/* Metro module 9543; source: components_native/common/Video.tsx; dependencies: [6, 7, 15, 17, 18, 57, 31, 27, 33, 4501, 697, 8011, 9544, 5459, 1244, 3868, 2] */ function _fun74450(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#74450, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9729:6, offset: 0x01d8dee8, size: 512 bytes, params: 8, frame: 26 var object3; const env0_0 = require; const closure = VideoComponent; const Object = global.Object; Object.defineProperty(exports, '__esModule', {value: true}); const env0_2 = importDefault(6) /* metro dependency 6 */; const env0_3 = importDefault(7) /* metro dependency 7 */; const env0_4 = importDefault(15) /* metro dependency 15 */; const env0_5 = importDefault(17) /* metro dependency 17 */; const env0_6 = importDefault(18) /* metro dependency 18 */; const env0_7 = importDefault(57) /* metro dependency 57 */; let value = importAll(31) /* metro dependency 31 */; const value2 = require(27) /* metro dependency 27 */; const env0_9 = value2.TouchableWithoutFeedback; const env0_10 = value2.View; const env0_11 = value2.Image; const env0_12 = value2.AppState; const env0_13 = (require(33) /* metro dependency 33 */).jsx; const createStylesModule = require(4501) /* metro dependency 4501: createStyles */; const createLegacyClassComponentStyles = createStylesModule.createLegacyClassComponentStyles; object3 = {}; const object4 = {'flex': 1, 'shadowColor': null, 'shadowOpacity': 0.5, 'shadowOffset': null, 'shadowRadius': 16}; const BLACK = (importDefault(697) /* metro dependency 697: native */).unsafe_rawColors.BLACK; object4.shadowColor = BLACK; object4.shadowOffset = {'height': 1, 'width': 0}; let BACKGROUND_BRAND = (importDefault(697) /* metro dependency 697: native */).colors.BACKGROUND_BRAND; object4.backgroundColor = BACKGROUND_BRAND; object3.container = object4; BACKGROUND_BRAND = (importDefault(697) /* metro dependency 697: native */).colors.BACKGROUND_BRAND; object3.video = {flex: 1, backgroundColor: BACKGROUND_BRAND}; const env0_14 = Reflect.apply(createLegacyClassComponentStyles, createStylesModule, [object3]); const PureComponent = value.PureComponent; value = _fun74458(PureComponent); const ThemeContext = (require(3868) /* metro dependency 3868: native */).ThemeContext; value.contextType = ThemeContext; (require(2) /* metro dependency 2 */).fileFinishedImporting('components_native/common/Video.tsx'); exports.default = value; exports.createVideoControls = createVideoControls; exports.VideoComponent = closure; } function _isNativeReflectConstruct_74451() { // fn#74451, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9729:253, offset: 0x01d8e0e8, size: 98 bytes, params: 1, frame: 18 var Boolean; var prototype; var valueOf; var call; var Reflect; var construct; var closure; var value; var error; try { Boolean = global.Boolean; prototype = Boolean.prototype; valueOf = prototype.valueOf; call = valueOf.call; Reflect = global.Reflect; construct = Reflect.construct; Boolean = global.Boolean; closure = function() { }; value = Reflect.apply(construct, Reflect, [Boolean, [], closure]); value = Reflect.apply(call, valueOf, [value]); var result = !value; } catch (error) { } return (_isNativeReflectConstruct_74451_isNativeReflectConstruct = function() { return !!result; })(); } function VideoComponent({style, source, poster, onLoadStart, onLoad, onError, onEnd, paused, muted, posterResizeMode, resizeMode, disableFocus, controls, ariaHidden, mixWithOthers, importantForAccessibility, pauseWhileAppInactive, playInBackground, preventsDisplaySleepDuringVideoPlayback, httpEngine}) { // fn#74454, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9729:737, offset: 0x01d8e14a, size: 456 bytes, params: 2, frame: 38 paused = !(paused === undefined) && paused; muted = muted === undefined || muted; posterResizeMode = posterResizeMode === undefined ? 'contain' : posterResizeMode; resizeMode = resizeMode === undefined ? 'contain' : resizeMode; pauseWhileAppInactive = pauseWhileAppInactive === undefined || pauseWhileAppInactive; playInBackground = !(playInBackground === undefined) && playInBackground; preventsDisplaySleepDuringVideoPlayback = preventsDisplaySleepDuringVideoPlayback === undefined || preventsDisplaySleepDuringVideoPlayback; const property = (require(8011) /* metro dependency 8011 */).default; const binding = env0_8; const useState = binding.useState; const value11 = env0_7(Reflect.apply(useState, binding, [AppState.currentState === 'active']), 2); const property2 = value11[0]; const env0_1 = value11[1]; env0_8.useEffect(_fun74455, [pauseWhileAppInactive]); const propertyProps = {style: style, source: source, importantForAccessibility: importantForAccessibility, poster: poster, muted: muted, paused: paused || pauseWhileAppInactive && !property2, posterResizeMode: posterResizeMode, resizeMode: resizeMode, repeat: true, playInBackground: playInBackground, pictureInPicture: false, playWhenInactive: false, onLoadStart: onLoadStart, onLoad: onLoad, onError: onError, onEnd: onEnd, disableFocus: disableFocus}; propertyProps['aria-hidden'] = ariaHidden; propertyProps.mixWithOthers = mixWithOthers; propertyProps.preventsDisplaySleepDuringVideoPlayback = preventsDisplaySleepDuringVideoPlayback; propertyProps.httpEngine = httpEngine; copyDataProperties(propertyProps, controls?.props, undefined); return ((Component) => )(property); } function _fun74458(a0) { // fn#74458, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9729:1663, offset: 0x01d8e368, size: 172 bytes, params: 2, frame: 16 const closure = Video_74459; env0_6(closure, a0); return env0_3(closure, [{key: 'componentDidMount', value: value_74462}, {key: 'componentWillUnmount', value: function() { if (this._renderTask != null) { this._renderTask.cancel(); } }}, {key: 'renderVideo', value: value_74465}, {key: 'renderImage', value: value_74466}, {key: 'render', value: value_74467}]); } function createVideoControls(a0) { // fn#74468, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9729:3938, offset: 0x01d8e8b7, size: 136 bytes, params: 2, frame: 11 const env0_0 = a0; return {seek: seek_74469, pause: pause_74470, useSubscribe: useSubscribe, props: {ref: env0_8.createRef(), onPlaybackRateChange: onPlaybackRateChange, onProgress: onProgress, onDownloadProgress: onDownloadProgress}}; } function _fun74455() { // fn#74455, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9729:1202, offset: 0x01d8e312, size: 59 bytes, params: 1, frame: 14 var environment; if (pauseWhileAppInactive) { value = environment.__proto__; var env0_0 = AppState.addEventListener('change', _fun74456); return _fun74457; } } function Video_74459(a0) { // fn#74459, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9729:1675, offset: 0x01d8e414, size: 193 bytes, params: 2, frame: 21 var r0; var Reflect; let value = copyRestArgs(0, undefined); let binding = env1_2; binding(this, Video_74459); const items = []; arraySpread(items, value, 0, items); value = env1_5(Video_74459); binding = env1_4; if (_isNativeReflectConstruct_74451()) { Reflect = global.Reflect; value = Reflect.construct(value, items, env1_5(this).constructor); r0 = value; } else { value = value.apply(this, items); r0 = value; } value = binding(this, r0); value.state = {postponeRender: true}; value.ref = env1_8.createRef(); value.isVideo = isVideo_74460; value.handleOpenFullScreen = handleOpenFullScreen; return value; } function value_74462() { // fn#74462, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9729:2288, offset: 0x01d8e5a0, size: 60 bytes, params: 1, frame: 13 var environment; let value = environment.__proto__; value = require(5459) /* metro dependency 5459: RunAfterInteractionsUtils */; this._renderTask = value.runAfterInteractions(_fun74463); } function value_74465() { // fn#74465, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9729:2514, offset: 0x01d8e61e, size: 242 bytes, params: 1, frame: 27 var videoURI; const value = environment.__proto__; const binding = env1_14; const context = this.context; const value2 = undefined; const value3 = binding(context); const props = this.props; const src = props.src; const poster = props.poster; const width = props.width; const height = props.height; const muted = props.muted; const paused = props.paused; const resizeMode = props.resizeMode; if ('videoURI' in src) { videoURI = src.videoURI; if (videoURI === '') { return null; } videoURI = src.videoURI; return videoURI != null ? : value2; } return null; } function value_74466() { // fn#74466, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9729:3024, offset: 0x01d8e710, size: 115 bytes, params: 1, frame: 17 var value; const props = this.props; const src = props.src; if ('uri' in src) { if (src.uri !== '') { value = environment.__proto__; return ( ); } } } function value_74467() { // fn#74467, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9729:3258, offset: 0x01d8e783, size: 308 bytes, params: 1, frame: 23 var r7; var r0; var intl; const value = environment.__proto__; const value2 = env1_14(this.context); const {style, width, height, canOpenFullscreen, postponeRender, accessibilityLabel} = this.props; const ref = this.ref; const value3 = null; const view = {this.state.postponeRender && postponeRender !== false ? value3 : this.isVideo() ? this.renderVideo() : this.renderImage()}; if (canOpenFullscreen) { if (value3 != accessibilityLabel) { r7 = accessibilityLabel; } else { intl = (require(1244) /* metro dependency 1244: indexNative */).intl; r7 = intl.string((require(1244) /* metro dependency 1244: indexNative */).t.OIDkcp); } r0 = {view}; } else { r0 = view; } return r0; } function createVideoControlsSeek(a0) { // fn#74469, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9729:4020, owner: createVideoControls.seek, offset: 0x01d8e93f, size: 52 bytes, params: 2, frame: 12 const current = env0_4.current; if (!(current == null || current.seek == null)) { current.seek(a0); } } function createVideoControlsPause(a0) { // fn#74470, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9729:4080, owner: createVideoControls.pause, offset: 0x01d8e973, size: 54 bytes, params: 2, frame: 12 env0_0(a0); if (env0_8 !== a0) { if (env0_2 != null) { env0_2(a0); } } } function createVideoControlsUseSubscribe(a0, a1, a2) { // fn#74471, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9729:4122, owner: createVideoControls.useSubscribe, offset: 0x01d8e9a9, size: 60 bytes, params: 4, frame: 13 env0_1 = a0; env0_2 = a1; env0_3 = a2; env1_8.useLayoutEffect(_fun74472, []); } function onPlaybackRateChange({playbackRate}) { // fn#74473, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9729:4242, owner: createVideoControls.onPlaybackRateChange, offset: 0x01d8ea38, size: 59 bytes, params: 2, frame: 11 if (env0_8 !== (playbackRate === 0)) { if (env0_2 != null) { env0_2(env0_8); } } } function onProgress({currentTime, seekableDuration}) { // fn#74474, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9729:4319, owner: createVideoControls.onProgress, offset: 0x01d8ea73, size: 60 bytes, params: 2, frame: 13 if (env0_1 != null) { env0_1(currentTime, seekableDuration); } } function createVideoControlsOnDownloadProgress({progressPercent}) { // fn#74475, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9729:4387, owner: createVideoControls.onDownloadProgress, offset: 0x01d8eaaf, size: 45 bytes, params: 2, frame: 11 if (env0_3 != null) { env0_3(progressPercent); } } function _fun74456(a0) { // fn#74456, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9729:1248, offset: 0x01d8e34d, size: 27 bytes, params: 2, frame: 12 env1_1(a0 === 'active'); } function Video_74459IsVideo() { // fn#74460, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9729:1934, owner: Video_74459.isVideo, offset: 0x01d8e4d5, size: 50 bytes, params: 1, frame: 4 const src = env0_0.props.src; return src != null && 'videoURI' in src && src.videoURI != null; } function handleOpenFullScreen() { // fn#74461, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9729:2030, owner: Video_74459.handleOpenFullScreen, offset: 0x01d8e507, size: 153 bytes, params: 1, frame: 17 var openMediaModal; var object; var value; const {src, onPress, width, height} = env0_0.props; if (onPress != null) { onPress(); } const current = env0_0.ref.current; if (current != null) { value = environment.__proto__.__proto__; value = require(9544) /* metro dependency 9544: openMediaModal */; openMediaModal = value.openMediaModal; object = {}; copyDataProperties(object, src, width); object['width'] = width; object['height'] = height; Reflect.apply(openMediaModal, value, [{initialSources: [object], originViewOrOriginLayout: current}]); } } function _fun74463() { // fn#74463, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9729:2347, offset: 0x01d8e5dc, size: 31 bytes, params: 1, frame: 12 env0_0.setState({postponeRender: false}); } function _fun74472() { // fn#74472, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9729:4173, offset: 0x01d8e9e5, size: 83 bytes, params: 1, frame: 15 if (env1_1 != null) { env1_1(env1_5, env1_6); } if (env1_2 != null) { env1_2(env1_8); } if (env1_3 != null) { env1_3(env1_7); } }