This commit is contained in:
janisslsm committed 2026-07-28 01:06:53 +03:00
1 parent af3b49f756
commit 1781d25a15
22448 files changed
+2731829 -2650550

No files matched your search

@@ -1,13 +1,17 @@
/* Metro module 9547; source: modules/media_viewer/MediaViewerAnalyticsManager.tsx; dependencies: [1379, 661, 629, 683, 2] */
import AnalyticsUtils from '../../utils/AnalyticsUtils.tsx'; /* Metro dependency 683 */
import ChannelStore from '../../stores/ChannelStore.tsx'; /* Metro dependency 1379 */
import * as FileImportTrackerModule from '../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
import * as Module00629Module from '../../by-id/module-00629.js'; /* Metro dependency 629 */
import * as ConstantsModule from '../../Constants.tsx'; /* Metro dependency 661 */
function _fun74530(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#74530, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9733:6, offset: 0x01d9143b, size: 588 bytes, params: 8, frame: 22
var object4;
let Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const channelStore = importDefault(1379) /* metro dependency 1379: ChannelStore */;
let value = require(661) /* metro dependency 661: Constants */;
let value = ConstantsModule;
const env0_3 = value.AnalyticEvents;
const env0_4 = value.AnalyticsSections;
object4 = {VIEWER_SWIPE: 'number_viewer_swipes', THUMBNAIL_SWIPE: 'number_thumbnail_swipes',
object = {VIEWER_SWIPE: 'number_viewer_swipes', THUMBNAIL_SWIPE: 'number_thumbnail_swipes',
SELECTED_ITEM_CHANGE: 'number_selected_item_changes', ZOOM_IN_BUTTON_PRESSED: 'number_zoom_in_button_pressed',
ZOOM_IN_IMAGE_PRESSED: 'number_zoom_in_image_pressed',
ZOOM_OUT_BUTTON_PRESSED: 'number_zoom_out_button_pressed',
@@ -15,17 +19,17 @@ function _fun74530(global, require, importDefault, importAll, module, exports, d
SAVE_MEDIA_PRESSED: 'number_save_media_button_pressed', OPEN_LINK_PRESSED: 'number_open_link_button_pressed',
MORE_BUTTON_PRESSED: 'number_more_button_pressed', COPY_IMAGE_PRESSED: 'number_copy_image_more_menu_pressed',
COPY_LINK_PRESSED: 'number_copy_link_more_menu_pressed', CONTEXT_MENU_OPENED: 'number_context_menu_opened'};
const object5 = {guildId: undefined, channelId: undefined, channelType: undefined, numMediaItems: 0,
const object2 = {guildId: undefined, channelId: undefined, channelType: undefined, numMediaItems: 0,
hasMediaOptions: undefined, source: undefined};
Object = global.Object;
const fromEntries = Object.fromEntries;
const Object2 = global.Object;
value = Object2.values(object4);
object5.incrementableActions = Reflect.apply(fromEntries, Object, [value.map(function(a0) {
value = Object2.values(object);
object2.incrementableActions = Reflect.apply(fromEntries, Object, [value.map(function(a0) {
return [a0, 0];
})]);
const env0_6 = (require(629) /* metro dependency 629 */).create(_fun74532);
const object6 = {markSessionStarted: markSessionStarted, markSessionCompleted: markSessionCompleted,
const env0_6 = (Module00629Module).create(_fun74532);
const object3 = {markSessionStarted: markSessionStarted, markSessionCompleted: markSessionCompleted,
markActionPerformed: markActionPerformed, trackMediaViewerImageSaved: trackMediaViewerImageSaved,
trackMediaViewerImageCopied: trackMediaViewerImageCopied,
trackMediaViewerLinkCopied: trackMediaViewerLinkCopied, trackMediaViewerLinkOpened: trackMediaViewerLinkOpened,
@@ -36,119 +40,124 @@ function _fun74530(global, require, importDefault, importAll, module, exports, d
var MESSAGE_EMBEDS_ACTION_COMPLETED = AnalyticEvents.MESSAGE_EMBEDS_ACTION_COMPLETED;
defaultImport.track(MESSAGE_EMBEDS_ACTION_COMPLETED, {platform: platform, error: error, action: action});
}};
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/media_viewer/MediaViewerAnalyticsManager.tsx');
exports.IncrementableMediaViewerActions = object4;
exports.MediaViewerAnalytics = object6;
}
(FileImportTrackerModule).fileFinishedImporting('modules/media_viewer/MediaViewerAnalyticsManager.tsx');
exports.IncrementableMediaViewerActions = object;
exports.MediaViewerAnalytics = object3;
function _fun74532() { // fn#74532, offset: 0x00d9d76b, size: 9 bytes, params: 1, frame: 1
return env0_5;
}
function markSessionStarted(a0) { // fn#74533, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9733:1157, offset: 0x01d91687, size: 241 bytes, params: 2, frame: 20
var object2;
const channel = ChannelStore.getChannel(a0.channelId);
const value3 = undefined;
const defaultImport = importDefault(683) /* metro dependency 683: AnalyticsUtils */;
const track = defaultImport.track;
const OPEN_MODAL = AnalyticEvents.OPEN_MODAL;
const MEDIA_VIEWER = AnalyticsSections.MEDIA_VIEWER;
const value4 = channel == null;
Reflect.apply(track, defaultImport, [OPEN_MODAL, {type: MEDIA_VIEWER, source: a0.source, channel_id: a0.channelId,
channel_type: channel == null ? value3 : channel.type, guild_id: value4 ? value3 : channel.guild_id}]);
const binding = env0_6;
const setState = binding.setState;
object2 = {};
copyDataProperties(object2, env0_5, value4);
copyDataProperties(object2, a0, value4);
object2['channelId'] = a0.channelId;
object2['channelType'] = channel == null ? value3 : channel.type;
object2['guildId'] = channel == null ? value3 : channel.guild_id;
Reflect.apply(setState, binding, [object2]);
return value3;
}
function markSessionStarted(a0) { // fn#74533, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9733:1157, offset: 0x01d91687, size: 241 bytes, params: 2, frame: 20
const channel = ChannelStore.getChannel(a0.channelId);
const value3 = undefined;
const defaultImport = AnalyticsUtils;
const track = defaultImport.track;
const OPEN_MODAL = AnalyticEvents.OPEN_MODAL;
const MEDIA_VIEWER = AnalyticsSections.MEDIA_VIEWER;
const value4 = channel == null;
Reflect.apply(track, defaultImport, [OPEN_MODAL, {type: MEDIA_VIEWER, source: a0.source, channel_id: a0.channelId,
channel_type: channel == null ? value3 : channel.type, guild_id: value4 ? value3 : channel.guild_id}]);
const binding = env0_6;
const setState = binding.setState;
object = {};
copyDataProperties(object, env0_5, value4);
copyDataProperties(object, a0, value4);
object['channelId'] = a0.channelId;
object['channelType'] = channel == null ? value3 : channel.type;
object['guildId'] = channel == null ? value3 : channel.guild_id;
Reflect.apply(setState, binding, [object]);
return value3;
}
function markSessionCompleted() { // fn#74534, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9733:1488, offset: 0x01d91778, size: 165 bytes, params: 1, frame: 18
const binding = env0_6;
const state = binding.getState();
const defaultImport = importDefault(683) /* metro dependency 683: AnalyticsUtils */;
const track = defaultImport.track;
const MEDIA_VIEWER_SESSION_COMPLETED = AnalyticEvents.MEDIA_VIEWER_SESSION_COMPLETED;
let object2 = {};
object2.source = state.source;
object2.guild_id = state.guildId;
object2.channel_id = state.channelId;
object2.channel_type = state.channelType;
object2.number_media_items = state.numMediaItems;
const hasMediaOptions = state.hasMediaOptions;
object2.has_media_options = hasMediaOptions;
copyDataProperties(object2, state.incrementableActions, hasMediaOptions);
Reflect.apply(track, defaultImport, [MEDIA_VIEWER_SESSION_COMPLETED, object2]);
const setState = binding.setState;
object2 = {};
copyDataProperties(object2, env0_5, hasMediaOptions);
Reflect.apply(setState, binding, [object2]);
}
function markSessionCompleted() { // fn#74534, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9733:1488, offset: 0x01d91778, size: 165 bytes, params: 1, frame: 18
const binding = env0_6;
const state = binding.getState();
const defaultImport = AnalyticsUtils;
const track = defaultImport.track;
const MEDIA_VIEWER_SESSION_COMPLETED = AnalyticEvents.MEDIA_VIEWER_SESSION_COMPLETED;
let object = {};
object.source = state.source;
object.guild_id = state.guildId;
object.channel_id = state.channelId;
object.channel_type = state.channelType;
object.number_media_items = state.numMediaItems;
const hasMediaOptions = state.hasMediaOptions;
object.has_media_options = hasMediaOptions;
copyDataProperties(object, state.incrementableActions, hasMediaOptions);
Reflect.apply(track, defaultImport, [MEDIA_VIEWER_SESSION_COMPLETED, object]);
const setState = binding.setState;
object = {};
copyDataProperties(object, env0_5, hasMediaOptions);
Reflect.apply(setState, binding, [object]);
}
function markActionPerformed(a0) { // fn#74535, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9733:1784, offset: 0x01d9181d, size: 38 bytes, params: 2, frame: 11
const env0_0 = a0;
env0_6.setState(_fun74536);
}
function markActionPerformed(a0) { // fn#74535, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9733:1784, offset: 0x01d9181d, size: 38 bytes, params: 2, frame: 11
const env0_0 = a0;
env0_6.setState(_fun74536);
function _fun74536(a0) { // fn#74536, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9733:1800, offset: 0x01d91843, size: 56 bytes, params: 2, frame: 14
const object2 = {};
copyDataProperties(object2, a0.incrementableActions, undefined);
const binding = env0_0;
object2[binding] = a0.incrementableActions[binding] + 1;
return {incrementableActions: object2};
}
function trackMediaViewerImageSaved({url, success}) { // fn#74537, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9733:1918, offset: 0x01d9187b, size: 96 bytes, params: 2, frame: 17
const state = env0_6.getState();
const defaultImport = importDefault(683) /* metro dependency 683: AnalyticsUtils */;
const track = defaultImport.track;
const MEDIA_VIEWER_IMAGE_SAVED = AnalyticEvents.MEDIA_VIEWER_IMAGE_SAVED;
Reflect.apply(track, defaultImport, [MEDIA_VIEWER_IMAGE_SAVED, {url: url, success: success,
channel_id: state.channelId}]);
}
}
function trackMediaViewerImageCopied({url, success}) { // fn#74538, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9733:2071, offset: 0x01d918db, size: 96 bytes, params: 2, frame: 17
const state = env0_6.getState();
const defaultImport = importDefault(683) /* metro dependency 683: AnalyticsUtils */;
const track = defaultImport.track;
const MEDIA_VIEWER_IMAGE_COPIED = AnalyticEvents.MEDIA_VIEWER_IMAGE_COPIED;
Reflect.apply(track, defaultImport, [MEDIA_VIEWER_IMAGE_COPIED, {url: url, success: success,
channel_id: state.channelId}]);
}
function trackMediaViewerImageSaved({url, success}) { // fn#74537, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9733:1918, offset: 0x01d9187b, size: 96 bytes, params: 2, frame: 17
const state = env0_6.getState();
const defaultImport = AnalyticsUtils;
const track = defaultImport.track;
const MEDIA_VIEWER_IMAGE_SAVED = AnalyticEvents.MEDIA_VIEWER_IMAGE_SAVED;
Reflect.apply(track, defaultImport, [MEDIA_VIEWER_IMAGE_SAVED, {url: url, success: success,
channel_id: state.channelId}]);
}
function trackMediaViewerLinkCopied({href, success}) { // fn#74539, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9733:2224, offset: 0x01d9193b, size: 98 bytes, params: 2, frame: 17
const state = env0_6.getState();
const defaultImport = importDefault(683) /* metro dependency 683: AnalyticsUtils */;
const track = defaultImport.track;
const MEDIA_VIEWER_LINK_COPIED = AnalyticEvents.MEDIA_VIEWER_LINK_COPIED;
Reflect.apply(track, defaultImport, [MEDIA_VIEWER_LINK_COPIED, {href: href, success: success,
channel_id: state.channelId}]);
}
function trackMediaViewerImageCopied({url, success}) { // fn#74538, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9733:2071, offset: 0x01d918db, size: 96 bytes, params: 2, frame: 17
const state = env0_6.getState();
const defaultImport = AnalyticsUtils;
const track = defaultImport.track;
const MEDIA_VIEWER_IMAGE_COPIED = AnalyticEvents.MEDIA_VIEWER_IMAGE_COPIED;
Reflect.apply(track, defaultImport, [MEDIA_VIEWER_IMAGE_COPIED, {url: url, success: success,
channel_id: state.channelId}]);
}
function trackMediaViewerLinkOpened({href}) { // fn#74540, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9733:2378, offset: 0x01d9199d, size: 87 bytes, params: 2, frame: 16
const state = env0_6.getState();
const defaultImport = importDefault(683) /* metro dependency 683: AnalyticsUtils */;
const track = defaultImport.track;
const MEDIA_VIEWER_LINK_OPENED = AnalyticEvents.MEDIA_VIEWER_LINK_OPENED;
Reflect.apply(track, defaultImport, [MEDIA_VIEWER_LINK_OPENED, {href: href, channel_id: state.channelId}]);
}
function trackMediaViewerLinkCopied({href, success}) { // fn#74539, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9733:2224, offset: 0x01d9193b, size: 98 bytes, params: 2, frame: 17
const state = env0_6.getState();
const defaultImport = AnalyticsUtils;
const track = defaultImport.track;
const MEDIA_VIEWER_LINK_COPIED = AnalyticEvents.MEDIA_VIEWER_LINK_COPIED;
Reflect.apply(track, defaultImport, [MEDIA_VIEWER_LINK_COPIED, {href: href, success: success,
channel_id: state.channelId}]);
}
function trackMediaViewerDownloadButtonTapped() { // fn#74541, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9733:2522, offset: 0x01d919f4, size: 93 bytes, params: 1, frame: 16
const state = env0_6.getState();
const defaultImport = importDefault(683) /* metro dependency 683: AnalyticsUtils */;
const track = defaultImport.track;
const MEDIA_VIEWER_DOWNLOAD_BUTTON_TAPPED = AnalyticEvents.MEDIA_VIEWER_DOWNLOAD_BUTTON_TAPPED;
Reflect.apply(track, defaultImport, [MEDIA_VIEWER_DOWNLOAD_BUTTON_TAPPED, {guild_id: state.guildId,
channel_id: state.channelId, channel_type: state.channelType}]);
}
function trackMediaViewerLinkOpened({href}) { // fn#74540, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9733:2378, offset: 0x01d9199d, size: 87 bytes, params: 2, frame: 16
const state = env0_6.getState();
const defaultImport = AnalyticsUtils;
const track = defaultImport.track;
const MEDIA_VIEWER_LINK_OPENED = AnalyticEvents.MEDIA_VIEWER_LINK_OPENED;
Reflect.apply(track, defaultImport, [MEDIA_VIEWER_LINK_OPENED, {href: href, channel_id: state.channelId}]);
}
function trackMediaViewerShareButtonTapped() { // fn#74542, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9733:2705, offset: 0x01d91a51, size: 93 bytes, params: 1, frame: 16
const state = env0_6.getState();
const defaultImport = importDefault(683) /* metro dependency 683: AnalyticsUtils */;
const track = defaultImport.track;
const MEDIA_VIEWER_SHARE_BUTTON_TAPPED = AnalyticEvents.MEDIA_VIEWER_SHARE_BUTTON_TAPPED;
Reflect.apply(track, defaultImport, [MEDIA_VIEWER_SHARE_BUTTON_TAPPED, {guild_id: state.guildId,
channel_id: state.channelId, channel_type: state.channelType}]);
}
function trackMediaViewerDownloadButtonTapped() { // fn#74541, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9733:2522, offset: 0x01d919f4, size: 93 bytes, params: 1, frame: 16
const state = env0_6.getState();
const defaultImport = AnalyticsUtils;
const track = defaultImport.track;
const MEDIA_VIEWER_DOWNLOAD_BUTTON_TAPPED = AnalyticEvents.MEDIA_VIEWER_DOWNLOAD_BUTTON_TAPPED;
Reflect.apply(track, defaultImport, [MEDIA_VIEWER_DOWNLOAD_BUTTON_TAPPED, {guild_id: state.guildId,
channel_id: state.channelId, channel_type: state.channelType}]);
}
function trackMediaViewerShareButtonTapped() { // fn#74542, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9733:2705, offset: 0x01d91a51, size: 93 bytes, params: 1, frame: 16
const state = env0_6.getState();
const defaultImport = AnalyticsUtils;
const track = defaultImport.track;
const MEDIA_VIEWER_SHARE_BUTTON_TAPPED = AnalyticEvents.MEDIA_VIEWER_SHARE_BUTTON_TAPPED;
Reflect.apply(track, defaultImport, [MEDIA_VIEWER_SHARE_BUTTON_TAPPED, {guild_id: state.guildId,
channel_id: state.channelId, channel_type: state.channelType}]);
}
function _fun74536(a0) { // fn#74536, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9733:1800, offset: 0x01d91843, size: 56 bytes, params: 2, frame: 14
const object = {};
copyDataProperties(object, a0.incrementableActions, undefined);
const binding = env0_0;
object[binding] = a0.incrementableActions[binding] + 1;
return {incrementableActions: object};
}
global.__d(_fun74530, 9547, [1379, 661, 629, 683,
2]) /* metro module 9547, dependencies: [1379, 661, 629, 683, 2] */;
@@ -1,8 +1,10 @@
/* Metro module 9561; source: modules/media_viewer/native/Constants.tsx; dependencies: [2] */
import * as FileImportTrackerModule from '../../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
function _fun74684(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#74684, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9747:6, offset: 0x01d9685c, size: 172 bytes, params: 8, frame: 15
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/media_viewer/native/Constants.tsx');
(FileImportTrackerModule).fileFinishedImporting('modules/media_viewer/native/Constants.tsx');
exports.THUMBNAIL_MARGIN = 2;
exports.THUMBNAIL_MIN_WIDTH = 24;
exports.THUMBNAIL_MAX_WIDTH = 72;
@@ -15,3 +17,4 @@ function _fun74684(global, require, importDefault, importAll, module, exports, d
exports.THUMBNAIL_HEIGHT_MARGIN_LANDSCAPE = 34;
}
global.__d(_fun74684, 9561, [2]) /* metro module 9561, dependencies: [2] */;
@@ -1,11 +1,15 @@
/* Metro module 9552; source: modules/media_viewer/native/MediaPlayerMuteManager.tsx; dependencies: [6, 7, 27, 629, 690, 2] */
import ClassCallCheck from '../../../by-id/module-00006-ClassCallCheck.js'; /* Metro dependency 6 */
import CreateClass from '../../../by-id/module-00007-CreateClass.js'; /* Metro dependency 7 */
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 ReactBatchUpdatesNativeModule from '../../../external/discord_common/js/shared/utils/ReactBatchUpdates.native.tsx'; /* Metro dependency 690 */
function _fun74586(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#74586, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9738:6, offset: 0x01d929c5, size: 247 bytes, params: 8, frame: 20
const env0_0 = require;
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 */;
let value = require(27) /* metro dependency 27 */;
let value = ReactNativeModule;
const NativeEventEmitter = value.NativeEventEmitter;
const NativeModules = value.NativeModules;
value = require(629) /* metro dependency 629 */;
@@ -15,39 +19,40 @@ function _fun74586(global, require, importDefault, importAll, module, exports, d
const MediaPlayerManager = NativeModules.MediaPlayerManager;
const nativeEventEmitter = new NativeEventEmitter(MediaPlayerManager);
const value6 = new _fun74588()();
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/media_viewer/native/MediaPlayerMuteManager.tsx');
(FileImportTrackerModule).fileFinishedImporting('modules/media_viewer/native/MediaPlayerMuteManager.tsx');
exports.default = value6;
exports.useMediaPlayerMutedStore = value;
}
function _fun74588() { // fn#74588, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9738:242, offset: 0x01d92ac7, size: 84 bytes, params: 1, frame: 15
return env0_3(MediaPlayerMuteManager, [{key: 'initialize', value: value_74590}, {key: 'terminate',
value: function() {
var muteSubscription = this.muteSubscription;
if (muteSubscription != null) {
muteSubscription.remove();
function _fun74588() { // fn#74588, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9738:242, offset: 0x01d92ac7, size: 84 bytes, params: 1, frame: 15
return CreateClass(MediaPlayerMuteManager, [{key: 'initialize', value: value_74590}, {key: 'terminate',
value: function() {
var muteSubscription = this.muteSubscription;
if (muteSubscription != null) {
muteSubscription.remove();
}
}}]);
function MediaPlayerMuteManager() { // fn#74589, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9738:263, offset: 0x01d92b1b, size: 33 bytes, params: 1, frame: 13
env1_2(this, MediaPlayerMuteManager);
this.muteSubscription = undefined;
}
}}]);
}
function MediaPlayerMuteManager() { // fn#74589, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9738:263, offset: 0x01d92b1b, size: 33 bytes, params: 1, frame: 13
env1_2(this, MediaPlayerMuteManager);
this.muteSubscription = undefined;
}
function value_74590() { // fn#74590, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9738:384, offset: 0x01d92b3c, size: 47 bytes, params: 1, frame: 13
var environment;
const value = environment.__proto__;
this.muteSubscription = env1_5.addListener('MediaPlayerMuteStateChanged', _fun74591);
function _fun74591({isMuted}) { // fn#74591, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9738:462, offset: 0x01d92b6b, size: 60 bytes, params: 2, frame: 12
var environment;
const value = environment.__proto__.__proto__;
(ReactBatchUpdatesNativeModule).batchUpdates(_fun74592);
function _fun74592() { // fn#74592, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9738:500, offset: 0x01d92ba7, size: 36 bytes, params: 1, frame: 12
env3_4.setState({isMuted: isMuted});
}
function value_74590() { // fn#74590, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9738:384, offset: 0x01d92b3c, size: 47 bytes, params: 1, frame: 13
var environment;
const value = environment.__proto__;
this.muteSubscription = env1_5.addListener('MediaPlayerMuteStateChanged', _fun74591);
}
}
function _fun74591({isMuted}) { // fn#74591, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9738:462, offset: 0x01d92b6b, size: 60 bytes, params: 2, frame: 12
var environment;
const value = environment.__proto__.__proto__;
(require(690) /* metro dependency 690: ReactBatchUpdatesNative */).batchUpdates(_fun74592);
}
}
}
function _fun74592() { // fn#74592, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9738:500, offset: 0x01d92ba7, size: 36 bytes, params: 1, frame: 12
env3_4.setState({isMuted: isMuted});
}
global.__d(_fun74586, 9552, [6, 7, 27, 629, 690, 2]) /* metro module 9552, dependencies: [6, 7, 27, 629, 690, 2] */;
File diff suppressed because it is too large. Load diff
@@ -1,29 +1,34 @@
/* Metro module 9562; source: modules/media_viewer/native/MediaViewerDimensionsContext.tsx; dependencies: [31, 33, 1478, 44, 2] */
import Module00044 from '../../../by-id/module-00044.js'; /* Metro dependency 44 */
import UseWindowDimensionsNative from '../../screen/useWindowDimensions.native.tsx'; /* Metro dependency 1478 */
import * as FileImportTrackerModule from '../../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
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 */
function _fun74685(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#74685, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9748:6, offset: 0x01d96908, size: 168 bytes, params: 8, frame: 18
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const value = importAll(31) /* metro dependency 31 */;
const env0_3 = (require(33) /* metro dependency 33 */).jsx;
const env0_4 = value.createContext(null);
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/media_viewer/native/MediaViewerDimensionsContext.tsx');
const env0_4 = ReactModule.createContext(null);
(FileImportTrackerModule).fileFinishedImporting('modules/media_viewer/native/MediaViewerDimensionsContext.tsx');
exports.MediaViewerDimensionsProvider = MediaViewerDimensionsProvider;
exports.useMediaViewerDimensions = useMediaViewerDimensions;
function MediaViewerDimensionsProvider({children}) { // fn#74686, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9748:270, offset: 0x01d969b0, size: 79 bytes, params: 2, frame: 15
const value2 = (UseWindowDimensionsNative)({ignoreKeyboard: true});
const Provider = env0_4.Provider;
return (
<Provider value={value2}>
{children}
</Provider>
);
}
function useMediaViewerDimensions() { // fn#74687, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9748:428, offset: 0x01d969ff, size: 64 bytes, params: 1, frame: 14
const value2 = env0_2.useContext(env0_4);
(Module00044)(value2 != null,
'useMediaViewerDimensions must be used inside MediaViewerDimensionsProvider');
return value2;
}
}
function MediaViewerDimensionsProvider({children}) { // fn#74686, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9748:270, offset: 0x01d969b0, size: 79 bytes, params: 2, frame: 15
const value2 = (importDefault(1478) /* metro dependency 1478: useWindowDimensionsNative */)({ignoreKeyboard: true});
const Provider = env0_4.Provider;
return (
<Provider value={value2}>
{children}
</Provider>
);
}
function useMediaViewerDimensions() { // fn#74687, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9748:428, offset: 0x01d969ff, size: 64 bytes, params: 1, frame: 14
const value2 = env0_2.useContext(env0_4);
(importDefault(44) /* metro dependency 44 */)(value2 != null,
'useMediaViewerDimensions must be used inside MediaViewerDimensionsProvider');
return value2;
}
global.__d(_fun74685, 9562, [31, 33, 1478, 44, 2]) /* metro module 9562, dependencies: [31, 33, 1478, 44, 2] */;
File diff suppressed because it is too large. Load diff
@@ -1,160 +1,214 @@
/* Metro module 9936; source: modules/media_viewer/native/components/MediaModalLoader.tsx; dependencies: [57, 31, 27, 33, 4501, 697, 4573, 1244, 9937, 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 * 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 CreateStylesModule from '../../../../design/components/Styles/native/createStyles.tsx'; /* Metro dependency 4501 */
import * as TextModule from '../../../../design/components/Text/native/Text.tsx'; /* Metro dependency 4573 */
function _fun77753(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#77753, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10122:6, offset: 0x01e0a074, size: 415 bytes, params: 8, frame: 28
var object3;
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_3 = importDefault(57) /* metro dependency 57 */;
let value = importAll(31) /* metro dependency 31 */;
const value2 = require(27) /* metro dependency 27 */;
const StyleSheet = value2.StyleSheet;
const env0_5 = value2.View;
const env0_6 = value2.ActivityIndicator;
const value3 = require(33) /* metro dependency 33 */;
const env0_7 = value3.jsx;
const env0_8 = value3.jsxs;
const createStylesModule = require(4501) /* metro dependency 4501: createStyles */;
const createStyles = createStylesModule.createStyles;
object3 = {};
const object4 = {};
copyDataProperties(object4, StyleSheet.absoluteFillObject, undefined);
object4['flex'] = 1;
object4['alignItems'] = 'center';
object4['justifyContent'] = 'center';
object4['backgroundColor'] = 'rgba(0, 0, 0, 0.7)';
object3.loader = object4;
const PX_12 = (importDefault(697) /* metro dependency 697: native */).space.PX_12;
object3.loaderIndicator = {marginTop: PX_12};
object3.loaderText = {textAlign: 'center'};
const env0_9 = Reflect.apply(createStyles, createStylesModule, [object3]);
object3 = {None: 0};
object3[0] = 'None';
object3.Loading = 1;
object3[1] = 'Loading';
object3.Loaded = 2;
object3[2] = 'Loaded';
object3.Error = 3;
object3[3] = 'Error';
let value = ReactModule;
const StyleSheet = ReactNativeModule.StyleSheet;
const createStyles = CreateStylesModule.createStyles;
object = {};
const object2 = {};
copyDataProperties(object2, StyleSheet.absoluteFillObject, undefined);
object2['flex'] = 1;
object2['alignItems'] = 'center';
object2['justifyContent'] = 'center';
object2['backgroundColor'] = 'rgba(0, 0, 0, 0.7)';
object.loader = object2;
const PX_12 = (Native).space.PX_12;
object.loaderIndicator = {marginTop: PX_12};
object.loaderText = {textAlign: 'center'};
const env0_9 = Reflect.apply(createStyles, CreateStylesModule, [object]);
object = {None: 0};
object[0] = 'None';
object.Loading = 1;
object[1] = 'Loading';
object.Loaded = 2;
object[2] = 'Loaded';
object.Error = 3;
object[3] = 'Error';
value = value.memo(MediaModalLoader);
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/media_viewer/native/components/MediaModalLoader.tsx');
(FileImportTrackerModule).fileFinishedImporting('modules/media_viewer/native/components/MediaModalLoader.tsx');
exports.default = value;
}
function MediaModalLoader(a0) { // fn#77754, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10122:559, offset: 0x01e0a213, size: 981 bytes, params: 2, frame: 34
var r0;
var Fragment;
var description;
const Text = (TextModule).Text;
var intl;
const Component = a0.Component;
const style = a0.style;
const onLoadStart = a0.onLoadStart;
const onLoad = a0.onLoad;
const onError = a0.onError;
let index = a0.index;
let value = undefined;
index = index === value ? 0 : index;
const source = a0.source;
let object = {'Component': 0, 'style': 0, 'onLoadStart': 0, 'onLoad': 0, 'onError': 0, 'index': 0, 'source': 0};
const value3 = null;
silentSetPrototypeOf(object, value3, undefined);
const value4 = copyDataProperties({}, a0, object, undefined);
const env0_3 = value;
let env0_4 = value;
const styles = useStyles();
const binding = env0_4;
let useState = binding.useState;
const binding2 = env0_10;
const None = binding2.None;
const value6 = Reflect.apply(useState, binding, [None]);
const binding3 = env0_3;
const value7 = binding3(value6, 2);
const property = value7[0];
env0_4 = value7[1];
useState = binding.useState;
const value8 = binding3(Reflect.apply(useState, binding, [0]), 2);
const property2 = value8[0];
const env0_5 = value8[1];
const env0_6 = binding.useRef(value3);
const value9 = binding.useCallback(_fun77755, []);
const value10 = binding.useCallback(_fun77758, []);
const value11 = binding.useCallback(_fun77759, []);
const value12 = binding.useCallback(_fun77760, []);
binding.useEffect(_fun77761, [property, onLoadStart, onError, onLoad]);
binding.useEffect(function() {
return _fun77763;
});
const Error = binding2.Error;
if (property === Error) {
var viewBindingProps = {style: [styles.loader, style]};
var textProps = {'style': null, 'variant': 'heading-md/semibold', 'color': 'always-white',
style: styles.loaderText};
intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
r0 = (
<View {...viewBindingProps}>
<Text {...textProps}>
{intl.string((require(1244) /* metro dependency 1244: indexNative */).t['+ITMYX'])}
</Text>
</View>
);
} else {
Fragment = env0_4.Fragment;
description = source.description;
object = [
<Component
{...value4}
{...{['style']: style}}
{...{['source']: source}}
{...{['onLoadStart']: value9}}
{...{['onProgress']: value10}}
{...{['onLoad']: value11}}
{...{['onError']: value12}}
{...{['accessibilityRole']: 'image'}}
{...{['accessibilityLabel']: value3 != description ? description : value}}
{...{['loop']: true}}
/>,
];
object[1] = (
property !== env0_10.Loading
? value3
: (
<View style={[styles.loader, style]}>
{
value3 == source.videoURI
? (
<Text
style={styles.loaderText}
variant="heading-md/semibold"
color="always-white"
>
{global.Math.round(property2)}
{'%'}
</Text>
)
: value3
}
<ActivityIndicator
color="white"
style={styles.loaderIndicator}
size="large"
/>
</View>
)
);
object[2] = ((Component) => <Component style={style} index={index} source={source} />)(importDefault(9937) /* metro dependency 9937: MediaModalSpoilerOverlay */);
value = (
<Fragment>
{object}
</Fragment>
);
r0 = value;
}
return r0;
function _fun77755() { // fn#77755, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10122:794, offset: 0x01e0a5e8, size: 46 bytes, params: 1, frame: 14
const binding = env0_6;
const value = global.setTimeout(_fun77756, 1000);
binding.current = value;
return value;
function _fun77756() { // fn#77756, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10122:820, offset: 0x01e0a616, size: 25 bytes, params: 1, frame: 11
env1_4(_fun77757);
function _fun77757(a0) { // fn#77757, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10122:828, offset: 0x01e0a62f, size: 44 bytes, params: 2, frame: 3
const None = env3_10.None;
return a0 === None ? env3_10.Loading : env3_10.None;
}
}
}
function _fun77758({nativeEvent}) { // fn#77758, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10122:890, offset: 0x01e0a65b, size: 48 bytes, params: 2, frame: 12
env0_5(100 * nativeEvent.loaded / nativeEvent.total);
}
function _fun77759() { // fn#77759, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10122:961, offset: 0x01e0a68b, size: 29 bytes, params: 1, frame: 11
const binding = env0_4;
const Loaded = env1_10.Loaded;
return binding(Loaded);
}
function _fun77760() { // fn#77760, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10122:999, offset: 0x01e0a6a8, size: 28 bytes, params: 1, frame: 11
const binding = env0_4;
const Error = env1_10.Error;
return binding(Error);
}
function _fun77761() { // fn#77761, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10122:1039, offset: 0x01e0a6c4, size: 119 bytes, params: 1, frame: 11
const binding = env0_3;
const Loading = env1_10.Loading;
if (Loading === binding) {
if (onLoadStart != null) {
onLoadStart();
}
} else if (env1_10.Error === binding) {
if (onError != null) {
onError();
}
} else if (env1_10.Loaded === binding) {
if (onLoad != null) {
onLoad();
}
}
}
function _fun77762() { // fn#77762, offset: 0x01e0a73b, size: 11 bytes, params: 1, frame: 1
return _fun77763;
function _fun77763() { // fn#77763, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10122:1178, offset: 0x01e0a746, size: 29 bytes, params: 1, frame: 11
return global.clearTimeout(env1_6.current);
}
}
function MediaModalLoader(a0) { // fn#77754, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10122:559, offset: 0x01e0a213, size: 981 bytes, params: 2, frame: 34
var r0;
var Fragment;
var description;
const Text = (require(4573) /* metro dependency 4573: Text */).Text;
var intl;
const Component = a0.Component;
const style = a0.style;
const onLoadStart = a0.onLoadStart;
const onLoad = a0.onLoad;
const onError = a0.onError;
let index = a0.index;
let value = undefined;
index = index === value ? 0 : index;
const source = a0.source;
let object = {'Component': 0, 'style': 0, 'onLoadStart': 0, 'onLoad': 0, 'onError': 0, 'index': 0, 'source': 0};
const value3 = null;
silentSetPrototypeOf(object, value3, undefined);
const value4 = copyDataProperties({}, a0, object, undefined);
const env0_3 = value;
let env0_4 = value;
const styles = useStyles();
const binding = env0_4;
let useState = binding.useState;
const binding2 = env0_10;
const None = binding2.None;
const value6 = Reflect.apply(useState, binding, [None]);
const binding3 = env0_3;
const value7 = binding3(value6, 2);
const property = value7[0];
env0_4 = value7[1];
useState = binding.useState;
const value8 = binding3(Reflect.apply(useState, binding, [0]), 2);
const property2 = value8[0];
const env0_5 = value8[1];
const env0_6 = binding.useRef(value3);
const value9 = binding.useCallback(_fun77755, []);
const value10 = binding.useCallback(_fun77758, []);
const value11 = binding.useCallback(_fun77759, []);
const value12 = binding.useCallback(_fun77760, []);
binding.useEffect(_fun77761, [property, onLoadStart, onError, onLoad]);
binding.useEffect(function() {
return _fun77763;
});
const Error = binding2.Error;
if (property === Error) {
var viewBindingProps = {style: [styles.loader, style]};
var textProps = {'style': null, 'variant': 'heading-md/semibold', 'color': 'always-white',
style: styles.loaderText};
intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
r0 = <View {...viewBindingProps}><Text {...textProps}>{intl.string((require(1244) /* metro dependency 1244: indexNative */).t['+ITMYX'])}</Text></View>;
} else {
Fragment = env0_4.Fragment;
description = source.description;
object = [<Component {...value4} {...{['style']: style}} {...{['source']: source}} {...{['onLoadStart']: value9}} {...{['onProgress']: value10}} {...{['onLoad']: value11}} {...{['onError']: value12}} {...{['accessibilityRole']: 'image'}} {...{['accessibilityLabel']: value3 != description ? description : value}} {...{['loop']: true}} />];
object[1] = property !== env0_10.Loading ? value3 : <View style={[styles.loader,
style]}>{value3 == source.videoURI ? <Text style={styles.loaderText} variant="heading-md/semibold" color="always-white">{global.Math.round(property2)}{'%'}</Text> : value3}<ActivityIndicator color="white" style={styles.loaderIndicator} size="large" /></View>;
object[2] = ((Component) => <Component style={style} index={index} source={source} />)(importDefault(9937) /* metro dependency 9937: MediaModalSpoilerOverlay */);
value = <Fragment>{object}</Fragment>;
r0 = value;
}
return r0;
}
function _fun77755() { // fn#77755, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10122:794, offset: 0x01e0a5e8, size: 46 bytes, params: 1, frame: 14
const binding = env0_6;
const value = global.setTimeout(_fun77756, 1000);
binding.current = value;
return value;
}
function _fun77758({nativeEvent}) { // fn#77758, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10122:890, offset: 0x01e0a65b, size: 48 bytes, params: 2, frame: 12
env0_5(100 * nativeEvent.loaded / nativeEvent.total);
}
function _fun77759() { // fn#77759, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10122:961, offset: 0x01e0a68b, size: 29 bytes, params: 1, frame: 11
const binding = env0_4;
const Loaded = env1_10.Loaded;
return binding(Loaded);
}
function _fun77760() { // fn#77760, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10122:999, offset: 0x01e0a6a8, size: 28 bytes, params: 1, frame: 11
const binding = env0_4;
const Error = env1_10.Error;
return binding(Error);
}
function _fun77761() { // fn#77761, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10122:1039, offset: 0x01e0a6c4, size: 119 bytes, params: 1, frame: 11
const binding = env0_3;
const Loading = env1_10.Loading;
if (Loading === binding) {
if (onLoadStart != null) {
onLoadStart();
}
} else if (env1_10.Error === binding) {
if (onError != null) {
onError();
}
} else if (env1_10.Loaded === binding) {
if (onLoad != null) {
onLoad();
}
}
}
function _fun77762() { // fn#77762, offset: 0x01e0a73b, size: 11 bytes, params: 1, frame: 1
return _fun77763;
}
function _fun77756() { // fn#77756, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10122:820, offset: 0x01e0a616, size: 25 bytes, params: 1, frame: 11
env1_4(_fun77757);
}
function _fun77757(a0) { // fn#77757, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10122:828, offset: 0x01e0a62f, size: 44 bytes, params: 2, frame: 3
const None = env3_10.None;
return a0 === None ? env3_10.Loading : env3_10.None;
}
global.__d(_fun77753, 9936, [57, 31, 27, 33, 4501, 697, 4573, 1244, 9937,
2]) /* metro module 9936, dependencies: [57, 31, 27, 33, 4501, 697, 4573, 1244, 9937, 2] */;
@@ -1,35 +1,39 @@
/* Metro module 9557; source: modules/media_viewer/native/components/MediaModalSheetWrapper.tsx; dependencies: [31, 661, 33, 6513, 4080, 9558, 2] */
import ActionSheetContext from '../../../action_sheet/native/ActionSheetContext.tsx'; /* Metro dependency 6513 */
import * as FileImportTrackerModule from '../../../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
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 */
function _fun74613(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#74613, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9743:6, offset: 0x01d935fe, size: 160 bytes, params: 8, frame: 18
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_2 = importAll(31) /* metro dependency 31 */;
const env0_3 = (require(661) /* metro dependency 661: Constants */).MEDIA_MODAL_KEY;
const env0_4 = (require(33) /* metro dependency 33 */).jsx;
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/media_viewer/native/components/MediaModalSheetWrapper.tsx');
(FileImportTrackerModule).fileFinishedImporting('modules/media_viewer/native/components/MediaModalSheetWrapper.tsx');
exports.default = MediaModalSheetWrapper;
}
function MediaModalSheetWrapper(a0) { // fn#74614, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9743:255, offset: 0x01d9369e, size: 180 bytes, params: 2, frame: 21
const onCloseCallback = a0.onCloseCallback;
const value = Object.create(null);
value.onCloseCallback = 0;
const value2 = copyDataProperties({}, a0, value, undefined);
const binding = env0_2;
binding.useEffect(_fun74615,
[binding.useContext(importDefault(6513) /* metro dependency 6513: ActionSheetContext */)]);
return ((Component) => <Component {...value2} {...{['onClose']: binding.useCallback(function() {
if (onCloseCallback != null) {
onCloseCallback();
function MediaModalSheetWrapper(a0) { // fn#74614, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9743:255, offset: 0x01d9369e, size: 180 bytes, params: 2, frame: 21
const onCloseCallback = a0.onCloseCallback;
const value = Object.create(null);
value.onCloseCallback = 0;
const value2 = copyDataProperties({}, a0, value, undefined);
ReactModule.useEffect(_fun74615,
[ReactModule.useContext(ActionSheetContext)]);
return ((Component) => <Component {...value2} {...{['onClose']: ReactModule.useCallback(function() {
if (onCloseCallback != null) {
onCloseCallback();
}
importDefault(dependencyMap[4]).hideActionSheet(MEDIA_MODAL_KEY);
}, [onCloseCallback])}} />)(importDefault(9558) /* metro dependency 9558: MediaModal */);
function _fun74615() { // fn#74615, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9743:354, offset: 0x01d93752, size: 54 bytes, params: 1, frame: 11
const value2 = undefined;
if ((env0_1 == null ? value2 : env0_1.transitionState) === 'exiting') {
env0_1.onLeave();
}
return value2;
}
importDefault(dependencyMap[4]).hideActionSheet(MEDIA_MODAL_KEY);
}, [onCloseCallback])}} />)(importDefault(9558) /* metro dependency 9558: MediaModal */);
}
function _fun74615() { // fn#74615, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9743:354, offset: 0x01d93752, size: 54 bytes, params: 1, frame: 11
const value2 = undefined;
if ((env0_1 == null ? value2 : env0_1.transitionState) === 'exiting') {
env0_1.onLeave();
}
return value2;
}
global.__d(_fun74613, 9557, [31, 661, 33, 6513, 4080, 9558,
2]) /* metro module 9557, dependencies: [31, 661, 33, 6513, 4080, 9558, 2] */;
@@ -1,96 +1,136 @@
/* Metro module 9937; source: modules/media_viewer/native/components/MediaModalSpoilerOverlay.tsx; dependencies: [57, 31, 27, 33, 4501, 697, 477, 3860, 9808, 4017, 4564, 6692, 4573, 1244, 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 * 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 PlatformUtilsModule from '../../../../utils/PlatformUtils.tsx'; /* Metro dependency 477 */
import * as UseTokenModule from '../../../../design/tokens/native/useToken.tsx'; /* Metro dependency 3860 */
import * as CreateStylesModule from '../../../../design/components/Styles/native/createStyles.tsx'; /* Metro dependency 4501 */
import * as TextModule from '../../../../design/components/Text/native/Text.tsx'; /* Metro dependency 4573 */
import * as UseMediaItemSpoilerStateModule from '../useMediaItemSpoilerState.tsx'; /* Metro dependency 9808 */
function _fun77764(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#77764, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10123:6, offset: 0x01e0a763, size: 456 bytes, params: 8, frame: 26
var object2;
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_3 = importDefault(57) /* metro dependency 57 */;
let value = importAll(31) /* metro dependency 31 */;
const value2 = require(27) /* metro dependency 27 */;
const env0_4 = value2.StyleSheet;
const env0_5 = value2.View;
const value3 = require(33) /* metro dependency 33 */;
const env0_6 = value3.jsx;
const env0_7 = value3.jsxs;
const createStylesModule = require(4501) /* metro dependency 4501: createStyles */;
const createStyles = createStylesModule.createStyles;
object2 = {spoilerOverlayContainer: {'justifyContent': 'center', 'alignContent': 'center', 'flex': 1}};
let value = ReactModule;
const createStyles = CreateStylesModule.createStyles;
object = {spoilerOverlayContainer: {'justifyContent': 'center', 'alignContent': 'center', 'flex': 1}};
const PX_4 = (importDefault(697) /* metro dependency 697: native */).space.PX_4;
object2.obscureContentContainer = {'gap': null, 'justifyContent': 'center', 'alignItems': 'center',
object.obscureContentContainer = {'gap': null, 'justifyContent': 'center', 'alignItems': 'center',
'alignSelf': 'center', gap: PX_4};
const object4 = {};
const object3 = {};
const PX_16 = (importDefault(697) /* metro dependency 697: native */).space.PX_16;
object4.paddingHorizontal = PX_16;
object4.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.lg;
object3.paddingHorizontal = PX_16;
object3.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.lg;
const PX_32 = (importDefault(697) /* metro dependency 697: native */).space.PX_32;
object4.height = PX_32;
const isAndroid2 = (require(477) /* metro dependency 477: PlatformUtils */).isAndroid();
object3.height = PX_32;
const isAndroid2 = (PlatformUtilsModule).isAndroid();
const unsafe_rawColors = (importDefault(697) /* metro dependency 697: native */).unsafe_rawColors;
object4.backgroundColor = isAndroid2 ? unsafe_rawColors.PRIMARY_800 : unsafe_rawColors.PRIMARY_600;
object4.flexGrow = 0;
object4.justifyContent = 'center';
object4.alignItems = 'center';
object4.alignSelf = 'center';
object2.spoilerOverlayBackground = object4;
const env0_8 = Reflect.apply(createStyles, createStylesModule, [object2]);
object3.backgroundColor = isAndroid2 ? unsafe_rawColors.PRIMARY_800 : unsafe_rawColors.PRIMARY_600;
object3.flexGrow = 0;
object3.justifyContent = 'center';
object3.alignItems = 'center';
object3.alignSelf = 'center';
object.spoilerOverlayBackground = object3;
const env0_8 = Reflect.apply(createStyles, CreateStylesModule, [object]);
value = value.memo(MediaModalSpoilerOverlay);
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/media_viewer/native/components/MediaModalSpoilerOverlay.tsx');
(FileImportTrackerModule).fileFinishedImporting('modules/media_viewer/native/components/MediaModalSpoilerOverlay.tsx');
exports.default = value;
}
function MediaModalSpoilerOverlay({style, index, source}) { // fn#77765, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10123:714, offset: 0x01e0a92b, size: 692 bytes, params: 2, frame: 31
var r10;
var r9;
var r0;
var View2;
var object2;
var absoluteFill;
var VisualEffectView;
var obscure;
var items2;
const Text = (require(4573) /* metro dependency 4573: Text */).Text;
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
var items3;
var value;
const styles = useStyles();
const useTokenModule = require(3860) /* metro dependency 3860: useToken */;
const useToken = useTokenModule.useToken;
const SPOILER_HIDDEN_BACKGROUND = (importDefault(697) /* metro dependency 697: native */).colors.SPOILER_HIDDEN_BACKGROUND;
const value2 = Reflect.apply(useToken, useTokenModule, [SPOILER_HIDDEN_BACKGROUND]);
const value4 = env0_3((require(9808) /* metro dependency 9808: useMediaItemSpoilerState */).useMediaItemSpoilerState(index),
2);
if (value4[0]) {
View2 = (importDefault(4017) /* metro dependency 4017: ReanimatedRexport */).View;
object2 = {};
absoluteFill = StyleSheet.absoluteFill;
object2.style = [style, absoluteFill, value4[1]];
VisualEffectView = importDefault(4564) /* metro dependency 4564: VisualEffectView */;
obscure = source.obscure;
r10 = obscure || (require(477) /* metro dependency 477: PlatformUtils */).isAndroid() ? 'dark' : 'light';
absoluteFill = StyleSheet.absoluteFill;
items2 = [<VisualEffectView blurTheme={r10} android_fallbackColor={value2} style={absoluteFill} />];
var viewBindingProps = {style: styles.spoilerOverlayContainer};
obscure = source.obscure;
if (obscure) {
var viewBinding3Props = {style: styles.obscureContentContainer};
const ImageWarningIcon = (require(6692) /* metro dependency 6692: ImageWarningIcon */).ImageWarningIcon;
value = <ImageWarningIcon size="lg" color="white" />;
items3 = [value];
items3[1] = <Text accessibilityRole="text" variant="heading-md/medium" color="always-white">{intl.string((require(1244) /* metro dependency 1244: indexNative */).t.SpxcUR)}</Text>;
value = <View {...viewBinding3Props}>{items3}</View>;
r9 = value;
function MediaModalSpoilerOverlay({style, index, source}) { // fn#77765, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10123:714, offset: 0x01e0a92b, size: 692 bytes, params: 2, frame: 31
var r10;
var r9;
var r0;
var View2;
var object;
var absoluteFill;
var VisualEffectView;
var obscure;
var items2;
const Text = (TextModule).Text;
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
var items3;
var value;
const styles = useStyles();
const useToken = UseTokenModule.useToken;
const SPOILER_HIDDEN_BACKGROUND = (Native).colors.SPOILER_HIDDEN_BACKGROUND;
const value2 = Reflect.apply(useToken, UseTokenModule, [SPOILER_HIDDEN_BACKGROUND]);
const value4 = Module00057((UseMediaItemSpoilerStateModule).useMediaItemSpoilerState(index),
2);
if (value4[0]) {
View2 = (importDefault(4017) /* metro dependency 4017: ReanimatedRexport */).View;
object = {};
absoluteFill = StyleSheet.absoluteFill;
object.style = [style, absoluteFill, value4[1]];
VisualEffectView = importDefault(4564) /* metro dependency 4564: VisualEffectView */;
obscure = source.obscure;
r10 = obscure || (require(477) /* metro dependency 477: PlatformUtils */).isAndroid() ? 'dark' : 'light';
absoluteFill = StyleSheet.absoluteFill;
items2 = [
<VisualEffectView
blurTheme={r10}
android_fallbackColor={value2}
style={absoluteFill}
/>,
];
var viewBindingProps = {style: styles.spoilerOverlayContainer};
obscure = source.obscure;
if (obscure) {
var viewBinding3Props = {style: styles.obscureContentContainer};
const ImageWarningIcon = (require(6692) /* metro dependency 6692: ImageWarningIcon */).ImageWarningIcon;
value = <ImageWarningIcon size="lg" color="white" />;
items3 = [value];
items3[1] = (
<Text
accessibilityRole="text"
variant="heading-md/medium"
color="always-white"
>
{intl.string((require(1244) /* metro dependency 1244: indexNative */).t.SpxcUR)}
</Text>
);
value = (
<View {...viewBinding3Props}>
{items3}
</View>
);
r9 = value;
} else {
var viewBinding2Props = {style: styles.spoilerOverlayBackground};
value = intl.string((require(1244) /* metro dependency 1244: indexNative */).t['F+x38C']);
value = (
<View {...viewBinding2Props}>
<Text
accessibilityRole="text"
variant="heading-md/medium"
color="always-white"
>
{value.toUpperCase()}
</Text>
</View>
);
r9 = value;
}
items2[1] = (
<View {...viewBindingProps}>
{r9}
</View>
);
value = (
<View2 {...object}>
{items2}
</View2>
);
r0 = value;
} else {
var viewBinding2Props = {style: styles.spoilerOverlayBackground};
value = intl.string((require(1244) /* metro dependency 1244: indexNative */).t['F+x38C']);
value = <View {...viewBinding2Props}><Text accessibilityRole="text" variant="heading-md/medium" color="always-white">{value.toUpperCase()}</Text></View>;
r9 = value;
r0 = null;
}
items2[1] = <View {...viewBindingProps}>{r9}</View>;
value = <View2 {...object2}>{items2}</View2>;
r0 = value;
} else {
r0 = null;
return r0;
}
return r0;
}
global.__d(_fun77764, 9937, [57, 31, 27, 33, 4501, 697, 477, 3860, 9808, 4017, 4564, 6692, 4573, 1244,
2]) /* metro module 9937, dependencies: [57, 31, 27, 33, 4501, 697, 477, 3860, 9808, 4017, 4564, 6692, 4573, 1244, 2] */;
@@ -1,6 +1,13 @@
/* Metro module 9565; source: modules/media_viewer/native/components/MediaModalTiktok.tsx; dependencies: [57, 31, 33, 9566, 6266, 9547, 9551, 9552, 2] */
import Module00057 from '../../../../by-id/module-00057.js'; /* Metro dependency 57 */
import UsePrevious from '../../../../hooks/usePrevious.tsx'; /* Metro dependency 6266 */
import MediaModalWebView from './MediaModalWebView.tsx'; /* Metro dependency 9566 */
import * as FileImportTrackerModule from '../../../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
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 MediaModalWebViewModule from './MediaModalWebView.tsx'; /* Metro dependency 9566 */
function _fun74694(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#74694, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9751:6, offset: 0x01d96d41, size: 356 bytes, params: 8, frame: 19
var object2;
const env0_0 = require;
const getReadablePlayerError = function(a0) {
if (a0 === '1') {
@@ -17,7 +24,7 @@ function _fun74694(global, require, importDefault, importAll, module, exports, d
}
return 'UNKNOWN';
};
const postMessage = function(a0, a1) {
const postMessage_74696 = function(a0, a1) {
var r5;
var property = global.JSON;
var object = {};
@@ -31,320 +38,331 @@ function _fun74694(global, require, importDefault, importAll, module, exports, d
};
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_3 = importDefault(57) /* metro dependency 57 */;
let value = importAll(31) /* metro dependency 31 */;
const env0_5 = (require(33) /* metro dependency 33 */).jsx;
let value = ReactModule;
const env0_5 = (JsxRuntimeModule).jsx;
const env0_6 = {'controls': 0, 'enable_music_info': 0, 'enable_timestamp': 0, 'utm_source': 'discord.gg'};
object2 = {};
const PlayerState = (require(9566) /* metro dependency 9566: MediaModalWebView */).PlayerState;
object = {};
const PlayerState = (MediaModalWebViewModule).PlayerState;
const UNSTARTED = PlayerState.UNSTARTED;
object2['-1'] = UNSTARTED;
object['-1'] = UNSTARTED;
const ENDED = PlayerState.ENDED;
object2[0] = ENDED;
object[0] = ENDED;
const PLAYING = PlayerState.PLAYING;
object2[1] = PLAYING;
object[1] = PLAYING;
const PAUSED = PlayerState.PAUSED;
object2[2] = PAUSED;
object[2] = PAUSED;
const BUFFERING = PlayerState.BUFFERING;
object2[3] = BUFFERING;
object[3] = BUFFERING;
value = value.memo(_fun74697);
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/media_viewer/native/components/MediaModalTiktok.tsx');
(FileImportTrackerModule).fileFinishedImporting('modules/media_viewer/native/components/MediaModalTiktok.tsx');
exports.default = value;
exports.createTiktokVideoControls = createTiktokVideoControls;
}
function _fun74697(a0) { // fn#74697, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9751:798, offset: 0x01d96f58, size: 535 bytes, params: 2, frame: 29
const visible = a0.visible;
const style = a0.style;
const source = a0.source;
const controls = a0.controls;
const object2 = {'visible': 0, 'style': 0, 'source': 0, 'controls': 0};
silentSetPrototypeOf(object2, null, undefined);
const value = copyDataProperties({}, a0, object2, undefined);
const value2 = undefined;
let binding = env0_4;
const useState = binding.useState;
const PlayerState = (require(9566) /* metro dependency 9566: MediaModalWebView */).PlayerState;
const UNREADY = PlayerState.UNREADY;
const value5 = env0_3(Reflect.apply(useState, binding, [UNREADY]), 2);
const property = value5[0];
var env0_4 = value5[1];
const value6 = (importDefault(6266) /* metro dependency 6266: usePrevious */)(property);
const value7 = (importDefault(6266) /* metro dependency 6266: usePrevious */)(visible);
const ref = controls == null || controls.props == null ? value2 : controls.props.ref;
const value8 = env0_4.useCallback(_fun74698, [controls == null ? value2 : controls.props]);
const value9 = (require(9552) /* metro dependency 9552: MediaPlayerMuteManager */).useMediaPlayerMutedStore(function(a0) {
return a0.isMuted;
});
binding = env0_4;
binding.useEffect(_fun74700, [ref, visible, value7, value6, property, value9]);
binding.useEffect(function() {
var MediaViewerAnalytics = require(dependencyMap[5]).MediaViewerAnalytics;
MediaViewerAnalytics.trackMessageEmbedsActionCompleted({'platform': 'tiktok', 'action': 'attempted'});
}, []);
const value10 = binding.useMemo(_fun74702, [source.uri]);
const MediaModalWebView = importDefault(9566) /* metro dependency 9566: MediaModalWebView */;
const object4 = {};
copyDataProperties(object4, source, object2);
object4['uri'] = value10;
return (
<MediaModalWebView
ref={ref}
style={style}
source={object4}
baseURL="https://www.tiktok.com/player/v1/"
injectedJavaScript={'\n window.addEventListener(\'message\', function(event) {\n if (!event.data["x-tiktok-player"]) {\n return;\n }\n window.ReactNativeWebView.postMessage(JSON.stringify(event.data));\n }, true);\n'}
onDataReceived={value8}
playerState={property}
{...value}
/>
);
}
function createTiktokVideoControls() { // fn#74704, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9751:2927, offset: 0x01d97629, size: 125 bytes, params: 1, frame: 11
return {seek: seek_74705, pause: pause_74706, useSubscribe: useSubscribe, props: {ref: env0_4.createRef(),
onPlayerStateChange: onPlayerStateChange, onCurrentSecond: onCurrentSecond, onDuration: onDuration}};
}
function _fun74698(a0) { // fn#74698, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9751:1009, offset: 0x01d9716f, size: 526 bytes, params: 2, frame: 16
var r1;
var r6;
var r3;
var r4;
var value2;
var moduleValue;
var setMuted;
var value4;
var value5;
var props;
var value9;
var onDuration;
var binding;
var value13;
const PlayerState = (require(9566) /* metro dependency 9566: MediaModalWebView */).PlayerState;
var MediaViewerAnalytics;
var trackMessageEmbedsActionCompleted;
var object2;
var getReadablePlayerErrorBinding;
var value14;
var property;
var value15;
const JSON = global.JSON;
let value = JSON.parse(a0);
const type = value.type;
if (type === 'onPlayerReady') {
function _fun74697(a0) { // fn#74697, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9751:798, offset: 0x01d96f58, size: 535 bytes, params: 2, frame: 29
const visible = a0.visible;
const style = a0.style;
const source = a0.source;
const controls = a0.controls;
const object = {'visible': 0, 'style': 0, 'source': 0, 'controls': 0};
silentSetPrototypeOf(object, null, undefined);
const value = copyDataProperties({}, a0, object, undefined);
const value2 = undefined;
let binding = env0_4;
const useState = binding.useState;
const PlayerState = (MediaModalWebViewModule).PlayerState;
const UNREADY = PlayerState.UNREADY;
const value5 = Module00057(Reflect.apply(useState, binding, [UNREADY]), 2);
const property = value5[0];
var env0_4 = value5[1];
const value6 = (UsePrevious)(property);
const value7 = (UsePrevious)(visible);
const ref = controls == null || controls.props == null ? value2 : controls.props.ref;
const value8 = env0_4.useCallback(_fun74698, [controls == null ? value2 : controls.props]);
const value9 = (require(9552) /* metro dependency 9552: MediaPlayerMuteManager */).useMediaPlayerMutedStore(function(a0) {
return a0.isMuted;
});
binding = env0_4;
value = environment.__proto__;
binding(PlayerState.READY);
} else if (type === 'onStateChange') {
value14 = environment.__proto__;
binding = env1_7;
value = value.value;
property = binding[value];
if (property != null) {
value15 = controls == null;
if (value15) {
r3 = value15;
r4 = undefined;
binding.useEffect(_fun74700, [ref, visible, value7, value6, property, value9]);
binding.useEffect(function() {
var MediaViewerAnalytics = require(dependencyMap[5]).MediaViewerAnalytics;
MediaViewerAnalytics.trackMessageEmbedsActionCompleted({'platform': 'tiktok', 'action': 'attempted'});
}, []);
const value10 = binding.useMemo(_fun74702, [source.uri]);
const object3 = {};
copyDataProperties(object3, source, object);
object3['uri'] = value10;
return (
<MediaModalWebView
ref={ref}
style={style}
source={object3}
baseURL="https://www.tiktok.com/player/v1/"
injectedJavaScript={'\n window.addEventListener(\'message\', function(event) {\n if (!event.data["x-tiktok-player"]) {\n return;\n }\n window.ReactNativeWebView.postMessage(JSON.stringify(event.data));\n }, true);\n'}
onDataReceived={value8}
playerState={property}
{...value}
/>
);
function _fun74698(a0) { // fn#74698, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9751:1009, offset: 0x01d9716f, size: 526 bytes, params: 2, frame: 16
var r1;
var r6;
var r3;
var r4;
var value2;
var moduleValue;
var setMuted;
var value4;
var value5;
var props;
var value9;
var onDuration;
var binding;
var value13;
const PlayerState = (MediaModalWebViewModule).PlayerState;
var MediaViewerAnalytics;
var trackMessageEmbedsActionCompleted;
var object;
var getReadablePlayerErrorBinding;
var value14;
var property;
var value15;
const JSON = global.JSON;
let value = JSON.parse(a0);
const type = value.type;
if (type === 'onPlayerReady') {
binding = env0_4;
value = environment.__proto__;
binding(PlayerState.READY);
} else if (type === 'onStateChange') {
value14 = environment.__proto__;
binding = env1_7;
value = value.value;
property = binding[value];
if (property != null) {
value15 = controls == null;
if (value15) {
r3 = value15;
r4 = undefined;
} else {
props = controls.props;
r3 = props == null;
r4 = props;
}
if (!r3) {
r4.onPlayerStateChange(property);
}
env0_4(property);
}
} else if (type === 'onError') {
binding = env0_4;
value13 = environment.__proto__;
binding(PlayerState.ERRORED);
MediaViewerAnalytics = (require(9547) /* metro dependency 9547: MediaViewerAnalyticsManager */).MediaViewerAnalytics;
trackMessageEmbedsActionCompleted = MediaViewerAnalytics.trackMessageEmbedsActionCompleted;
object = {'platform': 'tiktok', 'action': 'errored'};
getReadablePlayerErrorBinding = getReadablePlayerError;
value = value.value;
object.error = getReadablePlayerErrorBinding(value);
Reflect.apply(trackMessageEmbedsActionCompleted, MediaViewerAnalytics, [object]);
} else if (type === 'onCurrentTime') {
value4 = controls == null;
value5 = undefined;
if (value4) {
r1 = value4;
r6 = value5;
} else {
props = controls.props;
r1 = props == null;
r6 = props;
}
r1 = !r1 ? r6.onCurrentSecond == null : r1;
if (!r1) {
r6.onCurrentSecond(value.value.currentTime);
}
value9 = controls == null;
if (value9) {
r1 = value9;
r3 = value5;
} else {
props = controls.props;
r1 = props == null;
r3 = props;
}
r1 = !r1 ? r3.onDuration == null : r1;
if (!r1) {
onDuration = r3.onDuration;
value = value.value;
Reflect.apply(onDuration, r3, [value.duration]);
}
} else if (type === 'onMute') {
value2 = environment.__proto__;
moduleValue = require(9551) /* metro dependency 9551: useVideoControls */;
setMuted = moduleValue.setMuted;
value = value.value;
Reflect.apply(setMuted, moduleValue, [value]);
}
}
function _fun74700() { // fn#74700, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9751:1740, offset: 0x01d9737d, size: 429 bytes, params: 1, frame: 16
var r1;
var binding;
var value4;
const PlayerState = (MediaModalWebViewModule).PlayerState;
var value10;
var postMessage_74696Binding;
var value12;
var value14;
var value15;
const refBinding = ref;
const value2 = undefined;
const value3 = (refBinding == null ? value2 : ref.current) != null;
if (value3) {
binding = Module00057;
value4 = environment.__proto__;
r1 = binding !== PlayerState.UNREADY;
} else {
props = controls.props;
r3 = props == null;
r4 = props;
r1 = value3;
}
if (!r3) {
r4.onPlayerStateChange(property);
if (r1) {
r1 = visible && env0_5 === PlayerState.UNREADY;
r1 = r1 && Module00057 === PlayerState.READY;
if (r1) {
value10 = environment.__proto__;
postMessage_74696(ref, {type: 'play'});
}
r1 = visible && !env0_6;
if (r1) {
value12 = environment.__proto__;
postMessage_74696(ref, {type: 'play'});
}
r1 = !visible && env0_6;
if (r1) {
value14 = environment.__proto__;
postMessage_74696(ref, {type: 'pause'});
}
binding = Module00057;
value15 = environment.__proto__;
if (binding === PlayerState.ENDED) {
postMessage_74696Binding = postMessage_74696;
postMessage_74696Binding(ref, {'type': 'seekTo', 'value': 0});
postMessage_74696Binding(ref, {type: 'play'});
}
postMessage_74696(ref, {type: env0_8 ? 'mute' : 'unMute'});
}
env0_4(property);
return value2;
}
} else if (type === 'onError') {
binding = env0_4;
value13 = environment.__proto__;
binding(PlayerState.ERRORED);
MediaViewerAnalytics = (require(9547) /* metro dependency 9547: MediaViewerAnalyticsManager */).MediaViewerAnalytics;
trackMessageEmbedsActionCompleted = MediaViewerAnalytics.trackMessageEmbedsActionCompleted;
object2 = {'platform': 'tiktok', 'action': 'errored'};
getReadablePlayerErrorBinding = getReadablePlayerError;
value = value.value;
object2.error = getReadablePlayerErrorBinding(value);
Reflect.apply(trackMessageEmbedsActionCompleted, MediaViewerAnalytics, [object2]);
} else if (type === 'onCurrentTime') {
value4 = controls == null;
value5 = undefined;
if (value4) {
r1 = value4;
r6 = value5;
} else {
props = controls.props;
r1 = props == null;
r6 = props;
function _fun74702() { // fn#74702, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9751:2290, offset: 0x01d97564, size: 98 bytes, params: 1, frame: 13
const URL = global.URL;
const uRL = new URL(source.uri);
const Object = global.Object;
Object.entries(env1_6).forEach(_fun74703);
return uRL.toString();
function _fun74703(a0) { // fn#74703, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9751:2350, offset: 0x01d975c6, size: 99 bytes, params: 2, frame: 17
var r1;
var r2;
var r5;
var item3;
var value3;
const iterator = a0[Symbol.iterator]();
const iterator2 = iterator.next;
let item2 = Reflect.apply(iterator2, iterator, []);
let item = item2.value;
item2 = item2.done ? undefined : iterator;
const value = undefined;
const value2 = item2 === value;
const r4 = value2 ? value : item;
if (value2) {
r1 = item2;
r2 = value2;
r5 = value;
} else {
item3 = Reflect.apply(iterator2, item2, []);
item = item3.value;
item3 = item3.done ? undefined : item2;
value3 = item3 === value;
if (value3) {
r1 = item3;
r2 = value3;
r5 = value;
} else {
r1 = item3;
r2 = value3;
r5 = item;
}
}
if (!r2) {
r1.return();
}
const searchParams = env0_0.searchParams;
searchParams.append(r4, r5.toString());
return value;
}
}
r1 = !r1 ? r6.onCurrentSecond == null : r1;
if (!r1) {
r6.onCurrentSecond(value.value.currentTime);
}
value9 = controls == null;
if (value9) {
r1 = value9;
r3 = value5;
} else {
props = controls.props;
r1 = props == null;
r3 = props;
}
r1 = !r1 ? r3.onDuration == null : r1;
if (!r1) {
onDuration = r3.onDuration;
value = value.value;
Reflect.apply(onDuration, r3, [value.duration]);
}
} else if (type === 'onMute') {
value2 = environment.__proto__;
moduleValue = require(9551) /* metro dependency 9551: useVideoControls */;
setMuted = moduleValue.setMuted;
value = value.value;
Reflect.apply(setMuted, moduleValue, [value]);
}
}
function _fun74700() { // fn#74700, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9751:1740, offset: 0x01d9737d, size: 429 bytes, params: 1, frame: 16
var r1;
var binding;
var value4;
const PlayerState = (require(9566) /* metro dependency 9566: MediaModalWebView */).PlayerState;
var value10;
var postMessageBinding;
var value12;
var value14;
var value15;
const refBinding = ref;
const value2 = undefined;
const value3 = (refBinding == null ? value2 : ref.current) != null;
if (value3) {
binding = env0_3;
value4 = environment.__proto__;
r1 = binding !== PlayerState.UNREADY;
} else {
r1 = value3;
}
if (r1) {
r1 = visible && env0_5 === PlayerState.UNREADY;
r1 = r1 && env0_3 === PlayerState.READY;
if (r1) {
value10 = environment.__proto__;
postMessage(ref, {type: 'play'});
}
r1 = visible && !env0_6;
if (r1) {
value12 = environment.__proto__;
postMessage(ref, {type: 'play'});
}
r1 = !visible && env0_6;
if (r1) {
value14 = environment.__proto__;
postMessage(ref, {type: 'pause'});
}
binding = env0_3;
value15 = environment.__proto__;
if (binding === PlayerState.ENDED) {
postMessageBinding = postMessage;
postMessageBinding(ref, {'type': 'seekTo', 'value': 0});
postMessageBinding(ref, {type: 'play'});
}
postMessage(ref, {type: env0_8 ? 'mute' : 'unMute'});
}
return value2;
}
function _fun74702() { // fn#74702, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9751:2290, offset: 0x01d97564, size: 98 bytes, params: 1, frame: 13
const URL = global.URL;
const uRL = new URL(source.uri);
const Object = global.Object;
Object.entries(env1_6).forEach(_fun74703);
return uRL.toString();
}
function createTiktokVideoControlsSeek(a0) { // fn#74705, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9751:3008, owner: createTiktokVideoControls.seek, offset: 0x01d976a6, size: 43 bytes, params: 2, frame: 13
postMessage(env0_2, {type: 'seekTo', value: a0});
}
function createTiktokVideoControlsPause(a0) { // fn#74706, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9751:3056, owner: createTiktokVideoControls.pause, offset: 0x01d976d1, size: 58 bytes, params: 2, frame: 14
var value2;
var postMessageBinding;
var binding;
if (env0_5 !== a0) {
value2 = environment.__proto__;
postMessageBinding = postMessage;
binding = env0_2;
env0_5 = a0;
postMessageBinding(binding, {type: a0 ? 'pause' : 'play'});
}
}
function createTiktokVideoControlsUseSubscribe(a0, a1, a2) { // fn#74707, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9751:3121, owner: createTiktokVideoControls.useSubscribe, offset: 0x01d9770b, size: 53 bytes, params: 4, frame: 13
env0_0 = a0;
env0_1 = a1;
env1_4.useLayoutEffect(_fun74708, []);
}
function createTiktokVideoControlsOnCurrentSecond(a0) { // fn#74710, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9751:3321, owner: createTiktokVideoControls.onCurrentSecond, offset: 0x01d977e6, size: 44 bytes, params: 2, frame: 13
if (env0_0 != null) {
env0_0(a0, env0_4);
}
}
function createTiktokVideoControlsOnDuration(a0) { // fn#74711, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9751:3361, owner: createTiktokVideoControls.onDuration, offset: 0x01d97812, size: 44 bytes, params: 2, frame: 13
if (env0_0 != null) {
env0_0(env0_3, a0);
}
}
function _fun74703(a0) { // fn#74703, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9751:2350, offset: 0x01d975c6, size: 99 bytes, params: 2, frame: 17
var r1;
var r2;
var r5;
var item3;
var value3;
const iterator = a0[Symbol.iterator]();
const iterator2 = iterator.next;
let item2 = Reflect.apply(iterator2, iterator, []);
let item = item2.value;
item2 = item2.done ? undefined : iterator;
const value = undefined;
const value2 = item2 === value;
const r4 = value2 ? value : item;
if (value2) {
r1 = item2;
r2 = value2;
r5 = value;
} else {
item3 = Reflect.apply(iterator2, item2, []);
item = item3.value;
item3 = item3.done ? undefined : item2;
value3 = item3 === value;
if (value3) {
r1 = item3;
r2 = value3;
r5 = value;
} else {
r1 = item3;
r2 = value3;
r5 = item;
}
}
if (!r2) {
r1.return();
}
const searchParams = env0_0.searchParams;
searchParams.append(r4, r5.toString());
return value;
}
function _fun74708() { // fn#74708, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9751:3168, offset: 0x01d97740, size: 60 bytes, params: 1, frame: 15
if (env1_0 != null) {
env1_0(env1_3, env1_4);
}
if (env1_1 != null) {
env1_1(env1_5);
}
function createTiktokVideoControls() { // fn#74704, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9751:2927, offset: 0x01d97629, size: 125 bytes, params: 1, frame: 11
return {seek: seek_74705, pause: pause_74706, useSubscribe: useSubscribe_74707, props: {ref: env0_4.createRef(),
onPlayerStateChange: onPlayerStateChange, onCurrentSecond: onCurrentSecond, onDuration: onDuration}};
function createTiktokVideoControlsSeek(a0) { // fn#74705, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9751:3008, owner: createTiktokVideoControls.seek, offset: 0x01d976a6, size: 43 bytes, params: 2, frame: 13
postMessage_74696(env0_2, {type: 'seekTo', value: a0});
}
function createTiktokVideoControlsPause(a0) { // fn#74706, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9751:3056, owner: createTiktokVideoControls.pause, offset: 0x01d976d1, size: 58 bytes, params: 2, frame: 14
var value2;
var postMessage_74696Binding;
var binding;
if (env0_5 !== a0) {
value2 = environment.__proto__;
postMessage_74696Binding = postMessage_74696;
binding = env0_2;
env0_5 = a0;
postMessage_74696Binding(binding, {type: a0 ? 'pause' : 'play'});
}
}
function createTiktokVideoControlsUseSubscribe(a0, a1, a2) { // fn#74707, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9751:3121, owner: createTiktokVideoControls.useSubscribe, offset: 0x01d9770b, size: 53 bytes, params: 4, frame: 13
env0_0 = a0;
env0_1 = a1;
env1_4.useLayoutEffect(_fun74708, []);
function _fun74708() { // fn#74708, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9751:3168, offset: 0x01d97740, size: 60 bytes, params: 1, frame: 15
if (env1_0 != null) {
env1_0(env1_3, env1_4);
}
if (env1_1 != null) {
env1_1(env1_5);
}
}
}
function createTiktokVideoControlsOnPlayerStateChange(a0) { // fn#74709, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9751:3223, owner: createTiktokVideoControls.onPlayerStateChange, offset: 0x01d9777c, size: 106 bytes, params: 2, frame: 15
var binding;
const PlayerState = (MediaModalWebViewModule).PlayerState;
var value;
if (env0_1 != null) {
binding = env0_1;
value = environment.__proto__;
binding(a0 === PlayerState.PAUSED || a0 === PlayerState.ENDED);
}
}
function createTiktokVideoControlsOnCurrentSecond(a0) { // fn#74710, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9751:3321, owner: createTiktokVideoControls.onCurrentSecond, offset: 0x01d977e6, size: 44 bytes, params: 2, frame: 13
if (env0_0 != null) {
env0_0(a0, env0_4);
}
}
function createTiktokVideoControlsOnDuration(a0) { // fn#74711, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9751:3361, owner: createTiktokVideoControls.onDuration, offset: 0x01d97812, size: 44 bytes, params: 2, frame: 13
if (env0_0 != null) {
env0_0(Module00057, a0);
}
}
}
}
global.__d(_fun74694, 9565, [57, 31, 33, 9566, 6266, 9547, 9551, 9552,
2]) /* metro module 9565, dependencies: [57, 31, 33, 9566, 6266, 9547, 9551, 9552, 2] */;
@@ -1,11 +1,17 @@
/* Metro module 9567; source: modules/media_viewer/native/components/MediaModalWebVideoFile.tsx; dependencies: [57, 31, 33, 9566, 6266, 9547, 9552, 2] */
import Module00057 from '../../../../by-id/module-00057.js'; /* Metro dependency 57 */
import UsePrevious from '../../../../hooks/usePrevious.tsx'; /* Metro dependency 6266 */
import MediaModalWebView from './MediaModalWebView.tsx'; /* Metro dependency 9566 */
import * as FileImportTrackerModule from '../../../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
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 MediaModalWebViewModule from './MediaModalWebView.tsx'; /* Metro dependency 9566 */
function _fun74719(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#74719, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9753:6, offset: 0x01d97f0e, size: 234 bytes, params: 8, frame: 20
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_3 = importDefault(57) /* metro dependency 57 */;
let value = importAll(31) /* metro dependency 31 */;
const env0_5 = (require(33) /* metro dependency 33 */).jsx;
let value = ReactModule;
const GLOBAL_ENV = global.window.GLOBAL_ENV;
const WEBAPP_ENDPOINT = GLOBAL_ENV.WEBAPP_ENDPOINT;
const env0_6 = 'https:' + WEBAPP_ENDPOINT;
@@ -16,326 +22,338 @@ function _fun74719(global, require, importDefault, importAll, module, exports, d
return '\n<html>\n <head>\n <meta name="viewport" content="initial-scale=1">\n <style>\n * {\n margin: 0;\n padding: 0;\n inset: 0;\n width: 100%;\n height: 100%;\n background-color: #000;\n object-fit: contain;\n }\n </style>\n <script>' + value + '</script>\n </head>\n <body>\n </body>\n</html>\n';
};
value = value.memo(_fun74721);
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/media_viewer/native/components/MediaModalWebVideoFile.tsx');
(FileImportTrackerModule).fileFinishedImporting('modules/media_viewer/native/components/MediaModalWebVideoFile.tsx');
exports.default = value;
exports.createWebFileVideoControls = createWebFileVideoControls;
}
function _fun74721(a0) { // fn#74721, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9753:1721, offset: 0x01d9804a, size: 510 bytes, params: 2, frame: 29
const visible = a0.visible;
const style = a0.style;
const source = a0.source;
const controls = a0.controls;
const object2 = {'visible': 0, 'style': 0, 'source': 0, 'controls': 0};
silentSetPrototypeOf(object2, null, undefined);
const value = copyDataProperties({}, a0, object2, undefined);
const value2 = undefined;
let binding = env0_4;
const useState = binding.useState;
const PlayerState = (require(9566) /* metro dependency 9566: MediaModalWebView */).PlayerState;
const UNREADY = PlayerState.UNREADY;
const value5 = env0_3(Reflect.apply(useState, binding, [UNREADY]), 2);
const property = value5[0];
var env0_3 = value5[1];
const value6 = (importDefault(6266) /* metro dependency 6266: usePrevious */)(property);
var env0_4 = value6;
const value7 = (importDefault(6266) /* metro dependency 6266: usePrevious */)(visible);
const ref = controls == null || controls.props == null ? value2 : controls.props.ref;
const env0_6 = ref;
binding = env0_4;
binding.useEffect(function() {
var MediaViewerAnalytics = require(dependencyMap[5]).MediaViewerAnalytics;
MediaViewerAnalytics.trackMessageEmbedsActionCompleted({'platform': 'file', 'action': 'attempted'});
}, []);
const value8 = binding.useCallback(_fun74723, [controls == null ? value2 : controls.props]);
env0_4.useEffect(_fun74725, [ref, visible, value7, value6, property,
(require(9552) /* metro dependency 9552: MediaPlayerMuteManager */).useMediaPlayerMutedStore(function(a0) {
return a0.isMuted;
})]);
const value10 = HTML(source.uri);
const MediaModalWebView = importDefault(9566) /* metro dependency 9566: MediaModalWebView */;
binding = env0_6;
return (
<MediaModalWebView
ref={ref}
style={style}
source={{html: value10, baseUrl: binding}}
baseURL={binding}
playerState={property}
onDataReceived={value8}
javaScriptEnabled
javaScriptCanOpenWindowsAutomatically
{...value}
key={source.uri}
/>
);
}
function createWebFileVideoControls() { // fn#74726, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9753:4220, offset: 0x01d988a2, size: 146 bytes, params: 1, frame: 11
return {seek: seek_74728, pause: pause_74729, useSubscribe: useSubscribe, props: {ref: env0_4.createRef(),
onPlayerStateChange: onPlayerStateChange, onCurrentSecond: onCurrentSecond, onDuration: onDuration,
onDownloadProgress: function(a0) {
env0_6 = a0;
updateProgress();
}}};
}
function _fun74723(a0) { // fn#74723, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9753:2061, offset: 0x01d98282, size: 1198 bytes, params: 2, frame: 15
var r0;
var r1;
var r4;
var JSON;
var value;
var error;
var value3;
var props;
var value8;
var value13;
var value17;
var onPlayerStateChange;
var value20;
const PlayerState = (require(9566) /* metro dependency 9566: MediaModalWebView */).PlayerState;
var binding;
var value21;
var value24;
var value25;
var value28;
var value29;
var value32;
var value33;
var value36;
try {
JSON = global.JSON;
value = JSON.parse(a0);
r0 = value;
} catch (error) {
r0 = {};
}
const type = r0.type;
value = r0.value;
if (type === 'loaded') {
binding = env0_3;
value = environment.__proto__;
binding(PlayerState.READY);
} else if (type === 'canplay') {
value33 = controls == null;
if (value33) {
r1 = value33;
r4 = undefined;
} else {
props = controls.props;
r1 = props == null;
r4 = props;
}
if (!r1) {
onPlayerStateChange = r4.onPlayerStateChange;
value36 = environment.__proto__;
Reflect.apply(onPlayerStateChange, r4, [PlayerState.VIDEO_CUED]);
}
binding = env0_3;
value = environment.__proto__;
binding(PlayerState.VIDEO_CUED);
} else if (type === 'error') {
binding = env0_3;
value = environment.__proto__;
binding(PlayerState.ERRORED);
(require(9547) /* metro dependency 9547: MediaViewerAnalyticsManager */).MediaViewerAnalytics.trackMessageEmbedsActionCompleted({'platform': 'file',
'action': 'errored', 'error': 'unknown'});
} else if (type === 'ended') {
value29 = controls == null;
if (value29) {
r1 = value29;
r4 = undefined;
} else {
props = controls.props;
r1 = props == null;
r4 = props;
}
if (!r1) {
onPlayerStateChange = r4.onPlayerStateChange;
value32 = environment.__proto__;
Reflect.apply(onPlayerStateChange, r4, [PlayerState.ENDED]);
}
binding = env0_3;
value = environment.__proto__;
binding(PlayerState.ENDED);
} else if (type === 'play') {
value25 = controls == null;
if (value25) {
r1 = value25;
r4 = undefined;
} else {
props = controls.props;
r1 = props == null;
r4 = props;
}
if (!r1) {
onPlayerStateChange = r4.onPlayerStateChange;
value28 = environment.__proto__;
Reflect.apply(onPlayerStateChange, r4, [PlayerState.PLAYING]);
}
binding = env0_3;
value = environment.__proto__;
binding(PlayerState.PLAYING);
} else if (type === 'pause') {
value21 = controls == null;
if (value21) {
r1 = value21;
r4 = undefined;
} else {
props = controls.props;
r1 = props == null;
r4 = props;
}
if (!r1) {
onPlayerStateChange = r4.onPlayerStateChange;
value24 = environment.__proto__;
Reflect.apply(onPlayerStateChange, r4, [PlayerState.PAUSED]);
}
binding = env0_3;
value = environment.__proto__;
binding(PlayerState.PAUSED);
} else if (type === 'stalled') {
value17 = controls == null;
if (value17) {
r1 = value17;
r4 = undefined;
} else {
props = controls.props;
r1 = props == null;
r4 = props;
}
if (!r1) {
onPlayerStateChange = r4.onPlayerStateChange;
value20 = environment.__proto__;
Reflect.apply(onPlayerStateChange, r4, [PlayerState.BUFFERING]);
}
binding = env0_3;
value = environment.__proto__;
binding(PlayerState.BUFFERING);
} else if (type === 'durationchange') {
if (value != null) {
value13 = controls == null;
if (value13) {
r0 = value13;
r1 = undefined;
} else {
props = controls.props;
r0 = props == null;
r1 = props;
function _fun74721(a0) { // fn#74721, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9753:1721, offset: 0x01d9804a, size: 510 bytes, params: 2, frame: 29
const visible = a0.visible;
const style = a0.style;
const source = a0.source;
const controls = a0.controls;
const object = {'visible': 0, 'style': 0, 'source': 0, 'controls': 0};
silentSetPrototypeOf(object, null, undefined);
const value = copyDataProperties({}, a0, object, undefined);
const value2 = undefined;
let binding = env0_4;
const useState = binding.useState;
const PlayerState = (MediaModalWebViewModule).PlayerState;
const UNREADY = PlayerState.UNREADY;
const value5 = env0_3(Reflect.apply(useState, binding, [UNREADY]), 2);
const property = value5[0];
var env0_3 = value5[1];
const value6 = (UsePrevious)(property);
var env0_4 = value6;
const value7 = (UsePrevious)(visible);
const ref = controls == null || controls.props == null ? value2 : controls.props.ref;
const ref2 = ref;
binding = env0_4;
binding.useEffect(function() {
var MediaViewerAnalytics = require(dependencyMap[5]).MediaViewerAnalytics;
MediaViewerAnalytics.trackMessageEmbedsActionCompleted({'platform': 'file', 'action': 'attempted'});
}, []);
const value8 = binding.useCallback(_fun74723, [controls == null ? value2 : controls.props]);
env0_4.useEffect(_fun74725, [ref, visible, value7, value6, property,
(require(9552) /* metro dependency 9552: MediaPlayerMuteManager */).useMediaPlayerMutedStore(function(a0) {
return a0.isMuted;
})]);
const value10 = HTML(source.uri);
binding = ref2;
return (
<MediaModalWebView
ref={ref}
style={style}
source={{html: value10, baseUrl: binding}}
baseURL={binding}
playerState={property}
onDataReceived={value8}
javaScriptEnabled
javaScriptCanOpenWindowsAutomatically
{...value}
key={source.uri}
/>
);
function _fun74723(a0) { // fn#74723, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9753:2061, offset: 0x01d98282, size: 1198 bytes, params: 2, frame: 15
var r0;
var r1;
var r4;
var JSON;
var value;
var error;
var value3;
var props;
var value8;
var value13;
var value17;
var onPlayerStateChange;
var value20;
const PlayerState = (MediaModalWebViewModule).PlayerState;
var binding;
var value21;
var value24;
var value25;
var value28;
var value29;
var value32;
var value33;
var value36;
try {
JSON = global.JSON;
value = JSON.parse(a0);
r0 = value;
} catch (error) {
r0 = {};
}
r0 = !r0 ? r1.onDuration == null : r0;
if (!r0) {
r1.onDuration(value);
const type = r0.type;
value = r0.value;
if (type === 'loaded') {
binding = env0_3;
value = environment.__proto__;
binding(PlayerState.READY);
} else if (type === 'canplay') {
value33 = controls == null;
if (value33) {
r1 = value33;
r4 = undefined;
} else {
props = controls.props;
r1 = props == null;
r4 = props;
}
if (!r1) {
onPlayerStateChange = r4.onPlayerStateChange;
value36 = environment.__proto__;
Reflect.apply(onPlayerStateChange, r4, [PlayerState.VIDEO_CUED]);
}
binding = env0_3;
value = environment.__proto__;
binding(PlayerState.VIDEO_CUED);
} else if (type === 'error') {
binding = env0_3;
value = environment.__proto__;
binding(PlayerState.ERRORED);
(require(9547) /* metro dependency 9547: MediaViewerAnalyticsManager */).MediaViewerAnalytics.trackMessageEmbedsActionCompleted({'platform': 'file',
'action': 'errored', 'error': 'unknown'});
} else if (type === 'ended') {
value29 = controls == null;
if (value29) {
r1 = value29;
r4 = undefined;
} else {
props = controls.props;
r1 = props == null;
r4 = props;
}
if (!r1) {
onPlayerStateChange = r4.onPlayerStateChange;
value32 = environment.__proto__;
Reflect.apply(onPlayerStateChange, r4, [PlayerState.ENDED]);
}
binding = env0_3;
value = environment.__proto__;
binding(PlayerState.ENDED);
} else if (type === 'play') {
value25 = controls == null;
if (value25) {
r1 = value25;
r4 = undefined;
} else {
props = controls.props;
r1 = props == null;
r4 = props;
}
if (!r1) {
onPlayerStateChange = r4.onPlayerStateChange;
value28 = environment.__proto__;
Reflect.apply(onPlayerStateChange, r4, [PlayerState.PLAYING]);
}
binding = env0_3;
value = environment.__proto__;
binding(PlayerState.PLAYING);
} else if (type === 'pause') {
value21 = controls == null;
if (value21) {
r1 = value21;
r4 = undefined;
} else {
props = controls.props;
r1 = props == null;
r4 = props;
}
if (!r1) {
onPlayerStateChange = r4.onPlayerStateChange;
value24 = environment.__proto__;
Reflect.apply(onPlayerStateChange, r4, [PlayerState.PAUSED]);
}
binding = env0_3;
value = environment.__proto__;
binding(PlayerState.PAUSED);
} else if (type === 'stalled') {
value17 = controls == null;
if (value17) {
r1 = value17;
r4 = undefined;
} else {
props = controls.props;
r1 = props == null;
r4 = props;
}
if (!r1) {
onPlayerStateChange = r4.onPlayerStateChange;
value20 = environment.__proto__;
Reflect.apply(onPlayerStateChange, r4, [PlayerState.BUFFERING]);
}
binding = env0_3;
value = environment.__proto__;
binding(PlayerState.BUFFERING);
} else if (type === 'durationchange') {
if (value != null) {
value13 = controls == null;
if (value13) {
r0 = value13;
r1 = undefined;
} else {
props = controls.props;
r0 = props == null;
r1 = props;
}
r0 = !r0 ? r1.onDuration == null : r0;
if (!r0) {
r1.onDuration(value);
}
}
} else if (type === 'progress') {
if (value != null) {
value8 = controls == null;
if (value8) {
r0 = value8;
r1 = undefined;
} else {
props = controls.props;
r0 = props == null;
r1 = props;
}
r0 = !r0 ? r1.onDownloadProgress == null : r0;
if (!r0) {
r1.onDownloadProgress(value);
}
}
} else if (type === 'timeupdate') {
if (value != null) {
value3 = controls == null;
if (value3) {
r0 = value3;
r1 = undefined;
} else {
props = controls.props;
r0 = props == null;
r1 = props;
}
r0 = !r0 ? r1.onCurrentSecond == null : r0;
if (!r0) {
r1.onCurrentSecond(value);
}
}
}
}
} else if (type === 'progress') {
if (value != null) {
value8 = controls == null;
if (value8) {
r0 = value8;
r1 = undefined;
} else {
props = controls.props;
r0 = props == null;
r1 = props;
function _fun74725() { // fn#74725, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9753:3456, offset: 0x01d98730, size: 370 bytes, params: 1, frame: 17
var current;
const PlayerState = (MediaModalWebViewModule).PlayerState;
const refBinding = ref;
const value2 = undefined;
let r2 = (refBinding == null ? value2 : ref.current) != null && env0_2 !== PlayerState.UNREADY;
if (r2) {
current = ref.current;
current.injectJavaScript('window.player.muted = ' + global.JSON.stringify(env0_7) + '; true;');
r2 = visible && env0_4 === PlayerState.UNREADY;
r2 = r2 && env0_2 === PlayerState.READY;
if (r2) {
ref.current.injectJavaScript('window.player.play(); true;');
}
r2 = visible && !JsxRuntimeModule.jsx;
if (r2) {
ref.current.injectJavaScript('window.player.play(); true;');
}
r2 = !visible && JsxRuntimeModule.jsx;
if (r2) {
ref.current.injectJavaScript('window.player.pause(); true;');
}
}
r0 = !r0 ? r1.onDownloadProgress == null : r0;
if (!r0) {
r1.onDownloadProgress(value);
return value2;
}
}
function createWebFileVideoControls() { // fn#74726, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9753:4220, offset: 0x01d988a2, size: 146 bytes, params: 1, frame: 11
return {seek: seek_74728, pause: pause_74729, useSubscribe: useSubscribe_74730, props: {ref: env0_4.createRef(),
onPlayerStateChange: onPlayerStateChange, onCurrentSecond: onCurrentSecond, onDuration: onDuration,
onDownloadProgress: function(a0) {
env0_6 = a0;
updateProgress();
}}};
function updateProgress() { // fn#74727, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9753:4311, owner: createWebFileVideoControls.updateProgress, offset: 0x01d98934, size: 50 bytes, params: 1, frame: 11
if (JsxRuntimeModule.jsx > 0) {
if (env0_2 != null) {
env0_2(env0_6 / JsxRuntimeModule.jsx);
}
}
}
} else if (type === 'timeupdate') {
if (value != null) {
value3 = controls == null;
if (value3) {
r0 = value3;
r1 = undefined;
} else {
props = controls.props;
r0 = props == null;
r1 = props;
}
r0 = !r0 ? r1.onCurrentSecond == null : r0;
if (!r0) {
r1.onCurrentSecond(value);
function createWebFileVideoControlsSeek(a0) { // fn#74728, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9753:4347, owner: createWebFileVideoControls.seek, offset: 0x01d98966, size: 84 bytes, params: 2, frame: 15
const current = Module00057.current;
if (current != null) {
current.injectJavaScript('window.player.currentTime = ' + global.JSON.stringify(a0) + '; true;');
}
}
}
}
function _fun74725() { // fn#74725, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9753:3456, offset: 0x01d98730, size: 370 bytes, params: 1, frame: 17
var current;
const PlayerState = (require(9566) /* metro dependency 9566: MediaModalWebView */).PlayerState;
const refBinding = ref;
const value2 = undefined;
let r2 = (refBinding == null ? value2 : ref.current) != null && env0_2 !== PlayerState.UNREADY;
if (r2) {
current = ref.current;
current.injectJavaScript('window.player.muted = ' + global.JSON.stringify(env0_7) + '; true;');
r2 = visible && env0_4 === PlayerState.UNREADY;
r2 = r2 && env0_2 === PlayerState.READY;
if (r2) {
ref.current.injectJavaScript('window.player.play(); true;');
function createWebFileVideoControlsPause(a0) { // fn#74729, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9753:4461, owner: createWebFileVideoControls.pause, offset: 0x01d989ba, size: 78 bytes, params: 2, frame: 15
const current = Module00057.current;
if (current != null) {
current.injectJavaScript('window.player.' + (a0 ? 'pause' : 'play') + '(); true;');
}
}
r2 = visible && !env0_5;
if (r2) {
ref.current.injectJavaScript('window.player.play(); true;');
function createWebFileVideoControlsUseSubscribe(a0, a1, a2) { // fn#74730, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9753:4563, owner: createWebFileVideoControls.useSubscribe, offset: 0x01d98a08, size: 60 bytes, params: 4, frame: 13
env0_0 = a0;
env0_1 = a1;
env0_2 = a2;
env1_4.useLayoutEffect(_fun74731, []);
function _fun74731() { // fn#74731, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9753:4614, offset: 0x01d98a44, size: 37 bytes, params: 1, frame: 13
if (env1_0 != null) {
env1_0(env1_4, env1_5);
}
}
}
r2 = !visible && env0_5;
if (r2) {
ref.current.injectJavaScript('window.player.pause(); true;');
function createWebFileVideoControlsOnPlayerStateChange(a0) { // fn#74732, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9753:4655, owner: createWebFileVideoControls.onPlayerStateChange, offset: 0x01d9777c, size: 106 bytes, params: 2, frame: 15
var binding;
const PlayerState = (MediaModalWebViewModule).PlayerState;
var value;
if (env0_1 != null) {
binding = env0_1;
value = environment.__proto__;
binding(a0 === PlayerState.PAUSED || a0 === PlayerState.ENDED);
}
}
}
return value2;
}
function updateProgress() { // fn#74727, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9753:4311, owner: createWebFileVideoControls.updateProgress, offset: 0x01d98934, size: 50 bytes, params: 1, frame: 11
if (env0_5 > 0) {
if (env0_2 != null) {
env0_2(env0_6 / env0_5);
function createWebFileVideoControlsOnCurrentSecond(a0) { // fn#74733, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9753:4753, owner: createWebFileVideoControls.onCurrentSecond, offset: 0x01d98a69, size: 44 bytes, params: 2, frame: 13
if (env0_0 != null) {
env0_0(a0, JsxRuntimeModule.jsx);
}
}
function createWebFileVideoControlsOnDuration(a0) { // fn#74734, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9753:4793, owner: createWebFileVideoControls.onDuration, offset: 0x01d98a95, size: 52 bytes, params: 2, frame: 14
if (env0_0 != null) {
env0_0(env0_4, a0);
}
updateProgress();
}
}
}
function createWebFileVideoControlsSeek(a0) { // fn#74728, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9753:4347, owner: createWebFileVideoControls.seek, offset: 0x01d98966, size: 84 bytes, params: 2, frame: 15
const current = env0_3.current;
if (current != null) {
current.injectJavaScript('window.player.currentTime = ' + global.JSON.stringify(a0) + '; true;');
}
}
function createWebFileVideoControlsPause(a0) { // fn#74729, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9753:4461, owner: createWebFileVideoControls.pause, offset: 0x01d989ba, size: 78 bytes, params: 2, frame: 15
const current = env0_3.current;
if (current != null) {
current.injectJavaScript('window.player.' + (a0 ? 'pause' : 'play') + '(); true;');
}
}
function createWebFileVideoControlsUseSubscribe(a0, a1, a2) { // fn#74730, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9753:4563, owner: createWebFileVideoControls.useSubscribe, offset: 0x01d98a08, size: 60 bytes, params: 4, frame: 13
env0_0 = a0;
env0_1 = a1;
env0_2 = a2;
env1_4.useLayoutEffect(_fun74731, []);
}
function createWebFileVideoControlsOnCurrentSecond(a0) { // fn#74733, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9753:4753, owner: createWebFileVideoControls.onCurrentSecond, offset: 0x01d98a69, size: 44 bytes, params: 2, frame: 13
if (env0_0 != null) {
env0_0(a0, env0_5);
}
}
function createWebFileVideoControlsOnDuration(a0) { // fn#74734, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9753:4793, owner: createWebFileVideoControls.onDuration, offset: 0x01d98a95, size: 52 bytes, params: 2, frame: 14
if (env0_0 != null) {
env0_0(env0_4, a0);
}
updateProgress();
}
function _fun74731() { // fn#74731, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9753:4614, offset: 0x01d98a44, size: 37 bytes, params: 1, frame: 13
if (env1_0 != null) {
env1_0(env1_4, env1_5);
}
}
global.__d(_fun74719, 9567, [57, 31, 33, 9566, 6266, 9547, 9552,
2]) /* metro module 9567, dependencies: [57, 31, 33, 9566, 6266, 9547, 9552, 2] */;
@@ -1,160 +1,161 @@
/* Metro module 9566; source: modules/media_viewer/native/components/MediaModalWebView.tsx; dependencies: [31, 27, 33, 477, 4501, 4017, 4504, 3853, 5269, 2] */
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 ReanimatedRexportModule from '../../../reanimated/ReanimatedRexport.tsx'; /* Metro dependency 4017 */
import * as CreateStylesModule from '../../../../design/components/Styles/native/createStyles.tsx'; /* Metro dependency 4501 */
function _fun74712(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#74712, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9752:6, offset: 0x01d9783e, size: 471 bytes, params: 8, frame: 22
var object2;
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
let value = importAll(31) /* metro dependency 31 */;
const value2 = require(27) /* metro dependency 27 */;
const env0_4 = value2.ActivityIndicator;
const env0_5 = value2.View;
const value3 = require(33) /* metro dependency 33 */;
const env0_6 = value3.jsx;
const env0_7 = value3.jsxs;
let value = ReactModule;
const env0_8 = (require(477) /* metro dependency 477: PlatformUtils */).isIOS() ? "\n window.addEventListener('click', function(event) {\n window.ReactNativeWebView.postMessage(JSON.stringify({event: 'click'}));\n });\n" : '';
object2 = {UNREADY: 0};
object2[0] = 'UNREADY';
object2.READY = 1;
object2[1] = 'READY';
object2.ERRORED = 2;
object2[2] = 'ERRORED';
object2.UNSTARTED = 3;
object2[3] = 'UNSTARTED';
object2.ENDED = 4;
object2[4] = 'ENDED';
object2.PLAYING = 5;
object2[5] = 'PLAYING';
object2.PAUSED = 6;
object2[6] = 'PAUSED';
object2.BUFFERING = 7;
object2[7] = 'BUFFERING';
object2.VIDEO_CUED = 8;
object2[8] = 'VIDEO_CUED';
const env0_10 = (require(4501) /* metro dependency 4501: createStyles */).createStyles({loading: {'top': 0,
object = {UNREADY: 0};
object[0] = 'UNREADY';
object.READY = 1;
object[1] = 'READY';
object.ERRORED = 2;
object[2] = 'ERRORED';
object.UNSTARTED = 3;
object[3] = 'UNSTARTED';
object.ENDED = 4;
object[4] = 'ENDED';
object.PLAYING = 5;
object[5] = 'PLAYING';
object.PAUSED = 6;
object[6] = 'PAUSED';
object.BUFFERING = 7;
object[7] = 'BUFFERING';
object.VIDEO_CUED = 8;
object[8] = 'VIDEO_CUED';
const env0_10 = (CreateStylesModule).createStyles({loading: {'top': 0,
'left': 0, 'right': 0, 'bottom': 0, 'position': 'absolute', 'alignItems': 'center',
'justifyContent': 'center'}});
const env0_11 = {code: 'function MediaModalWebViewTsx1(){const{withTiming,webviewOpacity}=this.__closure;return{opacity:withTiming(webviewOpacity.get())};}'};
const env0_12 = {code: 'function MediaModalWebViewTsx2(){const{withTiming,loaderOpacity}=this.__closure;return{opacity:withTiming(loaderOpacity.get())};}'};
value = value.memo(value.forwardRef(_fun74713));
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/media_viewer/native/components/MediaModalWebView.tsx');
(FileImportTrackerModule).fileFinishedImporting('modules/media_viewer/native/components/MediaModalWebView.tsx');
exports.default = value;
exports.PlayerState = object2;
}
exports.PlayerState = object;
function _fun74713(a0, a1) { // fn#74713, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9752:1028, offset: 0x01d97a15, size: 799 bytes, params: 3, frame: 33
const style = a0.style;
const playerState = a0.playerState;
const onDataReceived = a0.onDataReceived;
const baseURL = a0.baseURL;
const injectedJavaScript = a0.injectedJavaScript;
const panGestureConfig = a0.panGestureConfig;
const panGestureConfig2 = panGestureConfig;
let object = {'style': 0, 'playerState': 0, 'onDataReceived': 0, 'baseURL': 0, 'injectedJavaScript': 0,
'panGestureConfig': 0};
silentSetPrototypeOf(object, null, undefined);
const value = copyDataProperties({}, a0, object, undefined);
const styles = useStyles();
const value3 = (ReanimatedRexportModule).useSharedValue(1);
const value4 = (ReanimatedRexportModule).useSharedValue(0);
let useAnimatedStyle = ReanimatedRexportModule.useAnimatedStyle;
let closure = f_74714;
const object2 = {};
object2.withTiming = (require(4504) /* metro dependency 4504: timing */).withTiming;
object2.webviewOpacity = value4;
closure.__closure = object2;
closure.__workletHash = 2179142865986;
closure.__initData = env0_11;
const value5 = Reflect.apply(useAnimatedStyle, ReanimatedRexportModule, [closure]);
useAnimatedStyle = ReanimatedRexportModule.useAnimatedStyle;
closure = S_74715;
const object3 = {};
object3.withTiming = (require(4504) /* metro dependency 4504: timing */).withTiming;
object3.loaderOpacity = value3;
closure.__closure = object3;
closure.__workletHash = 7752174298017;
closure.__initData = env0_12;
const value6 = Reflect.apply(useAnimatedStyle, ReanimatedRexportModule, [closure]);
const binding = panGestureConfig2;
binding.useEffect(_fun74716, [playerState, value3, value4]);
const value7 = binding.useCallback(_fun74717, [onDataReceived, panGestureConfig]);
const value8 = binding.useCallback(_fun74718, [baseURL]);
const View2 = (importDefault(4017) /* metro dependency 4017: ReanimatedRexport */).View;
object = [
<View2 style={[value5, {flex: 1}]}>
{((Component) => <Component {...value} {...{['injectedJavaScript']: '' + injectedJavaScript + '\n' + env0_8}} {...{['bounces']: false}} {...{['ref']: a1}} {...{['scrollEnabled']: false}} {...{['javaScriptEnabled']: true}} {...{['onMessage']: value7}} {...{['allowsInlineMediaPlayback']: true}} {...{['mediaPlaybackRequiresUserAction']: false}} {...{['onShouldStartLoadWithRequest']: value8}} />)(importDefault(5269) /* metro dependency 5269 */)}
</View2>,
];
const PLAYING = env0_9.PLAYING;
object[1] = playerState !== PLAYING && playerState !== env0_9.PAUSED && ((View) => <View style={[value6,
styles.loading]}><ActivityIndicator color="white" size="large" /></View>)((importDefault(4017) /* metro dependency 4017: ReanimatedRexport */).View);
return (
<View style={style}>
{object}
</View>
);
function f_74714() { // fn#74714, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9752:1237, offset: 0x01d97d34, size: 59 bytes, params: 1, frame: 13
let value = environment.__proto__;
value = require(4504) /* metro dependency 4504: timing */;
const withTiming = value.withTiming;
const get = ReactNativeModule.View.get;
return {opacity: Reflect.apply(withTiming, value, [Reflect.apply(get, ReactNativeModule.View, [])])};
}
function _fun74713(a0, a1) { // fn#74713, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9752:1028, offset: 0x01d97a15, size: 799 bytes, params: 3, frame: 33
const style = a0.style;
const playerState = a0.playerState;
const onDataReceived = a0.onDataReceived;
const baseURL = a0.baseURL;
const injectedJavaScript = a0.injectedJavaScript;
const panGestureConfig = a0.panGestureConfig;
const env0_3 = panGestureConfig;
let object = {'style': 0, 'playerState': 0, 'onDataReceived': 0, 'baseURL': 0, 'injectedJavaScript': 0,
'panGestureConfig': 0};
silentSetPrototypeOf(object, null, undefined);
const value = copyDataProperties({}, a0, object, undefined);
const styles = useStyles();
const value3 = (require(4017) /* metro dependency 4017: ReanimatedRexport */).useSharedValue(1);
const value4 = (require(4017) /* metro dependency 4017: ReanimatedRexport */).useSharedValue(0);
const reanimatedRexportModule = require(4017) /* metro dependency 4017: ReanimatedRexport */;
let useAnimatedStyle = reanimatedRexportModule.useAnimatedStyle;
let closure = f_74714;
const object4 = {};
object4.withTiming = (require(4504) /* metro dependency 4504: timing */).withTiming;
object4.webviewOpacity = value4;
closure.__closure = object4;
closure.__workletHash = 2179142865986;
closure.__initData = env0_11;
const value5 = Reflect.apply(useAnimatedStyle, reanimatedRexportModule, [closure]);
const moduleValue4 = reanimatedRexportModule;
useAnimatedStyle = moduleValue4.useAnimatedStyle;
closure = S_74715;
const object5 = {};
object5.withTiming = (require(4504) /* metro dependency 4504: timing */).withTiming;
object5.loaderOpacity = value3;
closure.__closure = object5;
closure.__workletHash = 7752174298017;
closure.__initData = env0_12;
const value6 = Reflect.apply(useAnimatedStyle, moduleValue4, [closure]);
const binding = env0_3;
binding.useEffect(_fun74716, [playerState, value3, value4]);
const value7 = binding.useCallback(_fun74717, [onDataReceived, panGestureConfig]);
const value8 = binding.useCallback(_fun74718, [baseURL]);
const View2 = (importDefault(4017) /* metro dependency 4017: ReanimatedRexport */).View;
object = [<View2 style={[value5,
{flex: 1}]}>{((Component) => <Component {...value} {...{['injectedJavaScript']: '' + injectedJavaScript + '\n' + env0_8}} {...{['bounces']: false}} {...{['ref']: a1}} {...{['scrollEnabled']: false}} {...{['javaScriptEnabled']: true}} {...{['onMessage']: value7}} {...{['allowsInlineMediaPlayback']: true}} {...{['mediaPlaybackRequiresUserAction']: false}} {...{['onShouldStartLoadWithRequest']: value8}} />)(importDefault(5269) /* metro dependency 5269 */)}</View2>];
const PLAYING = env0_9.PLAYING;
object[1] = playerState !== PLAYING && playerState !== env0_9.PAUSED && ((View) => <View style={[value6,
styles.loading]}><ActivityIndicator color="white" size="large" /></View>)((importDefault(4017) /* metro dependency 4017: ReanimatedRexport */).View);
return (
<View style={style}>
{object}
</View>
);
}
function S_74715() { // fn#74715, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9752:1433, offset: 0x01d97d6f, size: 59 bytes, params: 1, frame: 13
let value = environment.__proto__;
value = require(4504) /* metro dependency 4504: timing */;
const withTiming = value.withTiming;
const get = ReactNativeModule.ActivityIndicator.get;
return {opacity: Reflect.apply(withTiming, value, [Reflect.apply(get, ReactNativeModule.ActivityIndicator, [])])};
}
function f_74714() { // fn#74714, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9752:1237, offset: 0x01d97d34, size: 59 bytes, params: 1, frame: 13
let value = environment.__proto__;
value = require(4504) /* metro dependency 4504: timing */;
const withTiming = value.withTiming;
const binding = env0_5;
const get = binding.get;
return {opacity: Reflect.apply(withTiming, value, [Reflect.apply(get, binding, [])])};
}
function _fun74716() { // fn#74716, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9752:1610, offset: 0x01d97daa, size: 106 bytes, params: 1, frame: 13
var binding;
const playerStateBinding = playerState;
const BUFFERING = env1_9.BUFFERING;
if (!(playerStateBinding !== BUFFERING && playerState !== env1_9.PLAYING && playerState !== env1_9.ERRORED)) {
binding = ReactNativeModule.ActivityIndicator;
binding.set(0);
binding = ReactNativeModule.View;
binding.set(1);
}
}
function S_74715() { // fn#74715, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9752:1433, offset: 0x01d97d6f, size: 59 bytes, params: 1, frame: 13
let value = environment.__proto__;
value = require(4504) /* metro dependency 4504: timing */;
const withTiming = value.withTiming;
const binding = env0_4;
const get = binding.get;
return {opacity: Reflect.apply(withTiming, value, [Reflect.apply(get, binding, [])])};
}
function _fun74717(a0) { // fn#74717, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9752:1714, offset: 0x01d97e14, size: 125 bytes, params: 2, frame: 12
var panGestureConfigBinding;
var overlayEnabled;
var set;
var overlayEnabled2;
const JSON = global.JSON;
const value = JSON.parse(a0.nativeEvent.data);
if (value == null) {
onDataReceived(a0.nativeEvent.data);
} else if (value.event === 'click') {
panGestureConfigBinding = panGestureConfig;
overlayEnabled = panGestureConfigBinding.overlayEnabled;
set = overlayEnabled.set;
overlayEnabled2 = panGestureConfigBinding.overlayEnabled;
Reflect.apply(set, overlayEnabled, [!overlayEnabled2.get()]);
} else {
onDataReceived(a0.nativeEvent.data);
}
}
function _fun74718(a0) { // fn#74718, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9752:1876, offset: 0x01d97e91, size: 125 bytes, params: 2, frame: 13
var r0;
value = !(a0.url !== 'about:blank' && !a0.url.startsWith(baseURL) && (a0.isTopFrame ?? a0.isTopFrame == null));
if (r0) {
value = environment.__proto__;
value = importDefault(3853) /* metro dependency 3853: Linking */;
value.openURL(a0.url);
value = false;
r0 = value;
} else {
r0 = value;
}
return r0;
}
function _fun74716() { // fn#74716, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9752:1610, offset: 0x01d97daa, size: 106 bytes, params: 1, frame: 13
var binding;
const playerStateBinding = playerState;
const BUFFERING = env1_9.BUFFERING;
if (!(playerStateBinding !== BUFFERING && playerState !== env1_9.PLAYING && playerState !== env1_9.ERRORED)) {
binding = env0_4;
binding.set(0);
binding = env0_5;
binding.set(1);
}
}
function _fun74717(a0) { // fn#74717, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9752:1714, offset: 0x01d97e14, size: 125 bytes, params: 2, frame: 12
var panGestureConfigBinding;
var overlayEnabled;
var set;
var overlayEnabled2;
const JSON = global.JSON;
const value = JSON.parse(a0.nativeEvent.data);
if (value == null) {
onDataReceived(a0.nativeEvent.data);
} else if (value.event === 'click') {
panGestureConfigBinding = panGestureConfig;
overlayEnabled = panGestureConfigBinding.overlayEnabled;
set = overlayEnabled.set;
overlayEnabled2 = panGestureConfigBinding.overlayEnabled;
Reflect.apply(set, overlayEnabled, [!overlayEnabled2.get()]);
} else {
onDataReceived(a0.nativeEvent.data);
}
}
function _fun74718(a0) { // fn#74718, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9752:1876, offset: 0x01d97e91, size: 125 bytes, params: 2, frame: 13
var r0;
value = !(a0.url !== 'about:blank' && !a0.url.startsWith(baseURL) && (a0.isTopFrame ?? a0.isTopFrame == null));
if (r0) {
value = environment.__proto__;
value = importDefault(3853) /* metro dependency 3853: Linking */;
value.openURL(a0.url);
value = false;
r0 = value;
} else {
r0 = value;
}
return r0;
}
global.__d(_fun74712, 9566, [31, 27, 33, 477, 4501, 4017, 4504, 3853, 5269,
2]) /* metro module 9566, dependencies: [31, 27, 33, 477, 4501, 4017, 4504, 3853, 5269, 2] */;
@@ -1,168 +1,175 @@
/* Metro module 9931; source: modules/media_viewer/native/components/MediaModalYoutube.tsx; dependencies: [57, 31, 661, 33, 9566, 6266, 9547, 9546, 9932, 477, 2] */
import Module00057 from '../../../../by-id/module-00057.js'; /* Metro dependency 57 */
import UsePrevious from '../../../../hooks/usePrevious.tsx'; /* Metro dependency 6266 */
import * as FileImportTrackerModule from '../../../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
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 MediaModalWebViewModule from './MediaModalWebView.tsx'; /* Metro dependency 9566 */
function _fun77735(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#77735, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10117:6, offset: 0x01e09367, size: 254 bytes, params: 8, frame: 20
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_3 = importDefault(57) /* metro dependency 57 */;
let value = importAll(31) /* metro dependency 31 */;
const env0_5 = (require(661) /* metro dependency 661: Constants */).YOUTUBE_EMBED_PAGE_TYPE;
const env0_6 = (require(33) /* metro dependency 33 */).jsx;
let value = ReactModule;
const GLOBAL_ENV = global.window.GLOBAL_ENV;
const WEBAPP_ENDPOINT = GLOBAL_ENV.WEBAPP_ENDPOINT;
const env0_7 = 'https:' + WEBAPP_ENDPOINT;
value = value.memo(_fun77738);
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/media_viewer/native/components/MediaModalYoutube.tsx');
(FileImportTrackerModule).fileFinishedImporting('modules/media_viewer/native/components/MediaModalYoutube.tsx');
exports.default = value;
}
function HTML_77736(a0) { // fn#77736, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10117:216, offset: 0x01e09465, size: 50 bytes, params: 2, frame: 13
return '\n<html>\n <head>\n <meta name="viewport" content="initial-scale=1">\n <style>\n * {\n margin: 0;\n padding: 0;\n background-color: #000;\n }\n </style>\n <script>' + getJavascriptFromVideoID(a0) + '</script>\n </head>\n <body>\n <div id="player"></div>\n </body>\n</html>\n';
}
function getJavascriptFromVideoID(a0) { // fn#77737, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10117:566, offset: 0x01e09497, size: 238 bytes, params: 2, frame: 28
const start = a0.start;
const value = '';
return '\nconst tag = document.createElement(\'script\');\ntag.setAttribute(\'src\', "https://www.youtube.com/iframe_api");\ndocument.head.appendChild(tag);\n\nfunction onYouTubeIframeAPIReady() {\n window.player = new YT.Player(\'player\', {\n height: \'100%\',\n width: \'100%\',\n videoId: \'' + a0.videoId + "',\n playerVars: {\n 'playsinline': 1,\n 'fs': 0,\n 'pageType': " + YOUTUBE_EMBED_PAGE_TYPE + ',\n ' + (a0.clipt == null ? value : "'clipt': '" + a0.clipt + "',") + '\n ' + (a0.clip == null ? value : "'clip': '" + a0.clip + "',") + '\n ' + (start == null ? value : "'start': " + a0.start + ',') + "\n },\n events: {\n 'onReady': (e) => {\n window.ReactNativeWebView.postMessage(\n JSON.stringify({type: 'onReady', value: window.player.getPlayerState()})\n );\n },\n 'onError': (e) => {\n window.ReactNativeWebView.postMessage(\n JSON.stringify({type: 'onError', value: e.data})\n );\n },\n 'onStateChange': (e) => {\n window.ReactNativeWebView.postMessage(\n JSON.stringify({type: 'onStateChange', value: e.data})\n );\n }\n }\n });\n}\n";
}
function _fun77738(a0) { // fn#77738, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10117:1702, offset: 0x01e09585, size: 656 bytes, params: 2, frame: 31
var r5;
var r8;
var moduleValue2;
var moduleValue3;
var defaultImport;
var object2;
var object3;
const visible = a0.visible;
const style = a0.style;
const source = a0.source;
const object6 = {'visible': 0, 'style': 0, 'source': 0};
silentSetPrototypeOf(object6, null, undefined);
const value = copyDataProperties({}, a0, object6, undefined);
let binding = env0_4;
let useState = binding.useState;
const PlayerState = (require(9566) /* metro dependency 9566: MediaModalWebView */).PlayerState;
const UNREADY = PlayerState.UNREADY;
const value3 = Reflect.apply(useState, binding, [UNREADY]);
const binding2 = env0_3;
const value4 = binding2(value3, 2);
const property = value4[0];
const env0_2 = value4[1];
useState = binding.useState;
const value5 = binding2(Reflect.apply(useState, binding, [undefined]), 2);
const property2 = value5[0];
var env0_3 = value5[1];
const value6 = (importDefault(6266) /* metro dependency 6266: usePrevious */)(property);
const value7 = (importDefault(6266) /* metro dependency 6266: usePrevious */)(visible);
const value8 = binding.useRef(null);
binding.useEffect(function() {
var MediaViewerAnalytics = require(dependencyMap[6]).MediaViewerAnalytics;
MediaViewerAnalytics.trackMessageEmbedsActionCompleted({'platform': 'youtube', 'action': 'attempted'});
}, []);
const value9 = binding.useCallback(_fun77740, []);
binding.useEffect(_fun77741, [value8, visible, value7, value6, property]);
const youtubeVideoIdFromURI = (require(9546) /* metro dependency 9546: MediaSourceUtil */).getYoutubeVideoIdFromURI(source.uri);
if (youtubeVideoIdFromURI != null) {
r5 = youtubeVideoIdFromURI;
} else {
moduleValue2 = require(9546) /* metro dependency 9546: MediaSourceUtil */;
r5 = moduleValue2.getYoutubeClipVideoIdFromURI(source.uri);
function HTML_77736(a0) { // fn#77736, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10117:216, offset: 0x01e09465, size: 50 bytes, params: 2, frame: 13
return '\n<html>\n <head>\n <meta name="viewport" content="initial-scale=1">\n <style>\n * {\n margin: 0;\n padding: 0;\n background-color: #000;\n }\n </style>\n <script>' + getJavascriptFromVideoID(a0) + '</script>\n </head>\n <body>\n <div id="player"></div>\n </body>\n</html>\n';
}
if (r5 == null) {
return null;
function getJavascriptFromVideoID(a0) { // fn#77737, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10117:566, offset: 0x01e09497, size: 238 bytes, params: 2, frame: 28
const start = a0.start;
const value = '';
return '\nconst tag = document.createElement(\'script\');\ntag.setAttribute(\'src\', "https://www.youtube.com/iframe_api");\ndocument.head.appendChild(tag);\n\nfunction onYouTubeIframeAPIReady() {\n window.player = new YT.Player(\'player\', {\n height: \'100%\',\n width: \'100%\',\n videoId: \'' + a0.videoId + "',\n playerVars: {\n 'playsinline': 1,\n 'fs': 0,\n 'pageType': " + YOUTUBE_EMBED_PAGE_TYPE + ',\n ' + (a0.clipt == null ? value : "'clipt': '" + a0.clipt + "',") + '\n ' + (a0.clip == null ? value : "'clip': '" + a0.clip + "',") + '\n ' + (start == null ? value : "'start': " + a0.start + ',') + "\n },\n events: {\n 'onReady': (e) => {\n window.ReactNativeWebView.postMessage(\n JSON.stringify({type: 'onReady', value: window.player.getPlayerState()})\n );\n },\n 'onError': (e) => {\n window.ReactNativeWebView.postMessage(\n JSON.stringify({type: 'onError', value: e.data})\n );\n },\n 'onStateChange': (e) => {\n window.ReactNativeWebView.postMessage(\n JSON.stringify({type: 'onStateChange', value: e.data})\n );\n }\n }\n });\n}\n";
}
const ERRORED = PlayerState.ERRORED;
if (property !== ERRORED) {
function _fun77738(a0) { // fn#77738, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10117:1702, offset: 0x01e09585, size: 656 bytes, params: 2, frame: 31
var r5;
var r8;
var moduleValue2;
var moduleValue3;
var defaultImport;
var object;
var object4;
const visible = a0.visible;
const style = a0.style;
const source = a0.source;
const object5 = {'visible': 0, 'style': 0, 'source': 0};
silentSetPrototypeOf(object5, null, undefined);
const value = copyDataProperties({}, a0, object5, undefined);
let binding = env0_4;
let useState = binding.useState;
const PlayerState = (MediaModalWebViewModule).PlayerState;
const UNREADY = PlayerState.UNREADY;
const value3 = Reflect.apply(useState, binding, [UNREADY]);
const binding2 = env0_3;
const value4 = binding2(value3, 2);
const property = value4[0];
const env0_2 = value4[1];
useState = binding.useState;
const value5 = binding2(Reflect.apply(useState, binding, [undefined]), 2);
const property2 = value5[0];
var env0_3 = value5[1];
const value6 = (UsePrevious)(property);
const value7 = (UsePrevious)(visible);
const value8 = binding.useRef(null);
binding.useEffect(function() {
var MediaViewerAnalytics = require(dependencyMap[6]).MediaViewerAnalytics;
MediaViewerAnalytics.trackMessageEmbedsActionCompleted({'platform': 'youtube', 'action': 'attempted'});
}, []);
const value9 = binding.useCallback(_fun77740, []);
binding.useEffect(_fun77741, [value8, visible, value7, value6, property]);
const youtubeVideoIdFromURI = (require(9546) /* metro dependency 9546: MediaSourceUtil */).getYoutubeVideoIdFromURI(source.uri);
if (youtubeVideoIdFromURI != null) {
r5 = youtubeVideoIdFromURI;
} else {
moduleValue2 = require(9546) /* metro dependency 9546: MediaSourceUtil */;
r5 = moduleValue2.getYoutubeClipVideoIdFromURI(source.uri);
}
if (r5 == null) {
return null;
}
const ERRORED = PlayerState.ERRORED;
if (property !== ERRORED) {
moduleValue3 = require(477) /* metro dependency 477: PlatformUtils */;
r8 = moduleValue3.isAndroid() ? {'nestedScrollEnabled': true, 'overScrollMode': 'never',
'domStorageEnabled': true,
'mixedContentMode': 'compatibility'} : {};
defaultImport = importDefault(9566) /* metro dependency 9566: MediaModalWebView */;
object = {ref: value8, style: style};
object4 = {};
object4.html = HTML_77736(r5);
binding = env0_7;
object4.baseUrl = binding;
object.source = object4;
object.baseURL = binding;
object.playerState = property;
object.onDataReceived = value9;
object.javaScriptEnabled = true;
object.javaScriptCanOpenWindowsAutomatically = true;
copyDataProperties(object, r8, object5);
copyDataProperties(object, value, object5);
return ((Component) => <Component {...object} key={r5.videoId} />)(defaultImport);
}
if (property2 === 'embed_not_allowed') {
return ((Component) => <Component videoId={r5.videoId} />)(importDefault(9932) /* metro dependency 9932: MediaModalYoutubeEmbedError */);
}
moduleValue3 = require(477) /* metro dependency 477: PlatformUtils */;
r8 = moduleValue3.isAndroid() ? {'nestedScrollEnabled': true, 'overScrollMode': 'never',
'domStorageEnabled': true,
r8 = moduleValue3.isAndroid() ? {'nestedScrollEnabled': true, 'overScrollMode': 'never', 'domStorageEnabled': true,
'mixedContentMode': 'compatibility'} : {};
defaultImport = importDefault(9566) /* metro dependency 9566: MediaModalWebView */;
object2 = {ref: value8, style: style};
object3 = {};
object3.html = HTML_77736(r5);
object4 = {html: HTML_77736(r5)};
binding = env0_7;
object3.baseUrl = binding;
object2.source = object3;
object2.baseURL = binding;
object2.playerState = property;
object2.onDataReceived = value9;
object2.javaScriptEnabled = true;
object2.javaScriptCanOpenWindowsAutomatically = true;
copyDataProperties(object2, r8, object6);
copyDataProperties(object2, value, object6);
return ((Component) => <Component {...object2} key={r5.videoId} />)(defaultImport);
}
if (property2 === 'embed_not_allowed') {
return ((Component) => <Component videoId={r5.videoId} />)(importDefault(9932) /* metro dependency 9932: MediaModalYoutubeEmbedError */);
}
moduleValue3 = require(477) /* metro dependency 477: PlatformUtils */;
r8 = moduleValue3.isAndroid() ? {'nestedScrollEnabled': true, 'overScrollMode': 'never', 'domStorageEnabled': true,
'mixedContentMode': 'compatibility'} : {};
defaultImport = importDefault(9566) /* metro dependency 9566: MediaModalWebView */;
object3 = {html: HTML_77736(r5)};
binding = env0_7;
object3.baseUrl = binding;
return ((Component) => <Component ref={value8} style={style} source={object3} baseURL={binding} playerState={property} onDataReceived={value9} javaScriptEnabled javaScriptCanOpenWindowsAutomatically {...r8} {...value} key={r5.videoId} />)(defaultImport);
}
function _fun77740(a0) { // fn#77740, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10117:2053, offset: 0x01e0984f, size: 619 bytes, params: 2, frame: 16
var r2;
var r4;
var value2;
const PlayerState = (require(9566) /* metro dependency 9566: MediaModalWebView */).PlayerState;
var property;
var binding;
var value3;
const JSON = global.JSON;
let value = JSON.parse(a0);
const type = value.type;
value = value.value;
if (type === 'onReady') {
env0_2(value === '-1' ? PlayerState.ERRORED : PlayerState.READY);
} else if (type === 'onError') {
if (typeof value !== 'number') {
r2 = value;
} else {
value = value.toString();
r2 = value;
}
r4 = r2 === '2' ? 'invalid_parameter' : r2 === '5' ? 'html5_error' : r2 === '100' ? 'video_not_found' : r2 === '101' || r2 === '150' ? 'embed_not_allowed' : 'unknown';
binding = env0_2;
value3 = environment.__proto__;
binding(PlayerState.ERRORED);
env0_3(r4);
(require(9547) /* metro dependency 9547: MediaViewerAnalyticsManager */).MediaViewerAnalytics.trackMessageEmbedsActionCompleted({'platform': 'youtube',
'action': 'errored', error: r4});
} else if (type === 'onStateChange') {
value2 = environment.__proto__;
property = ({['-1']: PlayerState.UNSTARTED, [0]: PlayerState.ENDED, [1]: PlayerState.PLAYING,
[2]: PlayerState.PAUSED, [3]: PlayerState.BUFFERING, [5]: PlayerState.VIDEO_CUED})[value];
value = property != null;
if (value && property in PlayerState) {
env0_2(property);
object4.baseUrl = binding;
return ((Component) => <Component ref={value8} style={style} source={object4} baseURL={binding} playerState={property} onDataReceived={value9} javaScriptEnabled javaScriptCanOpenWindowsAutomatically {...r8} {...value} key={r5.videoId} />)(defaultImport);
function _fun77740(a0) { // fn#77740, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10117:2053, offset: 0x01e0984f, size: 619 bytes, params: 2, frame: 16
var r2;
var r4;
var value2;
const PlayerState = (MediaModalWebViewModule).PlayerState;
var property;
var binding;
var value3;
const JSON = global.JSON;
let value = JSON.parse(a0);
const type = value.type;
value = value.value;
if (type === 'onReady') {
env0_2(value === '-1' ? PlayerState.ERRORED : PlayerState.READY);
} else if (type === 'onError') {
if (typeof value !== 'number') {
r2 = value;
} else {
value = value.toString();
r2 = value;
}
r4 = r2 === '2' ? 'invalid_parameter' : r2 === '5' ? 'html5_error' : r2 === '100' ? 'video_not_found' : r2 === '101' || r2 === '150' ? 'embed_not_allowed' : 'unknown';
binding = env0_2;
value3 = environment.__proto__;
binding(PlayerState.ERRORED);
env0_3(r4);
(require(9547) /* metro dependency 9547: MediaViewerAnalyticsManager */).MediaViewerAnalytics.trackMessageEmbedsActionCompleted({'platform': 'youtube',
'action': 'errored', error: r4});
} else if (type === 'onStateChange') {
value2 = environment.__proto__;
property = ({['-1']: PlayerState.UNSTARTED, [0]: PlayerState.ENDED, [1]: PlayerState.PLAYING,
[2]: PlayerState.PAUSED, [3]: PlayerState.BUFFERING, [5]: PlayerState.VIDEO_CUED})[value];
value = property != null;
if (value && property in PlayerState) {
env0_2(property);
}
}
}
}
}
function _fun77741() { // fn#77741, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10117:2861, offset: 0x01e09aba, size: 291 bytes, params: 1, frame: 14
const PlayerState = (require(9566) /* metro dependency 9566: MediaModalWebView */).PlayerState;
let r1 = env0_6.current != null && env0_1 !== PlayerState.UNREADY;
if (r1) {
r1 = visible && env0_4 === PlayerState.UNREADY;
r1 = r1 && env0_1 === PlayerState.READY;
if (r1) {
env0_6.current.injectJavaScript('window.player.playVideo(); true;');
}
r1 = visible && !env0_5;
if (r1) {
env0_6.current.injectJavaScript('window.player.playVideo(); true;');
function _fun77741() { // fn#77741, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10117:2861, offset: 0x01e09aba, size: 291 bytes, params: 1, frame: 14
const PlayerState = (MediaModalWebViewModule).PlayerState;
let r1 = JsxRuntimeModule.jsx.current != null && env0_1 !== PlayerState.UNREADY;
if (r1) {
r1 = visible && env0_4 === PlayerState.UNREADY;
r1 = r1 && env0_1 === PlayerState.READY;
if (r1) {
JsxRuntimeModule.jsx.current.injectJavaScript('window.player.playVideo(); true;');
}
r1 = visible && !ConstantsModule.YOUTUBE_EMBED_PAGE_TYPE;
if (r1) {
JsxRuntimeModule.jsx.current.injectJavaScript('window.player.playVideo(); true;');
}
r1 = !visible && ConstantsModule.YOUTUBE_EMBED_PAGE_TYPE;
if (r1) {
JsxRuntimeModule.jsx.current.injectJavaScript('window.player.pauseVideo(); true;');
}
}
}
r1 = !visible && env0_5;
if (r1) {
env0_6.current.injectJavaScript('window.player.pauseVideo(); true;');
}
}
}
global.__d(_fun77735, 9931, [57, 31, 661, 33, 9566, 6266, 9547, 9546, 9932, 477,
2]) /* metro module 9931, dependencies: [57, 31, 661, 33, 9566, 6266, 9547, 9546, 9932, 477, 2] */;
@@ -1,60 +1,82 @@
/* Metro module 9932; source: modules/media_viewer/native/components/MediaModalYoutubeEmbedError.tsx; dependencies: [31, 27, 33, 4501, 697, 9933, 4573, 1244, 4578, 3853, 2] */
import Native from '../../../../external/discord_common/js/packages/tokens/native.tsx'; /* Metro dependency 697 */
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 CreateStylesModule from '../../../../design/components/Styles/native/createStyles.tsx'; /* Metro dependency 4501 */
import * as TextModule from '../../../../design/components/Text/native/Text.tsx'; /* Metro dependency 4573 */
import * as ButtonNativeModule from '../../../../design/components/Button/native/Button.native.tsx'; /* Metro dependency 4578 */
import * as StreamFailedModule from '../../../../design/components/Illustration/native/redesign/generated/StreamFailed.tsx'; /* Metro dependency 9933 */
function _fun77742(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#77742, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10118:6, offset: 0x01e09bdd, size: 331 bytes, params: 8, frame: 23
var object4;
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
let value = importAll(31) /* metro dependency 31 */;
const env0_3 = (require(27) /* metro dependency 27 */).View;
const value2 = require(33) /* metro dependency 33 */;
const env0_4 = value2.jsx;
const env0_5 = value2.jsxs;
const createStylesModule = require(4501) /* metro dependency 4501: createStyles */;
const createStyles = createStylesModule.createStyles;
object4 = {};
const object5 = {'backgroundColor': null, 'padding': null, 'justifyContent': 'center', 'alignItems': 'center',
let value = ReactModule;
const createStyles = CreateStylesModule.createStyles;
object = {};
const object2 = {'backgroundColor': null, 'padding': null, 'justifyContent': 'center', 'alignItems': 'center',
'flex': 1};
const VOICE_VIDEO_VIDEO_TILE_BACKGROUND = (importDefault(697) /* metro dependency 697: native */).colors.VOICE_VIDEO_VIDEO_TILE_BACKGROUND;
object5.backgroundColor = VOICE_VIDEO_VIDEO_TILE_BACKGROUND;
const PX_32 = (importDefault(697) /* metro dependency 697: native */).space.PX_32;
object5.padding = PX_32;
object4.container = object5;
const object6 = {};
const PX_8 = (importDefault(697) /* metro dependency 697: native */).space.PX_8;
object6.marginBottom = PX_8;
const PX_16 = (importDefault(697) /* metro dependency 697: native */).space.PX_16;
object6.marginTop = PX_16;
object4.text = object6;
const env0_6 = Reflect.apply(createStyles, createStylesModule, [object4]);
const VOICE_VIDEO_VIDEO_TILE_BACKGROUND = (Native).colors.VOICE_VIDEO_VIDEO_TILE_BACKGROUND;
object2.backgroundColor = VOICE_VIDEO_VIDEO_TILE_BACKGROUND;
const PX_32 = (Native).space.PX_32;
object2.padding = PX_32;
object.container = object2;
const object3 = {};
const PX_8 = (Native).space.PX_8;
object3.marginBottom = PX_8;
const PX_16 = (Native).space.PX_16;
object3.marginTop = PX_16;
object.text = object3;
const env0_6 = Reflect.apply(createStyles, CreateStylesModule, [object]);
value = value.memo(MediaModalYoutubeEmbedError);
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/media_viewer/native/components/MediaModalYoutubeEmbedError.tsx');
(FileImportTrackerModule).fileFinishedImporting('modules/media_viewer/native/components/MediaModalYoutubeEmbedError.tsx');
exports.default = value;
function MediaModalYoutubeEmbedError({videoId}) { // fn#77743, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10118:413, offset: 0x01e09d28, size: 322 bytes, params: 2, frame: 24
const styles = useStyles();
const StreamFailed = (StreamFailedModule).StreamFailed;
const items2 = [
<StreamFailed resizeMode="contain" />,
];
const Text = (TextModule).Text;
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
let string = intl.string;
items2[1] = (
<Text
style={styles.text}
variant="text-md/semibold"
color="white"
>
{Reflect.apply(string, intl, [(require(1244) /* metro dependency 1244: indexNative */).t.u7vKPs])}
</Text>
);
const Button = (ButtonNativeModule).Button;
string = intl.string;
const LLpxJ5 = (require(1244) /* metro dependency 1244: indexNative */).t.LLpxJ5;
items2[2] = (
<Button
text={Reflect.apply(string, intl, [LLpxJ5])}
variant="primary-overlay"
shrink
grow={false}
onPress={onPress_77744}
/>
);
return (
<View style={styles.container}>
{items2}
</View>
);
function MediaModalYoutubeEmbedErrorOnPress() { // fn#77744, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10118:792, owner: MediaModalYoutubeEmbedError.onPress, offset: 0x01e09e6a, size: 69 bytes, params: 1, frame: 14
let value = environment.__proto__;
value = importDefault(3853) /* metro dependency 3853: Linking */;
value.openURL('https://youtube.com/watch?v=' + videoId);
}
}
}
function MediaModalYoutubeEmbedError({videoId}) { // fn#77743, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10118:413, offset: 0x01e09d28, size: 322 bytes, params: 2, frame: 24
const styles = useStyles();
const StreamFailed = (require(9933) /* metro dependency 9933: StreamFailed */).StreamFailed;
const items2 = [<StreamFailed resizeMode="contain" />];
const Text = (require(4573) /* metro dependency 4573: Text */).Text;
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
let string = intl.string;
items2[1] = <Text style={styles.text} variant="text-md/semibold" color="white">{Reflect.apply(string, intl,
[(require(1244) /* metro dependency 1244: indexNative */).t.u7vKPs])}</Text>;
const Button = (require(4578) /* metro dependency 4578: ButtonNative */).Button;
string = intl.string;
const LLpxJ5 = (require(1244) /* metro dependency 1244: indexNative */).t.LLpxJ5;
items2[2] = <Button text={Reflect.apply(string, intl,
[LLpxJ5])} variant="primary-overlay" shrink grow={false} onPress={onPress_77744} />;
return (
<View style={styles.container}>
{items2}
</View>
);
}
function MediaModalYoutubeEmbedErrorOnPress() { // fn#77744, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10118:792, owner: MediaModalYoutubeEmbedError.onPress, offset: 0x01e09e6a, size: 69 bytes, params: 1, frame: 14
let value = environment.__proto__;
value = importDefault(3853) /* metro dependency 3853: Linking */;
value.openURL('https://youtube.com/watch?v=' + videoId);
}
global.__d(_fun77742, 9932, [31, 27, 33, 4501, 697, 9933, 4573, 1244, 4578, 3853,
2]) /* metro module 9932, dependencies: [31, 27, 33, 4501, 697, 9933, 4573, 1244, 4578, 3853, 2] */;
@@ -1,274 +1,287 @@
/* Metro module 9568; source: modules/media_viewer/native/components/MediaShareActions.tsx; dependencies: [31, 9569, 1379, 4814, 9590, 661, 4824, 33, 632, 4821, 8367, 4080, 9546, 4631, 9212, 9547, 8872, 3853, 9591, 4601, 4010, 9794, 1962, 9797, 4062, 1244, 9600, 9798, 9757, 9799, 6692, 6805, 6807, 2] */
import ChannelStore from '../../../../stores/ChannelStore.tsx'; /* Metro dependency 1379 */
import ActionSheetActionCreators from '../../../action_sheet/native/ActionSheetActionCreators.tsx'; /* Metro dependency 4080 */
import MessageStore from '../../../../stores/MessageStore.tsx'; /* Metro dependency 4814 */
import ICYMIStore from '../../../icymi/ICYMIStore.tsx'; /* Metro dependency 9569 */
import MessagePreviewStore from '../../../../stores/native/MessagePreviewStore.tsx'; /* Metro dependency 9590 */
import * as FileImportTrackerModule from '../../../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
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 UseStateFromStoresModule from '../../../../external/discord_common/js/packages/flux/useStateFromStores.tsx'; /* Metro dependency 632 */
import * as ConstantsModule from '../../../../Constants.tsx'; /* Metro dependency 661 */
import * as IndexNativeModule from '../../../../intl/index.native.tsx'; /* Metro dependency 1244 */
import * as ExplicitMediaRedactionUtilsModule from '../../../explicit_media_redaction/ExplicitMediaRedactionUtils.tsx'; /* Metro dependency 4821 */
import * as ExplicitMediaRedactionConstantsModule from '../../../explicit_media_redaction/ExplicitMediaRedactionConstants.tsx'; /* Metro dependency 4824 */
import * as ActionSheetNativeModule from '../../../../design/components/Sheet/native/ActionSheet.native.tsx'; /* Metro dependency 6805 */
import * as ActionSheetRowNativeModule from '../../../../design/components/Sheet/native/ActionSheetRow.native.tsx'; /* Metro dependency 6807 */
import * as ExplicitMediaUtilsModule from '../../../messages/native/renderer/ExplicitMediaUtils.tsx'; /* Metro dependency 8367 */
import * as ShowShareActionSheetAndroidModule from '../../../action_sheet/native/showShareActionSheet.android.tsx'; /* Metro dependency 9212 */
import * as MediaViewerAnalyticsManagerModule from '../../MediaViewerAnalyticsManager.tsx'; /* Metro dependency 9547 */
import * as WindowLaunchIconModule from '../../../../design/components/Icon/native/redesign/generated/WindowLaunchIcon.tsx'; /* Metro dependency 9757 */
function _fun74736(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#74736, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9754:6, offset: 0x01d98adf, size: 287 bytes, params: 8, frame: 20
const env0_0 = require;
const closure = useMediaShareActions;
const useMediaShareActions2 = useMediaShareActions;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_3 = importAll(31) /* metro dependency 31 */;
const icymiStore = importDefault(9569) /* metro dependency 9569: ICYMIStore */;
const channelStore = importDefault(1379) /* metro dependency 1379: ChannelStore */;
const messageStore = importDefault(4814) /* metro dependency 4814: MessageStore */;
const messagePreviewStore = importDefault(9590) /* metro dependency 9590: MessagePreviewStore */;
const constantsModule = require(661) /* metro dependency 661: Constants */;
const env0_8 = constantsModule.AnalyticsSections;
const env0_9 = constantsModule.GIF_RE_IOS;
const env0_10 = constantsModule.MediaType;
const env0_11 = (require(4824) /* metro dependency 4824: ExplicitMediaRedactionConstants */).EXPLICIT_MEDIA_FALSE_POSITIVE_ACTION_SHEET_KEY;
const env0_12 = (require(33) /* metro dependency 33 */).jsx;
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/media_viewer/native/components/MediaShareActions.tsx');
(FileImportTrackerModule).fileFinishedImporting('modules/media_viewer/native/components/MediaShareActions.tsx');
exports.default = MediaShareActionSheet;
exports.useMediaShareActions = closure;
}
function useMediaShareActions({source, disableDownload, shareable}) { // fn#74737, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9754:278, offset: 0x01d98bfe, size: 623 bytes, params: 2, frame: 29
const channelId = source.channelId;
const env0_3 = channelId;
const value2 = (require(632) /* metro dependency 632: useStateFromStores */).useStateFromStores([MessageStore,
ICYMIStore, MessagePreviewStore], _fun74738, [channelId, source.messageId]);
const shouldAgeVerifyForExplicitMedia2 = (require(4821) /* metro dependency 4821: ExplicitMediaRedactionUtils */).shouldAgeVerifyForExplicitMedia();
const explicitMediaUtilsModule = require(8367) /* metro dependency 8367: ExplicitMediaUtils */;
const getAttachmentObscurityProps = explicitMediaUtilsModule.getAttachmentObscurityProps;
return env0_3.useMemo(_fun74746, [disableDownload, env0_3.useCallback(_fun74743, [value2, source]),
env0_3.useCallback(_fun74744, [source]), env0_3.useCallback(_fun74741, [source]), env0_3.useCallback(_fun74745,
[source]), env0_3.useCallback(_fun74739, [source]), env0_3.useCallback(_fun74740, [source]),
Reflect.apply(getAttachmentObscurityProps, explicitMediaUtilsModule, [{'attachment': null,
'shouldObscureSpoiler': true, 'enabledContentHarmTypeFlags': 0, attachment: source,
shouldAgeVerify: shouldAgeVerifyForExplicitMedia2}]).obscure, shareable,
(require(9797) /* metro dependency 9797: canForwardMessage */).useCanForwardMessage(value2) && (source.attachmentId != null || source.accessoryType === 'embed'),
(require(9546) /* metro dependency 9546: MediaSourceUtil */).getVideoSourceType(source), source.channelId,
source.messageId]);
}
function MediaShareActionSheet(a0) { // fn#74747, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9754:3265, offset: 0x01d99677, size: 156 bytes, params: 2, frame: 18
const value2 = useMediaShareActions({source: a0.source, disableDownload: a0.disableDownload,
shareable: a0.shareable});
const ActionSheet = (require(6805) /* metro dependency 6805: ActionSheetNative */).ActionSheet;
const ActionSheetRow = (require(6807) /* metro dependency 6807: ActionSheetRowNative */).ActionSheetRow;
const Group = ActionSheetRow.Group;
return (
<ActionSheet>
<Group hasIcons>
{value2.map(_fun74748)}
</Group>
</ActionSheet>
);
}
function _fun74738() { // fn#74738, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9754:420, offset: 0x01d98e6d, size: 109 bytes, params: 1, frame: 17
var r1;
var r0;
var value3;
var value4;
const channelIdBinding = channelId;
const value2 = null;
if (value2 == channelIdBinding) {
r0 = value2;
} else if (value2 == messageId) {
r0 = value2;
} else {
value3 = environment.__proto__;
value4 = MessageStore.getMessage(channelId, messageId);
r1 = value2 != value4 ? value4 : MessagePreviewStore.getMessage(messageId);
r1 = value2 == r1 ? ICYMIStore.getMessage(messageId) : r1;
r0 = r1;
}
return r0;
}
function _fun74739() { // fn#74739, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9754:741, offset: 0x01d98eda, size: 245 bytes, params: 1, frame: 20
var sourceURI;
var moduleValue;
var urlMatchesFileExtension;
var value3;
var moduleValue2;
var downloadMediaAssetWithContentType;
var moduleValue3;
(importDefault(4080) /* metro dependency 4080: ActionSheetActionCreators */).hideActionSheet();
if (source.videoURI != null) {
moduleValue3 = require(9546) /* metro dependency 9546: MediaSourceUtil */;
downloadMediaAssetWithContentType = moduleValue3.downloadMediaAssetWithContentType;
sourceBinding = source;
Reflect.apply(downloadMediaAssetWithContentType, moduleValue3, [sourceBinding.videoURI, MediaType.VIDEO,
sourceBinding.contentType]);
} else {
sourceURI = source.sourceURI;
if (sourceURI != null) {
moduleValue = require(4631) /* metro dependency 4631: MediaFormatTesters */;
urlMatchesFileExtension = moduleValue.urlMatchesFileExtension;
sourceBinding = source;
sourceURI = sourceBinding.sourceURI;
value3 = Reflect.apply(urlMatchesFileExtension, moduleValue, [sourceURI, GIF_RE_IOS]);
moduleValue2 = require(9546) /* metro dependency 9546: MediaSourceUtil */;
downloadMediaAssetWithContentType = moduleValue2.downloadMediaAssetWithContentType;
sourceURI = sourceBinding.sourceURI;
Reflect.apply(downloadMediaAssetWithContentType, moduleValue2, [sourceURI,
value3 ? MediaType.GIF : MediaType.IMAGE,
source.contentType]);
}
}
}
function _fun74740() { // fn#74740, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9754:1062, offset: 0x01d98fcf, size: 159 bytes, params: 1, frame: 18
(importDefault(4080) /* metro dependency 4080: ActionSheetActionCreators */).hideActionSheet();
const showShareActionSheetAndroidModule = require(9212) /* metro dependency 9212: showShareActionSheetAndroid */;
const showShareActionSheet = showShareActionSheetAndroidModule.showShareActionSheet;
let r2 = source.videoURI ?? source.sourceURI;
r2 = r2 ?? source.uri;
const MEDIA_VIEWER = AnalyticsSections.MEDIA_VIEWER;
Reflect.apply(showShareActionSheet, showShareActionSheetAndroidModule, [{url: r2}, MEDIA_VIEWER]);
const MediaViewerAnalytics = (require(9547) /* metro dependency 9547: MediaViewerAnalyticsManager */).MediaViewerAnalytics;
MediaViewerAnalytics.trackMediaViewerShareButtonTapped();
}
function _fun74741() { // fn#74741, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9754:1297, offset: 0x01d9906e, size: 118 bytes, params: 1, frame: 13
var environment;
const value = environment.__proto__;
(importDefault(4080) /* metro dependency 4080: ActionSheetActionCreators */).hideActionSheet();
if (source.sourceURI != null) {
(require(8872) /* metro dependency 8872: MaskedLinkUtils */).handleClick({href: source.sourceURI,
onConfirm: onConfirm_74742});
}
}
function _fun74743() { // fn#74743, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9754:1459, offset: 0x01d99117, size: 249 bytes, params: 1, frame: 18
var attachmentId;
const value = environment.__proto__;
(importDefault(4080) /* metro dependency 4080: ActionSheetActionCreators */).hideActionSheet();
if (env0_5 != null) {
if (source.accessoryType !== 'embed') {
attachmentId = source.attachmentId;
if (attachmentId != null) {
(require(9591) /* metro dependency 9591: ForwardModalUtils */).openForwardModal({message: env0_5,
source: 'media-viewer', initialSelectedDestinations: undefined,
forwardOptions: {onlyAttachmentIds: [attachmentId]}});
exports.useMediaShareActions = useMediaShareActions2;
function useMediaShareActions({source, disableDownload, shareable}) { // fn#74737, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9754:278, offset: 0x01d98bfe, size: 623 bytes, params: 2, frame: 29
const channelId = source.channelId;
const channelId2 = channelId;
const value2 = (UseStateFromStoresModule).useStateFromStores([MessageStore,
ICYMIStore, MessagePreviewStore], _fun74738, [channelId, source.messageId]);
const shouldAgeVerifyForExplicitMedia2 = (ExplicitMediaRedactionUtilsModule).shouldAgeVerifyForExplicitMedia();
const getAttachmentObscurityProps = ExplicitMediaUtilsModule.getAttachmentObscurityProps;
return channelId2.useMemo(_fun74746, [disableDownload, channelId2.useCallback(_fun74743, [value2, source]),
channelId2.useCallback(_fun74744, [source]), channelId2.useCallback(_fun74741, [source]),
channelId2.useCallback(_fun74745, [source]), channelId2.useCallback(_fun74739, [source]),
channelId2.useCallback(_fun74740, [source]), Reflect.apply(getAttachmentObscurityProps,
ExplicitMediaUtilsModule, [{'attachment': null, 'shouldObscureSpoiler': true, 'enabledContentHarmTypeFlags': 0,
attachment: source, shouldAgeVerify: shouldAgeVerifyForExplicitMedia2}]).obscure, shareable,
(require(9797) /* metro dependency 9797: canForwardMessage */).useCanForwardMessage(value2) && (source.attachmentId != null || source.accessoryType === 'embed'),
(require(9546) /* metro dependency 9546: MediaSourceUtil */).getVideoSourceType(source), source.channelId,
source.messageId]);
function _fun74738() { // fn#74738, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9754:420, offset: 0x01d98e6d, size: 109 bytes, params: 1, frame: 17
var r1;
var r0;
var value3;
var messageStoreBinding;
var value4;
const channelIdBinding = channelId;
const value2 = null;
if (value2 == channelIdBinding) {
r0 = value2;
} else if (value2 == messageId) {
r0 = value2;
} else {
value3 = environment.__proto__;
messageStoreBinding = MessageStore;
value4 = messageStoreBinding.getMessage(channelId, messageId);
r1 = value2 != value4 ? value4 : MessagePreviewStore.getMessage(messageId);
r1 = value2 == r1 ? ICYMIStore.getMessage(messageId) : r1;
r0 = r1;
}
} else {
(require(9591) /* metro dependency 9591: ForwardModalUtils */).openForwardModal({message: env0_5,
source: 'media-viewer', initialSelectedDestinations: undefined,
forwardOptions: {onlyEmbedIndices: [source.mediaIndex]}});
return r0;
}
function _fun74739() { // fn#74739, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9754:741, offset: 0x01d98eda, size: 245 bytes, params: 1, frame: 20
var sourceURI;
var moduleValue;
var urlMatchesFileExtension;
var value3;
var moduleValue2;
var downloadMediaAssetWithContentType;
var moduleValue3;
(ActionSheetActionCreators).hideActionSheet();
if (source.videoURI != null) {
moduleValue3 = require(9546) /* metro dependency 9546: MediaSourceUtil */;
downloadMediaAssetWithContentType = moduleValue3.downloadMediaAssetWithContentType;
sourceBinding = source;
Reflect.apply(downloadMediaAssetWithContentType, moduleValue3, [sourceBinding.videoURI, MediaType.VIDEO,
sourceBinding.contentType]);
} else {
sourceURI = source.sourceURI;
if (sourceURI != null) {
moduleValue = require(4631) /* metro dependency 4631: MediaFormatTesters */;
urlMatchesFileExtension = moduleValue.urlMatchesFileExtension;
sourceBinding = source;
sourceURI = sourceBinding.sourceURI;
value3 = Reflect.apply(urlMatchesFileExtension, moduleValue, [sourceURI, GIF_RE_IOS]);
moduleValue2 = require(9546) /* metro dependency 9546: MediaSourceUtil */;
downloadMediaAssetWithContentType = moduleValue2.downloadMediaAssetWithContentType;
sourceURI = sourceBinding.sourceURI;
Reflect.apply(downloadMediaAssetWithContentType, moduleValue2, [sourceURI,
value3 ? MediaType.GIF : MediaType.IMAGE,
source.contentType]);
}
}
}
function _fun74740() { // fn#74740, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9754:1062, offset: 0x01d98fcf, size: 159 bytes, params: 1, frame: 18
(ActionSheetActionCreators).hideActionSheet();
const showShareActionSheet = ShowShareActionSheetAndroidModule.showShareActionSheet;
let r2 = source.videoURI ?? source.sourceURI;
r2 = r2 ?? source.uri;
const MEDIA_VIEWER = AnalyticsSections.MEDIA_VIEWER;
Reflect.apply(showShareActionSheet, ShowShareActionSheetAndroidModule, [{url: r2}, MEDIA_VIEWER]);
const MediaViewerAnalytics = (MediaViewerAnalyticsManagerModule).MediaViewerAnalytics;
MediaViewerAnalytics.trackMediaViewerShareButtonTapped();
}
function _fun74741() { // fn#74741, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9754:1297, offset: 0x01d9906e, size: 118 bytes, params: 1, frame: 13
var environment;
const value = environment.__proto__;
(ActionSheetActionCreators).hideActionSheet();
if (source.sourceURI != null) {
(require(8872) /* metro dependency 8872: MaskedLinkUtils */).handleClick({href: source.sourceURI,
onConfirm: onConfirm_74742});
}
function onConfirm_74742() { // fn#74742, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9754:1397, offset: 0x01d990e4, size: 51 bytes, params: 1, frame: 12
let value = environment.__proto__.__proto__;
value = importDefault(3853) /* metro dependency 3853: Linking */;
value.openURL(source.sourceURI);
}
}
function _fun74743() { // fn#74743, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9754:1459, offset: 0x01d99117, size: 249 bytes, params: 1, frame: 18
var attachmentId;
const value = environment.__proto__;
(ActionSheetActionCreators).hideActionSheet();
if (env0_5 != null) {
if (source.accessoryType !== 'embed') {
attachmentId = source.attachmentId;
if (attachmentId != null) {
(require(9591) /* metro dependency 9591: ForwardModalUtils */).openForwardModal({message: env0_5,
source: 'media-viewer', initialSelectedDestinations: undefined,
forwardOptions: {onlyAttachmentIds: [attachmentId]}});
}
} else {
(require(9591) /* metro dependency 9591: ForwardModalUtils */).openForwardModal({message: env0_5,
source: 'media-viewer', initialSelectedDestinations: undefined,
forwardOptions: {onlyEmbedIndices: [source.mediaIndex]}});
}
}
}
function _fun74744() { // fn#74744, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9754:1873, offset: 0x01d99210, size: 194 bytes, params: 1, frame: 19
var messageId;
var transitionToMessage;
var moduleValue;
var isChatLockedOpen;
let value = environment.__proto__;
const value2 = undefined;
(ActionSheetActionCreators).hideActionSheet();
const channelStoreBinding = ChannelStore;
const getChannel = channelStoreBinding.getChannel;
let channelId = source.channelId;
if (Reflect.apply(getChannel, channelStoreBinding,
[channelId]) != null && source.channelId != null && source.messageId != null) {
value = require(4601) /* metro dependency 4601: transitionToChannel */;
transitionToMessage = value.transitionToMessage;
var {channelId, messageId} = source;
moduleValue = require(4010) /* metro dependency 4010: useChatLayout */;
isChatLockedOpen = moduleValue.getChatLayout().isChatLockedOpen;
Reflect.apply(transitionToMessage, value, [channelId, messageId,
{navigationReplace: isChatLockedOpen ? value2 : !isChatLockedOpen}]);
}
return value2;
}
function _fun74745() { // fn#74745, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9754:2125, offset: 0x01d992d2, size: 188 bytes, params: 1, frame: 19
var defaultImport2;
var openLazy;
var value6;
importDefault(dependencyMap[11]).hideActionSheet();
const attachmentId = source.attachmentId;
if (attachmentId != null && source.channelId != null && source.messageId != null) {
defaultImport2 = importDefault(dependencyMap[11]);
openLazy = defaultImport2.openLazy;
value6 = require(dependencyMap[22])(dependencyMap[21], dependencyMap.paths);
sourceBinding = source;
Reflect.apply(openLazy, defaultImport2, [value6, EXPLICIT_MEDIA_FALSE_POSITIVE_ACTION_SHEET_KEY,
{messageId: sourceBinding.messageId, channelId: sourceBinding.channelId, attachmentId: attachmentId}]);
}
}
function _fun74746() { // fn#74746, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9754:2475, offset: 0x01d9938e, size: 745 bytes, params: 1, frame: 19
var push;
var object;
var value5;
const intl = (IndexNativeModule).intl;
const t = (IndexNativeModule).t;
var object2;
var value6;
var object3;
var value7;
var object5;
var object6;
const items2 = [];
if (disableDownload !== true && env0_14 !== (require(9546) /* metro dependency 9546: MediaSourceUtil */).VideoSourceType.WEB_FILE_IFRAME) {
push = items2.push;
object = {};
value5 = environment.__proto__;
object.IconComponent = (require(4062) /* metro dependency 4062: DownloadIcon */).DownloadIcon;
object.label = intl.string(t['R3BPH+']);
object.action = env0_7;
Reflect.apply(push, items2, [object]);
}
if (env0_13) {
push = items2.push;
object2 = {};
value6 = environment.__proto__;
object2.IconComponent = importDefault(9600) /* metro dependency 9600: ForwardingIcon */;
object2.label = intl.string(t.I3ltXO);
object2.action = ConstantsModule.MediaType;
Reflect.apply(push, items2, [object2]);
}
if (shareable) {
push = items2.push;
object3 = {};
value7 = environment.__proto__;
object3.IconComponent = (require(9798) /* metro dependency 9798: ShareIcon */).ShareIcon;
object3.label = intl.string(t.RDE0Sc);
object3.action = ConstantsModule.AnalyticsSections;
Reflect.apply(push, items2, [object3]);
}
push = items2.push;
const WindowLaunchIcon = (WindowLaunchIconModule).WindowLaunchIcon;
Reflect.apply(push, items2, [{IconComponent: WindowLaunchIcon, label: intl.string(t.q5jLJB), action: ConstantsModule.GIF_RE_IOS}]);
if (source.channelId != null && source.messageId != null) {
push = items2.push;
object5 = {};
object5.IconComponent = (require(9799) /* metro dependency 9799: ChatArrowRightIcon */).ChatArrowRightIcon;
object5.label = intl.string(t['+TSRGD']);
object5.action = ExplicitMediaRedactionConstantsModule.EXPLICIT_MEDIA_FALSE_POSITIVE_ACTION_SHEET_KEY;
Reflect.apply(push, items2, [object5]);
}
if (obscure) {
push = items2.push;
object6 = {};
object6.IconComponent = (require(6692) /* metro dependency 6692: ImageWarningIcon */).ImageWarningIcon;
object6.label = intl.string(t.ZH7P2h);
object6.action = JsxRuntimeModule.jsx;
Reflect.apply(push, items2, [object6]);
}
return items2;
}
}
function MediaShareActionSheet(a0) { // fn#74747, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9754:3265, offset: 0x01d99677, size: 156 bytes, params: 2, frame: 18
const value2 = useMediaShareActions({source: a0.source, disableDownload: a0.disableDownload,
shareable: a0.shareable});
const ActionSheet = (ActionSheetNativeModule).ActionSheet;
const ActionSheetRow = (ActionSheetRowNativeModule).ActionSheetRow;
const Group = ActionSheetRow.Group;
return (
<ActionSheet>
<Group hasIcons>
{value2.map(_fun74748)}
</Group>
</ActionSheet>
);
function _fun74748(a0, a1) { // fn#74748, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9754:3508, offset: 0x01d99713, size: 111 bytes, params: 3, frame: 18
const ActionSheetRow = (ActionSheetRowNativeModule).ActionSheetRow;
const ActionSheetRow2 = (ActionSheetRowNativeModule).ActionSheetRow;
const Icon = ActionSheetRow2.Icon;
const IconComponent = a0.IconComponent;
return (
<ActionSheetRow
icon={<Icon IconComponent={IconComponent} />}
onPress={a0.action}
label={a0.label}
key={a1}
/>
);
}
}
}
function _fun74744() { // fn#74744, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9754:1873, offset: 0x01d99210, size: 194 bytes, params: 1, frame: 19
var messageId;
var transitionToMessage;
var moduleValue;
var isChatLockedOpen;
let value = environment.__proto__;
const value2 = undefined;
(importDefault(4080) /* metro dependency 4080: ActionSheetActionCreators */).hideActionSheet();
const getChannel = ChannelStore.getChannel;
let channelId = source.channelId;
if (Reflect.apply(getChannel, ChannelStore,
[channelId]) != null && source.channelId != null && source.messageId != null) {
value = require(4601) /* metro dependency 4601: transitionToChannel */;
transitionToMessage = value.transitionToMessage;
var {channelId, messageId} = source;
moduleValue = require(4010) /* metro dependency 4010: useChatLayout */;
isChatLockedOpen = moduleValue.getChatLayout().isChatLockedOpen;
Reflect.apply(transitionToMessage, value, [channelId, messageId,
{navigationReplace: isChatLockedOpen ? value2 : !isChatLockedOpen}]);
}
return value2;
}
function _fun74745() { // fn#74745, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9754:2125, offset: 0x01d992d2, size: 188 bytes, params: 1, frame: 19
var defaultImport2;
var openLazy;
var value6;
importDefault(dependencyMap[11]).hideActionSheet();
const attachmentId = source.attachmentId;
if (attachmentId != null && source.channelId != null && source.messageId != null) {
defaultImport2 = importDefault(dependencyMap[11]);
openLazy = defaultImport2.openLazy;
value6 = require(dependencyMap[22])(dependencyMap[21], dependencyMap.paths);
sourceBinding = source;
Reflect.apply(openLazy, defaultImport2, [value6, EXPLICIT_MEDIA_FALSE_POSITIVE_ACTION_SHEET_KEY,
{messageId: sourceBinding.messageId, channelId: sourceBinding.channelId, attachmentId: attachmentId}]);
}
}
function _fun74746() { // fn#74746, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9754:2475, offset: 0x01d9938e, size: 745 bytes, params: 1, frame: 19
var push;
var object4;
var value5;
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
const t = (require(1244) /* metro dependency 1244: indexNative */).t;
var object7;
var value6;
var object8;
var value7;
var object9;
var object10;
const items2 = [];
if (disableDownload !== true && env0_14 !== (require(9546) /* metro dependency 9546: MediaSourceUtil */).VideoSourceType.WEB_FILE_IFRAME) {
push = items2.push;
object4 = {};
value5 = environment.__proto__;
object4.IconComponent = (require(4062) /* metro dependency 4062: DownloadIcon */).DownloadIcon;
object4.label = intl.string(t['R3BPH+']);
object4.action = env0_7;
Reflect.apply(push, items2, [object4]);
}
if (env0_13) {
push = items2.push;
object7 = {};
value6 = environment.__proto__;
object7.IconComponent = importDefault(9600) /* metro dependency 9600: ForwardingIcon */;
object7.label = intl.string(t.I3ltXO);
object7.action = env0_10;
Reflect.apply(push, items2, [object7]);
}
if (shareable) {
push = items2.push;
object8 = {};
value7 = environment.__proto__;
object8.IconComponent = (require(9798) /* metro dependency 9798: ShareIcon */).ShareIcon;
object8.label = intl.string(t.RDE0Sc);
object8.action = env0_8;
Reflect.apply(push, items2, [object8]);
}
push = items2.push;
const WindowLaunchIcon = (require(9757) /* metro dependency 9757: WindowLaunchIcon */).WindowLaunchIcon;
Reflect.apply(push, items2, [{IconComponent: WindowLaunchIcon, label: intl.string(t.q5jLJB), action: env0_9}]);
if (source.channelId != null && source.messageId != null) {
push = items2.push;
object9 = {};
object9.IconComponent = (require(9799) /* metro dependency 9799: ChatArrowRightIcon */).ChatArrowRightIcon;
object9.label = intl.string(t['+TSRGD']);
object9.action = env0_11;
Reflect.apply(push, items2, [object9]);
}
if (obscure) {
push = items2.push;
object10 = {};
object10.IconComponent = (require(6692) /* metro dependency 6692: ImageWarningIcon */).ImageWarningIcon;
object10.label = intl.string(t.ZH7P2h);
object10.action = env0_12;
Reflect.apply(push, items2, [object10]);
}
return items2;
}
function _fun74748(a0, a1) { // fn#74748, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9754:3508, offset: 0x01d99713, size: 111 bytes, params: 3, frame: 18
const ActionSheetRow = (require(6807) /* metro dependency 6807: ActionSheetRowNative */).ActionSheetRow;
const ActionSheetRow2 = (require(6807) /* metro dependency 6807: ActionSheetRowNative */).ActionSheetRow;
const Icon = ActionSheetRow2.Icon;
const IconComponent = a0.IconComponent;
return (
<ActionSheetRow
icon={<Icon IconComponent={IconComponent} />}
onPress={a0.action}
label={a0.label}
key={a1}
/>
);
}
function onConfirm_74742() { // fn#74742, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9754:1397, offset: 0x01d990e4, size: 51 bytes, params: 1, frame: 12
let value = environment.__proto__.__proto__;
value = importDefault(3853) /* metro dependency 3853: Linking */;
value.openURL(source.sourceURI);
}
global.__d(_fun74736, 9568, [31, 9569, 1379, 4814, 9590, 661, 4824, 33, 632, 4821, 8367, 4080, 9546, 4631, 9212,
9547, 8872, 3853, 9591, 4601, 4010, 9794, 1962, 9797, 4062, 1244, 9600, 9798, 9757, 9799, 6692, 6805, 6807,
2]) /* metro module 9568, dependencies: [31, 9569, 1379, 4814, 9590, 661, 4824, 33, 632, 4821, 8367, 4080, 9546, 4631, 9212, 9547, 8872, 3853, 9591, 4601, 4010, 9794, 1962, 9797, 4062, 1244, 9600, 9798, 9757, 9799, 6692, 6805, 6807, 2] */;
@@ -1,187 +1,231 @@
/* Metro module 9553; source: modules/media_viewer/native/components/MediaSlider.tsx; dependencies: [57, 31, 27, 33, 4501, 477, 6518, 22, 674, 4690, 5278, 1244, 9376, 9554, 4573, 7992, 9556, 697, 2] */
import Module00022 from '../../../../by-id/module-00022.js'; /* Metro dependency 22 */
import Native from '../../../../external/discord_common/js/packages/tokens/native.tsx'; /* Metro dependency 697 */
import UseInitialValue from '../../../../hooks/useInitialValue.tsx'; /* Metro dependency 6518 */
import Module09556 from '../../../../by-id/module-09556.js'; /* Metro dependency 9556 */
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 PlatformUtilsModule from '../../../../utils/PlatformUtils.tsx'; /* Metro dependency 477 */
import * as IndexNativeModule from '../../../../intl/index.native.tsx'; /* Metro dependency 1244 */
import * as CreateStylesModule from '../../../../design/components/Styles/native/createStyles.tsx'; /* Metro dependency 4501 */
import * as TextModule from '../../../../design/components/Text/native/Text.tsx'; /* Metro dependency 4573 */
import * as TimeUtilsModule from '../../../../utils/native/TimeUtils.tsx'; /* Metro dependency 4690 */
import * as PressablesModule from '../../../../design/void/Pressables/native/Pressables.tsx'; /* Metro dependency 5278 */
function _fun74594(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#74594, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9739:6, offset: 0x01d92be8, size: 418 bytes, params: 8, frame: 25
var object2;
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const value = 0;
const value2 = undefined;
const env0_3 = importDefault(dependencyMap[value]);
const env0_4 = importAll(31) /* metro dependency 31 */;
const env0_5 = (require(27) /* metro dependency 27 */).View;
const value3 = require(33) /* metro dependency 33 */;
const env0_6 = value3.jsx;
const env0_7 = value3.jsxs;
const createStylesModule = require(4501) /* metro dependency 4501: createStyles */;
const createStyles = createStylesModule.createStyles;
object2 = {};
const createStyles = CreateStylesModule.createStyles;
object = {};
const value5 = 12;
object2.container = {'flex': 1, 'marginHorizontal': 12, 'flexDirection': 'row', 'alignItems': 'center',
object.container = {'flex': 1, 'marginHorizontal': 12, 'flexDirection': 'row', 'alignItems': 'center',
'justifyContent': 'space-between'};
const value6 = 16;
object2.icon = {marginRight: value6};
const platformUtilsModule = require(477) /* metro dependency 477: PlatformUtils */;
object2.centerText = {lineHeight: platformUtilsModule.isAndroid() ? value5 : value2};
const value8 = platformUtilsModule;
object2.sliderContainer = {'position': 'relative', 'flex': 1, 'marginHorizontal': null, 'justifyContent': 'center',
marginHorizontal: value8.isAndroid() ? value : value6};
object2.progressSliderContainer = {'position': 'relative', 'flex': 1, 'marginHorizontal': 0,
object.icon = {marginRight: value6};
object.centerText = {lineHeight: PlatformUtilsModule.isAndroid() ? value5 : value2};
object.sliderContainer = {'position': 'relative', 'flex': 1, 'marginHorizontal': null, 'justifyContent': 'center',
marginHorizontal: PlatformUtilsModule.isAndroid() ? value : value6};
object.progressSliderContainer = {'position': 'relative', 'flex': 1, 'marginHorizontal': 0,
'justifyContent': 'center'};
object2.timelineBackgroundSlider = {'position': 'absolute', 'width': '100%', 'backgroundColor': 'transparent',
object.timelineBackgroundSlider = {'position': 'absolute', 'width': '100%', 'backgroundColor': 'transparent',
'zIndex': 0};
object2.downloadProgressSlider = {'position': 'absolute', 'width': '100%', 'backgroundColor': 'transparent',
object.downloadProgressSlider = {'position': 'absolute', 'width': '100%', 'backgroundColor': 'transparent',
'zIndex': 1};
object2.playbackSlider = {'position': 'absolute', 'width': '100%', 'zIndex': 2};
const env0_8 = Reflect.apply(createStyles, createStylesModule, [object2]);
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/media_viewer/native/components/MediaSlider.tsx');
object.playbackSlider = {'position': 'absolute', 'width': '100%', 'zIndex': 2};
const env0_8 = Reflect.apply(createStyles, CreateStylesModule, [object]);
(FileImportTrackerModule).fileFinishedImporting('modules/media_viewer/native/components/MediaSlider.tsx');
exports.default = MediaSlider;
return value2;
}
function MediaSlider({style, controls, paused, setPaused, onPlayPress}) { // fn#74595, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9739:934, offset: 0x01d92d8a, size: 1410 bytes, params: 2, frame: 45
const styles = useStyles();
const binding = env0_4;
var env0_4 = binding.useRef(false);
let useState = binding.useState;
const value2 = Reflect.apply(useState, binding, [0]);
const binding2 = onPlayPress;
const value3 = binding2(value2, 2);
const property = value3[0];
const env0_5 = value3[1];
useState = binding.useState;
const value4 = binding2(Reflect.apply(useState, binding, [0]), 2);
const property2 = value4[0];
const env0_6 = value4[1];
useState = binding.useState;
const value5 = binding2(Reflect.apply(useState, binding, ['transparent']), 2);
const property3 = value5[0];
const env0_7 = value5[1];
const value6 = binding.useRef(0);
useState = binding.useState;
const value7 = binding2(Reflect.apply(useState, binding, [0]), 2);
const property4 = value7[0];
const env0_9 = value7[1];
const value8 = (UseInitialValue)(_fun74596);
const env0_11 = (UseInitialValue)(_fun74598);
binding.useEffect(function() {
return _fun74601;
}, [value8]);
controls.useSubscribe(_fun74602, function(a0) {
setPaused(a0);
}, _fun74604);
const value9 = binding.useCallback(_fun74605, [controls, paused]);
const value10 = binding.useCallback(_fun74606, [controls]);
let getTimeFormat = TimeUtilsModule.getTimeFormat;
const value11 = Reflect.apply(getTimeFormat, TimeUtilsModule, [property]);
const items3 = [styles.container, style];
const PressableOpacity = (PressablesModule).PressableOpacity;
const pressableOpacityProps = {style: styles.icon, accessibilityRole: 'button'};
const intl = (IndexNativeModule).intl;
const string = intl.string;
const t = (IndexNativeModule).t;
pressableOpacityProps.accessibilityLabel = paused ? Reflect.apply(string, intl, [t.RscU7I]) : Reflect.apply(string,
intl, [t.ZcgDJX]);
pressableOpacityProps.onPress = function() {
if (paused) {
onPlayPress();
}
controls.pause(!paused);
};
pressableOpacityProps.hitSlop = {'top': 8, 'right': 8, 'bottom': 8, 'left': 8};
const items2 = [
<PressableOpacity {...pressableOpacityProps}>
{((Component) => <Component size="md" color="white" />)(paused ? (require(9376) /* metro dependency 9376: PlayIcon */).PlayIcon : (require(9554) /* metro dependency 9554: PauseIcon */).PauseIcon)}
</PressableOpacity>,
];
const Text = (TextModule).Text;
items2[1] = (
<Text
style={[styles.centerText, {width: property4}]}
tabularNumbers
lineClamp={1}
color="white"
variant="text-xs/medium"
>
{value11}
</Text>
);
let value = importDefault(7992) /* metro dependency 7992 */;
value = ((Component) => <Component style={styles.timelineBackgroundSlider} value={1} minimumValue={0} maximumValue={1} thumbTintColor={(importDefault(674) /* metro dependency 674 */)('#FFFFFF').alpha(0).hex()} minimumTrackTintColor={(importDefault(674) /* metro dependency 674 */)('#FFFFFF').alpha(0.1).hex()} maximumTrackTintColor={(importDefault(674) /* metro dependency 674 */)('#FFFFFF').alpha(0.1).hex()} />)(value);
const items5 = [
<View pointerEvents="none" style={styles.progressSliderContainer}>
{value}
{((Component) => <Component style={styles.downloadProgressSlider} value={property2} minimumValue={0} maximumValue={1} thumbTintColor={(importDefault(674) /* metro dependency 674 */)('#FFFFFF').alpha(0).hex()} minimumTrackTintColor={(importDefault(674) /* metro dependency 674 */)('#FFFFFF').alpha(0.2).hex()} maximumTrackTintColor={property3} />)(importDefault(7992) /* metro dependency 7992 */)}
</View>,
];
value = importDefault(7992) /* metro dependency 7992 */;
const valueProps3 = {style: styles.playbackSlider, value: property,
thumbImage: Module09556, minimumValue: 0, maximumValue: value6.current};
const WHITE = (Native).unsafe_rawColors.WHITE;
valueProps3.minimumTrackTintColor = WHITE;
valueProps3.maximumTrackTintColor = 'transparent';
valueProps3.onValueChange = value8;
valueProps3.onSlidingStart = value9;
valueProps3.onSlidingComplete = value10;
items5[1] = ((Component) => <Component {...valueProps3} />)(value);
items2[2] = (
<View style={styles.sliderContainer}>
{items5}
</View>
);
value = TimeUtilsModule;
getTimeFormat = value.getTimeFormat;
items2[3] = (
<Text
style={styles.centerText}
variant="text-xs/medium"
color="white"
tabularNumbers
lineClamp={1}
onLayout={onLayout_74608}
>
{Reflect.apply(getTimeFormat, value, [value6.current])}
</Text>
);
return (
<View style={items3}>
{items2}
</View>
);
function _fun74596() { // fn#74596, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9739:1230, offset: 0x01d9330c, size: 51 bytes, params: 1, frame: 13
var environment;
const value = environment.__proto__;
return (Module00022).throttle(_fun74597, 100);
function _fun74597(a0) { // fn#74597, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9739:1252, offset: 0x00e76efe, size: 19 bytes, params: 2, frame: 11
env1_5(a0);
}
function MediaSlider({style, controls, paused, setPaused, onPlayPress}) { // fn#74595, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9739:934, offset: 0x01d92d8a, size: 1410 bytes, params: 2, frame: 45
const styles = useStyles();
const binding = env0_4;
var env0_4 = binding.useRef(false);
let useState = binding.useState;
const value2 = Reflect.apply(useState, binding, [0]);
const binding2 = onPlayPress;
const value3 = binding2(value2, 2);
const property = value3[0];
const env0_5 = value3[1];
useState = binding.useState;
const value4 = binding2(Reflect.apply(useState, binding, [0]), 2);
const property2 = value4[0];
const env0_6 = value4[1];
useState = binding.useState;
const value5 = binding2(Reflect.apply(useState, binding, ['transparent']), 2);
const property3 = value5[0];
const env0_7 = value5[1];
const value6 = binding.useRef(0);
useState = binding.useState;
const value7 = binding2(Reflect.apply(useState, binding, [0]), 2);
const property4 = value7[0];
const env0_9 = value7[1];
const value8 = (importDefault(6518) /* metro dependency 6518: useInitialValue */)(_fun74596);
const env0_11 = (importDefault(6518) /* metro dependency 6518: useInitialValue */)(_fun74598);
binding.useEffect(function() {
return _fun74601;
}, [value8]);
controls.useSubscribe(_fun74602, function(a0) {
setPaused(a0);
}, _fun74604);
const value9 = binding.useCallback(_fun74605, [controls, paused]);
const value10 = binding.useCallback(_fun74606, [controls]);
const timeUtilsModule = require(4690) /* metro dependency 4690: TimeUtils */;
let getTimeFormat = timeUtilsModule.getTimeFormat;
const value11 = Reflect.apply(getTimeFormat, timeUtilsModule, [property]);
const items3 = [styles.container, style];
const PressableOpacity = (require(5278) /* metro dependency 5278: Pressables */).PressableOpacity;
const pressableOpacityProps = {style: styles.icon, accessibilityRole: 'button'};
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
const string = intl.string;
const t = (require(1244) /* metro dependency 1244: indexNative */).t;
pressableOpacityProps.accessibilityLabel = paused ? Reflect.apply(string, intl, [t.RscU7I]) : Reflect.apply(string,
intl, [t.ZcgDJX]);
pressableOpacityProps.onPress = function() {
if (paused) {
onPlayPress();
}
controls.pause(!paused);
};
pressableOpacityProps.hitSlop = {'top': 8, 'right': 8, 'bottom': 8, 'left': 8};
const items2 = [<PressableOpacity {...pressableOpacityProps}>{((Component) => <Component size="md" color="white" />)(paused ? (require(9376) /* metro dependency 9376: PlayIcon */).PlayIcon : (require(9554) /* metro dependency 9554: PauseIcon */).PauseIcon)}</PressableOpacity>];
const Text = (require(4573) /* metro dependency 4573: Text */).Text;
items2[1] = <Text style={[styles.centerText,
{width: property4}]} tabularNumbers lineClamp={1} color="white" variant="text-xs/medium">{value11}</Text>;
let value = importDefault(7992) /* metro dependency 7992 */;
value = ((Component) => <Component style={styles.timelineBackgroundSlider} value={1} minimumValue={0} maximumValue={1} thumbTintColor={(importDefault(674) /* metro dependency 674 */)('#FFFFFF').alpha(0).hex()} minimumTrackTintColor={(importDefault(674) /* metro dependency 674 */)('#FFFFFF').alpha(0.1).hex()} maximumTrackTintColor={(importDefault(674) /* metro dependency 674 */)('#FFFFFF').alpha(0.1).hex()} />)(value);
const items5 = [<View pointerEvents="none" style={styles.progressSliderContainer}>{value}{((Component) => <Component style={styles.downloadProgressSlider} value={property2} minimumValue={0} maximumValue={1} thumbTintColor={(importDefault(674) /* metro dependency 674 */)('#FFFFFF').alpha(0).hex()} minimumTrackTintColor={(importDefault(674) /* metro dependency 674 */)('#FFFFFF').alpha(0.2).hex()} maximumTrackTintColor={property3} />)(importDefault(7992) /* metro dependency 7992 */)}</View>];
value = importDefault(7992) /* metro dependency 7992 */;
const valueProps3 = {style: styles.playbackSlider, value: property,
thumbImage: importDefault(9556) /* metro dependency 9556 */, minimumValue: 0, maximumValue: value6.current};
const WHITE = (importDefault(697) /* metro dependency 697: native */).unsafe_rawColors.WHITE;
valueProps3.minimumTrackTintColor = WHITE;
valueProps3.maximumTrackTintColor = 'transparent';
valueProps3.onValueChange = value8;
valueProps3.onSlidingStart = value9;
valueProps3.onSlidingComplete = value10;
items5[1] = ((Component) => <Component {...valueProps3} />)(value);
items2[2] = <View style={styles.sliderContainer}>{items5}</View>;
value = timeUtilsModule;
getTimeFormat = value.getTimeFormat;
items2[3] = <Text style={styles.centerText} variant="text-xs/medium" color="white" tabularNumbers lineClamp={1} onLayout={onLayout_74608}>{Reflect.apply(getTimeFormat,
value, [value6.current])}</Text>;
return (
<View style={items3}>
{items2}
</View>
);
}
function _fun74596() { // fn#74596, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9739:1230, offset: 0x01d9330c, size: 51 bytes, params: 1, frame: 13
var environment;
const value = environment.__proto__;
return (importDefault(22) /* metro dependency 22 */).throttle(_fun74597, 100);
}
function _fun74598() { // fn#74598, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9739:1281, offset: 0x01d9333f, size: 51 bytes, params: 1, frame: 13
var environment;
const value = environment.__proto__;
return (Module00022).throttle(_fun74599, 100);
function _fun74599(a0) { // fn#74599, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9739:1303, offset: 0x01d93372, size: 104 bytes, params: 2, frame: 14
var r1;
let value = environment.__proto__;
env1_6(a0);
const binding = env1_7;
value = 'transparent';
if (a0 !== 1) {
r1 = value;
} else {
value = environment.__proto__.__proto__;
value = importDefault(674) /* metro dependency 674 */;
value = value('#FFFFFF');
value = value.alpha(0.2);
value = value.hex();
r1 = value;
}
binding(r1);
}
function _fun74598() { // fn#74598, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9739:1281, offset: 0x01d9333f, size: 51 bytes, params: 1, frame: 13
var environment;
const value = environment.__proto__;
return (importDefault(22) /* metro dependency 22 */).throttle(_fun74599, 100);
}
}
function _fun74600() { // fn#74600, offset: 0x01d933da, size: 11 bytes, params: 1, frame: 1
return _fun74601;
}
function _fun74600() { // fn#74600, offset: 0x01d933da, size: 11 bytes, params: 1, frame: 1
return _fun74601;
function _fun74601() { // fn#74601, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9739:1396, offset: 0x01d933e5, size: 21 bytes, params: 1, frame: 9
env1_10.cancel();
}
function _fun74602(a0, a1) { // fn#74602, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9739:1435, offset: 0x01d933fa, size: 32 bytes, params: 3, frame: 12
env0_10(a0);
env0_8.current = a1;
}
}
function _fun74604(a0) { // fn#74604, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9739:1475, offset: 0x01d9341a, size: 19 bytes, params: 2, frame: 11
env0_11(a0);
}
function _fun74602(a0, a1) { // fn#74602, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9739:1435, offset: 0x01d933fa, size: 32 bytes, params: 3, frame: 12
env0_10(a0);
env0_8.current = a1;
}
function _fun74604(a0) { // fn#74604, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9739:1475, offset: 0x01d9341a, size: 19 bytes, params: 2, frame: 11
env0_11(a0);
}
function _fun74605() { // fn#74605, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9739:1508, offset: 0x01d9342d, size: 41 bytes, params: 1, frame: 12
if (!paused) {
controls.pause(true);
env0_4.current = true;
}
}
function _fun74606(a0) { // fn#74606, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9739:1569, offset: 0x01d93456, size: 64 bytes, params: 2, frame: 12
controls.seek(a0);
if (env0_4.current) {
controls.pause(false);
env0_4.current = false;
}
}
function MediaSliderOnLayout({nativeEvent}) { // fn#74608, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9739:3085, owner: MediaSlider.onLayout, offset: 0x01d934c4, size: 36 bytes, params: 2, frame: 11
env0_9(nativeEvent.layout.width);
}
function _fun74605() { // fn#74605, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9739:1508, offset: 0x01d9342d, size: 41 bytes, params: 1, frame: 12
if (!paused) {
controls.pause(true);
env0_4.current = true;
}
}
function _fun74606(a0) { // fn#74606, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9739:1569, offset: 0x01d93456, size: 64 bytes, params: 2, frame: 12
controls.seek(a0);
if (env0_4.current) {
controls.pause(false);
env0_4.current = false;
}
}
function MediaSliderOnLayout({nativeEvent}) { // fn#74608, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9739:3085, owner: MediaSlider.onLayout, offset: 0x01d934c4, size: 36 bytes, params: 2, frame: 11
env0_9(nativeEvent.layout.width);
}
function _fun74599(a0) { // fn#74599, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9739:1303, offset: 0x01d93372, size: 104 bytes, params: 2, frame: 14
var r1;
let value = environment.__proto__;
env1_6(a0);
const binding = env1_7;
value = 'transparent';
if (a0 !== 1) {
r1 = value;
} else {
value = environment.__proto__.__proto__;
value = importDefault(674) /* metro dependency 674 */;
value = value('#FFFFFF');
value = value.alpha(0.2);
value = value.hex();
r1 = value;
}
binding(r1);
}
function _fun74601() { // fn#74601, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9739:1396, offset: 0x01d933e5, size: 21 bytes, params: 1, frame: 9
env1_10.cancel();
}
global.__d(_fun74594, 9553, [57, 31, 27, 33, 4501, 477, 6518, 22, 674, 4690, 5278, 1244, 9376, 9554, 4573, 7992,
9556, 697,
2]) /* metro module 9553, dependencies: [57, 31, 27, 33, 4501, 477, 6518, 22, 674, 4690, 5278, 1244, 9376, 9554, 4573, 7992, 9556, 697, 2] */;
@@ -1,17 +1,31 @@
/* Metro module 9938; source: modules/media_viewer/native/components/MediaViewer.tsx; dependencies: [57, 31, 27, 33, 477, 4017, 9939, 9940, 8621, 5321, 8140, 6771, 6789, 9562, 9946, 4504, 9551, 7717, 7725, 4018, 7727, 2] */
import Module00057 from '../../../../by-id/module-00057.js'; /* Metro dependency 57 */
import ReanimatedRexport from '../../../reanimated/ReanimatedRexport.tsx'; /* Metro dependency 4017 */
import UseAnalyticsLocations from '../../../app_analytics/useAnalyticsLocations.tsx'; /* Metro dependency 6771 */
import AnalyticsLocation from '../../../app_analytics/AnalyticsLocation.tsx'; /* Metro dependency 6789 */
import StatusBarAndroid from '../../../status_bar/native/components/StatusBar.android.tsx'; /* Metro dependency 7725 */
import UseStateFromSharedValue from '../../../reanimated/native/useStateFromSharedValue.tsx'; /* Metro dependency 8621 */
import UseMediaViewerClosePosition from '../useMediaViewerClosePosition.tsx'; /* Metro dependency 9946 */
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 PlatformUtilsModule from '../../../../utils/PlatformUtils.tsx'; /* Metro dependency 477 */
import * as ReanimatedRexportModule from '../../../reanimated/ReanimatedRexport.tsx'; /* Metro dependency 4017 */
import * as Module05321Module from '../../../../by-id/module-05321.js'; /* Metro dependency 5321 */
import * as UseAnalyticsLocationsModule from '../../../app_analytics/useAnalyticsLocations.tsx'; /* Metro dependency 6771 */
import * as DeviceOrientationModule from '../../../device/native/DeviceOrientation.tsx'; /* Metro dependency 7717 */
import * as FastListModule from '../../../../lib/native/FastList.tsx'; /* Metro dependency 8140 */
import * as MediaViewerDimensionsContextModule from '../MediaViewerDimensionsContext.tsx'; /* Metro dependency 9562 */
import * as UseMediaViewerPanGestureModule from '../useMediaViewerPanGesture.tsx'; /* Metro dependency 9939 */
import * as MediaViewerItemModule from './MediaViewerItem.tsx'; /* Metro dependency 9940 */
function _fun77766(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#77766, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10124:6, offset: 0x01e0abdf, size: 378 bytes, params: 8, frame: 19
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_3 = importDefault(57) /* metro dependency 57 */;
let value = importAll(31) /* metro dependency 31 */;
const value2 = require(27) /* metro dependency 27 */;
const env0_5 = value2.View;
const env0_6 = value2.StyleSheet;
const value3 = require(33) /* metro dependency 33 */;
const env0_7 = value3.jsx;
const env0_8 = value3.jsxs;
const env0_9 = (require(477) /* metro dependency 477: PlatformUtils */).isAndroid();
let value = ReactModule;
const env0_9 = (PlatformUtilsModule).isAndroid();
object = {code: 'function MediaViewerTsx1(){const{zoomed,pinching}=this.__closure;return!zoomed.get()&&!pinching.get();}'};
object = {code: 'function MediaViewerTsx2(){const{scrollEnabled}=this.__closure;return{scrollEnabled:scrollEnabled.get()};}'};
const env0_12 = value.memo(_fun77778);
@@ -21,394 +35,401 @@ function _fun77766(global, require, importDefault, importAll, module, exports, d
object = {code: 'function MediaViewerTsx6(){const{overlayEnabled,isInteracting,runOnJS,setShowHeader}=this.__closure;if(overlayEnabled.get()&&!isInteracting.get()){runOnJS(setShowHeader)(true);}}'};
object = {code: "function MediaViewerTsx7(){const{absoluteFillObject,translatePos,hideRelayoutSharedValue,withTiming,Easing}=this.__closure;return{...absoluteFillObject,alignItems:'center',justifyContent:'center',transform:[{translateY:translatePos.get()}],opacity:hideRelayoutSharedValue.get()?0:withTiming(1,{easing:Easing.linear,duration:75})};}"};
value = value.memo(_fun77784);
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/media_viewer/native/components/MediaViewer.tsx');
(FileImportTrackerModule).fileFinishedImporting('modules/media_viewer/native/components/MediaViewer.tsx');
exports.default = value;
}
function MediaViewer(a0) { // fn#77767, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10124:3340, offset: 0x01e0ad59, size: 1587 bytes, params: 2, frame: 54
var object2;
const onClose = a0.onClose;
const onLongPress = a0.onLongPress;
const originLayout = a0.originLayout;
const renderMedia = a0.renderMedia;
const renderOverlay = a0.renderOverlay;
const swipeVelocityThreshold = a0.swipeVelocityThreshold;
const {index, sources, useViewerProps, zoomed} = a0.syncer;
const defaultImport = importDefault(6771) /* metro dependency 6771: useAnalyticsLocations */;
const MEDIA_VIEWER = (importDefault(6789) /* metro dependency 6789: AnalyticsLocation */).MEDIA_VIEWER;
const analyticsLocations = defaultImport([MEDIA_VIEWER]).analyticsLocations;
let binding = env0_4;
let useState = binding.useState;
const value3 = env0_3(Reflect.apply(useState, binding, [true]), 2);
const property = value3[0];
const property2 = value3[1];
const {width,
height} = (require(9562) /* metro dependency 9562: MediaViewerDimensionsContext */).useMediaViewerDimensions();
const value5 = (importDefault(9946) /* metro dependency 9946: useMediaViewerClosePosition */)({index: index,
onClose: onClose, sources: sources, windowHeight: height, windowWidth: width});
const value6 = (require(4017) /* metro dependency 4017: ReanimatedRexport */).useSharedValue(0);
var env0_3 = value6;
const value7 = (require(4017) /* metro dependency 4017: ReanimatedRexport */).useSharedValue(false);
var env0_4 = value7;
const value8 = (require(4017) /* metro dependency 4017: ReanimatedRexport */).useAnimatedRef();
const value9 = sources.length > 1;
const {ref, onScroll, onContentSizeChange, useItemVisible} = useViewerProps();
const value11 = (require(9939) /* metro dependency 9939: useMediaViewerPanGesture */).useMediaViewerPanGestureConfig(value5,
swipeVelocityThreshold, onClose);
const dismiss = value11.dismiss;
const translatePos = value11.translatePos;
const isClosing = value11.isClosing;
const isInteracting = value11.isInteracting;
const overlayEnabled = value11.overlayEnabled;
const absoluteFillObject = StyleSheet.absoluteFillObject;
const reanimatedRexportModule = require(4017) /* metro dependency 4017: ReanimatedRexport */;
let useAnimatedStyle = reanimatedRexportModule.useAnimatedStyle;
let closure = MediaViewerM;
object2 = {absoluteFillObject: absoluteFillObject, windowHeight: height, entranceAnimationDriver: value6};
object2.interpolate = reanimatedRexportModule.interpolate;
object2.translatePos = translatePos;
object2.closePosition = value5;
closure.__closure = object2;
closure.__workletHash = 10332062530694;
closure.__initData = env0_13;
const value12 = Reflect.apply(useAnimatedStyle, reanimatedRexportModule, [closure]);
binding = env0_4;
useState = binding.useState;
object2 = {};
copyDataProperties(object2, StyleSheet.absoluteFillObject, undefined);
object2['backgroundColor'] = 'transparent';
const property3 = env0_3(Reflect.apply(useState, binding, [object2]), 1)[0];
const moduleValue7 = reanimatedRexportModule;
useAnimatedStyle = moduleValue7.useAnimatedStyle;
closure = MediaViewerP;
object2 = {isClosing: isClosing, hideRelayoutSharedValue: value7, overlayEnabled: overlayEnabled,
isInteracting: isInteracting};
object2.withTiming = (require(4504) /* metro dependency 4504: timing */).withTiming;
const Easing = reanimatedRexportModule.Easing;
object2.Easing = Easing;
object2.runOnJS = reanimatedRexportModule.runOnJS;
object2.setShowHeader = property2;
closure.__closure = object2;
closure.__workletHash = 14874736878670;
closure.__initData = env0_14;
const value14 = Reflect.apply(useAnimatedStyle, moduleValue7, [closure]);
const moduleValue8 = reanimatedRexportModule;
const useDerivedValue = moduleValue8.useDerivedValue;
closure = MediaViewerX;
object2 = {overlayEnabled: overlayEnabled, isInteracting: isInteracting};
object2.runOnJS = reanimatedRexportModule.runOnJS;
object2.setShowHeader = property2;
closure.__closure = object2;
closure.__workletHash = 2199049578465;
closure.__initData = env0_16;
Reflect.apply(useDerivedValue, moduleValue8, [closure]);
const moduleValue9 = reanimatedRexportModule;
useAnimatedStyle = moduleValue9.useAnimatedStyle;
closure = MediaViewerLe;
object2 = {absoluteFillObject: absoluteFillObject, translatePos: translatePos, hideRelayoutSharedValue: value7};
object2.withTiming = (require(4504) /* metro dependency 4504: timing */).withTiming;
object2.Easing = Easing;
closure.__closure = object2;
closure.__workletHash = 8244409104374;
closure.__initData = env0_17;
const value15 = Reflect.apply(useAnimatedStyle, moduleValue9, [closure]);
const env0_12 = env0_4.useRef(null);
binding = env0_4;
let useCallback = binding.useCallback;
const value16 = Reflect.apply(useCallback, binding, [_fun77773, [value9, value8, value7]]);
const value17 = env0_4.useCallback(_fun77775, [value7]);
var env0_14 = env0_4.useRef(false);
env0_4.useEffect(_fun77776, [width, height, value16]);
binding = env0_4;
useCallback = binding.useCallback;
(require(7717) /* metro dependency 7717: DeviceOrientation */).useOrientationListener(Reflect.apply(useCallback,
binding, [_fun77777, [value16]]));
const env0_122 = ((Component) => <Component entranceAnimationDriver={value6} onContentSizeChange={onContentSizeChange} onScroll={onScroll} onLongPress={onLongPress} originLayout={originLayout} panGestureConfig={value11} ref={ref} renderMedia={renderMedia} sources={sources} useItemVisible={useItemVisible} windowHeight={height} windowWidth={width} index={index} zoomed={zoomed} />)(env0_12);
const absoluteFill = StyleSheet.absoluteFill;
const items2 = [((Component) => <Component barStyle="light-content" hidden={!property} />)(importDefault(7725) /* metro dependency 7725: StatusBarAndroid */)];
const View2 = (importDefault(4017) /* metro dependency 4017: ReanimatedRexport */).View;
items2[1] = <View2 style={value12} />;
items2[2] = ((Component) => <Component ref={value8} style={value15}>{env0_122}</Component>)(importDefault(4018) /* metro dependency 4018: REAWorkaroundView */);
items2[3] = ((Component) => <Component style={[property3,
value14]} pointerEvents={property ? 'box-none' : 'none'}>{renderOverlay(dismiss,
overlayEnabled)}</Component>)(importDefault(4018) /* metro dependency 4018: REAWorkaroundView */);
items2[4] = ((Component) => <Component />)(importDefault(7727) /* metro dependency 7727: HomeIndicator */);
const view = <View style={absoluteFill} onAccessibilityEscape={dismiss} onLayout={value17}>{items2}</View>;
const AnalyticsLocationProvider = (require(6771) /* metro dependency 6771: useAnalyticsLocations */).AnalyticsLocationProvider;
return (
<AnalyticsLocationProvider value={analyticsLocations}>
{view}
</AnalyticsLocationProvider>
);
}
function _fun77778({entranceAnimationDriver, onContentSizeChange, onLongPress, onScroll, originLayout, panGestureConfig, renderMedia, sources, useItemVisible, windowWidth, windowHeight, ref, index, zoomed}) { // fn#77778, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10124:442, offset: 0x01e0b7d0, size: 700 bytes, params: 2, frame: 38
const env0_4 = renderMedia;
const value2 = (require(4017) /* metro dependency 4017: ReanimatedRexport */).useSharedValue(false);
const env0_10 = value2;
const reanimatedRexportModule = require(4017) /* metro dependency 4017: ReanimatedRexport */;
const useDerivedValue = reanimatedRexportModule.useDerivedValue;
let closure = T_77779;
closure.__closure = {zoomed: zoomed, pinching: value2};
closure.__workletHash = 9157951736691;
closure.__initData = env0_10;
const value3 = Reflect.apply(useDerivedValue, reanimatedRexportModule, [closure]);
const env0_11 = value3;
const value4 = env0_4.useCallback(_fun77780, [value2]);
const value5 = env0_4.useCallback(_fun77781, [value2]);
const {panGestureGenerator,
nativeGesture} = (require(9939) /* metro dependency 9939: useMediaViewerPanGesture */).useMediaViewerPanGesture(panGestureConfig,
value3);
const value7 = env0_4.useCallback(_fun77782, [entranceAnimationDriver, onLongPress, originLayout, panGestureConfig,
panGestureGenerator, renderMedia, sources, useItemVisible, windowHeight, windowWidth, zoomed]);
const moduleValue4 = reanimatedRexportModule;
const useAnimatedProps = moduleValue4.useAnimatedProps;
closure = H_77783;
closure.__closure = {scrollEnabled: value3};
closure.__workletHash = 13550782123441;
closure.__initData = env0_11;
const value8 = Reflect.apply(useAnimatedProps, moduleValue4, [closure]);
const value9 = (importDefault(8621) /* metro dependency 8621: useStateFromSharedValue */)(index);
const GestureDetector = (require(5321) /* metro dependency 5321 */).GestureDetector;
const AnimatedFastList = (require(8140) /* metro dependency 8140: FastList */).AnimatedFastList;
return (
<GestureDetector gesture={nativeGesture}>
<AnimatedFastList
ref={ref}
style={StyleSheet.absoluteFill}
sections={[sources.length]}
onTouchStart={value4}
onTouchEnd={value5}
onTouchCancel={value5}
initialScrollItem={value9}
automaticallyAdjustContentInsets={false}
showsVerticalScrollIndicator={false}
showsHorizontalScrollIndicator={false}
itemSize={windowWidth}
renderItem={value7}
onContentSizeChange={onContentSizeChange}
pagingEnabled
onScroll={onScroll}
scrollEventThrottle={16}
animatedProps={value8}
disableLegacyGestureHandling
chunkBase={windowWidth}
horizontal
/>
</GestureDetector>
);
}
function _fun77784(a0) { // fn#77784, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10124:6743, offset: 0x01e0bbb2, size: 75 bytes, params: 2, frame: 17
const MediaViewerDimensionsProvider = (require(9562) /* metro dependency 9562: MediaViewerDimensionsContext */).MediaViewerDimensionsProvider;
return (
<MediaViewerDimensionsProvider>
<MediaViewer {...a0} />
</MediaViewerDimensionsProvider>
);
}
function MediaViewerM() { // fn#77768, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10124:4100, owner: MediaViewer.M, offset: 0x01e0b38c, size: 171 bytes, params: 1, frame: 20
const object2 = {};
copyDataProperties(object2, absoluteFillObject, undefined);
object2['height'] = height;
object2['backgroundColor'] = 'black';
const Math = global.Math;
const min = Math.min;
let binding = env0_3;
const value2 = binding.get();
const reanimatedRexportModule = require(4017) /* metro dependency 4017: ReanimatedRexport */;
const interpolate = reanimatedRexportModule.interpolate;
const value4 = translatePos.get();
binding = env0_2;
object2['opacity'] = Reflect.apply(min, Math, [value2, Reflect.apply(interpolate, reanimatedRexportModule, [value4,
[-binding, 0, binding], [0, 1, 0]])]);
return object2;
}
function MediaViewerP() { // fn#77769, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10124:4524, owner: MediaViewer.P, offset: 0x01e0b437, size: 329 bytes, params: 1, frame: 26
var environment;
var r2;
var r1;
var binding;
var overlayEnabledBinding;
var isInteractingBinding;
var withTiming;
const Easing = (require(4017) /* metro dependency 4017: ReanimatedRexport */).Easing;
var value4;
var moduleValue;
var object;
var closure;
const runOnJS = (require(4017) /* metro dependency 4017: ReanimatedRexport */).runOnJS;
var value;
const value2 = isClosing.get();
const value3 = 0;
if (value2) {
r1 = value3;
} else {
function MediaViewer(a0) { // fn#77767, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10124:3340, offset: 0x01e0ad59, size: 1587 bytes, params: 2, frame: 54
const onClose = a0.onClose;
const onLongPress = a0.onLongPress;
const originLayout = a0.originLayout;
const renderMedia = a0.renderMedia;
const renderOverlay = a0.renderOverlay;
const swipeVelocityThreshold = a0.swipeVelocityThreshold;
const {index, sources, useViewerProps, zoomed} = a0.syncer;
const defaultImport = UseAnalyticsLocations;
const MEDIA_VIEWER = (AnalyticsLocation).MEDIA_VIEWER;
const analyticsLocations = defaultImport([MEDIA_VIEWER]).analyticsLocations;
let binding = env0_4;
let useState = binding.useState;
const value3 = env0_3(Reflect.apply(useState, binding, [true]), 2);
const property = value3[0];
const property2 = value3[1];
const {width,
height} = (MediaViewerDimensionsContextModule).useMediaViewerDimensions();
const value5 = (UseMediaViewerClosePosition)({index: index,
onClose: onClose, sources: sources, windowHeight: height, windowWidth: width});
const value6 = (ReanimatedRexportModule).useSharedValue(0);
var env0_3 = value6;
const value7 = (ReanimatedRexportModule).useSharedValue(false);
var env0_4 = value7;
const value8 = (ReanimatedRexportModule).useAnimatedRef();
const value9 = sources.length > 1;
const {ref, onScroll, onContentSizeChange, useItemVisible} = useViewerProps();
const value11 = (UseMediaViewerPanGestureModule).useMediaViewerPanGestureConfig(value5,
swipeVelocityThreshold, onClose);
const dismiss = value11.dismiss;
const translatePos = value11.translatePos;
const isClosing = value11.isClosing;
const isInteracting = value11.isInteracting;
const overlayEnabled = value11.overlayEnabled;
const absoluteFillObject = StyleSheet.absoluteFillObject;
let useAnimatedStyle = ReanimatedRexportModule.useAnimatedStyle;
let closure = MediaViewerM;
object = {absoluteFillObject: absoluteFillObject, windowHeight: height, entranceAnimationDriver: value6};
object.interpolate = ReanimatedRexportModule.interpolate;
object.translatePos = translatePos;
object.closePosition = value5;
closure.__closure = object;
closure.__workletHash = 10332062530694;
closure.__initData = env0_13;
const value12 = Reflect.apply(useAnimatedStyle, ReanimatedRexportModule, [closure]);
binding = env0_4;
if (binding.get()) {
r1 = value3;
} else {
overlayEnabledBinding = overlayEnabled;
if (overlayEnabledBinding.get()) {
isInteractingBinding = isInteracting;
if (isInteractingBinding.get()) {
value4 = environment.__proto__;
moduleValue = require(4504) /* metro dependency 4504: timing */;
withTiming = moduleValue.withTiming;
object = {};
object.easing = Easing.linear;
object.duration = 75;
closure = PN_77770;
closure.__closure = {runOnJS: runOnJS, setShowHeader: env0_0};
closure.__workletHash = 11572173694016;
closure.__initData = env1_15;
r2 = Reflect.apply(withTiming, moduleValue, [value3, object, 'respect-motion-settings', closure]);
} else {
value = environment.__proto__;
value = require(4504) /* metro dependency 4504: timing */;
value = value.withTiming(1, {easing: Easing.linear, duration: 150});
r2 = value;
}
} else {
value4 = environment.__proto__;
moduleValue = require(4504) /* metro dependency 4504: timing */;
withTiming = moduleValue.withTiming;
object = {};
object.easing = Easing.linear;
object.duration = 75;
closure = PN_77770;
closure.__closure = {runOnJS: runOnJS, setShowHeader: env0_0};
closure.__workletHash = 11572173694016;
closure.__initData = env1_15;
r2 = Reflect.apply(withTiming, moduleValue, [value3, object, 'respect-motion-settings', closure]);
}
r1 = r2;
useState = binding.useState;
object = {};
copyDataProperties(object, StyleSheet.absoluteFillObject, undefined);
object['backgroundColor'] = 'transparent';
const property3 = env0_3(Reflect.apply(useState, binding, [object]), 1)[0];
useAnimatedStyle = ReanimatedRexportModule.useAnimatedStyle;
closure = MediaViewerP;
object = {isClosing: isClosing, hideRelayoutSharedValue: value7, overlayEnabled: overlayEnabled,
isInteracting: isInteracting};
object.withTiming = (require(4504) /* metro dependency 4504: timing */).withTiming;
const Easing = ReanimatedRexportModule.Easing;
object.Easing = Easing;
object.runOnJS = ReanimatedRexportModule.runOnJS;
object.setShowHeader = property2;
closure.__closure = object;
closure.__workletHash = 14874736878670;
closure.__initData = env0_14;
const value14 = Reflect.apply(useAnimatedStyle, ReanimatedRexportModule, [closure]);
const useDerivedValue = ReanimatedRexportModule.useDerivedValue;
closure = MediaViewerX;
object = {overlayEnabled: overlayEnabled, isInteracting: isInteracting};
object.runOnJS = ReanimatedRexportModule.runOnJS;
object.setShowHeader = property2;
closure.__closure = object;
closure.__workletHash = 2199049578465;
closure.__initData = env0_16;
Reflect.apply(useDerivedValue, ReanimatedRexportModule, [closure]);
useAnimatedStyle = ReanimatedRexportModule.useAnimatedStyle;
closure = MediaViewerLe;
object = {absoluteFillObject: absoluteFillObject, translatePos: translatePos, hideRelayoutSharedValue: value7};
object.withTiming = (require(4504) /* metro dependency 4504: timing */).withTiming;
object.Easing = Easing;
closure.__closure = object;
closure.__workletHash = 8244409104374;
closure.__initData = env0_17;
const value15 = Reflect.apply(useAnimatedStyle, ReanimatedRexportModule, [closure]);
const env0_12 = env0_4.useRef(null);
binding = env0_4;
let useCallback = binding.useCallback;
const value16 = Reflect.apply(useCallback, binding, [_fun77773, [value9, value8, value7]]);
const value17 = env0_4.useCallback(_fun77775, [value7]);
var env0_14 = env0_4.useRef(false);
env0_4.useEffect(_fun77776, [width, height, value16]);
binding = env0_4;
useCallback = binding.useCallback;
(DeviceOrientationModule).useOrientationListener(Reflect.apply(useCallback,
binding, [_fun77777, [value16]]));
const env0_123 = ((Component) => <Component entranceAnimationDriver={value6} onContentSizeChange={onContentSizeChange} onScroll={onScroll} onLongPress={onLongPress} originLayout={originLayout} panGestureConfig={value11} ref={ref} renderMedia={renderMedia} sources={sources} useItemVisible={useItemVisible} windowHeight={height} windowWidth={width} index={index} zoomed={zoomed} />)(env0_12);
const absoluteFill = StyleSheet.absoluteFill;
const items2 = [
((Component) => <Component barStyle="light-content" hidden={!property} />)(StatusBarAndroid),
];
const View2 = (ReanimatedRexport).View;
items2[1] = <View2 style={value12} />;
items2[2] = ((Component) => <Component ref={value8} style={value15}>{env0_123}</Component>)(importDefault(4018) /* metro dependency 4018: REAWorkaroundView */);
items2[3] = ((Component) => <Component style={[property3,
value14]} pointerEvents={property ? 'box-none' : 'none'}>{renderOverlay(dismiss,
overlayEnabled)}</Component>)(importDefault(4018) /* metro dependency 4018: REAWorkaroundView */);
items2[4] = ((Component) => <Component />)(importDefault(7727) /* metro dependency 7727: HomeIndicator */);
const view = (
<View
style={absoluteFill}
onAccessibilityEscape={dismiss}
onLayout={value17}
>
{items2}
</View>
);
const AnalyticsLocationProvider = (UseAnalyticsLocationsModule).AnalyticsLocationProvider;
return (
<AnalyticsLocationProvider value={analyticsLocations}>
{view}
</AnalyticsLocationProvider>
);
function MediaViewerM() { // fn#77768, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10124:4100, owner: MediaViewer.M, offset: 0x01e0b38c, size: 171 bytes, params: 1, frame: 20
const object = {};
copyDataProperties(object, absoluteFillObject, undefined);
object['height'] = height;
object['backgroundColor'] = 'black';
const Math = global.Math;
const min = Math.min;
let binding = env0_3;
const value2 = binding.get();
const interpolate = ReanimatedRexportModule.interpolate;
const value4 = translatePos.get();
binding = env0_2;
object['opacity'] = Reflect.apply(min, Math, [value2, Reflect.apply(interpolate, ReanimatedRexportModule, [value4,
[-binding, 0, binding], [0, 1, 0]])]);
return object;
}
function MediaViewerP() { // fn#77769, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10124:4524, owner: MediaViewer.P, offset: 0x01e0b437, size: 329 bytes, params: 1, frame: 26
var environment;
var r2;
var r1;
var binding;
var overlayEnabledBinding;
var isInteractingBinding;
var withTiming;
const Easing = (ReanimatedRexportModule).Easing;
var value4;
var moduleValue;
var object2;
var PN_777702;
const runOnJS = (ReanimatedRexportModule).runOnJS;
var value;
const value2 = isClosing.get();
const value3 = 0;
if (value2) {
r1 = value3;
} else {
binding = env0_4;
if (binding.get()) {
r1 = value3;
} else {
overlayEnabledBinding = overlayEnabled;
if (overlayEnabledBinding.get()) {
isInteractingBinding = isInteracting;
if (isInteractingBinding.get()) {
value4 = environment.__proto__;
moduleValue = require(4504) /* metro dependency 4504: timing */;
withTiming = moduleValue.withTiming;
object2 = {};
object2.easing = Easing.linear;
object2.duration = 75;
PN_777702 = PN_77770;
PN_777702.__closure = {runOnJS: runOnJS, setShowHeader: env0_0};
PN_777702.__workletHash = 11572173694016;
PN_777702.__initData = env1_15;
r2 = Reflect.apply(withTiming, moduleValue, [value3, object2, 'respect-motion-settings',
PN_777702]);
} else {
value = environment.__proto__;
value = require(4504) /* metro dependency 4504: timing */;
value = value.withTiming(1, {easing: Easing.linear, duration: 150});
r2 = value;
}
} else {
value4 = environment.__proto__;
moduleValue = require(4504) /* metro dependency 4504: timing */;
withTiming = moduleValue.withTiming;
object2 = {};
object2.easing = Easing.linear;
object2.duration = 75;
PN_777702 = PN_77770;
PN_777702.__closure = {runOnJS: runOnJS, setShowHeader: env0_0};
PN_777702.__workletHash = 11572173694016;
PN_777702.__initData = env1_15;
r2 = Reflect.apply(withTiming, moduleValue, [value3, object2, 'respect-motion-settings', PN_777702]);
}
r1 = r2;
}
}
return {opacity: r1};
function PN_77770() { // fn#77770, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10124:4745, owner: MediaViewer.P.n, offset: 0x01e0b580, size: 51 bytes, params: 1, frame: 12
let value = environment.__proto__.__proto__;
value = require(4017) /* metro dependency 4017: ReanimatedRexport */;
value = value.runOnJS(env1_0);
value(false);
}
}
function MediaViewerX() { // fn#77771, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10124:5148, owner: MediaViewer.x, offset: 0x01e0b5b3, size: 88 bytes, params: 1, frame: 12
var value4;
if (overlayEnabled.get() && !isInteracting.get()) {
value4 = environment.__proto__;
(require(4017) /* metro dependency 4017: ReanimatedRexport */).runOnJS(env0_0)(true);
}
}
function MediaViewerLe() { // fn#77772, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10124:5381, owner: MediaViewer.le, offset: 0x01e0b60b, size: 181 bytes, params: 1, frame: 18
var r2;
var withTiming;
var object;
const object2 = {};
copyDataProperties(object2, absoluteFillObject, undefined);
object2['alignItems'] = 'center';
object2['justifyContent'] = 'center';
const object3 = {};
object3.translateY = translatePos.get();
object2['transform'] = [object3];
let value = env0_4.get();
if (value) {
r2 = 0;
} else {
value = environment.__proto__;
value = require(4504) /* metro dependency 4504: timing */;
withTiming = value.withTiming;
object = {};
object.easing = (require(4017) /* metro dependency 4017: ReanimatedRexport */).Easing.linear;
object.duration = 75;
value = Reflect.apply(withTiming, value, [1, object]);
r2 = value;
}
object2['opacity'] = r2;
return object2;
}
function _fun77773() { // fn#77773, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10124:5773, offset: 0x01e0b6c0, size: 102 bytes, params: 1, frame: 14
var binding;
var clearTimeout;
if (result && ReactNativeModule.View.current != null) {
binding = env0_4;
binding.set(true);
clearTimeout = global.clearTimeout;
binding = env0_12;
clearTimeout(binding.current);
binding.current = global.setTimeout(_fun77774, 250);
}
function _fun77774() { // fn#77774, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10124:5857, offset: 0x01e0b726, size: 23 bytes, params: 1, frame: 11
env1_4.set(false);
}
}
function _fun77775() { // fn#77775, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10124:5909, offset: 0x01e0b73d, size: 23 bytes, params: 1, frame: 11
env0_4.set(false);
}
function _fun77776() { // fn#77776, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10124:5960, offset: 0x01e0b754, size: 43 bytes, params: 1, frame: 10
if (env0_14.current) {
env0_13();
} else {
env0_14.current = true;
}
}
function _fun77777({orientation}, {orientation}) { // fn#77777, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10124:6029, offset: 0x01e0b77f, size: 81 bytes, params: 3, frame: 11
if (orientation !== orientation) {
env0_13();
}
const value = environment.__proto__;
if (env1_9) {
(require(9551) /* metro dependency 9551: useVideoControls */).unpauseCurrentVideoIfNeeded();
}
}
}
return {opacity: r1};
}
function MediaViewerX() { // fn#77771, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10124:5148, owner: MediaViewer.x, offset: 0x01e0b5b3, size: 88 bytes, params: 1, frame: 12
var value4;
if (overlayEnabled.get() && !isInteracting.get()) {
value4 = environment.__proto__;
(require(4017) /* metro dependency 4017: ReanimatedRexport */).runOnJS(env0_0)(true);
function _fun77778({entranceAnimationDriver, onContentSizeChange, onLongPress, onScroll, originLayout, panGestureConfig, renderMedia, sources, useItemVisible, windowWidth, windowHeight, ref, index, zoomed}) { // fn#77778, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10124:442, offset: 0x01e0b7d0, size: 700 bytes, params: 2, frame: 38
const renderMedia2 = renderMedia;
const value2 = (ReanimatedRexportModule).useSharedValue(false);
const env0_10 = value2;
const useDerivedValue = ReanimatedRexportModule.useDerivedValue;
let closure = T_77779;
closure.__closure = {zoomed: zoomed, pinching: value2};
closure.__workletHash = 9157951736691;
closure.__initData = env0_10;
const value3 = Reflect.apply(useDerivedValue, ReanimatedRexportModule, [closure]);
const env0_11 = value3;
const value4 = renderMedia2.useCallback(_fun77780, [value2]);
const value5 = renderMedia2.useCallback(_fun77781, [value2]);
const {panGestureGenerator,
nativeGesture} = (UseMediaViewerPanGestureModule).useMediaViewerPanGesture(panGestureConfig,
value3);
const value7 = renderMedia2.useCallback(_fun77782, [entranceAnimationDriver, onLongPress, originLayout,
panGestureConfig, panGestureGenerator, renderMedia, sources, useItemVisible, windowHeight, windowWidth, zoomed]);
const useAnimatedProps = ReanimatedRexportModule.useAnimatedProps;
closure = H_77783;
closure.__closure = {scrollEnabled: value3};
closure.__workletHash = 13550782123441;
closure.__initData = env0_11;
const value8 = Reflect.apply(useAnimatedProps, ReanimatedRexportModule, [closure]);
const value9 = (UseStateFromSharedValue)(index);
const GestureDetector = (Module05321Module).GestureDetector;
const AnimatedFastList = (FastListModule).AnimatedFastList;
return (
<GestureDetector gesture={nativeGesture}>
<AnimatedFastList
ref={ref}
style={StyleSheet.absoluteFill}
sections={[sources.length]}
onTouchStart={value4}
onTouchEnd={value5}
onTouchCancel={value5}
initialScrollItem={value9}
automaticallyAdjustContentInsets={false}
showsVerticalScrollIndicator={false}
showsHorizontalScrollIndicator={false}
itemSize={windowWidth}
renderItem={value7}
onContentSizeChange={onContentSizeChange}
pagingEnabled
onScroll={onScroll}
scrollEventThrottle={16}
animatedProps={value8}
disableLegacyGestureHandling
chunkBase={windowWidth}
horizontal
/>
</GestureDetector>
);
function T_77779() { // fn#77779, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10124:721, offset: 0x01e0ba8c, size: 40 bytes, params: 1, frame: 10
return !zoomed.get() && !env0_10.get();
}
function _fun77780({nativeEvent}) { // fn#77780, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10124:843, offset: 0x01e0bab4, size: 46 bytes, params: 2, frame: 12
const touches = nativeEvent.touches;
const binding = env0_10;
return binding.set(touches.length === 2);
}
function _fun77781() { // fn#77781, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10124:915, offset: 0x01e0bae2, size: 21 bytes, params: 1, frame: 11
return env0_10.set(false);
}
function _fun77782(a0, a1) { // fn#77782, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10124:1034, offset: 0x01e0baf7, size: 162 bytes, params: 3, frame: 16
const MediaViewerItem = (MediaViewerItemModule).MediaViewerItem;
return (
<MediaViewerItem
originLayout={originLayout}
renderMedia={renderMedia}
onLongPress={onLongPress}
windowWidth={windowWidth}
windowHeight={windowHeight}
panGestureConfig={panGestureConfig}
entranceAnimationDriver={entranceAnimationDriver}
source={sources[a1]}
index={a1}
zoomed={zoomed}
panGesture={panGestureGenerator(a1)}
useItemVisible={useItemVisible}
/>
);
}
function H_77783() { // fn#77783, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10124:1306, offset: 0x01e0bb99, size: 25 bytes, params: 1, frame: 10
const object = {};
object.scrollEnabled = env0_11.get();
return object;
}
}
}
function MediaViewerLe() { // fn#77772, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10124:5381, owner: MediaViewer.le, offset: 0x01e0b60b, size: 181 bytes, params: 1, frame: 18
var r2;
var withTiming;
var object4;
const object5 = {};
copyDataProperties(object5, absoluteFillObject, undefined);
object5['alignItems'] = 'center';
object5['justifyContent'] = 'center';
const object6 = {};
object6.translateY = translatePos.get();
object5['transform'] = [object6];
let value = env0_4.get();
if (value) {
r2 = 0;
} else {
value = environment.__proto__;
value = require(4504) /* metro dependency 4504: timing */;
withTiming = value.withTiming;
object4 = {};
object4.easing = (require(4017) /* metro dependency 4017: ReanimatedRexport */).Easing.linear;
object4.duration = 75;
value = Reflect.apply(withTiming, value, [1, object4]);
r2 = value;
function _fun77784(a0) { // fn#77784, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10124:6743, offset: 0x01e0bbb2, size: 75 bytes, params: 2, frame: 17
const MediaViewerDimensionsProvider = (MediaViewerDimensionsContextModule).MediaViewerDimensionsProvider;
return (
<MediaViewerDimensionsProvider>
<MediaViewer {...a0} />
</MediaViewerDimensionsProvider>
);
}
object5['opacity'] = r2;
return object5;
}
function _fun77773() { // fn#77773, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10124:5773, offset: 0x01e0b6c0, size: 102 bytes, params: 1, frame: 14
var binding;
var clearTimeout;
if (result && env0_5.current != null) {
binding = env0_4;
binding.set(true);
clearTimeout = global.clearTimeout;
binding = env0_12;
clearTimeout(binding.current);
binding.current = global.setTimeout(_fun77774, 250);
}
}
function _fun77775() { // fn#77775, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10124:5909, offset: 0x01e0b73d, size: 23 bytes, params: 1, frame: 11
env0_4.set(false);
}
function _fun77776() { // fn#77776, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10124:5960, offset: 0x01e0b754, size: 43 bytes, params: 1, frame: 10
if (env0_14.current) {
env0_13();
} else {
env0_14.current = true;
}
}
function _fun77777({orientation}, {orientation}) { // fn#77777, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10124:6029, offset: 0x01e0b77f, size: 81 bytes, params: 3, frame: 11
if (orientation !== orientation) {
env0_13();
}
const value = environment.__proto__;
if (env1_9) {
(require(9551) /* metro dependency 9551: useVideoControls */).unpauseCurrentVideoIfNeeded();
}
}
function T_77779() { // fn#77779, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10124:721, offset: 0x01e0ba8c, size: 40 bytes, params: 1, frame: 10
return !zoomed.get() && !env0_10.get();
}
function _fun77780({nativeEvent}) { // fn#77780, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10124:843, offset: 0x01e0bab4, size: 46 bytes, params: 2, frame: 12
const touches = nativeEvent.touches;
const binding = env0_10;
return binding.set(touches.length === 2);
}
function _fun77781() { // fn#77781, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10124:915, offset: 0x01e0bae2, size: 21 bytes, params: 1, frame: 11
return env0_10.set(false);
}
function _fun77782(a0, a1) { // fn#77782, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10124:1034, offset: 0x01e0baf7, size: 162 bytes, params: 3, frame: 16
const MediaViewerItem = (require(9940) /* metro dependency 9940: MediaViewerItem */).MediaViewerItem;
return (
<MediaViewerItem
originLayout={originLayout}
renderMedia={renderMedia}
onLongPress={onLongPress}
windowWidth={windowWidth}
windowHeight={windowHeight}
panGestureConfig={panGestureConfig}
entranceAnimationDriver={entranceAnimationDriver}
source={sources[a1]}
index={a1}
zoomed={zoomed}
panGesture={panGestureGenerator(a1)}
useItemVisible={useItemVisible}
/>
);
}
function H_77783() { // fn#77783, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10124:1306, offset: 0x01e0bb99, size: 25 bytes, params: 1, frame: 10
const object2 = {};
object2.scrollEnabled = env0_11.get();
return object2;
}
function PN_77770() { // fn#77770, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10124:4745, owner: MediaViewer.P.n, offset: 0x01e0b580, size: 51 bytes, params: 1, frame: 12
let value = environment.__proto__.__proto__;
value = require(4017) /* metro dependency 4017: ReanimatedRexport */;
value = value.runOnJS(env1_0);
value(false);
}
function _fun77774() { // fn#77774, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10124:5857, offset: 0x01e0b726, size: 23 bytes, params: 1, frame: 11
env1_4.set(false);
}
global.__d(_fun77766, 9938, [57, 31, 27, 33, 477, 4017, 9939, 9940, 8621, 5321, 8140, 6771, 6789, 9562, 9946, 4504,
9551, 7717, 7725, 4018, 7727,
2]) /* metro module 9938, dependencies: [57, 31, 27, 33, 477, 4017, 9939, 9940, 8621, 5321, 8140, 6771, 6789, 9562, 9946, 4504, 9551, 7717, 7725, 4018, 7727, 2] */;
@@ -1,242 +1,279 @@
/* Metro module 9940; source: modules/media_viewer/native/components/MediaViewerItem.tsx; dependencies: [57, 31, 27, 33, 477, 4015, 9941, 9942, 9546, 9545, 9810, 5321, 9943, 9944, 2] */
import Module00057 from '../../../../by-id/module-00057.js'; /* Metro dependency 57 */
import GetMediaViewerStateForScreen from '../getMediaViewerStateForScreen.tsx'; /* Metro dependency 9941 */
import MediaViewerItemPresenter from './MediaViewerItemPresenter.tsx'; /* Metro dependency 9943 */
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 PlatformUtilsModule from '../../../../utils/PlatformUtils.tsx'; /* Metro dependency 477 */
import * as ChatInputUtilsModule from '../../../../utils/native/ChatInputUtils.tsx'; /* Metro dependency 4015 */
import * as Module05321Module from '../../../../by-id/module-05321.js'; /* Metro dependency 5321 */
import * as UseMediaViewerSourcesModule from '../useMediaViewerSources.tsx'; /* Metro dependency 9545 */
function _fun77799(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#77799, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10126:6, offset: 0x01e0c489, size: 216 bytes, params: 8, frame: 19
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_3 = importDefault(57) /* metro dependency 57 */;
let value = importAll(31) /* metro dependency 31 */;
const env0_5 = (require(27) /* metro dependency 27 */).ScrollView;
const env0_6 = (require(33) /* metro dependency 33 */).jsx;
const env0_7 = (require(477) /* metro dependency 477: PlatformUtils */).isAndroid();
let value = ReactModule;
const env0_7 = (PlatformUtilsModule).isAndroid();
value = value.memo(_fun77800);
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/media_viewer/native/components/MediaViewerItem.tsx');
(FileImportTrackerModule).fileFinishedImporting('modules/media_viewer/native/components/MediaViewerItem.tsx');
exports.MediaViewerItem = value;
}
function _fun77800({entranceAnimationDriver, index, onLongPress, originLayout, panGestureConfig, panGesture, renderMedia, source, useItemVisible, zoomed, windowWidth, windowHeight}) { // fn#77800, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10126:183, offset: 0x01e0c561, size: 1128 bytes, params: 2, frame: 44
var r0;
const env0_3 = panGesture;
const env0_4 = zoomed;
var value;
let binding = env0_4;
const env0_7 = binding.useRef(windowWidth);
const env0_8 = binding.useRef(windowHeight);
let useState = binding.useState;
const value2 = Reflect.apply(useState, binding, [windowWidth]);
const binding2 = env0_3;
const value3 = binding2(value2, 2);
const property = value3[0];
const env0_9 = value3[1];
useState = binding.useState;
const value4 = binding2(Reflect.apply(useState, binding, [windowHeight]), 2);
const property2 = value4[0];
const env0_10 = value4[1];
binding.useEffect(_fun77801, []);
binding.useEffect(function() {
var env0_0 = global.setTimeout(_fun77803, 20);
return _fun77804;
}, [windowWidth, windowHeight]);
const maximumZoomScale = (importDefault(9941) /* metro dependency 9941: getMediaViewerStateForScreen */)(property,
property2, source).maximumZoomScale;
const value5 = binding.useRef(null);
const value6 = binding.useRef(null);
useState = binding.useState;
const value7 = binding2(Reflect.apply(useState, binding, [false]), 2);
const property3 = value7[0];
const env0_13 = value7[1];
const value8 = binding.useCallback(_fun77805, []);
const value9 = binding.useCallback(_fun77806, []);
const value10 = binding.useCallback(_fun77807, [zoomed, panGestureConfig]);
const {obscure,
channelId} = (require(9546) /* metro dependency 9546: MediaSourceUtil */).flattenSource(source) ?? ({});
const MediaViewerSourcesStore = (require(9545) /* metro dependency 9545: useMediaViewerSources */).MediaViewerSourcesStore;
const value12 = MediaViewerSourcesStore.useField('spoilerIndexes');
binding = env0_4;
const value13 = binding.useMemo(_fun77809, [index, value12]);
const value19 = binding.useMemo(_fun77814, [binding.useCallback(_fun77812, [value9, value8, zoomed]),
binding.useCallback(_fun77810, [value13, index, onLongPress,
(importDefault(9810) /* metro dependency 9810: useShouldHideMediaOptions */)(channelId)]),
binding.useCallback(_fun77813, [index]), value13, obscure, panGesture, binding.useCallback(function() {
var panGestureConfigBinding;
if (!zoomed.get()) {
panGestureConfigBinding = panGestureConfig;
panGestureConfigBinding.overlayEnabled.set(!panGestureConfigBinding.overlayEnabled.get());
function _fun77800({entranceAnimationDriver, index, onLongPress, originLayout, panGestureConfig, panGesture, renderMedia, source, useItemVisible, zoomed, windowWidth, windowHeight}) { // fn#77800, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10126:183, offset: 0x01e0c561, size: 1128 bytes, params: 2, frame: 44
var r0;
const panGesture2 = panGesture;
const zoomed2 = zoomed;
var value;
let binding = zoomed2;
const env0_7 = binding.useRef(windowWidth);
const env0_8 = binding.useRef(windowHeight);
let useState = binding.useState;
const value2 = Reflect.apply(useState, binding, [windowWidth]);
const binding2 = panGesture2;
const value3 = binding2(value2, 2);
const property = value3[0];
const env0_9 = value3[1];
useState = binding.useState;
const value4 = binding2(Reflect.apply(useState, binding, [windowHeight]), 2);
const property2 = value4[0];
const env0_10 = value4[1];
binding.useEffect(_fun77801, []);
binding.useEffect(function() {
var env0_0 = global.setTimeout(_fun77803, 20);
return _fun77804;
}, [windowWidth, windowHeight]);
const maximumZoomScale = (GetMediaViewerStateForScreen)(property,
property2, source).maximumZoomScale;
const value5 = binding.useRef(null);
const value6 = binding.useRef(null);
useState = binding.useState;
const value7 = binding2(Reflect.apply(useState, binding, [false]), 2);
const property3 = value7[0];
const env0_13 = value7[1];
const value8 = binding.useCallback(_fun77805, []);
const value9 = binding.useCallback(_fun77806, []);
const value10 = binding.useCallback(_fun77807, [zoomed, panGestureConfig]);
const {obscure,
channelId} = (require(9546) /* metro dependency 9546: MediaSourceUtil */).flattenSource(source) ?? ({});
const MediaViewerSourcesStore = (UseMediaViewerSourcesModule).MediaViewerSourcesStore;
const value12 = MediaViewerSourcesStore.useField('spoilerIndexes');
binding = zoomed2;
const value13 = binding.useMemo(_fun77809, [index, value12]);
const value19 = binding.useMemo(_fun77814, [binding.useCallback(_fun77812, [value9, value8, zoomed]),
binding.useCallback(_fun77810, [value13, index, onLongPress,
(importDefault(9810) /* metro dependency 9810: useShouldHideMediaOptions */)(channelId)]),
binding.useCallback(_fun77813, [index]), value13, obscure, panGesture, binding.useCallback(function() {
var panGestureConfigBinding;
if (!zoomed.get()) {
panGestureConfigBinding = panGestureConfig;
panGestureConfigBinding.overlayEnabled.set(!panGestureConfigBinding.overlayEnabled.get());
}
}, [zoomed, panGestureConfig])]);
const env0_24 = binding.useRef(false);
binding.useEffect(_fun77815, [value9, property, property2]);
const GestureDetector = (Module05321Module).GestureDetector;
const gestureDetector = (
<GestureDetector gesture={value19}>
{((Component) => <Component entranceAnimationDriver={entranceAnimationDriver} index={index} originLayout={originLayout} panGestureConfig={panGestureConfig} renderMedia={renderMedia} source={source} windowWidth={property} windowHeight={property2} useItemVisible={useItemVisible} />)(MediaViewerItemPresenter)}
</GestureDetector>
);
if (env0_7) {
value = importDefault(9944) /* metro dependency 9944: ZoomLayoutAndroid */;
value = ((Component) => <Component ref={value6} style={{width: property,
height: property2}} minimumZoomScale={1} maximumZoomScale={maximumZoomScale} onZoomChanged={value10}>{gestureDetector}</Component>)(value);
r0 = value;
} else {
value = 'auto';
value = (
<ScrollView
ref={value5}
style={{width: property, height: property2}}
automaticallyAdjustContentInsets={false}
showsHorizontalScrollIndicator={false}
showsVerticalScrollIndicator={false}
minimumZoomScale={1}
maximumZoomScale={maximumZoomScale}
centerContent
scrollEventThrottle={16}
onScroll={value10}
pointerEvents={property3 ? 'none' : value}
>
{gestureDetector}
</ScrollView>
);
r0 = value;
}
return r0;
function _fun77801() { // fn#77801, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10126:491, offset: 0x01e0c9c9, size: 37 bytes, params: 1, frame: 11
const value = environment.__proto__;
return (ChatInputUtilsModule).dismissKeyboard();
}
}, [zoomed, panGestureConfig])]);
const env0_24 = binding.useRef(false);
binding.useEffect(_fun77815, [value9, property, property2]);
const GestureDetector = (require(5321) /* metro dependency 5321 */).GestureDetector;
const gestureDetector = <GestureDetector gesture={value19}>{((Component) => <Component entranceAnimationDriver={entranceAnimationDriver} index={index} originLayout={originLayout} panGestureConfig={panGestureConfig} renderMedia={renderMedia} source={source} windowWidth={property} windowHeight={property2} useItemVisible={useItemVisible} />)(importDefault(9943) /* metro dependency 9943: MediaViewerItemPresenter */)}</GestureDetector>;
if (env0_7) {
value = importDefault(9944) /* metro dependency 9944: ZoomLayoutAndroid */;
value = ((Component) => <Component ref={value6} style={{width: property,
height: property2}} minimumZoomScale={1} maximumZoomScale={maximumZoomScale} onZoomChanged={value10}>{gestureDetector}</Component>)(value);
r0 = value;
} else {
value = 'auto';
value = <ScrollView ref={value5} style={{width: property,
height: property2}} automaticallyAdjustContentInsets={false} showsHorizontalScrollIndicator={false} showsVerticalScrollIndicator={false} minimumZoomScale={1} maximumZoomScale={maximumZoomScale} centerContent scrollEventThrottle={16} onScroll={value10} pointerEvents={property3 ? 'none' : value}>{gestureDetector}</ScrollView>;
r0 = value;
}
return r0;
}
function _fun77801() { // fn#77801, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10126:491, offset: 0x01e0c9c9, size: 37 bytes, params: 1, frame: 11
const value = environment.__proto__;
return (require(4015) /* metro dependency 4015: ChatInputUtils */).dismissKeyboard();
}
function _fun77802() { // fn#77802, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10126:539, offset: 0x01e0c9ee, size: 41 bytes, params: 1, frame: 14
const env0_0 = global.setTimeout(_fun77803, 20);
return _fun77804;
function _fun77803() { // fn#77803, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10126:562, offset: 0x01e0ca17, size: 53 bytes, params: 1, frame: 13
let binding = env1_9;
const windowWidthBinding = windowWidth;
binding(windowWidthBinding);
binding = env1_10;
const windowHeightBinding = windowHeight;
binding(windowHeightBinding);
env1_7.current = windowWidthBinding;
env1_8.current = windowHeightBinding;
}
function _fun77802() { // fn#77802, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10126:539, offset: 0x01e0c9ee, size: 41 bytes, params: 1, frame: 14
const env0_0 = global.setTimeout(_fun77803, 20);
return _fun77804;
}
function _fun77804() { // fn#77804, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10126:613, offset: 0x016d7e7e, size: 24 bytes, params: 1, frame: 11
return global.clearTimeout(env0_0);
}
function _fun77805(a0, a1) { // fn#77805, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10126:771, offset: 0x01e0ca4c, size: 203 bytes, params: 3, frame: 17
var object2;
var value2;
var value3;
let current = env0_11.current;
if (current != null) {
object2 = {};
current = env0_7.current;
object2.width = current;
current = env0_8.current;
object2.height = current;
value2 = object2.width / 2;
value3 = object2.height / 2;
current = env0_11.current;
current.getScrollResponder().scrollResponderZoomTo({x: a0 - value2 / 2, y: a1 - value3 / 2, width: value2,
height: value3, animated: true});
} else {
current = env0_12.current;
if (current !== null) {
current = env0_12.current;
}
function _fun77805(a0, a1) { // fn#77805, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10126:771, offset: 0x01e0ca4c, size: 203 bytes, params: 3, frame: 17
var object;
var value2;
var value3;
let current = env0_11.current;
if (current != null) {
current.zoomTo({x: a0, y: a1});
object = {};
current = env0_7.current;
object.width = current;
current = env0_8.current;
object.height = current;
value2 = object.width / 2;
value3 = object.height / 2;
current = env0_11.current;
current.getScrollResponder().scrollResponderZoomTo({x: a0 - value2 / 2, y: a1 - value3 / 2, width: value2,
height: value3, animated: true});
} else {
current = env0_12.current;
if (current !== null) {
current = env0_12.current;
if (current != null) {
current.zoomTo({x: a0, y: a1});
}
}
}
}
}
}
function _fun77806() { // fn#77806, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10126:1063, offset: 0x01e0cb17, size: 164 bytes, params: 1, frame: 15
var object2;
var width;
var height;
const value = a0;
const r4 = !(value !== undefined) || value;
let current = env0_11.current;
if (current != null) {
object2 = {};
current = env0_7.current;
object2.width = current;
current = env0_8.current;
object2.height = current;
width = object2.width;
height = object2.height;
current = env0_11.current;
current.getScrollResponder().scrollResponderZoomTo({'x': 0, 'y': 0, width: width, height: height,
animated: r4});
} else {
current = env0_12.current;
if (current !== null) {
current = env0_12.current;
current.unzoom({animated: r4});
function _fun77806() { // fn#77806, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10126:1063, offset: 0x01e0cb17, size: 164 bytes, params: 1, frame: 15
var object;
var width;
var height;
const value = a0;
const r4 = !(value !== undefined) || value;
let current = env0_11.current;
if (current != null) {
object = {};
current = env0_7.current;
object.width = current;
current = env0_8.current;
object.height = current;
width = object.width;
height = object.height;
current = env0_11.current;
current.getScrollResponder().scrollResponderZoomTo({'x': 0, 'y': 0, width: width, height: height,
animated: r4});
} else {
current = env0_12.current;
if (current !== null) {
current = env0_12.current;
current.unzoom({animated: r4});
}
}
}
}
}
function _fun77807({nativeEvent}) { // fn#77807, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10126:1323, offset: 0x01e0cbbb, size: 171 bytes, params: 2, frame: 15
var r1;
var useEntranceAnimationState;
const value = nativeEvent.zoomScale > 1;
zoomed.set(value);
panGestureConfig.isInteracting.set(value);
const binding = env1_7;
if (binding) {
r1 = binding;
} else {
useEntranceAnimationState = (require(9942) /* metro dependency 9942: useEntranceAnimation */).useEntranceAnimationState;
r1 = !useEntranceAnimationState.getState().isComplete;
}
r1 = !r1 ? value : r1;
if (!r1) {
env0_13(true);
global.setTimeout(_fun77808, 500);
}
}
function _fun77807({nativeEvent}) { // fn#77807, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10126:1323, offset: 0x01e0cbbb, size: 171 bytes, params: 2, frame: 15
var r1;
var useEntranceAnimationState;
const value = nativeEvent.zoomScale > 1;
zoomed.set(value);
panGestureConfig.isInteracting.set(value);
const binding = env1_7;
if (binding) {
r1 = binding;
} else {
useEntranceAnimationState = (require(9942) /* metro dependency 9942: useEntranceAnimation */).useEntranceAnimationState;
r1 = !useEntranceAnimationState.getState().isComplete;
}
r1 = !r1 ? value : r1;
if (!r1) {
env0_13(true);
global.setTimeout(_fun77808, 500);
}
function _fun77808() { // fn#77808, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10126:1480, offset: 0x01e0cc66, size: 18 bytes, params: 1, frame: 11
env1_13(false);
}
function _fun77809() { // fn#77809, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10126:1650, offset: 0x01e0cc78, size: 23 bytes, params: 1, frame: 11
const binding = env0_17;
return binding.has(index);
}
function _fun77810() { // fn#77810, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10126:1702, offset: 0x01e0cc8f, size: 86 bytes, params: 1, frame: 12
var value3;
var moduleValue;
if (env0_18) {
value3 = environment.__proto__;
moduleValue = require(9545) /* metro dependency 9545: useMediaViewerSources */;
moduleValue.removeSpoiler(index);
} else if (!(env0_19 || onLongPress == null)) {
onLongPress();
}
}
function _fun77812({absoluteX, absoluteY}) { // fn#77812, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10126:1866, offset: 0x01e0cd22, size: 78 bytes, params: 2, frame: 14
const get = zoomed.get;
if (Reflect.apply(get, zoomedBinding, [])) {
env0_15();
} else {
zoomedBinding = zoomed;
if (!zoomedBinding.get()) {
env0_14(absoluteX, absoluteY);
}
function _fun77809() { // fn#77809, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10126:1650, offset: 0x01e0cc78, size: 23 bytes, params: 1, frame: 11
const binding = env0_17;
return binding.has(index);
}
function _fun77810() { // fn#77810, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10126:1702, offset: 0x01e0cc8f, size: 86 bytes, params: 1, frame: 12
var value3;
var moduleValue;
if (env0_18) {
value3 = environment.__proto__;
moduleValue = require(9545) /* metro dependency 9545: useMediaViewerSources */;
moduleValue.removeSpoiler(index);
} else if (!(env0_19 || onLongPress == null)) {
onLongPress();
}
}
function _fun77812({absoluteX, absoluteY}) { // fn#77812, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10126:1866, offset: 0x01e0cd22, size: 78 bytes, params: 2, frame: 14
const get = zoomed.get;
if (Reflect.apply(get, zoomedBinding, [])) {
env0_15();
} else {
zoomedBinding = zoomed;
if (!zoomedBinding.get()) {
env0_14(absoluteX, absoluteY);
}
}
}
function _fun77813() { // fn#77813, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10126:1953, offset: 0x01d92731, size: 45 bytes, params: 1, frame: 12
let value = environment.__proto__;
value = require(9545) /* metro dependency 9545: useMediaViewerSources */;
value.removeSpoiler(index);
}
function _fun77814() { // fn#77814, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10126:2004, offset: 0x01e0cd70, size: 549 bytes, params: 1, frame: 24
const value = environment.__proto__;
const Gesture = (Module05321Module).Gesture;
const value3 = Gesture.Tap().runOnJS(true);
const value6 = value3.enabled(!env0_18).numberOfTaps(2);
let maxDistance = value6.maxDistance;
const isAndroid2 = PlatformUtilsModule.isAndroid();
const value7 = 10;
const value10 = Reflect.apply(maxDistance, value6, [isAndroid2 ? 20 : value7]).onStart(env0_22);
const value14 = Gesture.Tap().runOnJS(true).enabled(!env0_18).numberOfTaps(1);
maxDistance = value14.maxDistance;
const value17 = Reflect.apply(maxDistance, value14, [PlatformUtilsModule.isAndroid() ? 20 : value7]).onStart(env0_21);
const value19 = Gesture.Tap().runOnJS(true);
const value22 = value19.enabled(env0_18 && !obscure).numberOfTaps(1);
maxDistance = value22.maxDistance;
return Gesture.Simultaneous(Gesture.Exclusive(Reflect.apply(maxDistance, value22,
[PlatformUtilsModule.isAndroid() ? 20 : value7]).onStart(env0_23), value10, value17),
Gesture.LongPress().runOnJS(true).enabled(!env0_18).onStart(env0_20), panGesture);
}
function _fun77815() { // fn#77815, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10126:2557, offset: 0x01e0cf95, size: 46 bytes, params: 1, frame: 11
if (env0_24.current) {
env0_15(false);
} else {
env0_24.current = true;
}
}
}
}
function _fun77814() { // fn#77814, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10126:2004, offset: 0x01e0cd70, size: 549 bytes, params: 1, frame: 24
const value = environment.__proto__;
const Gesture = (require(5321) /* metro dependency 5321 */).Gesture;
const value3 = Gesture.Tap().runOnJS(true);
const value6 = value3.enabled(!env0_18).numberOfTaps(2);
let maxDistance = value6.maxDistance;
const platformUtilsModule = require(477) /* metro dependency 477: PlatformUtils */;
const isAndroid2 = platformUtilsModule.isAndroid();
const value7 = 10;
const value10 = Reflect.apply(maxDistance, value6, [isAndroid2 ? 20 : value7]).onStart(env0_22);
const value14 = Gesture.Tap().runOnJS(true).enabled(!env0_18).numberOfTaps(1);
maxDistance = value14.maxDistance;
const moduleValue2 = platformUtilsModule;
const value17 = Reflect.apply(maxDistance, value14, [moduleValue2.isAndroid() ? 20 : value7]).onStart(env0_21);
const value19 = Gesture.Tap().runOnJS(true);
const value22 = value19.enabled(env0_18 && !obscure).numberOfTaps(1);
maxDistance = value22.maxDistance;
const moduleValue3 = platformUtilsModule;
return Gesture.Simultaneous(Gesture.Exclusive(Reflect.apply(maxDistance, value22,
[moduleValue3.isAndroid() ? 20 : value7]).onStart(env0_23), value10, value17),
Gesture.LongPress().runOnJS(true).enabled(!env0_18).onStart(env0_20), panGesture);
}
function _fun77815() { // fn#77815, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10126:2557, offset: 0x01e0cf95, size: 46 bytes, params: 1, frame: 11
if (env0_24.current) {
env0_15(false);
} else {
env0_24.current = true;
}
}
function _fun77803() { // fn#77803, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10126:562, offset: 0x01e0ca17, size: 53 bytes, params: 1, frame: 13
let binding = env1_9;
const windowWidthBinding = windowWidth;
binding(windowWidthBinding);
binding = env1_10;
const windowHeightBinding = windowHeight;
binding(windowHeightBinding);
env1_7.current = windowWidthBinding;
env1_8.current = windowHeightBinding;
}
function _fun77808() { // fn#77808, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10126:1480, offset: 0x01e0cc66, size: 18 bytes, params: 1, frame: 11
env1_13(false);
}
global.__d(_fun77799, 9940, [57, 31, 27, 33, 477, 4015, 9941, 9942, 9546, 9545, 9810, 5321, 9943, 9944,
2]) /* metro module 9940, dependencies: [57, 31, 27, 33, 477, 4015, 9941, 9942, 9546, 9545, 9810, 5321, 9943, 9944, 2] */;
@@ -1,144 +1,149 @@
/* Metro module 9943; source: modules/media_viewer/native/components/MediaViewerItemPresenter.tsx; dependencies: [31, 27, 33, 9942, 9545, 9941, 4017, 4018, 2] */
import REAWorkaroundView from '../../../reanimated/native/REAWorkaroundView.tsx'; /* Metro dependency 4018 */
import GetMediaViewerStateForScreen from '../getMediaViewerStateForScreen.tsx'; /* Metro dependency 9941 */
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 ReanimatedRexportModule from '../../../reanimated/ReanimatedRexport.tsx'; /* Metro dependency 4017 */
import * as UseMediaViewerSourcesModule from '../useMediaViewerSources.tsx'; /* Metro dependency 9545 */
import * as UseEntranceAnimationModule from '../useEntranceAnimation.tsx'; /* Metro dependency 9942 */
function _fun77831(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#77831, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10129:6, offset: 0x01e0d5f8, size: 214 bytes, params: 8, frame: 18
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_3 = importAll(31) /* metro dependency 31 */;
const value = require(27) /* metro dependency 27 */;
const env0_4 = value.View;
const env0_5 = value.StyleSheet;
const env0_6 = (require(33) /* metro dependency 33 */).jsx;
object = {platformStyles: {'position': 'absolute', 'width': '100%', 'height': '100%'}};
object = {code: 'function MediaViewerItemPresenterTsx1(){const{entranceAnimationDriver,interpolate,Extrapolation,startHeight,sourceHeight,startWidth,sourceWidth,startTranslateY,startTranslateX,startScale}=this.__closure;const entranceValue=entranceAnimationDriver.get();const interpolateProxy=function(from,to){return interpolate(entranceValue,from,to,Extrapolation.CLAMP);};return{height:interpolateProxy([0,1],[startHeight,sourceHeight]),width:interpolateProxy([0,1],[startWidth,sourceWidth]),top:interpolateProxy([0,1],[startTranslateY,0]),left:interpolateProxy([0,1],[startTranslateX,0]),borderRadius:interpolateProxy([0,0.25],[16,0]),transform:[{scale:interpolateProxy([0,1],[startScale,1])}]};}'};
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/media_viewer/native/components/MediaViewerItemPresenter.tsx');
(FileImportTrackerModule).fileFinishedImporting('modules/media_viewer/native/components/MediaViewerItemPresenter.tsx');
exports.default = MediaViewerItemPresenter;
}
function MediaViewerItemPresenter({source, originLayout, renderMedia, windowWidth, windowHeight, entranceAnimationDriver, index, useItemVisible, panGestureConfig}) { // fn#77832, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10129:923, offset: 0x01e0d6ce, size: 1217 bytes, params: 2, frame: 40
var r17;
var r13;
var r14;
var r15;
var r16;
var value7;
var width5;
var height4;
var value19;
var value20;
const env0_3 = index;
const {loads, handleLoad, handleError,
handleLoadStart} = (require(9942) /* metro dependency 9942: useEntranceAnimation */).useEntranceAnimation(entranceAnimationDriver);
const MediaViewerSourcesStore = (require(9545) /* metro dependency 9545: useMediaViewerSources */).MediaViewerSourcesStore;
const value4 = env0_3.useMemo(_fun77833, [index, MediaViewerSourcesStore.useField('spoilerIndexes')]);
const {width, height} = (importDefault(9941) /* metro dependency 9941: getMediaViewerStateForScreen */)(windowWidth,
windowHeight, source);
const value6 = useItemVisible(index);
items2 = [];
const Array = global.Array;
if (Array.isArray(source)) {
value7 = loads <= 1;
if (value7) {
items2.push(renderMedia({key: '0:' + index + ':' + source[0].uri, onLoadStart: handleLoadStart,
onLoad: handleLoad,
onError: handleError, source: source[0], style: undefined.platformStyles, index: index,
hasSpoiler: value4,
function MediaViewerItemPresenter({source, originLayout, renderMedia, windowWidth, windowHeight, entranceAnimationDriver, index, useItemVisible, panGestureConfig}) { // fn#77832, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10129:923, offset: 0x01e0d6ce, size: 1217 bytes, params: 2, frame: 40
var r17;
var r13;
var r14;
var r15;
var r16;
var value7;
var width5;
var height4;
var value19;
var value20;
const index2 = index;
const {loads, handleLoad, handleError,
handleLoadStart} = (UseEntranceAnimationModule).useEntranceAnimation(entranceAnimationDriver);
const MediaViewerSourcesStore = (UseMediaViewerSourcesModule).MediaViewerSourcesStore;
const value4 = index2.useMemo(_fun77833, [index, MediaViewerSourcesStore.useField('spoilerIndexes')]);
const {width, height} = (GetMediaViewerStateForScreen)(windowWidth,
windowHeight, source);
const value6 = useItemVisible(index);
items2 = [];
const Array = global.Array;
if (Array.isArray(source)) {
value7 = loads <= 1;
if (value7) {
items2.push(renderMedia({key: '0:' + index + ':' + source[0].uri, onLoadStart: handleLoadStart,
onLoad: handleLoad,
onError: handleError, source: source[0], style: undefined.platformStyles, index: index,
hasSpoiler: value4,
visible: value6, panGestureConfig: panGestureConfig}));
}
if (loads >= 1) {
items2.push(renderMedia({key: '1:' + index + ':' + source[0].uri, source: source[1],
style: undefined.platformStyles, onLoad: handleLoad, onError: handleError,
pointerEvents: value7 ? 'none' : 'auto', fadeDuration: 0, fade: false, index: index, hasSpoiler: value4,
visible: value6, panGestureConfig: panGestureConfig}));
}
} else {
items2.push(renderMedia({key: '0:' + index + ':' + source.uri, onLoadStart: handleLoadStart, onLoad: handleLoad,
onError: handleError, source: source, style: undefined.platformStyles, index: index, hasSpoiler: value4,
visible: value6, panGestureConfig: panGestureConfig}));
}
if (loads >= 1) {
items2.push(renderMedia({key: '1:' + index + ':' + source[0].uri, source: source[1],
style: undefined.platformStyles, onLoad: handleLoad, onError: handleError,
pointerEvents: value7 ? 'none' : 'auto', fadeDuration: 0, fade: false, index: index, hasSpoiler: value4,
visible: value6, panGestureConfig: panGestureConfig}));
const value10 = width / height;
const value11 = originLayout.width / originLayout.height;
const value13 = originLayout.x - (width - originLayout.width) / 2 - (windowWidth - width) / 2;
let env0_8 = value13;
const value14 = (height - originLayout.height) / 2;
const value15 = (windowHeight - height) / 2;
if (originLayout.resizeMode === 'cover') {
width5 = originLayout.width;
height4 = originLayout.height;
value19 = originLayout.x - (windowWidth - width) / 2;
env0_8 = value19;
value20 = originLayout.y - value15;
r13 = 1;
r14 = value19;
r15 = value20;
r16 = width5;
r17 = height4;
} else {
r13 = originLayout.width / width * (value10 > value11 ? value10 : 1);
r14 = value13;
r15 = originLayout.y - value14 - value15;
r16 = width;
r17 = height;
}
} else {
items2.push(renderMedia({key: '0:' + index + ':' + source.uri, onLoadStart: handleLoadStart, onLoad: handleLoad,
onError: handleError, source: source, style: undefined.platformStyles, index: index, hasSpoiler: value4,
visible: value6, panGestureConfig: panGestureConfig}));
}
const value10 = width / height;
const value11 = originLayout.width / originLayout.height;
const value13 = originLayout.x - (width - originLayout.width) / 2 - (windowWidth - width) / 2;
let env0_8 = value13;
const value14 = (height - originLayout.height) / 2;
const value15 = (windowHeight - height) / 2;
if (originLayout.resizeMode === 'cover') {
width5 = originLayout.width;
height4 = originLayout.height;
value19 = originLayout.x - (windowWidth - width) / 2;
env0_8 = value19;
value20 = originLayout.y - value15;
r13 = 1;
r14 = value19;
r15 = value20;
r16 = width5;
r17 = height4;
} else {
r13 = originLayout.width / width * (value10 > value11 ? value10 : 1);
r14 = value13;
r15 = originLayout.y - value14 - value15;
r16 = width;
r17 = height;
}
const reanimatedRexportModule = require(4017) /* metro dependency 4017: ReanimatedRexport */;
const useAnimatedStyle = reanimatedRexportModule.useAnimatedStyle;
const closure = MediaViewerItemPresenterO;
const object = {entranceAnimationDriver: entranceAnimationDriver};
object.interpolate = reanimatedRexportModule.interpolate;
const Extrapolation = reanimatedRexportModule.Extrapolation;
object.Extrapolation = Extrapolation;
object.startHeight = r17;
object.sourceHeight = height;
object.startWidth = r16;
object.sourceWidth = width;
object.startTranslateY = r15;
object.startTranslateX = r14;
object.startScale = r13;
closure.__closure = object;
closure.__workletHash = 7638182709879;
closure.__initData = env0_8;
const value22 = Reflect.apply(useAnimatedStyle, reanimatedRexportModule, [closure]);
const value23 = env0_3.useMemo(function() {
return StyleSheet.create({container: {width: windowWidth, height: windowHeight, alignItems: 'center',
justifyContent: 'center'}, child: {width: width, height: height}, presenter: {'position': 'relative',
'overflow': 'hidden', 'opacity': 1}});
}, [windowWidth, windowHeight, width, height]);
return (
<View collapsable={false} style={value23.container}>
<View style={value23.child}>
{((Component) => <Component style={[value23.presenter,
value22]}>{items2}</Component>)(importDefault(4018) /* metro dependency 4018: REAWorkaroundView */)}
const useAnimatedStyle = ReanimatedRexportModule.useAnimatedStyle;
const MediaViewerItemPresenterO2 = MediaViewerItemPresenterO;
const object2 = {entranceAnimationDriver: entranceAnimationDriver};
object2.interpolate = ReanimatedRexportModule.interpolate;
const Extrapolation = ReanimatedRexportModule.Extrapolation;
object2.Extrapolation = Extrapolation;
object2.startHeight = r17;
object2.sourceHeight = height;
object2.startWidth = r16;
object2.sourceWidth = width;
object2.startTranslateY = r15;
object2.startTranslateX = r14;
object2.startScale = r13;
MediaViewerItemPresenterO2.__closure = object2;
MediaViewerItemPresenterO2.__workletHash = 7638182709879;
MediaViewerItemPresenterO2.__initData = env0_8;
const value22 = Reflect.apply(useAnimatedStyle, ReanimatedRexportModule, [MediaViewerItemPresenterO2]);
const value23 = index2.useMemo(function() {
return StyleSheet.create({container: {width: windowWidth, height: windowHeight, alignItems: 'center',
justifyContent: 'center'}, child: {width: width, height: height}, presenter: {'position': 'relative',
'overflow': 'hidden', 'opacity': 1}});
}, [windowWidth, windowHeight, width, height]);
return (
<View collapsable={false} style={value23.container}>
<View style={value23.child}>
{((Component) => <Component style={[value23.presenter,
value22]}>{items2}</Component>)(REAWorkaroundView)}
</View>
</View>
</View>
);
}
);
function _fun77833() { // fn#77833, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10129:1270, offset: 0x01e0db8f, size: 23 bytes, params: 1, frame: 11
return ReactNativeModule.View.has(index);
}
function _fun77833() { // fn#77833, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10129:1270, offset: 0x01e0db8f, size: 23 bytes, params: 1, frame: 11
const binding = env0_4;
return binding.has(index);
}
function MediaViewerItemPresenterO() { // fn#77834, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10129:2135, owner: MediaViewerItemPresenter.O, offset: 0x01e0dba6, size: 273 bytes, params: 1, frame: 16
const env0_0 = entranceAnimationDriver.get();
const interpolateProxy2 = interpolateProxy;
const object = {};
object.height = interpolateProxy2([0, 1], [height, height]);
object.width = interpolateProxy2([0, 1], [width, width]);
object.top = interpolateProxy2([0, 1], [env0_9, 0]);
object.left = interpolateProxy2([0, 1], [env0_8, 0]);
object.borderRadius = interpolateProxy2([0, 0.25], [16, 0]);
const object2 = {};
object2.scale = interpolateProxy2([0, 1], [env0_7, 1]);
object.transform = [object2];
return object;
function interpolateProxy(a0, a1) { // fn#77835, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10129:2177, owner: MediaViewerItemPresenter.O.interpolateProxy, offset: 0x01e0dcb7, size: 77 bytes, params: 3, frame: 18
let value = environment.__proto__.__proto__;
value = require(4017) /* metro dependency 4017: ReanimatedRexport */;
const interpolate = value.interpolate;
const binding = env0_0;
const Extrapolation = (require(4017) /* metro dependency 4017: ReanimatedRexport */).Extrapolation;
const CLAMP = Extrapolation.CLAMP;
return Reflect.apply(interpolate, value, [binding, a0, a1, CLAMP]);
}
function MediaViewerItemPresenterO() { // fn#77834, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10129:2135, owner: MediaViewerItemPresenter.O, offset: 0x01e0dba6, size: 273 bytes, params: 1, frame: 16
const env0_0 = entranceAnimationDriver.get();
const closure = interpolateProxy;
const object3 = {};
object3.height = closure([0, 1], [height, height]);
object3.width = closure([0, 1], [width, width]);
object3.top = closure([0, 1], [env0_9, 0]);
object3.left = closure([0, 1], [env0_8, 0]);
object3.borderRadius = closure([0, 0.25], [16, 0]);
const object4 = {};
object4.scale = closure([0, 1], [env0_7, 1]);
object3.transform = [object4];
return object3;
}
}
}
function interpolateProxy(a0, a1) { // fn#77835, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10129:2177, owner: MediaViewerItemPresenter.O.interpolateProxy, offset: 0x01e0dcb7, size: 77 bytes, params: 3, frame: 18
let value = environment.__proto__.__proto__;
value = require(4017) /* metro dependency 4017: ReanimatedRexport */;
const interpolate = value.interpolate;
const binding = env0_0;
const Extrapolation = (require(4017) /* metro dependency 4017: ReanimatedRexport */).Extrapolation;
const CLAMP = Extrapolation.CLAMP;
return Reflect.apply(interpolate, value, [binding, a0, a1, CLAMP]);
}
global.__d(_fun77831, 9943, [31, 27, 33, 9942, 9545, 9941, 4017, 4018,
2]) /* metro module 9943, dependencies: [31, 27, 33, 9942, 9545, 9941, 4017, 4018, 2] */;
@@ -1,200 +1,205 @@
/* Metro module 9807; source: modules/media_viewer/native/components/MediaViewerThumbnails.tsx; dependencies: [57, 31, 27, 9561, 33, 9808, 3860, 697, 4018, 4564, 477, 4501, 5475, 9546, 4017, 8140, 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 REAWorkaroundView from '../../../reanimated/native/REAWorkaroundView.tsx'; /* Metro dependency 4018 */
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 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 FastListModule from '../../../../lib/native/FastList.tsx'; /* Metro dependency 8140 */
import * as MediaSourceUtilModule from '../MediaSourceUtil.tsx'; /* Metro dependency 9546 */
import * as ConstantsModule from '../Constants.tsx'; /* Metro dependency 9561 */
import * as UseMediaItemSpoilerStateModule from '../useMediaItemSpoilerState.tsx'; /* Metro dependency 9808 */
function _fun76815(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#76815, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9993:6, offset: 0x01de5e66, size: 369 bytes, params: 8, frame: 23
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_3 = importDefault(57) /* metro dependency 57 */;
const value = importAll(31) /* metro dependency 31 */;
const value2 = require(27) /* metro dependency 27 */;
const env0_5 = value2.Pressable;
const env0_6 = value2.StyleSheet;
const constantsModule = require(9561) /* metro dependency 9561: Constants */;
const THUMBNAIL_MARGIN = constantsModule.THUMBNAIL_MARGIN;
const THUMBNAIL_HEIGHT = constantsModule.THUMBNAIL_HEIGHT;
const env0_7 = constantsModule.THUMBNAIL_WIDTH_MARGIN;
const value4 = require(33) /* metro dependency 33 */;
const env0_8 = value4.jsx;
const env0_9 = value4.jsxs;
const env0_11 = (require(4501) /* metro dependency 4501: createStyles */).createStyles({containerPortrait: {height: 60},
const THUMBNAIL_MARGIN = ConstantsModule.THUMBNAIL_MARGIN;
const THUMBNAIL_HEIGHT = ConstantsModule.THUMBNAIL_HEIGHT;
const env0_11 = (CreateStylesModule).createStyles({containerPortrait: {height: 60},
thumbnailButtonPortrait: {'overflow': 'hidden', 'marginHorizontal': null, 'borderRadius': 2,
marginHorizontal: THUMBNAIL_MARGIN}, thumbnailImagePortrait: {height: THUMBNAIL_HEIGHT, width: '100%'}});
const env0_12 = value.memo(_fun76817);
const env0_12 = ReactModule.memo(_fun76817);
object = {code: 'function MediaViewerThumbnailsTsx1(){const{scrollEnabled}=this.__closure;return{scrollEnabled:scrollEnabled.get()};}'};
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/media_viewer/native/components/MediaViewerThumbnails.tsx');
(FileImportTrackerModule).fileFinishedImporting('modules/media_viewer/native/components/MediaViewerThumbnails.tsx');
exports.default = MediaViewerThumbnails;
}
function ObscuredView({source, index}) { // fn#76816, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9993:276, offset: 0x01de5fd7, size: 301 bytes, params: 2, frame: 21
var r9;
var r0;
var defaultImport;
var object2;
var absoluteFill;
var defaultImport2;
const value3 = env0_3((require(9808) /* metro dependency 9808: useMediaItemSpoilerState */).useMediaItemSpoilerState(index),
2);
const property = value3[0];
const property2 = value3[1];
const useTokenModule = require(3860) /* metro dependency 3860: useToken */;
const useToken = useTokenModule.useToken;
const SPOILER_HIDDEN_BACKGROUND = (importDefault(697) /* metro dependency 697: native */).colors.SPOILER_HIDDEN_BACKGROUND;
const value4 = Reflect.apply(useToken, useTokenModule, [SPOILER_HIDDEN_BACKGROUND]);
if (property) {
if (source.spoiler) {
defaultImport = importDefault(4018) /* metro dependency 4018: REAWorkaroundView */;
object2 = {};
absoluteFill = StyleSheet.absoluteFill;
object2.style = [absoluteFill, property2];
defaultImport2 = importDefault(4564) /* metro dependency 4564: VisualEffectView */;
r9 = (require(477) /* metro dependency 477: PlatformUtils */).isAndroid() ? 'dark' : 'light';
absoluteFill = StyleSheet.absoluteFill;
r0 = ((Component) => <Component {...object2}>{((Component) => <Component blurTheme={r9} style={absoluteFill} android_fallbackColor={value4} />)(defaultImport2)}</Component>)(defaultImport);
} else if (source.obscure) {
defaultImport = importDefault(4018) /* metro dependency 4018: REAWorkaroundView */;
object2 = {};
absoluteFill = StyleSheet.absoluteFill;
object2.style = [absoluteFill, property2];
defaultImport2 = importDefault(4564) /* metro dependency 4564: VisualEffectView */;
r9 = (require(477) /* metro dependency 477: PlatformUtils */).isAndroid() ? 'dark' : 'light';
absoluteFill = StyleSheet.absoluteFill;
r0 = ((Component) => <Component {...object2}>{((Component) => <Component blurTheme={r9} style={absoluteFill} android_fallbackColor={value4} />)(defaultImport2)}</Component>)(defaultImport);
function ObscuredView({source, index}) { // fn#76816, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9993:276, offset: 0x01de5fd7, size: 301 bytes, params: 2, frame: 21
var r9;
var r0;
var defaultImport;
var object;
var absoluteFill;
var defaultImport2;
const value3 = Module00057((UseMediaItemSpoilerStateModule).useMediaItemSpoilerState(index),
2);
const property = value3[0];
const property2 = value3[1];
const useToken = UseTokenModule.useToken;
const SPOILER_HIDDEN_BACKGROUND = (Native).colors.SPOILER_HIDDEN_BACKGROUND;
const value4 = Reflect.apply(useToken, UseTokenModule, [SPOILER_HIDDEN_BACKGROUND]);
if (property) {
if (source.spoiler) {
defaultImport = importDefault(4018) /* metro dependency 4018: REAWorkaroundView */;
object = {};
absoluteFill = StyleSheet.absoluteFill;
object.style = [absoluteFill, property2];
defaultImport2 = importDefault(4564) /* metro dependency 4564: VisualEffectView */;
r9 = (require(477) /* metro dependency 477: PlatformUtils */).isAndroid() ? 'dark' : 'light';
absoluteFill = StyleSheet.absoluteFill;
r0 = ((Component) => <Component {...object}>{((Component) => <Component blurTheme={r9} style={absoluteFill} android_fallbackColor={value4} />)(defaultImport2)}</Component>)(defaultImport);
} else if (source.obscure) {
defaultImport = importDefault(4018) /* metro dependency 4018: REAWorkaroundView */;
object = {};
absoluteFill = StyleSheet.absoluteFill;
object.style = [absoluteFill, property2];
defaultImport2 = importDefault(4564) /* metro dependency 4564: VisualEffectView */;
r9 = (require(477) /* metro dependency 477: PlatformUtils */).isAndroid() ? 'dark' : 'light';
absoluteFill = StyleSheet.absoluteFill;
r0 = ((Component) => <Component {...object}>{((Component) => <Component blurTheme={r9} style={absoluteFill} android_fallbackColor={value4} />)(defaultImport2)}</Component>)(defaultImport);
} else {
r0 = null;
}
} else {
r0 = null;
}
} else {
r0 = null;
return r0;
}
return r0;
}
function _fun76817({source, numSources, selectedIndex, index, onSelect, useThumbnailStyle}) { // fn#76817, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9993:810, offset: 0x01de6104, size: 383 bytes, params: 2, frame: 30
const styles = useStyles();
const Array = global.Array;
const r10 = Array.isArray(source) ? source[0] : source;
return ((Component) => <Component style={[styles.thumbnailButtonPortrait, useThumbnailStyle(r10,
index)]}><Pressable needsOffscreenAlphaCompositing renderToHardwareTextureAndroid accessibilityRole="imagebutton" accessibilityLabel={'Thumbnail preview, ' + (index + 1) + ' of ' + numSources} accessibilityHint="Double tap to focus" accessibilityState={{selected: selectedIndex === index}} onPress={env0_4.useCallback(function() {
return onSelect(index);
}, [onSelect,
index])}>{((Component) => <Component style={styles.thumbnailImagePortrait} source={r10.thumbnail ?? r10} enableAnimation={false} />)(importDefault(5475) /* metro dependency 5475: FastImage */)}<ObscuredView source={r10} index={index} /></Pressable></Component>)(importDefault(4018) /* metro dependency 4018: REAWorkaroundView */);
}
function _fun76817({source, numSources, selectedIndex, index, onSelect, useThumbnailStyle}) { // fn#76817, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9993:810, offset: 0x01de6104, size: 383 bytes, params: 2, frame: 30
const styles = useStyles();
const Array = global.Array;
const r10 = Array.isArray(source) ? source[0] : source;
return ((Component) => <Component style={[styles.thumbnailButtonPortrait, useThumbnailStyle(r10,
index)]}><Pressable needsOffscreenAlphaCompositing renderToHardwareTextureAndroid accessibilityRole="imagebutton" accessibilityLabel={'Thumbnail preview, ' + (index + 1) + ' of ' + numSources} accessibilityHint="Double tap to focus" accessibilityState={{selected: selectedIndex === index}} onPress={env0_4.useCallback(function() {
return onSelect(index);
}, [onSelect,
index])}>{((Component) => <Component style={styles.thumbnailImagePortrait} source={r10.thumbnail ?? r10} enableAnimation={false} />)(importDefault(5475) /* metro dependency 5475: FastImage */)}<ObscuredView source={r10} index={index} /></Pressable></Component>)(importDefault(4018) /* metro dependency 4018: REAWorkaroundView */);
}
function MediaViewerThumbnails({syncer}) { // fn#76819, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9993:1676, offset: 0x01de6283, size: 629 bytes, params: 2, frame: 36
const styles = useStyles();
const sources = syncer.sources;
const useThumbnailsProps = syncer.useThumbnailsProps;
const index = syncer.index;
const onEndReached = syncer.onEndReached;
const onEndReachedThreshold = syncer.onEndReachedThreshold;
const variableWidthThumbnailsEnabled = syncer.variableWidthThumbnailsEnabled;
const thumbnailScrollPositions = syncer.thumbnailScrollPositions;
const env0_3 = thumbnailScrollPositions;
let value2 = useThumbnailsProps(THUMBNAIL_WIDTH_MARGIN, sources.length - 1);
const ref = value2.ref;
const headerBufferSize = value2.headerBufferSize;
const headerBufferStyle = value2.headerBufferStyle;
const env0_4 = headerBufferStyle;
const footerBufferSize = value2.footerBufferSize;
const footerBufferStyle = value2.footerBufferStyle;
const scrollEnabled = value2.scrollEnabled;
const onScroll = value2.onScroll;
const onSelect = value2.onSelect;
const useThumbnailStyle = value2.useThumbnailStyle;
const screenWidth = value2.screenWidth;
const itemSize = value2.itemSize;
const binding = env0_4;
const value3 = binding.useMemo(function() {
var r3;
var variableWidthThumbnailsEnabledBinding;
var push;
var value4;
var items = [];
var thumbnailScrollPositionsBinding = thumbnailScrollPositions;
var value2 = 0;
if (value2 < thumbnailScrollPositionsBinding.length) {
r3 = value2;
while (true) {
variableWidthThumbnailsEnabledBinding = variableWidthThumbnailsEnabled;
push = items.push;
if (variableWidthThumbnailsEnabledBinding) {
Reflect.apply(push, items, [thumbnailScrollPositions[r3].scrollStart]);
} else {
Reflect.apply(push, items, [r3 * THUMBNAIL_WIDTH_MARGIN]);
function MediaViewerThumbnails({syncer}) { // fn#76819, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9993:1676, offset: 0x01de6283, size: 629 bytes, params: 2, frame: 36
const styles = useStyles();
const sources = syncer.sources;
const useThumbnailsProps = syncer.useThumbnailsProps;
const index = syncer.index;
const onEndReached = syncer.onEndReached;
const onEndReachedThreshold = syncer.onEndReachedThreshold;
const variableWidthThumbnailsEnabled = syncer.variableWidthThumbnailsEnabled;
const thumbnailScrollPositions = syncer.thumbnailScrollPositions;
const thumbnailScrollPositions2 = thumbnailScrollPositions;
let value2 = useThumbnailsProps(THUMBNAIL_WIDTH_MARGIN, sources.length - 1);
const ref = value2.ref;
const headerBufferSize = value2.headerBufferSize;
const headerBufferStyle = value2.headerBufferStyle;
const headerBufferStyle2 = headerBufferStyle;
const footerBufferSize = value2.footerBufferSize;
const footerBufferStyle = value2.footerBufferStyle;
const scrollEnabled = value2.scrollEnabled;
const onScroll = value2.onScroll;
const onSelect = value2.onSelect;
const useThumbnailStyle = value2.useThumbnailStyle;
const screenWidth = value2.screenWidth;
const itemSize = value2.itemSize;
const binding = headerBufferStyle2;
const value3 = binding.useMemo(function() {
var r3;
var variableWidthThumbnailsEnabledBinding;
var push;
var value4;
var items = [];
var thumbnailScrollPositionsBinding = thumbnailScrollPositions;
var value2 = 0;
if (value2 < thumbnailScrollPositionsBinding.length) {
r3 = value2;
while (true) {
variableWidthThumbnailsEnabledBinding = variableWidthThumbnailsEnabled;
push = items.push;
if (variableWidthThumbnailsEnabledBinding) {
Reflect.apply(push, items, [thumbnailScrollPositions[r3].scrollStart]);
} else {
Reflect.apply(push, items, [r3 * THUMBNAIL_WIDTH_MARGIN]);
}
value4 = typeof r3 === 'bigint' ? r3 + 1n : +r3 + 1;
if (value4 < thumbnailScrollPositions.length) {
r3 = value4;
continue;
}
break;
}
value4 = typeof r3 === 'bigint' ? r3 + 1n : +r3 + 1;
if (value4 < thumbnailScrollPositions.length) {
r3 = value4;
continue;
}
break;
}
return items;
}, [thumbnailScrollPositions, variableWidthThumbnailsEnabled]);
const value6 = binding.useCallback(_fun76821, [sources,
thumbnailScrollPositions2((MediaSourceUtilModule).useSelectedMediaSource(syncer),
1)[0], onSelect, useThumbnailStyle]);
const value7 = binding.useMemo(function() {
return [sources.length];
}, [sources.length]);
const useAnimatedProps = ReanimatedRexportModule.useAnimatedProps;
const closure = function() {
var object = {};
object.scrollEnabled = scrollEnabled.get();
return object;
};
closure.__closure = {scrollEnabled: scrollEnabled};
closure.__workletHash = 13439565264141;
closure.__initData = env0_13;
const value8 = Reflect.apply(useAnimatedProps, ReanimatedRexportModule, [closure]);
const value9 = binding.useCallback(_fun76824, [headerBufferStyle]);
const value10 = binding.useCallback(_fun76825, [footerBufferStyle]);
const value11 = binding.useMemo(function() {
return index.get();
}, [index]);
const AnimatedFastList = (FastListModule).AnimatedFastList;
return (
<AnimatedFastList
ref={ref}
style={styles.containerPortrait}
sections={value7}
stickyHeaderFooter
disableContentWrappers
automaticallyAdjustContentInsets={false}
showsVerticalScrollIndicator={false}
showsHorizontalScrollIndicator={false}
initialScrollOrientation="center"
initialScrollItem={value11}
itemSize={itemSize}
renderItem={value6}
onScroll={onScroll}
horizontal
headerSize={headerBufferSize}
footerSize={footerBufferSize}
renderHeader={value9}
renderFooter={value10}
onEndReached={onEndReached}
endReachedThreshold={onEndReachedThreshold}
chunkBase={screenWidth}
snapToOffsets={value3}
animatedProps={value8}
/>
);
function _fun76821(a0, a1) { // fn#76821, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9993:2263, offset: 0x01de6554, size: 82 bytes, params: 3, frame: 15
const binding = env1_12;
const sourcesBinding = sources;
return ((Component) => <Component index={a1} source={sourcesBinding[a1]} numSources={sourcesBinding.length} selectedIndex={JsxRuntimeModule.jsxs} onSelect={onSelect} useThumbnailStyle={useThumbnailStyle} />)(binding);
}
return items;
}, [thumbnailScrollPositions, variableWidthThumbnailsEnabled]);
const value6 = binding.useCallback(_fun76821, [sources,
env0_3((require(9546) /* metro dependency 9546: MediaSourceUtil */).useSelectedMediaSource(syncer), 1)[0],
onSelect, useThumbnailStyle]);
const value7 = binding.useMemo(function() {
return [sources.length];
}, [sources.length]);
const reanimatedRexportModule = require(4017) /* metro dependency 4017: ReanimatedRexport */;
const useAnimatedProps = reanimatedRexportModule.useAnimatedProps;
const closure = function() {
var object = {};
object.scrollEnabled = scrollEnabled.get();
return object;
};
closure.__closure = {scrollEnabled: scrollEnabled};
closure.__workletHash = 13439565264141;
closure.__initData = env0_13;
const value8 = Reflect.apply(useAnimatedProps, reanimatedRexportModule, [closure]);
const value9 = binding.useCallback(_fun76824, [headerBufferStyle]);
const value10 = binding.useCallback(_fun76825, [footerBufferStyle]);
const value11 = binding.useMemo(function() {
return index.get();
}, [index]);
const AnimatedFastList = (require(8140) /* metro dependency 8140: FastList */).AnimatedFastList;
return (
<AnimatedFastList
ref={ref}
style={styles.containerPortrait}
sections={value7}
stickyHeaderFooter
disableContentWrappers
automaticallyAdjustContentInsets={false}
showsVerticalScrollIndicator={false}
showsHorizontalScrollIndicator={false}
initialScrollOrientation="center"
initialScrollItem={value11}
itemSize={itemSize}
renderItem={value6}
onScroll={onScroll}
horizontal
headerSize={headerBufferSize}
footerSize={footerBufferSize}
renderHeader={value9}
renderFooter={value10}
onEndReached={onEndReached}
endReachedThreshold={onEndReachedThreshold}
chunkBase={screenWidth}
snapToOffsets={value3}
animatedProps={value8}
/>
);
}
function _fun76821(a0, a1) { // fn#76821, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9993:2263, offset: 0x01de6554, size: 82 bytes, params: 3, frame: 15
const binding = env1_12;
const sourcesBinding = sources;
return ((Component) => <Component index={a1} source={sourcesBinding[a1]} numSources={sourcesBinding.length} selectedIndex={env0_9} onSelect={onSelect} useThumbnailStyle={useThumbnailStyle} />)(binding);
}
function _fun76824() { // fn#76824, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9993:2574, offset: 0x01de65d5, size: 50 bytes, params: 1, frame: 14
const value = environment.__proto__;
return ((Component) => <Component style={headerBufferStyle} />)(REAWorkaroundView);
}
function _fun76824() { // fn#76824, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9993:2574, offset: 0x01de65d5, size: 50 bytes, params: 1, frame: 14
const value = environment.__proto__;
return ((Component) => <Component style={headerBufferStyle} />)(importDefault(4018) /* metro dependency 4018: REAWorkaroundView */);
}
function _fun76825() { // fn#76825, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9993:2623, offset: 0x01de6607, size: 50 bytes, params: 1, frame: 14
const value = environment.__proto__;
return ((Component) => <Component style={footerBufferStyle} />)(REAWorkaroundView);
}
}
function _fun76825() { // fn#76825, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9993:2623, offset: 0x01de6607, size: 50 bytes, params: 1, frame: 14
const value = environment.__proto__;
return ((Component) => <Component style={footerBufferStyle} />)(importDefault(4018) /* metro dependency 4018: REAWorkaroundView */);
}
global.__d(_fun76815, 9807, [57, 31, 27, 9561, 33, 9808, 3860, 697, 4018, 4564, 477, 4501, 5475, 9546, 4017, 8140,
2]) /* metro module 9807, dependencies: [57, 31, 27, 9561, 33, 9808, 3860, 697, 4018, 4564, 477, 4501, 5475, 9546, 4017, 8140, 2] */;
@@ -1,20 +1,30 @@
/* Metro module 9829; source: modules/media_viewer/native/components/message_preview/MediaMessagePreview.tsx; dependencies: [57, 31, 27, 6865, 4792, 1379, 4814, 9590, 661, 33, 8177, 8368, 4501, 9562, 9773, 697, 566, 9830, 1244, 21, 9832, 9834, 9835, 7151, 9862, 5321, 9869, 9874, 4601, 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 ChannelStore from '../../../../../stores/ChannelStore.tsx'; /* Metro dependency 1379 */
import SearchMessageStore from '../../../../search/SearchMessageStore.tsx'; /* Metro dependency 4792 */
import MessageStore from '../../../../../stores/MessageStore.tsx'; /* Metro dependency 4814 */
import ForumPostMessagesStore from '../../../../forums/ForumPostMessagesStore.tsx'; /* Metro dependency 6865 */
import MessagePreviewStore from '../../../../../stores/native/MessagePreviewStore.tsx'; /* Metro dependency 9590 */
import ChatItem from '../../../../../components_native/chat/ChatItem.tsx'; /* Metro dependency 9773 */
import UseReactionPermissions from '../../../../messages/useReactionPermissions.tsx'; /* Metro dependency 9830 */
import ShowMediaMessagePreviewActionSheet from './showMediaMessagePreviewActionSheet.tsx'; /* Metro dependency 9832 */
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 FluxModule from '../../../../../external/discord_common/js/packages/flux/index.tsx'; /* Metro dependency 566 */
import * as ConstantsModule from '../../../../../Constants.tsx'; /* Metro dependency 661 */
import * as Module05321Module from '../../../../../by-id/module-05321.js'; /* Metro dependency 5321 */
import * as MediaViewerDimensionsContextModule from '../../MediaViewerDimensionsContext.tsx'; /* Metro dependency 9562 */
function _fun76972(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#76972, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10015:6, offset: 0x01deb908, size: 719 bytes, params: 8, frame: 22
var object2;
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_3 = importDefault(57) /* metro dependency 57 */;
const env0_4 = importAll(31) /* metro dependency 31 */;
let value = require(27) /* metro dependency 27 */;
let value = ReactNativeModule;
const env0_5 = value.findNodeHandle;
const env0_6 = value.ScrollView;
const forumPostMessagesStore = importDefault(6865) /* metro dependency 6865: ForumPostMessagesStore */;
const searchMessageStore = importDefault(4792) /* metro dependency 4792: SearchMessageStore */;
const channelStore = importDefault(1379) /* metro dependency 1379: ChannelStore */;
const messageStore = importDefault(4814) /* metro dependency 4814: MessageStore */;
const messagePreviewStore = importDefault(9590) /* metro dependency 9590: MessagePreviewStore */;
const ThemeTypes = (require(661) /* metro dependency 661: Constants */).ThemeTypes;
const ThemeTypes = (ConstantsModule).ThemeTypes;
value = require(33) /* metro dependency 33 */;
const env0_13 = value.jsx;
const env0_14 = value.Fragment;
@@ -37,297 +47,323 @@ function _fun76972(global, require, importDefault, importAll, module, exports, d
'top': 0, 'left': -9999, 'bottom': 0, 'width': '100%', 'opacity': 0}});
value = require(4501) /* metro dependency 4501: createStyles */;
let createNativeStyleProperties = value.createNativeStyleProperties;
object2 = {};
const REACTION_BACKGROUND_DEFAULT = (importDefault(697) /* metro dependency 697: native */).colors.REACTION_BACKGROUND_DEFAULT;
object2.reactionBackgroundColor = REACTION_BACKGROUND_DEFAULT;
const REACTION_BORDER_DEFAULT = (importDefault(697) /* metro dependency 697: native */).colors.REACTION_BORDER_DEFAULT;
object2.reactionBorderColor = REACTION_BORDER_DEFAULT;
const REACTION_TEXT_DEFAULT = (importDefault(697) /* metro dependency 697: native */).colors.REACTION_TEXT_DEFAULT;
object2.reactionTextColor = REACTION_TEXT_DEFAULT;
const REACTION_BACKGROUND_REACTED_DEFAULT = (importDefault(697) /* metro dependency 697: native */).colors.REACTION_BACKGROUND_REACTED_DEFAULT;
object2.activeReactionBackgroundColor = REACTION_BACKGROUND_REACTED_DEFAULT;
const REACTION_BORDER_REACTED_DEFAULT = (importDefault(697) /* metro dependency 697: native */).colors.REACTION_BORDER_REACTED_DEFAULT;
object2.activeReactionBorderColor = REACTION_BORDER_REACTED_DEFAULT;
const REACTION_TEXT_REACTED_DEFAULT = (importDefault(697) /* metro dependency 697: native */).colors.REACTION_TEXT_REACTED_DEFAULT;
object2.activeReactionTextColor = REACTION_TEXT_REACTED_DEFAULT;
const env0_19 = Reflect.apply(createNativeStyleProperties, value, [object2]);
object = {};
const REACTION_BACKGROUND_DEFAULT = (Native).colors.REACTION_BACKGROUND_DEFAULT;
object.reactionBackgroundColor = REACTION_BACKGROUND_DEFAULT;
const REACTION_BORDER_DEFAULT = (Native).colors.REACTION_BORDER_DEFAULT;
object.reactionBorderColor = REACTION_BORDER_DEFAULT;
const REACTION_TEXT_DEFAULT = (Native).colors.REACTION_TEXT_DEFAULT;
object.reactionTextColor = REACTION_TEXT_DEFAULT;
const REACTION_BACKGROUND_REACTED_DEFAULT = (Native).colors.REACTION_BACKGROUND_REACTED_DEFAULT;
object.activeReactionBackgroundColor = REACTION_BACKGROUND_REACTED_DEFAULT;
const REACTION_BORDER_REACTED_DEFAULT = (Native).colors.REACTION_BORDER_REACTED_DEFAULT;
object.activeReactionBorderColor = REACTION_BORDER_REACTED_DEFAULT;
const REACTION_TEXT_REACTED_DEFAULT = (Native).colors.REACTION_TEXT_REACTED_DEFAULT;
object.activeReactionTextColor = REACTION_TEXT_REACTED_DEFAULT;
const env0_19 = Reflect.apply(createNativeStyleProperties, value, [object]);
value = require(4501) /* metro dependency 4501: createStyles */;
createNativeStyleProperties = value.createNativeStyleProperties;
object2 = {};
const TEXT_MUTED = (importDefault(697) /* metro dependency 697: native */).colors.TEXT_MUTED;
object2.editedColor = TEXT_MUTED;
const TEXT_DEFAULT = (importDefault(697) /* metro dependency 697: native */).colors.TEXT_DEFAULT;
object2.seeMoreLabelColor = TEXT_DEFAULT;
const env0_20 = Reflect.apply(createNativeStyleProperties, value, [object2]);
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/media_viewer/native/components/message_preview/MediaMessagePreview.tsx');
object = {};
const TEXT_MUTED = (Native).colors.TEXT_MUTED;
object.editedColor = TEXT_MUTED;
const TEXT_DEFAULT = (Native).colors.TEXT_DEFAULT;
object.seeMoreLabelColor = TEXT_DEFAULT;
const env0_20 = Reflect.apply(createNativeStyleProperties, value, [object]);
(FileImportTrackerModule).fileFinishedImporting('modules/media_viewer/native/components/message_preview/MediaMessagePreview.tsx');
exports.default = MediaMessagePreview;
}
function MeasureMessage({message, onMeasure, onMeasureTruncated, disableReactionCreates}) { // fn#76973, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10015:893, offset: 0x01debbd7, size: 279 bytes, params: 2, frame: 22
const styles = useStyles();
const styles2 = styles;
const useMediaViewerDimensions = MediaViewerDimensionsContextModule.useMediaViewerDimensions;
const value3 = styles2.useMemo(function() {
var closure = _fun76975;
return {full: closure(false), truncated: closure(true)};
}, [disableReactionCreates, 0.5 * Reflect.apply(useMediaViewerDimensions, MediaViewerDimensionsContextModule,
[]).height, message, onMeasureTruncated, onMeasure, styles.dummyLayout]);
return (
<>
{((Component) => <Component {...value3.full} />)(ChatItem)}
{((Component) => <Component {...value3.truncated} />)(ChatItem)}
</>
);
function _fun76974() { // fn#76974, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10015:1059, offset: 0x01debcee, size: 39 bytes, params: 1, frame: 12
const generateChatItemProps2 = generateChatItemProps;
return {full: generateChatItemProps2(false), truncated: generateChatItemProps2(true)};
function generateChatItemProps(a0) { // fn#76975, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10015:1090, offset: 0x01debd15, size: 74 bytes, params: 2, frame: 3
const env0_0 = a0;
return {onLayout: onLayout_76976, modifyRow: modifyRow, rowGenerator: env2_16, message: message,
style: styles.dummyLayout};
function generateChatItemPropsOnLayout({nativeEvent}) { // fn#76976, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10015:1104, owner: generateChatItemProps.onLayout, offset: 0x01debd5f, size: 90 bytes, params: 2, frame: 14
const Math = global.Math;
const value2 = Math.min(nativeEvent.layout.height, env2_5);
if (value2 !== 0) {
if (env0_0) {
onMeasureTruncated(value2);
} else {
onMeasure(value2);
}
}
}
function MeasureMessage({message, onMeasure, onMeasureTruncated, disableReactionCreates}) { // fn#76973, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10015:893, offset: 0x01debbd7, size: 279 bytes, params: 2, frame: 22
const styles = useStyles();
const env0_4 = styles;
const mediaViewerDimensionsContextModule = require(9562) /* metro dependency 9562: MediaViewerDimensionsContext */;
const useMediaViewerDimensions = mediaViewerDimensionsContextModule.useMediaViewerDimensions;
const value3 = env0_4.useMemo(function() {
var closure = _fun76975;
return {full: closure(false), truncated: closure(true)};
}, [disableReactionCreates, 0.5 * Reflect.apply(useMediaViewerDimensions, mediaViewerDimensionsContextModule,
[]).height, message, onMeasureTruncated, onMeasure, styles.dummyLayout]);
return (
<>
{((Component) => <Component {...value3.full} />)(importDefault(9773) /* metro dependency 9773: ChatItem */)}
{((Component) => <Component {...value3.truncated} />)(importDefault(9773) /* metro dependency 9773: ChatItem */)}
</>
);
}
function modifyRow(a0) { // fn#76977, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10015:1186, owner: generateChatItemProps.modifyRow, offset: 0x01debdb9, size: 57 bytes, params: 2, frame: 13
rowModifierShared(a0, disableReactionCreates);
if (env0_0) {
a0.truncation = {'numberOfLines': 3, 'expandable': false, 'seeMoreLabel': ''};
}
}
function MediaMessagePreview({channelId, messageId, onClose, onTapMessage, onMeasureFullHeight, onMeasureCollapsedHeight, full, canExpand, setScrollViewIsAtTop, flingUpRef, flingDownRef, animationDriver}) { // fn#76979, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10015:2099, offset: 0x01debe2e, size: 1150 bytes, params: 2, frame: 44
const env0_3 = onTapMessage;
const env0_4 = full;
const value2 = (require(566) /* metro dependency 566: flux */).useStateFromStores([ChannelStore], _fun76980);
const disableReactionCreates = (importDefault(9830) /* metro dependency 9830: useReactionPermissions */)(value2).disableReactionCreates;
let binding = env0_4;
let useState = binding.useState;
const value3 = Reflect.apply(useState, binding, [false]);
binding = env0_3;
const value4 = binding(value3, 2);
const property = value4[0];
const env0_12 = value4[1];
const binding2 = env0_4;
useState = binding2.useState;
const value5 = binding(Reflect.apply(useState, binding2, [false]), 2);
const property2 = value5[0];
const env0_13 = value5[1];
const value7 = env0_4.useRef(null);
const binding4 = env0_4;
useState = binding4.useState;
const value8 = binding(Reflect.apply(useState, binding4, [null]), 2);
const property3 = value8[0];
const env0_16 = value8[1];
env0_4.useEffect(_fun76981, []);
const binding6 = env0_19;
let MIDNIGHT = ThemeTypes.MIDNIGHT;
const value9 = binding6(MIDNIGHT);
const binding7 = env0_20;
MIDNIGHT = ThemeTypes.MIDNIGHT;
const value10 = binding7(MIDNIGHT);
const value11 = env0_4.useCallback(_fun76982, [property3, disableReactionCreates, value10.editedColor,
value10.seeMoreLabelColor, value9, full, animationDriver]);
const value12 = (require(566) /* metro dependency 566: flux */).useStateFromStores([SearchMessageStore,
MessageStore, MessagePreviewStore, ForumPostMessagesStore], _fun76983, [channelId, messageId]);
const binding9 = env0_4;
useState = binding9.useState;
const value13 = binding(Reflect.apply(useState, binding9, [0]), 2);
const property4 = value13[0];
const env0_22 = value13[1];
const value14 = env0_4.useCallback(_fun76984, []);
const value15 = env0_4.useCallback(_fun76985, [full, property4]);
const value16 = env0_4.useCallback(_fun76986, [value12, onClose]);
const value17 = env0_4.useCallback(function(a0) {
if (a0 == null) {
throwTypeError(a0, "Cannot destructure 'undefined' or 'null'.", a0);
throw undefined;
}
}, [value12]);
const value18 = env0_4.useCallback(_fun76988, [channelId, value12, messageId]);
const value19 = env0_4.useCallback(_fun76989, []);
binding = env0_4;
const useMemo = binding.useMemo;
return value12 == null || value2 == null ? null : <>{((GestureDetector) => <GestureDetector gesture={Reflect.apply(useMemo,
binding, [_fun76990, [flingDownRef,
flingUpRef]])}><ScrollView scrollEventThrottle={16} onScroll={onScroll_76991} onLayout={value15} onContentSizeChange={value14} showsVerticalScrollIndicator={full} bounces={property}>{((Component) => <Component ref={value7} onLongPressLink={value19} onLongPressMessage={value16} onTapMessage={onTapMessage} onTapReaction={value18} onTapSeeMore={onTapMessage} onTapTag={value17} onTapLink={onTapLink} inverted={false} />)(importDefault(9869) /* metro dependency 9869: ChatAndroid */)}{((Component) => <Component rowGenerator={env0_16} modifyRow={value11} message={value12} />)(importDefault(9773) /* metro dependency 9773: ChatItem */)}</ScrollView></GestureDetector>)((require(5321) /* metro dependency 5321 */).GestureDetector)}{property2 ? <MeasureMessage disableReactionCreates={disableReactionCreates} message={value12} onMeasure={onMeasureFullHeight} onMeasureTruncated={onMeasureCollapsedHeight} /> : null}</>;
}
function _fun76974() { // fn#76974, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10015:1059, offset: 0x01debcee, size: 39 bytes, params: 1, frame: 12
const closure = generateChatItemProps;
return {full: closure(false), truncated: closure(true)};
}
function _fun76980() { // fn#76980, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10015:2356, offset: 0x01dec2ac, size: 41 bytes, params: 1, frame: 12
return channelId != null ? ChannelStore.getChannel(channelId) : undefined;
}
function _fun76981() { // fn#76981, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10015:2582, offset: 0x01dec2d5, size: 37 bytes, params: 1, frame: 12
env0_16(findNodeHandle(env0_14.current));
}
function _fun76982(a0) { // fn#76982, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10015:2700, offset: 0x01dec2fa, size: 279 bytes, params: 2, frame: 18
var object2;
var intl;
var Math;
var min;
let value = environment.__proto__;
const rowModifierSharedBinding = rowModifierShared;
const disableReactionCreatesBinding = disableReactionCreates;
rowModifierSharedBinding(a0, disableReactionCreatesBinding);
a0.reactTag = env0_15;
a0.canAddNewReactions = !disableReactionCreatesBinding;
a0.message.feedbackColor = undefined;
a0.message.editedColor = editedColor;
a0.reactionsTheme = env0_17;
if (!full) {
object2 = {'numberOfLines': 3, 'expandable': true};
intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
value = intl.string((require(1244) /* metro dependency 1244: indexNative */).t['7qbp3B']);
object2.seeMoreLabel = ' ' + value;
object2.seeMoreLabelColor = seeMoreLabelColor;
Math = global.Math;
min = Math.min;
value = animationDriver.get();
object2.outAnimationDuration = Reflect.apply(min, Math, [0.25 * value, 0.1]);
object2.outAnimation = 'fade';
a0.truncation = object2;
}
}
function _fun76983() { // fn#76983, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10015:3097, offset: 0x01dec411, size: 172 bytes, params: 1, frame: 19
var r0;
var value2;
var getMessage;
var value5;
var defaultImport;
var value6;
if (channelId != null) {
if (messageId != null) {
value2 = environment.__proto__;
r0 = MessageStore.getMessage(channelId, messageId) ?? MessagePreviewStore.getMessage(messageId);
if (r0 == null) {
getMessage = ForumPostMessagesStore.getMessage;
value5 = undefined;
defaultImport = importDefault(21) /* metro dependency 21: SnowflakeUtils */;
value6 = Reflect.apply(getMessage, ForumPostMessagesStore,
[defaultImport.castMessageIdAsChannelId(messageId)]);
r0 = value6 == null ? value5 : value6.firstMessage;
}
r0 = r0 ?? SearchMessageStore.getMessage(messageId);
return r0;
}
}
}
function _fun76984(a0, a1) { // fn#76984, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10015:3383, offset: 0x01dec4bd, size: 19 bytes, params: 3, frame: 11
env0_22(a1);
}
function MediaMessagePreview({channelId, messageId, onClose, onTapMessage, onMeasureFullHeight, onMeasureCollapsedHeight, full, canExpand, setScrollViewIsAtTop, flingUpRef, flingDownRef, animationDriver}) { // fn#76979, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10015:2099, offset: 0x01debe2e, size: 1150 bytes, params: 2, frame: 44
const onTapMessage2 = onTapMessage;
const full2 = full;
const value2 = (FluxModule).useStateFromStores([ChannelStore], _fun76980);
const disableReactionCreates = (UseReactionPermissions)(value2).disableReactionCreates;
let binding = full2;
let useState = binding.useState;
const value3 = Reflect.apply(useState, binding, [false]);
binding = onTapMessage2;
const value4 = binding(value3, 2);
const property = value4[0];
const env0_12 = value4[1];
const binding2 = full2;
useState = binding2.useState;
const value5 = binding(Reflect.apply(useState, binding2, [false]), 2);
const property2 = value5[0];
const env0_13 = value5[1];
const value7 = full2.useRef(null);
const binding4 = full2;
useState = binding4.useState;
const value8 = binding(Reflect.apply(useState, binding4, [null]), 2);
const property3 = value8[0];
const env0_16 = value8[1];
full2.useEffect(_fun76981, []);
const binding6 = env0_19;
let MIDNIGHT = ThemeTypes.MIDNIGHT;
const value9 = binding6(MIDNIGHT);
const binding7 = env0_20;
MIDNIGHT = ThemeTypes.MIDNIGHT;
const value10 = binding7(MIDNIGHT);
const value11 = full2.useCallback(_fun76982, [property3, disableReactionCreates, value10.editedColor,
value10.seeMoreLabelColor, value9, full, animationDriver]);
const value12 = (FluxModule).useStateFromStores([SearchMessageStore,
MessageStore, MessagePreviewStore, ForumPostMessagesStore], _fun76983, [channelId, messageId]);
const binding9 = full2;
useState = binding9.useState;
const value13 = binding(Reflect.apply(useState, binding9, [0]), 2);
const property4 = value13[0];
const env0_22 = value13[1];
const value14 = full2.useCallback(_fun76984, []);
const value15 = full2.useCallback(_fun76985, [full, property4]);
const value16 = full2.useCallback(_fun76986, [value12, onClose]);
const value17 = full2.useCallback(function(a0) {
if (a0 == null) {
throwTypeError(a0, "Cannot destructure 'undefined' or 'null'.", a0);
throw undefined;
}
}, [value12]);
const value18 = full2.useCallback(_fun76988, [channelId, value12, messageId]);
const value19 = full2.useCallback(_fun76989, []);
binding = full2;
const useMemo = binding.useMemo;
return (
value12 == null || value2 == null
? null
: (
<>
{((GestureDetector) => <GestureDetector gesture={Reflect.apply(useMemo, binding, [_fun76990,
[flingDownRef,
flingUpRef]])}><ScrollView scrollEventThrottle={16} onScroll={onScroll_76991} onLayout={value15} onContentSizeChange={value14} showsVerticalScrollIndicator={full} bounces={property}>{((Component) => <Component ref={value7} onLongPressLink={value19} onLongPressMessage={value16} onTapMessage={onTapMessage} onTapReaction={value18} onTapSeeMore={onTapMessage} onTapTag={value17} onTapLink={onTapLink} inverted={false} />)(importDefault(9869) /* metro dependency 9869: ChatAndroid */)}{((Component) => <Component rowGenerator={env0_16} modifyRow={value11} message={value12} />)(importDefault(9773) /* metro dependency 9773: ChatItem */)}</ScrollView></GestureDetector>)((require(5321) /* metro dependency 5321 */).GestureDetector)}
{
property2
? (
<MeasureMessage
disableReactionCreates={disableReactionCreates}
message={value12}
onMeasure={onMeasureFullHeight}
onMeasureTruncated={onMeasureCollapsedHeight}
/>
)
: null
}
</>
)
);
function _fun76980() { // fn#76980, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10015:2356, offset: 0x01dec2ac, size: 41 bytes, params: 1, frame: 12
return channelId != null ? ChannelStore.getChannel(channelId) : undefined;
}
function _fun76985({nativeEvent}) { // fn#76985, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10015:3421, offset: 0x01dec4d0, size: 62 bytes, params: 2, frame: 13
env0_13(true);
env0_12(env0_21 > nativeEvent.layout.height && full);
}
function _fun76981() { // fn#76981, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10015:2582, offset: 0x01dec2d5, size: 37 bytes, params: 1, frame: 12
env0_16(findNodeHandle(env0_14.current));
}
function _fun76986(a0) { // fn#76986, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10015:3496, offset: 0x01dec50e, size: 93 bytes, params: 2, frame: 14
let value = environment.__proto__;
const defaultImport = importDefault(9832) /* metro dependency 9832: showMediaMessagePreviewActionSheet */;
value = require(9834) /* metro dependency 9834: MessageDataSnowflakeUtils */;
const getNativeSyntheticEventData = value.getNativeSyntheticEventData;
defaultImport({channelId: Reflect.apply(getNativeSyntheticEventData, value, [a0]).channelId, message: env0_20,
closeMediaModal: onClose});
}
function _fun76982(a0) { // fn#76982, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10015:2700, offset: 0x01dec2fa, size: 279 bytes, params: 2, frame: 18
var object;
var intl;
var Math;
var min;
let value = environment.__proto__;
const rowModifierSharedBinding = rowModifierShared;
const disableReactionCreatesBinding = disableReactionCreates;
rowModifierSharedBinding(a0, disableReactionCreatesBinding);
a0.reactTag = env0_15;
a0.canAddNewReactions = !disableReactionCreatesBinding;
a0.message.feedbackColor = undefined;
a0.message.editedColor = editedColor;
a0.reactionsTheme = env0_17;
if (!full) {
object = {'numberOfLines': 3, 'expandable': true};
intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
value = intl.string((require(1244) /* metro dependency 1244: indexNative */).t['7qbp3B']);
object.seeMoreLabel = ' ' + value;
object.seeMoreLabelColor = seeMoreLabelColor;
Math = global.Math;
min = Math.min;
value = animationDriver.get();
object.outAnimationDuration = Reflect.apply(min, Math, [0.25 * value, 0.1]);
object.outAnimation = 'fade';
a0.truncation = object;
}
}
function _fun76988({nativeEvent}) { // fn#76988, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10015:3663, offset: 0x01dec56b, size: 205 bytes, params: 2, frame: 23
var r5;
var value3;
var value4;
var messageIdBinding;
var moduleValue;
var handleAddOrRemoveReaction;
var object2;
const reaction = nativeEvent.reaction;
if (env0_20 != null) {
value3 = environment.__proto__;
value4 = ChannelStore.getChannel(channelId);
if (value4 != null && messageId != null) {
moduleValue = require(9835) /* metro dependency 9835: MessagesUtils */;
handleAddOrRemoveReaction = moduleValue.handleAddOrRemoveReaction;
messageIdBinding = messageId;
if (reaction != null) {
object2 = {};
copyDataProperties(object2, reaction, undefined);
object2['emoji'] = reaction.emoji;
r5 = object2;
function _fun76983() { // fn#76983, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10015:3097, offset: 0x01dec411, size: 172 bytes, params: 1, frame: 19
var r0;
var value2;
var getMessage;
var forumPostMessagesStoreBinding;
var value5;
var defaultImport;
var value6;
if (channelId != null) {
if (messageId != null) {
value2 = environment.__proto__;
r0 = MessageStore.getMessage(channelId, messageId) ?? MessagePreviewStore.getMessage(messageId);
if (r0 == null) {
forumPostMessagesStoreBinding = ForumPostMessagesStore;
getMessage = forumPostMessagesStoreBinding.getMessage;
value5 = undefined;
defaultImport = importDefault(21) /* metro dependency 21: SnowflakeUtils */;
value6 = Reflect.apply(getMessage, forumPostMessagesStoreBinding,
[defaultImport.castMessageIdAsChannelId(messageId)]);
r0 = value6 == null ? value5 : value6.firstMessage;
}
r0 = r0 ?? SearchMessageStore.getMessage(messageId);
return r0;
}
}
}
function _fun76984(a0, a1) { // fn#76984, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10015:3383, offset: 0x01dec4bd, size: 19 bytes, params: 3, frame: 11
env0_22(a1);
}
function _fun76985({nativeEvent}) { // fn#76985, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10015:3421, offset: 0x01dec4d0, size: 62 bytes, params: 2, frame: 13
env0_13(true);
env0_12(env0_21 > nativeEvent.layout.height && full);
}
function _fun76986(a0) { // fn#76986, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10015:3496, offset: 0x01dec50e, size: 93 bytes, params: 2, frame: 14
let value = environment.__proto__;
const defaultImport = ShowMediaMessagePreviewActionSheet;
value = require(9834) /* metro dependency 9834: MessageDataSnowflakeUtils */;
const getNativeSyntheticEventData = value.getNativeSyntheticEventData;
defaultImport({channelId: Reflect.apply(getNativeSyntheticEventData, value, [a0]).channelId, message: env0_20,
closeMediaModal: onClose});
}
function _fun76988({nativeEvent}) { // fn#76988, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10015:3663, offset: 0x01dec56b, size: 205 bytes, params: 2, frame: 23
var r5;
var value3;
var channelStoreBinding;
var value4;
var messageIdBinding;
var moduleValue;
var handleAddOrRemoveReaction;
var object;
const reaction = nativeEvent.reaction;
if (env0_20 != null) {
value3 = environment.__proto__;
channelStoreBinding = ChannelStore;
value4 = channelStoreBinding.getChannel(channelId);
if (value4 != null && messageId != null) {
moduleValue = require(9835) /* metro dependency 9835: MessagesUtils */;
handleAddOrRemoveReaction = moduleValue.handleAddOrRemoveReaction;
messageIdBinding = messageId;
if (reaction != null) {
object = {};
copyDataProperties(object, reaction, undefined);
object['emoji'] = reaction.emoji;
r5 = object;
} else {
r5 = null;
}
Reflect.apply(handleAddOrRemoveReaction, moduleValue, [messageIdBinding, value4, r5, nativeEvent.isBurst,
(require(7151) /* metro dependency 7151: ReactionActionCreators */).ReactionLocations.MOBILE_MEDIA_VIEWER]);
}
}
}
function _fun76989({nativeEvent}) { // fn#76989, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10015:3911, offset: 0x01dec638, size: 75 bytes, params: 2, frame: 12
const url = nativeEvent.url;
let value = url != null;
if (value && url !== '') {
value = environment.__proto__;
value = importDefault(9862) /* metro dependency 9862: showLongPressURLActionSheet */;
value({urlString: url});
}
}
function _fun76990() { // fn#76990, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10015:3998, offset: 0x01dec683, size: 66 bytes, params: 1, frame: 13
let value = environment.__proto__;
const Gesture = (Module05321Module).Gesture;
value = Gesture.Native();
return value.requireExternalGestureToFail(flingUpRef, flingDownRef);
}
function MediaMessagePreviewOnScroll({nativeEvent}) { // fn#76991, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10015:4200, owner: MediaMessagePreview.onScroll, offset: 0x01dec6c5, size: 83 bytes, params: 2, frame: 15
setScrollViewIsAtTop(nativeEvent.contentOffset.y === 0 && (nativeEvent.velocity?.y ?? 0) === 0);
}
function onTapLink(a0) { // fn#76992, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10015:4519, owner: MediaMessagePreview.onTapLink, offset: 0x01dec718, size: 137 bytes, params: 2, frame: 14
var environment;
var value2;
if (canExpand) {
if (full) {
value2 = environment.__proto__;
(require(9874) /* metro dependency 9874: handleMessagesTapLink */).handleMessagesTapLink({allowWithinModal: true,
chatInputRef: undefined, handleTransitionToThread: handleTransitionToThread, message: env0_20,
messageChannel: env0_10, selectedChannelId: channelId, tapLinkData: a0.nativeEvent});
} else {
onTapMessage();
}
} else {
r5 = null;
value2 = environment.__proto__;
(require(9874) /* metro dependency 9874: handleMessagesTapLink */).handleMessagesTapLink({allowWithinModal: true,
chatInputRef: undefined, handleTransitionToThread: handleTransitionToThread, message: env0_20,
messageChannel: env0_10, selectedChannelId: channelId, tapLinkData: a0.nativeEvent});
}
Reflect.apply(handleAddOrRemoveReaction, moduleValue, [messageIdBinding, value4, r5, nativeEvent.isBurst,
(require(7151) /* metro dependency 7151: ReactionActionCreators */).ReactionLocations.MOBILE_MEDIA_VIEWER]);
function handleTransitionToThread(a0, a1, a2) { // fn#76993, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10015:4630, owner: MediaMessagePreview.onTapLink.handleTransitionToThread, offset: 0x01dec7a1, size: 80 bytes, params: 4, frame: 14
const value = environment.__proto__.__proto__;
const channel = ChannelStore.getChannel(a1);
if (channel != null) {
(require(4601) /* metro dependency 4601: transitionToChannel */).transitionToThread(channel, {source: a2,
navigationReplace: false});
}
}
}
}
}
function _fun76989({nativeEvent}) { // fn#76989, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10015:3911, offset: 0x01dec638, size: 75 bytes, params: 2, frame: 12
const url = nativeEvent.url;
let value = url != null;
if (value && url !== '') {
value = environment.__proto__;
value = importDefault(9862) /* metro dependency 9862: showLongPressURLActionSheet */;
value({urlString: url});
}
}
function _fun76990() { // fn#76990, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10015:3998, offset: 0x01dec683, size: 66 bytes, params: 1, frame: 13
let value = environment.__proto__;
const Gesture = (require(5321) /* metro dependency 5321 */).Gesture;
value = Gesture.Native();
return value.requireExternalGestureToFail(flingUpRef, flingDownRef);
}
function MediaMessagePreviewOnScroll({nativeEvent}) { // fn#76991, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10015:4200, owner: MediaMessagePreview.onScroll, offset: 0x01dec6c5, size: 83 bytes, params: 2, frame: 15
setScrollViewIsAtTop(nativeEvent.contentOffset.y === 0 && (nativeEvent.velocity?.y ?? 0) === 0);
}
function MediaMessagePreviewOnTapLink(a0) { // fn#76992, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10015:4519, owner: MediaMessagePreview.onTapLink, offset: 0x01dec718, size: 137 bytes, params: 2, frame: 14
var environment;
var value2;
if (canExpand) {
if (full) {
value2 = environment.__proto__;
(require(9874) /* metro dependency 9874: handleMessagesTapLink */).handleMessagesTapLink({allowWithinModal: true,
chatInputRef: undefined, handleTransitionToThread: handleTransitionToThread, message: env0_20,
messageChannel: env0_10, selectedChannelId: channelId, tapLinkData: a0.nativeEvent});
} else {
onTapMessage();
}
} else {
value2 = environment.__proto__;
(require(9874) /* metro dependency 9874: handleMessagesTapLink */).handleMessagesTapLink({allowWithinModal: true,
chatInputRef: undefined, handleTransitionToThread: handleTransitionToThread, message: env0_20,
messageChannel: env0_10, selectedChannelId: channelId, tapLinkData: a0.nativeEvent});
}
}
function generateChatItemProps(a0) { // fn#76975, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10015:1090, offset: 0x01debd15, size: 74 bytes, params: 2, frame: 3
const env0_0 = a0;
return {onLayout: onLayout_76976, modifyRow: modifyRow_76977, rowGenerator: env2_16, message: message,
style: styles.dummyLayout};
}
function onTapLinkHandleTransitionToThread(a0, a1, a2) { // fn#76993, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10015:4630, owner: MediaMessagePreview.onTapLink.handleTransitionToThread, offset: 0x01dec7a1, size: 80 bytes, params: 4, frame: 14
const value = environment.__proto__.__proto__;
const channel = ChannelStore.getChannel(a1);
if (channel != null) {
(require(4601) /* metro dependency 4601: transitionToChannel */).transitionToThread(channel, {source: a2,
navigationReplace: false});
}
}
function generateChatItemPropsOnLayout({nativeEvent}) { // fn#76976, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10015:1104, owner: generateChatItemProps.onLayout, offset: 0x01debd5f, size: 90 bytes, params: 2, frame: 14
const Math = global.Math;
const value2 = Math.min(nativeEvent.layout.height, env2_5);
if (value2 !== 0) {
if (env0_0) {
onMeasureTruncated(value2);
} else {
onMeasure(value2);
}
}
}
function generateChatItemPropsModifyRow(a0) { // fn#76977, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10015:1186, owner: generateChatItemProps.modifyRow, offset: 0x01debdb9, size: 57 bytes, params: 2, frame: 13
rowModifierShared(a0, disableReactionCreates);
if (env0_0) {
a0.truncation = {'numberOfLines': 3, 'expandable': false, 'seeMoreLabel': ''};
}
}
global.__d(_fun76972, 9829, [57, 31, 27, 6865, 4792, 1379, 4814, 9590, 661, 33, 8177, 8368, 4501, 9562, 9773, 697,
566, 9830, 1244, 21, 9832, 9834, 9835, 7151, 9862, 5321, 9869, 9874, 4601,
2]) /* metro module 9829, dependencies: [57, 31, 27, 6865, 4792, 1379, 4814, 9590, 661, 33, 8177, 8368, 4501, 9562, 9773, 697, 566, 9830, 1244, 21, 9832, 9834, 9835, 7151, 9862, 5321, 9869, 9874, 4601, 2] */;
@@ -1,77 +1,103 @@
/* Metro module 9833; source: modules/media_viewer/native/components/message_preview/MediaMessagePreviewActionSheet.tsx; dependencies: [31, 33, 3829, 6894, 4080, 1230, 6797, 3856, 8153, 6805, 6807, 9799, 1244, 8772, 8665, 2] */
import ActionSheetActionCreators from '../../../../action_sheet/native/ActionSheetActionCreators.tsx'; /* Metro dependency 4080 */
import * as FileImportTrackerModule from '../../../../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
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 Router_utilsModule from '../../../../routing/router_utils.tsx'; /* Metro dependency 1230 */
import * as UserSettingsModule from '../../../../user_settings/UserSettings.tsx'; /* Metro dependency 3829 */
import * as ToastUtilsModule from '../../../../toast/native/ToastUtils.tsx'; /* Metro dependency 3856 */
import * as ClipboardUtilsNativeModule from '../../../../../utils/ClipboardUtils.native.tsx'; /* Metro dependency 6797 */
import * as ActionSheetNativeModule from '../../../../../design/components/Sheet/native/ActionSheet.native.tsx'; /* Metro dependency 6805 */
import * as ReportModalsModule from '../../../../in_app_reports/ReportModals.tsx'; /* Metro dependency 8153 */
import * as ChatArrowRightIconModule from '../../../../../design/components/Icon/native/redesign/generated/ChatArrowRightIcon.tsx'; /* Metro dependency 9799 */
function _fun77004(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#77004, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10019:6, offset: 0x01decd80, size: 161 bytes, params: 8, frame: 18
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
let value = importAll(31) /* metro dependency 31 */;
const value2 = require(33) /* metro dependency 33 */;
const env0_4 = value2.jsx;
const env0_5 = value2.jsxs;
let value = ReactModule;
value = value.memo(MediaMessagePreviewActionSheet);
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/media_viewer/native/components/message_preview/MediaMessagePreviewActionSheet.tsx');
(FileImportTrackerModule).fileFinishedImporting('modules/media_viewer/native/components/message_preview/MediaMessagePreviewActionSheet.tsx');
exports.default = value;
}
function MediaMessagePreviewActionSheet({channel, message, user, closeMediaModal}) { // fn#77005, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10019:147, offset: 0x01dece21, size: 857 bytes, params: 2, frame: 32
var r10;
const DeveloperMode = (UserSettingsModule).DeveloperMode;
const value2 = DeveloperMode.useSetting();
let r8 = !user.isNonUserBot() && (require(6894) /* metro dependency 6894: ReportUtils */).canReportUser(user) && (require(6894) /* metro dependency 6894: ReportUtils */).canReportMessage(message);
const binding = undefined;
const value4 = binding.useCallback(_fun77006, []);
const value5 = binding.useCallback(_fun77007, [value4, closeMediaModal, channel.guild_id, channel.id, message.id]);
const value6 = binding.useCallback(_fun77008, [message.id, value4]);
const value7 = binding.useCallback(_fun77009, [message, value4]);
const ActionSheet = (ActionSheetNativeModule).ActionSheet;
const ActionSheetRow = (require(6807) /* metro dependency 6807: ActionSheetRowNative */).ActionSheetRow;
const Group = ActionSheetRow.Group;
const object2 = {};
const ActionSheetRow2 = (require(6807) /* metro dependency 6807: ActionSheetRowNative */).ActionSheetRow;
const Icon = ActionSheetRow2.Icon;
const ChatArrowRightIcon = (ChatArrowRightIconModule).ChatArrowRightIcon;
object2.icon = <Icon IconComponent={ChatArrowRightIcon} />;
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
object2.label = intl.string((require(1244) /* metro dependency 1244: indexNative */).t['+TSRGD']);
object2.onPress = value5;
const actionSheetRow = <ActionSheetRow {...object2} />;
if (value2) {
r10 = (
<ActionSheetRow
icon={((Icon) => <Icon IconComponent={(require(8772) /* metro dependency 8772: IdIcon */).IdIcon} />)((require(6807) /* metro dependency 6807: ActionSheetRowNative */).ActionSheetRow.Icon)}
label={intl.string((require(1244) /* metro dependency 1244: indexNative */).t.zBoHlf)}
onPress={value6}
/>
);
} else {
r10 = value2;
}
if (r8) {
r8 = (
<ActionSheetRow
icon={((Icon) => <Icon IconComponent={(require(8665) /* metro dependency 8665: FlagIcon */).FlagIcon} />)((require(6807) /* metro dependency 6807: ActionSheetRowNative */).ActionSheetRow.Icon)}
label={intl.string((require(1244) /* metro dependency 1244: indexNative */).t['+78Pfm'])}
onPress={value7}
variant="danger"
/>
);
}
return (
<ActionSheet>
<Group hasIcons>
{actionSheetRow}
{r10}
{r8}
</Group>
</ActionSheet>
);
function _fun77006() { // fn#77006, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10019:368, offset: 0x01ded17a, size: 37 bytes, params: 1, frame: 11
const value = environment.__proto__;
(ActionSheetActionCreators).hideActionSheet();
}
function _fun77007() { // fn#77007, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10019:422, offset: 0x01ded19f, size: 82 bytes, params: 1, frame: 16
env0_3();
closeMediaModal();
const transitionToGuild = Router_utilsModule.transitionToGuild;
const channelBinding = channel;
Reflect.apply(transitionToGuild, Router_utilsModule, [channelBinding.guild_id, channelBinding.id, message.id]);
}
function _fun77008() { // fn#77008, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10019:530, offset: 0x01ded1f1, size: 80 bytes, params: 1, frame: 14
env0_3();
ClipboardUtilsNativeModule.copy(message.id);
(ToastUtilsModule).presentIdCopied();
}
function _fun77009() { // fn#77009, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10019:613, offset: 0x01ded241, size: 60 bytes, params: 1, frame: 14
env0_3();
ReportModalsModule.showReportModalForMessage(message, 'mobile_media_message_preview_action_sheet');
}
function MediaMessagePreviewActionSheet({channel, message, user, closeMediaModal}) { // fn#77005, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10019:147, offset: 0x01dece21, size: 857 bytes, params: 2, frame: 32
var r10;
const DeveloperMode = (require(3829) /* metro dependency 3829: UserSettings */).DeveloperMode;
const value2 = DeveloperMode.useSetting();
let r8 = !user.isNonUserBot() && (require(6894) /* metro dependency 6894: ReportUtils */).canReportUser(user) && (require(6894) /* metro dependency 6894: ReportUtils */).canReportMessage(message);
const binding = undefined;
const value4 = binding.useCallback(_fun77006, []);
const value5 = binding.useCallback(_fun77007, [value4, closeMediaModal, channel.guild_id, channel.id, message.id]);
const value6 = binding.useCallback(_fun77008, [message.id, value4]);
const value7 = binding.useCallback(_fun77009, [message, value4]);
const ActionSheet = (require(6805) /* metro dependency 6805: ActionSheetNative */).ActionSheet;
const ActionSheetRow = (require(6807) /* metro dependency 6807: ActionSheetRowNative */).ActionSheetRow;
const Group = ActionSheetRow.Group;
const object = {};
const ActionSheetRow2 = (require(6807) /* metro dependency 6807: ActionSheetRowNative */).ActionSheetRow;
const Icon = ActionSheetRow2.Icon;
const ChatArrowRightIcon = (require(9799) /* metro dependency 9799: ChatArrowRightIcon */).ChatArrowRightIcon;
object.icon = <Icon IconComponent={ChatArrowRightIcon} />;
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
object.label = intl.string((require(1244) /* metro dependency 1244: indexNative */).t['+TSRGD']);
object.onPress = value5;
const actionSheetRow = <ActionSheetRow {...object} />;
if (value2) {
r10 = <ActionSheetRow icon={((Icon) => <Icon IconComponent={(require(8772) /* metro dependency 8772: IdIcon */).IdIcon} />)((require(6807) /* metro dependency 6807: ActionSheetRowNative */).ActionSheetRow.Icon)} label={intl.string((require(1244) /* metro dependency 1244: indexNative */).t.zBoHlf)} onPress={value6} />;
} else {
r10 = value2;
}
if (r8) {
r8 = <ActionSheetRow icon={((Icon) => <Icon IconComponent={(require(8665) /* metro dependency 8665: FlagIcon */).FlagIcon} />)((require(6807) /* metro dependency 6807: ActionSheetRowNative */).ActionSheetRow.Icon)} label={intl.string((require(1244) /* metro dependency 1244: indexNative */).t['+78Pfm'])} onPress={value7} variant="danger" />;
}
return (
<ActionSheet>
<Group hasIcons>
{actionSheetRow}
{r10}
{r8}
</Group>
</ActionSheet>
);
}
function _fun77007() { // fn#77007, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10019:422, offset: 0x01ded19f, size: 82 bytes, params: 1, frame: 16
env0_3();
closeMediaModal();
const router_utilsModule = require(1230) /* metro dependency 1230: router_utils */;
const transitionToGuild = router_utilsModule.transitionToGuild;
const channelBinding = channel;
Reflect.apply(transitionToGuild, router_utilsModule, [channelBinding.guild_id, channelBinding.id, message.id]);
}
function _fun77008() { // fn#77008, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10019:530, offset: 0x01ded1f1, size: 80 bytes, params: 1, frame: 14
env0_3();
const clipboardUtilsNativeModule = require(6797) /* metro dependency 6797: ClipboardUtilsNative */;
clipboardUtilsNativeModule.copy(message.id);
(require(3856) /* metro dependency 3856: ToastUtils */).presentIdCopied();
}
function _fun77009() { // fn#77009, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10019:613, offset: 0x01ded241, size: 60 bytes, params: 1, frame: 14
env0_3();
const reportModalsModule = require(8153) /* metro dependency 8153: ReportModals */;
reportModalsModule.showReportModalForMessage(message, 'mobile_media_message_preview_action_sheet');
}
global.__d(_fun77004, 9833, [31, 33, 3829, 6894, 4080, 1230, 6797, 3856, 8153, 6805, 6807, 9799, 1244, 8772, 8665,
2]) /* metro module 9833, dependencies: [31, 33, 3829, 6894, 4080, 1230, 6797, 3856, 8153, 6805, 6807, 9799, 1244, 8772, 8665, 2] */;
@@ -1,32 +1,38 @@
/* Metro module 9832; source: modules/media_viewer/native/components/message_preview/showMediaMessagePreviewActionSheet.tsx; dependencies: [1379, 1878, 4080, 9833, 1962, 2] */
import ChannelStore from '../../../../../stores/ChannelStore.tsx'; /* Metro dependency 1379 */
import UserStore from '../../../../../stores/UserStore.tsx'; /* Metro dependency 1878 */
import * as FileImportTrackerModule from '../../../../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
function _fun77002(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#77002, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10018:6, offset: 0x01decc46, size: 134 bytes, params: 8, frame: 19
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const channelStore = importDefault(1379) /* metro dependency 1379: ChannelStore */;
const userStore = importDefault(1878) /* metro dependency 1878: UserStore */;
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/media_viewer/native/components/message_preview/showMediaMessagePreviewActionSheet.tsx');
(FileImportTrackerModule).fileFinishedImporting('modules/media_viewer/native/components/message_preview/showMediaMessagePreviewActionSheet.tsx');
exports.default = showMediaMessagePreviewActionSheet;
}
function showMediaMessagePreviewActionSheet({channelId, closeMediaModal, message}) { // fn#77003, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10018:253, offset: 0x01decccc, size: 180 bytes, params: 2, frame: 20
var value3;
var defaultImport;
var openLazy;
var value;
const channel = ChannelStore.getChannel(channelId);
if (channel != null) {
if (message != null) {
value3 = UserStore.getUser(message.author.id);
if (value3 != null) {
defaultImport = importDefault(dependencyMap[2]);
openLazy = defaultImport.openLazy;
value = require(dependencyMap[4]);
value = value(dependencyMap[3], dependencyMap.paths);
Reflect.apply(openLazy, defaultImport, [value, 'MediaMessagePreviewActionSheet', {channel: channel,
message: message, user: value3, closeMediaModal: closeMediaModal}]);
function showMediaMessagePreviewActionSheet({channelId, closeMediaModal, message}) { // fn#77003, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10018:253, offset: 0x01decccc, size: 180 bytes, params: 2, frame: 20
var userStoreBinding;
var value3;
var defaultImport;
var openLazy;
var value;
const channel = ChannelStore.getChannel(channelId);
if (channel != null) {
if (message != null) {
userStoreBinding = UserStore;
value3 = userStoreBinding.getUser(message.author.id);
if (value3 != null) {
defaultImport = importDefault(dependencyMap[2]);
openLazy = defaultImport.openLazy;
value = require(dependencyMap[4]);
value = value(dependencyMap[3], dependencyMap.paths);
Reflect.apply(openLazy, defaultImport, [value, 'MediaMessagePreviewActionSheet', {channel: channel,
message: message, user: value3, closeMediaModal: closeMediaModal}]);
}
}
}
}
}
global.__d(_fun77002, 9832, [1379, 1878, 4080, 9833, 1962,
2]) /* metro module 9832, dependencies: [1379, 1878, 4080, 9833, 1962, 2] */;
@@ -1,151 +1,155 @@
/* Metro module 9544; source: modules/media_viewer/native/components/openMediaModal.tsx; dependencies: [57, 5, 3849, 661, 1478, 9545, 1962, 9547, 9551, 44, 4080, 9557, 5080, 9558, 2] */
import Module00005 from '../../../../by-id/module-00005.js'; /* Metro dependency 5 */
import Module00057 from '../../../../by-id/module-00057.js'; /* Metro dependency 57 */
import ActionSheetStore from '../../../action_sheet/native/ActionSheetStore.tsx'; /* Metro dependency 3849 */
import * as FileImportTrackerModule from '../../../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
import * as ConstantsModule from '../../../../Constants.tsx'; /* Metro dependency 661 */
function _fun74476(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#74476, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9730:6, offset: 0x01d8eadc, size: 183 bytes, params: 8, frame: 19
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_3 = importDefault(57) /* metro dependency 57 */;
const env0_4 = importDefault(5) /* metro dependency 5 */;
const actionSheetStore = importDefault(3849) /* metro dependency 3849: ActionSheetStore */;
const env0_6 = (require(661) /* metro dependency 661: Constants */).MEDIA_MODAL_KEY;
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/media_viewer/native/components/openMediaModal.tsx');
(FileImportTrackerModule).fileFinishedImporting('modules/media_viewer/native/components/openMediaModal.tsx');
exports.openMediaModal = function() {
return _openMediaModal.apply(this, arguments);
};
}
function _openMediaModal() { // fn#74477, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9730:152, offset: 0x01d8eb93, size: 50 bytes, params: 1, frame: 14
return Module00005(_fun74479).apply(this, arguments);
async function _fun74479(a0) { // fn#74479, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9730:205, offset: 0x01d8ebd9, size: 402 bytes, params: 2, frame: 26
var environment;
if (true) {
var originViewOrOriginLayout = a0.originViewOrOriginLayout;
if (a0.initialIndex !== undefined) {
}
var env0_1 = a0.initialSources;
var env0_2 = a0.analyticsSource;
var env0_3 = a0.channelId;
var env0_4 = a0.onClose;
if (a0.openAs !== undefined) {
}
var object = {'originViewOrOriginLayout': 0, 'initialIndex': 0, 'initialSources': 0, 'analyticsSource': 0,
'channelId': 0, 'onClose': 0, 'openAs': 0};
silentSetPrototypeOf(object, null, undefined);
var env0_6 = copyDataProperties({}, a0, object, undefined);
var env0_7;
var env0_8;
var env0_9;
await undefined;
if (false) {
return undefined;
}
var Promise = global.Promise;
var all = Promise.all;
value = environment.__proto__.__proto__;
var binding = env2_0;
var binding2 = env2_2;
object = [binding(binding2[6])(binding2[5], binding2.paths)];
object[1] = binding(binding2[6])(binding2[7], binding2.paths);
object[2] = binding(binding2[6])(binding2[8], binding2.paths);
await Reflect.apply(all, Promise, [object]);
var value8 = undefined;
if (false) {
return value8;
}
value = env2_3(value8, 3);
env0_7 = value[0].setMediaViewerSources;
env0_8 = value[1].MediaViewerAnalytics;
env0_9 = value[2].initVideoStateStore;
((a0) => {
var env0_0 = a0;
return a0 == null ? _fun74481 : 'measureInWindow' in a0 ? a0.measureInWindow.bind(a0) : _fun74481;
})(originViewOrOriginLayout)(_fun74482);
}
function getMeasureInWindowFunction(a0) { // fn#74480, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9730:528, offset: 0x01d8ed6b, size: 53 bytes, params: 2, frame: 12
const env0_0 = a0;
return a0 == null ? _fun74481 : 'measureInWindow' in a0 ? a0.measureInWindow.bind(a0) : _fun74481;
function _fun74481(a0) { // fn#74481, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9730:631, offset: 0x01d8eda0, size: 139 bytes, params: 2, frame: 20
var r0;
var object;
var binding;
var binding2;
var getWindowDimensions;
var value;
if (env0_0 != null) {
r0 = env0_0;
} else {
object = {'x': 0, 'y': 0};
value = environment.__proto__.__proto__.__proto__.__proto__;
binding = env4_0;
binding2 = env4_2;
value = binding(binding2[4]);
getWindowDimensions = value.getWindowDimensions;
object.width = Reflect.apply(getWindowDimensions, value, []).width;
value = binding(binding2[4]);
getWindowDimensions = value.getWindowDimensions;
object.height = Reflect.apply(getWindowDimensions, value, []).height;
r0 = object;
}
a0(r0.x, r0.y, r0.width, r0.height, r0.resizeMode);
}
function _openMediaModal() { // fn#74477, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9730:152, offset: 0x01d8eb93, size: 50 bytes, params: 1, frame: 14
return env0_4(_fun74479).apply(this, arguments);
}
}
function _fun74482(a0, a1, a2, a3, a4) { // fn#74482, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9730:794, offset: 0x01d8ee2b, size: 498 bytes, params: 6, frame: 24
var value2;
var binding;
var binding2;
var value3;
var pushLazy;
var value5;
var object;
var value6;
var binding3;
var value8;
var openLazy;
var value10;
if (openAs === 'action-sheet') {
value6 = environment.__proto__.__proto__.__proto__;
binding = env3_1;
binding3 = env3_2;
binding(binding3[9])(env3_5.isOpen(),
'An action sheet must be open to open the media modal as an action sheet');
value8 = binding(binding3[10]);
openLazy = value8.openLazy;
binding = env3_0;
value10 = binding(binding3[6])(binding3[11], binding3.paths);
binding = env3_6;
object = {};
copyDataProperties(object, env0_6, undefined);
object['initialIndex'] = initialIndex;
object['originLayout'] = {x: a0, y: a1, width: a2, height: a3, resizeMode: a4};
object['onCloseCallback'] = onClose;
object['disableHapticOnOpen'] = true;
Reflect.apply(openLazy, value8, [value10, binding, object, 'stack']);
} else {
value2 = environment.__proto__.__proto__.__proto__;
binding = env3_1;
binding2 = env3_2;
value3 = binding(binding2[12]);
pushLazy = value3.pushLazy;
binding = env3_0;
value5 = binding(binding2[6])(binding2[13], binding2.paths);
object = {};
copyDataProperties(object, env0_6, undefined);
object['initialIndex'] = initialIndex;
object['originLayout'] = {x: a0, y: a1, width: a2, height: a3, resizeMode: a4};
object['onCloseCallback'] = onClose;
binding = env3_6;
Reflect.apply(pushLazy, value3, [value5, object, binding, {animation: 'none'}]);
}
const setMediaViewerSourcesBinding = setMediaViewerSources;
const initialSourcesBinding = initialSources;
setMediaViewerSourcesBinding({sources: initialSourcesBinding, initialIndex: initialIndex});
MediaViewerAnalytics.markSessionStarted({channelId: channelId, numMediaItems: initialSourcesBinding.length,
source: analyticsSource});
initVideoStateStore();
}
async function _fun74479(a0) { // fn#74479, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9730:205, offset: 0x01d8ebd9, size: 402 bytes, params: 2, frame: 26
var environment;
if (true) {
var originViewOrOriginLayout = a0.originViewOrOriginLayout;
if (a0.initialIndex !== undefined) {
}
var env0_1 = a0.initialSources;
var env0_2 = a0.analyticsSource;
var env0_3 = a0.channelId;
var env0_4 = a0.onClose;
if (a0.openAs !== undefined) {
}
var object = {'originViewOrOriginLayout': 0, 'initialIndex': 0, 'initialSources': 0, 'analyticsSource': 0,
'channelId': 0, 'onClose': 0, 'openAs': 0};
silentSetPrototypeOf(object, null, undefined);
var env0_6 = copyDataProperties({}, a0, object, undefined);
var env0_7;
var env0_8;
var env0_9;
await undefined;
if (false) {
return undefined;
}
var Promise = global.Promise;
var all = Promise.all;
value = environment.__proto__.__proto__;
var binding = env2_0;
var binding2 = env2_2;
object = [binding(binding2[6])(binding2[5], binding2.paths)];
object[1] = binding(binding2[6])(binding2[7], binding2.paths);
object[2] = binding(binding2[6])(binding2[8], binding2.paths);
await Reflect.apply(all, Promise, [object]);
var value8 = undefined;
if (false) {
return value8;
}
value = env2_3(value8, 3);
env0_7 = value[0].setMediaViewerSources;
env0_8 = value[1].MediaViewerAnalytics;
env0_9 = value[2].initVideoStateStore;
((a0) => {
var env0_0 = a0;
return a0 == null ? _fun74481 : 'measureInWindow' in a0 ? a0.measureInWindow.bind(a0) : _fun74481;
})(originViewOrOriginLayout)(_fun74482);
}
}
function getMeasureInWindowFunction(a0) { // fn#74480, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9730:528, offset: 0x01d8ed6b, size: 53 bytes, params: 2, frame: 12
const env0_0 = a0;
return a0 == null ? _fun74481 : 'measureInWindow' in a0 ? a0.measureInWindow.bind(a0) : _fun74481;
}
function _fun74482(a0, a1, a2, a3, a4) { // fn#74482, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9730:794, offset: 0x01d8ee2b, size: 498 bytes, params: 6, frame: 24
var value2;
var binding;
var binding2;
var value3;
var pushLazy;
var value5;
var object2;
var value6;
var binding3;
var value8;
var openLazy;
var value10;
if (openAs === 'action-sheet') {
value6 = environment.__proto__.__proto__.__proto__;
binding = env3_1;
binding3 = env3_2;
binding(binding3[9])(env3_5.isOpen(),
'An action sheet must be open to open the media modal as an action sheet');
value8 = binding(binding3[10]);
openLazy = value8.openLazy;
binding = env3_0;
value10 = binding(binding3[6])(binding3[11], binding3.paths);
binding = env3_6;
object2 = {};
copyDataProperties(object2, env0_6, undefined);
object2['initialIndex'] = initialIndex;
object2['originLayout'] = {x: a0, y: a1, width: a2, height: a3, resizeMode: a4};
object2['onCloseCallback'] = onClose;
object2['disableHapticOnOpen'] = true;
Reflect.apply(openLazy, value8, [value10, binding, object2, 'stack']);
} else {
value2 = environment.__proto__.__proto__.__proto__;
binding = env3_1;
binding2 = env3_2;
value3 = binding(binding2[12]);
pushLazy = value3.pushLazy;
binding = env3_0;
value5 = binding(binding2[6])(binding2[13], binding2.paths);
object2 = {};
copyDataProperties(object2, env0_6, undefined);
object2['initialIndex'] = initialIndex;
object2['originLayout'] = {x: a0, y: a1, width: a2, height: a3, resizeMode: a4};
object2['onCloseCallback'] = onClose;
binding = env3_6;
Reflect.apply(pushLazy, value3, [value5, object2, binding, {animation: 'none'}]);
}
const setMediaViewerSourcesBinding = setMediaViewerSources;
const initialSourcesBinding = initialSources;
setMediaViewerSourcesBinding({sources: initialSourcesBinding, initialIndex: initialIndex});
MediaViewerAnalytics.markSessionStarted({channelId: channelId, numMediaItems: initialSourcesBinding.length,
source: analyticsSource});
initVideoStateStore();
}
function _fun74481(a0) { // fn#74481, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9730:631, offset: 0x01d8eda0, size: 139 bytes, params: 2, frame: 20
var r0;
var object2;
var binding;
var binding2;
var getWindowDimensions;
var value;
if (env0_0 != null) {
r0 = env0_0;
} else {
object2 = {'x': 0, 'y': 0};
value = environment.__proto__.__proto__.__proto__.__proto__;
binding = env4_0;
binding2 = env4_2;
value = binding(binding2[4]);
getWindowDimensions = value.getWindowDimensions;
object2.width = Reflect.apply(getWindowDimensions, value, []).width;
value = binding(binding2[4]);
getWindowDimensions = value.getWindowDimensions;
object2.height = Reflect.apply(getWindowDimensions, value, []).height;
r0 = object2;
}
a0(r0.x, r0.y, r0.width, r0.height, r0.resizeMode);
}
global.__d(_fun74476, 9544, [57, 5, 3849, 661, 1478, 9545, 1962, 9547, 9551, 44, 4080, 9557, 5080, 9558,
2]) /* metro module 9544, dependencies: [57, 5, 3849, 661, 1478, 9545, 1962, 9547, 9551, 44, 4080, 9557, 5080, 9558, 2] */;
@@ -1,171 +1,263 @@
/* Metro module 9801; source: modules/media_viewer/native/components/overlay/MediaModalOverlay.tsx; dependencies: [57, 31, 27, 33, 4501, 697, 6618, 8792, 1244, 9802, 9803, 9804, 9805, 9806, 9552, 477, 4564, 9807, 9562, 9809, 4017, 9823, 9551, 9827, 9808, 9545, 9546, 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 ReanimatedRexport from '../../../../reanimated/ReanimatedRexport.tsx'; /* Metro dependency 4017 */
import UseVideoControls from '../../useVideoControls.tsx'; /* Metro dependency 9551 */
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 CreateStylesModule from '../../../../../design/components/Styles/native/createStyles.tsx'; /* Metro dependency 4501 */
import * as SafeAreaViewModule from '../../../../../components_native/common/SafeAreaView.tsx'; /* Metro dependency 6618 */
import * as MediaSourceUtilModule from '../../MediaSourceUtil.tsx'; /* Metro dependency 9546 */
import * as UseVideoControlsModule from '../../useVideoControls.tsx'; /* Metro dependency 9551 */
import * as MediaViewerDimensionsContextModule from '../../MediaViewerDimensionsContext.tsx'; /* Metro dependency 9562 */
import * as UseOverlayLayoutDriverModule from '../../useOverlayLayoutDriver.tsx'; /* Metro dependency 9806 */
import * as UseMediaItemSpoilerStateModule from '../../useMediaItemSpoilerState.tsx'; /* Metro dependency 9808 */
import * as MediaModalOverlayHeaderModule from './MediaModalOverlayHeader.tsx'; /* Metro dependency 9809 */
function _fun76794(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#76794, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9987:6, offset: 0x01de500b, size: 412 bytes, params: 8, frame: 23
var object3;
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_3 = importDefault(57) /* metro dependency 57 */;
const value = importAll(31) /* metro dependency 31 */;
const value2 = require(27) /* metro dependency 27 */;
const StyleSheet = value2.StyleSheet;
const env0_6 = value2.View;
const value3 = require(33) /* metro dependency 33 */;
const env0_7 = value3.jsx;
const env0_8 = value3.jsxs;
const env0_9 = value3.Fragment;
const createStylesModule = require(4501) /* metro dependency 4501: createStyles */;
const createStyles = createStylesModule.createStyles;
object3 = {};
const object4 = {};
copyDataProperties(object4, StyleSheet.absoluteFillObject, undefined);
object4['top'] = undefined;
object4['backgroundColor'] = 'transparent';
object3.portraitFooterButtons = object4;
const PX_4 = (importDefault(697) /* metro dependency 697: native */).space.PX_4;
object3.overlayIcons = {'position': 'absolute', 'top': -40, 'right': 8, 'display': 'flex', 'flexDirection': 'row',
const StyleSheet = ReactNativeModule.StyleSheet;
const createStyles = CreateStylesModule.createStyles;
object = {};
const object2 = {};
copyDataProperties(object2, StyleSheet.absoluteFillObject, undefined);
object2['top'] = undefined;
object2['backgroundColor'] = 'transparent';
object.portraitFooterButtons = object2;
const PX_4 = (Native).space.PX_4;
object.overlayIcons = {'position': 'absolute', 'top': -40, 'right': 8, 'display': 'flex', 'flexDirection': 'row',
gap: PX_4};
object3.overlayButtonIcon = {'width': 20, 'height': 20};
object3.overlayButton = {'width': 32, 'height': 32, 'backgroundColor': 'rgba(0, 0, 0, 0.7)', 'borderRadius': 16};
const env0_10 = Reflect.apply(createStyles, createStylesModule, [object3]);
const env0_11 = value.memo(_fun76800);
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/media_viewer/native/components/overlay/MediaModalOverlay.tsx');
object.overlayButtonIcon = {'width': 20, 'height': 20};
object.overlayButton = {'width': 32, 'height': 32, 'backgroundColor': 'rgba(0, 0, 0, 0.7)', 'borderRadius': 16};
const env0_10 = Reflect.apply(createStyles, CreateStylesModule, [object]);
const env0_11 = ReactModule.memo(_fun76800);
(FileImportTrackerModule).fileFinishedImporting('modules/media_viewer/native/components/overlay/MediaModalOverlay.tsx');
exports.default = MediaModalOverlayGuard;
}
function OverlayMuteButton({isMuted, onToggleMute}) { // fn#76795, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9987:541, offset: 0x01de51a7, size: 263 bytes, params: 2, frame: 26
const styles = useStyles();
const SafeAreaPaddingView = require(dependencyMap[6]).SafeAreaPaddingView;
const defaultImport = importDefault(dependencyMap[7]);
const object = {accessibilityRole: 'button'};
const intl = require(dependencyMap[8]).intl;
object.accessibilityLabel = intl.string(require(dependencyMap[8]).t.w4m945);
object.source = importDefault(isMuted ? dependencyMap[9] : dependencyMap[10]);
const WHITE = importDefault(dependencyMap[5]).unsafe_rawColors.WHITE;
object.color = WHITE;
object.onPress = onToggleMute;
object.style = styles.overlayButton;
object.iconStyle = styles.overlayButtonIcon;
return (
<SafeAreaPaddingView left right>
{((Component) => <Component {...object} />)(defaultImport)}
</SafeAreaPaddingView>
);
}
function OverlayObscureToggleButton({spoilerActive, onToggleObscure}) { // fn#76796, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9987:891, offset: 0x01de52ae, size: 265 bytes, params: 2, frame: 26
const styles = useStyles();
const SafeAreaPaddingView = require(dependencyMap[6]).SafeAreaPaddingView;
const defaultImport = importDefault(dependencyMap[7]);
const object = {accessibilityRole: 'button'};
const intl = require(dependencyMap[8]).intl;
const string = intl.string;
const UIsxUw = require(dependencyMap[8]).t.UIsxUw;
object.accessibilityLabel = Reflect.apply(string, intl, [UIsxUw]);
object.source = importDefault(spoilerActive ? dependencyMap[11] : dependencyMap[12]);
const WHITE = importDefault(dependencyMap[5]).unsafe_rawColors.WHITE;
object.color = WHITE;
object.onPress = onToggleObscure;
object.style = styles.overlayButton;
object.iconStyle = styles.overlayButtonIcon;
return (
<SafeAreaPaddingView left right>
{((Component) => <Component {...object} />)(defaultImport)}
</SafeAreaPaddingView>
);
}
function MediaModalOverlay(a0) { // fn#76797, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9987:2639, offset: 0x01de53b7, size: 266 bytes, params: 2, frame: 22
const getVideoControls = a0.getVideoControls;
const source = a0.source;
const index = a0.index;
const videoControls = getVideoControls(index, source);
const value3 = (importDefault(9551) /* metro dependency 9551: useVideoControls */)(index, source, videoControls);
const property = env0_3((require(9808) /* metro dependency 9808: useMediaItemSpoilerState */).useMediaItemSpoilerState(index),
1)[0];
let binding = env0_4;
const value6 = binding.useCallback(_fun76798, [index]);
env0_4.useEffect(_fun76799, [videoControls]);
binding = env0_11;
const obscure = source.obscure;
return ((Component) => <Component {...a0} {...{['slider']: value3}} {...{['source']: source}} {...{['obscure']: obscure != null && obscure}} {...{['spoilerActive']: property}} {...{['toggleObscure']: value6}} />)(binding);
}
function _fun76800({slider, onClose, overlayEnabled, syncer, disableDownload, disableMediaOverlayButton, shareable, contextName, contextIcon, source, obscure, spoilerActive, toggleObscure}) { // fn#76800, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9987:1274, offset: 0x01de551b, size: 978 bytes, params: 2, frame: 41
var r5;
var r8;
const SafeAreaPaddingView = (require(6618) /* metro dependency 6618: SafeAreaView */).SafeAreaPaddingView;
var items2;
const styles = useStyles();
const value2 = (require(9806) /* metro dependency 9806: useOverlayLayoutDriver */).useOverlayLayoutDriver();
const value3 = (require(9806) /* metro dependency 9806: useOverlayLayoutDriver */).useFooterLayoutAnimation(value2);
const [property, property2] = env0_3(env0_4.useState(false), 2);
const value6 = (require(9552) /* metro dependency 9552: MediaPlayerMuteManager */).useMediaPlayerMutedStore(function(a0) {
return a0.isMuted;
});
if (slider != null) {
r5 = (require(477) /* metro dependency 477: PlatformUtils */).isIOS() && ((Component) => <Component blurTheme="dark" style={StyleSheet.absoluteFill} />)(importDefault(4564) /* metro dependency 4564: VisualEffectView */);
items2 = [r5, slider];
r5 = syncer.sources.length > 1 ? ((Component) => <Component syncer={syncer} />)(importDefault(9807) /* metro dependency 9807: MediaViewerThumbnails */) : null;
items2[2] = r5;
r8 = <SafeAreaPaddingView bottom left right style={{paddingTop: 8}}>{items2}</SafeAreaPaddingView>;
} else if (syncer.sources.length > 1) {
r5 = (require(477) /* metro dependency 477: PlatformUtils */).isIOS() && ((Component) => <Component blurTheme="dark" style={StyleSheet.absoluteFill} />)(importDefault(4564) /* metro dependency 4564: VisualEffectView */);
items2 = [r5, slider];
r5 = syncer.sources.length > 1 ? ((Component) => <Component syncer={syncer} />)(importDefault(9807) /* metro dependency 9807: MediaViewerThumbnails */) : null;
items2[2] = r5;
r8 = <SafeAreaPaddingView bottom left right style={{paddingTop: 8}}>{items2}</SafeAreaPaddingView>;
} else {
r8 = null;
function OverlayMuteButton({isMuted, onToggleMute}) { // fn#76795, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9987:541, offset: 0x01de51a7, size: 263 bytes, params: 2, frame: 26
const styles = useStyles();
const SafeAreaPaddingView = require(dependencyMap[6]).SafeAreaPaddingView;
const defaultImport = importDefault(dependencyMap[7]);
const object2 = {accessibilityRole: 'button'};
const intl = require(dependencyMap[8]).intl;
object2.accessibilityLabel = intl.string(require(dependencyMap[8]).t.w4m945);
object2.source = importDefault(isMuted ? dependencyMap[9] : dependencyMap[10]);
const WHITE = importDefault(dependencyMap[5]).unsafe_rawColors.WHITE;
object2.color = WHITE;
object2.onPress = onToggleMute;
object2.style = styles.overlayButton;
object2.iconStyle = styles.overlayButtonIcon;
return (
<SafeAreaPaddingView left right>
{((Component) => <Component {...object2} />)(defaultImport)}
</SafeAreaPaddingView>
);
}
const mediaViewerDimensionsContextModule = require(9562) /* metro dependency 9562: MediaViewerDimensionsContext */;
const useMediaViewerDimensions = mediaViewerDimensionsContextModule.useMediaViewerDimensions;
const height = Reflect.apply(useMediaViewerDimensions, mediaViewerDimensionsContextModule, []).height;
const jsxRuntimeEnv0_9Binding = jsxRuntimeEnv0_9;
const MediaModalOverlayHeader = (require(9809) /* metro dependency 9809: MediaModalOverlayHeader */).MediaModalOverlayHeader;
const mediaModalOverlayHeader = <MediaModalOverlayHeader animationDriver={value2} disableDownload={disableDownload} disableMediaOverlayButton={disableMediaOverlayButton} source={source} shareable={shareable} contextName={contextName} contextIcon={contextIcon} onClose={onClose} channelId={source.channelId} />;
const View2 = (importDefault(4017) /* metro dependency 4017: ReanimatedRexport */).View;
const items3 = [styles.portraitFooterButtons, value3];
const items4 = [!property && ((Component) => <Component description={source.description} />)(importDefault(9823) /* metro dependency 9823: MediaModalOverlayAltText */)];
items4[1] = slider != null || obscure ? <View style={styles.overlayIcons}>{slider != null && <OverlayMuteButton isMuted={value6} onToggleMute={(require(9551) /* metro dependency 9551: useVideoControls */).toggleMuted} />}{obscure ? <OverlayObscureToggleButton spoilerActive={spoilerActive} onToggleObscure={toggleObscure} /> : null}</View> : null;
if (!(height < 600)) {
const MediaModalOverlayFooter = (require(9827) /* metro dependency 9827: MediaModalOverlayFooter */).MediaModalOverlayFooter;
r8 = <MediaModalOverlayFooter sliderElement={slider} syncer={syncer} guildId={source.guildId} channelId={source.channelId} messageId={source.messageId} onClose={onClose} onFullViewToggled={property2} overlayEnabled={overlayEnabled} />;
} else {
r8 = r8;
function OverlayObscureToggleButton({spoilerActive, onToggleObscure}) { // fn#76796, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9987:891, offset: 0x01de52ae, size: 265 bytes, params: 2, frame: 26
const styles = useStyles();
const SafeAreaPaddingView = require(dependencyMap[6]).SafeAreaPaddingView;
const defaultImport = importDefault(dependencyMap[7]);
const object2 = {accessibilityRole: 'button'};
const intl = require(dependencyMap[8]).intl;
const string = intl.string;
const UIsxUw = require(dependencyMap[8]).t.UIsxUw;
object2.accessibilityLabel = Reflect.apply(string, intl, [UIsxUw]);
object2.source = importDefault(spoilerActive ? dependencyMap[11] : dependencyMap[12]);
const WHITE = importDefault(dependencyMap[5]).unsafe_rawColors.WHITE;
object2.color = WHITE;
object2.onPress = onToggleObscure;
object2.style = styles.overlayButton;
object2.iconStyle = styles.overlayButtonIcon;
return (
<SafeAreaPaddingView left right>
{((Component) => <Component {...object2} />)(defaultImport)}
</SafeAreaPaddingView>
);
}
items4[2] = r8;
return (
<>
{mediaModalOverlayHeader}
<View2 style={items3}>
{items4}
</View2>
</>
);
}
function MediaModalOverlayGuard(a0) { // fn#76802, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9987:3120, offset: 0x01de58ed, size: 196 bytes, params: 2, frame: 22
const onIndexChange = a0.onIndexChange;
const value = null;
const value2 = Object.create(value);
value2.onIndexChange = 0;
const value3 = copyDataProperties({}, a0, value2, undefined);
const value6 = env0_3((require(9546) /* metro dependency 9546: MediaSourceUtil */).useSelectedMediaSource(value3.syncer),
2);
const property = value6[0];
const property2 = value6[1];
env0_4.useEffect(_fun76803, [property, onIndexChange]);
return value == property2 ? value : <MediaModalOverlay {...value3} {...{['source']: property2}} {...{['index']: property}} />;
}
function MediaModalOverlay(a0) { // fn#76797, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9987:2639, offset: 0x01de53b7, size: 266 bytes, params: 2, frame: 22
const getVideoControls = a0.getVideoControls;
const source = a0.source;
const index = a0.index;
const videoControls = getVideoControls(index, source);
const value3 = (UseVideoControls)(index, source, videoControls);
const property = Module00057((UseMediaItemSpoilerStateModule).useMediaItemSpoilerState(index),
1)[0];
let binding = env0_4;
const value6 = binding.useCallback(_fun76798, [index]);
env0_4.useEffect(_fun76799, [videoControls]);
binding = env0_11;
const obscure = source.obscure;
return ((Component) => <Component {...a0} {...{['slider']: value3}} {...{['source']: source}} {...{['obscure']: obscure != null && obscure}} {...{['spoilerActive']: property}} {...{['toggleObscure']: value6}} />)(binding);
function _fun76798() { // fn#76798, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9987:2812, offset: 0x01de54c1, size: 45 bytes, params: 1, frame: 11
let value = environment.__proto__;
value = require(9545) /* metro dependency 9545: useMediaViewerSources */;
return value.toggleSpoiler(index);
}
function _fun76798() { // fn#76798, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9987:2812, offset: 0x01de54c1, size: 45 bytes, params: 1, frame: 11
let value = environment.__proto__;
value = require(9545) /* metro dependency 9545: useMediaViewerSources */;
return value.toggleSpoiler(index);
}
function _fun76799() { // fn#76799, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9987:2868, offset: 0x01de54ee, size: 45 bytes, params: 1, frame: 12
const value = environment.__proto__;
(UseVideoControlsModule).setVideoStateControls(env0_1);
}
}
function _fun76800({slider, onClose, overlayEnabled, syncer, disableDownload, disableMediaOverlayButton, shareable, contextName, contextIcon, source, obscure, spoilerActive, toggleObscure}) { // fn#76800, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9987:1274, offset: 0x01de551b, size: 978 bytes, params: 2, frame: 41
var r5;
var r8;
const SafeAreaPaddingView = (SafeAreaViewModule).SafeAreaPaddingView;
var items2;
const styles = useStyles();
const value2 = (UseOverlayLayoutDriverModule).useOverlayLayoutDriver();
const value3 = (UseOverlayLayoutDriverModule).useFooterLayoutAnimation(value2);
const [property, property2] = Module00057(env0_4.useState(false), 2);
const value6 = (require(9552) /* metro dependency 9552: MediaPlayerMuteManager */).useMediaPlayerMutedStore(function(a0) {
return a0.isMuted;
});
if (slider != null) {
r5 = (require(477) /* metro dependency 477: PlatformUtils */).isIOS() && ((Component) => <Component blurTheme="dark" style={StyleSheet.absoluteFill} />)(importDefault(4564) /* metro dependency 4564: VisualEffectView */);
items2 = [r5, slider];
r5 = (
syncer.sources.length > 1
? ((Component) => <Component syncer={syncer} />)(importDefault(9807) /* metro dependency 9807: MediaViewerThumbnails */)
: null
);
items2[2] = r5;
r8 = (
<SafeAreaPaddingView
bottom
left
right
style={{paddingTop: 8}}
>
{items2}
</SafeAreaPaddingView>
);
} else if (syncer.sources.length > 1) {
r5 = (require(477) /* metro dependency 477: PlatformUtils */).isIOS() && ((Component) => <Component blurTheme="dark" style={StyleSheet.absoluteFill} />)(importDefault(4564) /* metro dependency 4564: VisualEffectView */);
items2 = [r5, slider];
r5 = (
syncer.sources.length > 1
? ((Component) => <Component syncer={syncer} />)(importDefault(9807) /* metro dependency 9807: MediaViewerThumbnails */)
: null
);
items2[2] = r5;
r8 = (
<SafeAreaPaddingView
bottom
left
right
style={{paddingTop: 8}}
>
{items2}
</SafeAreaPaddingView>
);
} else {
r8 = null;
}
const useMediaViewerDimensions = MediaViewerDimensionsContextModule.useMediaViewerDimensions;
const height = Reflect.apply(useMediaViewerDimensions, MediaViewerDimensionsContextModule, []).height;
const jsxRuntimeEnv0_9Binding = jsxRuntimeEnv0_9;
const MediaModalOverlayHeader = (MediaModalOverlayHeaderModule).MediaModalOverlayHeader;
const mediaModalOverlayHeader = (
<MediaModalOverlayHeader
animationDriver={value2}
disableDownload={disableDownload}
disableMediaOverlayButton={disableMediaOverlayButton}
source={source}
shareable={shareable}
contextName={contextName}
contextIcon={contextIcon}
onClose={onClose}
channelId={source.channelId}
/>
);
const View2 = (ReanimatedRexport).View;
const items3 = [styles.portraitFooterButtons, value3];
const items4 = [
!property && ((Component) => <Component description={source.description} />)(importDefault(9823) /* metro dependency 9823: MediaModalOverlayAltText */),
];
items4[1] = (
slider != null || obscure
? (
<View style={styles.overlayIcons}>
{slider != null && <OverlayMuteButton isMuted={value6} onToggleMute={(require(9551) /* metro dependency 9551: useVideoControls */).toggleMuted} />}
{
obscure
? (
<OverlayObscureToggleButton spoilerActive={spoilerActive} onToggleObscure={toggleObscure} />
)
: null
}
</View>
)
: null
);
if (!(height < 600)) {
const MediaModalOverlayFooter = (require(9827) /* metro dependency 9827: MediaModalOverlayFooter */).MediaModalOverlayFooter;
r8 = (
<MediaModalOverlayFooter
sliderElement={slider}
syncer={syncer}
guildId={source.guildId}
channelId={source.channelId}
messageId={source.messageId}
onClose={onClose}
onFullViewToggled={property2}
overlayEnabled={overlayEnabled}
/>
);
} else {
r8 = r8;
}
items4[2] = r8;
return (
<>
{mediaModalOverlayHeader}
<View2 style={items3}>
{items4}
</View2>
</>
);
}
function MediaModalOverlayGuard(a0) { // fn#76802, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9987:3120, offset: 0x01de58ed, size: 196 bytes, params: 2, frame: 22
const onIndexChange = a0.onIndexChange;
const value = null;
const value2 = Object.create(value);
value2.onIndexChange = 0;
const value3 = copyDataProperties({}, a0, value2, undefined);
const value6 = Module00057((MediaSourceUtilModule).useSelectedMediaSource(value3.syncer),
2);
const property = value6[0];
const property2 = value6[1];
env0_4.useEffect(_fun76803, [property, onIndexChange]);
return (
value == property2
? value
: (
<MediaModalOverlay
{...value3}
{...{['source']: property2}}
{...{['index']: property}}
/>
)
);
function _fun76803() { // fn#76803, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9987:3271, offset: 0x01d099f3, size: 32 bytes, params: 1, frame: 11
if (onIndexChange != null) {
onIndexChange(env0_1);
}
}
}
function _fun76799() { // fn#76799, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9987:2868, offset: 0x01de54ee, size: 45 bytes, params: 1, frame: 12
const value = environment.__proto__;
(require(9551) /* metro dependency 9551: useVideoControls */).setVideoStateControls(env0_1);
}
global.__d(_fun76794, 9801, [57, 31, 27, 33, 4501, 697, 6618, 8792, 1244, 9802, 9803, 9804, 9805, 9806, 9552, 477,
4564, 9807, 9562, 9809, 4017, 9823, 9551, 9827, 9808, 9545, 9546,
2]) /* metro module 9801, dependencies: [57, 31, 27, 33, 4501, 697, 6618, 8792, 1244, 9802, 9803, 9804, 9805, 9806, 9552, 477, 4564, 9807, 9562, 9809, 4017, 9823, 9551, 9827, 9808, 9545, 9546, 2] */;
@@ -1,64 +1,78 @@
/* Metro module 9823; source: modules/media_viewer/native/components/overlay/MediaModalOverlayAltText.tsx; dependencies: [31, 33, 4501, 697, 1585, 3829, 5278, 9824, 4573, 1244, 2] */
import UseSafeAreaInsetsNative from '../../../../safe_area/useSafeAreaInsets.native.tsx'; /* Metro dependency 1585 */
import * as FileImportTrackerModule from '../../../../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
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 UserSettingsModule from '../../../../user_settings/UserSettings.tsx'; /* Metro dependency 3829 */
import * as CreateStylesModule from '../../../../../design/components/Styles/native/createStyles.tsx'; /* Metro dependency 4501 */
function _fun76921(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#76921, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10009:6, offset: 0x01de96c0, size: 181 bytes, params: 8, frame: 19
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
let value = importAll(31) /* metro dependency 31 */;
const env0_3 = (require(33) /* metro dependency 33 */).jsx;
const env0_4 = (require(4501) /* metro dependency 4501: createStyles */).createStyles(_fun76922);
let value = ReactModule;
const env0_4 = (CreateStylesModule).createStyles(_fun76922);
value = value.memo(MediaModalOverlayAltTextButton);
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/media_viewer/native/components/overlay/MediaModalOverlayAltText.tsx');
(FileImportTrackerModule).fileFinishedImporting('modules/media_viewer/native/components/overlay/MediaModalOverlayAltText.tsx');
exports.default = value;
}
function _fun76922(a0) { // fn#76922, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10009:144, offset: 0x01de9775, size: 212 bytes, params: 2, frame: 16
const object2 = {};
const CONTROL_OVERLAY_SECONDARY_BACKGROUND_ACTIVE = (importDefault(697) /* metro dependency 697: native */).colors.CONTROL_OVERLAY_SECONDARY_BACKGROUND_ACTIVE;
object2.backgroundColor = CONTROL_OVERLAY_SECONDARY_BACKGROUND_ACTIVE;
let PX_8 = (importDefault(697) /* metro dependency 697: native */).space.PX_8;
object2.marginVertical = PX_8;
PX_8 = (importDefault(697) /* metro dependency 697: native */).space.PX_8;
object2.marginHorizontal = PX_8;
PX_8 = (importDefault(697) /* metro dependency 697: native */).space.PX_8;
object2.marginRight = PX_8 + a0;
PX_8 = (importDefault(697) /* metro dependency 697: native */).space.PX_8;
object2.paddingHorizontal = PX_8;
const PX_4 = (importDefault(697) /* metro dependency 697: native */).space.PX_4;
object2.paddingVertical = PX_4;
object2.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.sm;
object2.alignSelf = 'flex-end';
return {container: object2};
}
function _fun76922(a0) { // fn#76922, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10009:144, offset: 0x01de9775, size: 212 bytes, params: 2, frame: 16
const object = {};
const CONTROL_OVERLAY_SECONDARY_BACKGROUND_ACTIVE = (importDefault(697) /* metro dependency 697: native */).colors.CONTROL_OVERLAY_SECONDARY_BACKGROUND_ACTIVE;
object.backgroundColor = CONTROL_OVERLAY_SECONDARY_BACKGROUND_ACTIVE;
let PX_8 = (importDefault(697) /* metro dependency 697: native */).space.PX_8;
object.marginVertical = PX_8;
PX_8 = (importDefault(697) /* metro dependency 697: native */).space.PX_8;
object.marginHorizontal = PX_8;
PX_8 = (importDefault(697) /* metro dependency 697: native */).space.PX_8;
object.marginRight = PX_8 + a0;
PX_8 = (importDefault(697) /* metro dependency 697: native */).space.PX_8;
object.paddingHorizontal = PX_8;
const PX_4 = (importDefault(697) /* metro dependency 697: native */).space.PX_4;
object.paddingVertical = PX_4;
object.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.sm;
object.alignSelf = 'flex-end';
return {container: object};
}
function MediaModalOverlayAltTextButton({description}) { // fn#76923, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10009:480, offset: 0x01de9849, size: 310 bytes, params: 2, frame: 21
var r0;
var PressableOpacity;
var Text;
var intl;
const styles = useStyles((importDefault(1585) /* metro dependency 1585: useSafeAreaInsetsNative */)().right);
const r2 = description ?? '';
const ViewImageDescriptions = (require(3829) /* metro dependency 3829: UserSettings */).ViewImageDescriptions;
const useSetting = ViewImageDescriptions.useSetting;
if (Reflect.apply(useSetting, ViewImageDescriptions, [])) {
if (r2.length === 0) {
function MediaModalOverlayAltTextButton({description}) { // fn#76923, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10009:480, offset: 0x01de9849, size: 310 bytes, params: 2, frame: 21
var r0;
var PressableOpacity;
var Text;
var intl;
const styles = useStyles((UseSafeAreaInsetsNative)().right);
const r2 = description ?? '';
const ViewImageDescriptions = (UserSettingsModule).ViewImageDescriptions;
const useSetting = ViewImageDescriptions.useSetting;
if (Reflect.apply(useSetting, ViewImageDescriptions, [])) {
if (r2.length === 0) {
r0 = null;
} else {
PressableOpacity = (require(5278) /* metro dependency 5278: Pressables */).PressableOpacity;
var pressableOpacityProps = {style: styles.container, onPress: onPress_76924, hitSlop: {'top': 6,
'bottom': 6,
'left': 6, 'right': 6}};
Text = (require(4573) /* metro dependency 4573: Text */).Text;
intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
r0 = (
<PressableOpacity {...pressableOpacityProps}>
<Text variant="text-xs/semibold" color="white">
{intl.string((require(1244) /* metro dependency 1244: indexNative */).t.Q5VqrN)}
</Text>
</PressableOpacity>
);
}
} else {
r0 = null;
} else {
PressableOpacity = (require(5278) /* metro dependency 5278: Pressables */).PressableOpacity;
var pressableOpacityProps = {style: styles.container, onPress: onPress_76924, hitSlop: {'top': 6,
'bottom': 6,
'left': 6, 'right': 6}};
Text = (require(4573) /* metro dependency 4573: Text */).Text;
intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
r0 = <PressableOpacity {...pressableOpacityProps}><Text variant="text-xs/semibold" color="white">{intl.string((require(1244) /* metro dependency 1244: indexNative */).t.Q5VqrN)}</Text></PressableOpacity>;
}
return r0;
function MediaModalOverlayAltTextButtonOnPress() { // fn#76924, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10009:699, owner: MediaModalOverlayAltTextButton.onPress, offset: 0x01de997f, size: 62 bytes, params: 1, frame: 14
const value = environment.__proto__;
(importDefault(9824) /* metro dependency 9824: openMediaModalOverlayAltTextSheet */)({description: env0_0 ?? ''});
}
} else {
r0 = null;
}
return r0;
}
function MediaModalOverlayAltTextButtonOnPress() { // fn#76924, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10009:699, owner: MediaModalOverlayAltTextButton.onPress, offset: 0x01de997f, size: 62 bytes, params: 1, frame: 14
const value = environment.__proto__;
(importDefault(9824) /* metro dependency 9824: openMediaModalOverlayAltTextSheet */)({description: env0_0 ?? ''});
}
global.__d(_fun76921, 9823, [31, 33, 4501, 697, 1585, 3829, 5278, 9824, 4573, 1244,
2]) /* metro module 9823, dependencies: [31, 33, 4501, 697, 1585, 3829, 5278, 9824, 4573, 1244, 2] */;
@@ -1,36 +1,46 @@
/* Metro module 9825; source: modules/media_viewer/native/components/overlay/MediaModalOverlayAltTextSheet.tsx; dependencies: [31, 33, 4501, 697, 9826, 8750, 6275, 6758, 1244, 4573, 2] */
import Native from '../../../../../external/discord_common/js/packages/tokens/native.tsx'; /* Metro dependency 697 */
import * as FileImportTrackerModule from '../../../../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
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 IndexNativeModule from '../../../../../intl/index.native.tsx'; /* Metro dependency 1244 */
import * as CreateStylesModule from '../../../../../design/components/Styles/native/createStyles.tsx'; /* Metro dependency 4501 */
import * as TextModule from '../../../../../design/components/Text/native/Text.tsx'; /* Metro dependency 4573 */
import * as BottomSheetNativeModule from '../../../../../design/components/Sheet/native/BottomSheet.native.tsx'; /* Metro dependency 6275 */
import * as BottomSheetTitleHeaderNativeModule from '../../../../../design/components/Sheet/native/BottomSheetTitleHeader.native.tsx'; /* Metro dependency 6758 */
function _fun76927(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#76927, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10011:6, offset: 0x01de9a81, size: 194 bytes, params: 8, frame: 21
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
importAll(31) /* metro dependency 31 */;
const env0_2 = (require(33) /* metro dependency 33 */).jsx;
const createStylesModule = require(4501) /* metro dependency 4501: createStyles */;
const createStyles = createStylesModule.createStyles;
const PX_16 = (importDefault(697) /* metro dependency 697: native */).space.PX_16;
const env0_3 = Reflect.apply(createStyles, createStylesModule, [{container: {padding: PX_16}}]);
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/media_viewer/native/components/overlay/MediaModalOverlayAltTextSheet.tsx');
ReactModule;
const createStyles = CreateStylesModule.createStyles;
const PX_16 = (Native).space.PX_16;
const env0_3 = Reflect.apply(createStyles, CreateStylesModule, [{container: {padding: PX_16}}]);
(FileImportTrackerModule).fileFinishedImporting('modules/media_viewer/native/components/overlay/MediaModalOverlayAltTextSheet.tsx');
exports.default = _default_76928;
function _default_76928({description}) { // fn#76928, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10011:193, offset: 0x01de9b43, size: 286 bytes, params: 2, frame: 23
const styles = useStyles();
const r9 = (require(8750) /* metro dependency 8750: useIsScreenLandscapeNative */).useIsScreenLandscape() ? 70 : (require(9826) /* metro dependency 9826: useMessagePreviewHeight */).useMessagePreviewCollapsedheight() + 20 + 50;
const BottomSheet = (BottomSheetNativeModule).BottomSheet;
const object = {};
const BottomSheetTitleHeader = (BottomSheetTitleHeaderNativeModule).BottomSheetTitleHeader;
const intl = (IndexNativeModule).intl;
const string = intl.string;
const J3IOO1 = (IndexNativeModule).t.J3IOO1;
object.header = <BottomSheetTitleHeader title={Reflect.apply(string, intl, [J3IOO1])} />;
object.contentStyles = [styles.container, {minHeight: r9}];
const Text = (TextModule).Text;
return (
<BottomSheet {...object}>
<Text accessibilityRole="text" variant="text-md/normal">
{description}
</Text>
</BottomSheet>
);
}
}
function _default_76928({description}) { // fn#76928, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10011:193, offset: 0x01de9b43, size: 286 bytes, params: 2, frame: 23
const styles = useStyles();
const r9 = (require(8750) /* metro dependency 8750: useIsScreenLandscapeNative */).useIsScreenLandscape() ? 70 : (require(9826) /* metro dependency 9826: useMessagePreviewHeight */).useMessagePreviewCollapsedheight() + 20 + 50;
const BottomSheet = (require(6275) /* metro dependency 6275: BottomSheetNative */).BottomSheet;
const object2 = {};
const BottomSheetTitleHeader = (require(6758) /* metro dependency 6758: BottomSheetTitleHeaderNative */).BottomSheetTitleHeader;
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
const string = intl.string;
const J3IOO1 = (require(1244) /* metro dependency 1244: indexNative */).t.J3IOO1;
object2.header = <BottomSheetTitleHeader title={Reflect.apply(string, intl, [J3IOO1])} />;
object2.contentStyles = [styles.container, {minHeight: r9}];
const Text = (require(4573) /* metro dependency 4573: Text */).Text;
return (
<BottomSheet {...object2}>
<Text accessibilityRole="text" variant="text-md/normal">
{description}
</Text>
</BottomSheet>
);
}
global.__d(_fun76927, 9825, [31, 33, 4501, 697, 9826, 8750, 6275, 6758, 1244, 4573,
2]) /* metro module 9825, dependencies: [31, 33, 4501, 697, 9826, 8750, 6275, 6758, 1244, 4573, 2] */;
File diff suppressed because it is too large. Load diff
@@ -1,10 +1,23 @@
/* Metro module 9809; source: modules/media_viewer/native/components/overlay/MediaModalOverlayHeader.tsx; dependencies: [31, 27, 33, 4501, 5314, 9806, 9568, 9810, 4017, 6618, 9811, 1244, 5312, 1305, 697, 4573, 9812, 8811, 477, 9821, 8638, 2] */
import ReanimatedRexport from '../../../../reanimated/ReanimatedRexport.tsx'; /* Metro dependency 4017 */
import UseShouldHideMediaOptions from '../../../../media_channel/useShouldHideMediaOptions.tsx'; /* Metro dependency 9810 */
import MediaViewerOverlayButton from './MediaViewerOverlayButton.tsx'; /* Metro dependency 9811 */
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 IndexNativeModule from '../../../../../intl/index.native.tsx'; /* Metro dependency 1244 */
import * as XSmallIconModule from '../../../../../design/components/Icon/native/redesign/generated/XSmallIcon.tsx'; /* Metro dependency 5312 */
import * as NavigatorConstantsNativeModule from '../../../../../design/components/Navigator/native/NavigatorConstants.native.tsx'; /* Metro dependency 5314 */
import * as SafeAreaViewModule from '../../../../../components_native/common/SafeAreaView.tsx'; /* Metro dependency 6618 */
import * as MediaShareActionsModule from '../MediaShareActions.tsx'; /* Metro dependency 9568 */
import * as UseOverlayLayoutDriverModule from '../../useOverlayLayoutDriver.tsx'; /* Metro dependency 9806 */
function _fun76833(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#76833, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9995:6, offset: 0x01de68fd, size: 356 bytes, params: 8, frame: 21
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
importAll(31) /* metro dependency 31 */;
let value = require(27) /* metro dependency 27 */;
ReactModule;
let value = ReactNativeModule;
const env0_3 = value.StyleSheet;
const env0_4 = value.View;
value = require(33) /* metro dependency 33 */;
@@ -12,7 +25,7 @@ function _fun76833(global, require, importDefault, importAll, module, exports, d
const env0_6 = value.jsxs;
value = require(4501) /* metro dependency 4501: createStyles */;
const createStyles = value.createStyles;
const NAV_BAR_HEIGHT = (require(5314) /* metro dependency 5314: NavigatorConstantsNative */).NAV_BAR_HEIGHT;
const NAV_BAR_HEIGHT = (NavigatorConstantsNativeModule).NAV_BAR_HEIGHT;
const env0_7 = Reflect.apply(createStyles, value, [{navbarInner: {'flex': 1, 'alignItems': 'center',
'flexDirection': 'row', 'height': null, 'paddingHorizontal': 6, 'justifyContent': 'space-between',
height: NAV_BAR_HEIGHT}, navbarLeft: {'flexShrink': 1, 'flexDirection': 'row', 'marginRight': 8},
@@ -21,89 +34,106 @@ function _fun76833(global, require, importDefault, importAll, module, exports, d
navbarNameInner: {'borderRadius': 20, 'justifyContent': 'center', 'alignItems': 'center',
'backgroundColor': 'rgba(0, 0, 0, 0.7)', 'flex': 1, 'flexDirection': 'row', 'paddingHorizontal': 18},
navbarNameShrinkWrapper: {flexShrink: 1}, contextIcon: {'width': 18, 'height': 18, 'marginRight': 6}}]);
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/media_viewer/native/components/overlay/MediaModalOverlayHeader.tsx');
(FileImportTrackerModule).fileFinishedImporting('modules/media_viewer/native/components/overlay/MediaModalOverlayHeader.tsx');
exports.MediaModalOverlayHeader = MediaModalOverlayHeader;
}
function MediaModalOverlayHeader({onClose, source, disableDownload, disableMediaOverlayButton, shareable, contextName, contextIcon, animationDriver, channelId}) { // fn#76834, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9995:925, offset: 0x01de6a61, size: 910 bytes, params: 2, frame: 43
var r25;
var r12;
var value8;
var Icon;
const styles = useStyles();
const value2 = (require(9806) /* metro dependency 9806: useOverlayLayoutDriver */).useHeaderLayoutAnimation(animationDriver);
const value3 = (require(9568) /* metro dependency 9568: MediaShareActions */).useMediaShareActions({source: source,
disableDownload: disableDownload, shareable: shareable});
const value4 = (importDefault(9810) /* metro dependency 9810: useShouldHideMediaOptions */)(channelId);
const View2 = (importDefault(4017) /* metro dependency 4017: ReanimatedRexport */).View;
const object = {};
copyDataProperties(object, StyleSheet.absoluteFillObject, undefined);
object['bottom'] = undefined;
const items2 = [object, value2];
const SafeAreaPaddingView = (require(6618) /* metro dependency 6618: SafeAreaView */).SafeAreaPaddingView;
const MediaViewerOverlayButton = importDefault(9811) /* metro dependency 9811: MediaViewerOverlayButton */;
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
const string = intl.string;
const cpT0Cq = (require(1244) /* metro dependency 1244: indexNative */).t.cpT0Cq;
const XSmallIcon = (require(5312) /* metro dependency 5312: XSmallIcon */).XSmallIcon;
const mediaViewerOverlayButton = <MediaViewerOverlayButton accessibilityLabel={Reflect.apply(string, intl,
[cpT0Cq])} icon={<XSmallIcon size="md" color="interactive-text-active" />} onPress={onClose} />;
const value7 = contextName != null;
if (value7) {
var viewBinding2Props = {style: styles.navbarName};
var viewBinding2Props2 = {style: styles.navbarNameInner};
value8 = contextIcon != null;
if (value8) {
Icon = (require(1305) /* metro dependency 1305: native */).Icon;
var iconProps = {source: contextIcon,
color: (importDefault(697) /* metro dependency 697: native */).unsafe_rawColors.PRIMARY_345,
size: (require(1305) /* metro dependency 1305: native */).Icon.Sizes.CUSTOM};
contextIcon = styles.contextIcon;
iconProps.style = contextIcon;
r25 = <Icon {...iconProps} />;
} else {
r25 = value8;
}
r12 = <View {...viewBinding2Props}><View {...viewBinding2Props2}>{r25}<View style={styles.navbarNameShrinkWrapper}>{((Text) => <Text accessibilityRole="header" variant="heading-md/medium" lineClamp={1} ellipsizeMode="tail" color="always-white">{contextName}</Text>)((require(4573) /* metro dependency 4573: Text */).Text)}</View></View></View>;
} else {
r12 = value7;
}
return (
<View2 style={items2}>
<SafeAreaPaddingView
top
left
right
pointerEvents="box-none"
>
<View style={styles.navbarInner} pointerEvents="box-none">
<View style={styles.navbarLeft}>
{mediaViewerOverlayButton}
{r12}
function MediaModalOverlayHeader({onClose, source, disableDownload, disableMediaOverlayButton, shareable, contextName, contextIcon, animationDriver, channelId}) { // fn#76834, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9995:925, offset: 0x01de6a61, size: 910 bytes, params: 2, frame: 43
var r25;
var r12;
var value8;
var Icon;
const styles = useStyles();
const value2 = (UseOverlayLayoutDriverModule).useHeaderLayoutAnimation(animationDriver);
const value3 = (MediaShareActionsModule).useMediaShareActions({source: source,
disableDownload: disableDownload, shareable: shareable});
const value4 = (UseShouldHideMediaOptions)(channelId);
const View2 = (ReanimatedRexport).View;
const object2 = {};
copyDataProperties(object2, StyleSheet.absoluteFillObject, undefined);
object2['bottom'] = undefined;
const items2 = [object2, value2];
const SafeAreaPaddingView = (SafeAreaViewModule).SafeAreaPaddingView;
const intl = (IndexNativeModule).intl;
const string = intl.string;
const cpT0Cq = (IndexNativeModule).t.cpT0Cq;
const XSmallIcon = (XSmallIconModule).XSmallIcon;
const mediaViewerOverlayButton = (
<MediaViewerOverlayButton
accessibilityLabel={Reflect.apply(string, intl, [cpT0Cq])}
icon={<XSmallIcon size="md" color="interactive-text-active" />}
onPress={onClose}
/>
);
const value7 = contextName != null;
if (value7) {
var viewBinding2Props = {style: styles.navbarName};
var viewBinding2Props2 = {style: styles.navbarNameInner};
value8 = contextIcon != null;
if (value8) {
Icon = (require(1305) /* metro dependency 1305: native */).Icon;
var iconProps = {source: contextIcon,
color: (importDefault(697) /* metro dependency 697: native */).unsafe_rawColors.PRIMARY_345,
size: (require(1305) /* metro dependency 1305: native */).Icon.Sizes.CUSTOM};
contextIcon = styles.contextIcon;
iconProps.style = contextIcon;
r25 = <Icon {...iconProps} />;
} else {
r25 = value8;
}
r12 = (
<View {...viewBinding2Props}>
<View {...viewBinding2Props2}>
{r25}
<View style={styles.navbarNameShrinkWrapper}>
{((Text) => <Text accessibilityRole="header" variant="heading-md/medium" lineClamp={1} ellipsizeMode="tail" color="always-white">{contextName}</Text>)((require(4573) /* metro dependency 4573: Text */).Text)}
</View>
</View>
{!value4 && <View style={styles.navbarRight}>{((Component) => <Component source={source} />)(importDefault(9812) /* metro dependency 9812: MediaViewerOverlayButtonFavoriteGIF */)}{disableMediaOverlayButton ? null : ((ContextMenu) => <ContextMenu items={value3}>{children_76835}</ContextMenu>)((require(8811) /* metro dependency 8811: ContextMenuNative */).ContextMenu)}</View>}
</View>
</SafeAreaPaddingView>
</View2>
);
}
);
} else {
r12 = value7;
}
return (
<View2 style={items2}>
<SafeAreaPaddingView
top
left
right
pointerEvents="box-none"
>
<View style={styles.navbarInner} pointerEvents="box-none">
<View style={styles.navbarLeft}>
{mediaViewerOverlayButton}
{r12}
</View>
{!value4 && <View style={styles.navbarRight}>{((Component) => <Component source={source} />)(importDefault(9812) /* metro dependency 9812: MediaViewerOverlayButtonFavoriteGIF */)}{disableMediaOverlayButton ? null : ((ContextMenu) => <ContextMenu items={value3}>{children_76835}</ContextMenu>)((require(8811) /* metro dependency 8811: ContextMenuNative */).ContextMenu)}</View>}
</View>
</SafeAreaPaddingView>
</View2>
);
function MediaModalOverlayHeaderChildren(a0) { // fn#76835, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9995:2169, owner: MediaModalOverlayHeader.children, offset: 0x01de6def, size: 258 bytes, params: 2, frame: 22
const ref = a0.ref;
const value = Object.create(null);
value.ref = 0;
const value2 = copyDataProperties({}, a0, value, undefined);
const intl = (IndexNativeModule).intl;
const string = intl.string;
const PdRCRg = (IndexNativeModule).t.PdRCRg;
return (
<MediaViewerOverlayButton
accessibilityLabel={Reflect.apply(string, intl, [PdRCRg])}
icon={(require(477) /* metro dependency 477: PlatformUtils */).isAndroid()
? ((MoreVerticalIcon) => <MoreVerticalIcon size="md" color="interactive-text-active" />)((require(9821) /* metro dependency 9821: MoreVerticalIcon */).MoreVerticalIcon)
: ((MoreHorizontalIcon) => <MoreHorizontalIcon size="md" color="interactive-text-active" />)((require(8638) /* metro dependency 8638: MoreHorizontalIcon */).MoreHorizontalIcon)}
ref={ref}
{...value2}
/>
);
}
}
function MediaModalOverlayHeaderChildren(a0) { // fn#76835, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9995:2169, owner: MediaModalOverlayHeader.children, offset: 0x01de6def, size: 258 bytes, params: 2, frame: 22
const ref = a0.ref;
const value = Object.create(null);
value.ref = 0;
const value2 = copyDataProperties({}, a0, value, undefined);
const MediaViewerOverlayButton = importDefault(9811) /* metro dependency 9811: MediaViewerOverlayButton */;
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
const string = intl.string;
const PdRCRg = (require(1244) /* metro dependency 1244: indexNative */).t.PdRCRg;
return (
<MediaViewerOverlayButton
accessibilityLabel={Reflect.apply(string, intl, [PdRCRg])}
icon={(require(477) /* metro dependency 477: PlatformUtils */).isAndroid() ? ((MoreVerticalIcon) => <MoreVerticalIcon size="md" color="interactive-text-active" />)((require(9821) /* metro dependency 9821: MoreVerticalIcon */).MoreVerticalIcon) : ((MoreHorizontalIcon) => <MoreHorizontalIcon size="md" color="interactive-text-active" />)((require(8638) /* metro dependency 8638: MoreHorizontalIcon */).MoreHorizontalIcon)}
ref={ref}
{...value2}
/>
);
}
global.__d(_fun76833, 9809, [31, 27, 33, 4501, 5314, 9806, 9568, 9810, 4017, 6618, 9811, 1244, 5312, 1305, 697,
4573, 9812, 8811, 477, 9821, 8638,
2]) /* metro module 9809, dependencies: [31, 27, 33, 4501, 5314, 9806, 9568, 9810, 4017, 6618, 9811, 1244, 5312, 1305, 697, 4573, 9812, 8811, 477, 9821, 8638, 2] */;
@@ -1,24 +1,29 @@
/* Metro module 9811; source: modules/media_viewer/native/components/overlay/MediaViewerOverlayButton.tsx; dependencies: [31, 33, 8341, 2] */
import * as FileImportTrackerModule from '../../../../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
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 IconButtonNativeModule from '../../../../../design/components/Button/native/IconButton.native.tsx'; /* Metro dependency 8341 */
function _fun76839(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#76839, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9997:6, offset: 0x01de703f, size: 142 bytes, params: 8, frame: 18
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
let value = importAll(31) /* metro dependency 31 */;
const env0_2 = (require(33) /* metro dependency 33 */).jsx;
let value = ReactModule;
value = value.forwardRef(_fun76840);
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/media_viewer/native/components/overlay/MediaViewerOverlayButton.tsx');
(FileImportTrackerModule).fileFinishedImporting('modules/media_viewer/native/components/overlay/MediaViewerOverlayButton.tsx');
exports.default = value;
function _fun76840(a0, a1) { // fn#76840, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9997:136, offset: 0x01de70cd, size: 76 bytes, params: 3, frame: 14
const IconButton = (IconButtonNativeModule).IconButton;
return (
<IconButton
ref={a1}
size="md"
variant="secondary-overlay"
{...a0}
/>
);
}
}
function _fun76840(a0, a1) { // fn#76840, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9997:136, offset: 0x01de70cd, size: 76 bytes, params: 3, frame: 14
const IconButton = (require(8341) /* metro dependency 8341: IconButtonNative */).IconButton;
return (
<IconButton
ref={a1}
size="md"
variant="secondary-overlay"
{...a0}
/>
);
}
global.__d(_fun76839, 9811, [31, 33, 8341, 2]) /* metro module 9811, dependencies: [31, 33, 8341, 2] */;
@@ -1,87 +1,94 @@
/* Metro module 9812; source: modules/media_viewer/native/components/overlay/MediaViewerOverlayButtonFavoriteGIF.tsx; dependencies: [31, 33, 9813, 9814, 3857, 1244, 9820, 9819, 1349, 9546, 9811, 8633, 697, 8635, 2] */
import * as FileImportTrackerModule from '../../../../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
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 IndexNativeModule from '../../../../../intl/index.native.tsx'; /* Metro dependency 1244 */
import * as MediaSourceUtilModule from '../../MediaSourceUtil.tsx'; /* Metro dependency 9546 */
import * as FavoriteGIFHooksModule from '../../../../gif_picker/FavoriteGIFHooks.tsx'; /* Metro dependency 9813 */
import * as GIFPickerActionCreatorsModule from '../../../../../actions/GIFPickerActionCreators.tsx'; /* Metro dependency 9814 */
import * as GifIconModule from '../../../../../design/components/Icon/native/redesign/generated/GifIcon.tsx'; /* Metro dependency 9820 */
function _fun76841(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#76841, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9998:6, offset: 0x01de7119, size: 152 bytes, params: 8, frame: 18
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
let value = importAll(31) /* metro dependency 31 */;
const env0_4 = (require(33) /* metro dependency 33 */).jsx;
let value = ReactModule;
value = value.memo(GIFFavButton);
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/media_viewer/native/components/overlay/MediaViewerOverlayButtonFavoriteGIF.tsx');
(FileImportTrackerModule).fileFinishedImporting('modules/media_viewer/native/components/overlay/MediaViewerOverlayButtonFavoriteGIF.tsx');
exports.default = value;
}
function GIFFavButton({source}) { // fn#76842, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9998:134, offset: 0x01de71b1, size: 491 bytes, params: 2, frame: 22
var r0;
const intl = (IndexNativeModule).intl;
var string;
const t = (IndexNativeModule).t;
let r11 = source.isGIFV ? source.embedURI : source.sourceURI;
let value = null;
r11 = value == r11 ? source.uri : r11;
const useIsFavoriteGIF = FavoriteGIFHooksModule.useIsFavoriteGIF;
const value3 = Reflect.apply(useIsFavoriteGIF, FavoriteGIFHooksModule,
[GIFPickerActionCreatorsModule.gifUrlKey(r11)]);
const value4 = env0_3.useCallback(_fun76843, [value3, source.embedProviderName, source.height, source.isGIFV,
source.thumbnail, source.uri, source.width, r11]);
if (MediaSourceUtilModule.isAnimatedImageSource(source)) {
value = importDefault(9811) /* metro dependency 9811: MediaViewerOverlayButton */;
string = intl.string;
value = ((Component) => <Component accessibilityLabel={value3 ? Reflect.apply(string, intl,
[t['5/NS74']]) : Reflect.apply(string, intl,
[t.nIH0v8])} onPress={value4} icon={value3 ? ((StarIcon) => <StarIcon color={(importDefault(697) /* metro dependency 697: native */).unsafe_rawColors.YELLOW_300} size="md" />)((require(8633) /* metro dependency 8633: StarIcon */).StarIcon) : ((StarOutlineIcon) => <StarOutlineIcon color="interactive-text-default" size="md" />)((require(8635) /* metro dependency 8635: StarOutlineIcon */).StarOutlineIcon)} />)(value);
r0 = value;
} else if (source.isGIFV) {
value = importDefault(9811) /* metro dependency 9811: MediaViewerOverlayButton */;
string = intl.string;
value = ((Component) => <Component accessibilityLabel={value3 ? Reflect.apply(string, intl,
[t['5/NS74']]) : Reflect.apply(string, intl,
[t.nIH0v8])} onPress={value4} icon={value3 ? ((StarIcon) => <StarIcon color={(importDefault(697) /* metro dependency 697: native */).unsafe_rawColors.YELLOW_300} size="md" />)((require(8633) /* metro dependency 8633: StarIcon */).StarIcon) : ((StarOutlineIcon) => <StarOutlineIcon color="interactive-text-default" size="md" />)((require(8635) /* metro dependency 8635: StarOutlineIcon */).StarOutlineIcon)} />)(value);
r0 = value;
} else {
r0 = value;
}
return r0;
function _fun76843() { // fn#76843, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9998:292, offset: 0x01de739c, size: 466 bytes, params: 1, frame: 21
var moduleValue;
var getGIFThumbnailForFavorite;
var object;
var sourceBinding;
var value3;
var moduleValue2;
var addFavoriteGIF;
var isGIFV;
var GIFType;
const intl = (IndexNativeModule).intl;
const t = (IndexNativeModule).t;
const GifIcon = (GifIconModule).GifIcon;
if (env0_2) {
(require(9814) /* metro dependency 9814: GIFPickerActionCreators */).removeFavoriteGIF(env0_1);
(importDefault(3857) /* metro dependency 3857: ToastActionCreators */).open({key: 'REMOVED_FROM_FAVORITES',
content: intl.string(t.in1rga), IconComponent: GifIcon});
} else {
moduleValue = require(9819) /* metro dependency 9819: GIFPickerUtils */;
getGIFThumbnailForFavorite = moduleValue.getGIFThumbnailForFavorite;
sourceBinding = source;
value3 = Reflect.apply(getGIFThumbnailForFavorite, moduleValue, [{providerName: sourceBinding.embedProviderName,
thumbnail: sourceBinding.thumbnail}]);
moduleValue2 = require(9814) /* metro dependency 9814: GIFPickerActionCreators */;
addFavoriteGIF = moduleValue2.addFavoriteGIF;
object = {url: env0_1};
object.src = sourceBinding.uri;
object.gifSrc = value3;
object.width = sourceBinding.width;
object.height = sourceBinding.height;
isGIFV = sourceBinding.isGIFV;
GIFType = (require(1349) /* metro dependency 1349: frecency_user_settings */).GIFType;
object.format = isGIFV ? GIFType.VIDEO : GIFType.IMAGE;
Reflect.apply(addFavoriteGIF, moduleValue2, [object]);
(importDefault(3857) /* metro dependency 3857: ToastActionCreators */).open({key: 'ADDED_TO_FAVORITES',
content: intl.string(t.okQonm), IconComponent: GifIcon});
}
}
function GIFFavButton({source}) { // fn#76842, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9998:134, offset: 0x01de71b1, size: 491 bytes, params: 2, frame: 22
var r0;
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
var string;
const t = (require(1244) /* metro dependency 1244: indexNative */).t;
let r11 = source.isGIFV ? source.embedURI : source.sourceURI;
let value = null;
r11 = value == r11 ? source.uri : r11;
const favoriteGIFHooksModule = require(9813) /* metro dependency 9813: FavoriteGIFHooks */;
const useIsFavoriteGIF = favoriteGIFHooksModule.useIsFavoriteGIF;
const gifPickerActionCreatorsModule = require(9814) /* metro dependency 9814: GIFPickerActionCreators */;
const value3 = Reflect.apply(useIsFavoriteGIF, favoriteGIFHooksModule,
[gifPickerActionCreatorsModule.gifUrlKey(r11)]);
const value4 = env0_3.useCallback(_fun76843, [value3, source.embedProviderName, source.height, source.isGIFV,
source.thumbnail, source.uri, source.width, r11]);
const mediaSourceUtilModule = require(9546) /* metro dependency 9546: MediaSourceUtil */;
if (mediaSourceUtilModule.isAnimatedImageSource(source)) {
value = importDefault(9811) /* metro dependency 9811: MediaViewerOverlayButton */;
string = intl.string;
value = ((Component) => <Component accessibilityLabel={value3 ? Reflect.apply(string, intl,
[t['5/NS74']]) : Reflect.apply(string, intl,
[t.nIH0v8])} onPress={value4} icon={value3 ? ((StarIcon) => <StarIcon color={(importDefault(697) /* metro dependency 697: native */).unsafe_rawColors.YELLOW_300} size="md" />)((require(8633) /* metro dependency 8633: StarIcon */).StarIcon) : ((StarOutlineIcon) => <StarOutlineIcon color="interactive-text-default" size="md" />)((require(8635) /* metro dependency 8635: StarOutlineIcon */).StarOutlineIcon)} />)(value);
r0 = value;
} else if (source.isGIFV) {
value = importDefault(9811) /* metro dependency 9811: MediaViewerOverlayButton */;
string = intl.string;
value = ((Component) => <Component accessibilityLabel={value3 ? Reflect.apply(string, intl,
[t['5/NS74']]) : Reflect.apply(string, intl,
[t.nIH0v8])} onPress={value4} icon={value3 ? ((StarIcon) => <StarIcon color={(importDefault(697) /* metro dependency 697: native */).unsafe_rawColors.YELLOW_300} size="md" />)((require(8633) /* metro dependency 8633: StarIcon */).StarIcon) : ((StarOutlineIcon) => <StarOutlineIcon color="interactive-text-default" size="md" />)((require(8635) /* metro dependency 8635: StarOutlineIcon */).StarOutlineIcon)} />)(value);
r0 = value;
} else {
r0 = value;
}
return r0;
}
function _fun76843() { // fn#76843, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9998:292, offset: 0x01de739c, size: 466 bytes, params: 1, frame: 21
var moduleValue;
var getGIFThumbnailForFavorite;
var object2;
var sourceBinding;
var value3;
var moduleValue2;
var addFavoriteGIF;
var isGIFV;
var GIFType;
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
const t = (require(1244) /* metro dependency 1244: indexNative */).t;
const GifIcon = (require(9820) /* metro dependency 9820: GifIcon */).GifIcon;
if (env0_2) {
(require(9814) /* metro dependency 9814: GIFPickerActionCreators */).removeFavoriteGIF(env0_1);
(importDefault(3857) /* metro dependency 3857: ToastActionCreators */).open({key: 'REMOVED_FROM_FAVORITES',
content: intl.string(t.in1rga), IconComponent: GifIcon});
} else {
moduleValue = require(9819) /* metro dependency 9819: GIFPickerUtils */;
getGIFThumbnailForFavorite = moduleValue.getGIFThumbnailForFavorite;
sourceBinding = source;
value3 = Reflect.apply(getGIFThumbnailForFavorite, moduleValue, [{providerName: sourceBinding.embedProviderName,
thumbnail: sourceBinding.thumbnail}]);
moduleValue2 = require(9814) /* metro dependency 9814: GIFPickerActionCreators */;
addFavoriteGIF = moduleValue2.addFavoriteGIF;
object2 = {url: env0_1};
object2.src = sourceBinding.uri;
object2.gifSrc = value3;
object2.width = sourceBinding.width;
object2.height = sourceBinding.height;
isGIFV = sourceBinding.isGIFV;
GIFType = (require(1349) /* metro dependency 1349: frecency_user_settings */).GIFType;
object2.format = isGIFV ? GIFType.VIDEO : GIFType.IMAGE;
Reflect.apply(addFavoriteGIF, moduleValue2, [object2]);
(importDefault(3857) /* metro dependency 3857: ToastActionCreators */).open({key: 'ADDED_TO_FAVORITES',
content: intl.string(t.okQonm), IconComponent: GifIcon});
}
}
global.__d(_fun76841, 9812, [31, 33, 9813, 9814, 3857, 1244, 9820, 9819, 1349, 9546, 9811, 8633, 697, 8635,
2]) /* metro module 9812, dependencies: [31, 33, 9813, 9814, 3857, 1244, 9820, 9819, 1349, 9546, 9811, 8633, 697, 8635, 2] */;
@@ -1,17 +1,20 @@
/* Metro module 9824; source: modules/media_viewer/native/components/overlay/openMediaModalOverlayAltTextSheet.tsx; dependencies: [4080, 9825, 1962, 2] */
import * as FileImportTrackerModule from '../../../../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
function _fun76925(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#76925, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10010:6, offset: 0x01de99bd, size: 103 bytes, params: 8, frame: 18
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/media_viewer/native/components/overlay/openMediaModalOverlayAltTextSheet.tsx');
(FileImportTrackerModule).fileFinishedImporting('modules/media_viewer/native/components/overlay/openMediaModalOverlayAltTextSheet.tsx');
exports.default = openMediaModalOverlayAltTextSheet;
function openMediaModalOverlayAltTextSheet({description}) { // fn#76926, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10010:220, offset: 0x01de9a24, size: 93 bytes, params: 2, frame: 17
const defaultImport = importDefault(dependencyMap[0]);
const openLazy = defaultImport.openLazy;
let value = require(dependencyMap[2]);
value = value(dependencyMap[1], dependencyMap.paths);
Reflect.apply(openLazy, defaultImport, [value, 'MediaModalOverlayAltTextSheet', {description: description}]);
}
}
function openMediaModalOverlayAltTextSheet({description}) { // fn#76926, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10010:220, offset: 0x01de9a24, size: 93 bytes, params: 2, frame: 17
const defaultImport = importDefault(dependencyMap[0]);
const openLazy = defaultImport.openLazy;
let value = require(dependencyMap[2]);
value = value(dependencyMap[1], dependencyMap.paths);
Reflect.apply(openLazy, defaultImport, [value, 'MediaModalOverlayAltTextSheet', {description: description}]);
}
global.__d(_fun76925, 9824, [4080, 9825, 1962, 2]) /* metro module 9824, dependencies: [4080, 9825, 1962, 2] */;
@@ -1,20 +1,25 @@
/* Metro module 9828; source: modules/media_viewer/native/components/overlay/useMediaModalFooterBackground.android.tsx; dependencies: [57, 674, 3860, 697, 2] */
import Module00057 from '../../../../../by-id/module-00057.js'; /* Metro dependency 57 */
import Module00674 from '../../../../../by-id/module-00674.js'; /* Metro dependency 674 */
import Native from '../../../../../external/discord_common/js/packages/tokens/native.tsx'; /* Metro dependency 697 */
import * as FileImportTrackerModule from '../../../../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
import * as UseTokenModule from '../../../../../design/tokens/native/useToken.tsx'; /* Metro dependency 3860 */
function _fun76970(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#76970, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10014:6, offset: 0x01deb7f8, size: 118 bytes, params: 8, frame: 19
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_3 = importDefault(57) /* metro dependency 57 */;
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/media_viewer/native/components/overlay/useMediaModalFooterBackground.android.tsx');
(FileImportTrackerModule).fileFinishedImporting('modules/media_viewer/native/components/overlay/useMediaModalFooterBackground.android.tsx');
exports.default = useMediaModalFooterBackground;
function useMediaModalFooterBackground() { // fn#76971, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10014:242, offset: 0x01deb86e, size: 154 bytes, params: 1, frame: 19
const defaultImport = Module00674;
const useToken = UseTokenModule.useToken;
const THEME_LOCKED_BLUR_FALLBACK = (Native).colors.THEME_LOCKED_BLUR_FALLBACK;
const value = Module00057(defaultImport(Reflect.apply(useToken, UseTokenModule, [THEME_LOCKED_BLUR_FALLBACK])).rgba(), 4);
return {mediaModalFooterBackgroundColorRgba: {r: value[0], g: value[1], b: value[2], a: value[3]},
MediaModalFooterUnderlay: undefined};
}
}
function useMediaModalFooterBackground() { // fn#76971, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10014:242, offset: 0x01deb86e, size: 154 bytes, params: 1, frame: 19
const defaultImport = importDefault(674) /* metro dependency 674 */;
const useTokenModule = require(3860) /* metro dependency 3860: useToken */;
const useToken = useTokenModule.useToken;
const THEME_LOCKED_BLUR_FALLBACK = (importDefault(697) /* metro dependency 697: native */).colors.THEME_LOCKED_BLUR_FALLBACK;
const value = env0_3(defaultImport(Reflect.apply(useToken, useTokenModule, [THEME_LOCKED_BLUR_FALLBACK])).rgba(), 4);
return {mediaModalFooterBackgroundColorRgba: {r: value[0], g: value[1], b: value[2], a: value[3]},
MediaModalFooterUnderlay: undefined};
}
global.__d(_fun76970, 9828, [57, 674, 3860, 697, 2]) /* metro module 9828, dependencies: [57, 674, 3860, 697, 2] */;
@@ -1,66 +1,70 @@
/* Metro module 9941; source: modules/media_viewer/native/getMediaViewerStateForScreen.tsx; dependencies: [9546, 2] */
import * as FileImportTrackerModule from '../../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
import * as MediaSourceUtilModule from './MediaSourceUtil.tsx'; /* Metro dependency 9546 */
function _fun77816(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#77816, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10127:6, offset: 0x01e0cfc3, size: 96 bytes, params: 8, frame: 18
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/media_viewer/native/getMediaViewerStateForScreen.tsx');
(FileImportTrackerModule).fileFinishedImporting('modules/media_viewer/native/getMediaViewerStateForScreen.tsx');
exports.default = getMediaViewerStateForScreen;
function getMediaViewerStateForScreen(a0, a1, a2) { // fn#77817, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10127:196, offset: 0x01e0d023, size: 391 bytes, params: 4, frame: 21
var r4;
var value4;
var object;
var Math;
var value5;
var value9;
var value10;
let value = MediaSourceUtilModule;
value = value.flattenSource(a2, true);
if (value == null) {
return {maximumZoomScale: 1, width: a0, height: a1};
}
const value2 = a0 / a1;
const width = value.width;
let height = value.height;
const value3 = width / height;
if (value.width < a0) {
height = value.height;
if (height < a1) {
r4 = value3 > value2 ? value.width / a0 : value.height / a1;
value9 = global.Math.min(0.5, r4 / 1.01);
value10 = 1;
r4 = value9 === 0 ? value10 : value10 / value9;
return {maximumZoomScale: r4, width: value.width, height: value.height};
}
if (value3 > value2) {
value5 = a0 / value.width;
object = {maximumZoomScale: 1 / value5 + 1};
Math = global.Math;
object.width = Math.floor(a0);
Math = global.Math;
object.height = Math.floor(value.height * value5);
return object;
}
height = value.height;
value4 = a1 / height;
} else {
if (value3 > value2) {
value5 = a0 / value.width;
object = {maximumZoomScale: 1 / value5 + 1};
Math = global.Math;
object.width = Math.floor(a0);
Math = global.Math;
object.height = Math.floor(value.height * value5);
return object;
}
value4 = a1 / value.height;
}
object = {maximumZoomScale: 1 / value4 + 1};
Math = global.Math;
object.width = Math.floor(value.width * value4);
Math = global.Math;
object.height = Math.floor(a1);
return object;
}
}
function getMediaViewerStateForScreen(a0, a1, a2) { // fn#77817, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10127:196, offset: 0x01e0d023, size: 391 bytes, params: 4, frame: 21
var r4;
var value4;
var object2;
var Math;
var value5;
var value9;
var value10;
let value = require(9546) /* metro dependency 9546: MediaSourceUtil */;
value = value.flattenSource(a2, true);
if (value == null) {
return {maximumZoomScale: 1, width: a0, height: a1};
}
const value2 = a0 / a1;
const width = value.width;
let height = value.height;
const value3 = width / height;
if (value.width < a0) {
height = value.height;
if (height < a1) {
r4 = value3 > value2 ? value.width / a0 : value.height / a1;
value9 = global.Math.min(0.5, r4 / 1.01);
value10 = 1;
r4 = value9 === 0 ? value10 : value10 / value9;
return {maximumZoomScale: r4, width: value.width, height: value.height};
}
if (value3 > value2) {
value5 = a0 / value.width;
object2 = {maximumZoomScale: 1 / value5 + 1};
Math = global.Math;
object2.width = Math.floor(a0);
Math = global.Math;
object2.height = Math.floor(value.height * value5);
return object2;
}
height = value.height;
value4 = a1 / height;
} else {
if (value3 > value2) {
value5 = a0 / value.width;
object2 = {maximumZoomScale: 1 / value5 + 1};
Math = global.Math;
object2.width = Math.floor(a0);
Math = global.Math;
object2.height = Math.floor(value.height * value5);
return object2;
}
value4 = a1 / value.height;
}
object2 = {maximumZoomScale: 1 / value4 + 1};
Math = global.Math;
object2.width = Math.floor(value.width * value4);
Math = global.Math;
object2.height = Math.floor(a1);
return object2;
}
global.__d(_fun77816, 9941, [9546, 2]) /* metro module 9941, dependencies: [9546, 2] */;
@@ -1,19 +1,21 @@
/* Metro module 9563; source: modules/media_viewer/native/portraitThumbnailHelpers.tsx; dependencies: [2] */
import * as FileImportTrackerModule from '../../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
function _fun74688(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#74688, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9749:6, offset: 0x01d96a3f, size: 107 bytes, params: 8, frame: 16
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
object = {code: 'function lerpVarWidthThumbnailScrollBounds_portraitThumbnailHelpersTsx1(positions,position){if(positions.length===0)return 0;if(position<0){return 0;}if(position>=positions.length){position=positions.length;}const index=Math.floor(position);const fraction=position-index;if(index>=positions.length){return positions[positions.length-1].scrollStart;}const startPos=positions[index].scrollStart;const endPos=index<positions.length-1?positions[index+1].scrollStart:startPos;return startPos+fraction*(endPos-startPos);}'};
const value = _fun74689();
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/media_viewer/native/portraitThumbnailHelpers.tsx');
(FileImportTrackerModule).fileFinishedImporting('modules/media_viewer/native/portraitThumbnailHelpers.tsx');
exports.lerpVarWidthThumbnailScrollBounds = value;
}
function _fun74689() { // fn#74689, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9749:625, offset: 0x01d96aaa, size: 48 bytes, params: 1, frame: 2
const lerpVarWidthThumbnailScrollBounds2 = lerpVarWidthThumbnailScrollBounds;
lerpVarWidthThumbnailScrollBounds2.__closure = {};
lerpVarWidthThumbnailScrollBounds2.__workletHash = 5256874583737;
lerpVarWidthThumbnailScrollBounds2.__initData = env0_0;
return lerpVarWidthThumbnailScrollBounds2;
}
function _fun74689() { // fn#74689, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9749:625, offset: 0x01d96aaa, size: 48 bytes, params: 1, frame: 2
const closure = lerpVarWidthThumbnailScrollBounds;
closure.__closure = {};
closure.__workletHash = 5256874583737;
closure.__initData = env0_0;
return closure;
}
function lerpVarWidthThumbnailScrollBounds(a0, a1) { // fn#74690, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9749:674, offset: 0x01d96ada, size: 158 bytes, params: 3, frame: 16
@@ -35,3 +37,4 @@ function lerpVarWidthThumbnailScrollBounds(a0, a1) { // fn#74690, source: /ci/bu
return scrollStart + value2 * ((value < a0.length - 1 ? a0[value + 1].scrollStart : scrollStart) - scrollStart);
}
global.__d(_fun74688, 9563, [2]) /* metro module 9563, dependencies: [2] */;
@@ -1,118 +1,126 @@
/* Metro module 9942; source: modules/media_viewer/native/useEntranceAnimation.tsx; dependencies: [57, 31, 1305, 629, 690, 4504, 4017, 2] */
import Module00057 from '../../../by-id/module-00057.js'; /* Metro dependency 57 */
import * as FileImportTrackerModule from '../../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
import * as ReactModule from '../../../by-id/module-00031-React.js'; /* Metro dependency 31 */
import * as Module00629Module from '../../../by-id/module-00629.js'; /* Metro dependency 629 */
import * as ReactBatchUpdatesNativeModule from '../../../external/discord_common/js/shared/utils/ReactBatchUpdates.native.tsx'; /* Metro dependency 690 */
import * as NativeModule from '../../../design/void/native.tsx'; /* Metro dependency 1305 */
import * as ReanimatedRexportModule from '../../reanimated/ReanimatedRexport.tsx'; /* Metro dependency 4017 */
import * as TimingModule from '../../../design/animation/reanimated/timing/timing.tsx'; /* Metro dependency 4504 */
function _fun77818(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#77818, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10128:6, offset: 0x01e0d1aa, size: 254 bytes, params: 8, frame: 18
var object2;
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_2 = importDefault(57) /* metro dependency 57 */;
const env0_3 = importAll(31) /* metro dependency 31 */;
object2 = {duration: 300};
const STANDARD_EASING = (require(1305) /* metro dependency 1305: native */).STANDARD_EASING;
object2.easing = STANDARD_EASING;
let value = require(629) /* metro dependency 629 */;
object = {duration: 300};
const STANDARD_EASING = (NativeModule).STANDARD_EASING;
object.easing = STANDARD_EASING;
let value = Module00629Module;
value = value.create(function() {
return {isComplete: false};
});
object2 = {code: 'function useEntranceAnimationTsx1(){const{runOnJS,setUseEntranceAnimationState}=this.__closure;runOnJS(setUseEntranceAnimationState)({isComplete:true});}'};
object2 = {code: 'function useEntranceAnimationTsx2(){const{runOnJS,setUseEntranceAnimationState,incrementLoads}=this.__closure;runOnJS(setUseEntranceAnimationState)({isComplete:true});runOnJS(incrementLoads)();}'};
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/media_viewer/native/useEntranceAnimation.tsx');
object = {code: 'function useEntranceAnimationTsx1(){const{runOnJS,setUseEntranceAnimationState}=this.__closure;runOnJS(setUseEntranceAnimationState)({isComplete:true});}'};
object = {code: 'function useEntranceAnimationTsx2(){const{runOnJS,setUseEntranceAnimationState,incrementLoads}=this.__closure;runOnJS(setUseEntranceAnimationState)({isComplete:true});runOnJS(incrementLoads)();}'};
(FileImportTrackerModule).fileFinishedImporting('modules/media_viewer/native/useEntranceAnimation.tsx');
exports.useEntranceAnimationState = value;
exports.useEntranceAnimation = useEntranceAnimation;
}
function setUseEntranceAnimationState(a0) { // fn#77819, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10128:206, offset: 0x01e0d2a8, size: 54 bytes, params: 2, frame: 12
const env0_0 = a0;
(ReactBatchUpdatesNativeModule).batchUpdates(_fun77820);
function _fun77820() { // fn#77820, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10128:269, offset: 0x01e0d2de, size: 27 bytes, params: 1, frame: 11
return env1_5.setState(env0_0);
}
function setUseEntranceAnimationState(a0) { // fn#77819, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10128:206, offset: 0x01e0d2a8, size: 54 bytes, params: 2, frame: 12
const env0_0 = a0;
(require(690) /* metro dependency 690: ReactBatchUpdatesNative */).batchUpdates(_fun77820);
}
function useEntranceAnimation(a0) { // fn#77822, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10128:803, offset: 0x01e0d304, size: 164 bytes, params: 2, frame: 17
const env0_0 = a0;
const binding = env0_3;
let value = env0_2(binding.useState(0), 2);
const property = value[0];
const env0_1 = value[1];
value = binding.useCallback(_fun77823, []);
const value3 = binding.useCallback(_fun77825, [a0]);
value = binding.useCallback(_fun77828, [value, a0]);
return {loads: property, handleLoadStart: value3, handleError: value, handleLoad: value};
}
function _fun77820() { // fn#77820, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10128:269, offset: 0x01e0d2de, size: 27 bytes, params: 1, frame: 11
return env1_5.setState(env0_0);
}
function _fun77823() { // fn#77823, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10128:896, offset: 0x01e0d3a8, size: 25 bytes, params: 1, frame: 11
env0_1(function(a0) {
return a0 + 1;
});
}
function _fun77825() { // fn#77825, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10128:936, offset: 0x01e0d3c1, size: 175 bytes, params: 1, frame: 23
(require(690) /* metro dependency 690: ReactBatchUpdatesNative */).batchUpdates(_fun77826);
const binding = env0_0;
const set = binding.set;
const timingModule = require(4504) /* metro dependency 4504: timing */;
const withTiming = timingModule.withTiming;
const binding2 = env1_4;
const closure = t_77827;
const object2 = {};
object2.runOnJS = (require(4017) /* metro dependency 4017: ReanimatedRexport */).runOnJS;
object2.setUseEntranceAnimationState = setUseEntranceAnimationState;
closure.__closure = object2;
closure.__workletHash = 7427534745615;
closure.__initData = env1_6;
Reflect.apply(set, binding, [Reflect.apply(withTiming, timingModule, [1, binding2, 'respect-motion-settings',
closure])]);
}
function _fun77828() { // fn#77828, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10128:1306, offset: 0x01e0d4c4, size: 223 bytes, params: 1, frame: 25
var environment;
var value3;
var set;
var moduleValue2;
var withTiming;
var binding2;
var closure;
var object2;
let binding = env0_0;
if (binding.get() !== 1) {
value3 = environment.__proto__;
(require(690) /* metro dependency 690: ReactBatchUpdatesNative */).batchUpdates(_fun77829);
binding = env0_0;
set = binding.set;
moduleValue2 = require(4504) /* metro dependency 4504: timing */;
withTiming = moduleValue2.withTiming;
binding2 = env1_4;
closure = t_77830;
object2 = {};
object2.runOnJS = (require(4017) /* metro dependency 4017: ReanimatedRexport */).runOnJS;
object2.setUseEntranceAnimationState = setUseEntranceAnimationState;
object2.incrementLoads = env0_2;
closure.__closure = object2;
closure.__workletHash = 9904090637386;
closure.__initData = env1_7;
Reflect.apply(set, binding, [Reflect.apply(withTiming, moduleValue2, [1, binding2, 'respect-motion-settings',
closure])]);
} else {
env0_2();
}
function useEntranceAnimation(a0) { // fn#77822, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10128:803, offset: 0x01e0d304, size: 164 bytes, params: 2, frame: 17
const env0_0 = a0;
let value = Module00057(ReactModule.useState(0), 2);
const property = value[0];
const env0_1 = value[1];
value = ReactModule.useCallback(_fun77823, []);
const value3 = ReactModule.useCallback(_fun77825, [a0]);
value = ReactModule.useCallback(_fun77828, [value, a0]);
return {loads: property, handleLoadStart: value3, handleError: value, handleLoad: value};
function _fun77823() { // fn#77823, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10128:896, offset: 0x01e0d3a8, size: 25 bytes, params: 1, frame: 11
env0_1(function(a0) {
return a0 + 1;
});
}
function _fun77825() { // fn#77825, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10128:936, offset: 0x01e0d3c1, size: 175 bytes, params: 1, frame: 23
(ReactBatchUpdatesNativeModule).batchUpdates(_fun77826);
const binding = env0_0;
const set = binding.set;
const withTiming = TimingModule.withTiming;
const binding2 = env1_4;
const t_778272 = t_77827;
const object = {};
object.runOnJS = (require(4017) /* metro dependency 4017: ReanimatedRexport */).runOnJS;
object.setUseEntranceAnimationState = setUseEntranceAnimationState;
t_778272.__closure = object;
t_778272.__workletHash = 7427534745615;
t_778272.__initData = env1_6;
Reflect.apply(set, binding, [Reflect.apply(withTiming, TimingModule, [1, binding2, 'respect-motion-settings',
t_778272])]);
function _fun77826() { // fn#77826, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10128:969, offset: 0x01e0d470, size: 29 bytes, params: 1, frame: 12
return env2_5.setState({isComplete: false});
}
function t_77827() { // fn#77827, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10128:1062, offset: 0x01e0d48d, size: 55 bytes, params: 1, frame: 12
const value = environment.__proto__.__proto__;
ReanimatedRexportModule.runOnJS(setUseEntranceAnimationState)({isComplete: true});
}
}
function _fun77828() { // fn#77828, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10128:1306, offset: 0x01e0d4c4, size: 223 bytes, params: 1, frame: 25
var environment;
var value3;
var set;
var moduleValue2;
var withTiming;
var binding2;
var t_778302;
var object;
let binding = env0_0;
if (binding.get() !== 1) {
value3 = environment.__proto__;
(require(690) /* metro dependency 690: ReactBatchUpdatesNative */).batchUpdates(_fun77829);
binding = env0_0;
set = binding.set;
moduleValue2 = require(4504) /* metro dependency 4504: timing */;
withTiming = moduleValue2.withTiming;
binding2 = env1_4;
t_778302 = t_77830;
object = {};
object.runOnJS = (require(4017) /* metro dependency 4017: ReanimatedRexport */).runOnJS;
object.setUseEntranceAnimationState = setUseEntranceAnimationState;
object.incrementLoads = Module00057;
t_778302.__closure = object;
t_778302.__workletHash = 9904090637386;
t_778302.__initData = env1_7;
Reflect.apply(set, binding, [Reflect.apply(withTiming, moduleValue2, [1, binding2, 'respect-motion-settings',
t_778302])]);
} else {
Module00057();
}
function _fun77829() { // fn#77829, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10128:1352, offset: 0x01e0d470, size: 29 bytes, params: 1, frame: 12
return env2_5.setState({isComplete: false});
}
function t_77830() { // fn#77830, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10128:1445, offset: 0x01e0d5a3, size: 85 bytes, params: 1, frame: 15
let value = environment.__proto__.__proto__;
ReanimatedRexportModule.runOnJS(setUseEntranceAnimationState)({isComplete: true});
value = ReanimatedRexportModule;
value.runOnJS(env1_2)();
}
}
}
}
function _fun77826() { // fn#77826, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10128:969, offset: 0x01e0d470, size: 29 bytes, params: 1, frame: 12
return env2_5.setState({isComplete: false});
}
function t_77827() { // fn#77827, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10128:1062, offset: 0x01e0d48d, size: 55 bytes, params: 1, frame: 12
const value = environment.__proto__.__proto__;
const reanimatedRexportModule = require(4017) /* metro dependency 4017: ReanimatedRexport */;
reanimatedRexportModule.runOnJS(setUseEntranceAnimationState)({isComplete: true});
}
function t_77830() { // fn#77830, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10128:1445, offset: 0x01e0d5a3, size: 85 bytes, params: 1, frame: 15
let value = environment.__proto__.__proto__;
const reanimatedRexportModule = require(4017) /* metro dependency 4017: ReanimatedRexport */;
reanimatedRexportModule.runOnJS(setUseEntranceAnimationState)({isComplete: true});
value = reanimatedRexportModule;
value.runOnJS(env1_2)();
}
global.__d(_fun77818, 9942, [57, 31, 1305, 629, 690, 4504, 4017,
2]) /* metro module 9942, dependencies: [57, 31, 1305, 629, 690, 4504, 4017, 2] */;
@@ -1,64 +1,80 @@
/* Metro module 9808; source: modules/media_viewer/native/useMediaItemSpoilerState.tsx; dependencies: [57, 31, 9545, 4017, 4504, 1305, 2] */
import Module00057 from '../../../by-id/module-00057.js'; /* Metro dependency 57 */
import * as FileImportTrackerModule from '../../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
import * as ReactModule from '../../../by-id/module-00031-React.js'; /* Metro dependency 31 */
import * as NativeModule from '../../../design/void/native.tsx'; /* Metro dependency 1305 */
import * as TimingModule from '../../../design/animation/reanimated/timing/timing.tsx'; /* Metro dependency 4504 */
import * as UseMediaViewerSourcesModule from './useMediaViewerSources.tsx'; /* Metro dependency 9545 */
function _fun76827(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#76827, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9994:6, offset: 0x01de6639, size: 165 bytes, params: 8, frame: 18
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_2 = importDefault(57) /* metro dependency 57 */;
const env0_3 = importAll(31) /* metro dependency 31 */;
object = {code: 'function useMediaItemSpoilerStateTsx1(){const{runOnJS,setSpoilerActive,hasSpoiler}=this.__closure;runOnJS(setSpoilerActive)(hasSpoiler);}'};
object = {code: 'function useMediaItemSpoilerStateTsx2(){const{spoilerOpacity}=this.__closure;return{opacity:spoilerOpacity.get()};}'};
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/media_viewer/native/useMediaItemSpoilerState.tsx');
(FileImportTrackerModule).fileFinishedImporting('modules/media_viewer/native/useMediaItemSpoilerState.tsx');
exports.useMediaItemSpoilerState = useMediaItemSpoilerState;
function useMediaItemSpoilerState(a0) { // fn#76828, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9994:509, offset: 0x01de66de, size: 259 bytes, params: 2, frame: 20
const env0_0 = a0;
const MediaViewerSourcesStore = (UseMediaViewerSourcesModule).MediaViewerSourcesStore;
const value2 = MediaViewerSourcesStore.useState(_fun76829);
const value4 = env0_2(env0_3.useState(value2), 2);
const value5 = 0;
const property = value4[value5];
const value6 = 1;
var env0_2 = value4[value6];
const value7 = (require(4017) /* metro dependency 4017: ReanimatedRexport */).useSharedValue(value2 ? value6 : value5);
var env0_3 = value7;
env0_3.useEffect(_fun76830, [value2, value7]);
items2 = [property];
const reanimatedRexportModule = require(4017) /* metro dependency 4017: ReanimatedRexport */;
const useAnimatedStyle = reanimatedRexportModule.useAnimatedStyle;
const useMediaItemSpoilerStateS2 = useMediaItemSpoilerStateS;
useMediaItemSpoilerStateS2.__closure = {spoilerOpacity: value7};
useMediaItemSpoilerStateS2.__workletHash = 8496335051493;
useMediaItemSpoilerStateS2.__initData = env0_5;
items2[1] = Reflect.apply(useAnimatedStyle, reanimatedRexportModule, [useMediaItemSpoilerStateS2]);
return items2;
function _fun76829({spoilerIndexes}) { // fn#76829, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9994:596, offset: 0x01d926ae, size: 28 bytes, params: 2, frame: 11
return spoilerIndexes.has(env0_0);
}
function _fun76830() { // fn#76830, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9994:716, offset: 0x01de67e1, size: 207 bytes, params: 1, frame: 25
const binding = env0_3;
const set = binding.set;
const withTiming = TimingModule.withTiming;
const r6 = env0_1 ? 1 : 0;
const object = {duration: 200};
const STANDARD_EASING = (NativeModule).STANDARD_EASING;
object.easing = STANDARD_EASING;
const t_768312 = t_76831;
const object2 = {};
object2.runOnJS = (require(4017) /* metro dependency 4017: ReanimatedRexport */).runOnJS;
object2.setSpoilerActive = env0_2;
object2.hasSpoiler = env0_1;
t_768312.__closure = object2;
t_768312.__workletHash = 15930548853488;
t_768312.__initData = env1_4;
Reflect.apply(set, binding, [Reflect.apply(withTiming, TimingModule, [r6, object, 'respect-motion-settings',
t_768312])]);
function t_76831() { // fn#76831, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9994:834, offset: 0x01de68b0, size: 53 bytes, params: 1, frame: 13
let value = environment.__proto__.__proto__;
value = require(4017) /* metro dependency 4017: ReanimatedRexport */;
value = value.runOnJS(env1_2);
value(env1_1);
}
}
function useMediaItemSpoilerStateS() { // fn#76832, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9994:1028, owner: useMediaItemSpoilerState.S, offset: 0x01de68e5, size: 24 bytes, params: 1, frame: 10
const object = {};
object.opacity = env0_3.get();
return object;
}
}
}
function useMediaItemSpoilerState(a0) { // fn#76828, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9994:509, offset: 0x01de66de, size: 259 bytes, params: 2, frame: 20
const env0_0 = a0;
const MediaViewerSourcesStore = (require(9545) /* metro dependency 9545: useMediaViewerSources */).MediaViewerSourcesStore;
const value2 = MediaViewerSourcesStore.useState(_fun76829);
const value4 = env0_2(env0_3.useState(value2), 2);
const value5 = 0;
const property = value4[value5];
const value6 = 1;
var env0_2 = value4[value6];
const value7 = (require(4017) /* metro dependency 4017: ReanimatedRexport */).useSharedValue(value2 ? value6 : value5);
var env0_3 = value7;
env0_3.useEffect(_fun76830, [value2, value7]);
items2 = [property];
const reanimatedRexportModule = require(4017) /* metro dependency 4017: ReanimatedRexport */;
const useAnimatedStyle = reanimatedRexportModule.useAnimatedStyle;
const closure = useMediaItemSpoilerStateS;
closure.__closure = {spoilerOpacity: value7};
closure.__workletHash = 8496335051493;
closure.__initData = env0_5;
items2[1] = Reflect.apply(useAnimatedStyle, reanimatedRexportModule, [closure]);
return items2;
}
function _fun76830() { // fn#76830, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9994:716, offset: 0x01de67e1, size: 207 bytes, params: 1, frame: 25
const binding = env0_3;
const set = binding.set;
const timingModule = require(4504) /* metro dependency 4504: timing */;
const withTiming = timingModule.withTiming;
const r6 = env0_1 ? 1 : 0;
const object3 = {duration: 200};
const STANDARD_EASING = (require(1305) /* metro dependency 1305: native */).STANDARD_EASING;
object3.easing = STANDARD_EASING;
const closure = t_76831;
const object4 = {};
object4.runOnJS = (require(4017) /* metro dependency 4017: ReanimatedRexport */).runOnJS;
object4.setSpoilerActive = env0_2;
object4.hasSpoiler = env0_1;
closure.__closure = object4;
closure.__workletHash = 15930548853488;
closure.__initData = env1_4;
Reflect.apply(set, binding, [Reflect.apply(withTiming, timingModule, [r6, object3, 'respect-motion-settings',
closure])]);
}
function t_76831() { // fn#76831, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9994:834, offset: 0x01de68b0, size: 53 bytes, params: 1, frame: 13
let value = environment.__proto__.__proto__;
value = require(4017) /* metro dependency 4017: ReanimatedRexport */;
value = value.runOnJS(env1_2);
value(env1_1);
}
global.__d(_fun76827, 9808, [57, 31, 9545, 4017, 4504, 1305,
2]) /* metro module 9808, dependencies: [57, 31, 9545, 4017, 4504, 1305, 2] */;
@@ -1,76 +1,80 @@
/* Metro module 9946; source: modules/media_viewer/native/useMediaViewerClosePosition.tsx; dependencies: [57, 31, 661, 9941, 8994, 4017, 2] */
import Module00057 from '../../../by-id/module-00057.js'; /* Metro dependency 57 */
import UseStableCallback from '../../../hooks/useStableCallback.tsx'; /* Metro dependency 8994 */
import * as FileImportTrackerModule from '../../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
import * as ReactModule from '../../../by-id/module-00031-React.js'; /* Metro dependency 31 */
import * as ConstantsModule from '../../../Constants.tsx'; /* Metro dependency 661 */
import * as ReanimatedRexportModule from '../../reanimated/ReanimatedRexport.tsx'; /* Metro dependency 4017 */
function _fun77846(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#77846, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10132:6, offset: 0x01e0e119, size: 202 bytes, params: 8, frame: 19
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_3 = importDefault(57) /* metro dependency 57 */;
const env0_4 = importAll(31) /* metro dependency 31 */;
const env0_5 = (require(661) /* metro dependency 661: Constants */).NOOP;
object = {code: 'function useMediaViewerClosePositionTsx1(){const{index}=this.__closure;return index.get();}'};
object = {code: 'function useMediaViewerClosePositionTsx2(index){const{runOnJS,setClosePosition}=this.__closure;runOnJS(setClosePosition)(index);}'};
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/media_viewer/native/useMediaViewerClosePosition.tsx');
(FileImportTrackerModule).fileFinishedImporting('modules/media_viewer/native/useMediaViewerClosePosition.tsx');
exports.default = useMediaViewerClosePosition;
}
function computeClosePosition(a0, a1, a2) { // fn#77847, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10132:131, offset: 0x01e0e1e3, size: 73 bytes, params: 4, frame: 16
var r0;
var value;
if (a2 != null) {
value = importDefault(9941) /* metro dependency 9941: getMediaViewerStateForScreen */;
value = value(a0, a1, a2);
r0 = value;
} else {
r0 = {height: a1};
function computeClosePosition(a0, a1, a2) { // fn#77847, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10132:131, offset: 0x01e0e1e3, size: 73 bytes, params: 4, frame: 16
var r0;
var value;
if (a2 != null) {
value = importDefault(9941) /* metro dependency 9941: getMediaViewerStateForScreen */;
value = value(a0, a1, a2);
r0 = value;
} else {
r0 = {height: a1};
}
return (a1 + r0.height) / 2;
}
return (a1 + r0.height) / 2;
}
function useMediaViewerClosePosition({index, sources, onClose = NOOP, windowHeight, windowWidth}) { // fn#77848, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10132:477, offset: 0x01e0e22c, size: 371 bytes, params: 2, frame: 24
var object2;
const env0_3 = windowWidth;
const value2 = (importDefault(8994) /* metro dependency 8994: useStableCallback */)(onClose);
const binding = value2;
const [property, env0_5] = env0_3(binding.useState(function() {
return computeClosePosition(windowWidth, windowHeight, sources[index.get()]);
}), 2);
const value5 = binding.useCallback(_fun77850, [value2, sources, windowHeight, windowWidth]);
const env0_6 = value5;
const reanimatedRexportModule = require(4017) /* metro dependency 4017: ReanimatedRexport */;
const useAnimatedReaction = reanimatedRexportModule.useAnimatedReaction;
const closure = function() {
return index.get();
};
closure.__closure = {index: index};
closure.__workletHash = 5031282724746;
closure.__initData = env0_6;
const closure2 = useMediaViewerClosePositionF;
object2 = {};
object2.runOnJS = reanimatedRexportModule.runOnJS;
object2.setClosePosition = value5;
closure2.__closure = object2;
closure2.__workletHash = 2709880768438;
closure2.__initData = env0_7;
Reflect.apply(useAnimatedReaction, reanimatedRexportModule, [closure, closure2]);
binding.useEffect(_fun77853, [value5, index]);
return property;
}
function useMediaViewerClosePosition({index, sources, onClose = NOOP, windowHeight, windowWidth}) { // fn#77848, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10132:477, offset: 0x01e0e22c, size: 371 bytes, params: 2, frame: 24
const windowWidth2 = windowWidth;
const value2 = (UseStableCallback)(onClose);
const binding = value2;
const [property, env0_5] = windowWidth2(binding.useState(function() {
return computeClosePosition(windowWidth, windowHeight, sources[index.get()]);
}), 2);
const value5 = binding.useCallback(_fun77850, [value2, sources, windowHeight, windowWidth]);
const env0_6 = value5;
const useAnimatedReaction = ReanimatedRexportModule.useAnimatedReaction;
const closure = function() {
return index.get();
};
closure.__closure = {index: index};
closure.__workletHash = 5031282724746;
closure.__initData = env0_6;
const useMediaViewerClosePositionF2 = useMediaViewerClosePositionF;
object = {};
object.runOnJS = ReanimatedRexportModule.runOnJS;
object.setClosePosition = value5;
useMediaViewerClosePositionF2.__closure = object;
useMediaViewerClosePositionF2.__workletHash = 2709880768438;
useMediaViewerClosePositionF2.__initData = env0_7;
Reflect.apply(useAnimatedReaction, ReanimatedRexportModule, [closure, useMediaViewerClosePositionF2]);
binding.useEffect(_fun77853, [value5, index]);
return property;
function _fun77850(a0) { // fn#77850, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10132:694, offset: 0x01e0e3d1, size: 65 bytes, params: 2, frame: 16
const property = sources[a0];
if (property == null) {
ReactModule();
}
env0_5(computeClosePosition(windowWidth, windowHeight, property));
}
function useMediaViewerClosePositionF(a0) { // fn#77852, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10132:890, owner: useMediaViewerClosePosition.f, offset: 0x01e0e412, size: 52 bytes, params: 2, frame: 12
let value = environment.__proto__;
value = require(4017) /* metro dependency 4017: ReanimatedRexport */;
value = value.runOnJS(env0_6);
value(a0);
}
function _fun77853() { // fn#77853, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10132:1043, offset: 0x01e0e446, size: 29 bytes, params: 1, frame: 11
env0_6(index.get());
}
function _fun77850(a0) { // fn#77850, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10132:694, offset: 0x01e0e3d1, size: 65 bytes, params: 2, frame: 16
const property = sources[a0];
if (property == null) {
env0_4();
}
env0_5(computeClosePosition(windowWidth, windowHeight, property));
}
function useMediaViewerClosePositionF(a0) { // fn#77852, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10132:890, owner: useMediaViewerClosePosition.f, offset: 0x01e0e412, size: 52 bytes, params: 2, frame: 12
let value = environment.__proto__;
value = require(4017) /* metro dependency 4017: ReanimatedRexport */;
value = value.runOnJS(env0_6);
value(a0);
}
function _fun77853() { // fn#77853, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10132:1043, offset: 0x01e0e446, size: 29 bytes, params: 1, frame: 11
env0_6(index.get());
}
global.__d(_fun77846, 9946, [57, 31, 661, 9941, 8994, 4017,
2]) /* metro module 9946, dependencies: [57, 31, 661, 9941, 8994, 4017, 2] */;
@@ -1,9 +1,15 @@
/* Metro module 9939; source: modules/media_viewer/native/useMediaViewerPanGesture.tsx; dependencies: [31, 4017, 9551, 9547, 4577, 8994, 5321, 2] */
import UseStableCallback from '../../../hooks/useStableCallback.tsx'; /* Metro dependency 8994 */
import * as FileImportTrackerModule from '../../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
import * as ReactModule from '../../../by-id/module-00031-React.js'; /* Metro dependency 31 */
import * as ReanimatedRexportModule from '../../reanimated/ReanimatedRexport.tsx'; /* Metro dependency 4017 */
import * as SpringModule from '../../../design/animation/reanimated/spring/spring.tsx'; /* Metro dependency 4577 */
import * as Module05321Module from '../../../by-id/module-05321.js'; /* Metro dependency 5321 */
function _fun77785(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#77785, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10125:6, offset: 0x01e0bbfd, size: 232 bytes, params: 8, frame: 18
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_3 = importAll(31) /* metro dependency 31 */;
const env0_4 = {'damping': 15, 'mass': 1, 'stiffness': 250, 'overshootClamping': true, 'restSpeedThreshold': 0.001,
'restDisplacementThreshold': 0.001};
object = {code: 'function useMediaViewerPanGestureTsx1(){const{runOnJS,handleClose}=this.__closure;runOnJS(handleClose)();}'};
@@ -11,178 +17,178 @@ function _fun77785(global, require, importDefault, importAll, module, exports, d
object = {code: 'function useMediaViewerPanGestureTsx3(_,manager){const{enabled}=this.__closure;if(!enabled.get()){manager.fail();}}'};
object = {code: 'function useMediaViewerPanGestureTsx4({velocityY:velocityY,translationY:translationY}){const{translatePos,start,velocity}=this.__closure;translatePos.set(translationY+start.get().y);velocity.set(velocityY);}'};
object = {code: 'function useMediaViewerPanGestureTsx5(){const{start,translatePos,isInteracting}=this.__closure;start.set({x:0,y:translatePos.get()});isInteracting.set(true);}'};
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/media_viewer/native/useMediaViewerPanGesture.tsx');
(FileImportTrackerModule).fileFinishedImporting('modules/media_viewer/native/useMediaViewerPanGesture.tsx');
exports.useMediaViewerPanGestureConfig = useMediaViewerPanGestureConfig;
exports.useMediaViewerPanGesture = useMediaViewerPanGesture;
}
function useMediaViewerPanGestureConfig(a0, a1, a2) { // fn#77786, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10125:1385, offset: 0x01e0bce5, size: 339 bytes, params: 4, frame: 25
const env0_0 = a0;
const env0_1 = a1;
const env0_2 = a2;
const value2 = (ReanimatedRexportModule).useSharedValue(false);
const env0_3 = value2;
const value3 = (ReanimatedRexportModule).useSharedValue(false);
const value4 = (ReanimatedRexportModule).useSharedValue(0);
const value5 = (ReanimatedRexportModule).useSharedValue(0);
const value6 = (ReanimatedRexportModule).useSharedValue({'y': 0, 'x': 0});
const value7 = (ReanimatedRexportModule).useSharedValue(true);
const binding = env0_3;
let value = binding.useCallback(function() {
require(dependencyMap[2]).tryPauseCurrentVideo();
if (importDefault != null) {
importDefault();
}
var MediaViewerAnalytics = require(dependencyMap[3]).MediaViewerAnalytics;
MediaViewerAnalytics.markSessionCompleted();
}, [a2]);
value = binding.useCallback(_fun77788, [a0, value, value2, value4, value5]);
return binding.useMemo(_fun77790, [value5, value2, value3, value4, a1, value, value6, value7]);
function _fun77788() { // fn#77788, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10125:1757, offset: 0x01e0be96, size: 223 bytes, params: 1, frame: 25
let binding = env0_3;
let set = binding.set;
Reflect.apply(set, binding, [true]);
const r8 = env0_6.get() < 0 ? -env0_0 : env0_0;
binding = env0_5;
set = binding.set;
const withSpring = SpringModule.withSpring;
const object = {};
object.velocity = env0_6.get();
copyDataProperties(object, env1_4, undefined);
const t_777892 = t_77789;
const object2 = {};
object2.runOnJS = (require(4017) /* metro dependency 4017: ReanimatedRexport */).runOnJS;
object2.handleClose = env0_9;
t_777892.__closure = object2;
t_777892.__workletHash = 7033730772994;
t_777892.__initData = env1_5;
Reflect.apply(set, binding, [Reflect.apply(withSpring, SpringModule, [r8, object, 'respect-motion-settings',
t_777892])]);
function t_77789() { // fn#77789, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10125:1876, offset: 0x01e0bf75, size: 48 bytes, params: 1, frame: 12
let value = environment.__proto__.__proto__;
value = require(4017) /* metro dependency 4017: ReanimatedRexport */;
value.runOnJS(env1_9)();
}
function useMediaViewerPanGestureConfig(a0, a1, a2) { // fn#77786, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10125:1385, offset: 0x01e0bce5, size: 339 bytes, params: 4, frame: 25
const env0_0 = a0;
const env0_1 = a1;
const env0_2 = a2;
const value2 = (require(4017) /* metro dependency 4017: ReanimatedRexport */).useSharedValue(false);
const env0_3 = value2;
const value3 = (require(4017) /* metro dependency 4017: ReanimatedRexport */).useSharedValue(false);
const value4 = (require(4017) /* metro dependency 4017: ReanimatedRexport */).useSharedValue(0);
const value5 = (require(4017) /* metro dependency 4017: ReanimatedRexport */).useSharedValue(0);
const value6 = (require(4017) /* metro dependency 4017: ReanimatedRexport */).useSharedValue({'y': 0, 'x': 0});
const value7 = (require(4017) /* metro dependency 4017: ReanimatedRexport */).useSharedValue(true);
const binding = env0_3;
let value = binding.useCallback(function() {
require(dependencyMap[2]).tryPauseCurrentVideo();
if (importDefault != null) {
importDefault();
}
var MediaViewerAnalytics = require(dependencyMap[3]).MediaViewerAnalytics;
MediaViewerAnalytics.markSessionCompleted();
}, [a2]);
value = binding.useCallback(_fun77788, [a0, value, value2, value4, value5]);
return binding.useMemo(_fun77790, [value5, value2, value3, value4, a1, value, value6, value7]);
}
function useMediaViewerPanGesture({swipeVelocityThreshold, velocity, isInteracting, translatePos, start, dismiss}, a1) { // fn#77791, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10125:2213, offset: 0x01e0bff3, size: 187 bytes, params: 3, frame: 21
const env0_3 = translatePos;
const env0_5 = a1;
const value2 = (importDefault(8994) /* metro dependency 8994: useStableCallback */)(dismiss);
const binding = env0_3;
return binding.useMemo(_fun77797, [binding.useCallback(_fun77792, [value2, a1, isInteracting, start,
swipeVelocityThreshold, translatePos, velocity])]);
}
function _fun77788() { // fn#77788, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10125:1757, offset: 0x01e0be96, size: 223 bytes, params: 1, frame: 25
let binding = env0_3;
let set = binding.set;
Reflect.apply(set, binding, [true]);
const r8 = env0_6.get() < 0 ? -env0_0 : env0_0;
binding = env0_5;
set = binding.set;
const springModule = require(4577) /* metro dependency 4577: spring */;
const withSpring = springModule.withSpring;
const object3 = {};
object3.velocity = env0_6.get();
copyDataProperties(object3, env1_4, undefined);
const closure = t_77789;
const object4 = {};
object4.runOnJS = (require(4017) /* metro dependency 4017: ReanimatedRexport */).runOnJS;
object4.handleClose = env0_9;
closure.__closure = object4;
closure.__workletHash = 7033730772994;
closure.__initData = env1_5;
Reflect.apply(set, binding, [Reflect.apply(withSpring, springModule, [r8, object3, 'respect-motion-settings',
closure])]);
}
function _fun77790() { // fn#77790, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10125:2043, offset: 0x01e0bfa5, size: 78 bytes, params: 1, frame: 3
return {velocity: env0_6, isClosing: env0_3, isInteracting: env0_4, overlayEnabled: env0_8, translatePos: env0_5,
swipeVelocityThreshold: require, dismiss: env0_10, start: env0_7};
}
function _fun77792() { // fn#77792, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10125:2371, offset: 0x01e0c0ae, size: 458 bytes, params: 1, frame: 23
var object2;
const Gesture = (require(5321) /* metro dependency 5321 */).Gesture;
const value5 = Gesture.Pan().maxPointers(1).activeOffsetY([-10, 10]).failOffsetX([-10, 10]);
const onStart = value5.onStart;
let closure = function() {
var startBinding = start;
var object = {x: 0};
object.y = translatePos.get();
startBinding.set(object);
isInteracting.set(true);
};
let startBinding = start;
const translatePosBinding = translatePos;
const isInteractingBinding = isInteracting;
closure.__closure = {start: startBinding, translatePos: translatePosBinding, isInteracting: isInteractingBinding};
closure.__workletHash = 12024094550213;
closure.__initData = env1_9;
const value7 = Reflect.apply(onStart, value5, [closure]);
const onUpdate = value7.onUpdate;
closure = function({velocityY, translationY}) {
translatePos.set(translationY + start.get().y);
velocity.set(velocityY);
};
const velocityBinding = velocity;
closure.__closure = {translatePos: translatePosBinding, start: startBinding, velocity: velocityBinding};
closure.__workletHash = 9790035695747;
closure.__initData = env1_8;
const value8 = Reflect.apply(onUpdate, value7, [closure]);
const onTouchesDown = value8.onTouchesDown;
closure = function(a0, a1) {
if (!require.get()) {
a1.fail();
function _fun77790() { // fn#77790, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10125:2043, offset: 0x01e0bfa5, size: 78 bytes, params: 1, frame: 3
return {velocity: env0_6, isClosing: env0_3, isInteracting: env0_4, overlayEnabled: env0_8, translatePos: env0_5,
swipeVelocityThreshold: require, dismiss: env0_10, start: env0_7};
}
};
closure.__closure = {enabled: require};
closure.__workletHash = 10675684732258;
closure.__initData = env1_7;
const value9 = Reflect.apply(onTouchesDown, value8, [closure]);
const onEnd = value9.onEnd;
closure = t_77796;
object2 = {isInteracting: isInteractingBinding, velocity: velocityBinding};
object2.swipeVelocityThreshold = swipeVelocityThreshold;
object2.runOnJS = (require(4017) /* metro dependency 4017: ReanimatedRexport */).runOnJS;
object2.dismiss = env0_6;
object2.translatePos = translatePosBinding;
object2.withSpring = (require(4577) /* metro dependency 4577: spring */).withSpring;
object2.SPRING_CONFIG = env1_4;
closure.__closure = object2;
closure.__workletHash = 3185523772752;
closure.__initData = env1_6;
return Reflect.apply(onEnd, value9, [closure]);
}
function _fun77797() { // fn#77797, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10125:3321, offset: 0x01e0c3f5, size: 76 bytes, params: 1, frame: 12
var environment;
let value = environment.__proto__;
const Gesture = (require(5321) /* metro dependency 5321 */).Gesture;
value = Gesture.Native();
const env0_1 = [];
return {panGestureGenerator: panGestureGenerator, nativeGesture: value};
}
function t_77789() { // fn#77789, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10125:1876, offset: 0x01e0bf75, size: 48 bytes, params: 1, frame: 12
let value = environment.__proto__.__proto__;
value = require(4017) /* metro dependency 4017: ReanimatedRexport */;
value.runOnJS(env1_9)();
}
function t_77796() { // fn#77796, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10125:2934, offset: 0x01e0c322, size: 211 bytes, params: 1, frame: 19
var translatePosBinding;
var value4;
var moduleValue;
var withSpring;
var object2;
var value5;
var moduleValue2;
isInteracting.set(false);
const Math = global.Math;
const abs = Math.abs;
const get = velocity.get;
if (Reflect.apply(abs, Math, [Reflect.apply(get, velocityBinding, [])]) > swipeVelocityThreshold) {
value5 = environment.__proto__.__proto__;
moduleValue2 = require(4017) /* metro dependency 4017: ReanimatedRexport */;
moduleValue2.runOnJS(env1_6)();
} else if (translatePos.get() !== 0) {
translatePosBinding = translatePos;
set = translatePosBinding.set;
value4 = environment.__proto__.__proto__;
moduleValue = require(4577) /* metro dependency 4577: spring */;
withSpring = moduleValue.withSpring;
object2 = {};
velocityBinding = velocity;
object2.velocity = velocityBinding.get();
copyDataProperties(object2, env2_4, velocityBinding);
Reflect.apply(set, translatePosBinding, [Reflect.apply(withSpring, moduleValue, [0, object2])]);
}
}
function panGestureGenerator(a0) { // fn#77798, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10125:3389, offset: 0x01e0c441, size: 72 bytes, params: 2, frame: 14
if (env0_1[a0] != null) {
return env0_1[a0];
function useMediaViewerPanGesture({swipeVelocityThreshold, velocity, isInteracting, translatePos, start, dismiss}, a1) { // fn#77791, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10125:2213, offset: 0x01e0bff3, size: 187 bytes, params: 3, frame: 21
const translatePos2 = translatePos;
const env0_5 = a1;
const value2 = (UseStableCallback)(dismiss);
const binding = translatePos2;
return binding.useMemo(_fun77797, [binding.useCallback(_fun77792, [value2, a1, isInteracting, start,
swipeVelocityThreshold, translatePos, velocity])]);
function _fun77792() { // fn#77792, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10125:2371, offset: 0x01e0c0ae, size: 458 bytes, params: 1, frame: 23
const Gesture = (Module05321Module).Gesture;
const value5 = Gesture.Pan().maxPointers(1).activeOffsetY([-10, 10]).failOffsetX([-10, 10]);
const onStart = value5.onStart;
let closure = function() {
var startBinding = start;
var object = {x: 0};
object.y = translatePos.get();
startBinding.set(object);
isInteracting.set(true);
};
let startBinding = start;
const translatePosBinding = translatePos;
const isInteractingBinding = isInteracting;
closure.__closure = {start: startBinding, translatePos: translatePosBinding, isInteracting: isInteractingBinding};
closure.__workletHash = 12024094550213;
closure.__initData = env1_9;
const value7 = Reflect.apply(onStart, value5, [closure]);
const onUpdate = value7.onUpdate;
closure = function({velocityY, translationY}) {
translatePos.set(translationY + start.get().y);
velocity.set(velocityY);
};
const velocityBinding = velocity;
closure.__closure = {translatePos: translatePosBinding, start: startBinding, velocity: velocityBinding};
closure.__workletHash = 9790035695747;
closure.__initData = env1_8;
const value8 = Reflect.apply(onUpdate, value7, [closure]);
const onTouchesDown = value8.onTouchesDown;
closure = function(a0, a1) {
if (!require.get()) {
a1.fail();
}
};
closure.__closure = {enabled: require};
closure.__workletHash = 10675684732258;
closure.__initData = env1_7;
const value9 = Reflect.apply(onTouchesDown, value8, [closure]);
const onEnd = value9.onEnd;
closure = t_77796;
object = {isInteracting: isInteractingBinding, velocity: velocityBinding};
object.swipeVelocityThreshold = swipeVelocityThreshold;
object.runOnJS = (require(4017) /* metro dependency 4017: ReanimatedRexport */).runOnJS;
object.dismiss = env0_6;
object.translatePos = translatePosBinding;
object.withSpring = (require(4577) /* metro dependency 4577: spring */).withSpring;
object.SPRING_CONFIG = env1_4;
closure.__closure = object;
closure.__workletHash = 3185523772752;
closure.__initData = env1_6;
return Reflect.apply(onEnd, value9, [closure]);
function t_77796() { // fn#77796, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10125:2934, offset: 0x01e0c322, size: 211 bytes, params: 1, frame: 19
var translatePosBinding;
var value4;
var moduleValue;
var withSpring;
var object;
var value5;
var moduleValue2;
isInteracting.set(false);
const Math = global.Math;
const abs = Math.abs;
const get = velocity.get;
if (Reflect.apply(abs, Math, [Reflect.apply(get, velocityBinding, [])]) > swipeVelocityThreshold) {
value5 = environment.__proto__.__proto__;
moduleValue2 = require(4017) /* metro dependency 4017: ReanimatedRexport */;
moduleValue2.runOnJS(env1_6)();
} else if (translatePos.get() !== 0) {
translatePosBinding = translatePos;
set = translatePosBinding.set;
value4 = environment.__proto__.__proto__;
moduleValue = require(4577) /* metro dependency 4577: spring */;
withSpring = moduleValue.withSpring;
object = {};
velocityBinding = velocity;
object.velocity = velocityBinding.get();
copyDataProperties(object, env2_4, velocityBinding);
Reflect.apply(set, translatePosBinding, [Reflect.apply(withSpring, moduleValue, [0, object])]);
}
}
}
function _fun77797() { // fn#77797, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10125:3321, offset: 0x01e0c3f5, size: 76 bytes, params: 1, frame: 12
var environment;
let value = environment.__proto__;
const Gesture = (Module05321Module).Gesture;
value = Gesture.Native();
const env0_1 = [];
return {panGestureGenerator: panGestureGenerator, nativeGesture: value};
function panGestureGenerator(a0) { // fn#77798, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10125:3389, offset: 0x01e0c441, size: 72 bytes, params: 2, frame: 14
if (env0_1[a0] != null) {
return env0_1[a0];
}
const value3 = env1_7();
const binding = env0_1;
binding[a0] = value3.blocksExternalGesture(env0_0);
return binding[a0];
}
}
}
const value3 = env1_7();
const binding = env0_1;
binding[a0] = value3.blocksExternalGesture(env0_0);
return binding[a0];
}
global.__d(_fun77785, 9939, [31, 4017, 9551, 9547, 4577, 8994, 5321,
2]) /* metro module 9939, dependencies: [31, 4017, 9551, 9547, 4577, 8994, 5321, 2] */;
@@ -1,4 +1,6 @@
/* Metro module 9545; source: modules/media_viewer/native/useMediaViewerSources.tsx; dependencies: [4024, 9546, 2] */
import * as FileImportTrackerModule from '../../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
function _fun74484(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#74484, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9731:6, offset: 0x01d8f01d, size: 161 bytes, params: 8, frame: 18
const env0_0 = require;
const Object = global.Object;
@@ -7,57 +9,58 @@ function _fun74484(global, require, importDefault, importAll, module, exports, d
var Set = global.Set;
return {sources: [], spoilerIndexes: new Set()};
});
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/media_viewer/native/useMediaViewerSources.tsx');
(FileImportTrackerModule).fileFinishedImporting('modules/media_viewer/native/useMediaViewerSources.tsx');
exports.MediaViewerSourcesStore = zustandStore;
exports.setMediaViewerSources = setMediaViewerSources;
exports.removeSpoiler = removeSpoiler;
exports.toggleSpoiler = toggleSpoiler;
}
function setMediaViewerSources({sources, initialIndex}) { // fn#74486, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9731:313, offset: 0x01d8f0ec, size: 122 bytes, params: 2, frame: 14
if (initialIndex !== undefined) {
}
const Set = global.Set;
const set = new Set();
const set2 = set;
sources.forEach(_fun74487);
const binding = set2;
binding.setState({sources: [], spoilerIndexes: set});
function _fun74487(a0, a1) { // fn#74487, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9731:407, offset: 0x01d8f166, size: 122 bytes, params: 3, frame: 15
let value = environment.__proto__;
value = require(9546) /* metro dependency 9546: MediaSourceUtil */;
value = value.flattenSource(a0);
if (value != null && (value.spoiler || value.obscure) && initialIndex !== a1) {
env0_2.add(a1);
}
env0_1.push(a0);
}
function setMediaViewerSources({sources, initialIndex}) { // fn#74486, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9731:313, offset: 0x01d8f0ec, size: 122 bytes, params: 2, frame: 14
if (initialIndex !== undefined) {
}
const Set = global.Set;
const set = new Set();
const env0_2 = set;
sources.forEach(_fun74487);
const binding = env0_2;
binding.setState({sources: [], spoilerIndexes: set});
}
function removeSpoiler(a0) { // fn#74488, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9731:566, offset: 0x01d8f1e0, size: 105 bytes, params: 2, frame: 13
var set;
let binding = env0_2;
const field = binding.getField('spoilerIndexes');
if (field.has(a0)) {
set = new global.Set(field);
set.delete(a0);
function removeSpoiler(a0) { // fn#74488, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9731:566, offset: 0x01d8f1e0, size: 105 bytes, params: 2, frame: 13
var set;
let binding = env0_2;
const field = binding.getField('spoilerIndexes');
if (field.has(a0)) {
set = new global.Set(field);
set.delete(a0);
binding = env0_2;
binding.setState({spoilerIndexes: set});
}
}
function toggleSpoiler(a0) { // fn#74489, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9731:718, offset: 0x01d8f249, size: 114 bytes, params: 2, frame: 13
let binding = env0_2;
const field = binding.getField('spoilerIndexes');
const Set = global.Set;
const set = new Set(field);
if (set.has(a0)) {
set.delete(a0);
} else {
set.add(a0);
}
binding = env0_2;
binding.setState({spoilerIndexes: set});
}
}
function toggleSpoiler(a0) { // fn#74489, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9731:718, offset: 0x01d8f249, size: 114 bytes, params: 2, frame: 13
let binding = env0_2;
const field = binding.getField('spoilerIndexes');
const Set = global.Set;
const set = new Set(field);
if (set.has(a0)) {
set.delete(a0);
} else {
set.add(a0);
}
binding = env0_2;
binding.setState({spoilerIndexes: set});
}
function _fun74487(a0, a1) { // fn#74487, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9731:407, offset: 0x01d8f166, size: 122 bytes, params: 3, frame: 15
let value = environment.__proto__;
value = require(9546) /* metro dependency 9546: MediaSourceUtil */;
value = value.flattenSource(a0);
if (value != null && (value.spoiler || value.obscure) && initialIndex !== a1) {
env0_2.add(a1);
}
env0_1.push(a0);
}
global.__d(_fun74484, 9545, [4024, 9546, 2]) /* metro module 9545, dependencies: [4024, 9546, 2] */;
File diff suppressed because it is too large. Load diff
@@ -1,49 +1,58 @@
/* Metro module 9826; source: modules/media_viewer/native/useMessagePreviewHeight.tsx; dependencies: [629, 690, 2] */
import * as FileImportTrackerModule from '../../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
import * as Module00629Module from '../../../by-id/module-00629.js'; /* Metro dependency 629 */
import * as ReactBatchUpdatesNativeModule from '../../../external/discord_common/js/shared/utils/ReactBatchUpdates.native.tsx'; /* Metro dependency 690 */
function _fun76929(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#76929, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10012:6, offset: 0x01de9c61, size: 194 bytes, params: 8, frame: 18
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
let value = require(629) /* metro dependency 629 */;
let value = Module00629Module;
value = value.create(function() {
return {'collapsedHeight': 0, 'expandedHeight': 0};
});
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/media_viewer/native/useMessagePreviewHeight.tsx');
(FileImportTrackerModule).fileFinishedImporting('modules/media_viewer/native/useMessagePreviewHeight.tsx');
exports.useMessagePreviewHeightStore = value;
exports.useMessagePreviewCollapsedheight = useMessagePreviewCollapsedheight;
exports.useMessagePreviewExpandedHeight = useMessagePreviewExpandedHeight;
exports.setMesssagePreviewHeight = setMesssagePreviewHeight;
exports.setMesssagePreviewCollapsedHeight = setMesssagePreviewCollapsedHeight;
exports.setMesssagePreviewExpandedHeight = setMesssagePreviewExpandedHeight;
function useMessagePreviewCollapsedheight() { // fn#76931, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10012:316, offset: 0x01de9d2f, size: 21 bytes, params: 1, frame: 9
return env0_2().collapsedHeight;
}
function useMessagePreviewExpandedHeight() { // fn#76932, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10012:422, offset: 0x01de9d44, size: 21 bytes, params: 1, frame: 9
return env0_2().expandedHeight;
}
function setMesssagePreviewHeight(a0) { // fn#76933, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10012:519, offset: 0x01de9d59, size: 54 bytes, params: 2, frame: 12
const env0_0 = a0;
(ReactBatchUpdatesNativeModule).batchUpdates(_fun76934);
function _fun76934() { // fn#76934, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10012:578, offset: 0x01167ebf, size: 27 bytes, params: 1, frame: 11
return env1_2.setState(env0_0);
}
}
function setMesssagePreviewCollapsedHeight(a0) { // fn#76935, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10012:635, offset: 0x01de9d8f, size: 54 bytes, params: 2, frame: 12
const env0_0 = a0;
(ReactBatchUpdatesNativeModule).batchUpdates(_fun76936);
function _fun76936() { // fn#76936, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10012:703, offset: 0x01de9dc5, size: 34 bytes, params: 1, frame: 12
return env1_2.setState({collapsedHeight: env0_0});
}
}
function setMesssagePreviewExpandedHeight(a0) { // fn#76937, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10012:777, offset: 0x01de9de7, size: 54 bytes, params: 2, frame: 12
const env0_0 = a0;
(ReactBatchUpdatesNativeModule).batchUpdates(_fun76938);
function _fun76938() { // fn#76938, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10012:844, offset: 0x01de9e1d, size: 34 bytes, params: 1, frame: 12
return env1_2.setState({expandedHeight: env0_0});
}
}
}
function useMessagePreviewCollapsedheight() { // fn#76931, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10012:316, offset: 0x01de9d2f, size: 21 bytes, params: 1, frame: 9
return env0_2().collapsedHeight;
}
function useMessagePreviewExpandedHeight() { // fn#76932, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10012:422, offset: 0x01de9d44, size: 21 bytes, params: 1, frame: 9
return env0_2().expandedHeight;
}
function setMesssagePreviewHeight(a0) { // fn#76933, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10012:519, offset: 0x01de9d59, size: 54 bytes, params: 2, frame: 12
const env0_0 = a0;
(require(690) /* metro dependency 690: ReactBatchUpdatesNative */).batchUpdates(_fun76934);
}
function setMesssagePreviewCollapsedHeight(a0) { // fn#76935, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10012:635, offset: 0x01de9d8f, size: 54 bytes, params: 2, frame: 12
const env0_0 = a0;
(require(690) /* metro dependency 690: ReactBatchUpdatesNative */).batchUpdates(_fun76936);
}
function setMesssagePreviewExpandedHeight(a0) { // fn#76937, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10012:777, offset: 0x01de9de7, size: 54 bytes, params: 2, frame: 12
const env0_0 = a0;
(require(690) /* metro dependency 690: ReactBatchUpdatesNative */).batchUpdates(_fun76938);
}
function _fun76936() { // fn#76936, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10012:703, offset: 0x01de9dc5, size: 34 bytes, params: 1, frame: 12
return env1_2.setState({collapsedHeight: env0_0});
}
function _fun76938() { // fn#76938, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10012:844, offset: 0x01de9e1d, size: 34 bytes, params: 1, frame: 12
return env1_2.setState({expandedHeight: env0_0});
}
global.__d(_fun76929, 9826, [629, 690, 2]) /* metro module 9826, dependencies: [629, 690, 2] */;
@@ -1,88 +1,93 @@
/* Metro module 9806; source: modules/media_viewer/native/useOverlayLayoutDriver.tsx; dependencies: [31, 4017, 9562, 4504, 1305, 2] */
import * as FileImportTrackerModule from '../../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
import * as ReactModule from '../../../by-id/module-00031-React.js'; /* Metro dependency 31 */
import * as NativeModule from '../../../design/void/native.tsx'; /* Metro dependency 1305 */
import * as ReanimatedRexportModule from '../../reanimated/ReanimatedRexport.tsx'; /* Metro dependency 4017 */
import * as MediaViewerDimensionsContextModule from './MediaViewerDimensionsContext.tsx'; /* Metro dependency 9562 */
function _fun76808(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#76808, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9992:6, offset: 0x01de5ac9, size: 172 bytes, params: 8, frame: 18
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_2 = importAll(31) /* metro dependency 31 */;
object = {code: 'function useOverlayLayoutDriverTsx1(){const{interpolate,animationDriver}=this.__closure;return{transform:[{translateY:interpolate(animationDriver.get(),[0,0.75,1],[-50,-50,0])}],opacity:interpolate(animationDriver.get(),[0,0.75,1],[0,0,1])};}'};
object = {code: 'function useOverlayLayoutDriverTsx2(){const{interpolate,animationDriver}=this.__closure;return{transform:[{translateY:interpolate(animationDriver.get(),[0,0.75,1],[50,50,0])}],opacity:interpolate(animationDriver.get(),[0,0.75,1],[0,0,1])};}'};
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/media_viewer/native/useOverlayLayoutDriver.tsx');
(FileImportTrackerModule).fileFinishedImporting('modules/media_viewer/native/useOverlayLayoutDriver.tsx');
exports.useOverlayLayoutDriver = useOverlayLayoutDriver;
exports.useHeaderLayoutAnimation = useHeaderLayoutAnimation;
exports.useFooterLayoutAnimation = useFooterLayoutAnimation;
function useOverlayLayoutDriver() { // fn#76809, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9992:733, offset: 0x01de5b75, size: 116 bytes, params: 1, frame: 17
const value2 = (ReanimatedRexportModule).useSharedValue(0);
const {height,
width} = (MediaViewerDimensionsContextModule).useMediaViewerDimensions();
ReactModule.useEffect(_fun76810, [value2, height, width]);
return value2;
function _fun76810() { // fn#76810, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9992:877, offset: 0x01de5be9, size: 93 bytes, params: 1, frame: 18
const binding = env0_0;
const set = binding.set;
let value = environment.__proto__;
value = require(4504) /* metro dependency 4504: timing */;
const withTiming = value.withTiming;
const STANDARD_EASING = (NativeModule).STANDARD_EASING;
Reflect.apply(set, binding, [Reflect.apply(withTiming, value, [1, {duration: 300, easing: STANDARD_EASING}])]);
}
}
function useHeaderLayoutAnimation(a0) { // fn#76811, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9992:998, offset: 0x01de5c46, size: 113 bytes, params: 2, frame: 18
const env0_0 = a0;
const useAnimatedStyle = ReanimatedRexportModule.useAnimatedStyle;
const useHeaderLayoutAnimationO2 = useHeaderLayoutAnimationO;
const object = {};
object.interpolate = ReanimatedRexportModule.interpolate;
object.animationDriver = a0;
useHeaderLayoutAnimationO2.__closure = object;
useHeaderLayoutAnimationO2.__workletHash = 13622939479876;
useHeaderLayoutAnimationO2.__initData = env0_3;
return Reflect.apply(useAnimatedStyle, ReanimatedRexportModule, [useHeaderLayoutAnimationO2]);
function useHeaderLayoutAnimationO() { // fn#76812, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9992:1071, owner: useHeaderLayoutAnimation.o, offset: 0x01de5cb7, size: 166 bytes, params: 1, frame: 23
const object = {};
const object2 = {};
let value = environment.__proto__;
value = require(4017) /* metro dependency 4017: ReanimatedRexport */;
const interpolate = value.interpolate;
const binding = env0_0;
object2.translateY = Reflect.apply(interpolate, value, [binding.get(), [0, 0.75, 1], [-50, -50, 0]]);
object.transform = [object2];
value = require(4017) /* metro dependency 4017: ReanimatedRexport */;
object.opacity = value.interpolate(binding.get(), [0, 0.75, 1], [0, 0, 1]);
return object;
}
}
function useFooterLayoutAnimation(a0) { // fn#76813, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9992:1368, offset: 0x01de5d5d, size: 113 bytes, params: 2, frame: 18
const env0_0 = a0;
const useAnimatedStyle = ReanimatedRexportModule.useAnimatedStyle;
const useFooterLayoutAnimationN2 = useFooterLayoutAnimationN;
const object = {};
object.interpolate = ReanimatedRexportModule.interpolate;
object.animationDriver = a0;
useFooterLayoutAnimationN2.__closure = object;
useFooterLayoutAnimationN2.__workletHash = 15220711492711;
useFooterLayoutAnimationN2.__initData = env0_4;
return Reflect.apply(useAnimatedStyle, ReanimatedRexportModule, [useFooterLayoutAnimationN2]);
function useFooterLayoutAnimationN() { // fn#76814, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9992:1441, owner: useFooterLayoutAnimation.n, offset: 0x01de5dce, size: 152 bytes, params: 1, frame: 22
const object = {};
const object2 = {};
let value = environment.__proto__;
value = require(4017) /* metro dependency 4017: ReanimatedRexport */;
const interpolate = value.interpolate;
const binding = env0_0;
object2.translateY = Reflect.apply(interpolate, value, [binding.get(), [0, 0.75, 1], [50, 50, 0]]);
object.transform = [object2];
value = require(4017) /* metro dependency 4017: ReanimatedRexport */;
object.opacity = value.interpolate(binding.get(), [0, 0.75, 1], [0, 0, 1]);
return object;
}
}
}
function useOverlayLayoutDriver() { // fn#76809, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9992:733, offset: 0x01de5b75, size: 116 bytes, params: 1, frame: 17
const value2 = (require(4017) /* metro dependency 4017: ReanimatedRexport */).useSharedValue(0);
const {height,
width} = (require(9562) /* metro dependency 9562: MediaViewerDimensionsContext */).useMediaViewerDimensions();
env0_2.useEffect(_fun76810, [value2, height, width]);
return value2;
}
function useHeaderLayoutAnimation(a0) { // fn#76811, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9992:998, offset: 0x01de5c46, size: 113 bytes, params: 2, frame: 18
const env0_0 = a0;
const reanimatedRexportModule = require(4017) /* metro dependency 4017: ReanimatedRexport */;
const useAnimatedStyle = reanimatedRexportModule.useAnimatedStyle;
const closure = useHeaderLayoutAnimationO;
const object2 = {};
object2.interpolate = reanimatedRexportModule.interpolate;
object2.animationDriver = a0;
closure.__closure = object2;
closure.__workletHash = 13622939479876;
closure.__initData = env0_3;
return Reflect.apply(useAnimatedStyle, reanimatedRexportModule, [closure]);
}
function useFooterLayoutAnimation(a0) { // fn#76813, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9992:1368, offset: 0x01de5d5d, size: 113 bytes, params: 2, frame: 18
const env0_0 = a0;
const reanimatedRexportModule = require(4017) /* metro dependency 4017: ReanimatedRexport */;
const useAnimatedStyle = reanimatedRexportModule.useAnimatedStyle;
const closure = useFooterLayoutAnimationN;
const object2 = {};
object2.interpolate = reanimatedRexportModule.interpolate;
object2.animationDriver = a0;
closure.__closure = object2;
closure.__workletHash = 15220711492711;
closure.__initData = env0_4;
return Reflect.apply(useAnimatedStyle, reanimatedRexportModule, [closure]);
}
function _fun76810() { // fn#76810, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9992:877, offset: 0x01de5be9, size: 93 bytes, params: 1, frame: 18
const binding = env0_0;
const set = binding.set;
let value = environment.__proto__;
value = require(4504) /* metro dependency 4504: timing */;
const withTiming = value.withTiming;
const STANDARD_EASING = (require(1305) /* metro dependency 1305: native */).STANDARD_EASING;
Reflect.apply(set, binding, [Reflect.apply(withTiming, value, [1, {duration: 300, easing: STANDARD_EASING}])]);
}
function useHeaderLayoutAnimationO() { // fn#76812, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9992:1071, owner: useHeaderLayoutAnimation.o, offset: 0x01de5cb7, size: 166 bytes, params: 1, frame: 23
const object3 = {};
const object4 = {};
let value = environment.__proto__;
value = require(4017) /* metro dependency 4017: ReanimatedRexport */;
const interpolate = value.interpolate;
const binding = env0_0;
object4.translateY = Reflect.apply(interpolate, value, [binding.get(), [0, 0.75, 1], [-50, -50, 0]]);
object3.transform = [object4];
value = require(4017) /* metro dependency 4017: ReanimatedRexport */;
object3.opacity = value.interpolate(binding.get(), [0, 0.75, 1], [0, 0, 1]);
return object3;
}
function useFooterLayoutAnimationN() { // fn#76814, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9992:1441, owner: useFooterLayoutAnimation.n, offset: 0x01de5dce, size: 152 bytes, params: 1, frame: 22
const object3 = {};
const object4 = {};
let value = environment.__proto__;
value = require(4017) /* metro dependency 4017: ReanimatedRexport */;
const interpolate = value.interpolate;
const binding = env0_0;
object4.translateY = Reflect.apply(interpolate, value, [binding.get(), [0, 0.75, 1], [50, 50, 0]]);
object3.transform = [object4];
value = require(4017) /* metro dependency 4017: ReanimatedRexport */;
object3.opacity = value.interpolate(binding.get(), [0, 0.75, 1], [0, 0, 1]);
return object3;
}
global.__d(_fun76808, 9806, [31, 4017, 9562, 4504, 1305,
2]) /* metro module 9806, dependencies: [31, 4017, 9562, 4504, 1305, 2] */;
@@ -1,150 +1,173 @@
/* Metro module 9551; source: modules/media_viewer/native/useVideoControls.tsx; dependencies: [57, 31, 4502, 33, 629, 690, 9552, 4501, 566, 9545, 6266, 9546, 9553, 2] */
import Module00057 from '../../../by-id/module-00057.js'; /* Metro dependency 57 */
import AccessibilityStore from '../../a11y/AccessibilityStore.tsx'; /* Metro dependency 4502 */
import UsePrevious from '../../../hooks/usePrevious.tsx'; /* Metro dependency 6266 */
import * as FileImportTrackerModule from '../../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
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 Module00629Module from '../../../by-id/module-00629.js'; /* Metro dependency 629 */
import * as ReactBatchUpdatesNativeModule from '../../../external/discord_common/js/shared/utils/ReactBatchUpdates.native.tsx'; /* Metro dependency 690 */
import * as CreateStylesModule from '../../../design/components/Styles/native/createStyles.tsx'; /* Metro dependency 4501 */
import * as UseMediaViewerSourcesModule from './useMediaViewerSources.tsx'; /* Metro dependency 9545 */
import * as MediaPlayerMuteManagerModule from './MediaPlayerMuteManager.tsx'; /* Metro dependency 9552 */
function _fun74566(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#74566, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9737:6, offset: 0x01d9238f, size: 346 bytes, params: 8, frame: 21
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_3 = importDefault(57) /* metro dependency 57 */;
const env0_4 = importAll(31) /* metro dependency 31 */;
const accessibilityStore = importDefault(4502) /* metro dependency 4502: AccessibilityStore */;
const env0_6 = (require(33) /* metro dependency 33 */).jsx;
let value = require(629) /* metro dependency 629 */;
let value = Module00629Module;
value = value.create(function() {
return {controls: undefined, paused: false};
});
const env0_8 = (require(4501) /* metro dependency 4501: createStyles */).createStyles({slider: {marginBottom: 8}});
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/media_viewer/native/useVideoControls.tsx');
const env0_8 = (CreateStylesModule).createStyles({slider: {marginBottom: 8}});
(FileImportTrackerModule).fileFinishedImporting('modules/media_viewer/native/useVideoControls.tsx');
exports.default = useVideoControls;
exports.useVideoStateStore = value;
exports.initVideoStateStore = initVideoStateStore;
exports.setMuted = setMuted;
exports.setMuted = setMuted_74575;
exports.toggleMuted = toggleMuted;
exports.setVideoStateControls = setVideoStateControls;
exports.setPausedState = setPausedState;
exports.tryPauseCurrentVideo = tryPauseCurrentVideo;
exports.unpauseCurrentVideoIfNeeded = unpauseCurrentVideoIfNeeded;
}
function useVideoControls(a0, a1, a2) { // fn#74568, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9737:254, offset: 0x01d924fb, size: 435 bytes, params: 4, frame: 28
const env0_0 = a0;
const env0_1 = a2;
const styles = useStyles();
const useReducedMotion = (require(566) /* metro dependency 566: flux */).useStateFromStores([AccessibilityStore],
function() {
return AccessibilityStore.useReducedMotion;
});
let binding = env0_4;
const [property, property2] = Module00057(binding.useState(false), 2);
const MediaViewerSourcesStore = (UseMediaViewerSourcesModule).MediaViewerSourcesStore;
const value4 = MediaViewerSourcesStore.useState(_fun74570);
var env0_4 = value4;
const value5 = (UsePrevious)(a0);
const r1 = a2 != null && (require(9546) /* metro dependency 9546: MediaSourceUtil */).supportOverlayVideoControls(a1);
const r2 = a1.portal ?? a1.videoURI;
const value8 = (UsePrevious)(r2);
binding = env0_4;
binding.useEffect(_fun74571, [a2, r2, useReducedMotion, value8, value4, value5, a0]);
if (r1) {
return ((Component) => <Component style={styles.slider} controls={a2} paused={property} setPaused={property2} onPlayPress={binding.useCallback(_fun74572,
[a0])} key={r2} />)(importDefault(9553) /* metro dependency 9553: MediaSlider */);
}
function _fun74570({spoilerIndexes}) { // fn#74570, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9737:442, offset: 0x01d926ae, size: 28 bytes, params: 2, frame: 11
return spoilerIndexes.has(env0_0);
}
function useVideoControls(a0, a1, a2) { // fn#74568, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9737:254, offset: 0x01d924fb, size: 435 bytes, params: 4, frame: 28
const env0_0 = a0;
const env0_1 = a2;
const styles = useStyles();
const useReducedMotion = (require(566) /* metro dependency 566: flux */).useStateFromStores([AccessibilityStore],
function() {
return AccessibilityStore.useReducedMotion;
});
let binding = env0_4;
const [property, property2] = env0_3(binding.useState(false), 2);
const MediaViewerSourcesStore = (require(9545) /* metro dependency 9545: useMediaViewerSources */).MediaViewerSourcesStore;
const value4 = MediaViewerSourcesStore.useState(_fun74570);
var env0_4 = value4;
const value5 = (importDefault(6266) /* metro dependency 6266: usePrevious */)(a0);
const r1 = a2 != null && (require(9546) /* metro dependency 9546: MediaSourceUtil */).supportOverlayVideoControls(a1);
const r2 = a1.portal ?? a1.videoURI;
const value8 = (importDefault(6266) /* metro dependency 6266: usePrevious */)(r2);
binding = env0_4;
binding.useEffect(_fun74571, [a2, r2, useReducedMotion, value8, value4, value5, a0]);
if (r1) {
return ((Component) => <Component style={styles.slider} controls={a2} paused={property} setPaused={property2} onPlayPress={binding.useCallback(_fun74572,
[a0])} key={r2} />)(importDefault(9553) /* metro dependency 9553: MediaSlider */);
}
}
function initVideoStateStore() { // fn#74573, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9737:982, offset: 0x01d9275e, size: 47 bytes, params: 1, frame: 12
(require(690) /* metro dependency 690: ReactBatchUpdatesNative */).batchUpdates(_fun74574);
}
function setMuted(a0) { // fn#74575, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9737:1095, offset: 0x01d927b1, size: 54 bytes, params: 2, frame: 12
const env0_0 = a0;
(require(690) /* metro dependency 690: ReactBatchUpdatesNative */).batchUpdates(_fun74576);
}
function toggleMuted() { // fn#74577, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9737:1216, offset: 0x01d92821, size: 47 bytes, params: 1, frame: 12
(require(690) /* metro dependency 690: ReactBatchUpdatesNative */).batchUpdates(function() {
var useMediaPlayerMutedStore = require(dependencyMap[6]).useMediaPlayerMutedStore;
useMediaPlayerMutedStore.setState(_fun74579);
});
}
function setVideoStateControls(a0) { // fn#74580, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9737:1365, offset: 0x01d9289a, size: 54 bytes, params: 2, frame: 12
const env0_0 = a0;
(require(690) /* metro dependency 690: ReactBatchUpdatesNative */).batchUpdates(_fun74581);
}
function setPausedState(a0) { // fn#74582, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9737:1470, offset: 0x01d928f2, size: 54 bytes, params: 2, frame: 12
const env0_0 = a0;
(require(690) /* metro dependency 690: ReactBatchUpdatesNative */).batchUpdates(_fun74583);
}
function tryPauseCurrentVideo() { // fn#74584, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9737:1572, offset: 0x01d9294a, size: 46 bytes, params: 1, frame: 11
const binding = env0_7;
const getState = binding.getState;
const controls = Reflect.apply(getState, binding, []).controls;
if (controls != null) {
controls.pause(true);
}
}
function unpauseCurrentVideoIfNeeded() { // fn#74585, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9737:1686, offset: 0x01d92978, size: 77 bytes, params: 1, frame: 13
var r1;
var r3;
var controls;
let binding = env0_7;
const getState = binding.getState;
const paused = Reflect.apply(getState, binding, []).paused;
const value2 = undefined;
if (paused) {
r1 = paused;
r3 = value2;
} else {
binding = env0_7;
controls = binding.getState().controls;
r1 = controls == null;
r3 = controls;
}
if (!r1) {
r3.pause(false);
}
return value2;
}
function _fun74571() { // fn#74571, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9737:597, offset: 0x01d926ca, size: 103 bytes, params: 1, frame: 12
var r2;
if (env0_5 !== env0_0) {
if (env0_5 != null) {
if (env0_6 != null) {
if (env0_7 !== env0_6) {
importDefault.seek(0);
r2 = env0_4 || useReducedMotion;
importDefault.pause(r2);
env0_3(r2);
function _fun74571() { // fn#74571, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9737:597, offset: 0x01d926ca, size: 103 bytes, params: 1, frame: 12
var r2;
if (env0_5 !== env0_0) {
if (env0_5 != null) {
if (JsxRuntimeModule.jsx != null) {
if (env0_7 !== JsxRuntimeModule.jsx) {
importDefault.seek(0);
r2 = env0_4 || useReducedMotion;
importDefault.pause(r2);
Module00057(r2);
}
}
}
}
}
function _fun74572() { // fn#74572, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9737:715, offset: 0x01d92731, size: 45 bytes, params: 1, frame: 12
const value = environment.__proto__;
(UseMediaViewerSourcesModule).removeSpoiler(env0_0);
}
}
function initVideoStateStore() { // fn#74573, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9737:982, offset: 0x01d9275e, size: 47 bytes, params: 1, frame: 12
(ReactBatchUpdatesNativeModule).batchUpdates(_fun74574);
function _fun74574() { // fn#74574, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9737:1035, offset: 0x01d9278d, size: 36 bytes, params: 1, frame: 13
env1_7.setState({controls: undefined, paused: false});
}
}
function setMuted_74575(a0) { // fn#74575, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9737:1095, offset: 0x01d927b1, size: 54 bytes, params: 2, frame: 12
const env0_0 = a0;
(ReactBatchUpdatesNativeModule).batchUpdates(_fun74576);
function _fun74576() { // fn#74576, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9737:1138, offset: 0x01d927e7, size: 58 bytes, params: 1, frame: 13
const useMediaPlayerMutedStore = (MediaPlayerMuteManagerModule).useMediaPlayerMutedStore;
useMediaPlayerMutedStore.setState({isMuted: env0_0});
}
}
function toggleMuted() { // fn#74577, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9737:1216, offset: 0x01d92821, size: 47 bytes, params: 1, frame: 12
(require(690) /* metro dependency 690: ReactBatchUpdatesNative */).batchUpdates(function() {
var useMediaPlayerMutedStore = require(dependencyMap[6]).useMediaPlayerMutedStore;
useMediaPlayerMutedStore.setState(_fun74579);
});
function _fun74578() { // fn#74578, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9737:1261, offset: 0x01d92850, size: 53 bytes, params: 1, frame: 12
const useMediaPlayerMutedStore = (MediaPlayerMuteManagerModule).useMediaPlayerMutedStore;
useMediaPlayerMutedStore.setState(function(a0) {
return {isMuted: !a0.isMuted};
});
}
}
function setVideoStateControls(a0) { // fn#74580, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9737:1365, offset: 0x01d9289a, size: 54 bytes, params: 2, frame: 12
const env0_0 = a0;
(ReactBatchUpdatesNativeModule).batchUpdates(_fun74581);
function _fun74581() { // fn#74581, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9737:1421, offset: 0x01d928d0, size: 34 bytes, params: 1, frame: 12
return env1_7.setState({controls: env0_0});
}
}
function setPausedState(a0) { // fn#74582, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9737:1470, offset: 0x01d928f2, size: 54 bytes, params: 2, frame: 12
const env0_0 = a0;
(ReactBatchUpdatesNativeModule).batchUpdates(_fun74583);
function _fun74583() { // fn#74583, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9737:1519, offset: 0x01d92928, size: 34 bytes, params: 1, frame: 12
return env1_7.setState({paused: env0_0});
}
}
function tryPauseCurrentVideo() { // fn#74584, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9737:1572, offset: 0x01d9294a, size: 46 bytes, params: 1, frame: 11
const binding = env0_7;
const getState = binding.getState;
const controls = Reflect.apply(getState, binding, []).controls;
if (controls != null) {
controls.pause(true);
}
}
function unpauseCurrentVideoIfNeeded() { // fn#74585, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9737:1686, offset: 0x01d92978, size: 77 bytes, params: 1, frame: 13
var r1;
var r3;
var controls;
let binding = env0_7;
const getState = binding.getState;
const paused = Reflect.apply(getState, binding, []).paused;
const value2 = undefined;
if (paused) {
r1 = paused;
r3 = value2;
} else {
binding = env0_7;
controls = binding.getState().controls;
r1 = controls == null;
r3 = controls;
}
if (!r1) {
r3.pause(false);
}
return value2;
}
}
function _fun74574() { // fn#74574, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9737:1035, offset: 0x01d9278d, size: 36 bytes, params: 1, frame: 13
env1_7.setState({controls: undefined, paused: false});
}
function _fun74576() { // fn#74576, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9737:1138, offset: 0x01d927e7, size: 58 bytes, params: 1, frame: 13
const useMediaPlayerMutedStore = (require(9552) /* metro dependency 9552: MediaPlayerMuteManager */).useMediaPlayerMutedStore;
useMediaPlayerMutedStore.setState({isMuted: env0_0});
}
function _fun74578() { // fn#74578, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9737:1261, offset: 0x01d92850, size: 53 bytes, params: 1, frame: 12
const useMediaPlayerMutedStore = (require(9552) /* metro dependency 9552: MediaPlayerMuteManager */).useMediaPlayerMutedStore;
useMediaPlayerMutedStore.setState(function(a0) {
return {isMuted: !a0.isMuted};
});
}
function _fun74581() { // fn#74581, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9737:1421, offset: 0x01d928d0, size: 34 bytes, params: 1, frame: 12
return env1_7.setState({controls: env0_0});
}
function _fun74583() { // fn#74583, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9737:1519, offset: 0x01d92928, size: 34 bytes, params: 1, frame: 12
return env1_7.setState({paused: env0_0});
function _fun74579({isMuted}) { // fn#74579, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9737:1309, offset: 0x01d92885, size: 21 bytes, params: 2, frame: 2
return {isMuted: !isMuted};
}
global.__d(_fun74566, 9551, [57, 31, 4502, 33, 629, 690, 9552, 4501, 566, 9545, 6266, 9546, 9553,
2]) /* metro module 9551, dependencies: [57, 31, 4502, 33, 629, 690, 9552, 4501, 566, 9545, 6266, 9546, 9553, 2] */;