759 lines
28 KiB
TypeScript
759 lines
28 KiB
TypeScript
/* Metro module 7634; source: modules/badges/BadgeDirectoryActionCreators.tsx; dependencies: [5, 1878, 661, 694, 507, 4826, 4831, 1216, 2] */
|
|
import Module00005 from '../../by-id/module-00005.js'; /* Metro dependency 5 */
|
|
import UserStore from '../../stores/UserStore.tsx'; /* Metro dependency 1878 */
|
|
import * as FileImportTrackerModule from '../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
|
|
import * as ConstantsModule from '../../Constants.tsx'; /* Metro dependency 661 */
|
|
|
|
function _fun61143(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#61143, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7812:6, offset: 0x0171ba1a, size: 194 bytes, params: 8, frame: 19
|
|
const env0_0 = require;
|
|
const urlUserId = function(a0) {
|
|
var value = a0;
|
|
return value !== UserStore.getCurrentUser()?.id ? value : ME;
|
|
};
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
let value = ConstantsModule;
|
|
const env0_5 = value.Endpoints;
|
|
const env0_6 = value.ME;
|
|
value = _fun61145();
|
|
const value2 = _fun61149();
|
|
(FileImportTrackerModule).fileFinishedImporting('modules/badges/BadgeDirectoryActionCreators.tsx');
|
|
exports.fetchBadgeDirectory = value;
|
|
exports.fetchBadge = value2;
|
|
function _fun61145() { // fn#61145, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7812:239, offset: 0x0171bb09, size: 32 bytes, params: 1, frame: 12
|
|
const env0_0 = Module00005(_fun61147);
|
|
return _fun61148;
|
|
async function _fun61147(a0) { // fn#61147, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7812:259, offset: 0x0171bb3b, size: 778 bytes, params: 2, frame: 29
|
|
var r3;
|
|
var id;
|
|
var r5;
|
|
var r6;
|
|
var r4;
|
|
var object;
|
|
var binding;
|
|
var getCurrentUser;
|
|
var value8;
|
|
var value9;
|
|
var value10;
|
|
var HermesInternal;
|
|
var concat;
|
|
var value11;
|
|
var isRetry;
|
|
var value12;
|
|
var value13;
|
|
var value14;
|
|
var Date;
|
|
var now;
|
|
var value15;
|
|
var value16;
|
|
var dispatch;
|
|
var binding2;
|
|
var property;
|
|
var value17;
|
|
var HTTP;
|
|
var get;
|
|
var USER_BADGES;
|
|
var binding3;
|
|
var value18;
|
|
var value19;
|
|
var value20;
|
|
var value21;
|
|
var value22;
|
|
var body;
|
|
var badges;
|
|
var length;
|
|
var value23;
|
|
var value24;
|
|
var value25;
|
|
var value26;
|
|
var binding4;
|
|
var value27;
|
|
var distribution;
|
|
var object2;
|
|
var binding5;
|
|
var value28;
|
|
var MetricEvents;
|
|
var BADGE_DIRECTORY_CATALOG_FETCH;
|
|
var value29;
|
|
var value30;
|
|
var value31;
|
|
var error;
|
|
var binding6;
|
|
var value32;
|
|
var binding7;
|
|
var captureException;
|
|
let value = a0;
|
|
const value2 = a1;
|
|
if (false) {
|
|
return undefined;
|
|
}
|
|
const value5 = undefined;
|
|
reducibleJoin3: while (true) {
|
|
if (value2 !== value5) {
|
|
r3 = value2;
|
|
break reducibleJoin3;
|
|
}
|
|
r3 = {};
|
|
break reducibleJoin3;
|
|
}
|
|
await value5;
|
|
if (false) {
|
|
return undefined;
|
|
}
|
|
reducibleJoin9: while (true) {
|
|
if (value != null) {
|
|
r5 = value;
|
|
break reducibleJoin9;
|
|
}
|
|
value = environment.__proto__.__proto__;
|
|
binding = env2_4;
|
|
getCurrentUser = binding.getCurrentUser;
|
|
value = Reflect.apply(getCurrentUser, binding, []);
|
|
reducibleJoin8: while (true) {
|
|
if (value == null) {
|
|
id = value5;
|
|
break reducibleJoin8;
|
|
}
|
|
id = value.id;
|
|
break reducibleJoin8;
|
|
}
|
|
r5 = id;
|
|
break reducibleJoin9;
|
|
}
|
|
reduciblePort88: while (true) {
|
|
exceptionLanding87: while (true) {
|
|
if (r5 == null) {
|
|
break reduciblePort88;
|
|
}
|
|
value = environment.__proto__.__proto__;
|
|
binding = env2_4;
|
|
getCurrentUser = binding.getCurrentUser;
|
|
value8 = Reflect.apply(getCurrentUser, binding, []);
|
|
reducibleJoin12: while (true) {
|
|
if (value8 == null) {
|
|
id = value5;
|
|
break reducibleJoin12;
|
|
}
|
|
id = value8.id;
|
|
break reducibleJoin12;
|
|
}
|
|
value9 = 'other';
|
|
reducibleJoin15: while (true) {
|
|
if (id != null) {
|
|
if (r5 !== id) {
|
|
r6 = value9;
|
|
break reducibleJoin15;
|
|
}
|
|
value10 = 'self';
|
|
r6 = value10;
|
|
break reducibleJoin15;
|
|
}
|
|
r6 = value9;
|
|
break reducibleJoin15;
|
|
}
|
|
HermesInternal = global.HermesInternal;
|
|
concat = HermesInternal.concat;
|
|
value11 = 'viewed_user:' + r6;
|
|
isRetry = r3.isRetry;
|
|
value12 = 'initial';
|
|
reducibleJoin17: while (true) {
|
|
if (isRetry !== true) {
|
|
r4 = value12;
|
|
break reducibleJoin17;
|
|
}
|
|
value13 = 'retry';
|
|
r4 = value13;
|
|
break reducibleJoin17;
|
|
}
|
|
value14 = 'attempt:' + r4;
|
|
Date = global.Date;
|
|
now = Date.now;
|
|
value15 = Reflect.apply(now, Date, []);
|
|
binding = env2_1;
|
|
value16 = binding(env2_2[3]);
|
|
dispatch = value16.dispatch;
|
|
Reflect.apply(dispatch, value16, [{type: 'BADGE_DIRECTORY_FETCH_START', userId: r5}]);
|
|
try {
|
|
binding = env2_0;
|
|
} catch (error) {
|
|
break exceptionLanding87;
|
|
}
|
|
try {
|
|
binding2 = env2_2;
|
|
} catch (error) {
|
|
break exceptionLanding87;
|
|
}
|
|
try {
|
|
property = binding2[4];
|
|
} catch (error) {
|
|
break exceptionLanding87;
|
|
}
|
|
try {
|
|
value17 = binding(property);
|
|
} catch (error) {
|
|
break exceptionLanding87;
|
|
}
|
|
try {
|
|
HTTP = value17.HTTP;
|
|
} catch (error) {
|
|
break exceptionLanding87;
|
|
}
|
|
try {
|
|
get = HTTP.get;
|
|
} catch (error) {
|
|
break exceptionLanding87;
|
|
}
|
|
try {
|
|
object = {};
|
|
} catch (error) {
|
|
break exceptionLanding87;
|
|
}
|
|
try {
|
|
binding = env2_5;
|
|
} catch (error) {
|
|
break exceptionLanding87;
|
|
}
|
|
try {
|
|
USER_BADGES = binding.USER_BADGES;
|
|
} catch (error) {
|
|
break exceptionLanding87;
|
|
}
|
|
try {
|
|
binding3 = env2_7;
|
|
} catch (error) {
|
|
break exceptionLanding87;
|
|
}
|
|
try {
|
|
value18 = binding3(r5);
|
|
} catch (error) {
|
|
break exceptionLanding87;
|
|
}
|
|
try {
|
|
value19 = Reflect.apply(USER_BADGES, binding, [value18]);
|
|
} catch (error) {
|
|
break exceptionLanding87;
|
|
}
|
|
try {
|
|
object.url = value19;
|
|
} catch (error) {
|
|
break exceptionLanding87;
|
|
}
|
|
try {
|
|
object.rejectWithError = true;
|
|
} catch (error) {
|
|
break exceptionLanding87;
|
|
}
|
|
try {
|
|
value20 = Reflect.apply(get, HTTP, [object]);
|
|
} catch (error) {
|
|
break exceptionLanding87;
|
|
}
|
|
await value20;
|
|
try {
|
|
value21 = undefined;
|
|
value22 = false;
|
|
} catch (error) {
|
|
break exceptionLanding87;
|
|
}
|
|
if (value22) {
|
|
return value21;
|
|
}
|
|
try {
|
|
body = value21.body;
|
|
} catch (error) {
|
|
break exceptionLanding87;
|
|
}
|
|
try {
|
|
object = [];
|
|
} catch (error) {
|
|
break exceptionLanding87;
|
|
}
|
|
try {
|
|
object[0] = value11;
|
|
} catch (error) {
|
|
break exceptionLanding87;
|
|
}
|
|
try {
|
|
object[1] = 'result:success';
|
|
} catch (error) {
|
|
break exceptionLanding87;
|
|
}
|
|
try {
|
|
badges = body.badges;
|
|
} catch (error) {
|
|
break exceptionLanding87;
|
|
}
|
|
try {
|
|
length = badges.length;
|
|
} catch (error) {
|
|
break exceptionLanding87;
|
|
}
|
|
value23 = 'non_empty';
|
|
try {
|
|
value24 = length !== 0;
|
|
} catch (error) {
|
|
break exceptionLanding87;
|
|
}
|
|
reducibleJoin49: while (true) {
|
|
if (value24) {
|
|
r6 = value23;
|
|
break reducibleJoin49;
|
|
}
|
|
value25 = 'empty';
|
|
r6 = value25;
|
|
break reducibleJoin49;
|
|
}
|
|
try {
|
|
value26 = 'catalog_state:' + r6;
|
|
} catch (error) {
|
|
break exceptionLanding87;
|
|
}
|
|
try {
|
|
object[2] = value26;
|
|
} catch (error) {
|
|
break exceptionLanding87;
|
|
}
|
|
try {
|
|
object[3] = value14;
|
|
} catch (error) {
|
|
break exceptionLanding87;
|
|
}
|
|
try {
|
|
binding = env2_1;
|
|
} catch (error) {
|
|
break exceptionLanding87;
|
|
}
|
|
try {
|
|
binding4 = env2_2;
|
|
} catch (error) {
|
|
break exceptionLanding87;
|
|
}
|
|
try {
|
|
property = binding4[5];
|
|
} catch (error) {
|
|
break exceptionLanding87;
|
|
}
|
|
try {
|
|
value27 = binding(property);
|
|
} catch (error) {
|
|
break exceptionLanding87;
|
|
}
|
|
try {
|
|
distribution = value27.distribution;
|
|
} catch (error) {
|
|
break exceptionLanding87;
|
|
}
|
|
try {
|
|
object2 = {};
|
|
} catch (error) {
|
|
break exceptionLanding87;
|
|
}
|
|
try {
|
|
binding5 = env2_0;
|
|
} catch (error) {
|
|
break exceptionLanding87;
|
|
}
|
|
try {
|
|
property = binding4[6];
|
|
} catch (error) {
|
|
break exceptionLanding87;
|
|
}
|
|
try {
|
|
value28 = binding5(property);
|
|
} catch (error) {
|
|
break exceptionLanding87;
|
|
}
|
|
try {
|
|
MetricEvents = value28.MetricEvents;
|
|
} catch (error) {
|
|
break exceptionLanding87;
|
|
}
|
|
try {
|
|
BADGE_DIRECTORY_CATALOG_FETCH = MetricEvents.BADGE_DIRECTORY_CATALOG_FETCH;
|
|
} catch (error) {
|
|
break exceptionLanding87;
|
|
}
|
|
try {
|
|
object2.name = BADGE_DIRECTORY_CATALOG_FETCH;
|
|
} catch (error) {
|
|
break exceptionLanding87;
|
|
}
|
|
try {
|
|
object2.tags = object;
|
|
} catch (error) {
|
|
break exceptionLanding87;
|
|
}
|
|
try {
|
|
Date = global.Date;
|
|
} catch (error) {
|
|
break exceptionLanding87;
|
|
}
|
|
try {
|
|
now = Date.now;
|
|
} catch (error) {
|
|
break exceptionLanding87;
|
|
}
|
|
try {
|
|
value29 = Reflect.apply(now, Date, []);
|
|
} catch (error) {
|
|
break exceptionLanding87;
|
|
}
|
|
try {
|
|
value30 = value29 - value15;
|
|
} catch (error) {
|
|
break exceptionLanding87;
|
|
}
|
|
try {
|
|
Reflect.apply(distribution, value27, [object2, value30]);
|
|
} catch (error) {
|
|
break exceptionLanding87;
|
|
}
|
|
try {
|
|
property = binding4[3];
|
|
} catch (error) {
|
|
break exceptionLanding87;
|
|
}
|
|
try {
|
|
value31 = binding(property);
|
|
} catch (error) {
|
|
break exceptionLanding87;
|
|
}
|
|
try {
|
|
dispatch = value31.dispatch;
|
|
} catch (error) {
|
|
break exceptionLanding87;
|
|
}
|
|
try {
|
|
object = {};
|
|
} catch (error) {
|
|
break exceptionLanding87;
|
|
}
|
|
try {
|
|
object.type = 'BADGE_DIRECTORY_FETCH_SUCCESS';
|
|
} catch (error) {
|
|
break exceptionLanding87;
|
|
}
|
|
try {
|
|
object.userId = r5;
|
|
} catch (error) {
|
|
break exceptionLanding87;
|
|
}
|
|
try {
|
|
badges = body.badges;
|
|
} catch (error) {
|
|
break exceptionLanding87;
|
|
}
|
|
try {
|
|
object.badges = badges;
|
|
} catch (error) {
|
|
break exceptionLanding87;
|
|
}
|
|
try {
|
|
Reflect.apply(dispatch, value31, [object]);
|
|
} catch (error) {
|
|
break exceptionLanding87;
|
|
}
|
|
break reduciblePort88;
|
|
}
|
|
binding = env2_1;
|
|
binding6 = env2_2;
|
|
value32 = binding(binding6[5]);
|
|
distribution = value32.distribution;
|
|
binding7 = env2_0;
|
|
MetricEvents = binding7(binding6[6]).MetricEvents;
|
|
BADGE_DIRECTORY_CATALOG_FETCH = MetricEvents.BADGE_DIRECTORY_CATALOG_FETCH;
|
|
Date = global.Date;
|
|
now = Date.now;
|
|
Reflect.apply(distribution, value32, [{name: BADGE_DIRECTORY_CATALOG_FETCH, tags: [value11, 'result:failure',
|
|
'catalog_state:unknown', value14]}, Reflect.apply(now, Date, []) - value15]);
|
|
value = binding(binding6[3]);
|
|
dispatch = value.dispatch;
|
|
Reflect.apply(dispatch, value, [{type: 'BADGE_DIRECTORY_FETCH_FAILURE', userId: r5}]);
|
|
value = binding(binding6[7]);
|
|
captureException = value.captureException;
|
|
Reflect.apply(captureException, value, [error]);
|
|
break reduciblePort88;
|
|
}
|
|
return value5;
|
|
}
|
|
|
|
function _fun61148() { // fn#61148, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7812:1191, offset: 0x00c3945f, size: 30 bytes, params: 1, frame: 13
|
|
return env0_0.apply(this, arguments);
|
|
}
|
|
|
|
}
|
|
|
|
function _fun61149() { // fn#61149, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7812:1239, offset: 0x0171be45, size: 32 bytes, params: 1, frame: 12
|
|
const env0_0 = Module00005(_fun61151);
|
|
return _fun61152;
|
|
function* _fun61151(a0, a1) { // fn#61151, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7812:1259, offset: 0x0171be6e, size: 260 bytes, params: 3, frame: 21
|
|
var r3;
|
|
var binding;
|
|
var binding2;
|
|
var property;
|
|
var value5;
|
|
var HTTP;
|
|
var get;
|
|
var object;
|
|
var USER_BADGE;
|
|
var binding3;
|
|
var value6;
|
|
var value7;
|
|
var value8;
|
|
var value9;
|
|
var value10;
|
|
var binding4;
|
|
var value11;
|
|
var dispatch;
|
|
var body;
|
|
var error;
|
|
let value = a1;
|
|
if (false) {
|
|
return undefined;
|
|
}
|
|
const value4 = undefined;
|
|
if (value != null) {
|
|
r3 = value;
|
|
} else {
|
|
value = environment.__proto__.__proto__;
|
|
binding = env2_4;
|
|
value = binding.getCurrentUser();
|
|
r3 = value == null ? value4 : value.id;
|
|
}
|
|
if (r3 != null) {
|
|
value = environment.__proto__.__proto__;
|
|
try {
|
|
binding = env2_0;
|
|
} catch (error) {
|
|
binding = env2_1;
|
|
value = binding(env2_2[7]);
|
|
value.captureException(error);
|
|
return value4;
|
|
}
|
|
try {
|
|
binding2 = env2_2;
|
|
} catch (error) {
|
|
binding = env2_1;
|
|
value = binding(env2_2[7]);
|
|
value.captureException(error);
|
|
return value4;
|
|
}
|
|
try {
|
|
property = binding2[4];
|
|
} catch (error) {
|
|
binding = env2_1;
|
|
value = binding(env2_2[7]);
|
|
value.captureException(error);
|
|
return value4;
|
|
}
|
|
try {
|
|
value5 = binding(property);
|
|
} catch (error) {
|
|
binding = env2_1;
|
|
value = binding(env2_2[7]);
|
|
value.captureException(error);
|
|
return value4;
|
|
}
|
|
try {
|
|
HTTP = value5.HTTP;
|
|
} catch (error) {
|
|
binding = env2_1;
|
|
value = binding(env2_2[7]);
|
|
value.captureException(error);
|
|
return value4;
|
|
}
|
|
try {
|
|
get = HTTP.get;
|
|
} catch (error) {
|
|
binding = env2_1;
|
|
value = binding(env2_2[7]);
|
|
value.captureException(error);
|
|
return value4;
|
|
}
|
|
try {
|
|
object = {};
|
|
} catch (error) {
|
|
binding = env2_1;
|
|
value = binding(env2_2[7]);
|
|
value.captureException(error);
|
|
return value4;
|
|
}
|
|
try {
|
|
binding = env2_5;
|
|
} catch (error) {
|
|
binding = env2_1;
|
|
value = binding(env2_2[7]);
|
|
value.captureException(error);
|
|
return value4;
|
|
}
|
|
try {
|
|
USER_BADGE = binding.USER_BADGE;
|
|
} catch (error) {
|
|
binding = env2_1;
|
|
value = binding(env2_2[7]);
|
|
value.captureException(error);
|
|
return value4;
|
|
}
|
|
try {
|
|
binding3 = env2_7;
|
|
} catch (error) {
|
|
binding = env2_1;
|
|
value = binding(env2_2[7]);
|
|
value.captureException(error);
|
|
return value4;
|
|
}
|
|
try {
|
|
value6 = binding3(r3);
|
|
} catch (error) {
|
|
binding = env2_1;
|
|
value = binding(env2_2[7]);
|
|
value.captureException(error);
|
|
return value4;
|
|
}
|
|
try {
|
|
value7 = Reflect.apply(USER_BADGE, binding, [value6, a0]);
|
|
} catch (error) {
|
|
binding = env2_1;
|
|
value = binding(env2_2[7]);
|
|
value.captureException(error);
|
|
return value4;
|
|
}
|
|
try {
|
|
object.url = value7;
|
|
} catch (error) {
|
|
binding = env2_1;
|
|
value = binding(env2_2[7]);
|
|
value.captureException(error);
|
|
return value4;
|
|
}
|
|
try {
|
|
object.rejectWithError = true;
|
|
} catch (error) {
|
|
binding = env2_1;
|
|
value = binding(env2_2[7]);
|
|
value.captureException(error);
|
|
return value4;
|
|
}
|
|
try {
|
|
value8 = Reflect.apply(get, HTTP, [object]);
|
|
} catch (error) {
|
|
binding = env2_1;
|
|
value = binding(env2_2[7]);
|
|
value.captureException(error);
|
|
return value4;
|
|
}
|
|
yield value8;
|
|
try {
|
|
value9 = undefined;
|
|
value10 = false;
|
|
} catch (error) {
|
|
binding = env2_1;
|
|
value = binding(env2_2[7]);
|
|
value.captureException(error);
|
|
return value4;
|
|
}
|
|
if (value10) {
|
|
return value9;
|
|
}
|
|
try {
|
|
binding = env2_1;
|
|
} catch (error) {
|
|
binding = env2_1;
|
|
value = binding(env2_2[7]);
|
|
value.captureException(error);
|
|
return value4;
|
|
}
|
|
try {
|
|
binding4 = env2_2;
|
|
} catch (error) {
|
|
binding = env2_1;
|
|
value = binding(env2_2[7]);
|
|
value.captureException(error);
|
|
return value4;
|
|
}
|
|
try {
|
|
property = binding4[3];
|
|
} catch (error) {
|
|
binding = env2_1;
|
|
value = binding(env2_2[7]);
|
|
value.captureException(error);
|
|
return value4;
|
|
}
|
|
try {
|
|
value11 = binding(property);
|
|
} catch (error) {
|
|
binding = env2_1;
|
|
value = binding(env2_2[7]);
|
|
value.captureException(error);
|
|
return value4;
|
|
}
|
|
try {
|
|
dispatch = value11.dispatch;
|
|
} catch (error) {
|
|
binding = env2_1;
|
|
value = binding(env2_2[7]);
|
|
value.captureException(error);
|
|
return value4;
|
|
}
|
|
try {
|
|
object = {};
|
|
} catch (error) {
|
|
binding = env2_1;
|
|
value = binding(env2_2[7]);
|
|
value.captureException(error);
|
|
return value4;
|
|
}
|
|
try {
|
|
object.type = 'BADGE_FETCH_SUCCESS';
|
|
} catch (error) {
|
|
binding = env2_1;
|
|
value = binding(env2_2[7]);
|
|
value.captureException(error);
|
|
return value4;
|
|
}
|
|
try {
|
|
object.userId = r3;
|
|
} catch (error) {
|
|
binding = env2_1;
|
|
value = binding(env2_2[7]);
|
|
value.captureException(error);
|
|
return value4;
|
|
}
|
|
try {
|
|
body = value9.body;
|
|
} catch (error) {
|
|
binding = env2_1;
|
|
value = binding(env2_2[7]);
|
|
value.captureException(error);
|
|
return value4;
|
|
}
|
|
try {
|
|
object.badge = body;
|
|
} catch (error) {
|
|
binding = env2_1;
|
|
value = binding(env2_2[7]);
|
|
value.captureException(error);
|
|
return value4;
|
|
}
|
|
try {
|
|
Reflect.apply(dispatch, value11, [object]);
|
|
} catch (error) {
|
|
binding = env2_1;
|
|
value = binding(env2_2[7]);
|
|
value.captureException(error);
|
|
}
|
|
}
|
|
return value4;
|
|
}
|
|
|
|
function _fun61152() { // fn#61152, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7812:1549, offset: 0x00c3945f, size: 30 bytes, params: 1, frame: 13
|
|
return env0_0.apply(this, arguments);
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
global.__d(_fun61143, 7634, [5, 1878, 661, 694, 507, 4826, 4831, 1216,
|
|
2]) /* metro module 7634, dependencies: [5, 1878, 661, 694, 507, 4826, 4831, 1216, 2] */;
|