UNPKG

vis-network

Version:

A dynamic, browser-based visualization library.

1,659 lines (1,354 loc) 1.2 MB
/** * vis-network * https://visjs.github.io/vis-network/ * * A dynamic, browser-based visualization library. * * @version 9.1.0 * @date 2021-08-29T08:43:14.666Z * * @copyright (c) 2011-2017 Almende B.V, http://almende.com * @copyright (c) 2017-2019 visjs contributors, https://github.com/visjs * * @license * vis.js is dual licensed under both * * 1. The Apache 2.0 License * http://www.apache.org/licenses/LICENSE-2.0 * * and * * 2. The MIT License * http://opensource.org/licenses/MIT * * vis.js may be distributed under either license. */ import { isDataViewLike, DataSet } from 'vis-data/peer/esm/vis-data.js'; var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {}; var check = function (it) { return it && it.Math == Math && it; }; // https://github.com/zloirock/core-js/issues/86#issuecomment-115759028 var global$k = // eslint-disable-next-line es/no-global-this -- safe check(typeof globalThis == 'object' && globalThis) || check(typeof window == 'object' && window) || // eslint-disable-next-line no-restricted-globals -- safe check(typeof self == 'object' && self) || check(typeof commonjsGlobal == 'object' && commonjsGlobal) || // eslint-disable-next-line no-new-func -- fallback function () { return this; }() || Function('return this')(); var objectGetOwnPropertyDescriptor = {}; var fails$m = function (exec) { try { return !!exec(); } catch (error) { return true; } }; var fails$l = fails$m; // Detect IE8's incomplete defineProperty implementation var descriptors = !fails$l(function () { // eslint-disable-next-line es/no-object-defineproperty -- required for testing return Object.defineProperty({}, 1, { get: function () { return 7; } })[1] != 7; }); var objectPropertyIsEnumerable = {}; var $propertyIsEnumerable$1 = {}.propertyIsEnumerable; // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe var getOwnPropertyDescriptor$7 = Object.getOwnPropertyDescriptor; // Nashorn ~ JDK8 bug var NASHORN_BUG = getOwnPropertyDescriptor$7 && !$propertyIsEnumerable$1.call({ 1: 2 }, 1); // `Object.prototype.propertyIsEnumerable` method implementation // https://tc39.es/ecma262/#sec-object.prototype.propertyisenumerable objectPropertyIsEnumerable.f = NASHORN_BUG ? function propertyIsEnumerable(V) { var descriptor = getOwnPropertyDescriptor$7(this, V); return !!descriptor && descriptor.enumerable; } : $propertyIsEnumerable$1; var createPropertyDescriptor$5 = function (bitmap, value) { return { enumerable: !(bitmap & 1), configurable: !(bitmap & 2), writable: !(bitmap & 4), value: value }; }; var toString$a = {}.toString; var classofRaw$1 = function (it) { return toString$a.call(it).slice(8, -1); }; var fails$k = fails$m; var classof$9 = classofRaw$1; var split = ''.split; // fallback for non-array-like ES3 and non-enumerable old V8 strings var indexedObject = fails$k(function () { // throws an error in rhino, see https://github.com/mozilla/rhino/issues/346 // eslint-disable-next-line no-prototype-builtins -- safe return !Object('z').propertyIsEnumerable(0); }) ? function (it) { return classof$9(it) == 'String' ? split.call(it, '') : Object(it); } : Object; // https://tc39.es/ecma262/#sec-requireobjectcoercible var requireObjectCoercible$5 = function (it) { if (it == undefined) throw TypeError("Can't call method on " + it); return it; }; var IndexedObject$3 = indexedObject; var requireObjectCoercible$4 = requireObjectCoercible$5; var toIndexedObject$a = function (it) { return IndexedObject$3(requireObjectCoercible$4(it)); }; var isObject$j = function (it) { return typeof it === 'object' ? it !== null : typeof it === 'function'; }; var path$x = {}; var path$w = path$x; var global$j = global$k; var aFunction$6 = function (variable) { return typeof variable == 'function' ? variable : undefined; }; var getBuiltIn$8 = function (namespace, method) { return arguments.length < 2 ? aFunction$6(path$w[namespace]) || aFunction$6(global$j[namespace]) : path$w[namespace] && path$w[namespace][method] || global$j[namespace] && global$j[namespace][method]; }; var getBuiltIn$7 = getBuiltIn$8; var engineUserAgent = getBuiltIn$7('navigator', 'userAgent') || ''; var global$i = global$k; var userAgent$3 = engineUserAgent; var process = global$i.process; var Deno = global$i.Deno; var versions = process && process.versions || Deno && Deno.version; var v8 = versions && versions.v8; var match, version; if (v8) { match = v8.split('.'); version = match[0] < 4 ? 1 : match[0] + match[1]; } else if (userAgent$3) { match = userAgent$3.match(/Edge\/(\d+)/); if (!match || match[1] >= 74) { match = userAgent$3.match(/Chrome\/(\d+)/); if (match) version = match[1]; } } var engineV8Version = version && +version; /* eslint-disable es/no-symbol -- required for testing */ var V8_VERSION$2 = engineV8Version; var fails$j = fails$m; // eslint-disable-next-line es/no-object-getownpropertysymbols -- required for testing var nativeSymbol = !!Object.getOwnPropertySymbols && !fails$j(function () { var symbol = Symbol(); // Chrome 38 Symbol has incorrect toString conversion // `get-own-property-symbols` polyfill symbols converted to object are not Symbol instances return !String(symbol) || !(Object(symbol) instanceof Symbol) || // Chrome 38-40 symbols are not inherited from DOM collections prototypes to instances !Symbol.sham && V8_VERSION$2 && V8_VERSION$2 < 41; }); /* eslint-disable es/no-symbol -- required for testing */ var NATIVE_SYMBOL$2 = nativeSymbol; var useSymbolAsUid = NATIVE_SYMBOL$2 && !Symbol.sham && typeof Symbol.iterator == 'symbol'; var getBuiltIn$6 = getBuiltIn$8; var USE_SYMBOL_AS_UID$1 = useSymbolAsUid; var isSymbol$4 = USE_SYMBOL_AS_UID$1 ? function (it) { return typeof it == 'symbol'; } : function (it) { var $Symbol = getBuiltIn$6('Symbol'); return typeof $Symbol == 'function' && Object(it) instanceof $Symbol; }; var isObject$i = isObject$j; // `OrdinaryToPrimitive` abstract operation // https://tc39.es/ecma262/#sec-ordinarytoprimitive var ordinaryToPrimitive$1 = function (input, pref) { var fn, val; if (pref === 'string' && typeof (fn = input.toString) == 'function' && !isObject$i(val = fn.call(input))) return val; if (typeof (fn = input.valueOf) == 'function' && !isObject$i(val = fn.call(input))) return val; if (pref !== 'string' && typeof (fn = input.toString) == 'function' && !isObject$i(val = fn.call(input))) return val; throw TypeError("Can't convert object to primitive value"); }; var shared$4 = {exports: {}}; var global$h = global$k; var setGlobal$1 = function (key, value) { try { // eslint-disable-next-line es/no-object-defineproperty -- safe Object.defineProperty(global$h, key, { value: value, configurable: true, writable: true }); } catch (error) { global$h[key] = value; } return value; }; var global$g = global$k; var setGlobal = setGlobal$1; var SHARED = '__core-js_shared__'; var store$3 = global$g[SHARED] || setGlobal(SHARED, {}); var sharedStore = store$3; var store$2 = sharedStore; (shared$4.exports = function (key, value) { return store$2[key] || (store$2[key] = value !== undefined ? value : {}); })('versions', []).push({ version: '3.16.1', mode: 'pure' , copyright: '© 2021 Denis Pushkarev (zloirock.ru)' }); var requireObjectCoercible$3 = requireObjectCoercible$5; // `ToObject` abstract operation // https://tc39.es/ecma262/#sec-toobject var toObject$d = function (argument) { return Object(requireObjectCoercible$3(argument)); }; var toObject$c = toObject$d; var hasOwnProperty = {}.hasOwnProperty; var has$c = Object.hasOwn || function hasOwn(it, key) { return hasOwnProperty.call(toObject$c(it), key); }; var id$2 = 0; var postfix = Math.random(); var uid$4 = function (key) { return 'Symbol(' + String(key === undefined ? '' : key) + ')_' + (++id$2 + postfix).toString(36); }; var global$f = global$k; var shared$3 = shared$4.exports; var has$b = has$c; var uid$3 = uid$4; var NATIVE_SYMBOL$1 = nativeSymbol; var USE_SYMBOL_AS_UID = useSymbolAsUid; var WellKnownSymbolsStore$1 = shared$3('wks'); var Symbol$1 = global$f.Symbol; var createWellKnownSymbol = USE_SYMBOL_AS_UID ? Symbol$1 : Symbol$1 && Symbol$1.withoutSetter || uid$3; var wellKnownSymbol$j = function (name) { if (!has$b(WellKnownSymbolsStore$1, name) || !(NATIVE_SYMBOL$1 || typeof WellKnownSymbolsStore$1[name] == 'string')) { if (NATIVE_SYMBOL$1 && has$b(Symbol$1, name)) { WellKnownSymbolsStore$1[name] = Symbol$1[name]; } else { WellKnownSymbolsStore$1[name] = createWellKnownSymbol('Symbol.' + name); } } return WellKnownSymbolsStore$1[name]; }; var isObject$h = isObject$j; var isSymbol$3 = isSymbol$4; var ordinaryToPrimitive = ordinaryToPrimitive$1; var wellKnownSymbol$i = wellKnownSymbol$j; var TO_PRIMITIVE$1 = wellKnownSymbol$i('toPrimitive'); // `ToPrimitive` abstract operation // https://tc39.es/ecma262/#sec-toprimitive var toPrimitive$1 = function (input, pref) { if (!isObject$h(input) || isSymbol$3(input)) return input; var exoticToPrim = input[TO_PRIMITIVE$1]; var result; if (exoticToPrim !== undefined) { if (pref === undefined) pref = 'default'; result = exoticToPrim.call(input, pref); if (!isObject$h(result) || isSymbol$3(result)) return result; throw TypeError("Can't convert object to primitive value"); } if (pref === undefined) pref = 'number'; return ordinaryToPrimitive(input, pref); }; var toPrimitive = toPrimitive$1; var isSymbol$2 = isSymbol$4; // `ToPropertyKey` abstract operation // https://tc39.es/ecma262/#sec-topropertykey var toPropertyKey$4 = function (argument) { var key = toPrimitive(argument, 'string'); return isSymbol$2(key) ? key : String(key); }; var global$e = global$k; var isObject$g = isObject$j; var document$1 = global$e.document; // typeof document.createElement is 'object' in old IE var EXISTS = isObject$g(document$1) && isObject$g(document$1.createElement); var documentCreateElement$1 = function (it) { return EXISTS ? document$1.createElement(it) : {}; }; var DESCRIPTORS$f = descriptors; var fails$i = fails$m; var createElement = documentCreateElement$1; // Thank's IE8 for his funny defineProperty var ie8DomDefine = !DESCRIPTORS$f && !fails$i(function () { // eslint-disable-next-line es/no-object-defineproperty -- requied for testing return Object.defineProperty(createElement('div'), 'a', { get: function () { return 7; } }).a != 7; }); var DESCRIPTORS$e = descriptors; var propertyIsEnumerableModule$2 = objectPropertyIsEnumerable; var createPropertyDescriptor$4 = createPropertyDescriptor$5; var toIndexedObject$9 = toIndexedObject$a; var toPropertyKey$3 = toPropertyKey$4; var has$a = has$c; var IE8_DOM_DEFINE$1 = ie8DomDefine; // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe var $getOwnPropertyDescriptor$1 = Object.getOwnPropertyDescriptor; // `Object.getOwnPropertyDescriptor` method // https://tc39.es/ecma262/#sec-object.getownpropertydescriptor objectGetOwnPropertyDescriptor.f = DESCRIPTORS$e ? $getOwnPropertyDescriptor$1 : function getOwnPropertyDescriptor(O, P) { O = toIndexedObject$9(O); P = toPropertyKey$3(P); if (IE8_DOM_DEFINE$1) try { return $getOwnPropertyDescriptor$1(O, P); } catch (error) { /* empty */ } if (has$a(O, P)) return createPropertyDescriptor$4(!propertyIsEnumerableModule$2.f.call(O, P), O[P]); }; var fails$h = fails$m; var replacement = /#|\.prototype\./; var isForced$1 = function (feature, detection) { var value = data[normalize(feature)]; return value == POLYFILL ? true : value == NATIVE ? false : typeof detection == 'function' ? fails$h(detection) : !!detection; }; var normalize = isForced$1.normalize = function (string) { return String(string).replace(replacement, '.').toLowerCase(); }; var data = isForced$1.data = {}; var NATIVE = isForced$1.NATIVE = 'N'; var POLYFILL = isForced$1.POLYFILL = 'P'; var isForced_1 = isForced$1; var aFunction$5 = function (it) { if (typeof it != 'function') { throw TypeError(String(it) + ' is not a function'); } return it; }; var aFunction$4 = aFunction$5; // optional / simple context binding var functionBindContext = function (fn, that, length) { aFunction$4(fn); if (that === undefined) return fn; switch (length) { case 0: return function () { return fn.call(that); }; case 1: return function (a) { return fn.call(that, a); }; case 2: return function (a, b) { return fn.call(that, a, b); }; case 3: return function (a, b, c) { return fn.call(that, a, b, c); }; } return function () { return fn.apply(that, arguments); }; }; var objectDefineProperty = {}; var isObject$f = isObject$j; var anObject$c = function (it) { if (!isObject$f(it)) { throw TypeError(String(it) + ' is not an object'); } return it; }; var DESCRIPTORS$d = descriptors; var IE8_DOM_DEFINE = ie8DomDefine; var anObject$b = anObject$c; var toPropertyKey$2 = toPropertyKey$4; // eslint-disable-next-line es/no-object-defineproperty -- safe var $defineProperty$1 = Object.defineProperty; // `Object.defineProperty` method // https://tc39.es/ecma262/#sec-object.defineproperty objectDefineProperty.f = DESCRIPTORS$d ? $defineProperty$1 : function defineProperty(O, P, Attributes) { anObject$b(O); P = toPropertyKey$2(P); anObject$b(Attributes); if (IE8_DOM_DEFINE) try { return $defineProperty$1(O, P, Attributes); } catch (error) { /* empty */ } if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported'); if ('value' in Attributes) O[P] = Attributes.value; return O; }; var DESCRIPTORS$c = descriptors; var definePropertyModule$4 = objectDefineProperty; var createPropertyDescriptor$3 = createPropertyDescriptor$5; var createNonEnumerableProperty$9 = DESCRIPTORS$c ? function (object, key, value) { return definePropertyModule$4.f(object, key, createPropertyDescriptor$3(1, value)); } : function (object, key, value) { object[key] = value; return object; }; var global$d = global$k; var getOwnPropertyDescriptor$6 = objectGetOwnPropertyDescriptor.f; var isForced = isForced_1; var path$v = path$x; var bind$a = functionBindContext; var createNonEnumerableProperty$8 = createNonEnumerableProperty$9; var has$9 = has$c; var wrapConstructor = function (NativeConstructor) { var Wrapper = function (a, b, c) { if (this instanceof NativeConstructor) { switch (arguments.length) { case 0: return new NativeConstructor(); case 1: return new NativeConstructor(a); case 2: return new NativeConstructor(a, b); } return new NativeConstructor(a, b, c); } return NativeConstructor.apply(this, arguments); }; Wrapper.prototype = NativeConstructor.prototype; return Wrapper; }; /* options.target - name of the target object options.global - target is the global object options.stat - export as static methods of target options.proto - export as prototype methods of target options.real - real prototype method for the `pure` version options.forced - export even if the native feature is available options.bind - bind methods to the target, required for the `pure` version options.wrap - wrap constructors to preventing global pollution, required for the `pure` version options.unsafe - use the simple assignment of property instead of delete + defineProperty options.sham - add a flag to not completely full polyfills options.enumerable - export as enumerable property options.noTargetGet - prevent calling a getter on target */ var _export = function (options, source) { var TARGET = options.target; var GLOBAL = options.global; var STATIC = options.stat; var PROTO = options.proto; var nativeSource = GLOBAL ? global$d : STATIC ? global$d[TARGET] : (global$d[TARGET] || {}).prototype; var target = GLOBAL ? path$v : path$v[TARGET] || (path$v[TARGET] = {}); var targetPrototype = target.prototype; var FORCED, USE_NATIVE, VIRTUAL_PROTOTYPE; var key, sourceProperty, targetProperty, nativeProperty, resultProperty, descriptor; for (key in source) { FORCED = isForced(GLOBAL ? key : TARGET + (STATIC ? '.' : '#') + key, options.forced); // contains in native USE_NATIVE = !FORCED && nativeSource && has$9(nativeSource, key); targetProperty = target[key]; if (USE_NATIVE) if (options.noTargetGet) { descriptor = getOwnPropertyDescriptor$6(nativeSource, key); nativeProperty = descriptor && descriptor.value; } else nativeProperty = nativeSource[key]; // export native or implementation sourceProperty = USE_NATIVE && nativeProperty ? nativeProperty : source[key]; if (USE_NATIVE && typeof targetProperty === typeof sourceProperty) continue; // bind timers to global for call from export context if (options.bind && USE_NATIVE) resultProperty = bind$a(sourceProperty, global$d); // wrap global constructors for prevent changs in this version else if (options.wrap && USE_NATIVE) resultProperty = wrapConstructor(sourceProperty); // make static versions for prototype methods else if (PROTO && typeof sourceProperty == 'function') resultProperty = bind$a(Function.call, sourceProperty); // default case else resultProperty = sourceProperty; // add a flag to not completely full polyfills if (options.sham || sourceProperty && sourceProperty.sham || targetProperty && targetProperty.sham) { createNonEnumerableProperty$8(resultProperty, 'sham', true); } target[key] = resultProperty; if (PROTO) { VIRTUAL_PROTOTYPE = TARGET + 'Prototype'; if (!has$9(path$v, VIRTUAL_PROTOTYPE)) { createNonEnumerableProperty$8(path$v, VIRTUAL_PROTOTYPE, {}); } // export virtual prototype methods path$v[VIRTUAL_PROTOTYPE][key] = sourceProperty; // export real prototype methods if (options.real && targetPrototype && !targetPrototype[key]) { createNonEnumerableProperty$8(targetPrototype, key, sourceProperty); } } } }; var ceil = Math.ceil; var floor$1 = Math.floor; // `ToInteger` abstract operation // https://tc39.es/ecma262/#sec-tointeger var toInteger$4 = function (argument) { return isNaN(argument = +argument) ? 0 : (argument > 0 ? floor$1 : ceil)(argument); }; var toInteger$3 = toInteger$4; var min$2 = Math.min; // `ToLength` abstract operation // https://tc39.es/ecma262/#sec-tolength var toLength$a = function (argument) { return argument > 0 ? min$2(toInteger$3(argument), 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991 }; var toInteger$2 = toInteger$4; var max$2 = Math.max; var min$1 = Math.min; // Helper for a popular repeating case of the spec: // Let integer be ? ToInteger(index). // If integer < 0, let result be max((length + integer), 0); else let result be min(integer, length). var toAbsoluteIndex$4 = function (index, length) { var integer = toInteger$2(index); return integer < 0 ? max$2(integer + length, 0) : min$1(integer, length); }; var toIndexedObject$8 = toIndexedObject$a; var toLength$9 = toLength$a; var toAbsoluteIndex$3 = toAbsoluteIndex$4; // `Array.prototype.{ indexOf, includes }` methods implementation var createMethod$5 = function (IS_INCLUDES) { return function ($this, el, fromIndex) { var O = toIndexedObject$8($this); var length = toLength$9(O.length); var index = toAbsoluteIndex$3(fromIndex, length); var value; // Array#includes uses SameValueZero equality algorithm // eslint-disable-next-line no-self-compare -- NaN check if (IS_INCLUDES && el != el) while (length > index) { value = O[index++]; // eslint-disable-next-line no-self-compare -- NaN check if (value != value) return true; // Array#indexOf ignores holes, Array#includes - not } else for (; length > index; index++) { if ((IS_INCLUDES || index in O) && O[index] === el) return IS_INCLUDES || index || 0; } return !IS_INCLUDES && -1; }; }; var arrayIncludes$1 = { // `Array.prototype.includes` method // https://tc39.es/ecma262/#sec-array.prototype.includes includes: createMethod$5(true), // `Array.prototype.indexOf` method // https://tc39.es/ecma262/#sec-array.prototype.indexof indexOf: createMethod$5(false) }; var hiddenKeys$6 = {}; var has$8 = has$c; var toIndexedObject$7 = toIndexedObject$a; var indexOf$4 = arrayIncludes$1.indexOf; var hiddenKeys$5 = hiddenKeys$6; var objectKeysInternal = function (object, names) { var O = toIndexedObject$7(object); var i = 0; var result = []; var key; for (key in O) !has$8(hiddenKeys$5, key) && has$8(O, key) && result.push(key); // Don't enum bug & hidden keys while (names.length > i) if (has$8(O, key = names[i++])) { ~indexOf$4(result, key) || result.push(key); } return result; }; var enumBugKeys$3 = ['constructor', 'hasOwnProperty', 'isPrototypeOf', 'propertyIsEnumerable', 'toLocaleString', 'toString', 'valueOf']; var internalObjectKeys$1 = objectKeysInternal; var enumBugKeys$2 = enumBugKeys$3; // `Object.keys` method // https://tc39.es/ecma262/#sec-object.keys // eslint-disable-next-line es/no-object-keys -- safe var objectKeys$4 = Object.keys || function keys(O) { return internalObjectKeys$1(O, enumBugKeys$2); }; var objectGetOwnPropertySymbols = {}; objectGetOwnPropertySymbols.f = Object.getOwnPropertySymbols; var DESCRIPTORS$b = descriptors; var fails$g = fails$m; var objectKeys$3 = objectKeys$4; var getOwnPropertySymbolsModule$2 = objectGetOwnPropertySymbols; var propertyIsEnumerableModule$1 = objectPropertyIsEnumerable; var toObject$b = toObject$d; var IndexedObject$2 = indexedObject; // eslint-disable-next-line es/no-object-assign -- safe var $assign = Object.assign; // eslint-disable-next-line es/no-object-defineproperty -- required for testing var defineProperty$b = Object.defineProperty; // `Object.assign` method // https://tc39.es/ecma262/#sec-object.assign var objectAssign = !$assign || fails$g(function () { // should have correct order of operations (Edge bug) if (DESCRIPTORS$b && $assign({ b: 1 }, $assign(defineProperty$b({}, 'a', { enumerable: true, get: function () { defineProperty$b(this, 'b', { value: 3, enumerable: false }); } }), { b: 2 })).b !== 1) return true; // should work with symbols and should have deterministic property order (V8 bug) var A = {}; var B = {}; // eslint-disable-next-line es/no-symbol -- safe var symbol = Symbol(); var alphabet = 'abcdefghijklmnopqrst'; A[symbol] = 7; alphabet.split('').forEach(function (chr) { B[chr] = chr; }); return $assign({}, A)[symbol] != 7 || objectKeys$3($assign({}, B)).join('') != alphabet; }) ? function assign(target, source) { // eslint-disable-line no-unused-vars -- required for `.length` var T = toObject$b(target); var argumentsLength = arguments.length; var index = 1; var getOwnPropertySymbols = getOwnPropertySymbolsModule$2.f; var propertyIsEnumerable = propertyIsEnumerableModule$1.f; while (argumentsLength > index) { var S = IndexedObject$2(arguments[index++]); var keys = getOwnPropertySymbols ? objectKeys$3(S).concat(getOwnPropertySymbols(S)) : objectKeys$3(S); var length = keys.length; var j = 0; var key; while (length > j) { key = keys[j++]; if (!DESCRIPTORS$b || propertyIsEnumerable.call(S, key)) T[key] = S[key]; } } return T; } : $assign; var $$I = _export; var assign$5 = objectAssign; // `Object.assign` method // https://tc39.es/ecma262/#sec-object.assign // eslint-disable-next-line es/no-object-assign -- required for testing $$I({ target: 'Object', stat: true, forced: Object.assign !== assign$5 }, { assign: assign$5 }); var path$u = path$x; var assign$4 = path$u.Object.assign; var parent$T = assign$4; var assign$3 = parent$T; var assign$2 = assign$3; var aFunction$3 = aFunction$5; var isObject$e = isObject$j; var slice$7 = [].slice; var factories = {}; var construct$3 = function (C, argsLength, args) { if (!(argsLength in factories)) { for (var list = [], i = 0; i < argsLength; i++) list[i] = 'a[' + i + ']'; // eslint-disable-next-line no-new-func -- we have no proper alternatives, IE8- only factories[argsLength] = Function('C,a', 'return new C(' + list.join(',') + ')'); } return factories[argsLength](C, args); }; // `Function.prototype.bind` method implementation // https://tc39.es/ecma262/#sec-function.prototype.bind var functionBind = Function.bind || function bind(that /* , ...args */ ) { var fn = aFunction$3(this); var partArgs = slice$7.call(arguments, 1); var boundFunction = function bound() { var args = partArgs.concat(slice$7.call(arguments)); return this instanceof boundFunction ? construct$3(fn, args.length, args) : fn.apply(that, args); }; if (isObject$e(fn.prototype)) boundFunction.prototype = fn.prototype; return boundFunction; }; var $$H = _export; var bind$9 = functionBind; // `Function.prototype.bind` method // https://tc39.es/ecma262/#sec-function.prototype.bind $$H({ target: 'Function', proto: true }, { bind: bind$9 }); var path$t = path$x; var entryVirtual$i = function (CONSTRUCTOR) { return path$t[CONSTRUCTOR + 'Prototype']; }; var entryVirtual$h = entryVirtual$i; var bind$8 = entryVirtual$h('Function').bind; var bind$7 = bind$8; var FunctionPrototype = Function.prototype; var bind_1 = function (it) { var own = it.bind; return it === FunctionPrototype || it instanceof Function && own === FunctionPrototype.bind ? bind$7 : own; }; var parent$S = bind_1; var bind$6 = parent$S; var bind$5 = bind$6; /** * Draw a circle. * * @param ctx - The context this shape will be rendered to. * @param x - The position of the center on the x axis. * @param y - The position of the center on the y axis. * @param r - The radius of the circle. */ function drawCircle(ctx, x, y, r) { ctx.beginPath(); ctx.arc(x, y, r, 0, 2 * Math.PI, false); ctx.closePath(); } /** * Draw a square. * * @param ctx - The context this shape will be rendered to. * @param x - The position of the center on the x axis. * @param y - The position of the center on the y axis. * @param r - Half of the width and height of the square. */ function drawSquare(ctx, x, y, r) { ctx.beginPath(); ctx.rect(x - r, y - r, r * 2, r * 2); ctx.closePath(); } /** * Draw an equilateral triangle standing on a side. * * @param ctx - The context this shape will be rendered to. * @param x - The position of the center on the x axis. * @param y - The position of the center on the y axis. * @param r - Half of the length of the sides. * * @remarks * http://en.wikipedia.org/wiki/Equilateral_triangle */ function drawTriangle(ctx, x, y, r) { ctx.beginPath(); // the change in radius and the offset is here to center the shape r *= 1.15; y += 0.275 * r; var s = r * 2; var s2 = s / 2; var ir = Math.sqrt(3) / 6 * s; // radius of inner circle var h = Math.sqrt(s * s - s2 * s2); // height ctx.moveTo(x, y - (h - ir)); ctx.lineTo(x + s2, y + ir); ctx.lineTo(x - s2, y + ir); ctx.lineTo(x, y - (h - ir)); ctx.closePath(); } /** * Draw an equilateral triangle standing on a vertex. * * @param ctx - The context this shape will be rendered to. * @param x - The position of the center on the x axis. * @param y - The position of the center on the y axis. * @param r - Half of the length of the sides. * * @remarks * http://en.wikipedia.org/wiki/Equilateral_triangle */ function drawTriangleDown(ctx, x, y, r) { ctx.beginPath(); // the change in radius and the offset is here to center the shape r *= 1.15; y -= 0.275 * r; var s = r * 2; var s2 = s / 2; var ir = Math.sqrt(3) / 6 * s; // radius of inner circle var h = Math.sqrt(s * s - s2 * s2); // height ctx.moveTo(x, y + (h - ir)); ctx.lineTo(x + s2, y - ir); ctx.lineTo(x - s2, y - ir); ctx.lineTo(x, y + (h - ir)); ctx.closePath(); } /** * Draw a star. * * @param ctx - The context this shape will be rendered to. * @param x - The position of the center on the x axis. * @param y - The position of the center on the y axis. * @param r - The outer radius of the star. */ function drawStar(ctx, x, y, r) { // http://www.html5canvastutorials.com/labs/html5-canvas-star-spinner/ ctx.beginPath(); // the change in radius and the offset is here to center the shape r *= 0.82; y += 0.1 * r; for (var n = 0; n < 10; n++) { var radius = n % 2 === 0 ? r * 1.3 : r * 0.5; ctx.lineTo(x + radius * Math.sin(n * 2 * Math.PI / 10), y - radius * Math.cos(n * 2 * Math.PI / 10)); } ctx.closePath(); } /** * Draw a diamond. * * @param ctx - The context this shape will be rendered to. * @param x - The position of the center on the x axis. * @param y - The position of the center on the y axis. * @param r - Half of the width and height of the diamond. * * @remarks * http://www.html5canvastutorials.com/labs/html5-canvas-star-spinner/ */ function drawDiamond(ctx, x, y, r) { ctx.beginPath(); ctx.lineTo(x, y + r); ctx.lineTo(x + r, y); ctx.lineTo(x, y - r); ctx.lineTo(x - r, y); ctx.closePath(); } /** * Draw a rectangle with rounded corners. * * @param ctx - The context this shape will be rendered to. * @param x - The position of the center on the x axis. * @param y - The position of the center on the y axis. * @param w - The width of the rectangle. * @param h - The height of the rectangle. * @param r - The radius of the corners. * * @remarks * http://stackoverflow.com/questions/1255512/how-to-draw-a-rounded-rectangle-on-html-canvas */ function drawRoundRect(ctx, x, y, w, h, r) { var r2d = Math.PI / 180; if (w - 2 * r < 0) { r = w / 2; } //ensure that the radius isn't too large for x if (h - 2 * r < 0) { r = h / 2; } //ensure that the radius isn't too large for y ctx.beginPath(); ctx.moveTo(x + r, y); ctx.lineTo(x + w - r, y); ctx.arc(x + w - r, y + r, r, r2d * 270, r2d * 360, false); ctx.lineTo(x + w, y + h - r); ctx.arc(x + w - r, y + h - r, r, 0, r2d * 90, false); ctx.lineTo(x + r, y + h); ctx.arc(x + r, y + h - r, r, r2d * 90, r2d * 180, false); ctx.lineTo(x, y + r); ctx.arc(x + r, y + r, r, r2d * 180, r2d * 270, false); ctx.closePath(); } /** * Draw an ellipse. * * @param ctx - The context this shape will be rendered to. * @param x - The position of the center on the x axis. * @param y - The position of the center on the y axis. * @param w - The width of the ellipse. * @param h - The height of the ellipse. * * @remarks * http://stackoverflow.com/questions/2172798/how-to-draw-an-oval-in-html5-canvas * * Postfix '_vis' added to discern it from standard method ellipse(). */ function drawEllipse(ctx, x, y, w, h) { var kappa = 0.5522848, ox = w / 2 * kappa, // control point offset horizontal oy = h / 2 * kappa, // control point offset vertical xe = x + w, // x-end ye = y + h, // y-end xm = x + w / 2, // x-middle ym = y + h / 2; // y-middle ctx.beginPath(); ctx.moveTo(x, ym); ctx.bezierCurveTo(x, ym - oy, xm - ox, y, xm, y); ctx.bezierCurveTo(xm + ox, y, xe, ym - oy, xe, ym); ctx.bezierCurveTo(xe, ym + oy, xm + ox, ye, xm, ye); ctx.bezierCurveTo(xm - ox, ye, x, ym + oy, x, ym); ctx.closePath(); } /** * Draw an isometric cylinder. * * @param ctx - The context this shape will be rendered to. * @param x - The position of the center on the x axis. * @param y - The position of the center on the y axis. * @param w - The width of the database. * @param h - The height of the database. * * @remarks * http://stackoverflow.com/questions/2172798/how-to-draw-an-oval-in-html5-canvas */ function drawDatabase(ctx, x, y, w, h) { var f = 1 / 3; var wEllipse = w; var hEllipse = h * f; var kappa = 0.5522848, ox = wEllipse / 2 * kappa, // control point offset horizontal oy = hEllipse / 2 * kappa, // control point offset vertical xe = x + wEllipse, // x-end ye = y + hEllipse, // y-end xm = x + wEllipse / 2, // x-middle ym = y + hEllipse / 2, // y-middle ymb = y + (h - hEllipse / 2), // y-midlle, bottom ellipse yeb = y + h; // y-end, bottom ellipse ctx.beginPath(); ctx.moveTo(xe, ym); ctx.bezierCurveTo(xe, ym + oy, xm + ox, ye, xm, ye); ctx.bezierCurveTo(xm - ox, ye, x, ym + oy, x, ym); ctx.bezierCurveTo(x, ym - oy, xm - ox, y, xm, y); ctx.bezierCurveTo(xm + ox, y, xe, ym - oy, xe, ym); ctx.lineTo(xe, ymb); ctx.bezierCurveTo(xe, ymb + oy, xm + ox, yeb, xm, yeb); ctx.bezierCurveTo(xm - ox, yeb, x, ymb + oy, x, ymb); ctx.lineTo(x, ym); } /** * Draw a dashed line. * * @param ctx - The context this shape will be rendered to. * @param x - The start position on the x axis. * @param y - The start position on the y axis. * @param x2 - The end position on the x axis. * @param y2 - The end position on the y axis. * @param pattern - List of lengths starting with line and then alternating between space and line. * * @author David Jordan * @remarks * date 2012-08-08 * http://stackoverflow.com/questions/4576724/dotted-stroke-in-canvas */ function drawDashedLine(ctx, x, y, x2, y2, pattern) { ctx.beginPath(); ctx.moveTo(x, y); var patternLength = pattern.length; var dx = x2 - x; var dy = y2 - y; var slope = dy / dx; var distRemaining = Math.sqrt(dx * dx + dy * dy); var patternIndex = 0; var draw = true; var xStep = 0; var dashLength = +pattern[0]; while (distRemaining >= 0.1) { dashLength = +pattern[patternIndex++ % patternLength]; if (dashLength > distRemaining) { dashLength = distRemaining; } xStep = Math.sqrt(dashLength * dashLength / (1 + slope * slope)); xStep = dx < 0 ? -xStep : xStep; x += xStep; y += slope * xStep; if (draw === true) { ctx.lineTo(x, y); } else { ctx.moveTo(x, y); } distRemaining -= dashLength; draw = !draw; } } /** * Draw a hexagon. * * @param ctx - The context this shape will be rendered to. * @param x - The position of the center on the x axis. * @param y - The position of the center on the y axis. * @param r - The radius of the hexagon. */ function drawHexagon(ctx, x, y, r) { ctx.beginPath(); var sides = 6; var a = Math.PI * 2 / sides; ctx.moveTo(x + r, y); for (var i = 1; i < sides; i++) { ctx.lineTo(x + r * Math.cos(a * i), y + r * Math.sin(a * i)); } ctx.closePath(); } var shapeMap = { circle: drawCircle, dashedLine: drawDashedLine, database: drawDatabase, diamond: drawDiamond, ellipse: drawEllipse, ellipse_vis: drawEllipse, hexagon: drawHexagon, roundRect: drawRoundRect, square: drawSquare, star: drawStar, triangle: drawTriangle, triangleDown: drawTriangleDown }; /** * Returns either custom or native drawing function base on supplied name. * * @param name - The name of the function. Either the name of a * CanvasRenderingContext2D property or an export from shapes.ts without the * draw prefix. * * @returns The function that can be used for rendering. In case of native * CanvasRenderingContext2D function the API is normalized to * `(ctx: CanvasRenderingContext2D, ...originalArgs) => void`. */ function getShape(name) { if (Object.prototype.hasOwnProperty.call(shapeMap, name)) { return shapeMap[name]; } else { return function (ctx) { for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { args[_key - 1] = arguments[_key]; } CanvasRenderingContext2D.prototype[name].call(ctx, args); }; } } var componentEmitter = {exports: {}}; (function (module) { /** * Expose `Emitter`. */ { module.exports = Emitter; } /** * Initialize a new `Emitter`. * * @api public */ function Emitter(obj) { if (obj) return mixin(obj); } /** * Mixin the emitter properties. * * @param {Object} obj * @return {Object} * @api private */ function mixin(obj) { for (var key in Emitter.prototype) { obj[key] = Emitter.prototype[key]; } return obj; } /** * Listen on the given `event` with `fn`. * * @param {String} event * @param {Function} fn * @return {Emitter} * @api public */ Emitter.prototype.on = Emitter.prototype.addEventListener = function (event, fn) { this._callbacks = this._callbacks || {}; (this._callbacks['$' + event] = this._callbacks['$' + event] || []).push(fn); return this; }; /** * Adds an `event` listener that will be invoked a single * time then automatically removed. * * @param {String} event * @param {Function} fn * @return {Emitter} * @api public */ Emitter.prototype.once = function (event, fn) { function on() { this.off(event, on); fn.apply(this, arguments); } on.fn = fn; this.on(event, on); return this; }; /** * Remove the given callback for `event` or all * registered callbacks. * * @param {String} event * @param {Function} fn * @return {Emitter} * @api public */ Emitter.prototype.off = Emitter.prototype.removeListener = Emitter.prototype.removeAllListeners = Emitter.prototype.removeEventListener = function (event, fn) { this._callbacks = this._callbacks || {}; // all if (0 == arguments.length) { this._callbacks = {}; return this; } // specific event var callbacks = this._callbacks['$' + event]; if (!callbacks) return this; // remove all handlers if (1 == arguments.length) { delete this._callbacks['$' + event]; return this; } // remove specific handler var cb; for (var i = 0; i < callbacks.length; i++) { cb = callbacks[i]; if (cb === fn || cb.fn === fn) { callbacks.splice(i, 1); break; } } // Remove event specific arrays for event types that no // one is subscribed for to avoid memory leak. if (callbacks.length === 0) { delete this._callbacks['$' + event]; } return this; }; /** * Emit `event` with the given args. * * @param {String} event * @param {Mixed} ... * @return {Emitter} */ Emitter.prototype.emit = function (event) { this._callbacks = this._callbacks || {}; var args = new Array(arguments.length - 1), callbacks = this._callbacks['$' + event]; for (var i = 1; i < arguments.length; i++) { args[i - 1] = arguments[i]; } if (callbacks) { callbacks = callbacks.slice(0); for (var i = 0, len = callbacks.length; i < len; ++i) { callbacks[i].apply(this, args); } } return this; }; /** * Return array of callbacks for `event`. * * @param {String} event * @return {Array} * @api public */ Emitter.prototype.listeners = function (event) { this._callbacks = this._callbacks || {}; return this._callbacks['$' + event] || []; }; /** * Check if this emitter has `event` handlers. * * @param {String} event * @return {Boolean} * @api public */ Emitter.prototype.hasListeners = function (event) { return !!this.listeners(event).length; }; })(componentEmitter); var Emitter = componentEmitter.exports; var isSymbol$1 = isSymbol$4; var toString$9 = function (argument) { if (isSymbol$1(argument)) throw TypeError('Cannot convert a Symbol value to a string'); return String(argument); }; var toInteger$1 = toInteger$4; var toString$8 = toString$9; var requireObjectCoercible$2 = requireObjectCoercible$5; // `String.prototype.codePointAt` methods implementation var createMethod$4 = function (CONVERT_TO_STRING) { return function ($this, pos) { var S = toString$8(requireObjectCoercible$2($this)); var position = toInteger$1(pos); var size = S.length; var first, second; if (position < 0 || position >= size) return CONVERT_TO_STRING ? '' : undefined; first = S.charCodeAt(position); return first < 0xD800 || first > 0xDBFF || position + 1 === size || (second = S.charCodeAt(position + 1)) < 0xDC00 || second > 0xDFFF ? CONVERT_TO_STRING ? S.charAt(position) : first : CONVERT_TO_STRING ? S.slice(position, position + 2) : (first - 0xD800 << 10) + (second - 0xDC00) + 0x10000; }; }; var stringMultibyte = { // `String.prototype.codePointAt` method // https://tc39.es/ecma262/#sec-string.prototype.codepointat codeAt: createMethod$4(false), // `String.prototype.at` method // https://github.com/mathiasbynens/String.prototype.at charAt: createMethod$4(true) }; var store$1 = sharedStore; var functionToString = Function.toString; // this helper broken in `core-js@3.4.1-3.4.4`, so we can't use `shared` helper if (typeof store$1.inspectSource != 'function') { store$1.inspectSource = function (it) { return functionToString.call(it); }; } var inspectSource$1 = store$1.inspectSource; var global$c = global$k; var inspectSource = inspectSource$1; var WeakMap$1 = global$c.WeakMap; var nativeWeakMap = typeof WeakMap$1 === 'function' && /native code/.test(inspectSource(WeakMap$1)); var shared$2 = shared$4.exports; var uid$2 = uid$4; var keys$3 = shared$2('keys'); var sharedKey$4 = function (key) { return keys$3[key] || (keys$3[key] = uid$2(key)); }; var NATIVE_WEAK_MAP$1 = nativeWeakMap; var global$b = global$k; var isObject$d = isObject$j; var createNonEnumerableProperty$7 = createNonEnumerableProperty$9; var objectHas = has$c; var shared$1 = sharedStore; var sharedKey$3 = sharedKey$4; var hiddenKeys$4 = hiddenKeys$6; var OBJECT_ALREADY_INITIALIZED = 'Object already initialized'; var WeakMap = global$b.WeakMap; var set$3, get$5, has$7; var enforce = function (it) { return has$7(it) ? get$5(it) : set$3(it, {}); }; var getterFor = function (TYPE) { return function (it) { var state; if (!isObject$d(it) || (state = get$5(it)).type !== TYPE) { throw TypeError('Incompatible receiver, ' + TYPE + ' required'); } return state; }; }; if (NATIVE_WEAK_MAP$1 || shared$1.state) { var store = shared$1.state || (shared$1.state = new WeakMap()); var wmget = store.get; var wmhas = store.has; var wmset = store.set; set$3 = function (it, metadata) { if (wmhas.call(store, it)) throw new TypeError(OBJECT_ALREADY_INITIALIZED); metadata.facade = it; wmset.call(store, it, metadata); return metadata; }; get$5 = function (it) { return wmget.call(store, it) || {}; }; has$7 = function (it) { return wmhas.call(store, it); }; } else { var STATE = sharedKey$3('state'); hiddenKeys$4[STATE] = true; set$3 = function (it, metadata) { if (objectHas(it, STATE)) throw new TypeError(OBJECT_ALREADY_INITIALIZED); metadata.facade = it; createNonEnumerableProperty$7(it, STATE, metadata); return metadata; }; get$5 = function (it) { return objectHas(it, STATE) ? it[STATE] : {}; }; has$7 = function (it) { return objectHas(it, STATE); }; } var internalState = { set: set$3, get: get$5, has: has$7, enforce: enforce, getterFor: getterFor }; var fails$f = fails$m; var correctPrototypeGetter = !fails$f(function () { function F() { /* empty */ } F.prototype.constructor = null; // eslint-disable-next-line es/no-object-getprototypeof -- required for testing return Object.getPrototypeOf(new F()) !== F.prototype; }); var has$6 = has$c; var toObject$a = toObject$d; var sharedKey$2 = sharedKey$4; var CORRECT_PROTOTYPE_GETTER$1 = correctPrototypeGetter; var IE_PROTO$1 = sharedKey$2('IE_PROTO'); var ObjectPrototype$1 = Object.prototype; // `Object.getPrototypeOf` method // https://tc39.es/ecma262/#sec-object.getprototypeof // eslint-disable-next-line es/no-object-getprototypeof -- safe var objectGetPrototypeOf = CORRECT_PROTOTYPE_GETTER$1 ? Object.getPrototypeOf : function (O) { O = toObject$a(O); if (has$6(O, IE_PROTO$1)) return O[IE_PROTO$1]; if (typeof O.constructor == 'function' && O instanceof O.constructor) { return O.constructor.prototype; } return O instanceof Object ? ObjectPrototype$1 : null; }; var fails$e = fails$m; var getPrototypeOf$7 = objectGetPrototypeOf; var createNonEnumerableProperty$6 = createNonEnumerableProperty$9; var has$5 = has$c; var wellKnownSymbol$h = wellKnownSymbol$j; var ITERATOR$4 = wellKnownSymbol$h('iterator'); var BUGGY_SAFARI_ITERATORS$1 = false; var returnThis$2 = function () { return this; }; // `%IteratorPrototype%` object // https://tc39.es/ecma262/#sec-%iteratorprototype%-object var IteratorPrototype$2, PrototypeOfArrayIteratorPrototype, arrayIterator; /* eslint-disable es/no-array-prototype-keys -- safe */ if ([].keys) { arrayIterator = [].keys(); // Safari 8 has buggy iterators w/o `next` if (!('next' in arrayIterator)) BUGGY_SAFARI_ITERATORS$1 = true;else { PrototypeOfArrayIteratorPrototype = getPrototypeOf$7(getPrototypeOf$7(arrayIterator)); if (PrototypeOfArrayIteratorPrototype !== Object.prototype) IteratorPrototype$2 = PrototypeOfArrayIteratorPrototype; } } var NEW_ITERATOR_PROTOTYPE = IteratorPrototype$2 == undefined || fails$e(function () { var test = {}; // FF44- legacy iterators case return IteratorPrototype$2[ITERATOR$4].call(test) !== test; }); if (NEW_ITERATOR_PROTOTYPE) IteratorPrototype$2 = {}; // `%IteratorPrototype%[@@iterator]()` method // https://tc39.es/ecma262/#sec-%iteratorprototype%-@@iterator if ((NEW_ITERATOR_PROTOTYPE) && !has$5(IteratorPrototype$2, ITERATOR$4)) { createNonEnumerableProperty$6(IteratorPrototype$2, ITERATOR$4, returnThis$2); } var iteratorsCore = { IteratorPrototype: IteratorPrototype$2, BUGGY_SAFARI_ITERATORS: BUGGY_SAFARI_ITERATORS$1 }; var DESCRIPTORS$a = descriptors; var definePropertyModule$3 = objectDefineProperty; var anObject$a = anObject$c; var objectKeys$2 = objectKeys$4; // `Object.defineProperties` method // https://tc39.es/ecma262/#sec-object.defineproperties // eslint-disable-next-line es/no-object-defineproperties -- safe var objectDefineProperties = DESCRIPTORS$a ? Object.defineProperties : function defineProperties(O, Properties) { anObject$a(O); var keys = objectKeys$2(Properties); var length = keys.length; var index = 0; var key; while (length > index) definePropertyModule$3.f(O, key = keys[index++], Properties[key]); return O; }; var getBuiltIn$5 = getBuiltIn$8; var html$1 = getBuiltIn$5('document', 'documentElement'); /* global ActiveXObject -- old IE, WSH */ var anObject$9 = anObject$c; var defineProperties$5 = objectDefineProperties; var enumBugKeys$1 = enumBugKeys$3; var hiddenKeys$3 = hiddenKeys$6; var html = html$1; var documentCreateElement = documentCreateElement$1; var sharedKey$1 = sharedKey$4; var GT = '>'; var LT = '<'; var PROTOTYPE$1 = 'prototype'; var SCRIPT = 'script'; var IE_PROTO = sharedKey$1('IE_PROTO'); var EmptyConstructor = function () { /* empty */ }; var scriptTag = function (content) { return LT + SCRIPT + GT + content + LT + '/' + SCRIPT + GT; }; // Create object with fake `null` prototype: use ActiveX Object with cleared prototype var NullProtoObjectViaActiveX = function (activeXDocument) { activeXDocument.write(scriptTag('')); activeXDocument.close(); var temp = activeXDocument.parentWindow.Object; activeXDocument = null; // avoid memory leak return temp; }; // Create object with fake `null` prototype: use iframe Object with cleared prototype var NullProtoObjectViaIFrame = function () { // Thrash, waste and sodomy: IE GC bug var iframe = documentCreateElement('iframe'); var JS = 'java' + SCRIPT + ':'; var iframeDocument; if (iframe.style) { iframe.style.display = 'none'; html.appendChild(iframe); // https://github.com/zloirock/core-js/issues/475 iframe.src = String(JS); iframeDocument = iframe.contentWindow.document; iframeDocument.open(); iframeDocument.write(scriptTag('document.F=Object')); iframeDocument.close(); return iframeDocument.F; } }; // Check for document.domain and active x support // No need to use active x approach when document.domain is not set // see https://github.com/es-shims/es5-shim/issues/150 // variation of https://github.com/kitcambridge/es5-shim/commit/4f738ac066346 // avoid IE GC bug var activeXDocument; var NullProtoObject = function () { try { activeXDocument = new ActiveXObject('htmlfile'); } catch (error) { /* ignore */ } NullProtoObject = document.domain && activeXDocument ? NullProtoObjectViaActiveX(activeXDocument) : // old IE NullProtoObjectViaIFrame() || NullProtoObjectViaActiveX(activeXDocument); // WSH var length = enumBugKeys$1.length; while (length--) delete NullProtoObject[PROTOTYPE$1][enumBugKeys$1[length]]; return NullProtoObject(); }; hiddenKeys$3[IE_PROTO] = true; // `Object.create` method // https://tc39.es/ecma262/#sec-object.create var objectCreate = Object.create || function create(O, Properties) { var result; if (O !== null) { EmptyConstructor[PROTOTYPE$1] = anObject$9(O); result = new EmptyConstructor(); EmptyConstructor[PROTOTYPE$1] = null; // add "__proto__" for Object.getPrototypeOf polyfill result[IE_PROTO] = O; } else result = NullProtoObject(); return Properties === undefined ? result : defineProperties$5(result, Properties); }; var wellKnownSymbol$g = wellKnownSymbol$j; var TO_STRING_TAG$3 = well