/* eslint-disable */
(function () {
if (typeof window.BX === "function") {
return;
}
/**
* Babel external helpers
* (c) 2018 Babel
* @license MIT
*/
(function (global) {
var babelHelpers = (global.babelHelpers = {});
function _typeof(obj) {
if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
babelHelpers.typeof = _typeof = function (obj) {
return typeof obj;
};
} else {
babelHelpers.typeof = _typeof = function (obj) {
return obj &&
typeof Symbol === "function" &&
obj.constructor === Symbol &&
obj !== Symbol.prototype
? "symbol"
: typeof obj;
};
}
return _typeof(obj);
}
babelHelpers.typeof = _typeof;
var REACT_ELEMENT_TYPE;
function _createRawReactElement(type, props, key, children) {
if (!REACT_ELEMENT_TYPE) {
REACT_ELEMENT_TYPE =
(typeof Symbol === "function" &&
Symbol.for &&
Symbol.for("react.element")) ||
0xeac7;
}
var defaultProps = type && type.defaultProps;
var childrenLength = arguments.length - 3;
if (!props && childrenLength !== 0) {
props = {
children: void 0,
};
}
if (props && defaultProps) {
for (var propName in defaultProps) {
if (props[propName] === void 0) {
props[propName] = defaultProps[propName];
}
}
} else if (!props) {
props = defaultProps || {};
}
if (childrenLength === 1) {
props.children = children;
} else if (childrenLength > 1) {
var childArray = new Array(childrenLength);
for (var i = 0; i < childrenLength; i++) {
childArray[i] = arguments[i + 3];
}
props.children = childArray;
}
return {
$$typeof: REACT_ELEMENT_TYPE,
type: type,
key: key === undefined ? null : "" + key,
ref: null,
props: props,
_owner: null,
};
}
babelHelpers.jsx = _createRawReactElement;
function _asyncIterator(iterable) {
var method;
if (typeof Symbol === "function") {
if (Symbol.asyncIterator) {
method = iterable[Symbol.asyncIterator];
if (method != null) return method.call(iterable);
}
if (Symbol.iterator) {
method = iterable[Symbol.iterator];
if (method != null) return method.call(iterable);
}
}
throw new TypeError("Object is not async iterable");
}
babelHelpers.asyncIterator = _asyncIterator;
function _AwaitValue(value) {
this.wrapped = value;
}
babelHelpers.AwaitValue = _AwaitValue;
function AsyncGenerator(gen) {
var front, back;
function send(key, arg) {
return new Promise(function (resolve, reject) {
var request = {
key: key,
arg: arg,
resolve: resolve,
reject: reject,
next: null,
};
if (back) {
back = back.next = request;
} else {
front = back = request;
resume(key, arg);
}
});
}
function resume(key, arg) {
try {
var result = gen[key](arg);
var value = result.value;
var wrappedAwait = value instanceof babelHelpers.AwaitValue;
Promise.resolve(wrappedAwait ? value.wrapped : value).then(
function (arg) {
if (wrappedAwait) {
resume("next", arg);
return;
}
settle(result.done ? "return" : "normal", arg);
},
function (err) {
resume("throw", err);
}
);
} catch (err) {
settle("throw", err);
}
}
function settle(type, value) {
switch (type) {
case "return":
front.resolve({
value: value,
done: true,
});
break;
case "throw":
front.reject(value);
break;
default:
front.resolve({
value: value,
done: false,
});
break;
}
front = front.next;
if (front) {
resume(front.key, front.arg);
} else {
back = null;
}
}
this._invoke = send;
if (typeof gen.return !== "function") {
this.return = undefined;
}
}
if (typeof Symbol === "function" && Symbol.asyncIterator) {
AsyncGenerator.prototype[Symbol.asyncIterator] = function () {
return this;
};
}
AsyncGenerator.prototype.next = function (arg) {
return this._invoke("next", arg);
};
AsyncGenerator.prototype.throw = function (arg) {
return this._invoke("throw", arg);
};
AsyncGenerator.prototype.return = function (arg) {
return this._invoke("return", arg);
};
babelHelpers.AsyncGenerator = AsyncGenerator;
function _wrapAsyncGenerator(fn) {
return function () {
return new babelHelpers.AsyncGenerator(fn.apply(this, arguments));
};
}
babelHelpers.wrapAsyncGenerator = _wrapAsyncGenerator;
function _awaitAsyncGenerator(value) {
return new babelHelpers.AwaitValue(value);
}
babelHelpers.awaitAsyncGenerator = _awaitAsyncGenerator;
function _asyncGeneratorDelegate(inner, awaitWrap) {
var iter = {},
waiting = false;
function pump(key, value) {
waiting = true;
value = new Promise(function (resolve) {
resolve(inner[key](value));
});
return {
done: false,
value: awaitWrap(value),
};
}
if (typeof Symbol === "function" && Symbol.iterator) {
iter[Symbol.iterator] = function () {
return this;
};
}
iter.next = function (value) {
if (waiting) {
waiting = false;
return value;
}
return pump("next", value);
};
if (typeof inner.throw === "function") {
iter.throw = function (value) {
if (waiting) {
waiting = false;
throw value;
}
return pump("throw", value);
};
}
if (typeof inner.return === "function") {
iter.return = function (value) {
return pump("return", value);
};
}
return iter;
}
babelHelpers.asyncGeneratorDelegate = _asyncGeneratorDelegate;
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
try {
var info = gen[key](arg);
var value = info.value;
} catch (error) {
reject(error);
return;
}
if (info.done) {
resolve(value);
} else {
Promise.resolve(value).then(_next, _throw);
}
}
function _asyncToGenerator(fn) {
return function () {
var self = this,
args = arguments;
return new Promise(function (resolve, reject) {
var gen = fn.apply(self, args);
function _next(value) {
asyncGeneratorStep(
gen,
resolve,
reject,
_next,
_throw,
"next",
value
);
}
function _throw(err) {
asyncGeneratorStep(
gen,
resolve,
reject,
_next,
_throw,
"throw",
err
);
}
_next(undefined);
});
};
}
babelHelpers.asyncToGenerator = _asyncToGenerator;
function _classCallCheck(instance, Constructor) {
if (!(instance instanceof Constructor)) {
throw new TypeError("Cannot call a class as a function");
}
}
babelHelpers.classCallCheck = _classCallCheck;
function _defineProperties(target, props) {
for (var i = 0; i < props.length; i++) {
var descriptor = props[i];
descriptor.enumerable = descriptor.enumerable || false;
descriptor.configurable = true;
if ("value" in descriptor) descriptor.writable = true;
Object.defineProperty(target, descriptor.key, descriptor);
}
}
function _createClass(Constructor, protoProps, staticProps) {
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
if (staticProps) _defineProperties(Constructor, staticProps);
return Constructor;
}
babelHelpers.createClass = _createClass;
function _defineEnumerableProperties(obj, descs) {
for (var key in descs) {
var desc = descs[key];
desc.configurable = desc.enumerable = true;
if ("value" in desc) desc.writable = true;
Object.defineProperty(obj, key, desc);
}
if (Object.getOwnPropertySymbols) {
var objectSymbols = Object.getOwnPropertySymbols(descs);
for (var i = 0; i < objectSymbols.length; i++) {
var sym = objectSymbols[i];
var desc = descs[sym];
desc.configurable = desc.enumerable = true;
if ("value" in desc) desc.writable = true;
Object.defineProperty(obj, sym, desc);
}
}
return obj;
}
babelHelpers.defineEnumerableProperties = _defineEnumerableProperties;
function _defaults(obj, defaults) {
var keys = Object.getOwnPropertyNames(defaults);
for (var i = 0; i < keys.length; i++) {
var key = keys[i];
var value = Object.getOwnPropertyDescriptor(defaults, key);
if (value && value.configurable && obj[key] === undefined) {
Object.defineProperty(obj, key, value);
}
}
return obj;
}
babelHelpers.defaults = _defaults;
function _defineProperty(obj, key, value) {
if (key in obj) {
Object.defineProperty(obj, key, {
value: value,
enumerable: true,
configurable: true,
writable: true,
});
} else {
obj[key] = value;
}
return obj;
}
babelHelpers.defineProperty = _defineProperty;
function _extends() {
babelHelpers.extends = _extends =
Object.assign ||
function (target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) {
if (Object.prototype.hasOwnProperty.call(source, key)) {
target[key] = source[key];
}
}
}
return target;
};
return _extends.apply(this, arguments);
}
babelHelpers.extends = _extends;
function _objectSpread(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i] != null ? arguments[i] : {};
var ownKeys = Object.keys(source);
if (typeof Object.getOwnPropertySymbols === "function") {
ownKeys = ownKeys.concat(
Object.getOwnPropertySymbols(source).filter(function (sym) {
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
})
);
}
ownKeys.forEach(function (key) {
babelHelpers.defineProperty(target, key, source[key]);
});
}
return target;
}
babelHelpers.objectSpread = _objectSpread;
function _inherits(subClass, superClass) {
if (typeof superClass !== "function" && superClass !== null) {
throw new TypeError(
"Super expression must either be null or a function"
);
}
subClass.prototype = Object.create(superClass && superClass.prototype, {
constructor: {
value: subClass,
writable: true,
configurable: true,
},
});
if (superClass) babelHelpers.setPrototypeOf(subClass, superClass);
}
babelHelpers.inherits = _inherits;
function _inheritsLoose(subClass, superClass) {
subClass.prototype = Object.create(superClass.prototype);
subClass.prototype.constructor = subClass;
subClass.__proto__ = superClass;
}
babelHelpers.inheritsLoose = _inheritsLoose;
function _getPrototypeOf(o) {
babelHelpers.getPrototypeOf = _getPrototypeOf = Object.setPrototypeOf
? Object.getPrototypeOf
: function _getPrototypeOf(o) {
return o.__proto__ || Object.getPrototypeOf(o);
};
return _getPrototypeOf(o);
}
babelHelpers.getPrototypeOf = _getPrototypeOf;
function _setPrototypeOf(o, p) {
babelHelpers.setPrototypeOf = _setPrototypeOf =
Object.setPrototypeOf ||
function _setPrototypeOf(o, p) {
o.__proto__ = p;
return o;
};
return _setPrototypeOf(o, p);
}
babelHelpers.setPrototypeOf = _setPrototypeOf;
function isNativeReflectConstruct() {
if (typeof Reflect === "undefined" || !Reflect.construct) return false;
if (Reflect.construct.sham) return false;
if (typeof Proxy === "function") return true;
try {
Date.prototype.toString.call(
Reflect.construct(Date, [], function () {})
);
return true;
} catch (e) {
return false;
}
}
function _construct(Parent, args, Class) {
if (isNativeReflectConstruct()) {
babelHelpers.construct = _construct = Reflect.construct;
} else {
babelHelpers.construct = _construct = function _construct(
Parent,
args,
Class
) {
var a = [null];
a.push.apply(a, args);
var Constructor = Function.bind.apply(Parent, a);
var instance = new Constructor();
if (Class) babelHelpers.setPrototypeOf(instance, Class.prototype);
return instance;
};
}
return _construct.apply(null, arguments);
}
babelHelpers.construct = _construct;
function _isNativeFunction(fn) {
return Function.toString.call(fn).indexOf("[native code]") !== -1;
}
babelHelpers.isNativeFunction = _isNativeFunction;
function _wrapNativeSuper(Class) {
var _cache = typeof Map === "function" ? new Map() : undefined;
babelHelpers.wrapNativeSuper = _wrapNativeSuper =
function _wrapNativeSuper(Class) {
if (Class === null || !babelHelpers.isNativeFunction(Class))
return Class;
if (typeof Class !== "function") {
throw new TypeError(
"Super expression must either be null or a function"
);
}
if (typeof _cache !== "undefined") {
if (_cache.has(Class)) return _cache.get(Class);
_cache.set(Class, Wrapper);
}
function Wrapper() {
return babelHelpers.construct(
Class,
arguments,
babelHelpers.getPrototypeOf(this).constructor
);
}
Wrapper.prototype = Object.create(Class.prototype, {
constructor: {
value: Wrapper,
enumerable: false,
writable: true,
configurable: true,
},
});
return babelHelpers.setPrototypeOf(Wrapper, Class);
};
return _wrapNativeSuper(Class);
}
babelHelpers.wrapNativeSuper = _wrapNativeSuper;
function _instanceof(left, right) {
if (
right != null &&
typeof Symbol !== "undefined" &&
right[Symbol.hasInstance]
) {
return right[Symbol.hasInstance](left);
} else {
return left instanceof right;
}
}
babelHelpers.instanceof = _instanceof;
function _interopRequireDefault(obj) {
return obj && obj.__esModule
? obj
: {
default: obj,
};
}
babelHelpers.interopRequireDefault = _interopRequireDefault;
function _interopRequireWildcard(obj) {
if (obj && obj.__esModule) {
return obj;
} else {
var newObj = {};
if (obj != null) {
for (var key in obj) {
if (Object.prototype.hasOwnProperty.call(obj, key)) {
var desc =
Object.defineProperty && Object.getOwnPropertyDescriptor
? Object.getOwnPropertyDescriptor(obj, key)
: {};
if (desc.get || desc.set) {
Object.defineProperty(newObj, key, desc);
} else {
newObj[key] = obj[key];
}
}
}
}
newObj.default = obj;
return newObj;
}
}
babelHelpers.interopRequireWildcard = _interopRequireWildcard;
function _newArrowCheck(innerThis, boundThis) {
if (innerThis !== boundThis) {
throw new TypeError("Cannot instantiate an arrow function");
}
}
babelHelpers.newArrowCheck = _newArrowCheck;
function _objectDestructuringEmpty(obj) {
if (obj == null) throw new TypeError("Cannot destructure undefined");
}
babelHelpers.objectDestructuringEmpty = _objectDestructuringEmpty;
function _objectWithoutPropertiesLoose(source, excluded) {
if (source == null) return {};
var target = {};
var sourceKeys = Object.keys(source);
var key, i;
for (i = 0; i < sourceKeys.length; i++) {
key = sourceKeys[i];
if (excluded.indexOf(key) >= 0) continue;
target[key] = source[key];
}
return target;
}
babelHelpers.objectWithoutPropertiesLoose = _objectWithoutPropertiesLoose;
function _objectWithoutProperties(source, excluded) {
if (source == null) return {};
var target = babelHelpers.objectWithoutPropertiesLoose(source, excluded);
var key, i;
if (Object.getOwnPropertySymbols) {
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
for (i = 0; i < sourceSymbolKeys.length; i++) {
key = sourceSymbolKeys[i];
if (excluded.indexOf(key) >= 0) continue;
if (!Object.prototype.propertyIsEnumerable.call(source, key))
continue;
target[key] = source[key];
}
}
return target;
}
babelHelpers.objectWithoutProperties = _objectWithoutProperties;
function _assertThisInitialized(self) {
if (self === void 0) {
throw new ReferenceError(
"this hasn't been initialised - super() hasn't been called"
);
}
return self;
}
babelHelpers.assertThisInitialized = _assertThisInitialized;
function _possibleConstructorReturn(self, call) {
if (call && (typeof call === "object" || typeof call === "function")) {
return call;
}
return babelHelpers.assertThisInitialized(self);
}
babelHelpers.possibleConstructorReturn = _possibleConstructorReturn;
function _superPropBase(object, property) {
while (!Object.prototype.hasOwnProperty.call(object, property)) {
object = babelHelpers.getPrototypeOf(object);
if (object === null) break;
}
return object;
}
babelHelpers.superPropBase = _superPropBase;
function _get(target, property, receiver) {
if (typeof Reflect !== "undefined" && Reflect.get) {
babelHelpers.get = _get = Reflect.get;
} else {
babelHelpers.get = _get = function _get(target, property, receiver) {
var base = babelHelpers.superPropBase(target, property);
if (!base) return;
var desc = Object.getOwnPropertyDescriptor(base, property);
if (desc.get) {
return desc.get.call(receiver);
}
return desc.value;
};
}
return _get(target, property, receiver || target);
}
babelHelpers.get = _get;
function set(target, property, value, receiver) {
if (typeof Reflect !== "undefined" && Reflect.set) {
set = Reflect.set;
} else {
set = function set(target, property, value, receiver) {
var base = babelHelpers.superPropBase(target, property);
var desc;
if (base) {
desc = Object.getOwnPropertyDescriptor(base, property);
if (desc.set) {
desc.set.call(receiver, value);
return true;
} else if (!desc.writable) {
return false;
}
}
desc = Object.getOwnPropertyDescriptor(receiver, property);
if (desc) {
if (!desc.writable) {
return false;
}
desc.value = value;
Object.defineProperty(receiver, property, desc);
} else {
babelHelpers.defineProperty(receiver, property, value);
}
return true;
};
}
return set(target, property, value, receiver);
}
function _set(target, property, value, receiver, isStrict) {
var s = set(target, property, value, receiver || target);
if (!s && isStrict) {
throw new Error("failed to set property");
}
return value;
}
babelHelpers.set = _set;
function _taggedTemplateLiteral(strings, raw) {
if (!raw) {
raw = strings.slice(0);
}
return Object.freeze(
Object.defineProperties(strings, {
raw: {
value: Object.freeze(raw),
},
})
);
}
babelHelpers.taggedTemplateLiteral = _taggedTemplateLiteral;
function _taggedTemplateLiteralLoose(strings, raw) {
if (!raw) {
raw = strings.slice(0);
}
strings.raw = raw;
return strings;
}
babelHelpers.taggedTemplateLiteralLoose = _taggedTemplateLiteralLoose;
function _temporalRef(val, name) {
if (val === babelHelpers.temporalUndefined) {
throw new ReferenceError(name + " is not defined - temporal dead zone");
} else {
return val;
}
}
babelHelpers.temporalRef = _temporalRef;
function _readOnlyError(name) {
throw new Error('"' + name + '" is read-only');
}
babelHelpers.readOnlyError = _readOnlyError;
function _classNameTDZError(name) {
throw new Error(
'Class "' + name + '" cannot be referenced in computed property keys.'
);
}
babelHelpers.classNameTDZError = _classNameTDZError;
babelHelpers.temporalUndefined = {};
function _slicedToArray(arr, i) {
return (
babelHelpers.arrayWithHoles(arr) ||
babelHelpers.iterableToArrayLimit(arr, i) ||
babelHelpers.nonIterableRest()
);
}
babelHelpers.slicedToArray = _slicedToArray;
function _slicedToArrayLoose(arr, i) {
return (
babelHelpers.arrayWithHoles(arr) ||
babelHelpers.iterableToArrayLimitLoose(arr, i) ||
babelHelpers.nonIterableRest()
);
}
babelHelpers.slicedToArrayLoose = _slicedToArrayLoose;
function _toArray(arr) {
return (
babelHelpers.arrayWithHoles(arr) ||
babelHelpers.iterableToArray(arr) ||
babelHelpers.nonIterableRest()
);
}
babelHelpers.toArray = _toArray;
function _toConsumableArray(arr) {
return (
babelHelpers.arrayWithoutHoles(arr) ||
babelHelpers.iterableToArray(arr) ||
babelHelpers.nonIterableSpread()
);
}
babelHelpers.toConsumableArray = _toConsumableArray;
function _arrayWithoutHoles(arr) {
if (Array.isArray(arr)) {
for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++)
arr2[i] = arr[i];
return arr2;
}
}
babelHelpers.arrayWithoutHoles = _arrayWithoutHoles;
function _arrayWithHoles(arr) {
if (Array.isArray(arr)) return arr;
}
babelHelpers.arrayWithHoles = _arrayWithHoles;
function _iterableToArray(iter) {
if (
Symbol.iterator in Object(iter) ||
Object.prototype.toString.call(iter) === "[object Arguments]"
)
return Array.from(iter);
}
babelHelpers.iterableToArray = _iterableToArray;
function _iterableToArrayLimit(arr, i) {
var _arr = [];
var _n = true;
var _d = false;
var _e = undefined;
try {
for (
var _i = arr[Symbol.iterator](), _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;
}
babelHelpers.iterableToArrayLimit = _iterableToArrayLimit;
function _iterableToArrayLimitLoose(arr, i) {
var _arr = [];
for (
var _iterator = arr[Symbol.iterator](), _step;
!(_step = _iterator.next()).done;
) {
_arr.push(_step.value);
if (i && _arr.length === i) break;
}
return _arr;
}
babelHelpers.iterableToArrayLimitLoose = _iterableToArrayLimitLoose;
function _nonIterableSpread() {
throw new TypeError("Invalid attempt to spread non-iterable instance");
}
babelHelpers.nonIterableSpread = _nonIterableSpread;
function _nonIterableRest() {
throw new TypeError(
"Invalid attempt to destructure non-iterable instance"
);
}
babelHelpers.nonIterableRest = _nonIterableRest;
function _skipFirstGeneratorNext(fn) {
return function () {
var it = fn.apply(this, arguments);
it.next();
return it;
};
}
babelHelpers.skipFirstGeneratorNext = _skipFirstGeneratorNext;
function _toPropertyKey(key) {
if (typeof key === "symbol") {
return key;
} else {
return String(key);
}
}
babelHelpers.toPropertyKey = _toPropertyKey;
function _initializerWarningHelper(descriptor, context) {
throw new Error(
"Decorating class property failed. Please ensure that " +
"proposal-class-properties is enabled and set to use loose mode. " +
"To use proposal-class-properties in spec mode with decorators, wait for " +
"the next major version of decorators in stage 2."
);
}
babelHelpers.initializerWarningHelper = _initializerWarningHelper;
function _initializerDefineProperty(target, property, descriptor, context) {
if (!descriptor) return;
Object.defineProperty(target, property, {
enumerable: descriptor.enumerable,
configurable: descriptor.configurable,
writable: descriptor.writable,
value: descriptor.initializer
? descriptor.initializer.call(context)
: void 0,
});
}
babelHelpers.initializerDefineProperty = _initializerDefineProperty;
function _applyDecoratedDescriptor(
target,
property,
decorators,
descriptor,
context
) {
var desc = {};
Object["ke" + "ys"](descriptor).forEach(function (key) {
desc[key] = descriptor[key];
});
desc.enumerable = !!desc.enumerable;
desc.configurable = !!desc.configurable;
if ("value" in desc || desc.initializer) {
desc.writable = true;
}
desc = decorators
.slice()
.reverse()
.reduce(function (desc, decorator) {
return decorator(target, property, desc) || desc;
}, desc);
if (context && desc.initializer !== void 0) {
desc.value = desc.initializer ? desc.initializer.call(context) : void 0;
desc.initializer = undefined;
}
if (desc.initializer === void 0) {
Object["define" + "Property"](target, property, desc);
desc = null;
}
return desc;
}
babelHelpers.applyDecoratedDescriptor = _applyDecoratedDescriptor;
var id = 0;
function _classPrivateFieldKey(name) {
return "__private_" + id++ + "_" + name;
}
babelHelpers.classPrivateFieldLooseKey = _classPrivateFieldKey;
function _classPrivateFieldBase(receiver, privateKey) {
if (!Object.prototype.hasOwnProperty.call(receiver, privateKey)) {
throw new TypeError("attempted to use private field on non-instance");
}
return receiver;
}
babelHelpers.classPrivateFieldLooseBase = _classPrivateFieldBase;
function _classPrivateFieldGet(receiver, privateMap) {
if (!privateMap.has(receiver)) {
throw new TypeError("attempted to get private field on non-instance");
}
return privateMap.get(receiver).value;
}
babelHelpers.classPrivateFieldGet = _classPrivateFieldGet;
function _classPrivateFieldSet(receiver, privateMap, value) {
if (!privateMap.has(receiver)) {
throw new TypeError("attempted to set private field on non-instance");
}
var descriptor = privateMap.get(receiver);
if (!descriptor.writable) {
throw new TypeError("attempted to set read only private field");
}
descriptor.value = value;
return value;
}
babelHelpers.classPrivateFieldSet = _classPrivateFieldSet;
})(typeof global === "undefined" ? window : global);
/**
* Copyright (c) 2014-present, Facebook, Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
!(function (global) {
"use strict";
var Op = Object.prototype;
var hasOwn = Op.hasOwnProperty;
var undefined; // More compressible than void 0.
var $Symbol = typeof Symbol === "function" ? Symbol : {};
var iteratorSymbol = $Symbol.iterator || "@@iterator";
var asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator";
var toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
// Define the runtime globally (as expected by generated code) as either
// module.exports (if we're in a module) or a new, empty object.
var runtime = (global.regeneratorRuntime = {});
function wrap(innerFn, outerFn, self, tryLocsList) {
// If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator.
var protoGenerator =
outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;
var generator = Object.create(protoGenerator.prototype);
var context = new Context(tryLocsList || []);
// The ._invoke method unifies the implementations of the .next,
// .throw, and .return methods.
generator._invoke = makeInvokeMethod(innerFn, self, context);
return generator;
}
runtime.wrap = wrap;
// Try/catch helper to minimize deoptimizations. Returns a completion
// record like context.tryEntries[i].completion. This interface could
// have been (and was previously) designed to take a closure to be
// invoked without arguments, but in all the cases we care about we
// already have an existing method we want to call, so there's no need
// to create a new function object. We can even get away with assuming
// the method takes exactly one argument, since that happens to be true
// in every case, so we don't have to touch the arguments object. The
// only additional allocation required is the completion record, which
// has a stable shape and so hopefully should be cheap to allocate.
function tryCatch(fn, obj, arg) {
try {
return { type: "normal", arg: fn.call(obj, arg) };
} catch (err) {
return { type: "throw", arg: err };
}
}
var GenStateSuspendedStart = "suspendedStart";
var GenStateSuspendedYield = "suspendedYield";
var GenStateExecuting = "executing";
var GenStateCompleted = "completed";
// Returning this object from the innerFn has the same effect as
// breaking out of the dispatch switch statement.
var ContinueSentinel = {};
// Dummy constructor functions that we use as the .constructor and
// .constructor.prototype properties for functions that return Generator
// objects. For full spec compliance, you may wish to configure your
// minifier not to mangle the names of these two functions.
function Generator() {}
function GeneratorFunction() {}
function GeneratorFunctionPrototype() {}
// This is a polyfill for %IteratorPrototype% for environments that
// don't natively support it.
var IteratorPrototype = {};
IteratorPrototype[iteratorSymbol] = function () {
return this;
};
var getProto = Object.getPrototypeOf;
var NativeIteratorPrototype = getProto && getProto(getProto(values([])));
if (
NativeIteratorPrototype &&
NativeIteratorPrototype !== Op &&
hasOwn.call(NativeIteratorPrototype, iteratorSymbol)
) {
// This environment has a native %IteratorPrototype%; use it instead
// of the polyfill.
IteratorPrototype = NativeIteratorPrototype;
}
var Gp =
(GeneratorFunctionPrototype.prototype =
Generator.prototype =
Object.create(IteratorPrototype));
GeneratorFunction.prototype = Gp.constructor = GeneratorFunctionPrototype;
GeneratorFunctionPrototype.constructor = GeneratorFunction;
GeneratorFunctionPrototype[toStringTagSymbol] =
GeneratorFunction.displayName = "GeneratorFunction";
// Helper for defining the .next, .throw, and .return methods of the
// Iterator interface in terms of a single ._invoke method.
function defineIteratorMethods(prototype) {
["next", "throw", "return"].forEach(function (method) {
prototype[method] = function (arg) {
return this._invoke(method, arg);
};
});
}
runtime.isGeneratorFunction = function (genFun) {
var ctor = typeof genFun === "function" && genFun.constructor;
return ctor
? ctor === GeneratorFunction ||
// For the native GeneratorFunction constructor, the best we can
// do is to check its .name property.
(ctor.displayName || ctor.name) === "GeneratorFunction"
: false;
};
runtime.mark = function (genFun) {
if (Object.setPrototypeOf) {
Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);
} else {
genFun.__proto__ = GeneratorFunctionPrototype;
if (!(toStringTagSymbol in genFun)) {
genFun[toStringTagSymbol] = "GeneratorFunction";
}
}
genFun.prototype = Object.create(Gp);
return genFun;
};
// Within the body of any async function, `await x` is transformed to
// `yield regeneratorRuntime.awrap(x)`, so that the runtime can test
// `hasOwn.call(value, "__await")` to determine if the yielded value is
// meant to be awaited.
runtime.awrap = function (arg) {
return { __await: arg };
};
function AsyncIterator(generator) {
function invoke(method, arg, resolve, reject) {
var record = tryCatch(generator[method], generator, arg);
if (record.type === "throw") {
reject(record.arg);
} else {
var result = record.arg;
var value = result.value;
if (
value &&
typeof value === "object" &&
hasOwn.call(value, "__await")
) {
return Promise.resolve(value.__await).then(
function (value) {
invoke("next", value, resolve, reject);
},
function (err) {
invoke("throw", err, resolve, reject);
}
);
}
return Promise.resolve(value).then(function (unwrapped) {
// When a yielded Promise is resolved, its final value becomes
// the .value of the Promise<{value,done}> result for the
// current iteration. If the Promise is rejected, however, the
// result for this iteration will be rejected with the same
// reason. Note that rejections of yielded Promises are not
// thrown back into the generator function, as is the case
// when an awaited Promise is rejected. This difference in
// behavior between yield and await is important, because it
// allows the consumer to decide what to do with the yielded
// rejection (swallow it and continue, manually .throw it back
// into the generator, abandon iteration, whatever). With
// await, by contrast, there is no opportunity to examine the
// rejection reason outside the generator function, so the
// only option is to throw it from the await expression, and
// let the generator function handle the exception.
result.value = unwrapped;
resolve(result);
}, reject);
}
}
var previousPromise;
function enqueue(method, arg) {
function callInvokeWithMethodAndArg() {
return new Promise(function (resolve, reject) {
invoke(method, arg, resolve, reject);
});
}
return (previousPromise =
// If enqueue has been called before, then we want to wait until
// all previous Promises have been resolved before calling invoke,
// so that results are always delivered in the correct order. If
// enqueue has not been called before, then it is important to
// call invoke immediately, without waiting on a callback to fire,
// so that the async generator function has the opportunity to do
// any necessary setup in a predictable way. This predictability
// is why the Promise constructor synchronously invokes its
// executor callback, and why async functions synchronously
// execute code before the first await. Since we implement simple
// async functions in terms of async generators, it is especially
// important to get this right, even though it requires care.
previousPromise
? previousPromise.then(
callInvokeWithMethodAndArg,
// Avoid propagating failures to Promises returned by later
// invocations of the iterator.
callInvokeWithMethodAndArg
)
: callInvokeWithMethodAndArg());
}
// Define the unified helper method that is used to implement .next,
// .throw, and .return (see defineIteratorMethods).
this._invoke = enqueue;
}
defineIteratorMethods(AsyncIterator.prototype);
AsyncIterator.prototype[asyncIteratorSymbol] = function () {
return this;
};
runtime.AsyncIterator = AsyncIterator;
// Note that simple async functions are implemented on top of
// AsyncIterator objects; they just return a Promise for the value of
// the final result produced by the iterator.
runtime.async = function (innerFn, outerFn, self, tryLocsList) {
var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList));
return runtime.isGeneratorFunction(outerFn)
? iter // If outerFn is a generator, return the full iterator.
: iter.next().then(function (result) {
return result.done ? result.value : iter.next();
});
};
function makeInvokeMethod(innerFn, self, context) {
var state = GenStateSuspendedStart;
return function invoke(method, arg) {
if (state === GenStateExecuting) {
throw new Error("Generator is already running");
}
if (state === GenStateCompleted) {
if (method === "throw") {
throw arg;
}
// Be forgiving, per 25.3.3.3.3 of the spec:
// https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume
return doneResult();
}
context.method = method;
context.arg = arg;
while (true) {
var delegate = context.delegate;
if (delegate) {
var delegateResult = maybeInvokeDelegate(delegate, context);
if (delegateResult) {
if (delegateResult === ContinueSentinel) continue;
return delegateResult;
}
}
if (context.method === "next") {
// Setting context._sent for legacy support of Babel's
// function.sent implementation.
context.sent = context._sent = context.arg;
} else if (context.method === "throw") {
if (state === GenStateSuspendedStart) {
state = GenStateCompleted;
throw context.arg;
}
context.dispatchException(context.arg);
} else if (context.method === "return") {
context.abrupt("return", context.arg);
}
state = GenStateExecuting;
var record = tryCatch(innerFn, self, context);
if (record.type === "normal") {
// If an exception is thrown from innerFn, we leave state ===
// GenStateExecuting and loop back for another invocation.
state = context.done ? GenStateCompleted : GenStateSuspendedYield;
if (record.arg === ContinueSentinel) {
continue;
}
return {
value: record.arg,
done: context.done,
};
} else if (record.type === "throw") {
state = GenStateCompleted;
// Dispatch the exception by looping back around to the
// context.dispatchException(context.arg) call above.
context.method = "throw";
context.arg = record.arg;
}
}
};
}
// Call delegate.iterator[context.method](context.arg) and handle the
// result, either by returning a { value, done } result from the
// delegate iterator, or by modifying context.method and context.arg,
// setting context.delegate to null, and returning the ContinueSentinel.
function maybeInvokeDelegate(delegate, context) {
var method = delegate.iterator[context.method];
if (method === undefined) {
// A .throw or .return when the delegate iterator has no .throw
// method always terminates the yield* loop.
context.delegate = null;
if (context.method === "throw") {
if (delegate.iterator.return) {
// If the delegate iterator has a return method, give it a
// chance to clean up.
context.method = "return";
context.arg = undefined;
maybeInvokeDelegate(delegate, context);
if (context.method === "throw") {
// If maybeInvokeDelegate(context) changed context.method from
// "return" to "throw", let that override the TypeError below.
return ContinueSentinel;
}
}
context.method = "throw";
context.arg = new TypeError(
"The iterator does not provide a 'throw' method"
);
}
return ContinueSentinel;
}
var record = tryCatch(method, delegate.iterator, context.arg);
if (record.type === "throw") {
context.method = "throw";
context.arg = record.arg;
context.delegate = null;
return ContinueSentinel;
}
var info = record.arg;
if (!info) {
context.method = "throw";
context.arg = new TypeError("iterator result is not an object");
context.delegate = null;
return ContinueSentinel;
}
if (info.done) {
// Assign the result of the finished delegate to the temporary
// variable specified by delegate.resultName (see delegateYield).
context[delegate.resultName] = info.value;
// Resume execution at the desired location (see delegateYield).
context.next = delegate.nextLoc;
// If context.method was "throw" but the delegate handled the
// exception, let the outer generator proceed normally. If
// context.method was "next", forget context.arg since it has been
// "consumed" by the delegate iterator. If context.method was
// "return", allow the original .return call to continue in the
// outer generator.
if (context.method !== "return") {
context.method = "next";
context.arg = undefined;
}
} else {
// Re-yield the result returned by the delegate method.
return info;
}
// The delegate iterator is finished, so forget it and continue with
// the outer generator.
context.delegate = null;
return ContinueSentinel;
}
// Define Generator.prototype.{next,throw,return} in terms of the
// unified ._invoke helper method.
defineIteratorMethods(Gp);
Gp[toStringTagSymbol] = "Generator";
// A Generator should always return itself as the iterator object when the
// @@iterator function is called on it. Some browsers' implementations of the
// iterator prototype chain incorrectly implement this, causing the Generator
// object to not be returned from this call. This ensures that doesn't happen.
// See https://github.com/facebook/regenerator/issues/274 for more details.
Gp[iteratorSymbol] = function () {
return this;
};
Gp.toString = function () {
return "[object Generator]";
};
function pushTryEntry(locs) {
var entry = { tryLoc: locs[0] };
if (1 in locs) {
entry.catchLoc = locs[1];
}
if (2 in locs) {
entry.finallyLoc = locs[2];
entry.afterLoc = locs[3];
}
this.tryEntries.push(entry);
}
function resetTryEntry(entry) {
var record = entry.completion || {};
record.type = "normal";
delete record.arg;
entry.completion = record;
}
function Context(tryLocsList) {
// The root entry object (effectively a try statement without a catch
// or a finally block) gives us a place to store values thrown from
// locations where there is no enclosing try statement.
this.tryEntries = [{ tryLoc: "root" }];
tryLocsList.forEach(pushTryEntry, this);
this.reset(true);
}
runtime.keys = function (object) {
var keys = [];
for (var key in object) {
keys.push(key);
}
keys.reverse();
// Rather than returning an object with a next method, we keep
// things simple and return the next function itself.
return function next() {
while (keys.length) {
var key = keys.pop();
if (key in object) {
next.value = key;
next.done = false;
return next;
}
}
// To avoid creating an additional object, we just hang the .value
// and .done properties off the next function object itself. This
// also ensures that the minifier will not anonymize the function.
next.done = true;
return next;
};
};
function values(iterable) {
if (iterable) {
var iteratorMethod = iterable[iteratorSymbol];
if (iteratorMethod) {
return iteratorMethod.call(iterable);
}
if (typeof iterable.next === "function") {
return iterable;
}
if (!isNaN(iterable.length)) {
var i = -1,
next = function next() {
while (++i < iterable.length) {
if (hasOwn.call(iterable, i)) {
next.value = iterable[i];
next.done = false;
return next;
}
}
next.value = undefined;
next.done = true;
return next;
};
return (next.next = next);
}
}
// Return an iterator with no values.
return { next: doneResult };
}
runtime.values = values;
function doneResult() {
return { value: undefined, done: true };
}
Context.prototype = {
constructor: Context,
reset: function (skipTempReset) {
this.prev = 0;
this.next = 0;
// Resetting context._sent for legacy support of Babel's
// function.sent implementation.
this.sent = this._sent = undefined;
this.done = false;
this.delegate = null;
this.method = "next";
this.arg = undefined;
this.tryEntries.forEach(resetTryEntry);
if (!skipTempReset) {
for (var name in this) {
// Not sure about the optimal order of these conditions:
if (
name.charAt(0) === "t" &&
hasOwn.call(this, name) &&
!isNaN(+name.slice(1))
) {
this[name] = undefined;
}
}
}
},
stop: function () {
this.done = true;
var rootEntry = this.tryEntries[0];
var rootRecord = rootEntry.completion;
if (rootRecord.type === "throw") {
throw rootRecord.arg;
}
return this.rval;
},
dispatchException: function (exception) {
if (this.done) {
throw exception;
}
var context = this;
function handle(loc, caught) {
record.type = "throw";
record.arg = exception;
context.next = loc;
if (caught) {
// If the dispatched exception was caught by a catch block,
// then let that catch block handle the exception normally.
context.method = "next";
context.arg = undefined;
}
return !!caught;
}
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
var entry = this.tryEntries[i];
var record = entry.completion;
if (entry.tryLoc === "root") {
// Exception thrown outside of any try block that could handle
// it, so set the completion value of the entire function to
// throw the exception.
return handle("end");
}
if (entry.tryLoc <= this.prev) {
var hasCatch = hasOwn.call(entry, "catchLoc");
var hasFinally = hasOwn.call(entry, "finallyLoc");
if (hasCatch && hasFinally) {
if (this.prev < entry.catchLoc) {
return handle(entry.catchLoc, true);
} else if (this.prev < entry.finallyLoc) {
return handle(entry.finallyLoc);
}
} else if (hasCatch) {
if (this.prev < entry.catchLoc) {
return handle(entry.catchLoc, true);
}
} else if (hasFinally) {
if (this.prev < entry.finallyLoc) {
return handle(entry.finallyLoc);
}
} else {
throw new Error("try statement without catch or finally");
}
}
}
},
abrupt: function (type, arg) {
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
var entry = this.tryEntries[i];
if (
entry.tryLoc <= this.prev &&
hasOwn.call(entry, "finallyLoc") &&
this.prev < entry.finallyLoc
) {
var finallyEntry = entry;
break;
}
}
if (
finallyEntry &&
(type === "break" || type === "continue") &&
finallyEntry.tryLoc <= arg &&
arg <= finallyEntry.finallyLoc
) {
// Ignore the finally entry if control is not jumping to a
// location outside the try/catch block.
finallyEntry = null;
}
var record = finallyEntry ? finallyEntry.completion : {};
record.type = type;
record.arg = arg;
if (finallyEntry) {
this.method = "next";
this.next = finallyEntry.finallyLoc;
return ContinueSentinel;
}
return this.complete(record);
},
complete: function (record, afterLoc) {
if (record.type === "throw") {
throw record.arg;
}
if (record.type === "break" || record.type === "continue") {
this.next = record.arg;
} else if (record.type === "return") {
this.rval = this.arg = record.arg;
this.method = "return";
this.next = "end";
} else if (record.type === "normal" && afterLoc) {
this.next = afterLoc;
}
return ContinueSentinel;
},
finish: function (finallyLoc) {
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
var entry = this.tryEntries[i];
if (entry.finallyLoc === finallyLoc) {
this.complete(entry.completion, entry.afterLoc);
resetTryEntry(entry);
return ContinueSentinel;
}
}
},
catch: function (tryLoc) {
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
var entry = this.tryEntries[i];
if (entry.tryLoc === tryLoc) {
var record = entry.completion;
if (record.type === "throw") {
var thrown = record.arg;
resetTryEntry(entry);
}
return thrown;
}
}
// The context.catch method must only be called with a location
// argument that corresponds to a known catch block.
throw new Error("illegal catch attempt");
},
delegateYield: function (iterable, resultName, nextLoc) {
this.delegate = {
iterator: values(iterable),
resultName: resultName,
nextLoc: nextLoc,
};
if (this.method === "next") {
// Deliberately forget the last sent value so that we don't
// accidentally pass it on to the delegate.
this.arg = undefined;
}
return ContinueSentinel;
},
};
})(
// In sloppy mode, unbound `this` refers to the global object, fallback to
// Function constructor if we're in global strict mode. That is sadly a form
// of indirect eval which violates Content Security Policy.
(function () {
return this;
})() || Function("return this")()
);
(function (exports) {
"use strict";
var commonjsGlobal =
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 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 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 fails = function (exec) {
try {
return !!exec();
} catch (error) {
return true;
}
};
// Detect IE8's incomplete defineProperty implementation
var descriptors = !fails(function () {
// eslint-disable-next-line es/no-object-defineproperty -- required for testing
return (
Object.defineProperty({}, 1, {
get: function () {
return 7;
},
})[1] != 7
);
});
var call = Function.prototype.call;
var functionCall = call.bind
? call.bind(call)
: function () {
return call.apply(call, arguments);
};
var $propertyIsEnumerable = {}.propertyIsEnumerable; // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor; // Nashorn ~ JDK8 bug
var NASHORN_BUG =
getOwnPropertyDescriptor &&
!$propertyIsEnumerable.call(
{
1: 2,
},
1
); // `Object.prototype.propertyIsEnumerable` method implementation
// https://tc39.es/ecma262/#sec-object.prototype.propertyisenumerable
var f = NASHORN_BUG
? function propertyIsEnumerable(V) {
var descriptor = getOwnPropertyDescriptor(this, V);
return !!descriptor && descriptor.enumerable;
}
: $propertyIsEnumerable;
var objectPropertyIsEnumerable = {
f: f,
};
var createPropertyDescriptor = function (bitmap, value) {
return {
enumerable: !(bitmap & 1),
configurable: !(bitmap & 2),
writable: !(bitmap & 4),
value: value,
};
};
var FunctionPrototype = Function.prototype;
var bind = FunctionPrototype.bind;
var call$1 = FunctionPrototype.call;
var callBind = bind && bind.bind(call$1);
var functionUncurryThis = bind
? function (fn) {
return fn && callBind(call$1, fn);
}
: function (fn) {
return (
fn &&
function () {
return call$1.apply(fn, arguments);
}
);
};
var toString = functionUncurryThis({}.toString);
var stringSlice = functionUncurryThis("".slice);
var classofRaw = function (it) {
return stringSlice(toString(it), 8, -1);
};
var Object$1 = global_1.Object;
var split = functionUncurryThis("".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 -- safe
return !Object$1("z").propertyIsEnumerable(0);
})
? function (it) {
return classofRaw(it) == "String" ? split(it, "") : Object$1(it);
}
: Object$1;
var TypeError$1 = global_1.TypeError; // `RequireObjectCoercible` abstract operation
// https://tc39.es/ecma262/#sec-requireobjectcoercible
var requireObjectCoercible = function (it) {
if (it == undefined) throw TypeError$1("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));
};
// `IsCallable` abstract operation
// https://tc39.es/ecma262/#sec-iscallable
var isCallable = function (argument) {
return typeof argument == "function";
};
var isObject = function (it) {
return typeof it == "object" ? it !== null : isCallable(it);
};
var aFunction = function (argument) {
return isCallable(argument) ? argument : undefined;
};
var getBuiltIn = function (namespace, method) {
return arguments.length < 2
? aFunction(global_1[namespace])
: global_1[namespace] && global_1[namespace][method];
};
var objectIsPrototypeOf = functionUncurryThis({}.isPrototypeOf);
var engineUserAgent = getBuiltIn("navigator", "userAgent") || "";
var process = global_1.process;
var Deno = global_1.Deno;
var versions = (process && process.versions) || (Deno && Deno.version);
var v8 = versions && versions.v8;
var match, version;
if (v8) {
match = v8.split("."); // in old Chrome, versions of V8 isn't V8 = Chrome / 10
// but their correct versions are not interesting for us
version = match[0] > 0 && match[0] < 4 ? 1 : +(match[0] + match[1]);
} // BrowserFS NodeJS `process` polyfill incorrectly set `.v8` to `0.0`
// so check `userAgent` even if `.v8` exists, but 0
if (!version && engineUserAgent) {
match = engineUserAgent.match(/Edge\/(\d+)/);
if (!match || match[1] >= 74) {
match = engineUserAgent.match(/Chrome\/(\d+)/);
if (match) version = +match[1];
}
}
var engineV8Version = version;
/* eslint-disable es/no-symbol -- required for testing */
// eslint-disable-next-line es/no-object-getownpropertysymbols -- required for testing
var nativeSymbol =
!!Object.getOwnPropertySymbols &&
!fails(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 && engineV8Version && engineV8Version < 41)
);
});
/* eslint-disable es/no-symbol -- required for testing */
var useSymbolAsUid =
nativeSymbol && !Symbol.sham && typeof Symbol.iterator == "symbol";
var Object$2 = global_1.Object;
var isSymbol = useSymbolAsUid
? function (it) {
return typeof it == "symbol";
}
: function (it) {
var $Symbol = getBuiltIn("Symbol");
return (
isCallable($Symbol) &&
objectIsPrototypeOf($Symbol.prototype, Object$2(it))
);
};
var String$1 = global_1.String;
var tryToString = function (argument) {
try {
return String$1(argument);
} catch (error) {
return "Object";
}
};
var TypeError$2 = global_1.TypeError; // `Assert: IsCallable(argument) is true`
var aCallable = function (argument) {
if (isCallable(argument)) return argument;
throw TypeError$2(tryToString(argument) + " is not a function");
};
// `GetMethod` abstract operation
// https://tc39.es/ecma262/#sec-getmethod
var getMethod = function (V, P) {
var func = V[P];
return func == null ? undefined : aCallable(func);
};
var TypeError$3 = global_1.TypeError; // `OrdinaryToPrimitive` abstract operation
// https://tc39.es/ecma262/#sec-ordinarytoprimitive
var ordinaryToPrimitive = function (input, pref) {
var fn, val;
if (
pref === "string" &&
isCallable((fn = input.toString)) &&
!isObject((val = functionCall(fn, input)))
)
return val;
if (
isCallable((fn = input.valueOf)) &&
!isObject((val = functionCall(fn, input)))
)
return val;
if (
pref !== "string" &&
isCallable((fn = input.toString)) &&
!isObject((val = functionCall(fn, input)))
)
return val;
throw TypeError$3("Can't convert object to primitive value");
};
var isPure = false;
// eslint-disable-next-line es/no-object-defineproperty -- safe
var defineProperty = Object.defineProperty;
var setGlobal = function (key, value) {
try {
defineProperty(global_1, key, {
value: value,
configurable: true,
writable: true,
});
} catch (error) {
global_1[key] = value;
}
return value;
};
var SHARED = "__core-js_shared__";
var store = global_1[SHARED] || setGlobal(SHARED, {});
var sharedStore = store;
var shared = createCommonjsModule(function (module) {
(module.exports = function (key, value) {
return (
sharedStore[key] ||
(sharedStore[key] = value !== undefined ? value : {})
);
})("versions", []).push({
version: "3.19.2",
mode: "global",
copyright: "(c) 2021 Denis Pushkarev (zloirock.ru)",
});
});
var Object$3 = global_1.Object; // `ToObject` abstract operation
// https://tc39.es/ecma262/#sec-toobject
var toObject = function (argument) {
return Object$3(requireObjectCoercible(argument));
};
var hasOwnProperty = functionUncurryThis({}.hasOwnProperty); // `HasOwnProperty` abstract operation
// https://tc39.es/ecma262/#sec-hasownproperty
var hasOwnProperty_1 =
Object.hasOwn ||
function hasOwn(it, key) {
return hasOwnProperty(toObject(it), key);
};
var id = 0;
var postfix = Math.random();
var toString$1 = functionUncurryThis((1.0).toString);
var uid = function (key) {
return (
"Symbol(" +
(key === undefined ? "" : key) +
")_" +
toString$1(++id + postfix, 36)
);
};
var WellKnownSymbolsStore = shared("wks");
var Symbol$1 = global_1.Symbol;
var symbolFor = Symbol$1 && Symbol$1["for"];
var createWellKnownSymbol = useSymbolAsUid
? Symbol$1
: (Symbol$1 && Symbol$1.withoutSetter) || uid;
var wellKnownSymbol = function (name) {
if (
!hasOwnProperty_1(WellKnownSymbolsStore, name) ||
!(nativeSymbol || typeof WellKnownSymbolsStore[name] == "string")
) {
var description = "Symbol." + name;
if (nativeSymbol && hasOwnProperty_1(Symbol$1, name)) {
WellKnownSymbolsStore[name] = Symbol$1[name];
} else if (useSymbolAsUid && symbolFor) {
WellKnownSymbolsStore[name] = symbolFor(description);
} else {
WellKnownSymbolsStore[name] = createWellKnownSymbol(description);
}
}
return WellKnownSymbolsStore[name];
};
var TypeError$4 = global_1.TypeError;
var TO_PRIMITIVE = wellKnownSymbol("toPrimitive"); // `ToPrimitive` abstract operation
// https://tc39.es/ecma262/#sec-toprimitive
var toPrimitive = function (input, pref) {
if (!isObject(input) || isSymbol(input)) return input;
var exoticToPrim = getMethod(input, TO_PRIMITIVE);
var result;
if (exoticToPrim) {
if (pref === undefined) pref = "default";
result = functionCall(exoticToPrim, input, pref);
if (!isObject(result) || isSymbol(result)) return result;
throw TypeError$4("Can't convert object to primitive value");
}
if (pref === undefined) pref = "number";
return ordinaryToPrimitive(input, pref);
};
// `ToPropertyKey` abstract operation
// https://tc39.es/ecma262/#sec-topropertykey
var toPropertyKey = function (argument) {
var key = toPrimitive(argument, "string");
return isSymbol(key) ? key : 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 () {
// eslint-disable-next-line es/no-object-defineproperty -- requied for testing
return (
Object.defineProperty(documentCreateElement("div"), "a", {
get: function () {
return 7;
},
}).a != 7
);
});
// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
var $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor; // `Object.getOwnPropertyDescriptor` method
// https://tc39.es/ecma262/#sec-object.getownpropertydescriptor
var f$1 = descriptors
? $getOwnPropertyDescriptor
: function getOwnPropertyDescriptor(O, P) {
O = toIndexedObject(O);
P = toPropertyKey(P);
if (ie8DomDefine)
try {
return $getOwnPropertyDescriptor(O, P);
} catch (error) {
/* empty */
}
if (hasOwnProperty_1(O, P))
return createPropertyDescriptor(
!functionCall(objectPropertyIsEnumerable.f, O, P),
O[P]
);
};
var objectGetOwnPropertyDescriptor = {
f: f$1,
};
var String$2 = global_1.String;
var TypeError$5 = global_1.TypeError; // `Assert: Type(argument) is Object`
var anObject = function (argument) {
if (isObject(argument)) return argument;
throw TypeError$5(String$2(argument) + " is not an object");
};
var TypeError$6 = global_1.TypeError; // eslint-disable-next-line es/no-object-defineproperty -- safe
var $defineProperty = Object.defineProperty; // `Object.defineProperty` method
// https://tc39.es/ecma262/#sec-object.defineproperty
var f$2 = descriptors
? $defineProperty
: function defineProperty(O, P, Attributes) {
anObject(O);
P = toPropertyKey(P);
anObject(Attributes);
if (ie8DomDefine)
try {
return $defineProperty(O, P, Attributes);
} catch (error) {
/* empty */
}
if ("get" in Attributes || "set" in Attributes)
throw TypeError$6("Accessors not supported");
if ("value" in Attributes) O[P] = Attributes.value;
return O;
};
var objectDefineProperty = {
f: f$2,
};
var createNonEnumerableProperty = descriptors
? function (object, key, value) {
return objectDefineProperty.f(
object,
key,
createPropertyDescriptor(1, value)
);
}
: function (object, key, value) {
object[key] = value;
return object;
};
var functionToString = functionUncurryThis(Function.toString); // this helper broken in `core-js@3.4.1-3.4.4`, so we can't use `shared` helper
if (!isCallable(sharedStore.inspectSource)) {
sharedStore.inspectSource = function (it) {
return functionToString(it);
};
}
var inspectSource = sharedStore.inspectSource;
var WeakMap = global_1.WeakMap;
var nativeWeakMap =
isCallable(WeakMap) && /native code/.test(inspectSource(WeakMap));
var keys = shared("keys");
var sharedKey = function (key) {
return keys[key] || (keys[key] = uid(key));
};
var hiddenKeys = {};
var OBJECT_ALREADY_INITIALIZED = "Object already initialized";
var TypeError$7 = global_1.TypeError;
var WeakMap$1 = global_1.WeakMap;
var set, get, has;
var enforce = function (it) {
return has(it) ? get(it) : set(it, {});
};
var getterFor = function (TYPE) {
return function (it) {
var state;
if (!isObject(it) || (state = get(it)).type !== TYPE) {
throw TypeError$7("Incompatible receiver, " + TYPE + " required");
}
return state;
};
};
if (nativeWeakMap || sharedStore.state) {
var store$1 = sharedStore.state || (sharedStore.state = new WeakMap$1());
var wmget = functionUncurryThis(store$1.get);
var wmhas = functionUncurryThis(store$1.has);
var wmset = functionUncurryThis(store$1.set);
set = function (it, metadata) {
if (wmhas(store$1, it))
throw new TypeError$7(OBJECT_ALREADY_INITIALIZED);
metadata.facade = it;
wmset(store$1, it, metadata);
return metadata;
};
get = function (it) {
return wmget(store$1, it) || {};
};
has = function (it) {
return wmhas(store$1, it);
};
} else {
var STATE = sharedKey("state");
hiddenKeys[STATE] = true;
set = function (it, metadata) {
if (hasOwnProperty_1(it, STATE))
throw new TypeError$7(OBJECT_ALREADY_INITIALIZED);
metadata.facade = it;
createNonEnumerableProperty(it, STATE, metadata);
return metadata;
};
get = function (it) {
return hasOwnProperty_1(it, STATE) ? it[STATE] : {};
};
has = function (it) {
return hasOwnProperty_1(it, STATE);
};
}
var internalState = {
set: set,
get: get,
has: has,
enforce: enforce,
getterFor: getterFor,
};
var FunctionPrototype$1 = Function.prototype; // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
var getDescriptor = descriptors && Object.getOwnPropertyDescriptor;
var EXISTS$1 = hasOwnProperty_1(FunctionPrototype$1, "name"); // additional protection from minified / mangled / dropped function names
var PROPER =
EXISTS$1 &&
function something() {
/* empty */
}.name === "something";
var CONFIGURABLE =
EXISTS$1 &&
(!descriptors ||
(descriptors &&
getDescriptor(FunctionPrototype$1, "name").configurable));
var functionName = {
EXISTS: EXISTS$1,
PROPER: PROPER,
CONFIGURABLE: CONFIGURABLE,
};
var redefine = createCommonjsModule(function (module) {
var CONFIGURABLE_FUNCTION_NAME = functionName.CONFIGURABLE;
var getInternalState = internalState.get;
var enforceInternalState = internalState.enforce;
var TEMPLATE = String(String).split("String");
(module.exports = function (O, key, value, options) {
var unsafe = options ? !!options.unsafe : false;
var simple = options ? !!options.enumerable : false;
var noTargetGet = options ? !!options.noTargetGet : false;
var name = options && options.name !== undefined ? options.name : key;
var state;
if (isCallable(value)) {
if (String(name).slice(0, 7) === "Symbol(") {
name = "[" + String(name).replace(/^Symbol\(([^)]*)\)/, "$1") + "]";
}
if (
!hasOwnProperty_1(value, "name") ||
(CONFIGURABLE_FUNCTION_NAME && value.name !== name)
) {
createNonEnumerableProperty(value, "name", name);
}
state = enforceInternalState(value);
if (!state.source) {
state.source = TEMPLATE.join(typeof name == "string" ? name : "");
}
}
if (O === global_1) {
if (simple) O[key] = value;
else setGlobal(key, value);
return;
} else if (!unsafe) {
delete O[key];
} else if (!noTargetGet && O[key]) {
simple = true;
}
if (simple) O[key] = value;
else createNonEnumerableProperty(O, key, value); // add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative
})(Function.prototype, "toString", function toString() {
return (
(isCallable(this) && getInternalState(this).source) ||
inspectSource(this)
);
});
});
var ceil = Math.ceil;
var floor = Math.floor; // `ToIntegerOrInfinity` abstract operation
// https://tc39.es/ecma262/#sec-tointegerorinfinity
var toIntegerOrInfinity = function (argument) {
var number = +argument; // eslint-disable-next-line no-self-compare -- safe
return number !== number || number === 0
? 0
: (number > 0 ? floor : ceil)(number);
};
var max = Math.max;
var min = 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 = function (index, length) {
var integer = toIntegerOrInfinity(index);
return integer < 0 ? max(integer + length, 0) : min(integer, length);
};
var min$1 = Math.min; // `ToLength` abstract operation
// https://tc39.es/ecma262/#sec-tolength
var toLength = function (argument) {
return argument > 0
? min$1(toIntegerOrInfinity(argument), 0x1fffffffffffff)
: 0; // 2 ** 53 - 1 == 9007199254740991
};
// `LengthOfArrayLike` abstract operation
// https://tc39.es/ecma262/#sec-lengthofarraylike
var lengthOfArrayLike = function (obj) {
return toLength(obj.length);
};
// `Array.prototype.{ indexOf, includes }` methods implementation
var createMethod = function (IS_INCLUDES) {
return function ($this, el, fromIndex) {
var O = toIndexedObject($this);
var length = lengthOfArrayLike(O);
var index = toAbsoluteIndex(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 = {
// `Array.prototype.includes` method
// https://tc39.es/ecma262/#sec-array.prototype.includes
includes: createMethod(true),
// `Array.prototype.indexOf` method
// https://tc39.es/ecma262/#sec-array.prototype.indexof
indexOf: createMethod(false),
};
var indexOf = arrayIncludes.indexOf;
var push = functionUncurryThis([].push);
var objectKeysInternal = function (object, names) {
var O = toIndexedObject(object);
var i = 0;
var result = [];
var key;
for (key in O)
!hasOwnProperty_1(hiddenKeys, key) &&
hasOwnProperty_1(O, key) &&
push(result, key); // Don't enum bug & hidden keys
while (names.length > i)
if (hasOwnProperty_1(O, (key = names[i++]))) {
~indexOf(result, key) || push(result, key);
}
return result;
};
// IE8- don't enum bug keys
var enumBugKeys = [
"constructor",
"hasOwnProperty",
"isPrototypeOf",
"propertyIsEnumerable",
"toLocaleString",
"toString",
"valueOf",
];
var hiddenKeys$1 = enumBugKeys.concat("length", "prototype"); // `Object.getOwnPropertyNames` method
// https://tc39.es/ecma262/#sec-object.getownpropertynames
// eslint-disable-next-line es/no-object-getownpropertynames -- safe
var f$3 =
Object.getOwnPropertyNames ||
function getOwnPropertyNames(O) {
return objectKeysInternal(O, hiddenKeys$1);
};
var objectGetOwnPropertyNames = {
f: f$3,
};
// eslint-disable-next-line es/no-object-getownpropertysymbols -- safe
var f$4 = Object.getOwnPropertySymbols;
var objectGetOwnPropertySymbols = {
f: f$4,
};
var concat = functionUncurryThis([].concat); // 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
? concat(keys, getOwnPropertySymbols(it))
: keys;
};
var copyConstructorProperties = function (target, source) {
var keys = ownKeys(source);
var defineProperty = objectDefineProperty.f;
var getOwnPropertyDescriptor = objectGetOwnPropertyDescriptor.f;
for (var i = 0; i < keys.length; i++) {
var key = keys[i];
if (!hasOwnProperty_1(target, key))
defineProperty(target, key, getOwnPropertyDescriptor(source, key));
}
};
var replacement = /#|\.prototype\./;
var isForced = function (feature, detection) {
var value = data[normalize(feature)];
return value == POLYFILL
? true
: value == NATIVE
? false
: isCallable(detection)
? 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 getOwnPropertyDescriptor$1 = objectGetOwnPropertyDescriptor.f;
/*
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
options.name - the .name of the function if it does not match the key
*/
var _export = function (options, source) {
var TARGET = options.target;
var GLOBAL = options.global;
var STATIC = options.stat;
var FORCED, target, key, targetProperty, sourceProperty, descriptor;
if (GLOBAL) {
target = global_1;
} else if (STATIC) {
target = global_1[TARGET] || setGlobal(TARGET, {});
} else {
target = (global_1[TARGET] || {}).prototype;
}
if (target)
for (key in source) {
sourceProperty = source[key];
if (options.noTargetGet) {
descriptor = getOwnPropertyDescriptor$1(target, key);
targetProperty = descriptor && descriptor.value;
} else targetProperty = target[key];
FORCED = isForced_1(
GLOBAL ? key : TARGET + (STATIC ? "." : "#") + key,
options.forced
); // contained in target
if (!FORCED && targetProperty !== undefined) {
if (typeof sourceProperty == typeof targetProperty) continue;
copyConstructorProperties(sourceProperty, targetProperty);
} // add a flag to not completely full polyfills
if (options.sham || (targetProperty && targetProperty.sham)) {
createNonEnumerableProperty(sourceProperty, "sham", true);
} // extend global
redefine(target, key, sourceProperty, options);
}
};
var correctPrototypeGetter = !fails(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 IE_PROTO = sharedKey("IE_PROTO");
var Object$4 = global_1.Object;
var ObjectPrototype = Object$4.prototype; // `Object.getPrototypeOf` method
// https://tc39.es/ecma262/#sec-object.getprototypeof
var objectGetPrototypeOf = correctPrototypeGetter
? Object$4.getPrototypeOf
: function (O) {
var object = toObject(O);
if (hasOwnProperty_1(object, IE_PROTO)) return object[IE_PROTO];
var constructor = object.constructor;
if (isCallable(constructor) && object instanceof constructor) {
return constructor.prototype;
}
return object instanceof Object$4 ? ObjectPrototype : null;
};
var String$3 = global_1.String;
var TypeError$8 = global_1.TypeError;
var aPossiblePrototype = function (argument) {
if (typeof argument == "object" || isCallable(argument)) return argument;
throw TypeError$8("Can't set " + String$3(argument) + " as a prototype");
};
/* eslint-disable no-proto -- safe */
// `Object.setPrototypeOf` method
// https://tc39.es/ecma262/#sec-object.setprototypeof
// Works with __proto__ only. Old v8 can't work with null proto objects.
// eslint-disable-next-line es/no-object-setprototypeof -- safe
var objectSetPrototypeOf =
Object.setPrototypeOf ||
("__proto__" in {}
? (function () {
var CORRECT_SETTER = false;
var test = {};
var setter;
try {
// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
setter = functionUncurryThis(
Object.getOwnPropertyDescriptor(Object.prototype, "__proto__")
.set
);
setter(test, []);
CORRECT_SETTER = test instanceof Array;
} catch (error) {
/* empty */
}
return function setPrototypeOf(O, proto) {
anObject(O);
aPossiblePrototype(proto);
if (CORRECT_SETTER) setter(O, proto);
else O.__proto__ = proto;
return O;
};
})()
: undefined);
// `Object.keys` method
// https://tc39.es/ecma262/#sec-object.keys
// eslint-disable-next-line es/no-object-keys -- safe
var objectKeys =
Object.keys ||
function keys(O) {
return objectKeysInternal(O, enumBugKeys);
};
// `Object.defineProperties` method
// https://tc39.es/ecma262/#sec-object.defineproperties
// eslint-disable-next-line es/no-object-defineproperties -- safe
var objectDefineProperties = descriptors
? Object.defineProperties
: function defineProperties(O, Properties) {
anObject(O);
var props = toIndexedObject(Properties);
var keys = objectKeys(Properties);
var length = keys.length;
var index = 0;
var key;
while (length > index)
objectDefineProperty.f(O, (key = keys[index++]), props[key]);
return O;
};
var html = getBuiltIn("document", "documentElement");
/* global ActiveXObject -- old IE, WSH */
var GT = ">";
var LT = "<";
var PROTOTYPE = "prototype";
var SCRIPT = "script";
var IE_PROTO$1 = sharedKey("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;
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 =
typeof document != "undefined"
? document.domain && activeXDocument
? NullProtoObjectViaActiveX(activeXDocument) // old IE
: NullProtoObjectViaIFrame()
: NullProtoObjectViaActiveX(activeXDocument); // WSH
var length = enumBugKeys.length;
while (length--) delete NullProtoObject[PROTOTYPE][enumBugKeys[length]];
return NullProtoObject();
};
hiddenKeys[IE_PROTO$1] = 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] = anObject(O);
result = new EmptyConstructor();
EmptyConstructor[PROTOTYPE] = null; // add "__proto__" for Object.getPrototypeOf polyfill
result[IE_PROTO$1] = O;
} else result = NullProtoObject();
return Properties === undefined
? result
: objectDefineProperties(result, Properties);
};
var createProperty = function (object, key, value) {
var propertyKey = toPropertyKey(key);
if (propertyKey in object)
objectDefineProperty.f(
object,
propertyKey,
createPropertyDescriptor(0, value)
);
else object[propertyKey] = value;
};
var Array$1 = global_1.Array;
var max$1 = Math.max;
var arraySliceSimple = function (O, start, end) {
var length = lengthOfArrayLike(O);
var k = toAbsoluteIndex(start, length);
var fin = toAbsoluteIndex(end === undefined ? length : end, length);
var result = Array$1(max$1(fin - k, 0));
for (var n = 0; k < fin; k++, n++) createProperty(result, n, O[k]);
result.length = n;
return result;
};
var replace = functionUncurryThis("".replace);
var split$1 = functionUncurryThis("".split);
var join = functionUncurryThis([].join);
var TEST = (function (arg) {
return String(Error(arg).stack);
})("zxcasd");
var V8_OR_CHAKRA_STACK_ENTRY = /\n\s*at [^:]*:[^\n]*/;
var IS_V8_OR_CHAKRA_STACK = V8_OR_CHAKRA_STACK_ENTRY.test(TEST);
var IS_FIREFOX_OR_SAFARI_STACK =
/@[^\n]*\n/.test(TEST) && !/zxcasd/.test(TEST);
var clearErrorStack = function (stack, dropEntries) {
if (typeof stack != "string") return stack;
if (IS_V8_OR_CHAKRA_STACK) {
while (dropEntries--)
stack = replace(stack, V8_OR_CHAKRA_STACK_ENTRY, "");
} else if (IS_FIREFOX_OR_SAFARI_STACK) {
return join(arraySliceSimple(split$1(stack, "\n"), dropEntries), "\n");
}
return stack;
};
// `InstallErrorCause` abstract operation
// https://tc39.es/proposal-error-cause/#sec-errorobjects-install-error-cause
var installErrorCause = function (O, options) {
if (isObject(options) && "cause" in options) {
createNonEnumerableProperty(O, "cause", options.cause);
}
};
var bind$1 = functionUncurryThis(functionUncurryThis.bind); // optional / simple context binding
var functionBindContext = function (fn, that) {
aCallable(fn);
return that === undefined
? fn
: bind$1
? bind$1(fn, that)
: function () /* ...args */
{
return fn.apply(that, arguments);
};
};
var iterators = {};
var ITERATOR = wellKnownSymbol("iterator");
var ArrayPrototype = Array.prototype; // check on default Array iterator
var isArrayIteratorMethod = function (it) {
return (
it !== undefined &&
(iterators.Array === it || ArrayPrototype[ITERATOR] === it)
);
};
var TO_STRING_TAG = wellKnownSymbol("toStringTag");
var test = {};
test[TO_STRING_TAG] = "z";
var toStringTagSupport = String(test) === "[object z]";
var TO_STRING_TAG$1 = wellKnownSymbol("toStringTag");
var Object$5 = global_1.Object; // 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 = toStringTagSupport
? classofRaw
: function (it) {
var O, tag, result;
return it === undefined
? "Undefined"
: it === null
? "Null" // @@toStringTag case
: typeof (tag = tryGet((O = Object$5(it)), TO_STRING_TAG$1)) ==
"string"
? tag // builtinTag case
: CORRECT_ARGUMENTS
? classofRaw(O) // ES3 arguments fallback
: (result = classofRaw(O)) == "Object" && isCallable(O.callee)
? "Arguments"
: result;
};
var ITERATOR$1 = wellKnownSymbol("iterator");
var getIteratorMethod = function (it) {
if (it != undefined)
return (
getMethod(it, ITERATOR$1) ||
getMethod(it, "@@iterator") ||
iterators[classof(it)]
);
};
var TypeError$9 = global_1.TypeError;
var getIterator = function (argument, usingIterator) {
var iteratorMethod =
arguments.length < 2 ? getIteratorMethod(argument) : usingIterator;
if (aCallable(iteratorMethod))
return anObject(functionCall(iteratorMethod, argument));
throw TypeError$9(tryToString(argument) + " is not iterable");
};
var iteratorClose = function (iterator, kind, value) {
var innerResult, innerError;
anObject(iterator);
try {
innerResult = getMethod(iterator, "return");
if (!innerResult) {
if (kind === "throw") throw value;
return value;
}
innerResult = functionCall(innerResult, iterator);
} catch (error) {
innerError = true;
innerResult = error;
}
if (kind === "throw") throw value;
if (innerError) throw innerResult;
anObject(innerResult);
return value;
};
var TypeError$a = global_1.TypeError;
var Result = function (stopped, result) {
this.stopped = stopped;
this.result = result;
};
var ResultPrototype = Result.prototype;
var iterate = function (iterable, unboundFunction, options) {
var that = options && options.that;
var AS_ENTRIES = !!(options && options.AS_ENTRIES);
var IS_ITERATOR = !!(options && options.IS_ITERATOR);
var INTERRUPTED = !!(options && options.INTERRUPTED);
var fn = functionBindContext(unboundFunction, that);
var iterator, iterFn, index, length, result, next, step;
var stop = function (condition) {
if (iterator) iteratorClose(iterator, "normal", condition);
return new Result(true, condition);
};
var callFn = function (value) {
if (AS_ENTRIES) {
anObject(value);
return INTERRUPTED
? fn(value[0], value[1], stop)
: fn(value[0], value[1]);
}
return INTERRUPTED ? fn(value, stop) : fn(value);
};
if (IS_ITERATOR) {
iterator = iterable;
} else {
iterFn = getIteratorMethod(iterable);
if (!iterFn)
throw TypeError$a(tryToString(iterable) + " is not iterable"); // optimisation for array iterators
if (isArrayIteratorMethod(iterFn)) {
for (
index = 0, length = lengthOfArrayLike(iterable);
length > index;
index++
) {
result = callFn(iterable[index]);
if (result && objectIsPrototypeOf(ResultPrototype, result))
return result;
}
return new Result(false);
}
iterator = getIterator(iterable, iterFn);
}
next = iterator.next;
while (!(step = functionCall(next, iterator)).done) {
try {
result = callFn(step.value);
} catch (error) {
iteratorClose(iterator, "throw", error);
}
if (
typeof result == "object" &&
result &&
objectIsPrototypeOf(ResultPrototype, result)
)
return result;
}
return new Result(false);
};
var String$4 = global_1.String;
var toString_1 = function (argument) {
if (classof(argument) === "Symbol")
throw TypeError("Cannot convert a Symbol value to a string");
return String$4(argument);
};
var normalizeStringArgument = function (argument, $default) {
return argument === undefined
? arguments.length < 2
? ""
: $default
: toString_1(argument);
};
var errorStackInstallable = !fails(function () {
var error = Error("a");
if (!("stack" in error)) return true; // eslint-disable-next-line es/no-object-defineproperty -- safe
Object.defineProperty(error, "stack", createPropertyDescriptor(1, 7));
return error.stack !== 7;
});
var TO_STRING_TAG$2 = wellKnownSymbol("toStringTag");
var Error$1 = global_1.Error;
var push$1 = [].push;
var $AggregateError = function AggregateError(
errors,
message
/* , options */
) {
var options = arguments.length > 2 ? arguments[2] : undefined;
var isInstance = objectIsPrototypeOf(AggregateErrorPrototype, this);
var that;
if (objectSetPrototypeOf) {
that = objectSetPrototypeOf(
new Error$1(undefined),
isInstance ? objectGetPrototypeOf(this) : AggregateErrorPrototype
);
} else {
that = isInstance ? this : objectCreate(AggregateErrorPrototype);
createNonEnumerableProperty(that, TO_STRING_TAG$2, "Error");
}
createNonEnumerableProperty(
that,
"message",
normalizeStringArgument(message, "")
);
if (errorStackInstallable)
createNonEnumerableProperty(
that,
"stack",
clearErrorStack(that.stack, 1)
);
installErrorCause(that, options);
var errorsArray = [];
iterate(errors, push$1, {
that: errorsArray,
});
createNonEnumerableProperty(that, "errors", errorsArray);
return that;
};
if (objectSetPrototypeOf) objectSetPrototypeOf($AggregateError, Error$1);
else copyConstructorProperties($AggregateError, Error$1);
var AggregateErrorPrototype = ($AggregateError.prototype = objectCreate(
Error$1.prototype,
{
constructor: createPropertyDescriptor(1, $AggregateError),
message: createPropertyDescriptor(1, ""),
name: createPropertyDescriptor(1, "AggregateError"),
}
)); // `AggregateError` constructor
// https://tc39.es/ecma262/#sec-aggregate-error-constructor
_export(
{
global: true,
},
{
AggregateError: $AggregateError,
}
);
var UNSCOPABLES = wellKnownSymbol("unscopables");
var ArrayPrototype$1 = Array.prototype; // Array.prototype[@@unscopables]
// https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
if (ArrayPrototype$1[UNSCOPABLES] == undefined) {
objectDefineProperty.f(ArrayPrototype$1, UNSCOPABLES, {
configurable: true,
value: objectCreate(null),
});
} // add a key to Array.prototype[@@unscopables]
var addToUnscopables = function (key) {
ArrayPrototype$1[UNSCOPABLES][key] = true;
};
// `Array.prototype.at` method
// https://github.com/tc39/proposal-relative-indexing-method
_export(
{
target: "Array",
proto: true,
},
{
at: function at(index) {
var O = toObject(this);
var len = lengthOfArrayLike(O);
var relativeIndex = toIntegerOrInfinity(index);
var k = relativeIndex >= 0 ? relativeIndex : len + relativeIndex;
return k < 0 || k >= len ? undefined : O[k];
},
}
);
addToUnscopables("at");
// `IsArray` abstract operation
// https://tc39.es/ecma262/#sec-isarray
// eslint-disable-next-line es/no-array-isarray -- safe
var isArray =
Array.isArray ||
function isArray(argument) {
return classofRaw(argument) == "Array";
};
var un$Reverse = functionUncurryThis([].reverse);
var test$1 = [1, 2]; // `Array.prototype.reverse` method
// https://tc39.es/ecma262/#sec-array.prototype.reverse
// fix for Safari 12.0 bug
// https://bugs.webkit.org/show_bug.cgi?id=188794
_export(
{
target: "Array",
proto: true,
forced: String(test$1) === String(test$1.reverse()),
},
{
reverse: function reverse() {
// eslint-disable-next-line no-self-assign -- dirty hack
if (isArray(this)) this.length = this.length;
return un$Reverse(this);
},
}
);
// eslint-disable-next-line es/no-typed-arrays -- safe
var arrayBufferNative =
typeof ArrayBuffer != "undefined" && typeof DataView != "undefined";
var redefineAll = function (target, src, options) {
for (var key in src) redefine(target, key, src[key], options);
return target;
};
var TypeError$b = global_1.TypeError;
var anInstance = function (it, Prototype) {
if (objectIsPrototypeOf(Prototype, it)) return it;
throw TypeError$b("Incorrect invocation");
};
var RangeError = global_1.RangeError; // `ToIndex` abstract operation
// https://tc39.es/ecma262/#sec-toindex
var toIndex = function (it) {
if (it === undefined) return 0;
var number = toIntegerOrInfinity(it);
var length = toLength(number);
if (number !== length) throw RangeError("Wrong length or index");
return length;
};
// IEEE754 conversions based on https://github.com/feross/ieee754
var Array$2 = global_1.Array;
var abs = Math.abs;
var pow = Math.pow;
var floor$1 = Math.floor;
var log = Math.log;
var LN2 = Math.LN2;
var pack = function (number, mantissaLength, bytes) {
var buffer = Array$2(bytes);
var exponentLength = bytes * 8 - mantissaLength - 1;
var eMax = (1 << exponentLength) - 1;
var eBias = eMax >> 1;
var rt = mantissaLength === 23 ? pow(2, -24) - pow(2, -77) : 0;
var sign = number < 0 || (number === 0 && 1 / number < 0) ? 1 : 0;
var index = 0;
var exponent, mantissa, c;
number = abs(number); // eslint-disable-next-line no-self-compare -- NaN check
if (number != number || number === Infinity) {
// eslint-disable-next-line no-self-compare -- NaN check
mantissa = number != number ? 1 : 0;
exponent = eMax;
} else {
exponent = floor$1(log(number) / LN2);
c = pow(2, -exponent);
if (number * c < 1) {
exponent--;
c *= 2;
}
if (exponent + eBias >= 1) {
number += rt / c;
} else {
number += rt * pow(2, 1 - eBias);
}
if (number * c >= 2) {
exponent++;
c /= 2;
}
if (exponent + eBias >= eMax) {
mantissa = 0;
exponent = eMax;
} else if (exponent + eBias >= 1) {
mantissa = (number * c - 1) * pow(2, mantissaLength);
exponent = exponent + eBias;
} else {
mantissa = number * pow(2, eBias - 1) * pow(2, mantissaLength);
exponent = 0;
}
}
while (mantissaLength >= 8) {
buffer[index++] = mantissa & 255;
mantissa /= 256;
mantissaLength -= 8;
}
exponent = (exponent << mantissaLength) | mantissa;
exponentLength += mantissaLength;
while (exponentLength > 0) {
buffer[index++] = exponent & 255;
exponent /= 256;
exponentLength -= 8;
}
buffer[--index] |= sign * 128;
return buffer;
};
var unpack = function (buffer, mantissaLength) {
var bytes = buffer.length;
var exponentLength = bytes * 8 - mantissaLength - 1;
var eMax = (1 << exponentLength) - 1;
var eBias = eMax >> 1;
var nBits = exponentLength - 7;
var index = bytes - 1;
var sign = buffer[index--];
var exponent = sign & 127;
var mantissa;
sign >>= 7;
while (nBits > 0) {
exponent = exponent * 256 + buffer[index--];
nBits -= 8;
}
mantissa = exponent & ((1 << -nBits) - 1);
exponent >>= -nBits;
nBits += mantissaLength;
while (nBits > 0) {
mantissa = mantissa * 256 + buffer[index--];
nBits -= 8;
}
if (exponent === 0) {
exponent = 1 - eBias;
} else if (exponent === eMax) {
return mantissa ? NaN : sign ? -Infinity : Infinity;
} else {
mantissa = mantissa + pow(2, mantissaLength);
exponent = exponent - eBias;
}
return (sign ? -1 : 1) * mantissa * pow(2, exponent - mantissaLength);
};
var ieee754 = {
pack: pack,
unpack: unpack,
};
// `Array.prototype.fill` method implementation
// https://tc39.es/ecma262/#sec-array.prototype.fill
var arrayFill = function fill(
value
/* , start = 0, end = @length */
) {
var O = toObject(this);
var length = lengthOfArrayLike(O);
var argumentsLength = arguments.length;
var index = toAbsoluteIndex(
argumentsLength > 1 ? arguments[1] : undefined,
length
);
var end = argumentsLength > 2 ? arguments[2] : undefined;
var endPos = end === undefined ? length : toAbsoluteIndex(end, length);
while (endPos > index) O[index++] = value;
return O;
};
var defineProperty$1 = objectDefineProperty.f;
var TO_STRING_TAG$3 = wellKnownSymbol("toStringTag");
var setToStringTag = function (it, TAG, STATIC) {
if (
it &&
!hasOwnProperty_1((it = STATIC ? it : it.prototype), TO_STRING_TAG$3)
) {
defineProperty$1(it, TO_STRING_TAG$3, {
configurable: true,
value: TAG,
});
}
};
var getOwnPropertyNames = objectGetOwnPropertyNames.f;
var defineProperty$2 = objectDefineProperty.f;
var PROPER_FUNCTION_NAME = functionName.PROPER;
var CONFIGURABLE_FUNCTION_NAME = functionName.CONFIGURABLE;
var getInternalState = internalState.get;
var setInternalState = internalState.set;
var ARRAY_BUFFER = "ArrayBuffer";
var DATA_VIEW = "DataView";
var PROTOTYPE$1 = "prototype";
var WRONG_LENGTH = "Wrong length";
var WRONG_INDEX = "Wrong index";
var NativeArrayBuffer = global_1[ARRAY_BUFFER];
var $ArrayBuffer = NativeArrayBuffer;
var ArrayBufferPrototype = $ArrayBuffer && $ArrayBuffer[PROTOTYPE$1];
var $DataView = global_1[DATA_VIEW];
var DataViewPrototype = $DataView && $DataView[PROTOTYPE$1];
var ObjectPrototype$1 = Object.prototype;
var Array$3 = global_1.Array;
var RangeError$1 = global_1.RangeError;
var fill = functionUncurryThis(arrayFill);
var reverse = functionUncurryThis([].reverse);
var packIEEE754 = ieee754.pack;
var unpackIEEE754 = ieee754.unpack;
var packInt8 = function (number) {
return [number & 0xff];
};
var packInt16 = function (number) {
return [number & 0xff, (number >> 8) & 0xff];
};
var packInt32 = function (number) {
return [
number & 0xff,
(number >> 8) & 0xff,
(number >> 16) & 0xff,
(number >> 24) & 0xff,
];
};
var unpackInt32 = function (buffer) {
return (
(buffer[3] << 24) | (buffer[2] << 16) | (buffer[1] << 8) | buffer[0]
);
};
var packFloat32 = function (number) {
return packIEEE754(number, 23, 4);
};
var packFloat64 = function (number) {
return packIEEE754(number, 52, 8);
};
var addGetter = function (Constructor, key) {
defineProperty$2(Constructor[PROTOTYPE$1], key, {
get: function () {
return getInternalState(this)[key];
},
});
};
var get$1 = function (view, count, index, isLittleEndian) {
var intIndex = toIndex(index);
var store = getInternalState(view);
if (intIndex + count > store.byteLength) throw RangeError$1(WRONG_INDEX);
var bytes = getInternalState(store.buffer).bytes;
var start = intIndex + store.byteOffset;
var pack = arraySliceSimple(bytes, start, start + count);
return isLittleEndian ? pack : reverse(pack);
};
var set$1 = function (
view,
count,
index,
conversion,
value,
isLittleEndian
) {
var intIndex = toIndex(index);
var store = getInternalState(view);
if (intIndex + count > store.byteLength) throw RangeError$1(WRONG_INDEX);
var bytes = getInternalState(store.buffer).bytes;
var start = intIndex + store.byteOffset;
var pack = conversion(+value);
for (var i = 0; i < count; i++)
bytes[start + i] = pack[isLittleEndian ? i : count - i - 1];
};
if (!arrayBufferNative) {
$ArrayBuffer = function ArrayBuffer(length) {
anInstance(this, ArrayBufferPrototype);
var byteLength = toIndex(length);
setInternalState(this, {
bytes: fill(Array$3(byteLength), 0),
byteLength: byteLength,
});
if (!descriptors) this.byteLength = byteLength;
};
ArrayBufferPrototype = $ArrayBuffer[PROTOTYPE$1];
$DataView = function DataView(buffer, byteOffset, byteLength) {
anInstance(this, DataViewPrototype);
anInstance(buffer, ArrayBufferPrototype);
var bufferLength = getInternalState(buffer).byteLength;
var offset = toIntegerOrInfinity(byteOffset);
if (offset < 0 || offset > bufferLength)
throw RangeError$1("Wrong offset");
byteLength =
byteLength === undefined
? bufferLength - offset
: toLength(byteLength);
if (offset + byteLength > bufferLength)
throw RangeError$1(WRONG_LENGTH);
setInternalState(this, {
buffer: buffer,
byteLength: byteLength,
byteOffset: offset,
});
if (!descriptors) {
this.buffer = buffer;
this.byteLength = byteLength;
this.byteOffset = offset;
}
};
DataViewPrototype = $DataView[PROTOTYPE$1];
if (descriptors) {
addGetter($ArrayBuffer, "byteLength");
addGetter($DataView, "buffer");
addGetter($DataView, "byteLength");
addGetter($DataView, "byteOffset");
}
redefineAll(DataViewPrototype, {
getInt8: function getInt8(byteOffset) {
return (get$1(this, 1, byteOffset)[0] << 24) >> 24;
},
getUint8: function getUint8(byteOffset) {
return get$1(this, 1, byteOffset)[0];
},
getInt16: function getInt16(
byteOffset
/* , littleEndian */
) {
var bytes = get$1(
this,
2,
byteOffset,
arguments.length > 1 ? arguments[1] : undefined
);
return (((bytes[1] << 8) | bytes[0]) << 16) >> 16;
},
getUint16: function getUint16(
byteOffset
/* , littleEndian */
) {
var bytes = get$1(
this,
2,
byteOffset,
arguments.length > 1 ? arguments[1] : undefined
);
return (bytes[1] << 8) | bytes[0];
},
getInt32: function getInt32(
byteOffset
/* , littleEndian */
) {
return unpackInt32(
get$1(
this,
4,
byteOffset,
arguments.length > 1 ? arguments[1] : undefined
)
);
},
getUint32: function getUint32(
byteOffset
/* , littleEndian */
) {
return (
unpackInt32(
get$1(
this,
4,
byteOffset,
arguments.length > 1 ? arguments[1] : undefined
)
) >>> 0
);
},
getFloat32: function getFloat32(
byteOffset
/* , littleEndian */
) {
return unpackIEEE754(
get$1(
this,
4,
byteOffset,
arguments.length > 1 ? arguments[1] : undefined
),
23
);
},
getFloat64: function getFloat64(
byteOffset
/* , littleEndian */
) {
return unpackIEEE754(
get$1(
this,
8,
byteOffset,
arguments.length > 1 ? arguments[1] : undefined
),
52
);
},
setInt8: function setInt8(byteOffset, value) {
set$1(this, 1, byteOffset, packInt8, value);
},
setUint8: function setUint8(byteOffset, value) {
set$1(this, 1, byteOffset, packInt8, value);
},
setInt16: function setInt16(
byteOffset,
value
/* , littleEndian */
) {
set$1(
this,
2,
byteOffset,
packInt16,
value,
arguments.length > 2 ? arguments[2] : undefined
);
},
setUint16: function setUint16(
byteOffset,
value
/* , littleEndian */
) {
set$1(
this,
2,
byteOffset,
packInt16,
value,
arguments.length > 2 ? arguments[2] : undefined
);
},
setInt32: function setInt32(
byteOffset,
value
/* , littleEndian */
) {
set$1(
this,
4,
byteOffset,
packInt32,
value,
arguments.length > 2 ? arguments[2] : undefined
);
},
setUint32: function setUint32(
byteOffset,
value
/* , littleEndian */
) {
set$1(
this,
4,
byteOffset,
packInt32,
value,
arguments.length > 2 ? arguments[2] : undefined
);
},
setFloat32: function setFloat32(
byteOffset,
value
/* , littleEndian */
) {
set$1(
this,
4,
byteOffset,
packFloat32,
value,
arguments.length > 2 ? arguments[2] : undefined
);
},
setFloat64: function setFloat64(
byteOffset,
value
/* , littleEndian */
) {
set$1(
this,
8,
byteOffset,
packFloat64,
value,
arguments.length > 2 ? arguments[2] : undefined
);
},
});
} else {
var INCORRECT_ARRAY_BUFFER_NAME =
PROPER_FUNCTION_NAME && NativeArrayBuffer.name !== ARRAY_BUFFER;
/* eslint-disable no-new -- required for testing */
if (
!fails(function () {
NativeArrayBuffer(1);
}) ||
!fails(function () {
new NativeArrayBuffer(-1);
}) ||
fails(function () {
new NativeArrayBuffer();
new NativeArrayBuffer(1.5);
new NativeArrayBuffer(NaN);
return INCORRECT_ARRAY_BUFFER_NAME && !CONFIGURABLE_FUNCTION_NAME;
})
) {
/* eslint-enable no-new -- required for testing */
$ArrayBuffer = function ArrayBuffer(length) {
anInstance(this, ArrayBufferPrototype);
return new NativeArrayBuffer(toIndex(length));
};
$ArrayBuffer[PROTOTYPE$1] = ArrayBufferPrototype;
for (
var keys$1 = getOwnPropertyNames(NativeArrayBuffer), j = 0, key;
keys$1.length > j;
) {
if (!((key = keys$1[j++]) in $ArrayBuffer)) {
createNonEnumerableProperty(
$ArrayBuffer,
key,
NativeArrayBuffer[key]
);
}
}
ArrayBufferPrototype.constructor = $ArrayBuffer;
} else if (INCORRECT_ARRAY_BUFFER_NAME && CONFIGURABLE_FUNCTION_NAME) {
createNonEnumerableProperty(NativeArrayBuffer, "name", ARRAY_BUFFER);
} // WebKit bug - the same parent prototype for typed arrays and data view
if (
objectSetPrototypeOf &&
objectGetPrototypeOf(DataViewPrototype) !== ObjectPrototype$1
) {
objectSetPrototypeOf(DataViewPrototype, ObjectPrototype$1);
} // iOS Safari 7.x bug
var testView = new $DataView(new $ArrayBuffer(2));
var $setInt8 = functionUncurryThis(DataViewPrototype.setInt8);
testView.setInt8(0, 2147483648);
testView.setInt8(1, 2147483649);
if (testView.getInt8(0) || !testView.getInt8(1))
redefineAll(
DataViewPrototype,
{
setInt8: function setInt8(byteOffset, value) {
$setInt8(this, byteOffset, (value << 24) >> 24);
},
setUint8: function setUint8(byteOffset, value) {
$setInt8(this, byteOffset, (value << 24) >> 24);
},
},
{
unsafe: true,
}
);
}
setToStringTag($ArrayBuffer, ARRAY_BUFFER);
setToStringTag($DataView, DATA_VIEW);
var arrayBuffer = {
ArrayBuffer: $ArrayBuffer,
DataView: $DataView,
};
var noop = function () {
/* empty */
};
var empty = [];
var construct = getBuiltIn("Reflect", "construct");
var constructorRegExp = /^\s*(?:class|function)\b/;
var exec = functionUncurryThis(constructorRegExp.exec);
var INCORRECT_TO_STRING = !constructorRegExp.exec(noop);
var isConstructorModern = function (argument) {
if (!isCallable(argument)) return false;
try {
construct(noop, empty, argument);
return true;
} catch (error) {
return false;
}
};
var isConstructorLegacy = function (argument) {
if (!isCallable(argument)) return false;
switch (classof(argument)) {
case "AsyncFunction":
case "GeneratorFunction":
case "AsyncGeneratorFunction":
return false;
// we can't check .prototype since constructors produced by .bind haven't it
}
return (
INCORRECT_TO_STRING ||
!!exec(constructorRegExp, inspectSource(argument))
);
}; // `IsConstructor` abstract operation
// https://tc39.es/ecma262/#sec-isconstructor
var isConstructor =
!construct ||
fails(function () {
var called;
return (
isConstructorModern(isConstructorModern.call) ||
!isConstructorModern(Object) ||
!isConstructorModern(function () {
called = true;
}) ||
called
);
})
? isConstructorLegacy
: isConstructorModern;
var TypeError$c = global_1.TypeError; // `Assert: IsConstructor(argument) is true`
var aConstructor = function (argument) {
if (isConstructor(argument)) return argument;
throw TypeError$c(tryToString(argument) + " is not a constructor");
};
var SPECIES = wellKnownSymbol("species"); // `SpeciesConstructor` abstract operation
// https://tc39.es/ecma262/#sec-speciesconstructor
var speciesConstructor = function (O, defaultConstructor) {
var C = anObject(O).constructor;
var S;
return C === undefined || (S = anObject(C)[SPECIES]) == undefined
? defaultConstructor
: aConstructor(S);
};
var ArrayBuffer$1 = arrayBuffer.ArrayBuffer;
var DataView$1 = arrayBuffer.DataView;
var DataViewPrototype$1 = DataView$1.prototype;
var un$ArrayBufferSlice = functionUncurryThis(
ArrayBuffer$1.prototype.slice
);
var getUint8 = functionUncurryThis(DataViewPrototype$1.getUint8);
var setUint8 = functionUncurryThis(DataViewPrototype$1.setUint8);
var INCORRECT_SLICE = fails(function () {
return !new ArrayBuffer$1(2).slice(1, undefined).byteLength;
}); // `ArrayBuffer.prototype.slice` method
// https://tc39.es/ecma262/#sec-arraybuffer.prototype.slice
_export(
{
target: "ArrayBuffer",
proto: true,
unsafe: true,
forced: INCORRECT_SLICE,
},
{
slice: function slice(start, end) {
if (un$ArrayBufferSlice && end === undefined) {
return un$ArrayBufferSlice(anObject(this), start); // FF fix
}
var length = anObject(this).byteLength;
var first = toAbsoluteIndex(start, length);
var fin = toAbsoluteIndex(end === undefined ? length : end, length);
var result = new (speciesConstructor(this, ArrayBuffer$1))(
toLength(fin - first)
);
var viewSource = new DataView$1(this);
var viewTarget = new DataView$1(result);
var index = 0;
while (first < fin) {
setUint8(viewTarget, index++, getUint8(viewSource, first++));
}
return result;
},
}
);
// `Object.fromEntries` method
// https://github.com/tc39/proposal-object-from-entries
_export(
{
target: "Object",
stat: true,
},
{
fromEntries: function fromEntries(iterable) {
var obj = {};
iterate(
iterable,
function (k, v) {
createProperty(obj, k, v);
},
{
AS_ENTRIES: true,
}
);
return obj;
},
}
);
// `Object.hasOwn` method
// https://github.com/tc39/proposal-accessible-object-hasownproperty
_export(
{
target: "Object",
stat: true,
},
{
hasOwn: hasOwnProperty_1,
}
);
var PromiseCapability = function (C) {
var resolve, reject;
this.promise = new C(function ($$resolve, $$reject) {
if (resolve !== undefined || reject !== undefined)
throw TypeError("Bad Promise constructor");
resolve = $$resolve;
reject = $$reject;
});
this.resolve = aCallable(resolve);
this.reject = aCallable(reject);
}; // `NewPromiseCapability` abstract operation
// https://tc39.es/ecma262/#sec-newpromisecapability
var f$5 = function (C) {
return new PromiseCapability(C);
};
var newPromiseCapability = {
f: f$5,
};
var perform = function (exec) {
try {
return {
error: false,
value: exec(),
};
} catch (error) {
return {
error: true,
value: error,
};
}
};
// `Promise.allSettled` method
// https://tc39.es/ecma262/#sec-promise.allsettled
_export(
{
target: "Promise",
stat: true,
},
{
allSettled: function allSettled(iterable) {
var C = this;
var capability = newPromiseCapability.f(C);
var resolve = capability.resolve;
var reject = capability.reject;
var result = perform(function () {
var promiseResolve = aCallable(C.resolve);
var values = [];
var counter = 0;
var remaining = 1;
iterate(iterable, function (promise) {
var index = counter++;
var alreadyCalled = false;
remaining++;
functionCall(promiseResolve, C, promise).then(
function (value) {
if (alreadyCalled) return;
alreadyCalled = true;
values[index] = {
status: "fulfilled",
value: value,
};
--remaining || resolve(values);
},
function (error) {
if (alreadyCalled) return;
alreadyCalled = true;
values[index] = {
status: "rejected",
reason: error,
};
--remaining || resolve(values);
}
);
});
--remaining || resolve(values);
});
if (result.error) reject(result.value);
return capability.promise;
},
}
);
var PROMISE_ANY_ERROR = "No one promise resolved"; // `Promise.any` method
// https://tc39.es/ecma262/#sec-promise.any
_export(
{
target: "Promise",
stat: true,
},
{
any: function any(iterable) {
var C = this;
var AggregateError = getBuiltIn("AggregateError");
var capability = newPromiseCapability.f(C);
var resolve = capability.resolve;
var reject = capability.reject;
var result = perform(function () {
var promiseResolve = aCallable(C.resolve);
var errors = [];
var counter = 0;
var remaining = 1;
var alreadyResolved = false;
iterate(iterable, function (promise) {
var index = counter++;
var alreadyRejected = false;
remaining++;
functionCall(promiseResolve, C, promise).then(
function (value) {
if (alreadyRejected || alreadyResolved) return;
alreadyResolved = true;
resolve(value);
},
function (error) {
if (alreadyRejected || alreadyResolved) return;
alreadyRejected = true;
errors[index] = error;
--remaining ||
reject(new AggregateError(errors, PROMISE_ANY_ERROR));
}
);
});
--remaining ||
reject(new AggregateError(errors, PROMISE_ANY_ERROR));
});
if (result.error) reject(result.value);
return capability.promise;
},
}
);
var nativePromiseConstructor = global_1.Promise;
var promiseResolve = function (C, x) {
anObject(C);
if (isObject(x) && x.constructor === C) return x;
var promiseCapability = newPromiseCapability.f(C);
var resolve = promiseCapability.resolve;
resolve(x);
return promiseCapability.promise;
};
// Safari bug https://bugs.webkit.org/show_bug.cgi?id=200829
var NON_GENERIC =
!!nativePromiseConstructor &&
fails(function () {
nativePromiseConstructor.prototype["finally"].call(
{
then: function () {
/* empty */
},
},
function () {
/* empty */
}
);
}); // `Promise.prototype.finally` method
// https://tc39.es/ecma262/#sec-promise.prototype.finally
_export(
{
target: "Promise",
proto: true,
real: true,
forced: NON_GENERIC,
},
{
finally: function (onFinally) {
var C = speciesConstructor(this, getBuiltIn("Promise"));
var isFunction = isCallable(onFinally);
return this.then(
isFunction
? function (x) {
return promiseResolve(C, onFinally()).then(function () {
return x;
});
}
: onFinally,
isFunction
? function (e) {
return promiseResolve(C, onFinally()).then(function () {
throw e;
});
}
: onFinally
);
},
}
); // makes sure that native promise-based APIs `Promise#finally` properly works with patched `Promise#then`
if (!isPure && isCallable(nativePromiseConstructor)) {
var method = getBuiltIn("Promise").prototype["finally"];
if (nativePromiseConstructor.prototype["finally"] !== method) {
redefine(nativePromiseConstructor.prototype, "finally", method, {
unsafe: true,
});
}
}
var ITERATOR$2 = wellKnownSymbol("iterator");
var BUGGY_SAFARI_ITERATORS = false; // `%IteratorPrototype%` object
// https://tc39.es/ecma262/#sec-%iteratorprototype%-object
var IteratorPrototype, 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 = true;
else {
PrototypeOfArrayIteratorPrototype = objectGetPrototypeOf(
objectGetPrototypeOf(arrayIterator)
);
if (PrototypeOfArrayIteratorPrototype !== Object.prototype)
IteratorPrototype = PrototypeOfArrayIteratorPrototype;
}
}
var NEW_ITERATOR_PROTOTYPE =
IteratorPrototype == undefined ||
fails(function () {
var test = {}; // FF44- legacy iterators case
return IteratorPrototype[ITERATOR$2].call(test) !== test;
});
if (NEW_ITERATOR_PROTOTYPE) IteratorPrototype = {}; // `%IteratorPrototype%[@@iterator]()` method
// https://tc39.es/ecma262/#sec-%iteratorprototype%-@@iterator
if (!isCallable(IteratorPrototype[ITERATOR$2])) {
redefine(IteratorPrototype, ITERATOR$2, function () {
return this;
});
}
var iteratorsCore = {
IteratorPrototype: IteratorPrototype,
BUGGY_SAFARI_ITERATORS: BUGGY_SAFARI_ITERATORS,
};
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 MATCH = wellKnownSymbol("match"); // `IsRegExp` abstract operation
// https://tc39.es/ecma262/#sec-isregexp
var isRegexp = function (it) {
var isRegExp;
return (
isObject(it) &&
((isRegExp = it[MATCH]) !== undefined
? !!isRegExp
: classofRaw(it) == "RegExp")
);
};
// `RegExp.prototype.flags` getter implementation
// https://tc39.es/ecma262/#sec-get-regexp.prototype.flags
var regexpFlags = function () {
var that = anObject(this);
var result = "";
if (that.global) result += "g";
if (that.ignoreCase) result += "i";
if (that.multiline) result += "m";
if (that.dotAll) result += "s";
if (that.unicode) result += "u";
if (that.sticky) result += "y";
return result;
};
var charAt = functionUncurryThis("".charAt);
var charCodeAt = functionUncurryThis("".charCodeAt);
var stringSlice$1 = functionUncurryThis("".slice);
var createMethod$1 = function (CONVERT_TO_STRING) {
return function ($this, pos) {
var S = toString_1(requireObjectCoercible($this));
var position = toIntegerOrInfinity(pos);
var size = S.length;
var first, second;
if (position < 0 || position >= size)
return CONVERT_TO_STRING ? "" : undefined;
first = charCodeAt(S, position);
return first < 0xd800 ||
first > 0xdbff ||
position + 1 === size ||
(second = charCodeAt(S, position + 1)) < 0xdc00 ||
second > 0xdfff
? CONVERT_TO_STRING
? charAt(S, position)
: first
: CONVERT_TO_STRING
? stringSlice$1(S, 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$1(false),
// `String.prototype.at` method
// https://github.com/mathiasbynens/String.prototype.at
charAt: createMethod$1(true),
};
var charAt$1 = stringMultibyte.charAt; // `AdvanceStringIndex` abstract operation
// https://tc39.es/ecma262/#sec-advancestringindex
var advanceStringIndex = function (S, index, unicode) {
return index + (unicode ? charAt$1(S, index).length : 1);
};
// babel-minify and Closure Compiler transpiles RegExp('a', 'y') -> /a/y and it causes SyntaxError
var $RegExp = global_1.RegExp;
var UNSUPPORTED_Y = fails(function () {
var re = $RegExp("a", "y");
re.lastIndex = 2;
return re.exec("abcd") != null;
}); // UC Browser bug
// https://github.com/zloirock/core-js/issues/1008
var MISSED_STICKY =
UNSUPPORTED_Y ||
fails(function () {
return !$RegExp("a", "y").sticky;
});
var BROKEN_CARET =
UNSUPPORTED_Y ||
fails(function () {
// https://bugzilla.mozilla.org/show_bug.cgi?id=773687
var re = $RegExp("^r", "gy");
re.lastIndex = 2;
return re.exec("str") != null;
});
var regexpStickyHelpers = {
BROKEN_CARET: BROKEN_CARET,
MISSED_STICKY: MISSED_STICKY,
UNSUPPORTED_Y: UNSUPPORTED_Y,
};
// babel-minify and Closure Compiler transpiles RegExp('.', 's') -> /./s and it causes SyntaxError
var $RegExp$1 = global_1.RegExp;
var regexpUnsupportedDotAll = fails(function () {
var re = $RegExp$1(".", "s");
return !(re.dotAll && re.exec("\n") && re.flags === "s");
});
// babel-minify and Closure Compiler transpiles RegExp('(?b)', 'g') -> /(?b)/g and it causes SyntaxError
var $RegExp$2 = global_1.RegExp;
var regexpUnsupportedNcg = fails(function () {
var re = $RegExp$2("(?b)", "g");
return re.exec("b").groups.a !== "b" || "b".replace(re, "$c") !== "bc";
});
/* eslint-disable regexp/no-empty-capturing-group, regexp/no-empty-group, regexp/no-lazy-ends -- testing */
/* eslint-disable regexp/no-useless-quantifier -- testing */
var getInternalState$1 = internalState.get;
var nativeReplace = shared(
"native-string-replace",
String.prototype.replace
);
var nativeExec = RegExp.prototype.exec;
var patchedExec = nativeExec;
var charAt$2 = functionUncurryThis("".charAt);
var indexOf$1 = functionUncurryThis("".indexOf);
var replace$1 = functionUncurryThis("".replace);
var stringSlice$2 = functionUncurryThis("".slice);
var UPDATES_LAST_INDEX_WRONG = (function () {
var re1 = /a/;
var re2 = /b*/g;
functionCall(nativeExec, re1, "a");
functionCall(nativeExec, re2, "a");
return re1.lastIndex !== 0 || re2.lastIndex !== 0;
})();
var UNSUPPORTED_Y$1 = regexpStickyHelpers.BROKEN_CARET; // nonparticipating capturing group, copied from es5-shim's String#split patch.
var NPCG_INCLUDED = /()??/.exec("")[1] !== undefined;
var PATCH =
UPDATES_LAST_INDEX_WRONG ||
NPCG_INCLUDED ||
UNSUPPORTED_Y$1 ||
regexpUnsupportedDotAll ||
regexpUnsupportedNcg;
if (PATCH) {
patchedExec = function exec(string) {
var re = this;
var state = getInternalState$1(re);
var str = toString_1(string);
var raw = state.raw;
var result, reCopy, lastIndex, match, i, object, group;
if (raw) {
raw.lastIndex = re.lastIndex;
result = functionCall(patchedExec, raw, str);
re.lastIndex = raw.lastIndex;
return result;
}
var groups = state.groups;
var sticky = UNSUPPORTED_Y$1 && re.sticky;
var flags = functionCall(regexpFlags, re);
var source = re.source;
var charsAdded = 0;
var strCopy = str;
if (sticky) {
flags = replace$1(flags, "y", "");
if (indexOf$1(flags, "g") === -1) {
flags += "g";
}
strCopy = stringSlice$2(str, re.lastIndex); // Support anchored sticky behavior.
if (
re.lastIndex > 0 &&
(!re.multiline ||
(re.multiline && charAt$2(str, re.lastIndex - 1) !== "\n"))
) {
source = "(?: " + source + ")";
strCopy = " " + strCopy;
charsAdded++;
} // ^(? + rx + ) is needed, in combination with some str slicing, to
// simulate the 'y' flag.
reCopy = new RegExp("^(?:" + source + ")", flags);
}
if (NPCG_INCLUDED) {
reCopy = new RegExp("^" + source + "$(?!\\s)", flags);
}
if (UPDATES_LAST_INDEX_WRONG) lastIndex = re.lastIndex;
match = functionCall(nativeExec, sticky ? reCopy : re, strCopy);
if (sticky) {
if (match) {
match.input = stringSlice$2(match.input, charsAdded);
match[0] = stringSlice$2(match[0], charsAdded);
match.index = re.lastIndex;
re.lastIndex += match[0].length;
} else re.lastIndex = 0;
} else if (UPDATES_LAST_INDEX_WRONG && match) {
re.lastIndex = re.global ? match.index + match[0].length : lastIndex;
}
if (NPCG_INCLUDED && match && match.length > 1) {
// Fix browsers whose `exec` methods don't consistently return `undefined`
// for NPCG, like IE8. NOTE: This doesn' work for /(.?)?/
functionCall(nativeReplace, match[0], reCopy, function () {
for (i = 1; i < arguments.length - 2; i++) {
if (arguments[i] === undefined) match[i] = undefined;
}
});
}
if (match && groups) {
match.groups = object = objectCreate(null);
for (i = 0; i < groups.length; i++) {
group = groups[i];
object[group[0]] = match[group[1]];
}
}
return match;
};
}
var regexpExec = patchedExec;
var TypeError$d = global_1.TypeError; // `RegExpExec` abstract operation
// https://tc39.es/ecma262/#sec-regexpexec
var regexpExecAbstract = function (R, S) {
var exec = R.exec;
if (isCallable(exec)) {
var result = functionCall(exec, R, S);
if (result !== null) anObject(result);
return result;
}
if (classofRaw(R) === "RegExp") return functionCall(regexpExec, R, S);
throw TypeError$d("RegExp#exec called on incompatible receiver");
};
/* eslint-disable es/no-string-prototype-matchall -- safe */
var MATCH_ALL = wellKnownSymbol("matchAll");
var REGEXP_STRING = "RegExp String";
var REGEXP_STRING_ITERATOR = REGEXP_STRING + " Iterator";
var setInternalState$1 = internalState.set;
var getInternalState$2 = internalState.getterFor(REGEXP_STRING_ITERATOR);
var RegExpPrototype = RegExp.prototype;
var TypeError$e = global_1.TypeError;
var getFlags = functionUncurryThis(regexpFlags);
var stringIndexOf = functionUncurryThis("".indexOf);
var un$MatchAll = functionUncurryThis("".matchAll);
var WORKS_WITH_NON_GLOBAL_REGEX =
!!un$MatchAll &&
!fails(function () {
un$MatchAll("a", /./);
});
var $RegExpStringIterator = createIteratorConstructor(
function RegExpStringIterator(regexp, string, $global, fullUnicode) {
setInternalState$1(this, {
type: REGEXP_STRING_ITERATOR,
regexp: regexp,
string: string,
global: $global,
unicode: fullUnicode,
done: false,
});
},
REGEXP_STRING,
function next() {
var state = getInternalState$2(this);
if (state.done)
return {
value: undefined,
done: true,
};
var R = state.regexp;
var S = state.string;
var match = regexpExecAbstract(R, S);
if (match === null)
return {
value: undefined,
done: (state.done = true),
};
if (state.global) {
if (toString_1(match[0]) === "")
R.lastIndex = advanceStringIndex(
S,
toLength(R.lastIndex),
state.unicode
);
return {
value: match,
done: false,
};
}
state.done = true;
return {
value: match,
done: false,
};
}
);
var $matchAll = function (string) {
var R = anObject(this);
var S = toString_1(string);
var C, flagsValue, flags, matcher, $global, fullUnicode;
C = speciesConstructor(R, RegExp);
flagsValue = R.flags;
if (
flagsValue === undefined &&
objectIsPrototypeOf(RegExpPrototype, R) &&
!("flags" in RegExpPrototype)
) {
flagsValue = getFlags(R);
}
flags = flagsValue === undefined ? "" : toString_1(flagsValue);
matcher = new C(C === RegExp ? R.source : R, flags);
$global = !!~stringIndexOf(flags, "g");
fullUnicode = !!~stringIndexOf(flags, "u");
matcher.lastIndex = toLength(R.lastIndex);
return new $RegExpStringIterator(matcher, S, $global, fullUnicode);
}; // `String.prototype.matchAll` method
// https://tc39.es/ecma262/#sec-string.prototype.matchall
_export(
{
target: "String",
proto: true,
forced: WORKS_WITH_NON_GLOBAL_REGEX,
},
{
matchAll: function matchAll(regexp) {
var O = requireObjectCoercible(this);
var flags, S, matcher, rx;
if (regexp != null) {
if (isRegexp(regexp)) {
flags = toString_1(
requireObjectCoercible(
"flags" in RegExpPrototype ? regexp.flags : getFlags(regexp)
)
);
if (!~stringIndexOf(flags, "g"))
throw TypeError$e(
"`.matchAll` does not allow non-global regexes"
);
}
if (WORKS_WITH_NON_GLOBAL_REGEX) return un$MatchAll(O, regexp);
matcher = getMethod(regexp, MATCH_ALL);
if (
matcher === undefined &&
isPure &&
classofRaw(regexp) == "RegExp"
)
matcher = $matchAll;
if (matcher) return functionCall(matcher, regexp, O);
} else if (WORKS_WITH_NON_GLOBAL_REGEX) return un$MatchAll(O, regexp);
S = toString_1(O);
rx = new RegExp(regexp, "g");
return isPure ? functionCall($matchAll, rx, S) : rx[MATCH_ALL](S);
},
}
);
isPure ||
MATCH_ALL in RegExpPrototype ||
redefine(RegExpPrototype, MATCH_ALL, $matchAll);
var floor$2 = Math.floor;
var charAt$3 = functionUncurryThis("".charAt);
var replace$2 = functionUncurryThis("".replace);
var stringSlice$3 = functionUncurryThis("".slice);
var SUBSTITUTION_SYMBOLS = /\$([$&'`]|\d{1,2}|<[^>]*>)/g;
var SUBSTITUTION_SYMBOLS_NO_NAMED = /\$([$&'`]|\d{1,2})/g; // `GetSubstitution` abstract operation
// https://tc39.es/ecma262/#sec-getsubstitution
var getSubstitution = function (
matched,
str,
position,
captures,
namedCaptures,
replacement
) {
var tailPos = position + matched.length;
var m = captures.length;
var symbols = SUBSTITUTION_SYMBOLS_NO_NAMED;
if (namedCaptures !== undefined) {
namedCaptures = toObject(namedCaptures);
symbols = SUBSTITUTION_SYMBOLS;
}
return replace$2(replacement, symbols, function (match, ch) {
var capture;
switch (charAt$3(ch, 0)) {
case "$":
return "$";
case "&":
return matched;
case "`":
return stringSlice$3(str, 0, position);
case "'":
return stringSlice$3(str, tailPos);
case "<":
capture = namedCaptures[stringSlice$3(ch, 1, -1)];
break;
default:
// \d\d?
var n = +ch;
if (n === 0) return match;
if (n > m) {
var f = floor$2(n / 10);
if (f === 0) return match;
if (f <= m)
return captures[f - 1] === undefined
? charAt$3(ch, 1)
: captures[f - 1] + charAt$3(ch, 1);
return match;
}
capture = captures[n - 1];
}
return capture === undefined ? "" : capture;
});
};
var REPLACE = wellKnownSymbol("replace");
var RegExpPrototype$1 = RegExp.prototype;
var TypeError$f = global_1.TypeError;
var getFlags$1 = functionUncurryThis(regexpFlags);
var indexOf$2 = functionUncurryThis("".indexOf);
var replace$3 = functionUncurryThis("".replace);
var stringSlice$4 = functionUncurryThis("".slice);
var max$2 = Math.max;
var stringIndexOf$1 = function (string, searchValue, fromIndex) {
if (fromIndex > string.length) return -1;
if (searchValue === "") return fromIndex;
return indexOf$2(string, searchValue, fromIndex);
}; // `String.prototype.replaceAll` method
// https://tc39.es/ecma262/#sec-string.prototype.replaceall
_export(
{
target: "String",
proto: true,
},
{
replaceAll: function replaceAll(searchValue, replaceValue) {
var O = requireObjectCoercible(this);
var IS_REG_EXP,
flags,
replacer,
string,
searchString,
functionalReplace,
searchLength,
advanceBy,
replacement;
var position = 0;
var endOfLastMatch = 0;
var result = "";
if (searchValue != null) {
IS_REG_EXP = isRegexp(searchValue);
if (IS_REG_EXP) {
flags = toString_1(
requireObjectCoercible(
"flags" in RegExpPrototype$1
? searchValue.flags
: getFlags$1(searchValue)
)
);
if (!~indexOf$2(flags, "g"))
throw TypeError$f(
"`.replaceAll` does not allow non-global regexes"
);
}
replacer = getMethod(searchValue, REPLACE);
if (replacer) {
return functionCall(replacer, searchValue, O, replaceValue);
} else if (isPure && IS_REG_EXP) {
return replace$3(toString_1(O), searchValue, replaceValue);
}
}
string = toString_1(O);
searchString = toString_1(searchValue);
functionalReplace = isCallable(replaceValue);
if (!functionalReplace) replaceValue = toString_1(replaceValue);
searchLength = searchString.length;
advanceBy = max$2(1, searchLength);
position = stringIndexOf$1(string, searchString, 0);
while (position !== -1) {
replacement = functionalReplace
? toString_1(replaceValue(searchString, position, string))
: getSubstitution(
searchString,
string,
position,
[],
undefined,
replaceValue
);
result +=
stringSlice$4(string, endOfLastMatch, position) + replacement;
endOfLastMatch = position + searchLength;
position = stringIndexOf$1(
string,
searchString,
position + advanceBy
);
}
if (endOfLastMatch < string.length) {
result += stringSlice$4(string, endOfLastMatch);
}
return result;
},
}
);
var ITERATOR$3 = wellKnownSymbol("iterator");
var SAFE_CLOSING = false;
var checkCorrectnessOfIteration = function (exec, SKIP_CLOSING) {
if (!SKIP_CLOSING && !SAFE_CLOSING) return false;
var ITERATION_SUPPORT = false;
try {
var object = {};
object[ITERATOR$3] = function () {
return {
next: function () {
return {
done: (ITERATION_SUPPORT = true),
};
},
};
};
exec(object);
} catch (error) {
/* empty */
}
return ITERATION_SUPPORT;
};
var defineProperty$3 = objectDefineProperty.f;
var Int8Array = global_1.Int8Array;
var Int8ArrayPrototype = Int8Array && Int8Array.prototype;
var Uint8ClampedArray = global_1.Uint8ClampedArray;
var Uint8ClampedArrayPrototype =
Uint8ClampedArray && Uint8ClampedArray.prototype;
var TypedArray = Int8Array && objectGetPrototypeOf(Int8Array);
var TypedArrayPrototype =
Int8ArrayPrototype && objectGetPrototypeOf(Int8ArrayPrototype);
var ObjectPrototype$2 = Object.prototype;
var TypeError$g = global_1.TypeError;
var TO_STRING_TAG$4 = wellKnownSymbol("toStringTag");
var TYPED_ARRAY_TAG = uid("TYPED_ARRAY_TAG");
var TYPED_ARRAY_CONSTRUCTOR = uid("TYPED_ARRAY_CONSTRUCTOR"); // Fixing native typed arrays in Opera Presto crashes the browser, see #595
var NATIVE_ARRAY_BUFFER_VIEWS =
arrayBufferNative &&
!!objectSetPrototypeOf &&
classof(global_1.opera) !== "Opera";
var TYPED_ARRAY_TAG_REQIRED = false;
var NAME, Constructor, Prototype;
var TypedArrayConstructorsList = {
Int8Array: 1,
Uint8Array: 1,
Uint8ClampedArray: 1,
Int16Array: 2,
Uint16Array: 2,
Int32Array: 4,
Uint32Array: 4,
Float32Array: 4,
Float64Array: 8,
};
var BigIntArrayConstructorsList = {
BigInt64Array: 8,
BigUint64Array: 8,
};
var isView = function isView(it) {
if (!isObject(it)) return false;
var klass = classof(it);
return (
klass === "DataView" ||
hasOwnProperty_1(TypedArrayConstructorsList, klass) ||
hasOwnProperty_1(BigIntArrayConstructorsList, klass)
);
};
var isTypedArray = function (it) {
if (!isObject(it)) return false;
var klass = classof(it);
return (
hasOwnProperty_1(TypedArrayConstructorsList, klass) ||
hasOwnProperty_1(BigIntArrayConstructorsList, klass)
);
};
var aTypedArray = function (it) {
if (isTypedArray(it)) return it;
throw TypeError$g("Target is not a typed array");
};
var aTypedArrayConstructor = function (C) {
if (
isCallable(C) &&
(!objectSetPrototypeOf || objectIsPrototypeOf(TypedArray, C))
)
return C;
throw TypeError$g(tryToString(C) + " is not a typed array constructor");
};
var exportTypedArrayMethod = function (KEY, property, forced) {
if (!descriptors) return;
if (forced)
for (var ARRAY in TypedArrayConstructorsList) {
var TypedArrayConstructor = global_1[ARRAY];
if (
TypedArrayConstructor &&
hasOwnProperty_1(TypedArrayConstructor.prototype, KEY)
)
try {
delete TypedArrayConstructor.prototype[KEY];
} catch (error) {
/* empty */
}
}
if (!TypedArrayPrototype[KEY] || forced) {
redefine(
TypedArrayPrototype,
KEY,
forced
? property
: (NATIVE_ARRAY_BUFFER_VIEWS && Int8ArrayPrototype[KEY]) || property
);
}
};
var exportTypedArrayStaticMethod = function (KEY, property, forced) {
var ARRAY, TypedArrayConstructor;
if (!descriptors) return;
if (objectSetPrototypeOf) {
if (forced)
for (ARRAY in TypedArrayConstructorsList) {
TypedArrayConstructor = global_1[ARRAY];
if (
TypedArrayConstructor &&
hasOwnProperty_1(TypedArrayConstructor, KEY)
)
try {
delete TypedArrayConstructor[KEY];
} catch (error) {
/* empty */
}
}
if (!TypedArray[KEY] || forced) {
// V8 ~ Chrome 49-50 `%TypedArray%` methods are non-writable non-configurable
try {
return redefine(
TypedArray,
KEY,
forced
? property
: (NATIVE_ARRAY_BUFFER_VIEWS && TypedArray[KEY]) || property
);
} catch (error) {
/* empty */
}
} else return;
}
for (ARRAY in TypedArrayConstructorsList) {
TypedArrayConstructor = global_1[ARRAY];
if (TypedArrayConstructor && (!TypedArrayConstructor[KEY] || forced)) {
redefine(TypedArrayConstructor, KEY, property);
}
}
};
for (NAME in TypedArrayConstructorsList) {
Constructor = global_1[NAME];
Prototype = Constructor && Constructor.prototype;
if (Prototype)
createNonEnumerableProperty(
Prototype,
TYPED_ARRAY_CONSTRUCTOR,
Constructor
);
else NATIVE_ARRAY_BUFFER_VIEWS = false;
}
for (NAME in BigIntArrayConstructorsList) {
Constructor = global_1[NAME];
Prototype = Constructor && Constructor.prototype;
if (Prototype)
createNonEnumerableProperty(
Prototype,
TYPED_ARRAY_CONSTRUCTOR,
Constructor
);
} // WebKit bug - typed arrays constructors prototype is Object.prototype
if (
!NATIVE_ARRAY_BUFFER_VIEWS ||
!isCallable(TypedArray) ||
TypedArray === Function.prototype
) {
// eslint-disable-next-line no-shadow -- safe
TypedArray = function TypedArray() {
throw TypeError$g("Incorrect invocation");
};
if (NATIVE_ARRAY_BUFFER_VIEWS)
for (NAME in TypedArrayConstructorsList) {
if (global_1[NAME]) objectSetPrototypeOf(global_1[NAME], TypedArray);
}
}
if (
!NATIVE_ARRAY_BUFFER_VIEWS ||
!TypedArrayPrototype ||
TypedArrayPrototype === ObjectPrototype$2
) {
TypedArrayPrototype = TypedArray.prototype;
if (NATIVE_ARRAY_BUFFER_VIEWS)
for (NAME in TypedArrayConstructorsList) {
if (global_1[NAME])
objectSetPrototypeOf(global_1[NAME].prototype, TypedArrayPrototype);
}
} // WebKit bug - one more object in Uint8ClampedArray prototype chain
if (
NATIVE_ARRAY_BUFFER_VIEWS &&
objectGetPrototypeOf(Uint8ClampedArrayPrototype) !== TypedArrayPrototype
) {
objectSetPrototypeOf(Uint8ClampedArrayPrototype, TypedArrayPrototype);
}
if (
descriptors &&
!hasOwnProperty_1(TypedArrayPrototype, TO_STRING_TAG$4)
) {
TYPED_ARRAY_TAG_REQIRED = true;
defineProperty$3(TypedArrayPrototype, TO_STRING_TAG$4, {
get: function () {
return isObject(this) ? this[TYPED_ARRAY_TAG] : undefined;
},
});
for (NAME in TypedArrayConstructorsList)
if (global_1[NAME]) {
createNonEnumerableProperty(global_1[NAME], TYPED_ARRAY_TAG, NAME);
}
}
var arrayBufferViewCore = {
NATIVE_ARRAY_BUFFER_VIEWS: NATIVE_ARRAY_BUFFER_VIEWS,
TYPED_ARRAY_CONSTRUCTOR: TYPED_ARRAY_CONSTRUCTOR,
TYPED_ARRAY_TAG: TYPED_ARRAY_TAG_REQIRED && TYPED_ARRAY_TAG,
aTypedArray: aTypedArray,
aTypedArrayConstructor: aTypedArrayConstructor,
exportTypedArrayMethod: exportTypedArrayMethod,
exportTypedArrayStaticMethod: exportTypedArrayStaticMethod,
isView: isView,
isTypedArray: isTypedArray,
TypedArray: TypedArray,
TypedArrayPrototype: TypedArrayPrototype,
};
/* eslint-disable no-new -- required for testing */
var NATIVE_ARRAY_BUFFER_VIEWS$1 =
arrayBufferViewCore.NATIVE_ARRAY_BUFFER_VIEWS;
var ArrayBuffer$2 = global_1.ArrayBuffer;
var Int8Array$1 = global_1.Int8Array;
var typedArrayConstructorsRequireWrappers =
!NATIVE_ARRAY_BUFFER_VIEWS$1 ||
!fails(function () {
Int8Array$1(1);
}) ||
!fails(function () {
new Int8Array$1(-1);
}) ||
!checkCorrectnessOfIteration(function (iterable) {
new Int8Array$1();
new Int8Array$1(null);
new Int8Array$1(1.5);
new Int8Array$1(iterable);
}, true) ||
fails(function () {
// Safari (11+) bug - a reason why even Safari 13 should load a typed array polyfill
return new Int8Array$1(new ArrayBuffer$2(2), 1, undefined).length !== 1;
});
var floor$3 = Math.floor; // `IsIntegralNumber` abstract operation
// https://tc39.es/ecma262/#sec-isintegralnumber
// eslint-disable-next-line es/no-number-isinteger -- safe
var isIntegralNumber =
Number.isInteger ||
function isInteger(it) {
return !isObject(it) && isFinite(it) && floor$3(it) === it;
};
var RangeError$2 = global_1.RangeError;
var toPositiveInteger = function (it) {
var result = toIntegerOrInfinity(it);
if (result < 0) throw RangeError$2("The argument can't be less than 0");
return result;
};
var RangeError$3 = global_1.RangeError;
var toOffset = function (it, BYTES) {
var offset = toPositiveInteger(it);
if (offset % BYTES) throw RangeError$3("Wrong offset");
return offset;
};
var aTypedArrayConstructor$1 = arrayBufferViewCore.aTypedArrayConstructor;
var typedArrayFrom = function from(
source
/* , mapfn, thisArg */
) {
var C = aConstructor(this);
var O = toObject(source);
var argumentsLength = arguments.length;
var mapfn = argumentsLength > 1 ? arguments[1] : undefined;
var mapping = mapfn !== undefined;
var iteratorMethod = getIteratorMethod(O);
var i, length, result, step, iterator, next;
if (iteratorMethod && !isArrayIteratorMethod(iteratorMethod)) {
iterator = getIterator(O, iteratorMethod);
next = iterator.next;
O = [];
while (!(step = functionCall(next, iterator)).done) {
O.push(step.value);
}
}
if (mapping && argumentsLength > 2) {
mapfn = functionBindContext(mapfn, arguments[2]);
}
length = lengthOfArrayLike(O);
result = new (aTypedArrayConstructor$1(C))(length);
for (i = 0; length > i; i++) {
result[i] = mapping ? mapfn(O[i], i) : O[i];
}
return result;
};
var SPECIES$1 = wellKnownSymbol("species");
var Array$4 = global_1.Array; // a part of `ArraySpeciesCreate` abstract operation
// https://tc39.es/ecma262/#sec-arrayspeciescreate
var arraySpeciesConstructor = function (originalArray) {
var C;
if (isArray(originalArray)) {
C = originalArray.constructor; // cross-realm fallback
if (isConstructor(C) && (C === Array$4 || isArray(C.prototype)))
C = undefined;
else if (isObject(C)) {
C = C[SPECIES$1];
if (C === null) C = undefined;
}
}
return C === undefined ? Array$4 : C;
};
// `ArraySpeciesCreate` abstract operation
// https://tc39.es/ecma262/#sec-arrayspeciescreate
var arraySpeciesCreate = function (originalArray, length) {
return new (arraySpeciesConstructor(originalArray))(
length === 0 ? 0 : length
);
};
var push$2 = functionUncurryThis([].push); // `Array.prototype.{ forEach, map, filter, some, every, find, findIndex, filterReject }` methods implementation
var createMethod$2 = 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 IS_FILTER_REJECT = TYPE == 7;
var NO_HOLES = TYPE == 5 || IS_FIND_INDEX;
return function ($this, callbackfn, that, specificCreate) {
var O = toObject($this);
var self = indexedObject(O);
var boundFunction = functionBindContext(callbackfn, that);
var length = lengthOfArrayLike(self);
var index = 0;
var create = specificCreate || arraySpeciesCreate;
var target = IS_MAP
? create($this, length)
: IS_FILTER || IS_FILTER_REJECT
? 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$2(target, value);
// filter
}
else
switch (TYPE) {
case 4:
return false;
// every
case 7:
push$2(target, value);
// filterReject
}
}
}
return IS_FIND_INDEX ? -1 : IS_SOME || IS_EVERY ? IS_EVERY : target;
};
};
var arrayIteration = {
// `Array.prototype.forEach` method
// https://tc39.es/ecma262/#sec-array.prototype.foreach
forEach: createMethod$2(0),
// `Array.prototype.map` method
// https://tc39.es/ecma262/#sec-array.prototype.map
map: createMethod$2(1),
// `Array.prototype.filter` method
// https://tc39.es/ecma262/#sec-array.prototype.filter
filter: createMethod$2(2),
// `Array.prototype.some` method
// https://tc39.es/ecma262/#sec-array.prototype.some
some: createMethod$2(3),
// `Array.prototype.every` method
// https://tc39.es/ecma262/#sec-array.prototype.every
every: createMethod$2(4),
// `Array.prototype.find` method
// https://tc39.es/ecma262/#sec-array.prototype.find
find: createMethod$2(5),
// `Array.prototype.findIndex` method
// https://tc39.es/ecma262/#sec-array.prototype.findIndex
findIndex: createMethod$2(6),
// `Array.prototype.filterReject` method
// https://github.com/tc39/proposal-array-filtering
filterReject: createMethod$2(7),
};
var SPECIES$2 = wellKnownSymbol("species");
var setSpecies = function (CONSTRUCTOR_NAME) {
var Constructor = getBuiltIn(CONSTRUCTOR_NAME);
var defineProperty = objectDefineProperty.f;
if (descriptors && Constructor && !Constructor[SPECIES$2]) {
defineProperty(Constructor, SPECIES$2, {
configurable: true,
get: function () {
return this;
},
});
}
};
// makes subclassing work correct for wrapped built-ins
var inheritIfRequired = function ($this, dummy, Wrapper) {
var NewTarget, NewTargetPrototype;
if (
// it can work only with native `setPrototypeOf`
objectSetPrototypeOf && // we haven't completely correct pre-ES6 way for getting `new.target`, so use this
isCallable((NewTarget = dummy.constructor)) &&
NewTarget !== Wrapper &&
isObject((NewTargetPrototype = NewTarget.prototype)) &&
NewTargetPrototype !== Wrapper.prototype
)
objectSetPrototypeOf($this, NewTargetPrototype);
return $this;
};
var typedArrayConstructor = createCommonjsModule(function (module) {
var getOwnPropertyNames = objectGetOwnPropertyNames.f;
var forEach = arrayIteration.forEach;
var getInternalState = internalState.get;
var setInternalState = internalState.set;
var nativeDefineProperty = objectDefineProperty.f;
var nativeGetOwnPropertyDescriptor = objectGetOwnPropertyDescriptor.f;
var round = Math.round;
var RangeError = global_1.RangeError;
var ArrayBuffer = arrayBuffer.ArrayBuffer;
var ArrayBufferPrototype = ArrayBuffer.prototype;
var DataView = arrayBuffer.DataView;
var NATIVE_ARRAY_BUFFER_VIEWS =
arrayBufferViewCore.NATIVE_ARRAY_BUFFER_VIEWS;
var TYPED_ARRAY_CONSTRUCTOR = arrayBufferViewCore.TYPED_ARRAY_CONSTRUCTOR;
var TYPED_ARRAY_TAG = arrayBufferViewCore.TYPED_ARRAY_TAG;
var TypedArray = arrayBufferViewCore.TypedArray;
var TypedArrayPrototype = arrayBufferViewCore.TypedArrayPrototype;
var aTypedArrayConstructor = arrayBufferViewCore.aTypedArrayConstructor;
var isTypedArray = arrayBufferViewCore.isTypedArray;
var BYTES_PER_ELEMENT = "BYTES_PER_ELEMENT";
var WRONG_LENGTH = "Wrong length";
var fromList = function (C, list) {
aTypedArrayConstructor(C);
var index = 0;
var length = list.length;
var result = new C(length);
while (length > index) result[index] = list[index++];
return result;
};
var addGetter = function (it, key) {
nativeDefineProperty(it, key, {
get: function () {
return getInternalState(this)[key];
},
});
};
var isArrayBuffer = function (it) {
var klass;
return (
objectIsPrototypeOf(ArrayBufferPrototype, it) ||
(klass = classof(it)) == "ArrayBuffer" ||
klass == "SharedArrayBuffer"
);
};
var isTypedArrayIndex = function (target, key) {
return (
isTypedArray(target) &&
!isSymbol(key) &&
key in target &&
isIntegralNumber(+key) &&
key >= 0
);
};
var wrappedGetOwnPropertyDescriptor = function getOwnPropertyDescriptor(
target,
key
) {
key = toPropertyKey(key);
return isTypedArrayIndex(target, key)
? createPropertyDescriptor(2, target[key])
: nativeGetOwnPropertyDescriptor(target, key);
};
var wrappedDefineProperty = function defineProperty(
target,
key,
descriptor
) {
key = toPropertyKey(key);
if (
isTypedArrayIndex(target, key) &&
isObject(descriptor) &&
hasOwnProperty_1(descriptor, "value") &&
!hasOwnProperty_1(descriptor, "get") &&
!hasOwnProperty_1(descriptor, "set") && // TODO: add validation descriptor w/o calling accessors
!descriptor.configurable &&
(!hasOwnProperty_1(descriptor, "writable") || descriptor.writable) &&
(!hasOwnProperty_1(descriptor, "enumerable") || descriptor.enumerable)
) {
target[key] = descriptor.value;
return target;
}
return nativeDefineProperty(target, key, descriptor);
};
if (descriptors) {
if (!NATIVE_ARRAY_BUFFER_VIEWS) {
objectGetOwnPropertyDescriptor.f = wrappedGetOwnPropertyDescriptor;
objectDefineProperty.f = wrappedDefineProperty;
addGetter(TypedArrayPrototype, "buffer");
addGetter(TypedArrayPrototype, "byteOffset");
addGetter(TypedArrayPrototype, "byteLength");
addGetter(TypedArrayPrototype, "length");
}
_export(
{
target: "Object",
stat: true,
forced: !NATIVE_ARRAY_BUFFER_VIEWS,
},
{
getOwnPropertyDescriptor: wrappedGetOwnPropertyDescriptor,
defineProperty: wrappedDefineProperty,
}
);
module.exports = function (TYPE, wrapper, CLAMPED) {
var BYTES = TYPE.match(/\d+$/)[0] / 8;
var CONSTRUCTOR_NAME = TYPE + (CLAMPED ? "Clamped" : "") + "Array";
var GETTER = "get" + TYPE;
var SETTER = "set" + TYPE;
var NativeTypedArrayConstructor = global_1[CONSTRUCTOR_NAME];
var TypedArrayConstructor = NativeTypedArrayConstructor;
var TypedArrayConstructorPrototype =
TypedArrayConstructor && TypedArrayConstructor.prototype;
var exported = {};
var getter = function (that, index) {
var data = getInternalState(that);
return data.view[GETTER](index * BYTES + data.byteOffset, true);
};
var setter = function (that, index, value) {
var data = getInternalState(that);
if (CLAMPED)
value =
(value = round(value)) < 0
? 0
: value > 0xff
? 0xff
: value & 0xff;
data.view[SETTER](index * BYTES + data.byteOffset, value, true);
};
var addElement = function (that, index) {
nativeDefineProperty(that, index, {
get: function () {
return getter(this, index);
},
set: function (value) {
return setter(this, index, value);
},
enumerable: true,
});
};
if (!NATIVE_ARRAY_BUFFER_VIEWS) {
TypedArrayConstructor = wrapper(function (
that,
data,
offset,
$length
) {
anInstance(that, TypedArrayConstructorPrototype);
var index = 0;
var byteOffset = 0;
var buffer, byteLength, length;
if (!isObject(data)) {
length = toIndex(data);
byteLength = length * BYTES;
buffer = new ArrayBuffer(byteLength);
} else if (isArrayBuffer(data)) {
buffer = data;
byteOffset = toOffset(offset, BYTES);
var $len = data.byteLength;
if ($length === undefined) {
if ($len % BYTES) throw RangeError(WRONG_LENGTH);
byteLength = $len - byteOffset;
if (byteLength < 0) throw RangeError(WRONG_LENGTH);
} else {
byteLength = toLength($length) * BYTES;
if (byteLength + byteOffset > $len)
throw RangeError(WRONG_LENGTH);
}
length = byteLength / BYTES;
} else if (isTypedArray(data)) {
return fromList(TypedArrayConstructor, data);
} else {
return functionCall(
typedArrayFrom,
TypedArrayConstructor,
data
);
}
setInternalState(that, {
buffer: buffer,
byteOffset: byteOffset,
byteLength: byteLength,
length: length,
view: new DataView(buffer),
});
while (index < length) addElement(that, index++);
});
if (objectSetPrototypeOf)
objectSetPrototypeOf(TypedArrayConstructor, TypedArray);
TypedArrayConstructorPrototype = TypedArrayConstructor.prototype =
objectCreate(TypedArrayPrototype);
} else if (typedArrayConstructorsRequireWrappers) {
TypedArrayConstructor = wrapper(function (
dummy,
data,
typedArrayOffset,
$length
) {
anInstance(dummy, TypedArrayConstructorPrototype);
return inheritIfRequired(
(function () {
if (!isObject(data))
return new NativeTypedArrayConstructor(toIndex(data));
if (isArrayBuffer(data))
return $length !== undefined
? new NativeTypedArrayConstructor(
data,
toOffset(typedArrayOffset, BYTES),
$length
)
: typedArrayOffset !== undefined
? new NativeTypedArrayConstructor(
data,
toOffset(typedArrayOffset, BYTES)
)
: new NativeTypedArrayConstructor(data);
if (isTypedArray(data))
return fromList(TypedArrayConstructor, data);
return functionCall(
typedArrayFrom,
TypedArrayConstructor,
data
);
})(),
dummy,
TypedArrayConstructor
);
});
if (objectSetPrototypeOf)
objectSetPrototypeOf(TypedArrayConstructor, TypedArray);
forEach(
getOwnPropertyNames(NativeTypedArrayConstructor),
function (key) {
if (!(key in TypedArrayConstructor)) {
createNonEnumerableProperty(
TypedArrayConstructor,
key,
NativeTypedArrayConstructor[key]
);
}
}
);
TypedArrayConstructor.prototype = TypedArrayConstructorPrototype;
}
if (
TypedArrayConstructorPrototype.constructor !== TypedArrayConstructor
) {
createNonEnumerableProperty(
TypedArrayConstructorPrototype,
"constructor",
TypedArrayConstructor
);
}
createNonEnumerableProperty(
TypedArrayConstructorPrototype,
TYPED_ARRAY_CONSTRUCTOR,
TypedArrayConstructor
);
if (TYPED_ARRAY_TAG) {
createNonEnumerableProperty(
TypedArrayConstructorPrototype,
TYPED_ARRAY_TAG,
CONSTRUCTOR_NAME
);
}
exported[CONSTRUCTOR_NAME] = TypedArrayConstructor;
_export(
{
global: true,
forced: TypedArrayConstructor != NativeTypedArrayConstructor,
sham: !NATIVE_ARRAY_BUFFER_VIEWS,
},
exported
);
if (!(BYTES_PER_ELEMENT in TypedArrayConstructor)) {
createNonEnumerableProperty(
TypedArrayConstructor,
BYTES_PER_ELEMENT,
BYTES
);
}
if (!(BYTES_PER_ELEMENT in TypedArrayConstructorPrototype)) {
createNonEnumerableProperty(
TypedArrayConstructorPrototype,
BYTES_PER_ELEMENT,
BYTES
);
}
setSpecies(CONSTRUCTOR_NAME);
};
} else
module.exports = function () {
/* empty */
};
});
// `Float32Array` constructor
// https://tc39.es/ecma262/#sec-typedarray-objects
typedArrayConstructor("Float32", function (init) {
return function Float32Array(data, byteOffset, length) {
return init(this, data, byteOffset, length);
};
});
// `Float64Array` constructor
// https://tc39.es/ecma262/#sec-typedarray-objects
typedArrayConstructor("Float64", function (init) {
return function Float64Array(data, byteOffset, length) {
return init(this, data, byteOffset, length);
};
});
// `Int8Array` constructor
// https://tc39.es/ecma262/#sec-typedarray-objects
typedArrayConstructor("Int8", function (init) {
return function Int8Array(data, byteOffset, length) {
return init(this, data, byteOffset, length);
};
});
// `Int16Array` constructor
// https://tc39.es/ecma262/#sec-typedarray-objects
typedArrayConstructor("Int16", function (init) {
return function Int16Array(data, byteOffset, length) {
return init(this, data, byteOffset, length);
};
});
// `Int32Array` constructor
// https://tc39.es/ecma262/#sec-typedarray-objects
typedArrayConstructor("Int32", function (init) {
return function Int32Array(data, byteOffset, length) {
return init(this, data, byteOffset, length);
};
});
// `Uint8Array` constructor
// https://tc39.es/ecma262/#sec-typedarray-objects
typedArrayConstructor("Uint8", function (init) {
return function Uint8Array(data, byteOffset, length) {
return init(this, data, byteOffset, length);
};
});
// `Uint8ClampedArray` constructor
// https://tc39.es/ecma262/#sec-typedarray-objects
typedArrayConstructor(
"Uint8",
function (init) {
return function Uint8ClampedArray(data, byteOffset, length) {
return init(this, data, byteOffset, length);
};
},
true
);
// `Uint16Array` constructor
// https://tc39.es/ecma262/#sec-typedarray-objects
typedArrayConstructor("Uint16", function (init) {
return function Uint16Array(data, byteOffset, length) {
return init(this, data, byteOffset, length);
};
});
// `Uint32Array` constructor
// https://tc39.es/ecma262/#sec-typedarray-objects
typedArrayConstructor("Uint32", function (init) {
return function Uint32Array(data, byteOffset, length) {
return init(this, data, byteOffset, length);
};
});
var aTypedArray$1 = arrayBufferViewCore.aTypedArray;
var exportTypedArrayMethod$1 = arrayBufferViewCore.exportTypedArrayMethod; // `%TypedArray%.prototype.at` method
// https://github.com/tc39/proposal-relative-indexing-method
exportTypedArrayMethod$1("at", function at(index) {
var O = aTypedArray$1(this);
var len = lengthOfArrayLike(O);
var relativeIndex = toIntegerOrInfinity(index);
var k = relativeIndex >= 0 ? relativeIndex : len + relativeIndex;
return k < 0 || k >= len ? undefined : O[k];
});
var exportTypedArrayStaticMethod$1 =
arrayBufferViewCore.exportTypedArrayStaticMethod;
// `%TypedArray%.from` method
// https://tc39.es/ecma262/#sec-%typedarray%.from
exportTypedArrayStaticMethod$1(
"from",
typedArrayFrom,
typedArrayConstructorsRequireWrappers
);
var aTypedArrayConstructor$2 = arrayBufferViewCore.aTypedArrayConstructor;
var exportTypedArrayStaticMethod$2 =
arrayBufferViewCore.exportTypedArrayStaticMethod; // `%TypedArray%.of` method
// https://tc39.es/ecma262/#sec-%typedarray%.of
exportTypedArrayStaticMethod$2(
"of",
function of /* ...items */() {
var index = 0;
var length = arguments.length;
var result = new (aTypedArrayConstructor$2(this))(length);
while (length > index) result[index] = arguments[index++];
return result;
},
typedArrayConstructorsRequireWrappers
);
var floor$4 = Math.floor;
var mergeSort = function (array, comparefn) {
var length = array.length;
var middle = floor$4(length / 2);
return length < 8
? insertionSort(array, comparefn)
: merge(
array,
mergeSort(arraySliceSimple(array, 0, middle), comparefn),
mergeSort(arraySliceSimple(array, middle), comparefn),
comparefn
);
};
var insertionSort = function (array, comparefn) {
var length = array.length;
var i = 1;
var element, j;
while (i < length) {
j = i;
element = array[i];
while (j && comparefn(array[j - 1], element) > 0) {
array[j] = array[--j];
}
if (j !== i++) array[j] = element;
}
return array;
};
var merge = function (array, left, right, comparefn) {
var llength = left.length;
var rlength = right.length;
var lindex = 0;
var rindex = 0;
while (lindex < llength || rindex < rlength) {
array[lindex + rindex] =
lindex < llength && rindex < rlength
? comparefn(left[lindex], right[rindex]) <= 0
? left[lindex++]
: right[rindex++]
: lindex < llength
? left[lindex++]
: right[rindex++];
}
return array;
};
var arraySort = mergeSort;
var firefox = engineUserAgent.match(/firefox\/(\d+)/i);
var engineFfVersion = !!firefox && +firefox[1];
var engineIsIeOrEdge = /MSIE|Trident/.test(engineUserAgent);
var webkit = engineUserAgent.match(/AppleWebKit\/(\d+)\./);
var engineWebkitVersion = !!webkit && +webkit[1];
var Array$5 = global_1.Array;
var aTypedArray$2 = arrayBufferViewCore.aTypedArray;
var exportTypedArrayMethod$2 = arrayBufferViewCore.exportTypedArrayMethod;
var Uint16Array = global_1.Uint16Array;
var un$Sort =
Uint16Array && functionUncurryThis(Uint16Array.prototype.sort); // WebKit
var ACCEPT_INCORRECT_ARGUMENTS =
!!un$Sort &&
!(
fails(function () {
un$Sort(new Uint16Array(2), null);
}) &&
fails(function () {
un$Sort(new Uint16Array(2), {});
})
);
var STABLE_SORT =
!!un$Sort &&
!fails(function () {
// feature detection can be too slow, so check engines versions
if (engineV8Version) return engineV8Version < 74;
if (engineFfVersion) return engineFfVersion < 67;
if (engineIsIeOrEdge) return true;
if (engineWebkitVersion) return engineWebkitVersion < 602;
var array = new Uint16Array(516);
var expected = Array$5(516);
var index, mod;
for (index = 0; index < 516; index++) {
mod = index % 4;
array[index] = 515 - index;
expected[index] = index - 2 * mod + 3;
}
un$Sort(array, function (a, b) {
return ((a / 4) | 0) - ((b / 4) | 0);
});
for (index = 0; index < 516; index++) {
if (array[index] !== expected[index]) return true;
}
});
var getSortCompare = function (comparefn) {
return function (x, y) {
if (comparefn !== undefined) return +comparefn(x, y) || 0; // eslint-disable-next-line no-self-compare -- NaN check
if (y !== y) return -1; // eslint-disable-next-line no-self-compare -- NaN check
if (x !== x) return 1;
if (x === 0 && y === 0) return 1 / x > 0 && 1 / y < 0 ? 1 : -1;
return x > y;
};
}; // `%TypedArray%.prototype.sort` method
// https://tc39.es/ecma262/#sec-%typedarray%.prototype.sort
exportTypedArrayMethod$2(
"sort",
function sort(comparefn) {
if (comparefn !== undefined) aCallable(comparefn);
if (STABLE_SORT) return un$Sort(this, comparefn);
return arraySort(aTypedArray$2(this), getSortCompare(comparefn));
},
!STABLE_SORT || ACCEPT_INCORRECT_ARGUMENTS
);
// 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,
};
// in old WebKit versions, `element.classList` is not an instance of global `DOMTokenList`
var classList = documentCreateElement("span").classList;
var DOMTokenListPrototype =
classList && classList.constructor && classList.constructor.prototype;
var domTokenListPrototype =
DOMTokenListPrototype === Object.prototype
? undefined
: DOMTokenListPrototype;
var PROPER_FUNCTION_NAME$1 = functionName.PROPER;
var CONFIGURABLE_FUNCTION_NAME$1 = functionName.CONFIGURABLE;
var IteratorPrototype$2 = iteratorsCore.IteratorPrototype;
var BUGGY_SAFARI_ITERATORS$1 = iteratorsCore.BUGGY_SAFARI_ITERATORS;
var ITERATOR$4 = 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$4] ||
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 (
CurrentIteratorPrototype !== Object.prototype &&
CurrentIteratorPrototype.next
) {
if (
objectGetPrototypeOf(CurrentIteratorPrototype) !==
IteratorPrototype$2
) {
if (objectSetPrototypeOf) {
objectSetPrototypeOf(
CurrentIteratorPrototype,
IteratorPrototype$2
);
} else if (!isCallable(CurrentIteratorPrototype[ITERATOR$4])) {
redefine(CurrentIteratorPrototype, ITERATOR$4, returnThis$1);
}
} // Set @@toStringTag to native iterators
setToStringTag(CurrentIteratorPrototype, TO_STRING_TAG, true, true);
}
} // fix Array.prototype.{ values, @@iterator }.name in V8 / FF
if (
PROPER_FUNCTION_NAME$1 &&
DEFAULT == VALUES &&
nativeIterator &&
nativeIterator.name !== VALUES
) {
if (CONFIGURABLE_FUNCTION_NAME$1) {
createNonEnumerableProperty(IterablePrototype, "name", VALUES);
} else {
INCORRECT_VALUES_NAME = true;
defaultIterator = function values() {
return functionCall(nativeIterator, this);
};
}
} // 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
);
} // define iterator
if (IterablePrototype[ITERATOR$4] !== defaultIterator) {
redefine(IterablePrototype, ITERATOR$4, defaultIterator, {
name: DEFAULT,
});
}
iterators[NAME] = defaultIterator;
return methods;
};
var ARRAY_ITERATOR = "Array Iterator";
var setInternalState$2 = internalState.set;
var getInternalState$3 = internalState.getterFor(ARRAY_ITERATOR); // `Array.prototype.entries` method
// https://tc39.es/ecma262/#sec-array.prototype.entries
// `Array.prototype.keys` method
// https://tc39.es/ecma262/#sec-array.prototype.keys
// `Array.prototype.values` method
// https://tc39.es/ecma262/#sec-array.prototype.values
// `Array.prototype[@@iterator]` method
// https://tc39.es/ecma262/#sec-array.prototype-@@iterator
// `CreateArrayIterator` internal method
// https://tc39.es/ecma262/#sec-createarrayiterator
var es_array_iterator = defineIterator(
Array,
"Array",
function (iterated, kind) {
setInternalState$2(this, {
type: ARRAY_ITERATOR,
target: toIndexedObject(iterated),
// target
index: 0,
// next index
kind: kind, // kind
}); // `%ArrayIteratorPrototype%.next` method
// https://tc39.es/ecma262/#sec-%arrayiteratorprototype%.next
},
function () {
var state = getInternalState$3(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.es/ecma262/#sec-createunmappedargumentsobject
// https://tc39.es/ecma262/#sec-createmappedargumentsobject
iterators.Arguments = iterators.Array; // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
addToUnscopables("keys");
addToUnscopables("values");
addToUnscopables("entries");
var ITERATOR$5 = wellKnownSymbol("iterator");
var TO_STRING_TAG$5 = wellKnownSymbol("toStringTag");
var ArrayValues = es_array_iterator.values;
var handlePrototype = function (CollectionPrototype, COLLECTION_NAME) {
if (CollectionPrototype) {
// some Chrome versions have non-configurable methods on DOMTokenList
if (CollectionPrototype[ITERATOR$5] !== ArrayValues)
try {
createNonEnumerableProperty(
CollectionPrototype,
ITERATOR$5,
ArrayValues
);
} catch (error) {
CollectionPrototype[ITERATOR$5] = ArrayValues;
}
if (!CollectionPrototype[TO_STRING_TAG$5]) {
createNonEnumerableProperty(
CollectionPrototype,
TO_STRING_TAG$5,
COLLECTION_NAME
);
}
if (domIterables[COLLECTION_NAME])
for (var METHOD_NAME in es_array_iterator) {
// some Chrome versions have non-configurable methods on DOMTokenList
if (
CollectionPrototype[METHOD_NAME] !==
es_array_iterator[METHOD_NAME]
)
try {
createNonEnumerableProperty(
CollectionPrototype,
METHOD_NAME,
es_array_iterator[METHOD_NAME]
);
} catch (error) {
CollectionPrototype[METHOD_NAME] =
es_array_iterator[METHOD_NAME];
}
}
}
};
for (var COLLECTION_NAME in domIterables) {
handlePrototype(
global_1[COLLECTION_NAME] && global_1[COLLECTION_NAME].prototype,
COLLECTION_NAME
);
}
handlePrototype(domTokenListPrototype, "DOMTokenList");
var FunctionPrototype$2 = Function.prototype;
var apply = FunctionPrototype$2.apply;
var bind$2 = FunctionPrototype$2.bind;
var call$2 = FunctionPrototype$2.call; // eslint-disable-next-line es/no-reflect -- safe
var functionApply =
(typeof Reflect == "object" && Reflect.apply) ||
(bind$2
? call$2.bind(apply)
: function () {
return call$2.apply(apply, arguments);
});
var arraySlice = functionUncurryThis([].slice);
var engineIsIos = /(?:ipad|iphone|ipod).*applewebkit/i.test(
engineUserAgent
);
var engineIsNode = classofRaw(global_1.process) == "process";
var set$2 = global_1.setImmediate;
var clear = global_1.clearImmediate;
var process$1 = global_1.process;
var Dispatch = global_1.Dispatch;
var Function$1 = global_1.Function;
var MessageChannel = global_1.MessageChannel;
var String$5 = global_1.String;
var counter = 0;
var queue = {};
var ONREADYSTATECHANGE = "onreadystatechange";
var location, defer, channel, port;
try {
// Deno throws a ReferenceError on `location` access without `--location` flag
location = global_1.location;
} catch (error) {
/* empty */
}
var run = function (id) {
if (hasOwnProperty_1(queue, id)) {
var fn = queue[id];
delete queue[id];
fn();
}
};
var runner = function (id) {
return function () {
run(id);
};
};
var listener = function (event) {
run(event.data);
};
var post = function (id) {
// old engines have not location.origin
global_1.postMessage(
String$5(id),
location.protocol + "//" + location.host
);
}; // Node.js 0.9+ & IE10+ has setImmediate, otherwise:
if (!set$2 || !clear) {
set$2 = function setImmediate(fn) {
var args = arraySlice(arguments, 1);
queue[++counter] = function () {
functionApply(isCallable(fn) ? fn : Function$1(fn), undefined, args);
};
defer(counter);
return counter;
};
clear = function clearImmediate(id) {
delete queue[id];
}; // Node.js 0.8-
if (engineIsNode) {
defer = function (id) {
process$1.nextTick(runner(id));
}; // Sphere (JS game engine) Dispatch API
} else if (Dispatch && Dispatch.now) {
defer = function (id) {
Dispatch.now(runner(id));
}; // Browsers with MessageChannel, includes WebWorkers
// except iOS - https://github.com/zloirock/core-js/issues/624
} else if (MessageChannel && !engineIsIos) {
channel = new MessageChannel();
port = channel.port2;
channel.port1.onmessage = listener;
defer = functionBindContext(port.postMessage, port); // Browsers with postMessage, skip WebWorkers
// IE8 has postMessage, but it's sync & typeof its postMessage is 'object'
} else if (
global_1.addEventListener &&
isCallable(global_1.postMessage) &&
!global_1.importScripts &&
location &&
location.protocol !== "file:" &&
!fails(post)
) {
defer = post;
global_1.addEventListener("message", listener, false); // IE8-
} else if (ONREADYSTATECHANGE in documentCreateElement("script")) {
defer = function (id) {
html.appendChild(documentCreateElement("script"))[
ONREADYSTATECHANGE
] = function () {
html.removeChild(this);
run(id);
};
}; // Rest old browsers
} else {
defer = function (id) {
setTimeout(runner(id), 0);
};
}
}
var task = {
set: set$2,
clear: clear,
};
var FORCED = !global_1.setImmediate || !global_1.clearImmediate; // http://w3c.github.io/setImmediate/
_export(
{
global: true,
bind: true,
enumerable: true,
forced: FORCED,
},
{
// `setImmediate` method
// http://w3c.github.io/setImmediate/#si-setImmediate
setImmediate: task.set,
// `clearImmediate` method
// http://w3c.github.io/setImmediate/#si-clearImmediate
clearImmediate: task.clear,
}
);
var engineIsIosPebble =
/ipad|iphone|ipod/i.test(engineUserAgent) &&
global_1.Pebble !== undefined;
var engineIsWebosWebkit = /web0s(?!.*chrome)/i.test(engineUserAgent);
var getOwnPropertyDescriptor$2 = objectGetOwnPropertyDescriptor.f;
var macrotask = task.set;
var MutationObserver =
global_1.MutationObserver || global_1.WebKitMutationObserver;
var document$2 = global_1.document;
var process$2 = global_1.process;
var Promise = global_1.Promise; // Node.js 11 shows ExperimentalWarning on getting `queueMicrotask`
var queueMicrotaskDescriptor = getOwnPropertyDescriptor$2(
global_1,
"queueMicrotask"
);
var queueMicrotask =
queueMicrotaskDescriptor && queueMicrotaskDescriptor.value;
var flush, head, last, notify, toggle, node, promise, then; // modern engines have queueMicrotask method
if (!queueMicrotask) {
flush = function () {
var parent, fn;
if (engineIsNode && (parent = process$2.domain)) parent.exit();
while (head) {
fn = head.fn;
head = head.next;
try {
fn();
} catch (error) {
if (head) notify();
else last = undefined;
throw error;
}
}
last = undefined;
if (parent) parent.enter();
}; // browsers with MutationObserver, except iOS - https://github.com/zloirock/core-js/issues/339
// also except WebOS Webkit https://github.com/zloirock/core-js/issues/898
if (
!engineIsIos &&
!engineIsNode &&
!engineIsWebosWebkit &&
MutationObserver &&
document$2
) {
toggle = true;
node = document$2.createTextNode("");
new MutationObserver(flush).observe(node, {
characterData: true,
});
notify = function () {
node.data = toggle = !toggle;
}; // environments with maybe non-completely correct, but existent Promise
} else if (!engineIsIosPebble && Promise && Promise.resolve) {
// Promise.resolve without an argument throws an error in LG WebOS 2
promise = Promise.resolve(undefined); // workaround of WebKit ~ iOS Safari 10.1 bug
promise.constructor = Promise;
then = functionBindContext(promise.then, promise);
notify = function () {
then(flush);
}; // Node.js without promises
} else if (engineIsNode) {
notify = function () {
process$2.nextTick(flush);
}; // for other environments - macrotask based on:
// - setImmediate
// - MessageChannel
// - window.postMessag
// - onreadystatechange
// - setTimeout
} else {
// strange IE + webpack dev server bug - use .bind(global)
macrotask = functionBindContext(macrotask, global_1);
notify = function () {
macrotask(flush);
};
}
}
var microtask =
queueMicrotask ||
function (fn) {
var task$$1 = {
fn: fn,
next: undefined,
};
if (last) last.next = task$$1;
if (!head) {
head = task$$1;
notify();
}
last = task$$1;
};
var process$3 = global_1.process; // `queueMicrotask` method
// https://html.spec.whatwg.org/multipage/timers-and-user-prompts.html#dom-queuemicrotask
_export(
{
global: true,
enumerable: true,
noTargetGet: true,
},
{
queueMicrotask: function queueMicrotask(fn) {
var domain = engineIsNode && process$3.domain;
microtask(domain ? domain.bind(fn) : fn);
},
}
);
// File generated automatically. Don't modify it.
})((this.window = this.window || {}));
if (window._main_polyfill_core) {
console.warn("main.polyfill.core is loaded more than once on this page");
}
window._main_polyfill_core = true;
(function (exports) {
"use strict";
var bxTmp = window.BX;
window.BX = function (node) {
if (window.BX.type.isNotEmptyString(node)) {
return document.getElementById(node);
}
if (window.BX.type.isDomNode(node)) {
return node;
}
if (window.BX.type.isFunction(node)) {
return window.BX.ready(node);
}
return null;
};
if (bxTmp) {
Object.keys(bxTmp).forEach((key) => {
window.BX[key] = bxTmp[key];
});
}
exports = window.BX;
/**
* Gets object.toString result
* @param value
* @return {string}
*/
function getTag(value) {
return Object.prototype.toString.call(value);
}
const objectCtorString = Function.prototype.toString.call(Object);
/**
* @memberOf BX
*/
let Type = /*#__PURE__*/ (function () {
function Type() {
babelHelpers.classCallCheck(this, Type);
}
babelHelpers.createClass(Type, null, [
{
key: "isString",
/**
* Checks that value is string
* @param value
* @return {boolean}
*/
value: function isString(value) {
return typeof value === "string";
},
/**
* Returns true if a value is not empty string
* @param value
* @returns {boolean}
*/
},
{
key: "isStringFilled",
value: function isStringFilled(value) {
return Type.isString(value) && value !== "";
},
/**
* Checks that value is function
* @param value
* @return {boolean}
*/
},
{
key: "isFunction",
value: function isFunction(value) {
return typeof value === "function";
},
/**
* Checks that value is object
* @param value
* @return {boolean}
*/
},
{
key: "isObject",
value: function isObject(value) {
return (
!!value &&
(typeof value === "object" || typeof value === "function")
);
},
/**
* Checks that value is object like
* @param value
* @return {boolean}
*/
},
{
key: "isObjectLike",
value: function isObjectLike(value) {
return !!value && typeof value === "object";
},
/**
* Checks that value is plain object
* @param value
* @return {boolean}
*/
},
{
key: "isPlainObject",
value: function isPlainObject(value) {
if (
!Type.isObjectLike(value) ||
getTag(value) !== "[object Object]"
) {
return false;
}
const proto = Object.getPrototypeOf(value);
if (proto === null) {
return true;
}
const ctor =
proto.hasOwnProperty("constructor") && proto.constructor;
return (
typeof ctor === "function" &&
Function.prototype.toString.call(ctor) === objectCtorString
);
},
/**
* Checks that value is boolean
* @param value
* @return {boolean}
*/
},
{
key: "isBoolean",
value: function isBoolean(value) {
return value === true || value === false;
},
/**
* Checks that value is number
* @param value
* @return {boolean}
*/
},
{
key: "isNumber",
value: function isNumber(value) {
return !Number.isNaN(value) && typeof value === "number";
},
/**
* Checks that value is integer
* @param value
* @return {boolean}
*/
},
{
key: "isInteger",
value: function isInteger(value) {
return Type.isNumber(value) && value % 1 === 0;
},
/**
* Checks that value is float
* @param value
* @return {boolean}
*/
},
{
key: "isFloat",
value: function isFloat(value) {
return Type.isNumber(value) && !Type.isInteger(value);
},
/**
* Checks that value is nil
* @param value
* @return {boolean}
*/
},
{
key: "isNil",
value: function isNil(value) {
return value === null || value === undefined;
},
/**
* Checks that value is array
* @param value
* @return {boolean}
*/
},
{
key: "isArray",
value: function isArray(value) {
return !Type.isNil(value) && Array.isArray(value);
},
/**
* Returns true if a value is an array and it has at least one element
* @param value
* @returns {boolean}
*/
},
{
key: "isArrayFilled",
value: function isArrayFilled(value) {
return Type.isArray(value) && value.length > 0;
},
/**
* Checks that value is array like
* @param value
* @return {boolean}
*/
},
{
key: "isArrayLike",
value: function isArrayLike(value) {
return (
!Type.isNil(value) &&
!Type.isFunction(value) &&
value.length > -1 &&
value.length <= Number.MAX_SAFE_INTEGER
);
},
/**
* Checks that value is Date
* @param value
* @return {boolean}
*/
},
{
key: "isDate",
value: function isDate(value) {
return (
Type.isObjectLike(value) && getTag(value) === "[object Date]"
);
},
/**
* Checks that is DOM node
* @param value
* @return {boolean}
*/
},
{
key: "isDomNode",
value: function isDomNode(value) {
return (
Type.isObjectLike(value) &&
!Type.isPlainObject(value) &&
"nodeType" in value
);
},
/**
* Checks that value is element node
* @param value
* @return {boolean}
*/
},
{
key: "isElementNode",
value: function isElementNode(value) {
return (
Type.isDomNode(value) && value.nodeType === Node.ELEMENT_NODE
);
},
/**
* Checks that value is text node
* @param value
* @return {boolean}
*/
},
{
key: "isTextNode",
value: function isTextNode(value) {
return Type.isDomNode(value) && value.nodeType === Node.TEXT_NODE;
},
/**
* Checks that value is Map
* @param value
* @return {boolean}
*/
},
{
key: "isMap",
value: function isMap(value) {
return Type.isObjectLike(value) && getTag(value) === "[object Map]";
},
/**
* Checks that value is Set
* @param value
* @return {boolean}
*/
},
{
key: "isSet",
value: function isSet(value) {
return Type.isObjectLike(value) && getTag(value) === "[object Set]";
},
/**
* Checks that value is WeakMap
* @param value
* @return {boolean}
*/
},
{
key: "isWeakMap",
value: function isWeakMap(value) {
return (
Type.isObjectLike(value) && getTag(value) === "[object WeakMap]"
);
},
/**
* Checks that value is WeakSet
* @param value
* @return {boolean}
*/
},
{
key: "isWeakSet",
value: function isWeakSet(value) {
return (
Type.isObjectLike(value) && getTag(value) === "[object WeakSet]"
);
},
/**
* Checks that value is prototype
* @param value
* @return {boolean}
*/
},
{
key: "isPrototype",
value: function isPrototype(value) {
return (
((typeof (value && value.constructor) === "function" &&
value.constructor.prototype) ||
Object.prototype) === value
);
},
/**
* Checks that value is regexp
* @param value
* @return {boolean}
*/
},
{
key: "isRegExp",
value: function isRegExp(value) {
return (
Type.isObjectLike(value) && getTag(value) === "[object RegExp]"
);
},
/**
* Checks that value is null
* @param value
* @return {boolean}
*/
},
{
key: "isNull",
value: function isNull(value) {
return value === null;
},
/**
* Checks that value is undefined
* @param value
* @return {boolean}
*/
},
{
key: "isUndefined",
value: function isUndefined(value) {
return typeof value === "undefined";
},
/**
* Checks that value is ArrayBuffer
* @param value
* @return {boolean}
*/
},
{
key: "isArrayBuffer",
value: function isArrayBuffer(value) {
return (
Type.isObjectLike(value) &&
getTag(value) === "[object ArrayBuffer]"
);
},
/**
* Checks that value is typed array
* @param value
* @return {boolean}
*/
},
{
key: "isTypedArray",
value: function isTypedArray(value) {
const regExpTypedTag =
/^\[object (?:Float(?:32|64)|(?:Int|Uint)(?:8|16|32)|Uint8Clamped)]$/;
return (
Type.isObjectLike(value) && regExpTypedTag.test(getTag(value))
);
},
/**
* Checks that value is Blob
* @param value
* @return {boolean}
*/
},
{
key: "isBlob",
value: function isBlob(value) {
return (
Type.isObjectLike(value) &&
Type.isNumber(value.size) &&
Type.isString(value.type) &&
Type.isFunction(value.slice)
);
},
/**
* Checks that value is File
* @param value
* @return {boolean}
*/
},
{
key: "isFile",
value: function isFile(value) {
return (
Type.isBlob(value) &&
Type.isString(value.name) &&
(Type.isNumber(value.lastModified) ||
Type.isObjectLike(value.lastModifiedDate))
);
},
/**
* Checks that value is FormData
* @param value
* @return {boolean}
*/
},
{
key: "isFormData",
value: function isFormData(value) {
return value instanceof FormData;
},
},
]);
return Type;
})();
/**
* @memberOf BX
*/
let Reflection = /*#__PURE__*/ (function () {
function Reflection() {
babelHelpers.classCallCheck(this, Reflection);
}
babelHelpers.createClass(Reflection, null, [
{
key: "getClass",
/**
* Gets link to function by function name
* @param className
* @return {?Function}
*/
value: function getClass(className) {
if (Type.isString(className) && !!className) {
let classFn = null;
let currentNamespace = window;
const namespaces = className.split(".");
for (let i = 0; i < namespaces.length; i += 1) {
const namespace = namespaces[i];
if (!currentNamespace[namespace]) {
return null;
}
currentNamespace = currentNamespace[namespace];
classFn = currentNamespace;
}
return classFn;
}
if (Type.isFunction(className)) {
return className;
}
return null;
},
/**
* Creates a namespace or returns a link to a previously created one
* @param {String} namespaceName
* @return {Object | Function | null}
*/
},
{
key: "namespace",
value: function namespace(namespaceName) {
let parts = namespaceName.split(".");
let parent = window.BX;
if (parts[0] === "BX") {
parts = parts.slice(1);
}
for (let i = 0; i < parts.length; i += 1) {
if (Type.isUndefined(parent[parts[i]])) {
parent[parts[i]] = {};
}
parent = parent[parts[i]];
}
return parent;
},
},
]);
return Reflection;
})();
const reEscape = /[&<>'"]/g;
const reUnescape = /&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34);/g;
const escapeEntities = {
"&": "&",
"<": "<",
">": ">",
"'": "'",
'"': """,
};
const unescapeEntities = {
"&": "&",
"&": "&",
"<": "<",
"<": "<",
">": ">",
">": ">",
"'": "'",
"'": "'",
""": '"',
""": '"',
};
/**
* @memberOf BX
*/
let Text = /*#__PURE__*/ (function () {
function Text() {
babelHelpers.classCallCheck(this, Text);
}
babelHelpers.createClass(Text, null, [
{
key: "encode",
/**
* Encodes all unsafe entities
* @param {string} value
* @return {string}
*/
value: function encode(value) {
if (Type.isString(value)) {
return value.replace(reEscape, (item) => escapeEntities[item]);
}
return value;
},
/**
* Decodes all encoded entities
* @param {string} value
* @return {string}
*/
},
{
key: "decode",
value: function decode(value) {
if (Type.isString(value)) {
return value.replace(
reUnescape,
(item) => unescapeEntities[item]
);
}
return value;
},
},
{
key: "getRandom",
value: function getRandom(length = 8) {
// eslint-disable-next-line
return [...Array(length)]
.map(() => (~~(Math.random() * 36)).toString(36))
.join("");
},
},
{
key: "toNumber",
value: function toNumber(value) {
const parsedValue = Number.parseFloat(value);
if (Type.isNumber(parsedValue)) {
return parsedValue;
}
return 0;
},
},
{
key: "toInteger",
value: function toInteger(value) {
return Text.toNumber(Number.parseInt(value, 10));
},
},
{
key: "toBoolean",
value: function toBoolean(value, trueValues = []) {
const transformedValue = Type.isString(value)
? value.toLowerCase()
: value;
return ["true", "y", "1", 1, true, ...trueValues].includes(
transformedValue
);
},
},
{
key: "toCamelCase",
value: function toCamelCase(str) {
if (!Type.isStringFilled(str)) {
return str;
}
const regex = /[-_\s]+(.)?/g;
if (!regex.test(str)) {
return str.match(/^[A-Z]+$/)
? str.toLowerCase()
: str[0].toLowerCase() + str.slice(1);
}
str = str.toLowerCase();
str = str.replace(regex, function (match, letter) {
return letter ? letter.toUpperCase() : "";
});
return str[0].toLowerCase() + str.substr(1);
},
},
{
key: "toPascalCase",
value: function toPascalCase(str) {
if (!Type.isStringFilled(str)) {
return str;
}
return this.capitalize(this.toCamelCase(str));
},
},
{
key: "toKebabCase",
value: function toKebabCase(str) {
if (!Type.isStringFilled(str)) {
return str;
}
const matches = str.match(
/[A-Z]{2,}(?=[A-Z][a-z]+[0-9]*|\b)|[A-Z]?[a-z]+[0-9]*|[A-Z]|[0-9]+/g
);
if (!matches) {
return str;
}
return matches.map((x) => x.toLowerCase()).join("-");
},
},
{
key: "capitalize",
value: function capitalize(str) {
if (!Type.isStringFilled(str)) {
return str;
}
return str[0].toUpperCase() + str.substr(1);
},
},
]);
return Text;
})();
const aliases = {
mousewheel: ["DOMMouseScroll"],
bxchange: ["change", "cut", "paste", "drop", "keyup"],
animationend: [
"animationend",
"oAnimationEnd",
"webkitAnimationEnd",
"MSAnimationEnd",
],
transitionend: [
"webkitTransitionEnd",
"otransitionend",
"oTransitionEnd",
"msTransitionEnd",
"transitionend",
],
fullscreenchange: [
"fullscreenchange",
"webkitfullscreenchange",
"mozfullscreenchange",
"MSFullscreenChange",
],
fullscreenerror: [
"fullscreenerror",
"webkitfullscreenerror",
"mozfullscreenerror",
"MSFullscreenError",
],
};
let Registry = /*#__PURE__*/ (function () {
function Registry() {
babelHelpers.classCallCheck(this, Registry);
babelHelpers.defineProperty(this, "registry", new WeakMap());
}
babelHelpers.createClass(Registry, [
{
key: "set",
value: function set(target, event, listener) {
const events = this.get(target);
if (!Type.isSet(events[event])) {
events[event] = new Set();
}
events[event].add(listener);
this.registry.set(target, events);
},
},
{
key: "get",
value: function get(target) {
return this.registry.get(target) || {};
},
},
{
key: "has",
value: function has(target, event, listener) {
if (event && listener) {
return (
this.registry.has(target) &&
this.registry.get(target)[event].has(listener)
);
}
return this.registry.has(target);
},
},
{
key: "delete",
value: function _delete(target, event, listener) {
if (!Type.isDomNode(target)) {
return;
}
if (Type.isString(event) && Type.isFunction(listener)) {
const events = this.registry.get(target);
if (Type.isPlainObject(events) && Type.isSet(events[event])) {
events[event].delete(listener);
}
return;
}
if (Type.isString(event)) {
const events = this.registry.get(target);
if (Type.isPlainObject(events) && Type.isSet(events[event])) {
events[event] = new Set();
}
return;
}
this.registry.delete(target);
},
},
]);
return Registry;
})();
var registry = new Registry();
function isOptionSupported(name) {
let isSupported = false;
try {
const options = Object.defineProperty({}, name, {
get() {
isSupported = true;
return undefined;
},
});
window.addEventListener("test", null, options);
} catch (err) {
// eslint-disable-next-line
}
return isSupported;
}
function fetchSupportedListenerOptions(options) {
if (!Type.isPlainObject(options)) {
return options;
}
return Object.keys(options).reduce((acc, name) => {
if (isOptionSupported(name)) {
acc[name] = options[name];
}
return acc;
}, {});
}
function bind(target, eventName, handler, options) {
if (!Type.isObject(target) || !Type.isFunction(target.addEventListener)) {
return;
}
const listenerOptions = fetchSupportedListenerOptions(options);
if (eventName in aliases) {
aliases[eventName].forEach((key) => {
target.addEventListener(key, handler, listenerOptions);
registry.set(target, eventName, handler);
});
return;
}
target.addEventListener(eventName, handler, listenerOptions);
registry.set(target, eventName, handler);
}
function unbind(target, eventName, handler, options) {
if (
!Type.isObject(target) ||
!Type.isFunction(target.removeEventListener)
) {
return;
}
const listenerOptions = fetchSupportedListenerOptions(options);
if (eventName in aliases) {
aliases[eventName].forEach((key) => {
target.removeEventListener(key, handler, listenerOptions);
registry.delete(target, key, handler);
});
return;
}
target.removeEventListener(eventName, handler, listenerOptions);
registry.delete(target, eventName, handler);
}
function unbindAll(target, eventName) {
const events = registry.get(target);
Object.keys(events).forEach((currentEvent) => {
events[currentEvent].forEach((handler) => {
if (!Type.isString(eventName) || eventName === currentEvent) {
unbind(target, currentEvent, handler);
}
});
});
}
function bindOnce(target, eventName, handler, options) {
const once = function once(...args) {
unbind(target, eventName, once, options);
handler(...args);
};
bind(target, eventName, once, options);
}
// eslint-disable-next-line
let debugState = true;
function enableDebug() {
debugState = true;
}
function disableDebug() {
debugState = false;
}
function isDebugEnabled() {
return debugState;
}
function debug(...args) {
if (isDebugEnabled() && Type.isObject(window.console)) {
if (Type.isFunction(window.console.log)) {
window.console.log("BX.debug: ", args.length > 0 ? args : args[0]);
if (args[0] instanceof Error && args[0].stack) {
window.console.log("BX.debug error stack trace", args[0].stack);
}
}
if (Type.isFunction(window.console.trace)) {
// eslint-disable-next-line
console.trace();
}
}
}
var debugNs = /*#__PURE__*/ Object.freeze({
get debugState() {
return debugState;
},
enableDebug: enableDebug,
disableDebug: disableDebug,
isDebugEnabled: isDebugEnabled,
default: debug,
});
const extensionsStorage = new Map();
const ajaxController = "main.bitrix.main.controller.loadext.getextensions";
function loadAssets(options) {
return new Promise((resolve) => {
// eslint-disable-next-line
BX.ajax
.runAction(ajaxController, {
data: options,
})
.then(resolve);
});
}
function fetchInlineScripts(acc, item) {
if (item.isInternal) {
acc.push(item.JS);
}
return acc;
}
function fetchExternalScripts(acc, item) {
if (!item.isInternal) {
acc.push(item.JS);
}
return acc;
}
function fetchExternalStyles(acc, item) {
if (Type.isString(item) && item !== "") {
acc.push(item);
}
return acc;
}
function fetchExtensionSettings(html) {
if (Type.isStringFilled(html)) {
const scripts = html.match(
/