Files
discord-decomp/sources/by-id/module-01164.jsx
T
2026-07-27 16:20:00 +03:00

137 lines
7.1 KiB
React

/* Metro module 1164; source: unknown; dependencies: [65, 77, 826, 825] */
function _fun12938(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#12938, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1291:6, offset: 0x00ddb6b5, size: 259 bytes, params: 8, frame: 21
const env0_0 = require;
const closure = setSpanMeasurement;
const closure2 = createSpanJSON;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_2 = importDefault(65) /* metro dependency 65 */;
const env0_3 = importDefault(77) /* metro dependency 77 */;
const Date = global.Date;
const env0_4 = Date.now();
exports.defaultTransactionSource = 'component';
exports.customTransactionSource = 'custom';
exports.MARGIN_OF_ERROR_SECONDS = 0.05;
exports.getTimeOriginMilliseconds = getTimeOriginMilliseconds;
exports.isNearToNow = isNearToNow;
exports.setSpanDurationAsMeasurement = setSpanDurationAsMeasurement;
exports.setSpanDurationAsMeasurementOnSpan = function(a0, a1, a2) {
var {timestamp, start_timestamp} = require(dependencyMap[2]).spanToJSON(a1);
if (timestamp && start_timestamp) {
setSpanMeasurement(a2, a0, 1000 * (timestamp - start_timestamp), 'millisecond');
}
};
exports.setSpanMeasurement = closure;
exports.getLatestChildSpanEndTimestamp = getLatestChildSpanEndTimestamp;
exports.getBundleStartTimestampMs = getBundleStartTimestampMs;
exports.createSpanJSON = closure2;
exports.createChildSpanJSON = createChildSpanJSON;
}
function setSpanMeasurement(a0, a1, a2, a3) { // fn#12939, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1291:129, offset: 0x00ddb7b8, size: 92 bytes, params: 5, frame: 20
const addEvent = a0.addEvent;
const binding = env0_3;
const SEMANTIC_ATTRIBUTE_SENTRY_MEASUREMENT_VALUE = (require(826) /* metro dependency 826 */).SEMANTIC_ATTRIBUTE_SENTRY_MEASUREMENT_VALUE;
let value = binding({}, SEMANTIC_ATTRIBUTE_SENTRY_MEASUREMENT_VALUE, a2);
const SEMANTIC_ATTRIBUTE_SENTRY_MEASUREMENT_UNIT = (require(826) /* metro dependency 826 */).SEMANTIC_ATTRIBUTE_SENTRY_MEASUREMENT_UNIT;
value = binding(value, SEMANTIC_ATTRIBUTE_SENTRY_MEASUREMENT_UNIT, a3);
Reflect.apply(addEvent, a0, [a1, value]);
}
function createSpanJSON(a0) { // fn#12940, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1291:296, offset: 0x00ddb814, size: 328 bytes, params: 2, frame: 29
var object2;
const moduleValue = require(826) /* metro dependency 826 */;
const dropUndefinedKeys = moduleValue.dropUndefinedKeys;
const Object = global.Object;
const assign = Object.assign;
const Object2 = global.Object;
const value2 = Object2.assign({status: 'ok'}, a0);
object2 = {};
object2.span_id = a0.span_id || moduleValue.uuid4().substring(16);
object2.trace_id = a0.trace_id || moduleValue.uuid4();
const moduleValue4 = moduleValue;
const dropUndefinedKeys2 = moduleValue4.dropUndefinedKeys;
const Object3 = global.Object;
const assign3 = Object3.assign;
const binding = env0_3;
const SEMANTIC_ATTRIBUTE_SENTRY_OP = moduleValue.SEMANTIC_ATTRIBUTE_SENTRY_OP;
let value = binding({}, SEMANTIC_ATTRIBUTE_SENTRY_OP, a0.op);
const SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN = moduleValue.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN;
value = binding(value, SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, a0.origin);
object2.data = Reflect.apply(dropUndefinedKeys2, moduleValue4, [Reflect.apply(assign3, Object3, [value,
a0.data || ({})])]);
return Reflect.apply(dropUndefinedKeys, moduleValue, [Reflect.apply(assign, Object, [value2, object2])]);
}
function isNearToNow(a0) { // fn#12942, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1291:868, offset: 0x00ddb95c, size: 86 bytes, params: 2, frame: 15
var r0;
var Math;
var abs;
let value = !!a0;
if (a0) {
Math = global.Math;
abs = Math.abs;
value = require(826) /* metro dependency 826 */;
value = Reflect.apply(abs, Math, [value.timestampInSeconds() - a0]);
value = value <= 0.05;
r0 = value;
} else {
r0 = value;
}
return r0;
}
function setSpanDurationAsMeasurement(a0, a1) { // fn#12943, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1291:981, offset: 0x00ddb9b2, size: 116 bytes, params: 3, frame: 17
const {timestamp, start_timestamp} = (require(826) /* metro dependency 826 */).spanToJSON(a1);
if (timestamp && start_timestamp) {
(require(826) /* metro dependency 826 */).setMeasurement(a0, 1000 * (timestamp - start_timestamp),
'millisecond');
}
}
function getLatestChildSpanEndTimestamp(a0) { // fn#12945, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1291:1421, offset: 0x00ddba89, size: 122 bytes, params: 2, frame: 16
var r0;
var Math;
var max;
var apply;
const value2 = undefined;
const value5 = (require(826) /* metro dependency 826 */).getSpanDescendants(a0).map(_fun12946).filter(function(a0) {
return !!a0;
});
if (value5.length) {
Math = global.Math;
max = Math.max;
apply = max.apply;
Math = global.Math;
r0 = Reflect.apply(apply, max, [Math, env0_2(value5)]);
} else {
r0 = value2;
}
return r0;
}
function getBundleStartTimestampMs() { // fn#12948, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1291:1670, offset: 0x00ddbb32, size: 171 bytes, params: 1, frame: 17
const RN_GLOBAL_OBJ = (require(825) /* metro dependency 825 */).RN_GLOBAL_OBJ;
const __BUNDLE_START_TIME__ = RN_GLOBAL_OBJ.__BUNDLE_START_TIME__;
if (__BUNDLE_START_TIME__) {
return RN_GLOBAL_OBJ.nativePerformanceNow ? global.Date.now() - RN_GLOBAL_OBJ.nativePerformanceNow() + __BUNDLE_START_TIME__ : __BUNDLE_START_TIME__;
}
(require(826) /* metro dependency 826 */).debug.warn('Missing the bundle start time on the global object.');
}
function createChildSpanJSON({op, trace_id, span_id, origin}, a1) { // fn#12949, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1291:2001, offset: 0x00ddbbdd, size: 92 bytes, params: 3, frame: 15
const createSpanJSONBinding = createSpanJSON;
const Object = global.Object;
const assign = Object.assign;
origin = !origin ? 'manual' : origin;
return createSpanJSONBinding(Reflect.apply(assign, Object, [{op: op, trace_id: trace_id, parent_span_id: span_id,
origin: origin}, a1]));
}
function _fun12946(a0) { // fn#12946, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1291:1505, offset: 0x00ddbb03, size: 47 bytes, params: 2, frame: 11
let value = environment.__proto__;
value = require(826) /* metro dependency 826 */;
return value.spanToJSON(a0).timestamp;
}