/* Metro module 11094; source: modules/media_uploads/native/UploadPreviewActionSheet.tsx; dependencies: [57, 31, 27, 4645, 6276, 33, 4501, 697, 44, 4650, 1478, 1585, 4594, 4080, 4673, 11095, 3857, 7684, 4660, 11133, 11134, 6275, 6277, 4572, 4573, 477, 9543, 8509, 6231, 6238, 11135, 11137, 1244, 8950, 11139, 7879, 6697, 11141, 4578, 4071, 2] */ function _fun84935(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#84935, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11280:6, offset: 0x01f5d433, size: 442 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 */; const env0_5 = value.Image; const env0_6 = value.View; const env0_7 = (require(4645) /* metro dependency 4645: DraftStore */).DraftType; const env0_8 = (require(6276) /* metro dependency 6276: ActionSheetConstants */).ACTION_SHEET_MAX_WIDTH; value = require(33) /* metro dependency 33 */; const env0_9 = value.jsx; const env0_10 = value.jsxs; value = require(4501) /* metro dependency 4501: createStyles */; const createStyles = value.createStyles; object2 = {}; object2.contentContainer = {padding: 16}; const object4 = {}; const BACKGROUND_SURFACE_HIGH = (importDefault(697) /* metro dependency 697: native */).colors.BACKGROUND_SURFACE_HIGH; object4.backgroundColor = BACKGROUND_SURFACE_HIGH; const PX_8 = (importDefault(697) /* metro dependency 697: native */).space.PX_8; object4.padding = PX_8; let md = (importDefault(697) /* metro dependency 697: native */).radii.md; object4.borderRadius = md; object4.width = '100%'; object2.imageWrap = object4; md = (importDefault(697) /* metro dependency 697: native */).radii.md; const PX_4 = (importDefault(697) /* metro dependency 697: native */).space.PX_4; object2.imageContainer = {'overflow': 'hidden', 'alignSelf': 'center', borderRadius: md - PX_4}; const env0_11 = Reflect.apply(createStyles, value, [object2]); (require(2) /* metro dependency 2 */).fileFinishedImporting('modules/media_uploads/native/UploadPreviewActionSheet.tsx'); exports.default = UploadPreviewActionSheet; } function UploadPreviewActionSheet({onAdd, onEdit, onRemove, channelId, onClose, disableAddDescription, disableSpoiler, upload}) { // fn#84936, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11280:529, offset: 0x01f5d5ed, size: 2198 bytes, params: 2, frame: 47 var r4; var r23; var r21; var r15; var r10; var value18; var space; var value19; const TableRowGroup = (require(6231) /* metro dependency 6231: TableRowGroupNative */).TableRowGroup; const TableRow = (require(6238) /* metro dependency 6238: TableRowNative */).TableRow; const intl = (require(1244) /* metro dependency 1244: indexNative */).intl; var items4; const TableCheckboxRow = (require(8950) /* metro dependency 8950: TableCheckboxRowNative */).TableCheckboxRow; const Button = (require(4578) /* metro dependency 4578: ButtonNative */).Button; const env0_3 = channelId; disableAddDescription = !(disableAddDescription === undefined) && disableAddDescription; const styles = useStyles(); const id = upload.id; const isVideo = upload.isVideo; const isImage = upload.isImage; const isThumbnail = upload.isThumbnail; const r28 = isThumbnail !== undefined && isThumbnail; const item = upload.item; const spoiler = upload.spoiler; const defaultImport = importDefault(44) /* metro dependency 44 */; const platform = item.platform; const UploadPlatform = (require(4650) /* metro dependency 4650: Upload */).UploadPlatform; const REACT_NATIVE = UploadPlatform.REACT_NATIVE; defaultImport(platform === REACT_NATIVE, 'Upload must be a React Native upload item.'); const width = (importDefault(1478) /* metro dependency 1478: useWindowDimensionsNative */)().width; const bottom = (importDefault(1585) /* metro dependency 1585: useSafeAreaInsetsNative */)().bottom; (importDefault(4594) /* metro dependency 4594: useMountEffect */)(function() { return _fun84938; }); const binding = onClose; const value5 = binding.useMemo(_fun84939, [width, item, styles]); const value6 = binding.useCallback(_fun84940, [onRemove, id]); const value7 = binding.useCallback(_fun84941, [onAdd]); const value8 = binding.useCallback(_fun84942, [onEdit, item]); const value9 = binding.useMemo(_fun84945, [isVideo, item]); const r20 = isImage && !disableAddDescription; const r24 = !r28 && !disableSpoiler; const value13 = (importDefault(11133) /* metro dependency 11133: useCanSetThumbnail */)(channelId, upload); const value14 = (importDefault(11134) /* metro dependency 11134: useSetMediaPostThumbnail */)(channelId, upload); const [property, env0_11] = env0_3(onClose.useState(undefined), 2); if (property != null) { value18 = property + bottom; space = (importDefault(697) /* metro dependency 697: native */).space; value19 = value18 + space.PX_32; space = (importDefault(697) /* metro dependency 697: native */).space; r4 = value19 + space.PX_16; } else { r4 = undefined; } const r22 = isImage && onEdit != null; const BottomSheet = (require(6275) /* metro dependency 6275: BottomSheetNative */).BottomSheet; const BottomSheetScrollView = (require(6277) /* metro dependency 6277 */).BottomSheetScrollView; const object = {}; const PX_16 = (importDefault(697) /* metro dependency 697: native */).space.PX_16; object.padding = PX_16; object.paddingBottom = bottom; const Stack = (require(4572) /* metro dependency 4572: StackNative */).Stack; const object2 = {spacing: 16, onLayout: onLayout_84946}; const Text = (require(4573) /* metro dependency 4573: Text */).Text; const items5 = [{item.filename}]; const items2 = [styles.imageContainer]; items2[1] = {width: value5.width, height: value5.height}; const platformUtilsModule = require(477) /* metro dependency 477: PlatformUtils */; const items3 = [platformUtilsModule.isIOS() && isVideo && item.uri.startsWith('file://') ? ((VideoComponent) => )((require(9543) /* metro dependency 9543: Video */).VideoComponent) : ]; items3[1] = value9 != null && value9 !== '' && ((Caption) => )((require(8509) /* metro dependency 8509: Caption */).Caption); items5[1] = {items3}; if (r20) { if (r20) { r23 = )((require(11135) /* metro dependency 11135: ImageFileIcon */).ImageFileIcon)} onPress={onPress_84947} label={intl.string((require(1244) /* metro dependency 1244: indexNative */).t['5S2AK+'])} arrow />; } else { r23 = null; } items4 = [r23]; if (r24) { r23 = )((require(11139) /* metro dependency 11139: SpoilerIcon */).SpoilerIcon)} onPress={function() { importDefault(dependencyMap[13]).hideActionSheet(); var defaultImport2 = importDefault(dependencyMap[35]); var channelIdBinding = channelId; var idBinding = id; var ChannelMessage = DraftType.ChannelMessage; defaultImport2.update(channelIdBinding, idBinding, ChannelMessage, {spoiler: !spoiler}); }} label={intl.string((require(1244) /* metro dependency 1244: indexNative */).t['gsI+xC'])} checked={spoiler} />; } else { r23 = null; } items4[1] = r23; if (value13) { r21 = )((require(6697) /* metro dependency 6697: ImageIcon */).ImageIcon)} label={intl.string((require(1244) /* metro dependency 1244: indexNative */).t.ews2pj)} onPress={value14} checked={r28} />; } else { r21 = value13; } items4[2] = r21; if (r22) { r21 = )((require(11141) /* metro dependency 11141: PencilSparkleIcon */).PencilSparkleIcon)} onPress={value8} label={intl.string((require(1244) /* metro dependency 1244: indexNative */).t.b0y3DL)} arrow />; } else { r21 = null; } items4[3] = r21; r15 = {items4}; } else if (r24) { if (r20) { r23 = )((require(11135) /* metro dependency 11135: ImageFileIcon */).ImageFileIcon)} onPress={onPress_84947} label={intl.string((require(1244) /* metro dependency 1244: indexNative */).t['5S2AK+'])} arrow />; } else { r23 = null; } items4 = [r23]; if (r24) { r23 = )((require(11139) /* metro dependency 11139: SpoilerIcon */).SpoilerIcon)} onPress={onPress_84948} label={intl.string((require(1244) /* metro dependency 1244: indexNative */).t['gsI+xC'])} checked={spoiler} />; } else { r23 = null; } items4[1] = r23; if (value13) { r21 = )((require(6697) /* metro dependency 6697: ImageIcon */).ImageIcon)} label={intl.string((require(1244) /* metro dependency 1244: indexNative */).t.ews2pj)} onPress={value14} checked={r28} />; } else { r21 = value13; } items4[2] = r21; if (r22) { r21 = )((require(11141) /* metro dependency 11141: PencilSparkleIcon */).PencilSparkleIcon)} onPress={value8} label={intl.string((require(1244) /* metro dependency 1244: indexNative */).t.b0y3DL)} arrow />; } else { r21 = null; } items4[3] = r21; r15 = {items4}; } else if (value13) { if (r20) { r23 = )((require(11135) /* metro dependency 11135: ImageFileIcon */).ImageFileIcon)} onPress={onPress_84947} label={intl.string((require(1244) /* metro dependency 1244: indexNative */).t['5S2AK+'])} arrow />; } else { r23 = null; } items4 = [r23]; if (r24) { r23 = )((require(11139) /* metro dependency 11139: SpoilerIcon */).SpoilerIcon)} onPress={onPress_84948} label={intl.string((require(1244) /* metro dependency 1244: indexNative */).t['gsI+xC'])} checked={spoiler} />; } else { r23 = null; } items4[1] = r23; if (value13) { r21 = )((require(6697) /* metro dependency 6697: ImageIcon */).ImageIcon)} label={intl.string((require(1244) /* metro dependency 1244: indexNative */).t.ews2pj)} onPress={value14} checked={r28} />; } else { r21 = value13; } items4[2] = r21; if (r22) { r21 = )((require(11141) /* metro dependency 11141: PencilSparkleIcon */).PencilSparkleIcon)} onPress={value8} label={intl.string((require(1244) /* metro dependency 1244: indexNative */).t.b0y3DL)} arrow />; } else { r21 = null; } items4[3] = r21; r15 = {items4}; } else if (r22) { if (r20) { r23 = )((require(11135) /* metro dependency 11135: ImageFileIcon */).ImageFileIcon)} onPress={onPress_84947} label={intl.string((require(1244) /* metro dependency 1244: indexNative */).t['5S2AK+'])} arrow />; } else { r23 = null; } items4 = [r23]; if (r24) { r23 = )((require(11139) /* metro dependency 11139: SpoilerIcon */).SpoilerIcon)} onPress={onPress_84948} label={intl.string((require(1244) /* metro dependency 1244: indexNative */).t['gsI+xC'])} checked={spoiler} />; } else { r23 = null; } items4[1] = r23; if (value13) { r21 = )((require(6697) /* metro dependency 6697: ImageIcon */).ImageIcon)} label={intl.string((require(1244) /* metro dependency 1244: indexNative */).t.ews2pj)} onPress={value14} checked={r28} />; } else { r21 = value13; } items4[2] = r21; if (r22) { r21 = )((require(11141) /* metro dependency 11141: PencilSparkleIcon */).PencilSparkleIcon)} onPress={value8} label={intl.string((require(1244) /* metro dependency 1244: indexNative */).t.b0y3DL)} arrow />; } else { r21 = null; } items4[3] = r21; r15 = {items4}; } else { r15 = null; } items5[2] = r15; if (onRemove != null) { r10 =