Files
discord-decomp/sources/modules/quests/native/QuestHome.tsx
T
2026-07-28 01:06:53 +03:00

811 lines
48 KiB
TypeScript

/* Metro module 13514; source: modules/quests/native/QuestHome.tsx; dependencies: [57, 31, 27, 4502, 9481, 7093, 7115, 6528, 661, 33, 4501, 697, 566, 1484, 13515, 694, 9535, 9534, 13555, 4578, 1244, 5080, 7007, 9483, 9530, 4573, 5278, 13557, 4068, 13559, 9479, 1585, 7091, 9484, 7121, 3857, 8947, 683, 8742, 480, 13566, 4127, 9528, 1485, 7114, 8416, 10183, 6531, 13567, 2] */
import Module00057 from '../../../by-id/module-00057.js'; /* Metro dependency 57 */
import Dispatcher from '../../../Dispatcher.tsx'; /* Metro dependency 694 */
import UseSafeAreaInsetsNative from '../../safe_area/useSafeAreaInsets.native.tsx'; /* Metro dependency 1585 */
import AccessibilityStore from '../../a11y/AccessibilityStore.tsx'; /* Metro dependency 4502 */
import QuestStore from '../QuestStore.tsx'; /* Metro dependency 7093 */
import QuestUtmStore from '../QuestUtmStore.tsx'; /* Metro dependency 7115 */
import UseTrackImpression from '../../app_analytics/useTrackImpression.tsx'; /* Metro dependency 8742 */
import QuestHomeNavigationStore from '../QuestHomeNavigationStore.tsx'; /* Metro dependency 9481 */
import QuestHomeEmptyState from './QuestHomeEmptyState.tsx'; /* Metro dependency 13555 */
import * as FileImportTrackerModule from '../../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
import * as ReactNativeModule from '../../../by-id/module-00027-ReactNative.js'; /* Metro dependency 27 */
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 AnalyticsUtilsModule from '../../../external/discord_common/js/packages/analytics-utils/AnalyticsUtils.tsx'; /* Metro dependency 480 */
import * as FluxModule from '../../../external/discord_common/js/packages/flux/index.tsx'; /* Metro dependency 566 */
import * as ConstantsModule from '../../../Constants.tsx'; /* Metro dependency 661 */
import * as IndexNativeModule from '../../../intl/index.native.tsx'; /* Metro dependency 1244 */
import * as UseNavigationNativeModule from '../../../design/components/Navigator/native/useNavigation.native.tsx'; /* Metro dependency 1484 */
import * as moduleValue6 from '../../../by-id/module-01485.js'; /* Metro dependency 1485 */
import * as UseVirtualCurrencyMobileEnabledModule from '../../virtual_currency/hooks/native/useVirtualCurrencyMobileEnabled.tsx'; /* Metro dependency 4127 */
import * as CreateStylesModule from '../../../design/components/Styles/native/createStyles.tsx'; /* Metro dependency 4501 */
import * as TextModule from '../../../design/components/Text/native/Text.tsx'; /* Metro dependency 4573 */
import * as ButtonNativeModule from '../../../design/components/Button/native/Button.native.tsx'; /* Metro dependency 4578 */
import * as QuestConstantsModule from '../QuestConstants.tsx'; /* Metro dependency 6528 */
import * as QuestTypesModule from '../QuestTypes.tsx'; /* Metro dependency 6531 */
import * as QuestDataUtilsModule from '../utils/QuestDataUtils.tsx'; /* Metro dependency 7091 */
import * as FlashListModule from '../../../external/discord_common/js/packages/flash-list/index.jsx'; /* Metro dependency 8416 */
import * as QuestsEligibilityModule from '../lib/QuestsEligibility.tsx'; /* Metro dependency 9479 */
import * as QuestHooksModule from '../hooks/QuestHooks.tsx'; /* Metro dependency 9483 */
import * as QuestHomeBountiesExperimentModule from '../experiments/QuestHomeBountiesExperiment.tsx'; /* Metro dependency 9528 */
import * as BountiesStage1ExperimentModule from '../experiments/BountiesStage1Experiment.tsx'; /* Metro dependency 9530 */
import * as SurveyActionTypesModule from '../../../external/discord_common/js/shared/shared-constants/SurveyActionTypes.tsx'; /* Metro dependency 9534 */
import * as QuestContentImpressionTrackerNativeModule from './QuestContentImpressionTracker.native.tsx'; /* Metro dependency 10183 */
import * as BountiesModalActionCreatorsModule from './BountiesModal/BountiesModalActionCreators.tsx'; /* Metro dependency 13515 */
import * as QuestCardModule from './QuestCard.tsx'; /* Metro dependency 13567 */
function _fun102639(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#102639, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13704:6, offset: 0x022431ad, size: 678 bytes, params: 8, frame: 23
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
let value = ReactModule;
const StyleSheet = ReactNativeModule.StyleSheet;
const createStyles = CreateStylesModule.createStyles;
object = {};
object.container = {flex: 1};
const object3 = {};
copyDataProperties(object3, StyleSheet.absoluteFillObject, undefined);
object3['justifyContent'] = 'center';
object3['alignItems'] = 'center';
object.loadingContainer = object3;
const object4 = {};
let PX_16 = (importDefault(697) /* metro dependency 697: native */).space.PX_16;
object4.marginBottom = PX_16;
PX_16 = (importDefault(697) /* metro dependency 697: native */).space.PX_16;
object4.paddingHorizontal = PX_16;
object.sectionHeader = object4;
let PX_4 = (importDefault(697) /* metro dependency 697: native */).space.PX_4;
object.sectionHeaderRow = {'flexDirection': 'row', 'alignItems': 'center', gap: PX_4};
const object6 = {};
PX_16 = (importDefault(697) /* metro dependency 697: native */).space.PX_16;
object6.marginBottom = PX_16;
PX_16 = (importDefault(697) /* metro dependency 697: native */).space.PX_16;
object6.paddingHorizontal = PX_16;
object6.backgroundColor = 'transparent';
object.previewButton = object6;
PX_4 = (importDefault(697) /* metro dependency 697: native */).space.PX_4;
object.sectionHeaderWithTag = {gap: PX_4};
const env0_17 = Reflect.apply(createStyles, CreateStylesModule, [object]);
const env0_18 = value.memo(_fun102646);
value = value.memo(QuestHome);
(FileImportTrackerModule).fileFinishedImporting('modules/quests/native/QuestHome.tsx');
exports.default = value;
function EmptyStateNoQuestsAvailable() { // fn#102640, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13704:813, offset: 0x02243453, size: 197 bytes, params: 1, frame: 22
const value3 = env0_4.useCallback(_fun102641,
[(UseNavigationNativeModule).useNavigation()]);
const Button = (ButtonNativeModule).Button;
const intl = (IndexNativeModule).intl;
return (
<QuestHomeEmptyState
action={<Button
variant="secondary"
text={intl.string((IndexNativeModule).t['/g10LC'])}
onPress={value3}
/>}
/>
);
function _fun102641() { // fn#102641, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13704:900, offset: 0x02243518, size: 19 bytes, params: 1, frame: 9
return env0_0.goBack();
}
}
function EmptyStateFiltered({onClearFilters}) { // fn#102642, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13704:1048, offset: 0x0224352b, size: 251 bytes, params: 2, frame: 23
const object = {};
const Button = (ButtonNativeModule).Button;
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
let string = intl.string;
object.action = (
<Button
variant="secondary"
text={Reflect.apply(string, intl, [(require(1244) /* metro dependency 1244: indexNative */).t.urZl31])}
onPress={onClearFilters}
/>
);
string = intl.string;
const PBfFnx = (require(1244) /* metro dependency 1244: indexNative */).t.PBfFnx;
object.title = Reflect.apply(string, intl, [PBfFnx]);
object.subtitle = intl.string((require(1244) /* metro dependency 1244: indexNative */).t.nwdKFC);
return <QuestHomeEmptyState {...object} />;
}
function HeaderPreviewButton() { // fn#102643, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13704:1315, offset: 0x02243626, size: 217 bytes, params: 1, frame: 22
var r0;
var Button;
var intl;
const styles = useStyles();
if ((require(9483) /* metro dependency 9483: QuestHooks */).useShouldShowPreviewToolTab()) {
var viewBindingProps = {style: styles.previewButton};
Button = (require(4578) /* metro dependency 4578: ButtonNative */).Button;
var buttonProps = {'grow': true, 'onPress': null, 'variant': 'primary', onPress: env0_4.useCallback(function() {
importDefault(dependencyMap[21]).popAll();
require(dependencyMap[22]).openUserSettings({screen: UserSettingsSections.QUEST_PREVIEW_TOOL_2});
}, [])};
intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
buttonProps.text = intl.string((require(1244) /* metro dependency 1244: indexNative */).t.tx5Ax5);
r0 = (
<View {...viewBindingProps}>
<Button {...buttonProps} />
</View>
);
} else {
r0 = null;
}
return r0;
}
function HeaderWithBounties() { // fn#102645, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13704:1652, offset: 0x02243750, size: 662 bytes, params: 1, frame: 31
var r5;
var object;
const Text = (TextModule).Text;
const intl = (IndexNativeModule).intl;
var string;
const t = (IndexNativeModule).t;
var items3;
var PressableOpacity;
var object3;
const styles = useStyles();
const BountiesStage1Experiment = (BountiesStage1ExperimentModule).BountiesStage1Experiment;
const useConfig = BountiesStage1Experiment.useConfig;
const QUEST_HOME_MOBILE = QuestsExperimentLocations.QUEST_HOME_MOBILE;
const verticalScrollEnabled = Reflect.apply(useConfig, BountiesStage1Experiment,
[{location: QUEST_HOME_MOBILE}]).verticalScrollEnabled;
const jsxRuntimeEnv0_16Binding = jsxRuntimeEnv0_16;
const items2 = [
<HeaderPreviewButton />,
];
if (verticalScrollEnabled) {
r5 = !verticalScrollEnabled;
} else {
var viewProps = {style: [styles.sectionHeader, styles.sectionHeaderRow]};
string = intl.string;
items3 = [
<Text variant="text-lg/bold">
{Reflect.apply(string, intl, [t.qetVDw])}
</Text>,
];
PressableOpacity = (require(5278) /* metro dependency 5278: Pressables */).PressableOpacity;
var pressableOpacityProps = {onPress: importDefault(13557) /* metro dependency 13557: openBountiesNuxPromoSheet */,
hitSlop: 14};
string = intl.string;
pressableOpacityProps['aria-label'] = Reflect.apply(string, intl, [t.hvVgAZ]);
pressableOpacityProps.accessibilityRole = 'button';
items3[1] = (
<PressableOpacity {...pressableOpacityProps}>
{((CircleInformationIcon) => <CircleInformationIcon size="xs" color={(importDefault(697) /* metro dependency 697: native */).colors.ICON_SUBTLE} />)((require(4068) /* metro dependency 4068: CircleInformationIcon */).CircleInformationIcon)}
</PressableOpacity>
);
r5 = (
<View {...viewProps}>
{items3}
</View>
);
}
items2[1] = r5;
items2[2] = ((Component) => <Component verticalScrollEnabled={verticalScrollEnabled} />)(importDefault(13559) /* metro dependency 13559: QuestHomeBounties */);
const items4 = [styles.sectionHeader];
items4[1] = styles.sectionHeaderWithTag;
string = intl.string;
const JALI2K = (IndexNativeModule).t.JALI2K;
items2[3] = (
<View style={items4}>
<Text variant="text-lg/semibold" color="white">
{Reflect.apply(string, intl, [JALI2K])}
</Text>
</View>
);
return (
<>
{items2}
</>
);
}
function _fun102646({shouldShowBounties, onLayout}) { // fn#102646, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13704:2451, offset: 0x022439e6, size: 72 bytes, params: 2, frame: 16
return (
<View onLayout={onLayout}>
{((Component) => <Component />)(shouldShowBounties ? HeaderWithBounties : HeaderPreviewButton)}
</View>
);
}
function QuestHome({containerStyle, isNavigationComplete, scrollToQuestId, filters, sortMethod, onClearFilters}) { // fn#102647, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13704:2593, offset: 0x02243a2e, size: 1507 bytes, params: 2, frame: 38
var object3;
var r1;
var r0;
const FlashList = (FlashListModule).FlashList;
var object;
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
const isEligibleForQuests = (QuestsEligibilityModule).getIsEligibleForQuests();
const styles = useStyles();
const bottom = (UseSafeAreaInsetsNative)().bottom;
const useFilteredQuests = QuestHooksModule.useFilteredQuests;
const QuestTabs = QuestHooksModule.QuestTabs;
let ALL = QuestTabs.ALL;
const binding = quests2;
const useMemo = binding.useMemo;
const value4 = Reflect.apply(useFilteredQuests, QuestHooksModule, [ALL, Reflect.apply(useMemo, binding,
[function() {
return {filters: filters, sortMethod: sortMethod};
}, [filters, sortMethod]])]);
const quests = value4.quests;
var quests2 = quests;
const excludedQuests = value4.excludedQuests;
const isFetchingCurrentQuests = value4.isFetchingCurrentQuests;
const hasFetched = value4.hasFetched;
quests2.useEffect(_fun102652, [(FluxModule).useStateFromStoresArray([QuestStore],
_fun102649, [])]);
const env0_9 = quests2.useRef(null);
const value7 = quests2.useMemo(_fun102653, [scrollToQuestId, quests, excludedQuests]);
quests2.useEffect(_fun102655, [scrollToQuestId, quests, excludedQuests, hasFetched, isFetchingCurrentQuests]);
const value8 = _fun102656({scrollToIndex: value7});
const scrollViewRef = value8.scrollViewRef;
const handleListScroll = value8.handleListScroll;
const handleListLayout = value8.handleListLayout;
const handleListLoad = value8.handleListLoad;
const env0_11 = value8.handleQuestCardLayout;
const handleHeaderLayout = value8.handleHeaderLayout;
const env0_13 = value8.visibilityRef;
const value9 = QuestUtmStore(function(a0) {
return a0.getUtmCurrentContext();
});
const defaultImport = UseTrackImpression;
object3 = {};
const ImpressionNames = (AnalyticsUtilsModule).ImpressionNames;
const QUEST_HOME = ImpressionNames.QUEST_HOME;
object3.name = QUEST_HOME;
const ImpressionTypes = (AnalyticsUtilsModule).ImpressionTypes;
const VIEW = ImpressionTypes.VIEW;
object3.type = VIEW;
ALL = QuestTabs.ALL;
object3.properties = {utm_source_current: value9.utmSourceCurrent, utm_medium_current: value9.utmMediumCurrent,
utm_campaign_current: value9.utmCampaignCurrent, utm_content_current: value9.utmContentCurrent, tab: ALL};
defaultImport(object3);
quests2.useEffect(_fun102667, [isEligibleForQuests]);
quests2.useEffect(function() {
if (scrollViewRef.current != null && hasFetched) {
scrollViewRef.current.scrollToOffset({'offset': 0, 'animated': false});
}
}, [filters, sortMethod, hasFetched, scrollViewRef]);
QuestHooksModule.useQuestHomeSortingFilteringAnalytics({selectedSortMethod: sortMethod, selectedFilters: filters,
numQuestsVisible: quests.length});
const useVirtualCurrencyMobileEnabled = UseVirtualCurrencyMobileEnabledModule.useVirtualCurrencyMobileEnabled;
const enabled = Reflect.apply(useVirtualCurrencyMobileEnabled, UseVirtualCurrencyMobileEnabledModule, []).enabled;
const QuestHomeBountiesExperiment = (QuestHomeBountiesExperimentModule).QuestHomeBountiesExperiment;
const useConfig = QuestHomeBountiesExperiment.useConfig;
object3 = {};
const QUEST_HOME_MOBILE = QuestsExperimentLocations.QUEST_HOME_MOBILE;
object3.location = QUEST_HOME_MOBILE;
const enabled2 = Reflect.apply(useConfig, QuestHomeBountiesExperiment, [object3]).enabled;
const useRoute = moduleValue6.useRoute;
const {isLoading,
questHomeBounties} = QuestHooksModule.useFetchQuestHomeBounties({previewAdCreativeIds: Reflect.apply(useRoute,
moduleValue6, []).params?.previewAdCreativeIds});
const r4 = enabled && enabled2 && (require(7114) /* metro dependency 7114: QuestUtils */).shouldShowBountiesGivenFilters(filters);
useSurveyActions({bountiesAvailable: r4 && !isLoading && questHomeBounties.length > 0});
const value13 = quests2.useCallback(_fun102679, [r4, handleHeaderLayout]);
if (isEligibleForQuests) {
if (isNavigationComplete) {
if (r4) {
if (isLoading) {
r1 = (
<View style={[styles.loadingContainer, containerStyle]}>
<ActivityIndicator animating />
</View>
);
} else if (isFetchingCurrentQuests) {
if (quests.length === 0) {
r1 = (
<View style={[styles.loadingContainer, containerStyle]}>
<ActivityIndicator animating />
</View>
);
} else if (quests.length === 0) {
r1 = (
filters.length === 0
? (
<EmptyStateNoQuestsAvailable />
)
: (
<EmptyStateFiltered onClearFilters={onClearFilters} />
)
);
} else {
object3 = {ref: scrollViewRef};
object = {};
object.paddingTop = (importDefault(697) /* metro dependency 697: native */).space.PX_16;
object.paddingBottom = bottom;
object3.contentContainerStyle = object;
object3.style = [styles.container, containerStyle];
object3.accessibilityLabel = intl.string((require(1244) /* metro dependency 1244: indexNative */).t.JALI2K);
object3.data = quests;
object3.renderItem = renderItem_102680;
object3.estimatedItemSize = (require(13567) /* metro dependency 13567: QuestCard */).ESTIMATED_CARD_HEIGHT;
object3.showsHorizontalScrollIndicator = false;
object3.ListHeaderComponent = value13;
object3.CellRendererComponent = CellRendererComponent_102682;
object3.onLayout = handleListLayout;
object3.onScroll = handleListScroll;
object3.onLoad = handleListLoad;
object3.scrollEventThrottle = 16;
r1 = <FlashList {...object3} />;
}
} else if (quests.length === 0) {
r1 = (
filters.length === 0
? (
<EmptyStateNoQuestsAvailable />
)
: (
<EmptyStateFiltered onClearFilters={onClearFilters} />
)
);
} else {
object3 = {ref: scrollViewRef};
object = {};
object.paddingTop = (importDefault(697) /* metro dependency 697: native */).space.PX_16;
object.paddingBottom = bottom;
object3.contentContainerStyle = object;
object3.style = [styles.container, containerStyle];
object3.accessibilityLabel = intl.string((require(1244) /* metro dependency 1244: indexNative */).t.JALI2K);
object3.data = quests;
object3.renderItem = renderItem_102680;
object3.estimatedItemSize = (require(13567) /* metro dependency 13567: QuestCard */).ESTIMATED_CARD_HEIGHT;
object3.showsHorizontalScrollIndicator = false;
object3.ListHeaderComponent = value13;
object3.CellRendererComponent = CellRendererComponent_102682;
object3.onLayout = handleListLayout;
object3.onScroll = handleListScroll;
object3.onLoad = handleListLoad;
object3.scrollEventThrottle = 16;
r1 = <FlashList {...object3} />;
}
} else if (isFetchingCurrentQuests) {
if (quests.length === 0) {
r1 = (
<View style={[styles.loadingContainer, containerStyle]}>
<ActivityIndicator animating />
</View>
);
} else if (quests.length === 0) {
r1 = (
filters.length === 0
? (
<EmptyStateNoQuestsAvailable />
)
: (
<EmptyStateFiltered onClearFilters={onClearFilters} />
)
);
} else {
object3 = {ref: scrollViewRef};
object = {};
object.paddingTop = (importDefault(697) /* metro dependency 697: native */).space.PX_16;
object.paddingBottom = bottom;
object3.contentContainerStyle = object;
object3.style = [styles.container, containerStyle];
object3.accessibilityLabel = intl.string((require(1244) /* metro dependency 1244: indexNative */).t.JALI2K);
object3.data = quests;
object3.renderItem = renderItem_102680;
object3.estimatedItemSize = (require(13567) /* metro dependency 13567: QuestCard */).ESTIMATED_CARD_HEIGHT;
object3.showsHorizontalScrollIndicator = false;
object3.ListHeaderComponent = value13;
object3.CellRendererComponent = CellRendererComponent_102682;
object3.onLayout = handleListLayout;
object3.onScroll = handleListScroll;
object3.onLoad = handleListLoad;
object3.scrollEventThrottle = 16;
r1 = <FlashList {...object3} />;
}
} else if (quests.length === 0) {
r1 = (
filters.length === 0
? (
<EmptyStateNoQuestsAvailable />
)
: (
<EmptyStateFiltered onClearFilters={onClearFilters} />
)
);
} else {
object3 = {ref: scrollViewRef};
object = {};
object.paddingTop = (importDefault(697) /* metro dependency 697: native */).space.PX_16;
object.paddingBottom = bottom;
object3.contentContainerStyle = object;
object3.style = [styles.container, containerStyle];
object3.accessibilityLabel = intl.string((require(1244) /* metro dependency 1244: indexNative */).t.JALI2K);
object3.data = quests;
object3.renderItem = renderItem_102680;
object3.estimatedItemSize = (require(13567) /* metro dependency 13567: QuestCard */).ESTIMATED_CARD_HEIGHT;
object3.showsHorizontalScrollIndicator = false;
object3.ListHeaderComponent = value13;
object3.CellRendererComponent = CellRendererComponent_102682;
object3.onLayout = handleListLayout;
object3.onScroll = handleListScroll;
object3.onLoad = handleListLoad;
object3.scrollEventThrottle = 16;
r1 = <FlashList {...object3} />;
}
} else {
r1 = (
<View style={[styles.loadingContainer, containerStyle]}>
<ActivityIndicator animating />
</View>
);
}
r0 = r1;
} else {
r0 = null;
}
return r0;
function _fun102649() { // fn#102649, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13704:2995, offset: 0x0224402a, size: 88 bytes, params: 1, frame: 13
var environment;
const Array = global.Array;
const from = Array.from;
let value = environment.__proto__;
const quests = QuestStore.quests;
value = Reflect.apply(from, Array, [quests.values()]);
value = value.filter(_fun102650);
value = value.map(function(a0) {
return a0.id;
});
return value.sort();
function _fun102650(a0) { // fn#102650, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13704:3037, offset: 0x02244082, size: 44 bytes, params: 2, frame: 11
let value = environment.__proto__.__proto__;
value = require(7091) /* metro dependency 7091: QuestDataUtils */;
return !value.isQuestExpired(a0);
}
}
function _fun102652() { // fn#102652, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13704:3110, offset: 0x022440ae, size: 87 bytes, params: 1, frame: 16
var value2;
var moduleValue;
if (env0_8.length > 0) {
value2 = environment.__proto__;
moduleValue = require(9484) /* metro dependency 9484: QuestActionCreators */;
moduleValue.markAdContentSeen((require(7121) /* metro dependency 7121: AdCreativeType */).AdCreativeType.QUEST,
env0_8);
}
}
function _fun102653() { // fn#102653, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13704:3228, offset: 0x02244105, size: 104 bytes, params: 1, frame: 18
const scrollToQuestIdBinding = scrollToQuestId;
const value2 = null;
if (value2 == scrollToQuestIdBinding) {
return value2;
}
return value2 == QuestDataUtilsModule.findQuestOrReplacement(scrollToQuestId, quests,
excludedQuests) ? value2 : quests.findIndex(_fun102654);
function _fun102654({id}) { // fn#102654, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13704:3334, offset: 0x00fc10ae, size: 26 bytes, params: 2, frame: 2
return id === env0_0.id;
}
}
function _fun102655() { // fn#102655, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13704:3375, offset: 0x0224416d, size: 316 bytes, params: 1, frame: 22
var value5;
var moduleValue;
var defaultImport;
var open;
var object;
var intl;
var defaultImport2;
var track;
var QUEST_HOME_MOBILE_DEEP_LINK_MISSING_QUEST;
if (scrollToQuestId != null && scrollToQuestId !== '' && hasFetched && !isFetchingCurrentQuests) {
value5 = environment.__proto__;
moduleValue = require(7091) /* metro dependency 7091: QuestDataUtils */;
if (moduleValue.findQuestOrReplacement(scrollToQuestId, quests,
excludedQuests) == null && env0_9.current !== scrollToQuestId) {
defaultImport = importDefault(3857) /* metro dependency 3857: ToastActionCreators */;
open = defaultImport.open;
object = {key: 'QUEST_HOME_MOBILE_DEEP_LINK_QUEST_NOT_FOUND'};
intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
object.content = intl.string((require(1244) /* metro dependency 1244: indexNative */).t.sIyHuY);
object.icon = importDefault(8947) /* metro dependency 8947 */;
object.toastDurationMs = 5000;
Reflect.apply(open, defaultImport, [object]);
defaultImport2 = importDefault(683) /* metro dependency 683: AnalyticsUtils */;
track = defaultImport2.track;
QUEST_HOME_MOBILE_DEEP_LINK_MISSING_QUEST = AnalyticEvents.QUEST_HOME_MOBILE_DEEP_LINK_MISSING_QUEST;
scrollToQuestIdBinding = scrollToQuestId;
Reflect.apply(track, defaultImport2, [QUEST_HOME_MOBILE_DEEP_LINK_MISSING_QUEST,
{quest_id: scrollToQuestIdBinding}]);
env0_9.current = scrollToQuestIdBinding;
}
}
}
function _fun102656({scrollToIndex}) { // fn#102656, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13704:3725, offset: 0x022442a9, size: 472 bytes, params: 2, frame: 25
const useReducedMotion = (require(566) /* metro dependency 566: flux */).useStateFromStores([AccessibilityStore],
function() {
return AccessibilityStore.useReducedMotion;
});
const value2 = env1_4.useRef(null);
const value3 = env1_4.useRef({parent: {scrollY: 0}, children: {}});
const value4 = env1_4.useCallback(_fun102658, []);
const value5 = env1_4.useCallback(_fun102659, [value4]);
const value6 = env1_4.useCallback(_fun102660, [value4]);
const [property, env0_6] = env1_3(env1_4.useState(false), 2);
const value9 = env1_4.useCallback(_fun102661, []);
const value10 = env1_4.useCallback(_fun102662, [value4]);
const value11 = env1_4.useCallback(_fun102663, [useReducedMotion]);
const value12 = env1_4.useCallback(_fun102664, [value4]);
env1_4.useEffect(_fun102665, [property, useReducedMotion, scrollToIndex, value11]);
return {scrollViewRef: value2, handleListScroll: value5, handleListLayout: value6, handleListLoad: value9,
handleQuestCardLayout: value10, handleHeaderLayout: value12, visibilityRef: value3};
function _fun102658(a0) { // fn#102658, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13704:3890, offset: 0x02244490, size: 141 bytes, params: 2, frame: 18
var r2;
var r4;
var r1;
var property;
var value5;
var value6;
var value7;
var calculateVisibility;
var value8;
var value9;
const Object = global.Object;
const keys = Object.keys;
let current = Module00057.current;
let children = current.children;
const value2 = Reflect.apply(keys, Object, [children]);
let length = value2.length;
const value3 = 0;
const value4 = undefined;
if (value3 < length) {
r2 = value4;
r4 = value3;
while (true) {
property = value2[r4];
value5 = a0 != null;
if (value5) {
value6 = property !== a0;
r1 = value6;
} else {
r1 = value5;
}
if (r1) {
continue;
}
current = Module00057.current;
children = current.children;
property = children[property];
value7 = property == null;
r1 = value7;
r2 = property;
if (r1) {
continue;
}
calculateVisibility = r2.calculateVisibility;
value8 = calculateVisibility == null;
r1 = value8;
if (r1) {
continue;
}
r2.calculateVisibility();
value9 = typeof r4 === 'bigint' ? r4 + 1n : +r4 + 1;
length = value2.length;
if (value9 < length) {
r4 = value9;
continue;
}
break;
}
}
return value4;
}
function _fun102659({nativeEvent}) { // fn#102659, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13704:4095, offset: 0x0224451d, size: 55 bytes, params: 2, frame: 10
Module00057.current.parent.scrollY = nativeEvent.contentOffset.y;
env0_4();
}
function _fun102660({nativeEvent}) { // fn#102660, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13704:4182, offset: 0x02244554, size: 50 bytes, params: 2, frame: 10
Module00057.current.parent.layout = nativeEvent.layout;
env0_4();
}
function _fun102661() { // fn#102661, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13704:4299, offset: 0x0218c4cf, size: 18 bytes, params: 1, frame: 11
env0_6(true);
}
function _fun102662({nativeEvent}, a1) { // fn#102662, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13704:4333, offset: 0x02244586, size: 84 bytes, params: 3, frame: 15
const children = Module00057.current.children;
const object = {};
copyDataProperties(object, Module00057.current.children[a1], undefined);
object['layout'] = nativeEvent.layout;
children[a1] = object;
env0_4(a1);
}
function _fun102663(a0) { // fn#102663, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13704:4447, offset: 0x022445da, size: 103 bytes, params: 2, frame: 14
var scrollToIndex;
var object;
let current = env0_2.current;
if (current != null) {
current = env0_2.current;
scrollToIndex = current.scrollToIndex;
object = {index: a0};
object.animated = !useReducedMotion;
value = environment.__proto__.__proto__;
object.viewOffset = (importDefault(697) /* metro dependency 697: native */).space.PX_8;
Reflect.apply(scrollToIndex, current, [object]);
}
}
function _fun102664({nativeEvent}) { // fn#102664, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13704:4570, offset: 0x02244641, size: 55 bytes, params: 2, frame: 10
Module00057.current.parent.firstItemOffset = nativeEvent.layout.height;
env0_4();
}
function _fun102665() { // fn#102665, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13704:4666, offset: 0x02244678, size: 84 bytes, params: 1, frame: 13
if (scrollToIndex != null && scrollToIndex !== -1 && ReactNativeModule.View) {
env0_7(scrollToIndex);
value = environment.__proto__.__proto__;
QuestHomeNavigationStore.setState({scrollToQuestId: null});
}
}
}
function _fun102667() { // fn#102667, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13704:5381, offset: 0x022446db, size: 55 bytes, params: 1, frame: 11
if (Module00057) {
value = environment.__proto__;
(require(13566) /* metro dependency 13566: QuestHomeOpenTriggerPoint */).QuestHomeOpenTriggerPoint.trigger();
}
}
function useSurveyActions({bountiesAvailable}) { // fn#102669, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13704:6022, owner: QuestHome.useSurveyActions, offset: 0x02244750, size: 224 bytes, params: 2, frame: 17
const value2 = (UseNavigationNativeModule).useNavigation();
const env0_2 = env1_4.useRef(false);
const env0_3 = env1_4.useRef(false);
const env0_4 = env1_4.useRef(false);
env1_4.useEffect(_fun102670, [bountiesAvailable]);
env1_4.useEffect(_fun102671, []);
env1_4.useEffect(_fun102674, []);
env1_4.useEffect(_fun102677, [value2]);
function _fun102670() { // fn#102670, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13704:6160, offset: 0x02244830, size: 26 bytes, params: 1, frame: 2
if (bountiesAvailable) {
env0_2.current = true;
}
}
function _fun102671() { // fn#102671, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13704:6203, offset: 0x0224484a, size: 65 bytes, params: 1, frame: 14
var environment;
const handleBountiesModalPush2 = handleBountiesModalPush;
const value = environment.__proto__.__proto__;
(Dispatcher).subscribe('MODAL_PUSH', handleBountiesModalPush2);
return _fun102673;
function handleBountiesModalPush({key}) { // fn#102672, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13704:6208, offset: 0x0224488b, size: 60 bytes, params: 2, frame: 12
const BOUNTIES_MODAL_KEY = (BountiesModalActionCreatorsModule).BOUNTIES_MODAL_KEY;
if (key === BOUNTIES_MODAL_KEY) {
value = environment.__proto__;
env1_3.current = true;
}
}
function _fun102673() { // fn#102673, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13704:6360, offset: 0x022448c7, size: 52 bytes, params: 1, frame: 14
let value = environment.__proto__.__proto__.__proto__;
value = importDefault(694) /* metro dependency 694: Dispatcher */;
value.unsubscribe('MODAL_PUSH', handleBountiesModalPush);
}
}
function _fun102674() { // fn#102674, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13704:6444, offset: 0x022448fb, size: 65 bytes, params: 1, frame: 14
var environment;
const handleClaimSuccess2 = handleClaimSuccess;
const value = environment.__proto__.__proto__;
(Dispatcher).subscribe('BOUNTIES_CLAIM_REWARD_SUCCESS',
handleClaimSuccess2);
return _fun102676;
function handleClaimSuccess() { // fn#102675, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13704:6449, offset: 0x0224493c, size: 19 bytes, params: 1, frame: 2
env1_4.current = true;
}
function _fun102676() { // fn#102676, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13704:6570, offset: 0x0224494f, size: 52 bytes, params: 1, frame: 14
let value = environment.__proto__.__proto__.__proto__;
value = importDefault(694) /* metro dependency 694: Dispatcher */;
value.unsubscribe('BOUNTIES_CLAIM_REWARD_SUCCESS', handleClaimSuccess);
}
}
function _fun102677() { // fn#102677, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13704:6668, offset: 0x02244983, size: 34 bytes, params: 1, frame: 13
return env0_1.addListener('beforeRemove', _fun102678);
function _fun102678() { // fn#102678, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13704:6702, offset: 0x022449a5, size: 178 bytes, params: 1, frame: 16
var value2;
var fireSurveyAction;
const SurveyActionTypes = (SurveyActionTypesModule).SurveyActionTypes;
let value = environment.__proto__;
let current = env1_2.current;
if (current) {
current = env1_4.current;
value2 = environment.__proto__.__proto__.__proto__;
if (current) {
value = require(9535) /* metro dependency 9535: QualtricsActionCreators */;
value.fireSurveyAction(SurveyActionTypes.BOUNTY_SESSION_COMPLETED);
} else {
current = env1_3.current;
value = require(9535) /* metro dependency 9535: QualtricsActionCreators */;
fireSurveyAction = value.fireSurveyAction;
if (current) {
Reflect.apply(fireSurveyAction, value, [SurveyActionTypes.BOUNTY_ABANDONED]);
} else {
Reflect.apply(fireSurveyAction, value, [SurveyActionTypes.BOUNTY_IMMEDIATE_DISMISSAL]);
}
}
}
}
}
}
function _fun102679() { // fn#102679, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13704:7042, offset: 0x02244a57, size: 44 bytes, params: 1, frame: 14
return ((Component) => <Component shouldShowBounties={JsxRuntimeModule.jsx} onLayout={handleHeaderLayout} />)(env1_18);
}
function QuestHomeRenderItem({item, index}) { // fn#102680, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13704:7493, owner: QuestHome.renderItem, offset: 0x02244a83, size: 169 bytes, params: 2, frame: 21
const QuestContentImpressionTrackerNative = (QuestContentImpressionTrackerNativeModule).QuestContentImpressionTrackerNative;
const object = {questOrQuests: item};
const QuestContent = (QuestTypesModule).QuestContent;
let QUEST_HOME_MOBILE = QuestContent.QUEST_HOME_MOBILE;
object.questContent = QUEST_HOME_MOBILE;
object.questContentPosition = index;
object.trackGuildAndChannelMetadata = false;
object.visibilityRef = visibilityRef;
QUEST_HOME_MOBILE = QuestContent.QUEST_HOME_MOBILE;
object.sourceQuestContent = QUEST_HOME_MOBILE;
return (
<QuestContentImpressionTrackerNative {...object} key={item.id}>
{children_102681}
</QuestContentImpressionTrackerNative>
);
function renderItemChildren() { // fn#102681, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13704:7769, owner: QuestHome.renderItem.children, offset: 0x02244b2c, size: 108 bytes, params: 1, frame: 19
const QuestCard = (QuestCardModule).QuestCard;
const itemBinding = item;
const indexBinding = index;
const QuestContent = (QuestTypesModule).QuestContent;
const QUEST_HOME_MOBILE = QuestContent.QUEST_HOME_MOBILE;
return (
<QuestCard
quest={itemBinding}
questContentPosition={indexBinding}
containerPadding={0}
sourceQuestContent={QUEST_HOME_MOBILE}
key={itemBinding.id}
/>
);
}
}
function QuestHomeCellRendererComponent(a0) { // fn#102682, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13704:8046, owner: QuestHome.CellRendererComponent, offset: 0x02244b98, size: 80 bytes, params: 2, frame: 15
const env0_0 = a0;
const CellContainer = (FlashListModule).CellContainer;
return <CellContainer {...a0} {...{['onLayout']: CellRendererComponentOnLayout}} />;
function CellRendererComponentOnLayout(a0) { // fn#102683, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13704:8089, owner: QuestHome.CellRendererComponent.onLayout, offset: 0x02244be8, size: 68 bytes, params: 2, frame: 14
const property = quests[env0_0.index];
if (property != null) {
handleQuestCardLayout(a0, property.id);
}
env0_0.onLayout(a0);
}
}
}
}
global.__d(_fun102639, 13514, [57, 31, 27, 4502, 9481, 7093, 7115, 6528, 661, 33, 4501, 697, 566, 1484, 13515, 694,
9535, 9534, 13555, 4578, 1244, 5080, 7007, 9483, 9530, 4573, 5278, 13557, 4068, 13559, 9479, 1585, 7091, 9484,
7121, 3857, 8947, 683, 8742, 480, 13566, 4127, 9528, 1485, 7114, 8416, 10183, 6531, 13567,
2]) /* metro module 13514, dependencies: [57, 31, 27, 4502, 9481, 7093, 7115, 6528, 661, 33, 4501, 697, 566, 1484, 13515, 694, 9535, 9534, 13555, 4578, 1244, 5080, 7007, 9483, 9530, 4573, 5278, 13557, 4068, 13559, 9479, 1585, 7091, 9484, 7121, 3857, 8947, 683, 8742, 480, 13566, 4127, 9528, 1485, 7114, 8416, 10183, 6531, 13567, 2] */;