/* Metro module 9773; source: components_native/chat/ChatItem.tsx; dependencies: [57, 31, 27, 4502, 661, 8178, 33, 4020, 9774, 9775, 9776, 671, 5216, 4501, 697, 477, 8368, 3860, 674, 4589, 2] */ import Module00057 from '../../by-id/module-00057.js'; /* Metro dependency 57 */ import AccessibilityStore from '../../modules/a11y/AccessibilityStore.tsx'; /* Metro dependency 4502 */ 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 ConstantsModule from '../../Constants.tsx'; /* Metro dependency 661 */ import * as UseTokenModule from '../../design/tokens/native/useToken.tsx'; /* Metro dependency 3860 */ import * as FabricUtilsModule from '../../utils/native/FabricUtils.tsx'; /* Metro dependency 4020 */ function _fun76692(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#76692, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9959:6, offset: 0x01de0e93, size: 503 bytes, params: 8, frame: 21 const env0_0 = require; const Object = global.Object; Object.defineProperty(exports, '__esModule', {value: true}); let value = ReactNativeModule; const requireNativeComponent = value.requireNativeComponent; const env0_5 = value.View; value = require(8178) /* metro dependency 8178: RowGeneratorConstants */; const env0_8 = value.RowType; const env0_9 = value.Changeset; value = require(33) /* metro dependency 33 */; const env0_10 = value.jsx; const env0_11 = value.jsxs; value = require(4020) /* metro dependency 4020: FabricUtils */; const r4 = value.isFabric() ? (require(9774) /* metro dependency 9774: MessageViewNativeComponent */).default : requireNativeComponent('DCDMessageView'); value = require(4020) /* metro dependency 4020: FabricUtils */; const r3 = value.isFabric() ? (require(9775) /* metro dependency 9775: SystemMessageViewNativeComponent */).default : requireNativeComponent('DCDSystemMessageView'); value = require(4020) /* metro dependency 4020: FabricUtils */; const r1 = value.isFabric() ? (require(9776) /* metro dependency 9776: AutoModerationSystemMessageViewNativeComponent */).default : requireNativeComponent('DCDAutoModerationSystemMessageView'); const env0_15 = (require(4501) /* metro dependency 4501: createStyles */).createStyles(function(a0, a1) { return {container: {'position': 'relative', 'overflow': 'hidden'}, offset: {marginTop: -a1, marginLeft: -a0}, gradient: {'position': 'absolute', 'bottom': 0, 'height': 24, 'width': '100%'}, itemRow: {backgroundColor: 'transparent'}}; }); (FileImportTrackerModule).fileFinishedImporting('components_native/chat/ChatItem.tsx'); exports.default = _default_76695; exports.DCDMessageView = r4; exports.DCDSystemMessageView = r3; exports.DCDAutoModerationSystemMessageView = r1; function DCDChatItem(a0) { // fn#76693, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9959:458, offset: 0x01de108a, size: 246 bytes, params: 2, frame: 18 var r0; var AUTOMOD_INCIDENT_ACTIONS; const message = a0.message; const value = Object.create(null); value.message = 0; const value2 = copyDataProperties({}, a0, value, undefined); const type = message.type; const AUTO_MODERATION_ACTION = MessageTypes.AUTO_MODERATION_ACTION; if (type === AUTO_MODERATION_ACTION) { r0 = ((Component) => )(env0_14); } else { AUTOMOD_INCIDENT_ACTIONS = (require(671) /* metro dependency 671: MessageTypes */).MessageTypesSets.AUTOMOD_INCIDENT_ACTIONS; r0 = ( AUTOMOD_INCIDENT_ACTIONS.has(message.type) ? ((Component) => )(env0_12) : ( (importDefault(5216) /* metro dependency 5216: isSystemMessage */)(message) ? ((Component) => )(env0_13) : ((Component) => )(env0_12) ) ); } return r0; } function _default_76695({rowGenerator, message, style, horizontalOffset, maxHeight, modifyRow, pointerEvents, onLayout, messageSizeCacheRef, backgroundColor = importDefault(dependencyMap[14]).colors.BACKGROUND_BASE_LOWER, gradientStyles}) { // fn#76695, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9959:901, offset: 0x01de11d0, size: 745 bytes, params: 2, frame: 30 horizontalOffset = horizontalOffset === undefined ? 8 : horizontalOffset; const onLayout2 = onLayout; const messageSizeCacheRef2 = messageSizeCacheRef; const binding = messageSizeCacheRef2; let useState = binding.useState; const value5 = Reflect.apply(useState, binding, [0]); const binding2 = onLayout2; const value6 = binding2(value5, 2); const property = value6[0]; const env0_5 = value6[1]; useState = binding.useState; const value7 = binding2(Reflect.apply(useState, binding, [undefined]), 2); const property2 = value7[0]; const env0_7 = value7[1]; const {row, rawRow} = binding.useMemo(_fun76696, [property2, AccessibilityStore.roleStyle, message, modifyRow, rowGenerator]); const value9 = binding.useMemo(_fun76697, [rawRow.contextType]); const styles = useStyles(horizontalOffset, value9); const value10 = binding.useCallback(_fun76698, [onLayout]); const value11 = binding.useCallback(_fun76699, [messageSizeCacheRef, message.id]); let r5 = maxHeight != null && property - value9 >= maxHeight; let r16 = messageSizeCacheRef == null || messageSizeCacheRef.current == null ? undefined : messageSizeCacheRef.current[message.id]; r16 = r5 ? maxHeight : r16; const view = ( ); const value16 = messageSizeCacheRef2.useMemo(_fun76700, [(UseTokenModule).useToken(backgroundColor)]); const items2 = [styles.container, style]; items2[2] = {height: r16}; const r7 = property2 != null && view; r5 = r5 && ((Component) => )(importDefault(4589) /* metro dependency 4589 */); return ( {r7} {r5} ); function _fun76696() { // fn#76696, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9959:1223, offset: 0x01de14b9, size: 221 bytes, params: 1, frame: 16 var object2; var r1; var JSON; var stringify; var object; const rowGeneratorBinding = rowGenerator; rowGeneratorBinding.setOptions({constrainedWidth: env0_6}); const generate = rowGeneratorBinding.generate; const MESSAGE = RowType.MESSAGE; const NOOP = Changeset.NOOP; const value3 = Reflect.apply(generate, rowGeneratorBinding, [{roleStyle: roleStyle, rowType: MESSAGE, changeType: NOOP, message: message, isFirst: true, canShowImages: true, canAddNewReactions: false}]); if (modifyRow != null) { modifyRow(value3); } object2 = {rawRow: value3}; if (FabricUtilsModule.isFabric()) { JSON = global.JSON; stringify = JSON.stringify; object = {index: 0}; copyDataProperties(object, value3, 0); r1 = Reflect.apply(stringify, JSON, [object]); } else { r1 = value3; } object2.row = r1; return object2; } function _fun76697() { // fn#76697, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9959:1526, offset: 0x01de1596, size: 97 bytes, params: 1, frame: 14 const value = environment.__proto__; return (require(477) /* metro dependency 477: PlatformUtils */).isAndroid() ? 0 : rawRow.contextType !== (require(8368) /* metro dependency 8368: RowGeneratorTypes */).MessageContextType.SEARCH ? 16 : 12; } function _fun76698(a0) { // fn#76698, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9959:1654, offset: 0x01de15f7, size: 55 bytes, params: 2, frame: 13 env0_7(a0.nativeEvent.layout.width); if (onLayout != null) { onLayout(a0); } } function _fun76699({nativeEvent}) { // fn#76699, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9959:1726, offset: 0x01de162e, size: 102 bytes, params: 2, frame: 12 const height = nativeEvent.layout.height; if (height > 0) { if (messageSizeCacheRef != null) { if (messageSizeCacheRef.current[message.id] !== height) { messageSizeCacheRef.current[message.id] = height; } } env0_5(height); } } function _fun76700() { // fn#76700, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9959:2043, offset: 0x01de1694, size: 78 bytes, params: 1, frame: 12 let value = environment.__proto__; value = importDefault(674) /* metro dependency 674 */; value = value(env0_10); value = value.alpha(0); value = value.hex(); return [value, env0_10]; } } } global.__d(_fun76692, 9773, [57, 31, 27, 4502, 661, 8178, 33, 4020, 9774, 9775, 9776, 671, 5216, 4501, 697, 477, 8368, 3860, 674, 4589, 2]) /* metro module 9773, dependencies: [57, 31, 27, 4502, 661, 8178, 33, 4020, 9774, 9775, 9776, 671, 5216, 4501, 697, 477, 8368, 3860, 674, 4589, 2] */;