Initial commit

This commit is contained in:
janisslsm committed 2026-07-27 16:20:00 +03:00
commit af3b49f756
16065 files changed
+2938410

No files matched your search

@@ -0,0 +1,370 @@
/* Metro module 10012; source: modules/game_profile/AnnouncementMessageUtils.tsx; dependencies: [3794, 1909, 4630, 4631, 10013, 4625, 8433, 1244, 1471, 2] */
function _fun78204(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#78204, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10198:6, offset: 0x01e211e2, size: 186 bytes, params: 8, frame: 18
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_3 = (require(3794) /* metro dependency 3794: MessageRecord */).isMessageComponentsV2;
const env0_4 = RegExp('^#{1,3}\\s+(.+)$', '');
const env0_5 = RegExp('^https?:\\/\\/\\S+$', '');
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/game_profile/AnnouncementMessageUtils.tsx');
exports.toAnnouncementMessages = function(a0) {
return a0.map(_fun78206);
};
exports.getPollExpiryLabel = getPollExpiryLabel;
exports.getPosterUrl = getPosterUrl;
}
function toAnnouncementMessages(a0) { // fn#78205, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10198:281, offset: 0x01e2129c, size: 24 bytes, params: 2, frame: 11
return a0.map(_fun78206);
}
function getPollExpiryLabel({expiry}) { // fn#78221, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10198:3028, offset: 0x01e21a20, size: 108 bytes, params: 2, frame: 15
var r0;
var intl;
const value2 = (require(8433) /* metro dependency 8433: useFormattedExpirationLabel */).formatExpirationLabel(expiry);
if (value2 != null) {
r0 = value2;
} else {
intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
r0 = intl.string((require(1244) /* metro dependency 1244: indexNative */).t['e+J3JZ']);
}
return r0;
}
function getPosterUrl(a0) { // fn#78222, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10198:3184, offset: 0x01e21a8c, size: 87 bytes, params: 2, frame: 15
var r0;
let value = importDefault(1471) /* metro dependency 1471: URLUtils */;
value = value.toURLSafe(a0);
const value2 = null;
if (value2 == value) {
r0 = value2;
} else {
value.searchParams.append('format', 'webp');
value = value.toString();
r0 = value;
}
return r0;
}
function _fun78206(a0) { // fn#78206, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10198:330, offset: 0x01e212b4, size: 635 bytes, params: 2, frame: 28
var r2;
var name;
var iconProxyURL;
var r14;
var r13;
var r12;
var r0;
var object2;
var property;
var author;
var footer;
var url;
const value2 = undefined;
const defaultImport = importDefault(10013) /* metro dependency 10013: maybeCreateMessageRecordFromSnapshot */;
const messageRecordUtilsModule = require(4625) /* metro dependency 4625: MessageRecordUtils */;
const value3 = defaultImport(messageRecordUtilsModule.createMessageRecord(a0));
const content = value3.content;
const value4 = extractContent(value3);
const value5 = extractMedia(value3);
const value6 = value4.indexOf('\n');
const value7 = value6 === -1;
const value9 = (value7 ? value4 : value4.slice(0, value6)).match(env1_4);
if (value9 != null) {
object2 = {};
object2.title = value9[1].trim();
object2.body = value7 ? '' : value4.slice(value6 + 1).trimStart();
r2 = object2;
} else {
r2 = {body: value4};
}
const title = r2.title;
const body = r2.body;
const reactions = a0.reactions;
r2 = reactions == null ? value2 : reactions.reduce(function(a0, a1) {
return a0 + a1.count;
}, 0);
const value14 = 0;
const r3 = r2 ?? value14;
if (value4 === content) {
r2 = value2;
} else if (isMessageComponentsV2(value3)) {
r2 = value2;
} else {
property = value3.embeds[value14];
if (property != null) {
author = property.author;
name = author == null ? value2 : author.name;
author = property.author;
iconProxyURL = author == null ? value2 : author.iconProxyURL;
r14 = iconProxyURL ?? (property.author == null ? value2 : property.author.iconURL);
footer = property.footer;
r13 = (footer == null ? value2 : footer.text) ?? (property.provider == null ? value2 : property.provider.name);
footer = property.footer;
iconProxyURL = footer == null ? value2 : footer.iconProxyURL;
r12 = iconProxyURL ?? (property.footer == null ? value2 : property.footer.iconURL);
url = property.url;
r0 = name != null || r13 != null || url != null ? {authorName: name, authorIconUrl: r14, providerName: r13,
providerIconUrl: r12, url: url, color: property.color ?? value2} : value2;
} else {
r0 = value2;
}
r2 = r0;
}
return {id: value3.id, media: value5, title: title, body: body, content: value4, timestamp: a0.timestamp,
reactionCount: r3, embedSource: r2, poll: value3.poll};
}
function extractContent(a0) { // fn#78207, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10198:399, offset: 0x01e2152f, size: 268 bytes, params: 2, frame: 20
var environment;
var r2;
var binding;
var property;
var items2;
let value = environment.__proto__.__proto__;
if (isMessageComponentsV2(a0)) {
value = a0.components.filter(function({type}) {
return type === require(dependencyMap[1]).ComponentType.TEXT_DISPLAY;
});
value = value.map(_fun78209);
return value.join('\n');
}
const content = a0.content;
if (content.length === 0) {
property = a0.embeds[0];
value = null;
if (value == property) {
r2 = value;
} else {
items2 = [];
if (value != property.rawTitle) {
items2.push('# ' + property.rawTitle);
}
if (value != property.rawDescription) {
items2.push(property.rawDescription);
}
r2 = items2.length > 0 ? items2.join('\n') : value;
}
r2 = value == r2 ? content : r2;
} else {
binding = env2_5;
if (binding.test(content.trim())) {
property = a0.embeds[0];
value = null;
if (value == property) {
r2 = value;
} else {
items2 = [];
if (value != property.rawTitle) {
items2.push('# ' + property.rawTitle);
}
if (value != property.rawDescription) {
items2.push(property.rawDescription);
}
r2 = items2.length > 0 ? items2.join('\n') : value;
}
r2 = value == r2 ? content : r2;
} else {
r2 = content;
}
}
return r2;
}
function extractMedia(a0) { // fn#78210, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10198:836, offset: 0x01e2166e, size: 737 bytes, params: 2, frame: 29
var environment;
var media;
var thumbnail;
var image;
var r9;
var value3;
var unfurledMediaItemType;
var attachments;
var value5;
var value6;
var embeds;
var value7;
var value8;
var value9;
var embedMediaToMediaItem;
var object5;
var object6;
var object7;
var object8;
let value = environment.__proto__.__proto__;
const isMessageComponentsV2Binding = isMessageComponentsV2;
const value2 = undefined;
if (isMessageComponentsV2Binding(a0)) {
value3 = a0.components.find(function({type}) {
return type === require(dependencyMap[1]).ComponentType.MEDIA_GALLERY;
});
media = value3 == null || value3.items[0] == null ? value2 : value3.items[0].media;
if (media == null) {
attachments = a0.attachments;
value5 = attachments.find(_fun78212);
if (value5 != null) {
return (require(4630) /* metro dependency 4630: MediaTypes */).messageAttachmentToMediaItem(value5, a0);
}
attachments = a0.attachments;
value6 = attachments.find(_fun78213);
if (value6 != null) {
return (require(4630) /* metro dependency 4630: MediaTypes */).messageAttachmentToMediaItem(value6, a0);
}
embeds = a0.embeds;
value7 = embeds.find(_fun78214);
thumbnail = value7 == null ? value2 : value7.thumbnail;
if (thumbnail != null) {
value = require(4630) /* metro dependency 4630: MediaTypes */;
embedMediaToMediaItem = value.embedMediaToMediaItem;
thumbnail = value7.thumbnail;
object8 = {type: 'embed'};
object8.embedIndex = a0.embeds.findIndex(_fun78215);
return Reflect.apply(embedMediaToMediaItem, value, [thumbnail, {message: a0, identifier: object8},
'IMAGE']);
}
embeds = a0.embeds;
value8 = embeds.find(_fun78216);
image = value8 == null ? value2 : value8.image;
if (image != null) {
value = require(4630) /* metro dependency 4630: MediaTypes */;
embedMediaToMediaItem = value.embedMediaToMediaItem;
image = value8.image;
object7 = {type: 'embed'};
object7.embedIndex = a0.embeds.findIndex(_fun78217);
return Reflect.apply(embedMediaToMediaItem, value, [image, {message: a0, identifier: object7},
'IMAGE']);
}
embeds = a0.embeds;
value9 = embeds.find(_fun78218);
thumbnail = value9 == null ? value2 : value9.thumbnail;
if (thumbnail != null) {
value = require(4630) /* metro dependency 4630: MediaTypes */;
embedMediaToMediaItem = value.embedMediaToMediaItem;
thumbnail = value9.thumbnail;
object6 = {type: 'embed'};
object6.embedIndex = a0.embeds.findIndex(_fun78219);
value = Reflect.apply(embedMediaToMediaItem, value, [thumbnail, {message: a0, identifier: object6},
'IMAGE']);
r9 = value;
} else {
r9 = value2;
}
return r9;
}
unfurledMediaItemType = (require(4630) /* metro dependency 4630: MediaTypes */).getUnfurledMediaItemType(media);
if (unfurledMediaItemType !== 'INVALID') {
object5 = {};
copyDataProperties(object5, media, undefined);
object5['type'] = unfurledMediaItemType;
object5['sourceMetadata'] = {message: a0};
return object5;
}
attachments = a0.attachments;
value5 = attachments.find(_fun78212);
if (value5 != null) {
return (require(4630) /* metro dependency 4630: MediaTypes */).messageAttachmentToMediaItem(value5, a0);
}
attachments = a0.attachments;
value6 = attachments.find(_fun78213);
if (value6 != null) {
return (require(4630) /* metro dependency 4630: MediaTypes */).messageAttachmentToMediaItem(value6, a0);
}
embeds = a0.embeds;
value7 = embeds.find(_fun78214);
thumbnail = value7 == null ? value2 : value7.thumbnail;
if (thumbnail != null) {
value = require(4630) /* metro dependency 4630: MediaTypes */;
embedMediaToMediaItem = value.embedMediaToMediaItem;
thumbnail = value7.thumbnail;
object8 = {type: 'embed'};
object8.embedIndex = a0.embeds.findIndex(_fun78215);
return Reflect.apply(embedMediaToMediaItem, value, [thumbnail, {message: a0, identifier: object8},
'IMAGE']);
}
embeds = a0.embeds;
value8 = embeds.find(_fun78216);
image = value8 == null ? value2 : value8.image;
if (image != null) {
value = require(4630) /* metro dependency 4630: MediaTypes */;
embedMediaToMediaItem = value.embedMediaToMediaItem;
image = value8.image;
object7 = {type: 'embed'};
object7.embedIndex = a0.embeds.findIndex(_fun78217);
return Reflect.apply(embedMediaToMediaItem, value, [image, {message: a0, identifier: object7}, 'IMAGE']);
}
embeds = a0.embeds;
value9 = embeds.find(_fun78218);
} else {
value5 = a0.attachments.find(_fun78212);
if (value5 != null) {
return (require(4630) /* metro dependency 4630: MediaTypes */).messageAttachmentToMediaItem(value5, a0);
}
value6 = a0.attachments.find(_fun78213);
if (value6 != null) {
return (require(4630) /* metro dependency 4630: MediaTypes */).messageAttachmentToMediaItem(value6, a0);
}
value7 = a0.embeds.find(function(a0) {
return a0.video != null && a0.thumbnail != null;
});
thumbnail = value7 == null ? value2 : value7.thumbnail;
if (thumbnail != null) {
value = require(4630) /* metro dependency 4630: MediaTypes */;
embedMediaToMediaItem = value.embedMediaToMediaItem;
thumbnail = value7.thumbnail;
object8 = {type: 'embed'};
object8.embedIndex = a0.embeds.findIndex(_fun78215);
return Reflect.apply(embedMediaToMediaItem, value, [thumbnail, {message: a0, identifier: object8},
'IMAGE']);
}
value8 = a0.embeds.find(function(a0) {
return a0.image != null;
});
image = value8 == null ? value2 : value8.image;
if (image != null) {
value = require(4630) /* metro dependency 4630: MediaTypes */;
embedMediaToMediaItem = value.embedMediaToMediaItem;
image = value8.image;
object7 = {type: 'embed'};
object7.embedIndex = a0.embeds.findIndex(_fun78217);
return Reflect.apply(embedMediaToMediaItem, value, [image, {message: a0, identifier: object7}, 'IMAGE']);
}
value9 = a0.embeds.find(function(a0) {
return a0.thumbnail != null;
});
}
thumbnail = value9 == null ? value2 : value9.thumbnail;
if (thumbnail != null) {
value = require(4630) /* metro dependency 4630: MediaTypes */;
embedMediaToMediaItem = value.embedMediaToMediaItem;
thumbnail = value9.thumbnail;
object6 = {type: 'embed'};
object6.embedIndex = a0.embeds.findIndex(_fun78219);
value = Reflect.apply(embedMediaToMediaItem, value, [thumbnail, {message: a0, identifier: object6}, 'IMAGE']);
r9 = value;
} else {
r9 = value2;
}
return r9;
}
function _fun78212({content_type}) { // fn#78212, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10198:1141, offset: 0x01e21982, size: 47 bytes, params: 2, frame: 11
const value = environment.__proto__.__proto__.__proto__;
return (require(4631) /* metro dependency 4631: MediaFormatTesters */).isImageContentType(content_type);
}
function _fun78213({content_type}) { // fn#78213, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10198:1277, offset: 0x01e219b1, size: 47 bytes, params: 2, frame: 11
const value = environment.__proto__.__proto__.__proto__;
return (require(4631) /* metro dependency 4631: MediaFormatTesters */).isVideoContentType(content_type);
}
function _fun78214(a0) { // fn#78214, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10198:1408, offset: 0x01e219e0, size: 30 bytes, params: 2, frame: 4
return a0.video != null && a0.thumbnail != null;
}
function _fun78216({image}) { // fn#78216, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10198:1644, offset: 0x01e219fe, size: 17 bytes, params: 2, frame: 2
return image != null;
}
function _fun78218({thumbnail}) { // fn#78218, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10198:1853, offset: 0x01e21a0f, size: 17 bytes, params: 2, frame: 2
return thumbnail != null;
}