/* Metro module 7076; source: modules/messages/MessageParser.tsx; dependencies: [6540, 5071, 1379, 1935, 1945, 1938, 1867, 3784, 3793, 3996, 1878, 661, 1881, 4805, 3855, 6624, 7077, 3829, 3797, 6629, 3995, 4617, 22, 6635, 1244, 7078, 6526, 1360, 3801, 2] */ import ChannelStore from '../../stores/ChannelStore.tsx'; /* Metro dependency 1379 */ import GuildStore from '../../stores/GuildStore.tsx'; /* Metro dependency 1867 */ import UserStore from '../../stores/UserStore.tsx'; /* Metro dependency 1878 */ import GuildChannelStore from '../../stores/GuildChannelStore.tsx'; /* Metro dependency 1935 */ import GuildRoleStore from '../../stores/GuildRoleStore.tsx'; /* Metro dependency 1938 */ import GuildMemberStore from '../../stores/GuildMemberStore.tsx'; /* Metro dependency 1945 */ import PermissionStore from '../../stores/PermissionStore.tsx'; /* Metro dependency 3784 */ import RelationshipStore from '../../stores/RelationshipStore.tsx'; /* Metro dependency 3793 */ import UnicodeEmojis from '../emojis/UnicodeEmojis.tsx'; /* Metro dependency 3797 */ import EmojiUtils from '../../utils/EmojiUtils.tsx'; /* Metro dependency 3801 */ import Module03855 from '../../by-id/module-03855.js'; /* Metro dependency 3855 */ import StreamerModeStore from '../../stores/StreamerModeStore.tsx'; /* Metro dependency 3996 */ import ActiveJoinedThreadsStore from '../threads/ActiveJoinedThreadsStore.tsx'; /* Metro dependency 5071 */ import EmojiStore from '../emojis/EmojiStore.tsx'; /* Metro dependency 6540 */ import MarkupTextRule from '../markup/MarkupTextRule.tsx'; /* Metro dependency 6629 */ import * as FileImportTrackerModule from '../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */ import * as ConstantsModule from '../../Constants.tsx'; /* Metro dependency 661 */ import * as IndexNativeModule from '../../intl/index.native.tsx'; /* Metro dependency 1244 */ import * as EmojiConstantsModule from '../emojis/EmojiConstants.tsx'; /* Metro dependency 1881 */ import * as GuildChannelStoreModule from '../../stores/GuildChannelStore.tsx'; /* Metro dependency 1935 */ import * as UserSettingsModule from '../user_settings/UserSettings.tsx'; /* Metro dependency 3829 */ import * as ParseContentForSuppressNotificationsModule from '../suppress_notifications/parseContentForSuppressNotifications.tsx'; /* Metro dependency 7077 */ function _fun56417(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#56417, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7254:6, offset: 0x013c70e9, size: 1506 bytes, params: 8, frame: 33 let env0_0 = require; const _arrayLikeToArray_56420 = function(a0, a1) { var r0; var r1; var r2; var value3; var length; var value5; var value = undefined; var value2 = value == null; reducibleJoin2: while (true) { if (value2) { r0 = value2; break reducibleJoin2; } value3 = value > a0.length; r0 = value3; break reducibleJoin2; } reducibleJoin4: while (true) { if (r0) { length = a0.length; r1 = length; break reducibleJoin4; } r1 = value; break reducibleJoin4; } value = (0, global.Array)(r1); var value4 = 0; if (value4 < r1) { r2 = value4; reducibleLoop5: while (true) { value[r2] = a0[r2]; value5 = typeof r2 === 'bigint' ? r2 + 1n : +r2 + 1; if (value5 < r1) { r2 = value5; continue reducibleLoop5; } break reducibleLoop5; } } return value; }; const closure = function(a0) { var env0_0 = a0; return {order: a0.order, match: a0.match, parse: _fun56427}; }; const matchRegexAndReturnText2 = matchRegexAndReturnText; const parseAndRebuild2 = parseAndRebuild; const createParserState2 = createParserState; const NOOP_56444 = function(a0) { return a0; }; const unparseWithMeta2 = unparseWithMeta; let Object = global.Object; Object.defineProperty(exports, '__esModule', {value: true}); let value = ConstantsModule; const MARKDOWN_SPOILER_REGEXP = value.MARKDOWN_SPOILER_REGEXP; const MARKDOWN_STATIC_ROUTE_NAME_REGEXP = value.MARKDOWN_STATIC_ROUTE_NAME_REGEXP; const env0_15 = value.Permissions; const regexp = RegExp('^<@!?(\\d+)>', ''); const regexp2 = RegExp('^<@&(\\d+)>', ''); const regexp3 = RegExp('^<#(\\d+)>', ''); const regexp4 = RegExp('^', ''); const env0_17 = RegExp('(@everyone|@here|@Clyde)\\b', ''); const env0_18 = RegExp('^[^\\s]+@[^\\s]+\\.[^\\s.]+', ''); object = {}; object.link = closure((importDefault(3855) /* metro dependency 3855 */).defaultRules.link); object.autolink = closure((importDefault(3855) /* metro dependency 3855 */).defaultRules.autolink); object.url = closure((importDefault(3855) /* metro dependency 3855 */).defaultRules.url); let RULES = (importDefault(6624) /* metro dependency 6624: MarkupRules */).RULES; object.inlineCode = closure(RULES.inlineCode); RULES = (importDefault(6624) /* metro dependency 6624: MarkupRules */).RULES; object.codeBlock = closure(RULES.codeBlock); object.rawUserMention = matchRegexAndReturnText2(regexp); object.rawRoleMention = matchRegexAndReturnText2(regexp2); object.rawChannelMention = matchRegexAndReturnText2(regexp3); object.rawEmoji = matchRegexAndReturnText2(regexp4); object.mention = {match: match_56446, parse: parse_56448}; object.channel = {match: function(a0, {channels}) { var value = _fun56450('#', a0, channels); var value2 = null; return value2 != value ? value : value2; }, parse: function(a0) { return {type: 'text', content: '<#' + a0[1] + '>'}; }}; object.emoticon = {match: match_56455, parse: parse_56456}; RULES = (importDefault(6624) /* metro dependency 6624: MarkupRules */).RULES; object.emoji = {order: RULES.emoji.order, match: function(a0) { var EMOJI_NAME_RE = importDefault(dependencyMap[18]).EMOJI_NAME_RE; return EMOJI_NAME_RE.exec(a0); }, parse: parse_56458}; object.customEmoticons = {match: function(a0, {customEmoticonsRegex}) { var r1; var value = null; r1 = value == customEmoticonsRegex ? undefined : customEmoticonsRegex.exec(a0); return value != r1 ? r1 : value; }, parse: parse_56460}; const object7 = {}; copyDataProperties(object7, MarkupTextRule, undefined); object7['match'] = match_56461; object.text = object7; const object8 = {}; RULES = (importDefault(6624) /* metro dependency 6624: MarkupRules */).RULES; object8.inlineCode = closure(RULES.inlineCode); RULES = (importDefault(6624) /* metro dependency 6624: MarkupRules */).RULES; object8.codeBlock = closure(RULES.codeBlock); value = importDefault(3855) /* metro dependency 3855 */; object8.mention = {match: value.anyScopeRegex(regexp), parse: parse_56462}; const object10 = {}; object10.match = (importDefault(3855) /* metro dependency 3855 */).anyScopeRegex(regexp2); object10.parse = parse_56464; object8.roleMention = object10; const object11 = {}; object11.match = (importDefault(3855) /* metro dependency 3855 */).anyScopeRegex(regexp3); object11.parse = parse_56465; object8.channel = object11; const object12 = {}; object12.match = (importDefault(3855) /* metro dependency 3855 */).anyScopeRegex(regexp4); object12.parse = parse_56466; object8.emoji = object12; const object13 = {}; value = importDefault(3855) /* metro dependency 3855 */; object13.match = value.anyScopeRegex((require(6635) /* metro dependency 6635: getSoundmojiASTFromString */).soundmojiRawFormatRegex); object13.parse = parse_56467; object8.soundboard = object13; const object14 = {}; object14.match = (importDefault(3855) /* metro dependency 3855 */).anyScopeRegex(MARKDOWN_SPOILER_REGEXP); object14.parse = parse_56468; object8.spoiler = object14; const object15 = {}; object15.match = (importDefault(3855) /* metro dependency 3855 */).anyScopeRegex(MARKDOWN_STATIC_ROUTE_NAME_REGEXP); object15.parse = function(a0) { return {content: ''}; }; object8.staticRouteLink = object15; const object16 = {}; RULES = (importDefault(6624) /* metro dependency 6624: MarkupRules */).RULES; copyDataProperties(object16, RULES.timestamp, undefined); object16['parse'] = function(a0) { var r4; var r6; var value = copyRestArgs(0, r6); var timestamp = importDefault(dependencyMap[15]).RULES.timestamp; var parse = timestamp.parse; var object = []; arraySpread(object, value, 0, r4); value = apply(parse, object, timestamp, r4); return value.type === 'text' ? {content: value.content} : {content: value.formatted}; }; object8.timestamp = object16; const object17 = {}; copyDataProperties(object17, MarkupTextRule, undefined); object8.text = object17; [object, object8].forEach(function(a0) { var env0_0 = a0; var Object = global.Object; Object.keys(a0).forEach(_fun56472); }); const env0_20 = (importDefault(3855) /* metro dependency 3855 */).parserFor(object); const env0_21 = RegExp('(?:)|:(?:([^\\s:]+?)(?:::skin-tone-\\d)?:)', 'g'); object = {parse: parse_56473, parsePreprocessor: parsePreprocessor, unparse: function(a0, a1, a2) { return unparseWithMeta(a0, a1, a2).content; }, unparseWithMeta: unparseWithMeta2}; (FileImportTrackerModule).fileFinishedImporting('modules/messages/MessageParser.tsx'); exports.default = object; exports.parseAndRebuild = parseAndRebuild2; exports.createParserState = createParserState2; function _createForOfIteratorHelperLoose_56418(a0, a1) { // fn#56418, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7254:385, offset: 0x013c76cb, size: 370 bytes, params: 3, frame: 20 var r6; var r9; var r5; var value3; var regexp; const env0_0 = a0; const Symbol = global.Symbol; let value = typeof Symbol !== 'undefined'; let r1 = value && a0[global.Symbol.iterator]; r1 = !r1 ? a0['@@iterator'] : r1; if (r1) { value = r1.call(a0); return value.next.bind(value); } const Array = global.Array; if (Array.isArray(a0)) { if (r1) { } return _fun56419; } value = undefined; if (a0) { if (typeof a0 === 'string') { value = _arrayLikeToArray_56420(a0, value); r5 = value; } else { value3 = ({}).toString.call(a0).slice(8, -1); r6 = value3 === 'Object' && a0.constructor; r9 = r6 ? a0.constructor.name : value3; if (r9 === 'Map') { r6 = global.Array.from(a0); } else if (r9 === 'Set') { r6 = global.Array.from(a0); } else if (r9 === 'Arguments') { value = _arrayLikeToArray_56420(a0, value); r6 = value; } else { regexp = RegExp('^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$', ''); if (regexp.test(r9)) { value = _arrayLikeToArray_56420(a0, value); r6 = value; } else { r6 = value; } } r5 = r6; } } else { r5 = value; } if (r5) { if (r5) { } return _fun56419; } const TypeError = global.TypeError; throw new TypeError('Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.'); function _fun56419() { // fn#56419, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7254:956, offset: 0x00c39d73, size: 69 bytes, params: 1, frame: 5 return env0_1 >= env0_0.length ? {done: true} : {done: false, value: env0_0[typeof env0_1 === 'bigint' ? env0_1 : +env0_1]}; } } function matchPrefix(a0, a1, a2, a3) { // fn#56421, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7254:1295, offset: 0x013c783d, size: 134 bytes, params: 5, frame: 13 var value; const env0_0 = a0; const env0_1 = a1; const env0_2 = a3; if (a1[0] === a0) { var env0_3 = a1.substring(a0.length); value = a2.sortBy(function(a0) { return -a0.text.length; }); value = value.filter(_fun56423); value = value.sortBy(_fun56424); value = value.map(_fun56425); return value.first(); } function _fun56423({text}) { // fn#56423, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7254:1415, offset: 0x013c78d5, size: 55 bytes, params: 2, frame: 12 let value = require.toLowerCase(); value = value.indexOf(text.toLowerCase()); return value === 1; } function _fun56424({text}) { // fn#56424, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7254:1482, offset: 0x013c790c, size: 26 bytes, params: 2, frame: 3 return text !== env0_3 ? 1 : 0; } function _fun56425({id, text}) { // fn#56425, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7254:1511, offset: 0x013c7926, size: 46 bytes, params: 2, frame: 4 return [env0_0 + text, id, importAll]; } } function matchAndReturnText(a0) { // fn#56426, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7254:1549, offset: 0x013c7954, size: 45 bytes, params: 2, frame: 4 const env0_0 = a0; return {order: a0.order, match: a0.match, parse: parse_56427}; function matchAndReturnTextParse(a0) { // fn#56427, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7254:1621, owner: matchAndReturnText.parse, offset: 0x013c7981, size: 33 bytes, params: 2, frame: 3 return {type: env0_0.type, content: a0[0]}; } } function matchRegexAndReturnText(a0) { // fn#56428, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7254:1654, offset: 0x013c79a2, size: 60 bytes, params: 2, frame: 12 const object = {}; object.match = (importDefault(3855) /* metro dependency 3855 */).anyScopeRegex(a0); object.parse = function(a0) { return {type: 'text', content: a0[0]}; }; return object; } function rebuild(a0, a1, a2, a3) { // fn#56430, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7254:6477, offset: 0x013c79de, size: 74 bytes, params: 5, frame: 13 const env0_0 = a1; const env0_1 = a2; const env0_2 = a3; const env0_3 = ''; a0.forEach(_fun56431); return {content: env0_3, emoji: []}; function _fun56431(a0) { // fn#56431, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7254:6535, offset: 0x013c7a28, size: 733 bytes, params: 2, frame: 29 var r2; var r15; var isShortcut; var r4; var type; var emoji; var value2; var value3; var defaultImport; var translateSurrogatesToInlineEmoji; var content; var value4; var binding; var exec; var value5; var defaultImport2; var getByName; var value6; var emojiContext; var getById; var value7; var value8; var value9; var value10; var rebuildBinding; var value11; var _createForOfIteratorHelperLoose_56418Binding; var value12; var value13; var done; var value14; var push; var object; var length; var position; var id; var value15; var isNotification; var value16; var moduleValue; var isolate; reducibleJoin16: while (true) { if (importAll == null) { break reducibleJoin16; } type = a0.type; reducibleJoin3: while (true) { if (type !== 'customEmoticon') { break reducibleJoin3; } emoji = a0.emoji; importAll(emoji, false); break reducibleJoin3; } type = a0.type; if (type !== 'emoticon') { type = a0.type; if (type !== 'text') { break reducibleJoin16; } } value2 = environment.__proto__; value3 = undefined; defaultImport = importDefault(3797) /* metro dependency 3797: UnicodeEmojis */; translateSurrogatesToInlineEmoji = defaultImport.translateSurrogatesToInlineEmoji; content = a0.content; value4 = Reflect.apply(translateSurrogatesToInlineEmoji, defaultImport, [content]); binding = env1_21; exec = binding.exec; value5 = Reflect.apply(exec, binding, [value4]); if (value5 === null) { break reducibleJoin16; } r2 = value5; reducibleLoop6: while (true) { reducibleJoin11: while (true) { reducibleJoin8: while (true) { if (r2[1] == null) { break reducibleJoin8; } if (r2[1] !== '') { emojiContext = require.emojiContext; if (emojiContext) { emojiContext = require.emojiContext; getById = emojiContext.getById; value7 = Reflect.apply(getById, emojiContext, [r2[1]]); r15 = value7; break reducibleJoin11; } r15 = value3; break reducibleJoin11; } break reducibleJoin8; } defaultImport2 = importDefault(3797) /* metro dependency 3797: UnicodeEmojis */; getByName = defaultImport2.getByName; value6 = Reflect.apply(getByName, defaultImport2, [r2[2]]); r15 = value6; break reducibleJoin11; } reducibleJoin15: while (true) { if (r15) { isShortcut = a0.isShortcut; reducibleJoin14: while (true) { if (isShortcut) { break reducibleJoin14; } value8 = false; isShortcut = value8; break reducibleJoin14; } importAll(r15, isShortcut); break reducibleJoin15; } break reducibleJoin15; } binding = env1_21; exec = binding.exec; value9 = Reflect.apply(exec, binding, [value4]); if (value9 !== null) { r2 = value9; continue reducibleLoop6; } break reducibleJoin16; } } content = a0.content; if (typeof content === 'string') { type = a0.type; if (type === 'emoji') { binding = env0_4; push = binding.push; object = {}; length = env0_3.length; object.position = length; content = a0.content; length = content.length; object.length = length; object.id = a0.id; Reflect.apply(push, binding, [object]); binding = env0_3; content = a0.content; env0_3 = binding + content; } else { reducibleJoin32: while (true) { reducibleJoin28: while (true) { if (type === 'codeBlock') { break reducibleJoin28; } if (type === 'inlineCode') { break reducibleJoin28; } if (type === 'mention') { break reducibleJoin28; } if (type === 'roleMention') { break reducibleJoin28; } if (type === 'channel') { break reducibleJoin28; } binding = env0_3; content = a0.content; env0_3 = binding + importDefault(content); break reducibleJoin32; } isNotification = require.isNotification; if (isNotification === true) { binding = env0_3; value16 = environment.__proto__; moduleValue = require(7078) /* metro dependency 7078: IsolateString */; isolate = moduleValue.isolate; env0_3 = binding + Reflect.apply(isolate, moduleValue, [a0.content]); break reducibleJoin32; } binding = env0_3; content = a0.content; env0_3 = binding + content; break reducibleJoin32; } } } else { content = a0.content; reducibleJoin32: while (true) { if (content.constructor !== global.Array) { break reducibleJoin32; } value10 = environment.__proto__; rebuildBinding = rebuild; content = a0.content; value11 = rebuildBinding(content, require, importDefault, importAll); content = value11.content; _createForOfIteratorHelperLoose_56418Binding = _createForOfIteratorHelperLoose_56418; emoji = value11.emoji; value12 = _createForOfIteratorHelperLoose_56418Binding(emoji); value13 = value12(); done = value13.done; if (!done) { r4 = value13; reducibleLoop19: while (true) { value14 = r4.value; binding = env0_4; push = binding.push; object = {}; length = env0_3.length; position = value14.position; object.position = length + position; length = value14.length; object.length = length; id = value14.id; object.id = id; Reflect.apply(push, binding, [object]); value15 = value12(); done = value15.done; if (done) { break reducibleLoop19; } r4 = value15; continue reducibleLoop19; } } env0_3 += content; break reducibleJoin32; } } } } function parseAndRebuild(a0, a1, a2) { // fn#56432, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7254:7459, offset: 0x013c7d05, size: 73 bytes, params: 4, frame: 18 return rebuild(env0_20(a0, a1), a1, (UnicodeEmojis).translateInlineEmojiToSurrogates, a2).content; } function createParserState(a0) { // fn#56433, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7254:7569, offset: 0x013c7d4e, size: 671 bytes, params: 2, frame: 23 var r13; var r6; var value9; var currentUser; let value = null; const r2 = value == a0 ? undefined : a0.getGuildId(); const r9 = value != r2 ? GuildStore.getGuild(r2) : value; const permissionStoreBinding = PermissionStore; const can = permissionStoreBinding.can; const MENTION_EVERYONE = Permissions.MENTION_EVERYONE; const env0_1 = Reflect.apply(can, permissionStoreBinding, [MENTION_EVERYONE, a0]); if (value == a0) { r13 = value != r2 ? GuildMemberStore.getMembers(r2).map(function({userId, nick}) { return {userId: userId, nick: nick}; }) : []; } else if (a0.isPrivate()) { value9 = a0.recipients.map(_fun56434); currentUser = UserStore.getCurrentUser(); if (value == currentUser) { r13 = value9; } else { value9.push({userId: currentUser.id, nick: value}); r13 = value9; } } else { r13 = value != r2 ? GuildMemberStore.getMembers(r2).map(_fun56435) : []; } const value11 = (importDefault(22) /* metro dependency 22 */)(r13.reduce(_fun56436, [])); const value15 = (importDefault(22) /* metro dependency 22 */)(value != r9 ? GuildRoleStore.getSortedRoles(r9.id) : []).filter(_fun56437).map(function({id, name}) { return {id: id, text: name}; }); const defaultImport3 = importDefault(22) /* metro dependency 22 */; const guildChannelStoreBinding = GuildChannelStore; const getTextChannelNameDisambiguations = guildChannelStoreBinding.getTextChannelNameDisambiguations; const value17 = defaultImport3(Reflect.apply(getTextChannelNameDisambiguations, guildChannelStoreBinding, [r2])).map(function({id, name}) { return {id: id, text: name}; }); if (value != r2) { value = defaultImport3; value = value((require(6526) /* metro dependency 6526: AutocompleteUtils */).COMMAND_SUPPORTED_CHANNEL_TYPE_KEYS); value = value.filter(function(a0) { return a0 !== GUILD_SELECTABLE_CHANNELS_KEY; }); value = value.flatMap(_fun56441); value = value.filter((require(1360) /* metro dependency 1360: GlobalUtils */).isNotNullish); value = value.value(); r6 = value; } else { r6 = []; } value = ActiveJoinedThreadsStore.computeAllActiveJoinedThreads(r2); value = value.map(function(a0) { var object = {id: a0.id}; object.text = require(dependencyMap[13]).computeChannelName(a0, UserStore, RelationshipStore); return object; }); const disambiguatedEmojiContext = EmojiStore.getDisambiguatedEmojiContext(r2); const escapedCustomEmoticonNames = disambiguatedEmojiContext.getEscapedCustomEmoticonNames(); const customEmoji = disambiguatedEmojiContext.getCustomEmoji(); const customEmoticonRegex = disambiguatedEmojiContext.getCustomEmoticonRegex(); let object = {inline: true, mentionableRoles: value15, guild: r9, users: value11}; object.channels = value17.concat(r6).concat(value); object.emojiContext = disambiguatedEmojiContext; object.customEmoticonsRegex = customEmoticonRegex; object.customEmoji = customEmoji; object.textExclusions = escapedCustomEmoticonNames; object.isNotification = false; return object; function _fun56436(a0, {userId}) { // fn#56436, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7254:7945, offset: 0x013c801a, size: 62 bytes, params: 3, frame: 13 let value = environment.__proto__; value = UserStore.getUser(userId); if (value != null) { a0.push({id: userId, text: value.tag}); } return a0; } function _fun56437({mentionable}) { // fn#56437, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7254:8087, offset: 0x013c8058, size: 24 bytes, params: 2, frame: 3 return env0_1 || mentionable; } function _fun56441(a0) { // fn#56441, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7254:8340, offset: 0x013c8099, size: 51 bytes, params: 2, frame: 11 var environment; const value = environment.__proto__; return GuildChannelStore.getChannels(env0_0)[a0].map(_fun56442); function _fun56442(a0) { // fn#56442, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7254:8368, offset: 0x013c80cc, size: 136 bytes, params: 2, frame: 17 var r0; var value; var permissionStoreBinding; var can; var VIEW_CHANNEL; var object; var moduleValue; var computeChannelName; let channel = a0.channel; if (channel.isCategory()) { value = environment.__proto__.__proto__; permissionStoreBinding = PermissionStore; can = permissionStoreBinding.can; VIEW_CHANNEL = Permissions.VIEW_CHANNEL; channel = a0.channel; value = Reflect.apply(can, permissionStoreBinding, [VIEW_CHANNEL, channel]); if (value) { object = {}; channel = a0.channel; object.id = channel.id; value = environment.__proto__.__proto__; moduleValue = require(4805) /* metro dependency 4805: useChannelName */; computeChannelName = moduleValue.computeChannelName; channel = a0.channel; object.text = Reflect.apply(computeChannelName, moduleValue, [channel, UserStore, RelationshipStore]); r0 = object; } else { r0 = null; } } else { object = {}; channel = a0.channel; object.id = channel.id; value = environment.__proto__.__proto__; moduleValue = require(4805) /* metro dependency 4805: useChannelName */; computeChannelName = moduleValue.computeChannelName; channel = a0.channel; object.text = Reflect.apply(computeChannelName, moduleValue, [channel, UserStore, RelationshipStore]); r0 = object; } return r0; } } } function unparseWithMeta(a0, a1, a2) { // fn#56445, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7254:8965, offset: 0x013c8196, size: 237 bytes, params: 4, frame: 18 var defaultImport; const channel = ChannelStore.getChannel(a1); const value3 = null; let r6 = value3 != channel ? channel.getGuildId() : value3; const r5 = value3 != r6 ? GuildStore.getGuild(r6) : value3; if (a2) { r6 = env0_19; } else { defaultImport = importDefault(22) /* metro dependency 22 */; r6 = defaultImport.omit(env0_19, ['spoiler', 'timestamp']); } const r4 = a2 ? NOOP_56444 : (importDefault(3797) /* metro dependency 3797: UnicodeEmojis */).translateSurrogatesToInlineEmoji; const object = {inline: true, guild: r5, channelId: a1, isNotification: a2}; const rebuildBinding = rebuild; let value = Module03855; value = value.parserFor(r6); return rebuildBinding(value(a0, object), object, r4); } function match_56446(a0, a1, a2) { // fn#56446, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7254:2355, offset: 0x013c8283, size: 320 bytes, params: 4, frame: 24 const SILENT_RE = (ParseContentForSuppressNotificationsModule).SILENT_RE; let value = a2.split(' '); value = value.pop() + a0; const binding = env0_18; if (binding.test(value)) { return null; } let matchPrefixBinding = matchPrefix; let users = a1.users; value = matchPrefixBinding('@', a0, users, 'mention'); if (value != null) { return value; } value = matchPrefix('@', a0, a1.mentionableRoles, 'roleMention'); if (value != null) { return value; } matchPrefixBinding = matchPrefix; users = a1.users; value = matchPrefixBinding('@', a0, users.map(function(a0) { var r3; var object = {}; copyDataProperties(object, a0, r3); object['text'] = a0.text.split('#')[0]; return object; }), 'mention'); if (value == null) { return null; } const value3 = env0_17.exec(a0); if (value3 != null) { if (value[0].length <= value3[0].length) { return null; } } if (a2 !== '') { return value; } const value4 = SILENT_RE.exec(a0); if (value4 == null) { return value; } return value[0].length <= value4[0].length ? null : value; } function match_56449(a0, {channels}) { // fn#56449, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7254:2932, offset: 0x013c84af, size: 46 bytes, params: 3, frame: 15 return matchChannelPrefix('#', a0, channels) ?? null; function matchChannelPrefix(a0, a1, a2) { // fn#56450, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7254:2965, owner: match_56449.matchChannelPrefix, offset: 0x013c84dd, size: 269 bytes, params: 4, frame: 24 var environment; var r9; var r2; var r7; var length; var value; var value2; var value3; var value4; var moduleValue; if (a1[0] === '#') { if (a1[1] !== '"') { value = environment.__proto__; return matchPrefix('#', a1, a2, 'channel'); } length = a1.length; value = 2; if (value < length) { r9 = value; reducibleLoop4: while (true) { if (a1[r9] !== '\\') { reducibleJoin7: while (true) { if (a1[r9] === '"') { r7 = r9; break reducibleLoop4; } r2 = r9; break reducibleJoin7; } } else { value2 = typeof r9 === 'bigint' ? r9 + 1n : +r9 + 1; r2 = value2; } value3 = typeof r2 === 'bigint' ? r2 + 1n : +r2 + 1; length = a1.length; if (value3 < length) { r9 = value3; continue reducibleLoop4; } r7 = value3; break reducibleLoop4; } } else { r7 = value; } var env0_0 = a1.substring(0, r7 + 1); value4 = environment.__proto__; moduleValue = require(4805) /* metro dependency 4805: useChannelName */; var env0_1 = moduleValue.unescapeChannelName(a1.substring(value, r7)); value = a2.sortBy(function(a0) { return -a0.text.length; }); value = value.filter(_fun56452); value = value.map(_fun56453); return value.first(); } function _fun56452({text}) { // fn#56452, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7254:3259, offset: 0x013c85ea, size: 21 bytes, params: 2, frame: 2 return env0_1 === text; } function _fun56453({id}) { // fn#56453, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7254:3284, offset: 0x013c85ff, size: 37 bytes, params: 2, frame: 3 return [env0_0, id, 'channel']; } } } function match_56455(a0, a1, a2) { // fn#56455, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7254:3406, offset: 0x013c865b, size: 213 bytes, params: 4, frame: 15 var regexp; var value2; var value; const ConvertEmoticons = (UserSettingsModule).ConvertEmoticons; const getSetting = ConvertEmoticons.getSetting; if (Reflect.apply(getSetting, ConvertEmoticons, [])) { if (a2.length === 0) { value = (importDefault(3797) /* metro dependency 3797: UnicodeEmojis */).EMOJI_SHORTCUT_RE.exec(a0); value2 = null; return value2 == value ? value2 : value[0].length === a0.length || a0[value[0].length] === ' ' ? value : a0[value[0].length] !== '\n' ? value2 : value; } regexp = RegExp('\\s$', ''); if (regexp.test(a2)) { value = (importDefault(3797) /* metro dependency 3797: UnicodeEmojis */).EMOJI_SHORTCUT_RE.exec(a0); value2 = null; return value2 == value ? value2 : value[0].length === a0.length || a0[value[0].length] === ' ' ? value : a0[value[0].length] !== '\n' ? value2 : value; } } return null; } function parse_56456(a0) { // fn#56456, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7254:3659, offset: 0x013c8730, size: 68 bytes, params: 2, frame: 13 const object = {'type': 'emoticon', 'content': null, 'isShortcut': true}; object.content = (importDefault(3797) /* metro dependency 3797: UnicodeEmojis */).convertShortcutToName(a0[1]); return object; } function match_56461(a0, a1) { // fn#56461, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7254:4374, offset: 0x013c897b, size: 168 bytes, params: 3, frame: 17 var r0; var value; var match; var value2; if (typeof a1.textExclusions !== 'string') { match = (importDefault(6629) /* metro dependency 6629: MarkupTextRule */).match; value2 = null; if (value2 != match) { value = importDefault(6629) /* metro dependency 6629: MarkupTextRule */; value = value.match(a0, a1, ''); r0 = value; } else { r0 = value2; } } else if (a1.textExclusions !== '') { value = require(6629) /* metro dependency 6629: MarkupTextRule */; value = value.textMarkupPatternWithExclusions(a1.textExclusions); value = value.exec(a0); r0 = value; } else { match = (importDefault(6629) /* metro dependency 6629: MarkupTextRule */).match; value2 = null; if (value2 != match) { value = importDefault(6629) /* metro dependency 6629: MarkupTextRule */; value = value.match(a0, a1, ''); r0 = value; } else { r0 = value2; } } return r0; } function parse_56462(a0, a1, {isNotification, guild, channelId}) { // fn#56462, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7254:4718, offset: 0x013c8a23, size: 540 bytes, params: 4, frame: 27 var r3; var r12; var r5; var some; var guildRoleStoreBinding; var defaultImport2; var value9; let value = undefined; var env0_0; const user = UserStore.getUser(a0[1]); if (user == null) { return {content: a0[0]}; } const userTag = (importDefault(3995) /* metro dependency 3995: UserUtils */).getUserTag(user, {identifiable: isNotification && StreamerModeStore.enabled ? 'never' : 'always'}); if (isNotification) { defaultImport2 = importDefault(4617) /* metro dependency 4617: NicknameUtils */; value9 = defaultImport2.getNickname(guild == null ? value : guild.id, channelId, user); if (value9 != null) { r5 = value9; } else { value = importDefault(3995) /* metro dependency 3995: UserUtils */; value = value.getGlobalName(user); r5 = value; } return {content: r5 != null ? '@' + r5 : '@' + userTag}; } if (user.bot) { return {content: '@' + userTag}; } const id = guild == null ? value : guild.id; const value7 = ''; if (id != null) { env0_0 = userTag.toLowerCase(); value = importDefault(22) /* metro dependency 22 */; some = value.some; guildRoleStoreBinding = GuildRoleStore; if (Reflect.apply(some, value, [guildRoleStoreBinding.getUnsafeMutableRoles(guild.id), _fun56463])) { value = value7 + user.discriminator; value = value.padStart(4, '0'); value = '#' + value; r3 = value; } else { r3 = value7; } r12 = r3; } else { r12 = value7; } return {content: '@' + userTag + r12}; function _fun56463({name}) { // fn#56463, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7254:5181, offset: 0x013c8c3f, size: 38 bytes, params: 2, frame: 12 const binding = env0_0; return binding.startsWith(name.toLowerCase()); } } function parse_56464(a0, a1, {guild}) { // fn#56464, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7254:5343, offset: 0x013c8c65, size: 101 bytes, params: 4, frame: 15 if (guild != null) { var role = GuildRoleStore.getRole(guild.id, a0[1]); if (role != null) { return {content: '@' + role.name}; } } return {content: a0[0]}; } function parse_56465(a0) { // fn#56465, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7254:5508, offset: 0x013c8cca, size: 99 bytes, params: 2, frame: 20 var r1; var moduleValue; const channel = ChannelStore.getChannel(a0[1]); if (channel == null) { r1 = a0[0]; } else { moduleValue = require(4805) /* metro dependency 4805: useChannelName */; r1 = moduleValue.computeChannelName(channel, UserStore, RelationshipStore, true, true); } return {content: r1}; } function parse_56466(a0, a1, {guild}) { // fn#56466, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7254:5655, offset: 0x013c8d2d, size: 178 bytes, params: 4, frame: 17 var r0; var r2; var r4; var r1; var item3; var value3; var item4; var value4; const iterator = a0[Symbol.iterator](); const iterator2 = iterator.next; let item2 = Reflect.apply(iterator2, iterator, []); let item = item2.value; item2 = item2.done ? undefined : iterator; let value = undefined; const value2 = item2 === value; if (value2) { r0 = item2; r2 = value2; r4 = value; } else { item3 = Reflect.apply(iterator2, item2, []); item = item3.value; item3 = item3.done ? undefined : item2; value3 = item3 === value; if (value3) { r0 = item3; r2 = value3; r4 = value; } else { r0 = item3; r2 = value3; r4 = item; } } if (r2) { r1 = value; } else { item4 = Reflect.apply(iterator2, r0, []); item = item4.value; item4 = item4.done ? undefined : r0; value4 = item4 === value; if (value4) { r0 = item4; r1 = value; r2 = value4; } else { r0 = item4; r1 = item; r2 = value4; } } if (!r2) { r0.return(); } const emojiStoreBinding = EmojiStore; const getDisambiguatedEmojiContext = emojiStoreBinding.getDisambiguatedEmojiContext; value = null; const byId = Reflect.apply(getDisambiguatedEmojiContext, emojiStoreBinding, [guild ? guild.id : value]).getById(r1); r4 = value != byId ? byId.name : r4; return {content: ':' + r4 + ':', id: r1}; } function parse_56468() { // fn#56468, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7254:5965, offset: 0x013c8e61, size: 105 bytes, params: 1, frame: 16 const intl = (IndexNativeModule).intl; let value = intl.string((IndexNativeModule).t['F+x38C']); value = value.toLowerCase(); return {content: '<' + value + '>'}; } function _fun56471(a0) { // fn#56471, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7254:6333, offset: 0x013c8f6f, size: 46 bytes, params: 2, frame: 12 const env0_0 = a0; const Object = global.Object; Object.keys(a0).forEach(_fun56472); function _fun56472(a0, a1) { // fn#56472, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7254:6361, offset: 0x013c8f9d, size: 27 bytes, params: 3, frame: 2 env0_0[a0].order = a1; } } function parse_56473(a0, a1) { // fn#56473, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7254:9284, offset: 0x013c8fb8, size: 112 bytes, params: 3, frame: 16 const value = a2; const env0_0 = a0; const value2 = undefined; let r5 = value !== value2 ? value : value2; r5 = r5 ?? createParserState(a0); const object = {content: a1, tts: false, invalidEmojis: [], validNonShortcutEmojis: []}; object.content = parseAndRebuild(object.content, r5, _fun56474); return object; function _fun56474(a0, a1) { // fn#56474, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7254:9451, offset: 0x013c9028, size: 125 bytes, params: 3, frame: 16 const defaultImport = EmojiUtils; const isEmojiPremiumLocked = defaultImport.isEmojiPremiumLocked; const object = {emoji: a0}; object.channel = env0_0; const CHAT = EmojiIntention.CHAT; object.intention = CHAT; if (Reflect.apply(isEmojiPremiumLocked, defaultImport, [object])) { env0_1.invalidEmojis.push(a0); } else if (!a1) { env0_1.validNonShortcutEmojis.push(a0); } } } function parsePreprocessor(a0, a1) { // fn#56475, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7254:9594, offset: 0x013c90a5, size: 32 bytes, params: 3, frame: 13 return env0_20(a1, createParserState(a0)); } } function _fun56434(a0) { // fn#56434, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7254:7743, offset: 0x013c7fed, size: 18 bytes, params: 2, frame: 2 return {userId: a0, nick: null}; } function _fun56435({userId, nick}) { // fn#56435, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7254:7873, offset: 0x013c7fff, size: 27 bytes, params: 2, frame: 3 return {userId: userId, nick: nick}; } function parse_56448(a0) { // fn#56448, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7254:2833, offset: 0x013c83f6, size: 185 bytes, params: 2, frame: 22 var r1; var r2; var r3; var r32; var r5; var item3; var value3; var item4; var value4; const iterator = a0[Symbol.iterator](); const iterator2 = iterator.next; let value = undefined; let item2 = Reflect.apply(iterator2, iterator, []); let item = item2.value; item2 = item2.done ? undefined : iterator; const value2 = item2 === value; if (value2) { } if (value2) { r1 = item2; r2 = value2; r3 = value; } else { item3 = Reflect.apply(iterator2, item2, []); item = item3.value; item3 = item3.done ? undefined : item2; value3 = item3 === value; if (value3) { r1 = item3; r2 = value3; r3 = value; } else { r1 = item3; r2 = value3; r3 = item; } } if (r2) { r32 = value; } else { item4 = Reflect.apply(iterator2, r1, []); item = item4.value; item4 = item4.done ? undefined : r1; value4 = item4 === value; if (value4) { r1 = item4; r2 = value4; r32 = value; } else { r1 = item4; r2 = value4; r32 = item; } } if (!r2) { r1.return(); } value = '@'; if (r32 !== 'roleMention') { r5 = value; } else { value += '&'; r5 = value; } return {type: r32, content: '<' + r5 + r3 + '>'}; } function parse_56458(a0, a1, {customEmoji}) { // fn#56458, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7254:3825, offset: 0x013c87a3, size: 223 bytes, params: 4, frame: 23 var r0; var r2; var r3; var item3; var value3; const iterator = a0[Symbol.iterator](); const iterator2 = iterator.next; let item2 = Reflect.apply(iterator2, iterator, []); let item = item2.value; item2 = item2.done ? undefined : iterator; const value = undefined; const value2 = item2 === value; const r1 = value2 ? value : item; if (value2) { r0 = item2; r2 = value2; r3 = value; } else { item3 = Reflect.apply(iterator2, item2, []); item = item3.value; item3 = item3.done ? undefined : item2; value3 = item3 === value; if (value3) { r0 = item3; r2 = value3; r3 = value; } else { r0 = item3; r2 = value3; r3 = item; } } if (!r2) { r0.return(); } r2 = customEmoji.get(r3) ?? null; return r2 != null ? {type: 'customEmoticon', content: '<' + (r2.animated !== true ? '' : 'a') + ':' + (r2.originalName ?? r2.name) + ':' + r2.id + '>', emoji: r2} : {type: 'text', content: r1}; } function parse_56460(a0, a1, {emojiContext}) { // fn#56460, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7254:4159, offset: 0x013c88b2, size: 201 bytes, params: 4, frame: 23 var r0; var r2; var r3; var item3; var value3; const iterator = a0[Symbol.iterator](); const iterator2 = iterator.next; let item2 = Reflect.apply(iterator2, iterator, []); let item = item2.value; item2 = item2.done ? undefined : iterator; let value = undefined; const value2 = item2 === value; const r1 = value2 ? value : item; if (value2) { r0 = item2; r2 = value2; r3 = value; } else { item3 = Reflect.apply(iterator2, item2, []); item = item3.value; item3 = item3.done ? undefined : item2; value3 = item3 === value; if (value3) { r0 = item3; r2 = value3; r3 = value; } else { r0 = item3; r2 = value3; r3 = item; } } if (!r2) { r0.return(); } value = emojiContext.getEmoticonByName(r3); return value != null ? {type: 'customEmoticon', content: '<' + (value.animated !== true ? '' : 'a') + ':' + value.name + ':' + value.id + '>', emoji: value} : {type: 'text', content: r1}; } function parse_56467(a0) { // fn#56467, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7254:5873, offset: 0x013c8ddf, size: 130 bytes, params: 2, frame: 19 var r0; var r1; var r6; var r5; var item3; var value3; var item4; var value4; const iterator = a0[Symbol.iterator](); const iterator2 = iterator.next; let item2 = Reflect.apply(iterator2, iterator, []); let item = item2.value; item2 = item2.done ? undefined : iterator; const value = undefined; const value2 = item2 === value; if (value2) { r0 = item2; r1 = value2; r6 = value; } else { item3 = Reflect.apply(iterator2, item2, []); item = item3.value; item3 = item3.done ? undefined : item2; value3 = item3 === value; if (value3) { r0 = item3; r1 = value3; r6 = value; } else { r0 = item3; r1 = value3; r6 = item; } } if (r1) { r5 = value; } else { item4 = Reflect.apply(iterator2, r0, []); item = item4.value; item4 = item4.done ? undefined : r0; value4 = item4 === value; if (value4) { r0 = item4; r1 = value4; r5 = value; } else { r0 = item4; r1 = value4; r5 = item; } } if (!r1) { r0.return(); } return {content: ''}; } global.__d(_fun56417, 7076, [6540, 5071, 1379, 1935, 1945, 1938, 1867, 3784, 3793, 3996, 1878, 661, 1881, 4805, 3855, 6624, 7077, 3829, 3797, 6629, 3995, 4617, 22, 6635, 1244, 7078, 6526, 1360, 3801, 2]) /* metro module 7076, dependencies: [6540, 5071, 1379, 1935, 1945, 1938, 1867, 3784, 3793, 3996, 1878, 661, 1881, 4805, 3855, 6624, 7077, 3829, 3797, 6629, 3995, 4617, 22, 6635, 1244, 7078, 6526, 1360, 3801, 2] */;