This commit is contained in:
janisslsm committed 2026-11-01 12:12:55 +02:00
1 parent 1781d25a15
commit 732c0ad767
33051 files changed
+2591613 -3019689

No files matched your search

@@ -0,0 +1,287 @@
// Metro module 9307 (f9308).
import { Changeset, RowType } from "./RowGeneratorConstants";
import getEmbeddedActivityKey from "../getEmbeddedActivityKey";
import isUndefinedOrNull from "../../../../_bundle/isUndefinedOrNull";
const r17 = {
determineChangeType: () => Changeset.NOOP,
determineChangeTypeForUploadProgress: () => Changeset.NOOP,
determineChangeTypeForEmbeddedActivity: () => Changeset.NOOP,
getBlocked: () => false,
getIgnored: () => false
};
class ChatManager {
_messages = null;
_rows = [];
messages = null;
rows = [];
rowIndex = 0;
maybeRemove = false;
uploadProgressIds = {};
embeddedActivities = {};
getPreviousMessages() {
return this._messages;
}
getPreviousRows() {
return this._rows;
}
getBlocked(a0) {
if (this._messages != null && !Array.isArray(this._messages)) {
const r13 = this._messages._map[a0.id];
return r13 != null && !(r13.blocked || !a0.blocked);
}
return false;
}
getIgnored(a0) {
if (this._messages != null && !Array.isArray(this._messages)) {
const r13 = this._messages._map[a0.id];
return r13 != null && !(r13.ignored || !a0.ignored);
}
return false;
}
clear() {
this._messages = null;
this._rows = [];
this.embeddedActivities = {};
}
finishUpdate(a0, a1) {
this._messages = a0;
this._rows = a1;
}
getLastRow() {
return this.rows != null ? this.rows.length > 0 ? this.rows[this.rows.length - 1] : null : null;
}
setup(a0) {
this.messages = a0;
this.rows = [];
this.rowIndex = 0;
this.maybeRemove = this._messages?.length === this.messages.length;
}
determineChangeTypeForUploadProgress(a0) {
let r13, NOOP;
const r10 = this.uploadProgressIds[a0.id];
if (r10 != null) {
if (r10.items?.length === a0.items?.length && (r10.compressionProgress === a0.compressionProgress && (r10.progress === a0.progress && r10.currentSize === a0.currentSize))) {
NOOP = Changeset.NOOP;
} else {
this.uploadProgressIds[a0.id] = a0;
NOOP = Changeset.UPDATE;
}
r13 = NOOP;
} else {
this.uploadProgressIds[a0.id] = a0;
r13 = Changeset.INSERT;
}
return r13;
}
determineChangeTypeForEmbeddedActivity(a0) {
const embeddedActivityKey = getEmbeddedActivityKey(a0);
const r10 = this.embeddedActivities[embeddedActivityKey];
this.embeddedActivities[embeddedActivityKey] = a0;
return r10 != null ? Changeset.UPDATE : Changeset.INSERT;
}
determineChangeType(a0) {
let UPDATE;
const { message, updateMessageIds, forceRender } = a0;
let r6 = arguments[1];
if (r6 === void 0) {
r6 = false;
}
if (this._messages == null) {
return Changeset.NOOP;
}
if (Array.isArray(this._messages)) {
return Changeset.NOOP;
}
if (this._messages._map == null) {
return Changeset.NOOP;
}
L25: {
const r20 = this._messages._map[message.id];
let r21 = r20;
if (r20 == null) {
const nonce = message.nonce;
r21 = r20;
if (nonce != null) {
r21 = this._messages._map[message.nonce];
if (r21 != null) {
UPDATE = Changeset.UPDATE;
break L25;
}
}
}
L22: {
if (r21 != null) {
if (r6 && r21.blocked && !message.blocked) {
break L22;
}
if (!forceRender && !(updateMessageIds == null ? void 0 : updateMessageIds.has(message.id))) {
if (isUndefinedOrNull(r21, message)) {
UPDATE = Changeset.NOOP;
break L25;
}
UPDATE = Changeset.UPDATE;
break L25;
}
UPDATE = Changeset.UPDATE;
break L25;
}
}
UPDATE = Changeset.INSERT;
}
return UPDATE;
}
createRow(a0) {
if (a0.type === RowType.MESSAGE && a0.message == null) {
return void 0;
}
const index = +this.rowIndex;
this.rowIndex = index + 1;
a0.index = index;
this.rows.push(a0);
return a0;
}
createChangeset() {
let r2, r3, r17, r34, rows;
if (this._messages == null) {
rows = this.rows;
} else {
L49: {
r17 = [];
const r12 = 0 < this._rows.length;
let r6 = 0;
let r7 = 0;
let r8 = 0;
if (!r12) {
const r27 = 0 < this.rows.length;
r6 = 0;
r7 = 0;
r8 = 0;
if (!r27) {
break L49;
}
}
while (true) {
L47: {
const length = this.rows.length;
const r9 = r6;
const r5 = r7;
const r4 = r8;
if (r4 !== length) {
if (r9 !== this._rows.length) {
const r21 = this._rows[r9];
const r46 = this.rows[r4];
const changeType = r46.changeType;
if (Changeset.NOOP !== changeType && Changeset.UPDATE !== changeType) {
Changeset.INSERT;
r46.index = r4 + r5;
r17.push(r46);
r34 = r4 + 1;
r2 = r9;
r3 = r5;
break L47;
}
L39: {
if (r46.type === r21.type) {
if (r46.type === RowType.SEPARATOR && r46.id !== r21.id) {
break L39;
}
if (r46.type === RowType.LOADING && r46.id !== r21.id) {
break L39;
}
if (r46.type === RowType.MESSAGE && r46.message != null && r21.message != null && r46.message.id !== r21.message.id && r46.message.nonce !== r21.message.id) {
break L39;
}
L37: {
if (r46.changeType === Changeset.NOOP) {
L38: {
if (!(r46.type === RowType.SEPARATOR && r46.text !== r21.text) && !(r46.type === RowType.LOADING && r46.isLoading !== r21.isLoading)) {
if (!(r46.type !== RowType.BLOCKED_GROUP && r46.type !== RowType.IGNORED_GROUP)) {
if (r46.text !== r21.text) {
break L38;
}
if (r46.revealed !== r21.revealed) {
break L38;
}
}
if (!(r46.type === RowType.MESSAGE && (r46.separatorBefore !== r21.separatorBefore && !this.maybeRemove))) {
if (r46.message?.isFirst === r21.message?.isFirst) {
break L37;
}
}
}
}
r46.changeType = Changeset.UPDATE;
r46.index = r4 + r5;
r17.push(r46);
r2 = r9 + 1;
r34 = r4 + 1;
r3 = r5;
break L47;
}
}
r46.index = r4 + r5;
r17.push(r46);
r2 = r9 + 1;
r34 = r4 + 1;
r3 = r5;
break L47;
}
}
const REMOVE = Changeset.REMOVE;
const index = r4 + r5;
r17.push({
changeType: REMOVE,
index
});
if (0 < index) {
const r121 = r17[index - 1];
if (!(r121.changeType !== Changeset.NOOP || r121.type !== RowType.MESSAGE || this.maybeRemove)) {
r121.changeType = Changeset.UPDATE;
}
}
r2 = r9 + 1;
r3 = r5 + 1;
r34 = r4;
} else {
const r38 = this.rows[r4];
r38.changeType = Changeset.INSERT;
r38.index = r4 + r5;
r17.push(r38);
r34 = r4 + 1;
r2 = r9;
r3 = r5;
}
} else {
r17.push({
changeType: Changeset.REMOVE,
index: r4 + r5
});
r3 = r5 + 1;
r2 = r9 + 1;
r34 = r4;
}
}
const length2 = this._rows.length;
r6 = r2;
r7 = r3;
r8 = r34;
if (!(r2 < length2)) {
const length3 = this.rows.length;
r6 = r2;
r7 = r3;
r8 = r34;
if (!(r8 < length3)) {
break;
}
}
}
}
rows = r17.filter((item) => item.changeType !== Changeset.NOOP);
}
this._messages = this.messages;
this._rows = this.rows;
return rows;
}
}
export default ChatManager;
export { r17 as MockChatManager };
@@ -0,0 +1,10 @@
// Metro module 7729 (f7730).
import { Image as Image2 } from "react-native";
let c4862_1 = Object.freeze(new Set(["YouTube", "TikTok"]));
export function getAssetUriForEmbed(a0) {
return Image2.resolveAssetSource(a0).uri;
}
export { c4862_1 as SUPPORTED_VIDEO_PARTNERS };
export function shouldPlayVideoInline(a0) {
return c4862_1.has(a0 == null ? "" : a0);
}
@@ -0,0 +1,87 @@
// Metro module 7904 (f7905).
import { MessageAttachmentFlags } from "../../../../Constants";
import * as _Module1384 from "../../../../_bundle/Module1384";
import * as _ObscuredMediaUtils from "../../../explicit_media_redaction/ObscuredMediaUtils";
import { getMediaObscuredReasonFromBitmask } from "../../../explicit_media_redaction/ObscuredMediaUtils";
import { ObscuredMediaTypes } from "../../../explicit_media_redaction/ExplicitMediaRedactionModels";
import { isVerifiedTeen } from "../../../age_assurance/AgeVerificationUtils";
import { intl, t } from "../../../../intl/index.native";
export function getAttachmentObscurityProps({ attachment, shouldObscureSpoiler, enabledContentHarmTypeFlags, shouldAgeVerify }) {
let flags = attachment.flags;
if (flags == null) {
flags = 0;
}
const hasFlag = _Module1384.hasFlag(flags, MessageAttachmentFlags.IS_SPOILER);
let contentScanVersion = attachment.content_scan_version !== void 0 ? attachment.content_scan_version : attachment.contentScanVersion !== void 0 ? attachment.contentScanVersion : void 0;
if (contentScanVersion == null) {
contentScanVersion = 0;
}
let flags2 = attachment.flags;
if (flags2 == null) {
flags2 = 0;
}
const media = {
contentScanVersion,
flags: flags2
};
const mediaObscuredReasonFromBitmask = getMediaObscuredReasonFromBitmask({
type: ObscuredMediaTypes.Attachment,
media
}, enabledContentHarmTypeFlags);
const isMediaScanPending = _ObscuredMediaUtils.isMediaScanPending({
type: ObscuredMediaTypes.Attachment,
media
}, enabledContentHarmTypeFlags);
const obscure = mediaObscuredReasonFromBitmask.length > 0;
const obscureHideControls = obscure ? isVerifiedTeen() : obscure;
const isSpoiler = shouldObscureSpoiler && hasFlag;
let obscureDescription = "";
const spoiler = shouldObscureSpoiler ? hasFlag ? intl.string(t["F+x38C"]).toUpperCase() : "" : "";
if (obscure) {
obscureDescription = intl.string(t.SpxcUR);
}
return {
isSpoiler,
spoiler,
obscure,
obscureDescription,
obscureAwaitingScan: isMediaScanPending,
verifyAge: obscure && shouldAgeVerify,
obscureHideControls,
obscureIsOpaque: obscure
};
}
export function getUnfurledMediaItemObscurityProps(a0) {
const { type, mediaItem } = a0;
let isSpoilered = a0.isSpoilered;
const { isAuthorBot, shouldObscureSpoiler, enabledContentHarmTypeFlags, shouldAgeVerify } = a0;
const mediaObscuredReasonFromBitmask = getMediaObscuredReasonFromBitmask({
type: ObscuredMediaTypes.GenericMedia,
media: mediaItem
}, enabledContentHarmTypeFlags);
const obscureAwaitingScan = isAuthorBot ? !isAuthorBot : _ObscuredMediaUtils.isMediaScanPending({
type: ObscuredMediaTypes.GenericMedia,
media: mediaItem
}, enabledContentHarmTypeFlags);
if (isSpoilered) {
isSpoilered = shouldObscureSpoiler;
}
const isObscured = mediaObscuredReasonFromBitmask.length > 0;
const obscureHideControls = isObscured ? isVerifiedTeen() : isObscured;
return {
isSpoiler: isSpoilered,
spoilerDescription: isSpoilered ? type === "image" ? intl.string(t.sb2W2J) : type === "video" ? intl.string(t.ehBaMc) : type === "file" ? intl.string(t["3Gc2XP"]) : type === "generic" ? intl.string(t.G71b77) : void 0 : null,
isObscured,
obscureDescription: isObscured ? intl.string(t.SpxcUR) : null,
obscureAwaitingScan,
verifyAge: isObscured && shouldAgeVerify,
obscureHideControls,
obscureIsOpaque: isObscured
};
}
export function getAttachmentObscurityDefaults() {
return {
isSpoiler: false,
spoiler: ""
};
}
@@ -0,0 +1,117 @@
// Metro module 7864 (f7865).
import { MessageTypes } from "../../../../Constants";
import Durations from "../../../../utils/Durations";
import LRUCache from "../../../../_bundle/LRUCache";
import MarkupUtils from "../../../markup/MarkupUtils";
import { changelogRules } from "../../../../components_native/ChangeLogStandardTemplate";
import { renderMessageMarkupToAST } from "../../renderMessageMarkup";
const r26 = {
max: Infinity,
maxAge: 15 * Durations.Millis.MINUTE,
updateAgeOnGet: true
};
let c4965_4 = new LRUCache(r26);
let c4965_5 = new LRUCache(r26);
let c4965_6 = new LRUCache({
...r26,
updateAgeOnGet: false
});
let c4965_7 = new LRUCache(r26);
export function parseEmbedTitleMarkup(a0, a1) {
const r5 = `${a0}-${a1}`;
let r13 = c4965_4.get(r5);
if (r13 == null) {
const r21 = MarkupUtils.parseEmbedTitleToAST(a0, true, {
channelId: a1
});
c4965_4.set(r5, r21);
r13 = r21;
}
return r13;
}
export function parseEmbedTitleMarkupWithoutLinks(a0, a1) {
const r15 = `${a0}-${a1}-nolinks`;
let r17 = c4965_5.get(r15);
if (r17 == null) {
const r24 = MarkupUtils.parseEmbedTitleWithoutLinksToAST(a0, true, {
channelId: a1
});
c4965_5.set(r15, r24);
r17 = r24;
}
return r17;
}
export function parseEmbedDescriptionMarkup({ description, channelId, isField, ignoreCache, replaceMap, showListsAndHeaders, showMaskedLinks }) {
let r18;
const r22 = `${description}-${channelId}`;
const r25 = c4965_6.get(r22);
if (r25 != null && !ignoreCache) {
return r25;
}
let r27 = description;
let r28 = r27;
for (const key in replaceMap) {
r18 = r27;
r28 = r18;
r27 = r18.replaceAll(key, replaceMap[key]);
}
r18 = r27;
r28 = r18;
const r39 = MarkupUtils.parseToAST(r28, true, {
channelId,
allowGameMentions: true,
allowLinks: true,
allowEmojiLinks: true,
allowHeading: isField ? !isField : showListsAndHeaders,
allowList: showListsAndHeaders,
previewLinkTarget: showMaskedLinks
});
c4965_6.set(r22, r39);
return r39;
}
export function parseMessageMarkup(a0, a1, a2, formatInline = false, allowList = false, r4 = false, allowLinks = false) {
let r29;
let r19 = c4965_7.get(a0);
if (!(r19 != null && r19.isInlineReplyPreview === formatInline)) {
if (a0.type === MessageTypes.CHANGELOG && a0.changelogId != null) {
const r45 = MarkupUtils.astParserFor(changelogRules(a0.changelogId, true));
const content = a0.content;
const allowHeading = allowList ? allowList : r4;
if (!allowList) {
allowList = r4;
}
const r51 = {
content: r45(content, false, {
hideSimpleEmbedContent: a2,
formatInline,
allowHeading,
allowList,
allowLinks,
previewLinkTarget: allowLinks
}),
isInlineReplyPreview: false,
hasSpoilerEmbeds: false,
hasBailedAst: false
};
c4965_7.set(a0, r51);
r29 = r51;
} else {
r29 = {
...renderMessageMarkupToAST(a0, {
contentMessage: a1,
hideSimpleEmbedContent: a2,
formatInline,
allowGameMentions: true,
allowHeading: allowList ? allowList : r4,
allowList: allowList ? allowList : r4,
allowLinks,
previewLinkTarget: allowLinks
}),
isInlineReplyPreview: formatInline
};
c4965_7.set(a0, r29);
}
r19 = r29;
}
return r19;
}
@@ -0,0 +1,60 @@
// Metro module 7718 (f7719).
import GuildAutomodMessageStore from "../../../guild_automod/GuildAutomodMessageStore";
import { RowType } from "./RowGeneratorConstants";
import createMessageContent from "./createMessageContent";
import { intl, t } from "../../../../intl/index.native";
import RowGeneratorUtils from "./RowGeneratorUtils";
export function generateMessageRowData(a0, a1, a2) {
const { changeType, message, roleStyle, isFirst, isEditing, separatorBefore, canAddNewReactions, reactionsTheme, isSystemDM: isSystemDM2 = false, canShowImages: canShowImages2 = true, truncation, renderContentOnly, pushFeedbackType, alwaysShowAddReaction: alwaysShowAddReaction2 = false } = a0;
let overrideBackgroundHighlight = a0.overrideBackgroundHighlight;
const r30 = {
type: RowType.MESSAGE,
message: createMessageContent({
options: a1,
message,
roleStyle,
isFirst,
isEditing,
canShowImages: canShowImages2,
isSystemDM: isSystemDM2,
isInlineReplyPreview: false,
pushFeedbackType,
renderContentOnly,
showContentInventoryEntryFallbackEmbed: a0.showContentInventoryEntryFallbackEmbed
}),
canAddNewReactions,
addNewReactionAccessibilityLabel: intl.string(t.lfIHs4),
reactionsTheme,
highlightLabel: intl.string(t["IOS/dU"]),
renderContentOnly,
separatorBefore,
changeType,
truncation,
alwaysShowAddReaction: alwaysShowAddReaction2,
backgroundHighlight: null,
swipeActions: null,
replyAccessibilityLabel: null,
forwardAccessibilityLabel: null,
threadAccessibilityLabel: null,
forcedTheme: null
};
if (overrideBackgroundHighlight == null) {
overrideBackgroundHighlight = RowGeneratorUtils.createBackgroundHighlight({
message,
theme: a2,
isEditing,
isAutomodBlockedMessage: GuildAutomodMessageStore.getMessage(message.id) != null
});
}
r30.backgroundHighlight = overrideBackgroundHighlight;
r30.swipeActions = RowGeneratorUtils.createSwipeActions(a1.enableSwipeActions && a0.canReply, a1.enableSwipeActions && a0.canEdit);
r30.replyAccessibilityLabel = intl.string(t["5IEsGx"]);
r30.forwardAccessibilityLabel = intl.string(t.I3ltXO);
r30.threadAccessibilityLabel = intl.string(t.rBIGBL);
let forcedTheme = a1.forcedTheme;
if (forcedTheme == null) {
forcedTheme = void 0;
}
r30.forcedTheme = forcedTheme;
return r30;
}
@@ -0,0 +1,38 @@
// Metro module 7715 (f7716).
const r9 = {
USER_SETTING: 0,
0: "USER_SETTING",
FORCE_ENABLE: 1,
1: "FORCE_ENABLE",
FORCE_DISABLE: 2,
2: "FORCE_DISABLE"
};
export { r9 as UserOption };
export const DEFAULT_OPTIONS = {
renderEmbeds: true,
renderReactions: true,
inlineEmbedMedia: true,
inlineAttachmentMedia: true,
animateEmoji: true,
gifAutoPlay: false,
timestampHourCycle: 0,
renderCodedLinks: true,
renderGiftCode: true,
renderActivityInstanceEmbed: true,
renderActivityInviteEmbed: true,
renderComponents: true,
renderThreadEmbeds: true,
renderReplies: true,
renderCommunicationDisabled: false,
renderAttachments: true,
renderExecutedCommands: true,
renderPolls: true,
renderSharedClientTheme: true,
renderForumPostActions: true,
ignoreMentioned: false,
ignoreEmbedDescriptionCache: false,
forceHideSimpleEmbedContent: false,
enableSwipeActions: false,
useAlternateEmbedColors: false,
restrictedPreview: false
};
@@ -0,0 +1,51 @@
// Metro module 7713 (f7714).
import ThemeStore from "../../../user_settings/ThemeStore";
import { LoadingType, RowType, SeparatorType } from "./RowGeneratorConstants";
import { DEFAULT_OPTIONS } from "./RenderMessageOptionsContext";
import Module12 from "../../../../_bundle/Module12";
import { generateBlockedGroupRowData } from "./rows/BlockedGroup";
import { generateMessageRowData } from "./MessageWithContent";
import { generateSeparatorRowData } from "./rows/Separator";
import { generateLoadingRowData } from "./rows/Loading";
import { assertNever } from "../../../../utils/GlobalUtils";
const options = {
constrainedWidth: 0,
animatingStickerMessageId: null,
forcedTheme: null,
shouldObscureSpoiler: true,
shouldDisableInteractiveComponents: true,
...DEFAULT_OPTIONS
};
class RowManager {
constructor() {
return {
__proto__: new.target.prototype,
options
};
}
setOptions(a0) {
this.options = Module12.merge({}, options, this.options, a0);
}
generate(a0) {
const rowType = a0.rowType;
let forcedTheme = this.options.forcedTheme;
if (forcedTheme == null) {
forcedTheme = ThemeStore.theme;
}
if (RowType.BLOCKED_GROUP !== rowType && RowType.IGNORED_GROUP !== rowType && RowType.SUSPENDED_USER_GROUP !== rowType) {
if (RowType.MESSAGE === rowType) {
return generateMessageRowData(a0, this.options, forcedTheme);
}
if (SeparatorType.DAY !== rowType && SeparatorType.UNREAD !== rowType && SeparatorType.SUMMARY !== rowType) {
if (LoadingType.LOAD_BEFORE !== rowType && LoadingType.LOAD_AFTER !== rowType) {
assertNever(rowType);
return void 0;
}
return generateLoadingRowData(a0, forcedTheme);
}
return generateSeparatorRowData(a0, forcedTheme);
}
return generateBlockedGroupRowData(a0, forcedTheme, this);
}
}
export default RowManager;
@@ -0,0 +1,79 @@
// Metro module 7714 (f7715).
const r14 = {
NOOP: 0,
0: "NOOP",
INSERT: 1,
1: "INSERT",
UPDATE: 2,
2: "UPDATE",
REMOVE: 3,
3: "REMOVE"
};
const r13 = {
SEPARATOR: 0,
0: "SEPARATOR",
MESSAGE: 1,
1: "MESSAGE",
BLOCKED_GROUP: 2,
2: "BLOCKED_GROUP",
LOADING: 4,
4: "LOADING",
EMBEDDED_ACTIVITY: 5,
5: "EMBEDDED_ACTIVITY",
IGNORED_GROUP: 6,
6: "IGNORED_GROUP",
SUSPENDED_USER_GROUP: 7,
7: "SUSPENDED_USER_GROUP"
};
const r12 = {
DAY: "day",
UNREAD: "unread",
SUMMARY: "summary"
};
const r11 = {
TOGGLE_BLOCKED_MESSAGES: "toggle",
LOAD_MORE_BEFORE: "load_more_before",
LOAD_MORE_AFTER: "load_more_after",
DISMISS_SUSPENDED_USER_MESSAGES: "dismiss"
};
const r10 = {
LOAD_BEFORE: "load_before",
LOAD_AFTER: "load_after"
};
const r44 = {
LOADED: 0,
0: "LOADED",
SYSTEM: 1,
1: "SYSTEM"
};
const r47 = {
UNSPECIFIED: 0,
0: "UNSPECIFIED",
UPLOAD_FAILED: 1,
1: "UPLOAD_FAILED",
AUTO_MODERATION_BLOCKED_MESSAGE: 2,
2: "AUTO_MODERATION_BLOCKED_MESSAGE"
};
const r51 = {
IMAGE: "image",
VIDEO: "video",
AUDIO: "audio",
OTHER: "other"
};
const r56 = {
NONE: 0,
0: "NONE",
REPLY: 1,
1: "REPLY",
REPLY_EDIT: 2,
2: "REPLY_EDIT"
};
export { r14 as Changeset };
export { r13 as RowType };
export { r12 as SeparatorType };
export { r11 as SeparatorAction };
export { r10 as LoadingType };
export { r44 as ReferencedMessageRowState };
export { r47 as MessageFailureState };
export { r51 as AttachmentType };
export { r56 as SwipeActionsType };
@@ -0,0 +1,9 @@
// Metro module 7717 (f7718).
import { processColor } from "react-native";
export function processColorOrThrow(a0) {
const r10 = processColor(a0);
if (r10 == null) {
throw new Error(`Unable to parse color: "${a0}"`);
}
return r10;
}
@@ -0,0 +1,19 @@
// Metro module 7905 (f7906).
const r12 = {
IMAGE: 1,
1: "IMAGE",
VIDEO: 2,
2: "VIDEO",
VISUAL_PLACEHOLDER: 3,
3: "VISUAL_PLACEHOLDER"
};
const r16 = {
DEFAULT: 0,
0: "DEFAULT",
SEARCH: 1,
1: "SEARCH",
MEDIA_VIEWER: 2,
2: "MEDIA_VIEWER"
};
export { r12 as MediaGalleryItemType };
export { r16 as MessageContextType };
@@ -0,0 +1,75 @@
// Metro module 7886 (f7887).
import { NativeModules } from "react-native";
import AccessibilityStore from "../../../a11y/AccessibilityStore";
import ChannelStore from "../../../../stores/ChannelStore";
import GuildStore from "../../../../stores/GuildStore";
import { DEFAULT_GUILD_OFFICIAL_COLOR, GUILD_OFFICIAL_HIGHLIGHT_ALPHA_COLOR } from "../../MessageConstants";
import { SwipeActionsType } from "./RowGeneratorConstants";
import { MessageFlags, MessageTypes } from "../../../../Constants";
import { createNativeStyleProperties, experimental_createToken } from "../../../../design/components/Styles/native/createStyles";
import { hexWithOpacity } from "../../../../utils/ColorUtils";
import Module712 from "../../../../_bundle/Module712";
import { showGuildOfficialMessageGradient, isGuildOfficialMessagesEnabled } from "../../GuildOfficialMessageUtils";
import { hasEphemeralAppearance } from "../../MessageRecordUtils";
import ImageUtils from "../../../../utils/native/ImageUtils";
let c4983_12;
const nativeStyleProperties = createNativeStyleProperties({
ephemeralBackgroundColor: Module712.colors.INTERACTIVE_BACKGROUND_ACTIVE,
ephemeralGutterColor: Module712.colors.BACKGROUND_BRAND,
giftIntentEphemeralBackgroundColor: experimental_createToken(() => hexWithOpacity(Module712.unsafe_rawColors.BRAND_500, 0.1)),
mentionedBackgroundColor: Module712.colors.MESSAGE_MENTIONED_BACKGROUND_DEFAULT,
mentionedGutterColor: Module712.unsafe_rawColors.YELLOW_300,
automodBlockedBackgroundColor: Module712.colors.MESSAGE_AUTOMOD_BACKGROUND_DEFAULT,
automodBlockedGutterColor: Module712.unsafe_rawColors.RED_345,
editingColor: Module712.colors.MESSAGE_HIGHLIGHT_BACKGROUND_DEFAULT
});
c4983_12 = new Set(NativeModules.MediaManager.getConstants().supportedExtensions);
const r82 = {
getImageSrc: function getImageSrc(a0, a1, a2, a3) {
const r12 = a0.endsWith(".webp");
return ImageUtils.getMobileOptimizedSrc(a0, a1, a2, ((r12 ? !r12 : !a0.endsWith(".avif")) || c4983_12.has("webp") ? a3 : true) ? "png" : null);
},
createBackgroundHighlight: function createBackgroundHighlight({ message, theme, isEditing, isAutomodBlockedMessage }) {
const r13 = nativeStyleProperties(theme);
if (isEditing) {
return {
backgroundColor: r13.editingColor
};
}
if (isAutomodBlockedMessage) {
return {
backgroundColor: r13.automodBlockedBackgroundColor,
gutterColor: r13.automodBlockedGutterColor
};
}
if (message.hasFlag(MessageFlags.IS_GUILD_OFFICIAL) && showGuildOfficialMessageGradient(AccessibilityStore.officialMessageStyle)) {
const guild = GuildStore.getGuild(ChannelStore.getChannel(message.getChannelId())?.guild_id);
if (isGuildOfficialMessagesEnabled(guild, "RowGeneratorUtils")) {
let r55 = guild?.officialMessageColor;
if (r55 == null) {
r55 = DEFAULT_GUILD_OFFICIAL_COLOR;
}
return {
backgroundColor: r55 | GUILD_OFFICIAL_HIGHLIGHT_ALPHA_COLOR,
gutterColor: message.mentioned ? r13.mentionedGutterColor : hasEphemeralAppearance(message) ? r13.ephemeralGutterColor : void 0
};
}
}
return message.mentioned ? {
backgroundColor: r13.mentionedBackgroundColor,
gutterColor: r13.mentionedGutterColor
} : hasEphemeralAppearance(message) ? {
backgroundColor: message.type === MessageTypes.GIFTING_PROMPT ? r13.giftIntentEphemeralBackgroundColor : r13.ephemeralBackgroundColor,
gutterColor: r13.ephemeralGutterColor
} : void 0;
},
createSwipeActions: function createSwipeActions(a0, a1) {
return a0 ? a1 ? SwipeActionsType.REPLY_EDIT : SwipeActionsType.REPLY : SwipeActionsType.NONE;
}
};
export default r82;
export const InviteEmbedBackground = {
dark: "#313339",
light: "#fafafa"
};
export { nativeStyleProperties as resolveHighlightThemedColors };
@@ -0,0 +1,920 @@
// Metro module 7720 (f7721).
import { processColor } from "react-native";
import AccessibilityStore from "../../../a11y/AccessibilityStore";
import ApplicationStore from "../../../applications/ApplicationStore";
import ClientThemesBackgroundStore from "../../../client_themes/ClientThemesBackgroundStore";
import EmojiStore from "../../../emojis/EmojiStore";
import GuildAutomodMessageStore from "../../../guild_automod/GuildAutomodMessageStore";
import InteractionStore from "../../../interactions/InteractionStore";
import LurkingStore from "../../../lurker_mode/LurkingStore";
import MediaPostSharePromptStore from "../../../media_channel/MediaPostSharePromptStore";
import ReferencedMessageStore, { ReferencedMessageState } from "../../../replies/ReferencedMessageStore";
import JoinedThreadsStore from "../../../threads/JoinedThreadsStore";
import ThreadMessageStore from "../../../threads/ThreadMessageStore";
import ThemeStore from "../../../user_settings/ThemeStore";
import AuthenticationStore from "../../../../stores/AuthenticationStore";
import ChannelStore from "../../../../stores/ChannelStore";
import GuildMemberStore from "../../../../stores/GuildMemberStore";
import GuildStore from "../../../../stores/GuildStore";
import RelationshipStore from "../../../../stores/RelationshipStore";
import UploadStore from "../../../../stores/UploadStore";
import UserStore from "../../../../stores/UserStore";
import { DEFAULT_GUILD_OFFICIAL_COLOR, GUILD_OFFICIAL_HIGHLIGHT_ALPHA, GUILD_OFFICIAL_HIGHLIGHT_ALPHA_COLOR } from "../../MessageConstants";
import { ReferencedMessageRowState } from "./RowGeneratorConstants";
import { ChannelTypes, MessageFlags, MessageStates, MessageTypes } from "../../../../Constants";
import { GuildTagBadgeSize } from "../../../guild_tag/GuildTagConstants";
import { computeChannelName } from "../../../channel/useChannelName";
import getEmbedThemeColors from "./row_data/embeds/getEmbedThemeColors";
import SnowflakeUtils from "../../../../utils/SnowflakeUtils";
import { formatMobileMessageCountLabel, formatMessageCountLabel } from "../../../threads/MessageCountUtils";
import { isChannelSpoilerGated } from "../../../spoiler_channels/SpoilerChannelUtils";
import { intl, t } from "../../../../intl/index.native";
import { getAssetUriForEmbed } from "./EmbedUtils";
import Module7730 from "../../../../_bundle/Module7730";
import { createDefaultReaction, createForumPostActions } from "./row_data/ForumPostActions";
import { getMessageStickers } from "../../../stickers/StickersUtils";
import * as _Module1384 from "../../../../_bundle/Module1384";
import { getPollResultsReplyPreviewMobile, getPollReplyPreview } from "../../../polls/PollsUtils";
import resolveMessageContentColors from "./resolveMessageContentColors";
import { getHasEnhancedRoleColors } from "../../../premium/powerups/hooks/useHasEnhancedRoleColors";
import { maybeCreateSingleForwardForMessage } from "../../../forwarding/formatMessageForwards";
import transformReactions from "./transformReactions";
import isSystemMessage from "../../isSystemMessage";
import { createSystemMessageContent } from "./system_messages/SystemMessage";
import * as _MarkupEligibilityUtils from "../../../markup/MarkupEligibilityUtils";
import { parseMessageMarkup } from "./MarkupParsers";
import redactRestrictedContent from "./redactRestrictedContent";
import { getEnabledHarmTypesForMessage } from "../../../explicit_media_redaction/ObscuredMediaUtils";
import * as _ExplicitMediaRedactionUtils from "../../../explicit_media_redaction/ExplicitMediaRedactionUtils";
import { ViewImageDescriptions, AnimateStickers } from "../../../user_settings/UserSettings";
import transformEmbeds from "./transformEmbeds";
import transformMessageComponents from "./transformMessageComponents";
import getTagProperties from "./getTagProperties";
import createMessageFailedEmbed, { createAutomodBlockedMessageEmbed } from "./createMessageFailedEmbed";
import { getUserAuthor, getMessageAuthor } from "../../useMessageAuthor";
import { ensureAvatarSource } from "../../../../utils/native/AvatarUtils";
import AvatarUtils2, { getAvatarDecorationURL } from "../../../../utils/AvatarUtils";
import { getDecorationSizeForAvatarSize } from "../../../collectibles/avatar_decorations/native/AvatarDecorationUtils";
import { AvatarSizes } from "../../../../design/void/native";
import { getRoleIcon } from "../../../guild_boosting/native/RoleIconUtils";
import didReplyMention from "../../../replies/didReplyMention";
import { assertNever } from "../../../../utils/GlobalUtils";
import { createInteractionStatus } from "./row_data/interaction/InteractionStatus";
import * as _CommunicationDisabledUtils from "../../../guild_communication_disabled/CommunicationDisabledUtils";
import { getVisibleConnectionsRole } from "../../../connections/ConnectionsUtils";
import transformUploaderAttachments from "./transformUploaderAttachments";
import transformMessageAttachments from "./transformMessageAttachments";
import { calendarFormat, accessibilityLabelCalendarFormat, dateFormat } from "../../../../utils/DateUtils";
import formatPollMessageChatData from "../../../polls/chat/formatPollMessageChatData";
import { formatSharedClientThemeData } from "../../../client_themes/native/chat/formatSharedClientThemeData";
import * as _GuildTagUtils from "../../../guild_tag/GuildTagUtils";
import { getUserPrimaryGuild, getGuildTagBadgeUrl } from "../../../guild_tag/GuildTagUtils";
import * as _GuildOfficialMessageUtils from "../../GuildOfficialMessageUtils";
import { showGuildOfficialMessageGradient, showGuildOfficialMessageTextColor, getAccessibleGuildOfficialTextColor } from "../../GuildOfficialMessageUtils";
import Module712 from "../../../../_bundle/Module712";
import { createVoiceChannelBadge } from "./row_data/VoiceChannelBadge";
import { processColorStrings } from "../../../premium/enhanced_role_colors/native/EnhancedRoleColorUtils";
import { createConnectionsRoleTag } from "./row_data/ConnectionsRoleTag";
import { createSurveyIndication } from "./row_data/SurveyIndication";
import { createEphemeralIndication } from "./row_data/EphemeralIndication";
import { createExecutedCommand } from "./row_data/interaction/ExecutedCommand";
import { createGiftCodeEmbed } from "./row_data/embeds/GiftCodeEmbed";
import { createCodedLinkEmbeds } from "./row_data/embeds/coded_links/CodedLinks";
import { createActivityInstanceEmbed } from "./row_data/embeds/EmbeddedActivityInstanceEmbed";
import { createActivityRichPresenceInviteEmbed } from "./row_data/embeds/ActivityRichPresenceInviteEmbed";
import transformStickers from "./transformStickers";
import Module7747 from "../../../../_bundle/Module7747";
import Module7748 from "../../../../_bundle/Module7748";
import { createPostPreviewEmbeds } from "./row_data/embeds/PostPreviewEmbeds";
import { createSafetyPolicyNoticeEmbed } from "./row_data/embeds/SafetyPolicyNoticeEmbed";
import { createSafetySystemNotificationEmbed } from "./row_data/embeds/SafetySystemNotificationEmbed";
import { createCtaButton } from "./row_data/CtaButton";
import { createMessageAccessibilityActions } from "../MessageAccessibilityActions";
import { createDisplayNameStylesMobile } from "../../../display_name_styles/native/createDisplayNameStylesMobile";
let createMessageContent;
const createThreadEmbed = function createThreadEmbed(a0, a1, a2, channel2, a4, theme) {
let r62, r83;
if (!a2 && a0.hasFlag(MessageFlags.HAS_THREAD) && channel2 != null) {
const title = computeChannelName(channel2, UserStore, RelationshipStore);
const backgroundColor = getEmbedThemeColors(theme).baseColors.backgroundColor;
const mostRecentMessage = ThreadMessageStore.getMostRecentMessage(SnowflakeUtils.castMessageIdAsChannelId(a0.id));
const count = ThreadMessageStore.getCount(SnowflakeUtils.castMessageIdAsChannelId(a0.id));
const messageCountLabel = formatMobileMessageCountLabel(count, channel2.id);
const messageCountAccessibilityLabel = formatMessageCountLabel(count, channel2.id);
if (count != null && count > 0) {
L26: {
if (isChannelSpoilerGated(channel2)) {
r83 = {
title,
messageCountLabel,
messageCountAccessibilityLabel,
messagePreviewString: intl.string(t["5uaI/7"]),
archived: false,
backgroundColor
};
} else if (channel2.threadMetadata?.archived) {
r83 = {
title,
messageCountLabel,
messageCountAccessibilityLabel,
messagePreviewString: intl.string(t.ZTo4HS),
archived: true,
archivedIconUrl: getAssetUriForEmbed(Module7730),
backgroundColor
};
} else {
if (mostRecentMessage != null && mostRecentMessage.type !== MessageTypes.CHANNEL_NAME_CHANGE && mostRecentMessage.type !== MessageTypes.THREAD_STARTER_MESSAGE) {
if (!mostRecentMessage.blocked && !mostRecentMessage.ignored) {
r83 = {
title,
messageCountLabel,
messageCountAccessibilityLabel,
referencedMessage: {
state: ReferencedMessageRowState.LOADED,
message: createMessageContent({
message: mostRecentMessage,
roleStyle: a1,
options: a4,
isFirst: true,
isEditing: false,
canShowImages: true,
isSystemDM: false,
isInlineReplyPreview: true
})
},
backgroundColor
};
break L26;
}
r83 = {
title,
messageCountLabel,
messageCountAccessibilityLabel,
messagePreviewString: mostRecentMessage.blocked ? intl.string(t.XAkOo2) : intl.string(t["G7p6v/"]),
archived: false,
backgroundColor
};
break L26;
}
r83 = {
title,
messageCountLabel,
messageCountAccessibilityLabel,
messagePreviewString: intl.string(t.ZTo4HS),
archived: false,
backgroundColor
};
}
}
r62 = r83;
} else {
r62 = {
title,
messageCountLabel,
messageCountAccessibilityLabel,
messagePreviewString: intl.string(t.HYtNyE),
archived: false,
backgroundColor
};
}
return r62;
}
};
createMessageContent = function createMessageContent(a0) {
let r178, r920, colorString3, content4, defaultUsernameColor, usernameColor;
const message = a0.message;
let messageForward = a0.messageForward;
const { roleStyle, isFirst, isEditing, canShowImages, isSystemDM, isInlineReplyPreview = false, options, pushFeedbackType, renderContentOnly, showContentInventoryEntryFallbackEmbed } = a0;
const { renderEmbeds, renderReactions, inlineEmbedMedia, inlineAttachmentMedia, constrainedWidth, ignoreMentioned, animateEmoji, animatingStickerMessageId, gifAutoPlay, timestampHourCycle, renderCodedLinks, renderGiftCode, renderActivityInstanceEmbed, renderActivityInviteEmbed, renderComponents, renderThreadEmbeds, renderReplies } = options;
let renderCommunicationDisabled = options.renderCommunicationDisabled;
let renderAttachments = options.renderAttachments;
const { renderExecutedCommands, renderPolls, renderSharedClientTheme, renderForumPostActions } = options;
let forcedTheme = options.forcedTheme;
const ignoreEmbedDescriptionCache = options.ignoreEmbedDescriptionCache;
let forceHideSimpleEmbedContent = options.forceHideSimpleEmbedContent;
const { shouldObscureSpoiler, shouldDisableInteractiveComponents, useAlternateEmbedColors, restrictedPreview } = options;
if (forcedTheme == null) {
forcedTheme = ThemeStore.theme;
}
const colors = resolveMessageContentColors(forcedTheme, useAlternateEmbedColors);
const shouldShowMedia = canShowImages === true;
const theme = forcedTheme;
let r40 = (shouldShowMedia ? renderEmbeds : shouldShowMedia) && message.type !== MessageTypes.CUSTOM_GIFT;
const shouldInlineEmbedMedia = shouldShowMedia ? inlineEmbedMedia : shouldShowMedia;
let shouldInlineAttachmentMedia = shouldShowMedia ? inlineAttachmentMedia : shouldShowMedia;
const channel = ChannelStore.getChannel(message.getChannelId());
const channel2 = ChannelStore.getChannel(SnowflakeUtils.castMessageIdAsChannelId(message.id));
const guildId = channel == null ? void 0 : channel.getGuildId();
const hasEnhancedRoleColors = getHasEnhancedRoleColors(guildId, message.author.id);
if (messageForward == null) {
messageForward = maybeCreateSingleForwardForMessage(message);
}
const message4 = messageForward != null ? messageForward.messageSnapshot.message : message;
const reactions = renderReactions ? transformReactions({
reactions: message.reactions,
animateEmoji
}) : [];
const type = message.type;
const THREAD_STARTER_MESSAGE = MessageTypes.THREAD_STARTER_MESSAGE;
let message5 = null;
if (type === THREAD_STARTER_MESSAGE) {
const messageByReference = ReferencedMessageStore.getMessageByReference(message.messageReference);
message5 = messageByReference.state === ReferencedMessageState.LOADED ? messageByReference.message : null;
}
if (message5 != null) {
return {
...createMessageContent({
message: message5,
roleStyle,
isFirst,
isEditing,
canShowImages,
isSystemDM,
isInlineReplyPreview,
options: {
...options,
renderThreadEmbeds: false,
renderReactions: false,
shouldDisableInteractiveComponents: true
}
}),
id: message.id
};
}
if (isSystemMessage(message)) {
return message.type === MessageTypes.THREAD_CREATED ? {
threadEmbed: createThreadEmbed(message, roleStyle, isInlineReplyPreview, channel2, options, theme),
...createSystemMessageContent({
message,
theme,
reactions,
roleStyle
})
} : createSystemMessageContent({
message,
theme,
reactions,
roleStyle,
isForumPost: channel == null ? void 0 : channel.isForumPost()
});
}
const r78 = isFirst ? renderContentOnly : !isFirst;
const author = message.author;
let editedTimestamp = message.editedTimestamp;
if (editedTimestamp == null) {
editedTimestamp = message.timestamp;
}
const isMessageNewerThanImprovedMarkdownEpoch = _MarkupEligibilityUtils.isMessageNewerThanImprovedMarkdownEpoch(editedTimestamp.valueOf());
if (message4.content != null && message4.content !== "") {
if (!forceHideSimpleEmbedContent) {
forceHideSimpleEmbedContent = r40 ? shouldInlineEmbedMedia : r40;
}
r178 = parseMessageMarkup(message, message4, forceHideSimpleEmbedContent, isInlineReplyPreview, channel2 != null && message.isFirstMessageInForumPost(channel2), isMessageNewerThanImprovedMarkdownEpoch, isMessageNewerThanImprovedMarkdownEpoch);
} else {
r178 = {
content: void 0,
hasSpoilerEmbeds: false,
hasBailedAst: false
};
}
const { content, hasSpoilerEmbeds, hasBailedAst } = r178;
let r188 = restrictedPreview && content != null ? redactRestrictedContent(content) : content;
const enabledHarmTypesForMessage = getEnabledHarmTypesForMessage(message);
const shouldAgeVerifyForExplicitMedia = _ExplicitMediaRedactionUtils.shouldAgeVerifyForExplicitMedia();
const setting = ViewImageDescriptions.getSetting();
if (r40) {
r40 = !hasBailedAst;
}
if (r40) {
r40 = !restrictedPreview;
}
const interaction = InteractionStore.getInteraction(message);
const r203 = r40 ? transformEmbeds({
embeds: message4.embeds,
channelId: message.channel_id,
gifAutoPlay,
hasSpoilerEmbeds,
ignoreEmbedDescriptionCache,
shouldInlineEmbedMedia,
colors,
showListsAndHeaders: isMessageNewerThanImprovedMarkdownEpoch,
showMaskedLinks: isMessageNewerThanImprovedMarkdownEpoch,
themedBackgroundColor: colors.embedBackgroundColor,
enabledContentHarmTypeFlags: enabledHarmTypesForMessage,
shouldAgeVerify: shouldAgeVerifyForExplicitMedia,
authorIsBot: message.author.bot,
showContentInventoryEntryFallbackEmbed,
transformComponents: (a0) => transformMessageComponents({
message,
guildId,
interaction,
shouldDisableInteractiveComponents,
shouldShowMedia,
shouldObscureSpoiler,
enabledContentHarmTypeFlags: enabledHarmTypesForMessage,
shouldAgeVerify: shouldAgeVerifyForExplicitMedia,
shouldShowMosaicMediaDescriptions: setting,
shouldAutoPlayGifs: gifAutoPlay,
colors
}, a0)
}) : void 0;
const tagProperties = getTagProperties({
message,
isSystemDM,
channel,
colors
});
const { tagText, tagAccessibilityLabel, tagVerified, tagTextColor, tagBackgroundColor, tagType, tagIconUrl, opTagText, opTagTextColor, opTagBackgroundColor } = tagProperties;
const uploaderFileForMessageId = UploadStore.getUploaderFileForMessageId(message.id);
const useAttachmentUploadPreview = uploaderFileForMessageId != null;
const r225 = message.state !== MessageStates.SEND_FAILED || message.isCommandType();
let r227 = r203;
if (!r225) {
const r228 = r203 == null ? [] : r203;
r228.push(createMessageFailedEmbed({
uploaderFile: uploaderFileForMessageId,
useAttachmentUploadPreview,
colors
}));
r227 = r228;
}
const message2 = GuildAutomodMessageStore.getMessage(message.id);
let embeds = r227;
if (message2 != null) {
const r239 = r227 == null ? [] : r227;
r239.push(createAutomodBlockedMessageEmbed({
errorMessage: message2.errorMessage,
colors
}));
embeds = r239;
}
const userAuthor = getUserAuthor(message.author, channel);
const guildMemberAvatar = userAuthor.guildMemberAvatar;
let guildMemberAvatarDecoration = userAuthor.guildMemberAvatarDecoration;
const iconRoleId = userAuthor.iconRoleId;
const r88 = ensureAvatarSource(message.isInteractionPlaceholder() && message.author.avatar == null && guildMemberAvatar == null ? message.application?.icon != null ? AvatarUtils2.getApplicationIconSource({
id: message.application.id,
icon: message.application.icon,
bot: message.application.bot
}) : guildMemberAvatar != null && guildId != null ? AvatarUtils2.getGuildMemberAvatarSource({
userId: author.id,
avatar: guildMemberAvatar,
guildId
}, author) : author.getAvatarSource(void 0) : guildMemberAvatar != null && guildId != null ? AvatarUtils2.getGuildMemberAvatarSource({
userId: author.id,
avatar: guildMemberAvatar,
guildId
}, author) : author.getAvatarSource(void 0));
if (guildMemberAvatarDecoration == null) {
guildMemberAvatarDecoration = author.avatarDecoration;
}
const avatarDecorationURL = getAvatarDecorationURL({
avatarDecoration: guildMemberAvatarDecoration,
size: getDecorationSizeForAvatarSize(AvatarSizes.NORMAL)
});
const r80 = iconRoleId != null ? guildId != null ? getRoleIcon({
guildId,
roleId: iconRoleId,
size: 18
}) : void 0 : void 0;
if (message.hasFlag(MessageFlags.SOURCE_MESSAGE_DELETED)) {
r188 = intl.string(t.JOtgSw);
}
const messageAuthor = getMessageAuthor(message);
let nick = messageAuthor.nick;
let colorString = messageAuthor.colorString;
const colorStrings = messageAuthor.colorStrings;
if (message.type === MessageTypes.INTERACTION_PREMIUM_UPSELL) {
r188 = intl.formatToPlainString(t["u4A+xK"], {
appName: nick
});
}
const type2 = message.type;
const REPLY = MessageTypes.REPLY;
let r108 = void 0;
if (type2 === REPLY) {
r108 = void 0;
if (renderReplies) {
const messageByReference2 = ReferencedMessageStore.getMessageByReference(message.messageReference);
const state = messageByReference2.state;
if (ReferencedMessageState.LOADED === state) {
const message3 = messageByReference2.message;
const messageForward2 = maybeCreateSingleForwardForMessage(message3);
if (RelationshipStore.isBlockedForMessage(message3)) {
r108 = {
state: ReferencedMessageRowState.SYSTEM,
content: intl.string(t.XAkOo2)
};
} else if (RelationshipStore.isIgnoredForMessage(message3)) {
r108 = {
state: ReferencedMessageRowState.SYSTEM,
content: intl.string(t["G7p6v/"])
};
} else {
const messageContent = createMessageContent({
message: message3,
messageForward: messageForward2,
roleStyle,
isFirst: true,
isEditing: false,
canShowImages: true,
isSystemDM: false,
isInlineReplyPreview: true,
options: {
...options,
renderReplies: false
}
});
if (messageContent == null) {
r108 = {
state: ReferencedMessageRowState.SYSTEM,
content: intl.string(t["1i+hMi"])
};
} else {
if ("username" in messageContent) {
const messageAuthor2 = getMessageAuthor(message3);
let nick2 = messageAuthor2.nick;
let colorString2 = messageAuthor2.colorString;
if (nick2 == null) {
nick2 = message3.author.username;
}
if (nick2 == null) {
nick2 = void 0;
}
messageContent.username = nick2;
if (r78) {
colorString3 = messageContent.colorString;
} else {
if (colorString2 == null) {
colorString2 = void 0;
}
colorString3 = processColor(colorString2);
if (colorString3 == null) {
colorString3 = messageContent.colorString;
}
}
messageContent.colorString = colorString3;
if (didReplyMention(message, message3)) {
messageContent.username = "@" + messageContent.username;
}
}
if (Array.isArray(messageContent.content) && messageContent.content.length === 0) {
messageContent.content = void 0;
}
let r406 = messageForward2 == null ? void 0 : messageForward2.messageSnapshot.message;
if (r406 == null) {
r406 = message3;
}
const content2 = messageContent.content;
const r411 = "stickers" in r406 ? getMessageStickers(r406) : [];
L137: {
if (r411.length > 0) {
content4 = intl.string(t["7K5Lma"]);
} else {
if ("interaction" in r406 && r406.interaction != null && r406.content === "") {
content4 = intl.string(t["2v7kfl"]);
break L137;
}
if (_Module1384.hasFlag(r406.flags, MessageFlags.IS_VOICE_MESSAGE)) {
content4 = intl.string(t["6bhHrc"]);
} else if (r406.type === MessageTypes.POLL_RESULT) {
content4 = getPollResultsReplyPreviewMobile(r406);
} else if (_Module1384.hasFlag(r406.flags, MessageFlags.IS_COMPONENTS_V2)) {
content4 = intl.string(t.Xxm5i3);
} else {
if (r406.content !== "") {
const r438 = content2 == null;
content4 = null;
if (!r438) {
break L137;
}
}
content4 = intl.string(t.JAKsM8);
}
}
}
if (message3.type === MessageTypes.POLL_RESULT) {
messageContent.content = content4;
}
const r487 = {
state: ReferencedMessageRowState.LOADED,
message: messageContent
};
r108 = r487;
if (content4 != null) {
r487.systemContent = content4;
r108 = r487;
}
}
}
} else if (ReferencedMessageState.NOT_LOADED === state) {
r108 = {
state: ReferencedMessageRowState.SYSTEM,
content: intl.string(t["1i+hMi"])
};
} else if (ReferencedMessageState.DELETED === state) {
r108 = {
state: ReferencedMessageRowState.SYSTEM,
content: intl.string(t.mE3KJN)
};
} else {
assertNever(messageByReference2);
r108 = void 0;
}
}
}
const threadEmbed = renderThreadEmbeds ? createThreadEmbed(message, roleStyle, isInlineReplyPreview, channel2, options, theme) : void 0;
const interactionStatus = createInteractionStatus(message, interaction);
const r536 = guildId != null ? GuildMemberStore.getMember(guildId, author.id) : null;
const isMemberCommunicationDisabled = _CommunicationDisabledUtils.isMemberCommunicationDisabled(r536);
const r545 = channel == null;
const guildMember = r536;
const visibleConnectionsRole = getVisibleConnectionsRole({
guildMember,
channel: (r545 ? void 0 : channel.parent_id) != null ? (channel == null ? void 0 : channel.isThread()) ? ChannelStore.getChannel(channel.parent_id) : channel : channel,
onlyChannelConnectionRoles: true
});
const length = message4.attachments.length;
const length2 = message4.embeds.length;
const r562 = (useAttachmentUploadPreview ? message.attachments.length === 0 : useAttachmentUploadPreview) && uploaderFileForMessageId != null;
const attachments = r562 ? transformUploaderAttachments({
uploaderFile: uploaderFileForMessageId,
isFailedMessage: message.state === MessageStates.SEND_FAILED,
shouldInlineAttachmentMedia
}) : renderAttachments ? transformMessageAttachments({
attachments: message4.attachments,
uploadAttachments: UploadStore.getUploadAttachments(message.nonce),
shouldInlineAttachmentMedia,
gifAutoPlay,
viewImageDescriptions: setting,
useReducedMotion: AccessibilityStore.useReducedMotion,
shouldObscureSpoiler,
themedBackgroundColor: colors.embedBackgroundColor,
enabledContentHarmTypeFlags: enabledHarmTypesForMessage,
shouldAgeVerify: shouldAgeVerifyForExplicitMedia,
colors
}) : [];
const r79 = r562 && message.state !== MessageStates.SEND_FAILED ? intl.string(t["yXY+5J"]) : calendarFormat(message.timestamp, true, timestampHourCycle);
const r76 = r562 && message.state !== MessageStates.SEND_FAILED ? intl.string(t["yXY+5J"]) : accessibilityLabelCalendarFormat(message.timestamp);
const id = AuthenticationStore.getId();
let content3 = message.isUnsupported ? intl.string(t.sWi5EU) : r188;
const isPoll = message.isPoll();
if (!((isPoll ? isInlineReplyPreview ? !isInlineReplyPreview : renderPolls : !isPoll) || r188 != null && r188 !== "")) {
content3 = getPollReplyPreview(message);
}
const pollData = renderPolls ? formatPollMessageChatData(message, void 0, {
theme,
animateEmoji
}) : void 0;
const sharedClientTheme = renderSharedClientTheme ? formatSharedClientThemeData(message, r88, nick) : void 0;
const shouldDisplayGuildTag = _GuildTagUtils.shouldDisplayGuildTag(author.id, guildId == null ? void 0 : guildId);
let clanBadgeUrl = void 0;
let clanTag = void 0;
let clanTagGuildId = void 0;
if (shouldDisplayGuildTag) {
const userPrimaryGuild = getUserPrimaryGuild(author.primaryGuild);
const { guildId: guildId2, tag } = userPrimaryGuild;
clanBadgeUrl = userPrimaryGuild.guildId != null ? getGuildTagBadgeUrl(userPrimaryGuild.guildId, userPrimaryGuild.badge, GuildTagBadgeSize.SIZE_12) : void 0;
clanTag = tag;
clanTagGuildId = guildId2;
}
const linkedLobby = channel?.linkedLobby;
const r662 = linkedLobby != null;
let lobbyTagIconUrl = void 0;
let lobbyAdditionalName = void 0;
if (r662) {
const r666 = message.additionalName != null;
lobbyTagIconUrl = void 0;
lobbyAdditionalName = void 0;
if (r666) {
const additionalName = message.additionalName;
lobbyTagIconUrl = void 0;
lobbyAdditionalName = void 0;
if (additionalName !== "") {
const additionalName2 = message.additionalName;
const application = ApplicationStore.getApplication(linkedLobby.application_id);
lobbyTagIconUrl = application?.icon != null ? AvatarUtils2.getApplicationIconURL({
id: application.id,
icon: application.icon,
size: 16
}) : void 0;
lobbyAdditionalName = additionalName2;
}
}
}
const hasFlag = _Module1384.hasFlag((message4 == null ? message : message4).flags, MessageFlags.IS_VOICE_MESSAGE);
let applicationId = message.applicationId;
if (applicationId == null) {
applicationId = "";
}
const application2 = ApplicationStore.getApplication(applicationId);
const gameApplicationId = application2 != null && _Module1384.hasFlag(message.flags, MessageFlags.SENT_BY_SOCIAL_LAYER_INTEGRATION) ? application2.id : void 0;
const r702 = message4 == null ? void 0 : message4.hasFlag(MessageFlags.IS_GUILD_OFFICIAL);
let stateAccessibilityLabel = void 0;
let r706 = void 0;
let officialMessageColor2 = void 0;
if (r702) {
const guild = GuildStore.getGuild(guildId);
const r711 = guild != null;
stateAccessibilityLabel = void 0;
r706 = void 0;
officialMessageColor2 = void 0;
if (r711) {
const isGuildOfficialMessagesEnabled = _GuildOfficialMessageUtils.isGuildOfficialMessagesEnabled(guild, "createMessageContent");
stateAccessibilityLabel = void 0;
r706 = void 0;
officialMessageColor2 = void 0;
if (isGuildOfficialMessagesEnabled) {
let officialMessageColor = guild.officialMessageColor;
if (officialMessageColor == null) {
officialMessageColor = DEFAULT_GUILD_OFFICIAL_COLOR;
}
const r114 = showGuildOfficialMessageGradient(AccessibilityStore.officialMessageStyle);
const r720 = r114 ? officialMessageColor | GUILD_OFFICIAL_HIGHLIGHT_ALPHA_COLOR : void 0;
const r726 = showGuildOfficialMessageTextColor(AccessibilityStore.officialMessageStyle) ? getAccessibleGuildOfficialTextColor(officialMessageColor, Module712.internal.resolveSemanticColor(theme, Module712.colors.BACKGROUND_BASE_LOWER), AccessibilityStore.desaturateUserColors ? AccessibilityStore.saturation : 1, r114 ? GUILD_OFFICIAL_HIGHLIGHT_ALPHA : 0).num() : void 0;
stateAccessibilityLabel = intl.string(t.GzDTxY);
r706 = r726;
officialMessageColor2 = r720;
}
}
}
const voiceChannelBadge = createVoiceChannelBadge(message.author.id, guildId);
const guildId4 = guildId == null ? void 0 : guildId;
let r765 = message4;
if (r765 == null) {
r765 = message;
}
const nonce = message.nonce != null && typeof message.nonce !== "string" ? String(message.nonce) : message.nonce;
const referencedMessage = renderContentOnly ? void 0 : r108;
const forwardInfo = messageForward != null ? messageForward.getForwardInfo() : void 0;
const mentioned = ignoreMentioned ? !ignoreMentioned : message.mentioned;
const edited = message.isEdited() ? renderContentOnly ? "" : intl.string(t.C8sXIM) : "";
const editedTimestamp2 = message.isEdited() ? renderContentOnly ? void 0 : message.editedTimestamp != null ? dateFormat(message.editedTimestamp, "LLLL") : void 0 : void 0;
const textColor = message.isUnsupported ? colors.unsupportedColor : r706 != null ? 4278190080 | r706 : colors.textColor;
if (r78) {
nick = author.username;
}
if (nick == null) {
nick = void 0;
}
const r762 = {
id: message.id,
channelId: message.channel_id,
guildId: guildId4,
flags: r765.flags,
type: message.type,
nonce,
state: message.state,
reactions,
referencedMessage,
threadEmbed,
forwardInfo,
mentioned,
edited,
editedTimestamp: editedTimestamp2,
editedColor: colors.editedColor,
textColor,
officialMessageColor: officialMessageColor2,
linkColor: colors.linkColor,
tagText,
tagAccessibilityLabel,
tagVerified,
tagTextColor,
tagBackgroundColor,
tagType,
tagIconUrl,
opTagText,
opTagTextColor,
opTagBackgroundColor,
stateAccessibilityLabel,
constrainedWidth,
gifAutoPlay,
animateEmoji,
username: nick,
avatarURL: r78 ? void 0 : r88.uri,
avatarDecorationURL: null,
authorId: null,
usernameColor: null,
roleColor: null,
roleColors: null,
shouldShowRoleDot: null,
shouldShowRoleOnName: null,
showLinkDecorations: null,
colorString: null,
roleIcon: null,
connectionsRoleTag: null,
timestamp: null,
timestampTooltip: null,
timestampColor: null,
timestampAccessibilityLabel: null,
content: null,
isEditing: null,
renderContentOnly: null,
surveyIndication: null,
ephemeralIndication: null,
interactionStatus: null,
executedCommand: null,
components: null,
feedbackColor: null,
highlightColor: null,
embeds: null,
giftCodes: null,
codedLinks: null,
activityInstanceEmbed: null,
activityRichPresenceInviteEmbed: null,
useAttachmentGridLayout: null,
useAttachmentUploadPreview: null,
attachments: null,
attachmentsOpacity: null,
stickers: null,
communicationDisabled: null,
isFirstForumPostMessage: null,
postActions: null,
isCurrentUserMessageAuthor: null,
usingGradientTheme: null,
swipeToReplyIconUrl: null,
swipeToEditIconUrl: null,
postPreviewEmbeds: null,
obscureLearnMoreLabel: null,
safetyPolicyNoticeEmbed: null,
pollData: null,
sharedClientTheme: null,
safetySystemNotificationEmbed: null,
ctaButton: null,
audioAttachmentBackgroundColor: null,
accessibilityActions: null,
clanTagGuildId: null,
clanTag: null,
clanBadgeUrl: null,
lobbyAdditionalName: null,
lobbyTagIconUrl: null,
isFirst: null,
gameApplicationId: null,
isAnnouncementChannel: null,
displayNameStyles: null,
voiceChannelBadge: null
};
const avatarDecorationURL2 = r78 ? null : avatarDecorationURL;
L270: {
r762.avatarDecorationURL = avatarDecorationURL2;
r762.authorId = author.id;
if (!r78 && roleStyle === "username") {
usernameColor = processColor(colorString == null ? void 0 : colorString);
if (usernameColor != null) {
break L270;
}
usernameColor = colors.defaultUsernameColor;
} else {
usernameColor = colors.defaultUsernameColor;
}
}
r762.usernameColor = usernameColor;
let roleColor = null;
if (!r78) {
let r817 = processColor(colorString == null ? void 0 : colorString);
if (r817 == null) {
r817 = null;
}
roleColor = r817;
}
r762.roleColor = roleColor;
r762.roleColors = hasEnhancedRoleColors ? r78 ? null : processColorStrings(colorStrings) : null;
r762.shouldShowRoleDot = roleStyle === "dot";
r762.shouldShowRoleOnName = roleStyle === "username";
r762.showLinkDecorations = AccessibilityStore.alwaysShowLinkDecorations;
if (r78) {
defaultUsernameColor = colors.defaultUsernameColor;
} else {
if (colorString == null) {
colorString = void 0;
}
defaultUsernameColor = processColor(colorString);
if (defaultUsernameColor == null) {
defaultUsernameColor = colors.defaultUsernameColor;
}
}
r762.colorString = defaultUsernameColor;
r762.roleIcon = r78 ? void 0 : r80;
r762.connectionsRoleTag = visibleConnectionsRole != null ? createConnectionsRoleTag(visibleConnectionsRole) : void 0;
r762.timestamp = r78 ? void 0 : r79;
r762.timestampTooltip = r78 ? void 0 : dateFormat(message.timestamp, "LLLL");
r762.timestampColor = r78 ? void 0 : colors.timestampColor;
r762.timestampAccessibilityLabel = r78 ? void 0 : r76;
r762.content = content3;
r762.isEditing = isEditing;
r762.renderContentOnly = renderContentOnly;
r762.surveyIndication = pushFeedbackType !== void 0 ? createSurveyIndication(message, theme, pushFeedbackType) : void 0;
r762.ephemeralIndication = createEphemeralIndication(message);
r762.interactionStatus = interactionStatus;
r762.executedCommand = renderExecutedCommands ? createExecutedCommand(message, channel, roleStyle, theme, colors.defaultUsernameColor) : void 0;
r762.components = message4.components.length > 0 ? renderComponents ? transformMessageComponents({
message,
guildId,
interaction,
shouldDisableInteractiveComponents,
shouldShowMedia,
shouldObscureSpoiler,
enabledContentHarmTypeFlags: enabledHarmTypesForMessage,
shouldAgeVerify: shouldAgeVerifyForExplicitMedia,
shouldShowMosaicMediaDescriptions: setting,
shouldAutoPlayGifs: gifAutoPlay,
colors
}, message4.components) : void 0 : void 0;
r762.feedbackColor = renderContentOnly ? 0 : colors.feedbackColor;
r762.highlightColor = renderContentOnly ? 0 : colors.highlightColor;
if (embeds == null) {
embeds = void 0;
}
r762.embeds = embeds;
r762.giftCodes = renderGiftCode ? createGiftCodeEmbed(message, theme) : [];
r762.codedLinks = renderCodedLinks ? createCodedLinkEmbeds(message, message4, channel, theme) : [];
r762.activityInstanceEmbed = renderActivityInstanceEmbed ? createActivityInstanceEmbed(message) : void 0;
r762.activityRichPresenceInviteEmbed = renderActivityInviteEmbed ? createActivityRichPresenceInviteEmbed(message, channel) : void 0;
if (shouldInlineAttachmentMedia) {
if (renderAttachments) {
renderAttachments = length !== 0 || length2 !== 0;
}
if (!renderAttachments) {
renderAttachments = useAttachmentUploadPreview;
}
shouldInlineAttachmentMedia = renderAttachments;
}
r762.useAttachmentGridLayout = shouldInlineAttachmentMedia;
r762.useAttachmentUploadPreview = useAttachmentUploadPreview;
r762.attachments = attachments;
r762.attachmentsOpacity = useAttachmentUploadPreview ? message.state === MessageStates.SEND_FAILED ? 0.2 : 1 : 1;
r762.stickers = restrictedPreview ? [] : transformStickers({
message: message4,
animateStickersSetting: AnimateStickers.getSetting(),
isUserInteracting: message.id === animatingStickerMessageId
});
if (renderCommunicationDisabled) {
renderCommunicationDisabled = isMemberCommunicationDisabled;
}
r762.communicationDisabled = renderCommunicationDisabled;
r762.isFirstForumPostMessage = !!(channel == null ? void 0 : channel.isForumPost()) && message.id === message.channel_id;
const r915 = channel == null ? void 0 : channel.isForumPost();
let postActions = void 0;
if (r915) {
postActions = void 0;
if (renderForumPostActions) {
L357: {
const { id: id2, channel_id } = message;
r920 = void 0;
if (id2 === channel_id) {
const guildId3 = channel.getGuildId();
if (guildId3 != null) {
const isLurking = LurkingStore.isLurking(guildId3);
r920 = void 0;
if (isLurking) {
break L357;
}
}
const hasJoined = JoinedThreadsStore.hasJoined(message.channel_id);
const hasReactions = message.reactions.length !== 0;
let defaultReaction = void 0;
if (!hasReactions) {
const defaultReactionEmoji = ChannelStore.getChannel(channel.parent_id)?.defaultReactionEmoji;
defaultReaction = createDefaultReaction({
defaultReactionEmoji,
customGuildEmoji: defaultReactionEmoji?.emojiId != null ? EmojiStore.getUsableCustomEmojiById(defaultReactionEmoji.emojiId) : null
});
}
r920 = createForumPostActions({
isFollowing: hasJoined,
hasReactions,
defaultReaction,
showMediaPostSharePrompt: MediaPostSharePromptStore.shouldDisplayPrompt(channel.id)
});
}
}
postActions = r920;
}
}
r762.postActions = postActions;
r762.isCurrentUserMessageAuthor = message.author.id === id;
r762.usingGradientTheme = ClientThemesBackgroundStore.gradientPreset != null;
r762.swipeToReplyIconUrl = getAssetUriForEmbed(Module7747);
r762.swipeToEditIconUrl = getAssetUriForEmbed(Module7748);
r762.postPreviewEmbeds = r40 ? createPostPreviewEmbeds(message, roleStyle, AccessibilityStore.useReducedMotion) : [];
r762.obscureLearnMoreLabel = intl.string(t["2aXnfa"]);
r762.safetyPolicyNoticeEmbed = createSafetyPolicyNoticeEmbed(message);
r762.pollData = pollData;
r762.sharedClientTheme = sharedClientTheme;
r762.safetySystemNotificationEmbed = createSafetySystemNotificationEmbed(message);
r762.ctaButton = createCtaButton(message.id, message.channel_id, colors);
r762.audioAttachmentBackgroundColor = hasFlag ? colors.embedBackgroundColor : void 0;
r762.accessibilityActions = createMessageAccessibilityActions(message, channel);
r762.clanTagGuildId = clanTagGuildId;
r762.clanTag = clanTag;
r762.clanBadgeUrl = clanBadgeUrl;
r762.lobbyAdditionalName = lobbyAdditionalName;
r762.lobbyTagIconUrl = lobbyTagIconUrl;
r762.isFirst = isFirst;
r762.gameApplicationId = gameApplicationId;
r762.isAnnouncementChannel = channel?.type === ChannelTypes.GUILD_ANNOUNCEMENT;
r762.displayNameStyles = createDisplayNameStylesMobile(message.author, guildMember);
r762.voiceChannelBadge = voiceChannelBadge;
return r762;
};
export default createMessageContent;
@@ -0,0 +1,42 @@
// Metro module 7932 (f7933).
import { MessageFailureState } from "./RowGeneratorConstants";
import { MessageEmbedTypes } from "../../../../Constants";
import { getAssetUriForEmbed } from "./EmbedUtils";
import Module7933 from "../../../../_bundle/Module7933";
import { intl, t } from "../../../../intl/index.native";
import Module7934 from "../../../../_bundle/Module7934";
import { sizeString } from "../../../../utils/FileUtils";
export default function createMessageFailedEmbed({ uploaderFile, useAttachmentUploadPreview, colors }) {
return uploaderFile != null ? useAttachmentUploadPreview ? {
type: MessageEmbedTypes.TEXT,
messageSendError: intl.string(t.lBLP4u),
failureState: MessageFailureState.UNSPECIFIED,
disableBackgroundColor: true,
bodyTextColor: colors.failedMessageBodyTextColor,
iconURL: getAssetUriForEmbed(Module7934)
} : {
type: MessageEmbedTypes.TEXT,
numAttachments: intl.formatToPlainString(t.D0noUt, {
count: uploaderFile.attachmentsCount
}),
failureState: MessageFailureState.UPLOAD_FAILED,
attachmentsSize: "" + (uploaderFile.currentSize !== 0 ? ` (${sizeString(uploaderFile.currentSize)})` : ""),
bodyTextColor: colors.embedBodyTextColor
} : {
type: MessageEmbedTypes.TEXT,
messageSendError: intl.string(t.lBLP4u),
failureState: MessageFailureState.UNSPECIFIED,
disableBackgroundColor: true,
bodyTextColor: colors.failedMessageBodyTextColor
};
};
export function createAutomodBlockedMessageEmbed(a0) {
return {
type: MessageEmbedTypes.TEXT,
messageSendError: a0.errorMessage,
failureState: MessageFailureState.AUTO_MODERATION_BLOCKED_MESSAGE,
disableBackgroundColor: true,
bodyTextColor: a0.colors.automodBlockedBodyTextColor,
iconURL: getAssetUriForEmbed(Module7933)
};
}
@@ -0,0 +1,75 @@
// Metro module 7815 (f7816).
import { Image as Image2 } from "react-native";
import { MessageTagTypes } from "../../MessageConstants";
import { isPublicSystemMessage } from "../../../public_guilds/PublicGuildsUtils";
import { intl, t } from "../../../../intl/index.native";
import isCrosspost from "../../isCrosspost";
import Module7820 from "../../../../_bundle/Module7820";
export default function getTagProperties(a0) {
let r78, BOT_TAG_SERVER_TYPE, channel, colors, tagIconUrl, tagText, tagVerified;
const { message, isSystemDM = false } = a0;
L11: {
channel = a0.channel;
colors = a0.colors;
const isVerifiedBot = message.author.isVerifiedBot();
if (!isPublicSystemMessage(message) && !isSystemDM) {
if (isCrosspost(message)) {
tagText = intl.string(t.PuJGuM);
BOT_TAG_SERVER_TYPE = MessageTagTypes.BOT_TAG_SERVER_TYPE;
tagVerified = isVerifiedBot;
tagIconUrl = void 0;
break L11;
}
const bot = message.author.bot;
tagVerified = isVerifiedBot;
tagIconUrl = void 0;
BOT_TAG_SERVER_TYPE = void 0;
tagText = null;
if (!bot) {
break L11;
}
const r37 = intl.string(t["9RNkeF"]);
tagIconUrl = isVerifiedBot ? Image2.resolveAssetSource(Module7820).uri : void 0;
tagVerified = isVerifiedBot;
BOT_TAG_SERVER_TYPE = void 0;
tagText = r37;
} else {
tagText = intl.string(t.lKQ7Wt);
BOT_TAG_SERVER_TYPE = MessageTagTypes.SYSTEM_DM_TAG_SYSTEM_TYPE;
tagVerified = true;
tagIconUrl = void 0;
}
}
const r1 = tagText != null;
let tagAccessibilityLabel = null;
if (r1) {
L22: {
if (!isPublicSystemMessage(message) && !isSystemDM) {
if (isCrosspost(message)) {
r78 = intl.string(t["39trQT"]);
break L22;
}
if (tagVerified) {
r78 = intl.string(t.g76OcH);
break L22;
}
r78 = intl.string(t.qwJHjo);
} else {
r78 = intl.string(t["7s687k"]);
}
}
tagAccessibilityLabel = r78;
}
return {
tagText,
tagAccessibilityLabel,
tagVerified,
tagTextColor: void 0,
tagBackgroundColor: void 0,
tagType: BOT_TAG_SERVER_TYPE,
tagIconUrl,
opTagText: channel?.ownerId === message.author.id && (channel == null ? void 0 : channel.isForumPost()) ? intl.string(t.fyE8sH) : null,
opTagTextColor: colors.opTagTextColor,
opTagBackgroundColor: colors.opTagBackgroundColor
};
};
@@ -0,0 +1,66 @@
// Metro module 7883 (f7884).
let redactRestrictedContent;
const nodeToText = function nodeToText(content) {
return content == null ? "" : typeof content !== "string" ? Array.isArray(content) ? content.map(nodeToText).join("") : typeof content.content === "string" ? content.content : content.content != null ? nodeToText(content.content) : "" : content;
};
redactRestrictedContent = function redactRestrictedContent(a0) {
let r54;
if (a0 != null && typeof a0 !== "string") {
if (Array.isArray(a0)) {
return a0.map(redactRestrictedContent);
}
if (a0.type !== "link" && a0.type !== "attachmentLink") {
if (a0.type === "customEmoji") {
return {
type: "text",
content: `:${a0.alt}:`
};
}
const r6 = a0.content != null ? {
...a0,
content: redactRestrictedContent(a0.content)
} : a0;
return a0.items != null ? {
...r6,
items: redactRestrictedContent(a0.items)
} : r6;
}
const content = a0.content;
const r45 = content == null;
let content3 = "";
if (!r45) {
let r47 = content;
if (typeof r47 !== "string") {
if (Array.isArray(content)) {
r54 = content.map(nodeToText).join("");
} else if (typeof content.content === "string") {
r54 = content.content;
} else {
const r53 = content.content != null;
r54 = "";
if (r53) {
const content2 = content.content;
const r55 = content2 == null;
let r56 = "";
if (!r55) {
let r8 = content2;
if (typeof r8 !== "string") {
r8 = Array.isArray(content2) ? content2.map(nodeToText).join("") : typeof content2.content === "string" ? content2.content : content2.content != null ? nodeToText(content2.content) : "";
}
r56 = r8;
}
r54 = r56;
}
}
r47 = r54;
}
content3 = r47;
}
return {
type: "inlineCode",
content: content3
};
}
return a0;
};
export default redactRestrictedContent;
@@ -0,0 +1,37 @@
// Metro module 7736 (f7737).
import { experimental_createToken, createNativeStyleProperties } from "../../../../design/components/Styles/native/createStyles";
import { isThemeDark } from "../../../../design/shared";
import Module712 from "../../../../_bundle/Module712";
let nativeStyleProperties;
let c4865_3 = {
textColor: Module712.colors.TEXT_STRONG,
linkColor: Module712.colors.TEXT_LINK,
timestampColor: Module712.colors.TEXT_MUTED,
highlightColor: Module712.colors.MESSAGE_HIGHLIGHT_BACKGROUND_DEFAULT,
unsupportedColor: Module712.colors.TEXT_MUTED,
embedProviderColor: experimental_createToken((a0) => isThemeDark(a0.theme) ? Module712.unsafe_rawColors.PRIMARY_300 : Module712.unsafe_rawColors.PRIMARY_630),
embedBorderLeftColor: Module712.colors.BORDER_NORMAL,
embedBodyTextColor: Module712.colors.TEXT_DEFAULT,
embedHeaderTextColor: Module712.colors.MOBILE_TEXT_HEADING_PRIMARY,
opTagTextColor: Module712.unsafe_rawColors.BRAND_560,
opTagBackgroundColor: experimental_createToken((a0) => isThemeDark(a0.theme) ? Module712.unsafe_rawColors.BRAND_260 : Module712.unsafe_rawColors.BRAND_200),
failedMessageBodyTextColor: Module712.unsafe_rawColors.RED_400,
automodBlockedBodyTextColor: Module712.colors.TEXT_MUTED,
aiBotTagColor: Module712.colors.TEXT_FEEDBACK_POSITIVE,
editedColor: Module712.colors.TEXT_MUTED,
defaultUsernameColor: Module712.colors.INTERACTIVE_TEXT_ACTIVE,
feedbackColor: Module712.colors.BACKGROUND_MOD_MUTED,
reportFpTextColor: Module712.colors.CONTROL_SECONDARY_TEXT_DEFAULT,
reportFpBackgroundColor: Module712.colors.CONTROL_SECONDARY_BACKGROUND_DEFAULT,
retryTextColor: Module712.colors.WHITE,
retryBackgroundColor: Module712.colors.BACKGROUND_BRAND,
clipTagBackgroundColor: Module712.colors.BACKGROUND_BRAND,
clipTagTextColor: Module712.unsafe_rawColors.WHITE
};
nativeStyleProperties = createNativeStyleProperties((a0) => ({
embedBackgroundColor: a0 ? Module712.colors.EMBED_BACKGROUND_ALTERNATE : Module712.colors.EMBED_BACKGROUND,
...c4865_3
}));
export default function resolveMessageContentColors(a0, r4 = false) {
return nativeStyleProperties(a0, r4);
};
@@ -0,0 +1,21 @@
// Metro module 8008 (f8009).
import { processColor } from "react-native";
import { DEFAULT_ROLE_COLOR_HEX } from "../../../../../Constants";
import Module712 from "../../../../../_bundle/Module712";
import { getDarkness, hex2int } from "../../../../../_bundle/int2hslRaw";
export function createConnectionsRoleTag(a0) {
let colorString = a0.colorString;
if (colorString == null) {
colorString = DEFAULT_ROLE_COLOR_HEX;
}
let WHITE = Module712.unsafe_rawColors.WHITE;
if (getDarkness(hex2int(colorString)) < 0.3) {
WHITE = Module712.unsafe_rawColors.PRIMARY_630;
}
return {
id: a0.id,
name: a0.name,
backgroundColor: processColor(colorString),
iconColor: processColor(WHITE)
};
}
@@ -0,0 +1,34 @@
// Metro module 12391 (f12392).
import ExplicitMediaStore from "../../../../explicit_media_redaction/ExplicitMediaStore";
import { getCtaButtonType, CtaButtonType } from "../../../CtaButtonUtils";
import * as _AgeVerificationUtils from "../../../../age_assurance/AgeVerificationUtils";
import { intl, t } from "../../../../../intl/index.native";
export function createCtaButton(a0, a1, a2) {
const ctaButtonType = getCtaButtonType(a0, a1);
const isAgeVerified = _AgeVerificationUtils.isAgeVerified();
const shouldShowTiggerPawtect = _AgeVerificationUtils.shouldShowTiggerPawtect();
if (CtaButtonType.MARK_AS_FALSE_POSITIVE === ctaButtonType) {
return {
text: intl.string(t["4q1Elf"]),
textColor: a2.reportFpTextColor,
backgroundColor: a2.reportFpBackgroundColor,
callback: ExplicitMediaStore.canSubmitFpReport(a0) ? CtaButtonType.MARK_AS_FALSE_POSITIVE : void 0
};
}
if (CtaButtonType.AGE_VERIFICATION_RETRY === ctaButtonType) {
return {
text: isAgeVerified ? intl.string(t["9KiIz6"]) : intl.string(t["/nicWo"]),
textColor: a2.retryTextColor,
backgroundColor: a2.retryBackgroundColor,
callback: shouldShowTiggerPawtect ? CtaButtonType.AGE_VERIFICATION_RETRY : void 0
};
}
if (CtaButtonType.CONNECT_TO_TEEN === ctaButtonType) {
return {
text: intl.string(t.n8a49k),
textColor: a2.retryTextColor,
backgroundColor: a2.retryBackgroundColor,
callback: CtaButtonType.CONNECT_TO_TEEN
};
}
}
@@ -0,0 +1,40 @@
// Metro module 7860 (f7861).
import GuildAutomodMessageStore from "../../../../guild_automod/GuildAutomodMessageStore";
import { HelpdeskArticles, MessageFlags } from "../../../../../Constants";
import { getEphemeralReasonMessage } from "../../../../application_commands/ApplicationCommandUserAppUtils";
import { intl, t } from "../../../../../intl/index.native";
import HelpdeskUtils from "../../../../../utils/HelpdeskUtils";
export function createEphemeralIndication(a0) {
if (a0.hasFlag(MessageFlags.EPHEMERAL)) {
if (a0.interactionMetadata?.ephemerality_reason != null) {
return {
content: intl.formatToParts(t.xgCMRQ, {
handleDelete: {
action: "bindDismissMessage",
message: a0
},
reason: getEphemeralReasonMessage(a0.interactionMetadata?.ephemerality_reason)
}),
helpArticleLink: HelpdeskUtils.getArticleURL(HelpdeskArticles.USING_APPS_FAQ),
helpButtonAccessibilityLabel: intl.string(t.OIWSJe)
};
}
const r25 = {
content: intl.formatToParts(t.uX3ecL, {
count: 1,
countMessages: 1,
handleDelete: {
action: "bindDismissMessage",
message: a0
}
}),
helpArticleLink: HelpdeskUtils.getAppsSupportURL(HelpdeskArticles.EPHEMERAL_MESSAGES),
helpButtonAccessibilityLabel: intl.string(t.htHOrp)
};
if (GuildAutomodMessageStore.getMessage(a0.id) != null) {
r25.helpArticleLink = HelpdeskUtils.getArticleURL(HelpdeskArticles.GUILD_AUTOMOD_BLOCKED_MESSAGE);
r25.helpButtonAccessibilityLabel = intl.string(t.OiCBhP);
}
return r25;
}
}
@@ -0,0 +1,103 @@
// Metro module 7731 (f7732).
import { HelpdeskArticles } from "../../../../../Constants";
import { getAssetUriForEmbed } from "../EmbedUtils";
import Module4142 from "../../../../../_bundle/Module4142";
import Module7732 from "../../../../../_bundle/Module7732";
import SentryUtils_native from "../../../../../utils/SentryUtils.native";
import Module4134 from "../../../../../_bundle/Module4134";
import { intl, t } from "../../../../../intl/index.native";
import HelpdeskUtils from "../../../../../utils/HelpdeskUtils";
import Module7733 from "../../../../../_bundle/Module7733";
import Module7734 from "../../../../../_bundle/Module7734";
import * as _AccessibilityLabelOptimizationExperiment from "../../../../a11y/native/AccessibilityLabelOptimizationExperiment";
import AvatarUtils from "../../../../../utils/AvatarUtils";
import { getAccessibleEmojiDisplayName } from "../../../../reactions/ReactionUtils";
import EmojiUtils from "../../../../../utils/EmojiUtils";
export function createDefaultReaction(a0) {
let emoji;
L14: {
const { defaultReactionEmoji, customGuildEmoji } = a0;
const shouldSkipAccessibilityLabels = _AccessibilityLabelOptimizationExperiment.shouldSkipAccessibilityLabels();
const r2 = defaultReactionEmoji != null;
emoji = void 0;
if (r2) {
const { emojiId, emojiName } = defaultReactionEmoji;
if (emojiId != null && customGuildEmoji != null) {
let name = customGuildEmoji.name;
if (name == null) {
name = "";
}
emoji = {
id: emojiId,
name: void 0,
animated: customGuildEmoji.animated,
src: AvatarUtils.getEmojiURL({
id: emojiId,
animated: customGuildEmoji.animated,
size: 48
}),
displayName: shouldSkipAccessibilityLabels ? name : getAccessibleEmojiDisplayName(false, 0, {
id: emojiId,
name,
animated: customGuildEmoji.animated
})
};
break L14;
}
const r21 = emojiName != null;
emoji = void 0;
if (r21) {
let name2 = emojiName;
if (name2 == null) {
name2 = "";
}
emoji = {
id: void 0,
name: emojiName,
animated: false,
src: EmojiUtils.getURL(emojiName),
displayName: shouldSkipAccessibilityLabels ? name2 : getAccessibleEmojiDisplayName(false, 0, {
id: void 0,
name: name2,
animated: false
})
};
}
}
}
return emoji != null ? {
emoji,
me: false,
count: 0
} : void 0;
}
export function createForumPostActions({ isFollowing, hasReactions, defaultReaction, showMediaPostSharePrompt }) {
const followIcon = isFollowing ? getAssetUriForEmbed(Module4142) : getAssetUriForEmbed(Module7732);
if (followIcon == null) {
SentryUtils_native.captureMessage(`Forum follow is null. isFollowing: ${isFollowing} icon: ${isFollowing ? Module4142 : Module7732}`);
}
const assetUriForEmbed = getAssetUriForEmbed(Module4134);
const addReactLabel = hasReactions ? void 0 : defaultReaction?.emoji != null ? void 0 : intl.string(t.xpOyTO);
const sharePrompt = showMediaPostSharePrompt ? {
title: intl.string(t["5uAO7d"]),
subtitle: intl.formatToParts(t.YtCu5p, {
helpArticleUrl: {
url: HelpdeskUtils.getCreatorSupportArticleURL(HelpdeskArticles.MEDIA_CHANNEL)
}
}),
cta: intl.string(t.C5UQC9),
icon: getAssetUriForEmbed(Module7733),
closeIcon: getAssetUriForEmbed(Module7734)
} : void 0;
return {
numDisplayedReactions: 3,
isFollowing,
followIcon,
followLabel: isFollowing ? intl.string(t["OtF+lC"]) : intl.string(t["0rQinA"]),
shareIcon: assetUriForEmbed,
shareLabel: intl.string(t.Ej3B3Y),
defaultReaction,
addReactLabel,
sharePrompt
};
}
@@ -0,0 +1,24 @@
// Metro module 8009 (f8010).
import { NotificationTypes } from "../../../../push_notifications/PushNotificationConstants";
import { t, intl } from "../../../../../intl/index.native";
import { getAssetUriForEmbed } from "../EmbedUtils";
import { isThemeDark } from "../../../../../design/shared";
import Module8010 from "../../../../../_bundle/Module8010";
import Module8011 from "../../../../../_bundle/Module8011";
export function createSurveyIndication(a0, a1, a2) {
let notificationType = a2;
const r10 = a2 === NotificationTypes.TOP_MESSAGE_PUSH ? t.GwWhce : t["46+Iqc"];
if (a2 == null) {
notificationType = NotificationTypes.TOP_MESSAGE_PUSH;
}
return {
content: intl.formatToParts(r10, {
handleMessage: {
action: "bindUserSurvey",
message: a0,
notificationType
}
}),
feedbackIconUrl: getAssetUriForEmbed(isThemeDark(a1) ? Module8010 : Module8011)
};
}
@@ -0,0 +1,33 @@
// Metro module 8006 (f8007).
import { Image as Image2 } from "react-native";
import ChannelStore from "../../../../../stores/ChannelStore";
import PermissionStore from "../../../../../stores/PermissionStore";
import VoiceStateStore from "../../../../../stores/VoiceStateStore";
import { Permissions } from "../../../../../Constants";
import { getVoiceChannelBadgeExperiment } from "../../../../channel/VoiceChannelBadgeExperiment";
import { getChannelIcon } from "../../../../../utils/native/ChannelUtils";
import { shouldAgeVerifyForAgeGate, shouldShowAgeGateForChannelId } from "../../../../age_gate/AgeGateUtils";
export function createVoiceChannelBadge(a0, a1) {
if (getVoiceChannelBadgeExperiment({
guildId: a1 == null ? void 0 : a1,
location: "VoiceChannelBadgeNative"
}).enabled && a1 != null) {
const discoverableVoiceState = VoiceStateStore.getDiscoverableVoiceState(a1, a0);
if (discoverableVoiceState != null) {
const channel = ChannelStore.getChannel(discoverableVoiceState?.channelId);
if (channel != null) {
const uri = Image2.resolveAssetSource(getChannelIcon(channel))?.uri;
if (uri != null) {
const r34 = shouldAgeVerifyForAgeGate() && shouldShowAgeGateForChannelId(channel.id);
const r40 = channel.isPrivate() || PermissionStore.can(Permissions.VIEW_CHANNEL, channel) && PermissionStore.can(Permissions.CONNECT, channel);
if (!r34 && r40) {
return {
channelId: channel.id,
channelIconUrl: uri
};
}
}
}
}
}
}
@@ -0,0 +1,410 @@
// Metro module 12371 (f12372).
import ApplicationStore from "../../../../../applications/ApplicationStore";
import SpotifyStore from "../../../../../spotify/SpotifyStore";
import { SpotifyApplication } from "../../../../../../records/SpotifyApplicationRecord";
import UserRecord from "../../../../../../records/UserRecord";
import AuthenticationStore from "../../../../../../stores/AuthenticationStore";
import GamePartyStore from "../../../../../../stores/GamePartyStore";
import LocalActivityStore from "../../../../../../stores/LocalActivityStore";
import MessageStore from "../../../../../../stores/MessageStore";
import PresenceStore from "../../../../../../stores/PresenceStore";
import SelfPresenceStore from "../../../../../../stores/SelfPresenceStore";
import UserStore from "../../../../../../stores/UserStore";
import ActivityLauncherStore from "../../../../../../stores/views/ActivityLauncherStore";
import { ActivityActionStates, ActivityActionTypes, ActivityTypes } from "../../../../../../Constants";
import { SPOTIFY_PLATFORM_NAME, isSpotifyParty } from "../../../../../spotify/SpotifyConstants";
import { fetchApplication } from "../../../../../applications/ApplicationActionCreators";
import { getRemoteJoinFooterLabel } from "../../../../../activities/utils/getRemoteJoinFooterLabel";
import { intl, t } from "../../../../../../intl/index.native";
import { getContentClassificationVisibility, ContentClassificationVisibility } from "../../../../../content_classification/ContentClassificationVisibility";
import { getApplicationFromMessage } from "../../../../../activities/utils/getApplicationFromMessage";
import isInviteActive from "../../../../../activities/utils/isInviteActive";
import { getIsAskToJoin } from "../../../../../activities/utils/getIsAskToJoin";
import { getAssetImage } from "../../../../../../utils/ApplicationAssetUtils";
import { getRequestToStreamText, getHeaderText, getPartyText, getDeadGameInviteText } from "../../../../../activities/utils/InviteEmbedTextUtils";
import { getPartySize } from "../../../../../activities/utils/getPartySize";
import { getCurrentActivityGamePlatform } from "../../../../../activities/utils/isActivityJoinableOnCurrentPlatform";
import getCurrentUserPresenceActivity from "../../../../../activities/utils/getCurrentUserPresenceActivity";
import { getIsInParty } from "../../../../../activities/utils/getIsInParty";
import { getCanSendInvite } from "../../../../../activities/utils/getCanSendInvite";
import { canLaunchFrame } from "../../../../../frames/utils/canLaunchFrame";
import { isEmbeddedApp } from "../../../../../app_launcher/utils/AppLauncherUtils";
import { getCanJoin } from "../../../../../activities/utils/getCanJoin";
import { formatActiveTimestamp } from "../../../../../content_inventory/utils";
import { getAppIconSrc, getAppGradientColors } from "../../../../../applications/message_embed/native/utils/nativeAppMessageEmbedUtil";
import getCoverImageFromActivity from "../../../../../activities/utils/getCoverImageFromActivity";
import { isMostRecentDeadEndInvite } from "../../../../../activities/utils/isMostRecentDeadEndInvite";
import { getSupportsRemoteJoin } from "../../../../../activities/utils/getSupportsRemoteJoin";
import { getShouldShowAppAuthPrompt } from "../../../../../application_account_linking/native/getShouldShowAppAuthPrompt";
import { ACTIVITY_GAME_PLATFORM_TO_ICON_KEY, getJoinFromSupportedPlatformsIconKeys } from "../../../../../activities/utils/useJoinFromSupportedPlatformsIconKeys";
import { getPresenceActivityInviteCoverImageURL } from "../../../../../activities/utils/usePresenceActivityInviteCoverImageURL";
import getRequestToStreamCTAAndIsDisabled from "../../../../../request_to_stream/native/getRequestToStreamCTAAndIsDisabled";
import RequestToStream_messages from "../../../../../request_to_stream/RequestToStream.messages";
let $mk89734 = function() {
return (a0) => a0.type === ActivityTypes.LISTENING;
};
let c8542_20 = {
ACTIVE: "active",
DEAD: "dead",
DEAD_COMPACT: "dead_compact",
BLOCKED: "blocked"
};
export { c8542_20 as EmbedDisplayType };
export function createActivityRichPresenceInviteEmbed(a0, a1) {
let r7, r28, r359, r576, ctaButtonEnabled, ctaButtonIsLoading, ctaButtonText, detailsText, footerLabel2, headerText2, iconSrc, partyMemberAvatarURIs, partySizeText, platformIconKeys, presenceActivity, subtitle, title;
if (a0.author != null && a0.activity != null && a1 != null) {
const contentClassificationVisibility = getContentClassificationVisibility(a0.application?.content_classification, a1, UserStore.getCurrentUser()?.nsfwAllowed);
if (ContentClassificationVisibility.DISPLAY === contentClassificationVisibility) {
let c19810_0 = a1;
const applicationFromMessage = getApplicationFromMessage(a0);
const id = a0.application?.id;
let application = id != null ? ApplicationStore.getApplication(id) : null;
if (application == null && id != null && ApplicationStore.isFetchingApplication(id) === false) {
fetchApplication(id, false);
}
if (application == null) {
application = applicationFromMessage;
}
const id2 = AuthenticationStore.getId();
if (a0.application != null) {
const id3 = a0.author.id;
presenceActivity = PresenceStore.getApplicationActivity(a0.activity?.type === ActivityActionTypes.JOIN_REQUEST ? id3 === id2 ? a1.isPrivate() ? a1.getRecipientId() : id2 : id2 : a0.activity?.type === ActivityActionTypes.STREAM_REQUEST ? id2 : id3, a0.application.id);
} else {
presenceActivity = PresenceStore.findActivity(a0.author.id, $mk89734());
}
const r163 = application != null;
let r164 = void 0;
if (r163) {
if (a0.activity?.type === ActivityActionTypes.STREAM_REQUEST) {
const iconSrc2 = application.icon != null ? getAppIconSrc(application.id, application.icon, application.bot) : null;
let r564 = iconSrc2;
if (r564 == null) {
r564 = void 0;
}
const appGradientColors2 = getAppGradientColors(r564);
const id6 = AuthenticationStore.getId();
if (a0.application != null) {
const id7 = a0.author.id;
r576 = PresenceStore.getApplicationActivity(a0.activity?.type === ActivityActionTypes.JOIN_REQUEST ? id7 === id6 ? a1.isPrivate() ? a1.getRecipientId() : id6 : id6 : a0.activity?.type === ActivityActionTypes.STREAM_REQUEST ? id6 : id7, a0.application.id);
} else {
r576 = PresenceStore.findActivity(a0.author.id, $mk89734());
}
const isInviteActive3 = isInviteActive(r576, a0, application.id);
const requestToStreamText = getRequestToStreamText(a0, a1, AuthenticationStore.getId());
const requestToStreamCTAAndIsDisabled = getRequestToStreamCTAAndIsDisabled(a0);
r164 = {
displayType: isInviteActive3 ? c8542_20.ACTIVE : c8542_20.DEAD,
ctaButtonEnabled: !requestToStreamCTAAndIsDisabled.isDisabled,
ctaButtonText: requestToStreamCTAAndIsDisabled.text,
ctaButtonIsLoading: false,
footerLabel: null,
gradientColors: appGradientColors2,
headerText: intl.string(RequestToStream_messages.nAyuPp),
iconSrc: iconSrc2,
isSpotifyParty: false,
isPlatformSupported: true,
maxPartySize: 0,
partyMemberAvatarURIs: null,
partySizeText: null,
platformIconKeys: [],
coverImageUrl: null,
detailsText: null,
subtitle: requestToStreamText,
title: application.name
};
} else {
const isInviteActive2 = isInviteActive(presenceActivity, a0, application.id);
const r173 = !isInviteActive2;
const isAskToJoin = getIsAskToJoin(a0);
let appName = a0.activity?.name_override;
if (appName == null) {
appName = application.name;
}
let r43 = a0.activity?.icon_override != null ? getAssetImage(application.id, a0.activity.icon_override) : null;
const headerText = getHeaderText(appName, a0.activity?.type, r173);
if (presenceActivity != null && presenceActivity.party != null) {
const r195 = Array;
let r200 = GamePartyStore.getParty(presenceActivity.party.id);
if (r200 == null) {
r200 = [];
}
r28 = r195.from(r200);
} else {
r28 = [];
}
let maxPartySize = getPartySize(presenceActivity).maxPartySize;
const currentActivityGamePlatform = getCurrentActivityGamePlatform();
const currentUserPresenceActivity = getCurrentUserPresenceActivity(LocalActivityStore, SelfPresenceStore, application.id);
const isInParty = getIsInParty(currentUserPresenceActivity, presenceActivity);
const canSendInvite = getCanSendInvite(presenceActivity, a0, application, id2);
const r220 = Set;
let r222 = presenceActivity?.supported_platforms;
if (r222 == null) {
r222 = [];
}
const isGameLaunchable = new r220(r222).has(currentActivityGamePlatform);
const canLaunchFrame2 = canLaunchFrame(application);
const canJoin2 = getCanJoin({
presenceActivity,
currentUserPresenceActivity,
currentUserId: id2,
message: a0,
application,
isEmbeddedApplication: isEmbeddedApp(application),
isFrameApplication: canLaunchFrame2,
isGameLaunchable
});
const { canJoin, remoteJoinPlatform } = canJoin2;
const isSpotifyParty2 = isSpotifyParty(presenceActivity == null ? void 0 : presenceActivity.party?.id) || application.id === SpotifyApplication.id;
let start = presenceActivity == null ? void 0 : presenceActivity.timestamps?.start;
if (start == null) {
start = presenceActivity?.created_at;
}
const end = presenceActivity == null ? void 0 : presenceActivity.timestamps?.end;
const r40 = start != null ? formatActiveTimestamp({
start,
end
}, Date.now()) : "";
if (r43 == null) {
r43 = application.icon != null ? getAppIconSrc(application.id, application.icon, application.bot) : null;
}
L160: {
if (isSpotifyParty2) {
const r435 = presenceActivity != null && (presenceActivity.details != null && presenceActivity.state != null) ? intl.formatToPlainString(t.JCvHtx, {
track: presenceActivity.details,
artist: presenceActivity.state
}).replace("\n", " ") : application.name;
const r459 = intl.string(t.sTo7s3);
if (isInviteActive2) {
let r471 = getCoverImageFromActivity(presenceActivity, application.id);
if (r471 == null) {
r471 = void 0;
}
const author = a0.author;
const hasConnectedAccount = SpotifyStore.hasConnectedAccount();
const syncingWith = SpotifyStore.getSyncingWith();
const activity = SpotifyStore.getActivity();
const id4 = author.id;
const id5 = AuthenticationStore.getId();
const r485 = activity?.party != null && (presenceActivity == null ? void 0 : presenceActivity.party?.id) === activity.party.id;
const r8 = syncingWith?.userId != null && syncingWith?.userId === author.id;
const r505 = intl.string(t.VJlc0S);
const r516 = hasConnectedAccount ? (r8 ? r8 : r485) ? intl.string(t.KC26NR) : r505 : intl.formatToPlainString(t.XWSHTb, {
platform: SPOTIFY_PLATFORM_NAME
});
ctaButtonEnabled = !(id4 === id5 || r8 || r485);
r7 = false;
title = r435;
iconSrc = r471;
subtitle = r40;
detailsText = null;
partySizeText = "";
partyMemberAvatarURIs = null;
ctaButtonIsLoading = false;
headerText2 = headerText;
footerLabel2 = r459;
ctaButtonText = r516;
} else {
subtitle = intl.string(t["84qx9r"]);
title = application.name;
r7 = false;
iconSrc = r43;
detailsText = null;
partySizeText = "";
partyMemberAvatarURIs = null;
ctaButtonIsLoading = false;
ctaButtonEnabled = false;
headerText2 = headerText;
footerLabel2 = r459;
ctaButtonText = void 0;
}
} else if (isInviteActive2) {
const r330 = r28.map((item) => {
let r7 = UserStore.getUser(item);
if (r7 == null) {
r7 = new UserRecord({
discriminator: "0005"
});
}
return String(r7 == null ? void 0 : r7.getAvatarURL(c19810_0.guild_id, 64));
});
const partyText = getPartyText({
maxPartySize,
partySize: r28.length,
activityActionType: a0.activity?.type
});
const details = presenceActivity?.details;
const r341 = details != null && details !== "" ? details : null;
L122: {
const supportsRemoteJoin = getSupportsRemoteJoin(presenceActivity);
const shouldShowAppAuthPrompt = getShouldShowAppAuthPrompt(application);
if (canJoin) {
const footerLabel3 = remoteJoinPlatform != null ? getRemoteJoinFooterLabel(remoteJoinPlatform) : void 0;
r359 = {
label: intl.string(t.VJlc0S),
disabled: false,
footerLabel: footerLabel3
};
} else if (canSendInvite) {
r359 = {
label: intl.string(t["hC/Zey"]),
disabled: a0.author.id === id2,
footerLabel: void 0
};
} else if (isInParty) {
r359 = {
label: intl.string(t.KC26NR),
disabled: true,
footerLabel: void 0
};
} else if (isAskToJoin) {
r359 = {
label: void 0,
disabled: false,
footerLabel: intl.formatToPlainString(t.gYVkSW, {
username: a0.author.globalName,
appName
})
};
} else {
if (supportsRemoteJoin && shouldShowAppAuthPrompt) {
r359 = {
label: intl.string(t.lw71Nf),
disabled: false,
footerLabel: void 0
};
break L122;
}
r359 = {
label: void 0,
disabled: false,
footerLabel: intl.string(t.OAB5TK)
};
}
}
const label = r359.label;
const r423 = !r359.disabled;
const footerLabel = r359.footerLabel;
const r5 = presenceActivity != null && presenceActivity.application_id != null && ActivityLauncherStore.getState(presenceActivity.application_id, ActivityActionTypes.JOIN) === ActivityActionStates.LOADING;
r7 = false;
ctaButtonIsLoading = r5;
title = appName;
iconSrc = r43;
subtitle = r40;
detailsText = r341;
partySizeText = partyText;
partyMemberAvatarURIs = r330;
ctaButtonEnabled = r423;
headerText2 = headerText;
footerLabel2 = footerLabel;
ctaButtonText = label;
} else {
const r278 = application.deepLinkUri != null;
const r279 = r278 ? MessageStore.getMessages(a1.id) : void 0;
if (r278 && r279 != null && isMostRecentDeadEndInvite(a0.id, r279, application.id, presenceActivity)) {
subtitle = getDeadGameInviteText(a0, appName, a1, id2, true);
ctaButtonText = intl.string(t["s+J8Dl"]);
r7 = false;
title = appName;
iconSrc = r43;
detailsText = null;
partySizeText = "";
partyMemberAvatarURIs = null;
ctaButtonIsLoading = false;
ctaButtonEnabled = true;
headerText2 = headerText;
footerLabel2 = void 0;
break L160;
}
headerText2 = intl.string(t.pkq6Vq);
subtitle = intl.string(t["Sq/E1I"]);
ctaButtonIsLoading = false;
title = appName;
iconSrc = r43;
r7 = true;
detailsText = null;
partySizeText = "";
partyMemberAvatarURIs = null;
ctaButtonEnabled = false;
footerLabel2 = void 0;
ctaButtonText = void 0;
}
}
if (remoteJoinPlatform != null) {
const r534 = [];
const r538 = ACTIVITY_GAME_PLATFORM_TO_ICON_KEY[remoteJoinPlatform];
platformIconKeys = r534;
if (r538 != null) {
r534.push(r538);
platformIconKeys = r534;
}
} else {
platformIconKeys = getJoinFromSupportedPlatformsIconKeys({
platforms: presenceActivity?.supported_platforms,
currentPlatform: currentActivityGamePlatform,
isGameLaunchable
});
}
let r541 = iconSrc;
if (r541 == null) {
r541 = void 0;
}
const appGradientColors = getAppGradientColors(r541);
const presenceActivityInviteCoverImageURL = getPresenceActivityInviteCoverImageURL({
messageId: a0.id,
presenceActivity,
application
});
const displayType = r7 ? c8542_20.DEAD_COMPACT : isInviteActive2 ? c8542_20.ACTIVE : c8542_20.DEAD;
if (!(maxPartySize > 0)) {
maxPartySize = r28.length;
}
r164 = {
displayType,
ctaButtonEnabled,
ctaButtonText,
ctaButtonIsLoading,
footerLabel: footerLabel2,
gradientColors: appGradientColors,
headerText: headerText2,
iconSrc,
isPlatformSupported: isGameLaunchable,
isSpotifyParty: isSpotifyParty2,
maxPartySize,
partyMemberAvatarURIs,
partySizeText,
platformIconKeys,
coverImageUrl: presenceActivityInviteCoverImageURL,
detailsText,
subtitle,
title
};
}
}
return r164;
}
if (ContentClassificationVisibility.BLOCK_UNDERAGE !== contentClassificationVisibility && ContentClassificationVisibility.BLOCK_CHANNEL_RESTRICTION !== contentClassificationVisibility) {
return null;
}
return {
displayType: c8542_20.BLOCKED,
headerText: intl.string(t.pkq6Vq),
subtitle: contentClassificationVisibility === ContentClassificationVisibility.BLOCK_UNDERAGE ? intl.string(t.GhU4yl) : intl.string(t.B99UMJ),
ctaButtonEnabled: false,
ctaButtonText: void 0,
ctaButtonIsLoading: false,
footerLabel: void 0,
gradientColors: [],
iconSrc: void 0,
isPlatformSupported: false,
isSpotifyParty: false,
maxPartySize: 0,
partyMemberAvatarURIs: null,
partySizeText: void 0,
platformIconKeys: [],
coverImageUrl: void 0,
detailsText: void 0,
title: void 0
};
}
}
@@ -0,0 +1,157 @@
// Metro module 12369 (f12370).
import EmbeddedActivitiesStore from "../../../../../activities/EmbeddedActivitiesStore";
import ApplicationStore from "../../../../../applications/ApplicationStore";
import AuthenticationStore from "../../../../../../stores/AuthenticationStore";
import ChannelStore from "../../../../../../stores/ChannelStore";
import PresenceStore from "../../../../../../stores/PresenceStore";
import UserStore from "../../../../../../stores/UserStore";
import { CodedLinkExtendedType } from "./coded_links/CodedLinksConstants";
import { getContentClassificationVisibility, ContentClassificationVisibility } from "../../../../../content_classification/ContentClassificationVisibility";
import { intl, t } from "../../../../../../intl/index.native";
import { AppMessageEmbedDisplayType } from "./coded_links/CodedLinksTypes";
import { getEmbeddedActivityParticipantAvatarUris } from "./coded_links/useEmbeddedActivityParticipantAvatarUris";
import { getJoinOrStartButtonState } from "../../../../EmbeddedApplicationInstanceUtils";
import { getPlayInContext } from "../../../../../applications/message_embed/utils/getPlayInContext";
import { getAppIconSrc, getAppGradientColors } from "../../../../../applications/message_embed/native/utils/nativeAppMessageEmbedUtil";
import { fetchApplication } from "../../../../../applications/ApplicationActionCreators";
import { getActivityLaunchURL } from "../../../../../applications/getApplicationInstallURL";
export function createActivityInstanceEmbed(a0) {
let header, participantsDescription;
const { application: application2, activityInstance } = a0;
const channel = ChannelStore.getChannel(a0.channel_id);
if (application2 != null && activityInstance?.id != null && channel != null) {
const contentClassificationVisibility = getContentClassificationVisibility(application2.content_classification, channel, UserStore.getCurrentUser()?.nsfwAllowed);
if (ContentClassificationVisibility.DISPLAY === contentClassificationVisibility) {
const id5 = activityInstance.id;
const application = application2;
const channel_id = a0.channel_id;
const guild_id = channel.guild_id;
let r92 = channel.isThread() ? channel.parent_id : channel_id;
if (r92 == null) {
r92 = "";
}
let id;
const activity = EmbeddedActivitiesStore.getEmbeddedActivitiesForChannelIncludingHidden(r92).find((item) => item.applicationId === application.id);
const currentEmbeddedActivity = EmbeddedActivitiesStore.getCurrentEmbeddedActivity();
const embeddedActivityParticipantAvatarUris = getEmbeddedActivityParticipantAvatarUris({
activity,
applicationId: application.id,
guildId: guild_id,
channelId: channel_id
});
id = application.id;
const r109 = activity == null ? void 0 : activity.userIds.values().next().value;
let r116 = r109 == null ? null : PresenceStore.findActivity(r109, (a0) => a0.application_id === id)?.details;
const joinOrStartButtonState = getJoinOrStartButtonState({
embeddedActivity: activity,
currentEmbeddedActivity,
channel
});
if (activity != null) {
if (r116 == null) {
r116 = intl.string(t.oQn0h4);
}
participantsDescription = `${embeddedActivityParticipantAvatarUris.length} ${intl.string(t.BMTj28)}`;
header = r116;
} else {
const r136 = joinOrStartButtonState.disabled ? intl.string(t.JBnc7N) : intl.string(t.cX9uLZ);
header = r116 == null ? r136 : r116;
participantsDescription = null;
}
const playInContext = getPlayInContext(application.id, channel_id);
const instanceId = playInContext.instanceId;
let isCurrentlyInInstance = playInContext.isCurrentlyInInstance;
const canLaunchInChannel = playInContext.canLaunchInChannel;
let iconSrc = application.icon != null ? getAppIconSrc(application.id, application.icon, application.bot) : null;
const label = instanceId == null ? intl.string(t.RscU7I) : intl.string(t.VJlc0S);
if (!isCurrentlyInInstance) {
isCurrentlyInInstance = canLaunchInChannel === false;
}
const actions = [{
id: "play_in_channel",
label,
disabled: isCurrentlyInInstance
}];
if (ApplicationStore.getApplication(application.id) == null && ApplicationStore.isFetchingApplication(application.id) === false) {
fetchApplication(application.id);
}
const appMessageEmbedModel = {
displayType: AppMessageEmbedDisplayType.DISPLAY,
appId: application.id,
messageId: a0.id,
title: intl.string(t.pkq6Vq),
header: null,
info: null,
tagline: null,
staticBannerSrc: null,
iconSrc: null,
embedUrl: null,
bannerRatio: "bot",
actions: null,
extendedType: null,
gradientColors: null,
backgroundColor: 0,
borderColor: 0,
headerColor: 0,
headerText: null,
type: null
};
if (header == null) {
header = "";
}
appMessageEmbedModel.header = header;
appMessageEmbedModel.iconSrc = iconSrc;
appMessageEmbedModel.embedUrl = getActivityLaunchURL({
applicationId: application.id,
referrerId: AuthenticationStore.getId()
});
appMessageEmbedModel.actions = actions;
appMessageEmbedModel.extendedType = CodedLinkExtendedType.APP_MESSAGE_EMBED;
if (iconSrc == null) {
iconSrc = void 0;
}
appMessageEmbedModel.gradientColors = getAppGradientColors(iconSrc);
return {
applicationId: application.id,
instanceId: id5,
appMessageEmbedModel,
participantAvatarUris: embeddedActivityParticipantAvatarUris,
participantsDescription
};
}
if (ContentClassificationVisibility.BLOCK_UNDERAGE !== contentClassificationVisibility && ContentClassificationVisibility.BLOCK_CHANNEL_RESTRICTION !== contentClassificationVisibility) {
return void 0;
}
const id2 = application2.id;
const id3 = activityInstance.id;
const id4 = a0.id;
const info = contentClassificationVisibility === ContentClassificationVisibility.BLOCK_UNDERAGE ? intl.string(t.LPOzxB) : intl.string(t.NIZyKq);
return {
applicationId: id2,
instanceId: id3,
participantAvatarUris: [],
participantsDescription: null,
appMessageEmbedModel: {
displayType: AppMessageEmbedDisplayType.BLOCKED,
appId: id2,
messageId: id4,
title: null,
header: intl.string(t.bZBN64),
info,
tagline: null,
iconSrc: null,
staticBannerSrc: null,
bannerRatio: "bot",
actions: [],
embedUrl: null,
extendedType: CodedLinkExtendedType.APP_MESSAGE_EMBED,
gradientColors: [],
backgroundColor: 0,
borderColor: 0,
headerColor: 0,
headerText: null,
type: null
}
};
}
}
@@ -0,0 +1,282 @@
// Metro module 8031 (f8032).
import { Image as Image2, processColor } from "react-native";
import AuthenticationStore from "../../../../../../stores/AuthenticationStore";
import GiftCodeStore from "../../../../../../stores/GiftCodeStore";
import UserStore from "../../../../../../stores/UserStore";
import SKUStore from "../../../../../../stores/game_store/SKUStore";
import { AbortCodes, MessageTypes } from "../../../../../../Constants";
import { PremiumGiftStyles, PremiumSubscriptionSKUs } from "../../../../../premium/PremiumConstants";
import Module12334 from "../../../../../../_bundle/Module12334";
import Module12335 from "../../../../../../_bundle/Module12335";
import Module12336 from "../../../../../../_bundle/Module12336";
import Module12337 from "../../../../../../_bundle/Module12337";
import Module12338 from "../../../../../../_bundle/Module12338";
import Module12339 from "../../../../../../_bundle/Module12339";
import Module12340 from "../../../../../../_bundle/Module12340";
import Module12341 from "../../../../../../_bundle/Module12341";
import Module12342 from "../../../../../../_bundle/Module12342";
import Module12343 from "../../../../../../_bundle/Module12343";
import Module12344 from "../../../../../../_bundle/Module12344";
import Module11896 from "../../../../../../_bundle/Module11896";
import UserUtils from "../../../../../../utils/UserUtils";
import getEmbedThemeColors from "./getEmbedThemeColors";
import * as _shared from "../../../../../../design/shared";
import { getEmbedBackground } from "../../../../../client_themes/native/ClientThemesUtils";
import { intl, t } from "../../../../../../intl/index.native";
import Module10994 from "../../../../../../_bundle/Module10994";
import Module10995 from "../../../../../../_bundle/Module10995";
import Module712 from "../../../../../../_bundle/Module712";
import Module3771 from "../../../../../../_bundle/Module3771";
import { processColorOrThrow } from "../../RowGeneratorStyleSheet";
import { getAssetUriForEmbed } from "../../EmbedUtils";
import Module12345 from "../../../../../../_bundle/Module12345";
import Module12346 from "../../../../../../_bundle/Module12346";
import Module12347 from "../../../../../../_bundle/Module12347";
import Module12348 from "../../../../../../_bundle/Module12348";
import Module12349 from "../../../../../../_bundle/Module12349";
import * as _SlayerStorefrontUtils from "../../../../../slayer_storefront/SlayerStorefrontUtils";
import { getGameItemThumbnailUrl } from "../../../../../slayer_storefront/SlayerStorefrontUtils";
import PremiumUtils from "../../../../../../utils/PremiumUtils";
import { HermesBuiltin } from "../../../../../../_hermes/prelude";
const getGiftStyleUrl = function getGiftStyleUrl(giftStyle) {
if (PremiumGiftStyles.BOX === giftStyle) {
return Module12334;
}
if (PremiumGiftStyles.CUP === giftStyle) {
return Module12335;
}
if (PremiumGiftStyles.SNOWGLOBE === giftStyle) {
return Module12336;
}
if (PremiumGiftStyles.STANDARD_BOX === giftStyle) {
return Module12337;
}
if (PremiumGiftStyles.COFFEE === giftStyle) {
return Module12338;
}
if (PremiumGiftStyles.CAKE === giftStyle) {
return Module12339;
}
if (PremiumGiftStyles.CHEST === giftStyle) {
return Module12340;
}
if (PremiumGiftStyles.SEASONAL_STANDARD_BOX === giftStyle) {
return Module12341;
}
if (PremiumGiftStyles.SEASONAL_CAKE === giftStyle) {
return Module12342;
}
if (PremiumGiftStyles.SEASONAL_CHEST === giftStyle) {
return Module12343;
}
if (PremiumGiftStyles.SEASONAL_COFFEE === giftStyle) {
return Module12344;
}
if (PremiumGiftStyles.NITROWEEN_STANDARD === giftStyle) {
return {
uri: Module11896
};
}
return Module12337;
};
export function createGiftCodeEmbed(a0, a1) {
let headerColor, titleColor, subtitleColor, bodyTextColor, resolvingGradientStart, resolvingGradientEnd, acceptLabelDisabledBackgroundColor, acceptLabelDisabledColor, thumbnailBackgroundColor, acceptLabelGreenColor, acceptBlurpleLabelBackgroundColor, c16195_13;
let c16195_0 = a0;
if (a0.author != null && a0.giftCodes.length !== 0) {
const colors = getEmbedThemeColors(a1).colors;
headerColor = colors.headerColor;
titleColor = colors.titleColor;
subtitleColor = colors.subtitleColor;
bodyTextColor = colors.bodyTextColor;
const { borderColor, backgroundColor } = colors;
resolvingGradientStart = colors.resolvingGradientStart;
resolvingGradientEnd = colors.resolvingGradientEnd;
acceptLabelDisabledBackgroundColor = colors.acceptLabelDisabledBackgroundColor;
acceptLabelDisabledColor = colors.acceptLabelDisabledColor;
thumbnailBackgroundColor = colors.thumbnailBackgroundColor;
acceptLabelGreenColor = colors.acceptLabelGreenColor;
acceptBlurpleLabelBackgroundColor = colors.acceptBlurpleLabelBackgroundColor;
const isThemeDark = _shared.isThemeDark(a1);
let backgroundColor2 = backgroundColor;
if (isThemeDark) {
let r41 = getEmbedBackground();
if (r41 == null) {
r41 = void 0;
}
let r42 = processColor(r41);
if (r42 == null) {
r42 = backgroundColor;
}
backgroundColor2 = r42;
}
c16195_13 = {
borderColor,
backgroundColor: backgroundColor2,
thumbnailCornerRadius: 3
};
return a0.giftCodes.map((a0) => {
let r220, r221, acceptLabelBackgroundColor, acceptLabelColor, acceptLabelText, headerText;
const r12 = GiftCodeStore.get(a0);
if (a0 != null) {
if (GiftCodeStore.getIsResolved(a0)) {
const id = AuthenticationStore.getId();
const r6 = r12 != null ? id === r12.userId : id === c16195_0.author.id;
if (r12 == null) {
const code = GiftCodeStore.getError(a0)?.code;
const INVALID_GIFT_REDEMPTION_CLIENT_UPDATE_REQUIRED = AbortCodes.INVALID_GIFT_REDEMPTION_CLIENT_UPDATE_REQUIRED;
const r420 = {
thumbnailUrl: Image2.resolveAssetSource(_shared.isThemeDark(a1) ? Module10994 : Module10995).uri,
headerText: (r6 ? intl.string(t.kzFKb6) : intl.string(t.jwCLTM)).toUpperCase(),
titleText: intl.string(t.SdKbX2),
titleColor: null,
headerColor: null,
thumbnailBackgroundColor: null,
subtitle: null,
subtitleColor: null
};
let titleColor2 = processColor(Module712.unsafe_rawColors.RED_400);
if (titleColor2 == null) {
titleColor2 = titleColor;
}
r420.titleColor = titleColor2;
r420.headerColor = headerColor;
r420.thumbnailBackgroundColor = thumbnailBackgroundColor;
r420.subtitle = code === INVALID_GIFT_REDEMPTION_CLIENT_UPDATE_REQUIRED ? intl.string(t.QXgO5w) : r6 ? intl.string(t.pBDXpb) : intl.string(t.TPamyd);
r420.subtitleColor = subtitleColor;
HermesBuiltin.copyDataProperties(r420, c16195_13);
return r420;
}
const r27 = SKUStore.get(r12.skuId);
const isAccepting = GiftCodeStore.getIsAccepting(a0);
const currentUser = UserStore.getCurrentUser();
const canBeAccepted = !!currentUser?.verified && !(r12.redeemed || r12.isClaimed);
const subtitle = canBeAccepted && r12.expiresAt != null ? intl.formatToPlainString(t.nZBvUR, {
hours: r12.expiresAt.diff(Module3771(), "h")
}) : void 0;
const bodyText = r12.redeemed ? intl.string(t["/cg57l"]) : r12.isClaimed ? intl.string(t.ARWFQX) : currentUser?.verified ? void 0 : intl.string(t["j+KPkX"]);
const r123 = r12.giftStyle != null || c16195_0.type === MessageTypes.CUSTOM_GIFT;
L42: {
if (canBeAccepted) {
const r188 = r123 ? intl.string(t.TiZFqX) : intl.string(t.bUvv1f);
acceptLabelBackgroundColor = acceptBlurpleLabelBackgroundColor;
acceptLabelColor = acceptLabelGreenColor;
acceptLabelText = r188;
} else if (isAccepting) {
acceptLabelText = intl.string(t.rTeOBK);
acceptLabelBackgroundColor = acceptLabelDisabledBackgroundColor;
acceptLabelColor = acceptLabelDisabledColor;
} else {
if (!r12.redeemed && !r12.isClaimed) {
const verified = currentUser?.verified;
acceptLabelColor = void 0;
acceptLabelBackgroundColor = void 0;
acceptLabelText = void 0;
if (verified) {
break L42;
}
acceptLabelText = intl.string(t.v740sh);
acceptLabelBackgroundColor = processColorOrThrow(Module712.unsafe_rawColors.BRAND_500);
acceptLabelColor = processColorOrThrow(Module712.unsafe_rawColors.WHITE);
break L42;
}
acceptLabelText = intl.string(t.BTihou);
acceptLabelBackgroundColor = acceptLabelDisabledBackgroundColor;
acceptLabelColor = acceptLabelDisabledColor;
}
}
L71: {
const skuId = r12.skuId;
if (PremiumSubscriptionSKUs.TIER_0 === skuId) {
const assetUriForEmbed5 = getAssetUriForEmbed(r123 ? getGiftStyleUrl(r12.giftStyle) : Module12345);
r220 = getAssetUriForEmbed(_shared.isThemeDark(a1) ? Module12346 : Module12347);
r221 = assetUriForEmbed5;
} else if (PremiumSubscriptionSKUs.TIER_1 === skuId) {
const assetUriForEmbed4 = getAssetUriForEmbed(r123 ? getGiftStyleUrl(r12.giftStyle) : Module12348);
r220 = getAssetUriForEmbed(_shared.isThemeDark(a1) ? Module12346 : Module12347);
r221 = assetUriForEmbed4;
} else {
if (PremiumSubscriptionSKUs.TIER_2 !== skuId && PremiumSubscriptionSKUs.LEGACY !== skuId) {
const assetUriForEmbed = getAssetUriForEmbed(_shared.isThemeDark(a1) ? Module12346 : Module12347);
const assetUriForEmbed2 = getAssetUriForEmbed(getGiftStyleUrl(r12.giftStyle));
r220 = assetUriForEmbed;
r221 = assetUriForEmbed2;
break L71;
}
const assetUriForEmbed3 = getAssetUriForEmbed(r123 ? getGiftStyleUrl(r12.giftStyle) : Module12349);
r220 = getAssetUriForEmbed(_shared.isThemeDark(a1) ? Module12346 : Module12347);
r221 = assetUriForEmbed3;
}
}
const isGameItemSKU = _SlayerStorefrontUtils.isGameItemSKU(r27);
let r308 = r221;
if (isGameItemSKU) {
const gameItemThumbnailUrl = getGameItemThumbnailUrl(r27);
let r314 = gameItemThumbnailUrl == null ? void 0 : gameItemThumbnailUrl.toString();
if (r314 == null) {
r314 = r221;
}
r308 = r314;
}
if (c16195_0.type === MessageTypes.CUSTOM_GIFT && !r6) {
const t1SOId = t.t1SOId;
let recipientDisplayName = UserUtils.getName(currentUser);
if (recipientDisplayName == null) {
recipientDisplayName = "";
}
headerText = intl.formatToPlainString(t1SOId, {
recipientDisplayName
}).toUpperCase();
} else {
headerText = (r6 ? intl.string(t.QLEMld) : intl.string(t.W4DBcy)).toUpperCase();
}
const r351 = r12 != null;
let titleText = void 0;
if (r351) {
if (c16195_0.type !== MessageTypes.CUSTOM_GIFT) {
titleText = r27 != null ? r27.name : void 0;
} else {
const user = UserStore.getUser(r12.userId);
const DDO4Wz = t.DDO4Wz;
let sender = UserUtils.getName(user);
if (sender == null) {
sender = "";
}
titleText = intl.formatToPlainString(DDO4Wz, {
sender
});
}
}
return {
...c16195_13,
headerText,
titleText,
subtitle,
bodyText,
headerColor,
titleColor,
subtitleColor,
bodyTextColor,
acceptLabelBackgroundColor,
acceptLabelColor,
acceptLabelText,
acceptLabelBorderColor: void 0,
canBeAccepted,
embedCanBeTapped: true,
giftCode: a0,
thumbnailUrl: r308 ?? void 0,
splashUrl: c16195_0.type !== MessageTypes.CUSTOM_GIFT ? r220 ?? void 0 : void 0,
splashHasRadialGradient: !PremiumUtils.isPremiumSku(r12.skuId),
splashOpacity: PremiumUtils.isPremiumSku(r12.skuId) ? 0.8 : 0.97
};
}
return {
headerText: intl.string(t["E+va0m"]).toUpperCase(),
headerColor,
resolvingGradientStart,
resolvingGradientEnd,
...c16195_13
};
}
});
}
}
@@ -0,0 +1,74 @@
// Metro module 7852 (f7853).
import PremiumGiftingIntentStore from "../../../../../premium/gifting/PremiumGiftingIntentStore";
import UserStore from "../../../../../../stores/UserStore";
import { GiftIntentType } from "../../../../../premium/PremiumConstants";
import { createNativeStyleProperties } from "../../../../../../design/components/Styles/native/createStyles";
import Module712 from "../../../../../../_bundle/Module712";
import { intl, t } from "../../../../../../intl/index.native";
import { unhandledGiftIntent } from "../../../../../premium/PremiumGiftingUtils";
import UserUtils from "../../../../../../utils/UserUtils";
import { getAssetUriForEmbed } from "../../EmbedUtils";
import Module4126 from "../../../../../../_bundle/Module4126";
import Module7858 from "../../../../../../_bundle/Module7858";
import Module7859 from "../../../../../../_bundle/Module7859";
const nativeStyleProperties = createNativeStyleProperties({
headerTextColor: Module712.colors.TEXT_STRONG,
subHeaderTextColor: Module712.colors.TEXT_SUBTLE,
backgroundColor: Module712.colors.BACKGROUND_BASE_LOWEST,
borderColor: Module712.colors.BORDER_MUTED
});
export function createGiftIntentEmbed({ giftingPrompt }, a1) {
let r29;
if (giftingPrompt == null) {
return null;
}
const { giftIntentType, recipientUserId } = giftingPrompt;
const user = UserStore.getUser(recipientUserId);
if (user == null) {
return null;
}
const name = UserUtils.getName(user);
const friendAnniversaryYears = PremiumGiftingIntentStore.getFriendAnniversaryYears(recipientUserId);
if (GiftIntentType.FRIEND_ANNIVERSARY === giftIntentType) {
r29 = {
headerText: intl.string(t.CeQIwZ),
subHeaderParts: [{
text: intl.formatToPlainString(t.PpG27s, {
numberOfYears: friendAnniversaryYears
})
}]
};
} else {
const UNSPECIFIED = GiftIntentType.UNSPECIFIED;
r29 = null;
if (UNSPECIFIED !== giftIntentType) {
unhandledGiftIntent(giftIntentType);
r29 = null;
}
}
if (r29 == null) {
return null;
}
const currentUser = UserStore.getCurrentUser();
const recipientAvatarUrl = `${user.getAvatarURL(void 0, 40)}`;
const currentUserAvatarUrl = currentUser != null ? `${currentUser.getAvatarURL(void 0, 40)}` : void 0;
const r69 = nativeStyleProperties(a1);
return {
recipientAvatarUrl,
currentUserAvatarUrl,
recipientName: name,
headerText: r29.headerText,
subHeaderParts: r29.subHeaderParts,
recipientUserId,
giftIntentType,
headerTextColor: r69.headerTextColor,
subHeaderTextColor: r69.subHeaderTextColor,
backgroundColor: r69.backgroundColor,
borderColor: r69.borderColor,
subHeaderIconUrl: getAssetUriForEmbed(Module4126),
primaryCtaLabel: intl.string(t.ilhtIa),
primaryCtaIconUrl: getAssetUriForEmbed(Module7858),
secondaryCtaIconUrl: getAssetUriForEmbed(Module7859),
secondaryCtaAccessibilityLabel: intl.string(t.I5gL2H)
};
}
@@ -0,0 +1,25 @@
// Metro module 12386 (f12387).
import { MessageEmbedTypes } from "../../../../../../Constants";
import createMediaPostPreviewEmbedContent from "../../../../../media_channel/native/createMediaPostPreviewEmbedContent";
export function createPostPreviewEmbeds(a0, c19818_1) {
let r5 = arguments[2];
if (r5 === void 0) {
r5 = false;
}
let c19818_2 = r5;
const r6 = [];
let c19818_3 = r6;
const embeds = a0.embeds;
if (embeds != null) {
embeds.forEach((embed) => {
if (embed.type === MessageEmbedTypes.POST_PREVIEW) {
const mediaPostPreviewEmbedContent = createMediaPostPreviewEmbedContent(a0, c19818_1, embed.url, c19818_2);
if (mediaPostPreviewEmbedContent == null) {
return void 0;
}
c19818_3.push(mediaPostPreviewEmbedContent);
}
});
}
return r6;
}
@@ -0,0 +1,53 @@
// Metro module 7829 (f7830).
import { HELP_CENTER_LINK, PremiumGroupInviteState } from "../../../../../premium/premium_group/PremiumGroupConstants";
import { createNativeStyleProperties } from "../../../../../../design/components/Styles/native/createStyles";
import Module712 from "../../../../../../_bundle/Module712";
import { getAssetUriForEmbed } from "../../EmbedUtils";
import Module7830 from "../../../../../../_bundle/Module7830";
import { getPremiumGroupInviteEmbedText } from "../../../../../premium/premium_group/PremiumGroupUtils.native";
import { intl, t } from "../../../../../../intl/index.native";
import PremiumGroup_messages from "../../../../../premium/premium_group/PremiumGroup.messages";
export function createPremiumGroupInviteEmbed(a0, a1, a2, a3) {
if (a0.author != null) {
const r47 = createNativeStyleProperties({
headerTextColor: Module712.colors.MOBILE_TEXT_HEADING_PRIMARY,
bodyTextColor: Module712.colors.TEXT_DEFAULT,
linkTextColor: Module712.colors.TEXT_LINK,
backgroundColor: Module712.colors.BACKGROUND_MOD_NORMAL,
betaPillTextColor: Module712.colors.BLACK,
betaPillBackgroundColor: Module712.colors.WHITE
})(a1);
const { headerTextColor, bodyTextColor, linkTextColor, backgroundColor, betaPillTextColor, betaPillBackgroundColor } = r47;
const assetUriForEmbed = getAssetUriForEmbed(Module7830);
const author = a0.author;
const premiumGroupInviteEmbedText = getPremiumGroupInviteEmbedText({
sender: author,
channel: a3,
isSender: a2 === author.id,
inviteState: PremiumGroupInviteState.UNKNOWN
});
if (premiumGroupInviteEmbedText != null) {
const { header, body } = premiumGroupInviteEmbedText;
const learnMoreLink = intl.formatToParts(PremiumGroup_messages["9VTnfI"], {
learnMoreLinkOnClick: {
action: "bindOpenUrl",
url: HELP_CENTER_LINK,
linkColor: linkTextColor
}
});
return {
headerText: header,
headerColor: headerTextColor,
backgroundColor,
borderColor: backgroundColor,
headerImageUrl: assetUriForEmbed,
betaPillText: intl.string(t.oW0eUd).toUpperCase(),
betaPillTextColor,
betaPillBackgroundColor,
bodyText: body,
bodyTextColor,
learnMoreLink
};
}
}
}
@@ -0,0 +1,154 @@
// Metro module 7843 (f7844).
import ChannelStore from "../../../../../../stores/ChannelStore";
import UserStore from "../../../../../../stores/UserStore";
import SubscriptionStore from "../../../../../../stores/billing/SubscriptionStore";
import UserOfferStore from "../../../../../../stores/billing/UserOfferStore";
import IAPStore_android from "../../../../../../stores/native/IAPStore.android";
import { HelpdeskArticles } from "../../../../../../Constants";
import { PREMIUM_TIER_2_REFERRAL_TRIAL_ID } from "../../../../../premium/PremiumConstants";
import { createNativeStyleProperties } from "../../../../../../design/components/Styles/native/createStyles";
import Module712 from "../../../../../../_bundle/Module712";
import { TrialIdToProductOfferId } from "../../../../../premium/native/ProductIds.android";
import { getAssetUriForEmbed } from "../../EmbedUtils";
import Module6313 from "../../../../../../_bundle/Module6313";
import { intl, t } from "../../../../../../intl/index.native";
import Module7844 from "../../../../../../_bundle/Module7844";
import UserUtils from "../../../../../../utils/UserUtils";
import PremiumUtils, { formatIntervalDuration } from "../../../../../../utils/PremiumUtils";
import * as _useTrialOffer from "../../../../../premium/useTrialOffer";
import { getReferralTrialOfferExpirationCopy } from "../../../../../premium/referral_program/ReferralProgramUtils";
import HelpdeskUtils from "../../../../../../utils/HelpdeskUtils";
import { isMetaQuest } from "../../../../../device/MetaQuestUtils.android";
import Module6628 from "../../../../../../_bundle/Module6628";
export function createReferralTrialEmbedRedeemable(a0, a1, a2, a3) {
let r188, bodyText, structuredBodyText;
if (a0.author != null) {
const r65 = createNativeStyleProperties({
headerTextColor: Module712.colors.WHITE,
titleColor: Module712.colors.MOBILE_TEXT_HEADING_PRIMARY,
bodyTextColor: Module712.colors.TEXT_DEFAULT,
footerTextColor: Module712.colors.TEXT_MUTED,
subTextColor: Module712.colors.INTERACTIVE_TEXT_DEFAULT,
backgroundColor: Module712.colors.BACKGROUND_MOD_NORMAL,
acceptLabelColor: Module712.colors.WHITE
})(a1);
const { headerTextColor, titleColor, bodyTextColor, footerTextColor, subTextColor, acceptLabelColor, backgroundColor } = r65;
const channel = ChannelStore.getChannel(a0.getChannelId());
if (channel != null && channel.isDM()) {
const r75 = {
backgroundColor,
borderColor: backgroundColor,
thumbnailCornerRadius: 3,
headerLogoUrl: getAssetUriForEmbed(Module6313),
headerText: intl.string(t.gtNqJQ).toLocaleLowerCase(),
headerColor: headerTextColor,
thumbnailUrl: getAssetUriForEmbed(Module7844)
};
const user = UserStore.getUser(a3?.user_id);
const user2 = UserStore.getUser(a3?.referrer_id);
if (user != null && user2 != null) {
const name2 = UserUtils.getName(user2);
const id = user2.id;
const name = UserUtils.getName(user);
const titleText = intl.formatToPlainString(t.IiWKwg, {
senderUserName: name2,
recipientUserName: name
});
if (a3 == null) {
return {
...r75,
titleText,
titleColor,
bodyText: intl.string(t.eEz1N5),
bodyTextColor,
canBeAccepted: false
};
}
const userTrialOffer = UserOfferStore.getUserTrialOffer(PREMIUM_TIER_2_REFERRAL_TRIAL_ID);
const offerIds = IAPStore_android.getOfferIds();
const r138 = Object.values(TrialIdToProductOfferId[PREMIUM_TIER_2_REFERRAL_TRIAL_ID]).every((item) => offerIds.has(item));
const r142 = a3.id === userTrialOffer?.id && r138;
const isPremium = PremiumUtils.isPremium(user);
const r148 = isPremium ? isPremium : user.id === a2 ? SubscriptionStore.getPremiumTypeSubscription() != null : isPremium;
const hasUserTrialOfferExpired = _useTrialOffer.hasUserTrialOfferExpired(a3);
const r158 = a3.redeemed_at != null;
const r160 = a3.expires_at == null || hasUserTrialOfferExpired || r148 || r158;
let footerText = void 0;
let subText = void 0;
if (!r160) {
const referralTrialOfferExpirationCopy = getReferralTrialOfferExpirationCopy(Date.parse(a3.expires_at));
footerText = intl.formatToPlainString(t.uj94C5, {
duration: formatIntervalDuration({
intervalType: a3.subscription_trial?.interval,
intervalCount: a3.subscription_trial?.interval_count
})
}).replace(/\*/g, "");
subText = referralTrialOfferExpirationCopy;
}
L48: {
r188 = id === a2;
if (r148 && (!r188 && !r158)) {
structuredBodyText = intl.formatToParts(t.LwCwT9, {
helpdeskArticle: {
action: "bindOpenUrl",
url: HelpdeskUtils.getArticleURL(HelpdeskArticles.REFERRAL_PROGRAM)
}
});
bodyText = void 0;
} else if (r148) {
bodyText = intl.formatToPlainString(t["Mptau/"], {
username: name
});
structuredBodyText = void 0;
} else {
if (hasUserTrialOfferExpired && !r158) {
bodyText = intl.string(t["9SNdf4"]);
structuredBodyText = void 0;
break L48;
}
structuredBodyText = !r142 && (!r158 && !r188) ? intl.formatToParts(isMetaQuest() ? t.yqX4Dr : t["7O7Zg3"], {
helpdeskArticle: {
action: "bindOpenUrl",
url: HelpdeskUtils.getArticleURL(HelpdeskArticles.REFERRAL_PROGRAM)
}
}) : intl.formatToParts(t.mVzEG8, {
helpdeskArticle: {
action: "bindOpenUrl",
url: HelpdeskUtils.getArticleURL(HelpdeskArticles.REFERRAL_PROGRAM)
},
username: name2
});
bodyText = void 0;
}
}
const canBeAccepted = (hasUserTrialOfferExpired ? !hasUserTrialOfferExpired : !r148) && r142 && !r188;
const r262 = {
...r75,
titleText,
titleColor,
bodyText,
structuredBodyText,
bodyTextColor,
subText,
subTextColor,
canBeAccepted
};
return canBeAccepted ? {
...r262,
footerText,
footerTextColor,
canBeAccepted,
acceptLabelText: intl.string(t.bXTClc),
acceptLabelColor,
acceptLabelIconUrl: getAssetUriForEmbed(Module6628)
} : r262;
}
return {
...r75,
bodyText: intl.string(t.eEz1N5),
bodyTextColor,
canBeAccepted: false
};
}
}
}
@@ -0,0 +1,165 @@
// Metro module 7834 (f7835).
import ChannelStore from "../../../../../../stores/ChannelStore";
import UserStore from "../../../../../../stores/UserStore";
import SubscriptionStore from "../../../../../../stores/billing/SubscriptionStore";
import UserOfferStore from "../../../../../../stores/billing/UserOfferStore";
import IAPStore_android from "../../../../../../stores/native/IAPStore.android";
import { HelpdeskArticles } from "../../../../../../Constants";
import { PREMIUM_TIER_2_REFERRAL_TRIAL_ID } from "../../../../../premium/PremiumConstants";
import { createNativeStyleProperties } from "../../../../../../design/components/Styles/native/createStyles";
import Module712 from "../../../../../../_bundle/Module712";
import { TrialIdToProductOfferId } from "../../../../../premium/native/ProductIds.android";
import Module7835 from "../../../../../../_bundle/Module7835";
import { intl, t } from "../../../../../../intl/index.native";
import UserUtils from "../../../../../../utils/UserUtils";
import HelpdeskUtils from "../../../../../../utils/HelpdeskUtils";
import PremiumUtils, { formatIntervalDuration } from "../../../../../../utils/PremiumUtils";
import * as _useTrialOffer from "../../../../../premium/useTrialOffer";
import { getReferralTrialOfferExpirationCopy } from "../../../../../premium/referral_program/ReferralProgramUtils";
import { isMetaQuest } from "../../../../../device/MetaQuestUtils.android";
import { getAssetUriForEmbed } from "../../EmbedUtils";
import Module6628 from "../../../../../../_bundle/Module6628";
export function createReferralTrialEmbedRedesign(a0, a1, a2, a3) {
let r203, bodyText, structuredBodyText;
if (a0.author != null) {
const r12 = createNativeStyleProperties({
titleColor: Module712.colors.TEXT_DEFAULT,
headerTextColor: Module712.colors.MOBILE_TEXT_HEADING_PRIMARY,
bodyTextColor: Module712.colors.TEXT_SUBTLE,
footerTextColor: Module712.colors.TEXT_MUTED,
subTextColor: Module712.colors.TEXT_SUBTLE,
backgroundColor: Module712.colors.BACKGROUND_MOD_NORMAL,
acceptLabelColor: Module712.colors.WHITE,
linkTextColor: Module712.colors.TEXT_LINK
})(a1);
const { titleColor, headerTextColor, bodyTextColor, footerTextColor, subTextColor, acceptLabelColor, backgroundColor, linkTextColor } = r12;
const channel = ChannelStore.getChannel(a0.getChannelId());
if (channel != null && channel.isDM()) {
const user = UserStore.getUser(a3?.user_id);
const user2 = UserStore.getUser(a3?.referrer_id);
if (user != null && user2 != null) {
const name = UserUtils.getName(user2);
const id = user2.id;
const titleText = intl.formatToPlainString(t.yisueA, {
sender: name,
helpdeskArticle: HelpdeskUtils.getArticleURL(HelpdeskArticles.REFERRAL_PROGRAM)
});
const learnMoreLink = intl.formatToParts(t.yisueA, {
sender: name,
helpdeskArticle: {
action: "bindOpenUrl",
url: HelpdeskUtils.getArticleURL(HelpdeskArticles.REFERRAL_PROGRAM),
linkColor: linkTextColor
}
});
const r117 = {
titleText,
titleColor,
headerImageUrl: Module7835,
headerText: intl.string(t.HtTvXA),
headerColor: headerTextColor,
backgroundColor,
borderColor: backgroundColor,
learnMoreLink
};
if (a3 == null) {
return {
...r117,
bodyText: intl.string(t.eEz1N5),
bodyTextColor,
canBeAccepted: false
};
}
const userTrialOffer = UserOfferStore.getUserTrialOffer(PREMIUM_TIER_2_REFERRAL_TRIAL_ID);
const offerIds = IAPStore_android.getOfferIds();
const r147 = Object.values(TrialIdToProductOfferId[PREMIUM_TIER_2_REFERRAL_TRIAL_ID]).every((item) => offerIds.has(item));
const r151 = a3.id === userTrialOffer?.id && r147;
const isPremium = PremiumUtils.isPremium(user);
const r157 = isPremium ? isPremium : user.id === a2 ? SubscriptionStore.getPremiumTypeSubscription() != null : isPremium;
const hasUserTrialOfferExpired = _useTrialOffer.hasUserTrialOfferExpired(a3);
const name2 = UserUtils.getName(user);
const r171 = a3.redeemed_at != null;
const r173 = a3.expires_at == null || hasUserTrialOfferExpired || r157 || r171;
let footerText = void 0;
let subText = void 0;
if (!r173) {
const referralTrialOfferExpirationCopy = getReferralTrialOfferExpirationCopy(Date.parse(a3.expires_at));
footerText = intl.formatToPlainString(t.uj94C5, {
duration: formatIntervalDuration({
intervalType: a3.subscription_trial?.interval,
intervalCount: a3.subscription_trial?.interval_count
})
}).replace(/\*/g, "");
subText = referralTrialOfferExpirationCopy;
}
L48: {
r203 = id === a2;
if (r157 && (!r203 && !r171)) {
structuredBodyText = intl.formatToParts(t.LwCwT9, {
helpdeskArticle: {
action: "bindOpenUrl",
url: HelpdeskUtils.getArticleURL(HelpdeskArticles.REFERRAL_PROGRAM)
}
});
bodyText = void 0;
} else if (r157) {
bodyText = intl.formatToPlainString(t["Mptau/"], {
username: name2
});
structuredBodyText = void 0;
} else {
if (hasUserTrialOfferExpired && !r171) {
bodyText = intl.string(t["9SNdf4"]);
structuredBodyText = void 0;
break L48;
}
structuredBodyText = !r151 && (!r171 && !r203) ? intl.formatToParts(isMetaQuest() ? t.yqX4Dr : t["7O7Zg3"], {
helpdeskArticle: {
action: "bindOpenUrl",
url: HelpdeskUtils.getArticleURL(HelpdeskArticles.REFERRAL_PROGRAM)
}
}) : intl.formatToParts(t.mVzEG8, {
helpdeskArticle: {
action: "bindOpenUrl",
url: HelpdeskUtils.getArticleURL(HelpdeskArticles.REFERRAL_PROGRAM)
},
username: name
});
bodyText = void 0;
}
}
const canBeAccepted = (hasUserTrialOfferExpired ? !hasUserTrialOfferExpired : !r157) && r151 && !r203;
const r274 = {
...r117,
bodyText,
structuredBodyText,
bodyTextColor,
subText,
subTextColor,
canBeAccepted
};
return canBeAccepted ? {
...r274,
footerText,
footerTextColor,
canBeAccepted,
acceptLabelText: intl.string(t.bXTClc),
acceptLabelColor,
acceptLabelIconUrl: getAssetUriForEmbed(Module6628)
} : r274;
}
return {
titleText: "",
titleColor,
headerImageUrl: Module7835,
headerText: "",
headerColor: headerTextColor,
backgroundColor,
borderColor: backgroundColor,
bodyText: intl.string(t.eEz1N5),
bodyTextColor,
canBeAccepted: false
};
}
}
}
@@ -0,0 +1,44 @@
// Metro module 12389 (f12390).
import { Image as Image2 } from "react-native";
import { MessageEmbedTypes } from "../../../../../../Constants";
import { SafetyHubPolicyNoticeKeys } from "../../../../../safety_hub/SafetyHubConstants";
import Module3771 from "../../../../../../_bundle/Module3771";
import { intl, t } from "../../../../../../intl/index.native";
import { getAssetUriForEmbed } from "../../EmbedUtils";
import Module7630 from "../../../../../../_bundle/Module7630";
export function createSafetyPolicyNoticeEmbed(a0) {
if (a0.embeds != null) {
if (a0.embeds[0]?.fields != null) {
if (a0.embeds[0]?.type === MessageEmbedTypes.SAFETY_POLICY_NOTICE) {
const r25 = a0.embeds[0];
const fields = r25.fields;
let r27 = fields == null ? void 0 : fields.find((field) => field.rawName === SafetyHubPolicyNoticeKeys.CLASSIFICATION_ID);
if (r27 == null) {
r27 = void 0;
}
let classificationId = r27?.rawValue;
if (classificationId == null) {
classificationId = void 0;
}
const fields2 = r25.fields;
let r33 = fields2 == null ? void 0 : fields2.find((item) => item.rawName === SafetyHubPolicyNoticeKeys.INCIDENT_TIMESTAMP);
if (r33 == null) {
r33 = void 0;
}
const r15 = r33 == null ? void 0 : r33.rawValue == null ? void 0 : parseFloat(r33.rawValue);
if (classificationId != null && r15 != null) {
return {
titleText: intl.string(t["4CxGXi"]),
titleIcon: getAssetUriForEmbed(Image2.resolveAssetSource(Module7630)),
subtitleText: intl.formatToPlainString(t.eevFb6, {
daysAgo: Module3771().diff(Module3771.unix(r15), "days")
}),
descriptionText: intl.string(t["5CLb0A"]),
ctaText: intl.string(t.zKnzwm),
classificationId
};
}
}
}
}
}
@@ -0,0 +1,66 @@
// Metro module 12390 (f12391).
import { Image as Image2 } from "react-native";
import { MessageEmbedTypes } from "../../../../../../Constants";
import Module3771 from "../../../../../../_bundle/Module3771";
import Module7630 from "../../../../../../_bundle/Module7630";
import Module4657 from "../../../../../../_bundle/Module4657";
import { parseMessageForProps, mapCtaToNativeData } from "../../../../../safety_hub/SafetyHubUtils";
import { getAssetUriForEmbed } from "../../EmbedUtils";
import { t, intl } from "../../../../../../intl/index.native";
export function createSafetySystemNotificationEmbed(a0) {
if (a0 != null && a0.embeds != null) {
if (a0.embeds[0]?.fields != null) {
if (a0.embeds[0]?.type === MessageEmbedTypes.SAFETY_SYSTEM_NOTIFICATION) {
const r28 = parseMessageForProps(a0);
if (r28 != null) {
const r31 = r28.ctas != null;
let r32 = void 0;
let r8 = void 0;
if (r31) {
const r36 = r28.ctas[0] != null ? mapCtaToNativeData(r28.ctas[0], r28.learn_more_link, r28.classification_id) : void 0;
r32 = r28.ctas[1] != null ? mapCtaToNativeData(r28.ctas[1], r28.learn_more_link, r28.classification_id) : void 0;
r8 = r36;
}
let header = r28.header;
if (header == null) {
header = "";
}
const r50 = {
titleText: header,
titleIcon: getAssetUriForEmbed(Image2.resolveAssetSource(r28.icon === "danger" ? Module7630 : Module4657)),
subtitleText: null,
descriptionText: null,
primaryCtaText: null,
primaryCtaType: null,
primaryCtaKey: null,
secondaryCtaText: null,
secondaryCtaType: null,
secondaryCtaKey: null,
footerTheme: null
};
const eevFb6 = t.eevFb6;
let timestamp = r28.timestamp;
if (timestamp == null) {
timestamp = 0;
}
r50.subtitleText = intl.formatToPlainString(eevFb6, {
daysAgo: Module3771().diff(Module3771.unix(timestamp), "days")
});
let body = r28.body;
if (body == null) {
body = "";
}
r50.descriptionText = body;
r50.primaryCtaText = r8?.text;
r50.primaryCtaType = r8?.type;
r50.primaryCtaKey = r8?.key;
r50.secondaryCtaText = r32?.text;
r50.secondaryCtaType = r32?.type;
r50.secondaryCtaKey = r32?.key;
r50.footerTheme = r28.theme;
return r50;
}
}
}
}
}
@@ -0,0 +1,82 @@
// Metro module 12364 (f12365).
import { Image as Image2 } from "react-native";
import BuildOverrideStore, { State } from "../../../../../../build_overrides/BuildOverrideStore";
import { InviteTypes } from "../../../../../../instant_invite/Constants";
import getEmbedThemeColors from "../getEmbedThemeColors";
import { DEVICE_FIELD } from "../../../../../../build_overrides/native/BuildOverrideUtils";
import validateBuildOverride from "../../../../../../build_overrides/validateBuildOverride";
import { getConstants } from "../../../../../../../utils/native/ClientInfoUtils";
import { intl, t } from "../../../../../../../intl/index.native";
import { processColorOrThrow } from "../../../RowGeneratorStyleSheet";
import Module712 from "../../../../../../../_bundle/Module712";
import { isThemeDark } from "../../../../../../../design/shared";
import Module10994 from "../../../../../../../_bundle/Module10994";
import Module10995 from "../../../../../../../_bundle/Module10995";
import Module12363 from "../../../../../../../_bundle/Module12363";
export function createBuildOverrideEmbed(a0, a1) {
let r61;
const embedThemeColors = getEmbedThemeColors(a1);
const { colors, baseColors } = embedThemeColors;
const currentBuildOverride = BuildOverrideStore.getCurrentBuildOverride();
const buildOverride = BuildOverrideStore.getBuildOverride(a0);
if (buildOverride.state === State.Resolving) {
return {
headerText: "RESOLVING",
resolvingGradientEnd: colors.resolvingGradientEnd,
resolvingGradientStart: colors.resolvingGradientStart,
type: InviteTypes.GUILD,
...baseColors
};
}
const override = buildOverride.override;
const r1 = override == null;
let subtitle = void 0;
if (!r1) {
const targetBuildOverride = override.targetBuildOverride;
subtitle = targetBuildOverride == null ? void 0 : targetBuildOverride[DEVICE_FIELD]?.id;
}
let r36 = subtitle != null;
if (r36) {
const overrides = currentBuildOverride.overrides;
r36 = subtitle === (overrides == null ? void 0 : overrides[DEVICE_FIELD]?.id);
}
const r54 = validateBuildOverride(buildOverride.override, ["discord_ios", "discord_android"], getConstants().Version);
if (currentBuildOverride.state !== State.Invalid && (buildOverride.state !== State.Invalid && (buildOverride.override != null && (subtitle != null && r54.valid)))) {
const r109 = {
...baseColors,
headerText: intl.string(t.Wj3LW4).toLocaleUpperCase(),
headerColor: colors.headerColor
};
const override2 = buildOverride.override;
const r131 = override2 == null;
let r132 = void 0;
if (!r131) {
const targetBuildOverride2 = override2.targetBuildOverride;
r132 = targetBuildOverride2 == null ? void 0 : targetBuildOverride2[DEVICE_FIELD]?.type;
}
r109.titleText = intl.string(r132 === "branch" ? t.p9TwTG : t.RCYGot);
r109.titleColor = colors.titleColor;
r109.subtitle = subtitle;
r109.subtitleColor = colors.subtitleColor;
r109.thumbnailUrl = Image2.resolveAssetSource(Module12363).uri;
r109.acceptButtonVariant = r36 ? "destructive" : "primary";
r109.acceptLabelText = r36 ? intl.string(t.tX4xrt) : intl.string(t.nOunHC);
r109.embedCanBeTapped = true;
r109.canBeAccepted = true;
r109.type = InviteTypes.GUILD;
r61 = r109;
} else {
r61 = {
...baseColors,
headerText: intl.string(t.d34xi4).toLocaleUpperCase(),
titleColor: processColorOrThrow(Module712.unsafe_rawColors.RED_400),
titleText: r54.valid ? intl.string(t.ODXApH) : r54.reason,
subtitle,
subtitleColor: subtitle != null ? colors.subtitleColor : void 0,
thumbnailUrl: Image2.resolveAssetSource(isThemeDark(a1) ? Module10994 : Module10995).uri,
thumbnailBackgroundColor: colors.thumbnailBackgroundColor,
type: InviteTypes.GUILD
};
}
return r61;
}
@@ -0,0 +1,152 @@
// Metro module 12350 (f12351).
import _slicedToArray from "../../../../../../../_bundle/_slicedToArray";
import LurkingStore from "../../../../../../lurker_mode/LurkingStore";
import GuildStore from "../../../../../../../stores/GuildStore";
import UserStore from "../../../../../../../stores/UserStore";
import { isApplicationCodedLink, isApplicationCodedLinkMobileSupported, getApplicationCodedLinkData } from "../../../../../../coded_links/ApplicationCodedLink";
import { getAppLinkGateResult, createAppMessageEmbed } from "../../../../../../applications/message_embed/native/createAppMessageEmbed";
import { CodedLinkType } from "../../../../../../coded_links/CodedLink";
import { createActivityMessageEmbed } from "../../../../../../applications/message_embed/native/createActivityMessageEmbed";
import { createInviteEmbed } from "./InviteEmbed";
import { createGuildTemplateEmbed } from "./GuildTemplateEmbed";
import { createBuildOverrideEmbed } from "./BuildOverrideEmbed";
import { createGuildScheduledEventLinkEmbed } from "./GuildScheduledEventEmbed";
import { createVoiceChannelLinkEmbed } from "./VoiceChannelLinkEmbed";
import { createEmbeddedActivityInviteEmbed } from "./EmbeddedActivityInviteEmbed";
import { canSeeExperimentEmbeds } from "../../../../../../experiments/client_override_hooks/useCodedLinksExperimentEmbeds";
import { createExperimentEmbed } from "./ExperimentEmbed";
import { getIsEligibleForSocialLayerStorefrontMobilePurchasing } from "../../../../../../slayer_storefront/experiments/SocialLayerStorefrontMobilePurchasingExperiment";
import { createSocialLayerStorefrontProductDetailsEmbed } from "../../../../../../slayer_storefront/native/createSocialLayerStorefrontProductDetailsEmbed";
import { createQuestsEmbed } from "../../../../../../quests/native/QuestEmbed.native";
import { assertNever } from "../../../../../../../utils/GlobalUtils";
export function createCodedLinkEmbeds(a0, a1, channel, theme) {
let currentUser;
const message = a0;
if (a0.author != null && a1.codedLinks.length !== 0) {
currentUser = UserStore.getCurrentUser();
return a1.codedLinks.map(({ type, code, url }) => {
if (isApplicationCodedLink(type)) {
if (channel == null) {
return null;
}
if (isApplicationCodedLinkMobileSupported(type)) {
const applicationCodedLinkData = getApplicationCodedLinkData(type, code, url);
if (applicationCodedLinkData == null) {
return null;
}
const appLinkGateResult = getAppLinkGateResult({
appId: applicationCodedLinkData.applicationId,
channel,
message,
theme
});
if (appLinkGateResult.state === "unavailable") {
return null;
}
if (appLinkGateResult.state === "blocked") {
return appLinkGateResult.model;
}
const app = appLinkGateResult.app;
const type2 = applicationCodedLinkData.type;
if (CodedLinkType.ACTIVITY_BOOKMARK === type2) {
return createActivityMessageEmbed({
theme,
embedUrl: url,
message,
app,
params: applicationCodedLinkData.params
});
}
if (CodedLinkType.APP_DIRECTORY_PROFILE !== type2 && CodedLinkType.APP_OAUTH2_LINK !== type2) {
return null;
}
return createAppMessageEmbed({
theme,
embedUrl: url,
message,
app
});
}
return null;
}
if (CodedLinkType.INVITE === type) {
return createInviteEmbed(message, code, theme);
}
if (CodedLinkType.TEMPLATE === type) {
return createGuildTemplateEmbed(code, theme);
}
if (CodedLinkType.BUILD_OVERRIDE === type) {
return createBuildOverrideEmbed(code, theme);
}
if (CodedLinkType.MANUAL_BUILD_OVERRIDE === type) {
const currentUser2 = UserStore.getCurrentUser();
let r161 = currentUser2 == null ? void 0 : currentUser2.isStaff();
if (!r161) {
const currentUser3 = UserStore.getCurrentUser();
r161 = currentUser3 == null ? void 0 : currentUser3.isStaffPersonal();
}
if (!r161) {
r161 = GuildStore.getGuild("943265993613008967") != null && !LurkingStore.isLurking("943265993613008967");
}
return r161 ? createBuildOverrideEmbed(code, theme) : null;
}
if (CodedLinkType.EVENT === type) {
return createGuildScheduledEventLinkEmbed(code, theme);
}
if (CodedLinkType.CHANNEL_LINK === type) {
return createVoiceChannelLinkEmbed(code, theme);
}
if (CodedLinkType.EMBEDDED_ACTIVITY_INVITE === type) {
return createEmbeddedActivityInviteEmbed({
theme,
inviteCode: code
});
}
if (CodedLinkType.EXPERIMENT === type) {
return canSeeExperimentEmbeds() ? createExperimentEmbed(url, theme) : null;
}
if (CodedLinkType.GUILD_PRODUCT !== type && CodedLinkType.SERVER_SHOP !== type) {
if (CodedLinkType.SOCIAL_LAYER_STOREFRONT !== type && CodedLinkType.SOCIAL_LAYER_STOREFRONT_APP !== type) {
if (CodedLinkType.QUESTS_EMBED === type) {
return createQuestsEmbed({
theme,
questId: code,
currentUser
});
}
if (CodedLinkType.COLLECTIBLES_SHOP !== type && CodedLinkType.GAME_PROFILE !== type && CodedLinkType.GAME_SERVER_SHARE !== type) {
return assertNever(type);
}
return null;
}
if (getIsEligibleForSocialLayerStorefrontMobilePurchasing({
location: "create_coded_link_embeds"
})) {
if (type === CodedLinkType.SOCIAL_LAYER_STOREFRONT_APP) {
const r120 = _slicedToArray(code.split("-"), 2);
return createSocialLayerStorefrontProductDetailsEmbed({
skuId: r120[0],
guildOrApplication: {
type: "application",
applicationId: r120[1]
},
theme
});
}
const r106 = _slicedToArray(code.split("-"), 2);
return createSocialLayerStorefrontProductDetailsEmbed({
skuId: r106[0],
guildOrApplication: {
type: "guild",
guildId: r106[1]
},
theme
});
}
return null;
}
return null;
});
}
return [];
}
@@ -0,0 +1,18 @@
// Metro module 9500 (f9501).
const r9 = {
STAGE_INSTANCE: 0,
0: "STAGE_INSTANCE",
GUILD_SCHEDULED_EVENT: 1,
1: "GUILD_SCHEDULED_EVENT",
GUILD_INVITE_DISABLED: 2,
2: "GUILD_INVITE_DISABLED",
EMBEDDED_ACTIVITY_INVITE: 3,
3: "EMBEDDED_ACTIVITY_INVITE",
APP_MESSAGE_EMBED: 4,
4: "APP_MESSAGE_EMBED",
GUILD_PROFILE_INVITE: 5,
5: "GUILD_PROFILE_INVITE",
VOICE_CHANNEL_LIST_INVITE: 6,
6: "VOICE_CHANNEL_LIST_INVITE"
};
export { r9 as CodedLinkExtendedType };
@@ -0,0 +1,6 @@
// Metro module 11135 (f11136).
const r8 = {
DISPLAY: "display",
BLOCKED: "blocked"
};
export { r8 as AppMessageEmbedDisplayType };
@@ -0,0 +1,100 @@
// Metro module 12359 (f12360).
import { Image as Image2 } from "react-native";
import EmbeddedActivitiesStore from "../../../../../../activities/EmbeddedActivitiesStore";
import ApplicationAssetsStore, { FetchState } from "../../../../../../applications/ApplicationAssetsStore";
import ApplicationStore from "../../../../../../applications/ApplicationStore";
import AuthenticationStore from "../../../../../../../stores/AuthenticationStore";
import ChannelStore from "../../../../../../../stores/ChannelStore";
import InviteStore from "../../../../../../../stores/InviteStore";
import RelationshipStore from "../../../../../../../stores/RelationshipStore";
import UserStore from "../../../../../../../stores/UserStore";
import { CodedLinkExtendedType } from "./CodedLinksConstants";
import { InviteTargetTypes } from "../../../../../../instant_invite/Constants";
import Dispatcher from "../../../../../../../Dispatcher";
import { fetchAssetIds, getAssetIds, getAssetImage } from "../../../../../../../utils/ApplicationAssetUtils";
import getEmbedThemeColors from "../getEmbedThemeColors";
import { getSimpleChannelIcon } from "../../../../../../../utils/native/ChannelUtils";
import { intl, t } from "../../../../../../../intl/index.native";
import { computeChannelName } from "../../../../../../channel/useChannelName";
import { getEmbeddedActivityParticipantAvatarUris } from "./useEmbeddedActivityParticipantAvatarUris";
const _excluded = ["embedded_cover"];
export function createEmbeddedActivityInviteEmbed({ inviteCode, theme }) {
let id;
id = void 0;
const invite = InviteStore.getInvite(inviteCode);
if (invite == null) {
return null;
}
const { target_type, target_application } = invite;
if (target_type === InviteTargetTypes.EMBEDDED_APPLICATION && target_application != null) {
if (ApplicationStore.getApplication(target_application.id) == null) {
Dispatcher.dispatch({
type: "APPLICATION_UPDATE",
application: target_application
});
}
id = target_application.id;
if (ApplicationAssetsStore.getApplicationAssetFetchState(id) === FetchState.NOT_FETCHED) {
fetchAssetIds(id, _excluded);
}
const embedThemeColors = getEmbedThemeColors(theme);
const baseColors = embedThemeColors.baseColors;
const acceptLabelGreenBackgroundColor = embedThemeColors.colors.acceptLabelGreenBackgroundColor;
const name = invite.guild?.name;
const id3 = invite.channel?.id;
const id2 = invite.guild?.id;
const r26 = id3 != null ? ChannelStore.getChannel(id3) : null;
const r72 = r26 != null ? getSimpleChannelIcon(r26) : null;
const channelIcon = r72 != null ? Image2.resolveAssetSource(r72)?.uri : void 0;
let headerText = target_application?.name;
if (headerText == null) {
headerText = null;
}
const titleText = intl.string(t["1qHIZ4"]);
const structurableSubtitleText = r26 != null && name != null ? intl.formatToParts(t.omZR7L, {
channelName: computeChannelName(r26, UserStore, RelationshipStore),
guildName: name
}) : name != null ? intl.formatToParts(t.u0vaDE, {
guildName: name
}) : null;
let r114 = id3 != null;
if (r114) {
const r120 = EmbeddedActivitiesStore.getEmbeddedActivitiesForChannel(id3).find((item) => item.applicationId === id);
const r121 = r120 == null;
let r122 = void 0;
if (!r121) {
const userIds = r120.userIds;
r122 = userIds == null ? void 0 : userIds.has(AuthenticationStore.getId());
}
r114 = r122;
}
const participantAvatarUris = id3 != null && id2 != null ? getEmbeddedActivityParticipantAvatarUris({
channelId: id3,
guildId: id2,
applicationId: id
}) : [];
const r142 = intl.string(t.VJlc0S);
const acceptLabelText = participantAvatarUris.length === 0 ? intl.string(t.I0v0Qv) : r114 ? intl.string(t.KC26NR) : r142;
let r165 = getAssetIds(id, _excluded);
if (r165 == null) {
r165 = [];
}
const [r169] = r165;
return {
...baseColors,
channelIcon,
headerText,
acceptLabelBackgroundColor: acceptLabelGreenBackgroundColor,
titleText,
structurableSubtitleText,
type: null,
extendedType: CodedLinkExtendedType.EMBEDDED_ACTIVITY_INVITE,
participantAvatarUris,
acceptLabelText,
splashUrl: r169 != null ? getAssetImage(id, r169, 1024) : void 0,
noParticipantsText: intl.string(t.PZLnuD),
ctaEnabled: !r114
};
}
return null;
}
@@ -0,0 +1,171 @@
// Metro module 10993 (f10994).
import { useMemo, useCallback } from "react";
import { Image as Image2 } from "react-native";
import AuthenticationStore from "../../../../../../../stores/AuthenticationStore";
import { ExperimentEmbedType } from "../../../../../../experiments/ExperimentConstants";
import { InviteTypes } from "../../../../../../instant_invite/Constants";
import getEmbedThemeColors from "../getEmbedThemeColors";
import { getExperimentFromEmbedURL, getExperimentTreatmentFromEmbedURL, getExperimentBuckets, getExperimentServerAssignmentLabel } from "../../../../../../experiments/ExperimentEmbedUtils";
import { useLegacyExperiments, getLegacyExperiments } from "../../../../../../experiments/client_override_hooks/useLegacyExperiments";
import { useApexExperiments, getApexExperiments } from "../../../../../../experiments/client_override_hooks/useApexExperiments";
import { isThemeDark } from "../../../../../../../design/utils/shared/themes";
import Module10994 from "../../../../../../../_bundle/Module10994";
import Module10995 from "../../../../../../../_bundle/Module10995";
import { getExperimentServerAssignment } from "../../../../../../experiments/client_override_hooks/useExperimentAssignments";
import { getAssetUriForEmbed } from "../../../EmbedUtils";
import Module10997 from "../../../../../../../_bundle/Module10997";
import { getExperimentVariantsForDevTools } from "../../../../../../experiments/devtools/ExperimentDevToolsUtils";
import ActionSheetActionCreators from "../../../../../../action_sheet/native/ActionSheetActionCreators";
import { overrideBucket } from "../../../../../../experiments/ExperimentManager";
import { BottomSheet } from "../../../../../../../design/components/Sheet/native/BottomSheet.native";
import { BottomSheetTitleHeader } from "../../../../../../../design/components/Sheet/native/BottomSheetTitleHeader.native";
import { ExperimentDetails } from "../../../../../../devtools/native/components/screens/DevToolsExperimentsScreen";
import { useCanSeeExperimentEmbeds } from "../../../../../../experiments/client_override_hooks/useCodedLinksExperimentEmbeds";
const ExperimentOverrideActionSheet = function ExperimentOverrideActionSheet(props) {
const { id, experiment, override } = props;
const memo = useMemo(() => experiment != null ? getExperimentVariantsForDevTools(experiment) : [], [experiment]);
return <BottomSheet header={<BottomSheetTitleHeader title={experiment.title} subtitle={id} />}>
<ExperimentDetails experiment={experiment} override={override} id={id} options={useMemo(() => {
if (experiment == null) {
return [];
}
let c26901_1;
const map = new Map();
let c26901_0 = map;
memo.forEach((item) => {
c26901_0.set(item.id, item);
});
const r15 = [];
c26901_1 = r15;
map.forEach((item) => {
c26901_1.push({
label: item.label,
onPress: () => {
ActionSheetActionCreators.hideActionSheet("ExperimentOverrideSheet");
overrideBucket(experiment.system, id, item.id);
}
});
});
r15.push({
label: "Clear Override",
isDestructive: true,
onPress: () => {
ActionSheetActionCreators.hideActionSheet("ExperimentOverrideSheet");
overrideBucket(experiment.system, id, null);
}
});
return r15;
}, [id, experiment, memo])} onCopyLink={useCallback(() => {
ActionSheetActionCreators.hideActionSheet("ExperimentOverrideSheet");
}, [])} />
</BottomSheet>;
};
export default function ConnectedExperimentOverrideActionSheet(props) {
const id2 = props.id;
const legacyExperiments = useLegacyExperiments();
const { experiments, overridesInfo } = legacyExperiments;
const apexExperiments = useApexExperiments();
const { experiments: experiments2, overridesInfo: overridesInfo2 } = apexExperiments;
const memo2 = useMemo(() => {
let r4 = experiments[id2];
if (r4 == null) {
r4 = experiments2[id2];
}
if (r4 == null) {
r4 = null;
}
return r4;
}, [experiments, experiments2, id2]);
const memo3 = useMemo(() => {
let r4 = overridesInfo[id2];
if (r4 == null) {
r4 = overridesInfo2[id2];
}
if (r4 == null) {
r4 = null;
}
return r4;
}, [overridesInfo, overridesInfo2, id2]);
const canSeeExperimentEmbeds = useCanSeeExperimentEmbeds();
return memo2 != null ? canSeeExperimentEmbeds ? <ExperimentOverrideActionSheet id={id2} experiment={memo2} override={memo3} /> : null : null;
};
export function createExperimentEmbed(a0, a1) {
const embedThemeColors = getEmbedThemeColors(a1);
const { colors, baseColors } = embedThemeColors;
const experimentFromEmbedURL = getExperimentFromEmbedURL(a0);
const experimentTreatmentFromEmbedURL = getExperimentTreatmentFromEmbedURL(a0);
const legacyExperiments = getLegacyExperiments();
const { experiments: experiments3, overridesInfo: overridesInfo3 } = legacyExperiments;
const apexExperiments = getApexExperiments();
const { experiments: experiments4, overridesInfo: overridesInfo4 } = apexExperiments;
const r0 = experimentFromEmbedURL != null;
let r20 = null;
if (r0) {
let r41 = experiments3[experimentFromEmbedURL];
if (r41 == null) {
r41 = experiments4[experimentFromEmbedURL];
}
r20 = r41;
}
if (experimentFromEmbedURL != null && r20 != null) {
let r42 = overridesInfo3[experimentFromEmbedURL];
if (r42 == null) {
r42 = overridesInfo4[experimentFromEmbedURL];
}
if (r42 == null) {
r42 = null;
}
const r49 = getExperimentBuckets(r20).find((item) => item.value === experimentTreatmentFromEmbedURL);
const r51 = r49 != null ? ExperimentEmbedType.EXPERIMENT_TREATMENT : ExperimentEmbedType.EXPERIMENT;
const experimentServerAssignmentLabel = getExperimentServerAssignmentLabel(r20, getExperimentServerAssignment(r20, AuthenticationStore.getId()));
if (r51 === ExperimentEmbedType.EXPERIMENT_TREATMENT) {
const subtitle = r49 != null ? r49.label : `Server Config: ${experimentServerAssignmentLabel}`;
const r97 = r42 != null && r49 != null && r42.variantId === r49.value;
const r100 = {
...baseColors,
headerText: "EXPERIMENT TREATMENT",
titleText: experimentFromEmbedURL,
titleColor: colors.titleColor,
subtitle,
subtitleColor: colors.subtitleColor,
thumbnailUrl: getAssetUriForEmbed(Module10997),
thumbnailBackgroundColor: colors.backgroundColor,
acceptLabelColor: r97 ? colors.clearLabelRedColor : colors.acceptLabelGreenColor,
acceptLabelBackgroundColor: r97 ? colors.clearLabelRedBackgroundColor : colors.acceptLabelGreenBackgroundColor
};
const concat = HermesInternal.concat;
r100.acceptLabelText = r97 ? concat.call("Clear Treatment ", experimentTreatmentFromEmbedURL) : concat.call("Apply Treatment ", experimentTreatmentFromEmbedURL);
r100.embedCanBeTapped = true;
r100.type = InviteTypes.GUILD;
return r100;
}
return {
...baseColors,
headerText: "EXPERIMENT",
titleText: experimentFromEmbedURL,
titleColor: colors.titleColor,
subtitle: r42 != null ? `Client Override Applied: Treatment ${r42.variantId}` : `Server Assignment: ${experimentServerAssignmentLabel}`,
subtitleColor: colors.subtitleColor,
thumbnailUrl: getAssetUriForEmbed(Module10997),
thumbnailBackgroundColor: colors.backgroundColor,
acceptLabelColor: colors.acceptLabelGreenColor,
acceptLabelBackgroundColor: colors.acceptLabelGreenBackgroundColor,
acceptLabelText: "View Experiment Details",
embedCanBeTapped: true,
type: InviteTypes.GUILD
};
}
return {
...baseColors,
headerText: "EXPERIMENT",
titleText: experimentFromEmbedURL == null ? "Unknown Experiment" : experimentFromEmbedURL,
titleColor: colors.titleColor,
subtitle: "Unknown Experiment",
subtitleColor: colors.subtitleColor,
bodyText: "This client is missing this experiment. You may need to open the surface where the experiment is used first.",
bodyTextColor: colors.bodyTextColor,
thumbnailUrl: Image2.resolveAssetSource(isThemeDark(a1) ? Module10994 : Module10995).uri,
thumbnailBackgroundColor: colors.thumbnailBackgroundColor,
type: InviteTypes.GUILD
};
}
@@ -0,0 +1,222 @@
// Metro module 12357 (f12358).
import { processColor } from "react-native";
import GuildScheduledEventStore, { isGuildEventEnded, isGuildScheduledEventActive } from "../../../../../../guild_scheduled_events/GuildScheduledEventStore";
import { getGuildIconSource } from "../../../../../../../records/GuildRecord";
import ChannelStore from "../../../../../../../stores/ChannelStore";
import GuildStore from "../../../../../../../stores/GuildStore";
import RelationshipStore from "../../../../../../../stores/RelationshipStore";
import UserStore from "../../../../../../../stores/UserStore";
import { CodedLinkExtendedType } from "./CodedLinksConstants";
import { GuildScheduledEventEntityTypes } from "../../../../../../guild_scheduled_events/GuildScheduledEventsConstants";
import { InviteTypes } from "../../../../../../instant_invite/Constants";
import getEmbedThemeColors from "../getEmbedThemeColors";
import { getAssetUriForEmbed } from "../../../EmbedUtils";
import * as _useCanInviteForGuildEvent from "../../../../../../guild_scheduled_events/useCanInviteForGuildEvent";
import { getEventSchedule } from "../../../../../../guild_scheduled_events/useEventSchedule";
import { getEventTimeData, getNextRecurrenceIdInEvent } from "../../../../../../guild_scheduled_events/utils/ScheduleUtils";
import { getGuildScheduledEventHeaderProps } from "../../../../../../guild_scheduled_events/native/GuildScheduledEventHeaderUtils";
import { intl, t } from "../../../../../../../intl/index.native";
import Module7732 from "../../../../../../../_bundle/Module7732";
import Share from "../../../../../../icons/native/Share";
import { processColorOrThrow } from "../../../RowGeneratorStyleSheet";
import Module712 from "../../../../../../../_bundle/Module712";
import Module10356 from "../../../../../../../_bundle/Module10356";
import MarkupUtils from "../../../../../../markup/MarkupUtils";
import { getLocationFromEvent } from "../../../../../../guild_scheduled_events/utils/EntityUtils";
import { computeChannelName } from "../../../../../../channel/useChannelName";
import { getEventLocationIconSource } from "../../../../../../guild_scheduled_events/native/components/GuildEventUtils";
import GuildScheduledEventManager from "../../../../../../guild_scheduled_events/GuildScheduledEventManager";
import Module12358 from "../../../../../../../_bundle/Module12358";
import GuildScheduledEventsActionCreators from "../../../../../../guild_scheduled_events/GuildScheduledEventsActionCreators";
import { fromInviteGuild } from "../../../../../../../utils/GuildRecordUtils";
let c8531_17;
const createGuildScheduledEventEmbed = function createGuildScheduledEventEmbed({ channel, guildEvent, userCount, guild, theme, type, recurrenceId }) {
let acceptLabelBackgroundColor, acceptLabelGreenColor, acceptLabelIcon, acceptLabelText, headerTextColor, isRsvped, secondaryActionIcon;
const colors = getEmbedThemeColors(theme).colors;
const id = channel?.id;
const r9 = guild != null ? getGuildIconSource(guild, 128, false) : void 0;
const guildIcon = r9 != null ? getAssetUriForEmbed(r9) : void 0;
const isGuildEventInvitable = _useCanInviteForGuildEvent.isGuildEventInvitable(guildEvent);
const isGuildScheduledEventActive2 = isGuildScheduledEventActive(guildEvent);
const entity_type2 = guildEvent.entity_type;
const EXTERNAL = GuildScheduledEventEntityTypes.EXTERNAL;
const isInterestedInEventRecurrence = GuildScheduledEventStore.isInterestedInEventRecurrence(guildEvent.id, recurrenceId);
const { name, description, entity_type } = guildEvent;
const STAGE_INSTANCE = GuildScheduledEventEntityTypes.STAGE_INSTANCE;
const eventSchedule = getEventSchedule(guildEvent, recurrenceId);
const guildScheduledEventHeaderProps = getGuildScheduledEventHeaderProps({
eventTimeData: getEventTimeData(eventSchedule == null ? void 0 : eventSchedule.startTime.toISOString()),
isStage: entity_type === STAGE_INSTANCE,
theme,
event: guildEvent
});
const { color, icon, shouldChangeTextColor, text } = guildScheduledEventHeaderProps;
const embedCanBeTapped = guild != null;
const r31 = {
titleColor: colors.titleColor,
borderColor: colors.borderColor,
backgroundColor: colors.backgroundColor,
thumbnailCornerRadius: 15,
embedCanBeTapped
};
const r38 = intl.string(t.DlcqlU);
const assetUriForEmbed2 = getAssetUriForEmbed(Module7732);
const assetUriForEmbed = getAssetUriForEmbed(Share);
if (embedCanBeTapped) {
if (isGuildScheduledEventActive2) {
const acceptLabelActiveBackgroundColor = colors.acceptLabelActiveBackgroundColor;
const r135 = entity_type2 === EXTERNAL ? intl.string(t.GoCQxU) : intl.string(t.IaYdtW);
acceptLabelGreenColor = colors.acceptLabelGreenColor;
isRsvped = false;
acceptLabelText = r135;
secondaryActionIcon = assetUriForEmbed;
acceptLabelIcon = void 0;
acceptLabelBackgroundColor = acceptLabelActiveBackgroundColor;
} else if (isInterestedInEventRecurrence) {
acceptLabelBackgroundColor = colors.backgroundColor;
acceptLabelIcon = getAssetUriForEmbed(Module10356);
acceptLabelGreenColor = colors.acceptLabelDisabledTextColor;
secondaryActionIcon = assetUriForEmbed;
acceptLabelText = r38;
isRsvped = isInterestedInEventRecurrence;
} else {
acceptLabelBackgroundColor = colors.acceptLabelActiveBackgroundColor;
acceptLabelGreenColor = colors.acceptLabelGreenColor;
secondaryActionIcon = assetUriForEmbed;
acceptLabelIcon = assetUriForEmbed2;
acceptLabelText = r38;
isRsvped = isInterestedInEventRecurrence;
}
} else {
acceptLabelBackgroundColor = processColorOrThrow(Module712.unsafe_rawColors.GREEN_360);
acceptLabelText = intl.string(t.XpeFYr);
acceptLabelGreenColor = colors.acceptLabelGreenColor;
secondaryActionIcon = void 0;
acceptLabelIcon = void 0;
isRsvped = false;
}
if (!isGuildEventInvitable) {
secondaryActionIcon = void 0;
}
const content = description != null ? MarkupUtils.parseToAST(description, true, {
channelId: id,
allowLinks: true,
allowEmojiLinks: true,
allowHeading: true,
allowList: true
}) : void 0;
let channelName = getLocationFromEvent(guildEvent);
if (channelName == null) {
channelName = channel != null ? computeChannelName(channel, UserStore, RelationshipStore) : void 0;
}
const eventLocationIconSource = getEventLocationIconSource(guildEvent, channel, embedCanBeTapped);
const user = UserStore.getUser(guildEvent.creator_id);
GuildScheduledEventManager.getGuildEventUserCounts(guildEvent.guild_id, guildEvent.id, recurrenceId != null ? [recurrenceId] : []);
GuildScheduledEventManager.getGuildEventsForCurrentUser(guildEvent.guild_id);
const r182 = {
...r31,
acceptLabelBackgroundColor,
acceptLabelBorderColor: isRsvped ? colors.acceptLabelDisabledBorderColor : void 0,
acceptLabelColor: acceptLabelGreenColor,
acceptLabelIcon,
acceptLabelText,
badgeCount: userCount == null ? void 0 : userCount.toLocaleString(),
badgeIcon: getAssetUriForEmbed(Module12358),
channelIcon: eventLocationIconSource != null ? getAssetUriForEmbed(eventLocationIconSource) : void 0
};
if (channelName == null) {
channelName = void 0;
}
r182.channelName = channelName;
r182.content = content;
r182.creatorAvatar = user != null ? getAssetUriForEmbed(user.getAvatarSource(guildEvent.guild_id)) : void 0;
r182.extendedType = CodedLinkExtendedType.GUILD_SCHEDULED_EVENT;
r182.guildIcon = guildIcon;
r182.guildName = guild?.name;
let headerColor = processColor(color);
if (headerColor == null) {
headerColor = colors.headerColor;
}
r182.headerColor = headerColor;
r182.headerIcon = getAssetUriForEmbed(icon);
r182.headerText = text;
if (shouldChangeTextColor) {
let r218 = processColor(color);
if (r218 == null) {
r218 = colors.headerColor;
}
headerTextColor = r218;
} else {
headerTextColor = colors.headerColor;
}
r182.headerTextColor = headerTextColor;
r182.isRsvped = isRsvped;
r182.secondaryActionIcon = secondaryActionIcon;
r182.titleText = name;
r182.type = type;
r182.guildEventId = guildEvent.id;
return r182;
};
c8531_17 = {};
export function createGuildScheduledEventInviteEmbed(a0, a1) {
let r49;
const channel = ChannelStore.getChannel(a0.channel?.id);
const guild_id = channel?.guild_id;
const guildScheduledEvent = GuildScheduledEventStore.getGuildScheduledEvent(a0.guild_scheduled_event?.id);
const userCount = GuildScheduledEventStore.getUserCount(a0.guild_scheduled_event?.id, null);
if (guildScheduledEvent == null) {
const r50 = guild_id != null;
r49 = null;
if (r50) {
GuildScheduledEventsActionCreators.fetchGuildEventsForGuild(guild_id);
r49 = null;
}
} else {
if (guild_id != null) {
GuildScheduledEventManager.getGuildEventUserCounts(guild_id, guildScheduledEvent.id, []);
}
const guild = a0.guild != null ? fromInviteGuild(a0.guild) : GuildStore.getGuild(channel?.guild_id);
let type = a0.type;
if (type == null) {
type = InviteTypes.GUILD;
}
r49 = createGuildScheduledEventEmbed({
channel,
guildEvent: guildScheduledEvent,
userCount,
guild,
theme: a1,
type
});
}
return r49;
}
export function createGuildScheduledEventLinkEmbed(a0, a1) {
let [r19, r20, recurrenceId] = a0.split("-");
let c19802_0 = r19;
const guildScheduledEvent = GuildScheduledEventStore.getGuildScheduledEvent(r20);
if (recurrenceId == null) {
recurrenceId = getNextRecurrenceIdInEvent(guildScheduledEvent);
}
if (recurrenceId == null) {
recurrenceId = void 0;
}
if (guildScheduledEvent != null && !isGuildEventEnded(guildScheduledEvent)) {
GuildScheduledEventManager.getGuildEventUserCounts(r19, guildScheduledEvent.id, recurrenceId != null ? [recurrenceId] : []);
const userCount = GuildScheduledEventStore.getUserCount(guildScheduledEvent.id, recurrenceId);
return createGuildScheduledEventEmbed({
channel: ChannelStore.getChannel(guildScheduledEvent?.channel_id),
guildEvent: guildScheduledEvent,
userCount,
guild: GuildStore.getGuild(r19),
theme: a1,
type: InviteTypes.GUILD,
recurrenceId
});
}
if (!c8531_17[r19]) {
GuildScheduledEventsActionCreators.fetchGuildEventsForGuild(r19).then(() => delete c8531_17[c19802_0]).catch(() => delete c8531_17[c19802_0]);
c8531_17[r19] = true;
}
return null;
}
@@ -0,0 +1,59 @@
// Metro module 12362 (f12363).
import { Image as Image2 } from "react-native";
import GuildTemplateStore from "../../../../../../guild_templates/GuildTemplateStore";
import { GuildTemplateStates } from "../../../../../../guild_templates/GuildTemplatesConstants";
import { InviteTypes } from "../../../../../../instant_invite/Constants";
import getEmbedThemeColors from "../getEmbedThemeColors";
import { intl, t } from "../../../../../../../intl/index.native";
import { processColorOrThrow } from "../../../RowGeneratorStyleSheet";
import Module712 from "../../../../../../../_bundle/Module712";
import { isThemeDark } from "../../../../../../../design/shared";
import Module10994 from "../../../../../../../_bundle/Module10994";
import Module10995 from "../../../../../../../_bundle/Module10995";
import Module12363 from "../../../../../../../_bundle/Module12363";
export function createGuildTemplateEmbed(a0, a1) {
const embedThemeColors = getEmbedThemeColors(a1);
const { colors, baseColors } = embedThemeColors;
const guildTemplate = GuildTemplateStore.getGuildTemplate(a0);
if (guildTemplate == null) {
return null;
}
if (guildTemplate.state === GuildTemplateStates.RESOLVING) {
return {
headerText: intl.string(t.Xj87Yf).toUpperCase(),
resolvingGradientEnd: colors.resolvingGradientEnd,
resolvingGradientStart: colors.resolvingGradientStart,
type: InviteTypes.GUILD,
...baseColors
};
}
if (guildTemplate.state === GuildTemplateStates.EXPIRED) {
return {
...baseColors,
headerText: intl.string(t.C7ZRNw).toUpperCase(),
titleColor: processColorOrThrow(Module712.unsafe_rawColors.RED_400),
titleText: intl.string(t.A6MwXE),
thumbnailUrl: Image2.resolveAssetSource(isThemeDark(a1) ? Module10994 : Module10995).uri,
thumbnailBackgroundColor: colors.thumbnailBackgroundColor,
type: InviteTypes.GUILD
};
}
const subtitle = intl.formatToPlainString(t.L8Awgh, {
usageCount: guildTemplate.usageCount.toString()
});
return {
...baseColors,
headerText: intl.string(t.kAvFkO).toUpperCase(),
headerColor: colors.headerColor,
titleText: guildTemplate.name,
titleColor: colors.titleColor,
subtitle,
subtitleColor: colors.subtitleColor,
thumbnailUrl: Image2.resolveAssetSource(Module12363).uri,
acceptLabelColor: colors.acceptLabelGreenColor,
acceptLabelBackgroundColor: colors.acceptLabelGreenBackgroundColor,
acceptLabelText: intl.string(t["a3Gl+e"]),
embedCanBeTapped: true,
type: InviteTypes.GUILD
};
}
@@ -0,0 +1,67 @@
// Metro module 12352 (f12353).
import InviteStore from "../../../../../../../stores/InviteStore";
import UserStore from "../../../../../../../stores/UserStore";
import { AbortCodes, InviteStates } from "../../../../../../../Constants";
import { InviteTypes } from "../../../../../../instant_invite/Constants";
import { createResolvingGuildInvite, createErroredGuildInvite, createDisabledGuildInvite, createGuildInvite, createExpiredGuildInvite } from "./invite/GuildInvite";
import { getInviteType, getGuildInviteExtendedType, GuildInviteExtendedType } from "../../../../../../instant_invite/InviteTypeUtils";
import { createGroupDMInvite } from "./invite/GroupDMInvite";
import { createFriendInvite } from "./invite/FriendInvite";
import { createGuildScheduledEventInviteEmbed } from "./GuildScheduledEventEmbed";
import { createEmbeddedActivityInviteEmbed } from "./EmbeddedActivityInviteEmbed";
import { createGuildProfileInvite } from "./invite/GuildProfileInvite";
import { getVoiceChannelListInviteExperiment } from "../../../../../VoiceChannelListInviteExperiment";
import { createVoiceChannelListInviteEmbed } from "./invite/VoiceChannelListInviteEmbed";
export function createInviteEmbed(a0, a1, a2) {
const invite = InviteStore.getInvite(a1);
if (invite == null) {
return null;
}
const id2 = UserStore.getCurrentUser()?.id;
const id = a0.author.id;
if (invite.state === InviteStates.RESOLVING) {
return createResolvingGuildInvite(a2);
}
const r27 = id2 === id;
if (invite.state !== InviteStates.EXPIRED && invite.state !== InviteStates.BANNED) {
if (invite.state === InviteStates.ERROR) {
const inviteError = InviteStore.getInviteError(a1);
return inviteError == null ? createErroredGuildInvite(a1, r27, a2) : inviteError.code === AbortCodes.INVITES_DISABLED ? createDisabledGuildInvite(invite, a2) : createErroredGuildInvite(a1, r27, a2);
}
const inviteType = getInviteType(invite);
if (InviteTypes.GROUP_DM === inviteType) {
return createGroupDMInvite(invite, r27, a2);
}
if (InviteTypes.FRIEND === inviteType) {
return createFriendInvite(invite, r27, id2, a2);
}
const guildInviteExtendedType = getGuildInviteExtendedType(invite);
if (GuildInviteExtendedType.EVENT === guildInviteExtendedType) {
return createGuildScheduledEventInviteEmbed(invite, a2);
}
if (GuildInviteExtendedType.APPLICATION === guildInviteExtendedType) {
return createEmbeddedActivityInviteEmbed({
inviteCode: invite.code,
theme: a2
});
}
if (GuildInviteExtendedType.PROFILE === guildInviteExtendedType) {
return createGuildProfileInvite(invite, a2);
}
if (GuildInviteExtendedType.VOICE_CHANNEL === guildInviteExtendedType) {
const id3 = invite.guild?.id;
if (id3 != null && getVoiceChannelListInviteExperiment({
guildId: id3,
location: "mobile_invite_embed"
}).enabled) {
const voiceChannelListInviteEmbed = createVoiceChannelListInviteEmbed(invite, a2);
if (voiceChannelListInviteEmbed != null) {
return voiceChannelListInviteEmbed;
}
}
return createGuildInvite(invite, r27, a2);
}
return createGuildInvite(invite, r27, a2);
}
return createExpiredGuildInvite(a0, r27, a2);
}
@@ -0,0 +1,66 @@
// Metro module 12366 (f12367).
import _slicedToArray from "../../../../../../../_bundle/_slicedToArray";
import { Image as Image2 } from "react-native";
import { getGuildAcronym } from "../../../../../../../records/GuildRecord";
import ChannelStore from "../../../../../../../stores/ChannelStore";
import GuildStore from "../../../../../../../stores/GuildStore";
import PermissionStore from "../../../../../../../stores/PermissionStore";
import RelationshipStore from "../../../../../../../stores/RelationshipStore";
import UserStore from "../../../../../../../stores/UserStore";
import { Permissions } from "../../../../../../../Constants";
import { InviteTypes } from "../../../../../../instant_invite/Constants";
import getEmbedThemeColors from "../getEmbedThemeColors";
import AvatarUtils from "../../../../../../../utils/AvatarUtils";
import { isAndroid } from "../../../../../../../utils/PlatformUtils";
import { intl, t } from "../../../../../../../intl/index.native";
import { getChannelIcon } from "../../../../../../../utils/native/ChannelUtils";
import { computeChannelName } from "../../../../../../channel/useChannelName";
export function createVoiceChannelLinkEmbed(a0, a1) {
let r12, thumbnailText;
const r22 = _slicedToArray(a0.split("/"), 2);
const r23 = r22[0];
const channel = ChannelStore.getChannel(r22[1]);
const guild = GuildStore.getGuild(r23);
if (channel != null && channel.isGuildVocal() && guild != null && PermissionStore.can(Permissions.VIEW_CHANNEL, channel) && PermissionStore.can(Permissions.CONNECT, channel)) {
const embedThemeColors = getEmbedThemeColors(a1);
const { colors, baseColors } = embedThemeColors;
if (guild?.icon != null) {
r12 = AvatarUtils.getGuildIconURL({
id: guild?.id,
icon: guild?.icon,
canAnimate: true,
size: 128
});
thumbnailText = void 0;
} else {
thumbnailText = guild != null ? getGuildAcronym(guild) : void 0;
r12 = void 0;
}
return {
...baseColors,
headerText: isAndroid() ? "" : void 0,
headerColor: colors.headerColor,
acceptLabelText: channel.isGuildStageVoice() ? intl.string(t["7vb2cc"]) : intl.string(t.gpqgah),
onlineText: void 0,
memberText: void 0,
channelIcon: Image2.resolveAssetSource(getChannelIcon(channel))?.uri,
titleText: computeChannelName(channel, UserStore, RelationshipStore),
titleColor: colors.titleColor,
thumbnailUrl: r12 ?? void 0,
thumbnailText,
subtitleColor: void 0,
acceptLabelBackgroundColor: colors.acceptLabelGreenBackgroundColor,
acceptLabelBorderColor: void 0,
acceptLabelColor: colors.acceptLabelGreenColor,
embedCanBeTapped: true,
canBeAccepted: true,
channelName: intl.formatToPlainString(t["2wimj5"], {
guildName: guild.name
}),
subtitle: "",
type: InviteTypes.GUILD,
inviteSplash: void 0
};
}
return null;
}
@@ -0,0 +1,68 @@
// Metro module 12356 (f12357).
import { Image as Image2 } from "react-native";
import RelationshipStore from "../../../../../../../../stores/RelationshipStore";
import { InviteTypes } from "../../../../../../../instant_invite/Constants";
import getEmbedThemeColors from "../../getEmbedThemeColors";
import { intl, t } from "../../../../../../../../intl/index.native";
import UserUtils from "../../../../../../../../utils/UserUtils";
import AvatarUtils from "../../../../../../../../utils/AvatarUtils";
export function createFriendInvite(a0, a1, a2, a3) {
let acceptLabelDisabledBackgroundColor, acceptLabelDisabledColor, acceptLabelText, canBeAccepted;
const embedThemeColors = getEmbedThemeColors(a3);
const { colors, baseColors } = embedThemeColors;
const r18 = a1 ? intl.string(t.eQyu1F) : intl.string(t.PYJHW6);
const titleText = a0.inviter != null ? a0.inviter.username : "";
const subtitle = a0.inviter != null ? UserUtils.getUserTag(a0.inviter) : "";
const r48 = a0.inviter != null && RelationshipStore.isFriend(a0.inviter?.id);
const r54 = a0.inviter != null ? Image2.resolveAssetSource(AvatarUtils.getUserAvatarSource(a0.inviter)).uri : "";
if (a0.inviter?.id === a2) {
acceptLabelDisabledColor = colors.acceptLabelDisabledColor;
acceptLabelDisabledBackgroundColor = colors.acceptLabelDisabledBackgroundColor;
acceptLabelText = intl.string(t.ib7Ng1);
canBeAccepted = false;
} else {
const { acceptLabelGreenColor, acceptLabelGreenBackgroundColor } = colors;
if (r48) {
acceptLabelText = intl.string(t.xhxnPn);
canBeAccepted = true;
acceptLabelDisabledBackgroundColor = acceptLabelGreenBackgroundColor;
acceptLabelDisabledColor = acceptLabelGreenColor;
} else {
acceptLabelText = intl.string(t.ib7Ng1);
canBeAccepted = true;
acceptLabelDisabledBackgroundColor = acceptLabelGreenBackgroundColor;
acceptLabelDisabledColor = acceptLabelGreenColor;
}
}
const headerText = r18 != null ? r18.toUpperCase() : void 0;
const thumbnailUrl = r54 ?? void 0;
const subtitleColor = subtitle !== "" ? colors.subtitleColor : void 0;
let channelName = a0.channel?.name;
if (channelName == null) {
channelName = void 0;
}
let type = a0.type;
if (type == null) {
type = InviteTypes.FRIEND;
}
return {
...baseColors,
thumbnailCornerRadius: 25,
headerText,
headerColor: colors.headerColor,
acceptLabelText,
channelIcon: void 0,
titleText,
titleColor: colors.titleColor,
thumbnailUrl,
subtitle,
subtitleColor,
acceptLabelBackgroundColor: acceptLabelDisabledBackgroundColor,
acceptLabelBorderColor: void 0,
acceptLabelColor: acceptLabelDisabledColor,
embedCanBeTapped: false,
canBeAccepted,
channelName,
type
};
}
@@ -0,0 +1,76 @@
// Metro module 12355 (f12356).
import ChannelStore from "../../../../../../../../stores/ChannelStore";
import RelationshipStore from "../../../../../../../../stores/RelationshipStore";
import UserStore from "../../../../../../../../stores/UserStore";
import { InviteTypes } from "../../../../../../../instant_invite/Constants";
import getEmbedThemeColors from "../../getEmbedThemeColors";
import getChannelAndRecipientsFromInvite from "./getChannelAndRecipientsFromInvite";
import { intl, t } from "../../../../../../../../intl/index.native";
import { getChannelIconSource } from "../../../../../../../channel/getChannelIcon";
import { ensureAvatarSource } from "../../../../../../../../utils/native/AvatarUtils";
import { computeChannelName } from "../../../../../../../channel/useChannelName";
export function createGroupDMInvite(a0, a1, a2) {
let acceptLabelDisabledBackgroundColor, acceptLabelDisabledColor, acceptLabelText;
const embedThemeColors = getEmbedThemeColors(a2);
const { colors, baseColors } = embedThemeColors;
const channelAndRecipientsFromInvite = getChannelAndRecipientsFromInvite(a0);
let channel = channelAndRecipientsFromInvite.channel;
const recipients_ = channelAndRecipientsFromInvite.recipients_;
const channel2 = ChannelStore.getChannel(channel?.id);
const r4 = channel2 != null;
let r36 = false;
if (r4) {
r36 = true;
channel = channel2;
}
const r20 = a1 ? intl.string(t.qmtuXE) : intl.string(t["3p3/BK"]);
if (r36) {
intl.string(t.cEnaWx);
} else {
intl.string(t.XpeFYr);
}
const memberText = recipients_.length > 0 ? intl.formatToPlainString(t.zRl6XR, {
count: recipients_.length
}) : void 0;
const r71 = channel != null ? getChannelIconSource(channel) : null;
const r76 = r71 != null ? ensureAvatarSource(r71).uri : null;
const titleText = (r36 ? channel != null ? computeChannelName(channel, UserStore, RelationshipStore) : null : null) || a0.channel?.name || recipients_.map((item) => item.username).join(", ") || intl.string(t.LJpTRF);
if (r36) {
acceptLabelDisabledColor = colors.acceptLabelDisabledColor;
acceptLabelDisabledBackgroundColor = colors.acceptLabelDisabledBackgroundColor;
acceptLabelText = intl.string(t.cEnaWx);
} else {
acceptLabelDisabledColor = colors.acceptLabelGreenColor;
acceptLabelDisabledBackgroundColor = colors.acceptLabelGreenBackgroundColor;
acceptLabelText = intl.string(t.XpeFYr);
}
const headerText = r20 != null ? r20.toUpperCase() : void 0;
const thumbnailUrl = r76 ?? void 0;
const channelName = r36 ? channel != null ? computeChannelName(channel, UserStore, RelationshipStore) : titleText : titleText;
let type = a0.type;
if (type == null) {
type = InviteTypes.GROUP_DM;
}
return {
...baseColors,
headerText,
headerColor: colors.headerColor,
acceptLabelText,
onlineText: void 0,
memberText,
channelIcon: void 0,
titleText,
titleColor: colors.titleColor,
thumbnailUrl,
thumbnailText: void 0,
subtitle: "",
subtitleColor: void 0,
acceptLabelBackgroundColor: acceptLabelDisabledBackgroundColor,
acceptLabelBorderColor: void 0,
acceptLabelColor: acceptLabelDisabledColor,
embedCanBeTapped: true,
canBeAccepted: !r36,
channelName,
type
};
}
@@ -0,0 +1,317 @@
// Metro module 12353 (f12354).
import { Image as Image2 } from "react-native";
import { getGuildAcronym, getGuildIconURL } from "../../../../../../../../records/GuildRecord";
import ApplicationStreamingStore from "../../../../../../../../stores/ApplicationStreamingStore";
import ChannelStore from "../../../../../../../../stores/ChannelStore";
import GuildMemberStore from "../../../../../../../../stores/GuildMemberStore";
import GuildStore from "../../../../../../../../stores/GuildStore";
import InviteStore from "../../../../../../../../stores/InviteStore";
import RelationshipStore from "../../../../../../../../stores/RelationshipStore";
import UserStore from "../../../../../../../../stores/UserStore";
import { CodedLinkExtendedType } from "../CodedLinksConstants";
import { ChannelTypes, GuildFeatures, HelpdeskArticles } from "../../../../../../../../Constants";
import { InviteTargetTypes, InviteTypes } from "../../../../../../../instant_invite/Constants";
import getEmbedThemeColors from "../../getEmbedThemeColors";
import { intl, t } from "../../../../../../../../intl/index.native";
import { processColorOrThrow } from "../../../../RowGeneratorStyleSheet";
import Module712 from "../../../../../../../../_bundle/Module712";
import UserUtils from "../../../../../../../../utils/UserUtils";
import { isThemeDark } from "../../../../../../../../design/shared";
import Module10994 from "../../../../../../../../_bundle/Module10994";
import Module10995 from "../../../../../../../../_bundle/Module10995";
import { fromInviteGuild } from "../../../../../../../../utils/GuildRecordUtils";
import HelpdeskUtils from "../../../../../../../../utils/HelpdeskUtils";
import { getAssetUriForEmbed } from "../../../../EmbedUtils";
import Module11827 from "../../../../../../../../_bundle/Module11827";
import { getDescriptiveInviteError } from "../../../../../../../../utils/InviteErrorUtils";
import GuestUtils from "../../../../../../../guests/GuestUtils";
import getChannelAndRecipientsFromInvite from "./getChannelAndRecipientsFromInvite";
import { getHeaderTextForInvite } from "../../../../../../getHeaderTextForInvite";
import { hasFlag } from "../../../../../../../../_bundle/Module1384";
import { GuildInviteFlags } from "../../../../../../../../_bundle/Module6709";
import AvatarUtils from "../../../../../../../../utils/AvatarUtils";
import getDevicePixelRatio_native from "../../../../../../../../utils/getDevicePixelRatio.native";
import { getChannelIcon } from "../../../../../../../../utils/native/ChannelUtils";
import { getGuildBadgeImageSource } from "../../../../../../../guild_badge/native/GuildBadgeImageSource";
import { computeChannelName } from "../../../../../../../channel/useChannelName";
export function createResolvingGuildInvite(a0) {
const embedThemeColors = getEmbedThemeColors(a0);
const { colors, baseColors } = embedThemeColors;
return {
headerText: intl.string(t["N/g9Z4"]).toUpperCase(),
resolvingGradientEnd: colors.resolvingGradientEnd,
resolvingGradientStart: colors.resolvingGradientStart,
type: InviteTypes.GUILD,
...baseColors
};
}
export function createExpiredGuildInvite(a0, a1, a2) {
const embedThemeColors = getEmbedThemeColors(a2);
const colors = embedThemeColors.colors;
return {
...embedThemeColors.baseColors,
headerText: (a1 ? intl.string(t.C89OLE) : intl.string(t.YVub5y)).toUpperCase(),
titleColor: processColorOrThrow(Module712.unsafe_rawColors.RED_400),
subtitle: a1 ? intl.string(t["F/OLvL"]) : a0.author?.username != null ? intl.formatToPlainString(t["9Akp1s"], {
username: UserUtils.getFormattedName(a0.author)
}) : intl.string(t["SMJr+a"]),
titleText: intl.string(t["Jhx/ud"]),
thumbnailUrl: Image2.resolveAssetSource(isThemeDark(a2) ? Module10994 : Module10995).uri,
thumbnailBackgroundColor: colors.thumbnailBackgroundColor,
subtitleColor: colors.subtitleColor,
type: InviteTypes.GUILD
};
}
export function createDisabledGuildInvite(a0, a1) {
const embedThemeColors = getEmbedThemeColors(a1);
const { colors, baseColors } = embedThemeColors;
const r27 = a0.guild != null ? fromInviteGuild(a0.guild) : GuildStore.getGuild(ChannelStore.getChannel(a0.channel?.id)?.guild_id);
const r34 = r27 != null ? getGuildIconURL(r27, 48, false) : void 0;
const r37 = {
...baseColors,
extendedType: CodedLinkExtendedType.GUILD_INVITE_DISABLED,
headerText: intl.string(t["Hyx2F/"]).toUpperCase(),
titleText: intl.string(t.tQ4AnN),
titleColor: processColorOrThrow(Module712.unsafe_rawColors.RED_345)
};
let guildName = r27?.name;
if (guildName == null) {
guildName = intl.string(t.wBceYP);
}
r37.guildName = guildName;
r37.subtitle = intl.string(t["x+XpjL"]);
r37.helpCenterArticleLabel = intl.string(t["4FlZqw"]);
r37.helpCenterArticleURL = HelpdeskUtils.getArticleURL(HelpdeskArticles.INVITE_DISABLED);
let guildIcon = r34;
if (guildIcon == null) {
guildIcon = void 0;
}
r37.guildIcon = guildIcon;
r37.thumbnailUrl = getAssetUriForEmbed(Module11827);
r37.thumbnailText = r34 != null ? void 0 : r27 != null ? getGuildAcronym(r27) : void 0;
r37.subtitleColor = colors.subtitleColor;
r37.type = InviteTypes.GUILD;
return r37;
}
export function createErroredGuildInvite(a0, a1, a2) {
const embedThemeColors = getEmbedThemeColors(a2);
const { colors, baseColors } = embedThemeColors;
const inviteError = InviteStore.getInviteError(a0);
const descriptiveInviteError = getDescriptiveInviteError(inviteError?.code);
const r26 = {
...baseColors,
headerText: (a1 ? intl.string(t.C89OLE) : intl.string(t.YVub5y)).toUpperCase(),
titleColor: processColorOrThrow(Module712.unsafe_rawColors.RED_400)
};
let subtitle = descriptiveInviteError?.description;
if (subtitle == null) {
subtitle = inviteError?.message;
}
r26.subtitle = subtitle;
let titleText = descriptiveInviteError?.title;
if (titleText == null) {
titleText = intl.string(t["Jhx/ud"]);
}
r26.titleText = titleText;
r26.thumbnailUrl = Image2.resolveAssetSource(isThemeDark(a2) ? Module10994 : Module10995).uri;
r26.thumbnailBackgroundColor = colors.thumbnailBackgroundColor;
r26.subtitleColor = colors.subtitleColor;
r26.type = InviteTypes.GUILD;
return r26;
}
export function createGuildInvite(a0, a1, a2) {
let r27, r33, r119, r121, acceptLabelBackgroundColor, acceptLabelColor, acceptLabelText, channelIcon, memberText, onlineText, subtitle, thumbnailText, titleText;
const embedThemeColors = getEmbedThemeColors(a2);
const { colors, baseColors } = embedThemeColors;
let r31 = a0.guild != null ? GuildStore.getGuild(a0.guild.id) : null;
const canAcceptInvite = GuestUtils.canAcceptInvite([GuildMemberStore], a0);
const channel = getChannelAndRecipientsFromInvite(a0).channel;
const isVoiceChannel = channel != null && channel.isGuildVocal();
let isStage = channel == null ? void 0 : channel.isGuildStageVoice();
if (isStage == null) {
isStage = false;
}
const { target_user, target_type } = a0;
let approximate_member_count = a0.approximate_member_count;
const approximate_presence_count = a0.approximate_presence_count;
const STREAM = InviteTargetTypes.STREAM;
const r2 = a0.guild != null && r31 == null;
let r4 = true;
if (r2) {
r31 = fromInviteGuild(a0.guild);
r4 = false;
}
let isHubGuild = r31 == null ? void 0 : r31.features.has(GuildFeatures.HUB);
if (isHubGuild == null) {
isHubGuild = false;
}
const isStream = target_type === STREAM;
let flags = a0.flags;
if (flags == null) {
flags = 0;
}
const headerTextForInvite = getHeaderTextForInvite({
isVoiceChannel,
isOwnInvite: a1,
isHubGuild,
isStream,
isStage,
isGuest: hasFlag(flags, GuildInviteFlags.IS_GUEST_INVITE)
});
const name = r31?.name;
if (r31?.icon != null) {
r27 = AvatarUtils.getGuildIconURL({
id: r31?.id,
icon: r31?.icon,
canAnimate: true,
size: 128
});
r33 = void 0;
} else {
r33 = r31 != null ? getGuildAcronym(r31) : void 0;
r27 = void 0;
}
const r100 = r31?.splash != null;
let inviteSplash = void 0;
if (r100) {
let r112 = AvatarUtils.getGuildSplashURL({
id: r31.id,
splash: r31.splash,
size: 400 * getDevicePixelRatio_native()
});
if (r112 == null) {
r112 = void 0;
}
inviteSplash = r112;
}
L63: {
if (isVoiceChannel) {
if (r4 && target_user != null && isStream) {
const uri3 = Image2.resolveAssetSource(AvatarUtils.getUserAvatarSource(target_user)).uri;
const r189 = intl.formatToPlainString(t.QmlLEq, {
name: UserUtils.getFormattedName(target_user)
});
subtitle = intl.formatToPlainString(t.u0vaDE, {
guildName: r31?.name
});
r119 = ApplicationStreamingStore.getActiveStreamForUser(target_user.id, channel.getGuildId()) != null;
thumbnailText = void 0;
r121 = uri3;
titleText = r189;
channelIcon = void 0;
memberText = void 0;
onlineText = void 0;
break L63;
}
const uri2 = Image2.resolveAssetSource(getChannelIcon(channel))?.uri;
subtitle = "";
channelIcon = uri2;
r119 = r4;
thumbnailText = r33;
r121 = r27;
titleText = name;
memberText = void 0;
onlineText = void 0;
} else {
if (channel != null && channel.type === ChannelTypes.GUILD_STAGE_VOICE) {
const uri = Image2.resolveAssetSource(getChannelIcon(channel))?.uri;
subtitle = "";
channelIcon = uri;
r119 = r4;
thumbnailText = r33;
r121 = r27;
titleText = name;
memberText = void 0;
onlineText = void 0;
break L63;
}
if (!(approximate_member_count != null && approximate_member_count >= 5) && !(approximate_presence_count != null && approximate_presence_count > 0)) {
const r6 = channel != null;
subtitle = "";
r119 = r4;
thumbnailText = r33;
r121 = r27;
titleText = name;
channelIcon = void 0;
memberText = void 0;
onlineText = void 0;
if (!r6) {
break L63;
}
channelIcon = Image2.resolveAssetSource(getChannelIcon(channel))?.uri;
subtitle = "";
r119 = r4;
thumbnailText = r33;
r121 = r27;
titleText = name;
memberText = void 0;
onlineText = void 0;
break L63;
}
const r140 = intl.formatToPlainString(t["LC+S+m"], {
membersOnline: approximate_presence_count
});
const zRl6XR = t.zRl6XR;
if (approximate_member_count == null) {
approximate_member_count = 0;
}
memberText = intl.formatToPlainString(zRl6XR, {
count: approximate_member_count
});
subtitle = "";
r119 = r4;
thumbnailText = r33;
r121 = r27;
titleText = name;
channelIcon = void 0;
onlineText = r140;
}
}
if (isVoiceChannel) {
const { acceptLabelGreenColor, acceptLabelGreenBackgroundColor } = colors;
acceptLabelText = isStage ? intl.string(t["7vb2cc"]) : intl.string(t.gpqgah);
acceptLabelBackgroundColor = acceptLabelGreenBackgroundColor;
acceptLabelColor = acceptLabelGreenColor;
} else if (r119) {
acceptLabelColor = colors.acceptLabelDisabledColor;
acceptLabelBackgroundColor = colors.acceptLabelDisabledBackgroundColor;
acceptLabelText = intl.string(t.cEnaWx);
} else {
acceptLabelColor = colors.acceptLabelGreenColor;
acceptLabelBackgroundColor = colors.acceptLabelGreenBackgroundColor;
acceptLabelText = intl.string(t.XpeFYr);
}
const r239 = r31 != null ? getGuildBadgeImageSource(r31, a2) : void 0;
const headerText = headerTextForInvite != null ? headerTextForInvite.toUpperCase() : void 0;
const thumbnailUrl = r121 ?? void 0;
const subtitleColor = subtitle !== "" ? colors.subtitleColor : void 0;
const channelName = channel != null ? computeChannelName(channel, UserStore, RelationshipStore) : void 0;
let type = a0.type;
if (type == null) {
type = InviteTypes.GUILD;
}
return {
...baseColors,
headerText,
headerColor: colors.headerColor,
acceptLabelText,
onlineText,
memberText,
channelIcon,
titleText,
titleColor: colors.titleColor,
thumbnailUrl,
thumbnailText,
subtitle,
subtitleColor,
acceptLabelBackgroundColor,
acceptLabelBorderColor: void 0,
acceptLabelColor,
embedCanBeTapped: true,
canBeAccepted: canAcceptInvite,
channelName,
type,
inviteSplash,
badgeIconUrl: r239 != null ? getAssetUriForEmbed(r239) : void 0
};
}
@@ -0,0 +1,210 @@
// Metro module 12361 (f12362).
import LocaleStore from "../../../../../../../user_settings/LocaleStore";
import { CodedLinkExtendedType } from "../CodedLinksConstants";
import { GuildFeatures } from "../../../../../../../../Constants";
import { InviteTypes } from "../../../../../../../instant_invite/Constants";
import getEmbedThemeColors from "../../getEmbedThemeColors";
import { buildGuildProfileFromInvite } from "../../../../../../../guild_profile/GuildProfileBuilders";
import { isThemeDark } from "../../../../../../../../design/shared";
import Module712 from "../../../../../../../../_bundle/Module712";
import { fromGuildProfile } from "../../../../../../../../utils/GuildRecordUtils";
import { getProfilePrimaryColor } from "../../../../../../../guild_profile/native/GuildProfileUtils";
import { getBackgroundForProfile } from "../../../../../../../guild_profile/native/components/GuildProfileView";
import AvatarUtils from "../../../../../../../../utils/AvatarUtils";
import { getAcronym } from "../../../../../../../../_bundle/Module1857";
import getDevicePixelRatio_native from "../../../../../../../../utils/getDevicePixelRatio.native";
import { intl, t } from "../../../../../../../../intl/index.native";
import { getGuildProfileCTAType, CTATypes } from "../../../../../../../guild_profile/hooks/useGuildProfileCTA";
import { getGuildBadgeImageSource } from "../../../../../../../guild_badge/native/GuildBadgeImageSource";
import { getEstablishedDate } from "../../../../../../../guild_profile/GuildProfileUtils";
import SnowflakeUtils from "../../../../../../../../utils/SnowflakeUtils";
import { sortInviteRoles, inviteRoleToDisplayData } from "../../../../../../../../utils/GuildRoleUtils";
import { getRoleIconData } from "../../../../../../../guild_boosting/RoleIconUtils";
import { int2hex } from "../../../../../../../../_bundle/int2hslRaw";
import { processColorOrThrow } from "../../../../RowGeneratorStyleSheet";
import { getAssetUriForEmbed } from "../../../../EmbedUtils";
export function createGuildProfileInvite(a0, a1) {
let r22, acceptLabelText, thumbnailText;
const embedThemeColors = getEmbedThemeColors(a1);
const { colors, baseColors } = embedThemeColors;
const r13 = buildGuildProfileFromInvite(a0);
const r15 = isThemeDark(a1) ? Module712.unsafe_rawColors.PRIMARY_660 : Module712.unsafe_rawColors.PRIMARY_160;
const r12 = r13 != null ? fromGuildProfile(r13) : null;
let r50 = getProfilePrimaryColor(r13);
if (r50 == null) {
r50 = r15;
}
const [r18, r17] = getBackgroundForProfile(a1, r50);
let count = r13?.memberCount;
if (count == null) {
count = a0.approximate_member_count;
}
let membersOnline = r13?.onlineCount;
if (membersOnline == null) {
membersOnline = a0.approximate_presence_count;
}
if (r13?.icon != null) {
r22 = AvatarUtils.getGuildIconURL({
id: r13.id,
icon: r13.icon,
canAnimate: true,
size: 128
});
thumbnailText = void 0;
} else {
let r64 = r13?.name;
if (r64 == null) {
r64 = "";
}
thumbnailText = getAcronym(r64);
r22 = void 0;
}
const r72 = r12 == null ? void 0 : r12.features.has(GuildFeatures.DISCOVERABLE);
let inviteSplash = void 0;
if (r72) {
const r80 = r13?.customBanner != null;
inviteSplash = void 0;
if (r80) {
let r91 = AvatarUtils.getGuildDiscoverySplashURL({
id: r13.id,
splash: r13.customBanner,
size: 400 * getDevicePixelRatio_native()
});
if (r91 == null) {
r91 = void 0;
}
inviteSplash = r91;
}
}
const r92 = count != null && count >= 5 || membersOnline != null && membersOnline > 0;
let memberText = void 0;
let onlineText = void 0;
if (r92) {
const r97 = membersOnline != null ? intl.formatToPlainString(t["LC+S+m"], {
membersOnline
}) : void 0;
memberText = count != null ? intl.formatToPlainString(t.zRl6XR, {
count
}) : void 0;
onlineText = r97;
}
const r117 = r13 != null ? getGuildProfileCTAType(r13, a0.code) : null;
if (CTATypes.IS_MEMBER === r117) {
acceptLabelText = intl.string(t.IRoQXr);
} else if (CTATypes.HAS_APPLICATION === r117) {
acceptLabelText = intl.string(t["4yfIDk"]);
} else if (CTATypes.APPLY_TO_JOIN === r117) {
acceptLabelText = intl.string(t["7XdMW2"]);
} else if (CTATypes.ACCEPT_ROLES === r117) {
acceptLabelText = intl.string(t.MMlhsr);
} else {
if (CTATypes.LURK_DISCOVERABLE !== r117) {
CTATypes.JOIN_VIA_INVITE;
}
acceptLabelText = intl.string(t.XpeFYr);
}
const r188 = r12 != null ? getGuildBadgeImageSource(r12, a1) : void 0;
const r192 = r13 == null;
let r193 = void 0;
if (!r192) {
const traits = r13.traits;
r193 = traits == null ? void 0 : traits.filter((trait) => trait != null && trait.label.trim().length > 0);
}
const establishedText = r13 != null ? intl.formatToPlainString(t.zb2Q56, {
createdAtDate: getEstablishedDate(SnowflakeUtils.extractTimestamp(r13.id), LocaleStore.locale)
}) : void 0;
const r221 = a0.roles != null;
let roles = void 0;
if (r221) {
const r226 = a0.roles.length > 0;
roles = void 0;
if (r226) {
const r228 = a0.guild != null;
roles = void 0;
if (r228) {
const id = a0.guild.id;
roles = [...a0.roles].sort(sortInviteRoles).map((item) => {
let r22 = getRoleIconData(inviteRoleToDisplayData(id, item), 16);
if (r22 == null) {
r22 = {};
}
const { customIconSrc, unicodeEmoji } = r22;
let color = item.color;
if (color == null) {
color = 0;
}
const r27 = int2hex(color);
const roleIcon = customIconSrc == null ? unicodeEmoji != null ? {
source: customIconSrc,
unicodeEmoji: unicodeEmoji?.surrogates,
name: item.name,
size: 16,
alt: intl.formatToPlainString(t["9+YWrE"], {
name: item.name
})
} : void 0 : {
source: customIconSrc,
unicodeEmoji: unicodeEmoji?.surrogates,
name: item.name,
size: 16,
alt: intl.formatToPlainString(t["9+YWrE"], {
name: item.name
})
};
return {
id: item.id,
name: item.name,
color: processColorOrThrow(r27),
roleIcon
};
});
}
}
}
const name = r13?.name;
const thumbnailUrl = r22 ?? void 0;
let bodyText = r13?.description;
if (bodyText == null) {
bodyText = "";
}
let type = a0.type;
if (type == null) {
type = InviteTypes.GUILD;
}
const r241 = {
...baseColors,
extendedType: CodedLinkExtendedType.GUILD_PROFILE_INVITE,
acceptLabelText,
onlineText,
memberText,
titleText: name,
thumbnailUrl,
thumbnailText,
bodyText,
embedCanBeTapped: true,
canBeAccepted: true,
type,
inviteSplash,
bannerColor: processColorOrThrow(r18),
bannerColorSecondary: processColorOrThrow(r17)
};
if (r193 == null) {
r193 = [];
}
let hasProfileOverflow = r193.length > 0;
if (!hasProfileOverflow) {
let r268 = r13?.gameApplicationIds;
if (r268 == null) {
r268 = [];
}
hasProfileOverflow = r268.length > 0;
}
r241.hasProfileOverflow = hasProfileOverflow;
r241.badgeIconUrl = r188 != null ? getAssetUriForEmbed(r188) : void 0;
r241.acceptLabelBackgroundColor = colors.acceptLabelGreenBackgroundColor;
r241.establishedText = establishedText;
r241.headerText = null;
r241.roles = roles;
r241.rolesHeadingText = roles != null ? roles.length > 0 ? intl.string(t.stcSfI) : void 0 : void 0;
return r241;
}
@@ -0,0 +1,174 @@
// Metro module 9498 (f9499).
import { processColor } from "react-native";
import AccessibilityStore from "../../../../../../../a11y/AccessibilityStore";
import VoiceChannelStartTimeStore from "../../../../../../../channel/VoiceChannelStartTimeStore";
import { getGuildIconSource } from "../../../../../../../../records/GuildRecord";
import ChannelStore from "../../../../../../../../stores/ChannelStore";
import GuildMemberStore from "../../../../../../../../stores/GuildMemberStore";
import GuildStore from "../../../../../../../../stores/GuildStore";
import PermissionStore from "../../../../../../../../stores/PermissionStore";
import RelationshipStore from "../../../../../../../../stores/RelationshipStore";
import UserStore from "../../../../../../../../stores/UserStore";
import VoiceStateStore from "../../../../../../../../stores/VoiceStateStore";
import SortedVoiceStateStore from "../../../../../../../../stores/views/SortedVoiceStateStore";
import { CodedLinkExtendedType } from "../CodedLinksConstants";
import { BasicPermissions } from "../../../../../../../../Constants";
import { InviteTypes } from "../../../../../../../instant_invite/Constants";
import getChannelAndRecipientsFromInvite from "./getChannelAndRecipientsFromInvite";
import getEmbedThemeColors from "../../getEmbedThemeColors";
import { getAssetUriForEmbed } from "../../../../EmbedUtils";
import AvatarUtils from "../../../../../../../../utils/AvatarUtils";
import UserUtils from "../../../../../../../../utils/UserUtils";
import { getEmbedScrollGradientBackground } from "../../../../../../../client_themes/native/ClientThemesUtils";
import { computeChannelName } from "../../../../../../../channel/useChannelName";
import { intl, t } from "../../../../../../../../intl/index.native";
import GuestUtils from "../../../../../../../guests/GuestUtils";
export function canShowVoiceChannelListInviteEmbed(a0) {
const r1 = a0.guild == null;
let r9 = null;
if (!r1) {
const guild2 = GuildStore.getGuild(a0.guild.id);
const r12 = guild2 == null;
r9 = null;
if (!r12) {
const channel = getChannelAndRecipientsFromInvite(a0).channel;
const r20 = channel == null;
r9 = null;
if (!r20) {
const isGuildVocal = channel.isGuildVocal();
r9 = null;
if (isGuildVocal) {
let channel2 = ChannelStore.getChannel(channel.id);
if (channel2 == null) {
channel2 = channel;
}
r9 = PermissionStore.canBasicChannel(BasicPermissions.VIEW_CHANNEL, channel2) ? {
guild: guild2,
channel: channel2
} : null;
}
}
}
}
return r9 != null;
}
export function createVoiceChannelListInviteEmbed(a0, a1) {
const r2 = a0.guild == null;
let r7 = null;
if (!r2) {
const guild2 = GuildStore.getGuild(a0.guild.id);
const r31 = guild2 == null;
r7 = null;
if (!r31) {
const channel2 = getChannelAndRecipientsFromInvite(a0).channel;
const r39 = channel2 == null;
r7 = null;
if (!r39) {
const isGuildVocal = channel2.isGuildVocal();
r7 = null;
if (isGuildVocal) {
let channel3 = ChannelStore.getChannel(channel2.id);
if (channel3 == null) {
channel3 = channel2;
}
r7 = PermissionStore.canBasicChannel(BasicPermissions.VIEW_CHANNEL, channel3) ? {
guild: guild2,
channel: channel3
} : null;
}
}
}
}
if (r7 == null) {
return null;
}
let displayNameStylesEnabled;
const { guild, channel } = r7;
const embedThemeColors = getEmbedThemeColors(a1);
const { colors, baseColors } = embedThemeColors;
const guildIcon = guild.icon != null ? getAssetUriForEmbed(getGuildIconSource(guild, 128, false)) : void 0;
const voiceStatesForChannelAlt = SortedVoiceStateStore.getVoiceStatesForChannelAlt(channel.id, guild.id);
const r83 = [...voiceStatesForChannelAlt.filter((item) => item.voiceState.selfStream), ...voiceStatesForChannelAlt.filter((item) => !item.voiceState.selfStream)].slice(0, 10);
displayNameStylesEnabled = AccessibilityStore.displayNameStylesEnabled;
const voiceUsers = r83.map((item) => {
let member = item.member;
if (member == null) {
member = GuildMemberStore.getMember(guild.id, item.user.id);
}
const r24 = member?.avatar != null ? AvatarUtils.getGuildMemberAvatarURLSimple({
guildId: guild.id,
userId: item.user.id,
avatar: member.avatar,
size: 24
}) : AvatarUtils.getUserAvatarURL(item.user, false, 24);
let avatarUrl = r24;
if (typeof avatarUrl === "number") {
avatarUrl = getAssetUriForEmbed(r24);
}
let fontId = void 0;
if (displayNameStylesEnabled) {
let r46 = member == null ? void 0 : member.displayNameStyles?.fontId;
if (r46 == null) {
r46 = item.user.displayNameStyles?.fontId;
}
fontId = r46;
}
let nick = item.nick;
if (nick == null) {
nick = UserUtils.getName(item.user);
}
let selfStream = item.voiceState.selfStream;
if (selfStream == null) {
selfStream = false;
}
return {
userId: item.user.id,
displayName: nick,
avatarUrl,
isStreaming: selfStream,
fontId
};
});
let voiceStartTimestamp = VoiceChannelStartTimeStore.getStartTime(channel);
if (voiceStartTimestamp == null) {
voiceStartTimestamp = void 0;
}
const currentClientVoiceChannelId = VoiceStateStore.getCurrentClientVoiceChannelId(guild.id);
const id = channel.id;
let r101 = getEmbedScrollGradientBackground();
if (r101 == null) {
r101 = void 0;
}
let backgroundColor = processColor(r101);
if (backgroundColor == null) {
backgroundColor = baseColors.backgroundColor;
}
const r95 = {
...baseColors,
backgroundColor,
extendedType: CodedLinkExtendedType.VOICE_CHANNEL_LIST_INVITE,
headerColor: colors.headerColor,
guildName: guild.name,
guildIcon,
headerText: "",
titleText: computeChannelName(channel, UserStore, RelationshipStore)
};
const titleColor = voiceStatesForChannelAlt.length > 0 ? colors.voiceActiveColor : colors.voiceMutedColor;
const isConnected = currentClientVoiceChannelId === id;
r95.titleColor = titleColor;
r95.acceptLabelText = intl.string(t.gpqgah);
r95.acceptLabelColor = colors.acceptLabelGreenColor;
r95.acceptLabelBackgroundColor = colors.acceptLabelGreenBackgroundColor;
r95.canBeAccepted = GuestUtils.canAcceptInvite([GuildMemberStore], a0);
r95.embedCanBeTapped = true;
r95.type = InviteTypes.GUILD;
r95.voiceUsers = voiceUsers;
r95.voiceStartTimestamp = voiceStartTimestamp;
r95.emptyStateText = intl.string(t.zSqdrS);
r95.streamingLabel = intl.string(t.dI3q4h).toUpperCase();
r95.voiceHeaderBackgroundColor = colors.voiceHeaderBackgroundColor;
r95.reducedMotion = AccessibilityStore.useReducedMotion;
r95.isConnected = isConnected;
r95.privacyHintText = intl.string(t.fkg9mQ);
return r95;
}
@@ -0,0 +1,12 @@
// Metro module 9501 (f9502).
import { createChannelRecordFromInvite } from "../../../../../../../../records/ChannelRecord";
export default function getChannelAndRecipientsFromInvite(a0) {
const recipients_ = a0.channel != null && a0.channel.recipients != null ? a0.channel.recipients.slice() : [];
return {
recipients_,
channel: a0.channel != null ? createChannelRecordFromInvite({
...a0.channel,
recipients: recipients_
}) : null
};
};
@@ -0,0 +1,36 @@
// Metro module 12360 (f12361).
import { useMemo } from "react";
import EmbeddedActivitiesStore from "../../../../../../activities/EmbeddedActivitiesStore";
import UserStore from "../../../../../../../stores/UserStore";
import { isNotNullish } from "../../../../../../../utils/GlobalUtils";
import { useStateFromStoresArray } from "../../../../../../../_bundle/defaultAreStatesEqual";
export default function useEmbeddedActivityParticipantAvatarUris({ activity, guildId }) {
let stateFromStoresArray;
stateFromStoresArray = void 0;
const memo = useMemo(() => {
const r4 = Array;
let r7 = activity?.userIds;
if (r7 == null) {
r7 = [];
}
return r4.from(r7);
}, [activity]);
stateFromStoresArray = useStateFromStoresArray([UserStore], () => memo.map((item) => UserStore.getUser(item)), [memo]);
return useMemo(() => stateFromStoresArray.filter(isNotNullish).map((item) => `${item.getAvatarURL(guildId, 64)}`), [guildId, stateFromStoresArray]);
};
export function getEmbeddedActivityParticipantAvatarUris(a0) {
const { channelId, guildId: guildId2, applicationId } = a0;
let activity2 = a0.activity;
if (activity2 == null) {
activity2 = EmbeddedActivitiesStore.getEmbeddedActivitiesForChannel(channelId).find((item) => item.applicationId === applicationId);
}
const r16 = Array;
let r18 = activity2?.userIds;
if (r18 == null) {
r18 = [];
}
return r16.from(r18).map((item) => {
const user = UserStore.getUser(item);
return `${user == null ? void 0 : user.getAvatarURL(guildId2, 64)}`;
}).filter(isNotNullish);
}
@@ -0,0 +1,62 @@
// Metro module 7725 (f7726).
import { useMemo } from "react";
import { experimental_createToken, createNativeStyleProperties } from "../../../../../../design/components/Styles/native/createStyles";
import { isThemeDark } from "../../../../../../design/shared";
import Module712 from "../../../../../../_bundle/Module712";
import { hexWithOpacity } from "../../../../../../utils/ColorUtils";
let nativeStyleProperties;
const acceptLabelActiveBackgroundColor = experimental_createToken((a0) => isThemeDark(a0.theme) ? Module712.unsafe_rawColors.PRIMARY_500 : Module712.unsafe_rawColors.PRIMARY_400);
const acceptLabelDisabledBackgroundColor = experimental_createToken((a0) => isThemeDark(a0.theme) ? Module712.unsafe_rawColors.PRIMARY_600 : hexWithOpacity(Module712.unsafe_rawColors.PRIMARY_500, 0.3));
const acceptLabelDisabledBorderColor = experimental_createToken((a0) => isThemeDark(a0.theme) ? Module712.unsafe_rawColors.PRIMARY_500 : Module712.unsafe_rawColors.PRIMARY_400);
const acceptLabelDisabledTextColor = experimental_createToken((a0) => isThemeDark(a0.theme) ? Module712.unsafe_rawColors.PRIMARY_500 : Module712.unsafe_rawColors.PRIMARY_400);
const acceptLabelDisabledColor = experimental_createToken((a0) => isThemeDark(a0.theme) ? Module712.unsafe_rawColors.PRIMARY_500 : Module712.unsafe_rawColors.PRIMARY_100);
nativeStyleProperties = createNativeStyleProperties({
acceptBlurpleLabelBackgroundColor: Module712.colors.BACKGROUND_BRAND,
acceptLabelGreenBackgroundColor: Module712.colors.CONTROL_CONNECTED_BACKGROUND_DEFAULT,
acceptLabelGreenColor: Module712.unsafe_rawColors.WHITE,
backgroundColor: Module712.colors.MOBILE_EMBED_BACKGROUND_DEFAULT,
bodyTextColor: Module712.colors.TEXT_DEFAULT,
clearLabelRedBackgroundColor: Module712.unsafe_rawColors.RED_400,
clearLabelRedColor: Module712.unsafe_rawColors.WHITE,
headerColor: Module712.colors.TEXT_SUBTLE,
subtitleColor: Module712.colors.TEXT_SUBTLE,
titleColor: Module712.colors.MOBILE_TEXT_HEADING_PRIMARY,
acceptLabelActiveBackgroundColor,
acceptLabelDisabledBackgroundColor,
acceptLabelDisabledBorderColor,
acceptLabelDisabledTextColor,
acceptLabelDisabledColor,
borderColor: experimental_createToken((a0) => isThemeDark(a0.theme) ? hexWithOpacity(Module712.unsafe_rawColors.WHITE, 0.06) : hexWithOpacity(Module712.unsafe_rawColors.PRIMARY_860, 0.08)),
resolvingGradientEnd: experimental_createToken((a0) => isThemeDark(a0.theme) ? Module712.unsafe_rawColors.PRIMARY_600 : Module712.unsafe_rawColors.PRIMARY_100),
resolvingGradientStart: experimental_createToken((a0) => isThemeDark(a0.theme) ? "#666b73" : Module712.unsafe_rawColors.PRIMARY_300),
thumbnailBackgroundColor: experimental_createToken((a0) => isThemeDark(a0.theme) ? Module712.unsafe_rawColors.PRIMARY_600 : hexWithOpacity(Module712.unsafe_rawColors.PRIMARY_200, 0.3)),
voiceActiveColor: Module712.colors.TEXT_FEEDBACK_POSITIVE,
voiceHeaderBackgroundColor: Module712.colors.BACKGROUND_MOD_MUTED,
voiceMutedColor: Module712.colors.TEXT_MUTED
});
export default function getEmbedThemeColors(a0) {
const colors = nativeStyleProperties(a0);
return {
colors,
baseColors: {
borderColor: colors.borderColor,
backgroundColor: colors.backgroundColor,
thumbnailCornerRadius: 15,
headerColor: colors.headerColor
}
};
};
export function useEmbedThemeColors(a0) {
return useMemo(() => {
const colors = nativeStyleProperties(a0);
return {
colors,
baseColors: {
borderColor: colors.borderColor,
backgroundColor: colors.backgroundColor,
thumbnailCornerRadius: 15,
headerColor: colors.headerColor
}
};
}, [a0]);
}
@@ -0,0 +1,193 @@
// Metro module 8012 (f8013).
import { processColor } from "react-native";
import UserRecord from "../../../../../../records/UserRecord";
import ChannelStore from "../../../../../../stores/ChannelStore";
import UserStore from "../../../../../../stores/UserStore";
import { MessageTypes } from "../../../../../../Constants";
import { ensureAvatarSource } from "../../../../../../utils/native/AvatarUtils";
import AvatarUtils2 from "../../../../../../utils/AvatarUtils";
import { getUserAuthor } from "../../../../useMessageAuthor";
import * as _ApplicationInteractionInfoUtils from "../../../../../applications/ApplicationInteractionInfoUtils";
import Module712 from "../../../../../../_bundle/Module712";
import { getInitialInteractionMetadata } from "../../../../../application_commands/ApplicationCommandUtils";
import { InteractionTypes } from "../../../../../../flow/Server";
import * as _EnhancedRoleColorUtils from "../../../../../premium/enhanced_role_colors/native/EnhancedRoleColorUtils";
import { processColorStrings } from "../../../../../premium/enhanced_role_colors/native/EnhancedRoleColorUtils";
import { isActivitiesInTextEnabled } from "../../../../../activities/ActivitiesInTextUtils";
import { intl, t } from "../../../../../../intl/index.native";
import { formatPrimaryEntryPointCommandName } from "../../../../../app_launcher/utils/AppLauncherUtils";
export function createExecutedCommand(a0, a1, a2, a3, a4) {
let r202, SSrolr, commandNameOnClick, content;
const r4 = a0.activityInstance != null && a0.activityInstance !== void 0;
L5: {
if (a0.interaction != null) {
if (a0.interaction.displayName === "" && !r4) {
break L5;
}
const user = UserStore.getUser(a0.interaction?.user?.id);
const r44 = user != null;
let avatarURL = void 0;
if (r44) {
const guildMemberAvatar = getUserAuthor(user, a1 == null ? ChannelStore.getChannel(a0.getChannelId()) : a1).guildMemberAvatar;
const guildId = a1 == null ? void 0 : a1.getGuildId();
avatarURL = ensureAvatarSource(guildMemberAvatar != null && guildId != null ? AvatarUtils2.getGuildMemberAvatarSource({
userId: user.id,
avatar: guildMemberAvatar,
guildId
}, user) : user.getAvatarSource(void 0)).uri;
}
const r3 = a0.type === MessageTypes.CHAT_INPUT_COMMAND || a0.type === MessageTypes.INTERACTION_PREMIUM_UPSELL;
const isPrimaryEntryPointCommandMessage = _ApplicationInteractionInfoUtils.isPrimaryEntryPointCommandMessage(a0);
const userAuthor = getUserAuthor(a0.interaction.user, a1);
const { colorString: colorString2, colorStrings: colorStrings2 } = userAuthor;
const displayName = a0.interaction.displayName;
const r94 = Module712.internal.resolveSemanticColor(a3, Module712.colors.MENTION_BACKGROUND);
const initialInteractionMetadata = getInitialInteractionMetadata(a0);
const r105 = initialInteractionMetadata?.type === InteractionTypes.APPLICATION_COMMAND ? initialInteractionMetadata.target_user != null ? new UserRecord(initialInteractionMetadata.target_user) : null : null;
const userAuthor2 = getUserAuthor(r105, a1);
const { colorString, colorStrings } = userAuthor2;
const r118 = a2 === "username";
let linkColor = a4;
if (r118) {
let r123 = processColor(colorString == null ? void 0 : colorString);
if (r123 == null) {
r123 = a4;
}
linkColor = r123;
}
let linkColor2 = a4;
if (r118) {
let r127 = processColor(colorString2 == null ? void 0 : colorString2);
if (r127 == null) {
r127 = a4;
}
linkColor2 = r127;
}
const r129 = a1 == null ? void 0 : a1.getGuildId();
const id = a0.interaction.user.id;
const isNativeMessageEligibleForEnhancedRoleColors = _EnhancedRoleColorUtils.isNativeMessageEligibleForEnhancedRoleColors(r129, id);
const isNativeMessageEligibleForEnhancedRoleColors2 = _EnhancedRoleColorUtils.isNativeMessageEligibleForEnhancedRoleColors(r129, r105?.id);
const roleColors = isNativeMessageEligibleForEnhancedRoleColors ? processColorStrings(colorStrings2) : null;
const roleColors2 = isNativeMessageEligibleForEnhancedRoleColors2 ? processColorStrings(colorStrings) : null;
const r157 = {
username: getUserAuthor(a0.interaction.user, a1).nick,
usernameOnClick: null
};
let r161 = colorString2;
if (r161 == null) {
r161 = void 0;
}
let roleColor = processColor(r161);
if (roleColor == null) {
roleColor = null;
}
const usernameOnClick = {
name: "usernameOnClick",
action: "bindUserMenu",
userId: id,
messageChannelId: a0.channel_id,
linkColor: linkColor2,
roleColor,
roleColors,
shouldShowRoleDot: null
};
let shouldShowRoleDot2 = a2 === "dot";
const shouldShowRoleDot = shouldShowRoleDot2 ? colorString2 != null : shouldShowRoleDot2;
L76: {
usernameOnClick.shouldShowRoleDot = shouldShowRoleDot;
r157.usernameOnClick = usernameOnClick;
if (r4 && !isPrimaryEntryPointCommandMessage) {
if (isActivitiesInTextEnabled(a1)) {
content = intl.formatToParts(t["R/mrBi"], {
...r157,
activityTextOnClick: {
action: "bindTapActivityText",
applicationUserId: a0.author.id,
messageChannelId: a0.channel_id
}
});
break L76;
}
content = intl.formatToParts(t.k964Wm, {
...r157
});
} else {
const commandName = isPrimaryEntryPointCommandMessage ? formatPrimaryEntryPointCommandName(displayName) : displayName;
L66: {
L64: {
SSrolr = t.SSrolr;
r202 = {
...r157,
commandName
};
if (a1 != null) {
if (!r3 && !isPrimaryEntryPointCommandMessage) {
break L64;
}
commandNameOnClick = {
name: "commandNameOnClick",
action: "bindTapCommandName",
userId: a0.interaction.user.id,
messageId: a0.id,
applicationUserId: a0.author.id,
messageType: a0.type,
messageChannelId: a0.channel_id
};
break L66;
}
}
commandNameOnClick = {};
}
r202.commandNameOnClick = commandNameOnClick;
content = intl.formatToParts(SSrolr, r202);
if (r105 != null) {
const mqKdCM = t.mqKdCM;
const r224 = {
...r157,
commandName,
commandNameOnClick: {},
targetUsername: getUserAuthor(r105, a1).nick
};
const id2 = r105?.id;
let r238 = colorString;
if (r238 == null) {
r238 = void 0;
}
let roleColor2 = processColor(r238);
if (roleColor2 == null) {
roleColor2 = null;
}
if (shouldShowRoleDot2) {
shouldShowRoleDot2 = colorString != null;
}
r224.targetUsernameOnClick = {
name: "targetUsernameOnClick",
action: "bindUserMenu",
userId: id2,
messageChannelId: a0.channel_id,
linkColor,
roleColor: roleColor2,
roleColors: roleColors2,
shouldShowRoleDot: shouldShowRoleDot2
};
content = intl.formatToParts(mqKdCM, r224);
}
}
}
return {
userId: a0.interaction.user.id,
username: r157.username,
usernameColor: linkColor2,
avatarURL,
targetUsernameColor: linkColor,
content,
commandNameBackgroundStyles: {
color: processColor(r94),
borderRadius: 4,
spaceAround: true
},
showAppsIcon: true
};
}
}
}
@@ -0,0 +1,50 @@
// Metro module 7992 (f7993).
import { getInteractionStatusViewState, InteractionStatusViewState } from "../../../../../interactions/InteractionUtils";
import { intl, t } from "../../../../../../intl/index.native";
let c5057_2 = {
LOADING: 0,
0: "LOADING",
FAILED: 1,
1: "FAILED",
EPHEMERAL_SUCCESS: 999,
999: "EPHEMERAL_SUCCESS"
};
export function createInteractionStatus(a0, a1) {
const interactionStatusViewState = getInteractionStatusViewState(a0, a1);
if (InteractionStatusViewState.SENDING === interactionStatusViewState) {
return {
text: intl.string(t.RiLfBY),
state: c5057_2.LOADING
};
}
if (InteractionStatusViewState.CREATED === interactionStatusViewState) {
return {
text: intl.formatToPlainString(t["7ePV4t"], {
applicationName: a0.author.username
}),
state: c5057_2.LOADING
};
}
if (InteractionStatusViewState.TIMED_OUT === interactionStatusViewState) {
return {
text: intl.string(t.h8hzPd),
state: c5057_2.FAILED
};
}
if (InteractionStatusViewState.FAILED === interactionStatusViewState) {
let interactionError = a0.interactionError;
if (interactionError == null) {
interactionError = intl.string(t.VCsUJu);
}
return {
text: interactionError,
state: c5057_2.FAILED
};
}
if (InteractionStatusViewState.EPHEMERAL_SUCCESS === interactionStatusViewState) {
return {
text: "",
state: c5057_2.EPHEMERAL_SUCCESS
};
}
}
@@ -0,0 +1,43 @@
// Metro module 7716 (f7717).
import { SeparatorAction } from "../RowGeneratorConstants";
import { UNSAFE_Colors } from "../../../../../_bundle/Module505";
import { memoize } from "../../../../../_bundle/Module12";
import { isThemeDark } from "../../../../../design/shared";
import Module712 from "../../../../../_bundle/Module712";
import { hexWithOpacity } from "../../../../../utils/ColorUtils";
import { processColorOrThrow } from "../RowGeneratorStyleSheet";
let c4849_5 = memoize((a0) => {
const r9 = isThemeDark(a0) ? Module712.unsafe_rawColors.PRIMARY_700 : "#DBE0E4";
const r8 = isThemeDark(a0) ? Module712.unsafe_rawColors.PRIMARY_630 : "#FAFAFA";
const r30 = isThemeDark(a0) ? hexWithOpacity(Module712.unsafe_rawColors.PRIMARY_300, 0.6) : UNSAFE_Colors.GREY1;
return {
borderColor: processColorOrThrow(r9),
backgroundColor: processColorOrThrow(r8),
color: processColorOrThrow(r30)
};
});
export function generateBlockedGroupRowData(a0, a1, c15997_0) {
const { changeType, message, content, text, revealed } = a0;
let context = a0.context;
const rowType = a0.rowType;
const canUncollapse = !("canUncollapse" in a0) || a0.canUncollapse;
const r18 = {
...c4849_5(a1),
type: rowType,
content: content.map((item) => c15997_0.generate(item))
};
if (context == null) {
context = message.id;
}
r18.button = {
action: {
type: SeparatorAction.TOGGLE_BLOCKED_MESSAGES,
context
}
};
r18.changeType = changeType;
r18.text = text;
r18.revealed = revealed;
r18.canUncollapse = canUncollapse;
return r18;
}
@@ -0,0 +1,27 @@
// Metro module 12394 (f12395).
import { LoadingType, RowType, SeparatorAction } from "../RowGeneratorConstants";
import { createNativeStyleProperties } from "../../../../../design/components/Styles/native/createStyles";
import Module712 from "../../../../../_bundle/Module712";
const nativeStyleProperties = createNativeStyleProperties({
loadButtonBackgroundColor: Module712.colors.CONTROL_SECONDARY_BACKGROUND_DEFAULT,
loadButtonColor: Module712.colors.CONTROL_SECONDARY_TEXT_DEFAULT,
loadingColor: Module712.colors.ICON_SUBTLE
});
export function generateLoadingRowData({ rowType, changeType, text, isLoading }, a1) {
const r10 = nativeStyleProperties(a1);
return {
type: RowType.LOADING,
id: rowType,
button: {
action: {
type: rowType === LoadingType.LOAD_BEFORE ? SeparatorAction.LOAD_MORE_BEFORE : SeparatorAction.LOAD_MORE_AFTER
},
backgroundColor: r10.loadButtonBackgroundColor,
cornerRadius: 4,
text
},
color: isLoading ? r10.loadingColor : r10.loadButtonColor,
changeType,
isLoading
};
}
@@ -0,0 +1,49 @@
// Metro module 12393 (f12394).
import { RowType, SeparatorType } from "../RowGeneratorConstants";
import { createNativeStyleProperties } from "../../../../../design/components/Styles/native/createStyles";
import Module712 from "../../../../../_bundle/Module712";
import { isMobileVisualRefreshEnabled } from "../../../../themes/experiments/MobileVisualRefreshExperiment";
import { assertNever } from "../../../../../utils/GlobalUtils";
const nativeStyleProperties = createNativeStyleProperties({
dayColor: Module712.colors.TEXT_MUTED,
unreadTextColor: Module712.colors.MOBILE_CHAT_NEW_MESSAGE_TEXT,
unreadBorderColor: Module712.colors.MOBILE_CHAT_NEW_MESSAGE_BORDER,
summaryColor: Module712.colors.TEXT_BRAND
});
export function generateSeparatorRowData(a0, a1) {
const { rowType, changeType } = a0;
const r11 = nativeStyleProperties(a1);
if (SeparatorType.DAY === rowType) {
return {
type: RowType.SEPARATOR,
id: rowType,
color: r11.dayColor,
text: a0.text,
changeType
};
}
if (SeparatorType.UNREAD === rowType) {
const text = a0.text;
return {
type: RowType.SEPARATOR,
id: rowType,
color: r11.unreadTextColor,
borderColor: isMobileVisualRefreshEnabled("Separator") ? r11.unreadBorderColor : void 0,
changeType,
text
};
}
if (SeparatorType.SUMMARY === rowType) {
const summary = a0.summary;
return {
type: RowType.SEPARATOR,
id: rowType,
color: r11.summaryColor,
text: summary.topic,
summary,
isBeforeContent: a0.isBeforeContent,
changeType
};
}
assertNever(rowType);
}
@@ -0,0 +1,17 @@
// Metro module 7885 (f7886).
export function sanitizeMediaDimension(a0) {
let r7;
L4: {
if (typeof a0 === "number") {
const isFinite2 = Number.isFinite(a0);
r7 = 0;
if (!isFinite2) {
break L4;
}
r7 = a0 < 0 ? 0 : a0;
} else {
r7 = a0;
}
}
return r7;
}
@@ -0,0 +1,36 @@
// Metro module 7742 (f7743).
import { THREAD_CHANNEL_TYPES } from "../../../../../records/ChannelRecord";
import ChannelStore from "../../../../../stores/ChannelStore";
import UserStore from "../../../../../stores/UserStore";
import { getMessageAuthorWithProcessedColor, getUserAuthorWithProcessedColor } from "./useAuthorWithProcessedColor";
import formatUsernameOnClick from "./formatUsernameOnClick";
import { intl, t } from "../../../../../intl/index.native";
import createCommonMessage from "./createCommonMessage";
export function createAddRecipientSystemMessage(a0) {
const { message, roleStyle } = a0;
const userId = message.mentions[0];
const user = UserStore.getUser(userId);
const channel = ChannelStore.getChannel(message.channel_id);
const r19 = channel != null && THREAD_CHANNEL_TYPES.has(channel.type);
const messageAuthorWithProcessedColor = getMessageAuthorWithProcessedColor(message);
const userAuthorWithProcessedColor = getUserAuthorWithProcessedColor(user, channel);
const r32 = {
username: messageAuthorWithProcessedColor.nick,
usernameOnClick: formatUsernameOnClick({
message,
author: messageAuthorWithProcessedColor,
roleStyle
}),
otherUsername: userAuthorWithProcessedColor.nick,
otherUsernameOnClick: formatUsernameOnClick({
userId,
message,
author: userAuthorWithProcessedColor,
roleStyle
})
};
return {
content: r19 ? intl.formatToParts(t.Vej1Nw, r32) : intl.formatToParts(t["7/Xl0S"], r32),
...createCommonMessage(a0)
};
}
@@ -0,0 +1,30 @@
// Metro module 7791 (f7792).
import { MessageTypes } from "../../../../../Constants";
import { COMMAND_SENTINEL } from "../../../../channel_autocomplete/ChannelAutocompleteConstants";
import { getApplicationCommand } from "../../../ApplicationCommands";
import { getMessageAuthorWithProcessedColor } from "./useAuthorWithProcessedColor";
import { intl, t } from "../../../../../intl/index.native";
import formatUsernameOnClick from "./formatUsernameOnClick";
import createCommonMessage from "./createCommonMessage";
export function createApplicationCommandSourceSystemMessage(a0) {
const { message, roleStyle } = a0;
const applicationCommand = getApplicationCommand(message.content);
const name = message.application?.name;
if (applicationCommand != null && name != null) {
const messageAuthorWithProcessedColor = getMessageAuthorWithProcessedColor(message);
return {
content: intl.formatToParts(t["1Zm+zw"], {
username: messageAuthorWithProcessedColor.nick,
usernameOnClick: formatUsernameOnClick({
message,
author: messageAuthorWithProcessedColor,
roleStyle
}),
commandName: message.type === MessageTypes.CHAT_INPUT_COMMAND ? `${COMMAND_SENTINEL}${applicationCommand.name}` : applicationCommand.name,
applicationName: name
}),
...createCommonMessage(a0)
};
}
return null;
}
@@ -0,0 +1,21 @@
// Metro module 7812 (f7813).
import { getMessageAuthorWithProcessedColor } from "./useAuthorWithProcessedColor";
import { getApplicationSubscriptionSystemMessageASTContent } from "../../../../premium_apps/ApplicationSubscriptionSystemMessageUtils";
import formatUsernameOnClick from "./formatUsernameOnClick";
import createCommonMessage from "./createCommonMessage";
export function createApplicationSubscriptionPurchaseSystemMessage(a0) {
const { message, roleStyle } = a0;
const messageAuthorWithProcessedColor = getMessageAuthorWithProcessedColor(message);
return {
content: getApplicationSubscriptionSystemMessageASTContent({
application: message.application,
username: messageAuthorWithProcessedColor.nick,
usernameOnClick: formatUsernameOnClick({
message,
author: messageAuthorWithProcessedColor,
roleStyle
})
}),
...createCommonMessage(a0)
};
}
@@ -0,0 +1,247 @@
// Metro module 7795 (f7796).
import { Image as Image2, processColor } from "react-native";
import ChannelStore from "../../../../../stores/ChannelStore";
import GuildMemberStore from "../../../../../stores/GuildMemberStore";
import PermissionStore from "../../../../../stores/PermissionStore";
import RelationshipStore from "../../../../../stores/RelationshipStore";
import UserStore from "../../../../../stores/UserStore";
import { Permissions } from "../../../../../Constants";
import { memoize } from "../../../../../_bundle/Module12";
import { isThemeDark } from "../../../../../design/shared";
import Module712 from "../../../../../_bundle/Module712";
import { processColorOrThrow } from "../RowGeneratorStyleSheet";
import * as _AutomodMessageUtils from "../../../../guild_automod/AutomodMessageUtils";
import { isAutomodMessageRecord, extractAutomodMessageFields, getActionHeaderTextMobile, extractAutomodNotificationFields, IS_BACKWARDS_COMPAT_RAID_TYPE, getUserIdOfAutomodAction, getRaidAlertResolveCTAText, getQuarantineReasonString } from "../../../../guild_automod/AutomodMessageUtils";
import { getMessageAuthor } from "../../../useMessageAuthor";
import { intl, t } from "../../../../../intl/index.native";
import { AutomodNotificationEmbedTypeKeys } from "../../../../../_bundle/Module7772";
import Module3771 from "../../../../../_bundle/Module3771";
import { AutomodRaidAlertTypes } from "../../../../../_bundle/Module7796";
import { DATE_CONFIG } from "../../../../guild_antiraid/GuildAntiRaidUtils";
import { makeSource, getGuildMemberAvatarSource } from "../../../../../utils/AvatarUtils";
import Module7800 from "../../../../../_bundle/Module7800";
import Module6732 from "../../../../../_bundle/Module6732";
import { ensureAvatarSource, getAutomodAvatarURL } from "../../../../../utils/native/AvatarUtils";
import Module7801 from "../../../../../_bundle/Module7801";
import { getRoleIcon } from "../../../../guild_boosting/native/RoleIconUtils";
import createCommonMessage from "./createCommonMessage";
import { computeChannelName } from "../../../../channel/useChannelName";
import { isMemberCommunicationDisabled } from "../../../../guild_communication_disabled/CommunicationDisabledUtils";
import { accessibilityLabelCalendarFormat } from "../../../../../utils/DateUtils";
import Module7802 from "../../../../../_bundle/Module7802";
import Module7803 from "../../../../../_bundle/Module7803";
let c4914_11 = memoize((a0) => ({
defaultUsernameColor: processColorOrThrow(isThemeDark(a0) ? Module712.unsafe_rawColors.WHITE : Module712.unsafe_rawColors.PRIMARY_630)
}));
export function createAutoModerationActionSystemMessage(a0) {
let r27, author, colorString, feedbackText, guildMemberAvatar, headerText, iconRoleId, isAutomodNotification, nick, notification;
const { message, theme, roleStyle } = a0;
const defaultUsernameColor = c4914_11(theme).defaultUsernameColor;
if (isAutomodMessageRecord(message)) {
const r54 = extractAutomodMessageFields(message);
const { ruleName, keyword, embedChannel, content } = r54;
let flaggedMessageId = r54.flaggedMessageId;
const { embedChannelId, quarantineType, interactionUserId } = r54;
const channel = ChannelStore.getChannel(message.getChannelId());
const guildId = channel == null ? void 0 : channel.getGuildId();
L49: {
const messageAuthor = getMessageAuthor(message);
nick = messageAuthor.nick;
guildMemberAvatar = messageAuthor.guildMemberAvatar;
colorString = messageAuthor.colorString;
iconRoleId = messageAuthor.iconRoleId;
author = message.author;
r27 = PermissionStore.can(Permissions.VIEW_CHANNEL, embedChannel);
headerText = getActionHeaderTextMobile(message, author, interactionUserId);
const r15 = intl.string(t["94JbM3"]);
isAutomodNotification = _AutomodMessageUtils.isAutomodNotification(message);
notification = null;
feedbackText = r15;
if (isAutomodNotification) {
const r88 = extractAutomodNotificationFields(message);
const notificationType = r88.notificationType;
if (IS_BACKWARDS_COMPAT_RAID_TYPE !== notificationType && AutomodNotificationEmbedTypeKeys.RAID !== notificationType) {
if (AutomodNotificationEmbedTypeKeys.MENTION_RAID === notificationType) {
const r271 = {
subtitleLeft: r88.raidDatetime != null ? Module3771(r88.raidDatetime).fromNow() : void 0,
header: intl.string(t.C2uIXE),
headerColor: processColorOrThrow(Module712.internal.resolveSemanticColor(theme, Module712.colors.TEXT_FEEDBACK_CRITICAL)),
headerIconURL: Image2.resolveAssetSource(makeSource(Module6732)).uri,
headerIconColor: processColorOrThrow(Module712.internal.resolveSemanticColor(theme, Module712.colors.TEXT_FEEDBACK_CRITICAL)),
body: intl.string(t.SWIWEV),
shouldShowActions: false
};
headerText = "";
notification = r271;
feedbackText = r15;
break L49;
}
if (AutomodNotificationEmbedTypeKeys.ACTIVITY_ALERTS_ENABLED === notificationType) {
const userIdOfAutomodAction = getUserIdOfAutomodAction(message);
const user = UserStore.getUser(userIdOfAutomodAction);
const r163 = userIdOfAutomodAction != null ? guildId != null ? GuildMemberStore.getMember(guildId, userIdOfAutomodAction) : null : null;
let enabledByUsername = r163?.nick;
if (enabledByUsername == null) {
enabledByUsername = user?.username;
}
const r184 = ensureAvatarSource(r163?.avatar != null && guildId != null ? getGuildMemberAvatarSource({
userId: author.id,
avatar: r163?.avatar,
guildId
}, author) : author.getAvatarSource(void 0, false, 16));
const r194 = {
header: intl.string(t.lVLiFp),
headerColor: processColorOrThrow(Module712.internal.resolveSemanticColor(theme, Module712.colors.TEXT_FEEDBACK_POSITIVE)),
headerIconURL: Image2.resolveAssetSource(makeSource(Module7801)).uri,
headerIconColor: processColorOrThrow(Module712.internal.resolveSemanticColor(theme, Module712.colors.TEXT_FEEDBACK_POSITIVE)),
body: intl.string(t["QV/8u5"]),
shouldShowActions: false,
subtitleRight: Module3771(message.timestamp).fromNow(),
subtitleLeft: intl.string(t.qlFrXW),
enabledByAvatarURL: r184.uri,
enabledByUsername,
enabledByColor: r163?.colorString != null ? processColor(r163.colorString) : void 0
};
headerText = "";
notification = r194;
feedbackText = r15;
break L49;
}
const r111 = {
header: intl.string(t.VdZCcC),
headerColor: processColorOrThrow(Module712.internal.resolveSemanticColor(theme, Module712.colors.TEXT_SUBTLE)),
headerIconURL: Image2.resolveAssetSource(makeSource(Module6732)).uri,
headerIconColor: processColorOrThrow(Module712.internal.resolveSemanticColor(theme, Module712.colors.TEXT_SUBTLE)),
body: intl.string(t["NxHYX/"]),
shouldShowActions: false
};
headerText = "";
notification = r111;
feedbackText = r15;
break L49;
}
const subtitleRight = r88.raidDatetime != null ? Module3771(r88.raidDatetime).fromNow() : void 0;
const raidType = r88.raidType;
const DM_RAID = AutomodRaidAlertTypes.DM_RAID;
const dateTime = r88.raidDatetime != null ? new Date(r88.raidDatetime).toLocaleString(intl.currentLocale, DATE_CONFIG) : "";
const r357 = raidType === DM_RAID;
const subtitleLeft = r357 ? intl.formatToPlainString(t["5C8Mh3"], {
dmsSent: r88.dmsSent
}) : intl.formatToPlainString(t["4ylIiu"], {
joinCount: r88.joinAttempts
});
const r372 = {
subtitleLeft,
severity: subtitleLeft,
subtitleRight,
startTime: subtitleRight,
header: r357 ? intl.string(t["8+lHUb"]) : intl.string(t.xMwcwV),
headerColor: processColorOrThrow(Module712.internal.resolveSemanticColor(theme, Module712.colors.TEXT_FEEDBACK_CRITICAL)),
headerIconURL: Image2.resolveAssetSource(makeSource(r357 ? Module7800 : Module6732)).uri,
headerIconColor: processColorOrThrow(Module712.internal.resolveSemanticColor(theme, Module712.colors.TEXT_FEEDBACK_CRITICAL)),
body: intl.formatToPlainString(t["4QIIZl"], {
dateTime
}),
shouldShowActions: true
};
headerText = intl.string(t.ufawcw);
feedbackText = getRaidAlertResolveCTAText(r88.resolvedReason);
notification = r372;
}
}
const avatarURL = guildId != null ? ensureAvatarSource(guildMemberAvatar != null && guildId != null ? getGuildMemberAvatarSource({
userId: author.id,
avatar: guildMemberAvatar,
guildId
}, author) : author.getAvatarSource(void 0)).uri : null;
const r456 = guildId != null ? GuildMemberStore.getMember(guildId, author.id) : null;
const roleIcon = iconRoleId != null ? guildId != null ? getRoleIcon({
guildId,
roleId: iconRoleId,
size: 18
}) : void 0 : void 0;
const r467 = {
...createCommonMessage(a0),
roleIcon,
authorId: author.id,
username: intl.string(t.hG1StD),
avatarURL: ensureAvatarSource(makeSource(getAutomodAvatarURL())).uri,
colorString: processColor(colorString == null ? void 0 : colorString)
};
const autoModerationContext = {
headerText,
headerBadgeText: intl.string(t["70CJbT"]),
keywordDisplayText: keyword != null ? intl.formatToPlainString(t.SYIUTR, {
keyword
}) : "",
message: null,
notification: null,
ruleDisplayText: null,
reasonDisplayText: null,
actionsIconURL: null,
actionsText: null,
feedbackText: null
};
if (flaggedMessageId == null) {
flaggedMessageId = message.id;
}
let channelId = embedChannel?.id;
if (channelId == null) {
channelId = embedChannelId;
}
if (channelId == null) {
channelId = message.channel_id;
}
const channelName = r27 ? quarantineType == null ? embedChannel != null ? computeChannelName(embedChannel, UserStore, RelationshipStore) : void 0 : void 0 : void 0;
let usernameColor = defaultUsernameColor;
if (roleStyle === "username") {
let r535 = processColor(colorString == null ? void 0 : colorString);
if (r535 == null) {
r535 = defaultUsernameColor;
}
usernameColor = r535;
}
const message2 = {
id: flaggedMessageId,
channelId,
guildId,
userId: author.id,
channelName,
username: nick,
usernameColor,
roleColor: processColor(colorString == null ? void 0 : colorString),
shouldShowRoleDot: roleStyle === "dot" && colorString != null,
colorString: null,
avatarURL: null,
content: null,
communicationDisabled: null,
timestamp: null
};
if (colorString == null) {
colorString = void 0;
}
let colorString2 = processColor(colorString);
if (colorString2 == null) {
colorString2 = defaultUsernameColor;
}
message2.colorString = colorString2;
message2.avatarURL = avatarURL;
message2.content = content;
message2.communicationDisabled = isMemberCommunicationDisabled(r456);
message2.timestamp = accessibilityLabelCalendarFormat(message.timestamp);
autoModerationContext.message = message2;
autoModerationContext.notification = notification;
autoModerationContext.ruleDisplayText = intl.formatToPlainString(t.ZoOyKB, {
ruleName
});
autoModerationContext.reasonDisplayText = quarantineType != null ? intl.formatToPlainString(t["26bB2M"], {
reason: getQuarantineReasonString(quarantineType)
}) : null;
autoModerationContext.actionsIconURL = Image2.resolveAssetSource(makeSource(isAutomodNotification ? Module7802 : Module7803)).uri;
autoModerationContext.actionsText = isAutomodNotification ? intl.string(t.UgXhdn) : intl.string(t.DEoVWZ);
autoModerationContext.feedbackText = feedbackText;
r467.autoModerationContext = autoModerationContext;
return r467;
}
return null;
}
@@ -0,0 +1,58 @@
// Metro module 7760 (f7761).
import ChannelRTCStore from "../../../../calls/ChannelRTCStore";
import AuthenticationStore from "../../../../../stores/AuthenticationStore";
import VoiceStateStore from "../../../../../stores/VoiceStateStore";
import { ME } from "../../../../../Constants";
import { ParticipantTypes } from "../../../../calls/CallConstants";
import getHumanizedCallDuration from "../../../getHumanizedCallDuration";
import { checkIsCallActive } from "../../../../calls/mobile/useIsCallActive";
import { intl, t } from "../../../../../intl/index.native";
import { ensureAvatarSource } from "../../../../../utils/native/AvatarUtils";
import { calendarFormat } from "../../../../../utils/DateUtils";
import createCommonMessage from "./createCommonMessage";
export function createCallSystemMessage(a0) {
let r76, r78, avatarURLs, description, title;
const message = a0.message;
const id = AuthenticationStore.getId();
const channelId = message.getChannelId();
const call = message.call;
const userVoiceChannelId = VoiceStateStore.getUserVoiceChannelId(ME, id);
const humanizedCallDuration = getHumanizedCallDuration(message);
const participants = ChannelRTCStore.getParticipants(channelId);
const isCallActive = checkIsCallActive(channelId, message.id);
const missed = (isCallActive ? !isCallActive : call != null) && call.participants.indexOf(id) === -1;
if (isCallActive) {
L16: {
r76 = intl.string(t["NGg/fm"]);
r78 = "";
if (isCallActive) {
if (userVoiceChannelId != null) {
r78 = "";
if (userVoiceChannelId === channelId) {
break L16;
}
}
r78 = intl.string(t.DqA3mi);
}
}
avatarURLs = participants.filter((participant) => participant.type === ParticipantTypes.USER && !participant.ringing).map((item) => ensureAvatarSource(item.user.getAvatarSource(void 0)).uri);
description = r78;
title = r76;
} else {
title = missed ? intl.string(t["2CnhoI"]) : intl.string(t.v05Xd6);
description = humanizedCallDuration != null ? intl.formatToPlainString(t.SBDnp1, {
duration: humanizedCallDuration,
timestamp: calendarFormat(message.timestamp)
}) : calendarFormat(message.timestamp);
avatarURLs = [ensureAvatarSource(message.author.getAvatarSource(void 0)).uri];
}
return {
title,
description,
isCallActive,
missed,
avatarURLs,
rawMilliseconds: message.timestamp.valueOf(),
...createCommonMessage(a0)
};
}
@@ -0,0 +1,61 @@
// Metro module 7764 (f7765).
import ChannelStore from "../../../../../stores/ChannelStore";
import resolveMessageContentColors from "../resolveMessageContentColors";
import { getMessageAuthorWithProcessedColor } from "./useAuthorWithProcessedColor";
import formatUsernameOnClick from "./formatUsernameOnClick";
import createCommonMessage from "./createCommonMessage";
import { intl, t } from "../../../../../intl/index.native";
import { MessageAccessibilityAction } from "../../MessageAccessibilityActions";
import { HermesBuiltin } from "../../../../../_hermes/prelude";
export function createChangeChannelIconSystemMessage(a0) {
const { message, theme, roleStyle } = a0;
const r13 = resolveMessageContentColors(theme);
const messageAuthorWithProcessedColor = getMessageAuthorWithProcessedColor(message);
const usernameOnClick = formatUsernameOnClick({
message,
author: messageAuthorWithProcessedColor,
roleStyle
});
const channel = ChannelStore.getChannel(message.channel_id);
const r3 = channel == null;
let r32 = void 0;
if (!r3) {
const isGroupDM = channel.isGroupDM;
r32 = isGroupDM == null ? void 0 : isGroupDM.call(channel);
}
if (r32 == null) {
r32 = false;
}
const commonMessage = createCommonMessage(a0);
const r54 = {
content: r32 ? intl.formatToParts(t.hfeYXC, {
username: messageAuthorWithProcessedColor.nick,
usernameOnClick,
onEditGroup: {
action: "bindOpenGdmCustomizeActionSheet",
linkColor: r13?.linkColor,
messageChannelId: message.channel_id,
medium: true
}
}) : intl.formatToParts(t.wypJZ0, {
username: messageAuthorWithProcessedColor.nick,
usernameOnClick
}),
...commonMessage
};
let r56 = void 0;
if (r32) {
let accessibilityActions = commonMessage.accessibilityActions;
if (accessibilityActions == null) {
accessibilityActions = [];
}
r56 = {
accessibilityActions: [...accessibilityActions, {
label: intl.string(t["5Q9+/L"]),
name: MessageAccessibilityAction.EDIT_GDM
}]
};
}
HermesBuiltin.copyDataProperties(r54, r56);
return r54;
}
@@ -0,0 +1,63 @@
// Metro module 7763 (f7764).
import ChannelStore from "../../../../../stores/ChannelStore";
import resolveMessageContentColors from "../resolveMessageContentColors";
import { getMessageAuthorWithProcessedColor } from "./useAuthorWithProcessedColor";
import formatUsernameOnClick from "./formatUsernameOnClick";
import { t, intl } from "../../../../../intl/index.native";
import createCommonMessage from "./createCommonMessage";
import { MessageAccessibilityAction } from "../../MessageAccessibilityActions";
import { HermesBuiltin } from "../../../../../_hermes/prelude";
export function createChangeChannelNameSystemMessage(a0) {
const { message, theme, roleStyle } = a0;
const r13 = resolveMessageContentColors(theme);
const messageAuthorWithProcessedColor = getMessageAuthorWithProcessedColor(message);
const usernameOnClick = formatUsernameOnClick({
message,
author: messageAuthorWithProcessedColor,
roleStyle
});
const channel = ChannelStore.getChannel(message.channel_id);
const r3 = channel == null;
let r32 = void 0;
if (!r3) {
const isGroupDM = channel.isGroupDM;
r32 = isGroupDM == null ? void 0 : isGroupDM.call(channel);
}
if (r32 == null) {
r32 = false;
}
const r12 = message.content === "" ? t.hToFyf : t.rk0be9;
const commonMessage = createCommonMessage(a0);
const r65 = {
content: r32 ? intl.formatToParts(r12, {
username: messageAuthorWithProcessedColor.nick,
usernameOnClick,
channelName: message.content,
onEditGroup: {
action: "bindOpenGdmCustomizeActionSheet",
linkColor: r13?.linkColor,
messageChannelId: message.channel_id
}
}) : intl.formatToParts(a0.isForumPost ? t["qa0e/n"] : t.XCPMEG, {
username: messageAuthorWithProcessedColor.nick,
usernameOnClick,
channelName: message.content
}),
...commonMessage
};
let r67 = void 0;
if (r32) {
let accessibilityActions = commonMessage.accessibilityActions;
if (accessibilityActions == null) {
accessibilityActions = [];
}
r67 = {
accessibilityActions: [...accessibilityActions, {
label: intl.string(t["5Q9+/L"]),
name: MessageAccessibilityAction.EDIT_GDM
}]
};
}
HermesBuiltin.copyDataProperties(r65, r67);
return r65;
}
@@ -0,0 +1,26 @@
// Metro module 7788 (f7789).
import { getMessageAuthorWithProcessedColor } from "./useAuthorWithProcessedColor";
import { intl, t } from "../../../../../intl/index.native";
import formatUsernameOnClick from "./formatUsernameOnClick";
import createCommonMessage from "./createCommonMessage";
export function createChannelFollowAddSystemMessage(a0) {
const { message, roleStyle } = a0;
const messageAuthorWithProcessedColor = getMessageAuthorWithProcessedColor(message);
return {
content: intl.formatToParts(t.xH8qGO, {
username: messageAuthorWithProcessedColor.nick,
usernameOnClick: formatUsernameOnClick({
message,
author: messageAuthorWithProcessedColor,
roleStyle
}),
webhookName: message.content,
webhookNameOnClick: {
action: "bindGuildMenu",
messageReference: message.messageReference,
medium: true
}
}),
...createCommonMessage(a0)
};
}
@@ -0,0 +1,44 @@
// Metro module 7825 (f7826).
import ApplicationStore from "../../../../applications/ApplicationStore";
import { HelpdeskArticles } from "../../../../../Constants";
import resolveMessageContentColors from "../resolveMessageContentColors";
import { getMessageAuthorWithProcessedColor } from "./useAuthorWithProcessedColor";
import formatUsernameOnClick from "./formatUsernameOnClick";
import HelpdeskUtils from "../../../../../utils/HelpdeskUtils";
import { intl, t } from "../../../../../intl/index.native";
import createCommonMessage from "./createCommonMessage";
export function createChannelLinkedToLobbySystemMessage(a0) {
const { message, roleStyle } = a0;
const r18 = resolveMessageContentColors(a0.theme);
let applicationId = message.applicationId;
if (applicationId == null) {
applicationId = "";
}
const application = ApplicationStore.getApplication(applicationId);
if (application == null) {
return null;
}
const messageAuthorWithProcessedColor = getMessageAuthorWithProcessedColor(message);
return {
content: intl.formatToParts(t.gZfhOw, {
username: messageAuthorWithProcessedColor.nick,
usernameOnClick: formatUsernameOnClick({
message,
author: messageAuthorWithProcessedColor,
roleStyle
}),
applicationName: application.name,
applicationNameOnClick: {
linkColor: r18.defaultUsernameColor,
medium: true
},
urlOnClick: {
action: "bindOpenUrl",
url: HelpdeskUtils.getArticleURL(HelpdeskArticles.LINKED_LOBBIES),
linkColor: r18.linkColor,
medium: true
}
}),
...createCommonMessage(a0)
};
}
@@ -0,0 +1,54 @@
// Metro module 7765 (f7766).
import { getMessageAuthorWithProcessedColor } from "./useAuthorWithProcessedColor";
import formatUsernameOnClick from "./formatUsernameOnClick";
import { intl, t } from "../../../../../intl/index.native";
import createCommonMessage from "./createCommonMessage";
import { MessageAccessibilityAction } from "../../MessageAccessibilityActions";
export function createChannelPinnedMessageSystemMessage(a0) {
const { message, roleStyle } = a0;
const messageAuthorWithProcessedColor = getMessageAuthorWithProcessedColor(message);
const r13 = {
username: messageAuthorWithProcessedColor.nick,
usernameOnClick: formatUsernameOnClick({
message,
author: messageAuthorWithProcessedColor,
roleStyle
}),
pinsOnClick: {
action: "bindOpenPins",
messageChannelId: message.channel_id,
medium: true
}
};
const messageReference = message.messageReference;
const content = messageReference != null ? intl.formatToParts(t["7mvRNF"], {
...r13,
messageOnClick: {
action: "bindJumpToMessage",
targetChannelId: messageReference.channel_id,
targetMessageId: messageReference.message_id,
medium: true
}
}) : intl.formatToParts(t["6TrHq2"], r13);
const commonMessage = createCommonMessage(a0);
let accessibilityActions = commonMessage.accessibilityActions;
if (accessibilityActions == null) {
accessibilityActions = [];
}
const accessibilityActions2 = [...accessibilityActions];
accessibilityActions2.push({
label: intl.string(t["mp1N/2"]),
name: MessageAccessibilityAction.OPEN_PINS
});
if (messageReference != null) {
accessibilityActions2.push({
label: intl.string(t["+TSRGD"]),
name: MessageAccessibilityAction.JUMP_TO_MESSAGE
});
}
return {
content,
...commonMessage,
accessibilityActions: accessibilityActions2
};
}
@@ -0,0 +1,65 @@
// Metro module 7849 (f7850).
import ChannelStore from "../../../../../stores/ChannelStore";
import UserStore from "../../../../../stores/UserStore";
import { getUserAuthorWithProcessedColor } from "./useAuthorWithProcessedColor";
import formatUsernameOnClick from "./formatUsernameOnClick";
import { createNativeStyleProperties } from "../../../../../design/components/Styles/native/createStyles";
import Module712 from "../../../../../_bundle/Module712";
import { intl, t } from "../../../../../intl/index.native";
import { getAssetUriForEmbed } from "../EmbedUtils";
import Module7850 from "../../../../../_bundle/Module7850";
import createCommonMessage from "./createCommonMessage";
export function createFriendRequestAcceptedSystemMessage(a0) {
let content2, textColor;
const { message, roleStyle } = a0;
const channel = ChannelStore.getChannel(message.channel_id);
if (channel != null && channel.isDM()) {
const recipientId = channel.getRecipientId();
const user = UserStore.getUser(recipientId);
const currentUser = UserStore.getCurrentUser();
if (user != null && currentUser != null) {
const userAuthorWithProcessedColor = getUserAuthorWithProcessedColor(user, channel);
const r17 = {
username: userAuthorWithProcessedColor.nick,
usernameOnClick: formatUsernameOnClick({
userId: recipientId,
message,
author: userAuthorWithProcessedColor,
roleStyle
})
};
const r1 = message.author.id === currentUser.id;
const content = message.content;
if (content != null && content !== "") {
const baseTextColor = createNativeStyleProperties({
baseTextColor: Module712.colors.TEXT_SUBTLE
})(a0.theme).baseTextColor;
content2 = r1 ? intl.formatToParts(t["6pQebO"], {
...r17,
note: content,
formattedNote: {
colorString: userAuthorWithProcessedColor.colorString
}
}) : intl.formatToParts(t.bNrwDM, {
...r17,
note: content,
formattedNote: {
colorString: userAuthorWithProcessedColor.colorString
}
});
textColor = baseTextColor;
} else {
content2 = r1 ? intl.formatToParts(t.REfFZs, r17) : intl.formatToParts(t.hyPOTm, r17);
textColor = void 0;
}
return {
content: content2,
iconUrl: getAssetUriForEmbed(Module7850),
textColor,
...createCommonMessage(a0)
};
}
return null;
}
return null;
}
@@ -0,0 +1,28 @@
// Metro module 7851 (f7852).
import { createNativeStyleProperties } from "../../../../../design/components/Styles/native/createStyles";
import Module712 from "../../../../../_bundle/Module712";
import { createGiftIntentEmbed } from "../row_data/embeds/GiftIntentEmbed";
import createCommonMessage from "./createCommonMessage";
import { createEphemeralIndication } from "../row_data/EphemeralIndication";
import { getAssetUriForEmbed } from "../EmbedUtils";
import Module7732 from "../../../../../_bundle/Module7732";
const nativeStyleProperties = createNativeStyleProperties({
iconTintColor: Module712.colors.BACKGROUND_BRAND,
iconDividerColor: Module712.colors.ICON_STRONG
});
export function createGiftIntentSystemMessage(a0) {
const { message, theme } = a0;
const giftIntentEmbed = createGiftIntentEmbed(message, theme);
if (giftIntentEmbed == null) {
return null;
}
const r16 = nativeStyleProperties(theme);
return {
...createCommonMessage(a0),
giftIntentInfo: giftIntentEmbed,
ephemeralIndication: createEphemeralIndication(message),
iconUrl: getAssetUriForEmbed(Module7732),
iconTintColor: r16.iconTintColor,
iconDividerColor: r16.iconDividerColor
};
}
@@ -0,0 +1,86 @@
// Metro module 7814 (f7815).
import ChannelStore from "../../../../../stores/ChannelStore";
import { createNativeStyleProperties } from "../../../../../design/components/Styles/native/createStyles";
import Module712 from "../../../../../_bundle/Module712";
import resolveMessageContentColors from "../resolveMessageContentColors";
import { getMessageAuthorWithProcessedColor } from "./useAuthorWithProcessedColor";
import formatUsernameOnClick from "./formatUsernameOnClick";
import { intl, t } from "../../../../../intl/index.native";
import getTagProperties from "../getTagProperties";
import createCommonMessage from "./createCommonMessage";
import { ensureAvatarSource, getAutomodAvatarURL } from "../../../../../utils/native/AvatarUtils";
import { makeSource } from "../../../../../utils/AvatarUtils";
import { HermesBuiltin } from "../../../../../_hermes/prelude";
const nativeStyleProperties = createNativeStyleProperties({
automodUsernameColor: Module712.colors.TEXT_BRAND
});
export { nativeStyleProperties as resolveAlertModeColors };
export function createGuildAlertModeEnabledSystemMessage(a0) {
const { message, roleStyle, theme } = a0;
const colors = resolveMessageContentColors(theme);
const channel = ChannelStore.getChannel(message.channel_id);
const messageAuthorWithProcessedColor = getMessageAuthorWithProcessedColor(message);
let automodUsernameColor = nativeStyleProperties(theme).automodUsernameColor;
const r29 = {
username: messageAuthorWithProcessedColor.nick,
usernameOnClick: formatUsernameOnClick({
message,
author: messageAuthorWithProcessedColor,
roleStyle
}),
time: message.content !== "" ? new Date(message.content).toLocaleString(intl.currentLocale, {
hour: "numeric",
minute: "2-digit"
}) : ""
};
const tagProperties = getTagProperties({
message,
channel,
isSystemDM: true,
colors
});
const r50 = {
...createCommonMessage(a0),
content: intl.formatToParts(t.ig55n6, r29),
username: intl.string(t.hG1StD)
};
if (automodUsernameColor == null) {
automodUsernameColor = null;
}
r50.usernameColor = automodUsernameColor;
r50.avatarURL = ensureAvatarSource(makeSource(getAutomodAvatarURL())).uri;
HermesBuiltin.copyDataProperties(r50, tagProperties);
return r50;
}
export function createGuildAlertModeDisabledSystemMessage(a0) {
const { message, roleStyle, theme } = a0;
const colors = resolveMessageContentColors(theme);
let automodUsernameColor = nativeStyleProperties(theme).automodUsernameColor;
const messageAuthorWithProcessedColor = getMessageAuthorWithProcessedColor(message);
const r10 = {
username: messageAuthorWithProcessedColor.nick,
usernameOnClick: formatUsernameOnClick({
message,
author: messageAuthorWithProcessedColor,
roleStyle
})
};
const tagProperties = getTagProperties({
message,
channel: void 0,
isSystemDM: true,
colors
});
const r32 = {
...createCommonMessage(a0),
content: intl.formatToParts(t.cyq2WA, r10),
username: intl.string(t.hG1StD)
};
if (automodUsernameColor == null) {
automodUsernameColor = null;
}
r32.usernameColor = automodUsernameColor;
r32.avatarURL = ensureAvatarSource(makeSource(getAutomodAvatarURL())).uri;
HermesBuiltin.copyDataProperties(r32, tagProperties);
return r32;
}
@@ -0,0 +1,27 @@
// Metro module 7790 (f7791).
import { intl, t } from "../../../../../intl/index.native";
import createCommonMessage from "./createCommonMessage";
export function createGuildDiscoveryDisqualifiedSystemMessage(a0) {
return {
content: intl.string(t.NxS3hY),
...createCommonMessage(a0)
};
}
export function createGuildDiscoveryRequalifiedSystemMessage(a0) {
return {
content: intl.string(t.tu6tOR),
...createCommonMessage(a0)
};
}
export function createGuildDiscoveryGracePeriodInitialWarningSystemMessage(a0) {
return {
content: intl.string(t.BoiiWz),
...createCommonMessage(a0)
};
}
export function createGuildDiscoveryGracePeriodFinalWarningSystemMessage(a0) {
return {
content: intl.string(t.ED4mGc),
...createCommonMessage(a0)
};
}
@@ -0,0 +1,52 @@
// Metro module 7806 (f7807).
import MessageRecord from "../../../../../records/MessageRecord";
import ChannelStore from "../../../../../stores/ChannelStore";
import { MessageTypes } from "../../../../../Constants";
import { getMessageAuthor } from "../../../useMessageAuthor";
import { getMessageAuthorWithProcessedColor } from "./useAuthorWithProcessedColor";
import { ensureAvatarSource } from "../../../../../utils/native/AvatarUtils";
import { getGuildMemberAvatarSource } from "../../../../../utils/AvatarUtils";
import { getGuildProductPurchaseSystemMessageContentMobile } from "../../../../guild_products/GuildProductSystemMessageUtils";
import formatUsernameOnClick from "./formatUsernameOnClick";
import { intl, t } from "../../../../../intl/index.native";
import createCommonMessage from "./createCommonMessage";
export function createGuildProductPurchaseSystemMessage(a0) {
const r5 = {
...a0,
message: new MessageRecord(a0.message)
};
r5.message.type = MessageTypes.ROLE_SUBSCRIPTION_PURCHASE;
const purchaseNotification = r5.message.purchaseNotification;
const productName = purchaseNotification == null ? void 0 : purchaseNotification.guild_product_purchase?.product_name;
if (productName == null) {
return null;
}
const message = r5.message;
const roleStyle = a0.roleStyle;
const author = message.author;
const channel = ChannelStore.getChannel(message.getChannelId());
const guildId = channel == null ? void 0 : channel.getGuildId();
const guildMemberAvatar = getMessageAuthor(message).guildMemberAvatar;
const messageAuthorWithProcessedColor = getMessageAuthorWithProcessedColor(message);
const r55 = ensureAvatarSource(guildMemberAvatar != null && guildId != null ? getGuildMemberAvatarSource({
userId: author.id,
avatar: guildMemberAvatar,
guildId
}, author) : author.getAvatarSource(void 0));
return {
content: getGuildProductPurchaseSystemMessageContentMobile({
username: messageAuthorWithProcessedColor.nick,
usernameOnClickHandler: formatUsernameOnClick({
message,
author: messageAuthorWithProcessedColor,
roleStyle
}),
productName
}),
totalMonthsSubscribed: 0,
username: messageAuthorWithProcessedColor.nick,
avatarURL: r55.uri,
welcomeLabel: intl.string(t.s2N5HS),
...createCommonMessage(r5)
};
}
@@ -0,0 +1,45 @@
// Metro module 7822 (f7823).
import ChannelStore from "../../../../../stores/ChannelStore";
import resolveMessageContentColors from "../resolveMessageContentColors";
import { getMessageAuthorWithProcessedColor } from "./useAuthorWithProcessedColor";
import { resolveAlertModeColors } from "./GuildAlertModeSystemMessage";
import formatUsernameOnClick from "./formatUsernameOnClick";
import getTagProperties from "../getTagProperties";
import createCommonMessage from "./createCommonMessage";
import { intl, t } from "../../../../../intl/index.native";
import { ensureAvatarSource, getAutomodAvatarURL } from "../../../../../utils/native/AvatarUtils";
import { makeSource } from "../../../../../utils/AvatarUtils";
import { HermesBuiltin } from "../../../../../_hermes/prelude";
export function createGuildReportFalseAlarmSystemMessage(a0) {
const { message, roleStyle, theme } = a0;
const colors = resolveMessageContentColors(theme);
const channel = ChannelStore.getChannel(message.channel_id);
const messageAuthorWithProcessedColor = getMessageAuthorWithProcessedColor(message);
let automodUsernameColor = resolveAlertModeColors(theme).automodUsernameColor;
const r29 = {
username: messageAuthorWithProcessedColor.nick,
usernameOnClick: formatUsernameOnClick({
message,
author: messageAuthorWithProcessedColor,
roleStyle
})
};
const tagProperties = getTagProperties({
message,
channel,
isSystemDM: true,
colors
});
const r38 = {
...createCommonMessage(a0),
content: intl.formatToParts(t["21+uW4"], r29),
username: intl.string(t.hG1StD)
};
if (automodUsernameColor == null) {
automodUsernameColor = null;
}
r38.usernameColor = automodUsernameColor;
r38.avatarURL = ensureAvatarSource(makeSource(getAutomodAvatarURL())).uri;
HermesBuiltin.copyDataProperties(r38, tagProperties);
return r38;
}
@@ -0,0 +1,53 @@
// Metro module 7821 (f7822).
import ChannelStore from "../../../../../stores/ChannelStore";
import GuildStore from "../../../../../stores/GuildStore";
import resolveMessageContentColors from "../resolveMessageContentColors";
import { getMessageAuthorWithProcessedColor } from "./useAuthorWithProcessedColor";
import { resolveAlertModeColors } from "./GuildAlertModeSystemMessage";
import formatUsernameOnClick from "./formatUsernameOnClick";
import getTagProperties from "../getTagProperties";
import createCommonMessage from "./createCommonMessage";
import { intl, t } from "../../../../../intl/index.native";
import { ensureAvatarSource, getAutomodAvatarURL } from "../../../../../utils/native/AvatarUtils";
import { makeSource } from "../../../../../utils/AvatarUtils";
import { HermesBuiltin } from "../../../../../_hermes/prelude";
export function createGuildReportRaidSystemMessage(a0) {
const { message, roleStyle, theme } = a0;
const colors = resolveMessageContentColors(theme);
const channel = ChannelStore.getChannel(message.channel_id);
const guild = GuildStore.getGuild(channel?.guild_id);
const messageAuthorWithProcessedColor = getMessageAuthorWithProcessedColor(message);
let automodUsernameColor = resolveAlertModeColors(theme).automodUsernameColor;
const r35 = {
username: messageAuthorWithProcessedColor.nick,
usernameOnClick: formatUsernameOnClick({
message,
author: messageAuthorWithProcessedColor,
roleStyle
}),
guildName: null
};
let guildName = guild?.name;
if (guildName == null) {
guildName = "";
}
r35.guildName = guildName;
const tagProperties = getTagProperties({
message,
channel,
isSystemDM: true,
colors
});
const r45 = {
...createCommonMessage(a0),
content: intl.formatToParts(t["MTmH+u"], r35),
username: intl.string(t.hG1StD)
};
if (automodUsernameColor == null) {
automodUsernameColor = null;
}
r45.usernameColor = automodUsernameColor;
r45.avatarURL = ensureAvatarSource(makeSource(getAutomodAvatarURL())).uri;
HermesBuiltin.copyDataProperties(r45, tagProperties);
return r45;
}
@@ -0,0 +1,47 @@
// Metro module 7789 (f7790).
import { StreamTypes } from "../../../../go_live/Constants";
import getHumanizedCallDuration from "../../../getHumanizedCallDuration";
import { getMessageAuthorWithProcessedColor } from "./useAuthorWithProcessedColor";
import formatUsernameOnClick from "./formatUsernameOnClick";
import { intl, t } from "../../../../../intl/index.native";
import createCommonMessage from "./createCommonMessage";
export function createGuildStreamSystemMessage(a0) {
const { message, roleStyle } = a0;
const author = message.author;
let messageReference = message.messageReference;
if (messageReference == null) {
messageReference = {};
}
const { channel_id, guild_id } = messageReference;
const humanizedCallDuration = getHumanizedCallDuration(message);
const ended = humanizedCallDuration != null;
const messageAuthorWithProcessedColor = getMessageAuthorWithProcessedColor(message);
const r25 = {
username: messageAuthorWithProcessedColor.nick,
usernameOnClick: formatUsernameOnClick({
message,
author: messageAuthorWithProcessedColor,
roleStyle
})
};
const onJoinStream = {
action: "bindJoinStream",
stream: {
streamType: StreamTypes.GUILD,
channelId: channel_id,
ownerId: author.id,
guildId: guild_id
}
};
return {
ended,
content: ended ? intl.formatToParts(t.FP7rUI, {
...r25,
duration: humanizedCallDuration
}) : intl.formatToParts(t.dMmbGk, {
...r25,
onJoinStream
}),
...createCommonMessage(a0)
};
}
@@ -0,0 +1,40 @@
// Metro module 7826 (f7827).
import ApplicationStore from "../../../../applications/ApplicationStore";
import { HelpdeskArticles } from "../../../../../Constants";
import resolveMessageContentColors from "../resolveMessageContentColors";
import { getMessageAuthorWithProcessedColor } from "./useAuthorWithProcessedColor";
import formatUsernameOnClick from "./formatUsernameOnClick";
import HelpdeskUtils from "../../../../../utils/HelpdeskUtils";
import { intl, t } from "../../../../../intl/index.native";
import createCommonMessage from "./createCommonMessage";
export function createInGameMessageNuxSystemMessage(a0) {
const { message, theme, roleStyle } = a0;
const r18 = resolveMessageContentColors(theme);
let applicationId = message.applicationId;
if (applicationId == null) {
applicationId = "";
}
const application = ApplicationStore.getApplication(applicationId);
if (application == null) {
return null;
}
const messageAuthorWithProcessedColor = getMessageAuthorWithProcessedColor(message);
return {
content: intl.formatToParts(t["92erOB"], {
username: messageAuthorWithProcessedColor.nick,
usernameOnClick: formatUsernameOnClick({
message,
author: messageAuthorWithProcessedColor,
roleStyle
}),
gameName: application.name,
urlOnClick: {
action: "bindOpenUrl",
url: HelpdeskUtils.getArticleURL(HelpdeskArticles.SOCIAL_LAYER_CONNECTIONS),
linkColor: r18.linkColor,
medium: true
}
}),
...createCommonMessage(a0)
};
}
@@ -0,0 +1,41 @@
// Metro module 7827 (f7828).
import GuildJoinRequestStore from "../../../../guild_member_verification/GuildJoinRequestStore";
import UserGuildJoinRequestStore from "../../../../guild_member_verification/UserGuildJoinRequestStore";
import GuildStore from "../../../../../stores/GuildStore";
import UserStore from "../../../../../stores/UserStore";
import { MessageTypes } from "../../../../../Constants";
import { intl, t } from "../../../../../intl/index.native";
import SnowflakeUtils from "../../../../../utils/SnowflakeUtils";
import createCommonMessage from "./createCommonMessage";
export function createJoinRequestNotificationSystemMessage(a0) {
const message = a0.message;
const request = GuildJoinRequestStore.getRequest(SnowflakeUtils.cast(message.channel_id));
const r2 = request == null;
let r22 = void 0;
if (!r2) {
let r24 = GuildStore.getGuild(request.guildId);
if (r24 == null) {
r24 = UserGuildJoinRequestStore.getJoinRequestGuild(request.guildId);
}
r22 = r24;
}
let username = UserStore.getUser(request?.userId)?.username;
if (username == null) {
username = request == null ? void 0 : request.user?.username;
}
const type = message.type;
const name = r22?.name;
return {
content: MessageTypes.GUILD_JOIN_REQUEST_ACCEPT_NOTIFICATION === type ? username != null && name != null ? intl.formatToParts(t.EloBG4, {
username,
guildName: name
}) : intl.string(t["2VLV0d"]) : MessageTypes.GUILD_JOIN_REQUEST_REJECT_NOTIFICATION === type ? username != null && name != null ? intl.formatToParts(t["UGN/Yy"], {
username,
guildName: name
}) : intl.string(t.FVF6qU) : MessageTypes.GUILD_JOIN_REQUEST_WITHDRAWN_NOTIFICATION === type ? username != null && name != null ? intl.formatToParts(t.u4movT, {
username,
guildName: name
}) : intl.string(t.BMlbE7) : "",
...createCommonMessage(a0)
};
}
@@ -0,0 +1,31 @@
// Metro module 7793 (f7794).
import ChannelStore from "../../../../../stores/ChannelStore";
import RelationshipStore from "../../../../../stores/RelationshipStore";
import UserStore from "../../../../../stores/UserStore";
import { getMessageAuthorWithProcessedColor } from "./useAuthorWithProcessedColor";
import { intl, t } from "../../../../../intl/index.native";
import formatUsernameOnClick from "./formatUsernameOnClick";
import { computeChannelName } from "../../../../channel/useChannelName";
import createCommonMessage from "./createCommonMessage";
export function createNewThreadSystemMessage(a0) {
const { message, roleStyle } = a0;
const messageAuthorWithProcessedColor = getMessageAuthorWithProcessedColor(message);
const channel = ChannelStore.getChannel(message.messageReference?.channel_id);
return {
content: intl.formatToParts(t.veX9jq, {
actorName: messageAuthorWithProcessedColor.nick,
actorHook: formatUsernameOnClick({
message,
author: messageAuthorWithProcessedColor,
roleStyle
}),
threadName: channel != null ? computeChannelName(channel, UserStore, RelationshipStore) : message.content,
threadOnClick: {
action: "bindOpenThreadChannel",
threadId: message.messageReference?.channel_id,
medium: true
}
}),
...createCommonMessage(a0)
};
}
@@ -0,0 +1,114 @@
// Metro module 7823 (f7824).
import { EMOJI_URL_BASE_SIZE } from "../../../../emojis/EmojiConstants";
import { getMessageAuthorWithProcessedColor } from "./useAuthorWithProcessedColor";
import formatUsernameOnClick from "./formatUsernameOnClick";
import { t, intl } from "../../../../../intl/index.native";
import AvatarUtils from "../../../../../utils/AvatarUtils";
import UnicodeEmojis from "../../../../emojis/UnicodeEmojis";
import parsePollResultSystemMessageEmbed from "../../../../polls/parsePollResultSystemMessageEmbed";
import createCommonMessage from "./createCommonMessage";
function $mk79304($env) {
return () => $env[0];
}
export function createPollResultSystemMessage(a0) {
let content2;
const r10 = parsePollResultSystemMessageEmbed(a0.message.embeds[0]);
if (r10 == null) {
return null;
}
if (a0.message.messageReference == null) {
return null;
}
const { message, roleStyle } = a0;
const messageAuthorWithProcessedColor = getMessageAuthorWithProcessedColor(message);
const r12 = {
username: messageAuthorWithProcessedColor.nick,
usernameOnClick: formatUsernameOnClick({
message,
author: messageAuthorWithProcessedColor,
roleStyle
}),
title: r10.questionText,
titleOnClick: {
action: "bindJumpToMessage",
targetChannelId: message.messageReference.channel_id,
targetMessageId: message.messageReference.message_id,
medium: true
}
};
if (r10.totalVotes === 0) {
let env16029;
const r124 = t["9dPxsm"];
const r129 = env16029 = {};
env16029[0] = {
type: "emoji",
content: "frowning",
surrogate: "😦"
};
content2 = intl.formatToParts(r124, {
...r12,
sadEmojiHook: $mk79304(r129)
});
} else {
const percentage = `${Math.round(r10.victorAnswerVotes / r10.totalVotes * 100)}%`;
if (r10.victorAnswerId == null) {
content2 = intl.formatToParts(t.dqftZ2, {
...r12,
percentage
});
} else {
const content = [];
const victorEmoji = r10.victorEmoji;
if (victorEmoji != null) {
if (victorEmoji.id != null) {
content.push({
id: victorEmoji.id,
type: "customEmoji",
alt: victorEmoji.name,
src: AvatarUtils.getEmojiURL({
id: victorEmoji.id,
animated: victorEmoji.animated,
size: EMOJI_URL_BASE_SIZE
}),
frozenSrc: AvatarUtils.getEmojiURL({
id: victorEmoji.id,
animated: false,
size: EMOJI_URL_BASE_SIZE
})
});
} else {
content.push({
type: "emoji",
content: UnicodeEmojis.convertSurrogateToName(victorEmoji.name, false),
surrogate: victorEmoji.name
});
}
content.push({
type: "text",
content: " "
});
}
let env16028;
content.push({
type: "text",
content: r10.victorAnswerText
});
const zFwIxC = t.zFwIxC;
const r101 = {
type: "strong",
content
};
const r102 = env16028 = {};
env16028[0] = r101;
content2 = intl.formatToParts(zFwIxC, {
...r12,
answerHook: $mk79304(r102),
percentage
});
}
}
return {
...createCommonMessage(a0),
content: content2
};
}
@@ -0,0 +1,29 @@
// Metro module 7828 (f7829).
import AuthenticationStore from "../../../../../stores/AuthenticationStore";
import ChannelStore from "../../../../../stores/ChannelStore";
import { createNativeStyleProperties } from "../../../../../design/components/Styles/native/createStyles";
import Module712 from "../../../../../_bundle/Module712";
import { createPremiumGroupInviteEmbed } from "../row_data/embeds/PremiumGroupInviteEmbed";
import createCommonMessage from "./createCommonMessage";
import { getAssetUriForEmbed } from "../EmbedUtils";
import Module6628 from "../../../../../_bundle/Module6628";
const nativeStyleProperties = createNativeStyleProperties({
iconTintColor: Module712.colors.ICON_STRONG,
iconDividerColor: Module712.colors.ICON_STRONG
});
export function createPremiumGroupInviteSystemMessage(a0) {
const { message, theme } = a0;
const channel = ChannelStore.getChannel(message.getChannelId());
const premiumGroupInviteEmbed = createPremiumGroupInviteEmbed(message, theme, AuthenticationStore.getId(), channel);
if (premiumGroupInviteEmbed == null) {
return null;
}
const r26 = nativeStyleProperties(theme);
return {
...createCommonMessage(a0),
premiumGroupInviteInfo: premiumGroupInviteEmbed,
iconUrl: getAssetUriForEmbed(Module6628),
iconTintColor: r26.iconTintColor,
iconDividerColor: r26.iconDividerColor
};
}
@@ -0,0 +1,36 @@
// Metro module 7813 (f7814).
import { MessageTypes } from "../../../../../Constants";
import { getMessageAuthorWithProcessedColor } from "./useAuthorWithProcessedColor";
import formatUsernameOnClick from "./formatUsernameOnClick";
import { getPrivateChannelIntegrationAddedSystemMessageASTContent, getPrivateChannelIntegrationRemovedSystemMessageASTContent } from "../../../../private_channel_integrations/PrivateChannelIntegrationSystemMessageUtils";
import createCommonMessage from "./createCommonMessage";
export function createPrivateChannelIntegrationSystemMessage(a0, a1) {
const { message, roleStyle } = a0;
const messageAuthorWithProcessedColor = getMessageAuthorWithProcessedColor(message);
const usernameOnClick = formatUsernameOnClick({
message,
author: messageAuthorWithProcessedColor,
roleStyle
});
const application = message.application;
const applicationNameOnClick = application?.bot != null ? {
action: "bindUserMenu",
userId: application.bot.id,
messageChannelId: message.channel_id,
medium: true
} : void 0;
return {
content: a1 === MessageTypes.PRIVATE_CHANNEL_INTEGRATION_ADDED ? getPrivateChannelIntegrationAddedSystemMessageASTContent({
application,
username: messageAuthorWithProcessedColor.nick,
usernameOnClick,
applicationNameOnClick
}) : getPrivateChannelIntegrationRemovedSystemMessageASTContent({
application,
username: messageAuthorWithProcessedColor.nick,
usernameOnClick,
applicationNameOnClick
}),
...createCommonMessage(a0)
};
}
@@ -0,0 +1,6 @@
// Metro module 7805 (f7806).
import { PurchaseNotificationType } from "../../../../../flow/Server";
import { createGuildProductPurchaseSystemMessage } from "./GuildProductPurchaseSystemMessage";
export function createPurchaseNotificationSystemMessage(a0) {
return a0.message.purchaseNotification?.type === PurchaseNotificationType.GUILD_PRODUCT ? createGuildProductPurchaseSystemMessage(a0) : null;
}
@@ -0,0 +1,50 @@
// Metro module 7833 (f7834).
import ReferralTrialStore from "../../../../premium/ReferralTrialStore";
import AuthenticationStore from "../../../../../stores/AuthenticationStore";
import { createNativeStyleProperties } from "../../../../../design/components/Styles/native/createStyles";
import Module712 from "../../../../../_bundle/Module712";
import { createReferralTrialEmbedRedesign } from "../row_data/embeds/ReferralTrialEmbedRedesign";
import createCommonMessage from "./createCommonMessage";
import { getAssetUriForEmbed } from "../EmbedUtils";
import Module6628 from "../../../../../_bundle/Module6628";
import { createReferralTrialEmbedRedeemable } from "../row_data/embeds/ReferralTrialEmbed";
const nativeStyleProperties = createNativeStyleProperties({
iconTintColor: Module712.colors.ICON_STRONG,
iconDividerColor: Module712.colors.ICON_STRONG
});
export function createReferralSystemMessage(a0) {
const { message, theme } = a0;
const id = AuthenticationStore.getId();
const referralTrialOfferId = message.referralTrialOfferId;
if (referralTrialOfferId == null) {
return null;
}
const relevantUserTrialOffer = ReferralTrialStore.getRelevantUserTrialOffer(referralTrialOfferId);
if (relevantUserTrialOffer?.referrer_id === id) {
const referralTrialEmbedRedeemable = createReferralTrialEmbedRedeemable(message, theme, id, relevantUserTrialOffer);
if (referralTrialEmbedRedeemable == null) {
return null;
}
const r55 = nativeStyleProperties(theme);
return {
...createCommonMessage(a0),
referralTrialOfferInfo: referralTrialEmbedRedeemable,
iconUrl: getAssetUriForEmbed(Module6628),
iconTintColor: r55.iconTintColor,
iconDividerColor: r55.iconDividerColor
};
}
const referralTrialEmbedRedesign = createReferralTrialEmbedRedesign(message, theme, id, relevantUserTrialOffer);
if (referralTrialEmbedRedesign == null) {
return null;
}
const r29 = nativeStyleProperties(theme);
return {
...createCommonMessage(a0),
referralTrialOfferInfoRedesign: referralTrialEmbedRedesign,
iconUrl: getAssetUriForEmbed(Module6628),
iconTintColor: r29.iconTintColor,
iconDividerColor: r29.iconDividerColor,
timestamp: void 0
};
}
@@ -0,0 +1,45 @@
// Metro module 7759 (f7760).
import { THREAD_CHANNEL_TYPES } from "../../../../../records/ChannelRecord";
import ChannelStore from "../../../../../stores/ChannelStore";
import UserStore from "../../../../../stores/UserStore";
import { getMessageAuthorWithProcessedColor, getUserAuthorWithProcessedColor } from "./useAuthorWithProcessedColor";
import formatUsernameOnClick from "./formatUsernameOnClick";
import { intl, t } from "../../../../../intl/index.native";
import createCommonMessage from "./createCommonMessage";
export function createRemoveRecipientSystemMessage(a0) {
const { message, roleStyle } = a0;
const author = message.author;
const userId = message.mentions[0];
const channel = ChannelStore.getChannel(message.channel_id);
const r19 = channel != null && THREAD_CHANNEL_TYPES.has(channel.type);
const messageAuthorWithProcessedColor = getMessageAuthorWithProcessedColor(message);
const r28 = {
username: messageAuthorWithProcessedColor.nick,
usernameOnClick: formatUsernameOnClick({
message,
author: messageAuthorWithProcessedColor,
roleStyle
})
};
if (author.id === userId) {
return {
content: r19 ? intl.formatToParts(t.uHmblj, r28) : intl.formatToParts(t["Qn5+Lf"], r28),
...createCommonMessage(a0)
};
}
const userAuthorWithProcessedColor = getUserAuthorWithProcessedColor(UserStore.getUser(userId), channel);
const r40 = {
...r28,
otherUsername: userAuthorWithProcessedColor.nick,
otherUsernameOnClick: formatUsernameOnClick({
userId,
message,
author: userAuthorWithProcessedColor,
roleStyle
})
};
return {
content: r19 ? intl.formatToParts(t.KBrM5t, r40) : intl.formatToParts(t.QtZ0RD, r40),
...createCommonMessage(a0)
};
}
@@ -0,0 +1,64 @@
// Metro module 7804 (f7805).
import ChannelStore from "../../../../../stores/ChannelStore";
import GuildStore from "../../../../../stores/GuildStore";
import { SystemChannelFlags } from "../../../../../Constants";
import { getMessageAuthor } from "../../../useMessageAuthor";
import { getMessageAuthorWithProcessedColor } from "./useAuthorWithProcessedColor";
import { computeIsStickerReplyEnabled } from "./useIsStickerReplyEnabled";
import { transformSticker } from "./transformSticker";
import { pickRoleSubscriptionPurchaseSticker, getRoleSubscriptionPurchaseSystemMessageContentMobile, getRoleSubscriptionPurchaseStickerCTA } from "../../../../guild_role_subscriptions/GuildRoleSubscriptionSystemMessageUtils";
import { ensureAvatarSource } from "../../../../../utils/native/AvatarUtils";
import { getGuildMemberAvatarSource } from "../../../../../utils/AvatarUtils";
import formatUsernameOnClick from "./formatUsernameOnClick";
import { intl, t } from "../../../../../intl/index.native";
import createCommonMessage from "./createCommonMessage";
export function createRoleSubscriptionPurchaseSystemMessage(a0) {
const { message, roleStyle } = a0;
const roleSubscriptionData = message.roleSubscriptionData;
if (roleSubscriptionData == null) {
return null;
}
const author = message.author;
const channel = ChannelStore.getChannel(message.getChannelId());
const guildId = channel == null ? void 0 : channel.getGuildId();
const guild = GuildStore.getGuild(guildId);
const guildMemberAvatar = getMessageAuthor(message).guildMemberAvatar;
const messageAuthorWithProcessedColor = getMessageAuthorWithProcessedColor(message);
const sticker = guildId != null ? channel != null ? computeIsStickerReplyEnabled(guildId, channel, message, guild != null && !(guild.systemChannelFlags & SystemChannelFlags.SUPPRESS_ROLE_SUBSCRIPTION_PURCHASE_NOTIFICATION_REPLIES)) ? transformSticker(pickRoleSubscriptionPurchaseSticker(message.id)) : void 0 : void 0 : void 0;
const r66 = ensureAvatarSource(guildMemberAvatar != null && guildId != null ? getGuildMemberAvatarSource({
userId: author.id,
avatar: guildMemberAvatar,
guildId
}, author) : author.getAvatarSource(void 0));
const roleSubscriptionOnClickHandler = {
action: "bindOpenRoleSubscriptionOverview",
guildId,
messageId: message.id,
channelId: channel?.id,
roleSubscriptionListingId: message.roleSubscriptionData?.role_subscription_listing_id
};
let guildId2 = guildId;
if (guildId2 == null) {
guildId2 = void 0;
}
return {
content: getRoleSubscriptionPurchaseSystemMessageContentMobile({
username: messageAuthorWithProcessedColor.nick,
guildId: guildId2,
usernameOnClickHandler: formatUsernameOnClick({
message,
author: messageAuthorWithProcessedColor,
roleStyle
}),
roleSubscriptionOnClickHandler,
roleSubscriptionData
}),
totalMonthsSubscribed: roleSubscriptionData.total_months_subscribed,
username: messageAuthorWithProcessedColor.nick,
avatarURL: r66.uri,
sticker,
stickerLabel: getRoleSubscriptionPurchaseStickerCTA(message.id, false),
welcomeLabel: intl.string(t.piPHvY),
...createCommonMessage(a0)
};
}
@@ -0,0 +1,21 @@
// Metro module 7808 (f7809).
import { getMessageAuthorWithProcessedColor } from "./useAuthorWithProcessedColor";
import { intl, t } from "../../../../../intl/index.native";
import formatUsernameOnClick from "./formatUsernameOnClick";
import createCommonMessage from "./createCommonMessage";
export function createStageEndSystemMessage(a0) {
const { message, roleStyle } = a0;
const messageAuthorWithProcessedColor = getMessageAuthorWithProcessedColor(message);
return {
content: intl.formatToParts(t.vMJhvG, {
username: messageAuthorWithProcessedColor.nick,
usernameOnClick: formatUsernameOnClick({
message,
author: messageAuthorWithProcessedColor,
roleStyle
}),
topic: message.content
}),
...createCommonMessage(a0)
};
}
@@ -0,0 +1,54 @@
// Metro module 7811 (f7812).
import StageChannelParticipantStore from "../../../../stage_channels/StageChannelParticipantStore";
import ChannelStore from "../../../../../stores/ChannelStore";
import PermissionStore from "../../../../../stores/PermissionStore";
import { HelpdeskArticles, MessageFlags, MessageTypes, Permissions } from "../../../../../Constants";
import { intl, t } from "../../../../../intl/index.native";
import HelpdeskUtils from "../../../../../utils/HelpdeskUtils";
import { getMessageAuthorWithProcessedColor } from "./useAuthorWithProcessedColor";
import SnowflakeUtils from "../../../../../utils/SnowflakeUtils";
import { RequestToSpeakStates } from "../../../../stage_channels/useAudienceRequestToSpeakState";
import formatUsernameOnClick from "./formatUsernameOnClick";
import createCommonMessage from "./createCommonMessage";
export function createStageRaiseHandSystemMessage(a0) {
const { message, roleStyle } = a0;
const messageAuthorWithProcessedColor = getMessageAuthorWithProcessedColor(message);
let showInviteToSpeakButton = PermissionStore.can(Permissions.MUTE_MEMBERS, ChannelStore.getChannel(message.channel_id));
const participant = StageChannelParticipantStore.getParticipant(message.channel_id, message.author.id);
const r44 = new Date(SnowflakeUtils.extractTimestamp(message.id)).toISOString();
const r45 = Date;
let r46 = participant == null ? void 0 : participant.voiceState?.requestToSpeakTimestamp;
if (r46 == null) {
r46 = 0;
}
const r55 = new r45(r46).toISOString();
if (showInviteToSpeakButton) {
showInviteToSpeakButton = participant?.rtsState === RequestToSpeakStates.REQUESTED_TO_SPEAK;
}
if (showInviteToSpeakButton) {
showInviteToSpeakButton = r44 === r55;
}
return {
content: intl.formatToParts(t.M87x7Y, {
username: messageAuthorWithProcessedColor.nick,
usernameOnClick: formatUsernameOnClick({
message,
author: messageAuthorWithProcessedColor,
roleStyle
})
}),
showInviteToSpeakButton,
buttonLabel: intl.string(t.f0T7hI),
ephemeralIndication: message.hasFlag(MessageFlags.EPHEMERAL) ? message.type === MessageTypes.STAGE_RAISE_HAND ? {
content: intl.formatToParts(t["qDAX++"], {
handleDelete: {
action: "bindDismissMessage",
message
}
}),
helpArticleLink: HelpdeskUtils.getArticleURL(HelpdeskArticles.EPHEMERAL_MESSAGES),
helpButtonAccessibilityLabel: intl.string(t.htHOrp)
} : void 0 : void 0,
...createCommonMessage(a0)
};
}
@@ -0,0 +1,20 @@
// Metro module 7810 (f7811).
import { getMessageAuthorWithProcessedColor } from "./useAuthorWithProcessedColor";
import { intl, t } from "../../../../../intl/index.native";
import formatUsernameOnClick from "./formatUsernameOnClick";
import createCommonMessage from "./createCommonMessage";
export function createStageSpeakerSystemMessage(a0) {
const { message, roleStyle } = a0;
const messageAuthorWithProcessedColor = getMessageAuthorWithProcessedColor(message);
return {
content: intl.formatToParts(t.V4uCm4, {
username: messageAuthorWithProcessedColor.nick,
usernameOnClick: formatUsernameOnClick({
message,
author: messageAuthorWithProcessedColor,
roleStyle
})
}),
...createCommonMessage(a0)
};
}
@@ -0,0 +1,21 @@
// Metro module 7807 (f7808).
import { getMessageAuthorWithProcessedColor } from "./useAuthorWithProcessedColor";
import { intl, t } from "../../../../../intl/index.native";
import formatUsernameOnClick from "./formatUsernameOnClick";
import createCommonMessage from "./createCommonMessage";
export function createStageStartSystemMessage(a0) {
const { message, roleStyle } = a0;
const messageAuthorWithProcessedColor = getMessageAuthorWithProcessedColor(message);
return {
content: intl.formatToParts(t.aZtRW8, {
username: messageAuthorWithProcessedColor.nick,
usernameOnClick: formatUsernameOnClick({
message,
author: messageAuthorWithProcessedColor,
roleStyle
}),
topic: message.content
}),
...createCommonMessage(a0)
};
}
@@ -0,0 +1,21 @@
// Metro module 7809 (f7810).
import { getMessageAuthorWithProcessedColor } from "./useAuthorWithProcessedColor";
import { intl, t } from "../../../../../intl/index.native";
import formatUsernameOnClick from "./formatUsernameOnClick";
import createCommonMessage from "./createCommonMessage";
export function createStageTopicSystemMessage(a0) {
const { message, roleStyle } = a0;
const messageAuthorWithProcessedColor = getMessageAuthorWithProcessedColor(message);
return {
content: intl.formatToParts(t.ro3RM0, {
username: messageAuthorWithProcessedColor.nick,
usernameOnClick: formatUsernameOnClick({
message,
author: messageAuthorWithProcessedColor,
roleStyle
}),
topic: message.content
}),
...createCommonMessage(a0)
};
}
@@ -0,0 +1,175 @@
// Metro module 7741 (f7742).
import { BoostedGuildTiers, MessageTypes } from "../../../../../Constants";
import { createAddRecipientSystemMessage } from "./AddRecipientSystemMessage";
import { createRemoveRecipientSystemMessage } from "./RemoveRecipientSystemMessage";
import { createCallSystemMessage } from "./CallSystemMessage";
import { createChangeChannelNameSystemMessage } from "./ChangeChannelNameSystemMessage";
import { createChangeChannelIconSystemMessage } from "./ChangeChannelIconSystemMessage";
import { createChannelPinnedMessageSystemMessage } from "./ChannelPinnedMessageSystemMessage";
import { createUserJoinSystemMessage } from "./UserJoinSystemMessage";
import { createUserPremiumGuildSubscriptionSystemMessage } from "./UserPremiumGuildSubscriptionSystemMessage";
import { createUserPremiumGuildSubscriptionTierAchievedSystemMessage } from "./UserPremiumGuildSubscriptionTierAchievedSystemMessage";
import { createChannelFollowAddSystemMessage } from "./ChannelFollowAddSystemMessage";
import { createGuildStreamSystemMessage } from "./GuildStreamSystemMessage";
import { createGuildDiscoveryDisqualifiedSystemMessage, createGuildDiscoveryRequalifiedSystemMessage, createGuildDiscoveryGracePeriodInitialWarningSystemMessage, createGuildDiscoveryGracePeriodFinalWarningSystemMessage } from "./GuildDiscoverySystemMessage";
import { createApplicationCommandSourceSystemMessage } from "./ApplicationCommandSourceSystemMessage";
import { createNewThreadSystemMessage } from "./NewThreadSystemMessage";
import { createThreadStarterSystemMessage } from "./ThreadStarterSystemMessage";
import { createAutoModerationActionSystemMessage } from "./AutoModerationActionSystemMessage";
import { createRoleSubscriptionPurchaseSystemMessage } from "./RoleSubscriptionPurchaseSystemMessage";
import { createPurchaseNotificationSystemMessage } from "./PurchaseNotificationSystemMessage";
import { createStageStartSystemMessage } from "./StageStartSystemMessage";
import { createStageEndSystemMessage } from "./StageEndSystemMessage";
import { createStageTopicSystemMessage } from "./StageTopicSystemMessage";
import { createStageSpeakerSystemMessage } from "./StageSpeakerSystemMessage";
import { createStageRaiseHandSystemMessage } from "./StageRaiseHandSystemMessage";
import { createApplicationSubscriptionPurchaseSystemMessage } from "./ApplicationSubscriptionPurchaseSystemMessage";
import { createPrivateChannelIntegrationSystemMessage } from "./PrivateChannelIntegrationSystemMessage";
import { createGuildAlertModeEnabledSystemMessage, createGuildAlertModeDisabledSystemMessage } from "./GuildAlertModeSystemMessage";
import { createGuildReportRaidSystemMessage } from "./GuildReportRaidSystemMessage";
import { createGuildReportFalseAlarmSystemMessage } from "./GuildReportFalseAlarmSystemMessage";
import { createPollResultSystemMessage } from "./PollResultSystemMessage";
import { createChannelLinkedToLobbySystemMessage } from "./ChannelLinkedToLobbySystemMessage";
import { createInGameMessageNuxSystemMessage } from "./InGameMessageNuxSystemMessage";
import { createJoinRequestNotificationSystemMessage } from "./JoinRequestNotificationSystemMessage";
import { createPremiumGroupInviteSystemMessage } from "./PremiumGroupInviteSystemMessage";
import { createReferralSystemMessage } from "./ReferralSystemMessage";
import { createVoiceSessionSystemMessage } from "./VoiceSessionSystemMessage";
import { createFriendRequestAcceptedSystemMessage } from "./FriendRequestAcceptedSystemMessage";
import { createGiftIntentSystemMessage } from "./GiftIntentSystemMessage";
export function createSystemMessageContent(a0) {
const type = a0.message.type;
if (MessageTypes.RECIPIENT_ADD === type) {
return createAddRecipientSystemMessage(a0);
}
if (MessageTypes.RECIPIENT_REMOVE === type) {
return createRemoveRecipientSystemMessage(a0);
}
if (MessageTypes.CALL === type) {
return createCallSystemMessage(a0);
}
if (MessageTypes.CHANNEL_NAME_CHANGE === type) {
return createChangeChannelNameSystemMessage(a0);
}
if (MessageTypes.CHANNEL_ICON_CHANGE === type) {
return createChangeChannelIconSystemMessage(a0);
}
if (MessageTypes.CHANNEL_PINNED_MESSAGE === type) {
return createChannelPinnedMessageSystemMessage(a0);
}
if (MessageTypes.USER_JOIN === type) {
return createUserJoinSystemMessage(a0);
}
if (MessageTypes.GUILD_BOOST === type) {
return createUserPremiumGuildSubscriptionSystemMessage(a0);
}
if (MessageTypes.GUILD_BOOST_TIER_1 === type) {
return createUserPremiumGuildSubscriptionTierAchievedSystemMessage(a0, BoostedGuildTiers.TIER_1);
}
if (MessageTypes.GUILD_BOOST_TIER_2 === type) {
return createUserPremiumGuildSubscriptionTierAchievedSystemMessage(a0, BoostedGuildTiers.TIER_2);
}
if (MessageTypes.GUILD_BOOST_TIER_3 === type) {
return createUserPremiumGuildSubscriptionTierAchievedSystemMessage(a0, BoostedGuildTiers.TIER_3);
}
if (MessageTypes.CHANNEL_FOLLOW_ADD === type) {
return createChannelFollowAddSystemMessage(a0);
}
if (MessageTypes.GUILD_STREAM === type) {
return createGuildStreamSystemMessage(a0);
}
if (MessageTypes.GUILD_DISCOVERY_DISQUALIFIED === type) {
return createGuildDiscoveryDisqualifiedSystemMessage(a0);
}
if (MessageTypes.GUILD_DISCOVERY_REQUALIFIED === type) {
return createGuildDiscoveryRequalifiedSystemMessage(a0);
}
if (MessageTypes.GUILD_DISCOVERY_GRACE_PERIOD_INITIAL_WARNING === type) {
return createGuildDiscoveryGracePeriodInitialWarningSystemMessage(a0);
}
if (MessageTypes.GUILD_DISCOVERY_GRACE_PERIOD_FINAL_WARNING === type) {
return createGuildDiscoveryGracePeriodFinalWarningSystemMessage(a0);
}
if (MessageTypes.CHAT_INPUT_COMMAND !== type && MessageTypes.CONTEXT_MENU_COMMAND !== type) {
if (MessageTypes.GUILD_INVITE_REMINDER === type) {
return null;
}
if (MessageTypes.THREAD_CREATED === type) {
return createNewThreadSystemMessage(a0);
}
if (MessageTypes.THREAD_STARTER_MESSAGE === type) {
return createThreadStarterSystemMessage(a0);
}
if (MessageTypes.AUTO_MODERATION_ACTION === type) {
return createAutoModerationActionSystemMessage(a0);
}
if (MessageTypes.ROLE_SUBSCRIPTION_PURCHASE === type) {
return createRoleSubscriptionPurchaseSystemMessage(a0);
}
if (MessageTypes.PURCHASE_NOTIFICATION === type) {
return createPurchaseNotificationSystemMessage(a0);
}
if (MessageTypes.STAGE_START === type) {
return createStageStartSystemMessage(a0);
}
if (MessageTypes.STAGE_END === type) {
return createStageEndSystemMessage(a0);
}
if (MessageTypes.STAGE_TOPIC === type) {
return createStageTopicSystemMessage(a0);
}
if (MessageTypes.STAGE_SPEAKER === type) {
return createStageSpeakerSystemMessage(a0);
}
if (MessageTypes.STAGE_RAISE_HAND === type) {
return createStageRaiseHandSystemMessage(a0);
}
if (MessageTypes.GUILD_APPLICATION_PREMIUM_SUBSCRIPTION === type) {
return createApplicationSubscriptionPurchaseSystemMessage(a0);
}
if (MessageTypes.PRIVATE_CHANNEL_INTEGRATION_ADDED !== type && MessageTypes.PRIVATE_CHANNEL_INTEGRATION_REMOVED !== type) {
if (MessageTypes.GUILD_INCIDENT_ALERT_MODE_ENABLED === type) {
return createGuildAlertModeEnabledSystemMessage(a0);
}
if (MessageTypes.GUILD_INCIDENT_ALERT_MODE_DISABLED === type) {
return createGuildAlertModeDisabledSystemMessage(a0);
}
if (MessageTypes.GUILD_INCIDENT_REPORT_RAID === type) {
return createGuildReportRaidSystemMessage(a0);
}
if (MessageTypes.GUILD_INCIDENT_REPORT_FALSE_ALARM === type) {
return createGuildReportFalseAlarmSystemMessage(a0);
}
if (MessageTypes.POLL_RESULT === type) {
return createPollResultSystemMessage(a0);
}
if (MessageTypes.CHANNEL_LINKED_TO_LOBBY === type) {
return createChannelLinkedToLobbySystemMessage(a0);
}
if (MessageTypes.IN_GAME_MESSAGE_NUX === type) {
return createInGameMessageNuxSystemMessage(a0);
}
if (MessageTypes.GUILD_JOIN_REQUEST_ACCEPT_NOTIFICATION !== type && MessageTypes.GUILD_JOIN_REQUEST_REJECT_NOTIFICATION !== type && MessageTypes.GUILD_JOIN_REQUEST_WITHDRAWN_NOTIFICATION !== type) {
if (MessageTypes.PREMIUM_GROUP_INVITE === type) {
return createPremiumGroupInviteSystemMessage(a0);
}
if (MessageTypes.PREMIUM_REFERRAL === type) {
return createReferralSystemMessage(a0);
}
if (MessageTypes.VOICE_SESSION === type) {
return createVoiceSessionSystemMessage(a0);
}
if (MessageTypes.FRIEND_REQUEST_ACCEPTED === type) {
return createFriendRequestAcceptedSystemMessage(a0);
}
if (MessageTypes.GIFTING_PROMPT === type) {
return createGiftIntentSystemMessage(a0);
}
return null;
}
return createJoinRequestNotificationSystemMessage(a0);
}
return createPrivateChannelIntegrationSystemMessage(a0, a0.message.type);
}
return createApplicationCommandSourceSystemMessage(a0);
}
@@ -0,0 +1,15 @@
// Metro module 7794 (f7795).
import ReferencedMessageStore, { ReferencedMessageState } from "../../../../replies/ReferencedMessageStore";
import { MessageTypes } from "../../../../../Constants";
import Module38 from "../../../../../_bundle/Module38";
import { intl, t } from "../../../../../intl/index.native";
import createCommonMessage from "./createCommonMessage";
export function createThreadStarterSystemMessage(a0) {
const message = a0.message;
const { messageReference, type } = message;
Module38(type === MessageTypes.THREAD_STARTER_MESSAGE, `cannot call createThreadStarterSystemMessage on a message of type ${type}`);
return ReferencedMessageStore.getMessageByReference(messageReference).state !== ReferencedMessageState.LOADED ? {
content: intl.string(t.OCs36J),
...createCommonMessage(a0)
} : null;
}
@@ -0,0 +1,42 @@
// Metro module 7766 (f7767).
import ChannelStore from "../../../../../stores/ChannelStore";
import GuildStore from "../../../../../stores/GuildStore";
import { SystemChannelFlags } from "../../../../../Constants";
import { getMessageAuthorWithProcessedColor } from "./useAuthorWithProcessedColor";
import SystemMessageUtils from "../../../../../utils/SystemMessageUtils";
import { computeIsStickerReplyEnabled } from "./useIsStickerReplyEnabled";
import { transformSticker } from "./transformSticker";
import { pickWelcomeSticker } from "../../../../welcome_cta/WelcomeCTAUtils";
import { intl, t } from "../../../../../intl/index.native";
import formatUsernameOnClick from "./formatUsernameOnClick";
import createCommonMessage from "./createCommonMessage";
export function createUserJoinSystemMessage(a0) {
const { message, roleStyle } = a0;
const messageAuthorWithProcessedColor = getMessageAuthorWithProcessedColor(message);
const channel = ChannelStore.getChannel(message.getChannelId());
const systemMessageUserJoinMobile = SystemMessageUtils.getSystemMessageUserJoinMobile(message.id);
const r31 = channel == null ? void 0 : channel.getGuildId();
const r33 = r31 != null;
let sticker = void 0;
if (r33) {
const r35 = channel != null;
sticker = void 0;
if (r35) {
const guild = GuildStore.getGuild(r31);
sticker = computeIsStickerReplyEnabled(r31, channel, message, guild != null && !(guild.systemChannelFlags & SystemChannelFlags.SUPPRESS_JOIN_NOTIFICATION_REPLIES)) ? transformSticker(pickWelcomeSticker(message.id)) : void 0;
}
}
return {
content: intl.formatToParts(systemMessageUserJoinMobile, {
username: messageAuthorWithProcessedColor.nick,
usernameOnClick: formatUsernameOnClick({
message,
author: messageAuthorWithProcessedColor,
roleStyle
})
}),
sticker,
stickerLabel: intl.string(t["7Tj6HT"]),
...createCommonMessage(a0)
};
}
@@ -0,0 +1,27 @@
// Metro module 7785 (f7786).
import getNumSubscriptionsPurchasedFromSystemMessage from "../../../../premium/getNumSubscriptionsPurchasedFromSystemMessage";
import { getMessageAuthorWithProcessedColor } from "./useAuthorWithProcessedColor";
import formatUsernameOnClick from "./formatUsernameOnClick";
import { intl, t } from "../../../../../intl/index.native";
import createCommonMessage from "./createCommonMessage";
export function createUserPremiumGuildSubscriptionSystemMessage(a0) {
const { message, roleStyle } = a0;
const numSubscriptionsPurchasedFromSystemMessage = getNumSubscriptionsPurchasedFromSystemMessage(message);
const messageAuthorWithProcessedColor = getMessageAuthorWithProcessedColor(message);
const usernameOnClick = formatUsernameOnClick({
message,
author: messageAuthorWithProcessedColor,
roleStyle
});
return {
content: numSubscriptionsPurchasedFromSystemMessage > 1 ? intl.formatToParts(t.rbj006, {
username: messageAuthorWithProcessedColor.nick,
usernameOnClick,
numSubscriptions: numSubscriptionsPurchasedFromSystemMessage
}) : intl.formatToParts(t.ihxM9x, {
username: messageAuthorWithProcessedColor.nick,
usernameOnClick
}),
...createCommonMessage(a0)
};
}
@@ -0,0 +1,43 @@
// Metro module 7787 (f7788).
import ChannelStore from "../../../../../stores/ChannelStore";
import GuildStore from "../../../../../stores/GuildStore";
import { createUserPremiumGuildSubscriptionSystemMessage } from "./UserPremiumGuildSubscriptionSystemMessage";
import getNumSubscriptionsPurchasedFromSystemMessage from "../../../../premium/getNumSubscriptionsPurchasedFromSystemMessage";
import { getMessageAuthorWithProcessedColor } from "./useAuthorWithProcessedColor";
import formatUsernameOnClick from "./formatUsernameOnClick";
import { intl, t } from "../../../../../intl/index.native";
import { getTierName } from "../../../../../utils/GuildBoostingUtils";
import createCommonMessage from "./createCommonMessage";
export function createUserPremiumGuildSubscriptionTierAchievedSystemMessage(a0, a1) {
const { message, roleStyle } = a0;
const channel = ChannelStore.getChannel(message.getChannelId());
if (channel == null) {
return createUserPremiumGuildSubscriptionSystemMessage(a0);
}
const guild = GuildStore.getGuild(channel.getGuildId());
if (guild == null) {
return createUserPremiumGuildSubscriptionSystemMessage(a0);
}
const numSubscriptionsPurchasedFromSystemMessage = getNumSubscriptionsPurchasedFromSystemMessage(message);
const messageAuthorWithProcessedColor = getMessageAuthorWithProcessedColor(message);
const usernameOnClick = formatUsernameOnClick({
message,
author: messageAuthorWithProcessedColor,
roleStyle
});
return {
content: numSubscriptionsPurchasedFromSystemMessage > 1 ? intl.formatToParts(t.GjNvr7, {
username: messageAuthorWithProcessedColor.nick,
usernameOnClick,
guildName: guild.name,
newTierName: getTierName(a1),
numSubscriptions: numSubscriptionsPurchasedFromSystemMessage
}) : intl.formatToParts(t.oAYAP7, {
username: messageAuthorWithProcessedColor.nick,
usernameOnClick,
guildName: guild.name,
newTierName: getTierName(a1)
}),
...createCommonMessage(a0)
};
}
@@ -0,0 +1,69 @@
// Metro module 7845 (f7846).
import ChannelStore from "../../../../../stores/ChannelStore";
import getHumanizedCallDuration from "../../../getHumanizedCallDuration";
import { getMessageAuthorWithProcessedColor, getUserAuthorWithProcessedColor } from "./useAuthorWithProcessedColor";
import { getSortedVoiceSessionParticipants } from "../../../VoiceSessionUtils";
import { intl, t } from "../../../../../intl/index.native";
import formatUsernameOnClick from "./formatUsernameOnClick";
import createCommonMessage from "./createCommonMessage";
export function createVoiceSessionSystemMessage(a0) {
let content;
const { message, roleStyle } = a0;
const channel = ChannelStore.getChannel(message.channel_id);
const humanizedCallDuration = getHumanizedCallDuration(message);
const messageAuthorWithProcessedColor = getMessageAuthorWithProcessedColor(message);
const r13 = getSortedVoiceSessionParticipants(message).map((item) => ({
user: item,
messageAuthor: getUserAuthorWithProcessedColor(item, channel)
}));
if (humanizedCallDuration == null) {
content = intl.formatToParts(t.HzBfIN, {
username: messageAuthorWithProcessedColor.nick,
usernameOnClick: formatUsernameOnClick({
message,
author: messageAuthorWithProcessedColor,
roleStyle
})
});
} else {
const atbXuX = t.atbXuX;
const r45 = {
userCount: r13.length + 1,
username: messageAuthorWithProcessedColor.nick,
usernameOnClick: formatUsernameOnClick({
message,
author: messageAuthorWithProcessedColor,
roleStyle
}),
username2: null,
username2OnClick: null,
username3: null,
username3OnClick: null,
otherCount: null,
duration: null
};
const r50 = r13[0];
r45.username2 = r50 == null ? void 0 : r50.messageAuthor.nick;
r45.username2OnClick = r13[0] != null ? formatUsernameOnClick({
userId: r13[0].user.id,
message,
author: r13[0].messageAuthor,
roleStyle
}) : void 0;
const r62 = r13[1];
r45.username3 = r62 == null ? void 0 : r62.messageAuthor.nick;
r45.username3OnClick = r13[1] != null ? formatUsernameOnClick({
userId: r13[1].user.id,
message,
author: r13[1].messageAuthor,
roleStyle
}) : void 0;
r45.otherCount = r13.length - 1;
r45.duration = humanizedCallDuration;
content = intl.formatToParts(atbXuX, r45);
}
return {
content,
...createCommonMessage(a0)
};
}
@@ -0,0 +1,33 @@
// Metro module 7746 (f7747).
import ChannelStore from "../../../../../stores/ChannelStore";
import { createNativeStyleProperties, experimental_createToken } from "../../../../../design/components/Styles/native/createStyles";
import { isThemeDark } from "../../../../../design/shared";
import { hexWithOpacity } from "../../../../../utils/ColorUtils";
import Module712 from "../../../../../_bundle/Module712";
import { calendarFormat } from "../../../../../utils/DateUtils";
import { getAssetUriForEmbed } from "../EmbedUtils";
import Module7747 from "../../../../../_bundle/Module7747";
import Module7748 from "../../../../../_bundle/Module7748";
import { createMessageAccessibilityActions } from "../../MessageAccessibilityActions";
const nativeStyleProperties = createNativeStyleProperties({
timestampColor: Module712.colors.TEXT_MUTED,
highlightColor: experimental_createToken((a0) => isThemeDark(a0.theme) ? hexWithOpacity(Module712.unsafe_rawColors.WHITE, 0.1) : "rgba(201,210,240,0.6)")
});
export default function createCommonMessage({ message, theme, reactions }) {
const r9 = nativeStyleProperties(theme);
const channel = ChannelStore.getChannel(message.channel_id);
return {
id: message.id,
channelId: message.channel_id,
type: message.type,
mentioned: message.mentioned,
timestamp: calendarFormat(message.timestamp, true),
timestampColor: r9.timestampColor,
dark: isThemeDark(theme),
highlightColor: r9.highlightColor,
reactions,
swipeToReplyIconUrl: getAssetUriForEmbed(Module7747),
swipeToEditIconUrl: getAssetUriForEmbed(Module7748),
accessibilityActions: createMessageAccessibilityActions(message, channel)
};
};
@@ -0,0 +1,27 @@
// Metro module 7745 (f7746).
import { isNativeMessageEligibleForEnhancedRoleColors } from "../../../../premium/enhanced_role_colors/native/EnhancedRoleColorUtils";
export default function formatUsernameOnClick(a0) {
let userId = a0.userId;
const { message, author, roleStyle } = a0;
let messageChannelId = a0.messageChannelId;
const { colorString, colorStrings, guildId } = author;
if (userId == null) {
userId = message.author.id;
}
const linkColor = roleStyle === "username" ? colorString : null;
const roleColors = isNativeMessageEligibleForEnhancedRoleColors(guildId, userId) ? colorStrings : null;
const shouldShowRoleDot = roleStyle === "dot" && colorString != null;
if (messageChannelId == null) {
messageChannelId = message.channel_id;
}
return {
action: "bindUserMenu",
userId,
linkColor,
roleColor: colorString,
roleColors,
shouldShowRoleDot,
messageChannelId,
medium: true
};
};
@@ -0,0 +1,39 @@
// Metro module 7780 (f7781).
import { useMemo } from "react";
import { StickerAnimationSettings } from "../../../../stickers/StickersConstants";
import { getStickerAssetUrl } from "../../../../stickers/StickersUtils";
import { NativeLottieRenderMode } from "../../../../stickers/native/NativeLottieView";
import { intl, t } from "../../../../../intl/index.native";
import { AnimateStickers } from "../../../../user_settings/UserSettings";
import * as _AccessibilityLabelOptimizationExperiment from "../../../../a11y/native/AccessibilityLabelOptimizationExperiment";
const transform = function transform(sticker, a1, shouldSkipAccessibilityLabels) {
let id = sticker.id;
if (id == null) {
id = "";
}
let url = getStickerAssetUrl(sticker, {
isPreview: !a1
});
if (url == null) {
url = "";
}
return {
...sticker,
asset: id,
url,
renderMode: a1 ? NativeLottieRenderMode.LOOP : NativeLottieRenderMode.STILL,
accessibilityLabel: shouldSkipAccessibilityLabels ? intl.string(t["fT+Yjp"]) : intl.formatToPlainString(t.rk6pOw, {
stickerName: sticker.name
}),
accessibilityHint: intl.string(t.GCEruV)
};
};
export default function useTransformedSticker({ sticker, isStickerReplyEnabled }) {
const r1 = AnimateStickers.useSetting() === StickerAnimationSettings.ALWAYS_ANIMATE;
let c16025_2 = r1;
const shouldSkipAccessibilityLabels = _AccessibilityLabelOptimizationExperiment.shouldSkipAccessibilityLabels();
return useMemo(() => isStickerReplyEnabled ? transform(sticker, c16025_2, shouldSkipAccessibilityLabels) : void 0, [r1, isStickerReplyEnabled, shouldSkipAccessibilityLabels, sticker]);
};
export function transformSticker(a0) {
return transform(a0, AnimateStickers.getSetting() === StickerAnimationSettings.ALWAYS_ANIMATE, _AccessibilityLabelOptimizationExperiment.shouldSkipAccessibilityLabels());
}
@@ -0,0 +1,24 @@
// Metro module 7743 (f7744).
import { processColor } from "react-native";
import { getMessageAuthor, getUserAuthor } from "../../../useMessageAuthor";
import { processColorStrings } from "../../../../premium/enhanced_role_colors/native/EnhancedRoleColorUtils";
export function getMessageAuthorWithProcessedColor(a0) {
const messageAuthor = getMessageAuthor(a0);
const { nick, colorString, colorStrings, guildId } = messageAuthor;
return {
nick,
colorString: colorString != null ? processColor(colorString) : void 0,
colorStrings: processColorStrings(colorStrings),
guildId
};
}
export function getUserAuthorWithProcessedColor(a0, a1) {
const userAuthor = getUserAuthor(a0, a1);
const { nick, colorString, colorStrings, guildId } = userAuthor;
return {
nick,
colorString: colorString != null ? processColor(colorString) : void 0,
colorStrings: processColorStrings(colorStrings),
guildId
};
}
@@ -0,0 +1,26 @@
// Metro module 7779 (f7780).
import GuildMemberStore from "../../../../../stores/GuildMemberStore";
import PermissionStore from "../../../../../stores/PermissionStore";
import UserStore from "../../../../../stores/UserStore";
import { Permissions } from "../../../../../Constants";
import { computeIsReadOnlyThread } from "../../../../threads/ThreadHooks";
export function computeIsStickerReplyEnabled(a0, a1, a2, a3) {
const currentUser = UserStore.getCurrentUser();
const r9 = currentUser != null && GuildMemberStore.getMember(a0, currentUser.id)?.isPending;
const r21 = computeIsReadOnlyThread(a1);
let r26 = PermissionStore.can(Permissions.SEND_MESSAGES, a1);
const bot = a2.author.bot;
if (r26) {
r26 = !r21;
}
if (r26) {
r26 = !r9;
}
if (r26) {
r26 = !bot;
}
if (r26) {
r26 = a3;
}
return r26;
}
Loaded 100 of 33051 files, more files were not shown because too many files have changed in this diff. Show more