Files
2026-07-28 01:06:53 +03:00

1440 lines
92 KiB
TypeScript

/* Metro module 11525; source: modules/chat_input/native/ChatInput.tsx; dependencies: [5, 57, 31, 27, 7168, 11526, 10738, 7074, 11527, 4645, 7075, 3784, 4644, 7729, 11529, 661, 1483, 1881, 1580, 33, 4501, 697, 477, 3860, 673, 4589, 1357, 3963, 11530, 11531, 566, 6860, 6771, 7149, 11533, 4017, 4022, 8448, 11535, 11536, 11433, 11537, 5225, 1239, 1584, 4660, 7879, 4650, 491, 4081, 683, 1583, 4863, 7860, 11575, 11732, 11095, 4015, 1847, 11733, 8530, 8812, 11752, 11110, 7875, 11755, 11756, 3815, 11773, 11774, 4573, 11775, 11776, 11782, 11783, 11784, 11788, 11790, 11804, 11809, 11812, 11850, 11854, 11871, 11002, 11884, 11886, 11887, 11711, 11888, 2] */
import Module00005 from '../../../by-id/module-00005.js'; /* Metro dependency 5 */
import Module00057 from '../../../by-id/module-00057.js'; /* Metro dependency 57 */
import AnalyticsUtils from '../../../utils/AnalyticsUtils.tsx'; /* Metro dependency 683 */
import Native from '../../../external/discord_common/js/packages/tokens/native.tsx'; /* Metro dependency 697 */
import PermissionStore from '../../../stores/PermissionStore.tsx'; /* Metro dependency 3784 */
import ReanimatedRexport from '../../reanimated/ReanimatedRexport.tsx'; /* Metro dependency 4017 */
import UseKeyboardType from '../../keyboard/native/useKeyboardType.tsx'; /* Metro dependency 4022 */
import UploadAttachmentStore from '../../../stores/UploadAttachmentStore.tsx'; /* Metro dependency 4644 */
import DraftStore from '../../../stores/DraftStore.tsx'; /* Metro dependency 4645 */
import UseAnalyticsLocations from '../../app_analytics/useAnalyticsLocations.tsx'; /* Metro dependency 6771 */
import PendingReplyStore from '../../replies/PendingReplyStore.tsx'; /* Metro dependency 7074 */
import EditMessageStore from '../../../stores/EditMessageStore.tsx'; /* Metro dependency 7075 */
import ApplicationCommandStore from '../../application_commands/ApplicationCommandStore.tsx'; /* Metro dependency 7168 */
import NativeMenuStore from '../../native_menu/native/NativeMenuStore.tsx'; /* Metro dependency 10738 */
import DiceRollStore from '../../dice_roll/DiceRollStore.tsx'; /* Metro dependency 11526 */
import UseTextareaPlaceholderAndLabels from '../../channel/useTextareaPlaceholderAndLabels.tsx'; /* Metro dependency 11535 */
import UseChatInputRefs from './useChatInputRefs.tsx'; /* Metro dependency 11537 */
import ChatInputImageCarousel from './accessories/ChatInputImageCarousel.tsx'; /* Metro dependency 11755 */
import ChatInputNativeComponent from './ChatInputNativeComponent.tsx'; /* Metro dependency 11773 */
import GetChatInputPositionStyle from './getChatInputPositionStyle.tsx'; /* Metro dependency 11782 */
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 ConstantsModule from '../../../Constants.tsx'; /* Metro dependency 661 */
import * as ComponentDispatchUtilsModule from '../../../utils/ComponentDispatchUtils.tsx'; /* Metro dependency 1239 */
import * as MobileVisualRefreshExperimentModule from '../../themes/experiments/MobileVisualRefreshExperiment.tsx'; /* Metro dependency 1357 */
import * as AppLauncherNativeConstantsModule from '../../app_launcher/native/AppLauncherNativeConstants.tsx'; /* Metro dependency 1483 */
import * as MediaKeyboardConstantsModule from '../../media_keyboard/native/MediaKeyboardConstants.tsx'; /* Metro dependency 1580 */
import * as KeyboardTypesModule from '../../keyboard/native/KeyboardTypes.tsx'; /* Metro dependency 1583 */
import * as ChatInputFocusedModule from '../../keyboard/native/ChatInputFocused.tsx'; /* Metro dependency 1584 */
import * as EmojiConstantsModule from '../../emojis/EmojiConstants.tsx'; /* Metro dependency 1881 */
import * as UseTokenModule from '../../../design/tokens/native/useToken.tsx'; /* Metro dependency 3860 */
import * as ClientThemesUtilsModule from '../../client_themes/native/ClientThemesUtils.tsx'; /* Metro dependency 3963 */
import * as ChatInputUtilsModule from '../../../utils/native/ChatInputUtils.tsx'; /* Metro dependency 4015 */
import * as HapticUtilsNativeModule from '../../haptics/HapticUtils.native.tsx'; /* Metro dependency 4081 */
import * as CreateStylesModule from '../../../design/components/Styles/native/createStyles.tsx'; /* Metro dependency 4501 */
import * as DraftStoreModule from '../../../stores/DraftStore.tsx'; /* Metro dependency 4645 */
import * as UploadModule from '../../../lib/uploader/Upload.tsx'; /* Metro dependency 4650 */
import * as UseChatBottomManagerUIStoreModule from './useChatBottomManagerUIStore.tsx'; /* Metro dependency 7729 */
import * as UseMessageMaxLengthModule from '../../messages/useMessageMaxLength.tsx'; /* Metro dependency 7875 */
import * as EmojiActionCreatorsModule from '../../emojis/EmojiActionCreators.tsx'; /* Metro dependency 8530 */
import * as MediaKeyboardUtilsModule from '../../media_keyboard/native/MediaKeyboardUtils.tsx'; /* Metro dependency 11095 */
import * as VoiceMessagesUIStoreModule from '../../voice_messages/native/VoiceMessagesUIStore.tsx'; /* Metro dependency 11527 */
import * as ChatInputConstantsModule from './ChatInputConstants.tsx'; /* Metro dependency 11529 */
import * as PollCreationModalActionCreatorsModule from '../../polls/native/PollCreationModalActionCreators.tsx'; /* Metro dependency 11733 */
import * as PortalKeyboardPlaceholderModule from '../../keyboard/native/PortalKeyboardPlaceholder.tsx'; /* Metro dependency 11774 */
import * as ChatInputAccessibilityDividerModule from './accessories/ChatInputAccessibilityDivider.tsx'; /* Metro dependency 11783 */
import * as MemberActionChatInputBannerModule from '../../guild_onboarding_home/native/MemberActionChatInputBanner.tsx'; /* Metro dependency 11809 */
import * as DoubleTapToReactChatInputBannerModule from '../../double_tap_to_react/native/DoubleTapToReactChatInputBanner.tsx'; /* Metro dependency 11812 */
function _fun88219(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#88219, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11711:6, offset: 0x01fdaa88, size: 702 bytes, params: 8, frame: 20
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
let value = ReactModule;
const env0_36 = (CreateStylesModule).createStyles(_fun88221);
object = {code: 'function ChatInputTsx1(){const{placeholderFieldHeight,textFieldHeight}=this.__closure;return{minHeight:placeholderFieldHeight>0?Math.max(textFieldHeight.get(),placeholderFieldHeight):textFieldHeight.get()};}'};
const value7 = value.forwardRef(_fun88222);
value7.displayName = 'ChatInput';
value = value.memo(value7);
(FileImportTrackerModule).fileFinishedImporting('modules/chat_input/native/ChatInput.tsx');
exports.default = value;
function ChatInputScrimGradient({gradientHeight, inline, scrimBase}) { // fn#88220, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11711:3339, offset: 0x01fdad46, size: 412 bytes, params: 2, frame: 22
inline = !(inline === undefined) && inline;
const useToken = UseTokenModule.useToken;
const CHAT_INPUT_FLOATING_SCRIM_GRADIENT_HEIGHT = (Native).modules.mobile.CHAT_INPUT_FLOATING_SCRIM_GRADIENT_HEIGHT;
const r11 = gradientHeight ?? Reflect.apply(useToken, UseTokenModule, [CHAT_INPUT_FLOATING_SCRIM_GRADIENT_HEIGHT]);
const r9 = (require(673) /* metro dependency 673: ColorUtils */).hex2rgb(scrimBase, 1) ?? scrimBase;
const r12 = (require(673) /* metro dependency 673: ColorUtils */).hex2rgb(scrimBase, 0) ?? 'transparent';
const value6 = -r11;
return (
<View
style={{
'position': 'absolute',
'top': null,
'left': 0,
'right': 0,
'bottom': 0,
top: inline ? value6 : value6 / 2,
}}
pointerEvents="none"
>
{((Component) => <Component colors={[r12, r9]} style={{height: r11}} start={{'x': 0, 'y': 0}} end={{'x': 0,
'y': 1}} locations={[0, 1]} />)(importDefault(4589) /* metro dependency 4589 */)}
<View style={{flex: 1, backgroundColor: r9}} />
</View>
);
}
function _fun88221(a0, a1, a2) { // fn#88221, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11711:787, offset: 0x01fdaee2, size: 1220 bytes, params: 4, frame: 22
let value = a0;
const object = {};
const object2 = {position: 'relative'};
const PX_8 = (importDefault(697) /* metro dependency 697: native */).space.PX_8;
object2.paddingVertical = PX_8;
object2.paddingHorizontal = CHAT_INPUT_HORIZONTAL_PADDING - CHAT_INPUT_HORIZONTAL_PADDING_PARENT;
object2.backgroundColor = value ?? (importDefault(697) /* metro dependency 697: native */).colors.BACKGROUND_BASE_LOW;
object2.borderTopWidth = 1;
let BORDER_SUBTLE = (importDefault(697) /* metro dependency 697: native */).colors.BORDER_SUBTLE;
object2.borderColor = BORDER_SUBTLE;
object.container = object2;
object.containerInner = {'flexDirection': 'row', 'alignItems': 'flex-end'};
const object3 = {};
copyDataProperties(object3, a1 ? {'alignSelf': 'stretch', 'marginLeft': 0, 'marginTop': 0} : {'flex': 1,
'marginLeft': 6}, undefined);
object.inputDefault = object3;
const PX_4 = (require(477) /* metro dependency 477: PlatformUtils */).isAndroid() ? (importDefault(697) /* metro dependency 697: native */).space.PX_4 : 6;
object.customPlaceholder = {'position': 'absolute', 'left': null, 'right': 0, left: PX_4};
const object7 = {'flexDirection': 'row', 'alignItems': 'stretch', 'borderRadius': null, 'paddingHorizontal': null,
'marginHorizontal': null, 'overflow': 'hidden', 'flex': 1};
const CHAT_INPUT_BORDER_RADIUS = (importDefault(697) /* metro dependency 697: native */).modules.mobile.CHAT_INPUT_BORDER_RADIUS;
object7.borderRadius = CHAT_INPUT_BORDER_RADIUS;
let CHAT_INPUT_PILL_PADDING = (importDefault(697) /* metro dependency 697: native */).modules.mobile.CHAT_INPUT_PILL_PADDING;
object7.paddingHorizontal = CHAT_INPUT_PILL_PADDING;
const CHAT_INPUT_PILL_MARGIN_HORIZONTAL = (importDefault(697) /* metro dependency 697: native */).modules.mobile.CHAT_INPUT_PILL_MARGIN_HORIZONTAL;
object7.marginHorizontal = CHAT_INPUT_PILL_MARGIN_HORIZONTAL;
let CHAT_INPUT_PILL_BORDER_WIDTH = (importDefault(697) /* metro dependency 697: native */).modules.mobile.CHAT_INPUT_PILL_BORDER_WIDTH;
object7.borderWidth = CHAT_INPUT_PILL_BORDER_WIDTH;
const INPUT_BORDER_DEFAULT = (importDefault(697) /* metro dependency 697: native */).colors.INPUT_BORDER_DEFAULT;
object7.borderColor = INPUT_BORDER_DEFAULT;
object7.backgroundColor = value != null ? (importDefault(697) /* metro dependency 697: native */).colors.CARD_SECONDARY_BG : (importDefault(697) /* metro dependency 697: native */).colors.CHAT_INPUT_BACKGROUND;
object.input = object7;
CHAT_INPUT_PILL_PADDING = (importDefault(697) /* metro dependency 697: native */).modules.mobile.CHAT_INPUT_PILL_PADDING;
object.rightAccessory = {'flexDirection': 'column', 'justifyContent': 'flex-end', 'alignItems': 'center',
paddingVertical: CHAT_INPUT_PILL_PADDING};
CHAT_INPUT_PILL_BORDER_WIDTH = (importDefault(697) /* metro dependency 697: native */).modules.mobile.CHAT_INPUT_PILL_BORDER_WIDTH;
object.refreshButtonAlignment = {marginBottom: CHAT_INPUT_PILL_BORDER_WIDTH};
object.accessories = {'position': 'absolute', 'bottom': '100%', 'left': 0, 'right': 0};
const object10 = {'borderTopWidth': 0, 'borderColor': 'transparent', 'borderRadius': null,
'backgroundColor': 'transparent', 'paddingHorizontal': null, 'paddingVertical': 0, 'overflow': 'visible'};
object10.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.none;
let CHAT_INPUT_CONTAINER_HORIZONTAL_PADDING = (importDefault(697) /* metro dependency 697: native */).modules.mobile.CHAT_INPUT_CONTAINER_HORIZONTAL_PADDING;
object10.paddingHorizontal = CHAT_INPUT_CONTAINER_HORIZONTAL_PADDING;
object.floatingContainer = object10;
const object11 = {};
const MOBILE_FLOATINGBAR_BACKGROUND = (importDefault(697) /* metro dependency 697: native */).colors.MOBILE_FLOATINGBAR_BACKGROUND;
object11.backgroundColor = MOBILE_FLOATINGBAR_BACKGROUND;
const CHAT_INPUT_FLOATING_ACCESSORY_BORDER_WIDTH = (importDefault(697) /* metro dependency 697: native */).modules.mobile.CHAT_INPUT_FLOATING_ACCESSORY_BORDER_WIDTH;
object11.borderWidth = CHAT_INPUT_FLOATING_ACCESSORY_BORDER_WIDTH;
const MOBILE_FLOATING_ACCESSORY_BORDER = (importDefault(697) /* metro dependency 697: native */).colors.MOBILE_FLOATING_ACCESSORY_BORDER;
object11.borderColor = MOBILE_FLOATING_ACCESSORY_BORDER;
const CHAT_INPUT_FLOATING_BORDER_RADIUS = (importDefault(697) /* metro dependency 697: native */).modules.mobile.CHAT_INPUT_FLOATING_BORDER_RADIUS;
object11.borderRadius = CHAT_INPUT_FLOATING_BORDER_RADIUS;
object11.flexDirection = 'column';
object11.overflow = 'hidden';
object.floatingInputBox = object11;
BORDER_SUBTLE = (importDefault(697) /* metro dependency 697: native */).colors.BORDER_SUBTLE;
object.floatingInputBoxPressed = {borderColor: BORDER_SUBTLE};
object.floatingInputBoxTyping = {'shadowOpacity': 0, 'elevation': 0};
const object13 = {'flexDirection': 'row', 'alignItems': 'flex-end'};
const CHAT_INPUT_FLOATING_CONTENT_PADDING_HORIZONTAL = (importDefault(697) /* metro dependency 697: native */).modules.mobile.CHAT_INPUT_FLOATING_CONTENT_PADDING_HORIZONTAL;
object13.paddingHorizontal = CHAT_INPUT_FLOATING_CONTENT_PADDING_HORIZONTAL;
const CHAT_INPUT_FLOATING_CONTENT_PADDING_VERTICAL = (importDefault(697) /* metro dependency 697: native */).modules.mobile.CHAT_INPUT_FLOATING_CONTENT_PADDING_VERTICAL;
object13.paddingVertical = CHAT_INPUT_FLOATING_CONTENT_PADDING_VERTICAL;
const CHAT_INPUT_FLOATING_CONTENT_GAP = (importDefault(697) /* metro dependency 697: native */).modules.mobile.CHAT_INPUT_FLOATING_CONTENT_GAP;
object13.gap = CHAT_INPUT_FLOATING_CONTENT_GAP;
object.floatingMainContents = object13;
value = require(477) /* metro dependency 477: PlatformUtils */;
value = value.isAndroid();
object.inputFlat = {'flex': 1, 'justifyContent': 'center', marginHorizontal: value ? -5 : -6};
CHAT_INPUT_CONTAINER_HORIZONTAL_PADDING = (importDefault(697) /* metro dependency 697: native */).modules.mobile.CHAT_INPUT_CONTAINER_HORIZONTAL_PADDING;
object.floatingTypingWrapper = {backgroundColor: 'transparent',
paddingRight: CHAT_INPUT_CONTAINER_HORIZONTAL_PADDING};
object.floatingScrimOverlap = {marginTop: -a2 / 2};
object.overflowVisible = {overflow: 'visible'};
return object;
}
function _fun88222({channel, isResourceChannel, screenIndex, setNoExtractUI, secondaryTextFieldRef, threadCreationCallback, onJumpToPresent}, a1) { // fn#88222, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11711:4093, offset: 0x01fdb3a6, size: 5607 bytes, params: 3, frame: 78
var r37;
var r29;
var moduleValue16;
var ChatInputActions;
var object5;
var DMMessageStickerGreeting;
var object6;
var items10;
var items11;
var items15;
var object7;
var items17;
var items18;
var ChatInputRightActions;
let env0_5 = undefined;
let env0_6 = undefined;
const {enabled,
chatInputFloating} = (MobileVisualRefreshExperimentModule).useMobileVisualRefreshConfig({location: 'ChatInput'});
const useGradientValue = ClientThemesUtilsModule.useGradientValue;
const GradientPercentage = ClientThemesUtilsModule.GradientPercentage;
const END = GradientPercentage.END;
const value4 = Reflect.apply(useGradientValue, ClientThemesUtilsModule, [END]);
let useToken = UseTokenModule.useToken;
const CHAT_INPUT_ACTION_BUTTON_SIZE = (Native).modules.mobile.CHAT_INPUT_ACTION_BUTTON_SIZE;
const value5 = Reflect.apply(useToken, UseTokenModule, [CHAT_INPUT_ACTION_BUTTON_SIZE]);
useToken = UseTokenModule.useToken;
const CHAT_INPUT_SEND_BUTTON_HEIGHT = (Native).modules.mobile.CHAT_INPUT_SEND_BUTTON_HEIGHT;
const value7 = (Reflect.apply(useToken, UseTokenModule, [CHAT_INPUT_SEND_BUTTON_HEIGHT]) - value5) / 2;
useToken = UseTokenModule.useToken;
const CHAT_INPUT_FLOATING_SCRIM_GRADIENT_HEIGHT = (Native).modules.mobile.CHAT_INPUT_FLOATING_SCRIM_GRADIENT_HEIGHT;
const value8 = Reflect.apply(useToken, UseTokenModule, [CHAT_INPUT_FLOATING_SCRIM_GRADIENT_HEIGHT]);
const styles = useStyles(value4, chatInputFloating, value8);
useToken = UseTokenModule.useToken;
const BACKGROUND_BASE_LOWER = (Native).colors.BACKGROUND_BASE_LOWER;
const r49 = value4 ?? Reflect.apply(useToken, UseTokenModule, [BACKGROUND_BASE_LOWER]);
useToken = UseTokenModule.useToken;
const CHAT_INPUT_FLOATING_TYPING_GRADIENT_HEIGHT_REDUCED = (Native).modules.mobile.CHAT_INPUT_FLOATING_TYPING_GRADIENT_HEIGHT_REDUCED;
const value11 = Reflect.apply(useToken, UseTokenModule, [CHAT_INPUT_FLOATING_TYPING_GRADIENT_HEIGHT_REDUCED]);
useToken = UseTokenModule.useToken;
const CHAT_INPUT_FLOATING_INLINE_FULL_GRADIENT_HEIGHT = (Native).modules.mobile.CHAT_INPUT_FLOATING_INLINE_FULL_GRADIENT_HEIGHT;
const value12 = Reflect.apply(useToken, UseTokenModule, [CHAT_INPUT_FLOATING_INLINE_FULL_GRADIENT_HEIGHT]);
useToken = UseTokenModule.useToken;
const CHAT_INPUT_FLOATING_SCRIM_GRADIENT_HEIGHT_AT_BOTTOM = (Native).modules.mobile.CHAT_INPUT_FLOATING_SCRIM_GRADIENT_HEIGHT_AT_BOTTOM;
const value13 = Reflect.apply(useToken, UseTokenModule, [CHAT_INPUT_FLOATING_SCRIM_GRADIENT_HEIGHT_AT_BOTTOM]);
useToken = UseTokenModule.useToken;
const CHAT_INPUT_CONTAINER_HORIZONTAL_PADDING = (Native).modules.mobile.CHAT_INPUT_CONTAINER_HORIZONTAL_PADDING;
const value14 = Reflect.apply(useToken, UseTokenModule, [CHAT_INPUT_CONTAINER_HORIZONTAL_PADDING]);
let binding = env0_6;
let useMemo = binding.useMemo;
const value15 = Reflect.apply(useMemo, binding, [_fun88223, [value14]]);
binding.useRef(chatInputFloating).current = chatInputFloating;
let useState = binding.useState;
const value18 = env0_5(Reflect.apply(useState, binding, [false]), 2);
const property = value18[0];
env0_5 = value18[1];
const r14 = chatInputFloating ? importDefault(11530) /* metro dependency 11530: FloatingChatInputContainer */ : View;
const value20 = threadCreationCallback != null;
env0_6 = value20;
const r19 = channel.isPrivate() && !value20;
const value22 = DiceRollStore(function({channelId}) {
return channelId === channel.id;
});
let r32 = chatInputFloating && (channel.rateLimitPerUser > 0 || (require(11531) /* metro dependency 11531: useTypingUsersIds */).useTypingUserIds(channel.id,
1).length > 0) && !useChatShowingAutoComplete(screenIndex);
const value28 = useChatIsAtBottom(screenIndex);
const r47 = value28 ? value13 : value8;
const r50 = value28 ? value11 : value12;
const value29 = (require(566) /* metro dependency 566: flux */).useStateFromStores([EditMessageStore], _fun88225);
const value30 = (require(566) /* metro dependency 566: flux */).useStateFromStores([PendingReplyStore], _fun88226);
const value31 = (require(566) /* metro dependency 566: flux */).useStateFromStores([UploadAttachmentStore],
_fun88227);
binding = env0_6;
useMemo = binding.useMemo;
let r45 = value29 ?? Reflect.apply(useMemo, binding, [_fun88228, [channel.id, value20]]);
const {canMentionEveryone, canUpload, canSendVoiceMessage, editable,
canCreateThreads} = (require(566) /* metro dependency 566: flux */).useStateFromStoresObject([PermissionStore],
_fun88229, [channel, value20]);
const analyticsLocations = (UseAnalyticsLocations)().analyticsLocations;
let r17 = value20 || value29 != null;
if (!r17) {
moduleValue16 = require(6860) /* metro dependency 6860: ThreadHooks */;
r17 = !moduleValue16.getIsActiveChannelOrUnarchivableThread(channel);
}
const value36 = value30 != null;
const r66 = (require(6860) /* metro dependency 6860: ThreadHooks */).useCanStartThread(channel) && !ChannelTypesSets.GUILD_THREADS_ONLY.has(channel.type) && !value20;
const r35 = (require(7149) /* metro dependency 7149: PollsUtils */).useCanPostPollsInChannel(channel) && !value20;
useToken = UseTokenModule.useToken;
const CHAT_INPUT_PILL_BORDER_WIDTH = (Native).modules.mobile.CHAT_INPUT_PILL_BORDER_WIDTH;
const value42 = Reflect.apply(useToken, UseTokenModule, [CHAT_INPUT_PILL_BORDER_WIDTH]);
let r56 = enabled ? value5 - 2 * value42 : (require(11533) /* metro dependency 11533: useChatInputMaxHeight */).getChatInputMinHeight();
const value45 = (require(4017) /* metro dependency 4017: ReanimatedRexport */).useSharedValue(chatInputFloating ? value5 : r56);
env0_6.useEffect(_fun88230, [chatInputFloating, value5, r56, value45]);
const value46 = (UseKeyboardType)();
const value47 = useVoiceMessagesUIStore(function(a0) {
return a0.startTimeMillis != null;
});
const value48 = !value20;
let r62 = value20 ? value48 : (require(8448) /* metro dependency 8448: ActivitiesInTextUtils */).getIsAppLauncherEnabled(channel);
const activeCommand = (require(566) /* metro dependency 566: flux */).useStateFromStores([ApplicationCommandStore],
function() {
return ApplicationCommandStore.getActiveCommand(channel.id);
});
const defaultImport2 = UseTextareaPlaceholderAndLabels;
const value50 = !editable;
const {placeholder, accessibilityLabel} = defaultImport2({channel: channel, isReadonly: value50,
isCreatingThread: value20});
const value52 = (importDefault(11536) /* metro dependency 11536: useAnniversaryPlaceholder */)(editable ? value20 ? null : channel : null);
const value53 = (require(11433) /* metro dependency 11433: GiftIntentExpressionPickerState */).useGiftIntentExpressionPickerActive(channel.id);
const r60 = (require(11433) /* metro dependency 11433: GiftIntentExpressionPickerState */).useGiftIntentExpressionPickerPlaceholder(channel.id) ?? value52;
const value55 = !value53;
const r39 = value53 ? value55 : undefined;
binding = env0_6;
useState = binding.useState;
const value57 = env0_5(Reflect.apply(useState, binding, [r45.length > 0]), 2);
const property2 = value57[0];
const env0_14 = value57[1];
binding.useEffect(_fun88233, [r45]);
const r54 = r60 != null && !property2;
binding = env0_6;
const [property3, env0_15] = env0_5(binding.useState(0), 2);
let closure = _fun88234;
const value62 = binding.useCallback(closure, []);
const r57 = enabled ? 5 : 8;
r56 = chatInputFloating ? value5 : r56;
let r42 = r54 && property3 > 0 ? global.Math.max(r56, property3 + 2 * r57) : 0;
const r63 = r42 > 0 ? (r42 - property3) / 2 : r57;
const reanimatedRexportModule = require(4017) /* metro dependency 4017: ReanimatedRexport */;
const useAnimatedStyle = reanimatedRexportModule.useAnimatedStyle;
closure = it_88235;
closure.__closure = {placeholderFieldHeight: r42, textFieldHeight: value45};
closure.__workletHash = 14640048327678;
closure.__initData = env0_37;
const value67 = Reflect.apply(useAnimatedStyle, reanimatedRexportModule, [closure]);
const value68 = (UseChatInputRefs)({chatInputProps: {analyticsLocations: analyticsLocations,
canUpload: canUpload, channel: channel, defaultValue: r45, hasAttachmentsToUpload: value31,
pendingEdit: value29, pendingReply: value30, screenIndex: screenIndex,
secondaryTextFieldRef: secondaryTextFieldRef, threadCreationCallback: threadCreationCallback},
chatInputTextFieldHeight: value45, ref: a1});
binding = env0_6;
binding.useEffect(_fun88236, [value68]);
binding.useEffect(_fun88237, [value68, channel, value29, value30]);
binding.useEffect(function() {
var closure = _fun88239;
var env0_0 = closure;
var ComponentDispatch = require(dependencyMap[43]).ComponentDispatch;
ComponentDispatch.subscribe(ComponentActions.TEXTAREA_FOCUS, closure);
return _fun88240;
}, [value68]);
const value69 = binding.useMemo(_fun88241, [value68]);
const value70 = binding.useCallback(_fun88271, [value20, value68]);
const value71 = binding.useCallback(function() {
return true;
}, []);
const value72 = binding.useCallback(_fun88273, [editable, value53, value68]);
const value73 = ((Component) => <Component canUpload={canUpload} channelId={channel.id} screenIndex={screenIndex} />)(ChatInputImageCarousel);
if (editable) {
ChatInputActions = importDefault(11756) /* metro dependency 11756: ChatInputActions */;
var defaultImport6Props = {ref: value68.chatInputActions, channel: channel,
onPressAction: value69.handlePressAction, canStartThreads: r66, isAppLauncherEnabled: r62,
keyboardType: value46};
r62 = canUpload && activeCommand == null;
r62 = !r62 ? r35 : r62;
defaultImport6Props.shouldPhotosButtonBeDisabled = !r62;
defaultImport6Props.canUpload = canUpload;
r62 = value20 ? value48 : (require(3815) /* metro dependency 3815: BillingPlatformUtils */).isPremiumGiftingSupported();
defaultImport6Props.shouldShowGiftButton = r62;
defaultImport6Props.canPostPolls = r35;
defaultImport6Props.onPollsPress = value69.handlePollsPress;
defaultImport6Props.onAttachPress = value69.handleAttachPress;
r42 = <ChatInputActions {...defaultImport6Props} />;
} else {
r42 = null;
}
const View2 = (ReanimatedRexport).View;
const items2 = [styles.inputDefault, value67];
const PORTAL_KEYBOARD_PLACEHOLDER_INSTANCE = (PortalKeyboardPlaceholderModule).PORTAL_KEYBOARD_PLACEHOLDER_INSTANCE;
const handleFocus = value69.handleFocus;
const handleBlur = value69.handleBlur;
const handleChangeContentSize = value69.handleChangeContentSize;
const handleMaxHeightChanged = value69.handleMaxHeightChanged;
const handleSelectionOrTextChange = value69.handleSelectionOrTextChange;
const handleTextFlushed = value69.handleTextFlushed;
const handlePasteImage = value69.handlePasteImage;
const handlePasteCommand = value69.handlePasteCommand;
const handleTapAction = value69.handleTapAction;
const handlePressSend = value69.handlePressSend;
const value76 = '';
r62 = r60 == null ? placeholder : value76;
const chatInputNative = value68.chatInputNative;
const KeyboardTypes = (require(1583) /* metro dependency 1583: KeyboardTypes */).KeyboardTypes;
const MEDIA = KeyboardTypes.MEDIA;
const view = (
<View2 style={items2}>
<ChatInputNativeComponent
accessibilityLabel={accessibilityLabel}
customKeyboard={PORTAL_KEYBOARD_PLACEHOLDER_INSTANCE}
editable={editable}
onBeginFocus={handleFocus}
onEndBlur={handleBlur}
onChangeContentSize={handleChangeContentSize}
onMaxHeightChanged={handleMaxHeightChanged}
onSelectionOrTextChange={handleSelectionOrTextChange}
onTextFlushed={handleTextFlushed}
onPasteImage={handlePasteImage}
onPasteCommand={handlePasteCommand}
onTapAction={handleTapAction}
onRequestSend={handlePressSend}
placeholder={r62}
ref={chatInputNative}
setNoExtractUI={setNoExtractUI}
shouldShowCursor={value46 !== MEDIA}
verticalInset={r57}
/>
{
r54
? ((Text) => <Text pointerEvents="none" onLayout={value62} style={[styles.customPlaceholder,
{top: r63}]} variant="text-md/normal" color="text-muted" maxFontSizeMultiplier={2}>{r60}</Text>)((require(4573) /* metro dependency 4573: Text */).Text)
: null
}
{((Component) => <Component enabled={value55} keyboardType={value46} onSelectKeyboard={value69.handleToggleKeyboard} ref={value68.chatInputCover} />)(importDefault(11775) /* metro dependency 11775: ChatInputCover */)}
</View2>
);
const r28 = (
editable || value20
? ((Component) => <Component ref={value68.chatInputSendButton} canSendVoiceMessage={canSendVoiceMessage} channel={channel} defaultValue={r45} hasPendingAttachments={value31 && canUpload} hasPendingEdit={value29 != null} onSendMessage={value69.handlePressSend} requireTextContent={value48} />)(importDefault(11776) /* metro dependency 11776: ChatInputSendButton */)
: null
);
const items5 = [(GetChatInputPositionStyle)({isCreatingThread: value20})];
items5[1] = chatInputFloating && styles.overflowVisible;
items5[2] = chatInputFloating && value48 && styles.floatingScrimOverlap;
const items6 = [
chatInputFloating && !r32 && <ChatInputScrimGradient gradientHeight={r47} inline={false} scrimBase={r49} />,
];
let r12 = chatInputFloating && r32;
if (r12) {
object5 = {'position': 'absolute', 'top': 0, 'left': 0, 'right': 0, 'bottom': 0};
object5.backgroundColor = (require(673) /* metro dependency 673: ColorUtils */).hex2rgb(r49, 1) ?? r49;
r12 = <View style={object5} pointerEvents="none" />;
}
items6[1] = r12;
const ChatInputAccessibilityDivider = (ChatInputAccessibilityDividerModule).ChatInputAccessibilityDivider;
items6[2] = <ChatInputAccessibilityDivider />;
if (r19) {
DMMessageStickerGreeting = importDefault(11784) /* metro dependency 11784: DMMessageStickerGreeting */;
object6 = {channel: channel};
r45 = value76 !== r45 || value76 !== value68.chatInput.current?.getText();
object6.hasInputText = r45;
r12 = <DMMessageStickerGreeting {...object6} />;
} else {
r12 = null;
}
items6[3] = r12;
const items7 = [
chatInputFloating && r32 && <ChatInputScrimGradient gradientHeight={r50} inline scrimBase={r49} />,
];
items7[1] = (
value20
? null
: ((Component) => <Component channel={channel} screenIndex={screenIndex} wrapperStyle={chatInputFloating ? [styles.floatingTypingWrapper,
value15] : undefined} />)(importDefault(11788) /* metro dependency 11788: TypingIndicator */)
);
items7[2] = (
PlatformUtilsModule.isIOS()
? ((Component) => <Component channelId={channel.id} screenIndex={screenIndex} onJumpToPresent={onJumpToPresent} />)(importDefault(11790) /* metro dependency 11790: JumpToPresentButton */)
: null
);
items6[4] = (
<View style={styles.accessories}>
{items7}
</View>
);
items6[5] = (
isResourceChannel
? ((Component) => <Component channel={channel} key={channel.id} />)(importDefault(11804) /* metro dependency 11804: ResourceChannelButtons */)
: null
);
const MemberActionsChatInputBannerGuardedOuter = (MemberActionChatInputBannerModule).MemberActionsChatInputBannerGuardedOuter;
items6[6] = <MemberActionsChatInputBannerGuardedOuter channel={channel} />;
const DoubleTapToReactChatInputBanner = (DoubleTapToReactChatInputBannerModule).DoubleTapToReactChatInputBanner;
items6[7] = <DoubleTapToReactChatInputBanner channel={channel} />;
items6[8] = (
value22
? ((Component) => <Component channelId={channel.id} />)(importDefault(11850) /* metro dependency 11850: DiceRollBar */)
: null
);
const EXPRESSION = KeyboardTypes.EXPRESSION;
items6[9] = (
value46 === EXPRESSION
? null
: ((Component) => <Component ref={value68.chatInputAutocomplete} analyticsLocations={analyticsLocations} channel={channel} canMentionEveryone={canMentionEveryone} keyboardType={value46} onChangeAutoCompleteVisibility={value69.handleChangeAutoCompleteVisibility} commandsDisabled={r17} canOnlyUseTextCommands={value36} chatInputRef={value68.chatInput} screenIndex={screenIndex} />)(importDefault(11854) /* metro dependency 11854: AutocompleteWrapper */)
);
const value96 = !chatInputFloating;
items6[10] = (
chatInputFloating
? value96
: ((Component) => <Component channel={channel} />)(importDefault(11871) /* metro dependency 11871: ChatInputNotificationNudge */)
);
items6[11] = (
chatInputFloating
? value96
: ((Component) => <Component channel={channel} chatInputRef={value68.chatInput} pendingEdit={value29} pendingReply={value30} />)(importDefault(11002) /* metro dependency 11002: ChatInputContextBar */)
);
items6[12] = ((Component) => <Component ref={value68.chatInputAppCommandManager} canOnlyUseTextCommands={value36} channel={channel} chatInputRef={value68.chatInput} chatInputStateRef={value68.state} commandsDisabled={r17} />)(importDefault(11884) /* metro dependency 11884: ChatInputAppCommandManager */);
const items9 = [styles.container];
items9[1] = chatInputFloating && styles.floatingContainer;
const handleLayoutOfInputContainer = value69.handleLayoutOfInputContainer;
const jsxRuntimeEnv0_35Binding = jsxRuntimeEnv0_35;
const object8 = {};
if (chatInputFloating) {
items15 = [value73];
items15[1] = ((Component) => <Component channel={channel} />)(importDefault(11871) /* metro dependency 11871: ChatInputNotificationNudge */);
object7 = {};
r32 = r32 && styles.floatingInputBoxTyping;
object7.style = [styles.floatingInputBox, property && styles.floatingInputBoxPressed, r32];
object7.onStartShouldSetResponder = value71;
object7.onResponderRelease = value72;
object7.collapsable = false;
object7.accessibilityElementsHidden = value47;
object7.importantForAccessibility = value47 ? 'no-hide-descendants' : undefined;
items17 = [
((Component) => <Component channel={channel} chatInputRef={value68.chatInput} pendingEdit={value29} pendingReply={value30} />)(importDefault(11002) /* metro dependency 11002: ChatInputContextBar */),
];
var viewBinding10Props = {style: styles.floatingMainContents};
items18 = [
r42 != null
? (
<View style={{paddingBottom: value7, paddingLeft: value7}}>
{r42}
</View>
)
: null,
];
items18[1] = (
<View style={[styles.inputFlat, {paddingBottom: value7}]}>
{view}
{((Component) => <Component analyticsLocations={analyticsLocations} ref={value68.chatInputCharCounter} />)(importDefault(11886) /* metro dependency 11886: ChatInputCharCounter */)}
</View>
);
if (editable) {
var viewBinding13Props = {style: {paddingBottom: value7}};
ChatInputRightActions = importDefault(11887) /* metro dependency 11887: ChatInputRightActions */;
var defaultImport25Props = {ref: value68.chatInputRightActions, channel: channel, keyboardType: value46,
showKeyboardIcon: r39};
r37 = value20 ? value48 : (require(3815) /* metro dependency 3815: BillingPlatformUtils */).isPremiumGiftingSupported();
r37 = r37 && value55;
defaultImport25Props.shouldShowGiftButton = r37;
defaultImport25Props.onPressAction = value69.handlePressAction;
defaultImport25Props.onPressExpression = value69.handlePressExpression;
r29 = (
<View {...viewBinding13Props}>
<ChatInputRightActions {...defaultImport25Props} />
</View>
);
} else {
r29 = null;
}
items18[2] = r29;
items18[3] = r28;
items17[1] = (
<View {...viewBinding10Props}>
{items18}
</View>
);
items15[2] = (
<View {...object7}>
{items17}
</View>
);
object8.children = items15;
} else {
items10 = [value73];
var viewBinding4Props = {style: styles.containerInner, collapsable: false, accessibilityElementsHidden: value47,
importantForAccessibility: value47 ? 'no-hide-descendants' : undefined};
r45 = (
enabled
? (
<View style={styles.refreshButtonAlignment}>
{r42}
</View>
)
: r42
);
items11 = [r45];
items11[1] = (
<View style={[styles.input, {minHeight: value5 - 2 * value42}]}>
{view}
<View style={styles.rightAccessory}>
{
editable
? ((Component) => <Component active={value46 === (require(1583) /* metro dependency 1583: KeyboardTypes */).KeyboardTypes.EXPRESSION} showKeyboardIcon={r39} onPress={value69.handlePressExpression} />)(importDefault(11711) /* metro dependency 11711: ChatInputExpressionButton */)
: null
}
{((Component) => <Component analyticsLocations={analyticsLocations} ref={value68.chatInputCharCounter} />)(importDefault(11886) /* metro dependency 11886: ChatInputCharCounter */)}
</View>
</View>
);
r45 = (
enabled
? (
<View style={styles.refreshButtonAlignment}>
{r28}
</View>
)
: r28
);
items11[2] = r45;
items10[1] = (
<View {...viewBinding4Props}>
{items11}
</View>
);
object8.children = items10;
}
items6[13] = ((Component) => <Component style={items9} onLayout={handleLayoutOfInputContainer}>{((Fragment) => <Fragment {...object8} />)(jsxRuntimeEnv0_35Binding)}</Component>)(r14);
const view2 = (
<View
collapsable={false}
onLayout={value70}
style={items5}
>
{items6}
</View>
);
return (
value20
? view2
: ((Component) => <Component channel={channel} screenIndex={screenIndex} canSendMessages={editable} canCreateThreads={canCreateThreads} onJumpToPresent={onJumpToPresent} isReadonly={value50}>{view2}</Component>)(importDefault(11888) /* metro dependency 11888: ChatInputGuardWrapper */)
);
function _fun88223() { // fn#88223, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11711:5125, offset: 0x01fdc98d, size: 23 bytes, params: 1, frame: 3
return {paddingLeft: 2 * env0_3};
}
function _fun88225() { // fn#88225, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11711:5481, offset: 0x01fdc9be, size: 41 bytes, params: 1, frame: 12
return env0_6 ? null : EditMessageStore.getEditingTextValue(channel.id);
}
function _fun88226() { // fn#88226, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11711:5559, offset: 0x01fdc9e7, size: 41 bytes, params: 1, frame: 12
return env0_6 ? undefined : PendingReplyStore.getPendingReply(channel.id);
}
function _fun88227() { // fn#88227, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11711:5635, offset: 0x01fdca10, size: 74 bytes, params: 1, frame: 13
if (env0_6) {
return false;
}
const uploadAttachmentStoreBinding = UploadAttachmentStore;
const getUploads = uploadAttachmentStoreBinding.getUploads;
const id = channel.id;
const ChannelMessage = DraftType.ChannelMessage;
const value = Reflect.apply(getUploads, uploadAttachmentStoreBinding, [id, ChannelMessage]);
return value != null && value.length > 0;
}
function _fun88228() { // fn#88228, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11711:5741, offset: 0x01fdca5a, size: 58 bytes, params: 1, frame: 15
return DraftStore.getDraft(channel.id, env0_6 ? DraftType.FirstThreadMessage : DraftType.ChannelMessage);
}
function _fun88229() { // fn#88229, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11711:5875, offset: 0x01fdca94, size: 346 bytes, params: 1, frame: 21
let value = environment.__proto__;
let permissionStoreBinding = PermissionStore;
let can = permissionStoreBinding.can;
const ATTACH_FILES = Permissions.ATTACH_FILES;
let channelBinding = channel;
const value3 = Reflect.apply(can, permissionStoreBinding, [ATTACH_FILES, channelBinding]);
can = permissionStoreBinding.can;
const MENTION_EVERYONE = Permissions.MENTION_EVERYONE;
const value4 = Reflect.apply(can, permissionStoreBinding, [MENTION_EVERYONE, channelBinding]);
can = permissionStoreBinding.can;
const SEND_MESSAGES = Permissions.SEND_MESSAGES;
const value5 = Reflect.apply(can, permissionStoreBinding, [SEND_MESSAGES, channelBinding]);
can = permissionStoreBinding.can;
const SEND_VOICE_MESSAGES = Permissions.SEND_VOICE_MESSAGES;
const value6 = Reflect.apply(can, permissionStoreBinding, [SEND_VOICE_MESSAGES, channelBinding]);
can = permissionStoreBinding.can;
const CREATE_PUBLIC_THREADS = Permissions.CREATE_PUBLIC_THREADS;
const r1 = Reflect.apply(can, permissionStoreBinding, [CREATE_PUBLIC_THREADS,
channelBinding]) || PermissionStore.can(Permissions.CREATE_PRIVATE_THREADS, channel);
permissionStoreBinding = PermissionStore;
can = permissionStoreBinding.can;
const SEND_MESSAGES_IN_THREADS = Permissions.SEND_MESSAGES_IN_THREADS;
channelBinding = channel;
const value9 = Reflect.apply(can, permissionStoreBinding, [SEND_MESSAGES_IN_THREADS, channelBinding]);
const isPrivate2 = channelBinding.isPrivate();
value = require(6860) /* metro dependency 6860: ThreadHooks */;
value = value.computeIsReadOnlyThread(channelBinding);
let r2 = env0_6 ? value9 : isPrivate2 || value5;
r2 = r2 ? value : !r2;
return {canMentionEveryone: (isPrivate2 || value4 && !r2) && !env0_6,
canUpload: (isPrivate2 || value3) && !r2 && !env0_6,
canSendVoiceMessage: (isPrivate2 || value6) && !r2 && !env0_6, editable: !r2, canCreateThreads: r1};
}
function _fun88230() { // fn#88230, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11711:6831, offset: 0x01fdcbee, size: 38 bytes, params: 1, frame: 13
VoiceMessagesUIStoreModule.useVoiceMessagesUIStore.set(chatInputFloating ? env0_2 : env0_11);
}
function _fun88233() { // fn#88233, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11711:7376, offset: 0x01fdcc45, size: 31 bytes, params: 1, frame: 11
env0_14(env0_9.length > 0);
}
function _fun88234({nativeEvent}) { // fn#88234, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11711:7493, offset: 0x01fdcc64, size: 36 bytes, params: 2, frame: 11
env0_15(nativeEvent.layout.height);
}
function it_88235() { // fn#88235, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11711:7648, offset: 0x01fdcc88, size: 73 bytes, params: 1, frame: 16
return {minHeight: env0_16 > 0 ? global.Math.max(VoiceMessagesUIStoreModule.useVoiceMessagesUIStore.get(), env0_16) : VoiceMessagesUIStoreModule.useVoiceMessagesUIStore.get()};
}
function _fun88236() { // fn#88236, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11711:8072, offset: 0x01fdccd1, size: 53 bytes, params: 1, frame: 11
env0_17.chatInput.current.setText(env0_17.props.current.defaultValue);
}
function _fun88237() { // fn#88237, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11711:8166, offset: 0x01fdcd06, size: 286 bytes, params: 1, frame: 15
var value6;
let current = env0_17.propsPrev.current;
const pendingEdit = current.pendingEdit;
let r2 = current.pendingReply == null && env0_8 != null;
r2 = !r2 ? pendingEdit == null && ReactNativeModule.View != null : r2;
if (r2) {
current = env0_17.chatInput.current;
if (current != null) {
current.focus();
}
}
const id = env0_17.propsPrev.current.channel.id;
if (id === channel.id) {
if (pendingEdit !== ReactNativeModule.View) {
current = env0_17.chatInput.current;
if (current != null) {
current.setText(ReactNativeModule.View ?? '');
}
}
} else {
value6 = environment.__proto__;
if (id !== (require(5225) /* metro dependency 5225: FakePlaceholderPrivateChannel */).FAKE_PLACEHOLDER_PRIVATE_CHANNEL_ID) {
current = env0_17.chatInput.current;
if (current != null) {
current.setText(env0_17.props.current.defaultValue);
}
} else if (pendingEdit !== ReactNativeModule.View) {
current = env0_17.chatInput.current;
if (current != null) {
current.setText(ReactNativeModule.View ?? '');
}
}
}
}
function _fun88238() { // fn#88238, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11711:8598, offset: 0x01fdce24, size: 75 bytes, params: 1, frame: 15
const handleOpenKeyboard2 = handleOpenKeyboard;
let ComponentDispatch = (ComponentDispatchUtilsModule).ComponentDispatch;
const subscribe = ComponentDispatch.subscribe;
let TEXTAREA_FOCUS = ComponentActions.TEXTAREA_FOCUS;
Reflect.apply(subscribe, ComponentDispatch, [TEXTAREA_FOCUS, handleOpenKeyboard2]);
return function() {
var ComponentDispatch = require(dependencyMap[43]).ComponentDispatch;
var TEXTAREA_FOCUS = ComponentActions.TEXTAREA_FOCUS;
ComponentDispatch.unsubscribe(TEXTAREA_FOCUS, handleOpenKeyboard);
};
function handleOpenKeyboard(a0) { // fn#88239, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11711:8626, offset: 0x01fdce6f, size: 92 bytes, params: 2, frame: 14
const value = undefined;
const channelId = a0 == null ? value : a0.channelId;
let current = env1_17.props.current;
if (channelId === (current == null ? value : current.channel.id)) {
current = env1_17.chatInput.current;
if (current != null) {
current.openSystemKeyboard();
}
}
return value;
}
function _fun88240() { // fn#88240, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11711:8858, offset: 0x01fdcecb, size: 62 bytes, params: 1, frame: 14
const ComponentDispatch = (ComponentDispatchUtilsModule).ComponentDispatch;
const unsubscribe = ComponentDispatch.unsubscribe;
const TEXTAREA_FOCUS = ComponentActions.TEXTAREA_FOCUS;
Reflect.apply(unsubscribe, ComponentDispatch, [TEXTAREA_FOCUS, handleOpenKeyboard]);
}
}
function _fun88241() { // fn#88241, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11711:8966, offset: 0x01fdcf09, size: 259 bytes, params: 1, frame: 13
const object = {handleBlur: handleBlur_88242, handleFocus: handleFocus,
handleChangeContentSize: handleChangeContentSize, handleLayoutOfInputContainer: handleLayoutOfInputContainer,
handleLayout: handleLayout_88246, handleMaxHeightChanged: handleMaxHeightChanged,
handleChangeAutoCompleteVisibility: handleChangeAutoCompleteVisibility, handlePasteCommand: handlePasteCommand};
const env0_0 = env1_4(_fun88251);
object.handlePasteImage = handlePasteImage;
object.handlePressAction = handlePressAction;
object.handlePollsPress = handlePollsPress;
object.handleAttachPress = handleAttachPress;
object.handlePressExpression = handlePressExpression;
object.handlePressSend = handlePressSend;
object.handleSelectionOrTextChange = handleSelectionOrTextChange;
object.handleTapAction = handleTapAction;
object.handleTextOrFocusChange = handleTextOrFocusChange;
object.handleTextFlushed = handleTextFlushed;
object.handleToggleKeyboard = handleToggleKeyboard;
return object;
function handleBlur_88242({nativeEvent}) { // fn#88242, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11711:8989, offset: 0x01fdd00c, size: 305 bytes, params: 2, frame: 17
var setData;
var object;
const text = nativeEvent.text;
let value = environment.__proto__.__proto__;
(ChatInputFocusedModule).setIsAnyChatInputFocused(false);
value = environment.__proto__;
env1_18.handleTextOrFocusChange(text, false);
let state = env1_17.state;
let current = state.current;
current.focused = false;
env1_5(false);
current = env1_17.chatInputCover.current;
if (current != null) {
current.focused(false);
}
current = env1_17.chatInputAppCommandManager.current;
if (current != null) {
current.updateState();
}
current = env1_17.chatInputAutocomplete.current;
if (current != null) {
setData = current.setData;
object = {focused: false, text: text};
state = env1_17.state;
object.selectionStart = state.current.selectionStart;
state = env1_17.state;
object.selectionEnd = state.current.selectionEnd;
Reflect.apply(setData, current, [object]);
}
current = env1_17.chatInputSendButton.current;
if (current != null) {
current.setHasText(text.trim().length > 0);
}
}
function handleFocus({nativeEvent}) { // fn#88243, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11711:9502, offset: 0x01fdd13d, size: 297 bytes, params: 2, frame: 17
const start = nativeEvent.start;
const end = nativeEvent.end;
let value = environment.__proto__.__proto__;
(ChatInputFocusedModule).setIsAnyChatInputFocused(true);
value = environment.__proto__;
let current = env1_17.state.current;
current.focused = true;
env1_5(true);
env1_17.state.current.selectionStart = start;
env1_17.state.current.selectionEnd = end;
const binding = env1_18;
binding.handleTextOrFocusChange(env1_17.state.current.text, true);
current = env1_17.chatInputAppCommandManager.current;
if (current != null) {
current.updateState();
}
current = env1_17.chatInputCover.current;
if (current != null) {
current.focused(true);
}
current = env1_17.chatInputAutocomplete.current;
if (current != null) {
current.setData({focused: true, text: env1_17.state.current.text, selectionStart: start, selectionEnd: end});
}
}
function handleChangeContentSize({nativeEvent}) { // fn#88244, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11711:10006, offset: 0x01fdd266, size: 105 bytes, params: 2, frame: 14
const height = nativeEvent.height;
let value = environment.__proto__;
env1_17.state.current.textFieldContentSize = height;
const textFieldHeight = env1_17.state.current.textFieldHeight;
const set = textFieldHeight.set;
value = environment.__proto__.__proto__;
value = require(11533) /* metro dependency 11533: useChatInputMaxHeight */;
const getChatInputHeightAnimationTiming = value.getChatInputHeightAnimationTiming;
Reflect.apply(set, textFieldHeight, [Reflect.apply(getChatInputHeightAnimationTiming, value, [height])]);
}
function handleLayoutOfInputContainer({nativeEvent}) { // fn#88245, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11711:10189, offset: 0x01fdd2cf, size: 59 bytes, params: 2, frame: 11
const current = env1_17.chatInputAutocomplete.current;
if (current != null) {
current.setChatInputHeight(nativeEvent.layout.height);
}
}
function handleLayout_88246({nativeEvent}) { // fn#88246, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11711:10311, offset: 0x01fdd30a, size: 100 bytes, params: 2, frame: 13
const {height, width} = nativeEvent.layout;
let value = height !== 0;
if (value && width !== 0) {
value = environment.__proto__;
if (env1_17.props.current.threadCreationCallback == null) {
env1_17.chatInput.current.updateChatInputContainerHeightDebounced(height);
}
}
}
function handleMaxHeightChanged() { // fn#88247, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11711:10518, offset: 0x01fdd36e, size: 99 bytes, params: 1, frame: 14
var textFieldHeight;
var set;
let value = environment.__proto__;
const textFieldContentSize = env1_17.state.current.textFieldContentSize;
if (textFieldContentSize !== 0) {
textFieldHeight = env1_17.state.current.textFieldHeight;
set = textFieldHeight.set;
value = environment.__proto__.__proto__;
value = require(11533) /* metro dependency 11533: useChatInputMaxHeight */;
Reflect.apply(set, textFieldHeight, [value.getChatInputHeightAnimationTiming(textFieldContentSize)]);
}
}
function handleChangeAutoCompleteVisibility(a0) { // fn#88248, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11711:10694, offset: 0x01fdd3d1, size: 43 bytes, params: 2, frame: 13
updateShowingAutoComplete(env1_17.props.current.screenIndex, a0);
}
function handlePasteCommand({nativeEvent}) { // fn#88249, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11711:10752, offset: 0x01fdd3fc, size: 122 bytes, params: 2, frame: 16
var r1;
var r2;
var value2;
var applicationCommandManager;
const data = nativeEvent.data;
let current = env1_17.state.current;
if (current.focused) {
current = env1_17.chatInputAppCommandManager.current;
value2 = current == null;
if (value2) {
r1 = value2;
r2 = current;
} else {
applicationCommandManager = current.getApplicationCommandManager();
r1 = applicationCommandManager == null;
r2 = applicationCommandManager;
}
if (!r1) {
r2.setPastedCommand(data, env1_17.props.current.channel);
}
}
}
async function _fun88251({nativeEvent}) { // fn#88251, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11711:10977, offset: 0x01fdd48a, size: 344 bytes, params: 2, frame: 23
var value4;
var binding;
var value5;
var value6;
var binding2;
var value8;
var addFile;
var object;
var object2;
if (true) {
var url = nativeEvent.url;
var width = nativeEvent.width;
var height = nativeEvent.height;
var type = nativeEvent.type;
await undefined;
if (false) {
return undefined;
}
value = environment.__proto__.__proto__;
if (UploadAttachmentStore.state.current.focused) {
if (UploadAttachmentStore.props.current.canUpload) {
value4 = environment.__proto__.__proto__.__proto__;
binding = env3_0;
value5 = binding(env3_3[45]);
await value5.getImageDimensionsIfMissing(url, width, height);
value6 = undefined;
if (false) {
return value6;
}
binding = env3_1;
binding2 = env3_3;
value8 = binding(binding2[46]);
addFile = value8.addFile;
object = {};
object.channelId = UploadAttachmentStore.props.current.channel.id;
object2 = {uri: url, originalUri: url};
width = value6.width;
object2.width = width;
height = value6.height;
object2.height = height;
object2.mimeType = type;
binding = env3_0;
object2.platform = binding(binding2[47]).UploadPlatform.REACT_NATIVE;
object2.id = binding(binding2[48]).v4();
object.file = object2;
object.draftType = env3_14.ChannelMessage;
Reflect.apply(addFile, value8, [object]);
return undefined;
}
}
}
}
function handlePasteImage() { // fn#88252, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11711:11367, offset: 0x00c3945f, size: 30 bytes, params: 1, frame: 13
return env0_0.apply(this, arguments);
}
function handlePressAction(a0, a1, a2) { // fn#88253, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11711:11429, offset: 0x01fdd5e2, size: 1440 bytes, params: 4, frame: 21
var environment;
const HapticFeedbackTypes = (require(4081) /* metro dependency 4081: HapticUtilsNative */).HapticFeedbackTypes;
var handleSelectThread;
var value3;
var props;
var current;
var channel;
var moduleValue;
var moduleValue2;
var moduleValue4;
var handleSelectGift;
var value4;
var handleViewAllDialog;
var object;
var value5;
var value6;
var moduleValue5;
var moduleValue6;
var defaultImport2;
var track;
var CHAT_INPUT_COMPONENT_VIEWED;
var value7;
var moduleValue8;
var value8;
var binding;
var handleToggleKeyboard;
const KeyboardTypes = (KeyboardTypesModule).KeyboardTypes;
var object2;
var getAppDMApplication;
var value9;
var MEDIA;
let value = a2;
const PHOTOS = ChatInputActionType.PHOTOS;
if (PHOTOS === a1) {
value = require(4081) /* metro dependency 4081: HapticUtilsNative */;
value.triggerHapticFeedback(HapticFeedbackTypes.IMPACT_LIGHT);
value = importDefault(683) /* metro dependency 683: AnalyticsUtils */;
track = value.track;
CHAT_INPUT_COMPONENT_VIEWED = AnalyticEvents.CHAT_INPUT_COMPONENT_VIEWED;
object = {};
object.type = ChatInputComponentViewedTypes.ADD_BUTTON;
value9 = environment.__proto__;
props = env1_17.props;
current = props.current;
channel = current.channel;
object.channel_id = channel.id;
props = env1_17.props;
current = props.current;
channel = current.channel;
object.guild_id = channel.guild_id;
Reflect.apply(track, value, [CHAT_INPUT_COMPONENT_VIEWED, object]);
current = env1_4.current;
if (current) {
value = require(4022) /* metro dependency 4022: useKeyboardType */;
value = value.getKeyboardType();
if (value === KeyboardTypes.APP_LAUNCHER) {
env1_18.handleToggleKeyboard({type: KeyboardTypes.APP_LAUNCHER});
} else {
value = require(4022) /* metro dependency 4022: useKeyboardType */;
value = value.getKeyboardType();
MEDIA = KeyboardTypes.MEDIA;
if (value === MEDIA) {
current = env1_17.chatInputActions.current;
if (current != null) {
current.focusPhotosButton();
}
}
binding = env1_18;
handleToggleKeyboard = binding.handleToggleKeyboard;
MEDIA = KeyboardTypes.MEDIA;
Reflect.apply(handleToggleKeyboard, binding, [{type: MEDIA,
context: {target: MediaKeyboardTarget.CHAT}}]);
}
} else {
value = require(4022) /* metro dependency 4022: useKeyboardType */;
value = value.getKeyboardType();
MEDIA = KeyboardTypes.MEDIA;
if (value === MEDIA) {
current = env1_17.chatInputActions.current;
if (current != null) {
current.focusPhotosButton();
}
}
binding = env1_18;
handleToggleKeyboard = binding.handleToggleKeyboard;
MEDIA = KeyboardTypes.MEDIA;
Reflect.apply(handleToggleKeyboard, binding, [{type: MEDIA, context: {target: MediaKeyboardTarget.CHAT}}]);
}
} else if (ChatInputActionType.APPS === a1) {
value6 = undefined;
moduleValue5 = require(4081) /* metro dependency 4081: HapticUtilsNative */;
moduleValue5.triggerHapticFeedback(HapticFeedbackTypes.IMPACT_LIGHT);
moduleValue6 = require(4863) /* metro dependency 4863: AppAnalyticsUtils */;
moduleValue6.trackWithMetadata(AnalyticEvents.APP_LAUNCHER_ENTRYPOINT_BUTTON_CLICKED);
defaultImport2 = importDefault(683) /* metro dependency 683: AnalyticsUtils */;
track = defaultImport2.track;
CHAT_INPUT_COMPONENT_VIEWED = AnalyticEvents.CHAT_INPUT_COMPONENT_VIEWED;
object = {};
object.type = ChatInputComponentViewedTypes.APPS_BUTTON;
value7 = environment.__proto__;
props = env1_17.props;
current = props.current;
channel = current.channel;
object.channel_id = channel.id;
props = env1_17.props;
current = props.current;
channel = current.channel;
object.guild_id = channel.guild_id;
Reflect.apply(track, defaultImport2, [CHAT_INPUT_COMPONENT_VIEWED, object]);
(importAll(7860) /* metro dependency 7860: EmbeddedActivitiesActionCreators */).dismissNewActivityIndicator();
moduleValue8 = require(11575) /* metro dependency 11575: AppLauncherKeyboard */;
value8 = null;
moduleValue8.setAppLauncherA11yFocusReturnRef(value8 != value ? value : value8);
binding = env1_18;
handleToggleKeyboard = binding.handleToggleKeyboard;
object = {};
object.type = KeyboardTypes.APP_LAUNCHER;
object2 = {};
object2.initialRouteName = AppLauncherRouteName.HOME;
value = require(11732) /* metro dependency 11732: getAppDMApplication */;
getAppDMApplication = value.getAppDMApplication;
props = env1_17.props;
current = props.current;
channel = current.channel;
value = Reflect.apply(getAppDMApplication, value, [channel]);
object2.initialSearchQuery = value8 == value ? value6 : value.name;
object.context = object2;
Reflect.apply(handleToggleKeyboard, binding, [object]);
} else if (ChatInputActionType.ALL_PHOTOS === a1) {
value = require(4081) /* metro dependency 4081: HapticUtilsNative */;
value.triggerHapticFeedback(HapticFeedbackTypes.IMPACT_LIGHT);
value = require(11095) /* metro dependency 11095: MediaKeyboardUtils */;
handleViewAllDialog = value.handleViewAllDialog;
value5 = environment.__proto__;
Reflect.apply(handleViewAllDialog, value, [{channel: env1_17.props.current.channel,
uploadLimit: MAX_UPLOAD_COUNT,
onDismissKeyboard: onDismissKeyboard_88254, onRestoreKeyboard: onRestoreKeyboard,
onSelectFiles: onSelectFiles_88256, draftType: DraftType.ChannelMessage}]);
} else if (ChatInputActionType.NITRO_GIFT === a1) {
(importDefault(1847) /* metro dependency 1847: KeyboardStateDebugging */).markPotentialBadState();
moduleValue = require(4081) /* metro dependency 4081: HapticUtilsNative */;
moduleValue.triggerHapticFeedback(HapticFeedbackTypes.IMPACT_LIGHT);
moduleValue2 = require(477) /* metro dependency 477: PlatformUtils */;
if (moduleValue2.isAndroid()) {
(require(4015) /* metro dependency 4015: ChatInputUtils */).dismissKeyboard();
}
moduleValue4 = require(11095) /* metro dependency 11095: MediaKeyboardUtils */;
handleSelectGift = moduleValue4.handleSelectGift;
value4 = environment.__proto__;
Reflect.apply(handleSelectGift, moduleValue4, [env1_17.props.current.analyticsLocations, env1_17.chatInput,
value]);
} else if (ChatInputActionType.THREAD === a1) {
value = require(4081) /* metro dependency 4081: HapticUtilsNative */;
value.triggerHapticFeedback(HapticFeedbackTypes.IMPACT_LIGHT);
value = require(11095) /* metro dependency 11095: MediaKeyboardUtils */;
handleSelectThread = value.handleSelectThread;
value3 = environment.__proto__;
Reflect.apply(handleSelectThread, value, [env1_17.props.current.channel, env1_17.chatInput]);
}
function handlePressActionOnDismissKeyboard() { // fn#88254, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11711:12859, owner: handlePressAction.onDismissKeyboard, offset: 0x01fddb82, size: 37 bytes, params: 1, frame: 11
const value = environment.__proto__.__proto__.__proto__;
return (ChatInputUtilsModule).dismissKeyboard();
}
function handlePressActionOnRestoreKeyboard() { // fn#88255, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11711:12908, owner: handlePressAction.onRestoreKeyboard, offset: 0x01fddba7, size: 63 bytes, params: 1, frame: 14
const binding = env2_18;
const handleToggleKeyboard = binding.handleToggleKeyboard;
const KeyboardTypes = (KeyboardTypesModule).KeyboardTypes;
const SYSTEM = KeyboardTypes.SYSTEM;
return Reflect.apply(handleToggleKeyboard, binding, [{type: SYSTEM}]);
}
function handlePressActionOnSelectFiles(a0) { // fn#88256, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11711:12988, owner: handlePressAction.onSelectFiles, offset: 0x01fddbe6, size: 94 bytes, params: 2, frame: 17
let value = environment.__proto__.__proto__.__proto__;
value = require(11095) /* metro dependency 11095: MediaKeyboardUtils */;
const addImagesFromPicker = value.addImagesFromPicker;
const id = env2_17.props.current.channel.id;
const UploadOrigin = (UploadModule).UploadOrigin;
const IMAGE_PICKER = UploadOrigin.IMAGE_PICKER;
Reflect.apply(addImagesFromPicker, value, [id, a0, IMAGE_PICKER]);
}
}
function handlePollsPress() { // fn#88257, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11711:13555, offset: 0x01fddc44, size: 255 bytes, params: 1, frame: 18
const triggerHapticFeedback = HapticUtilsNativeModule.triggerHapticFeedback;
const HapticFeedbackTypes = HapticUtilsNativeModule.HapticFeedbackTypes;
const IMPACT_LIGHT = HapticFeedbackTypes.IMPACT_LIGHT;
Reflect.apply(triggerHapticFeedback, HapticUtilsNativeModule, [IMPACT_LIGHT]);
const defaultImport = AnalyticsUtils;
const track = defaultImport.track;
const CHAT_INPUT_COMPONENT_VIEWED = AnalyticEvents.CHAT_INPUT_COMPONENT_VIEWED;
const POLLS = ChatInputComponentViewedTypes.POLLS;
Reflect.apply(track, defaultImport, [CHAT_INPUT_COMPONENT_VIEWED, {type: POLLS,
channel_id: env1_17.props.current.channel.id, guild_id: env1_17.props.current.channel.guild_id}]);
(ChatInputUtilsModule).dismissKeyboard();
(PollCreationModalActionCreatorsModule).openCreatePollModal({channel: env1_17.props.current.channel,
onCancel: onCancel_88258});
function handlePollsPressOnCancel() { // fn#88258, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11711:13876, owner: handlePollsPress.onCancel, offset: 0x01fddba7, size: 63 bytes, params: 1, frame: 14
const binding = env2_18;
const handleToggleKeyboard = binding.handleToggleKeyboard;
const KeyboardTypes = (KeyboardTypesModule).KeyboardTypes;
const SYSTEM = KeyboardTypes.SYSTEM;
return Reflect.apply(handleToggleKeyboard, binding, [{type: SYSTEM}]);
}
}
function handleAttachPress() { // fn#88259, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11711:13963, offset: 0x01fddd43, size: 157 bytes, params: 1, frame: 16
const triggerHapticFeedback = HapticUtilsNativeModule.triggerHapticFeedback;
const HapticFeedbackTypes = HapticUtilsNativeModule.HapticFeedbackTypes;
const IMPACT_LIGHT = HapticFeedbackTypes.IMPACT_LIGHT;
Reflect.apply(triggerHapticFeedback, HapticUtilsNativeModule, [IMPACT_LIGHT]);
(MediaKeyboardUtilsModule).handleAttachFile({channel: env1_17.props.current.channel,
uploadLimit: MAX_UPLOAD_COUNT, onDismissKeyboard: onDismissKeyboard_88260, onRestoreKeyboard: onRestoreKeyboard,
onSelectFiles: onSelectFiles_88262});
function handleAttachPressOnDismissKeyboard() { // fn#88260, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11711:14134, owner: handleAttachPress.onDismissKeyboard, offset: 0x01fddb82, size: 37 bytes, params: 1, frame: 11
const value = environment.__proto__.__proto__.__proto__;
return (ChatInputUtilsModule).dismissKeyboard();
}
function handleAttachPressOnRestoreKeyboard() { // fn#88261, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11711:14183, owner: handleAttachPress.onRestoreKeyboard, offset: 0x01fddba7, size: 63 bytes, params: 1, frame: 14
const binding = env2_18;
const handleToggleKeyboard = binding.handleToggleKeyboard;
const KeyboardTypes = (KeyboardTypesModule).KeyboardTypes;
const SYSTEM = KeyboardTypes.SYSTEM;
return Reflect.apply(handleToggleKeyboard, binding, [{type: SYSTEM}]);
}
function handleAttachPressOnSelectFiles(a0) { // fn#88262, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11711:14263, owner: handleAttachPress.onSelectFiles, offset: 0x01fddde0, size: 94 bytes, params: 2, frame: 17
let value = environment.__proto__.__proto__.__proto__;
value = require(11095) /* metro dependency 11095: MediaKeyboardUtils */;
const addImagesFromPicker = value.addImagesFromPicker;
const id = env2_17.props.current.channel.id;
const UploadOrigin = (UploadModule).UploadOrigin;
const FILE_ATTACHMENT = UploadOrigin.FILE_ATTACHMENT;
Reflect.apply(addImagesFromPicker, value, [id, a0, FILE_ATTACHMENT]);
}
}
function handlePressExpression(a0) { // fn#88263, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11711:14391, offset: 0x01fdde3e, size: 103 bytes, params: 2, frame: 15
const initiateEmojiInteraction = EmojiActionCreatorsModule.initiateEmojiInteraction;
const ChatInputExpressionPressed = EmojiInteractionPoint.ChatInputExpressionPressed;
Reflect.apply(initiateEmojiInteraction, EmojiActionCreatorsModule, [ChatInputExpressionPressed]);
const binding = env1_18;
const handleToggleKeyboard = binding.handleToggleKeyboard;
const KeyboardTypes = (KeyboardTypesModule).KeyboardTypes;
const EXPRESSION = KeyboardTypes.EXPRESSION;
Reflect.apply(handleToggleKeyboard, binding, [{type: EXPRESSION, context: a0}]);
}
function handlePressSend() { // fn#88264, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11711:14552, offset: 0x01fddea5, size: 32 bytes, params: 1, frame: 9
env1_17.chatInput.current.handleSend();
}
function handleSelectionOrTextChange({nativeEvent}) { // fn#88265, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11711:14620, offset: 0x01fddec5, size: 406 bytes, params: 2, frame: 20
const start = nativeEvent.start;
const end = nativeEvent.end;
const text = nativeEvent.text;
const editId = nativeEvent.editId;
let value = environment.__proto__;
let current = env1_17.state.current;
const editId2 = current.editId;
env1_17.state.current.editId = editId;
env1_17.state.current.selectionStart = start;
env1_17.state.current.selectionEnd = end;
const binding = env1_18;
binding.handleTextOrFocusChange(text, env1_17.state.current.focused);
current = env1_17.chatInputAppCommandManager.current;
if (current != null) {
current.updateState();
}
current = env1_17.chatInputAutocomplete.current;
if (current != null) {
current.setData({focused: env1_17.state.current.focused, text: text, selectionStart: start, selectionEnd: end});
}
current = env1_17.chatInputSendButton.current;
if (current != null) {
current.setHasText(text.trim().length > 0);
}
if (editId2 !== editId) {
current = env1_17.chatInput.current;
current.handleTextChanged(text);
current = env1_17.chatInputCharCounter.current;
if (current != null) {
current.onMessageLengthChanged(text.length);
}
value = environment.__proto__.__proto__;
value = require(8812) /* metro dependency 8812: ContextMenuStateNative */;
value.hideContextMenu();
}
}
function handleTapAction({nativeEvent}) { // fn#88266, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11711:15302, offset: 0x01fde05b, size: 183 bytes, params: 2, frame: 18
var environment;
var value;
var chatInput;
var current;
var value2;
var value3;
var moduleValue;
var openCommandAttachmentPreview;
var applicationCommandManager;
var channelId;
var optionName;
const tapAction = nativeEvent.tapAction;
if (tapAction.action === 'tapAttachment') {
value = environment.__proto__;
chatInput = env1_17.chatInput;
current = chatInput.current;
current.blur();
value2 = environment.__proto__.__proto__;
value3 = undefined;
moduleValue = require(11752) /* metro dependency 11752: ApplicationCommandUtils */;
openCommandAttachmentPreview = moduleValue.openCommandAttachmentPreview;
chatInput = env1_17.chatInput;
current = chatInput.current;
applicationCommandManager = current.getApplicationCommandManager();
channelId = tapAction.channelId;
optionName = tapAction.optionName;
current = env1_17.state.current;
Reflect.apply(openCommandAttachmentPreview, moduleValue, [applicationCommandManager, channelId, optionName,
current.focused ? _fun88267 : value3]);
}
function _fun88267() { // fn#88267, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11711:15531, offset: 0x01fde112, size: 30 bytes, params: 1, frame: 9
return env2_17.chatInput.current.openSystemKeyboard();
}
}
function handleTextOrFocusChange(a0, a1) { // fn#88268, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11711:15611, offset: 0x01fde130, size: 449 bytes, params: 3, frame: 16
var current;
var value2;
var nativeMenuStoreBinding;
var defaultImport2;
const binding = env1_14;
let length = a0.length;
binding(length > 0);
length = a0.length;
if (length > 0) {
if (a1) {
value2 = environment.__proto__.__proto__;
nativeMenuStoreBinding = NativeMenuStore;
if (nativeMenuStoreBinding.isOpen()) {
(importDefault(11110) /* metro dependency 11110: NativeMenuActionCreators */).hideNativeMenu();
}
current = env1_17.chatInputActions.current;
if (current != null) {
current.onDismissActions(a1);
}
current = env1_17.chatInputRightActions.current;
if (current != null) {
current.onDismissActions(a1);
}
} else {
length = a0.length;
current = env1_17.state.current;
if (length > current.textPrev.length) {
value2 = environment.__proto__.__proto__;
nativeMenuStoreBinding = NativeMenuStore;
if (nativeMenuStoreBinding.isOpen()) {
(importDefault(11110) /* metro dependency 11110: NativeMenuActionCreators */).hideNativeMenu();
}
current = env1_17.chatInputActions.current;
if (current != null) {
current.onDismissActions(a1);
}
current = env1_17.chatInputRightActions.current;
if (current != null) {
current.onDismissActions(a1);
}
} else if (a0.length === 0) {
current = env1_17.chatInputActions.current;
if (current != null) {
current.onShowActions(a1);
}
current = env1_17.chatInputRightActions.current;
if (current != null) {
current.onShowActions(a1);
}
}
}
} else if (a0.length === 0) {
current = env1_17.chatInputActions.current;
if (current != null) {
current.onShowActions(a1);
}
current = env1_17.chatInputRightActions.current;
if (current != null) {
current.onShowActions(a1);
}
}
const maxMessageLength = (UseMessageMaxLengthModule).getMaxMessageLength();
if (env1_17.state.current.textPrev.length <= maxMessageLength && a0.length > maxMessageLength) {
defaultImport2 = importDefault(683) /* metro dependency 683: AnalyticsUtils */;
defaultImport2.track(AnalyticEvents.MESSAGE_LENGTH_LIMIT_REACHED, {});
}
env1_17.state.current.textPrev = env1_17.state.current.text;
env1_17.state.current.text = a0;
}
function handleTextFlushed({nativeEvent}) { // fn#88269, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11711:16247, offset: 0x01fde2f1, size: 65 bytes, params: 2, frame: 12
const text = nativeEvent.text;
const requestId = nativeEvent.requestId;
let value = environment.__proto__;
value = env1_17.chatInputTextFlushedResponses.current.get(requestId);
if (value != null) {
value(text);
}
}
function handleToggleKeyboard(a0) { // fn#88270, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11711:16378, offset: 0x01fde332, size: 198 bytes, params: 2, frame: 14
let value = environment.__proto__.__proto__;
const nativeMenuStoreBinding = NativeMenuStore;
if (nativeMenuStoreBinding.isOpen()) {
(importDefault(11110) /* metro dependency 11110: NativeMenuActionCreators */).hideNativeMenu();
}
let type = a0.type;
const KeyboardTypes = (KeyboardTypesModule).KeyboardTypes;
const SYSTEM = KeyboardTypes.SYSTEM;
if (type === SYSTEM) {
value = environment.__proto__;
env1_17.chatInput.current.openSystemKeyboard();
} else {
type = a0.type;
value = require(4022) /* metro dependency 4022: useKeyboardType */;
if (type === value.getKeyboardType()) {
value = environment.__proto__;
env1_17.chatInput.current.openSystemKeyboard();
} else {
value = environment.__proto__;
env1_17.chatInput.current.openCustomKeyboard(a0);
}
}
}
}
function _fun88271({nativeEvent}) { // fn#88271, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11711:16615, offset: 0x01fde3f8, size: 81 bytes, params: 2, frame: 13
const {height, width} = nativeEvent.layout;
if (height !== 0 && width !== 0) {
if (!env0_6) {
env0_17.chatInput.current.updateChatInputContainerHeightDebounced(height);
}
}
}
function _fun88273() { // fn#88273, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11711:16814, offset: 0x01fde449, size: 58 bytes, params: 1, frame: 9
var binding;
var current;
if (editable) {
binding = env0_13;
current = env0_17.chatInput.current;
if (binding) {
current.focus();
} else {
current.openSystemKeyboard();
}
}
}
}
}
global.__d(_fun88219, 11525, [5, 57, 31, 27, 7168, 11526, 10738, 7074, 11527, 4645, 7075, 3784, 4644, 7729, 11529,
661, 1483, 1881, 1580, 33, 4501, 697, 477, 3860, 673, 4589, 1357, 3963, 11530, 11531, 566, 6860, 6771, 7149,
11533, 4017, 4022, 8448, 11535, 11536, 11433, 11537, 5225, 1239, 1584, 4660, 7879, 4650, 491, 4081, 683, 1583,
4863, 7860, 11575, 11732, 11095, 4015, 1847, 11733, 8530, 8812, 11752, 11110, 7875, 11755, 11756, 3815, 11773,
11774, 4573, 11775, 11776, 11782, 11783, 11784, 11788, 11790, 11804, 11809, 11812, 11850, 11854, 11871, 11002,
11884, 11886, 11887, 11711, 11888,
2]) /* metro module 11525, dependencies: [5, 57, 31, 27, 7168, 11526, 10738, 7074, 11527, 4645, 7075, 3784, 4644, 7729, 11529, 661, 1483, 1881, 1580, 33, 4501, 697, 477, 3860, 673, 4589, 1357, 3963, 11530, 11531, 566, 6860, 6771, 7149, 11533, 4017, 4022, 8448, 11535, 11536, 11433, 11537, 5225, 1239, 1584, 4660, 7879, 4650, 491, 4081, 683, 1583, 4863, 7860, 11575, 11732, 11095, 4015, 1847, 11733, 8530, 8812, 11752, 11110, 7875, 11755, 11756, 3815, 11773, 11774, 4573, 11775, 11776, 11782, 11783, 11784, 11788, 11790, 11804, 11809, 11812, 11850, 11854, 11871, 11002, 11884, 11886, 11887, 11711, 11888, 2] */;