3072 lines
162 KiB
TypeScript
3072 lines
162 KiB
TypeScript
/* Metro module 9483; source: modules/quests/hooks/QuestHooks.tsx; dependencies: [5, 57, 31, 1949, 1379, 5040, 1878, 7092, 7094, 7093, 6528, 661, 1880, 566, 9479, 9484, 477, 9493, 7108, 6531, 7091, 672, 7114, 7116, 7119, 9500, 22, 9511, 9503, 9513, 1948, 9520, 6535, 9522, 7120, 6777, 9524, 9505, 8461, 7121, 9525, 1244, 1856, 4242, 7110, 4048, 4002, 9495, 3802, 9526, 683, 1360, 9528, 9529, 9532, 3829, 9534, 9535, 2] */
|
|
import Module00005 from '../../../by-id/module-00005.js'; /* Metro dependency 5 */
|
|
import Module00057 from '../../../by-id/module-00057.js'; /* Metro dependency 57 */
|
|
import Durations from '../../../utils/Durations.tsx'; /* Metro dependency 672 */
|
|
import AnalyticsUtils from '../../../utils/AnalyticsUtils.tsx'; /* Metro dependency 683 */
|
|
import ChannelStore from '../../../stores/ChannelStore.tsx'; /* Metro dependency 1379 */
|
|
import UserStore from '../../../stores/UserStore.tsx'; /* Metro dependency 1878 */
|
|
import HelpdeskUtils from '../../../utils/HelpdeskUtils.tsx'; /* Metro dependency 1948 */
|
|
import LocaleStore from '../../user_settings/LocaleStore.tsx'; /* Metro dependency 1949 */
|
|
import UseTheme from '../../../hooks/useTheme.tsx'; /* Metro dependency 4048 */
|
|
import ConnectedAccountsStore from '../../../stores/ConnectedAccountsStore.tsx'; /* Metro dependency 5040 */
|
|
import UseGetOrFetchApplications from '../../applications/useGetOrFetchApplications.tsx'; /* Metro dependency 6777 */
|
|
import BountyStore from '../BountyStore.tsx'; /* Metro dependency 7092 */
|
|
import QuestStore from '../QuestStore.tsx'; /* Metro dependency 7093 */
|
|
import * as FileImportTrackerModule from '../../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
|
|
import * as Module00022Module from '../../../by-id/module-00022.js'; /* Metro dependency 22 */
|
|
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 IndexNativeModule from '../../../intl/index.native.tsx'; /* Metro dependency 1244 */
|
|
import * as PremiumConstantsModule from '../../premium/PremiumConstants.tsx'; /* Metro dependency 1880 */
|
|
import * as PremiumUtilsModule from '../../../utils/PremiumUtils.tsx'; /* Metro dependency 3802 */
|
|
import * as UserSettingsModule from '../../user_settings/UserSettings.tsx'; /* Metro dependency 3829 */
|
|
import * as Module04242Module from '../../../by-id/module-04242.js'; /* Metro dependency 4242 */
|
|
import * as QuestConstantsModule from '../QuestConstants.tsx'; /* Metro dependency 6528 */
|
|
import * as QuestTypesModule from '../QuestTypes.tsx'; /* Metro dependency 6531 */
|
|
import * as FirstPartyQuestTaskTypesModule from '../../../external/discord_common/js/shared/shared-constants/FirstPartyQuestTaskTypes.tsx'; /* Metro dependency 6535 */
|
|
import * as QuestDataUtilsModule from '../utils/QuestDataUtils.tsx'; /* Metro dependency 7091 */
|
|
import * as ConsoleQuestUIStoreModule from '../ConsoleQuestUIStore.tsx'; /* Metro dependency 7094 */
|
|
import * as AnalyticsActionsModule from '../lib/analytics/AnalyticsActions.tsx'; /* Metro dependency 7110 */
|
|
import * as QuestUtilsModule from '../utils/QuestUtils.tsx'; /* Metro dependency 7114 */
|
|
import * as QuestTaskUtilsModule from '../utils/QuestTaskUtils.tsx'; /* Metro dependency 7116 */
|
|
import * as QuestTypeModule from '../../../external/discord_common/js/shared/shared-constants/QuestType.tsx'; /* Metro dependency 7119 */
|
|
import * as AnalyticsTypesModule from '../lib/analytics/AnalyticsTypes.tsx'; /* Metro dependency 7120 */
|
|
import * as AdCreativeTypeModule from '../../../external/discord_common/js/shared/shared-constants/AdCreativeType.tsx'; /* Metro dependency 7121 */
|
|
import * as UseFetchCollectiblesProductModule from '../../collectibles/hooks/useFetchCollectiblesProduct.tsx'; /* Metro dependency 8461 */
|
|
import * as QuestsEligibilityModule from '../lib/QuestsEligibility.tsx'; /* Metro dependency 9479 */
|
|
import * as QuestActionCreatorsModule from '../QuestActionCreators.tsx'; /* Metro dependency 9484 */
|
|
import * as AssetUtilsModule from '../lib/AssetUtils.tsx'; /* Metro dependency 9495 */
|
|
import * as QuestRewardUtilsModule from '../utils/QuestRewardUtils.tsx'; /* Metro dependency 9500 */
|
|
import * as QuestOrbMultiplierUtilsModule from '../utils/QuestOrbMultiplierUtils.tsx'; /* Metro dependency 9503 */
|
|
import * as QuestCopyUtilsModule from '../utils/QuestCopyUtils.tsx'; /* Metro dependency 9505 */
|
|
import * as ExperimentsModule from '../experiments/index.tsx'; /* Metro dependency 9511 */
|
|
import * as ContentImpressionTrackerHooksModule from '../lib/analytics/ContentImpressionTrackerHooks.tsx'; /* Metro dependency 9513 */
|
|
import * as QuestPlatformUtilsModule from '../utils/QuestPlatformUtils.tsx'; /* Metro dependency 9520 */
|
|
import * as VideoQuestUtilsModule from '../utils/VideoQuestUtils.tsx'; /* Metro dependency 9522 */
|
|
import * as QuestMatchingUtilsModule from '../utils/QuestMatchingUtils.tsx'; /* Metro dependency 9524 */
|
|
import * as QuestConsoleStartErrorModule from '../../../external/discord_common/js/shared/shared-constants/QuestConsoleStartError.tsx'; /* Metro dependency 9525 */
|
|
import * as QuestHomeBountiesExperimentModule from '../experiments/QuestHomeBountiesExperiment.tsx'; /* Metro dependency 9528 */
|
|
import * as UseVideoModalPlacementEnabledModule from './useVideoModalPlacementEnabled.tsx'; /* Metro dependency 9529 */
|
|
|
|
function _fun73746(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#73746, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9669:6, offset: 0x01d76b83, size: 1639 bytes, params: 8, frame: 41
|
|
let env0_0 = require;
|
|
const _arrayLikeToArray_73749 = 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 useQuests2 = useQuests;
|
|
const doesQuestPassFilter = function(a0, a1, a2) {
|
|
var env0_0 = a0;
|
|
var env0_1 = a1 === 'task' ? doesQuestPassTaskFilter : a1 !== 'reward' ? undefined : doesQuestPassRewardFilter;
|
|
return a2.length === 0 || a2.some(_fun73762);
|
|
};
|
|
const sortQuests2 = sortQuests;
|
|
const closure3 = function(a0) {
|
|
var env0_0 = a0;
|
|
return require(dependencyMap[13]).useStateFromStores([QuestStore], _fun73778, [a0]);
|
|
};
|
|
const closure4 = function(a0) {
|
|
var env0_0 = a0;
|
|
return require(dependencyMap[13]).useStateFromStores([QuestStore], _fun73780);
|
|
};
|
|
const useIsQuestProgressingOnConsole2 = useIsQuestProgressingOnConsole;
|
|
const useIsQuestProgressingVideoQuest2 = useIsQuestProgressingVideoQuest;
|
|
const useIsQuestProgressing2 = useIsQuestProgressing;
|
|
const useThirdPartyTaskDetails2 = useThirdPartyTaskDetails;
|
|
const useGetOrFetchApplicationForConsoleQuests2 = useGetOrFetchApplicationForConsoleQuests;
|
|
const useConnectedAccounts2 = useConnectedAccounts;
|
|
const useSelectedTaskPlatform2 = useSelectedTaskPlatform;
|
|
const useTaskPlatformScreen2 = useTaskPlatformScreen;
|
|
const useQuestHomeHeroShelf2 = useQuestHomeHeroShelf;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
let value = QuestConstantsModule;
|
|
const env0_13 = value.QuestTaskPlatform;
|
|
const env0_14 = value.QuestsExperimentLocations;
|
|
const env0_15 = value.MEMBER_LIST_SOCIAL_ENTRY_POINT_ALLOWED_TASK_TYPES;
|
|
const env0_16 = value.QuestHomeSortMethods;
|
|
const env0_17 = value.SORTED_QUEST_HOME_FILTER_GROUPS;
|
|
const env0_18 = value.TaskFilterTypes;
|
|
const env0_19 = value.RewardFilterTypes;
|
|
const env0_20 = value.MOBILE_ORBS_INTRO_QUEST_ID;
|
|
const env0_21 = value.ORBS_INTRO_QUEST_ID;
|
|
value = require(661) /* metro dependency 661: Constants */;
|
|
const env0_22 = value.HelpdeskArticles;
|
|
const env0_23 = value.PlatformTypes;
|
|
const env0_24 = value.ThemeTypes;
|
|
const env0_25 = value.AnalyticEvents;
|
|
const env0_28 = {};
|
|
const env0_29 = {'questHomeHero': null, 'isQuestHomeHeroShelfEnabled': false};
|
|
object = {DESC: 0};
|
|
object[0] = 'DESC';
|
|
object.ASC = 1;
|
|
object[1] = 'ASC';
|
|
const useQuestTaskDetails2 = useQuestTaskDetails;
|
|
const useWaitingForConsoleConnection2 = useWaitingForConsoleConnection;
|
|
const object3 = {UNACCEPTED: 0};
|
|
object3[0] = 'UNACCEPTED';
|
|
object3.ACCEPTED = 1;
|
|
object3[1] = 'ACCEPTED';
|
|
object3.IN_PROGRESS = 2;
|
|
object3[2] = 'IN_PROGRESS';
|
|
object3.COMPLETED = 3;
|
|
object3[3] = 'COMPLETED';
|
|
object3.CLAIMED = 4;
|
|
object3[4] = 'CLAIMED';
|
|
const useIsPreviewerOnAnyQuest2 = useIsPreviewerOnAnyQuest;
|
|
let Millis = (importDefault(672) /* metro dependency 672: Durations */).Millis;
|
|
const HOUR = Millis.HOUR;
|
|
const env0_37 = 6 * HOUR;
|
|
Millis = (importDefault(672) /* metro dependency 672: Durations */).Millis;
|
|
const env0_38 = Millis.MINUTE;
|
|
(FileImportTrackerModule).fileFinishedImporting('modules/quests/hooks/QuestHooks.tsx');
|
|
exports.useQuests = useQuests2;
|
|
exports.sortQuests = sortQuests2;
|
|
exports.QuestTabs = {ALL: 'all', CLAIMED: 'claimed', PREVIEW_TOOL: 'preview_tool'};
|
|
exports.QuestQueryParams = {TAB: 'tab', QUEST_ID: 'quest_id', SORT: 'sort', FILTER: 'filter',
|
|
AD_CREATIVE_IDS: 'ad_creative_ids'};
|
|
exports.useFilteredQuests = useFilteredQuests;
|
|
exports.useClaimedQuests = useClaimedQuests;
|
|
exports.useExpiredQuestsMap = function() {
|
|
return require(dependencyMap[13]).useStateFromStores([QuestStore], _fun73850);
|
|
};
|
|
exports.useShouldShowBonusOrbsUX = useShouldShowBonusOrbsUX;
|
|
exports.useQuestOrbRewardMultiplier = function(a0) {
|
|
var env0_0 = a0;
|
|
return require(dependencyMap[13]).useStateFromStores([QuestStore], _fun73853, [a0]);
|
|
};
|
|
exports.useIsQuestExpired = closure3;
|
|
exports.useIsQuestEligibleForMembersListPopout = useIsQuestEligibleForMembersListPopout;
|
|
exports.useQuestFormattedDate = useQuestFormattedDate;
|
|
exports.useOnOpenGameClick = useOnOpenGameClick;
|
|
exports.useIsQuestProgressingOnDesktop = closure4;
|
|
exports.useIsQuestProgressingOnConsole = useIsQuestProgressingOnConsole2;
|
|
exports.useIsQuestProgressingVideoQuest = useIsQuestProgressingVideoQuest2;
|
|
exports.useIsQuestProgressing = useIsQuestProgressing2;
|
|
exports.useQuestTaskDetails = useQuestTaskDetails2;
|
|
exports.useThirdPartyTaskDetails = useThirdPartyTaskDetails2;
|
|
exports.useConnectedConsoleLinkOnClick = useConnectedConsoleLinkOnClick;
|
|
exports.useGetOrFetchApplicationForConsoleQuests = useGetOrFetchApplicationForConsoleQuests2;
|
|
exports.useQuestForMemberListSocialEntryPoint = useQuestForMemberListSocialEntryPoint;
|
|
exports.useQuestCollectibles = useQuestCollectibles;
|
|
exports.useQuestPreviewActions = useQuestPreviewActions;
|
|
exports.useConnectedAccounts = useConnectedAccounts2;
|
|
exports.useManuallyStartConsoleQuest = useManuallyStartConsoleQuest;
|
|
exports.useWaitingForConsoleConnection = useWaitingForConsoleConnection2;
|
|
exports.useQuestHowToHelpArticle = useQuestHowToHelpArticle;
|
|
exports.QuestProgressState = object3;
|
|
exports.useProgressState = useProgressState;
|
|
exports.useQuestCompletionDetails = useQuestCompletionDetails;
|
|
exports.useSelectedTaskPlatform = useSelectedTaskPlatform2;
|
|
exports.useTaskPlatformScreen = useTaskPlatformScreen2;
|
|
exports.useQuestWarningTips = useQuestWarningTips;
|
|
exports.useQuest = useQuest;
|
|
exports.useNonNullableQuest = useNonNullableQuest;
|
|
exports.useQuestBarOrDockModeChangeTracking = useQuestBarOrDockModeChangeTracking;
|
|
exports.useCosponsoredLogotypeAsset = useCosponsoredLogotypeAsset;
|
|
exports.useClaimedCollectibleRewardMessage = useClaimedCollectibleRewardMessage;
|
|
exports.useLaunchInGameActivityQuest = useLaunchInGameActivityQuest;
|
|
exports.useIsPreviewerOnAnyQuest = useIsPreviewerOnAnyQuest2;
|
|
exports.useShouldShowPreviewToolTab = function() {
|
|
return useIsPreviewerOnAnyQuest();
|
|
};
|
|
exports.useShouldShowQuestsActivityPanelItem = useShouldShowQuestsActivityPanelItem;
|
|
exports.useQuestsWithPreviewAccess = useQuestsWithPreviewAccess;
|
|
exports.useQuestHomeFilterOptions = useQuestHomeFilterOptions;
|
|
exports.useQuestHomeSortOptions = useQuestHomeSortOptions;
|
|
exports.useQuestHomeSortingFilteringAnalytics = useQuestHomeSortingFilteringAnalytics;
|
|
exports.useShouldShowQuestPreviewOverrides = useShouldShowQuestPreviewOverrides;
|
|
exports.useQuestHomeHeroShelf = useQuestHomeHeroShelf2;
|
|
exports.useFetchQuestHomeBounties = useFetchQuestHomeBounties;
|
|
exports.useQuestHomeBounties = function() {
|
|
return require(dependencyMap[13]).useStateFromStoresObject([BountyStore], _fun73936);
|
|
};
|
|
exports.useQuestBarImpressionSurvey = useQuestBarImpressionSurvey;
|
|
function _createForOfIteratorHelperLoose_73747(a0, a1) { // fn#73747, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9669:611, offset: 0x01d771ea, 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 _fun73748;
|
|
}
|
|
value = undefined;
|
|
if (a0) {
|
|
if (typeof a0 === 'string') {
|
|
value = _arrayLikeToArray_73749(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_73749(a0, value);
|
|
r6 = value;
|
|
} else {
|
|
regexp = RegExp('^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$', '');
|
|
if (regexp.test(r9)) {
|
|
value = _arrayLikeToArray_73749(a0, value);
|
|
r6 = value;
|
|
} else {
|
|
r6 = value;
|
|
}
|
|
}
|
|
r5 = r6;
|
|
}
|
|
} else {
|
|
r5 = value;
|
|
}
|
|
if (r5) {
|
|
if (r5) {
|
|
}
|
|
return _fun73748;
|
|
}
|
|
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 _fun73748() { // fn#73748, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9669:1182, 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 useQuests() { // fn#73750, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9669:1530, offset: 0x01d7735e, size: 365 bytes, params: 1, frame: 22
|
|
const value = a0;
|
|
const r8 = value !== undefined ? value : {'fetchPolicy': 'cache-only', 'callerSource': 'unknown'};
|
|
const [property, env0_2] = undefined(undefined.useState(false), 2);
|
|
const value4 = (require(566) /* metro dependency 566: flux */).useStateFromStoresArray([QuestStore], _fun73751);
|
|
const value5 = (require(566) /* metro dependency 566: flux */).useStateFromStoresArray([QuestStore], _fun73752);
|
|
const {isFetchingCurrentQuests,
|
|
lastFetchedCurrentQuests} = (require(566) /* metro dependency 566: flux */).useStateFromStoresObject([QuestStore],
|
|
function() {
|
|
return {isFetchingCurrentQuests: QuestStore.isFetchingCurrentQuests,
|
|
lastFetchedCurrentQuests: QuestStore.lastFetchedCurrentQuests};
|
|
});
|
|
const isEligibleForQuests = (QuestsEligibilityModule).getIsEligibleForQuests();
|
|
isEligibleForQuests.useEffect(_fun73754, [r8.fetchPolicy, isEligibleForQuests, property, isFetchingCurrentQuests,
|
|
lastFetchedCurrentQuests, r8.callerSource]);
|
|
return {quests: value4, excludedQuests: value5, isFetchingCurrentQuests: isFetchingCurrentQuests,
|
|
hasFetched: property};
|
|
function _fun73751() { // fn#73751, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9669:1687, offset: 0x01d774cb, size: 37 bytes, params: 1, frame: 13
|
|
let value = environment.__proto__;
|
|
value = QuestStore.quests.values();
|
|
const items2 = [];
|
|
arraySpread(items2, value, 0, undefined);
|
|
return items2;
|
|
}
|
|
|
|
function _fun73752() { // fn#73752, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9669:1757, offset: 0x01d774f0, size: 37 bytes, params: 1, frame: 13
|
|
let value = environment.__proto__;
|
|
value = QuestStore.excludedQuests.values();
|
|
const items2 = [];
|
|
arraySpread(items2, value, 0, undefined);
|
|
return items2;
|
|
}
|
|
|
|
function _fun73754() { // fn#73754, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9669:2062, offset: 0x01d7753a, size: 373 bytes, params: 1, frame: 17
|
|
var value2;
|
|
var moduleValue2;
|
|
var defaultImport2;
|
|
var moduleValue3;
|
|
const QuestPlacement = (QuestTypesModule).QuestPlacement;
|
|
let fetchPolicy = env0_0.fetchPolicy;
|
|
if (fetchPolicy !== 'cache-only') {
|
|
fetchPolicy = env0_0.fetchPolicy;
|
|
if (fetchPolicy === 'cache-and-network') {
|
|
if (ReactModule) {
|
|
if (env0_1) {
|
|
return undefined;
|
|
}
|
|
if (isFetchingCurrentQuests) {
|
|
return undefined;
|
|
}
|
|
env0_2(true);
|
|
value2 = environment.__proto__;
|
|
(require(9484) /* metro dependency 9484: QuestActionCreators */).fetchCurrentQuests();
|
|
moduleValue2 = require(477) /* metro dependency 477: PlatformUtils */;
|
|
if (moduleValue2.isMac()) {
|
|
if ((importDefault(9493) /* metro dependency 9493: DiscordAppStateNative */).getState() !== 'focused') {
|
|
return undefined;
|
|
}
|
|
defaultImport2 = importDefault(7108) /* metro dependency 7108: NewAdRequestBehaviorExperiment */;
|
|
if (defaultImport2.getConfig({location: 'QuestHookUseQuests'}).enableNewRequestBehavior) {
|
|
return undefined;
|
|
}
|
|
moduleValue3 = require(9484) /* metro dependency 9484: QuestActionCreators */;
|
|
moduleValue3.fetchQuestToDeliver(QuestPlacement.MOBILE_HOME_DOCK_AREA,
|
|
'use_quests_' + env0_0.callerSource);
|
|
return undefined;
|
|
}
|
|
defaultImport2 = importDefault(7108) /* metro dependency 7108: NewAdRequestBehaviorExperiment */;
|
|
if (defaultImport2.getConfig({location: 'QuestHookUseQuests'}).enableNewRequestBehavior) {
|
|
return undefined;
|
|
}
|
|
moduleValue3 = require(9484) /* metro dependency 9484: QuestActionCreators */;
|
|
moduleValue3.fetchQuestToDeliver(QuestPlacement.MOBILE_HOME_DOCK_AREA,
|
|
'use_quests_' + env0_0.callerSource);
|
|
return undefined;
|
|
}
|
|
return undefined;
|
|
}
|
|
fetchPolicy = env0_0.fetchPolicy;
|
|
if (fetchPolicy !== 'cache-or-network') {
|
|
return undefined;
|
|
}
|
|
if (lastFetchedCurrentQuests !== 0) {
|
|
return undefined;
|
|
}
|
|
if (ReactModule) {
|
|
if (env0_1) {
|
|
return undefined;
|
|
}
|
|
if (isFetchingCurrentQuests) {
|
|
return undefined;
|
|
}
|
|
env0_2(true);
|
|
value2 = environment.__proto__;
|
|
(require(9484) /* metro dependency 9484: QuestActionCreators */).fetchCurrentQuests();
|
|
moduleValue2 = require(477) /* metro dependency 477: PlatformUtils */;
|
|
if (moduleValue2.isMac()) {
|
|
if ((importDefault(9493) /* metro dependency 9493: DiscordAppStateNative */).getState() !== 'focused') {
|
|
return undefined;
|
|
}
|
|
defaultImport2 = importDefault(7108) /* metro dependency 7108: NewAdRequestBehaviorExperiment */;
|
|
if (defaultImport2.getConfig({location: 'QuestHookUseQuests'}).enableNewRequestBehavior) {
|
|
return undefined;
|
|
}
|
|
moduleValue3 = require(9484) /* metro dependency 9484: QuestActionCreators */;
|
|
moduleValue3.fetchQuestToDeliver(QuestPlacement.MOBILE_HOME_DOCK_AREA,
|
|
'use_quests_' + env0_0.callerSource);
|
|
return undefined;
|
|
}
|
|
defaultImport2 = importDefault(7108) /* metro dependency 7108: NewAdRequestBehaviorExperiment */;
|
|
if (defaultImport2.getConfig({location: 'QuestHookUseQuests'}).enableNewRequestBehavior) {
|
|
return undefined;
|
|
}
|
|
moduleValue3 = require(9484) /* metro dependency 9484: QuestActionCreators */;
|
|
moduleValue3.fetchQuestToDeliver(QuestPlacement.MOBILE_HOME_DOCK_AREA, 'use_quests_' + env0_0.callerSource);
|
|
return undefined;
|
|
}
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
function defaultSortFn(a0, a1, {questHomeHero, isQuestHomeHeroShelfEnabled}) { // fn#73755, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9669:2599, offset: 0x01d776af, size: 867 bytes, params: 4, frame: 28
|
|
var r13;
|
|
var r0;
|
|
var r3;
|
|
var sortByDateBinding;
|
|
var config;
|
|
var expiresAt;
|
|
var moduleValue4;
|
|
var getQuestType;
|
|
var value17;
|
|
var moduleValue5;
|
|
var value18;
|
|
var hasWatchVideoOnMobileTasks2;
|
|
var hasWatchVideoOnMobileTasks3;
|
|
const QuestType = (QuestTypeModule).QuestType;
|
|
const value2 = a0.id === MOBILE_ORBS_INTRO_QUEST_ID;
|
|
const value3 = a1.id === MOBILE_ORBS_INTRO_QUEST_ID;
|
|
const r2 = value2 && a0.userStatus?.completedAt == null;
|
|
if (r2 !== (value3 && a1.userStatus?.completedAt == null)) {
|
|
return r2 ? env0_27 : 1;
|
|
}
|
|
const isQuestExpired2 = (QuestDataUtilsModule).isQuestExpired(a0);
|
|
let userStatus = a0.userStatus;
|
|
const value9 = userStatus?.claimedAt != null;
|
|
userStatus = a1.userStatus;
|
|
const value10 = userStatus?.claimedAt != null;
|
|
userStatus = a0.userStatus;
|
|
const value11 = userStatus?.enrolledAt != null;
|
|
userStatus = a1.userStatus;
|
|
const value12 = userStatus?.enrolledAt != null;
|
|
const Millis = (Durations).Millis;
|
|
const MINUTE = Millis.MINUTE;
|
|
const value13 = 30 * MINUTE;
|
|
const hasEnrolledTimeLapsed2 = hasEnrolledTimeLapsed(a0, value13);
|
|
const hasEnrolledTimeLapsed3 = hasEnrolledTimeLapsed(a1, value13);
|
|
if (isQuestExpired2) {
|
|
if (value9 !== value10) {
|
|
r13 = value9 ? env0_27 : 1;
|
|
} else if (value11 !== value12) {
|
|
r13 = value11 ? env0_27 : 1;
|
|
} else {
|
|
sortByDateBinding = sortByDate;
|
|
config = a0.config;
|
|
expiresAt = config.expiresAt;
|
|
config = a1.config;
|
|
r13 = sortByDateBinding(expiresAt, config.expiresAt, env0_30.DESC);
|
|
}
|
|
return r13;
|
|
}
|
|
if (questHomeHero == null) {
|
|
moduleValue4 = require(7114) /* metro dependency 7114: QuestUtils */;
|
|
getQuestType = moduleValue4.getQuestType;
|
|
config = a0.config;
|
|
value17 = Reflect.apply(getQuestType, moduleValue4, [config]);
|
|
moduleValue5 = require(7114) /* metro dependency 7114: QuestUtils */;
|
|
getQuestType = moduleValue5.getQuestType;
|
|
config = a1.config;
|
|
value18 = Reflect.apply(getQuestType, moduleValue5, [config]);
|
|
} else {
|
|
if (isQuestHomeHeroShelfEnabled) {
|
|
moduleValue4 = require(7114) /* metro dependency 7114: QuestUtils */;
|
|
getQuestType = moduleValue4.getQuestType;
|
|
config = a0.config;
|
|
value17 = Reflect.apply(getQuestType, moduleValue4, [config]);
|
|
moduleValue5 = require(7114) /* metro dependency 7114: QuestUtils */;
|
|
getQuestType = moduleValue5.getQuestType;
|
|
config = a1.config;
|
|
value18 = Reflect.apply(getQuestType, moduleValue5, [config]);
|
|
hasWatchVideoOnMobileTasks2 = (require(7116) /* metro dependency 7116: QuestTaskUtils */).hasWatchVideoOnMobileTasks(a0);
|
|
hasWatchVideoOnMobileTasks3 = (require(7116) /* metro dependency 7116: QuestTaskUtils */).hasWatchVideoOnMobileTasks(a1);
|
|
if (hasWatchVideoOnMobileTasks2 === hasWatchVideoOnMobileTasks3) {
|
|
if (value17 === value18) {
|
|
if (hasEnrolledTimeLapsed2 === hasEnrolledTimeLapsed3) {
|
|
if (value9 !== value10) {
|
|
r3 = value9 ? 1 : env0_27;
|
|
} else if (value11 !== value12) {
|
|
r3 = value11 ? env0_27 : 1;
|
|
} else {
|
|
sortByDateBinding = sortByDate;
|
|
config = a0.config;
|
|
expiresAt = config.expiresAt;
|
|
config = a1.config;
|
|
r3 = sortByDateBinding(expiresAt, config.expiresAt, env0_30.ASC);
|
|
}
|
|
} else if (hasEnrolledTimeLapsed2) {
|
|
r3 = hasEnrolledTimeLapsed2 ? 1 : env0_27;
|
|
} else if (hasEnrolledTimeLapsed3) {
|
|
r3 = hasEnrolledTimeLapsed2 ? 1 : env0_27;
|
|
} else if (value9 !== value10) {
|
|
r3 = value9 ? 1 : env0_27;
|
|
} else if (value11 !== value12) {
|
|
r3 = value11 ? env0_27 : 1;
|
|
} else {
|
|
sortByDateBinding = sortByDate;
|
|
config = a0.config;
|
|
expiresAt = config.expiresAt;
|
|
config = a1.config;
|
|
r3 = sortByDateBinding(expiresAt, config.expiresAt, env0_30.ASC);
|
|
}
|
|
r0 = r3;
|
|
} else if (value17 === QuestType.VIDEO) {
|
|
r0 = value17 !== QuestType.VIDEO ? 1 : env0_27;
|
|
} else if (value18 !== QuestType.VIDEO) {
|
|
if (hasEnrolledTimeLapsed2 === hasEnrolledTimeLapsed3) {
|
|
if (value9 !== value10) {
|
|
r3 = value9 ? 1 : env0_27;
|
|
} else if (value11 !== value12) {
|
|
r3 = value11 ? env0_27 : 1;
|
|
} else {
|
|
sortByDateBinding = sortByDate;
|
|
config = a0.config;
|
|
expiresAt = config.expiresAt;
|
|
config = a1.config;
|
|
r3 = sortByDateBinding(expiresAt, config.expiresAt, env0_30.ASC);
|
|
}
|
|
} else if (hasEnrolledTimeLapsed2) {
|
|
r3 = hasEnrolledTimeLapsed2 ? 1 : env0_27;
|
|
} else if (hasEnrolledTimeLapsed3) {
|
|
r3 = hasEnrolledTimeLapsed2 ? 1 : env0_27;
|
|
} else if (value9 !== value10) {
|
|
r3 = value9 ? 1 : env0_27;
|
|
} else if (value11 !== value12) {
|
|
r3 = value11 ? env0_27 : 1;
|
|
} else {
|
|
sortByDateBinding = sortByDate;
|
|
config = a0.config;
|
|
expiresAt = config.expiresAt;
|
|
config = a1.config;
|
|
r3 = sortByDateBinding(expiresAt, config.expiresAt, env0_30.ASC);
|
|
}
|
|
r0 = r3;
|
|
} else {
|
|
r0 = value17 !== QuestType.VIDEO ? 1 : env0_27;
|
|
}
|
|
} else if (hasWatchVideoOnMobileTasks2) {
|
|
r0 = hasWatchVideoOnMobileTasks2 ? env0_27 : 1;
|
|
} else if (hasWatchVideoOnMobileTasks3) {
|
|
r0 = hasWatchVideoOnMobileTasks2 ? env0_27 : 1;
|
|
} else if (value17 === value18) {
|
|
if (hasEnrolledTimeLapsed2 === hasEnrolledTimeLapsed3) {
|
|
if (value9 !== value10) {
|
|
r3 = value9 ? 1 : env0_27;
|
|
} else if (value11 !== value12) {
|
|
r3 = value11 ? env0_27 : 1;
|
|
} else {
|
|
sortByDateBinding = sortByDate;
|
|
config = a0.config;
|
|
expiresAt = config.expiresAt;
|
|
config = a1.config;
|
|
r3 = sortByDateBinding(expiresAt, config.expiresAt, env0_30.ASC);
|
|
}
|
|
} else if (hasEnrolledTimeLapsed2) {
|
|
r3 = hasEnrolledTimeLapsed2 ? 1 : env0_27;
|
|
} else if (hasEnrolledTimeLapsed3) {
|
|
r3 = hasEnrolledTimeLapsed2 ? 1 : env0_27;
|
|
} else if (value9 !== value10) {
|
|
r3 = value9 ? 1 : env0_27;
|
|
} else if (value11 !== value12) {
|
|
r3 = value11 ? env0_27 : 1;
|
|
} else {
|
|
sortByDateBinding = sortByDate;
|
|
config = a0.config;
|
|
expiresAt = config.expiresAt;
|
|
config = a1.config;
|
|
r3 = sortByDateBinding(expiresAt, config.expiresAt, env0_30.ASC);
|
|
}
|
|
r0 = r3;
|
|
} else if (value17 === QuestType.VIDEO) {
|
|
r0 = value17 !== QuestType.VIDEO ? 1 : env0_27;
|
|
} else if (value18 !== QuestType.VIDEO) {
|
|
if (hasEnrolledTimeLapsed2 === hasEnrolledTimeLapsed3) {
|
|
if (value9 !== value10) {
|
|
r3 = value9 ? 1 : env0_27;
|
|
} else if (value11 !== value12) {
|
|
r3 = value11 ? env0_27 : 1;
|
|
} else {
|
|
sortByDateBinding = sortByDate;
|
|
config = a0.config;
|
|
expiresAt = config.expiresAt;
|
|
config = a1.config;
|
|
r3 = sortByDateBinding(expiresAt, config.expiresAt, env0_30.ASC);
|
|
}
|
|
} else if (hasEnrolledTimeLapsed2) {
|
|
r3 = hasEnrolledTimeLapsed2 ? 1 : env0_27;
|
|
} else if (hasEnrolledTimeLapsed3) {
|
|
r3 = hasEnrolledTimeLapsed2 ? 1 : env0_27;
|
|
} else if (value9 !== value10) {
|
|
r3 = value9 ? 1 : env0_27;
|
|
} else if (value11 !== value12) {
|
|
r3 = value11 ? env0_27 : 1;
|
|
} else {
|
|
sortByDateBinding = sortByDate;
|
|
config = a0.config;
|
|
expiresAt = config.expiresAt;
|
|
config = a1.config;
|
|
r3 = sortByDateBinding(expiresAt, config.expiresAt, env0_30.ASC);
|
|
}
|
|
r0 = r3;
|
|
} else {
|
|
r0 = value17 !== QuestType.VIDEO ? 1 : env0_27;
|
|
}
|
|
return r0;
|
|
}
|
|
var moduleValue2 = require(7114) /* metro dependency 7114: QuestUtils */;
|
|
var isQuestFeaturedByHero2 = moduleValue2.isQuestFeaturedByHero(questHomeHero, a0.id);
|
|
var moduleValue3 = require(7114) /* metro dependency 7114: QuestUtils */;
|
|
var isQuestFeaturedByHero3 = moduleValue3.isQuestFeaturedByHero(questHomeHero, a1.id);
|
|
if (isQuestFeaturedByHero2) {
|
|
return isQuestFeaturedByHero2 ? env0_27 : 1;
|
|
}
|
|
if (isQuestFeaturedByHero3) {
|
|
return isQuestFeaturedByHero2 ? env0_27 : 1;
|
|
}
|
|
moduleValue4 = require(7114) /* metro dependency 7114: QuestUtils */;
|
|
value17 = moduleValue4.getQuestType(a0.config);
|
|
moduleValue5 = require(7114) /* metro dependency 7114: QuestUtils */;
|
|
value18 = moduleValue5.getQuestType(a1.config);
|
|
}
|
|
hasWatchVideoOnMobileTasks2 = (require(7116) /* metro dependency 7116: QuestTaskUtils */).hasWatchVideoOnMobileTasks(a0);
|
|
hasWatchVideoOnMobileTasks3 = (require(7116) /* metro dependency 7116: QuestTaskUtils */).hasWatchVideoOnMobileTasks(a1);
|
|
if (hasWatchVideoOnMobileTasks2 === hasWatchVideoOnMobileTasks3) {
|
|
if (value17 === value18) {
|
|
if (hasEnrolledTimeLapsed2 === hasEnrolledTimeLapsed3) {
|
|
if (value9 !== value10) {
|
|
r3 = value9 ? 1 : env0_27;
|
|
} else if (value11 !== value12) {
|
|
r3 = value11 ? env0_27 : 1;
|
|
} else {
|
|
sortByDateBinding = sortByDate;
|
|
config = a0.config;
|
|
expiresAt = config.expiresAt;
|
|
config = a1.config;
|
|
r3 = sortByDateBinding(expiresAt, config.expiresAt, env0_30.ASC);
|
|
}
|
|
} else if (hasEnrolledTimeLapsed2) {
|
|
r3 = hasEnrolledTimeLapsed2 ? 1 : env0_27;
|
|
} else if (hasEnrolledTimeLapsed3) {
|
|
r3 = hasEnrolledTimeLapsed2 ? 1 : env0_27;
|
|
} else if (value9 !== value10) {
|
|
r3 = value9 ? 1 : env0_27;
|
|
} else if (value11 !== value12) {
|
|
r3 = value11 ? env0_27 : 1;
|
|
} else {
|
|
sortByDateBinding = sortByDate;
|
|
config = a0.config;
|
|
expiresAt = config.expiresAt;
|
|
config = a1.config;
|
|
r3 = sortByDateBinding(expiresAt, config.expiresAt, env0_30.ASC);
|
|
}
|
|
r0 = r3;
|
|
} else if (value17 === QuestType.VIDEO) {
|
|
r0 = value17 !== QuestType.VIDEO ? 1 : env0_27;
|
|
} else if (value18 !== QuestType.VIDEO) {
|
|
if (hasEnrolledTimeLapsed2 === hasEnrolledTimeLapsed3) {
|
|
if (value9 !== value10) {
|
|
r3 = value9 ? 1 : env0_27;
|
|
} else if (value11 !== value12) {
|
|
r3 = value11 ? env0_27 : 1;
|
|
} else {
|
|
sortByDateBinding = sortByDate;
|
|
config = a0.config;
|
|
expiresAt = config.expiresAt;
|
|
config = a1.config;
|
|
r3 = sortByDateBinding(expiresAt, config.expiresAt, env0_30.ASC);
|
|
}
|
|
} else if (hasEnrolledTimeLapsed2) {
|
|
r3 = hasEnrolledTimeLapsed2 ? 1 : env0_27;
|
|
} else if (hasEnrolledTimeLapsed3) {
|
|
r3 = hasEnrolledTimeLapsed2 ? 1 : env0_27;
|
|
} else if (value9 !== value10) {
|
|
r3 = value9 ? 1 : env0_27;
|
|
} else if (value11 !== value12) {
|
|
r3 = value11 ? env0_27 : 1;
|
|
} else {
|
|
sortByDateBinding = sortByDate;
|
|
config = a0.config;
|
|
expiresAt = config.expiresAt;
|
|
config = a1.config;
|
|
r3 = sortByDateBinding(expiresAt, config.expiresAt, env0_30.ASC);
|
|
}
|
|
r0 = r3;
|
|
} else {
|
|
r0 = value17 !== QuestType.VIDEO ? 1 : env0_27;
|
|
}
|
|
} else if (hasWatchVideoOnMobileTasks2) {
|
|
r0 = hasWatchVideoOnMobileTasks2 ? env0_27 : 1;
|
|
} else if (hasWatchVideoOnMobileTasks3) {
|
|
r0 = hasWatchVideoOnMobileTasks2 ? env0_27 : 1;
|
|
} else if (value17 === value18) {
|
|
if (hasEnrolledTimeLapsed2 === hasEnrolledTimeLapsed3) {
|
|
if (value9 !== value10) {
|
|
r3 = value9 ? 1 : env0_27;
|
|
} else if (value11 !== value12) {
|
|
r3 = value11 ? env0_27 : 1;
|
|
} else {
|
|
sortByDateBinding = sortByDate;
|
|
config = a0.config;
|
|
expiresAt = config.expiresAt;
|
|
config = a1.config;
|
|
r3 = sortByDateBinding(expiresAt, config.expiresAt, env0_30.ASC);
|
|
}
|
|
} else if (hasEnrolledTimeLapsed2) {
|
|
r3 = hasEnrolledTimeLapsed2 ? 1 : env0_27;
|
|
} else if (hasEnrolledTimeLapsed3) {
|
|
r3 = hasEnrolledTimeLapsed2 ? 1 : env0_27;
|
|
} else if (value9 !== value10) {
|
|
r3 = value9 ? 1 : env0_27;
|
|
} else if (value11 !== value12) {
|
|
r3 = value11 ? env0_27 : 1;
|
|
} else {
|
|
sortByDateBinding = sortByDate;
|
|
config = a0.config;
|
|
expiresAt = config.expiresAt;
|
|
config = a1.config;
|
|
r3 = sortByDateBinding(expiresAt, config.expiresAt, env0_30.ASC);
|
|
}
|
|
r0 = r3;
|
|
} else if (value17 === QuestType.VIDEO) {
|
|
r0 = value17 !== QuestType.VIDEO ? 1 : env0_27;
|
|
} else if (value18 !== QuestType.VIDEO) {
|
|
if (hasEnrolledTimeLapsed2 === hasEnrolledTimeLapsed3) {
|
|
if (value9 !== value10) {
|
|
r3 = value9 ? 1 : env0_27;
|
|
} else if (value11 !== value12) {
|
|
r3 = value11 ? env0_27 : 1;
|
|
} else {
|
|
sortByDateBinding = sortByDate;
|
|
config = a0.config;
|
|
expiresAt = config.expiresAt;
|
|
config = a1.config;
|
|
r3 = sortByDateBinding(expiresAt, config.expiresAt, env0_30.ASC);
|
|
}
|
|
} else if (hasEnrolledTimeLapsed2) {
|
|
r3 = hasEnrolledTimeLapsed2 ? 1 : env0_27;
|
|
} else if (hasEnrolledTimeLapsed3) {
|
|
r3 = hasEnrolledTimeLapsed2 ? 1 : env0_27;
|
|
} else if (value9 !== value10) {
|
|
r3 = value9 ? 1 : env0_27;
|
|
} else if (value11 !== value12) {
|
|
r3 = value11 ? env0_27 : 1;
|
|
} else {
|
|
sortByDateBinding = sortByDate;
|
|
config = a0.config;
|
|
expiresAt = config.expiresAt;
|
|
config = a1.config;
|
|
r3 = sortByDateBinding(expiresAt, config.expiresAt, env0_30.ASC);
|
|
}
|
|
r0 = r3;
|
|
} else {
|
|
r0 = value17 !== QuestType.VIDEO ? 1 : env0_27;
|
|
}
|
|
return r0;
|
|
}
|
|
|
|
function recentSortFn({config}, {config}) { // fn#73756, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9669:3792, offset: 0x01d77a12, size: 58 bytes, params: 3, frame: 15
|
|
const sortByDateBinding = sortByDate;
|
|
const startsAt = config.startsAt;
|
|
const startsAt2 = config.startsAt;
|
|
const DESC = env0_30.DESC;
|
|
return sortByDateBinding(startsAt, startsAt2, DESC);
|
|
}
|
|
|
|
function recentlyEnrolledSortFn(a0, a1) { // fn#73757, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9669:3881, offset: 0x01d77a4c, size: 167 bytes, params: 3, frame: 18
|
|
var r0;
|
|
var sortByDateBinding;
|
|
var config;
|
|
var expiresAt;
|
|
let userStatus = a0.userStatus;
|
|
const value = undefined;
|
|
const enrolledAt = userStatus == null ? value : userStatus.enrolledAt;
|
|
userStatus = a1.userStatus;
|
|
const enrolledAt2 = userStatus == null ? value : userStatus.enrolledAt;
|
|
if (enrolledAt != null) {
|
|
r0 = enrolledAt == null ? enrolledAt != null ? sortByDate(enrolledAt, enrolledAt2,
|
|
env0_30.DESC) : enrolledAt2 != null ? 1 : sortByDate(enrolledAt, enrolledAt2,
|
|
env0_30.DESC) : enrolledAt2 == null ? env0_27 : enrolledAt != null ? sortByDate(enrolledAt, enrolledAt2,
|
|
env0_30.DESC) : enrolledAt2 != null ? 1 : sortByDate(enrolledAt, enrolledAt2, env0_30.DESC);
|
|
} else if (enrolledAt2 == null) {
|
|
sortByDateBinding = sortByDate;
|
|
config = a0.config;
|
|
expiresAt = config.expiresAt;
|
|
config = a1.config;
|
|
r0 = sortByDateBinding(expiresAt, config.expiresAt, env0_30.DESC);
|
|
} else {
|
|
r0 = enrolledAt == null ? enrolledAt != null ? sortByDate(enrolledAt, enrolledAt2,
|
|
env0_30.DESC) : enrolledAt2 != null ? 1 : sortByDate(enrolledAt, enrolledAt2,
|
|
env0_30.DESC) : enrolledAt2 == null ? env0_27 : enrolledAt != null ? sortByDate(enrolledAt, enrolledAt2,
|
|
env0_30.DESC) : enrolledAt2 != null ? 1 : sortByDate(enrolledAt, enrolledAt2, env0_30.DESC);
|
|
}
|
|
return r0;
|
|
}
|
|
|
|
function expiringSoonSortFn({config}, {config}) { // fn#73758, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9669:4158, offset: 0x01d77af3, size: 58 bytes, params: 3, frame: 15
|
|
const sortByDateBinding = sortByDate;
|
|
const expiresAt = config.expiresAt;
|
|
const expiresAt2 = config.expiresAt;
|
|
const ASC = env0_30.ASC;
|
|
return sortByDateBinding(expiresAt, expiresAt2, ASC);
|
|
}
|
|
|
|
function doesQuestPassTaskFilter(a0, a1) { // fn#73759, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9669:4254, offset: 0x01d77b2d, size: 252 bytes, params: 3, frame: 17
|
|
var r1;
|
|
var value;
|
|
const VIDEO = TaskFilterTypes.VIDEO;
|
|
if (VIDEO === a1) {
|
|
return (require(7116) /* metro dependency 7116: QuestTaskUtils */).hasWatchVideoTasks(a0);
|
|
}
|
|
const PLAY = TaskFilterTypes.PLAY;
|
|
if (PLAY === a1) {
|
|
r1 = (require(7116) /* metro dependency 7116: QuestTaskUtils */).hasPlayOnDesktopTask({quest: a0}) || (require(7116) /* metro dependency 7116: QuestTaskUtils */).hasStreamOnDesktopTask({quest: a0});
|
|
r1 = !r1 ? (require(7116) /* metro dependency 7116: QuestTaskUtils */).hasPlayActivityTask(a0) : r1;
|
|
r1 = !r1 ? (require(7116) /* metro dependency 7116: QuestTaskUtils */).isConsoleQuest(a0) : r1;
|
|
if (!r1) {
|
|
value = require(7116) /* metro dependency 7116: QuestTaskUtils */;
|
|
value = value.isInGameQuest(a0);
|
|
r1 = value;
|
|
}
|
|
return r1;
|
|
}
|
|
return false;
|
|
}
|
|
|
|
function doesQuestPassRewardFilter(a0, a1) { // fn#73760, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9669:4569, offset: 0x01d77c29, size: 218 bytes, params: 3, frame: 15
|
|
var r2;
|
|
var moduleValue;
|
|
var hasInGameQuestReward2;
|
|
var value;
|
|
const VIRTUAL_CURRENCY = RewardFilterTypes.VIRTUAL_CURRENCY;
|
|
if (VIRTUAL_CURRENCY === a1) {
|
|
value = require(9500) /* metro dependency 9500: QuestRewardUtils */;
|
|
return value.hasVirtualCurrencyReward(a0.config);
|
|
}
|
|
const COLLECTIBLE = RewardFilterTypes.COLLECTIBLE;
|
|
if (COLLECTIBLE === a1) {
|
|
value = require(9500) /* metro dependency 9500: QuestRewardUtils */;
|
|
return value.hasCollectiblesQuestReward(a0.config);
|
|
}
|
|
const IN_GAME = RewardFilterTypes.IN_GAME;
|
|
if (IN_GAME === a1) {
|
|
moduleValue = require(9500) /* metro dependency 9500: QuestRewardUtils */;
|
|
hasInGameQuestReward2 = moduleValue.hasInGameQuestReward(a0.config);
|
|
if (hasInGameQuestReward2) {
|
|
r2 = hasInGameQuestReward2;
|
|
} else {
|
|
value = require(9500) /* metro dependency 9500: QuestRewardUtils */;
|
|
value = value.hasQuestRewardCode(a0.config);
|
|
r2 = value;
|
|
}
|
|
return r2;
|
|
}
|
|
return false;
|
|
}
|
|
|
|
function doesQuestPassFilter(a0, a1, a2) { // fn#73761, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9669:4889, offset: 0x01d77d03, size: 87 bytes, params: 4, frame: 13
|
|
const env0_0 = a0;
|
|
const r0 = a1 === 'task' ? doesQuestPassTaskFilter : a1 !== 'reward' ? undefined : doesQuestPassRewardFilter;
|
|
return a2.length === 0 || a2.some(_fun73762);
|
|
function _fun73762({filter}) { // fn#73762, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9669:5099, offset: 0x01d77d5a, size: 29 bytes, params: 2, frame: 13
|
|
return env0_1(env0_0, filter);
|
|
}
|
|
|
|
}
|
|
|
|
function sortQuests(a0) { // fn#73763, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9669:5181, offset: 0x01d77d77, size: 186 bytes, params: 2, frame: 18
|
|
var r2;
|
|
let value = a0;
|
|
const value2 = a1;
|
|
const value3 = a2;
|
|
let r1 = value2 !== undefined ? value2 : env0_28;
|
|
const r4 = value3 !== undefined ? value3 : env0_29;
|
|
const sortMethod = r1.sortMethod;
|
|
const filters = r1.filters;
|
|
if (filters == null) {
|
|
r2 = value;
|
|
} else if (filters.length === 0) {
|
|
r2 = value;
|
|
} else {
|
|
value = filterQuests(value, filters);
|
|
r2 = value;
|
|
}
|
|
const MOST_RECENT = QuestHomeSortMethods.MOST_RECENT;
|
|
if (MOST_RECENT === sortMethod) {
|
|
r1 = recentSortFn;
|
|
} else if (QuestHomeSortMethods.RECENTLY_ENROLLED === sortMethod) {
|
|
r1 = recentlyEnrolledSortFn;
|
|
} else if (QuestHomeSortMethods.EXPIRING_SOON === sortMethod) {
|
|
r1 = expiringSoonSortFn;
|
|
} else {
|
|
QuestHomeSortMethods.SUGGESTED;
|
|
r1 = defaultSortFn;
|
|
}
|
|
return r2.sort(((a0, a1) => {
|
|
var env0_0 = a0;
|
|
var env0_1 = a1;
|
|
return _fun73768;
|
|
})(r1, r4));
|
|
function filterQuests(a0, a1) { // fn#73764, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9669:5269, owner: sortQuests.filterQuests, offset: 0x01d77e31, size: 85 bytes, params: 3, frame: 15
|
|
var environment;
|
|
if (a1.length === 0) {
|
|
return a0;
|
|
}
|
|
const value = environment.__proto__;
|
|
const env0_0 = (Module00022Module).groupBy(a1, 'group');
|
|
return a0.filter(_fun73765);
|
|
function _fun73765(a0) { // fn#73765, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9669:5373, offset: 0x01d77e86, size: 55 bytes, params: 2, frame: 12
|
|
const env0_0 = a0;
|
|
const Object = global.Object;
|
|
return Object.entries(env0_0).every(_fun73766);
|
|
function _fun73766(a0) { // fn#73766, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9669:5401, offset: 0x01d77ebd, size: 86 bytes, params: 2, frame: 18
|
|
var r0;
|
|
var r1;
|
|
var r2;
|
|
var item3;
|
|
var value3;
|
|
const iterator = a0[Symbol.iterator]();
|
|
const iterator2 = iterator.next;
|
|
let item2 = Reflect.apply(iterator2, iterator, []);
|
|
let item = item2.value;
|
|
item2 = item2.done ? undefined : iterator;
|
|
const value = undefined;
|
|
const value2 = item2 === value;
|
|
const r3 = value2 ? value : item;
|
|
if (value2) {
|
|
r0 = item2;
|
|
r1 = value2;
|
|
r2 = value;
|
|
} else {
|
|
item3 = Reflect.apply(iterator2, item2, []);
|
|
item = item3.value;
|
|
item3 = item3.done ? undefined : item2;
|
|
value3 = item3 === value;
|
|
if (value3) {
|
|
r0 = item3;
|
|
r1 = value3;
|
|
r2 = value;
|
|
} else {
|
|
r0 = item3;
|
|
r1 = value3;
|
|
r2 = item;
|
|
}
|
|
}
|
|
if (!r1) {
|
|
r0.return();
|
|
}
|
|
return doesQuestPassFilter(env0_0, r3, r2);
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
function prioritizeLiveQuests(a0, a1) { // fn#73767, owner: sortQuests.prioritizeLiveQuests, offset: 0x01d77f13, size: 25 bytes, params: 3, frame: 2
|
|
const env0_0 = a0;
|
|
const env0_1 = a1;
|
|
return _fun73768;
|
|
function _fun73768(a0, a1) { // fn#73768, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9669:5491, offset: 0x01d77f2c, size: 107 bytes, params: 3, frame: 19
|
|
const value = environment.__proto__.__proto__;
|
|
const isQuestExpired2 = QuestDataUtilsModule.isQuestExpired(a0);
|
|
return !isQuestExpired2 !== !QuestDataUtilsModule.isQuestExpired(a1) ? isQuestExpired2 ? 1 : env2_27 : env0_0(a0, a1,
|
|
require);
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
function sortByDate(a0, a1, a2) { // fn#73769, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9669:5912, offset: 0x01d77f97, size: 50 bytes, params: 4, frame: 13
|
|
const DESC = env0_30.DESC;
|
|
return a0.localeCompare(a1) * (a2 !== DESC ? 1 : env0_27);
|
|
}
|
|
|
|
function useAllQuests(a0, a1) { // fn#73770, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9669:5988, offset: 0x01d77fc9, size: 184 bytes, params: 3, frame: 17
|
|
const env0_0 = a0;
|
|
const env0_1 = a1;
|
|
const value = useSortMetadata();
|
|
const env0_3 = env0_5Binding.useRef([]);
|
|
const env0_4 = env0_5Binding.useRef(a1.sortMethod);
|
|
var env0_5Binding = ReactModule.useRef(a1.filters);
|
|
const env0_6 = env0_5Binding.useRef(0);
|
|
const env0_7 = env0_5Binding.useRef(value);
|
|
return env0_5Binding.useMemo(_fun73774, [a0, a1, value]);
|
|
function useSortMetadata() { // fn#73771, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9669:6021, owner: useAllQuests.useSortMetadata, offset: 0x01d78081, size: 147 bytes, params: 1, frame: 18
|
|
const value3 = (require(566) /* metro dependency 566: flux */).useStateFromStores([QuestStore], function() {
|
|
return null;
|
|
}, [(require(9511) /* metro dependency 9511: experiments */).useShouldRemoveQuestHomeHero()]);
|
|
return env1_5.useMemo(_fun73773, [value3, useQuestHomeHeroShelf(value3).isShelfEnabled]);
|
|
function _fun73773() { // fn#73773, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9669:6206, offset: 0x01d78114, size: 25 bytes, params: 1, frame: 3
|
|
return {questHomeHero: env0_0, isQuestHomeHeroShelfEnabled: isShelfEnabled};
|
|
}
|
|
|
|
}
|
|
|
|
function _fun73774() { // fn#73774, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9669:6379, offset: 0x01d7812d, size: 257 bytes, params: 1, frame: 17
|
|
var environment;
|
|
var sortMethod;
|
|
var filters;
|
|
var value2;
|
|
var sortQuestsBinding;
|
|
var binding;
|
|
var binding2;
|
|
var value4;
|
|
var binding3;
|
|
var binding4;
|
|
var binding5;
|
|
let length = env0_0.length;
|
|
if (length === 0) {
|
|
return [];
|
|
}
|
|
let current = env0_3.current;
|
|
length = current.length;
|
|
if (length > 0) {
|
|
current = env0_6.current;
|
|
length = env0_0.length;
|
|
if (current !== length) {
|
|
value2 = environment.__proto__;
|
|
sortQuestsBinding = sortQuests;
|
|
binding = env0_0;
|
|
binding2 = env0_2;
|
|
value4 = sortQuestsBinding(binding, require, binding2).map(function(a0) {
|
|
return a0.id;
|
|
});
|
|
env0_3.current = value4;
|
|
env0_4.current = require.sortMethod;
|
|
ReactModule.current = require.filters;
|
|
env0_6.current = binding.length;
|
|
env0_7.current = binding2;
|
|
return value4;
|
|
}
|
|
current = env0_4.current;
|
|
sortMethod = require.sortMethod;
|
|
if (current !== sortMethod) {
|
|
value2 = environment.__proto__;
|
|
sortQuestsBinding = sortQuests;
|
|
binding = env0_0;
|
|
binding2 = env0_2;
|
|
value4 = sortQuestsBinding(binding, require, binding2).map(_fun73775);
|
|
env0_3.current = value4;
|
|
env0_4.current = require.sortMethod;
|
|
ReactModule.current = require.filters;
|
|
env0_6.current = binding.length;
|
|
env0_7.current = binding2;
|
|
return value4;
|
|
}
|
|
current = ReactModule.current;
|
|
filters = require.filters;
|
|
if (current !== filters) {
|
|
value2 = environment.__proto__;
|
|
sortQuestsBinding = sortQuests;
|
|
binding = env0_0;
|
|
binding2 = env0_2;
|
|
value4 = sortQuestsBinding(binding, require, binding2).map(_fun73775);
|
|
env0_3.current = value4;
|
|
env0_4.current = require.sortMethod;
|
|
ReactModule.current = require.filters;
|
|
env0_6.current = binding.length;
|
|
env0_7.current = binding2;
|
|
return value4;
|
|
}
|
|
current = env0_7.current;
|
|
if (current === env0_2) {
|
|
return env0_3.current;
|
|
}
|
|
value2 = environment.__proto__;
|
|
sortQuestsBinding = sortQuests;
|
|
binding = env0_0;
|
|
binding2 = env0_2;
|
|
value4 = sortQuestsBinding(binding, require, binding2).map(_fun73775);
|
|
env0_3.current = value4;
|
|
binding3 = env0_4;
|
|
sortMethod = require.sortMethod;
|
|
binding3.current = sortMethod;
|
|
binding4 = ReactModule;
|
|
filters = require.filters;
|
|
binding4.current = filters;
|
|
binding5 = env0_6;
|
|
length = binding.length;
|
|
binding5.current = length;
|
|
} else {
|
|
sortQuestsBinding = sortQuests;
|
|
binding = env0_0;
|
|
binding2 = env0_2;
|
|
value4 = sortQuestsBinding(binding, require, binding2).map(function(a0) {
|
|
return a0.id;
|
|
});
|
|
env0_3.current = value4;
|
|
env0_4.current = require.sortMethod;
|
|
ReactModule.current = require.filters;
|
|
env0_6.current = binding.length;
|
|
}
|
|
env0_7.current = binding2;
|
|
return value4;
|
|
}
|
|
|
|
}
|
|
|
|
function isQuestHiddenFromQuestHome(a0) { // fn#73776, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9669:6903, offset: 0x01d7822e, size: 81 bytes, params: 2, frame: 14
|
|
var r0;
|
|
var value;
|
|
const isQuestExpired2 = (require(7091) /* metro dependency 7091: QuestDataUtils */).isQuestExpired(a0);
|
|
if (isQuestExpired2) {
|
|
value = require(7091) /* metro dependency 7091: QuestDataUtils */;
|
|
value = !value.hasUnclaimedReward(a0.userStatus);
|
|
r0 = value;
|
|
} else {
|
|
r0 = isQuestExpired2;
|
|
}
|
|
return r0;
|
|
}
|
|
|
|
function useIsQuestExpired(a0) { // fn#73777, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9669:7022, offset: 0x01d7827f, size: 75 bytes, params: 2, frame: 16
|
|
const env0_0 = a0;
|
|
return (FluxModule).useStateFromStores([QuestStore], _fun73778, [a0]);
|
|
function _fun73778() { // fn#73778, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9669:7093, offset: 0x01d782ca, size: 45 bytes, params: 1, frame: 12
|
|
return env0_0 != null && QuestStore.isQuestExpired(env0_0.id);
|
|
}
|
|
|
|
}
|
|
|
|
function useIsQuestProgressingOnDesktop(a0) { // fn#73779, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9669:7135, offset: 0x01d782f7, size: 66 bytes, params: 2, frame: 14
|
|
const env0_0 = a0;
|
|
return (FluxModule).useStateFromStores([QuestStore], _fun73780);
|
|
function _fun73780() { // fn#73780, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9669:7219, offset: 0x01d78339, size: 32 bytes, params: 1, frame: 11
|
|
const questStoreBinding = QuestStore;
|
|
return questStoreBinding.isProgressingOnDesktop(env0_0.id);
|
|
}
|
|
|
|
}
|
|
|
|
function useIsQuestProgressingOnConsole(a0) { // fn#73781, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9669:7256, offset: 0x01d78359, size: 44 bytes, params: 2, frame: 14
|
|
const env0_0 = a0;
|
|
return ReactModule.useMemo(_fun73782, [a0]);
|
|
function _fun73782() { // fn#73782, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9669:7317, offset: 0x01d78385, size: 45 bytes, params: 1, frame: 11
|
|
const value = environment.__proto__;
|
|
return (QuestTaskUtilsModule).isQuestProgressingOnConsole(env0_0);
|
|
}
|
|
|
|
}
|
|
|
|
function useIsQuestProgressingVideoQuest(a0) { // fn#73783, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9669:7368, offset: 0x01d783b2, size: 100 bytes, params: 2, frame: 16
|
|
const env0_0 = a0;
|
|
return ReactModule.useMemo(_fun73785, [a0,
|
|
(FluxModule).useStateFromStores([QuestStore], _fun73784)]);
|
|
function _fun73784() { // fn#73784, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9669:7452, offset: 0x01d78416, size: 67 bytes, params: 1, frame: 15
|
|
const questStoreBinding = QuestStore;
|
|
const getOptimisticProgress = questStoreBinding.getOptimisticProgress;
|
|
const id = env0_0.id;
|
|
const FirstPartyQuestTaskTypes = (FirstPartyQuestTaskTypesModule).FirstPartyQuestTaskTypes;
|
|
const WATCH_VIDEO = FirstPartyQuestTaskTypes.WATCH_VIDEO;
|
|
return Reflect.apply(getOptimisticProgress, questStoreBinding, [id, WATCH_VIDEO]);
|
|
}
|
|
|
|
function _fun73785() { // fn#73785, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9669:7553, offset: 0x01d78459, size: 45 bytes, params: 1, frame: 11
|
|
const value = environment.__proto__;
|
|
return (VideoQuestUtilsModule).isVideoQuestProgressing(env0_0);
|
|
}
|
|
|
|
}
|
|
|
|
function useIsQuestProgressing(a0) { // fn#73786, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9669:7602, offset: 0x01d78486, size: 49 bytes, params: 2, frame: 13
|
|
const value2 = useIsQuestProgressingOnDesktop(a0);
|
|
const value3 = useIsQuestProgressingOnConsole(a0);
|
|
const value = useIsQuestProgressingVideoQuest(a0);
|
|
let r0 = value2 || value3;
|
|
r0 = !r0 ? value : r0;
|
|
return r0;
|
|
}
|
|
|
|
function useThirdPartyTaskDetails(a0) { // fn#73787, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9669:8269, offset: 0x01d784b7, size: 44 bytes, params: 2, frame: 14
|
|
const env0_0 = a0;
|
|
return ReactModule.useMemo(_fun73788, [a0]);
|
|
function _fun73788() { // fn#73788, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9669:8324, offset: 0x01d784e3, size: 45 bytes, params: 1, frame: 11
|
|
const value = environment.__proto__;
|
|
return (QuestTaskUtilsModule).getThirdPartyTaskDetails(env0_0);
|
|
}
|
|
|
|
}
|
|
|
|
function useGetOrFetchApplicationForConsoleQuests(a0) { // fn#73789, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9669:8372, offset: 0x01d78510, size: 71 bytes, params: 2, frame: 15
|
|
const env0_0 = a0;
|
|
return (UseGetOrFetchApplications)(ReactModule.useMemo(_fun73790, [a0]));
|
|
function _fun73790() { // fn#73790, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9669:8442, offset: 0x01d78557, size: 146 bytes, params: 1, frame: 19
|
|
var r3;
|
|
var value6;
|
|
var moduleValue;
|
|
var consoleApplicationId;
|
|
var value8;
|
|
const Set = global.Set;
|
|
const set = new Set();
|
|
const value4 = _createForOfIteratorHelperLoose_73747(env0_0);
|
|
const value5 = value4();
|
|
let done = value5.done;
|
|
if (!done) {
|
|
r3 = value5;
|
|
while (true) {
|
|
value6 = r3.value;
|
|
moduleValue = require(7116) /* metro dependency 7116: QuestTaskUtils */;
|
|
consoleApplicationId = moduleValue.getConsoleApplicationId(value6);
|
|
if (consoleApplicationId != null) {
|
|
set.add(consoleApplicationId);
|
|
}
|
|
value8 = value4();
|
|
done = value8.done;
|
|
if (done) {
|
|
break;
|
|
}
|
|
r3 = value8;
|
|
continue;
|
|
}
|
|
}
|
|
const Array = global.Array;
|
|
return Array.from(set);
|
|
}
|
|
|
|
}
|
|
|
|
function useConnectedAccounts() { // fn#73791, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9669:8638, offset: 0x01d785e9, size: 146 bytes, params: 1, frame: 15
|
|
const {fetching,
|
|
accounts} = (require(566) /* metro dependency 566: flux */).useStateFromStoresObject([ConnectedAccountsStore],
|
|
function() {
|
|
var object = {};
|
|
object.fetching = ConnectedAccountsStore.isFetching();
|
|
object.accounts = ConnectedAccountsStore.getAccounts();
|
|
return object;
|
|
});
|
|
const value = ReactModule.useMemo(_fun73793, [accounts]);
|
|
return {fetching: fetching, xboxAccounts: value.xboxAccounts, playstationAccounts: value.playstationAccounts,
|
|
xboxAndPlaystationAccounts: value.xboxAndPlaystationAccounts};
|
|
function _fun73793() { // fn#73793, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9669:8814, offset: 0x01d786a8, size: 89 bytes, params: 1, frame: 12
|
|
var value;
|
|
const value2 = accounts.filter(function(a0) {
|
|
return a0.revoked === false;
|
|
}).filter(function({type}) {
|
|
return type === PlatformTypes.XBOX;
|
|
});
|
|
value = value.filter(function({type}) {
|
|
return type === PlatformTypes.PLAYSTATION;
|
|
});
|
|
return {xboxAccounts: value2, playstationAccounts: value, xboxAndPlaystationAccounts: value2.concat(value)};
|
|
}
|
|
|
|
}
|
|
|
|
function useSelectedTaskPlatform(a0) { // fn#73797, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9669:9531, offset: 0x01d78748, size: 108 bytes, params: 2, frame: 16
|
|
const env0_0 = a0;
|
|
const useStateFromStores = FluxModule.useStateFromStores;
|
|
let items2 = [QuestStore];
|
|
items2 = [Reflect.apply(useStateFromStores, FluxModule, [items2, _fun73798])];
|
|
const useCallback = ReactModule.useCallback;
|
|
items2[1] = Reflect.apply(useCallback, ReactModule, [_fun73799, [a0]]);
|
|
return items2;
|
|
function _fun73798() { // fn#73798, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9669:9608, offset: 0x01d787b4, size: 29 bytes, params: 1, frame: 11
|
|
return QuestStore.selectedTaskPlatform(env0_0);
|
|
}
|
|
|
|
function _fun73799(a0) { // fn#73799, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9669:9655, offset: 0x01d787d1, size: 49 bytes, params: 2, frame: 13
|
|
const value = environment.__proto__;
|
|
return (QuestActionCreatorsModule).selectTaskPlatform(env0_0, a0);
|
|
}
|
|
|
|
}
|
|
|
|
function useTaskPlatformScreen(a0, a1) { // fn#73800, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9669:9699, offset: 0x01d78802, size: 293 bytes, params: 3, frame: 22
|
|
const env0_0 = a0;
|
|
const env0_1 = a1;
|
|
const value3 = Module00057(useSelectedTaskPlatform(a0.id), 2);
|
|
const property = value3[0];
|
|
const property2 = value3[1];
|
|
let binding = env0_5;
|
|
let useMemo = binding.useMemo;
|
|
const value4 = Reflect.apply(useMemo, binding, [_fun73801, [a0]]);
|
|
let includes = value4.includes;
|
|
const DESKTOP = QuestTaskPlatform.DESKTOP;
|
|
const value5 = Reflect.apply(includes, value4, [DESKTOP]);
|
|
includes = value4.includes;
|
|
const CONSOLE = QuestTaskPlatform.CONSOLE;
|
|
const value6 = Reflect.apply(includes, value4, [CONSOLE]);
|
|
const value7 = useIsQuestProgressingOnDesktop(a0);
|
|
const value8 = useIsQuestProgressingOnConsole(a0);
|
|
const value9 = env0_5.useMemo(_fun73802, [a1]);
|
|
var env0_5 = value9;
|
|
const r7 = value7 ? QuestTaskPlatform.DESKTOP : value8 ? QuestTaskPlatform.CONSOLE : null;
|
|
binding = env0_5;
|
|
useMemo = binding.useMemo;
|
|
return [Reflect.apply(useMemo, binding, [_fun73813, [value6, value5, value9, r7, property]]), value4, property2];
|
|
function _fun73801() { // fn#73801, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9669:9807, offset: 0x01d78927, size: 45 bytes, params: 1, frame: 11
|
|
const value = environment.__proto__;
|
|
return (QuestPlatformUtilsModule).supportedTaskPlatforms(env0_0);
|
|
}
|
|
|
|
function _fun73802() { // fn#73802, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9669:9986, offset: 0x01d78954, size: 511 bytes, params: 1, frame: 18
|
|
var environment;
|
|
let value = environment.__proto__;
|
|
value = require(4242) /* metro dependency 4242 */;
|
|
value = value.match(require);
|
|
value = value.with({percentComplete: 0}, function() {
|
|
return null;
|
|
});
|
|
const FirstPartyQuestTaskTypes = (FirstPartyQuestTaskTypesModule).FirstPartyQuestTaskTypes;
|
|
const PLAY_ON_DESKTOP = FirstPartyQuestTaskTypes.PLAY_ON_DESKTOP;
|
|
value = value.with({taskType: PLAY_ON_DESKTOP}, function() {
|
|
return QuestTaskPlatform.DESKTOP;
|
|
});
|
|
const PLAY_ACTIVITY = FirstPartyQuestTaskTypes.PLAY_ACTIVITY;
|
|
value = value.with({taskType: PLAY_ACTIVITY}, function() {
|
|
return QuestTaskPlatform.DESKTOP;
|
|
});
|
|
const WATCH_VIDEO = FirstPartyQuestTaskTypes.WATCH_VIDEO;
|
|
value = value.with({taskType: WATCH_VIDEO}, function() {
|
|
return QuestTaskPlatform.DESKTOP;
|
|
});
|
|
const WATCH_VIDEO_ON_MOBILE = FirstPartyQuestTaskTypes.WATCH_VIDEO_ON_MOBILE;
|
|
value = value.with({taskType: WATCH_VIDEO_ON_MOBILE}, function() {
|
|
return QuestTaskPlatform.DESKTOP;
|
|
});
|
|
const STREAM_ON_DESKTOP = FirstPartyQuestTaskTypes.STREAM_ON_DESKTOP;
|
|
value = value.with({taskType: STREAM_ON_DESKTOP}, function() {
|
|
return QuestTaskPlatform.DESKTOP;
|
|
});
|
|
const PLAY_ON_XBOX = FirstPartyQuestTaskTypes.PLAY_ON_XBOX;
|
|
value = value.with({taskType: PLAY_ON_XBOX}, function() {
|
|
return QuestTaskPlatform.CONSOLE;
|
|
});
|
|
const PLAY_ON_PLAYSTATION = FirstPartyQuestTaskTypes.PLAY_ON_PLAYSTATION;
|
|
value = value.with({taskType: PLAY_ON_PLAYSTATION}, function() {
|
|
return QuestTaskPlatform.CONSOLE;
|
|
});
|
|
const ACHIEVEMENT_IN_GAME = FirstPartyQuestTaskTypes.ACHIEVEMENT_IN_GAME;
|
|
value = value.with({taskType: ACHIEVEMENT_IN_GAME}, function() {
|
|
return QuestTaskPlatform.DESKTOP;
|
|
});
|
|
const ACHIEVEMENT_IN_ACTIVITY = FirstPartyQuestTaskTypes.ACHIEVEMENT_IN_ACTIVITY;
|
|
value = value.with({taskType: ACHIEVEMENT_IN_ACTIVITY}, function() {
|
|
return QuestTaskPlatform.DESKTOP;
|
|
});
|
|
return value.exhaustive();
|
|
}
|
|
|
|
function _fun73813() { // fn#73813, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9669:10885, offset: 0x01d78b71, size: 367 bytes, params: 1, frame: 16
|
|
var environment;
|
|
let value = environment.__proto__;
|
|
const value3 = (Module04242Module).match({lastPlatformProgress: env0_5,
|
|
currentProgressingPlatform: env0_6, selectedPlatform: env0_2});
|
|
let CONSOLE = QuestTaskPlatform.CONSOLE;
|
|
const value4 = value3.with({currentProgressingPlatform: CONSOLE}, function() {
|
|
return require(dependencyMap[19]).TaskPlatformScreen.CONSOLE;
|
|
});
|
|
let DESKTOP = QuestTaskPlatform.DESKTOP;
|
|
const value5 = value4.with({currentProgressingPlatform: DESKTOP}, function() {
|
|
return require(dependencyMap[19]).TaskPlatformScreen.DESKTOP;
|
|
});
|
|
CONSOLE = QuestTaskPlatform.CONSOLE;
|
|
const value6 = value5.with({currentProgressingPlatform: null, lastPlatformProgress: CONSOLE}, function() {
|
|
return require(dependencyMap[19]).TaskPlatformScreen.CONSOLE;
|
|
});
|
|
DESKTOP = QuestTaskPlatform.DESKTOP;
|
|
const value7 = value6.with({currentProgressingPlatform: null, lastPlatformProgress: DESKTOP}, function() {
|
|
return require(dependencyMap[19]).TaskPlatformScreen.DESKTOP;
|
|
});
|
|
CONSOLE = QuestTaskPlatform.CONSOLE;
|
|
const value8 = value7.with({'currentProgressingPlatform': null, 'lastPlatformProgress': null,
|
|
selectedPlatform: CONSOLE}, function() {
|
|
return require(dependencyMap[19]).TaskPlatformScreen.CONSOLE;
|
|
});
|
|
DESKTOP = QuestTaskPlatform.DESKTOP;
|
|
value = value8.with({'currentProgressingPlatform': null, 'lastPlatformProgress': null, selectedPlatform: DESKTOP},
|
|
function() {
|
|
return require(dependencyMap[19]).TaskPlatformScreen.DESKTOP;
|
|
});
|
|
value = value.with({'currentProgressingPlatform': null, 'lastPlatformProgress': null, 'selectedPlatform': null},
|
|
_fun73820);
|
|
return value.exhaustive();
|
|
function _fun73820() { // fn#73820, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9669:11743, offset: 0x01d78d2e, size: 110 bytes, params: 1, frame: 12
|
|
const TaskPlatformScreen = (QuestTypesModule).TaskPlatformScreen;
|
|
return env1_4 && env1_3 ? TaskPlatformScreen.SELECT : env1_4 ? TaskPlatformScreen.CONSOLE : TaskPlatformScreen.DESKTOP;
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
function useQuestHomeHeroShelf(a0) { // fn#73821, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9669:12258, offset: 0x01d78d9c, size: 119 bytes, params: 2, frame: 17
|
|
return ReactModule.useMemo(_fun73823, [(require(566) /* metro dependency 566: flux */).useStateFromStores([QuestStore],
|
|
function() {
|
|
return QuestStore.quests;
|
|
}), a0?.questIds]);
|
|
function _fun73823() { // fn#73823, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9669:12393, offset: 0x01d78e22, size: 168 bytes, params: 1, frame: 14
|
|
var value;
|
|
if (questIds == null) {
|
|
return {shelfQuests: [], isShelfEnabled: false};
|
|
}
|
|
value = Reflect.apply(questIds.map(function(a0) {
|
|
return quests.get(a0);
|
|
}).filter, value, [(require(1360) /* metro dependency 1360: GlobalUtils */).isNotNullish]);
|
|
value = value.filter(_fun73825);
|
|
return value.length <= 1 ? {shelfQuests: [], isShelfEnabled: false} : {shelfQuests: value, isShelfEnabled: true};
|
|
function _fun73825(a0) { // fn#73825, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9669:12516, offset: 0x01d78ee0, size: 44 bytes, params: 2, frame: 11
|
|
let value = environment.__proto__.__proto__;
|
|
value = require(7091) /* metro dependency 7091: QuestDataUtils */;
|
|
return !value.isQuestExpired(a0);
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
function useQuestTaskDetails(a0) { // fn#73826, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9669:7788, offset: 0x01d78f0c, size: 183 bytes, params: 2, frame: 18
|
|
const env0_0 = a0;
|
|
const value2 = ReactModule.useCallback(_fun73827, [a0]);
|
|
const [property, env0_2] = Module00057(ReactModule.useState(value2()), 2);
|
|
ReactModule.useEffect(_fun73829, [a0, useIsQuestProgressing(a0), ReactModule.useCallback(_fun73828, [value2])]);
|
|
return property;
|
|
function _fun73827() { // fn#73827, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9669:7813, offset: 0x01d78fc3, size: 45 bytes, params: 1, frame: 11
|
|
const value = environment.__proto__;
|
|
return (QuestTaskUtilsModule).getQuestTaskDetails(env0_0);
|
|
}
|
|
|
|
function _fun73828() { // fn#73828, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9669:7914, offset: 0x01d78ff0, size: 24 bytes, params: 1, frame: 11
|
|
return env0_2(env0_1());
|
|
}
|
|
|
|
function _fun73829() { // fn#73829, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9669:7978, offset: 0x01d79008, size: 195 bytes, params: 1, frame: 16
|
|
var environment;
|
|
var window;
|
|
var setInterval;
|
|
var value;
|
|
let userStatus = env0_0.userStatus;
|
|
const value2 = undefined;
|
|
if ((userStatus == null ? value2 : userStatus.enrolledAt) != null) {
|
|
userStatus = env0_0.userStatus;
|
|
if ((userStatus == null ? value2 : userStatus.completedAt) != null) {
|
|
Module00005();
|
|
return value2;
|
|
}
|
|
userStatus = env0_0.userStatus;
|
|
if ((userStatus == null ? value2 : userStatus.claimedAt) != null) {
|
|
Module00005();
|
|
return value2;
|
|
}
|
|
if (Module00057) {
|
|
window = global.window;
|
|
setInterval = window.setInterval;
|
|
value = environment.__proto__;
|
|
value = 1 * (importDefault(672) /* metro dependency 672: Durations */).Millis.SECOND;
|
|
var env0_0 = Reflect.apply(setInterval, window, [_fun73830, value]);
|
|
return _fun73831;
|
|
}
|
|
}
|
|
Module00005();
|
|
return value2;
|
|
function _fun73830() { // fn#73830, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9669:8181, offset: 0x01d790cb, size: 15 bytes, params: 1, frame: 9
|
|
env1_3();
|
|
}
|
|
|
|
function _fun73831() { // fn#73831, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9669:8224, offset: 0x01d790da, size: 35 bytes, params: 1, frame: 11
|
|
global.clearInterval(env0_0);
|
|
env1_3();
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
function useWaitingForConsoleConnection({quest}) { // fn#73832, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9669:9203, offset: 0x01d790fd, size: 93 bytes, params: 2, frame: 15
|
|
const xboxAndPlaystationAccounts = useConnectedAccounts().xboxAndPlaystationAccounts;
|
|
const value2 = useIsQuestProgressing(quest);
|
|
const value3 = xboxAndPlaystationAccounts.length === 0;
|
|
let value = QuestTaskUtilsModule;
|
|
value = value.isConsoleQuest(quest);
|
|
return value && value3 && !value2;
|
|
}
|
|
|
|
function useIsPreviewerOnAnyQuest() { // fn#73833, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9669:11927, offset: 0x01d7915a, size: 78 bytes, params: 1, frame: 14
|
|
const useStateFromStoresArray = FluxModule.useStateFromStoresArray;
|
|
return Reflect.apply(useStateFromStoresArray, FluxModule, [[QuestStore], _fun73834]).some(function(a0) {
|
|
return a0.preview;
|
|
});
|
|
function _fun73834() { // fn#73834, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9669:11970, offset: 0x01d774cb, size: 37 bytes, params: 1, frame: 13
|
|
let value = environment.__proto__;
|
|
value = QuestStore.quests.values();
|
|
const items2 = [];
|
|
arraySpread(items2, value, 0, undefined);
|
|
return items2;
|
|
}
|
|
|
|
}
|
|
|
|
function useFilteredQuests(a0) { // fn#73837, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9669:12878, offset: 0x01d7924d, size: 303 bytes, params: 2, frame: 25
|
|
var r5;
|
|
var r14;
|
|
var value10;
|
|
var value11;
|
|
var value12;
|
|
var value13;
|
|
var removeExpiredQuests;
|
|
var isQuestHiddenFromQuestHome2;
|
|
var value14;
|
|
var value15;
|
|
const value = a1;
|
|
const r8 = value !== undefined ? value : env0_28;
|
|
const {quests, excludedQuests, isFetchingCurrentQuests, hasFetched} = useQuests({'fetchPolicy': 'cache-and-network',
|
|
'callerSource': 'use_filtered_quests'});
|
|
const Map = global.Map;
|
|
let map = quests.map;
|
|
map = new Map(Reflect.apply(map, quests, [function(a0) {
|
|
return [a0.id, a0];
|
|
}]));
|
|
const value6 = useAllQuests(quests, r8);
|
|
const value7 = useCompletedAndClaimedQuests(quests);
|
|
const items2 = [];
|
|
const _createForOfIteratorHelperLoose_73747Binding = _createForOfIteratorHelperLoose_73747;
|
|
let ALL = env0_31.ALL;
|
|
let r0 = a0 !== ALL ? value7 : value6;
|
|
const value8 = _createForOfIteratorHelperLoose_73747Binding(r0);
|
|
const value9 = value8();
|
|
let done = value9.done;
|
|
if (!done) {
|
|
r5 = value9;
|
|
while (true) {
|
|
value10 = r5.value;
|
|
value11 = map.get(value10);
|
|
value12 = value11 != null;
|
|
if (value12) {
|
|
ALL = env0_31.ALL;
|
|
value13 = a0 === ALL;
|
|
r14 = value13;
|
|
} else {
|
|
r14 = value12;
|
|
}
|
|
if (!r14) {
|
|
continue;
|
|
}
|
|
removeExpiredQuests = r8.removeExpiredQuests;
|
|
r14 = removeExpiredQuests;
|
|
if (!r14) {
|
|
continue;
|
|
}
|
|
isQuestHiddenFromQuestHome2 = isQuestHiddenFromQuestHome(value11);
|
|
r14 = isQuestHiddenFromQuestHome2;
|
|
value14 = value11 == null;
|
|
if (value14) {
|
|
r0 = value14;
|
|
continue;
|
|
}
|
|
r0 = r14;
|
|
continue;
|
|
if (r0) {
|
|
continue;
|
|
}
|
|
items2.push(value11);
|
|
value15 = value8();
|
|
done = value15.done;
|
|
if (done) {
|
|
break;
|
|
}
|
|
r5 = value15;
|
|
continue;
|
|
}
|
|
}
|
|
return {quests: items2, excludedQuests: excludedQuests, isFetchingCurrentQuests: isFetchingCurrentQuests,
|
|
hasFetched: hasFetched};
|
|
function useCompletedAndClaimedQuests(a0) { // fn#73839, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9669:13131, owner: useFilteredQuests.useCompletedAndClaimedQuests, offset: 0x01d7937c, size: 100 bytes, params: 2, frame: 15
|
|
const env0_0 = a0;
|
|
const value2 = env1_5.useMemo(_fun73840, [a0]);
|
|
const env0_2 = env1_5.useRef([]);
|
|
return env1_5.useMemo(_fun73842, [value2]);
|
|
function _fun73840() { // fn#73840, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9669:13189, offset: 0x01d793e0, size: 28 bytes, params: 1, frame: 11
|
|
return env0_0.filter(function(a0) {
|
|
var property = a0.userStatus;
|
|
var value = undefined;
|
|
var value2 = (property == null ? value : property.completedAt) != null;
|
|
property = a0.userStatus;
|
|
return value2 && (property == null ? value : property.claimedAt) != null;
|
|
});
|
|
}
|
|
|
|
function _fun73842() { // fn#73842, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9669:13375, offset: 0x01d7943b, size: 133 bytes, params: 1, frame: 13
|
|
if (env0_1.length === 0) {
|
|
return [];
|
|
}
|
|
if (env0_2.current.length > 0) {
|
|
if (env0_2.current.length === env0_1.length) {
|
|
return env0_2.current;
|
|
}
|
|
}
|
|
const value3 = env0_1.sort(_fun73843).map(function(a0) {
|
|
return a0.id;
|
|
});
|
|
env0_2.current = value3;
|
|
return value3;
|
|
function _fun73843(a0, a1) { // fn#73843, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9669:13487, offset: 0x01d794c0, size: 144 bytes, params: 3, frame: 18
|
|
var r0;
|
|
var value3;
|
|
var sortByDateBinding;
|
|
var config;
|
|
var rewardsConfig;
|
|
var rewardsExpireAt;
|
|
let userStatus = a0.userStatus;
|
|
const value = undefined;
|
|
const value2 = (userStatus == null ? value : userStatus.claimedAt) == null;
|
|
userStatus = a1.userStatus;
|
|
if (value2 !== ((userStatus == null ? value : userStatus.claimedAt) == null)) {
|
|
r0 = value2 ? env3_27 : 1;
|
|
} else {
|
|
value3 = environment.__proto__.__proto__.__proto__;
|
|
sortByDateBinding = sortByDate;
|
|
config = a0.config;
|
|
rewardsConfig = config.rewardsConfig;
|
|
rewardsExpireAt = rewardsConfig.rewardsExpireAt;
|
|
config = a1.config;
|
|
rewardsConfig = config.rewardsConfig;
|
|
r0 = sortByDateBinding(rewardsExpireAt, rewardsConfig.rewardsExpireAt, env3_30.DESC);
|
|
}
|
|
return r0;
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
function useClaimedQuests() { // fn#73845, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9669:14057, offset: 0x01d79550, size: 165 bytes, params: 1, frame: 19
|
|
const env0_0 = ReactModule.useRef(false);
|
|
const value2 = (require(566) /* metro dependency 566: flux */).useStateFromStoresArray([QuestStore], function() {
|
|
var Array = global.Array;
|
|
return Array.from(QuestStore.claimedQuests.values());
|
|
});
|
|
const isFetchingClaimedQuests = (require(566) /* metro dependency 566: flux */).useStateFromStores([QuestStore],
|
|
function() {
|
|
return QuestStore.isFetchingClaimedQuests;
|
|
});
|
|
ReactModule.useEffect(_fun73848, [isFetchingClaimedQuests]);
|
|
return {claimedQuests: value2, isFetchingClaimedQuests: isFetchingClaimedQuests};
|
|
function _fun73848() { // fn#73848, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9669:14276, offset: 0x01d7962e, size: 73 bytes, params: 1, frame: 11
|
|
var value;
|
|
if (!(isFetchingClaimedQuests || env0_0.current)) {
|
|
env0_0.current = true;
|
|
value = environment.__proto__;
|
|
value = require(9484) /* metro dependency 9484: QuestActionCreators */;
|
|
value.fetchClaimedQuests();
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
function useExpiredQuestsMap() { // fn#73849, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9669:14416, offset: 0x01d79677, size: 59 bytes, params: 1, frame: 13
|
|
return (require(566) /* metro dependency 566: flux */).useStateFromStores([QuestStore], function() {
|
|
return QuestStore.getExpiredQuestsMap();
|
|
});
|
|
function _fun73850() { // fn#73850, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9669:14488, offset: 0x01d796b2, size: 21 bytes, params: 1, frame: 9
|
|
return QuestStore.getExpiredQuestsMap();
|
|
}
|
|
|
|
}
|
|
|
|
function useShouldShowBonusOrbsUX(a0, a1) { // fn#73851, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9669:14547, offset: 0x01d796c7, size: 134 bytes, params: 3, frame: 17
|
|
var value;
|
|
const value2 = useIsQuestExpired(a0);
|
|
value = Reflect.apply((require(9500) /* metro dependency 9500: QuestRewardUtils */).hasVirtualCurrencyReward, value,
|
|
[a0.config]);
|
|
const questRewardUtilsModule = require(9500) /* metro dependency 9500: QuestRewardUtils */;
|
|
const hasPremiumOrbQuantity2 = questRewardUtilsModule.hasPremiumOrbQuantity(a0.config);
|
|
const QuestOrbMultiplierEligibilityType = (QuestOrbMultiplierUtilsModule).QuestOrbMultiplierEligibilityType;
|
|
const INELIGIBLE = QuestOrbMultiplierEligibilityType.INELIGIBLE;
|
|
return !value2 && value && hasPremiumOrbQuantity2 && a1 !== INELIGIBLE;
|
|
}
|
|
|
|
function useQuestOrbRewardMultiplier(a0) { // fn#73852, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9669:14815, offset: 0x01d7974d, size: 75 bytes, params: 2, frame: 16
|
|
const env0_0 = a0;
|
|
return (FluxModule).useStateFromStores([QuestStore], _fun73853, [a0]);
|
|
function _fun73853() { // fn#73853, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9669:14896, offset: 0x01d79798, size: 75 bytes, params: 1, frame: 13
|
|
var r0;
|
|
let value = environment.__proto__;
|
|
const quest = QuestStore.getQuest(env0_0);
|
|
const value4 = null;
|
|
if (value4 == quest) {
|
|
r0 = value4;
|
|
} else {
|
|
value = require(9500) /* metro dependency 9500: QuestRewardUtils */;
|
|
value = value.getQuestOrbMultiplier(quest.config);
|
|
r0 = value;
|
|
}
|
|
return r0;
|
|
}
|
|
|
|
}
|
|
|
|
function useIsQuestEligibleForMembersListPopout(a0, a1, a2) { // fn#73854, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9669:15072, offset: 0x01d797e3, size: 293 bytes, params: 4, frame: 24
|
|
const env0_0 = a0;
|
|
const env0_1 = a1;
|
|
const value2 = undefined;
|
|
const value3 = (require(566) /* metro dependency 566: flux */).useStateFromStores([ChannelStore], _fun73855);
|
|
const value4 = (require(566) /* metro dependency 566: flux */).useStateFromStores([QuestStore], function() {
|
|
return QuestStore.questEnrollmentBlockedUntil != null;
|
|
}, []);
|
|
const value5 = (require(566) /* metro dependency 566: flux */).useStateFromStores([UserStore], _fun73857);
|
|
const value6 = (require(566) /* metro dependency 566: flux */).useStateFromStores([QuestStore], _fun73858, [a0]);
|
|
if (a0 == null) {
|
|
return false;
|
|
}
|
|
if (value4) {
|
|
return false;
|
|
}
|
|
if (value6) {
|
|
return false;
|
|
}
|
|
if (value5 === a2) {
|
|
return false;
|
|
}
|
|
const userStatus = a0.userStatus;
|
|
const value7 = (userStatus == null ? value2 : userStatus.claimedAt) != null;
|
|
let value = QuestUtilsModule;
|
|
value = value.isStreamingAndCanWatch(a1, value3);
|
|
return !(value7 && !value);
|
|
function _fun73855() { // fn#73855, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9669:15169, offset: 0x01d79908, size: 58 bytes, params: 1, frame: 14
|
|
let value = environment.__proto__;
|
|
const channelStoreBinding = ChannelStore;
|
|
const value2 = null;
|
|
value = channelStoreBinding.getChannel(value2 == require ? undefined : require.channelId);
|
|
return value2 != value ? value : value2;
|
|
}
|
|
|
|
function _fun73857() { // fn#73857, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9669:15365, offset: 0x01d79957, size: 34 bytes, params: 1, frame: 10
|
|
const value = environment.__proto__;
|
|
return UserStore.getCurrentUser()?.id;
|
|
}
|
|
|
|
function _fun73858() { // fn#73858, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9669:15463, offset: 0x01d782ca, size: 45 bytes, params: 1, frame: 12
|
|
return env0_0 != null && QuestStore.isQuestExpired(env0_0.id);
|
|
}
|
|
|
|
}
|
|
|
|
function useQuestFormattedDate(a0) { // fn#73859, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9669:15675, offset: 0x01d79979, size: 137 bytes, params: 2, frame: 17
|
|
const value = a1;
|
|
const env0_0 = a0;
|
|
return ReactModule.useMemo(_fun73861, [a0, value !== undefined ? value : {dateStyle: 'short'},
|
|
(require(566) /* metro dependency 566: flux */).useStateFromStores([LocaleStore], function() {
|
|
return LocaleStore.locale;
|
|
})]);
|
|
function _fun73861() { // fn#73861, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9669:15804, offset: 0x01d79a02, size: 74 bytes, params: 1, frame: 14
|
|
var r0;
|
|
var Date;
|
|
var binding;
|
|
var date;
|
|
if (env0_0 == null) {
|
|
r0 = '';
|
|
} else {
|
|
Date = global.Date;
|
|
binding = env0_0;
|
|
date = new Date();
|
|
r0 = date.toLocaleDateString(locale, env0_1);
|
|
}
|
|
return r0;
|
|
}
|
|
|
|
}
|
|
|
|
function useOnOpenGameClick({quest, content, ctaContent, sourceQuestContent}) { // fn#73862, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9669:15888, offset: 0x01d79a4c, size: 131 bytes, params: 2, frame: 18
|
|
return ReactModule.useCallback(_fun73863, [quest, content, ctaContent,
|
|
(ContentImpressionTrackerHooksModule).useQuestImpressionId(),
|
|
sourceQuestContent]);
|
|
function _fun73863() { // fn#73863, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9669:16032, offset: 0x01d79acf, size: 166 bytes, params: 1, frame: 16
|
|
var window;
|
|
var open;
|
|
var moduleValue;
|
|
var value;
|
|
if (quest.id !== ORBS_INTRO_QUEST_ID) {
|
|
moduleValue = require(9520) /* metro dependency 9520: QuestPlatformUtils */;
|
|
moduleValue.openGameLinkDirectly(quest, {content: content, ctaContent: ctaContent, impressionId: Module00057,
|
|
sourceQuestContent: sourceQuestContent});
|
|
} else {
|
|
window = global.window;
|
|
open = window.open;
|
|
value = importDefault(1948) /* metro dependency 1948: HelpdeskUtils */;
|
|
Reflect.apply(open, window, [value.getArticleURL(HelpdeskArticles.VIRTUAL_CURRENCY_LEARN_MORE)]);
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
function useConnectedConsoleLinkOnClick({quest, questContent, sourceQuestContent}) { // fn#73864, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9669:16598, offset: 0x01d79b75, size: 103 bytes, params: 2, frame: 13
|
|
const env0_3 = useWaitingForConsoleConnection({quest: quest});
|
|
const env0_4 = (ContentImpressionTrackerHooksModule).useQuestImpression();
|
|
return _fun73865;
|
|
function _fun73865() { // fn#73865, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9669:16735, offset: 0x01d79bdc, size: 249 bytes, params: 1, frame: 20
|
|
var openConsoleConnectionSettings;
|
|
var object;
|
|
var object2;
|
|
const QuestContentCTA = (AnalyticsTypesModule).QuestContentCTA;
|
|
var openAddConsoleConnectionModal;
|
|
var object3;
|
|
const binding = env0_3;
|
|
const value3 = undefined;
|
|
if (binding) {
|
|
openAddConsoleConnectionModal = QuestPlatformUtilsModule.openAddConsoleConnectionModal;
|
|
object = {};
|
|
object.quest = quest;
|
|
object3 = {};
|
|
object3.content = questContent;
|
|
object3.ctaContent = QuestContentCTA.CONNECT_CONSOLE_LINK;
|
|
object3.impressionId = env0_4 == null ? value3 : env0_4.getId();
|
|
object3.sourceQuestContent = sourceQuestContent;
|
|
Reflect.apply(openAddConsoleConnectionModal, QuestPlatformUtilsModule, [object, object3]);
|
|
} else {
|
|
openConsoleConnectionSettings = QuestPlatformUtilsModule.openConsoleConnectionSettings;
|
|
object = {};
|
|
object.quest = quest;
|
|
object2 = {};
|
|
object2.content = questContent;
|
|
object2.ctaContent = QuestContentCTA.VIEW_CONSOLE_CONNECTIONS_LINK;
|
|
object2.impressionId = env0_4 == null ? value3 : env0_4.getId();
|
|
object2.sourceQuestContent = sourceQuestContent;
|
|
Reflect.apply(openConsoleConnectionSettings, QuestPlatformUtilsModule, [object, object2]);
|
|
}
|
|
return value3;
|
|
}
|
|
|
|
}
|
|
|
|
function useQuestForMemberListSocialEntryPoint(a0) { // fn#73866, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9669:17239, offset: 0x01d79cd5, size: 161 bytes, params: 2, frame: 18
|
|
const env0_0 = a0;
|
|
const quests = (require(566) /* metro dependency 566: flux */).useStateFromStores([QuestStore], function() {
|
|
return QuestStore.quests;
|
|
});
|
|
const Array = global.Array;
|
|
const value3 = ReactModule.useMemo(_fun73868, [a0, quests,
|
|
useGetOrFetchApplicationForConsoleQuests(Array.from(quests.values()))]);
|
|
return useIsQuestExpired(value3) ? null : value3;
|
|
function _fun73868() { // fn#73868, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9669:17424, offset: 0x01d79d76, size: 78 bytes, params: 1, frame: 17
|
|
const value = environment.__proto__;
|
|
return (QuestMatchingUtilsModule).getQuestsFromActivities(QuestUtilsModule.filterQuestsForSocialEntrypoints(quests,
|
|
MEMBER_LIST_SOCIAL_ENTRY_POINT_ALLOWED_TASK_TYPES), env0_0);
|
|
}
|
|
|
|
}
|
|
|
|
function useQuestCollectibles(a0) { // fn#73869, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9669:17600, offset: 0x01d79dc4, size: 155 bytes, params: 2, frame: 15
|
|
const value = undefined;
|
|
const hasCollectiblesQuestReward2 = (QuestRewardUtilsModule).hasCollectiblesQuestReward(a0);
|
|
const {product,
|
|
isFetching} = (UseFetchCollectiblesProductModule).useFetchCollectiblesProduct((QuestCopyUtilsModule).getDefaultReward(a0).skuId);
|
|
return {hasQuestCollectibles: hasCollectiblesQuestReward2,
|
|
avatarDecoration: product == null || product.items == null ? value : product.items[0], isFetching: isFetching};
|
|
}
|
|
|
|
function useQuestPreviewActions(a0) { // fn#73870, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9669:17916, offset: 0x01d79e5f, size: 44 bytes, params: 2, frame: 14
|
|
const env0_0 = a0;
|
|
return ReactModule.useMemo(function() {
|
|
return {handleComplete: _fun73872, handleProgress: _fun73873, handleResetStatusClick: _fun73874,
|
|
handleResetDismissibilityClick: _fun73875, handleOverridePreviewClick: _fun73876,
|
|
handleResetHasBeenSeenClick: _fun73877};
|
|
}, [a0]);
|
|
function _fun73871() { // fn#73871, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9669:17969, offset: 0x01d79e8b, size: 78 bytes, params: 1, frame: 3
|
|
return {handleComplete: handleComplete, handleProgress: handleProgress_73873,
|
|
handleResetStatusClick: handleResetStatusClick, handleResetDismissibilityClick: handleResetDismissibilityClick,
|
|
handleOverridePreviewClick: handleOverridePreviewClick,
|
|
handleResetHasBeenSeenClick: handleResetHasBeenSeenClick};
|
|
function handleComplete() { // fn#73872, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9669:17990, offset: 0x01d79ed9, size: 45 bytes, params: 1, frame: 11
|
|
const value = environment.__proto__.__proto__;
|
|
return (QuestActionCreatorsModule).completeQuestPreview(env1_0);
|
|
}
|
|
|
|
function handleProgress_73873(a0) { // fn#73873, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9669:18043, offset: 0x01d79f06, size: 49 bytes, params: 2, frame: 13
|
|
const value = environment.__proto__.__proto__;
|
|
return (QuestActionCreatorsModule).completeQuestPreview(env1_0, a0);
|
|
}
|
|
|
|
function handleResetStatusClick() { // fn#73874, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9669:18105, offset: 0x01d79f37, size: 45 bytes, params: 1, frame: 11
|
|
const value = environment.__proto__.__proto__;
|
|
return (QuestActionCreatorsModule).resetQuestPreviewStatus(env1_0);
|
|
}
|
|
|
|
function handleResetDismissibilityClick() { // fn#73875, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9669:18177, offset: 0x01d79f64, size: 45 bytes, params: 1, frame: 11
|
|
const value = environment.__proto__.__proto__;
|
|
return (QuestActionCreatorsModule).resetQuestDismissibilityStatus(env1_0);
|
|
}
|
|
|
|
function handleOverridePreviewClick(a0) { // fn#73876, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9669:18252, offset: 0x01d79f91, size: 49 bytes, params: 2, frame: 13
|
|
const value = environment.__proto__.__proto__;
|
|
return (QuestActionCreatorsModule).overrideQuestForPlacement(a0, env1_0);
|
|
}
|
|
|
|
function handleResetHasBeenSeenClick() { // fn#73877, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9669:18324, offset: 0x01d79fc2, size: 78 bytes, params: 1, frame: 15
|
|
let value = environment.__proto__.__proto__;
|
|
value = require(9484) /* metro dependency 9484: QuestActionCreators */;
|
|
const markAdContentUnseen = value.markAdContentUnseen;
|
|
const AdCreativeType = (AdCreativeTypeModule).AdCreativeType;
|
|
const QUEST = AdCreativeType.QUEST;
|
|
return Reflect.apply(markAdContentUnseen, value, [QUEST, [env1_0]]);
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
function useManuallyStartConsoleQuest({questId, preview, beforeRequest, afterRequest}) { // fn#73878, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9669:18480, offset: 0x01d7a010, size: 330 bytes, params: 2, frame: 23
|
|
const afterRequest2 = afterRequest;
|
|
const [property, env0_4] = env0_4Binding(property22.useState([]), 2);
|
|
const value5 = env0_4Binding(property22.useState(false), 2);
|
|
const property2 = value5[0];
|
|
var property22 = property2;
|
|
const env0_6 = value5[1];
|
|
property22.useEffect(_fun73881,
|
|
[(require(566) /* metro dependency 566: flux */).useStateFromStores([ConnectedAccountsStore], function() {
|
|
return ConnectedAccountsStore.getAccounts();
|
|
}), useConsoleQuestUIStore(function(a0) {
|
|
return a0.clearErrorHintsByType;
|
|
}), questId]);
|
|
object = {};
|
|
object.startConsoleQuest = property22.useCallback(afterRequest2(_fun73885), [property2, beforeRequest, afterRequest,
|
|
preview, questId]);
|
|
object.startingConsoleQuest = property2;
|
|
object.errorHints = property;
|
|
return object;
|
|
function _fun73881() { // fn#73881, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9669:18733, offset: 0x01d7a178, size: 74 bytes, params: 1, frame: 15
|
|
let binding = env0_4;
|
|
binding(function(a0) {
|
|
return a0.filter(_fun73883);
|
|
});
|
|
binding = env0_7;
|
|
const questIdBinding = questId;
|
|
const QuestConsoleStartError = (QuestConsoleStartErrorModule).QuestConsoleStartError;
|
|
const EXPIRED_CREDENTIAL = QuestConsoleStartError.EXPIRED_CREDENTIAL;
|
|
binding(questIdBinding, EXPIRED_CREDENTIAL);
|
|
function _fun73882(a0) { // fn#73882, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9669:18741, offset: 0x01d7a1c2, size: 24 bytes, params: 2, frame: 11
|
|
return a0.filter(function({type}) {
|
|
return type !== require(dependencyMap[40]).QuestConsoleStartError.EXPIRED_CREDENTIAL;
|
|
});
|
|
function _fun73883({type}) { // fn#73883, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9669:18754, offset: 0x01d7a1da, size: 51 bytes, params: 2, frame: 12
|
|
const QuestConsoleStartError = (QuestConsoleStartErrorModule).QuestConsoleStartError;
|
|
const EXPIRED_CREDENTIAL = QuestConsoleStartError.EXPIRED_CREDENTIAL;
|
|
return type !== EXPIRED_CREDENTIAL;
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
function* _fun73885() { // fn#73885, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9669:18926, offset: 0x01d7a218, size: 352 bytes, params: 1, frame: 20
|
|
var errorHints;
|
|
var r3;
|
|
var binding;
|
|
var binding2;
|
|
var property;
|
|
var value6;
|
|
var manuallyStartConsoleQuest;
|
|
var value7;
|
|
var value8;
|
|
var value9;
|
|
var error;
|
|
if (false) {
|
|
return undefined;
|
|
}
|
|
value = undefined;
|
|
if (!env1_5) {
|
|
var value4 = null;
|
|
if (value4 != dependencyMap) {
|
|
dependencyMap();
|
|
}
|
|
LocaleStore(true);
|
|
try {
|
|
binding = env2_0;
|
|
} catch (error) {
|
|
r3 = value4;
|
|
LocaleStore(false);
|
|
if (value4 != env1_3) {
|
|
binding = env1_3;
|
|
errorHints = value4 == r3 ? value : r3.errorHints;
|
|
r3 = value4 != errorHints ? errorHints : [];
|
|
binding(r3);
|
|
}
|
|
throw error;
|
|
}
|
|
try {
|
|
binding2 = env2_2;
|
|
} catch (error) {
|
|
r3 = value4;
|
|
LocaleStore(false);
|
|
if (value4 != env1_3) {
|
|
binding = env1_3;
|
|
errorHints = value4 == r3 ? value : r3.errorHints;
|
|
r3 = value4 != errorHints ? errorHints : [];
|
|
binding(r3);
|
|
}
|
|
throw error;
|
|
}
|
|
try {
|
|
property = binding2[15];
|
|
} catch (error) {
|
|
r3 = value4;
|
|
LocaleStore(false);
|
|
if (value4 != env1_3) {
|
|
binding = env1_3;
|
|
errorHints = value4 == r3 ? value : r3.errorHints;
|
|
r3 = value4 != errorHints ? errorHints : [];
|
|
binding(r3);
|
|
}
|
|
throw error;
|
|
}
|
|
try {
|
|
value6 = binding(property);
|
|
} catch (error) {
|
|
r3 = value4;
|
|
LocaleStore(false);
|
|
if (value4 != env1_3) {
|
|
binding = env1_3;
|
|
errorHints = value4 == r3 ? value : r3.errorHints;
|
|
r3 = value4 != errorHints ? errorHints : [];
|
|
binding(r3);
|
|
}
|
|
throw error;
|
|
}
|
|
try {
|
|
manuallyStartConsoleQuest = value6.manuallyStartConsoleQuest;
|
|
} catch (error) {
|
|
r3 = value4;
|
|
LocaleStore(false);
|
|
if (value4 != env1_3) {
|
|
binding = env1_3;
|
|
errorHints = value4 == r3 ? value : r3.errorHints;
|
|
r3 = value4 != errorHints ? errorHints : [];
|
|
binding(r3);
|
|
}
|
|
throw error;
|
|
}
|
|
try {
|
|
} catch (error) {
|
|
r3 = value4;
|
|
LocaleStore(false);
|
|
if (value4 != env1_3) {
|
|
binding = env1_3;
|
|
errorHints = value4 == r3 ? value : r3.errorHints;
|
|
r3 = value4 != errorHints ? errorHints : [];
|
|
binding(r3);
|
|
}
|
|
throw error;
|
|
}
|
|
try {
|
|
} catch (error) {
|
|
r3 = value4;
|
|
LocaleStore(false);
|
|
if (value4 != env1_3) {
|
|
binding = env1_3;
|
|
errorHints = value4 == r3 ? value : r3.errorHints;
|
|
r3 = value4 != errorHints ? errorHints : [];
|
|
binding(r3);
|
|
}
|
|
throw error;
|
|
}
|
|
try {
|
|
value7 = Reflect.apply(manuallyStartConsoleQuest, value6, [require, importDefault]);
|
|
} catch (error) {
|
|
r3 = value4;
|
|
LocaleStore(false);
|
|
if (value4 != env1_3) {
|
|
binding = env1_3;
|
|
errorHints = value4 == r3 ? value : r3.errorHints;
|
|
r3 = value4 != errorHints ? errorHints : [];
|
|
binding(r3);
|
|
}
|
|
throw error;
|
|
}
|
|
yield value7;
|
|
try {
|
|
value8 = undefined;
|
|
value9 = false;
|
|
} catch (error) {
|
|
r3 = value4;
|
|
LocaleStore(false);
|
|
if (value4 != env1_3) {
|
|
binding = env1_3;
|
|
errorHints = value4 == r3 ? value : r3.errorHints;
|
|
r3 = value4 != errorHints ? errorHints : [];
|
|
binding(r3);
|
|
}
|
|
throw error;
|
|
}
|
|
if (value9) {
|
|
LocaleStore(false);
|
|
if (value4 != env1_3) {
|
|
binding = env1_3;
|
|
errorHints = value4 == value4 ? value : value4.errorHints;
|
|
binding(value4 != errorHints ? errorHints : []);
|
|
}
|
|
return value8;
|
|
}
|
|
try {
|
|
binding = env1_4;
|
|
} catch (error) {
|
|
r3 = value8;
|
|
LocaleStore(false);
|
|
if (value4 != env1_3) {
|
|
binding = env1_3;
|
|
errorHints = value4 == r3 ? value : r3.errorHints;
|
|
r3 = value4 != errorHints ? errorHints : [];
|
|
binding(r3);
|
|
}
|
|
throw error;
|
|
}
|
|
try {
|
|
errorHints = value8.errorHints;
|
|
} catch (error) {
|
|
r3 = value8;
|
|
LocaleStore(false);
|
|
if (value4 != env1_3) {
|
|
binding = env1_3;
|
|
errorHints = value4 == r3 ? value : r3.errorHints;
|
|
r3 = value4 != errorHints ? errorHints : [];
|
|
binding(r3);
|
|
}
|
|
throw error;
|
|
}
|
|
try {
|
|
binding(errorHints);
|
|
} catch (error) {
|
|
r3 = value8;
|
|
LocaleStore(false);
|
|
if (value4 != env1_3) {
|
|
binding = env1_3;
|
|
errorHints = value4 == r3 ? value : r3.errorHints;
|
|
r3 = value4 != errorHints ? errorHints : [];
|
|
binding(r3);
|
|
}
|
|
throw error;
|
|
}
|
|
LocaleStore(false);
|
|
if (value4 != env1_3) {
|
|
binding = env1_3;
|
|
errorHints = value4 == value8 ? value : value8.errorHints;
|
|
binding(value4 != errorHints ? errorHints : []);
|
|
}
|
|
}
|
|
return value;
|
|
}
|
|
|
|
}
|
|
|
|
function useQuestHowToHelpArticle() { // fn#73886, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9669:19274, offset: 0x01d7a378, size: 288 bytes, params: 1, frame: 22
|
|
const {xboxAccounts, playstationAccounts} = useConnectedAccounts();
|
|
const value3 = xboxAccounts.length > 0;
|
|
const value4 = playstationAccounts.length > 0;
|
|
const defaultImport = HelpdeskUtils;
|
|
let getArticleURL = defaultImport.getArticleURL;
|
|
const QUEST_HOW_TO_PLAYSTATION = HelpdeskArticles.QUEST_HOW_TO_PLAYSTATION;
|
|
const value5 = Reflect.apply(getArticleURL, defaultImport, [QUEST_HOW_TO_PLAYSTATION]);
|
|
const defaultImport2 = defaultImport;
|
|
getArticleURL = defaultImport2.getArticleURL;
|
|
const QUEST_HOW_TO_XBOX = HelpdeskArticles.QUEST_HOW_TO_XBOX;
|
|
const value6 = Reflect.apply(getArticleURL, defaultImport2, [QUEST_HOW_TO_XBOX]);
|
|
const intl = (IndexNativeModule).intl;
|
|
let format = intl.format;
|
|
const t = (IndexNativeModule).t;
|
|
const value = Reflect.apply(format, intl, [t.beN4DG, {psHelpdeskArticle: value5, xboxHelpdeskArticle: value6}]);
|
|
format = intl.format;
|
|
const HVS7nh = t.HVS7nh;
|
|
const value7 = Reflect.apply(format, intl, [HVS7nh, {helpdeskArticle: value4 ? value5 : value6}]);
|
|
return {message: value3 ? value4 ? value3 ? value : value4 ? value7 : value : value7 : value3 ? value : value4 ? value7 : value,
|
|
xboxURL: value6, playstationURL: value5};
|
|
}
|
|
|
|
function useProgressState(a0) { // fn#73887, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9669:19735, offset: 0x01d7a498, size: 177 bytes, params: 2, frame: 16
|
|
let userStatus = a0.userStatus;
|
|
const value = undefined;
|
|
const value2 = (userStatus == null ? value : userStatus.enrolledAt) != null;
|
|
userStatus = a0.userStatus;
|
|
const value3 = (userStatus == null ? value : userStatus.completedAt) != null;
|
|
userStatus = a0.userStatus;
|
|
return (userStatus == null ? value : userStatus.claimedAt) != null ? env0_34.CLAIMED : value3 ? env0_34.COMPLETED : useQuestTaskDetails(a0).percentComplete > 0 && value2 ? env0_34.IN_PROGRESS : value2 ? env0_34.ACCEPTED : env0_34.UNACCEPTED;
|
|
}
|
|
|
|
function useQuestCompletionDetails(a0) { // fn#73888, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9669:20084, offset: 0x01d7a549, size: 244 bytes, params: 2, frame: 20
|
|
var r1;
|
|
let value = a1;
|
|
const value2 = undefined;
|
|
const r7 = value !== value2 ? value : false;
|
|
const locale = (require(566) /* metro dependency 566: flux */).useStateFromStores([LocaleStore], function() {
|
|
return LocaleStore.locale;
|
|
});
|
|
let percentComplete = useQuestTaskDetails(a0).percentComplete;
|
|
const value3 = useThirdPartyTaskDetails(a0);
|
|
percentComplete = value3 != null ? value3.percentComplete : percentComplete;
|
|
object = {completedRatio: percentComplete, percentComplete: 100 * percentComplete};
|
|
if (value3 == null) {
|
|
value = require(1856) /* metro dependency 1856: NumberUtils */;
|
|
value = value.formatPercent(locale, percentComplete, {roundingMode: 'floor'});
|
|
r1 = value;
|
|
} else if (r7) {
|
|
value = require(1856) /* metro dependency 1856: NumberUtils */;
|
|
value = value.formatPercent(locale, percentComplete, {roundingMode: 'floor'});
|
|
r1 = value;
|
|
} else {
|
|
r1 = '' + (value3 == null ? value2 : value3.progress) + '/' + (value3 == null ? value2 : value3.target);
|
|
}
|
|
object.completedRatioDisplay = r1;
|
|
return object;
|
|
}
|
|
|
|
function useQuestWarningTips(a0) { // fn#73890, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9669:20595, offset: 0x01d7a63d, size: 551 bytes, params: 2, frame: 24
|
|
var moduleValue2;
|
|
const intl = (IndexNativeModule).intl;
|
|
const t = (IndexNativeModule).t;
|
|
const value2 = undefined;
|
|
const value3 = useThirdPartyTaskDetails(a0);
|
|
const value4 = useQuestTaskDetails(a0);
|
|
const property = Module00057(useTaskPlatformScreen(a0, value4), 1)[0];
|
|
const value7 = useIsQuestExpired(a0);
|
|
let userStatus = a0.userStatus;
|
|
const value8 = (userStatus == null ? value2 : userStatus.enrolledAt) != null;
|
|
userStatus = a0.userStatus;
|
|
const value9 = (userStatus == null ? value2 : userStatus.completedAt) != null;
|
|
const FirstPartyQuestTaskTypesSets = (require(6535) /* metro dependency 6535: FirstPartyQuestTaskTypes */).FirstPartyQuestTaskTypesSets;
|
|
const DESKTOP = FirstPartyQuestTaskTypesSets.DESKTOP;
|
|
let r0 = DESKTOP.has(value4.taskType) && value4.percentComplete > 0;
|
|
const value12 = value4.percentComplete === 0;
|
|
let r4 = value8 && !value9 && !value7 && value3 == null;
|
|
if (r4) {
|
|
r0 = !r0 ? value12 && property === (require(6531) /* metro dependency 6531: QuestTypes */).TaskPlatformScreen.DESKTOP : r0;
|
|
r4 = r0;
|
|
}
|
|
let r2 = (require(477) /* metro dependency 477: PlatformUtils */).isWeb() && r4;
|
|
if (r2) {
|
|
moduleValue2 = require(9520) /* metro dependency 9520: QuestPlatformUtils */;
|
|
r2 = !moduleValue2.isQuestSupportedOnWeb(a0);
|
|
}
|
|
const items2 = [];
|
|
if ((require(477) /* metro dependency 477: PlatformUtils */).isMac() && value4.taskType === (require(6535) /* metro dependency 6535: FirstPartyQuestTaskTypes */).FirstPartyQuestTaskTypes.STREAM_ON_DESKTOP && r4) {
|
|
items2.push(intl.string(t.MFGxFM));
|
|
}
|
|
if (r2) {
|
|
items2.push(intl.string(t.BV6xDm));
|
|
}
|
|
return items2;
|
|
}
|
|
|
|
function useQuest(a0) { // fn#73891, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9669:21321, offset: 0x01d7a864, size: 84 bytes, params: 2, frame: 13
|
|
const useStateFromStores = FluxModule.useStateFromStores;
|
|
const value = Reflect.apply(useStateFromStores, FluxModule, [[QuestStore], function() {
|
|
return QuestStore.quests;
|
|
}]).get(a0);
|
|
const value2 = null;
|
|
return value2 != value ? value : value2;
|
|
}
|
|
|
|
function useNonNullableQuest(a0, a1) { // fn#73893, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9669:21452, offset: 0x01d7a8b8, size: 136 bytes, params: 3, frame: 19
|
|
const env0_0 = a0;
|
|
const env0_1 = a1;
|
|
const value2 = (FluxModule).useStateFromStores([QuestStore], _fun73894, [a0]);
|
|
const value3 = null;
|
|
const r0 = value3 != value2 ? value2 : value3;
|
|
ReactModule.useEffect(_fun73895, [r0, a0, a1]);
|
|
return r0;
|
|
function _fun73894() { // fn#73894, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9669:21537, offset: 0x01d7a940, size: 27 bytes, params: 1, frame: 11
|
|
return QuestStore.getQuest(env0_0);
|
|
}
|
|
|
|
function _fun73895() { // fn#73895, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9669:21589, offset: 0x01d7a95b, size: 235 bytes, params: 1, frame: 22
|
|
var value2;
|
|
var value3;
|
|
var items2;
|
|
var moduleValue;
|
|
var captureQuestsException;
|
|
var Error;
|
|
var binding;
|
|
var value4;
|
|
if (env0_2 == null) {
|
|
value2 = environment.__proto__;
|
|
value3 = QuestStore.quests.keys();
|
|
items2 = [];
|
|
arraySpread(items2, value3, 0, undefined);
|
|
moduleValue = require(7091) /* metro dependency 7091: QuestDataUtils */;
|
|
captureQuestsException = moduleValue.captureQuestsException;
|
|
Error = global.Error;
|
|
binding = env0_0;
|
|
value4 = 'Quest unexpectedly missing from store: ' + binding;
|
|
Reflect.apply(captureQuestsException, moduleValue, [new Error(), {tags: {source: 'useNonNullableQuest'},
|
|
extra: {questId: binding, storeQuestIds: items2, storeSize: items2.length,
|
|
isFetchingCurrentQuests: QuestStore.isFetchingCurrentQuests,
|
|
lastFetchedCurrentQuests: QuestStore.lastFetchedCurrentQuests}}]);
|
|
if (require != null) {
|
|
require();
|
|
}
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
function useQuestBarOrDockModeChangeTracking({mode, questContent, sourceQuestContent, questId}) { // fn#73896, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9669:21984, offset: 0x01d7aa46, size: 151 bytes, params: 2, frame: 19
|
|
const env0_4 = ReactModule.useRef(null);
|
|
ReactModule.useEffect(_fun73897, [questId, questContent, mode, sourceQuestContent]);
|
|
ReactModule.useEffect(function() {
|
|
if (questId != null) {
|
|
return _fun73899;
|
|
}
|
|
}, [questId, questContent, sourceQuestContent]);
|
|
function _fun73897() { // fn#73897, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9669:22119, offset: 0x01d7aadd, size: 133 bytes, params: 1, frame: 15
|
|
var modeBinding;
|
|
var value4;
|
|
var moduleValue;
|
|
var trackQuestBarOrDockModeChange;
|
|
var binding;
|
|
if (questId != null && env0_4.current !== mode) {
|
|
value4 = environment.__proto__;
|
|
moduleValue = require(7110) /* metro dependency 7110: AnalyticsActions */;
|
|
trackQuestBarOrDockModeChange = moduleValue.trackQuestBarOrDockModeChange;
|
|
modeBinding = mode;
|
|
binding = env0_4;
|
|
Reflect.apply(trackQuestBarOrDockModeChange, moduleValue, [{mode: modeBinding, prevMode: binding.current,
|
|
questContent: questContent, questId: questId, sourceQuestContent: sourceQuestContent}]);
|
|
binding.current = modeBinding;
|
|
}
|
|
}
|
|
|
|
function _fun73898() { // fn#73898, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9669:22303, offset: 0x01d7ab62, size: 28 bytes, params: 1, frame: 2
|
|
if (questId != null) {
|
|
return _fun73899;
|
|
}
|
|
function _fun73899() { // fn#73899, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9669:22325, offset: 0x01d7ab7e, size: 90 bytes, params: 1, frame: 14
|
|
const value = environment.__proto__.__proto__;
|
|
(AnalyticsActionsModule).trackQuestBarOrDockModeChange({mode: null,
|
|
prevMode: env1_4.current, questContent: questContent, questId: questId, sourceQuestContent: sourceQuestContent});
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
function useCosponsoredLogotypeAsset(a0, a1) { // fn#73900, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9669:22492, offset: 0x01d7abd8, size: 148 bytes, params: 3, frame: 20
|
|
const env0_0 = a0;
|
|
const env0_1 = a1;
|
|
return ReactModule.useMemo(_fun73902, [(UseTheme)(), a1,
|
|
(FluxModule).useStateFromStores([QuestStore], _fun73901, [a0])]);
|
|
function _fun73901() { // fn#73901, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9669:22574, offset: 0x01d7a940, size: 27 bytes, params: 1, frame: 11
|
|
return QuestStore.getQuest(env0_0);
|
|
}
|
|
|
|
function _fun73902() { // fn#73902, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9669:22629, offset: 0x01d7ac6c, size: 156 bytes, params: 1, frame: 19
|
|
if (env0_2 == null) {
|
|
return null;
|
|
}
|
|
const r5 = require ?? ((require(4002) /* metro dependency 4002: shared */).isThemeDark(Module00005) ? ThemeTypes.DARK : ThemeTypes.LIGHT);
|
|
const getQuestAsset = AssetUtilsModule.getQuestAsset;
|
|
const binding = env0_2;
|
|
const QuestAssetType = AssetUtilsModule.QuestAssetType;
|
|
const COSPONSOR_LOGO_TYPE = QuestAssetType.COSPONSOR_LOGO_TYPE;
|
|
return Reflect.apply(getQuestAsset, AssetUtilsModule, [binding, COSPONSOR_LOGO_TYPE, r5]);
|
|
}
|
|
|
|
}
|
|
|
|
function useClaimedCollectibleRewardMessage(a0) { // fn#73903, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9669:22844, offset: 0x01d7ad08, size: 610 bytes, params: 2, frame: 26
|
|
const intl = (IndexNativeModule).intl;
|
|
const t = (IndexNativeModule).t;
|
|
const currentUser = (require(566) /* metro dependency 566: flux */).useStateFromStores([UserStore], function() {
|
|
return UserStore.getCurrentUser();
|
|
});
|
|
const defaultRewardName = (QuestRewardUtilsModule).getDefaultRewardName(a0,
|
|
currentUser);
|
|
const collectibleQuestRewardDuration = (QuestRewardUtilsModule).getCollectibleQuestRewardDuration(a0);
|
|
const collectibleQuestRewardExtendableExpirationDate = (QuestRewardUtilsModule).getCollectibleQuestRewardExtendableExpirationDate(a0);
|
|
const isCollectibleQuestRewardPermanentWithPremiumSubscription2 = (QuestRewardUtilsModule).isCollectibleQuestRewardPermanentWithPremiumSubscription(a0);
|
|
const isCollectibleQuestRewardPremiumExtendable2 = (QuestRewardUtilsModule).isCollectibleQuestRewardPremiumExtendable(a0);
|
|
const isPremium = PremiumUtilsModule.isPremium;
|
|
const TIER_2 = PremiumTypes.TIER_2;
|
|
const isPremium2 = Reflect.apply(isPremium, PremiumUtilsModule, [currentUser, TIER_2]);
|
|
if (collectibleQuestRewardDuration == null) {
|
|
return intl.formatToPlainString(t.l9uXL8, {decorationName: defaultRewardName});
|
|
}
|
|
const value5 = intl.formatToPlainString(t.o97tNn, {rewardName: defaultRewardName});
|
|
const formatToPlainString = intl.formatToPlainString;
|
|
const PkyRZo = t.PkyRZo;
|
|
return isCollectibleQuestRewardPremiumExtendable2 ? isCollectibleQuestRewardPermanentWithPremiumSubscription2 ? isPremium2 ? value5 : intl.formatToPlainString(t.ie4YK0,
|
|
{rewardName: defaultRewardName,
|
|
duration: collectibleQuestRewardDuration}) : isPremium2 ? Reflect.apply(formatToPlainString, intl, [PkyRZo,
|
|
{rewardName: defaultRewardName,
|
|
expirationDate: collectibleQuestRewardExtendableExpirationDate}]) : intl.formatToPlainString(t.yCpc0U,
|
|
{duration: collectibleQuestRewardDuration, rewardName: defaultRewardName}) : intl.formatToPlainString(t.tTlItm,
|
|
{duration: collectibleQuestRewardDuration, decorationName: defaultRewardName});
|
|
}
|
|
|
|
function useLaunchInGameActivityQuest(a0) { // fn#73905, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9669:23835, offset: 0x01d7af6a, size: 77 bytes, params: 2, frame: 14
|
|
const activityApplicationId = (QuestTaskUtilsModule).getActivityApplicationId(a0);
|
|
const object = {};
|
|
object.launchInGameActivity = (importDefault(9526) /* metro dependency 9526: useRefocusOrLaunchActivity */)({applicationId: activityApplicationId});
|
|
return object;
|
|
}
|
|
|
|
function useShouldShowQuestsActivityPanelItem(a0) { // fn#73907, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9669:24133, offset: 0x01d7afc6, size: 232 bytes, params: 2, frame: 20
|
|
var r0;
|
|
var moduleValue;
|
|
let value = a0;
|
|
const value2 = null;
|
|
const value3 = undefined;
|
|
const userStatus = value2 == value ? value3 : value.userStatus;
|
|
const value4 = value2 != userStatus;
|
|
if (value4) {
|
|
moduleValue = require(7091) /* metro dependency 7091: QuestDataUtils */;
|
|
r0 = moduleValue.isDismissed(value.userStatus,
|
|
(require(6531) /* metro dependency 6531: QuestTypes */).QuestContent.ACTIVITY_PANEL);
|
|
} else {
|
|
r0 = value4;
|
|
}
|
|
const value7 = useIsQuestExpired(value2 != value ? value : value2);
|
|
value = value2 != (value2 == value || value2 == value.userStatus ? value3 : value.userStatus.claimedAt);
|
|
const value8 = (require(566) /* metro dependency 566: flux */).useStateFromStores([QuestStore], function() {
|
|
return QuestStore.questEnrollmentBlockedUntil != null;
|
|
}, []);
|
|
r0 = !r0 ? value7 : r0;
|
|
r0 = !r0 ? value : r0;
|
|
r0 = !r0 ? value8 : r0;
|
|
return !r0;
|
|
}
|
|
|
|
function useQuestsWithPreviewAccess() { // fn#73909, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9669:24485, offset: 0x01d7b0ae, size: 94 bytes, params: 1, frame: 15
|
|
return ReactModule.useMemo(_fun73911,
|
|
[(FluxModule).useStateFromStoresArray([QuestStore], _fun73910)]);
|
|
function _fun73910() { // fn#73910, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9669:24535, offset: 0x01d774cb, size: 37 bytes, params: 1, frame: 13
|
|
let value = environment.__proto__;
|
|
value = QuestStore.quests.values();
|
|
const items2 = [];
|
|
arraySpread(items2, value, 0, undefined);
|
|
return items2;
|
|
}
|
|
|
|
function _fun73911() { // fn#73911, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9669:24582, offset: 0x01d7b10c, size: 28 bytes, params: 1, frame: 11
|
|
return env0_0.filter(function(a0) {
|
|
return a0.preview;
|
|
});
|
|
}
|
|
|
|
}
|
|
|
|
function useQuestHomeFilterOptions() { // fn#73913, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9669:24647, offset: 0x01d7b128, size: 45 bytes, params: 1, frame: 14
|
|
return ReactModule.useMemo(function() {
|
|
return SORTED_QUEST_HOME_FILTER_GROUPS.map(_fun73915);
|
|
}, [SORTED_QUEST_HOME_FILTER_GROUPS]);
|
|
function _fun73914() { // fn#73914, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9669:24710, offset: 0x01d7b155, size: 28 bytes, params: 1, frame: 11
|
|
return SORTED_QUEST_HOME_FILTER_GROUPS.map(function(a0) {
|
|
var r0;
|
|
var r1;
|
|
var r2;
|
|
var item3;
|
|
var value3;
|
|
var iterator = a0[Symbol.iterator]();
|
|
var iterator2 = iterator.next;
|
|
var item2 = Reflect.apply(iterator2, iterator, []);
|
|
var item = item2.value;
|
|
item2 = item2.done ? undefined : iterator;
|
|
var value = undefined;
|
|
var value2 = item2 === value;
|
|
var r4 = value2 ? value : item;
|
|
if (value2) {
|
|
r0 = item2;
|
|
r1 = value;
|
|
r2 = value2;
|
|
} else {
|
|
item3 = Reflect.apply(iterator2, item2, []);
|
|
item = item3.value;
|
|
item3 = item3.done ? undefined : item2;
|
|
value3 = item3 === value;
|
|
if (value3) {
|
|
r0 = item3;
|
|
r1 = value;
|
|
r2 = value3;
|
|
} else {
|
|
r0 = item3;
|
|
r1 = item;
|
|
r2 = value3;
|
|
}
|
|
}
|
|
if (!r2) {
|
|
r0.return();
|
|
}
|
|
var object = {};
|
|
object.heading = require(dependencyMap[37]).getFilterGroupHeadingText(r4);
|
|
object.options = r1;
|
|
return object;
|
|
});
|
|
function _fun73915(a0) { // fn#73915, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9669:24721, offset: 0x01d7b171, size: 110 bytes, params: 2, frame: 16
|
|
var r0;
|
|
var r1;
|
|
var r2;
|
|
var item3;
|
|
var value3;
|
|
const iterator = a0[Symbol.iterator]();
|
|
const iterator2 = iterator.next;
|
|
let item2 = Reflect.apply(iterator2, iterator, []);
|
|
let item = item2.value;
|
|
item2 = item2.done ? undefined : iterator;
|
|
const value = undefined;
|
|
const value2 = item2 === value;
|
|
const r4 = value2 ? value : item;
|
|
if (value2) {
|
|
r0 = item2;
|
|
r1 = value;
|
|
r2 = value2;
|
|
} else {
|
|
item3 = Reflect.apply(iterator2, item2, []);
|
|
item = item3.value;
|
|
item3 = item3.done ? undefined : item2;
|
|
value3 = item3 === value;
|
|
if (value3) {
|
|
r0 = item3;
|
|
r1 = value;
|
|
r2 = value3;
|
|
} else {
|
|
r0 = item3;
|
|
r1 = item;
|
|
r2 = value3;
|
|
}
|
|
}
|
|
if (!r2) {
|
|
r0.return();
|
|
}
|
|
const object = {};
|
|
object.heading = (require(9505) /* metro dependency 9505: QuestCopyUtils */).getFilterGroupHeadingText(r4);
|
|
object.options = r1;
|
|
return object;
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
function useQuestHomeSortOptions() { // fn#73916, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9669:24827, offset: 0x01d7b1df, size: 33 bytes, params: 1, frame: 13
|
|
return ReactModule.useMemo(_fun73917, []);
|
|
function _fun73917() { // fn#73917, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9669:24880, offset: 0x01d7b200, size: 46 bytes, params: 1, frame: 11
|
|
var environment;
|
|
const Object = global.Object;
|
|
const keys = Object.keys;
|
|
const value = environment.__proto__;
|
|
return Reflect.apply(keys, Object, [QuestHomeSortMethods]).map(function(a0) {
|
|
var object = {};
|
|
object.label = require(dependencyMap[37]).getSortMethodText(QuestHomeSortMethods[a0]);
|
|
object.value = QuestHomeSortMethods[a0];
|
|
return object;
|
|
});
|
|
}
|
|
|
|
}
|
|
|
|
function useQuestHomeSortingFilteringAnalytics({selectedSortMethod, selectedFilters, numQuestsVisible}) { // fn#73919, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9669:25011, offset: 0x01d7b271, size: 144 bytes, params: 2, frame: 17
|
|
const env0_3 = ReactModule.useRef(null);
|
|
const env0_4 = ReactModule.useRef(null);
|
|
ReactModule.useEffect(_fun73920, [selectedSortMethod]);
|
|
ReactModule.useEffect(_fun73921, [selectedFilters, numQuestsVisible]);
|
|
function _fun73920() { // fn#73920, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9669:25176, offset: 0x01d7b301, size: 86 bytes, params: 1, frame: 17
|
|
const defaultImport = AnalyticsUtils;
|
|
const track = defaultImport.track;
|
|
const QUEST_HOME_SORT_METHOD_CHANGED = AnalyticEvents.QUEST_HOME_SORT_METHOD_CHANGED;
|
|
const selectedSortMethodBinding = selectedSortMethod;
|
|
const binding = env0_3;
|
|
Reflect.apply(track, defaultImport, [QUEST_HOME_SORT_METHOD_CHANGED, {sort_method: selectedSortMethodBinding,
|
|
previous_sort_method: binding.current}]);
|
|
binding.current = selectedSortMethodBinding;
|
|
}
|
|
|
|
function _fun73921() { // fn#73921, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9669:25309, offset: 0x01d7b357, size: 128 bytes, params: 1, frame: 18
|
|
const value2 = selectedFilters.map(function(a0) {
|
|
return a0.filter;
|
|
});
|
|
const defaultImport = AnalyticsUtils;
|
|
const track = defaultImport.track;
|
|
const QUEST_HOME_FILTERS_CHANGED = AnalyticEvents.QUEST_HOME_FILTERS_CHANGED;
|
|
Reflect.apply(track, defaultImport, [QUEST_HOME_FILTERS_CHANGED, {filters: value2,
|
|
previous_filters: env0_4.current ?? [], num_quests_visible: numQuestsVisible}]);
|
|
env0_4.current = value2;
|
|
}
|
|
|
|
}
|
|
|
|
function useShouldShowQuestPreviewOverrides(a0) { // fn#73923, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9669:25523, offset: 0x01d7b3e1, size: 45 bytes, params: 2, frame: 13
|
|
return ReactModule.useMemo(_fun73924, []) || a0.preview;
|
|
function _fun73924() { // fn#73924, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9669:25537, offset: 0x01d7b40e, size: 45 bytes, params: 1, frame: 10
|
|
var r1;
|
|
let value = environment.__proto__;
|
|
value = UserStore.getCurrentUser();
|
|
if (value == null) {
|
|
r1 = undefined;
|
|
} else {
|
|
value = value.isStaff();
|
|
r1 = value;
|
|
}
|
|
return r1 === true;
|
|
}
|
|
|
|
}
|
|
|
|
function useFetchQuestHomeBounties() { // fn#73925, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9669:25702, offset: 0x01d7b43b, size: 424 bytes, params: 1, frame: 21
|
|
const value = a0;
|
|
const previewAdCreativeIds = (value !== undefined ? value : {}).previewAdCreativeIds;
|
|
var env0_4Binding = undefined;
|
|
const QuestHomeBountiesExperiment = (QuestHomeBountiesExperimentModule).QuestHomeBountiesExperiment;
|
|
let useConfig = QuestHomeBountiesExperiment.useConfig;
|
|
let QUEST_HOME_MOBILE = QuestsExperimentLocations.QUEST_HOME_MOBILE;
|
|
const enabled = Reflect.apply(useConfig, QuestHomeBountiesExperiment, [{location: QUEST_HOME_MOBILE}]).enabled;
|
|
const BountyStaleRefreshQuestHomeExperiment = (ExperimentsModule).BountyStaleRefreshQuestHomeExperiment;
|
|
useConfig = BountyStaleRefreshQuestHomeExperiment.useConfig;
|
|
QUEST_HOME_MOBILE = QuestsExperimentLocations.QUEST_HOME_MOBILE;
|
|
const enabled2 = Reflect.apply(useConfig, BountyStaleRefreshQuestHomeExperiment,
|
|
[{location: QUEST_HOME_MOBILE}]).enabled;
|
|
const value2 = (UseVideoModalPlacementEnabledModule).useVideoModalPlacementEnabled('useFetchQuestHomeBounties');
|
|
const QuestPlacement = (QuestTypesModule).QuestPlacement;
|
|
const r8 = value2 ? QuestPlacement.VIDEO_MODAL_MOBILE : QuestPlacement.QUEST_HOME_MOBILE_CAROUSEL;
|
|
var [property, env0_4] = env0_4Binding(ReactModule.useState(enabled), 2);
|
|
const {isFetching,
|
|
questHomeBounties} = (require(566) /* metro dependency 566: flux */).useStateFromStoresObject([BountyStore],
|
|
function() {
|
|
var bountyStoreBinding = BountyStore;
|
|
return {isFetching: bountyStoreBinding.isFetchingQuestHomeBounties,
|
|
questHomeBounties: bountyStoreBinding.questHomeBounties};
|
|
});
|
|
ReactModule.useEffect(_fun73927, [enabled, enabled2, previewAdCreativeIds, r8]);
|
|
object = {};
|
|
if (enabled) {
|
|
object.questHomeBounties = questHomeBounties;
|
|
object.isLoading = property || isFetching;
|
|
} else {
|
|
object.questHomeBounties = [];
|
|
object.isLoading = false;
|
|
}
|
|
return object;
|
|
function _fun73927() { // fn#73927, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9669:26354, offset: 0x01d7b604, size: 117 bytes, params: 1, frame: 14
|
|
var environment;
|
|
var window;
|
|
var setInterval;
|
|
if (enabled) {
|
|
(function() {
|
|
return _loadBounties.apply(this, arguments);
|
|
})();
|
|
if (enabled) {
|
|
window = global.window;
|
|
setInterval = window.setInterval;
|
|
value = environment.__proto__;
|
|
var env0_2 = Reflect.apply(setInterval, window, [_fun73933, MINUTE]);
|
|
return _fun73934;
|
|
}
|
|
return function() {
|
|
env0_0 = true;
|
|
};
|
|
}
|
|
function _loadBounties() { // fn#73929, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9669:26591, offset: 0x01d7b679, size: 53 bytes, params: 1, frame: 13
|
|
var environment;
|
|
const value = environment.__proto__.__proto__;
|
|
return env2_3(_fun73931).apply(this, arguments);
|
|
function* _fun73931() { // fn#73931, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9669:26640, offset: 0x01d7b6b9, size: 259 bytes, params: 1, frame: 16
|
|
var value4;
|
|
var length;
|
|
var value5;
|
|
var value6;
|
|
var binding;
|
|
var binding2;
|
|
var property;
|
|
var value7;
|
|
var fetchQuestHomeBounties;
|
|
var questHomeBounties;
|
|
var value8;
|
|
var value9;
|
|
var value10;
|
|
var binding3;
|
|
var value11;
|
|
var fetchBountyPreview;
|
|
var bountyPreview;
|
|
var value12;
|
|
var value13;
|
|
var error;
|
|
if (true) {
|
|
var Date = global.Date;
|
|
value = Date.now();
|
|
value = environment.__proto__.__proto__.__proto__;
|
|
try {
|
|
} catch (error) {
|
|
if (previewAdCreativeIds) {
|
|
throw error;
|
|
}
|
|
env3_4(false);
|
|
throw error;
|
|
}
|
|
try {
|
|
value4 = require == null;
|
|
} catch (error) {
|
|
if (previewAdCreativeIds) {
|
|
throw error;
|
|
}
|
|
env3_4(false);
|
|
throw error;
|
|
}
|
|
if (value4) {
|
|
value6 = environment.__proto__.__proto__.__proto__.__proto__;
|
|
try {
|
|
binding = env4_0;
|
|
} catch (error) {
|
|
if (previewAdCreativeIds) {
|
|
throw error;
|
|
}
|
|
env3_4(false);
|
|
throw error;
|
|
}
|
|
try {
|
|
binding2 = env4_2;
|
|
} catch (error) {
|
|
if (previewAdCreativeIds) {
|
|
throw error;
|
|
}
|
|
env3_4(false);
|
|
throw error;
|
|
}
|
|
try {
|
|
property = binding2[54];
|
|
} catch (error) {
|
|
if (previewAdCreativeIds) {
|
|
throw error;
|
|
}
|
|
env3_4(false);
|
|
throw error;
|
|
}
|
|
try {
|
|
value7 = binding(property);
|
|
} catch (error) {
|
|
if (previewAdCreativeIds) {
|
|
throw error;
|
|
}
|
|
env3_4(false);
|
|
throw error;
|
|
}
|
|
try {
|
|
fetchQuestHomeBounties = value7.fetchQuestHomeBounties;
|
|
} catch (error) {
|
|
if (previewAdCreativeIds) {
|
|
throw error;
|
|
}
|
|
env3_4(false);
|
|
throw error;
|
|
}
|
|
try {
|
|
binding = env3_3;
|
|
} catch (error) {
|
|
if (previewAdCreativeIds) {
|
|
throw error;
|
|
}
|
|
env3_4(false);
|
|
throw error;
|
|
}
|
|
try {
|
|
questHomeBounties = Reflect.apply(fetchQuestHomeBounties, value7, [binding]);
|
|
} catch (error) {
|
|
if (previewAdCreativeIds) {
|
|
throw error;
|
|
}
|
|
env3_4(false);
|
|
throw error;
|
|
}
|
|
yield questHomeBounties;
|
|
try {
|
|
value8 = undefined;
|
|
value9 = false;
|
|
} catch (error) {
|
|
if (previewAdCreativeIds) {
|
|
throw error;
|
|
}
|
|
env3_4(false);
|
|
throw error;
|
|
}
|
|
if (value9) {
|
|
if (!previewAdCreativeIds) {
|
|
env3_4(false);
|
|
}
|
|
return value8;
|
|
}
|
|
if (!previewAdCreativeIds) {
|
|
env3_4(false);
|
|
}
|
|
} else {
|
|
try {
|
|
} catch (error) {
|
|
if (previewAdCreativeIds) {
|
|
throw error;
|
|
}
|
|
env3_4(false);
|
|
throw error;
|
|
}
|
|
try {
|
|
length = require.length;
|
|
} catch (error) {
|
|
if (previewAdCreativeIds) {
|
|
throw error;
|
|
}
|
|
env3_4(false);
|
|
throw error;
|
|
}
|
|
try {
|
|
value5 = length > 0;
|
|
} catch (error) {
|
|
if (previewAdCreativeIds) {
|
|
throw error;
|
|
}
|
|
env3_4(false);
|
|
throw error;
|
|
}
|
|
if (value5) {
|
|
value10 = environment.__proto__.__proto__.__proto__.__proto__;
|
|
try {
|
|
binding = env4_0;
|
|
} catch (error) {
|
|
if (previewAdCreativeIds) {
|
|
throw error;
|
|
}
|
|
env3_4(false);
|
|
throw error;
|
|
}
|
|
try {
|
|
binding3 = env4_2;
|
|
} catch (error) {
|
|
if (previewAdCreativeIds) {
|
|
throw error;
|
|
}
|
|
env3_4(false);
|
|
throw error;
|
|
}
|
|
try {
|
|
property = binding3[54];
|
|
} catch (error) {
|
|
if (previewAdCreativeIds) {
|
|
throw error;
|
|
}
|
|
env3_4(false);
|
|
throw error;
|
|
}
|
|
try {
|
|
value11 = binding(property);
|
|
} catch (error) {
|
|
if (previewAdCreativeIds) {
|
|
throw error;
|
|
}
|
|
env3_4(false);
|
|
throw error;
|
|
}
|
|
try {
|
|
fetchBountyPreview = value11.fetchBountyPreview;
|
|
} catch (error) {
|
|
if (previewAdCreativeIds) {
|
|
throw error;
|
|
}
|
|
env3_4(false);
|
|
throw error;
|
|
}
|
|
try {
|
|
} catch (error) {
|
|
if (previewAdCreativeIds) {
|
|
throw error;
|
|
}
|
|
env3_4(false);
|
|
throw error;
|
|
}
|
|
try {
|
|
bountyPreview = Reflect.apply(fetchBountyPreview, value11, [require]);
|
|
} catch (error) {
|
|
if (previewAdCreativeIds) {
|
|
throw error;
|
|
}
|
|
env3_4(false);
|
|
throw error;
|
|
}
|
|
yield bountyPreview;
|
|
try {
|
|
value12 = undefined;
|
|
value13 = false;
|
|
} catch (error) {
|
|
if (previewAdCreativeIds) {
|
|
throw error;
|
|
}
|
|
env3_4(false);
|
|
throw error;
|
|
}
|
|
if (value13) {
|
|
if (!previewAdCreativeIds) {
|
|
env3_4(false);
|
|
}
|
|
return value12;
|
|
}
|
|
if (!previewAdCreativeIds) {
|
|
env3_4(false);
|
|
}
|
|
return undefined;
|
|
}
|
|
try {
|
|
binding = env4_0;
|
|
} catch (error) {
|
|
if (previewAdCreativeIds) {
|
|
throw error;
|
|
}
|
|
env3_4(false);
|
|
throw error;
|
|
}
|
|
try {
|
|
binding2 = env4_2;
|
|
} catch (error) {
|
|
if (previewAdCreativeIds) {
|
|
throw error;
|
|
}
|
|
env3_4(false);
|
|
throw error;
|
|
}
|
|
try {
|
|
property = binding2[54];
|
|
} catch (error) {
|
|
if (previewAdCreativeIds) {
|
|
throw error;
|
|
}
|
|
env3_4(false);
|
|
throw error;
|
|
}
|
|
try {
|
|
value7 = binding(property);
|
|
} catch (error) {
|
|
if (previewAdCreativeIds) {
|
|
throw error;
|
|
}
|
|
env3_4(false);
|
|
throw error;
|
|
}
|
|
try {
|
|
fetchQuestHomeBounties = value7.fetchQuestHomeBounties;
|
|
} catch (error) {
|
|
if (previewAdCreativeIds) {
|
|
throw error;
|
|
}
|
|
env3_4(false);
|
|
throw error;
|
|
}
|
|
try {
|
|
binding = env3_3;
|
|
} catch (error) {
|
|
if (previewAdCreativeIds) {
|
|
throw error;
|
|
}
|
|
env3_4(false);
|
|
throw error;
|
|
}
|
|
try {
|
|
questHomeBounties = Reflect.apply(fetchQuestHomeBounties, value7, [binding]);
|
|
} catch (error) {
|
|
if (previewAdCreativeIds) {
|
|
throw error;
|
|
}
|
|
env3_4(false);
|
|
throw error;
|
|
}
|
|
yield questHomeBounties;
|
|
try {
|
|
value8 = undefined;
|
|
value9 = false;
|
|
} catch (error) {
|
|
if (previewAdCreativeIds) {
|
|
throw error;
|
|
}
|
|
env3_4(false);
|
|
throw error;
|
|
}
|
|
if (value9) {
|
|
if (!previewAdCreativeIds) {
|
|
env3_4(false);
|
|
}
|
|
return value8;
|
|
}
|
|
if (!previewAdCreativeIds) {
|
|
env3_4(false);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
function _fun73933() { // fn#73933, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9669:26442, offset: 0x01d7b7bc, size: 53 bytes, params: 1, frame: 10
|
|
const Date = global.Date;
|
|
let value = Date.now();
|
|
value -= env0_1;
|
|
if (value > env2_37) {
|
|
loadBounties();
|
|
}
|
|
}
|
|
|
|
function _fun73934() { // fn#73934, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9669:26489, offset: 0x01d7b7f1, size: 36 bytes, params: 1, frame: 11
|
|
global.window.clearInterval(env0_2);
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
function useQuestHomeBounties() { // fn#73935, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9669:26927, offset: 0x01d7b815, size: 60 bytes, params: 1, frame: 13
|
|
return (require(566) /* metro dependency 566: flux */).useStateFromStoresObject([BountyStore], function() {
|
|
var bountyStoreBinding = BountyStore;
|
|
return {questHomeBounties: bountyStoreBinding.questHomeBounties,
|
|
isFetching: bountyStoreBinding.isFetchingQuestHomeBounties};
|
|
});
|
|
function _fun73936() { // fn#73936, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9669:27006, offset: 0x01d7b851, size: 33 bytes, params: 1, frame: 3
|
|
const bountyStoreBinding = BountyStore;
|
|
return {questHomeBounties: bountyStoreBinding.questHomeBounties,
|
|
isFetching: bountyStoreBinding.isFetchingQuestHomeBounties};
|
|
}
|
|
|
|
}
|
|
|
|
function useQuestBarImpressionSurvey(a0) { // fn#73937, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9669:27127, offset: 0x01d7b872, size: 128 bytes, params: 2, frame: 17
|
|
const env0_0 = a0;
|
|
const value2 = undefined;
|
|
const DropsOptedOut = (UserSettingsModule).DropsOptedOut;
|
|
const value3 = DropsOptedOut.useSetting();
|
|
const userStatus = a0.userStatus;
|
|
return ReactModule.useCallback(_fun73938, [value3, (userStatus == null ? value2 : userStatus.enrolledAt) != null, a0.id]);
|
|
function _fun73938() { // fn#73938, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9669:27287, offset: 0x01d7b8f2, size: 114 bytes, params: 1, frame: 15
|
|
var binding;
|
|
var value2;
|
|
var SurveyActionTypes;
|
|
if (!result) {
|
|
binding = env0_1;
|
|
value2 = environment.__proto__;
|
|
SurveyActionTypes = (require(9534) /* metro dependency 9534: SurveyActionTypes */).SurveyActionTypes;
|
|
(require(9535) /* metro dependency 9535: QualtricsActionCreators */).fireSurveyAction(binding ? SurveyActionTypes.AD_IMPRESSION_QUEST_BAR_OPT_OUT : SurveyActionTypes.AD_IMPRESSION_QUEST_BAR_OPT_IN,
|
|
|
|
{quest_id: env0_0.id});
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
function _fun73775(a0) { // fn#73775, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9669:6563, offset: 0x00e46f8c, size: 10 bytes, params: 2, frame: 1
|
|
return a0.id;
|
|
}
|
|
|
|
function hasEnrolledTimeLapsed(a0, a1) { // fn#73836, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9669:12046, offset: 0x01d791b3, size: 154 bytes, params: 3, frame: 15
|
|
var Date;
|
|
var value5;
|
|
var date;
|
|
let userStatus = a0.userStatus;
|
|
const value = undefined;
|
|
const value2 = (userStatus == null ? value : userStatus.completedAt) != null;
|
|
userStatus = a0.userStatus;
|
|
let r0 = (userStatus == null ? value : userStatus.enrolledAt) != null && !value2;
|
|
if (r0) {
|
|
Date = global.Date;
|
|
value5 = Date.now();
|
|
Date = global.Date;
|
|
userStatus = a0.userStatus;
|
|
date = new Date(userStatus == null ? value : userStatus.enrolledAt);
|
|
date = value5 - date.getTime();
|
|
date = date > a1;
|
|
r0 = date;
|
|
}
|
|
return r0;
|
|
}
|
|
|
|
global.__d(_fun73746, 9483, [5, 57, 31, 1949, 1379, 5040, 1878, 7092, 7094, 7093, 6528, 661, 1880, 566, 9479, 9484,
|
|
477, 9493, 7108, 6531, 7091, 672, 7114, 7116, 7119, 9500, 22, 9511, 9503, 9513, 1948, 9520, 6535, 9522, 7120,
|
|
6777, 9524, 9505, 8461, 7121, 9525, 1244, 1856, 4242, 7110, 4048, 4002, 9495, 3802, 9526, 683, 1360, 9528, 9529,
|
|
9532, 3829, 9534, 9535,
|
|
2]) /* metro module 9483, dependencies: [5, 57, 31, 1949, 1379, 5040, 1878, 7092, 7094, 7093, 6528, 661, 1880, 566, 9479, 9484, 477, 9493, 7108, 6531, 7091, 672, 7114, 7116, 7119, 9500, 22, 9511, 9503, 9513, 1948, 9520, 6535, 9522, 7120, 6777, 9524, 9505, 8461, 7121, 9525, 1244, 1856, 4242, 7110, 4048, 4002, 9495, 3802, 9526, 683, 1360, 9528, 9529, 9532, 3829, 9534, 9535, 2] */;
|