Files
2026-07-28 01:06:53 +03:00

223 lines
15 KiB
TypeScript

/* Metro module 13664; source: modules/quests/native/QuestDock/QuestDockUnenrolledBackground.tsx; dependencies: [57, 31, 27, 4502, 6528, 13572, 661, 33, 4501, 13650, 13568, 13573, 13576, 8621, 566, 3860, 697, 674, 4017, 4577, 477, 9480, 8141, 9543, 5475, 4589, 2] */
import Module00057 from '../../../../by-id/module-00057.js'; /* Metro dependency 57 */
import Native from '../../../../external/discord_common/js/packages/tokens/native.tsx'; /* Metro dependency 697 */
import AccessibilityStore from '../../../a11y/AccessibilityStore.tsx'; /* Metro dependency 4502 */
import defaultImport5 from '../../../../by-id/module-04589-LinearGradient.js'; /* Metro dependency 4589 */
import ReanimatedNativeView from '../../../core/native/ReanimatedNativeView.tsx'; /* Metro dependency 8141 */
import UseStateFromSharedValue from '../../../reanimated/native/useStateFromSharedValue.tsx'; /* Metro dependency 8621 */
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 ConstantsModule from '../../../../Constants.tsx'; /* Metro dependency 661 */
import * as UseTokenModule from '../../../../design/tokens/native/useToken.tsx'; /* Metro dependency 3860 */
import * as ReanimatedRexportModule from '../../../reanimated/ReanimatedRexport.tsx'; /* Metro dependency 4017 */
import * as CreateStylesModule from '../../../../design/components/Styles/native/createStyles.tsx'; /* Metro dependency 4501 */
import * as SpringModule from '../../../../design/animation/reanimated/spring/spring.tsx'; /* Metro dependency 4577 */
import * as QuestConstantsModule from '../../QuestConstants.tsx'; /* Metro dependency 6528 */
import * as QuestHooksNativeModule from '../QuestHooks.native.tsx'; /* Metro dependency 13568 */
import * as QuestDockConstantsModule from './QuestDockConstants.tsx'; /* Metro dependency 13572 */
import * as QuestDockGestureContextModule from './QuestDockGestureContext.tsx'; /* Metro dependency 13573 */
import * as QuestDockExternalCoordinationContextModule from './QuestDockExternalCoordinationContext.tsx'; /* Metro dependency 13576 */
function _fun104349(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#104349, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13861:6, offset: 0x0229337b, size: 502 bytes, params: 8, frame: 25
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
let value = ReactModule;
const StyleSheet = ReactNativeModule.StyleSheet;
const QUEST_DOCK_EXPANDED_HEIGHT = QuestDockConstantsModule.QUEST_DOCK_EXPANDED_HEIGHT;
const createStyles = CreateStylesModule.createStyles;
object = {};
const object2 = {};
copyDataProperties(object2, StyleSheet.absoluteFillObject, undefined);
object2['right'] = undefined;
object2['bottom'] = undefined;
object2['height'] = QUEST_DOCK_EXPANDED_HEIGHT;
object2['zIndex'] = 1;
object.backgroundWrapper = object2;
const object3 = {};
copyDataProperties(object3, StyleSheet.absoluteFillObject, undefined);
object3['height'] = QUEST_DOCK_EXPANDED_HEIGHT;
object3['resizeMode'] = 'cover';
object.backgroundHeroAsset = object3;
const object4 = {};
copyDataProperties(object4, StyleSheet.absoluteFillObject, undefined);
object.backgroundHeroAssetVideo = object4;
const object5 = {};
copyDataProperties(object5, StyleSheet.absoluteFillObject, undefined);
object5['height'] = QUEST_DOCK_EXPANDED_HEIGHT;
object.backgroundGradient = object5;
const env0_13 = Reflect.apply(createStyles, CreateStylesModule, [object]);
object = {code: 'function QuestDockUnenrolledBackgroundTsx1(){const{withSpring,activeQuestDockMode,QuestDockMode,QUEST_DOCK_UNENROLLED_HEADER_INSET_EXPANDED,QUEST_DOCK_MODE_CHANGE_PHYSICS_CLAMPED,windowDimensions}=this.__closure;return{transform:[{translateX:withSpring(activeQuestDockMode.get()===QuestDockMode.COLLAPSED?QUEST_DOCK_UNENROLLED_HEADER_INSET_EXPANDED*-1:0,QUEST_DOCK_MODE_CHANGE_PHYSICS_CLAMPED)},{translateY:withSpring(activeQuestDockMode.get()===QuestDockMode.COLLAPSED?QUEST_DOCK_UNENROLLED_HEADER_INSET_EXPANDED*-1:0,QUEST_DOCK_MODE_CHANGE_PHYSICS_CLAMPED)}],width:windowDimensions.get().width};}'};
object = {code: 'function QuestDockUnenrolledBackgroundTsx2(){const{withSpring,activeQuestDockMode,QuestDockMode,videoLoaded,QUEST_DOCK_MODE_CHANGE_PHYSICS_CLAMPED}=this.__closure;return{opacity:withSpring(activeQuestDockMode.get()!==QuestDockMode.EXPANDED||!videoLoaded?1:0,QUEST_DOCK_MODE_CHANGE_PHYSICS_CLAMPED)};}'};
value = value.memo(QuestDockUnenrolledBackground);
(FileImportTrackerModule).fileFinishedImporting('modules/quests/native/QuestDock/QuestDockUnenrolledBackground.tsx');
exports.default = value;
function QuestDockUnenrolledBackground() { // fn#104350, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13861:1604, offset: 0x02293571, size: 1273 bytes, params: 1, frame: 35
var moduleValue5;
let binding = env0_4;
let useContext = binding.useContext;
const quest = Reflect.apply(useContext, binding,
[importDefault(13650) /* metro dependency 13650: QuestDockContext */]).quest;
const styles = useStyles();
const {staticUrl,
videoAsset} = (QuestHooksNativeModule).useQuestDockHeroAsset(quest);
useContext = binding.useContext;
const QuestDockGestureContext = (QuestDockGestureContextModule).QuestDockGestureContext;
const {activeQuestDockMode, windowDimensions} = Reflect.apply(useContext, binding, [QuestDockGestureContext]);
useContext = binding.useContext;
const QuestDockExternalCoordinationContext = (QuestDockExternalCoordinationContextModule).QuestDockExternalCoordinationContext;
const setRestingQuestDockMode = Reflect.apply(useContext, binding,
[QuestDockExternalCoordinationContext]).setRestingQuestDockMode;
const value4 = (UseStateFromSharedValue)(activeQuestDockMode);
const useReducedMotion = (require(566) /* metro dependency 566: flux */).useStateFromStores([AccessibilityStore],
function() {
return AccessibilityStore.useReducedMotion;
});
const useToken = UseTokenModule.useToken;
const CARD_BACKGROUND_DEFAULT = (Native).colors.CARD_BACKGROUND_DEFAULT;
const value5 = Reflect.apply(useToken, UseTokenModule, [CARD_BACKGROUND_DEFAULT]);
const env0_3 = value5;
const value6 = binding.useMemo(_fun104352, [value5]);
let closure = function() {
return [0, 0.33, 0.76, 1];
};
const value7 = binding.useMemo(closure, []);
let useAnimatedStyle = ReanimatedRexportModule.useAnimatedStyle;
closure = QuestDockUnenrolledBackgroundS;
closure.__closure = {withSpring: (require(4577) /* metro dependency 4577: spring */).withSpring,
activeQuestDockMode: activeQuestDockMode, QuestDockMode: QuestDockMode,
QUEST_DOCK_UNENROLLED_HEADER_INSET_EXPANDED: QUEST_DOCK_UNENROLLED_HEADER_INSET_EXPANDED,
QUEST_DOCK_MODE_CHANGE_PHYSICS_CLAMPED: QUEST_DOCK_MODE_CHANGE_PHYSICS_CLAMPED,
windowDimensions: windowDimensions};
closure.__workletHash = 3565242281634;
closure.__initData = env0_14;
const value8 = Reflect.apply(useAnimatedStyle, ReanimatedRexportModule, [closure]);
const useState = binding.useState;
const value10 = env0_3(Reflect.apply(useState, binding, [AppState.currentState !== 'active']), 2);
var property = value10[0];
var env0_4 = value10[1];
binding.useEffect(function() {
var env0_0 = AppState.addEventListener('change', _fun104356);
return _fun104357;
}, [activeQuestDockMode, setRestingQuestDockMode]);
useContext = binding.useContext;
let r4 = !property && Reflect.apply(useContext, binding,
[importDefault(13650) /* metro dependency 13650: QuestDockContext */]).isRendered && !useReducedMotion && videoAsset != null;
if (r4) {
moduleValue5 = require(477) /* metro dependency 477: PlatformUtils */;
r4 = !moduleValue5.isAndroid();
}
r4 = r4 && (require(9480) /* metro dependency 9480: QuestUtilsNative */).isHeroVideoSupported(videoAsset);
binding = env0_4;
var [property, env0_6] = env0_3(binding.useState(false), 2);
const value17 = binding.useCallback(_fun104358, []);
useAnimatedStyle = ReanimatedRexportModule.useAnimatedStyle;
closure = QuestDockUnenrolledBackgroundG;
closure.__closure = {withSpring: (require(4577) /* metro dependency 4577: spring */).withSpring,
activeQuestDockMode: activeQuestDockMode, QuestDockMode: QuestDockMode, videoLoaded: property,
QUEST_DOCK_MODE_CHANGE_PHYSICS_CLAMPED: QUEST_DOCK_MODE_CHANGE_PHYSICS_CLAMPED};
closure.__workletHash = 13084905891385;
closure.__initData = env0_15;
const value18 = Reflect.apply(useAnimatedStyle, ReanimatedRexportModule, [closure]);
const items2 = [styles.backgroundWrapper, value8];
const r5 = (
r4
? (
<env0_4.Fragment>
{((VideoComponent) => <VideoComponent style={styles.backgroundHeroAssetVideo} onLoad={value17} source={{uri: videoAsset.url}} paused={value4 !== QuestDockMode.EXPANDED} resizeMode="cover" muted disableFocus preventsDisplaySleepDuringVideoPlayback={false} />)((require(9543) /* metro dependency 9543: Video */).VideoComponent)}
<ReanimatedNativeView style={value18}>
{((Component) => <Component style={styles.backgroundHeroAsset} source={{uri: staticUrl}} />)(importDefault(5475) /* metro dependency 5475: FastImage */)}
</ReanimatedNativeView>
</env0_4.Fragment>
)
: ((Component) => <Component style={styles.backgroundHeroAsset} source={{uri: staticUrl}} />)(importDefault(5475) /* metro dependency 5475: FastImage */)
);
const {START, END} = VerticalGradient;
return (
<ReanimatedNativeView style={items2}>
{r5}
{((Component) => <Component locations={value7} style={styles.backgroundGradient} start={START} end={END} colors={value6} />)(defaultImport5)}
</ReanimatedNativeView>
);
function _fun104352() { // fn#104352, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13861:2080, offset: 0x02293a6a, size: 168 bytes, params: 1, frame: 12
let value = environment.__proto__;
value = importDefault(674) /* metro dependency 674 */;
value = value(env0_3);
const value3 = value.alpha(0);
const items2 = [value3.hex()];
const value5 = value.alpha(0.1);
items2[1] = value5.hex();
const value6 = value.alpha(0.8);
items2[2] = value6.hex();
value = value.alpha(1);
items2[3] = value.hex();
return items2;
}
function QuestDockUnenrolledBackgroundS() { // fn#104354, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13861:2256, owner: QuestDockUnenrolledBackground.s, offset: 0x02293b1e, size: 217 bytes, params: 1, frame: 21
let withSpring = SpringModule.withSpring;
const activeQuestDockModeBinding = activeQuestDockMode;
let get = activeQuestDockModeBinding.get;
const value3 = Reflect.apply(get, activeQuestDockModeBinding, []);
let COLLAPSED = QuestDockMode.COLLAPSED;
const value4 = 0;
const items2 = [{translateX: Reflect.apply(withSpring, SpringModule,
[value3 !== COLLAPSED ? value4 : -1 * QUEST_DOCK_UNENROLLED_HEADER_INSET_EXPANDED,
QUEST_DOCK_MODE_CHANGE_PHYSICS_CLAMPED])}];
withSpring = SpringModule.withSpring;
const value6 = activeQuestDockMode.get();
COLLAPSED = QuestDockMode.COLLAPSED;
items2[1] = {translateY: Reflect.apply(withSpring, SpringModule,
[value6 !== COLLAPSED ? value4 : -1 * QUEST_DOCK_UNENROLLED_HEADER_INSET_EXPANDED,
QUEST_DOCK_MODE_CHANGE_PHYSICS_CLAMPED])};
const windowDimensionsBinding = windowDimensions;
get = windowDimensionsBinding.get;
return {transform: items2, width: Reflect.apply(get, windowDimensionsBinding, []).width};
}
function _fun104355() { // fn#104355, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13861:2739, offset: 0x02293bf7, size: 45 bytes, params: 1, frame: 14
const env0_0 = AppState.addEventListener('change', _fun104356);
return _fun104357;
function _fun104356(a0) { // fn#104356, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13861:2779, offset: 0x02293c24, size: 118 bytes, params: 2, frame: 15
let value = a0 !== 'active';
env1_4(value);
let r3 = (require(477) /* metro dependency 477: PlatformUtils */).isIOS() && value;
if (r3) {
value = activeQuestDockMode.get();
value = value === QuestDockMode.EXPANDED;
r3 = value;
}
if (r3) {
setRestingQuestDockMode(QuestDockMode.COLLAPSED);
}
}
function _fun104357() { // fn#104357, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13861:2874, offset: 0x00cd0cb3, size: 21 bytes, params: 1, frame: 9
env0_0.remove();
}
}
function _fun104358() { // fn#104358, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13861:3076, offset: 0x0218c4cf, size: 18 bytes, params: 1, frame: 11
env0_6(true);
}
function QuestDockUnenrolledBackgroundG() { // fn#104359, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13861:3125, owner: QuestDockUnenrolledBackground.G, offset: 0x02293c9a, size: 96 bytes, params: 1, frame: 18
const withSpring = SpringModule.withSpring;
const value3 = activeQuestDockMode.get();
const EXPANDED = QuestDockMode.EXPANDED;
const value4 = 1;
return {opacity: Reflect.apply(withSpring, SpringModule, [value3 !== EXPANDED ? value4 : ReactNativeModule.AppState ? 0 : value4,
QUEST_DOCK_MODE_CHANGE_PHYSICS_CLAMPED])};
}
}
}
global.__d(_fun104349, 13664, [57, 31, 27, 4502, 6528, 13572, 661, 33, 4501, 13650, 13568, 13573, 13576, 8621, 566,
3860, 697, 674, 4017, 4577, 477, 9480, 8141, 9543, 5475, 4589,
2]) /* metro module 13664, dependencies: [57, 31, 27, 4502, 6528, 13572, 661, 33, 4501, 13650, 13568, 13573, 13576, 8621, 566, 3860, 697, 674, 4017, 4577, 477, 9480, 8141, 9543, 5475, 4589, 2] */;