@jsxtools/eslint-plugin-jsx-a11y
Version:
Static AST checker for accessibility rules on JSX elements for flat ESLint Config.
5,244 lines • 153 kB
JavaScript
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
function getDefaultExportFromCjs (x) {
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
}
function getAugmentedNamespace(n) {
if (n.__esModule) return n;
var f = n.default;
if (typeof f == "function") {
var a = function a () {
if (this instanceof a) {
return Reflect.construct(f, arguments, this.constructor);
}
return f.apply(this, arguments);
};
a.prototype = f.prototype;
} else a = {};
Object.defineProperty(a, '__esModule', {value: true});
Object.keys(n).forEach(function (k) {
var d = Object.getOwnPropertyDescriptor(n, k);
Object.defineProperty(a, k, d.get ? d : {
enumerable: true,
get: function () {
return n[k];
}
});
});
return a;
}
var callBind$6 = {exports: {}};
/* eslint no-invalid-this: 1 */
var ERROR_MESSAGE = 'Function.prototype.bind called on incompatible ';
var toStr$9 = Object.prototype.toString;
var max = Math.max;
var funcType = '[object Function]';
var concatty = function concatty(a, b) {
var arr = [];
for (var i = 0; i < a.length; i += 1) {
arr[i] = a[i];
}
for (var j = 0; j < b.length; j += 1) {
arr[j + a.length] = b[j];
}
return arr;
};
var slicy = function slicy(arrLike, offset) {
var arr = [];
for (var i = offset || 0, j = 0; i < arrLike.length; i += 1, j += 1) {
arr[j] = arrLike[i];
}
return arr;
};
var joiny = function (arr, joiner) {
var str = '';
for (var i = 0; i < arr.length; i += 1) {
str += arr[i];
if (i + 1 < arr.length) {
str += joiner;
}
}
return str;
};
var implementation$k = function bind(that) {
var target = this;
if (typeof target !== 'function' || toStr$9.apply(target) !== funcType) {
throw new TypeError(ERROR_MESSAGE + target);
}
var args = slicy(arguments, 1);
var bound;
var binder = function () {
if (this instanceof bound) {
var result = target.apply(
this,
concatty(args, arguments)
);
if (Object(result) === result) {
return result;
}
return this;
}
return target.apply(
that,
concatty(args, arguments)
);
};
var boundLength = max(0, target.length - args.length);
var boundArgs = [];
for (var i = 0; i < boundLength; i++) {
boundArgs[i] = '$' + i;
}
bound = Function('binder', 'return function (' + joiny(boundArgs, ',') + '){ return binder.apply(this,arguments); }')(binder);
if (target.prototype) {
var Empty = function Empty() {};
Empty.prototype = target.prototype;
bound.prototype = new Empty();
Empty.prototype = null;
}
return bound;
};
var implementation$j = implementation$k;
var functionBind = Function.prototype.bind || implementation$j;
/** @type {import('.')} */
var esErrors = Error;
/** @type {import('./eval')} */
var _eval = EvalError;
/** @type {import('./range')} */
var range = RangeError;
/** @type {import('./ref')} */
var ref = ReferenceError;
/** @type {import('./syntax')} */
var syntax = SyntaxError;
/** @type {import('./type')} */
var type = TypeError;
/** @type {import('./uri')} */
var uri = URIError;
/* eslint complexity: [2, 18], max-statements: [2, 33] */
var shams$1 = function hasSymbols() {
if (typeof Symbol !== 'function' || typeof Object.getOwnPropertySymbols !== 'function') { return false; }
if (typeof Symbol.iterator === 'symbol') { return true; }
var obj = {};
var sym = Symbol('test');
var symObj = Object(sym);
if (typeof sym === 'string') { return false; }
if (Object.prototype.toString.call(sym) !== '[object Symbol]') { return false; }
if (Object.prototype.toString.call(symObj) !== '[object Symbol]') { return false; }
// temp disabled per https://github.com/ljharb/object.assign/issues/17
// if (sym instanceof Symbol) { return false; }
// temp disabled per https://github.com/WebReflection/get-own-property-symbols/issues/4
// if (!(symObj instanceof Symbol)) { return false; }
// if (typeof Symbol.prototype.toString !== 'function') { return false; }
// if (String(sym) !== Symbol.prototype.toString.call(sym)) { return false; }
var symVal = 42;
obj[sym] = symVal;
for (sym in obj) { return false; } // eslint-disable-line no-restricted-syntax, no-unreachable-loop
if (typeof Object.keys === 'function' && Object.keys(obj).length !== 0) { return false; }
if (typeof Object.getOwnPropertyNames === 'function' && Object.getOwnPropertyNames(obj).length !== 0) { return false; }
var syms = Object.getOwnPropertySymbols(obj);
if (syms.length !== 1 || syms[0] !== sym) { return false; }
if (!Object.prototype.propertyIsEnumerable.call(obj, sym)) { return false; }
if (typeof Object.getOwnPropertyDescriptor === 'function') {
var descriptor = Object.getOwnPropertyDescriptor(obj, sym);
if (descriptor.value !== symVal || descriptor.enumerable !== true) { return false; }
}
return true;
};
var origSymbol = typeof Symbol !== 'undefined' && Symbol;
var hasSymbolSham = shams$1;
var hasSymbols$4 = function hasNativeSymbols() {
if (typeof origSymbol !== 'function') { return false; }
if (typeof Symbol !== 'function') { return false; }
if (typeof origSymbol('foo') !== 'symbol') { return false; }
if (typeof Symbol('bar') !== 'symbol') { return false; }
return hasSymbolSham();
};
var test = {
__proto__: null,
foo: {}
};
var $Object$1 = Object;
/** @type {import('.')} */
var hasProto$3 = function hasProto() {
// @ts-expect-error: TS errors on an inherited property for some reason
return { __proto__: test }.foo === test.foo
&& !(test instanceof $Object$1);
};
var call = Function.prototype.call;
var $hasOwn = Object.prototype.hasOwnProperty;
var bind$1 = functionBind;
/** @type {(o: {}, p: PropertyKey) => p is keyof o} */
var hasown$1 = bind$1.call(call, $hasOwn);
var undefined$1;
var $Error = esErrors;
var $EvalError = _eval;
var $RangeError = range;
var $ReferenceError = ref;
var $SyntaxError$1 = syntax;
var $TypeError$9 = type;
var $URIError = uri;
var $Function = Function;
// eslint-disable-next-line consistent-return
var getEvalledConstructor = function (expressionSyntax) {
try {
return $Function('"use strict"; return (' + expressionSyntax + ').constructor;')();
} catch (e) {}
};
var $gOPD$1 = Object.getOwnPropertyDescriptor;
if ($gOPD$1) {
try {
$gOPD$1({}, '');
} catch (e) {
$gOPD$1 = null; // this is IE 8, which has a broken gOPD
}
}
var throwTypeError = function () {
throw new $TypeError$9();
};
var ThrowTypeError = $gOPD$1
? (function () {
try {
// eslint-disable-next-line no-unused-expressions, no-caller, no-restricted-properties
arguments.callee; // IE 8 does not throw here
return throwTypeError;
} catch (calleeThrows) {
try {
// IE 8 throws on Object.getOwnPropertyDescriptor(arguments, '')
return $gOPD$1(arguments, 'callee').get;
} catch (gOPDthrows) {
return throwTypeError;
}
}
}())
: throwTypeError;
var hasSymbols$3 = hasSymbols$4();
var hasProto$2 = hasProto$3();
var getProto$3 = Object.getPrototypeOf || (
hasProto$2
? function (x) { return x.__proto__; } // eslint-disable-line no-proto
: null
);
var needsEval = {};
var TypedArray = typeof Uint8Array === 'undefined' || !getProto$3 ? undefined$1 : getProto$3(Uint8Array);
var INTRINSICS = {
__proto__: null,
'%AggregateError%': typeof AggregateError === 'undefined' ? undefined$1 : AggregateError,
'%Array%': Array,
'%ArrayBuffer%': typeof ArrayBuffer === 'undefined' ? undefined$1 : ArrayBuffer,
'%ArrayIteratorPrototype%': hasSymbols$3 && getProto$3 ? getProto$3([][Symbol.iterator]()) : undefined$1,
'%AsyncFromSyncIteratorPrototype%': undefined$1,
'%AsyncFunction%': needsEval,
'%AsyncGenerator%': needsEval,
'%AsyncGeneratorFunction%': needsEval,
'%AsyncIteratorPrototype%': needsEval,
'%Atomics%': typeof Atomics === 'undefined' ? undefined$1 : Atomics,
'%BigInt%': typeof BigInt === 'undefined' ? undefined$1 : BigInt,
'%BigInt64Array%': typeof BigInt64Array === 'undefined' ? undefined$1 : BigInt64Array,
'%BigUint64Array%': typeof BigUint64Array === 'undefined' ? undefined$1 : BigUint64Array,
'%Boolean%': Boolean,
'%DataView%': typeof DataView === 'undefined' ? undefined$1 : DataView,
'%Date%': Date,
'%decodeURI%': decodeURI,
'%decodeURIComponent%': decodeURIComponent,
'%encodeURI%': encodeURI,
'%encodeURIComponent%': encodeURIComponent,
'%Error%': $Error,
'%eval%': eval, // eslint-disable-line no-eval
'%EvalError%': $EvalError,
'%Float32Array%': typeof Float32Array === 'undefined' ? undefined$1 : Float32Array,
'%Float64Array%': typeof Float64Array === 'undefined' ? undefined$1 : Float64Array,
'%FinalizationRegistry%': typeof FinalizationRegistry === 'undefined' ? undefined$1 : FinalizationRegistry,
'%Function%': $Function,
'%GeneratorFunction%': needsEval,
'%Int8Array%': typeof Int8Array === 'undefined' ? undefined$1 : Int8Array,
'%Int16Array%': typeof Int16Array === 'undefined' ? undefined$1 : Int16Array,
'%Int32Array%': typeof Int32Array === 'undefined' ? undefined$1 : Int32Array,
'%isFinite%': isFinite,
'%isNaN%': isNaN,
'%IteratorPrototype%': hasSymbols$3 && getProto$3 ? getProto$3(getProto$3([][Symbol.iterator]())) : undefined$1,
'%JSON%': typeof JSON === 'object' ? JSON : undefined$1,
'%Map%': typeof Map === 'undefined' ? undefined$1 : Map,
'%MapIteratorPrototype%': typeof Map === 'undefined' || !hasSymbols$3 || !getProto$3 ? undefined$1 : getProto$3(new Map()[Symbol.iterator]()),
'%Math%': Math,
'%Number%': Number,
'%Object%': Object,
'%parseFloat%': parseFloat,
'%parseInt%': parseInt,
'%Promise%': typeof Promise === 'undefined' ? undefined$1 : Promise,
'%Proxy%': typeof Proxy === 'undefined' ? undefined$1 : Proxy,
'%RangeError%': $RangeError,
'%ReferenceError%': $ReferenceError,
'%Reflect%': typeof Reflect === 'undefined' ? undefined$1 : Reflect,
'%RegExp%': RegExp,
'%Set%': typeof Set === 'undefined' ? undefined$1 : Set,
'%SetIteratorPrototype%': typeof Set === 'undefined' || !hasSymbols$3 || !getProto$3 ? undefined$1 : getProto$3(new Set()[Symbol.iterator]()),
'%SharedArrayBuffer%': typeof SharedArrayBuffer === 'undefined' ? undefined$1 : SharedArrayBuffer,
'%String%': String,
'%StringIteratorPrototype%': hasSymbols$3 && getProto$3 ? getProto$3(''[Symbol.iterator]()) : undefined$1,
'%Symbol%': hasSymbols$3 ? Symbol : undefined$1,
'%SyntaxError%': $SyntaxError$1,
'%ThrowTypeError%': ThrowTypeError,
'%TypedArray%': TypedArray,
'%TypeError%': $TypeError$9,
'%Uint8Array%': typeof Uint8Array === 'undefined' ? undefined$1 : Uint8Array,
'%Uint8ClampedArray%': typeof Uint8ClampedArray === 'undefined' ? undefined$1 : Uint8ClampedArray,
'%Uint16Array%': typeof Uint16Array === 'undefined' ? undefined$1 : Uint16Array,
'%Uint32Array%': typeof Uint32Array === 'undefined' ? undefined$1 : Uint32Array,
'%URIError%': $URIError,
'%WeakMap%': typeof WeakMap === 'undefined' ? undefined$1 : WeakMap,
'%WeakRef%': typeof WeakRef === 'undefined' ? undefined$1 : WeakRef,
'%WeakSet%': typeof WeakSet === 'undefined' ? undefined$1 : WeakSet
};
if (getProto$3) {
try {
null.error; // eslint-disable-line no-unused-expressions
} catch (e) {
// https://github.com/tc39/proposal-shadowrealm/pull/384#issuecomment-1364264229
var errorProto = getProto$3(getProto$3(e));
INTRINSICS['%Error.prototype%'] = errorProto;
}
}
var doEval = function doEval(name) {
var value;
if (name === '%AsyncFunction%') {
value = getEvalledConstructor('async function () {}');
} else if (name === '%GeneratorFunction%') {
value = getEvalledConstructor('function* () {}');
} else if (name === '%AsyncGeneratorFunction%') {
value = getEvalledConstructor('async function* () {}');
} else if (name === '%AsyncGenerator%') {
var fn = doEval('%AsyncGeneratorFunction%');
if (fn) {
value = fn.prototype;
}
} else if (name === '%AsyncIteratorPrototype%') {
var gen = doEval('%AsyncGenerator%');
if (gen && getProto$3) {
value = getProto$3(gen.prototype);
}
}
INTRINSICS[name] = value;
return value;
};
var LEGACY_ALIASES = {
__proto__: null,
'%ArrayBufferPrototype%': ['ArrayBuffer', 'prototype'],
'%ArrayPrototype%': ['Array', 'prototype'],
'%ArrayProto_entries%': ['Array', 'prototype', 'entries'],
'%ArrayProto_forEach%': ['Array', 'prototype', 'forEach'],
'%ArrayProto_keys%': ['Array', 'prototype', 'keys'],
'%ArrayProto_values%': ['Array', 'prototype', 'values'],
'%AsyncFunctionPrototype%': ['AsyncFunction', 'prototype'],
'%AsyncGenerator%': ['AsyncGeneratorFunction', 'prototype'],
'%AsyncGeneratorPrototype%': ['AsyncGeneratorFunction', 'prototype', 'prototype'],
'%BooleanPrototype%': ['Boolean', 'prototype'],
'%DataViewPrototype%': ['DataView', 'prototype'],
'%DatePrototype%': ['Date', 'prototype'],
'%ErrorPrototype%': ['Error', 'prototype'],
'%EvalErrorPrototype%': ['EvalError', 'prototype'],
'%Float32ArrayPrototype%': ['Float32Array', 'prototype'],
'%Float64ArrayPrototype%': ['Float64Array', 'prototype'],
'%FunctionPrototype%': ['Function', 'prototype'],
'%Generator%': ['GeneratorFunction', 'prototype'],
'%GeneratorPrototype%': ['GeneratorFunction', 'prototype', 'prototype'],
'%Int8ArrayPrototype%': ['Int8Array', 'prototype'],
'%Int16ArrayPrototype%': ['Int16Array', 'prototype'],
'%Int32ArrayPrototype%': ['Int32Array', 'prototype'],
'%JSONParse%': ['JSON', 'parse'],
'%JSONStringify%': ['JSON', 'stringify'],
'%MapPrototype%': ['Map', 'prototype'],
'%NumberPrototype%': ['Number', 'prototype'],
'%ObjectPrototype%': ['Object', 'prototype'],
'%ObjProto_toString%': ['Object', 'prototype', 'toString'],
'%ObjProto_valueOf%': ['Object', 'prototype', 'valueOf'],
'%PromisePrototype%': ['Promise', 'prototype'],
'%PromiseProto_then%': ['Promise', 'prototype', 'then'],
'%Promise_all%': ['Promise', 'all'],
'%Promise_reject%': ['Promise', 'reject'],
'%Promise_resolve%': ['Promise', 'resolve'],
'%RangeErrorPrototype%': ['RangeError', 'prototype'],
'%ReferenceErrorPrototype%': ['ReferenceError', 'prototype'],
'%RegExpPrototype%': ['RegExp', 'prototype'],
'%SetPrototype%': ['Set', 'prototype'],
'%SharedArrayBufferPrototype%': ['SharedArrayBuffer', 'prototype'],
'%StringPrototype%': ['String', 'prototype'],
'%SymbolPrototype%': ['Symbol', 'prototype'],
'%SyntaxErrorPrototype%': ['SyntaxError', 'prototype'],
'%TypedArrayPrototype%': ['TypedArray', 'prototype'],
'%TypeErrorPrototype%': ['TypeError', 'prototype'],
'%Uint8ArrayPrototype%': ['Uint8Array', 'prototype'],
'%Uint8ClampedArrayPrototype%': ['Uint8ClampedArray', 'prototype'],
'%Uint16ArrayPrototype%': ['Uint16Array', 'prototype'],
'%Uint32ArrayPrototype%': ['Uint32Array', 'prototype'],
'%URIErrorPrototype%': ['URIError', 'prototype'],
'%WeakMapPrototype%': ['WeakMap', 'prototype'],
'%WeakSetPrototype%': ['WeakSet', 'prototype']
};
var bind = functionBind;
var hasOwn$1 = hasown$1;
var $concat = bind.call(Function.call, Array.prototype.concat);
var $spliceApply = bind.call(Function.apply, Array.prototype.splice);
var $replace = bind.call(Function.call, String.prototype.replace);
var $strSlice = bind.call(Function.call, String.prototype.slice);
var $exec$1 = bind.call(Function.call, RegExp.prototype.exec);
/* adapted from https://github.com/lodash/lodash/blob/4.17.15/dist/lodash.js#L6735-L6744 */
var rePropName = /[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g;
var reEscapeChar = /\\(\\)?/g; /** Used to match backslashes in property paths. */
var stringToPath = function stringToPath(string) {
var first = $strSlice(string, 0, 1);
var last = $strSlice(string, -1);
if (first === '%' && last !== '%') {
throw new $SyntaxError$1('invalid intrinsic syntax, expected closing `%`');
} else if (last === '%' && first !== '%') {
throw new $SyntaxError$1('invalid intrinsic syntax, expected opening `%`');
}
var result = [];
$replace(string, rePropName, function (match, number, quote, subString) {
result[result.length] = quote ? $replace(subString, reEscapeChar, '$1') : number || match;
});
return result;
};
/* end adaptation */
var getBaseIntrinsic = function getBaseIntrinsic(name, allowMissing) {
var intrinsicName = name;
var alias;
if (hasOwn$1(LEGACY_ALIASES, intrinsicName)) {
alias = LEGACY_ALIASES[intrinsicName];
intrinsicName = '%' + alias[0] + '%';
}
if (hasOwn$1(INTRINSICS, intrinsicName)) {
var value = INTRINSICS[intrinsicName];
if (value === needsEval) {
value = doEval(intrinsicName);
}
if (typeof value === 'undefined' && !allowMissing) {
throw new $TypeError$9('intrinsic ' + name + ' exists, but is not available. Please file an issue!');
}
return {
alias: alias,
name: intrinsicName,
value: value
};
}
throw new $SyntaxError$1('intrinsic ' + name + ' does not exist!');
};
var getIntrinsic = function GetIntrinsic(name, allowMissing) {
if (typeof name !== 'string' || name.length === 0) {
throw new $TypeError$9('intrinsic name must be a non-empty string');
}
if (arguments.length > 1 && typeof allowMissing !== 'boolean') {
throw new $TypeError$9('"allowMissing" argument must be a boolean');
}
if ($exec$1(/^%?[^%]*%?$/, name) === null) {
throw new $SyntaxError$1('`%` may not be present anywhere but at the beginning and end of the intrinsic name');
}
var parts = stringToPath(name);
var intrinsicBaseName = parts.length > 0 ? parts[0] : '';
var intrinsic = getBaseIntrinsic('%' + intrinsicBaseName + '%', allowMissing);
var intrinsicRealName = intrinsic.name;
var value = intrinsic.value;
var skipFurtherCaching = false;
var alias = intrinsic.alias;
if (alias) {
intrinsicBaseName = alias[0];
$spliceApply(parts, $concat([0, 1], alias));
}
for (var i = 1, isOwn = true; i < parts.length; i += 1) {
var part = parts[i];
var first = $strSlice(part, 0, 1);
var last = $strSlice(part, -1);
if (
(
(first === '"' || first === "'" || first === '`')
|| (last === '"' || last === "'" || last === '`')
)
&& first !== last
) {
throw new $SyntaxError$1('property names with quotes must have matching quotes');
}
if (part === 'constructor' || !isOwn) {
skipFurtherCaching = true;
}
intrinsicBaseName += '.' + part;
intrinsicRealName = '%' + intrinsicBaseName + '%';
if (hasOwn$1(INTRINSICS, intrinsicRealName)) {
value = INTRINSICS[intrinsicRealName];
} else if (value != null) {
if (!(part in value)) {
if (!allowMissing) {
throw new $TypeError$9('base intrinsic for ' + name + ' exists, but the property is not available.');
}
return void undefined$1;
}
if ($gOPD$1 && (i + 1) >= parts.length) {
var desc = $gOPD$1(value, part);
isOwn = !!desc;
// By convention, when a data property is converted to an accessor
// property to emulate a data property that does not suffer from
// the override mistake, that accessor's getter is marked with
// an `originalValue` property. Here, when we detect this, we
// uphold the illusion by pretending to see that original data
// property, i.e., returning the value rather than the getter
// itself.
if (isOwn && 'get' in desc && !('originalValue' in desc.get)) {
value = desc.get;
} else {
value = value[part];
}
} else {
isOwn = hasOwn$1(value, part);
value = value[part];
}
if (isOwn && !skipFurtherCaching) {
INTRINSICS[intrinsicRealName] = value;
}
}
}
return value;
};
var esDefineProperty;
var hasRequiredEsDefineProperty;
function requireEsDefineProperty () {
if (hasRequiredEsDefineProperty) return esDefineProperty;
hasRequiredEsDefineProperty = 1;
var GetIntrinsic = getIntrinsic;
/** @type {import('.')} */
var $defineProperty = GetIntrinsic('%Object.defineProperty%', true) || false;
if ($defineProperty) {
try {
$defineProperty({}, 'a', { value: 1 });
} catch (e) {
// IE 8 has a broken defineProperty
$defineProperty = false;
}
}
esDefineProperty = $defineProperty;
return esDefineProperty;
}
var GetIntrinsic$7 = getIntrinsic;
var $gOPD = GetIntrinsic$7('%Object.getOwnPropertyDescriptor%', true);
if ($gOPD) {
try {
$gOPD([], 'length');
} catch (e) {
// IE 8 has a broken gOPD
$gOPD = null;
}
}
var gopd$1 = $gOPD;
var $defineProperty$2 = requireEsDefineProperty();
var $SyntaxError = syntax;
var $TypeError$8 = type;
var gopd = gopd$1;
/** @type {import('.')} */
var defineDataProperty$1 = function defineDataProperty(
obj,
property,
value
) {
if (!obj || (typeof obj !== 'object' && typeof obj !== 'function')) {
throw new $TypeError$8('`obj` must be an object or a function`');
}
if (typeof property !== 'string' && typeof property !== 'symbol') {
throw new $TypeError$8('`property` must be a string or a symbol`');
}
if (arguments.length > 3 && typeof arguments[3] !== 'boolean' && arguments[3] !== null) {
throw new $TypeError$8('`nonEnumerable`, if provided, must be a boolean or null');
}
if (arguments.length > 4 && typeof arguments[4] !== 'boolean' && arguments[4] !== null) {
throw new $TypeError$8('`nonWritable`, if provided, must be a boolean or null');
}
if (arguments.length > 5 && typeof arguments[5] !== 'boolean' && arguments[5] !== null) {
throw new $TypeError$8('`nonConfigurable`, if provided, must be a boolean or null');
}
if (arguments.length > 6 && typeof arguments[6] !== 'boolean') {
throw new $TypeError$8('`loose`, if provided, must be a boolean');
}
var nonEnumerable = arguments.length > 3 ? arguments[3] : null;
var nonWritable = arguments.length > 4 ? arguments[4] : null;
var nonConfigurable = arguments.length > 5 ? arguments[5] : null;
var loose = arguments.length > 6 ? arguments[6] : false;
/* @type {false | TypedPropertyDescriptor<unknown>} */
var desc = !!gopd && gopd(obj, property);
if ($defineProperty$2) {
$defineProperty$2(obj, property, {
configurable: nonConfigurable === null && desc ? desc.configurable : !nonConfigurable,
enumerable: nonEnumerable === null && desc ? desc.enumerable : !nonEnumerable,
value: value,
writable: nonWritable === null && desc ? desc.writable : !nonWritable
});
} else if (loose || (!nonEnumerable && !nonWritable && !nonConfigurable)) {
// must fall back to [[Set]], and was not explicitly asked to make non-enumerable, non-writable, or non-configurable
obj[property] = value; // eslint-disable-line no-param-reassign
} else {
throw new $SyntaxError('This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.');
}
};
var $defineProperty$1 = requireEsDefineProperty();
var hasPropertyDescriptors$1 = function hasPropertyDescriptors() {
return !!$defineProperty$1;
};
hasPropertyDescriptors$1.hasArrayLengthDefineBug = function hasArrayLengthDefineBug() {
// node v0.6 has a bug where array lengths can be Set but not Defined
if (!$defineProperty$1) {
return null;
}
try {
return $defineProperty$1([], 'length', { value: 1 }).length !== 1;
} catch (e) {
// In Firefox 4-22, defining length on an array throws an exception.
return true;
}
};
var hasPropertyDescriptors_1 = hasPropertyDescriptors$1;
var GetIntrinsic$6 = getIntrinsic;
var define$c = defineDataProperty$1;
var hasDescriptors$1 = hasPropertyDescriptors_1();
var gOPD$3 = gopd$1;
var $TypeError$7 = type;
var $floor = GetIntrinsic$6('%Math.floor%');
/** @type {import('.')} */
var setFunctionLength = function setFunctionLength(fn, length) {
if (typeof fn !== 'function') {
throw new $TypeError$7('`fn` is not a function');
}
if (typeof length !== 'number' || length < 0 || length > 0xFFFFFFFF || $floor(length) !== length) {
throw new $TypeError$7('`length` must be a positive 32-bit integer');
}
var loose = arguments.length > 2 && !!arguments[2];
var functionLengthIsConfigurable = true;
var functionLengthIsWritable = true;
if ('length' in fn && gOPD$3) {
var desc = gOPD$3(fn, 'length');
if (desc && !desc.configurable) {
functionLengthIsConfigurable = false;
}
if (desc && !desc.writable) {
functionLengthIsWritable = false;
}
}
if (functionLengthIsConfigurable || functionLengthIsWritable || !loose) {
if (hasDescriptors$1) {
define$c(/** @type {Parameters<define>[0]} */ (fn), 'length', length, true, true);
} else {
define$c(/** @type {Parameters<define>[0]} */ (fn), 'length', length);
}
}
return fn;
};
(function (module) {
var bind = functionBind;
var GetIntrinsic = getIntrinsic;
var setFunctionLength$1 = setFunctionLength;
var $TypeError = type;
var $apply = GetIntrinsic('%Function.prototype.apply%');
var $call = GetIntrinsic('%Function.prototype.call%');
var $reflectApply = GetIntrinsic('%Reflect.apply%', true) || bind.call($call, $apply);
var $defineProperty = requireEsDefineProperty();
var $max = GetIntrinsic('%Math.max%');
module.exports = function callBind(originalFunction) {
if (typeof originalFunction !== 'function') {
throw new $TypeError('a function is required');
}
var func = $reflectApply(bind, $call, arguments);
return setFunctionLength$1(
func,
1 + $max(0, originalFunction.length - (arguments.length - 1)),
true
);
};
var applyBind = function applyBind() {
return $reflectApply(bind, $apply, arguments);
};
if ($defineProperty) {
$defineProperty(module.exports, 'apply', { value: applyBind });
} else {
module.exports.apply = applyBind;
}
} (callBind$6));
var callBindExports = callBind$6.exports;
var toStr$8 = Object.prototype.toString;
var isArguments = function isArguments(value) {
var str = toStr$8.call(value);
var isArgs = str === '[object Arguments]';
if (!isArgs) {
isArgs = str !== '[object Array]' &&
value !== null &&
typeof value === 'object' &&
typeof value.length === 'number' &&
value.length >= 0 &&
toStr$8.call(value.callee) === '[object Function]';
}
return isArgs;
};
var implementation$i;
var hasRequiredImplementation;
function requireImplementation () {
if (hasRequiredImplementation) return implementation$i;
hasRequiredImplementation = 1;
var keysShim;
if (!Object.keys) {
// modified from https://github.com/es-shims/es5-shim
var has = Object.prototype.hasOwnProperty;
var toStr = Object.prototype.toString;
var isArgs = isArguments; // eslint-disable-line global-require
var isEnumerable = Object.prototype.propertyIsEnumerable;
var hasDontEnumBug = !isEnumerable.call({ toString: null }, 'toString');
var hasProtoEnumBug = isEnumerable.call(function () {}, 'prototype');
var dontEnums = [
'toString',
'toLocaleString',
'valueOf',
'hasOwnProperty',
'isPrototypeOf',
'propertyIsEnumerable',
'constructor'
];
var equalsConstructorPrototype = function (o) {
var ctor = o.constructor;
return ctor && ctor.prototype === o;
};
var excludedKeys = {
$applicationCache: true,
$console: true,
$external: true,
$frame: true,
$frameElement: true,
$frames: true,
$innerHeight: true,
$innerWidth: true,
$onmozfullscreenchange: true,
$onmozfullscreenerror: true,
$outerHeight: true,
$outerWidth: true,
$pageXOffset: true,
$pageYOffset: true,
$parent: true,
$scrollLeft: true,
$scrollTop: true,
$scrollX: true,
$scrollY: true,
$self: true,
$webkitIndexedDB: true,
$webkitStorageInfo: true,
$window: true
};
var hasAutomationEqualityBug = (function () {
/* global window */
if (typeof window === 'undefined') { return false; }
for (var k in window) {
try {
if (!excludedKeys['$' + k] && has.call(window, k) && window[k] !== null && typeof window[k] === 'object') {
try {
equalsConstructorPrototype(window[k]);
} catch (e) {
return true;
}
}
} catch (e) {
return true;
}
}
return false;
}());
var equalsConstructorPrototypeIfNotBuggy = function (o) {
/* global window */
if (typeof window === 'undefined' || !hasAutomationEqualityBug) {
return equalsConstructorPrototype(o);
}
try {
return equalsConstructorPrototype(o);
} catch (e) {
return false;
}
};
keysShim = function keys(object) {
var isObject = object !== null && typeof object === 'object';
var isFunction = toStr.call(object) === '[object Function]';
var isArguments = isArgs(object);
var isString = isObject && toStr.call(object) === '[object String]';
var theKeys = [];
if (!isObject && !isFunction && !isArguments) {
throw new TypeError('Object.keys called on a non-object');
}
var skipProto = hasProtoEnumBug && isFunction;
if (isString && object.length > 0 && !has.call(object, 0)) {
for (var i = 0; i < object.length; ++i) {
theKeys.push(String(i));
}
}
if (isArguments && object.length > 0) {
for (var j = 0; j < object.length; ++j) {
theKeys.push(String(j));
}
} else {
for (var name in object) {
if (!(skipProto && name === 'prototype') && has.call(object, name)) {
theKeys.push(String(name));
}
}
}
if (hasDontEnumBug) {
var skipConstructor = equalsConstructorPrototypeIfNotBuggy(object);
for (var k = 0; k < dontEnums.length; ++k) {
if (!(skipConstructor && dontEnums[k] === 'constructor') && has.call(object, dontEnums[k])) {
theKeys.push(dontEnums[k]);
}
}
}
return theKeys;
};
}
implementation$i = keysShim;
return implementation$i;
}
var slice = Array.prototype.slice;
var isArgs = isArguments;
var origKeys = Object.keys;
var keysShim = origKeys ? function keys(o) { return origKeys(o); } : requireImplementation();
var originalKeys = Object.keys;
keysShim.shim = function shimObjectKeys() {
if (Object.keys) {
var keysWorksWithArguments = (function () {
// Safari 5.0 bug
var args = Object.keys(arguments);
return args && args.length === arguments.length;
}(1, 2));
if (!keysWorksWithArguments) {
Object.keys = function keys(object) { // eslint-disable-line func-name-matching
if (isArgs(object)) {
return originalKeys(slice.call(object));
}
return originalKeys(object);
};
}
} else {
Object.keys = keysShim;
}
return Object.keys || keysShim;
};
var objectKeys = keysShim;
var keys = objectKeys;
var hasSymbols$2 = typeof Symbol === 'function' && typeof Symbol('foo') === 'symbol';
var toStr$7 = Object.prototype.toString;
var concat = Array.prototype.concat;
var defineDataProperty = defineDataProperty$1;
var isFunction = function (fn) {
return typeof fn === 'function' && toStr$7.call(fn) === '[object Function]';
};
var supportsDescriptors$1 = hasPropertyDescriptors_1();
var defineProperty$1 = function (object, name, value, predicate) {
if (name in object) {
if (predicate === true) {
if (object[name] === value) {
return;
}
} else if (!isFunction(predicate) || !predicate()) {
return;
}
}
if (supportsDescriptors$1) {
defineDataProperty(object, name, value, true);
} else {
defineDataProperty(object, name, value);
}
};
var defineProperties$1 = function (object, map) {
var predicates = arguments.length > 2 ? arguments[2] : {};
var props = keys(map);
if (hasSymbols$2) {
props = concat.call(props, Object.getOwnPropertySymbols(map));
}
for (var i = 0; i < props.length; i += 1) {
defineProperty$1(object, props[i], map[props[i]], predicates[props[i]]);
}
};
defineProperties$1.supportsDescriptors = !!supportsDescriptors$1;
var defineProperties_1 = defineProperties$1;
var callBound$8;
var hasRequiredCallBound;
function requireCallBound () {
if (hasRequiredCallBound) return callBound$8;
hasRequiredCallBound = 1;
var GetIntrinsic = getIntrinsic;
var callBind = callBindExports;
var $indexOf = callBind(GetIntrinsic('String.prototype.indexOf'));
callBound$8 = function callBoundIntrinsic(name, allowMissing) {
var intrinsic = GetIntrinsic(name, !!allowMissing);
if (typeof intrinsic === 'function' && $indexOf(name, '.prototype.') > -1) {
return callBind(intrinsic);
}
return intrinsic;
};
return callBound$8;
}
var isLeadingSurrogate;
var hasRequiredIsLeadingSurrogate;
function requireIsLeadingSurrogate () {
if (hasRequiredIsLeadingSurrogate) return isLeadingSurrogate;
hasRequiredIsLeadingSurrogate = 1;
isLeadingSurrogate = function isLeadingSurrogate(charCode) {
return typeof charCode === 'number' && charCode >= 0xD800 && charCode <= 0xDBFF;
};
return isLeadingSurrogate;
}
var isTrailingSurrogate;
var hasRequiredIsTrailingSurrogate;
function requireIsTrailingSurrogate () {
if (hasRequiredIsTrailingSurrogate) return isTrailingSurrogate;
hasRequiredIsTrailingSurrogate = 1;
isTrailingSurrogate = function isTrailingSurrogate(charCode) {
return typeof charCode === 'number' && charCode >= 0xDC00 && charCode <= 0xDFFF;
};
return isTrailingSurrogate;
}
var UTF16SurrogatePairToCodePoint;
var hasRequiredUTF16SurrogatePairToCodePoint;
function requireUTF16SurrogatePairToCodePoint () {
if (hasRequiredUTF16SurrogatePairToCodePoint) return UTF16SurrogatePairToCodePoint;
hasRequiredUTF16SurrogatePairToCodePoint = 1;
var GetIntrinsic = getIntrinsic;
var $TypeError = type;
var $fromCharCode = GetIntrinsic('%String.fromCharCode%');
var isLeadingSurrogate = requireIsLeadingSurrogate();
var isTrailingSurrogate = requireIsTrailingSurrogate();
// https://tc39.es/ecma262/2020/#sec-utf16decodesurrogatepair
UTF16SurrogatePairToCodePoint = function UTF16SurrogatePairToCodePoint(lead, trail) {
if (!isLeadingSurrogate(lead) || !isTrailingSurrogate(trail)) {
throw new $TypeError('Assertion failed: `lead` must be a leading surrogate char code, and `trail` must be a trailing surrogate char code');
}
// var cp = (lead - 0xD800) * 0x400 + (trail - 0xDC00) + 0x10000;
return $fromCharCode(lead) + $fromCharCode(trail);
};
return UTF16SurrogatePairToCodePoint;
}
var CodePointAt;
var hasRequiredCodePointAt;
function requireCodePointAt () {
if (hasRequiredCodePointAt) return CodePointAt;
hasRequiredCodePointAt = 1;
var $TypeError = type;
var callBound = requireCallBound();
var isLeadingSurrogate = requireIsLeadingSurrogate();
var isTrailingSurrogate = requireIsTrailingSurrogate();
var UTF16SurrogatePairToCodePoint = requireUTF16SurrogatePairToCodePoint();
var $charAt = callBound('String.prototype.charAt');
var $charCodeAt = callBound('String.prototype.charCodeAt');
// https://262.ecma-international.org/12.0/#sec-codepointat
CodePointAt = function CodePointAt(string, position) {
if (typeof string !== 'string') {
throw new $TypeError('Assertion failed: `string` must be a String');
}
var size = string.length;
if (position < 0 || position >= size) {
throw new $TypeError('Assertion failed: `position` must be >= 0, and < the length of `string`');
}
var first = $charCodeAt(string, position);
var cp = $charAt(string, position);
var firstIsLeading = isLeadingSurrogate(first);
var firstIsTrailing = isTrailingSurrogate(first);
if (!firstIsLeading && !firstIsTrailing) {
return {
'[[CodePoint]]': cp,
'[[CodeUnitCount]]': 1,
'[[IsUnpairedSurrogate]]': false
};
}
if (firstIsTrailing || (position + 1 === size)) {
return {
'[[CodePoint]]': cp,
'[[CodeUnitCount]]': 1,
'[[IsUnpairedSurrogate]]': true
};
}
var second = $charCodeAt(string, position + 1);
if (!isTrailingSurrogate(second)) {
return {
'[[CodePoint]]': cp,
'[[CodeUnitCount]]': 1,
'[[IsUnpairedSurrogate]]': true
};
}
return {
'[[CodePoint]]': UTF16SurrogatePairToCodePoint(first, second),
'[[CodeUnitCount]]': 2,
'[[IsUnpairedSurrogate]]': false
};
};
return CodePointAt;
}
var _isNaN;
var hasRequired_isNaN;
function require_isNaN () {
if (hasRequired_isNaN) return _isNaN;
hasRequired_isNaN = 1;
_isNaN = Number.isNaN || function isNaN(a) {
return a !== a;
};
return _isNaN;
}
var _isFinite;
var hasRequired_isFinite;
function require_isFinite () {
if (hasRequired_isFinite) return _isFinite;
hasRequired_isFinite = 1;
var $isNaN = require_isNaN();
_isFinite = function (x) { return (typeof x === 'number' || typeof x === 'bigint') && !$isNaN(x) && x !== Infinity && x !== -Infinity; };
return _isFinite;
}
var isInteger;
var hasRequiredIsInteger;
function requireIsInteger () {
if (hasRequiredIsInteger) return isInteger;
hasRequiredIsInteger = 1;
var GetIntrinsic = getIntrinsic;
var $abs = GetIntrinsic('%Math.abs%');
var $floor = GetIntrinsic('%Math.floor%');
var $isNaN = require_isNaN();
var $isFinite = require_isFinite();
isInteger = function isInteger(argument) {
if (typeof argument !== 'number' || $isNaN(argument) || !$isFinite(argument)) {
return false;
}
var absValue = $abs(argument);
return $floor(absValue) === absValue;
};
return isInteger;
}
var maxSafeInteger;
var hasRequiredMaxSafeInteger;
function requireMaxSafeInteger () {
if (hasRequiredMaxSafeInteger) return maxSafeInteger;
hasRequiredMaxSafeInteger = 1;
maxSafeInteger = Number.MAX_SAFE_INTEGER || 9007199254740991; // Math.pow(2, 53) - 1;
return maxSafeInteger;
}
var AdvanceStringIndex;
var hasRequiredAdvanceStringIndex;
function requireAdvanceStringIndex () {
if (hasRequiredAdvanceStringIndex) return AdvanceStringIndex;
hasRequiredAdvanceStringIndex = 1;
var CodePointAt = requireCodePointAt();
var isInteger = requireIsInteger();
var MAX_SAFE_INTEGER = requireMaxSafeInteger();
var $TypeError = type;
// https://262.ecma-international.org/12.0/#sec-advancestringindex
AdvanceStringIndex = function AdvanceStringIndex(S, index, unicode) {
if (typeof S !== 'string') {
throw new $TypeError('Assertion failed: `S` must be a String');
}
if (!isInteger(index) || index < 0 || index > MAX_SAFE_INTEGER) {
throw new $TypeError('Assertion failed: `length` must be an integer >= 0 and <= 2**53');
}
if (typeof unicode !== 'boolean') {
throw new $TypeError('Assertion failed: `unicode` must be a Boolean');
}
if (!unicode) {
return index + 1;
}
var length = S.length;
if ((index + 1) >= length) {
return index + 1;
}
var cp = CodePointAt(S, index);
return index + cp['[[CodeUnitCount]]'];
};
return AdvanceStringIndex;
}
var IsArray$1;
var hasRequiredIsArray$1;
function requireIsArray$1 () {
if (hasRequiredIsArray$1) return IsArray$1;
hasRequiredIsArray$1 = 1;
var GetIntrinsic = getIntrinsic;
var $Array = GetIntrinsic('%Array%');
// eslint-disable-next-line global-require
var toStr = !$Array.isArray && requireCallBound()('Object.prototype.toString');
IsArray$1 = $Array.isArray || function IsArray(argument) {
return toStr(argument) === '[object Array]';
};
return IsArray$1;
}
var IsArray;
var hasRequiredIsArray;
function requireIsArray () {
if (hasRequiredIsArray) return IsArray;
hasRequiredIsArray = 1;
// https://262.ecma-international.org/6.0/#sec-isarray
IsArray = requireIsArray$1();
return IsArray;
}
var Call$1;
var hasRequiredCall;
function requireCall () {
if (hasRequiredCall) return Call$1;
hasRequiredCall = 1;
var GetIntrinsic = getIntrinsic;
var callBound = requireCallBound();
var $TypeError = type;
var IsArray = requireIsArray();
var $apply = GetIntrinsic('%Reflect.apply%', true) || callBound('Function.prototype.apply');
// https://262.ecma-international.org/6.0/#sec-call
Call$1 = function Call(F, V) {
var argumentsList = arguments.length > 2 ? arguments[2] : [];
if (!IsArray(argumentsList)) {
throw new $TypeError('Assertion failed: optional `argumentsList`, if provided, must be a List');
}
return $apply(F, V, argumentsList);
};
return Call$1;
}
const __viteBrowserExternal = {};
const __viteBrowserExternal$1 = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.defineProperty({
__proto__: null,
default: __viteBrowserExternal
}, Symbol.toStringTag, { value: 'Module' }));
const require$$0 = /*@__PURE__*/getAugmentedNamespace(__viteBrowserExternal$1);
var objectInspect;
var hasRequiredObjectInspect;
function requireObjectInspect () {
if (hasRequiredObjectInspect) return objectInspect;
hasRequiredObjectInspect = 1;
var hasMap = typeof Map === 'function' && Map.prototype;
var mapSizeDescriptor = Object.getOwnPropertyDescriptor && hasMap ? Object.getOwnPropertyDescriptor(Map.prototype, 'size') : null;
var mapSize = hasMap && mapSizeDescriptor && typeof mapSizeDescriptor.get === 'function' ? mapSizeDescriptor.get : null;
var mapForEach = hasMap && Map.prototype.forEach;
var hasSet = typeof Set === 'function' && Set.prototype;
var setSizeDescriptor = Object.getOwnPropertyDescriptor && hasSet ? Object.getOwnPropertyDescriptor(Set.prototype, 'size') : null;
var setSize = hasSet && setSizeDescriptor && typeof setSizeDescriptor.get === 'function' ? setSizeDescriptor.get : null;
var setForEach = hasSet && Set.prototype.forEach;
var hasWeakMap = typeof WeakMap === 'function' && WeakMap.prototype;
var weakMapHas = hasWeakMap ? WeakMap.prototype.has : null;
var hasWeakSet = typeof WeakSet === 'function' && WeakSet.prototype;
var weakSetHas = hasWeakSet ? WeakSet.prototype.has : null;
var hasWeakRef = typeof WeakRef === 'function' && WeakRef.prototype;
var weakRefDeref = hasWeakRef ? WeakRef.prototype.deref : null;
var booleanValueOf = Boolean.prototype.valueOf;
var objectToString = Object.prototype.toString;
var functionToString = Function.prototype.toString;
var $match = String.prototype.match;
var $slice = String.prototype.slice;
var $replace = String.prototype.replace;
var $toUpperCase = String.prototype.toUpperCase;
var $toLowerCase = String.prototype.toLowerCase;
var $test = RegExp.prototype.test;
var $concat = Array.prototype.concat;
var $join = Array.prototype.join;
var $arrSlice = Array.prototype.slice;
var $floor = Math.floor;
var bigIntValueOf = typeof BigInt === 'function' ? BigInt.prototype.valueOf : null;
var gOPS = Object.getOwnPropertySymbols;
var symToString = typeof Symbol === 'function' && typeof Symbol.iterator === 'symbol' ? Symbol.prototype.toString : null;
var hasShammedSymbols = typeof Symbol === 'function' && typeof Symbol.iterator === 'object';
// ie, `has-tostringtag/shams
var toStringTag = typeof Symbol === 'function' && Symbol.toStringTag && (typeof Symbol.toStringTag === hasShammedSymbols ? 'object' : 'symbol')
? Symbol.toStringTag
: null;
var isEnumerable = Object.prototype.propertyIsEnumerable;
var gPO = (typeof Reflect === 'function' ? Reflect.getPrototypeOf : Object.getPrototypeOf) || (
[].__proto__ === Array.prototype // eslint-disable-line no-proto
? function (O) {
return O.__proto__; // eslint-disable-line no-proto
}
: null
);
function addNumericSeparator(num, str) {
if (
num === Infinity
|| num === -Infinity
|| num !== num
|| (num && num > -1000 && num < 1000)
|| $test.call(/e/, str)
) {
return str;
}
var sepRegex = /[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;
if (typeof num === 'number') {
var int = num < 0 ? -$floor(-num) : $floor(num); // trunc(num)
if (int !== num) {
var intStr = String(int);
var dec = $slice.call(str, intStr.length + 1);
return $replace.call(intStr, sepRegex, '$&_') + '.' + $replace.call($replace.call(dec, /([0-9]{3})/g, '$&_'), /_$/, '');
}
}
return $replace.call(str, sepRegex, '$&_');
}
var utilInspect = require$$0;
var inspectCustom = utilInspect.custom;
var inspectSymbol = isSymbol(inspectCustom) ? inspectCustom : null;
objectInspect = function inspect_(obj, options, depth, seen) {
var opts = options || {};
if (has(opts, 'quoteStyle') && (opts.quoteStyle !== 'single' && opts.quoteStyle !== 'double')) {
throw new TypeError('option "quoteStyle" must be "single" or "double"');
}
if (
has(opts, 'maxStringLength') && (typeof opts.maxStringLength === 'number'
? opts.maxStringLength < 0 && opts.maxStringLength !== Infinity
: opts.maxStringLength !== null
)
) {
throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');
}
var customInspect = has(opts, 'customInspect') ? opts.customInspect : true;
if (typeof customInspect !== 'boolean' && customInspect !== 'symbol') {
throw new TypeError('option "customInspect", if provided, must be `true`, `false`, or `\'symbol\'`');
}
if (
has(opts, 'indent')
&& opts.indent !== null
&& opts.indent !== '\t'
&& !(parseInt(opts.indent, 10) === opts.indent && opts.indent > 0)
) {
throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');
}
if (has(opts, 'numericSeparator') && typeof opts.numericSeparator !== 'boolean') {
throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');
}
var numericSeparator = opts.numericSeparator;
if (typeof obj === 'undefined') {
return 'undefined';
}
if (obj === null) {
return 'null';
}
if (typeof obj === 'boolean') {
return obj ? 'true' : 'false';
}
if (typeof obj === 'string') {
return inspectString(obj, opts);
}
if (typeof obj === 'number') {
if (obj === 0) {
return Infinity / obj > 0 ? '0' : '-0';
}
var str = String(obj);
return numericSeparator ? addNumericSeparator(obj, str) : str;
}
if (typeof obj === 'bigint') {
var bigIntStr = String(obj) + 'n';
return numericSeparator ? addNumericSeparator(obj, bigIntStr) : bigIntStr;
}
var maxDepth = typeof opts.depth === 'undefined' ? 5 : opts.depth;
if (typeof depth === 'undefined') { depth = 0; }
if (depth >= maxDepth && maxDepth > 0 && typeof obj === 'object') {
return isArray(obj) ? '[Array]' : '[Object]';
}
var indent = getIndent(opts, depth);
if (typeof seen === 'undefined') {
seen = [];
} else if (indexOf(seen, obj) >= 0) {
return '[Circular]';
}
function inspect(value, from, noIndent) {
if (from) {
seen = $arrSlice.call(seen);
seen.push(from);
}
if (noIndent) {
var newOpts = {
depth: opts.depth
};
if (has(opts, 'quoteStyle')) {
newOpts.quoteStyle = opts.quoteStyle;
}
return inspect_(value, newOpts, depth + 1, seen);
}
return inspect_(value, opts, depth + 1, seen);
}
if (typeof obj === 'function' && !isRegExp(obj)) { // in older engines, regexes are callable
var name = nameOf(obj);
var keys = arrObjKeys(obj, inspect);
return '[Function' + (name ? ': ' + name : ' (anonymous)') + ']' + (keys.length > 0 ? ' { ' + $join.call(keys, ', ') + ' }' : '');
}
if (isSymbol(obj)) {
var symString = hasShammedSymbols ? $replace.call(String(obj), /^(Symbol\(.*\))_[^)]*$/, '$1') : symToString.call(obj);
return typeof obj === 'object' && !hasShammedSymbols ? markBoxed(symString) : symString;
}
if (isElement(obj)) {
var s = '<' + $toLowerCase.call(String(obj.nodeName));
var attrs = obj.attributes || [];
for (var i = 0; i < attrs.length; i++) {
s += ' ' + attrs[i].name + '=' + wrapQuotes(quote(attrs[i].value), 'double', opts);
}
s += '>';
if (obj.childNodes && obj.childNodes.length) { s += '...'; }
s += '</' + $toLowerCase.call(String(obj.nodeName)) + '>';
return s;
}
if (isArray(obj)) {
if (obj.length === 0) { return '[]'; }
var xs = arrObjKeys(obj, inspect);
if (indent && !singleLineValues(xs)) {
return '[' + indentedJoin(xs, indent) + ']';
}
return '[ ' + $join.call(xs, ', ') + ' ]';
}
if (isError(obj)) {
var parts = arrObjKeys(obj, inspect);
if (!('cause' in Error.prototype) && 'cause' in obj && !isEnumerable.call(obj, 'cause')) {
return '{ [' + String(obj) + '] ' + $join.call($concat.call('[cause]: ' + inspect(obj.cause), parts), ', ') + ' }';
}
if (parts.length === 0) { return '[' + String(obj) + ']'; }
return '{ [' + String(obj) + '] ' + $join.call(parts, ', ') + ' }';
}
if (typeof obj === 'object' && customInspect) {
if (inspectSymbol && typeof obj[inspectSymbol] === 'function' && utilInspect) {
return utilInspect(obj, { depth: maxDepth - depth });
} else if (customInspect !== 'symbol' && typeof obj.inspect === 'function') {
return obj.inspect();
}
}
if (isMap(obj)) {
var mapParts = [];
if (mapForEach) {
mapForEach.call(obj, function (value, key) {
mapParts.push(inspect(key, obj, true) + ' => ' + inspect(value, obj));
});
}
return collectionOf('Map', mapSize.call(obj), mapParts, indent);
}
if (isSet(obj)) {
var setParts = [];
if (setForEach) {
setForEach.call(obj, function (value) {
setParts.push(inspect(value, obj));
});
}
return collectionOf('Set', setSize.call(obj), setParts, indent);
}
if (isWeakMap(obj)) {
return weakCollectionOf('WeakMap');
}
if (isWeakSet(obj)) {
return weakCollectionOf('WeakSet');
}
if (isWeakRef(obj)) {
return weakCollectionOf('WeakRef');
}
if (isNumber(obj)) {
return markBoxed(inspect(Number(obj)));
}
if (isBigInt(obj)) {
return markBoxed(inspect(bigIntValueOf.call(obj)));
}
if (isBoolean(obj)) {
return markBoxed(booleanValueOf.call(obj));
}
if (isString(obj)) {
return markBoxed(inspect(String(obj)));
}
// note: in IE 8, sometimes `global !== window` but both are the prototypes of each other
/* eslint-env browser */
if (typeof window !== 'undefined' && obj === window) {
return '{ [object Window] }';
}
if (obj === commonjsGlobal) {
return '{ [object globalThis] }';
}
if (!isDate(obj) && !isRegExp(obj)) {
var ys = arrObjKeys(obj, inspect);
var isPlainObject = gPO ? gPO(obj) === Object.prototype : obj instanceof Object || obj.constructor === Object;
var protoTag = obj instanceof Object ? '' : 'null prototype';
var stringTag = !isPlainObject && toStringTag && Object(obj) === obj && toStringTag in obj ? $slice.call(toStr(obj), 8, -1) : protoTag ? 'Object' : '';
var constructorTag = isPlainObject || typeof obj.constructor !== 'function' ? '' : obj.constructor.name ? obj.constructor.name + ' ' : '';
var tag = constructorTag + (stringTag || protoTag ? '[' + $join.call($concat.call([], stringTag || [], protoTag || []), ': ') + '] ' : '');
if (ys.length === 0) { return tag + '{}'; }
if (indent) {
return tag + '{' + indentedJoin(ys, indent) + '}';
}
return tag + '{ ' + $join.call(ys, ', ') + ' }';
}
return String(obj);
};
function wrapQuotes(s, defaultStyle, opts) {
var quoteChar = (opts.quoteStyle || defaultStyle) === 'double' ? '"' : "'";
return quoteChar + s + quoteChar;
}
function quote(s) {
return $replace.call(String(s), /"/g, '"');
}
function isArray(obj) { return toStr(obj) === '[object Array]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }
function isDate(obj) { return toStr(obj) === '[object Date]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }
function isRegExp(obj) { return toStr(obj) === '[object RegExp]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }
function isError(obj) { return toStr(obj) === '[object Error]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }
function isString(obj) { return toStr(obj) === '[object String]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }
function isNumber(obj) { return toStr(obj) === '[object Number]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }
function isBoolean(obj) { return toStr(obj) === '[object Boolean]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }
// Symbol and BigInt do have Symbol.toStringTag by spec, so that can't be used to eliminate false positives
function isSymbol(obj) {
if (hasShammedSymbols) {
return obj && typeof obj === 'object' && obj instanceof Symbol;
}
if (typeof obj === 'symbol') {
return true;
}
if (!obj || typeof obj !== 'object' || !symToString) {
return false;
}
try {
symToString.call(obj);
return true;
} catch (e) {}
return false;
}
function isBigInt(obj) {
if (!obj || typeof obj !== 'object' || !bigIntValueOf) {
return false;
}
try {
bigIntValueOf.call(obj);
return true;
} catch (e) {}
return false;
}
var hasOwn = Object.prototype.hasOwnProperty || function (key) { return key in this; };
function has(obj, key) {
return hasOwn.call(obj, key);
}
function toStr(obj) {
return objectToString.call(obj);
}
function nameOf(f) {
if (f.name) { return f.name; }
var m = $match.call(functionToString.call(f), /^function\s*([\w$]+)/);
if (m) { return m[1]; }
return null;
}
function indexOf(xs, x) {
if (xs.indexOf) { return xs.indexOf(x); }
for (var i = 0, l = xs.length; i < l; i++) {
if (xs[i] === x) { return i; }
}
return -1;
}
function isMap(x) {
if (!mapSize || !x || typeof x !== 'object') {
return false;
}
try {
mapSize.call(x);
try {
setSize.call(x);
} catch (s) {
return true;
}
return x instanceof Map; // core-js workaround, pre-v2.5.0
} catch (e) {}
return false;
}
function isWeakMap(x) {
if (!weakMapHas || !x || typeof x !== 'object') {
return false;
}
try {
weakMapHas.call(x, weakMapHas);
try {
weakSetHas.call(x, weakSetHas);
} catch (s) {
return true;
}
return x instanceof WeakMap; // core-js workaround, pre-v2.5.0
} catch (e) {}
return false;
}
function isWeakRef(x) {
if (!weakRefDeref || !x || typeof x !== 'object') {
return false;
}
try {
weakRefDeref.call(x);
return true;
} catch (e) {}
return false;
}
function isSet(x) {
if (!setSize || !x || typeof x !== 'object') {
return false;
}
try {
setSize.call(x);
try {
mapSize.call(x);
} catch (m) {
return true;
}
return x instanceof Set; // core-js workaround, pre-v2.5.0
} catch (e) {}
return false;
}
function isWeakSet(x) {
if (!weakSetHas || !x || typeof x !== 'object') {
return false;
}
try {
weakSetHas.call(x, weakSetHas);
try {
weakMapHas.call(x, weakMapHas);
} catch (s) {
return true;
}
return x instanceof WeakSet; // core-js workaround, pre-v2.5.0
} catch (e) {}
return false;
}
function isElement(x) {
if (!x || typeof x !== 'object') { return false; }
if (typeof HTMLElement !== 'undefined' && x instanceof HTMLElement) {
return true;
}
return typeof x.nodeName === 'string' && typeof x.getAttribute === 'function';
}
function inspectString(str, opts) {
if (str.length > opts.maxStringLength) {
var remaining = str.length - opts.maxStringLength;
var trailer = '... ' + remaining + ' more character' + (remaining > 1 ? 's' : '');
return inspectString($slice.call(str, 0, opts.maxStringLength), opts) + trailer;
}
// eslint-disable-next-line no-control-regex
var s = $replace.call($replace.call(str, /(['\\])/g, '\\$1'), /[\x00-\x1f]/g, lowbyte);
return wrapQuotes(s, 'single', opts);
}
function lowbyte(c) {
var n = c.charCodeAt(0);
var x = {
8: 'b',
9: 't',
10: 'n',
12: 'f',
13: 'r'
}[n];
if (x) { return '\\' + x; }
return '\\x' + (n < 0x10 ? '0' : '') + $toUpperCase.call(n.toString(16));
}
function markBoxed(str) {
return 'Object(' + str + ')';
}
function weakCollectionOf(type) {
return type + ' { ? }';
}
function collectionOf(type, size, entries, indent) {
var joinedEntries = indent ? indentedJoin(entries, indent) : $join.call(entries, ', ');
return type + ' (' + size + ') {' + joinedEntries + '}';
}
function singleLineValues(xs) {
for (var i = 0; i < xs.length; i++) {
if (indexOf(xs[i], '\n') >= 0) {
return false;
}
}
return true;
}
function getIndent(opts, depth) {
var baseIndent;
if (opts.indent === '\t') {
baseIndent = '\t';
} else if (typeof opts.indent === 'number' && opts.indent > 0) {
baseIndent = $join.call(Array(opts.indent + 1), ' ');
} else {
return null;
}
return {
base: baseIndent,
prev: $join.call(Array(depth + 1), baseIndent)
};
}
function indentedJoin(xs, indent) {
if (xs.length === 0) { return ''; }
var lineJoiner = '\n' + indent.prev + indent.base;
return lineJoiner + $join.call(xs, ',' + lineJoiner) + '\n' + indent.prev;
}
function arrObjKeys(obj, inspect) {
var isArr = isArray(obj);
var xs = [];
if (isArr) {
xs.length = obj.length;
for (var i = 0; i < obj.length; i++) {
xs[i] = has(obj, i) ? inspect(obj[i], obj) : '';
}
}
var syms = typeof gOPS === 'function' ? gOPS(obj) : [];
var symMap;
if (hasShammedSymbols) {
symMap = {};
for (var k = 0; k < syms.length; k++) {
symMap['$' + syms[k]] = syms[k];
}
}
for (var key in obj) { // eslint-disable-line no-restricted-syntax
if (!has(obj, key)) { continue; } // eslint-disable-line no-restricted-syntax, no-continue
if (isArr && String(Number(key)) === key && key < obj.length) { continue; } // eslint-disable-line no-restricted-syntax, no-continue
if (hasShammedSymbols && symMap['$' + key] instanceof Symbol) {
// this is to prevent shammed Symbols, which are stored as strings, from being included in the string key section
continue; // eslint-disable-line no-restricted-syntax, no-continue
} else if ($test.call(/[^\w$]/, key)) {
xs.push(inspect(key, obj) + ': ' + inspect(obj[key], obj));
} else {
xs.push(key + ': ' + inspect(obj[key], obj));
}
}
if (typeof gOPS === 'function') {
for (var j = 0; j < syms.length; j++) {
if (isEnumerable.call(obj, syms[j])) {
xs.push('[' + inspect(syms[j]) + ']: ' + inspect(obj[syms[j]], obj));
}
}
}
return xs;
}
return objectInspect;
}
var IsPropertyKey$1;
var hasRequiredIsPropertyKey;
function requireIsPropertyKey () {
if (hasRequiredIsPropertyKey) return IsPropertyKey$1;
hasRequiredIsPropertyKey = 1;
// https://262.ecma-international.org/6.0/#sec-ispropertykey
IsPropertyKey$1 = function IsPropertyKey(argument) {
return typeof argument === 'string' || typeof argument === 'symbol';
};
return IsPropertyKey$1;
}
var Type$6;
var hasRequiredType$1;
function requireType$1 () {
if (hasRequiredType$1) return Type$6;
hasRequiredType$1 = 1;
// https://262.ecma-international.org/5.1/#sec-8
Type$6 = function Type(x) {
if (x === null) {
return 'Null';
}
if (typeof x === 'undefined') {
return 'Undefined';
}
if (typeof x === 'function' || typeof x === 'object') {
return 'Object';
}
if (typeof x === 'number') {
return 'Number';
}
if (typeof x === 'boolean') {
return 'Boolean';
}
if (typeof x === 'string') {
return 'String';
}
};
return Type$6;
}
var Type$5;
var hasRequiredType;
function requireType () {
if (hasRequiredType) return Type$5;
hasRequiredType = 1;
var ES5Type = requireType$1();
// https://262.ecma-international.org/11.0/#sec-ecmascript-data-types-and-values
Type$5 = function Type(x) {
if (typeof x === 'symbol') {
return 'Symbol';
}
if (typeof x === 'bigint') {
return 'BigInt';
}
return ES5Type(x);
};
return Type$5;
}
var Get;
var hasRequiredGet;
function requireGet () {
if (hasRequiredGet) return Get;
hasRequiredGet = 1;
var $TypeError = type;
var inspect = requireObjectInspect();
var IsPropertyKey = requireIsPropertyKey();
var Type = requireType();
// https://262.ecma-international.org/6.0/#sec-get-o-p
Get = function Get(O, P) {
// 7.3.1.1
if (Type(O) !== 'Object') {
throw new $TypeError('Assertion failed: Type(O) is not Object');
}
// 7.3.1.2
if (!IsPropertyKey(P)) {
throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true, got ' + inspect(P));
}
// 7.3.1.3
return O[P];
};
return Get;
}
var GetIteratorDirect$1;
var hasRequiredGetIteratorDirect;
function requireGetIteratorDirect () {
if (hasRequiredGetIteratorDirect) return GetIteratorDirect$1;
hasRequiredGetIteratorDirect = 1;
var GetIntrinsic = getIntrinsic;
var $TypeError = GetIntrinsic('%TypeError%');
var Get = requireGet();
var Type = requireType();
GetIteratorDirect$1 = function GetIteratorDirect(obj) {
if (Type(obj) !== 'Object') {
throw new $TypeError('Assertion failed: `obj` must be an Object');
}
var nextMethod = Get(obj, 'next'); // step 2
var iteratorRecord = { '[[Iterator]]': obj, '[[NextMethod]]': nextMethod, '[[Done]]': false }; // step 3
return iteratorRecord; // step 4
};
return GetIteratorDirect$1;
}
var GetV;
var hasRequiredGetV;
function requireGetV () {
if (hasRequiredGetV) return GetV;
hasRequiredGetV = 1;
var $TypeError = type;
var inspect = requireObjectInspect();
var IsPropertyKey = requireIsPropertyKey();
// var ToObject = require('./ToObject');
// https://262.ecma-international.org/6.0/#sec-getv
GetV = function GetV(V, P) {
// 7.3.2.1
if (!IsPropertyKey(P)) {
throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true, got ' + inspect(P));
}
// 7.3.2.2-3
// var O = ToObject(V);
// 7.3.2.4
return V[P];
};
return GetV;
}
var isCallable$1;
var hasRequiredIsCallable$1;
function requireIsCallable$1 () {
if (hasRequiredIsCallable$1) return isCallable$1;
hasRequiredIsCallable$1 = 1;
var fnToStr = Function.prototype.toString;
var reflectApply = typeof Reflect === 'object' && Reflect !== null && Reflect.apply;
var badArrayLike;
var isCallableMarker;
if (typeof reflectApply === 'function' && typeof Object.defineProperty === 'function') {
try {
badArrayLike = Object.defineProperty({}, 'length', {
get: function () {
throw isCallableMarker;
}
});
isCallableMarker = {};
// eslint-disable-next-line no-throw-literal
reflectApply(function () { throw 42; }, null, badArrayLike);
} catch (_) {
if (_ !== isCallableMarker) {
reflectApply = null;
}
}
} else {
reflectApply = null;
}
var constructorRegex = /^\s*class\b/;
var isES6ClassFn = function isES6ClassFunction(value) {
try {
var fnStr = fnToStr.call(value);
return constructorRegex.test(fnStr);
} catch (e) {
return false; // not a function
}
};
var tryFunctionObject = function tryFunctionToStr(value) {
try {
if (isES6ClassFn(value)) { return false; }
fnToStr.call(value);
return true;
} catch (e) {
return false;
}
};
var toStr = Object.prototype.toString;
var objectClass = '[object Object]';
var fnClass = '[object Function]';
var genClass = '[object GeneratorFunction]';
var ddaClass = '[object HTMLAllCollection]'; // IE 11
var ddaClass2 = '[object HTML document.all class]';
var ddaClass3 = '[object HTMLCollection]'; // IE 9-10
var hasToStringTag = typeof Symbol === 'function' && !!Symbol.toStringTag; // better: use `has-tostringtag`
var isIE68 = !(0 in [,]); // eslint-disable-line no-sparse-arrays, comma-spacing
var isDDA = function isDocumentDotAll() { return false; };
if (typeof document === 'object') {
// Firefox 3 canonicalizes DDA to undefined when it's not accessed directly
var all = document.all;
if (toStr.call(all) === toStr.call(document.all)) {
isDDA = function isDocumentDotAll(value) {
/* globals document: false */
// in IE 6-8, typeof document.all is "object" and it's truthy
if ((isIE68 || !value) && (typeof value === 'undefined' || typeof value === 'object')) {
try {
var str = toStr.call(value);
return (
str === ddaClass
|| str === ddaClass2
|| str === ddaClass3 // opera 12.16
|| str === objectClass // IE 6-8
) && value('') == null; // eslint-disable-line eqeqeq
} catch (e) { /**/ }
}
return false;
};
}
}
isCallable$1 = reflectApply
? function isCallable(value) {
if (isDDA(value)) { return true; }
if (!value) { return false; }
if (typeof value !== 'function' && typeof value !== 'object') { return false; }
try {
reflectApply(value, null, badArrayLike);
} catch (e) {
if (e !== isCallableMarker) { return false; }
}
return !isES6ClassFn(value) && tryFunctionObject(value);
}
: function isCallable(value) {
if (isDDA(value)) { return true; }
if (!value) { return false; }
if (typeof value !== 'function' && typeof value !== 'object') { return false; }
if (hasToStringTag) { return tryFunctionObject(value); }
if (isES6ClassFn(value)) { return false; }
var strClass = toStr.call(value);
if (strClass !== fnClass && strClass !== genClass && !(/^\[object HTML/).test(strClass)) { return false; }
return tryFunctionObject(value);
};
return isCallable$1;
}
var IsCallable$4;
var hasRequiredIsCallable;
function requireIsCallable () {
if (hasRequiredIsCallable) return IsCallable$4;
hasRequiredIsCallable = 1;
// http://262.ecma-international.org/5.1/#sec-9.11
IsCallable$4 = requireIsCallable$1();
return IsCallable$4;
}
var GetMethod;
var hasRequiredGetMethod;
function requireGetMethod () {
if (hasRequiredGetMethod) return GetMethod;
hasRequiredGetMethod = 1;
var $TypeError = type;
var GetV = requireGetV();
var IsCallable = requireIsCallable();
var IsPropertyKey = requireIsPropertyKey();
var inspect = requireObjectInspect();
// https://262.ecma-international.org/6.0/#sec-getmethod
GetMethod = function GetMethod(O, P) {
// 7.3.9.1
if (!IsPropertyKey(P)) {
throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true');
}
// 7.3.9.2
var func = GetV(O, P);
// 7.3.9.4
if (func == null) {
return void 0;
}
// 7.3.9.5
if (!IsCallable(func)) {
throw new $TypeError(inspect(P) + ' is not a function: ' + inspect(func));
}
// 7.3.9.6
return func;
};
return GetMethod;
}
var shams;
var hasRequiredShams;
function requireShams () {
if (hasRequiredShams) return shams;
hasRequiredShams = 1;
var hasSymbols = shams$1;
/** @type {import('.')} */
shams = function hasToStringTagShams() {
return hasSymbols() && !!Symbol.toStringTag;
};
return shams;
}
var isString$1;
var hasRequiredIsString;
function requireIsString () {
if (hasRequiredIsString) return isString$1;
hasRequiredIsString = 1;
var strValue = String.prototype.valueOf;
var tryStringObject = function tryStringObject(value) {
try {
strValue.call(value);
return true;
} catch (e) {
return false;
}
};
var toStr = Object.prototype.toString;
var strClass = '[object String]';
var hasToStringTag = requireShams()();
isString$1 = function isString(value) {
if (typeof value === 'string') {
return true;
}
if (typeof value !== 'object') {
return false;
}
return hasToStringTag ? tryStringObject(value) : toStr.call(value) === strClass;
};
return isString$1;
}
var getIteratorMethod;
var hasRequiredGetIteratorMethod;
function requireGetIteratorMethod () {
if (hasRequiredGetIteratorMethod) return getIteratorMethod;
hasRequiredGetIteratorMethod = 1;
var hasSymbols = hasSymbols$4();
var GetIntrinsic = getIntrinsic;
var callBound = requireCallBound();
var isString = requireIsString();
var $iterator = GetIntrinsic('%Symbol.iterator%', true);
var $stringSlice = callBound('String.prototype.slice');
var $String = GetIntrinsic('%String%');
getIteratorMethod = function getIteratorMethod(ES, iterable) {
var usingIterator;
if (hasSymbols) {
usingIterator = ES.GetMethod(iterable, $iterator);
} else if (ES.IsArray(iterable)) {
usingIterator = function () {
var i = -1;
var arr = this; // eslint-disable-line no-invalid-this
return {
next: function () {
i += 1;
return {
done: i >= arr.length,
value: arr[i]
};
}
};
};
} else if (isString(iterable)) {
usingIterator = function () {
var i = 0;
return {
next: function () {
var nextIndex = ES.AdvanceStringIndex($String(iterable), i, true);
var value = $stringSlice(iterable, i, nextIndex);
i = nextIndex;
return {
done: nextIndex > iterable.length,
value: value
};
}
};
};
}
return usingIterator;
};
return getIteratorMethod;
}
var GetIteratorFlattenable$1;
var hasRequiredGetIteratorFlattenable;
function requireGetIteratorFlattenable () {
if (hasRequiredGetIteratorFlattenable) return GetIteratorFlattenable$1;
hasRequiredGetIteratorFlattenable = 1;
var GetIntrinsic = getIntrinsic;
var $TypeError = GetIntrinsic('%TypeError%');
var AdvanceStringIndex = requireAdvanceStringIndex();
var Call = requireCall();
var GetIteratorDirect = requireGetIteratorDirect();
var GetMethod = requireGetMethod();
var IsArray = requireIsArray();
var Type = requireType();
var getIteratorMethod = requireGetIteratorMethod();
GetIteratorFlattenable$1 = function GetIteratorFlattenable(obj, stringHandling) {
if (Type(obj) !== 'Object') {
if (stringHandling === 'reject-strings' || typeof obj !== 'string') {
throw new $TypeError('obj must be an Object'); // step 1.a
}
}
var method = void undefined; // step 2
// method = GetMethod(obj, Symbol.iterator); // step 5.a
method = getIteratorMethod(
{
AdvanceStringIndex: AdvanceStringIndex,
GetMethod: GetMethod,
IsArray: IsArray
},
obj
);
var iterator;
if (typeof method === 'undefined') { // step 3
iterator = obj; // step 3.a
} else { // step 4
iterator = Call(method, obj); // step 4.a
}
if (Type(iterator) !== 'Object') {
throw new $TypeError('iterator must be an Object'); // step 5
}
return GetIteratorDirect(iterator); // step 6
};
return GetIteratorFlattenable$1;
}
var OrdinaryHasInstance$1;
var hasRequiredOrdinaryHasInstance;
function requireOrdinaryHasInstance () {
if (hasRequiredOrdinaryHasInstance) return OrdinaryHasInstance$1;
hasRequiredOrdinaryHasInstance = 1;
var $TypeError = type;
var Get = requireGet();
var IsCallable = requireIsCallable();
var Type = requireType();
// https://262.ecma-international.org/6.0/#sec-ordinaryhasinstance
OrdinaryHasInstance$1 = function OrdinaryHasInstance(C, O) {
if (!IsCallable(C)) {
return false;
}
if (Type(O) !== 'Object') {
return false;
}
var P = Get(C, 'prototype');
if (Type(P) !== 'Object') {
throw new $TypeError('OrdinaryHasInstance called on an object with an invalid prototype property.');
}
return O instanceof C;
};
return OrdinaryHasInstance$1;
}
var forEach$2;
var hasRequiredForEach;
function requireForEach () {
if (hasRequiredForEach) return forEach$2;
hasRequiredForEach = 1;
forEach$2 = function forEach(array, callback) {
for (var i = 0; i < array.length; i += 1) {
callback(array[i], i, array); // eslint-disable-line callback-return
}
};
return forEach$2;
}
var sideChannel;
var hasRequiredSideChannel;
function requireSideChannel () {
if (hasRequiredSideChannel) return sideChannel;
hasRequiredSideChannel = 1;
var GetIntrinsic = getIntrinsic;
var callBound = requireCallBound();
var inspect = requireObjectInspect();
var $TypeError = type;
var $WeakMap = GetIntrinsic('%WeakMap%', true);
var $Map = GetIntrinsic('%Map%', true);
var $weakMapGet = callBound('WeakMap.prototype.get', true);
var $weakMapSet = callBound('WeakMap.prototype.set', true);
var $weakMapHas = callBound('WeakMap.prototype.has', true);
var $mapGet = callBound('Map.prototype.get', true);
var $mapSet = callBound('Map.prototype.set', true);
var $mapHas = callBound('Map.prototype.has', true);
/*
* This function traverses the list returning the node corresponding to the given key.
*
* That node is also moved to the head of the list, so that if it's accessed again we don't need to traverse the whole list. By doing so, all the recently used nodes can be accessed relatively quickly.
*/
/** @type {import('.').listGetNode} */
var listGetNode = function (list, key) { // eslint-disable-line consistent-return
/** @type {typeof list | NonNullable<(typeof list)['next']>} */
var prev = list;
/** @type {(typeof list)['next']} */
var curr;
for (; (curr = prev.next) !== null; prev = curr) {
if (curr.key === key) {
prev.next = curr.next;
// eslint-disable-next-line no-extra-parens
curr.next = /** @type {NonNullable<typeof list.next>} */ (list.next);
list.next = curr; // eslint-disable-line no-param-reassign
return curr;
}
}
};
/** @type {import('.').listGet} */
var listGet = function (objects, key) {
var node = listGetNode(objects, key);
return node && node.value;
};
/** @type {import('.').listSet} */
var listSet = function (objects, key, value) {
var node = listGetNode(objects, key);
if (node) {
node.value = value;
} else {
// Prepend the new node to the beginning of the list
objects.next = /** @type {import('.').ListNode<typeof value>} */ ({ // eslint-disable-line no-param-reassign, no-extra-parens
key: key,
next: objects.next,
value: value
});
}
};
/** @type {import('.').listHas} */
var listHas = function (objects, key) {
return !!listGetNode(objects, key);
};
/** @type {import('.')} */
sideChannel = function getSideChannel() {
/** @type {WeakMap<object, unknown>} */ var $wm;
/** @type {Map<object, unknown>} */ var $m;
/** @type {import('.').RootNode<unknown>} */ var $o;
/** @type {import('.').Channel} */
var channel = {
assert: function (key) {
if (!channel.has(key)) {
throw new $TypeError('Side channel does not contain ' + inspect(key));
}
},
get: function (key) { // eslint-disable-line consistent-return
if ($WeakMap && key && (typeof key === 'object' || typeof key === 'function')) {
if ($wm) {
return $weakMapGet($wm, key);
}
} else if ($Map) {
if ($m) {
return $mapGet($m, key);
}
} else {
if ($o) { // eslint-disable-line no-lonely-if
return listGet($o, key);
}
}
},
has: function (key) {
if ($WeakMap && key && (typeof key === 'object' || typeof key === 'function')) {
if ($wm) {
return $weakMapHas($wm, key);
}
} else if ($Map) {
if ($m) {
return $mapHas($m, key);
}
} else {
if ($o) { // eslint-disable-line no-lonely-if
return listHas($o, key);
}
}
return false;
},
set: function (key, value) {
if ($WeakMap && key && (typeof key === 'object' || typeof key === 'function')) {
if (!$wm) {
$wm = new $WeakMap();
}
$weakMapSet($wm, key, value);
} else if ($Map) {
if (!$m) {
$m = new $Map();
}
$mapSet($m, key, value);
} else {
if (!$o) {
// Initialize the linked list as an empty node, so that we don't have to special-case handling of the first node: we can always refer to it as (previous node).next, instead of something like (list).head
$o = { key: {}, next: null };
}
listSet($o, key, value);
}
}
};
return channel;
};
return sideChannel;
}
var internalSlot;
var hasRequiredInternalSlot;
function requireInternalSlot () {
if (hasRequiredInternalSlot) return internalSlot;
hasRequiredInternalSlot = 1;
var hasOwn = hasown$1;
var channel = requireSideChannel()();
var $TypeError = type;
var SLOT = {
assert: function (O, slot) {
if (!O || (typeof O !== 'object' && typeof O !== 'function')) {
throw new $TypeError('`O` is not an object');
}
if (typeof slot !== 'string') {
throw new $TypeError('`slot` must be a string');
}
channel.assert(O);
if (!SLOT.has(O, slot)) {
throw new $TypeError('`' + slot + '` is not present on `O`');
}
},
get: function (O, slot) {
if (!O || (typeof O !== 'object' && typeof O !== 'function')) {
throw new $TypeError('`O` is not an object');
}
if (typeof slot !== 'string') {
throw new $TypeError('`slot` must be a string');
}
var slots = channel.get(O);
return slots && slots['$' + slot];
},
has: function (O, slot) {
if (!O || (typeof O !== 'object' && typeof O !== 'function')) {
throw new $TypeError('`O` is not an object');
}
if (typeof slot !== 'string') {
throw new $TypeError('`slot` must be a string');
}
var slots = channel.get(O);
return !!slots && hasOwn(slots, '$' + slot);
},
set: function (O, slot, V) {
if (!O || (typeof O !== 'object' && typeof O !== 'function')) {
throw new $TypeError('`O` is not an object');
}
if (typeof slot !== 'string') {
throw new $TypeError('`slot` must be a string');
}
var slots = channel.get(O);
if (!slots) {
slots = {};
channel.set(O, slots);
}
slots['$' + slot] = V;
}
};
if (Object.freeze) {
Object.freeze(SLOT);
}
internalSlot = SLOT;
return internalSlot;
}
var OrdinaryObjectCreate$1;
var hasRequiredOrdinaryObjectCreate;
function requireOrdinaryObjectCreate () {
if (hasRequiredOrdinaryObjectCreate) return OrdinaryObjectCreate$1;
hasRequiredOrdinaryObjectCreate = 1;
var GetIntrinsic = getIntrinsic;
var $ObjectCreate = GetIntrinsic('%Object.create%', true);
var $TypeError = type;
var $SyntaxError = syntax;
var IsArray = requireIsArray();
var Type = requireType();
var forEach = requireForEach();
var SLOT = requireInternalSlot();
var hasProto = hasProto$3();
// https://262.ecma-international.org/11.0/#sec-objectcreate
OrdinaryObjectCreate$1 = function OrdinaryObjectCreate(proto) {
if (proto !== null && Type(proto) !== 'Object') {
throw new $TypeError('Assertion failed: `proto` must be null or an object');
}
var additionalInternalSlotsList = arguments.length < 2 ? [] : arguments[1];
if (!IsArray(additionalInternalSlotsList)) {
throw new $TypeError('Assertion failed: `additionalInternalSlotsList` must be an Array');
}
// var internalSlotsList = ['[[Prototype]]', '[[Extensible]]']; // step 1
// internalSlotsList.push(...additionalInternalSlotsList); // step 2
// var O = MakeBasicObject(internalSlotsList); // step 3
// setProto(O, proto); // step 4
// return O; // step 5
var O;
if ($ObjectCreate) {
O = $ObjectCreate(proto);
} else if (hasProto) {
O = { __proto__: proto };
} else {
if (proto === null) {
throw new $SyntaxError('native Object.create support is required to create null objects');
}
var T = function T() {};
T.prototype = proto;
O = new T();
}
if (additionalInternalSlotsList.length > 0) {
forEach(additionalInternalSlotsList, function (slot) {
SLOT.set(O, slot, void undefined);
});
}
return O;
};
return OrdinaryObjectCreate$1;
}
var implementation_browser = {exports: {}};
/* eslint no-negated-condition: 0, no-new-func: 0 */
if (typeof self !== 'undefined') {
implementation_browser.exports = self;
} else if (typeof window !== 'undefined') {
implementation_browser.exports = window;
} else {
implementation_browser.exports = Function('return this')();
}
var implementation_browserExports = implementation_browser.exports;
var implementation$h = implementation_browserExports;
var polyfill$8 = function getPolyfill() {
if (typeof commonjsGlobal !== 'object' || !commonjsGlobal || commonjsGlobal.Math !== Math || commonjsGlobal.Array !== Array) {
return implementation$h;
}
return commonjsGlobal;
};
var define$b = defineProperties_1;
var getPolyfill$b = polyfill$8;
var shim$b = function shimGlobal() {
var polyfill = getPolyfill$b();
if (define$b.supportsDescriptors) {
var descriptor = Object.getOwnPropertyDescriptor(polyfill, 'globalThis');
if (!descriptor || (descriptor.configurable && (descriptor.enumerable || !descriptor.writable || globalThis !== polyfill))) { // eslint-disable-line max-len
Object.defineProperty(polyfill, 'globalThis', {
configurable: true,
enumerable: false,
value: polyfill,
writable: true
});
}
} else if (typeof globalThis !== 'object' || globalThis !== polyfill) {
polyfill.globalThis = polyfill;
}
return polyfill;
};
var defineProperties = defineProperties_1;
var implementation$g = implementation_browserExports;
var getPolyfill$a = polyfill$8;
var shim$a = shim$b;
var polyfill$7 = getPolyfill$a();
var getGlobal = function () { return polyfill$7; };
defineProperties(getGlobal, {
getPolyfill: getPolyfill$a,
implementation: implementation$g,
shim: shim$a
});
var globalthis = getGlobal;
// http://262.ecma-international.org/5.1/#sec-9.11
var IsCallable$3 = requireIsCallable$1();
var ES5Type = requireType$1();
// https://262.ecma-international.org/11.0/#sec-ecmascript-data-types-and-values
var Type$4 = function Type(x) {
if (typeof x === 'symbol') {
return 'Symbol';
}
if (typeof x === 'bigint') {
return 'BigInt';
}
return ES5Type(x);
};
var numToStr = Number.prototype.toString;
var tryNumberObject = function tryNumberObject(value) {
try {
numToStr.call(value);
return true;
} catch (e) {
return false;
}
};
var toStr$6 = Object.prototype.toString;
var numClass = '[object Number]';
var hasToStringTag$7 = requireShams()();
var isNumberObject = function isNumberObject(value) {
if (typeof value === 'number') {
return true;
}
if (typeof value !== 'object') {
return false;
}
return hasToStringTag$7 ? tryNumberObject(value) : toStr$6.call(value) === numClass;
};
var callBound$7 = requireCallBound();
var $boolToStr = callBound$7('Boolean.prototype.toString');
var $toString$2 = callBound$7('Object.prototype.toString');
var tryBooleanObject = function booleanBrandCheck(value) {
try {
$boolToStr(value);
return true;
} catch (e) {
return false;
}
};
var boolClass = '[object Boolean]';
var hasToStringTag$6 = requireShams()();
var isBooleanObject = function isBoolean(value) {
if (typeof value === 'boolean') {
return true;
}
if (value === null || typeof value !== 'object') {
return false;
}
return hasToStringTag$6 && Symbol.toStringTag in value ? tryBooleanObject(value) : $toString$2(value) === boolClass;
};
var isSymbol$1 = {exports: {}};
var toStr$5 = Object.prototype.toString;
var hasSymbols$1 = hasSymbols$4();
if (hasSymbols$1) {
var symToStr = Symbol.prototype.toString;
var symStringRegex = /^Symbol\(.*\)$/;
var isSymbolObject = function isRealSymbolObject(value) {
if (typeof value.valueOf() !== 'symbol') {
return false;
}
return symStringRegex.test(symToStr.call(value));
};
isSymbol$1.exports = function isSymbol(value) {
if (typeof value === 'symbol') {
return true;
}
if (toStr$5.call(value) !== '[object Symbol]') {
return false;
}
try {
return isSymbolObject(value);
} catch (e) {
return false;
}
};
} else {
isSymbol$1.exports = function isSymbol(value) {
// this environment does not support Symbols.
return false ;
};
}
var isSymbolExports = isSymbol$1.exports;
var isBigint = {exports: {}};
var $BigInt = typeof BigInt !== 'undefined' && BigInt;
var hasBigints = function hasNativeBigInts() {
return typeof $BigInt === 'function'
&& typeof BigInt === 'function'
&& typeof $BigInt(42) === 'bigint' // eslint-disable-line no-magic-numbers
&& typeof BigInt(42) === 'bigint'; // eslint-disable-line no-magic-numbers
};
var hasBigInts = hasBigints();
if (hasBigInts) {
var bigIntValueOf = BigInt.prototype.valueOf;
var tryBigInt = function tryBigIntObject(value) {
try {
bigIntValueOf.call(value);
return true;
} catch (e) {
}
return false;
};
isBigint.exports = function isBigInt(value) {
if (
value === null
|| typeof value === 'undefined'
|| typeof value === 'boolean'
|| typeof value === 'string'
|| typeof value === 'number'
|| typeof value === 'symbol'
|| typeof value === 'function'
) {
return false;
}
if (typeof value === 'bigint') {
return true;
}
return tryBigInt(value);
};
} else {
isBigint.exports = function isBigInt(value) {
return false ;
};
}
var isBigintExports = isBigint.exports;
var isString = requireIsString();
var isNumber = isNumberObject;
var isBoolean = isBooleanObject;
var isSymbol = isSymbolExports;
var isBigInt = isBigintExports;
// eslint-disable-next-line consistent-return
var whichBoxedPrimitive$1 = function whichBoxedPrimitive(value) {
// eslint-disable-next-line eqeqeq
if (value == null || (typeof value !== 'object' && typeof value !== 'function')) {
return null;
}
if (isString(value)) {
return 'String';
}
if (isNumber(value)) {
return 'Number';
}
if (isBoolean(value)) {
return 'Boolean';
}
if (isSymbol(value)) {
return 'Symbol';
}
if (isBigInt(value)) {
return 'BigInt';
}
};
/** @const */
var $Map$1 = typeof Map === 'function' && Map.prototype ? Map : null;
var $Set$1 = typeof Set === 'function' && Set.prototype ? Set : null;
var exported$2;
if (!$Map$1) {
/** @type {import('.')} */
// eslint-disable-next-line no-unused-vars
exported$2 = function isMap(x) {
// `Map` is not present in this environment.
return false;
};
}
var $mapHas$3 = $Map$1 ? Map.prototype.has : null;
var $setHas$3 = $Set$1 ? Set.prototype.has : null;
if (!exported$2 && !$mapHas$3) {
/** @type {import('.')} */
// eslint-disable-next-line no-unused-vars
exported$2 = function isMap(x) {
// `Map` does not have a `has` method
return false;
};
}
/** @type {import('.')} */
var isMap$1 = exported$2 || function isMap(x) {
if (!x || typeof x !== 'object') {
return false;
}
try {
$mapHas$3.call(x);
if ($setHas$3) {
try {
$setHas$3.call(x);
} catch (e) {
return true;
}
}
// @ts-expect-error TS can't figure out that $Map is always truthy here
return x instanceof $Map$1; // core-js workaround, pre-v2.5.0
} catch (e) {}
return false;
};
var $Map = typeof Map === 'function' && Map.prototype ? Map : null;
var $Set = typeof Set === 'function' && Set.prototype ? Set : null;
var exported$1;
if (!$Set) {
/** @type {import('.')} */
// eslint-disable-next-line no-unused-vars
exported$1 = function isSet(x) {
// `Set` is not present in this environment.
return false;
};
}
var $mapHas$2 = $Map ? Map.prototype.has : null;
var $setHas$2 = $Set ? Set.prototype.has : null;
if (!exported$1 && !$setHas$2) {
/** @type {import('.')} */
// eslint-disable-next-line no-unused-vars
exported$1 = function isSet(x) {
// `Set` does not have a `has` method
return false;
};
}
/** @type {import('.')} */
var isSet$1 = exported$1 || function isSet(x) {
if (!x || typeof x !== 'object') {
return false;
}
try {
$setHas$2.call(x);
if ($mapHas$2) {
try {
$mapHas$2.call(x);
} catch (e) {
return true;
}
}
// @ts-expect-error TS can't figure out that $Set is always truthy here
return x instanceof $Set; // core-js workaround, pre-v2.5.0
} catch (e) {}
return false;
};
var $WeakMap = typeof WeakMap === 'function' && WeakMap.prototype ? WeakMap : null;
var $WeakSet$1 = typeof WeakSet === 'function' && WeakSet.prototype ? WeakSet : null;
var exported;
if (!$WeakMap) {
/** @type {import('.')} */
// eslint-disable-next-line no-unused-vars
exported = function isWeakMap(x) {
// `WeakMap` is not present in this environment.
return false;
};
}
var $mapHas$1 = $WeakMap ? $WeakMap.prototype.has : null;
var $setHas$1 = $WeakSet$1 ? $WeakSet$1.prototype.has : null;
if (!exported && !$mapHas$1) {
/** @type {import('.')} */
// eslint-disable-next-line no-unused-vars
exported = function isWeakMap(x) {
// `WeakMap` does not have a `has` method
return false;
};
}
/** @type {import('.')} */
var isWeakmap = exported || function isWeakMap(x) {
if (!x || typeof x !== 'object') {
return false;
}
try {
$mapHas$1.call(x, $mapHas$1);
if ($setHas$1) {
try {
$setHas$1.call(x, $setHas$1);
} catch (e) {
return true;
}
}
// @ts-expect-error TS can't figure out that $WeakMap is always truthy here
return x instanceof $WeakMap; // core-js workaround, pre-v3
} catch (e) {}
return false;
};
var isWeakset = {exports: {}};
var GetIntrinsic$5 = getIntrinsic;
var callBound$6 = requireCallBound();
var $WeakSet = GetIntrinsic$5('%WeakSet%', true);
var $setHas = callBound$6('WeakSet.prototype.has', true);
if ($setHas) {
var $mapHas = callBound$6('WeakMap.prototype.has', true);
/** @type {import('.')} */
isWeakset.exports = function isWeakSet(x) {
if (!x || typeof x !== 'object') {
return false;
}
try {
$setHas(x, $setHas);
if ($mapHas) {
try {
$mapHas(x, $mapHas);
} catch (e) {
return true;
}
}
// @ts-expect-error TS can't figure out that $WeakSet is always truthy here
return x instanceof $WeakSet; // core-js workaround, pre-v3
} catch (e) {}
return false;
};
} else {
/** @type {import('.')} */
// eslint-disable-next-line no-unused-vars
isWeakset.exports = function isWeakSet(x) {
// `WeakSet` does not exist, or does not have a `has` method
return false;
};
}
var isWeaksetExports = isWeakset.exports;
var isMap = isMap$1;
var isSet = isSet$1;
var isWeakMap = isWeakmap;
var isWeakSet = isWeaksetExports;
/** @type {import('.')} */
var whichCollection$1 = function whichCollection(/** @type {unknown} */ value) {
if (value && typeof value === 'object') {
if (isMap(value)) {
return 'Map';
}
if (isSet(value)) {
return 'Set';
}
if (isWeakMap(value)) {
return 'WeakMap';
}
if (isWeakSet(value)) {
return 'WeakSet';
}
}
return false;
};
var isCallable = requireIsCallable$1();
var toStr$4 = Object.prototype.toString;
var hasOwnProperty = Object.prototype.hasOwnProperty;
var forEachArray = function forEachArray(array, iterator, receiver) {
for (var i = 0, len = array.length; i < len; i++) {
if (hasOwnProperty.call(array, i)) {
if (receiver == null) {
iterator(array[i], i, array);
} else {
iterator.call(receiver, array[i], i, array);
}
}
}
};
var forEachString = function forEachString(string, iterator, receiver) {
for (var i = 0, len = string.length; i < len; i++) {
// no such thing as a sparse string.
if (receiver == null) {
iterator(string.charAt(i), i, string);
} else {
iterator.call(receiver, string.charAt(i), i, string);
}
}
};
var forEachObject = function forEachObject(object, iterator, receiver) {
for (var k in object) {
if (hasOwnProperty.call(object, k)) {
if (receiver == null) {
iterator(object[k], k, object);
} else {
iterator.call(receiver, object[k], k, object);
}
}
}
};
var forEach$1 = function forEach(list, iterator, thisArg) {
if (!isCallable(iterator)) {
throw new TypeError('iterator must be a function');
}
var receiver;
if (arguments.length >= 3) {
receiver = thisArg;
}
if (toStr$4.call(list) === '[object Array]') {
forEachArray(list, iterator, receiver);
} else if (typeof list === 'string') {
forEachString(list, iterator, receiver);
} else {
forEachObject(list, iterator, receiver);
}
};
var forEach_1 = forEach$1;
/** @type {import('.')} */
var possibleTypedArrayNames = [
'Float32Array',
'Float64Array',
'Int8Array',
'Int16Array',
'Int32Array',
'Uint8Array',
'Uint8ClampedArray',
'Uint16Array',
'Uint32Array',
'BigInt64Array',
'BigUint64Array'
];
var possibleNames = possibleTypedArrayNames;
var g$1 = typeof globalThis === 'undefined' ? commonjsGlobal : globalThis;
/** @type {import('.')} */
var availableTypedArrays$1 = function availableTypedArrays() {
var /** @type {ReturnType<typeof availableTypedArrays>} */ out = [];
for (var i = 0; i < possibleNames.length; i++) {
if (typeof g$1[possibleNames[i]] === 'function') {
// @ts-expect-error
out[out.length] = possibleNames[i];
}
}
return out;
};
var forEach = forEach_1;
var availableTypedArrays = availableTypedArrays$1;
var callBind$5 = callBindExports;
var callBound$5 = requireCallBound();
var gOPD$2 = gopd$1;
/** @type {(O: object) => string} */
var $toString$1 = callBound$5('Object.prototype.toString');
var hasToStringTag$5 = requireShams()();
var g = typeof globalThis === 'undefined' ? commonjsGlobal : globalThis;
var typedArrays = availableTypedArrays();
var $slice = callBound$5('String.prototype.slice');
var getPrototypeOf = Object.getPrototypeOf; // require('getprototypeof');
/** @type {<T = unknown>(array: readonly T[], value: unknown) => number} */
var $indexOf = callBound$5('Array.prototype.indexOf', true) || function indexOf(array, value) {
for (var i = 0; i < array.length; i += 1) {
if (array[i] === value) {
return i;
}
}
return -1;
};
/** @typedef {(receiver: import('.').TypedArray) => string | typeof Uint8Array.prototype.slice.call | typeof Uint8Array.prototype.set.call} Getter */
/** @type {{ [k in `\$${import('.').TypedArrayName}`]?: Getter } & { __proto__: null }} */
var cache = { __proto__: null };
if (hasToStringTag$5 && gOPD$2 && getPrototypeOf) {
forEach(typedArrays, function (typedArray) {
var arr = new g[typedArray]();
if (Symbol.toStringTag in arr) {
var proto = getPrototypeOf(arr);
// @ts-expect-error TS won't narrow inside a closure
var descriptor = gOPD$2(proto, Symbol.toStringTag);
if (!descriptor) {
var superProto = getPrototypeOf(proto);
// @ts-expect-error TS won't narrow inside a closure
descriptor = gOPD$2(superProto, Symbol.toStringTag);
}
// @ts-expect-error TODO: fix
cache['$' + typedArray] = callBind$5(descriptor.get);
}
});
} else {
forEach(typedArrays, function (typedArray) {
var arr = new g[typedArray]();
var fn = arr.slice || arr.set;
if (fn) {
// @ts-expect-error TODO: fix
cache['$' + typedArray] = callBind$5(fn);
}
});
}
/** @type {(value: object) => false | import('.').TypedArrayName} */
var tryTypedArrays = function tryAllTypedArrays(value) {
/** @type {ReturnType<typeof tryAllTypedArrays>} */ var found = false;
forEach(
// eslint-disable-next-line no-extra-parens
/** @type {Record<`\$${TypedArrayName}`, Getter>} */ /** @type {any} */ (cache),
/** @type {(getter: Getter, name: `\$${import('.').TypedArrayName}`) => void} */
function (getter, typedArray) {
if (!found) {
try {
// @ts-expect-error TODO: fix
if ('$' + getter(value) === typedArray) {
found = $slice(typedArray, 1);
}
} catch (e) { /**/ }
}
}
);
return found;
};
/** @type {(value: object) => false | import('.').TypedArrayName} */
var trySlices = function tryAllSlices(value) {
/** @type {ReturnType<typeof tryAllSlices>} */ var found = false;
forEach(
// eslint-disable-next-line no-extra-parens
/** @type {Record<`\$${TypedArrayName}`, Getter>} */ /** @type {any} */ (cache),
/** @type {(getter: typeof cache, name: `\$${import('.').TypedArrayName}`) => void} */ function (getter, name) {
if (!found) {
try {
// @ts-expect-error TODO: fix
getter(value);
found = $slice(name, 1);
} catch (e) { /**/ }
}
}
);
return found;
};
/** @type {import('.')} */
var whichTypedArray$1 = function whichTypedArray(value) {
if (!value || typeof value !== 'object') { return false; }
if (!hasToStringTag$5) {
/** @type {string} */
var tag = $slice($toString$1(value), 8, -1);
if ($indexOf(typedArrays, tag) > -1) {
return tag;
}
if (tag !== 'Object') {
return false;
}
// node < 0.6 hits here on real Typed Arrays
return trySlices(value);
}
if (!gOPD$2) { return null; } // unknown engine
return tryTypedArrays(value);
};
var isarray;
var hasRequiredIsarray;
function requireIsarray () {
if (hasRequiredIsarray) return isarray;
hasRequiredIsarray = 1;
var toString = {}.toString;
isarray = Array.isArray || function (arr) {
return toString.call(arr) == '[object Array]';
};
return isarray;
}
var getDay = Date.prototype.getDay;
var tryDateObject = function tryDateGetDayCall(value) {
try {
getDay.call(value);
return true;
} catch (e) {
return false;
}
};
var toStr$3 = Object.prototype.toString;
var dateClass = '[object Date]';
var hasToStringTag$4 = requireShams()();
var isDateObject = function isDateObject(value) {
if (typeof value !== 'object' || value === null) {
return false;
}
return hasToStringTag$4 ? tryDateObject(value) : toStr$3.call(value) === dateClass;
};
var callBound$4 = requireCallBound();
var hasToStringTag$3 = requireShams()();
var has;
var $exec;
var isRegexMarker;
var badStringifier;
if (hasToStringTag$3) {
has = callBound$4('Object.prototype.hasOwnProperty');
$exec = callBound$4('RegExp.prototype.exec');
isRegexMarker = {};
var throwRegexMarker = function () {
throw isRegexMarker;
};
badStringifier = {
toString: throwRegexMarker,
valueOf: throwRegexMarker
};
if (typeof Symbol.toPrimitive === 'symbol') {
badStringifier[Symbol.toPrimitive] = throwRegexMarker;
}
}
var $toString = callBound$4('Object.prototype.toString');
var gOPD$1 = Object.getOwnPropertyDescriptor;
var regexClass = '[object RegExp]';
var isRegex$1 = hasToStringTag$3
// eslint-disable-next-line consistent-return
? function isRegex(value) {
if (!value || typeof value !== 'object') {
return false;
}
var descriptor = gOPD$1(value, 'lastIndex');
var hasLastIndexDataProperty = descriptor && has(descriptor, 'value');
if (!hasLastIndexDataProperty) {
return false;
}
try {
$exec(value, badStringifier);
} catch (e) {
return e === isRegexMarker;
}
}
: function isRegex(value) {
// In older browsers, typeof regex incorrectly returns 'function'
if (!value || (typeof value !== 'object' && typeof value !== 'function')) {
return false;
}
return $toString(value) === regexClass;
};
var callBound$3 = requireCallBound();
var $deref = callBound$3('WeakRef.prototype.deref', true);
var isWeakref = typeof WeakRef === 'undefined'
? function isWeakRef(value) { // eslint-disable-line no-unused-vars
return false;
}
: function isWeakRef(value) {
if (!value || typeof value !== 'object') {
return false;
}
try {
$deref(value);
return true;
} catch (e) {
return false;
}
};
var callBound$2 = requireCallBound();
var $register = callBound$2('FinalizationRegistry.prototype.register', true);
var isFinalizationregistry = $register
? function isFinalizationRegistry(value) {
if (!value || typeof value !== 'object') {
return false;
}
try {
$register(value, {});
return true;
} catch (e) {
return false;
}
}
: function isFinalizationRegistry(value) { // eslint-disable-line no-unused-vars
return false;
};
var hasown;
var hasRequiredHasown;
function requireHasown () {
if (hasRequiredHasown) return hasown;
hasRequiredHasown = 1;
var call = Function.prototype.call;
var $hasOwn = Object.prototype.hasOwnProperty;
var bind = functionBind;
/** @type {import('.')} */
hasown = bind.call(call, $hasOwn);
return hasown;
}
var $TypeError$6 = type;
var hasOwn = requireHasown();
var IsPropertyKey = requireIsPropertyKey();
var Type$3 = requireType();
// https://262.ecma-international.org/6.0/#sec-hasownproperty
var HasOwnProperty$1 = function HasOwnProperty(O, P) {
if (Type$3(O) !== 'Object') {
throw new $TypeError$6('Assertion failed: `O` must be an Object');
}
if (!IsPropertyKey(P)) {
throw new $TypeError$6('Assertion failed: `P` must be a Property Key');
}
return hasOwn(O, P);
};
var functionsHaveNames$2 = function functionsHaveNames() {
return typeof function f() {}.name === 'string';
};
var gOPD = Object.getOwnPropertyDescriptor;
if (gOPD) {
try {
gOPD([], 'length');
} catch (e) {
// IE 8 has a broken gOPD
gOPD = null;
}
}
functionsHaveNames$2.functionsHaveConfigurableNames = function functionsHaveConfigurableNames() {
if (!functionsHaveNames$2() || !gOPD) {
return false;
}
var desc = gOPD(function () {}, 'name');
return !!desc && !!desc.configurable;
};
var $bind = Function.prototype.bind;
functionsHaveNames$2.boundFunctionsHaveNames = function boundFunctionsHaveNames() {
return functionsHaveNames$2() && typeof $bind === 'function' && function f() {}.bind().name !== '';
};
var functionsHaveNames_1 = functionsHaveNames$2;
var IsCallable$2 = requireIsCallable();
var HasOwnProperty = HasOwnProperty$1;
var functionsHaveNames$1 = functionsHaveNames_1();
var callBound$1 = requireCallBound();
var $functionToString = callBound$1('Function.prototype.toString');
var $stringMatch = callBound$1('String.prototype.match');
var toStr$2 = callBound$1('Object.prototype.toString');
var classRegex = /^class /;
var isClass = function isClassConstructor(fn) {
if (IsCallable$2(fn)) {
return false;
}
if (typeof fn !== 'function') {
return false;
}
try {
var match = $stringMatch($functionToString(fn), classRegex);
return !!match;
} catch (e) {}
return false;
};
var regex = /\s*function\s+([^(\s]*)\s*/;
var isIE68 = !(0 in [,]); // eslint-disable-line no-sparse-arrays, comma-spacing
var objectClass = '[object Object]';
var ddaClass = '[object HTMLAllCollection]';
var functionProto = Function.prototype;
var isDDA = function isDocumentDotAll() {
return false;
};
if (typeof document === 'object') {
// Firefox 3 canonicalizes DDA to undefined when it's not accessed directly
var all = document.all;
if (toStr$2(all) === toStr$2(document.all)) {
isDDA = function isDocumentDotAll(value) {
/* globals document: false */
// in IE 6-8, typeof document.all is "object" and it's truthy
if ((isIE68 || !value) && (typeof value === 'undefined' || typeof value === 'object')) {
try {
var str = toStr$2(value);
// IE 6-8 uses `objectClass`
return (str === ddaClass || str === objectClass) && value('') == null; // eslint-disable-line eqeqeq
} catch (e) { /**/ }
}
return false;
};
}
}
var implementation$f = function getName() {
if (isDDA(this) || (!isClass(this) && !IsCallable$2(this))) {
throw new TypeError('Function.prototype.name sham getter called on non-function');
}
if (functionsHaveNames$1 && HasOwnProperty(this, 'name')) {
return this.name;
}
if (this === functionProto) {
return '';
}
var str = $functionToString(this);
var match = $stringMatch(str, regex);
var name = match && match[1];
return name;
};
var implementation$e = implementation$f;
var polyfill$6 = function getPolyfill() {
return implementation$e;
};
var supportsDescriptors = defineProperties_1.supportsDescriptors;
var functionsHaveNames = functionsHaveNames_1();
var getPolyfill$9 = polyfill$6;
var defineProperty = Object.defineProperty;
var TypeErr = TypeError;
var shim$9 = function shimName() {
var polyfill = getPolyfill$9();
if (functionsHaveNames) {
return polyfill;
}
if (!supportsDescriptors) {
throw new TypeErr('Shimming Function.prototype.name support requires ES5 property descriptor support.');
}
var functionProto = Function.prototype;
defineProperty(functionProto, 'name', {
configurable: true,
enumerable: false,
get: function () {
var name = polyfill.call(this);
if (this !== functionProto) {
defineProperty(this, 'name', {
configurable: true,
enumerable: false,
value: name,
writable: false
});
}
return name;
}
});
return polyfill;
};
var define$a = defineProperties_1;
var callBind$4 = callBindExports;
var implementation$d = implementation$f;
var getPolyfill$8 = polyfill$6;
var shim$8 = shim$9;
var bound$2 = callBind$4(implementation$d);
define$a(bound$2, {
getPolyfill: getPolyfill$8,
implementation: implementation$d,
shim: shim$8
});
var function_prototype_name = bound$2;
var toStr$1 = Object.prototype.toString;
var fnToStr$1 = Function.prototype.toString;
var isFnRegex$1 = /^\s*(?:function)?\*/;
var hasToStringTag$2 = requireShams()();
var getProto$2 = Object.getPrototypeOf;
var getGeneratorFunc = function () { // eslint-disable-line consistent-return
if (!hasToStringTag$2) {
return false;
}
try {
return Function('return function*() {}')();
} catch (e) {
}
};
var GeneratorFunction;
var isGeneratorFunction$1 = function isGeneratorFunction(fn) {
if (typeof fn !== 'function') {
return false;
}
if (isFnRegex$1.test(fnToStr$1.call(fn))) {
return true;
}
if (!hasToStringTag$2) {
var str = toStr$1.call(fn);
return str === '[object GeneratorFunction]';
}
if (!getProto$2) {
return false;
}
if (typeof GeneratorFunction === 'undefined') {
var generatorFunc = getGeneratorFunc();
GeneratorFunction = generatorFunc ? getProto$2(generatorFunc) : false;
}
return getProto$2(fn) === GeneratorFunction;
};
var toStr = Object.prototype.toString;
var fnToStr = Function.prototype.toString;
var isFnRegex = /^\s*async(?:\s+function(?:\s+|\()|\s*\()/;
var hasToStringTag$1 = requireShams()();
var getProto$1 = Object.getPrototypeOf;
var getAsyncFunc = function () { // eslint-disable-line consistent-return
if (!hasToStringTag$1) {
return false;
}
try {
return Function('return async function () {}')();
} catch (e) {
}
};
var AsyncFunction;
var isAsyncFunction$1 = function isAsyncFunction(fn) {
if (typeof fn !== 'function') {
return false;
}
if (isFnRegex.test(fnToStr.call(fn))) {
return true;
}
if (!hasToStringTag$1) {
var str = toStr.call(fn);
return str === '[object AsyncFunction]';
}
if (!getProto$1) {
return false;
}
if (typeof AsyncFunction === 'undefined') {
var asyncFunc = getAsyncFunc();
AsyncFunction = asyncFunc ? getProto$1(asyncFunc) : false;
}
return getProto$1(fn) === AsyncFunction;
};
var whichBoxedPrimitive = whichBoxedPrimitive$1;
var whichCollection = whichCollection$1;
var whichTypedArray = whichTypedArray$1;
var isArray = requireIsarray();
var isDate = isDateObject;
var isRegex = isRegex$1;
var isWeakRef = isWeakref;
var isFinalizationRegistry = isFinalizationregistry;
var name = function_prototype_name;
var isGeneratorFunction = isGeneratorFunction$1;
var isAsyncFunction = isAsyncFunction$1;
var hasToStringTag = requireShams()();
var toStringTag = hasToStringTag && Symbol.toStringTag;
var $Object = Object;
var promiseThen = typeof Promise === 'function' && Promise.prototype.then;
var isPromise = function isPromise(value) {
if (!value || typeof value !== 'object' || !promiseThen) {
return false;
}
try {
promiseThen.call(value, null, function () {});
return true;
} catch (e) {}
return false;
};
var isKnownBuiltin = function isKnownBuiltin(builtinName) {
return builtinName
// primitives
&& builtinName !== 'BigInt'
&& builtinName !== 'Boolean'
&& builtinName !== 'Null'
&& builtinName !== 'Number'
&& builtinName !== 'String'
&& builtinName !== 'Symbol'
&& builtinName !== 'Undefined'
// namespaces
&& builtinName !== 'Math'
&& builtinName !== 'JSON'
&& builtinName !== 'Reflect'
&& builtinName !== 'Atomics'
// collections
&& builtinName !== 'Map'
&& builtinName !== 'Set'
&& builtinName !== 'WeakMap'
&& builtinName !== 'WeakSet'
// typed arrays
&& builtinName !== 'BigInt64Array'
&& builtinName !== 'BigUint64Array'
&& builtinName !== 'Float32Array'
&& builtinName !== 'Float64Array'
&& builtinName !== 'Int16Array'
&& builtinName !== 'Int32Array'
&& builtinName !== 'Int8Array'
&& builtinName !== 'Uint16Array'
&& builtinName !== 'Uint32Array'
&& builtinName !== 'Uint8Array'
&& builtinName !== 'Uint8ClampedArray'
// checked explicitly
&& builtinName !== 'Array'
&& builtinName !== 'Date'
&& builtinName !== 'FinalizationRegistry'
&& builtinName !== 'Promise'
&& builtinName !== 'RegExp'
&& builtinName !== 'WeakRef'
// functions
&& builtinName !== 'Function'
&& builtinName !== 'GeneratorFunction'
&& builtinName !== 'AsyncFunction';
};
var whichBuiltinType$1 = function whichBuiltinType(value) {
if (value == null) {
return value;
}
// covers: primitives, {,Weak}Map/Set, typed arrays
var which = whichBoxedPrimitive($Object(value)) || whichCollection(value) || whichTypedArray(value);
if (which) {
return which;
}
if (isArray(value)) {
return 'Array';
}
if (isDate(value)) {
return 'Date';
}
if (isRegex(value)) {
return 'RegExp';
}
if (isWeakRef(value)) {
return 'WeakRef';
}
if (isFinalizationRegistry(value)) {
return 'FinalizationRegistry';
}
if (typeof value === 'function') {
if (isGeneratorFunction(value)) {
return 'GeneratorFunction';
}
if (isAsyncFunction(value)) {
return 'AsyncFunction';
}
return 'Function';
}
if (isPromise(value)) {
return 'Promise';
}
if (toStringTag && toStringTag in value) {
var tag = value[toStringTag];
if (isKnownBuiltin(tag)) {
return tag;
}
}
if (typeof value.constructor === 'function') {
var constructorName = name(value.constructor);
if (isKnownBuiltin(constructorName)) {
return constructorName;
}
}
return 'Object';
};
var GetIntrinsic$4 = getIntrinsic;
var IsCallable$1 = IsCallable$3;
var Type$2 = Type$4;
var whichBuiltinType = whichBuiltinType$1;
var $TypeError$5 = type;
var $gPO = GetIntrinsic$4('%Object.getPrototypeOf%', true);
var $ObjectPrototype = GetIntrinsic$4('%Object.prototype%');
var hasProto$1 = [].__proto__ === Array.prototype; // eslint-disable-line no-proto
var implementation$c = function getPrototypeOf(O) {
if (Type$2(O) !== 'Object') {
throw new $TypeError$5('Reflect.getPrototypeOf called on non-object');
}
if ($gPO) {
return $gPO(O);
}
if (hasProto$1) {
// eslint-disable-next-line no-proto
var proto = O.__proto__;
if (proto || proto === null) {
return proto;
}
}
var type = whichBuiltinType(O);
if (type) {
var intrinsic = GetIntrinsic$4('%' + type + '.prototype%', true);
if (intrinsic) {
return intrinsic;
}
}
if (IsCallable$1(O.constructor)) {
return O.constructor.prototype;
}
if (O instanceof Object) {
return $ObjectPrototype;
}
/*
* Correctly return null for Objects created with `Object.create(null)` (shammed or native) or `{ __proto__: null}`. Also returns null for
* cross-realm objects on browsers that lack `__proto__` support (like IE <11), but that's the best we can do.
*/
return null;
};
var Type$1 = Type$4;
var $TypeError$4 = type;
var implementation$b = implementation$c;
var hasProto = [].__proto__ === Array.prototype; // eslint-disable-line no-proto
var getProto = function getPrototypeOf(value) {
if (Type$1(value) !== 'Object') {
throw new $TypeError$4('Reflect.getPrototypeOf called on non-object');
}
return value.__proto__; // eslint-disable-line no-proto
};
var polyfill$5 = function getPolyfill() {
if (typeof Reflect === 'object' && Reflect && Reflect.getPrototypeOf) {
return Reflect.getPrototypeOf;
}
if (hasProto) {
return getProto;
}
return implementation$b;
};
var define$9 = defineProperties_1;
var getPolyfill$7 = polyfill$5;
var shim$7 = function shimGetPrototypeOf() {
define$9(
commonjsGlobal,
{ Reflect: {} },
{ Reflect: function () { return typeof Reflect !== 'object' || !Reflect; } }
);
var polyfill = getPolyfill$7();
define$9(
Reflect,
{ getPrototypeOf: polyfill },
{ getPrototypeOf: function () { return Reflect.getPrototypeOf !== polyfill; } }
);
return polyfill;
};
var callBind$3 = callBindExports;
var define$8 = defineProperties_1;
var implementation$a = implementation$c;
var getPolyfill$6 = polyfill$5;
var shim$6 = shim$7;
var bound$1 = callBind$3(getPolyfill$6(), typeof Reflect === 'object' ? Reflect : Object);
define$8(bound$1, {
getPolyfill: getPolyfill$6,
implementation: implementation$a,
shim: shim$6
});
var reflect_getprototypeof = bound$1;
var define$7 = defineDataProperty$1;
var hasDescriptors = hasPropertyDescriptors_1();
var functionsHaveConfigurableNames = functionsHaveNames_1.functionsHaveConfigurableNames();
var $TypeError$3 = type;
/** @type {import('.')} */
var setFunctionName$1 = function setFunctionName(fn, name) {
if (typeof fn !== 'function') {
throw new $TypeError$3('`fn` is not a function');
}
var loose = arguments.length > 2 && !!arguments[2];
if (!loose || functionsHaveConfigurableNames) {
if (hasDescriptors) {
define$7(/** @type {Parameters<define>[0]} */ (fn), 'name', name, true, true);
} else {
define$7(/** @type {Parameters<define>[0]} */ (fn), 'name', name);
}
}
return fn;
};
var GetIntrinsic$3 = getIntrinsic;
var gPO = reflect_getprototypeof;
var hasSymbols = hasSymbols$4;
var define$6 = defineProperties_1;
var setFunctionName = setFunctionName$1;
var arrayIterProto = GetIntrinsic$3('%ArrayIteratorPrototype%', true);
var iterProto$1 = arrayIterProto && gPO(arrayIterProto);
var result = iterProto$1 || {};
if (hasSymbols()) {
var defined = {};
var predicates = {};
var trueThunk = function () {
return true;
};
if (!(Symbol.iterator in result)) {
// needed when result === iterProto, or, node 0.11.15 - 3
defined[Symbol.iterator] = setFunctionName(function SymbolIterator() {
return this;
}, '[Symbol.iterator]', true);
predicates[Symbol.iterator] = trueThunk;
}
define$6(result, defined, predicates);
}
var iterator_prototype = result;
var GetIntrinsic$2 = getIntrinsic;
var hasPropertyDescriptors = hasPropertyDescriptors_1();
var $TypeError$2 = GetIntrinsic$2('%TypeError%');
var $defineProperty = hasPropertyDescriptors && GetIntrinsic$2('%Object.defineProperty%', true);
var iterProto = iterator_prototype;
var callBound = requireCallBound();
var $isPrototypeOf = callBound('Object.prototype.isPrototypeOf');
var $Iterator$2 = typeof Iterator === 'function' ? Iterator : function Iterator() {
if (
!(this instanceof Iterator)
|| this.constructor === Iterator
|| !$isPrototypeOf(Iterator, this.constructor)
) {
throw new $TypeError$2('`Iterator` can not be called or constructed directly');
}
};
if ($Iterator$2.prototype !== iterProto) {
$Iterator$2.prototype = iterProto;
}
$defineProperty($Iterator$2, 'prototype', { writable: false });
var implementation$9 = $Iterator$2;
var globalThis$2 = globalthis();
var implementation$8 = implementation$9;
var polyfill$4 = function getPolyfill() {
return typeof globalThis$2.Iterator === 'function' ? globalThis$2.Iterator : implementation$8;
};
var CreateIterResultObject;
var hasRequiredCreateIterResultObject;
function requireCreateIterResultObject () {
if (hasRequiredCreateIterResultObject) return CreateIterResultObject;
hasRequiredCreateIterResultObject = 1;
var $TypeError = type;
// https://262.ecma-international.org/6.0/#sec-createiterresultobject
CreateIterResultObject = function CreateIterResultObject(value, done) {
if (typeof done !== 'boolean') {
throw new $TypeError('Assertion failed: Type(done) is not Boolean');
}
return {
value: value,
done: done
};
};
return CreateIterResultObject;
}
var implementation$7 = iterator_prototype;
var WrapForValidIteratorPrototype;
var hasRequiredWrapForValidIteratorPrototype;
function requireWrapForValidIteratorPrototype () {
if (hasRequiredWrapForValidIteratorPrototype) return WrapForValidIteratorPrototype;
hasRequiredWrapForValidIteratorPrototype = 1;
var GetIntrinsic = getIntrinsic;
var $TypeError = GetIntrinsic('%TypeError%');
var Call = requireCall();
var CreateIterResultObject = requireCreateIterResultObject();
var GetMethod = requireGetMethod();
var Type = requireType();
var SLOT = requireInternalSlot();
var iterProto = implementation$7;
// https://tc39.es/proposal-iterator-helpers/#sec-wrapforvaliditeratorprototype-object
WrapForValidIteratorPrototype = /* GetIntrinsic('%WrapForValidIteratorPrototype%', true) || */ {
__proto__: iterProto,
next: function next() {
var O = this; // step 1
// RequireInternalSlot(O, [[Iterated]]); // step 2
SLOT.assert(O, '[[Iterated]]');
var iteratorRecord = SLOT.get(O, '[[Iterated]]'); // step 3
return Call(iteratorRecord['[[NextMethod]]'], iteratorRecord['[[Iterator]]']); // step 4
},
'return': function () {
var O = this; // step 1
// RequireInternalSlot(O, [[Iterated]]); // step 2
SLOT.assert(O, '[[Iterated]]');
var iterator = SLOT.get(O, '[[Iterated]]')['[[Iterator]]']; // step 3
if (Type(iterator) !== 'Object') {
throw new $TypeError('iterator must be an Object'); // step 4
}
var returnMethod = GetMethod(iterator, 'return'); // step 5
if (typeof returnMethod === 'undefined') { // step 6
return CreateIterResultObject(undefined, true); // step 6.a
}
return Call(returnMethod, iterator); // step 7
}
};
return WrapForValidIteratorPrototype;
}
var GetIntrinsic$1 = getIntrinsic;
var $TypeError$1 = GetIntrinsic$1('%TypeError%');
var GetIteratorFlattenable = requireGetIteratorFlattenable();
var OrdinaryHasInstance = requireOrdinaryHasInstance();
var OrdinaryObjectCreate = requireOrdinaryObjectCreate();
var $Iterator$1 = polyfill$4();
var $WrapForValidIteratorPrototype = requireWrapForValidIteratorPrototype();
var SLOT$1 = requireInternalSlot();
var implementation$6 = function from(O) {
if (this instanceof from) {
throw new $TypeError$1('`Iterator.from` is not a constructor');
}
var iteratorRecord = GetIteratorFlattenable(O, 'iterate-strings'); // step 1
var hasInstance = OrdinaryHasInstance($Iterator$1, iteratorRecord['[[Iterator]]']); // step 2
if (hasInstance) { // step 3
return iteratorRecord['[[Iterator]]']; // step 3.a
}
var wrapper = OrdinaryObjectCreate($WrapForValidIteratorPrototype); // , ['[[Iterated]]']); // step 4
SLOT$1.set(wrapper, '[[Iterated]]', iteratorRecord); // step 5
return wrapper; // step 6
};
var define$5 = defineProperties_1;
var globalThis$1 = globalthis();
var getPolyfill$5 = polyfill$4;
var shim$5 = function shimIterator() {
var polyfill = getPolyfill$5();
define$5(
globalThis$1,
{ Iterator: polyfill },
{ Iterator: function () { return Iterator !== polyfill; } }
);
return polyfill;
};
var define$4 = defineProperties_1;
var callBind$2 = callBindExports;
var implementation$5 = implementation$9;
var getPolyfill$4 = polyfill$4;
var shim$4 = shim$5;
var polyfill$3 = callBind$2(getPolyfill$4());
define$4(polyfill$3, {
getPolyfill: getPolyfill$4,
implementation: implementation$5,
shim: shim$4
});
var Iterator$1 = polyfill$3;
var implementation$4 = implementation$6;
var $Iterator = Iterator$1;
var polyfill$2 = function getPolyfill() {
return typeof $Iterator.from === 'function' ? $Iterator.from : implementation$4;
};
var getPolyfill$3 = polyfill$2;
var define$3 = defineProperties_1;
var getIteratorPolyfill = polyfill$4;
var shim$3 = function shimIteratorFrom() {
var $Iterator = getIteratorPolyfill();
var polyfill = getPolyfill$3();
define$3(
$Iterator,
{ from: polyfill },
{ from: function () { return $Iterator.from !== polyfill; } }
);
return polyfill;
};
var callBind$1 = callBindExports;
var define$2 = defineProperties_1;
var implementation$3 = implementation$6;
var getPolyfill$2 = polyfill$2;
var shim$2 = shim$3;
var bound = callBind$1(getPolyfill$2(), null);
define$2(bound, {
getPolyfill: getPolyfill$2,
implementation: implementation$3,
shim: shim$2
});
var Iterator_from = bound;
const iterFrom = /*@__PURE__*/getDefaultExportFromCjs(Iterator_from);
var CompletionRecord_1;
var hasRequiredCompletionRecord;
function requireCompletionRecord () {
if (hasRequiredCompletionRecord) return CompletionRecord_1;
hasRequiredCompletionRecord = 1;
var $SyntaxError = syntax;
var SLOT = requireInternalSlot();
// https://262.ecma-international.org/7.0/#sec-completion-record-specification-type
var CompletionRecord = function CompletionRecord(type, value) {
if (!(this instanceof CompletionRecord)) {
return new CompletionRecord(type, value);
}
if (type !== 'normal' && type !== 'break' && type !== 'continue' && type !== 'return' && type !== 'throw') {
throw new $SyntaxError('Assertion failed: `type` must be one of "normal", "break", "continue", "return", or "throw"');
}
SLOT.set(this, '[[Type]]', type);
SLOT.set(this, '[[Value]]', value);
// [[Target]] slot?
};
CompletionRecord.prototype.type = function Type() {
return SLOT.get(this, '[[Type]]');
};
CompletionRecord.prototype.value = function Value() {
return SLOT.get(this, '[[Value]]');
};
CompletionRecord.prototype['?'] = function ReturnIfAbrupt() {
var type = SLOT.get(this, '[[Type]]');
var value = SLOT.get(this, '[[Value]]');
if (type === 'normal') {
return value;
}
if (type === 'throw') {
throw value;
}
throw new $SyntaxError('Completion Record is not of type "normal" or "throw": other types not supported');
};
CompletionRecord.prototype['!'] = function assert() {
var type = SLOT.get(this, '[[Type]]');
if (type !== 'normal') {
throw new $SyntaxError('Assertion failed: Completion Record is not of type "normal"');
}
return SLOT.get(this, '[[Value]]');
};
CompletionRecord_1 = CompletionRecord;
return CompletionRecord_1;
}
var GeneratorStart;
var hasRequiredGeneratorStart;
function requireGeneratorStart () {
if (hasRequiredGeneratorStart) return GeneratorStart;
hasRequiredGeneratorStart = 1;
var GetIntrinsic = getIntrinsic;
var $TypeError = GetIntrinsic('%TypeError%');
var CreateIterResultObject = requireCreateIterResultObject();
var IsCallable = requireIsCallable();
var Type = requireType();
var SLOT = requireInternalSlot();
GeneratorStart = function GeneratorStart(generator, closure) {
SLOT.assert(generator, '[[GeneratorState]]');
SLOT.assert(generator, '[[GeneratorContext]]');
SLOT.assert(generator, '[[GeneratorBrand]]');
SLOT.assert(generator, '[[Sentinel]]'); // our userland slot
SLOT.assert(generator, '[[CloseIfAbrupt]]'); // our second userland slot
if (!IsCallable(closure) || closure.length !== 0) {
throw new $TypeError('`closure` must be a function that takes no arguments');
}
var sentinel = SLOT.get(closure, '[[Sentinel]]');
if (Type(sentinel) !== 'Object') {
throw new $TypeError('`closure.[[Sentinel]]` must be an object');
}
SLOT.set(generator, '[[GeneratorContext]]', function () { // steps 2-5
try {
var result = closure();
if (result === sentinel) {
SLOT.set(generator, '[[GeneratorState]]', 'completed');
SLOT.set(generator, '[[GeneratorContext]]', null);
return CreateIterResultObject(void undefined, true);
}
SLOT.set(generator, '[[GeneratorState]]', 'suspendedYield');
return CreateIterResultObject(result, false);
} catch (e) {
SLOT.set(generator, '[[GeneratorState]]', 'completed');
SLOT.set(generator, '[[GeneratorContext]]', null);
throw e;
}
});
SLOT.set(generator, '[[GeneratorState]]', 'suspendedStart'); // step 6
};
return GeneratorStart;
}
var every;
var hasRequiredEvery;
function requireEvery () {
if (hasRequiredEvery) return every;
hasRequiredEvery = 1;
every = function every(array, predicate) {
for (var i = 0; i < array.length; i += 1) {
if (!predicate(array[i], i, array)) {
return false;
}
}
return true;
};
return every;
}
var safeArrayConcat;
var hasRequiredSafeArrayConcat;
function requireSafeArrayConcat () {
if (hasRequiredSafeArrayConcat) return safeArrayConcat;
hasRequiredSafeArrayConcat = 1;
var GetIntrinsic = getIntrinsic;
var $concat = GetIntrinsic('%Array.prototype.concat%');
var callBind = callBindExports;
var callBound = requireCallBound();
var $slice = callBound('Array.prototype.slice');
var hasSymbols = shams$1();
var isConcatSpreadable = hasSymbols && Symbol.isConcatSpreadable;
/** @type {never[]} */ var empty = [];
var $concatApply = isConcatSpreadable ? callBind.apply($concat, empty) : null;
// eslint-disable-next-line no-extra-parens
var isArray = isConcatSpreadable ? /** @type {(value: unknown) => value is unknown[]} */ (requireIsarray()) : null;
/** @type {import('.')} */
safeArrayConcat = isConcatSpreadable
// eslint-disable-next-line no-unused-vars
? function safeArrayConcat(item) {
for (var i = 0; i < arguments.length; i += 1) {
/** @type {typeof item} */ var arg = arguments[i];
// @ts-expect-error ts(2538) see https://github.com/microsoft/TypeScript/issues/9998#issuecomment-1890787975; works if `const`
if (arg && typeof arg === 'object' && typeof arg[isConcatSpreadable] === 'boolean') {
// @ts-expect-error ts(7015) TS doesn't yet support Symbol indexing
if (!empty[isConcatSpreadable]) {
// @ts-expect-error ts(7015) TS doesn't yet support Symbol indexing
empty[isConcatSpreadable] = true;
}
// @ts-expect-error ts(2721) ts(18047) not sure why TS can't figure out this can't be null
var arr = isArray(arg) ? $slice(arg) : [arg];
// @ts-expect-error ts(7015) TS can't handle expandos on an array
arr[isConcatSpreadable] = true; // shadow the property. TODO: use [[Define]]
arguments[i] = arr;
}
}
// @ts-expect-error ts(2345) https://github.com/microsoft/TypeScript/issues/57164 TS doesn't understand that apply can take an arguments object
return $concatApply(arguments);
}
: callBind($concat, empty);
return safeArrayConcat;
}
var CreateIteratorFromClosure$1;
var hasRequiredCreateIteratorFromClosure;
function requireCreateIteratorFromClosure () {
if (hasRequiredCreateIteratorFromClosure) return CreateIteratorFromClosure$1;
hasRequiredCreateIteratorFromClosure = 1;
var GetIntrinsic = getIntrinsic;
var $TypeError = GetIntrinsic('%TypeError%');
var GeneratorStart = requireGeneratorStart();
var IsArray = requireIsArray();
var IsCallable = requireIsCallable();
var OrdinaryObjectCreate = requireOrdinaryObjectCreate();
var Type = requireType();
var every = requireEvery();
var SLOT = requireInternalSlot();
var safeConcat = requireSafeArrayConcat();
var isString = function isString(slot) {
return Type(slot) === 'String';
};
CreateIteratorFromClosure$1 = function CreateIteratorFromClosure(closure, generatorBrand, proto) {
if (!IsCallable(closure)) {
throw new $TypeError('`closure` must be a function');
}
if (Type(generatorBrand) !== 'String') {
throw new $TypeError('`generatorBrand` must be a string');
}
var extraSlots = arguments.length > 3 ? arguments[3] : [];
if (arguments.length > 3) {
if (!IsArray(extraSlots) || !every(extraSlots, isString)) {
throw new $TypeError('`extraSlots` must be a List of String internal slot names');
}
}
var internalSlotsList = safeConcat(extraSlots, ['[[GeneratorContext]]', '[[GeneratorBrand]]', '[[GeneratorState]]']); // step 3
var generator = OrdinaryObjectCreate(proto, internalSlotsList); // steps 4, 6
SLOT.set(generator, '[[GeneratorBrand]]', generatorBrand); // step 5
SLOT.assert(closure, '[[Sentinel]]'); // our userland slot
SLOT.set(generator, '[[Sentinel]]', SLOT.get(closure, '[[Sentinel]]')); // our userland slot
SLOT.assert(closure, '[[CloseIfAbrupt]]'); // our second userland slot
SLOT.set(generator, '[[CloseIfAbrupt]]', SLOT.get(closure, '[[CloseIfAbrupt]]')); // our second userland slot
GeneratorStart(generator, closure); // step 13
return generator; // step 15
};
return CreateIteratorFromClosure$1;
}
var matchRecord;
var hasRequiredMatchRecord;
function requireMatchRecord () {
if (hasRequiredMatchRecord) return matchRecord;
hasRequiredMatchRecord = 1;
var hasOwn = requireHasown();
// https://262.ecma-international.org/13.0/#sec-match-records
matchRecord = function isMatchRecord(record) {
return (
!!record
&& typeof record === 'object'
&& hasOwn(record, '[[StartIndex]]')
&& hasOwn(record, '[[EndIndex]]')
&& record['[[StartIndex]]'] >= 0
&& record['[[EndIndex]]'] >= record['[[StartIndex]]']
&& String(parseInt(record['[[StartIndex]]'], 10)) === String(record['[[StartIndex]]'])
&& String(parseInt(record['[[EndIndex]]'], 10)) === String(record['[[EndIndex]]'])
);
};
return matchRecord;
}
var propertyDescriptor;
var hasRequiredPropertyDescriptor;
function requirePropertyDescriptor () {
if (hasRequiredPropertyDescriptor) return propertyDescriptor;
hasRequiredPropertyDescriptor = 1;
var $TypeError = type;
var hasOwn = requireHasown();
var allowed = {
__proto__: null,
'[[Configurable]]': true,
'[[Enumerable]]': true,
'[[Get]]': true,
'[[Set]]': true,
'[[Value]]': true,
'[[Writable]]': true
};
// https://262.ecma-international.org/6.0/#sec-property-descriptor-specification-type
propertyDescriptor = function isPropertyDescriptor(Desc) {
if (!Desc || typeof Desc !== 'object') {
return false;
}
for (var key in Desc) { // eslint-disable-line
if (hasOwn(Desc, key) && !allowed[key]) {
return false;
}
}
var isData = hasOwn(Desc, '[[Value]]') || hasOwn(Desc, '[[Writable]]');
var IsAccessor = hasOwn(Desc, '[[Get]]') || hasOwn(Desc, '[[Set]]');
if (isData && IsAccessor) {
throw new $TypeError('Property Descriptors may not be both accessor and data descriptors');
}
return true;
};
return propertyDescriptor;
}
var iteratorRecord;
var hasRequiredIteratorRecord;
function requireIteratorRecord () {
if (hasRequiredIteratorRecord) return iteratorRecord;
hasRequiredIteratorRecord = 1;
var hasOwn = requireHasown();
iteratorRecord = function isIteratorRecord(value) {
return !!value
&& typeof value === 'object'
&& hasOwn(value, '[[Iterator]]')
&& hasOwn(value, '[[NextMethod]]')
&& typeof value['[[NextMethod]]'] === 'function'
&& hasOwn(value, '[[Done]]')
&& typeof value['[[Done]]'] === 'boolean';
};
return iteratorRecord;
}
var promiseCapabilityRecord;
var hasRequiredPromiseCapabilityRecord;
function requirePromiseCapabilityRecord () {
if (hasRequiredPromiseCapabilityRecord) return promiseCapabilityRecord;
hasRequiredPromiseCapabilityRecord = 1;
var hasOwn = requireHasown();
promiseCapabilityRecord = function isPromiseCapabilityRecord(value) {
return !!value
&& typeof value === 'object'
&& hasOwn(value, '[[Resolve]]')
&& typeof value['[[Resolve]]'] === 'function'
&& hasOwn(value, '[[Reject]]')
&& typeof value['[[Reject]]'] === 'function'
&& hasOwn(value, '[[Promise]]')
&& !!value['[[Promise]]']
&& typeof value['[[Promise]]'] === 'object'
&& typeof value['[[Promise]]'].then === 'function';
};
return promiseCapabilityRecord;
}
var asyncGeneratorRequestRecord;
var hasRequiredAsyncGeneratorRequestRecord;
function requireAsyncGeneratorRequestRecord () {
if (hasRequiredAsyncGeneratorRequestRecord) return asyncGeneratorRequestRecord;
hasRequiredAsyncGeneratorRequestRecord = 1;
var hasOwn = requireHasown();
var isPromiseCapabilityRecord = requirePromiseCapabilityRecord();
asyncGeneratorRequestRecord = function isAsyncGeneratorRequestRecord(value) {
return !!value
&& typeof value === 'object'
&& hasOwn(value, '[[Completion]]') // TODO: confirm is a completion record
&& hasOwn(value, '[[Capability]]')
&& isPromiseCapabilityRecord(value['[[Capability]]']);
};
return asyncGeneratorRequestRecord;
}
var regexpRecord;
var hasRequiredRegexpRecord;
function requireRegexpRecord () {
if (hasRequiredRegexpRecord) return regexpRecord;
hasRequiredRegexpRecord = 1;
var hasOwn = requireHasown();
var isInteger = requireIsInteger();
regexpRecord = function isRegExpRecord(value) {
return !!value
&& typeof value === 'object'
&& hasOwn(value, '[[IgnoreCase]]')
&& typeof value['[[IgnoreCase]]'] === 'boolean'
&& hasOwn(value, '[[Multiline]]')
&& typeof value['[[Multiline]]'] === 'boolean'
&& hasOwn(value, '[[DotAll]]')
&& typeof value['[[DotAll]]'] === 'boolean'
&& hasOwn(value, '[[Unicode]]')
&& typeof value['[[Unicode]]'] === 'boolean'
&& hasOwn(value, '[[CapturingGroupsCount]]')
&& typeof value['[[CapturingGroupsCount]]'] === 'number'
&& isInteger(value['[[CapturingGroupsCount]]'])
&& value['[[CapturingGroupsCount]]'] >= 0
&& (!hasOwn(value, '[[UnicodeSets]]') || typeof value['[[UnicodeSets]]'] === 'boolean'); // optional since it was added later
};
return regexpRecord;
}
var assertRecord;
var hasRequiredAssertRecord;
function requireAssertRecord () {
if (hasRequiredAssertRecord) return assertRecord;
hasRequiredAssertRecord = 1;
// TODO, semver-major: delete this
var $TypeError = type;
var $SyntaxError = syntax;
var isMatchRecord = requireMatchRecord();
var isPropertyDescriptor = requirePropertyDescriptor();
var isIteratorRecord = requireIteratorRecord();
var isPromiseCapabilityRecord = requirePromiseCapabilityRecord();
var isAsyncGeneratorRequestRecord = requireAsyncGeneratorRequestRecord();
var isRegExpRecord = requireRegexpRecord();
var predicates = {
'Property Descriptor': isPropertyDescriptor,
'Match Record': isMatchRecord,
'Iterator Record': isIteratorRecord,
'PromiseCapability Record': isPromiseCapabilityRecord,
'AsyncGeneratorRequest Record': isAsyncGeneratorRequestRecord,
'RegExp Record': isRegExpRecord
};
assertRecord = function assertRecord(Type, recordType, argumentName, value) {
var predicate = predicates[recordType];
if (typeof predicate !== 'function') {
throw new $SyntaxError('unknown record type: ' + recordType);
}
if (!predicate(value)) {
throw new $TypeError(argumentName + ' must be a ' + recordType);
}
};
return assertRecord;
}
var IteratorClose$1;
var hasRequiredIteratorClose;
function requireIteratorClose () {
if (hasRequiredIteratorClose) return IteratorClose$1;
hasRequiredIteratorClose = 1;
var GetIntrinsic = getIntrinsic;
var $TypeError = GetIntrinsic('%TypeError%');
var Call = requireCall();
var CompletionRecord = requireCompletionRecord();
var GetMethod = requireGetMethod();
var Type = requireType();
var assertRecord = requireAssertRecord();
// https://262.ecma-international.org/14.0/#sec-iteratorclose
IteratorClose$1 = function IteratorClose(iteratorRecord, completion) {
assertRecord(Type, 'Iterator Record', 'iteratorRecord', iteratorRecord);
if (Type(iteratorRecord['[[Iterator]]']) !== 'Object') {
throw new $TypeError('Assertion failed: iteratorRecord.[[Iterator]] must be an Object'); // step 1
}
if (!(completion instanceof CompletionRecord)) { // step 2
throw new $TypeError('Assertion failed: completion is not a Completion Record instance');
}
var completionThunk = function () {
var value = completion.value();
if (completion.type() === 'throw') {
throw value;
}
return value;
};
var iterator = iteratorRecord['[[Iterator]]']; // step 3
var iteratorReturn;
try {
iteratorReturn = GetMethod(iterator, 'return'); // step 4
} catch (e) {
completionThunk(); // throws if `completion` is a throw completion // step 6
completionThunk = null; // ensure it's not called twice.
throw e; // step 7
}
if (typeof iteratorReturn === 'undefined') {
return completionThunk(); // step 5.a - 5.b
}
var innerResult;
try {
innerResult = Call(iteratorReturn, iterator, []);
} catch (e) {
// if we hit here, then "e" is the innerResult completion that needs re-throwing
completionThunk(); // throws if `completion` is a throw completion // step 6
completionThunk = null; // ensure it's not called twice.
// if not, then return the innerResult completion
throw e; // step 7
}
var completionRecord = completionThunk(); // if innerResult worked, then throw if the completion does
completionThunk = null; // ensure it's not called twice.
if (Type(innerResult) !== 'Object') {
throw new $TypeError('iterator .return must return an object');
}
return completionRecord;
};
return IteratorClose$1;
}
var ToBoolean$1;
var hasRequiredToBoolean;
function requireToBoolean () {
if (hasRequiredToBoolean) return ToBoolean$1;
hasRequiredToBoolean = 1;
// http://262.ecma-international.org/5.1/#sec-9.2
ToBoolean$1 = function ToBoolean(value) { return !!value; };
return ToBoolean$1;
}
var IteratorComplete;
var hasRequiredIteratorComplete;
function requireIteratorComplete () {
if (hasRequiredIteratorComplete) return IteratorComplete;
hasRequiredIteratorComplete = 1;
var $TypeError = type;
var Get = requireGet();
var ToBoolean = requireToBoolean();
var Type = requireType();
// https://262.ecma-international.org/6.0/#sec-iteratorcomplete
IteratorComplete = function IteratorComplete(iterResult) {
if (Type(iterResult) !== 'Object') {
throw new $TypeError('Assertion failed: Type(iterResult) is not Object');
}
return ToBoolean(Get(iterResult, 'done'));
};
return IteratorComplete;
}
var IteratorNext;
var hasRequiredIteratorNext;
function requireIteratorNext () {
if (hasRequiredIteratorNext) return IteratorNext;
hasRequiredIteratorNext = 1;
var $TypeError = type;
var Call = requireCall();
var Type = requireType();
var isIteratorRecord = requireIteratorRecord();
// https://262.ecma-international.org/14.0/#sec-iteratornext
IteratorNext = function IteratorNext(iteratorRecord) {
if (!isIteratorRecord(iteratorRecord)) {
throw new $TypeError('Assertion failed: `iteratorRecord` must be an Iterator Record'); // step 1
}
var result;
if (arguments.length < 2) { // step 1
result = Call(iteratorRecord['[[NextMethod]]'], iteratorRecord['[[Iterator]]']); // step 1.a
} else { // step 2
result = Call(iteratorRecord['[[NextMethod]]'], iteratorRecord['[[Iterator]]'], [arguments[1]]); // step 2.a
}
if (Type(result) !== 'Object') {
throw new $TypeError('iterator next must return an object'); // step 3
}
return result; // step 4
};
return IteratorNext;
}
var IteratorStep$1;
var hasRequiredIteratorStep;
function requireIteratorStep () {
if (hasRequiredIteratorStep) return IteratorStep$1;
hasRequiredIteratorStep = 1;
var $TypeError = type;
var IteratorComplete = requireIteratorComplete();
var IteratorNext = requireIteratorNext();
var isIteratorRecord = requireIteratorRecord();
// https://262.ecma-international.org/14.0/#sec-iteratorstep
IteratorStep$1 = function IteratorStep(iteratorRecord) {
if (!isIteratorRecord(iteratorRecord)) {
throw new $TypeError('Assertion failed: `iteratorRecord` must be an Iterator Record'); // step 1
}
var result = IteratorNext(iteratorRecord); // step 1
var done = IteratorComplete(result); // step 2
return done === true ? false : result; // steps 3-4
};
return IteratorStep$1;
}
var IteratorValue$1;
var hasRequiredIteratorValue;
function requireIteratorValue () {
if (hasRequiredIteratorValue) return IteratorValue$1;
hasRequiredIteratorValue = 1;
var $TypeError = type;
var Get = requireGet();
var Type = requireType();
// https://262.ecma-international.org/6.0/#sec-iteratorvalue
IteratorValue$1 = function IteratorValue(iterResult) {
if (Type(iterResult) !== 'Object') {
throw new $TypeError('Assertion failed: Type(iterResult) is not Object');
}
return Get(iterResult, 'value');
};
return IteratorValue$1;
}
var ThrowCompletion$1;
var hasRequiredThrowCompletion;
function requireThrowCompletion () {
if (hasRequiredThrowCompletion) return ThrowCompletion$1;
hasRequiredThrowCompletion = 1;
var CompletionRecord = requireCompletionRecord();
// https://262.ecma-international.org/9.0/#sec-throwcompletion
ThrowCompletion$1 = function ThrowCompletion(argument) {
return new CompletionRecord('throw', argument);
};
return ThrowCompletion$1;
}
var esSetTostringtag;
var hasRequiredEsSetTostringtag;
function requireEsSetTostringtag () {
if (hasRequiredEsSetTostringtag) return esSetTostringtag;
hasRequiredEsSetTostringtag = 1;
var GetIntrinsic = getIntrinsic;
var $defineProperty = GetIntrinsic('%Object.defineProperty%', true);
var hasToStringTag = requireShams()();
var hasOwn = requireHasown();
var toStringTag = hasToStringTag ? Symbol.toStringTag : null;
/** @type {import('.')} */
esSetTostringtag = function setToStringTag(object, value) {
var overrideIfSet = arguments.length > 2 && arguments[2] && arguments[2].force;
if (toStringTag && (overrideIfSet || !hasOwn(object, toStringTag))) {
if ($defineProperty) {
$defineProperty(object, toStringTag, {
configurable: true,
enumerable: false,
value: value,
writable: false
});
} else {
object[toStringTag] = value; // eslint-disable-line no-param-reassign
}
}
};
return esSetTostringtag;
}
var GeneratorValidate;
var hasRequiredGeneratorValidate;
function requireGeneratorValidate () {
if (hasRequiredGeneratorValidate) return GeneratorValidate;
hasRequiredGeneratorValidate = 1;
var GetIntrinsic = getIntrinsic;
var $TypeError = GetIntrinsic('%TypeError%');
var SLOT = requireInternalSlot();
GeneratorValidate = function GeneratorValidate(generator, generatorBrand) {
SLOT.assert(generator, '[[GeneratorState]]'); // step 1
SLOT.assert(generator, '[[GeneratorBrand]]'); // step 2
var brand = SLOT.get(generator, '[[GeneratorBrand]]');
if (brand !== generatorBrand) {
throw new $TypeError('Assertion failed: generator brand is unexpected: ' + brand);
}
SLOT.assert(generator, '[[GeneratorContext]]'); // step 4
var state = SLOT.get(generator, '[[GeneratorState]]'); // step 5
if (state === 'executing') {
throw new $TypeError('generator is executing');
}
return state; // step 7
};
return GeneratorValidate;
}
var GeneratorResume;
var hasRequiredGeneratorResume;
function requireGeneratorResume () {
if (hasRequiredGeneratorResume) return GeneratorResume;
hasRequiredGeneratorResume = 1;
var GetIntrinsic = getIntrinsic;
var $TypeError = GetIntrinsic('%TypeError%');
var CreateIterResultObject = requireCreateIterResultObject();
var GeneratorValidate = requireGeneratorValidate();
var SLOT = requireInternalSlot();
GeneratorResume = function GeneratorResume(generator, value, generatorBrand) {
var state = GeneratorValidate(generator, generatorBrand); // step 1
if (state === 'completed') {
return CreateIterResultObject(void undefined, true); // step 2
}
if (state !== 'suspendedStart' && state !== 'suspendedYield') {
throw new $TypeError('Assertion failed: generator state is unexpected: ' + state); // step 3
}
var genContext = SLOT.get(generator, '[[GeneratorContext]]');
SLOT.set(generator, '[[GeneratorState]]', 'executing'); // step 7
var result = genContext(value); // steps 5-6, 8-10
return result;
};
return GeneratorResume;
}
var GeneratorResumeAbrupt;
var hasRequiredGeneratorResumeAbrupt;
function requireGeneratorResumeAbrupt () {
if (hasRequiredGeneratorResumeAbrupt) return GeneratorResumeAbrupt;
hasRequiredGeneratorResumeAbrupt = 1;
var GetIntrinsic = getIntrinsic;
var $TypeError = GetIntrinsic('%TypeError%');
var CompletionRecord = requireCompletionRecord();
var CreateIterResultObject = requireCreateIterResultObject();
var GeneratorValidate = requireGeneratorValidate();
var SLOT = requireInternalSlot();
GeneratorResumeAbrupt = function GeneratorResumeAbrupt(generator, abruptCompletion, generatorBrand) {
if (!(abruptCompletion instanceof CompletionRecord)) {
throw new $TypeError('Assertion failed: abruptCompletion must be a Completion Record');
}
var state = GeneratorValidate(generator, generatorBrand); // step 1
if (state === 'suspendedStart') { // step 2
SLOT.set(generator, '[[GeneratorState]]', 'completed'); // step 3.a
SLOT.set(generator, '[[GeneratorContext]]', null); // step 3.b
state = 'completed'; // step 3.c
}
var value = abruptCompletion.value();
if (state === 'completed') { // step 3
return CreateIterResultObject(value, true); // steps 3.a-b
}
if (state !== 'suspendedYield') {
throw new $TypeError('Assertion failed: generator state is unexpected: ' + state); // step 4
}
if (abruptCompletion.type() === 'return') {
// due to representing `GeneratorContext` as a function, we can't safely re-invoke it, so we can't support sending it a return completion
return CreateIterResultObject(SLOT.get(generator, '[[CloseIfAbrupt]]')(abruptCompletion), true);
}
var genContext = SLOT.get(generator, '[[GeneratorContext]]'); // step 5
SLOT.set(generator, '[[GeneratorState]]', 'executing'); // step 8
var result = genContext(value); // steps 6-7, 8-11
return result; // step 12
};
return GeneratorResumeAbrupt;
}
var NormalCompletion;
var hasRequiredNormalCompletion;
function requireNormalCompletion () {
if (hasRequiredNormalCompletion) return NormalCompletion;
hasRequiredNormalCompletion = 1;
var CompletionRecord = requireCompletionRecord();
// https://262.ecma-international.org/6.0/#sec-normalcompletion
NormalCompletion = function NormalCompletion(value) {
return new CompletionRecord('normal', value);
};
return NormalCompletion;
}
var IteratorHelperPrototype;
var hasRequiredIteratorHelperPrototype;
function requireIteratorHelperPrototype () {
if (hasRequiredIteratorHelperPrototype) return IteratorHelperPrototype;
hasRequiredIteratorHelperPrototype = 1;
var setToStringTag = requireEsSetTostringtag();
var hasProto = hasProto$3();
var iterProto = implementation$7;
var SLOT = requireInternalSlot();
var CompletionRecord = requireCompletionRecord();
var CreateIterResultObject = requireCreateIterResultObject();
var GeneratorResume = requireGeneratorResume();
var GeneratorResumeAbrupt = requireGeneratorResumeAbrupt();
var IteratorClose = requireIteratorClose();
var NormalCompletion = requireNormalCompletion();
var implementation;
if (hasProto) {
implementation = {
__proto__: iterProto,
next: function next() {
return GeneratorResume(this, void undefined, 'Iterator Helper');
},
'return': function () {
var O = this; // step 1
SLOT.assert(O, '[[UnderlyingIterator]]'); // step 2
SLOT.assert(O, '[[GeneratorState]]'); // step 3
if (SLOT.get(O, '[[GeneratorState]]') === 'suspendedStart') { // step 4
SLOT.set(O, '[[GeneratorState]]', 'completed'); // step 4.a
IteratorClose(SLOT.get(O, '[[UnderlyingIterator]]'), NormalCompletion('unused')); // step 4.c
return CreateIterResultObject(void undefined, true); // step 4.d
}
var C = new CompletionRecord('return', void undefined); // step 5
return GeneratorResumeAbrupt(O, C, 'Iterator Helper'); // step 6
}
};
setToStringTag(implementation, 'Iterator Helper');
} else {
var IteratorHelper = function IteratorHelper() {};
IteratorHelper.prototype = iterProto;
implementation = new IteratorHelper();
delete implementation.constructor;
implementation.next = function next() {
return GeneratorResume(this, void undefined, 'Iterator Helper');
};
implementation['return'] = function () {
var C = new CompletionRecord('return', void undefined); // step 1
return GeneratorResumeAbrupt(this, C, 'Iterator Helper');
};
}
IteratorHelperPrototype = implementation;
return IteratorHelperPrototype;
}
var GetIntrinsic = getIntrinsic;
var $TypeError = GetIntrinsic('%TypeError%');
var Call = requireCall();
var CompletionRecord = requireCompletionRecord();
var CreateIteratorFromClosure = requireCreateIteratorFromClosure();
var GetIteratorDirect = requireGetIteratorDirect();
var IsCallable = requireIsCallable();
var IteratorClose = requireIteratorClose();
var IteratorStep = requireIteratorStep();
var IteratorValue = requireIteratorValue();
var ThrowCompletion = requireThrowCompletion();
var ToBoolean = requireToBoolean();
var Type = requireType();
var iterHelperProto = requireIteratorHelperPrototype();
var SLOT = requireInternalSlot();
var implementation$2 = function filter(predicate) {
if (this instanceof filter) {
throw new $TypeError('`filter` is not a constructor');
}
var O = this; // step 1
if (Type(O) !== 'Object') {
throw new $TypeError('`this` value must be an Object'); // step 2
}
if (!IsCallable(predicate)) {
throw new $TypeError('`predicate` must be a function'); // step 3
}
var iterated = GetIteratorDirect(O); // step 4
var closeIfAbrupt = function (abruptCompletion) {
if (!(abruptCompletion instanceof CompletionRecord)) {
throw new $TypeError('`abruptCompletion` must be a Completion Record');
}
IteratorClose(
iterated,
abruptCompletion
);
};
var sentinel = {};
var counter = 0; // step 6.a
var closure = function () {
// eslint-disable-next-line no-constant-condition
while (true) { // step 6.b
var next = IteratorStep(iterated); // step 6.b.i
if (!next) {
// return void undefined; // step 6.b.ii
return sentinel;
}
var value = IteratorValue(next); // step 6.b.iii
var selected;
try {
selected = Call(predicate, void undefined, [value, counter]); // step 6.b.iv
// yield mapped // step 6.b.vi
if (ToBoolean(selected)) {
return value;
}
} catch (e) {
// close iterator // step 6.b.v, 6.b.vii
closeIfAbrupt(ThrowCompletion(e));
throw e;
} finally {
counter += 1; // step 6.b.viii
}
}
};
SLOT.set(closure, '[[Sentinel]]', sentinel); // for the userland implementation
SLOT.set(closure, '[[CloseIfAbrupt]]', closeIfAbrupt); // for the userland implementation
var result = CreateIteratorFromClosure(closure, 'Iterator Helper', iterHelperProto, ['[[UnderlyingIterator]]']); // step 7
SLOT.set(result, '[[UnderlyingIterator]]', iterated); // step 8
return result; // step 9
};
var implementation$1 = implementation$2;
var polyfill$1 = function getPolyfill() {
return typeof Iterator === 'function' && typeof Iterator.prototype.filter === 'function'
? Iterator.prototype.filter
: implementation$1;
};
var define$1 = defineProperties_1;
var getPolyfill$1 = polyfill$1;
var $IteratorPrototype = implementation$7;
var shim$1 = function shimIteratorPrototypeFilter() {
var polyfill = getPolyfill$1();
define$1(
$IteratorPrototype,
{ filter: polyfill },
{ filter: function () { return $IteratorPrototype.filter !== polyfill; } }
);
return polyfill;
};
var define = defineProperties_1;
var callBind = callBindExports;
var implementation = implementation$2;
var getPolyfill = polyfill$1;
var shim = shim$1;
var polyfill = callBind(getPolyfill());
define(polyfill, {
getPolyfill: getPolyfill,
implementation: implementation,
shim: shim
});
var Iterator_prototype_filter = polyfill;
const filter = /*@__PURE__*/getDefaultExportFromCjs(Iterator_prototype_filter);
exports.callBindExports = callBindExports;
exports.defineProperties_1 = defineProperties_1;
exports.filter = filter;
exports.getDefaultExportFromCjs = getDefaultExportFromCjs;
exports.getIntrinsic = getIntrinsic;
exports.implementation = implementation$7;
exports.iterFrom = iterFrom;
exports.requireCall = requireCall;
exports.requireGetIteratorDirect = requireGetIteratorDirect;
exports.requireIsCallable = requireIsCallable;
exports.requireIteratorClose = requireIteratorClose;
exports.requireIteratorStep = requireIteratorStep;
exports.requireIteratorValue = requireIteratorValue;
exports.requireNormalCompletion = requireNormalCompletion;
exports.requireThrowCompletion = requireThrowCompletion;
exports.requireToBoolean = requireToBoolean;
exports.requireType = requireType;