(function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : typeof define === 'function' && define.amd ? define(factory) : (global = global || self, global.assetsLoadMonitor = factory()); }(this, function () { 'use strict'; var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {}; function createCommonjsModule(fn, module) { return module = { exports: {} }, fn(module, module.exports), module.exports; } var O = 'object'; var check = function (it) { return it && it.Math == Math && it; }; // https://github.com/zloirock/core-js/issues/86#issuecomment-115759028 var global_1 = // eslint-disable-next-line no-undef check(typeof globalThis == O && globalThis) || check(typeof window == O && window) || check(typeof self == O && self) || check(typeof commonjsGlobal == O && commonjsGlobal) || // eslint-disable-next-line no-new-func Function('return this')(); var fails = function (exec) { try { return !!exec(); } catch (error) { return true; } }; // Thank's IE8 for his funny defineProperty var descriptors = !fails(function () { return Object.defineProperty({}, 'a', { get: function () { return 7; } }).a != 7; }); var nativePropertyIsEnumerable = {}.propertyIsEnumerable; var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor; // Nashorn ~ JDK8 bug var NASHORN_BUG = getOwnPropertyDescriptor && !nativePropertyIsEnumerable.call({ 1: 2 }, 1); // `Object.prototype.propertyIsEnumerable` method implementation // https://tc39.github.io/ecma262/#sec-object.prototype.propertyisenumerable var f = NASHORN_BUG ? function propertyIsEnumerable(V) { var descriptor = getOwnPropertyDescriptor(this, V); return !!descriptor && descriptor.enumerable; } : nativePropertyIsEnumerable; var objectPropertyIsEnumerable = { f: f }; var createPropertyDescriptor = function (bitmap, value) { return { enumerable: !(bitmap & 1), configurable: !(bitmap & 2), writable: !(bitmap & 4), value: value }; }; var toString = {}.toString; var classofRaw = function (it) { return toString.call(it).slice(8, -1); }; var split = ''.split; // fallback for non-array-like ES3 and non-enumerable old V8 strings var indexedObject = fails(function () { // throws an error in rhino, see https://github.com/mozilla/rhino/issues/346 // eslint-disable-next-line no-prototype-builtins return !Object('z').propertyIsEnumerable(0); }) ? function (it) { return classofRaw(it) == 'String' ? split.call(it, '') : Object(it); } : Object; // `RequireObjectCoercible` abstract operation // https://tc39.github.io/ecma262/#sec-requireobjectcoercible var requireObjectCoercible = function (it) { if (it == undefined) throw TypeError("Can't call method on " + it); return it; }; // toObject with fallback for non-array-like ES3 strings var toIndexedObject = function (it) { return indexedObject(requireObjectCoercible(it)); }; var isObject = function (it) { return typeof it === 'object' ? it !== null : typeof it === 'function'; }; // `ToPrimitive` abstract operation // https://tc39.github.io/ecma262/#sec-toprimitive // instead of the ES6 spec version, we didn't implement @@toPrimitive case // and the second argument - flag - preferred type is a string var toPrimitive = function (input, PREFERRED_STRING) { if (!isObject(input)) return input; var fn, val; if (PREFERRED_STRING && typeof (fn = input.toString) == 'function' && !isObject(val = fn.call(input))) return val; if (typeof (fn = input.valueOf) == 'function' && !isObject(val = fn.call(input))) return val; if (!PREFERRED_STRING && typeof (fn = input.toString) == 'function' && !isObject(val = fn.call(input))) return val; throw TypeError("Can't convert object to primitive value"); }; var hasOwnProperty = {}.hasOwnProperty; var has = function (it, key) { return hasOwnProperty.call(it, key); }; var document$1 = global_1.document; // typeof document.createElement is 'object' in old IE var EXISTS = isObject(document$1) && isObject(document$1.createElement); var documentCreateElement = function (it) { return EXISTS ? document$1.createElement(it) : {}; }; // Thank's IE8 for his funny defineProperty var ie8DomDefine = !descriptors && !fails(function () { return Object.defineProperty(documentCreateElement('div'), 'a', { get: function () { return 7; } }).a != 7; }); var nativeGetOwnPropertyDescriptor = Object.getOwnPropertyDescriptor; // `Object.getOwnPropertyDescriptor` method // https://tc39.github.io/ecma262/#sec-object.getownpropertydescriptor var f$1 = descriptors ? nativeGetOwnPropertyDescriptor : function getOwnPropertyDescriptor(O, P) { O = toIndexedObject(O); P = toPrimitive(P, true); if (ie8DomDefine) try { return nativeGetOwnPropertyDescriptor(O, P); } catch (error) { /* empty */ } if (has(O, P)) return createPropertyDescriptor(!objectPropertyIsEnumerable.f.call(O, P), O[P]); }; var objectGetOwnPropertyDescriptor = { f: f$1 }; var replacement = /#|\.prototype\./; var isForced = function (feature, detection) { var value = data[normalize(feature)]; return value == POLYFILL ? true : value == NATIVE ? false : typeof detection == 'function' ? fails(detection) : !!detection; }; var normalize = isForced.normalize = function (string) { return String(string).replace(replacement, '.').toLowerCase(); }; var data = isForced.data = {}; var NATIVE = isForced.NATIVE = 'N'; var POLYFILL = isForced.POLYFILL = 'P'; var isForced_1 = isForced; var path = {}; var aFunction = function (it) { if (typeof it != 'function') { throw TypeError(String(it) + ' is not a function'); } return it; }; // optional / simple context binding var bindContext = function (fn, that, length) { aFunction(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 (/* ...args */) { return fn.apply(that, arguments); }; }; var anObject = function (it) { if (!isObject(it)) { throw TypeError(String(it) + ' is not an object'); } return it; }; var nativeDefineProperty = Object.defineProperty; // `Object.defineProperty` method // https://tc39.github.io/ecma262/#sec-object.defineproperty var f$2 = descriptors ? nativeDefineProperty : function defineProperty(O, P, Attributes) { anObject(O); P = toPrimitive(P, true); anObject(Attributes); if (ie8DomDefine) try { return nativeDefineProperty(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 objectDefineProperty = { f: f$2 }; var hide = descriptors ? function (object, key, value) { return objectDefineProperty.f(object, key, createPropertyDescriptor(1, value)); } : function (object, key, value) { object[key] = value; return object; }; var getOwnPropertyDescriptor$1 = objectGetOwnPropertyDescriptor.f; 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_1 : STATIC ? global_1[TARGET] : (global_1[TARGET] || {}).prototype; var target = GLOBAL ? path : path[TARGET] || (path[TARGET] = {}); var targetPrototype = target.prototype; var FORCED, USE_NATIVE, VIRTUAL_PROTOTYPE; var key, sourceProperty, targetProperty, nativeProperty, resultProperty, descriptor; for (key in source) { FORCED = isForced_1(GLOBAL ? key : TARGET + (STATIC ? '.' : '#') + key, options.forced); // contains in native USE_NATIVE = !FORCED && nativeSource && has(nativeSource, key); targetProperty = target[key]; if (USE_NATIVE) if (options.noTargetGet) { descriptor = getOwnPropertyDescriptor$1(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 = bindContext(sourceProperty, global_1); // 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 = bindContext(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)) { hide(resultProperty, 'sham', true); } target[key] = resultProperty; if (PROTO) { VIRTUAL_PROTOTYPE = TARGET + 'Prototype'; if (!has(path, VIRTUAL_PROTOTYPE)) hide(path, VIRTUAL_PROTOTYPE, {}); // export virtual prototype methods path[VIRTUAL_PROTOTYPE][key] = sourceProperty; // export real prototype methods if (options.real && targetPrototype && !targetPrototype[key]) hide(targetPrototype, key, sourceProperty); } } }; // `Object.defineProperty` method // https://tc39.github.io/ecma262/#sec-object.defineproperty _export({ target: 'Object', stat: true, forced: !descriptors, sham: !descriptors }, { defineProperty: objectDefineProperty.f }); var defineProperty_1 = createCommonjsModule(function (module) { var Object = path.Object; var defineProperty = module.exports = function defineProperty(it, key, desc) { return Object.defineProperty(it, key, desc); }; if (Object.defineProperty.sham) defineProperty.sham = true; }); var defineProperty = defineProperty_1; var defineProperty$1 = defineProperty; var ceil = Math.ceil; var floor = Math.floor; // `ToInteger` abstract operation // https://tc39.github.io/ecma262/#sec-tointeger var toInteger = function (argument) { return isNaN(argument = +argument) ? 0 : (argument > 0 ? floor : ceil)(argument); }; var min = Math.min; // `ToLength` abstract operation // https://tc39.github.io/ecma262/#sec-tolength var toLength = function (argument) { return argument > 0 ? min(toInteger(argument), 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991 }; var max = 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(length, length). var toAbsoluteIndex = function (index, length) { var integer = toInteger(index); return integer < 0 ? max(integer + length, 0) : min$1(integer, length); }; // `Array.prototype.{ indexOf, includes }` methods implementation var createMethod = function (IS_INCLUDES) { return function ($this, el, fromIndex) { var O = toIndexedObject($this); var length = toLength(O.length); var index = toAbsoluteIndex(fromIndex, length); var value; // Array#includes uses SameValueZero equality algorithm // eslint-disable-next-line no-self-compare if (IS_INCLUDES && el != el) while (length > index) { value = O[index++]; // eslint-disable-next-line no-self-compare 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 = { // `Array.prototype.includes` method // https://tc39.github.io/ecma262/#sec-array.prototype.includes includes: createMethod(true), // `Array.prototype.indexOf` method // https://tc39.github.io/ecma262/#sec-array.prototype.indexof indexOf: createMethod(false) }; var hiddenKeys = {}; var indexOf = arrayIncludes.indexOf; var objectKeysInternal = function (object, names) { var O = toIndexedObject(object); var i = 0; var result = []; var key; for (key in O) !has(hiddenKeys, key) && has(O, key) && result.push(key); // Don't enum bug & hidden keys while (names.length > i) if (has(O, key = names[i++])) { ~indexOf(result, key) || result.push(key); } return result; }; // IE8- don't enum bug keys var enumBugKeys = [ 'constructor', 'hasOwnProperty', 'isPrototypeOf', 'propertyIsEnumerable', 'toLocaleString', 'toString', 'valueOf' ]; // `Object.keys` method // https://tc39.github.io/ecma262/#sec-object.keys var objectKeys = Object.keys || function keys(O) { return objectKeysInternal(O, enumBugKeys); }; // `Object.defineProperties` method // https://tc39.github.io/ecma262/#sec-object.defineproperties var objectDefineProperties = descriptors ? Object.defineProperties : function defineProperties(O, Properties) { anObject(O); var keys = objectKeys(Properties); var length = keys.length; var index = 0; var key; while (length > index) objectDefineProperty.f(O, key = keys[index++], Properties[key]); return O; }; // `Object.defineProperties` method // https://tc39.github.io/ecma262/#sec-object.defineproperties _export({ target: 'Object', stat: true, forced: !descriptors, sham: !descriptors }, { defineProperties: objectDefineProperties }); var defineProperties_1 = createCommonjsModule(function (module) { var Object = path.Object; var defineProperties = module.exports = function defineProperties(T, D) { return Object.defineProperties(T, D); }; if (Object.defineProperties.sham) defineProperties.sham = true; }); var defineProperties = defineProperties_1; var defineProperties$1 = defineProperties; var aFunction$1 = function (variable) { return typeof variable == 'function' ? variable : undefined; }; var getBuiltIn = function (namespace, method) { return arguments.length < 2 ? aFunction$1(path[namespace]) || aFunction$1(global_1[namespace]) : path[namespace] && path[namespace][method] || global_1[namespace] && global_1[namespace][method]; }; var hiddenKeys$1 = enumBugKeys.concat('length', 'prototype'); // `Object.getOwnPropertyNames` method // https://tc39.github.io/ecma262/#sec-object.getownpropertynames var f$3 = Object.getOwnPropertyNames || function getOwnPropertyNames(O) { return objectKeysInternal(O, hiddenKeys$1); }; var objectGetOwnPropertyNames = { f: f$3 }; var f$4 = Object.getOwnPropertySymbols; var objectGetOwnPropertySymbols = { f: f$4 }; // all object keys, includes non-enumerable and symbols var ownKeys = getBuiltIn('Reflect', 'ownKeys') || function ownKeys(it) { var keys = objectGetOwnPropertyNames.f(anObject(it)); var getOwnPropertySymbols = objectGetOwnPropertySymbols.f; return getOwnPropertySymbols ? keys.concat(getOwnPropertySymbols(it)) : keys; }; var createProperty = function (object, key, value) { var propertyKey = toPrimitive(key); if (propertyKey in object) objectDefineProperty.f(object, propertyKey, createPropertyDescriptor(0, value)); else object[propertyKey] = value; }; // `Object.getOwnPropertyDescriptors` method // https://tc39.github.io/ecma262/#sec-object.getownpropertydescriptors _export({ target: 'Object', stat: true, sham: !descriptors }, { getOwnPropertyDescriptors: function getOwnPropertyDescriptors(object) { var O = toIndexedObject(object); var getOwnPropertyDescriptor = objectGetOwnPropertyDescriptor.f; var keys = ownKeys(O); var result = {}; var index = 0; var key, descriptor; while (keys.length > index) { descriptor = getOwnPropertyDescriptor(O, key = keys[index++]); if (descriptor !== undefined) createProperty(result, key, descriptor); } return result; } }); var getOwnPropertyDescriptors = path.Object.getOwnPropertyDescriptors; var getOwnPropertyDescriptors$1 = getOwnPropertyDescriptors; var getOwnPropertyDescriptors$2 = getOwnPropertyDescriptors$1; var iterators = {}; var setGlobal = function (key, value) { try { hide(global_1, key, value); } catch (error) { global_1[key] = value; } return value; }; var shared = createCommonjsModule(function (module) { var SHARED = '__core-js_shared__'; var store = global_1[SHARED] || setGlobal(SHARED, {}); (module.exports = function (key, value) { return store[key] || (store[key] = value !== undefined ? value : {}); })('versions', []).push({ version: '3.2.1', mode: 'pure', copyright: '© 2019 Denis Pushkarev (zloirock.ru)' }); }); var functionToString = shared('native-function-to-string', Function.toString); var WeakMap = global_1.WeakMap; var nativeWeakMap = typeof WeakMap === 'function' && /native code/.test(functionToString.call(WeakMap)); var id = 0; var postfix = Math.random(); var uid = function (key) { return 'Symbol(' + String(key === undefined ? '' : key) + ')_' + (++id + postfix).toString(36); }; var keys = shared('keys'); var sharedKey = function (key) { return keys[key] || (keys[key] = uid(key)); }; var WeakMap$1 = global_1.WeakMap; var set, get, has$1; var enforce = function (it) { return has$1(it) ? get(it) : set(it, {}); }; var getterFor = function (TYPE) { return function (it) { var state; if (!isObject(it) || (state = get(it)).type !== TYPE) { throw TypeError('Incompatible receiver, ' + TYPE + ' required'); } return state; }; }; if (nativeWeakMap) { var store = new WeakMap$1(); var wmget = store.get; var wmhas = store.has; var wmset = store.set; set = function (it, metadata) { wmset.call(store, it, metadata); return metadata; }; get = function (it) { return wmget.call(store, it) || {}; }; has$1 = function (it) { return wmhas.call(store, it); }; } else { var STATE = sharedKey('state'); hiddenKeys[STATE] = true; set = function (it, metadata) { hide(it, STATE, metadata); return metadata; }; get = function (it) { return has(it, STATE) ? it[STATE] : {}; }; has$1 = function (it) { return has(it, STATE); }; } var internalState = { set: set, get: get, has: has$1, enforce: enforce, getterFor: getterFor }; // `ToObject` abstract operation // https://tc39.github.io/ecma262/#sec-toobject var toObject = function (argument) { return Object(requireObjectCoercible(argument)); }; var correctPrototypeGetter = !fails(function () { function F() { /* empty */ } F.prototype.constructor = null; return Object.getPrototypeOf(new F()) !== F.prototype; }); var IE_PROTO = sharedKey('IE_PROTO'); var ObjectPrototype = Object.prototype; // `Object.getPrototypeOf` method // https://tc39.github.io/ecma262/#sec-object.getprototypeof var objectGetPrototypeOf = correctPrototypeGetter ? Object.getPrototypeOf : function (O) { O = toObject(O); if (has(O, IE_PROTO)) return O[IE_PROTO]; if (typeof O.constructor == 'function' && O instanceof O.constructor) { return O.constructor.prototype; } return O instanceof Object ? ObjectPrototype : null; }; var nativeSymbol = !!Object.getOwnPropertySymbols && !fails(function () { // Chrome 38 Symbol has incorrect toString conversion // eslint-disable-next-line no-undef return !String(Symbol()); }); var Symbol$1 = global_1.Symbol; var store$1 = shared('wks'); var wellKnownSymbol = function (name) { return store$1[name] || (store$1[name] = nativeSymbol && Symbol$1[name] || (nativeSymbol ? Symbol$1 : uid)('Symbol.' + name)); }; var ITERATOR = wellKnownSymbol('iterator'); var BUGGY_SAFARI_ITERATORS = false; // `%IteratorPrototype%` object // https://tc39.github.io/ecma262/#sec-%iteratorprototype%-object var IteratorPrototype, PrototypeOfArrayIteratorPrototype, arrayIterator; if ([].keys) { arrayIterator = [].keys(); // Safari 8 has buggy iterators w/o `next` if (!('next' in arrayIterator)) BUGGY_SAFARI_ITERATORS = true; else { PrototypeOfArrayIteratorPrototype = objectGetPrototypeOf(objectGetPrototypeOf(arrayIterator)); if (PrototypeOfArrayIteratorPrototype !== Object.prototype) IteratorPrototype = PrototypeOfArrayIteratorPrototype; } } if (IteratorPrototype == undefined) IteratorPrototype = {}; var iteratorsCore = { IteratorPrototype: IteratorPrototype, BUGGY_SAFARI_ITERATORS: BUGGY_SAFARI_ITERATORS }; var html = getBuiltIn('document', 'documentElement'); var IE_PROTO$1 = sharedKey('IE_PROTO'); var PROTOTYPE = 'prototype'; var Empty = function () { /* empty */ }; // Create object with fake `null` prototype: use iframe Object with cleared prototype var createDict = function () { // Thrash, waste and sodomy: IE GC bug var iframe = documentCreateElement('iframe'); var length = enumBugKeys.length; var lt = '<'; var script = 'script'; var gt = '>'; var js = 'java' + script + ':'; var iframeDocument; iframe.style.display = 'none'; html.appendChild(iframe); iframe.src = String(js); iframeDocument = iframe.contentWindow.document; iframeDocument.open(); iframeDocument.write(lt + script + gt + 'document.F=Object' + lt + '/' + script + gt); iframeDocument.close(); createDict = iframeDocument.F; while (length--) delete createDict[PROTOTYPE][enumBugKeys[length]]; return createDict(); }; // `Object.create` method // https://tc39.github.io/ecma262/#sec-object.create var objectCreate = Object.create || function create(O, Properties) { var result; if (O !== null) { Empty[PROTOTYPE] = anObject(O); result = new Empty(); Empty[PROTOTYPE] = null; // add "__proto__" for Object.getPrototypeOf polyfill result[IE_PROTO$1] = O; } else result = createDict(); return Properties === undefined ? result : objectDefineProperties(result, Properties); }; hiddenKeys[IE_PROTO$1] = true; var TO_STRING_TAG = wellKnownSymbol('toStringTag'); // ES3 wrong here var CORRECT_ARGUMENTS = classofRaw(function () { return arguments; }()) == 'Arguments'; // fallback for IE11 Script Access Denied error var tryGet = function (it, key) { try { return it[key]; } catch (error) { /* empty */ } }; // getting tag from ES6+ `Object.prototype.toString` var classof = function (it) { var O, tag, result; return it === undefined ? 'Undefined' : it === null ? 'Null' // @@toStringTag case : typeof (tag = tryGet(O = Object(it), TO_STRING_TAG)) == 'string' ? tag // builtinTag case : CORRECT_ARGUMENTS ? classofRaw(O) // ES3 arguments fallback : (result = classofRaw(O)) == 'Object' && typeof O.callee == 'function' ? 'Arguments' : result; }; var TO_STRING_TAG$1 = wellKnownSymbol('toStringTag'); var test = {}; test[TO_STRING_TAG$1] = 'z'; // `Object.prototype.toString` method implementation // https://tc39.github.io/ecma262/#sec-object.prototype.tostring var objectToString = String(test) !== '[object z]' ? function toString() { return '[object ' + classof(this) + ']'; } : test.toString; var defineProperty$2 = objectDefineProperty.f; var TO_STRING_TAG$2 = wellKnownSymbol('toStringTag'); var METHOD_REQUIRED = objectToString !== ({}).toString; var setToStringTag = function (it, TAG, STATIC, SET_METHOD) { if (it) { var target = STATIC ? it : it.prototype; if (!has(target, TO_STRING_TAG$2)) { defineProperty$2(target, TO_STRING_TAG$2, { configurable: true, value: TAG }); } if (SET_METHOD && METHOD_REQUIRED) hide(target, 'toString', objectToString); } }; var IteratorPrototype$1 = iteratorsCore.IteratorPrototype; var returnThis = function () { return this; }; var createIteratorConstructor = function (IteratorConstructor, NAME, next) { var TO_STRING_TAG = NAME + ' Iterator'; IteratorConstructor.prototype = objectCreate(IteratorPrototype$1, { next: createPropertyDescriptor(1, next) }); setToStringTag(IteratorConstructor, TO_STRING_TAG, false, true); iterators[TO_STRING_TAG] = returnThis; return IteratorConstructor; }; var aPossiblePrototype = function (it) { if (!isObject(it) && it !== null) { throw TypeError("Can't set " + String(it) + ' as a prototype'); } return it; }; // `Object.setPrototypeOf` method // https://tc39.github.io/ecma262/#sec-object.setprototypeof // Works with __proto__ only. Old v8 can't work with null proto objects. /* eslint-disable no-proto */ var objectSetPrototypeOf = Object.setPrototypeOf || ('__proto__' in {} ? function () { var CORRECT_SETTER = false; var test = {}; var setter; try { setter = Object.getOwnPropertyDescriptor(Object.prototype, '__proto__').set; setter.call(test, []); CORRECT_SETTER = test instanceof Array; } catch (error) { /* empty */ } return function setPrototypeOf(O, proto) { anObject(O); aPossiblePrototype(proto); if (CORRECT_SETTER) setter.call(O, proto); else O.__proto__ = proto; return O; }; }() : undefined); var redefine = function (target, key, value, options) { if (options && options.enumerable) target[key] = value; else hide(target, key, value); }; var IteratorPrototype$2 = iteratorsCore.IteratorPrototype; var BUGGY_SAFARI_ITERATORS$1 = iteratorsCore.BUGGY_SAFARI_ITERATORS; var ITERATOR$1 = wellKnownSymbol('iterator'); var KEYS = 'keys'; var VALUES = 'values'; var ENTRIES = 'entries'; var returnThis$1 = function () { return this; }; var defineIterator = function (Iterable, NAME, IteratorConstructor, next, DEFAULT, IS_SET, FORCED) { createIteratorConstructor(IteratorConstructor, NAME, next); var getIterationMethod = function (KIND) { if (KIND === DEFAULT && defaultIterator) return defaultIterator; if (!BUGGY_SAFARI_ITERATORS$1 && KIND in IterablePrototype) return IterablePrototype[KIND]; switch (KIND) { case KEYS: return function keys() { return new IteratorConstructor(this, KIND); }; case VALUES: return function values() { return new IteratorConstructor(this, KIND); }; case ENTRIES: return function entries() { return new IteratorConstructor(this, KIND); }; } return function () { return new IteratorConstructor(this); }; }; var TO_STRING_TAG = NAME + ' Iterator'; var INCORRECT_VALUES_NAME = false; var IterablePrototype = Iterable.prototype; var nativeIterator = IterablePrototype[ITERATOR$1] || IterablePrototype['@@iterator'] || DEFAULT && IterablePrototype[DEFAULT]; var defaultIterator = !BUGGY_SAFARI_ITERATORS$1 && nativeIterator || getIterationMethod(DEFAULT); var anyNativeIterator = NAME == 'Array' ? IterablePrototype.entries || nativeIterator : nativeIterator; var CurrentIteratorPrototype, methods, KEY; // fix native if (anyNativeIterator) { CurrentIteratorPrototype = objectGetPrototypeOf(anyNativeIterator.call(new Iterable())); if (IteratorPrototype$2 !== Object.prototype && CurrentIteratorPrototype.next) { // Set @@toStringTag to native iterators setToStringTag(CurrentIteratorPrototype, TO_STRING_TAG, true, true); iterators[TO_STRING_TAG] = returnThis$1; } } // fix Array#{values, @@iterator}.name in V8 / FF if (DEFAULT == VALUES && nativeIterator && nativeIterator.name !== VALUES) { INCORRECT_VALUES_NAME = true; defaultIterator = function values() { return nativeIterator.call(this); }; } // define iterator if ((FORCED) && IterablePrototype[ITERATOR$1] !== defaultIterator) { hide(IterablePrototype, ITERATOR$1, defaultIterator); } iterators[NAME] = defaultIterator; // export additional methods if (DEFAULT) { methods = { values: getIterationMethod(VALUES), keys: IS_SET ? defaultIterator : getIterationMethod(KEYS), entries: getIterationMethod(ENTRIES) }; if (FORCED) for (KEY in methods) { if (BUGGY_SAFARI_ITERATORS$1 || INCORRECT_VALUES_NAME || !(KEY in IterablePrototype)) { redefine(IterablePrototype, KEY, methods[KEY]); } } else _export({ target: NAME, proto: true, forced: BUGGY_SAFARI_ITERATORS$1 || INCORRECT_VALUES_NAME }, methods); } return methods; }; var ARRAY_ITERATOR = 'Array Iterator'; var setInternalState = internalState.set; var getInternalState = internalState.getterFor(ARRAY_ITERATOR); // `Array.prototype.entries` method // https://tc39.github.io/ecma262/#sec-array.prototype.entries // `Array.prototype.keys` method // https://tc39.github.io/ecma262/#sec-array.prototype.keys // `Array.prototype.values` method // https://tc39.github.io/ecma262/#sec-array.prototype.values // `Array.prototype[@@iterator]` method // https://tc39.github.io/ecma262/#sec-array.prototype-@@iterator // `CreateArrayIterator` internal method // https://tc39.github.io/ecma262/#sec-createarrayiterator var es_array_iterator = defineIterator(Array, 'Array', function (iterated, kind) { setInternalState(this, { type: ARRAY_ITERATOR, target: toIndexedObject(iterated), // target index: 0, // next index kind: kind // kind }); // `%ArrayIteratorPrototype%.next` method // https://tc39.github.io/ecma262/#sec-%arrayiteratorprototype%.next }, function () { var state = getInternalState(this); var target = state.target; var kind = state.kind; var index = state.index++; if (!target || index >= target.length) { state.target = undefined; return { value: undefined, done: true }; } if (kind == 'keys') return { value: index, done: false }; if (kind == 'values') return { value: target[index], done: false }; return { value: [index, target[index]], done: false }; }, 'values'); // argumentsList[@@iterator] is %ArrayProto_values% // https://tc39.github.io/ecma262/#sec-createunmappedargumentsobject // https://tc39.github.io/ecma262/#sec-createmappedargumentsobject iterators.Arguments = iterators.Array; // iterable DOM collections // flag - `iterable` interface - 'entries', 'keys', 'values', 'forEach' methods var domIterables = { CSSRuleList: 0, CSSStyleDeclaration: 0, CSSValueList: 0, ClientRectList: 0, DOMRectList: 0, DOMStringList: 0, DOMTokenList: 1, DataTransferItemList: 0, FileList: 0, HTMLAllCollection: 0, HTMLCollection: 0, HTMLFormElement: 0, HTMLSelectElement: 0, MediaList: 0, MimeTypeArray: 0, NamedNodeMap: 0, NodeList: 1, PaintRequestList: 0, Plugin: 0, PluginArray: 0, SVGLengthList: 0, SVGNumberList: 0, SVGPathSegList: 0, SVGPointList: 0, SVGStringList: 0, SVGTransformList: 0, SourceBufferList: 0, StyleSheetList: 0, TextTrackCueList: 0, TextTrackList: 0, TouchList: 0 }; var TO_STRING_TAG$3 = wellKnownSymbol('toStringTag'); for (var COLLECTION_NAME in domIterables) { var Collection = global_1[COLLECTION_NAME]; var CollectionPrototype = Collection && Collection.prototype; if (CollectionPrototype && !CollectionPrototype[TO_STRING_TAG$3]) { hide(CollectionPrototype, TO_STRING_TAG$3, COLLECTION_NAME); } iterators[COLLECTION_NAME] = iterators.Array; } // `IsArray` abstract operation // https://tc39.github.io/ecma262/#sec-isarray var isArray = Array.isArray || function isArray(arg) { return classofRaw(arg) == 'Array'; }; var SPECIES = wellKnownSymbol('species'); // `ArraySpeciesCreate` abstract operation // https://tc39.github.io/ecma262/#sec-arrayspeciescreate var arraySpeciesCreate = function (originalArray, length) { var C; if (isArray(originalArray)) { C = originalArray.constructor; // cross-realm fallback if (typeof C == 'function' && (C === Array || isArray(C.prototype))) C = undefined; else if (isObject(C)) { C = C[SPECIES]; if (C === null) C = undefined; } } return new (C === undefined ? Array : C)(length === 0 ? 0 : length); }; var push = [].push; // `Array.prototype.{ forEach, map, filter, some, every, find, findIndex }` methods implementation var createMethod$1 = function (TYPE) { var IS_MAP = TYPE == 1; var IS_FILTER = TYPE == 2; var IS_SOME = TYPE == 3; var IS_EVERY = TYPE == 4; var IS_FIND_INDEX = TYPE == 6; var NO_HOLES = TYPE == 5 || IS_FIND_INDEX; return function ($this, callbackfn, that, specificCreate) { var O = toObject($this); var self = indexedObject(O); var boundFunction = bindContext(callbackfn, that, 3); var length = toLength(self.length); var index = 0; var create = specificCreate || arraySpeciesCreate; var target = IS_MAP ? create($this, length) : IS_FILTER ? create($this, 0) : undefined; var value, result; for (;length > index; index++) if (NO_HOLES || index in self) { value = self[index]; result = boundFunction(value, index, O); if (TYPE) { if (IS_MAP) target[index] = result; // map else if (result) switch (TYPE) { case 3: return true; // some case 5: return value; // find case 6: return index; // findIndex case 2: push.call(target, value); // filter } else if (IS_EVERY) return false; // every } } return IS_FIND_INDEX ? -1 : IS_SOME || IS_EVERY ? IS_EVERY : target; }; }; var arrayIteration = { // `Array.prototype.forEach` method // https://tc39.github.io/ecma262/#sec-array.prototype.foreach forEach: createMethod$1(0), // `Array.prototype.map` method // https://tc39.github.io/ecma262/#sec-array.prototype.map map: createMethod$1(1), // `Array.prototype.filter` method // https://tc39.github.io/ecma262/#sec-array.prototype.filter filter: createMethod$1(2), // `Array.prototype.some` method // https://tc39.github.io/ecma262/#sec-array.prototype.some some: createMethod$1(3), // `Array.prototype.every` method // https://tc39.github.io/ecma262/#sec-array.prototype.every every: createMethod$1(4), // `Array.prototype.find` method // https://tc39.github.io/ecma262/#sec-array.prototype.find find: createMethod$1(5), // `Array.prototype.findIndex` method // https://tc39.github.io/ecma262/#sec-array.prototype.findIndex findIndex: createMethod$1(6) }; var sloppyArrayMethod = function (METHOD_NAME, argument) { var method = [][METHOD_NAME]; return !method || !fails(function () { // eslint-disable-next-line no-useless-call,no-throw-literal method.call(null, argument || function () { throw 1; }, 1); }); }; var $forEach = arrayIteration.forEach; // `Array.prototype.forEach` method implementation // https://tc39.github.io/ecma262/#sec-array.prototype.foreach var arrayForEach = sloppyArrayMethod('forEach') ? function forEach(callbackfn /* , thisArg */) { return $forEach(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined); } : [].forEach; // `Array.prototype.forEach` method // https://tc39.github.io/ecma262/#sec-array.prototype.foreach _export({ target: 'Array', proto: true, forced: [].forEach != arrayForEach }, { forEach: arrayForEach }); var entryVirtual = function (CONSTRUCTOR) { return path[CONSTRUCTOR + 'Prototype']; }; var forEach = entryVirtual('Array').forEach; var forEach$1 = forEach; var ArrayPrototype = Array.prototype; var DOMIterables = { DOMTokenList: true, NodeList: true }; var forEach_1 = function (it) { var own = it.forEach; return it === ArrayPrototype || (it instanceof Array && own === ArrayPrototype.forEach) // eslint-disable-next-line no-prototype-builtins || DOMIterables.hasOwnProperty(classof(it)) ? forEach$1 : own; }; var forEach$2 = forEach_1; var nativeGetOwnPropertyDescriptor$1 = objectGetOwnPropertyDescriptor.f; var FAILS_ON_PRIMITIVES = fails(function () { nativeGetOwnPropertyDescriptor$1(1); }); var FORCED = !descriptors || FAILS_ON_PRIMITIVES; // `Object.getOwnPropertyDescriptor` method // https://tc39.github.io/ecma262/#sec-object.getownpropertydescriptor _export({ target: 'Object', stat: true, forced: FORCED, sham: !descriptors }, { getOwnPropertyDescriptor: function getOwnPropertyDescriptor(it, key) { return nativeGetOwnPropertyDescriptor$1(toIndexedObject(it), key); } }); var getOwnPropertyDescriptor_1 = createCommonjsModule(function (module) { var Object = path.Object; var getOwnPropertyDescriptor = module.exports = function getOwnPropertyDescriptor(it, key) { return Object.getOwnPropertyDescriptor(it, key); }; if (Object.getOwnPropertyDescriptor.sham) getOwnPropertyDescriptor.sham = true; }); var getOwnPropertyDescriptor$2 = getOwnPropertyDescriptor_1; var getOwnPropertyDescriptor$3 = getOwnPropertyDescriptor$2; var SPECIES$1 = wellKnownSymbol('species'); var arrayMethodHasSpeciesSupport = function (METHOD_NAME) { return !fails(function () { var array = []; var constructor = array.constructor = {}; constructor[SPECIES$1] = function () { return { foo: 1 }; }; return array[METHOD_NAME](Boolean).foo !== 1; }); }; var $filter = arrayIteration.filter; // `Array.prototype.filter` method // https://tc39.github.io/ecma262/#sec-array.prototype.filter // with adding support of @@species _export({ target: 'Array', proto: true, forced: !arrayMethodHasSpeciesSupport('filter') }, { filter: function filter(callbackfn /* , thisArg */) { return $filter(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined); } }); var filter = entryVirtual('Array').filter; var ArrayPrototype$1 = Array.prototype; var filter_1 = function (it) { var own = it.filter; return it === ArrayPrototype$1 || (it instanceof Array && own === ArrayPrototype$1.filter) ? filter : own; }; var filter$1 = filter_1; var filter$2 = filter$1; var nativeGetOwnPropertyNames = objectGetOwnPropertyNames.f; var toString$1 = {}.toString; var windowNames = typeof window == 'object' && window && Object.getOwnPropertyNames ? Object.getOwnPropertyNames(window) : []; var getWindowNames = function (it) { try { return nativeGetOwnPropertyNames(it); } catch (error) { return windowNames.slice(); } }; // fallback for IE11 buggy Object.getOwnPropertyNames with iframe and window var f$5 = function getOwnPropertyNames(it) { return windowNames && toString$1.call(it) == '[object Window]' ? getWindowNames(it) : nativeGetOwnPropertyNames(toIndexedObject(it)); }; var objectGetOwnPropertyNamesExternal = { f: f$5 }; var f$6 = wellKnownSymbol; var wrappedWellKnownSymbol = { f: f$6 }; var defineProperty$3 = objectDefineProperty.f; var defineWellKnownSymbol = function (NAME) { var Symbol = path.Symbol || (path.Symbol = {}); if (!has(Symbol, NAME)) defineProperty$3(Symbol, NAME, { value: wrappedWellKnownSymbol.f(NAME) }); }; var $forEach$1 = arrayIteration.forEach; var HIDDEN = sharedKey('hidden'); var SYMBOL = 'Symbol'; var PROTOTYPE$1 = 'prototype'; var TO_PRIMITIVE = wellKnownSymbol('toPrimitive'); var setInternalState$1 = internalState.set; var getInternalState$1 = internalState.getterFor(SYMBOL); var ObjectPrototype$1 = Object[PROTOTYPE$1]; var $Symbol = global_1.Symbol; var JSON$1 = global_1.JSON; var nativeJSONStringify = JSON$1 && JSON$1.stringify; var nativeGetOwnPropertyDescriptor$2 = objectGetOwnPropertyDescriptor.f; var nativeDefineProperty$1 = objectDefineProperty.f; var nativeGetOwnPropertyNames$1 = objectGetOwnPropertyNamesExternal.f; var nativePropertyIsEnumerable$1 = objectPropertyIsEnumerable.f; var AllSymbols = shared('symbols'); var ObjectPrototypeSymbols = shared('op-symbols'); var StringToSymbolRegistry = shared('string-to-symbol-registry'); var SymbolToStringRegistry = shared('symbol-to-string-registry'); var WellKnownSymbolsStore = shared('wks'); var QObject = global_1.QObject; // Don't use setters in Qt Script, https://github.com/zloirock/core-js/issues/173 var USE_SETTER = !QObject || !QObject[PROTOTYPE$1] || !QObject[PROTOTYPE$1].findChild; // fallback for old Android, https://code.google.com/p/v8/issues/detail?id=687 var setSymbolDescriptor = descriptors && fails(function () { return objectCreate(nativeDefineProperty$1({}, 'a', { get: function () { return nativeDefineProperty$1(this, 'a', { value: 7 }).a; } })).a != 7; }) ? function (O, P, Attributes) { var ObjectPrototypeDescriptor = nativeGetOwnPropertyDescriptor$2(ObjectPrototype$1, P); if (ObjectPrototypeDescriptor) delete ObjectPrototype$1[P]; nativeDefineProperty$1(O, P, Attributes); if (ObjectPrototypeDescriptor && O !== ObjectPrototype$1) { nativeDefineProperty$1(ObjectPrototype$1, P, ObjectPrototypeDescriptor); } } : nativeDefineProperty$1; var wrap = function (tag, description) { var symbol = AllSymbols[tag] = objectCreate($Symbol[PROTOTYPE$1]); setInternalState$1(symbol, { type: SYMBOL, tag: tag, description: description }); if (!descriptors) symbol.description = description; return symbol; }; var isSymbol = nativeSymbol && typeof $Symbol.iterator == 'symbol' ? function (it) { return typeof it == 'symbol'; } : function (it) { return Object(it) instanceof $Symbol; }; var $defineProperty = function defineProperty(O, P, Attributes) { if (O === ObjectPrototype$1) $defineProperty(ObjectPrototypeSymbols, P, Attributes); anObject(O); var key = toPrimitive(P, true); anObject(Attributes); if (has(AllSymbols, key)) { if (!Attributes.enumerable) { if (!has(O, HIDDEN)) nativeDefineProperty$1(O, HIDDEN, createPropertyDescriptor(1, {})); O[HIDDEN][key] = true; } else { if (has(O, HIDDEN) && O[HIDDEN][key]) O[HIDDEN][key] = false; Attributes = objectCreate(Attributes, { enumerable: createPropertyDescriptor(0, false) }); } return setSymbolDescriptor(O, key, Attributes); } return nativeDefineProperty$1(O, key, Attributes); }; var $defineProperties = function defineProperties(O, Properties) { anObject(O); var properties = toIndexedObject(Properties); var keys = objectKeys(properties).concat($getOwnPropertySymbols(properties)); $forEach$1(keys, function (key) { if (!descriptors || $propertyIsEnumerable.call(properties, key)) $defineProperty(O, key, properties[key]); }); return O; }; var $create = function create(O, Properties) { return Properties === undefined ? objectCreate(O) : $defineProperties(objectCreate(O), Properties); }; var $propertyIsEnumerable = function propertyIsEnumerable(V) { var P = toPrimitive(V, true); var enumerable = nativePropertyIsEnumerable$1.call(this, P); if (this === ObjectPrototype$1 && has(AllSymbols, P) && !has(ObjectPrototypeSymbols, P)) return false; return enumerable || !has(this, P) || !has(AllSymbols, P) || has(this, HIDDEN) && this[HIDDEN][P] ? enumerable : true; }; var $getOwnPropertyDescriptor = function getOwnPropertyDescriptor(O, P) { var it = toIndexedObject(O); var key = toPrimitive(P, true); if (it === ObjectPrototype$1 && has(AllSymbols, key) && !has(ObjectPrototypeSymbols, key)) return; var descriptor = nativeGetOwnPropertyDescriptor$2(it, key); if (descriptor && has(AllSymbols, key) && !(has(it, HIDDEN) && it[HIDDEN][key])) { descriptor.enumerable = true; } return descriptor; }; var $getOwnPropertyNames = function getOwnPropertyNames(O) { var names = nativeGetOwnPropertyNames$1(toIndexedObject(O)); var result = []; $forEach$1(names, function (key) { if (!has(AllSymbols, key) && !has(hiddenKeys, key)) result.push(key); }); return result; }; var $getOwnPropertySymbols = function getOwnPropertySymbols(O) { var IS_OBJECT_PROTOTYPE = O === ObjectPrototype$1; var names = nativeGetOwnPropertyNames$1(IS_OBJECT_PROTOTYPE ? ObjectPrototypeSymbols : toIndexedObject(O)); var result = []; $forEach$1(names, function (key) { if (has(AllSymbols, key) && (!IS_OBJECT_PROTOTYPE || has(ObjectPrototype$1, key))) { result.push(AllSymbols[key]); } }); return result; }; // `Symbol` constructor // https://tc39.github.io/ecma262/#sec-symbol-constructor if (!nativeSymbol) { $Symbol = function Symbol() { if (this instanceof $Symbol) throw TypeError('Symbol is not a constructor'); var description = !arguments.length || arguments[0] === undefined ? undefined : String(arguments[0]); var tag = uid(description); var setter = function (value) { if (this === ObjectPrototype$1) setter.call(ObjectPrototypeSymbols, value); if (has(this, HIDDEN) && has(this[HIDDEN], tag)) this[HIDDEN][tag] = false; setSymbolDescriptor(this, tag, createPropertyDescriptor(1, value)); }; if (descriptors && USE_SETTER) setSymbolDescriptor(ObjectPrototype$1, tag, { configurable: true, set: setter }); return wrap(tag, description); }; redefine($Symbol[PROTOTYPE$1], 'toString', function toString() { return getInternalState$1(this).tag; }); objectPropertyIsEnumerable.f = $propertyIsEnumerable; objectDefineProperty.f = $defineProperty; objectGetOwnPropertyDescriptor.f = $getOwnPropertyDescriptor; objectGetOwnPropertyNames.f = objectGetOwnPropertyNamesExternal.f = $getOwnPropertyNames; objectGetOwnPropertySymbols.f = $getOwnPropertySymbols; if (descriptors) { // https://github.com/tc39/proposal-Symbol-description nativeDefineProperty$1($Symbol[PROTOTYPE$1], 'description', { configurable: true, get: function description() { return getInternalState$1(this).description; } }); } wrappedWellKnownSymbol.f = function (name) { return wrap(wellKnownSymbol(name), name); }; } _export({ global: true, wrap: true, forced: !nativeSymbol, sham: !nativeSymbol }, { Symbol: $Symbol }); $forEach$1(objectKeys(WellKnownSymbolsStore), function (name) { defineWellKnownSymbol(name); }); _export({ target: SYMBOL, stat: true, forced: !nativeSymbol }, { // `Symbol.for` method // https://tc39.github.io/ecma262/#sec-symbol.for 'for': function (key) { var string = String(key); if (has(StringToSymbolRegistry, string)) return StringToSymbolRegistry[string]; var symbol = $Symbol(string); StringToSymbolRegistry[string] = symbol; SymbolToStringRegistry[symbol] = string; return symbol; }, // `Symbol.keyFor` method // https://tc39.github.io/ecma262/#sec-symbol.keyfor keyFor: function keyFor(sym) { if (!isSymbol(sym)) throw TypeError(sym + ' is not a symbol'); if (has(SymbolToStringRegistry, sym)) return SymbolToStringRegistry[sym]; }, useSetter: function () { USE_SETTER = true; }, useSimple: function () { USE_SETTER = false; } }); _export({ target: 'Object', stat: true, forced: !nativeSymbol, sham: !descriptors }, { // `Object.create` method // https://tc39.github.io/ecma262/#sec-object.create create: $create, // `Object.defineProperty` method // https://tc39.github.io/ecma262/#sec-object.defineproperty defineProperty: $defineProperty, // `Object.defineProperties` method // https://tc39.github.io/ecma262/#sec-object.defineproperties defineProperties: $defineProperties, // `Object.getOwnPropertyDescriptor` method // https://tc39.github.io/ecma262/#sec-object.getownpropertydescriptors getOwnPropertyDescriptor: $getOwnPropertyDescriptor }); _export({ target: 'Object', stat: true, forced: !nativeSymbol }, { // `Object.getOwnPropertyNames` method // https://tc39.github.io/ecma262/#sec-object.getownpropertynames getOwnPropertyNames: $getOwnPropertyNames, // `Object.getOwnPropertySymbols` method // https://tc39.github.io/ecma262/#sec-object.getownpropertysymbols getOwnPropertySymbols: $getOwnPropertySymbols }); // Chrome 38 and 39 `Object.getOwnPropertySymbols` fails on primitives // https://bugs.chromium.org/p/v8/issues/detail?id=3443 _export({ target: 'Object', stat: true, forced: fails(function () { objectGetOwnPropertySymbols.f(1); }) }, { getOwnPropertySymbols: function getOwnPropertySymbols(it) { return objectGetOwnPropertySymbols.f(toObject(it)); } }); // `JSON.stringify` method behavior with symbols // https://tc39.github.io/ecma262/#sec-json.stringify JSON$1 && _export({ target: 'JSON', stat: true, forced: !nativeSymbol || fails(function () { var symbol = $Symbol(); // MS Edge converts symbol values to JSON as {} return nativeJSONStringify([symbol]) != '[null]' // WebKit converts symbol values to JSON as null || nativeJSONStringify({ a: symbol }) != '{}' // V8 throws on boxed symbols || nativeJSONStringify(Object(symbol)) != '{}'; }) }, { stringify: function stringify(it) { var args = [it]; var index = 1; var replacer, $replacer; while (arguments.length > index) args.push(arguments[index++]); $replacer = replacer = args[1]; if (!isObject(replacer) && it === undefined || isSymbol(it)) return; // IE8 returns string on undefined if (!isArray(replacer)) replacer = function (key, value) { if (typeof $replacer == 'function') value = $replacer.call(this, key, value); if (!isSymbol(value)) return value; }; args[1] = replacer; return nativeJSONStringify.apply(JSON$1, args); } }); // `Symbol.prototype[@@toPrimitive]` method // https://tc39.github.io/ecma262/#sec-symbol.prototype-@@toprimitive if (!$Symbol[PROTOTYPE$1][TO_PRIMITIVE]) hide($Symbol[PROTOTYPE$1], TO_PRIMITIVE, $Symbol[PROTOTYPE$1].valueOf); // `Symbol.prototype[@@toStringTag]` property // https://tc39.github.io/ecma262/#sec-symbol.prototype-@@tostringtag setToStringTag($Symbol, SYMBOL); hiddenKeys[HIDDEN] = true; var getOwnPropertySymbols = path.Object.getOwnPropertySymbols; var getOwnPropertySymbols$1 = getOwnPropertySymbols; var getOwnPropertySymbols$2 = getOwnPropertySymbols$1; var FAILS_ON_PRIMITIVES$1 = fails(function () { objectKeys(1); }); // `Object.keys` method // https://tc39.github.io/ecma262/#sec-object.keys _export({ target: 'Object', stat: true, forced: FAILS_ON_PRIMITIVES$1 }, { keys: function keys(it) { return objectKeys(toObject(it)); } }); var keys$1 = path.Object.keys; var keys$2 = keys$1; var keys$3 = keys$2; var defineProperty$4 = defineProperty_1; var defineProperty$5 = defineProperty$4; function _defineProperty(obj, key, value) { if (key in obj) { defineProperty$5(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } var defineProperty$6 = _defineProperty; var userAgent = getBuiltIn('navigator', 'userAgent') || ''; var slice = [].slice; var MSIE = /MSIE .\./.test(userAgent); // <- dirty ie9- check var wrap$1 = function (scheduler) { return function (handler, timeout /* , ...arguments */) { var boundArgs = arguments.length > 2; var args = boundArgs ? slice.call(arguments, 2) : undefined; return scheduler(boundArgs ? function () { // eslint-disable-next-line no-new-func (typeof handler == 'function' ? handler : Function(handler)).apply(this, args); } : handler, timeout); }; }; // ie9- setTimeout & setInterval additional parameters fix // https://html.spec.whatwg.org/multipage/timers-and-user-prompts.html#timers _export({ global: true, bind: true, forced: MSIE }, { // `setTimeout` method // https://html.spec.whatwg.org/multipage/timers-and-user-prompts.html#dom-settimeout setTimeout: wrap$1(global_1.setTimeout), // `setInterval` method // https://html.spec.whatwg.org/multipage/timers-and-user-prompts.html#dom-setinterval setInterval: wrap$1(global_1.setInterval) }); var setTimeout$1 = path.setTimeout; var setTimeout$2 = setTimeout$1; var slice$1 = [].slice; var factories = {}; var construct = 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 factories[argsLength] = Function('C,a', 'return new C(' + list.join(',') + ')'); } return factories[argsLength](C, args); }; // `Function.prototype.bind` method implementation // https://tc39.github.io/ecma262/#sec-function.prototype.bind var functionBind = Function.bind || function bind(that /* , ...args */) { var fn = aFunction(this); var partArgs = slice$1.call(arguments, 1); var boundFunction = function bound(/* args... */) { var args = partArgs.concat(slice$1.call(arguments)); return this instanceof boundFunction ? construct(fn, args.length, args) : fn.apply(that, args); }; if (isObject(fn.prototype)) boundFunction.prototype = fn.prototype; return boundFunction; }; // `Function.prototype.bind` method // https://tc39.github.io/ecma262/#sec-function.prototype.bind _export({ target: 'Function', proto: true }, { bind: functionBind }); var bind = entryVirtual('Function').bind; var FunctionPrototype = Function.prototype; var bind_1 = function (it) { var own = it.bind; return it === FunctionPrototype || (it instanceof Function && own === FunctionPrototype.bind) ? bind : own; }; var bind$1 = bind_1; var bind$2 = bind$1; var SPECIES$2 = wellKnownSymbol('species'); var nativeSlice = [].slice; var max$1 = Math.max; // `Array.prototype.slice` method // https://tc39.github.io/ecma262/#sec-array.prototype.slice // fallback for not array-like ES3 strings and DOM objects _export({ target: 'Array', proto: true, forced: !arrayMethodHasSpeciesSupport('slice') }, { slice: function slice(start, end) { var O = toIndexedObject(this); var length = toLength(O.length); var k = toAbsoluteIndex(start, length); var fin = toAbsoluteIndex(end === undefined ? length : end, length); // inline `ArraySpeciesCreate` for usage native `Array#slice` where it's possible var Constructor, result, n; if (isArray(O)) { Constructor = O.constructor; // cross-realm fallback if (typeof Constructor == 'function' && (Constructor === Array || isArray(Constructor.prototype))) { Constructor = undefined; } else if (isObject(Constructor)) { Constructor = Constructor[SPECIES$2]; if (Constructor === null) Constructor = undefined; } if (Constructor === Array || Constructor === undefined) { return nativeSlice.call(O, k, fin); } } result = new (Constructor === undefined ? Array : Constructor)(max$1(fin - k, 0)); for (n = 0; k < fin; k++, n++) if (k in O) createProperty(result, n, O[k]); result.length = n; return result; } }); var slice$2 = entryVirtual('Array').slice; var ArrayPrototype$2 = Array.prototype; var slice_1 = function (it) { var own = it.slice; return it === ArrayPrototype$2 || (it instanceof Array && own === ArrayPrototype$2.slice) ? slice$2 : own; }; var slice$3 = slice_1; var slice$4 = slice$3; // a string of all valid unicode whitespaces // eslint-disable-next-line max-len var whitespaces = '\u0009\u000A\u000B\u000C\u000D\u0020\u00A0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF'; var whitespace = '[' + whitespaces + ']'; var ltrim = RegExp('^' + whitespace + whitespace + '*'); var rtrim = RegExp(whitespace + whitespace + '*$'); // `String.prototype.{ trim, trimStart, trimEnd, trimLeft, trimRight }` methods implementation var createMethod$2 = function (TYPE) { return function ($this) { var string = String(requireObjectCoercible($this)); if (TYPE & 1) string = string.replace(ltrim, ''); if (TYPE & 2) string = string.replace(rtrim, ''); return string; }; }; var stringTrim = { // `String.prototype.{ trimLeft, trimStart }` methods // https://tc39.github.io/ecma262/#sec-string.prototype.trimstart start: createMethod$2(1), // `String.prototype.{ trimRight, trimEnd }` methods // https://tc39.github.io/ecma262/#sec-string.prototype.trimend end: createMethod$2(2), // `String.prototype.trim` method // https://tc39.github.io/ecma262/#sec-string.prototype.trim trim: createMethod$2(3) }; var trim = stringTrim.trim; var nativeParseInt = global_1.parseInt; var hex = /^[+-]?0[Xx]/; var FORCED$1 = nativeParseInt(whitespaces + '08') !== 8 || nativeParseInt(whitespaces + '0x16') !== 22; // `parseInt` method // https://tc39.github.io/ecma262/#sec-parseint-string-radix var _parseInt = FORCED$1 ? function parseInt(string, radix) { var S = trim(String(string)); return nativeParseInt(S, (radix >>> 0) || (hex.test(S) ? 16 : 10)); } : nativeParseInt; // `parseInt` method // https://tc39.github.io/ecma262/#sec-parseint-string-radix _export({ global: true, forced: parseInt != _parseInt }, { parseInt: _parseInt }); var _parseInt$1 = path.parseInt; var _parseInt$2 = _parseInt$1; var _parseInt$3 = _parseInt$2; // `Array.isArray` method // https://tc39.github.io/ecma262/#sec-array.isarray _export({ target: 'Array', stat: true }, { isArray: isArray }); var isArray$1 = path.Array.isArray; var isArray$2 = isArray$1; var isArray$3 = isArray$2; function _arrayWithHoles(arr) { if (isArray$3(arr)) return arr; } var arrayWithHoles = _arrayWithHoles; // `String.prototype.{ codePointAt, at }` methods implementation var createMethod$3 = function (CONVERT_TO_STRING) { return function ($this, pos) { var S = String(requireObjectCoercible($this)); var position = toInteger(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.github.io/ecma262/#sec-string.prototype.codepointat codeAt: createMethod$3(false), // `String.prototype.at` method // https://github.com/mathiasbynens/String.prototype.at charAt: createMethod$3(true) }; var charAt = stringMultibyte.charAt; var STRING_ITERATOR = 'String Iterator'; var setInternalState$2 = internalState.set; var getInternalState$2 = internalState.getterFor(STRING_ITERATOR); // `String.prototype[@@iterator]` method // https://tc39.github.io/ecma262/#sec-string.prototype-@@iterator defineIterator(String, 'String', function (iterated) { setInternalState$2(this, { type: STRING_ITERATOR, string: String(iterated), index: 0 }); // `%StringIteratorPrototype%.next` method // https://tc39.github.io/ecma262/#sec-%stringiteratorprototype%.next }, function next() { var state = getInternalState$2(this); var string = state.string; var index = state.index; var point; if (index >= string.length) return { value: undefined, done: true }; point = charAt(string, index); state.index += point.length; return { value: point, done: false }; }); var ITERATOR$2 = wellKnownSymbol('iterator'); var getIteratorMethod = function (it) { if (it != undefined) return it[ITERATOR$2] || it['@@iterator'] || iterators[classof(it)]; }; var getIterator = function (it) { var iteratorMethod = getIteratorMethod(it); if (typeof iteratorMethod != 'function') { throw TypeError(String(it) + ' is not iterable'); } return anObject(iteratorMethod.call(it)); }; var getIterator$1 = getIterator; var getIterator$2 = getIterator$1; var ITERATOR$3 = wellKnownSymbol('iterator'); var isIterable = function (it) { var O = Object(it); return O[ITERATOR$3] !== undefined || '@@iterator' in O // eslint-disable-next-line no-prototype-builtins || iterators.hasOwnProperty(classof(O)); }; var isIterable$1 = isIterable; var isIterable$2 = isIterable$1; function _iterableToArrayLimit(arr, i) { if (!(isIterable$2(Object(arr)) || Object.prototype.toString.call(arr) === "[object Arguments]")) { return; } var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = getIterator$2(arr), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } var iterableToArrayLimit = _iterableToArrayLimit; function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } var nonIterableRest = _nonIterableRest; function _slicedToArray(arr, i) { return arrayWithHoles(arr) || iterableToArrayLimit(arr, i) || nonIterableRest(); } var slicedToArray = _slicedToArray; var IS_CONCAT_SPREADABLE = wellKnownSymbol('isConcatSpreadable'); var MAX_SAFE_INTEGER = 0x1FFFFFFFFFFFFF; var MAXIMUM_ALLOWED_INDEX_EXCEEDED = 'Maximum allowed index exceeded'; var IS_CONCAT_SPREADABLE_SUPPORT = !fails(function () { var array = []; array[IS_CONCAT_SPREADABLE] = false; return array.concat()[0] !== array; }); var SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('concat'); var isConcatSpreadable = function (O) { if (!isObject(O)) return false; var spreadable = O[IS_CONCAT_SPREADABLE]; return spreadable !== undefined ? !!spreadable : isArray(O); }; var FORCED$2 = !IS_CONCAT_SPREADABLE_SUPPORT || !SPECIES_SUPPORT; // `Array.prototype.concat` method // https://tc39.github.io/ecma262/#sec-array.prototype.concat // with adding support of @@isConcatSpreadable and @@species _export({ target: 'Array', proto: true, forced: FORCED$2 }, { concat: function concat(arg) { // eslint-disable-line no-unused-vars var O = toObject(this); var A = arraySpeciesCreate(O, 0); var n = 0; var i, k, length, len, E; for (i = -1, length = arguments.length; i < length; i++) { E = i === -1 ? O : arguments[i]; if (isConcatSpreadable(E)) { len = toLength(E.length); if (n + len > MAX_SAFE_INTEGER) throw TypeError(MAXIMUM_ALLOWED_INDEX_EXCEEDED); for (k = 0; k < len; k++, n++) if (k in E) createProperty(A, n, E[k]); } else { if (n >= MAX_SAFE_INTEGER) throw TypeError(MAXIMUM_ALLOWED_INDEX_EXCEEDED); createProperty(A, n++, E); } } A.length = n; return A; } }); var concat = entryVirtual('Array').concat; var ArrayPrototype$3 = Array.prototype; var concat_1 = function (it) { var own = it.concat; return it === ArrayPrototype$3 || (it instanceof Array && own === ArrayPrototype$3.concat) ? concat : own; }; var concat$1 = concat_1; var concat$2 = concat$1; function _arrayWithoutHoles(arr) { if (isArray$3(arr)) { for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } } var arrayWithoutHoles = _arrayWithoutHoles; // call something on iterator step with safe closing on error var callWithSafeIterationClosing = function (iterator, fn, value, ENTRIES) { try { return ENTRIES ? fn(anObject(value)[0], value[1]) : fn(value); // 7.4.6 IteratorClose(iterator, completion) } catch (error) { var returnMethod = iterator['return']; if (returnMethod !== undefined) anObject(returnMethod.call(iterator)); throw error; } }; var ITERATOR$4 = wellKnownSymbol('iterator'); var ArrayPrototype$4 = Array.prototype; // check on default Array iterator var isArrayIteratorMethod = function (it) { return it !== undefined && (iterators.Array === it || ArrayPrototype$4[ITERATOR$4] === it); }; // `Array.from` method implementation // https://tc39.github.io/ecma262/#sec-array.from var arrayFrom = function from(arrayLike /* , mapfn = undefined, thisArg = undefined */) { var O = toObject(arrayLike); var C = typeof this == 'function' ? this : Array; var argumentsLength = arguments.length; var mapfn = argumentsLength > 1 ? arguments[1] : undefined; var mapping = mapfn !== undefined; var index = 0; var iteratorMethod = getIteratorMethod(O); var length, result, step, iterator; if (mapping) mapfn = bindContext(mapfn, argumentsLength > 2 ? arguments[2] : undefined, 2); // if the target is not iterable or it's an array with the default iterator - use a simple case if (iteratorMethod != undefined && !(C == Array && isArrayIteratorMethod(iteratorMethod))) { iterator = iteratorMethod.call(O); result = new C(); for (;!(step = iterator.next()).done; index++) { createProperty(result, index, mapping ? callWithSafeIterationClosing(iterator, mapfn, [step.value, index], true) : step.value ); } } else { length = toLength(O.length); result = new C(length); for (;length > index; index++) { createProperty(result, index, mapping ? mapfn(O[index], index) : O[index]); } } result.length = index; return result; }; var ITERATOR$5 = wellKnownSymbol('iterator'); var SAFE_CLOSING = false; try { var called = 0; var iteratorWithReturn = { next: function () { return { done: !!called++ }; }, 'return': function () { SAFE_CLOSING = true; } }; iteratorWithReturn[ITERATOR$5] = function () { return this; }; } catch (error) { /* empty */ } var checkCorrectnessOfIteration = function (exec, SKIP_CLOSING) { if (!SKIP_CLOSING && !SAFE_CLOSING) return false; var ITERATION_SUPPORT = false; try { var object = {}; object[ITERATOR$5] = function () { return { next: function () { return { done: ITERATION_SUPPORT = true }; } }; }; exec(object); } catch (error) { /* empty */ } return ITERATION_SUPPORT; }; var INCORRECT_ITERATION = !checkCorrectnessOfIteration(function (iterable) { }); // `Array.from` method // https://tc39.github.io/ecma262/#sec-array.from _export({ target: 'Array', stat: true, forced: INCORRECT_ITERATION }, { from: arrayFrom }); var from_1 = path.Array.from; var from_1$1 = from_1; var from_1$2 = from_1$1; function _iterableToArray(iter) { if (isIterable$2(Object(iter)) || Object.prototype.toString.call(iter) === "[object Arguments]") return from_1$2(iter); } var iterableToArray = _iterableToArray; function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance"); } var nonIterableSpread = _nonIterableSpread; function _toConsumableArray(arr) { return arrayWithoutHoles(arr) || iterableToArray(arr) || nonIterableSpread(); } var toConsumableArray = _toConsumableArray; var $map = arrayIteration.map; // `Array.prototype.map` method // https://tc39.github.io/ecma262/#sec-array.prototype.map // with adding support of @@species _export({ target: 'Array', proto: true, forced: !arrayMethodHasSpeciesSupport('map') }, { map: function map(callbackfn /* , thisArg */) { return $map(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined); } }); var map = entryVirtual('Array').map; var ArrayPrototype$5 = Array.prototype; var map_1 = function (it) { var own = it.map; return it === ArrayPrototype$5 || (it instanceof Array && own === ArrayPrototype$5.map) ? map : own; }; var map$1 = map_1; var map$2 = map$1; var from_1$3 = from_1; var from_1$4 = from_1$3; var $includes = arrayIncludes.includes; // `Array.prototype.includes` method // https://tc39.github.io/ecma262/#sec-array.prototype.includes _export({ target: 'Array', proto: true }, { includes: function includes(el /* , fromIndex = 0 */) { return $includes(this, el, arguments.length > 1 ? arguments[1] : undefined); } }); var includes = entryVirtual('Array').includes; var MATCH = wellKnownSymbol('match'); // `IsRegExp` abstract operation // https://tc39.github.io/ecma262/#sec-isregexp var isRegexp = function (it) { var isRegExp; return isObject(it) && ((isRegExp = it[MATCH]) !== undefined ? !!isRegExp : classofRaw(it) == 'RegExp'); }; var notARegexp = function (it) { if (isRegexp(it)) { throw TypeError("The method doesn't accept regular expressions"); } return it; }; var MATCH$1 = wellKnownSymbol('match'); var correctIsRegexpLogic = function (METHOD_NAME) { var regexp = /./; try { '/./'[METHOD_NAME](regexp); } catch (e) { try { regexp[MATCH$1] = false; return '/./'[METHOD_NAME](regexp); } catch (f) { /* empty */ } } return false; }; // `String.prototype.includes` method // https://tc39.github.io/ecma262/#sec-string.prototype.includes _export({ target: 'String', proto: true, forced: !correctIsRegexpLogic('includes') }, { includes: function includes(searchString /* , position = 0 */) { return !!~String(requireObjectCoercible(this)) .indexOf(notARegexp(searchString), arguments.length > 1 ? arguments[1] : undefined); } }); var includes$1 = entryVirtual('String').includes; var ArrayPrototype$6 = Array.prototype; var StringPrototype = String.prototype; var includes$2 = function (it) { var own = it.includes; if (it === ArrayPrototype$6 || (it instanceof Array && own === ArrayPrototype$6.includes)) return includes; if (typeof it === 'string' || it === StringPrototype || (it instanceof String && own === StringPrototype.includes)) { return includes$1; } return own; }; var includes$3 = includes$2; var includes$4 = includes$3; var $indexOf = arrayIncludes.indexOf; var nativeIndexOf = [].indexOf; var NEGATIVE_ZERO = !!nativeIndexOf && 1 / [1].indexOf(1, -0) < 0; var SLOPPY_METHOD = sloppyArrayMethod('indexOf'); // `Array.prototype.indexOf` method // https://tc39.github.io/ecma262/#sec-array.prototype.indexof _export({ target: 'Array', proto: true, forced: NEGATIVE_ZERO || SLOPPY_METHOD }, { indexOf: function indexOf(searchElement /* , fromIndex = 0 */) { return NEGATIVE_ZERO // convert -0 to +0 ? nativeIndexOf.apply(this, arguments) || 0 : $indexOf(this, searchElement, arguments.length > 1 ? arguments[1] : undefined); } }); var indexOf$1 = entryVirtual('Array').indexOf; var ArrayPrototype$7 = Array.prototype; var indexOf_1 = function (it) { var own = it.indexOf; return it === ArrayPrototype$7 || (it instanceof Array && own === ArrayPrototype$7.indexOf) ? indexOf$1 : own; }; var indexOf$2 = indexOf_1; var indexOf$3 = indexOf$2; /** * Returns a function, that, as long as it continues to be invoked, will not * be triggered. The function will be called after it stops being called for * N milliseconds. If `immediate` is passed, trigger the function on the * leading edge, instead of the trailing. The function also has a property 'clear' * that is a function which will clear the timer to prevent previously scheduled executions. * * @source underscore.js * @see http://unscriptable.com/2009/03/20/debouncing-javascript-methods/ * @param {Function} function to wrap * @param {Number} timeout in ms (`100`) * @param {Boolean} whether to execute at the beginning (`false`) * @api public */ function debounce(func, wait, immediate){ var timeout, args, context, timestamp, result; if (null == wait) wait = 100; function later() { var last = Date.now() - timestamp; if (last < wait && last >= 0) { timeout = setTimeout(later, wait - last); } else { timeout = null; if (!immediate) { result = func.apply(context, args); context = args = null; } } } var debounced = function(){ context = this; args = arguments; timestamp = Date.now(); var callNow = immediate && !timeout; if (!timeout) timeout = setTimeout(later, wait); if (callNow) { result = func.apply(context, args); context = args = null; } return result; }; debounced.clear = function() { if (timeout) { clearTimeout(timeout); timeout = null; } }; debounced.flush = function() { if (timeout) { result = func.apply(context, args); context = args = null; clearTimeout(timeout); timeout = null; } }; return debounced; } // Adds compatibility for ES modules debounce.debounce = debounce; var debounce_1 = debounce; var propertyIsEnumerable = objectPropertyIsEnumerable.f; // `Object.{ entries, values }` methods implementation var createMethod$4 = function (TO_ENTRIES) { return function (it) { var O = toIndexedObject(it); var keys = objectKeys(O); var length = keys.length; var i = 0; var result = []; var key; while (length > i) { key = keys[i++]; if (!descriptors || propertyIsEnumerable.call(O, key)) { result.push(TO_ENTRIES ? [key, O[key]] : O[key]); } } return result; }; }; var objectToArray = { // `Object.entries` method // https://tc39.github.io/ecma262/#sec-object.entries entries: createMethod$4(true), // `Object.values` method // https://tc39.github.io/ecma262/#sec-object.values values: createMethod$4(false) }; var $entries = objectToArray.entries; // `Object.entries` method // https://tc39.github.io/ecma262/#sec-object.entries _export({ target: 'Object', stat: true }, { entries: function entries(O) { return $entries(O); } }); var entries = path.Object.entries; var entries$1 = entries; var entries$2 = entries$1; var $JSON = path.JSON || (path.JSON = { stringify: JSON.stringify }); var stringify = function stringify(it) { // eslint-disable-line no-unused-vars return $JSON.stringify.apply($JSON, arguments); }; var stringify$1 = stringify; var stringify$2 = stringify$1; // 上报资源类型 var RESOUCE_TYPE = { IMG: 1, JS: 2, CSS: 3, XHR: 4 }; // 加载情况 var LOAD_STATUS = { SUCCESS: 1, FAILED: 0 }; // 上报默认延时(debounceSendAssetsRequest) var WAIT_MILLISECONDS = 2000; // 要处理的 标签 var MONITOR_TAGS = ['script', 'link', 'img']; // 每一次上报的资源数组最大长度 var REPORT_MAX_LENGTH = 3; // 连续上报时每个请求之间的间隔时间:毫秒 var SEND_REQUEST_INTERVAL = 100; function encodeData(data) { return encodeURIComponent(stringify$2(data)); } function serialize(data) { var _context; return map$2(_context = entries$2(data || {})).call(_context, function (_ref) { var _context2; var _ref2 = slicedToArray(_ref, 2), key = _ref2[0], value = _ref2[1]; return concat$2(_context2 = "".concat(encodeURIComponent(key), "=")).call(_context2, encodeURIComponent(value)); }).join('&'); } function sendRequest(url, data, cb) { var _context3; var img = new Image(); if (cb) setTimeout$2(cb, SEND_REQUEST_INTERVAL); // onload event will not trigger. img.src = concat$2(_context3 = "".concat(url, "?")).call(_context3, serialize(data)); } function getUrl(element) { if (!element.tagName) return ''; switch (element.tagName.toLowerCase()) { case 'img': case 'script': return element.src; case 'link': return element.href; case 'xhr': return element.url; default: return ''; } } function getResourceType(element) { if (!element.tagName) return ''; switch (element.tagName.toLowerCase()) { case 'img': return RESOUCE_TYPE.IMG; case 'script': return RESOUCE_TYPE.JS; case 'link': return RESOUCE_TYPE.CSS; case 'xhr': return RESOUCE_TYPE.XHR; default: return ''; } } function setPropToInt() { var obj = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; var data = {}; // eslint-disable-next-line no-restricted-syntax for (var prop in obj) { if (typeof obj[prop] === 'number') { data[prop] = Math.round(obj[prop]); } else if (prop !== 'toJSON') { data[prop] = obj[prop]; } } return data; } function ownKeys$1(object, enumerableOnly) { var keys = keys$3(object); if (getOwnPropertySymbols$2) { var symbols = getOwnPropertySymbols$2(object); if (enumerableOnly) symbols = filter$2(symbols).call(symbols, function (sym) { return getOwnPropertyDescriptor$3(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { var _context8; forEach$2(_context8 = ownKeys$1(source, true)).call(_context8, function (key) { defineProperty$6(target, key, source[key]); }); } else if (getOwnPropertyDescriptors$2) { defineProperties$1(target, getOwnPropertyDescriptors$2(source)); } else { var _context9; forEach$2(_context9 = ownKeys$1(source)).call(_context9, function (key) { defineProperty$1(target, key, getOwnPropertyDescriptor$3(source, key)); }); } } return target; } var customPageUrl = ''; var $pageUrl = document.querySelector('meta[name=bigo-report-page-url]'); if ($pageUrl) { customPageUrl = $pageUrl.getAttribute('content'); } // 是否支持performance var IS_SUPPORT_PERFORMANCE = window.performance && typeof window.performance.getEntriesByName === 'function'; var ALL_ASSTES = []; // 存放页面所有上报过的资源 var isInSample = false; // 是否在样本中,在则需要上报 var sendRequest$1 = null; // 上报请求 var debounceSendAssetsRequest = null; // 资源上报 var cachedData = []; // 缓存页面 onload 后的监控数据 var isWindowLoaded = false; // 检测是否初次加载页面,是则累计上报 var cachedDataBeforeLoad = []; // 缓存页面 onload 前的监控数据 // 根据采样率,判断是否上报 function isNeedReport() { return isInSample && IS_SUPPORT_PERFORMANCE; } // 是否忽略采样率 function isIgnoreSample(elem, isLoadSuccess) { var isXhrError = getResourceType(elem) === RESOUCE_TYPE.XHR && !isLoadSuccess; // 接口错误时采样率为1 return !!isXhrError; } // 获取 外部资源/接口 上报数据 function getElemReportData(elem, isLoadSuccess) { var time = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0; if (!elem) return null; var url = getUrl(elem); // 资源url if (!url || url.search('chrome-extension') > -1) return null; var entries = {}; var costTime = time; if (IS_SUPPORT_PERFORMANCE) { var entiresArr = window.performance.getEntriesByName(url); if (entiresArr.length) { entries = setPropToInt(entiresArr[entiresArr.length - 1]); costTime = entries.duration; } } return { url: url, // 资源url success: isLoadSuccess, // 是否成功 cost_time: costTime, // 请求+下载+解析 耗时 resource_type: getResourceType(elem), // 资源类型 page_url: customPageUrl || window.location.href, // 项目url success_performance: encodeData(entries || {}) // performance整个对象 }; } // 外部资源 上报/缓存 function report(elem, isLoadSuccess) { var time = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0; var errorType = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : ''; var errorMsg = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : ''; var statusCode = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : ''; var extendData = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : {}; try { if (!isIgnoreSample(elem, isLoadSuccess) && !isNeedReport()) return; var data = getElemReportData(elem, isLoadSuccess, time); if (data) { var _context; // 图片,过滤base64 if (data.resource_type === RESOUCE_TYPE.IMG && indexOf$3(_context = data.url).call(_context, 'data:image/png;base64') > -1) return; // 非接口,且已加载过 if (data.resource_type !== RESOUCE_TYPE.XHR && includes$4(ALL_ASSTES).call(ALL_ASSTES, data.url)) return; ALL_ASSTES.push(data.url); // 接口,增加失败信息 if (data.resource_type === RESOUCE_TYPE.XHR) { data.error_type = errorType || ''; // 失败类型: 1 超时类,2 status !== 200类,3 其他错误 data.error_msg = errorMsg || ''; // 失败具体信息 data.status_code = statusCode || ''; // 失败状态码 data = _objectSpread({}, data, {}, extendData || {}); // 拼上 业务要上报的数据 } // 上报数据 // console.log(data) if (isWindowLoaded) { cachedData.push(data); debounceSendAssetsRequest(); } else { cachedDataBeforeLoad.push(data); } } } catch (err) { console.error(err); } } // 监听onload onerror function listenLoadEvent(elem) { elem.addEventListener('load', function () { return report(elem, LOAD_STATUS.SUCCESS); }); elem.addEventListener('error', function () { return report(elem, LOAD_STATUS.FAILED); }); } // 监听动态插入的标签 function observeTagInsert() { if (!window.MutationObserver) return; var config = { attributes: false, childList: true, subtree: false }; var observer = new MutationObserver(function (mutationsList) { var _context2; forEach$2(_context2 = from_1$4(mutationsList)).call(_context2, function (mutation) { if (mutation.type === 'childList') { var _context3; forEach$2(_context3 = from_1$4(mutation.addedNodes)).call(_context3, function (elem) { var tagName = elem.tagName; if (tagName && includes$4(MONITOR_TAGS).call(MONITOR_TAGS, tagName.toLowerCase())) { listenLoadEvent(elem); // 监听 请求成功/失败 } }); } }); }); observer.observe(document.head, config); // body非动态加载的资源 document.onreadystatechange = function () { if (document.readyState === 'interactive') { observer.observe(document.body, config); } }; } // onload前 js加载 用时最长的资源的时长 function getJsCostTimeBeforeLoad() { var _context4; var costTimeArr = map$2(cachedDataBeforeLoad).call(cachedDataBeforeLoad, function (item) { return item.resource_type === RESOUCE_TYPE.JS ? item.cost_time : 0; }); return Math.max.apply(Math, concat$2(_context4 = toConsumableArray(costTimeArr)).call(_context4, [0])); } // 页面性能上报,参数:采样率 function sendPerformanceRequest() { var sampleRate = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0; if (!IS_SUPPORT_PERFORMANCE) return; // FP/FCP var paintArr = from_1$4(performance.getEntriesByType('paint')); var _ref = paintArr.length ? paintArr : [{}, {}], _ref2 = slicedToArray(_ref, 2), fp = _ref2[0], fcp = _ref2[1]; var paintTime = { FP: fp ? _parseInt$3(fp.duration + fp.startTime, 10) : null, FCP: fcp ? _parseInt$3(fcp.duration + fcp.startTime, 10) : null }; // performance整串数据,按照navigation格式上报 // timing 比 naviagtion 多以下属性:domLoading、navigationStart // timing 比 naviagtion 少以下属性: // decodedBodySize、duration、encodedBodySize、entryType、initiatorType、name、nextHopProtocol、 // redirectCount、secureConnectionStart、serverTiming、startTime、transferSize、type、workerStart var performanceData = {}; var navaigation = performance.getEntriesByType('navigation'); if (navaigation && navaigation.length) { performanceData = setPropToInt(navaigation[0]); } else { var timing = window.performance.timing; // eslint-disable-next-line no-restricted-syntax for (var prop in timing) { if (typeof timing[prop] === 'number') { performanceData[prop] = Math.max(timing[prop] - timing.navigationStart, 0); } } } // console.log(navaigation[0]) // console.log(performanceData) // 之前上报的数据 var dnsTime = performanceData.connectEnd - performanceData.domainLookupStart; var htmlTime = performanceData.responseEnd - performanceData.requestStart; var loadTime = performanceData.loadEventEnd || performanceData.loadEventStart || performanceData.domComplete || performanceData.domInteractive; var jsCostTime = getJsCostTimeBeforeLoad(); sendRequest$1({ module: 'page_avg_load', url: customPageUrl || window.location.href, // 性能上报的当前页面地址, dns_cost_time: dnsTime, // dns + tcp html_cost_time: htmlTime, // html 请求+下载 耗时 js_cost_time: jsCostTime, // js 加载 耗时(取 用时最长的资源的时长) load_cost_time: loadTime, // 页面总加载时间 sample_rate: _parseInt$3(sampleRate * 100, 10), // 采样率 1-100 paint_time: encodeData(paintTime), // 首个图片加载完成 耗时 performance: encodeData(performanceData) // performance整个对象 }); } var sendRequestCount = 0; // 外部资源上报 function sendAssetsRequest(data) { if (data && data.length > 0) { var sendData = []; for (var i = 0; i < data.length; i += REPORT_MAX_LENGTH) { sendData.push(slice$4(data).call(data, i, i + REPORT_MAX_LENGTH)); } var j = 0; var oneByOneSend = function oneByOneSend() { sendRequestCount += 1; console.log("assets-load-monitor: send request times is ".concat(sendRequestCount)); sendRequest$1({ module: 'front_interface_call', data: encodeData(sendData[j]) }, function () { j += 1; if (j < sendData.length) oneByOneSend(); }); }; oneByOneSend(); } } // 遍历body子元素,调用上报函数 function bodyAssetsPushToCached() { if (document.body) { var _context5; forEach$2(_context5 = from_1$4(document.body.childNodes)).call(_context5, function (elem) { var tagName = elem.tagName; if (tagName && includes$4(MONITOR_TAGS).call(MONITOR_TAGS, tagName.toLowerCase())) { var url = getUrl(elem); if (IS_SUPPORT_PERFORMANCE) { report(elem, window.performance.getEntriesByName(url)[0] ? 1 : 0); } } }); } } // 初始化 function init(config) { try { var _context6, _context7; if (config.sampleRate < 0 || config.sampleRate > 1) { console.warn('[sampleRate] should be between 0 and 1'); } // 是否在样本中 var forceInSample = indexOf$3(_context6 = window.location.href).call(_context6, 'fe_monitor=1') !== -1; isInSample = forceInSample || Math.round(Math.random() * 100) <= config.sampleRate * 100; // if (!isNeedReport()) return // console.log('monitor in sample') // 外部资源上报 sendRequest$1 = bind$2(_context7 = sendRequest).call(_context7, null, config.api); debounceSendAssetsRequest = debounce_1(function () { if (cachedData.length) { var sendData = cachedData; cachedData = []; sendAssetsRequest(sendData); } }, config.reportWaitMilliSeconds || WAIT_MILLISECONDS); // 监听动态插入的标签 if (isNeedReport()) { observeTagInsert(); } // onload window.addEventListener('load', function () { var onloadSend = function onloadSend() { if (isNeedReport()) { // 遍历body子元素,往cachedDataBeforeLoad插入数据 bodyAssetsPushToCached(); // 页面性能上报 sendPerformanceRequest(config.sampleRate); } // 确保放在 bodyAssetsPushToCached() 之后 isWindowLoaded = true; var sendData = cachedDataBeforeLoad; cachedDataBeforeLoad = null; // onload 前资源上报 sendAssetsRequest(sendData); }; // 新增 尽量不影响页面主线程 if (window.requestIdleCallback) { window.requestIdleCallback(onloadSend); } else { // 为了保证onload后拿到可靠数据,setTimeout处理一下 setTimeout$2(onloadSend); } }); } catch (e) { console.error(e); } } // 对外暴露 上报图片 function sendImgLoadReport(elem, isSuccess) { report(elem, isSuccess); } // 对外暴露 上报接口 function sendRpcReport(url, isSuccess, time, errorType, errorMsg, statusCode, extendData) { var elem = { url: url, tagName: 'XHR' }; report(elem, isSuccess, time, errorType, errorMsg, statusCode, extendData); } var assetsLoadMonitor = /*#__PURE__*/Object.freeze({ isNeedReport: isNeedReport, init: init, sendImgLoadReport: sendImgLoadReport, sendRpcReport: sendRpcReport }); function ownKeys$2(object, enumerableOnly) { var keys = keys$3(object); if (getOwnPropertySymbols$2) { var symbols = getOwnPropertySymbols$2(object); if (enumerableOnly) symbols = filter$2(symbols).call(symbols, function (sym) { return getOwnPropertyDescriptor$3(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } function _objectSpread$1(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { var _context; forEach$2(_context = ownKeys$2(source, true)).call(_context, function (key) { defineProperty$6(target, key, source[key]); }); } else if (getOwnPropertyDescriptors$2) { defineProperties$1(target, getOwnPropertyDescriptors$2(source)); } else { var _context2; forEach$2(_context2 = ownKeys$2(source)).call(_context2, function (key) { defineProperty$1(target, key, getOwnPropertyDescriptor$3(source, key)); }); } } return target; } var config = { sampleRate: 0.2, api: 'https://front-perf.like-video.com/api/call', reportWaitMilliseconds: 2000 }; if (window.$_PERF_OPTIONS) { config = _objectSpread$1({}, config, {}, window.$_PERF_OPTIONS); } init(config); return assetsLoadMonitor; }));