This commit is contained in:
janisslsm committed 2026-07-28 01:06:53 +03:00
1 parent af3b49f756
commit 1781d25a15
22448 files changed
+2731829 -2650550

No files matched your search

@@ -1,11 +1,15 @@
/* Metro module 9523; source: modules/quests/utils/MobileQuestVideoWatchCtaCopy.tsx; dependencies: [7116, 1244, 2] */
import * as FileImportTrackerModule from '../../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
import * as IndexNativeModule from '../../../intl/index.native.tsx'; /* Metro dependency 1244 */
import * as QuestTaskUtilsModule from './QuestTaskUtils.tsx'; /* Metro dependency 7116 */
function _fun74303(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#74303, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9709:6, offset: 0x01d896a8, size: 128 bytes, params: 8, frame: 19
const env0_0 = require;
const closure = formatWatchRemainingDurationShort;
const formatWatchRemainingDurationShort2 = formatWatchRemainingDurationShort;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/quests/utils/MobileQuestVideoWatchCtaCopy.tsx');
exports.formatWatchRemainingDurationShort = closure;
(FileImportTrackerModule).fileFinishedImporting('modules/quests/utils/MobileQuestVideoWatchCtaCopy.tsx');
exports.formatWatchRemainingDurationShort = formatWatchRemainingDurationShort2;
exports.getVideoQuestWatchCtaText = function(a0) {
var value = a0.percentComplete > 0;
var value3 = formatWatchRemainingDurationShort(a0);
@@ -16,39 +20,40 @@ function _fun74303(global, require, importDefault, importAll, module, exports, d
{durationShort: value3}]) : Reflect.apply(formatToPlainString, intl, [t.CHrvqg, {durationShort: value3}]);
};
exports.getVideoQuestWatchCtaAccessibilityLabel = getVideoQuestWatchCtaAccessibilityLabel;
}
function formatWatchRemainingDurationShort(a0) { // fn#74304, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9709:43, offset: 0x01d89728, size: 219 bytes, params: 2, frame: 18
var r0;
const intl = (IndexNativeModule).intl;
var formatToPlainString;
const t = (IndexNativeModule).t;
var object;
var PHhTXX;
const remainingTaskTime = (QuestTaskUtilsModule).getRemainingTaskTime(a0);
const value4 = 60 * remainingTaskTime.minutes + remainingTaskTime.seconds;
if (value4 >= 60) {
formatToPlainString = intl.formatToPlainString;
PHhTXX = t.PHhTXX;
object = {};
object.count = global.Math.round(value4 / 60);
r0 = Reflect.apply(formatToPlainString, intl, [PHhTXX, object]);
} else {
r0 = intl.formatToPlainString(t.rUfeQx, {count: value4});
}
return r0;
}
function formatWatchRemainingDurationShort(a0) { // fn#74304, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9709:43, offset: 0x01d89728, size: 219 bytes, params: 2, frame: 18
var r0;
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
var formatToPlainString;
const t = (require(1244) /* metro dependency 1244: indexNative */).t;
var object2;
var PHhTXX;
const remainingTaskTime = (require(7116) /* metro dependency 7116: QuestTaskUtils */).getRemainingTaskTime(a0);
const value4 = 60 * remainingTaskTime.minutes + remainingTaskTime.seconds;
if (value4 >= 60) {
formatToPlainString = intl.formatToPlainString;
PHhTXX = t.PHhTXX;
object2 = {};
object2.count = global.Math.round(value4 / 60);
r0 = Reflect.apply(formatToPlainString, intl, [PHhTXX, object2]);
} else {
r0 = intl.formatToPlainString(t.rUfeQx, {count: value4});
function getVideoQuestWatchCtaAccessibilityLabel(a0) { // fn#74306, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9709:832, offset: 0x01d8987d, size: 364 bytes, params: 2, frame: 20
const intl = (IndexNativeModule).intl;
const t = (IndexNativeModule).t;
const value = a0.percentComplete > 0;
const {minutes, seconds} = (QuestTaskUtilsModule).getRemainingTaskTime(a0);
const r5 = minutes > 0 && seconds > 0 ? intl.formatToPlainString(t['lW/66D'], {minutes: minutes,
seconds: seconds}) : minutes > 0 ? intl.formatToPlainString(t['SxnF/O'],
{count: minutes}) : intl.formatToPlainString(t['0BZpdi'], {count: seconds});
const formatToPlainString = intl.formatToPlainString;
return value ? Reflect.apply(formatToPlainString, intl, [t['ch+yrN'],
{remainTime: r5}]) : Reflect.apply(formatToPlainString, intl, [t.Bwc5Dg, {remainTime: r5}]);
}
return r0;
}
function getVideoQuestWatchCtaAccessibilityLabel(a0) { // fn#74306, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9709:832, offset: 0x01d8987d, size: 364 bytes, params: 2, frame: 20
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
const t = (require(1244) /* metro dependency 1244: indexNative */).t;
const value = a0.percentComplete > 0;
const {minutes, seconds} = (require(7116) /* metro dependency 7116: QuestTaskUtils */).getRemainingTaskTime(a0);
const r5 = minutes > 0 && seconds > 0 ? intl.formatToPlainString(t['lW/66D'], {minutes: minutes,
seconds: seconds}) : minutes > 0 ? intl.formatToPlainString(t['SxnF/O'],
{count: minutes}) : intl.formatToPlainString(t['0BZpdi'], {count: seconds});
const formatToPlainString = intl.formatToPlainString;
return value ? Reflect.apply(formatToPlainString, intl, [t['ch+yrN'],
{remainTime: r5}]) : Reflect.apply(formatToPlainString, intl, [t.Bwc5Dg, {remainTime: r5}]);
}
global.__d(_fun74303, 9523, [7116, 1244, 2]) /* metro module 9523, dependencies: [7116, 1244, 2] */;
+111 -108
View File
@@ -1,16 +1,18 @@
/* Metro module 9505; source: modules/quests/utils/QuestCopyUtils.tsx; dependencies: [6528, 1244, 7110, 6797, 2] */
import * as FileImportTrackerModule from '../../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
import * as IndexNativeModule from '../../../intl/index.native.tsx'; /* Metro dependency 1244 */
import * as QuestConstantsModule from '../QuestConstants.tsx'; /* Metro dependency 6528 */
import * as ClipboardUtilsNativeModule from '../../../utils/ClipboardUtils.native.tsx'; /* Metro dependency 6797 */
import * as AnalyticsActionsModule from '../lib/analytics/AnalyticsActions.tsx'; /* Metro dependency 7110 */
function _fun74183(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#74183, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9691:6, offset: 0x01d83745, size: 258 bytes, params: 8, frame: 18
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const questConstantsModule = require(6528) /* metro dependency 6528: QuestConstants */;
const env0_2 = questConstantsModule.QuestHomeSortMethods;
const env0_3 = questConstantsModule.RewardFilterTypes;
const env0_4 = questConstantsModule.TaskFilterTypes;
const closure = function(a0) {
return '' + global.location.protocol + '//' + global.location.host + '/quests/' + a0;
};
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/quests/utils/QuestCopyUtils.tsx');
(FileImportTrackerModule).fileFinishedImporting('modules/quests/utils/QuestCopyUtils.tsx');
exports.getContextualEntrypointHeading = getContextualEntrypointHeading;
exports.getDisclosureText = getDisclosureText;
exports.getExternalCtaLabel = function(a0) {
@@ -35,119 +37,120 @@ function _fun74183(global, require, importDefault, importAll, module, exports, d
}
return a0.rewardsConfig.rewards[0];
};
}
function getContextualEntrypointHeading({quest, taskDetails, thirdPartyTaskDetails}) { // fn#74185, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9691:351, offset: 0x01d83885, size: 542 bytes, params: 2, frame: 19
var percentComplete;
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
const t = (require(1244) /* metro dependency 1244: indexNative */).t;
let userStatus = quest.userStatus;
const value = undefined;
if ((userStatus == null ? value : userStatus.completedAt) != null) {
return intl.string(t.BzFeTF);
}
userStatus = quest.userStatus;
if ((userStatus == null ? value : userStatus.enrolledAt) != null) {
percentComplete = taskDetails.percentComplete;
percentComplete = thirdPartyTaskDetails != null ? thirdPartyTaskDetails.percentComplete : percentComplete;
return percentComplete >= 0.75 ? intl.string(t.gvCR4H) : percentComplete >= 0.45 && percentComplete <= 0.55 ? intl.string(t.JNx8sG) : percentComplete > 0 ? intl.string(t.JMbfnc) : intl.string(t['7e5k7L']);
}
const formatToPlainString = intl.formatToPlainString;
const EQa7os = t.EQa7os;
return Reflect.apply(formatToPlainString, intl, [EQa7os, {questName: quest.config.messages.questName}]);
}
function getDisclosureText({isTargetedDisclosure, isContextualDisclosure, isVideoQuest, gamePublisher, gameTitle, cosponsorName}) { // fn#74186, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9691:964, offset: 0x01d83aa3, size: 468 bytes, params: 2, frame: 21
var r0;
var r5;
var r1;
var value;
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
var formatToPlainString;
const t = (require(1244) /* metro dependency 1244: indexNative */).t;
if (isTargetedDisclosure) {
if (isContextualDisclosure) {
r1 = intl.string(t.nPg6f1);
} else {
r5 = cosponsorName == null ? intl.formatToPlainString(t.Piihy1,
{gamePublisher: gamePublisher}) : intl.formatToPlainString(t.DV47Gy, {gamePublisher: gamePublisher,
cosponsorName: cosponsorName});
value = intl.string(t.fEbrT8);
value = '' + r5 + ' ' + value;
r1 = value;
function getContextualEntrypointHeading({quest, taskDetails, thirdPartyTaskDetails}) { // fn#74185, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9691:351, offset: 0x01d83885, size: 542 bytes, params: 2, frame: 19
var percentComplete;
const intl = (IndexNativeModule).intl;
const t = (IndexNativeModule).t;
let userStatus = quest.userStatus;
const value = undefined;
if ((userStatus == null ? value : userStatus.completedAt) != null) {
return intl.string(t.BzFeTF);
}
r0 = r1;
} else {
formatToPlainString = intl.formatToPlainString;
r0 = isVideoQuest ? Reflect.apply(formatToPlainString, intl, [t.rctMRl,
{gamePublisher: gamePublisher}]) : Reflect.apply(formatToPlainString, intl, [t['5bQWNG'],
{gamePublisher: gamePublisher, gameTitle: gameTitle}]);
userStatus = quest.userStatus;
if ((userStatus == null ? value : userStatus.enrolledAt) != null) {
percentComplete = taskDetails.percentComplete;
percentComplete = thirdPartyTaskDetails != null ? thirdPartyTaskDetails.percentComplete : percentComplete;
return percentComplete >= 0.75 ? intl.string(t.gvCR4H) : percentComplete >= 0.45 && percentComplete <= 0.55 ? intl.string(t.JNx8sG) : percentComplete > 0 ? intl.string(t.JMbfnc) : intl.string(t['7e5k7L']);
}
const formatToPlainString = intl.formatToPlainString;
const EQa7os = t.EQa7os;
return Reflect.apply(formatToPlainString, intl, [EQa7os, {questName: quest.config.messages.questName}]);
}
return r0;
}
function getSortMethodText(a0) { // fn#74188, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9691:1627, offset: 0x01d83c8e, size: 316 bytes, params: 2, frame: 15
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
const t = (require(1244) /* metro dependency 1244: indexNative */).t;
const SUGGESTED = QuestHomeSortMethods.SUGGESTED;
if (SUGGESTED === a0) {
return intl.string(t.gBfXPZ);
function getDisclosureText({isTargetedDisclosure, isContextualDisclosure, isVideoQuest, gamePublisher, gameTitle, cosponsorName}) { // fn#74186, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9691:964, offset: 0x01d83aa3, size: 468 bytes, params: 2, frame: 21
var r0;
var r5;
var r1;
var value;
const intl = (IndexNativeModule).intl;
var formatToPlainString;
const t = (IndexNativeModule).t;
if (isTargetedDisclosure) {
if (isContextualDisclosure) {
r1 = intl.string(t.nPg6f1);
} else {
r5 = cosponsorName == null ? intl.formatToPlainString(t.Piihy1,
{gamePublisher: gamePublisher}) : intl.formatToPlainString(t.DV47Gy, {gamePublisher: gamePublisher,
cosponsorName: cosponsorName});
value = intl.string(t.fEbrT8);
value = '' + r5 + ' ' + value;
r1 = value;
}
r0 = r1;
} else {
formatToPlainString = intl.formatToPlainString;
r0 = isVideoQuest ? Reflect.apply(formatToPlainString, intl, [t.rctMRl,
{gamePublisher: gamePublisher}]) : Reflect.apply(formatToPlainString, intl, [t['5bQWNG'],
{gamePublisher: gamePublisher, gameTitle: gameTitle}]);
}
return r0;
}
const MOST_RECENT = QuestHomeSortMethods.MOST_RECENT;
if (MOST_RECENT === a0) {
return intl.string(t.K6oEu2);
}
const EXPIRING_SOON = QuestHomeSortMethods.EXPIRING_SOON;
if (EXPIRING_SOON === a0) {
return intl.string(t.IB22n3);
}
const RECENTLY_ENROLLED = QuestHomeSortMethods.RECENTLY_ENROLLED;
if (RECENTLY_ENROLLED === a0) {
return intl.string(t['BB+2tX']);
}
}
function getFilterTypeText(a0) { // fn#74189, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9691:1954, offset: 0x01d83dca, size: 392 bytes, params: 2, frame: 15
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
const t = (require(1244) /* metro dependency 1244: indexNative */).t;
const VIRTUAL_CURRENCY = RewardFilterTypes.VIRTUAL_CURRENCY;
if (VIRTUAL_CURRENCY === a0) {
return intl.string(t.ElYQFS);
}
const COLLECTIBLE = RewardFilterTypes.COLLECTIBLE;
if (COLLECTIBLE === a0) {
return intl.string(t.Jg17Ut);
function getSortMethodText(a0) { // fn#74188, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9691:1627, offset: 0x01d83c8e, size: 316 bytes, params: 2, frame: 15
const intl = (IndexNativeModule).intl;
const t = (IndexNativeModule).t;
const SUGGESTED = QuestHomeSortMethods.SUGGESTED;
if (SUGGESTED === a0) {
return intl.string(t.gBfXPZ);
}
const MOST_RECENT = QuestHomeSortMethods.MOST_RECENT;
if (MOST_RECENT === a0) {
return intl.string(t.K6oEu2);
}
const EXPIRING_SOON = QuestHomeSortMethods.EXPIRING_SOON;
if (EXPIRING_SOON === a0) {
return intl.string(t.IB22n3);
}
const RECENTLY_ENROLLED = QuestHomeSortMethods.RECENTLY_ENROLLED;
if (RECENTLY_ENROLLED === a0) {
return intl.string(t['BB+2tX']);
}
}
const IN_GAME = RewardFilterTypes.IN_GAME;
if (IN_GAME === a0) {
return intl.string(t['O/J2kr']);
}
const VIDEO = TaskFilterTypes.VIDEO;
if (VIDEO === a0) {
return intl.string(t.e0iISA);
}
const PLAY = TaskFilterTypes.PLAY;
if (PLAY === a0) {
return intl.string(t['1nJR4p']);
function getFilterTypeText(a0) { // fn#74189, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9691:1954, offset: 0x01d83dca, size: 392 bytes, params: 2, frame: 15
const intl = (IndexNativeModule).intl;
const t = (IndexNativeModule).t;
const VIRTUAL_CURRENCY = RewardFilterTypes.VIRTUAL_CURRENCY;
if (VIRTUAL_CURRENCY === a0) {
return intl.string(t.ElYQFS);
}
const COLLECTIBLE = RewardFilterTypes.COLLECTIBLE;
if (COLLECTIBLE === a0) {
return intl.string(t.Jg17Ut);
}
const IN_GAME = RewardFilterTypes.IN_GAME;
if (IN_GAME === a0) {
return intl.string(t['O/J2kr']);
}
const VIDEO = TaskFilterTypes.VIDEO;
if (VIDEO === a0) {
return intl.string(t.e0iISA);
}
const PLAY = TaskFilterTypes.PLAY;
if (PLAY === a0) {
return intl.string(t['1nJR4p']);
}
}
}
function getFilterGroupHeadingText(a0) { // fn#74190, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9691:2338, offset: 0x01d83f52, size: 151 bytes, params: 2, frame: 14
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
const t = (require(1244) /* metro dependency 1244: indexNative */).t;
if (a0 === 'reward') {
return intl.string(t.vjLqAU);
function getFilterGroupHeadingText(a0) { // fn#74190, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9691:2338, offset: 0x01d83f52, size: 151 bytes, params: 2, frame: 14
const intl = (IndexNativeModule).intl;
const t = (IndexNativeModule).t;
if (a0 === 'reward') {
return intl.string(t.vjLqAU);
}
if (a0 === 'task') {
return intl.string(t.Hufmss);
}
}
if (a0 === 'task') {
return intl.string(t.Hufmss);
function copyShareLink(a0, {content, ctaContent, position, impressionId, sourceQuestContent}) { // fn#74192, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9691:2605, offset: 0x01d83ffa, size: 136 bytes, params: 3, frame: 18
(AnalyticsActionsModule).trackQuestContentClicked({questId: a0,
questContent: content, questContentCTA: ctaContent, questContentPosition: position, impressionId: impressionId,
sourceQuestContent: sourceQuestContent});
ClipboardUtilsNativeModule.copy(getQuestUrl(a0));
}
}
function copyShareLink(a0, {content, ctaContent, position, impressionId, sourceQuestContent}) { // fn#74192, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9691:2605, offset: 0x01d83ffa, size: 136 bytes, params: 3, frame: 18
(require(7110) /* metro dependency 7110: AnalyticsActions */).trackQuestContentClicked({questId: a0,
questContent: content, questContentCTA: ctaContent, questContentPosition: position, impressionId: impressionId,
sourceQuestContent: sourceQuestContent});
const clipboardUtilsNativeModule = require(6797) /* metro dependency 6797: ClipboardUtilsNative */;
clipboardUtilsNativeModule.copy(getQuestUrl(a0));
}
global.__d(_fun74183, 9505, [6528, 1244, 7110, 6797,
2]) /* metro module 9505, dependencies: [6528, 1244, 7110, 6797, 2] */;
+363 -354
View File
@@ -1,4 +1,14 @@
/* Metro module 7091; source: modules/quests/utils/QuestDataUtils.tsx; dependencies: [1949, 7092, 7093, 6528, 661, 6531, 1391, 7108, 1216, 2] */
import SentryUtilsNative from '../../../utils/SentryUtils.native.tsx'; /* Metro dependency 1216 */
import LocaleStore from '../../user_settings/LocaleStore.tsx'; /* Metro dependency 1949 */
import BountyStore from '../BountyStore.tsx'; /* Metro dependency 7092 */
import QuestStore from '../QuestStore.tsx'; /* Metro dependency 7093 */
import NewAdRequestBehaviorExperiment from '../experiments/NewAdRequestBehaviorExperiment.tsx'; /* Metro dependency 7108 */
import * as FileImportTrackerModule from '../../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
import * as ConstantsModule from '../../../Constants.tsx'; /* Metro dependency 661 */
import * as QuestConstantsModule from '../QuestConstants.tsx'; /* Metro dependency 6528 */
import * as QuestTypesModule from '../QuestTypes.tsx'; /* Metro dependency 6531 */
function _fun56551(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#56551, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7269:6, offset: 0x013cb5c0, size: 484 bytes, params: 8, frame: 23
const env0_0 = require;
const _arrayLikeToArray_56554 = function(a0, a1) {
@@ -57,7 +67,7 @@ function _fun56551(global, require, importDefault, importAll, module, exports, d
const closure3 = function(a0) {
return isQuestConfigExpired(a0.config);
};
const closure4 = getQuestPlacementFromQuestContent;
const getQuestPlacementFromQuestContent2 = getQuestPlacementFromQuestContent;
const mapQuestAdDecision = function(a0) {
return {questId: a0.questId, adCreativeId: a0.adCreativeId, adDecisionData: a0.adDecisionData,
adContext: a0.adContext, metadataSealed: a0.metadataSealed,
@@ -65,15 +75,7 @@ function _fun56551(global, require, importDefault, importAll, module, exports, d
};
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const localeStore = importDefault(1949) /* metro dependency 1949: LocaleStore */;
const bountyStore = importDefault(7092) /* metro dependency 7092: BountyStore */;
const questStore = importDefault(7093) /* metro dependency 7093: QuestStore */;
const questConstantsModule = require(6528) /* metro dependency 6528: QuestConstants */;
const env0_6 = questConstantsModule.DismissibleQuestContentFlags;
const env0_7 = questConstantsModule.BILLABLE_PLACEMENTS;
const env0_8 = questConstantsModule.EMPTY_AD_DECISION_DATA;
const env0_9 = (require(661) /* metro dependency 661: Constants */).Routes;
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/quests/utils/QuestDataUtils.tsx');
(FileImportTrackerModule).fileFinishedImporting('modules/quests/utils/QuestDataUtils.tsx');
exports.THIRTY_DAYS_MS = 2592000000;
exports.earnedDecisionIsValid = function(a0) {
var r0;
@@ -114,7 +116,7 @@ function _fun56551(global, require, importDefault, importAll, module, exports, d
return value == null || isQuestExpired(value) ? undefined : value;
}
};
exports.getQuestPlacementFromQuestContent = closure4;
exports.getQuestPlacementFromQuestContent = getQuestPlacementFromQuestContent2;
exports.isBillableQuestContent = isBillableQuestContent;
exports.getAdDecisionData = function(a0, a1) {
var r2;
@@ -133,369 +135,376 @@ function _fun56551(global, require, importDefault, importAll, module, exports, d
exports.isOnDiscoverQuestHomeRoute = function() {
return global.window.location.pathname.startsWith(Routes.QUEST_HOME_DEPRECATED);
};
}
function _createForOfIteratorHelperLoose_56552(a0, a1) { // fn#56552, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7269:243, offset: 0x013cb7a4, size: 370 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)) {
function _createForOfIteratorHelperLoose_56552(a0, a1) { // fn#56552, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7269:243, offset: 0x013cb7a4, size: 370 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);
}
return _fun56553;
}
value = undefined;
if (a0) {
if (typeof a0 === 'string') {
value = _arrayLikeToArray_56554(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') {
const Array = global.Array;
if (Array.isArray(a0)) {
if (r1) {
}
return _fun56553;
}
value = undefined;
if (a0) {
if (typeof a0 === 'string') {
value = _arrayLikeToArray_56554(a0, value);
r6 = value;
r5 = value;
} else {
regexp = RegExp('^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$', '');
if (regexp.test(r9)) {
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_56554(a0, value);
r6 = value;
} else {
r6 = value;
regexp = RegExp('^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$', '');
if (regexp.test(r9)) {
value = _arrayLikeToArray_56554(a0, value);
r6 = value;
} else {
r6 = value;
}
}
r5 = r6;
}
r5 = r6;
} else {
r5 = value;
}
} else {
r5 = value;
}
if (r5) {
if (r5) {
if (r5) {
}
return _fun56553;
}
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 _fun56553() { // fn#56553, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7269:814, 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]};
}
return _fun56553;
}
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 getQuestPlacementFromQuestContent(a0) { // fn#56558, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7269:1398, offset: 0x013cb9ba, size: 356 bytes, params: 2, frame: 15
const object2 = {};
const QuestContent = (require(6531) /* metro dependency 6531: QuestTypes */).QuestContent;
const QUEST_BAR = QuestContent.QUEST_BAR;
const QuestPlacement = (require(6531) /* metro dependency 6531: QuestTypes */).QuestPlacement;
let DESKTOP_ACCOUNT_PANEL_AREA = QuestPlacement.DESKTOP_ACCOUNT_PANEL_AREA;
object2[QUEST_BAR] = DESKTOP_ACCOUNT_PANEL_AREA;
const QUEST_BAR_V2 = QuestContent.QUEST_BAR_V2;
DESKTOP_ACCOUNT_PANEL_AREA = QuestPlacement.DESKTOP_ACCOUNT_PANEL_AREA;
object2[QUEST_BAR_V2] = DESKTOP_ACCOUNT_PANEL_AREA;
const QUEST_BAR_MOBILE = QuestContent.QUEST_BAR_MOBILE;
const MOBILE_HOME_DOCK_AREA = QuestPlacement.MOBILE_HOME_DOCK_AREA;
object2[QUEST_BAR_MOBILE] = MOBILE_HOME_DOCK_AREA;
const QUEST_HOME_HERO = QuestContent.QUEST_HOME_HERO;
let QUEST_HOME_BANNER_DESKTOP = QuestPlacement.QUEST_HOME_BANNER_DESKTOP;
object2[QUEST_HOME_HERO] = QUEST_HOME_BANNER_DESKTOP;
const QUEST_HOME_HERO_SHELF = QuestContent.QUEST_HOME_HERO_SHELF;
QUEST_HOME_BANNER_DESKTOP = QuestPlacement.QUEST_HOME_BANNER_DESKTOP;
object2[QUEST_HOME_HERO_SHELF] = QUEST_HOME_BANNER_DESKTOP;
const QUEST_HOME_MOBILE_CAROUSEL = QuestContent.QUEST_HOME_MOBILE_CAROUSEL;
const QUEST_HOME_MOBILE_CAROUSEL2 = QuestPlacement.QUEST_HOME_MOBILE_CAROUSEL;
object2[QUEST_HOME_MOBILE_CAROUSEL] = QUEST_HOME_MOBILE_CAROUSEL2;
const VIDEO_MODAL_MOBILE = QuestContent.VIDEO_MODAL_MOBILE;
const VIDEO_MODAL_MOBILE2 = QuestPlacement.VIDEO_MODAL_MOBILE;
object2[VIDEO_MODAL_MOBILE] = VIDEO_MODAL_MOBILE2;
return object2[a0];
}
function getQuestDeliveryDataForPlacement(a0, a1) { // fn#56560, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7269:2306, offset: 0x013cbb67, size: 394 bytes, params: 3, frame: 20
var r0;
var r5;
var value3;
var adDecisionByPlacementAndAdCreativeId;
var quest;
var id;
const QuestPlacement = (require(6531) /* metro dependency 6531: QuestTypes */).QuestPlacement;
const QUEST_HOME_MOBILE_CAROUSEL = QuestPlacement.QUEST_HOME_MOBILE_CAROUSEL;
if (a0 === QUEST_HOME_MOBILE_CAROUSEL) {
value3 = null;
if (value3 == a1) {
r0 = value3;
} else {
adDecisionByPlacementAndAdCreativeId = BountyStore.getAdDecisionByPlacementAndAdCreativeId(a0, a1);
r0 = value3 != adDecisionByPlacementAndAdCreativeId ? mapQuestAdDecision(adDecisionByPlacementAndAdCreativeId) : value3;
}
} else if (a0 !== QuestPlacement.VIDEO_MODAL_MOBILE) {
r0 = null;
} else {
value3 = null;
if (value3 == a1) {
r0 = value3;
} else {
adDecisionByPlacementAndAdCreativeId = BountyStore.getAdDecisionByPlacementAndAdCreativeId(a0, a1);
r0 = value3 != adDecisionByPlacementAndAdCreativeId ? mapQuestAdDecision(adDecisionByPlacementAndAdCreativeId) : value3;
}
}
const value6 = null;
if (value6 != r0) {
function getQuestPlacementFromQuestContent(a0) { // fn#56558, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7269:1398, offset: 0x013cb9ba, size: 356 bytes, params: 2, frame: 15
const object = {};
const QuestContent = (QuestTypesModule).QuestContent;
const QUEST_BAR = QuestContent.QUEST_BAR;
const QuestPlacement = (QuestTypesModule).QuestPlacement;
let DESKTOP_ACCOUNT_PANEL_AREA = QuestPlacement.DESKTOP_ACCOUNT_PANEL_AREA;
object[QUEST_BAR] = DESKTOP_ACCOUNT_PANEL_AREA;
const QUEST_BAR_V2 = QuestContent.QUEST_BAR_V2;
DESKTOP_ACCOUNT_PANEL_AREA = QuestPlacement.DESKTOP_ACCOUNT_PANEL_AREA;
object[QUEST_BAR_V2] = DESKTOP_ACCOUNT_PANEL_AREA;
const QUEST_BAR_MOBILE = QuestContent.QUEST_BAR_MOBILE;
const MOBILE_HOME_DOCK_AREA = QuestPlacement.MOBILE_HOME_DOCK_AREA;
object[QUEST_BAR_MOBILE] = MOBILE_HOME_DOCK_AREA;
const QUEST_HOME_HERO = QuestContent.QUEST_HOME_HERO;
let QUEST_HOME_BANNER_DESKTOP = QuestPlacement.QUEST_HOME_BANNER_DESKTOP;
object[QUEST_HOME_HERO] = QUEST_HOME_BANNER_DESKTOP;
const QUEST_HOME_HERO_SHELF = QuestContent.QUEST_HOME_HERO_SHELF;
QUEST_HOME_BANNER_DESKTOP = QuestPlacement.QUEST_HOME_BANNER_DESKTOP;
object[QUEST_HOME_HERO_SHELF] = QUEST_HOME_BANNER_DESKTOP;
const QUEST_HOME_MOBILE_CAROUSEL = QuestContent.QUEST_HOME_MOBILE_CAROUSEL;
const QUEST_HOME_MOBILE_CAROUSEL2 = QuestPlacement.QUEST_HOME_MOBILE_CAROUSEL;
object[QUEST_HOME_MOBILE_CAROUSEL] = QUEST_HOME_MOBILE_CAROUSEL2;
const VIDEO_MODAL_MOBILE = QuestContent.VIDEO_MODAL_MOBILE;
const VIDEO_MODAL_MOBILE2 = QuestPlacement.VIDEO_MODAL_MOBILE;
object[VIDEO_MODAL_MOBILE] = VIDEO_MODAL_MOBILE2;
return object[a0];
}
function getQuestDeliveryDataForPlacement(a0, a1) { // fn#56560, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7269:2306, offset: 0x013cbb67, size: 394 bytes, params: 3, frame: 20
var r0;
var r5;
var value3;
var adDecisionByPlacementAndAdCreativeId;
var quest;
var id;
const QuestPlacement = (QuestTypesModule).QuestPlacement;
const QUEST_HOME_MOBILE_CAROUSEL = QuestPlacement.QUEST_HOME_MOBILE_CAROUSEL;
if (a0 === QUEST_HOME_MOBILE_CAROUSEL) {
value3 = null;
if (value3 == a1) {
r0 = value3;
} else {
adDecisionByPlacementAndAdCreativeId = BountyStore.getAdDecisionByPlacementAndAdCreativeId(a0, a1);
r0 = value3 != adDecisionByPlacementAndAdCreativeId ? mapQuestAdDecision(adDecisionByPlacementAndAdCreativeId) : value3;
}
} else if (a0 !== QuestPlacement.VIDEO_MODAL_MOBILE) {
r0 = null;
} else {
value3 = null;
if (value3 == a1) {
r0 = value3;
} else {
adDecisionByPlacementAndAdCreativeId = BountyStore.getAdDecisionByPlacementAndAdCreativeId(a0, a1);
r0 = value3 != adDecisionByPlacementAndAdCreativeId ? mapQuestAdDecision(adDecisionByPlacementAndAdCreativeId) : value3;
}
}
const value6 = null;
if (value6 != r0) {
return r0;
}
const defaultImport = NewAdRequestBehaviorExperiment;
const getConfig = defaultImport.getConfig;
let object = {location: 'getQuestDeliveryDataForPlacement'};
const enableNewRequestBehavior = Reflect.apply(getConfig, defaultImport, [object]).enableNewRequestBehavior;
const value7 = QuestStore.questAdDecisionByPlacement.get(a0);
const QUEST_HOME_BANNER_DESKTOP = QuestPlacement.QUEST_HOME_BANNER_DESKTOP;
if (a0 === QUEST_HOME_BANNER_DESKTOP) {
if (value6 != value7) {
return mapQuestAdDecision(value7);
}
}
if (enableNewRequestBehavior) {
return value6 == value7 ? value6 : mapQuestAdDecision(value7);
}
const value = QuestStore.questToDeliverForPlacement.get(a0);
if (value6 == value) {
r5 = value6;
} else {
object = {};
quest = value.quest;
id = quest.id;
object.questId = id;
quest = value.quest;
id = quest.id;
object.adCreativeId = id;
object.adDecisionData = value.adDecisionData;
object.adContext = value.adContext;
object.metadataSealed = value.metadataSealed;
object.trafficMetadataSealed = value.trafficMetadataSealed;
r5 = object;
}
return r5;
}
function findQuestOrReplacement(a0, a1, a2) { // fn#56562, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7269:3402, offset: 0x013cbd24, size: 203 bytes, params: 4, frame: 17
var r4;
var Map;
let value = a1;
const value2 = a2;
let Array = global.Array;
if (Array.isArray(value)) {
Map = global.Map;
value = value.map(function(a0) {
return [a0.id, a0];
});
r4 = new Map(value);
} else {
r4 = value;
}
Array = global.Array;
const r3 = Array.isArray(value2) ? new global.Map(value2.map(function(a0) {
return [a0.id, a0];
})) : value2;
value = r4.get(a0);
if (value != null) {
return value;
}
value = r3.get(a0);
const value5 = undefined;
const replacementId = value == null ? value5 : value.replacementId;
return replacementId != null ? r4.get(replacementId) : value5;
}
function getIsQuestExpiredButWithinThirtyDayLookback(a0) { // fn#56566, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7269:3973, offset: 0x013cbe50, size: 132 bytes, params: 2, frame: 13
var Date;
var config;
var expiresAt;
var value2;
var date;
var value4;
var value;
if (isQuestExpired(a0)) {
Date = global.Date;
value = Date.now();
value -= 2592000000;
Date = global.Date;
config = a0.config;
expiresAt = config.expiresAt;
value2 = Object.create(Date.prototype, {constructor: {value: Date}});
date = new Date();
value4 = (date instanceof Object ? date : value2).valueOf();
config = a0.config;
expiresAt = config.expiresAt;
return expiresAt != null && !(value4 <= value);
}
return false;
}
function findNextUpcomingExpirationEpochMs(a0) { // fn#56567, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7269:4199, offset: 0x013cbed4, size: 157 bytes, params: 2, frame: 20
var r2;
var r3;
var r10;
var r9;
var r0;
var value6;
var config;
var expiresAt;
var prototype;
var value7;
var date;
var value8;
var value9;
var value10;
var value11;
var value12;
let Date = global.Date;
const value = Date.now();
const value3 = _createForOfIteratorHelperLoose_56552(a0);
const value4 = value3();
let done = value4.done;
const value5 = null;
if (done) {
r0 = value5;
} else {
r2 = value5;
r3 = value4;
while (true) {
value6 = r3.value;
Date = global.Date;
config = value6.config;
expiresAt = config.expiresAt;
prototype = Date.prototype;
value7 = Object.create(prototype, {constructor: {value: Date}});
date = new Date();
value8 = date instanceof Object ? date : value7;
value9 = value8.valueOf();
if (value9 <= value) {
r9 = r2;
} else {
value10 = value5 == r2;
if (value10) {
r10 = value10;
continue;
}
value11 = value9 < r2;
r10 = value11;
if (r10) {
r2 = value9;
continue;
}
continue;
r9 = r2;
}
value12 = value3();
done = value12.done;
if (done) {
r0 = r9;
break;
}
r2 = r9;
r3 = value12;
continue;
}
}
return r0;
}
const defaultImport = importDefault(7108) /* metro dependency 7108: NewAdRequestBehaviorExperiment */;
const getConfig = defaultImport.getConfig;
let object2 = {location: 'getQuestDeliveryDataForPlacement'};
const enableNewRequestBehavior = Reflect.apply(getConfig, defaultImport, [object2]).enableNewRequestBehavior;
const value7 = QuestStore.questAdDecisionByPlacement.get(a0);
const QUEST_HOME_BANNER_DESKTOP = QuestPlacement.QUEST_HOME_BANNER_DESKTOP;
if (a0 === QUEST_HOME_BANNER_DESKTOP) {
if (value6 != value7) {
return mapQuestAdDecision(value7);
}
}
if (enableNewRequestBehavior) {
return value6 == value7 ? value6 : mapQuestAdDecision(value7);
}
const value = QuestStore.questToDeliverForPlacement.get(a0);
if (value6 == value) {
r5 = value6;
} else {
object2 = {};
quest = value.quest;
id = quest.id;
object2.questId = id;
quest = value.quest;
id = quest.id;
object2.adCreativeId = id;
object2.adDecisionData = value.adDecisionData;
object2.adContext = value.adContext;
object2.metadataSealed = value.metadataSealed;
object2.trafficMetadataSealed = value.trafficMetadataSealed;
r5 = object2;
}
return r5;
}
function findQuestOrReplacement(a0, a1, a2) { // fn#56562, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7269:3402, offset: 0x013cbd24, size: 203 bytes, params: 4, frame: 17
var r4;
var Map;
let value = a1;
const value2 = a2;
let Array = global.Array;
if (Array.isArray(value)) {
Map = global.Map;
value = value.map(function(a0) {
return [a0.id, a0];
});
r4 = new Map(value);
} else {
r4 = value;
function getQuestFormattedDate(a0) { // fn#56569, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7269:4555, offset: 0x013cbf96, size: 97 bytes, params: 2, frame: 14
var r0;
var date;
const value = a1;
if (a0 == null) {
r0 = '';
} else {
date = new global.Date(a0);
date = date.toLocaleDateString(LocaleStore.locale, value !== undefined ? value : {dateStyle: 'short'});
r0 = date;
}
return r0;
}
Array = global.Array;
const r3 = Array.isArray(value2) ? new global.Map(value2.map(function(a0) {
return [a0.id, a0];
})) : value2;
value = r4.get(a0);
if (value != null) {
function isBillableQuestContent(a0) { // fn#56571, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7269:4927, offset: 0x013cc04a, size: 42 bytes, params: 2, frame: 12
const questPlacementFromQuestContent = getQuestPlacementFromQuestContent(a0);
return questPlacementFromQuestContent != null && BILLABLE_PLACEMENTS.has(questPlacementFromQuestContent);
}
function getAdMetadataSealed(a0, a1) { // fn#56573, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7269:5327, offset: 0x013cc0e1, size: 55 bytes, params: 3, frame: 14
var questDeliveryDataForPlacement;
const getQuestPlacementFromQuestContentBinding = getQuestPlacementFromQuestContent;
const value2 = undefined;
const questPlacementFromQuestContentBinding = getQuestPlacementFromQuestContentBinding(a0);
if (questPlacementFromQuestContentBinding != null) {
questDeliveryDataForPlacement = getQuestDeliveryDataForPlacement(questPlacementFromQuestContentBinding, a1);
return questDeliveryDataForPlacement == null ? value2 : questDeliveryDataForPlacement.metadataSealed;
}
return value2;
}
function getAdTrafficMetadataSealed(a0, a1, a2) { // fn#56574, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7269:5527, offset: 0x013cc118, size: 109 bytes, params: 4, frame: 17
var quest;
const getQuestPlacementFromQuestContentBinding = getQuestPlacementFromQuestContent;
const value2 = undefined;
const questPlacementFromQuestContentBinding = getQuestPlacementFromQuestContentBinding(a0);
if (questPlacementFromQuestContentBinding != null) {
var {trafficMetadataSealed, questId} = getQuestDeliveryDataForPlacement(questPlacementFromQuestContentBinding,
a2) ?? ({});
if (trafficMetadataSealed == null) {
if (a1 != null) {
quest = QuestStore.getQuest(a1);
return quest == null ? value2 : quest.trafficMetadataSealed;
}
return value2;
}
if (a2 != null) {
return trafficMetadataSealed;
}
if (questId === a1) {
return trafficMetadataSealed;
}
}
if (a1 != null) {
quest = QuestStore.getQuest(a1);
return quest == null ? value2 : quest.trafficMetadataSealed;
}
return value2;
}
function getAdContext(a0, a1) { // fn#56575, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7269:5858, offset: 0x013cc185, size: 55 bytes, params: 3, frame: 14
var questDeliveryDataForPlacement;
const getQuestPlacementFromQuestContentBinding = getQuestPlacementFromQuestContent;
const value2 = undefined;
const questPlacementFromQuestContentBinding = getQuestPlacementFromQuestContentBinding(a0);
if (questPlacementFromQuestContentBinding != null) {
questDeliveryDataForPlacement = getQuestDeliveryDataForPlacement(questPlacementFromQuestContentBinding, a1);
return questDeliveryDataForPlacement == null ? value2 : questDeliveryDataForPlacement.adContext;
}
return value2;
}
function captureQuestsException(a0, a1) { // fn#56576, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7269:6042, offset: 0x013cc1bc, size: 108 bytes, params: 3, frame: 17
const value = undefined;
const defaultImport = SentryUtilsNative;
const captureException = defaultImport.captureException;
const object = {};
copyDataProperties(object, a1, undefined);
const object2 = {};
const value2 = a1 == null;
copyDataProperties(object2, value2 ? value : a1.tags, value2);
object2['app_context'] = 'quests';
object['tags'] = object2;
Reflect.apply(captureException, defaultImport, [a0, object]);
return value;
}
value = r3.get(a0);
const value5 = undefined;
const replacementId = value == null ? value5 : value.replacementId;
return replacementId != null ? r4.get(replacementId) : value5;
}
function getIsQuestExpiredButWithinThirtyDayLookback(a0) { // fn#56566, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7269:3973, offset: 0x013cbe50, size: 132 bytes, params: 2, frame: 13
var Date;
var config;
var expiresAt;
var value2;
var date;
var value4;
var value;
if (isQuestExpired(a0)) {
Date = global.Date;
value = Date.now();
value -= 2592000000;
Date = global.Date;
config = a0.config;
expiresAt = config.expiresAt;
value2 = Object.create(Date.prototype, {constructor: {value: Date}});
date = new Date();
value4 = (date instanceof Object ? date : value2).valueOf();
config = a0.config;
expiresAt = config.expiresAt;
return expiresAt != null && !(value4 <= value);
}
return false;
}
function findNextUpcomingExpirationEpochMs(a0) { // fn#56567, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7269:4199, offset: 0x013cbed4, size: 157 bytes, params: 2, frame: 20
var r2;
var r3;
var r10;
var r9;
var r0;
var value6;
var config;
var expiresAt;
var prototype;
var value7;
var date;
var value8;
var value9;
var value10;
var value11;
var value12;
let Date = global.Date;
const value = Date.now();
const value3 = _createForOfIteratorHelperLoose_56552(a0);
const value4 = value3();
let done = value4.done;
const value5 = null;
if (done) {
r0 = value5;
} else {
r2 = value5;
r3 = value4;
while (true) {
value6 = r3.value;
Date = global.Date;
config = value6.config;
expiresAt = config.expiresAt;
prototype = Date.prototype;
value7 = Object.create(prototype, {constructor: {value: Date}});
date = new Date();
value8 = date instanceof Object ? date : value7;
value9 = value8.valueOf();
if (value9 <= value) {
r9 = r2;
} else {
value10 = value5 == r2;
if (value10) {
r10 = value10;
continue;
}
value11 = value9 < r2;
r10 = value11;
if (r10) {
r2 = value9;
continue;
}
continue;
r9 = r2;
}
value12 = value3();
done = value12.done;
if (done) {
r0 = r9;
break;
}
r2 = r9;
r3 = value12;
continue;
}
}
return r0;
}
function getQuestFormattedDate(a0) { // fn#56569, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7269:4555, offset: 0x013cbf96, size: 97 bytes, params: 2, frame: 14
var r0;
var date;
const value = a1;
if (a0 == null) {
r0 = '';
} else {
date = new global.Date(a0);
date = date.toLocaleDateString(LocaleStore.locale, value !== undefined ? value : {dateStyle: 'short'});
r0 = date;
}
return r0;
}
function isBillableQuestContent(a0) { // fn#56571, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7269:4927, offset: 0x013cc04a, size: 42 bytes, params: 2, frame: 12
const questPlacementFromQuestContent = getQuestPlacementFromQuestContent(a0);
return questPlacementFromQuestContent != null && BILLABLE_PLACEMENTS.has(questPlacementFromQuestContent);
}
function getAdMetadataSealed(a0, a1) { // fn#56573, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7269:5327, offset: 0x013cc0e1, size: 55 bytes, params: 3, frame: 14
var questDeliveryDataForPlacement;
const getQuestPlacementFromQuestContentBinding = getQuestPlacementFromQuestContent;
const value2 = undefined;
const questPlacementFromQuestContentBinding = getQuestPlacementFromQuestContentBinding(a0);
if (questPlacementFromQuestContentBinding != null) {
questDeliveryDataForPlacement = getQuestDeliveryDataForPlacement(questPlacementFromQuestContentBinding, a1);
return questDeliveryDataForPlacement == null ? value2 : questDeliveryDataForPlacement.metadataSealed;
}
return value2;
}
function getAdTrafficMetadataSealed(a0, a1, a2) { // fn#56574, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7269:5527, offset: 0x013cc118, size: 109 bytes, params: 4, frame: 17
var quest;
const getQuestPlacementFromQuestContentBinding = getQuestPlacementFromQuestContent;
const value2 = undefined;
const questPlacementFromQuestContentBinding = getQuestPlacementFromQuestContentBinding(a0);
if (questPlacementFromQuestContentBinding != null) {
var {trafficMetadataSealed, questId} = getQuestDeliveryDataForPlacement(questPlacementFromQuestContentBinding,
a2) ?? ({});
if (trafficMetadataSealed == null) {
if (a1 != null) {
quest = QuestStore.getQuest(a1);
return quest == null ? value2 : quest.trafficMetadataSealed;
}
return value2;
}
if (a2 != null) {
return trafficMetadataSealed;
}
if (questId === a1) {
return trafficMetadataSealed;
}
}
if (a1 != null) {
quest = QuestStore.getQuest(a1);
return quest == null ? value2 : quest.trafficMetadataSealed;
}
return value2;
}
function getAdContext(a0, a1) { // fn#56575, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7269:5858, offset: 0x013cc185, size: 55 bytes, params: 3, frame: 14
var questDeliveryDataForPlacement;
const getQuestPlacementFromQuestContentBinding = getQuestPlacementFromQuestContent;
const value2 = undefined;
const questPlacementFromQuestContentBinding = getQuestPlacementFromQuestContentBinding(a0);
if (questPlacementFromQuestContentBinding != null) {
questDeliveryDataForPlacement = getQuestDeliveryDataForPlacement(questPlacementFromQuestContentBinding, a1);
return questDeliveryDataForPlacement == null ? value2 : questDeliveryDataForPlacement.adContext;
}
return value2;
}
function captureQuestsException(a0, a1) { // fn#56576, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7269:6042, offset: 0x013cc1bc, size: 108 bytes, params: 3, frame: 17
const value = undefined;
const defaultImport = importDefault(1216) /* metro dependency 1216: SentryUtilsNative */;
const captureException = defaultImport.captureException;
const object3 = {};
copyDataProperties(object3, a1, undefined);
const object4 = {};
const value2 = a1 == null;
copyDataProperties(object4, value2 ? value : a1.tags, value2);
object4['app_context'] = 'quests';
object3['tags'] = object4;
Reflect.apply(captureException, defaultImport, [a0, object3]);
return value;
}
global.__d(_fun56551, 7091, [1949, 7092, 7093, 6528, 661, 6531, 1391, 7108, 1216,
2]) /* metro module 7091, dependencies: [1949, 7092, 7093, 6528, 661, 6531, 1391, 7108, 1216, 2] */;
@@ -1,4 +1,12 @@
/* Metro module 9524; source: modules/quests/utils/QuestMatchingUtils.tsx; dependencies: [57, 4234, 6528, 661, 4237, 7116, 7091, 7114, 2] */
import Module00057 from '../../../by-id/module-00057.js'; /* Metro dependency 57 */
import ApplicationStore from '../../applications/ApplicationStore.tsx'; /* Metro dependency 4234 */
import * as FileImportTrackerModule from '../../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
import * as ConstantsModule from '../../../Constants.tsx'; /* Metro dependency 661 */
import * as ConstantsModule2 from '../../activities/Constants.tsx'; /* Metro dependency 4237 */
import * as QuestConstantsModule from '../QuestConstants.tsx'; /* Metro dependency 6528 */
import * as QuestTaskUtilsModule from './QuestTaskUtils.tsx'; /* Metro dependency 7116 */
function _fun74307(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#74307, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9710:6, offset: 0x01d899e9, size: 330 bytes, params: 8, frame: 21
let env0_0 = require;
const _arrayLikeToArray_74310 = function(a0, a1) {
@@ -44,21 +52,13 @@ function _fun74307(global, require, importDefault, importAll, module, exports, d
}
return value;
};
const closure = questMatchesActivity;
const closure2 = getQuestByActivity;
const questMatchesActivity2 = questMatchesActivity;
const getQuestByActivity2 = getQuestByActivity;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_2 = importDefault(57) /* metro dependency 57 */;
const applicationStore = importDefault(4234) /* metro dependency 4234: ApplicationStore */;
const questConstantsModule = require(6528) /* metro dependency 6528: QuestConstants */;
const env0_4 = questConstantsModule.DISCORD_APPLICATION_ID;
const env0_5 = questConstantsModule.PLAY_ACTIVITY_CLOUD_GAMING_QUEST_ID;
const env0_6 = questConstantsModule.PLAY_ACTIVITY_SOCIAL_ENTRY_APPLICATION_ID;
const env0_7 = (require(661) /* metro dependency 661: Constants */).ActivityGamePlatforms;
const env0_8 = (require(4237) /* metro dependency 4237: Constants */).XBOX_ACTIVITY_APPLICATION_ID;
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/quests/utils/QuestMatchingUtils.tsx');
exports.questMatchesActivity = closure;
exports.getQuestByActivity = closure2;
(FileImportTrackerModule).fileFinishedImporting('modules/quests/utils/QuestMatchingUtils.tsx');
exports.questMatchesActivity = questMatchesActivity2;
exports.getQuestByActivity = getQuestByActivity2;
exports.getQuestByApplicationId = getQuestByApplicationId;
exports.allPlayOnDesktopQuestsByApplicationId = function(a0, a1) {
var env0_0 = a1;
@@ -108,89 +108,80 @@ function _fun74307(global, require, importDefault, importAll, module, exports, d
}
return r0;
};
}
function _createForOfIteratorHelperLoose_74308(a0, a1) { // fn#74308, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9710:317, offset: 0x01d89b33, 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)) {
function _createForOfIteratorHelperLoose_74308(a0, a1) { // fn#74308, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9710:317, offset: 0x01d89b33, 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);
}
return _fun74309;
}
value = undefined;
if (a0) {
if (typeof a0 === 'string') {
value = _arrayLikeToArray_74310(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') {
const Array = global.Array;
if (Array.isArray(a0)) {
if (r1) {
}
return _fun74309;
}
value = undefined;
if (a0) {
if (typeof a0 === 'string') {
value = _arrayLikeToArray_74310(a0, value);
r6 = value;
r5 = value;
} else {
regexp = RegExp('^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$', '');
if (regexp.test(r9)) {
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_74310(a0, value);
r6 = value;
} else {
r6 = value;
regexp = RegExp('^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$', '');
if (regexp.test(r9)) {
value = _arrayLikeToArray_74310(a0, value);
r6 = value;
} else {
r6 = value;
}
}
r5 = r6;
}
r5 = r6;
}
} else {
r5 = value;
}
if (r5) {
if (r5) {
}
return _fun74309;
}
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 questMatchesActivity(a0, a1) { // fn#74311, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9710:1227, offset: 0x01d89ca7, size: 295 bytes, params: 3, frame: 19
var r1;
var r2;
var r0;
var value10;
var consoleApplicationId;
let value = a0 != null;
if (value) {
r1 = a0.application_id === XBOX_ACTIVITY_APPLICATION_ID || a0.platform === ActivityGamePlatforms.XBOX;
if (r1) {
value10 = a0.name.toLowerCase();
consoleApplicationId = (require(7116) /* metro dependency 7116: QuestTaskUtils */).getConsoleApplicationId(a1);
if (consoleApplicationId == null) {
r2 = false;
} else {
value = ApplicationStore.getApplication(consoleApplicationId);
r2 = value != null && value10 === value.name.toLowerCase();
}
r1 = r2;
} else {
r1 = a0.platform === ActivityGamePlatforms.PS4 || a0.platform === ActivityGamePlatforms.PS5;
r5 = value;
}
if (r5) {
if (r5) {
}
return _fun74309;
}
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 _fun74309() { // fn#74309, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9710:888, 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 questMatchesActivity(a0, a1) { // fn#74311, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9710:1227, offset: 0x01d89ca7, size: 295 bytes, params: 3, frame: 19
var r1;
var r2;
var r0;
var value10;
var consoleApplicationId;
let value = a0 != null;
if (value) {
r1 = a0.application_id === XBOX_ACTIVITY_APPLICATION_ID || a0.platform === ActivityGamePlatforms.XBOX;
if (r1) {
value10 = a0.name.toLowerCase();
consoleApplicationId = (require(7116) /* metro dependency 7116: QuestTaskUtils */).getConsoleApplicationId(a1);
@@ -202,174 +193,194 @@ function questMatchesActivity(a0, a1) { // fn#74311, source: /ci/build/discord/d
}
r1 = r2;
} else {
r1 = a1 != null && a1.id === PLAY_ACTIVITY_CLOUD_GAMING_QUEST_ID;
r1 = r1 && a0.application_id === PLAY_ACTIVITY_SOCIAL_ENTRY_APPLICATION_ID;
r1 = !r1 ? a0.application_id != null && questMatchesApplicationId(a0.application_id, a1) : r1;
}
}
r0 = r1;
} else {
r0 = value;
}
return r0;
}
function getQuestByActivity(a0, a1) { // fn#74312, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9710:1685, offset: 0x01d89dce, size: 129 bytes, params: 3, frame: 21
var r2;
var value4;
var value5;
var property;
var moduleValue;
var isQuestExpired;
var value6;
const value2 = _createForOfIteratorHelperLoose_74308(a0);
const value3 = value2();
let done = value3.done;
if (!done) {
r2 = value3;
reducibleLoop1: while (true) {
value4 = r2.value;
value5 = env0_2(value4, 2);
value5[0];
property = value5[1];
if (questMatchesActivity(a1, property)) {
moduleValue = require(7091) /* metro dependency 7091: QuestDataUtils */;
isQuestExpired = moduleValue.isQuestExpired;
reducibleJoin4: while (true) {
if (!Reflect.apply(isQuestExpired, moduleValue, [property])) {
return property;
r1 = a0.platform === ActivityGamePlatforms.PS4 || a0.platform === ActivityGamePlatforms.PS5;
if (r1) {
value10 = a0.name.toLowerCase();
consoleApplicationId = (require(7116) /* metro dependency 7116: QuestTaskUtils */).getConsoleApplicationId(a1);
if (consoleApplicationId == null) {
r2 = false;
} else {
value = ApplicationStore.getApplication(consoleApplicationId);
r2 = value != null && value10 === value.name.toLowerCase();
}
break reducibleJoin4;
r1 = r2;
} else {
r1 = a1 != null && a1.id === PLAY_ACTIVITY_CLOUD_GAMING_QUEST_ID;
r1 = r1 && a0.application_id === PLAY_ACTIVITY_SOCIAL_ENTRY_APPLICATION_ID;
r1 = !r1 ? a0.application_id != null && questMatchesApplicationId(a0.application_id, a1) : r1;
}
}
value6 = value2();
done = value6.done;
if (done) {
return undefined;
r0 = r1;
} else {
r0 = value;
}
return r0;
}
function getQuestByActivity(a0, a1) { // fn#74312, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9710:1685, offset: 0x01d89dce, size: 129 bytes, params: 3, frame: 21
var r2;
var value4;
var value5;
var property;
var moduleValue;
var isQuestExpired;
var value6;
const value2 = _createForOfIteratorHelperLoose_74308(a0);
const value3 = value2();
let done = value3.done;
if (!done) {
r2 = value3;
reducibleLoop1: while (true) {
value4 = r2.value;
value5 = Module00057(value4, 2);
value5[0];
property = value5[1];
if (questMatchesActivity(a1, property)) {
moduleValue = require(7091) /* metro dependency 7091: QuestDataUtils */;
isQuestExpired = moduleValue.isQuestExpired;
reducibleJoin4: while (true) {
if (!Reflect.apply(isQuestExpired, moduleValue, [property])) {
return property;
}
break reducibleJoin4;
}
}
value6 = value2();
done = value6.done;
if (done) {
return undefined;
}
r2 = value6;
continue reducibleLoop1;
}
r2 = value6;
continue reducibleLoop1;
}
}
}
function questMatchesApplicationId(a0, a1) { // fn#74313, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9710:1888, offset: 0x01d89e4f, size: 77 bytes, params: 3, frame: 12
var r0;
const env0_0 = a0;
let value = require(7116) /* metro dependency 7116: QuestTaskUtils */;
value = value.getAllApplicationIds(a1);
const value2 = value != null;
if (value2) {
value = value.some(_fun74314);
r0 = value;
} else {
r0 = value2;
function questMatchesApplicationId(a0, a1) { // fn#74313, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9710:1888, offset: 0x01d89e4f, size: 77 bytes, params: 3, frame: 12
var r0;
const env0_0 = a0;
let value = QuestTaskUtilsModule;
value = value.getAllApplicationIds(a1);
const value2 = value != null;
if (value2) {
value = value.some(_fun74314);
r0 = value;
} else {
r0 = value2;
}
return r0;
function _fun74314(a0) { // fn#74314, offset: 0x00fcba1c, size: 16 bytes, params: 2, frame: 2
return a0 === env0_0;
}
}
return r0;
}
function getQuestByApplicationId(a0, a1) { // fn#74315, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9710:2193, offset: 0x01d89e9c, size: 137 bytes, params: 3, frame: 22
var r2;
var r0;
var value5;
var value6;
var property;
var moduleValue;
var isQuestExpired;
var value7;
const _createForOfIteratorHelperLoose_74308Binding = _createForOfIteratorHelperLoose_74308;
const value2 = undefined;
const value3 = _createForOfIteratorHelperLoose_74308Binding(a0);
const value4 = value3();
let done = value4.done;
if (done) {
r0 = value2;
} else {
r2 = value4;
reducibleLoop1: while (true) {
value5 = r2.value;
value6 = env0_2(value5, 2);
value6[0];
property = value6[1];
if (questMatchesApplicationId(a1, property)) {
moduleValue = require(7091) /* metro dependency 7091: QuestDataUtils */;
isQuestExpired = moduleValue.isQuestExpired;
reducibleJoin3: while (true) {
if (Reflect.apply(isQuestExpired, moduleValue, [property])) {
break reducibleJoin3;
function getQuestByApplicationId(a0, a1) { // fn#74315, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9710:2193, offset: 0x01d89e9c, size: 137 bytes, params: 3, frame: 22
var r2;
var r0;
var value5;
var value6;
var property;
var moduleValue;
var isQuestExpired;
var value7;
const _createForOfIteratorHelperLoose_74308Binding = _createForOfIteratorHelperLoose_74308;
const value2 = undefined;
const value3 = _createForOfIteratorHelperLoose_74308Binding(a0);
const value4 = value3();
let done = value4.done;
if (done) {
r0 = value2;
} else {
r2 = value4;
reducibleLoop1: while (true) {
value5 = r2.value;
value6 = Module00057(value5, 2);
value6[0];
property = value6[1];
if (questMatchesApplicationId(a1, property)) {
moduleValue = require(7091) /* metro dependency 7091: QuestDataUtils */;
isQuestExpired = moduleValue.isQuestExpired;
reducibleJoin3: while (true) {
if (Reflect.apply(isQuestExpired, moduleValue, [property])) {
break reducibleJoin3;
}
r0 = property;
break reducibleLoop1;
}
r0 = property;
}
value7 = value3();
done = value7.done;
if (done) {
r0 = value2;
break reducibleLoop1;
}
r2 = value7;
continue reducibleLoop1;
}
value7 = value3();
done = value7.done;
if (done) {
r0 = value2;
break reducibleLoop1;
}
r2 = value7;
continue reducibleLoop1;
}
return r0;
}
return r0;
}
function allPlayOnDesktopQuestsByApplicationId(a0, a1) { // fn#74316, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9710:2461, offset: 0x01d89f25, size: 58 bytes, params: 3, frame: 13
const env0_0 = a1;
const Array = global.Array;
return Array.from(a0.values()).filter(_fun74317);
}
function allPlayOnDesktopQuestsByApplicationId(a0, a1) { // fn#74316, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9710:2461, offset: 0x01d89f25, size: 58 bytes, params: 3, frame: 13
const env0_0 = a1;
const Array = global.Array;
return Array.from(a0.values()).filter(_fun74317);
function _fun74317(a0) { // fn#74317, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9710:2551, offset: 0x01d89f5f, size: 105 bytes, params: 2, frame: 16
var r0;
var moduleValue;
let value = environment.__proto__;
const value3 = questMatchesApplicationId(require, a0);
if (value3) {
moduleValue = require(7091) /* metro dependency 7091: QuestDataUtils */;
r0 = !moduleValue.isQuestExpired(a0);
} else {
r0 = value3;
}
if (r0) {
value = require(7116) /* metro dependency 7116: QuestTaskUtils */;
value = value.hasPlayOnDesktopTask({quest: a0});
r0 = value;
}
return r0;
}
function getEligibleQuestsForApplicationId(a0, a1) { // fn#74319, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9710:2925, offset: 0x01d8a01f, size: 85 bytes, params: 3, frame: 13
var r0;
var Array;
let value = a2;
const env0_0 = a1;
if (value !== undefined) {
}
if (a1 == null) {
r0 = [];
} else {
Array = global.Array;
value = Array.from(a0.values());
value = value.filter(_fun74320);
r0 = value;
}
return r0;
}
function _fun74317(a0) { // fn#74317, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9710:2551, offset: 0x01d89f5f, size: 105 bytes, params: 2, frame: 16
var r0;
var moduleValue;
let value = environment.__proto__;
const value3 = questMatchesApplicationId(require, a0);
if (value3) {
moduleValue = require(7091) /* metro dependency 7091: QuestDataUtils */;
r0 = !moduleValue.isQuestExpired(a0);
} else {
r0 = value3;
}
if (r0) {
value = require(7116) /* metro dependency 7116: QuestTaskUtils */;
value = value.hasPlayOnDesktopTask({quest: a0});
r0 = value;
}
return r0;
}
function getEligibleQuestsForApplicationId(a0, a1) { // fn#74319, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9710:2925, offset: 0x01d8a01f, size: 85 bytes, params: 3, frame: 13
var r0;
var Array;
let value = a2;
const env0_0 = a1;
if (value !== undefined) {
}
if (a1 == null) {
r0 = [];
} else {
Array = global.Array;
value = Array.from(a0.values());
value = value.filter(_fun74320);
r0 = value;
}
return r0;
function _fun74320(a0) { // fn#74320, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9710:3027, offset: 0x01d8a074, size: 225 bytes, params: 2, frame: 17
var moduleValue3;
const value = environment.__proto__;
const value2 = undefined;
const activityApplicationId = (QuestTaskUtilsModule).getActivityApplicationId(a0);
let r0 = a0 != null && (require(7114) /* metro dependency 7114: QuestUtils */).canLaunchActivity(a0);
if (r0) {
moduleValue3 = require(7091) /* metro dependency 7091: QuestDataUtils */;
r0 = !moduleValue3.isQuestExpired(a0);
}
r0 = r0 && activityApplicationId === require && activityApplicationId !== DISCORD_APPLICATION_ID;
r0 = r0 && ((a0.userStatus == null ? value2 : a0.userStatus.completedAt) == null || env0_1) && ((a0.userStatus == null ? value2 : a0.userStatus.enrolledAt) == null || env0_1);
return r0;
}
function _fun74320(a0) { // fn#74320, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9710:3027, offset: 0x01d8a074, size: 225 bytes, params: 2, frame: 17
var moduleValue3;
const value = environment.__proto__;
const value2 = undefined;
const activityApplicationId = (require(7116) /* metro dependency 7116: QuestTaskUtils */).getActivityApplicationId(a0);
let r0 = a0 != null && (require(7114) /* metro dependency 7114: QuestUtils */).canLaunchActivity(a0);
if (r0) {
moduleValue3 = require(7091) /* metro dependency 7091: QuestDataUtils */;
r0 = !moduleValue3.isQuestExpired(a0);
}
r0 = r0 && activityApplicationId === require && activityApplicationId !== DISCORD_APPLICATION_ID;
r0 = r0 && ((a0.userStatus == null ? value2 : a0.userStatus.completedAt) == null || env0_1) && ((a0.userStatus == null ? value2 : a0.userStatus.enrolledAt) == null || env0_1);
return r0;
}
global.__d(_fun74307, 9524, [57, 4234, 6528, 661, 4237, 7116, 7091, 7114,
2]) /* metro module 9524, dependencies: [57, 4234, 6528, 661, 4237, 7116, 7091, 7114, 2] */;
@@ -1,51 +1,59 @@
/* Metro module 9503; source: modules/quests/utils/QuestOrbMultiplierUtils.tsx; dependencies: [3802, 1893, 1895, 5136, 2] */
import PremiumUtils from '../../../utils/PremiumUtils.tsx'; /* Metro dependency 3802 */
import * as FileImportTrackerModule from '../../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
function _fun74173(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#74173, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9689:6, offset: 0x01d83224, size: 228 bytes, params: 8, frame: 18
var object2;
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
object2 = {UPSELL: 'UPSELL', NITRO: 'NITRO', CREPE: 'CREPE', INELIGIBLE: 'INELIGIBLE'};
const CREPE = object2.CREPE;
object = {UPSELL: 'UPSELL', NITRO: 'NITRO', CREPE: 'CREPE', INELIGIBLE: 'INELIGIBLE'};
const CREPE = object.CREPE;
const items2 = [CREPE];
const NITRO = object2.NITRO;
const NITRO = object.NITRO;
items2[1] = NITRO;
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/quests/utils/QuestOrbMultiplierUtils.tsx');
exports.QuestOrbMultiplierEligibilityType = object2;
(FileImportTrackerModule).fileFinishedImporting('modules/quests/utils/QuestOrbMultiplierUtils.tsx');
exports.QuestOrbMultiplierEligibilityType = object;
exports.QuestOrbMultiplierSource = {NITRO: 'nitro', CREPE: 'crepe'};
exports.shouldReceiveQuestOrbMultiplier = shouldReceiveQuestOrbMultiplier;
exports.getQuestOrbMultiplierSource = getQuestOrbMultiplierSource;
}
function getQuestOrbMultiplierSource(a0) { // fn#74175, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9689:559, offset: 0x01d83308, size: 335 bytes, params: 2, frame: 18
var r1;
var defaultImport2;
var moduleValue;
var value3;
var perkSource;
const PerkSource = (require(1895) /* metro dependency 1895: user */).PerkSource;
var moduleValue2;
const value2 = undefined;
const defaultImport = importDefault(3802) /* metro dependency 3802: PremiumUtils */;
if (defaultImport.canUseMoreQuestOrbs(a0)) {
defaultImport2 = defaultImport;
if (defaultImport2.canUseQuestOrbMultiplier(a0)) {
return env0_3.NITRO;
}
moduleValue = require(1893) /* metro dependency 1893: PerksStateUtils */;
value3 = null;
perkSource = moduleValue.getPerkSource(value3 == a0 ? value2 : a0.perks,
(require(1895) /* metro dependency 1895: user */).Perk.MORE_QUEST_ORBS);
if (value3 == perkSource) {
moduleValue2 = require(5136) /* metro dependency 5136: CrepeExperiment */;
r1 = moduleValue2.getIsCrepeEnabled('getQuestOrbMultiplierSource') && value3 != perkSource && perkSource.includes(PerkSource.SOURCE_THIRDPARTY_CROISSANT) ? env0_3.CREPE : value3;
} else if (perkSource.includes(PerkSource.SOURCE_NITRO)) {
r1 = env0_3.NITRO;
} else {
moduleValue2 = require(5136) /* metro dependency 5136: CrepeExperiment */;
r1 = moduleValue2.getIsCrepeEnabled('getQuestOrbMultiplierSource') && value3 != perkSource && perkSource.includes(PerkSource.SOURCE_THIRDPARTY_CROISSANT) ? env0_3.CREPE : value3;
}
return r1;
function shouldReceiveQuestOrbMultiplier(a0) { // fn#74174, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9689:463, offset: 0x00e3c556, size: 22 bytes, params: 2, frame: 11
return env0_4.includes(a0);
}
return null;
function getQuestOrbMultiplierSource(a0) { // fn#74175, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9689:559, offset: 0x01d83308, size: 335 bytes, params: 2, frame: 18
var r1;
var defaultImport2;
var moduleValue;
var value3;
var perkSource;
const PerkSource = (require(1895) /* metro dependency 1895: user */).PerkSource;
var moduleValue2;
const value2 = undefined;
const defaultImport = PremiumUtils;
if (defaultImport.canUseMoreQuestOrbs(a0)) {
defaultImport2 = defaultImport;
if (defaultImport2.canUseQuestOrbMultiplier(a0)) {
return env0_3.NITRO;
}
moduleValue = require(1893) /* metro dependency 1893: PerksStateUtils */;
value3 = null;
perkSource = moduleValue.getPerkSource(value3 == a0 ? value2 : a0.perks,
(require(1895) /* metro dependency 1895: user */).Perk.MORE_QUEST_ORBS);
if (value3 == perkSource) {
moduleValue2 = require(5136) /* metro dependency 5136: CrepeExperiment */;
r1 = moduleValue2.getIsCrepeEnabled('getQuestOrbMultiplierSource') && value3 != perkSource && perkSource.includes(PerkSource.SOURCE_THIRDPARTY_CROISSANT) ? env0_3.CREPE : value3;
} else if (perkSource.includes(PerkSource.SOURCE_NITRO)) {
r1 = env0_3.NITRO;
} else {
moduleValue2 = require(5136) /* metro dependency 5136: CrepeExperiment */;
r1 = moduleValue2.getIsCrepeEnabled('getQuestOrbMultiplierSource') && value3 != perkSource && perkSource.includes(PerkSource.SOURCE_THIRDPARTY_CROISSANT) ? env0_3.CREPE : value3;
}
return r1;
}
return null;
}
}
global.__d(_fun74173, 9503, [3802, 1893, 1895, 5136,
2]) /* metro module 9503, dependencies: [3802, 1893, 1895, 5136, 2] */;
File diff suppressed because it is too large. Load diff
+341 -278
View File
@@ -1,4 +1,13 @@
/* Metro module 9500; source: modules/quests/utils/QuestRewardUtils.tsx; dependencies: [5121, 9501, 7098, 7091, 3381, 1244, 9502, 9503, 9504, 9505, 9506, 6531, 2] */
import CollectiblesCategoryStore from '../../collectibles/CollectiblesCategoryStore.tsx'; /* Metro dependency 5121 */
import * as FileImportTrackerModule from '../../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
import * as IndexNativeModule from '../../../intl/index.native.tsx'; /* Metro dependency 1244 */
import * as QuestTypesModule from '../QuestTypes.tsx'; /* Metro dependency 6531 */
import * as QuestRewardTypesModule from '../../../external/discord_common/js/shared/shared-constants/QuestRewardTypes.tsx'; /* Metro dependency 7098 */
import * as QuestRewardExpirationModeModule from '../../../external/discord_common/js/shared/shared-constants/QuestRewardExpirationMode.tsx'; /* Metro dependency 9501 */
import * as QuestCopyUtilsModule from './QuestCopyUtils.tsx'; /* Metro dependency 9505 */
import * as QuestRewardAssignmentMethodsModule from '../../../external/discord_common/js/shared/shared-constants/QuestRewardAssignmentMethods.tsx'; /* Metro dependency 9506 */
function _fun74129(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#74129, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9686:6, offset: 0x01d82096, size: 573 bytes, params: 8, frame: 27
const env0_0 = require;
const closure = function(a0) {
@@ -20,17 +29,16 @@ function _fun74129(global, require, importDefault, importAll, module, exports, d
const closure5 = function(a0) {
return a0.rewardsConfig.rewards.find(_fun74139)?.orbQuantity;
};
const closure6 = isCollectibleQuestRewardPremiumExtendable;
const closure7 = getQuestOrbMultiplier;
const closure8 = getQuestOrbRewardQuantityForUser;
const isCollectibleQuestRewardPremiumExtendable2 = isCollectibleQuestRewardPremiumExtendable;
const getQuestOrbMultiplier2 = getQuestOrbMultiplier;
const getQuestOrbRewardQuantityForUser2 = getQuestOrbRewardQuantityForUser;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const collectiblesCategoryStore = importDefault(5121) /* metro dependency 5121: CollectiblesCategoryStore */;
const Set = global.Set;
const {PREMIUM_EXTENSION,
PREMIUM_PERMANENT} = (require(9501) /* metro dependency 9501: QuestRewardExpirationMode */).QuestRewardExpirationMode;
PREMIUM_PERMANENT} = (QuestRewardExpirationModeModule).QuestRewardExpirationMode;
const set = new Set([PREMIUM_EXTENSION, PREMIUM_PERMANENT]);
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/quests/utils/QuestRewardUtils.tsx');
(FileImportTrackerModule).fileFinishedImporting('modules/quests/utils/QuestRewardUtils.tsx');
exports.getCollectiblesQuestReward = closure;
exports.getCollectibleQuestRewardExtendableExpirationDate = getCollectibleQuestRewardExtendableExpirationDate;
exports.getCollectibleQuestRewardDuration = getCollectibleQuestRewardDuration;
@@ -59,7 +67,7 @@ function _fun74129(global, require, importDefault, importAll, module, exports, d
}
return value2;
};
exports.isCollectibleQuestRewardPremiumExtendable = closure6;
exports.isCollectibleQuestRewardPremiumExtendable = isCollectibleQuestRewardPremiumExtendable2;
exports.isCollectibleQuestRewardPermanentWithPremiumSubscription = isCollectibleQuestRewardPermanentWithPremiumSubscription;
exports.getQuestPrimaryReward = function(a0) {
var property = a0.userStatus;
@@ -68,9 +76,9 @@ function _fun74129(global, require, importDefault, importAll, module, exports, d
property = a0.config;
return value ? property.rewardsConfig.rewards[r2] : property.rewards[r2];
};
exports.getQuestOrbMultiplier = closure7;
exports.getQuestOrbMultiplier = getQuestOrbMultiplier2;
exports.getQuestOrbMultiplierForUser = getQuestOrbMultiplierForUser;
exports.getQuestOrbRewardQuantityForUser = closure8;
exports.getQuestOrbRewardQuantityForUser = getQuestOrbRewardQuantityForUser2;
exports.getDefaultRewardName = function(a0, a1) {
return _getDefaultRewardName(a0, a1, false);
};
@@ -91,292 +99,347 @@ function _fun74129(global, require, importDefault, importAll, module, exports, d
return property.length > 0 ? property[0] : require(dependencyMap[11]).QuestRewardCodePlatforms.CROSS_PLATFORM;
};
exports.getPlatformString = getPlatformString;
}
function getCollectiblesQuestReward({rewardsConfig}) { // fn#74130, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9686:226, offset: 0x01d822d3, size: 99 bytes, params: 2, frame: 15
const value = rewardsConfig.rewards.find(function({type}) {
return type === require(dependencyMap[2]).QuestRewardTypes.COLLECTIBLE;
});
const type = value?.type;
const QuestRewardTypes = (QuestRewardTypesModule).QuestRewardTypes;
const COLLECTIBLE = QuestRewardTypes.COLLECTIBLE;
return type !== COLLECTIBLE ? null : value;
function _fun74131({type}) { // fn#74131, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9686:301, offset: 0x01d82336, size: 51 bytes, params: 2, frame: 12
const QuestRewardTypes = (QuestRewardTypesModule).QuestRewardTypes;
const COLLECTIBLE = QuestRewardTypes.COLLECTIBLE;
return type === COLLECTIBLE;
}
function getCollectiblesQuestReward({rewardsConfig}) { // fn#74130, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9686:226, offset: 0x01d822d3, size: 99 bytes, params: 2, frame: 15
const value = rewardsConfig.rewards.find(function({type}) {
return type === require(dependencyMap[2]).QuestRewardTypes.COLLECTIBLE;
});
const type = value?.type;
const QuestRewardTypes = (require(7098) /* metro dependency 7098: QuestRewardTypes */).QuestRewardTypes;
const COLLECTIBLE = QuestRewardTypes.COLLECTIBLE;
return type !== COLLECTIBLE ? null : value;
}
function hasFractionalPremiumQuestReward({rewardsConfig}) { // fn#74132, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9686:430, offset: 0x01d82369, size: 37 bytes, params: 2, frame: 11
return rewardsConfig.rewards.some(function({type}) {
return type === require(dependencyMap[2]).QuestRewardTypes.FRACTIONAL_PREMIUM;
});
}
function hasVirtualCurrencyReward({rewardsConfig}) { // fn#74134, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9686:570, offset: 0x01d823c1, size: 37 bytes, params: 2, frame: 11
return rewardsConfig.rewards.some(function({type}) {
return type === require(dependencyMap[2]).QuestRewardTypes.VIRTUAL_CURRENCY;
});
}
function hasPremiumOrbQuantity({rewardsConfig}) { // fn#74136, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9686:701, offset: 0x01d82419, size: 67 bytes, params: 2, frame: 12
const premiumOrbQuantity = rewardsConfig.rewards.find(function({type}) {
return type === require(dependencyMap[2]).QuestRewardTypes.VIRTUAL_CURRENCY;
})?.premiumOrbQuantity;
return premiumOrbQuantity != null && premiumOrbQuantity > 0;
}
function getVirtualCurrencyRewardOrbQuantity({rewardsConfig}) { // fn#74138, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9686:886, offset: 0x01d8245c, size: 54 bytes, params: 2, frame: 11
return rewardsConfig.rewards.find(function({type}) {
return type === require(dependencyMap[2]).QuestRewardTypes.VIRTUAL_CURRENCY;
})?.orbQuantity;
}
function isCollectibleQuestRewardPremiumExtendable(a0) { // fn#74140, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9686:1063, offset: 0x01d82492, size: 55 bytes, params: 2, frame: 13
const getCollectiblesQuestRewardBinding = getCollectiblesQuestReward;
const value2 = undefined;
const collectiblesQuestRewardBinding = getCollectiblesQuestRewardBinding(a0);
const expirationMode = collectiblesQuestRewardBinding == null ? value2 : collectiblesQuestRewardBinding.expirationMode;
return expirationMode != null && env0_3.has(expirationMode);
}
function getQuestOrbMultiplier({rewardsConfig}) { // fn#74141, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9686:1214, offset: 0x01d824c9, size: 158 bytes, params: 2, frame: 15
const value = rewardsConfig.rewards.find(function({type}) {
return type === require(dependencyMap[2]).QuestRewardTypes.VIRTUAL_CURRENCY;
});
const type = value?.type;
const QuestRewardTypes = (require(7098) /* metro dependency 7098: QuestRewardTypes */).QuestRewardTypes;
const VIRTUAL_CURRENCY = QuestRewardTypes.VIRTUAL_CURRENCY;
if (type !== VIRTUAL_CURRENCY) {
return null;
}
const premiumOrbQuantity = value.premiumOrbQuantity;
const orbQuantity = value.orbQuantity;
return premiumOrbQuantity == null || orbQuantity === 0 ? null : global.Math.round(premiumOrbQuantity / orbQuantity * 100) / 100;
}
function getQuestOrbRewardQuantityForUser(a0, a1) { // fn#74143, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9686:1519, offset: 0x01d82567, size: 158 bytes, params: 3, frame: 16
var r2;
var moduleValue2;
const value = a0.rewardsConfig.rewards.find(function({type}) {
return type === require(dependencyMap[2]).QuestRewardTypes.VIRTUAL_CURRENCY;
});
if (value == null) {
return null;
}
if (a1 == null) {
return value.orbQuantity;
}
if (hasPremiumOrbQuantity(a0)) {
moduleValue2 = require(9503) /* metro dependency 9503: QuestOrbMultiplierUtils */;
r2 = moduleValue2.shouldReceiveQuestOrbMultiplier((require(9502) /* metro dependency 9502: QuestOrbMultiplierHooks */).getQuestOrbMultiplierEligibilityForUser(a1)) && value.premiumOrbQuantity != null ? value.premiumOrbQuantity : value.orbQuantity;
} else {
r2 = value.orbQuantity;
}
return r2;
}
function hasFractionalPremiumQuestReward({rewardsConfig}) { // fn#74132, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9686:430, offset: 0x01d82369, size: 37 bytes, params: 2, frame: 11
return rewardsConfig.rewards.some(function({type}) {
return type === require(dependencyMap[2]).QuestRewardTypes.FRACTIONAL_PREMIUM;
});
function _fun74133({type}) { // fn#74133, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9686:511, offset: 0x01d8238e, size: 51 bytes, params: 2, frame: 12
const QuestRewardTypes = (QuestRewardTypesModule).QuestRewardTypes;
const FRACTIONAL_PREMIUM = QuestRewardTypes.FRACTIONAL_PREMIUM;
return type === FRACTIONAL_PREMIUM;
}
function _getDefaultRewardName(a0, a1, a2) { // fn#74145, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9686:1899, offset: 0x01d82605, size: 231 bytes, params: 4, frame: 18
var r7;
var intl;
if (hasFractionalPremiumQuestReward(a0)) {
return (require(9504) /* metro dependency 9504: FractionalPremiumUtils */).getFractionalPremiumQuestRewardName(a0);
}
if (hasVirtualCurrencyReward(a0)) {
r7 = getQuestOrbRewardQuantityForUser(a0, a1) ?? getVirtualCurrencyRewardOrbQuantity(a0) ?? 0;
intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
return intl.formatToPlainString((require(1244) /* metro dependency 1244: indexNative */).t['nLXlh+'],
{orbAmount: r7});
}
const value = require(9505) /* metro dependency 9505: QuestCopyUtils */;
const getDefaultReward = value.getDefaultReward;
const messages = Reflect.apply(getDefaultReward, value, [a0]).messages;
return a2 ? messages.nameWithArticle : messages.name;
}
function getCollectibleQuestRewardExtendableExpirationDate(a0) { // fn#74146, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9686:2580, offset: 0x01d826ec, size: 95 bytes, params: 2, frame: 14
var r0;
var value;
const collectiblesQuestReward = getCollectiblesQuestReward(a0);
const value3 = null;
if (value3 != collectiblesQuestReward) {
if ('expiresAtPremium' in collectiblesQuestReward) {
if (value3 != collectiblesQuestReward.expiresAtPremium) {
value = require(7091) /* metro dependency 7091: QuestDataUtils */;
value = value.getQuestFormattedDate(collectiblesQuestReward.expiresAtPremium);
r0 = value;
function hasVirtualCurrencyReward({rewardsConfig}) { // fn#74134, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9686:570, offset: 0x01d823c1, size: 37 bytes, params: 2, frame: 11
return rewardsConfig.rewards.some(function({type}) {
return type === require(dependencyMap[2]).QuestRewardTypes.VIRTUAL_CURRENCY;
});
function _fun74135({type}) { // fn#74135, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9686:644, offset: 0x01d823e6, size: 51 bytes, params: 2, frame: 12
const QuestRewardTypes = (QuestRewardTypesModule).QuestRewardTypes;
const VIRTUAL_CURRENCY = QuestRewardTypes.VIRTUAL_CURRENCY;
return type === VIRTUAL_CURRENCY;
}
}
function hasPremiumOrbQuantity({rewardsConfig}) { // fn#74136, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9686:701, offset: 0x01d82419, size: 67 bytes, params: 2, frame: 12
const premiumOrbQuantity = rewardsConfig.rewards.find(function({type}) {
return type === require(dependencyMap[2]).QuestRewardTypes.VIRTUAL_CURRENCY;
})?.premiumOrbQuantity;
return premiumOrbQuantity != null && premiumOrbQuantity > 0;
function _fun74137({type}) { // fn#74137, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9686:771, offset: 0x01d823e6, size: 51 bytes, params: 2, frame: 12
const QuestRewardTypes = (QuestRewardTypesModule).QuestRewardTypes;
const VIRTUAL_CURRENCY = QuestRewardTypes.VIRTUAL_CURRENCY;
return type === VIRTUAL_CURRENCY;
}
}
function getVirtualCurrencyRewardOrbQuantity({rewardsConfig}) { // fn#74138, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9686:886, offset: 0x01d8245c, size: 54 bytes, params: 2, frame: 11
return rewardsConfig.rewards.find(function({type}) {
return type === require(dependencyMap[2]).QuestRewardTypes.VIRTUAL_CURRENCY;
})?.orbQuantity;
function _fun74139({type}) { // fn#74139, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9686:970, offset: 0x01d823e6, size: 51 bytes, params: 2, frame: 12
const QuestRewardTypes = (QuestRewardTypesModule).QuestRewardTypes;
const VIRTUAL_CURRENCY = QuestRewardTypes.VIRTUAL_CURRENCY;
return type === VIRTUAL_CURRENCY;
}
}
function isCollectibleQuestRewardPremiumExtendable(a0) { // fn#74140, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9686:1063, offset: 0x01d82492, size: 55 bytes, params: 2, frame: 13
const getCollectiblesQuestRewardBinding = getCollectiblesQuestReward;
const value2 = undefined;
const collectiblesQuestRewardBinding = getCollectiblesQuestRewardBinding(a0);
const expirationMode = collectiblesQuestRewardBinding == null ? value2 : collectiblesQuestRewardBinding.expirationMode;
return expirationMode != null && env0_3.has(expirationMode);
}
function getQuestOrbMultiplier({rewardsConfig}) { // fn#74141, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9686:1214, offset: 0x01d824c9, size: 158 bytes, params: 2, frame: 15
const value = rewardsConfig.rewards.find(function({type}) {
return type === require(dependencyMap[2]).QuestRewardTypes.VIRTUAL_CURRENCY;
});
const type = value?.type;
const QuestRewardTypes = (QuestRewardTypesModule).QuestRewardTypes;
const VIRTUAL_CURRENCY = QuestRewardTypes.VIRTUAL_CURRENCY;
if (type !== VIRTUAL_CURRENCY) {
return null;
}
const premiumOrbQuantity = value.premiumOrbQuantity;
const orbQuantity = value.orbQuantity;
return premiumOrbQuantity == null || orbQuantity === 0 ? null : global.Math.round(premiumOrbQuantity / orbQuantity * 100) / 100;
}
function getQuestOrbRewardQuantityForUser(a0, a1) { // fn#74143, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9686:1519, offset: 0x01d82567, size: 158 bytes, params: 3, frame: 16
var r2;
var moduleValue2;
const value = a0.rewardsConfig.rewards.find(function({type}) {
return type === require(dependencyMap[2]).QuestRewardTypes.VIRTUAL_CURRENCY;
});
if (value == null) {
return null;
}
if (a1 == null) {
return value.orbQuantity;
}
if (hasPremiumOrbQuantity(a0)) {
moduleValue2 = require(9503) /* metro dependency 9503: QuestOrbMultiplierUtils */;
r2 = moduleValue2.shouldReceiveQuestOrbMultiplier((require(9502) /* metro dependency 9502: QuestOrbMultiplierHooks */).getQuestOrbMultiplierEligibilityForUser(a1)) && value.premiumOrbQuantity != null ? value.premiumOrbQuantity : value.orbQuantity;
} else {
r2 = value.orbQuantity;
}
return r2;
}
function _getDefaultRewardName(a0, a1, a2) { // fn#74145, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9686:1899, offset: 0x01d82605, size: 231 bytes, params: 4, frame: 18
var r7;
var intl;
if (hasFractionalPremiumQuestReward(a0)) {
return (require(9504) /* metro dependency 9504: FractionalPremiumUtils */).getFractionalPremiumQuestRewardName(a0);
}
if (hasVirtualCurrencyReward(a0)) {
r7 = getQuestOrbRewardQuantityForUser(a0, a1) ?? getVirtualCurrencyRewardOrbQuantity(a0) ?? 0;
intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
return intl.formatToPlainString((require(1244) /* metro dependency 1244: indexNative */).t['nLXlh+'],
{orbAmount: r7});
}
const getDefaultReward = QuestCopyUtilsModule.getDefaultReward;
const messages = Reflect.apply(getDefaultReward, QuestCopyUtilsModule, [a0]).messages;
return a2 ? messages.nameWithArticle : messages.name;
}
function getCollectibleQuestRewardExtendableExpirationDate(a0) { // fn#74146, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9686:2580, offset: 0x01d826ec, size: 95 bytes, params: 2, frame: 14
var r0;
var value;
const collectiblesQuestReward = getCollectiblesQuestReward(a0);
const value3 = null;
if (value3 != collectiblesQuestReward) {
if ('expiresAtPremium' in collectiblesQuestReward) {
if (value3 != collectiblesQuestReward.expiresAtPremium) {
value = require(7091) /* metro dependency 7091: QuestDataUtils */;
value = value.getQuestFormattedDate(collectiblesQuestReward.expiresAtPremium);
r0 = value;
} else {
r0 = value3;
}
} else {
r0 = value3;
}
} else {
r0 = value3;
}
} else {
r0 = value3;
return r0;
}
return r0;
}
function getCollectibleQuestRewardDuration(a0) { // fn#74147, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9686:2836, offset: 0x01d8274b, size: 554 bytes, params: 2, frame: 22
var expiresAt;
var Date;
var prototype;
var value3;
var date;
var value4;
var value5;
var value6;
var value7;
var value8;
var value9;
var value11;
var value12;
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
const t = (require(1244) /* metro dependency 1244: indexNative */).t;
const collectiblesQuestReward = getCollectiblesQuestReward(a0);
if (collectiblesQuestReward != null) {
if ('expiresAt' in collectiblesQuestReward) {
expiresAt = collectiblesQuestReward.expiresAt;
if (expiresAt == null) {
return null;
function getCollectibleQuestRewardDuration(a0) { // fn#74147, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9686:2836, offset: 0x01d8274b, size: 554 bytes, params: 2, frame: 22
var expiresAt;
var Date;
var prototype;
var value3;
var date;
var value4;
var value5;
var value6;
var value7;
var value8;
var value9;
var value11;
var value12;
const intl = (IndexNativeModule).intl;
const t = (IndexNativeModule).t;
const collectiblesQuestReward = getCollectiblesQuestReward(a0);
if (collectiblesQuestReward != null) {
if ('expiresAt' in collectiblesQuestReward) {
expiresAt = collectiblesQuestReward.expiresAt;
if (expiresAt == null) {
return null;
}
Date = global.Date;
expiresAt = a0.expiresAt;
prototype = Date.prototype;
value3 = Object.create(prototype, {constructor: {value: Date}});
date = new Date();
value4 = date instanceof Object ? date : value3;
Date = global.Date;
expiresAt = collectiblesQuestReward.expiresAt;
prototype = Date.prototype;
value5 = Object.create(prototype, {constructor: {value: Date}});
date = new Date();
value6 = date instanceof Object ? date : value5;
value7 = (require(3381) /* metro dependency 3381 */).differenceInDays(value6, value4);
value8 = global.Math.floor(value7 / 30);
value9 = 0;
value11 = value8 + (value7 % 30 >= 25 ? 1 : value9);
if (value11 >= 12) {
return intl.formatToPlainString(t.PClsrw, {years: global.Math.floor(value11 / 12)});
}
if (value11 > value9) {
return intl.formatToPlainString(t.kridzK, {months: value11});
}
value12 = (require(3381) /* metro dependency 3381 */).differenceInDays(value6, value4);
if (value12 >= 7) {
return intl.formatToPlainString(t.EmoBD2, {weeks: global.Math.ceil(value12 / 7)});
}
return intl.formatToPlainString(t['k2UNz+'], {days: value12});
}
Date = global.Date;
expiresAt = a0.expiresAt;
prototype = Date.prototype;
value3 = Object.create(prototype, {constructor: {value: Date}});
date = new Date();
value4 = date instanceof Object ? date : value3;
Date = global.Date;
expiresAt = collectiblesQuestReward.expiresAt;
prototype = Date.prototype;
value5 = Object.create(prototype, {constructor: {value: Date}});
date = new Date();
value6 = date instanceof Object ? date : value5;
value7 = (require(3381) /* metro dependency 3381 */).differenceInDays(value6, value4);
value8 = global.Math.floor(value7 / 30);
value9 = 0;
value11 = value8 + (value7 % 30 >= 25 ? 1 : value9);
if (value11 >= 12) {
return intl.formatToPlainString(t.PClsrw, {years: global.Math.floor(value11 / 12)});
}
if (value11 > value9) {
return intl.formatToPlainString(t.kridzK, {months: value11});
}
value12 = (require(3381) /* metro dependency 3381 */).differenceInDays(value6, value4);
if (value12 >= 7) {
return intl.formatToPlainString(t.EmoBD2, {weeks: global.Math.ceil(value12 / 7)});
}
return intl.formatToPlainString(t['k2UNz+'], {days: value12});
}
return null;
}
function hasCollectiblesQuestReward(a0) { // fn#74148, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9686:3683, offset: 0x01d82975, size: 25 bytes, params: 2, frame: 11
return getCollectiblesQuestReward(a0) != null;
}
function hasInGameQuestReward({rewardsConfig}) { // fn#74149, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9686:3789, offset: 0x01d8298e, size: 37 bytes, params: 2, frame: 11
return rewardsConfig.rewards.some(function({type}) {
return type === require(dependencyMap[2]).QuestRewardTypes.IN_GAME;
});
function _fun74150({type}) { // fn#74150, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9686:3859, offset: 0x01d829b3, size: 51 bytes, params: 2, frame: 12
const QuestRewardTypes = (QuestRewardTypesModule).QuestRewardTypes;
const IN_GAME = QuestRewardTypes.IN_GAME;
return type === IN_GAME;
}
}
function hasQuestRewardCode({rewardsConfig}) { // fn#74151, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9686:3929, offset: 0x01d829e6, size: 37 bytes, params: 2, frame: 11
return rewardsConfig.rewards.some(function({type}) {
return type === require(dependencyMap[2]).QuestRewardTypes.REWARD_CODE;
});
function _fun74152({type}) { // fn#74152, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9686:3997, offset: 0x01d82a0b, size: 51 bytes, params: 2, frame: 12
const QuestRewardTypes = (QuestRewardTypesModule).QuestRewardTypes;
const REWARD_CODE = QuestRewardTypes.REWARD_CODE;
return type === REWARD_CODE;
}
}
function getInGameQuestReward({rewardsConfig}) { // fn#74153, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9686:4073, offset: 0x01d82a3e, size: 49 bytes, params: 2, frame: 11
return rewardsConfig.rewards.find(function({type}) {
return type === require(dependencyMap[2]).QuestRewardTypes.IN_GAME;
}) ?? null;
function _fun74154({type}) { // fn#74154, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9686:4158, offset: 0x01d829b3, size: 51 bytes, params: 2, frame: 12
const QuestRewardTypes = (QuestRewardTypesModule).QuestRewardTypes;
const IN_GAME = QuestRewardTypes.IN_GAME;
return type === IN_GAME;
}
}
function getCollectiblesQuestRewardItem(a0) { // fn#74155, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9686:4248, offset: 0x01d82a6f, size: 92 bytes, params: 2, frame: 14
const getCollectiblesQuestRewardBinding = getCollectiblesQuestReward;
const value2 = undefined;
const collectiblesQuestRewardBinding = getCollectiblesQuestRewardBinding(a0);
const value4 = null;
const product = CollectiblesCategoryStore.getProduct(value4 == collectiblesQuestRewardBinding ? value2 : collectiblesQuestRewardBinding.skuId);
const r1 = value4 == product || value4 == product.items ? value2 : product.items[0];
return value4 != r1 ? r1 : value4;
}
function getVirtualCurrencyRewardPremiumOrbQuantity({rewardsConfig}) { // fn#74156, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9686:4559, offset: 0x01d82acb, size: 102 bytes, params: 2, frame: 14
const value = rewardsConfig.rewards.find(function({type}) {
return type === require(dependencyMap[2]).QuestRewardTypes.VIRTUAL_CURRENCY;
});
const type = value?.type;
const QuestRewardTypes = (QuestRewardTypesModule).QuestRewardTypes;
const VIRTUAL_CURRENCY = QuestRewardTypes.VIRTUAL_CURRENCY;
if (type === VIRTUAL_CURRENCY) {
return value.premiumOrbQuantity;
}
function _fun74157({type}) { // fn#74157, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9686:4650, offset: 0x01d823e6, size: 51 bytes, params: 2, frame: 12
const QuestRewardTypes = (QuestRewardTypesModule).QuestRewardTypes;
const VIRTUAL_CURRENCY = QuestRewardTypes.VIRTUAL_CURRENCY;
return type === VIRTUAL_CURRENCY;
}
}
function isCollectibleQuestRewardPermanentWithPremiumSubscription(a0) { // fn#74158, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9686:4953, offset: 0x01d82b31, size: 84 bytes, params: 2, frame: 14
var r0;
var collectiblesQuestReward;
const isCollectibleQuestRewardPremiumExtendableBinding = isCollectibleQuestRewardPremiumExtendable;
const value2 = undefined;
const isCollectibleQuestRewardPremiumExtendable2 = isCollectibleQuestRewardPremiumExtendableBinding(a0);
if (isCollectibleQuestRewardPremiumExtendable2) {
collectiblesQuestReward = getCollectiblesQuestReward(a0);
r0 = (collectiblesQuestReward == null ? value2 : collectiblesQuestReward.expirationMode) === (require(9501) /* metro dependency 9501: QuestRewardExpirationMode */).QuestRewardExpirationMode.PREMIUM_PERMANENT;
} else {
r0 = isCollectibleQuestRewardPremiumExtendable2;
}
return r0;
}
function getQuestOrbMultiplierForUser(a0, a1) { // fn#74160, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9686:5494, offset: 0x01d82be0, size: 132 bytes, params: 3, frame: 17
var r0;
if (a1 == null) {
return 1;
}
var value;
const questOrbMultiplier = getQuestOrbMultiplier(a0);
const value3 = 1;
if (hasPremiumOrbQuantity(a0)) {
value = require(9503) /* metro dependency 9503: QuestOrbMultiplierUtils */;
r0 = value.shouldReceiveQuestOrbMultiplier((require(9502) /* metro dependency 9502: QuestOrbMultiplierHooks */).getQuestOrbMultiplierEligibilityForUser(a1)) ? questOrbMultiplier ?? value3 : value3;
} else {
r0 = value3;
}
return r0;
}
function isTieredRewardCodeQuest({quest}) { // fn#74164, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9686:6255, offset: 0x01d82cfa, size: 119 bytes, params: 2, frame: 13
const rewardsConfig = quest.config.rewardsConfig;
const assignmentMethod = rewardsConfig.assignmentMethod;
const QuestRewardAssignmentMethods = (QuestRewardAssignmentMethodsModule).QuestRewardAssignmentMethods;
const TIERED = QuestRewardAssignmentMethods.TIERED;
return assignmentMethod === TIERED && rewardsConfig.rewards.length > 0 && rewardsConfig.rewards.every(function({type}) {
return type === require(dependencyMap[2]).QuestRewardTypes.REWARD_CODE;
});
}
function getPlatformString(a0) { // fn#74167, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9686:6673, offset: 0x01d82db8, size: 482 bytes, params: 2, frame: 15
const intl = (IndexNativeModule).intl;
const t = (IndexNativeModule).t;
const QuestRewardCodePlatforms = (QuestTypesModule).QuestRewardCodePlatforms;
const XBOX = QuestRewardCodePlatforms.XBOX;
if (XBOX === a0) {
return intl.string(t.G84UWZ);
}
const PLAYSTATION = QuestRewardCodePlatforms.PLAYSTATION;
if (PLAYSTATION === a0) {
return intl.string(t['6IeKx2']);
}
const SWITCH = QuestRewardCodePlatforms.SWITCH;
if (SWITCH === a0) {
return intl.string(t['1pp0su']);
}
const PC = QuestRewardCodePlatforms.PC;
if (PC === a0) {
return intl.string(t['YK+wUg']);
}
const CROSS_PLATFORM = QuestRewardCodePlatforms.CROSS_PLATFORM;
if (CROSS_PLATFORM === a0) {
return intl.string(t.UWVbzV);
}
}
return null;
}
function hasCollectiblesQuestReward(a0) { // fn#74148, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9686:3683, offset: 0x01d82975, size: 25 bytes, params: 2, frame: 11
return getCollectiblesQuestReward(a0) != null;
}
function hasInGameQuestReward({rewardsConfig}) { // fn#74149, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9686:3789, offset: 0x01d8298e, size: 37 bytes, params: 2, frame: 11
return rewardsConfig.rewards.some(function({type}) {
return type === require(dependencyMap[2]).QuestRewardTypes.IN_GAME;
});
}
function hasQuestRewardCode({rewardsConfig}) { // fn#74151, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9686:3929, offset: 0x01d829e6, size: 37 bytes, params: 2, frame: 11
return rewardsConfig.rewards.some(function({type}) {
return type === require(dependencyMap[2]).QuestRewardTypes.REWARD_CODE;
});
}
function getInGameQuestReward({rewardsConfig}) { // fn#74153, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9686:4073, offset: 0x01d82a3e, size: 49 bytes, params: 2, frame: 11
return rewardsConfig.rewards.find(function({type}) {
return type === require(dependencyMap[2]).QuestRewardTypes.IN_GAME;
}) ?? null;
}
function getCollectiblesQuestRewardItem(a0) { // fn#74155, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9686:4248, offset: 0x01d82a6f, size: 92 bytes, params: 2, frame: 14
const getCollectiblesQuestRewardBinding = getCollectiblesQuestReward;
const value2 = undefined;
const collectiblesQuestRewardBinding = getCollectiblesQuestRewardBinding(a0);
const value4 = null;
const product = CollectiblesCategoryStore.getProduct(value4 == collectiblesQuestRewardBinding ? value2 : collectiblesQuestRewardBinding.skuId);
const r1 = value4 == product || value4 == product.items ? value2 : product.items[0];
return value4 != r1 ? r1 : value4;
}
function getVirtualCurrencyRewardPremiumOrbQuantity({rewardsConfig}) { // fn#74156, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9686:4559, offset: 0x01d82acb, size: 102 bytes, params: 2, frame: 14
const value = rewardsConfig.rewards.find(function({type}) {
return type === require(dependencyMap[2]).QuestRewardTypes.VIRTUAL_CURRENCY;
});
const type = value?.type;
const QuestRewardTypes = (require(7098) /* metro dependency 7098: QuestRewardTypes */).QuestRewardTypes;
const VIRTUAL_CURRENCY = QuestRewardTypes.VIRTUAL_CURRENCY;
if (type === VIRTUAL_CURRENCY) {
return value.premiumOrbQuantity;
}
}
function isCollectibleQuestRewardPermanentWithPremiumSubscription(a0) { // fn#74158, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9686:4953, offset: 0x01d82b31, size: 84 bytes, params: 2, frame: 14
var r0;
var collectiblesQuestReward;
const isCollectibleQuestRewardPremiumExtendableBinding = isCollectibleQuestRewardPremiumExtendable;
const value2 = undefined;
const isCollectibleQuestRewardPremiumExtendable2 = isCollectibleQuestRewardPremiumExtendableBinding(a0);
if (isCollectibleQuestRewardPremiumExtendable2) {
collectiblesQuestReward = getCollectiblesQuestReward(a0);
r0 = (collectiblesQuestReward == null ? value2 : collectiblesQuestReward.expirationMode) === (require(9501) /* metro dependency 9501: QuestRewardExpirationMode */).QuestRewardExpirationMode.PREMIUM_PERMANENT;
} else {
r0 = isCollectibleQuestRewardPremiumExtendable2;
}
return r0;
}
function getQuestOrbMultiplierForUser(a0, a1) { // fn#74160, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9686:5494, offset: 0x01d82be0, size: 132 bytes, params: 3, frame: 17
var r0;
if (a1 == null) {
return 1;
}
var value;
const questOrbMultiplier = getQuestOrbMultiplier(a0);
const value3 = 1;
if (hasPremiumOrbQuantity(a0)) {
value = require(9503) /* metro dependency 9503: QuestOrbMultiplierUtils */;
r0 = value.shouldReceiveQuestOrbMultiplier((require(9502) /* metro dependency 9502: QuestOrbMultiplierHooks */).getQuestOrbMultiplierEligibilityForUser(a1)) ? questOrbMultiplier ?? value3 : value3;
} else {
r0 = value3;
}
return r0;
}
function isTieredRewardCodeQuest({quest}) { // fn#74164, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9686:6255, offset: 0x01d82cfa, size: 119 bytes, params: 2, frame: 13
const rewardsConfig = quest.config.rewardsConfig;
const assignmentMethod = rewardsConfig.assignmentMethod;
const QuestRewardAssignmentMethods = (require(9506) /* metro dependency 9506: QuestRewardAssignmentMethods */).QuestRewardAssignmentMethods;
const TIERED = QuestRewardAssignmentMethods.TIERED;
return assignmentMethod === TIERED && rewardsConfig.rewards.length > 0 && rewardsConfig.rewards.every(function({type}) {
return type === require(dependencyMap[2]).QuestRewardTypes.REWARD_CODE;
});
}
function getPlatformString(a0) { // fn#74167, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9686:6673, offset: 0x01d82db8, size: 482 bytes, params: 2, frame: 15
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
const t = (require(1244) /* metro dependency 1244: indexNative */).t;
const QuestRewardCodePlatforms = (require(6531) /* metro dependency 6531: QuestTypes */).QuestRewardCodePlatforms;
const XBOX = QuestRewardCodePlatforms.XBOX;
if (XBOX === a0) {
return intl.string(t.G84UWZ);
}
const PLAYSTATION = QuestRewardCodePlatforms.PLAYSTATION;
if (PLAYSTATION === a0) {
return intl.string(t['6IeKx2']);
}
const SWITCH = QuestRewardCodePlatforms.SWITCH;
if (SWITCH === a0) {
return intl.string(t['1pp0su']);
}
const PC = QuestRewardCodePlatforms.PC;
if (PC === a0) {
return intl.string(t['YK+wUg']);
}
const CROSS_PLATFORM = QuestRewardCodePlatforms.CROSS_PLATFORM;
if (CROSS_PLATFORM === a0) {
return intl.string(t.UWVbzV);
}
}
global.__d(_fun74129, 9500, [5121, 9501, 7098, 7091, 3381, 1244, 9502, 9503, 9504, 9505, 9506, 6531,
2]) /* metro module 9500, dependencies: [5121, 9501, 7098, 7091, 3381, 1244, 9502, 9503, 9504, 9505, 9506, 6531, 2] */;
+191 -185
View File
@@ -1,8 +1,14 @@
/* Metro module 7100; source: modules/quests/utils/QuestServerUtils.tsx; dependencies: [57, 4242, 7101, 7098, 2] */
import Module00057 from '../../../by-id/module-00057.js'; /* Metro dependency 57 */
import * as FileImportTrackerModule from '../../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
import * as Module04242Module from '../../../by-id/module-04242.js'; /* Metro dependency 4242 */
import * as QuestRewardTypesModule from '../../../external/discord_common/js/shared/shared-constants/QuestRewardTypes.tsx'; /* Metro dependency 7098 */
import * as QuestModule from '../types/v2/Quest.tsx'; /* Metro dependency 7101 */
function _fun56749(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#56749, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7278:6, offset: 0x013d03df, size: 246 bytes, params: 8, frame: 21
const env0_0 = require;
const closure = questConfigFromServer;
const closure2 = questUserStatusFromServer;
const questConfigFromServer2 = questConfigFromServer;
const questUserStatusFromServer2 = questUserStatusFromServer;
const closure3 = function(a0) {
var tier = a0.tier;
var value = null;
@@ -18,11 +24,10 @@ function _fun56749(global, require, importDefault, importAll, module, exports, d
};
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_2 = importDefault(57) /* metro dependency 57 */;
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/quests/utils/QuestServerUtils.tsx');
(FileImportTrackerModule).fileFinishedImporting('modules/quests/utils/QuestServerUtils.tsx');
exports.isQuestWithKnownConfigVersion = isQuestWithKnownConfigVersion;
exports.questConfigFromServer = closure;
exports.questUserStatusFromServer = closure2;
exports.questConfigFromServer = questConfigFromServer2;
exports.questUserStatusFromServer = questUserStatusFromServer2;
exports.questWithUserStatusFromServer = questWithUserStatusFromServer;
exports.excludedQuestFromServer = function(a0) {
return {id: a0.id, replacementId: a0.replacement_id};
@@ -35,195 +40,196 @@ function _fun56749(global, require, importDefault, importAll, module, exports, d
object.errors = a0.errors;
return object;
};
}
function questConfigFromServer(a0) { // fn#56750, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7278:108, offset: 0x013d04d5, size: 80 bytes, params: 2, frame: 13
let value = require(4242) /* metro dependency 4242 */;
value = value.match(a0);
value = value.with({config_version: 2}, _fun56751);
return value.exhaustive();
}
function progressFromServer(a0) { // fn#56752, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7278:238, offset: 0x013d054e, size: 189 bytes, params: 2, frame: 24
var r2;
var r11;
var property;
var value5;
var property2;
var event_name;
var value6;
var updated_at;
var completed_at;
var heartbeat;
var last_beat_at;
var expires_at;
var value7;
const object2 = {};
const Object = global.Object;
const value = Object.entries(a0);
let length = value.length;
const value2 = 0;
const value4 = null;
if (value2 < length) {
r2 = value2;
while (true) {
property = value[r2];
value5 = env0_2(property, 2);
property = value5[value2];
property2 = value5[1];
event_name = property2.event_name;
value6 = property2.value;
updated_at = property2.updated_at;
completed_at = property2.completed_at;
heartbeat = property2.heartbeat;
if (value4 == heartbeat) {
r11 = value4;
} else {
last_beat_at = heartbeat.last_beat_at;
expires_at = heartbeat.expires_at;
r11 = {lastBeatAt: last_beat_at, expiresAt: expires_at};
}
object2[property] = {eventName: event_name, value: value6, updatedAt: updated_at, completedAt: completed_at,
heartbeat: r11};
value7 = typeof r2 === 'bigint' ? r2 + 1n : +r2 + 1;
length = value.length;
if (value7 < length) {
r2 = value7;
continue;
}
break;
function questConfigFromServer(a0) { // fn#56750, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7278:108, offset: 0x013d04d5, size: 80 bytes, params: 2, frame: 13
let value = Module04242Module;
value = value.match(a0);
value = value.with({config_version: 2}, _fun56751);
return value.exhaustive();
function _fun56751(a0) { // fn#56751, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7278:191, offset: 0x013d0525, size: 41 bytes, params: 2, frame: 11
const value = environment.__proto__;
return (QuestModule).questFromServerV2(a0);
}
}
return object2;
}
function questUserStatusFromServer({user_id, quest_id, enrolled_at, completed_at, claimed_at, claimed_tier, orb_quantity_claimed, last_stream_heartbeat_at, stream_progress_seconds, dismissed_quest_content, progress}) { // fn#56753, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7278:551, offset: 0x013d060b, size: 179 bytes, params: 2, frame: 14
const object2 = {};
object2.userId = user_id;
object2.questId = quest_id;
object2.enrolledAt = enrolled_at;
object2.completedAt = completed_at;
object2.claimedAt = claimed_at;
object2.claimedTier = claimed_tier ?? null;
object2.orbQuantityClaimed = orb_quantity_claimed ?? null;
object2.lastStreamHeartbeatAt = last_stream_heartbeat_at;
object2.streamProgressSeconds = stream_progress_seconds;
object2.dismissedQuestContent = dismissed_quest_content;
object2.progress = progressFromServer(progress);
return object2;
}
function getSimpleRewardFromServer(a0) { // fn#56754, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7278:1004, offset: 0x013d06be, size: 193 bytes, params: 2, frame: 13
const type = a0.type;
const QuestRewardTypes = (require(7098) /* metro dependency 7098: QuestRewardTypes */).QuestRewardTypes;
const VIRTUAL_CURRENCY = QuestRewardTypes.VIRTUAL_CURRENCY;
return type === VIRTUAL_CURRENCY ? {skuId: a0.sku_id, type: a0.type, name: a0.name,
nameWithArticle: a0.name_with_article, collectibleProduct: a0.collectible_product,
orbQuantity: a0.orb_quantity} : {skuId: a0.sku_id, type: a0.type, name: a0.name,
nameWithArticle: a0.name_with_article, asset: a0.asset, assetVideo: a0.asset_video,
collectibleProduct: a0.collectible_product};
}
function getClaimedQuestFromServer(a0) { // fn#56755, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7278:1402, offset: 0x013d077f, size: 394 bytes, params: 2, frame: 14
const object2 = {};
object2.id = a0.id;
object2.startsAt = a0.starts_at;
object2.expiresAt = a0.expires_at;
object2.features = a0.features;
object2.messages = {questName: a0.messages.quest_name, gamePublisher: a0.messages.game_publisher,
gameTitle: a0.messages.game_title};
object2.assets = {hero: a0.assets.hero, heroVideo: a0.assets.hero_video, questBarHero: a0.assets.quest_bar_hero,
questBarHeroVideo: a0.assets.quest_bar_hero_video, gameTile: a0.assets.game_tile, logotype: a0.assets.logotype,
logotypeLight: a0.assets.logotype_light, logotypeDark: a0.assets.logotype_dark,
gameTileLight: a0.assets.game_tile_light, gameTileDark: a0.assets.game_tile_dark};
object2.colors = {primary: a0.colors.primary, secondary: a0.colors.secondary};
const rewards = a0.rewards;
object2.rewards = rewards.map(getSimpleRewardFromServer);
const value = require(7101) /* metro dependency 7101: Quest */;
object2.cosponsorMetadata = value.questCosponsorMetadataFromServer(a0.cosponsor_metadata);
return object2;
}
function _questsTenantMetadataFromServer(a0) { // fn#56757, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7278:2349, offset: 0x013d095b, size: 216 bytes, params: 2, frame: 16
var object;
var questsRewardCodeFromServerBinding;
const value = undefined;
let quest_rewards = a0 == null ? value : a0.quest_rewards;
if (quest_rewards == null) {
return null;
function progressFromServer(a0) { // fn#56752, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7278:238, offset: 0x013d054e, size: 189 bytes, params: 2, frame: 24
var r2;
var r11;
var property;
var value5;
var property2;
var event_name;
var value6;
var updated_at;
var completed_at;
var heartbeat;
var last_beat_at;
var expires_at;
var value7;
const object = {};
const Object = global.Object;
const value = Object.entries(a0);
let length = value.length;
const value2 = 0;
const value4 = null;
if (value2 < length) {
r2 = value2;
while (true) {
property = value[r2];
value5 = Module00057(property, 2);
property = value5[value2];
property2 = value5[1];
event_name = property2.event_name;
value6 = property2.value;
updated_at = property2.updated_at;
completed_at = property2.completed_at;
heartbeat = property2.heartbeat;
if (value4 == heartbeat) {
r11 = value4;
} else {
last_beat_at = heartbeat.last_beat_at;
expires_at = heartbeat.expires_at;
r11 = {lastBeatAt: last_beat_at, expiresAt: expires_at};
}
object[property] = {eventName: event_name, value: value6, updatedAt: updated_at, completedAt: completed_at,
heartbeat: r11};
value7 = typeof r2 === 'bigint' ? r2 + 1n : +r2 + 1;
length = value.length;
if (value7 < length) {
r2 = value7;
continue;
}
break;
}
}
return object;
}
quest_rewards = a0.quest_rewards;
let reward = quest_rewards.reward;
const tag = reward.tag;
const QuestRewardTypes = (require(7098) /* metro dependency 7098: QuestRewardTypes */).QuestRewardTypes;
const IN_GAME = QuestRewardTypes.IN_GAME;
if (IN_GAME === tag) {
return {questRewards: {reward: {tag: quest_rewards.reward.tag}}};
function questUserStatusFromServer({user_id, quest_id, enrolled_at, completed_at, claimed_at, claimed_tier, orb_quantity_claimed, last_stream_heartbeat_at, stream_progress_seconds, dismissed_quest_content, progress}) { // fn#56753, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7278:551, offset: 0x013d060b, size: 179 bytes, params: 2, frame: 14
const object = {};
object.userId = user_id;
object.questId = quest_id;
object.enrolledAt = enrolled_at;
object.completedAt = completed_at;
object.claimedAt = claimed_at;
object.claimedTier = claimed_tier ?? null;
object.orbQuantityClaimed = orb_quantity_claimed ?? null;
object.lastStreamHeartbeatAt = last_stream_heartbeat_at;
object.streamProgressSeconds = stream_progress_seconds;
object.dismissedQuestContent = dismissed_quest_content;
object.progress = progressFromServer(progress);
return object;
}
const REWARD_CODE = QuestRewardTypes.REWARD_CODE;
if (REWARD_CODE === tag) {
object = {};
reward = quest_rewards.reward;
object.tag = reward.tag;
questsRewardCodeFromServerBinding = questsRewardCodeFromServer;
reward = quest_rewards.reward;
object.rewardCode = questsRewardCodeFromServerBinding(reward.reward_code);
return {questRewards: {reward: object}};
function getSimpleRewardFromServer(a0) { // fn#56754, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7278:1004, offset: 0x013d06be, size: 193 bytes, params: 2, frame: 13
const type = a0.type;
const QuestRewardTypes = (QuestRewardTypesModule).QuestRewardTypes;
const VIRTUAL_CURRENCY = QuestRewardTypes.VIRTUAL_CURRENCY;
return type === VIRTUAL_CURRENCY ? {skuId: a0.sku_id, type: a0.type, name: a0.name,
nameWithArticle: a0.name_with_article, collectibleProduct: a0.collectible_product,
orbQuantity: a0.orb_quantity} : {skuId: a0.sku_id, type: a0.type, name: a0.name,
nameWithArticle: a0.name_with_article, asset: a0.asset, assetVideo: a0.asset_video,
collectibleProduct: a0.collectible_product};
}
return value;
}
function isQuestWithKnownConfigVersion(a0) { // fn#56759, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7278:2987, offset: 0x013d0a68, size: 92 bytes, params: 2, frame: 13
var environment;
var value;
var property;
var match;
var config;
var closure;
var error;
try {
value = environment;
property = dependencyMap[1];
value = require(property);
match = value.match;
config = a0.config;
value = Reflect.apply(match, value, [config]);
closure = function() {
return true;
};
value = value.with({config_version: 2}, closure);
value = value.exhaustive();
} catch (error) {
return false;
function getClaimedQuestFromServer(a0) { // fn#56755, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7278:1402, offset: 0x013d077f, size: 394 bytes, params: 2, frame: 14
const object = {};
object.id = a0.id;
object.startsAt = a0.starts_at;
object.expiresAt = a0.expires_at;
object.features = a0.features;
object.messages = {questName: a0.messages.quest_name, gamePublisher: a0.messages.game_publisher,
gameTitle: a0.messages.game_title};
object.assets = {hero: a0.assets.hero, heroVideo: a0.assets.hero_video, questBarHero: a0.assets.quest_bar_hero,
questBarHeroVideo: a0.assets.quest_bar_hero_video, gameTile: a0.assets.game_tile, logotype: a0.assets.logotype,
logotypeLight: a0.assets.logotype_light, logotypeDark: a0.assets.logotype_dark,
gameTileLight: a0.assets.game_tile_light, gameTileDark: a0.assets.game_tile_dark};
object.colors = {primary: a0.colors.primary, secondary: a0.colors.secondary};
const rewards = a0.rewards;
object.rewards = rewards.map(getSimpleRewardFromServer);
object.cosponsorMetadata = QuestModule.questCosponsorMetadataFromServer(a0.cosponsor_metadata);
return object;
}
return value;
}
function questWithUserStatusFromServer(a0) { // fn#56761, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7278:3266, offset: 0x013d0ac4, size: 111 bytes, params: 2, frame: 14
const object2 = {};
object2.id = a0.id;
object2.preview = a0.preview;
object2.config = questConfigFromServer(a0.config);
const user_status = a0.user_status;
const value2 = null;
object2.userStatus = value2 == user_status ? value2 : questUserStatusFromServer(a0.user_status);
object2.targetedContent = a0.targeted_content;
object2.trafficMetadataSealed = a0.traffic_metadata_sealed;
return object2;
}
function _questsTenantMetadataFromServer(a0) { // fn#56757, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7278:2349, offset: 0x013d095b, size: 216 bytes, params: 2, frame: 16
var object2;
var questsRewardCodeFromServerBinding;
const value = undefined;
let quest_rewards = a0 == null ? value : a0.quest_rewards;
if (quest_rewards == null) {
return null;
}
quest_rewards = a0.quest_rewards;
let reward = quest_rewards.reward;
const tag = reward.tag;
const QuestRewardTypes = (QuestRewardTypesModule).QuestRewardTypes;
const IN_GAME = QuestRewardTypes.IN_GAME;
if (IN_GAME === tag) {
return {questRewards: {reward: {tag: quest_rewards.reward.tag}}};
}
const REWARD_CODE = QuestRewardTypes.REWARD_CODE;
if (REWARD_CODE === tag) {
object2 = {};
reward = quest_rewards.reward;
object2.tag = reward.tag;
questsRewardCodeFromServerBinding = questsRewardCodeFromServer;
reward = quest_rewards.reward;
object2.rewardCode = questsRewardCodeFromServerBinding(reward.reward_code);
return {questRewards: {reward: object2}};
}
return value;
}
function getClaimedQuestWithUserStatusFromServer(a0) { // fn#56763, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7278:3696, offset: 0x013d0b50, size: 76 bytes, params: 2, frame: 14
const object2 = {};
object2.id = a0.id;
object2.config = getClaimedQuestFromServer(a0.config);
const user_status = a0.user_status;
const value2 = null;
object2.userStatus = value2 == user_status ? value2 : questUserStatusFromServer(a0.user_status);
return object2;
}
function isQuestWithKnownConfigVersion(a0) { // fn#56759, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7278:2987, offset: 0x013d0a68, size: 92 bytes, params: 2, frame: 13
var environment;
var value;
var property;
var match;
var config;
var closure;
var error;
try {
value = environment;
property = dependencyMap[1];
value = require(property);
match = value.match;
config = a0.config;
value = Reflect.apply(match, value, [config]);
closure = function() {
return true;
};
value = value.with({config_version: 2}, closure);
value = value.exhaustive();
} catch (error) {
return false;
}
return value;
}
function questWithUserStatusFromServer(a0) { // fn#56761, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7278:3266, offset: 0x013d0ac4, size: 111 bytes, params: 2, frame: 14
const object = {};
object.id = a0.id;
object.preview = a0.preview;
object.config = questConfigFromServer(a0.config);
const user_status = a0.user_status;
const value2 = null;
object.userStatus = value2 == user_status ? value2 : questUserStatusFromServer(a0.user_status);
object.targetedContent = a0.targeted_content;
object.trafficMetadataSealed = a0.traffic_metadata_sealed;
return object;
}
function getClaimedQuestWithUserStatusFromServer(a0) { // fn#56763, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7278:3696, offset: 0x013d0b50, size: 76 bytes, params: 2, frame: 14
const object = {};
object.id = a0.id;
object.config = getClaimedQuestFromServer(a0.config);
const user_status = a0.user_status;
const value2 = null;
object.userStatus = value2 == user_status ? value2 : questUserStatusFromServer(a0.user_status);
return object;
}
function _fun56751(a0) { // fn#56751, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7278:191, offset: 0x013d0525, size: 41 bytes, params: 2, frame: 11
const value = environment.__proto__;
return (require(7101) /* metro dependency 7101: Quest */).questFromServerV2(a0);
}
global.__d(_fun56749, 7100, [57, 4242, 7101, 7098,
2]) /* metro module 7100, dependencies: [57, 4242, 7101, 7098, 2] */;
File diff suppressed because it is too large. Load diff
+196 -180
View File
@@ -1,4 +1,14 @@
/* Metro module 7114; source: modules/quests/utils/QuestUtils.tsx; dependencies: [57, 4295, 1867, 3784, 4297, 7115, 6528, 7116, 7117, 7118, 7119, 7120, 2] */
import Module00057 from '../../../by-id/module-00057.js'; /* Metro dependency 57 */
import GuildStore from '../../../stores/GuildStore.tsx'; /* Metro dependency 1867 */
import PermissionStore from '../../../stores/PermissionStore.tsx'; /* Metro dependency 3784 */
import GameConsoleStore from '../../game_console/GameConsoleStore.tsx'; /* Metro dependency 4295 */
import VoiceStateStore from '../../../stores/VoiceStateStore.tsx'; /* Metro dependency 4297 */
import QuestUtmStore from '../QuestUtmStore.tsx'; /* Metro dependency 7115 */
import * as FileImportTrackerModule from '../../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
import * as QuestConstantsModule from '../QuestConstants.tsx'; /* Metro dependency 6528 */
import * as QuestTaskUtilsModule from './QuestTaskUtils.tsx'; /* Metro dependency 7116 */
function _fun56858(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#56858, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7292:6, offset: 0x013d3ddf, size: 372 bytes, params: 8, frame: 21
const env0_0 = require;
const _arrayLikeToArray_56861 = function(a0, a1) {
@@ -44,25 +54,15 @@ function _fun56858(global, require, importDefault, importAll, module, exports, d
}
return value;
};
const closure = isSponsoredPlayQuest;
const isSponsoredPlayQuest2 = isSponsoredPlayQuest;
const closure2 = function(a0, a1) {
var Set = global.Set;
return new Set(a0.config.features).has(a1);
};
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_2 = importDefault(57) /* metro dependency 57 */;
const gameConsoleStore = importDefault(4295) /* metro dependency 4295: GameConsoleStore */;
const guildStore = importDefault(1867) /* metro dependency 1867: GuildStore */;
const permissionStore = importDefault(3784) /* metro dependency 3784: PermissionStore */;
const voiceStateStore = importDefault(4297) /* metro dependency 4297: VoiceStateStore */;
const questUtmStore = importDefault(7115) /* metro dependency 7115: QuestUtmStore */;
const questConstantsModule = require(6528) /* metro dependency 6528: QuestConstants */;
const env0_8 = questConstantsModule.DISCORD_APPLICATION_ID;
const env0_9 = questConstantsModule.QuestVariants;
const env0_10 = questConstantsModule.RewardFilterTypes;
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/quests/utils/QuestUtils.tsx');
exports.isSponsoredPlayQuest = closure;
(FileImportTrackerModule).fileFinishedImporting('modules/quests/utils/QuestUtils.tsx');
exports.isSponsoredPlayQuest = isSponsoredPlayQuest2;
exports.isPlayAnyActivityQuest = function(a0) {
return require(dependencyMap[7]).getPlayActivityApplicationId(a0) === DISCORD_APPLICATION_ID;
};
@@ -87,198 +87,214 @@ function _fun56858(global, require, importDefault, importAll, module, exports, d
return !a0.some(_fun56872) && (a0.length === 0 || a0.some(_fun56873));
};
exports.setQuestHomeUtmContext = setQuestHomeUtmContext;
}
function _createForOfIteratorHelperLoose_56859(a0, a1) { // fn#56859, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7292:238, offset: 0x013d3f53, size: 370 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)) {
function _createForOfIteratorHelperLoose_56859(a0, a1) { // fn#56859, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7292:238, offset: 0x013d3f53, size: 370 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);
}
return _fun56860;
}
value = undefined;
if (a0) {
if (typeof a0 === 'string') {
value = _arrayLikeToArray_56861(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') {
const Array = global.Array;
if (Array.isArray(a0)) {
if (r1) {
}
return _fun56860;
}
value = undefined;
if (a0) {
if (typeof a0 === 'string') {
value = _arrayLikeToArray_56861(a0, value);
r6 = value;
r5 = value;
} else {
regexp = RegExp('^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$', '');
if (regexp.test(r9)) {
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_56861(a0, value);
r6 = value;
} else {
r6 = value;
regexp = RegExp('^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$', '');
if (regexp.test(r9)) {
value = _arrayLikeToArray_56861(a0, value);
r6 = value;
} else {
r6 = value;
}
}
r5 = r6;
}
r5 = r6;
} else {
r5 = value;
}
} else {
r5 = value;
}
if (r5) {
if (r5) {
if (r5) {
}
return _fun56860;
}
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 _fun56860() { // fn#56860, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7292:809, 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]};
}
return _fun56860;
}
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 isSponsoredPlayQuest(a0) { // fn#56862, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7292:1148, offset: 0x013d40c5, size: 70 bytes, params: 2, frame: 13
if (a0 == null) {
return false;
}
let value = require(7116) /* metro dependency 7116: QuestTaskUtils */;
value = value.getDesktopApplicationIds(a0);
return value != null && value.length > 1;
}
function canLaunchActivity(a0) { // fn#56865, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7292:1613, offset: 0x013d4176, size: 72 bytes, params: 2, frame: 14
var r0;
var value;
const hasPlayActivityTask2 = (require(7116) /* metro dependency 7116: QuestTaskUtils */).hasPlayActivityTask(a0);
if (hasPlayActivityTask2) {
r0 = hasPlayActivityTask2;
} else {
value = require(7116) /* metro dependency 7116: QuestTaskUtils */;
value = value.hasAchievementActivityTask(a0);
r0 = value;
function isSponsoredPlayQuest(a0) { // fn#56862, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7292:1148, offset: 0x013d40c5, size: 70 bytes, params: 2, frame: 13
if (a0 == null) {
return false;
}
let value = QuestTaskUtilsModule;
value = value.getDesktopApplicationIds(a0);
return value != null && value.length > 1;
}
return r0;
}
function filterQuestsForSocialEntrypoints(a0, a1) { // fn#56866, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7292:1759, offset: 0x013d41be, size: 299 bytes, params: 3, frame: 30
var r4;
var r19;
var value5;
var value6;
var property;
var property2;
var hasVariantBinding;
var NON_GAMING_PLAY_QUEST;
var moduleValue;
var getQuestTaskTypes;
var value7;
var value8;
var value9;
var has;
var value10;
var set;
var value11;
const Map = global.Map;
const map = new Map();
const value3 = _createForOfIteratorHelperLoose_56859(a0);
const value4 = value3();
let done = value4.done;
if (!done) {
r4 = value4;
while (true) {
value5 = r4.value;
value6 = env0_2(value5, 2);
property = value6[0];
property2 = value6[1];
if (!isSponsoredPlayQuest(property2)) {
hasVariantBinding = hasVariant;
NON_GAMING_PLAY_QUEST = QuestVariants.NON_GAMING_PLAY_QUEST;
if (hasVariantBinding(property2, NON_GAMING_PLAY_QUEST)) {
break;
function canLaunchActivity(a0) { // fn#56865, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7292:1613, offset: 0x013d4176, size: 72 bytes, params: 2, frame: 14
var r0;
var value;
const hasPlayActivityTask2 = (require(7116) /* metro dependency 7116: QuestTaskUtils */).hasPlayActivityTask(a0);
if (hasPlayActivityTask2) {
r0 = hasPlayActivityTask2;
} else {
value = require(7116) /* metro dependency 7116: QuestTaskUtils */;
value = value.hasAchievementActivityTask(a0);
r0 = value;
}
return r0;
}
function filterQuestsForSocialEntrypoints(a0, a1) { // fn#56866, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7292:1759, offset: 0x013d41be, size: 299 bytes, params: 3, frame: 30
var r4;
var r19;
var value5;
var value6;
var property;
var property2;
var hasVariantBinding;
var NON_GAMING_PLAY_QUEST;
var moduleValue;
var getQuestTaskTypes;
var value7;
var value8;
var value9;
var has;
var value10;
var set;
var value11;
const Map = global.Map;
const map = new Map();
const value3 = _createForOfIteratorHelperLoose_56859(a0);
const value4 = value3();
let done = value4.done;
if (!done) {
r4 = value4;
while (true) {
value5 = r4.value;
value6 = Module00057(value5, 2);
property = value6[0];
property2 = value6[1];
if (!isSponsoredPlayQuest(property2)) {
hasVariantBinding = hasVariant;
NON_GAMING_PLAY_QUEST = QuestVariants.NON_GAMING_PLAY_QUEST;
if (hasVariantBinding(property2, NON_GAMING_PLAY_QUEST)) {
break;
}
_createForOfIteratorHelperLoose_56859Binding = _createForOfIteratorHelperLoose_56859;
moduleValue = require(7116) /* metro dependency 7116: QuestTaskUtils */;
getQuestTaskTypes = moduleValue.getQuestTaskTypes;
value7 = _createForOfIteratorHelperLoose_56859Binding(Reflect.apply(getQuestTaskTypes, moduleValue,
[property2]));
value8 = value7();
done = value8.done;
if (done) {
break;
}
r19 = value8;
loopExit4: while (true) {
value9 = r19.value;
has = a1.has;
if (Reflect.apply(has, a1, [value9])) {
set = map.set;
Reflect.apply(set, map, [property, property2]);
break loopExit4;
}
value10 = value7();
done = value10.done;
if (done) {
break loopExit4;
}
r19 = value10;
continue;
}
}
_createForOfIteratorHelperLoose_56859Binding = _createForOfIteratorHelperLoose_56859;
moduleValue = require(7116) /* metro dependency 7116: QuestTaskUtils */;
getQuestTaskTypes = moduleValue.getQuestTaskTypes;
value7 = _createForOfIteratorHelperLoose_56859Binding(Reflect.apply(getQuestTaskTypes, moduleValue,
[property2]));
value8 = value7();
done = value8.done;
value11 = value3();
done = value11.done;
if (done) {
break;
}
r19 = value8;
loopExit4: while (true) {
value9 = r19.value;
has = a1.has;
if (Reflect.apply(has, a1, [value9])) {
set = map.set;
Reflect.apply(set, map, [property, property2]);
break loopExit4;
}
value10 = value7();
done = value10.done;
if (done) {
break loopExit4;
}
r19 = value10;
continue;
}
r4 = value11;
continue;
}
value11 = value3();
done = value11.done;
if (done) {
break;
}
r4 = value11;
continue;
}
return map;
}
return map;
}
function isStreamingAndCanWatch(a0, a1) { // fn#56868, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7292:2270, offset: 0x013d431d, size: 87 bytes, params: 3, frame: 20
return a0 != null && a1 != null && (require(7118) /* metro dependency 7118: StreamPermissionUtils */).canWatchStream(a1,
VoiceStateStore, GuildStore, PermissionStore, GameConsoleStore)[0];
}
function shouldShowBountiesGivenFilters(a0) { // fn#56871, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7292:2681, offset: 0x013d43fc, size: 62 bytes, params: 2, frame: 13
return !a0.some(function(a0) {
return a0.group === 'task';
}) && (a0.length === 0 || a0.some(_fun56873));
}
function setQuestHomeUtmContext({questId, fromContent, utmSource, utmMedium}) { // fn#56874, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7292:2868, offset: 0x013d4479, size: 112 bytes, params: 2, frame: 16
const state = QuestUtmStore.getState();
const setUtmCurrentContext = state.setUtmCurrentContext;
const object2 = {utmSourceCurrent: utmSource, utmMediumCurrent: utmMedium, utmCampaignCurrent: questId};
object2.utmContentCurrent = (require(7120) /* metro dependency 7120: AnalyticsTypes */).getQuestContentName(fromContent);
Reflect.apply(setUtmCurrentContext, state, [object2]);
}
function _fun56873(a0) { // fn#56873, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7292:2785, offset: 0x013d444d, size: 44 bytes, params: 2, frame: 3
var r0;
var filter;
let value = a0.group === 'reward';
if (value) {
filter = a0.filter;
value = environment.__proto__;
value = filter === RewardFilterTypes.VIRTUAL_CURRENCY;
r0 = value;
} else {
r0 = value;
function isStreamingAndCanWatch(a0, a1) { // fn#56868, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7292:2270, offset: 0x013d431d, size: 87 bytes, params: 3, frame: 20
var moduleValue;
let r0 = a0 != null && a1 != null;
if (r0) {
moduleValue = require(7118) /* metro dependency 7118: StreamPermissionUtils */;
r0 = moduleValue.canWatchStream(a1, VoiceStateStore, GuildStore, PermissionStore, GameConsoleStore)[0];
}
return r0;
}
return r0;
function shouldShowBountiesGivenFilters(a0) { // fn#56871, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7292:2681, offset: 0x013d43fc, size: 62 bytes, params: 2, frame: 13
return !a0.some(function(a0) {
return a0.group === 'task';
}) && (a0.length === 0 || a0.some(_fun56873));
function _fun56873(a0) { // fn#56873, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7292:2785, offset: 0x013d444d, size: 44 bytes, params: 2, frame: 3
var r0;
var filter;
let value = a0.group === 'reward';
if (value) {
filter = a0.filter;
value = environment.__proto__;
value = filter === RewardFilterTypes.VIRTUAL_CURRENCY;
r0 = value;
} else {
r0 = value;
}
return r0;
}
}
function setQuestHomeUtmContext({questId, fromContent, utmSource, utmMedium}) { // fn#56874, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7292:2868, offset: 0x013d4479, size: 112 bytes, params: 2, frame: 16
const state = QuestUtmStore.getState();
const setUtmCurrentContext = state.setUtmCurrentContext;
const object = {utmSourceCurrent: utmSource, utmMediumCurrent: utmMedium, utmCampaignCurrent: questId};
object.utmContentCurrent = (require(7120) /* metro dependency 7120: AnalyticsTypes */).getQuestContentName(fromContent);
Reflect.apply(setUtmCurrentContext, state, [object]);
}
}
function _fun56872({group}) { // fn#56872, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7292:2739, offset: 0x013d443a, size: 19 bytes, params: 2, frame: 2
return group === 'task';
}
global.__d(_fun56858, 7114, [57, 4295, 1867, 3784, 4297, 7115, 6528, 7116, 7117, 7118, 7119, 7120,
2]) /* metro module 7114, dependencies: [57, 4295, 1867, 3784, 4297, 7115, 6528, 7116, 7117, 7118, 7119, 7120, 2] */;
@@ -1,7 +1,16 @@
/* Metro module 9522; source: modules/quests/utils/VideoQuestUtils.tsx; dependencies: [4401, 7093, 7095, 661, 7091, 9484, 7116, 1244, 7110, 4007, 2, 9523] */
import NetworkStore from '../../../stores/NetworkStore.tsx'; /* Metro dependency 4401 */
import QuestStore from '../QuestStore.tsx'; /* Metro dependency 7093 */
import VideoQuestUIStore from '../VideoQuestUIStore.tsx'; /* Metro dependency 7095 */
import * as FileImportTrackerModule from '../../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
import * as ConstantsModule from '../../../Constants.tsx'; /* Metro dependency 661 */
import * as IndexNativeModule from '../../../intl/index.native.tsx'; /* Metro dependency 1244 */
import * as QuestTaskUtilsModule from './QuestTaskUtils.tsx'; /* Metro dependency 7116 */
import * as MobileQuestVideoWatchCtaCopyModule from './MobileQuestVideoWatchCtaCopy.tsx'; /* Metro dependency 9523 */
function _fun74293(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#74293, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9708:6, offset: 0x01d89035, size: 312 bytes, params: 8, frame: 22
const env0_0 = require;
const closure = sendVideoProgress;
const sendVideoProgress2 = sendVideoProgress;
const closure2 = function(a0, a1) {
var r1;
var r0;
@@ -27,14 +36,10 @@ function _fun74293(global, require, importDefault, importAll, module, exports, d
};
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const networkStore = importDefault(4401) /* metro dependency 4401: NetworkStore */;
const questStore = importDefault(7093) /* metro dependency 7093: QuestStore */;
const videoQuestUIStore = importDefault(7095) /* metro dependency 7095: VideoQuestUIStore */;
const env0_5 = (require(661) /* metro dependency 661: Constants */).AnalyticEvents;
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/quests/utils/VideoQuestUtils.tsx');
const getVideoQuestWatchCtaText = (require(9523) /* metro dependency 9523: MobileQuestVideoWatchCtaCopy */).getVideoQuestWatchCtaText;
(FileImportTrackerModule).fileFinishedImporting('modules/quests/utils/VideoQuestUtils.tsx');
const getVideoQuestWatchCtaText = (MobileQuestVideoWatchCtaCopyModule).getVideoQuestWatchCtaText;
exports.getVideoQuestWatchCtaText = getVideoQuestWatchCtaText;
exports.sendVideoProgress = closure;
exports.sendVideoProgress = sendVideoProgress2;
exports.getVideoOrientation = function(a0) {
var video = a0.assets.video;
var value = 'portrait';
@@ -57,89 +62,92 @@ function _fun74293(global, require, importDefault, importAll, module, exports, d
return r0;
};
exports.isVideoQuestProgressing = isVideoQuestProgressing;
}
function sendVideoProgress(a0, a1) { // fn#74294, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9708:151, offset: 0x01d8916d, size: 144 bytes, params: 3, frame: 17
var value;
const value2 = undefined;
let r3 = (require(7091) /* metro dependency 7091: QuestDataUtils */).isQuestExpired(a0) || (a0.userStatus == null ? value2 : a0.userStatus.enrolledAt) == null;
r3 = !r3 ? (a0.userStatus == null ? value2 : a0.userStatus.completedAt) != null : r3;
if (!r3) {
value = require(9484) /* metro dependency 9484: QuestActionCreators */;
value.updateVideoProgress(a0.id, a1);
}
return value2;
}
function getVideoQuestProgressRemainingAccessibilityLabel(a0, a1) { // fn#74298, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9708:928, offset: 0x01d892d1, size: 393 bytes, params: 3, frame: 21
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
const t = (require(1244) /* metro dependency 1244: indexNative */).t;
if (a1) {
return intl.string(t['ij5E/5']);
}
const {minutes, seconds} = (require(7116) /* metro dependency 7116: QuestTaskUtils */).getRemainingTaskTime(a0);
return intl.formatToPlainString(t.nzYZrt,
{remainingTime: minutes > 0 && seconds > 0 ? intl.formatToPlainString(t['lW/66D'], {minutes: minutes,
seconds: seconds}) : minutes > 0 ? intl.formatToPlainString(t['SxnF/O'],
{count: minutes}) : intl.formatToPlainString(t['0BZpdi'], {count: seconds})});
}
function getVideoQuestEndCardCtaText({ctaConfig}) { // fn#74299, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9708:1548, offset: 0x01d8945a, size: 85 bytes, params: 2, frame: 15
var r0;
var intl;
const buttonLabel = ctaConfig.buttonLabel;
if (buttonLabel != null) {
r0 = buttonLabel;
} else {
intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
r0 = intl.string((require(1244) /* metro dependency 1244: indexNative */).t.iiTtpJ);
}
return r0;
}
function handleVideoQuestModalClose({questId, sourceQuestContent, videoSessionId}) { // fn#74300, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9708:1705, offset: 0x01d894af, size: 369 bytes, params: 2, frame: 25
var r0;
var quest;
var maxTimestampSec;
var formatVideoProgressRatioBinding;
var value11;
var moduleValue;
var trackQuestEvent;
var object2;
var moduleValue2;
var object4;
VideoQuestUIStore.getState().setTranscriptEnabled(false);
const videoProgress = VideoQuestUIStore.getState().getVideoProgress(questId);
if (videoProgress != null) {
quest = QuestStore.getQuest(questId);
r0 = quest != null && quest.userStatus?.enrolledAt != null;
r0 = r0 && quest.userStatus?.completedAt == null;
if (r0) {
sendVideoProgress(quest, videoProgress.maxTimestampSec);
function sendVideoProgress(a0, a1) { // fn#74294, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9708:151, offset: 0x01d8916d, size: 144 bytes, params: 3, frame: 17
var value;
const value2 = undefined;
let r3 = (require(7091) /* metro dependency 7091: QuestDataUtils */).isQuestExpired(a0) || (a0.userStatus == null ? value2 : a0.userStatus.enrolledAt) == null;
r3 = !r3 ? (a0.userStatus == null ? value2 : a0.userStatus.completedAt) != null : r3;
if (!r3) {
value = require(9484) /* metro dependency 9484: QuestActionCreators */;
value.updateVideoProgress(a0.id, a1);
}
formatVideoProgressRatioBinding = formatVideoProgressRatio;
maxTimestampSec = videoProgress.maxTimestampSec;
value11 = formatVideoProgressRatioBinding(maxTimestampSec, videoProgress.duration);
moduleValue = require(7110) /* metro dependency 7110: AnalyticsActions */;
trackQuestEvent = moduleValue.trackQuestEvent;
maxTimestampSec = videoProgress.maxTimestampSec;
Reflect.apply(trackQuestEvent, moduleValue, [{questId: questId, event: AnalyticEvents.QUEST_VIDEO_PROGRESSED,
properties: {progress: value11, video_timestamp_seconds: maxTimestampSec, video_session_id: videoSessionId},
sourceQuestContent: sourceQuestContent}]);
moduleValue2 = require(7110) /* metro dependency 7110: AnalyticsActions */;
trackQuestEvent = moduleValue2.trackQuestEvent;
object2 = {questId: questId};
object2.event = AnalyticEvents.QUEST_VIDEO_MODAL_CLOSED;
object4 = {video_progress: value11, video_session_id: videoSessionId};
object4.network_connection_speed = NetworkStore.getEffectiveConnectionSpeed();
object2.properties = object4;
object2.sourceQuestContent = sourceQuestContent;
Reflect.apply(trackQuestEvent, moduleValue2, [object2]);
return value2;
}
function getVideoQuestProgressRemainingAccessibilityLabel(a0, a1) { // fn#74298, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9708:928, offset: 0x01d892d1, size: 393 bytes, params: 3, frame: 21
const intl = (IndexNativeModule).intl;
const t = (IndexNativeModule).t;
if (a1) {
return intl.string(t['ij5E/5']);
}
const {minutes, seconds} = (QuestTaskUtilsModule).getRemainingTaskTime(a0);
return intl.formatToPlainString(t.nzYZrt,
{remainingTime: minutes > 0 && seconds > 0 ? intl.formatToPlainString(t['lW/66D'], {minutes: minutes,
seconds: seconds}) : minutes > 0 ? intl.formatToPlainString(t['SxnF/O'],
{count: minutes}) : intl.formatToPlainString(t['0BZpdi'], {count: seconds})});
}
function getVideoQuestEndCardCtaText({ctaConfig}) { // fn#74299, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9708:1548, offset: 0x01d8945a, size: 85 bytes, params: 2, frame: 15
var r0;
var intl;
const buttonLabel = ctaConfig.buttonLabel;
if (buttonLabel != null) {
r0 = buttonLabel;
} else {
intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
r0 = intl.string((require(1244) /* metro dependency 1244: indexNative */).t.iiTtpJ);
}
return r0;
}
function handleVideoQuestModalClose({questId, sourceQuestContent, videoSessionId}) { // fn#74300, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9708:1705, offset: 0x01d894af, size: 369 bytes, params: 2, frame: 25
var r0;
var quest;
var maxTimestampSec;
var formatVideoProgressRatioBinding;
var value11;
var moduleValue;
var trackQuestEvent;
var object;
var moduleValue2;
var object3;
const videoQuestUIStoreBinding = VideoQuestUIStore;
videoQuestUIStoreBinding.getState().setTranscriptEnabled(false);
const videoProgress = videoQuestUIStoreBinding.getState().getVideoProgress(questId);
if (videoProgress != null) {
quest = QuestStore.getQuest(questId);
r0 = quest != null && quest.userStatus?.enrolledAt != null;
r0 = r0 && quest.userStatus?.completedAt == null;
if (r0) {
sendVideoProgress(quest, videoProgress.maxTimestampSec);
}
formatVideoProgressRatioBinding = formatVideoProgressRatio;
maxTimestampSec = videoProgress.maxTimestampSec;
value11 = formatVideoProgressRatioBinding(maxTimestampSec, videoProgress.duration);
moduleValue = require(7110) /* metro dependency 7110: AnalyticsActions */;
trackQuestEvent = moduleValue.trackQuestEvent;
maxTimestampSec = videoProgress.maxTimestampSec;
Reflect.apply(trackQuestEvent, moduleValue, [{questId: questId, event: AnalyticEvents.QUEST_VIDEO_PROGRESSED,
properties: {progress: value11, video_timestamp_seconds: maxTimestampSec, video_session_id: videoSessionId},
sourceQuestContent: sourceQuestContent}]);
moduleValue2 = require(7110) /* metro dependency 7110: AnalyticsActions */;
trackQuestEvent = moduleValue2.trackQuestEvent;
object = {questId: questId};
object.event = AnalyticEvents.QUEST_VIDEO_MODAL_CLOSED;
object3 = {video_progress: value11, video_session_id: videoSessionId};
object3.network_connection_speed = NetworkStore.getEffectiveConnectionSpeed();
object.properties = object3;
object.sourceQuestContent = sourceQuestContent;
Reflect.apply(trackQuestEvent, moduleValue2, [object]);
}
}
function isVideoQuestProgressing(a0) { // fn#74302, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9708:2661, offset: 0x01d89649, size: 95 bytes, params: 2, frame: 15
const hasWatchVideoTasks2 = (QuestTaskUtilsModule).hasWatchVideoTasks(a0);
return hasWatchVideoTasks2 ? (require(4007) /* metro dependency 4007: NavigationRouteUtilsNative */).isModalOpen(getVideoQuestModalKey(a0.id)) : !!hasWatchVideoTasks2;
}
}
function isVideoQuestProgressing(a0) { // fn#74302, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9708:2661, offset: 0x01d89649, size: 95 bytes, params: 2, frame: 15
const hasWatchVideoTasks2 = (require(7116) /* metro dependency 7116: QuestTaskUtils */).hasWatchVideoTasks(a0);
return hasWatchVideoTasks2 ? (require(4007) /* metro dependency 4007: NavigationRouteUtilsNative */).isModalOpen(getVideoQuestModalKey(a0.id)) : !!hasWatchVideoTasks2;
}
global.__d(_fun74293, 9522, [4401, 7093, 7095, 661, 7091, 9484, 7116, 1244, 7110, 4007, 2,
9523]) /* metro module 9522, dependencies: [4401, 7093, 7095, 661, 7091, 9484, 7116, 1244, 7110, 4007, 2, 9523] */;