UNPKG

2.23 MBSource Map (JSON)View Raw
1{"version":3,"file":"vis-network.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/path.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/native-symbol.js","../node_modules/core-js-pure/internals/use-symbol-as-uid.js","../node_modules/core-js-pure/internals/is-symbol.js","../node_modules/core-js-pure/internals/ordinary-to-primitive.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/to-object.js","../node_modules/core-js-pure/internals/has.js","../node_modules/core-js-pure/internals/uid.js","../node_modules/core-js-pure/internals/well-known-symbol.js","../node_modules/core-js-pure/internals/to-primitive.js","../node_modules/core-js-pure/internals/to-property-key.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/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/to-integer.js","../node_modules/core-js-pure/internals/to-length.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-get-own-property-symbols.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/internals/function-bind.js","../node_modules/core-js-pure/modules/es.function.bind.js","../node_modules/core-js-pure/internals/entry-virtual.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","../lib/network/shapes.ts","../node_modules/component-emitter/index.js","../node_modules/core-js-pure/internals/to-string.js","../node_modules/core-js-pure/internals/string-multibyte.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/shared-key.js","../node_modules/core-js-pure/internals/internal-state.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/object-define-properties.js","../node_modules/core-js-pure/internals/html.js","../node_modules/core-js-pure/internals/object-create.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/iterators.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/redefine.js","../node_modules/core-js-pure/internals/define-iterator.js","../node_modules/core-js-pure/modules/es.string.iterator.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/create-property.js","../node_modules/core-js-pure/internals/get-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/modules/es.array.iterator.js","../node_modules/core-js-pure/es/get-iterator-method.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/stable/get-iterator-method.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/is-array.js","../node_modules/core-js-pure/internals/object-get-own-property-names.js","../node_modules/core-js-pure/internals/object-get-own-property-names-external.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/array-species-constructor.js","../node_modules/core-js-pure/internals/array-species-create.js","../node_modules/core-js-pure/internals/array-iteration.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/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/own-keys.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.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/modules/es.object.define-property.js","../node_modules/core-js-pure/es/object/define-property.js","../node_modules/core-js-pure/stable/object/define-property.js","../node_modules/@babel/runtime-corejs3/core-js-stable/object/define-property.js","../node_modules/@babel/runtime-corejs3/helpers/classCallCheck.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","../node_modules/@babel/runtime-corejs3/helpers/defineProperty.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/stable/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/array-method-has-species-support.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/stable/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.matcher.js","../node_modules/core-js-pure/modules/esnext.symbol.metadata.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/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/stable/instance/slice.js","../node_modules/core-js-pure/features/instance/slice.js","../node_modules/@babel/runtime-corejs3/core-js/instance/slice.js","../node_modules/core-js-pure/features/array/from.js","../node_modules/@babel/runtime-corejs3/core-js/array/from.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/es/symbol/iterator.js","../node_modules/core-js-pure/stable/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/@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/@babel/runtime-corejs3/core-js-stable/symbol.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/@babel/runtime-corejs3/core-js-stable/instance/slice.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/@babel/runtime-corejs3/core-js-stable/array/is-array.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.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/modules/es.date.now.js","../node_modules/core-js-pure/es/date/now.js","../node_modules/core-js-pure/stable/date/now.js","../node_modules/@babel/runtime-corejs3/core-js-stable/date/now.js","../node_modules/core-js-pure/internals/array-method-is-strict.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.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/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.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/es/instance/includes.js","../node_modules/core-js-pure/stable/instance/includes.js","../node_modules/@babel/runtime-corejs3/core-js-stable/instance/includes.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/stable/object/get-prototype-of.js","../node_modules/@babel/runtime-corejs3/core-js-stable/object/get-prototype-of.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/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/stable/object/values.js","../node_modules/@babel/runtime-corejs3/core-js-stable/object/values.js","../node_modules/core-js-pure/internals/whitespaces.js","../node_modules/core-js-pure/internals/string-trim.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/es/parse-int.js","../node_modules/core-js-pure/stable/parse-int.js","../node_modules/@babel/runtime-corejs3/core-js-stable/parse-int.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/es/instance/index-of.js","../node_modules/core-js-pure/stable/instance/index-of.js","../node_modules/@babel/runtime-corejs3/core-js-stable/instance/index-of.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/es/instance/trim.js","../node_modules/core-js-pure/stable/instance/trim.js","../node_modules/@babel/runtime-corejs3/core-js-stable/instance/trim.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/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/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/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/es/instance/fill.js","../node_modules/core-js-pure/stable/instance/fill.js","../node_modules/@babel/runtime-corejs3/core-js-stable/instance/fill.js","../node_modules/@egjs/hammerjs/dist/hammer.esm.js","../node_modules/vis-util/esnext/esm/vis-util.js","../lib/network/dotparser.js","../lib/network/gephiParser.ts","../lib/network/locales.ts","../lib/network/locale-utils.ts","../lib/network/CachedImage.js","../lib/network/Images.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","../lib/network/modules/Groups.js","../node_modules/core-js-pure/modules/es.number.is-nan.js","../node_modules/core-js-pure/es/number/is-nan.js","../node_modules/core-js-pure/stable/number/is-nan.js","../node_modules/@babel/runtime-corejs3/core-js-stable/number/is-nan.js","../node_modules/core-js-pure/internals/number-is-finite.js","../node_modules/core-js-pure/modules/es.number.is-finite.js","../node_modules/core-js-pure/es/number/is-finite.js","../node_modules/core-js-pure/stable/number/is-finite.js","../node_modules/@babel/runtime-corejs3/core-js-stable/number/is-finite.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/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/@babel/runtime-corejs3/helpers/assertThisInitialized.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/stable/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/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/regenerator-runtime/runtime.js","../node_modules/@babel/runtime-corejs3/regenerator/index.js","../node_modules/core-js-pure/internals/array-reduce.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/flatten-into-array.js","../node_modules/core-js-pure/modules/es.array.flat-map.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/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","../node_modules/@babel/runtime-corejs3/core-js-stable/symbol/iterator.js","../node_modules/core-js-pure/internals/get-iterator.js","../node_modules/core-js-pure/es/get-iterator.js","../node_modules/core-js-pure/stable/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/internals/array-sort.js","../node_modules/core-js-pure/internals/engine-ff-version.js","../node_modules/core-js-pure/internals/engine-is-ie-or-edge.js","../node_modules/core-js-pure/internals/engine-webkit-version.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/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/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/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","../node_modules/vis-data/esnext/esm/vis-data.js","../node_modules/core-js-pure/internals/number-parse-float.js","../node_modules/core-js-pure/modules/es.parse-float.js","../node_modules/core-js-pure/es/parse-float.js","../node_modules/core-js-pure/stable/parse-float.js","../node_modules/@babel/runtime-corejs3/core-js-stable/parse-float.js","../node_modules/core-js-pure/modules/es.object.get-own-property-names.js","../node_modules/core-js-pure/es/object/get-own-property-names.js","../node_modules/core-js-pure/stable/object/get-own-property-names.js","../node_modules/@babel/runtime-corejs3/core-js-stable/object/get-own-property-names.js","../lib/network/modules/components/shared/ComponentUtil.js","../lib/network/modules/components/shared/LabelAccumulator.js","../lib/network/modules/components/shared/LabelSplitter.js","../lib/network/modules/components/shared/Label.js","../lib/network/modules/components/nodes/util/NodeBase.js","../lib/network/modules/components/nodes/shapes/Box.js","../lib/network/modules/components/nodes/util/CircleImageBase.js","../lib/network/modules/components/nodes/shapes/Circle.js","../lib/network/modules/components/nodes/shapes/CircularImage.js","../lib/network/modules/components/nodes/util/ShapeBase.js","../lib/network/modules/components/nodes/shapes/CustomShape.js","../lib/network/modules/components/nodes/shapes/Database.js","../lib/network/modules/components/nodes/shapes/Diamond.js","../lib/network/modules/components/nodes/shapes/Dot.js","../lib/network/modules/components/nodes/shapes/Ellipse.js","../lib/network/modules/components/nodes/shapes/Icon.js","../lib/network/modules/components/nodes/shapes/Image.js","../lib/network/modules/components/nodes/shapes/Square.js","../lib/network/modules/components/nodes/shapes/Hexagon.js","../lib/network/modules/components/nodes/shapes/Star.js","../lib/network/modules/components/nodes/shapes/Text.js","../lib/network/modules/components/nodes/shapes/Triangle.js","../lib/network/modules/components/nodes/shapes/TriangleDown.js","../lib/network/modules/components/Node.js","../lib/network/modules/NodesHandler.js","../node_modules/core-js-pure/modules/es.reflect.get.js","../node_modules/core-js-pure/es/reflect/get.js","../node_modules/core-js-pure/stable/reflect/get.js","../node_modules/core-js-pure/features/reflect/get.js","../node_modules/@babel/runtime-corejs3/core-js/reflect/get.js","../node_modules/core-js-pure/features/object/get-own-property-descriptor.js","../node_modules/@babel/runtime-corejs3/core-js/object/get-own-property-descriptor.js","../node_modules/@babel/runtime-corejs3/helpers/superPropBase.js","../node_modules/@babel/runtime-corejs3/helpers/get.js","../node_modules/core-js-pure/modules/es.math.hypot.js","../node_modules/core-js-pure/es/math/hypot.js","../node_modules/core-js-pure/stable/math/hypot.js","../node_modules/@babel/runtime-corejs3/core-js-stable/math/hypot.js","../lib/network/modules/components/edges/util/end-points.ts","../lib/network/modules/components/edges/util/edge-base.ts","../lib/network/modules/components/edges/util/bezier-edge-base.ts","../lib/network/modules/components/edges/bezier-edge-dynamic.ts","../lib/network/modules/components/edges/bezier-edge-static.ts","../lib/network/modules/components/edges/util/cubic-bezier-edge-base.ts","../lib/network/modules/components/edges/cubic-bezier-edge.ts","../lib/network/modules/components/edges/straight-edge.ts","../lib/network/modules/components/Edge.js","../lib/network/modules/EdgesHandler.js","../lib/network/modules/components/physics/BarnesHutSolver.js","../lib/network/modules/components/physics/RepulsionSolver.js","../lib/network/modules/components/physics/HierarchicalRepulsionSolver.js","../lib/network/modules/components/physics/SpringSolver.js","../lib/network/modules/components/physics/HierarchicalSpringSolver.js","../lib/network/modules/components/physics/CentralGravitySolver.js","../lib/network/modules/components/physics/FA2BasedRepulsionSolver.js","../lib/network/modules/components/physics/FA2BasedCentralGravitySolver.js","../lib/network/modules/PhysicsEngine.js","../lib/network/NetworkUtil.js","../lib/network/modules/components/nodes/Cluster.js","../lib/network/modules/Clustering.js","../lib/network/modules/CanvasRenderer.js","../node_modules/core-js-pure/stable/set-interval.js","../node_modules/@babel/runtime-corejs3/core-js-stable/set-interval.js","../lib/hammerUtil.js","../lib/network/modules/Canvas.js","../lib/network/modules/view-handler/index.ts","../lib/network/modules/View.js","../node_modules/keycharm/src/keycharm.js","../lib/network/modules/components/NavigationHandler.js","../lib/network/modules/InteractionHandler.js","../node_modules/core-js-pure/internals/collection-weak.js","../node_modules/core-js-pure/modules/es.weak-map.js","../node_modules/core-js-pure/es/weak-map/index.js","../node_modules/core-js-pure/stable/weak-map/index.js","../node_modules/@babel/runtime-corejs3/core-js-stable/weak-map.js","../node_modules/tslib/tslib.es6.js","../lib/network/modules/selection/selection-accumulator.ts","../lib/network/modules/SelectionHandler.js","../node_modules/timsort/build/timsort.js","../node_modules/timsort/index.js","../lib/network/modules/components/DirectionStrategy.js","../node_modules/core-js-pure/modules/es.array.every.js","../node_modules/core-js-pure/es/array/virtual/every.js","../node_modules/core-js-pure/es/instance/every.js","../node_modules/core-js-pure/stable/instance/every.js","../node_modules/@babel/runtime-corejs3/core-js-stable/instance/every.js","../lib/network/modules/layout-engine/index.ts","../lib/network/modules/LayoutEngine.js","../lib/network/modules/ManipulationSystem.js","../lib/network/options.ts","../lib/network/modules/components/algorithms/FloydWarshall.js","../lib/network/modules/KamadaKawai.js","../lib/network/Network.js","../lib/DOMutil.js","../lib/index-legacy.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 es/no-global-this -- safe\n check(typeof globalThis == 'object' && globalThis) ||\n check(typeof window == 'object' && window) ||\n // eslint-disable-next-line no-restricted-globals -- safe\n check(typeof self == 'object' && self) ||\n check(typeof global == 'object' && global) ||\n // eslint-disable-next-line no-new-func -- fallback\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// Detect IE8's incomplete defineProperty implementation\nmodule.exports = !fails(function () {\n // eslint-disable-next-line es/no-object-defineproperty -- required for testing\n return Object.defineProperty({}, 1, { get: function () { return 7; } })[1] != 7;\n});\n","'use strict';\nvar $propertyIsEnumerable = {}.propertyIsEnumerable;\n// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe\nvar getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;\n\n// Nashorn ~ JDK8 bug\nvar NASHORN_BUG = getOwnPropertyDescriptor && !$propertyIsEnumerable.call({ 1: 2 }, 1);\n\n// `Object.prototype.propertyIsEnumerable` method implementation\n// https://tc39.es/ecma262/#sec-object.prototype.propertyisenumerable\nexports.f = NASHORN_BUG ? function propertyIsEnumerable(V) {\n var descriptor = getOwnPropertyDescriptor(this, V);\n return !!descriptor && descriptor.enumerable;\n} : $propertyIsEnumerable;\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 -- safe\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.es/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","module.exports = {};\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 Deno = global.Deno;\nvar versions = process && process.versions || Deno && Deno.version;\nvar v8 = versions && versions.v8;\nvar match, version;\n\nif (v8) {\n match = v8.split('.');\n version = match[0] < 4 ? 1 : 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","/* eslint-disable es/no-symbol -- required for testing */\nvar V8_VERSION = require('../internals/engine-v8-version');\nvar fails = require('../internals/fails');\n\n// eslint-disable-next-line es/no-object-getownpropertysymbols -- required for testing\nmodule.exports = !!Object.getOwnPropertySymbols && !fails(function () {\n var symbol = Symbol();\n // Chrome 38 Symbol has incorrect toString conversion\n // `get-own-property-symbols` polyfill symbols converted to object are not Symbol instances\n return !String(symbol) || !(Object(symbol) instanceof Symbol) ||\n // Chrome 38-40 symbols are not inherited from DOM collections prototypes to instances\n !Symbol.sham && V8_VERSION && V8_VERSION < 41;\n});\n","/* eslint-disable es/no-symbol -- required for testing */\nvar NATIVE_SYMBOL = require('../internals/native-symbol');\n\nmodule.exports = NATIVE_SYMBOL\n && !Symbol.sham\n && typeof Symbol.iterator == 'symbol';\n","var getBuiltIn = require('../internals/get-built-in');\nvar USE_SYMBOL_AS_UID = require('../internals/use-symbol-as-uid');\n\nmodule.exports = USE_SYMBOL_AS_UID ? function (it) {\n return typeof it == 'symbol';\n} : function (it) {\n var $Symbol = getBuiltIn('Symbol');\n return typeof $Symbol == 'function' && Object(it) instanceof $Symbol;\n};\n","var isObject = require('../internals/is-object');\n\n// `OrdinaryToPrimitive` abstract operation\n// https://tc39.es/ecma262/#sec-ordinarytoprimitive\nmodule.exports = function (input, pref) {\n var fn, val;\n if (pref === '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 (pref !== '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 global = require('../internals/global');\n\nmodule.exports = function (key, value) {\n try {\n // eslint-disable-next-line es/no-object-defineproperty -- safe\n Object.defineProperty(global, key, { value: value, configurable: true, writable: true });\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.16.1',\n mode: IS_PURE ? 'pure' : 'global',\n copyright: '© 2021 Denis Pushkarev (zloirock.ru)'\n});\n","var requireObjectCoercible = require('../internals/require-object-coercible');\n\n// `ToObject` abstract operation\n// https://tc39.es/ecma262/#sec-toobject\nmodule.exports = function (argument) {\n return Object(requireObjectCoercible(argument));\n};\n","var toObject = require('../internals/to-object');\n\nvar hasOwnProperty = {}.hasOwnProperty;\n\nmodule.exports = Object.hasOwn || function hasOwn(it, key) {\n return hasOwnProperty.call(toObject(it), key);\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 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) || !(NATIVE_SYMBOL || typeof WellKnownSymbolsStore[name] == 'string')) {\n if (NATIVE_SYMBOL && has(Symbol, name)) {\n WellKnownSymbolsStore[name] = Symbol[name];\n } else {\n WellKnownSymbolsStore[name] = createWellKnownSymbol('Symbol.' + name);\n }\n } return WellKnownSymbolsStore[name];\n};\n","var isObject = require('../internals/is-object');\nvar isSymbol = require('../internals/is-symbol');\nvar ordinaryToPrimitive = require('../internals/ordinary-to-primitive');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\n\nvar TO_PRIMITIVE = wellKnownSymbol('toPrimitive');\n\n// `ToPrimitive` abstract operation\n// https://tc39.es/ecma262/#sec-toprimitive\nmodule.exports = function (input, pref) {\n if (!isObject(input) || isSymbol(input)) return input;\n var exoticToPrim = input[TO_PRIMITIVE];\n var result;\n if (exoticToPrim !== undefined) {\n if (pref === undefined) pref = 'default';\n result = exoticToPrim.call(input, pref);\n if (!isObject(result) || isSymbol(result)) return result;\n throw TypeError(\"Can't convert object to primitive value\");\n }\n if (pref === undefined) pref = 'number';\n return ordinaryToPrimitive(input, pref);\n};\n","var toPrimitive = require('../internals/to-primitive');\nvar isSymbol = require('../internals/is-symbol');\n\n// `ToPropertyKey` abstract operation\n// https://tc39.es/ecma262/#sec-topropertykey\nmodule.exports = function (argument) {\n var key = toPrimitive(argument, 'string');\n return isSymbol(key) ? key : String(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 // eslint-disable-next-line es/no-object-defineproperty -- requied for testing\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 toPropertyKey = require('../internals/to-property-key');\nvar has = require('../internals/has');\nvar IE8_DOM_DEFINE = require('../internals/ie8-dom-define');\n\n// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe\nvar $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;\n\n// `Object.getOwnPropertyDescriptor` method\n// https://tc39.es/ecma262/#sec-object.getownpropertydescriptor\nexports.f = DESCRIPTORS ? $getOwnPropertyDescriptor : function getOwnPropertyDescriptor(O, P) {\n O = toIndexedObject(O);\n P = toPropertyKey(P);\n if (IE8_DOM_DEFINE) try {\n return $getOwnPropertyDescriptor(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 = 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 toPropertyKey = require('../internals/to-property-key');\n\n// eslint-disable-next-line es/no-object-defineproperty -- safe\nvar $defineProperty = Object.defineProperty;\n\n// `Object.defineProperty` method\n// https://tc39.es/ecma262/#sec-object.defineproperty\nexports.f = DESCRIPTORS ? $defineProperty : function defineProperty(O, P, Attributes) {\n anObject(O);\n P = toPropertyKey(P);\n anObject(Attributes);\n if (IE8_DOM_DEFINE) try {\n return $defineProperty(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 ceil = Math.ceil;\nvar floor = Math.floor;\n\n// `ToInteger` abstract operation\n// https://tc39.es/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.es/ecma262/#sec-tolength\nmodule.exports = function (argument) {\n return argument > 0 ? min(toInteger(argument), 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991\n};\n","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 -- NaN check\n if (IS_INCLUDES && el != el) while (length > index) {\n value = O[index++];\n // eslint-disable-next-line no-self-compare -- NaN check\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.es/ecma262/#sec-array.prototype.includes\n includes: createMethod(true),\n // `Array.prototype.indexOf` method\n // https://tc39.es/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.es/ecma262/#sec-object.keys\n// eslint-disable-next-line es/no-object-keys -- safe\nmodule.exports = Object.keys || function keys(O) {\n return internalObjectKeys(O, enumBugKeys);\n};\n","// eslint-disable-next-line es/no-object-getownpropertysymbols -- safe\nexports.f = Object.getOwnPropertySymbols;\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\n// eslint-disable-next-line es/no-object-assign -- safe\nvar $assign = Object.assign;\n// eslint-disable-next-line es/no-object-defineproperty -- required for testing\nvar defineProperty = Object.defineProperty;\n\n// `Object.assign` method\n// https://tc39.es/ecma262/#sec-object.assign\nmodule.exports = !$assign || fails(function () {\n // should have correct order of operations (Edge bug)\n if (DESCRIPTORS && $assign({ b: 1 }, $assign(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 es/no-symbol -- safe\n var symbol = Symbol();\n var alphabet = 'abcdefghijklmnopqrst';\n A[symbol] = 7;\n alphabet.split('').forEach(function (chr) { B[chr] = chr; });\n return $assign({}, A)[symbol] != 7 || objectKeys($assign({}, B)).join('') != alphabet;\n}) ? function assign(target, source) { // eslint-disable-line no-unused-vars -- required for `.length`\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} : $assign;\n","var $ = require('../internals/export');\nvar assign = require('../internals/object-assign');\n\n// `Object.assign` method\n// https://tc39.es/ecma262/#sec-object.assign\n// eslint-disable-next-line es/no-object-assign -- required for testing\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 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 -- we have no proper alternatives, IE8- only\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.es/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.es/ecma262/#sec-function.prototype.bind\n$({ target: 'Function', proto: true }, {\n bind: bind\n});\n","var path = require('../internals/path');\n\nmodule.exports = function (CONSTRUCTOR) {\n return path[CONSTRUCTOR + 'Prototype'];\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\");","/**\n * Draw a circle.\n *\n * @param ctx - The context this shape will be rendered to.\n * @param x - The position of the center on the x axis.\n * @param y - The position of the center on the y axis.\n * @param r - The radius of the circle.\n */\nexport function drawCircle(\n ctx: CanvasRenderingContext2D,\n x: number,\n y: number,\n r: number\n): void {\n ctx.beginPath();\n ctx.arc(x, y, r, 0, 2 * Math.PI, false);\n ctx.closePath();\n}\n\n/**\n * Draw a square.\n *\n * @param ctx - The context this shape will be rendered to.\n * @param x - The position of the center on the x axis.\n * @param y - The position of the center on the y axis.\n * @param r - Half of the width and height of the square.\n */\nexport function drawSquare(\n ctx: CanvasRenderingContext2D,\n x: number,\n y: number,\n r: number\n): void {\n ctx.beginPath();\n ctx.rect(x - r, y - r, r * 2, r * 2);\n ctx.closePath();\n}\n\n/**\n * Draw an equilateral triangle standing on a side.\n *\n * @param ctx - The context this shape will be rendered to.\n * @param x - The position of the center on the x axis.\n * @param y - The position of the center on the y axis.\n * @param r - Half of the length of the sides.\n *\n * @remarks\n * http://en.wikipedia.org/wiki/Equilateral_triangle\n */\nexport function drawTriangle(\n ctx: CanvasRenderingContext2D,\n x: number,\n y: number,\n r: number\n): void {\n ctx.beginPath();\n\n // the change in radius and the offset is here to center the shape\n r *= 1.15;\n y += 0.275 * r;\n\n const s = r * 2;\n const s2 = s / 2;\n const ir = (Math.sqrt(3) / 6) * s; // radius of inner circle\n const h = Math.sqrt(s * s - s2 * s2); // height\n\n ctx.moveTo(x, y - (h - ir));\n ctx.lineTo(x + s2, y + ir);\n ctx.lineTo(x - s2, y + ir);\n ctx.lineTo(x, y - (h - ir));\n ctx.closePath();\n}\n\n/**\n * Draw an equilateral triangle standing on a vertex.\n *\n * @param ctx - The context this shape will be rendered to.\n * @param x - The position of the center on the x axis.\n * @param y - The position of the center on the y axis.\n * @param r - Half of the length of the sides.\n *\n * @remarks\n * http://en.wikipedia.org/wiki/Equilateral_triangle\n */\nexport function drawTriangleDown(\n ctx: CanvasRenderingContext2D,\n x: number,\n y: number,\n r: number\n): void {\n ctx.beginPath();\n\n // the change in radius and the offset is here to center the shape\n r *= 1.15;\n y -= 0.275 * r;\n\n const s = r * 2;\n const s2 = s / 2;\n const ir = (Math.sqrt(3) / 6) * s; // radius of inner circle\n const h = Math.sqrt(s * s - s2 * s2); // height\n\n ctx.moveTo(x, y + (h - ir));\n ctx.lineTo(x + s2, y - ir);\n ctx.lineTo(x - s2, y - ir);\n ctx.lineTo(x, y + (h - ir));\n ctx.closePath();\n}\n\n/**\n * Draw a star.\n *\n * @param ctx - The context this shape will be rendered to.\n * @param x - The position of the center on the x axis.\n * @param y - The position of the center on the y axis.\n * @param r - The outer radius of the star.\n */\nexport function drawStar(\n ctx: CanvasRenderingContext2D,\n x: number,\n y: number,\n r: number\n): void {\n // http://www.html5canvastutorials.com/labs/html5-canvas-star-spinner/\n ctx.beginPath();\n\n // the change in radius and the offset is here to center the shape\n r *= 0.82;\n y += 0.1 * r;\n\n for (let n = 0; n < 10; n++) {\n const radius = n % 2 === 0 ? r * 1.3 : r * 0.5;\n ctx.lineTo(\n x + radius * Math.sin((n * 2 * Math.PI) / 10),\n y - radius * Math.cos((n * 2 * Math.PI) / 10)\n );\n }\n\n ctx.closePath();\n}\n\n/**\n * Draw a diamond.\n *\n * @param ctx - The context this shape will be rendered to.\n * @param x - The position of the center on the x axis.\n * @param y - The position of the center on the y axis.\n * @param r - Half of the width and height of the diamond.\n *\n * @remarks\n * http://www.html5canvastutorials.com/labs/html5-canvas-star-spinner/\n */\nexport function drawDiamond(\n ctx: CanvasRenderingContext2D,\n x: number,\n y: number,\n r: number\n): void {\n ctx.beginPath();\n\n ctx.lineTo(x, y + r);\n ctx.lineTo(x + r, y);\n ctx.lineTo(x, y - r);\n ctx.lineTo(x - r, y);\n\n ctx.closePath();\n}\n\n/**\n * Draw a rectangle with rounded corners.\n *\n * @param ctx - The context this shape will be rendered to.\n * @param x - The position of the center on the x axis.\n * @param y - The position of the center on the y axis.\n * @param w - The width of the rectangle.\n * @param h - The height of the rectangle.\n * @param r - The radius of the corners.\n *\n * @remarks\n * http://stackoverflow.com/questions/1255512/how-to-draw-a-rounded-rectangle-on-html-canvas\n */\nexport function drawRoundRect(\n ctx: CanvasRenderingContext2D,\n x: number,\n y: number,\n w: number,\n h: number,\n r: number\n): void {\n const r2d = Math.PI / 180;\n if (w - 2 * r < 0) {\n r = w / 2;\n } //ensure that the radius isn't too large for x\n if (h - 2 * r < 0) {\n r = h / 2;\n } //ensure that the radius isn't too large for y\n ctx.beginPath();\n ctx.moveTo(x + r, y);\n ctx.lineTo(x + w - r, y);\n ctx.arc(x + w - r, y + r, r, r2d * 270, r2d * 360, false);\n ctx.lineTo(x + w, y + h - r);\n ctx.arc(x + w - r, y + h - r, r, 0, r2d * 90, false);\n ctx.lineTo(x + r, y + h);\n ctx.arc(x + r, y + h - r, r, r2d * 90, r2d * 180, false);\n ctx.lineTo(x, y + r);\n ctx.arc(x + r, y + r, r, r2d * 180, r2d * 270, false);\n ctx.closePath();\n}\n\n/**\n * Draw an ellipse.\n *\n * @param ctx - The context this shape will be rendered to.\n * @param x - The position of the center on the x axis.\n * @param y - The position of the center on the y axis.\n * @param w - The width of the ellipse.\n * @param h - The height of the ellipse.\n *\n * @remarks\n * http://stackoverflow.com/questions/2172798/how-to-draw-an-oval-in-html5-canvas\n *\n * Postfix '_vis' added to discern it from standard method ellipse().\n */\nexport function drawEllipse(\n ctx: CanvasRenderingContext2D,\n x: number,\n y: number,\n w: number,\n h: number\n): void {\n const kappa = 0.5522848,\n ox = (w / 2) * kappa, // control point offset horizontal\n oy = (h / 2) * kappa, // control point offset vertical\n xe = x + w, // x-end\n ye = y + h, // y-end\n xm = x + w / 2, // x-middle\n ym = y + h / 2; // y-middle\n\n ctx.beginPath();\n ctx.moveTo(x, ym);\n ctx.bezierCurveTo(x, ym - oy, xm - ox, y, xm, y);\n ctx.bezierCurveTo(xm + ox, y, xe, ym - oy, xe, ym);\n ctx.bezierCurveTo(xe, ym + oy, xm + ox, ye, xm, ye);\n ctx.bezierCurveTo(xm - ox, ye, x, ym + oy, x, ym);\n ctx.closePath();\n}\n\n/**\n * Draw an isometric cylinder.\n *\n * @param ctx - The context this shape will be rendered to.\n * @param x - The position of the center on the x axis.\n * @param y - The position of the center on the y axis.\n * @param w - The width of the database.\n * @param h - The height of the database.\n *\n * @remarks\n * http://stackoverflow.com/questions/2172798/how-to-draw-an-oval-in-html5-canvas\n */\nexport function drawDatabase(\n ctx: CanvasRenderingContext2D,\n x: number,\n y: number,\n w: number,\n h: number\n): void {\n const f = 1 / 3;\n const wEllipse = w;\n const hEllipse = h * f;\n\n const kappa = 0.5522848,\n ox = (wEllipse / 2) * kappa, // control point offset horizontal\n oy = (hEllipse / 2) * kappa, // control point offset vertical\n xe = x + wEllipse, // x-end\n ye = y + hEllipse, // y-end\n xm = x + wEllipse / 2, // x-middle\n ym = y + hEllipse / 2, // y-middle\n ymb = y + (h - hEllipse / 2), // y-midlle, bottom ellipse\n yeb = y + h; // y-end, bottom ellipse\n\n ctx.beginPath();\n ctx.moveTo(xe, ym);\n\n ctx.bezierCurveTo(xe, ym + oy, xm + ox, ye, xm, ye);\n ctx.bezierCurveTo(xm - ox, ye, x, ym + oy, x, ym);\n\n ctx.bezierCurveTo(x, ym - oy, xm - ox, y, xm, y);\n ctx.bezierCurveTo(xm + ox, y, xe, ym - oy, xe, ym);\n\n ctx.lineTo(xe, ymb);\n\n ctx.bezierCurveTo(xe, ymb + oy, xm + ox, yeb, xm, yeb);\n ctx.bezierCurveTo(xm - ox, yeb, x, ymb + oy, x, ymb);\n\n ctx.lineTo(x, ym);\n}\n\n/**\n * Draw a dashed line.\n *\n * @param ctx - The context this shape will be rendered to.\n * @param x - The start position on the x axis.\n * @param y - The start position on the y axis.\n * @param x2 - The end position on the x axis.\n * @param y2 - The end position on the y axis.\n * @param pattern - List of lengths starting with line and then alternating between space and line.\n *\n * @author David Jordan\n * @remarks\n * date 2012-08-08\n * http://stackoverflow.com/questions/4576724/dotted-stroke-in-canvas\n */\nexport function drawDashedLine(\n ctx: CanvasRenderingContext2D,\n x: number,\n y: number,\n x2: number,\n y2: number,\n pattern: number[]\n): void {\n ctx.beginPath();\n ctx.moveTo(x, y);\n\n const patternLength = pattern.length;\n const dx = x2 - x;\n const dy = y2 - y;\n const slope = dy / dx;\n let distRemaining = Math.sqrt(dx * dx + dy * dy);\n let patternIndex = 0;\n let draw = true;\n let xStep = 0;\n let dashLength = +pattern[0];\n\n while (distRemaining >= 0.1) {\n dashLength = +pattern[patternIndex++ % patternLength];\n if (dashLength > distRemaining) {\n dashLength = distRemaining;\n }\n\n xStep = Math.sqrt((dashLength * dashLength) / (1 + slope * slope));\n xStep = dx < 0 ? -xStep : xStep;\n x += xStep;\n y += slope * xStep;\n\n if (draw === true) {\n ctx.lineTo(x, y);\n } else {\n ctx.moveTo(x, y);\n }\n\n distRemaining -= dashLength;\n draw = !draw;\n }\n}\n\n/**\n * Draw a hexagon.\n *\n * @param ctx - The context this shape will be rendered to.\n * @param x - The position of the center on the x axis.\n * @param y - The position of the center on the y axis.\n * @param r - The radius of the hexagon.\n */\nexport function drawHexagon(\n ctx: CanvasRenderingContext2D,\n x: number,\n y: number,\n r: number\n): void {\n ctx.beginPath();\n const sides = 6;\n const a = (Math.PI * 2) / sides;\n ctx.moveTo(x + r, y);\n for (let i = 1; i < sides; i++) {\n ctx.lineTo(x + r * Math.cos(a * i), y + r * Math.sin(a * i));\n }\n ctx.closePath();\n}\n\nconst shapeMap = {\n circle: drawCircle,\n dashedLine: drawDashedLine,\n database: drawDatabase,\n diamond: drawDiamond,\n ellipse: drawEllipse,\n ellipse_vis: drawEllipse,\n hexagon: drawHexagon,\n roundRect: drawRoundRect,\n square: drawSquare,\n star: drawStar,\n triangle: drawTriangle,\n triangleDown: drawTriangleDown,\n};\n\n/**\n * Returns either custom or native drawing function base on supplied name.\n *\n * @param name - The name of the function. Either the name of a\n * CanvasRenderingContext2D property or an export from shapes.ts without the\n * draw prefix.\n *\n * @returns The function that can be used for rendering. In case of native\n * CanvasRenderingContext2D function the API is normalized to\n * `(ctx: CanvasRenderingContext2D, ...originalArgs) => void`.\n */\nexport function getShape(\n name: keyof CanvasRenderingContext2D | keyof typeof shapeMap\n): any {\n if (Object.prototype.hasOwnProperty.call(shapeMap, name)) {\n return (shapeMap as any)[name];\n } else {\n return function (ctx: CanvasRenderingContext2D, ...args: any[]): void {\n (CanvasRenderingContext2D.prototype as any)[name].call(ctx, args);\n };\n }\n}\n","\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","var isSymbol = require('../internals/is-symbol');\n\nmodule.exports = function (argument) {\n if (isSymbol(argument)) throw TypeError('Cannot convert a Symbol value to a string');\n return String(argument);\n};\n","var toInteger = require('../internals/to-integer');\nvar toString = require('../internals/to-string');\nvar requireObjectCoercible = require('../internals/require-object-coercible');\n\n// `String.prototype.codePointAt` methods implementation\nvar createMethod = function (CONVERT_TO_STRING) {\n return function ($this, pos) {\n var S = toString(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.es/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","var store = require('../internals/shared-store');\n\nvar functionToString = Function.toString;\n\n// this helper broken in `core-js@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 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 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 OBJECT_ALREADY_INITIALIZED = 'Object already initialized';\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 || shared.state) {\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 if (wmhas.call(store, it)) throw new TypeError(OBJECT_ALREADY_INITIALIZED);\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 if (objectHas(it, STATE)) throw new TypeError(OBJECT_ALREADY_INITIALIZED);\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","var fails = require('../internals/fails');\n\nmodule.exports = !fails(function () {\n function F() { /* empty */ }\n F.prototype.constructor = null;\n // eslint-disable-next-line es/no-object-getprototypeof -- required for testing\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.es/ecma262/#sec-object.getprototypeof\n// eslint-disable-next-line es/no-object-getprototypeof -- safe\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 fails = require('../internals/fails');\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.es/ecma262/#sec-%iteratorprototype%-object\nvar IteratorPrototype, PrototypeOfArrayIteratorPrototype, arrayIterator;\n\n/* eslint-disable es/no-array-prototype-keys -- safe */\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\nvar NEW_ITERATOR_PROTOTYPE = IteratorPrototype == undefined || fails(function () {\n var test = {};\n // FF44- legacy iterators case\n return IteratorPrototype[ITERATOR].call(test) !== test;\n});\n\nif (NEW_ITERATOR_PROTOTYPE) IteratorPrototype = {};\n\n// `%IteratorPrototype%[@@iterator]()` method\n// https://tc39.es/ecma262/#sec-%iteratorprototype%-@@iterator\nif ((!IS_PURE || NEW_ITERATOR_PROTOTYPE) && !has(IteratorPrototype, ITERATOR)) {\n createNonEnumerableProperty(IteratorPrototype, ITERATOR, returnThis);\n}\n\nmodule.exports = {\n IteratorPrototype: IteratorPrototype,\n BUGGY_SAFARI_ITERATORS: BUGGY_SAFARI_ITERATORS\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.es/ecma262/#sec-object.defineproperties\n// eslint-disable-next-line es/no-object-defineproperties -- safe\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 getBuiltIn = require('../internals/get-built-in');\n\nmodule.exports = getBuiltIn('document', 'documentElement');\n","/* global ActiveXObject -- old IE, WSH */\nvar 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 if (iframe.style) {\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\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 activeXDocument = new ActiveXObject('htmlfile');\n } catch (error) { /* ignore */ }\n NullProtoObject = document.domain && activeXDocument ?\n NullProtoObjectViaActiveX(activeXDocument) : // old IE\n NullProtoObjectViaIFrame() ||\n NullProtoObjectViaActiveX(activeXDocument); // WSH\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.es/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 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.es/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","module.exports = {};\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","/* eslint-disable no-proto -- safe */\nvar anObject = require('../internals/an-object');\nvar aPossiblePrototype = require('../internals/a-possible-prototype');\n\n// `Object.setPrototypeOf` method\n// https://tc39.es/ecma262/#sec-object.setprototypeof\n// Works with __proto__ only. Old v8 can't work with null proto objects.\n// eslint-disable-next-line es/no-object-setprototypeof -- safe\nmodule.exports = Object.setPrototypeOf || ('__proto__' in {} ? function () {\n var CORRECT_SETTER = false;\n var test = {};\n var setter;\n try {\n // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe\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","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","'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.prototype.{ 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 charAt = require('../internals/string-multibyte').charAt;\nvar toString = require('../internals/to-string');\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.es/ecma262/#sec-string.prototype-@@iterator\ndefineIterator(String, 'String', function (iterated) {\n setInternalState(this, {\n type: STRING_ITERATOR,\n string: toString(iterated),\n index: 0\n });\n// `%StringIteratorPrototype%.next` method\n// https://tc39.es/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 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 } 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 toPropertyKey = require('../internals/to-property-key');\nvar definePropertyModule = require('../internals/object-define-property');\nvar createPropertyDescriptor = require('../internals/create-property-descriptor');\n\nmodule.exports = function (object, key, value) {\n var propertyKey = toPropertyKey(key);\n if (propertyKey in object) definePropertyModule.f(object, propertyKey, createPropertyDescriptor(0, value));\n else object[propertyKey] = value;\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","'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.es/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 es/no-array-from, no-throw-literal -- required for testing\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 // eslint-disable-next-line es/no-array-from -- required for testing\n Array.from(iterable);\n});\n\n// `Array.from` method\n// https://tc39.es/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 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.es/ecma262/#sec-array.prototype.entries\n// `Array.prototype.keys` method\n// https://tc39.es/ecma262/#sec-array.prototype.keys\n// `Array.prototype.values` method\n// https://tc39.es/ecma262/#sec-array.prototype.values\n// `Array.prototype[@@iterator]` method\n// https://tc39.es/ecma262/#sec-array.prototype-@@iterator\n// `CreateArrayIterator` internal method\n// https://tc39.es/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.es/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.es/ecma262/#sec-createunmappedargumentsobject\n// https://tc39.es/ecma262/#sec-createmappedargumentsobject\nIterators.Arguments = Iterators.Array;\n\n// https://tc39.es/ecma262/#sec-array.prototype-@@unscopables\naddToUnscopables('keys');\naddToUnscopables('values');\naddToUnscopables('entries');\n","require('../modules/es.array.iterator');\nrequire('../modules/es.string.iterator');\nvar getIteratorMethod = require('../internals/get-iterator-method');\n\nmodule.exports = getIteratorMethod;\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 parent = require('../es/get-iterator-method');\nrequire('../modules/web.dom-collections.iterator');\n\nmodule.exports = parent;\n","var parent = require('../stable/get-iterator-method');\n\nmodule.exports = parent;\n","module.exports = require(\"core-js-pure/features/get-iterator-method\");","var classof = require('../internals/classof-raw');\n\n// `IsArray` abstract operation\n// https://tc39.es/ecma262/#sec-isarray\n// eslint-disable-next-line es/no-array-isarray -- safe\nmodule.exports = Array.isArray || function isArray(arg) {\n return classof(arg) == 'Array';\n};\n","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.es/ecma262/#sec-object.getownpropertynames\n// eslint-disable-next-line es/no-object-getownpropertynames -- safe\nexports.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {\n return internalObjectKeys(O, hiddenKeys);\n};\n","/* eslint-disable es/no-object-getownpropertynames -- safe */\nvar toIndexedObject = require('../internals/to-indexed-object');\nvar $getOwnPropertyNames = 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 $getOwnPropertyNames(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 : $getOwnPropertyNames(toIndexedObject(it));\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 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// a part of `ArraySpeciesCreate` abstract operation\n// https://tc39.es/ecma262/#sec-arrayspeciescreate\nmodule.exports = function (originalArray) {\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 C === undefined ? Array : C;\n};\n","var arraySpeciesConstructor = require('../internals/array-species-constructor');\n\n// `ArraySpeciesCreate` abstract operation\n// https://tc39.es/ecma262/#sec-arrayspeciescreate\nmodule.exports = function (originalArray, length) {\n return new (arraySpeciesConstructor(originalArray))(length === 0 ? 0 : length);\n};\n","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, filterReject }` 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 IS_FILTER_REJECT = TYPE == 7;\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 || IS_FILTER_REJECT ? 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 switch (TYPE) {\n case 4: return false; // every\n case 7: push.call(target, value); // filterReject\n }\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.es/ecma262/#sec-array.prototype.foreach\n forEach: createMethod(0),\n // `Array.prototype.map` method\n // https://tc39.es/ecma262/#sec-array.prototype.map\n map: createMethod(1),\n // `Array.prototype.filter` method\n // https://tc39.es/ecma262/#sec-array.prototype.filter\n filter: createMethod(2),\n // `Array.prototype.some` method\n // https://tc39.es/ecma262/#sec-array.prototype.some\n some: createMethod(3),\n // `Array.prototype.every` method\n // https://tc39.es/ecma262/#sec-array.prototype.every\n every: createMethod(4),\n // `Array.prototype.find` method\n // https://tc39.es/ecma262/#sec-array.prototype.find\n find: createMethod(5),\n // `Array.prototype.findIndex` method\n // https://tc39.es/ecma262/#sec-array.prototype.findIndex\n findIndex: createMethod(6),\n // `Array.prototype.filterReject` method\n // https://github.com/tc39/proposal-array-filtering\n filterReject: createMethod(7)\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 fails = require('../internals/fails');\nvar has = require('../internals/has');\nvar isArray = require('../internals/is-array');\nvar isObject = require('../internals/is-object');\nvar isSymbol = require('../internals/is-symbol');\nvar anObject = require('../internals/an-object');\nvar toObject = require('../internals/to-object');\nvar toIndexedObject = require('../internals/to-indexed-object');\nvar toPropertyKey = require('../internals/to-property-key');\nvar $toString = require('../internals/to-string');\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 $defineProperty = function defineProperty(O, P, Attributes) {\n if (O === ObjectPrototype) $defineProperty(ObjectPrototypeSymbols, P, Attributes);\n anObject(O);\n var key = toPropertyKey(P);\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 = toPropertyKey(V);\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 = toPropertyKey(P);\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.es/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 : $toString(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.es/ecma262/#sec-symbol.for\n 'for': function (key) {\n var string = $toString(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.es/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.es/ecma262/#sec-object.create\n create: $create,\n // `Object.defineProperty` method\n // https://tc39.es/ecma262/#sec-object.defineproperty\n defineProperty: $defineProperty,\n // `Object.defineProperties` method\n // https://tc39.es/ecma262/#sec-object.defineproperties\n defineProperties: $defineProperties,\n // `Object.getOwnPropertyDescriptor` method\n // https://tc39.es/ecma262/#sec-object.getownpropertydescriptors\n getOwnPropertyDescriptor: $getOwnPropertyDescriptor\n});\n\n$({ target: 'Object', stat: true, forced: !NATIVE_SYMBOL }, {\n // `Object.getOwnPropertyNames` method\n // https://tc39.es/ecma262/#sec-object.getownpropertynames\n getOwnPropertyNames: $getOwnPropertyNames,\n // `Object.getOwnPropertySymbols` method\n // https://tc39.es/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.es/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 -- required for `.length`\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.es/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.es/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\");","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.es/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');\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","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.es/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 DESCRIPTORS = require('../internals/descriptors');\nvar defineProperties = require('../internals/object-define-properties');\n\n// `Object.defineProperties` method\n// https://tc39.es/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 $ = require('../internals/export');\nvar DESCRIPTORS = require('../internals/descriptors');\nvar objectDefinePropertyModile = require('../internals/object-define-property');\n\n// `Object.defineProperty` method\n// https://tc39.es/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/stable/object/define-property\");","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;\nmodule.exports[\"default\"] = module.exports, module.exports.__esModule = true;","var parent = require('../../stable/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;\nmodule.exports[\"default\"] = module.exports, module.exports.__esModule = true;","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;\nmodule.exports[\"default\"] = module.exports, module.exports.__esModule = true;","var $ = require('../internals/export');\nvar isArray = require('../internals/is-array');\n\n// `Array.isArray` method\n// https://tc39.es/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","var parent = require('../../stable/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;\nmodule.exports[\"default\"] = module.exports, module.exports.__esModule = true;","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","'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.es/ecma262/#sec-array.prototype.concat\n// with adding support of @@isConcatSpreadable and @@species\n$({ target: 'Array', proto: true, forced: FORCED }, {\n // eslint-disable-next-line no-unused-vars -- required for `.length`\n concat: function concat(arg) {\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.es/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.es/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.es/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.es/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.es/ecma262/#sec-symbol.match\ndefineWellKnownSymbol('match');\n","var defineWellKnownSymbol = require('../internals/define-well-known-symbol');\n\n// `Symbol.matchAll` well-known symbol\n// https://tc39.es/ecma262/#sec-symbol.matchall\ndefineWellKnownSymbol('matchAll');\n","var defineWellKnownSymbol = require('../internals/define-well-known-symbol');\n\n// `Symbol.replace` well-known symbol\n// https://tc39.es/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.es/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.es/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.es/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.es/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.es/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.es/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.es/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 parent = require('../../es/symbol');\nrequire('../../modules/web.dom-collections.iterator');\n\nmodule.exports = parent;\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.matcher` well-known symbol\n// https://github.com/tc39/proposal-pattern-matching\ndefineWellKnownSymbol('matcher');\n","var defineWellKnownSymbol = require('../internals/define-well-known-symbol');\n\n// `Symbol.metadata` well-known symbol\n// https://github.com/tc39/proposal-decorators\ndefineWellKnownSymbol('metadata');\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","// TODO: remove from `core-js@4`\nvar 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('../../stable/symbol');\nrequire('../../modules/esnext.symbol.async-dispose');\nrequire('../../modules/esnext.symbol.dispose');\nrequire('../../modules/esnext.symbol.matcher');\nrequire('../../modules/esnext.symbol.metadata');\nrequire('../../modules/esnext.symbol.observable');\n// TODO: Remove from `core-js@4`\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 _Symbol = require(\"@babel/runtime-corejs3/core-js/symbol\");\n\nvar _getIteratorMethod = require(\"@babel/runtime-corejs3/core-js/get-iterator-method\");\n\nfunction _iterableToArrayLimit(arr, i) {\n var _i = arr == null ? null : typeof _Symbol !== \"undefined\" && _getIteratorMethod(arr) || arr[\"@@iterator\"];\n\n if (_i == null) return;\n var _arr = [];\n var _n = true;\n var _d = false;\n\n var _s, _e;\n\n try {\n for (_i = _i.call(arr); !(_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;\nmodule.exports[\"default\"] = module.exports, module.exports.__esModule = true;","'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');\n\nvar HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('slice');\n\nvar SPECIES = wellKnownSymbol('species');\nvar nativeSlice = [].slice;\nvar max = Math.max;\n\n// `Array.prototype.slice` method\n// https://tc39.es/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 }, {\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","var parent = require('../../stable/instance/slice');\n\nmodule.exports = parent;\n","module.exports = require(\"core-js-pure/features/instance/slice\");","var parent = require('../../stable/array/from');\n\nmodule.exports = parent;\n","module.exports = require(\"core-js-pure/features/array/from\");","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;\nmodule.exports[\"default\"] = module.exports, module.exports.__esModule = true;","var _sliceInstanceProperty = require(\"@babel/runtime-corejs3/core-js/instance/slice\");\n\nvar _Array$from = require(\"@babel/runtime-corejs3/core-js/array/from\");\n\nvar arrayLikeToArray = require(\"./arrayLikeToArray.js\");\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;\nmodule.exports[\"default\"] = module.exports, module.exports.__esModule = true;","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;\nmodule.exports[\"default\"] = module.exports, module.exports.__esModule = true;","var arrayWithHoles = require(\"./arrayWithHoles.js\");\n\nvar iterableToArrayLimit = require(\"./iterableToArrayLimit.js\");\n\nvar unsupportedIterableToArray = require(\"./unsupportedIterableToArray.js\");\n\nvar nonIterableRest = require(\"./nonIterableRest.js\");\n\nfunction _slicedToArray(arr, i) {\n return arrayWithHoles(arr) || iterableToArrayLimit(arr, i) || unsupportedIterableToArray(arr, i) || nonIterableRest();\n}\n\nmodule.exports = _slicedToArray;\nmodule.exports[\"default\"] = module.exports, module.exports.__esModule = true;","require('../../modules/es.array.iterator');\nrequire('../../modules/es.object.to-string');\nrequire('../../modules/es.string.iterator');\nrequire('../../modules/es.symbol.iterator');\nvar WrappedWellKnownSymbolModule = require('../../internals/well-known-symbol-wrapped');\n\nmodule.exports = WrappedWellKnownSymbolModule.f('iterator');\n","var parent = require('../../es/symbol/iterator');\nrequire('../../modules/web.dom-collections.iterator');\n\nmodule.exports = parent;\n","var parent = require('../../stable/symbol/iterator');\n\nmodule.exports = parent;\n","module.exports = require(\"core-js-pure/features/symbol/iterator\");","var _Symbol = require(\"@babel/runtime-corejs3/core-js/symbol\");\n\nvar _Symbol$iterator = require(\"@babel/runtime-corejs3/core-js/symbol/iterator\");\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\n module.exports[\"default\"] = module.exports, module.exports.__esModule = true;\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 module.exports[\"default\"] = module.exports, module.exports.__esModule = true;\n }\n\n return _typeof(obj);\n}\n\nmodule.exports = _typeof;\nmodule.exports[\"default\"] = module.exports, module.exports.__esModule = true;","var _Array$isArray = require(\"@babel/runtime-corejs3/core-js/array/is-array\");\n\nvar arrayLikeToArray = require(\"./arrayLikeToArray.js\");\n\nfunction _arrayWithoutHoles(arr) {\n if (_Array$isArray(arr)) return arrayLikeToArray(arr);\n}\n\nmodule.exports = _arrayWithoutHoles;\nmodule.exports[\"default\"] = module.exports, module.exports.__esModule = true;","var _Symbol = require(\"@babel/runtime-corejs3/core-js/symbol\");\n\nvar _getIteratorMethod = require(\"@babel/runtime-corejs3/core-js/get-iterator-method\");\n\nvar _Array$from = require(\"@babel/runtime-corejs3/core-js/array/from\");\n\nfunction _iterableToArray(iter) {\n if (typeof _Symbol !== \"undefined\" && _getIteratorMethod(iter) != null || iter[\"@@iterator\"] != null) return _Array$from(iter);\n}\n\nmodule.exports = _iterableToArray;\nmodule.exports[\"default\"] = module.exports, module.exports.__esModule = true;","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;\nmodule.exports[\"default\"] = module.exports, module.exports.__esModule = true;","var arrayWithoutHoles = require(\"./arrayWithoutHoles.js\");\n\nvar iterableToArray = require(\"./iterableToArray.js\");\n\nvar unsupportedIterableToArray = require(\"./unsupportedIterableToArray.js\");\n\nvar nonIterableSpread = require(\"./nonIterableSpread.js\");\n\nfunction _toConsumableArray(arr) {\n return arrayWithoutHoles(arr) || iterableToArray(arr) || unsupportedIterableToArray(arr) || nonIterableSpread();\n}\n\nmodule.exports = _toConsumableArray;\nmodule.exports[\"default\"] = module.exports, module.exports.__esModule = true;","module.exports = require(\"core-js-pure/stable/symbol\");","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\");","module.exports = require(\"core-js-pure/stable/instance/slice\");","var $ = require('../internals/export');\nvar ownKeys = require('../internals/own-keys');\n\n// `Reflect.ownKeys` method\n// https://tc39.es/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\");","module.exports = require(\"core-js-pure/stable/array/is-array\");","'use strict';\nvar $ = require('../internals/export');\nvar $map = require('../internals/array-iteration').map;\nvar arrayMethodHasSpeciesSupport = require('../internals/array-method-has-species-support');\n\nvar HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('map');\n\n// `Array.prototype.map` method\n// https://tc39.es/ecma262/#sec-array.prototype.map\n// with adding support of @@species\n$({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT }, {\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\");","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.es/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 $ = require('../internals/export');\n\n// `Date.now` method\n// https://tc39.es/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 parent = require('../../es/date/now');\n\nmodule.exports = parent;\n","module.exports = require(\"core-js-pure/stable/date/now\");","'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 -- required for testing\n method.call(null, argument || function () { throw 1; }, 1);\n });\n};\n","'use strict';\nvar $forEach = require('../internals/array-iteration').forEach;\nvar arrayMethodIsStrict = require('../internals/array-method-is-strict');\n\nvar STRICT_METHOD = arrayMethodIsStrict('forEach');\n\n// `Array.prototype.forEach` method implementation\n// https://tc39.es/ecma262/#sec-array.prototype.foreach\nmodule.exports = !STRICT_METHOD ? function forEach(callbackfn /* , thisArg */) {\n return $forEach(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);\n// eslint-disable-next-line es/no-array-prototype-foreach -- safe\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.es/ecma262/#sec-array.prototype.foreach\n// eslint-disable-next-line es/no-array-prototype-foreach -- safe\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 -- safe\n || DOMIterables.hasOwnProperty(classof(it)) ? forEach : own;\n};\n","module.exports = require(\"core-js-pure/stable/instance/for-each\");","'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.es/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 -- dirty hack\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 $ = 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');\n\nvar HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('splice');\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.es/ecma262/#sec-array.prototype.splice\n// with adding support of @@species\n$({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT }, {\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 $includes = require('../internals/array-includes').includes;\nvar addToUnscopables = require('../internals/add-to-unscopables');\n\n// `Array.prototype.includes` method\n// https://tc39.es/ecma262/#sec-array.prototype.includes\n$({ target: 'Array', proto: true }, {\n includes: function includes(el /* , fromIndex = 0 */) {\n return $includes(this, el, arguments.length > 1 ? arguments[1] : undefined);\n }\n});\n\n// https://tc39.es/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.es/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 toString = require('../internals/to-string');\nvar correctIsRegExpLogic = require('../internals/correct-is-regexp-logic');\n\n// `String.prototype.includes` method\n// https://tc39.es/ecma262/#sec-string.prototype.includes\n$({ target: 'String', proto: true, forced: !correctIsRegExpLogic('includes') }, {\n includes: function includes(searchString /* , position = 0 */) {\n return !!~toString(requireObjectCoercible(this))\n .indexOf(toString(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","var arrayIncludes = require('../array/virtual/includes');\nvar stringIncludes = require('../string/virtual/includes');\n\nvar ArrayPrototype = Array.prototype;\nvar StringPrototype = String.prototype;\n\nmodule.exports = function (it) {\n var own = it.includes;\n if (it === ArrayPrototype || (it instanceof Array && own === ArrayPrototype.includes)) return arrayIncludes;\n if (typeof it === 'string' || it === StringPrototype || (it instanceof String && own === StringPrototype.includes)) {\n return stringIncludes;\n } return own;\n};\n","var parent = require('../../es/instance/includes');\n\nmodule.exports = parent;\n","module.exports = require(\"core-js-pure/stable/instance/includes\");","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.es/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","var parent = require('../../es/object/get-prototype-of');\n\nmodule.exports = parent;\n","module.exports = require(\"core-js-pure/stable/object/get-prototype-of\");","'use strict';\nvar $ = require('../internals/export');\nvar $filter = require('../internals/array-iteration').filter;\nvar arrayMethodHasSpeciesSupport = require('../internals/array-method-has-species-support');\n\nvar HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('filter');\n\n// `Array.prototype.filter` method\n// https://tc39.es/ecma262/#sec-array.prototype.filter\n// with adding support of @@species\n$({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT }, {\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 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.es/ecma262/#sec-object.entries\n entries: createMethod(true),\n // `Object.values` method\n // https://tc39.es/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.es/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 parent = require('../../es/object/values');\n\nmodule.exports = parent;\n","module.exports = require(\"core-js-pure/stable/object/values\");","// a string of all valid unicode whitespaces\nmodule.exports = '\\u0009\\u000A\\u000B\\u000C\\u000D\\u0020\\u00A0\\u1680\\u2000\\u2001\\u2002' +\n '\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200A\\u202F\\u205F\\u3000\\u2028\\u2029\\uFEFF';\n","var requireObjectCoercible = require('../internals/require-object-coercible');\nvar toString = require('../internals/to-string');\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 = toString(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.es/ecma262/#sec-string.prototype.trimstart\n start: createMethod(1),\n // `String.prototype.{ trimRight, trimEnd }` methods\n // https://tc39.es/ecma262/#sec-string.prototype.trimend\n end: createMethod(2),\n // `String.prototype.trim` method\n // https://tc39.es/ecma262/#sec-string.prototype.trim\n trim: createMethod(3)\n};\n","var global = require('../internals/global');\nvar toString = require('../internals/to-string');\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.es/ecma262/#sec-parseint-string-radix\nmodule.exports = FORCED ? function parseInt(string, radix) {\n var S = trim(toString(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.es/ecma262/#sec-parseint-string-radix\n$({ global: true, forced: parseInt != parseIntImplementation }, {\n parseInt: parseIntImplementation\n});\n","require('../modules/es.parse-int');\nvar path = require('../internals/path');\n\nmodule.exports = path.parseInt;\n","var parent = require('../es/parse-int');\n\nmodule.exports = parent;\n","module.exports = require(\"core-js-pure/stable/parse-int\");","'use strict';\n/* eslint-disable es/no-array-prototype-indexof -- required for testing */\nvar $ = require('../internals/export');\nvar $indexOf = require('../internals/array-includes').indexOf;\nvar arrayMethodIsStrict = require('../internals/array-method-is-strict');\n\nvar nativeIndexOf = [].indexOf;\n\nvar NEGATIVE_ZERO = !!nativeIndexOf && 1 / [1].indexOf(1, -0) < 0;\nvar STRICT_METHOD = arrayMethodIsStrict('indexOf');\n\n// `Array.prototype.indexOf` method\n// https://tc39.es/ecma262/#sec-array.prototype.indexof\n$({ target: 'Array', proto: true, forced: NEGATIVE_ZERO || !STRICT_METHOD }, {\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 indexOf = require('../array/virtual/index-of');\n\nvar ArrayPrototype = Array.prototype;\n\nmodule.exports = function (it) {\n var own = it.indexOf;\n return it === ArrayPrototype || (it instanceof Array && own === ArrayPrototype.indexOf) ? indexOf : own;\n};\n","var parent = require('../../es/instance/index-of');\n\nmodule.exports = parent;\n","module.exports = require(\"core-js-pure/stable/instance/index-of\");","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.es/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","var trim = require('../string/virtual/trim');\n\nvar StringPrototype = String.prototype;\n\nmodule.exports = function (it) {\n var own = it.trim;\n return typeof it === 'string' || it === StringPrototype\n || (it instanceof String && own === StringPrototype.trim) ? trim : own;\n};\n","var parent = require('../../es/instance/trim');\n\nmodule.exports = parent;\n","module.exports = require(\"core-js-pure/stable/instance/trim\");","var $ = require('../internals/export');\nvar DESCRIPTORS = require('../internals/descriptors');\nvar create = require('../internals/object-create');\n\n// `Object.create` method\n// https://tc39.es/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 $ = 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 // `JSON.stringify` method\n // https://tc39.es/ecma262/#sec-json.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 -- required for `.length`\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\n// eslint-disable-next-line es/no-json -- safe\nif (!core.JSON) core.JSON = { stringify: JSON.stringify };\n\n// eslint-disable-next-line no-unused-vars -- required for `.length`\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 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 -- spec requirement\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\");","'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.es/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.es/ecma262/#sec-array.prototype.fill\n$({ target: 'Array', proto: true }, {\n fill: fill\n});\n\n// https://tc39.es/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 fill = require('../array/virtual/fill');\n\nvar ArrayPrototype = Array.prototype;\n\nmodule.exports = function (it) {\n var own = it.fill;\n return it === ArrayPrototype || (it instanceof Array && own === ArrayPrototype.fill) ? fill : own;\n};\n","var parent = require('../../es/instance/fill');\n\nmodule.exports = parent;\n","module.exports = require(\"core-js-pure/stable/instance/fill\");","/*! 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.2\n * @date 2021-02-06T21:33:57.447Z\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","/* eslint-disable no-prototype-builtins */\n/* eslint-disable no-unused-vars */\n/* eslint-disable no-var */\n\n/**\n * Parse a text source containing data in DOT language into a JSON object.\n * The object contains two lists: one with nodes and one with edges.\n *\n * DOT language reference: http://www.graphviz.org/doc/info/lang.html\n *\n * DOT language attributes: http://graphviz.org/content/attrs\n *\n * @param {string} data Text containing a graph in DOT-notation\n * @returns {object} graph An object containing two parameters:\n * {Object[]} nodes\n * {Object[]} edges\n *\n * -------------------------------------------\n * TODO\n * ====\n *\n * For label handling, this is an incomplete implementation. From docs (quote #3015):\n *\n * > the escape sequences \"\\n\", \"\\l\" and \"\\r\" divide the label into lines, centered,\n * > left-justified, and right-justified, respectively.\n *\n * Source: http://www.graphviz.org/content/attrs#kescString\n *\n * > As another aid for readability, dot allows double-quoted strings to span multiple physical\n * > lines using the standard C convention of a backslash immediately preceding a newline\n * > character\n * > In addition, double-quoted strings can be concatenated using a '+' operator.\n * > As HTML strings can contain newline characters, which are used solely for formatting,\n * > the language does not allow escaped newlines or concatenation operators to be used\n * > within them.\n *\n * - Currently, only '\\\\n' is handled\n * - Note that text explicitly says 'labels'; the dot parser currently handles escape\n * sequences in **all** strings.\n */\nexport function parseDOT(data) {\n dot = data;\n return parseGraph();\n}\n\n// mapping of attributes from DOT (the keys) to vis.js (the values)\nvar NODE_ATTR_MAPPING = {\n fontsize: \"font.size\",\n fontcolor: \"font.color\",\n labelfontcolor: \"font.color\",\n fontname: \"font.face\",\n color: [\"color.border\", \"color.background\"],\n fillcolor: \"color.background\",\n tooltip: \"title\",\n labeltooltip: \"title\",\n};\nvar EDGE_ATTR_MAPPING = Object.create(NODE_ATTR_MAPPING);\nEDGE_ATTR_MAPPING.color = \"color.color\";\nEDGE_ATTR_MAPPING.style = \"dashes\";\n\n// token types enumeration\nvar TOKENTYPE = {\n NULL: 0,\n DELIMITER: 1,\n IDENTIFIER: 2,\n UNKNOWN: 3,\n};\n\n// map with all delimiters\nvar DELIMITERS = {\n \"{\": true,\n \"}\": true,\n \"[\": true,\n \"]\": true,\n \";\": true,\n \"=\": true,\n \",\": true,\n\n \"->\": true,\n \"--\": true,\n};\n\nvar dot = \"\"; // current dot file\nvar index = 0; // current index in dot file\nvar c = \"\"; // current token character in expr\nvar token = \"\"; // current token\nvar tokenType = TOKENTYPE.NULL; // type of the token\n\n/**\n * Get the first character from the dot file.\n * The character is stored into the char c. If the end of the dot file is\n * reached, the function puts an empty string in c.\n */\nfunction first() {\n index = 0;\n c = dot.charAt(0);\n}\n\n/**\n * Get the next character from the dot file.\n * The character is stored into the char c. If the end of the dot file is\n * reached, the function puts an empty string in c.\n */\nfunction next() {\n index++;\n c = dot.charAt(index);\n}\n\n/**\n * Preview the next character from the dot file.\n *\n * @returns {string} cNext\n */\nfunction nextPreview() {\n return dot.charAt(index + 1);\n}\n\n/**\n * Test whether given character is alphabetic or numeric ( a-zA-Z_0-9.:# )\n *\n * @param {string} c\n * @returns {boolean} isAlphaNumeric\n */\nfunction isAlphaNumeric(c) {\n var charCode = c.charCodeAt(0);\n\n if (charCode < 47) {\n // #.\n return charCode === 35 || charCode === 46;\n }\n if (charCode < 59) {\n // 0-9 and :\n return charCode > 47;\n }\n if (charCode < 91) {\n // A-Z\n return charCode > 64;\n }\n if (charCode < 96) {\n // _\n return charCode === 95;\n }\n if (charCode < 123) {\n // a-z\n return charCode > 96;\n }\n\n return false;\n}\n\n/**\n * Merge all options of object b into object b\n *\n * @param {object} a\n * @param {object} b\n * @returns {object} a\n */\nfunction merge(a, b) {\n if (!a) {\n a = {};\n }\n\n if (b) {\n for (var name in b) {\n if (b.hasOwnProperty(name)) {\n a[name] = b[name];\n }\n }\n }\n return a;\n}\n\n/**\n * Set a value in an object, where the provided parameter name can be a\n * path with nested parameters. For example:\n *\n * var obj = {a: 2};\n * setValue(obj, 'b.c', 3); // obj = {a: 2, b: {c: 3}}\n *\n * @param {object} obj\n * @param {string} path A parameter name or dot-separated parameter path,\n * like \"color.highlight.border\".\n * @param {*} value\n */\nfunction setValue(obj, path, value) {\n var keys = path.split(\".\");\n var o = obj;\n while (keys.length) {\n var key = keys.shift();\n if (keys.length) {\n // this isn't the end point\n if (!o[key]) {\n o[key] = {};\n }\n o = o[key];\n } else {\n // this is the end point\n o[key] = value;\n }\n }\n}\n\n/**\n * Add a node to a graph object. If there is already a node with\n * the same id, their attributes will be merged.\n *\n * @param {object} graph\n * @param {object} node\n */\nfunction addNode(graph, node) {\n var i, len;\n var current = null;\n\n // find root graph (in case of subgraph)\n var graphs = [graph]; // list with all graphs from current graph to root graph\n var root = graph;\n while (root.parent) {\n graphs.push(root.parent);\n root = root.parent;\n }\n\n // find existing node (at root level) by its id\n if (root.nodes) {\n for (i = 0, len = root.nodes.length; i < len; i++) {\n if (node.id === root.nodes[i].id) {\n current = root.nodes[i];\n break;\n }\n }\n }\n\n if (!current) {\n // this is a new node\n current = {\n id: node.id,\n };\n if (graph.node) {\n // clone default attributes\n current.attr = merge(current.attr, graph.node);\n }\n }\n\n // add node to this (sub)graph and all its parent graphs\n for (i = graphs.length - 1; i >= 0; i--) {\n var g = graphs[i];\n\n if (!g.nodes) {\n g.nodes = [];\n }\n if (g.nodes.indexOf(current) === -1) {\n g.nodes.push(current);\n }\n }\n\n // merge attributes\n if (node.attr) {\n current.attr = merge(current.attr, node.attr);\n }\n}\n\n/**\n * Add an edge to a graph object\n *\n * @param {object} graph\n * @param {object} edge\n */\nfunction addEdge(graph, edge) {\n if (!graph.edges) {\n graph.edges = [];\n }\n graph.edges.push(edge);\n if (graph.edge) {\n var attr = merge({}, graph.edge); // clone default attributes\n edge.attr = merge(attr, edge.attr); // merge attributes\n }\n}\n\n/**\n * Create an edge to a graph object\n *\n * @param {object} graph\n * @param {string | number | object} from\n * @param {string | number | object} to\n * @param {string} type\n * @param {object | null} attr\n * @returns {object} edge\n */\nfunction createEdge(graph, from, to, type, attr) {\n var edge = {\n from: from,\n to: to,\n type: type,\n };\n\n if (graph.edge) {\n edge.attr = merge({}, graph.edge); // clone default attributes\n }\n edge.attr = merge(edge.attr || {}, attr); // merge attributes\n\n // Move arrows attribute from attr to edge temporally created in\n // parseAttributeList().\n if (attr != null) {\n if (attr.hasOwnProperty(\"arrows\") && attr[\"arrows\"] != null) {\n edge[\"arrows\"] = { to: { enabled: true, type: attr.arrows.type } };\n attr[\"arrows\"] = null;\n }\n }\n return edge;\n}\n\n/**\n * Get next token in the current dot file.\n * The token and token type are available as token and tokenType\n */\nfunction getToken() {\n tokenType = TOKENTYPE.NULL;\n token = \"\";\n\n // skip over whitespaces\n while (c === \" \" || c === \"\\t\" || c === \"\\n\" || c === \"\\r\") {\n // space, tab, enter\n next();\n }\n\n do {\n var isComment = false;\n\n // skip comment\n if (c === \"#\") {\n // find the previous non-space character\n var i = index - 1;\n while (dot.charAt(i) === \" \" || dot.charAt(i) === \"\\t\") {\n i--;\n }\n if (dot.charAt(i) === \"\\n\" || dot.charAt(i) === \"\") {\n // the # is at the start of a line, this is indeed a line comment\n while (c != \"\" && c != \"\\n\") {\n next();\n }\n isComment = true;\n }\n }\n if (c === \"/\" && nextPreview() === \"/\") {\n // skip line comment\n while (c != \"\" && c != \"\\n\") {\n next();\n }\n isComment = true;\n }\n if (c === \"/\" && nextPreview() === \"*\") {\n // skip block comment\n while (c != \"\") {\n if (c === \"*\" && nextPreview() === \"/\") {\n // end of block comment found. skip these last two characters\n next();\n next();\n break;\n } else {\n next();\n }\n }\n isComment = true;\n }\n\n // skip over whitespaces\n while (c === \" \" || c === \"\\t\" || c === \"\\n\" || c === \"\\r\") {\n // space, tab, enter\n next();\n }\n } while (isComment);\n\n // check for end of dot file\n if (c === \"\") {\n // token is still empty\n tokenType = TOKENTYPE.DELIMITER;\n return;\n }\n\n // check for delimiters consisting of 2 characters\n var c2 = c + nextPreview();\n if (DELIMITERS[c2]) {\n tokenType = TOKENTYPE.DELIMITER;\n token = c2;\n next();\n next();\n return;\n }\n\n // check for delimiters consisting of 1 character\n if (DELIMITERS[c]) {\n tokenType = TOKENTYPE.DELIMITER;\n token = c;\n next();\n return;\n }\n\n // check for an identifier (number or string)\n // TODO: more precise parsing of numbers/strings (and the port separator ':')\n if (isAlphaNumeric(c) || c === \"-\") {\n token += c;\n next();\n\n while (isAlphaNumeric(c)) {\n token += c;\n next();\n }\n if (token === \"false\") {\n token = false; // convert to boolean\n } else if (token === \"true\") {\n token = true; // convert to boolean\n } else if (!isNaN(Number(token))) {\n token = Number(token); // convert to number\n }\n tokenType = TOKENTYPE.IDENTIFIER;\n return;\n }\n\n // check for a string enclosed by double quotes\n if (c === '\"') {\n next();\n while (c != \"\" && (c != '\"' || (c === '\"' && nextPreview() === '\"'))) {\n if (c === '\"') {\n // skip the escape character\n token += c;\n next();\n } else if (c === \"\\\\\" && nextPreview() === \"n\") {\n // Honor a newline escape sequence\n token += \"\\n\";\n next();\n } else {\n token += c;\n }\n next();\n }\n if (c != '\"') {\n throw newSyntaxError('End of string \" expected');\n }\n next();\n tokenType = TOKENTYPE.IDENTIFIER;\n return;\n }\n\n // something unknown is found, wrong characters, a syntax error\n tokenType = TOKENTYPE.UNKNOWN;\n while (c != \"\") {\n token += c;\n next();\n }\n throw new SyntaxError('Syntax error in part \"' + chop(token, 30) + '\"');\n}\n\n/**\n * Parse a graph.\n *\n * @returns {object} graph\n */\nfunction parseGraph() {\n var graph = {};\n\n first();\n getToken();\n\n // optional strict keyword\n if (token === \"strict\") {\n graph.strict = true;\n getToken();\n }\n\n // graph or digraph keyword\n if (token === \"graph\" || token === \"digraph\") {\n graph.type = token;\n getToken();\n }\n\n // optional graph id\n if (tokenType === TOKENTYPE.IDENTIFIER) {\n graph.id = token;\n getToken();\n }\n\n // open angle bracket\n if (token != \"{\") {\n throw newSyntaxError(\"Angle bracket { expected\");\n }\n getToken();\n\n // statements\n parseStatements(graph);\n\n // close angle bracket\n if (token != \"}\") {\n throw newSyntaxError(\"Angle bracket } expected\");\n }\n getToken();\n\n // end of file\n if (token !== \"\") {\n throw newSyntaxError(\"End of file expected\");\n }\n getToken();\n\n // remove temporary default options\n delete graph.node;\n delete graph.edge;\n delete graph.graph;\n\n return graph;\n}\n\n/**\n * Parse a list with statements.\n *\n * @param {object} graph\n */\nfunction parseStatements(graph) {\n while (token !== \"\" && token != \"}\") {\n parseStatement(graph);\n if (token === \";\") {\n getToken();\n }\n }\n}\n\n/**\n * Parse a single statement. Can be a an attribute statement, node\n * statement, a series of node statements and edge statements, or a\n * parameter.\n *\n * @param {object} graph\n */\nfunction parseStatement(graph) {\n // parse subgraph\n var subgraph = parseSubgraph(graph);\n if (subgraph) {\n // edge statements\n parseEdge(graph, subgraph);\n\n return;\n }\n\n // parse an attribute statement\n var attr = parseAttributeStatement(graph);\n if (attr) {\n return;\n }\n\n // parse node\n if (tokenType != TOKENTYPE.IDENTIFIER) {\n throw newSyntaxError(\"Identifier expected\");\n }\n var id = token; // id can be a string or a number\n getToken();\n\n if (token === \"=\") {\n // id statement\n getToken();\n if (tokenType != TOKENTYPE.IDENTIFIER) {\n throw newSyntaxError(\"Identifier expected\");\n }\n graph[id] = token;\n getToken();\n // TODO: implement comma separated list with \"a_list: ID=ID [','] [a_list] \"\n } else {\n parseNodeStatement(graph, id);\n }\n}\n\n/**\n * Parse a subgraph\n *\n * @param {object} graph parent graph object\n * @returns {object | null} subgraph\n */\nfunction parseSubgraph(graph) {\n var subgraph = null;\n\n // optional subgraph keyword\n if (token === \"subgraph\") {\n subgraph = {};\n subgraph.type = \"subgraph\";\n getToken();\n\n // optional graph id\n if (tokenType === TOKENTYPE.IDENTIFIER) {\n subgraph.id = token;\n getToken();\n }\n }\n\n // open angle bracket\n if (token === \"{\") {\n getToken();\n\n if (!subgraph) {\n subgraph = {};\n }\n subgraph.parent = graph;\n subgraph.node = graph.node;\n subgraph.edge = graph.edge;\n subgraph.graph = graph.graph;\n\n // statements\n parseStatements(subgraph);\n\n // close angle bracket\n if (token != \"}\") {\n throw newSyntaxError(\"Angle bracket } expected\");\n }\n getToken();\n\n // remove temporary default options\n delete subgraph.node;\n delete subgraph.edge;\n delete subgraph.graph;\n delete subgraph.parent;\n\n // register at the parent graph\n if (!graph.subgraphs) {\n graph.subgraphs = [];\n }\n graph.subgraphs.push(subgraph);\n }\n\n return subgraph;\n}\n\n/**\n * parse an attribute statement like \"node [shape=circle fontSize=16]\".\n * Available keywords are 'node', 'edge', 'graph'.\n * The previous list with default attributes will be replaced\n *\n * @param {object} graph\n * @returns {string | null} keyword Returns the name of the parsed attribute\n * (node, edge, graph), or null if nothing\n * is parsed.\n */\nfunction parseAttributeStatement(graph) {\n // attribute statements\n if (token === \"node\") {\n getToken();\n\n // node attributes\n graph.node = parseAttributeList();\n return \"node\";\n } else if (token === \"edge\") {\n getToken();\n\n // edge attributes\n graph.edge = parseAttributeList();\n return \"edge\";\n } else if (token === \"graph\") {\n getToken();\n\n // graph attributes\n graph.graph = parseAttributeList();\n return \"graph\";\n }\n\n return null;\n}\n\n/**\n * parse a node statement\n *\n * @param {object} graph\n * @param {string | number} id\n */\nfunction parseNodeStatement(graph, id) {\n // node statement\n var node = {\n id: id,\n };\n var attr = parseAttributeList();\n if (attr) {\n node.attr = attr;\n }\n addNode(graph, node);\n\n // edge statements\n parseEdge(graph, id);\n}\n\n/**\n * Parse an edge or a series of edges\n *\n * @param {object} graph\n * @param {string | number} from Id of the from node\n */\nfunction parseEdge(graph, from) {\n while (token === \"->\" || token === \"--\") {\n var to;\n var type = token;\n getToken();\n\n var subgraph = parseSubgraph(graph);\n if (subgraph) {\n to = subgraph;\n } else {\n if (tokenType != TOKENTYPE.IDENTIFIER) {\n throw newSyntaxError(\"Identifier or subgraph expected\");\n }\n to = token;\n addNode(graph, {\n id: to,\n });\n getToken();\n }\n\n // parse edge attributes\n var attr = parseAttributeList();\n\n // create edge\n var edge = createEdge(graph, from, to, type, attr);\n addEdge(graph, edge);\n\n from = to;\n }\n}\n\n/**\n * As explained in [1], graphviz has limitations for combination of\n * arrow[head|tail] and dir. If attribute list includes 'dir',\n * following cases just be supported.\n * 1. both or none + arrowhead, arrowtail\n * 2. forward + arrowhead (arrowtail is not affedted)\n * 3. back + arrowtail (arrowhead is not affected)\n * [1] https://www.graphviz.org/doc/info/attrs.html#h:undir_note\n *\n * This function is called from parseAttributeList() to parse 'dir'\n * attribute with given 'attr_names' and 'attr_list'.\n *\n * @param {object} attr_names Array of attribute names\n * @param {object} attr_list Array of objects of attribute set\n * @returns {object} attr_list Updated attr_list\n */\nfunction parseDirAttribute(attr_names, attr_list) {\n var i;\n if (attr_names.includes(\"dir\")) {\n var idx = {}; // get index of 'arrows' and 'dir'\n idx.arrows = {};\n for (i = 0; i < attr_list.length; i++) {\n if (attr_list[i].name === \"arrows\") {\n if (attr_list[i].value.to != null) {\n idx.arrows.to = i;\n } else if (attr_list[i].value.from != null) {\n idx.arrows.from = i;\n } else {\n throw newSyntaxError(\"Invalid value of arrows\");\n }\n } else if (attr_list[i].name === \"dir\") {\n idx.dir = i;\n }\n }\n\n // first, add default arrow shape if it is not assigned to avoid error\n var dir_type = attr_list[idx.dir].value;\n if (!attr_names.includes(\"arrows\")) {\n if (dir_type === \"both\") {\n attr_list.push({\n attr: attr_list[idx.dir].attr,\n name: \"arrows\",\n value: { to: { enabled: true } },\n });\n idx.arrows.to = attr_list.length - 1;\n attr_list.push({\n attr: attr_list[idx.dir].attr,\n name: \"arrows\",\n value: { from: { enabled: true } },\n });\n idx.arrows.from = attr_list.length - 1;\n } else if (dir_type === \"forward\") {\n attr_list.push({\n attr: attr_list[idx.dir].attr,\n name: \"arrows\",\n value: { to: { enabled: true } },\n });\n idx.arrows.to = attr_list.length - 1;\n } else if (dir_type === \"back\") {\n attr_list.push({\n attr: attr_list[idx.dir].attr,\n name: \"arrows\",\n value: { from: { enabled: true } },\n });\n idx.arrows.from = attr_list.length - 1;\n } else if (dir_type === \"none\") {\n attr_list.push({\n attr: attr_list[idx.dir].attr,\n name: \"arrows\",\n value: \"\",\n });\n idx.arrows.to = attr_list.length - 1;\n } else {\n throw newSyntaxError('Invalid dir type \"' + dir_type + '\"');\n }\n }\n\n var from_type;\n var to_type;\n // update 'arrows' attribute from 'dir'.\n if (dir_type === \"both\") {\n // both of shapes of 'from' and 'to' are given\n if (idx.arrows.to && idx.arrows.from) {\n to_type = attr_list[idx.arrows.to].value.to.type;\n from_type = attr_list[idx.arrows.from].value.from.type;\n attr_list[idx.arrows.to] = {\n attr: attr_list[idx.arrows.to].attr,\n name: attr_list[idx.arrows.to].name,\n value: {\n to: { enabled: true, type: to_type },\n from: { enabled: true, type: from_type },\n },\n };\n attr_list.splice(idx.arrows.from, 1);\n\n // shape of 'to' is assigned and use default to 'from'\n } else if (idx.arrows.to) {\n to_type = attr_list[idx.arrows.to].value.to.type;\n from_type = \"arrow\";\n attr_list[idx.arrows.to] = {\n attr: attr_list[idx.arrows.to].attr,\n name: attr_list[idx.arrows.to].name,\n value: {\n to: { enabled: true, type: to_type },\n from: { enabled: true, type: from_type },\n },\n };\n\n // only shape of 'from' is assigned and use default for 'to'\n } else if (idx.arrows.from) {\n to_type = \"arrow\";\n from_type = attr_list[idx.arrows.from].value.from.type;\n attr_list[idx.arrows.from] = {\n attr: attr_list[idx.arrows.from].attr,\n name: attr_list[idx.arrows.from].name,\n value: {\n to: { enabled: true, type: to_type },\n from: { enabled: true, type: from_type },\n },\n };\n }\n } else if (dir_type === \"back\") {\n // given both of shapes, but use only 'from'\n if (idx.arrows.to && idx.arrows.from) {\n to_type = \"\";\n from_type = attr_list[idx.arrows.from].value.from.type;\n attr_list[idx.arrows.from] = {\n attr: attr_list[idx.arrows.from].attr,\n name: attr_list[idx.arrows.from].name,\n value: {\n to: { enabled: true, type: to_type },\n from: { enabled: true, type: from_type },\n },\n };\n\n // given shape of 'to', but does not use it\n } else if (idx.arrows.to) {\n to_type = \"\";\n from_type = \"arrow\";\n idx.arrows.from = idx.arrows.to;\n attr_list[idx.arrows.from] = {\n attr: attr_list[idx.arrows.from].attr,\n name: attr_list[idx.arrows.from].name,\n value: {\n to: { enabled: true, type: to_type },\n from: { enabled: true, type: from_type },\n },\n };\n\n // assign given 'from' shape\n } else if (idx.arrows.from) {\n to_type = \"\";\n from_type = attr_list[idx.arrows.from].value.from.type;\n attr_list[idx.arrows.to] = {\n attr: attr_list[idx.arrows.from].attr,\n name: attr_list[idx.arrows.from].name,\n value: {\n to: { enabled: true, type: to_type },\n from: { enabled: true, type: from_type },\n },\n };\n }\n\n attr_list[idx.arrows.from] = {\n attr: attr_list[idx.arrows.from].attr,\n name: attr_list[idx.arrows.from].name,\n value: {\n from: {\n enabled: true,\n type: attr_list[idx.arrows.from].value.from.type,\n },\n },\n };\n } else if (dir_type === \"none\") {\n var idx_arrow;\n if (idx.arrows.to) {\n idx_arrow = idx.arrows.to;\n } else {\n idx_arrow = idx.arrows.from;\n }\n\n attr_list[idx_arrow] = {\n attr: attr_list[idx_arrow].attr,\n name: attr_list[idx_arrow].name,\n value: \"\",\n };\n } else if (dir_type === \"forward\") {\n // given both of shapes, but use only 'to'\n if (idx.arrows.to && idx.arrows.from) {\n to_type = attr_list[idx.arrows.to].value.to.type;\n from_type = \"\";\n attr_list[idx.arrows.to] = {\n attr: attr_list[idx.arrows.to].attr,\n name: attr_list[idx.arrows.to].name,\n value: {\n to: { enabled: true, type: to_type },\n from: { enabled: true, type: from_type },\n },\n };\n\n // assign given 'to' shape\n } else if (idx.arrows.to) {\n to_type = attr_list[idx.arrows.to].value.to.type;\n from_type = \"\";\n attr_list[idx.arrows.to] = {\n attr: attr_list[idx.arrows.to].attr,\n name: attr_list[idx.arrows.to].name,\n value: {\n to: { enabled: true, type: to_type },\n from: { enabled: true, type: from_type },\n },\n };\n\n // given shape of 'from', but does not use it\n } else if (idx.arrows.from) {\n to_type = \"arrow\";\n from_type = \"\";\n idx.arrows.to = idx.arrows.from;\n attr_list[idx.arrows.to] = {\n attr: attr_list[idx.arrows.to].attr,\n name: attr_list[idx.arrows.to].name,\n value: {\n to: { enabled: true, type: to_type },\n from: { enabled: true, type: from_type },\n },\n };\n }\n\n attr_list[idx.arrows.to] = {\n attr: attr_list[idx.arrows.to].attr,\n name: attr_list[idx.arrows.to].name,\n value: {\n to: {\n enabled: true,\n type: attr_list[idx.arrows.to].value.to.type,\n },\n },\n };\n } else {\n throw newSyntaxError('Invalid dir type \"' + dir_type + '\"');\n }\n\n // remove 'dir' attribute no need anymore\n attr_list.splice(idx.dir, 1);\n }\n return attr_list;\n}\n\n/**\n * Parse a set with attributes,\n * for example [label=\"1.000\", shape=solid]\n *\n * @returns {object | null} attr\n */\nfunction parseAttributeList() {\n var i;\n var attr = null;\n\n // edge styles of dot and vis\n var edgeStyles = {\n dashed: true,\n solid: false,\n dotted: [1, 5],\n };\n\n /**\n * Define arrow types.\n * vis currently supports types defined in 'arrowTypes'.\n * Details of arrow shapes are described in\n * http://www.graphviz.org/content/arrow-shapes\n */\n var arrowTypes = {\n dot: \"circle\",\n box: \"box\",\n crow: \"crow\",\n curve: \"curve\",\n icurve: \"inv_curve\",\n normal: \"triangle\",\n inv: \"inv_triangle\",\n diamond: \"diamond\",\n tee: \"bar\",\n vee: \"vee\",\n };\n\n /**\n * 'attr_list' contains attributes for checking if some of them are affected\n * later. For instance, both of 'arrowhead' and 'dir' (edge style defined\n * in DOT) make changes to 'arrows' attribute in vis.\n */\n var attr_list = new Array();\n var attr_names = new Array(); // used for checking the case.\n\n // parse attributes\n while (token === \"[\") {\n getToken();\n attr = {};\n while (token !== \"\" && token != \"]\") {\n if (tokenType != TOKENTYPE.IDENTIFIER) {\n throw newSyntaxError(\"Attribute name expected\");\n }\n var name = token;\n\n getToken();\n if (token != \"=\") {\n throw newSyntaxError(\"Equal sign = expected\");\n }\n getToken();\n\n if (tokenType != TOKENTYPE.IDENTIFIER) {\n throw newSyntaxError(\"Attribute value expected\");\n }\n var value = token;\n\n // convert from dot style to vis\n if (name === \"style\") {\n value = edgeStyles[value];\n }\n\n var arrowType;\n if (name === \"arrowhead\") {\n arrowType = arrowTypes[value];\n name = \"arrows\";\n value = { to: { enabled: true, type: arrowType } };\n }\n\n if (name === \"arrowtail\") {\n arrowType = arrowTypes[value];\n name = \"arrows\";\n value = { from: { enabled: true, type: arrowType } };\n }\n\n attr_list.push({ attr: attr, name: name, value: value });\n attr_names.push(name);\n\n getToken();\n if (token == \",\") {\n getToken();\n }\n }\n\n if (token != \"]\") {\n throw newSyntaxError(\"Bracket ] expected\");\n }\n getToken();\n }\n\n /**\n * As explained in [1], graphviz has limitations for combination of\n * arrow[head|tail] and dir. If attribute list includes 'dir',\n * following cases just be supported.\n * 1. both or none + arrowhead, arrowtail\n * 2. forward + arrowhead (arrowtail is not affedted)\n * 3. back + arrowtail (arrowhead is not affected)\n * [1] https://www.graphviz.org/doc/info/attrs.html#h:undir_note\n */\n if (attr_names.includes(\"dir\")) {\n var idx = {}; // get index of 'arrows' and 'dir'\n idx.arrows = {};\n for (i = 0; i < attr_list.length; i++) {\n if (attr_list[i].name === \"arrows\") {\n if (attr_list[i].value.to != null) {\n idx.arrows.to = i;\n } else if (attr_list[i].value.from != null) {\n idx.arrows.from = i;\n } else {\n throw newSyntaxError(\"Invalid value of arrows\");\n }\n } else if (attr_list[i].name === \"dir\") {\n idx.dir = i;\n }\n }\n\n // first, add default arrow shape if it is not assigned to avoid error\n var dir_type = attr_list[idx.dir].value;\n if (!attr_names.includes(\"arrows\")) {\n if (dir_type === \"both\") {\n attr_list.push({\n attr: attr_list[idx.dir].attr,\n name: \"arrows\",\n value: { to: { enabled: true } },\n });\n idx.arrows.to = attr_list.length - 1;\n attr_list.push({\n attr: attr_list[idx.dir].attr,\n name: \"arrows\",\n value: { from: { enabled: true } },\n });\n idx.arrows.from = attr_list.length - 1;\n } else if (dir_type === \"forward\") {\n attr_list.push({\n attr: attr_list[idx.dir].attr,\n name: \"arrows\",\n value: { to: { enabled: true } },\n });\n idx.arrows.to = attr_list.length - 1;\n } else if (dir_type === \"back\") {\n attr_list.push({\n attr: attr_list[idx.dir].attr,\n name: \"arrows\",\n value: { from: { enabled: true } },\n });\n idx.arrows.from = attr_list.length - 1;\n } else if (dir_type === \"none\") {\n attr_list.push({\n attr: attr_list[idx.dir].attr,\n name: \"arrows\",\n value: \"\",\n });\n idx.arrows.to = attr_list.length - 1;\n } else {\n throw newSyntaxError('Invalid dir type \"' + dir_type + '\"');\n }\n }\n\n var from_type;\n var to_type;\n // update 'arrows' attribute from 'dir'.\n if (dir_type === \"both\") {\n // both of shapes of 'from' and 'to' are given\n if (idx.arrows.to && idx.arrows.from) {\n to_type = attr_list[idx.arrows.to].value.to.type;\n from_type = attr_list[idx.arrows.from].value.from.type;\n attr_list[idx.arrows.to] = {\n attr: attr_list[idx.arrows.to].attr,\n name: attr_list[idx.arrows.to].name,\n value: {\n to: { enabled: true, type: to_type },\n from: { enabled: true, type: from_type },\n },\n };\n attr_list.splice(idx.arrows.from, 1);\n\n // shape of 'to' is assigned and use default to 'from'\n } else if (idx.arrows.to) {\n to_type = attr_list[idx.arrows.to].value.to.type;\n from_type = \"arrow\";\n attr_list[idx.arrows.to] = {\n attr: attr_list[idx.arrows.to].attr,\n name: attr_list[idx.arrows.to].name,\n value: {\n to: { enabled: true, type: to_type },\n from: { enabled: true, type: from_type },\n },\n };\n\n // only shape of 'from' is assigned and use default for 'to'\n } else if (idx.arrows.from) {\n to_type = \"arrow\";\n from_type = attr_list[idx.arrows.from].value.from.type;\n attr_list[idx.arrows.from] = {\n attr: attr_list[idx.arrows.from].attr,\n name: attr_list[idx.arrows.from].name,\n value: {\n to: { enabled: true, type: to_type },\n from: { enabled: true, type: from_type },\n },\n };\n }\n } else if (dir_type === \"back\") {\n // given both of shapes, but use only 'from'\n if (idx.arrows.to && idx.arrows.from) {\n to_type = \"\";\n from_type = attr_list[idx.arrows.from].value.from.type;\n attr_list[idx.arrows.from] = {\n attr: attr_list[idx.arrows.from].attr,\n name: attr_list[idx.arrows.from].name,\n value: {\n to: { enabled: true, type: to_type },\n from: { enabled: true, type: from_type },\n },\n };\n\n // given shape of 'to', but does not use it\n } else if (idx.arrows.to) {\n to_type = \"\";\n from_type = \"arrow\";\n idx.arrows.from = idx.arrows.to;\n attr_list[idx.arrows.from] = {\n attr: attr_list[idx.arrows.from].attr,\n name: attr_list[idx.arrows.from].name,\n value: {\n to: { enabled: true, type: to_type },\n from: { enabled: true, type: from_type },\n },\n };\n\n // assign given 'from' shape\n } else if (idx.arrows.from) {\n to_type = \"\";\n from_type = attr_list[idx.arrows.from].value.from.type;\n attr_list[idx.arrows.to] = {\n attr: attr_list[idx.arrows.from].attr,\n name: attr_list[idx.arrows.from].name,\n value: {\n to: { enabled: true, type: to_type },\n from: { enabled: true, type: from_type },\n },\n };\n }\n\n attr_list[idx.arrows.from] = {\n attr: attr_list[idx.arrows.from].attr,\n name: attr_list[idx.arrows.from].name,\n value: {\n from: {\n enabled: true,\n type: attr_list[idx.arrows.from].value.from.type,\n },\n },\n };\n } else if (dir_type === \"none\") {\n var idx_arrow;\n if (idx.arrows.to) {\n idx_arrow = idx.arrows.to;\n } else {\n idx_arrow = idx.arrows.from;\n }\n\n attr_list[idx_arrow] = {\n attr: attr_list[idx_arrow].attr,\n name: attr_list[idx_arrow].name,\n value: \"\",\n };\n } else if (dir_type === \"forward\") {\n // given both of shapes, but use only 'to'\n if (idx.arrows.to && idx.arrows.from) {\n to_type = attr_list[idx.arrows.to].value.to.type;\n from_type = \"\";\n attr_list[idx.arrows.to] = {\n attr: attr_list[idx.arrows.to].attr,\n name: attr_list[idx.arrows.to].name,\n value: {\n to: { enabled: true, type: to_type },\n from: { enabled: true, type: from_type },\n },\n };\n\n // assign given 'to' shape\n } else if (idx.arrows.to) {\n to_type = attr_list[idx.arrows.to].value.to.type;\n from_type = \"\";\n attr_list[idx.arrows.to] = {\n attr: attr_list[idx.arrows.to].attr,\n name: attr_list[idx.arrows.to].name,\n value: {\n to: { enabled: true, type: to_type },\n from: { enabled: true, type: from_type },\n },\n };\n\n // given shape of 'from', but does not use it\n } else if (idx.arrows.from) {\n to_type = \"arrow\";\n from_type = \"\";\n idx.arrows.to = idx.arrows.from;\n attr_list[idx.arrows.to] = {\n attr: attr_list[idx.arrows.to].attr,\n name: attr_list[idx.arrows.to].name,\n value: {\n to: { enabled: true, type: to_type },\n from: { enabled: true, type: from_type },\n },\n };\n }\n\n attr_list[idx.arrows.to] = {\n attr: attr_list[idx.arrows.to].attr,\n name: attr_list[idx.arrows.to].name,\n value: {\n to: { enabled: true, type: attr_list[idx.arrows.to].value.to.type },\n },\n };\n } else {\n throw newSyntaxError('Invalid dir type \"' + dir_type + '\"');\n }\n\n // remove 'dir' attribute no need anymore\n attr_list.splice(idx.dir, 1);\n }\n\n // parse 'penwidth'\n var nof_attr_list;\n if (attr_names.includes(\"penwidth\")) {\n var tmp_attr_list = [];\n\n nof_attr_list = attr_list.length;\n for (i = 0; i < nof_attr_list; i++) {\n // exclude 'width' from attr_list if 'penwidth' exists\n if (attr_list[i].name !== \"width\") {\n if (attr_list[i].name === \"penwidth\") {\n attr_list[i].name = \"width\";\n }\n tmp_attr_list.push(attr_list[i]);\n }\n }\n attr_list = tmp_attr_list;\n }\n\n nof_attr_list = attr_list.length;\n for (i = 0; i < nof_attr_list; i++) {\n setValue(attr_list[i].attr, attr_list[i].name, attr_list[i].value);\n }\n\n return attr;\n}\n\n/**\n * Create a syntax error with extra information on current token and index.\n *\n * @param {string} message\n * @returns {SyntaxError} err\n */\nfunction newSyntaxError(message) {\n return new SyntaxError(\n message + ', got \"' + chop(token, 30) + '\" (char ' + index + \")\"\n );\n}\n\n/**\n * Chop off text after a maximum length\n *\n * @param {string} text\n * @param {number} maxLength\n * @returns {string}\n */\nfunction chop(text, maxLength) {\n return text.length <= maxLength ? text : text.substr(0, 27) + \"...\";\n}\n\n/**\n * Execute a function fn for each pair of elements in two arrays\n *\n * @param {Array | *} array1\n * @param {Array | *} array2\n * @param {Function} fn\n */\nfunction forEach2(array1, array2, fn) {\n if (Array.isArray(array1)) {\n array1.forEach(function (elem1) {\n if (Array.isArray(array2)) {\n array2.forEach(function (elem2) {\n fn(elem1, elem2);\n });\n } else {\n fn(elem1, array2);\n }\n });\n } else {\n if (Array.isArray(array2)) {\n array2.forEach(function (elem2) {\n fn(array1, elem2);\n });\n } else {\n fn(array1, array2);\n }\n }\n}\n\n/**\n * Set a nested property on an object\n * When nested objects are missing, they will be created.\n * For example setProp({}, 'font.color', 'red') will return {font: {color: 'red'}}\n *\n * @param {object} object\n * @param {string} path A dot separated string like 'font.color'\n * @param {*} value Value for the property\n * @returns {object} Returns the original object, allows for chaining.\n */\nfunction setProp(object, path, value) {\n var names = path.split(\".\");\n var prop = names.pop();\n\n // traverse over the nested objects\n var obj = object;\n for (var i = 0; i < names.length; i++) {\n var name = names[i];\n if (!(name in obj)) {\n obj[name] = {};\n }\n obj = obj[name];\n }\n\n // set the property value\n obj[prop] = value;\n\n return object;\n}\n\n/**\n * Convert an object with DOT attributes to their vis.js equivalents.\n *\n * @param {object} attr Object with DOT attributes\n * @param {object} mapping\n * @returns {object} Returns an object with vis.js attributes\n */\nfunction convertAttr(attr, mapping) {\n var converted = {};\n\n for (var prop in attr) {\n if (attr.hasOwnProperty(prop)) {\n var visProp = mapping[prop];\n if (Array.isArray(visProp)) {\n visProp.forEach(function (visPropI) {\n setProp(converted, visPropI, attr[prop]);\n });\n } else if (typeof visProp === \"string\") {\n setProp(converted, visProp, attr[prop]);\n } else {\n setProp(converted, prop, attr[prop]);\n }\n }\n }\n\n return converted;\n}\n\n/**\n * Convert a string containing a graph in DOT language into a map containing\n * with nodes and edges in the format of graph.\n *\n * @param {string} data Text containing a graph in DOT-notation\n * @returns {object} graphData\n */\nexport function DOTToGraph(data) {\n // parse the DOT file\n var dotData = parseDOT(data);\n var graphData = {\n nodes: [],\n edges: [],\n options: {},\n };\n\n // copy the nodes\n if (dotData.nodes) {\n dotData.nodes.forEach(function (dotNode) {\n var graphNode = {\n id: dotNode.id,\n label: String(dotNode.label || dotNode.id),\n };\n merge(graphNode, convertAttr(dotNode.attr, NODE_ATTR_MAPPING));\n if (graphNode.image) {\n graphNode.shape = \"image\";\n }\n graphData.nodes.push(graphNode);\n });\n }\n\n // copy the edges\n if (dotData.edges) {\n /**\n * Convert an edge in DOT format to an edge with VisGraph format\n *\n * @param {object} dotEdge\n * @returns {object} graphEdge\n */\n var convertEdge = function (dotEdge) {\n var graphEdge = {\n from: dotEdge.from,\n to: dotEdge.to,\n };\n merge(graphEdge, convertAttr(dotEdge.attr, EDGE_ATTR_MAPPING));\n\n // Add arrows attribute to default styled arrow.\n // The reason why default style is not added in parseAttributeList() is\n // because only default is cleared before here.\n if (graphEdge.arrows == null && dotEdge.type === \"->\") {\n graphEdge.arrows = \"to\";\n }\n\n return graphEdge;\n };\n\n dotData.edges.forEach(function (dotEdge) {\n var from, to;\n if (dotEdge.from instanceof Object) {\n from = dotEdge.from.nodes;\n } else {\n from = {\n id: dotEdge.from,\n };\n }\n\n if (dotEdge.to instanceof Object) {\n to = dotEdge.to.nodes;\n } else {\n to = {\n id: dotEdge.to,\n };\n }\n\n if (dotEdge.from instanceof Object && dotEdge.from.edges) {\n dotEdge.from.edges.forEach(function (subEdge) {\n var graphEdge = convertEdge(subEdge);\n graphData.edges.push(graphEdge);\n });\n }\n\n forEach2(from, to, function (from, to) {\n var subEdge = createEdge(\n graphData,\n from.id,\n to.id,\n dotEdge.type,\n dotEdge.attr\n );\n var graphEdge = convertEdge(subEdge);\n graphData.edges.push(graphEdge);\n });\n\n if (dotEdge.to instanceof Object && dotEdge.to.edges) {\n dotEdge.to.edges.forEach(function (subEdge) {\n var graphEdge = convertEdge(subEdge);\n graphData.edges.push(graphEdge);\n });\n }\n });\n }\n\n // copy the options\n if (dotData.attr) {\n graphData.options = dotData.attr;\n }\n\n return graphData;\n}\n\n/* eslint-enable no-var */\n/* eslint-enable no-unused-vars */\n/* eslint-enable no-prototype-builtins */\n","export type Id = number | string;\n\nexport interface ColorObject {\n background: string;\n border: string;\n highlight: {\n background: string;\n border: string;\n };\n hover: {\n background: string;\n border: string;\n };\n}\n\nexport interface GephiData {\n nodes: GephiNode[];\n edges: GephiEdge[];\n}\nexport interface GephiParseOptions {\n fixed?: boolean;\n inheritColor?: boolean;\n parseColor?: boolean;\n}\n\nexport interface GephiNode {\n id: Id;\n\n attributes?: { title?: string };\n color?: string;\n label?: string;\n size?: number;\n title?: string;\n x?: number;\n y?: number;\n}\nexport interface GephiEdge {\n id: Id;\n source: Id;\n target: Id;\n\n attributes?: { title?: string };\n color?: string;\n label?: string;\n type?: string;\n}\n\nexport interface VisData {\n nodes: VisNode[];\n edges: VisEdge[];\n}\n\nexport interface VisNode {\n id: Id;\n fixed: boolean;\n\n color?: string | ColorObject;\n label?: string;\n size?: number;\n title?: string;\n x?: number;\n y?: number;\n\n attributes?: unknown;\n}\nexport interface VisEdge {\n id: Id;\n from: Id;\n to: Id;\n\n arrows?: \"to\";\n color?: string;\n label?: string;\n title?: string;\n\n attributes?: unknown;\n}\n\n/**\n * Convert Gephi to Vis.\n *\n * @param gephiJSON - The parsed JSON data in Gephi format.\n * @param optionsObj - Additional options.\n *\n * @returns The converted data ready to be used in Vis.\n */\nexport function parseGephi(\n gephiJSON: GephiData,\n optionsObj?: GephiParseOptions\n): VisData {\n const options = {\n edges: {\n inheritColor: false,\n },\n nodes: {\n fixed: false,\n parseColor: false,\n },\n };\n\n if (optionsObj != null) {\n if (optionsObj.fixed != null) {\n options.nodes.fixed = optionsObj.fixed;\n }\n if (optionsObj.parseColor != null) {\n options.nodes.parseColor = optionsObj.parseColor;\n }\n if (optionsObj.inheritColor != null) {\n options.edges.inheritColor = optionsObj.inheritColor;\n }\n }\n\n const gEdges = gephiJSON.edges;\n const vEdges = gEdges.map((gEdge): VisEdge => {\n const vEdge: VisEdge = {\n from: gEdge.source,\n id: gEdge.id,\n to: gEdge.target,\n };\n\n if (gEdge.attributes != null) {\n vEdge.attributes = gEdge.attributes;\n }\n if (gEdge.label != null) {\n vEdge.label = gEdge.label;\n }\n if (gEdge.attributes != null && gEdge.attributes.title != null) {\n vEdge.title = gEdge.attributes.title;\n }\n if (gEdge.type === \"Directed\") {\n vEdge.arrows = \"to\";\n }\n // edge['value'] = gEdge.attributes != null ? gEdge.attributes.Weight : undefined;\n // edge['width'] = edge['value'] != null ? undefined : edgegEdge.size;\n if (gEdge.color && options.edges.inheritColor === false) {\n vEdge.color = gEdge.color;\n }\n\n return vEdge;\n });\n\n const vNodes = gephiJSON.nodes.map((gNode): VisNode => {\n const vNode: VisNode = {\n id: gNode.id,\n fixed: options.nodes.fixed && gNode.x != null && gNode.y != null,\n };\n\n if (gNode.attributes != null) {\n vNode.attributes = gNode.attributes;\n }\n if (gNode.label != null) {\n vNode.label = gNode.label;\n }\n if (gNode.size != null) {\n vNode.size = gNode.size;\n }\n if (gNode.attributes != null && gNode.attributes.title != null) {\n vNode.title = gNode.attributes.title;\n }\n if (gNode.title != null) {\n vNode.title = gNode.title;\n }\n if (gNode.x != null) {\n vNode.x = gNode.x;\n }\n if (gNode.y != null) {\n vNode.y = gNode.y;\n }\n if (gNode.color != null) {\n if (options.nodes.parseColor === true) {\n vNode.color = gNode.color;\n } else {\n vNode.color = {\n background: gNode.color,\n border: gNode.color,\n highlight: {\n background: gNode.color,\n border: gNode.color,\n },\n hover: {\n background: gNode.color,\n border: gNode.color,\n },\n };\n }\n }\n\n return vNode;\n });\n\n return { nodes: vNodes, edges: vEdges };\n}\n","export interface Locale {\n addDescription: string;\n addEdge: string;\n addNode: string;\n back: string;\n close: string;\n createEdgeError: string;\n del: string;\n deleteClusterError: string;\n edgeDescription: string;\n edit: string;\n editClusterError: string;\n editEdge: string;\n editEdgeDescription: string;\n editNode: string;\n}\nexport type Locales = Record<string, Locale>;\n\n// English\nexport const en: Locale = {\n addDescription: \"Click in an empty space to place a new node.\",\n addEdge: \"Add Edge\",\n addNode: \"Add Node\",\n back: \"Back\",\n close: \"Close\",\n createEdgeError: \"Cannot link edges to a cluster.\",\n del: \"Delete selected\",\n deleteClusterError: \"Clusters cannot be deleted.\",\n edgeDescription:\n \"Click on a node and drag the edge to another node to connect them.\",\n edit: \"Edit\",\n editClusterError: \"Clusters cannot be edited.\",\n editEdge: \"Edit Edge\",\n editEdgeDescription:\n \"Click on the control points and drag them to a node to connect to it.\",\n editNode: \"Edit Node\",\n};\n\n// German\nexport const de: Locale = {\n addDescription:\n \"Klicke auf eine freie Stelle, um einen neuen Knoten zu plazieren.\",\n addEdge: \"Kante hinzuf\\u00fcgen\",\n addNode: \"Knoten hinzuf\\u00fcgen\",\n back: \"Zur\\u00fcck\",\n close: \"Schließen\",\n createEdgeError:\n \"Es ist nicht m\\u00f6glich, Kanten mit Clustern zu verbinden.\",\n del: \"L\\u00f6sche Auswahl\",\n deleteClusterError: \"Cluster k\\u00f6nnen nicht gel\\u00f6scht werden.\",\n edgeDescription:\n \"Klicke auf einen Knoten und ziehe die Kante zu einem anderen Knoten, um diese zu verbinden.\",\n edit: \"Editieren\",\n editClusterError: \"Cluster k\\u00f6nnen nicht editiert werden.\",\n editEdge: \"Kante editieren\",\n editEdgeDescription:\n \"Klicke auf die Verbindungspunkte und ziehe diese auf einen Knoten, um sie zu verbinden.\",\n editNode: \"Knoten editieren\",\n};\n\n// Spanish\nexport const es: Locale = {\n addDescription:\n \"Haga clic en un lugar vac\\u00edo para colocar un nuevo nodo.\",\n addEdge: \"A\\u00f1adir arista\",\n addNode: \"A\\u00f1adir nodo\",\n back: \"Atr\\u00e1s\",\n close: \"Cerrar\",\n createEdgeError: \"No se puede conectar una arista a un grupo.\",\n del: \"Eliminar selecci\\u00f3n\",\n deleteClusterError: \"No es posible eliminar grupos.\",\n edgeDescription:\n \"Haga clic en un nodo y arrastre la arista hacia otro nodo para conectarlos.\",\n edit: \"Editar\",\n editClusterError: \"No es posible editar grupos.\",\n editEdge: \"Editar arista\",\n editEdgeDescription:\n \"Haga clic en un punto de control y arrastrelo a un nodo para conectarlo.\",\n editNode: \"Editar nodo\",\n};\n\n//Italiano\nexport const it: Locale = {\n addDescription: \"Clicca per aggiungere un nuovo nodo\",\n addEdge: \"Aggiungi un vertice\",\n addNode: \"Aggiungi un nodo\",\n back: \"Indietro\",\n close: \"Chiudere\",\n createEdgeError: \"Non si possono collegare vertici ad un cluster\",\n del: \"Cancella la selezione\",\n deleteClusterError: \"I cluster non possono essere cancellati\",\n edgeDescription:\n \"Clicca su un nodo e trascinalo ad un altro nodo per connetterli.\",\n edit: \"Modifica\",\n editClusterError: \"I clusters non possono essere modificati.\",\n editEdge: \"Modifica il vertice\",\n editEdgeDescription:\n \"Clicca sui Punti di controllo e trascinali ad un nodo per connetterli.\",\n editNode: \"Modifica il nodo\",\n};\n\n// Dutch\nexport const nl: Locale = {\n addDescription: \"Klik op een leeg gebied om een nieuwe node te maken.\",\n addEdge: \"Link toevoegen\",\n addNode: \"Node toevoegen\",\n back: \"Terug\",\n close: \"Sluiten\",\n createEdgeError: \"Kan geen link maken naar een cluster.\",\n del: \"Selectie verwijderen\",\n deleteClusterError: \"Clusters kunnen niet worden verwijderd.\",\n edgeDescription:\n \"Klik op een node en sleep de link naar een andere node om ze te verbinden.\",\n edit: \"Wijzigen\",\n editClusterError: \"Clusters kunnen niet worden aangepast.\",\n editEdge: \"Link wijzigen\",\n editEdgeDescription:\n \"Klik op de verbindingspunten en sleep ze naar een node om daarmee te verbinden.\",\n editNode: \"Node wijzigen\",\n};\n\n// Portuguese Brazil\nexport const pt: Locale = {\n addDescription: \"Clique em um espaço em branco para adicionar um novo nó\",\n addEdge: \"Adicionar aresta\",\n addNode: \"Adicionar nó\",\n back: \"Voltar\",\n close: \"Fechar\",\n createEdgeError: \"Não foi possível linkar arestas a um cluster.\",\n del: \"Remover selecionado\",\n deleteClusterError: \"Clusters não puderam ser removidos.\",\n edgeDescription:\n \"Clique em um nó e arraste a aresta até outro nó para conectá-los\",\n edit: \"Editar\",\n editClusterError: \"Clusters não puderam ser editados.\",\n editEdge: \"Editar aresta\",\n editEdgeDescription:\n \"Clique nos pontos de controle e os arraste para um nó para conectá-los\",\n editNode: \"Editar nó\",\n};\n\n// Russian\nexport const ru: Locale = {\n addDescription: \"Кликните в свободное место, чтобы добавить новый узел.\",\n addEdge: \"Добавить ребро\",\n addNode: \"Добавить узел\",\n back: \"Назад\",\n close: \"Закрывать\",\n createEdgeError: \"Невозможно соединить ребра в кластер.\",\n del: \"Удалить выбранное\",\n deleteClusterError: \"Кластеры не могут быть удалены\",\n edgeDescription:\n \"Кликните на узел и протяните ребро к другому узлу, чтобы соединить их.\",\n edit: \"Редактировать\",\n editClusterError: \"Кластеры недоступны для редактирования.\",\n editEdge: \"Редактировать ребро\",\n editEdgeDescription:\n \"Кликните на контрольные точки и перетащите их в узел, чтобы подключиться к нему.\",\n editNode: \"Редактировать узел\",\n};\n\n// Chinese\nexport const cn: Locale = {\n addDescription: \"单击空白处放置新节点。\",\n addEdge: \"添加连接线\",\n addNode: \"添加节点\",\n back: \"返回\",\n close: \"關閉\",\n createEdgeError: \"无法将连接线连接到群集。\",\n del: \"删除选定\",\n deleteClusterError: \"无法删除群集。\",\n edgeDescription: \"单击某个节点并将该连接线拖动到另一个节点以连接它们。\",\n edit: \"编辑\",\n editClusterError: \"无法编辑群集。\",\n editEdge: \"编辑连接线\",\n editEdgeDescription: \"单击控制节点并将它们拖到节点上连接。\",\n editNode: \"编辑节点\",\n};\n\n// Ukrainian\nexport const uk: Locale = {\n addDescription: \"Kлікніть на вільне місце, щоб додати новий вузол.\",\n addEdge: \"Додати край\",\n addNode: \"Додати вузол\",\n back: \"Назад\",\n close: \"Закрити\",\n createEdgeError: \"Не можливо об'єднати краї в групу.\",\n del: \"Видалити обране\",\n deleteClusterError: \"Групи не можуть бути видалені.\",\n edgeDescription:\n \"Клікніть на вузол і перетягніть край до іншого вузла, щоб їх з'єднати.\",\n edit: \"Редагувати\",\n editClusterError: \"Групи недоступні для редагування.\",\n editEdge: \"Редагувати край\",\n editEdgeDescription:\n \"Клікніть на контрольні точки і перетягніть їх у вузол, щоб підключитися до нього.\",\n editNode: \"Редагувати вузол\",\n};\n\n// French\nexport const fr: Locale = {\n addDescription: \"Cliquez dans un endroit vide pour placer un nœud.\",\n addEdge: \"Ajouter un lien\",\n addNode: \"Ajouter un nœud\",\n back: \"Retour\",\n close: \"Fermer\",\n createEdgeError: \"Impossible de créer un lien vers un cluster.\",\n del: \"Effacer la sélection\",\n deleteClusterError: \"Les clusters ne peuvent pas être effacés.\",\n edgeDescription:\n \"Cliquez sur un nœud et glissez le lien vers un autre nœud pour les connecter.\",\n edit: \"Éditer\",\n editClusterError: \"Les clusters ne peuvent pas être édités.\",\n editEdge: \"Éditer le lien\",\n editEdgeDescription:\n \"Cliquez sur les points de contrôle et glissez-les pour connecter un nœud.\",\n editNode: \"Éditer le nœud\",\n};\n\n// Czech\nexport const cs: Locale = {\n addDescription: \"Kluknutím do prázdného prostoru můžete přidat nový vrchol.\",\n addEdge: \"Přidat hranu\",\n addNode: \"Přidat vrchol\",\n back: \"Zpět\",\n close: \"Zavřít\",\n createEdgeError: \"Nelze připojit hranu ke shluku.\",\n del: \"Smazat výběr\",\n deleteClusterError: \"Nelze mazat shluky.\",\n edgeDescription:\n \"Přetažením z jednoho vrcholu do druhého můžete spojit tyto vrcholy novou hranou.\",\n edit: \"Upravit\",\n editClusterError: \"Nelze upravovat shluky.\",\n editEdge: \"Upravit hranu\",\n editEdgeDescription:\n \"Přetažením kontrolního vrcholu hrany ji můžete připojit k jinému vrcholu.\",\n editNode: \"Upravit vrchol\",\n};\n","/**\n * Normalizes language code into the format used internally.\n *\n * @param locales - All the available locales.\n * @param rawCode - The original code as supplied by the user.\n *\n * @returns Language code in the format language-COUNTRY or language, eventually\n * fallbacks to en.\n */\nexport function normalizeLanguageCode(\n locales: Record<string, undefined | object>,\n rawCode: string\n): string {\n try {\n const [rawLanguage, rawCountry] = rawCode.split(/[-_ /]/, 2);\n const language = rawLanguage != null ? rawLanguage.toLowerCase() : null;\n const country = rawCountry != null ? rawCountry.toUpperCase() : null;\n\n if (language && country) {\n const code = language + \"-\" + country;\n if (Object.prototype.hasOwnProperty.call(locales, code)) {\n return code;\n } else {\n console.warn(`Unknown variant ${country} of language ${language}.`);\n }\n }\n\n if (language) {\n const code = language;\n if (Object.prototype.hasOwnProperty.call(locales, code)) {\n return code;\n } else {\n console.warn(`Unknown language ${language}`);\n }\n }\n\n console.warn(`Unknown locale ${rawCode}, falling back to English.`);\n\n return \"en\";\n } catch (error) {\n console.error(error);\n console.warn(\n `Unexpected error while normalizing locale ${rawCode}, falling back to English.`\n );\n\n return \"en\";\n }\n}\n","/**\n * Associates a canvas to a given image, containing a number of renderings\n * of the image at various sizes.\n *\n * This technique is known as 'mipmapping'.\n *\n * NOTE: Images can also be of type 'data:svg+xml`. This code also works\n * for svg, but the mipmapping may not be necessary.\n *\n * @param {Image} image\n */\nclass CachedImage {\n /**\n * @ignore\n */\n constructor() {\n this.NUM_ITERATIONS = 4; // Number of items in the coordinates array\n\n this.image = new Image();\n this.canvas = document.createElement(\"canvas\");\n }\n\n /**\n * Called when the image has been successfully loaded.\n */\n init() {\n if (this.initialized()) return;\n\n this.src = this.image.src; // For same interface with Image\n const w = this.image.width;\n const h = this.image.height;\n\n // Ease external access\n this.width = w;\n this.height = h;\n\n const h2 = Math.floor(h / 2);\n const h4 = Math.floor(h / 4);\n const h8 = Math.floor(h / 8);\n const h16 = Math.floor(h / 16);\n\n const w2 = Math.floor(w / 2);\n const w4 = Math.floor(w / 4);\n const w8 = Math.floor(w / 8);\n const w16 = Math.floor(w / 16);\n\n // Make canvas as small as possible\n this.canvas.width = 3 * w4;\n this.canvas.height = h2;\n\n // Coordinates and sizes of images contained in the canvas\n // Values per row: [top x, left y, width, height]\n\n this.coordinates = [\n [0, 0, w2, h2],\n [w2, 0, w4, h4],\n [w2, h4, w8, h8],\n [5 * w8, h4, w16, h16],\n ];\n\n this._fillMipMap();\n }\n\n /**\n * @returns {boolean} true if init() has been called, false otherwise.\n */\n initialized() {\n return this.coordinates !== undefined;\n }\n\n /**\n * Redraw main image in various sizes to the context.\n *\n * The rationale behind this is to reduce artefacts due to interpolation\n * at differing zoom levels.\n *\n * Source: http://stackoverflow.com/q/18761404/1223531\n *\n * This methods takes the resizing out of the drawing loop, in order to\n * reduce performance overhead.\n *\n * TODO: The code assumes that a 2D context can always be gotten. This is\n * not necessarily true! OTOH, if not true then usage of this class\n * is senseless.\n *\n * @private\n */\n _fillMipMap() {\n const ctx = this.canvas.getContext(\"2d\");\n\n // First zoom-level comes from the image\n const to = this.coordinates[0];\n ctx.drawImage(this.image, to[0], to[1], to[2], to[3]);\n\n // The rest are copy actions internal to the canvas/context\n for (let iterations = 1; iterations < this.NUM_ITERATIONS; iterations++) {\n const from = this.coordinates[iterations - 1];\n const to = this.coordinates[iterations];\n\n ctx.drawImage(\n this.canvas,\n from[0],\n from[1],\n from[2],\n from[3],\n to[0],\n to[1],\n to[2],\n to[3]\n );\n }\n }\n\n /**\n * Draw the image, using the mipmap if necessary.\n *\n * MipMap is only used if param factor > 2; otherwise, original bitmap\n * is resized. This is also used to skip mipmap usage, e.g. by setting factor = 1\n *\n * Credits to 'Alex de Mulder' for original implementation.\n *\n * @param {CanvasRenderingContext2D} ctx context on which to draw zoomed image\n * @param {Float} factor scale factor at which to draw\n * @param {number} left\n * @param {number} top\n * @param {number} width\n * @param {number} height\n */\n drawImageAtPosition(ctx, factor, left, top, width, height) {\n if (!this.initialized()) return; //can't draw image yet not intialized\n\n if (factor > 2) {\n // Determine which zoomed image to use\n factor *= 0.5;\n let iterations = 0;\n while (factor > 2 && iterations < this.NUM_ITERATIONS) {\n factor *= 0.5;\n iterations += 1;\n }\n\n if (iterations >= this.NUM_ITERATIONS) {\n iterations = this.NUM_ITERATIONS - 1;\n }\n //console.log(\"iterations: \" + iterations);\n\n const from = this.coordinates[iterations];\n ctx.drawImage(\n this.canvas,\n from[0],\n from[1],\n from[2],\n from[3],\n left,\n top,\n width,\n height\n );\n } else {\n // Draw image directly\n ctx.drawImage(this.image, left, top, width, height);\n }\n }\n}\n\nexport default CachedImage;\n","import CachedImage from \"./CachedImage\";\n\n/**\n * This callback is a callback that accepts an Image.\n *\n * @callback ImageCallback\n * @param {Image} image\n */\n\n/**\n * This class loads images and keeps them stored.\n *\n * @param {ImageCallback} callback\n */\nclass Images {\n /**\n * @param {ImageCallback} callback\n */\n constructor(callback) {\n this.images = {};\n this.imageBroken = {};\n this.callback = callback;\n }\n\n /**\n * @param {string} url The original Url that failed to load, if the broken image is successfully loaded it will be added to the cache using this Url as the key so that subsequent requests for this Url will return the broken image\n * @param {string} brokenUrl Url the broken image to try and load\n * @param {Image} imageToLoadBrokenUrlOn The image object\n */\n _tryloadBrokenUrl(url, brokenUrl, imageToLoadBrokenUrlOn) {\n //If these parameters aren't specified then exit the function because nothing constructive can be done\n if (url === undefined || imageToLoadBrokenUrlOn === undefined) return;\n if (brokenUrl === undefined) {\n console.warn(\"No broken url image defined\");\n return;\n }\n\n //Clear the old subscription to the error event and put a new in place that only handle errors in loading the brokenImageUrl\n imageToLoadBrokenUrlOn.image.onerror = () => {\n console.error(\"Could not load brokenImage:\", brokenUrl);\n // cache item will contain empty image, this should be OK for default\n };\n\n //Set the source of the image to the brokenUrl, this is actually what kicks off the loading of the broken image\n imageToLoadBrokenUrlOn.image.src = brokenUrl;\n }\n\n /**\n *\n * @param {vis.Image} imageToRedrawWith\n * @private\n */\n _redrawWithImage(imageToRedrawWith) {\n if (this.callback) {\n this.callback(imageToRedrawWith);\n }\n }\n\n /**\n * @param {string} url Url of the image\n * @param {string} brokenUrl Url of an image to use if the url image is not found\n * @returns {Image} img The image object\n */\n load(url, brokenUrl) {\n //Try and get the image from the cache, if successful then return the cached image\n const cachedImage = this.images[url];\n if (cachedImage) return cachedImage;\n\n //Create a new image\n const img = new CachedImage();\n\n // Need to add to cache here, otherwise final return will spawn different copies of the same image,\n // Also, there will be multiple loads of the same image.\n this.images[url] = img;\n\n //Subscribe to the event that is raised if the image loads successfully\n img.image.onload = () => {\n // Properly init the cached item and then request a redraw\n this._fixImageCoordinates(img.image);\n img.init();\n this._redrawWithImage(img);\n };\n\n //Subscribe to the event that is raised if the image fails to load\n img.image.onerror = () => {\n console.error(\"Could not load image:\", url);\n //Try and load the image specified by the brokenUrl using\n this._tryloadBrokenUrl(url, brokenUrl, img);\n };\n\n //Set the source of the image to the url, this is what actually kicks off the loading of the image\n img.image.src = url;\n\n //Return the new image\n return img;\n }\n\n /**\n * IE11 fix -- thanks dponch!\n *\n * Local helper function\n *\n * @param {vis.Image} imageToCache\n * @private\n */\n _fixImageCoordinates(imageToCache) {\n if (imageToCache.width === 0) {\n document.body.appendChild(imageToCache);\n imageToCache.width = imageToCache.offsetWidth;\n imageToCache.height = imageToCache.offsetHeight;\n document.body.removeChild(imageToCache);\n }\n }\n}\n\nexport default Images;\n","var fails = require('../internals/fails');\n\nmodule.exports = !fails(function () {\n // eslint-disable-next-line es/no-object-isextensible, es/no-object-preventextensions -- required for testing\n return Object.isExtensible(Object.preventExtensions({}));\n});\n","var $ = require('../internals/export');\nvar 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 getOwnPropertyNamesModule = require('../internals/object-get-own-property-names');\nvar getOwnPropertyNamesExternalModule = require('../internals/object-get-own-property-names-external');\nvar uid = require('../internals/uid');\nvar FREEZING = require('../internals/freezing');\n\nvar REQUIRED = false;\nvar METADATA = uid('meta');\nvar id = 0;\n\n// eslint-disable-next-line es/no-object-isextensible -- safe\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 && REQUIRED && isExtensible(it) && !has(it, METADATA)) setMetadata(it);\n return it;\n};\n\nvar enable = function () {\n meta.enable = function () { /* empty */ };\n REQUIRED = true;\n var getOwnPropertyNames = getOwnPropertyNamesModule.f;\n var splice = [].splice;\n var test = {};\n test[METADATA] = 1;\n\n // prevent exposing of metadata key\n if (getOwnPropertyNames(test).length) {\n getOwnPropertyNamesModule.f = function (it) {\n var result = getOwnPropertyNames(it);\n for (var i = 0, length = result.length; i < length; i++) {\n if (result[i] === METADATA) {\n splice.call(result, i, 1);\n break;\n }\n } return result;\n };\n\n $({ target: 'Object', stat: true, forced: true }, {\n getOwnPropertyNames: getOwnPropertyNamesExternalModule.f\n });\n }\n};\n\nvar meta = module.exports = {\n enable: enable,\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.enable();\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 // `{ Map, Set }.prototype.clear()` methods\n // https://tc39.es/ecma262/#sec-map.prototype.clear\n // https://tc39.es/ecma262/#sec-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 // `{ Map, Set }.prototype.delete(key)` methods\n // https://tc39.es/ecma262/#sec-map.prototype.delete\n // https://tc39.es/ecma262/#sec-set.prototype.delete\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 // `{ Map, Set }.prototype.forEach(callbackfn, thisArg = undefined)` methods\n // https://tc39.es/ecma262/#sec-map.prototype.foreach\n // https://tc39.es/ecma262/#sec-set.prototype.foreach\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 // `{ Map, Set}.prototype.has(key)` methods\n // https://tc39.es/ecma262/#sec-map.prototype.has\n // https://tc39.es/ecma262/#sec-set.prototype.has\n has: function has(key) {\n return !!getEntry(this, key);\n }\n });\n\n redefineAll(C.prototype, IS_MAP ? {\n // `Map.prototype.get(key)` method\n // https://tc39.es/ecma262/#sec-map.prototype.get\n get: function get(key) {\n var entry = getEntry(this, key);\n return entry && entry.value;\n },\n // `Map.prototype.set(key, value)` method\n // https://tc39.es/ecma262/#sec-map.prototype.set\n set: function set(key, value) {\n return define(this, key === 0 ? 0 : key, value);\n }\n } : {\n // `Set.prototype.add(value)` method\n // https://tc39.es/ecma262/#sec-set.prototype.add\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 // `{ Map, Set }.prototype.{ keys, values, entries, @@iterator }()` methods\n // https://tc39.es/ecma262/#sec-map.prototype.entries\n // https://tc39.es/ecma262/#sec-map.prototype.keys\n // https://tc39.es/ecma262/#sec-map.prototype.values\n // https://tc39.es/ecma262/#sec-map.prototype-@@iterator\n // https://tc39.es/ecma262/#sec-set.prototype.entries\n // https://tc39.es/ecma262/#sec-set.prototype.keys\n // https://tc39.es/ecma262/#sec-set.prototype.values\n // https://tc39.es/ecma262/#sec-set.prototype-@@iterator\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 // `{ Map, Set }.prototype[@@species]` accessors\n // https://tc39.es/ecma262/#sec-get-map-@@species\n // https://tc39.es/ecma262/#sec-get-set-@@species\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.es/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.array.iterator');\nrequire('../../modules/es.map');\nrequire('../../modules/es.object.to-string');\nrequire('../../modules/es.string.iterator');\nvar path = require('../../internals/path');\n\nmodule.exports = path.Map;\n","var parent = require('../../es/map');\nrequire('../../modules/web.dom-collections.iterator');\n\nmodule.exports = parent;\n","module.exports = require(\"core-js-pure/stable/map\");","/**\n * This class can store groups and options specific for groups.\n */\nexport class Groups {\n /**\n * @ignore\n */\n constructor() {\n this.clear();\n this._defaultIndex = 0;\n this._groupIndex = 0;\n\n this._defaultGroups = [\n {\n border: \"#2B7CE9\",\n background: \"#97C2FC\",\n highlight: { border: \"#2B7CE9\", background: \"#D2E5FF\" },\n hover: { border: \"#2B7CE9\", background: \"#D2E5FF\" },\n }, // 0: blue\n {\n border: \"#FFA500\",\n background: \"#FFFF00\",\n highlight: { border: \"#FFA500\", background: \"#FFFFA3\" },\n hover: { border: \"#FFA500\", background: \"#FFFFA3\" },\n }, // 1: yellow\n {\n border: \"#FA0A10\",\n background: \"#FB7E81\",\n highlight: { border: \"#FA0A10\", background: \"#FFAFB1\" },\n hover: { border: \"#FA0A10\", background: \"#FFAFB1\" },\n }, // 2: red\n {\n border: \"#41A906\",\n background: \"#7BE141\",\n highlight: { border: \"#41A906\", background: \"#A1EC76\" },\n hover: { border: \"#41A906\", background: \"#A1EC76\" },\n }, // 3: green\n {\n border: \"#E129F0\",\n background: \"#EB7DF4\",\n highlight: { border: \"#E129F0\", background: \"#F0B3F5\" },\n hover: { border: \"#E129F0\", background: \"#F0B3F5\" },\n }, // 4: magenta\n {\n border: \"#7C29F0\",\n background: \"#AD85E4\",\n highlight: { border: \"#7C29F0\", background: \"#D3BDF0\" },\n hover: { border: \"#7C29F0\", background: \"#D3BDF0\" },\n }, // 5: purple\n {\n border: \"#C37F00\",\n background: \"#FFA807\",\n highlight: { border: \"#C37F00\", background: \"#FFCA66\" },\n hover: { border: \"#C37F00\", background: \"#FFCA66\" },\n }, // 6: orange\n {\n border: \"#4220FB\",\n background: \"#6E6EFD\",\n highlight: { border: \"#4220FB\", background: \"#9B9BFD\" },\n hover: { border: \"#4220FB\", background: \"#9B9BFD\" },\n }, // 7: darkblue\n {\n border: \"#FD5A77\",\n background: \"#FFC0CB\",\n highlight: { border: \"#FD5A77\", background: \"#FFD1D9\" },\n hover: { border: \"#FD5A77\", background: \"#FFD1D9\" },\n }, // 8: pink\n {\n border: \"#4AD63A\",\n background: \"#C2FABC\",\n highlight: { border: \"#4AD63A\", background: \"#E6FFE3\" },\n hover: { border: \"#4AD63A\", background: \"#E6FFE3\" },\n }, // 9: mint\n\n {\n border: \"#990000\",\n background: \"#EE0000\",\n highlight: { border: \"#BB0000\", background: \"#FF3333\" },\n hover: { border: \"#BB0000\", background: \"#FF3333\" },\n }, // 10:bright red\n\n {\n border: \"#FF6000\",\n background: \"#FF6000\",\n highlight: { border: \"#FF6000\", background: \"#FF6000\" },\n hover: { border: \"#FF6000\", background: \"#FF6000\" },\n }, // 12: real orange\n {\n border: \"#97C2FC\",\n background: \"#2B7CE9\",\n highlight: { border: \"#D2E5FF\", background: \"#2B7CE9\" },\n hover: { border: \"#D2E5FF\", background: \"#2B7CE9\" },\n }, // 13: blue\n {\n border: \"#399605\",\n background: \"#255C03\",\n highlight: { border: \"#399605\", background: \"#255C03\" },\n hover: { border: \"#399605\", background: \"#255C03\" },\n }, // 14: green\n {\n border: \"#B70054\",\n background: \"#FF007E\",\n highlight: { border: \"#B70054\", background: \"#FF007E\" },\n hover: { border: \"#B70054\", background: \"#FF007E\" },\n }, // 15: magenta\n {\n border: \"#AD85E4\",\n background: \"#7C29F0\",\n highlight: { border: \"#D3BDF0\", background: \"#7C29F0\" },\n hover: { border: \"#D3BDF0\", background: \"#7C29F0\" },\n }, // 16: purple\n {\n border: \"#4557FA\",\n background: \"#000EA1\",\n highlight: { border: \"#6E6EFD\", background: \"#000EA1\" },\n hover: { border: \"#6E6EFD\", background: \"#000EA1\" },\n }, // 17: darkblue\n {\n border: \"#FFC0CB\",\n background: \"#FD5A77\",\n highlight: { border: \"#FFD1D9\", background: \"#FD5A77\" },\n hover: { border: \"#FFD1D9\", background: \"#FD5A77\" },\n }, // 18: pink\n {\n border: \"#C2FABC\",\n background: \"#74D66A\",\n highlight: { border: \"#E6FFE3\", background: \"#74D66A\" },\n hover: { border: \"#E6FFE3\", background: \"#74D66A\" },\n }, // 19: mint\n\n {\n border: \"#EE0000\",\n background: \"#990000\",\n highlight: { border: \"#FF3333\", background: \"#BB0000\" },\n hover: { border: \"#FF3333\", background: \"#BB0000\" },\n }, // 20:bright red\n ];\n\n this.options = {};\n this.defaultOptions = {\n useDefaultGroups: true,\n };\n Object.assign(this.options, this.defaultOptions);\n }\n\n /**\n *\n * @param {object} options\n */\n setOptions(options) {\n const optionFields = [\"useDefaultGroups\"];\n\n if (options !== undefined) {\n for (const groupName in options) {\n if (Object.prototype.hasOwnProperty.call(options, groupName)) {\n if (optionFields.indexOf(groupName) === -1) {\n const group = options[groupName];\n this.add(groupName, group);\n }\n }\n }\n }\n }\n\n /**\n * Clear all groups\n */\n clear() {\n this._groups = new Map();\n this._groupNames = [];\n }\n\n /**\n * Get group options of a groupname.\n * If groupname is not found, a new group may be created.\n *\n * @param {*} groupname Can be a number, string, Date, etc.\n * @param {boolean} [shouldCreate=true] If true, create a new group\n * @returns {object} The found or created group\n */\n get(groupname, shouldCreate = true) {\n let group = this._groups.get(groupname);\n\n if (group === undefined && shouldCreate) {\n if (\n this.options.useDefaultGroups === false &&\n this._groupNames.length > 0\n ) {\n // create new group\n const index = this._groupIndex % this._groupNames.length;\n ++this._groupIndex;\n group = {};\n group.color = this._groups.get(this._groupNames[index]);\n this._groups.set(groupname, group);\n } else {\n // create new group\n const index = this._defaultIndex % this._defaultGroups.length;\n this._defaultIndex++;\n group = {};\n group.color = this._defaultGroups[index];\n this._groups.set(groupname, group);\n }\n }\n\n return group;\n }\n\n /**\n * Add custom group style.\n *\n * @param {string} groupName - The name of the group, a new group will be\n * created if a group with the same name doesn't exist, otherwise the old\n * groups style will be overwritten.\n * @param {object} style - An object containing borderColor, backgroundColor,\n * etc.\n * @returns {object} The created group object.\n */\n add(groupName, style) {\n // Only push group name once to prevent duplicates which would consume more\n // RAM and also skew the distribution towards more often updated groups,\n // neither of which is desirable.\n if (!this._groups.has(groupName)) {\n this._groupNames.push(groupName);\n }\n this._groups.set(groupName, style);\n return style;\n }\n}\n","var $ = require('../internals/export');\n\n// `Number.isNaN` method\n// https://tc39.es/ecma262/#sec-number.isnan\n$({ target: 'Number', stat: true }, {\n isNaN: function isNaN(number) {\n // eslint-disable-next-line no-self-compare -- NaN check\n return number != number;\n }\n});\n","require('../../modules/es.number.is-nan');\nvar path = require('../../internals/path');\n\nmodule.exports = path.Number.isNaN;\n","var parent = require('../../es/number/is-nan');\n\nmodule.exports = parent;\n","module.exports = require(\"core-js-pure/stable/number/is-nan\");","var global = require('../internals/global');\n\nvar globalIsFinite = global.isFinite;\n\n// `Number.isFinite` method\n// https://tc39.es/ecma262/#sec-number.isfinite\n// eslint-disable-next-line es/no-number-isfinite -- safe\nmodule.exports = Number.isFinite || function isFinite(it) {\n return typeof it == 'number' && globalIsFinite(it);\n};\n","var $ = require('../internals/export');\nvar numberIsFinite = require('../internals/number-is-finite');\n\n// `Number.isFinite` method\n// https://tc39.es/ecma262/#sec-number.isfinite\n$({ target: 'Number', stat: true }, { isFinite: numberIsFinite });\n","require('../../modules/es.number.is-finite');\nvar path = require('../../internals/path');\n\nmodule.exports = path.Number.isFinite;\n","var parent = require('../../es/number/is-finite');\n\nmodule.exports = parent;\n","module.exports = require(\"core-js-pure/stable/number/is-finite\");","'use strict';\nvar $ = require('../internals/export');\nvar $some = require('../internals/array-iteration').some;\nvar arrayMethodIsStrict = require('../internals/array-method-is-strict');\n\nvar STRICT_METHOD = arrayMethodIsStrict('some');\n\n// `Array.prototype.some` method\n// https://tc39.es/ecma262/#sec-array.prototype.some\n$({ target: 'Array', proto: true, forced: !STRICT_METHOD }, {\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 $ = 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.es/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\");","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;\nmodule.exports[\"default\"] = module.exports, module.exports.__esModule = true;","var parent = require('../../stable/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.es/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","var parent = require('../../stable/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 module.exports[\"default\"] = module.exports, module.exports.__esModule = true;\n return _setPrototypeOf(o, p);\n}\n\nmodule.exports = _setPrototypeOf;\nmodule.exports[\"default\"] = module.exports, module.exports.__esModule = true;","var _Object$create = require(\"@babel/runtime-corejs3/core-js/object/create\");\n\nvar setPrototypeOf = require(\"./setPrototypeOf.js\");\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;\nmodule.exports[\"default\"] = module.exports, module.exports.__esModule = true;","var _typeof = require(\"@babel/runtime-corejs3/helpers/typeof\")[\"default\"];\n\nvar assertThisInitialized = require(\"./assertThisInitialized.js\");\n\nfunction _possibleConstructorReturn(self, call) {\n if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) {\n return call;\n } else if (call !== void 0) {\n throw new TypeError(\"Derived constructors may only return object or undefined\");\n }\n\n return assertThisInitialized(self);\n}\n\nmodule.exports = _possibleConstructorReturn;\nmodule.exports[\"default\"] = module.exports, module.exports.__esModule = true;","var parent = require('../../stable/object/get-prototype-of');\n\nmodule.exports = parent;\n","module.exports = require(\"core-js-pure/features/object/get-prototype-of\");","var _Object$setPrototypeOf = require(\"@babel/runtime-corejs3/core-js/object/set-prototype-of\");\n\nvar _Object$getPrototypeOf = require(\"@babel/runtime-corejs3/core-js/object/get-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 module.exports[\"default\"] = module.exports, module.exports.__esModule = true;\n return _getPrototypeOf(o);\n}\n\nmodule.exports = _getPrototypeOf;\nmodule.exports[\"default\"] = module.exports, module.exports.__esModule = true;","/**\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 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.es/ecma262/#sec-array.prototype.reduce\n left: createMethod(false),\n // `Array.prototype.reduceRight` method\n // https://tc39.es/ecma262/#sec-array.prototype.reduceright\n right: createMethod(true)\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 CHROME_VERSION = require('../internals/engine-v8-version');\nvar IS_NODE = require('../internals/engine-is-node');\n\nvar STRICT_METHOD = arrayMethodIsStrict('reduce');\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.es/ecma262/#sec-array.prototype.reduce\n$({ target: 'Array', proto: true, forced: !STRICT_METHOD || 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 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","'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://tc39.es/ecma262/#sec-array.prototype.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","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\");","'use strict';\nvar collection = require('../internals/collection');\nvar collectionStrong = require('../internals/collection-strong');\n\n// `Set` constructor\n// https://tc39.es/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.array.iterator');\nrequire('../../modules/es.object.to-string');\nrequire('../../modules/es.set');\nrequire('../../modules/es.string.iterator');\nvar path = require('../../internals/path');\n\nmodule.exports = path.Set;\n","var parent = require('../../es/set');\nrequire('../../modules/web.dom-collections.iterator');\n\nmodule.exports = parent;\n","module.exports = require(\"core-js-pure/stable/set\");","module.exports = require(\"core-js-pure/stable/symbol/iterator\");","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/es.array.iterator');\nrequire('../modules/es.string.iterator');\nvar getIterator = require('../internals/get-iterator');\n\nmodule.exports = getIterator;\n","var parent = require('../es/get-iterator');\nrequire('../modules/web.dom-collections.iterator');\n\nmodule.exports = parent;\n","var parent = require('../stable/get-iterator');\n\nmodule.exports = parent;\n","module.exports = require(\"core-js-pure/features/get-iterator\");","// TODO: use something more complex like timsort?\nvar floor = Math.floor;\n\nvar mergeSort = function (array, comparefn) {\n var length = array.length;\n var middle = floor(length / 2);\n return length < 8 ? insertionSort(array, comparefn) : merge(\n mergeSort(array.slice(0, middle), comparefn),\n mergeSort(array.slice(middle), comparefn),\n comparefn\n );\n};\n\nvar insertionSort = function (array, comparefn) {\n var length = array.length;\n var i = 1;\n var element, j;\n\n while (i < length) {\n j = i;\n element = array[i];\n while (j && comparefn(array[j - 1], element) > 0) {\n array[j] = array[--j];\n }\n if (j !== i++) array[j] = element;\n } return array;\n};\n\nvar merge = function (left, right, comparefn) {\n var llength = left.length;\n var rlength = right.length;\n var lindex = 0;\n var rindex = 0;\n var result = [];\n\n while (lindex < llength || rindex < rlength) {\n if (lindex < llength && rindex < rlength) {\n result.push(comparefn(left[lindex], right[rindex]) <= 0 ? left[lindex++] : right[rindex++]);\n } else {\n result.push(lindex < llength ? left[lindex++] : right[rindex++]);\n }\n } return result;\n};\n\nmodule.exports = mergeSort;\n","var userAgent = require('../internals/engine-user-agent');\n\nvar firefox = userAgent.match(/firefox\\/(\\d+)/i);\n\nmodule.exports = !!firefox && +firefox[1];\n","var UA = require('../internals/engine-user-agent');\n\nmodule.exports = /MSIE|Trident/.test(UA);\n","var userAgent = require('../internals/engine-user-agent');\n\nvar webkit = userAgent.match(/AppleWebKit\\/(\\d+)\\./);\n\nmodule.exports = !!webkit && +webkit[1];\n","'use strict';\nvar $ = require('../internals/export');\nvar aFunction = require('../internals/a-function');\nvar toObject = require('../internals/to-object');\nvar toLength = require('../internals/to-length');\nvar toString = require('../internals/to-string');\nvar fails = require('../internals/fails');\nvar internalSort = require('../internals/array-sort');\nvar arrayMethodIsStrict = require('../internals/array-method-is-strict');\nvar FF = require('../internals/engine-ff-version');\nvar IE_OR_EDGE = require('../internals/engine-is-ie-or-edge');\nvar V8 = require('../internals/engine-v8-version');\nvar WEBKIT = require('../internals/engine-webkit-version');\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 STABLE_SORT = !fails(function () {\n // feature detection can be too slow, so check engines versions\n if (V8) return V8 < 70;\n if (FF && FF > 3) return;\n if (IE_OR_EDGE) return true;\n if (WEBKIT) return WEBKIT < 603;\n\n var result = '';\n var code, chr, value, index;\n\n // generate an array with more 512 elements (Chakra and old V8 fails only in this case)\n for (code = 65; code < 76; code++) {\n chr = String.fromCharCode(code);\n\n switch (code) {\n case 66: case 69: case 70: case 72: value = 3; break;\n case 68: case 71: value = 4; break;\n default: value = 2;\n }\n\n for (index = 0; index < 47; index++) {\n test.push({ k: chr + index, v: value });\n }\n }\n\n test.sort(function (a, b) { return b.v - a.v; });\n\n for (index = 0; index < test.length; index++) {\n chr = test[index].k.charAt(0);\n if (result.charAt(result.length - 1) !== chr) result += chr;\n }\n\n return result !== 'DGBEFHACIJK';\n});\n\nvar FORCED = FAILS_ON_UNDEFINED || !FAILS_ON_NULL || !STRICT_METHOD || !STABLE_SORT;\n\nvar getSortCompare = function (comparefn) {\n return function (x, y) {\n if (y === undefined) return -1;\n if (x === undefined) return 1;\n if (comparefn !== undefined) return +comparefn(x, y) || 0;\n return toString(x) > toString(y) ? 1 : -1;\n };\n};\n\n// `Array.prototype.sort` method\n// https://tc39.es/ecma262/#sec-array.prototype.sort\n$({ target: 'Array', proto: true, forced: FORCED }, {\n sort: function sort(comparefn) {\n if (comparefn !== undefined) aFunction(comparefn);\n\n var array = toObject(this);\n\n if (STABLE_SORT) return comparefn === undefined ? nativeSort.call(array) : nativeSort.call(array, comparefn);\n\n var items = [];\n var arrayLength = toLength(array.length);\n var itemsLength, index;\n\n for (index = 0; index < arrayLength; index++) {\n if (index in array) items.push(array[index]);\n }\n\n items = internalSort(items, getSortCompare(comparefn));\n itemsLength = items.length;\n index = 0;\n\n while (index < itemsLength) array[index] = items[index++];\n while (index < arrayLength) delete array[index++];\n\n return array;\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');\nrequire('../../../modules/es.object.to-string');\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 -- safe\n || DOMIterables.hasOwnProperty(classof(it)) ? keys : own;\n};\n","module.exports = require(\"core-js-pure/stable/instance/keys\");","require('../../../modules/es.array.iterator');\nrequire('../../../modules/es.object.to-string');\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 -- safe\n || DOMIterables.hasOwnProperty(classof(it)) ? values : own;\n};\n","module.exports = require(\"core-js-pure/stable/instance/values\");","require('../../../modules/es.array.iterator');\nrequire('../../../modules/es.object.to-string');\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 -- safe\n || DOMIterables.hasOwnProperty(classof(it)) ? entries : own;\n};\n","module.exports = require(\"core-js-pure/stable/instance/entries\");","// 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;","/**\n * vis-data\n * http://visjs.org/\n *\n * Manage unstructured data using DataSet. Add, update, and remove data, and listen for changes in the data.\n *\n * @version 7.1.2\n * @date 2021-01-08T20:37:11.601Z\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 { pureDeepObjectAssign } from 'vis-util/esnext/esm/vis-util.js';\nexport { DELETE } from 'vis-util/esnext/esm/vis-util.js';\nimport { v4 } from 'uuid';\n\n/**\r\n * Create new data pipe.\r\n *\r\n * @param from - The source data set or data view.\r\n *\r\n * @remarks\r\n * Example usage:\r\n * ```typescript\r\n * interface AppItem {\r\n * whoami: string;\r\n * appData: unknown;\r\n * visData: VisItem;\r\n * }\r\n * interface VisItem {\r\n * id: number;\r\n * label: string;\r\n * color: string;\r\n * x: number;\r\n * y: number;\r\n * }\r\n *\r\n * const ds1 = new DataSet<AppItem, \"whoami\">([], { fieldId: \"whoami\" });\r\n * const ds2 = new DataSet<VisItem, \"id\">();\r\n *\r\n * const pipe = createNewDataPipeFrom(ds1)\r\n * .filter((item): boolean => item.enabled === true)\r\n * .map<VisItem, \"id\">((item): VisItem => item.visData)\r\n * .to(ds2);\r\n *\r\n * pipe.start();\r\n * ```\r\n *\r\n * @returns A factory whose methods can be used to configure the pipe.\r\n */\r\nfunction createNewDataPipeFrom(from) {\r\n return new DataPipeUnderConstruction(from);\r\n}\r\n/**\r\n * Internal implementation of the pipe. This should be accessible only through\r\n * `createNewDataPipeFrom` from the outside.\r\n *\r\n * @typeParam SI - Source item type.\r\n * @typeParam SP - Source item type's id property name.\r\n * @typeParam TI - Target item type.\r\n * @typeParam TP - Target item type's id property name.\r\n */\r\nclass SimpleDataPipe {\r\n /**\r\n * Create a new data pipe.\r\n *\r\n * @param _source - The data set or data view that will be observed.\r\n * @param _transformers - An array of transforming functions to be used to\r\n * filter or transform the items in the pipe.\r\n * @param _target - The data set or data view that will receive the items.\r\n */\r\n constructor(_source, _transformers, _target) {\r\n this._source = _source;\r\n this._transformers = _transformers;\r\n this._target = _target;\r\n /**\r\n * Bound listeners for use with `DataInterface['on' | 'off']`.\r\n */\r\n this._listeners = {\r\n add: this._add.bind(this),\r\n remove: this._remove.bind(this),\r\n update: this._update.bind(this),\r\n };\r\n }\r\n /** @inheritDoc */\r\n all() {\r\n this._target.update(this._transformItems(this._source.get()));\r\n return this;\r\n }\r\n /** @inheritDoc */\r\n start() {\r\n this._source.on(\"add\", this._listeners.add);\r\n this._source.on(\"remove\", this._listeners.remove);\r\n this._source.on(\"update\", this._listeners.update);\r\n return this;\r\n }\r\n /** @inheritDoc */\r\n stop() {\r\n this._source.off(\"add\", this._listeners.add);\r\n this._source.off(\"remove\", this._listeners.remove);\r\n this._source.off(\"update\", this._listeners.update);\r\n return this;\r\n }\r\n /**\r\n * Apply the transformers to the items.\r\n *\r\n * @param items - The items to be transformed.\r\n *\r\n * @returns The transformed items.\r\n */\r\n _transformItems(items) {\r\n return this._transformers.reduce((items, transform) => {\r\n return transform(items);\r\n }, items);\r\n }\r\n /**\r\n * Handle an add event.\r\n *\r\n * @param _name - Ignored.\r\n * @param payload - The payload containing the ids of the added items.\r\n */\r\n _add(_name, payload) {\r\n if (payload == null) {\r\n return;\r\n }\r\n this._target.add(this._transformItems(this._source.get(payload.items)));\r\n }\r\n /**\r\n * Handle an update event.\r\n *\r\n * @param _name - Ignored.\r\n * @param payload - The payload containing the ids of the updated items.\r\n */\r\n _update(_name, payload) {\r\n if (payload == null) {\r\n return;\r\n }\r\n this._target.update(this._transformItems(this._source.get(payload.items)));\r\n }\r\n /**\r\n * Handle a remove event.\r\n *\r\n * @param _name - Ignored.\r\n * @param payload - The payload containing the data of the removed items.\r\n */\r\n _remove(_name, payload) {\r\n if (payload == null) {\r\n return;\r\n }\r\n this._target.remove(this._transformItems(payload.oldData));\r\n }\r\n}\r\n/**\r\n * Internal implementation of the pipe factory. This should be accessible\r\n * only through `createNewDataPipeFrom` from the outside.\r\n *\r\n * @typeParam TI - Target item type.\r\n * @typeParam TP - Target item type's id property name.\r\n */\r\nclass DataPipeUnderConstruction {\r\n /**\r\n * Create a new data pipe factory. This is an internal constructor that\r\n * should never be called from outside of this file.\r\n *\r\n * @param _source - The source data set or data view for this pipe.\r\n */\r\n constructor(_source) {\r\n this._source = _source;\r\n /**\r\n * Array transformers used to transform items within the pipe. This is typed\r\n * as any for the sake of simplicity.\r\n */\r\n this._transformers = [];\r\n }\r\n /**\r\n * Filter the items.\r\n *\r\n * @param callback - A filtering function that returns true if given item\r\n * should be piped and false if not.\r\n *\r\n * @returns This factory for further configuration.\r\n */\r\n filter(callback) {\r\n this._transformers.push((input) => input.filter(callback));\r\n return this;\r\n }\r\n /**\r\n * Map each source item to a new type.\r\n *\r\n * @param callback - A mapping function that takes a source item and returns\r\n * corresponding mapped item.\r\n *\r\n * @typeParam TI - Target item type.\r\n * @typeParam TP - Target item type's id property name.\r\n *\r\n * @returns This factory for further configuration.\r\n */\r\n map(callback) {\r\n this._transformers.push((input) => input.map(callback));\r\n return this;\r\n }\r\n /**\r\n * Map each source item to zero or more items of a new type.\r\n *\r\n * @param callback - A mapping function that takes a source item and returns\r\n * an array of corresponding mapped items.\r\n *\r\n * @typeParam TI - Target item type.\r\n * @typeParam TP - Target item type's id property name.\r\n *\r\n * @returns This factory for further configuration.\r\n */\r\n flatMap(callback) {\r\n this._transformers.push((input) => input.flatMap(callback));\r\n return this;\r\n }\r\n /**\r\n * Connect this pipe to given data set.\r\n *\r\n * @param target - The data set that will receive the items from this pipe.\r\n *\r\n * @returns The pipe connected between given data sets and performing\r\n * configured transformation on the processed items.\r\n */\r\n to(target) {\r\n return new SimpleDataPipe(this._source, this._transformers, target);\r\n }\r\n}\n\n/**\r\n * Determine whether a value can be used as an id.\r\n *\r\n * @param value - Input value of unknown type.\r\n *\r\n * @returns True if the value is valid id, false otherwise.\r\n */\r\nfunction isId(value) {\r\n return typeof value === \"string\" || typeof value === \"number\";\r\n}\n\n/**\r\n * A queue.\r\n *\r\n * @typeParam T - The type of method names to be replaced by queued versions.\r\n */\r\nclass Queue {\r\n /**\r\n * Construct a new Queue.\r\n *\r\n * @param options - Queue configuration.\r\n */\r\n constructor(options) {\r\n this._queue = [];\r\n this._timeout = null;\r\n this._extended = null;\r\n // options\r\n this.delay = null;\r\n this.max = Infinity;\r\n this.setOptions(options);\r\n }\r\n /**\r\n * Update the configuration of the queue.\r\n *\r\n * @param options - Queue configuration.\r\n */\r\n setOptions(options) {\r\n if (options && typeof options.delay !== \"undefined\") {\r\n this.delay = options.delay;\r\n }\r\n if (options && typeof options.max !== \"undefined\") {\r\n this.max = options.max;\r\n }\r\n this._flushIfNeeded();\r\n }\r\n /**\r\n * Extend an object with queuing functionality.\r\n * The object will be extended with a function flush, and the methods provided in options.replace will be replaced with queued ones.\r\n *\r\n * @param object - The object to be extended.\r\n * @param options - Additional options.\r\n *\r\n * @returns The created queue.\r\n */\r\n static extend(object, options) {\r\n const queue = new Queue(options);\r\n if (object.flush !== undefined) {\r\n throw new Error(\"Target object already has a property flush\");\r\n }\r\n object.flush = () => {\r\n queue.flush();\r\n };\r\n const methods = [\r\n {\r\n name: \"flush\",\r\n original: undefined,\r\n },\r\n ];\r\n if (options && options.replace) {\r\n for (let i = 0; i < options.replace.length; i++) {\r\n const name = options.replace[i];\r\n methods.push({\r\n name: name,\r\n // @TODO: better solution?\r\n original: object[name],\r\n });\r\n // @TODO: better solution?\r\n queue.replace(object, name);\r\n }\r\n }\r\n queue._extended = {\r\n object: object,\r\n methods: methods,\r\n };\r\n return queue;\r\n }\r\n /**\r\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.\r\n */\r\n destroy() {\r\n this.flush();\r\n if (this._extended) {\r\n const object = this._extended.object;\r\n const methods = this._extended.methods;\r\n for (let i = 0; i < methods.length; i++) {\r\n const method = methods[i];\r\n if (method.original) {\r\n // @TODO: better solution?\r\n object[method.name] = method.original;\r\n }\r\n else {\r\n // @TODO: better solution?\r\n delete object[method.name];\r\n }\r\n }\r\n this._extended = null;\r\n }\r\n }\r\n /**\r\n * Replace a method on an object with a queued version.\r\n *\r\n * @param object - Object having the method.\r\n * @param method - The method name.\r\n */\r\n replace(object, method) {\r\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. */\r\n const me = this;\r\n const original = object[method];\r\n if (!original) {\r\n throw new Error(\"Method \" + method + \" undefined\");\r\n }\r\n object[method] = function (...args) {\r\n // add this call to the queue\r\n me.queue({\r\n args: args,\r\n fn: original,\r\n context: this,\r\n });\r\n };\r\n }\r\n /**\r\n * Queue a call.\r\n *\r\n * @param entry - The function or entry to be queued.\r\n */\r\n queue(entry) {\r\n if (typeof entry === \"function\") {\r\n this._queue.push({ fn: entry });\r\n }\r\n else {\r\n this._queue.push(entry);\r\n }\r\n this._flushIfNeeded();\r\n }\r\n /**\r\n * Check whether the queue needs to be flushed.\r\n */\r\n _flushIfNeeded() {\r\n // flush when the maximum is exceeded.\r\n if (this._queue.length > this.max) {\r\n this.flush();\r\n }\r\n // flush after a period of inactivity when a delay is configured\r\n if (this._timeout != null) {\r\n clearTimeout(this._timeout);\r\n this._timeout = null;\r\n }\r\n if (this.queue.length > 0 && typeof this.delay === \"number\") {\r\n this._timeout = setTimeout(() => {\r\n this.flush();\r\n }, this.delay);\r\n }\r\n }\r\n /**\r\n * Flush all queued calls\r\n */\r\n flush() {\r\n this._queue.splice(0).forEach((entry) => {\r\n entry.fn.apply(entry.context || entry.fn, entry.args || []);\r\n });\r\n }\r\n}\n\n/**\r\n * [[DataSet]] code that can be reused in [[DataView]] or other similar implementations of [[DataInterface]].\r\n *\r\n * @typeParam Item - Item type that may or may not have an id.\r\n * @typeParam IdProp - Name of the property that contains the id.\r\n */\r\nclass DataSetPart {\r\n constructor() {\r\n this._subscribers = {\r\n \"*\": [],\r\n add: [],\r\n remove: [],\r\n update: [],\r\n };\r\n /**\r\n * @deprecated Use on instead (PS: DataView.subscribe === DataView.on).\r\n */\r\n this.subscribe = DataSetPart.prototype.on;\r\n /**\r\n * @deprecated Use off instead (PS: DataView.unsubscribe === DataView.off).\r\n */\r\n this.unsubscribe = DataSetPart.prototype.off;\r\n }\r\n /**\r\n * Trigger an event\r\n *\r\n * @param event - Event name.\r\n * @param payload - Event payload.\r\n * @param senderId - Id of the sender.\r\n */\r\n _trigger(event, payload, senderId) {\r\n if (event === \"*\") {\r\n throw new Error(\"Cannot trigger event *\");\r\n }\r\n [...this._subscribers[event], ...this._subscribers[\"*\"]].forEach((subscriber) => {\r\n subscriber(event, payload, senderId != null ? senderId : null);\r\n });\r\n }\r\n /**\r\n * Subscribe to an event, add an event listener.\r\n *\r\n * @remarks Non-function callbacks are ignored.\r\n *\r\n * @param event - Event name.\r\n * @param callback - Callback method.\r\n */\r\n on(event, callback) {\r\n if (typeof callback === \"function\") {\r\n this._subscribers[event].push(callback);\r\n }\r\n // @TODO: Maybe throw for invalid callbacks?\r\n }\r\n /**\r\n * Unsubscribe from an event, remove an event listener.\r\n *\r\n * @remarks If the same callback was subscribed more than once **all** occurences will be removed.\r\n *\r\n * @param event - Event name.\r\n * @param callback - Callback method.\r\n */\r\n off(event, callback) {\r\n this._subscribers[event] = this._subscribers[event].filter((subscriber) => subscriber !== callback);\r\n }\r\n}\n\n/**\r\n * Data stream\r\n *\r\n * @remarks\r\n * [[DataStream]] offers an always up to date stream of items from a [[DataSet]] or [[DataView]].\r\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.\r\n * Multiple invocations of for example [[toItemArray]] may yield different results (if the data source like for example [[DataSet]] gets modified).\r\n *\r\n * @typeParam Item - The item type this stream is going to work with.\r\n */\r\nclass DataStream {\r\n /**\r\n * Create a new data stream.\r\n *\r\n * @param pairs - The id, item pairs.\r\n */\r\n constructor(pairs) {\r\n this._pairs = pairs;\r\n }\r\n /**\r\n * Return an iterable of key, value pairs for every entry in the stream.\r\n */\r\n *[Symbol.iterator]() {\r\n for (const [id, item] of this._pairs) {\r\n yield [id, item];\r\n }\r\n }\r\n /**\r\n * Return an iterable of key, value pairs for every entry in the stream.\r\n */\r\n *entries() {\r\n for (const [id, item] of this._pairs) {\r\n yield [id, item];\r\n }\r\n }\r\n /**\r\n * Return an iterable of keys in the stream.\r\n */\r\n *keys() {\r\n for (const [id] of this._pairs) {\r\n yield id;\r\n }\r\n }\r\n /**\r\n * Return an iterable of values in the stream.\r\n */\r\n *values() {\r\n for (const [, item] of this._pairs) {\r\n yield item;\r\n }\r\n }\r\n /**\r\n * Return an array containing all the ids in this stream.\r\n *\r\n * @remarks\r\n * The array may contain duplicities.\r\n *\r\n * @returns The array with all ids from this stream.\r\n */\r\n toIdArray() {\r\n return [...this._pairs].map((pair) => pair[0]);\r\n }\r\n /**\r\n * Return an array containing all the items in this stream.\r\n *\r\n * @remarks\r\n * The array may contain duplicities.\r\n *\r\n * @returns The array with all items from this stream.\r\n */\r\n toItemArray() {\r\n return [...this._pairs].map((pair) => pair[1]);\r\n }\r\n /**\r\n * Return an array containing all the entries in this stream.\r\n *\r\n * @remarks\r\n * The array may contain duplicities.\r\n *\r\n * @returns The array with all entries from this stream.\r\n */\r\n toEntryArray() {\r\n return [...this._pairs];\r\n }\r\n /**\r\n * Return an object map containing all the items in this stream accessible by ids.\r\n *\r\n * @remarks\r\n * In case of duplicate ids (coerced to string so `7 == '7'`) the last encoutered appears in the returned object.\r\n *\r\n * @returns The object map of all id → item pairs from this stream.\r\n */\r\n toObjectMap() {\r\n const map = Object.create(null);\r\n for (const [id, item] of this._pairs) {\r\n map[id] = item;\r\n }\r\n return map;\r\n }\r\n /**\r\n * Return a map containing all the items in this stream accessible by ids.\r\n *\r\n * @returns The map of all id → item pairs from this stream.\r\n */\r\n toMap() {\r\n return new Map(this._pairs);\r\n }\r\n /**\r\n * Return a set containing all the (unique) ids in this stream.\r\n *\r\n * @returns The set of all ids from this stream.\r\n */\r\n toIdSet() {\r\n return new Set(this.toIdArray());\r\n }\r\n /**\r\n * Return a set containing all the (unique) items in this stream.\r\n *\r\n * @returns The set of all items from this stream.\r\n */\r\n toItemSet() {\r\n return new Set(this.toItemArray());\r\n }\r\n /**\r\n * Cache the items from this stream.\r\n *\r\n * @remarks\r\n * This method allows for items to be fetched immediatelly and used (possibly multiple times) later.\r\n * It can also be used to optimize performance as [[DataStream]] would otherwise reevaluate everything upon each iteration.\r\n *\r\n * ## Example\r\n * ```javascript\r\n * const ds = new DataSet([…])\r\n *\r\n * const cachedStream = ds.stream()\r\n * .filter(…)\r\n * .sort(…)\r\n * .map(…)\r\n * .cached(…) // Data are fetched, processed and cached here.\r\n *\r\n * ds.clear()\r\n * chachedStream // Still has all the items.\r\n * ```\r\n *\r\n * @returns A new [[DataStream]] with cached items (detached from the original [[DataSet]]).\r\n */\r\n cache() {\r\n return new DataStream([...this._pairs]);\r\n }\r\n /**\r\n * Get the distinct values of given property.\r\n *\r\n * @param callback - The function that picks and possibly converts the property.\r\n *\r\n * @typeParam T - The type of the distinct value.\r\n *\r\n * @returns A set of all distinct properties.\r\n */\r\n distinct(callback) {\r\n const set = new Set();\r\n for (const [id, item] of this._pairs) {\r\n set.add(callback(item, id));\r\n }\r\n return set;\r\n }\r\n /**\r\n * Filter the items of the stream.\r\n *\r\n * @param callback - The function that decides whether an item will be included.\r\n *\r\n * @returns A new data stream with the filtered items.\r\n */\r\n filter(callback) {\r\n const pairs = this._pairs;\r\n return new DataStream({\r\n *[Symbol.iterator]() {\r\n for (const [id, item] of pairs) {\r\n if (callback(item, id)) {\r\n yield [id, item];\r\n }\r\n }\r\n },\r\n });\r\n }\r\n /**\r\n * Execute a callback for each item of the stream.\r\n *\r\n * @param callback - The function that will be invoked for each item.\r\n */\r\n forEach(callback) {\r\n for (const [id, item] of this._pairs) {\r\n callback(item, id);\r\n }\r\n }\r\n /**\r\n * Map the items into a different type.\r\n *\r\n * @param callback - The function that does the conversion.\r\n *\r\n * @typeParam Mapped - The type of the item after mapping.\r\n *\r\n * @returns A new data stream with the mapped items.\r\n */\r\n map(callback) {\r\n const pairs = this._pairs;\r\n return new DataStream({\r\n *[Symbol.iterator]() {\r\n for (const [id, item] of pairs) {\r\n yield [id, callback(item, id)];\r\n }\r\n },\r\n });\r\n }\r\n /**\r\n * Get the item with the maximum value of given property.\r\n *\r\n * @param callback - The function that picks and possibly converts the property.\r\n *\r\n * @returns The item with the maximum if found otherwise null.\r\n */\r\n max(callback) {\r\n const iter = this._pairs[Symbol.iterator]();\r\n let curr = iter.next();\r\n if (curr.done) {\r\n return null;\r\n }\r\n let maxItem = curr.value[1];\r\n let maxValue = callback(curr.value[1], curr.value[0]);\r\n while (!(curr = iter.next()).done) {\r\n const [id, item] = curr.value;\r\n const value = callback(item, id);\r\n if (value > maxValue) {\r\n maxValue = value;\r\n maxItem = item;\r\n }\r\n }\r\n return maxItem;\r\n }\r\n /**\r\n * Get the item with the minimum value of given property.\r\n *\r\n * @param callback - The function that picks and possibly converts the property.\r\n *\r\n * @returns The item with the minimum if found otherwise null.\r\n */\r\n min(callback) {\r\n const iter = this._pairs[Symbol.iterator]();\r\n let curr = iter.next();\r\n if (curr.done) {\r\n return null;\r\n }\r\n let minItem = curr.value[1];\r\n let minValue = callback(curr.value[1], curr.value[0]);\r\n while (!(curr = iter.next()).done) {\r\n const [id, item] = curr.value;\r\n const value = callback(item, id);\r\n if (value < minValue) {\r\n minValue = value;\r\n minItem = item;\r\n }\r\n }\r\n return minItem;\r\n }\r\n /**\r\n * Reduce the items into a single value.\r\n *\r\n * @param callback - The function that does the reduction.\r\n * @param accumulator - The initial value of the accumulator.\r\n *\r\n * @typeParam T - The type of the accumulated value.\r\n *\r\n * @returns The reduced value.\r\n */\r\n reduce(callback, accumulator) {\r\n for (const [id, item] of this._pairs) {\r\n accumulator = callback(accumulator, item, id);\r\n }\r\n return accumulator;\r\n }\r\n /**\r\n * Sort the items.\r\n *\r\n * @param callback - Item comparator.\r\n *\r\n * @returns A new stream with sorted items.\r\n */\r\n sort(callback) {\r\n return new DataStream({\r\n [Symbol.iterator]: () => [...this._pairs]\r\n .sort(([idA, itemA], [idB, itemB]) => callback(itemA, itemB, idA, idB))[Symbol.iterator](),\r\n });\r\n }\r\n}\n\n/**\r\n * Add an id to given item if it doesn't have one already.\r\n *\r\n * @remarks\r\n * The item will be modified.\r\n *\r\n * @param item - The item that will have an id after a call to this function.\r\n * @param idProp - The key of the id property.\r\n *\r\n * @typeParam Item - Item type that may or may not have an id.\r\n * @typeParam IdProp - Name of the property that contains the id.\r\n *\r\n * @returns true\r\n */\r\nfunction ensureFullItem(item, idProp) {\r\n if (item[idProp] == null) {\r\n // generate an id\r\n item[idProp] = v4();\r\n }\r\n return item;\r\n}\r\n/**\r\n * # DataSet\r\n *\r\n * Vis.js comes with a flexible DataSet, which can be used to hold and\r\n * manipulate unstructured data and listen for changes in the data. The DataSet\r\n * is key/value based. Data items can be added, updated and removed from the\r\n * DataSet, and one can subscribe to changes in the DataSet. The data in the\r\n * DataSet can be filtered and ordered. Data can be normalized when appending it\r\n * to the DataSet as well.\r\n *\r\n * ## Example\r\n *\r\n * The following example shows how to use a DataSet.\r\n *\r\n * ```javascript\r\n * // create a DataSet\r\n * var options = {};\r\n * var data = new vis.DataSet(options);\r\n *\r\n * // add items\r\n * // note that the data items can contain different properties and data formats\r\n * data.add([\r\n * {id: 1, text: 'item 1', date: new Date(2013, 6, 20), group: 1, first: true},\r\n * {id: 2, text: 'item 2', date: '2013-06-23', group: 2},\r\n * {id: 3, text: 'item 3', date: '2013-06-25', group: 2},\r\n * {id: 4, text: 'item 4'}\r\n * ]);\r\n *\r\n * // subscribe to any change in the DataSet\r\n * data.on('*', function (event, properties, senderId) {\r\n * console.log('event', event, properties);\r\n * });\r\n *\r\n * // update an existing item\r\n * data.update({id: 2, group: 1});\r\n *\r\n * // remove an item\r\n * data.remove(4);\r\n *\r\n * // get all ids\r\n * var ids = data.getIds();\r\n * console.log('ids', ids);\r\n *\r\n * // get a specific item\r\n * var item1 = data.get(1);\r\n * console.log('item1', item1);\r\n *\r\n * // retrieve a filtered subset of the data\r\n * var items = data.get({\r\n * filter: function (item) {\r\n * return item.group == 1;\r\n * }\r\n * });\r\n * console.log('filtered items', items);\r\n * ```\r\n *\r\n * @typeParam Item - Item type that may or may not have an id.\r\n * @typeParam IdProp - Name of the property that contains the id.\r\n */\r\nclass DataSet extends DataSetPart {\r\n /**\r\n * Construct a new DataSet.\r\n *\r\n * @param data - Initial data or options.\r\n * @param options - Options (type error if data is also options).\r\n */\r\n constructor(data, options) {\r\n super();\r\n this._queue = null;\r\n // correctly read optional arguments\r\n if (data && !Array.isArray(data)) {\r\n options = data;\r\n data = [];\r\n }\r\n this._options = options || {};\r\n this._data = new Map(); // map with data indexed by id\r\n this.length = 0; // number of items in the DataSet\r\n this._idProp = this._options.fieldId || \"id\"; // name of the field containing id\r\n // add initial data when provided\r\n if (data && data.length) {\r\n this.add(data);\r\n }\r\n this.setOptions(options);\r\n }\r\n /** @inheritDoc */\r\n get idProp() {\r\n return this._idProp;\r\n }\r\n /**\r\n * Set new options.\r\n *\r\n * @param options - The new options.\r\n */\r\n setOptions(options) {\r\n if (options && options.queue !== undefined) {\r\n if (options.queue === false) {\r\n // delete queue if loaded\r\n if (this._queue) {\r\n this._queue.destroy();\r\n this._queue = null;\r\n }\r\n }\r\n else {\r\n // create queue and update its options\r\n if (!this._queue) {\r\n this._queue = Queue.extend(this, {\r\n replace: [\"add\", \"update\", \"remove\"],\r\n });\r\n }\r\n if (options.queue && typeof options.queue === \"object\") {\r\n this._queue.setOptions(options.queue);\r\n }\r\n }\r\n }\r\n }\r\n /**\r\n * Add a data item or an array with items.\r\n *\r\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.\r\n *\r\n * ## Example\r\n *\r\n * ```javascript\r\n * // create a DataSet\r\n * const data = new vis.DataSet()\r\n *\r\n * // add items\r\n * const ids = data.add([\r\n * { id: 1, text: 'item 1' },\r\n * { id: 2, text: 'item 2' },\r\n * { text: 'item without an id' }\r\n * ])\r\n *\r\n * console.log(ids) // [1, 2, '<UUIDv4>']\r\n * ```\r\n *\r\n * @param data - Items to be added (ids will be generated if missing).\r\n * @param senderId - Sender id.\r\n *\r\n * @returns addedIds - Array with the ids (generated if not present) of the added items.\r\n *\r\n * @throws When an item with the same id as any of the added items already exists.\r\n */\r\n add(data, senderId) {\r\n const addedIds = [];\r\n let id;\r\n if (Array.isArray(data)) {\r\n // Array\r\n const idsToAdd = data.map((d) => d[this._idProp]);\r\n if (idsToAdd.some((id) => this._data.has(id))) {\r\n throw new Error(\"A duplicate id was found in the parameter array.\");\r\n }\r\n for (let i = 0, len = data.length; i < len; i++) {\r\n id = this._addItem(data[i]);\r\n addedIds.push(id);\r\n }\r\n }\r\n else if (data && typeof data === \"object\") {\r\n // Single item\r\n id = this._addItem(data);\r\n addedIds.push(id);\r\n }\r\n else {\r\n throw new Error(\"Unknown dataType\");\r\n }\r\n if (addedIds.length) {\r\n this._trigger(\"add\", { items: addedIds }, senderId);\r\n }\r\n return addedIds;\r\n }\r\n /**\r\n * Update existing items. When an item does not exist, it will be created.\r\n *\r\n * @remarks\r\n * The provided properties will be merged in the existing item. When an item does not exist, it will be created.\r\n *\r\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.\r\n *\r\n * ## Example\r\n *\r\n * ```javascript\r\n * // create a DataSet\r\n * const data = new vis.DataSet([\r\n * { id: 1, text: 'item 1' },\r\n * { id: 2, text: 'item 2' },\r\n * { id: 3, text: 'item 3' }\r\n * ])\r\n *\r\n * // update items\r\n * const ids = data.update([\r\n * { id: 2, text: 'item 2 (updated)' },\r\n * { id: 4, text: 'item 4 (new)' }\r\n * ])\r\n *\r\n * console.log(ids) // [2, 4]\r\n * ```\r\n *\r\n * ## Warning for TypeScript users\r\n * This method may introduce partial items into the data set. Use add or updateOnly instead for better type safety.\r\n *\r\n * @param data - Items to be updated (if the id is already present) or added (if the id is missing).\r\n * @param senderId - Sender id.\r\n *\r\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.\r\n *\r\n * @throws When the supplied data is neither an item nor an array of items.\r\n */\r\n update(data, senderId) {\r\n const addedIds = [];\r\n const updatedIds = [];\r\n const oldData = [];\r\n const updatedData = [];\r\n const idProp = this._idProp;\r\n const addOrUpdate = (item) => {\r\n const origId = item[idProp];\r\n if (origId != null && this._data.has(origId)) {\r\n const fullItem = item; // it has an id, therefore it is a fullitem\r\n const oldItem = Object.assign({}, this._data.get(origId));\r\n // update item\r\n const id = this._updateItem(fullItem);\r\n updatedIds.push(id);\r\n updatedData.push(fullItem);\r\n oldData.push(oldItem);\r\n }\r\n else {\r\n // add new item\r\n const id = this._addItem(item);\r\n addedIds.push(id);\r\n }\r\n };\r\n if (Array.isArray(data)) {\r\n // Array\r\n for (let i = 0, len = data.length; i < len; i++) {\r\n if (data[i] && typeof data[i] === \"object\") {\r\n addOrUpdate(data[i]);\r\n }\r\n else {\r\n console.warn(\"Ignoring input item, which is not an object at index \" + i);\r\n }\r\n }\r\n }\r\n else if (data && typeof data === \"object\") {\r\n // Single item\r\n addOrUpdate(data);\r\n }\r\n else {\r\n throw new Error(\"Unknown dataType\");\r\n }\r\n if (addedIds.length) {\r\n this._trigger(\"add\", { items: addedIds }, senderId);\r\n }\r\n if (updatedIds.length) {\r\n const props = { items: updatedIds, oldData: oldData, data: updatedData };\r\n // TODO: remove deprecated property 'data' some day\r\n //Object.defineProperty(props, 'data', {\r\n // 'get': (function() {\r\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');\r\n // return updatedData;\r\n // }).bind(this)\r\n //});\r\n this._trigger(\"update\", props, senderId);\r\n }\r\n return addedIds.concat(updatedIds);\r\n }\r\n /**\r\n * Update existing items. When an item does not exist, an error will be thrown.\r\n *\r\n * @remarks\r\n * The provided properties will be deeply merged into the existing item.\r\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.\r\n *\r\n * After the items are updated, the DataSet will trigger an event `update`.\r\n * When a `senderId` is provided, this id will be passed with the triggered event to all subscribers.\r\n *\r\n * ## Example\r\n *\r\n * ```javascript\r\n * // create a DataSet\r\n * const data = new vis.DataSet([\r\n * { id: 1, text: 'item 1' },\r\n * { id: 2, text: 'item 2' },\r\n * { id: 3, text: 'item 3' },\r\n * ])\r\n *\r\n * // update items\r\n * const ids = data.update([\r\n * { id: 2, text: 'item 2 (updated)' }, // works\r\n * // { id: 4, text: 'item 4 (new)' }, // would throw\r\n * // { text: 'item 4 (new)' }, // would also throw\r\n * ])\r\n *\r\n * console.log(ids) // [2]\r\n * ```\r\n *\r\n * @param data - Updates (the id and optionally other props) to the items in this data set.\r\n * @param senderId - Sender id.\r\n *\r\n * @returns updatedIds - The ids of the updated items.\r\n *\r\n * @throws When the supplied data is neither an item nor an array of items, when the ids are missing.\r\n */\r\n updateOnly(data, senderId) {\r\n if (!Array.isArray(data)) {\r\n data = [data];\r\n }\r\n const updateEventData = data\r\n .map((update) => {\r\n const oldData = this._data.get(update[this._idProp]);\r\n if (oldData == null) {\r\n throw new Error(\"Updating non-existent items is not allowed.\");\r\n }\r\n return { oldData, update };\r\n })\r\n .map(({ oldData, update }) => {\r\n const id = oldData[this._idProp];\r\n const updatedData = pureDeepObjectAssign(oldData, update);\r\n this._data.set(id, updatedData);\r\n return {\r\n id,\r\n oldData: oldData,\r\n updatedData,\r\n };\r\n });\r\n if (updateEventData.length) {\r\n const props = {\r\n items: updateEventData.map((value) => value.id),\r\n oldData: updateEventData.map((value) => value.oldData),\r\n data: updateEventData.map((value) => value.updatedData),\r\n };\r\n // TODO: remove deprecated property 'data' some day\r\n //Object.defineProperty(props, 'data', {\r\n // 'get': (function() {\r\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');\r\n // return updatedData;\r\n // }).bind(this)\r\n //});\r\n this._trigger(\"update\", props, senderId);\r\n return props.items;\r\n }\r\n else {\r\n return [];\r\n }\r\n }\r\n /** @inheritDoc */\r\n get(first, second) {\r\n // @TODO: Woudn't it be better to split this into multiple methods?\r\n // parse the arguments\r\n let id = undefined;\r\n let ids = undefined;\r\n let options = undefined;\r\n if (isId(first)) {\r\n // get(id [, options])\r\n id = first;\r\n options = second;\r\n }\r\n else if (Array.isArray(first)) {\r\n // get(ids [, options])\r\n ids = first;\r\n options = second;\r\n }\r\n else {\r\n // get([, options])\r\n options = first;\r\n }\r\n // determine the return type\r\n const returnType = options && options.returnType === \"Object\" ? \"Object\" : \"Array\";\r\n // @TODO: WTF is this? Or am I missing something?\r\n // var returnType\r\n // if (options && options.returnType) {\r\n // var allowedValues = ['Array', 'Object']\r\n // returnType =\r\n // allowedValues.indexOf(options.returnType) == -1\r\n // ? 'Array'\r\n // : options.returnType\r\n // } else {\r\n // returnType = 'Array'\r\n // }\r\n // build options\r\n const filter = options && options.filter;\r\n const items = [];\r\n let item = undefined;\r\n let itemIds = undefined;\r\n let itemId = undefined;\r\n // convert items\r\n if (id != null) {\r\n // return a single item\r\n item = this._data.get(id);\r\n if (item && filter && !filter(item)) {\r\n item = undefined;\r\n }\r\n }\r\n else if (ids != null) {\r\n // return a subset of items\r\n for (let i = 0, len = ids.length; i < len; i++) {\r\n item = this._data.get(ids[i]);\r\n if (item != null && (!filter || filter(item))) {\r\n items.push(item);\r\n }\r\n }\r\n }\r\n else {\r\n // return all items\r\n itemIds = [...this._data.keys()];\r\n for (let i = 0, len = itemIds.length; i < len; i++) {\r\n itemId = itemIds[i];\r\n item = this._data.get(itemId);\r\n if (item != null && (!filter || filter(item))) {\r\n items.push(item);\r\n }\r\n }\r\n }\r\n // order the results\r\n if (options && options.order && id == undefined) {\r\n this._sort(items, options.order);\r\n }\r\n // filter fields of the items\r\n if (options && options.fields) {\r\n const fields = options.fields;\r\n if (id != undefined && item != null) {\r\n item = this._filterFields(item, fields);\r\n }\r\n else {\r\n for (let i = 0, len = items.length; i < len; i++) {\r\n items[i] = this._filterFields(items[i], fields);\r\n }\r\n }\r\n }\r\n // return the results\r\n if (returnType == \"Object\") {\r\n const result = {};\r\n for (let i = 0, len = items.length; i < len; i++) {\r\n const resultant = items[i];\r\n // @TODO: Shoudn't this be this._fieldId?\r\n // result[resultant.id] = resultant\r\n const id = resultant[this._idProp];\r\n result[id] = resultant;\r\n }\r\n return result;\r\n }\r\n else {\r\n if (id != null) {\r\n // a single item\r\n return item ?? null;\r\n }\r\n else {\r\n // just return our array\r\n return items;\r\n }\r\n }\r\n }\r\n /** @inheritDoc */\r\n getIds(options) {\r\n const data = this._data;\r\n const filter = options && options.filter;\r\n const order = options && options.order;\r\n const itemIds = [...data.keys()];\r\n const ids = [];\r\n if (filter) {\r\n // get filtered items\r\n if (order) {\r\n // create ordered list\r\n const items = [];\r\n for (let i = 0, len = itemIds.length; i < len; i++) {\r\n const id = itemIds[i];\r\n const item = this._data.get(id);\r\n if (item != null && filter(item)) {\r\n items.push(item);\r\n }\r\n }\r\n this._sort(items, order);\r\n for (let i = 0, len = items.length; i < len; i++) {\r\n ids.push(items[i][this._idProp]);\r\n }\r\n }\r\n else {\r\n // create unordered list\r\n for (let i = 0, len = itemIds.length; i < len; i++) {\r\n const id = itemIds[i];\r\n const item = this._data.get(id);\r\n if (item != null && filter(item)) {\r\n ids.push(item[this._idProp]);\r\n }\r\n }\r\n }\r\n }\r\n else {\r\n // get all items\r\n if (order) {\r\n // create an ordered list\r\n const items = [];\r\n for (let i = 0, len = itemIds.length; i < len; i++) {\r\n const id = itemIds[i];\r\n items.push(data.get(id));\r\n }\r\n this._sort(items, order);\r\n for (let i = 0, len = items.length; i < len; i++) {\r\n ids.push(items[i][this._idProp]);\r\n }\r\n }\r\n else {\r\n // create unordered list\r\n for (let i = 0, len = itemIds.length; i < len; i++) {\r\n const id = itemIds[i];\r\n const item = data.get(id);\r\n if (item != null) {\r\n ids.push(item[this._idProp]);\r\n }\r\n }\r\n }\r\n }\r\n return ids;\r\n }\r\n /** @inheritDoc */\r\n getDataSet() {\r\n return this;\r\n }\r\n /** @inheritDoc */\r\n forEach(callback, options) {\r\n const filter = options && options.filter;\r\n const data = this._data;\r\n const itemIds = [...data.keys()];\r\n if (options && options.order) {\r\n // execute forEach on ordered list\r\n const items = this.get(options);\r\n for (let i = 0, len = items.length; i < len; i++) {\r\n const item = items[i];\r\n const id = item[this._idProp];\r\n callback(item, id);\r\n }\r\n }\r\n else {\r\n // unordered\r\n for (let i = 0, len = itemIds.length; i < len; i++) {\r\n const id = itemIds[i];\r\n const item = this._data.get(id);\r\n if (item != null && (!filter || filter(item))) {\r\n callback(item, id);\r\n }\r\n }\r\n }\r\n }\r\n /** @inheritDoc */\r\n map(callback, options) {\r\n const filter = options && options.filter;\r\n const mappedItems = [];\r\n const data = this._data;\r\n const itemIds = [...data.keys()];\r\n // convert and filter items\r\n for (let i = 0, len = itemIds.length; i < len; i++) {\r\n const id = itemIds[i];\r\n const item = this._data.get(id);\r\n if (item != null && (!filter || filter(item))) {\r\n mappedItems.push(callback(item, id));\r\n }\r\n }\r\n // order items\r\n if (options && options.order) {\r\n this._sort(mappedItems, options.order);\r\n }\r\n return mappedItems;\r\n }\r\n /**\r\n * Filter the fields of an item.\r\n *\r\n * @param item - The item whose fields should be filtered.\r\n * @param fields - The names of the fields that will be kept.\r\n *\r\n * @typeParam K - Field name type.\r\n *\r\n * @returns The item without any additional fields.\r\n */\r\n _filterFields(item, fields) {\r\n if (!item) {\r\n // item is null\r\n return item;\r\n }\r\n return (Array.isArray(fields)\r\n ? // Use the supplied array\r\n fields\r\n : // Use the keys of the supplied object\r\n Object.keys(fields)).reduce((filteredItem, field) => {\r\n filteredItem[field] = item[field];\r\n return filteredItem;\r\n }, {});\r\n }\r\n /**\r\n * Sort the provided array with items.\r\n *\r\n * @param items - Items to be sorted in place.\r\n * @param order - A field name or custom sort function.\r\n *\r\n * @typeParam T - The type of the items in the items array.\r\n */\r\n _sort(items, order) {\r\n if (typeof order === \"string\") {\r\n // order by provided field name\r\n const name = order; // field name\r\n items.sort((a, b) => {\r\n // @TODO: How to treat missing properties?\r\n const av = a[name];\r\n const bv = b[name];\r\n return av > bv ? 1 : av < bv ? -1 : 0;\r\n });\r\n }\r\n else if (typeof order === \"function\") {\r\n // order by sort function\r\n items.sort(order);\r\n }\r\n else {\r\n // TODO: extend order by an Object {field:string, direction:string}\r\n // where direction can be 'asc' or 'desc'\r\n throw new TypeError(\"Order must be a function or a string\");\r\n }\r\n }\r\n /**\r\n * Remove an item or multiple items by “reference” (only the id is used) or by id.\r\n *\r\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.\r\n *\r\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.\r\n *\r\n * ## Example\r\n * ```javascript\r\n * // create a DataSet\r\n * const data = new vis.DataSet([\r\n * { id: 1, text: 'item 1' },\r\n * { id: 2, text: 'item 2' },\r\n * { id: 3, text: 'item 3' }\r\n * ])\r\n *\r\n * // remove items\r\n * const ids = data.remove([2, { id: 3 }, 4])\r\n *\r\n * console.log(ids) // [2, 3]\r\n * ```\r\n *\r\n * @param id - One or more items or ids of items to be removed.\r\n * @param senderId - Sender id.\r\n *\r\n * @returns The ids of the removed items.\r\n */\r\n remove(id, senderId) {\r\n const removedIds = [];\r\n const removedItems = [];\r\n // force everything to be an array for simplicity\r\n const ids = Array.isArray(id) ? id : [id];\r\n for (let i = 0, len = ids.length; i < len; i++) {\r\n const item = this._remove(ids[i]);\r\n if (item) {\r\n const itemId = item[this._idProp];\r\n if (itemId != null) {\r\n removedIds.push(itemId);\r\n removedItems.push(item);\r\n }\r\n }\r\n }\r\n if (removedIds.length) {\r\n this._trigger(\"remove\", { items: removedIds, oldData: removedItems }, senderId);\r\n }\r\n return removedIds;\r\n }\r\n /**\r\n * Remove an item by its id or reference.\r\n *\r\n * @param id - Id of an item or the item itself.\r\n *\r\n * @returns The removed item if removed, null otherwise.\r\n */\r\n _remove(id) {\r\n // @TODO: It origianlly returned the item although the docs say id.\r\n // The code expects the item, so probably an error in the docs.\r\n let ident;\r\n // confirm the id to use based on the args type\r\n if (isId(id)) {\r\n ident = id;\r\n }\r\n else if (id && typeof id === \"object\") {\r\n ident = id[this._idProp]; // look for the identifier field using ._idProp\r\n }\r\n // do the removing if the item is found\r\n if (ident != null && this._data.has(ident)) {\r\n const item = this._data.get(ident) || null;\r\n this._data.delete(ident);\r\n --this.length;\r\n return item;\r\n }\r\n return null;\r\n }\r\n /**\r\n * Clear the entire data set.\r\n *\r\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.\r\n *\r\n * @param senderId - Sender id.\r\n *\r\n * @returns removedIds - The ids of all removed items.\r\n */\r\n clear(senderId) {\r\n const ids = [...this._data.keys()];\r\n const items = [];\r\n for (let i = 0, len = ids.length; i < len; i++) {\r\n items.push(this._data.get(ids[i]));\r\n }\r\n this._data.clear();\r\n this.length = 0;\r\n this._trigger(\"remove\", { items: ids, oldData: items }, senderId);\r\n return ids;\r\n }\r\n /**\r\n * Find the item with maximum value of a specified field.\r\n *\r\n * @param field - Name of the property that should be searched for max value.\r\n *\r\n * @returns Item containing max value, or null if no items.\r\n */\r\n max(field) {\r\n let max = null;\r\n let maxField = null;\r\n for (const item of this._data.values()) {\r\n const itemField = item[field];\r\n if (typeof itemField === \"number\" &&\r\n (maxField == null || itemField > maxField)) {\r\n max = item;\r\n maxField = itemField;\r\n }\r\n }\r\n return max || null;\r\n }\r\n /**\r\n * Find the item with minimum value of a specified field.\r\n *\r\n * @param field - Name of the property that should be searched for min value.\r\n *\r\n * @returns Item containing min value, or null if no items.\r\n */\r\n min(field) {\r\n let min = null;\r\n let minField = null;\r\n for (const item of this._data.values()) {\r\n const itemField = item[field];\r\n if (typeof itemField === \"number\" &&\r\n (minField == null || itemField < minField)) {\r\n min = item;\r\n minField = itemField;\r\n }\r\n }\r\n return min || null;\r\n }\r\n /**\r\n * Find all distinct values of a specified field\r\n *\r\n * @param prop - The property name whose distinct values should be returned.\r\n *\r\n * @returns Unordered array containing all distinct values. Items without specified property are ignored.\r\n */\r\n distinct(prop) {\r\n const data = this._data;\r\n const itemIds = [...data.keys()];\r\n const values = [];\r\n let count = 0;\r\n for (let i = 0, len = itemIds.length; i < len; i++) {\r\n const id = itemIds[i];\r\n const item = data.get(id);\r\n const value = item[prop];\r\n let exists = false;\r\n for (let j = 0; j < count; j++) {\r\n if (values[j] == value) {\r\n exists = true;\r\n break;\r\n }\r\n }\r\n if (!exists && value !== undefined) {\r\n values[count] = value;\r\n count++;\r\n }\r\n }\r\n return values;\r\n }\r\n /**\r\n * Add a single item. Will fail when an item with the same id already exists.\r\n *\r\n * @param item - A new item to be added.\r\n *\r\n * @returns Added item's id. An id is generated when it is not present in the item.\r\n */\r\n _addItem(item) {\r\n const fullItem = ensureFullItem(item, this._idProp);\r\n const id = fullItem[this._idProp];\r\n // check whether this id is already taken\r\n if (this._data.has(id)) {\r\n // item already exists\r\n throw new Error(\"Cannot add item: item with id \" + id + \" already exists\");\r\n }\r\n this._data.set(id, fullItem);\r\n ++this.length;\r\n return id;\r\n }\r\n /**\r\n * Update a single item: merge with existing item.\r\n * Will fail when the item has no id, or when there does not exist an item with the same id.\r\n *\r\n * @param update - The new item\r\n *\r\n * @returns The id of the updated item.\r\n */\r\n _updateItem(update) {\r\n const id = update[this._idProp];\r\n if (id == null) {\r\n throw new Error(\"Cannot update item: item has no id (item: \" +\r\n JSON.stringify(update) +\r\n \")\");\r\n }\r\n const item = this._data.get(id);\r\n if (!item) {\r\n // item doesn't exist\r\n throw new Error(\"Cannot update item: no item with id \" + id + \" found\");\r\n }\r\n this._data.set(id, { ...item, ...update });\r\n return id;\r\n }\r\n /** @inheritDoc */\r\n stream(ids) {\r\n if (ids) {\r\n const data = this._data;\r\n return new DataStream({\r\n *[Symbol.iterator]() {\r\n for (const id of ids) {\r\n const item = data.get(id);\r\n if (item != null) {\r\n yield [id, item];\r\n }\r\n }\r\n },\r\n });\r\n }\r\n else {\r\n return new DataStream({\r\n [Symbol.iterator]: this._data.entries.bind(this._data),\r\n });\r\n }\r\n }\r\n}\n\n/**\r\n * DataView\r\n *\r\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.\r\n *\r\n * ## Example\r\n * ```javascript\r\n * // create a DataSet\r\n * var data = new vis.DataSet();\r\n * data.add([\r\n * {id: 1, text: 'item 1', date: new Date(2013, 6, 20), group: 1, first: true},\r\n * {id: 2, text: 'item 2', date: '2013-06-23', group: 2},\r\n * {id: 3, text: 'item 3', date: '2013-06-25', group: 2},\r\n * {id: 4, text: 'item 4'}\r\n * ]);\r\n *\r\n * // create a DataView\r\n * // the view will only contain items having a property group with value 1,\r\n * // and will only output fields id, text, and date.\r\n * var view = new vis.DataView(data, {\r\n * filter: function (item) {\r\n * return (item.group == 1);\r\n * },\r\n * fields: ['id', 'text', 'date']\r\n * });\r\n *\r\n * // subscribe to any change in the DataView\r\n * view.on('*', function (event, properties, senderId) {\r\n * console.log('event', event, properties);\r\n * });\r\n *\r\n * // update an item in the data set\r\n * data.update({id: 2, group: 1});\r\n *\r\n * // get all ids in the view\r\n * var ids = view.getIds();\r\n * console.log('ids', ids); // will output [1, 2]\r\n *\r\n * // get all items in the view\r\n * var items = view.get();\r\n * ```\r\n *\r\n * @typeParam Item - Item type that may or may not have an id.\r\n * @typeParam IdProp - Name of the property that contains the id.\r\n */\r\nclass DataView extends DataSetPart {\r\n /**\r\n * Create a DataView.\r\n *\r\n * @param data - The instance containing data (directly or indirectly).\r\n * @param options - Options to configure this data view.\r\n */\r\n constructor(data, options) {\r\n super();\r\n /** @inheritDoc */\r\n this.length = 0;\r\n this._ids = new Set(); // ids of the items currently in memory (just contains a boolean true)\r\n this._options = options || {};\r\n this._listener = this._onEvent.bind(this);\r\n this.setData(data);\r\n }\r\n /** @inheritDoc */\r\n get idProp() {\r\n return this.getDataSet().idProp;\r\n }\r\n // TODO: implement a function .config() to dynamically update things like configured filter\r\n // and trigger changes accordingly\r\n /**\r\n * Set a data source for the view.\r\n *\r\n * @param data - The instance containing data (directly or indirectly).\r\n *\r\n * @remarks\r\n * Note that when the data view is bound to a data set it won't be garbage\r\n * collected unless the data set is too. Use `dataView.setData(null)` or\r\n * `dataView.dispose()` to enable garbage collection before you lose the last\r\n * reference.\r\n */\r\n setData(data) {\r\n if (this._data) {\r\n // unsubscribe from current dataset\r\n if (this._data.off) {\r\n this._data.off(\"*\", this._listener);\r\n }\r\n // trigger a remove of all items in memory\r\n const ids = this._data.getIds({ filter: this._options.filter });\r\n const items = this._data.get(ids);\r\n this._ids.clear();\r\n this.length = 0;\r\n this._trigger(\"remove\", { items: ids, oldData: items });\r\n }\r\n if (data != null) {\r\n this._data = data;\r\n // trigger an add of all added items\r\n const ids = this._data.getIds({ filter: this._options.filter });\r\n for (let i = 0, len = ids.length; i < len; i++) {\r\n const id = ids[i];\r\n this._ids.add(id);\r\n }\r\n this.length = ids.length;\r\n this._trigger(\"add\", { items: ids });\r\n }\r\n else {\r\n this._data = new DataSet();\r\n }\r\n // subscribe to new dataset\r\n if (this._data.on) {\r\n this._data.on(\"*\", this._listener);\r\n }\r\n }\r\n /**\r\n * Refresh the DataView.\r\n * Useful when the DataView has a filter function containing a variable parameter.\r\n */\r\n refresh() {\r\n const ids = this._data.getIds({\r\n filter: this._options.filter,\r\n });\r\n const oldIds = [...this._ids];\r\n const newIds = {};\r\n const addedIds = [];\r\n const removedIds = [];\r\n const removedItems = [];\r\n // check for additions\r\n for (let i = 0, len = ids.length; i < len; i++) {\r\n const id = ids[i];\r\n newIds[id] = true;\r\n if (!this._ids.has(id)) {\r\n addedIds.push(id);\r\n this._ids.add(id);\r\n }\r\n }\r\n // check for removals\r\n for (let i = 0, len = oldIds.length; i < len; i++) {\r\n const id = oldIds[i];\r\n const item = this._data.get(id);\r\n if (item == null) {\r\n // @TODO: Investigate.\r\n // Doesn't happen during tests or examples.\r\n // Is it really impossible or could it eventually happen?\r\n // How to handle it if it does? The types guarantee non-nullable items.\r\n console.error(\"If you see this, report it please.\");\r\n }\r\n else if (!newIds[id]) {\r\n removedIds.push(id);\r\n removedItems.push(item);\r\n this._ids.delete(id);\r\n }\r\n }\r\n this.length += addedIds.length - removedIds.length;\r\n // trigger events\r\n if (addedIds.length) {\r\n this._trigger(\"add\", { items: addedIds });\r\n }\r\n if (removedIds.length) {\r\n this._trigger(\"remove\", { items: removedIds, oldData: removedItems });\r\n }\r\n }\r\n /** @inheritDoc */\r\n get(first, second) {\r\n if (this._data == null) {\r\n return null;\r\n }\r\n // parse the arguments\r\n let ids = null;\r\n let options;\r\n if (isId(first) || Array.isArray(first)) {\r\n ids = first;\r\n options = second;\r\n }\r\n else {\r\n options = first;\r\n }\r\n // extend the options with the default options and provided options\r\n const viewOptions = Object.assign({}, this._options, options);\r\n // create a combined filter method when needed\r\n const thisFilter = this._options.filter;\r\n const optionsFilter = options && options.filter;\r\n if (thisFilter && optionsFilter) {\r\n viewOptions.filter = (item) => {\r\n return thisFilter(item) && optionsFilter(item);\r\n };\r\n }\r\n if (ids == null) {\r\n return this._data.get(viewOptions);\r\n }\r\n else {\r\n return this._data.get(ids, viewOptions);\r\n }\r\n }\r\n /** @inheritDoc */\r\n getIds(options) {\r\n if (this._data.length) {\r\n const defaultFilter = this._options.filter;\r\n const optionsFilter = options != null ? options.filter : null;\r\n let filter;\r\n if (optionsFilter) {\r\n if (defaultFilter) {\r\n filter = (item) => {\r\n return defaultFilter(item) && optionsFilter(item);\r\n };\r\n }\r\n else {\r\n filter = optionsFilter;\r\n }\r\n }\r\n else {\r\n filter = defaultFilter;\r\n }\r\n return this._data.getIds({\r\n filter: filter,\r\n order: options && options.order,\r\n });\r\n }\r\n else {\r\n return [];\r\n }\r\n }\r\n /** @inheritDoc */\r\n forEach(callback, options) {\r\n if (this._data) {\r\n const defaultFilter = this._options.filter;\r\n const optionsFilter = options && options.filter;\r\n let filter;\r\n if (optionsFilter) {\r\n if (defaultFilter) {\r\n filter = function (item) {\r\n return defaultFilter(item) && optionsFilter(item);\r\n };\r\n }\r\n else {\r\n filter = optionsFilter;\r\n }\r\n }\r\n else {\r\n filter = defaultFilter;\r\n }\r\n this._data.forEach(callback, {\r\n filter: filter,\r\n order: options && options.order,\r\n });\r\n }\r\n }\r\n /** @inheritDoc */\r\n map(callback, options) {\r\n if (this._data) {\r\n const defaultFilter = this._options.filter;\r\n const optionsFilter = options && options.filter;\r\n let filter;\r\n if (optionsFilter) {\r\n if (defaultFilter) {\r\n filter = (item) => {\r\n return defaultFilter(item) && optionsFilter(item);\r\n };\r\n }\r\n else {\r\n filter = optionsFilter;\r\n }\r\n }\r\n else {\r\n filter = defaultFilter;\r\n }\r\n return this._data.map(callback, {\r\n filter: filter,\r\n order: options && options.order,\r\n });\r\n }\r\n else {\r\n return [];\r\n }\r\n }\r\n /** @inheritDoc */\r\n getDataSet() {\r\n return this._data.getDataSet();\r\n }\r\n /** @inheritDoc */\r\n stream(ids) {\r\n return this._data.stream(ids || {\r\n [Symbol.iterator]: this._ids.keys.bind(this._ids),\r\n });\r\n }\r\n /**\r\n * Render the instance unusable prior to garbage collection.\r\n *\r\n * @remarks\r\n * The intention of this method is to help discover scenarios where the data\r\n * view is being used when the programmer thinks it has been garbage collected\r\n * already. It's stricter version of `dataView.setData(null)`.\r\n */\r\n dispose() {\r\n if (this._data?.off) {\r\n this._data.off(\"*\", this._listener);\r\n }\r\n const message = \"This data view has already been disposed of.\";\r\n const replacement = {\r\n get: () => {\r\n throw new Error(message);\r\n },\r\n set: () => {\r\n throw new Error(message);\r\n },\r\n configurable: false,\r\n };\r\n for (const key of Reflect.ownKeys(DataView.prototype)) {\r\n Object.defineProperty(this, key, replacement);\r\n }\r\n }\r\n /**\r\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.\r\n *\r\n * @param event - The name of the event.\r\n * @param params - Parameters of the event.\r\n * @param senderId - Id supplied by the sender.\r\n */\r\n _onEvent(event, params, senderId) {\r\n if (!params || !params.items || !this._data) {\r\n return;\r\n }\r\n const ids = params.items;\r\n const addedIds = [];\r\n const updatedIds = [];\r\n const removedIds = [];\r\n const oldItems = [];\r\n const updatedItems = [];\r\n const removedItems = [];\r\n switch (event) {\r\n case \"add\":\r\n // filter the ids of the added items\r\n for (let i = 0, len = ids.length; i < len; i++) {\r\n const id = ids[i];\r\n const item = this.get(id);\r\n if (item) {\r\n this._ids.add(id);\r\n addedIds.push(id);\r\n }\r\n }\r\n break;\r\n case \"update\":\r\n // determine the event from the views viewpoint: an updated\r\n // item can be added, updated, or removed from this view.\r\n for (let i = 0, len = ids.length; i < len; i++) {\r\n const id = ids[i];\r\n const item = this.get(id);\r\n if (item) {\r\n if (this._ids.has(id)) {\r\n updatedIds.push(id);\r\n updatedItems.push(params.data[i]);\r\n oldItems.push(params.oldData[i]);\r\n }\r\n else {\r\n this._ids.add(id);\r\n addedIds.push(id);\r\n }\r\n }\r\n else {\r\n if (this._ids.has(id)) {\r\n this._ids.delete(id);\r\n removedIds.push(id);\r\n removedItems.push(params.oldData[i]);\r\n }\r\n }\r\n }\r\n break;\r\n case \"remove\":\r\n // filter the ids of the removed items\r\n for (let i = 0, len = ids.length; i < len; i++) {\r\n const id = ids[i];\r\n if (this._ids.has(id)) {\r\n this._ids.delete(id);\r\n removedIds.push(id);\r\n removedItems.push(params.oldData[i]);\r\n }\r\n }\r\n break;\r\n }\r\n this.length += addedIds.length - removedIds.length;\r\n if (addedIds.length) {\r\n this._trigger(\"add\", { items: addedIds }, senderId);\r\n }\r\n if (updatedIds.length) {\r\n this._trigger(\"update\", { items: updatedIds, oldData: oldItems, data: updatedItems }, senderId);\r\n }\r\n if (removedIds.length) {\r\n this._trigger(\"remove\", { items: removedIds, oldData: removedItems }, senderId);\r\n }\r\n }\r\n}\n\n/**\r\n * Check that given value is compatible with Vis Data Set interface.\r\n *\r\n * @param idProp - The expected property to contain item id.\r\n * @param v - The value to be tested.\r\n *\r\n * @returns True if all expected values and methods match, false otherwise.\r\n */\r\nfunction isDataSetLike(idProp, v) {\r\n return (typeof v === \"object\" &&\r\n v !== null &&\r\n idProp === v.idProp &&\r\n typeof v.add === \"function\" &&\r\n typeof v.clear === \"function\" &&\r\n typeof v.distinct === \"function\" &&\r\n typeof v.forEach === \"function\" &&\r\n typeof v.get === \"function\" &&\r\n typeof v.getDataSet === \"function\" &&\r\n typeof v.getIds === \"function\" &&\r\n typeof v.length === \"number\" &&\r\n typeof v.map === \"function\" &&\r\n typeof v.max === \"function\" &&\r\n typeof v.min === \"function\" &&\r\n typeof v.off === \"function\" &&\r\n typeof v.on === \"function\" &&\r\n typeof v.remove === \"function\" &&\r\n typeof v.setOptions === \"function\" &&\r\n typeof v.stream === \"function\" &&\r\n typeof v.update === \"function\" &&\r\n typeof v.updateOnly === \"function\");\r\n}\n\n/**\r\n * Check that given value is compatible with Vis Data View interface.\r\n *\r\n * @param idProp - The expected property to contain item id.\r\n * @param v - The value to be tested.\r\n *\r\n * @returns True if all expected values and methods match, false otherwise.\r\n */\r\nfunction isDataViewLike(idProp, v) {\r\n return (typeof v === \"object\" &&\r\n v !== null &&\r\n idProp === v.idProp &&\r\n typeof v.forEach === \"function\" &&\r\n typeof v.get === \"function\" &&\r\n typeof v.getDataSet === \"function\" &&\r\n typeof v.getIds === \"function\" &&\r\n typeof v.length === \"number\" &&\r\n typeof v.map === \"function\" &&\r\n typeof v.off === \"function\" &&\r\n typeof v.on === \"function\" &&\r\n typeof v.stream === \"function\" &&\r\n isDataSetLike(idProp, v.getDataSet()));\r\n}\n\nexport { DataSet, DataStream, DataView, Queue, createNewDataPipeFrom, isDataSetLike, isDataViewLike };\n//# sourceMappingURL=vis-data.js.map\n","var global = require('../internals/global');\nvar toString = require('../internals/to-string');\nvar trim = require('../internals/string-trim').trim;\nvar whitespaces = require('../internals/whitespaces');\n\nvar $parseFloat = global.parseFloat;\nvar FORCED = 1 / $parseFloat(whitespaces + '-0') !== -Infinity;\n\n// `parseFloat` method\n// https://tc39.es/ecma262/#sec-parsefloat-string\nmodule.exports = FORCED ? function parseFloat(string) {\n var trimmedString = trim(toString(string));\n var result = $parseFloat(trimmedString);\n return result === 0 && trimmedString.charAt(0) == '-' ? -0 : result;\n} : $parseFloat;\n","var $ = require('../internals/export');\nvar parseFloatImplementation = require('../internals/number-parse-float');\n\n// `parseFloat` method\n// https://tc39.es/ecma262/#sec-parsefloat-string\n$({ global: true, forced: parseFloat != parseFloatImplementation }, {\n parseFloat: parseFloatImplementation\n});\n","require('../modules/es.parse-float');\nvar path = require('../internals/path');\n\nmodule.exports = path.parseFloat;\n","var parent = require('../es/parse-float');\n\nmodule.exports = parent;\n","module.exports = require(\"core-js-pure/stable/parse-float\");","var $ = require('../internals/export');\nvar fails = require('../internals/fails');\nvar getOwnPropertyNames = require('../internals/object-get-own-property-names-external').f;\n\n// eslint-disable-next-line es/no-object-getownpropertynames -- required for testing\nvar FAILS_ON_PRIMITIVES = fails(function () { return !Object.getOwnPropertyNames(1); });\n\n// `Object.getOwnPropertyNames` method\n// https://tc39.es/ecma262/#sec-object.getownpropertynames\n$({ target: 'Object', stat: true, forced: FAILS_ON_PRIMITIVES }, {\n getOwnPropertyNames: getOwnPropertyNames\n});\n","require('../../modules/es.object.get-own-property-names');\nvar path = require('../../internals/path');\n\nvar Object = path.Object;\n\nmodule.exports = function getOwnPropertyNames(it) {\n return Object.getOwnPropertyNames(it);\n};\n","var parent = require('../../es/object/get-own-property-names');\n\nmodule.exports = parent;\n","module.exports = require(\"core-js-pure/stable/object/get-own-property-names\");","import { topMost } from \"vis-util/esnext\";\n\n/**\n * Helper functions for components\n */\n\n/**\n * Determine values to use for (sub)options of 'chosen'.\n *\n * This option is either a boolean or an object whose values should be examined further.\n * The relevant structures are:\n *\n * - chosen: <boolean value>\n * - chosen: { subOption: <boolean or function> }\n *\n * Where subOption is 'node', 'edge' or 'label'.\n *\n * The intention of this method appears to be to set a specific priority to the options;\n * Since most properties are either bridged or merged into the local options objects, there\n * is not much point in handling them separately.\n * TODO: examine if 'most' in previous sentence can be replaced with 'all'. In that case, we\n * should be able to get rid of this method.\n *\n * @param {string} subOption option within object 'chosen' to consider; either 'node', 'edge' or 'label'\n * @param {object} pile array of options objects to consider\n *\n * @returns {boolean | Function} value for passed subOption of 'chosen' to use\n */\nexport function choosify(subOption, pile) {\n // allowed values for subOption\n const allowed = [\"node\", \"edge\", \"label\"];\n let value = true;\n\n const chosen = topMost(pile, \"chosen\");\n if (typeof chosen === \"boolean\") {\n value = chosen;\n } else if (typeof chosen === \"object\") {\n if (allowed.indexOf(subOption) === -1) {\n throw new Error(\n \"choosify: subOption '\" +\n subOption +\n \"' should be one of \" +\n \"'\" +\n allowed.join(\"', '\") +\n \"'\"\n );\n }\n\n const chosenEdge = topMost(pile, [\"chosen\", subOption]);\n if (typeof chosenEdge === \"boolean\" || typeof chosenEdge === \"function\") {\n value = chosenEdge;\n }\n }\n\n return value;\n}\n\n/**\n * Check if the point falls within the given rectangle.\n *\n * @param {rect} rect\n * @param {point} point\n * @param {rotationPoint} [rotationPoint] if specified, the rotation that applies to the rectangle.\n * @returns {boolean} true if point within rectangle, false otherwise\n */\nexport function pointInRect(rect, point, rotationPoint) {\n if (rect.width <= 0 || rect.height <= 0) {\n return false; // early out\n }\n\n if (rotationPoint !== undefined) {\n // Rotate the point the same amount as the rectangle\n const tmp = {\n x: point.x - rotationPoint.x,\n y: point.y - rotationPoint.y,\n };\n\n if (rotationPoint.angle !== 0) {\n // In order to get the coordinates the same, you need to\n // rotate in the reverse direction\n const angle = -rotationPoint.angle;\n\n const tmp2 = {\n x: Math.cos(angle) * tmp.x - Math.sin(angle) * tmp.y,\n y: Math.sin(angle) * tmp.x + Math.cos(angle) * tmp.y,\n };\n point = tmp2;\n } else {\n point = tmp;\n }\n\n // Note that if a rotation is specified, the rectangle coordinates\n // are **not* the full canvas coordinates. They are relative to the\n // rotationPoint. Hence, the point coordinates need not be translated\n // back in this case.\n }\n\n const right = rect.x + rect.width;\n const bottom = rect.y + rect.width;\n\n return (\n rect.left < point.x &&\n right > point.x &&\n rect.top < point.y &&\n bottom > point.y\n );\n}\n\n/**\n * Check if given value is acceptable as a label text.\n *\n * @param {*} text value to check; can be anything at this point\n * @returns {boolean} true if valid label value, false otherwise\n */\nexport function isValidLabel(text) {\n // Note that this is quite strict: types that *might* be converted to string are disallowed\n return typeof text === \"string\" && text !== \"\";\n}\n\n/**\n * Returns x, y of self reference circle based on provided angle\n *\n * @param {object} ctx\n * @param {number} angle\n * @param {number} radius\n * @param {VisNode} node\n *\n * @returns {object} x and y coordinates\n */\nexport function getSelfRefCoordinates(ctx, angle, radius, node) {\n let x = node.x;\n let y = node.y;\n\n if (typeof node.distanceToBorder === \"function\") {\n //calculating opposite and adjacent\n //distaneToBorder becomes Hypotenuse.\n //Formulas sin(a) = Opposite / Hypotenuse and cos(a) = Adjacent / Hypotenuse\n const toBorderDist = node.distanceToBorder(ctx, angle);\n const yFromNodeCenter = Math.sin(angle) * toBorderDist;\n const xFromNodeCenter = Math.cos(angle) * toBorderDist;\n //xFromNodeCenter is basically x and if xFromNodeCenter equals to the distance to border then it means\n //that y does not need calculation because it is equal node.height / 2 or node.y\n //same thing with yFromNodeCenter and if yFromNodeCenter equals to the distance to border then it means\n //that x is equal node.width / 2 or node.x\n if (xFromNodeCenter === toBorderDist) {\n x += toBorderDist;\n y = node.y;\n } else if (yFromNodeCenter === toBorderDist) {\n x = node.x;\n y -= toBorderDist;\n } else {\n x += xFromNodeCenter;\n y -= yFromNodeCenter;\n }\n } else if (node.shape.width > node.shape.height) {\n x = node.x + node.shape.width * 0.5;\n y = node.y - radius;\n } else {\n x = node.x + radius;\n y = node.y - node.shape.height * 0.5;\n }\n\n return { x, y };\n}\n","/**\n * Callback to determine text dimensions, using the parent label settings.\n *\n * @callback MeasureText\n * @param {text} text\n * @param {text} mod\n * @returns {object} { width, values} width in pixels and font attributes\n */\n\n/**\n * Helper class for Label which collects results of splitting labels into lines and blocks.\n *\n * @private\n */\nclass LabelAccumulator {\n /**\n * @param {MeasureText} measureText\n */\n constructor(measureText) {\n this.measureText = measureText;\n this.current = 0;\n this.width = 0;\n this.height = 0;\n this.lines = [];\n }\n\n /**\n * Append given text to the given line.\n *\n * @param {number} l index of line to add to\n * @param {string} text string to append to line\n * @param {'bold'|'ital'|'boldital'|'mono'|'normal'} [mod='normal']\n * @private\n */\n _add(l, text, mod = \"normal\") {\n if (this.lines[l] === undefined) {\n this.lines[l] = {\n width: 0,\n height: 0,\n blocks: [],\n };\n }\n\n // We still need to set a block for undefined and empty texts, hence return at this point\n // This is necessary because we don't know at this point if we're at the\n // start of an empty line or not.\n // To compensate, empty blocks are removed in `finalize()`.\n //\n // Empty strings should still have a height\n let tmpText = text;\n if (text === undefined || text === \"\") tmpText = \" \";\n\n // Determine width and get the font properties\n const result = this.measureText(tmpText, mod);\n const block = Object.assign({}, result.values);\n block.text = text;\n block.width = result.width;\n block.mod = mod;\n\n if (text === undefined || text === \"\") {\n block.width = 0;\n }\n\n this.lines[l].blocks.push(block);\n\n // Update the line width. We need this for determining if a string goes over max width\n this.lines[l].width += block.width;\n }\n\n /**\n * Returns the width in pixels of the current line.\n *\n * @returns {number}\n */\n curWidth() {\n const line = this.lines[this.current];\n if (line === undefined) return 0;\n\n return line.width;\n }\n\n /**\n * Add text in block to current line\n *\n * @param {string} text\n * @param {'bold'|'ital'|'boldital'|'mono'|'normal'} [mod='normal']\n */\n append(text, mod = \"normal\") {\n this._add(this.current, text, mod);\n }\n\n /**\n * Add text in block to current line and start a new line\n *\n * @param {string} text\n * @param {'bold'|'ital'|'boldital'|'mono'|'normal'} [mod='normal']\n */\n newLine(text, mod = \"normal\") {\n this._add(this.current, text, mod);\n this.current++;\n }\n\n /**\n * Determine and set the heights of all the lines currently contained in this instance\n *\n * Note that width has already been set.\n *\n * @private\n */\n determineLineHeights() {\n for (let k = 0; k < this.lines.length; k++) {\n const line = this.lines[k];\n\n // Looking for max height of blocks in line\n let height = 0;\n\n if (line.blocks !== undefined) {\n // Can happen if text contains e.g. '\\n '\n for (let l = 0; l < line.blocks.length; l++) {\n const block = line.blocks[l];\n\n if (height < block.height) {\n height = block.height;\n }\n }\n }\n\n line.height = height;\n }\n }\n\n /**\n * Determine the full size of the label text, as determined by current lines and blocks\n *\n * @private\n */\n determineLabelSize() {\n let width = 0;\n let height = 0;\n for (let k = 0; k < this.lines.length; k++) {\n const line = this.lines[k];\n\n if (line.width > width) {\n width = line.width;\n }\n height += line.height;\n }\n\n this.width = width;\n this.height = height;\n }\n\n /**\n * Remove all empty blocks and empty lines we don't need\n *\n * This must be done after the width/height determination,\n * so that these are set properly for processing here.\n *\n * @returns {Array<Line>} Lines with empty blocks (and some empty lines) removed\n * @private\n */\n removeEmptyBlocks() {\n const tmpLines = [];\n for (let k = 0; k < this.lines.length; k++) {\n const line = this.lines[k];\n\n // Note: an empty line in between text has width zero but is still relevant to layout.\n // So we can't use width for testing empty line here\n if (line.blocks.length === 0) continue;\n\n // Discard final empty line always\n if (k === this.lines.length - 1) {\n if (line.width === 0) continue;\n }\n\n const tmpLine = {};\n Object.assign(tmpLine, line);\n tmpLine.blocks = [];\n\n let firstEmptyBlock;\n const tmpBlocks = [];\n for (let l = 0; l < line.blocks.length; l++) {\n const block = line.blocks[l];\n if (block.width !== 0) {\n tmpBlocks.push(block);\n } else {\n if (firstEmptyBlock === undefined) {\n firstEmptyBlock = block;\n }\n }\n }\n\n // Ensure that there is *some* text present\n if (tmpBlocks.length === 0 && firstEmptyBlock !== undefined) {\n tmpBlocks.push(firstEmptyBlock);\n }\n\n tmpLine.blocks = tmpBlocks;\n\n tmpLines.push(tmpLine);\n }\n\n return tmpLines;\n }\n\n /**\n * Set the sizes for all lines and the whole thing.\n *\n * @returns {{width: (number|*), height: (number|*), lines: Array}}\n */\n finalize() {\n //console.log(JSON.stringify(this.lines, null, 2));\n\n this.determineLineHeights();\n this.determineLabelSize();\n const tmpLines = this.removeEmptyBlocks();\n\n // Return a simple hash object for further processing.\n return {\n width: this.width,\n height: this.height,\n lines: tmpLines,\n };\n }\n}\n\nexport default LabelAccumulator;\n","import LabelAccumulator from \"./LabelAccumulator\";\nimport { isValidLabel } from \"./ComponentUtil\";\n\n// Hash of prepared regexp's for tags\nconst tagPattern = {\n // HTML\n \"<b>\": /<b>/,\n \"<i>\": /<i>/,\n \"<code>\": /<code>/,\n \"</b>\": /<\\/b>/,\n \"</i>\": /<\\/i>/,\n \"</code>\": /<\\/code>/,\n // Markdown\n \"*\": /\\*/, // bold\n _: /_/, // ital\n \"`\": /`/, // mono\n afterBold: /[^*]/,\n afterItal: /[^_]/,\n afterMono: /[^`]/,\n};\n\n/**\n * Internal helper class for parsing the markup tags for HTML and Markdown.\n *\n * NOTE: Sequences of tabs and spaces are reduced to single space.\n * Scan usage of `this.spacing` within method\n */\nclass MarkupAccumulator {\n /**\n * Create an instance\n *\n * @param {string} text text to parse for markup\n */\n constructor(text) {\n this.text = text;\n this.bold = false;\n this.ital = false;\n this.mono = false;\n this.spacing = false;\n this.position = 0;\n this.buffer = \"\";\n this.modStack = [];\n\n this.blocks = [];\n }\n\n /**\n * Return the mod label currently on the top of the stack\n *\n * @returns {string} label of topmost mod\n * @private\n */\n mod() {\n return this.modStack.length === 0 ? \"normal\" : this.modStack[0];\n }\n\n /**\n * Return the mod label currently active\n *\n * @returns {string} label of active mod\n * @private\n */\n modName() {\n if (this.modStack.length === 0) return \"normal\";\n else if (this.modStack[0] === \"mono\") return \"mono\";\n else {\n if (this.bold && this.ital) {\n return \"boldital\";\n } else if (this.bold) {\n return \"bold\";\n } else if (this.ital) {\n return \"ital\";\n }\n }\n }\n\n /**\n * @private\n */\n emitBlock() {\n if (this.spacing) {\n this.add(\" \");\n this.spacing = false;\n }\n if (this.buffer.length > 0) {\n this.blocks.push({ text: this.buffer, mod: this.modName() });\n this.buffer = \"\";\n }\n }\n\n /**\n * Output text to buffer\n *\n * @param {string} text text to add\n * @private\n */\n add(text) {\n if (text === \" \") {\n this.spacing = true;\n }\n if (this.spacing) {\n this.buffer += \" \";\n this.spacing = false;\n }\n if (text != \" \") {\n this.buffer += text;\n }\n }\n\n /**\n * Handle parsing of whitespace\n *\n * @param {string} ch the character to check\n * @returns {boolean} true if the character was processed as whitespace, false otherwise\n */\n parseWS(ch) {\n if (/[ \\t]/.test(ch)) {\n if (!this.mono) {\n this.spacing = true;\n } else {\n this.add(ch);\n }\n return true;\n }\n\n return false;\n }\n\n /**\n * @param {string} tagName label for block type to set\n * @private\n */\n setTag(tagName) {\n this.emitBlock();\n this[tagName] = true;\n this.modStack.unshift(tagName);\n }\n\n /**\n * @param {string} tagName label for block type to unset\n * @private\n */\n unsetTag(tagName) {\n this.emitBlock();\n this[tagName] = false;\n this.modStack.shift();\n }\n\n /**\n * @param {string} tagName label for block type we are currently processing\n * @param {string|RegExp} tag string to match in text\n * @returns {boolean} true if the tag was processed, false otherwise\n */\n parseStartTag(tagName, tag) {\n // Note: if 'mono' passed as tagName, there is a double check here. This is OK\n if (!this.mono && !this[tagName] && this.match(tag)) {\n this.setTag(tagName);\n return true;\n }\n\n return false;\n }\n\n /**\n * @param {string|RegExp} tag\n * @param {number} [advance=true] if set, advance current position in text\n * @returns {boolean} true if match at given position, false otherwise\n * @private\n */\n match(tag, advance = true) {\n const [regExp, length] = this.prepareRegExp(tag);\n const matched = regExp.test(this.text.substr(this.position, length));\n\n if (matched && advance) {\n this.position += length - 1;\n }\n\n return matched;\n }\n\n /**\n * @param {string} tagName label for block type we are currently processing\n * @param {string|RegExp} tag string to match in text\n * @param {RegExp} [nextTag] regular expression to match for characters *following* the current tag\n * @returns {boolean} true if the tag was processed, false otherwise\n */\n parseEndTag(tagName, tag, nextTag) {\n let checkTag = this.mod() === tagName;\n if (tagName === \"mono\") {\n // special handling for 'mono'\n checkTag = checkTag && this.mono;\n } else {\n checkTag = checkTag && !this.mono;\n }\n\n if (checkTag && this.match(tag)) {\n if (nextTag !== undefined) {\n // Purpose of the following match is to prevent a direct unset/set of a given tag\n // E.g. '*bold **still bold*' => '*bold still bold*'\n if (\n this.position === this.text.length - 1 ||\n this.match(nextTag, false)\n ) {\n this.unsetTag(tagName);\n }\n } else {\n this.unsetTag(tagName);\n }\n\n return true;\n }\n\n return false;\n }\n\n /**\n * @param {string|RegExp} tag string to match in text\n * @param {value} value string to replace tag with, if found at current position\n * @returns {boolean} true if the tag was processed, false otherwise\n */\n replace(tag, value) {\n if (this.match(tag)) {\n this.add(value);\n this.position += length - 1;\n return true;\n }\n\n return false;\n }\n\n /**\n * Create a regular expression for the tag if it isn't already one.\n *\n * The return value is an array `[RegExp, number]`, with exactly two value, where:\n * - RegExp is the regular expression to use\n * - number is the lenth of the input string to match\n *\n * @param {string|RegExp} tag string to match in text\n * @returns {Array} regular expression to use and length of input string to match\n * @private\n */\n prepareRegExp(tag) {\n let length;\n let regExp;\n if (tag instanceof RegExp) {\n regExp = tag;\n length = 1; // ASSUMPTION: regexp only tests one character\n } else {\n // use prepared regexp if present\n const prepared = tagPattern[tag];\n if (prepared !== undefined) {\n regExp = prepared;\n } else {\n regExp = new RegExp(tag);\n }\n\n length = tag.length;\n }\n\n return [regExp, length];\n }\n}\n\n/**\n * Helper class for Label which explodes the label text into lines and blocks within lines\n *\n * @private\n */\nclass LabelSplitter {\n /**\n * @param {CanvasRenderingContext2D} ctx Canvas rendering context\n * @param {Label} parent reference to the Label instance using current instance\n * @param {boolean} selected\n * @param {boolean} hover\n */\n constructor(ctx, parent, selected, hover) {\n this.ctx = ctx;\n this.parent = parent;\n this.selected = selected;\n this.hover = hover;\n\n /**\n * Callback to determine text width; passed to LabelAccumulator instance\n *\n * @param {string} text string to determine width of\n * @param {string} mod font type to use for this text\n * @returns {object} { width, values} width in pixels and font attributes\n */\n const textWidth = (text, mod) => {\n if (text === undefined) return 0;\n\n // TODO: This can be done more efficiently with caching\n // This will set the ctx.font correctly, depending on selected/hover and mod - so that ctx.measureText() will be accurate.\n const values = this.parent.getFormattingValues(ctx, selected, hover, mod);\n\n let width = 0;\n if (text !== \"\") {\n const measure = this.ctx.measureText(text);\n width = measure.width;\n }\n\n return { width, values: values };\n };\n\n this.lines = new LabelAccumulator(textWidth);\n }\n\n /**\n * Split passed text of a label into lines and blocks.\n *\n * # NOTE\n *\n * The handling of spacing is option dependent:\n *\n * - if `font.multi : false`, all spaces are retained\n * - if `font.multi : true`, every sequence of spaces is compressed to a single space\n *\n * This might not be the best way to do it, but this is as it has been working till now.\n * In order not to break existing functionality, for the time being this behaviour will\n * be retained in any code changes.\n *\n * @param {string} text text to split\n * @returns {Array<line>}\n */\n process(text) {\n if (!isValidLabel(text)) {\n return this.lines.finalize();\n }\n\n const font = this.parent.fontOptions;\n\n // Normalize the end-of-line's to a single representation - order important\n text = text.replace(/\\r\\n/g, \"\\n\"); // Dos EOL's\n text = text.replace(/\\r/g, \"\\n\"); // Mac EOL's\n\n // Note that at this point, there can be no \\r's in the text.\n // This is used later on splitStringIntoLines() to split multifont texts.\n\n const nlLines = String(text).split(\"\\n\");\n const lineCount = nlLines.length;\n\n if (font.multi) {\n // Multi-font case: styling tags active\n for (let i = 0; i < lineCount; i++) {\n const blocks = this.splitBlocks(nlLines[i], font.multi);\n // Post: Sequences of tabs and spaces are reduced to single space\n\n if (blocks === undefined) continue;\n\n if (blocks.length === 0) {\n this.lines.newLine(\"\");\n continue;\n }\n\n if (font.maxWdt > 0) {\n // widthConstraint.maximum defined\n //console.log('Running widthConstraint multi, max: ' + this.fontOptions.maxWdt);\n for (let j = 0; j < blocks.length; j++) {\n const mod = blocks[j].mod;\n const text = blocks[j].text;\n this.splitStringIntoLines(text, mod, true);\n }\n } else {\n // widthConstraint.maximum NOT defined\n for (let j = 0; j < blocks.length; j++) {\n const mod = blocks[j].mod;\n const text = blocks[j].text;\n this.lines.append(text, mod);\n }\n }\n\n this.lines.newLine();\n }\n } else {\n // Single-font case\n if (font.maxWdt > 0) {\n // widthConstraint.maximum defined\n // console.log('Running widthConstraint normal, max: ' + this.fontOptions.maxWdt);\n for (let i = 0; i < lineCount; i++) {\n this.splitStringIntoLines(nlLines[i]);\n }\n } else {\n // widthConstraint.maximum NOT defined\n for (let i = 0; i < lineCount; i++) {\n this.lines.newLine(nlLines[i]);\n }\n }\n }\n\n return this.lines.finalize();\n }\n\n /**\n * normalize the markup system\n *\n * @param {boolean|'md'|'markdown'|'html'} markupSystem\n * @returns {string}\n */\n decodeMarkupSystem(markupSystem) {\n let system = \"none\";\n if (markupSystem === \"markdown\" || markupSystem === \"md\") {\n system = \"markdown\";\n } else if (markupSystem === true || markupSystem === \"html\") {\n system = \"html\";\n }\n return system;\n }\n\n /**\n *\n * @param {string} text\n * @returns {Array}\n */\n splitHtmlBlocks(text) {\n const s = new MarkupAccumulator(text);\n\n const parseEntities = (ch) => {\n if (/&/.test(ch)) {\n const parsed =\n s.replace(s.text, \"&lt;\", \"<\") || s.replace(s.text, \"&amp;\", \"&\");\n\n if (!parsed) {\n s.add(\"&\");\n }\n\n return true;\n }\n\n return false;\n };\n\n while (s.position < s.text.length) {\n const ch = s.text.charAt(s.position);\n\n const parsed =\n s.parseWS(ch) ||\n (/</.test(ch) &&\n (s.parseStartTag(\"bold\", \"<b>\") ||\n s.parseStartTag(\"ital\", \"<i>\") ||\n s.parseStartTag(\"mono\", \"<code>\") ||\n s.parseEndTag(\"bold\", \"</b>\") ||\n s.parseEndTag(\"ital\", \"</i>\") ||\n s.parseEndTag(\"mono\", \"</code>\"))) ||\n parseEntities(ch);\n\n if (!parsed) {\n s.add(ch);\n }\n s.position++;\n }\n s.emitBlock();\n return s.blocks;\n }\n\n /**\n *\n * @param {string} text\n * @returns {Array}\n */\n splitMarkdownBlocks(text) {\n const s = new MarkupAccumulator(text);\n let beginable = true;\n\n const parseOverride = (ch) => {\n if (/\\\\/.test(ch)) {\n if (s.position < this.text.length + 1) {\n s.position++;\n ch = this.text.charAt(s.position);\n if (/ \\t/.test(ch)) {\n s.spacing = true;\n } else {\n s.add(ch);\n beginable = false;\n }\n }\n\n return true;\n }\n\n return false;\n };\n\n while (s.position < s.text.length) {\n const ch = s.text.charAt(s.position);\n\n const parsed =\n s.parseWS(ch) ||\n parseOverride(ch) ||\n ((beginable || s.spacing) &&\n (s.parseStartTag(\"bold\", \"*\") ||\n s.parseStartTag(\"ital\", \"_\") ||\n s.parseStartTag(\"mono\", \"`\"))) ||\n s.parseEndTag(\"bold\", \"*\", \"afterBold\") ||\n s.parseEndTag(\"ital\", \"_\", \"afterItal\") ||\n s.parseEndTag(\"mono\", \"`\", \"afterMono\");\n\n if (!parsed) {\n s.add(ch);\n beginable = false;\n }\n s.position++;\n }\n s.emitBlock();\n return s.blocks;\n }\n\n /**\n * Explodes a piece of text into single-font blocks using a given markup\n *\n * @param {string} text\n * @param {boolean|'md'|'markdown'|'html'} markupSystem\n * @returns {Array.<{text: string, mod: string}>}\n * @private\n */\n splitBlocks(text, markupSystem) {\n const system = this.decodeMarkupSystem(markupSystem);\n if (system === \"none\") {\n return [\n {\n text: text,\n mod: \"normal\",\n },\n ];\n } else if (system === \"markdown\") {\n return this.splitMarkdownBlocks(text);\n } else if (system === \"html\") {\n return this.splitHtmlBlocks(text);\n }\n }\n\n /**\n * @param {string} text\n * @returns {boolean} true if text length over the current max with\n * @private\n */\n overMaxWidth(text) {\n const width = this.ctx.measureText(text).width;\n return this.lines.curWidth() + width > this.parent.fontOptions.maxWdt;\n }\n\n /**\n * Determine the longest part of the sentence which still fits in the\n * current max width.\n *\n * @param {Array} words Array of strings signifying a text lines\n * @returns {number} index of first item in string making string go over max\n * @private\n */\n getLongestFit(words) {\n let text = \"\";\n let w = 0;\n\n while (w < words.length) {\n const pre = text === \"\" ? \"\" : \" \";\n const newText = text + pre + words[w];\n\n if (this.overMaxWidth(newText)) break;\n text = newText;\n w++;\n }\n\n return w;\n }\n\n /**\n * Determine the longest part of the string which still fits in the\n * current max width.\n *\n * @param {Array} words Array of strings signifying a text lines\n * @returns {number} index of first item in string making string go over max\n */\n getLongestFitWord(words) {\n let w = 0;\n\n while (w < words.length) {\n if (this.overMaxWidth(words.slice(0, w))) break;\n w++;\n }\n\n return w;\n }\n\n /**\n * Split the passed text into lines, according to width constraint (if any).\n *\n * The method assumes that the input string is a single line, i.e. without lines break.\n *\n * This method retains spaces, if still present (case `font.multi: false`).\n * A space which falls on an internal line break, will be replaced by a newline.\n * There is no special handling of tabs; these go along with the flow.\n *\n * @param {string} str\n * @param {string} [mod='normal']\n * @param {boolean} [appendLast=false]\n * @private\n */\n splitStringIntoLines(str, mod = \"normal\", appendLast = false) {\n // Set the canvas context font, based upon the current selected/hover state\n // and the provided mod, so the text measurement performed by getLongestFit\n // will be accurate - and not just use the font of whoever last used the canvas.\n this.parent.getFormattingValues(this.ctx, this.selected, this.hover, mod);\n\n // Still-present spaces are relevant, retain them\n str = str.replace(/^( +)/g, \"$1\\r\");\n str = str.replace(/([^\\r][^ ]*)( +)/g, \"$1\\r$2\\r\");\n let words = str.split(\"\\r\");\n\n while (words.length > 0) {\n let w = this.getLongestFit(words);\n\n if (w === 0) {\n // Special case: the first word is already larger than the max width.\n const word = words[0];\n\n // Break the word to the largest part that fits the line\n const x = this.getLongestFitWord(word);\n this.lines.newLine(word.slice(0, x), mod);\n\n // Adjust the word, so that the rest will be done next iteration\n words[0] = word.slice(x);\n } else {\n // skip any space that is replaced by a newline\n let newW = w;\n if (words[w - 1] === \" \") {\n w--;\n } else if (words[newW] === \" \") {\n newW++;\n }\n\n const text = words.slice(0, w).join(\"\");\n\n if (w == words.length && appendLast) {\n this.lines.append(text, mod);\n } else {\n this.lines.newLine(text, mod);\n }\n\n // Adjust the word, so that the rest will be done next iteration\n words = words.slice(newW);\n }\n }\n }\n}\n\nexport default LabelSplitter;\n","import { deepExtend, forEach, overrideOpacity, topMost } from \"vis-util/esnext\";\nimport { choosify, isValidLabel } from \"./ComponentUtil\";\nimport LabelSplitter from \"./LabelSplitter\";\n\n/**\n * List of special styles for multi-fonts\n *\n * @private\n */\nconst multiFontStyle = [\"bold\", \"ital\", \"boldital\", \"mono\"];\n\n/**\n * A Label to be used for Nodes or Edges.\n */\nclass Label {\n /**\n * @param {object} body\n * @param {object} options\n * @param {boolean} [edgelabel=false]\n */\n constructor(body, options, edgelabel = false) {\n this.body = body;\n this.pointToSelf = false;\n this.baseSize = undefined;\n this.fontOptions = {}; // instance variable containing the *instance-local* font options\n this.setOptions(options);\n this.size = { top: 0, left: 0, width: 0, height: 0, yLine: 0 };\n this.isEdgeLabel = edgelabel;\n }\n\n /**\n * @param {object} options the options of the parent Node-instance\n */\n setOptions(options) {\n this.elementOptions = options; // Reference to the options of the parent Node-instance\n\n this.initFontOptions(options.font);\n\n if (isValidLabel(options.label)) {\n this.labelDirty = true;\n } else {\n // Bad label! Change the option value to prevent bad stuff happening\n options.label = undefined;\n }\n\n if (options.font !== undefined && options.font !== null) {\n // font options can be deleted at various levels\n if (typeof options.font === \"string\") {\n this.baseSize = this.fontOptions.size;\n } else if (typeof options.font === \"object\") {\n const size = options.font.size;\n\n if (size !== undefined) {\n this.baseSize = size;\n }\n }\n }\n }\n\n /**\n * Init the font Options structure.\n *\n * Member fontOptions serves as an accumulator for the current font options.\n * As such, it needs to be completely separated from the node options.\n *\n * @param {object} newFontOptions the new font options to process\n * @private\n */\n initFontOptions(newFontOptions) {\n // Prepare the multi-font option objects.\n // These will be filled in propagateFonts(), if required\n forEach(multiFontStyle, (style) => {\n this.fontOptions[style] = {};\n });\n\n // Handle shorthand option, if present\n if (Label.parseFontString(this.fontOptions, newFontOptions)) {\n this.fontOptions.vadjust = 0;\n return;\n }\n\n // Copy over the non-multifont options, if specified\n forEach(newFontOptions, (prop, n) => {\n if (prop !== undefined && prop !== null && typeof prop !== \"object\") {\n this.fontOptions[n] = prop;\n }\n });\n }\n\n /**\n * If in-variable is a string, parse it as a font specifier.\n *\n * Note that following is not done here and have to be done after the call:\n * - Not all font options are set (vadjust, mod)\n *\n * @param {object} outOptions out-parameter, object in which to store the parse results (if any)\n * @param {object} inOptions font options to parse\n * @returns {boolean} true if font parsed as string, false otherwise\n * @static\n */\n static parseFontString(outOptions, inOptions) {\n if (!inOptions || typeof inOptions !== \"string\") return false;\n\n const newOptionsArray = inOptions.split(\" \");\n\n outOptions.size = +newOptionsArray[0].replace(\"px\", \"\");\n outOptions.face = newOptionsArray[1];\n outOptions.color = newOptionsArray[2];\n\n return true;\n }\n\n /**\n * Set the width and height constraints based on 'nearest' value\n *\n * @param {Array} pile array of option objects to consider\n * @returns {object} the actual constraint values to use\n * @private\n */\n constrain(pile) {\n // NOTE: constrainWidth and constrainHeight never set!\n // NOTE: for edge labels, only 'maxWdt' set\n // Node labels can set all the fields\n const fontOptions = {\n constrainWidth: false,\n maxWdt: -1,\n minWdt: -1,\n constrainHeight: false,\n minHgt: -1,\n valign: \"middle\",\n };\n\n const widthConstraint = topMost(pile, \"widthConstraint\");\n if (typeof widthConstraint === \"number\") {\n fontOptions.maxWdt = Number(widthConstraint);\n fontOptions.minWdt = Number(widthConstraint);\n } else if (typeof widthConstraint === \"object\") {\n const widthConstraintMaximum = topMost(pile, [\n \"widthConstraint\",\n \"maximum\",\n ]);\n if (typeof widthConstraintMaximum === \"number\") {\n fontOptions.maxWdt = Number(widthConstraintMaximum);\n }\n const widthConstraintMinimum = topMost(pile, [\n \"widthConstraint\",\n \"minimum\",\n ]);\n if (typeof widthConstraintMinimum === \"number\") {\n fontOptions.minWdt = Number(widthConstraintMinimum);\n }\n }\n\n const heightConstraint = topMost(pile, \"heightConstraint\");\n if (typeof heightConstraint === \"number\") {\n fontOptions.minHgt = Number(heightConstraint);\n } else if (typeof heightConstraint === \"object\") {\n const heightConstraintMinimum = topMost(pile, [\n \"heightConstraint\",\n \"minimum\",\n ]);\n if (typeof heightConstraintMinimum === \"number\") {\n fontOptions.minHgt = Number(heightConstraintMinimum);\n }\n const heightConstraintValign = topMost(pile, [\n \"heightConstraint\",\n \"valign\",\n ]);\n if (typeof heightConstraintValign === \"string\") {\n if (\n heightConstraintValign === \"top\" ||\n heightConstraintValign === \"bottom\"\n ) {\n fontOptions.valign = heightConstraintValign;\n }\n }\n }\n\n return fontOptions;\n }\n\n /**\n * Set options and update internal state\n *\n * @param {object} options options to set\n * @param {Array} pile array of option objects to consider for option 'chosen'\n */\n update(options, pile) {\n this.setOptions(options, true);\n this.propagateFonts(pile);\n deepExtend(this.fontOptions, this.constrain(pile));\n this.fontOptions.chooser = choosify(\"label\", pile);\n }\n\n /**\n * When margins are set in an element, adjust sizes is called to remove them\n * from the width/height constraints. This must be done prior to label sizing.\n *\n * @param {{top: number, right: number, bottom: number, left: number}} margins\n */\n adjustSizes(margins) {\n const widthBias = margins ? margins.right + margins.left : 0;\n if (this.fontOptions.constrainWidth) {\n this.fontOptions.maxWdt -= widthBias;\n this.fontOptions.minWdt -= widthBias;\n }\n const heightBias = margins ? margins.top + margins.bottom : 0;\n if (this.fontOptions.constrainHeight) {\n this.fontOptions.minHgt -= heightBias;\n }\n }\n\n /////////////////////////////////////////////////////////\n // Methods for handling options piles\n // Eventually, these will be moved to a separate class\n /////////////////////////////////////////////////////////\n\n /**\n * Add the font members of the passed list of option objects to the pile.\n *\n * @param {Pile} dstPile pile of option objects add to\n * @param {Pile} srcPile pile of option objects to take font options from\n * @private\n */\n addFontOptionsToPile(dstPile, srcPile) {\n for (let i = 0; i < srcPile.length; ++i) {\n this.addFontToPile(dstPile, srcPile[i]);\n }\n }\n\n /**\n * Add given font option object to the list of objects (the 'pile') to consider for determining\n * multi-font option values.\n *\n * @param {Pile} pile pile of option objects to use\n * @param {object} options instance to add to pile\n * @private\n */\n addFontToPile(pile, options) {\n if (options === undefined) return;\n if (options.font === undefined || options.font === null) return;\n\n const item = options.font;\n pile.push(item);\n }\n\n /**\n * Collect all own-property values from the font pile that aren't multi-font option objectss.\n *\n * @param {Pile} pile pile of option objects to use\n * @returns {object} object with all current own basic font properties\n * @private\n */\n getBasicOptions(pile) {\n const ret = {};\n\n // Scans the whole pile to get all options present\n for (let n = 0; n < pile.length; ++n) {\n let fontOptions = pile[n];\n\n // Convert shorthand if necessary\n const tmpShorthand = {};\n if (Label.parseFontString(tmpShorthand, fontOptions)) {\n fontOptions = tmpShorthand;\n }\n\n forEach(fontOptions, (opt, name) => {\n if (opt === undefined) return; // multi-font option need not be present\n if (Object.prototype.hasOwnProperty.call(ret, name)) return; // Keep first value we encounter\n\n if (multiFontStyle.indexOf(name) !== -1) {\n // Skip multi-font properties but we do need the structure\n ret[name] = {};\n } else {\n ret[name] = opt;\n }\n });\n }\n\n return ret;\n }\n\n /**\n * Return the value for given option for the given multi-font.\n *\n * All available option objects are trawled in the set order to construct the option values.\n *\n * ---------------------------------------------------------------------\n * ## Traversal of pile for multi-fonts\n *\n * The determination of multi-font option values is a special case, because any values not\n * present in the multi-font options should by definition be taken from the main font options,\n * i.e. from the current 'parent' object of the multi-font option.\n *\n * ### Search order for multi-fonts\n *\n * 'bold' used as example:\n *\n * - search in option group 'bold' in local properties\n * - search in main font option group in local properties\n *\n * ---------------------------------------------------------------------\n *\n * @param {Pile} pile pile of option objects to use\n * @param {MultiFontStyle} multiName sub path for the multi-font\n * @param {string} option the option to search for, for the given multi-font\n * @returns {string|number} the value for the given option\n * @private\n */\n getFontOption(pile, multiName, option) {\n let multiFont;\n\n // Search multi font in local properties\n for (let n = 0; n < pile.length; ++n) {\n const fontOptions = pile[n];\n\n if (Object.prototype.hasOwnProperty.call(fontOptions, multiName)) {\n multiFont = fontOptions[multiName];\n if (multiFont === undefined || multiFont === null) continue;\n\n // Convert shorthand if necessary\n // TODO: inefficient to do this conversion every time; find a better way.\n const tmpShorthand = {};\n if (Label.parseFontString(tmpShorthand, multiFont)) {\n multiFont = tmpShorthand;\n }\n\n if (Object.prototype.hasOwnProperty.call(multiFont, option)) {\n return multiFont[option];\n }\n }\n }\n\n // Option is not mentioned in the multi font options; take it from the parent font options.\n // These have already been converted with getBasicOptions(), so use the converted values.\n if (Object.prototype.hasOwnProperty.call(this.fontOptions, option)) {\n return this.fontOptions[option];\n }\n\n // A value **must** be found; you should never get here.\n throw new Error(\n \"Did not find value for multi-font for property: '\" + option + \"'\"\n );\n }\n\n /**\n * Return all options values for the given multi-font.\n *\n * All available option objects are trawled in the set order to construct the option values.\n *\n * @param {Pile} pile pile of option objects to use\n * @param {MultiFontStyle} multiName sub path for the mod-font\n * @returns {MultiFontOptions}\n * @private\n */\n getFontOptions(pile, multiName) {\n const result = {};\n const optionNames = [\"color\", \"size\", \"face\", \"mod\", \"vadjust\"]; // List of allowed options per multi-font\n\n for (let i = 0; i < optionNames.length; ++i) {\n const mod = optionNames[i];\n result[mod] = this.getFontOption(pile, multiName, mod);\n }\n\n return result;\n }\n\n /////////////////////////////////////////////////////////\n // End methods for handling options piles\n /////////////////////////////////////////////////////////\n\n /**\n * Collapse the font options for the multi-font to single objects, from\n * the chain of option objects passed (the 'pile').\n *\n * @param {Pile} pile sequence of option objects to consider.\n * First item in list assumed to be the newly set options.\n */\n propagateFonts(pile) {\n const fontPile = []; // sequence of font objects to consider, order important\n\n // Note that this.elementOptions is not used here.\n this.addFontOptionsToPile(fontPile, pile);\n this.fontOptions = this.getBasicOptions(fontPile);\n\n // We set multifont values even if multi === false, for consistency (things break otherwise)\n for (let i = 0; i < multiFontStyle.length; ++i) {\n const mod = multiFontStyle[i];\n const modOptions = this.fontOptions[mod];\n const tmpMultiFontOptions = this.getFontOptions(fontPile, mod);\n\n // Copy over found values\n forEach(tmpMultiFontOptions, (option, n) => {\n modOptions[n] = option;\n });\n\n modOptions.size = Number(modOptions.size);\n modOptions.vadjust = Number(modOptions.vadjust);\n }\n }\n\n /**\n * Main function. This is called from anything that wants to draw a label.\n *\n * @param {CanvasRenderingContext2D} ctx\n * @param {number} x\n * @param {number} y\n * @param {boolean} selected\n * @param {boolean} hover\n * @param {string} [baseline='middle']\n */\n draw(ctx, x, y, selected, hover, baseline = \"middle\") {\n // if no label, return\n if (this.elementOptions.label === undefined) return;\n\n // check if we have to render the label\n let viewFontSize = this.fontOptions.size * this.body.view.scale;\n if (\n this.elementOptions.label &&\n viewFontSize < this.elementOptions.scaling.label.drawThreshold - 1\n )\n return;\n\n // This ensures that there will not be HUGE letters on screen\n // by setting an upper limit on the visible text size (regardless of zoomLevel)\n if (viewFontSize >= this.elementOptions.scaling.label.maxVisible) {\n viewFontSize =\n Number(this.elementOptions.scaling.label.maxVisible) /\n this.body.view.scale;\n }\n\n // update the size cache if required\n this.calculateLabelSize(ctx, selected, hover, x, y, baseline);\n this._drawBackground(ctx);\n this._drawText(ctx, x, this.size.yLine, baseline, viewFontSize);\n }\n\n /**\n * Draws the label background\n *\n * @param {CanvasRenderingContext2D} ctx\n * @private\n */\n _drawBackground(ctx) {\n if (\n this.fontOptions.background !== undefined &&\n this.fontOptions.background !== \"none\"\n ) {\n ctx.fillStyle = this.fontOptions.background;\n const size = this.getSize();\n ctx.fillRect(size.left, size.top, size.width, size.height);\n }\n }\n\n /**\n *\n * @param {CanvasRenderingContext2D} ctx\n * @param {number} x\n * @param {number} y\n * @param {string} [baseline='middle']\n * @param {number} viewFontSize\n * @private\n */\n _drawText(ctx, x, y, baseline = \"middle\", viewFontSize) {\n [x, y] = this._setAlignment(ctx, x, y, baseline);\n\n ctx.textAlign = \"left\";\n x = x - this.size.width / 2; // Shift label 1/2-distance to the left\n if (this.fontOptions.valign && this.size.height > this.size.labelHeight) {\n if (this.fontOptions.valign === \"top\") {\n y -= (this.size.height - this.size.labelHeight) / 2;\n }\n if (this.fontOptions.valign === \"bottom\") {\n y += (this.size.height - this.size.labelHeight) / 2;\n }\n }\n\n // draw the text\n for (let i = 0; i < this.lineCount; i++) {\n const line = this.lines[i];\n if (line && line.blocks) {\n let width = 0;\n if (this.isEdgeLabel || this.fontOptions.align === \"center\") {\n width += (this.size.width - line.width) / 2;\n } else if (this.fontOptions.align === \"right\") {\n width += this.size.width - line.width;\n }\n for (let j = 0; j < line.blocks.length; j++) {\n const block = line.blocks[j];\n ctx.font = block.font;\n const [fontColor, strokeColor] = this._getColor(\n block.color,\n viewFontSize,\n block.strokeColor\n );\n if (block.strokeWidth > 0) {\n ctx.lineWidth = block.strokeWidth;\n ctx.strokeStyle = strokeColor;\n ctx.lineJoin = \"round\";\n }\n ctx.fillStyle = fontColor;\n\n if (block.strokeWidth > 0) {\n ctx.strokeText(block.text, x + width, y + block.vadjust);\n }\n ctx.fillText(block.text, x + width, y + block.vadjust);\n width += block.width;\n }\n y += line.height;\n }\n }\n }\n\n /**\n *\n * @param {CanvasRenderingContext2D} ctx\n * @param {number} x\n * @param {number} y\n * @param {string} baseline\n * @returns {Array.<number>}\n * @private\n */\n _setAlignment(ctx, x, y, baseline) {\n // check for label alignment (for edges)\n // TODO: make alignment for nodes\n if (\n this.isEdgeLabel &&\n this.fontOptions.align !== \"horizontal\" &&\n this.pointToSelf === false\n ) {\n x = 0;\n y = 0;\n\n const lineMargin = 2;\n if (this.fontOptions.align === \"top\") {\n ctx.textBaseline = \"alphabetic\";\n y -= 2 * lineMargin; // distance from edge, required because we use alphabetic. Alphabetic has less difference between browsers\n } else if (this.fontOptions.align === \"bottom\") {\n ctx.textBaseline = \"hanging\";\n y += 2 * lineMargin; // distance from edge, required because we use hanging. Hanging has less difference between browsers\n } else {\n ctx.textBaseline = \"middle\";\n }\n } else {\n ctx.textBaseline = baseline;\n }\n return [x, y];\n }\n\n /**\n * fade in when relative scale is between threshold and threshold - 1.\n * If the relative scale would be smaller than threshold -1 the draw function would have returned before coming here.\n *\n * @param {string} color The font color to use\n * @param {number} viewFontSize\n * @param {string} initialStrokeColor\n * @returns {Array.<string>} An array containing the font color and stroke color\n * @private\n */\n _getColor(color, viewFontSize, initialStrokeColor) {\n let fontColor = color || \"#000000\";\n let strokeColor = initialStrokeColor || \"#ffffff\";\n if (viewFontSize <= this.elementOptions.scaling.label.drawThreshold) {\n const opacity = Math.max(\n 0,\n Math.min(\n 1,\n 1 - (this.elementOptions.scaling.label.drawThreshold - viewFontSize)\n )\n );\n fontColor = overrideOpacity(fontColor, opacity);\n strokeColor = overrideOpacity(strokeColor, opacity);\n }\n return [fontColor, strokeColor];\n }\n\n /**\n *\n * @param {CanvasRenderingContext2D} ctx\n * @param {boolean} selected\n * @param {boolean} hover\n * @returns {{width: number, height: number}}\n */\n getTextSize(ctx, selected = false, hover = false) {\n this._processLabel(ctx, selected, hover);\n return {\n width: this.size.width,\n height: this.size.height,\n lineCount: this.lineCount,\n };\n }\n\n /**\n * Get the current dimensions of the label\n *\n * @returns {rect}\n */\n getSize() {\n const lineMargin = 2;\n let x = this.size.left; // default values which might be overridden below\n let y = this.size.top - 0.5 * lineMargin; // idem\n\n if (this.isEdgeLabel) {\n const x2 = -this.size.width * 0.5;\n\n switch (this.fontOptions.align) {\n case \"middle\":\n x = x2;\n y = -this.size.height * 0.5;\n break;\n case \"top\":\n x = x2;\n y = -(this.size.height + lineMargin);\n break;\n case \"bottom\":\n x = x2;\n y = lineMargin;\n break;\n }\n }\n\n const ret = {\n left: x,\n top: y,\n width: this.size.width,\n height: this.size.height,\n };\n\n return ret;\n }\n\n /**\n *\n * @param {CanvasRenderingContext2D} ctx\n * @param {boolean} selected\n * @param {boolean} hover\n * @param {number} [x=0]\n * @param {number} [y=0]\n * @param {'middle'|'hanging'} [baseline='middle']\n */\n calculateLabelSize(ctx, selected, hover, x = 0, y = 0, baseline = \"middle\") {\n this._processLabel(ctx, selected, hover);\n this.size.left = x - this.size.width * 0.5;\n this.size.top = y - this.size.height * 0.5;\n this.size.yLine = y + (1 - this.lineCount) * 0.5 * this.fontOptions.size;\n if (baseline === \"hanging\") {\n this.size.top += 0.5 * this.fontOptions.size;\n this.size.top += 4; // distance from node, required because we use hanging. Hanging has less difference between browsers\n this.size.yLine += 4; // distance from node\n }\n }\n\n /**\n *\n * @param {CanvasRenderingContext2D} ctx\n * @param {boolean} selected\n * @param {boolean} hover\n * @param {string} mod\n * @returns {{color, size, face, mod, vadjust, strokeWidth: *, strokeColor: (*|string|allOptions.edges.font.strokeColor|{string}|allOptions.nodes.font.strokeColor|Array)}}\n */\n getFormattingValues(ctx, selected, hover, mod) {\n const getValue = function (fontOptions, mod, option) {\n if (mod === \"normal\") {\n if (option === \"mod\") return \"\";\n return fontOptions[option];\n }\n\n if (fontOptions[mod][option] !== undefined) {\n // Grumbl leaving out test on undefined equals false for \"\"\n return fontOptions[mod][option];\n } else {\n // Take from parent font option\n return fontOptions[option];\n }\n };\n\n const values = {\n color: getValue(this.fontOptions, mod, \"color\"),\n size: getValue(this.fontOptions, mod, \"size\"),\n face: getValue(this.fontOptions, mod, \"face\"),\n mod: getValue(this.fontOptions, mod, \"mod\"),\n vadjust: getValue(this.fontOptions, mod, \"vadjust\"),\n strokeWidth: this.fontOptions.strokeWidth,\n strokeColor: this.fontOptions.strokeColor,\n };\n if (selected || hover) {\n if (\n mod === \"normal\" &&\n this.fontOptions.chooser === true &&\n this.elementOptions.labelHighlightBold\n ) {\n values.mod = \"bold\";\n } else {\n if (typeof this.fontOptions.chooser === \"function\") {\n this.fontOptions.chooser(\n values,\n this.elementOptions.id,\n selected,\n hover\n );\n }\n }\n }\n\n let fontString = \"\";\n if (values.mod !== undefined && values.mod !== \"\") {\n // safeguard for undefined - this happened\n fontString += values.mod + \" \";\n }\n fontString += values.size + \"px \" + values.face;\n\n ctx.font = fontString.replace(/\"/g, \"\");\n values.font = ctx.font;\n values.height = values.size;\n return values;\n }\n\n /**\n *\n * @param {boolean} selected\n * @param {boolean} hover\n * @returns {boolean}\n */\n differentState(selected, hover) {\n return selected !== this.selectedState || hover !== this.hoverState;\n }\n\n /**\n * This explodes the passed text into lines and determines the width, height and number of lines.\n *\n * @param {CanvasRenderingContext2D} ctx\n * @param {boolean} selected\n * @param {boolean} hover\n * @param {string} inText the text to explode\n * @returns {{width, height, lines}|*}\n * @private\n */\n _processLabelText(ctx, selected, hover, inText) {\n const splitter = new LabelSplitter(ctx, this, selected, hover);\n return splitter.process(inText);\n }\n\n /**\n * This explodes the label string into lines and sets the width, height and number of lines.\n *\n * @param {CanvasRenderingContext2D} ctx\n * @param {boolean} selected\n * @param {boolean} hover\n * @private\n */\n _processLabel(ctx, selected, hover) {\n if (this.labelDirty === false && !this.differentState(selected, hover))\n return;\n\n const state = this._processLabelText(\n ctx,\n selected,\n hover,\n this.elementOptions.label\n );\n\n if (this.fontOptions.minWdt > 0 && state.width < this.fontOptions.minWdt) {\n state.width = this.fontOptions.minWdt;\n }\n\n this.size.labelHeight = state.height;\n if (this.fontOptions.minHgt > 0 && state.height < this.fontOptions.minHgt) {\n state.height = this.fontOptions.minHgt;\n }\n\n this.lines = state.lines;\n this.lineCount = state.lines.length;\n this.size.width = state.width;\n this.size.height = state.height;\n this.selectedState = selected;\n this.hoverState = hover;\n\n this.labelDirty = false;\n }\n\n /**\n * Check if this label is visible\n *\n * @returns {boolean} true if this label will be show, false otherwise\n */\n visible() {\n if (\n this.size.width === 0 ||\n this.size.height === 0 ||\n this.elementOptions.label === undefined\n ) {\n return false; // nothing to display\n }\n\n const viewFontSize = this.fontOptions.size * this.body.view.scale;\n if (viewFontSize < this.elementOptions.scaling.label.drawThreshold - 1) {\n return false; // Too small or too far away to show\n }\n\n return true;\n }\n}\n\nexport default Label;\n","/**\n * The Base class for all Nodes.\n */\nclass NodeBase {\n /**\n * @param {object} options\n * @param {object} body\n * @param {Label} labelModule\n */\n constructor(options, body, labelModule) {\n this.body = body;\n this.labelModule = labelModule;\n this.setOptions(options);\n this.top = undefined;\n this.left = undefined;\n this.height = undefined;\n this.width = undefined;\n this.radius = undefined;\n this.margin = undefined;\n this.refreshNeeded = true;\n this.boundingBox = { top: 0, left: 0, right: 0, bottom: 0 };\n }\n\n /**\n *\n * @param {object} options\n */\n setOptions(options) {\n this.options = options;\n }\n\n /**\n *\n * @param {Label} labelModule\n * @private\n */\n _setMargins(labelModule) {\n this.margin = {};\n if (this.options.margin) {\n if (typeof this.options.margin == \"object\") {\n this.margin.top = this.options.margin.top;\n this.margin.right = this.options.margin.right;\n this.margin.bottom = this.options.margin.bottom;\n this.margin.left = this.options.margin.left;\n } else {\n this.margin.top = this.options.margin;\n this.margin.right = this.options.margin;\n this.margin.bottom = this.options.margin;\n this.margin.left = this.options.margin;\n }\n }\n labelModule.adjustSizes(this.margin);\n }\n\n /**\n *\n * @param {CanvasRenderingContext2D} ctx\n * @param {number} angle\n * @returns {number}\n * @private\n */\n _distanceToBorder(ctx, angle) {\n const borderWidth = this.options.borderWidth;\n if (ctx) {\n this.resize(ctx);\n }\n return (\n Math.min(\n Math.abs(this.width / 2 / Math.cos(angle)),\n Math.abs(this.height / 2 / Math.sin(angle))\n ) + borderWidth\n );\n }\n\n /**\n *\n * @param {CanvasRenderingContext2D} ctx\n * @param {ArrowOptions} values\n */\n enableShadow(ctx, values) {\n if (values.shadow) {\n ctx.shadowColor = values.shadowColor;\n ctx.shadowBlur = values.shadowSize;\n ctx.shadowOffsetX = values.shadowX;\n ctx.shadowOffsetY = values.shadowY;\n }\n }\n\n /**\n *\n * @param {CanvasRenderingContext2D} ctx\n * @param {ArrowOptions} values\n */\n disableShadow(ctx, values) {\n if (values.shadow) {\n ctx.shadowColor = \"rgba(0,0,0,0)\";\n ctx.shadowBlur = 0;\n ctx.shadowOffsetX = 0;\n ctx.shadowOffsetY = 0;\n }\n }\n\n /**\n *\n * @param {CanvasRenderingContext2D} ctx\n * @param {ArrowOptions} values\n */\n enableBorderDashes(ctx, values) {\n if (values.borderDashes !== false) {\n if (ctx.setLineDash !== undefined) {\n let dashes = values.borderDashes;\n if (dashes === true) {\n dashes = [5, 15];\n }\n ctx.setLineDash(dashes);\n } else {\n console.warn(\n \"setLineDash is not supported in this browser. The dashed borders cannot be used.\"\n );\n this.options.shapeProperties.borderDashes = false;\n values.borderDashes = false;\n }\n }\n }\n\n /**\n *\n * @param {CanvasRenderingContext2D} ctx\n * @param {ArrowOptions} values\n */\n disableBorderDashes(ctx, values) {\n if (values.borderDashes !== false) {\n if (ctx.setLineDash !== undefined) {\n ctx.setLineDash([0]);\n } else {\n console.warn(\n \"setLineDash is not supported in this browser. The dashed borders cannot be used.\"\n );\n this.options.shapeProperties.borderDashes = false;\n values.borderDashes = false;\n }\n }\n }\n\n /**\n * Determine if the shape of a node needs to be recalculated.\n *\n * @param {boolean} selected\n * @param {boolean} hover\n * @returns {boolean}\n * @protected\n */\n needsRefresh(selected, hover) {\n if (this.refreshNeeded === true) {\n // This is probably not the best location to reset this member.\n // However, in the current logic, it is the most convenient one.\n this.refreshNeeded = false;\n return true;\n }\n\n return (\n this.width === undefined ||\n this.labelModule.differentState(selected, hover)\n );\n }\n\n /**\n *\n * @param {CanvasRenderingContext2D} ctx\n * @param {ArrowOptions} values\n */\n initContextForDraw(ctx, values) {\n const borderWidth = values.borderWidth / this.body.view.scale;\n\n ctx.lineWidth = Math.min(this.width, borderWidth);\n ctx.strokeStyle = values.borderColor;\n ctx.fillStyle = values.color;\n }\n\n /**\n *\n * @param {CanvasRenderingContext2D} ctx\n * @param {ArrowOptions} values\n */\n performStroke(ctx, values) {\n const borderWidth = values.borderWidth / this.body.view.scale;\n\n //draw dashed border if enabled, save and restore is required for firefox not to crash on unix.\n ctx.save();\n // if borders are zero width, they will be drawn with width 1 by default. This prevents that\n if (borderWidth > 0) {\n this.enableBorderDashes(ctx, values);\n //draw the border\n ctx.stroke();\n //disable dashed border for other elements\n this.disableBorderDashes(ctx, values);\n }\n ctx.restore();\n }\n\n /**\n *\n * @param {CanvasRenderingContext2D} ctx\n * @param {ArrowOptions} values\n */\n performFill(ctx, values) {\n ctx.save();\n ctx.fillStyle = values.color;\n // draw shadow if enabled\n this.enableShadow(ctx, values);\n // draw the background\n ctx.fill();\n // disable shadows for other elements.\n this.disableShadow(ctx, values);\n\n ctx.restore();\n this.performStroke(ctx, values);\n }\n\n /**\n *\n * @param {number} margin\n * @private\n */\n _addBoundingBoxMargin(margin) {\n this.boundingBox.left -= margin;\n this.boundingBox.top -= margin;\n this.boundingBox.bottom += margin;\n this.boundingBox.right += margin;\n }\n\n /**\n * Actual implementation of this method call.\n *\n * Doing it like this makes it easier to override\n * in the child classes.\n *\n * @param {number} x width\n * @param {number} y height\n * @param {CanvasRenderingContext2D} ctx\n * @param {boolean} selected\n * @param {boolean} hover\n * @private\n */\n _updateBoundingBox(x, y, ctx, selected, hover) {\n if (ctx !== undefined) {\n this.resize(ctx, selected, hover);\n }\n\n this.left = x - this.width / 2;\n this.top = y - this.height / 2;\n\n this.boundingBox.left = this.left;\n this.boundingBox.top = this.top;\n this.boundingBox.bottom = this.top + this.height;\n this.boundingBox.right = this.left + this.width;\n }\n\n /**\n * Default implementation of this method call.\n * This acts as a stub which can be overridden.\n *\n * @param {number} x width\n * @param {number} y height\n * @param {CanvasRenderingContext2D} ctx\n * @param {boolean} selected\n * @param {boolean} hover\n */\n updateBoundingBox(x, y, ctx, selected, hover) {\n this._updateBoundingBox(x, y, ctx, selected, hover);\n }\n\n /**\n * Determine the dimensions to use for nodes with an internal label\n *\n * Currently, these are: Circle, Ellipse, Database, Box\n * The other nodes have external labels, and will not call this method\n *\n * If there is no label, decent default values are supplied.\n *\n * @param {CanvasRenderingContext2D} ctx\n * @param {boolean} [selected]\n * @param {boolean} [hover]\n * @returns {{width:number, height:number}}\n */\n getDimensionsFromLabel(ctx, selected, hover) {\n // NOTE: previously 'textSize' was not put in 'this' for Ellipse\n // TODO: examine the consequences.\n this.textSize = this.labelModule.getTextSize(ctx, selected, hover);\n let width = this.textSize.width;\n let height = this.textSize.height;\n\n const DEFAULT_SIZE = 14;\n if (width === 0) {\n // This happens when there is no label text set\n width = DEFAULT_SIZE; // use a decent default\n height = DEFAULT_SIZE; // if width zero, then height also always zero\n }\n\n return { width: width, height: height };\n }\n}\n\nexport default NodeBase;\n","\"use strict\";\n\nimport NodeBase from \"../util/NodeBase\";\nimport { drawRoundRect } from \"../util/shapes\";\n\n/**\n * A Box Node/Cluster shape.\n *\n * @augments NodeBase\n */\nclass Box extends NodeBase {\n /**\n * @param {object} options\n * @param {object} body\n * @param {Label} labelModule\n */\n constructor(options, body, labelModule) {\n super(options, body, labelModule);\n this._setMargins(labelModule);\n }\n\n /**\n *\n * @param {CanvasRenderingContext2D} ctx\n * @param {boolean} [selected]\n * @param {boolean} [hover]\n */\n resize(ctx, selected = this.selected, hover = this.hover) {\n if (this.needsRefresh(selected, hover)) {\n const dimensions = this.getDimensionsFromLabel(ctx, selected, hover);\n\n this.width = dimensions.width + this.margin.right + this.margin.left;\n this.height = dimensions.height + this.margin.top + this.margin.bottom;\n this.radius = this.width / 2;\n }\n }\n\n /**\n *\n * @param {CanvasRenderingContext2D} ctx\n * @param {number} x width\n * @param {number} y height\n * @param {boolean} selected\n * @param {boolean} hover\n * @param {ArrowOptions} values\n */\n draw(ctx, x, y, selected, hover, values) {\n this.resize(ctx, selected, hover);\n this.left = x - this.width / 2;\n this.top = y - this.height / 2;\n\n this.initContextForDraw(ctx, values);\n drawRoundRect(\n ctx,\n this.left,\n this.top,\n this.width,\n this.height,\n values.borderRadius\n );\n this.performFill(ctx, values);\n\n this.updateBoundingBox(x, y, ctx, selected, hover);\n this.labelModule.draw(\n ctx,\n this.left + this.textSize.width / 2 + this.margin.left,\n this.top + this.textSize.height / 2 + this.margin.top,\n selected,\n hover\n );\n }\n\n /**\n *\n * @param {number} x width\n * @param {number} y height\n * @param {CanvasRenderingContext2D} ctx\n * @param {boolean} selected\n * @param {boolean} hover\n */\n updateBoundingBox(x, y, ctx, selected, hover) {\n this._updateBoundingBox(x, y, ctx, selected, hover);\n\n const borderRadius = this.options.shapeProperties.borderRadius; // only effective for box\n this._addBoundingBoxMargin(borderRadius);\n }\n\n /**\n *\n * @param {CanvasRenderingContext2D} ctx\n * @param {number} angle\n * @returns {number}\n */\n distanceToBorder(ctx, angle) {\n if (ctx) {\n this.resize(ctx);\n }\n const borderWidth = this.options.borderWidth;\n\n return (\n Math.min(\n Math.abs(this.width / 2 / Math.cos(angle)),\n Math.abs(this.height / 2 / Math.sin(angle))\n ) + borderWidth\n );\n }\n}\n\nexport default Box;\n","import NodeBase from \"./NodeBase\";\nimport { drawCircle } from \"./shapes\";\n\n/**\n * NOTE: This is a bad base class\n *\n * Child classes are:\n *\n * Image - uses *only* image methods\n * Circle - uses *only* _drawRawCircle\n * CircleImage - uses all\n *\n * TODO: Refactor, move _drawRawCircle to different module, derive Circle from NodeBase\n * Rename this to ImageBase\n * Consolidate common code in Image and CircleImage to base class\n *\n * @augments NodeBase\n */\nclass CircleImageBase extends NodeBase {\n /**\n * @param {object} options\n * @param {object} body\n * @param {Label} labelModule\n */\n constructor(options, body, labelModule) {\n super(options, body, labelModule);\n this.labelOffset = 0;\n this.selected = false;\n }\n\n /**\n *\n * @param {object} options\n * @param {object} [imageObj]\n * @param {object} [imageObjAlt]\n */\n setOptions(options, imageObj, imageObjAlt) {\n this.options = options;\n\n if (!(imageObj === undefined && imageObjAlt === undefined)) {\n this.setImages(imageObj, imageObjAlt);\n }\n }\n\n /**\n * Set the images for this node.\n *\n * The images can be updated after the initial setting of options;\n * therefore, this method needs to be reentrant.\n *\n * For correct working in error cases, it is necessary to properly set\n * field 'nodes.brokenImage' in the options.\n *\n * @param {Image} imageObj required; main image to show for this node\n * @param {Image|undefined} imageObjAlt optional; image to show when node is selected\n */\n setImages(imageObj, imageObjAlt) {\n if (imageObjAlt && this.selected) {\n this.imageObj = imageObjAlt;\n this.imageObjAlt = imageObj;\n } else {\n this.imageObj = imageObj;\n this.imageObjAlt = imageObjAlt;\n }\n }\n\n /**\n * Set selection and switch between the base and the selected image.\n *\n * Do the switch only if imageObjAlt exists.\n *\n * @param {boolean} selected value of new selected state for current node\n */\n switchImages(selected) {\n const selection_changed =\n (selected && !this.selected) || (!selected && this.selected);\n this.selected = selected; // Remember new selection\n\n if (this.imageObjAlt !== undefined && selection_changed) {\n const imageTmp = this.imageObj;\n this.imageObj = this.imageObjAlt;\n this.imageObjAlt = imageTmp;\n }\n }\n\n /**\n * Returns Image Padding from node options\n *\n * @returns {{top: number,left: number,bottom: number,right: number}} image padding inside this shape\n * @private\n */\n _getImagePadding() {\n const imgPadding = { top: 0, right: 0, bottom: 0, left: 0 };\n if (this.options.imagePadding) {\n const optImgPadding = this.options.imagePadding;\n if (typeof optImgPadding == \"object\") {\n imgPadding.top = optImgPadding.top;\n imgPadding.right = optImgPadding.right;\n imgPadding.bottom = optImgPadding.bottom;\n imgPadding.left = optImgPadding.left;\n } else {\n imgPadding.top = optImgPadding;\n imgPadding.right = optImgPadding;\n imgPadding.bottom = optImgPadding;\n imgPadding.left = optImgPadding;\n }\n }\n\n return imgPadding;\n }\n\n /**\n * Adjust the node dimensions for a loaded image.\n *\n * Pre: this.imageObj is valid\n */\n _resizeImage() {\n let width, height;\n\n if (this.options.shapeProperties.useImageSize === false) {\n // Use the size property\n let ratio_width = 1;\n let ratio_height = 1;\n\n // Only calculate the proper ratio if both width and height not zero\n if (this.imageObj.width && this.imageObj.height) {\n if (this.imageObj.width > this.imageObj.height) {\n ratio_width = this.imageObj.width / this.imageObj.height;\n } else {\n ratio_height = this.imageObj.height / this.imageObj.width;\n }\n }\n\n width = this.options.size * 2 * ratio_width;\n height = this.options.size * 2 * ratio_height;\n } else {\n // Use the image size with image padding\n const imgPadding = this._getImagePadding();\n width = this.imageObj.width + imgPadding.left + imgPadding.right;\n height = this.imageObj.height + imgPadding.top + imgPadding.bottom;\n }\n\n this.width = width;\n this.height = height;\n this.radius = 0.5 * this.width;\n }\n\n /**\n *\n * @param {CanvasRenderingContext2D} ctx\n * @param {number} x width\n * @param {number} y height\n * @param {ArrowOptions} values\n * @private\n */\n _drawRawCircle(ctx, x, y, values) {\n this.initContextForDraw(ctx, values);\n drawCircle(ctx, x, y, values.size);\n this.performFill(ctx, values);\n }\n\n /**\n *\n * @param {CanvasRenderingContext2D} ctx\n * @param {ArrowOptions} values\n * @private\n */\n _drawImageAtPosition(ctx, values) {\n if (this.imageObj.width != 0) {\n // draw the image\n ctx.globalAlpha = values.opacity !== undefined ? values.opacity : 1;\n\n // draw shadow if enabled\n this.enableShadow(ctx, values);\n\n let factor = 1;\n if (this.options.shapeProperties.interpolation === true) {\n factor = this.imageObj.width / this.width / this.body.view.scale;\n }\n\n const imgPadding = this._getImagePadding();\n\n const imgPosLeft = this.left + imgPadding.left;\n const imgPosTop = this.top + imgPadding.top;\n const imgWidth = this.width - imgPadding.left - imgPadding.right;\n const imgHeight = this.height - imgPadding.top - imgPadding.bottom;\n this.imageObj.drawImageAtPosition(\n ctx,\n factor,\n imgPosLeft,\n imgPosTop,\n imgWidth,\n imgHeight\n );\n\n // disable shadows for other elements.\n this.disableShadow(ctx, values);\n }\n }\n\n /**\n *\n * @param {CanvasRenderingContext2D} ctx\n * @param {number} x width\n * @param {number} y height\n * @param {boolean} selected\n * @param {boolean} hover\n * @private\n */\n _drawImageLabel(ctx, x, y, selected, hover) {\n let offset = 0;\n\n if (this.height !== undefined) {\n offset = this.height * 0.5;\n const labelDimensions = this.labelModule.getTextSize(\n ctx,\n selected,\n hover\n );\n if (labelDimensions.lineCount >= 1) {\n offset += labelDimensions.height / 2;\n }\n }\n\n const yLabel = y + offset;\n\n if (this.options.label) {\n this.labelOffset = offset;\n }\n this.labelModule.draw(ctx, x, yLabel, selected, hover, \"hanging\");\n }\n}\n\nexport default CircleImageBase;\n","\"use strict\";\n\nimport CircleImageBase from \"../util/CircleImageBase\";\n\n/**\n * A Circle Node/Cluster shape.\n *\n * @augments CircleImageBase\n */\nclass Circle extends CircleImageBase {\n /**\n * @param {object} options\n * @param {object} body\n * @param {Label} labelModule\n */\n constructor(options, body, labelModule) {\n super(options, body, labelModule);\n this._setMargins(labelModule);\n }\n\n /**\n *\n * @param {CanvasRenderingContext2D} ctx\n * @param {boolean} [selected]\n * @param {boolean} [hover]\n */\n resize(ctx, selected = this.selected, hover = this.hover) {\n if (this.needsRefresh(selected, hover)) {\n const dimensions = this.getDimensionsFromLabel(ctx, selected, hover);\n\n const diameter = Math.max(\n dimensions.width + this.margin.right + this.margin.left,\n dimensions.height + this.margin.top + this.margin.bottom\n );\n\n this.options.size = diameter / 2; // NOTE: this size field only set here, not in Ellipse, Database, Box\n this.width = diameter;\n this.height = diameter;\n this.radius = this.width / 2;\n }\n }\n\n /**\n *\n * @param {CanvasRenderingContext2D} ctx\n * @param {number} x width\n * @param {number} y height\n * @param {boolean} selected\n * @param {boolean} hover\n * @param {ArrowOptions} values\n */\n draw(ctx, x, y, selected, hover, values) {\n this.resize(ctx, selected, hover);\n this.left = x - this.width / 2;\n this.top = y - this.height / 2;\n\n this._drawRawCircle(ctx, x, y, values);\n\n this.updateBoundingBox(x, y);\n this.labelModule.draw(\n ctx,\n this.left + this.textSize.width / 2 + this.margin.left,\n y,\n selected,\n hover\n );\n }\n\n /**\n *\n * @param {number} x width\n * @param {number} y height\n */\n updateBoundingBox(x, y) {\n this.boundingBox.top = y - this.options.size;\n this.boundingBox.left = x - this.options.size;\n this.boundingBox.right = x + this.options.size;\n this.boundingBox.bottom = y + this.options.size;\n }\n\n /**\n *\n * @param {CanvasRenderingContext2D} ctx\n * @returns {number}\n */\n distanceToBorder(ctx) {\n if (ctx) {\n this.resize(ctx);\n }\n return this.width * 0.5;\n }\n}\n\nexport default Circle;\n","\"use strict\";\n\nimport CircleImageBase from \"../util/CircleImageBase\";\n\n/**\n * A CircularImage Node/Cluster shape.\n *\n * @augments CircleImageBase\n */\nclass CircularImage extends CircleImageBase {\n /**\n * @param {object} options\n * @param {object} body\n * @param {Label} labelModule\n * @param {Image} imageObj\n * @param {Image} imageObjAlt\n */\n constructor(options, body, labelModule, imageObj, imageObjAlt) {\n super(options, body, labelModule);\n\n this.setImages(imageObj, imageObjAlt);\n }\n\n /**\n *\n * @param {CanvasRenderingContext2D} ctx\n * @param {boolean} [selected]\n * @param {boolean} [hover]\n */\n resize(ctx, selected = this.selected, hover = this.hover) {\n const imageAbsent =\n this.imageObj.src === undefined ||\n this.imageObj.width === undefined ||\n this.imageObj.height === undefined;\n\n if (imageAbsent) {\n const diameter = this.options.size * 2;\n this.width = diameter;\n this.height = diameter;\n this.radius = 0.5 * this.width;\n return;\n }\n\n // At this point, an image is present, i.e. this.imageObj is valid.\n if (this.needsRefresh(selected, hover)) {\n this._resizeImage();\n }\n }\n\n /**\n *\n * @param {CanvasRenderingContext2D} ctx\n * @param {number} x width\n * @param {number} y height\n * @param {boolean} selected\n * @param {boolean} hover\n * @param {ArrowOptions} values\n */\n draw(ctx, x, y, selected, hover, values) {\n this.switchImages(selected);\n this.resize();\n\n let labelX = x,\n labelY = y;\n\n if (this.options.shapeProperties.coordinateOrigin === \"top-left\") {\n this.left = x;\n this.top = y;\n labelX += this.width / 2;\n labelY += this.height / 2;\n } else {\n this.left = x - this.width / 2;\n this.top = y - this.height / 2;\n }\n\n // draw the background circle. IMPORTANT: the stroke in this method is used by the clip method below.\n this._drawRawCircle(ctx, labelX, labelY, values);\n\n // now we draw in the circle, we save so we can revert the clip operation after drawing.\n ctx.save();\n // clip is used to use the stroke in drawRawCircle as an area that we can draw in.\n ctx.clip();\n // draw the image\n this._drawImageAtPosition(ctx, values);\n // restore so we can again draw on the full canvas\n ctx.restore();\n\n this._drawImageLabel(ctx, labelX, labelY, selected, hover);\n\n this.updateBoundingBox(x, y);\n }\n\n // TODO: compare with Circle.updateBoundingBox(), consolidate? More stuff is happening here\n /**\n *\n * @param {number} x width\n * @param {number} y height\n */\n updateBoundingBox(x, y) {\n if (this.options.shapeProperties.coordinateOrigin === \"top-left\") {\n this.boundingBox.top = y;\n this.boundingBox.left = x;\n this.boundingBox.right = x + this.options.size * 2;\n this.boundingBox.bottom = y + this.options.size * 2;\n } else {\n this.boundingBox.top = y - this.options.size;\n this.boundingBox.left = x - this.options.size;\n this.boundingBox.right = x + this.options.size;\n this.boundingBox.bottom = y + this.options.size;\n }\n\n // TODO: compare with Image.updateBoundingBox(), consolidate?\n this.boundingBox.left = Math.min(\n this.boundingBox.left,\n this.labelModule.size.left\n );\n this.boundingBox.right = Math.max(\n this.boundingBox.right,\n this.labelModule.size.left + this.labelModule.size.width\n );\n this.boundingBox.bottom = Math.max(\n this.boundingBox.bottom,\n this.boundingBox.bottom + this.labelOffset\n );\n }\n\n /**\n *\n * @param {CanvasRenderingContext2D} ctx\n * @returns {number}\n */\n distanceToBorder(ctx) {\n if (ctx) {\n this.resize(ctx);\n }\n return this.width * 0.5;\n }\n}\n\nexport default CircularImage;\n","import NodeBase from \"../util/NodeBase\";\nimport { getShape } from \"./shapes\";\n\n/**\n * Base class for constructing Node/Cluster Shapes.\n *\n * @augments NodeBase\n */\nclass ShapeBase extends NodeBase {\n /**\n * @param {object} options\n * @param {object} body\n * @param {Label} labelModule\n */\n constructor(options, body, labelModule) {\n super(options, body, labelModule);\n }\n\n /**\n *\n * @param {CanvasRenderingContext2D} ctx\n * @param {boolean} [selected]\n * @param {boolean} [hover]\n * @param {object} [values={size: this.options.size}]\n */\n resize(\n ctx,\n selected = this.selected,\n hover = this.hover,\n values = { size: this.options.size }\n ) {\n if (this.needsRefresh(selected, hover)) {\n this.labelModule.getTextSize(ctx, selected, hover);\n const size = 2 * values.size;\n this.width = this.customSizeWidth ?? size;\n this.height = this.customSizeHeight ?? size;\n this.radius = 0.5 * this.width;\n }\n }\n\n /**\n *\n * @param {CanvasRenderingContext2D} ctx\n * @param {string} shape\n * @param {number} sizeMultiplier - Unused! TODO: Remove next major release\n * @param {number} x\n * @param {number} y\n * @param {boolean} selected\n * @param {boolean} hover\n * @param {ArrowOptions} values\n * @private\n *\n * @returns {object} Callbacks to draw later on higher layers.\n */\n _drawShape(ctx, shape, sizeMultiplier, x, y, selected, hover, values) {\n this.resize(ctx, selected, hover, values);\n this.left = x - this.width / 2;\n this.top = y - this.height / 2;\n\n this.initContextForDraw(ctx, values);\n getShape(shape)(ctx, x, y, values.size);\n this.performFill(ctx, values);\n\n if (this.options.icon !== undefined) {\n if (this.options.icon.code !== undefined) {\n ctx.font =\n (selected ? \"bold \" : \"\") +\n this.height / 2 +\n \"px \" +\n (this.options.icon.face || \"FontAwesome\");\n ctx.fillStyle = this.options.icon.color || \"black\";\n ctx.textAlign = \"center\";\n ctx.textBaseline = \"middle\";\n ctx.fillText(this.options.icon.code, x, y);\n }\n }\n\n return {\n drawExternalLabel: () => {\n if (this.options.label !== undefined) {\n // Need to call following here in order to ensure value for\n // `this.labelModule.size.height`.\n this.labelModule.calculateLabelSize(\n ctx,\n selected,\n hover,\n x,\n y,\n \"hanging\"\n );\n const yLabel =\n y + 0.5 * this.height + 0.5 * this.labelModule.size.height;\n this.labelModule.draw(ctx, x, yLabel, selected, hover, \"hanging\");\n }\n\n this.updateBoundingBox(x, y);\n },\n };\n }\n\n /**\n *\n * @param {number} x\n * @param {number} y\n */\n updateBoundingBox(x, y) {\n this.boundingBox.top = y - this.options.size;\n this.boundingBox.left = x - this.options.size;\n this.boundingBox.right = x + this.options.size;\n this.boundingBox.bottom = y + this.options.size;\n\n if (this.options.label !== undefined && this.labelModule.size.width > 0) {\n this.boundingBox.left = Math.min(\n this.boundingBox.left,\n this.labelModule.size.left\n );\n this.boundingBox.right = Math.max(\n this.boundingBox.right,\n this.labelModule.size.left + this.labelModule.size.width\n );\n this.boundingBox.bottom = Math.max(\n this.boundingBox.bottom,\n this.boundingBox.bottom + this.labelModule.size.height\n );\n }\n }\n}\n\nexport default ShapeBase;\n","\"use strict\";\n\nimport ShapeBase from \"../util/ShapeBase\";\n\n/**\n * A CustomShape Node/Cluster shape.\n *\n * @augments ShapeBase\n */\nclass CustomShape extends ShapeBase {\n /**\n * @param {object} options\n * @param {object} body\n * @param {Label} labelModule\n * @param {Function} ctxRenderer\n \n */\n constructor(options, body, labelModule, ctxRenderer) {\n super(options, body, labelModule, ctxRenderer);\n this.ctxRenderer = ctxRenderer;\n }\n\n /**\n *\n * @param {CanvasRenderingContext2D} ctx\n * @param {number} x width\n * @param {number} y height\n * @param {boolean} selected\n * @param {boolean} hover\n * @param {ArrowOptions} values\n *\n * @returns {object} Callbacks to draw later on different layers.\n */\n draw(ctx, x, y, selected, hover, values) {\n this.resize(ctx, selected, hover, values);\n this.left = x - this.width / 2;\n this.top = y - this.height / 2;\n\n // Guard right away because someone may just draw in the function itself.\n ctx.save();\n const drawLater = this.ctxRenderer({\n ctx,\n id: this.options.id,\n x,\n y,\n state: { selected, hover },\n style: { ...values },\n label: this.options.label,\n });\n // Render the node shape bellow arrows.\n if (drawLater.drawNode != null) {\n drawLater.drawNode();\n }\n ctx.restore();\n\n if (drawLater.drawExternalLabel) {\n // Guard the external label (above arrows) drawing function.\n const drawExternalLabel = drawLater.drawExternalLabel;\n drawLater.drawExternalLabel = () => {\n ctx.save();\n drawExternalLabel();\n ctx.restore();\n };\n }\n\n if (drawLater.nodeDimensions) {\n this.customSizeWidth = drawLater.nodeDimensions.width;\n this.customSizeHeight = drawLater.nodeDimensions.height;\n }\n\n return drawLater;\n }\n\n /**\n *\n * @param {CanvasRenderingContext2D} ctx\n * @param {number} angle\n * @returns {number}\n */\n distanceToBorder(ctx, angle) {\n return this._distanceToBorder(ctx, angle);\n }\n}\n\nexport default CustomShape;\n","\"use strict\";\n\nimport NodeBase from \"../util/NodeBase\";\nimport { drawDatabase } from \"../util/shapes\";\n\n/**\n * A Database Node/Cluster shape.\n *\n * @augments NodeBase\n */\nclass Database extends NodeBase {\n /**\n * @param {object} options\n * @param {object} body\n * @param {Label} labelModule\n */\n constructor(options, body, labelModule) {\n super(options, body, labelModule);\n this._setMargins(labelModule);\n }\n\n /**\n *\n * @param {CanvasRenderingContext2D} ctx\n * @param {boolean} selected\n * @param {boolean} hover\n */\n resize(ctx, selected, hover) {\n if (this.needsRefresh(selected, hover)) {\n const dimensions = this.getDimensionsFromLabel(ctx, selected, hover);\n const size = dimensions.width + this.margin.right + this.margin.left;\n\n this.width = size;\n this.height = size;\n this.radius = this.width / 2;\n }\n }\n\n /**\n *\n * @param {CanvasRenderingContext2D} ctx\n * @param {number} x width\n * @param {number} y height\n * @param {boolean} selected\n * @param {boolean} hover\n * @param {ArrowOptions} values\n */\n draw(ctx, x, y, selected, hover, values) {\n this.resize(ctx, selected, hover);\n this.left = x - this.width / 2;\n this.top = y - this.height / 2;\n\n this.initContextForDraw(ctx, values);\n drawDatabase(\n ctx,\n x - this.width / 2,\n y - this.height / 2,\n this.width,\n this.height\n );\n this.performFill(ctx, values);\n\n this.updateBoundingBox(x, y, ctx, selected, hover);\n this.labelModule.draw(\n ctx,\n this.left + this.textSize.width / 2 + this.margin.left,\n this.top + this.textSize.height / 2 + this.margin.top,\n selected,\n hover\n );\n }\n /**\n *\n * @param {CanvasRenderingContext2D} ctx\n * @param {number} angle\n * @returns {number}\n */\n distanceToBorder(ctx, angle) {\n return this._distanceToBorder(ctx, angle);\n }\n}\n\nexport default Database;\n","\"use strict\";\n\nimport ShapeBase from \"../util/ShapeBase\";\n\n/**\n * A Diamond Node/Cluster shape.\n *\n * @augments ShapeBase\n */\nclass Diamond extends ShapeBase {\n /**\n * @param {object} options\n * @param {object} body\n * @param {Label} labelModule\n */\n constructor(options, body, labelModule) {\n super(options, body, labelModule);\n }\n\n /**\n *\n * @param {CanvasRenderingContext2D} ctx\n * @param {number} x width\n * @param {number} y height\n * @param {boolean} selected\n * @param {boolean} hover\n * @param {ArrowOptions} values\n *\n * @returns {object} Callbacks to draw later on higher layers.\n */\n draw(ctx, x, y, selected, hover, values) {\n return this._drawShape(ctx, \"diamond\", 4, x, y, selected, hover, values);\n }\n\n /**\n *\n * @param {CanvasRenderingContext2D} ctx\n * @param {number} angle\n * @returns {number}\n */\n distanceToBorder(ctx, angle) {\n return this._distanceToBorder(ctx, angle);\n }\n}\n\nexport default Diamond;\n","\"use strict\";\n\nimport ShapeBase from \"../util/ShapeBase\";\n\n/**\n * A Dot Node/Cluster shape.\n *\n * @augments ShapeBase\n */\nclass Dot extends ShapeBase {\n /**\n * @param {object} options\n * @param {object} body\n * @param {Label} labelModule\n */\n constructor(options, body, labelModule) {\n super(options, body, labelModule);\n }\n\n /**\n *\n * @param {CanvasRenderingContext2D} ctx\n * @param {number} x width\n * @param {number} y height\n * @param {boolean} selected\n * @param {boolean} hover\n * @param {ArrowOptions} values\n *\n * @returns {object} Callbacks to draw later on higher layers.\n */\n draw(ctx, x, y, selected, hover, values) {\n return this._drawShape(ctx, \"circle\", 2, x, y, selected, hover, values);\n }\n\n /**\n *\n * @param {CanvasRenderingContext2D} ctx\n * @returns {number}\n */\n distanceToBorder(ctx) {\n if (ctx) {\n this.resize(ctx);\n }\n return this.options.size;\n }\n}\n\nexport default Dot;\n","\"use strict\";\n\nimport NodeBase from \"../util/NodeBase\";\nimport { drawEllipse } from \"../util/shapes\";\n\n/**\n * Am Ellipse Node/Cluster shape.\n *\n * @augments NodeBase\n */\nclass Ellipse extends NodeBase {\n /**\n * @param {object} options\n * @param {object} body\n * @param {Label} labelModule\n */\n constructor(options, body, labelModule) {\n super(options, body, labelModule);\n }\n\n /**\n *\n * @param {CanvasRenderingContext2D} ctx\n * @param {boolean} [selected]\n * @param {boolean} [hover]\n */\n resize(ctx, selected = this.selected, hover = this.hover) {\n if (this.needsRefresh(selected, hover)) {\n const dimensions = this.getDimensionsFromLabel(ctx, selected, hover);\n\n this.height = dimensions.height * 2;\n this.width = dimensions.width + dimensions.height;\n this.radius = 0.5 * this.width;\n }\n }\n\n /**\n *\n * @param {CanvasRenderingContext2D} ctx\n * @param {number} x width\n * @param {number} y height\n * @param {boolean} selected\n * @param {boolean} hover\n * @param {ArrowOptions} values\n */\n draw(ctx, x, y, selected, hover, values) {\n this.resize(ctx, selected, hover);\n this.left = x - this.width * 0.5;\n this.top = y - this.height * 0.5;\n\n this.initContextForDraw(ctx, values);\n drawEllipse(ctx, this.left, this.top, this.width, this.height);\n this.performFill(ctx, values);\n\n this.updateBoundingBox(x, y, ctx, selected, hover);\n this.labelModule.draw(ctx, x, y, selected, hover);\n }\n\n /**\n *\n * @param {CanvasRenderingContext2D} ctx\n * @param {number} angle\n * @returns {number}\n */\n distanceToBorder(ctx, angle) {\n if (ctx) {\n this.resize(ctx);\n }\n const a = this.width * 0.5;\n const b = this.height * 0.5;\n const w = Math.sin(angle) * a;\n const h = Math.cos(angle) * b;\n return (a * b) / Math.sqrt(w * w + h * h);\n }\n}\n\nexport default Ellipse;\n","\"use strict\";\n\nimport NodeBase from \"../util/NodeBase\";\n\n/**\n * An icon replacement for the default Node shape.\n *\n * @augments NodeBase\n */\nclass Icon extends NodeBase {\n /**\n * @param {object} options\n * @param {object} body\n * @param {Label} labelModule\n */\n constructor(options, body, labelModule) {\n super(options, body, labelModule);\n this._setMargins(labelModule);\n }\n\n /**\n *\n * @param {CanvasRenderingContext2D} ctx - Unused.\n * @param {boolean} [selected]\n * @param {boolean} [hover]\n */\n resize(ctx, selected, hover) {\n if (this.needsRefresh(selected, hover)) {\n this.iconSize = {\n width: Number(this.options.icon.size),\n height: Number(this.options.icon.size),\n };\n this.width = this.iconSize.width + this.margin.right + this.margin.left;\n this.height = this.iconSize.height + this.margin.top + this.margin.bottom;\n this.radius = 0.5 * this.width;\n }\n }\n\n /**\n *\n * @param {CanvasRenderingContext2D} ctx\n * @param {number} x width\n * @param {number} y height\n * @param {boolean} selected\n * @param {boolean} hover\n * @param {ArrowOptions} values\n *\n * @returns {object} Callbacks to draw later on higher layers.\n */\n draw(ctx, x, y, selected, hover, values) {\n this.resize(ctx, selected, hover);\n this.options.icon.size = this.options.icon.size || 50;\n\n this.left = x - this.width / 2;\n this.top = y - this.height / 2;\n this._icon(ctx, x, y, selected, hover, values);\n\n return {\n drawExternalLabel: () => {\n if (this.options.label !== undefined) {\n const iconTextSpacing = 5;\n this.labelModule.draw(\n ctx,\n this.left + this.iconSize.width / 2 + this.margin.left,\n y + this.height / 2 + iconTextSpacing,\n selected\n );\n }\n\n this.updateBoundingBox(x, y);\n },\n };\n }\n\n /**\n *\n * @param {number} x\n * @param {number} y\n */\n updateBoundingBox(x, y) {\n this.boundingBox.top = y - this.options.icon.size * 0.5;\n this.boundingBox.left = x - this.options.icon.size * 0.5;\n this.boundingBox.right = x + this.options.icon.size * 0.5;\n this.boundingBox.bottom = y + this.options.icon.size * 0.5;\n\n if (this.options.label !== undefined && this.labelModule.size.width > 0) {\n const iconTextSpacing = 5;\n this.boundingBox.left = Math.min(\n this.boundingBox.left,\n this.labelModule.size.left\n );\n this.boundingBox.right = Math.max(\n this.boundingBox.right,\n this.labelModule.size.left + this.labelModule.size.width\n );\n this.boundingBox.bottom = Math.max(\n this.boundingBox.bottom,\n this.boundingBox.bottom + this.labelModule.size.height + iconTextSpacing\n );\n }\n }\n\n /**\n *\n * @param {CanvasRenderingContext2D} ctx\n * @param {number} x width\n * @param {number} y height\n * @param {boolean} selected\n * @param {boolean} hover - Unused\n * @param {ArrowOptions} values\n */\n _icon(ctx, x, y, selected, hover, values) {\n const iconSize = Number(this.options.icon.size);\n\n if (this.options.icon.code !== undefined) {\n ctx.font = [\n this.options.icon.weight != null\n ? this.options.icon.weight\n : selected\n ? \"bold\"\n : \"\",\n // If the weight is forced (for example to make Font Awesome 5 work\n // properly) substitute slightly bigger size for bold font face.\n (this.options.icon.weight != null && selected ? 5 : 0) +\n iconSize +\n \"px\",\n this.options.icon.face,\n ].join(\" \");\n\n // draw icon\n ctx.fillStyle = this.options.icon.color || \"black\";\n ctx.textAlign = \"center\";\n ctx.textBaseline = \"middle\";\n\n // draw shadow if enabled\n this.enableShadow(ctx, values);\n ctx.fillText(this.options.icon.code, x, y);\n\n // disable shadows for other elements.\n this.disableShadow(ctx, values);\n } else {\n console.error(\n \"When using the icon shape, you need to define the code in the icon options object. This can be done per node or globally.\"\n );\n }\n }\n\n /**\n *\n * @param {CanvasRenderingContext2D} ctx\n * @param {number} angle\n * @returns {number}\n */\n distanceToBorder(ctx, angle) {\n return this._distanceToBorder(ctx, angle);\n }\n}\n\nexport default Icon;\n","\"use strict\";\n\nimport CircleImageBase from \"../util/CircleImageBase\";\nimport { overrideOpacity } from \"vis-util/esnext\";\n\n/**\n * An image-based replacement for the default Node shape.\n *\n * @augments CircleImageBase\n */\nclass Image extends CircleImageBase {\n /**\n * @param {object} options\n * @param {object} body\n * @param {Label} labelModule\n * @param {Image} imageObj\n * @param {Image} imageObjAlt\n */\n constructor(options, body, labelModule, imageObj, imageObjAlt) {\n super(options, body, labelModule);\n\n this.setImages(imageObj, imageObjAlt);\n }\n\n /**\n *\n * @param {CanvasRenderingContext2D} ctx - Unused.\n * @param {boolean} [selected]\n * @param {boolean} [hover]\n */\n resize(ctx, selected = this.selected, hover = this.hover) {\n const imageAbsent =\n this.imageObj.src === undefined ||\n this.imageObj.width === undefined ||\n this.imageObj.height === undefined;\n\n if (imageAbsent) {\n const side = this.options.size * 2;\n this.width = side;\n this.height = side;\n return;\n }\n\n if (this.needsRefresh(selected, hover)) {\n this._resizeImage();\n }\n }\n\n /**\n *\n * @param {CanvasRenderingContext2D} ctx\n * @param {number} x width\n * @param {number} y height\n * @param {boolean} selected\n * @param {boolean} hover\n * @param {ArrowOptions} values\n */\n draw(ctx, x, y, selected, hover, values) {\n ctx.save();\n this.switchImages(selected);\n this.resize();\n\n let labelX = x,\n labelY = y;\n\n if (this.options.shapeProperties.coordinateOrigin === \"top-left\") {\n this.left = x;\n this.top = y;\n labelX += this.width / 2;\n labelY += this.height / 2;\n } else {\n this.left = x - this.width / 2;\n this.top = y - this.height / 2;\n }\n\n if (this.options.shapeProperties.useBorderWithImage === true) {\n const neutralborderWidth = this.options.borderWidth;\n const selectionLineWidth =\n this.options.borderWidthSelected || 2 * this.options.borderWidth;\n const borderWidth =\n (selected ? selectionLineWidth : neutralborderWidth) /\n this.body.view.scale;\n ctx.lineWidth = Math.min(this.width, borderWidth);\n\n ctx.beginPath();\n let strokeStyle = selected\n ? this.options.color.highlight.border\n : hover\n ? this.options.color.hover.border\n : this.options.color.border;\n let fillStyle = selected\n ? this.options.color.highlight.background\n : hover\n ? this.options.color.hover.background\n : this.options.color.background;\n\n if (values.opacity !== undefined) {\n strokeStyle = overrideOpacity(strokeStyle, values.opacity);\n fillStyle = overrideOpacity(fillStyle, values.opacity);\n }\n // setup the line properties.\n ctx.strokeStyle = strokeStyle;\n\n // set a fillstyle\n ctx.fillStyle = fillStyle;\n\n // draw a rectangle to form the border around. This rectangle is filled so the opacity of a picture (in future vis releases?) can be used to tint the image\n ctx.rect(\n this.left - 0.5 * ctx.lineWidth,\n this.top - 0.5 * ctx.lineWidth,\n this.width + ctx.lineWidth,\n this.height + ctx.lineWidth\n );\n ctx.fill();\n\n this.performStroke(ctx, values);\n\n ctx.closePath();\n }\n\n this._drawImageAtPosition(ctx, values);\n\n this._drawImageLabel(ctx, labelX, labelY, selected, hover);\n\n this.updateBoundingBox(x, y);\n ctx.restore();\n }\n\n /**\n *\n * @param {number} x\n * @param {number} y\n */\n updateBoundingBox(x, y) {\n this.resize();\n\n if (this.options.shapeProperties.coordinateOrigin === \"top-left\") {\n this.left = x;\n this.top = y;\n } else {\n this.left = x - this.width / 2;\n this.top = y - this.height / 2;\n }\n\n this.boundingBox.left = this.left;\n this.boundingBox.top = this.top;\n this.boundingBox.bottom = this.top + this.height;\n this.boundingBox.right = this.left + this.width;\n\n if (this.options.label !== undefined && this.labelModule.size.width > 0) {\n this.boundingBox.left = Math.min(\n this.boundingBox.left,\n this.labelModule.size.left\n );\n this.boundingBox.right = Math.max(\n this.boundingBox.right,\n this.labelModule.size.left + this.labelModule.size.width\n );\n this.boundingBox.bottom = Math.max(\n this.boundingBox.bottom,\n this.boundingBox.bottom + this.labelOffset\n );\n }\n }\n\n /**\n *\n * @param {CanvasRenderingContext2D} ctx\n * @param {number} angle\n * @returns {number}\n */\n distanceToBorder(ctx, angle) {\n return this._distanceToBorder(ctx, angle);\n }\n}\n\nexport default Image;\n","\"use strict\";\n\nimport ShapeBase from \"../util/ShapeBase\";\n\n/**\n * A Square Node/Cluster shape.\n *\n * @augments ShapeBase\n */\nclass Square extends ShapeBase {\n /**\n * @param {object} options\n * @param {object} body\n * @param {Label} labelModule\n */\n constructor(options, body, labelModule) {\n super(options, body, labelModule);\n }\n\n /**\n *\n * @param {CanvasRenderingContext2D} ctx\n * @param {number} x width\n * @param {number} y height\n * @param {boolean} selected\n * @param {boolean} hover\n * @param {ArrowOptions} values\n *\n * @returns {object} Callbacks to draw later on higher layers.\n */\n draw(ctx, x, y, selected, hover, values) {\n return this._drawShape(ctx, \"square\", 2, x, y, selected, hover, values);\n }\n\n /**\n *\n * @param {CanvasRenderingContext2D} ctx\n * @param {number} angle\n * @returns {number}\n */\n distanceToBorder(ctx, angle) {\n return this._distanceToBorder(ctx, angle);\n }\n}\n\nexport default Square;\n","\"use strict\";\n\nimport ShapeBase from \"../util/ShapeBase\";\n\n/**\n * A Hexagon Node/Cluster shape.\n *\n * @augments ShapeBase\n */\nclass Hexagon extends ShapeBase {\n /**\n * @param {object} options\n * @param {object} body\n * @param {Label} labelModule\n */\n constructor(options, body, labelModule) {\n super(options, body, labelModule);\n }\n\n /**\n *\n * @param {CanvasRenderingContext2D} ctx\n * @param {number} x width\n * @param {number} y height\n * @param {boolean} selected\n * @param {boolean} hover\n * @param {ArrowOptions} values\n *\n * @returns {object} Callbacks to draw later on higher layers.\n */\n draw(ctx, x, y, selected, hover, values) {\n return this._drawShape(ctx, \"hexagon\", 4, x, y, selected, hover, values);\n }\n\n /**\n *\n * @param {CanvasRenderingContext2D} ctx\n * @param {number} angle\n * @returns {number}\n */\n distanceToBorder(ctx, angle) {\n return this._distanceToBorder(ctx, angle);\n }\n}\n\nexport default Hexagon;\n","\"use strict\";\n\nimport ShapeBase from \"../util/ShapeBase\";\n\n/**\n * A Star Node/Cluster shape.\n *\n * @augments ShapeBase\n */\nclass Star extends ShapeBase {\n /**\n * @param {object} options\n * @param {object} body\n * @param {Label} labelModule\n */\n constructor(options, body, labelModule) {\n super(options, body, labelModule);\n }\n\n /**\n *\n * @param {CanvasRenderingContext2D} ctx\n * @param {number} x width\n * @param {number} y height\n * @param {boolean} selected\n * @param {boolean} hover\n * @param {ArrowOptions} values\n *\n * @returns {object} Callbacks to draw later on higher layers.\n */\n draw(ctx, x, y, selected, hover, values) {\n return this._drawShape(ctx, \"star\", 4, x, y, selected, hover, values);\n }\n\n /**\n *\n * @param {CanvasRenderingContext2D} ctx\n * @param {number} angle\n * @returns {number}\n */\n distanceToBorder(ctx, angle) {\n return this._distanceToBorder(ctx, angle);\n }\n}\n\nexport default Star;\n","\"use strict\";\n\nimport NodeBase from \"../util/NodeBase\";\n\n/**\n * A text-based replacement for the default Node shape.\n *\n * @augments NodeBase\n */\nclass Text extends NodeBase {\n /**\n * @param {object} options\n * @param {object} body\n * @param {Label} labelModule\n */\n constructor(options, body, labelModule) {\n super(options, body, labelModule);\n this._setMargins(labelModule);\n }\n\n /**\n *\n * @param {CanvasRenderingContext2D} ctx\n * @param {boolean} selected\n * @param {boolean} hover\n */\n resize(ctx, selected, hover) {\n if (this.needsRefresh(selected, hover)) {\n this.textSize = this.labelModule.getTextSize(ctx, selected, hover);\n this.width = this.textSize.width + this.margin.right + this.margin.left;\n this.height = this.textSize.height + this.margin.top + this.margin.bottom;\n this.radius = 0.5 * this.width;\n }\n }\n\n /**\n *\n * @param {CanvasRenderingContext2D} ctx\n * @param {number} x width\n * @param {number} y height\n * @param {boolean} selected\n * @param {boolean} hover\n * @param {ArrowOptions} values\n */\n draw(ctx, x, y, selected, hover, values) {\n this.resize(ctx, selected, hover);\n this.left = x - this.width / 2;\n this.top = y - this.height / 2;\n\n // draw shadow if enabled\n this.enableShadow(ctx, values);\n this.labelModule.draw(\n ctx,\n this.left + this.textSize.width / 2 + this.margin.left,\n this.top + this.textSize.height / 2 + this.margin.top,\n selected,\n hover\n );\n\n // disable shadows for other elements.\n this.disableShadow(ctx, values);\n\n this.updateBoundingBox(x, y, ctx, selected, hover);\n }\n\n /**\n *\n * @param {CanvasRenderingContext2D} ctx\n * @param {number} angle\n * @returns {number}\n */\n distanceToBorder(ctx, angle) {\n return this._distanceToBorder(ctx, angle);\n }\n}\n\nexport default Text;\n","\"use strict\";\n\nimport ShapeBase from \"../util/ShapeBase\";\n\n/**\n * A Triangle Node/Cluster shape.\n *\n * @augments ShapeBase\n */\nclass Triangle extends ShapeBase {\n /**\n * @param {object} options\n * @param {object} body\n * @param {Label} labelModule\n */\n constructor(options, body, labelModule) {\n super(options, body, labelModule);\n }\n\n /**\n *\n * @param {CanvasRenderingContext2D} ctx\n * @param {number} x\n * @param {number} y\n * @param {boolean} selected\n * @param {boolean} hover\n * @param {ArrowOptions} values\n *\n * @returns {object} Callbacks to draw later on higher layers.\n */\n draw(ctx, x, y, selected, hover, values) {\n return this._drawShape(ctx, \"triangle\", 3, x, y, selected, hover, values);\n }\n\n /**\n *\n * @param {CanvasRenderingContext2D} ctx\n * @param {number} angle\n * @returns {number}\n */\n distanceToBorder(ctx, angle) {\n return this._distanceToBorder(ctx, angle);\n }\n}\n\nexport default Triangle;\n","\"use strict\";\n\nimport ShapeBase from \"../util/ShapeBase\";\n\n/**\n * A downward facing Triangle Node/Cluster shape.\n *\n * @augments ShapeBase\n */\nclass TriangleDown extends ShapeBase {\n /**\n * @param {object} options\n * @param {object} body\n * @param {Label} labelModule\n */\n constructor(options, body, labelModule) {\n super(options, body, labelModule);\n }\n\n /**\n *\n * @param {CanvasRenderingContext2D} ctx\n * @param {number} x\n * @param {number} y\n * @param {boolean} selected\n * @param {boolean} hover\n * @param {ArrowOptions} values\n *\n * @returns {object} Callbacks to draw later on higher layers.\n */\n draw(ctx, x, y, selected, hover, values) {\n return this._drawShape(\n ctx,\n \"triangleDown\",\n 3,\n x,\n y,\n selected,\n hover,\n values\n );\n }\n\n /**\n *\n * @param {CanvasRenderingContext2D} ctx\n * @param {number} angle\n * @returns {number}\n */\n distanceToBorder(ctx, angle) {\n return this._distanceToBorder(ctx, angle);\n }\n}\n\nexport default TriangleDown;\n","import {\n VALIDATOR_PRINT_STYLE,\n bridgeObject,\n fillIfDefined,\n mergeOptions,\n overrideOpacity,\n parseColor,\n selectiveNotDeepExtend,\n} from \"vis-util/esnext\";\n\nimport Label from \"./shared/Label\";\nimport { choosify, pointInRect } from \"./shared/ComponentUtil\";\nimport Box from \"./nodes/shapes/Box\";\nimport Circle from \"./nodes/shapes/Circle\";\nimport CircularImage from \"./nodes/shapes/CircularImage\";\nimport CustomShape from \"./nodes/shapes/CustomShape\";\nimport Database from \"./nodes/shapes/Database\";\nimport Diamond from \"./nodes/shapes/Diamond\";\nimport Dot from \"./nodes/shapes/Dot\";\nimport Ellipse from \"./nodes/shapes/Ellipse\";\nimport Icon from \"./nodes/shapes/Icon\";\nimport Image from \"./nodes/shapes/Image\";\nimport Square from \"./nodes/shapes/Square\";\nimport Hexagon from \"./nodes/shapes/Hexagon\";\nimport Star from \"./nodes/shapes/Star\";\nimport Text from \"./nodes/shapes/Text\";\nimport Triangle from \"./nodes/shapes/Triangle\";\nimport TriangleDown from \"./nodes/shapes/TriangleDown\";\n\n/**\n * A node. A node can be connected to other nodes via one or multiple edges.\n */\nclass Node {\n /**\n *\n * @param {object} options An object containing options for the node. All\n * options are optional, except for the id.\n * {number} id Id of the node. Required\n * {string} label Text label for the node\n * {number} x Horizontal position of the node\n * {number} y Vertical position of the node\n * {string} shape Node shape\n * {string} image An image url\n * {string} title A title text, can be HTML\n * {anytype} group A group name or number\n *\n * @param {object} body Shared state of current network instance\n * @param {Network.Images} imagelist A list with images. Only needed when the node has an image\n * @param {Groups} grouplist A list with groups. Needed for retrieving group options\n * @param {object} globalOptions Current global node options; these serve as defaults for the node instance\n * @param {object} defaultOptions Global default options for nodes; note that this is also the prototype\n * for parameter `globalOptions`.\n */\n constructor(\n options,\n body,\n imagelist,\n grouplist,\n globalOptions,\n defaultOptions\n ) {\n this.options = bridgeObject(globalOptions);\n this.globalOptions = globalOptions;\n this.defaultOptions = defaultOptions;\n this.body = body;\n\n this.edges = []; // all edges connected to this node\n\n // set defaults for the options\n this.id = undefined;\n this.imagelist = imagelist;\n this.grouplist = grouplist;\n\n // state options\n this.x = undefined;\n this.y = undefined;\n this.baseSize = this.options.size;\n this.baseFontSize = this.options.font.size;\n this.predefinedPosition = false; // used to check if initial fit should just take the range or approximate\n this.selected = false;\n this.hover = false;\n\n this.labelModule = new Label(\n this.body,\n this.options,\n false /* Not edge label */\n );\n this.setOptions(options);\n }\n\n /**\n * Attach a edge to the node\n *\n * @param {Edge} edge\n */\n attachEdge(edge) {\n if (this.edges.indexOf(edge) === -1) {\n this.edges.push(edge);\n }\n }\n\n /**\n * Detach a edge from the node\n *\n * @param {Edge} edge\n */\n detachEdge(edge) {\n const index = this.edges.indexOf(edge);\n if (index != -1) {\n this.edges.splice(index, 1);\n }\n }\n\n /**\n * Set or overwrite options for the node\n *\n * @param {object} options an object with options\n * @returns {null|boolean}\n */\n setOptions(options) {\n const currentShape = this.options.shape;\n\n if (!options) {\n return; // Note that the return value will be 'undefined'! This is OK.\n }\n\n // Save the color for later.\n // This is necessary in order to prevent local color from being overwritten by group color.\n // TODO: To prevent such workarounds the way options are handled should be rewritten from scratch.\n // This is not the only problem with current options handling.\n if (typeof options.color !== \"undefined\") {\n this._localColor = options.color;\n }\n\n // basic options\n if (options.id !== undefined) {\n this.id = options.id;\n }\n\n if (this.id === undefined) {\n throw new Error(\"Node must have an id\");\n }\n\n Node.checkMass(options, this.id);\n\n // set these options locally\n // clear x and y positions\n if (options.x !== undefined) {\n if (options.x === null) {\n this.x = undefined;\n this.predefinedPosition = false;\n } else {\n this.x = parseInt(options.x);\n this.predefinedPosition = true;\n }\n }\n if (options.y !== undefined) {\n if (options.y === null) {\n this.y = undefined;\n this.predefinedPosition = false;\n } else {\n this.y = parseInt(options.y);\n this.predefinedPosition = true;\n }\n }\n if (options.size !== undefined) {\n this.baseSize = options.size;\n }\n if (options.value !== undefined) {\n options.value = parseFloat(options.value);\n }\n\n // this transforms all shorthands into fully defined options\n Node.parseOptions(\n this.options,\n options,\n true,\n this.globalOptions,\n this.grouplist\n );\n\n const pile = [options, this.options, this.defaultOptions];\n this.chooser = choosify(\"node\", pile);\n\n this._load_images();\n this.updateLabelModule(options);\n\n // Need to set local opacity after `this.updateLabelModule(options);` because `this.updateLabelModule(options);` overrites local opacity with group opacity\n if (options.opacity !== undefined && Node.checkOpacity(options.opacity)) {\n this.options.opacity = options.opacity;\n }\n\n this.updateShape(currentShape);\n\n return options.hidden !== undefined || options.physics !== undefined;\n }\n\n /**\n * Load the images from the options, for the nodes that need them.\n *\n * Images are always loaded, even if they are not used in the current shape.\n * The user may switch to an image shape later on.\n *\n * @private\n */\n _load_images() {\n if (\n this.options.shape === \"circularImage\" ||\n this.options.shape === \"image\"\n ) {\n if (this.options.image === undefined) {\n throw new Error(\n \"Option image must be defined for node type '\" +\n this.options.shape +\n \"'\"\n );\n }\n }\n\n if (this.options.image === undefined) {\n return;\n }\n\n if (this.imagelist === undefined) {\n throw new Error(\"Internal Error: No images provided\");\n }\n\n if (typeof this.options.image === \"string\") {\n this.imageObj = this.imagelist.load(\n this.options.image,\n this.options.brokenImage,\n this.id\n );\n } else {\n if (this.options.image.unselected === undefined) {\n throw new Error(\"No unselected image provided\");\n }\n\n this.imageObj = this.imagelist.load(\n this.options.image.unselected,\n this.options.brokenImage,\n this.id\n );\n\n if (this.options.image.selected !== undefined) {\n this.imageObjAlt = this.imagelist.load(\n this.options.image.selected,\n this.options.brokenImage,\n this.id\n );\n } else {\n this.imageObjAlt = undefined;\n }\n }\n }\n\n /**\n * Check that opacity is only between 0 and 1\n *\n * @param {number} opacity\n * @returns {boolean}\n */\n static checkOpacity(opacity) {\n return 0 <= opacity && opacity <= 1;\n }\n\n /**\n * Check that origin is 'center' or 'top-left'\n *\n * @param {string} origin\n * @returns {boolean}\n */\n static checkCoordinateOrigin(origin) {\n return origin === undefined || origin === \"center\" || origin === \"top-left\";\n }\n\n /**\n * Copy group option values into the node options.\n *\n * The group options override the global node options, so the copy of group options\n * must happen *after* the global node options have been set.\n *\n * This method must also be called also if the global node options have changed and the group options did not.\n *\n * @param {object} parentOptions\n * @param {object} newOptions new values for the options, currently only passed in for check\n * @param {object} groupList\n */\n static updateGroupOptions(parentOptions, newOptions, groupList) {\n if (groupList === undefined) return; // No groups, nothing to do\n\n const group = parentOptions.group;\n\n // paranoia: the selected group is already merged into node options, check.\n if (\n newOptions !== undefined &&\n newOptions.group !== undefined &&\n group !== newOptions.group\n ) {\n throw new Error(\n \"updateGroupOptions: group values in options don't match.\"\n );\n }\n\n const hasGroup =\n typeof group === \"number\" || (typeof group === \"string\" && group != \"\");\n if (!hasGroup) return; // current node has no group, no need to merge\n\n const groupObj = groupList.get(group);\n\n if (groupObj.opacity !== undefined && newOptions.opacity === undefined) {\n if (!Node.checkOpacity(groupObj.opacity)) {\n console.error(\n \"Invalid option for node opacity. Value must be between 0 and 1, found: \" +\n groupObj.opacity\n );\n groupObj.opacity = undefined;\n }\n }\n\n // Skip any new option to avoid them being overridden by the group options.\n const skipProperties = Object.getOwnPropertyNames(newOptions).filter(\n (p) => newOptions[p] != null\n );\n // Always skip merging group font options into parent; these are required to be distinct for labels\n skipProperties.push(\"font\");\n selectiveNotDeepExtend(skipProperties, parentOptions, groupObj);\n\n // the color object needs to be completely defined.\n // Since groups can partially overwrite the colors, we parse it again, just in case.\n parentOptions.color = parseColor(parentOptions.color);\n }\n\n /**\n * This process all possible shorthands in the new options and makes sure that the parentOptions are fully defined.\n * Static so it can also be used by the handler.\n *\n * @param {object} parentOptions\n * @param {object} newOptions\n * @param {boolean} [allowDeletion=false]\n * @param {object} [globalOptions={}]\n * @param {object} [groupList]\n * @static\n */\n static parseOptions(\n parentOptions,\n newOptions,\n allowDeletion = false,\n globalOptions = {},\n groupList\n ) {\n const fields = [\"color\", \"fixed\", \"shadow\"];\n selectiveNotDeepExtend(fields, parentOptions, newOptions, allowDeletion);\n\n Node.checkMass(newOptions);\n\n if (parentOptions.opacity !== undefined) {\n if (!Node.checkOpacity(parentOptions.opacity)) {\n console.error(\n \"Invalid option for node opacity. Value must be between 0 and 1, found: \" +\n parentOptions.opacity\n );\n parentOptions.opacity = undefined;\n }\n }\n\n if (newOptions.opacity !== undefined) {\n if (!Node.checkOpacity(newOptions.opacity)) {\n console.error(\n \"Invalid option for node opacity. Value must be between 0 and 1, found: \" +\n newOptions.opacity\n );\n newOptions.opacity = undefined;\n }\n }\n\n if (\n newOptions.shapeProperties &&\n !Node.checkCoordinateOrigin(newOptions.shapeProperties.coordinateOrigin)\n ) {\n console.error(\n \"Invalid option for node coordinateOrigin, found: \" +\n newOptions.shapeProperties.coordinateOrigin\n );\n }\n\n // merge the shadow options into the parent.\n mergeOptions(parentOptions, newOptions, \"shadow\", globalOptions);\n\n // individual shape newOptions\n if (newOptions.color !== undefined && newOptions.color !== null) {\n const parsedColor = parseColor(newOptions.color);\n fillIfDefined(parentOptions.color, parsedColor);\n } else if (allowDeletion === true && newOptions.color === null) {\n parentOptions.color = bridgeObject(globalOptions.color); // set the object back to the global options\n }\n\n // handle the fixed options\n if (newOptions.fixed !== undefined && newOptions.fixed !== null) {\n if (typeof newOptions.fixed === \"boolean\") {\n parentOptions.fixed.x = newOptions.fixed;\n parentOptions.fixed.y = newOptions.fixed;\n } else {\n if (\n newOptions.fixed.x !== undefined &&\n typeof newOptions.fixed.x === \"boolean\"\n ) {\n parentOptions.fixed.x = newOptions.fixed.x;\n }\n if (\n newOptions.fixed.y !== undefined &&\n typeof newOptions.fixed.y === \"boolean\"\n ) {\n parentOptions.fixed.y = newOptions.fixed.y;\n }\n }\n }\n\n if (allowDeletion === true && newOptions.font === null) {\n parentOptions.font = bridgeObject(globalOptions.font); // set the object back to the global options\n }\n\n Node.updateGroupOptions(parentOptions, newOptions, groupList);\n\n // handle the scaling options, specifically the label part\n if (newOptions.scaling !== undefined) {\n mergeOptions(\n parentOptions.scaling,\n newOptions.scaling,\n \"label\",\n globalOptions.scaling\n );\n }\n }\n\n /**\n *\n * @returns {{color: *, borderWidth: *, borderColor: *, size: *, borderDashes: (boolean|Array|allOptions.nodes.shapeProperties.borderDashes|{boolean, array}), borderRadius: (number|allOptions.nodes.shapeProperties.borderRadius|{number}|Array), shadow: *, shadowColor: *, shadowSize: *, shadowX: *, shadowY: *}}\n */\n getFormattingValues() {\n const values = {\n color: this.options.color.background,\n opacity: this.options.opacity,\n borderWidth: this.options.borderWidth,\n borderColor: this.options.color.border,\n size: this.options.size,\n borderDashes: this.options.shapeProperties.borderDashes,\n borderRadius: this.options.shapeProperties.borderRadius,\n shadow: this.options.shadow.enabled,\n shadowColor: this.options.shadow.color,\n shadowSize: this.options.shadow.size,\n shadowX: this.options.shadow.x,\n shadowY: this.options.shadow.y,\n };\n if (this.selected || this.hover) {\n if (this.chooser === true) {\n if (this.selected) {\n if (this.options.borderWidthSelected != null) {\n values.borderWidth = this.options.borderWidthSelected;\n } else {\n values.borderWidth *= 2;\n }\n values.color = this.options.color.highlight.background;\n values.borderColor = this.options.color.highlight.border;\n values.shadow = this.options.shadow.enabled;\n } else if (this.hover) {\n values.color = this.options.color.hover.background;\n values.borderColor = this.options.color.hover.border;\n values.shadow = this.options.shadow.enabled;\n }\n } else if (typeof this.chooser === \"function\") {\n this.chooser(values, this.options.id, this.selected, this.hover);\n if (values.shadow === false) {\n if (\n values.shadowColor !== this.options.shadow.color ||\n values.shadowSize !== this.options.shadow.size ||\n values.shadowX !== this.options.shadow.x ||\n values.shadowY !== this.options.shadow.y\n ) {\n values.shadow = true;\n }\n }\n }\n } else {\n values.shadow = this.options.shadow.enabled;\n }\n if (this.options.opacity !== undefined) {\n const opacity = this.options.opacity;\n values.borderColor = overrideOpacity(values.borderColor, opacity);\n values.color = overrideOpacity(values.color, opacity);\n values.shadowColor = overrideOpacity(values.shadowColor, opacity);\n }\n return values;\n }\n\n /**\n *\n * @param {object} options\n */\n updateLabelModule(options) {\n if (this.options.label === undefined || this.options.label === null) {\n this.options.label = \"\";\n }\n\n Node.updateGroupOptions(\n this.options,\n {\n ...options,\n color: (options && options.color) || this._localColor || undefined,\n },\n this.grouplist\n );\n\n //\n // Note:The prototype chain for this.options is:\n //\n // this.options -> NodesHandler.options -> NodesHandler.defaultOptions\n // (also: this.globalOptions)\n //\n // Note that the prototypes are mentioned explicitly in the pile list below;\n // WE DON'T WANT THE ORDER OF THE PROTOTYPES!!!! At least, not for font handling of labels.\n // This is a good indication that the prototype usage of options is deficient.\n //\n const currentGroup = this.grouplist.get(this.options.group, false);\n const pile = [\n options, // new options\n this.options, // current node options, see comment above for prototype\n currentGroup, // group options, if any\n this.globalOptions, // Currently set global node options\n this.defaultOptions, // Default global node options\n ];\n this.labelModule.update(this.options, pile);\n\n if (this.labelModule.baseSize !== undefined) {\n this.baseFontSize = this.labelModule.baseSize;\n }\n }\n\n /**\n *\n * @param {string} currentShape\n */\n updateShape(currentShape) {\n if (currentShape === this.options.shape && this.shape) {\n this.shape.setOptions(this.options, this.imageObj, this.imageObjAlt);\n } else {\n // choose draw method depending on the shape\n switch (this.options.shape) {\n case \"box\":\n this.shape = new Box(this.options, this.body, this.labelModule);\n break;\n case \"circle\":\n this.shape = new Circle(this.options, this.body, this.labelModule);\n break;\n case \"circularImage\":\n this.shape = new CircularImage(\n this.options,\n this.body,\n this.labelModule,\n this.imageObj,\n this.imageObjAlt\n );\n break;\n case \"custom\":\n this.shape = new CustomShape(\n this.options,\n this.body,\n this.labelModule,\n this.options.ctxRenderer\n );\n break;\n case \"database\":\n this.shape = new Database(this.options, this.body, this.labelModule);\n break;\n case \"diamond\":\n this.shape = new Diamond(this.options, this.body, this.labelModule);\n break;\n case \"dot\":\n this.shape = new Dot(this.options, this.body, this.labelModule);\n break;\n case \"ellipse\":\n this.shape = new Ellipse(this.options, this.body, this.labelModule);\n break;\n case \"icon\":\n this.shape = new Icon(this.options, this.body, this.labelModule);\n break;\n case \"image\":\n this.shape = new Image(\n this.options,\n this.body,\n this.labelModule,\n this.imageObj,\n this.imageObjAlt\n );\n break;\n case \"square\":\n this.shape = new Square(this.options, this.body, this.labelModule);\n break;\n case \"hexagon\":\n this.shape = new Hexagon(this.options, this.body, this.labelModule);\n break;\n case \"star\":\n this.shape = new Star(this.options, this.body, this.labelModule);\n break;\n case \"text\":\n this.shape = new Text(this.options, this.body, this.labelModule);\n break;\n case \"triangle\":\n this.shape = new Triangle(this.options, this.body, this.labelModule);\n break;\n case \"triangleDown\":\n this.shape = new TriangleDown(\n this.options,\n this.body,\n this.labelModule\n );\n break;\n default:\n this.shape = new Ellipse(this.options, this.body, this.labelModule);\n break;\n }\n }\n this.needsRefresh();\n }\n\n /**\n * select this node\n */\n select() {\n this.selected = true;\n this.needsRefresh();\n }\n\n /**\n * unselect this node\n */\n unselect() {\n this.selected = false;\n this.needsRefresh();\n }\n\n /**\n * Reset the calculated size of the node, forces it to recalculate its size\n */\n needsRefresh() {\n this.shape.refreshNeeded = true;\n }\n\n /**\n * get the title of this node.\n *\n * @returns {string} title The title of the node, or undefined when no title\n * has been set.\n */\n getTitle() {\n return this.options.title;\n }\n\n /**\n * Calculate the distance to the border of the Node\n *\n * @param {CanvasRenderingContext2D} ctx\n * @param {number} angle Angle in radians\n * @returns {number} distance Distance to the border in pixels\n */\n distanceToBorder(ctx, angle) {\n return this.shape.distanceToBorder(ctx, angle);\n }\n\n /**\n * Check if this node has a fixed x and y position\n *\n * @returns {boolean} true if fixed, false if not\n */\n isFixed() {\n return this.options.fixed.x && this.options.fixed.y;\n }\n\n /**\n * check if this node is selecte\n *\n * @returns {boolean} selected True if node is selected, else false\n */\n isSelected() {\n return this.selected;\n }\n\n /**\n * Retrieve the value of the node. Can be undefined\n *\n * @returns {number} value\n */\n getValue() {\n return this.options.value;\n }\n\n /**\n * Get the current dimensions of the label\n *\n * @returns {rect}\n */\n getLabelSize() {\n return this.labelModule.size();\n }\n\n /**\n * Adjust the value range of the node. The node will adjust it's size\n * based on its value.\n *\n * @param {number} min\n * @param {number} max\n * @param {number} total\n */\n setValueRange(min, max, total) {\n if (this.options.value !== undefined) {\n const scale = this.options.scaling.customScalingFunction(\n min,\n max,\n total,\n this.options.value\n );\n const sizeDiff = this.options.scaling.max - this.options.scaling.min;\n if (this.options.scaling.label.enabled === true) {\n const fontDiff =\n this.options.scaling.label.max - this.options.scaling.label.min;\n this.options.font.size =\n this.options.scaling.label.min + scale * fontDiff;\n }\n this.options.size = this.options.scaling.min + scale * sizeDiff;\n } else {\n this.options.size = this.baseSize;\n this.options.font.size = this.baseFontSize;\n }\n\n this.updateLabelModule();\n }\n\n /**\n * Draw this node in the given canvas\n * The 2d context of a HTML canvas can be retrieved by canvas.getContext(\"2d\");\n *\n * @param {CanvasRenderingContext2D} ctx\n *\n * @returns {object} Callbacks to draw later on higher layers.\n */\n draw(ctx) {\n const values = this.getFormattingValues();\n return (\n this.shape.draw(ctx, this.x, this.y, this.selected, this.hover, values) ||\n {}\n );\n }\n\n /**\n * Update the bounding box of the shape\n *\n * @param {CanvasRenderingContext2D} ctx\n */\n updateBoundingBox(ctx) {\n this.shape.updateBoundingBox(this.x, this.y, ctx);\n }\n\n /**\n * Recalculate the size of this node in the given canvas\n * The 2d context of a HTML canvas can be retrieved by canvas.getContext(\"2d\");\n *\n * @param {CanvasRenderingContext2D} ctx\n */\n resize(ctx) {\n const values = this.getFormattingValues();\n this.shape.resize(ctx, this.selected, this.hover, values);\n }\n\n /**\n * Determine all visual elements of this node instance, in which the given\n * point falls within the bounding shape.\n *\n * @param {point} point\n * @returns {Array.<nodeClickItem|nodeLabelClickItem>} list with the items which are on the point\n */\n getItemsOnPoint(point) {\n const ret = [];\n\n if (this.labelModule.visible()) {\n if (pointInRect(this.labelModule.getSize(), point)) {\n ret.push({ nodeId: this.id, labelId: 0 });\n }\n }\n\n if (pointInRect(this.shape.boundingBox, point)) {\n ret.push({ nodeId: this.id });\n }\n\n return ret;\n }\n\n /**\n * Check if this object is overlapping with the provided object\n *\n * @param {object} obj an object with parameters left, top, right, bottom\n * @returns {boolean} True if location is located on node\n */\n isOverlappingWith(obj) {\n return (\n this.shape.left < obj.right &&\n this.shape.left + this.shape.width > obj.left &&\n this.shape.top < obj.bottom &&\n this.shape.top + this.shape.height > obj.top\n );\n }\n\n /**\n * Check if this object is overlapping with the provided object\n *\n * @param {object} obj an object with parameters left, top, right, bottom\n * @returns {boolean} True if location is located on node\n */\n isBoundingBoxOverlappingWith(obj) {\n return (\n this.shape.boundingBox.left < obj.right &&\n this.shape.boundingBox.right > obj.left &&\n this.shape.boundingBox.top < obj.bottom &&\n this.shape.boundingBox.bottom > obj.top\n );\n }\n\n /**\n * Check valid values for mass\n *\n * The mass may not be negative or zero. If it is, reset to 1\n *\n * @param {object} options\n * @param {Node.id} id\n * @static\n */\n static checkMass(options, id) {\n if (options.mass !== undefined && options.mass <= 0) {\n let strId = \"\";\n if (id !== undefined) {\n strId = \" in node id: \" + id;\n }\n console.error(\n \"%cNegative or zero mass disallowed\" + strId + \", setting mass to 1.\",\n VALIDATOR_PRINT_STYLE\n );\n options.mass = 1;\n }\n }\n}\n\nexport default Node;\n","import { bridgeObject, forEach } from \"vis-util/esnext\";\nimport { DataSet, isDataViewLike } from \"vis-data/esnext\";\nimport Node from \"./components/Node\";\n\n/**\n * Handler for Nodes\n */\nclass NodesHandler {\n /**\n * @param {object} body\n * @param {Images} images\n * @param {Array.<Group>} groups\n * @param {LayoutEngine} layoutEngine\n */\n constructor(body, images, groups, layoutEngine) {\n this.body = body;\n this.images = images;\n this.groups = groups;\n this.layoutEngine = layoutEngine;\n\n // create the node API in the body container\n this.body.functions.createNode = this.create.bind(this);\n\n this.nodesListeners = {\n add: (event, params) => {\n this.add(params.items);\n },\n update: (event, params) => {\n this.update(params.items, params.data, params.oldData);\n },\n remove: (event, params) => {\n this.remove(params.items);\n },\n };\n\n this.defaultOptions = {\n borderWidth: 1,\n borderWidthSelected: undefined,\n brokenImage: undefined,\n color: {\n border: \"#2B7CE9\",\n background: \"#97C2FC\",\n highlight: {\n border: \"#2B7CE9\",\n background: \"#D2E5FF\",\n },\n hover: {\n border: \"#2B7CE9\",\n background: \"#D2E5FF\",\n },\n },\n opacity: undefined, // number between 0 and 1\n fixed: {\n x: false,\n y: false,\n },\n font: {\n color: \"#343434\",\n size: 14, // px\n face: \"arial\",\n background: \"none\",\n strokeWidth: 0, // px\n strokeColor: \"#ffffff\",\n align: \"center\",\n vadjust: 0,\n multi: false,\n bold: {\n mod: \"bold\",\n },\n boldital: {\n mod: \"bold italic\",\n },\n ital: {\n mod: \"italic\",\n },\n mono: {\n mod: \"\",\n size: 15, // px\n face: \"monospace\",\n vadjust: 2,\n },\n },\n group: undefined,\n hidden: false,\n icon: {\n face: \"FontAwesome\", //'FontAwesome',\n code: undefined, //'\\uf007',\n size: 50, //50,\n color: \"#2B7CE9\", //'#aa00ff'\n },\n image: undefined, // --> URL\n imagePadding: {\n // only for image shape\n top: 0,\n right: 0,\n bottom: 0,\n left: 0,\n },\n label: undefined,\n labelHighlightBold: true,\n level: undefined,\n margin: {\n top: 5,\n right: 5,\n bottom: 5,\n left: 5,\n },\n mass: 1,\n physics: true,\n scaling: {\n min: 10,\n max: 30,\n label: {\n enabled: false,\n min: 14,\n max: 30,\n maxVisible: 30,\n drawThreshold: 5,\n },\n customScalingFunction: function (min, max, total, value) {\n if (max === min) {\n return 0.5;\n } else {\n const scale = 1 / (max - min);\n return Math.max(0, (value - min) * scale);\n }\n },\n },\n shadow: {\n enabled: false,\n color: \"rgba(0,0,0,0.5)\",\n size: 10,\n x: 5,\n y: 5,\n },\n shape: \"ellipse\",\n shapeProperties: {\n borderDashes: false, // only for borders\n borderRadius: 6, // only for box shape\n interpolation: true, // only for image and circularImage shapes\n useImageSize: false, // only for image and circularImage shapes\n useBorderWithImage: false, // only for image shape\n coordinateOrigin: \"center\", // only for image and circularImage shapes\n },\n size: 25,\n title: undefined,\n value: undefined,\n x: undefined,\n y: undefined,\n };\n\n // Protect from idiocy\n if (this.defaultOptions.mass <= 0) {\n throw \"Internal error: mass in defaultOptions of NodesHandler may not be zero or negative\";\n }\n\n this.options = bridgeObject(this.defaultOptions);\n\n this.bindEventListeners();\n }\n\n /**\n * Binds event listeners\n */\n bindEventListeners() {\n // refresh the nodes. Used when reverting from hierarchical layout\n this.body.emitter.on(\"refreshNodes\", this.refresh.bind(this));\n this.body.emitter.on(\"refresh\", this.refresh.bind(this));\n this.body.emitter.on(\"destroy\", () => {\n forEach(this.nodesListeners, (callback, event) => {\n if (this.body.data.nodes) this.body.data.nodes.off(event, callback);\n });\n delete this.body.functions.createNode;\n delete this.nodesListeners.add;\n delete this.nodesListeners.update;\n delete this.nodesListeners.remove;\n delete this.nodesListeners;\n });\n }\n\n /**\n *\n * @param {object} options\n */\n setOptions(options) {\n if (options !== undefined) {\n Node.parseOptions(this.options, options);\n\n // Need to set opacity here because Node.parseOptions is also used for groups,\n // if you set opacity in Node.parseOptions it overwrites group opacity.\n if (options.opacity !== undefined) {\n if (\n Number.isNaN(options.opacity) ||\n !Number.isFinite(options.opacity) ||\n options.opacity < 0 ||\n options.opacity > 1\n ) {\n console.error(\n \"Invalid option for node opacity. Value must be between 0 and 1, found: \" +\n options.opacity\n );\n } else {\n this.options.opacity = options.opacity;\n }\n }\n\n // update the shape in all nodes\n if (options.shape !== undefined) {\n for (const nodeId in this.body.nodes) {\n if (Object.prototype.hasOwnProperty.call(this.body.nodes, nodeId)) {\n this.body.nodes[nodeId].updateShape();\n }\n }\n }\n\n // Update the labels of nodes if any relevant options changed.\n if (\n typeof options.font !== \"undefined\" ||\n typeof options.widthConstraint !== \"undefined\" ||\n typeof options.heightConstraint !== \"undefined\"\n ) {\n for (const nodeId of Object.keys(this.body.nodes)) {\n this.body.nodes[nodeId].updateLabelModule();\n this.body.nodes[nodeId].needsRefresh();\n }\n }\n\n // update the shape size in all nodes\n if (options.size !== undefined) {\n for (const nodeId in this.body.nodes) {\n if (Object.prototype.hasOwnProperty.call(this.body.nodes, nodeId)) {\n this.body.nodes[nodeId].needsRefresh();\n }\n }\n }\n\n // update the state of the variables if needed\n if (options.hidden !== undefined || options.physics !== undefined) {\n this.body.emitter.emit(\"_dataChanged\");\n }\n }\n }\n\n /**\n * Set a data set with nodes for the network\n *\n * @param {Array | DataSet | DataView} nodes The data containing the nodes.\n * @param {boolean} [doNotEmit=false] - Suppress data changed event.\n * @private\n */\n setData(nodes, doNotEmit = false) {\n const oldNodesData = this.body.data.nodes;\n\n if (isDataViewLike(\"id\", nodes)) {\n this.body.data.nodes = nodes;\n } else if (Array.isArray(nodes)) {\n this.body.data.nodes = new DataSet();\n this.body.data.nodes.add(nodes);\n } else if (!nodes) {\n this.body.data.nodes = new DataSet();\n } else {\n throw new TypeError(\"Array or DataSet expected\");\n }\n\n if (oldNodesData) {\n // unsubscribe from old dataset\n forEach(this.nodesListeners, function (callback, event) {\n oldNodesData.off(event, callback);\n });\n }\n\n // remove drawn nodes\n this.body.nodes = {};\n\n if (this.body.data.nodes) {\n // subscribe to new dataset\n const me = this;\n forEach(this.nodesListeners, function (callback, event) {\n me.body.data.nodes.on(event, callback);\n });\n\n // draw all new nodes\n const ids = this.body.data.nodes.getIds();\n this.add(ids, true);\n }\n\n if (doNotEmit === false) {\n this.body.emitter.emit(\"_dataChanged\");\n }\n }\n\n /**\n * Add nodes\n *\n * @param {number[] | string[]} ids\n * @param {boolean} [doNotEmit=false]\n * @private\n */\n add(ids, doNotEmit = false) {\n let id;\n const newNodes = [];\n for (let i = 0; i < ids.length; i++) {\n id = ids[i];\n const properties = this.body.data.nodes.get(id);\n const node = this.create(properties);\n newNodes.push(node);\n this.body.nodes[id] = node; // note: this may replace an existing node\n }\n\n this.layoutEngine.positionInitially(newNodes);\n\n if (doNotEmit === false) {\n this.body.emitter.emit(\"_dataChanged\");\n }\n }\n\n /**\n * Update existing nodes, or create them when not yet existing\n *\n * @param {number[] | string[]} ids id's of changed nodes\n * @param {Array} changedData array with changed data\n * @param {Array|undefined} oldData optional; array with previous data\n * @private\n */\n update(ids, changedData, oldData) {\n const nodes = this.body.nodes;\n let dataChanged = false;\n for (let i = 0; i < ids.length; i++) {\n const id = ids[i];\n let node = nodes[id];\n const data = changedData[i];\n if (node !== undefined) {\n // update node\n if (node.setOptions(data)) {\n dataChanged = true;\n }\n } else {\n dataChanged = true;\n // create node\n node = this.create(data);\n nodes[id] = node;\n }\n }\n\n if (!dataChanged && oldData !== undefined) {\n // Check for any changes which should trigger a layout recalculation\n // For now, this is just 'level' for hierarchical layout\n // Assumption: old and new data arranged in same order; at time of writing, this holds.\n dataChanged = changedData.some(function (newValue, index) {\n const oldValue = oldData[index];\n return oldValue && oldValue.level !== newValue.level;\n });\n }\n\n if (dataChanged === true) {\n this.body.emitter.emit(\"_dataChanged\");\n } else {\n this.body.emitter.emit(\"_dataUpdated\");\n }\n }\n\n /**\n * Remove existing nodes. If nodes do not exist, the method will just ignore it.\n *\n * @param {number[] | string[]} ids\n * @private\n */\n remove(ids) {\n const nodes = this.body.nodes;\n\n for (let i = 0; i < ids.length; i++) {\n const id = ids[i];\n delete nodes[id];\n }\n\n this.body.emitter.emit(\"_dataChanged\");\n }\n\n /**\n * create a node\n *\n * @param {object} properties\n * @param {class} [constructorClass=Node.default]\n * @returns {*}\n */\n create(properties, constructorClass = Node) {\n return new constructorClass(\n properties,\n this.body,\n this.images,\n this.groups,\n this.options,\n this.defaultOptions\n );\n }\n\n /**\n *\n * @param {boolean} [clearPositions=false]\n */\n refresh(clearPositions = false) {\n forEach(this.body.nodes, (node, nodeId) => {\n const data = this.body.data.nodes.get(nodeId);\n if (data !== undefined) {\n if (clearPositions === true) {\n node.setOptions({ x: null, y: null });\n }\n node.setOptions({ fixed: false });\n node.setOptions(data);\n }\n });\n }\n\n /**\n * Returns the positions of the nodes.\n *\n * @param {Array.<Node.id> | string} [ids] --> optional, can be array of nodeIds, can be string\n * @returns {{}}\n */\n getPositions(ids) {\n const dataArray = {};\n if (ids !== undefined) {\n if (Array.isArray(ids) === true) {\n for (let i = 0; i < ids.length; i++) {\n if (this.body.nodes[ids[i]] !== undefined) {\n const node = this.body.nodes[ids[i]];\n dataArray[ids[i]] = {\n x: Math.round(node.x),\n y: Math.round(node.y),\n };\n }\n }\n } else {\n if (this.body.nodes[ids] !== undefined) {\n const node = this.body.nodes[ids];\n dataArray[ids] = { x: Math.round(node.x), y: Math.round(node.y) };\n }\n }\n } else {\n for (let i = 0; i < this.body.nodeIndices.length; i++) {\n const node = this.body.nodes[this.body.nodeIndices[i]];\n dataArray[this.body.nodeIndices[i]] = {\n x: Math.round(node.x),\n y: Math.round(node.y),\n };\n }\n }\n return dataArray;\n }\n\n /**\n * Retrieves the x y position of a specific id.\n *\n * @param {string} id The id to retrieve.\n *\n * @throws {TypeError} If no id is included.\n * @throws {ReferenceError} If an invalid id is provided.\n *\n * @returns {{ x: number, y: number }} Returns X, Y canvas position of the node with given id.\n */\n getPosition(id) {\n if (id == undefined) {\n throw new TypeError(\"No id was specified for getPosition method.\");\n } else if (this.body.nodes[id] == undefined) {\n throw new ReferenceError(\n `NodeId provided for getPosition does not exist. Provided: ${id}`\n );\n } else {\n return {\n x: Math.round(this.body.nodes[id].x),\n y: Math.round(this.body.nodes[id].y),\n };\n }\n }\n\n /**\n * Load the XY positions of the nodes into the dataset.\n */\n storePositions() {\n // todo: add support for clusters and hierarchical.\n const dataArray = [];\n const dataset = this.body.data.nodes.getDataSet();\n\n for (const dsNode of dataset.get()) {\n const id = dsNode.id;\n const bodyNode = this.body.nodes[id];\n const x = Math.round(bodyNode.x);\n const y = Math.round(bodyNode.y);\n\n if (dsNode.x !== x || dsNode.y !== y) {\n dataArray.push({ id, x, y });\n }\n }\n\n dataset.update(dataArray);\n }\n\n /**\n * get the bounding box of a node.\n *\n * @param {Node.id} nodeId\n * @returns {j|*}\n */\n getBoundingBox(nodeId) {\n if (this.body.nodes[nodeId] !== undefined) {\n return this.body.nodes[nodeId].shape.boundingBox;\n }\n }\n\n /**\n * Get the Ids of nodes connected to this node.\n *\n * @param {Node.id} nodeId\n * @param {'to'|'from'|undefined} direction values 'from' and 'to' select respectively parent and child nodes only.\n * Any other value returns both parent and child nodes.\n * @returns {Array}\n */\n getConnectedNodes(nodeId, direction) {\n const nodeList = [];\n if (this.body.nodes[nodeId] !== undefined) {\n const node = this.body.nodes[nodeId];\n const nodeObj = {}; // used to quickly check if node already exists\n for (let i = 0; i < node.edges.length; i++) {\n const edge = node.edges[i];\n if (direction !== \"to\" && edge.toId == node.id) {\n // these are double equals since ids can be numeric or string\n if (nodeObj[edge.fromId] === undefined) {\n nodeList.push(edge.fromId);\n nodeObj[edge.fromId] = true;\n }\n } else if (direction !== \"from\" && edge.fromId == node.id) {\n // these are double equals since ids can be numeric or string\n if (nodeObj[edge.toId] === undefined) {\n nodeList.push(edge.toId);\n nodeObj[edge.toId] = true;\n }\n }\n }\n }\n return nodeList;\n }\n\n /**\n * Get the ids of the edges connected to this node.\n *\n * @param {Node.id} nodeId\n * @returns {*}\n */\n getConnectedEdges(nodeId) {\n const edgeList = [];\n if (this.body.nodes[nodeId] !== undefined) {\n const node = this.body.nodes[nodeId];\n for (let i = 0; i < node.edges.length; i++) {\n edgeList.push(node.edges[i].id);\n }\n } else {\n console.error(\n \"NodeId provided for getConnectedEdges does not exist. Provided: \",\n nodeId\n );\n }\n return edgeList;\n }\n\n /**\n * Move a node.\n *\n * @param {Node.id} nodeId\n * @param {number} x\n * @param {number} y\n */\n moveNode(nodeId, x, y) {\n if (this.body.nodes[nodeId] !== undefined) {\n this.body.nodes[nodeId].x = Number(x);\n this.body.nodes[nodeId].y = Number(y);\n setTimeout(() => {\n this.body.emitter.emit(\"startSimulation\");\n }, 0);\n } else {\n console.error(\n \"Node id supplied to moveNode does not exist. Provided: \",\n nodeId\n );\n }\n }\n}\n\nexport default NodesHandler;\n","var $ = require('../internals/export');\nvar isObject = require('../internals/is-object');\nvar anObject = require('../internals/an-object');\nvar has = require('../internals/has');\nvar getOwnPropertyDescriptorModule = require('../internals/object-get-own-property-descriptor');\nvar getPrototypeOf = require('../internals/object-get-prototype-of');\n\n// `Reflect.get` method\n// https://tc39.es/ecma262/#sec-reflect.get\nfunction get(target, propertyKey /* , receiver */) {\n var receiver = arguments.length < 3 ? target : arguments[2];\n var descriptor, prototype;\n if (anObject(target) === receiver) return target[propertyKey];\n if (descriptor = getOwnPropertyDescriptorModule.f(target, propertyKey)) return has(descriptor, 'value')\n ? descriptor.value\n : descriptor.get === undefined\n ? undefined\n : descriptor.get.call(receiver);\n if (isObject(prototype = getPrototypeOf(target))) return get(prototype, propertyKey, receiver);\n}\n\n$({ target: 'Reflect', stat: true }, {\n get: get\n});\n","require('../../modules/es.reflect.get');\nvar path = require('../../internals/path');\n\nmodule.exports = path.Reflect.get;\n","var parent = require('../../es/reflect/get');\n\nmodule.exports = parent;\n","var parent = require('../../stable/reflect/get');\n\nmodule.exports = parent;\n","module.exports = require(\"core-js-pure/features/reflect/get\");","var parent = require('../../stable/object/get-own-property-descriptor');\n\nmodule.exports = parent;\n","module.exports = require(\"core-js-pure/features/object/get-own-property-descriptor\");","var getPrototypeOf = require(\"./getPrototypeOf.js\");\n\nfunction _superPropBase(object, property) {\n while (!Object.prototype.hasOwnProperty.call(object, property)) {\n object = getPrototypeOf(object);\n if (object === null) break;\n }\n\n return object;\n}\n\nmodule.exports = _superPropBase;\nmodule.exports[\"default\"] = module.exports, module.exports.__esModule = true;","var _Reflect$get = require(\"@babel/runtime-corejs3/core-js/reflect/get\");\n\nvar _Object$getOwnPropertyDescriptor = require(\"@babel/runtime-corejs3/core-js/object/get-own-property-descriptor\");\n\nvar superPropBase = require(\"./superPropBase.js\");\n\nfunction _get(target, property, receiver) {\n if (typeof Reflect !== \"undefined\" && _Reflect$get) {\n module.exports = _get = _Reflect$get;\n module.exports[\"default\"] = module.exports, module.exports.__esModule = true;\n } else {\n module.exports = _get = function _get(target, property, receiver) {\n var base = superPropBase(target, property);\n if (!base) return;\n\n var desc = _Object$getOwnPropertyDescriptor(base, property);\n\n if (desc.get) {\n return desc.get.call(receiver);\n }\n\n return desc.value;\n };\n\n module.exports[\"default\"] = module.exports, module.exports.__esModule = true;\n }\n\n return _get(target, property, receiver || target);\n}\n\nmodule.exports = _get;\nmodule.exports[\"default\"] = module.exports, module.exports.__esModule = true;","var $ = require('../internals/export');\n\n// eslint-disable-next-line es/no-math-hypot -- required for testing\nvar $hypot = Math.hypot;\nvar abs = Math.abs;\nvar sqrt = Math.sqrt;\n\n// Chrome 77 bug\n// https://bugs.chromium.org/p/v8/issues/detail?id=9546\nvar BUGGY = !!$hypot && $hypot(Infinity, NaN) !== Infinity;\n\n// `Math.hypot` method\n// https://tc39.es/ecma262/#sec-math.hypot\n$({ target: 'Math', stat: true, forced: BUGGY }, {\n // eslint-disable-next-line no-unused-vars -- required for `.length`\n hypot: function hypot(value1, value2) {\n var sum = 0;\n var i = 0;\n var aLen = arguments.length;\n var larg = 0;\n var arg, div;\n while (i < aLen) {\n arg = abs(arguments[i++]);\n if (larg < arg) {\n div = larg / arg;\n sum = sum * div * div + 1;\n larg = arg;\n } else if (arg > 0) {\n div = arg / larg;\n sum += div * div;\n } else sum += arg;\n }\n return larg === Infinity ? Infinity : larg * sqrt(sum);\n }\n});\n","require('../../modules/es.math.hypot');\nvar path = require('../../internals/path');\n\nmodule.exports = path.Math.hypot;\n","var parent = require('../../es/math/hypot');\n\nmodule.exports = parent;\n","module.exports = require(\"core-js-pure/stable/math/hypot\");","/** ============================================================================\n * Location of all the endpoint drawing routines.\n *\n * Every endpoint has its own drawing routine, which contains an endpoint definition.\n *\n * The endpoint definitions must have the following properies:\n *\n * - (0,0) is the connection point to the node it attaches to\n * - The endpoints are orientated to the positive x-direction\n * - The length of the endpoint is at most 1\n *\n * As long as the endpoint classes remain simple and not too numerous, they will\n * be contained within this module.\n * All classes here except `EndPoints` should be considered as private to this module.\n *\n * -----------------------------------------------------------------------------\n * ### Further Actions\n *\n * After adding a new endpoint here, you also need to do the following things:\n *\n * - Add the new endpoint name to `network/options.js` in array `endPoints`.\n * - Add the new endpoint name to the documentation.\n * Scan for 'arrows.to.type` and add it to the description.\n * - Add the endpoint to the examples. At the very least, add it to example\n * `edgeStyles/arrowTypes`.\n * ============================================================================= */\n\nimport { ArrowData, Point } from \"./types\";\nimport { drawCircle } from \"./shapes\";\n\n/**\n * Common methods for endpoints\n *\n * @class\n */\nclass EndPoint {\n /**\n * Apply transformation on points for display.\n *\n * The following is done:\n * - rotate by the specified angle\n * - multiply the (normalized) coordinates by the passed length\n * - offset by the target coordinates\n *\n * @param points - The point(s) to be transformed.\n * @param arrowData - The data determining the result of the transformation.\n */\n public static transform(points: Point | Point[], arrowData: ArrowData): void {\n if (!Array.isArray(points)) {\n points = [points];\n }\n\n const x = arrowData.point.x;\n const y = arrowData.point.y;\n const angle = arrowData.angle;\n const length = arrowData.length;\n\n for (let i = 0; i < points.length; ++i) {\n const p = points[i];\n const xt = p.x * Math.cos(angle) - p.y * Math.sin(angle);\n const yt = p.x * Math.sin(angle) + p.y * Math.cos(angle);\n\n p.x = x + length * xt;\n p.y = y + length * yt;\n }\n }\n\n /**\n * Draw a closed path using the given real coordinates.\n *\n * @param ctx - The path will be rendered into this context.\n * @param points - The points of the path.\n */\n public static drawPath(ctx: CanvasRenderingContext2D, points: Point[]): void {\n ctx.beginPath();\n ctx.moveTo(points[0].x, points[0].y);\n for (let i = 1; i < points.length; ++i) {\n ctx.lineTo(points[i].x, points[i].y);\n }\n ctx.closePath();\n }\n}\n\n/**\n * Drawing methods for the arrow endpoint.\n */\nclass Image extends EndPoint {\n /**\n * Draw this shape at the end of a line.\n *\n * @param ctx - The shape will be rendered into this context.\n * @param arrowData - The data determining the shape.\n *\n * @returns False as there is no way to fill an image.\n */\n public static draw(\n ctx: CanvasRenderingContext2D,\n arrowData: ArrowData\n ): false {\n if (arrowData.image) {\n ctx.save();\n\n ctx.translate(arrowData.point.x, arrowData.point.y);\n ctx.rotate(Math.PI / 2 + arrowData.angle);\n\n const width =\n arrowData.imageWidth != null\n ? arrowData.imageWidth\n : arrowData.image.width;\n const height =\n arrowData.imageHeight != null\n ? arrowData.imageHeight\n : arrowData.image.height;\n\n arrowData.image.drawImageAtPosition(\n ctx,\n 1, // scale\n -width / 2, // x\n 0, // y\n width,\n height\n );\n\n ctx.restore();\n }\n\n return false;\n }\n}\n\n/**\n * Drawing methods for the arrow endpoint.\n */\nclass Arrow extends EndPoint {\n /**\n * Draw this shape at the end of a line.\n *\n * @param ctx - The shape will be rendered into this context.\n * @param arrowData - The data determining the shape.\n *\n * @returns True because ctx.fill() can be used to fill the arrow.\n */\n public static draw(\n ctx: CanvasRenderingContext2D,\n arrowData: ArrowData\n ): true {\n // Normalized points of closed path, in the order that they should be drawn.\n // (0, 0) is the attachment point, and the point around which should be rotated\n const points = [\n { x: 0, y: 0 },\n { x: -1, y: 0.3 },\n { x: -0.9, y: 0 },\n { x: -1, y: -0.3 },\n ];\n\n EndPoint.transform(points, arrowData);\n EndPoint.drawPath(ctx, points);\n\n return true;\n }\n}\n\n/**\n * Drawing methods for the crow endpoint.\n */\nclass Crow {\n /**\n * Draw this shape at the end of a line.\n *\n * @param ctx - The shape will be rendered into this context.\n * @param arrowData - The data determining the shape.\n *\n * @returns True because ctx.fill() can be used to fill the arrow.\n */\n public static draw(\n ctx: CanvasRenderingContext2D,\n arrowData: ArrowData\n ): true {\n // Normalized points of closed path, in the order that they should be drawn.\n // (0, 0) is the attachment point, and the point around which should be rotated\n const points = [\n { x: -1, y: 0 },\n { x: 0, y: 0.3 },\n { x: -0.4, y: 0 },\n { x: 0, y: -0.3 },\n ];\n\n EndPoint.transform(points, arrowData);\n EndPoint.drawPath(ctx, points);\n\n return true;\n }\n}\n\n/**\n * Drawing methods for the curve endpoint.\n */\nclass Curve {\n /**\n * Draw this shape at the end of a line.\n *\n * @param ctx - The shape will be rendered into this context.\n * @param arrowData - The data determining the shape.\n *\n * @returns True because ctx.fill() can be used to fill the arrow.\n */\n public static draw(\n ctx: CanvasRenderingContext2D,\n arrowData: ArrowData\n ): true {\n // Normalized points of closed path, in the order that they should be drawn.\n // (0, 0) is the attachment point, and the point around which should be rotated\n const point = { x: -0.4, y: 0 };\n EndPoint.transform(point, arrowData);\n\n // Update endpoint style for drawing transparent arc.\n ctx.strokeStyle = ctx.fillStyle;\n ctx.fillStyle = \"rgba(0, 0, 0, 0)\";\n\n // Define curve endpoint as semicircle.\n const pi = Math.PI;\n const startAngle = arrowData.angle - pi / 2;\n const endAngle = arrowData.angle + pi / 2;\n ctx.beginPath();\n ctx.arc(\n point.x,\n point.y,\n arrowData.length * 0.4,\n startAngle,\n endAngle,\n false\n );\n ctx.stroke();\n\n return true;\n }\n}\n\n/**\n * Drawing methods for the inverted curve endpoint.\n */\nclass InvertedCurve {\n /**\n * Draw this shape at the end of a line.\n *\n * @param ctx - The shape will be rendered into this context.\n * @param arrowData - The data determining the shape.\n *\n * @returns True because ctx.fill() can be used to fill the arrow.\n */\n public static draw(\n ctx: CanvasRenderingContext2D,\n arrowData: ArrowData\n ): true {\n // Normalized points of closed path, in the order that they should be drawn.\n // (0, 0) is the attachment point, and the point around which should be rotated\n const point = { x: -0.3, y: 0 };\n EndPoint.transform(point, arrowData);\n\n // Update endpoint style for drawing transparent arc.\n ctx.strokeStyle = ctx.fillStyle;\n ctx.fillStyle = \"rgba(0, 0, 0, 0)\";\n\n // Define inverted curve endpoint as semicircle.\n const pi = Math.PI;\n const startAngle = arrowData.angle + pi / 2;\n const endAngle = arrowData.angle + (3 * pi) / 2;\n ctx.beginPath();\n ctx.arc(\n point.x,\n point.y,\n arrowData.length * 0.4,\n startAngle,\n endAngle,\n false\n );\n ctx.stroke();\n\n return true;\n }\n}\n\n/**\n * Drawing methods for the trinagle endpoint.\n */\nclass Triangle {\n /**\n * Draw this shape at the end of a line.\n *\n * @param ctx - The shape will be rendered into this context.\n * @param arrowData - The data determining the shape.\n *\n * @returns True because ctx.fill() can be used to fill the arrow.\n */\n public static draw(\n ctx: CanvasRenderingContext2D,\n arrowData: ArrowData\n ): true {\n // Normalized points of closed path, in the order that they should be drawn.\n // (0, 0) is the attachment point, and the point around which should be rotated\n const points = [\n { x: 0.02, y: 0 },\n { x: -1, y: 0.3 },\n { x: -1, y: -0.3 },\n ];\n\n EndPoint.transform(points, arrowData);\n EndPoint.drawPath(ctx, points);\n\n return true;\n }\n}\n\n/**\n * Drawing methods for the inverted trinagle endpoint.\n */\nclass InvertedTriangle {\n /**\n * Draw this shape at the end of a line.\n *\n * @param ctx - The shape will be rendered into this context.\n * @param arrowData - The data determining the shape.\n *\n * @returns True because ctx.fill() can be used to fill the arrow.\n */\n public static draw(\n ctx: CanvasRenderingContext2D,\n arrowData: ArrowData\n ): true {\n // Normalized points of closed path, in the order that they should be drawn.\n // (0, 0) is the attachment point, and the point around which should be rotated\n const points = [\n { x: 0, y: 0.3 },\n { x: 0, y: -0.3 },\n { x: -1, y: 0 },\n ];\n\n EndPoint.transform(points, arrowData);\n EndPoint.drawPath(ctx, points);\n\n return true;\n }\n}\n\n/**\n * Drawing methods for the circle endpoint.\n */\nclass Circle {\n /**\n * Draw this shape at the end of a line.\n *\n * @param ctx - The shape will be rendered into this context.\n * @param arrowData - The data determining the shape.\n *\n * @returns True because ctx.fill() can be used to fill the arrow.\n */\n public static draw(\n ctx: CanvasRenderingContext2D,\n arrowData: ArrowData\n ): true {\n const point = { x: -0.4, y: 0 };\n\n EndPoint.transform(point, arrowData);\n drawCircle(ctx, point.x, point.y, arrowData.length * 0.4);\n\n return true;\n }\n}\n\n/**\n * Drawing methods for the bar endpoint.\n */\nclass Bar {\n /**\n * Draw this shape at the end of a line.\n *\n * @param ctx - The shape will be rendered into this context.\n * @param arrowData - The data determining the shape.\n *\n * @returns True because ctx.fill() can be used to fill the arrow.\n */\n public static draw(\n ctx: CanvasRenderingContext2D,\n arrowData: ArrowData\n ): true {\n /*\n var points = [\n {x:0, y:0.5},\n {x:0, y:-0.5}\n ];\n\n EndPoint.transform(points, arrowData);\n ctx.beginPath();\n ctx.moveTo(points[0].x, points[0].y);\n ctx.lineTo(points[1].x, points[1].y);\n ctx.stroke();\n*/\n\n const points = [\n { x: 0, y: 0.5 },\n { x: 0, y: -0.5 },\n { x: -0.15, y: -0.5 },\n { x: -0.15, y: 0.5 },\n ];\n\n EndPoint.transform(points, arrowData);\n EndPoint.drawPath(ctx, points);\n\n return true;\n }\n}\n\n/**\n * Drawing methods for the box endpoint.\n */\nclass Box {\n /**\n * Draw this shape at the end of a line.\n *\n * @param ctx - The shape will be rendered into this context.\n * @param arrowData - The data determining the shape.\n *\n * @returns True because ctx.fill() can be used to fill the arrow.\n */\n public static draw(\n ctx: CanvasRenderingContext2D,\n arrowData: ArrowData\n ): true {\n const points = [\n { x: 0, y: 0.3 },\n { x: 0, y: -0.3 },\n { x: -0.6, y: -0.3 },\n { x: -0.6, y: 0.3 },\n ];\n\n EndPoint.transform(points, arrowData);\n EndPoint.drawPath(ctx, points);\n\n return true;\n }\n}\n\n/**\n * Drawing methods for the diamond endpoint.\n */\nclass Diamond {\n /**\n * Draw this shape at the end of a line.\n *\n * @param ctx - The shape will be rendered into this context.\n * @param arrowData - The data determining the shape.\n *\n * @returns True because ctx.fill() can be used to fill the arrow.\n */\n public static draw(\n ctx: CanvasRenderingContext2D,\n arrowData: ArrowData\n ): true {\n const points = [\n { x: 0, y: 0 },\n { x: -0.5, y: -0.3 },\n { x: -1, y: 0 },\n { x: -0.5, y: 0.3 },\n ];\n\n EndPoint.transform(points, arrowData);\n EndPoint.drawPath(ctx, points);\n\n return true;\n }\n}\n\n/**\n * Drawing methods for the vee endpoint.\n */\nclass Vee {\n /**\n * Draw this shape at the end of a line.\n *\n * @param ctx - The shape will be rendered into this context.\n * @param arrowData - The data determining the shape.\n *\n * @returns True because ctx.fill() can be used to fill the arrow.\n */\n public static draw(\n ctx: CanvasRenderingContext2D,\n arrowData: ArrowData\n ): true {\n // Normalized points of closed path, in the order that they should be drawn.\n // (0, 0) is the attachment point, and the point around which should be rotated\n const points = [\n { x: -1, y: 0.3 },\n { x: -0.5, y: 0 },\n { x: -1, y: -0.3 },\n { x: 0, y: 0 },\n ];\n\n EndPoint.transform(points, arrowData);\n EndPoint.drawPath(ctx, points);\n\n return true;\n }\n}\n\n/**\n * Drawing methods for the endpoints.\n */\nexport class EndPoints {\n /**\n * Draw an endpoint.\n *\n * @param ctx - The shape will be rendered into this context.\n * @param arrowData - The data determining the shape.\n *\n * @returns True if ctx.fill() can be used to fill the arrow, false otherwise.\n */\n public static draw(\n ctx: CanvasRenderingContext2D,\n arrowData: ArrowData\n ): boolean {\n let type;\n if (arrowData.type) {\n type = arrowData.type.toLowerCase();\n }\n\n switch (type) {\n case \"image\":\n return Image.draw(ctx, arrowData);\n case \"circle\":\n return Circle.draw(ctx, arrowData);\n case \"box\":\n return Box.draw(ctx, arrowData);\n case \"crow\":\n return Crow.draw(ctx, arrowData);\n case \"curve\":\n return Curve.draw(ctx, arrowData);\n case \"diamond\":\n return Diamond.draw(ctx, arrowData);\n case \"inv_curve\":\n return InvertedCurve.draw(ctx, arrowData);\n case \"triangle\":\n return Triangle.draw(ctx, arrowData);\n case \"inv_triangle\":\n return InvertedTriangle.draw(ctx, arrowData);\n case \"bar\":\n return Bar.draw(ctx, arrowData);\n case \"vee\":\n return Vee.draw(ctx, arrowData);\n case \"arrow\": // fall-through\n default:\n return Arrow.draw(ctx, arrowData);\n }\n }\n}\n","import { overrideOpacity } from \"vis-util/esnext\";\nimport { EndPoints } from \"./end-points\";\nimport {\n ArrowData,\n ArrowDataWithCore,\n ArrowType,\n EdgeFormattingValues,\n EdgeType,\n Id,\n Label,\n EdgeOptions,\n Point,\n PointT,\n SelectiveRequired,\n VBody,\n VNode,\n} from \"./types\";\nimport { drawDashedLine } from \"./shapes\";\nimport { getSelfRefCoordinates } from \"../../shared/ComponentUtil\";\n\nexport interface FindBorderPositionOptions<Via> {\n via: Via;\n}\nexport interface FindBorderPositionCircleOptions {\n x: number;\n y: number;\n low: number;\n high: number;\n direction: number;\n}\n\n/**\n * The Base Class for all edges.\n */\nexport abstract class EdgeBase<Via = undefined> implements EdgeType {\n public from!: VNode; // Initialized in setOptions\n public fromPoint: Point;\n public to!: VNode; // Initialized in setOptions\n public toPoint: Point;\n public via?: VNode;\n\n public color: unknown = {};\n public colorDirty = true;\n public id!: Id; // Initialized in setOptions\n public options!: EdgeOptions; // Initialized in setOptions\n public hoverWidth = 1.5;\n public selectionWidth = 2;\n\n /**\n * Create a new instance.\n *\n * @param options - The options object of given edge.\n * @param _body - The body of the network.\n * @param _labelModule - Label module.\n */\n public constructor(\n options: EdgeOptions,\n protected _body: VBody,\n protected _labelModule: Label\n ) {\n this.setOptions(options);\n\n this.fromPoint = this.from;\n this.toPoint = this.to;\n }\n\n /**\n * Find the intersection between the border of the node and the edge.\n *\n * @param node - The node (either from or to node of the edge).\n * @param ctx - The context that will be used for rendering.\n * @param options - Additional options.\n *\n * @returns Cartesian coordinates of the intersection between the border of the node and the edge.\n */\n protected abstract _findBorderPosition(\n node: VNode,\n ctx: CanvasRenderingContext2D,\n options?: FindBorderPositionOptions<Via>\n ): PointT;\n\n /**\n * Return additional point(s) the edge passes through.\n *\n * @returns Cartesian coordinates of the point(s) the edge passes through.\n */\n public abstract getViaNode(): Via;\n\n /** @inheritDoc */\n public abstract getPoint(position: number, viaNode?: Via): Point;\n\n /** @inheritDoc */\n public connect(): void {\n this.from = this._body.nodes[this.options.from];\n this.to = this._body.nodes[this.options.to];\n }\n\n /** @inheritDoc */\n public cleanup(): boolean {\n return false;\n }\n\n /**\n * Set new edge options.\n *\n * @param options - The new edge options object.\n */\n public setOptions(options: EdgeOptions): void {\n this.options = options;\n\n this.from = this._body.nodes[this.options.from];\n this.to = this._body.nodes[this.options.to];\n this.id = this.options.id;\n }\n\n /** @inheritDoc */\n public drawLine(\n ctx: CanvasRenderingContext2D,\n values: SelectiveRequired<\n EdgeFormattingValues,\n | \"color\"\n | \"opacity\"\n | \"shadowColor\"\n | \"shadowSize\"\n | \"shadowX\"\n | \"shadowY\"\n | \"width\"\n >,\n _selected?: boolean,\n _hover?: boolean,\n viaNode: Via = this.getViaNode()\n ): void {\n // set style\n ctx.strokeStyle = this.getColor(ctx, values);\n ctx.lineWidth = values.width;\n\n if (values.dashes !== false) {\n this._drawDashedLine(ctx, values, viaNode);\n } else {\n this._drawLine(ctx, values, viaNode);\n }\n }\n\n /**\n * Draw a line with given style between two nodes through supplied node(s).\n *\n * @param ctx - The context that will be used for rendering.\n * @param values - Formatting values like color, opacity or shadow.\n * @param viaNode - Additional control point(s) for the edge.\n * @param fromPoint - TODO: Seems ignored, remove?\n * @param toPoint - TODO: Seems ignored, remove?\n */\n private _drawLine(\n ctx: CanvasRenderingContext2D,\n values: SelectiveRequired<\n EdgeFormattingValues,\n \"shadowColor\" | \"shadowSize\" | \"shadowX\" | \"shadowY\"\n >,\n viaNode: Via,\n fromPoint?: Point,\n toPoint?: Point\n ): void {\n if (this.from != this.to) {\n // draw line\n this._line(ctx, values, viaNode, fromPoint, toPoint);\n } else {\n const [x, y, radius] = this._getCircleData(ctx);\n this._circle(ctx, values, x, y, radius);\n }\n }\n\n /**\n * Draw a dashed line with given style between two nodes through supplied node(s).\n *\n * @param ctx - The context that will be used for rendering.\n * @param values - Formatting values like color, opacity or shadow.\n * @param viaNode - Additional control point(s) for the edge.\n * @param _fromPoint - Ignored (TODO: remove in the future).\n * @param _toPoint - Ignored (TODO: remove in the future).\n */\n private _drawDashedLine(\n ctx: CanvasRenderingContext2D,\n values: SelectiveRequired<\n EdgeFormattingValues,\n \"shadowColor\" | \"shadowSize\" | \"shadowX\" | \"shadowY\"\n >,\n viaNode: Via,\n _fromPoint?: Point,\n _toPoint?: Point\n ): void {\n ctx.lineCap = \"round\";\n const pattern = Array.isArray(values.dashes) ? values.dashes : [5, 5];\n\n // only firefox and chrome support this method, else we use the legacy one.\n if (ctx.setLineDash !== undefined) {\n ctx.save();\n\n // set dash settings for chrome or firefox\n ctx.setLineDash(pattern);\n ctx.lineDashOffset = 0;\n\n // draw the line\n if (this.from != this.to) {\n // draw line\n this._line(ctx, values, viaNode);\n } else {\n const [x, y, radius] = this._getCircleData(ctx);\n this._circle(ctx, values, x, y, radius);\n }\n\n // restore the dash settings.\n ctx.setLineDash([0]);\n ctx.lineDashOffset = 0;\n ctx.restore();\n } else {\n // unsupporting smooth lines\n if (this.from != this.to) {\n // draw line\n drawDashedLine(\n ctx,\n this.from.x,\n this.from.y,\n this.to.x,\n this.to.y,\n pattern\n );\n } else {\n const [x, y, radius] = this._getCircleData(ctx);\n this._circle(ctx, values, x, y, radius);\n }\n // draw shadow if enabled\n this.enableShadow(ctx, values);\n\n ctx.stroke();\n\n // disable shadows for other elements.\n this.disableShadow(ctx, values);\n }\n }\n\n /**\n * Draw a line with given style between two nodes through supplied node(s).\n *\n * @param ctx - The context that will be used for rendering.\n * @param values - Formatting values like color, opacity or shadow.\n * @param viaNode - Additional control point(s) for the edge.\n * @param fromPoint - TODO: Seems ignored, remove?\n * @param toPoint - TODO: Seems ignored, remove?\n */\n protected abstract _line(\n ctx: CanvasRenderingContext2D,\n values: EdgeFormattingValues,\n viaNode: Via,\n fromPoint?: Point,\n toPoint?: Point\n ): void;\n\n /**\n * Find the intersection between the border of the node and the edge.\n *\n * @param node - The node (either from or to node of the edge).\n * @param ctx - The context that will be used for rendering.\n * @param options - Additional options.\n *\n * @returns Cartesian coordinates of the intersection between the border of the node and the edge.\n */\n public findBorderPosition(\n node: VNode,\n ctx: CanvasRenderingContext2D,\n options?: FindBorderPositionOptions<Via> | FindBorderPositionCircleOptions\n ): PointT {\n if (this.from != this.to) {\n return this._findBorderPosition(node, ctx, options as any);\n } else {\n return this._findBorderPositionCircle(node, ctx, options as any);\n }\n }\n\n /** @inheritDoc */\n public findBorderPositions(ctx: CanvasRenderingContext2D): {\n from: Point;\n to: Point;\n } {\n if (this.from != this.to) {\n return {\n from: this._findBorderPosition(this.from, ctx),\n to: this._findBorderPosition(this.to, ctx),\n };\n } else {\n const [x, y] = this._getCircleData(ctx).slice(0, 2);\n\n return {\n from: this._findBorderPositionCircle(this.from, ctx, {\n x,\n y,\n low: 0.25,\n high: 0.6,\n direction: -1,\n }),\n to: this._findBorderPositionCircle(this.from, ctx, {\n x,\n y,\n low: 0.6,\n high: 0.8,\n direction: 1,\n }),\n };\n }\n }\n\n /**\n * Compute the center point and radius of an edge connected to the same node at both ends.\n *\n * @param ctx - The context that will be used for rendering.\n *\n * @returns `[x, y, radius]`\n */\n protected _getCircleData(\n ctx?: CanvasRenderingContext2D\n ): [number, number, number] {\n const radius = this.options.selfReference.size;\n\n if (ctx !== undefined) {\n if (this.from.shape.width === undefined) {\n this.from.shape.resize(ctx);\n }\n }\n\n // get circle coordinates\n const coordinates = getSelfRefCoordinates(\n ctx,\n this.options.selfReference.angle,\n radius,\n this.from\n );\n\n return [coordinates.x, coordinates.y, radius];\n }\n\n /**\n * Get a point on a circle.\n *\n * @param x - Center of the circle on the x axis.\n * @param y - Center of the circle on the y axis.\n * @param radius - Radius of the circle.\n * @param position - Value between 0 (line start) and 1 (line end).\n *\n * @returns Cartesian coordinates of requested point on the circle.\n */\n private _pointOnCircle(\n x: number,\n y: number,\n radius: number,\n position: number\n ): Point {\n const angle = position * 2 * Math.PI;\n return {\n x: x + radius * Math.cos(angle),\n y: y - radius * Math.sin(angle),\n };\n }\n\n /**\n * Find the intersection between the border of the node and the edge.\n *\n * @remarks\n * This function uses binary search to look for the point where the circle crosses the border of the node.\n *\n * @param nearNode - The node (either from or to node of the edge).\n * @param ctx - The context that will be used for rendering.\n * @param options - Additional options.\n *\n * @returns Cartesian coordinates of the intersection between the border of the node and the edge.\n */\n private _findBorderPositionCircle(\n nearNode: VNode,\n ctx: CanvasRenderingContext2D,\n options: FindBorderPositionCircleOptions\n ): PointT {\n const x = options.x;\n const y = options.y;\n let low = options.low;\n let high = options.high;\n const direction = options.direction;\n\n const maxIterations = 10;\n const radius = this.options.selfReference.size;\n const threshold = 0.05;\n let pos: Point;\n\n let middle = (low + high) * 0.5;\n\n let endPointOffset = 0;\n if (this.options.arrowStrikethrough === true) {\n if (direction === -1) {\n endPointOffset = this.options.endPointOffset.from;\n } else if (direction === 1) {\n endPointOffset = this.options.endPointOffset.to;\n }\n }\n\n let iteration = 0;\n do {\n middle = (low + high) * 0.5;\n\n pos = this._pointOnCircle(x, y, radius, middle);\n const angle = Math.atan2(nearNode.y - pos.y, nearNode.x - pos.x);\n\n const distanceToBorder =\n nearNode.distanceToBorder(ctx, angle) + endPointOffset;\n\n const distanceToPoint = Math.sqrt(\n Math.pow(pos.x - nearNode.x, 2) + Math.pow(pos.y - nearNode.y, 2)\n );\n const difference = distanceToBorder - distanceToPoint;\n if (Math.abs(difference) < threshold) {\n break; // found\n } else if (difference > 0) {\n // distance to nodes is larger than distance to border --> t needs to be bigger if we're looking at the to node.\n if (direction > 0) {\n low = middle;\n } else {\n high = middle;\n }\n } else {\n if (direction > 0) {\n high = middle;\n } else {\n low = middle;\n }\n }\n\n ++iteration;\n } while (low <= high && iteration < maxIterations);\n\n return {\n ...pos,\n t: middle,\n };\n }\n\n /**\n * Get the line width of the edge. Depends on width and whether one of the connected nodes is selected.\n *\n * @param selected - Determines wheter the line is selected.\n * @param hover - Determines wheter the line is being hovered, only applies if selected is false.\n *\n * @returns The width of the line.\n */\n public getLineWidth(selected: boolean, hover: boolean): number {\n if (selected === true) {\n return Math.max(this.selectionWidth, 0.3 / this._body.view.scale);\n } else if (hover === true) {\n return Math.max(this.hoverWidth, 0.3 / this._body.view.scale);\n } else {\n return Math.max(this.options.width, 0.3 / this._body.view.scale);\n }\n }\n\n /**\n * Compute the color or gradient for given edge.\n *\n * @param ctx - The context that will be used for rendering.\n * @param values - Formatting values like color, opacity or shadow.\n * @param _selected - Ignored (TODO: remove in the future).\n * @param _hover - Ignored (TODO: remove in the future).\n *\n * @returns Color string if single color is inherited or gradient if two.\n */\n public getColor(\n ctx: CanvasRenderingContext2D,\n values: SelectiveRequired<EdgeFormattingValues, \"color\" | \"opacity\">\n ): string | CanvasGradient {\n if (values.inheritsColor !== false) {\n // when this is a loop edge, just use the 'from' method\n if (values.inheritsColor === \"both\" && this.from.id !== this.to.id) {\n const grd = ctx.createLinearGradient(\n this.from.x,\n this.from.y,\n this.to.x,\n this.to.y\n );\n let fromColor = this.from.options.color.highlight.border;\n let toColor = this.to.options.color.highlight.border;\n\n if (this.from.selected === false && this.to.selected === false) {\n fromColor = overrideOpacity(\n this.from.options.color.border,\n values.opacity\n );\n toColor = overrideOpacity(\n this.to.options.color.border,\n values.opacity\n );\n } else if (this.from.selected === true && this.to.selected === false) {\n toColor = this.to.options.color.border;\n } else if (this.from.selected === false && this.to.selected === true) {\n fromColor = this.from.options.color.border;\n }\n grd.addColorStop(0, fromColor);\n grd.addColorStop(1, toColor);\n\n // -------------------- this returns -------------------- //\n return grd;\n }\n\n if (values.inheritsColor === \"to\") {\n return overrideOpacity(this.to.options.color.border, values.opacity);\n } else {\n // \"from\"\n return overrideOpacity(this.from.options.color.border, values.opacity);\n }\n } else {\n return overrideOpacity(values.color, values.opacity);\n }\n }\n\n /**\n * Draw a line from a node to itself, a circle.\n *\n * @param ctx - The context that will be used for rendering.\n * @param values - Formatting values like color, opacity or shadow.\n * @param x - Center of the circle on the x axis.\n * @param y - Center of the circle on the y axis.\n * @param radius - Radius of the circle.\n */\n private _circle(\n ctx: CanvasRenderingContext2D,\n values: SelectiveRequired<\n EdgeFormattingValues,\n \"shadowColor\" | \"shadowSize\" | \"shadowX\" | \"shadowY\"\n >,\n x: number,\n y: number,\n radius: number\n ): void {\n // draw shadow if enabled\n this.enableShadow(ctx, values);\n\n //full circle\n let angleFrom = 0;\n let angleTo = Math.PI * 2;\n\n if (!this.options.selfReference.renderBehindTheNode) {\n //render only parts which are not overlaping with parent node\n //need to find x,y of from point and x,y to point\n //calculating radians\n const low = this.options.selfReference.angle;\n const high = this.options.selfReference.angle + Math.PI;\n const pointTFrom = this._findBorderPositionCircle(this.from, ctx, {\n x,\n y,\n low,\n high,\n direction: -1,\n });\n const pointTTo = this._findBorderPositionCircle(this.from, ctx, {\n x,\n y,\n low,\n high,\n direction: 1,\n });\n angleFrom = Math.atan2(pointTFrom.y - y, pointTFrom.x - x);\n angleTo = Math.atan2(pointTTo.y - y, pointTTo.x - x);\n }\n\n // draw a circle\n ctx.beginPath();\n ctx.arc(x, y, radius, angleFrom, angleTo, false);\n ctx.stroke();\n\n // disable shadows for other elements.\n this.disableShadow(ctx, values);\n }\n\n /**\n * @inheritDoc\n *\n * @remarks\n * http://stackoverflow.com/questions/849211/shortest-distancae-between-a-point-and-a-line-segment\n */\n public getDistanceToEdge(\n x1: number,\n y1: number,\n x2: number,\n y2: number,\n x3: number,\n y3: number\n ): number {\n if (this.from != this.to) {\n return this._getDistanceToEdge(x1, y1, x2, y2, x3, y3);\n } else {\n const [x, y, radius] = this._getCircleData(undefined);\n const dx = x - x3;\n const dy = y - y3;\n return Math.abs(Math.sqrt(dx * dx + dy * dy) - radius);\n }\n }\n\n /**\n * Calculate the distance between a point (x3, y3) and a line segment from (x1, y1) to (x2, y2).\n *\n * @remarks\n * http://stackoverflow.com/questions/849211/shortest-distancae-between-a-point-and-a-line-segment\n *\n * @param x1 - First end of the line segment on the x axis.\n * @param y1 - First end of the line segment on the y axis.\n * @param x2 - Second end of the line segment on the x axis.\n * @param y2 - Second end of the line segment on the y axis.\n * @param x3 - Position of the point on the x axis.\n * @param y3 - Position of the point on the y axis.\n * @param via - Additional control point(s) for the edge.\n *\n * @returns The distance between the line segment and the point.\n */\n protected abstract _getDistanceToEdge(\n x1: number,\n y1: number,\n x2: number,\n y2: number,\n x3: number,\n y3: number,\n via?: Via\n ): number;\n\n /**\n * Calculate the distance between a point (x3, y3) and a line segment from (x1, y1) to (x2, y2).\n *\n * @param x1 - First end of the line segment on the x axis.\n * @param y1 - First end of the line segment on the y axis.\n * @param x2 - Second end of the line segment on the x axis.\n * @param y2 - Second end of the line segment on the y axis.\n * @param x3 - Position of the point on the x axis.\n * @param y3 - Position of the point on the y axis.\n *\n * @returns The distance between the line segment and the point.\n */\n protected _getDistanceToLine(\n x1: number,\n y1: number,\n x2: number,\n y2: number,\n x3: number,\n y3: number\n ): number {\n const px = x2 - x1;\n const py = y2 - y1;\n const something = px * px + py * py;\n let u = ((x3 - x1) * px + (y3 - y1) * py) / something;\n\n if (u > 1) {\n u = 1;\n } else if (u < 0) {\n u = 0;\n }\n\n const x = x1 + u * px;\n const y = y1 + u * py;\n const dx = x - x3;\n const dy = y - y3;\n\n //# Note: If the actual distance does not matter,\n //# if you only want to compare what this function\n //# returns to other results of this function, you\n //# can just return the squared distance instead\n //# (i.e. remove the sqrt) to gain a little performance\n\n return Math.sqrt(dx * dx + dy * dy);\n }\n\n /** @inheritDoc */\n public getArrowData(\n ctx: CanvasRenderingContext2D,\n position: \"middle\",\n viaNode: VNode,\n selected: boolean,\n hover: boolean,\n values: SelectiveRequired<\n EdgeFormattingValues,\n \"middleArrowType\" | \"middleArrowScale\" | \"width\"\n >\n ): ArrowDataWithCore;\n /** @inheritDoc */\n public getArrowData(\n ctx: CanvasRenderingContext2D,\n position: \"to\",\n viaNode: VNode,\n selected: boolean,\n hover: boolean,\n values: SelectiveRequired<\n EdgeFormattingValues,\n \"toArrowType\" | \"toArrowScale\" | \"width\"\n >\n ): ArrowDataWithCore;\n /** @inheritDoc */\n public getArrowData(\n ctx: CanvasRenderingContext2D,\n position: \"from\",\n viaNode: VNode,\n selected: boolean,\n hover: boolean,\n values: SelectiveRequired<\n EdgeFormattingValues,\n \"fromArrowType\" | \"fromArrowScale\" | \"width\"\n >\n ): ArrowDataWithCore;\n /** @inheritDoc */\n public getArrowData(\n ctx: CanvasRenderingContext2D,\n position: \"from\" | \"to\" | \"middle\",\n viaNode: VNode,\n _selected: boolean,\n _hover: boolean,\n values: SelectiveRequired<EdgeFormattingValues, \"width\">\n ): ArrowDataWithCore {\n // set lets\n let angle: number;\n let arrowPoint: Point;\n let node1: VNode;\n let node2: VNode;\n let reversed: boolean;\n let scaleFactor: number;\n let type: ArrowType;\n const lineWidth: number = values.width;\n\n if (position === \"from\") {\n node1 = this.from;\n node2 = this.to;\n reversed = values.fromArrowScale! < 0;\n scaleFactor = Math.abs(values.fromArrowScale!);\n type = values.fromArrowType!;\n } else if (position === \"to\") {\n node1 = this.to;\n node2 = this.from;\n reversed = values.toArrowScale! < 0;\n scaleFactor = Math.abs(values.toArrowScale!);\n type = values.toArrowType!;\n } else {\n node1 = this.to;\n node2 = this.from;\n reversed = values.middleArrowScale! < 0;\n scaleFactor = Math.abs(values.middleArrowScale!);\n type = values.middleArrowType!;\n }\n\n const length = 15 * scaleFactor + 3 * lineWidth; // 3* lineWidth is the width of the edge.\n\n // if not connected to itself\n if (node1 != node2) {\n const approximateEdgeLength = Math.hypot(\n node1.x - node2.x,\n node1.y - node2.y\n );\n const relativeLength = length / approximateEdgeLength;\n\n if (position !== \"middle\") {\n // draw arrow head\n if (this.options.smooth.enabled === true) {\n const pointT = this._findBorderPosition(node1, ctx, { via: viaNode });\n const guidePos = this.getPoint(\n pointT.t + relativeLength * (position === \"from\" ? 1 : -1),\n viaNode\n );\n angle = Math.atan2(pointT.y - guidePos.y, pointT.x - guidePos.x);\n arrowPoint = pointT;\n } else {\n angle = Math.atan2(node1.y - node2.y, node1.x - node2.x);\n arrowPoint = this._findBorderPosition(node1, ctx);\n }\n } else {\n // Negative half length reverses arrow direction.\n const halfLength = (reversed ? -relativeLength : relativeLength) / 2;\n const guidePos1 = this.getPoint(0.5 + halfLength, viaNode);\n const guidePos2 = this.getPoint(0.5 - halfLength, viaNode);\n angle = Math.atan2(\n guidePos1.y - guidePos2.y,\n guidePos1.x - guidePos2.x\n );\n arrowPoint = this.getPoint(0.5, viaNode);\n }\n } else {\n // draw circle\n const [x, y, radius] = this._getCircleData(ctx);\n\n if (position === \"from\") {\n const low = this.options.selfReference.angle;\n const high = this.options.selfReference.angle + Math.PI;\n\n const pointT = this._findBorderPositionCircle(this.from, ctx, {\n x,\n y,\n low,\n high,\n direction: -1,\n });\n angle = pointT.t * -2 * Math.PI + 1.5 * Math.PI + 0.1 * Math.PI;\n arrowPoint = pointT;\n } else if (position === \"to\") {\n const low = this.options.selfReference.angle;\n const high = this.options.selfReference.angle + Math.PI;\n\n const pointT = this._findBorderPositionCircle(this.from, ctx, {\n x,\n y,\n low,\n high,\n direction: 1,\n });\n angle = pointT.t * -2 * Math.PI + 1.5 * Math.PI - 1.1 * Math.PI;\n arrowPoint = pointT;\n } else {\n const pos = this.options.selfReference.angle / (2 * Math.PI);\n arrowPoint = this._pointOnCircle(x, y, radius, pos);\n angle = pos * -2 * Math.PI + 1.5 * Math.PI + 0.1 * Math.PI;\n }\n }\n\n const xi = arrowPoint.x - length * 0.9 * Math.cos(angle);\n const yi = arrowPoint.y - length * 0.9 * Math.sin(angle);\n const arrowCore = { x: xi, y: yi };\n\n return {\n point: arrowPoint,\n core: arrowCore,\n angle: angle,\n length: length,\n type: type,\n };\n }\n\n /** @inheritDoc */\n public drawArrowHead(\n ctx: CanvasRenderingContext2D,\n values: SelectiveRequired<\n EdgeFormattingValues,\n | \"color\"\n | \"opacity\"\n | \"shadowColor\"\n | \"shadowSize\"\n | \"shadowX\"\n | \"shadowY\"\n | \"width\"\n >,\n _selected: boolean,\n _hover: boolean,\n arrowData: ArrowData\n ): void {\n // set style\n ctx.strokeStyle = this.getColor(ctx, values);\n ctx.fillStyle = ctx.strokeStyle;\n ctx.lineWidth = values.width;\n\n const canFill = EndPoints.draw(ctx, arrowData);\n\n if (canFill) {\n // draw shadow if enabled\n this.enableShadow(ctx, values);\n ctx.fill();\n // disable shadows for other elements.\n this.disableShadow(ctx, values);\n }\n }\n\n /**\n * Set the shadow formatting values in the context if enabled, do nothing otherwise.\n *\n * @param ctx - The context that will be used for rendering.\n * @param values - Formatting values for the shadow.\n */\n public enableShadow(\n ctx: CanvasRenderingContext2D,\n values: SelectiveRequired<\n EdgeFormattingValues,\n \"shadowColor\" | \"shadowSize\" | \"shadowX\" | \"shadowY\"\n >\n ): void {\n if (values.shadow === true) {\n ctx.shadowColor = values.shadowColor;\n ctx.shadowBlur = values.shadowSize;\n ctx.shadowOffsetX = values.shadowX;\n ctx.shadowOffsetY = values.shadowY;\n }\n }\n\n /**\n * Reset the shadow formatting values in the context if enabled, do nothing otherwise.\n *\n * @param ctx - The context that will be used for rendering.\n * @param values - Formatting values for the shadow.\n */\n public disableShadow(\n ctx: CanvasRenderingContext2D,\n values: EdgeFormattingValues\n ): void {\n if (values.shadow === true) {\n ctx.shadowColor = \"rgba(0,0,0,0)\";\n ctx.shadowBlur = 0;\n ctx.shadowOffsetX = 0;\n ctx.shadowOffsetY = 0;\n }\n }\n\n /**\n * Render the background according to the formatting values.\n *\n * @param ctx - The context that will be used for rendering.\n * @param values - Formatting values for the background.\n */\n public drawBackground(\n ctx: CanvasRenderingContext2D,\n values: SelectiveRequired<\n EdgeFormattingValues,\n \"backgroundColor\" | \"backgroundSize\"\n >\n ): void {\n if (values.background !== false) {\n // save original line attrs\n const origCtxAttr = {\n strokeStyle: ctx.strokeStyle,\n lineWidth: ctx.lineWidth,\n dashes: (ctx as any).dashes,\n };\n\n ctx.strokeStyle = values.backgroundColor;\n ctx.lineWidth = values.backgroundSize;\n this.setStrokeDashed(ctx, values.backgroundDashes);\n\n ctx.stroke();\n\n // restore original line attrs\n ctx.strokeStyle = origCtxAttr.strokeStyle;\n ctx.lineWidth = origCtxAttr.lineWidth;\n (ctx as any).dashes = origCtxAttr.dashes;\n this.setStrokeDashed(ctx, values.dashes);\n }\n }\n\n /**\n * Set the line dash pattern if supported. Logs a warning to the console if it isn't supported.\n *\n * @param ctx - The context that will be used for rendering.\n * @param dashes - The pattern [line, space, line…], true for default dashed line or false for normal line.\n */\n public setStrokeDashed(\n ctx: CanvasRenderingContext2D,\n dashes?: boolean | number[]\n ): void {\n if (dashes !== false) {\n if (ctx.setLineDash !== undefined) {\n const pattern = Array.isArray(dashes) ? dashes : [5, 5];\n ctx.setLineDash(pattern);\n } else {\n console.warn(\n \"setLineDash is not supported in this browser. The dashed stroke cannot be used.\"\n );\n }\n } else {\n if (ctx.setLineDash !== undefined) {\n ctx.setLineDash([]);\n } else {\n console.warn(\n \"setLineDash is not supported in this browser. The dashed stroke cannot be used.\"\n );\n }\n }\n }\n}\n","import { EdgeBase } from \"./edge-base\";\nimport {\n EdgeFormattingValues,\n Label,\n EdgeOptions,\n Point,\n PointT,\n SelectiveRequired,\n VBody,\n VNode,\n} from \"./types\";\n\n/**\n * The Base Class for all Bezier edges.\n * Bezier curves are used to model smooth gradual curves in paths between nodes.\n */\nexport abstract class BezierEdgeBase<Via> extends EdgeBase<Via> {\n /**\n * Create a new instance.\n *\n * @param options - The options object of given edge.\n * @param body - The body of the network.\n * @param labelModule - Label module.\n */\n public constructor(options: EdgeOptions, body: VBody, labelModule: Label) {\n super(options, body, labelModule);\n }\n\n /**\n * Compute additional point(s) the edge passes through.\n *\n * @returns Cartesian coordinates of the point(s) the edge passes through.\n */\n protected abstract _getViaCoordinates(): Via;\n\n /**\n * Find the intersection between the border of the node and the edge.\n *\n * @remarks\n * This function uses binary search to look for the point where the bezier curve crosses the border of the node.\n *\n * @param nearNode - The node (either from or to node of the edge).\n * @param ctx - The context that will be used for rendering.\n * @param viaNode - Additional node(s) the edge passes through.\n *\n * @returns Cartesian coordinates of the intersection between the border of the node and the edge.\n */\n protected _findBorderPositionBezier(\n nearNode: VNode,\n ctx: CanvasRenderingContext2D,\n viaNode: Via = this._getViaCoordinates()\n ): PointT {\n const maxIterations = 10;\n const threshold = 0.2;\n let from = false;\n let high = 1;\n let low = 0;\n let node = this.to;\n let pos: Point;\n let middle: number;\n\n let endPointOffset = this.options.endPointOffset\n ? this.options.endPointOffset.to\n : 0;\n\n if (nearNode.id === this.from.id) {\n node = this.from;\n from = true;\n\n endPointOffset = this.options.endPointOffset\n ? this.options.endPointOffset.from\n : 0;\n }\n\n if (this.options.arrowStrikethrough === false) {\n endPointOffset = 0;\n }\n\n let iteration = 0;\n do {\n middle = (low + high) * 0.5;\n\n pos = this.getPoint(middle, viaNode);\n const angle = Math.atan2(node.y - pos.y, node.x - pos.x);\n\n const distanceToBorder =\n node.distanceToBorder(ctx, angle) + endPointOffset;\n\n const distanceToPoint = Math.sqrt(\n Math.pow(pos.x - node.x, 2) + Math.pow(pos.y - node.y, 2)\n );\n const difference = distanceToBorder - distanceToPoint;\n if (Math.abs(difference) < threshold) {\n break; // found\n } else if (difference < 0) {\n // distance to nodes is larger than distance to border --> t needs to be bigger if we're looking at the to node.\n if (from === false) {\n low = middle;\n } else {\n high = middle;\n }\n } else {\n if (from === false) {\n high = middle;\n } else {\n low = middle;\n }\n }\n\n ++iteration;\n } while (low <= high && iteration < maxIterations);\n\n return {\n ...pos,\n t: middle,\n };\n }\n\n /**\n * Calculate the distance between a point (x3,y3) and a line segment from (x1,y1) to (x2,y2).\n *\n * @remarks\n * http://stackoverflow.com/questions/849211/shortest-distancae-between-a-point-and-a-line-segment\n *\n * @param x1 - First end of the line segment on the x axis.\n * @param y1 - First end of the line segment on the y axis.\n * @param x2 - Second end of the line segment on the x axis.\n * @param y2 - Second end of the line segment on the y axis.\n * @param x3 - Position of the point on the x axis.\n * @param y3 - Position of the point on the y axis.\n * @param via - The control point for the edge.\n *\n * @returns The distance between the line segment and the point.\n */\n protected _getDistanceToBezierEdge(\n x1: number,\n y1: number,\n x2: number,\n y2: number,\n x3: number,\n y3: number,\n via: Point\n ): number {\n // x3,y3 is the point\n let minDistance = 1e9;\n let distance;\n let i, t, x, y;\n let lastX = x1;\n let lastY = y1;\n for (i = 1; i < 10; i++) {\n t = 0.1 * i;\n x =\n Math.pow(1 - t, 2) * x1 + 2 * t * (1 - t) * via.x + Math.pow(t, 2) * x2;\n y =\n Math.pow(1 - t, 2) * y1 + 2 * t * (1 - t) * via.y + Math.pow(t, 2) * y2;\n if (i > 0) {\n distance = this._getDistanceToLine(lastX, lastY, x, y, x3, y3);\n minDistance = distance < minDistance ? distance : minDistance;\n }\n lastX = x;\n lastY = y;\n }\n\n return minDistance;\n }\n\n /**\n * Render a bezier curve between two nodes.\n *\n * @remarks\n * The method accepts zero, one or two control points.\n * Passing zero control points just draws a straight line.\n *\n * @param ctx - The context that will be used for rendering.\n * @param values - Style options for edge drawing.\n * @param viaNode1 - First control point for curve drawing.\n * @param viaNode2 - Second control point for curve drawing.\n */\n protected _bezierCurve(\n ctx: CanvasRenderingContext2D,\n values: SelectiveRequired<\n EdgeFormattingValues,\n | \"backgroundColor\"\n | \"backgroundSize\"\n | \"shadowColor\"\n | \"shadowSize\"\n | \"shadowX\"\n | \"shadowY\"\n >,\n viaNode1?: Point,\n viaNode2?: Point\n ): void {\n ctx.beginPath();\n ctx.moveTo(this.fromPoint.x, this.fromPoint.y);\n\n if (viaNode1 != null && viaNode1.x != null) {\n if (viaNode2 != null && viaNode2.x != null) {\n ctx.bezierCurveTo(\n viaNode1.x,\n viaNode1.y,\n viaNode2.x,\n viaNode2.y,\n this.toPoint.x,\n this.toPoint.y\n );\n } else {\n ctx.quadraticCurveTo(\n viaNode1.x,\n viaNode1.y,\n this.toPoint.x,\n this.toPoint.y\n );\n }\n } else {\n // fallback to normal straight edge\n ctx.lineTo(this.toPoint.x, this.toPoint.y);\n }\n\n // draw a background\n this.drawBackground(ctx, values);\n\n // draw shadow if enabled\n this.enableShadow(ctx, values);\n ctx.stroke();\n this.disableShadow(ctx, values);\n }\n\n /** @inheritDoc */\n public getViaNode(): Via {\n return this._getViaCoordinates();\n }\n}\n","import { BezierEdgeBase } from \"./util/bezier-edge-base\";\nimport {\n EdgeFormattingValues,\n Label,\n EdgeOptions,\n Point,\n PointT,\n SelectiveRequired,\n VBody,\n VNode,\n} from \"./util/types\";\n\n/**\n * A Dynamic Bezier Edge. Bezier curves are used to model smooth gradual\n * curves in paths between nodes. The Dynamic piece refers to how the curve\n * reacts to physics changes.\n *\n * @augments BezierEdgeBase\n */\nexport class BezierEdgeDynamic extends BezierEdgeBase<Point> {\n public via: VNode = this.via; // constructor → super → super → setOptions → setupSupportNode\n private readonly _boundFunction: () => void;\n\n /**\n * Create a new instance.\n *\n * @param options - The options object of given edge.\n * @param body - The body of the network.\n * @param labelModule - Label module.\n */\n public constructor(options: EdgeOptions, body: VBody, labelModule: Label) {\n //this.via = undefined; // Here for completeness but not allowed to defined before super() is invoked.\n super(options, body, labelModule); // --> this calls the setOptions below\n this._boundFunction = (): void => {\n this.positionBezierNode();\n };\n this._body.emitter.on(\"_repositionBezierNodes\", this._boundFunction);\n }\n\n /** @inheritDoc */\n public setOptions(options: EdgeOptions): void {\n super.setOptions(options);\n\n // check if the physics has changed.\n let physicsChange = false;\n if (this.options.physics !== options.physics) {\n physicsChange = true;\n }\n\n // set the options and the to and from nodes\n this.options = options;\n this.id = this.options.id;\n this.from = this._body.nodes[this.options.from];\n this.to = this._body.nodes[this.options.to];\n\n // setup the support node and connect\n this.setupSupportNode();\n this.connect();\n\n // when we change the physics state of the edge, we reposition the support node.\n if (physicsChange === true) {\n this.via.setOptions({ physics: this.options.physics });\n this.positionBezierNode();\n }\n }\n\n /** @inheritDoc */\n public connect(): void {\n this.from = this._body.nodes[this.options.from];\n this.to = this._body.nodes[this.options.to];\n if (\n this.from === undefined ||\n this.to === undefined ||\n this.options.physics === false\n ) {\n this.via.setOptions({ physics: false });\n } else {\n // fix weird behaviour where a self referencing node has physics enabled\n if (this.from.id === this.to.id) {\n this.via.setOptions({ physics: false });\n } else {\n this.via.setOptions({ physics: true });\n }\n }\n }\n\n /** @inheritDoc */\n public cleanup(): boolean {\n this._body.emitter.off(\"_repositionBezierNodes\", this._boundFunction);\n if (this.via !== undefined) {\n delete this._body.nodes[this.via.id];\n this.via = undefined;\n return true;\n }\n return false;\n }\n\n /**\n * Create and add a support node if not already present.\n *\n * @remarks\n * Bezier curves require an anchor point to calculate the smooth flow.\n * These points are nodes.\n * These nodes are invisible but are used for the force calculation.\n *\n * The changed data is not called, if needed, it is returned by the main edge constructor.\n */\n public setupSupportNode(): void {\n if (this.via === undefined) {\n const nodeId = \"edgeId:\" + this.id;\n const node = this._body.functions.createNode({\n id: nodeId,\n shape: \"circle\",\n physics: true,\n hidden: true,\n });\n this._body.nodes[nodeId] = node;\n this.via = node;\n this.via.parentEdgeId = this.id;\n this.positionBezierNode();\n }\n }\n\n /**\n * Position bezier node.\n */\n public positionBezierNode(): void {\n if (\n this.via !== undefined &&\n this.from !== undefined &&\n this.to !== undefined\n ) {\n this.via.x = 0.5 * (this.from.x + this.to.x);\n this.via.y = 0.5 * (this.from.y + this.to.y);\n } else if (this.via !== undefined) {\n this.via.x = 0;\n this.via.y = 0;\n }\n }\n\n /** @inheritDoc */\n protected _line(\n ctx: CanvasRenderingContext2D,\n values: SelectiveRequired<\n EdgeFormattingValues,\n | \"backgroundColor\"\n | \"backgroundSize\"\n | \"shadowColor\"\n | \"shadowSize\"\n | \"shadowX\"\n | \"shadowY\"\n >,\n viaNode: VNode\n ): void {\n this._bezierCurve(ctx, values, viaNode);\n }\n\n /** @inheritDoc */\n protected _getViaCoordinates(): Point {\n return this.via;\n }\n\n /** @inheritDoc */\n public getViaNode(): Point {\n return this.via;\n }\n\n /** @inheritDoc */\n public getPoint(position: number, viaNode: Point = this.via): Point {\n if (this.from === this.to) {\n const [cx, cy, cr] = this._getCircleData();\n const a = 2 * Math.PI * (1 - position);\n return {\n x: cx + cr * Math.sin(a),\n y: cy + cr - cr * (1 - Math.cos(a)),\n };\n } else {\n return {\n x:\n Math.pow(1 - position, 2) * this.fromPoint.x +\n 2 * position * (1 - position) * viaNode.x +\n Math.pow(position, 2) * this.toPoint.x,\n y:\n Math.pow(1 - position, 2) * this.fromPoint.y +\n 2 * position * (1 - position) * viaNode.y +\n Math.pow(position, 2) * this.toPoint.y,\n };\n }\n }\n\n /** @inheritDoc */\n protected _findBorderPosition(\n nearNode: VNode,\n ctx: CanvasRenderingContext2D\n ): PointT {\n return this._findBorderPositionBezier(nearNode, ctx, this.via);\n }\n\n /** @inheritDoc */\n protected _getDistanceToEdge(\n x1: number,\n y1: number,\n x2: number,\n y2: number,\n x3: number,\n y3: number\n ): number {\n // x3,y3 is the point\n return this._getDistanceToBezierEdge(x1, y1, x2, y2, x3, y3, this.via);\n }\n}\n","import { BezierEdgeBase } from \"./util/bezier-edge-base\";\nimport {\n EdgeFormattingValues,\n Label,\n EdgeOptions,\n Point,\n PointT,\n SelectiveRequired,\n VBody,\n VNode,\n} from \"./util/types\";\n\n/**\n * A Static Bezier Edge. Bezier curves are used to model smooth gradual curves in paths between nodes.\n */\nexport class BezierEdgeStatic extends BezierEdgeBase<Point> {\n /**\n * Create a new instance.\n *\n * @param options - The options object of given edge.\n * @param body - The body of the network.\n * @param labelModule - Label module.\n */\n public constructor(options: EdgeOptions, body: VBody, labelModule: Label) {\n super(options, body, labelModule);\n }\n\n /** @inheritDoc */\n protected _line(\n ctx: CanvasRenderingContext2D,\n values: SelectiveRequired<\n EdgeFormattingValues,\n | \"backgroundColor\"\n | \"backgroundSize\"\n | \"shadowColor\"\n | \"shadowSize\"\n | \"shadowX\"\n | \"shadowY\"\n >,\n viaNode: Point\n ): void {\n this._bezierCurve(ctx, values, viaNode);\n }\n\n /** @inheritDoc */\n public getViaNode(): Point {\n return this._getViaCoordinates();\n }\n\n /**\n * Compute the coordinates of the via node.\n *\n * @remarks\n * We do not use the to and fromPoints here to make the via nodes the same as edges without arrows.\n *\n * @returns Cartesian coordinates of the via node.\n */\n protected _getViaCoordinates(): Point {\n // Assumption: x/y coordinates in from/to always defined\n const factor = this.options.smooth.roundness;\n const type = this.options.smooth.type;\n let dx = Math.abs(this.from.x - this.to.x);\n let dy = Math.abs(this.from.y - this.to.y);\n if (type === \"discrete\" || type === \"diagonalCross\") {\n let stepX;\n let stepY;\n\n if (dx <= dy) {\n stepX = stepY = factor * dy;\n } else {\n stepX = stepY = factor * dx;\n }\n\n if (this.from.x > this.to.x) {\n stepX = -stepX;\n }\n if (this.from.y >= this.to.y) {\n stepY = -stepY;\n }\n\n let xVia = this.from.x + stepX;\n let yVia = this.from.y + stepY;\n\n if (type === \"discrete\") {\n if (dx <= dy) {\n xVia = dx < factor * dy ? this.from.x : xVia;\n } else {\n yVia = dy < factor * dx ? this.from.y : yVia;\n }\n }\n\n return { x: xVia, y: yVia };\n } else if (type === \"straightCross\") {\n let stepX = (1 - factor) * dx;\n let stepY = (1 - factor) * dy;\n\n if (dx <= dy) {\n // up - down\n stepX = 0;\n if (this.from.y < this.to.y) {\n stepY = -stepY;\n }\n } else {\n // left - right\n if (this.from.x < this.to.x) {\n stepX = -stepX;\n }\n stepY = 0;\n }\n\n return {\n x: this.to.x + stepX,\n y: this.to.y + stepY,\n };\n } else if (type === \"horizontal\") {\n let stepX = (1 - factor) * dx;\n if (this.from.x < this.to.x) {\n stepX = -stepX;\n }\n\n return {\n x: this.to.x + stepX,\n y: this.from.y,\n };\n } else if (type === \"vertical\") {\n let stepY = (1 - factor) * dy;\n if (this.from.y < this.to.y) {\n stepY = -stepY;\n }\n\n return {\n x: this.from.x,\n y: this.to.y + stepY,\n };\n } else if (type === \"curvedCW\") {\n dx = this.to.x - this.from.x;\n dy = this.from.y - this.to.y;\n const radius = Math.sqrt(dx * dx + dy * dy);\n const pi = Math.PI;\n\n const originalAngle = Math.atan2(dy, dx);\n const myAngle = (originalAngle + (factor * 0.5 + 0.5) * pi) % (2 * pi);\n\n return {\n x: this.from.x + (factor * 0.5 + 0.5) * radius * Math.sin(myAngle),\n y: this.from.y + (factor * 0.5 + 0.5) * radius * Math.cos(myAngle),\n };\n } else if (type === \"curvedCCW\") {\n dx = this.to.x - this.from.x;\n dy = this.from.y - this.to.y;\n const radius = Math.sqrt(dx * dx + dy * dy);\n const pi = Math.PI;\n\n const originalAngle = Math.atan2(dy, dx);\n const myAngle = (originalAngle + (-factor * 0.5 + 0.5) * pi) % (2 * pi);\n\n return {\n x: this.from.x + (factor * 0.5 + 0.5) * radius * Math.sin(myAngle),\n y: this.from.y + (factor * 0.5 + 0.5) * radius * Math.cos(myAngle),\n };\n } else {\n // continuous\n let stepX;\n let stepY;\n\n if (dx <= dy) {\n stepX = stepY = factor * dy;\n } else {\n stepX = stepY = factor * dx;\n }\n\n if (this.from.x > this.to.x) {\n stepX = -stepX;\n }\n if (this.from.y >= this.to.y) {\n stepY = -stepY;\n }\n\n let xVia = this.from.x + stepX;\n let yVia = this.from.y + stepY;\n\n if (dx <= dy) {\n if (this.from.x <= this.to.x) {\n xVia = this.to.x < xVia ? this.to.x : xVia;\n } else {\n xVia = this.to.x > xVia ? this.to.x : xVia;\n }\n } else {\n if (this.from.y >= this.to.y) {\n yVia = this.to.y > yVia ? this.to.y : yVia;\n } else {\n yVia = this.to.y < yVia ? this.to.y : yVia;\n }\n }\n\n return { x: xVia, y: yVia };\n }\n }\n\n /** @inheritDoc */\n protected _findBorderPosition(\n nearNode: VNode,\n ctx: CanvasRenderingContext2D,\n options: { via?: Point } = {}\n ): PointT {\n return this._findBorderPositionBezier(nearNode, ctx, options.via);\n }\n\n /** @inheritDoc */\n protected _getDistanceToEdge(\n x1: number,\n y1: number,\n x2: number,\n y2: number,\n x3: number,\n y3: number,\n viaNode = this._getViaCoordinates()\n ) {\n // x3,y3 is the point\n return this._getDistanceToBezierEdge(x1, y1, x2, y2, x3, y3, viaNode);\n }\n\n /** @inheritDoc */\n public getPoint(\n position: number,\n viaNode: Point = this._getViaCoordinates()\n ): Point {\n const t = position;\n const x =\n Math.pow(1 - t, 2) * this.fromPoint.x +\n 2 * t * (1 - t) * viaNode.x +\n Math.pow(t, 2) * this.toPoint.x;\n const y =\n Math.pow(1 - t, 2) * this.fromPoint.y +\n 2 * t * (1 - t) * viaNode.y +\n Math.pow(t, 2) * this.toPoint.y;\n\n return { x: x, y: y };\n }\n}\n","import { BezierEdgeBase } from \"./bezier-edge-base\";\nimport { Label, EdgeOptions, Point, VBody } from \"./types\";\n\n/**\n * A Base Class for all Cubic Bezier Edges. Bezier curves are used to model\n * smooth gradual curves in paths between nodes.\n *\n * @augments BezierEdgeBase\n */\nexport abstract class CubicBezierEdgeBase<Via> extends BezierEdgeBase<Via> {\n /**\n * Create a new instance.\n *\n * @param options - The options object of given edge.\n * @param body - The body of the network.\n * @param labelModule - Label module.\n */\n public constructor(options: EdgeOptions, body: VBody, labelModule: Label) {\n super(options, body, labelModule);\n }\n\n /**\n * Calculate the distance between a point (x3,y3) and a line segment from (x1,y1) to (x2,y2).\n *\n * @remarks\n * http://stackoverflow.com/questions/849211/shortest-distancae-between-a-point-and-a-line-segment\n * https://en.wikipedia.org/wiki/B%C3%A9zier_curve\n *\n * @param x1 - First end of the line segment on the x axis.\n * @param y1 - First end of the line segment on the y axis.\n * @param x2 - Second end of the line segment on the x axis.\n * @param y2 - Second end of the line segment on the y axis.\n * @param x3 - Position of the point on the x axis.\n * @param y3 - Position of the point on the y axis.\n * @param via1 - The first point this edge passes through.\n * @param via2 - The second point this edge passes through.\n *\n * @returns The distance between the line segment and the point.\n */\n protected _getDistanceToBezierEdge2(\n x1: number,\n y1: number,\n x2: number,\n y2: number,\n x3: number,\n y3: number,\n via1: Point,\n via2: Point\n ): number {\n // x3,y3 is the point\n let minDistance = 1e9;\n let lastX = x1;\n let lastY = y1;\n const vec = [0, 0, 0, 0];\n for (let i = 1; i < 10; i++) {\n const t = 0.1 * i;\n vec[0] = Math.pow(1 - t, 3);\n vec[1] = 3 * t * Math.pow(1 - t, 2);\n vec[2] = 3 * Math.pow(t, 2) * (1 - t);\n vec[3] = Math.pow(t, 3);\n const x = vec[0] * x1 + vec[1] * via1.x + vec[2] * via2.x + vec[3] * x2;\n const y = vec[0] * y1 + vec[1] * via1.y + vec[2] * via2.y + vec[3] * y2;\n if (i > 0) {\n const distance = this._getDistanceToLine(lastX, lastY, x, y, x3, y3);\n minDistance = distance < minDistance ? distance : minDistance;\n }\n lastX = x;\n lastY = y;\n }\n\n return minDistance;\n }\n}\n","import { CubicBezierEdgeBase } from \"./util/cubic-bezier-edge-base\";\nimport {\n EdgeFormattingValues,\n Label,\n EdgeOptions,\n Point,\n PointT,\n SelectiveRequired,\n VBody,\n VNode,\n} from \"./util/types\";\n\n/**\n * A Cubic Bezier Edge. Bezier curves are used to model smooth gradual curves in paths between nodes.\n */\nexport class CubicBezierEdge extends CubicBezierEdgeBase<[Point, Point]> {\n /**\n * Create a new instance.\n *\n * @param options - The options object of given edge.\n * @param body - The body of the network.\n * @param labelModule - Label module.\n */\n public constructor(options: EdgeOptions, body: VBody, labelModule: Label) {\n super(options, body, labelModule);\n }\n\n /** @inheritDoc */\n protected _line(\n ctx: CanvasRenderingContext2D,\n values: SelectiveRequired<\n EdgeFormattingValues,\n | \"backgroundColor\"\n | \"backgroundSize\"\n | \"shadowColor\"\n | \"shadowSize\"\n | \"shadowX\"\n | \"shadowY\"\n >,\n viaNodes: [Point, Point]\n ): void {\n // get the coordinates of the support points.\n const via1 = viaNodes[0];\n const via2 = viaNodes[1];\n this._bezierCurve(ctx, values, via1, via2);\n }\n\n /**\n * Compute the additional points the edge passes through.\n *\n * @returns Cartesian coordinates of the points the edge passes through.\n */\n protected _getViaCoordinates(): [Point, Point] {\n const dx = this.from.x - this.to.x;\n const dy = this.from.y - this.to.y;\n\n let x1: number;\n let y1: number;\n let x2: number;\n let y2: number;\n const roundness = this.options.smooth.roundness;\n\n // horizontal if x > y or if direction is forced or if direction is horizontal\n if (\n (Math.abs(dx) > Math.abs(dy) ||\n this.options.smooth.forceDirection === true ||\n this.options.smooth.forceDirection === \"horizontal\") &&\n this.options.smooth.forceDirection !== \"vertical\"\n ) {\n y1 = this.from.y;\n y2 = this.to.y;\n x1 = this.from.x - roundness * dx;\n x2 = this.to.x + roundness * dx;\n } else {\n y1 = this.from.y - roundness * dy;\n y2 = this.to.y + roundness * dy;\n x1 = this.from.x;\n x2 = this.to.x;\n }\n\n return [\n { x: x1, y: y1 },\n { x: x2, y: y2 },\n ];\n }\n\n /** @inheritDoc */\n public getViaNode(): [Point, Point] {\n return this._getViaCoordinates();\n }\n\n /** @inheritDoc */\n protected _findBorderPosition(\n nearNode: VNode,\n ctx: CanvasRenderingContext2D\n ): PointT {\n return this._findBorderPositionBezier(nearNode, ctx);\n }\n\n /** @inheritDoc */\n protected _getDistanceToEdge(\n x1: number,\n y1: number,\n x2: number,\n y2: number,\n x3: number,\n y3: number,\n [via1, via2]: [Point, Point] = this._getViaCoordinates()\n ): number {\n // x3,y3 is the point\n return this._getDistanceToBezierEdge2(x1, y1, x2, y2, x3, y3, via1, via2);\n }\n\n /** @inheritDoc */\n public getPoint(\n position: number,\n [via1, via2]: [Point, Point] = this._getViaCoordinates()\n ): Point {\n const t = position;\n const vec: [number, number, number, number] = [\n Math.pow(1 - t, 3),\n 3 * t * Math.pow(1 - t, 2),\n 3 * Math.pow(t, 2) * (1 - t),\n Math.pow(t, 3),\n ];\n const x =\n vec[0] * this.fromPoint.x +\n vec[1] * via1.x +\n vec[2] * via2.x +\n vec[3] * this.toPoint.x;\n const y =\n vec[0] * this.fromPoint.y +\n vec[1] * via1.y +\n vec[2] * via2.y +\n vec[3] * this.toPoint.y;\n\n return { x: x, y: y };\n }\n}\n","import { EdgeBase } from \"./util/edge-base\";\nimport {\n EdgeFormattingValues,\n Label,\n EdgeOptions,\n Point,\n PointT,\n SelectiveRequired,\n VBody,\n VNode,\n} from \"./util/types\";\n\n/**\n * A Straight Edge.\n */\nexport class StraightEdge extends EdgeBase {\n /**\n * Create a new instance.\n *\n * @param options - The options object of given edge.\n * @param body - The body of the network.\n * @param labelModule - Label module.\n */\n public constructor(options: EdgeOptions, body: VBody, labelModule: Label) {\n super(options, body, labelModule);\n }\n\n /** @inheritDoc */\n protected _line(\n ctx: CanvasRenderingContext2D,\n values: SelectiveRequired<\n EdgeFormattingValues,\n \"shadowColor\" | \"shadowSize\" | \"shadowX\" | \"shadowY\"\n >\n ): void {\n // draw a straight line\n ctx.beginPath();\n ctx.moveTo(this.fromPoint.x, this.fromPoint.y);\n ctx.lineTo(this.toPoint.x, this.toPoint.y);\n // draw shadow if enabled\n this.enableShadow(ctx, values);\n ctx.stroke();\n this.disableShadow(ctx, values);\n }\n\n /** @inheritDoc */\n public getViaNode(): undefined {\n return undefined;\n }\n\n /** @inheritDoc */\n public getPoint(position: number): Point {\n return {\n x: (1 - position) * this.fromPoint.x + position * this.toPoint.x,\n y: (1 - position) * this.fromPoint.y + position * this.toPoint.y,\n };\n }\n\n /** @inheritDoc */\n protected _findBorderPosition(\n nearNode: VNode,\n ctx: CanvasRenderingContext2D\n ): PointT {\n let node1 = this.to;\n let node2 = this.from;\n if (nearNode.id === this.from.id) {\n node1 = this.from;\n node2 = this.to;\n }\n\n const angle = Math.atan2(node1.y - node2.y, node1.x - node2.x);\n const dx = node1.x - node2.x;\n const dy = node1.y - node2.y;\n const edgeSegmentLength = Math.sqrt(dx * dx + dy * dy);\n const toBorderDist = nearNode.distanceToBorder(ctx, angle);\n const toBorderPoint =\n (edgeSegmentLength - toBorderDist) / edgeSegmentLength;\n\n return {\n x: (1 - toBorderPoint) * node2.x + toBorderPoint * node1.x,\n y: (1 - toBorderPoint) * node2.y + toBorderPoint * node1.y,\n t: 0,\n };\n }\n\n /** @inheritDoc */\n protected _getDistanceToEdge(\n x1: number,\n y1: number,\n x2: number,\n y2: number,\n x3: number,\n y3: number\n ): number {\n // x3,y3 is the point\n return this._getDistanceToLine(x1, y1, x2, y2, x3, y3);\n }\n}\n","import {\n bridgeObject,\n deepExtend,\n isString,\n mergeOptions,\n selectiveDeepExtend,\n} from \"vis-util/esnext\";\nimport Label from \"./shared/Label\";\nimport {\n choosify,\n getSelfRefCoordinates,\n isValidLabel,\n pointInRect,\n} from \"./shared/ComponentUtil\";\nimport {\n BezierEdgeDynamic,\n BezierEdgeStatic,\n CubicBezierEdge,\n StraightEdge,\n} from \"./edges\";\n\n/**\n * An edge connects two nodes and has a specific direction.\n */\nclass Edge {\n /**\n * @param {object} options values specific to this edge, must contain at least 'from' and 'to'\n * @param {object} body shared state from Network instance\n * @param {Network.Images} imagelist A list with images. Only needed when the edge has image arrows.\n * @param {object} globalOptions options from the EdgesHandler instance\n * @param {object} defaultOptions default options from the EdgeHandler instance. Value and reference are constant\n */\n constructor(options, body, imagelist, globalOptions, defaultOptions) {\n if (body === undefined) {\n throw new Error(\"No body provided\");\n }\n\n // Since globalOptions is constant in values as well as reference,\n // Following needs to be done only once.\n\n this.options = bridgeObject(globalOptions);\n this.globalOptions = globalOptions;\n this.defaultOptions = defaultOptions;\n this.body = body;\n this.imagelist = imagelist;\n\n // initialize variables\n this.id = undefined;\n this.fromId = undefined;\n this.toId = undefined;\n this.selected = false;\n this.hover = false;\n this.labelDirty = true;\n\n this.baseWidth = this.options.width;\n this.baseFontSize = this.options.font.size;\n\n this.from = undefined; // a node\n this.to = undefined; // a node\n\n this.edgeType = undefined;\n\n this.connected = false;\n\n this.labelModule = new Label(\n this.body,\n this.options,\n true /* It's an edge label */\n );\n this.setOptions(options);\n }\n\n /**\n * Set or overwrite options for the edge\n *\n * @param {object} options an object with options\n * @returns {undefined|boolean} undefined if no options, true if layout affecting data changed, false otherwise.\n */\n setOptions(options) {\n if (!options) {\n return;\n }\n\n // Following options if changed affect the layout.\n let affectsLayout =\n (typeof options.physics !== \"undefined\" &&\n this.options.physics !== options.physics) ||\n (typeof options.hidden !== \"undefined\" &&\n (this.options.hidden || false) !== (options.hidden || false)) ||\n (typeof options.from !== \"undefined\" &&\n this.options.from !== options.from) ||\n (typeof options.to !== \"undefined\" && this.options.to !== options.to);\n\n Edge.parseOptions(this.options, options, true, this.globalOptions);\n\n if (options.id !== undefined) {\n this.id = options.id;\n }\n if (options.from !== undefined) {\n this.fromId = options.from;\n }\n if (options.to !== undefined) {\n this.toId = options.to;\n }\n if (options.title !== undefined) {\n this.title = options.title;\n }\n if (options.value !== undefined) {\n options.value = parseFloat(options.value);\n }\n\n const pile = [options, this.options, this.defaultOptions];\n this.chooser = choosify(\"edge\", pile);\n\n // update label Module\n this.updateLabelModule(options);\n\n // Update edge type, this if changed affects the layout.\n affectsLayout = this.updateEdgeType() || affectsLayout;\n\n // if anything has been updates, reset the selection width and the hover width\n this._setInteractionWidths();\n\n // A node is connected when it has a from and to node that both exist in the network.body.nodes.\n this.connect();\n\n return affectsLayout;\n }\n\n /**\n *\n * @param {object} parentOptions\n * @param {object} newOptions\n * @param {boolean} [allowDeletion=false]\n * @param {object} [globalOptions={}]\n * @param {boolean} [copyFromGlobals=false]\n */\n static parseOptions(\n parentOptions,\n newOptions,\n allowDeletion = false,\n globalOptions = {},\n copyFromGlobals = false\n ) {\n const fields = [\n \"endPointOffset\",\n \"arrowStrikethrough\",\n \"id\",\n \"from\",\n \"hidden\",\n \"hoverWidth\",\n \"labelHighlightBold\",\n \"length\",\n \"line\",\n \"opacity\",\n \"physics\",\n \"scaling\",\n \"selectionWidth\",\n \"selfReferenceSize\",\n \"selfReference\",\n \"to\",\n \"title\",\n \"value\",\n \"width\",\n \"font\",\n \"chosen\",\n \"widthConstraint\",\n ];\n\n // only deep extend the items in the field array. These do not have shorthand.\n selectiveDeepExtend(fields, parentOptions, newOptions, allowDeletion);\n\n // Only use endPointOffset values (from and to) if it's valid values\n if (\n newOptions.endPointOffset !== undefined &&\n newOptions.endPointOffset.from !== undefined\n ) {\n if (Number.isFinite(newOptions.endPointOffset.from)) {\n parentOptions.endPointOffset.from = newOptions.endPointOffset.from;\n } else {\n parentOptions.endPointOffset.from =\n globalOptions.endPointOffset.from !== undefined\n ? globalOptions.endPointOffset.from\n : 0;\n console.error(\"endPointOffset.from is not a valid number\");\n }\n }\n\n if (\n newOptions.endPointOffset !== undefined &&\n newOptions.endPointOffset.to !== undefined\n ) {\n if (Number.isFinite(newOptions.endPointOffset.to)) {\n parentOptions.endPointOffset.to = newOptions.endPointOffset.to;\n } else {\n parentOptions.endPointOffset.to =\n globalOptions.endPointOffset.to !== undefined\n ? globalOptions.endPointOffset.to\n : 0;\n console.error(\"endPointOffset.to is not a valid number\");\n }\n }\n\n // Only copy label if it's a legal value.\n if (isValidLabel(newOptions.label)) {\n parentOptions.label = newOptions.label;\n } else if (!isValidLabel(parentOptions.label)) {\n parentOptions.label = undefined;\n }\n\n mergeOptions(parentOptions, newOptions, \"smooth\", globalOptions);\n mergeOptions(parentOptions, newOptions, \"shadow\", globalOptions);\n mergeOptions(parentOptions, newOptions, \"background\", globalOptions);\n\n if (newOptions.dashes !== undefined && newOptions.dashes !== null) {\n parentOptions.dashes = newOptions.dashes;\n } else if (allowDeletion === true && newOptions.dashes === null) {\n parentOptions.dashes = Object.create(globalOptions.dashes); // this sets the pointer of the option back to the global option.\n }\n\n // set the scaling newOptions\n if (newOptions.scaling !== undefined && newOptions.scaling !== null) {\n if (newOptions.scaling.min !== undefined) {\n parentOptions.scaling.min = newOptions.scaling.min;\n }\n if (newOptions.scaling.max !== undefined) {\n parentOptions.scaling.max = newOptions.scaling.max;\n }\n mergeOptions(\n parentOptions.scaling,\n newOptions.scaling,\n \"label\",\n globalOptions.scaling\n );\n } else if (allowDeletion === true && newOptions.scaling === null) {\n parentOptions.scaling = Object.create(globalOptions.scaling); // this sets the pointer of the option back to the global option.\n }\n\n // handle multiple input cases for arrows\n if (newOptions.arrows !== undefined && newOptions.arrows !== null) {\n if (typeof newOptions.arrows === \"string\") {\n const arrows = newOptions.arrows.toLowerCase();\n parentOptions.arrows.to.enabled = arrows.indexOf(\"to\") != -1;\n parentOptions.arrows.middle.enabled = arrows.indexOf(\"middle\") != -1;\n parentOptions.arrows.from.enabled = arrows.indexOf(\"from\") != -1;\n } else if (typeof newOptions.arrows === \"object\") {\n mergeOptions(\n parentOptions.arrows,\n newOptions.arrows,\n \"to\",\n globalOptions.arrows\n );\n mergeOptions(\n parentOptions.arrows,\n newOptions.arrows,\n \"middle\",\n globalOptions.arrows\n );\n mergeOptions(\n parentOptions.arrows,\n newOptions.arrows,\n \"from\",\n globalOptions.arrows\n );\n } else {\n throw new Error(\n \"The arrow newOptions can only be an object or a string. Refer to the documentation. You used:\" +\n JSON.stringify(newOptions.arrows)\n );\n }\n } else if (allowDeletion === true && newOptions.arrows === null) {\n parentOptions.arrows = Object.create(globalOptions.arrows); // this sets the pointer of the option back to the global option.\n }\n\n // handle multiple input cases for color\n if (newOptions.color !== undefined && newOptions.color !== null) {\n const fromColor = isString(newOptions.color)\n ? {\n color: newOptions.color,\n highlight: newOptions.color,\n hover: newOptions.color,\n inherit: false,\n opacity: 1,\n }\n : newOptions.color;\n const toColor = parentOptions.color;\n\n // If passed, fill in values from default options - required in the case of no prototype bridging\n if (copyFromGlobals) {\n deepExtend(toColor, globalOptions.color, false, allowDeletion);\n } else {\n // Clear local properties - need to do it like this in order to retain prototype bridges\n for (const i in toColor) {\n if (Object.prototype.hasOwnProperty.call(toColor, i)) {\n delete toColor[i];\n }\n }\n }\n\n if (isString(toColor)) {\n toColor.color = toColor;\n toColor.highlight = toColor;\n toColor.hover = toColor;\n toColor.inherit = false;\n if (fromColor.opacity === undefined) {\n toColor.opacity = 1.0; // set default\n }\n } else {\n let colorsDefined = false;\n if (fromColor.color !== undefined) {\n toColor.color = fromColor.color;\n colorsDefined = true;\n }\n if (fromColor.highlight !== undefined) {\n toColor.highlight = fromColor.highlight;\n colorsDefined = true;\n }\n if (fromColor.hover !== undefined) {\n toColor.hover = fromColor.hover;\n colorsDefined = true;\n }\n if (fromColor.inherit !== undefined) {\n toColor.inherit = fromColor.inherit;\n }\n if (fromColor.opacity !== undefined) {\n toColor.opacity = Math.min(1, Math.max(0, fromColor.opacity));\n }\n\n if (colorsDefined === true) {\n toColor.inherit = false;\n } else {\n if (toColor.inherit === undefined) {\n toColor.inherit = \"from\"; // Set default\n }\n }\n }\n } else if (allowDeletion === true && newOptions.color === null) {\n parentOptions.color = bridgeObject(globalOptions.color); // set the object back to the global options\n }\n\n if (allowDeletion === true && newOptions.font === null) {\n parentOptions.font = bridgeObject(globalOptions.font); // set the object back to the global options\n }\n\n if (Object.prototype.hasOwnProperty.call(newOptions, \"selfReferenceSize\")) {\n console.warn(\n \"The selfReferenceSize property has been deprecated. Please use selfReference property instead. The selfReference can be set like thise selfReference:{size:30, angle:Math.PI / 4}\"\n );\n parentOptions.selfReference.size = newOptions.selfReferenceSize;\n }\n }\n\n /**\n *\n * @returns {ArrowOptions}\n */\n getFormattingValues() {\n const toArrow =\n this.options.arrows.to === true ||\n this.options.arrows.to.enabled === true;\n const fromArrow =\n this.options.arrows.from === true ||\n this.options.arrows.from.enabled === true;\n const middleArrow =\n this.options.arrows.middle === true ||\n this.options.arrows.middle.enabled === true;\n const inheritsColor = this.options.color.inherit;\n const values = {\n toArrow: toArrow,\n toArrowScale: this.options.arrows.to.scaleFactor,\n toArrowType: this.options.arrows.to.type,\n toArrowSrc: this.options.arrows.to.src,\n toArrowImageWidth: this.options.arrows.to.imageWidth,\n toArrowImageHeight: this.options.arrows.to.imageHeight,\n middleArrow: middleArrow,\n middleArrowScale: this.options.arrows.middle.scaleFactor,\n middleArrowType: this.options.arrows.middle.type,\n middleArrowSrc: this.options.arrows.middle.src,\n middleArrowImageWidth: this.options.arrows.middle.imageWidth,\n middleArrowImageHeight: this.options.arrows.middle.imageHeight,\n fromArrow: fromArrow,\n fromArrowScale: this.options.arrows.from.scaleFactor,\n fromArrowType: this.options.arrows.from.type,\n fromArrowSrc: this.options.arrows.from.src,\n fromArrowImageWidth: this.options.arrows.from.imageWidth,\n fromArrowImageHeight: this.options.arrows.from.imageHeight,\n arrowStrikethrough: this.options.arrowStrikethrough,\n color: inheritsColor ? undefined : this.options.color.color,\n inheritsColor: inheritsColor,\n opacity: this.options.color.opacity,\n hidden: this.options.hidden,\n length: this.options.length,\n shadow: this.options.shadow.enabled,\n shadowColor: this.options.shadow.color,\n shadowSize: this.options.shadow.size,\n shadowX: this.options.shadow.x,\n shadowY: this.options.shadow.y,\n dashes: this.options.dashes,\n width: this.options.width,\n background: this.options.background.enabled,\n backgroundColor: this.options.background.color,\n backgroundSize: this.options.background.size,\n backgroundDashes: this.options.background.dashes,\n };\n if (this.selected || this.hover) {\n if (this.chooser === true) {\n if (this.selected) {\n const selectedWidth = this.options.selectionWidth;\n if (typeof selectedWidth === \"function\") {\n values.width = selectedWidth(values.width);\n } else if (typeof selectedWidth === \"number\") {\n values.width += selectedWidth;\n }\n values.width = Math.max(values.width, 0.3 / this.body.view.scale);\n values.color = this.options.color.highlight;\n values.shadow = this.options.shadow.enabled;\n } else if (this.hover) {\n const hoverWidth = this.options.hoverWidth;\n if (typeof hoverWidth === \"function\") {\n values.width = hoverWidth(values.width);\n } else if (typeof hoverWidth === \"number\") {\n values.width += hoverWidth;\n }\n values.width = Math.max(values.width, 0.3 / this.body.view.scale);\n values.color = this.options.color.hover;\n values.shadow = this.options.shadow.enabled;\n }\n } else if (typeof this.chooser === \"function\") {\n this.chooser(values, this.options.id, this.selected, this.hover);\n if (values.color !== undefined) {\n values.inheritsColor = false;\n }\n if (values.shadow === false) {\n if (\n values.shadowColor !== this.options.shadow.color ||\n values.shadowSize !== this.options.shadow.size ||\n values.shadowX !== this.options.shadow.x ||\n values.shadowY !== this.options.shadow.y\n ) {\n values.shadow = true;\n }\n }\n }\n } else {\n values.shadow = this.options.shadow.enabled;\n values.width = Math.max(values.width, 0.3 / this.body.view.scale);\n }\n return values;\n }\n\n /**\n * update the options in the label module\n *\n * @param {object} options\n */\n updateLabelModule(options) {\n const pile = [\n options,\n this.options,\n this.globalOptions, // Currently set global edge options\n this.defaultOptions,\n ];\n\n this.labelModule.update(this.options, pile);\n\n if (this.labelModule.baseSize !== undefined) {\n this.baseFontSize = this.labelModule.baseSize;\n }\n }\n\n /**\n * update the edge type, set the options\n *\n * @returns {boolean}\n */\n updateEdgeType() {\n const smooth = this.options.smooth;\n let dataChanged = false;\n let changeInType = true;\n if (this.edgeType !== undefined) {\n if (\n (this.edgeType instanceof BezierEdgeDynamic &&\n smooth.enabled === true &&\n smooth.type === \"dynamic\") ||\n (this.edgeType instanceof CubicBezierEdge &&\n smooth.enabled === true &&\n smooth.type === \"cubicBezier\") ||\n (this.edgeType instanceof BezierEdgeStatic &&\n smooth.enabled === true &&\n smooth.type !== \"dynamic\" &&\n smooth.type !== \"cubicBezier\") ||\n (this.edgeType instanceof StraightEdge && smooth.type.enabled === false)\n ) {\n changeInType = false;\n }\n if (changeInType === true) {\n dataChanged = this.cleanup();\n }\n }\n if (changeInType === true) {\n if (smooth.enabled === true) {\n if (smooth.type === \"dynamic\") {\n dataChanged = true;\n this.edgeType = new BezierEdgeDynamic(\n this.options,\n this.body,\n this.labelModule\n );\n } else if (smooth.type === \"cubicBezier\") {\n this.edgeType = new CubicBezierEdge(\n this.options,\n this.body,\n this.labelModule\n );\n } else {\n this.edgeType = new BezierEdgeStatic(\n this.options,\n this.body,\n this.labelModule\n );\n }\n } else {\n this.edgeType = new StraightEdge(\n this.options,\n this.body,\n this.labelModule\n );\n }\n } else {\n // if nothing changes, we just set the options.\n this.edgeType.setOptions(this.options);\n }\n return dataChanged;\n }\n\n /**\n * Connect an edge to its nodes\n */\n connect() {\n this.disconnect();\n\n this.from = this.body.nodes[this.fromId] || undefined;\n this.to = this.body.nodes[this.toId] || undefined;\n this.connected = this.from !== undefined && this.to !== undefined;\n\n if (this.connected === true) {\n this.from.attachEdge(this);\n this.to.attachEdge(this);\n } else {\n if (this.from) {\n this.from.detachEdge(this);\n }\n if (this.to) {\n this.to.detachEdge(this);\n }\n }\n\n this.edgeType.connect();\n }\n\n /**\n * Disconnect an edge from its nodes\n */\n disconnect() {\n if (this.from) {\n this.from.detachEdge(this);\n this.from = undefined;\n }\n if (this.to) {\n this.to.detachEdge(this);\n this.to = undefined;\n }\n\n this.connected = false;\n }\n\n /**\n * get the title of this edge.\n *\n * @returns {string} title The title of the edge, or undefined when no title\n * has been set.\n */\n getTitle() {\n return this.title;\n }\n\n /**\n * check if this node is selecte\n *\n * @returns {boolean} selected True if node is selected, else false\n */\n isSelected() {\n return this.selected;\n }\n\n /**\n * Retrieve the value of the edge. Can be undefined\n *\n * @returns {number} value\n */\n getValue() {\n return this.options.value;\n }\n\n /**\n * Adjust the value range of the edge. The edge will adjust it's width\n * based on its value.\n *\n * @param {number} min\n * @param {number} max\n * @param {number} total\n */\n setValueRange(min, max, total) {\n if (this.options.value !== undefined) {\n const scale = this.options.scaling.customScalingFunction(\n min,\n max,\n total,\n this.options.value\n );\n const widthDiff = this.options.scaling.max - this.options.scaling.min;\n if (this.options.scaling.label.enabled === true) {\n const fontDiff =\n this.options.scaling.label.max - this.options.scaling.label.min;\n this.options.font.size =\n this.options.scaling.label.min + scale * fontDiff;\n }\n this.options.width = this.options.scaling.min + scale * widthDiff;\n } else {\n this.options.width = this.baseWidth;\n this.options.font.size = this.baseFontSize;\n }\n\n this._setInteractionWidths();\n this.updateLabelModule();\n }\n\n /**\n *\n * @private\n */\n _setInteractionWidths() {\n if (typeof this.options.hoverWidth === \"function\") {\n this.edgeType.hoverWidth = this.options.hoverWidth(this.options.width);\n } else {\n this.edgeType.hoverWidth = this.options.hoverWidth + this.options.width;\n }\n if (typeof this.options.selectionWidth === \"function\") {\n this.edgeType.selectionWidth = this.options.selectionWidth(\n this.options.width\n );\n } else {\n this.edgeType.selectionWidth =\n this.options.selectionWidth + this.options.width;\n }\n }\n\n /**\n * Redraw a edge\n * Draw this edge in the given canvas\n * The 2d context of a HTML canvas can be retrieved by canvas.getContext(\"2d\");\n *\n * @param {CanvasRenderingContext2D} ctx\n */\n draw(ctx) {\n const values = this.getFormattingValues();\n if (values.hidden) {\n return;\n }\n\n // get the via node from the edge type\n const viaNode = this.edgeType.getViaNode();\n\n // draw line and label\n this.edgeType.drawLine(ctx, values, this.selected, this.hover, viaNode);\n this.drawLabel(ctx, viaNode);\n }\n\n /**\n * Redraw arrows\n * Draw this arrows in the given canvas\n * The 2d context of a HTML canvas can be retrieved by canvas.getContext(\"2d\");\n *\n * @param {CanvasRenderingContext2D} ctx\n */\n drawArrows(ctx) {\n const values = this.getFormattingValues();\n if (values.hidden) {\n return;\n }\n\n // get the via node from the edge type\n const viaNode = this.edgeType.getViaNode();\n const arrowData = {};\n\n // restore edge targets to defaults\n this.edgeType.fromPoint = this.edgeType.from;\n this.edgeType.toPoint = this.edgeType.to;\n\n // from and to arrows give a different end point for edges. we set them here\n if (values.fromArrow) {\n arrowData.from = this.edgeType.getArrowData(\n ctx,\n \"from\",\n viaNode,\n this.selected,\n this.hover,\n values\n );\n if (values.arrowStrikethrough === false)\n this.edgeType.fromPoint = arrowData.from.core;\n if (values.fromArrowSrc) {\n arrowData.from.image = this.imagelist.load(values.fromArrowSrc);\n }\n if (values.fromArrowImageWidth) {\n arrowData.from.imageWidth = values.fromArrowImageWidth;\n }\n if (values.fromArrowImageHeight) {\n arrowData.from.imageHeight = values.fromArrowImageHeight;\n }\n }\n if (values.toArrow) {\n arrowData.to = this.edgeType.getArrowData(\n ctx,\n \"to\",\n viaNode,\n this.selected,\n this.hover,\n values\n );\n if (values.arrowStrikethrough === false)\n this.edgeType.toPoint = arrowData.to.core;\n if (values.toArrowSrc) {\n arrowData.to.image = this.imagelist.load(values.toArrowSrc);\n }\n if (values.toArrowImageWidth) {\n arrowData.to.imageWidth = values.toArrowImageWidth;\n }\n if (values.toArrowImageHeight) {\n arrowData.to.imageHeight = values.toArrowImageHeight;\n }\n }\n\n // the middle arrow depends on the line, which can depend on the to and from arrows so we do this one lastly.\n if (values.middleArrow) {\n arrowData.middle = this.edgeType.getArrowData(\n ctx,\n \"middle\",\n viaNode,\n this.selected,\n this.hover,\n values\n );\n\n if (values.middleArrowSrc) {\n arrowData.middle.image = this.imagelist.load(values.middleArrowSrc);\n }\n if (values.middleArrowImageWidth) {\n arrowData.middle.imageWidth = values.middleArrowImageWidth;\n }\n if (values.middleArrowImageHeight) {\n arrowData.middle.imageHeight = values.middleArrowImageHeight;\n }\n }\n\n if (values.fromArrow) {\n this.edgeType.drawArrowHead(\n ctx,\n values,\n this.selected,\n this.hover,\n arrowData.from\n );\n }\n if (values.middleArrow) {\n this.edgeType.drawArrowHead(\n ctx,\n values,\n this.selected,\n this.hover,\n arrowData.middle\n );\n }\n if (values.toArrow) {\n this.edgeType.drawArrowHead(\n ctx,\n values,\n this.selected,\n this.hover,\n arrowData.to\n );\n }\n }\n\n /**\n *\n * @param {CanvasRenderingContext2D} ctx\n * @param {Node} viaNode\n */\n drawLabel(ctx, viaNode) {\n if (this.options.label !== undefined) {\n // set style\n const node1 = this.from;\n const node2 = this.to;\n\n if (this.labelModule.differentState(this.selected, this.hover)) {\n this.labelModule.getTextSize(ctx, this.selected, this.hover);\n }\n\n let point;\n if (node1.id != node2.id) {\n this.labelModule.pointToSelf = false;\n point = this.edgeType.getPoint(0.5, viaNode);\n ctx.save();\n\n const rotationPoint = this._getRotation(ctx);\n if (rotationPoint.angle != 0) {\n ctx.translate(rotationPoint.x, rotationPoint.y);\n ctx.rotate(rotationPoint.angle);\n }\n\n // draw the label\n this.labelModule.draw(ctx, point.x, point.y, this.selected, this.hover);\n\n /*\n // Useful debug code: draw a border around the label\n // This should **not** be enabled in production!\n var size = this.labelModule.getSize();; // ;; intentional so lint catches it\n ctx.strokeStyle = \"#ff0000\";\n ctx.strokeRect(size.left, size.top, size.width, size.height);\n // End debug code\n*/\n\n ctx.restore();\n } else {\n // Ignore the orientations.\n this.labelModule.pointToSelf = true;\n\n // get circle coordinates\n const coordinates = getSelfRefCoordinates(\n ctx,\n this.options.selfReference.angle,\n this.options.selfReference.size,\n node1\n );\n\n point = this._pointOnCircle(\n coordinates.x,\n coordinates.y,\n this.options.selfReference.size,\n this.options.selfReference.angle\n );\n\n this.labelModule.draw(ctx, point.x, point.y, this.selected, this.hover);\n }\n }\n }\n\n /**\n * Determine all visual elements of this edge instance, in which the given\n * point falls within the bounding shape.\n *\n * @param {point} point\n * @returns {Array.<edgeClickItem|edgeLabelClickItem>} list with the items which are on the point\n */\n getItemsOnPoint(point) {\n const ret = [];\n\n if (this.labelModule.visible()) {\n const rotationPoint = this._getRotation();\n if (pointInRect(this.labelModule.getSize(), point, rotationPoint)) {\n ret.push({ edgeId: this.id, labelId: 0 });\n }\n }\n\n const obj = {\n left: point.x,\n top: point.y,\n };\n\n if (this.isOverlappingWith(obj)) {\n ret.push({ edgeId: this.id });\n }\n\n return ret;\n }\n\n /**\n * Check if this object is overlapping with the provided object\n *\n * @param {object} obj an object with parameters left, top\n * @returns {boolean} True if location is located on the edge\n */\n isOverlappingWith(obj) {\n if (this.connected) {\n const distMax = 10;\n const xFrom = this.from.x;\n const yFrom = this.from.y;\n const xTo = this.to.x;\n const yTo = this.to.y;\n const xObj = obj.left;\n const yObj = obj.top;\n\n const dist = this.edgeType.getDistanceToEdge(\n xFrom,\n yFrom,\n xTo,\n yTo,\n xObj,\n yObj\n );\n\n return dist < distMax;\n } else {\n return false;\n }\n }\n\n /**\n * Determine the rotation point, if any.\n *\n * @param {CanvasRenderingContext2D} [ctx] if passed, do a recalculation of the label size\n * @returns {rotationPoint} the point to rotate around and the angle in radians to rotate\n * @private\n */\n _getRotation(ctx) {\n const viaNode = this.edgeType.getViaNode();\n const point = this.edgeType.getPoint(0.5, viaNode);\n\n if (ctx !== undefined) {\n this.labelModule.calculateLabelSize(\n ctx,\n this.selected,\n this.hover,\n point.x,\n point.y\n );\n }\n\n const ret = {\n x: point.x,\n y: this.labelModule.size.yLine,\n angle: 0,\n };\n\n if (!this.labelModule.visible()) {\n return ret; // Don't even bother doing the atan2, there's nothing to draw\n }\n\n if (this.options.font.align === \"horizontal\") {\n return ret; // No need to calculate angle\n }\n\n const dy = this.from.y - this.to.y;\n const dx = this.from.x - this.to.x;\n let angle = Math.atan2(dy, dx); // radians\n\n // rotate so that label is readable\n if ((angle < -1 && dx < 0) || (angle > 0 && dx < 0)) {\n angle += Math.PI;\n }\n ret.angle = angle;\n\n return ret;\n }\n\n /**\n * Get a point on a circle\n *\n * @param {number} x\n * @param {number} y\n * @param {number} radius\n * @param {number} angle\n * @returns {object} point\n * @private\n */\n _pointOnCircle(x, y, radius, angle) {\n return {\n x: x + radius * Math.cos(angle),\n y: y - radius * Math.sin(angle),\n };\n }\n\n /**\n * Sets selected state to true\n */\n select() {\n this.selected = true;\n }\n\n /**\n * Sets selected state to false\n */\n unselect() {\n this.selected = false;\n }\n\n /**\n * cleans all required things on delete\n *\n * @returns {*}\n */\n cleanup() {\n return this.edgeType.cleanup();\n }\n\n /**\n * Remove edge from the list and perform necessary cleanup.\n */\n remove() {\n this.cleanup();\n this.disconnect();\n delete this.body.edges[this.id];\n }\n\n /**\n * Check if both connecting nodes exist\n *\n * @returns {boolean}\n */\n endPointsValid() {\n return (\n this.body.nodes[this.fromId] !== undefined &&\n this.body.nodes[this.toId] !== undefined\n );\n }\n}\n\nexport default Edge;\n","import { deepExtend, forEach } from \"vis-util/esnext\";\nimport { DataSet, isDataViewLike } from \"vis-data/esnext\";\nimport Edge from \"./components/Edge\";\n\n/**\n * Handler for Edges\n */\nclass EdgesHandler {\n /**\n * @param {object} body\n * @param {Array.<Image>} images\n * @param {Array.<Group>} groups\n */\n constructor(body, images, groups) {\n this.body = body;\n this.images = images;\n this.groups = groups;\n\n // create the edge API in the body container\n this.body.functions.createEdge = this.create.bind(this);\n\n this.edgesListeners = {\n add: (event, params) => {\n this.add(params.items);\n },\n update: (event, params) => {\n this.update(params.items);\n },\n remove: (event, params) => {\n this.remove(params.items);\n },\n };\n\n this.options = {};\n this.defaultOptions = {\n arrows: {\n to: { enabled: false, scaleFactor: 1, type: \"arrow\" }, // boolean / {arrowScaleFactor:1} / {enabled: false, arrowScaleFactor:1}\n middle: { enabled: false, scaleFactor: 1, type: \"arrow\" },\n from: { enabled: false, scaleFactor: 1, type: \"arrow\" },\n },\n endPointOffset: {\n from: 0,\n to: 0,\n },\n arrowStrikethrough: true,\n color: {\n color: \"#848484\",\n highlight: \"#848484\",\n hover: \"#848484\",\n inherit: \"from\",\n opacity: 1.0,\n },\n dashes: false,\n font: {\n color: \"#343434\",\n size: 14, // px\n face: \"arial\",\n background: \"none\",\n strokeWidth: 2, // px\n strokeColor: \"#ffffff\",\n align: \"horizontal\",\n multi: false,\n vadjust: 0,\n bold: {\n mod: \"bold\",\n },\n boldital: {\n mod: \"bold italic\",\n },\n ital: {\n mod: \"italic\",\n },\n mono: {\n mod: \"\",\n size: 15, // px\n face: \"courier new\",\n vadjust: 2,\n },\n },\n hidden: false,\n hoverWidth: 1.5,\n label: undefined,\n labelHighlightBold: true,\n length: undefined,\n physics: true,\n scaling: {\n min: 1,\n max: 15,\n label: {\n enabled: true,\n min: 14,\n max: 30,\n maxVisible: 30,\n drawThreshold: 5,\n },\n customScalingFunction: function (min, max, total, value) {\n if (max === min) {\n return 0.5;\n } else {\n const scale = 1 / (max - min);\n return Math.max(0, (value - min) * scale);\n }\n },\n },\n selectionWidth: 1.5,\n selfReference: {\n size: 20,\n angle: Math.PI / 4,\n renderBehindTheNode: true,\n },\n shadow: {\n enabled: false,\n color: \"rgba(0,0,0,0.5)\",\n size: 10,\n x: 5,\n y: 5,\n },\n background: {\n enabled: false,\n color: \"rgba(111,111,111,1)\",\n size: 10,\n dashes: false,\n },\n smooth: {\n enabled: true,\n type: \"dynamic\",\n forceDirection: \"none\",\n roundness: 0.5,\n },\n title: undefined,\n width: 1,\n value: undefined,\n };\n\n deepExtend(this.options, this.defaultOptions);\n\n this.bindEventListeners();\n }\n\n /**\n * Binds event listeners\n */\n bindEventListeners() {\n // this allows external modules to force all dynamic curves to turn static.\n this.body.emitter.on(\"_forceDisableDynamicCurves\", (type, emit = true) => {\n if (type === \"dynamic\") {\n type = \"continuous\";\n }\n let dataChanged = false;\n for (const edgeId in this.body.edges) {\n if (Object.prototype.hasOwnProperty.call(this.body.edges, edgeId)) {\n const edge = this.body.edges[edgeId];\n const edgeData = this.body.data.edges.get(edgeId);\n\n // only forcibly remove the smooth curve if the data has been set of the edge has the smooth curves defined.\n // this is because a change in the global would not affect these curves.\n if (edgeData != null) {\n const smoothOptions = edgeData.smooth;\n if (smoothOptions !== undefined) {\n if (\n smoothOptions.enabled === true &&\n smoothOptions.type === \"dynamic\"\n ) {\n if (type === undefined) {\n edge.setOptions({ smooth: false });\n } else {\n edge.setOptions({ smooth: { type: type } });\n }\n dataChanged = true;\n }\n }\n }\n }\n }\n if (emit === true && dataChanged === true) {\n this.body.emitter.emit(\"_dataChanged\");\n }\n });\n\n // this is called when options of EXISTING nodes or edges have changed.\n //\n // NOTE: Not true, called when options have NOT changed, for both existing as well as new nodes.\n // See update() for logic.\n // TODO: Verify and examine the consequences of this. It might still trigger when\n // non-option fields have changed, but then reconnecting edges is still useless.\n // Alternatively, it might also be called when edges are removed.\n //\n this.body.emitter.on(\"_dataUpdated\", () => {\n this.reconnectEdges();\n });\n\n // refresh the edges. Used when reverting from hierarchical layout\n this.body.emitter.on(\"refreshEdges\", this.refresh.bind(this));\n this.body.emitter.on(\"refresh\", this.refresh.bind(this));\n this.body.emitter.on(\"destroy\", () => {\n forEach(this.edgesListeners, (callback, event) => {\n if (this.body.data.edges) this.body.data.edges.off(event, callback);\n });\n delete this.body.functions.createEdge;\n delete this.edgesListeners.add;\n delete this.edgesListeners.update;\n delete this.edgesListeners.remove;\n delete this.edgesListeners;\n });\n }\n\n /**\n *\n * @param {object} options\n */\n setOptions(options) {\n if (options !== undefined) {\n // use the parser from the Edge class to fill in all shorthand notations\n Edge.parseOptions(this.options, options, true, this.defaultOptions, true);\n\n // update smooth settings in all edges\n let dataChanged = false;\n if (options.smooth !== undefined) {\n for (const edgeId in this.body.edges) {\n if (Object.prototype.hasOwnProperty.call(this.body.edges, edgeId)) {\n dataChanged =\n this.body.edges[edgeId].updateEdgeType() || dataChanged;\n }\n }\n }\n\n // update fonts in all edges\n if (options.font !== undefined) {\n for (const edgeId in this.body.edges) {\n if (Object.prototype.hasOwnProperty.call(this.body.edges, edgeId)) {\n this.body.edges[edgeId].updateLabelModule();\n }\n }\n }\n\n // update the state of the variables if needed\n if (\n options.hidden !== undefined ||\n options.physics !== undefined ||\n dataChanged === true\n ) {\n this.body.emitter.emit(\"_dataChanged\");\n }\n }\n }\n\n /**\n * Load edges by reading the data table\n *\n * @param {Array | DataSet | DataView} edges The data containing the edges.\n * @param {boolean} [doNotEmit=false] - Suppress data changed event.\n * @private\n */\n setData(edges, doNotEmit = false) {\n const oldEdgesData = this.body.data.edges;\n\n if (isDataViewLike(\"id\", edges)) {\n this.body.data.edges = edges;\n } else if (Array.isArray(edges)) {\n this.body.data.edges = new DataSet();\n this.body.data.edges.add(edges);\n } else if (!edges) {\n this.body.data.edges = new DataSet();\n } else {\n throw new TypeError(\"Array or DataSet expected\");\n }\n\n // TODO: is this null or undefined or false?\n if (oldEdgesData) {\n // unsubscribe from old dataset\n forEach(this.edgesListeners, (callback, event) => {\n oldEdgesData.off(event, callback);\n });\n }\n\n // remove drawn edges\n this.body.edges = {};\n\n // TODO: is this null or undefined or false?\n if (this.body.data.edges) {\n // subscribe to new dataset\n forEach(this.edgesListeners, (callback, event) => {\n this.body.data.edges.on(event, callback);\n });\n\n // draw all new nodes\n const ids = this.body.data.edges.getIds();\n this.add(ids, true);\n }\n\n this.body.emitter.emit(\"_adjustEdgesForHierarchicalLayout\");\n if (doNotEmit === false) {\n this.body.emitter.emit(\"_dataChanged\");\n }\n }\n\n /**\n * Add edges\n *\n * @param {number[] | string[]} ids\n * @param {boolean} [doNotEmit=false]\n * @private\n */\n add(ids, doNotEmit = false) {\n const edges = this.body.edges;\n const edgesData = this.body.data.edges;\n\n for (let i = 0; i < ids.length; i++) {\n const id = ids[i];\n\n const oldEdge = edges[id];\n if (oldEdge) {\n oldEdge.disconnect();\n }\n\n const data = edgesData.get(id, { showInternalIds: true });\n edges[id] = this.create(data);\n }\n\n this.body.emitter.emit(\"_adjustEdgesForHierarchicalLayout\");\n\n if (doNotEmit === false) {\n this.body.emitter.emit(\"_dataChanged\");\n }\n }\n\n /**\n * Update existing edges, or create them when not yet existing\n *\n * @param {number[] | string[]} ids\n * @private\n */\n update(ids) {\n const edges = this.body.edges;\n const edgesData = this.body.data.edges;\n let dataChanged = false;\n for (let i = 0; i < ids.length; i++) {\n const id = ids[i];\n const data = edgesData.get(id);\n const edge = edges[id];\n if (edge !== undefined) {\n // update edge\n edge.disconnect();\n dataChanged = edge.setOptions(data) || dataChanged; // if a support node is added, data can be changed.\n edge.connect();\n } else {\n // create edge\n this.body.edges[id] = this.create(data);\n dataChanged = true;\n }\n }\n\n if (dataChanged === true) {\n this.body.emitter.emit(\"_adjustEdgesForHierarchicalLayout\");\n this.body.emitter.emit(\"_dataChanged\");\n } else {\n this.body.emitter.emit(\"_dataUpdated\");\n }\n }\n\n /**\n * Remove existing edges. Non existing ids will be ignored\n *\n * @param {number[] | string[]} ids\n * @param {boolean} [emit=true]\n * @private\n */\n remove(ids, emit = true) {\n if (ids.length === 0) return; // early out\n\n const edges = this.body.edges;\n forEach(ids, (id) => {\n const edge = edges[id];\n if (edge !== undefined) {\n edge.remove();\n }\n });\n\n if (emit) {\n this.body.emitter.emit(\"_dataChanged\");\n }\n }\n\n /**\n * Refreshes Edge Handler\n */\n refresh() {\n forEach(this.body.edges, (edge, edgeId) => {\n const data = this.body.data.edges.get(edgeId);\n if (data !== undefined) {\n edge.setOptions(data);\n }\n });\n }\n\n /**\n *\n * @param {object} properties\n * @returns {Edge}\n */\n create(properties) {\n return new Edge(\n properties,\n this.body,\n this.images,\n this.options,\n this.defaultOptions\n );\n }\n\n /**\n * Reconnect all edges\n *\n * @private\n */\n reconnectEdges() {\n let id;\n const nodes = this.body.nodes;\n const edges = this.body.edges;\n\n for (id in nodes) {\n if (Object.prototype.hasOwnProperty.call(nodes, id)) {\n nodes[id].edges = [];\n }\n }\n\n for (id in edges) {\n if (Object.prototype.hasOwnProperty.call(edges, id)) {\n const edge = edges[id];\n edge.from = null;\n edge.to = null;\n edge.connect();\n }\n }\n }\n\n /**\n *\n * @param {Edge.id} edgeId\n * @returns {Array}\n */\n getConnectedNodes(edgeId) {\n const nodeList = [];\n if (this.body.edges[edgeId] !== undefined) {\n const edge = this.body.edges[edgeId];\n if (edge.fromId !== undefined) {\n nodeList.push(edge.fromId);\n }\n if (edge.toId !== undefined) {\n nodeList.push(edge.toId);\n }\n }\n return nodeList;\n }\n\n /**\n * There is no direct relation between the nodes and the edges DataSet,\n * so the right place to do call this is in the handler for event `_dataUpdated`.\n */\n _updateState() {\n this._addMissingEdges();\n this._removeInvalidEdges();\n }\n\n /**\n * Scan for missing nodes and remove corresponding edges, if any.\n *\n * @private\n */\n _removeInvalidEdges() {\n const edgesToDelete = [];\n\n forEach(this.body.edges, (edge, id) => {\n const toNode = this.body.nodes[edge.toId];\n const fromNode = this.body.nodes[edge.fromId];\n\n // Skip clustering edges here, let the Clustering module handle those\n if (\n (toNode !== undefined && toNode.isCluster === true) ||\n (fromNode !== undefined && fromNode.isCluster === true)\n ) {\n return;\n }\n\n if (toNode === undefined || fromNode === undefined) {\n edgesToDelete.push(id);\n }\n });\n\n this.remove(edgesToDelete, false);\n }\n\n /**\n * add all edges from dataset that are not in the cached state\n *\n * @private\n */\n _addMissingEdges() {\n const edgesData = this.body.data.edges;\n if (edgesData === undefined || edgesData === null) {\n return; // No edges DataSet yet; can happen on startup\n }\n\n const edges = this.body.edges;\n const addIds = [];\n\n edgesData.forEach((edgeData, edgeId) => {\n const edge = edges[edgeId];\n if (edge === undefined) {\n addIds.push(edgeId);\n }\n });\n\n this.add(addIds, true);\n }\n}\n\nexport default EdgesHandler;\n","import { Alea } from \"vis-util/esnext\";\n\n/**\n * Barnes Hut Solver\n */\nclass BarnesHutSolver {\n /**\n * @param {object} body\n * @param {{physicsNodeIndices: Array, physicsEdgeIndices: Array, forces: {}, velocities: {}}} physicsBody\n * @param {object} options\n */\n constructor(body, physicsBody, options) {\n this.body = body;\n this.physicsBody = physicsBody;\n this.barnesHutTree;\n this.setOptions(options);\n this._rng = Alea(\"BARNES HUT SOLVER\");\n\n // debug: show grid\n // this.body.emitter.on(\"afterDrawing\", (ctx) => {this._debug(ctx,'#ff0000')})\n }\n\n /**\n *\n * @param {object} options\n */\n setOptions(options) {\n this.options = options;\n this.thetaInversed = 1 / this.options.theta;\n\n // if 1 then min distance = 0.5, if 0.5 then min distance = 0.5 + 0.5*node.shape.radius\n this.overlapAvoidanceFactor =\n 1 - Math.max(0, Math.min(1, this.options.avoidOverlap));\n }\n\n /**\n * This function calculates the forces the nodes apply on each other based on a gravitational model.\n * The Barnes Hut method is used to speed up this N-body simulation.\n *\n * @private\n */\n solve() {\n if (\n this.options.gravitationalConstant !== 0 &&\n this.physicsBody.physicsNodeIndices.length > 0\n ) {\n let node;\n const nodes = this.body.nodes;\n const nodeIndices = this.physicsBody.physicsNodeIndices;\n const nodeCount = nodeIndices.length;\n\n // create the tree\n const barnesHutTree = this._formBarnesHutTree(nodes, nodeIndices);\n\n // for debugging\n this.barnesHutTree = barnesHutTree;\n\n // place the nodes one by one recursively\n for (let i = 0; i < nodeCount; i++) {\n node = nodes[nodeIndices[i]];\n if (node.options.mass > 0) {\n // starting with root is irrelevant, it never passes the BarnesHutSolver condition\n this._getForceContributions(barnesHutTree.root, node);\n }\n }\n }\n }\n\n /**\n * @param {object} parentBranch\n * @param {Node} node\n * @private\n */\n _getForceContributions(parentBranch, node) {\n this._getForceContribution(parentBranch.children.NW, node);\n this._getForceContribution(parentBranch.children.NE, node);\n this._getForceContribution(parentBranch.children.SW, node);\n this._getForceContribution(parentBranch.children.SE, node);\n }\n\n /**\n * This function traverses the barnesHutTree. It checks when it can approximate distant nodes with their center of mass.\n * If a region contains a single node, we check if it is not itself, then we apply the force.\n *\n * @param {object} parentBranch\n * @param {Node} node\n * @private\n */\n _getForceContribution(parentBranch, node) {\n // we get no force contribution from an empty region\n if (parentBranch.childrenCount > 0) {\n // get the distance from the center of mass to the node.\n const dx = parentBranch.centerOfMass.x - node.x;\n const dy = parentBranch.centerOfMass.y - node.y;\n const distance = Math.sqrt(dx * dx + dy * dy);\n\n // BarnesHutSolver condition\n // original condition : s/d < theta = passed === d/s > 1/theta = passed\n // calcSize = 1/s --> d * 1/s > 1/theta = passed\n if (distance * parentBranch.calcSize > this.thetaInversed) {\n this._calculateForces(distance, dx, dy, node, parentBranch);\n } else {\n // Did not pass the condition, go into children if available\n if (parentBranch.childrenCount === 4) {\n this._getForceContributions(parentBranch, node);\n } else {\n // parentBranch must have only one node, if it was empty we wouldnt be here\n if (parentBranch.children.data.id != node.id) {\n // if it is not self\n this._calculateForces(distance, dx, dy, node, parentBranch);\n }\n }\n }\n }\n }\n\n /**\n * Calculate the forces based on the distance.\n *\n * @param {number} distance\n * @param {number} dx\n * @param {number} dy\n * @param {Node} node\n * @param {object} parentBranch\n * @private\n */\n _calculateForces(distance, dx, dy, node, parentBranch) {\n if (distance === 0) {\n distance = 0.1;\n dx = distance;\n }\n\n if (this.overlapAvoidanceFactor < 1 && node.shape.radius) {\n distance = Math.max(\n 0.1 + this.overlapAvoidanceFactor * node.shape.radius,\n distance - node.shape.radius\n );\n }\n\n // the dividing by the distance cubed instead of squared allows us to get the fx and fy components without sines and cosines\n // it is shorthand for gravityforce with distance squared and fx = dx/distance * gravityForce\n const gravityForce =\n (this.options.gravitationalConstant *\n parentBranch.mass *\n node.options.mass) /\n Math.pow(distance, 3);\n const fx = dx * gravityForce;\n const fy = dy * gravityForce;\n\n this.physicsBody.forces[node.id].x += fx;\n this.physicsBody.forces[node.id].y += fy;\n }\n\n /**\n * This function constructs the barnesHut tree recursively. It creates the root, splits it and starts placing the nodes.\n *\n * @param {Array.<Node>} nodes\n * @param {Array.<number>} nodeIndices\n * @returns {{root: {centerOfMass: {x: number, y: number}, mass: number, range: {minX: number, maxX: number, minY: number, maxY: number}, size: number, calcSize: number, children: {data: null}, maxWidth: number, level: number, childrenCount: number}}} BarnesHutTree\n * @private\n */\n _formBarnesHutTree(nodes, nodeIndices) {\n let node;\n const nodeCount = nodeIndices.length;\n\n let minX = nodes[nodeIndices[0]].x;\n let minY = nodes[nodeIndices[0]].y;\n let maxX = nodes[nodeIndices[0]].x;\n let maxY = nodes[nodeIndices[0]].y;\n\n // get the range of the nodes\n for (let i = 1; i < nodeCount; i++) {\n const node = nodes[nodeIndices[i]];\n const x = node.x;\n const y = node.y;\n if (node.options.mass > 0) {\n if (x < minX) {\n minX = x;\n }\n if (x > maxX) {\n maxX = x;\n }\n if (y < minY) {\n minY = y;\n }\n if (y > maxY) {\n maxY = y;\n }\n }\n }\n // make the range a square\n const sizeDiff = Math.abs(maxX - minX) - Math.abs(maxY - minY); // difference between X and Y\n if (sizeDiff > 0) {\n minY -= 0.5 * sizeDiff;\n maxY += 0.5 * sizeDiff;\n } // xSize > ySize\n else {\n minX += 0.5 * sizeDiff;\n maxX -= 0.5 * sizeDiff;\n } // xSize < ySize\n\n const minimumTreeSize = 1e-5;\n const rootSize = Math.max(minimumTreeSize, Math.abs(maxX - minX));\n const halfRootSize = 0.5 * rootSize;\n const centerX = 0.5 * (minX + maxX),\n centerY = 0.5 * (minY + maxY);\n\n // construct the barnesHutTree\n const barnesHutTree = {\n root: {\n centerOfMass: { x: 0, y: 0 },\n mass: 0,\n range: {\n minX: centerX - halfRootSize,\n maxX: centerX + halfRootSize,\n minY: centerY - halfRootSize,\n maxY: centerY + halfRootSize,\n },\n size: rootSize,\n calcSize: 1 / rootSize,\n children: { data: null },\n maxWidth: 0,\n level: 0,\n childrenCount: 4,\n },\n };\n this._splitBranch(barnesHutTree.root);\n\n // place the nodes one by one recursively\n for (let i = 0; i < nodeCount; i++) {\n node = nodes[nodeIndices[i]];\n if (node.options.mass > 0) {\n this._placeInTree(barnesHutTree.root, node);\n }\n }\n\n // make global\n return barnesHutTree;\n }\n\n /**\n * this updates the mass of a branch. this is increased by adding a node.\n *\n * @param {object} parentBranch\n * @param {Node} node\n * @private\n */\n _updateBranchMass(parentBranch, node) {\n const centerOfMass = parentBranch.centerOfMass;\n const totalMass = parentBranch.mass + node.options.mass;\n const totalMassInv = 1 / totalMass;\n\n centerOfMass.x =\n centerOfMass.x * parentBranch.mass + node.x * node.options.mass;\n centerOfMass.x *= totalMassInv;\n\n centerOfMass.y =\n centerOfMass.y * parentBranch.mass + node.y * node.options.mass;\n centerOfMass.y *= totalMassInv;\n\n parentBranch.mass = totalMass;\n const biggestSize = Math.max(\n Math.max(node.height, node.radius),\n node.width\n );\n parentBranch.maxWidth =\n parentBranch.maxWidth < biggestSize ? biggestSize : parentBranch.maxWidth;\n }\n\n /**\n * determine in which branch the node will be placed.\n *\n * @param {object} parentBranch\n * @param {Node} node\n * @param {boolean} skipMassUpdate\n * @private\n */\n _placeInTree(parentBranch, node, skipMassUpdate) {\n if (skipMassUpdate != true || skipMassUpdate === undefined) {\n // update the mass of the branch.\n this._updateBranchMass(parentBranch, node);\n }\n\n const range = parentBranch.children.NW.range;\n let region;\n if (range.maxX > node.x) {\n // in NW or SW\n if (range.maxY > node.y) {\n region = \"NW\";\n } else {\n region = \"SW\";\n }\n } else {\n // in NE or SE\n if (range.maxY > node.y) {\n region = \"NE\";\n } else {\n region = \"SE\";\n }\n }\n\n this._placeInRegion(parentBranch, node, region);\n }\n\n /**\n * actually place the node in a region (or branch)\n *\n * @param {object} parentBranch\n * @param {Node} node\n * @param {'NW'| 'NE' | 'SW' | 'SE'} region\n * @private\n */\n _placeInRegion(parentBranch, node, region) {\n const children = parentBranch.children[region];\n\n switch (children.childrenCount) {\n case 0: // place node here\n children.children.data = node;\n children.childrenCount = 1;\n this._updateBranchMass(children, node);\n break;\n case 1: // convert into children\n // if there are two nodes exactly overlapping (on init, on opening of cluster etc.)\n // we move one node a little bit and we do not put it in the tree.\n if (\n children.children.data.x === node.x &&\n children.children.data.y === node.y\n ) {\n node.x += this._rng();\n node.y += this._rng();\n } else {\n this._splitBranch(children);\n this._placeInTree(children, node);\n }\n break;\n case 4: // place in branch\n this._placeInTree(children, node);\n break;\n }\n }\n\n /**\n * this function splits a branch into 4 sub branches. If the branch contained a node, we place it in the subbranch\n * after the split is complete.\n *\n * @param {object} parentBranch\n * @private\n */\n _splitBranch(parentBranch) {\n // if the branch is shaded with a node, replace the node in the new subset.\n let containedNode = null;\n if (parentBranch.childrenCount === 1) {\n containedNode = parentBranch.children.data;\n parentBranch.mass = 0;\n parentBranch.centerOfMass.x = 0;\n parentBranch.centerOfMass.y = 0;\n }\n parentBranch.childrenCount = 4;\n parentBranch.children.data = null;\n this._insertRegion(parentBranch, \"NW\");\n this._insertRegion(parentBranch, \"NE\");\n this._insertRegion(parentBranch, \"SW\");\n this._insertRegion(parentBranch, \"SE\");\n\n if (containedNode != null) {\n this._placeInTree(parentBranch, containedNode);\n }\n }\n\n /**\n * This function subdivides the region into four new segments.\n * Specifically, this inserts a single new segment.\n * It fills the children section of the parentBranch\n *\n * @param {object} parentBranch\n * @param {'NW'| 'NE' | 'SW' | 'SE'} region\n * @private\n */\n _insertRegion(parentBranch, region) {\n let minX, maxX, minY, maxY;\n const childSize = 0.5 * parentBranch.size;\n switch (region) {\n case \"NW\":\n minX = parentBranch.range.minX;\n maxX = parentBranch.range.minX + childSize;\n minY = parentBranch.range.minY;\n maxY = parentBranch.range.minY + childSize;\n break;\n case \"NE\":\n minX = parentBranch.range.minX + childSize;\n maxX = parentBranch.range.maxX;\n minY = parentBranch.range.minY;\n maxY = parentBranch.range.minY + childSize;\n break;\n case \"SW\":\n minX = parentBranch.range.minX;\n maxX = parentBranch.range.minX + childSize;\n minY = parentBranch.range.minY + childSize;\n maxY = parentBranch.range.maxY;\n break;\n case \"SE\":\n minX = parentBranch.range.minX + childSize;\n maxX = parentBranch.range.maxX;\n minY = parentBranch.range.minY + childSize;\n maxY = parentBranch.range.maxY;\n break;\n }\n\n parentBranch.children[region] = {\n centerOfMass: { x: 0, y: 0 },\n mass: 0,\n range: { minX: minX, maxX: maxX, minY: minY, maxY: maxY },\n size: 0.5 * parentBranch.size,\n calcSize: 2 * parentBranch.calcSize,\n children: { data: null },\n maxWidth: 0,\n level: parentBranch.level + 1,\n childrenCount: 0,\n };\n }\n\n //--------------------------- DEBUGGING BELOW ---------------------------//\n\n /**\n * This function is for debugging purposed, it draws the tree.\n *\n * @param {CanvasRenderingContext2D} ctx\n * @param {string} color\n * @private\n */\n _debug(ctx, color) {\n if (this.barnesHutTree !== undefined) {\n ctx.lineWidth = 1;\n\n this._drawBranch(this.barnesHutTree.root, ctx, color);\n }\n }\n\n /**\n * This function is for debugging purposes. It draws the branches recursively.\n *\n * @param {object} branch\n * @param {CanvasRenderingContext2D} ctx\n * @param {string} color\n * @private\n */\n _drawBranch(branch, ctx, color) {\n if (color === undefined) {\n color = \"#FF0000\";\n }\n\n if (branch.childrenCount === 4) {\n this._drawBranch(branch.children.NW, ctx);\n this._drawBranch(branch.children.NE, ctx);\n this._drawBranch(branch.children.SE, ctx);\n this._drawBranch(branch.children.SW, ctx);\n }\n ctx.strokeStyle = color;\n ctx.beginPath();\n ctx.moveTo(branch.range.minX, branch.range.minY);\n ctx.lineTo(branch.range.maxX, branch.range.minY);\n ctx.stroke();\n\n ctx.beginPath();\n ctx.moveTo(branch.range.maxX, branch.range.minY);\n ctx.lineTo(branch.range.maxX, branch.range.maxY);\n ctx.stroke();\n\n ctx.beginPath();\n ctx.moveTo(branch.range.maxX, branch.range.maxY);\n ctx.lineTo(branch.range.minX, branch.range.maxY);\n ctx.stroke();\n\n ctx.beginPath();\n ctx.moveTo(branch.range.minX, branch.range.maxY);\n ctx.lineTo(branch.range.minX, branch.range.minY);\n ctx.stroke();\n\n /*\n if (branch.mass > 0) {\n ctx.circle(branch.centerOfMass.x, branch.centerOfMass.y, 3*branch.mass);\n ctx.stroke();\n }\n */\n }\n}\n\nexport default BarnesHutSolver;\n","import { Alea } from \"vis-util/esnext\";\n\n/**\n * Repulsion Solver\n */\nclass RepulsionSolver {\n /**\n * @param {object} body\n * @param {{physicsNodeIndices: Array, physicsEdgeIndices: Array, forces: {}, velocities: {}}} physicsBody\n * @param {object} options\n */\n constructor(body, physicsBody, options) {\n this._rng = Alea(\"REPULSION SOLVER\");\n\n this.body = body;\n this.physicsBody = physicsBody;\n this.setOptions(options);\n }\n\n /**\n *\n * @param {object} options\n */\n setOptions(options) {\n this.options = options;\n }\n\n /**\n * Calculate the forces the nodes apply on each other based on a repulsion field.\n * This field is linearly approximated.\n *\n * @private\n */\n solve() {\n let dx, dy, distance, fx, fy, repulsingForce, node1, node2;\n\n const nodes = this.body.nodes;\n const nodeIndices = this.physicsBody.physicsNodeIndices;\n const forces = this.physicsBody.forces;\n\n // repulsing forces between nodes\n const nodeDistance = this.options.nodeDistance;\n\n // approximation constants\n const a = -2 / 3 / nodeDistance;\n const b = 4 / 3;\n\n // we loop from i over all but the last entree in the array\n // j loops from i+1 to the last. This way we do not double count any of the indices, nor i === j\n for (let i = 0; i < nodeIndices.length - 1; i++) {\n node1 = nodes[nodeIndices[i]];\n for (let j = i + 1; j < nodeIndices.length; j++) {\n node2 = nodes[nodeIndices[j]];\n\n dx = node2.x - node1.x;\n dy = node2.y - node1.y;\n distance = Math.sqrt(dx * dx + dy * dy);\n\n // same condition as BarnesHutSolver, making sure nodes are never 100% overlapping.\n if (distance === 0) {\n distance = 0.1 * this._rng();\n dx = distance;\n }\n\n if (distance < 2 * nodeDistance) {\n if (distance < 0.5 * nodeDistance) {\n repulsingForce = 1.0;\n } else {\n repulsingForce = a * distance + b; // linear approx of 1 / (1 + Math.exp((distance / nodeDistance - 1) * steepness))\n }\n repulsingForce = repulsingForce / distance;\n\n fx = dx * repulsingForce;\n fy = dy * repulsingForce;\n\n forces[node1.id].x -= fx;\n forces[node1.id].y -= fy;\n forces[node2.id].x += fx;\n forces[node2.id].y += fy;\n }\n }\n }\n }\n}\n\nexport default RepulsionSolver;\n","/**\n * Hierarchical Repulsion Solver\n */\nclass HierarchicalRepulsionSolver {\n /**\n * @param {object} body\n * @param {{physicsNodeIndices: Array, physicsEdgeIndices: Array, forces: {}, velocities: {}}} physicsBody\n * @param {object} options\n */\n constructor(body, physicsBody, options) {\n this.body = body;\n this.physicsBody = physicsBody;\n this.setOptions(options);\n }\n\n /**\n *\n * @param {object} options\n */\n setOptions(options) {\n this.options = options;\n this.overlapAvoidanceFactor = Math.max(\n 0,\n Math.min(1, this.options.avoidOverlap || 0)\n );\n }\n\n /**\n * Calculate the forces the nodes apply on each other based on a repulsion field.\n * This field is linearly approximated.\n *\n * @private\n */\n solve() {\n const nodes = this.body.nodes;\n const nodeIndices = this.physicsBody.physicsNodeIndices;\n const forces = this.physicsBody.forces;\n\n // repulsing forces between nodes\n const nodeDistance = this.options.nodeDistance;\n\n // we loop from i over all but the last entree in the array\n // j loops from i+1 to the last. This way we do not double count any of the indices, nor i === j\n for (let i = 0; i < nodeIndices.length - 1; i++) {\n const node1 = nodes[nodeIndices[i]];\n for (let j = i + 1; j < nodeIndices.length; j++) {\n const node2 = nodes[nodeIndices[j]];\n\n // nodes only affect nodes on their level\n if (node1.level === node2.level) {\n const theseNodesDistance =\n nodeDistance +\n this.overlapAvoidanceFactor *\n ((node1.shape.radius || 0) / 2 + (node2.shape.radius || 0) / 2);\n\n const dx = node2.x - node1.x;\n const dy = node2.y - node1.y;\n const distance = Math.sqrt(dx * dx + dy * dy);\n\n const steepness = 0.05;\n let repulsingForce;\n if (distance < theseNodesDistance) {\n repulsingForce =\n -Math.pow(steepness * distance, 2) +\n Math.pow(steepness * theseNodesDistance, 2);\n } else {\n repulsingForce = 0;\n }\n // normalize force with\n if (distance !== 0) {\n repulsingForce = repulsingForce / distance;\n }\n const fx = dx * repulsingForce;\n const fy = dy * repulsingForce;\n\n forces[node1.id].x -= fx;\n forces[node1.id].y -= fy;\n forces[node2.id].x += fx;\n forces[node2.id].y += fy;\n }\n }\n }\n }\n}\n\nexport default HierarchicalRepulsionSolver;\n","/**\n * Spring Solver\n */\nclass SpringSolver {\n /**\n * @param {object} body\n * @param {{physicsNodeIndices: Array, physicsEdgeIndices: Array, forces: {}, velocities: {}}} physicsBody\n * @param {object} options\n */\n constructor(body, physicsBody, options) {\n this.body = body;\n this.physicsBody = physicsBody;\n this.setOptions(options);\n }\n\n /**\n *\n * @param {object} options\n */\n setOptions(options) {\n this.options = options;\n }\n\n /**\n * This function calculates the springforces on the nodes, accounting for the support nodes.\n *\n * @private\n */\n solve() {\n let edgeLength, edge;\n const edgeIndices = this.physicsBody.physicsEdgeIndices;\n const edges = this.body.edges;\n let node1, node2, node3;\n\n // forces caused by the edges, modelled as springs\n for (let i = 0; i < edgeIndices.length; i++) {\n edge = edges[edgeIndices[i]];\n if (edge.connected === true && edge.toId !== edge.fromId) {\n // only calculate forces if nodes are in the same sector\n if (\n this.body.nodes[edge.toId] !== undefined &&\n this.body.nodes[edge.fromId] !== undefined\n ) {\n if (edge.edgeType.via !== undefined) {\n edgeLength =\n edge.options.length === undefined\n ? this.options.springLength\n : edge.options.length;\n node1 = edge.to;\n node2 = edge.edgeType.via;\n node3 = edge.from;\n\n this._calculateSpringForce(node1, node2, 0.5 * edgeLength);\n this._calculateSpringForce(node2, node3, 0.5 * edgeLength);\n } else {\n // the * 1.5 is here so the edge looks as large as a smooth edge. It does not initially because the smooth edges use\n // the support nodes which exert a repulsive force on the to and from nodes, making the edge appear larger.\n edgeLength =\n edge.options.length === undefined\n ? this.options.springLength * 1.5\n : edge.options.length;\n this._calculateSpringForce(edge.from, edge.to, edgeLength);\n }\n }\n }\n }\n }\n\n /**\n * This is the code actually performing the calculation for the function above.\n *\n * @param {Node} node1\n * @param {Node} node2\n * @param {number} edgeLength\n * @private\n */\n _calculateSpringForce(node1, node2, edgeLength) {\n const dx = node1.x - node2.x;\n const dy = node1.y - node2.y;\n const distance = Math.max(Math.sqrt(dx * dx + dy * dy), 0.01);\n\n // the 1/distance is so the fx and fy can be calculated without sine or cosine.\n const springForce =\n (this.options.springConstant * (edgeLength - distance)) / distance;\n\n const fx = dx * springForce;\n const fy = dy * springForce;\n\n // handle the case where one node is not part of the physcis\n if (this.physicsBody.forces[node1.id] !== undefined) {\n this.physicsBody.forces[node1.id].x += fx;\n this.physicsBody.forces[node1.id].y += fy;\n }\n\n if (this.physicsBody.forces[node2.id] !== undefined) {\n this.physicsBody.forces[node2.id].x -= fx;\n this.physicsBody.forces[node2.id].y -= fy;\n }\n }\n}\n\nexport default SpringSolver;\n","/**\n * Hierarchical Spring Solver\n */\nclass HierarchicalSpringSolver {\n /**\n * @param {object} body\n * @param {{physicsNodeIndices: Array, physicsEdgeIndices: Array, forces: {}, velocities: {}}} physicsBody\n * @param {object} options\n */\n constructor(body, physicsBody, options) {\n this.body = body;\n this.physicsBody = physicsBody;\n this.setOptions(options);\n }\n\n /**\n *\n * @param {object} options\n */\n setOptions(options) {\n this.options = options;\n }\n\n /**\n * This function calculates the springforces on the nodes, accounting for the support nodes.\n *\n * @private\n */\n solve() {\n let edgeLength, edge;\n let dx, dy, fx, fy, springForce, distance;\n const edges = this.body.edges;\n const factor = 0.5;\n\n const edgeIndices = this.physicsBody.physicsEdgeIndices;\n const nodeIndices = this.physicsBody.physicsNodeIndices;\n const forces = this.physicsBody.forces;\n\n // initialize the spring force counters\n for (let i = 0; i < nodeIndices.length; i++) {\n const nodeId = nodeIndices[i];\n forces[nodeId].springFx = 0;\n forces[nodeId].springFy = 0;\n }\n\n // forces caused by the edges, modelled as springs\n for (let i = 0; i < edgeIndices.length; i++) {\n edge = edges[edgeIndices[i]];\n if (edge.connected === true) {\n edgeLength =\n edge.options.length === undefined\n ? this.options.springLength\n : edge.options.length;\n\n dx = edge.from.x - edge.to.x;\n dy = edge.from.y - edge.to.y;\n distance = Math.sqrt(dx * dx + dy * dy);\n distance = distance === 0 ? 0.01 : distance;\n\n // the 1/distance is so the fx and fy can be calculated without sine or cosine.\n springForce =\n (this.options.springConstant * (edgeLength - distance)) / distance;\n\n fx = dx * springForce;\n fy = dy * springForce;\n\n if (edge.to.level != edge.from.level) {\n if (forces[edge.toId] !== undefined) {\n forces[edge.toId].springFx -= fx;\n forces[edge.toId].springFy -= fy;\n }\n if (forces[edge.fromId] !== undefined) {\n forces[edge.fromId].springFx += fx;\n forces[edge.fromId].springFy += fy;\n }\n } else {\n if (forces[edge.toId] !== undefined) {\n forces[edge.toId].x -= factor * fx;\n forces[edge.toId].y -= factor * fy;\n }\n if (forces[edge.fromId] !== undefined) {\n forces[edge.fromId].x += factor * fx;\n forces[edge.fromId].y += factor * fy;\n }\n }\n }\n }\n\n // normalize spring forces\n springForce = 1;\n let springFx, springFy;\n for (let i = 0; i < nodeIndices.length; i++) {\n const nodeId = nodeIndices[i];\n springFx = Math.min(\n springForce,\n Math.max(-springForce, forces[nodeId].springFx)\n );\n springFy = Math.min(\n springForce,\n Math.max(-springForce, forces[nodeId].springFy)\n );\n\n forces[nodeId].x += springFx;\n forces[nodeId].y += springFy;\n }\n\n // retain energy balance\n let totalFx = 0;\n let totalFy = 0;\n for (let i = 0; i < nodeIndices.length; i++) {\n const nodeId = nodeIndices[i];\n totalFx += forces[nodeId].x;\n totalFy += forces[nodeId].y;\n }\n const correctionFx = totalFx / nodeIndices.length;\n const correctionFy = totalFy / nodeIndices.length;\n\n for (let i = 0; i < nodeIndices.length; i++) {\n const nodeId = nodeIndices[i];\n forces[nodeId].x -= correctionFx;\n forces[nodeId].y -= correctionFy;\n }\n }\n}\n\nexport default HierarchicalSpringSolver;\n","/**\n * Central Gravity Solver\n */\nclass CentralGravitySolver {\n /**\n * @param {object} body\n * @param {{physicsNodeIndices: Array, physicsEdgeIndices: Array, forces: {}, velocities: {}}} physicsBody\n * @param {object} options\n */\n constructor(body, physicsBody, options) {\n this.body = body;\n this.physicsBody = physicsBody;\n this.setOptions(options);\n }\n\n /**\n *\n * @param {object} options\n */\n setOptions(options) {\n this.options = options;\n }\n\n /**\n * Calculates forces for each node\n */\n solve() {\n let dx, dy, distance, node;\n const nodes = this.body.nodes;\n const nodeIndices = this.physicsBody.physicsNodeIndices;\n const forces = this.physicsBody.forces;\n\n for (let i = 0; i < nodeIndices.length; i++) {\n const nodeId = nodeIndices[i];\n node = nodes[nodeId];\n dx = -node.x;\n dy = -node.y;\n distance = Math.sqrt(dx * dx + dy * dy);\n\n this._calculateForces(distance, dx, dy, forces, node);\n }\n }\n\n /**\n * Calculate the forces based on the distance.\n *\n * @param {number} distance\n * @param {number} dx\n * @param {number} dy\n * @param {object<Node.id, vis.Node>} forces\n * @param {Node} node\n * @private\n */\n _calculateForces(distance, dx, dy, forces, node) {\n const gravityForce =\n distance === 0 ? 0 : this.options.centralGravity / distance;\n forces[node.id].x = dx * gravityForce;\n forces[node.id].y = dy * gravityForce;\n }\n}\n\nexport default CentralGravitySolver;\n","import BarnesHutSolver from \"./BarnesHutSolver\";\nimport { Alea } from \"vis-util/esnext\";\n\n/**\n * @augments BarnesHutSolver\n */\nclass ForceAtlas2BasedRepulsionSolver extends BarnesHutSolver {\n /**\n * @param {object} body\n * @param {{physicsNodeIndices: Array, physicsEdgeIndices: Array, forces: {}, velocities: {}}} physicsBody\n * @param {object} options\n */\n constructor(body, physicsBody, options) {\n super(body, physicsBody, options);\n\n this._rng = Alea(\"FORCE ATLAS 2 BASED REPULSION SOLVER\");\n }\n\n /**\n * Calculate the forces based on the distance.\n *\n * @param {number} distance\n * @param {number} dx\n * @param {number} dy\n * @param {Node} node\n * @param {object} parentBranch\n * @private\n */\n _calculateForces(distance, dx, dy, node, parentBranch) {\n if (distance === 0) {\n distance = 0.1 * this._rng();\n dx = distance;\n }\n\n if (this.overlapAvoidanceFactor < 1 && node.shape.radius) {\n distance = Math.max(\n 0.1 + this.overlapAvoidanceFactor * node.shape.radius,\n distance - node.shape.radius\n );\n }\n\n const degree = node.edges.length + 1;\n // the dividing by the distance cubed instead of squared allows us to get the fx and fy components without sines and cosines\n // it is shorthand for gravityforce with distance squared and fx = dx/distance * gravityForce\n const gravityForce =\n (this.options.gravitationalConstant *\n parentBranch.mass *\n node.options.mass *\n degree) /\n Math.pow(distance, 2);\n const fx = dx * gravityForce;\n const fy = dy * gravityForce;\n\n this.physicsBody.forces[node.id].x += fx;\n this.physicsBody.forces[node.id].y += fy;\n }\n}\n\nexport default ForceAtlas2BasedRepulsionSolver;\n","import CentralGravitySolver from \"./CentralGravitySolver\";\n\n/**\n * @augments CentralGravitySolver\n */\nclass ForceAtlas2BasedCentralGravitySolver extends CentralGravitySolver {\n /**\n * @param {object} body\n * @param {{physicsNodeIndices: Array, physicsEdgeIndices: Array, forces: {}, velocities: {}}} physicsBody\n * @param {object} options\n */\n constructor(body, physicsBody, options) {\n super(body, physicsBody, options);\n }\n\n /**\n * Calculate the forces based on the distance.\n *\n * @param {number} distance\n * @param {number} dx\n * @param {number} dy\n * @param {object<Node.id, Node>} forces\n * @param {Node} node\n * @private\n */\n _calculateForces(distance, dx, dy, forces, node) {\n if (distance > 0) {\n const degree = node.edges.length + 1;\n const gravityForce =\n this.options.centralGravity * degree * node.options.mass;\n forces[node.id].x = dx * gravityForce;\n forces[node.id].y = dy * gravityForce;\n }\n }\n}\n\nexport default ForceAtlas2BasedCentralGravitySolver;\n","import BarnesHutSolver from \"./components/physics/BarnesHutSolver\";\nimport Repulsion from \"./components/physics/RepulsionSolver\";\nimport HierarchicalRepulsion from \"./components/physics/HierarchicalRepulsionSolver\";\nimport SpringSolver from \"./components/physics/SpringSolver\";\nimport HierarchicalSpringSolver from \"./components/physics/HierarchicalSpringSolver\";\nimport CentralGravitySolver from \"./components/physics/CentralGravitySolver\";\nimport ForceAtlas2BasedRepulsionSolver from \"./components/physics/FA2BasedRepulsionSolver\";\nimport ForceAtlas2BasedCentralGravitySolver from \"./components/physics/FA2BasedCentralGravitySolver\";\nimport {\n HSVToHex,\n mergeOptions,\n selectiveNotDeepExtend,\n} from \"vis-util/esnext\";\nimport { EndPoints } from \"./components/edges\"; // for debugging with _drawForces()\n\n/**\n * The physics engine\n */\nclass PhysicsEngine {\n /**\n * @param {object} body\n */\n constructor(body) {\n this.body = body;\n this.physicsBody = {\n physicsNodeIndices: [],\n physicsEdgeIndices: [],\n forces: {},\n velocities: {},\n };\n\n this.physicsEnabled = true;\n this.simulationInterval = 1000 / 60;\n this.requiresTimeout = true;\n this.previousStates = {};\n this.referenceState = {};\n this.freezeCache = {};\n this.renderTimer = undefined;\n\n // parameters for the adaptive timestep\n this.adaptiveTimestep = false;\n this.adaptiveTimestepEnabled = false;\n this.adaptiveCounter = 0;\n this.adaptiveInterval = 3;\n\n this.stabilized = false;\n this.startedStabilization = false;\n this.stabilizationIterations = 0;\n this.ready = false; // will be set to true if the stabilize\n\n // default options\n this.options = {};\n this.defaultOptions = {\n enabled: true,\n barnesHut: {\n theta: 0.5,\n gravitationalConstant: -2000,\n centralGravity: 0.3,\n springLength: 95,\n springConstant: 0.04,\n damping: 0.09,\n avoidOverlap: 0,\n },\n forceAtlas2Based: {\n theta: 0.5,\n gravitationalConstant: -50,\n centralGravity: 0.01,\n springConstant: 0.08,\n springLength: 100,\n damping: 0.4,\n avoidOverlap: 0,\n },\n repulsion: {\n centralGravity: 0.2,\n springLength: 200,\n springConstant: 0.05,\n nodeDistance: 100,\n damping: 0.09,\n avoidOverlap: 0,\n },\n hierarchicalRepulsion: {\n centralGravity: 0.0,\n springLength: 100,\n springConstant: 0.01,\n nodeDistance: 120,\n damping: 0.09,\n },\n maxVelocity: 50,\n minVelocity: 0.75, // px/s\n solver: \"barnesHut\",\n stabilization: {\n enabled: true,\n iterations: 1000, // maximum number of iteration to stabilize\n updateInterval: 50,\n onlyDynamicEdges: false,\n fit: true,\n },\n timestep: 0.5,\n adaptiveTimestep: true,\n wind: { x: 0, y: 0 },\n };\n Object.assign(this.options, this.defaultOptions);\n this.timestep = 0.5;\n this.layoutFailed = false;\n\n this.bindEventListeners();\n }\n\n /**\n * Binds event listeners\n */\n bindEventListeners() {\n this.body.emitter.on(\"initPhysics\", () => {\n this.initPhysics();\n });\n this.body.emitter.on(\"_layoutFailed\", () => {\n this.layoutFailed = true;\n });\n this.body.emitter.on(\"resetPhysics\", () => {\n this.stopSimulation();\n this.ready = false;\n });\n this.body.emitter.on(\"disablePhysics\", () => {\n this.physicsEnabled = false;\n this.stopSimulation();\n });\n this.body.emitter.on(\"restorePhysics\", () => {\n this.setOptions(this.options);\n if (this.ready === true) {\n this.startSimulation();\n }\n });\n this.body.emitter.on(\"startSimulation\", () => {\n if (this.ready === true) {\n this.startSimulation();\n }\n });\n this.body.emitter.on(\"stopSimulation\", () => {\n this.stopSimulation();\n });\n this.body.emitter.on(\"destroy\", () => {\n this.stopSimulation(false);\n this.body.emitter.off();\n });\n this.body.emitter.on(\"_dataChanged\", () => {\n // Nodes and/or edges have been added or removed, update shortcut lists.\n this.updatePhysicsData();\n });\n\n // debug: show forces\n // this.body.emitter.on(\"afterDrawing\", (ctx) => {this._drawForces(ctx);});\n }\n\n /**\n * set the physics options\n *\n * @param {object} options\n */\n setOptions(options) {\n if (options !== undefined) {\n if (options === false) {\n this.options.enabled = false;\n this.physicsEnabled = false;\n this.stopSimulation();\n } else if (options === true) {\n this.options.enabled = true;\n this.physicsEnabled = true;\n this.startSimulation();\n } else {\n this.physicsEnabled = true;\n selectiveNotDeepExtend([\"stabilization\"], this.options, options);\n mergeOptions(this.options, options, \"stabilization\");\n\n if (options.enabled === undefined) {\n this.options.enabled = true;\n }\n\n if (this.options.enabled === false) {\n this.physicsEnabled = false;\n this.stopSimulation();\n }\n\n const wind = this.options.wind;\n if (wind) {\n if (typeof wind.x !== \"number\" || Number.isNaN(wind.x)) {\n wind.x = 0;\n }\n if (typeof wind.y !== \"number\" || Number.isNaN(wind.y)) {\n wind.y = 0;\n }\n }\n\n // set the timestep\n this.timestep = this.options.timestep;\n }\n }\n this.init();\n }\n\n /**\n * configure the engine.\n */\n init() {\n let options;\n if (this.options.solver === \"forceAtlas2Based\") {\n options = this.options.forceAtlas2Based;\n this.nodesSolver = new ForceAtlas2BasedRepulsionSolver(\n this.body,\n this.physicsBody,\n options\n );\n this.edgesSolver = new SpringSolver(this.body, this.physicsBody, options);\n this.gravitySolver = new ForceAtlas2BasedCentralGravitySolver(\n this.body,\n this.physicsBody,\n options\n );\n } else if (this.options.solver === \"repulsion\") {\n options = this.options.repulsion;\n this.nodesSolver = new Repulsion(this.body, this.physicsBody, options);\n this.edgesSolver = new SpringSolver(this.body, this.physicsBody, options);\n this.gravitySolver = new CentralGravitySolver(\n this.body,\n this.physicsBody,\n options\n );\n } else if (this.options.solver === \"hierarchicalRepulsion\") {\n options = this.options.hierarchicalRepulsion;\n this.nodesSolver = new HierarchicalRepulsion(\n this.body,\n this.physicsBody,\n options\n );\n this.edgesSolver = new HierarchicalSpringSolver(\n this.body,\n this.physicsBody,\n options\n );\n this.gravitySolver = new CentralGravitySolver(\n this.body,\n this.physicsBody,\n options\n );\n } else {\n // barnesHut\n options = this.options.barnesHut;\n this.nodesSolver = new BarnesHutSolver(\n this.body,\n this.physicsBody,\n options\n );\n this.edgesSolver = new SpringSolver(this.body, this.physicsBody, options);\n this.gravitySolver = new CentralGravitySolver(\n this.body,\n this.physicsBody,\n options\n );\n }\n\n this.modelOptions = options;\n }\n\n /**\n * initialize the engine\n */\n initPhysics() {\n if (this.physicsEnabled === true && this.options.enabled === true) {\n if (this.options.stabilization.enabled === true) {\n this.stabilize();\n } else {\n this.stabilized = false;\n this.ready = true;\n this.body.emitter.emit(\"fit\", {}, this.layoutFailed); // if the layout failed, we use the approximation for the zoom\n this.startSimulation();\n }\n } else {\n this.ready = true;\n this.body.emitter.emit(\"fit\");\n }\n }\n\n /**\n * Start the simulation\n */\n startSimulation() {\n if (this.physicsEnabled === true && this.options.enabled === true) {\n this.stabilized = false;\n\n // when visible, adaptivity is disabled.\n this.adaptiveTimestep = false;\n\n // this sets the width of all nodes initially which could be required for the avoidOverlap\n this.body.emitter.emit(\"_resizeNodes\");\n if (this.viewFunction === undefined) {\n this.viewFunction = this.simulationStep.bind(this);\n this.body.emitter.on(\"initRedraw\", this.viewFunction);\n this.body.emitter.emit(\"_startRendering\");\n }\n } else {\n this.body.emitter.emit(\"_redraw\");\n }\n }\n\n /**\n * Stop the simulation, force stabilization.\n *\n * @param {boolean} [emit=true]\n */\n stopSimulation(emit = true) {\n this.stabilized = true;\n if (emit === true) {\n this._emitStabilized();\n }\n if (this.viewFunction !== undefined) {\n this.body.emitter.off(\"initRedraw\", this.viewFunction);\n this.viewFunction = undefined;\n if (emit === true) {\n this.body.emitter.emit(\"_stopRendering\");\n }\n }\n }\n\n /**\n * The viewFunction inserts this step into each render loop. It calls the physics tick and handles the cleanup at stabilized.\n *\n */\n simulationStep() {\n // check if the physics have settled\n const startTime = Date.now();\n this.physicsTick();\n const physicsTime = Date.now() - startTime;\n\n // run double speed if it is a little graph\n if (\n (physicsTime < 0.4 * this.simulationInterval ||\n this.runDoubleSpeed === true) &&\n this.stabilized === false\n ) {\n this.physicsTick();\n\n // this makes sure there is no jitter. The decision is taken once to run it at double speed.\n this.runDoubleSpeed = true;\n }\n\n if (this.stabilized === true) {\n this.stopSimulation();\n }\n }\n\n /**\n * trigger the stabilized event.\n *\n * @param {number} [amountOfIterations=this.stabilizationIterations]\n * @private\n */\n _emitStabilized(amountOfIterations = this.stabilizationIterations) {\n if (\n this.stabilizationIterations > 1 ||\n this.startedStabilization === true\n ) {\n setTimeout(() => {\n this.body.emitter.emit(\"stabilized\", {\n iterations: amountOfIterations,\n });\n this.startedStabilization = false;\n this.stabilizationIterations = 0;\n }, 0);\n }\n }\n\n /**\n * Calculate the forces for one physics iteration and move the nodes.\n *\n * @private\n */\n physicsStep() {\n this.gravitySolver.solve();\n this.nodesSolver.solve();\n this.edgesSolver.solve();\n this.moveNodes();\n }\n\n /**\n * Make dynamic adjustments to the timestep, based on current state.\n *\n * Helper function for physicsTick().\n *\n * @private\n */\n adjustTimeStep() {\n const factor = 1.2; // Factor for increasing the timestep on success.\n\n // we compare the two steps. if it is acceptable we double the step.\n if (this._evaluateStepQuality() === true) {\n this.timestep = factor * this.timestep;\n } else {\n // if not, we decrease the step to a minimum of the options timestep.\n // if the decreased timestep is smaller than the options step, we do not reset the counter\n // we assume that the options timestep is stable enough.\n if (this.timestep / factor < this.options.timestep) {\n this.timestep = this.options.timestep;\n } else {\n // if the timestep was larger than 2 times the option one we check the adaptivity again to ensure\n // that large instabilities do not form.\n this.adaptiveCounter = -1; // check again next iteration\n this.timestep = Math.max(this.options.timestep, this.timestep / factor);\n }\n }\n }\n\n /**\n * A single simulation step (or 'tick') in the physics simulation\n *\n * @private\n */\n physicsTick() {\n this._startStabilizing(); // this ensures that there is no start event when the network is already stable.\n if (this.stabilized === true) return;\n\n // adaptivity means the timestep adapts to the situation, only applicable for stabilization\n if (\n this.adaptiveTimestep === true &&\n this.adaptiveTimestepEnabled === true\n ) {\n // timestep remains stable for \"interval\" iterations.\n const doAdaptive = this.adaptiveCounter % this.adaptiveInterval === 0;\n\n if (doAdaptive) {\n // first the big step and revert.\n this.timestep = 2 * this.timestep;\n this.physicsStep();\n this.revert(); // saves the reference state\n\n // now the normal step. Since this is the last step, it is the more stable one and we will take this.\n this.timestep = 0.5 * this.timestep;\n\n // since it's half the step, we do it twice.\n this.physicsStep();\n this.physicsStep();\n\n this.adjustTimeStep();\n } else {\n this.physicsStep(); // normal step, keeping timestep constant\n }\n\n this.adaptiveCounter += 1;\n } else {\n // case for the static timestep, we reset it to the one in options and take a normal step.\n this.timestep = this.options.timestep;\n this.physicsStep();\n }\n\n if (this.stabilized === true) this.revert();\n this.stabilizationIterations++;\n }\n\n /**\n * Nodes and edges can have the physics toggles on or off. A collection of indices is created here so we can skip the check all the time.\n *\n * @private\n */\n updatePhysicsData() {\n this.physicsBody.forces = {};\n this.physicsBody.physicsNodeIndices = [];\n this.physicsBody.physicsEdgeIndices = [];\n const nodes = this.body.nodes;\n const edges = this.body.edges;\n\n // get node indices for physics\n for (const nodeId in nodes) {\n if (Object.prototype.hasOwnProperty.call(nodes, nodeId)) {\n if (nodes[nodeId].options.physics === true) {\n this.physicsBody.physicsNodeIndices.push(nodes[nodeId].id);\n }\n }\n }\n\n // get edge indices for physics\n for (const edgeId in edges) {\n if (Object.prototype.hasOwnProperty.call(edges, edgeId)) {\n if (edges[edgeId].options.physics === true) {\n this.physicsBody.physicsEdgeIndices.push(edges[edgeId].id);\n }\n }\n }\n\n // get the velocity and the forces vector\n for (let i = 0; i < this.physicsBody.physicsNodeIndices.length; i++) {\n const nodeId = this.physicsBody.physicsNodeIndices[i];\n this.physicsBody.forces[nodeId] = { x: 0, y: 0 };\n\n // forces can be reset because they are recalculated. Velocities have to persist.\n if (this.physicsBody.velocities[nodeId] === undefined) {\n this.physicsBody.velocities[nodeId] = { x: 0, y: 0 };\n }\n }\n\n // clean deleted nodes from the velocity vector\n for (const nodeId in this.physicsBody.velocities) {\n if (nodes[nodeId] === undefined) {\n delete this.physicsBody.velocities[nodeId];\n }\n }\n }\n\n /**\n * Revert the simulation one step. This is done so after stabilization, every new start of the simulation will also say stabilized.\n */\n revert() {\n const nodeIds = Object.keys(this.previousStates);\n const nodes = this.body.nodes;\n const velocities = this.physicsBody.velocities;\n this.referenceState = {};\n\n for (let i = 0; i < nodeIds.length; i++) {\n const nodeId = nodeIds[i];\n if (nodes[nodeId] !== undefined) {\n if (nodes[nodeId].options.physics === true) {\n this.referenceState[nodeId] = {\n positions: { x: nodes[nodeId].x, y: nodes[nodeId].y },\n };\n velocities[nodeId].x = this.previousStates[nodeId].vx;\n velocities[nodeId].y = this.previousStates[nodeId].vy;\n nodes[nodeId].x = this.previousStates[nodeId].x;\n nodes[nodeId].y = this.previousStates[nodeId].y;\n }\n } else {\n delete this.previousStates[nodeId];\n }\n }\n }\n\n /**\n * This compares the reference state to the current state\n *\n * @returns {boolean}\n * @private\n */\n _evaluateStepQuality() {\n let dx, dy, dpos;\n const nodes = this.body.nodes;\n const reference = this.referenceState;\n const posThreshold = 0.3;\n\n for (const nodeId in this.referenceState) {\n if (\n Object.prototype.hasOwnProperty.call(this.referenceState, nodeId) &&\n nodes[nodeId] !== undefined\n ) {\n dx = nodes[nodeId].x - reference[nodeId].positions.x;\n dy = nodes[nodeId].y - reference[nodeId].positions.y;\n\n dpos = Math.sqrt(Math.pow(dx, 2) + Math.pow(dy, 2));\n\n if (dpos > posThreshold) {\n return false;\n }\n }\n }\n return true;\n }\n\n /**\n * move the nodes one timestep and check if they are stabilized\n */\n moveNodes() {\n const nodeIndices = this.physicsBody.physicsNodeIndices;\n let maxNodeVelocity = 0;\n let averageNodeVelocity = 0;\n\n // the velocity threshold (energy in the system) for the adaptivity toggle\n const velocityAdaptiveThreshold = 5;\n\n for (let i = 0; i < nodeIndices.length; i++) {\n const nodeId = nodeIndices[i];\n const nodeVelocity = this._performStep(nodeId);\n // stabilized is true if stabilized is true and velocity is smaller than vmin --> all nodes must be stabilized\n maxNodeVelocity = Math.max(maxNodeVelocity, nodeVelocity);\n averageNodeVelocity += nodeVelocity;\n }\n\n // evaluating the stabilized and adaptiveTimestepEnabled conditions\n this.adaptiveTimestepEnabled =\n averageNodeVelocity / nodeIndices.length < velocityAdaptiveThreshold;\n this.stabilized = maxNodeVelocity < this.options.minVelocity;\n }\n\n /**\n * Calculate new velocity for a coordinate direction\n *\n * @param {number} v velocity for current coordinate\n * @param {number} f regular force for current coordinate\n * @param {number} m mass of current node\n * @returns {number} new velocity for current coordinate\n * @private\n */\n calculateComponentVelocity(v, f, m) {\n const df = this.modelOptions.damping * v; // damping force\n const a = (f - df) / m; // acceleration\n\n v += a * this.timestep;\n\n // Put a limit on the velocities if it is really high\n const maxV = this.options.maxVelocity || 1e9;\n if (Math.abs(v) > maxV) {\n v = v > 0 ? maxV : -maxV;\n }\n\n return v;\n }\n\n /**\n * Perform the actual step\n *\n * @param {Node.id} nodeId\n * @returns {number} the new velocity of given node\n * @private\n */\n _performStep(nodeId) {\n const node = this.body.nodes[nodeId];\n const force = this.physicsBody.forces[nodeId];\n\n if (this.options.wind) {\n force.x += this.options.wind.x;\n force.y += this.options.wind.y;\n }\n\n const velocity = this.physicsBody.velocities[nodeId];\n\n // store the state so we can revert\n this.previousStates[nodeId] = {\n x: node.x,\n y: node.y,\n vx: velocity.x,\n vy: velocity.y,\n };\n\n if (node.options.fixed.x === false) {\n velocity.x = this.calculateComponentVelocity(\n velocity.x,\n force.x,\n node.options.mass\n );\n node.x += velocity.x * this.timestep;\n } else {\n force.x = 0;\n velocity.x = 0;\n }\n\n if (node.options.fixed.y === false) {\n velocity.y = this.calculateComponentVelocity(\n velocity.y,\n force.y,\n node.options.mass\n );\n node.y += velocity.y * this.timestep;\n } else {\n force.y = 0;\n velocity.y = 0;\n }\n\n const totalVelocity = Math.sqrt(\n Math.pow(velocity.x, 2) + Math.pow(velocity.y, 2)\n );\n return totalVelocity;\n }\n\n /**\n * When initializing and stabilizing, we can freeze nodes with a predefined position.\n * This greatly speeds up stabilization because only the supportnodes for the smoothCurves have to settle.\n *\n * @private\n */\n _freezeNodes() {\n const nodes = this.body.nodes;\n for (const id in nodes) {\n if (Object.prototype.hasOwnProperty.call(nodes, id)) {\n if (nodes[id].x && nodes[id].y) {\n const fixed = nodes[id].options.fixed;\n this.freezeCache[id] = { x: fixed.x, y: fixed.y };\n fixed.x = true;\n fixed.y = true;\n }\n }\n }\n }\n\n /**\n * Unfreezes the nodes that have been frozen by _freezeDefinedNodes.\n *\n * @private\n */\n _restoreFrozenNodes() {\n const nodes = this.body.nodes;\n for (const id in nodes) {\n if (Object.prototype.hasOwnProperty.call(nodes, id)) {\n if (this.freezeCache[id] !== undefined) {\n nodes[id].options.fixed.x = this.freezeCache[id].x;\n nodes[id].options.fixed.y = this.freezeCache[id].y;\n }\n }\n }\n this.freezeCache = {};\n }\n\n /**\n * Find a stable position for all nodes\n *\n * @param {number} [iterations=this.options.stabilization.iterations]\n */\n stabilize(iterations = this.options.stabilization.iterations) {\n if (typeof iterations !== \"number\") {\n iterations = this.options.stabilization.iterations;\n console.error(\n \"The stabilize method needs a numeric amount of iterations. Switching to default: \",\n iterations\n );\n }\n\n if (this.physicsBody.physicsNodeIndices.length === 0) {\n this.ready = true;\n return;\n }\n\n // enable adaptive timesteps\n this.adaptiveTimestep = true && this.options.adaptiveTimestep;\n\n // this sets the width of all nodes initially which could be required for the avoidOverlap\n this.body.emitter.emit(\"_resizeNodes\");\n\n this.stopSimulation(); // stop the render loop\n this.stabilized = false;\n\n // block redraw requests\n this.body.emitter.emit(\"_blockRedraw\");\n this.targetIterations = iterations;\n\n // start the stabilization\n if (this.options.stabilization.onlyDynamicEdges === true) {\n this._freezeNodes();\n }\n this.stabilizationIterations = 0;\n\n setTimeout(() => this._stabilizationBatch(), 0);\n }\n\n /**\n * If not already stabilizing, start it and emit a start event.\n *\n * @returns {boolean} true if stabilization started with this call\n * @private\n */\n _startStabilizing() {\n if (this.startedStabilization === true) return false;\n\n this.body.emitter.emit(\"startStabilizing\");\n this.startedStabilization = true;\n return true;\n }\n\n /**\n * One batch of stabilization\n *\n * @private\n */\n _stabilizationBatch() {\n const running = () =>\n this.stabilized === false &&\n this.stabilizationIterations < this.targetIterations;\n\n const sendProgress = () => {\n this.body.emitter.emit(\"stabilizationProgress\", {\n iterations: this.stabilizationIterations,\n total: this.targetIterations,\n });\n };\n\n if (this._startStabilizing()) {\n sendProgress(); // Ensure that there is at least one start event.\n }\n\n let count = 0;\n while (running() && count < this.options.stabilization.updateInterval) {\n this.physicsTick();\n count++;\n }\n\n sendProgress();\n\n if (running()) {\n setTimeout(this._stabilizationBatch.bind(this), 0);\n } else {\n this._finalizeStabilization();\n }\n }\n\n /**\n * Wrap up the stabilization, fit and emit the events.\n *\n * @private\n */\n _finalizeStabilization() {\n this.body.emitter.emit(\"_allowRedraw\");\n if (this.options.stabilization.fit === true) {\n this.body.emitter.emit(\"fit\");\n }\n\n if (this.options.stabilization.onlyDynamicEdges === true) {\n this._restoreFrozenNodes();\n }\n\n this.body.emitter.emit(\"stabilizationIterationsDone\");\n this.body.emitter.emit(\"_requestRedraw\");\n\n if (this.stabilized === true) {\n this._emitStabilized();\n } else {\n this.startSimulation();\n }\n\n this.ready = true;\n }\n\n //--------------------------- DEBUGGING BELOW ---------------------------//\n\n /**\n * Debug function that display arrows for the forces currently active in the network.\n *\n * Use this when debugging only.\n *\n * @param {CanvasRenderingContext2D} ctx\n * @private\n */\n _drawForces(ctx) {\n for (let i = 0; i < this.physicsBody.physicsNodeIndices.length; i++) {\n const index = this.physicsBody.physicsNodeIndices[i];\n const node = this.body.nodes[index];\n const force = this.physicsBody.forces[index];\n const factor = 20;\n const colorFactor = 0.03;\n const forceSize = Math.sqrt(Math.pow(force.x, 2) + Math.pow(force.x, 2));\n\n const size = Math.min(Math.max(5, forceSize), 15);\n const arrowSize = 3 * size;\n\n const color = HSVToHex(\n (180 - Math.min(1, Math.max(0, colorFactor * forceSize)) * 180) / 360,\n 1,\n 1\n );\n\n const point = {\n x: node.x + factor * force.x,\n y: node.y + factor * force.y,\n };\n\n ctx.lineWidth = size;\n ctx.strokeStyle = color;\n ctx.beginPath();\n ctx.moveTo(node.x, node.y);\n ctx.lineTo(point.x, point.y);\n ctx.stroke();\n\n const angle = Math.atan2(force.y, force.x);\n ctx.fillStyle = color;\n EndPoints.draw(ctx, {\n type: \"arrow\",\n point: point,\n angle: angle,\n length: arrowSize,\n });\n ctx.fill();\n }\n }\n}\n\nexport default PhysicsEngine;\n","import { deepExtend } from \"vis-util/esnext\";\n\n/**\n * Utility Class\n */\nclass NetworkUtil {\n /**\n * @ignore\n */\n constructor() {}\n\n /**\n * Find the center position of the network considering the bounding boxes\n *\n * @param {Array.<Node>} allNodes\n * @param {Array.<Node>} [specificNodes=[]]\n * @returns {{minX: number, maxX: number, minY: number, maxY: number}}\n * @static\n */\n static getRange(allNodes, specificNodes = []) {\n let minY = 1e9,\n maxY = -1e9,\n minX = 1e9,\n maxX = -1e9,\n node;\n if (specificNodes.length > 0) {\n for (let i = 0; i < specificNodes.length; i++) {\n node = allNodes[specificNodes[i]];\n if (minX > node.shape.boundingBox.left) {\n minX = node.shape.boundingBox.left;\n }\n if (maxX < node.shape.boundingBox.right) {\n maxX = node.shape.boundingBox.right;\n }\n if (minY > node.shape.boundingBox.top) {\n minY = node.shape.boundingBox.top;\n } // top is negative, bottom is positive\n if (maxY < node.shape.boundingBox.bottom) {\n maxY = node.shape.boundingBox.bottom;\n } // top is negative, bottom is positive\n }\n }\n\n if (minX === 1e9 && maxX === -1e9 && minY === 1e9 && maxY === -1e9) {\n (minY = 0), (maxY = 0), (minX = 0), (maxX = 0);\n }\n return { minX: minX, maxX: maxX, minY: minY, maxY: maxY };\n }\n\n /**\n * Find the center position of the network\n *\n * @param {Array.<Node>} allNodes\n * @param {Array.<Node>} [specificNodes=[]]\n * @returns {{minX: number, maxX: number, minY: number, maxY: number}}\n * @static\n */\n static getRangeCore(allNodes, specificNodes = []) {\n let minY = 1e9,\n maxY = -1e9,\n minX = 1e9,\n maxX = -1e9,\n node;\n if (specificNodes.length > 0) {\n for (let i = 0; i < specificNodes.length; i++) {\n node = allNodes[specificNodes[i]];\n if (minX > node.x) {\n minX = node.x;\n }\n if (maxX < node.x) {\n maxX = node.x;\n }\n if (minY > node.y) {\n minY = node.y;\n } // top is negative, bottom is positive\n if (maxY < node.y) {\n maxY = node.y;\n } // top is negative, bottom is positive\n }\n }\n\n if (minX === 1e9 && maxX === -1e9 && minY === 1e9 && maxY === -1e9) {\n (minY = 0), (maxY = 0), (minX = 0), (maxX = 0);\n }\n return { minX: minX, maxX: maxX, minY: minY, maxY: maxY };\n }\n\n /**\n * @param {object} range = {minX: minX, maxX: maxX, minY: minY, maxY: maxY};\n * @returns {{x: number, y: number}}\n * @static\n */\n static findCenter(range) {\n return {\n x: 0.5 * (range.maxX + range.minX),\n y: 0.5 * (range.maxY + range.minY),\n };\n }\n\n /**\n * This returns a clone of the options or options of the edge or node to be used for construction of new edges or check functions for new nodes.\n *\n * @param {vis.Item} item\n * @param {'node'|undefined} type\n * @returns {{}}\n * @static\n */\n static cloneOptions(item, type) {\n const clonedOptions = {};\n if (type === undefined || type === \"node\") {\n deepExtend(clonedOptions, item.options, true);\n clonedOptions.x = item.x;\n clonedOptions.y = item.y;\n clonedOptions.amountOfConnections = item.edges.length;\n } else {\n deepExtend(clonedOptions, item.options, true);\n }\n return clonedOptions;\n }\n}\n\nexport default NetworkUtil;\n","import { forEach } from \"vis-util/esnext\";\nimport Node from \"../Node\";\n\n/**\n * A Cluster is a special Node that allows a group of Nodes positioned closely together\n * to be represented by a single Cluster Node.\n *\n * @augments Node\n */\nclass Cluster extends Node {\n /**\n * @param {object} options\n * @param {object} body\n * @param {Array.<HTMLImageElement>}imagelist\n * @param {Array} grouplist\n * @param {object} globalOptions\n * @param {object} defaultOptions Global default options for nodes\n */\n constructor(\n options,\n body,\n imagelist,\n grouplist,\n globalOptions,\n defaultOptions\n ) {\n super(options, body, imagelist, grouplist, globalOptions, defaultOptions);\n\n this.isCluster = true;\n this.containedNodes = {};\n this.containedEdges = {};\n }\n\n /**\n * Transfer child cluster data to current and disconnect the child cluster.\n *\n * Please consult the header comment in 'Clustering.js' for the fields set here.\n *\n * @param {string|number} childClusterId id of child cluster to open\n */\n _openChildCluster(childClusterId) {\n const childCluster = this.body.nodes[childClusterId];\n if (this.containedNodes[childClusterId] === undefined) {\n throw new Error(\n \"node with id: \" + childClusterId + \" not in current cluster\"\n );\n }\n if (!childCluster.isCluster) {\n throw new Error(\"node with id: \" + childClusterId + \" is not a cluster\");\n }\n\n // Disconnect child cluster from current cluster\n delete this.containedNodes[childClusterId];\n forEach(childCluster.edges, (edge) => {\n delete this.containedEdges[edge.id];\n });\n\n // Transfer nodes and edges\n forEach(childCluster.containedNodes, (node, nodeId) => {\n this.containedNodes[nodeId] = node;\n });\n childCluster.containedNodes = {};\n\n forEach(childCluster.containedEdges, (edge, edgeId) => {\n this.containedEdges[edgeId] = edge;\n });\n childCluster.containedEdges = {};\n\n // Transfer edges within cluster edges which are clustered\n forEach(childCluster.edges, (clusterEdge) => {\n forEach(this.edges, (parentClusterEdge) => {\n // Assumption: a clustered edge can only be present in a single clustering edge\n // Not tested here\n const index = parentClusterEdge.clusteringEdgeReplacingIds.indexOf(\n clusterEdge.id\n );\n if (index === -1) return;\n\n forEach(clusterEdge.clusteringEdgeReplacingIds, (srcId) => {\n parentClusterEdge.clusteringEdgeReplacingIds.push(srcId);\n\n // Maintain correct bookkeeping for transferred edge\n this.body.edges[srcId].edgeReplacedById = parentClusterEdge.id;\n });\n\n // Remove cluster edge from parent cluster edge\n parentClusterEdge.clusteringEdgeReplacingIds.splice(index, 1);\n });\n });\n childCluster.edges = [];\n }\n}\n\nexport default Cluster;\n","/* ===========================================================================\n\n# TODO\n\n- `edgeReplacedById` not cleaned up yet on cluster edge removal\n- allowSingleNodeCluster could be a global option as well; currently needs to always\n be passed to clustering methods\n\n----------------------------------------------\n\n# State Model for Clustering\n\nThe total state for clustering is non-trivial. It is useful to have a model\navailable as to how it works. The following documents the relevant state items.\n\n\n## Network State\n\nThe following `network`-members are relevant to clustering:\n\n- `body.nodes` - all nodes actively participating in the network\n- `body.edges` - same for edges\n- `body.nodeIndices` - id's of nodes that are visible at a given moment\n- `body.edgeIndices` - same for edges\n\nThis includes:\n\n- helper nodes for dragging in `manipulation`\n- helper nodes for edge type `dynamic`\n- cluster nodes and edges\n- there may be more than this.\n\nA node/edge may be missing in the `Indices` member if:\n\n- it is a helper node\n- the node or edge state has option `hidden` set\n- It is not visible due to clustering\n\n\n## Clustering State\n\nFor the hashes, the id's of the nodes/edges are used as key.\n\nMember `network.clustering` contains the following items:\n\n- `clusteredNodes` - hash with values: { clusterId: <id of cluster>, node: <node instance>}\n- `clusteredEdges` - hash with values: restore information for given edge\n\n\nDue to nesting of clusters, these members can contain cluster nodes and edges as well.\n\nThe important thing to note here, is that the clustered nodes and edges also\nappear in the members of the cluster nodes. For data update, it is therefore\nimportant to scan these lists as well as the cluster nodes.\n\n\n### Cluster Node\n\nA cluster node has the following extra fields:\n\n- `isCluster : true` - indication that this is a cluster node\n- `containedNodes` - hash of nodes contained in this cluster\n- `containedEdges` - same for edges\n- `edges` - array of cluster edges for this node\n\n\n**NOTE:**\n\n- `containedEdges` can also contain edges which are not clustered; e.g. an edge\n connecting two nodes in the same cluster.\n\n\n### Cluster Edge\n\nThese are the items in the `edges` member of a clustered node. They have the\nfollowing relevant members:\n\n- 'clusteringEdgeReplacingIds` - array of id's of edges replaced by this edge\n\nNote that it's possible to nest clusters, so that `clusteringEdgeReplacingIds`\ncan contain edge id's of other clusters.\n\n\n### Clustered Edge\n\nThis is any edge contained by a cluster edge. It gets the following additional\nmember:\n\n- `edgeReplacedById` - id of the cluster edge in which current edge is clustered\n\n\n =========================================================================== */\nimport { deepExtend, forEach } from \"vis-util/esnext\";\nimport { v4 as randomUUID } from \"uuid\";\nimport NetworkUtil from \"../NetworkUtil\";\nimport Cluster from \"./components/nodes/Cluster\";\nimport Edge from \"./components/Edge\"; // Only needed for check on type!\nimport Node from \"./components/Node\"; // Only needed for check on type!\n\n/**\n * The clustering engine\n */\nclass ClusterEngine {\n /**\n * @param {object} body\n */\n constructor(body) {\n this.body = body;\n this.clusteredNodes = {}; // key: node id, value: { clusterId: <id of cluster>, node: <node instance>}\n this.clusteredEdges = {}; // key: edge id, value: restore information for given edge\n\n this.options = {};\n this.defaultOptions = {};\n Object.assign(this.options, this.defaultOptions);\n\n this.body.emitter.on(\"_resetData\", () => {\n this.clusteredNodes = {};\n this.clusteredEdges = {};\n });\n }\n\n /**\n *\n * @param {number} hubsize\n * @param {object} options\n */\n clusterByHubsize(hubsize, options) {\n if (hubsize === undefined) {\n hubsize = this._getHubSize();\n } else if (typeof hubsize === \"object\") {\n options = this._checkOptions(hubsize);\n hubsize = this._getHubSize();\n }\n\n const nodesToCluster = [];\n for (let i = 0; i < this.body.nodeIndices.length; i++) {\n const node = this.body.nodes[this.body.nodeIndices[i]];\n if (node.edges.length >= hubsize) {\n nodesToCluster.push(node.id);\n }\n }\n\n for (let i = 0; i < nodesToCluster.length; i++) {\n this.clusterByConnection(nodesToCluster[i], options, true);\n }\n\n this.body.emitter.emit(\"_dataChanged\");\n }\n\n /**\n * loop over all nodes, check if they adhere to the condition and cluster if needed.\n *\n * @param {object} options\n * @param {boolean} [refreshData=true]\n */\n cluster(options = {}, refreshData = true) {\n if (options.joinCondition === undefined) {\n throw new Error(\n \"Cannot call clusterByNodeData without a joinCondition function in the options.\"\n );\n }\n\n // check if the options object is fine, append if needed\n options = this._checkOptions(options);\n\n const childNodesObj = {};\n const childEdgesObj = {};\n\n // collect the nodes that will be in the cluster\n forEach(this.body.nodes, (node, nodeId) => {\n if (node.options && options.joinCondition(node.options) === true) {\n childNodesObj[nodeId] = node;\n\n // collect the edges that will be in the cluster\n forEach(node.edges, (edge) => {\n if (this.clusteredEdges[edge.id] === undefined) {\n childEdgesObj[edge.id] = edge;\n }\n });\n }\n });\n\n this._cluster(childNodesObj, childEdgesObj, options, refreshData);\n }\n\n /**\n * Cluster all nodes in the network that have only X edges\n *\n * @param {number} edgeCount\n * @param {object} options\n * @param {boolean} [refreshData=true]\n */\n clusterByEdgeCount(edgeCount, options, refreshData = true) {\n options = this._checkOptions(options);\n const clusters = [];\n const usedNodes = {};\n let edge, edges, relevantEdgeCount;\n // collect the nodes that will be in the cluster\n for (let i = 0; i < this.body.nodeIndices.length; i++) {\n const childNodesObj = {};\n const childEdgesObj = {};\n const nodeId = this.body.nodeIndices[i];\n const node = this.body.nodes[nodeId];\n\n // if this node is already used in another cluster this session, we do not have to re-evaluate it.\n if (usedNodes[nodeId] === undefined) {\n relevantEdgeCount = 0;\n edges = [];\n for (let j = 0; j < node.edges.length; j++) {\n edge = node.edges[j];\n if (this.clusteredEdges[edge.id] === undefined) {\n if (edge.toId !== edge.fromId) {\n relevantEdgeCount++;\n }\n edges.push(edge);\n }\n }\n\n // this node qualifies, we collect its neighbours to start the clustering process.\n if (relevantEdgeCount === edgeCount) {\n const checkJoinCondition = function (node) {\n if (\n options.joinCondition === undefined ||\n options.joinCondition === null\n ) {\n return true;\n }\n\n const clonedOptions = NetworkUtil.cloneOptions(node);\n return options.joinCondition(clonedOptions);\n };\n\n let gatheringSuccessful = true;\n for (let j = 0; j < edges.length; j++) {\n edge = edges[j];\n const childNodeId = this._getConnectedId(edge, nodeId);\n // add the nodes to the list by the join condition.\n if (checkJoinCondition(node)) {\n childEdgesObj[edge.id] = edge;\n childNodesObj[nodeId] = node;\n childNodesObj[childNodeId] = this.body.nodes[childNodeId];\n usedNodes[nodeId] = true;\n } else {\n // this node does not qualify after all.\n gatheringSuccessful = false;\n break;\n }\n }\n\n // add to the cluster queue\n if (\n Object.keys(childNodesObj).length > 0 &&\n Object.keys(childEdgesObj).length > 0 &&\n gatheringSuccessful === true\n ) {\n /**\n * Search for cluster data that contains any of the node id's\n *\n * @returns {boolean} true if no joinCondition, otherwise return value of joinCondition\n */\n const findClusterData = function () {\n for (let n = 0; n < clusters.length; ++n) {\n // Search for a cluster containing any of the node id's\n for (const m in childNodesObj) {\n if (clusters[n].nodes[m] !== undefined) {\n return clusters[n];\n }\n }\n }\n\n return undefined;\n };\n\n // If any of the found nodes is part of a cluster found in this method,\n // add the current values to that cluster\n const foundCluster = findClusterData();\n if (foundCluster !== undefined) {\n // Add nodes to found cluster if not present\n for (const m in childNodesObj) {\n if (foundCluster.nodes[m] === undefined) {\n foundCluster.nodes[m] = childNodesObj[m];\n }\n }\n\n // Add edges to found cluster, if not present\n for (const m in childEdgesObj) {\n if (foundCluster.edges[m] === undefined) {\n foundCluster.edges[m] = childEdgesObj[m];\n }\n }\n } else {\n // Create a new cluster group\n clusters.push({ nodes: childNodesObj, edges: childEdgesObj });\n }\n }\n }\n }\n }\n\n for (let i = 0; i < clusters.length; i++) {\n this._cluster(clusters[i].nodes, clusters[i].edges, options, false);\n }\n\n if (refreshData === true) {\n this.body.emitter.emit(\"_dataChanged\");\n }\n }\n\n /**\n * Cluster all nodes in the network that have only 1 edge\n *\n * @param {object} options\n * @param {boolean} [refreshData=true]\n */\n clusterOutliers(options, refreshData = true) {\n this.clusterByEdgeCount(1, options, refreshData);\n }\n\n /**\n * Cluster all nodes in the network that have only 2 edge\n *\n * @param {object} options\n * @param {boolean} [refreshData=true]\n */\n clusterBridges(options, refreshData = true) {\n this.clusterByEdgeCount(2, options, refreshData);\n }\n\n /**\n * suck all connected nodes of a node into the node.\n *\n * @param {Node.id} nodeId\n * @param {object} options\n * @param {boolean} [refreshData=true]\n */\n clusterByConnection(nodeId, options, refreshData = true) {\n // kill conditions\n if (nodeId === undefined) {\n throw new Error(\"No nodeId supplied to clusterByConnection!\");\n }\n if (this.body.nodes[nodeId] === undefined) {\n throw new Error(\n \"The nodeId given to clusterByConnection does not exist!\"\n );\n }\n\n const node = this.body.nodes[nodeId];\n options = this._checkOptions(options, node);\n if (options.clusterNodeProperties.x === undefined) {\n options.clusterNodeProperties.x = node.x;\n }\n if (options.clusterNodeProperties.y === undefined) {\n options.clusterNodeProperties.y = node.y;\n }\n if (options.clusterNodeProperties.fixed === undefined) {\n options.clusterNodeProperties.fixed = {};\n options.clusterNodeProperties.fixed.x = node.options.fixed.x;\n options.clusterNodeProperties.fixed.y = node.options.fixed.y;\n }\n\n const childNodesObj = {};\n const childEdgesObj = {};\n const parentNodeId = node.id;\n const parentClonedOptions = NetworkUtil.cloneOptions(node);\n childNodesObj[parentNodeId] = node;\n\n // collect the nodes that will be in the cluster\n for (let i = 0; i < node.edges.length; i++) {\n const edge = node.edges[i];\n if (this.clusteredEdges[edge.id] === undefined) {\n const childNodeId = this._getConnectedId(edge, parentNodeId);\n\n // if the child node is not in a cluster\n if (this.clusteredNodes[childNodeId] === undefined) {\n if (childNodeId !== parentNodeId) {\n if (options.joinCondition === undefined) {\n childEdgesObj[edge.id] = edge;\n childNodesObj[childNodeId] = this.body.nodes[childNodeId];\n } else {\n // clone the options and insert some additional parameters that could be interesting.\n const childClonedOptions = NetworkUtil.cloneOptions(\n this.body.nodes[childNodeId]\n );\n if (\n options.joinCondition(\n parentClonedOptions,\n childClonedOptions\n ) === true\n ) {\n childEdgesObj[edge.id] = edge;\n childNodesObj[childNodeId] = this.body.nodes[childNodeId];\n }\n }\n } else {\n // swallow the edge if it is self-referencing.\n childEdgesObj[edge.id] = edge;\n }\n }\n }\n }\n const childNodeIDs = Object.keys(childNodesObj).map(function (childNode) {\n return childNodesObj[childNode].id;\n });\n\n for (const childNodeKey in childNodesObj) {\n if (!Object.prototype.hasOwnProperty.call(childNodesObj, childNodeKey))\n continue;\n\n const childNode = childNodesObj[childNodeKey];\n for (let y = 0; y < childNode.edges.length; y++) {\n const childEdge = childNode.edges[y];\n if (\n childNodeIDs.indexOf(this._getConnectedId(childEdge, childNode.id)) >\n -1\n ) {\n childEdgesObj[childEdge.id] = childEdge;\n }\n }\n }\n this._cluster(childNodesObj, childEdgesObj, options, refreshData);\n }\n\n /**\n * This function creates the edges that will be attached to the cluster\n * It looks for edges that are connected to the nodes from the \"outside' of the cluster.\n *\n * @param {{Node.id: vis.Node}} childNodesObj\n * @param {{vis.Edge.id: vis.Edge}} childEdgesObj\n * @param {object} clusterNodeProperties\n * @param {object} clusterEdgeProperties\n * @private\n */\n _createClusterEdges(\n childNodesObj,\n childEdgesObj,\n clusterNodeProperties,\n clusterEdgeProperties\n ) {\n let edge, childNodeId, childNode, toId, fromId, otherNodeId;\n\n // loop over all child nodes and their edges to find edges going out of the cluster\n // these edges will be replaced by clusterEdges.\n const childKeys = Object.keys(childNodesObj);\n const createEdges = [];\n for (let i = 0; i < childKeys.length; i++) {\n childNodeId = childKeys[i];\n childNode = childNodesObj[childNodeId];\n\n // construct new edges from the cluster to others\n for (let j = 0; j < childNode.edges.length; j++) {\n edge = childNode.edges[j];\n // we only handle edges that are visible to the system, not the disabled ones from the clustering process.\n if (this.clusteredEdges[edge.id] === undefined) {\n // self-referencing edges will be added to the \"hidden\" list\n if (edge.toId == edge.fromId) {\n childEdgesObj[edge.id] = edge;\n } else {\n // set up the from and to.\n if (edge.toId == childNodeId) {\n // this is a double equals because ints and strings can be interchanged here.\n toId = clusterNodeProperties.id;\n fromId = edge.fromId;\n otherNodeId = fromId;\n } else {\n toId = edge.toId;\n fromId = clusterNodeProperties.id;\n otherNodeId = toId;\n }\n }\n\n // Only edges from the cluster outwards are being replaced.\n if (childNodesObj[otherNodeId] === undefined) {\n createEdges.push({ edge: edge, fromId: fromId, toId: toId });\n }\n }\n }\n }\n\n //\n // Here we actually create the replacement edges.\n //\n // We could not do this in the loop above as the creation process\n // would add an edge to the edges array we are iterating over.\n //\n // NOTE: a clustered edge can have multiple base edges!\n //\n const newEdges = [];\n\n /**\n * Find a cluster edge which matches the given created edge.\n *\n * @param {vis.Edge} createdEdge\n * @returns {vis.Edge}\n */\n const getNewEdge = function (createdEdge) {\n for (let j = 0; j < newEdges.length; j++) {\n const newEdge = newEdges[j];\n\n // We replace both to and from edges with a single cluster edge\n const matchToDirection =\n createdEdge.fromId === newEdge.fromId &&\n createdEdge.toId === newEdge.toId;\n const matchFromDirection =\n createdEdge.fromId === newEdge.toId &&\n createdEdge.toId === newEdge.fromId;\n\n if (matchToDirection || matchFromDirection) {\n return newEdge;\n }\n }\n\n return null;\n };\n\n for (let j = 0; j < createEdges.length; j++) {\n const createdEdge = createEdges[j];\n const edge = createdEdge.edge;\n let newEdge = getNewEdge(createdEdge);\n\n if (newEdge === null) {\n // Create a clustered edge for this connection\n newEdge = this._createClusteredEdge(\n createdEdge.fromId,\n createdEdge.toId,\n edge,\n clusterEdgeProperties\n );\n\n newEdges.push(newEdge);\n } else {\n newEdge.clusteringEdgeReplacingIds.push(edge.id);\n }\n\n // also reference the new edge in the old edge\n this.body.edges[edge.id].edgeReplacedById = newEdge.id;\n\n // hide the replaced edge\n this._backupEdgeOptions(edge);\n edge.setOptions({ physics: false });\n }\n }\n\n /**\n * This function checks the options that can be supplied to the different cluster functions\n * for certain fields and inserts defaults if needed\n *\n * @param {object} options\n * @returns {*}\n * @private\n */\n _checkOptions(options = {}) {\n if (options.clusterEdgeProperties === undefined) {\n options.clusterEdgeProperties = {};\n }\n if (options.clusterNodeProperties === undefined) {\n options.clusterNodeProperties = {};\n }\n\n return options;\n }\n\n /**\n *\n * @param {object} childNodesObj | object with node objects, id as keys, same as childNodes except it also contains a source node\n * @param {object} childEdgesObj | object with edge objects, id as keys\n * @param {Array} options | object with {clusterNodeProperties, clusterEdgeProperties, processProperties}\n * @param {boolean} refreshData | when true, do not wrap up\n * @private\n */\n _cluster(childNodesObj, childEdgesObj, options, refreshData = true) {\n // Remove nodes which are already clustered\n const tmpNodesToRemove = [];\n for (const nodeId in childNodesObj) {\n if (Object.prototype.hasOwnProperty.call(childNodesObj, nodeId)) {\n if (this.clusteredNodes[nodeId] !== undefined) {\n tmpNodesToRemove.push(nodeId);\n }\n }\n }\n\n for (let n = 0; n < tmpNodesToRemove.length; ++n) {\n delete childNodesObj[tmpNodesToRemove[n]];\n }\n\n // kill condition: no nodes don't bother\n if (Object.keys(childNodesObj).length == 0) {\n return;\n }\n\n // allow clusters of 1 if options allow\n if (\n Object.keys(childNodesObj).length == 1 &&\n options.clusterNodeProperties.allowSingleNodeCluster != true\n ) {\n return;\n }\n\n let clusterNodeProperties = deepExtend({}, options.clusterNodeProperties);\n\n // construct the clusterNodeProperties\n if (options.processProperties !== undefined) {\n // get the childNode options\n const childNodesOptions = [];\n for (const nodeId in childNodesObj) {\n if (Object.prototype.hasOwnProperty.call(childNodesObj, nodeId)) {\n const clonedOptions = NetworkUtil.cloneOptions(childNodesObj[nodeId]);\n childNodesOptions.push(clonedOptions);\n }\n }\n\n // get cluster properties based on childNodes\n const childEdgesOptions = [];\n for (const edgeId in childEdgesObj) {\n if (Object.prototype.hasOwnProperty.call(childEdgesObj, edgeId)) {\n // these cluster edges will be removed on creation of the cluster.\n if (edgeId.substr(0, 12) !== \"clusterEdge:\") {\n const clonedOptions = NetworkUtil.cloneOptions(\n childEdgesObj[edgeId],\n \"edge\"\n );\n childEdgesOptions.push(clonedOptions);\n }\n }\n }\n\n clusterNodeProperties = options.processProperties(\n clusterNodeProperties,\n childNodesOptions,\n childEdgesOptions\n );\n if (!clusterNodeProperties) {\n throw new Error(\n \"The processProperties function does not return properties!\"\n );\n }\n }\n\n // check if we have an unique id;\n if (clusterNodeProperties.id === undefined) {\n clusterNodeProperties.id = \"cluster:\" + randomUUID();\n }\n const clusterId = clusterNodeProperties.id;\n\n if (clusterNodeProperties.label === undefined) {\n clusterNodeProperties.label = \"cluster\";\n }\n\n // give the clusterNode a position if it does not have one.\n let pos = undefined;\n if (clusterNodeProperties.x === undefined) {\n pos = this._getClusterPosition(childNodesObj);\n clusterNodeProperties.x = pos.x;\n }\n if (clusterNodeProperties.y === undefined) {\n if (pos === undefined) {\n pos = this._getClusterPosition(childNodesObj);\n }\n clusterNodeProperties.y = pos.y;\n }\n\n // force the ID to remain the same\n clusterNodeProperties.id = clusterId;\n\n // create the cluster Node\n // Note that allowSingleNodeCluster, if present, is stored in the options as well\n const clusterNode = this.body.functions.createNode(\n clusterNodeProperties,\n Cluster\n );\n clusterNode.containedNodes = childNodesObj;\n clusterNode.containedEdges = childEdgesObj;\n // cache a copy from the cluster edge properties if we have to reconnect others later on\n clusterNode.clusterEdgeProperties = options.clusterEdgeProperties;\n\n // finally put the cluster node into global\n this.body.nodes[clusterNodeProperties.id] = clusterNode;\n\n this._clusterEdges(\n childNodesObj,\n childEdgesObj,\n clusterNodeProperties,\n options.clusterEdgeProperties\n );\n\n // set ID to undefined so no duplicates arise\n clusterNodeProperties.id = undefined;\n\n // wrap up\n if (refreshData === true) {\n this.body.emitter.emit(\"_dataChanged\");\n }\n }\n\n /**\n *\n * @param {Edge} edge\n * @private\n */\n _backupEdgeOptions(edge) {\n if (this.clusteredEdges[edge.id] === undefined) {\n this.clusteredEdges[edge.id] = { physics: edge.options.physics };\n }\n }\n\n /**\n *\n * @param {Edge} edge\n * @private\n */\n _restoreEdge(edge) {\n const originalOptions = this.clusteredEdges[edge.id];\n if (originalOptions !== undefined) {\n edge.setOptions({ physics: originalOptions.physics });\n delete this.clusteredEdges[edge.id];\n }\n }\n\n /**\n * Check if a node is a cluster.\n *\n * @param {Node.id} nodeId\n * @returns {*}\n */\n isCluster(nodeId) {\n if (this.body.nodes[nodeId] !== undefined) {\n return this.body.nodes[nodeId].isCluster === true;\n } else {\n console.error(\"Node does not exist.\");\n return false;\n }\n }\n\n /**\n * get the position of the cluster node based on what's inside\n *\n * @param {object} childNodesObj | object with node objects, id as keys\n * @returns {{x: number, y: number}}\n * @private\n */\n _getClusterPosition(childNodesObj) {\n const childKeys = Object.keys(childNodesObj);\n let minX = childNodesObj[childKeys[0]].x;\n let maxX = childNodesObj[childKeys[0]].x;\n let minY = childNodesObj[childKeys[0]].y;\n let maxY = childNodesObj[childKeys[0]].y;\n let node;\n for (let i = 1; i < childKeys.length; i++) {\n node = childNodesObj[childKeys[i]];\n minX = node.x < minX ? node.x : minX;\n maxX = node.x > maxX ? node.x : maxX;\n minY = node.y < minY ? node.y : minY;\n maxY = node.y > maxY ? node.y : maxY;\n }\n\n return { x: 0.5 * (minX + maxX), y: 0.5 * (minY + maxY) };\n }\n\n /**\n * Open a cluster by calling this function.\n *\n * @param {vis.Edge.id} clusterNodeId | the ID of the cluster node\n * @param {object} options\n * @param {boolean} refreshData | wrap up afterwards if not true\n */\n openCluster(clusterNodeId, options, refreshData = true) {\n // kill conditions\n if (clusterNodeId === undefined) {\n throw new Error(\"No clusterNodeId supplied to openCluster.\");\n }\n\n const clusterNode = this.body.nodes[clusterNodeId];\n\n if (clusterNode === undefined) {\n throw new Error(\n \"The clusterNodeId supplied to openCluster does not exist.\"\n );\n }\n if (\n clusterNode.isCluster !== true ||\n clusterNode.containedNodes === undefined ||\n clusterNode.containedEdges === undefined\n ) {\n throw new Error(\"The node:\" + clusterNodeId + \" is not a valid cluster.\");\n }\n\n // Check if current cluster is clustered itself\n const stack = this.findNode(clusterNodeId);\n const parentIndex = stack.indexOf(clusterNodeId) - 1;\n if (parentIndex >= 0) {\n // Current cluster is clustered; transfer contained nodes and edges to parent\n const parentClusterNodeId = stack[parentIndex];\n const parentClusterNode = this.body.nodes[parentClusterNodeId];\n\n // clustering.clusteredNodes and clustering.clusteredEdges remain unchanged\n parentClusterNode._openChildCluster(clusterNodeId);\n\n // All components of child cluster node have been transferred. It can die now.\n delete this.body.nodes[clusterNodeId];\n if (refreshData === true) {\n this.body.emitter.emit(\"_dataChanged\");\n }\n\n return;\n }\n\n // main body\n const containedNodes = clusterNode.containedNodes;\n const containedEdges = clusterNode.containedEdges;\n\n // allow the user to position the nodes after release.\n if (\n options !== undefined &&\n options.releaseFunction !== undefined &&\n typeof options.releaseFunction === \"function\"\n ) {\n const positions = {};\n const clusterPosition = { x: clusterNode.x, y: clusterNode.y };\n for (const nodeId in containedNodes) {\n if (Object.prototype.hasOwnProperty.call(containedNodes, nodeId)) {\n const containedNode = this.body.nodes[nodeId];\n positions[nodeId] = { x: containedNode.x, y: containedNode.y };\n }\n }\n const newPositions = options.releaseFunction(clusterPosition, positions);\n\n for (const nodeId in containedNodes) {\n if (Object.prototype.hasOwnProperty.call(containedNodes, nodeId)) {\n const containedNode = this.body.nodes[nodeId];\n if (newPositions[nodeId] !== undefined) {\n containedNode.x =\n newPositions[nodeId].x === undefined\n ? clusterNode.x\n : newPositions[nodeId].x;\n containedNode.y =\n newPositions[nodeId].y === undefined\n ? clusterNode.y\n : newPositions[nodeId].y;\n }\n }\n }\n } else {\n // copy the position from the cluster\n forEach(containedNodes, function (containedNode) {\n // inherit position\n if (containedNode.options.fixed.x === false) {\n containedNode.x = clusterNode.x;\n }\n if (containedNode.options.fixed.y === false) {\n containedNode.y = clusterNode.y;\n }\n });\n }\n\n // release nodes\n for (const nodeId in containedNodes) {\n if (Object.prototype.hasOwnProperty.call(containedNodes, nodeId)) {\n const containedNode = this.body.nodes[nodeId];\n\n // inherit speed\n containedNode.vx = clusterNode.vx;\n containedNode.vy = clusterNode.vy;\n\n containedNode.setOptions({ physics: true });\n\n delete this.clusteredNodes[nodeId];\n }\n }\n\n // copy the clusterNode edges because we cannot iterate over an object that we add or remove from.\n const edgesToBeDeleted = [];\n for (let i = 0; i < clusterNode.edges.length; i++) {\n edgesToBeDeleted.push(clusterNode.edges[i]);\n }\n\n // actually handling the deleting.\n for (let i = 0; i < edgesToBeDeleted.length; i++) {\n const edge = edgesToBeDeleted[i];\n const otherNodeId = this._getConnectedId(edge, clusterNodeId);\n const otherNode = this.clusteredNodes[otherNodeId];\n\n for (let j = 0; j < edge.clusteringEdgeReplacingIds.length; j++) {\n const transferId = edge.clusteringEdgeReplacingIds[j];\n const transferEdge = this.body.edges[transferId];\n if (transferEdge === undefined) continue;\n\n // if the other node is in another cluster, we transfer ownership of this edge to the other cluster\n if (otherNode !== undefined) {\n // transfer ownership:\n const otherCluster = this.body.nodes[otherNode.clusterId];\n otherCluster.containedEdges[transferEdge.id] = transferEdge;\n\n // delete local reference\n delete containedEdges[transferEdge.id];\n\n // get to and from\n let fromId = transferEdge.fromId;\n let toId = transferEdge.toId;\n if (transferEdge.toId == otherNodeId) {\n toId = otherNode.clusterId;\n } else {\n fromId = otherNode.clusterId;\n }\n\n // create new cluster edge from the otherCluster\n this._createClusteredEdge(\n fromId,\n toId,\n transferEdge,\n otherCluster.clusterEdgeProperties,\n { hidden: false, physics: true }\n );\n } else {\n this._restoreEdge(transferEdge);\n }\n }\n\n edge.remove();\n }\n\n // handle the releasing of the edges\n for (const edgeId in containedEdges) {\n if (Object.prototype.hasOwnProperty.call(containedEdges, edgeId)) {\n this._restoreEdge(containedEdges[edgeId]);\n }\n }\n\n // remove clusterNode\n delete this.body.nodes[clusterNodeId];\n\n if (refreshData === true) {\n this.body.emitter.emit(\"_dataChanged\");\n }\n }\n\n /**\n *\n * @param {Cluster.id} clusterId\n * @returns {Array.<Node.id>}\n */\n getNodesInCluster(clusterId) {\n const nodesArray = [];\n if (this.isCluster(clusterId) === true) {\n const containedNodes = this.body.nodes[clusterId].containedNodes;\n for (const nodeId in containedNodes) {\n if (Object.prototype.hasOwnProperty.call(containedNodes, nodeId)) {\n nodesArray.push(this.body.nodes[nodeId].id);\n }\n }\n }\n\n return nodesArray;\n }\n\n /**\n * Get the stack clusterId's that a certain node resides in. cluster A -> cluster B -> cluster C -> node\n *\n * If a node can't be found in the chain, return an empty array.\n *\n * @param {string|number} nodeId\n * @returns {Array}\n */\n findNode(nodeId) {\n const stack = [];\n const max = 100;\n let counter = 0;\n let node;\n\n while (this.clusteredNodes[nodeId] !== undefined && counter < max) {\n node = this.body.nodes[nodeId];\n if (node === undefined) return [];\n stack.push(node.id);\n\n nodeId = this.clusteredNodes[nodeId].clusterId;\n counter++;\n }\n\n node = this.body.nodes[nodeId];\n if (node === undefined) return [];\n stack.push(node.id);\n\n stack.reverse();\n return stack;\n }\n\n /**\n * Using a clustered nodeId, update with the new options\n *\n * @param {Node.id} clusteredNodeId\n * @param {object} newOptions\n */\n updateClusteredNode(clusteredNodeId, newOptions) {\n if (clusteredNodeId === undefined) {\n throw new Error(\"No clusteredNodeId supplied to updateClusteredNode.\");\n }\n if (newOptions === undefined) {\n throw new Error(\"No newOptions supplied to updateClusteredNode.\");\n }\n if (this.body.nodes[clusteredNodeId] === undefined) {\n throw new Error(\n \"The clusteredNodeId supplied to updateClusteredNode does not exist.\"\n );\n }\n\n this.body.nodes[clusteredNodeId].setOptions(newOptions);\n this.body.emitter.emit(\"_dataChanged\");\n }\n\n /**\n * Using a base edgeId, update all related clustered edges with the new options\n *\n * @param {vis.Edge.id} startEdgeId\n * @param {object} newOptions\n */\n updateEdge(startEdgeId, newOptions) {\n if (startEdgeId === undefined) {\n throw new Error(\"No startEdgeId supplied to updateEdge.\");\n }\n if (newOptions === undefined) {\n throw new Error(\"No newOptions supplied to updateEdge.\");\n }\n if (this.body.edges[startEdgeId] === undefined) {\n throw new Error(\"The startEdgeId supplied to updateEdge does not exist.\");\n }\n\n const allEdgeIds = this.getClusteredEdges(startEdgeId);\n for (let i = 0; i < allEdgeIds.length; i++) {\n const edge = this.body.edges[allEdgeIds[i]];\n edge.setOptions(newOptions);\n }\n this.body.emitter.emit(\"_dataChanged\");\n }\n\n /**\n * Get a stack of clusterEdgeId's (+base edgeid) that a base edge is the same as. cluster edge C -> cluster edge B -> cluster edge A -> base edge(edgeId)\n *\n * @param {vis.Edge.id} edgeId\n * @returns {Array.<vis.Edge.id>}\n */\n getClusteredEdges(edgeId) {\n const stack = [];\n const max = 100;\n let counter = 0;\n\n while (\n edgeId !== undefined &&\n this.body.edges[edgeId] !== undefined &&\n counter < max\n ) {\n stack.push(this.body.edges[edgeId].id);\n edgeId = this.body.edges[edgeId].edgeReplacedById;\n counter++;\n }\n stack.reverse();\n return stack;\n }\n\n /**\n * Get the base edge id of clusterEdgeId. cluster edge (clusteredEdgeId) -> cluster edge B -> cluster edge C -> base edge\n *\n * @param {vis.Edge.id} clusteredEdgeId\n * @returns {vis.Edge.id} baseEdgeId\n *\n * TODO: deprecate in 5.0.0. Method getBaseEdges() is the correct one to use.\n */\n getBaseEdge(clusteredEdgeId) {\n // Just kludge this by returning the first base edge id found\n return this.getBaseEdges(clusteredEdgeId)[0];\n }\n\n /**\n * Get all regular edges for this clustered edge id.\n *\n * @param {vis.Edge.id} clusteredEdgeId\n * @returns {Array.<vis.Edge.id>} all baseEdgeId's under this clustered edge\n */\n getBaseEdges(clusteredEdgeId) {\n const IdsToHandle = [clusteredEdgeId];\n const doneIds = [];\n const foundIds = [];\n const max = 100;\n let counter = 0;\n\n while (IdsToHandle.length > 0 && counter < max) {\n const nextId = IdsToHandle.pop();\n if (nextId === undefined) continue; // Paranoia here and onwards\n const nextEdge = this.body.edges[nextId];\n if (nextEdge === undefined) continue;\n counter++;\n\n const replacingIds = nextEdge.clusteringEdgeReplacingIds;\n if (replacingIds === undefined) {\n // nextId is a base id\n foundIds.push(nextId);\n } else {\n // Another cluster edge, unravel this one as well\n for (let i = 0; i < replacingIds.length; ++i) {\n const replacingId = replacingIds[i];\n\n // Don't add if already handled\n // TODO: never triggers; find a test-case which does\n if (\n IdsToHandle.indexOf(replacingIds) !== -1 ||\n doneIds.indexOf(replacingIds) !== -1\n ) {\n continue;\n }\n\n IdsToHandle.push(replacingId);\n }\n }\n\n doneIds.push(nextId);\n }\n\n return foundIds;\n }\n\n /**\n * Get the Id the node is connected to\n *\n * @param {vis.Edge} edge\n * @param {Node.id} nodeId\n * @returns {*}\n * @private\n */\n _getConnectedId(edge, nodeId) {\n if (edge.toId != nodeId) {\n return edge.toId;\n } else if (edge.fromId != nodeId) {\n return edge.fromId;\n } else {\n return edge.fromId;\n }\n }\n\n /**\n * We determine how many connections denote an important hub.\n * We take the mean + 2*std as the important hub size. (Assuming a normal distribution of data, ~2.2%)\n *\n * @returns {number}\n * @private\n */\n _getHubSize() {\n let average = 0;\n let averageSquared = 0;\n let hubCounter = 0;\n let largestHub = 0;\n\n for (let i = 0; i < this.body.nodeIndices.length; i++) {\n const node = this.body.nodes[this.body.nodeIndices[i]];\n if (node.edges.length > largestHub) {\n largestHub = node.edges.length;\n }\n average += node.edges.length;\n averageSquared += Math.pow(node.edges.length, 2);\n hubCounter += 1;\n }\n average = average / hubCounter;\n averageSquared = averageSquared / hubCounter;\n\n const variance = averageSquared - Math.pow(average, 2);\n const standardDeviation = Math.sqrt(variance);\n\n let hubThreshold = Math.floor(average + 2 * standardDeviation);\n\n // always have at least one to cluster\n if (hubThreshold > largestHub) {\n hubThreshold = largestHub;\n }\n\n return hubThreshold;\n }\n\n /**\n * Create an edge for the cluster representation.\n *\n * @param {Node.id} fromId\n * @param {Node.id} toId\n * @param {vis.Edge} baseEdge\n * @param {object} clusterEdgeProperties\n * @param {object} extraOptions\n * @returns {Edge} newly created clustered edge\n * @private\n */\n _createClusteredEdge(\n fromId,\n toId,\n baseEdge,\n clusterEdgeProperties,\n extraOptions\n ) {\n // copy the options of the edge we will replace\n const clonedOptions = NetworkUtil.cloneOptions(baseEdge, \"edge\");\n // make sure the properties of clusterEdges are superimposed on it\n deepExtend(clonedOptions, clusterEdgeProperties);\n\n // set up the edge\n clonedOptions.from = fromId;\n clonedOptions.to = toId;\n clonedOptions.id = \"clusterEdge:\" + randomUUID();\n\n // apply the edge specific options to it if specified\n if (extraOptions !== undefined) {\n deepExtend(clonedOptions, extraOptions);\n }\n\n const newEdge = this.body.functions.createEdge(clonedOptions);\n newEdge.clusteringEdgeReplacingIds = [baseEdge.id];\n newEdge.connect();\n\n // Register the new edge\n this.body.edges[newEdge.id] = newEdge;\n\n return newEdge;\n }\n\n /**\n * Add the passed child nodes and edges to the given cluster node.\n *\n * @param {object | Node} childNodes hash of nodes or single node to add in cluster\n * @param {object | Edge} childEdges hash of edges or single edge to take into account when clustering\n * @param {Node} clusterNode cluster node to add nodes and edges to\n * @param {object} [clusterEdgeProperties]\n * @private\n */\n _clusterEdges(childNodes, childEdges, clusterNode, clusterEdgeProperties) {\n if (childEdges instanceof Edge) {\n const edge = childEdges;\n const obj = {};\n obj[edge.id] = edge;\n childEdges = obj;\n }\n\n if (childNodes instanceof Node) {\n const node = childNodes;\n const obj = {};\n obj[node.id] = node;\n childNodes = obj;\n }\n\n if (clusterNode === undefined || clusterNode === null) {\n throw new Error(\"_clusterEdges: parameter clusterNode required\");\n }\n\n if (clusterEdgeProperties === undefined) {\n // Take the required properties from the cluster node\n clusterEdgeProperties = clusterNode.clusterEdgeProperties;\n }\n\n // create the new edges that will connect to the cluster.\n // All self-referencing edges will be added to childEdges here.\n this._createClusterEdges(\n childNodes,\n childEdges,\n clusterNode,\n clusterEdgeProperties\n );\n\n // disable the childEdges\n for (const edgeId in childEdges) {\n if (Object.prototype.hasOwnProperty.call(childEdges, edgeId)) {\n if (this.body.edges[edgeId] !== undefined) {\n const edge = this.body.edges[edgeId];\n // cache the options before changing\n this._backupEdgeOptions(edge);\n // disable physics and hide the edge\n edge.setOptions({ physics: false });\n }\n }\n }\n\n // disable the childNodes\n for (const nodeId in childNodes) {\n if (Object.prototype.hasOwnProperty.call(childNodes, nodeId)) {\n this.clusteredNodes[nodeId] = {\n clusterId: clusterNode.id,\n node: this.body.nodes[nodeId],\n };\n this.body.nodes[nodeId].setOptions({ physics: false });\n }\n }\n }\n\n /**\n * Determine in which cluster given nodeId resides.\n *\n * If not in cluster, return undefined.\n *\n * NOTE: If you know a cleaner way to do this, please enlighten me (wimrijnders).\n *\n * @param {Node.id} nodeId\n * @returns {Node|undefined} Node instance for cluster, if present\n * @private\n */\n _getClusterNodeForNode(nodeId) {\n if (nodeId === undefined) return undefined;\n const clusteredNode = this.clusteredNodes[nodeId];\n\n // NOTE: If no cluster info found, it should actually be an error\n if (clusteredNode === undefined) return undefined;\n const clusterId = clusteredNode.clusterId;\n if (clusterId === undefined) return undefined;\n\n return this.body.nodes[clusterId];\n }\n\n /**\n * Internal helper function for conditionally removing items in array\n *\n * Done like this because Array.filter() is not fully supported by all IE's.\n *\n * @param {Array} arr\n * @param {Function} callback\n * @returns {Array}\n * @private\n */\n _filter(arr, callback) {\n const ret = [];\n\n forEach(arr, (item) => {\n if (callback(item)) {\n ret.push(item);\n }\n });\n\n return ret;\n }\n\n /**\n * Scan all edges for changes in clustering and adjust this if necessary.\n *\n * Call this (internally) after there has been a change in node or edge data.\n *\n * Pre: States of this.body.nodes and this.body.edges consistent\n * Pre: this.clusteredNodes and this.clusteredEdge consistent with containedNodes and containedEdges\n * of cluster nodes.\n */\n _updateState() {\n let nodeId;\n const deletedNodeIds = [];\n const deletedEdgeIds = {};\n\n /**\n * Utility function to iterate over clustering nodes only\n *\n * @param {Function} callback function to call for each cluster node\n */\n const eachClusterNode = (callback) => {\n forEach(this.body.nodes, (node) => {\n if (node.isCluster === true) {\n callback(node);\n }\n });\n };\n\n //\n // Remove deleted regular nodes from clustering\n //\n\n // Determine the deleted nodes\n for (nodeId in this.clusteredNodes) {\n if (!Object.prototype.hasOwnProperty.call(this.clusteredNodes, nodeId))\n continue;\n const node = this.body.nodes[nodeId];\n\n if (node === undefined) {\n deletedNodeIds.push(nodeId);\n }\n }\n\n // Remove nodes from cluster nodes\n eachClusterNode(function (clusterNode) {\n for (let n = 0; n < deletedNodeIds.length; n++) {\n delete clusterNode.containedNodes[deletedNodeIds[n]];\n }\n });\n\n // Remove nodes from cluster list\n for (let n = 0; n < deletedNodeIds.length; n++) {\n delete this.clusteredNodes[deletedNodeIds[n]];\n }\n\n //\n // Remove deleted edges from clustering\n //\n\n // Add the deleted clustered edges to the list\n forEach(this.clusteredEdges, (edgeId) => {\n const edge = this.body.edges[edgeId];\n if (edge === undefined || !edge.endPointsValid()) {\n deletedEdgeIds[edgeId] = edgeId;\n }\n });\n\n // Cluster nodes can also contain edges which are not clustered,\n // i.e. nodes 1-2 within cluster with an edge in between.\n // So the cluster nodes also need to be scanned for invalid edges\n eachClusterNode(function (clusterNode) {\n forEach(clusterNode.containedEdges, (edge, edgeId) => {\n if (!edge.endPointsValid() && !deletedEdgeIds[edgeId]) {\n deletedEdgeIds[edgeId] = edgeId;\n }\n });\n });\n\n // Also scan for cluster edges which need to be removed in the active list.\n // Regular edges have been removed beforehand, so this only picks up the cluster edges.\n forEach(this.body.edges, (edge, edgeId) => {\n // Explicitly scan the contained edges for validity\n let isValid = true;\n const replacedIds = edge.clusteringEdgeReplacingIds;\n if (replacedIds !== undefined) {\n let numValid = 0;\n\n forEach(replacedIds, (containedEdgeId) => {\n const containedEdge = this.body.edges[containedEdgeId];\n\n if (containedEdge !== undefined && containedEdge.endPointsValid()) {\n numValid += 1;\n }\n });\n\n isValid = numValid > 0;\n }\n\n if (!edge.endPointsValid() || !isValid) {\n deletedEdgeIds[edgeId] = edgeId;\n }\n });\n\n // Remove edges from cluster nodes\n eachClusterNode((clusterNode) => {\n forEach(deletedEdgeIds, (deletedEdgeId) => {\n delete clusterNode.containedEdges[deletedEdgeId];\n\n forEach(clusterNode.edges, (edge, m) => {\n if (edge.id === deletedEdgeId) {\n clusterNode.edges[m] = null; // Don't want to directly delete here, because in the loop\n return;\n }\n\n edge.clusteringEdgeReplacingIds = this._filter(\n edge.clusteringEdgeReplacingIds,\n function (id) {\n return !deletedEdgeIds[id];\n }\n );\n });\n\n // Clean up the nulls\n clusterNode.edges = this._filter(clusterNode.edges, function (item) {\n return item !== null;\n });\n });\n });\n\n // Remove from cluster list\n forEach(deletedEdgeIds, (edgeId) => {\n delete this.clusteredEdges[edgeId];\n });\n\n // Remove cluster edges from active list (this.body.edges).\n // deletedEdgeIds still contains id of regular edges, but these should all\n // be gone when you reach here.\n forEach(deletedEdgeIds, (edgeId) => {\n delete this.body.edges[edgeId];\n });\n\n //\n // Check changed cluster state of edges\n //\n\n // Iterating over keys here, because edges may be removed in the loop\n const ids = Object.keys(this.body.edges);\n forEach(ids, (edgeId) => {\n const edge = this.body.edges[edgeId];\n\n const shouldBeClustered =\n this._isClusteredNode(edge.fromId) || this._isClusteredNode(edge.toId);\n if (shouldBeClustered === this._isClusteredEdge(edge.id)) {\n return; // all is well\n }\n\n if (shouldBeClustered) {\n // add edge to clustering\n const clusterFrom = this._getClusterNodeForNode(edge.fromId);\n if (clusterFrom !== undefined) {\n this._clusterEdges(this.body.nodes[edge.fromId], edge, clusterFrom);\n }\n\n const clusterTo = this._getClusterNodeForNode(edge.toId);\n if (clusterTo !== undefined) {\n this._clusterEdges(this.body.nodes[edge.toId], edge, clusterTo);\n }\n\n // TODO: check that it works for both edges clustered\n // (This might be paranoia)\n } else {\n delete this._clusterEdges[edgeId];\n this._restoreEdge(edge);\n // This should not be happening, the state should\n // be properly updated at this point.\n //\n // If it *is* reached during normal operation, then we have to implement\n // undo clustering for this edge here.\n // throw new Error('remove edge from clustering not implemented!')\n }\n });\n\n // Clusters may be nested to any level. Keep on opening until nothing to open\n let changed = false;\n let continueLoop = true;\n while (continueLoop) {\n const clustersToOpen = [];\n\n // Determine the id's of clusters that need opening\n eachClusterNode(function (clusterNode) {\n const numNodes = Object.keys(clusterNode.containedNodes).length;\n const allowSingle = clusterNode.options.allowSingleNodeCluster === true;\n if ((allowSingle && numNodes < 1) || (!allowSingle && numNodes < 2)) {\n clustersToOpen.push(clusterNode.id);\n }\n });\n\n // Open them\n for (let n = 0; n < clustersToOpen.length; ++n) {\n this.openCluster(\n clustersToOpen[n],\n {},\n false /* Don't refresh, we're in an refresh/update already */\n );\n }\n\n continueLoop = clustersToOpen.length > 0;\n changed = changed || continueLoop;\n }\n\n if (changed) {\n this._updateState(); // Redo this method (recursion possible! should be safe)\n }\n }\n\n /**\n * Determine if node with given id is part of a cluster.\n *\n * @param {Node.id} nodeId\n * @returns {boolean} true if part of a cluster.\n */\n _isClusteredNode(nodeId) {\n return this.clusteredNodes[nodeId] !== undefined;\n }\n\n /**\n * Determine if edge with given id is not visible due to clustering.\n *\n * An edge is considered clustered if:\n * - it is directly replaced by a clustering edge\n * - any of its connecting nodes is in a cluster\n *\n * @param {vis.Edge.id} edgeId\n * @returns {boolean} true if part of a cluster.\n */\n _isClusteredEdge(edgeId) {\n return this.clusteredEdges[edgeId] !== undefined;\n }\n}\n\nexport default ClusterEngine;\n","import { selectiveDeepExtend } from \"vis-util/esnext\";\n\n/**\n * Initializes window.requestAnimationFrame() to a usable form.\n *\n * Specifically, set up this method for the case of running on node.js with jsdom enabled.\n *\n * NOTES:\n *\n * * On node.js, when calling this directly outside of this class, `window` is not defined.\n * This happens even if jsdom is used.\n * * For node.js + jsdom, `window` is available at the moment the constructor is called.\n * For this reason, the called is placed within the constructor.\n * * Even then, `window.requestAnimationFrame()` is not defined, so it still needs to be added.\n * * During unit testing, it happens that the window object is reset during execution, causing\n * a runtime error due to missing `requestAnimationFrame()`. This needs to be compensated for,\n * see `_requestNextFrame()`.\n * * Since this is a global object, it may affect other modules besides `Network`. With normal\n * usage, this does not cause any problems. During unit testing, errors may occur. These have\n * been compensated for, see comment block in _requestNextFrame().\n *\n * @private\n */\nfunction _initRequestAnimationFrame() {\n let func;\n\n if (window !== undefined) {\n func =\n window.requestAnimationFrame ||\n window.mozRequestAnimationFrame ||\n window.webkitRequestAnimationFrame ||\n window.msRequestAnimationFrame;\n }\n\n if (func === undefined) {\n // window or method not present, setting mock requestAnimationFrame\n window.requestAnimationFrame = function (callback) {\n //console.log(\"Called mock requestAnimationFrame\");\n callback();\n };\n } else {\n window.requestAnimationFrame = func;\n }\n}\n\n/**\n * The canvas renderer\n */\nclass CanvasRenderer {\n /**\n * @param {object} body\n * @param {Canvas} canvas\n */\n constructor(body, canvas) {\n _initRequestAnimationFrame();\n this.body = body;\n this.canvas = canvas;\n\n this.redrawRequested = false;\n this.renderTimer = undefined;\n this.requiresTimeout = true;\n this.renderingActive = false;\n this.renderRequests = 0;\n this.allowRedraw = true;\n\n this.dragging = false;\n this.zooming = false;\n this.options = {};\n this.defaultOptions = {\n hideEdgesOnDrag: false,\n hideEdgesOnZoom: false,\n hideNodesOnDrag: false,\n };\n Object.assign(this.options, this.defaultOptions);\n\n this._determineBrowserMethod();\n this.bindEventListeners();\n }\n\n /**\n * Binds event listeners\n */\n bindEventListeners() {\n this.body.emitter.on(\"dragStart\", () => {\n this.dragging = true;\n });\n this.body.emitter.on(\"dragEnd\", () => {\n this.dragging = false;\n });\n this.body.emitter.on(\"zoom\", () => {\n this.zooming = true;\n window.clearTimeout(this.zoomTimeoutId);\n this.zoomTimeoutId = window.setTimeout(() => {\n this.zooming = false;\n this._requestRedraw.bind(this)();\n }, 250);\n });\n this.body.emitter.on(\"_resizeNodes\", () => {\n this._resizeNodes();\n });\n this.body.emitter.on(\"_redraw\", () => {\n if (this.renderingActive === false) {\n this._redraw();\n }\n });\n this.body.emitter.on(\"_blockRedraw\", () => {\n this.allowRedraw = false;\n });\n this.body.emitter.on(\"_allowRedraw\", () => {\n this.allowRedraw = true;\n this.redrawRequested = false;\n });\n this.body.emitter.on(\"_requestRedraw\", this._requestRedraw.bind(this));\n this.body.emitter.on(\"_startRendering\", () => {\n this.renderRequests += 1;\n this.renderingActive = true;\n this._startRendering();\n });\n this.body.emitter.on(\"_stopRendering\", () => {\n this.renderRequests -= 1;\n this.renderingActive = this.renderRequests > 0;\n this.renderTimer = undefined;\n });\n this.body.emitter.on(\"destroy\", () => {\n this.renderRequests = 0;\n this.allowRedraw = false;\n this.renderingActive = false;\n if (this.requiresTimeout === true) {\n clearTimeout(this.renderTimer);\n } else {\n window.cancelAnimationFrame(this.renderTimer);\n }\n this.body.emitter.off();\n });\n }\n\n /**\n *\n * @param {object} options\n */\n setOptions(options) {\n if (options !== undefined) {\n const fields = [\"hideEdgesOnDrag\", \"hideEdgesOnZoom\", \"hideNodesOnDrag\"];\n selectiveDeepExtend(fields, this.options, options);\n }\n }\n\n /**\n * Prepare the drawing of the next frame.\n *\n * Calls the callback when the next frame can or will be drawn.\n *\n * @param {Function} callback\n * @param {number} delay - timeout case only, wait this number of milliseconds\n * @returns {Function | undefined}\n * @private\n */\n _requestNextFrame(callback, delay) {\n // During unit testing, it happens that the mock window object is reset while\n // the next frame is still pending. Then, either 'window' is not present, or\n // 'requestAnimationFrame()' is not present because it is not defined on the\n // mock window object.\n //\n // As a consequence, unrelated unit tests may appear to fail, even if the problem\n // described happens in the current unit test.\n //\n // This is not something that will happen in normal operation, but we still need\n // to take it into account.\n //\n if (typeof window === \"undefined\") return; // Doing `if (window === undefined)` does not work here!\n\n let timer;\n\n const myWindow = window; // Grab a reference to reduce the possibility that 'window' is reset\n // while running this method.\n\n if (this.requiresTimeout === true) {\n // wait given number of milliseconds and perform the animation step function\n timer = myWindow.setTimeout(callback, delay);\n } else {\n if (myWindow.requestAnimationFrame) {\n timer = myWindow.requestAnimationFrame(callback);\n }\n }\n\n return timer;\n }\n\n /**\n *\n * @private\n */\n _startRendering() {\n if (this.renderingActive === true) {\n if (this.renderTimer === undefined) {\n this.renderTimer = this._requestNextFrame(\n this._renderStep.bind(this),\n this.simulationInterval\n );\n }\n }\n }\n\n /**\n *\n * @private\n */\n _renderStep() {\n if (this.renderingActive === true) {\n // reset the renderTimer so a new scheduled animation step can be set\n this.renderTimer = undefined;\n\n if (this.requiresTimeout === true) {\n // this schedules a new simulation step\n this._startRendering();\n }\n\n this._redraw();\n\n if (this.requiresTimeout === false) {\n // this schedules a new simulation step\n this._startRendering();\n }\n }\n }\n\n /**\n * Redraw the network with the current data\n * chart will be resized too.\n */\n redraw() {\n this.body.emitter.emit(\"setSize\");\n this._redraw();\n }\n\n /**\n * Redraw the network with the current data\n *\n * @private\n */\n _requestRedraw() {\n if (\n this.redrawRequested !== true &&\n this.renderingActive === false &&\n this.allowRedraw === true\n ) {\n this.redrawRequested = true;\n this._requestNextFrame(() => {\n this._redraw(false);\n }, 0);\n }\n }\n\n /**\n * Redraw the network with the current data\n *\n * @param {boolean} [hidden=false] | Used to get the first estimate of the node sizes.\n * Only the nodes are drawn after which they are quickly drawn over.\n * @private\n */\n _redraw(hidden = false) {\n if (this.allowRedraw === true) {\n this.body.emitter.emit(\"initRedraw\");\n\n this.redrawRequested = false;\n\n const drawLater = {\n drawExternalLabels: null,\n };\n\n // when the container div was hidden, this fixes it back up!\n if (\n this.canvas.frame.canvas.width === 0 ||\n this.canvas.frame.canvas.height === 0\n ) {\n this.canvas.setSize();\n }\n\n this.canvas.setTransform();\n\n const ctx = this.canvas.getContext();\n\n // clear the canvas\n const w = this.canvas.frame.canvas.clientWidth;\n const h = this.canvas.frame.canvas.clientHeight;\n ctx.clearRect(0, 0, w, h);\n\n // if the div is hidden, we stop the redraw here for performance.\n if (this.canvas.frame.clientWidth === 0) {\n return;\n }\n\n // set scaling and translation\n ctx.save();\n ctx.translate(this.body.view.translation.x, this.body.view.translation.y);\n ctx.scale(this.body.view.scale, this.body.view.scale);\n\n ctx.beginPath();\n this.body.emitter.emit(\"beforeDrawing\", ctx);\n ctx.closePath();\n\n if (hidden === false) {\n if (\n (this.dragging === false ||\n (this.dragging === true &&\n this.options.hideEdgesOnDrag === false)) &&\n (this.zooming === false ||\n (this.zooming === true && this.options.hideEdgesOnZoom === false))\n ) {\n this._drawEdges(ctx);\n }\n }\n\n if (\n this.dragging === false ||\n (this.dragging === true && this.options.hideNodesOnDrag === false)\n ) {\n const { drawExternalLabels } = this._drawNodes(ctx, hidden);\n drawLater.drawExternalLabels = drawExternalLabels;\n }\n\n // draw the arrows last so they will be at the top\n if (hidden === false) {\n if (\n (this.dragging === false ||\n (this.dragging === true &&\n this.options.hideEdgesOnDrag === false)) &&\n (this.zooming === false ||\n (this.zooming === true && this.options.hideEdgesOnZoom === false))\n ) {\n this._drawArrows(ctx);\n }\n }\n\n if (drawLater.drawExternalLabels != null) {\n drawLater.drawExternalLabels();\n }\n\n if (hidden === false) {\n this._drawSelectionBox(ctx);\n }\n\n ctx.beginPath();\n this.body.emitter.emit(\"afterDrawing\", ctx);\n ctx.closePath();\n\n // restore original scaling and translation\n ctx.restore();\n if (hidden === true) {\n ctx.clearRect(0, 0, w, h);\n }\n }\n }\n\n /**\n * Redraw all nodes\n *\n * @param {CanvasRenderingContext2D} ctx\n * @param {boolean} [alwaysShow]\n * @private\n */\n _resizeNodes() {\n this.canvas.setTransform();\n const ctx = this.canvas.getContext();\n ctx.save();\n ctx.translate(this.body.view.translation.x, this.body.view.translation.y);\n ctx.scale(this.body.view.scale, this.body.view.scale);\n\n const nodes = this.body.nodes;\n let node;\n\n // resize all nodes\n for (const nodeId in nodes) {\n if (Object.prototype.hasOwnProperty.call(nodes, nodeId)) {\n node = nodes[nodeId];\n node.resize(ctx);\n node.updateBoundingBox(ctx, node.selected);\n }\n }\n\n // restore original scaling and translation\n ctx.restore();\n }\n\n /**\n * Redraw all nodes\n *\n * @param {CanvasRenderingContext2D} ctx 2D context of a HTML canvas\n * @param {boolean} [alwaysShow]\n * @private\n *\n * @returns {object} Callbacks to draw later on higher layers.\n */\n _drawNodes(ctx, alwaysShow = false) {\n const nodes = this.body.nodes;\n const nodeIndices = this.body.nodeIndices;\n let node;\n const selected = [];\n const hovered = [];\n const margin = 20;\n const topLeft = this.canvas.DOMtoCanvas({ x: -margin, y: -margin });\n const bottomRight = this.canvas.DOMtoCanvas({\n x: this.canvas.frame.canvas.clientWidth + margin,\n y: this.canvas.frame.canvas.clientHeight + margin,\n });\n const viewableArea = {\n top: topLeft.y,\n left: topLeft.x,\n bottom: bottomRight.y,\n right: bottomRight.x,\n };\n\n const drawExternalLabels = [];\n\n // draw unselected nodes;\n for (let i = 0; i < nodeIndices.length; i++) {\n node = nodes[nodeIndices[i]];\n // set selected and hovered nodes aside\n if (node.hover) {\n hovered.push(nodeIndices[i]);\n } else if (node.isSelected()) {\n selected.push(nodeIndices[i]);\n } else {\n if (alwaysShow === true) {\n const drawLater = node.draw(ctx);\n if (drawLater.drawExternalLabel != null) {\n drawExternalLabels.push(drawLater.drawExternalLabel);\n }\n } else if (node.isBoundingBoxOverlappingWith(viewableArea) === true) {\n const drawLater = node.draw(ctx);\n if (drawLater.drawExternalLabel != null) {\n drawExternalLabels.push(drawLater.drawExternalLabel);\n }\n } else {\n node.updateBoundingBox(ctx, node.selected);\n }\n }\n }\n\n let i;\n const selectedLength = selected.length;\n const hoveredLength = hovered.length;\n\n // draw the selected nodes on top\n for (i = 0; i < selectedLength; i++) {\n node = nodes[selected[i]];\n const drawLater = node.draw(ctx);\n if (drawLater.drawExternalLabel != null) {\n drawExternalLabels.push(drawLater.drawExternalLabel);\n }\n }\n\n // draw hovered nodes above everything else: fixes https://github.com/visjs/vis-network/issues/226\n for (i = 0; i < hoveredLength; i++) {\n node = nodes[hovered[i]];\n const drawLater = node.draw(ctx);\n if (drawLater.drawExternalLabel != null) {\n drawExternalLabels.push(drawLater.drawExternalLabel);\n }\n }\n\n return {\n drawExternalLabels: () => {\n for (const draw of drawExternalLabels) {\n draw();\n }\n },\n };\n }\n\n /**\n * Redraw all edges\n *\n * @param {CanvasRenderingContext2D} ctx 2D context of a HTML canvas\n * @private\n */\n _drawEdges(ctx) {\n const edges = this.body.edges;\n const edgeIndices = this.body.edgeIndices;\n\n for (let i = 0; i < edgeIndices.length; i++) {\n const edge = edges[edgeIndices[i]];\n if (edge.connected === true) {\n edge.draw(ctx);\n }\n }\n }\n\n /**\n * Redraw all arrows\n *\n * @param {CanvasRenderingContext2D} ctx 2D context of a HTML canvas\n * @private\n */\n _drawArrows(ctx) {\n const edges = this.body.edges;\n const edgeIndices = this.body.edgeIndices;\n\n for (let i = 0; i < edgeIndices.length; i++) {\n const edge = edges[edgeIndices[i]];\n if (edge.connected === true) {\n edge.drawArrows(ctx);\n }\n }\n }\n\n /**\n * Determine if the browser requires a setTimeout or a requestAnimationFrame. This was required because\n * some implementations (safari and IE9) did not support requestAnimationFrame\n *\n * @private\n */\n _determineBrowserMethod() {\n if (typeof window !== \"undefined\") {\n const browserType = navigator.userAgent.toLowerCase();\n this.requiresTimeout = false;\n if (browserType.indexOf(\"msie 9.0\") != -1) {\n // IE 9\n this.requiresTimeout = true;\n } else if (browserType.indexOf(\"safari\") != -1) {\n // safari\n if (browserType.indexOf(\"chrome\") <= -1) {\n this.requiresTimeout = true;\n }\n }\n } else {\n this.requiresTimeout = true;\n }\n }\n\n /**\n * Redraw selection box\n *\n * @param {CanvasRenderingContext2D} ctx 2D context of a HTML canvas\n * @private\n */\n _drawSelectionBox(ctx) {\n if (this.body.selectionBox.show) {\n ctx.beginPath();\n const width =\n this.body.selectionBox.position.end.x -\n this.body.selectionBox.position.start.x;\n const height =\n this.body.selectionBox.position.end.y -\n this.body.selectionBox.position.start.y;\n ctx.rect(\n this.body.selectionBox.position.start.x,\n this.body.selectionBox.position.start.y,\n width,\n height\n );\n ctx.fillStyle = \"rgba(151, 194, 252, 0.2)\";\n ctx.fillRect(\n this.body.selectionBox.position.start.x,\n this.body.selectionBox.position.start.y,\n width,\n height\n );\n ctx.strokeStyle = \"rgba(151, 194, 252, 1)\";\n ctx.stroke();\n } else {\n ctx.closePath();\n }\n }\n}\n\nexport default CanvasRenderer;\n","require('../modules/web.timers');\nvar path = require('../internals/path');\n\nmodule.exports = path.setInterval;\n","module.exports = require(\"core-js-pure/stable/set-interval\");","/**\n * Register a touch event, taking place before a gesture\n *\n * @param {Hammer} hammer A hammer instance\n * @param {Function} callback Callback, called as callback(event)\n */\nexport function onTouch(hammer, callback) {\n callback.inputHandler = function (event) {\n if (event.isFirst) {\n callback(event);\n }\n };\n\n hammer.on(\"hammer.input\", callback.inputHandler);\n}\n\n/**\n * Register a release event, taking place after a gesture\n *\n * @param {Hammer} hammer A hammer instance\n * @param {Function} callback Callback, called as callback(event)\n * @returns {*}\n */\nexport function onRelease(hammer, callback) {\n callback.inputHandler = function (event) {\n if (event.isFinal) {\n callback(event);\n }\n };\n\n return hammer.on(\"hammer.input\", callback.inputHandler);\n}\n\n/**\n * Unregister a touch event, taking place before a gesture\n *\n * @param {Hammer} hammer A hammer instance\n * @param {Function} callback Callback, called as callback(event)\n */\nexport function offTouch(hammer, callback) {\n hammer.off(\"hammer.input\", callback.inputHandler);\n}\n\n/**\n * Unregister a release event, taking place before a gesture\n *\n * @param {Hammer} hammer A hammer instance\n * @param {Function} callback Callback, called as callback(event)\n */\nexport const offRelease = offTouch;\n\n/**\n * Hack the PinchRecognizer such that it doesn't prevent default behavior\n * for vertical panning.\n *\n * Yeah ... this is quite a hack ... see https://github.com/hammerjs/hammer.js/issues/932\n *\n * @param {Hammer.Pinch} pinchRecognizer\n * @returns {Hammer.Pinch} returns the pinchRecognizer\n */\nexport function disablePreventDefaultVertically(pinchRecognizer) {\n const TOUCH_ACTION_PAN_Y = \"pan-y\";\n\n pinchRecognizer.getTouchAction = function () {\n // default method returns [TOUCH_ACTION_NONE]\n return [TOUCH_ACTION_PAN_Y];\n };\n\n return pinchRecognizer;\n}\n","import { onRelease, onTouch } from \"../../hammerUtil\";\n\nimport {\n Hammer,\n addEventListener,\n removeEventListener,\n selectiveDeepExtend,\n} from \"vis-util/esnext\";\n\n/**\n * Create the main frame for the Network.\n * This function is executed once when a Network object is created. The frame\n * contains a canvas, and this canvas contains all objects like the axis and\n * nodes.\n */\nclass Canvas {\n /**\n * @param {object} body\n */\n constructor(body) {\n this.body = body;\n this.pixelRatio = 1;\n this.cameraState = {};\n this.initialized = false;\n this.canvasViewCenter = {};\n this._cleanupCallbacks = [];\n\n this.options = {};\n this.defaultOptions = {\n autoResize: true,\n height: \"100%\",\n width: \"100%\",\n };\n Object.assign(this.options, this.defaultOptions);\n\n this.bindEventListeners();\n }\n\n /**\n * Binds event listeners\n */\n bindEventListeners() {\n // bind the events\n this.body.emitter.once(\"resize\", (obj) => {\n if (obj.width !== 0) {\n this.body.view.translation.x = obj.width * 0.5;\n }\n if (obj.height !== 0) {\n this.body.view.translation.y = obj.height * 0.5;\n }\n });\n this.body.emitter.on(\"setSize\", this.setSize.bind(this));\n this.body.emitter.on(\"destroy\", () => {\n this.hammerFrame.destroy();\n this.hammer.destroy();\n this._cleanUp();\n });\n }\n\n /**\n * @param {object} options\n */\n setOptions(options) {\n if (options !== undefined) {\n const fields = [\"width\", \"height\", \"autoResize\"];\n selectiveDeepExtend(fields, this.options, options);\n }\n\n // Automatically adapt to changing size of the container element.\n this._cleanUp();\n if (this.options.autoResize === true) {\n if (window.ResizeObserver) {\n // decent browsers, immediate reactions\n const observer = new ResizeObserver(() => {\n const changed = this.setSize();\n if (changed === true) {\n this.body.emitter.emit(\"_requestRedraw\");\n }\n });\n const { frame } = this;\n\n observer.observe(frame);\n this._cleanupCallbacks.push(() => {\n observer.unobserve(frame);\n });\n } else {\n // IE11, continous polling\n const resizeTimer = setInterval(() => {\n const changed = this.setSize();\n if (changed === true) {\n this.body.emitter.emit(\"_requestRedraw\");\n }\n }, 1000);\n this._cleanupCallbacks.push(() => {\n clearInterval(resizeTimer);\n });\n }\n\n // Automatically adapt to changing size of the browser.\n const resizeFunction = this._onResize.bind(this);\n addEventListener(window, \"resize\", resizeFunction);\n this._cleanupCallbacks.push(() => {\n removeEventListener(window, \"resize\", resizeFunction);\n });\n }\n }\n\n /**\n * @private\n */\n _cleanUp() {\n this._cleanupCallbacks\n .splice(0)\n .reverse()\n .forEach((callback) => {\n try {\n callback();\n } catch (error) {\n console.error(error);\n }\n });\n }\n\n /**\n * @private\n */\n _onResize() {\n this.setSize();\n this.body.emitter.emit(\"_redraw\");\n }\n\n /**\n * Get and store the cameraState\n *\n * @param {number} [pixelRatio=this.pixelRatio]\n * @private\n */\n _getCameraState(pixelRatio = this.pixelRatio) {\n if (this.initialized === true) {\n this.cameraState.previousWidth = this.frame.canvas.width / pixelRatio;\n this.cameraState.previousHeight = this.frame.canvas.height / pixelRatio;\n this.cameraState.scale = this.body.view.scale;\n this.cameraState.position = this.DOMtoCanvas({\n x: (0.5 * this.frame.canvas.width) / pixelRatio,\n y: (0.5 * this.frame.canvas.height) / pixelRatio,\n });\n }\n }\n\n /**\n * Set the cameraState\n *\n * @private\n */\n _setCameraState() {\n if (\n this.cameraState.scale !== undefined &&\n this.frame.canvas.clientWidth !== 0 &&\n this.frame.canvas.clientHeight !== 0 &&\n this.pixelRatio !== 0 &&\n this.cameraState.previousWidth > 0 &&\n this.cameraState.previousHeight > 0\n ) {\n const widthRatio =\n this.frame.canvas.width /\n this.pixelRatio /\n this.cameraState.previousWidth;\n const heightRatio =\n this.frame.canvas.height /\n this.pixelRatio /\n this.cameraState.previousHeight;\n let newScale = this.cameraState.scale;\n\n if (widthRatio != 1 && heightRatio != 1) {\n newScale = this.cameraState.scale * 0.5 * (widthRatio + heightRatio);\n } else if (widthRatio != 1) {\n newScale = this.cameraState.scale * widthRatio;\n } else if (heightRatio != 1) {\n newScale = this.cameraState.scale * heightRatio;\n }\n\n this.body.view.scale = newScale;\n // this comes from the view module.\n const currentViewCenter = this.DOMtoCanvas({\n x: 0.5 * this.frame.canvas.clientWidth,\n y: 0.5 * this.frame.canvas.clientHeight,\n });\n\n const distanceFromCenter = {\n // offset from view, distance view has to change by these x and y to center the node\n x: currentViewCenter.x - this.cameraState.position.x,\n y: currentViewCenter.y - this.cameraState.position.y,\n };\n this.body.view.translation.x +=\n distanceFromCenter.x * this.body.view.scale;\n this.body.view.translation.y +=\n distanceFromCenter.y * this.body.view.scale;\n }\n }\n\n /**\n *\n * @param {number|string} value\n * @returns {string}\n * @private\n */\n _prepareValue(value) {\n if (typeof value === \"number\") {\n return value + \"px\";\n } else if (typeof value === \"string\") {\n if (value.indexOf(\"%\") !== -1 || value.indexOf(\"px\") !== -1) {\n return value;\n } else if (value.indexOf(\"%\") === -1) {\n return value + \"px\";\n }\n }\n throw new Error(\n \"Could not use the value supplied for width or height:\" + value\n );\n }\n\n /**\n * Create the HTML\n */\n _create() {\n // remove all elements from the container element.\n while (this.body.container.hasChildNodes()) {\n this.body.container.removeChild(this.body.container.firstChild);\n }\n\n this.frame = document.createElement(\"div\");\n this.frame.className = \"vis-network\";\n this.frame.style.position = \"relative\";\n this.frame.style.overflow = \"hidden\";\n this.frame.tabIndex = 0; // tab index is required for keycharm to bind keystrokes to the div instead of the window\n\n //////////////////////////////////////////////////////////////////\n\n this.frame.canvas = document.createElement(\"canvas\");\n this.frame.canvas.style.position = \"relative\";\n this.frame.appendChild(this.frame.canvas);\n\n if (!this.frame.canvas.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.frame.canvas.appendChild(noCanvas);\n } else {\n this._setPixelRatio();\n this.setTransform();\n }\n\n // add the frame to the container element\n this.body.container.appendChild(this.frame);\n\n this.body.view.scale = 1;\n this.body.view.translation = {\n x: 0.5 * this.frame.canvas.clientWidth,\n y: 0.5 * this.frame.canvas.clientHeight,\n };\n\n this._bindHammer();\n }\n\n /**\n * This function binds hammer, it can be repeated over and over due to the uniqueness check.\n *\n * @private\n */\n _bindHammer() {\n if (this.hammer !== undefined) {\n this.hammer.destroy();\n }\n this.drag = {};\n this.pinch = {};\n\n // init hammer\n this.hammer = new Hammer(this.frame.canvas);\n this.hammer.get(\"pinch\").set({ enable: true });\n // enable to get better response, todo: test on mobile.\n this.hammer\n .get(\"pan\")\n .set({ threshold: 5, direction: Hammer.DIRECTION_ALL });\n\n onTouch(this.hammer, (event) => {\n this.body.eventListeners.onTouch(event);\n });\n this.hammer.on(\"tap\", (event) => {\n this.body.eventListeners.onTap(event);\n });\n this.hammer.on(\"doubletap\", (event) => {\n this.body.eventListeners.onDoubleTap(event);\n });\n this.hammer.on(\"press\", (event) => {\n this.body.eventListeners.onHold(event);\n });\n this.hammer.on(\"panstart\", (event) => {\n this.body.eventListeners.onDragStart(event);\n });\n this.hammer.on(\"panmove\", (event) => {\n this.body.eventListeners.onDrag(event);\n });\n this.hammer.on(\"panend\", (event) => {\n this.body.eventListeners.onDragEnd(event);\n });\n this.hammer.on(\"pinch\", (event) => {\n this.body.eventListeners.onPinch(event);\n });\n\n // TODO: neatly cleanup these handlers when re-creating the Canvas, IF these are done with hammer, event.stopPropagation will not work?\n this.frame.canvas.addEventListener(\"wheel\", (event) => {\n this.body.eventListeners.onMouseWheel(event);\n });\n\n this.frame.canvas.addEventListener(\"mousemove\", (event) => {\n this.body.eventListeners.onMouseMove(event);\n });\n this.frame.canvas.addEventListener(\"contextmenu\", (event) => {\n this.body.eventListeners.onContext(event);\n });\n\n this.hammerFrame = new Hammer(this.frame);\n onRelease(this.hammerFrame, (event) => {\n this.body.eventListeners.onRelease(event);\n });\n }\n\n /**\n * Set a new size for the network\n *\n * @param {string} width Width in pixels or percentage (for example '800px'\n * or '50%')\n * @param {string} height Height in pixels or percentage (for example '400px'\n * or '30%')\n * @returns {boolean}\n */\n setSize(width = this.options.width, height = this.options.height) {\n width = this._prepareValue(width);\n height = this._prepareValue(height);\n\n let emitEvent = false;\n const oldWidth = this.frame.canvas.width;\n const oldHeight = this.frame.canvas.height;\n\n // update the pixel ratio\n //\n // NOTE: Comment in following is rather inconsistent; this is the ONLY place in the code\n // where it is assumed that the pixel ratio could change at runtime.\n // The only way I can think of this happening is a rotating screen or tablet; but then\n // there should be a mechanism for reloading the data (TODO: check if this is present).\n //\n // If the assumption is true (i.e. pixel ratio can change at runtime), then *all* usage\n // of pixel ratio must be overhauled for this.\n //\n // For the time being, I will humor the assumption here, and in the rest of the code assume it is\n // constant.\n const previousRatio = this.pixelRatio; // we cache this because the camera state storage needs the old value\n this._setPixelRatio();\n\n if (\n width != this.options.width ||\n height != this.options.height ||\n this.frame.style.width != width ||\n this.frame.style.height != height\n ) {\n this._getCameraState(previousRatio);\n\n this.frame.style.width = width;\n this.frame.style.height = height;\n\n this.frame.canvas.style.width = \"100%\";\n this.frame.canvas.style.height = \"100%\";\n\n this.frame.canvas.width = Math.round(\n this.frame.canvas.clientWidth * this.pixelRatio\n );\n this.frame.canvas.height = Math.round(\n this.frame.canvas.clientHeight * this.pixelRatio\n );\n\n this.options.width = width;\n this.options.height = height;\n\n this.canvasViewCenter = {\n x: 0.5 * this.frame.clientWidth,\n y: 0.5 * this.frame.clientHeight,\n };\n\n emitEvent = true;\n } else {\n // this would adapt the width of the canvas to the width from 100% if and only if\n // there is a change.\n\n const newWidth = Math.round(\n this.frame.canvas.clientWidth * this.pixelRatio\n );\n const newHeight = Math.round(\n this.frame.canvas.clientHeight * this.pixelRatio\n );\n\n // store the camera if there is a change in size.\n if (\n this.frame.canvas.width !== newWidth ||\n this.frame.canvas.height !== newHeight\n ) {\n this._getCameraState(previousRatio);\n }\n\n if (this.frame.canvas.width !== newWidth) {\n this.frame.canvas.width = newWidth;\n emitEvent = true;\n }\n if (this.frame.canvas.height !== newHeight) {\n this.frame.canvas.height = newHeight;\n emitEvent = true;\n }\n }\n\n if (emitEvent === true) {\n this.body.emitter.emit(\"resize\", {\n width: Math.round(this.frame.canvas.width / this.pixelRatio),\n height: Math.round(this.frame.canvas.height / this.pixelRatio),\n oldWidth: Math.round(oldWidth / this.pixelRatio),\n oldHeight: Math.round(oldHeight / this.pixelRatio),\n });\n\n // restore the camera on change.\n this._setCameraState();\n }\n\n // set initialized so the get and set camera will work from now on.\n this.initialized = true;\n return emitEvent;\n }\n\n /**\n *\n * @returns {CanvasRenderingContext2D}\n */\n getContext() {\n return this.frame.canvas.getContext(\"2d\");\n }\n\n /**\n * Determine the pixel ratio for various browsers.\n *\n * @returns {number}\n * @private\n */\n _determinePixelRatio() {\n const ctx = this.getContext();\n if (ctx === undefined) {\n throw new Error(\"Could not get canvax context\");\n }\n\n let numerator = 1;\n if (typeof window !== \"undefined\") {\n // (window !== undefined) doesn't work here!\n // Protection during unit tests, where 'window' can be missing\n numerator = window.devicePixelRatio || 1;\n }\n\n const denominator =\n ctx.webkitBackingStorePixelRatio ||\n ctx.mozBackingStorePixelRatio ||\n ctx.msBackingStorePixelRatio ||\n ctx.oBackingStorePixelRatio ||\n ctx.backingStorePixelRatio ||\n 1;\n\n return numerator / denominator;\n }\n\n /**\n * Lazy determination of pixel ratio.\n *\n * @private\n */\n _setPixelRatio() {\n this.pixelRatio = this._determinePixelRatio();\n }\n\n /**\n * Set the transform in the contained context, based on its pixelRatio\n */\n setTransform() {\n const ctx = this.getContext();\n if (ctx === undefined) {\n throw new Error(\"Could not get canvax context\");\n }\n\n ctx.setTransform(this.pixelRatio, 0, 0, this.pixelRatio, 0, 0);\n }\n\n /**\n * Convert the X coordinate in DOM-space (coordinate point in browser relative to the container div) to\n * the X coordinate in canvas-space (the simulation sandbox, which the camera looks upon)\n *\n * @param {number} x\n * @returns {number}\n * @private\n */\n _XconvertDOMtoCanvas(x) {\n return (x - this.body.view.translation.x) / this.body.view.scale;\n }\n\n /**\n * Convert the X coordinate in canvas-space (the simulation sandbox, which the camera looks upon) to\n * the X coordinate in DOM-space (coordinate point in browser relative to the container div)\n *\n * @param {number} x\n * @returns {number}\n * @private\n */\n _XconvertCanvasToDOM(x) {\n return x * this.body.view.scale + this.body.view.translation.x;\n }\n\n /**\n * Convert the Y coordinate in DOM-space (coordinate point in browser relative to the container div) to\n * the Y coordinate in canvas-space (the simulation sandbox, which the camera looks upon)\n *\n * @param {number} y\n * @returns {number}\n * @private\n */\n _YconvertDOMtoCanvas(y) {\n return (y - this.body.view.translation.y) / this.body.view.scale;\n }\n\n /**\n * Convert the Y coordinate in canvas-space (the simulation sandbox, which the camera looks upon) to\n * the Y coordinate in DOM-space (coordinate point in browser relative to the container div)\n *\n * @param {number} y\n * @returns {number}\n * @private\n */\n _YconvertCanvasToDOM(y) {\n return y * this.body.view.scale + this.body.view.translation.y;\n }\n\n /**\n * @param {point} pos\n * @returns {point}\n */\n canvasToDOM(pos) {\n return {\n x: this._XconvertCanvasToDOM(pos.x),\n y: this._YconvertCanvasToDOM(pos.y),\n };\n }\n\n /**\n *\n * @param {point} pos\n * @returns {point}\n */\n DOMtoCanvas(pos) {\n return {\n x: this._XconvertDOMtoCanvas(pos.x),\n y: this._YconvertDOMtoCanvas(pos.y),\n };\n }\n}\n\nexport default Canvas;\n","type IdType = string | number;\n\nexport interface ViewFitOptions {\n nodes: IdType[];\n minZoomLevel: number;\n maxZoomLevel: number;\n}\n\n/**\n * Validate the fit options, replace missing optional values by defaults etc.\n *\n * @param rawOptions - The raw options.\n * @param allNodeIds - All node ids that will be used if nodes are omitted in\n * the raw options.\n *\n * @returns Options with everything filled in and validated.\n */\nexport function normalizeFitOptions(\n rawOptions: Partial<ViewFitOptions>,\n allNodeIds: IdType[]\n): ViewFitOptions {\n const options = Object.assign<ViewFitOptions, Partial<ViewFitOptions>>(\n {\n nodes: allNodeIds,\n minZoomLevel: Number.MIN_VALUE,\n maxZoomLevel: 1,\n },\n rawOptions ?? {}\n );\n\n if (!Array.isArray(options.nodes)) {\n throw new TypeError(\"Nodes has to be an array of ids.\");\n }\n if (options.nodes.length === 0) {\n options.nodes = allNodeIds;\n }\n\n if (!(typeof options.minZoomLevel === \"number\" && options.minZoomLevel > 0)) {\n throw new TypeError(\"Min zoom level has to be a number higher than zero.\");\n }\n\n if (\n !(\n typeof options.maxZoomLevel === \"number\" &&\n options.minZoomLevel <= options.maxZoomLevel\n )\n ) {\n throw new TypeError(\n \"Max zoom level has to be a number higher than min zoom level.\"\n );\n }\n\n return options;\n}\n","import { easingFunctions } from \"vis-util/esnext\";\n\nimport NetworkUtil from \"../NetworkUtil\";\nimport { normalizeFitOptions } from \"./view-handler\";\n\n/**\n * The view\n */\nclass View {\n /**\n * @param {object} body\n * @param {Canvas} canvas\n */\n constructor(body, canvas) {\n this.body = body;\n this.canvas = canvas;\n\n this.animationSpeed = 1 / this.renderRefreshRate;\n this.animationEasingFunction = \"easeInOutQuint\";\n this.easingTime = 0;\n this.sourceScale = 0;\n this.targetScale = 0;\n this.sourceTranslation = 0;\n this.targetTranslation = 0;\n this.lockedOnNodeId = undefined;\n this.lockedOnNodeOffset = undefined;\n this.touchTime = 0;\n\n this.viewFunction = undefined;\n\n this.body.emitter.on(\"fit\", this.fit.bind(this));\n this.body.emitter.on(\"animationFinished\", () => {\n this.body.emitter.emit(\"_stopRendering\");\n });\n this.body.emitter.on(\"unlockNode\", this.releaseNode.bind(this));\n }\n\n /**\n *\n * @param {object} [options={}]\n */\n setOptions(options = {}) {\n this.options = options;\n }\n\n /**\n * This function zooms out to fit all data on screen based on amount of nodes\n *\n * @param {object} [options={{nodes=Array}}]\n * @param options\n * @param {boolean} [initialZoom=false] | zoom based on fitted formula or range, true = fitted, default = false;\n */\n fit(options, initialZoom = false) {\n options = normalizeFitOptions(options, this.body.nodeIndices);\n\n const canvasWidth = this.canvas.frame.canvas.clientWidth;\n const canvasHeight = this.canvas.frame.canvas.clientHeight;\n\n let range;\n let zoomLevel;\n if (canvasWidth === 0 || canvasHeight === 0) {\n // There's no point in trying to fit into zero sized canvas. This could\n // potentially even result in invalid values being computed. For example\n // for network without nodes and zero sized canvas the zoom level would\n // end up being computed as 0/0 which results in NaN. In any other case\n // this would be 0/something which is again pointless to compute.\n zoomLevel = 1;\n\n range = NetworkUtil.getRange(this.body.nodes, options.nodes);\n } else if (initialZoom === true) {\n // check if more than half of the nodes have a predefined position. If so, we use the range, not the approximation.\n let positionDefined = 0;\n for (const nodeId in this.body.nodes) {\n if (Object.prototype.hasOwnProperty.call(this.body.nodes, nodeId)) {\n const node = this.body.nodes[nodeId];\n if (node.predefinedPosition === true) {\n positionDefined += 1;\n }\n }\n }\n if (positionDefined > 0.5 * this.body.nodeIndices.length) {\n this.fit(options, false);\n return;\n }\n\n range = NetworkUtil.getRange(this.body.nodes, options.nodes);\n\n const numberOfNodes = this.body.nodeIndices.length;\n zoomLevel = 12.662 / (numberOfNodes + 7.4147) + 0.0964822; // this is obtained from fitting a dataset from 5 points with scale levels that looked good.\n\n // correct for larger canvasses.\n const factor = Math.min(canvasWidth / 600, canvasHeight / 600);\n zoomLevel *= factor;\n } else {\n this.body.emitter.emit(\"_resizeNodes\");\n range = NetworkUtil.getRange(this.body.nodes, options.nodes);\n\n const xDistance = Math.abs(range.maxX - range.minX) * 1.1;\n const yDistance = Math.abs(range.maxY - range.minY) * 1.1;\n\n const xZoomLevel = canvasWidth / xDistance;\n const yZoomLevel = canvasHeight / yDistance;\n\n zoomLevel = xZoomLevel <= yZoomLevel ? xZoomLevel : yZoomLevel;\n }\n\n if (zoomLevel > options.maxZoomLevel) {\n zoomLevel = options.maxZoomLevel;\n } else if (zoomLevel < options.minZoomLevel) {\n zoomLevel = options.minZoomLevel;\n }\n\n const center = NetworkUtil.findCenter(range);\n const animationOptions = {\n position: center,\n scale: zoomLevel,\n animation: options.animation,\n };\n this.moveTo(animationOptions);\n }\n\n // animation\n\n /**\n * Center a node in view.\n *\n * @param {number} nodeId\n * @param {number} [options]\n */\n focus(nodeId, options = {}) {\n if (this.body.nodes[nodeId] !== undefined) {\n const nodePosition = {\n x: this.body.nodes[nodeId].x,\n y: this.body.nodes[nodeId].y,\n };\n options.position = nodePosition;\n options.lockedOnNode = nodeId;\n\n this.moveTo(options);\n } else {\n console.error(\"Node: \" + nodeId + \" cannot be found.\");\n }\n }\n\n /**\n *\n * @param {object} options | options.offset = {x:number, y:number} // offset from the center in DOM pixels\n * | options.scale = number // scale to move to\n * | options.position = {x:number, y:number} // position to move to\n * | options.animation = {duration:number, easingFunction:String} || Boolean // position to move to\n */\n moveTo(options) {\n if (options === undefined) {\n options = {};\n return;\n }\n\n if (options.offset != null) {\n if (options.offset.x != null) {\n // Coerce and verify that x is valid.\n options.offset.x = +options.offset.x;\n if (!Number.isFinite(options.offset.x)) {\n throw new TypeError(\n 'The option \"offset.x\" has to be a finite number.'\n );\n }\n } else {\n options.offset.x = 0;\n }\n\n if (options.offset.y != null) {\n // Coerce and verify that y is valid.\n options.offset.y = +options.offset.y;\n if (!Number.isFinite(options.offset.y)) {\n throw new TypeError(\n 'The option \"offset.y\" has to be a finite number.'\n );\n }\n } else {\n options.offset.x = 0;\n }\n } else {\n options.offset = {\n x: 0,\n y: 0,\n };\n }\n\n if (options.position != null) {\n if (options.position.x != null) {\n // Coerce and verify that x is valid.\n options.position.x = +options.position.x;\n if (!Number.isFinite(options.position.x)) {\n throw new TypeError(\n 'The option \"position.x\" has to be a finite number.'\n );\n }\n } else {\n options.position.x = 0;\n }\n\n if (options.position.y != null) {\n // Coerce and verify that y is valid.\n options.position.y = +options.position.y;\n if (!Number.isFinite(options.position.y)) {\n throw new TypeError(\n 'The option \"position.y\" has to be a finite number.'\n );\n }\n } else {\n options.position.x = 0;\n }\n } else {\n options.position = this.getViewPosition();\n }\n\n if (options.scale != null) {\n // Coerce and verify that the scale is valid.\n options.scale = +options.scale;\n if (!(options.scale > 0)) {\n throw new TypeError(\n 'The option \"scale\" has to be a number greater than zero.'\n );\n }\n } else {\n options.scale = this.body.view.scale;\n }\n\n if (options.animation === undefined) {\n options.animation = { duration: 0 };\n }\n if (options.animation === false) {\n options.animation = { duration: 0 };\n }\n if (options.animation === true) {\n options.animation = {};\n }\n if (options.animation.duration === undefined) {\n options.animation.duration = 1000;\n } // default duration\n if (options.animation.easingFunction === undefined) {\n options.animation.easingFunction = \"easeInOutQuad\";\n } // default easing function\n\n this.animateView(options);\n }\n\n /**\n *\n * @param {object} options | options.offset = {x:number, y:number} // offset from the center in DOM pixels\n * | options.time = number // animation time in milliseconds\n * | options.scale = number // scale to animate to\n * | options.position = {x:number, y:number} // position to animate to\n * | options.easingFunction = String // linear, easeInQuad, easeOutQuad, easeInOutQuad,\n * // easeInCubic, easeOutCubic, easeInOutCubic,\n * // easeInQuart, easeOutQuart, easeInOutQuart,\n * // easeInQuint, easeOutQuint, easeInOutQuint\n */\n animateView(options) {\n if (options === undefined) {\n return;\n }\n this.animationEasingFunction = options.animation.easingFunction;\n // release if something focussed on the node\n this.releaseNode();\n if (options.locked === true) {\n this.lockedOnNodeId = options.lockedOnNode;\n this.lockedOnNodeOffset = options.offset;\n }\n\n // forcefully complete the old animation if it was still running\n if (this.easingTime != 0) {\n this._transitionRedraw(true); // by setting easingtime to 1, we finish the animation.\n }\n\n this.sourceScale = this.body.view.scale;\n this.sourceTranslation = this.body.view.translation;\n this.targetScale = options.scale;\n\n // set the scale so the viewCenter is based on the correct zoom level. This is overridden in the transitionRedraw\n // but at least then we'll have the target transition\n this.body.view.scale = this.targetScale;\n const viewCenter = this.canvas.DOMtoCanvas({\n x: 0.5 * this.canvas.frame.canvas.clientWidth,\n y: 0.5 * this.canvas.frame.canvas.clientHeight,\n });\n\n const distanceFromCenter = {\n // offset from view, distance view has to change by these x and y to center the node\n x: viewCenter.x - options.position.x,\n y: viewCenter.y - options.position.y,\n };\n this.targetTranslation = {\n x:\n this.sourceTranslation.x +\n distanceFromCenter.x * this.targetScale +\n options.offset.x,\n y:\n this.sourceTranslation.y +\n distanceFromCenter.y * this.targetScale +\n options.offset.y,\n };\n\n // if the time is set to 0, don't do an animation\n if (options.animation.duration === 0) {\n if (this.lockedOnNodeId != undefined) {\n this.viewFunction = this._lockedRedraw.bind(this);\n this.body.emitter.on(\"initRedraw\", this.viewFunction);\n } else {\n this.body.view.scale = this.targetScale;\n this.body.view.translation = this.targetTranslation;\n this.body.emitter.emit(\"_requestRedraw\");\n }\n } else {\n this.animationSpeed =\n 1 / (60 * options.animation.duration * 0.001) || 1 / 60; // 60 for 60 seconds, 0.001 for milli's\n this.animationEasingFunction = options.animation.easingFunction;\n\n this.viewFunction = this._transitionRedraw.bind(this);\n this.body.emitter.on(\"initRedraw\", this.viewFunction);\n this.body.emitter.emit(\"_startRendering\");\n }\n }\n\n /**\n * used to animate smoothly by hijacking the redraw function.\n *\n * @private\n */\n _lockedRedraw() {\n const nodePosition = {\n x: this.body.nodes[this.lockedOnNodeId].x,\n y: this.body.nodes[this.lockedOnNodeId].y,\n };\n const viewCenter = this.canvas.DOMtoCanvas({\n x: 0.5 * this.canvas.frame.canvas.clientWidth,\n y: 0.5 * this.canvas.frame.canvas.clientHeight,\n });\n const distanceFromCenter = {\n // offset from view, distance view has to change by these x and y to center the node\n x: viewCenter.x - nodePosition.x,\n y: viewCenter.y - nodePosition.y,\n };\n const sourceTranslation = this.body.view.translation;\n const targetTranslation = {\n x:\n sourceTranslation.x +\n distanceFromCenter.x * this.body.view.scale +\n this.lockedOnNodeOffset.x,\n y:\n sourceTranslation.y +\n distanceFromCenter.y * this.body.view.scale +\n this.lockedOnNodeOffset.y,\n };\n\n this.body.view.translation = targetTranslation;\n }\n\n /**\n * Resets state of a locked on Node\n */\n releaseNode() {\n if (this.lockedOnNodeId !== undefined && this.viewFunction !== undefined) {\n this.body.emitter.off(\"initRedraw\", this.viewFunction);\n this.lockedOnNodeId = undefined;\n this.lockedOnNodeOffset = undefined;\n }\n }\n\n /**\n * @param {boolean} [finished=false]\n * @private\n */\n _transitionRedraw(finished = false) {\n this.easingTime += this.animationSpeed;\n this.easingTime = finished === true ? 1.0 : this.easingTime;\n\n const progress = easingFunctions[this.animationEasingFunction](\n this.easingTime\n );\n\n this.body.view.scale =\n this.sourceScale + (this.targetScale - this.sourceScale) * progress;\n this.body.view.translation = {\n x:\n this.sourceTranslation.x +\n (this.targetTranslation.x - this.sourceTranslation.x) * progress,\n y:\n this.sourceTranslation.y +\n (this.targetTranslation.y - this.sourceTranslation.y) * progress,\n };\n\n // cleanup\n if (this.easingTime >= 1.0) {\n this.body.emitter.off(\"initRedraw\", this.viewFunction);\n this.easingTime = 0;\n if (this.lockedOnNodeId != undefined) {\n this.viewFunction = this._lockedRedraw.bind(this);\n this.body.emitter.on(\"initRedraw\", this.viewFunction);\n }\n this.body.emitter.emit(\"animationFinished\");\n }\n }\n\n /**\n *\n * @returns {number}\n */\n getScale() {\n return this.body.view.scale;\n }\n\n /**\n *\n * @returns {{x: number, y: number}}\n */\n getViewPosition() {\n return this.canvas.DOMtoCanvas({\n x: 0.5 * this.canvas.frame.canvas.clientWidth,\n y: 0.5 * this.canvas.frame.canvas.clientHeight,\n });\n }\n}\n\nexport default View;\n","/**\r\n * Created by Alex on 11/6/2014.\r\n */\r\nexport default function keycharm(options) {\r\n var preventDefault = options && options.preventDefault || false;\r\n\r\n var container = options && options.container || window;\r\n\r\n var _exportFunctions = {};\r\n var _bound = {keydown:{}, keyup:{}};\r\n var _keys = {};\r\n var i;\r\n\r\n // a - z\r\n for (i = 97; i <= 122; i++) {_keys[String.fromCharCode(i)] = {code:65 + (i - 97), shift: false};}\r\n // A - Z\r\n for (i = 65; i <= 90; i++) {_keys[String.fromCharCode(i)] = {code:i, shift: true};}\r\n // 0 - 9\r\n for (i = 0; i <= 9; i++) {_keys['' + i] = {code:48 + i, shift: false};}\r\n // F1 - F12\r\n for (i = 1; i <= 12; i++) {_keys['F' + i] = {code:111 + i, shift: false};}\r\n // num0 - num9\r\n for (i = 0; i <= 9; i++) {_keys['num' + i] = {code:96 + i, shift: false};}\r\n\r\n // numpad misc\r\n _keys['num*'] = {code:106, shift: false};\r\n _keys['num+'] = {code:107, shift: false};\r\n _keys['num-'] = {code:109, shift: false};\r\n _keys['num/'] = {code:111, shift: false};\r\n _keys['num.'] = {code:110, shift: false};\r\n // arrows\r\n _keys['left'] = {code:37, shift: false};\r\n _keys['up'] = {code:38, shift: false};\r\n _keys['right'] = {code:39, shift: false};\r\n _keys['down'] = {code:40, shift: false};\r\n // extra keys\r\n _keys['space'] = {code:32, shift: false};\r\n _keys['enter'] = {code:13, shift: false};\r\n _keys['shift'] = {code:16, shift: undefined};\r\n _keys['esc'] = {code:27, shift: false};\r\n _keys['backspace'] = {code:8, shift: false};\r\n _keys['tab'] = {code:9, shift: false};\r\n _keys['ctrl'] = {code:17, shift: false};\r\n _keys['alt'] = {code:18, shift: false};\r\n _keys['delete'] = {code:46, shift: false};\r\n _keys['pageup'] = {code:33, shift: false};\r\n _keys['pagedown'] = {code:34, shift: false};\r\n // symbols\r\n _keys['='] = {code:187, shift: false};\r\n _keys['-'] = {code:189, shift: false};\r\n _keys[']'] = {code:221, shift: false};\r\n _keys['['] = {code:219, shift: false};\r\n\r\n\r\n\r\n var down = function(event) {handleEvent(event,'keydown');};\r\n var up = function(event) {handleEvent(event,'keyup');};\r\n\r\n // handle the actualy bound key with the event\r\n var handleEvent = function(event,type) {\r\n if (_bound[type][event.keyCode] !== undefined) {\r\n var bound = _bound[type][event.keyCode];\r\n for (var i = 0; i < bound.length; i++) {\r\n if (bound[i].shift === undefined) {\r\n bound[i].fn(event);\r\n }\r\n else if (bound[i].shift == true && event.shiftKey == true) {\r\n bound[i].fn(event);\r\n }\r\n else if (bound[i].shift == false && event.shiftKey == false) {\r\n bound[i].fn(event);\r\n }\r\n }\r\n\r\n if (preventDefault == true) {\r\n event.preventDefault();\r\n }\r\n }\r\n };\r\n\r\n // bind a key to a callback\r\n _exportFunctions.bind = function(key, callback, type) {\r\n if (type === undefined) {\r\n type = 'keydown';\r\n }\r\n if (_keys[key] === undefined) {\r\n throw new Error(\"unsupported key: \" + key);\r\n }\r\n if (_bound[type][_keys[key].code] === undefined) {\r\n _bound[type][_keys[key].code] = [];\r\n }\r\n _bound[type][_keys[key].code].push({fn:callback, shift:_keys[key].shift});\r\n };\r\n\r\n\r\n // bind all keys to a call back (demo purposes)\r\n _exportFunctions.bindAll = function(callback, type) {\r\n if (type === undefined) {\r\n type = 'keydown';\r\n }\r\n for (var key in _keys) {\r\n if (_keys.hasOwnProperty(key)) {\r\n _exportFunctions.bind(key,callback,type);\r\n }\r\n }\r\n };\r\n\r\n // get the key label from an event\r\n _exportFunctions.getKey = function(event) {\r\n for (var key in _keys) {\r\n if (_keys.hasOwnProperty(key)) {\r\n if (event.shiftKey == true && _keys[key].shift == true && event.keyCode == _keys[key].code) {\r\n return key;\r\n }\r\n else if (event.shiftKey == false && _keys[key].shift == false && event.keyCode == _keys[key].code) {\r\n return key;\r\n }\r\n else if (event.keyCode == _keys[key].code && key == 'shift') {\r\n return key;\r\n }\r\n }\r\n }\r\n return \"unknown key, currently not supported\";\r\n };\r\n\r\n // unbind either a specific callback from a key or all of them (by leaving callback undefined)\r\n _exportFunctions.unbind = function(key, callback, type) {\r\n if (type === undefined) {\r\n type = 'keydown';\r\n }\r\n if (_keys[key] === undefined) {\r\n throw new Error(\"unsupported key: \" + key);\r\n }\r\n if (callback !== undefined) {\r\n var newBindings = [];\r\n var bound = _bound[type][_keys[key].code];\r\n if (bound !== undefined) {\r\n for (var i = 0; i < bound.length; i++) {\r\n if (!(bound[i].fn == callback && bound[i].shift == _keys[key].shift)) {\r\n newBindings.push(_bound[type][_keys[key].code][i]);\r\n }\r\n }\r\n }\r\n _bound[type][_keys[key].code] = newBindings;\r\n }\r\n else {\r\n _bound[type][_keys[key].code] = [];\r\n }\r\n };\r\n\r\n // reset all bound variables.\r\n _exportFunctions.reset = function() {\r\n _bound = {keydown:{}, keyup:{}};\r\n };\r\n\r\n // unbind all listeners and reset all variables.\r\n _exportFunctions.destroy = function() {\r\n _bound = {keydown:{}, keyup:{}};\r\n container.removeEventListener('keydown', down, true);\r\n container.removeEventListener('keyup', up, true);\r\n };\r\n\r\n // create listeners.\r\n container.addEventListener('keydown',down,true);\r\n container.addEventListener('keyup',up,true);\r\n\r\n // return the public functions.\r\n return _exportFunctions;\r\n}\r\n","import \"./NavigationHandler.css\";\n\nimport { Hammer } from \"vis-util/esnext\";\nimport { onRelease, onTouch } from \"../../../hammerUtil\";\nimport keycharm from \"keycharm\";\n\n/**\n * Navigation Handler\n */\nclass NavigationHandler {\n /**\n * @param {object} body\n * @param {Canvas} canvas\n */\n constructor(body, canvas) {\n this.body = body;\n this.canvas = canvas;\n\n this.iconsCreated = false;\n this.navigationHammers = [];\n this.boundFunctions = {};\n this.touchTime = 0;\n this.activated = false;\n\n this.body.emitter.on(\"activate\", () => {\n this.activated = true;\n this.configureKeyboardBindings();\n });\n this.body.emitter.on(\"deactivate\", () => {\n this.activated = false;\n this.configureKeyboardBindings();\n });\n this.body.emitter.on(\"destroy\", () => {\n if (this.keycharm !== undefined) {\n this.keycharm.destroy();\n }\n });\n\n this.options = {};\n }\n\n /**\n *\n * @param {object} options\n */\n setOptions(options) {\n if (options !== undefined) {\n this.options = options;\n this.create();\n }\n }\n\n /**\n * Creates or refreshes navigation and sets key bindings\n */\n create() {\n if (this.options.navigationButtons === true) {\n if (this.iconsCreated === false) {\n this.loadNavigationElements();\n }\n } else if (this.iconsCreated === true) {\n this.cleanNavigation();\n }\n\n this.configureKeyboardBindings();\n }\n\n /**\n * Cleans up previous navigation items\n */\n cleanNavigation() {\n // clean hammer bindings\n if (this.navigationHammers.length != 0) {\n for (let i = 0; i < this.navigationHammers.length; i++) {\n this.navigationHammers[i].destroy();\n }\n this.navigationHammers = [];\n }\n\n // clean up previous navigation items\n if (\n this.navigationDOM &&\n this.navigationDOM[\"wrapper\"] &&\n this.navigationDOM[\"wrapper\"].parentNode\n ) {\n this.navigationDOM[\"wrapper\"].parentNode.removeChild(\n this.navigationDOM[\"wrapper\"]\n );\n }\n\n this.iconsCreated = false;\n }\n\n /**\n * Creation of the navigation controls nodes. They are drawn over the rest of the nodes and are not affected by scale and translation\n * they have a triggerFunction which is called on click. If the position of the navigation controls is dependent\n * on this.frame.canvas.clientWidth or this.frame.canvas.clientHeight, we flag horizontalAlignLeft and verticalAlignTop false.\n * This means that the location will be corrected by the _relocateNavigation function on a size change of the canvas.\n *\n * @private\n */\n loadNavigationElements() {\n this.cleanNavigation();\n\n this.navigationDOM = {};\n const navigationDivs = [\n \"up\",\n \"down\",\n \"left\",\n \"right\",\n \"zoomIn\",\n \"zoomOut\",\n \"zoomExtends\",\n ];\n const navigationDivActions = [\n \"_moveUp\",\n \"_moveDown\",\n \"_moveLeft\",\n \"_moveRight\",\n \"_zoomIn\",\n \"_zoomOut\",\n \"_fit\",\n ];\n\n this.navigationDOM[\"wrapper\"] = document.createElement(\"div\");\n this.navigationDOM[\"wrapper\"].className = \"vis-navigation\";\n this.canvas.frame.appendChild(this.navigationDOM[\"wrapper\"]);\n\n for (let i = 0; i < navigationDivs.length; i++) {\n this.navigationDOM[navigationDivs[i]] = document.createElement(\"div\");\n this.navigationDOM[navigationDivs[i]].className =\n \"vis-button vis-\" + navigationDivs[i];\n this.navigationDOM[\"wrapper\"].appendChild(\n this.navigationDOM[navigationDivs[i]]\n );\n\n const hammer = new Hammer(this.navigationDOM[navigationDivs[i]]);\n if (navigationDivActions[i] === \"_fit\") {\n onTouch(hammer, this._fit.bind(this));\n } else {\n onTouch(hammer, this.bindToRedraw.bind(this, navigationDivActions[i]));\n }\n\n this.navigationHammers.push(hammer);\n }\n\n // use a hammer for the release so we do not require the one used in the rest of the network\n // the one the rest uses can be overloaded by the manipulation system.\n const hammerFrame = new Hammer(this.canvas.frame);\n onRelease(hammerFrame, () => {\n this._stopMovement();\n });\n this.navigationHammers.push(hammerFrame);\n\n this.iconsCreated = true;\n }\n\n /**\n *\n * @param {string} action\n */\n bindToRedraw(action) {\n if (this.boundFunctions[action] === undefined) {\n this.boundFunctions[action] = this[action].bind(this);\n this.body.emitter.on(\"initRedraw\", this.boundFunctions[action]);\n this.body.emitter.emit(\"_startRendering\");\n }\n }\n\n /**\n *\n * @param {string} action\n */\n unbindFromRedraw(action) {\n if (this.boundFunctions[action] !== undefined) {\n this.body.emitter.off(\"initRedraw\", this.boundFunctions[action]);\n this.body.emitter.emit(\"_stopRendering\");\n delete this.boundFunctions[action];\n }\n }\n\n /**\n * this stops all movement induced by the navigation buttons\n *\n * @private\n */\n _fit() {\n if (new Date().valueOf() - this.touchTime > 700) {\n // TODO: fix ugly hack to avoid hammer's double fireing of event (because we use release?)\n this.body.emitter.emit(\"fit\", { duration: 700 });\n this.touchTime = new Date().valueOf();\n }\n }\n\n /**\n * this stops all movement induced by the navigation buttons\n *\n * @private\n */\n _stopMovement() {\n for (const boundAction in this.boundFunctions) {\n if (\n Object.prototype.hasOwnProperty.call(this.boundFunctions, boundAction)\n ) {\n this.body.emitter.off(\"initRedraw\", this.boundFunctions[boundAction]);\n this.body.emitter.emit(\"_stopRendering\");\n }\n }\n this.boundFunctions = {};\n }\n /**\n *\n * @private\n */\n _moveUp() {\n this.body.view.translation.y += this.options.keyboard.speed.y;\n }\n /**\n *\n * @private\n */\n _moveDown() {\n this.body.view.translation.y -= this.options.keyboard.speed.y;\n }\n /**\n *\n * @private\n */\n _moveLeft() {\n this.body.view.translation.x += this.options.keyboard.speed.x;\n }\n /**\n *\n * @private\n */\n _moveRight() {\n this.body.view.translation.x -= this.options.keyboard.speed.x;\n }\n /**\n *\n * @private\n */\n _zoomIn() {\n const scaleOld = this.body.view.scale;\n const scale = this.body.view.scale * (1 + this.options.keyboard.speed.zoom);\n const translation = this.body.view.translation;\n const scaleFrac = scale / scaleOld;\n const tx =\n (1 - scaleFrac) * this.canvas.canvasViewCenter.x +\n translation.x * scaleFrac;\n const ty =\n (1 - scaleFrac) * this.canvas.canvasViewCenter.y +\n translation.y * scaleFrac;\n\n this.body.view.scale = scale;\n this.body.view.translation = { x: tx, y: ty };\n this.body.emitter.emit(\"zoom\", {\n direction: \"+\",\n scale: this.body.view.scale,\n pointer: null,\n });\n }\n\n /**\n *\n * @private\n */\n _zoomOut() {\n const scaleOld = this.body.view.scale;\n const scale = this.body.view.scale / (1 + this.options.keyboard.speed.zoom);\n const translation = this.body.view.translation;\n const scaleFrac = scale / scaleOld;\n const tx =\n (1 - scaleFrac) * this.canvas.canvasViewCenter.x +\n translation.x * scaleFrac;\n const ty =\n (1 - scaleFrac) * this.canvas.canvasViewCenter.y +\n translation.y * scaleFrac;\n\n this.body.view.scale = scale;\n this.body.view.translation = { x: tx, y: ty };\n this.body.emitter.emit(\"zoom\", {\n direction: \"-\",\n scale: this.body.view.scale,\n pointer: null,\n });\n }\n\n /**\n * bind all keys using keycharm.\n */\n configureKeyboardBindings() {\n if (this.keycharm !== undefined) {\n this.keycharm.destroy();\n }\n\n if (this.options.keyboard.enabled === true) {\n if (this.options.keyboard.bindToWindow === true) {\n this.keycharm = keycharm({ container: window, preventDefault: true });\n } else {\n this.keycharm = keycharm({\n container: this.canvas.frame,\n preventDefault: true,\n });\n }\n\n this.keycharm.reset();\n\n if (this.activated === true) {\n this.keycharm.bind(\n \"up\",\n () => {\n this.bindToRedraw(\"_moveUp\");\n },\n \"keydown\"\n );\n this.keycharm.bind(\n \"down\",\n () => {\n this.bindToRedraw(\"_moveDown\");\n },\n \"keydown\"\n );\n this.keycharm.bind(\n \"left\",\n () => {\n this.bindToRedraw(\"_moveLeft\");\n },\n \"keydown\"\n );\n this.keycharm.bind(\n \"right\",\n () => {\n this.bindToRedraw(\"_moveRight\");\n },\n \"keydown\"\n );\n this.keycharm.bind(\n \"=\",\n () => {\n this.bindToRedraw(\"_zoomIn\");\n },\n \"keydown\"\n );\n this.keycharm.bind(\n \"num+\",\n () => {\n this.bindToRedraw(\"_zoomIn\");\n },\n \"keydown\"\n );\n this.keycharm.bind(\n \"num-\",\n () => {\n this.bindToRedraw(\"_zoomOut\");\n },\n \"keydown\"\n );\n this.keycharm.bind(\n \"-\",\n () => {\n this.bindToRedraw(\"_zoomOut\");\n },\n \"keydown\"\n );\n this.keycharm.bind(\n \"[\",\n () => {\n this.bindToRedraw(\"_zoomOut\");\n },\n \"keydown\"\n );\n this.keycharm.bind(\n \"]\",\n () => {\n this.bindToRedraw(\"_zoomIn\");\n },\n \"keydown\"\n );\n this.keycharm.bind(\n \"pageup\",\n () => {\n this.bindToRedraw(\"_zoomIn\");\n },\n \"keydown\"\n );\n this.keycharm.bind(\n \"pagedown\",\n () => {\n this.bindToRedraw(\"_zoomOut\");\n },\n \"keydown\"\n );\n\n this.keycharm.bind(\n \"up\",\n () => {\n this.unbindFromRedraw(\"_moveUp\");\n },\n \"keyup\"\n );\n this.keycharm.bind(\n \"down\",\n () => {\n this.unbindFromRedraw(\"_moveDown\");\n },\n \"keyup\"\n );\n this.keycharm.bind(\n \"left\",\n () => {\n this.unbindFromRedraw(\"_moveLeft\");\n },\n \"keyup\"\n );\n this.keycharm.bind(\n \"right\",\n () => {\n this.unbindFromRedraw(\"_moveRight\");\n },\n \"keyup\"\n );\n this.keycharm.bind(\n \"=\",\n () => {\n this.unbindFromRedraw(\"_zoomIn\");\n },\n \"keyup\"\n );\n this.keycharm.bind(\n \"num+\",\n () => {\n this.unbindFromRedraw(\"_zoomIn\");\n },\n \"keyup\"\n );\n this.keycharm.bind(\n \"num-\",\n () => {\n this.unbindFromRedraw(\"_zoomOut\");\n },\n \"keyup\"\n );\n this.keycharm.bind(\n \"-\",\n () => {\n this.unbindFromRedraw(\"_zoomOut\");\n },\n \"keyup\"\n );\n this.keycharm.bind(\n \"[\",\n () => {\n this.unbindFromRedraw(\"_zoomOut\");\n },\n \"keyup\"\n );\n this.keycharm.bind(\n \"]\",\n () => {\n this.unbindFromRedraw(\"_zoomIn\");\n },\n \"keyup\"\n );\n this.keycharm.bind(\n \"pageup\",\n () => {\n this.unbindFromRedraw(\"_zoomIn\");\n },\n \"keyup\"\n );\n this.keycharm.bind(\n \"pagedown\",\n () => {\n this.unbindFromRedraw(\"_zoomOut\");\n },\n \"keyup\"\n );\n }\n }\n }\n}\n\nexport default NavigationHandler;\n","import {\n Popup,\n getAbsoluteLeft,\n getAbsoluteTop,\n mergeOptions,\n parseColor,\n selectiveNotDeepExtend,\n} from \"vis-util/esnext\";\nimport NavigationHandler from \"./components/NavigationHandler\";\n\n/**\n * Handler for interactions\n */\nclass InteractionHandler {\n /**\n * @param {object} body\n * @param {Canvas} canvas\n * @param {SelectionHandler} selectionHandler\n */\n constructor(body, canvas, selectionHandler) {\n this.body = body;\n this.canvas = canvas;\n this.selectionHandler = selectionHandler;\n this.navigationHandler = new NavigationHandler(body, canvas);\n\n // bind the events from hammer to functions in this object\n this.body.eventListeners.onTap = this.onTap.bind(this);\n this.body.eventListeners.onTouch = this.onTouch.bind(this);\n this.body.eventListeners.onDoubleTap = this.onDoubleTap.bind(this);\n this.body.eventListeners.onHold = this.onHold.bind(this);\n this.body.eventListeners.onDragStart = this.onDragStart.bind(this);\n this.body.eventListeners.onDrag = this.onDrag.bind(this);\n this.body.eventListeners.onDragEnd = this.onDragEnd.bind(this);\n this.body.eventListeners.onMouseWheel = this.onMouseWheel.bind(this);\n this.body.eventListeners.onPinch = this.onPinch.bind(this);\n this.body.eventListeners.onMouseMove = this.onMouseMove.bind(this);\n this.body.eventListeners.onRelease = this.onRelease.bind(this);\n this.body.eventListeners.onContext = this.onContext.bind(this);\n\n this.touchTime = 0;\n this.drag = {};\n this.pinch = {};\n this.popup = undefined;\n this.popupObj = undefined;\n this.popupTimer = undefined;\n\n this.body.functions.getPointer = this.getPointer.bind(this);\n\n this.options = {};\n this.defaultOptions = {\n dragNodes: true,\n dragView: true,\n hover: false,\n keyboard: {\n enabled: false,\n speed: { x: 10, y: 10, zoom: 0.02 },\n bindToWindow: true,\n autoFocus: true,\n },\n navigationButtons: false,\n tooltipDelay: 300,\n zoomView: true,\n zoomSpeed: 1,\n };\n Object.assign(this.options, this.defaultOptions);\n\n this.bindEventListeners();\n }\n\n /**\n * Binds event listeners\n */\n bindEventListeners() {\n this.body.emitter.on(\"destroy\", () => {\n clearTimeout(this.popupTimer);\n delete this.body.functions.getPointer;\n });\n }\n\n /**\n *\n * @param {object} options\n */\n setOptions(options) {\n if (options !== undefined) {\n // extend all but the values in fields\n const fields = [\n \"hideEdgesOnDrag\",\n \"hideEdgesOnZoom\",\n \"hideNodesOnDrag\",\n \"keyboard\",\n \"multiselect\",\n \"selectable\",\n \"selectConnectedEdges\",\n ];\n selectiveNotDeepExtend(fields, this.options, options);\n\n // merge the keyboard options in.\n mergeOptions(this.options, options, \"keyboard\");\n\n if (options.tooltip) {\n Object.assign(this.options.tooltip, options.tooltip);\n if (options.tooltip.color) {\n this.options.tooltip.color = parseColor(options.tooltip.color);\n }\n }\n }\n\n this.navigationHandler.setOptions(this.options);\n }\n\n /**\n * Get the pointer location from a touch location\n *\n * @param {{x: number, y: number}} touch\n * @returns {{x: number, y: number}} pointer\n * @private\n */\n getPointer(touch) {\n return {\n x: touch.x - getAbsoluteLeft(this.canvas.frame.canvas),\n y: touch.y - getAbsoluteTop(this.canvas.frame.canvas),\n };\n }\n\n /**\n * On start of a touch gesture, store the pointer\n *\n * @param {Event} event The event\n * @private\n */\n onTouch(event) {\n if (new Date().valueOf() - this.touchTime > 50) {\n this.drag.pointer = this.getPointer(event.center);\n this.drag.pinched = false;\n this.pinch.scale = this.body.view.scale;\n // to avoid double fireing of this event because we have two hammer instances. (on canvas and on frame)\n this.touchTime = new Date().valueOf();\n }\n }\n\n /**\n * handle tap/click event: select/unselect a node\n *\n * @param {Event} event\n * @private\n */\n onTap(event) {\n const pointer = this.getPointer(event.center);\n const multiselect =\n this.selectionHandler.options.multiselect &&\n (event.changedPointers[0].ctrlKey || event.changedPointers[0].metaKey);\n\n this.checkSelectionChanges(pointer, multiselect);\n\n this.selectionHandler.commitAndEmit(pointer, event);\n this.selectionHandler.generateClickEvent(\"click\", event, pointer);\n }\n\n /**\n * handle doubletap event\n *\n * @param {Event} event\n * @private\n */\n onDoubleTap(event) {\n const pointer = this.getPointer(event.center);\n this.selectionHandler.generateClickEvent(\"doubleClick\", event, pointer);\n }\n\n /**\n * handle long tap event: multi select nodes\n *\n * @param {Event} event\n * @private\n */\n onHold(event) {\n const pointer = this.getPointer(event.center);\n const multiselect = this.selectionHandler.options.multiselect;\n\n this.checkSelectionChanges(pointer, multiselect);\n\n this.selectionHandler.commitAndEmit(pointer, event);\n this.selectionHandler.generateClickEvent(\"click\", event, pointer);\n this.selectionHandler.generateClickEvent(\"hold\", event, pointer);\n }\n\n /**\n * handle the release of the screen\n *\n * @param {Event} event\n * @private\n */\n onRelease(event) {\n if (new Date().valueOf() - this.touchTime > 10) {\n const pointer = this.getPointer(event.center);\n this.selectionHandler.generateClickEvent(\"release\", event, pointer);\n // to avoid double fireing of this event because we have two hammer instances. (on canvas and on frame)\n this.touchTime = new Date().valueOf();\n }\n }\n\n /**\n *\n * @param {Event} event\n */\n onContext(event) {\n const pointer = this.getPointer({ x: event.clientX, y: event.clientY });\n this.selectionHandler.generateClickEvent(\"oncontext\", event, pointer);\n }\n\n /**\n * Select and deselect nodes depending current selection change.\n *\n * @param {{x: number, y: number}} pointer\n * @param {boolean} [add=false]\n */\n checkSelectionChanges(pointer, add = false) {\n if (add === true) {\n this.selectionHandler.selectAdditionalOnPoint(pointer);\n } else {\n this.selectionHandler.selectOnPoint(pointer);\n }\n }\n\n /**\n * Remove all node and edge id's from the first set that are present in the second one.\n *\n * @param {{nodes: Array.<Node>, edges: Array.<vis.Edge>}} firstSet\n * @param {{nodes: Array.<Node>, edges: Array.<vis.Edge>}} secondSet\n * @returns {{nodes: Array.<Node>, edges: Array.<vis.Edge>}}\n * @private\n */\n _determineDifference(firstSet, secondSet) {\n const arrayDiff = function (firstArr, secondArr) {\n const result = [];\n\n for (let i = 0; i < firstArr.length; i++) {\n const value = firstArr[i];\n if (secondArr.indexOf(value) === -1) {\n result.push(value);\n }\n }\n\n return result;\n };\n\n return {\n nodes: arrayDiff(firstSet.nodes, secondSet.nodes),\n edges: arrayDiff(firstSet.edges, secondSet.edges),\n };\n }\n\n /**\n * This function is called by onDragStart.\n * It is separated out because we can then overload it for the datamanipulation system.\n *\n * @param {Event} event\n * @private\n */\n onDragStart(event) {\n // if already dragging, do not start\n // this can happen on touch screens with multiple fingers\n if (this.drag.dragging) {\n return;\n }\n\n //in case the touch event was triggered on an external div, do the initial touch now.\n if (this.drag.pointer === undefined) {\n this.onTouch(event);\n }\n\n // note: drag.pointer is set in onTouch to get the initial touch location\n const node = this.selectionHandler.getNodeAt(this.drag.pointer);\n\n this.drag.dragging = true;\n this.drag.selection = [];\n this.drag.translation = Object.assign({}, this.body.view.translation); // copy the object\n this.drag.nodeId = undefined;\n\n if (event.srcEvent.shiftKey) {\n this.body.selectionBox.show = true;\n const pointer = this.getPointer(event.center);\n\n this.body.selectionBox.position.start = {\n x: this.canvas._XconvertDOMtoCanvas(pointer.x),\n y: this.canvas._YconvertDOMtoCanvas(pointer.y),\n };\n this.body.selectionBox.position.end = {\n x: this.canvas._XconvertDOMtoCanvas(pointer.x),\n y: this.canvas._YconvertDOMtoCanvas(pointer.y),\n };\n }\n\n if (node !== undefined && this.options.dragNodes === true) {\n this.drag.nodeId = node.id;\n // select the clicked node if not yet selected\n if (node.isSelected() === false) {\n this.selectionHandler.unselectAll();\n this.selectionHandler.selectObject(node);\n }\n\n // after select to contain the node\n this.selectionHandler.generateClickEvent(\n \"dragStart\",\n event,\n this.drag.pointer\n );\n\n // create an array with the selected nodes and their original location and status\n for (const node of this.selectionHandler.getSelectedNodes()) {\n const s = {\n id: node.id,\n node: node,\n\n // store original x, y, xFixed and yFixed, make the node temporarily Fixed\n x: node.x,\n y: node.y,\n xFixed: node.options.fixed.x,\n yFixed: node.options.fixed.y,\n };\n\n node.options.fixed.x = true;\n node.options.fixed.y = true;\n\n this.drag.selection.push(s);\n }\n } else {\n // fallback if no node is selected and thus the view is dragged.\n this.selectionHandler.generateClickEvent(\n \"dragStart\",\n event,\n this.drag.pointer,\n undefined,\n true\n );\n }\n }\n\n /**\n * handle drag event\n *\n * @param {Event} event\n * @private\n */\n onDrag(event) {\n if (this.drag.pinched === true) {\n return;\n }\n\n // remove the focus on node if it is focussed on by the focusOnNode\n this.body.emitter.emit(\"unlockNode\");\n\n const pointer = this.getPointer(event.center);\n\n const selection = this.drag.selection;\n if (selection && selection.length && this.options.dragNodes === true) {\n this.selectionHandler.generateClickEvent(\"dragging\", event, pointer);\n\n // calculate delta's and new location\n const deltaX = pointer.x - this.drag.pointer.x;\n const deltaY = pointer.y - this.drag.pointer.y;\n\n // update position of all selected nodes\n selection.forEach((selection) => {\n const node = selection.node;\n // only move the node if it was not fixed initially\n if (selection.xFixed === false) {\n node.x = this.canvas._XconvertDOMtoCanvas(\n this.canvas._XconvertCanvasToDOM(selection.x) + deltaX\n );\n }\n // only move the node if it was not fixed initially\n if (selection.yFixed === false) {\n node.y = this.canvas._YconvertDOMtoCanvas(\n this.canvas._YconvertCanvasToDOM(selection.y) + deltaY\n );\n }\n });\n\n // start the simulation of the physics\n this.body.emitter.emit(\"startSimulation\");\n } else {\n // create selection box\n if (event.srcEvent.shiftKey) {\n this.selectionHandler.generateClickEvent(\n \"dragging\",\n event,\n pointer,\n undefined,\n true\n );\n\n // if the drag was not started properly because the click started outside the network div, start it now.\n if (this.drag.pointer === undefined) {\n this.onDragStart(event);\n return;\n }\n\n this.body.selectionBox.position.end = {\n x: this.canvas._XconvertDOMtoCanvas(pointer.x),\n y: this.canvas._YconvertDOMtoCanvas(pointer.y),\n };\n this.body.emitter.emit(\"_requestRedraw\");\n }\n\n // move the network\n if (this.options.dragView === true && !event.srcEvent.shiftKey) {\n this.selectionHandler.generateClickEvent(\n \"dragging\",\n event,\n pointer,\n undefined,\n true\n );\n\n // if the drag was not started properly because the click started outside the network div, start it now.\n if (this.drag.pointer === undefined) {\n this.onDragStart(event);\n return;\n }\n\n const diffX = pointer.x - this.drag.pointer.x;\n const diffY = pointer.y - this.drag.pointer.y;\n\n this.body.view.translation = {\n x: this.drag.translation.x + diffX,\n y: this.drag.translation.y + diffY,\n };\n this.body.emitter.emit(\"_requestRedraw\");\n }\n }\n }\n\n /**\n * handle drag start event\n *\n * @param {Event} event\n * @private\n */\n onDragEnd(event) {\n this.drag.dragging = false;\n\n if (this.body.selectionBox.show) {\n this.body.selectionBox.show = false;\n const selectionBoxPosition = this.body.selectionBox.position;\n const selectionBoxPositionMinMax = {\n minX: Math.min(\n selectionBoxPosition.start.x,\n selectionBoxPosition.end.x\n ),\n minY: Math.min(\n selectionBoxPosition.start.y,\n selectionBoxPosition.end.y\n ),\n maxX: Math.max(\n selectionBoxPosition.start.x,\n selectionBoxPosition.end.x\n ),\n maxY: Math.max(\n selectionBoxPosition.start.y,\n selectionBoxPosition.end.y\n ),\n };\n\n const toBeSelectedNodes = this.body.nodeIndices.filter((nodeId) => {\n const node = this.body.nodes[nodeId];\n return (\n node.x >= selectionBoxPositionMinMax.minX &&\n node.x <= selectionBoxPositionMinMax.maxX &&\n node.y >= selectionBoxPositionMinMax.minY &&\n node.y <= selectionBoxPositionMinMax.maxY\n );\n });\n\n toBeSelectedNodes.forEach((nodeId) =>\n this.selectionHandler.selectObject(this.body.nodes[nodeId])\n );\n\n const pointer = this.getPointer(event.center);\n this.selectionHandler.commitAndEmit(pointer, event);\n this.selectionHandler.generateClickEvent(\n \"dragEnd\",\n event,\n this.getPointer(event.center),\n undefined,\n true\n );\n this.body.emitter.emit(\"_requestRedraw\");\n } else {\n const selection = this.drag.selection;\n if (selection && selection.length) {\n selection.forEach(function (s) {\n // restore original xFixed and yFixed\n s.node.options.fixed.x = s.xFixed;\n s.node.options.fixed.y = s.yFixed;\n });\n this.selectionHandler.generateClickEvent(\n \"dragEnd\",\n event,\n this.getPointer(event.center)\n );\n this.body.emitter.emit(\"startSimulation\");\n } else {\n this.selectionHandler.generateClickEvent(\n \"dragEnd\",\n event,\n this.getPointer(event.center),\n undefined,\n true\n );\n this.body.emitter.emit(\"_requestRedraw\");\n }\n }\n }\n\n /**\n * Handle pinch event\n *\n * @param {Event} event The event\n * @private\n */\n onPinch(event) {\n const pointer = this.getPointer(event.center);\n\n this.drag.pinched = true;\n if (this.pinch[\"scale\"] === undefined) {\n this.pinch.scale = 1;\n }\n\n // TODO: enabled moving while pinching?\n const scale = this.pinch.scale * event.scale;\n this.zoom(scale, pointer);\n }\n\n /**\n * Zoom the network in or out\n *\n * @param {number} scale a number around 1, and between 0.01 and 10\n * @param {{x: number, y: number}} pointer Position on screen\n * @private\n */\n zoom(scale, pointer) {\n if (this.options.zoomView === true) {\n const scaleOld = this.body.view.scale;\n if (scale < 0.00001) {\n scale = 0.00001;\n }\n if (scale > 10) {\n scale = 10;\n }\n\n let preScaleDragPointer = undefined;\n if (this.drag !== undefined) {\n if (this.drag.dragging === true) {\n preScaleDragPointer = this.canvas.DOMtoCanvas(this.drag.pointer);\n }\n }\n // + this.canvas.frame.canvas.clientHeight / 2\n const translation = this.body.view.translation;\n\n const scaleFrac = scale / scaleOld;\n const tx = (1 - scaleFrac) * pointer.x + translation.x * scaleFrac;\n const ty = (1 - scaleFrac) * pointer.y + translation.y * scaleFrac;\n\n this.body.view.scale = scale;\n this.body.view.translation = { x: tx, y: ty };\n\n if (preScaleDragPointer != undefined) {\n const postScaleDragPointer =\n this.canvas.canvasToDOM(preScaleDragPointer);\n this.drag.pointer.x = postScaleDragPointer.x;\n this.drag.pointer.y = postScaleDragPointer.y;\n }\n\n this.body.emitter.emit(\"_requestRedraw\");\n\n if (scaleOld < scale) {\n this.body.emitter.emit(\"zoom\", {\n direction: \"+\",\n scale: this.body.view.scale,\n pointer: pointer,\n });\n } else {\n this.body.emitter.emit(\"zoom\", {\n direction: \"-\",\n scale: this.body.view.scale,\n pointer: pointer,\n });\n }\n }\n }\n\n /**\n * Event handler for mouse wheel event, used to zoom the timeline\n * See http://adomas.org/javascript-mouse-wheel/\n * https://github.com/EightMedia/hammer.js/issues/256\n *\n * @param {MouseEvent} event\n * @private\n */\n onMouseWheel(event) {\n if (this.options.zoomView === true) {\n // If delta is nonzero, handle it.\n // Basically, delta is now positive if wheel was scrolled up,\n // and negative, if wheel was scrolled down.\n if (event.deltaY !== 0) {\n // calculate the new scale\n let scale = this.body.view.scale;\n scale *=\n 1 + (event.deltaY < 0 ? 1 : -1) * (this.options.zoomSpeed * 0.1);\n\n // calculate the pointer location\n const pointer = this.getPointer({ x: event.clientX, y: event.clientY });\n\n // apply the new scale\n this.zoom(scale, pointer);\n }\n\n // Prevent default actions caused by mouse wheel.\n event.preventDefault();\n }\n }\n\n /**\n * Mouse move handler for checking whether the title moves over a node with a title.\n *\n * @param {Event} event\n * @private\n */\n onMouseMove(event) {\n const pointer = this.getPointer({ x: event.clientX, y: event.clientY });\n let popupVisible = false;\n\n // check if the previously selected node is still selected\n if (this.popup !== undefined) {\n if (this.popup.hidden === false) {\n this._checkHidePopup(pointer);\n }\n\n // if the popup was not hidden above\n if (this.popup.hidden === false) {\n popupVisible = true;\n this.popup.setPosition(pointer.x + 3, pointer.y - 5);\n this.popup.show();\n }\n }\n\n // if we bind the keyboard to the div, we have to highlight it to use it. This highlights it on mouse over.\n if (\n this.options.keyboard.autoFocus &&\n this.options.keyboard.bindToWindow === false &&\n this.options.keyboard.enabled === true\n ) {\n this.canvas.frame.focus();\n }\n\n // start a timeout that will check if the mouse is positioned above an element\n if (popupVisible === false) {\n if (this.popupTimer !== undefined) {\n clearInterval(this.popupTimer); // stop any running calculationTimer\n this.popupTimer = undefined;\n }\n if (!this.drag.dragging) {\n this.popupTimer = setTimeout(\n () => this._checkShowPopup(pointer),\n this.options.tooltipDelay\n );\n }\n }\n\n // adding hover highlights\n if (this.options.hover === true) {\n this.selectionHandler.hoverObject(event, pointer);\n }\n }\n\n /**\n * Check if there is an element on the given position in the network\n * (a node or edge). If so, and if this element has a title,\n * show a popup window with its title.\n *\n * @param {{x:number, y:number}} pointer\n * @private\n */\n _checkShowPopup(pointer) {\n const x = this.canvas._XconvertDOMtoCanvas(pointer.x);\n const y = this.canvas._YconvertDOMtoCanvas(pointer.y);\n const pointerObj = {\n left: x,\n top: y,\n right: x,\n bottom: y,\n };\n\n const previousPopupObjId =\n this.popupObj === undefined ? undefined : this.popupObj.id;\n let nodeUnderCursor = false;\n let popupType = \"node\";\n\n // check if a node is under the cursor.\n if (this.popupObj === undefined) {\n // search the nodes for overlap, select the top one in case of multiple nodes\n const nodeIndices = this.body.nodeIndices;\n const nodes = this.body.nodes;\n let node;\n const overlappingNodes = [];\n for (let i = 0; i < nodeIndices.length; i++) {\n node = nodes[nodeIndices[i]];\n if (node.isOverlappingWith(pointerObj) === true) {\n nodeUnderCursor = true;\n if (node.getTitle() !== undefined) {\n overlappingNodes.push(nodeIndices[i]);\n }\n }\n }\n\n if (overlappingNodes.length > 0) {\n // if there are overlapping nodes, select the last one, this is the one which is drawn on top of the others\n this.popupObj = nodes[overlappingNodes[overlappingNodes.length - 1]];\n // if you hover over a node, the title of the edge is not supposed to be shown.\n nodeUnderCursor = true;\n }\n }\n\n if (this.popupObj === undefined && nodeUnderCursor === false) {\n // search the edges for overlap\n const edgeIndices = this.body.edgeIndices;\n const edges = this.body.edges;\n let edge;\n const overlappingEdges = [];\n for (let i = 0; i < edgeIndices.length; i++) {\n edge = edges[edgeIndices[i]];\n if (edge.isOverlappingWith(pointerObj) === true) {\n if (edge.connected === true && edge.getTitle() !== undefined) {\n overlappingEdges.push(edgeIndices[i]);\n }\n }\n }\n\n if (overlappingEdges.length > 0) {\n this.popupObj = edges[overlappingEdges[overlappingEdges.length - 1]];\n popupType = \"edge\";\n }\n }\n\n if (this.popupObj !== undefined) {\n // show popup message window\n if (this.popupObj.id !== previousPopupObjId) {\n if (this.popup === undefined) {\n this.popup = new Popup(this.canvas.frame);\n }\n\n this.popup.popupTargetType = popupType;\n this.popup.popupTargetId = this.popupObj.id;\n\n // adjust a small offset such that the mouse cursor is located in the\n // bottom left location of the popup, and you can easily move over the\n // popup area\n this.popup.setPosition(pointer.x + 3, pointer.y - 5);\n this.popup.setText(this.popupObj.getTitle());\n this.popup.show();\n this.body.emitter.emit(\"showPopup\", this.popupObj.id);\n }\n } else {\n if (this.popup !== undefined) {\n this.popup.hide();\n this.body.emitter.emit(\"hidePopup\");\n }\n }\n }\n\n /**\n * Check if the popup must be hidden, which is the case when the mouse is no\n * longer hovering on the object\n *\n * @param {{x:number, y:number}} pointer\n * @private\n */\n _checkHidePopup(pointer) {\n const pointerObj = this.selectionHandler._pointerToPositionObject(pointer);\n\n let stillOnObj = false;\n if (this.popup.popupTargetType === \"node\") {\n if (this.body.nodes[this.popup.popupTargetId] !== undefined) {\n stillOnObj =\n this.body.nodes[this.popup.popupTargetId].isOverlappingWith(\n pointerObj\n );\n\n // if the mouse is still one the node, we have to check if it is not also on one that is drawn on top of it.\n // we initially only check stillOnObj because this is much faster.\n if (stillOnObj === true) {\n const overNode = this.selectionHandler.getNodeAt(pointer);\n stillOnObj =\n overNode === undefined\n ? false\n : overNode.id === this.popup.popupTargetId;\n }\n }\n } else {\n if (this.selectionHandler.getNodeAt(pointer) === undefined) {\n if (this.body.edges[this.popup.popupTargetId] !== undefined) {\n stillOnObj =\n this.body.edges[this.popup.popupTargetId].isOverlappingWith(\n pointerObj\n );\n }\n }\n }\n\n if (stillOnObj === false) {\n this.popupObj = undefined;\n this.popup.hide();\n this.body.emitter.emit(\"hidePopup\");\n }\n }\n}\n\nexport default InteractionHandler;\n","'use strict';\nvar redefineAll = require('../internals/redefine-all');\nvar getWeakData = require('../internals/internal-metadata').getWeakData;\nvar anObject = require('../internals/an-object');\nvar isObject = require('../internals/is-object');\nvar anInstance = require('../internals/an-instance');\nvar iterate = require('../internals/iterate');\nvar ArrayIterationModule = require('../internals/array-iteration');\nvar $has = require('../internals/has');\nvar InternalStateModule = require('../internals/internal-state');\n\nvar setInternalState = InternalStateModule.set;\nvar internalStateGetterFor = InternalStateModule.getterFor;\nvar find = ArrayIterationModule.find;\nvar findIndex = ArrayIterationModule.findIndex;\nvar id = 0;\n\n// fallback for uncaught frozen keys\nvar uncaughtFrozenStore = function (store) {\n return store.frozen || (store.frozen = new UncaughtFrozenStore());\n};\n\nvar UncaughtFrozenStore = function () {\n this.entries = [];\n};\n\nvar findUncaughtFrozen = function (store, key) {\n return find(store.entries, function (it) {\n return it[0] === key;\n });\n};\n\nUncaughtFrozenStore.prototype = {\n get: function (key) {\n var entry = findUncaughtFrozen(this, key);\n if (entry) return entry[1];\n },\n has: function (key) {\n return !!findUncaughtFrozen(this, key);\n },\n set: function (key, value) {\n var entry = findUncaughtFrozen(this, key);\n if (entry) entry[1] = value;\n else this.entries.push([key, value]);\n },\n 'delete': function (key) {\n var index = findIndex(this.entries, function (it) {\n return it[0] === key;\n });\n if (~index) this.entries.splice(index, 1);\n return !!~index;\n }\n};\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 id: id++,\n frozen: undefined\n });\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 data = getWeakData(anObject(key), true);\n if (data === true) uncaughtFrozenStore(state).set(key, value);\n else data[state.id] = value;\n return that;\n };\n\n redefineAll(C.prototype, {\n // `{ WeakMap, WeakSet }.prototype.delete(key)` methods\n // https://tc39.es/ecma262/#sec-weakmap.prototype.delete\n // https://tc39.es/ecma262/#sec-weakset.prototype.delete\n 'delete': function (key) {\n var state = getInternalState(this);\n if (!isObject(key)) return false;\n var data = getWeakData(key);\n if (data === true) return uncaughtFrozenStore(state)['delete'](key);\n return data && $has(data, state.id) && delete data[state.id];\n },\n // `{ WeakMap, WeakSet }.prototype.has(key)` methods\n // https://tc39.es/ecma262/#sec-weakmap.prototype.has\n // https://tc39.es/ecma262/#sec-weakset.prototype.has\n has: function has(key) {\n var state = getInternalState(this);\n if (!isObject(key)) return false;\n var data = getWeakData(key);\n if (data === true) return uncaughtFrozenStore(state).has(key);\n return data && $has(data, state.id);\n }\n });\n\n redefineAll(C.prototype, IS_MAP ? {\n // `WeakMap.prototype.get(key)` method\n // https://tc39.es/ecma262/#sec-weakmap.prototype.get\n get: function get(key) {\n var state = getInternalState(this);\n if (isObject(key)) {\n var data = getWeakData(key);\n if (data === true) return uncaughtFrozenStore(state).get(key);\n return data ? data[state.id] : undefined;\n }\n },\n // `WeakMap.prototype.set(key, value)` method\n // https://tc39.es/ecma262/#sec-weakmap.prototype.set\n set: function set(key, value) {\n return define(this, key, value);\n }\n } : {\n // `WeakSet.prototype.add(value)` method\n // https://tc39.es/ecma262/#sec-weakset.prototype.add\n add: function add(value) {\n return define(this, value, true);\n }\n });\n\n return C;\n }\n};\n","'use strict';\nvar global = require('../internals/global');\nvar redefineAll = require('../internals/redefine-all');\nvar InternalMetadataModule = require('../internals/internal-metadata');\nvar collection = require('../internals/collection');\nvar collectionWeak = require('../internals/collection-weak');\nvar isObject = require('../internals/is-object');\nvar enforceIternalState = require('../internals/internal-state').enforce;\nvar NATIVE_WEAK_MAP = require('../internals/native-weak-map');\n\nvar IS_IE11 = !global.ActiveXObject && 'ActiveXObject' in global;\n// eslint-disable-next-line es/no-object-isextensible -- safe\nvar isExtensible = Object.isExtensible;\nvar InternalWeakMap;\n\nvar wrapper = function (init) {\n return function WeakMap() {\n return init(this, arguments.length ? arguments[0] : undefined);\n };\n};\n\n// `WeakMap` constructor\n// https://tc39.es/ecma262/#sec-weakmap-constructor\nvar $WeakMap = module.exports = collection('WeakMap', wrapper, collectionWeak);\n\n// IE11 WeakMap frozen keys fix\n// We can't use feature detection because it crash some old IE builds\n// https://github.com/zloirock/core-js/issues/485\nif (NATIVE_WEAK_MAP && IS_IE11) {\n InternalWeakMap = collectionWeak.getConstructor(wrapper, 'WeakMap', true);\n InternalMetadataModule.enable();\n var WeakMapPrototype = $WeakMap.prototype;\n var nativeDelete = WeakMapPrototype['delete'];\n var nativeHas = WeakMapPrototype.has;\n var nativeGet = WeakMapPrototype.get;\n var nativeSet = WeakMapPrototype.set;\n redefineAll(WeakMapPrototype, {\n 'delete': function (key) {\n if (isObject(key) && !isExtensible(key)) {\n var state = enforceIternalState(this);\n if (!state.frozen) state.frozen = new InternalWeakMap();\n return nativeDelete.call(this, key) || state.frozen['delete'](key);\n } return nativeDelete.call(this, key);\n },\n has: function has(key) {\n if (isObject(key) && !isExtensible(key)) {\n var state = enforceIternalState(this);\n if (!state.frozen) state.frozen = new InternalWeakMap();\n return nativeHas.call(this, key) || state.frozen.has(key);\n } return nativeHas.call(this, key);\n },\n get: function get(key) {\n if (isObject(key) && !isExtensible(key)) {\n var state = enforceIternalState(this);\n if (!state.frozen) state.frozen = new InternalWeakMap();\n return nativeHas.call(this, key) ? nativeGet.call(this, key) : state.frozen.get(key);\n } return nativeGet.call(this, key);\n },\n set: function set(key, value) {\n if (isObject(key) && !isExtensible(key)) {\n var state = enforceIternalState(this);\n if (!state.frozen) state.frozen = new InternalWeakMap();\n nativeHas.call(this, key) ? nativeSet.call(this, key, value) : state.frozen.set(key, value);\n } else nativeSet.call(this, key, value);\n return this;\n }\n });\n}\n","require('../../modules/es.array.iterator');\nrequire('../../modules/es.object.to-string');\nrequire('../../modules/es.weak-map');\nvar path = require('../../internals/path');\n\nmodule.exports = path.WeakMap;\n","var parent = require('../../es/weak-map');\nrequire('../../modules/web.dom-collections.iterator');\n\nmodule.exports = parent;\n","module.exports = require(\"core-js-pure/stable/weak-map\");","/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n if (typeof b !== \"function\" && b !== null)\r\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\r\n}) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n});\r\n\r\nexport function __exportStar(m, o) {\r\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n}\r\n\r\nexport function __spreadArray(to, from, pack) {\r\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\r\n if (ar || !(i in from)) {\r\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\r\n ar[i] = from[i];\r\n }\r\n }\r\n return to.concat(ar || Array.prototype.slice.call(from));\r\n}\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nvar __setModuleDefault = Object.create ? (function(o, v) {\r\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\r\n}) : function(o, v) {\r\n o[\"default\"] = v;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\r\n __setModuleDefault(result, mod);\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\r\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\r\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\r\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\r\n}\r\n","export interface Selectable {\n select(): void;\n unselect(): void;\n}\n\ninterface SingleTypeSelectionAccumulatorChanges<T> {\n added: T[];\n deleted: T[];\n previous: T[];\n current: T[];\n}\n\n/**\n * @param prev\n * @param next\n */\nfunction diffSets<T>(prev: ReadonlySet<T>, next: ReadonlySet<T>): Set<T> {\n const diff = new Set<T>();\n for (const item of next) {\n if (!prev.has(item)) {\n diff.add(item);\n }\n }\n return diff;\n}\n\nclass SingleTypeSelectionAccumulator<T extends Selectable> {\n #previousSelection: ReadonlySet<T> = new Set();\n #selection: Set<T> = new Set();\n\n public get size(): number {\n return this.#selection.size;\n }\n\n public add(...items: readonly T[]): void {\n for (const item of items) {\n this.#selection.add(item);\n }\n }\n public delete(...items: readonly T[]): void {\n for (const item of items) {\n this.#selection.delete(item);\n }\n }\n public clear(): void {\n this.#selection.clear();\n }\n\n public getSelection(): T[] {\n return [...this.#selection];\n }\n\n public getChanges(): SingleTypeSelectionAccumulatorChanges<T> {\n return {\n added: [...diffSets(this.#previousSelection, this.#selection)],\n deleted: [...diffSets(this.#selection, this.#previousSelection)],\n previous: [...new Set<T>(this.#previousSelection)],\n current: [...new Set<T>(this.#selection)],\n };\n }\n\n public commit(): SingleTypeSelectionAccumulatorChanges<T> {\n const changes = this.getChanges();\n\n this.#previousSelection = this.#selection;\n this.#selection = new Set(this.#previousSelection);\n\n for (const item of changes.added) {\n item.select();\n }\n for (const item of changes.deleted) {\n item.unselect();\n }\n\n return changes;\n }\n}\n\n// TODO: These should be real types imported from node.ts and edge.ts that don't\n// exist yet.\ninterface Node extends Selectable {\n $: \"node\";\n}\ninterface Edge extends Selectable {\n $: \"edge\";\n}\n\nexport interface SelectionAccumulatorCommitSummary {\n nodes: SingleTypeSelectionAccumulatorChanges<Node>;\n edges: SingleTypeSelectionAccumulatorChanges<Edge>;\n}\n\nexport type SelectionAccumulatorCommitHandler<\n CommitArgs extends readonly any[]\n> = (summary: SelectionAccumulatorCommitSummary, ...rest: CommitArgs) => void;\n\nexport class SelectionAccumulator<CommitArgs extends readonly any[]> {\n #nodes = new SingleTypeSelectionAccumulator<Node>();\n #edges = new SingleTypeSelectionAccumulator<Edge>();\n\n readonly #commitHandler: SelectionAccumulatorCommitHandler<CommitArgs>;\n\n public constructor(\n commitHandler: SelectionAccumulatorCommitHandler<CommitArgs> = (): void => {}\n ) {\n this.#commitHandler = commitHandler;\n }\n\n public get sizeNodes(): number {\n return this.#nodes.size;\n }\n public get sizeEdges(): number {\n return this.#edges.size;\n }\n\n public getNodes(): Node[] {\n return this.#nodes.getSelection();\n }\n public getEdges(): Edge[] {\n return this.#edges.getSelection();\n }\n\n public addNodes(...nodes: readonly Node[]): void {\n this.#nodes.add(...nodes);\n }\n public addEdges(...edges: readonly Edge[]): void {\n this.#edges.add(...edges);\n }\n\n public deleteNodes(node: Node): void {\n this.#nodes.delete(node);\n }\n public deleteEdges(edge: Edge): void {\n this.#edges.delete(edge);\n }\n\n public clear(): void {\n this.#nodes.clear();\n this.#edges.clear();\n }\n\n public commit(...rest: CommitArgs): SelectionAccumulatorCommitSummary {\n const summary = {\n nodes: this.#nodes.commit(),\n edges: this.#edges.commit(),\n };\n this.#commitHandler(summary, ...rest);\n return summary;\n }\n}\n","import Node from \"./components/Node\";\nimport Edge from \"./components/Edge\";\nimport { SelectionAccumulator } from \"./selection\";\n\nimport { selectiveDeepExtend } from \"vis-util/esnext\";\n\n/**\n * The handler for selections\n */\nclass SelectionHandler {\n /**\n * @param {object} body\n * @param {Canvas} canvas\n */\n constructor(body, canvas) {\n this.body = body;\n this.canvas = canvas;\n // TODO: Consider firing an event on any change to the selection, not\n // only those caused by clicks and taps. It would be easy to implement\n // now and (at least to me) it seems like something that could be\n // quite useful.\n this._selectionAccumulator = new SelectionAccumulator();\n this.hoverObj = { nodes: {}, edges: {} };\n\n this.options = {};\n this.defaultOptions = {\n multiselect: false,\n selectable: true,\n selectConnectedEdges: true,\n hoverConnectedEdges: true,\n };\n Object.assign(this.options, this.defaultOptions);\n\n this.body.emitter.on(\"_dataChanged\", () => {\n this.updateSelection();\n });\n }\n\n /**\n *\n * @param {object} [options]\n */\n setOptions(options) {\n if (options !== undefined) {\n const fields = [\n \"multiselect\",\n \"hoverConnectedEdges\",\n \"selectable\",\n \"selectConnectedEdges\",\n ];\n selectiveDeepExtend(fields, this.options, options);\n }\n }\n\n /**\n * handles the selection part of the tap;\n *\n * @param {{x: number, y: number}} pointer\n * @returns {boolean}\n */\n selectOnPoint(pointer) {\n let selected = false;\n if (this.options.selectable === true) {\n const obj = this.getNodeAt(pointer) || this.getEdgeAt(pointer);\n\n // unselect after getting the objects in order to restore width and height.\n this.unselectAll();\n\n if (obj !== undefined) {\n selected = this.selectObject(obj);\n }\n this.body.emitter.emit(\"_requestRedraw\");\n }\n return selected;\n }\n\n /**\n *\n * @param {{x: number, y: number}} pointer\n * @returns {boolean}\n */\n selectAdditionalOnPoint(pointer) {\n let selectionChanged = false;\n if (this.options.selectable === true) {\n const obj = this.getNodeAt(pointer) || this.getEdgeAt(pointer);\n\n if (obj !== undefined) {\n selectionChanged = true;\n if (obj.isSelected() === true) {\n this.deselectObject(obj);\n } else {\n this.selectObject(obj);\n }\n\n this.body.emitter.emit(\"_requestRedraw\");\n }\n }\n return selectionChanged;\n }\n\n /**\n * Create an object containing the standard fields for an event.\n *\n * @param {Event} event\n * @param {{x: number, y: number}} pointer Object with the x and y screen coordinates of the mouse\n * @returns {{}}\n * @private\n */\n _initBaseEvent(event, pointer) {\n const properties = {};\n\n properties[\"pointer\"] = {\n DOM: { x: pointer.x, y: pointer.y },\n canvas: this.canvas.DOMtoCanvas(pointer),\n };\n properties[\"event\"] = event;\n\n return properties;\n }\n\n /**\n * Generate an event which the user can catch.\n *\n * This adds some extra data to the event with respect to cursor position and\n * selected nodes and edges.\n *\n * @param {string} eventType Name of event to send\n * @param {Event} event\n * @param {{x: number, y: number}} pointer Object with the x and y screen coordinates of the mouse\n * @param {object | undefined} oldSelection If present, selection state before event occured\n * @param {boolean|undefined} [emptySelection=false] Indicate if selection data should be passed\n */\n generateClickEvent(\n eventType,\n event,\n pointer,\n oldSelection,\n emptySelection = false\n ) {\n const properties = this._initBaseEvent(event, pointer);\n\n if (emptySelection === true) {\n properties.nodes = [];\n properties.edges = [];\n } else {\n const tmp = this.getSelection();\n properties.nodes = tmp.nodes;\n properties.edges = tmp.edges;\n }\n\n if (oldSelection !== undefined) {\n properties[\"previousSelection\"] = oldSelection;\n }\n\n if (eventType == \"click\") {\n // For the time being, restrict this functionality to\n // just the click event.\n properties.items = this.getClickedItems(pointer);\n }\n\n if (event.controlEdge !== undefined) {\n properties.controlEdge = event.controlEdge;\n }\n\n this.body.emitter.emit(eventType, properties);\n }\n\n /**\n *\n * @param {object} obj\n * @param {boolean} [highlightEdges=this.options.selectConnectedEdges]\n * @returns {boolean}\n */\n selectObject(obj, highlightEdges = this.options.selectConnectedEdges) {\n if (obj !== undefined) {\n if (obj instanceof Node) {\n if (highlightEdges === true) {\n this._selectionAccumulator.addEdges(...obj.edges);\n }\n this._selectionAccumulator.addNodes(obj);\n } else {\n this._selectionAccumulator.addEdges(obj);\n }\n return true;\n }\n return false;\n }\n\n /**\n *\n * @param {object} obj\n */\n deselectObject(obj) {\n if (obj.isSelected() === true) {\n obj.selected = false;\n this._removeFromSelection(obj);\n }\n }\n\n /**\n * retrieve all nodes overlapping with given object\n *\n * @param {object} object An object with parameters left, top, right, bottom\n * @returns {number[]} An array with id's of the overlapping nodes\n * @private\n */\n _getAllNodesOverlappingWith(object) {\n const overlappingNodes = [];\n const nodes = this.body.nodes;\n for (let i = 0; i < this.body.nodeIndices.length; i++) {\n const nodeId = this.body.nodeIndices[i];\n if (nodes[nodeId].isOverlappingWith(object)) {\n overlappingNodes.push(nodeId);\n }\n }\n return overlappingNodes;\n }\n\n /**\n * Return a position object in canvasspace from a single point in screenspace\n *\n * @param {{x: number, y: number}} pointer\n * @returns {{left: number, top: number, right: number, bottom: number}}\n * @private\n */\n _pointerToPositionObject(pointer) {\n const canvasPos = this.canvas.DOMtoCanvas(pointer);\n return {\n left: canvasPos.x - 1,\n top: canvasPos.y + 1,\n right: canvasPos.x + 1,\n bottom: canvasPos.y - 1,\n };\n }\n\n /**\n * Get the top node at the passed point (like a click)\n *\n * @param {{x: number, y: number}} pointer\n * @param {boolean} [returnNode=true]\n * @returns {Node | undefined} node\n */\n getNodeAt(pointer, returnNode = true) {\n // we first check if this is an navigation controls element\n const positionObject = this._pointerToPositionObject(pointer);\n const overlappingNodes = this._getAllNodesOverlappingWith(positionObject);\n // if there are overlapping nodes, select the last one, this is the\n // one which is drawn on top of the others\n if (overlappingNodes.length > 0) {\n if (returnNode === true) {\n return this.body.nodes[overlappingNodes[overlappingNodes.length - 1]];\n } else {\n return overlappingNodes[overlappingNodes.length - 1];\n }\n } else {\n return undefined;\n }\n }\n\n /**\n * retrieve all edges overlapping with given object, selector is around center\n *\n * @param {object} object An object with parameters left, top, right, bottom\n * @param {number[]} overlappingEdges An array with id's of the overlapping nodes\n * @private\n */\n _getEdgesOverlappingWith(object, overlappingEdges) {\n const edges = this.body.edges;\n for (let i = 0; i < this.body.edgeIndices.length; i++) {\n const edgeId = this.body.edgeIndices[i];\n if (edges[edgeId].isOverlappingWith(object)) {\n overlappingEdges.push(edgeId);\n }\n }\n }\n\n /**\n * retrieve all nodes overlapping with given object\n *\n * @param {object} object An object with parameters left, top, right, bottom\n * @returns {number[]} An array with id's of the overlapping nodes\n * @private\n */\n _getAllEdgesOverlappingWith(object) {\n const overlappingEdges = [];\n this._getEdgesOverlappingWith(object, overlappingEdges);\n return overlappingEdges;\n }\n\n /**\n * Get the edges nearest to the passed point (like a click)\n *\n * @param {{x: number, y: number}} pointer\n * @param {boolean} [returnEdge=true]\n * @returns {Edge | undefined} node\n */\n getEdgeAt(pointer, returnEdge = true) {\n // Iterate over edges, pick closest within 10\n const canvasPos = this.canvas.DOMtoCanvas(pointer);\n let mindist = 10;\n let overlappingEdge = null;\n const edges = this.body.edges;\n for (let i = 0; i < this.body.edgeIndices.length; i++) {\n const edgeId = this.body.edgeIndices[i];\n const edge = edges[edgeId];\n if (edge.connected) {\n const xFrom = edge.from.x;\n const yFrom = edge.from.y;\n const xTo = edge.to.x;\n const yTo = edge.to.y;\n const dist = edge.edgeType.getDistanceToEdge(\n xFrom,\n yFrom,\n xTo,\n yTo,\n canvasPos.x,\n canvasPos.y\n );\n if (dist < mindist) {\n overlappingEdge = edgeId;\n mindist = dist;\n }\n }\n }\n if (overlappingEdge !== null) {\n if (returnEdge === true) {\n return this.body.edges[overlappingEdge];\n } else {\n return overlappingEdge;\n }\n } else {\n return undefined;\n }\n }\n\n /**\n * Add object to the selection array.\n *\n * @param {object} obj\n * @private\n */\n _addToHover(obj) {\n if (obj instanceof Node) {\n this.hoverObj.nodes[obj.id] = obj;\n } else {\n this.hoverObj.edges[obj.id] = obj;\n }\n }\n\n /**\n * Remove a single option from selection.\n *\n * @param {object} obj\n * @private\n */\n _removeFromSelection(obj) {\n if (obj instanceof Node) {\n this._selectionAccumulator.deleteNodes(obj);\n this._selectionAccumulator.deleteEdges(...obj.edges);\n } else {\n this._selectionAccumulator.deleteEdges(obj);\n }\n }\n\n /**\n * Unselect all nodes and edges.\n */\n unselectAll() {\n this._selectionAccumulator.clear();\n }\n\n /**\n * return the number of selected nodes\n *\n * @returns {number}\n */\n getSelectedNodeCount() {\n return this._selectionAccumulator.sizeNodes;\n }\n\n /**\n * return the number of selected edges\n *\n * @returns {number}\n */\n getSelectedEdgeCount() {\n return this._selectionAccumulator.sizeEdges;\n }\n\n /**\n * select the edges connected to the node that is being selected\n *\n * @param {Node} node\n * @private\n */\n _hoverConnectedEdges(node) {\n for (let i = 0; i < node.edges.length; i++) {\n const edge = node.edges[i];\n edge.hover = true;\n this._addToHover(edge);\n }\n }\n\n /**\n * Remove the highlight from a node or edge, in response to mouse movement\n *\n * @param {Event} event\n * @param {{x: number, y: number}} pointer object with the x and y screen coordinates of the mouse\n * @param {Node|vis.Edge} object\n * @private\n */\n emitBlurEvent(event, pointer, object) {\n const properties = this._initBaseEvent(event, pointer);\n\n if (object.hover === true) {\n object.hover = false;\n if (object instanceof Node) {\n properties.node = object.id;\n this.body.emitter.emit(\"blurNode\", properties);\n } else {\n properties.edge = object.id;\n this.body.emitter.emit(\"blurEdge\", properties);\n }\n }\n }\n\n /**\n * Create the highlight for a node or edge, in response to mouse movement\n *\n * @param {Event} event\n * @param {{x: number, y: number}} pointer object with the x and y screen coordinates of the mouse\n * @param {Node|vis.Edge} object\n * @returns {boolean} hoverChanged\n * @private\n */\n emitHoverEvent(event, pointer, object) {\n const properties = this._initBaseEvent(event, pointer);\n let hoverChanged = false;\n\n if (object.hover === false) {\n object.hover = true;\n this._addToHover(object);\n hoverChanged = true;\n if (object instanceof Node) {\n properties.node = object.id;\n this.body.emitter.emit(\"hoverNode\", properties);\n } else {\n properties.edge = object.id;\n this.body.emitter.emit(\"hoverEdge\", properties);\n }\n }\n\n return hoverChanged;\n }\n\n /**\n * Perform actions in response to a mouse movement.\n *\n * @param {Event} event\n * @param {{x: number, y: number}} pointer | object with the x and y screen coordinates of the mouse\n */\n hoverObject(event, pointer) {\n let object = this.getNodeAt(pointer);\n if (object === undefined) {\n object = this.getEdgeAt(pointer);\n }\n\n let hoverChanged = false;\n // remove all node hover highlights\n for (const nodeId in this.hoverObj.nodes) {\n if (Object.prototype.hasOwnProperty.call(this.hoverObj.nodes, nodeId)) {\n if (\n object === undefined ||\n (object instanceof Node && object.id != nodeId) ||\n object instanceof Edge\n ) {\n this.emitBlurEvent(event, pointer, this.hoverObj.nodes[nodeId]);\n delete this.hoverObj.nodes[nodeId];\n hoverChanged = true;\n }\n }\n }\n\n // removing all edge hover highlights\n for (const edgeId in this.hoverObj.edges) {\n if (Object.prototype.hasOwnProperty.call(this.hoverObj.edges, edgeId)) {\n // if the hover has been changed here it means that the node has been hovered over or off\n // we then do not use the emitBlurEvent method here.\n if (hoverChanged === true) {\n this.hoverObj.edges[edgeId].hover = false;\n delete this.hoverObj.edges[edgeId];\n }\n // if the blur remains the same and the object is undefined (mouse off) or another\n // edge has been hovered, or another node has been hovered we blur the edge.\n else if (\n object === undefined ||\n (object instanceof Edge && object.id != edgeId) ||\n (object instanceof Node && !object.hover)\n ) {\n this.emitBlurEvent(event, pointer, this.hoverObj.edges[edgeId]);\n delete this.hoverObj.edges[edgeId];\n hoverChanged = true;\n }\n }\n }\n\n if (object !== undefined) {\n const hoveredEdgesCount = Object.keys(this.hoverObj.edges).length;\n const hoveredNodesCount = Object.keys(this.hoverObj.nodes).length;\n const newOnlyHoveredEdge =\n object instanceof Edge &&\n hoveredEdgesCount === 0 &&\n hoveredNodesCount === 0;\n const newOnlyHoveredNode =\n object instanceof Node &&\n hoveredEdgesCount === 0 &&\n hoveredNodesCount === 0;\n\n if (hoverChanged || newOnlyHoveredEdge || newOnlyHoveredNode) {\n hoverChanged = this.emitHoverEvent(event, pointer, object);\n }\n\n if (object instanceof Node && this.options.hoverConnectedEdges === true) {\n this._hoverConnectedEdges(object);\n }\n }\n\n if (hoverChanged === true) {\n this.body.emitter.emit(\"_requestRedraw\");\n }\n }\n\n /**\n * Commit the selection changes but don't emit any events.\n */\n commitWithoutEmitting() {\n this._selectionAccumulator.commit();\n }\n\n /**\n * Select and deselect nodes depending current selection change.\n *\n * For changing nodes, select/deselect events are fired.\n *\n * NOTE: For a given edge, if one connecting node is deselected and with the\n * same click the other node is selected, no events for the edge will fire. It\n * was selected and it will remain selected.\n *\n * @param {{x: number, y: number}} pointer - The x and y coordinates of the\n * click, tap, dragend… that triggered this.\n * @param {UIEvent} event - The event that triggered this.\n */\n commitAndEmit(pointer, event) {\n let selected = false;\n\n const selectionChanges = this._selectionAccumulator.commit();\n const previousSelection = {\n nodes: selectionChanges.nodes.previous,\n edges: selectionChanges.edges.previous,\n };\n\n if (selectionChanges.edges.deleted.length > 0) {\n this.generateClickEvent(\n \"deselectEdge\",\n event,\n pointer,\n previousSelection\n );\n selected = true;\n }\n\n if (selectionChanges.nodes.deleted.length > 0) {\n this.generateClickEvent(\n \"deselectNode\",\n event,\n pointer,\n previousSelection\n );\n selected = true;\n }\n\n if (selectionChanges.nodes.added.length > 0) {\n this.generateClickEvent(\"selectNode\", event, pointer);\n selected = true;\n }\n\n if (selectionChanges.edges.added.length > 0) {\n this.generateClickEvent(\"selectEdge\", event, pointer);\n selected = true;\n }\n\n // fire the select event if anything has been selected or deselected\n if (selected === true) {\n // select or unselect\n this.generateClickEvent(\"select\", event, pointer);\n }\n }\n\n /**\n * Retrieve the currently selected node and edge ids.\n *\n * @returns {{nodes: Array.<string>, edges: Array.<string>}} Arrays with the\n * ids of the selected nodes and edges.\n */\n getSelection() {\n return {\n nodes: this.getSelectedNodeIds(),\n edges: this.getSelectedEdgeIds(),\n };\n }\n\n /**\n * Retrieve the currently selected nodes.\n *\n * @returns {Array} An array with selected nodes.\n */\n getSelectedNodes() {\n return this._selectionAccumulator.getNodes();\n }\n\n /**\n * Retrieve the currently selected edges.\n *\n * @returns {Array} An array with selected edges.\n */\n getSelectedEdges() {\n return this._selectionAccumulator.getEdges();\n }\n\n /**\n * Retrieve the currently selected node ids.\n *\n * @returns {Array} An array with the ids of the selected nodes.\n */\n getSelectedNodeIds() {\n return this._selectionAccumulator.getNodes().map((node) => node.id);\n }\n\n /**\n * Retrieve the currently selected edge ids.\n *\n * @returns {Array} An array with the ids of the selected edges.\n */\n getSelectedEdgeIds() {\n return this._selectionAccumulator.getEdges().map((edge) => edge.id);\n }\n\n /**\n * Updates the current selection\n *\n * @param {{nodes: Array.<string>, edges: Array.<string>}} selection\n * @param {object} options Options\n */\n setSelection(selection, options = {}) {\n if (!selection || (!selection.nodes && !selection.edges)) {\n throw new TypeError(\n \"Selection must be an object with nodes and/or edges properties\"\n );\n }\n\n // first unselect any selected node, if option is true or undefined\n if (options.unselectAll || options.unselectAll === undefined) {\n this.unselectAll();\n }\n if (selection.nodes) {\n for (const id of selection.nodes) {\n const node = this.body.nodes[id];\n if (!node) {\n throw new RangeError('Node with id \"' + id + '\" not found');\n }\n // don't select edges with it\n this.selectObject(node, options.highlightEdges);\n }\n }\n\n if (selection.edges) {\n for (const id of selection.edges) {\n const edge = this.body.edges[id];\n if (!edge) {\n throw new RangeError('Edge with id \"' + id + '\" not found');\n }\n this.selectObject(edge);\n }\n }\n this.body.emitter.emit(\"_requestRedraw\");\n this._selectionAccumulator.commit();\n }\n\n /**\n * select zero or more nodes with the option to highlight edges\n *\n * @param {number[] | string[]} selection An array with the ids of the\n * selected nodes.\n * @param {boolean} [highlightEdges]\n */\n selectNodes(selection, highlightEdges = true) {\n if (!selection || selection.length === undefined)\n throw \"Selection must be an array with ids\";\n\n this.setSelection({ nodes: selection }, { highlightEdges: highlightEdges });\n }\n\n /**\n * select zero or more edges\n *\n * @param {number[] | string[]} selection An array with the ids of the\n * selected nodes.\n */\n selectEdges(selection) {\n if (!selection || selection.length === undefined)\n throw \"Selection must be an array with ids\";\n\n this.setSelection({ edges: selection });\n }\n\n /**\n * Validate the selection: remove ids of nodes which no longer exist\n *\n * @private\n */\n updateSelection() {\n for (const node in this._selectionAccumulator.getNodes()) {\n if (!Object.prototype.hasOwnProperty.call(this.body.nodes, node.id)) {\n this._selectionAccumulator.deleteNodes(node);\n }\n }\n for (const edge in this._selectionAccumulator.getEdges()) {\n if (!Object.prototype.hasOwnProperty.call(this.body.edges, edge.id)) {\n this._selectionAccumulator.deleteEdges(edge);\n }\n }\n }\n\n /**\n * Determine all the visual elements clicked which are on the given point.\n *\n * All elements are returned; this includes nodes, edges and their labels.\n * The order returned is from highest to lowest, i.e. element 0 of the return\n * value is the topmost item clicked on.\n *\n * The return value consists of an array of the following possible elements:\n *\n * - `{nodeId:number}` - node with given id clicked on\n * - `{nodeId:number, labelId:0}` - label of node with given id clicked on\n * - `{edgeId:number}` - edge with given id clicked on\n * - `{edge:number, labelId:0}` - label of edge with given id clicked on\n *\n * ## NOTES\n *\n * - Currently, there is only one label associated with a node or an edge,\n * but this is expected to change somewhere in the future.\n * - Since there is no z-indexing yet, it is not really possible to set the nodes and\n * edges in the correct order. For the time being, nodes come first.\n *\n * @param {point} pointer mouse position in screen coordinates\n * @returns {Array.<nodeClickItem|nodeLabelClickItem|edgeClickItem|edgeLabelClickItem>}\n * @private\n */\n getClickedItems(pointer) {\n const point = this.canvas.DOMtoCanvas(pointer);\n const items = [];\n\n // Note reverse order; we want the topmost clicked items to be first in the array\n // Also note that selected nodes are disregarded here; these normally display on top\n const nodeIndices = this.body.nodeIndices;\n const nodes = this.body.nodes;\n for (let i = nodeIndices.length - 1; i >= 0; i--) {\n const node = nodes[nodeIndices[i]];\n const ret = node.getItemsOnPoint(point);\n items.push.apply(items, ret); // Append the return value to the running list.\n }\n\n const edgeIndices = this.body.edgeIndices;\n const edges = this.body.edges;\n for (let i = edgeIndices.length - 1; i >= 0; i--) {\n const edge = edges[edgeIndices[i]];\n const ret = edge.getItemsOnPoint(point);\n items.push.apply(items, ret); // Append the return value to the running list.\n }\n\n return items;\n }\n}\n\nexport default SelectionHandler;\n","/****\n * The MIT License\n *\n * Copyright (c) 2015 Marco Ziccardi\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n *\n ****/\n(function (global, factory) {\n if (typeof define === 'function' && define.amd) {\n define('timsort', ['exports'], factory);\n } else if (typeof exports !== 'undefined') {\n factory(exports);\n } else {\n var mod = {\n exports: {}\n };\n factory(mod.exports);\n global.timsort = mod.exports;\n }\n})(this, function (exports) {\n 'use strict';\n\n exports.__esModule = true;\n exports.sort = sort;\n\n function _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError('Cannot call a class as a function');\n }\n }\n\n var DEFAULT_MIN_MERGE = 32;\n\n var DEFAULT_MIN_GALLOPING = 7;\n\n var DEFAULT_TMP_STORAGE_LENGTH = 256;\n\n var POWERS_OF_TEN = [1e0, 1e1, 1e2, 1e3, 1e4, 1e5, 1e6, 1e7, 1e8, 1e9];\n\n function log10(x) {\n if (x < 1e5) {\n if (x < 1e2) {\n return x < 1e1 ? 0 : 1;\n }\n\n if (x < 1e4) {\n return x < 1e3 ? 2 : 3;\n }\n\n return 4;\n }\n\n if (x < 1e7) {\n return x < 1e6 ? 5 : 6;\n }\n\n if (x < 1e9) {\n return x < 1e8 ? 7 : 8;\n }\n\n return 9;\n }\n\n function alphabeticalCompare(a, b) {\n if (a === b) {\n return 0;\n }\n\n if (~ ~a === a && ~ ~b === b) {\n if (a === 0 || b === 0) {\n return a < b ? -1 : 1;\n }\n\n if (a < 0 || b < 0) {\n if (b >= 0) {\n return -1;\n }\n\n if (a >= 0) {\n return 1;\n }\n\n a = -a;\n b = -b;\n }\n\n var al = log10(a);\n var bl = log10(b);\n\n var t = 0;\n\n if (al < bl) {\n a *= POWERS_OF_TEN[bl - al - 1];\n b /= 10;\n t = -1;\n } else if (al > bl) {\n b *= POWERS_OF_TEN[al - bl - 1];\n a /= 10;\n t = 1;\n }\n\n if (a === b) {\n return t;\n }\n\n return a < b ? -1 : 1;\n }\n\n var aStr = String(a);\n var bStr = String(b);\n\n if (aStr === bStr) {\n return 0;\n }\n\n return aStr < bStr ? -1 : 1;\n }\n\n function minRunLength(n) {\n var r = 0;\n\n while (n >= DEFAULT_MIN_MERGE) {\n r |= n & 1;\n n >>= 1;\n }\n\n return n + r;\n }\n\n function makeAscendingRun(array, lo, hi, compare) {\n var runHi = lo + 1;\n\n if (runHi === hi) {\n return 1;\n }\n\n if (compare(array[runHi++], array[lo]) < 0) {\n while (runHi < hi && compare(array[runHi], array[runHi - 1]) < 0) {\n runHi++;\n }\n\n reverseRun(array, lo, runHi);\n } else {\n while (runHi < hi && compare(array[runHi], array[runHi - 1]) >= 0) {\n runHi++;\n }\n }\n\n return runHi - lo;\n }\n\n function reverseRun(array, lo, hi) {\n hi--;\n\n while (lo < hi) {\n var t = array[lo];\n array[lo++] = array[hi];\n array[hi--] = t;\n }\n }\n\n function binaryInsertionSort(array, lo, hi, start, compare) {\n if (start === lo) {\n start++;\n }\n\n for (; start < hi; start++) {\n var pivot = array[start];\n\n var left = lo;\n var right = start;\n\n while (left < right) {\n var mid = left + right >>> 1;\n\n if (compare(pivot, array[mid]) < 0) {\n right = mid;\n } else {\n left = mid + 1;\n }\n }\n\n var n = start - left;\n\n switch (n) {\n case 3:\n array[left + 3] = array[left + 2];\n\n case 2:\n array[left + 2] = array[left + 1];\n\n case 1:\n array[left + 1] = array[left];\n break;\n default:\n while (n > 0) {\n array[left + n] = array[left + n - 1];\n n--;\n }\n }\n\n array[left] = pivot;\n }\n }\n\n function gallopLeft(value, array, start, length, hint, compare) {\n var lastOffset = 0;\n var maxOffset = 0;\n var offset = 1;\n\n if (compare(value, array[start + hint]) > 0) {\n maxOffset = length - hint;\n\n while (offset < maxOffset && compare(value, array[start + hint + offset]) > 0) {\n lastOffset = offset;\n offset = (offset << 1) + 1;\n\n if (offset <= 0) {\n offset = maxOffset;\n }\n }\n\n if (offset > maxOffset) {\n offset = maxOffset;\n }\n\n lastOffset += hint;\n offset += hint;\n } else {\n maxOffset = hint + 1;\n while (offset < maxOffset && compare(value, array[start + hint - offset]) <= 0) {\n lastOffset = offset;\n offset = (offset << 1) + 1;\n\n if (offset <= 0) {\n offset = maxOffset;\n }\n }\n if (offset > maxOffset) {\n offset = maxOffset;\n }\n\n var tmp = lastOffset;\n lastOffset = hint - offset;\n offset = hint - tmp;\n }\n\n lastOffset++;\n while (lastOffset < offset) {\n var m = lastOffset + (offset - lastOffset >>> 1);\n\n if (compare(value, array[start + m]) > 0) {\n lastOffset = m + 1;\n } else {\n offset = m;\n }\n }\n return offset;\n }\n\n function gallopRight(value, array, start, length, hint, compare) {\n var lastOffset = 0;\n var maxOffset = 0;\n var offset = 1;\n\n if (compare(value, array[start + hint]) < 0) {\n maxOffset = hint + 1;\n\n while (offset < maxOffset && compare(value, array[start + hint - offset]) < 0) {\n lastOffset = offset;\n offset = (offset << 1) + 1;\n\n if (offset <= 0) {\n offset = maxOffset;\n }\n }\n\n if (offset > maxOffset) {\n offset = maxOffset;\n }\n\n var tmp = lastOffset;\n lastOffset = hint - offset;\n offset = hint - tmp;\n } else {\n maxOffset = length - hint;\n\n while (offset < maxOffset && compare(value, array[start + hint + offset]) >= 0) {\n lastOffset = offset;\n offset = (offset << 1) + 1;\n\n if (offset <= 0) {\n offset = maxOffset;\n }\n }\n\n if (offset > maxOffset) {\n offset = maxOffset;\n }\n\n lastOffset += hint;\n offset += hint;\n }\n\n lastOffset++;\n\n while (lastOffset < offset) {\n var m = lastOffset + (offset - lastOffset >>> 1);\n\n if (compare(value, array[start + m]) < 0) {\n offset = m;\n } else {\n lastOffset = m + 1;\n }\n }\n\n return offset;\n }\n\n var TimSort = (function () {\n function TimSort(array, compare) {\n _classCallCheck(this, TimSort);\n\n this.array = null;\n this.compare = null;\n this.minGallop = DEFAULT_MIN_GALLOPING;\n this.length = 0;\n this.tmpStorageLength = DEFAULT_TMP_STORAGE_LENGTH;\n this.stackLength = 0;\n this.runStart = null;\n this.runLength = null;\n this.stackSize = 0;\n\n this.array = array;\n this.compare = compare;\n\n this.length = array.length;\n\n if (this.length < 2 * DEFAULT_TMP_STORAGE_LENGTH) {\n this.tmpStorageLength = this.length >>> 1;\n }\n\n this.tmp = new Array(this.tmpStorageLength);\n\n this.stackLength = this.length < 120 ? 5 : this.length < 1542 ? 10 : this.length < 119151 ? 19 : 40;\n\n this.runStart = new Array(this.stackLength);\n this.runLength = new Array(this.stackLength);\n }\n\n TimSort.prototype.pushRun = function pushRun(runStart, runLength) {\n this.runStart[this.stackSize] = runStart;\n this.runLength[this.stackSize] = runLength;\n this.stackSize += 1;\n };\n\n TimSort.prototype.mergeRuns = function mergeRuns() {\n while (this.stackSize > 1) {\n var n = this.stackSize - 2;\n\n if (n >= 1 && this.runLength[n - 1] <= this.runLength[n] + this.runLength[n + 1] || n >= 2 && this.runLength[n - 2] <= this.runLength[n] + this.runLength[n - 1]) {\n\n if (this.runLength[n - 1] < this.runLength[n + 1]) {\n n--;\n }\n } else if (this.runLength[n] > this.runLength[n + 1]) {\n break;\n }\n this.mergeAt(n);\n }\n };\n\n TimSort.prototype.forceMergeRuns = function forceMergeRuns() {\n while (this.stackSize > 1) {\n var n = this.stackSize - 2;\n\n if (n > 0 && this.runLength[n - 1] < this.runLength[n + 1]) {\n n--;\n }\n\n this.mergeAt(n);\n }\n };\n\n TimSort.prototype.mergeAt = function mergeAt(i) {\n var compare = this.compare;\n var array = this.array;\n\n var start1 = this.runStart[i];\n var length1 = this.runLength[i];\n var start2 = this.runStart[i + 1];\n var length2 = this.runLength[i + 1];\n\n this.runLength[i] = length1 + length2;\n\n if (i === this.stackSize - 3) {\n this.runStart[i + 1] = this.runStart[i + 2];\n this.runLength[i + 1] = this.runLength[i + 2];\n }\n\n this.stackSize--;\n\n var k = gallopRight(array[start2], array, start1, length1, 0, compare);\n start1 += k;\n length1 -= k;\n\n if (length1 === 0) {\n return;\n }\n\n length2 = gallopLeft(array[start1 + length1 - 1], array, start2, length2, length2 - 1, compare);\n\n if (length2 === 0) {\n return;\n }\n\n if (length1 <= length2) {\n this.mergeLow(start1, length1, start2, length2);\n } else {\n this.mergeHigh(start1, length1, start2, length2);\n }\n };\n\n TimSort.prototype.mergeLow = function mergeLow(start1, length1, start2, length2) {\n\n var compare = this.compare;\n var array = this.array;\n var tmp = this.tmp;\n var i = 0;\n\n for (i = 0; i < length1; i++) {\n tmp[i] = array[start1 + i];\n }\n\n var cursor1 = 0;\n var cursor2 = start2;\n var dest = start1;\n\n array[dest++] = array[cursor2++];\n\n if (--length2 === 0) {\n for (i = 0; i < length1; i++) {\n array[dest + i] = tmp[cursor1 + i];\n }\n return;\n }\n\n if (length1 === 1) {\n for (i = 0; i < length2; i++) {\n array[dest + i] = array[cursor2 + i];\n }\n array[dest + length2] = tmp[cursor1];\n return;\n }\n\n var minGallop = this.minGallop;\n\n while (true) {\n var count1 = 0;\n var count2 = 0;\n var exit = false;\n\n do {\n if (compare(array[cursor2], tmp[cursor1]) < 0) {\n array[dest++] = array[cursor2++];\n count2++;\n count1 = 0;\n\n if (--length2 === 0) {\n exit = true;\n break;\n }\n } else {\n array[dest++] = tmp[cursor1++];\n count1++;\n count2 = 0;\n if (--length1 === 1) {\n exit = true;\n break;\n }\n }\n } while ((count1 | count2) < minGallop);\n\n if (exit) {\n break;\n }\n\n do {\n count1 = gallopRight(array[cursor2], tmp, cursor1, length1, 0, compare);\n\n if (count1 !== 0) {\n for (i = 0; i < count1; i++) {\n array[dest + i] = tmp[cursor1 + i];\n }\n\n dest += count1;\n cursor1 += count1;\n length1 -= count1;\n if (length1 <= 1) {\n exit = true;\n break;\n }\n }\n\n array[dest++] = array[cursor2++];\n\n if (--length2 === 0) {\n exit = true;\n break;\n }\n\n count2 = gallopLeft(tmp[cursor1], array, cursor2, length2, 0, compare);\n\n if (count2 !== 0) {\n for (i = 0; i < count2; i++) {\n array[dest + i] = array[cursor2 + i];\n }\n\n dest += count2;\n cursor2 += count2;\n length2 -= count2;\n\n if (length2 === 0) {\n exit = true;\n break;\n }\n }\n array[dest++] = tmp[cursor1++];\n\n if (--length1 === 1) {\n exit = true;\n break;\n }\n\n minGallop--;\n } while (count1 >= DEFAULT_MIN_GALLOPING || count2 >= DEFAULT_MIN_GALLOPING);\n\n if (exit) {\n break;\n }\n\n if (minGallop < 0) {\n minGallop = 0;\n }\n\n minGallop += 2;\n }\n\n this.minGallop = minGallop;\n\n if (minGallop < 1) {\n this.minGallop = 1;\n }\n\n if (length1 === 1) {\n for (i = 0; i < length2; i++) {\n array[dest + i] = array[cursor2 + i];\n }\n array[dest + length2] = tmp[cursor1];\n } else if (length1 === 0) {\n throw new Error('mergeLow preconditions were not respected');\n } else {\n for (i = 0; i < length1; i++) {\n array[dest + i] = tmp[cursor1 + i];\n }\n }\n };\n\n TimSort.prototype.mergeHigh = function mergeHigh(start1, length1, start2, length2) {\n var compare = this.compare;\n var array = this.array;\n var tmp = this.tmp;\n var i = 0;\n\n for (i = 0; i < length2; i++) {\n tmp[i] = array[start2 + i];\n }\n\n var cursor1 = start1 + length1 - 1;\n var cursor2 = length2 - 1;\n var dest = start2 + length2 - 1;\n var customCursor = 0;\n var customDest = 0;\n\n array[dest--] = array[cursor1--];\n\n if (--length1 === 0) {\n customCursor = dest - (length2 - 1);\n\n for (i = 0; i < length2; i++) {\n array[customCursor + i] = tmp[i];\n }\n\n return;\n }\n\n if (length2 === 1) {\n dest -= length1;\n cursor1 -= length1;\n customDest = dest + 1;\n customCursor = cursor1 + 1;\n\n for (i = length1 - 1; i >= 0; i--) {\n array[customDest + i] = array[customCursor + i];\n }\n\n array[dest] = tmp[cursor2];\n return;\n }\n\n var minGallop = this.minGallop;\n\n while (true) {\n var count1 = 0;\n var count2 = 0;\n var exit = false;\n\n do {\n if (compare(tmp[cursor2], array[cursor1]) < 0) {\n array[dest--] = array[cursor1--];\n count1++;\n count2 = 0;\n if (--length1 === 0) {\n exit = true;\n break;\n }\n } else {\n array[dest--] = tmp[cursor2--];\n count2++;\n count1 = 0;\n if (--length2 === 1) {\n exit = true;\n break;\n }\n }\n } while ((count1 | count2) < minGallop);\n\n if (exit) {\n break;\n }\n\n do {\n count1 = length1 - gallopRight(tmp[cursor2], array, start1, length1, length1 - 1, compare);\n\n if (count1 !== 0) {\n dest -= count1;\n cursor1 -= count1;\n length1 -= count1;\n customDest = dest + 1;\n customCursor = cursor1 + 1;\n\n for (i = count1 - 1; i >= 0; i--) {\n array[customDest + i] = array[customCursor + i];\n }\n\n if (length1 === 0) {\n exit = true;\n break;\n }\n }\n\n array[dest--] = tmp[cursor2--];\n\n if (--length2 === 1) {\n exit = true;\n break;\n }\n\n count2 = length2 - gallopLeft(array[cursor1], tmp, 0, length2, length2 - 1, compare);\n\n if (count2 !== 0) {\n dest -= count2;\n cursor2 -= count2;\n length2 -= count2;\n customDest = dest + 1;\n customCursor = cursor2 + 1;\n\n for (i = 0; i < count2; i++) {\n array[customDest + i] = tmp[customCursor + i];\n }\n\n if (length2 <= 1) {\n exit = true;\n break;\n }\n }\n\n array[dest--] = array[cursor1--];\n\n if (--length1 === 0) {\n exit = true;\n break;\n }\n\n minGallop--;\n } while (count1 >= DEFAULT_MIN_GALLOPING || count2 >= DEFAULT_MIN_GALLOPING);\n\n if (exit) {\n break;\n }\n\n if (minGallop < 0) {\n minGallop = 0;\n }\n\n minGallop += 2;\n }\n\n this.minGallop = minGallop;\n\n if (minGallop < 1) {\n this.minGallop = 1;\n }\n\n if (length2 === 1) {\n dest -= length1;\n cursor1 -= length1;\n customDest = dest + 1;\n customCursor = cursor1 + 1;\n\n for (i = length1 - 1; i >= 0; i--) {\n array[customDest + i] = array[customCursor + i];\n }\n\n array[dest] = tmp[cursor2];\n } else if (length2 === 0) {\n throw new Error('mergeHigh preconditions were not respected');\n } else {\n customCursor = dest - (length2 - 1);\n for (i = 0; i < length2; i++) {\n array[customCursor + i] = tmp[i];\n }\n }\n };\n\n return TimSort;\n })();\n\n function sort(array, compare, lo, hi) {\n if (!Array.isArray(array)) {\n throw new TypeError('Can only sort arrays');\n }\n\n if (!compare) {\n compare = alphabeticalCompare;\n } else if (typeof compare !== 'function') {\n hi = lo;\n lo = compare;\n compare = alphabeticalCompare;\n }\n\n if (!lo) {\n lo = 0;\n }\n if (!hi) {\n hi = array.length;\n }\n\n var remaining = hi - lo;\n\n if (remaining < 2) {\n return;\n }\n\n var runLength = 0;\n\n if (remaining < DEFAULT_MIN_MERGE) {\n runLength = makeAscendingRun(array, lo, hi, compare);\n binaryInsertionSort(array, lo, hi, lo + runLength, compare);\n return;\n }\n\n var ts = new TimSort(array, compare);\n\n var minRun = minRunLength(remaining);\n\n do {\n runLength = makeAscendingRun(array, lo, hi, compare);\n if (runLength < minRun) {\n var force = remaining;\n if (force > minRun) {\n force = minRun;\n }\n\n binaryInsertionSort(array, lo, lo + force, lo + runLength, compare);\n runLength = force;\n }\n\n ts.pushRun(lo, runLength);\n ts.mergeRuns();\n\n remaining -= runLength;\n lo += runLength;\n } while (remaining !== 0);\n\n ts.forceMergeRuns();\n }\n});\n","module.exports = require('./build/timsort.js');","/**\n * Helper classes for LayoutEngine.\n *\n * Strategy pattern for usage of direction methods for hierarchical layouts.\n */\n\nimport { sort as timsort } from \"timsort\";\n\n/**\n * Interface definition for direction strategy classes.\n *\n * This class describes the interface for the Strategy\n * pattern classes used to differentiate horizontal and vertical\n * direction of hierarchical results.\n *\n * For a given direction, one coordinate will be 'fixed', meaning that it is\n * determined by level.\n * The other coordinate is 'unfixed', meaning that the nodes on a given level\n * can still move along that coordinate. So:\n *\n * - `vertical` layout: `x` unfixed, `y` fixed per level\n * - `horizontal` layout: `x` fixed per level, `y` unfixed\n *\n * The local methods are stubs and should be regarded as abstract.\n * Derived classes **must** implement all the methods themselves.\n *\n * @private\n */\nclass DirectionInterface {\n /**\n * @ignore\n */\n abstract() {\n throw new Error(\"Can't instantiate abstract class!\");\n }\n\n /**\n * This is a dummy call which is used to suppress the jsdoc errors of type:\n *\n * \"'param' is assigned a value but never used\"\n *\n * @ignore\n **/\n fake_use() {\n // Do nothing special\n }\n\n /**\n * Type to use to translate dynamic curves to, in the case of hierarchical layout.\n * Dynamic curves do not work for these.\n *\n * The value should be perpendicular to the actual direction of the layout.\n *\n * @returns {string} Direction, either 'vertical' or 'horizontal'\n */\n curveType() {\n return this.abstract();\n }\n\n /**\n * Return the value of the coordinate that is not fixed for this direction.\n *\n * @param {Node} node The node to read\n * @returns {number} Value of the unfixed coordinate\n */\n getPosition(node) {\n this.fake_use(node);\n return this.abstract();\n }\n\n /**\n * Set the value of the coordinate that is not fixed for this direction.\n *\n * @param {Node} node The node to adjust\n * @param {number} position\n * @param {number} [level] if specified, the hierarchy level that this node should be fixed to\n */\n setPosition(node, position, level = undefined) {\n this.fake_use(node, position, level);\n this.abstract();\n }\n\n /**\n * Get the width of a tree.\n *\n * A `tree` here is a subset of nodes within the network which are not connected to other nodes,\n * only among themselves. In essence, it is a sub-network.\n *\n * @param {number} index The index number of a tree\n * @returns {number} the width of a tree in the view coordinates\n */\n getTreeSize(index) {\n this.fake_use(index);\n return this.abstract();\n }\n\n /**\n * Sort array of nodes on the unfixed coordinates.\n *\n * **Note:** chrome has non-stable sorting implementation, which\n * has a tendency to change the order of the array items,\n * even if the custom sort function returns 0.\n *\n * For this reason, an external sort implementation is used,\n * which has the added benefit of being faster than the standard\n * platforms implementation. This has been verified on `node.js`,\n * `firefox` and `chrome` (all linux).\n *\n * @param {Array.<Node>} nodeArray array of nodes to sort\n */\n sort(nodeArray) {\n this.fake_use(nodeArray);\n this.abstract();\n }\n\n /**\n * Assign the fixed coordinate of the node to the given level\n *\n * @param {Node} node The node to adjust\n * @param {number} level The level to fix to\n */\n fix(node, level) {\n this.fake_use(node, level);\n this.abstract();\n }\n\n /**\n * Add an offset to the unfixed coordinate of the given node.\n *\n * @param {NodeId} nodeId Id of the node to adjust\n * @param {number} diff Offset to add to the unfixed coordinate\n */\n shift(nodeId, diff) {\n this.fake_use(nodeId, diff);\n this.abstract();\n }\n}\n\n/**\n * Vertical Strategy\n *\n * Coordinate `y` is fixed on levels, coordinate `x` is unfixed.\n *\n * @augments DirectionInterface\n * @private\n */\nclass VerticalStrategy extends DirectionInterface {\n /**\n * Constructor\n *\n * @param {object} layout reference to the parent LayoutEngine instance.\n */\n constructor(layout) {\n super();\n this.layout = layout;\n }\n\n /** @inheritDoc */\n curveType() {\n return \"horizontal\";\n }\n\n /** @inheritDoc */\n getPosition(node) {\n return node.x;\n }\n\n /** @inheritDoc */\n setPosition(node, position, level = undefined) {\n if (level !== undefined) {\n this.layout.hierarchical.addToOrdering(node, level);\n }\n node.x = position;\n }\n\n /** @inheritDoc */\n getTreeSize(index) {\n const res = this.layout.hierarchical.getTreeSize(\n this.layout.body.nodes,\n index\n );\n return { min: res.min_x, max: res.max_x };\n }\n\n /** @inheritDoc */\n sort(nodeArray) {\n timsort(nodeArray, function (a, b) {\n return a.x - b.x;\n });\n }\n\n /** @inheritDoc */\n fix(node, level) {\n node.y = this.layout.options.hierarchical.levelSeparation * level;\n node.options.fixed.y = true;\n }\n\n /** @inheritDoc */\n shift(nodeId, diff) {\n this.layout.body.nodes[nodeId].x += diff;\n }\n}\n\n/**\n * Horizontal Strategy\n *\n * Coordinate `x` is fixed on levels, coordinate `y` is unfixed.\n *\n * @augments DirectionInterface\n * @private\n */\nclass HorizontalStrategy extends DirectionInterface {\n /**\n * Constructor\n *\n * @param {object} layout reference to the parent LayoutEngine instance.\n */\n constructor(layout) {\n super();\n this.layout = layout;\n }\n\n /** @inheritDoc */\n curveType() {\n return \"vertical\";\n }\n\n /** @inheritDoc */\n getPosition(node) {\n return node.y;\n }\n\n /** @inheritDoc */\n setPosition(node, position, level = undefined) {\n if (level !== undefined) {\n this.layout.hierarchical.addToOrdering(node, level);\n }\n node.y = position;\n }\n\n /** @inheritDoc */\n getTreeSize(index) {\n const res = this.layout.hierarchical.getTreeSize(\n this.layout.body.nodes,\n index\n );\n return { min: res.min_y, max: res.max_y };\n }\n\n /** @inheritDoc */\n sort(nodeArray) {\n timsort(nodeArray, function (a, b) {\n return a.y - b.y;\n });\n }\n\n /** @inheritDoc */\n fix(node, level) {\n node.x = this.layout.options.hierarchical.levelSeparation * level;\n node.options.fixed.x = true;\n }\n\n /** @inheritDoc */\n shift(nodeId, diff) {\n this.layout.body.nodes[nodeId].y += diff;\n }\n}\n\nexport { HorizontalStrategy, VerticalStrategy };\n","'use strict';\nvar $ = require('../internals/export');\nvar $every = require('../internals/array-iteration').every;\nvar arrayMethodIsStrict = require('../internals/array-method-is-strict');\n\nvar STRICT_METHOD = arrayMethodIsStrict('every');\n\n// `Array.prototype.every` method\n// https://tc39.es/ecma262/#sec-array.prototype.every\n$({ target: 'Array', proto: true, forced: !STRICT_METHOD }, {\n every: function every(callbackfn /* , thisArg */) {\n return $every(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);\n }\n});\n","require('../../../modules/es.array.every');\nvar entryVirtual = require('../../../internals/entry-virtual');\n\nmodule.exports = entryVirtual('Array').every;\n","var every = require('../array/virtual/every');\n\nvar ArrayPrototype = Array.prototype;\n\nmodule.exports = function (it) {\n var own = it.every;\n return it === ArrayPrototype || (it instanceof Array && own === ArrayPrototype.every) ? every : own;\n};\n","var parent = require('../../es/instance/every');\n\nmodule.exports = parent;\n","module.exports = require(\"core-js-pure/stable/instance/every\");","type Levels = Record<string | number, number>;\ntype Id = string | number;\ninterface Edge {\n connected: boolean;\n from: Node;\n fromId: Id;\n to: Node;\n toId: Id;\n}\ninterface Node {\n id: Id;\n edges: Edge[];\n}\n\n/**\n * Try to assign levels to nodes according to their positions in the cyclic “hierarchy”.\n *\n * @param nodes - Visible nodes of the graph.\n * @param levels - If present levels will be added to it, if not a new object will be created.\n *\n * @returns Populated node levels.\n */\nfunction fillLevelsByDirectionCyclic(\n nodes: Map<Id, Node>,\n levels: Levels\n): Levels {\n const edges = new Set<Edge>();\n nodes.forEach((node): void => {\n node.edges.forEach((edge): void => {\n if (edge.connected) {\n edges.add(edge);\n }\n });\n });\n\n edges.forEach((edge): void => {\n const fromId = edge.from.id;\n const toId = edge.to.id;\n\n if (levels[fromId] == null) {\n levels[fromId] = 0;\n }\n\n if (levels[toId] == null || levels[fromId] >= levels[toId]) {\n levels[toId] = levels[fromId] + 1;\n }\n });\n\n return levels;\n}\n\n/**\n * Assign levels to nodes according to their positions in the hierarchy. Leaves will be lined up at the bottom and all other nodes as close to their children as possible.\n *\n * @param nodes - Visible nodes of the graph.\n *\n * @returns Populated node levels.\n */\nexport function fillLevelsByDirectionLeaves(nodes: Map<Id, Node>): Levels {\n return fillLevelsByDirection(\n // Pick only leaves (nodes without children).\n (node): boolean =>\n node.edges\n // Take only visible nodes into account.\n .filter((edge): boolean => nodes.has(edge.toId))\n // Check that all edges lead to this node (leaf).\n .every((edge): boolean => edge.to === node),\n // Use the lowest level.\n (newLevel, oldLevel): boolean => oldLevel > newLevel,\n // Go against the direction of the edges.\n \"from\",\n nodes\n );\n}\n\n/**\n * Assign levels to nodes according to their positions in the hierarchy. Roots will be lined up at the top and all nodes as close to their parents as possible.\n *\n * @param nodes - Visible nodes of the graph.\n *\n * @returns Populated node levels.\n */\nexport function fillLevelsByDirectionRoots(nodes: Map<Id, Node>): Levels {\n return fillLevelsByDirection(\n // Pick only roots (nodes without parents).\n (node): boolean =>\n node.edges\n // Take only visible nodes into account.\n .filter((edge): boolean => nodes.has(edge.toId))\n // Check that all edges lead from this node (root).\n .every((edge): boolean => edge.from === node),\n // Use the highest level.\n (newLevel, oldLevel): boolean => oldLevel < newLevel,\n // Go in the direction of the edges.\n \"to\",\n nodes\n );\n}\n\n/**\n * Assign levels to nodes according to their positions in the hierarchy.\n *\n * @param isEntryNode - Checks and return true if the graph should be traversed from this node.\n * @param shouldLevelBeReplaced - Checks and returns true if the level of given node should be updated to the new value.\n * @param direction - Wheter the graph should be traversed in the direction of the edges `\"to\"` or in the other way `\"from\"`.\n * @param nodes - Visible nodes of the graph.\n *\n * @returns Populated node levels.\n */\nfunction fillLevelsByDirection(\n isEntryNode: (node: Node) => boolean,\n shouldLevelBeReplaced: (newLevel: number, oldLevel: number) => boolean,\n direction: \"to\" | \"from\",\n nodes: Map<Id, Node>\n): Levels {\n const levels = Object.create(null);\n\n // If acyclic, the graph can be walked through with (most likely way) fewer\n // steps than the number bellow. The exact value isn't too important as long\n // as it's quick to compute (doesn't impact acyclic graphs too much), is\n // higher than the number of steps actually needed (doesn't cut off before\n // acyclic graph is walked through) and prevents infinite loops (cuts off for\n // cyclic graphs).\n const limit = [...nodes.values()].reduce<number>(\n (acc, node): number => acc + 1 + node.edges.length,\n 0\n );\n\n const edgeIdProp: \"fromId\" | \"toId\" = (direction + \"Id\") as \"fromId\" | \"toId\";\n const newLevelDiff = direction === \"to\" ? 1 : -1;\n\n for (const [entryNodeId, entryNode] of nodes) {\n if (\n // Skip if the node is not visible.\n !nodes.has(entryNodeId) ||\n // Skip if the node is not an entry node.\n !isEntryNode(entryNode)\n ) {\n continue;\n }\n\n // Line up all the entry nodes on level 0.\n levels[entryNodeId] = 0;\n\n const stack: Node[] = [entryNode];\n let done = 0;\n let node: Node | undefined;\n while ((node = stack.pop())) {\n if (!nodes.has(entryNodeId)) {\n // Skip if the node is not visible.\n continue;\n }\n\n const newLevel = levels[node.id] + newLevelDiff;\n\n node.edges\n .filter(\n (edge): boolean =>\n // Ignore disconnected edges.\n edge.connected &&\n // Ignore circular edges.\n edge.to !== edge.from &&\n // Ignore edges leading to the node that's currently being processed.\n edge[direction] !== node &&\n // Ignore edges connecting to an invisible node.\n nodes.has(edge.toId) &&\n // Ignore edges connecting from an invisible node.\n nodes.has(edge.fromId)\n )\n .forEach((edge): void => {\n const targetNodeId = edge[edgeIdProp];\n const oldLevel = levels[targetNodeId];\n\n if (oldLevel == null || shouldLevelBeReplaced(newLevel, oldLevel)) {\n levels[targetNodeId] = newLevel;\n stack.push(edge[direction]);\n }\n });\n\n if (done > limit) {\n // This would run forever on a cyclic graph.\n return fillLevelsByDirectionCyclic(nodes, levels);\n } else {\n ++done;\n }\n }\n }\n\n return levels;\n}\n","/**\n * There's a mix-up with terms in the code. Following are the formal definitions:\n *\n * tree - a strict hierarchical network, i.e. every node has at most one parent\n * forest - a collection of trees. These distinct trees are thus not connected.\n *\n * So:\n * - in a network that is not a tree, there exist nodes with multiple parents.\n * - a network consisting of unconnected sub-networks, of which at least one\n * is not a tree, is not a forest.\n *\n * In the code, the definitions are:\n *\n * tree - any disconnected sub-network, strict hierarchical or not.\n * forest - a bunch of these sub-networks\n *\n * The difference between tree and not-tree is important in the code, notably within\n * to the block-shifting algorithm. The algorithm assumes formal trees and fails\n * for not-trees, often in a spectacular manner (search for 'exploding network' in the issues).\n *\n * In order to distinguish the definitions in the following code, the adjective 'formal' is\n * used. If 'formal' is absent, you must assume the non-formal definition.\n *\n * ----------------------------------------------------------------------------------\n * NOTES\n * =====\n *\n * A hierarchical layout is a different thing from a hierarchical network.\n * The layout is a way to arrange the nodes in the view; this can be done\n * on non-hierarchical networks as well. The converse is also possible.\n */\n\"use strict\";\nimport TimSort from \"timsort\";\nimport {\n Alea,\n deepExtend,\n forEach,\n mergeOptions,\n selectiveDeepExtend,\n} from \"vis-util/esnext\";\nimport NetworkUtil from \"../NetworkUtil\";\nimport {\n HorizontalStrategy,\n VerticalStrategy,\n} from \"./components/DirectionStrategy.js\";\nimport {\n fillLevelsByDirectionLeaves,\n fillLevelsByDirectionRoots,\n} from \"./layout-engine\";\n\n/**\n * Container for derived data on current network, relating to hierarchy.\n *\n * @private\n */\nclass HierarchicalStatus {\n /**\n * @ignore\n */\n constructor() {\n this.childrenReference = {}; // child id's per node id\n this.parentReference = {}; // parent id's per node id\n this.trees = {}; // tree id per node id; i.e. to which tree does given node id belong\n\n this.distributionOrdering = {}; // The nodes per level, in the display order\n this.levels = {}; // hierarchy level per node id\n this.distributionIndex = {}; // The position of the node in the level sorting order, per node id.\n\n this.isTree = false; // True if current network is a formal tree\n this.treeIndex = -1; // Highest tree id in current network.\n }\n\n /**\n * Add the relation between given nodes to the current state.\n *\n * @param {Node.id} parentNodeId\n * @param {Node.id} childNodeId\n */\n addRelation(parentNodeId, childNodeId) {\n if (this.childrenReference[parentNodeId] === undefined) {\n this.childrenReference[parentNodeId] = [];\n }\n this.childrenReference[parentNodeId].push(childNodeId);\n\n if (this.parentReference[childNodeId] === undefined) {\n this.parentReference[childNodeId] = [];\n }\n this.parentReference[childNodeId].push(parentNodeId);\n }\n\n /**\n * Check if the current state is for a formal tree or formal forest.\n *\n * This is the case if every node has at most one parent.\n *\n * Pre: parentReference init'ed properly for current network\n */\n checkIfTree() {\n for (const i in this.parentReference) {\n if (this.parentReference[i].length > 1) {\n this.isTree = false;\n return;\n }\n }\n\n this.isTree = true;\n }\n\n /**\n * Return the number of separate trees in the current network.\n *\n * @returns {number}\n */\n numTrees() {\n return this.treeIndex + 1; // This assumes the indexes are assigned consecitively\n }\n\n /**\n * Assign a tree id to a node\n *\n * @param {Node} node\n * @param {string|number} treeId\n */\n setTreeIndex(node, treeId) {\n if (treeId === undefined) return; // Don't bother\n\n if (this.trees[node.id] === undefined) {\n this.trees[node.id] = treeId;\n this.treeIndex = Math.max(treeId, this.treeIndex);\n }\n }\n\n /**\n * Ensure level for given id is defined.\n *\n * Sets level to zero for given node id if not already present\n *\n * @param {Node.id} nodeId\n */\n ensureLevel(nodeId) {\n if (this.levels[nodeId] === undefined) {\n this.levels[nodeId] = 0;\n }\n }\n\n /**\n * get the maximum level of a branch.\n *\n * TODO: Never entered; find a test case to test this!\n *\n * @param {Node.id} nodeId\n * @returns {number}\n */\n getMaxLevel(nodeId) {\n const accumulator = {};\n\n const _getMaxLevel = (nodeId) => {\n if (accumulator[nodeId] !== undefined) {\n return accumulator[nodeId];\n }\n let level = this.levels[nodeId];\n if (this.childrenReference[nodeId]) {\n const children = this.childrenReference[nodeId];\n if (children.length > 0) {\n for (let i = 0; i < children.length; i++) {\n level = Math.max(level, _getMaxLevel(children[i]));\n }\n }\n }\n accumulator[nodeId] = level;\n return level;\n };\n\n return _getMaxLevel(nodeId);\n }\n\n /**\n *\n * @param {Node} nodeA\n * @param {Node} nodeB\n */\n levelDownstream(nodeA, nodeB) {\n if (this.levels[nodeB.id] === undefined) {\n // set initial level\n if (this.levels[nodeA.id] === undefined) {\n this.levels[nodeA.id] = 0;\n }\n // set level\n this.levels[nodeB.id] = this.levels[nodeA.id] + 1;\n }\n }\n\n /**\n * Small util method to set the minimum levels of the nodes to zero.\n *\n * @param {Array.<Node>} nodes\n */\n setMinLevelToZero(nodes) {\n let minLevel = 1e9;\n // get the minimum level\n for (const nodeId in nodes) {\n if (Object.prototype.hasOwnProperty.call(nodes, nodeId)) {\n if (this.levels[nodeId] !== undefined) {\n minLevel = Math.min(this.levels[nodeId], minLevel);\n }\n }\n }\n\n // subtract the minimum from the set so we have a range starting from 0\n for (const nodeId in nodes) {\n if (Object.prototype.hasOwnProperty.call(nodes, nodeId)) {\n if (this.levels[nodeId] !== undefined) {\n this.levels[nodeId] -= minLevel;\n }\n }\n }\n }\n\n /**\n * Get the min and max xy-coordinates of a given tree\n *\n * @param {Array.<Node>} nodes\n * @param {number} index\n * @returns {{min_x: number, max_x: number, min_y: number, max_y: number}}\n */\n getTreeSize(nodes, index) {\n let min_x = 1e9;\n let max_x = -1e9;\n let min_y = 1e9;\n let max_y = -1e9;\n\n for (const nodeId in this.trees) {\n if (Object.prototype.hasOwnProperty.call(this.trees, nodeId)) {\n if (this.trees[nodeId] === index) {\n const node = nodes[nodeId];\n min_x = Math.min(node.x, min_x);\n max_x = Math.max(node.x, max_x);\n min_y = Math.min(node.y, min_y);\n max_y = Math.max(node.y, max_y);\n }\n }\n }\n\n return {\n min_x: min_x,\n max_x: max_x,\n min_y: min_y,\n max_y: max_y,\n };\n }\n\n /**\n * Check if two nodes have the same parent(s)\n *\n * @param {Node} node1\n * @param {Node} node2\n * @returns {boolean} true if the two nodes have a same ancestor node, false otherwise\n */\n hasSameParent(node1, node2) {\n const parents1 = this.parentReference[node1.id];\n const parents2 = this.parentReference[node2.id];\n if (parents1 === undefined || parents2 === undefined) {\n return false;\n }\n\n for (let i = 0; i < parents1.length; i++) {\n for (let j = 0; j < parents2.length; j++) {\n if (parents1[i] == parents2[j]) {\n return true;\n }\n }\n }\n return false;\n }\n\n /**\n * Check if two nodes are in the same tree.\n *\n * @param {Node} node1\n * @param {Node} node2\n * @returns {boolean} true if this is so, false otherwise\n */\n inSameSubNetwork(node1, node2) {\n return this.trees[node1.id] === this.trees[node2.id];\n }\n\n /**\n * Get a list of the distinct levels in the current network\n *\n * @returns {Array}\n */\n getLevels() {\n return Object.keys(this.distributionOrdering);\n }\n\n /**\n * Add a node to the ordering per level\n *\n * @param {Node} node\n * @param {number} level\n */\n addToOrdering(node, level) {\n if (this.distributionOrdering[level] === undefined) {\n this.distributionOrdering[level] = [];\n }\n\n let isPresent = false;\n const curLevel = this.distributionOrdering[level];\n for (const n in curLevel) {\n //if (curLevel[n].id === node.id) {\n if (curLevel[n] === node) {\n isPresent = true;\n break;\n }\n }\n\n if (!isPresent) {\n this.distributionOrdering[level].push(node);\n this.distributionIndex[node.id] =\n this.distributionOrdering[level].length - 1;\n }\n }\n}\n\n/**\n * The Layout Engine\n */\nclass LayoutEngine {\n /**\n * @param {object} body\n */\n constructor(body) {\n this.body = body;\n\n // Make sure there always is some RNG because the setOptions method won't\n // set it unless there's a seed for it.\n this._resetRNG(Math.random() + \":\" + Date.now());\n\n this.setPhysics = false;\n this.options = {};\n this.optionsBackup = { physics: {} };\n\n this.defaultOptions = {\n randomSeed: undefined,\n improvedLayout: true,\n clusterThreshold: 150,\n hierarchical: {\n enabled: false,\n levelSeparation: 150,\n nodeSpacing: 100,\n treeSpacing: 200,\n blockShifting: true,\n edgeMinimization: true,\n parentCentralization: true,\n direction: \"UD\", // UD, DU, LR, RL\n sortMethod: \"hubsize\", // hubsize, directed\n },\n };\n Object.assign(this.options, this.defaultOptions);\n this.bindEventListeners();\n }\n\n /**\n * Binds event listeners\n */\n bindEventListeners() {\n this.body.emitter.on(\"_dataChanged\", () => {\n this.setupHierarchicalLayout();\n });\n this.body.emitter.on(\"_dataLoaded\", () => {\n this.layoutNetwork();\n });\n this.body.emitter.on(\"_resetHierarchicalLayout\", () => {\n this.setupHierarchicalLayout();\n });\n this.body.emitter.on(\"_adjustEdgesForHierarchicalLayout\", () => {\n if (this.options.hierarchical.enabled !== true) {\n return;\n }\n // get the type of static smooth curve in case it is required\n const type = this.direction.curveType();\n\n // force all edges into static smooth curves.\n this.body.emitter.emit(\"_forceDisableDynamicCurves\", type, false);\n });\n }\n\n /**\n *\n * @param {object} options\n * @param {object} allOptions\n * @returns {object}\n */\n setOptions(options, allOptions) {\n if (options !== undefined) {\n const hierarchical = this.options.hierarchical;\n const prevHierarchicalState = hierarchical.enabled;\n selectiveDeepExtend(\n [\"randomSeed\", \"improvedLayout\", \"clusterThreshold\"],\n this.options,\n options\n );\n mergeOptions(this.options, options, \"hierarchical\");\n\n if (options.randomSeed !== undefined) {\n this._resetRNG(options.randomSeed);\n }\n\n if (hierarchical.enabled === true) {\n if (prevHierarchicalState === true) {\n // refresh the overridden options for nodes and edges.\n this.body.emitter.emit(\"refresh\", true);\n }\n\n // make sure the level separation is the right way up\n if (\n hierarchical.direction === \"RL\" ||\n hierarchical.direction === \"DU\"\n ) {\n if (hierarchical.levelSeparation > 0) {\n hierarchical.levelSeparation *= -1;\n }\n } else {\n if (hierarchical.levelSeparation < 0) {\n hierarchical.levelSeparation *= -1;\n }\n }\n\n this.setDirectionStrategy();\n\n this.body.emitter.emit(\"_resetHierarchicalLayout\");\n // because the hierarchical system needs it's own physics and smooth curve settings,\n // we adapt the other options if needed.\n return this.adaptAllOptionsForHierarchicalLayout(allOptions);\n } else {\n if (prevHierarchicalState === true) {\n // refresh the overridden options for nodes and edges.\n this.body.emitter.emit(\"refresh\");\n return deepExtend(allOptions, this.optionsBackup);\n }\n }\n }\n return allOptions;\n }\n\n /**\n * Reset the random number generator with given seed.\n *\n * @param {any} seed - The seed that will be forwarded the the RNG.\n */\n _resetRNG(seed) {\n this.initialRandomSeed = seed;\n this._rng = Alea(this.initialRandomSeed);\n }\n\n /**\n *\n * @param {object} allOptions\n * @returns {object}\n */\n adaptAllOptionsForHierarchicalLayout(allOptions) {\n if (this.options.hierarchical.enabled === true) {\n const backupPhysics = this.optionsBackup.physics;\n\n // set the physics\n if (allOptions.physics === undefined || allOptions.physics === true) {\n allOptions.physics = {\n enabled:\n backupPhysics.enabled === undefined ? true : backupPhysics.enabled,\n solver: \"hierarchicalRepulsion\",\n };\n backupPhysics.enabled =\n backupPhysics.enabled === undefined ? true : backupPhysics.enabled;\n backupPhysics.solver = backupPhysics.solver || \"barnesHut\";\n } else if (typeof allOptions.physics === \"object\") {\n backupPhysics.enabled =\n allOptions.physics.enabled === undefined\n ? true\n : allOptions.physics.enabled;\n backupPhysics.solver = allOptions.physics.solver || \"barnesHut\";\n allOptions.physics.solver = \"hierarchicalRepulsion\";\n } else if (allOptions.physics !== false) {\n backupPhysics.solver = \"barnesHut\";\n allOptions.physics = { solver: \"hierarchicalRepulsion\" };\n }\n\n // get the type of static smooth curve in case it is required\n let type = this.direction.curveType();\n\n // disable smooth curves if nothing is defined. If smooth curves have been turned on,\n // turn them into static smooth curves.\n if (allOptions.edges === undefined) {\n this.optionsBackup.edges = {\n smooth: { enabled: true, type: \"dynamic\" },\n };\n allOptions.edges = { smooth: false };\n } else if (allOptions.edges.smooth === undefined) {\n this.optionsBackup.edges = {\n smooth: { enabled: true, type: \"dynamic\" },\n };\n allOptions.edges.smooth = false;\n } else {\n if (typeof allOptions.edges.smooth === \"boolean\") {\n this.optionsBackup.edges = { smooth: allOptions.edges.smooth };\n allOptions.edges.smooth = {\n enabled: allOptions.edges.smooth,\n type: type,\n };\n } else {\n const smooth = allOptions.edges.smooth;\n\n // allow custom types except for dynamic\n if (smooth.type !== undefined && smooth.type !== \"dynamic\") {\n type = smooth.type;\n }\n\n // TODO: this is options merging; see if the standard routines can be used here.\n this.optionsBackup.edges = {\n smooth: {\n enabled: smooth.enabled === undefined ? true : smooth.enabled,\n type: smooth.type === undefined ? \"dynamic\" : smooth.type,\n roundness:\n smooth.roundness === undefined ? 0.5 : smooth.roundness,\n forceDirection:\n smooth.forceDirection === undefined\n ? false\n : smooth.forceDirection,\n },\n };\n\n // NOTE: Copying an object to self; this is basically setting defaults for undefined variables\n allOptions.edges.smooth = {\n enabled: smooth.enabled === undefined ? true : smooth.enabled,\n type: type,\n roundness: smooth.roundness === undefined ? 0.5 : smooth.roundness,\n forceDirection:\n smooth.forceDirection === undefined\n ? false\n : smooth.forceDirection,\n };\n }\n }\n\n // Force all edges into static smooth curves.\n // Only applies to edges that do not use the global options for smooth.\n this.body.emitter.emit(\"_forceDisableDynamicCurves\", type);\n }\n\n return allOptions;\n }\n\n /**\n *\n * @param {Array.<Node>} nodesArray\n */\n positionInitially(nodesArray) {\n if (this.options.hierarchical.enabled !== true) {\n this._resetRNG(this.initialRandomSeed);\n const radius = nodesArray.length + 50;\n for (let i = 0; i < nodesArray.length; i++) {\n const node = nodesArray[i];\n const angle = 2 * Math.PI * this._rng();\n if (node.x === undefined) {\n node.x = radius * Math.cos(angle);\n }\n if (node.y === undefined) {\n node.y = radius * Math.sin(angle);\n }\n }\n }\n }\n\n /**\n * Use Kamada Kawai to position nodes. This is quite a heavy algorithm so if there are a lot of nodes we\n * cluster them first to reduce the amount.\n */\n layoutNetwork() {\n if (\n this.options.hierarchical.enabled !== true &&\n this.options.improvedLayout === true\n ) {\n const indices = this.body.nodeIndices;\n\n // first check if we should Kamada Kawai to layout. The threshold is if less than half of the visible\n // nodes have predefined positions we use this.\n let positionDefined = 0;\n for (let i = 0; i < indices.length; i++) {\n const node = this.body.nodes[indices[i]];\n if (node.predefinedPosition === true) {\n positionDefined += 1;\n }\n }\n\n // if less than half of the nodes have a predefined position we continue\n if (positionDefined < 0.5 * indices.length) {\n const MAX_LEVELS = 10;\n let level = 0;\n const clusterThreshold = this.options.clusterThreshold;\n\n //\n // Define the options for the hidden cluster nodes\n // These options don't propagate outside the clustering phase.\n //\n // Some options are explicitly disabled, because they may be set in group or default node options.\n // The clusters are never displayed, so most explicit settings here serve as performance optimizations.\n //\n // The explicit setting of 'shape' is to avoid `shape: 'image'`; images are not passed to the hidden\n // cluster nodes, leading to an exception on creation.\n //\n // All settings here are performance related, except when noted otherwise.\n //\n const clusterOptions = {\n clusterNodeProperties: {\n shape: \"ellipse\", // Bugfix: avoid type 'image', no images supplied\n label: \"\", // avoid label handling\n group: \"\", // avoid group handling\n font: { multi: false }, // avoid font propagation\n },\n clusterEdgeProperties: {\n label: \"\", // avoid label handling\n font: { multi: false }, // avoid font propagation\n smooth: {\n enabled: false, // avoid drawing penalty for complex edges\n },\n },\n };\n\n // if there are a lot of nodes, we cluster before we run the algorithm.\n // NOTE: this part fails to find clusters for large scale-free networks, which should\n // be easily clusterable.\n // TODO: examine why this is so\n if (indices.length > clusterThreshold) {\n const startLength = indices.length;\n while (indices.length > clusterThreshold && level <= MAX_LEVELS) {\n //console.time(\"clustering\")\n level += 1;\n const before = indices.length;\n // if there are many nodes we do a hubsize cluster\n if (level % 3 === 0) {\n this.body.modules.clustering.clusterBridges(clusterOptions);\n } else {\n this.body.modules.clustering.clusterOutliers(clusterOptions);\n }\n const after = indices.length;\n if (before == after && level % 3 !== 0) {\n this._declusterAll();\n this.body.emitter.emit(\"_layoutFailed\");\n console.info(\n \"This network could not be positioned by this version of the improved layout algorithm.\" +\n \" Please disable improvedLayout for better performance.\"\n );\n return;\n }\n //console.timeEnd(\"clustering\")\n //console.log(before,level,after);\n }\n // increase the size of the edges\n this.body.modules.kamadaKawai.setOptions({\n springLength: Math.max(150, 2 * startLength),\n });\n }\n if (level > MAX_LEVELS) {\n console.info(\n \"The clustering didn't succeed within the amount of interations allowed,\" +\n \" progressing with partial result.\"\n );\n }\n\n // position the system for these nodes and edges\n this.body.modules.kamadaKawai.solve(\n indices,\n this.body.edgeIndices,\n true\n );\n\n // shift to center point\n this._shiftToCenter();\n\n // perturb the nodes a little bit to force the physics to kick in\n const offset = 70;\n for (let i = 0; i < indices.length; i++) {\n // Only perturb the nodes that aren't fixed\n const node = this.body.nodes[indices[i]];\n if (node.predefinedPosition === false) {\n node.x += (0.5 - this._rng()) * offset;\n node.y += (0.5 - this._rng()) * offset;\n }\n }\n\n // uncluster all clusters\n this._declusterAll();\n\n // reposition all bezier nodes.\n this.body.emitter.emit(\"_repositionBezierNodes\");\n }\n }\n }\n\n /**\n * Move all the nodes towards to the center so gravitational pull wil not move the nodes away from view\n *\n * @private\n */\n _shiftToCenter() {\n const range = NetworkUtil.getRangeCore(\n this.body.nodes,\n this.body.nodeIndices\n );\n const center = NetworkUtil.findCenter(range);\n for (let i = 0; i < this.body.nodeIndices.length; i++) {\n const node = this.body.nodes[this.body.nodeIndices[i]];\n node.x -= center.x;\n node.y -= center.y;\n }\n }\n\n /**\n * Expands all clusters\n *\n * @private\n */\n _declusterAll() {\n let clustersPresent = true;\n while (clustersPresent === true) {\n clustersPresent = false;\n for (let i = 0; i < this.body.nodeIndices.length; i++) {\n if (this.body.nodes[this.body.nodeIndices[i]].isCluster === true) {\n clustersPresent = true;\n this.body.modules.clustering.openCluster(\n this.body.nodeIndices[i],\n {},\n false\n );\n }\n }\n if (clustersPresent === true) {\n this.body.emitter.emit(\"_dataChanged\");\n }\n }\n }\n\n /**\n *\n * @returns {number|*}\n */\n getSeed() {\n return this.initialRandomSeed;\n }\n\n /**\n * This is the main function to layout the nodes in a hierarchical way.\n * It checks if the node details are supplied correctly\n *\n * @private\n */\n setupHierarchicalLayout() {\n if (\n this.options.hierarchical.enabled === true &&\n this.body.nodeIndices.length > 0\n ) {\n // get the size of the largest hubs and check if the user has defined a level for a node.\n let node, nodeId;\n let definedLevel = false;\n let undefinedLevel = false;\n this.lastNodeOnLevel = {};\n this.hierarchical = new HierarchicalStatus();\n\n for (nodeId in this.body.nodes) {\n if (Object.prototype.hasOwnProperty.call(this.body.nodes, nodeId)) {\n node = this.body.nodes[nodeId];\n if (node.options.level !== undefined) {\n definedLevel = true;\n this.hierarchical.levels[nodeId] = node.options.level;\n } else {\n undefinedLevel = true;\n }\n }\n }\n\n // if the user defined some levels but not all, alert and run without hierarchical layout\n if (undefinedLevel === true && definedLevel === true) {\n throw new Error(\n \"To use the hierarchical layout, nodes require either no predefined levels\" +\n \" or levels have to be defined for all nodes.\"\n );\n } else {\n // define levels if undefined by the users. Based on hubsize.\n if (undefinedLevel === true) {\n const sortMethod = this.options.hierarchical.sortMethod;\n if (sortMethod === \"hubsize\") {\n this._determineLevelsByHubsize();\n } else if (sortMethod === \"directed\") {\n this._determineLevelsDirected();\n } else if (sortMethod === \"custom\") {\n this._determineLevelsCustomCallback();\n }\n }\n\n // fallback for cases where there are nodes but no edges\n for (const nodeId in this.body.nodes) {\n if (Object.prototype.hasOwnProperty.call(this.body.nodes, nodeId)) {\n this.hierarchical.ensureLevel(nodeId);\n }\n }\n // check the distribution of the nodes per level.\n const distribution = this._getDistribution();\n\n // get the parent children relations.\n this._generateMap();\n\n // place the nodes on the canvas.\n this._placeNodesByHierarchy(distribution);\n\n // condense the whitespace.\n this._condenseHierarchy();\n\n // shift to center so gravity does not have to do much\n this._shiftToCenter();\n }\n }\n }\n\n /**\n * @private\n */\n _condenseHierarchy() {\n // Global var in this scope to define when the movement has stopped.\n let stillShifting = false;\n const branches = {};\n // first we have some methods to help shifting trees around.\n // the main method to shift the trees\n const shiftTrees = () => {\n const treeSizes = getTreeSizes();\n let shiftBy = 0;\n for (let i = 0; i < treeSizes.length - 1; i++) {\n const diff = treeSizes[i].max - treeSizes[i + 1].min;\n shiftBy += diff + this.options.hierarchical.treeSpacing;\n shiftTree(i + 1, shiftBy);\n }\n };\n\n // shift a single tree by an offset\n const shiftTree = (index, offset) => {\n const trees = this.hierarchical.trees;\n\n for (const nodeId in trees) {\n if (Object.prototype.hasOwnProperty.call(trees, nodeId)) {\n if (trees[nodeId] === index) {\n this.direction.shift(nodeId, offset);\n }\n }\n }\n };\n\n // get the width of all trees\n const getTreeSizes = () => {\n const treeWidths = [];\n for (let i = 0; i < this.hierarchical.numTrees(); i++) {\n treeWidths.push(this.direction.getTreeSize(i));\n }\n return treeWidths;\n };\n\n // get a map of all nodes in this branch\n const getBranchNodes = (source, map) => {\n if (map[source.id]) {\n return;\n }\n map[source.id] = true;\n if (this.hierarchical.childrenReference[source.id]) {\n const children = this.hierarchical.childrenReference[source.id];\n if (children.length > 0) {\n for (let i = 0; i < children.length; i++) {\n getBranchNodes(this.body.nodes[children[i]], map);\n }\n }\n }\n };\n\n // get a min max width as well as the maximum movement space it has on either sides\n // we use min max terminology because width and height can interchange depending on the direction of the layout\n const getBranchBoundary = (branchMap, maxLevel = 1e9) => {\n let minSpace = 1e9;\n let maxSpace = 1e9;\n let min = 1e9;\n let max = -1e9;\n for (const branchNode in branchMap) {\n if (Object.prototype.hasOwnProperty.call(branchMap, branchNode)) {\n const node = this.body.nodes[branchNode];\n const level = this.hierarchical.levels[node.id];\n const position = this.direction.getPosition(node);\n\n // get the space around the node.\n const [minSpaceNode, maxSpaceNode] = this._getSpaceAroundNode(\n node,\n branchMap\n );\n minSpace = Math.min(minSpaceNode, minSpace);\n maxSpace = Math.min(maxSpaceNode, maxSpace);\n\n // the width is only relevant for the levels two nodes have in common. This is why we filter on this.\n if (level <= maxLevel) {\n min = Math.min(position, min);\n max = Math.max(position, max);\n }\n }\n }\n\n return [min, max, minSpace, maxSpace];\n };\n\n // check what the maximum level is these nodes have in common.\n const getCollisionLevel = (node1, node2) => {\n const maxLevel1 = this.hierarchical.getMaxLevel(node1.id);\n const maxLevel2 = this.hierarchical.getMaxLevel(node2.id);\n return Math.min(maxLevel1, maxLevel2);\n };\n\n /**\n * Condense elements. These can be nodes or branches depending on the callback.\n *\n * @param {Function} callback\n * @param {Array.<number>} levels\n * @param {*} centerParents\n */\n const shiftElementsCloser = (callback, levels, centerParents) => {\n const hier = this.hierarchical;\n\n for (let i = 0; i < levels.length; i++) {\n const level = levels[i];\n const levelNodes = hier.distributionOrdering[level];\n if (levelNodes.length > 1) {\n for (let j = 0; j < levelNodes.length - 1; j++) {\n const node1 = levelNodes[j];\n const node2 = levelNodes[j + 1];\n\n // NOTE: logic maintained as it was; if nodes have same ancestor,\n // then of course they are in the same sub-network.\n if (\n hier.hasSameParent(node1, node2) &&\n hier.inSameSubNetwork(node1, node2)\n ) {\n callback(node1, node2, centerParents);\n }\n }\n }\n }\n };\n\n // callback for shifting branches\n const branchShiftCallback = (node1, node2, centerParent = false) => {\n //window.CALLBACKS.push(() => {\n const pos1 = this.direction.getPosition(node1);\n const pos2 = this.direction.getPosition(node2);\n const diffAbs = Math.abs(pos2 - pos1);\n const nodeSpacing = this.options.hierarchical.nodeSpacing;\n //console.log(\"NOW CHECKING:\", node1.id, node2.id, diffAbs);\n if (diffAbs > nodeSpacing) {\n const branchNodes1 = {};\n const branchNodes2 = {};\n\n getBranchNodes(node1, branchNodes1);\n getBranchNodes(node2, branchNodes2);\n\n // check the largest distance between the branches\n const maxLevel = getCollisionLevel(node1, node2);\n const branchNodeBoundary1 = getBranchBoundary(branchNodes1, maxLevel);\n const branchNodeBoundary2 = getBranchBoundary(branchNodes2, maxLevel);\n const max1 = branchNodeBoundary1[1];\n const min2 = branchNodeBoundary2[0];\n const minSpace2 = branchNodeBoundary2[2];\n\n //console.log(node1.id, getBranchBoundary(branchNodes1, maxLevel), node2.id,\n // getBranchBoundary(branchNodes2, maxLevel), maxLevel);\n const diffBranch = Math.abs(max1 - min2);\n if (diffBranch > nodeSpacing) {\n let offset = max1 - min2 + nodeSpacing;\n if (offset < -minSpace2 + nodeSpacing) {\n offset = -minSpace2 + nodeSpacing;\n //console.log(\"RESETTING OFFSET\", max1 - min2 + this.options.hierarchical.nodeSpacing, -minSpace2, offset);\n }\n if (offset < 0) {\n //console.log(\"SHIFTING\", node2.id, offset);\n this._shiftBlock(node2.id, offset);\n stillShifting = true;\n\n if (centerParent === true) this._centerParent(node2);\n }\n }\n }\n //this.body.emitter.emit(\"_redraw\");})\n };\n\n const minimizeEdgeLength = (iterations, node) => {\n //window.CALLBACKS.push(() => {\n // console.log(\"ts\",node.id);\n const nodeId = node.id;\n const allEdges = node.edges;\n const nodeLevel = this.hierarchical.levels[node.id];\n\n // gather constants\n const C2 =\n this.options.hierarchical.levelSeparation *\n this.options.hierarchical.levelSeparation;\n const referenceNodes = {};\n const aboveEdges = [];\n for (let i = 0; i < allEdges.length; i++) {\n const edge = allEdges[i];\n if (edge.toId != edge.fromId) {\n const otherNode = edge.toId == nodeId ? edge.from : edge.to;\n referenceNodes[allEdges[i].id] = otherNode;\n if (this.hierarchical.levels[otherNode.id] < nodeLevel) {\n aboveEdges.push(edge);\n }\n }\n }\n\n // differentiated sum of lengths based on only moving one node over one axis\n const getFx = (point, edges) => {\n let sum = 0;\n for (let i = 0; i < edges.length; i++) {\n if (referenceNodes[edges[i].id] !== undefined) {\n const a =\n this.direction.getPosition(referenceNodes[edges[i].id]) - point;\n sum += a / Math.sqrt(a * a + C2);\n }\n }\n return sum;\n };\n\n // doubly differentiated sum of lengths based on only moving one node over one axis\n const getDFx = (point, edges) => {\n let sum = 0;\n for (let i = 0; i < edges.length; i++) {\n if (referenceNodes[edges[i].id] !== undefined) {\n const a =\n this.direction.getPosition(referenceNodes[edges[i].id]) - point;\n sum -= C2 * Math.pow(a * a + C2, -1.5);\n }\n }\n return sum;\n };\n\n const getGuess = (iterations, edges) => {\n let guess = this.direction.getPosition(node);\n // Newton's method for optimization\n const guessMap = {};\n for (let i = 0; i < iterations; i++) {\n const fx = getFx(guess, edges);\n const dfx = getDFx(guess, edges);\n\n // we limit the movement to avoid instability.\n const limit = 40;\n const ratio = Math.max(-limit, Math.min(limit, Math.round(fx / dfx)));\n guess = guess - ratio;\n // reduce duplicates\n if (guessMap[guess] !== undefined) {\n break;\n }\n guessMap[guess] = i;\n }\n return guess;\n };\n\n const moveBranch = (guess) => {\n // position node if there is space\n const nodePosition = this.direction.getPosition(node);\n\n // check movable area of the branch\n if (branches[node.id] === undefined) {\n const branchNodes = {};\n getBranchNodes(node, branchNodes);\n branches[node.id] = branchNodes;\n }\n const branchBoundary = getBranchBoundary(branches[node.id]);\n const minSpaceBranch = branchBoundary[2];\n const maxSpaceBranch = branchBoundary[3];\n\n const diff = guess - nodePosition;\n\n // check if we are allowed to move the node:\n let branchOffset = 0;\n if (diff > 0) {\n branchOffset = Math.min(\n diff,\n maxSpaceBranch - this.options.hierarchical.nodeSpacing\n );\n } else if (diff < 0) {\n branchOffset = -Math.min(\n -diff,\n minSpaceBranch - this.options.hierarchical.nodeSpacing\n );\n }\n\n if (branchOffset != 0) {\n //console.log(\"moving branch:\",branchOffset, maxSpaceBranch, minSpaceBranch)\n this._shiftBlock(node.id, branchOffset);\n //this.body.emitter.emit(\"_redraw\");\n stillShifting = true;\n }\n };\n\n const moveNode = (guess) => {\n const nodePosition = this.direction.getPosition(node);\n\n // position node if there is space\n const [minSpace, maxSpace] = this._getSpaceAroundNode(node);\n const diff = guess - nodePosition;\n // check if we are allowed to move the node:\n let newPosition = nodePosition;\n if (diff > 0) {\n newPosition = Math.min(\n nodePosition + (maxSpace - this.options.hierarchical.nodeSpacing),\n guess\n );\n } else if (diff < 0) {\n newPosition = Math.max(\n nodePosition - (minSpace - this.options.hierarchical.nodeSpacing),\n guess\n );\n }\n\n if (newPosition !== nodePosition) {\n //console.log(\"moving Node:\",diff, minSpace, maxSpace);\n this.direction.setPosition(node, newPosition);\n //this.body.emitter.emit(\"_redraw\");\n stillShifting = true;\n }\n };\n\n let guess = getGuess(iterations, aboveEdges);\n moveBranch(guess);\n guess = getGuess(iterations, allEdges);\n moveNode(guess);\n //})\n };\n\n // method to remove whitespace between branches. Because we do bottom up, we can center the parents.\n const minimizeEdgeLengthBottomUp = (iterations) => {\n let levels = this.hierarchical.getLevels();\n levels = levels.reverse();\n for (let i = 0; i < iterations; i++) {\n stillShifting = false;\n for (let j = 0; j < levels.length; j++) {\n const level = levels[j];\n const levelNodes = this.hierarchical.distributionOrdering[level];\n for (let k = 0; k < levelNodes.length; k++) {\n minimizeEdgeLength(1000, levelNodes[k]);\n }\n }\n if (stillShifting !== true) {\n //console.log(\"FINISHED minimizeEdgeLengthBottomUp IN \" + i);\n break;\n }\n }\n };\n\n // method to remove whitespace between branches. Because we do bottom up, we can center the parents.\n const shiftBranchesCloserBottomUp = (iterations) => {\n let levels = this.hierarchical.getLevels();\n levels = levels.reverse();\n for (let i = 0; i < iterations; i++) {\n stillShifting = false;\n shiftElementsCloser(branchShiftCallback, levels, true);\n if (stillShifting !== true) {\n //console.log(\"FINISHED shiftBranchesCloserBottomUp IN \" + (i+1));\n break;\n }\n }\n };\n\n // center all parents\n const centerAllParents = () => {\n for (const nodeId in this.body.nodes) {\n if (Object.prototype.hasOwnProperty.call(this.body.nodes, nodeId))\n this._centerParent(this.body.nodes[nodeId]);\n }\n };\n\n // center all parents\n const centerAllParentsBottomUp = () => {\n let levels = this.hierarchical.getLevels();\n levels = levels.reverse();\n for (let i = 0; i < levels.length; i++) {\n const level = levels[i];\n const levelNodes = this.hierarchical.distributionOrdering[level];\n for (let j = 0; j < levelNodes.length; j++) {\n this._centerParent(levelNodes[j]);\n }\n }\n };\n\n // the actual work is done here.\n if (this.options.hierarchical.blockShifting === true) {\n shiftBranchesCloserBottomUp(5);\n centerAllParents();\n }\n\n // minimize edge length\n if (this.options.hierarchical.edgeMinimization === true) {\n minimizeEdgeLengthBottomUp(20);\n }\n\n if (this.options.hierarchical.parentCentralization === true) {\n centerAllParentsBottomUp();\n }\n\n shiftTrees();\n }\n\n /**\n * This gives the space around the node. IF a map is supplied, it will only check against nodes NOT in the map.\n * This is used to only get the distances to nodes outside of a branch.\n *\n * @param {Node} node\n * @param {{Node.id: vis.Node}} map\n * @returns {number[]}\n * @private\n */\n _getSpaceAroundNode(node, map) {\n let useMap = true;\n if (map === undefined) {\n useMap = false;\n }\n const level = this.hierarchical.levels[node.id];\n if (level !== undefined) {\n const index = this.hierarchical.distributionIndex[node.id];\n const position = this.direction.getPosition(node);\n const ordering = this.hierarchical.distributionOrdering[level];\n let minSpace = 1e9;\n let maxSpace = 1e9;\n if (index !== 0) {\n const prevNode = ordering[index - 1];\n if (\n (useMap === true && map[prevNode.id] === undefined) ||\n useMap === false\n ) {\n const prevPos = this.direction.getPosition(prevNode);\n minSpace = position - prevPos;\n }\n }\n\n if (index != ordering.length - 1) {\n const nextNode = ordering[index + 1];\n if (\n (useMap === true && map[nextNode.id] === undefined) ||\n useMap === false\n ) {\n const nextPos = this.direction.getPosition(nextNode);\n maxSpace = Math.min(maxSpace, nextPos - position);\n }\n }\n\n return [minSpace, maxSpace];\n } else {\n return [0, 0];\n }\n }\n\n /**\n * We use this method to center a parent node and check if it does not cross other nodes when it does.\n *\n * @param {Node} node\n * @private\n */\n _centerParent(node) {\n if (this.hierarchical.parentReference[node.id]) {\n const parents = this.hierarchical.parentReference[node.id];\n for (let i = 0; i < parents.length; i++) {\n const parentId = parents[i];\n const parentNode = this.body.nodes[parentId];\n const children = this.hierarchical.childrenReference[parentId];\n\n if (children !== undefined) {\n // get the range of the children\n const newPosition = this._getCenterPosition(children);\n\n const position = this.direction.getPosition(parentNode);\n const [minSpace, maxSpace] = this._getSpaceAroundNode(parentNode);\n const diff = position - newPosition;\n if (\n (diff < 0 &&\n Math.abs(diff) <\n maxSpace - this.options.hierarchical.nodeSpacing) ||\n (diff > 0 &&\n Math.abs(diff) < minSpace - this.options.hierarchical.nodeSpacing)\n ) {\n this.direction.setPosition(parentNode, newPosition);\n }\n }\n }\n }\n }\n\n /**\n * This function places the nodes on the canvas based on the hierarchial distribution.\n *\n * @param {object} distribution | obtained by the function this._getDistribution()\n * @private\n */\n _placeNodesByHierarchy(distribution) {\n this.positionedNodes = {};\n // start placing all the level 0 nodes first. Then recursively position their branches.\n for (const level in distribution) {\n if (Object.prototype.hasOwnProperty.call(distribution, level)) {\n // sort nodes in level by position:\n let nodeArray = Object.keys(distribution[level]);\n nodeArray = this._indexArrayToNodes(nodeArray);\n this.direction.sort(nodeArray);\n let handledNodeCount = 0;\n\n for (let i = 0; i < nodeArray.length; i++) {\n const node = nodeArray[i];\n if (this.positionedNodes[node.id] === undefined) {\n const spacing = this.options.hierarchical.nodeSpacing;\n let pos = spacing * handledNodeCount;\n // We get the X or Y values we need and store them in pos and previousPos.\n // The get and set make sure we get X or Y\n if (handledNodeCount > 0) {\n pos = this.direction.getPosition(nodeArray[i - 1]) + spacing;\n }\n this.direction.setPosition(node, pos, level);\n this._validatePositionAndContinue(node, level, pos);\n\n handledNodeCount++;\n }\n }\n }\n }\n }\n\n /**\n * This is a recursively called function to enumerate the branches from the largest hubs and place the nodes\n * on a X position that ensures there will be no overlap.\n *\n * @param {Node.id} parentId\n * @param {number} parentLevel\n * @private\n */\n _placeBranchNodes(parentId, parentLevel) {\n const childRef = this.hierarchical.childrenReference[parentId];\n\n // if this is not a parent, cancel the placing. This can happen with multiple parents to one child.\n if (childRef === undefined) {\n return;\n }\n\n // get a list of childNodes\n const childNodes = [];\n for (let i = 0; i < childRef.length; i++) {\n childNodes.push(this.body.nodes[childRef[i]]);\n }\n\n // use the positions to order the nodes.\n this.direction.sort(childNodes);\n\n // position the childNodes\n for (let i = 0; i < childNodes.length; i++) {\n const childNode = childNodes[i];\n const childNodeLevel = this.hierarchical.levels[childNode.id];\n // check if the child node is below the parent node and if it has already been positioned.\n if (\n childNodeLevel > parentLevel &&\n this.positionedNodes[childNode.id] === undefined\n ) {\n // get the amount of space required for this node. If parent the width is based on the amount of children.\n const spacing = this.options.hierarchical.nodeSpacing;\n let pos;\n\n // we get the X or Y values we need and store them in pos and previousPos.\n // The get and set make sure we get X or Y\n if (i === 0) {\n pos = this.direction.getPosition(this.body.nodes[parentId]);\n } else {\n pos = this.direction.getPosition(childNodes[i - 1]) + spacing;\n }\n this.direction.setPosition(childNode, pos, childNodeLevel);\n this._validatePositionAndContinue(childNode, childNodeLevel, pos);\n } else {\n return;\n }\n }\n\n // center the parent nodes.\n const center = this._getCenterPosition(childNodes);\n this.direction.setPosition(this.body.nodes[parentId], center, parentLevel);\n }\n\n /**\n * This method checks for overlap and if required shifts the branch. It also keeps records of positioned nodes.\n * Finally it will call _placeBranchNodes to place the branch nodes.\n *\n * @param {Node} node\n * @param {number} level\n * @param {number} pos\n * @private\n */\n _validatePositionAndContinue(node, level, pos) {\n // This method only works for formal trees and formal forests\n // Early exit if this is not the case\n if (!this.hierarchical.isTree) return;\n\n // if overlap has been detected, we shift the branch\n if (this.lastNodeOnLevel[level] !== undefined) {\n const previousPos = this.direction.getPosition(\n this.body.nodes[this.lastNodeOnLevel[level]]\n );\n if (pos - previousPos < this.options.hierarchical.nodeSpacing) {\n const diff = previousPos + this.options.hierarchical.nodeSpacing - pos;\n const sharedParent = this._findCommonParent(\n this.lastNodeOnLevel[level],\n node.id\n );\n this._shiftBlock(sharedParent.withChild, diff);\n }\n }\n\n this.lastNodeOnLevel[level] = node.id; // store change in position.\n this.positionedNodes[node.id] = true;\n this._placeBranchNodes(node.id, level);\n }\n\n /**\n * Receives an array with node indices and returns an array with the actual node references.\n * Used for sorting based on node properties.\n *\n * @param {Array.<Node.id>} idArray\n * @returns {Array.<Node>}\n */\n _indexArrayToNodes(idArray) {\n const array = [];\n for (let i = 0; i < idArray.length; i++) {\n array.push(this.body.nodes[idArray[i]]);\n }\n return array;\n }\n\n /**\n * This function get the distribution of levels based on hubsize\n *\n * @returns {object}\n * @private\n */\n _getDistribution() {\n const distribution = {};\n let nodeId, node;\n\n // we fix Y because the hierarchy is vertical,\n // we fix X so we do not give a node an x position for a second time.\n // the fix of X is removed after the x value has been set.\n for (nodeId in this.body.nodes) {\n if (Object.prototype.hasOwnProperty.call(this.body.nodes, nodeId)) {\n node = this.body.nodes[nodeId];\n const level =\n this.hierarchical.levels[nodeId] === undefined\n ? 0\n : this.hierarchical.levels[nodeId];\n this.direction.fix(node, level);\n if (distribution[level] === undefined) {\n distribution[level] = {};\n }\n distribution[level][nodeId] = node;\n }\n }\n return distribution;\n }\n\n /**\n * Return the active (i.e. visible) edges for this node\n *\n * @param {Node} node\n * @returns {Array.<vis.Edge>} Array of edge instances\n * @private\n */\n _getActiveEdges(node) {\n const result = [];\n\n forEach(node.edges, (edge) => {\n if (this.body.edgeIndices.indexOf(edge.id) !== -1) {\n result.push(edge);\n }\n });\n\n return result;\n }\n\n /**\n * Get the hubsizes for all active nodes.\n *\n * @returns {number}\n * @private\n */\n _getHubSizes() {\n const hubSizes = {};\n const nodeIds = this.body.nodeIndices;\n\n forEach(nodeIds, (nodeId) => {\n const node = this.body.nodes[nodeId];\n const hubSize = this._getActiveEdges(node).length;\n hubSizes[hubSize] = true;\n });\n\n // Make an array of the size sorted descending\n const result = [];\n forEach(hubSizes, (size) => {\n result.push(Number(size));\n });\n\n TimSort.sort(result, function (a, b) {\n return b - a;\n });\n\n return result;\n }\n\n /**\n * this function allocates nodes in levels based on the recursive branching from the largest hubs.\n *\n * @private\n */\n _determineLevelsByHubsize() {\n const levelDownstream = (nodeA, nodeB) => {\n this.hierarchical.levelDownstream(nodeA, nodeB);\n };\n\n const hubSizes = this._getHubSizes();\n\n for (let i = 0; i < hubSizes.length; ++i) {\n const hubSize = hubSizes[i];\n if (hubSize === 0) break;\n\n forEach(this.body.nodeIndices, (nodeId) => {\n const node = this.body.nodes[nodeId];\n\n if (hubSize === this._getActiveEdges(node).length) {\n this._crawlNetwork(levelDownstream, nodeId);\n }\n });\n }\n }\n\n /**\n * TODO: release feature\n * TODO: Determine if this feature is needed at all\n *\n * @private\n */\n _determineLevelsCustomCallback() {\n const minLevel = 100000;\n\n // TODO: this should come from options.\n // eslint-disable-next-line no-unused-vars -- This should eventually be implemented with these parameters used.\n const customCallback = function (nodeA, nodeB, edge) {};\n\n // TODO: perhaps move to HierarchicalStatus.\n // But I currently don't see the point, this method is not used.\n const levelByDirection = (nodeA, nodeB, edge) => {\n let levelA = this.hierarchical.levels[nodeA.id];\n // set initial level\n if (levelA === undefined) {\n levelA = this.hierarchical.levels[nodeA.id] = minLevel;\n }\n\n const diff = customCallback(\n NetworkUtil.cloneOptions(nodeA, \"node\"),\n NetworkUtil.cloneOptions(nodeB, \"node\"),\n NetworkUtil.cloneOptions(edge, \"edge\")\n );\n\n this.hierarchical.levels[nodeB.id] = levelA + diff;\n };\n\n this._crawlNetwork(levelByDirection);\n this.hierarchical.setMinLevelToZero(this.body.nodes);\n }\n\n /**\n * Allocate nodes in levels based on the direction of the edges.\n *\n * @private\n */\n _determineLevelsDirected() {\n const nodes = this.body.nodeIndices.reduce((acc, id) => {\n acc.set(id, this.body.nodes[id]);\n return acc;\n }, new Map());\n\n if (this.options.hierarchical.shakeTowards === \"roots\") {\n this.hierarchical.levels = fillLevelsByDirectionRoots(nodes);\n } else {\n this.hierarchical.levels = fillLevelsByDirectionLeaves(nodes);\n }\n\n this.hierarchical.setMinLevelToZero(this.body.nodes);\n }\n\n /**\n * Update the bookkeeping of parent and child.\n *\n * @private\n */\n _generateMap() {\n const fillInRelations = (parentNode, childNode) => {\n if (\n this.hierarchical.levels[childNode.id] >\n this.hierarchical.levels[parentNode.id]\n ) {\n this.hierarchical.addRelation(parentNode.id, childNode.id);\n }\n };\n\n this._crawlNetwork(fillInRelations);\n this.hierarchical.checkIfTree();\n }\n\n /**\n * Crawl over the entire network and use a callback on each node couple that is connected to each other.\n *\n * @param {Function} [callback=function(){}] | will receive nodeA, nodeB and the connecting edge. A and B are distinct.\n * @param {Node.id} startingNodeId\n * @private\n */\n _crawlNetwork(callback = function () {}, startingNodeId) {\n const progress = {};\n\n const crawler = (node, tree) => {\n if (progress[node.id] === undefined) {\n this.hierarchical.setTreeIndex(node, tree);\n\n progress[node.id] = true;\n let childNode;\n const edges = this._getActiveEdges(node);\n for (let i = 0; i < edges.length; i++) {\n const edge = edges[i];\n if (edge.connected === true) {\n if (edge.toId == node.id) {\n // Not '===' because id's can be string and numeric\n childNode = edge.from;\n } else {\n childNode = edge.to;\n }\n\n if (node.id != childNode.id) {\n // Not '!==' because id's can be string and numeric\n callback(node, childNode, edge);\n crawler(childNode, tree);\n }\n }\n }\n }\n };\n\n if (startingNodeId === undefined) {\n // Crawl over all nodes\n let treeIndex = 0; // Serves to pass a unique id for the current distinct tree\n\n for (let i = 0; i < this.body.nodeIndices.length; i++) {\n const nodeId = this.body.nodeIndices[i];\n\n if (progress[nodeId] === undefined) {\n const node = this.body.nodes[nodeId];\n crawler(node, treeIndex);\n treeIndex += 1;\n }\n }\n } else {\n // Crawl from the given starting node\n const node = this.body.nodes[startingNodeId];\n if (node === undefined) {\n console.error(\"Node not found:\", startingNodeId);\n return;\n }\n crawler(node);\n }\n }\n\n /**\n * Shift a branch a certain distance\n *\n * @param {Node.id} parentId\n * @param {number} diff\n * @private\n */\n _shiftBlock(parentId, diff) {\n const progress = {};\n const shifter = (parentId) => {\n if (progress[parentId]) {\n return;\n }\n progress[parentId] = true;\n this.direction.shift(parentId, diff);\n\n const childRef = this.hierarchical.childrenReference[parentId];\n if (childRef !== undefined) {\n for (let i = 0; i < childRef.length; i++) {\n shifter(childRef[i]);\n }\n }\n };\n shifter(parentId);\n }\n\n /**\n * Find a common parent between branches.\n *\n * @param {Node.id} childA\n * @param {Node.id} childB\n * @returns {{foundParent, withChild}}\n * @private\n */\n _findCommonParent(childA, childB) {\n const parents = {};\n const iterateParents = (parents, child) => {\n const parentRef = this.hierarchical.parentReference[child];\n if (parentRef !== undefined) {\n for (let i = 0; i < parentRef.length; i++) {\n const parent = parentRef[i];\n parents[parent] = true;\n iterateParents(parents, parent);\n }\n }\n };\n const findParent = (parents, child) => {\n const parentRef = this.hierarchical.parentReference[child];\n if (parentRef !== undefined) {\n for (let i = 0; i < parentRef.length; i++) {\n const parent = parentRef[i];\n if (parents[parent] !== undefined) {\n return { foundParent: parent, withChild: child };\n }\n const branch = findParent(parents, parent);\n if (branch.foundParent !== null) {\n return branch;\n }\n }\n }\n return { foundParent: null, withChild: child };\n };\n\n iterateParents(parents, childA);\n return findParent(parents, childB);\n }\n\n /**\n * Set the strategy pattern for handling the coordinates given the current direction.\n *\n * The individual instances contain all the operations and data specific to a layout direction.\n *\n * @param {Node} node\n * @param {{x: number, y: number}} position\n * @param {number} level\n * @param {boolean} [doNotUpdate=false]\n * @private\n */\n setDirectionStrategy() {\n const isVertical =\n this.options.hierarchical.direction === \"UD\" ||\n this.options.hierarchical.direction === \"DU\";\n\n if (isVertical) {\n this.direction = new VerticalStrategy(this);\n } else {\n this.direction = new HorizontalStrategy(this);\n }\n }\n\n /**\n * Determine the center position of a branch from the passed list of child nodes\n *\n * This takes into account the positions of all the child nodes.\n *\n * @param {Array.<Node|vis.Node.id>} childNodes Array of either child nodes or node id's\n * @returns {number}\n * @private\n */\n _getCenterPosition(childNodes) {\n let minPos = 1e9;\n let maxPos = -1e9;\n\n for (let i = 0; i < childNodes.length; i++) {\n let childNode;\n if (childNodes[i].id !== undefined) {\n childNode = childNodes[i];\n } else {\n const childNodeId = childNodes[i];\n childNode = this.body.nodes[childNodeId];\n }\n\n const position = this.direction.getPosition(childNode);\n minPos = Math.min(minPos, position);\n maxPos = Math.max(maxPos, position);\n }\n\n return 0.5 * (minPos + maxPos);\n }\n}\n\nexport default LayoutEngine;\n","import \"./ManipulationSystem.css\";\n\nimport { Hammer, deepExtend, recursiveDOMDelete } from \"vis-util/esnext\";\nimport { v4 as randomUUID } from \"uuid\";\nimport { onTouch } from \"../../hammerUtil\";\n\n/**\n * Clears the toolbar div element of children\n *\n * @private\n */\nclass ManipulationSystem {\n /**\n * @param {object} body\n * @param {Canvas} canvas\n * @param {SelectionHandler} selectionHandler\n * @param {InteractionHandler} interactionHandler\n */\n constructor(body, canvas, selectionHandler, interactionHandler) {\n this.body = body;\n this.canvas = canvas;\n this.selectionHandler = selectionHandler;\n this.interactionHandler = interactionHandler;\n\n this.editMode = false;\n this.manipulationDiv = undefined;\n this.editModeDiv = undefined;\n this.closeDiv = undefined;\n\n this._domEventListenerCleanupQueue = [];\n this.temporaryUIFunctions = {};\n this.temporaryEventFunctions = [];\n\n this.touchTime = 0;\n this.temporaryIds = { nodes: [], edges: [] };\n this.guiEnabled = false;\n this.inMode = false;\n this.selectedControlNode = undefined;\n\n this.options = {};\n this.defaultOptions = {\n enabled: false,\n initiallyActive: false,\n addNode: true,\n addEdge: true,\n editNode: undefined,\n editEdge: true,\n deleteNode: true,\n deleteEdge: true,\n controlNodeStyle: {\n shape: \"dot\",\n size: 6,\n color: {\n background: \"#ff0000\",\n border: \"#3c3c3c\",\n highlight: { background: \"#07f968\", border: \"#3c3c3c\" },\n },\n borderWidth: 2,\n borderWidthSelected: 2,\n },\n };\n Object.assign(this.options, this.defaultOptions);\n\n this.body.emitter.on(\"destroy\", () => {\n this._clean();\n });\n this.body.emitter.on(\"_dataChanged\", this._restore.bind(this));\n this.body.emitter.on(\"_resetData\", this._restore.bind(this));\n }\n\n /**\n * If something changes in the data during editing, switch back to the initial datamanipulation state and close all edit modes.\n *\n * @private\n */\n _restore() {\n if (this.inMode !== false) {\n if (this.options.initiallyActive === true) {\n this.enableEditMode();\n } else {\n this.disableEditMode();\n }\n }\n }\n\n /**\n * Set the Options\n *\n * @param {object} options\n * @param {object} allOptions\n * @param {object} globalOptions\n */\n setOptions(options, allOptions, globalOptions) {\n if (allOptions !== undefined) {\n if (allOptions.locale !== undefined) {\n this.options.locale = allOptions.locale;\n } else {\n this.options.locale = globalOptions.locale;\n }\n if (allOptions.locales !== undefined) {\n this.options.locales = allOptions.locales;\n } else {\n this.options.locales = globalOptions.locales;\n }\n }\n\n if (options !== undefined) {\n if (typeof options === \"boolean\") {\n this.options.enabled = options;\n } else {\n this.options.enabled = true;\n deepExtend(this.options, options);\n }\n if (this.options.initiallyActive === true) {\n this.editMode = true;\n }\n this._setup();\n }\n }\n\n /**\n * Enable or disable edit-mode. Draws the DOM required and cleans up after itself.\n *\n * @private\n */\n toggleEditMode() {\n if (this.editMode === true) {\n this.disableEditMode();\n } else {\n this.enableEditMode();\n }\n }\n\n /**\n * Enables Edit Mode\n */\n enableEditMode() {\n this.editMode = true;\n\n this._clean();\n if (this.guiEnabled === true) {\n this.manipulationDiv.style.display = \"block\";\n this.closeDiv.style.display = \"block\";\n this.editModeDiv.style.display = \"none\";\n this.showManipulatorToolbar();\n }\n }\n\n /**\n * Disables Edit Mode\n */\n disableEditMode() {\n this.editMode = false;\n\n this._clean();\n if (this.guiEnabled === true) {\n this.manipulationDiv.style.display = \"none\";\n this.closeDiv.style.display = \"none\";\n this.editModeDiv.style.display = \"block\";\n this._createEditButton();\n }\n }\n\n /**\n * Creates the main toolbar. Removes functions bound to the select event. Binds all the buttons of the toolbar.\n *\n * @private\n */\n showManipulatorToolbar() {\n // restore the state of any bound functions or events, remove control nodes, restore physics\n this._clean();\n\n // reset global variables\n this.manipulationDOM = {};\n\n // if the gui is enabled, draw all elements.\n if (this.guiEnabled === true) {\n // a _restore will hide these menus\n this.editMode = true;\n this.manipulationDiv.style.display = \"block\";\n this.closeDiv.style.display = \"block\";\n\n const selectedNodeCount = this.selectionHandler.getSelectedNodeCount();\n const selectedEdgeCount = this.selectionHandler.getSelectedEdgeCount();\n const selectedTotalCount = selectedNodeCount + selectedEdgeCount;\n const locale = this.options.locales[this.options.locale];\n let needSeperator = false;\n\n if (this.options.addNode !== false) {\n this._createAddNodeButton(locale);\n needSeperator = true;\n }\n if (this.options.addEdge !== false) {\n if (needSeperator === true) {\n this._createSeperator(1);\n } else {\n needSeperator = true;\n }\n this._createAddEdgeButton(locale);\n }\n\n if (\n selectedNodeCount === 1 &&\n typeof this.options.editNode === \"function\"\n ) {\n if (needSeperator === true) {\n this._createSeperator(2);\n } else {\n needSeperator = true;\n }\n this._createEditNodeButton(locale);\n } else if (\n selectedEdgeCount === 1 &&\n selectedNodeCount === 0 &&\n this.options.editEdge !== false\n ) {\n if (needSeperator === true) {\n this._createSeperator(3);\n } else {\n needSeperator = true;\n }\n this._createEditEdgeButton(locale);\n }\n\n // remove buttons\n if (selectedTotalCount !== 0) {\n if (selectedNodeCount > 0 && this.options.deleteNode !== false) {\n if (needSeperator === true) {\n this._createSeperator(4);\n }\n this._createDeleteButton(locale);\n } else if (\n selectedNodeCount === 0 &&\n this.options.deleteEdge !== false\n ) {\n if (needSeperator === true) {\n this._createSeperator(4);\n }\n this._createDeleteButton(locale);\n }\n }\n\n // bind the close button\n this._bindElementEvents(this.closeDiv, this.toggleEditMode.bind(this));\n\n // refresh this bar based on what has been selected\n this._temporaryBindEvent(\n \"select\",\n this.showManipulatorToolbar.bind(this)\n );\n }\n\n // redraw to show any possible changes\n this.body.emitter.emit(\"_redraw\");\n }\n\n /**\n * Create the toolbar for adding Nodes\n */\n addNodeMode() {\n // when using the gui, enable edit mode if it wasnt already.\n if (this.editMode !== true) {\n this.enableEditMode();\n }\n\n // restore the state of any bound functions or events, remove control nodes, restore physics\n this._clean();\n\n this.inMode = \"addNode\";\n if (this.guiEnabled === true) {\n const locale = this.options.locales[this.options.locale];\n this.manipulationDOM = {};\n this._createBackButton(locale);\n this._createSeperator();\n this._createDescription(\n locale[\"addDescription\"] || this.options.locales[\"en\"][\"addDescription\"]\n );\n\n // bind the close button\n this._bindElementEvents(this.closeDiv, this.toggleEditMode.bind(this));\n }\n\n this._temporaryBindEvent(\"click\", this._performAddNode.bind(this));\n }\n\n /**\n * call the bound function to handle the editing of the node. The node has to be selected.\n */\n editNode() {\n // when using the gui, enable edit mode if it wasnt already.\n if (this.editMode !== true) {\n this.enableEditMode();\n }\n\n // restore the state of any bound functions or events, remove control nodes, restore physics\n this._clean();\n const node = this.selectionHandler.getSelectedNodes()[0];\n if (node !== undefined) {\n this.inMode = \"editNode\";\n if (typeof this.options.editNode === \"function\") {\n if (node.isCluster !== true) {\n const data = deepExtend({}, node.options, false);\n data.x = node.x;\n data.y = node.y;\n\n if (this.options.editNode.length === 2) {\n this.options.editNode(data, (finalizedData) => {\n if (\n finalizedData !== null &&\n finalizedData !== undefined &&\n this.inMode === \"editNode\"\n ) {\n // if for whatever reason the mode has changes (due to dataset change) disregard the callback) {\n this.body.data.nodes.getDataSet().update(finalizedData);\n }\n this.showManipulatorToolbar();\n });\n } else {\n throw new Error(\n \"The function for edit does not support two arguments (data, callback)\"\n );\n }\n } else {\n alert(\n this.options.locales[this.options.locale][\"editClusterError\"] ||\n this.options.locales[\"en\"][\"editClusterError\"]\n );\n }\n } else {\n throw new Error(\n \"No function has been configured to handle the editing of nodes.\"\n );\n }\n } else {\n this.showManipulatorToolbar();\n }\n }\n\n /**\n * create the toolbar to connect nodes\n */\n addEdgeMode() {\n // when using the gui, enable edit mode if it wasnt already.\n if (this.editMode !== true) {\n this.enableEditMode();\n }\n\n // restore the state of any bound functions or events, remove control nodes, restore physics\n this._clean();\n\n this.inMode = \"addEdge\";\n if (this.guiEnabled === true) {\n const locale = this.options.locales[this.options.locale];\n this.manipulationDOM = {};\n this._createBackButton(locale);\n this._createSeperator();\n this._createDescription(\n locale[\"edgeDescription\"] ||\n this.options.locales[\"en\"][\"edgeDescription\"]\n );\n\n // bind the close button\n this._bindElementEvents(this.closeDiv, this.toggleEditMode.bind(this));\n }\n\n // temporarily overload functions\n this._temporaryBindUI(\"onTouch\", this._handleConnect.bind(this));\n this._temporaryBindUI(\"onDragEnd\", this._finishConnect.bind(this));\n this._temporaryBindUI(\"onDrag\", this._dragControlNode.bind(this));\n this._temporaryBindUI(\"onRelease\", this._finishConnect.bind(this));\n this._temporaryBindUI(\"onDragStart\", this._dragStartEdge.bind(this));\n this._temporaryBindUI(\"onHold\", () => {});\n }\n\n /**\n * create the toolbar to edit edges\n */\n editEdgeMode() {\n // when using the gui, enable edit mode if it wasn't already.\n if (this.editMode !== true) {\n this.enableEditMode();\n }\n\n // restore the state of any bound functions or events, remove control nodes, restore physics\n this._clean();\n\n this.inMode = \"editEdge\";\n if (\n typeof this.options.editEdge === \"object\" &&\n typeof this.options.editEdge.editWithoutDrag === \"function\"\n ) {\n this.edgeBeingEditedId = this.selectionHandler.getSelectedEdgeIds()[0];\n if (this.edgeBeingEditedId !== undefined) {\n const edge = this.body.edges[this.edgeBeingEditedId];\n this._performEditEdge(edge.from.id, edge.to.id);\n return;\n }\n }\n if (this.guiEnabled === true) {\n const locale = this.options.locales[this.options.locale];\n this.manipulationDOM = {};\n this._createBackButton(locale);\n this._createSeperator();\n this._createDescription(\n locale[\"editEdgeDescription\"] ||\n this.options.locales[\"en\"][\"editEdgeDescription\"]\n );\n\n // bind the close button\n this._bindElementEvents(this.closeDiv, this.toggleEditMode.bind(this));\n }\n\n this.edgeBeingEditedId = this.selectionHandler.getSelectedEdgeIds()[0];\n if (this.edgeBeingEditedId !== undefined) {\n const edge = this.body.edges[this.edgeBeingEditedId];\n\n // create control nodes\n const controlNodeFrom = this._getNewTargetNode(edge.from.x, edge.from.y);\n const controlNodeTo = this._getNewTargetNode(edge.to.x, edge.to.y);\n\n this.temporaryIds.nodes.push(controlNodeFrom.id);\n this.temporaryIds.nodes.push(controlNodeTo.id);\n\n this.body.nodes[controlNodeFrom.id] = controlNodeFrom;\n this.body.nodeIndices.push(controlNodeFrom.id);\n this.body.nodes[controlNodeTo.id] = controlNodeTo;\n this.body.nodeIndices.push(controlNodeTo.id);\n\n // temporarily overload UI functions, cleaned up automatically because of _temporaryBindUI\n this._temporaryBindUI(\"onTouch\", this._controlNodeTouch.bind(this)); // used to get the position\n this._temporaryBindUI(\"onTap\", () => {}); // disabled\n this._temporaryBindUI(\"onHold\", () => {}); // disabled\n this._temporaryBindUI(\n \"onDragStart\",\n this._controlNodeDragStart.bind(this)\n ); // used to select control node\n this._temporaryBindUI(\"onDrag\", this._controlNodeDrag.bind(this)); // used to drag control node\n this._temporaryBindUI(\"onDragEnd\", this._controlNodeDragEnd.bind(this)); // used to connect or revert control nodes\n this._temporaryBindUI(\"onMouseMove\", () => {}); // disabled\n\n // create function to position control nodes correctly on movement\n // automatically cleaned up because we use the temporary bind\n this._temporaryBindEvent(\"beforeDrawing\", (ctx) => {\n const positions = edge.edgeType.findBorderPositions(ctx);\n if (controlNodeFrom.selected === false) {\n controlNodeFrom.x = positions.from.x;\n controlNodeFrom.y = positions.from.y;\n }\n if (controlNodeTo.selected === false) {\n controlNodeTo.x = positions.to.x;\n controlNodeTo.y = positions.to.y;\n }\n });\n\n this.body.emitter.emit(\"_redraw\");\n } else {\n this.showManipulatorToolbar();\n }\n }\n\n /**\n * delete everything in the selection\n */\n deleteSelected() {\n // when using the gui, enable edit mode if it wasnt already.\n if (this.editMode !== true) {\n this.enableEditMode();\n }\n\n // restore the state of any bound functions or events, remove control nodes, restore physics\n this._clean();\n\n this.inMode = \"delete\";\n const selectedNodes = this.selectionHandler.getSelectedNodeIds();\n const selectedEdges = this.selectionHandler.getSelectedEdgeIds();\n let deleteFunction = undefined;\n if (selectedNodes.length > 0) {\n for (let i = 0; i < selectedNodes.length; i++) {\n if (this.body.nodes[selectedNodes[i]].isCluster === true) {\n alert(\n this.options.locales[this.options.locale][\"deleteClusterError\"] ||\n this.options.locales[\"en\"][\"deleteClusterError\"]\n );\n return;\n }\n }\n\n if (typeof this.options.deleteNode === \"function\") {\n deleteFunction = this.options.deleteNode;\n }\n } else if (selectedEdges.length > 0) {\n if (typeof this.options.deleteEdge === \"function\") {\n deleteFunction = this.options.deleteEdge;\n }\n }\n\n if (typeof deleteFunction === \"function\") {\n const data = { nodes: selectedNodes, edges: selectedEdges };\n if (deleteFunction.length === 2) {\n deleteFunction(data, (finalizedData) => {\n if (\n finalizedData !== null &&\n finalizedData !== undefined &&\n this.inMode === \"delete\"\n ) {\n // if for whatever reason the mode has changes (due to dataset change) disregard the callback) {\n this.body.data.edges.getDataSet().remove(finalizedData.edges);\n this.body.data.nodes.getDataSet().remove(finalizedData.nodes);\n this.body.emitter.emit(\"startSimulation\");\n this.showManipulatorToolbar();\n } else {\n this.body.emitter.emit(\"startSimulation\");\n this.showManipulatorToolbar();\n }\n });\n } else {\n throw new Error(\n \"The function for delete does not support two arguments (data, callback)\"\n );\n }\n } else {\n this.body.data.edges.getDataSet().remove(selectedEdges);\n this.body.data.nodes.getDataSet().remove(selectedNodes);\n this.body.emitter.emit(\"startSimulation\");\n this.showManipulatorToolbar();\n }\n }\n\n //********************************************** PRIVATE ***************************************//\n\n /**\n * draw or remove the DOM\n *\n * @private\n */\n _setup() {\n if (this.options.enabled === true) {\n // Enable the GUI\n this.guiEnabled = true;\n\n this._createWrappers();\n if (this.editMode === false) {\n this._createEditButton();\n } else {\n this.showManipulatorToolbar();\n }\n } else {\n this._removeManipulationDOM();\n\n // disable the gui\n this.guiEnabled = false;\n }\n }\n\n /**\n * create the div overlays that contain the DOM\n *\n * @private\n */\n _createWrappers() {\n // load the manipulator HTML elements. All styling done in css.\n if (this.manipulationDiv === undefined) {\n this.manipulationDiv = document.createElement(\"div\");\n this.manipulationDiv.className = \"vis-manipulation\";\n if (this.editMode === true) {\n this.manipulationDiv.style.display = \"block\";\n } else {\n this.manipulationDiv.style.display = \"none\";\n }\n this.canvas.frame.appendChild(this.manipulationDiv);\n }\n\n // container for the edit button.\n if (this.editModeDiv === undefined) {\n this.editModeDiv = document.createElement(\"div\");\n this.editModeDiv.className = \"vis-edit-mode\";\n if (this.editMode === true) {\n this.editModeDiv.style.display = \"none\";\n } else {\n this.editModeDiv.style.display = \"block\";\n }\n this.canvas.frame.appendChild(this.editModeDiv);\n }\n\n // container for the close div button\n if (this.closeDiv === undefined) {\n this.closeDiv = document.createElement(\"button\");\n this.closeDiv.className = \"vis-close\";\n this.closeDiv.setAttribute(\n \"aria-label\",\n this.options.locales[this.options.locale]?.[\"close\"] ??\n this.options.locales[\"en\"][\"close\"]\n );\n this.closeDiv.style.display = this.manipulationDiv.style.display;\n this.canvas.frame.appendChild(this.closeDiv);\n }\n }\n\n /**\n * generate a new target node. Used for creating new edges and editing edges\n *\n * @param {number} x\n * @param {number} y\n * @returns {Node}\n * @private\n */\n _getNewTargetNode(x, y) {\n const controlNodeStyle = deepExtend({}, this.options.controlNodeStyle);\n\n controlNodeStyle.id = \"targetNode\" + randomUUID();\n controlNodeStyle.hidden = false;\n controlNodeStyle.physics = false;\n controlNodeStyle.x = x;\n controlNodeStyle.y = y;\n\n // we have to define the bounding box in order for the nodes to be drawn immediately\n const node = this.body.functions.createNode(controlNodeStyle);\n node.shape.boundingBox = { left: x, right: x, top: y, bottom: y };\n\n return node;\n }\n\n /**\n * Create the edit button\n */\n _createEditButton() {\n // restore everything to it's original state (if applicable)\n this._clean();\n\n // reset the manipulationDOM\n this.manipulationDOM = {};\n\n // empty the editModeDiv\n recursiveDOMDelete(this.editModeDiv);\n\n // create the contents for the editMode button\n const locale = this.options.locales[this.options.locale];\n const button = this._createButton(\n \"editMode\",\n \"vis-edit vis-edit-mode\",\n locale[\"edit\"] || this.options.locales[\"en\"][\"edit\"]\n );\n this.editModeDiv.appendChild(button);\n\n // bind a hammer listener to the button, calling the function toggleEditMode.\n this._bindElementEvents(button, this.toggleEditMode.bind(this));\n }\n\n /**\n * this function cleans up after everything this module does. Temporary elements, functions and events are removed, physics restored, hammers removed.\n *\n * @private\n */\n _clean() {\n // not in mode\n this.inMode = false;\n\n // _clean the divs\n if (this.guiEnabled === true) {\n recursiveDOMDelete(this.editModeDiv);\n recursiveDOMDelete(this.manipulationDiv);\n\n // removes all the bindings and overloads\n this._cleanupDOMEventListeners();\n }\n\n // remove temporary nodes and edges\n this._cleanupTemporaryNodesAndEdges();\n\n // restore overloaded UI functions\n this._unbindTemporaryUIs();\n\n // remove the temporaryEventFunctions\n this._unbindTemporaryEvents();\n\n // restore the physics if required\n this.body.emitter.emit(\"restorePhysics\");\n }\n\n /**\n * Each dom element has it's own hammer. They are stored in this.manipulationHammers. This cleans them up.\n *\n * @private\n */\n _cleanupDOMEventListeners() {\n // _clean DOM event listener bindings\n for (const callback of this._domEventListenerCleanupQueue.splice(0)) {\n callback();\n }\n }\n\n /**\n * Remove all DOM elements created by this module.\n *\n * @private\n */\n _removeManipulationDOM() {\n // removes all the bindings and overloads\n this._clean();\n\n // empty the manipulation divs\n recursiveDOMDelete(this.manipulationDiv);\n recursiveDOMDelete(this.editModeDiv);\n recursiveDOMDelete(this.closeDiv);\n\n // remove the manipulation divs\n if (this.manipulationDiv) {\n this.canvas.frame.removeChild(this.manipulationDiv);\n }\n if (this.editModeDiv) {\n this.canvas.frame.removeChild(this.editModeDiv);\n }\n if (this.closeDiv) {\n this.canvas.frame.removeChild(this.closeDiv);\n }\n\n // set the references to undefined\n this.manipulationDiv = undefined;\n this.editModeDiv = undefined;\n this.closeDiv = undefined;\n }\n\n /**\n * create a seperator line. the index is to differentiate in the manipulation dom\n *\n * @param {number} [index=1]\n * @private\n */\n _createSeperator(index = 1) {\n this.manipulationDOM[\"seperatorLineDiv\" + index] =\n document.createElement(\"div\");\n this.manipulationDOM[\"seperatorLineDiv\" + index].className =\n \"vis-separator-line\";\n this.manipulationDiv.appendChild(\n this.manipulationDOM[\"seperatorLineDiv\" + index]\n );\n }\n\n // ---------------------- DOM functions for buttons --------------------------//\n\n /**\n *\n * @param {Locale} locale\n * @private\n */\n _createAddNodeButton(locale) {\n const button = this._createButton(\n \"addNode\",\n \"vis-add\",\n locale[\"addNode\"] || this.options.locales[\"en\"][\"addNode\"]\n );\n this.manipulationDiv.appendChild(button);\n this._bindElementEvents(button, this.addNodeMode.bind(this));\n }\n\n /**\n *\n * @param {Locale} locale\n * @private\n */\n _createAddEdgeButton(locale) {\n const button = this._createButton(\n \"addEdge\",\n \"vis-connect\",\n locale[\"addEdge\"] || this.options.locales[\"en\"][\"addEdge\"]\n );\n this.manipulationDiv.appendChild(button);\n this._bindElementEvents(button, this.addEdgeMode.bind(this));\n }\n\n /**\n *\n * @param {Locale} locale\n * @private\n */\n _createEditNodeButton(locale) {\n const button = this._createButton(\n \"editNode\",\n \"vis-edit\",\n locale[\"editNode\"] || this.options.locales[\"en\"][\"editNode\"]\n );\n this.manipulationDiv.appendChild(button);\n this._bindElementEvents(button, this.editNode.bind(this));\n }\n\n /**\n *\n * @param {Locale} locale\n * @private\n */\n _createEditEdgeButton(locale) {\n const button = this._createButton(\n \"editEdge\",\n \"vis-edit\",\n locale[\"editEdge\"] || this.options.locales[\"en\"][\"editEdge\"]\n );\n this.manipulationDiv.appendChild(button);\n this._bindElementEvents(button, this.editEdgeMode.bind(this));\n }\n\n /**\n *\n * @param {Locale} locale\n * @private\n */\n _createDeleteButton(locale) {\n let deleteBtnClass;\n if (this.options.rtl) {\n deleteBtnClass = \"vis-delete-rtl\";\n } else {\n deleteBtnClass = \"vis-delete\";\n }\n const button = this._createButton(\n \"delete\",\n deleteBtnClass,\n locale[\"del\"] || this.options.locales[\"en\"][\"del\"]\n );\n this.manipulationDiv.appendChild(button);\n this._bindElementEvents(button, this.deleteSelected.bind(this));\n }\n\n /**\n *\n * @param {Locale} locale\n * @private\n */\n _createBackButton(locale) {\n const button = this._createButton(\n \"back\",\n \"vis-back\",\n locale[\"back\"] || this.options.locales[\"en\"][\"back\"]\n );\n this.manipulationDiv.appendChild(button);\n this._bindElementEvents(button, this.showManipulatorToolbar.bind(this));\n }\n\n /**\n *\n * @param {number|string} id\n * @param {string} className\n * @param {label} label\n * @param {string} labelClassName\n * @returns {HTMLElement}\n * @private\n */\n _createButton(id, className, label, labelClassName = \"vis-label\") {\n this.manipulationDOM[id + \"Div\"] = document.createElement(\"button\");\n this.manipulationDOM[id + \"Div\"].className = \"vis-button \" + className;\n this.manipulationDOM[id + \"Label\"] = document.createElement(\"div\");\n this.manipulationDOM[id + \"Label\"].className = labelClassName;\n this.manipulationDOM[id + \"Label\"].innerText = label;\n this.manipulationDOM[id + \"Div\"].appendChild(\n this.manipulationDOM[id + \"Label\"]\n );\n return this.manipulationDOM[id + \"Div\"];\n }\n\n /**\n *\n * @param {Label} label\n * @private\n */\n _createDescription(label) {\n this.manipulationDOM[\"descriptionLabel\"] = document.createElement(\"div\");\n this.manipulationDOM[\"descriptionLabel\"].className = \"vis-none\";\n this.manipulationDOM[\"descriptionLabel\"].innerText = label;\n this.manipulationDiv.appendChild(this.manipulationDOM[\"descriptionLabel\"]);\n }\n\n // -------------------------- End of DOM functions for buttons ------------------------------//\n\n /**\n * this binds an event until cleanup by the clean functions.\n *\n * @param {Event} event The event\n * @param {Function} newFunction\n * @private\n */\n _temporaryBindEvent(event, newFunction) {\n this.temporaryEventFunctions.push({\n event: event,\n boundFunction: newFunction,\n });\n this.body.emitter.on(event, newFunction);\n }\n\n /**\n * this overrides an UI function until cleanup by the clean function\n *\n * @param {string} UIfunctionName\n * @param {Function} newFunction\n * @private\n */\n _temporaryBindUI(UIfunctionName, newFunction) {\n if (this.body.eventListeners[UIfunctionName] !== undefined) {\n this.temporaryUIFunctions[UIfunctionName] =\n this.body.eventListeners[UIfunctionName];\n this.body.eventListeners[UIfunctionName] = newFunction;\n } else {\n throw new Error(\n \"This UI function does not exist. Typo? You tried: \" +\n UIfunctionName +\n \" possible are: \" +\n JSON.stringify(Object.keys(this.body.eventListeners))\n );\n }\n }\n\n /**\n * Restore the overridden UI functions to their original state.\n *\n * @private\n */\n _unbindTemporaryUIs() {\n for (const functionName in this.temporaryUIFunctions) {\n if (\n Object.prototype.hasOwnProperty.call(\n this.temporaryUIFunctions,\n functionName\n )\n ) {\n this.body.eventListeners[functionName] =\n this.temporaryUIFunctions[functionName];\n delete this.temporaryUIFunctions[functionName];\n }\n }\n this.temporaryUIFunctions = {};\n }\n\n /**\n * Unbind the events created by _temporaryBindEvent\n *\n * @private\n */\n _unbindTemporaryEvents() {\n for (let i = 0; i < this.temporaryEventFunctions.length; i++) {\n const eventName = this.temporaryEventFunctions[i].event;\n const boundFunction = this.temporaryEventFunctions[i].boundFunction;\n this.body.emitter.off(eventName, boundFunction);\n }\n this.temporaryEventFunctions = [];\n }\n\n /**\n * Bind an hammer instance to a DOM element.\n *\n * @param {Element} domElement\n * @param {Function} boundFunction\n */\n _bindElementEvents(domElement, boundFunction) {\n // Bind touch events.\n const hammer = new Hammer(domElement, {});\n onTouch(hammer, boundFunction);\n this._domEventListenerCleanupQueue.push(() => {\n hammer.destroy();\n });\n\n // Bind keyboard events.\n const keyupListener = ({ keyCode, key }) => {\n if (key === \"Enter\" || key === \" \" || keyCode === 13 || keyCode === 32) {\n boundFunction();\n }\n };\n domElement.addEventListener(\"keyup\", keyupListener, false);\n this._domEventListenerCleanupQueue.push(() => {\n domElement.removeEventListener(\"keyup\", keyupListener, false);\n });\n }\n\n /**\n * Neatly clean up temporary edges and nodes\n *\n * @private\n */\n _cleanupTemporaryNodesAndEdges() {\n // _clean temporary edges\n for (let i = 0; i < this.temporaryIds.edges.length; i++) {\n this.body.edges[this.temporaryIds.edges[i]].disconnect();\n delete this.body.edges[this.temporaryIds.edges[i]];\n const indexTempEdge = this.body.edgeIndices.indexOf(\n this.temporaryIds.edges[i]\n );\n if (indexTempEdge !== -1) {\n this.body.edgeIndices.splice(indexTempEdge, 1);\n }\n }\n\n // _clean temporary nodes\n for (let i = 0; i < this.temporaryIds.nodes.length; i++) {\n delete this.body.nodes[this.temporaryIds.nodes[i]];\n const indexTempNode = this.body.nodeIndices.indexOf(\n this.temporaryIds.nodes[i]\n );\n if (indexTempNode !== -1) {\n this.body.nodeIndices.splice(indexTempNode, 1);\n }\n }\n\n this.temporaryIds = { nodes: [], edges: [] };\n }\n\n // ------------------------------------------ EDIT EDGE FUNCTIONS -----------------------------------------//\n\n /**\n * the touch is used to get the position of the initial click\n *\n * @param {Event} event The event\n * @private\n */\n _controlNodeTouch(event) {\n this.selectionHandler.unselectAll();\n this.lastTouch = this.body.functions.getPointer(event.center);\n this.lastTouch.translation = Object.assign({}, this.body.view.translation); // copy the object\n }\n\n /**\n * the drag start is used to mark one of the control nodes as selected.\n *\n * @private\n */\n _controlNodeDragStart() {\n const pointer = this.lastTouch;\n const pointerObj = this.selectionHandler._pointerToPositionObject(pointer);\n const from = this.body.nodes[this.temporaryIds.nodes[0]];\n const to = this.body.nodes[this.temporaryIds.nodes[1]];\n const edge = this.body.edges[this.edgeBeingEditedId];\n this.selectedControlNode = undefined;\n\n const fromSelect = from.isOverlappingWith(pointerObj);\n const toSelect = to.isOverlappingWith(pointerObj);\n\n if (fromSelect === true) {\n this.selectedControlNode = from;\n edge.edgeType.from = from;\n } else if (toSelect === true) {\n this.selectedControlNode = to;\n edge.edgeType.to = to;\n }\n\n // we use the selection to find the node that is being dragged. We explicitly select it here.\n if (this.selectedControlNode !== undefined) {\n this.selectionHandler.selectObject(this.selectedControlNode);\n }\n\n this.body.emitter.emit(\"_redraw\");\n }\n\n /**\n * dragging the control nodes or the canvas\n *\n * @param {Event} event The event\n * @private\n */\n _controlNodeDrag(event) {\n this.body.emitter.emit(\"disablePhysics\");\n const pointer = this.body.functions.getPointer(event.center);\n const pos = this.canvas.DOMtoCanvas(pointer);\n if (this.selectedControlNode !== undefined) {\n this.selectedControlNode.x = pos.x;\n this.selectedControlNode.y = pos.y;\n } else {\n this.interactionHandler.onDrag(event);\n }\n this.body.emitter.emit(\"_redraw\");\n }\n\n /**\n * connecting or restoring the control nodes.\n *\n * @param {Event} event The event\n * @private\n */\n _controlNodeDragEnd(event) {\n const pointer = this.body.functions.getPointer(event.center);\n const pointerObj = this.selectionHandler._pointerToPositionObject(pointer);\n const edge = this.body.edges[this.edgeBeingEditedId];\n // if the node that was dragged is not a control node, return\n if (this.selectedControlNode === undefined) {\n return;\n }\n\n // we use the selection to find the node that is being dragged. We explicitly DEselect the control node here.\n this.selectionHandler.unselectAll();\n const overlappingNodeIds =\n this.selectionHandler._getAllNodesOverlappingWith(pointerObj);\n let node = undefined;\n for (let i = overlappingNodeIds.length - 1; i >= 0; i--) {\n if (overlappingNodeIds[i] !== this.selectedControlNode.id) {\n node = this.body.nodes[overlappingNodeIds[i]];\n break;\n }\n }\n // perform the connection\n if (node !== undefined && this.selectedControlNode !== undefined) {\n if (node.isCluster === true) {\n alert(\n this.options.locales[this.options.locale][\"createEdgeError\"] ||\n this.options.locales[\"en\"][\"createEdgeError\"]\n );\n } else {\n const from = this.body.nodes[this.temporaryIds.nodes[0]];\n if (this.selectedControlNode.id === from.id) {\n this._performEditEdge(node.id, edge.to.id);\n } else {\n this._performEditEdge(edge.from.id, node.id);\n }\n }\n } else {\n edge.updateEdgeType();\n this.body.emitter.emit(\"restorePhysics\");\n }\n\n this.body.emitter.emit(\"_redraw\");\n }\n\n // ------------------------------------ END OF EDIT EDGE FUNCTIONS -----------------------------------------//\n\n // ------------------------------------------- ADD EDGE FUNCTIONS -----------------------------------------//\n /**\n * the function bound to the selection event. It checks if you want to connect a cluster and changes the description\n * to walk the user through the process.\n *\n * @param {Event} event\n * @private\n */\n _handleConnect(event) {\n // check to avoid double fireing of this function.\n if (new Date().valueOf() - this.touchTime > 100) {\n this.lastTouch = this.body.functions.getPointer(event.center);\n this.lastTouch.translation = Object.assign(\n {},\n this.body.view.translation\n ); // copy the object\n\n this.interactionHandler.drag.pointer = this.lastTouch; // Drag pointer is not updated when adding edges\n this.interactionHandler.drag.translation = this.lastTouch.translation;\n\n const pointer = this.lastTouch;\n const node = this.selectionHandler.getNodeAt(pointer);\n\n if (node !== undefined) {\n if (node.isCluster === true) {\n alert(\n this.options.locales[this.options.locale][\"createEdgeError\"] ||\n this.options.locales[\"en\"][\"createEdgeError\"]\n );\n } else {\n // create a node the temporary line can look at\n const targetNode = this._getNewTargetNode(node.x, node.y);\n this.body.nodes[targetNode.id] = targetNode;\n this.body.nodeIndices.push(targetNode.id);\n\n // create a temporary edge\n const connectionEdge = this.body.functions.createEdge({\n id: \"connectionEdge\" + randomUUID(),\n from: node.id,\n to: targetNode.id,\n physics: false,\n smooth: {\n enabled: true,\n type: \"continuous\",\n roundness: 0.5,\n },\n });\n this.body.edges[connectionEdge.id] = connectionEdge;\n this.body.edgeIndices.push(connectionEdge.id);\n\n this.temporaryIds.nodes.push(targetNode.id);\n this.temporaryIds.edges.push(connectionEdge.id);\n }\n }\n this.touchTime = new Date().valueOf();\n }\n }\n\n /**\n *\n * @param {Event} event\n * @private\n */\n _dragControlNode(event) {\n const pointer = this.body.functions.getPointer(event.center);\n\n const pointerObj = this.selectionHandler._pointerToPositionObject(pointer);\n // remember the edge id\n let connectFromId = undefined;\n if (this.temporaryIds.edges[0] !== undefined) {\n connectFromId = this.body.edges[this.temporaryIds.edges[0]].fromId;\n }\n\n // get the overlapping node but NOT the temporary node;\n const overlappingNodeIds =\n this.selectionHandler._getAllNodesOverlappingWith(pointerObj);\n let node = undefined;\n for (let i = overlappingNodeIds.length - 1; i >= 0; i--) {\n // if the node id is NOT a temporary node, accept the node.\n if (this.temporaryIds.nodes.indexOf(overlappingNodeIds[i]) === -1) {\n node = this.body.nodes[overlappingNodeIds[i]];\n break;\n }\n }\n\n event.controlEdge = { from: connectFromId, to: node ? node.id : undefined };\n this.selectionHandler.generateClickEvent(\n \"controlNodeDragging\",\n event,\n pointer\n );\n\n if (this.temporaryIds.nodes[0] !== undefined) {\n const targetNode = this.body.nodes[this.temporaryIds.nodes[0]]; // there is only one temp node in the add edge mode.\n targetNode.x = this.canvas._XconvertDOMtoCanvas(pointer.x);\n targetNode.y = this.canvas._YconvertDOMtoCanvas(pointer.y);\n this.body.emitter.emit(\"_redraw\");\n } else {\n this.interactionHandler.onDrag(event);\n }\n }\n\n /**\n * Connect the new edge to the target if one exists, otherwise remove temp line\n *\n * @param {Event} event The event\n * @private\n */\n _finishConnect(event) {\n const pointer = this.body.functions.getPointer(event.center);\n const pointerObj = this.selectionHandler._pointerToPositionObject(pointer);\n\n // remember the edge id\n let connectFromId = undefined;\n if (this.temporaryIds.edges[0] !== undefined) {\n connectFromId = this.body.edges[this.temporaryIds.edges[0]].fromId;\n }\n\n // get the overlapping node but NOT the temporary node;\n const overlappingNodeIds =\n this.selectionHandler._getAllNodesOverlappingWith(pointerObj);\n let node = undefined;\n for (let i = overlappingNodeIds.length - 1; i >= 0; i--) {\n // if the node id is NOT a temporary node, accept the node.\n if (this.temporaryIds.nodes.indexOf(overlappingNodeIds[i]) === -1) {\n node = this.body.nodes[overlappingNodeIds[i]];\n break;\n }\n }\n\n // clean temporary nodes and edges.\n this._cleanupTemporaryNodesAndEdges();\n\n // perform the connection\n if (node !== undefined) {\n if (node.isCluster === true) {\n alert(\n this.options.locales[this.options.locale][\"createEdgeError\"] ||\n this.options.locales[\"en\"][\"createEdgeError\"]\n );\n } else {\n if (\n this.body.nodes[connectFromId] !== undefined &&\n this.body.nodes[node.id] !== undefined\n ) {\n this._performAddEdge(connectFromId, node.id);\n }\n }\n }\n\n event.controlEdge = { from: connectFromId, to: node ? node.id : undefined };\n this.selectionHandler.generateClickEvent(\n \"controlNodeDragEnd\",\n event,\n pointer\n );\n\n // No need to do _generateclickevent('dragEnd') here, the regular dragEnd event fires.\n this.body.emitter.emit(\"_redraw\");\n }\n\n /**\n *\n * @param {Event} event\n * @private\n */\n _dragStartEdge(event) {\n const pointer = this.lastTouch;\n this.selectionHandler.generateClickEvent(\n \"dragStart\",\n event,\n pointer,\n undefined,\n true\n );\n }\n\n // --------------------------------------- END OF ADD EDGE FUNCTIONS -------------------------------------//\n\n // ------------------------------ Performing all the actual data manipulation ------------------------//\n\n /**\n * Adds a node on the specified location\n *\n * @param {object} clickData\n * @private\n */\n _performAddNode(clickData) {\n const defaultData = {\n id: randomUUID(),\n x: clickData.pointer.canvas.x,\n y: clickData.pointer.canvas.y,\n label: \"new\",\n };\n\n if (typeof this.options.addNode === \"function\") {\n if (this.options.addNode.length === 2) {\n this.options.addNode(defaultData, (finalizedData) => {\n if (\n finalizedData !== null &&\n finalizedData !== undefined &&\n this.inMode === \"addNode\"\n ) {\n // if for whatever reason the mode has changes (due to dataset change) disregard the callback\n this.body.data.nodes.getDataSet().add(finalizedData);\n }\n this.showManipulatorToolbar();\n });\n } else {\n this.showManipulatorToolbar();\n throw new Error(\n \"The function for add does not support two arguments (data,callback)\"\n );\n }\n } else {\n this.body.data.nodes.getDataSet().add(defaultData);\n this.showManipulatorToolbar();\n }\n }\n\n /**\n * connect two nodes with a new edge.\n *\n * @param {Node.id} sourceNodeId\n * @param {Node.id} targetNodeId\n * @private\n */\n _performAddEdge(sourceNodeId, targetNodeId) {\n const defaultData = { from: sourceNodeId, to: targetNodeId };\n if (typeof this.options.addEdge === \"function\") {\n if (this.options.addEdge.length === 2) {\n this.options.addEdge(defaultData, (finalizedData) => {\n if (\n finalizedData !== null &&\n finalizedData !== undefined &&\n this.inMode === \"addEdge\"\n ) {\n // if for whatever reason the mode has changes (due to dataset change) disregard the callback\n this.body.data.edges.getDataSet().add(finalizedData);\n this.selectionHandler.unselectAll();\n this.showManipulatorToolbar();\n }\n });\n } else {\n throw new Error(\n \"The function for connect does not support two arguments (data,callback)\"\n );\n }\n } else {\n this.body.data.edges.getDataSet().add(defaultData);\n this.selectionHandler.unselectAll();\n this.showManipulatorToolbar();\n }\n }\n\n /**\n * connect two nodes with a new edge.\n *\n * @param {Node.id} sourceNodeId\n * @param {Node.id} targetNodeId\n * @private\n */\n _performEditEdge(sourceNodeId, targetNodeId) {\n const defaultData = {\n id: this.edgeBeingEditedId,\n from: sourceNodeId,\n to: targetNodeId,\n label: this.body.data.edges.get(this.edgeBeingEditedId).label,\n };\n let eeFunct = this.options.editEdge;\n if (typeof eeFunct === \"object\") {\n eeFunct = eeFunct.editWithoutDrag;\n }\n if (typeof eeFunct === \"function\") {\n if (eeFunct.length === 2) {\n eeFunct(defaultData, (finalizedData) => {\n if (\n finalizedData === null ||\n finalizedData === undefined ||\n this.inMode !== \"editEdge\"\n ) {\n // if for whatever reason the mode has changes (due to dataset change) disregard the callback) {\n this.body.edges[defaultData.id].updateEdgeType();\n this.body.emitter.emit(\"_redraw\");\n this.showManipulatorToolbar();\n } else {\n this.body.data.edges.getDataSet().update(finalizedData);\n this.selectionHandler.unselectAll();\n this.showManipulatorToolbar();\n }\n });\n } else {\n throw new Error(\n \"The function for edit does not support two arguments (data, callback)\"\n );\n }\n } else {\n this.body.data.edges.getDataSet().update(defaultData);\n this.selectionHandler.unselectAll();\n this.showManipulatorToolbar();\n }\n }\n}\n\nexport default ManipulationSystem;\n","import {\n ConfiguratorConfig,\n ConfiguratorHideOption,\n OptionsConfig,\n} from \"vis-util/esnext\";\n\n/**\n * This object contains all possible options. It will check if the types are correct, if required if the option is one\n * of the allowed values.\n *\n * __any__ means that the name of the property does not matter.\n * __type__ is a required field for all objects and contains the allowed types of all objects\n */\nconst string = \"string\";\nconst bool = \"boolean\";\nconst number = \"number\";\nconst array = \"array\";\nconst object = \"object\"; // should only be in a __type__ property\nconst dom = \"dom\";\nconst any = \"any\";\n\n// List of endpoints\nconst endPoints = [\n \"arrow\",\n \"bar\",\n \"box\",\n \"circle\",\n \"crow\",\n \"curve\",\n \"diamond\",\n \"image\",\n \"inv_curve\",\n \"inv_triangle\",\n \"triangle\",\n \"vee\",\n];\n\n/* eslint-disable @typescript-eslint/naming-convention -- The __*__ format is used to prevent collisions with actual option names. */\nconst nodeOptions: OptionsConfig = {\n borderWidth: { number },\n borderWidthSelected: { number, undefined: \"undefined\" },\n brokenImage: { string, undefined: \"undefined\" },\n chosen: {\n label: { boolean: bool, function: \"function\" },\n node: { boolean: bool, function: \"function\" },\n __type__: { object, boolean: bool },\n },\n color: {\n border: { string },\n background: { string },\n highlight: {\n border: { string },\n background: { string },\n __type__: { object, string },\n },\n hover: {\n border: { string },\n background: { string },\n __type__: { object, string },\n },\n __type__: { object, string },\n },\n opacity: { number, undefined: \"undefined\" },\n fixed: {\n x: { boolean: bool },\n y: { boolean: bool },\n __type__: { object, boolean: bool },\n },\n font: {\n align: { string },\n color: { string },\n size: { number }, // px\n face: { string },\n background: { string },\n strokeWidth: { number }, // px\n strokeColor: { string },\n vadjust: { number },\n multi: { boolean: bool, string },\n bold: {\n color: { string },\n size: { number }, // px\n face: { string },\n mod: { string },\n vadjust: { number },\n __type__: { object, string },\n },\n boldital: {\n color: { string },\n size: { number }, // px\n face: { string },\n mod: { string },\n vadjust: { number },\n __type__: { object, string },\n },\n ital: {\n color: { string },\n size: { number }, // px\n face: { string },\n mod: { string },\n vadjust: { number },\n __type__: { object, string },\n },\n mono: {\n color: { string },\n size: { number }, // px\n face: { string },\n mod: { string },\n vadjust: { number },\n __type__: { object, string },\n },\n __type__: { object, string },\n },\n group: { string, number, undefined: \"undefined\" },\n heightConstraint: {\n minimum: { number },\n valign: { string },\n __type__: { object, boolean: bool, number },\n },\n hidden: { boolean: bool },\n icon: {\n face: { string },\n code: { string }, //'\\uf007',\n size: { number }, //50,\n color: { string },\n weight: { string, number },\n __type__: { object },\n },\n id: { string, number },\n image: {\n selected: { string, undefined: \"undefined\" }, // --> URL\n unselected: { string, undefined: \"undefined\" }, // --> URL\n __type__: { object, string },\n },\n imagePadding: {\n top: { number },\n right: { number },\n bottom: { number },\n left: { number },\n __type__: { object, number },\n },\n label: { string, undefined: \"undefined\" },\n labelHighlightBold: { boolean: bool },\n level: { number, undefined: \"undefined\" },\n margin: {\n top: { number },\n right: { number },\n bottom: { number },\n left: { number },\n __type__: { object, number },\n },\n mass: { number },\n physics: { boolean: bool },\n scaling: {\n min: { number },\n max: { number },\n label: {\n enabled: { boolean: bool },\n min: { number },\n max: { number },\n maxVisible: { number },\n drawThreshold: { number },\n __type__: { object, boolean: bool },\n },\n customScalingFunction: { function: \"function\" },\n __type__: { object },\n },\n shadow: {\n enabled: { boolean: bool },\n color: { string },\n size: { number },\n x: { number },\n y: { number },\n __type__: { object, boolean: bool },\n },\n shape: {\n string: [\n \"custom\",\n \"ellipse\",\n \"circle\",\n \"database\",\n \"box\",\n \"text\",\n \"image\",\n \"circularImage\",\n \"diamond\",\n \"dot\",\n \"star\",\n \"triangle\",\n \"triangleDown\",\n \"square\",\n \"icon\",\n \"hexagon\",\n ],\n },\n ctxRenderer: { function: \"function\" },\n shapeProperties: {\n borderDashes: { boolean: bool, array },\n borderRadius: { number },\n interpolation: { boolean: bool },\n useImageSize: { boolean: bool },\n useBorderWithImage: { boolean: bool },\n coordinateOrigin: { string: [\"center\", \"top-left\"] },\n __type__: { object },\n },\n size: { number },\n title: { string, dom, undefined: \"undefined\" },\n value: { number, undefined: \"undefined\" },\n widthConstraint: {\n minimum: { number },\n maximum: { number },\n __type__: { object, boolean: bool, number },\n },\n x: { number },\n y: { number },\n __type__: { object },\n};\nconst allOptions: OptionsConfig = {\n configure: {\n enabled: { boolean: bool },\n filter: { boolean: bool, string, array, function: \"function\" },\n container: { dom },\n showButton: { boolean: bool },\n __type__: { object, boolean: bool, string, array, function: \"function\" },\n },\n edges: {\n arrows: {\n to: {\n enabled: { boolean: bool },\n scaleFactor: { number },\n type: { string: endPoints },\n imageHeight: { number },\n imageWidth: { number },\n src: { string },\n __type__: { object, boolean: bool },\n },\n middle: {\n enabled: { boolean: bool },\n scaleFactor: { number },\n type: { string: endPoints },\n imageWidth: { number },\n imageHeight: { number },\n src: { string },\n __type__: { object, boolean: bool },\n },\n from: {\n enabled: { boolean: bool },\n scaleFactor: { number },\n type: { string: endPoints },\n imageWidth: { number },\n imageHeight: { number },\n src: { string },\n __type__: { object, boolean: bool },\n },\n __type__: { string: [\"from\", \"to\", \"middle\"], object },\n },\n endPointOffset: {\n from: {\n number: number,\n },\n to: {\n number: number,\n },\n __type__: {\n object: object,\n number: number,\n },\n },\n arrowStrikethrough: { boolean: bool },\n background: {\n enabled: { boolean: bool },\n color: { string },\n size: { number },\n dashes: { boolean: bool, array },\n __type__: { object, boolean: bool },\n },\n chosen: {\n label: { boolean: bool, function: \"function\" },\n edge: { boolean: bool, function: \"function\" },\n __type__: { object, boolean: bool },\n },\n color: {\n color: { string },\n highlight: { string },\n hover: { string },\n inherit: { string: [\"from\", \"to\", \"both\"], boolean: bool },\n opacity: { number },\n __type__: { object, string },\n },\n dashes: { boolean: bool, array },\n font: {\n color: { string },\n size: { number }, // px\n face: { string },\n background: { string },\n strokeWidth: { number }, // px\n strokeColor: { string },\n align: { string: [\"horizontal\", \"top\", \"middle\", \"bottom\"] },\n vadjust: { number },\n multi: { boolean: bool, string },\n bold: {\n color: { string },\n size: { number }, // px\n face: { string },\n mod: { string },\n vadjust: { number },\n __type__: { object, string },\n },\n boldital: {\n color: { string },\n size: { number }, // px\n face: { string },\n mod: { string },\n vadjust: { number },\n __type__: { object, string },\n },\n ital: {\n color: { string },\n size: { number }, // px\n face: { string },\n mod: { string },\n vadjust: { number },\n __type__: { object, string },\n },\n mono: {\n color: { string },\n size: { number }, // px\n face: { string },\n mod: { string },\n vadjust: { number },\n __type__: { object, string },\n },\n __type__: { object, string },\n },\n hidden: { boolean: bool },\n hoverWidth: { function: \"function\", number },\n label: { string, undefined: \"undefined\" },\n labelHighlightBold: { boolean: bool },\n length: { number, undefined: \"undefined\" },\n physics: { boolean: bool },\n scaling: {\n min: { number },\n max: { number },\n label: {\n enabled: { boolean: bool },\n min: { number },\n max: { number },\n maxVisible: { number },\n drawThreshold: { number },\n __type__: { object, boolean: bool },\n },\n customScalingFunction: { function: \"function\" },\n __type__: { object },\n },\n selectionWidth: { function: \"function\", number },\n selfReferenceSize: { number },\n selfReference: {\n size: { number },\n angle: { number },\n renderBehindTheNode: { boolean: bool },\n __type__: { object },\n },\n shadow: {\n enabled: { boolean: bool },\n color: { string },\n size: { number },\n x: { number },\n y: { number },\n __type__: { object, boolean: bool },\n },\n smooth: {\n enabled: { boolean: bool },\n type: {\n string: [\n \"dynamic\",\n \"continuous\",\n \"discrete\",\n \"diagonalCross\",\n \"straightCross\",\n \"horizontal\",\n \"vertical\",\n \"curvedCW\",\n \"curvedCCW\",\n \"cubicBezier\",\n ],\n },\n roundness: { number },\n forceDirection: {\n string: [\"horizontal\", \"vertical\", \"none\"],\n boolean: bool,\n },\n __type__: { object, boolean: bool },\n },\n title: { string, undefined: \"undefined\" },\n width: { number },\n widthConstraint: {\n maximum: { number },\n __type__: { object, boolean: bool, number },\n },\n value: { number, undefined: \"undefined\" },\n __type__: { object },\n },\n groups: {\n useDefaultGroups: { boolean: bool },\n __any__: nodeOptions,\n __type__: { object },\n },\n interaction: {\n dragNodes: { boolean: bool },\n dragView: { boolean: bool },\n hideEdgesOnDrag: { boolean: bool },\n hideEdgesOnZoom: { boolean: bool },\n hideNodesOnDrag: { boolean: bool },\n hover: { boolean: bool },\n keyboard: {\n enabled: { boolean: bool },\n speed: {\n x: { number },\n y: { number },\n zoom: { number },\n __type__: { object },\n },\n bindToWindow: { boolean: bool },\n autoFocus: { boolean: bool },\n __type__: { object, boolean: bool },\n },\n multiselect: { boolean: bool },\n navigationButtons: { boolean: bool },\n selectable: { boolean: bool },\n selectConnectedEdges: { boolean: bool },\n hoverConnectedEdges: { boolean: bool },\n tooltipDelay: { number },\n zoomView: { boolean: bool },\n zoomSpeed: { number },\n __type__: { object },\n },\n layout: {\n randomSeed: { undefined: \"undefined\", number, string },\n improvedLayout: { boolean: bool },\n clusterThreshold: { number },\n hierarchical: {\n enabled: { boolean: bool },\n levelSeparation: { number },\n nodeSpacing: { number },\n treeSpacing: { number },\n blockShifting: { boolean: bool },\n edgeMinimization: { boolean: bool },\n parentCentralization: { boolean: bool },\n direction: { string: [\"UD\", \"DU\", \"LR\", \"RL\"] }, // UD, DU, LR, RL\n sortMethod: { string: [\"hubsize\", \"directed\"] }, // hubsize, directed\n shakeTowards: { string: [\"leaves\", \"roots\"] }, // leaves, roots\n __type__: { object, boolean: bool },\n },\n __type__: { object },\n },\n manipulation: {\n enabled: { boolean: bool },\n initiallyActive: { boolean: bool },\n addNode: { boolean: bool, function: \"function\" },\n addEdge: { boolean: bool, function: \"function\" },\n editNode: { function: \"function\" },\n editEdge: {\n editWithoutDrag: { function: \"function\" },\n __type__: { object, boolean: bool, function: \"function\" },\n },\n deleteNode: { boolean: bool, function: \"function\" },\n deleteEdge: { boolean: bool, function: \"function\" },\n controlNodeStyle: nodeOptions,\n __type__: { object, boolean: bool },\n },\n nodes: nodeOptions,\n physics: {\n enabled: { boolean: bool },\n barnesHut: {\n theta: { number },\n gravitationalConstant: { number },\n centralGravity: { number },\n springLength: { number },\n springConstant: { number },\n damping: { number },\n avoidOverlap: { number },\n __type__: { object },\n },\n forceAtlas2Based: {\n theta: { number },\n gravitationalConstant: { number },\n centralGravity: { number },\n springLength: { number },\n springConstant: { number },\n damping: { number },\n avoidOverlap: { number },\n __type__: { object },\n },\n repulsion: {\n centralGravity: { number },\n springLength: { number },\n springConstant: { number },\n nodeDistance: { number },\n damping: { number },\n __type__: { object },\n },\n hierarchicalRepulsion: {\n centralGravity: { number },\n springLength: { number },\n springConstant: { number },\n nodeDistance: { number },\n damping: { number },\n avoidOverlap: { number },\n __type__: { object },\n },\n maxVelocity: { number },\n minVelocity: { number }, // px/s\n solver: {\n string: [\n \"barnesHut\",\n \"repulsion\",\n \"hierarchicalRepulsion\",\n \"forceAtlas2Based\",\n ],\n },\n stabilization: {\n enabled: { boolean: bool },\n iterations: { number }, // maximum number of iteration to stabilize\n updateInterval: { number },\n onlyDynamicEdges: { boolean: bool },\n fit: { boolean: bool },\n __type__: { object, boolean: bool },\n },\n timestep: { number },\n adaptiveTimestep: { boolean: bool },\n wind: {\n x: { number },\n y: { number },\n __type__: { object },\n },\n __type__: { object, boolean: bool },\n },\n\n //globals :\n autoResize: { boolean: bool },\n clickToUse: { boolean: bool },\n locale: { string },\n locales: {\n __any__: { any },\n __type__: { object },\n },\n height: { string },\n width: { string },\n __type__: { object },\n};\n/* eslint-enable @typescript-eslint/naming-convention */\n\n/**\n * This provides ranges, initial values, steps and dropdown menu choices for the\n * configuration.\n *\n * @remarks\n * Checkbox: `boolean`\n * The value supllied will be used as the initial value.\n *\n * Text field: `string`\n * The passed text will be used as the initial value. Any text will be\n * accepted afterwards.\n *\n * Number range: `[number, number, number, number]`\n * The meanings are `[initial value, min, max, step]`.\n *\n * Dropdown: `[Exclude<string, \"color\">, ...(string | number | boolean)[]]`\n * Translations for people with poor understanding of TypeScript: the first\n * value always has to be a string but never `\"color\"`, the rest can be any\n * combination of strings, numbers and booleans.\n *\n * Color picker: `[\"color\", string]`\n * The first value says this will be a color picker not a dropdown menu. The\n * next value is the initial color.\n */\nconst configureOptions: ConfiguratorConfig = {\n nodes: {\n borderWidth: [1, 0, 10, 1],\n borderWidthSelected: [2, 0, 10, 1],\n color: {\n border: [\"color\", \"#2B7CE9\"],\n background: [\"color\", \"#97C2FC\"],\n highlight: {\n border: [\"color\", \"#2B7CE9\"],\n background: [\"color\", \"#D2E5FF\"],\n },\n hover: {\n border: [\"color\", \"#2B7CE9\"],\n background: [\"color\", \"#D2E5FF\"],\n },\n },\n opacity: [0, 0, 1, 0.1],\n fixed: {\n x: false,\n y: false,\n },\n font: {\n color: [\"color\", \"#343434\"],\n size: [14, 0, 100, 1], // px\n face: [\"arial\", \"verdana\", \"tahoma\"],\n background: [\"color\", \"none\"],\n strokeWidth: [0, 0, 50, 1], // px\n strokeColor: [\"color\", \"#ffffff\"],\n },\n //group: 'string',\n hidden: false,\n labelHighlightBold: true,\n //icon: {\n // face: 'string', //'FontAwesome',\n // code: 'string', //'\\uf007',\n // size: [50, 0, 200, 1], //50,\n // color: ['color','#2B7CE9'] //'#aa00ff'\n //},\n //image: 'string', // --> URL\n physics: true,\n scaling: {\n min: [10, 0, 200, 1],\n max: [30, 0, 200, 1],\n label: {\n enabled: false,\n min: [14, 0, 200, 1],\n max: [30, 0, 200, 1],\n maxVisible: [30, 0, 200, 1],\n drawThreshold: [5, 0, 20, 1],\n },\n },\n shadow: {\n enabled: false,\n color: \"rgba(0,0,0,0.5)\",\n size: [10, 0, 20, 1],\n x: [5, -30, 30, 1],\n y: [5, -30, 30, 1],\n },\n shape: [\n \"ellipse\",\n \"box\",\n \"circle\",\n \"database\",\n \"diamond\",\n \"dot\",\n \"square\",\n \"star\",\n \"text\",\n \"triangle\",\n \"triangleDown\",\n \"hexagon\",\n ],\n shapeProperties: {\n borderDashes: false,\n borderRadius: [6, 0, 20, 1],\n interpolation: true,\n useImageSize: false,\n },\n size: [25, 0, 200, 1],\n },\n edges: {\n arrows: {\n to: { enabled: false, scaleFactor: [1, 0, 3, 0.05], type: \"arrow\" },\n middle: { enabled: false, scaleFactor: [1, 0, 3, 0.05], type: \"arrow\" },\n from: { enabled: false, scaleFactor: [1, 0, 3, 0.05], type: \"arrow\" },\n },\n endPointOffset: {\n from: [0, -10, 10, 1],\n to: [0, -10, 10, 1],\n },\n arrowStrikethrough: true,\n color: {\n color: [\"color\", \"#848484\"],\n highlight: [\"color\", \"#848484\"],\n hover: [\"color\", \"#848484\"],\n inherit: [\"from\", \"to\", \"both\", true, false],\n opacity: [1, 0, 1, 0.05],\n },\n dashes: false,\n font: {\n color: [\"color\", \"#343434\"],\n size: [14, 0, 100, 1], // px\n face: [\"arial\", \"verdana\", \"tahoma\"],\n background: [\"color\", \"none\"],\n strokeWidth: [2, 0, 50, 1], // px\n strokeColor: [\"color\", \"#ffffff\"],\n align: [\"horizontal\", \"top\", \"middle\", \"bottom\"],\n },\n hidden: false,\n hoverWidth: [1.5, 0, 5, 0.1],\n labelHighlightBold: true,\n physics: true,\n scaling: {\n min: [1, 0, 100, 1],\n max: [15, 0, 100, 1],\n label: {\n enabled: true,\n min: [14, 0, 200, 1],\n max: [30, 0, 200, 1],\n maxVisible: [30, 0, 200, 1],\n drawThreshold: [5, 0, 20, 1],\n },\n },\n selectionWidth: [1.5, 0, 5, 0.1],\n selfReferenceSize: [20, 0, 200, 1],\n selfReference: {\n size: [20, 0, 200, 1],\n angle: [Math.PI / 2, -6 * Math.PI, 6 * Math.PI, Math.PI / 8],\n renderBehindTheNode: true,\n },\n shadow: {\n enabled: false,\n color: \"rgba(0,0,0,0.5)\",\n size: [10, 0, 20, 1],\n x: [5, -30, 30, 1],\n y: [5, -30, 30, 1],\n },\n smooth: {\n enabled: true,\n type: [\n \"dynamic\",\n \"continuous\",\n \"discrete\",\n \"diagonalCross\",\n \"straightCross\",\n \"horizontal\",\n \"vertical\",\n \"curvedCW\",\n \"curvedCCW\",\n \"cubicBezier\",\n ],\n forceDirection: [\"horizontal\", \"vertical\", \"none\"],\n roundness: [0.5, 0, 1, 0.05],\n },\n width: [1, 0, 30, 1],\n },\n layout: {\n //randomSeed: [0, 0, 500, 1],\n //improvedLayout: true,\n hierarchical: {\n enabled: false,\n levelSeparation: [150, 20, 500, 5],\n nodeSpacing: [100, 20, 500, 5],\n treeSpacing: [200, 20, 500, 5],\n blockShifting: true,\n edgeMinimization: true,\n parentCentralization: true,\n direction: [\"UD\", \"DU\", \"LR\", \"RL\"], // UD, DU, LR, RL\n sortMethod: [\"hubsize\", \"directed\"], // hubsize, directed\n shakeTowards: [\"leaves\", \"roots\"], // leaves, roots\n },\n },\n interaction: {\n dragNodes: true,\n dragView: true,\n hideEdgesOnDrag: false,\n hideEdgesOnZoom: false,\n hideNodesOnDrag: false,\n hover: false,\n keyboard: {\n enabled: false,\n speed: {\n x: [10, 0, 40, 1],\n y: [10, 0, 40, 1],\n zoom: [0.02, 0, 0.1, 0.005],\n },\n bindToWindow: true,\n autoFocus: true,\n },\n multiselect: false,\n navigationButtons: false,\n selectable: true,\n selectConnectedEdges: true,\n hoverConnectedEdges: true,\n tooltipDelay: [300, 0, 1000, 25],\n zoomView: true,\n zoomSpeed: [1, 0.1, 2, 0.1],\n },\n manipulation: {\n enabled: false,\n initiallyActive: false,\n },\n physics: {\n enabled: true,\n barnesHut: {\n theta: [0.5, 0.1, 1, 0.05],\n gravitationalConstant: [-2000, -30000, 0, 50],\n centralGravity: [0.3, 0, 10, 0.05],\n springLength: [95, 0, 500, 5],\n springConstant: [0.04, 0, 1.2, 0.005],\n damping: [0.09, 0, 1, 0.01],\n avoidOverlap: [0, 0, 1, 0.01],\n },\n forceAtlas2Based: {\n theta: [0.5, 0.1, 1, 0.05],\n gravitationalConstant: [-50, -500, 0, 1],\n centralGravity: [0.01, 0, 1, 0.005],\n springLength: [95, 0, 500, 5],\n springConstant: [0.08, 0, 1.2, 0.005],\n damping: [0.4, 0, 1, 0.01],\n avoidOverlap: [0, 0, 1, 0.01],\n },\n repulsion: {\n centralGravity: [0.2, 0, 10, 0.05],\n springLength: [200, 0, 500, 5],\n springConstant: [0.05, 0, 1.2, 0.005],\n nodeDistance: [100, 0, 500, 5],\n damping: [0.09, 0, 1, 0.01],\n },\n hierarchicalRepulsion: {\n centralGravity: [0.2, 0, 10, 0.05],\n springLength: [100, 0, 500, 5],\n springConstant: [0.01, 0, 1.2, 0.005],\n nodeDistance: [120, 0, 500, 5],\n damping: [0.09, 0, 1, 0.01],\n avoidOverlap: [0, 0, 1, 0.01],\n },\n maxVelocity: [50, 0, 150, 1],\n minVelocity: [0.1, 0.01, 0.5, 0.01],\n solver: [\n \"barnesHut\",\n \"forceAtlas2Based\",\n \"repulsion\",\n \"hierarchicalRepulsion\",\n ],\n timestep: [0.5, 0.01, 1, 0.01],\n wind: {\n x: [0, -10, 10, 0.1],\n y: [0, -10, 10, 0.1],\n },\n //adaptiveTimestep: true\n },\n} as const;\n\nexport const configuratorHideOption: ConfiguratorHideOption = (\n parentPath,\n optionName,\n options\n): boolean => {\n if (\n parentPath.includes(\"physics\") &&\n (configureOptions as any).physics.solver.includes(optionName) &&\n options.physics.solver !== optionName &&\n optionName !== \"wind\"\n ) {\n return true;\n }\n\n return false;\n};\n\nexport { allOptions, configureOptions };\n","/**\n * The Floyd–Warshall algorithm is an algorithm for finding shortest paths in\n * a weighted graph with positive or negative edge weights (but with no negative\n * cycles). - https://en.wikipedia.org/wiki/Floyd–Warshall_algorithm\n */\nclass FloydWarshall {\n /**\n * @ignore\n */\n constructor() {}\n\n /**\n *\n * @param {object} body\n * @param {Array.<Node>} nodesArray\n * @param {Array.<Edge>} edgesArray\n * @returns {{}}\n */\n getDistances(body, nodesArray, edgesArray) {\n const D_matrix = {};\n const edges = body.edges;\n\n // prepare matrix with large numbers\n for (let i = 0; i < nodesArray.length; i++) {\n const node = nodesArray[i];\n const cell = {};\n D_matrix[node] = cell;\n for (let j = 0; j < nodesArray.length; j++) {\n cell[nodesArray[j]] = i == j ? 0 : 1e9;\n }\n }\n\n // put the weights for the edges in. This assumes unidirectionality.\n for (let i = 0; i < edgesArray.length; i++) {\n const edge = edges[edgesArray[i]];\n // edge has to be connected if it counts to the distances. If it is connected to inner clusters it will crash so we also check if it is in the D_matrix\n if (\n edge.connected === true &&\n D_matrix[edge.fromId] !== undefined &&\n D_matrix[edge.toId] !== undefined\n ) {\n D_matrix[edge.fromId][edge.toId] = 1;\n D_matrix[edge.toId][edge.fromId] = 1;\n }\n }\n\n const nodeCount = nodesArray.length;\n\n // Adapted FloydWarshall based on unidirectionality to greatly reduce complexity.\n for (let k = 0; k < nodeCount; k++) {\n const knode = nodesArray[k];\n const kcolm = D_matrix[knode];\n for (let i = 0; i < nodeCount - 1; i++) {\n const inode = nodesArray[i];\n const icolm = D_matrix[inode];\n for (let j = i + 1; j < nodeCount; j++) {\n const jnode = nodesArray[j];\n const jcolm = D_matrix[jnode];\n\n const val = Math.min(icolm[jnode], icolm[knode] + kcolm[jnode]);\n icolm[jnode] = val;\n jcolm[inode] = val;\n }\n }\n }\n\n return D_matrix;\n }\n}\n\nexport default FloydWarshall;\n","// distance finding algorithm\nimport FloydWarshall from \"./components/algorithms/FloydWarshall.js\";\n\n/**\n * KamadaKawai positions the nodes initially based on\n *\n * \"AN ALGORITHM FOR DRAWING GENERAL UNDIRECTED GRAPHS\"\n * -- Tomihisa KAMADA and Satoru KAWAI in 1989\n *\n * Possible optimizations in the distance calculation can be implemented.\n */\nclass KamadaKawai {\n /**\n * @param {object} body\n * @param {number} edgeLength\n * @param {number} edgeStrength\n */\n constructor(body, edgeLength, edgeStrength) {\n this.body = body;\n this.springLength = edgeLength;\n this.springConstant = edgeStrength;\n this.distanceSolver = new FloydWarshall();\n }\n\n /**\n * Not sure if needed but can be used to update the spring length and spring constant\n *\n * @param {object} options\n */\n setOptions(options) {\n if (options) {\n if (options.springLength) {\n this.springLength = options.springLength;\n }\n if (options.springConstant) {\n this.springConstant = options.springConstant;\n }\n }\n }\n\n /**\n * Position the system\n *\n * @param {Array.<Node>} nodesArray\n * @param {Array.<vis.Edge>} edgesArray\n * @param {boolean} [ignoreClusters=false]\n */\n solve(nodesArray, edgesArray, ignoreClusters = false) {\n // get distance matrix\n const D_matrix = this.distanceSolver.getDistances(\n this.body,\n nodesArray,\n edgesArray\n ); // distance matrix\n\n // get the L Matrix\n this._createL_matrix(D_matrix);\n\n // get the K Matrix\n this._createK_matrix(D_matrix);\n\n // initial E Matrix\n this._createE_matrix();\n\n // calculate positions\n const threshold = 0.01;\n const innerThreshold = 1;\n let iterations = 0;\n const maxIterations = Math.max(\n 1000,\n Math.min(10 * this.body.nodeIndices.length, 6000)\n );\n const maxInnerIterations = 5;\n\n let maxEnergy = 1e9;\n let highE_nodeId = 0,\n dE_dx = 0,\n dE_dy = 0,\n delta_m = 0,\n subIterations = 0;\n\n while (maxEnergy > threshold && iterations < maxIterations) {\n iterations += 1;\n [highE_nodeId, maxEnergy, dE_dx, dE_dy] =\n this._getHighestEnergyNode(ignoreClusters);\n delta_m = maxEnergy;\n subIterations = 0;\n while (delta_m > innerThreshold && subIterations < maxInnerIterations) {\n subIterations += 1;\n this._moveNode(highE_nodeId, dE_dx, dE_dy);\n [delta_m, dE_dx, dE_dy] = this._getEnergy(highE_nodeId);\n }\n }\n }\n\n /**\n * get the node with the highest energy\n *\n * @param {boolean} ignoreClusters\n * @returns {number[]}\n * @private\n */\n _getHighestEnergyNode(ignoreClusters) {\n const nodesArray = this.body.nodeIndices;\n const nodes = this.body.nodes;\n let maxEnergy = 0;\n let maxEnergyNodeId = nodesArray[0];\n let dE_dx_max = 0,\n dE_dy_max = 0;\n\n for (let nodeIdx = 0; nodeIdx < nodesArray.length; nodeIdx++) {\n const m = nodesArray[nodeIdx];\n // by not evaluating nodes with predefined positions we should only move nodes that have no positions.\n if (\n nodes[m].predefinedPosition !== true ||\n (nodes[m].isCluster === true && ignoreClusters === true) ||\n nodes[m].options.fixed.x !== true ||\n nodes[m].options.fixed.y !== true\n ) {\n const [delta_m, dE_dx, dE_dy] = this._getEnergy(m);\n if (maxEnergy < delta_m) {\n maxEnergy = delta_m;\n maxEnergyNodeId = m;\n dE_dx_max = dE_dx;\n dE_dy_max = dE_dy;\n }\n }\n }\n\n return [maxEnergyNodeId, maxEnergy, dE_dx_max, dE_dy_max];\n }\n\n /**\n * calculate the energy of a single node\n *\n * @param {Node.id} m\n * @returns {number[]}\n * @private\n */\n _getEnergy(m) {\n const [dE_dx, dE_dy] = this.E_sums[m];\n const delta_m = Math.sqrt(dE_dx ** 2 + dE_dy ** 2);\n return [delta_m, dE_dx, dE_dy];\n }\n\n /**\n * move the node based on it's energy\n * the dx and dy are calculated from the linear system proposed by Kamada and Kawai\n *\n * @param {number} m\n * @param {number} dE_dx\n * @param {number} dE_dy\n * @private\n */\n _moveNode(m, dE_dx, dE_dy) {\n const nodesArray = this.body.nodeIndices;\n const nodes = this.body.nodes;\n let d2E_dx2 = 0;\n let d2E_dxdy = 0;\n let d2E_dy2 = 0;\n\n const x_m = nodes[m].x;\n const y_m = nodes[m].y;\n const km = this.K_matrix[m];\n const lm = this.L_matrix[m];\n\n for (let iIdx = 0; iIdx < nodesArray.length; iIdx++) {\n const i = nodesArray[iIdx];\n if (i !== m) {\n const x_i = nodes[i].x;\n const y_i = nodes[i].y;\n const kmat = km[i];\n const lmat = lm[i];\n const denominator = 1.0 / ((x_m - x_i) ** 2 + (y_m - y_i) ** 2) ** 1.5;\n d2E_dx2 += kmat * (1 - lmat * (y_m - y_i) ** 2 * denominator);\n d2E_dxdy += kmat * (lmat * (x_m - x_i) * (y_m - y_i) * denominator);\n d2E_dy2 += kmat * (1 - lmat * (x_m - x_i) ** 2 * denominator);\n }\n }\n // make the variable names easier to make the solving of the linear system easier to read\n const A = d2E_dx2,\n B = d2E_dxdy,\n C = dE_dx,\n D = d2E_dy2,\n E = dE_dy;\n\n // solve the linear system for dx and dy\n const dy = (C / A + E / B) / (B / A - D / B);\n const dx = -(B * dy + C) / A;\n\n // move the node\n nodes[m].x += dx;\n nodes[m].y += dy;\n\n // Recalculate E_matrix (should be incremental)\n this._updateE_matrix(m);\n }\n\n /**\n * Create the L matrix: edge length times shortest path\n *\n * @param {object} D_matrix\n * @private\n */\n _createL_matrix(D_matrix) {\n const nodesArray = this.body.nodeIndices;\n const edgeLength = this.springLength;\n\n this.L_matrix = [];\n for (let i = 0; i < nodesArray.length; i++) {\n this.L_matrix[nodesArray[i]] = {};\n for (let j = 0; j < nodesArray.length; j++) {\n this.L_matrix[nodesArray[i]][nodesArray[j]] =\n edgeLength * D_matrix[nodesArray[i]][nodesArray[j]];\n }\n }\n }\n\n /**\n * Create the K matrix: spring constants times shortest path\n *\n * @param {object} D_matrix\n * @private\n */\n _createK_matrix(D_matrix) {\n const nodesArray = this.body.nodeIndices;\n const edgeStrength = this.springConstant;\n\n this.K_matrix = [];\n for (let i = 0; i < nodesArray.length; i++) {\n this.K_matrix[nodesArray[i]] = {};\n for (let j = 0; j < nodesArray.length; j++) {\n this.K_matrix[nodesArray[i]][nodesArray[j]] =\n edgeStrength * D_matrix[nodesArray[i]][nodesArray[j]] ** -2;\n }\n }\n }\n\n /**\n * Create matrix with all energies between nodes\n *\n * @private\n */\n _createE_matrix() {\n const nodesArray = this.body.nodeIndices;\n const nodes = this.body.nodes;\n this.E_matrix = {};\n this.E_sums = {};\n for (let mIdx = 0; mIdx < nodesArray.length; mIdx++) {\n this.E_matrix[nodesArray[mIdx]] = [];\n }\n for (let mIdx = 0; mIdx < nodesArray.length; mIdx++) {\n const m = nodesArray[mIdx];\n const x_m = nodes[m].x;\n const y_m = nodes[m].y;\n let dE_dx = 0;\n let dE_dy = 0;\n for (let iIdx = mIdx; iIdx < nodesArray.length; iIdx++) {\n const i = nodesArray[iIdx];\n if (i !== m) {\n const x_i = nodes[i].x;\n const y_i = nodes[i].y;\n const denominator =\n 1.0 / Math.sqrt((x_m - x_i) ** 2 + (y_m - y_i) ** 2);\n this.E_matrix[m][iIdx] = [\n this.K_matrix[m][i] *\n (x_m - x_i - this.L_matrix[m][i] * (x_m - x_i) * denominator),\n this.K_matrix[m][i] *\n (y_m - y_i - this.L_matrix[m][i] * (y_m - y_i) * denominator),\n ];\n this.E_matrix[i][mIdx] = this.E_matrix[m][iIdx];\n dE_dx += this.E_matrix[m][iIdx][0];\n dE_dy += this.E_matrix[m][iIdx][1];\n }\n }\n //Store sum\n this.E_sums[m] = [dE_dx, dE_dy];\n }\n }\n\n /**\n * Update method, just doing single column (rows are auto-updated) (update all sums)\n *\n * @param {number} m\n * @private\n */\n _updateE_matrix(m) {\n const nodesArray = this.body.nodeIndices;\n const nodes = this.body.nodes;\n const colm = this.E_matrix[m];\n const kcolm = this.K_matrix[m];\n const lcolm = this.L_matrix[m];\n const x_m = nodes[m].x;\n const y_m = nodes[m].y;\n let dE_dx = 0;\n let dE_dy = 0;\n for (let iIdx = 0; iIdx < nodesArray.length; iIdx++) {\n const i = nodesArray[iIdx];\n if (i !== m) {\n //Keep old energy value for sum modification below\n const cell = colm[iIdx];\n const oldDx = cell[0];\n const oldDy = cell[1];\n\n //Calc new energy:\n const x_i = nodes[i].x;\n const y_i = nodes[i].y;\n const denominator =\n 1.0 / Math.sqrt((x_m - x_i) ** 2 + (y_m - y_i) ** 2);\n const dx =\n kcolm[i] * (x_m - x_i - lcolm[i] * (x_m - x_i) * denominator);\n const dy =\n kcolm[i] * (y_m - y_i - lcolm[i] * (y_m - y_i) * denominator);\n colm[iIdx] = [dx, dy];\n dE_dx += dx;\n dE_dy += dy;\n\n //add new energy to sum of each column\n const sum = this.E_sums[i];\n sum[0] += dx - oldDx;\n sum[1] += dy - oldDy;\n }\n }\n //Store sum at -1 index\n this.E_sums[m] = [dE_dx, dE_dy];\n }\n}\n\nexport default KamadaKawai;\n","// Load custom shapes into CanvasRenderingContext2D\nimport \"./shapes\";\n\nimport \"vis-util/esnext/styles/activator.css\";\nimport \"vis-util/esnext/styles/bootstrap.css\";\nimport \"vis-util/esnext/styles/color-picker.css\";\nimport \"vis-util/esnext/styles/configurator.css\";\nimport \"vis-util/esnext/styles/popup.css\";\n\nimport Emitter from \"component-emitter\";\nimport {\n Activator,\n Configurator,\n VALIDATOR_PRINT_STYLE,\n Validator,\n deepExtend,\n recursiveDOMDelete,\n selectiveDeepExtend,\n} from \"vis-util/esnext\";\nimport { DOTToGraph } from \"./dotparser\";\nimport { parseGephi } from \"./gephiParser\";\nimport * as locales from \"./locales\";\nimport { normalizeLanguageCode } from \"./locale-utils\";\n\nimport Images from \"./Images\";\nimport { Groups } from \"./modules/Groups\";\nimport NodesHandler from \"./modules/NodesHandler\";\nimport EdgesHandler from \"./modules/EdgesHandler\";\nimport PhysicsEngine from \"./modules/PhysicsEngine\";\nimport ClusterEngine from \"./modules/Clustering\";\nimport CanvasRenderer from \"./modules/CanvasRenderer\";\nimport Canvas from \"./modules/Canvas\";\nimport View from \"./modules/View\";\nimport InteractionHandler from \"./modules/InteractionHandler\";\nimport SelectionHandler from \"./modules/SelectionHandler\";\nimport LayoutEngine from \"./modules/LayoutEngine\";\nimport ManipulationSystem from \"./modules/ManipulationSystem\";\nimport {\n allOptions,\n configureOptions,\n configuratorHideOption,\n} from \"./options\";\nimport KamadaKawai from \"./modules/KamadaKawai.js\";\n\n/**\n * Create a network visualization, displaying nodes and edges.\n *\n * @param {Element} container The DOM element in which the Network will\n * be created. Normally a div element.\n * @param {object} data An object containing parameters\n * {Array} nodes\n * {Array} edges\n * @param {object} options Options\n * @class Network\n */\nexport function Network(container, data, options) {\n if (!(this instanceof Network)) {\n throw new SyntaxError(\"Constructor must be called with the new operator\");\n }\n\n // set constant values\n this.options = {};\n this.defaultOptions = {\n locale: \"en\",\n locales: locales,\n clickToUse: false,\n };\n Object.assign(this.options, this.defaultOptions);\n\n /**\n * Containers for nodes and edges.\n *\n * 'edges' and 'nodes' contain the full definitions of all the network elements.\n * 'nodeIndices' and 'edgeIndices' contain the id's of the active elements.\n *\n * The distinction is important, because a defined node need not be active, i.e.\n * visible on the canvas. This happens in particular when clusters are defined, in\n * that case there will be nodes and edges not displayed.\n * The bottom line is that all code with actions related to visibility, *must* use\n * 'nodeIndices' and 'edgeIndices', not 'nodes' and 'edges' directly.\n */\n this.body = {\n container: container,\n\n // See comment above for following fields\n nodes: {},\n nodeIndices: [],\n edges: {},\n edgeIndices: [],\n\n emitter: {\n on: this.on.bind(this),\n off: this.off.bind(this),\n emit: this.emit.bind(this),\n once: this.once.bind(this),\n },\n eventListeners: {\n onTap: function () {},\n onTouch: function () {},\n onDoubleTap: function () {},\n onHold: function () {},\n onDragStart: function () {},\n onDrag: function () {},\n onDragEnd: function () {},\n onMouseWheel: function () {},\n onPinch: function () {},\n onMouseMove: function () {},\n onRelease: function () {},\n onContext: function () {},\n },\n data: {\n nodes: null, // A DataSet or DataView\n edges: null, // A DataSet or DataView\n },\n functions: {\n createNode: function () {},\n createEdge: function () {},\n getPointer: function () {},\n },\n modules: {},\n view: {\n scale: 1,\n translation: { x: 0, y: 0 },\n },\n selectionBox: {\n show: false,\n position: {\n start: { x: 0, y: 0 },\n end: { x: 0, y: 0 },\n },\n },\n };\n\n // bind the event listeners\n this.bindEventListeners();\n\n // setting up all modules\n this.images = new Images(() => this.body.emitter.emit(\"_requestRedraw\")); // object with images\n this.groups = new Groups(); // object with groups\n this.canvas = new Canvas(this.body); // DOM handler\n this.selectionHandler = new SelectionHandler(this.body, this.canvas); // Selection handler\n this.interactionHandler = new InteractionHandler(\n this.body,\n this.canvas,\n this.selectionHandler\n ); // Interaction handler handles all the hammer bindings (that are bound by canvas), key\n this.view = new View(this.body, this.canvas); // camera handler, does animations and zooms\n this.renderer = new CanvasRenderer(this.body, this.canvas); // renderer, starts renderloop, has events that modules can hook into\n this.physics = new PhysicsEngine(this.body); // physics engine, does all the simulations\n this.layoutEngine = new LayoutEngine(this.body); // layout engine for inital layout and hierarchical layout\n this.clustering = new ClusterEngine(this.body); // clustering api\n this.manipulation = new ManipulationSystem(\n this.body,\n this.canvas,\n this.selectionHandler,\n this.interactionHandler\n ); // data manipulation system\n\n this.nodesHandler = new NodesHandler(\n this.body,\n this.images,\n this.groups,\n this.layoutEngine\n ); // Handle adding, deleting and updating of nodes as well as global options\n this.edgesHandler = new EdgesHandler(this.body, this.images, this.groups); // Handle adding, deleting and updating of edges as well as global options\n\n this.body.modules[\"kamadaKawai\"] = new KamadaKawai(this.body, 150, 0.05); // Layouting algorithm.\n this.body.modules[\"clustering\"] = this.clustering;\n\n // create the DOM elements\n this.canvas._create();\n\n // apply options\n this.setOptions(options);\n\n // load data (the disable start variable will be the same as the enabled clustering)\n this.setData(data);\n}\n\n// Extend Network with an Emitter mixin\nEmitter(Network.prototype);\n\n/**\n * Set options\n *\n * @param {object} options\n */\nNetwork.prototype.setOptions = function (options) {\n if (options === null) {\n options = undefined; // This ensures that options handling doesn't crash in the handling\n }\n\n if (options !== undefined) {\n const errorFound = Validator.validate(options, allOptions);\n if (errorFound === true) {\n console.error(\n \"%cErrors have been found in the supplied options object.\",\n VALIDATOR_PRINT_STYLE\n );\n }\n\n // copy the global fields over\n const fields = [\"locale\", \"locales\", \"clickToUse\"];\n selectiveDeepExtend(fields, this.options, options);\n\n // normalize the locale or use English\n if (options.locale !== undefined) {\n options.locale = normalizeLanguageCode(\n options.locales || this.options.locales,\n options.locale\n );\n }\n\n // the hierarchical system can adapt the edges and the physics to it's own options because not all combinations work with the hierarichical system.\n options = this.layoutEngine.setOptions(options.layout, options);\n\n this.canvas.setOptions(options); // options for canvas are in globals\n\n // pass the options to the modules\n this.groups.setOptions(options.groups);\n this.nodesHandler.setOptions(options.nodes);\n this.edgesHandler.setOptions(options.edges);\n this.physics.setOptions(options.physics);\n this.manipulation.setOptions(options.manipulation, options, this.options); // manipulation uses the locales in the globals\n\n this.interactionHandler.setOptions(options.interaction);\n this.renderer.setOptions(options.interaction); // options for rendering are in interaction\n this.selectionHandler.setOptions(options.interaction); // options for selection are in interaction\n\n // reload the settings of the nodes to apply changes in groups that are not referenced by pointer.\n if (options.groups !== undefined) {\n this.body.emitter.emit(\"refreshNodes\");\n }\n // these two do not have options at the moment, here for completeness\n //this.view.setOptions(options.view);\n //this.clustering.setOptions(options.clustering);\n\n if (\"configure\" in options) {\n if (!this.configurator) {\n this.configurator = new Configurator(\n this,\n this.body.container,\n configureOptions,\n this.canvas.pixelRatio,\n configuratorHideOption\n );\n }\n\n this.configurator.setOptions(options.configure);\n }\n\n // if the configuration system is enabled, copy all options and put them into the config system\n if (this.configurator && this.configurator.options.enabled === true) {\n const networkOptions = {\n nodes: {},\n edges: {},\n layout: {},\n interaction: {},\n manipulation: {},\n physics: {},\n global: {},\n };\n deepExtend(networkOptions.nodes, this.nodesHandler.options);\n deepExtend(networkOptions.edges, this.edgesHandler.options);\n deepExtend(networkOptions.layout, this.layoutEngine.options);\n // load the selectionHandler and render default options in to the interaction group\n deepExtend(networkOptions.interaction, this.selectionHandler.options);\n deepExtend(networkOptions.interaction, this.renderer.options);\n\n deepExtend(networkOptions.interaction, this.interactionHandler.options);\n deepExtend(networkOptions.manipulation, this.manipulation.options);\n deepExtend(networkOptions.physics, this.physics.options);\n\n // load globals into the global object\n deepExtend(networkOptions.global, this.canvas.options);\n deepExtend(networkOptions.global, this.options);\n\n this.configurator.setModuleOptions(networkOptions);\n }\n\n // handle network global options\n if (options.clickToUse !== undefined) {\n if (options.clickToUse === true) {\n if (this.activator === undefined) {\n this.activator = new Activator(this.canvas.frame);\n this.activator.on(\"change\", () => {\n this.body.emitter.emit(\"activate\");\n });\n }\n } else {\n if (this.activator !== undefined) {\n this.activator.destroy();\n delete this.activator;\n }\n this.body.emitter.emit(\"activate\");\n }\n } else {\n this.body.emitter.emit(\"activate\");\n }\n\n this.canvas.setSize();\n // start the physics simulation. Can be safely called multiple times.\n this.body.emitter.emit(\"startSimulation\");\n }\n};\n\n/**\n * Update the visible nodes and edges list with the most recent node state.\n *\n * Visible nodes are stored in this.body.nodeIndices.\n * Visible edges are stored in this.body.edgeIndices.\n * A node or edges is visible if it is not hidden or clustered.\n *\n * @private\n */\nNetwork.prototype._updateVisibleIndices = function () {\n const nodes = this.body.nodes;\n const edges = this.body.edges;\n this.body.nodeIndices = [];\n this.body.edgeIndices = [];\n\n for (const nodeId in nodes) {\n if (Object.prototype.hasOwnProperty.call(nodes, nodeId)) {\n if (\n !this.clustering._isClusteredNode(nodeId) &&\n nodes[nodeId].options.hidden === false\n ) {\n this.body.nodeIndices.push(nodes[nodeId].id);\n }\n }\n }\n\n for (const edgeId in edges) {\n if (Object.prototype.hasOwnProperty.call(edges, edgeId)) {\n const edge = edges[edgeId];\n\n // It can happen that this is executed *after* a node edge has been removed,\n // but *before* the edge itself has been removed. Taking this into account.\n const fromNode = nodes[edge.fromId];\n const toNode = nodes[edge.toId];\n const edgeNodesPresent = fromNode !== undefined && toNode !== undefined;\n\n const isVisible =\n !this.clustering._isClusteredEdge(edgeId) &&\n edge.options.hidden === false &&\n edgeNodesPresent &&\n fromNode.options.hidden === false && // Also hidden if any of its connecting nodes are hidden\n toNode.options.hidden === false; // idem\n\n if (isVisible) {\n this.body.edgeIndices.push(edge.id);\n }\n }\n }\n};\n\n/**\n * Bind all events\n */\nNetwork.prototype.bindEventListeners = function () {\n // This event will trigger a rebuilding of the cache everything.\n // Used when nodes or edges have been added or removed.\n this.body.emitter.on(\"_dataChanged\", () => {\n this.edgesHandler._updateState();\n this.body.emitter.emit(\"_dataUpdated\");\n });\n\n // this is called when options of EXISTING nodes or edges have changed.\n this.body.emitter.on(\"_dataUpdated\", () => {\n // Order important in following block\n this.clustering._updateState();\n this._updateVisibleIndices();\n\n this._updateValueRange(this.body.nodes);\n this._updateValueRange(this.body.edges);\n // start simulation (can be called safely, even if already running)\n this.body.emitter.emit(\"startSimulation\");\n this.body.emitter.emit(\"_requestRedraw\");\n });\n};\n\n/**\n * Set nodes and edges, and optionally options as well.\n *\n * @param {object} data Object containing parameters:\n * {Array | DataSet | DataView} [nodes] Array with nodes\n * {Array | DataSet | DataView} [edges] Array with edges\n * {String} [dot] String containing data in DOT format\n * {String} [gephi] String containing data in gephi JSON format\n * {Options} [options] Object with options\n */\nNetwork.prototype.setData = function (data) {\n // reset the physics engine.\n this.body.emitter.emit(\"resetPhysics\");\n this.body.emitter.emit(\"_resetData\");\n\n // unselect all to ensure no selections from old data are carried over.\n this.selectionHandler.unselectAll();\n\n if (data && data.dot && (data.nodes || data.edges)) {\n throw new SyntaxError(\n 'Data must contain either parameter \"dot\" or ' +\n ' parameter pair \"nodes\" and \"edges\", but not both.'\n );\n }\n\n // set options\n this.setOptions(data && data.options);\n // set all data\n if (data && data.dot) {\n console.warn(\n \"The dot property has been deprecated. Please use the static convertDot method to convert DOT into vis.network format and use the normal data format with nodes and edges. This converter is used like this: var data = vis.network.convertDot(dotString);\"\n );\n // parse DOT file\n const dotData = DOTToGraph(data.dot);\n this.setData(dotData);\n return;\n } else if (data && data.gephi) {\n // parse DOT file\n console.warn(\n \"The gephi property has been deprecated. Please use the static convertGephi method to convert gephi into vis.network format and use the normal data format with nodes and edges. This converter is used like this: var data = vis.network.convertGephi(gephiJson);\"\n );\n const gephiData = parseGephi(data.gephi);\n this.setData(gephiData);\n return;\n } else {\n this.nodesHandler.setData(data && data.nodes, true);\n this.edgesHandler.setData(data && data.edges, true);\n }\n\n // emit change in data\n this.body.emitter.emit(\"_dataChanged\");\n\n // emit data loaded\n this.body.emitter.emit(\"_dataLoaded\");\n\n // find a stable position or start animating to a stable position\n this.body.emitter.emit(\"initPhysics\");\n};\n\n/**\n * Cleans up all bindings of the network, removing it fully from the memory IF the variable is set to null after calling this function.\n * var network = new vis.Network(..);\n * network.destroy();\n * network = null;\n */\nNetwork.prototype.destroy = function () {\n this.body.emitter.emit(\"destroy\");\n // clear events\n this.body.emitter.off();\n this.off();\n\n // delete modules\n delete this.groups;\n delete this.canvas;\n delete this.selectionHandler;\n delete this.interactionHandler;\n delete this.view;\n delete this.renderer;\n delete this.physics;\n delete this.layoutEngine;\n delete this.clustering;\n delete this.manipulation;\n delete this.nodesHandler;\n delete this.edgesHandler;\n delete this.configurator;\n delete this.images;\n\n for (const nodeId in this.body.nodes) {\n if (!Object.prototype.hasOwnProperty.call(this.body.nodes, nodeId))\n continue;\n delete this.body.nodes[nodeId];\n }\n\n for (const edgeId in this.body.edges) {\n if (!Object.prototype.hasOwnProperty.call(this.body.edges, edgeId))\n continue;\n delete this.body.edges[edgeId];\n }\n\n // remove the container and everything inside it recursively\n recursiveDOMDelete(this.body.container);\n};\n\n/**\n * Update the values of all object in the given array according to the current\n * value range of the objects in the array.\n *\n * @param {object} obj An object containing a set of Edges or Nodes\n * The objects must have a method getValue() and\n * setValueRange(min, max).\n * @private\n */\nNetwork.prototype._updateValueRange = function (obj) {\n let id;\n\n // determine the range of the objects\n let valueMin = undefined;\n let valueMax = undefined;\n let valueTotal = 0;\n for (id in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, id)) {\n const value = obj[id].getValue();\n if (value !== undefined) {\n valueMin = valueMin === undefined ? value : Math.min(value, valueMin);\n valueMax = valueMax === undefined ? value : Math.max(value, valueMax);\n valueTotal += value;\n }\n }\n }\n\n // adjust the range of all objects\n if (valueMin !== undefined && valueMax !== undefined) {\n for (id in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, id)) {\n obj[id].setValueRange(valueMin, valueMax, valueTotal);\n }\n }\n }\n};\n\n/**\n * Returns true when the Network is active.\n *\n * @returns {boolean}\n */\nNetwork.prototype.isActive = function () {\n return !this.activator || this.activator.active;\n};\n\nNetwork.prototype.setSize = function () {\n return this.canvas.setSize.apply(this.canvas, arguments);\n};\nNetwork.prototype.canvasToDOM = function () {\n return this.canvas.canvasToDOM.apply(this.canvas, arguments);\n};\nNetwork.prototype.DOMtoCanvas = function () {\n return this.canvas.DOMtoCanvas.apply(this.canvas, arguments);\n};\n\n/**\n * Nodes can be in clusters. Clusters can also be in clusters. This function returns and array of\n * nodeIds showing where the node is.\n *\n * If any nodeId in the chain, especially the first passed in as a parameter, is not present in\n * the current nodes list, an empty array is returned.\n *\n * Example:\n * cluster 'A' contains cluster 'B',\n * cluster 'B' contains cluster 'C',\n * cluster 'C' contains node 'fred'.\n * `jsnetwork.clustering.findNode('fred')` will return `['A','B','C','fred']`.\n *\n * @param {string|number} nodeId\n * @returns {Array}\n */\nNetwork.prototype.findNode = function () {\n return this.clustering.findNode.apply(this.clustering, arguments);\n};\n\nNetwork.prototype.isCluster = function () {\n return this.clustering.isCluster.apply(this.clustering, arguments);\n};\nNetwork.prototype.openCluster = function () {\n return this.clustering.openCluster.apply(this.clustering, arguments);\n};\nNetwork.prototype.cluster = function () {\n return this.clustering.cluster.apply(this.clustering, arguments);\n};\nNetwork.prototype.getNodesInCluster = function () {\n return this.clustering.getNodesInCluster.apply(this.clustering, arguments);\n};\nNetwork.prototype.clusterByConnection = function () {\n return this.clustering.clusterByConnection.apply(this.clustering, arguments);\n};\nNetwork.prototype.clusterByHubsize = function () {\n return this.clustering.clusterByHubsize.apply(this.clustering, arguments);\n};\nNetwork.prototype.updateClusteredNode = function () {\n return this.clustering.updateClusteredNode.apply(this.clustering, arguments);\n};\nNetwork.prototype.getClusteredEdges = function () {\n return this.clustering.getClusteredEdges.apply(this.clustering, arguments);\n};\nNetwork.prototype.getBaseEdge = function () {\n return this.clustering.getBaseEdge.apply(this.clustering, arguments);\n};\nNetwork.prototype.getBaseEdges = function () {\n return this.clustering.getBaseEdges.apply(this.clustering, arguments);\n};\nNetwork.prototype.updateEdge = function () {\n return this.clustering.updateEdge.apply(this.clustering, arguments);\n};\n\n/**\n * This method will cluster all nodes with 1 edge with their respective connected node.\n * The options object is explained in full <a data-scroll=\"\" data-options=\"{ &quot;easing&quot;: &quot;easeInCubic&quot; }\" href=\"#optionsObject\">below</a>.\n *\n * @param {object} [options]\n * @returns {undefined}\n */\nNetwork.prototype.clusterOutliers = function () {\n return this.clustering.clusterOutliers.apply(this.clustering, arguments);\n};\n\nNetwork.prototype.getSeed = function () {\n return this.layoutEngine.getSeed.apply(this.layoutEngine, arguments);\n};\nNetwork.prototype.enableEditMode = function () {\n return this.manipulation.enableEditMode.apply(this.manipulation, arguments);\n};\nNetwork.prototype.disableEditMode = function () {\n return this.manipulation.disableEditMode.apply(this.manipulation, arguments);\n};\nNetwork.prototype.addNodeMode = function () {\n return this.manipulation.addNodeMode.apply(this.manipulation, arguments);\n};\nNetwork.prototype.editNode = function () {\n return this.manipulation.editNode.apply(this.manipulation, arguments);\n};\nNetwork.prototype.editNodeMode = function () {\n console.warn(\"Deprecated: Please use editNode instead of editNodeMode.\");\n return this.manipulation.editNode.apply(this.manipulation, arguments);\n};\nNetwork.prototype.addEdgeMode = function () {\n return this.manipulation.addEdgeMode.apply(this.manipulation, arguments);\n};\nNetwork.prototype.editEdgeMode = function () {\n return this.manipulation.editEdgeMode.apply(this.manipulation, arguments);\n};\nNetwork.prototype.deleteSelected = function () {\n return this.manipulation.deleteSelected.apply(this.manipulation, arguments);\n};\nNetwork.prototype.getPositions = function () {\n return this.nodesHandler.getPositions.apply(this.nodesHandler, arguments);\n};\nNetwork.prototype.getPosition = function () {\n return this.nodesHandler.getPosition.apply(this.nodesHandler, arguments);\n};\nNetwork.prototype.storePositions = function () {\n return this.nodesHandler.storePositions.apply(this.nodesHandler, arguments);\n};\nNetwork.prototype.moveNode = function () {\n return this.nodesHandler.moveNode.apply(this.nodesHandler, arguments);\n};\nNetwork.prototype.getBoundingBox = function () {\n return this.nodesHandler.getBoundingBox.apply(this.nodesHandler, arguments);\n};\nNetwork.prototype.getConnectedNodes = function (objectId) {\n if (this.body.nodes[objectId] !== undefined) {\n return this.nodesHandler.getConnectedNodes.apply(\n this.nodesHandler,\n arguments\n );\n } else {\n return this.edgesHandler.getConnectedNodes.apply(\n this.edgesHandler,\n arguments\n );\n }\n};\nNetwork.prototype.getConnectedEdges = function () {\n return this.nodesHandler.getConnectedEdges.apply(\n this.nodesHandler,\n arguments\n );\n};\nNetwork.prototype.startSimulation = function () {\n return this.physics.startSimulation.apply(this.physics, arguments);\n};\nNetwork.prototype.stopSimulation = function () {\n return this.physics.stopSimulation.apply(this.physics, arguments);\n};\nNetwork.prototype.stabilize = function () {\n return this.physics.stabilize.apply(this.physics, arguments);\n};\nNetwork.prototype.getSelection = function () {\n return this.selectionHandler.getSelection.apply(\n this.selectionHandler,\n arguments\n );\n};\nNetwork.prototype.setSelection = function () {\n return this.selectionHandler.setSelection.apply(\n this.selectionHandler,\n arguments\n );\n};\nNetwork.prototype.getSelectedNodes = function () {\n return this.selectionHandler.getSelectedNodeIds.apply(\n this.selectionHandler,\n arguments\n );\n};\nNetwork.prototype.getSelectedEdges = function () {\n return this.selectionHandler.getSelectedEdgeIds.apply(\n this.selectionHandler,\n arguments\n );\n};\nNetwork.prototype.getNodeAt = function () {\n const node = this.selectionHandler.getNodeAt.apply(\n this.selectionHandler,\n arguments\n );\n if (node !== undefined && node.id !== undefined) {\n return node.id;\n }\n return node;\n};\nNetwork.prototype.getEdgeAt = function () {\n const edge = this.selectionHandler.getEdgeAt.apply(\n this.selectionHandler,\n arguments\n );\n if (edge !== undefined && edge.id !== undefined) {\n return edge.id;\n }\n return edge;\n};\nNetwork.prototype.selectNodes = function () {\n return this.selectionHandler.selectNodes.apply(\n this.selectionHandler,\n arguments\n );\n};\nNetwork.prototype.selectEdges = function () {\n return this.selectionHandler.selectEdges.apply(\n this.selectionHandler,\n arguments\n );\n};\nNetwork.prototype.unselectAll = function () {\n this.selectionHandler.unselectAll.apply(this.selectionHandler, arguments);\n this.selectionHandler.commitWithoutEmitting.apply(this.selectionHandler);\n this.redraw();\n};\nNetwork.prototype.redraw = function () {\n return this.renderer.redraw.apply(this.renderer, arguments);\n};\nNetwork.prototype.getScale = function () {\n return this.view.getScale.apply(this.view, arguments);\n};\nNetwork.prototype.getViewPosition = function () {\n return this.view.getViewPosition.apply(this.view, arguments);\n};\nNetwork.prototype.fit = function () {\n return this.view.fit.apply(this.view, arguments);\n};\nNetwork.prototype.moveTo = function () {\n return this.view.moveTo.apply(this.view, arguments);\n};\nNetwork.prototype.focus = function () {\n return this.view.focus.apply(this.view, arguments);\n};\nNetwork.prototype.releaseNode = function () {\n return this.view.releaseNode.apply(this.view, arguments);\n};\nNetwork.prototype.getOptionsFromConfigurator = function () {\n let options = {};\n if (this.configurator) {\n options = this.configurator.getOptions.apply(this.configurator);\n }\n return options;\n};\n\nexport default Network;\n","// DOM utility methods\n\n/**\n * this prepares the JSON container for allocating SVG elements\n *\n * @param {object} JSONcontainer\n * @private\n */\nexport function prepareElements(JSONcontainer) {\n // cleanup the redundant svgElements;\n for (const elementType in JSONcontainer) {\n if (Object.prototype.hasOwnProperty.call(JSONcontainer, elementType)) {\n JSONcontainer[elementType].redundant = JSONcontainer[elementType].used;\n JSONcontainer[elementType].used = [];\n }\n }\n}\n\n/**\n * this cleans up all the unused SVG elements. By asking for the parentNode, we only need to supply the JSON container from\n * which to remove the redundant elements.\n *\n * @param {object} JSONcontainer\n * @private\n */\nexport function cleanupElements(JSONcontainer) {\n // cleanup the redundant svgElements;\n for (const elementType in JSONcontainer) {\n if (Object.prototype.hasOwnProperty.call(JSONcontainer, elementType)) {\n if (JSONcontainer[elementType].redundant) {\n for (let i = 0; i < JSONcontainer[elementType].redundant.length; i++) {\n JSONcontainer[elementType].redundant[i].parentNode.removeChild(\n JSONcontainer[elementType].redundant[i]\n );\n }\n JSONcontainer[elementType].redundant = [];\n }\n }\n }\n}\n\n/**\n * Ensures that all elements are removed first up so they can be recreated cleanly\n *\n * @param {object} JSONcontainer\n */\nexport function resetElements(JSONcontainer) {\n prepareElements(JSONcontainer);\n cleanupElements(JSONcontainer);\n prepareElements(JSONcontainer);\n}\n\n/**\n * Allocate or generate an SVG element if needed. Store a reference to it in the JSON container and draw it in the svgContainer\n * the JSON container and the SVG container have to be supplied so other svg containers (like the legend) can use this.\n *\n * @param {string} elementType\n * @param {object} JSONcontainer\n * @param {object} svgContainer\n * @returns {Element}\n * @private\n */\nexport function getSVGElement(elementType, JSONcontainer, svgContainer) {\n let element;\n // allocate SVG element, if it doesnt yet exist, create one.\n if (Object.prototype.hasOwnProperty.call(JSONcontainer, elementType)) {\n // this element has been created before\n // check if there is an redundant element\n if (JSONcontainer[elementType].redundant.length > 0) {\n element = JSONcontainer[elementType].redundant[0];\n JSONcontainer[elementType].redundant.shift();\n } else {\n // create a new element and add it to the SVG\n element = document.createElementNS(\n \"http://www.w3.org/2000/svg\",\n elementType\n );\n svgContainer.appendChild(element);\n }\n } else {\n // create a new element and add it to the SVG, also create a new object in the svgElements to keep track of it.\n element = document.createElementNS(\n \"http://www.w3.org/2000/svg\",\n elementType\n );\n JSONcontainer[elementType] = { used: [], redundant: [] };\n svgContainer.appendChild(element);\n }\n JSONcontainer[elementType].used.push(element);\n return element;\n}\n\n/**\n * Allocate or generate an SVG element if needed. Store a reference to it in the JSON container and draw it in the svgContainer\n * the JSON container and the SVG container have to be supplied so other svg containers (like the legend) can use this.\n *\n * @param {string} elementType\n * @param {object} JSONcontainer\n * @param {Element} DOMContainer\n * @param {Element} insertBefore\n * @returns {*}\n */\nexport function getDOMElement(\n elementType,\n JSONcontainer,\n DOMContainer,\n insertBefore\n) {\n let element;\n // allocate DOM element, if it doesnt yet exist, create one.\n if (Object.prototype.hasOwnProperty.call(JSONcontainer, elementType)) {\n // this element has been created before\n // check if there is an redundant element\n if (JSONcontainer[elementType].redundant.length > 0) {\n element = JSONcontainer[elementType].redundant[0];\n JSONcontainer[elementType].redundant.shift();\n } else {\n // create a new element and add it to the SVG\n element = document.createElement(elementType);\n if (insertBefore !== undefined) {\n DOMContainer.insertBefore(element, insertBefore);\n } else {\n DOMContainer.appendChild(element);\n }\n }\n } else {\n // create a new element and add it to the SVG, also create a new object in the svgElements to keep track of it.\n element = document.createElement(elementType);\n JSONcontainer[elementType] = { used: [], redundant: [] };\n if (insertBefore !== undefined) {\n DOMContainer.insertBefore(element, insertBefore);\n } else {\n DOMContainer.appendChild(element);\n }\n }\n JSONcontainer[elementType].used.push(element);\n return element;\n}\n\n/**\n * Draw a point object. This is a separate function because it can also be called by the legend.\n * The reason the JSONcontainer and the target SVG svgContainer have to be supplied is so the legend can use these functions\n * as well.\n *\n * @param {number} x\n * @param {number} y\n * @param {object} groupTemplate: A template containing the necessary information to draw the datapoint e.g., {style: 'circle', size: 5, className: 'className' }\n * @param groupTemplate\n * @param {object} JSONcontainer\n * @param {object} svgContainer\n * @param {object} labelObj\n * @returns {vis.PointItem}\n */\nexport function drawPoint(\n x,\n y,\n groupTemplate,\n JSONcontainer,\n svgContainer,\n labelObj\n) {\n let point;\n if (groupTemplate.style == \"circle\") {\n point = getSVGElement(\"circle\", JSONcontainer, svgContainer);\n point.setAttributeNS(null, \"cx\", x);\n point.setAttributeNS(null, \"cy\", y);\n point.setAttributeNS(null, \"r\", 0.5 * groupTemplate.size);\n } else {\n point = getSVGElement(\"rect\", JSONcontainer, svgContainer);\n point.setAttributeNS(null, \"x\", x - 0.5 * groupTemplate.size);\n point.setAttributeNS(null, \"y\", y - 0.5 * groupTemplate.size);\n point.setAttributeNS(null, \"width\", groupTemplate.size);\n point.setAttributeNS(null, \"height\", groupTemplate.size);\n }\n\n if (groupTemplate.styles !== undefined) {\n point.setAttributeNS(null, \"style\", groupTemplate.styles);\n }\n point.setAttributeNS(null, \"class\", groupTemplate.className + \" vis-point\");\n //handle label\n\n if (labelObj) {\n const label = getSVGElement(\"text\", JSONcontainer, svgContainer);\n if (labelObj.xOffset) {\n x = x + labelObj.xOffset;\n }\n\n if (labelObj.yOffset) {\n y = y + labelObj.yOffset;\n }\n if (labelObj.content) {\n label.textContent = labelObj.content;\n }\n\n if (labelObj.className) {\n label.setAttributeNS(null, \"class\", labelObj.className + \" vis-label\");\n }\n label.setAttributeNS(null, \"x\", x);\n label.setAttributeNS(null, \"y\", y);\n }\n\n return point;\n}\n\n/**\n * draw a bar SVG element centered on the X coordinate\n *\n * @param {number} x\n * @param {number} y\n * @param {number} width\n * @param {number} height\n * @param {string} className\n * @param {object} JSONcontainer\n * @param {object} svgContainer\n * @param {string} style\n */\nexport function drawBar(\n x,\n y,\n width,\n height,\n className,\n JSONcontainer,\n svgContainer,\n style\n) {\n if (height != 0) {\n if (height < 0) {\n height *= -1;\n y -= height;\n }\n const rect = getSVGElement(\"rect\", JSONcontainer, svgContainer);\n rect.setAttributeNS(null, \"x\", x - 0.5 * width);\n rect.setAttributeNS(null, \"y\", y);\n rect.setAttributeNS(null, \"width\", width);\n rect.setAttributeNS(null, \"height\", height);\n rect.setAttributeNS(null, \"class\", className);\n if (style) {\n rect.setAttributeNS(null, \"style\", style);\n }\n }\n}\n","// Network.\nexport * from \"./network/Network\";\n\nimport Images from \"./network/Images\";\nimport * as dotparser from \"./network/dotparser\";\nimport * as gephiParser from \"./network/gephiParser\";\nimport { parseGephi } from \"./network/gephiParser\";\nimport * as allOptions from \"./network/options\";\nexport const network = {\n Images,\n dotparser,\n gephiParser,\n allOptions,\n convertDot: dotparser.DOTToGraph,\n convertGephi: parseGephi,\n};\n\n// utils\nimport * as DOMutil from \"./DOMutil\";\nexport { DOMutil };\n\n// vis-util\nimport * as util from \"vis-util/esnext\";\nexport { util };\n\n// vis-data\nimport * as data from \"vis-data/esnext\";\nexport { data };\nexport { DataSet, DataView, Queue } from \"vis-data/esnext\";\n\n// bundled external libraries\nimport { Hammer } from \"vis-util/esnext\";\nexport { Hammer };\nimport * as keycharm from \"keycharm\";\nexport { keycharm };\n"],"names":["check","it","Math","globalThis","window","self","global","Function","exec","error","fails","Object","defineProperty","get","$propertyIsEnumerable","propertyIsEnumerable","getOwnPropertyDescriptor","NASHORN_BUG","call","V","descriptor","enumerable","bitmap","value","configurable","writable","toString","slice","split","classof","undefined","TypeError","IndexedObject","requireObjectCoercible","aFunction","variable","namespace","method","arguments","length","path","getBuiltIn","process","Deno","versions","version","v8","match","userAgent","getOwnPropertySymbols","symbol","Symbol","String","sham","V8_VERSION","NATIVE_SYMBOL","iterator","USE_SYMBOL_AS_UID","$Symbol","input","pref","fn","val","isObject","valueOf","key","SHARED","store","setGlobal","module","push","mode","copyright","argument","hasOwnProperty","hasOwn","toObject","id","postfix","random","WellKnownSymbolsStore","shared","createWellKnownSymbol","withoutSetter","uid","name","has","TO_PRIMITIVE","wellKnownSymbol","isSymbol","exoticToPrim","result","ordinaryToPrimitive","toPrimitive","document","EXISTS","createElement","DESCRIPTORS","a","$getOwnPropertyDescriptor","O","P","toIndexedObject","toPropertyKey","IE8_DOM_DEFINE","createPropertyDescriptor","propertyIsEnumerableModule","f","replacement","isForced","feature","detection","data","normalize","POLYFILL","NATIVE","string","replace","toLowerCase","that","b","c","apply","$defineProperty","Attributes","anObject","object","definePropertyModule","require$$0","wrapConstructor","NativeConstructor","Wrapper","prototype","options","source","TARGET","target","GLOBAL","STATIC","stat","PROTO","proto","nativeSource","targetPrototype","FORCED","USE_NATIVE","VIRTUAL_PROTOTYPE","sourceProperty","targetProperty","nativeProperty","resultProperty","forced","noTargetGet","bind","wrap","createNonEnumerableProperty","real","ceil","floor","isNaN","min","toInteger","max","index","integer","createMethod","IS_INCLUDES","$this","el","fromIndex","toLength","toAbsoluteIndex","includes","indexOf","names","i","hiddenKeys","keys","internalObjectKeys","enumBugKeys","$assign","assign","A","B","alphabet","forEach","chr","objectKeys","join","T","argumentsLength","getOwnPropertySymbolsModule","S","concat","j","$","parent","factories","construct","C","argsLength","args","list","partArgs","boundFunction","bound","CONSTRUCTOR","entryVirtual","FunctionPrototype","own","drawCircle","ctx","x","y","r","beginPath","arc","PI","closePath","drawSquare","rect","drawTriangle","s","s2","ir","sqrt","h","moveTo","lineTo","drawTriangleDown","drawStar","n","radius","sin","cos","drawDiamond","drawRoundRect","w","r2d","drawEllipse","kappa","ox","oy","xe","ye","xm","ym","bezierCurveTo","drawDatabase","wEllipse","hEllipse","ymb","yeb","drawDashedLine","x2","y2","pattern","patternLength","dx","dy","slope","distRemaining","patternIndex","draw","xStep","dashLength","drawHexagon","sides","shapeMap","circle","dashedLine","database","diamond","ellipse","ellipse_vis","hexagon","roundRect","square","star","triangle","triangleDown","getShape","CanvasRenderingContext2D","Emitter","obj","mixin","on","addEventListener","event","_callbacks","once","off","removeListener","removeAllListeners","removeEventListener","callbacks","cb","splice","emit","Array","len","listeners","hasListeners","CONVERT_TO_STRING","pos","position","size","first","second","charCodeAt","charAt","codeAt","functionToString","inspectSource","WeakMap","test","OBJECT_ALREADY_INITIALIZED","set","enforce","getterFor","TYPE","state","type","NATIVE_WEAK_MAP","wmget","wmhas","wmset","metadata","facade","STATE","sharedKey","objectHas","F","constructor","getPrototypeOf","IE_PROTO","ObjectPrototype","CORRECT_PROTOTYPE_GETTER","ITERATOR","BUGGY_SAFARI_ITERATORS","returnThis","IteratorPrototype","PrototypeOfArrayIteratorPrototype","arrayIterator","NEW_ITERATOR_PROTOTYPE","defineProperties","Properties","GT","LT","PROTOTYPE","SCRIPT","EmptyConstructor","scriptTag","content","NullProtoObjectViaActiveX","activeXDocument","write","close","temp","parentWindow","NullProtoObjectViaIFrame","iframe","documentCreateElement","JS","iframeDocument","style","display","html","appendChild","src","contentWindow","open","NullProtoObject","ActiveXObject","domain","create","TO_STRING_TAG","CORRECT_ARGUMENTS","classofRaw","tryGet","TO_STRING_TAG_SUPPORT","tag","callee","TAG","SET_METHOD","IteratorConstructor","NAME","next","setToStringTag","Iterators","setPrototypeOf","CORRECT_SETTER","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","redefine","STRING_ITERATOR","setInternalState","InternalStateModule","getInternalState","defineIterator","iterated","point","done","returnMethod","iteratorClose","ArrayPrototype","propertyKey","from","arrayLike","mapfn","mapping","iteratorMethod","getIteratorMethod","step","isArrayIteratorMethod","callWithSafeIterationClosing","createProperty","SAFE_CLOSING","called","iteratorWithReturn","SKIP_CLOSING","ITERATION_SUPPORT","INCORRECT_ITERATION","checkCorrectnessOfIteration","iterable","ARRAY_ITERATOR","kind","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","isArray","arg","getOwnPropertyNames","$getOwnPropertyNames","windowNames","getWindowNames","wrappedWellKnownSymbolModule","SPECIES","originalArray","arraySpeciesConstructor","IS_MAP","IS_FILTER","IS_SOME","IS_EVERY","IS_FIND_INDEX","IS_FILTER_REJECT","NO_HOLES","callbackfn","specificCreate","arraySpeciesCreate","map","filter","some","every","find","findIndex","filterReject","$forEach","HIDDEN","SYMBOL","$stringify","nativeGetOwnPropertyDescriptor","getOwnPropertyDescriptorModule","nativeDefineProperty","nativeGetOwnPropertyNames","getOwnPropertyNamesExternal","nativePropertyIsEnumerable","AllSymbols","ObjectPrototypeSymbols","StringToSymbolRegistry","SymbolToStringRegistry","QObject","USE_SETTER","findChild","setSymbolDescriptor","nativeObjectCreate","ObjectPrototypeDescriptor","description","$defineProperties","properties","$getOwnPropertySymbols","$create","IS_OBJECT_PROTOTYPE","$toString","getOwnPropertyNamesModule","defineWellKnownSymbol","keyFor","sym","useSetter","useSimple","FORCED_JSON_STRINGIFY","stringify","replacer","space","$replacer","FAILS_ON_PRIMITIVES","ownKeys","getOwnPropertyDescriptors","D","objectDefinePropertyModile","desc","_classCallCheck","instance","Constructor","exports","_defineProperties","props","_Object$defineProperty","_createClass","protoProps","staticProps","_defineProperty","_arrayWithHoles","arr","_Array$isArray","METHOD_NAME","array","foo","Boolean","IS_CONCAT_SPREADABLE","MAX_SAFE_INTEGER","MAXIMUM_ALLOWED_INDEX_EXCEEDED","IS_CONCAT_SPREADABLE_SUPPORT","SPECIES_SUPPORT","arrayMethodHasSpeciesSupport","isConcatSpreadable","spreadable","k","E","JSON","_iterableToArrayLimit","_i","_Symbol","_getIteratorMethod","_arr","_n","_d","_s","_e","err","HAS_SPECIES_SUPPORT","nativeSlice","start","end","fin","_arrayLikeToArray","arr2","_unsupportedIterableToArray","o","minLen","_context","arrayLikeToArray","_sliceInstanceProperty","_Array$from","_nonIterableRest","_slicedToArray","arrayWithHoles","iterableToArrayLimit","unsupportedIterableToArray","nonIterableRest","WrappedWellKnownSymbolModule","_typeof","_Symbol$iterator","_arrayWithoutHoles","_iterableToArray","iter","_nonIterableSpread","_toConsumableArray","arrayWithoutHoles","iterableToArray","nonIterableSpread","Reflect","$map","nativeKeys","now","Date","getTime","STRICT_METHOD","arrayMethodIsStrict","nativeReverse","reverse","MAXIMUM_ALLOWED_LENGTH_EXCEEDED","deleteCount","actualStart","insertCount","actualDeleteCount","to","$includes","MATCH","isRegExp","regexp","error1","error2","correctIsRegExpLogic","searchString","notARegExp","StringPrototype","arrayIncludes","stringIncludes","nativeGetPrototypeOf","$filter","TO_ENTRIES","$values","whitespace","whitespaces","ltrim","RegExp","rtrim","trim","$parseInt","parseInt","hex","radix","parseIntImplementation","$indexOf","nativeIndexOf","NEGATIVE_ZERO","searchElement","non","$trim","forcedStringTrimMethod","re","low","hi","fix","offset","prev","core","MSIE","scheduler","handler","timeout","boundArgs","setTimeout","setInterval","fill","endPos","output","_Reflect$ownKeys","_mapInstanceProperty","_Object$keys2","parseDOT","dot","parseGraph","NODE_ATTR_MAPPING","fontsize","fontcolor","labelfontcolor","fontname","color","fillcolor","tooltip","labeltooltip","EDGE_ATTR_MAPPING","_Object$create","TOKENTYPE","NULL","DELIMITER","IDENTIFIER","UNKNOWN","DELIMITERS","token","tokenType","nextPreview","isAlphaNumeric","charCode","merge","setValue","shift","addNode","graph","node","current","graphs","root","nodes","attr","g","_indexOfInstanceProperty","addEdge","edge","edges","createEdge","enabled","arrows","getToken","isComment","c2","Number","newSyntaxError","SyntaxError","chop","strict","parseStatements","parseStatement","subgraph","parseSubgraph","parseEdge","parseAttributeStatement","parseNodeStatement","subgraphs","parseAttributeList","edgeStyles","dashed","solid","dotted","arrowTypes","box","crow","curve","icurve","normal","inv","tee","vee","attr_list","attr_names","arrowType","_includesInstanceProperty","idx","dir","dir_type","from_type","to_type","idx_arrow","nof_attr_list","tmp_attr_list","message","text","maxLength","substr","forEach2","array1","array2","elem1","elem2","setProp","prop","pop","convertAttr","converted","visProp","visPropI","DOTToGraph","dotData","graphData","dotNode","graphNode","label","image","shape","convertEdge","dotEdge","graphEdge","subEdge","parseGephi","gephiJSON","optionsObj","inheritColor","fixed","parseColor","gEdges","vEdges","gEdge","vEdge","attributes","title","vNodes","gNode","vNode","background","border","highlight","hover","en","addDescription","back","createEdgeError","del","deleteClusterError","edgeDescription","edit","editClusterError","editEdge","editEdgeDescription","editNode","de","es","nl","pt","ru","cn","uk","fr","cs","normalizeLanguageCode","locales","rawCode","rawLanguage","rawCountry","language","country","toUpperCase","code","console","warn","CachedImage","NUM_ITERATIONS","Image","canvas","initialized","width","height","h2","h4","h8","h16","w2","w4","w8","w16","coordinates","_fillMipMap","getContext","drawImage","iterations","factor","left","top","Images","callback","images","imageBroken","url","brokenUrl","imageToLoadBrokenUrlOn","onerror","imageToRedrawWith","cachedImage","img","onload","_fixImageCoordinates","init","_redrawWithImage","_tryloadBrokenUrl","imageToCache","body","offsetWidth","offsetHeight","removeChild","isExtensible","preventExtensions","REQUIRED","METADATA","setMetadata","objectID","weakData","fastKey","getWeakData","onFreeze","FREEZING","enable","meta","getOwnPropertyNamesExternalModule","Result","stopped","unboundFunction","AS_ENTRIES","IS_ITERATOR","INTERRUPTED","iterFn","stop","condition","callFn","require$$1","internalStateGetterFor","CONSTRUCTOR_NAME","wrapper","common","IS_WEAK","ADDER","NativePrototype","exported","getConstructor","InternalMetadataModule","anInstance","collection","iterate","IS_ADDER","setStrong","unsafe","last","define","entry","getEntry","previous","removed","redefineAll","clear","add","ITERATOR_NAME","getInternalCollectionState","getInternalIteratorState","setSpecies","Map","collectionStrong","Groups","_defaultIndex","_groupIndex","_defaultGroups","defaultOptions","useDefaultGroups","optionFields","groupName","group","_groups","_groupNames","groupname","shouldCreate","number","globalIsFinite","isFinite","numberIsFinite","$some","nativeConstruct","NEW_TARGET_BUG","ARGS_BUG","Target","newTarget","$args","_assertThisInitialized","ReferenceError","_setPrototypeOf","p","_Object$setPrototypeOf","_inherits","subClass","superClass","_possibleConstructorReturn","assertThisInitialized","_getPrototypeOf","_Object$getPrototypeOf","runtime","Op","iteratorSymbol","asyncIteratorSymbol","asyncIterator","toStringTagSymbol","toStringTag","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","tryLoc","catchLoc","finallyLoc","afterLoc","tryEntries","resetTryEntry","completion","reset","skipTempReset","rootEntry","rootRecord","rval","exception","handle","loc","caught","hasCatch","hasFinally","finallyEntry","complete","finish","thrown","delegateYield","regeneratorRuntime","accidentalStrictMode","IS_RIGHT","memo","right","$reduce","CHROME_BUG","IS_NODE","CHROME_VERSION","reduce","flattenIntoArray","original","sourceLen","depth","mapper","thisArg","targetIndex","sourceIndex","mapFn","element","flatMap","Set","getIterator","mergeSort","comparefn","middle","insertionSort","llength","rlength","lindex","rindex","firefox","UA","webkit","nativeSort","sort","FAILS_ON_UNDEFINED","FAILS_ON_NULL","STABLE_SORT","V8","FF","IE_OR_EDGE","WEBKIT","fromCharCode","v","getSortCompare","items","arrayLength","itemsLength","internalSort","getRandomValues","rnds8","Uint8Array","rng","crypto","msCrypto","validate","uuid","REGEX","byteToHex","v4","buf","rnds","_bindInstanceProperty","_reduceInstanceProperty","_filterInstanceProperty","_flatMapInstanceProperty","$parseFloat","parseFloat","Infinity","trimmedString","parseFloatImplementation","choosify","subOption","pile","allowed","chosen","topMost","chosenEdge","pointInRect","rotationPoint","tmp","angle","tmp2","bottom","isValidLabel","getSelfRefCoordinates","distanceToBorder","toBorderDist","yFromNodeCenter","xFromNodeCenter","LabelAccumulator","measureText","lines","l","mod","blocks","tmpText","block","_Object$assign","line","_add","tmpLines","tmpLine","firstEmptyBlock","tmpBlocks","determineLineHeights","determineLabelSize","removeEmptyBlocks","tagPattern","_","afterBold","afterItal","afterMono","MarkupAccumulator","bold","ital","mono","spacing","buffer","modStack","modName","ch","tagName","emitBlock","unshift","setTag","advance","prepareRegExp","regExp","matched","nextTag","checkTag","unsetTag","prepared","LabelSplitter","selected","textWidth","getFormattingValues","measure","finalize","font","fontOptions","nlLines","lineCount","multi","splitBlocks","newLine","maxWdt","splitStringIntoLines","append","markupSystem","system","parseEntities","parsed","parseWS","parseStartTag","parseEndTag","beginable","parseOverride","decodeMarkupSystem","splitMarkdownBlocks","splitHtmlBlocks","curWidth","words","pre","newText","overMaxWidth","str","appendLast","getLongestFit","word","getLongestFitWord","newW","multiFontStyle","Label","edgelabel","pointToSelf","baseSize","setOptions","yLine","isEdgeLabel","elementOptions","initFontOptions","labelDirty","newFontOptions","parseFontString","vadjust","constrainWidth","minWdt","constrainHeight","minHgt","valign","widthConstraint","widthConstraintMaximum","widthConstraintMinimum","heightConstraint","heightConstraintMinimum","heightConstraintValign","propagateFonts","deepExtend","constrain","chooser","margins","widthBias","heightBias","dstPile","srcPile","addFontToPile","item","ret","tmpShorthand","opt","multiName","option","multiFont","optionNames","getFontOption","fontPile","addFontOptionsToPile","getBasicOptions","modOptions","tmpMultiFontOptions","getFontOptions","baseline","viewFontSize","view","scale","scaling","drawThreshold","maxVisible","calculateLabelSize","_drawBackground","_drawText","fillStyle","getSize","fillRect","_setAlignment","textAlign","labelHeight","align","_getColor","strokeColor","fontColor","strokeWidth","lineWidth","strokeStyle","lineJoin","strokeText","fillText","lineMargin","textBaseline","initialStrokeColor","opacity","overrideOpacity","_processLabel","getValue","face","labelHighlightBold","fontString","selectedState","hoverState","inText","splitter","differentState","_processLabelText","outOptions","inOptions","newOptionsArray","NodeBase","labelModule","margin","refreshNeeded","boundingBox","adjustSizes","borderWidth","resize","abs","shadow","shadowColor","shadowBlur","shadowSize","shadowOffsetX","shadowX","shadowOffsetY","shadowY","borderDashes","setLineDash","dashes","shapeProperties","borderColor","save","enableBorderDashes","stroke","disableBorderDashes","restore","enableShadow","disableShadow","performStroke","_updateBoundingBox","textSize","getTextSize","DEFAULT_SIZE","Box","_setMargins","needsRefresh","dimensions","getDimensionsFromLabel","initContextForDraw","borderRadius","performFill","updateBoundingBox","_addBoundingBoxMargin","CircleImageBase","labelOffset","imageObj","imageObjAlt","setImages","selection_changed","imageTmp","imgPadding","imagePadding","optImgPadding","useImageSize","ratio_width","ratio_height","_getImagePadding","globalAlpha","interpolation","imgPosLeft","imgPosTop","imgWidth","imgHeight","drawImageAtPosition","labelDimensions","yLabel","Circle","diameter","_drawRawCircle","CircularImage","imageAbsent","_resizeImage","switchImages","labelX","labelY","coordinateOrigin","clip","_drawImageAtPosition","_drawImageLabel","ShapeBase","customSizeWidth","customSizeHeight","sizeMultiplier","icon","drawExternalLabel","CustomShape","ctxRenderer","drawLater","drawNode","nodeDimensions","_distanceToBorder","Database","Diamond","_drawShape","Dot","Ellipse","Icon","iconSize","_icon","iconTextSpacing","weight","side","useBorderWithImage","neutralborderWidth","selectionLineWidth","borderWidthSelected","Square","Hexagon","Star","Text","Triangle","TriangleDown","Node","imagelist","grouplist","globalOptions","bridgeObject","baseFontSize","predefinedPosition","currentShape","_localColor","checkMass","parseOptions","_load_images","updateLabelModule","checkOpacity","updateShape","hidden","physics","load","brokenImage","unselected","updateGroupOptions","currentGroup","update","total","customScalingFunction","sizeDiff","fontDiff","visible","nodeId","labelId","origin","parentOptions","newOptions","groupList","hasGroup","groupObj","skipProperties","selectiveNotDeepExtend","allowDeletion","fields","checkCoordinateOrigin","mergeOptions","parsedColor","fillIfDefined","mass","strId","VALIDATOR_PRINT_STYLE","NodesHandler","groups","layoutEngine","functions","createNode","nodesListeners","params","oldData","remove","boldital","level","bindEventListeners","emitter","refresh","_Number$isNaN","_Number$isFinite","doNotEmit","oldNodesData","isDataViewLike","DataSet","me","ids","getIds","newNodes","positionInitially","changedData","dataChanged","_someInstanceProperty","newValue","oldValue","constructorClass","clearPositions","dataArray","round","nodeIndices","dataset","getDataSet","dsNode","bodyNode","direction","nodeList","nodeObj","toId","fromId","edgeList","receiver","_superPropBase","property","_get","_Reflect$get","base","superPropBase","_Object$getOwnPropertyDescriptor","$hypot","hypot","BUGGY","NaN","value1","value2","sum","aLen","larg","div","EndPoint","points","arrowData","xt","yt","translate","rotate","imageWidth","imageHeight","Arrow","transform","drawPath","Crow","Curve","pi","startAngle","endAngle","InvertedCurve","InvertedTriangle","Bar","Vee","EndPoints","EdgeBase","_body","_labelModule","fromPoint","toPoint","_selected","_hover","viaNode","getViaNode","getColor","_drawDashedLine","_drawLine","_line","_getCircleData","_circle","_fromPoint","_toPoint","lineCap","lineDashOffset","_findBorderPosition","_findBorderPositionCircle","high","selfReference","nearNode","maxIterations","threshold","endPointOffset","arrowStrikethrough","iteration","_pointOnCircle","atan2","distanceToPoint","pow","difference","t","selectionWidth","hoverWidth","inheritsColor","grd","createLinearGradient","fromColor","toColor","addColorStop","angleFrom","angleTo","renderBehindTheNode","pointTFrom","pointTTo","x1","y1","x3","y3","_getDistanceToEdge","px","py","something","u","arrowPoint","node1","node2","reversed","scaleFactor","fromArrowScale","fromArrowType","toArrowScale","toArrowType","middleArrowScale","middleArrowType","approximateEdgeLength","_Math$hypot","relativeLength","smooth","pointT","via","guidePos","getPoint","halfLength","guidePos1","guidePos2","xi","yi","arrowCore","canFill","origCtxAttr","backgroundColor","backgroundSize","setStrokeDashed","backgroundDashes","BezierEdgeBase","_getViaCoordinates","minDistance","distance","lastX","lastY","_getDistanceToLine","viaNode1","viaNode2","quadraticCurveTo","drawBackground","BezierEdgeDynamic","_boundFunction","positionBezierNode","physicsChange","setupSupportNode","connect","parentEdgeId","_bezierCurve","cx","cy","cr","_findBorderPositionBezier","_getDistanceToBezierEdge","BezierEdgeStatic","roundness","stepX","stepY","xVia","yVia","originalAngle","myAngle","CubicBezierEdgeBase","via1","via2","vec","CubicBezierEdge","viaNodes","forceDirection","_getDistanceToBezierEdge2","StraightEdge","edgeSegmentLength","toBorderPoint","Edge","baseWidth","edgeType","connected","affectsLayout","updateEdgeType","_setInteractionWidths","toArrow","fromArrow","middleArrow","inherit","toArrowSrc","toArrowImageWidth","toArrowImageHeight","middleArrowSrc","middleArrowImageWidth","middleArrowImageHeight","fromArrowSrc","fromArrowImageWidth","fromArrowImageHeight","selectedWidth","changeInType","cleanup","disconnect","attachEdge","detachEdge","widthDiff","drawLine","drawLabel","getArrowData","drawArrowHead","_getRotation","edgeId","isOverlappingWith","distMax","xFrom","yFrom","xTo","yTo","xObj","yObj","dist","getDistanceToEdge","copyFromGlobals","selectiveDeepExtend","_JSON$stringify","isString","colorsDefined","selfReferenceSize","EdgesHandler","edgesListeners","edgeData","smoothOptions","reconnectEdges","oldEdgesData","edgesData","oldEdge","showInternalIds","_addMissingEdges","_removeInvalidEdges","edgesToDelete","toNode","fromNode","isCluster","addIds","BarnesHutSolver","physicsBody","barnesHutTree","_rng","Alea","thetaInversed","theta","overlapAvoidanceFactor","avoidOverlap","gravitationalConstant","physicsNodeIndices","nodeCount","_formBarnesHutTree","_getForceContributions","parentBranch","_getForceContribution","children","NW","NE","SW","SE","childrenCount","centerOfMass","calcSize","_calculateForces","gravityForce","fx","fy","forces","minX","minY","maxX","maxY","minimumTreeSize","rootSize","halfRootSize","centerX","centerY","range","maxWidth","_splitBranch","_placeInTree","totalMass","totalMassInv","biggestSize","skipMassUpdate","_updateBranchMass","region","_placeInRegion","containedNode","_insertRegion","childSize","_drawBranch","branch","RepulsionSolver","repulsingForce","nodeDistance","HierarchicalRepulsionSolver","theseNodesDistance","steepness","SpringSolver","edgeLength","edgeIndices","physicsEdgeIndices","node3","springLength","_calculateSpringForce","springForce","springConstant","HierarchicalSpringSolver","springFx","springFy","totalFx","totalFy","correctionFx","correctionFy","CentralGravitySolver","centralGravity","ForceAtlas2BasedRepulsionSolver","degree","ForceAtlas2BasedCentralGravitySolver","PhysicsEngine","velocities","physicsEnabled","simulationInterval","requiresTimeout","previousStates","referenceState","freezeCache","renderTimer","adaptiveTimestep","adaptiveTimestepEnabled","adaptiveCounter","adaptiveInterval","stabilized","startedStabilization","stabilizationIterations","ready","barnesHut","damping","forceAtlas2Based","repulsion","hierarchicalRepulsion","maxVelocity","minVelocity","solver","stabilization","updateInterval","onlyDynamicEdges","fit","timestep","wind","layoutFailed","initPhysics","stopSimulation","startSimulation","updatePhysicsData","nodesSolver","edgesSolver","gravitySolver","Repulsion","HierarchicalRepulsion","modelOptions","stabilize","viewFunction","simulationStep","_emitStabilized","startTime","_Date$now","physicsTick","physicsTime","runDoubleSpeed","amountOfIterations","solve","moveNodes","_evaluateStepQuality","_startStabilizing","doAdaptive","physicsStep","revert","adjustTimeStep","nodeIds","_Object$keys","positions","vx","vy","dpos","reference","posThreshold","maxNodeVelocity","averageNodeVelocity","velocityAdaptiveThreshold","nodeVelocity","_performStep","m","df","maxV","force","velocity","calculateComponentVelocity","totalVelocity","targetIterations","_freezeNodes","_stabilizationBatch","running","sendProgress","count","_finalizeStabilization","_restoreFrozenNodes","colorFactor","forceSize","arrowSize","HSVToHex","NetworkUtil","allNodes","specificNodes","clonedOptions","amountOfConnections","Cluster","containedNodes","containedEdges","childClusterId","childCluster","clusterEdge","parentClusterEdge","clusteringEdgeReplacingIds","srcId","edgeReplacedById","ClusterEngine","clusteredNodes","clusteredEdges","hubsize","_getHubSize","_checkOptions","nodesToCluster","clusterByConnection","refreshData","joinCondition","childNodesObj","childEdgesObj","_cluster","edgeCount","clusters","usedNodes","relevantEdgeCount","checkJoinCondition","cloneOptions","gatheringSuccessful","childNodeId","_getConnectedId","findClusterData","foundCluster","clusterByEdgeCount","clusterNodeProperties","parentNodeId","parentClonedOptions","childClonedOptions","childNodeIDs","childNode","childNodeKey","childEdge","clusterEdgeProperties","otherNodeId","childKeys","createEdges","newEdges","getNewEdge","createdEdge","newEdge","matchToDirection","matchFromDirection","_createClusteredEdge","_backupEdgeOptions","tmpNodesToRemove","allowSingleNodeCluster","processProperties","childNodesOptions","childEdgesOptions","randomUUID","clusterId","_getClusterPosition","clusterNode","_clusterEdges","originalOptions","clusterNodeId","stack","findNode","parentIndex","parentClusterNodeId","parentClusterNode","_openChildCluster","releaseFunction","clusterPosition","newPositions","edgesToBeDeleted","otherNode","transferId","transferEdge","otherCluster","_restoreEdge","nodesArray","counter","clusteredNodeId","startEdgeId","allEdgeIds","getClusteredEdges","clusteredEdgeId","getBaseEdges","IdsToHandle","doneIds","foundIds","nextId","nextEdge","replacingIds","replacingId","average","averageSquared","hubCounter","largestHub","variance","standardDeviation","hubThreshold","baseEdge","extraOptions","childNodes","childEdges","_createClusterEdges","clusteredNode","deletedNodeIds","deletedEdgeIds","eachClusterNode","endPointsValid","isValid","replacedIds","numValid","containedEdgeId","containedEdge","deletedEdgeId","_filter","shouldBeClustered","_isClusteredNode","_isClusteredEdge","clusterFrom","_getClusterNodeForNode","clusterTo","changed","continueLoop","clustersToOpen","numNodes","allowSingle","openCluster","_updateState","_initRequestAnimationFrame","func","requestAnimationFrame","mozRequestAnimationFrame","webkitRequestAnimationFrame","msRequestAnimationFrame","CanvasRenderer","redrawRequested","renderingActive","renderRequests","allowRedraw","dragging","zooming","hideEdgesOnDrag","hideEdgesOnZoom","hideNodesOnDrag","_determineBrowserMethod","clearTimeout","zoomTimeoutId","_setTimeout","_requestRedraw","_resizeNodes","_redraw","_startRendering","cancelAnimationFrame","delay","timer","myWindow","_requestNextFrame","_renderStep","drawExternalLabels","frame","setSize","setTransform","clientWidth","clientHeight","clearRect","translation","_drawEdges","_drawNodes","_drawArrows","_drawSelectionBox","alwaysShow","hovered","topLeft","DOMtoCanvas","bottomRight","viewableArea","isSelected","isBoundingBoxOverlappingWith","selectedLength","hoveredLength","drawArrows","browserType","navigator","selectionBox","show","onTouch","hammer","inputHandler","isFirst","onRelease","isFinal","Canvas","pixelRatio","cameraState","canvasViewCenter","_cleanupCallbacks","autoResize","hammerFrame","destroy","_cleanUp","ResizeObserver","observer","observe","unobserve","resizeTimer","_setInterval","clearInterval","resizeFunction","_onResize","previousWidth","previousHeight","widthRatio","heightRatio","newScale","currentViewCenter","distanceFromCenter","container","hasChildNodes","firstChild","className","overflow","tabIndex","noCanvas","fontWeight","padding","innerText","_setPixelRatio","_bindHammer","drag","pinch","Hammer","DIRECTION_ALL","eventListeners","onTap","onDoubleTap","onHold","onDragStart","onDrag","onDragEnd","onPinch","onMouseWheel","onMouseMove","onContext","_prepareValue","emitEvent","oldWidth","oldHeight","previousRatio","_getCameraState","newWidth","newHeight","_setCameraState","numerator","devicePixelRatio","denominator","webkitBackingStorePixelRatio","mozBackingStorePixelRatio","msBackingStorePixelRatio","oBackingStorePixelRatio","backingStorePixelRatio","_determinePixelRatio","_XconvertCanvasToDOM","_YconvertCanvasToDOM","_XconvertDOMtoCanvas","_YconvertDOMtoCanvas","normalizeFitOptions","rawOptions","allNodeIds","minZoomLevel","MIN_VALUE","maxZoomLevel","View","animationSpeed","renderRefreshRate","animationEasingFunction","easingTime","sourceScale","targetScale","sourceTranslation","targetTranslation","lockedOnNodeId","lockedOnNodeOffset","touchTime","releaseNode","initialZoom","canvasWidth","canvasHeight","zoomLevel","getRange","positionDefined","numberOfNodes","xDistance","yDistance","xZoomLevel","yZoomLevel","center","findCenter","animationOptions","animation","nodePosition","lockedOnNode","getViewPosition","duration","easingFunction","animateView","locked","_transitionRedraw","viewCenter","_lockedRedraw","finished","progress","easingFunctions","keycharm","preventDefault","_exportFunctions","_bound","keydown","keyup","_keys","down","handleEvent","up","keyCode","shiftKey","bindAll","getKey","unbind","newBindings","NavigationHandler","iconsCreated","navigationHammers","boundFunctions","activated","configureKeyboardBindings","navigationButtons","loadNavigationElements","cleanNavigation","navigationDOM","parentNode","navigationDivs","navigationDivActions","_fit","bindToRedraw","_stopMovement","action","boundAction","keyboard","speed","scaleOld","zoom","scaleFrac","tx","ty","pointer","bindToWindow","unbindFromRedraw","InteractionHandler","selectionHandler","navigationHandler","popup","popupObj","popupTimer","getPointer","dragNodes","dragView","autoFocus","tooltipDelay","zoomView","zoomSpeed","touch","getAbsoluteLeft","getAbsoluteTop","pinched","multiselect","changedPointers","ctrlKey","metaKey","checkSelectionChanges","commitAndEmit","generateClickEvent","clientX","clientY","selectAdditionalOnPoint","selectOnPoint","firstSet","secondSet","arrayDiff","firstArr","secondArr","getNodeAt","selection","srcEvent","unselectAll","selectObject","getSelectedNodes","xFixed","yFixed","deltaX","deltaY","diffX","diffY","selectionBoxPosition","selectionBoxPositionMinMax","toBeSelectedNodes","preScaleDragPointer","postScaleDragPointer","canvasToDOM","popupVisible","_checkHidePopup","setPosition","focus","_checkShowPopup","hoverObject","pointerObj","previousPopupObjId","nodeUnderCursor","popupType","overlappingNodes","getTitle","overlappingEdges","Popup","popupTargetType","popupTargetId","setText","hide","_pointerToPositionObject","stillOnObj","overNode","ArrayIterationModule","uncaughtFrozenStore","frozen","UncaughtFrozenStore","findUncaughtFrozen","$has","enforceIternalState","IS_IE11","InternalWeakMap","$WeakMap","collectionWeak","WeakMapPrototype","nativeDelete","nativeHas","nativeGet","nativeSet","__classPrivateFieldGet","__classPrivateFieldSet","diffSets","diff","SingleTypeSelectionAccumulator","_SingleTypeSelectionAccumulator_previousSelection","_SingleTypeSelectionAccumulator_selection","delete","added","deleted","changes","getChanges","select","unselect","SelectionAccumulator","commitHandler","_SelectionAccumulator_nodes","_SelectionAccumulator_edges","_SelectionAccumulator_commitHandler","getSelection","summary","commit","rest","SelectionHandler","_selectionAccumulator","hoverObj","selectable","selectConnectedEdges","hoverConnectedEdges","updateSelection","getEdgeAt","selectionChanged","deselectObject","DOM","eventType","oldSelection","emptySelection","_initBaseEvent","getClickedItems","controlEdge","highlightEdges","addEdges","addNodes","_removeFromSelection","canvasPos","returnNode","positionObject","_getAllNodesOverlappingWith","_getEdgesOverlappingWith","returnEdge","mindist","overlappingEdge","deleteNodes","deleteEdges","sizeNodes","sizeEdges","_addToHover","hoverChanged","emitBlurEvent","hoveredEdgesCount","hoveredNodesCount","newOnlyHoveredEdge","newOnlyHoveredNode","emitHoverEvent","_hoverConnectedEdges","selectionChanges","previousSelection","getSelectedNodeIds","getSelectedEdgeIds","getNodes","getEdges","RangeError","setSelection","getItemsOnPoint","factory","this","__esModule","DEFAULT_MIN_MERGE","DEFAULT_MIN_GALLOPING","DEFAULT_TMP_STORAGE_LENGTH","POWERS_OF_TEN","log10","alphabeticalCompare","al","bl","aStr","bStr","minRunLength","makeAscendingRun","lo","compare","runHi","reverseRun","binaryInsertionSort","pivot","mid","gallopLeft","hint","lastOffset","maxOffset","gallopRight","TimSort","minGallop","tmpStorageLength","stackLength","runStart","runLength","stackSize","pushRun","mergeRuns","mergeAt","forceMergeRuns","start1","length1","start2","length2","mergeLow","mergeHigh","cursor1","cursor2","dest","count1","count2","exit","customCursor","customDest","remaining","ts","minRun","DirectionInterface","abstract","fake_use","nodeArray","VerticalStrategy","layout","hierarchical","addToOrdering","res","getTreeSize","min_x","max_x","timsort","levelSeparation","HorizontalStrategy","min_y","max_y","$every","fillLevelsByDirectionCyclic","levels","fillLevelsByDirectionLeaves","fillLevelsByDirection","_everyInstanceProperty","newLevel","oldLevel","fillLevelsByDirectionRoots","isEntryNode","shouldLevelBeReplaced","limit","_valuesInstanceProperty","acc","edgeIdProp","newLevelDiff","entryNodeId","entryNode","targetNodeId","HierarchicalStatus","childrenReference","parentReference","trees","distributionOrdering","distributionIndex","isTree","treeIndex","treeId","accumulator","_getMaxLevel","nodeA","nodeB","minLevel","parents1","parents2","isPresent","curLevel","LayoutEngine","_resetRNG","setPhysics","optionsBackup","randomSeed","improvedLayout","clusterThreshold","nodeSpacing","treeSpacing","blockShifting","edgeMinimization","parentCentralization","sortMethod","setupHierarchicalLayout","layoutNetwork","curveType","allOptions","prevHierarchicalState","setDirectionStrategy","adaptAllOptionsForHierarchicalLayout","seed","initialRandomSeed","backupPhysics","indices","MAX_LEVELS","clusterOptions","startLength","before","modules","clustering","clusterBridges","clusterOutliers","after","_declusterAll","kamadaKawai","_shiftToCenter","getRangeCore","clustersPresent","definedLevel","undefinedLevel","lastNodeOnLevel","_determineLevelsByHubsize","_determineLevelsDirected","_determineLevelsCustomCallback","ensureLevel","distribution","_getDistribution","_generateMap","_placeNodesByHierarchy","_condenseHierarchy","stillShifting","branches","shiftTrees","treeSizes","getTreeSizes","shiftBy","shiftTree","treeWidths","numTrees","getBranchNodes","getBranchBoundary","branchMap","maxLevel","minSpace","maxSpace","branchNode","getPosition","_getSpaceAroundNode","minSpaceNode","maxSpaceNode","getCollisionLevel","maxLevel1","getMaxLevel","maxLevel2","shiftElementsCloser","centerParents","hier","levelNodes","hasSameParent","inSameSubNetwork","branchShiftCallback","centerParent","pos1","pos2","diffAbs","branchNodes1","branchNodes2","branchNodeBoundary1","branchNodeBoundary2","max1","min2","minSpace2","diffBranch","_shiftBlock","_centerParent","minimizeEdgeLength","allEdges","nodeLevel","C2","referenceNodes","aboveEdges","getFx","getDFx","getGuess","guess","guessMap","dfx","ratio","moveBranch","branchNodes","branchBoundary","minSpaceBranch","maxSpaceBranch","branchOffset","moveNode","newPosition","minimizeEdgeLengthBottomUp","getLevels","_reverseInstanceProperty","shiftBranchesCloserBottomUp","centerAllParents","centerAllParentsBottomUp","useMap","ordering","prevNode","prevPos","nextNode","nextPos","parents","parentId","_getCenterPosition","positionedNodes","_indexArrayToNodes","handledNodeCount","_validatePositionAndContinue","parentLevel","childRef","childNodeLevel","previousPos","sharedParent","_findCommonParent","withChild","_placeBranchNodes","idArray","hubSizes","hubSize","_getActiveEdges","levelDownstream","_getHubSizes","_crawlNetwork","customCallback","levelByDirection","levelA","setMinLevelToZero","shakeTowards","fillInRelations","addRelation","checkIfTree","startingNodeId","crawler","tree","setTreeIndex","shifter","childA","childB","iterateParents","child","parentRef","findParent","foundParent","isVertical","minPos","maxPos","ManipulationSystem","interactionHandler","editMode","manipulationDiv","editModeDiv","closeDiv","_domEventListenerCleanupQueue","temporaryUIFunctions","temporaryEventFunctions","temporaryIds","guiEnabled","inMode","selectedControlNode","initiallyActive","deleteNode","deleteEdge","controlNodeStyle","_clean","_restore","enableEditMode","disableEditMode","locale","_setup","showManipulatorToolbar","_createEditButton","manipulationDOM","selectedNodeCount","getSelectedNodeCount","selectedEdgeCount","getSelectedEdgeCount","selectedTotalCount","needSeperator","_createAddNodeButton","_createSeperator","_createAddEdgeButton","_createEditNodeButton","_createEditEdgeButton","_createDeleteButton","_bindElementEvents","toggleEditMode","_temporaryBindEvent","_createBackButton","_createDescription","_performAddNode","finalizedData","alert","_temporaryBindUI","_handleConnect","_finishConnect","_dragControlNode","_dragStartEdge","editWithoutDrag","edgeBeingEditedId","_performEditEdge","controlNodeFrom","_getNewTargetNode","controlNodeTo","_controlNodeTouch","_controlNodeDragStart","_controlNodeDrag","_controlNodeDragEnd","findBorderPositions","selectedNodes","selectedEdges","deleteFunction","_createWrappers","_removeManipulationDOM","setAttribute","recursiveDOMDelete","button","_createButton","_cleanupDOMEventListeners","_cleanupTemporaryNodesAndEdges","_unbindTemporaryUIs","_unbindTemporaryEvents","_spliceInstanceProperty","addNodeMode","addEdgeMode","editEdgeMode","deleteBtnClass","rtl","deleteSelected","labelClassName","newFunction","UIfunctionName","functionName","eventName","domElement","keyupListener","indexTempEdge","indexTempNode","lastTouch","fromSelect","toSelect","overlappingNodeIds","targetNode","connectionEdge","connectFromId","_performAddEdge","clickData","defaultData","sourceNodeId","eeFunct","bool","dom","any","endPoints","nodeOptions","boolean","function","__type__","minimum","maximum","configure","showButton","__any__","interaction","manipulation","clickToUse","configureOptions","configuratorHideOption","parentPath","optionName","FloydWarshall","edgesArray","D_matrix","cell","knode","kcolm","inode","icolm","jnode","jcolm","KamadaKawai","edgeStrength","distanceSolver","ignoreClusters","getDistances","_createL_matrix","_createK_matrix","_createE_matrix","innerThreshold","maxInnerIterations","maxEnergy","highE_nodeId","dE_dx","dE_dy","delta_m","subIterations","_getHighestEnergyNode","_moveNode","_getEnergy","maxEnergyNodeId","dE_dx_max","dE_dy_max","nodeIdx","E_sums","d2E_dx2","d2E_dxdy","d2E_dy2","x_m","y_m","km","K_matrix","lm","L_matrix","iIdx","x_i","y_i","kmat","lmat","_updateE_matrix","E_matrix","mIdx","colm","lcolm","oldDx","oldDy","Network","renderer","nodesHandler","edgesHandler","_create","setData","errorFound","Validator","configurator","Configurator","networkOptions","setModuleOptions","activator","Activator","_updateVisibleIndices","edgeNodesPresent","isVisible","_updateValueRange","gephi","gephiData","valueMin","valueMax","valueTotal","setValueRange","isActive","active","cluster","getNodesInCluster","clusterByHubsize","updateClusteredNode","getBaseEdge","updateEdge","getSeed","editNodeMode","getPositions","storePositions","getBoundingBox","getConnectedNodes","objectId","getConnectedEdges","getSelectedEdges","selectNodes","selectEdges","commitWithoutEmitting","redraw","getScale","getOptionsFromConfigurator","getOptions","prepareElements","JSONcontainer","elementType","redundant","used","cleanupElements","resetElements","getSVGElement","svgContainer","createElementNS","getDOMElement","DOMContainer","insertBefore","drawPoint","groupTemplate","labelObj","setAttributeNS","styles","xOffset","yOffset","textContent","drawBar","network","dotparser","gephiParser","convertDot","convertGephi"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAAA,IAAIA,KAAK,GAAG,UAAUC,EAAV,EAAc;CACxB,SAAOA,EAAE,IAAIA,EAAE,CAACC,IAAH,IAAWA,IAAjB,IAAyBD,EAAhC;CACD,CAFD;;;CAKA,YAAc;CAEZD,KAAK,CAAC,OAAOG,UAAP,IAAqB,QAArB,IAAiCA,UAAlC,CAAL,IACAH,KAAK,CAAC,OAAOI,MAAP,IAAiB,QAAjB,IAA6BA,MAA9B,CAD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AAc,GAAGn2E,SAAjB;;;;;;CCQA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;;KACMq3E;;;;;;;;CACJ;CACF;CACA;CACE,wBAAW;CACT,YAAM,IAAIh+C,KAAJ,CAAU,mCAAV,CAAN;CACD;CAED;CACF;CACA;CACA;CACA;CACA;CACA;;;;YACE,oBAAW;CAEV;CAED;CACF;CACA;CACA;CACA;CACA;CACA;CACA;;;;YACE,qBAAY;CACV,aAAO,KAAKi+C,QAAL,EAAP;CACD;CAED;CACF;CACA;CACA;CACA;CACA;;;;YACE,qBAAYjyD,IAAZ,EAAkB;CAChB,WAAKkyD,QAAL,CAAclyD,IAAd;CACA,aAAO,KAAKiyD,QAAL,EAAP;CACD;CAED;CACF;CACA;CACA;CACA;CACA;CACA;;;;YACE,qBAAYjyD,IAAZ,EAAkBpa,QAAlB,EAA+C;CAAA,UAAnBgsC,KAAmB,uEAAXn9C,SAAW;CAC7C,WAAKy9E,QAAL,CAAclyD,IAAd,EAAoBpa,QAApB,EAA8BgsC,KAA9B;CACA,WAAKqgC,QAAL;CACD;CAED;CACF;CACA;CACA;CACA;CACA;CACA;CACA;CACA;;;;YACE,qBAAYn1E,KAAZ,EAAmB;CACjB,WAAKo1E,QAAL,CAAcp1E,KAAd;CACA,aAAO,KAAKm1E,QAAL,EAAP;CACD;CAED;CACF;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;;;;YACE,cAAKE,SAAL,EAAgB;CACd,WAAKD,QAAL,CAAcC,SAAd;CACA,WAAKF,QAAL;CACD;CAED;CACF;CACA;CACA;CACA;CACA;;;;YACE,aAAIjyD,IAAJ,EAAU4xB,KAAV,EAAiB;CACf,WAAKsgC,QAAL,CAAclyD,IAAd,EAAoB4xB,KAApB;CACA,WAAKqgC,QAAL;CACD;CAED;CACF;CACA;CACA;CACA;CACA;;;;YACE,eAAMliC,MAA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