139 lines
8.5 KiB
TypeScript
139 lines
8.5 KiB
TypeScript
/* Metro module 11581; source: modules/activities/useActivityShelfData.tsx; dependencies: [31, 1878, 7505, 1378, 566, 6777, 1360, 8049, 477, 8040, 2] */
|
|
import EmbeddedActivitiesStore from './EmbeddedActivitiesStore.tsx'; /* Metro dependency 1378 */
|
|
import UserStore from '../../stores/UserStore.tsx'; /* Metro dependency 1878 */
|
|
import UseGetOrFetchApplications from '../applications/useGetOrFetchApplications.tsx'; /* Metro dependency 6777 */
|
|
import TestModeStore from '../../stores/game_store/TestModeStore.tsx'; /* Metro dependency 7505 */
|
|
import GetPlatform from './utils/getPlatform.tsx'; /* Metro dependency 8049 */
|
|
import * as FileImportTrackerModule from '../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
|
|
import * as ReactModule from '../../by-id/module-00031-React.js'; /* Metro dependency 31 */
|
|
import * as FluxModule from '../../external/discord_common/js/packages/flux/index.tsx'; /* Metro dependency 566 */
|
|
import * as GlobalUtilsModule from '../../utils/GlobalUtils.tsx'; /* Metro dependency 1360 */
|
|
|
|
function _fun88672(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#88672, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11767:6, offset: 0x01fee1cd, size: 169 bytes, params: 8, frame: 19
|
|
const env0_0 = require;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
(FileImportTrackerModule).fileFinishedImporting('modules/activities/useActivityShelfData.tsx');
|
|
exports.useActivityShelfData = useActivityShelfData;
|
|
function useActivityShelfData(a0) { // fn#88673, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11767:237, offset: 0x01fee276, size: 385 bytes, params: 2, frame: 21
|
|
var r5;
|
|
const env0_0 = a0;
|
|
var value;
|
|
const value2 = undefined;
|
|
const useStateFromStores = FluxModule.useStateFromStores;
|
|
const userStoreBinding = UserStore;
|
|
let items2 = [userStoreBinding];
|
|
const getCurrentUser = userStoreBinding.getCurrentUser;
|
|
const value3 = Reflect.apply(useStateFromStores, FluxModule, [items2, getCurrentUser]);
|
|
const value4 = FluxModule.useStateFromStoresArray([EmbeddedActivitiesStore], _fun88674);
|
|
const testModeEmbeddedApplicationId = FluxModule.useStateFromStores([TestModeStore], function() {
|
|
return TestModeStore.testModeEmbeddedApplicationId;
|
|
});
|
|
const testModeEmbeddedApplicationId2 = testModeEmbeddedApplicationId;
|
|
const value5 = value4.map(function(a0) {
|
|
return a0.application_id;
|
|
});
|
|
if (testModeEmbeddedApplicationId == null) {
|
|
r5 = value5;
|
|
} else {
|
|
items2 = [testModeEmbeddedApplicationId];
|
|
arraySpread(items2, value5, 1, value5);
|
|
r5 = items2;
|
|
}
|
|
const value6 = (UseGetOrFetchApplications)(r5);
|
|
const binding = testModeEmbeddedApplicationId2;
|
|
const value7 = binding.useMemo(_fun88678, [binding.useMemo(_fun88677, [value6]), testModeEmbeddedApplicationId]);
|
|
value = binding.useMemo(_fun88679, [value4, value]);
|
|
return binding.useMemo(_fun88682, [value3 == null ? value2 : value3.nsfwAllowed, value, value7]);
|
|
function _fun88674() { // fn#88674, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11767:364, offset: 0x01fee3f7, size: 27 bytes, params: 1, frame: 11
|
|
return EmbeddedActivitiesStore.getShelfActivities(env0_0);
|
|
}
|
|
|
|
function _fun88677() { // fn#88677, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11767:544, offset: 0x01fee423, size: 50 bytes, params: 1, frame: 13
|
|
const binding = env0_4;
|
|
return binding.filter((GlobalUtilsModule).isNotNullish);
|
|
}
|
|
|
|
function _fun88678() { // fn#88678, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11767:598, offset: 0x01fee455, size: 119 bytes, params: 1, frame: 5
|
|
return testModeEmbeddedApplicationId == null ? [] : env0_5.length > 0 ? env0_5[0].id !== testModeEmbeddedApplicationId ? [] : env0_5[0].embeddedActivityConfig != null ? [{activity: env0_5[0].embeddedActivityConfig,
|
|
application: env0_5[0]}] : [] : [];
|
|
}
|
|
|
|
function _fun88679() { // fn#88679, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11767:752, offset: 0x01fee4cc, size: 69 bytes, params: 1, frame: 13
|
|
const value = env0_2.map(_fun88680);
|
|
return value.filter((GlobalUtilsModule).isNotNullish);
|
|
function _fun88680(a0) { // fn#88680, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11767:763, offset: 0x01fee511, size: 59 bytes, params: 2, frame: 12
|
|
var environment;
|
|
const env0_0 = a0;
|
|
let value = environment.__proto__;
|
|
value = env1_5.find(_fun88681);
|
|
const value2 = null;
|
|
return value2 == value ? value2 : {activity: a0, application: value};
|
|
function _fun88681({id}) { // fn#88681, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11767:781, offset: 0x01e7622b, size: 27 bytes, params: 2, frame: 2
|
|
return id === env0_0.application_id;
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
function _fun88682() { // fn#88682, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11767:915, offset: 0x01fee54c, size: 86 bytes, params: 1, frame: 15
|
|
const binding = env0_6;
|
|
const items2 = [];
|
|
arraySpread(items2, env0_7, arraySpread(items2, binding, 0, undefined), undefined);
|
|
let value = items2.filter(_fun88683);
|
|
value = value.filter(_fun88684);
|
|
return value.filter(_fun88685);
|
|
function _fun88683({activity}) { // fn#88683, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11767:939, offset: 0x01fee5a2, size: 93 bytes, params: 2, frame: 15
|
|
const r2 = activity.supported_platforms ?? [];
|
|
const includes = r2.includes;
|
|
let value = environment.__proto__.__proto__;
|
|
const defaultImport = GetPlatform;
|
|
value = require(477) /* metro dependency 477: PlatformUtils */;
|
|
const getOS = value.getOS;
|
|
return Reflect.apply(includes, r2, [defaultImport(Reflect.apply(getOS, value, []))]);
|
|
}
|
|
|
|
function _fun88684({activity}) { // fn#88684, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11767:1053, offset: 0x01fee5ff, size: 92 bytes, params: 2, frame: 5
|
|
var r0;
|
|
const requires_age_gate = activity.requires_age_gate;
|
|
let value = !requires_age_gate;
|
|
if (requires_age_gate) {
|
|
value = environment.__proto__;
|
|
value = env1_1?.nsfwAllowed === true;
|
|
r0 = value;
|
|
} else {
|
|
r0 = value;
|
|
}
|
|
if (!r0) {
|
|
value = environment.__proto__;
|
|
value = env1_1?.nsfwAllowed == null;
|
|
r0 = value;
|
|
}
|
|
return r0;
|
|
}
|
|
|
|
function _fun88685({application}) { // fn#88685, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11767:1175, offset: 0x01fee65b, size: 85 bytes, params: 2, frame: 14
|
|
var r0;
|
|
let value = environment.__proto__;
|
|
value = env1_1?.nsfwAllowed === false;
|
|
if (value) {
|
|
value = environment.__proto__.__proto__;
|
|
value = importDefault(8040) /* metro dependency 8040: isApplicationAgeRestricted */;
|
|
value = value(application.id);
|
|
r0 = value;
|
|
} else {
|
|
r0 = value;
|
|
}
|
|
return !r0;
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
global.__d(_fun88672, 11581, [31, 1878, 7505, 1378, 566, 6777, 1360, 8049, 477, 8040,
|
|
2]) /* metro module 11581, dependencies: [31, 1878, 7505, 1378, 566, 6777, 1360, 8049, 477, 8040, 2] */;
|