Files
discord-decomp/sources/by-id/module-00831.js
T
2026-07-28 01:06:53 +03:00

278 lines
11 KiB
JavaScript

/* Metro module 831; source: unknown; dependencies: [832, 833, 836, 837] */
import * as Module00836Module from './module-00836.js'; /* Metro dependency 836 */
function _fun9021(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#9021, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:958:6, offset: 0x00d5b3ac, size: 194 bytes, params: 8, frame: 20
const env0_0 = require;
const addNonEnumerableProperty2 = addNonEnumerableProperty;
const markFunctionWrapped2 = markFunctionWrapped;
const convertToPlainObject2 = convertToPlainObject;
const getOwnProperties = function(a0) {
var r4;
var object;
var propertyName;
var propertyName2;
var hasOwnProperty;
if (typeof a0 === 'object') {
if (a0 !== null) {
object = {};
for (propertyName in a0) {
hasOwnProperty = global.Object.prototype.hasOwnProperty;
if (!hasOwnProperty.call(a0, propertyName)) {
r4 = propertyName2;
continue;
}
object[propertyName] = a0[propertyName];
r4 = propertyName2;
}
return object;
}
}
return {};
};
const Object = global.Object;
const defineProperty = Object.defineProperty;
const Symbol = global.Symbol;
Reflect.apply(defineProperty, Object, [exports, Symbol.toStringTag, {value: 'Module'}]);
exports.addNonEnumerableProperty = addNonEnumerableProperty2;
exports.convertToPlainObject = convertToPlainObject2;
exports.dropUndefinedKeys = dropUndefinedKeys;
exports.extractExceptionKeysForMessage = extractExceptionKeysForMessage;
exports.fill = fill_9032;
exports.getOriginalFunction = function(a0) {
return a0.__sentry_original__;
};
exports.markFunctionWrapped = markFunctionWrapped2;
exports.objectify = objectify;
function addNonEnumerableProperty(a0, a1, a2) { // fn#9022, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:958:30, offset: 0x00d5b46e, size: 164 bytes, params: 4, frame: 18
var Object;
var error;
var value;
var DEBUG_BUILD;
var debug;
try {
Object = global.Object;
Object.defineProperty(a0, a1, {'value': null, 'writable': true, 'configurable': true, value: a2});
} catch (error) {
value = environment;
DEBUG_BUILD = (require(832) /* metro dependency 832 */).DEBUG_BUILD;
if (DEBUG_BUILD) {
debug = (require(833) /* metro dependency 833 */).debug;
debug.log('Failed to add non-enumerable property "' + a1 + '" to object', a0);
}
}
}
function markFunctionWrapped(a0, a1) { // fn#9023, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:958:249, offset: 0x00d5b512, size: 68 bytes, params: 3, frame: 15
var r0;
var prototype;
var value;
var error;
try {
prototype = a1.prototype;
r0 = prototype || ({});
a1.prototype = r0;
a0.prototype = r0;
value = environment;
addNonEnumerableProperty(a0, '__sentry_original__', a1);
} catch (error) {
}
}
function convertToPlainObject(a0) { // fn#9024, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:958:398, offset: 0x00d5b556, size: 286 bytes, params: 2, frame: 19
var r2;
var Object;
var assign;
var object;
var serializeEventTargetBinding;
var value2;
var value3;
var value;
if (Module00836Module.isError(a0)) {
return global.Object.assign({message: a0.message, name: a0.name, stack: a0.stack}, getOwnProperties(a0));
}
if (Module00836Module.isEvent(a0)) {
Object = global.Object;
assign = Object.assign;
object = {};
object.type = a0.type;
serializeEventTargetBinding = serializeEventTarget;
object.target = serializeEventTargetBinding(a0.target);
object.currentTarget = serializeEventTargetBinding(a0.currentTarget);
value2 = Reflect.apply(assign, Object, [object, getOwnProperties(a0)]);
value3 = typeof global.CustomEvent !== 'undefined';
if (value3) {
value = Module00836Module;
value = value.isInstanceOf(a0, global.CustomEvent);
r2 = value;
} else {
r2 = value3;
}
if (r2) {
value2.detail = a0.detail;
}
return value2;
}
return a0;
}
function serializeEventTarget(a0) { // fn#9025, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:958:816, offset: 0x00d5b674, size: 121 bytes, params: 2, frame: 14
var r0;
var value;
var property;
var moduleValue;
var isElement2;
var Object;
var prototype;
var toString;
var error;
try {
value = environment;
property = dependencyMap[2];
moduleValue = require(property);
isElement2 = moduleValue.isElement(a0);
if (isElement2) {
property = dependencyMap[3];
value = require(property);
value = value.htmlTreeAsString(a0);
r0 = value;
} else {
Object = global.Object;
prototype = Object.prototype;
toString = prototype.toString;
value = toString.call(a0);
r0 = value;
}
} catch (error) {
return '<unknown>';
}
return r0;
}
function _dropUndefinedKeys(a0, a1) { // fn#9027, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:958:1130, offset: 0x00d5b74b, size: 196 bytes, params: 3, frame: 18
var object;
const env0_0 = a0;
const env0_1 = a1;
if (a0 !== null) {
if (typeof a0 !== 'object') {
return a0;
}
var value = a1.get(a0);
if (value !== undefined) {
return value;
}
var Array = global.Array;
if (Array.isArray(a0)) {
object = [];
a1.set(a0, object);
a0.forEach(_fun9028);
return object;
}
var constructor = a0.constructor;
var Object = global.Object;
value = constructor === Object;
if (value || constructor === undefined) {
object = {};
a1.set(a0, object);
global.Object.keys(a0).forEach(_fun9029);
return object;
}
}
return a0;
function _fun9028(a0) { // fn#9028, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:958:1301, offset: 0x00d5b80f, size: 41 bytes, params: 2, frame: 15
const binding = env0_2;
binding.push(_dropUndefinedKeys(a0, require));
}
function _fun9029(a0) { // fn#9029, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:958:1478, offset: 0x00d5b838, size: 47 bytes, params: 2, frame: 15
var binding;
var value2;
const property = env0_0[a0];
if (property !== undefined) {
binding = env0_3;
value2 = environment.__proto__;
binding[a0] = _dropUndefinedKeys(property, require);
}
}
}
function dropUndefinedKeys(a0) { // fn#9030, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:958:1735, offset: 0x00d5b867, size: 48 bytes, params: 2, frame: 13
const _dropUndefinedKeysBinding = _dropUndefinedKeys;
const Map = global.Map;
return _dropUndefinedKeysBinding(a0, new Map());
}
function extractExceptionKeysForMessage(a0) { // fn#9031, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:958:1836, offset: 0x00d5b897, size: 78 bytes, params: 2, frame: 13
var r0;
const Object = global.Object;
const keys = Object.keys;
var value;
Reflect.apply(keys, Object, [convertToPlainObject(a0)]).sort();
if (value[0]) {
value = value.join(', ');
r0 = value;
} else {
r0 = '[object has no keys]';
}
return r0;
}
function fill_9032(a0, a1, a2) { // fn#9032, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:958:1987, offset: 0x00d5b8e5, size: 203 bytes, params: 4, frame: 17
var property;
var value;
var error;
var DEBUG_BUILD;
var debug;
if (a1 in a0) {
property = a0[a1];
if (typeof property === 'function') {
value = a2(property);
if (typeof value === 'function') {
markFunctionWrapped(value, property);
}
try {
a0[a1] = value;
} catch (error) {
value = environment;
DEBUG_BUILD = (require(832) /* metro dependency 832 */).DEBUG_BUILD;
if (DEBUG_BUILD) {
debug = (require(833) /* metro dependency 833 */).debug;
debug.log('Failed to replace method "' + a1 + '" in object', a0);
}
}
}
}
}
function objectify(a0) { // fn#9034, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:958:2361, offset: 0x00d5b9bb, size: 164 bytes, params: 2, frame: 13
var r0;
var value2;
var moduleValue;
var constructor;
let value = a0;
if (value == null === true) {
r0 = new global.String(value);
} else {
value2 = typeof value;
r0 = value2 === 'symbol' || value2 === 'bigint';
if (r0 === true) {
value = global.Object(value);
r0 = value;
} else {
moduleValue = require(836) /* metro dependency 836 */;
if (moduleValue.isPrimitive(value) !== true) {
r0 = value;
} else {
constructor = value.constructor;
constructor = new constructor(value);
r0 = constructor;
}
}
}
return r0;
}
}
global.__d(_fun9021, 831, [832, 833, 836, 837]) /* metro module 831, dependencies: [832, 833, 836, 837] */;