137 lines
5.8 KiB
JavaScript
137 lines
5.8 KiB
JavaScript
/* Metro module 883; source: unknown; dependencies: [846] */
|
|
function _fun9526(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#9526, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1010:6, offset: 0x00d69d3e, size: 98 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.getEnvelopeEndpointWithUrlEncodedAuth = getEnvelopeEndpointWithUrlEncodedAuth;
|
|
exports.getReportDialogEndpoint = getReportDialogEndpoint;
|
|
function getEnvelopeEndpointWithUrlEncodedAuth(a0, a1, a2) { // fn#9528, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1010:282, offset: 0x00d69e54, size: 205 bytes, params: 4, frame: 19
|
|
var r0;
|
|
var object;
|
|
var URLSearchParams;
|
|
var value2;
|
|
var uRLSearchParams;
|
|
let value = a1;
|
|
if (value) {
|
|
r0 = value;
|
|
} else {
|
|
value = getBaseApiEndpoint(a0);
|
|
value = '' + value + a0.projectId + '/envelope/';
|
|
object = {sentry_version: '7'};
|
|
if (a0.publicKey) {
|
|
object.sentry_key = a0.publicKey;
|
|
}
|
|
if (a2) {
|
|
object.sentry_client = '' + a2.name + '/' + a2.version;
|
|
}
|
|
URLSearchParams = global.URLSearchParams;
|
|
value2 = Object.create(URLSearchParams.prototype, {constructor: {value: URLSearchParams}});
|
|
uRLSearchParams = new URLSearchParams();
|
|
value = '' + value + '?' + (uRLSearchParams instanceof Object ? uRLSearchParams : value2).toString();
|
|
r0 = value;
|
|
}
|
|
return r0;
|
|
}
|
|
|
|
function getReportDialogEndpoint(a0, a1) { // fn#9529, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1010:660, offset: 0x00d69f21, size: 428 bytes, params: 3, frame: 35
|
|
var r5;
|
|
var r15;
|
|
var r22;
|
|
var r2;
|
|
var value3;
|
|
var properties;
|
|
var properties2;
|
|
var properties3;
|
|
var propertyName;
|
|
var propertyName2;
|
|
var encodeURIComponent;
|
|
var value4;
|
|
var user;
|
|
var name;
|
|
var email;
|
|
var value;
|
|
const dsn = (require(846) /* metro dependency 846 */).makeDsn(a0);
|
|
if (dsn) {
|
|
value3 = '' + getBaseApiEndpoint(dsn) + 'embed/error-page/';
|
|
value = require(846) /* metro dependency 846 */;
|
|
value = value.dsnToString(dsn);
|
|
value = 'dsn=' + value;
|
|
properties = Object.keys(a1);
|
|
properties2 = 0;
|
|
properties3 = properties.length;
|
|
if (properties === undefined) {
|
|
r2 = value;
|
|
} else {
|
|
r5 = value;
|
|
r15 = properties2;
|
|
while (true) {
|
|
propertyName = properties[r15];
|
|
propertyName2 = r15 + 1;
|
|
if (propertyName === undefined) {
|
|
r2 = r5;
|
|
break;
|
|
}
|
|
if (propertyName === 'dsn') {
|
|
r15 = propertyName2;
|
|
continue;
|
|
}
|
|
if (propertyName === 'onClose') {
|
|
r15 = propertyName2;
|
|
continue;
|
|
}
|
|
if (propertyName === 'user') {
|
|
user = a1.user;
|
|
if (!user) {
|
|
r15 = propertyName2;
|
|
continue;
|
|
}
|
|
name = user.name;
|
|
if (!name) {
|
|
r22 = r5;
|
|
continue;
|
|
}
|
|
encodeURIComponent = global.encodeURIComponent;
|
|
name = user.name;
|
|
value = encodeURIComponent(name);
|
|
value = r5 + ('&name=' + value);
|
|
r22 = value;
|
|
email = user.email;
|
|
if (!email) {
|
|
r5 = r22;
|
|
r15 = propertyName2;
|
|
continue;
|
|
}
|
|
encodeURIComponent = global.encodeURIComponent;
|
|
email = user.email;
|
|
value = encodeURIComponent(email);
|
|
value = r22 + ('&email=' + value);
|
|
r5 = value;
|
|
r15 = propertyName2;
|
|
} else {
|
|
encodeURIComponent = global.encodeURIComponent;
|
|
value = encodeURIComponent(propertyName);
|
|
encodeURIComponent = global.encodeURIComponent;
|
|
value4 = encodeURIComponent(a1[propertyName]);
|
|
value = r5 + ('&' + value + '=' + value4);
|
|
r5 = value;
|
|
r15 = propertyName2;
|
|
}
|
|
}
|
|
}
|
|
return '' + value3 + '?' + r2;
|
|
}
|
|
return '';
|
|
}
|
|
|
|
}
|
|
|
|
function getBaseApiEndpoint(a0) { // fn#9527, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1010:91, offset: 0x00d69da0, size: 180 bytes, params: 2, frame: 21
|
|
const protocol = a0.protocol;
|
|
const value = '';
|
|
return value + (protocol ? value + a0.protocol + ':' : value) + '//' + a0.host + (a0.port ? ':' + a0.port : value) + (a0.path ? '/' + a0.path : value) + '/api/';
|
|
}
|
|
|
|
global.__d(_fun9526, 883, [846]) /* metro module 883, dependencies: [846] */;
|