decord/source/7499_normalize.js

227 lines
7.1 KiB
JavaScript
Raw Normal View History

2026-08-08 06:10:11 +00:00
// Module ID: 7499
// Function ID: 7500
2026-07-29 08:29:29 +00:00
// Name: normalize
2026-08-08 06:10:11 +00:00
// Dependencies: [32, 7500, 7460, 7461, 7457]
2026-07-29 08:29:29 +00:00
// Exports: normalizeUrlToBase
2026-08-08 06:10:11 +00:00
// Module 7499 (normalize)
2026-07-29 08:29:29 +00:00
import _slicedToArray from "_slicedToArray";
function normalize(arg0) {
let num = arg1;
if (arg1 === undefined) {
num = 100;
}
let num2 = arg2;
if (arg2 === undefined) {
num2 = Infinity;
}
try {
return visit("", arg0, num, num2);
} catch (tmp5) {
const obj = { ERROR: null };
const _HermesInternal = HermesInternal;
obj[0] = "**non-serializable** (" + tmp5 + ")";
return obj;
}
}
2026-08-04 21:03:28 +00:00
function visit(arg0, num) {
num = arg2;
2026-07-29 08:29:29 +00:00
if (arg2 === undefined) {
num = Infinity;
}
let num2 = arg3;
if (arg3 === undefined) {
num2 = Infinity;
}
let memoBuilderResult = arg4;
if (arg4 === undefined) {
2026-08-08 06:10:11 +00:00
memoBuilderResult = require(7500) /* memoBuilder */.memoBuilder();
let obj = require(7500) /* memoBuilder */;
2026-07-29 08:29:29 +00:00
}
_slicedToArray(memoBuilderResult, 2);
2026-08-04 21:03:28 +00:00
if (null != num) {
2026-07-29 08:29:29 +00:00
const items = ["boolean", "string"];
2026-08-04 21:03:28 +00:00
if (!items.includes(typeof num)) {
if (typeof num === "number") {
2026-07-29 08:29:29 +00:00
let _Number = Number;
}
2026-08-04 21:03:28 +00:00
let str = (function stringifyValue(arg0, obj) {
2026-07-29 08:29:29 +00:00
try {
if ("domain" === arg0) {
2026-08-04 21:03:28 +00:00
if (obj) {
if (typeof obj === "object") {
if (obj._events) {
2026-07-29 08:29:29 +00:00
return "[Domain]";
}
}
}
}
if ("domainEmitter" === arg0) {
return "[DomainEmitter]";
} else {
if (undefined !== closure_0) {
2026-08-04 21:03:28 +00:00
if (obj === closure_0) {
2026-07-29 08:29:29 +00:00
return "[Global]";
}
}
const _window = window;
2026-08-04 21:03:28 +00:00
if (typeof window !== "undefined") {
2026-07-29 08:29:29 +00:00
const _window2 = window;
2026-08-04 21:03:28 +00:00
if (obj === window) {
2026-07-29 08:29:29 +00:00
return "[Window]";
}
}
const _document = document;
2026-08-04 21:03:28 +00:00
if (typeof document !== "undefined") {
2026-07-29 08:29:29 +00:00
const _document2 = document;
2026-08-04 21:03:28 +00:00
if (obj === document) {
2026-07-29 08:29:29 +00:00
return "[Document]";
}
}
2026-08-04 21:03:28 +00:00
if (obj.isVueViewModel(obj)) {
2026-07-29 08:29:29 +00:00
return "[VueViewModel]";
} else {
let tmp4Result = tmp4(tmp5[3]);
2026-08-04 21:03:28 +00:00
if (tmp4Result.isSyntheticEvent(obj)) {
2026-07-29 08:29:29 +00:00
return "[SyntheticEvent]";
} else {
2026-08-04 21:03:28 +00:00
if (typeof obj === "number") {
2026-07-29 08:29:29 +00:00
const _Number = Number;
2026-08-04 21:03:28 +00:00
if (!Number.isFinite(obj)) {
2026-07-29 08:29:29 +00:00
const _HermesInternal = HermesInternal;
2026-08-04 21:03:28 +00:00
return "[" + obj + "]";
2026-07-29 08:29:29 +00:00
}
}
2026-08-04 21:03:28 +00:00
if (typeof obj === "function") {
2026-07-29 08:29:29 +00:00
tmp4Result = tmp4(tmp5[4]);
const _HermesInternal4 = HermesInternal;
2026-08-04 21:03:28 +00:00
return "[Function: " + tmp4Result.getFunctionName(obj) + "]";
} else if (typeof obj === "symbol") {
2026-07-29 08:29:29 +00:00
const _String2 = String;
const _HermesInternal3 = HermesInternal;
2026-08-04 21:03:28 +00:00
return "[" + String(obj) + "]";
} else if (typeof obj === "bigint") {
2026-07-29 08:29:29 +00:00
const _String = String;
const _HermesInternal2 = HermesInternal;
2026-08-04 21:03:28 +00:00
return "[BigInt: " + String(obj) + "]";
2026-07-29 08:29:29 +00:00
} else {
2026-08-04 21:03:28 +00:00
const tmp9 = (function getConstructorName(arg0) {
const prototypeOf = Object.getPrototypeOf(arg0);
2026-07-29 08:29:29 +00:00
let str = "null prototype";
if (prototypeOf) {
str = prototypeOf.constructor.name;
}
return str;
2026-08-04 21:03:28 +00:00
})(obj);
2026-07-29 08:29:29 +00:00
const _HermesInternal6 = HermesInternal;
if (obj4.test(tmp9)) {
let combined = concat(tmp10, "]");
} else {
combined = concat(tmp10, "]");
}
return combined;
}
}
}
obj = callback(table[3]);
}
} catch (tmp7) {
const _HermesInternal5 = HermesInternal;
return "**non-serializable** (" + tmp7 + ")";
}
2026-08-04 21:03:28 +00:00
})(arg0, num);
2026-07-29 08:29:29 +00:00
if (str.startsWith("[object ")) {
2026-08-04 21:03:28 +00:00
if (num.__sentry_skip_normalization__) {
return num;
2026-07-29 08:29:29 +00:00
} else {
2026-08-04 21:03:28 +00:00
if (typeof num.__sentry_override_normalization_depth__ === "number") {
num = num.__sentry_override_normalization_depth__;
2026-07-29 08:29:29 +00:00
}
if (0 === num) {
return str.replace("object ", "");
2026-08-04 21:03:28 +00:00
} else if (tmp6(num)) {
2026-07-29 08:29:29 +00:00
return "[Circular ~]";
} else {
2026-08-04 21:03:28 +00:00
if (num) {
if (typeof num.toJSON === "function") {
2026-07-29 08:29:29 +00:00
try {
2026-08-04 21:03:28 +00:00
return visit("", num.toJSON(), num - 1, num2, tmp8);
2026-07-29 08:29:29 +00:00
} catch (err) {
}
}
}
const _Array = Array;
2026-08-04 21:03:28 +00:00
const tmp14 = Array.isArray(num) ? [] : {};
2026-08-08 06:10:11 +00:00
const convertToPlainObjectResult = require(7460) /* addNonEnumerableProperty */.convertToPlainObject(num);
2026-07-29 08:29:29 +00:00
let num6 = 0;
const keys = Object.keys();
if (keys !== undefined) {
while (keys[tmp] !== undefined) {
let _Object = Object;
let call = hasOwnProperty.call;
let tmp28 = tmp21;
if (!(typeof call === "unknown" ? hasOwnProperty(tmp21) : call(convertToPlainObjectResult, tmp21))) {
continue;
} else {
if (tmp20 >= num2) {
let str4 = "[MaxProperties ~]";
tmp14[tmp21] = "[MaxProperties ~]";
break;
} else {
let tmp22 = visit;
let tmp23 = tmp21;
let tmp24 = num2;
let tmp25 = memoBuilderResult;
tmp14[tmp21] = visit(tmp28, convertToPlainObjectResult[tmp21], num - 1, num2, tmp8);
num6 = tmp20 + 1;
continue;
}
break;
}
break;
}
}
2026-08-04 21:03:28 +00:00
tmp7(num);
2026-07-29 08:29:29 +00:00
return tmp14;
}
}
} else {
return str;
}
}
}
2026-08-04 21:03:28 +00:00
return num;
2026-07-29 08:29:29 +00:00
}
function normalizeToSize(arg0) {
let num = arg1;
if (arg1 === undefined) {
num = 3;
}
let num2 = arg2;
if (arg2 === undefined) {
num2 = 102400;
}
let tmp = normalize(arg0, num);
if (~-str.split(/%..|./).length > num2) {
tmp = normalizeToSize(arg0, num - 1, num2);
}
return tmp;
}
export { normalize };
export { normalizeToSize };
export const normalizeUrlToBase = function normalizeUrlToBase(arg0, str) {
const replaced = str.replace(/\\/g, "/");
try {
const _decodeURI = decodeURI;
str = decodeURI(arg0);
const str2 = str.replace(/\\/g, "/");
const _RegExp = RegExp;
const _HermesInternal = HermesInternal;
const regExp = new RegExp("(file://)?/*" + tmp2 + "/*", "ig");
return str.replace(/\\/g, "/").replace(/webpack:\/?/g, "").replace(regExp, "app:///");
} catch (err) {
}
};