Files
2026-07-28 01:06:53 +03:00

821 lines
38 KiB
TypeScript

/* Metro module 9480; source: modules/quests/native/QuestUtils.native.tsx; dependencies: [5, 31, 9481, 6528, 661, 33, 4080, 9482, 1962, 9947, 9500, 10184, 10188, 7099, 9484, 6531, 3857, 1244, 8947, 8953, 9479, 7114, 8088, 4008, 7007, 477, 3853, 697, 10189, 8658, 4497, 4500, 1485, 2] */
import Module00005 from '../../../by-id/module-00005.js'; /* Metro dependency 5 */
import Linking from '../../../lib/native/Linking.tsx'; /* Metro dependency 3853 */
import QuestHomeNavigationStore from '../QuestHomeNavigationStore.tsx'; /* Metro dependency 9481 */
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 PlatformUtilsModule from '../../../utils/PlatformUtils.tsx'; /* Metro dependency 477 */
import * as ConstantsModule from '../../../Constants.tsx'; /* Metro dependency 661 */
import * as RootNavigationRefNativeModule from '../../main_tabs_v2/RootNavigationRef.native.tsx'; /* Metro dependency 4008 */
import * as UseAlertStoreNativeModule from '../../../design/components/AlertModal/native/useAlertStore.native.tsx'; /* Metro dependency 4497 */
import * as AlertModalNativeModule from '../../../design/components/AlertModal/native/AlertModal.native.tsx'; /* Metro dependency 4500 */
import * as QuestConstantsModule from '../QuestConstants.tsx'; /* Metro dependency 6528 */
import * as QuestUtilsModule from '../utils/QuestUtils.tsx'; /* Metro dependency 7114 */
import * as QuestsEligibilityModule from '../lib/QuestsEligibility.tsx'; /* Metro dependency 9479 */
import * as QuestRewardUtilsModule from '../utils/QuestRewardUtils.tsx'; /* Metro dependency 9500 */
function _fun73711(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#73711, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9666:6, offset: 0x01d75541, size: 423 bytes, params: 8, frame: 19
const env0_0 = require;
const _arrayLikeToArray_73714 = function(a0, a1) {
var r0;
var r1;
var r2;
var value3;
var length;
var value5;
var value = undefined;
var value2 = value == null;
reducibleJoin2: while (true) {
if (value2) {
r0 = value2;
break reducibleJoin2;
}
value3 = value > a0.length;
r0 = value3;
break reducibleJoin2;
}
reducibleJoin4: while (true) {
if (r0) {
length = a0.length;
r1 = length;
break reducibleJoin4;
}
r1 = value;
break reducibleJoin4;
}
value = (0, global.Array)(r1);
var value4 = 0;
if (value4 < r1) {
r2 = value4;
reducibleLoop5: while (true) {
value[r2] = a0[r2];
value5 = typeof r2 === 'bigint' ? r2 + 1n : +r2 + 1;
if (value5 < r1) {
r2 = value5;
continue reducibleLoop5;
}
break reducibleLoop5;
}
}
return value;
};
const openRewardClaimBottomSheet = function({questId, questContent, questContentPosition, sourceQuestContent}) {
return importDefault(dependencyMap[6]).openLazy(require(dependencyMap[8])(dependencyMap[9],
dependencyMap.paths),
QUEST_REWARD_CODE_CLAIM_BOTTOM_SHEET_KEY, {questId: questId, questContent: questContent,
questContentPosition: questContentPosition, sourceQuestContent: sourceQuestContent});
};
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
ReactModule;
let value = QuestConstantsModule;
const env0_5 = value.QuestsExperimentLocations;
const env0_6 = value.QUEST_REWARD_CODE_CLAIM_BOTTOM_SHEET_KEY;
const env0_7 = value.QUEST_REWARD_DETAILS_BOTTOM_SHEET_KEY;
const env0_8 = value.QuestVariants;
value = require(33) /* metro dependency 33 */;
const env0_10 = value.jsx;
const env0_11 = value.Fragment;
const env0_12 = value.jsxs;
const viewReward2 = viewReward;
const env0_14 = _fun73717();
value = _fun73721();
(FileImportTrackerModule).fileFinishedImporting('modules/quests/native/QuestUtils.native.tsx');
exports.openRewardDetailsBottomSheet = function({questId}) {
return importDefault(dependencyMap[6]).openLazy(require(dependencyMap[8])(dependencyMap[7],
dependencyMap.paths),
QUEST_REWARD_DETAILS_BOTTOM_SHEET_KEY, {questId: questId});
};
exports.viewReward = viewReward2;
exports.handleRewardClaimThenView = value;
exports.openQuestHome = openQuestHome;
exports.isHeroVideoSupported = isHeroVideoSupported;
exports.openDiscordQuestsFAQ = openDiscordQuestsFAQ;
exports.getPrimaryCtaIcon = getPrimaryCtaIcon;
exports.showQuestUnavailableAlert = showQuestUnavailableAlert;
exports.dismissOverlayScreens = dismissOverlayScreens;
function _createForOfIteratorHelperLoose_73712(a0, a1) { // fn#73712, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9666:350, offset: 0x01d756e8, size: 372 bytes, params: 3, frame: 20
var r6;
var r9;
var r5;
var value3;
var regexp;
const env0_0 = a0;
const Symbol = global.Symbol;
let value = typeof Symbol !== 'undefined';
let r1 = value && a0[global.Symbol.iterator];
r1 = !r1 ? a0['@@iterator'] : r1;
if (r1) {
value = r1.call(a0);
return value.next.bind(value);
}
const Array = global.Array;
if (Array.isArray(a0)) {
if (r1) {
}
return _fun73713;
}
value = undefined;
if (a0) {
if (typeof a0 === 'string') {
value = _arrayLikeToArray_73714(a0, value);
r5 = value;
} else {
value3 = ({}).toString.call(a0).slice(8, -1);
r6 = value3 === 'Object' && a0.constructor;
r9 = r6 ? a0.constructor.name : value3;
if (r9 === 'Map') {
r6 = global.Array.from(a0);
} else if (r9 === 'Set') {
r6 = global.Array.from(a0);
} else if (r9 === 'Arguments') {
value = _arrayLikeToArray_73714(a0, value);
r6 = value;
} else {
regexp = RegExp('^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$', '');
if (regexp.test(r9)) {
value = _arrayLikeToArray_73714(a0, value);
r6 = value;
} else {
r6 = value;
}
}
r5 = r6;
}
} else {
r5 = value;
}
if (r5) {
if (r5) {
}
return _fun73713;
}
const TypeError = global.TypeError;
throw new TypeError('Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.');
function _fun73713() { // fn#73713, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9666:921, offset: 0x00c39d73, size: 69 bytes, params: 1, frame: 5
return env0_1 >= env0_0.length ? {done: true} : {done: false,
value: env0_0[typeof env0_1 === 'bigint' ? env0_1 : +env0_1]};
}
}
function viewReward({quest, product, questContent, questContentPosition, onSuccess, sourceQuestContent}) { // fn#73716, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9666:1504, offset: 0x01d758db, size: 241 bytes, params: 2, frame: 22
var moduleValue2;
var value;
if (QuestRewardUtilsModule.hasQuestRewardCode(quest.config)) {
openRewardClaimBottomSheet({questId: quest.id, questContent: questContent,
questContentPosition: questContentPosition, sourceQuestContent: sourceQuestContent});
} else {
moduleValue2 = QuestRewardUtilsModule;
if (moduleValue2.hasVirtualCurrencyReward(quest.config)) {
value = require(10184) /* metro dependency 10184: QuestOrbsRewardModalNative */;
value.openQuestOrbsRewardModal({quest: quest});
} else {
value = require(10188) /* metro dependency 10188: openQuestCollectibleRewardModal */;
value.openQuestCollectibleRewardModal({quest: quest, product: product, onSuccess: onSuccess});
}
}
}
function _fun73717() { // fn#73717, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9666:1909, offset: 0x01d759cc, size: 36 bytes, params: 1, frame: 12
const env0_0 = Module00005(_fun73719);
return _fun73720;
function* _fun73719(a0) { // fn#73719, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9666:1929, offset: 0x01d759fb, size: 328 bytes, params: 2, frame: 23
var binding3;
var property;
var value7;
var claimQuestReward;
var id;
var value8;
var QuestContent;
var value9;
var value10;
var value11;
var error;
var binding4;
var value12;
var open;
var binding5;
var intl;
var string;
var t;
var CKsXk3;
if (false) {
return undefined;
}
value = environment.__proto__.__proto__;
let binding = env2_0;
const binding2 = env2_2;
const value3 = binding(binding2[13]);
const getQuestLogger = value3.getQuestLogger;
let object = {};
let QUEST_HOME_MOBILE = env2_5.QUEST_HOME_MOBILE;
object.location = QUEST_HOME_MOBILE;
const value4 = Reflect.apply(getQuestLogger, value3, [object]);
const defaultPlatform = binding(binding2[10]).getDefaultPlatform(a0.config);
try {
binding = env2_0;
} catch (error) {
value4.error('Error claiming reward', error);
binding = env2_1;
binding4 = env2_2;
value12 = binding(binding4[16]);
open = value12.open;
object = {key: 'CLAIM_QUEST_REWARD_ERROR'};
binding5 = env2_0;
intl = binding5(binding4[17]).intl;
string = intl.string;
t = binding5(binding4[17]).t;
CKsXk3 = t.CKsXk3;
object.content = Reflect.apply(string, intl, [CKsXk3]);
object.icon = binding(binding4[18]);
Reflect.apply(open, value12, [object]);
return false;
}
try {
binding3 = env2_2;
} catch (error) {
value4.error('Error claiming reward', error);
binding = env2_1;
binding4 = env2_2;
value12 = binding(binding4[16]);
open = value12.open;
object = {key: 'CLAIM_QUEST_REWARD_ERROR'};
binding5 = env2_0;
intl = binding5(binding4[17]).intl;
string = intl.string;
t = binding5(binding4[17]).t;
CKsXk3 = t.CKsXk3;
object.content = Reflect.apply(string, intl, [CKsXk3]);
object.icon = binding(binding4[18]);
Reflect.apply(open, value12, [object]);
return false;
}
try {
property = binding3[14];
} catch (error) {
value4.error('Error claiming reward', error);
binding = env2_1;
binding4 = env2_2;
value12 = binding(binding4[16]);
open = value12.open;
object = {key: 'CLAIM_QUEST_REWARD_ERROR'};
binding5 = env2_0;
intl = binding5(binding4[17]).intl;
string = intl.string;
t = binding5(binding4[17]).t;
CKsXk3 = t.CKsXk3;
object.content = Reflect.apply(string, intl, [CKsXk3]);
object.icon = binding(binding4[18]);
Reflect.apply(open, value12, [object]);
return false;
}
try {
value7 = binding(property);
} catch (error) {
value4.error('Error claiming reward', error);
binding = env2_1;
binding4 = env2_2;
value12 = binding(binding4[16]);
open = value12.open;
object = {key: 'CLAIM_QUEST_REWARD_ERROR'};
binding5 = env2_0;
intl = binding5(binding4[17]).intl;
string = intl.string;
t = binding5(binding4[17]).t;
CKsXk3 = t.CKsXk3;
object.content = Reflect.apply(string, intl, [CKsXk3]);
object.icon = binding(binding4[18]);
Reflect.apply(open, value12, [object]);
return false;
}
try {
claimQuestReward = value7.claimQuestReward;
} catch (error) {
value4.error('Error claiming reward', error);
binding = env2_1;
binding4 = env2_2;
value12 = binding(binding4[16]);
open = value12.open;
object = {key: 'CLAIM_QUEST_REWARD_ERROR'};
binding5 = env2_0;
intl = binding5(binding4[17]).intl;
string = intl.string;
t = binding5(binding4[17]).t;
CKsXk3 = t.CKsXk3;
object.content = Reflect.apply(string, intl, [CKsXk3]);
object.icon = binding(binding4[18]);
Reflect.apply(open, value12, [object]);
return false;
}
try {
id = a0.id;
} catch (error) {
value4.error('Error claiming reward', error);
binding = env2_1;
binding4 = env2_2;
value12 = binding(binding4[16]);
open = value12.open;
object = {key: 'CLAIM_QUEST_REWARD_ERROR'};
binding5 = env2_0;
intl = binding5(binding4[17]).intl;
string = intl.string;
t = binding5(binding4[17]).t;
CKsXk3 = t.CKsXk3;
object.content = Reflect.apply(string, intl, [CKsXk3]);
object.icon = binding(binding4[18]);
Reflect.apply(open, value12, [object]);
return false;
}
try {
property = binding3[15];
} catch (error) {
value4.error('Error claiming reward', error);
binding = env2_1;
binding4 = env2_2;
value12 = binding(binding4[16]);
open = value12.open;
object = {key: 'CLAIM_QUEST_REWARD_ERROR'};
binding5 = env2_0;
intl = binding5(binding4[17]).intl;
string = intl.string;
t = binding5(binding4[17]).t;
CKsXk3 = t.CKsXk3;
object.content = Reflect.apply(string, intl, [CKsXk3]);
object.icon = binding(binding4[18]);
Reflect.apply(open, value12, [object]);
return false;
}
try {
value8 = binding(property);
} catch (error) {
value4.error('Error claiming reward', error);
binding = env2_1;
binding4 = env2_2;
value12 = binding(binding4[16]);
open = value12.open;
object = {key: 'CLAIM_QUEST_REWARD_ERROR'};
binding5 = env2_0;
intl = binding5(binding4[17]).intl;
string = intl.string;
t = binding5(binding4[17]).t;
CKsXk3 = t.CKsXk3;
object.content = Reflect.apply(string, intl, [CKsXk3]);
object.icon = binding(binding4[18]);
Reflect.apply(open, value12, [object]);
return false;
}
try {
QuestContent = value8.QuestContent;
} catch (error) {
value4.error('Error claiming reward', error);
binding = env2_1;
binding4 = env2_2;
value12 = binding(binding4[16]);
open = value12.open;
object = {key: 'CLAIM_QUEST_REWARD_ERROR'};
binding5 = env2_0;
intl = binding5(binding4[17]).intl;
string = intl.string;
t = binding5(binding4[17]).t;
CKsXk3 = t.CKsXk3;
object.content = Reflect.apply(string, intl, [CKsXk3]);
object.icon = binding(binding4[18]);
Reflect.apply(open, value12, [object]);
return false;
}
try {
QUEST_HOME_MOBILE = QuestContent.QUEST_HOME_MOBILE;
} catch (error) {
value4.error('Error claiming reward', error);
binding = env2_1;
binding4 = env2_2;
value12 = binding(binding4[16]);
open = value12.open;
object = {key: 'CLAIM_QUEST_REWARD_ERROR'};
binding5 = env2_0;
intl = binding5(binding4[17]).intl;
string = intl.string;
t = binding5(binding4[17]).t;
CKsXk3 = t.CKsXk3;
object.content = Reflect.apply(string, intl, [CKsXk3]);
object.icon = binding(binding4[18]);
Reflect.apply(open, value12, [object]);
return false;
}
try {
value9 = Reflect.apply(claimQuestReward, value7, [id, defaultPlatform, QUEST_HOME_MOBILE]);
} catch (error) {
value4.error('Error claiming reward', error);
binding = env2_1;
binding4 = env2_2;
value12 = binding(binding4[16]);
open = value12.open;
object = {key: 'CLAIM_QUEST_REWARD_ERROR'};
binding5 = env2_0;
intl = binding5(binding4[17]).intl;
string = intl.string;
t = binding5(binding4[17]).t;
CKsXk3 = t.CKsXk3;
object.content = Reflect.apply(string, intl, [CKsXk3]);
object.icon = binding(binding4[18]);
Reflect.apply(open, value12, [object]);
return false;
}
yield value9;
try {
value10 = undefined;
value11 = false;
} catch (error) {
value4.error('Error claiming reward', error);
binding = env2_1;
binding4 = env2_2;
value12 = binding(binding4[16]);
open = value12.open;
object = {key: 'CLAIM_QUEST_REWARD_ERROR'};
binding5 = env2_0;
intl = binding5(binding4[17]).intl;
string = intl.string;
t = binding5(binding4[17]).t;
CKsXk3 = t.CKsXk3;
object.content = Reflect.apply(string, intl, [CKsXk3]);
object.icon = binding(binding4[18]);
Reflect.apply(open, value12, [object]);
return false;
}
if (value11) {
return value10;
}
return true;
}
function _fun73720() { // fn#73720, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9666:2319, offset: 0x00c3945f, size: 30 bytes, params: 1, frame: 13
return env0_0.apply(this, arguments);
}
}
function _fun73721() { // fn#73721, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9666:2367, offset: 0x01d75b43, size: 36 bytes, params: 1, frame: 12
const env0_0 = Module00005(_fun73723);
return _fun73724;
async function _fun73723({quest, questContent, questContentPosition, product, hideActionSheet, currentUserHasVerifiedEmailOrPhone, currentUserHasVerifiedEmail, onSuccess, sourceQuestContent}) { // fn#73723, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9666:2387, offset: 0x01d75b7b, size: 493 bytes, params: 2, frame: 27
var binding;
var hasVirtualCurrencyReward;
var config;
var open;
var binding2;
var value4;
var object;
var binding3;
var intl;
var value5;
var hasQuestRewardCode;
var value6;
if (false) {
return undefined;
}
await undefined;
if (false) {
return undefined;
}
if (hideActionSheet === true) {
value = environment.__proto__.__proto__;
value = env2_1(env2_2[6]);
value.hideActionSheet();
}
if (currentUserHasVerifiedEmailOrPhone) {
if (currentUserHasVerifiedEmail) {
value = environment.__proto__.__proto__;
value5 = env2_0(env2_2[10]);
if (value5.hasQuestRewardCode(quest.config)) {
env2_17({questId: quest.id, questContent: questContent, questContentPosition: questContentPosition,
sourceQuestContent: sourceQuestContent});
return true;
}
await env2_14(quest);
value6 = undefined;
if (false) {
return value6;
}
if (value6) {
env2_13({quest: quest, product: product, questContent: questContent,
questContentPosition: questContentPosition,
onSuccess: onSuccess, sourceQuestContent: sourceQuestContent});
}
return value6;
}
value = environment.__proto__.__proto__;
binding = env2_0;
value = binding(env2_2[10]);
hasVirtualCurrencyReward = value.hasVirtualCurrencyReward;
config = quest.config;
if (Reflect.apply(hasVirtualCurrencyReward, value, [config])) {
if (!currentUserHasVerifiedEmail) {
value = environment.__proto__.__proto__;
value = env2_1(env2_2[19]);
value.open();
}
value = environment.__proto__.__proto__;
binding = env2_1;
binding2 = env2_2;
value4 = binding(binding2[16]);
open = value4.open;
object = {key: 'CLAIM_QUEST_REWARD_ERROR'};
binding3 = env2_0;
intl = binding3(binding2[17]).intl;
object.content = intl.string(binding3(binding2[17]).t['HZlu0+']);
object.icon = binding(binding2[18]);
Reflect.apply(open, value4, [object]);
return false;
}
value = environment.__proto__.__proto__;
binding = env2_0;
value5 = binding(env2_2[10]);
hasQuestRewardCode = value5.hasQuestRewardCode;
config = quest.config;
if (Reflect.apply(hasQuestRewardCode, value5, [config])) {
env2_17({questId: quest.id, questContent: questContent, questContentPosition: questContentPosition,
sourceQuestContent: sourceQuestContent});
return true;
}
await env2_14(quest);
value6 = undefined;
if (false) {
return value6;
}
if (value6) {
env2_13({quest: quest, product: product, questContent: questContent,
questContentPosition: questContentPosition,
onSuccess: onSuccess, sourceQuestContent: sourceQuestContent});
}
return value6;
}
if (!currentUserHasVerifiedEmail) {
value = environment.__proto__.__proto__;
value = env2_1(env2_2[19]);
value.open();
}
value = environment.__proto__.__proto__;
binding = env2_1;
binding2 = env2_2;
value4 = binding(binding2[16]);
open = value4.open;
object = {key: 'CLAIM_QUEST_REWARD_ERROR'};
binding3 = env2_0;
intl = binding3(binding2[17]).intl;
object.content = intl.string(binding3(binding2[17]).t['HZlu0+']);
object.icon = binding(binding2[18]);
Reflect.apply(open, value4, [object]);
return false;
}
function _fun73724() { // fn#73724, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9666:3104, offset: 0x00c3945f, size: 30 bytes, params: 1, frame: 13
return env0_0.apply(this, arguments);
}
}
function openQuestHome({scrollToQuestId, mergeExistingRoutes, sort, filter, fromContent}) { // fn#73726, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9666:3448, offset: 0x01d75dc6, size: 213 bytes, params: 2, frame: 19
if (mergeExistingRoutes !== undefined) {
}
if (sort !== undefined) {
}
if (filter !== undefined) {
}
const getIsEligibleForQuests = QuestsEligibilityModule.getIsEligibleForQuests;
if (Reflect.apply(getIsEligibleForQuests, QuestsEligibilityModule, [])) {
(require(7114) /* metro dependency 7114: QuestUtils */).setQuestHomeUtmContext({questId: scrollToQuestId ?? undefined,
fromContent: fromContent});
(importDefault(8088) /* metro dependency 8088: closeVoicePanels */)();
global.setTimeout(_fun73727, 1);
}
function _fun73727() { // fn#73727, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9666:3672, offset: 0x01d75e9b, size: 242 bytes, params: 1, frame: 19
var environment;
var r5;
var object;
let value = environment.__proto__;
const rootNavigationRef = (RootNavigationRefNativeModule).getRootNavigationRef();
const value3 = null;
if (value3 != rootNavigationRef) {
if (rootNavigationRef.isReady()) {
r5 = mergeExistingRoutes ? ((a0) => {
var closure;
var value = a0.getRootState();
if (value != null) {
if (value.routes) {
var env0_0 = _fun73729;
closure = _fun73730;
var env0_1 = closure;
return closure(value.routes);
}
}
return null;
})(rootNavigationRef) : value3;
QuestHomeNavigationStore.setState({sort: sort, filter: filter,
scrollToQuestId: value3 != scrollToQuestId ? scrollToQuestId : ''});
object = {};
object.screen = UserSettingsSections.QUESTS;
if (mergeExistingRoutes) {
if (value3 != r5) {
rootNavigationRef.navigate({name: 'settings', key: r5.key, params: object});
} else {
(require(7007) /* metro dependency 7007: openUserSettings */).openUserSettings(object);
}
} else {
(require(7007) /* metro dependency 7007: openUserSettings */).openUserSettings(object);
}
}
}
function _fun73728(a0) { // fn#73728, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9666:3750, offset: 0x01d75f8d, size: 69 bytes, params: 2, frame: 12
const rootState = a0.getRootState();
if (rootState != null) {
if (rootState.routes) {
return searchRoutes_73730(rootState.routes);
}
}
return null;
function isQuestsRoute(a0) { // fn#73729, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9666:3829, offset: 0x01d75fd2, size: 61 bytes, params: 2, frame: 4
var screen;
var r0;
var params;
let value = a0.name === 'settings';
if (value) {
params = a0.params;
value = undefined;
screen = params == null ? value : params.screen;
value = environment.__proto__.__proto__.__proto__;
value = screen === UserSettingsSections.QUESTS;
r0 = value;
} else {
r0 = value;
}
return r0;
}
function searchRoutes_73730(a0) { // fn#73730, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9666:3928, offset: 0x01d7600f, size: 132 bytes, params: 2, frame: 19
var r5;
var value4;
var state;
var routes;
var searchRoutes_73730Binding;
var value5;
var value6;
let value = environment.__proto__.__proto__.__proto__;
value = _createForOfIteratorHelperLoose_73712(a0);
const value2 = value();
let done = value2.done;
if (!done) {
r5 = value2;
reducibleLoop1: while (true) {
value4 = r5.value;
if (isQuestsRoute(value4)) {
return value4;
}
state = value4.state;
if (state != null) {
routes = state.routes;
reducibleJoin5: while (true) {
if (routes) {
searchRoutes_73730Binding = searchRoutes_73730;
state = value4.state;
routes = state.routes;
value5 = searchRoutes_73730Binding(routes);
if (value5) {
return value5;
}
break reducibleJoin5;
}
break reducibleJoin5;
}
}
value6 = value();
done = value6.done;
if (done) {
return null;
}
r5 = value6;
continue reducibleLoop1;
}
}
return null;
}
}
}
}
function isHeroVideoSupported(a0) { // fn#73731, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9666:4380, offset: 0x01d76093, size: 86 bytes, params: 2, frame: 12
let value = PlatformUtilsModule;
value = value.isIOS();
const value2 = a0.mimetype === 'video/mp4';
return value || value2 ? value2 : a0.mimetype === 'video/webm';
}
function openDiscordQuestsFAQ() { // fn#73732, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9666:4502, offset: 0x01d760e9, size: 44 bytes, params: 1, frame: 12
(Linking).openURL('https://support.discord.com/hc/en-us/articles/22225719947543-Discord-Quests-FAQ#h_01HVPBZR5FBM7QBFR9KDBASXP5');
}
function getPrimaryCtaIcon(a0) { // fn#73733, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9666:4658, offset: 0x01d76115, size: 320 bytes, params: 2, frame: 19
var features;
var object;
const value = a1;
const r2 = value !== undefined ? value : false;
if (QuestUtilsModule.canLaunchActivity(a0)) {
features = a0.config.features;
if (features.includes(QuestVariants.MOBILE_ACTIVITY_QUEST)) {
object = {};
object.marginRight = r2 ? (importDefault(697) /* metro dependency 697: native */).space.PX_4 : 0;
features = a0.config.features;
if (features.includes(QuestVariants.CLOUD_GAMING_ACTIVITY)) {
const CloudIcon = (require(10189) /* metro dependency 10189: CloudIcon */).CloudIcon;
return (
<CloudIcon
size="sm"
style={object}
color={(importDefault(697) /* metro dependency 697: native */).colors.WHITE}
/>
);
} else {
const GameControllerIcon = (require(8658) /* metro dependency 8658: GameControllerIcon */).GameControllerIcon;
return (
<GameControllerIcon
size="sm"
style={object}
color={(importDefault(697) /* metro dependency 697: native */).colors.WHITE}
/>
);
}
}
}
}
function showQuestUnavailableAlert() { // fn#73734, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9666:5066, offset: 0x01d76255, size: 391 bytes, params: 1, frame: 27
const openAlert = UseAlertStoreNativeModule.openAlert;
const AlertModal = (AlertModalNativeModule).AlertModal;
const object = {};
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
let string = intl.string;
const Lhpq2P = (require(1244) /* metro dependency 1244: indexNative */).t.Lhpq2P;
object.title = Reflect.apply(string, intl, [Lhpq2P]);
object.content = intl.string((require(1244) /* metro dependency 1244: indexNative */).t.iyF4WB);
const jsxRuntimeEnv0_11Binding = jsxRuntimeEnv0_11;
const AlertActionButton = (AlertModalNativeModule).AlertActionButton;
string = intl.string;
const H0vjGc = (require(1244) /* metro dependency 1244: indexNative */).t.H0vjGc;
object.actions = (
<>
<AlertActionButton
text={Reflect.apply(string, intl, [H0vjGc])}
onPress={(require(9484) /* metro dependency 9484: QuestActionCreators */).fetchCurrentQuests}
/>
<AlertActionButton
text={intl.string((require(1244) /* metro dependency 1244: indexNative */).t['6XS10x'])}
variant="secondary"
/>
</>
);
Reflect.apply(openAlert, UseAlertStoreNativeModule, ['quest-unavailable', <AlertModal {...object} />]);
}
function dismissOverlayScreens() { // fn#73735, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9666:5540, offset: 0x01d763dc, size: 206 bytes, params: 1, frame: 17
var rootState;
var routes;
var value4;
var length;
var dispatch;
var CommonActions;
var reset;
var object;
const rootNavigationRef = (RootNavigationRefNativeModule).getRootNavigationRef();
if (rootNavigationRef != null) {
if (rootNavigationRef.isReady()) {
rootState = rootNavigationRef.getRootState();
routes = rootState.routes;
value4 = routes.filter(function(a0) {
return a0.name !== 'you' && a0.name !== 'settings';
});
length = value4.length;
routes = rootState.routes;
if (length < routes.length) {
dispatch = rootNavigationRef.dispatch;
CommonActions = (require(1485) /* metro dependency 1485 */).CommonActions;
reset = CommonActions.reset;
object = {};
copyDataProperties(object, rootState, rootState);
object['routes'] = value4;
object['index'] = value4.length - 1;
Reflect.apply(dispatch, rootNavigationRef, [Reflect.apply(reset, CommonActions, [object])]);
}
}
}
}
}
global.__d(_fun73711, 9480, [5, 31, 9481, 6528, 661, 33, 4080, 9482, 1962, 9947, 9500, 10184, 10188, 7099, 9484,
6531, 3857, 1244, 8947, 8953, 9479, 7114, 8088, 4008, 7007, 477, 3853, 697, 10189, 8658, 4497, 4500, 1485,
2]) /* metro module 9480, dependencies: [5, 31, 9481, 6528, 661, 33, 4080, 9482, 1962, 9947, 9500, 10184, 10188, 7099, 9484, 6531, 3857, 1244, 8947, 8953, 9479, 7114, 8088, 4008, 7007, 477, 3853, 697, 10189, 8658, 4497, 4500, 1485, 2] */;