311 lines
20 KiB
TypeScript
311 lines
20 KiB
TypeScript
/* Metro module 13623; source: modules/quests/native/QuestContextMenu.tsx; dependencies: [29, 31, 7093, 661, 33, 8341, 8639, 1244, 9483, 566, 6531, 9949, 9513, 9505, 7114, 477, 4093, 9480, 9520, 7120, 3869, 13580, 9484, 6249, 13624, 4060, 7116, 6797, 4064, 9519, 9517, 9518, 7121, 8811, 2] */
|
|
import ObjectWithoutProperties from '../../../by-id/module-00029-ObjectWithoutProperties.js'; /* Metro dependency 29 */
|
|
import QuestStore from '../QuestStore.tsx'; /* Metro dependency 7093 */
|
|
import QuestDisclosureModalActionCreators from './QuestDisclosureModal/QuestDisclosureModalActionCreators.tsx'; /* Metro dependency 13580 */
|
|
import * as FileImportTrackerModule from '../../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
|
|
import * as ReactModule from '../../../by-id/module-00031-React.js'; /* Metro dependency 31 */
|
|
import * as JsxRuntimeModule from '../../../by-id/module-00033-JsxRuntime.js'; /* Metro dependency 33 */
|
|
import * as PlatformUtilsModule from '../../../utils/PlatformUtils.tsx'; /* Metro dependency 477 */
|
|
import * as ConstantsModule from '../../../Constants.tsx'; /* Metro dependency 661 */
|
|
import * as IndexNativeModule from '../../../intl/index.native.tsx'; /* Metro dependency 1244 */
|
|
import * as LinkExternalSmallIconModule from '../../../design/components/Icon/native/redesign/generated/LinkExternalSmallIcon.tsx'; /* Metro dependency 6249 */
|
|
import * as QuestTypesModule from '../QuestTypes.tsx'; /* Metro dependency 6531 */
|
|
import * as AnalyticsTypesModule from '../lib/analytics/AnalyticsTypes.tsx'; /* Metro dependency 7120 */
|
|
import * as IconButtonNativeModule from '../../../design/components/Button/native/IconButton.native.tsx'; /* Metro dependency 8341 */
|
|
import * as ContextMenuNativeModule from '../../../design/components/ContextMenu/native/ContextMenu.native.tsx'; /* Metro dependency 8811 */
|
|
import * as QuestHooksModule from '../hooks/QuestHooks.tsx'; /* Metro dependency 9483 */
|
|
import * as QuestCopyUtilsModule from '../utils/QuestCopyUtils.tsx'; /* Metro dependency 9505 */
|
|
import * as ContentImpressionTrackerHooksModule from '../lib/analytics/ContentImpressionTrackerHooks.tsx'; /* Metro dependency 9513 */
|
|
import * as AdAnalyticsInterfaceExperimentModule from '../experiments/AdAnalyticsInterfaceExperiment.tsx'; /* Metro dependency 9519 */
|
|
import * as AnalyticsHooksModule from '../lib/analytics/AnalyticsHooks.tsx'; /* Metro dependency 9949 */
|
|
|
|
function _fun104044(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#104044, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13820:6, offset: 0x02281fe8, size: 231 bytes, params: 8, frame: 19
|
|
const env0_0 = require;
|
|
const env0_3 = ['ref'];
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
let value = ReactModule;
|
|
value = value.memo(_fun104046);
|
|
(FileImportTrackerModule).fileFinishedImporting('modules/quests/native/QuestContextMenu.tsx');
|
|
exports.default = value;
|
|
function renderDefaultButton(a0) { // fn#104045, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13820:177, offset: 0x022820cf, size: 229 bytes, params: 2, frame: 19
|
|
const ref = a0.ref;
|
|
const value2 = ObjectWithoutProperties(a0, env0_3);
|
|
const IconButton = (IconButtonNativeModule).IconButton;
|
|
const iconButtonProps = {ref: ref, ...value2};
|
|
iconButtonProps['icon'] = importDefault(8639) /* metro dependency 8639 */;
|
|
iconButtonProps['variant'] = 'secondary';
|
|
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
|
|
const string = intl.string;
|
|
const CAgr1w = (require(1244) /* metro dependency 1244: indexNative */).t.CAgr1w;
|
|
iconButtonProps['accessibilityLabel'] = Reflect.apply(string, intl, [CAgr1w]);
|
|
iconButtonProps['accessibilityHint'] = intl.string((require(1244) /* metro dependency 1244: indexNative */).t.hd0b7t);
|
|
return <IconButton {...iconButtonProps} />;
|
|
}
|
|
|
|
function _fun104046({children = renderDefaultButton, quest, showShareLink, additionalItems = [], sourceQuestContent}) { // fn#104046, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13820:432, offset: 0x022821b4, size: 1019 bytes, params: 2, frame: 37
|
|
var r23;
|
|
var moduleValue6;
|
|
showShareLink = !(showShareLink === undefined) && showShareLink;
|
|
const value5 = (QuestHooksModule).useQuestPreviewActions(quest.id);
|
|
const handleComplete = value5.handleComplete;
|
|
const handleProgress = value5.handleProgress;
|
|
const handleResetDismissibilityClick = value5.handleResetDismissibilityClick;
|
|
const handleResetDismissibilityClick2 = handleResetDismissibilityClick;
|
|
const handleResetStatusClick = value5.handleResetStatusClick;
|
|
const handleOverridePreviewClick = value5.handleOverridePreviewClick;
|
|
const handleResetHasBeenSeenClick = value5.handleResetHasBeenSeenClick;
|
|
const value6 = (require(566) /* metro dependency 566: flux */).useStateFromStores([QuestStore], function() {
|
|
return QuestStore.getQuestPreviewOverride(require(dependencyMap[10]).QuestContent.QUEST_BAR_MOBILE);
|
|
}, []);
|
|
const value7 = (AnalyticsHooksModule).useTrackQuestContentClickedWithImpression();
|
|
const value8 = (ContentImpressionTrackerHooksModule).useQuestImpressionId();
|
|
const externalCtaLabel = (QuestCopyUtilsModule).getExternalCtaLabel(quest);
|
|
if (showShareLink) {
|
|
moduleValue6 = require(7114) /* metro dependency 7114: QuestUtils */;
|
|
r23 = moduleValue6.isShareableQuest(quest.config);
|
|
} else {
|
|
r23 = showShareLink;
|
|
}
|
|
let binding = handleResetDismissibilityClick2;
|
|
const value10 = binding.useCallback(_fun104048, [quest, value8, sourceQuestContent]);
|
|
const value11 = binding.useCallback(_fun104049, [r23, quest.id, value8, sourceQuestContent]);
|
|
const value12 = binding.useCallback(_fun104050, [quest, sourceQuestContent]);
|
|
const value13 = binding.useCallback(_fun104051, [quest.id]);
|
|
const value14 = binding.useCallback(_fun104052, [quest.id]);
|
|
const value15 = binding.useMemo(_fun104053, [externalCtaLabel, value10, value12, r23, value11]);
|
|
const value17 = binding.useMemo(_fun104055, [binding.useMemo(_fun104054, [quest, value13, value14]), handleComplete,
|
|
handleResetDismissibilityClick, handleProgress, handleResetStatusClick, handleResetHasBeenSeenClick, quest.id]);
|
|
const value18 = (QuestHooksModule).useShouldShowQuestPreviewOverrides(quest);
|
|
const value19 = binding.useMemo(_fun104058, [handleOverridePreviewClick, quest.id, value6?.id]);
|
|
binding = handleResetDismissibilityClick2;
|
|
const value20 = binding.useMemo(_fun104060, [value15, value17, quest.preview, value18, value19, additionalItems]);
|
|
const value21 = binding.useCallback(_fun104061, [quest.id, value7, value8, sourceQuestContent]);
|
|
const ContextMenu = (ContextMenuNativeModule).ContextMenu;
|
|
return (
|
|
<ContextMenu
|
|
items={value20}
|
|
onOpen={value21}
|
|
triggerOnTap
|
|
>
|
|
{children}
|
|
</ContextMenu>
|
|
);
|
|
function _fun104048() { // fn#104048, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13820:1040, offset: 0x022825e5, size: 279 bytes, params: 1, frame: 18
|
|
var r2;
|
|
var defaultImport;
|
|
var moduleValue2;
|
|
let value = environment.__proto__;
|
|
const isIOS2 = (PlatformUtilsModule).isIOS();
|
|
if (isIOS2) {
|
|
defaultImport = importDefault(4093) /* metro dependency 4093: parseURL */;
|
|
moduleValue2 = require(9505) /* metro dependency 9505: QuestCopyUtils */;
|
|
r2 = defaultImport(moduleValue2.getCtaLink(quest.config)).payload.type === LinkingTypes.INVITE;
|
|
} else {
|
|
r2 = isIOS2;
|
|
}
|
|
if (r2) {
|
|
(require(9480) /* metro dependency 9480: QuestUtilsNative */).dismissOverlayScreens();
|
|
}
|
|
value = require(9520) /* metro dependency 9520: QuestPlatformUtils */;
|
|
const openGameLinkDirectly = value.openGameLinkDirectly;
|
|
const questBinding = quest;
|
|
const object = {};
|
|
const QuestContent = (QuestTypesModule).QuestContent;
|
|
const QUEST_HOME_MOBILE = QuestContent.QUEST_HOME_MOBILE;
|
|
object.content = QUEST_HOME_MOBILE;
|
|
const QuestContentCTA = (AnalyticsTypesModule).QuestContentCTA;
|
|
const CONTEXT_MENU_OPEN_GAME_LINK = QuestContentCTA.CONTEXT_MENU_OPEN_GAME_LINK;
|
|
object.ctaContent = CONTEXT_MENU_OPEN_GAME_LINK;
|
|
object.impressionId = env0_11;
|
|
object.sourceQuestContent = sourceQuestContent;
|
|
Reflect.apply(openGameLinkDirectly, value, [questBinding, object]);
|
|
}
|
|
|
|
function _fun104049() { // fn#104049, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13820:1372, offset: 0x022826fc, size: 216 bytes, params: 1, frame: 18
|
|
var value2;
|
|
var moduleValue;
|
|
var copyShareLink;
|
|
var id;
|
|
var object;
|
|
var AccessibilityAnnouncer;
|
|
var announce;
|
|
var intl;
|
|
if (env0_13) {
|
|
value2 = environment.__proto__;
|
|
moduleValue = require(9505) /* metro dependency 9505: QuestCopyUtils */;
|
|
copyShareLink = moduleValue.copyShareLink;
|
|
id = quest.id;
|
|
object = {};
|
|
object.content = (require(6531) /* metro dependency 6531: QuestTypes */).QuestContent.QUEST_HOME_MOBILE;
|
|
object.ctaContent = (require(7120) /* metro dependency 7120: AnalyticsTypes */).QuestContentCTA.CONTEXT_MENU_COPY_LINK;
|
|
object.impressionId = env0_11;
|
|
object.sourceQuestContent = sourceQuestContent;
|
|
Reflect.apply(copyShareLink, moduleValue, [id, object]);
|
|
AccessibilityAnnouncer = (require(3869) /* metro dependency 3869: AccessibilityAnnouncerAndroid */).AccessibilityAnnouncer;
|
|
announce = AccessibilityAnnouncer.announce;
|
|
intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
|
|
Reflect.apply(announce, AccessibilityAnnouncer,
|
|
[intl.string((require(1244) /* metro dependency 1244: indexNative */).t['+5kSoW'])]);
|
|
}
|
|
}
|
|
|
|
function _fun104050() { // fn#104050, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13820:1672, offset: 0x022827d4, size: 136 bytes, params: 1, frame: 17
|
|
const defaultImport = QuestDisclosureModalActionCreators;
|
|
const showModal = defaultImport.showModal;
|
|
const object = {};
|
|
object.quest = quest;
|
|
object.isTargetedDisclosure = false;
|
|
const object2 = {};
|
|
const QuestContent = (QuestTypesModule).QuestContent;
|
|
const QUEST_HOME_MOBILE = QuestContent.QUEST_HOME_MOBILE;
|
|
object2.content = QUEST_HOME_MOBILE;
|
|
const QuestContentCTA = (AnalyticsTypesModule).QuestContentCTA;
|
|
const CONTEXT_MENU_OPEN_DISCLOSURE = QuestContentCTA.CONTEXT_MENU_OPEN_DISCLOSURE;
|
|
object2.ctaContent = CONTEXT_MENU_OPEN_DISCLOSURE;
|
|
object2.sourceQuestContent = sourceQuestContent;
|
|
object.trackingCtx = object2;
|
|
Reflect.apply(showModal, defaultImport, [object]);
|
|
}
|
|
|
|
function _fun104051() { // fn#104051, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13820:1905, offset: 0x0228285c, size: 53 bytes, params: 1, frame: 13
|
|
let value = environment.__proto__;
|
|
value = require(9484) /* metro dependency 9484: QuestActionCreators */;
|
|
return value.manuallyStartConsoleQuest(quest.id, true);
|
|
}
|
|
|
|
function _fun104052() { // fn#104052, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13820:1979, offset: 0x02282891, size: 50 bytes, params: 1, frame: 11
|
|
let value = environment.__proto__;
|
|
value = require(9484) /* metro dependency 9484: QuestActionCreators */;
|
|
return value.manualStopConsoleQuest(quest.id);
|
|
}
|
|
|
|
function _fun104053() { // fn#104053, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13820:2043, offset: 0x022828c3, size: 285 bytes, params: 1, frame: 21
|
|
var items2;
|
|
let object = {};
|
|
object.label = env0_12;
|
|
const LinkExternalSmallIcon = (LinkExternalSmallIconModule).LinkExternalSmallIcon;
|
|
object.IconComponent = LinkExternalSmallIcon;
|
|
object.action = env0_14;
|
|
object.accessibilityRole = 'link';
|
|
const items3 = [object];
|
|
object = {};
|
|
const intl = (IndexNativeModule).intl;
|
|
const string = intl.string;
|
|
const t = (IndexNativeModule).t;
|
|
const GcsZKJ = t.GcsZKJ;
|
|
object.label = Reflect.apply(string, intl, [GcsZKJ]);
|
|
object.action = env0_16;
|
|
object.iconSource = importDefault(13624) /* metro dependency 13624 */;
|
|
items3[1] = object;
|
|
if (env0_13) {
|
|
object = {};
|
|
object.label = intl.string(t.WqhZss);
|
|
object.IconComponent = (require(4060) /* metro dependency 4060: CopyIcon */).CopyIcon;
|
|
object.action = env0_15;
|
|
items2 = [object];
|
|
} else {
|
|
items2 = [];
|
|
}
|
|
arraySpread(items3, items2, 2, require);
|
|
return items3;
|
|
}
|
|
|
|
function _fun104054() { // fn#104054, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13820:2337, offset: 0x022829e0, size: 109 bytes, params: 1, frame: 13
|
|
let value = environment.__proto__;
|
|
value = require(7116) /* metro dependency 7116: QuestTaskUtils */;
|
|
return value.isConsoleQuest(quest) ? [{label: 'Start Console Heartbeat', action: env0_17},
|
|
{label: 'Stop Console Heartbeat', action: env0_18}] : [];
|
|
}
|
|
|
|
function _fun104055() { // fn#104055, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13820:2481, offset: 0x02282a4d, size: 183 bytes, params: 1, frame: 15
|
|
const items2 = [{label: 'Set Random Quest Progress', action: action_104056}];
|
|
items2[1] = {label: 'Complete Quest', action: handleComplete};
|
|
items2[2] = {label: 'Reset Quest', action: handleResetStatusClick};
|
|
items2[3] = {label: 'Reset Dismissibility', action: handleResetDismissibilityClick};
|
|
const handleResetHasBeenSeenClickBinding = handleResetHasBeenSeenClick;
|
|
items2[4] = {label: 'Reset Quest Seen', action: handleResetHasBeenSeenClickBinding};
|
|
const value = arraySpread(items2, env0_20, 5, handleResetHasBeenSeenClickBinding);
|
|
items2[value] = {label: 'Copy Quest ID', action: action_104057};
|
|
value + 1;
|
|
return items2;
|
|
function action_104056() { // fn#104056, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13820:2528, offset: 0x02282b04, size: 62 bytes, params: 1, frame: 12
|
|
const value = environment.__proto__;
|
|
const handleProgressBinding = handleProgress;
|
|
const Math = global.Math;
|
|
return handleProgressBinding(0.9 * Math.random() + 0.03);
|
|
}
|
|
|
|
function action_104057() { // fn#104057, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13820:2733, offset: 0x02282b42, size: 50 bytes, params: 1, frame: 11
|
|
let value = environment.__proto__.__proto__;
|
|
value = require(6797) /* metro dependency 6797: ClipboardUtilsNative */;
|
|
return value.copy(quest.id);
|
|
}
|
|
|
|
}
|
|
|
|
function _fun104058() { // fn#104058, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13820:2841, offset: 0x02282b74, size: 104 bytes, params: 1, frame: 14
|
|
const value2 = undefined;
|
|
const CheckmarkLargeIcon = (env0_9 == null ? value2 : env0_9.id) !== quest.id ? value2 : (require(4064) /* metro dependency 4064: CheckmarkLargeIcon */).CheckmarkLargeIcon;
|
|
return {label: 'Show in Quest Bar', action: function() {
|
|
return handleOverridePreviewClick(require(dependencyMap[10]).QuestContent.QUEST_BAR_MOBILE);
|
|
}, IconComponent: CheckmarkLargeIcon};
|
|
}
|
|
|
|
function _fun104060() { // fn#104060, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13820:3050, offset: 0x02282c0f, size: 132 bytes, params: 1, frame: 15
|
|
var r0;
|
|
var items2;
|
|
var value2;
|
|
const r4 = env0_1 != null ? [env0_19, env0_1] : [env0_19];
|
|
if (env0_22) {
|
|
r4.push([env0_23]);
|
|
}
|
|
if (quest.preview) {
|
|
items2 = [];
|
|
value2 = arraySpread(items2, r4, 0, r4);
|
|
items2[value2] = env0_21;
|
|
value2 + 1;
|
|
r0 = items2;
|
|
} else {
|
|
r0 = r4;
|
|
}
|
|
return r0;
|
|
}
|
|
|
|
function _fun104061() { // fn#104061, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13820:3164, offset: 0x02282c93, size: 360 bytes, params: 1, frame: 17
|
|
var object;
|
|
const QuestContent = (QuestTypesModule).QuestContent;
|
|
const QuestContentCTA = (AnalyticsTypesModule).QuestContentCTA;
|
|
var captureAdUserAction;
|
|
let value = environment.__proto__;
|
|
const shouldMigrateToAdAnalyticsInterface = AdAnalyticsInterfaceExperimentModule.shouldMigrateToAdAnalyticsInterface;
|
|
const AdAnalyticsInterfaceExperimentStep = AdAnalyticsInterfaceExperimentModule.AdAnalyticsInterfaceExperimentStep;
|
|
const STEP_2_CLICKED_INTERNAL = AdAnalyticsInterfaceExperimentStep.STEP_2_CLICKED_INTERNAL;
|
|
if (Reflect.apply(shouldMigrateToAdAnalyticsInterface, AdAnalyticsInterfaceExperimentModule,
|
|
[STEP_2_CLICKED_INTERNAL, 'quest_context_menu'])) {
|
|
value = require(9517) /* metro dependency 9517: captureAdUserAction */;
|
|
captureAdUserAction = value.captureAdUserAction;
|
|
object = {};
|
|
object.type = (require(9518) /* metro dependency 9518: captureAdUserActionTypes */).AdUserActionType.CLICK_INTERNAL;
|
|
object.adCreativeType = (require(7121) /* metro dependency 7121: AdCreativeType */).AdCreativeType.QUEST;
|
|
object.adCreativeId = quest.id;
|
|
object.questContentCTA = QuestContentCTA.OPEN_CONTEXT_MENU;
|
|
object.surfaceId = QuestContent.QUEST_HOME_MOBILE;
|
|
object.sourceQuestContent = sourceQuestContent;
|
|
object.impressionId = env0_11;
|
|
Reflect.apply(captureAdUserAction, value, [object]);
|
|
} else {
|
|
env0_10({questId: quest.id, questContent: QuestContent.QUEST_HOME_MOBILE,
|
|
questContentCTA: QuestContentCTA.OPEN_CONTEXT_MENU, sourceQuestContent: sourceQuestContent});
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
global.__d(_fun104044, 13623, [29, 31, 7093, 661, 33, 8341, 8639, 1244, 9483, 566, 6531, 9949, 9513, 9505, 7114,
|
|
477, 4093, 9480, 9520, 7120, 3869, 13580, 9484, 6249, 13624, 4060, 7116, 6797, 4064, 9519, 9517, 9518, 7121,
|
|
8811,
|
|
2]) /* metro module 13623, dependencies: [29, 31, 7093, 661, 33, 8341, 8639, 1244, 9483, 566, 6531, 9949, 9513, 9505, 7114, 477, 4093, 9480, 9520, 7120, 3869, 13580, 9484, 6249, 13624, 4060, 7116, 6797, 4064, 9519, 9517, 9518, 7121, 8811, 2] */;
|