decord/source/modules/quests/native/QuestDock/QuestDock.tsx
github-actions 8d58bae3b2 chore: update source for alpha 347.4
Skipped 1 file(s) >100MB (GitHub limit): source/__polyfill/04xxx/module_4907.js (118.4 MB)
2026-09-18 06:58:00 +00:00

812 lines
42 KiB
TypeScript

// Module ID: 15389
// Function ID: 15390
// Name: QuestDock
// Dependencies: [5, 32, 109, 19, 17, 15299, 5614, 15301, 1074, 1085, 21, 4722, 576, 15308, 15298, 15302, 15305, 5129, 4458, 8499, 1612, 15306, 4423, 15390, 5143, 15300, 5147, 5126, 15391, 7269, 1115, 15392, 15393, 15394, 5130, 11729, 5617, 15395, 7798, 7803, 7924, 15388, 504, 11730, 11528, 4432, 15297, 1241, 15396, 15397, 15404, 15405, 15407, 12020, 5621, 15409, 15410, 15412, 2]
// Module 15389 (QuestDock)
import initialize from "initialize" /* 504 */;
import nativeDefault from "native" /* 576 */;
import AnalyticsUtilsDefault from "AnalyticsUtils" /* 1241 */;
import native from "native" /* 4432 */;
import ReanimatedRexport from "ReanimatedRexport" /* 4458 */;
import spring from "spring" /* 5143 */;
import springPresets from "springPresets" /* 5147 */;
import QuestTypes from "QuestTypes" /* 5617 */;
import AdCreativeType from "AdCreativeType" /* 5621 */;
import MonitoringAgentDefault from "MonitoringAgent" /* 7798 */;
import MetricEvents from "MetricEvents" /* 7803 */;
import AnalyticsTypes from "AnalyticsTypes" /* 7924 */;
import QuestActionCreators from "QuestActionCreators" /* 11528 */;
import hooks_QuestHooks from "hooks/QuestHooks" /* 11729 */;
import QuestsEligibility from "QuestsEligibility" /* 11730 */;
import QuestContentImpressionTracker from "QuestContentImpressionTracker" /* 12020 */;
import QuestDockUtils from "QuestDockUtils" /* 15300 */;
import QuestDockGestureContext from "QuestDockGestureContext" /* 15302 */;
import QuestDockBountyHeaderDefault from "QuestDockBountyHeader" /* 15409 */;
import QuestDockBountyBodyDefault from "QuestDockBountyBody" /* 15410 */;
import QuestDockBountyBackgroundDefault from "QuestDockBountyBackground" /* 15412 */;
import asyncGeneratorStep from "asyncGeneratorStep" /* 5 */;
import _slicedToArray from "module_32" /* 32 */;
import _objectWithoutProperties from "_objectWithoutProperties" /* 109 */;
import noop from "module_19" /* 19 */;
import QuestDockStore from "QuestDockStore" /* 15299 */;
require = fn;
function QuestDockWithGestureAnimation(backgroundColor) {
backgroundColor = backgroundColor.backgroundColor;
const layoutVariant = backgroundColor.layoutVariant;
importDefault = tmp;
let str = "fixed";
({ expandedHeight, collapsedContent, expandedContent, backgroundContent } = backgroundColor);
if ("flush" === layoutVariant) {
str = "content";
}
let str2 = "overlay";
if ("flush" === layoutVariant) {
str2 = "default";
}
const questDockCreative = backgroundColor(questDockExpandHandler[13]).useQuestDockCreative();
let obj = backgroundColor(questDockExpandHandler[13]);
questDockExpandHandler = backgroundColor(questDockExpandHandler[14]).useQuestDockExpandHandler(questDockCreative);
let tmp7 = closure_26();
const context = setRestingQuestDockMode.useContext(backgroundColor(questDockExpandHandler[15]).QuestDockGestureContext);
const questDockWrapperSpecs = context.questDockWrapperSpecs;
const activeQuestDockMode = context.activeQuestDockMode;
const windowDimensions = context.windowDimensions;
const context1 = setRestingQuestDockMode.useContext(backgroundColor(questDockExpandHandler[16]).QuestDockExternalCoordinationContext);
const restingQuestDockMode = context1.restingQuestDockMode;
setRestingQuestDockMode = context1.setRestingQuestDockMode;
let items = [setRestingQuestDockMode];
const id = setRestingQuestDockMode.useId();
const callback = setRestingQuestDockMode.useCallback(() => {
setRestingQuestDockMode(QuestDockMode.COLLAPSED);
}, items);
let obj2 = backgroundColor(questDockExpandHandler[14]);
const questDockModeAnimatedReaction = backgroundColor(questDockExpandHandler[14]).useQuestDockModeAnimatedReaction();
let obj3 = backgroundColor(questDockExpandHandler[14]);
const questDockDismissalReset = backgroundColor(questDockExpandHandler[14]).useQuestDockDismissalReset();
let obj4 = backgroundColor(questDockExpandHandler[14]);
const isScreenReaderEnabled = backgroundColor(questDockExpandHandler[17]).useIsScreenReaderEnabled();
let obj5 = backgroundColor(questDockExpandHandler[17]);
const fn = function z() {
return restingQuestDockMode.get() === QuestDockMode.EXPANDED;
};
fn.__closure = { restingQuestDockMode, QuestDockMode };
fn.__workletHash = 2415817673061;
fn.__initData = __initData;
const derivedValue = backgroundColor(questDockExpandHandler[18]).useDerivedValue(fn);
const tmp17 = require("useStateFromSharedValue")(derivedValue);
const top = require("useSafeAreaInsets")().top;
let obj6 = backgroundColor(questDockExpandHandler[18]);
obj7 = { restingQuestDockMode, QuestDockMode };
const youBarTotalHeight = backgroundColor(questDockExpandHandler[21]).useYouBarTotalHeight();
const obj8 = backgroundColor(questDockExpandHandler[21]);
const token = backgroundColor(questDockExpandHandler[22]).useToken(require("native").modules.mobile.QUEST_DOCK_BORDER_RADIUS);
const tmp20 = require("useQuestDockAnimatedBorderRadius")(token);
closure_10 = tmp20;
const obj9 = backgroundColor(questDockExpandHandler[22]);
const fn2 = function $() {
const size = { backgroundColor, borderBottomRightRadius: spring.withSpring(closure_10.get(), QUEST_DOCK_MODE_CHANGE_PHYSICS_CLAMPED), borderBottomLeftRadius: null, height: null, width: null, opacity: null, transform: null };
size.borderBottomLeftRadius = spring.withSpring(closure_10.get(), QUEST_DOCK_MODE_CHANGE_PHYSICS_CLAMPED);
size.height = questDockWrapperSpecs.get().height;
size.width = questDockWrapperSpecs.get().width;
size.opacity = spring.withSpring(1, QUEST_DOCK_MODE_CHANGE_PHYSICS);
const obj = { translateX: null };
const obj6 = spring;
obj.translateX = obj6.withSpring(questDockWrapperSpecs.get().x + -1 * QuestDockUtils.roundToNearestPixel(questDockWrapperSpecs.get().width / 2), QUEST_DOCK_MODE_CHANGE_PHYSICS);
const items = [obj, ];
const obj5 = { translateY: null };
obj5.translateY = spring.withSpring(questDockWrapperSpecs.get().y, QUEST_DOCK_MODE_CHANGE_PHYSICS);
items[1] = obj5;
size.transform = items;
return size;
};
const obj10 = backgroundColor(questDockExpandHandler[18]);
fn2.__closure = { backgroundColor, withSpring: backgroundColor(questDockExpandHandler[24]).withSpring, bottomBorderRadius: tmp20, QUEST_DOCK_MODE_CHANGE_PHYSICS_CLAMPED, questDockWrapperSpecs, QUEST_DOCK_MODE_CHANGE_PHYSICS, roundToNearestPixel: backgroundColor(questDockExpandHandler[25]).roundToNearestPixel };
fn2.__workletHash = 9565489600157;
fn2.__initData = __initData2;
const animatedStyle = obj10.useAnimatedStyle(fn2);
const obj11 = { backgroundColor, withSpring: backgroundColor(questDockExpandHandler[24]).withSpring, bottomBorderRadius: tmp20, QUEST_DOCK_MODE_CHANGE_PHYSICS_CLAMPED, questDockWrapperSpecs, QUEST_DOCK_MODE_CHANGE_PHYSICS, roundToNearestPixel: backgroundColor(questDockExpandHandler[25]).roundToNearestPixel };
const sharedValue = backgroundColor(questDockExpandHandler[18]).useSharedValue(0);
const obj12 = backgroundColor(questDockExpandHandler[18]);
class J {
constructor() {
obj = { transform: null };
obj1 = { scale: null };
obj3 = closure_0(closure_2[24]);
obj4 = closure_0(closure_2[18]);
interpolateResult = obj4.interpolate(closure_11.get(), [1, 0], [1, 1]);
obj1.scale = obj3.withSpring(interpolateResult, closure_0(closure_2[26]).springStandard);
items = [];
items[0] = obj1;
obj.transform = items;
return obj;
}
}
const obj13 = backgroundColor(questDockExpandHandler[18]);
J.__closure = { withSpring: backgroundColor(questDockExpandHandler[24]).withSpring, interpolate: backgroundColor(questDockExpandHandler[18]).interpolate, isPressed: sharedValue, springStandard: backgroundColor(questDockExpandHandler[26]).springStandard };
J.__workletHash = 3373473585356;
J.__initData = __initData3;
const items1 = [setRestingQuestDockMode, questDockExpandHandler];
const animatedStyle1 = obj13.useAnimatedStyle(J);
const items2 = [sharedValue];
const callback1 = setRestingQuestDockMode.useCallback(() => {
setRestingQuestDockMode(QuestDockMode.EXPANDED);
questDockExpandHandler();
}, items1);
const items3 = [sharedValue];
const callback2 = setRestingQuestDockMode.useCallback(() => {
const result = sharedValue.set(1);
}, items2);
const callback3 = setRestingQuestDockMode.useCallback(() => {
const result = sharedValue.set(0);
}, items3);
const obj14 = { withSpring: backgroundColor(questDockExpandHandler[24]).withSpring, interpolate: backgroundColor(questDockExpandHandler[18]).interpolate, isPressed: sharedValue, springStandard: backgroundColor(questDockExpandHandler[26]).springStandard };
class Z {
constructor() {
obj = closure_0(closure_2[24]);
num = 0;
if (activeQuestDockMode.get() === QuestDockMode.EXPANDED) {
num = 1;
}
obj1 = { opacity: obj.withSpring(num, closure_14), height: windowDimensions.get().height };
return obj1;
}
}
const obj15 = backgroundColor(questDockExpandHandler[18]);
Z.__closure = { withSpring: backgroundColor(questDockExpandHandler[24]).withSpring, activeQuestDockMode, QuestDockMode, QUEST_DOCK_MODE_CHANGE_PHYSICS, windowDimensions };
Z.__workletHash = 6178969276321;
Z.__initData = __initData4;
const animatedStyle2 = obj15.useAnimatedStyle(Z);
const obj16 = { withSpring: backgroundColor(questDockExpandHandler[24]).withSpring, activeQuestDockMode, QuestDockMode, QUEST_DOCK_MODE_CHANGE_PHYSICS, windowDimensions };
function ee() {
let pointerEvents = "none";
if (activeQuestDockMode.get() === QuestDockMode.EXPANDED) {
pointerEvents = "auto";
}
return { pointerEvents };
}
ee.__closure = { activeQuestDockMode, QuestDockMode };
ee.__workletHash = 5416180055289;
ee.__initData = __initData5;
const animatedProps = backgroundColor(questDockExpandHandler[18]).useAnimatedProps(ee);
const obj17 = backgroundColor(questDockExpandHandler[18]);
function te() {
value = questDockWrapperSpecs.get();
return windowDimensions.get().height - top - value.height;
}
te.__closure = { questDockWrapperSpecs, windowDimensions, safeAreaTop: top };
te.__workletHash = 8073454569923;
te.__initData = __initData6;
const derivedValue1 = backgroundColor(questDockExpandHandler[18]).useDerivedValue(te);
const obj18 = backgroundColor(questDockExpandHandler[18]);
const tmp30 = require("useStateFromSharedValue")(derivedValue1);
function oe() {
if (activeQuestDockMode.get() === QuestDockMode.CLOSED) {
let num = 0;
} else {
num = 1;
}
return { opacity: spring.withSpring(num, QUEST_DOCK_MODE_CHANGE_PHYSICS) };
}
const obj19 = backgroundColor(questDockExpandHandler[18]);
oe.__closure = { withSpring: backgroundColor(questDockExpandHandler[24]).withSpring, activeQuestDockMode, QuestDockMode, QUEST_DOCK_MODE_CHANGE_PHYSICS };
oe.__workletHash = 6468803634518;
oe.__initData = __initData7;
const animatedStyle3 = obj19.useAnimatedStyle(oe);
const obj20 = { withSpring: backgroundColor(questDockExpandHandler[24]).withSpring, activeQuestDockMode, QuestDockMode, QUEST_DOCK_MODE_CHANGE_PHYSICS };
function ie() {
if (closure_1) {
if (activeQuestDockMode.get() === QuestDockMode.EXPANDED) {
let tmp4 = QUEST_DOCK_CONTENT_BORDER_RADII;
}
const size = { borderTopLeftRadius: tmp4, borderTopRightRadius: null, borderBottomLeftRadius: null, borderBottomRightRadius: null, opacity: null, height: null, width: null, transform: null, borderBottomWidth: null };
if (tmp) {
if (activeQuestDockMode.get() === QuestDockMode.EXPANDED) {
let tmp7 = QUEST_DOCK_CONTENT_BORDER_RADII;
}
size.borderTopRightRadius = tmp7;
if (tmp) {
if (activeQuestDockMode.get() === QuestDockMode.EXPANDED) {
value2 = QUEST_DOCK_CONTENT_BORDER_RADII;
}
size.borderBottomLeftRadius = value2;
if (tmp) {
if (activeQuestDockMode.get() === QuestDockMode.EXPANDED) {
value = QUEST_DOCK_CONTENT_BORDER_RADII;
}
size.borderBottomRightRadius = value;
let num2 = 1;
if (activeQuestDockMode.get() === QuestDockMode.EXPANDED) {
num2 = 0;
}
size.opacity = spring.withSpring(num2, QUEST_DOCK_MODE_CHANGE_PHYSICS_CLAMPED);
if (activeQuestDockMode.get() === QuestDockMode.EXPANDED) {
if (tmp) {
let height = QUEST_DOCK_COLLAPSED_HEIGHT;
}
size.height = height;
if (obj3.get() === QuestDockMode.EXPANDED) {
if (tmp) {
let width = questDockWrapperSpecs.get().width - 2 * closure_2_17;
}
size.width = width;
let num5 = 0;
if (tmp) {
let num6 = 0;
if (obj3.get() === QuestDockMode.EXPANDED) {
num6 = closure_2_17;
}
num5 = tmp16(5143).withSpring(num6, tmp19);
const tmp16Result = tmp16(5143);
}
const obj = { translateX: num5 };
const items = [obj, ];
let num7 = 0;
if (tmp) {
let num8 = 0;
if (obj3.get() === QuestDockMode.EXPANDED) {
num8 = closure_2_17;
}
num7 = tmp16(5143).withSpring(num8, tmp19);
const tmp16Result2 = tmp16(5143);
}
const obj4 = { translateY: num7 };
items[1] = obj4;
size.transform = items;
let num9 = 0;
if (closure_10.get() > 0) {
num9 = 1;
}
size.borderBottomWidth = num9;
return size;
}
width = questDockWrapperSpecs.get().width;
}
height = questDockWrapperSpecs.get().height;
}
value = closure_10.get();
}
value2 = closure_10.get();
}
tmp7 = token;
}
tmp4 = token;
}
const obj21 = backgroundColor(questDockExpandHandler[18]);
ie.__closure = { hasInsetHeaderTile: "insetHeader" === layoutVariant, activeQuestDockMode, QuestDockMode, QUEST_DOCK_CONTENT_BORDER_RADII, questDockBorderRadius: token, bottomBorderRadius: tmp20, withSpring: backgroundColor(questDockExpandHandler[24]).withSpring, QUEST_DOCK_MODE_CHANGE_PHYSICS_CLAMPED, QUEST_DOCK_COLLAPSED_HEIGHT, questDockWrapperSpecs, QUEST_DOCK_UNENROLLED_HEADER_INSET_EXPANDED: closure_17 };
ie.__workletHash = 13161475723910;
ie.__initData = __initData8;
const obj23 = { style: tmp7.wrapper, pointerEvents: "auto", children: null };
const animatedStyle4 = obj21.useAnimatedStyle(ie);
const obj24 = { nativeID: id, style: tmp7.accessibilityWrapper, accessibilityViewIsModal: null, onAccessibilityEscape: null, pointerEvents: "box-none", children: null };
let tmp37 = isScreenReaderEnabled;
if (tmp37) {
tmp37 = tmp17;
}
obj24.accessibilityViewIsModal = tmp37;
obj24.onAccessibilityEscape = callback;
const obj22 = { hasInsetHeaderTile: "insetHeader" === layoutVariant, activeQuestDockMode, QuestDockMode, QUEST_DOCK_CONTENT_BORDER_RADII, questDockBorderRadius: token, bottomBorderRadius: tmp20, withSpring: backgroundColor(questDockExpandHandler[24]).withSpring, QUEST_DOCK_MODE_CHANGE_PHYSICS_CLAMPED, QUEST_DOCK_COLLAPSED_HEIGHT, questDockWrapperSpecs, QUEST_DOCK_UNENROLLED_HEADER_INSET_EXPANDED: closure_17 };
const tmp34 = closure_25;
const obj25 = { style: animatedStyle1, children: null };
let tmp16Result = require("QuestDockGestureDetector");
const obj26 = { style: null, layout: null, children: null };
const items4 = [tmp7.questDockWrapper, { bottom: youBarTotalHeight - 1 }, animatedStyle];
obj26.style = items4;
const obj27 = { bottom: youBarTotalHeight - 1 };
const tmp16Result6 = require("ReanimatedNativeView");
obj26.layout = backgroundColor(questDockExpandHandler[25]).dimensionsLayoutTransition;
const obj28 = { style: tmp7.nestedPressable, onPressIn: callback2, onPressOut: callback3, onPress: callback1, pointerEvents: null, accessibilityRole: "button", accessibilityLabel: null, accessibilityHint: null };
let str3 = "auto";
if (tmp17) {
str3 = "none";
}
obj28.pointerEvents = str3;
const intl = tmp3(tmp4[30]).intl;
obj28.accessibilityLabel = intl.string(backgroundColor(questDockExpandHandler[30]).t.rjVPdM);
let str4 = "";
if (!tmp17) {
const intl2 = tmp3(tmp4[30]).intl;
str4 = intl2.string(tmp3(tmp4[30]).t.n0MlOB);
}
const obj29 = { children: null };
const obj30 = { children: null };
obj28.accessibilityHint = str4;
const items5 = [closure_23(token, obj28), , , ];
const obj31 = { style: null, layout: null, pointerEvents: "none" };
const items6 = [tmp7.questDockHeaderBorder, animatedStyle4];
obj31.style = items6;
const tmp16Result7 = require("ReanimatedNativeView");
obj31.layout = backgroundColor(questDockExpandHandler[25]).dimensionsLayoutTransition;
items5[1] = closure_23(require("ReanimatedNativeView"), obj31);
const obj32 = { style: null, children: null };
const items7 = [tmp7.questDockContentWrapper, animatedStyle3];
obj32.style = items7;
const obj33 = { style: tmp7.questDockContentWrapper, children: null };
const tmp16Result8 = require("ReanimatedNativeView");
const items8 = [closure_23(require("QuestDockContentCollapsed"), { hideOnExpand: "flush" === layoutVariant, children: collapsedContent }), closure_23(require("QuestDockContentExpanded"), { expandedHeightMode: str, expandedHeight, children: expandedContent })];
obj33.children = items8;
const items9 = [closure_24(top, obj33), backgroundContent];
obj32.children = items9;
items5[2] = closure_24(require("ReanimatedNativeView"), obj32);
items5[3] = closure_23(require("QuestDockDragHandle"), { isExpanded: tmp17, variant: str2 });
obj26.children = items5;
obj25.children = closure_24(tmp16Result7, obj26);
obj30.children = closure_23(tmp16Result6, obj25);
obj24.children = closure_23(tmp16Result, obj30);
obj23.children = closure_23(backgroundColor(questDockExpandHandler[27]).AccessibilityViewAnimated, obj24);
const items10 = [closure_23(top, obj23), ];
const obj34 = { style: animatedStyle2, animatedProps, children: null };
const tmp16Result9 = require("ReanimatedNativeView");
obj34.children = closure_23(backgroundColor(questDockExpandHandler[34]).Backdrop, { onDismiss: callback, accessibleDismissStyle: { height: tmp30 } });
items10[1] = closure_23(require("ReanimatedNativeView"), obj34);
obj29.children = items10;
return closure_24(tmp34, obj29);
}
function QuestDockModeChangeTracker(mode) {
const tmp = _objectWithoutProperties(mode, closure_3);
const obj2 = { mode: mode.mode };
const merged = Object.assign(tmp);
obj2.questContent = QuestTypes.QuestContent.QUEST_BAR_MOBILE;
obj2.sourceQuestContent = QuestTypes.QuestContent.QUEST_BAR_MOBILE;
const questBarOrDockModeChangeTracking = hooks_QuestHooks.useQuestBarOrDockModeChangeTracking(obj2);
return null;
}
function QuestBarRenderedTriggerPointWrapper() {
const effect = noop.useEffect(() => {
const QuestBarRenderedTriggerPoint = require("QuestBarRenderedTriggerPoint").QuestBarRenderedTriggerPoint;
QuestBarRenderedTriggerPoint.trigger();
}, []);
return null;
}
function QuestDockWithEntranceAnimation(arg0) {
({ renderModeChangeTracker: require, identifierMetricTag } = arg0);
({ backgroundImageUrl, iconUrl, layoutVariant: dependencyMap, theme: closure_3, backgroundColor: asyncGeneratorStep, expandedHeight: _slicedToArray, collapsedContent: _objectWithoutProperties, expandedContent: noop, backgroundContent: closure_8 } = arg0);
({ renderImpressionTracker, trackAssetLoadingFailure } = arg0);
const context = noop.useContext(identifierMetricTag(15388));
const isRendered = context.isRendered;
let items = [closure_11];
const mode = initialize.useStateFromStores(items, () => closure_11.prevRestingQuestDockMode);
closure_11 = _slicedToArray(noop.useState(() => performance.now()), 1)[0];
noop.useRef(false);
let obj = noop;
let tmp = identifierMetricTag;
[componentDimensions, closure_14] = noop.useState({ width: 0, height: 0 });
let tmp4 = closure_38();
const isEligibleForQuests = QuestsEligibility.getIsEligibleForQuests();
const fn = function n() {
let num = 0;
if (isRendered) {
num = 1;
}
const obj2 = { opacity: spring.withSpring(num, obj7, "animate-always"), transform: null };
const tmp3 = isRendered;
const tmp4 = obj7;
let num2 = 0;
if (!tmp3) {
num2 = first.height;
}
const tmpResult = spring;
const items = [{ translateY: spring.withSpring(num2, tmp4) }];
obj2.transform = items;
return obj2;
};
let obj4 = ReanimatedRexport;
fn.__closure = { withSpring: spring.withSpring, isRendered, ENTRANCE_ANIMATION_SPING_CONFIG: obj7, componentDimensions };
fn.__workletHash = 15545726338295;
fn.__initData = __initData9;
closure_129_5 = undefined;
closure_129_0 = identifierMetricTag;
closure_129_1 = backgroundImageUrl;
closure_129_2 = iconUrl;
closure_129_3 = trackAssetLoadingFailure;
const animatedStyle = obj4.useAnimatedStyle(fn);
[first1, closure_129_5] = noop.useState(constants2.PENDING);
closure_129_4 = first1;
closure_129_6 = noop.useEffectEvent((arg0) => {
if (theme != null) {
tmp(arg0);
}
});
const items1 = [backgroundImageUrl, iconUrl];
const effect = noop.useEffect(() => {
function prefetchWithErrorReporting(arg0) {
const self = this;
const apply = closure_1.apply;
if (typeof apply === "unknown") {
let applyArgumentsResult = HermesBuiltin.applyArguments(self);
} else {
applyArgumentsResult = apply(self, arguments);
}
return applyArgumentsResult;
}
closure_1 = async function _prefetchWithErrorReporting(arg0, value) {
if (v3 === 2) {
v3 = 3;
throw new TypeError("Generator functions may not be called on executing generators");
} else if (tmp6 === 3) {
if (arg0 === 1) {
throw value;
} else if (arg0 === 2) {
const obj2 = { value, done: true };
return obj2;
} else {
return { value: "HermesInternal", done: null };
}
} else {
try {
v3 = 2;
if (0 === c5) {
if (arg0 === 1) {
v3 = 3;
throw value;
} else if (arg0 === 2) {
v3 = 3;
const obj3 = { value, done: true };
return obj3;
} else {
closure_2 = tmp3;
closure_1 = tmp7;
closure_129_0 = closure_0;
c4 = 1;
c5 = 2;
v3 = 1;
const obj4 = { value: mode.prefetch(closure_0), done: false };
return obj4;
}
} else if (1 === tmp7) {
c4 = 0;
v3(closure_129_0);
v3 = 3;
return { value: false, done: true };
} else if (arg0 === 1) {
v3 = 3;
throw value;
} else if (arg0 === 2) {
c4 = 0;
v3 = 3;
const obj = { value, done: true };
return obj;
} else {
c4 = 0;
v3 = 3;
return { value: true, done: true };
}
} catch (tmp16) {
closure_3 = tmp16;
if (tmp4 === c4) {
v3 = tmp2;
throw tmp16;
} else {
c5 = tmp;
}
}
}
};
closure_2 = async function _preloadQuestDockAssets(arg0, value) {
if (c3 === 2) {
c3 = 3;
throw new TypeError("Generator functions may not be called on executing generators");
} else if (tmp4 === 3) {
if (arg0 === 1) {
throw value;
} else if (arg0 === 2) {
const obj2 = { value, done: true };
return obj2;
} else {
return { value: "HermesInternal", done: null };
}
} else {
try {
c3 = 2;
if (0 === c2) {
if (arg0 === 1) {
c3 = 3;
throw value;
} else if (arg0 === 2) {
c3 = 3;
const obj3 = { value, done: true };
return obj3;
} else {
closure_1 = tmp5;
closure_0 = tmp2;
closure_128_0 = undefined;
const items = [];
if (null != closure_1) {
items.push(prefetchWithErrorReporting(tmp24));
}
if (null != c2) {
items.push(prefetchWithErrorReporting(tmp15));
}
c2 = 1;
c3 = 1;
const obj4 = { value: Promise.all(items), done: false };
return obj4;
}
} else if (arg0 === 1) {
c3 = 3;
throw value;
} else if (arg0 === 2) {
c3 = 3;
const obj = { value, done: true };
return obj;
} else {
closure_128_0 = value;
if (closure_128_0.every((item) => true === item)) {
let FAILED = tmp11.SUCCEEDED;
} else {
FAILED = tmp11.FAILED;
}
expandedHeight(FAILED);
c3 = 3;
}
} catch (tmp19) {
c3 = tmp;
throw tmp19;
}
}
};
(function preloadQuestDockAssets() {
const self = this;
const apply = closure_2.apply;
if (typeof apply === "unknown") {
HermesBuiltin.applyArguments(self);
} else {
apply(self, arguments);
}
})();
}, items1);
const items2 = [first1, identifierMetricTag];
const effect1 = noop.useEffect(() => {
if (backgroundColor === constants.FAILED) {
const obj2 = { name: MetricEvents.MetricEvents.QUEST_CONTENT_RENDERING_FAILURE, tags: null };
const items = [_require, , ];
const obj = MonitoringAgentDefault;
const _HermesInternal = HermesInternal;
items[1] = "quest_content:" + AnalyticsTypes.getQuestContentName(QuestTypes.QuestContent.QUEST_BAR_MOBILE);
items[2] = "reason:asset_loading_error";
obj2.tags = items;
obj.increment(obj2);
}
}, items2);
let tmp14 = !isEligibleForQuests;
if (isEligibleForQuests) {
tmp14 = first1 !== constants2.SUCCEEDED;
}
closure_15 = tmp14;
const items3 = [tmp14];
const effect2 = obj.useEffect(() => {
let result = QuestActionCreators.updateQuestDockVisibilityEligibility({ isEligibleToBeVisible: !closure_15 });
return () => {
const result = closure_1_0(layoutVariant[44]).updateQuestDockVisibilityEligibility({ isEligibleToBeVisible: false });
};
}, items3);
let tmp16 = null;
if (!tmp14) {
const obj6 = { pointerEvents: "box-none", style: null, onLayout: null, children: null };
const items4 = [tmp4.wrapperAnimated, animatedStyle];
obj6.style = items4;
obj6.onLayout = function onLayout(height) {
const size = { height: height.nativeEvent.layout.height, width: height.nativeEvent.layout.width };
closure_14(size);
if (!ref.current) {
tmp2.current = true;
const _Math = Math;
if (Math.random() < 0.1) {
const _Math2 = Math;
const _performance = performance;
const rounded = Math.round(performance.now() - closure_11);
const obj = { name: MetricEvents.MetricEvents.QUEST_BAR_MOBILE_TIME_TO_FIRST_PAINT, tags: null };
const items = [identifierMetricTag];
obj.tags = items;
MonitoringAgentDefault.distribution(obj, rounded);
}
}
};
obj7 = {
children() {
const obj = { children: null };
const items = [_require({ mode }), __initData3(QuestBarRenderedTriggerPointWrapper, {}), ];
const obj3 = { expandedHeight, children: null };
const obj4 = { theme, children: __initData3(QuestDockWithGestureAnimation, { backgroundColor, layoutVariant, expandedHeight, collapsedContent, expandedContent, backgroundContent }) };
obj3.children = __initData3(native.ThemeContextProvider, obj4);
items[2] = __initData3(QuestDockGestureContext.QuestDockGestureContextProvider, obj3);
obj.children = items;
return __initData4(closure_2_25, obj);
},
overrideVisibility: context.isVisibleToUser
};
obj6.children = renderImpressionTracker(obj7);
tmp16 = closure_23(tmp(4458).View, obj6);
}
return tmp16;
}
class QuestDockQuestContent {
constructor(arg0) {
quest = global.quest;
closure_1 = undefined;
tmp2 = closure_2;
tmp = quest;
obj = quest(closure_2[35]);
closure_1 = obj.useQuestBarImpressionSurvey(quest);
obj2 = quest(closure_2[14]);
questDockAppThemedBackgroundColor = obj2.useQuestDockAppThemedBackgroundColor();
obj3 = quest(closure_2[46]);
obj4 = quest(closure_2[46]);
userStatus = quest.userStatus;
enrolledAt = undefined;
questGameLogotypeAssetUrl = obj4.useQuestGameLogotypeAssetUrl(quest);
if (userStatus != null) {
enrolledAt = userStatus.enrolledAt;
}
tmp6 = null != enrolledAt;
tmp7 = jsx;
obj1 = { quest, children: null };
obj7 = {
identifierMetricTag: "quest_id:" + quest.id,
backgroundImageUrl: obj3.useQuestDockHeroAsset(quest).staticUrl,
iconUrl: questGameLogotypeAssetUrl,
trackAssetLoadingFailure(asset_id) {
AnalyticsUtilsDefault.track(AnalyticEvents.QUEST_ASSET_LOADING_FAILURE, { quest_id: quest.id, source: constants.QUESTS_BAR_MOBILE, asset_id });
},
layoutVariant: null,
theme: null,
backgroundColor: null,
expandedHeight: null,
collapsedContent: null,
expandedContent: null,
backgroundContent: null,
renderImpressionTracker: null,
renderModeChangeTracker: null
};
tmp8 = QuestDockWithEntranceAnimation;
str = "insetHeader";
if (tmp6) {
str = "flush";
}
obj7.layoutVariant = str;
DARK = undefined;
if (!tmp6) {
tmp10 = ThemeTypes;
DARK = ThemeTypes.DARK;
}
obj7.theme = DARK;
obj7.backgroundColor = questDockAppThemedBackgroundColor;
obj7.expandedHeight = closure_19;
tmp11 = closure_1;
obj7.collapsedContent = tmp7(tmp11(tmp6 ? tmp2[48] : tmp2[49]), {});
obj7.expandedContent = tmp7(tmp11(tmp6 ? tmp2[50] : tmp2[51]), {});
tmp7Result = null;
if (!tmp6) {
tmp7Result = tmp7(tmp11(tmp2[52]), {});
}
obj7.backgroundContent = tmp7Result;
obj7.renderImpressionTracker = function renderImpressionTracker(arg0) {
({ children, overrideVisibility } = arg0);
return __initData3(QuestContentImpressionTracker.BillableAdPlacementImpressionTrackerNative, { questOrQuests: quest, overrideVisibility, questContent: QuestTypes.QuestContent.QUEST_BAR_MOBILE, sourceQuestContent: QuestTypes.QuestContent.QUEST_BAR_MOBILE, onImpression, children });
};
obj7.renderModeChangeTracker = function renderModeChangeTracker(mode) {
return __initData3(QuestDockModeChangeTracker, { questId: quest.id, mode: mode.mode });
};
obj1.children = tmp7(tmp8, obj7);
return tmp7(tmp(tmp2[13]).QuestDockQuestProvider, obj1);
}
}
function QuestDockBountyContent(bounty) {
bounty = bounty.bounty;
const bountyPreviewImageUrl = bounty(15298).useBountyPreviewImageUrl(bounty);
let obj = bounty(15298);
const questDockAppThemedBackgroundColor = bounty(15298).useQuestDockAppThemedBackgroundColor();
const obj3 = { bounty, children: null };
const obj2 = bounty(15298);
obj3.children = closure_23(QuestDockWithEntranceAnimation, {
identifierMetricTag: "ad_creative_id:" + bounty.id,
backgroundImageUrl: bountyPreviewImageUrl,
iconUrl: bounty.productIcon,
trackAssetLoadingFailure(asset_id) {
const obj = AnalyticsUtilsDefault;
obj.track(AnalyticEvents.AD_ASSET_LOADING_FAILURE, { source: constants.QUESTS_BAR_MOBILE, ad_creative_id: bounty.id, ad_creative_type: AdCreativeType.AdCreativeType.BOUNTY, asset_id });
},
layoutVariant: "insetHeader",
theme: ThemeTypes.DARK,
backgroundColor: questDockAppThemedBackgroundColor,
expandedHeight: expandedHeight2,
collapsedContent: closure_23(QuestDockBountyHeaderDefault, {}),
expandedContent: closure_23(QuestDockBountyBodyDefault, {}),
backgroundContent: closure_23(QuestDockBountyBackgroundDefault, { previewImageUrl: bountyPreviewImageUrl }),
renderImpressionTracker(arg0) {
({ children, overrideVisibility } = arg0);
return __initData3(QuestContentImpressionTracker.BillableAdPlacementImpressionTrackerNative, { adContentId: bounty.id, adCreativeType: AdCreativeType.AdCreativeType.BOUNTY, overrideVisibility, questContent: QuestTypes.QuestContent.QUEST_BAR_MOBILE, sourceQuestContent: QuestTypes.QuestContent.QUEST_BAR_MOBILE, children });
},
renderModeChangeTracker(mode) {
return __initData3(QuestDockModeChangeTracker, { adCreativeType: AdCreativeType.AdCreativeType.BOUNTY, adContentId: bounty.id, mode: mode.mode });
}
});
return closure_23(bounty(15308).QuestDockBountyProvider, obj3);
}
let closure_3 = ["mode"];
get_ActivityIndicator = fn(17);
({ View: closure_8, StyleSheet, Pressable: closure_9, Image: c10 } = get_ActivityIndicator);
const QuestConstants = fn(5614);
({ QuestDockMode: closure_12, QuestsExperimentLocations: map1 } = QuestConstants);
const QuestDockConstants = fn(15301);
({ QUEST_DOCK_MODE_CHANGE_PHYSICS: closure_14, QUEST_DOCK_MODE_CHANGE_PHYSICS_CLAMPED: closure_15, QUEST_DOCK_CONTENT_BORDER_RADII: closure_16, QUEST_DOCK_UNENROLLED_HEADER_INSET_EXPANDED: closure_17, QUEST_DOCK_COLLAPSED_HEIGHT: closure_18, QUEST_DOCK_LANDSCAPE_MEDIA_EXPANDED_HEIGHT: closure_19, QUEST_DOCK_PORTRAIT_MEDIA_EXPANDED_HEIGHT: closure_20 } = QuestDockConstants);
const AnalyticEvents = fn(1074).AnalyticEvents;
const ThemeTypes = fn(1085).ThemeTypes;
const jsxProd = fn(21);
({ jsx: closure_23, jsxs: closure_24, Fragment: closure_25 } = jsxProd);
let createStyles = fn(4722);
let obj = { wrapper: { position: "absolute", left: "50%", bottom: 0, zIndex: 1 }, accessibilityWrapper: null, questDockWrapper: null, questDockContentWrapper: null, questDockHeaderBorder: null, nestedPressable: null };
let obj3 = {};
let merged = Object.assign(StyleSheet.absoluteFillObject);
obj3.zIndex = 1;
obj.accessibilityWrapper = obj3;
const rect = { position: "absolute", bottom: 0, left: "50%", overflow: "hidden", display: "flex", alignItems: "center", justifyContent: "center", borderRadius: nativeDefault.modules.mobile.QUEST_DOCK_BORDER_RADIUS, zIndex: 1 };
obj.questDockWrapper = rect;
let obj4 = {};
const merged1 = Object.assign(StyleSheet.absoluteFillObject);
obj4.justifyContent = "flex-end";
obj4.zIndex = 4;
obj.questDockContentWrapper = obj4;
let obj5 = {};
const merged2 = Object.assign(StyleSheet.absoluteFillObject);
obj5.bottom = undefined;
obj5.right = undefined;
obj5.borderWidth = 1;
obj5.borderColor = nativeDefault.colors.BORDER_MUTED;
obj5.zIndex = 5;
obj.questDockHeaderBorder = obj5;
let obj6 = {};
const merged3 = Object.assign(StyleSheet.absoluteFillObject);
obj6.zIndex = 6;
obj.nestedPressable = obj6;
let closure_26 = createStyles.createStyles(obj);
const __initData = { code: "function QuestDockTsx1(){const{restingQuestDockMode,QuestDockMode}=this.__closure;return restingQuestDockMode.get()===QuestDockMode.EXPANDED;}" };
const __initData2 = { code: "function QuestDockTsx2(){const{backgroundColor,withSpring,bottomBorderRadius,QUEST_DOCK_MODE_CHANGE_PHYSICS_CLAMPED,questDockWrapperSpecs,QUEST_DOCK_MODE_CHANGE_PHYSICS,roundToNearestPixel}=this.__closure;return{backgroundColor:backgroundColor,borderBottomRightRadius:withSpring(bottomBorderRadius.get(),QUEST_DOCK_MODE_CHANGE_PHYSICS_CLAMPED),borderBottomLeftRadius:withSpring(bottomBorderRadius.get(),QUEST_DOCK_MODE_CHANGE_PHYSICS_CLAMPED),height:questDockWrapperSpecs.get().height,width:questDockWrapperSpecs.get().width,opacity:withSpring(1,QUEST_DOCK_MODE_CHANGE_PHYSICS),transform:[{translateX:withSpring(questDockWrapperSpecs.get().x+roundToNearestPixel(questDockWrapperSpecs.get().width/2)*-1,QUEST_DOCK_MODE_CHANGE_PHYSICS)},{translateY:withSpring(questDockWrapperSpecs.get().y,QUEST_DOCK_MODE_CHANGE_PHYSICS)}]};}" };
const __initData3 = { code: "function QuestDockTsx3(){const{withSpring,interpolate,isPressed,springStandard}=this.__closure;return{transform:[{scale:withSpring(interpolate(isPressed.get(),[1,0],[1,1]),springStandard)}]};}" };
const __initData4 = { code: "function QuestDockTsx4(){const{withSpring,activeQuestDockMode,QuestDockMode,QUEST_DOCK_MODE_CHANGE_PHYSICS,windowDimensions}=this.__closure;return{opacity:withSpring(activeQuestDockMode.get()===QuestDockMode.EXPANDED?1:0,QUEST_DOCK_MODE_CHANGE_PHYSICS),height:windowDimensions.get().height};}" };
const __initData5 = { code: "function QuestDockTsx5(){const{activeQuestDockMode,QuestDockMode}=this.__closure;return{pointerEvents:activeQuestDockMode.get()===QuestDockMode.EXPANDED?'auto':'none'};}" };
const __initData6 = { code: "function QuestDockTsx6(){const{questDockWrapperSpecs,windowDimensions,safeAreaTop}=this.__closure;const specs=questDockWrapperSpecs.get();const windowHeight=windowDimensions.get().height;return windowHeight-safeAreaTop-specs.height;}" };
const __initData7 = { code: "function QuestDockTsx7(){const{withSpring,activeQuestDockMode,QuestDockMode,QUEST_DOCK_MODE_CHANGE_PHYSICS}=this.__closure;return{opacity:withSpring(activeQuestDockMode.get()===QuestDockMode.CLOSED||activeQuestDockMode.get()===QuestDockMode.SOFT_DISMISSED?0:1,QUEST_DOCK_MODE_CHANGE_PHYSICS)};}" };
const __initData8 = { code: "function QuestDockTsx8(){const{hasInsetHeaderTile,activeQuestDockMode,QuestDockMode,QUEST_DOCK_CONTENT_BORDER_RADII,questDockBorderRadius,bottomBorderRadius,withSpring,QUEST_DOCK_MODE_CHANGE_PHYSICS_CLAMPED,QUEST_DOCK_COLLAPSED_HEIGHT,questDockWrapperSpecs,QUEST_DOCK_UNENROLLED_HEADER_INSET_EXPANDED}=this.__closure;return{borderTopLeftRadius:hasInsetHeaderTile&&activeQuestDockMode.get()===QuestDockMode.EXPANDED?QUEST_DOCK_CONTENT_BORDER_RADII:questDockBorderRadius,borderTopRightRadius:hasInsetHeaderTile&&activeQuestDockMode.get()===QuestDockMode.EXPANDED?QUEST_DOCK_CONTENT_BORDER_RADII:questDockBorderRadius,borderBottomLeftRadius:hasInsetHeaderTile&&activeQuestDockMode.get()===QuestDockMode.EXPANDED?QUEST_DOCK_CONTENT_BORDER_RADII:bottomBorderRadius.get(),borderBottomRightRadius:hasInsetHeaderTile&&activeQuestDockMode.get()===QuestDockMode.EXPANDED?QUEST_DOCK_CONTENT_BORDER_RADII:bottomBorderRadius.get(),opacity:withSpring(activeQuestDockMode.get()===QuestDockMode.EXPANDED?0:1,QUEST_DOCK_MODE_CHANGE_PHYSICS_CLAMPED),height:activeQuestDockMode.get()===QuestDockMode.EXPANDED?hasInsetHeaderTile?QUEST_DOCK_COLLAPSED_HEIGHT:questDockWrapperSpecs.get().height:questDockWrapperSpecs.get().height,width:activeQuestDockMode.get()===QuestDockMode.EXPANDED&&hasInsetHeaderTile?questDockWrapperSpecs.get().width-QUEST_DOCK_UNENROLLED_HEADER_INSET_EXPANDED*2:questDockWrapperSpecs.get().width,transform:[{translateX:hasInsetHeaderTile?withSpring(activeQuestDockMode.get()===QuestDockMode.EXPANDED?QUEST_DOCK_UNENROLLED_HEADER_INSET_EXPANDED:0,QUEST_DOCK_MODE_CHANGE_PHYSICS_CLAMPED):0},{translateY:hasInsetHeaderTile?withSpring(activeQuestDockMode.get()===QuestDockMode.EXPANDED?QUEST_DOCK_UNENROLLED_HEADER_INSET_EXPANDED:0,QUEST_DOCK_MODE_CHANGE_PHYSICS_CLAMPED):0}],borderBottomWidth:bottomBorderRadius.get()>0?1:0};}" };
createStyles = fn(4722);
let closure_38 = createStyles.createStyles(() => ({ wrapperAnimated: { position: "absolute", bottom: 0, padding: 0, width: "100%" } }));
let obj7 = {};
const merged4 = Object.assign(fn(5147).SUBTLE_SPRING);
obj7.overshootClamping = true;
obj7.damping = 54;
const constants2 = { PENDING: "pending", SUCCEEDED: "succeeded", FAILED: "failed" };
const __initData9 = { code: "function QuestDockTsx9(){const{withSpring,isRendered,ENTRANCE_ANIMATION_SPING_CONFIG,componentDimensions}=this.__closure;return{opacity:withSpring(isRendered?1:0,ENTRANCE_ANIMATION_SPING_CONFIG,'animate-always'),transform:[{translateY:withSpring(isRendered?0:componentDimensions.height,ENTRANCE_ANIMATION_SPING_CONFIG)}]};}" };
let size = fn(2);
let result = size.fileFinishedImporting("modules/quests/native/QuestDock/QuestDock.tsx");
export default noop.memo(function QuestDockWithVisibilityContext() {
mobileQuestDock = mobileQuestDock(isMobileQuestDockVisibleToUser[46]).useMobileQuestDock();
let obj = mobileQuestDock(isMobileQuestDockVisibleToUser[46]);
const tmp = isMobileQuestDockVisibleToUser;
const isMobileQuestDockRenderedBase = mobileQuestDock(isMobileQuestDockVisibleToUser[46]).useIsMobileQuestDockRenderedBase(mobileQuestDock);
let obj2 = mobileQuestDock(isMobileQuestDockVisibleToUser[46]);
isMobileQuestDockVisibleToUser = mobileQuestDock(isMobileQuestDockVisibleToUser[46]).useIsMobileQuestDockVisibleToUser(mobileQuestDock, isMobileQuestDockRenderedBase);
const items = [isMobileQuestDockRenderedBase, isMobileQuestDockVisibleToUser];
const items1 = [mobileQuestDock];
const memo = noop.useMemo(() => ({ isRendered: isMobileQuestDockRenderedBase, isVisibleToUser: isMobileQuestDockVisibleToUser }), items);
const memo1 = noop.useMemo(() => {
const type = mobileQuestDock.type;
if (AdCreativeType.AdCreativeType.BOUNTY === type) {
const obj2 = { bounty: tmp.bounty };
return __initData3(QuestDockBountyContent, obj2);
} else if (tmp2(5621).AdCreativeType.QUEST === type) {
const obj = { quest: tmp.quest };
return __initData3(QuestDockQuestContent, obj);
} else if (tmp2(5621).AdCreativeType.NO_FILL === type) {
return null;
}
}, items1);
let tmp7 = null;
if (mobileQuestDock.type !== mobileQuestDock(isMobileQuestDockVisibleToUser[54]).AdCreativeType.NO_FILL) {
const obj4 = { value: memo, children: memo1 };
tmp7 = closure_23(isMobileQuestDockRenderedBase(tmp[41]).Provider, obj4);
}
return tmp7;
});
export { QuestDockQuestContent };