103 lines
5.5 KiB
React
103 lines
5.5 KiB
React
/* Metro module 1102; source: unknown; dependencies: [1080, 826, 1041] */
|
|
function _fun12326(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#12326, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1229:6, offset: 0x00dc7be8, size: 130 bytes, params: 8, frame: 20
|
|
let env0_0 = require;
|
|
const closure = function(a0) {
|
|
var r1;
|
|
var Boolean = global.Boolean;
|
|
r1 = a0.type === 'transaction' && a0.spans && a0.contexts?.trace;
|
|
r1 = r1 && a0.contexts.trace.op === 'ui.action.click' && a0.spans.some(_fun12328);
|
|
return Boolean(r1);
|
|
};
|
|
const Object = global.Object;
|
|
const defineProperty = Object.defineProperty;
|
|
const Symbol = global.Symbol;
|
|
Reflect.apply(defineProperty, Object, [exports, Symbol.toStringTag, {value: 'Module'}]);
|
|
let value = require(826) /* metro dependency 826 */;
|
|
value = value.defineIntegration(function() {
|
|
var env0_0 = (arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}).sidecarUrl || 'http://localhost:8969/stream';
|
|
return {name: 'SpotlightBrowser', setup: _fun12330, processEvent: _fun12331, afterAllSetup: _fun12332};
|
|
});
|
|
exports.INTEGRATION_NAME = 'SpotlightBrowser';
|
|
exports.isSpotlightInteraction = closure;
|
|
exports.spotlightBrowserIntegration = value;
|
|
}
|
|
|
|
function isSpotlightInteraction(a0) { // fn#12327, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1229:1079, offset: 0x00dc7c6a, size: 128 bytes, params: 2, frame: 14
|
|
const Boolean = global.Boolean;
|
|
let r1 = a0.type === 'transaction' && a0.spans && a0.contexts?.trace;
|
|
r1 = r1 && a0.contexts.trace.op === 'ui.action.click' && a0.spans.some(function({description}) {
|
|
return description?.includes('#sentry-spotlight');
|
|
});
|
|
return Boolean(r1);
|
|
}
|
|
|
|
function _spotlightIntegration() { // fn#12329, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1229:149, offset: 0x00dc7d0f, size: 94 bytes, params: 1, frame: 5
|
|
if ((arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}).sidecarUrl) {
|
|
}
|
|
return {name: 'SpotlightBrowser', setup: setup_12330, processEvent: function(a0) {
|
|
var value = a0;
|
|
return isSpotlightInteraction(value) ? null : value;
|
|
}, afterAllSetup: function(a0) {
|
|
_fun12333(a0, sidecarUrl);
|
|
}};
|
|
}
|
|
|
|
function _spotlightIntegrationSetup() { // fn#12330, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1229:311, owner: _spotlightIntegration.setup, offset: 0x00dc7d6d, size: 86 bytes, params: 1, frame: 14
|
|
var debug;
|
|
if ((require(1080) /* metro dependency 1080 */).DEBUG_BUILD) {
|
|
debug = (require(826) /* metro dependency 826 */).debug;
|
|
debug.log('Using Sidecar URL', sidecarUrl);
|
|
}
|
|
}
|
|
|
|
function _spotlightIntegrationAfterAllSetup(a0) { // fn#12332, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1229:484, owner: _spotlightIntegration.afterAllSetup, offset: 0x00dc7dde, size: 27 bytes, params: 2, frame: 13
|
|
setupSidecarForwarding(a0, sidecarUrl);
|
|
}
|
|
|
|
function setupSidecarForwarding(a0, a1) { // fn#12333, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1229:511, owner: _spotlightIntegration.afterAllSetup.setupSidecarForwarding, offset: 0x00dc7df9, size: 87 bytes, params: 3, frame: 15
|
|
var environment;
|
|
const env0_0 = a1;
|
|
const value = environment.__proto__.__proto__;
|
|
const env0_1 = (require(1041) /* metro dependency 1041 */).getNativeImplementation('fetch');
|
|
a0.on('beforeEnvelope', _fun12334);
|
|
}
|
|
|
|
function _fun12334(a0) { // fn#12334, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1229:622, offset: 0x00dc7e50, size: 196 bytes, params: 2, frame: 18
|
|
var environment;
|
|
var binding;
|
|
var object2;
|
|
var value2;
|
|
var value;
|
|
if (env0_2 > 3) {
|
|
value2 = environment.__proto__.__proto__.__proto__;
|
|
(require(826) /* metro dependency 826 */).debug.warn('[Spotlight] Disabled Sentry -> Spotlight integration due to too many failed requests:',
|
|
|
|
env0_2);
|
|
} else {
|
|
binding = env0_1;
|
|
object2 = {method: 'POST'};
|
|
value = environment.__proto__.__proto__.__proto__;
|
|
value = require(826) /* metro dependency 826 */;
|
|
object2.body = value.serializeEnvelope(a0);
|
|
object2.headers = {['Content-Type']: 'application/x-sentry-envelope'};
|
|
object2.mode = 'cors';
|
|
value = binding(require, object2);
|
|
value.then(_fun12335, _fun12336);
|
|
}
|
|
}
|
|
|
|
function _fun12335(a0) { // fn#12335, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1229:878, offset: 0x00dc7f14, size: 49 bytes, params: 2, frame: 3
|
|
let value = a0.status >= 200;
|
|
if (value && a0.status < 400) {
|
|
value = environment.__proto__;
|
|
}
|
|
}
|
|
|
|
function _fun12336(a0) { // fn#12336, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1229:928, offset: 0x00dc7f45, size: 67 bytes, params: 2, frame: 14
|
|
const binding = env1_2;
|
|
env1_2 = typeof binding === 'bigint' ? binding + 1n : +binding + 1;
|
|
(require(826) /* metro dependency 826 */).debug.error("Sentry SDK can't connect to Sidecar is it running? See: https://spotlightjs.com/sidecar/npx/",
|
|
a0);
|
|
}
|
|
|