88 lines
4.1 KiB
React
88 lines
4.1 KiB
React
/* Metro module 912; source: unknown; dependencies: [857, 877, 834, 850, 828, 865, 844, 843, 833] */
|
|
function _fun9792(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#9792, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1039:6, offset: 0x00d722ef, size: 78 bytes, params: 8, frame: 17
|
|
const env0_0 = require;
|
|
const Object = global.Object;
|
|
const defineProperty = Object.defineProperty;
|
|
const Symbol = global.Symbol;
|
|
Reflect.apply(defineProperty, Object, [exports, Symbol.toStringTag, {value: 'Module'}]);
|
|
exports.getTraceData = getTraceData;
|
|
}
|
|
|
|
function getTraceData() { // fn#9793, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1039:106, offset: 0x00d7233d, size: 640 bytes, params: 1, frame: 23
|
|
var r9;
|
|
var r5;
|
|
var r6;
|
|
var r8;
|
|
var r3;
|
|
var object2;
|
|
var value;
|
|
var asyncContextStrategy;
|
|
var propagationContext;
|
|
var traceId;
|
|
var sampled;
|
|
var propagationSpanId;
|
|
var moduleValue8;
|
|
var value11;
|
|
var TRACEPARENT_REGEXP;
|
|
var propagationContext2;
|
|
const r2 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
const client = r2.client;
|
|
if (client) {
|
|
r9 = client;
|
|
} else {
|
|
value = require(857) /* metro dependency 857 */;
|
|
value = value.getClient();
|
|
r9 = value;
|
|
}
|
|
const moduleValue = require(877) /* metro dependency 877 */;
|
|
if (moduleValue.isEnabled()) {
|
|
if (r9) {
|
|
asyncContextStrategy = (require(850) /* metro dependency 850 */).getAsyncContextStrategy((require(834) /* metro dependency 834 */).getMainCarrier());
|
|
if (asyncContextStrategy.getTraceData) {
|
|
return asyncContextStrategy.getTraceData(r2);
|
|
}
|
|
r5 = r2.scope || (require(857) /* metro dependency 857 */).getCurrentScope();
|
|
r6 = r2.span || (require(828) /* metro dependency 828 */).getActiveSpan();
|
|
if (r6) {
|
|
r8 = (require(828) /* metro dependency 828 */).spanToTraceHeader(r6);
|
|
} else {
|
|
propagationContext = r5.getPropagationContext();
|
|
r8 = (require(843) /* metro dependency 843 */).generateSentryTraceHeader(propagationContext.traceId,
|
|
propagationContext.propagationSpanId, propagationContext.sampled);
|
|
}
|
|
moduleValue8 = require(865) /* metro dependency 865 */;
|
|
value11 = (require(844) /* metro dependency 844 */).dynamicSamplingContextToSentryBaggageHeader(r6 ? moduleValue8.getDynamicSamplingContextFromSpan(r6) : moduleValue8.getDynamicSamplingContextFromScope(r9,
|
|
|
|
|
|
r5));
|
|
TRACEPARENT_REGEXP = (require(843) /* metro dependency 843 */).TRACEPARENT_REGEXP;
|
|
if (TRACEPARENT_REGEXP.test(r8)) {
|
|
object2 = {};
|
|
object2['sentry-trace'] = r8;
|
|
object2.baggage = value11;
|
|
if (r2.propagateTraceparent) {
|
|
if (r6) {
|
|
value = require(828) /* metro dependency 828 */;
|
|
value = value.spanToTraceparentHeader(r6);
|
|
r3 = value;
|
|
} else {
|
|
propagationContext2 = r5.getPropagationContext();
|
|
traceId = propagationContext2.traceId;
|
|
sampled = propagationContext2.sampled;
|
|
propagationSpanId = propagationContext2.propagationSpanId;
|
|
value = require(843) /* metro dependency 843 */;
|
|
value = value.generateTraceparentHeader(traceId, propagationSpanId, sampled);
|
|
r3 = value;
|
|
}
|
|
object2.traceparent = r3;
|
|
}
|
|
return object2;
|
|
}
|
|
(require(833) /* metro dependency 833 */).debug.warn('Invalid sentry-trace data. Cannot generate trace data');
|
|
return {};
|
|
}
|
|
}
|
|
return {};
|
|
}
|
|
|