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

848 lines
49 KiB
TypeScript

/* Metro module 13523; source: modules/quests/native/AdVideoPlayer.tsx; dependencies: [57, 31, 27, 7030, 661, 33, 697, 8011, 4501, 674, 4017, 4577, 4581, 4504, 4507, 1239, 566, 477, 1216, 1585, 1244, 5278, 13524, 13526, 13528, 13529, 10234, 9376, 9554, 13530, 13531, 2] */
import Module00057 from '../../../by-id/module-00057.js'; /* Metro dependency 57 */
import Module00674 from '../../../by-id/module-00674.js'; /* Metro dependency 674 */
import UseSafeAreaInsetsNative from '../../safe_area/useSafeAreaInsets.native.tsx'; /* Metro dependency 1585 */
import AppStateStore from '../../../stores/native/AppStateStore.tsx'; /* Metro dependency 7030 */
import Module08011 from '../../../by-id/module-08011.jsx'; /* Metro dependency 8011 */
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 ComponentDispatchUtilsModule from '../../../utils/ComponentDispatchUtils.tsx'; /* Metro dependency 1239 */
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 SpringPresetsModule from '../../../design/animation/reanimated/spring/springPresets.tsx'; /* Metro dependency 4581 */
import * as PressablesModule from '../../../design/void/Pressables/native/Pressables.tsx'; /* Metro dependency 5278 */
import * as VideoQuestPlayerControlButtonModule from './VideoQuestModal/VideoQuestPlayerControlButton.tsx'; /* Metro dependency 13528 */
function _fun102796(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#102796, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13713:6, offset: 0x02248c8c, size: 1300 bytes, params: 8, frame: 30
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
let value = ReactModule;
const StyleSheet = ReactNativeModule.StyleSheet;
object = {};
let PX_16 = (importDefault(697) /* metro dependency 697: native */).space.PX_16;
object.left = PX_16;
PX_16 = (importDefault(697) /* metro dependency 697: native */).space.PX_16;
object.right = PX_16;
PX_16 = (importDefault(697) /* metro dependency 697: native */).space.PX_16;
object.top = PX_16;
PX_16 = (importDefault(697) /* metro dependency 697: native */).space.PX_16;
object.bottom = PX_16;
const env0_14 = value.memo(Module08011);
object = {code: 'function hasVideoEnded_AdVideoPlayerTsx1(currentTime,videoDuration){return currentTime>=videoDuration-1;}'};
const value5 = _fun102798();
const y_1028002 = y_102800;
y_1028002.__closure = {hasVideoEnded: value5};
y_1028002.__workletHash = 16693292055973;
y_1028002.__initData = {code: 'function AdVideoPlayerTsx2(currentTime,maxTimestamp,videoDuration,allowUnrestrictedSeeking){const{hasVideoEnded}=this.__closure;return!hasVideoEnded(currentTime,videoDuration)&&(allowUnrestrictedSeeking||currentTime<=maxTimestamp-1);}'};
const createStyles = CreateStylesModule.createStyles;
object = {};
const object3 = {};
copyDataProperties(object3, StyleSheet.absoluteFillObject, undefined);
object.container = object3;
const object4 = {};
copyDataProperties(object4, StyleSheet.absoluteFillObject, undefined);
const BACKGROUND_BASE_LOWEST = (importDefault(697) /* metro dependency 697: native */).colors.BACKGROUND_BASE_LOWEST;
object4['backgroundColor'] = BACKGROUND_BASE_LOWEST;
object4['justifyContent'] = 'center';
object4['alignItems'] = 'center';
object.loadingContainer = object4;
object.bufferingSpinner = {position: 'absolute'};
const object6 = {};
copyDataProperties(object6, StyleSheet.absoluteFillObject, undefined);
object6['justifyContent'] = 'center';
object6['alignItems'] = 'center';
object.bufferingSpinnerCentered = object6;
object.video = {'height': '100%', 'width': '100%'};
object.videoContainer = {'position': 'relative', 'height': '100%', 'width': '100%'};
const object7 = {};
copyDataProperties(object7, StyleSheet.absoluteFillObject, undefined);
const BLACK = (importDefault(697) /* metro dependency 697: native */).unsafe_rawColors.BLACK;
const value9 = Module00674(BLACK).alpha(0.5);
object7['backgroundColor'] = value9.hex();
object7['justifyContent'] = 'center';
object7['alignItems'] = 'center';
object7['flexDirection'] = 'column';
object.controls = object7;
let PX_8 = (importDefault(697) /* metro dependency 697: native */).space.PX_8;
object.controlsTopBottom = {'flexDirection': 'row', 'justifyContent': 'flex-end', 'padding': null,
'position': 'absolute', 'left': 0, 'right': 0, padding: PX_8};
const PX_24 = (importDefault(697) /* metro dependency 697: native */).space.PX_24;
object.controlsMiddle = {'justifyContent': 'center', 'alignItems': 'center', 'flexGrow': 1, 'flexDirection': 'row',
'gap': null, 'pointerEvents': 'box-none', gap: PX_24};
object.controlsTop = {top: 0};
object.controlsBottom = {bottom: 0};
PX_16 = (importDefault(697) /* metro dependency 697: native */).space.PX_16;
object.progressContainer = {'position': 'absolute', 'bottom': 0, 'right': 0, 'left': 0,
'justifyContent': 'flex-end', 'height': null, 'overflow': 'hidden', height: PX_16};
const object12 = {'height': 1, 'backgroundColor': null, 'shadowOffset': null, 'shadowRadius': 6, 'shadowOpacity': 1,
'elevation': 5};
let WHITE = (importDefault(697) /* metro dependency 697: native */).colors.WHITE;
object12.backgroundColor = WHITE;
object12.shadowOffset = {'width': 0, 'height': 0};
WHITE = (importDefault(697) /* metro dependency 697: native */).colors.WHITE;
object12.shadowColor = WHITE;
object.progress = object12;
const TEXT_DEFAULT = (importDefault(697) /* metro dependency 697: native */).colors.TEXT_DEFAULT;
object.icon = {color: TEXT_DEFAULT};
const TEXT_SUBTLE = (importDefault(697) /* metro dependency 697: native */).colors.TEXT_SUBTLE;
object.iconDisabled = {color: TEXT_SUBTLE};
PX_8 = (importDefault(697) /* metro dependency 697: native */).space.PX_8;
object.controlButton = {padding: PX_8};
const env0_18 = Reflect.apply(createStyles, CreateStylesModule, [object]);
const env0_21 = {code: 'function AdVideoPlayerTsx3(){const{hasLoaded,hideControls,showControls,playerState,PlayerState,isVideoEnded}=this.__closure;return hasLoaded&&!hideControls&&(showControls.get()||playerState===PlayerState.PAUSED||playerState===PlayerState.ENDED||playerState===PlayerState.ERRORED||isVideoEnded);}'};
const env0_22 = {code: "function AdVideoPlayerTsx4(){const{shouldShowControls,withSpring,SUBTLE_SPRING}=this.__closure;const show=shouldShowControls();return{opacity:withSpring(show?1:0,SUBTLE_SPRING),pointerEvents:show?'auto':'none'};}"};
const env0_23 = {code: 'function AdVideoPlayerTsx5(){const{withTiming,progressSharedValue,timingFast}=this.__closure;return{width:withTiming(progressSharedValue.get()*100+"%",timingFast,\'animate-always\')};}'};
value = value.memo(_fun102801);
(FileImportTrackerModule).fileFinishedImporting('modules/quests/native/AdVideoPlayer.tsx');
exports.PlayerState = {PAUSED: 'paused', PLAYING: 'playing', ENDED: 'ended', LOADING: 'loading', ERRORED: 'errored'};
exports.PlaybackTriggerSource = {USER_INTERACTION: 'USER_INTERACTION', SYSTEM_INITIATED: 'SYSTEM_INITIATED',
IMPERATIVE_API: 'IMPERATIVE_API'};
exports.AdVideoPlayer = value;
function getSafeAreaInsetOrPadding(a0, a1) { // fn#102797, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13713:374, offset: 0x022491a0, size: 42 bytes, params: 3, frame: 14
const Math = global.Math;
return Math.max(a0[a1], env0_13[a1]);
}
function _fun102798() { // fn#102798, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13713:584, offset: 0x022491ca, size: 48 bytes, params: 1, frame: 2
const closure = function(a0, a1) {
return a0 >= a1 - 1;
};
closure.__closure = {};
closure.__workletHash = 8992945176371;
closure.__initData = env0_15;
return closure;
}
function y_102800(a0, a1, a2, a3) { // fn#102800, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13713:1014, offset: 0x0224920d, size: 52 bytes, params: 5, frame: 14
return !env0_16(a0, a2) && (a3 || a0 <= a1 - 1);
}
function _fun102801({source, initialProgress, contentDuration, allowUnrestrictedSeeking, disableResumeOnLoad, style, isFullscreen, externallyPaused, contentInsets, captionsEnabled, onToggleCaptions, onOpenTranscript, onToggleFullscreen, renderCaptions, onLoadStart, onLoad, onReadyForDisplay, onProgress, onSeek, onBuffer, onError, onEnd, onPlayerStateChange, onPausePlayback, onResumePlayback, onVideoTracks, onVideoLayout, videoRef, bufferingSpinnerPlacement, showCaptionsButton, showTranscriptButton, showFullscreenButton, showProgress, showSkipButtons, hideControls, httpEngine, automaticallyWaitsToMinimizeStalling, repeat, ref}) { // fn#102801, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13713:3495, offset: 0x02249241, size: 4363 bytes, params: 2, frame: 74
var r25;
var r24;
var getSafeAreaInsetOrPaddingBinding;
const PressableOpacity = (PressablesModule).PressableOpacity;
var items7;
const VideoQuestPlayerControlButton = (VideoQuestPlayerControlButtonModule).VideoQuestPlayerControlButton;
contentDuration = contentDuration === undefined ? 0 : contentDuration;
allowUnrestrictedSeeking = !(allowUnrestrictedSeeking === undefined) && allowUnrestrictedSeeking;
disableResumeOnLoad = !(disableResumeOnLoad === undefined) && disableResumeOnLoad;
captionsEnabled = !(captionsEnabled === undefined) && captionsEnabled;
const onLoadStart2 = onLoadStart;
const onLoad2 = onLoad;
bufferingSpinnerPlacement = bufferingSpinnerPlacement === undefined ? 'top-left' : bufferingSpinnerPlacement;
showCaptionsButton = !(showCaptionsButton === undefined) && showCaptionsButton;
showTranscriptButton = !(showTranscriptButton === undefined) && showTranscriptButton;
showFullscreenButton = !(showFullscreenButton === undefined) && showFullscreenButton;
showProgress = !(showProgress === undefined) && showProgress;
showSkipButtons = showSkipButtons === undefined || showSkipButtons;
hideControls = !(hideControls === undefined) && hideControls;
repeat = !(repeat === undefined) && repeat;
const repeat2 = repeat;
const styles = useStyles();
let binding = onLoad2;
const r58 = videoRef ?? binding.useRef(null);
binding = onLoad2;
let useState = binding.useState;
const value16 = Reflect.apply(useState, binding, [contentDuration]);
const binding2 = onLoadStart2;
const value17 = binding2(value16, 2);
const property = value17[0];
const property6 = property;
const env0_17 = value17[1];
useState = binding.useState;
let object = {};
copyDataProperties(object, initialProgress, undefined);
const value19 = binding2(Reflect.apply(useState, binding, [object]), 2);
const property2 = value19[0];
const env0_19 = value19[1];
useState = binding.useState;
const LOADING = env0_19.LOADING;
const value20 = binding2(Reflect.apply(useState, binding, [LOADING]), 2);
const property3 = value20[0];
const env0_21 = value20[1];
useState = binding.useState;
const value21 = binding2(Reflect.apply(useState, binding, [false]), 2);
const property4 = value21[0];
const property42 = property4;
const env0_23 = value21[1];
const env0_24 = binding.useRef(null);
const env0_25 = binding.useRef(0);
let useCallback = binding.useCallback;
const value22 = Reflect.apply(useCallback, binding, [_fun102802, [onPlayerStateChange]]);
const r34 = property4 && property3 === env0_19.ENDED && property6(property2.timestampSec, property2.duration);
const value25 = (ReanimatedRexportModule).useSharedValue(false);
let closure = shouldShowControls;
binding = env0_19;
closure.__closure = {hasLoaded: property4, hideControls: hideControls, showControls: value25,
playerState: property3, PlayerState: binding, isVideoEnded: r34};
closure.__workletHash = 6484184524579;
closure.__initData = env0_21;
let useAnimatedStyle = ReanimatedRexportModule.useAnimatedStyle;
const he_1028042 = he_102804;
object = {shouldShowControls: closure};
object.withSpring = (require(4577) /* metro dependency 4577: spring */).withSpring;
const SUBTLE_SPRING = (SpringPresetsModule).SUBTLE_SPRING;
object.SUBTLE_SPRING = SUBTLE_SPRING;
he_1028042.__closure = object;
he_1028042.__workletHash = 311315682972;
he_1028042.__initData = property42;
const value26 = Reflect.apply(useAnimatedStyle, ReanimatedRexportModule, [he_1028042]);
const value27 = closure();
const value28 = ReanimatedRexportModule.useSharedValue(0);
useAnimatedStyle = ReanimatedRexportModule.useAnimatedStyle;
closure = pe_102805;
closure.__closure = {withTiming: (require(4504) /* metro dependency 4504: timing */).withTiming,
progressSharedValue: value28, timingFast: (require(4507) /* metro dependency 4507: timingPresets */).timingFast};
closure.__workletHash = 11793601648786;
closure.__initData = env0_23;
const value29 = Reflect.apply(useAnimatedStyle, ReanimatedRexportModule, [closure]);
const binding3 = onLoad2;
const env0_31 = binding3.useRef(-1);
const value30 = binding3.useCallback(function(a0) {
var env0_0 = a0;
return _fun102807;
}, [value25]);
const value31 = binding3.useCallback(_fun102809, []);
const [property5, env0_33] = onLoadStart2(binding3.useState(false), 2);
const value34 = binding3.useCallback(_fun102811, [onReadyForDisplay]);
const value35 = binding3.useCallback(_fun102812, [allowUnrestrictedSeeking, property2.duration,
property2.maxTimestampSec, r58]);
binding3.useImperativeHandle(ref, function() {
return {seekToStart: _fun102814, play: _fun102815, pause: _fun102816};
}, [value35, property3, value22, onResumePlayback, onPausePlayback]);
useCallback = binding3.useCallback;
object = [r58];
object[1] = initialProgress.timestampSec;
object[2] = disableResumeOnLoad;
object[3] = value22;
object[4] = onLoad;
object[5] = value35;
const value36 = Reflect.apply(useCallback, binding3, [_fun102817, object]);
const value37 = binding3.useCallback(_fun102818, [property3, onPausePlayback, onResumePlayback, r34, value22,
value35]);
const value38 = binding3.useCallback(_fun102819, [value37]);
const env0_36 = binding3.useRef(false);
binding3.useEffect(_fun102822, [binding3.useCallback(_fun102820, [property3, value22, onPausePlayback]),
binding3.useCallback(_fun102821, [property3, value22, onResumePlayback])]);
const value41 = binding3.useCallback(_fun102824, [value25, value37]);
const value42 = binding3.useCallback(_fun102825, [property, value28, onSeek, value31, r58]);
let ERRORED = binding.ERRORED;
const r33 = property3 === ERRORED || !y_102800(property2.timestampSec, property2.maxTimestampSec,
property2.duration, allowUnrestrictedSeeking);
binding = onLoad2;
const value45 = binding.useCallback(_fun102826, [value35, property, value28, r33]);
useCallback = binding.useCallback;
const value46 = value30(Reflect.apply(useCallback, binding, [_fun102827, [value35, property, value28, property3,
value22]]));
const value47 = value30(value45);
const value48 = binding.useCallback(_fun102828, [value28, value31, onProgress]);
const value49 = binding.useCallback(_fun102829, [value22, onEnd, repeat]);
const value50 = binding.useCallback(_fun102830, [value22, onLoadStart]);
const value51 = binding.useCallback(_fun102831, [value22, onError]);
const state = (require(566) /* metro dependency 566: flux */).useStateFromStores([AppStateStore], function() {
return AppStateStore.getState();
});
const ACTIVE = AppStates.ACTIVE;
const value52 = state === ACTIVE;
binding.useLayoutEffect(_fun102833, [r58]);
let r32 = value52 ? property3 === env0_19.PAUSED : !value52;
r32 = !r32 ? property3 === env0_19.LOADING : r32;
r32 = !r32 ? externallyPaused : r32;
const {isBuffering, toggleBuffering} = useBufferingState({onBuffer: onBuffer});
binding = onLoad2;
const value57 = binding.useCallback(_fun102837, [toggleBuffering, property3]);
const value58 = binding.useCallback(_fun102838, [toggleBuffering]);
const value59 = binding.useCallback(_fun102839, [toggleBuffering]);
const value60 = (UseSafeAreaInsetsNative)();
let r22 = isFullscreen && value60 != null;
if (r22) {
object = {};
getSafeAreaInsetOrPaddingBinding = getSafeAreaInsetOrPadding;
object.paddingRight = getSafeAreaInsetOrPaddingBinding(value60, 'right');
object.paddingLeft = getSafeAreaInsetOrPaddingBinding(value60, 'left');
r22 = object;
}
const items2 = [styles.container, style];
const pressableBindingProps = {style: [styles.videoContainer], onPress: value41, accessible: !value27};
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
let string = intl.string;
const t = (require(1244) /* metro dependency 1244: indexNative */).t;
pressableBindingProps.accessibilityLabel = Reflect.apply(string, intl, [r32 ? t.R3aFPe : t.fTMEUi]);
ERRORED = env0_19.ERRORED;
const items3 = [
property3 !== ERRORED && ((Component) => <Component mixWithOthers="inherit" httpEngine={httpEngine} automaticallyWaitsToMinimizeStalling={automaticallyWaitsToMinimizeStalling} ref={r58} accessible={false} importantForAccessibility="no-hide-descendants" accessibilityRole="none" style={styles.video} paused={r32} repeat={repeat} source={source} onBuffer={value57} onPlaybackStalled={value58} onPlaybackResume={value59} onLoad={value36} onSeek={value42} onProgress={value48} onLoadStart={value50} onEnd={value49} onError={value51} onReadyForDisplay={value34} onVideoTracks={onVideoTracks} onLayout={onVideoLayout} resizeMode="contain" />)(repeat2),
];
items3[1] = renderCaptions?.(property2.timestampSec);
items3[2] = isBuffering && <ActivityIndicator animating style={[styles.bufferingSpinner,
isFullscreen || bufferingSpinnerPlacement === 'center' ? styles.bufferingSpinnerCentered : {top: contentInsets?.top ?? 0,
left: contentInsets?.left ?? 0}]} color={(importDefault(697) /* metro dependency 697: native */).unsafe_rawColors.WHITE} />;
items3[3] = !property5 && <View style={styles.loadingContainer}><ActivityIndicator animating /></View>;
const View2 = (importDefault(4017) /* metro dependency 4017: ReanimatedRexport */).View;
const items5 = [styles.controls, value26];
let r18 = showCaptionsButton || showTranscriptButton;
if (r18) {
var viewProps = {style: [styles.controlsTopBottom, styles.controlsTop, r22]};
items7 = [
showCaptionsButton && <PressableOpacity accessibilityRole="button" accessibilityLabel={intl.string((require(1244) /* metro dependency 1244: indexNative */).t.bDSZO1)} onPress={onToggleCaptions} style={styles.controlButton}>{((ClosedCaptionsOutlineIcon) => <ClosedCaptionsOutlineIcon color={captionsEnabled ? styles.icon.color : styles.iconDisabled.color} />)((require(13524) /* metro dependency 13524: ClosedCaptionsOutlineIcon */).ClosedCaptionsOutlineIcon)}</PressableOpacity>,
];
items7[1] = showTranscriptButton && <PressableOpacity accessibilityRole="button" accessibilityLabel={intl.string((require(1244) /* metro dependency 1244: indexNative */).t.KCzjTi)} onPress={onOpenTranscript} style={styles.controlButton}>{((TranscriptOutlineIcon) => <TranscriptOutlineIcon color={styles.iconDisabled.color} />)((require(13526) /* metro dependency 13526: TranscriptOutlineIcon */).TranscriptOutlineIcon)}</PressableOpacity>;
r18 = (
<View {...viewProps}>
{items7}
</View>
);
}
const items8 = [r18];
if (showSkipButtons) {
r25 = (
<VideoQuestPlayerControlButton
disabled={property3 === env0_19.ERRORED}
accessibilityRole="button"
accessibilityLabel={intl.string((require(1244) /* metro dependency 1244: indexNative */).t.r9s3Uv)}
onPress={value46}
>
{((SkipBackwardIcon) => <SkipBackwardIcon color={styles.icon.color} width={16} height={16} />)((require(13529) /* metro dependency 13529: SkipBackwardIcon */).SkipBackwardIcon)}
</VideoQuestPlayerControlButton>
);
} else {
r25 = showSkipButtons;
}
const items9 = [r25];
string = intl.string;
const r37 = r34 || property3 === env0_19.ERRORED ? (require(1244) /* metro dependency 1244: indexNative */).t.K0e7M9 : r32 ? t.R3aFPe : t.fTMEUi;
if (r34 || property3 === env0_19.ERRORED) {
const RetryIcon = (require(10234) /* metro dependency 10234: RetryIcon */).RetryIcon;
r32 = <RetryIcon size="lg" />;
} else {
r32 = ((Component) => <Component size="lg" />)(r32 ? (require(9376) /* metro dependency 9376: PlayIcon */).PlayIcon : (require(9554) /* metro dependency 9554: PauseIcon */).PauseIcon);
}
items9[1] = (
<VideoQuestPlayerControlButton
accessibilityRole="button"
accessibilityLabel={Reflect.apply(string, intl, [r37])}
onPress={value38}
>
{r32}
</VideoQuestPlayerControlButton>
);
if (showSkipButtons) {
r24 = (
<VideoQuestPlayerControlButton
disabled={r33}
accessibilityRole="button"
accessibilityLabel={intl.string((require(1244) /* metro dependency 1244: indexNative */).t.zWDcNP)}
onPress={value47}
>
{((SkipForwardIcon) => <SkipForwardIcon color={styles.icon.color} width={16} height={16} />)((require(13530) /* metro dependency 13530: SkipForwardIcon */).SkipForwardIcon)}
</VideoQuestPlayerControlButton>
);
} else {
r24 = showSkipButtons;
}
items9[2] = r24;
items8[1] = (
<View style={styles.controlsMiddle}>
{items9}
</View>
);
items8[2] = showFullscreenButton && <View style={[styles.controlsTopBottom, styles.controlsBottom,
r22]}><PressableOpacity accessibilityRole="button" accessibilityLabel={intl.string((require(1244) /* metro dependency 1244: indexNative */).t.vKZT5t)} onPress={onToggleFullscreen} style={styles.controlButton}>{((FullscreenEnterIcon) => <FullscreenEnterIcon />)((require(13531) /* metro dependency 13531: FullscreenEnterIcon */).FullscreenEnterIcon)}</PressableOpacity></View>;
items3[4] = (
<View2 style={items5} accessible={false}>
{items8}
</View2>
);
items3[5] = showProgress && <View style={styles.progressContainer}>{((View) => <View style={[styles.progress,
value29]} />)((importDefault(4017) /* metro dependency 4017: ReanimatedRexport */).View)}</View>;
return (
<View style={items2} accessible={false}>
<Pressable {...pressableBindingProps}>
{items3}
</Pressable>
</View>
);
function _fun102802(a0) { // fn#102802, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13713:4522, offset: 0x0224a34c, size: 38 bytes, params: 2, frame: 13
env0_21(a0);
if (onPlayerStateChange != null) {
onPlayerStateChange(a0);
}
}
function shouldShowControls() { // fn#102803, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13713:4644, offset: 0x0224a372, size: 117 bytes, params: 1, frame: 12
var r1;
let r0 = env0_22 && !hideControls;
if (r0) {
r1 = env0_28.get() || env0_20 === env1_19.PAUSED;
r1 = !r1 ? env0_20 === env1_19.ENDED : r1;
r1 = !r1 ? env0_20 === env1_19.ERRORED : r1;
r1 = !r1 ? env0_27 : r1;
r0 = r1;
}
return r0;
}
function he_102804() { // fn#102804, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13713:4920, offset: 0x0224a3e7, size: 105 bytes, params: 1, frame: 18
const shouldShowControls2 = shouldShowControls();
const withSpring = SpringModule.withSpring;
const r3 = shouldShowControls2 ? 1 : 0;
const SUBTLE_SPRING = (SpringPresetsModule).SUBTLE_SPRING;
return {opacity: Reflect.apply(withSpring, SpringModule, [r3, SUBTLE_SPRING]),
pointerEvents: shouldShowControls2 ? 'auto' : 'none'};
}
function pe_102805() { // fn#102805, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13713:5265, offset: 0x0224a450, size: 100 bytes, params: 1, frame: 18
const object = {};
let value = environment.__proto__;
value = require(4504) /* metro dependency 4504: timing */;
object.width = value.withTiming(100 * env0_30.get() + '%',
(require(4507) /* metro dependency 4507: timingPresets */).timingFast, 'animate-always');
return object;
}
function _fun102806(a0) { // fn#102806, offset: 0x0224a4b4, size: 18 bytes, params: 2, frame: 2
const env0_0 = a0;
return _fun102807;
function _fun102807(a0) { // fn#102807, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13713:5541, offset: 0x0224a4c6, size: 135 bytes, params: 2, frame: 18
var binding3;
var items2;
const value = copyRestArgs(0, undefined);
global.clearTimeout(env1_31.current);
const binding = env1_28;
binding.set(true);
env1_31.current = global.setTimeout(_fun102808, 2000);
if (env0_0 != null) {
binding3 = env0_0;
items2 = [];
arraySpread(items2, value, 0, binding);
return apply(binding3, items2, undefined, binding);
}
function _fun102808() { // fn#102808, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13713:5612, offset: 0x0224a54d, size: 23 bytes, params: 1, frame: 11
env2_28.set(false);
}
}
}
function _fun102809(a0, a1) { // fn#102809, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13713:5684, offset: 0x0224a564, size: 39 bytes, params: 3, frame: 11
const env0_0 = a0;
const env0_1 = a1;
env0_19(_fun102810);
function _fun102810({maxTimestampSec}) { // fn#102810, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13713:5696, offset: 0x0224a58b, size: 74 bytes, params: 2, frame: 16
const Math = global.Math;
const max = Math.max;
const Math2 = global.Math;
const floor = Math2.floor;
const binding = env0_0;
return {timestampSec: binding, maxTimestampSec: Reflect.apply(max, Math, [maxTimestampSec, Reflect.apply(floor,
Math2, [binding])]), duration: require};
}
}
function _fun102811() { // fn#102811, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13713:5874, offset: 0x0224a5d5, size: 38 bytes, params: 1, frame: 11
if (onReadyForDisplay != null) {
onReadyForDisplay();
}
env0_33(true);
}
function _fun102812(a0) { // fn#102812, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13713:5924, offset: 0x0224a5fb, size: 176 bytes, params: 2, frame: 16
var r6;
var allowUnrestrictedSeekingBinding;
var binding;
var Math;
var value3;
let current = env0_15.current;
if (current != null) {
allowUnrestrictedSeekingBinding = allowUnrestrictedSeeking;
binding = env0_18;
r6 = allowUnrestrictedSeekingBinding ? binding.duration : binding.maxTimestampSec;
Math = global.Math;
value3 = Math.max(0, global.Math.min(a0, r6));
binding = env0_25;
current = binding.current;
binding.current = (current + 1) % 100;
current = env0_15.current;
current.seek(value3 + 0.0001 * env0_25.current);
env0_24.current = value3;
}
}
function _fun102813() { // fn#102813, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13713:6162, offset: 0x0224a6ab, size: 42 bytes, params: 1, frame: 3
return {seekToStart: seekToStart, play: play_102815, pause: pause_102816};
function seekToStart() { // fn#102814, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13713:6180, offset: 0x0224a6d5, size: 107 bytes, params: 1, frame: 13
const binding = env1_20;
const ERRORED = env2_19.ERRORED;
if (binding !== ERRORED) {
env1_34(0);
if (env1_20 === env2_19.ENDED) {
env1_26(env2_19.PLAYING);
if (onResumePlayback != null) {
onResumePlayback(env2_20.IMPERATIVE_API);
}
}
}
}
function play_102815() { // fn#102815, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13713:6274, offset: 0x0224a740, size: 78 bytes, params: 1, frame: 13
const binding = env1_20;
const PAUSED = env2_19.PAUSED;
if (binding === PAUSED) {
env1_26(env2_19.PLAYING);
if (onResumePlayback != null) {
onResumePlayback(env2_20.IMPERATIVE_API);
}
}
}
function pause_102816() { // fn#102816, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13713:6346, offset: 0x0224a78e, size: 78 bytes, params: 1, frame: 13
const binding = env1_20;
const PLAYING = env2_19.PLAYING;
if (binding === PLAYING) {
env1_26(env2_19.PAUSED);
if (onPausePlayback != null) {
onPausePlayback(env2_20.IMPERATIVE_API);
}
}
}
}
function _fun102817(a0) { // fn#102817, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13713:6453, offset: 0x0224a7dc, size: 149 bytes, params: 2, frame: 16
var r3;
var timestampSec;
var binding;
var value5;
const duration = a0.duration;
env0_17(duration);
env0_23(true);
if (env0_15.current != null) {
timestampSec = initialProgress.timestampSec;
r3 = !disableResumeOnLoad && timestampSec > 5;
r3 = r3 && timestampSec < duration - 3;
if (r3) {
env0_34(timestampSec - 1);
}
binding = env0_26;
value5 = environment.__proto__;
binding(env1_19.PLAYING);
if (onLoad != null) {
onLoad(a0);
}
}
}
function _fun102818() { // fn#102818, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13713:6633, offset: 0x0224a871, size: 284 bytes, params: 1, frame: 14
const value = a0;
let shouldRestartVideo = (value !== undefined ? value : {}).shouldRestartVideo;
shouldRestartVideo = shouldRestartVideo === undefined || shouldRestartVideo;
const binding = env0_20;
const ERRORED = env1_19.ERRORED;
if (binding === ERRORED) {
env0_34(0);
env0_26(env1_19.PLAYING);
if (onResumePlayback != null) {
onResumePlayback(env1_20.USER_INTERACTION);
}
} else if (env0_27) {
if (shouldRestartVideo) {
env0_34(0);
env0_26(env1_19.PLAYING);
if (onResumePlayback != null) {
onResumePlayback(env1_20.USER_INTERACTION);
}
} else if (env0_20 === env1_19.PAUSED) {
env0_26(env1_19.PLAYING);
if (onResumePlayback != null) {
onResumePlayback(env1_20.USER_INTERACTION);
}
} else if (env0_20 === env1_19.LOADING) {
env0_26(env1_19.PLAYING);
if (onResumePlayback != null) {
onResumePlayback(env1_20.USER_INTERACTION);
}
} else if (env0_20 === env1_19.PLAYING) {
env0_26(env1_19.PAUSED);
if (onPausePlayback != null) {
onPausePlayback(env1_20.USER_INTERACTION);
}
}
} else if (env0_20 === env1_19.PAUSED) {
env0_26(env1_19.PLAYING);
if (onResumePlayback != null) {
onResumePlayback(env1_20.USER_INTERACTION);
}
} else if (env0_20 === env1_19.LOADING) {
env0_26(env1_19.PLAYING);
if (onResumePlayback != null) {
onResumePlayback(env1_20.USER_INTERACTION);
}
} else if (env0_20 === env1_19.PLAYING) {
env0_26(env1_19.PAUSED);
if (onPausePlayback != null) {
onPausePlayback(env1_20.USER_INTERACTION);
}
}
}
function _fun102819() { // fn#102819, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13713:6919, offset: 0x01d7afb7, size: 15 bytes, params: 1, frame: 9
return env0_35();
}
function _fun102820() { // fn#102820, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13713:6969, offset: 0x0224a98d, size: 102 bytes, params: 1, frame: 13
env0_36.current = false;
const binding = env0_20;
const PLAYING = env1_19.PLAYING;
if (binding === PLAYING) {
env0_36.current = true;
env0_26(env1_19.PAUSED);
if (onPausePlayback != null) {
onPausePlayback(env1_20.SYSTEM_INITIATED);
}
}
}
function _fun102821() { // fn#102821, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13713:7095, offset: 0x0224a9f3, size: 102 bytes, params: 1, frame: 13
var binding;
var value2;
if (env0_36.current) {
env0_36.current = false;
binding = env0_20;
value2 = environment.__proto__;
if (binding !== env1_19.ERRORED) {
env0_26(env1_19.PLAYING);
if (onResumePlayback != null) {
onResumePlayback(env1_20.SYSTEM_INITIATED);
}
}
}
}
function _fun102822() { // fn#102822, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13713:7217, offset: 0x0224aa59, size: 108 bytes, params: 1, frame: 19
const ComponentDispatch = (ComponentDispatchUtilsModule).ComponentDispatch;
let subscribe = ComponentDispatch.subscribe;
const QUEST_GAME_LINK_OPENED = ComponentActions.QUEST_GAME_LINK_OPENED;
Reflect.apply(subscribe, ComponentDispatch, [QUEST_GAME_LINK_OPENED, env0_37]);
subscribe = ComponentDispatch.subscribe;
const QUEST_APP_STORE_OVERLAY_FINISHED = ComponentActions.QUEST_APP_STORE_OVERLAY_FINISHED;
Reflect.apply(subscribe, ComponentDispatch, [QUEST_APP_STORE_OVERLAY_FINISHED, env0_38]);
return _fun102823;
function _fun102823() { // fn#102823, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13713:7364, offset: 0x0224aac5, size: 99 bytes, params: 1, frame: 19
const ComponentDispatch = (ComponentDispatchUtilsModule).ComponentDispatch;
let unsubscribe = ComponentDispatch.unsubscribe;
const QUEST_GAME_LINK_OPENED = ComponentActions.QUEST_GAME_LINK_OPENED;
Reflect.apply(unsubscribe, ComponentDispatch, [QUEST_GAME_LINK_OPENED, env1_37]);
unsubscribe = ComponentDispatch.unsubscribe;
const QUEST_APP_STORE_OVERLAY_FINISHED = ComponentActions.QUEST_APP_STORE_OVERLAY_FINISHED;
Reflect.apply(unsubscribe, ComponentDispatch, [QUEST_APP_STORE_OVERLAY_FINISHED, env1_38]);
}
}
function _fun102824() { // fn#102824, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13713:7549, offset: 0x0224ab28, size: 57 bytes, params: 1, frame: 12
const binding = env0_28;
const get = binding.get;
if (Reflect.apply(get, binding, [])) {
env0_28.set(false);
}
env0_35({shouldRestartVideo: false});
}
function _fun102825(a0) { // fn#102825, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13713:7632, offset: 0x0224ab61, size: 114 bytes, params: 2, frame: 16
var binding;
var set;
var currentTime;
if (env0_15.current != null) {
env0_24.current = null;
if (env0_16 > 0) {
binding = env0_30;
set = binding.set;
currentTime = a0.currentTime;
Reflect.apply(set, binding, [currentTime / env0_16]);
binding = env0_32;
currentTime = a0.currentTime;
binding(currentTime, env0_16);
}
if (onSeek != null) {
onSeek(a0);
}
}
}
function _fun102826() { // fn#102826, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13713:7849, offset: 0x0224abd3, size: 68 bytes, params: 1, frame: 12
if (!env0_39) {
env0_34((env0_24.current ?? env0_30.get() * env0_16) + 10);
}
}
function _fun102827() { // fn#102827, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13713:7957, offset: 0x0224ac17, size: 99 bytes, params: 1, frame: 13
env0_34((env0_24.current ?? env0_30.get() * env0_16) - 10);
const binding = env0_20;
const ENDED = env1_19.ENDED;
if (binding === ENDED) {
env0_26(env1_19.PLAYING);
}
}
function _fun102828(a0) { // fn#102828, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13713:8091, offset: 0x0224ac7a, size: 122 bytes, params: 2, frame: 16
const seekableDuration = a0.seekableDuration;
const value = 0;
const r3 = value === seekableDuration ? value : a0.currentTime / a0.seekableDuration;
env0_32(a0.currentTime, a0.seekableDuration);
env0_30.set(r3);
if (onProgress != null) {
onProgress({currentTime: a0.currentTime, seekableDuration: a0.seekableDuration, progress: r3});
}
}
function _fun102829() { // fn#102829, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13713:8324, offset: 0x0224acf4, size: 58 bytes, params: 1, frame: 12
var binding;
var value2;
if (!repeat) {
binding = env0_26;
value2 = environment.__proto__;
binding(env1_19.ENDED);
}
if (onEnd != null) {
onEnd();
}
}
function _fun102830() { // fn#102830, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13713:8389, offset: 0x0224ad2e, size: 47 bytes, params: 1, frame: 12
const binding = env0_26;
const LOADING = env1_19.LOADING;
binding(LOADING);
if (onLoadStart != null) {
onLoadStart();
}
}
function _fun102831(a0) { // fn#102831, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13713:8449, offset: 0x0224ad5d, size: 51 bytes, params: 2, frame: 12
const binding = env0_26;
const ERRORED = env1_19.ERRORED;
binding(ERRORED);
if (onError != null) {
onError(a0);
}
}
function _fun102833() { // fn#102833, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13713:8576, offset: 0x0224ad90, size: 67 bytes, params: 1, frame: 12
var environment;
var current;
let value = environment.__proto__;
value = require(477) /* metro dependency 477: PlatformUtils */;
if (value.isAndroid()) {
current = env0_15.current;
return _fun102834;
}
function _fun102834() { // fn#102834, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13713:8629, offset: 0x0224add3, size: 120 bytes, params: 1, frame: 13
var r1;
var value;
var value2;
var setNativeProps;
var value3;
var error;
try {
value = environment;
value2 = current == null;
if (value2) {
r1 = value2;
} else {
setNativeProps = current.setNativeProps;
value3 = setNativeProps == null;
r1 = value3;
}
if (!r1) {
current.setNativeProps({'paused': true, 'repeat': false, src: {uri: null}});
}
} catch (error) {
value = environment.__proto__.__proto__;
value = importDefault(1216) /* metro dependency 1216: SentryUtilsNative */;
value.captureException(error);
}
}
}
function useBufferingState({onBuffer}) { // fn#102835, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13713:8823, offset: 0x0224ae4b, size: 120 bytes, params: 2, frame: 16
var environment;
let value = environment.__proto__;
const binding = env1_4;
const env0_1 = binding.useRef(false);
value = env1_3(binding.useState(false), 2);
const property = value[0];
const env0_2 = value[1];
const useCallback = binding.useCallback;
let object = [onBuffer];
object = {isBuffering: property, toggleBuffering: Reflect.apply(useCallback, binding, [_fun102836, object])};
return object;
function _fun102836(a0) { // fn#102836, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13713:8940, offset: 0x0224aec3, size: 61 bytes, params: 2, frame: 13
env0_2(a0);
if (a0 !== env0_1.current) {
env0_1.current = a0;
if (onBuffer != null) {
onBuffer(a0);
}
}
}
}
function _fun102837({isBuffering}) { // fn#102837, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13713:9112, offset: 0x0224af00, size: 109 bytes, params: 2, frame: 13
var binding;
var value2;
var moduleValue;
if (isBuffering) {
binding = env0_20;
value2 = environment.__proto__;
if (binding === env1_19.LOADING) {
toggleBuffering(true);
} else {
moduleValue = require(477) /* metro dependency 477: PlatformUtils */;
if (moduleValue.isIOS()) {
if (!isBuffering) {
toggleBuffering(false);
}
} else {
toggleBuffering(true);
}
}
} else if (!isBuffering) {
toggleBuffering(false);
}
}
function _fun102838() { // fn#102838, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13713:9215, offset: 0x0224af6d, size: 54 bytes, params: 1, frame: 11
let value = environment.__proto__;
value = require(477) /* metro dependency 477: PlatformUtils */;
if (value.isIOS()) {
toggleBuffering(true);
}
}
function _fun102839() { // fn#102839, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13713:9271, offset: 0x0224afa3, size: 54 bytes, params: 1, frame: 11
let value = environment.__proto__;
value = require(477) /* metro dependency 477: PlatformUtils */;
if (value.isIOS()) {
toggleBuffering(false);
}
}
}
}
global.__d(_fun102796, 13523, [57, 31, 27, 7030, 661, 33, 697, 8011, 4501, 674, 4017, 4577, 4581, 4504, 4507, 1239,
566, 477, 1216, 1585, 1244, 5278, 13524, 13526, 13528, 13529, 10234, 9376, 9554, 13530, 13531,
2]) /* metro module 13523, dependencies: [57, 31, 27, 7030, 661, 33, 697, 8011, 4501, 674, 4017, 4577, 4581, 4504, 4507, 1239, 566, 477, 1216, 1585, 1244, 5278, 13524, 13526, 13528, 13529, 10234, 9376, 9554, 13530, 13531, 2] */;