791 lines
50 KiB
TypeScript
791 lines
50 KiB
TypeScript
/* Metro module 11537; source: modules/chat_input/native/useChatInputRefs.tsx; dependencies: [31, 6583, 4645, 7075, 7080, 1878, 7729, 661, 6625, 4503, 6518, 4015, 22, 11538, 11540, 11541, 7875, 7165, 4022, 1583, 1482, 477, 4023, 1848, 683, 11005, 7067, 11004, 11542, 7076, 11543, 4643, 11574, 6996, 2] */
|
|
import Module00022 from '../../../by-id/module-00022.js'; /* Metro dependency 22 */
|
|
import UserStore from '../../../stores/UserStore.tsx'; /* Metro dependency 1878 */
|
|
import StickersStore from '../../stickers/StickersStore.tsx'; /* Metro dependency 6583 */
|
|
import EditMessageStore from '../../../stores/EditMessageStore.tsx'; /* Metro dependency 7075 */
|
|
import SlowmodeStore from '../../../stores/SlowmodeStore.tsx'; /* Metro dependency 7080 */
|
|
import OpenCustomKeyboardAndroid from '../../keyboard/native/openCustomKeyboard.android.tsx'; /* Metro dependency 11574 */
|
|
import * as FileImportTrackerModule from '../../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
|
|
import * as ReactModule from '../../../by-id/module-00031-React.js'; /* Metro dependency 31 */
|
|
import * as PlatformUtilsModule from '../../../utils/PlatformUtils.tsx'; /* Metro dependency 477 */
|
|
import * as ConstantsModule from '../../../Constants.tsx'; /* Metro dependency 661 */
|
|
import * as KeyboardTypesModule from '../../keyboard/native/KeyboardTypes.tsx'; /* Metro dependency 1583 */
|
|
import * as KeyboardManagerUtilsModule from '../../../utils/native/KeyboardManagerUtils.tsx'; /* Metro dependency 1848 */
|
|
import * as UseKeyboardTypeModule from '../../keyboard/native/useKeyboardType.tsx'; /* Metro dependency 4022 */
|
|
import * as PortalKeyboardUIStoreNativeModule from '../../keyboard/native/PortalKeyboardUIStore.native.tsx'; /* Metro dependency 4023 */
|
|
import * as MessageConstantsModule from '../../messages/MessageConstants.tsx'; /* Metro dependency 4503 */
|
|
import * as DraftStoreModule from '../../../stores/DraftStore.tsx'; /* Metro dependency 4645 */
|
|
import * as ChannelAutocompleteConstantsModule from '../../channel_autocomplete/ChannelAutocompleteConstants.tsx'; /* Metro dependency 6625 */
|
|
import * as UseChatBottomManagerUIStoreModule from './useChatBottomManagerUIStore.tsx'; /* Metro dependency 7729 */
|
|
import * as ChatInputSendUtilsModule from './accessories/ChatInputSendUtils.tsx'; /* Metro dependency 11543 */
|
|
|
|
function _fun88360(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#88360, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11723:6, offset: 0x01fe09d0, size: 295 bytes, params: 8, frame: 19
|
|
const env0_0 = require;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
(FileImportTrackerModule).fileFinishedImporting('modules/chat_input/native/useChatInputRefs.tsx');
|
|
exports.default = useChatInputRefs;
|
|
function useChatInputRefs({chatInputProps, chatInputTextFieldHeight, ref}) { // fn#88361, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11723:380, offset: 0x01fe0af7, size: 520 bytes, params: 2, frame: 21
|
|
const binding = env0_3;
|
|
let useRef = binding.useRef;
|
|
const env0_2 = Reflect.apply(useRef, binding, [null]);
|
|
var env0_3 = binding.useRef(null);
|
|
const env0_4 = binding.useRef(null);
|
|
const env0_5 = binding.useRef(null);
|
|
const env0_6 = binding.useRef(null);
|
|
const env0_7 = binding.useRef(null);
|
|
const env0_8 = binding.useRef(null);
|
|
const env0_9 = binding.useRef(null);
|
|
useRef = binding.useRef;
|
|
const Map = global.Map;
|
|
const value2 = Object.create(Map.prototype, {constructor: {value: Map}});
|
|
const map = new Map();
|
|
const env0_10 = Reflect.apply(useRef, binding, [map instanceof Object ? map : value2]);
|
|
let value = importDefault(6518) /* metro dependency 6518: useInitialValue */;
|
|
value = value(_fun88362);
|
|
const env0_12 = binding.useRef(chatInputProps);
|
|
const env0_13 = binding.useRef(chatInputProps);
|
|
binding.useEffect(_fun88363, [chatInputProps]);
|
|
binding.useEffect(_fun88364, [chatInputProps.channel.id]);
|
|
binding.useEffect(_fun88365, [value, chatInputProps.channel.id]);
|
|
const env0_14 = binding.useRef((importDefault(6518) /* metro dependency 6518: useInitialValue */)(function() {
|
|
var chatInputPropsBinding = chatInputProps;
|
|
return {'editId': null, 'focused': false, 'selectionStart': 0, 'selectionEnd': 0, 'text': null,
|
|
'textPrev': null,
|
|
'textFieldContentSize': 0, text: chatInputPropsBinding.defaultValue,
|
|
textPrev: chatInputPropsBinding.defaultValue, textFieldHeight: chatInputTextFieldHeight};
|
|
}));
|
|
const env0_15 = binding.useRef({'handledHereMention': false, 'sending': false});
|
|
value = binding.useMemo(_fun88368, [value]);
|
|
const chatInputRefObject = value.chatInputRefObject;
|
|
const chatInputRefObjectCallback = value.chatInputRefObjectCallback;
|
|
const env0_16 = binding.useRef(chatInputRefObject);
|
|
binding.useImperativeHandle(ref, chatInputRefObjectCallback);
|
|
return binding.useMemo(_fun88406, []);
|
|
function _fun88362() { // fn#88362, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11723:631, offset: 0x01fe0cff, size: 62 bytes, params: 1, frame: 13
|
|
let value = environment.__proto__;
|
|
value = require(4015) /* metro dependency 4015: ChatInputUtils */;
|
|
const createInputRefTracker = value.createInputRefTracker;
|
|
const chatInputPropsBinding = chatInputProps;
|
|
return Reflect.apply(createInputRefTracker, value, [chatInputPropsBinding.channel.id,
|
|
chatInputPropsBinding.screenIndex]);
|
|
}
|
|
|
|
function _fun88363() { // fn#88363, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11723:737, offset: 0x01fe0d3d, size: 98 bytes, params: 1, frame: 11
|
|
let current = env0_13.current;
|
|
if (current.channel.id !== chatInputProps.channel.id) {
|
|
current = env0_16.current;
|
|
if (current != null) {
|
|
current.flushPendingDraftSave();
|
|
}
|
|
}
|
|
const binding = env0_12;
|
|
const binding2 = env0_13;
|
|
binding.current = binding2.current;
|
|
binding2.current = chatInputProps;
|
|
}
|
|
|
|
function _fun88364() { // fn#88364, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11723:886, offset: 0x01fe0d9f, size: 24 bytes, params: 1, frame: 2
|
|
env0_15.current.handledHereMention = false;
|
|
}
|
|
|
|
function _fun88365() { // fn#88365, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11723:954, offset: 0x01fe0db7, size: 53 bytes, params: 1, frame: 13
|
|
ChannelAutocompleteConstantsModule.COMMAND_SENTINEL.handleRef(env0_16.current, chatInputProps.channel.id);
|
|
return _fun88366;
|
|
function _fun88366() { // fn#88366, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11723:995, offset: 0x01fe0dec, size: 39 bytes, params: 1, frame: 13
|
|
const binding = env1_11;
|
|
binding.handleRef(null, chatInputProps.channel.id);
|
|
}
|
|
|
|
}
|
|
|
|
function _fun88368() { // fn#88368, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11723:1292, offset: 0x01fe0e4b, size: 503 bytes, params: 1, frame: 18
|
|
var environment;
|
|
const value = environment.__proto__;
|
|
const env0_0 = (Module00022).throttle(_fun88369, 200);
|
|
const env0_1 = (Module00022).throttle(_fun88370, 500);
|
|
const env0_2 = (Module00022).debounce(_fun88371, 32);
|
|
return {chatInputRefObject: {backspace: backspace_88372, blur: blur_88373,
|
|
chatInputTrackerRegister: chatInputTrackerRegister, chatInputTrackerUnregister: chatInputTrackerUnregister,
|
|
clearText: clearText_88376, closeCustomKeyboard: closeCustomKeyboard_88377,
|
|
dismissKeyboard: dismissKeyboard_88378, flushPendingDraftSave: flushPendingDraftSave, focus: focus_88380,
|
|
getApplicationCommandManager: getApplicationCommandManager_88381, getText: getText_88382,
|
|
handleCancelEditing: handleCancelEditing, handlePressKey: handlePressKey, handleSaveEditing: handleSaveEditing,
|
|
handleSend: handleSend, handleSelectGIF: handleSelectGIF, handleSelectSticker: handleSelectSticker,
|
|
hideSideActions: hideSideActions, handleTextChanged: handleTextChanged, insertText: insertText,
|
|
isFocused: isFocused_88396, openCustomKeyboard: openCustomKeyboard_88397,
|
|
openSystemKeyboard: openSystemKeyboard_88398, replaceRange: replaceRange_88399,
|
|
setSelectedRange: setSelectedRange_88400, setText: setText_88401, showSideActions: showSideActions,
|
|
updateNativeTextBlocksThrottled: updateNativeTextBlocksThrottled,
|
|
updateChatInputContainerHeightDebounced: updateChatInputContainerHeightDebounced},
|
|
chatInputRefObjectCallback: chatInputRefObjectCallback};
|
|
function _fun88369(a0, a1) { // fn#88369, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11723:1322, offset: 0x01fe1042, size: 58 bytes, params: 3, frame: 16
|
|
let value = environment.__proto__.__proto__;
|
|
value = importDefault(11538) /* metro dependency 11538: ChatInputNativeCommands */;
|
|
value.updateTextBlocks(env1_8.current, a0, a1);
|
|
}
|
|
|
|
function _fun88370(a0) { // fn#88370, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11723:1399, offset: 0x01fe107c, size: 384 bytes, params: 2, frame: 20
|
|
var startsWith;
|
|
var value2;
|
|
var defaultImport;
|
|
var value3;
|
|
var defaultImport2;
|
|
var defaultImport3;
|
|
var value4;
|
|
var moduleValue;
|
|
var defaultImport4;
|
|
const current = env1_13.current;
|
|
const channel = current.channel;
|
|
if (current.pendingEdit == null) {
|
|
if (a0.length > 0) {
|
|
startsWith = a0.startsWith;
|
|
value2 = environment.__proto__.__proto__;
|
|
if (Reflect.apply(startsWith, a0, [COMMAND_SENTINEL])) {
|
|
value3 = environment.__proto__.__proto__;
|
|
defaultImport2 = importDefault(11540) /* metro dependency 11540: TypingActionCreators */;
|
|
defaultImport2.stopTyping(channel.id);
|
|
} else {
|
|
defaultImport = importDefault(11540) /* metro dependency 11540: TypingActionCreators */;
|
|
defaultImport.startTyping(channel.id);
|
|
}
|
|
} else {
|
|
value3 = environment.__proto__.__proto__;
|
|
defaultImport2 = importDefault(11540) /* metro dependency 11540: TypingActionCreators */;
|
|
defaultImport2.stopTyping(channel.id);
|
|
}
|
|
if (current.threadCreationCallback == null) {
|
|
if (!env1_15.current.handledHereMention) {
|
|
value4 = environment.__proto__.__proto__;
|
|
moduleValue = require(11541) /* metro dependency 11541: ChatInputContentCallbacks */;
|
|
if (moduleValue.tryUpdateSubscriptionForHereMention(a0,
|
|
(require(7875) /* metro dependency 7875: useMessageMaxLength */).getMaxMessageLength(),
|
|
channel.guild_id,
|
|
channel.id)) {
|
|
env1_15.current.handledHereMention = true;
|
|
}
|
|
}
|
|
value = environment.__proto__.__proto__;
|
|
defaultImport4 = importDefault(7165) /* metro dependency 7165: DraftActionCreators */;
|
|
defaultImport4.saveDraft(channel.id, a0, DraftType.ChannelMessage);
|
|
} else {
|
|
value = environment.__proto__.__proto__;
|
|
defaultImport3 = importDefault(7165) /* metro dependency 7165: DraftActionCreators */;
|
|
defaultImport3.saveDraft(channel.id, a0, DraftType.FirstThreadMessage);
|
|
}
|
|
}
|
|
}
|
|
|
|
function _fun88371(a0) { // fn#88371, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11723:1863, offset: 0x01fe11fc, size: 38 bytes, params: 2, frame: 13
|
|
updateChatInputContainerHeight(env1_13.current.screenIndex, a0);
|
|
}
|
|
|
|
function backspace_88372() { // fn#88372, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11723:1913, offset: 0x01fe1222, size: 50 bytes, params: 1, frame: 12
|
|
let value = environment.__proto__.__proto__;
|
|
value = importDefault(11538) /* metro dependency 11538: ChatInputNativeCommands */;
|
|
value.backspace(env1_8.current);
|
|
}
|
|
|
|
function blur_88373() { // fn#88373, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11723:1954, offset: 0x01fe1254, size: 50 bytes, params: 1, frame: 12
|
|
let value = environment.__proto__.__proto__;
|
|
value = importDefault(11538) /* metro dependency 11538: ChatInputNativeCommands */;
|
|
value.blur(env1_8.current);
|
|
}
|
|
|
|
function chatInputTrackerRegister() { // fn#88374, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11723:2010, offset: 0x01fe1286, size: 21 bytes, params: 1, frame: 9
|
|
env1_11.register();
|
|
}
|
|
|
|
function chatInputTrackerUnregister() { // fn#88375, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11723:2056, offset: 0x01fe129b, size: 21 bytes, params: 1, frame: 9
|
|
env1_11.unregister();
|
|
}
|
|
|
|
function clearText_88376() { // fn#88376, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11723:2087, offset: 0x01fe12b0, size: 37 bytes, params: 1, frame: 11
|
|
const current = env1_16.current;
|
|
if (current != null) {
|
|
current.setText('');
|
|
}
|
|
}
|
|
|
|
function closeCustomKeyboard_88377() { // fn#88377, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11723:2154, offset: 0x01fe12d5, size: 229 bytes, params: 1, frame: 16
|
|
var defaultImport;
|
|
var closeCustomKeyboard;
|
|
var value3;
|
|
const value = environment.__proto__.__proto__;
|
|
const keyboardType = (UseKeyboardTypeModule).getKeyboardType();
|
|
const KeyboardTypes = (KeyboardTypesModule).KeyboardTypes;
|
|
const SYSTEM = KeyboardTypes.SYSTEM;
|
|
if (keyboardType !== SYSTEM) {
|
|
(require(1482) /* metro dependency 1482: KeyboardUIStoreNative */).setKeyboardType({type: KeyboardTypes.SYSTEM});
|
|
}
|
|
if (!PlatformUtilsModule.isAndroid()) {
|
|
defaultImport = importDefault(11538) /* metro dependency 11538: ChatInputNativeCommands */;
|
|
closeCustomKeyboard = defaultImport.closeCustomKeyboard;
|
|
value3 = environment.__proto__;
|
|
Reflect.apply(closeCustomKeyboard, defaultImport, [env1_8.current]);
|
|
}
|
|
(PortalKeyboardUIStoreNativeModule).closePortalKeyboardRequest();
|
|
}
|
|
|
|
function dismissKeyboard_88378() { // fn#88378, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11723:2399, offset: 0x01fe13ba, size: 65 bytes, params: 1, frame: 11
|
|
let value = environment.__proto__.__proto__;
|
|
(KeyboardManagerUtilsModule).dismissGlobalKeyboard();
|
|
value = environment.__proto__;
|
|
const current = env1_16.current;
|
|
if (current != null) {
|
|
current.closeCustomKeyboard();
|
|
}
|
|
}
|
|
|
|
function flushPendingDraftSave() { // fn#88379, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11723:2511, offset: 0x01fe13fb, size: 21 bytes, params: 1, frame: 9
|
|
env0_1.flush();
|
|
}
|
|
|
|
function focus_88380() { // fn#88380, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11723:2533, offset: 0x01fe1410, size: 50 bytes, params: 1, frame: 12
|
|
let value = environment.__proto__.__proto__;
|
|
value = importDefault(11538) /* metro dependency 11538: ChatInputNativeCommands */;
|
|
value.focus(env1_8.current);
|
|
}
|
|
|
|
function getApplicationCommandManager_88381() { // fn#88381, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11723:2594, offset: 0x01fe1442, size: 35 bytes, params: 1, frame: 10
|
|
const value = environment.__proto__;
|
|
return env1_4.current?.getApplicationCommandManager();
|
|
}
|
|
|
|
function getText_88382() { // fn#88382, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11723:2681, offset: 0x01fe1465, size: 19 bytes, params: 1, frame: 1
|
|
return env1_14.current.text;
|
|
}
|
|
|
|
function handleCancelEditing() { // fn#88383, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11723:2720, offset: 0x01fe1478, size: 272 bytes, params: 1, frame: 22
|
|
var value3;
|
|
var defaultImport;
|
|
var track;
|
|
var CHAT_CONTEXT_BAR_ACTION_CANCELED;
|
|
var object;
|
|
var currentUser;
|
|
var endEditMessage;
|
|
let value = environment.__proto__;
|
|
const channel = env1_13.current.channel;
|
|
env0_1.cancel();
|
|
value = environment.__proto__.__proto__;
|
|
const editMessageStoreBinding = EditMessageStore;
|
|
const getEditingMessage = editMessageStoreBinding.getEditingMessage;
|
|
let id = channel.id;
|
|
const value2 = Reflect.apply(getEditingMessage, editMessageStoreBinding, [id]);
|
|
if (value2 != null) {
|
|
value3 = undefined;
|
|
defaultImport = importDefault(683) /* metro dependency 683: AnalyticsUtils */;
|
|
track = defaultImport.track;
|
|
CHAT_CONTEXT_BAR_ACTION_CANCELED = AnalyticEvents.CHAT_CONTEXT_BAR_ACTION_CANCELED;
|
|
object = {};
|
|
id = value2.id;
|
|
object.message_id = id;
|
|
id = channel.id;
|
|
object.channel_id = id;
|
|
object.guild_id = channel.guild_id;
|
|
object.context_action = 'edit';
|
|
object.reason = (require(11005) /* metro dependency 11005: LongPressMessageActionSheetUtils */).getContextBarCancelReason('edit',
|
|
|
|
'cancel');
|
|
currentUser = UserStore.getCurrentUser();
|
|
id = currentUser == null ? value3 : currentUser.id;
|
|
object.is_own_message = id === value2.author.id;
|
|
Reflect.apply(track, defaultImport, [CHAT_CONTEXT_BAR_ACTION_CANCELED, object]);
|
|
value = importDefault(7067) /* metro dependency 7067: MessageActionCreators */;
|
|
endEditMessage = value.endEditMessage;
|
|
id = channel.id;
|
|
Reflect.apply(endEditMessage, value, [id]);
|
|
}
|
|
}
|
|
|
|
function handlePressKey(a0) { // fn#88384, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11723:3109, offset: 0x01fe1588, size: 279 bytes, params: 2, frame: 16
|
|
var r5;
|
|
let value = environment.__proto__;
|
|
let current = env1_13.current;
|
|
const pendingEdit = current.pendingEdit;
|
|
const pendingReply = current.pendingReply;
|
|
const channel = current.channel;
|
|
const isChannelOnCooldown2 = SlowmodeStore.isChannelOnCooldown(channel);
|
|
if (a0 === '\r') {
|
|
current = env1_16.current;
|
|
r5 = current?.getText() ?? '';
|
|
if (r5.trim().length > 0) {
|
|
if (pendingEdit != null) {
|
|
current = env1_16.current;
|
|
if (current != null) {
|
|
current.handleSaveEditing();
|
|
}
|
|
} else if (!isChannelOnCooldown2) {
|
|
current = env1_16.current;
|
|
if (current != null) {
|
|
current.handleSend();
|
|
}
|
|
}
|
|
} else if (!isChannelOnCooldown2) {
|
|
current = env1_16.current;
|
|
if (current != null) {
|
|
current.handleSend();
|
|
}
|
|
}
|
|
} else if (a0 === 'UIKeyInputEscape') {
|
|
if (pendingEdit != null) {
|
|
current = env1_16.current;
|
|
if (current != null) {
|
|
current.handleCancelEditing();
|
|
}
|
|
} else if (pendingReply != null) {
|
|
value = require(11004) /* metro dependency 11004: PendingReplyActionCreators */;
|
|
value.deletePendingReply(channel.id);
|
|
}
|
|
}
|
|
}
|
|
|
|
function handleSaveEditing(a0) { // fn#88385, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11723:3571, offset: 0x01fe169f, size: 90 bytes, params: 2, frame: 15
|
|
var environment;
|
|
var value;
|
|
var getText;
|
|
var value2;
|
|
const handleSaveEditing_body2 = handleSaveEditing_body;
|
|
if (a0 == null) {
|
|
value = environment.__proto__.__proto__;
|
|
value = importDefault(11538) /* metro dependency 11538: ChatInputNativeCommands */;
|
|
getText = value.getText;
|
|
value2 = environment.__proto__;
|
|
Reflect.apply(getText, value, [env1_8.current, env1_10.current, handleSaveEditing_body2]);
|
|
} else {
|
|
handleSaveEditing_body2(a0);
|
|
}
|
|
function handleSaveEditing_body(a0) { // fn#88386, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11723:3597, owner: handleSaveEditing.body, offset: 0x01fe16f9, size: 296 bytes, params: 2, frame: 21
|
|
var r10;
|
|
var value6;
|
|
var moduleValue;
|
|
var value7;
|
|
var getEditingTextValue;
|
|
var defaultImport;
|
|
var endEditMessage;
|
|
let value = a0;
|
|
let current = env2_13.current;
|
|
const channel = current.channel;
|
|
env1_1.cancel();
|
|
let editMessageStoreBinding = EditMessageStore;
|
|
const getEditingMessage = editMessageStoreBinding.getEditingMessage;
|
|
let id = channel.id;
|
|
const value5 = Reflect.apply(getEditingMessage, editMessageStoreBinding, [id]);
|
|
if (value5 != null) {
|
|
value6 = undefined;
|
|
moduleValue = require(11542) /* metro dependency 11542: LegacyCommands */;
|
|
value7 = moduleValue.handleLegacyCommands(value, {channel: channel, isEdit: true});
|
|
r10 = (value7 == null ? value6 : value7.content) == null ? value : value7.content;
|
|
editMessageStoreBinding = EditMessageStore;
|
|
getEditingTextValue = editMessageStoreBinding.getEditingTextValue;
|
|
id = channel.id;
|
|
if (r10 !== Reflect.apply(getEditingTextValue, editMessageStoreBinding, [id])) {
|
|
value = importDefault(7076) /* metro dependency 7076: MessageParser */;
|
|
value = value.parse(channel, r10);
|
|
defaultImport = importDefault(7067) /* metro dependency 7067: MessageActionCreators */;
|
|
defaultImport.editMessage(channel.id, value5.id, value);
|
|
}
|
|
value = importDefault(7067) /* metro dependency 7067: MessageActionCreators */;
|
|
endEditMessage = value.endEditMessage;
|
|
id = channel.id;
|
|
Reflect.apply(endEditMessage, value, [id]);
|
|
current = env2_16.current;
|
|
if (current != null) {
|
|
current.showSideActions();
|
|
}
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
function handleSend() { // fn#88387, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11723:4057, offset: 0x01fe1821, size: 335 bytes, params: 1, frame: 19
|
|
var environment;
|
|
var r0;
|
|
var sendCommand;
|
|
var text;
|
|
var value6;
|
|
var defaultImport;
|
|
var getText;
|
|
var value7;
|
|
var defaultImport2;
|
|
let current = env1_15.current;
|
|
if (!current.sending) {
|
|
current = env1_15.current;
|
|
current.sending = true;
|
|
env0_0.cancel();
|
|
current = env1_13.current;
|
|
if (current.threadCreationCallback != null) {
|
|
value7 = environment.__proto__.__proto__;
|
|
defaultImport2 = importDefault(11538) /* metro dependency 11538: ChatInputNativeCommands */;
|
|
getText = defaultImport2.getText;
|
|
current = env1_8.current;
|
|
Reflect.apply(getText, defaultImport2, [current, env1_10.current, _fun88388]);
|
|
current = env1_15.current;
|
|
current.sending = false;
|
|
return undefined;
|
|
}
|
|
current = env1_16.current;
|
|
var applicationCommandManager = current.getApplicationCommandManager();
|
|
if (applicationCommandManager == null) {
|
|
r0 = undefined;
|
|
} else {
|
|
sendCommand = applicationCommandManager.sendCommand;
|
|
current = env1_14.current;
|
|
text = current.text;
|
|
current = env1_13.current;
|
|
r0 = Reflect.apply(sendCommand, applicationCommandManager, [text, current.channel, _fun88389]);
|
|
}
|
|
if (!r0) {
|
|
value6 = environment.__proto__.__proto__;
|
|
defaultImport = importDefault(11538) /* metro dependency 11538: ChatInputNativeCommands */;
|
|
defaultImport.getText(env1_8.current, env1_10.current, _fun88390);
|
|
}
|
|
current = env1_15.current;
|
|
current.sending = false;
|
|
}
|
|
function _fun88388(a0) { // fn#88388, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11723:4218, offset: 0x01fe1970, size: 138 bytes, params: 2, frame: 19
|
|
const value = environment.__proto__.__proto__.__proto__;
|
|
const chatInputValidateContentLength = ChatInputSendUtilsModule.chatInputValidateContentLength;
|
|
const object = {text: a0};
|
|
const object2 = {};
|
|
const binding = env2_13;
|
|
copyDataProperties(object2, binding.current, binding);
|
|
object2['chatInputRef'] = env2_16;
|
|
object.params = object2;
|
|
if (Reflect.apply(chatInputValidateContentLength, ChatInputSendUtilsModule, [object]) != null) {
|
|
ChatInputSendUtilsModule.chatInputCreateThread({text: a0, threadCreationCallback: threadCreationCallback});
|
|
}
|
|
}
|
|
|
|
function _fun88389(a0, a1) { // fn#88389, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11723:4519, offset: 0x01fe19fa, size: 102 bytes, params: 3, frame: 16
|
|
let value = environment.__proto__.__proto__.__proto__;
|
|
value = require(11543) /* metro dependency 11543: ChatInputSendUtils */;
|
|
const chatInputSendApplicationCommand = value.chatInputSendApplicationCommand;
|
|
const object2 = {};
|
|
const binding = env2_13;
|
|
copyDataProperties(object2, binding.current, binding);
|
|
object2['chatInputRef'] = env2_16;
|
|
Reflect.apply(chatInputSendApplicationCommand, value, [{applicationCommand: {command: a0, optionValues: a1},
|
|
params: object2}]);
|
|
}
|
|
|
|
function _fun88390(a0) { // fn#88390, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11723:4697, offset: 0x01fe1a60, size: 249 bytes, params: 2, frame: 18
|
|
var value2;
|
|
var value3;
|
|
var moduleValue;
|
|
var chatInputHandleSendText;
|
|
var object2;
|
|
var value4;
|
|
let current = env2_13.current;
|
|
if (current.pendingEdit != null) {
|
|
value4 = environment.__proto__;
|
|
env1_1.cancel();
|
|
current = env2_16.current;
|
|
if (current != null) {
|
|
current.handleSaveEditing(a0);
|
|
}
|
|
} else {
|
|
value2 = environment.__proto__;
|
|
env1_1.cancel();
|
|
value3 = environment.__proto__.__proto__.__proto__;
|
|
moduleValue = require(11543) /* metro dependency 11543: ChatInputSendUtils */;
|
|
chatInputHandleSendText = moduleValue.chatInputHandleSendText;
|
|
object2 = {};
|
|
copyDataProperties(object2, env2_13.current, undefined);
|
|
object2['chatInputRef'] = env2_16;
|
|
Reflect.apply(chatInputHandleSendText, moduleValue, [{text: a0, params: object2}]);
|
|
}
|
|
const keyboardType = (UseKeyboardTypeModule).getKeyboardType();
|
|
const KeyboardTypes = (KeyboardTypesModule).KeyboardTypes;
|
|
const SYSTEM = KeyboardTypes.SYSTEM;
|
|
if (keyboardType === SYSTEM) {
|
|
env2_16.current.focus();
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
function handleSelectGIF({url}) { // fn#88391, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11723:5005, offset: 0x01fe1b59, size: 271 bytes, params: 2, frame: 26
|
|
var defaultImport;
|
|
var sendMessage;
|
|
var id;
|
|
var value4;
|
|
var object;
|
|
var defaultImport3;
|
|
var moduleValue;
|
|
var deletePendingReply;
|
|
const {channel, pendingReply, threadCreationCallback} = env1_13.current;
|
|
if (!(SlowmodeStore.isChannelOnCooldown(channel) || url.length === 0)) {
|
|
if (threadCreationCallback != null) {
|
|
threadCreationCallback(url);
|
|
} else {
|
|
defaultImport = importDefault(7067) /* metro dependency 7067: MessageActionCreators */;
|
|
sendMessage = defaultImport.sendMessage;
|
|
id = channel.id;
|
|
value4 = (importDefault(7076) /* metro dependency 7076: MessageParser */).parse(channel, url);
|
|
object = {};
|
|
defaultImport3 = importDefault(7067) /* metro dependency 7067: MessageActionCreators */;
|
|
copyDataProperties(object, defaultImport3.getSendMessageOptionsForReply(pendingReply), undefined);
|
|
object['location'] = MessageSendLocation.GIF_REPLY;
|
|
Reflect.apply(sendMessage, defaultImport, [id, value4, true, object]);
|
|
moduleValue = require(11004) /* metro dependency 11004: PendingReplyActionCreators */;
|
|
deletePendingReply = moduleValue.deletePendingReply;
|
|
id = channel.id;
|
|
Reflect.apply(deletePendingReply, moduleValue, [id]);
|
|
}
|
|
env1_16.current.dismissKeyboard();
|
|
}
|
|
}
|
|
|
|
function handleSelectSticker(a0) { // fn#88392, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11723:5347, offset: 0x01fe1c68, size: 524 bytes, params: 2, frame: 30
|
|
var moduleValue;
|
|
var stickersStoreBinding;
|
|
var text;
|
|
var moduleValue2;
|
|
var chatInputValidateContentLength;
|
|
var object;
|
|
var object2;
|
|
var value3;
|
|
var defaultImport;
|
|
var sendStickers;
|
|
var id;
|
|
var object3;
|
|
var defaultImport2;
|
|
var moduleValue3;
|
|
var deletePendingReply;
|
|
var defaultImport3;
|
|
var saveDraft;
|
|
let current = env1_13.current;
|
|
const channel = current.channel;
|
|
const pendingReply = current.pendingReply;
|
|
const threadCreationCallback = current.threadCreationCallback;
|
|
const slowmodeStoreBinding = SlowmodeStore;
|
|
if (!slowmodeStoreBinding.isChannelOnCooldown(channel)) {
|
|
if (a0 != null) {
|
|
moduleValue = require(4643) /* metro dependency 4643: StickersUtils */;
|
|
if (moduleValue.isStandardSticker(a0)) {
|
|
stickersStoreBinding = StickersStore;
|
|
if (stickersStoreBinding.getStickerPack(a0.pack_id) != null) {
|
|
current = env1_14.current;
|
|
text = current.text;
|
|
moduleValue2 = require(11543) /* metro dependency 11543: ChatInputSendUtils */;
|
|
chatInputValidateContentLength = moduleValue2.chatInputValidateContentLength;
|
|
object = {text: text};
|
|
object2 = {};
|
|
current = env1_13.current;
|
|
copyDataProperties(object2, current, undefined);
|
|
object2['chatInputRef'] = env1_16;
|
|
object.params = object2;
|
|
value3 = Reflect.apply(chatInputValidateContentLength, moduleValue2, [object]);
|
|
if (value3 != null) {
|
|
env0_1.cancel();
|
|
if (threadCreationCallback != null) {
|
|
threadCreationCallback(text, [a0.id]);
|
|
} else {
|
|
defaultImport = importDefault(7067) /* metro dependency 7067: MessageActionCreators */;
|
|
sendStickers = defaultImport.sendStickers;
|
|
id = channel.id;
|
|
object = [a0.id];
|
|
object3 = {};
|
|
defaultImport2 = importDefault(7067) /* metro dependency 7067: MessageActionCreators */;
|
|
copyDataProperties(object3, defaultImport2.getSendMessageOptionsForReply(pendingReply),
|
|
undefined);
|
|
object3['location'] = MessageSendLocation.STICKER_REPLY;
|
|
Reflect.apply(sendStickers, defaultImport, [id, object, value3, object3]);
|
|
moduleValue3 = require(11004) /* metro dependency 11004: PendingReplyActionCreators */;
|
|
deletePendingReply = moduleValue3.deletePendingReply;
|
|
id = channel.id;
|
|
Reflect.apply(deletePendingReply, moduleValue3, [id]);
|
|
defaultImport3 = importDefault(7165) /* metro dependency 7165: DraftActionCreators */;
|
|
saveDraft = defaultImport3.saveDraft;
|
|
id = channel.id;
|
|
Reflect.apply(saveDraft, defaultImport3, [id, '', DraftType.ChannelMessage]);
|
|
current = env1_16.current;
|
|
if (current != null) {
|
|
current.clearText();
|
|
}
|
|
current = env1_16.current;
|
|
if (current != null) {
|
|
current.showSideActions();
|
|
}
|
|
}
|
|
current = env1_16.current;
|
|
current.dismissKeyboard();
|
|
}
|
|
}
|
|
} else {
|
|
current = env1_14.current;
|
|
text = current.text;
|
|
moduleValue2 = require(11543) /* metro dependency 11543: ChatInputSendUtils */;
|
|
chatInputValidateContentLength = moduleValue2.chatInputValidateContentLength;
|
|
object = {text: text};
|
|
object2 = {};
|
|
current = env1_13.current;
|
|
copyDataProperties(object2, current, undefined);
|
|
object2['chatInputRef'] = env1_16;
|
|
object.params = object2;
|
|
value3 = Reflect.apply(chatInputValidateContentLength, moduleValue2, [object]);
|
|
if (value3 != null) {
|
|
env0_1.cancel();
|
|
if (threadCreationCallback != null) {
|
|
threadCreationCallback(text, [a0.id]);
|
|
} else {
|
|
defaultImport = importDefault(7067) /* metro dependency 7067: MessageActionCreators */;
|
|
sendStickers = defaultImport.sendStickers;
|
|
id = channel.id;
|
|
object = [a0.id];
|
|
object3 = {};
|
|
defaultImport2 = importDefault(7067) /* metro dependency 7067: MessageActionCreators */;
|
|
copyDataProperties(object3, defaultImport2.getSendMessageOptionsForReply(pendingReply),
|
|
undefined);
|
|
object3['location'] = MessageSendLocation.STICKER_REPLY;
|
|
Reflect.apply(sendStickers, defaultImport, [id, object, value3, object3]);
|
|
moduleValue3 = require(11004) /* metro dependency 11004: PendingReplyActionCreators */;
|
|
deletePendingReply = moduleValue3.deletePendingReply;
|
|
id = channel.id;
|
|
Reflect.apply(deletePendingReply, moduleValue3, [id]);
|
|
defaultImport3 = importDefault(7165) /* metro dependency 7165: DraftActionCreators */;
|
|
saveDraft = defaultImport3.saveDraft;
|
|
id = channel.id;
|
|
Reflect.apply(saveDraft, defaultImport3, [id, '', DraftType.ChannelMessage]);
|
|
current = env1_16.current;
|
|
if (current != null) {
|
|
current.clearText();
|
|
}
|
|
current = env1_16.current;
|
|
if (current != null) {
|
|
current.showSideActions();
|
|
}
|
|
}
|
|
current = env1_16.current;
|
|
current.dismissKeyboard();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
function hideSideActions() { // fn#88393, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11723:6010, offset: 0x01fe1e74, size: 87 bytes, params: 1, frame: 13
|
|
let current = env1_2.current;
|
|
if (current != null) {
|
|
current.onDismissActions(env1_14.current.focused);
|
|
}
|
|
current = env1_3.current;
|
|
if (current != null) {
|
|
current.onDismissActions(env1_14.current.focused);
|
|
}
|
|
}
|
|
|
|
function handleTextChanged(a0) { // fn#88394, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11723:6160, offset: 0x00d14a70, size: 19 bytes, params: 2, frame: 11
|
|
env0_1(a0);
|
|
}
|
|
|
|
function insertText(a0, a1, a2) { // fn#88395, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11723:6181, offset: 0x01fe1ecb, size: 141 bytes, params: 4, frame: 16
|
|
var r5;
|
|
let value = a0;
|
|
const r6 = a1 ?? env1_14.current.selectionStart;
|
|
const current = env1_16.current;
|
|
const replaceRange = current.replaceRange;
|
|
const object = {location: r6};
|
|
object.length = env1_14.current.selectionEnd - r6;
|
|
if (a2) {
|
|
value += ' ';
|
|
r5 = value;
|
|
} else {
|
|
r5 = value;
|
|
}
|
|
object.text = r5;
|
|
const editId = env1_14.current.editId;
|
|
value = undefined;
|
|
object.editId = editId ?? value;
|
|
Reflect.apply(replaceRange, current, [object]);
|
|
return value;
|
|
}
|
|
|
|
function isFocused_88396() { // fn#88396, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11723:6372, offset: 0x01fe1f58, size: 20 bytes, params: 1, frame: 1
|
|
return env1_14.current.focused;
|
|
}
|
|
|
|
function openCustomKeyboard_88397(a0) { // fn#88397, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11723:6413, offset: 0x01fe1f6c, size: 97 bytes, params: 2, frame: 14
|
|
const {channel, secondaryTextFieldRef} = env1_13.current;
|
|
(OpenCustomKeyboardAndroid)({channelId: channel.id,
|
|
chatInputRef: env1_16, chatInputNativeRef: env1_8, keyboardParams: a0,
|
|
secondaryTextFieldRef: secondaryTextFieldRef});
|
|
}
|
|
|
|
function openSystemKeyboard_88398() { // fn#88398, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11723:6595, offset: 0x01fe1fcd, size: 221 bytes, params: 1, frame: 16
|
|
var openSystemKeyboard;
|
|
var value5;
|
|
let value = environment.__proto__.__proto__;
|
|
const keyboardType = (UseKeyboardTypeModule).getKeyboardType();
|
|
const KeyboardTypes = (KeyboardTypesModule).KeyboardTypes;
|
|
const SYSTEM = KeyboardTypes.SYSTEM;
|
|
if (!(keyboardType === SYSTEM && (require(6996) /* metro dependency 6996: useKeyboardIsOpen */).getKeyboardIsOpen({includeCustomKeyboard: false}))) {
|
|
(require(1482) /* metro dependency 1482: KeyboardUIStoreNative */).setKeyboardType({type: KeyboardTypes.SYSTEM,
|
|
context: {keyboardWillOpen: true}});
|
|
value = importDefault(11538) /* metro dependency 11538: ChatInputNativeCommands */;
|
|
openSystemKeyboard = value.openSystemKeyboard;
|
|
value5 = environment.__proto__;
|
|
Reflect.apply(openSystemKeyboard, value, [env1_8.current]);
|
|
}
|
|
}
|
|
|
|
function replaceRange_88399(a0) { // fn#88399, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11723:6864, offset: 0x01fe20aa, size: 54 bytes, params: 2, frame: 14
|
|
let value = environment.__proto__.__proto__;
|
|
value = importDefault(11538) /* metro dependency 11538: ChatInputNativeCommands */;
|
|
value.replaceRange(env1_8.current, a0);
|
|
}
|
|
|
|
function setSelectedRange_88400(a0, a1) { // fn#88400, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11723:6921, offset: 0x01fe20e0, size: 58 bytes, params: 3, frame: 16
|
|
let value = environment.__proto__.__proto__;
|
|
value = importDefault(11538) /* metro dependency 11538: ChatInputNativeCommands */;
|
|
value.setSelectedRange(env1_8.current, a0, a1);
|
|
}
|
|
|
|
function setText_88401(a0) { // fn#88401, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11723:6979, offset: 0x01fe211a, size: 54 bytes, params: 2, frame: 14
|
|
let value = environment.__proto__.__proto__;
|
|
value = importDefault(11538) /* metro dependency 11538: ChatInputNativeCommands */;
|
|
value.setText(env1_8.current, a0);
|
|
}
|
|
|
|
function showSideActions() { // fn#88402, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11723:7030, offset: 0x01fe2150, size: 87 bytes, params: 1, frame: 13
|
|
let current = env1_2.current;
|
|
if (current != null) {
|
|
current.onShowActions(env1_14.current.focused);
|
|
}
|
|
current = env1_3.current;
|
|
if (current != null) {
|
|
current.onShowActions(env1_14.current.focused);
|
|
}
|
|
}
|
|
|
|
function updateNativeTextBlocksThrottled(a0, a1) { // fn#88403, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11723:7188, offset: 0x010aa300, size: 23 bytes, params: 3, frame: 13
|
|
env0_0(a0, a1);
|
|
}
|
|
|
|
function updateChatInputContainerHeightDebounced(a0) { // fn#88404, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11723:7244, offset: 0x00d14aa4, size: 19 bytes, params: 2, frame: 11
|
|
env0_2(a0);
|
|
}
|
|
|
|
function chatInputRefObjectCallback() { // fn#88405, offset: 0x00c7c381, size: 9 bytes, params: 1, frame: 1
|
|
return env0_3;
|
|
}
|
|
|
|
}
|
|
|
|
function _fun88406() { // fn#88406, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11723:7437, offset: 0x01fe21a7, size: 122 bytes, params: 1, frame: 3
|
|
return {chatInput: env0_16, chatInputCharCounter: env0_6, chatInputCover: env0_7, chatInputActions: env0_2,
|
|
chatInputRightActions: env0_3, chatInputAutocomplete: env0_5, chatInputAppCommandManager: env0_4,
|
|
chatInputNative: env0_8, chatInputSendButton: env0_9, chatInputTextFlushedResponses: env0_10, props: env0_13,
|
|
propsPrev: env0_12, state: env0_14};
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
global.__d(_fun88360, 11537, [31, 6583, 4645, 7075, 7080, 1878, 7729, 661, 6625, 4503, 6518, 4015, 22, 11538, 11540,
|
|
11541, 7875, 7165, 4022, 1583, 1482, 477, 4023, 1848, 683, 11005, 7067, 11004, 11542, 7076, 11543, 4643, 11574,
|
|
6996,
|
|
2]) /* metro module 11537, dependencies: [31, 6583, 4645, 7075, 7080, 1878, 7729, 661, 6625, 4503, 6518, 4015, 22, 11538, 11540, 11541, 7875, 7165, 4022, 1583, 1482, 477, 4023, 1848, 683, 11005, 7067, 11004, 11542, 7076, 11543, 4643, 11574, 6996, 2] */;
|