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

File diff suppressed because it is too large. Load diff
+288
View File
@@ -0,0 +1,288 @@
// Metro module 5778 (f5779).
import EmbeddedActivitiesStore from "../activities/EmbeddedActivitiesStore";
import GatedChannelStore from "../channel/GatedChannelStore";
import GuildScheduledEventStore from "../guild_scheduled_events/GuildScheduledEventStore";
import ActiveJoinedThreadsStore from "../threads/ActiveJoinedThreadsStore";
import JoinedThreadsStore from "../threads/JoinedThreadsStore";
import UserSettingsProtoStore from "../user_settings/UserSettingsProtoStore";
import AuthenticationStore from "../../stores/AuthenticationStore";
import CategoryCollapseStore from "../../stores/CategoryCollapseStore";
import ChannelStore from "../../stores/ChannelStore";
import CollapsedVoiceChannelStore from "../../stores/CollapsedVoiceChannelStore";
import DetectableGameStore from "../../stores/DetectableGameStore";
import PermissionStore from "../../stores/PermissionStore";
import ReadStateStore from "../../stores/ReadStateStore";
import SelectedChannelStore from "../../stores/SelectedChannelStore";
import UserGuildSettingsStore from "../../stores/UserGuildSettingsStore";
import { UserSettingsTypes } from "../user_settings/UserSettingsConstants";
import ChannelListState from "./ChannelListState";
import Module12 from "../../_bundle/Module12";
import { isNotNullish } from "../../utils/GlobalUtils";
import { getEmbeddedActivityLocationGuildId, getEmbeddedActivityLocationChannelId } from "../activities/utils/embeddedActivityLocationUtils";
import SnowflakeUtils from "../../utils/SnowflakeUtils";
import Module589 from "../../_bundle/Module589";
import Dispatcher from "../../Dispatcher";
let channelId, voiceChannelId, c3594_21, handleChannelSelect;
const handleReset = function handleReset() {
const channelId2 = SelectedChannelStore.getChannelId();
const voiceChannelId2 = SelectedChannelStore.getVoiceChannelId();
channelId = channelId2;
voiceChannelId = voiceChannelId2;
return c3594_21.clear();
};
const handleGuildAction = function handleGuildAction(a0) {
return c3594_21.clearGuildId(a0.guild.id);
};
const handleChannelAction = function handleChannelAction(a0) {
return c3594_21.clearGuildId(a0.channel.guild_id);
};
const handleRebuildGuildId = function handleRebuildGuildId(a0) {
return c3594_21.clearGuildId(a0.guildId);
};
const handleReadStateChange = function handleReadStateChange(a0) {
return c3594_21.nonPositionalChannelIdUpdate(a0.channelId);
};
const handleThreadUpdate = function handleThreadUpdate(a0) {
return c3594_21.nonPositionalChannelIdUpdate(a0.channel.id);
};
const handleThreadMemberUpdate = function handleThreadMemberUpdate(a0) {
return c3594_21.nonPositionalChannelIdUpdate(a0.id);
};
handleChannelSelect = function handleChannelSelect() {
const channelId2 = SelectedChannelStore.getChannelId();
const voiceChannelId2 = SelectedChannelStore.getVoiceChannelId();
let r13 = !!(channelId !== channelId2 || voiceChannelId !== voiceChannelId2);
if (r13) {
Module12([channelId, voiceChannelId, channelId2, voiceChannelId2]).uniq().forEach((item) => {
if (item != null) {
c3594_21.nonPositionalChannelIdUpdate(item);
}
});
channelId = channelId2;
voiceChannelId = voiceChannelId2;
r13 = true;
}
return r13;
};
const handleCategoryChange = function handleCategoryChange({ id }) {
const channel = ChannelStore.getChannel(id);
return channel == null ? c3594_21.clearGuildId(id) : c3594_21.clearGuildId(channel.guild_id);
};
const handleVoiceChannelsChange = function handleVoiceChannelsChange(a0) {
return c3594_21.clearGuildId(a0.guildId);
};
const handleRecomputeAllSubtitles = function handleRecomputeAllSubtitles() {
return c3594_21.updateSubtitles();
};
const handleGuildScheduledEventUpdate = function handleGuildScheduledEventUpdate(a0) {
return c3594_21.updateSubtitles(a0.guildScheduledEvent.guild_id);
};
channelId = null;
voiceChannelId = null;
c3594_21 = new ChannelListState();
class ChannelListStore extends Module589.Store {
static displayName = "ChannelListStore";
initialize() {
this.waitFor(ActiveJoinedThreadsStore, AuthenticationStore, CategoryCollapseStore, ChannelStore, CollapsedVoiceChannelStore, EmbeddedActivitiesStore, DetectableGameStore, GatedChannelStore, GuildScheduledEventStore, JoinedThreadsStore, PermissionStore, ReadStateStore, SelectedChannelStore, UserGuildSettingsStore, UserSettingsProtoStore);
}
getGuild(a0, a1) {
let r7 = a1?.guildActionRows;
if (r7 == null) {
r7 = [];
}
let r4 = a1?.channelNoticeRows;
if (r4 == null) {
r4 = [];
}
const guild = c3594_21.getGuild(a0, r7, r4);
return {
guildChannelsVersion: guild.version,
guildChannels: guild
};
}
getGuildWithoutChangingGuildActionRows(a0) {
const guildChannelRowsOnly = c3594_21.getGuildChannelRowsOnly(a0);
return {
guildChannelsVersion: guildChannelRowsOnly.version,
guildChannels: guildChannelRowsOnly
};
}
recentsChannelCount(a0) {
if (a0 == null) {
return 0;
}
const guildChannelRowsOnly = c3594_21.getGuildChannelRowsOnly(a0);
return guildChannelRowsOnly.getCategoryFromSection(guildChannelRowsOnly.recentsSectionNumber).getShownChannelIds().length;
}
}
const channelListStore = new ChannelListStore(Dispatcher, {
APPLICATION_FETCH_FAIL: handleRecomputeAllSubtitles,
APPLICATION_FETCH_SUCCESS: handleRecomputeAllSubtitles,
APPLICATION_FETCH: handleRecomputeAllSubtitles,
APPLICATIONS_FETCH_FAIL: handleRecomputeAllSubtitles,
APPLICATIONS_FETCH_SUCCESS: handleRecomputeAllSubtitles,
APPLICATIONS_FETCH: handleRecomputeAllSubtitles,
BACKGROUND_SYNC: handleReset,
BULK_ACK: function handleBulkAck({ channels }) {
let c15143_0 = false;
Module12(channels).map((item) => ChannelStore.getChannel(item.channelId)?.guild_id).filter(isNotNullish).uniq().forEach((item) => {
if (c3594_21.clearGuildId(item)) {
c15143_0 = true;
}
});
return c15143_0;
},
BULK_CLEAR_RECENTS: handleRebuildGuildId,
CACHE_LOADED_LAZY: handleReset,
CATEGORY_COLLAPSE_ALL: handleRebuildGuildId,
CATEGORY_COLLAPSE: handleCategoryChange,
CATEGORY_EXPAND_ALL: handleRebuildGuildId,
CATEGORY_EXPAND: handleCategoryChange,
CHANNEL_ACK: handleReadStateChange,
CHANNEL_COLLAPSE: function handleChannelCollapse(a0) {
return c3594_21.clearGuildId(ChannelStore.getChannel(a0.channelId)?.guild_id);
},
CHANNEL_CREATE: handleChannelAction,
CHANNEL_DELETE: handleChannelAction,
CHANNEL_LOCAL_ACK: handleReadStateChange,
CHANNEL_MUTE_EXPIRED: handleRebuildGuildId,
CHANNEL_RTC_UPDATE_CHAT_OPEN: handleReadStateChange,
CHANNEL_SELECT: handleChannelSelect,
CHANNEL_INFO: function handleChannelInfo(a0) {
return c3594_21.clearGuildId(a0.guildId);
},
CHANNEL_UPDATES: function handleChannelUpdates({ channels }) {
let c15144_0 = false;
Module12(channels).map((item) => item.guild_id).uniq().forEach((item) => {
if (c3594_21.clearGuildId(item)) {
c15144_0 = true;
}
});
return c15144_0;
},
CONNECTION_OPEN_SUPPLEMENTAL: handleRecomputeAllSubtitles,
CONNECTION_OPEN: handleReset,
CURRENT_USER_UPDATE: handleReset,
DECAY_READ_STATES: handleReset,
DEV_TOOLS_DESIGN_TOGGLE_SET: handleReset,
DISABLE_AUTOMATIC_ACK: handleReadStateChange,
DISMISS_FAVORITE_SUGGESTION: function handleFavoriteSuggestionDimissed(a0) {
return c3594_21.nonPositionalChannelIdUpdate(a0.channelId);
},
EMBEDDED_ACTIVITY_UPDATE_V2: function handleEmbeddedActivityUpdateV2({ instance }) {
return c3594_21.updateSubtitles(getEmbeddedActivityLocationGuildId(instance.location), getEmbeddedActivityLocationChannelId(instance.location));
},
EMBEDDED_ACTIVITY_LAUNCH_START: function handleEmbeddedActivityLaunchStart() {
c3594_21.updateSubtitles();
},
EMBEDDED_ACTIVITY_LAUNCH_SUCCESS: handleRecomputeAllSubtitles,
ENABLE_AUTOMATIC_ACK: handleReadStateChange,
FETCH_GUILD_EVENTS_FOR_GUILD: function handleFetchGuildEventsForGuild(a0) {
return c3594_21.updateSubtitles(a0.guildId);
},
GAMES_DATABASE_FETCH_FAIL: handleRecomputeAllSubtitles,
GAMES_DATABASE_FETCH: handleRecomputeAllSubtitles,
GAMES_DATABASE_UPDATE: handleRecomputeAllSubtitles,
GUILD_APPLICATIONS_FETCH_SUCCESS: handleRecomputeAllSubtitles,
GUILD_CREATE: handleGuildAction,
GUILD_DELETE: handleGuildAction,
GUILD_MEMBER_UPDATE: function handleGuildMemberUpdate({ guildId, user }) {
return AuthenticationStore.getId() === user.id && c3594_21.clearGuildId(guildId);
},
GUILD_MUTE_EXPIRED: handleRebuildGuildId,
GUILD_ROLE_CREATE: handleRebuildGuildId,
GUILD_ROLE_DELETE: handleRebuildGuildId,
GUILD_ROLE_SUBSCRIPTIONS_FETCH_RESTRICTIONS_FAILURE: handleRebuildGuildId,
GUILD_ROLE_SUBSCRIPTIONS_FETCH_RESTRICTIONS_SUCCESS: handleRebuildGuildId,
GUILD_ROLE_UPDATE: handleRebuildGuildId,
GUILD_SCHEDULED_EVENT_CREATE: handleGuildScheduledEventUpdate,
GUILD_SCHEDULED_EVENT_DELETE: handleGuildScheduledEventUpdate,
GUILD_SCHEDULED_EVENT_UPDATE: handleGuildScheduledEventUpdate,
GUILD_TOGGLE_COLLAPSE_MUTED: handleRebuildGuildId,
GUILD_UPDATE: handleGuildAction,
IMPERSONATE_STOP: handleRebuildGuildId,
IMPERSONATE_UPDATE: handleRebuildGuildId,
LOAD_CHANNELS: function handleLoadChannels(a0) {
a0.channels.forEach((channel) => c3594_21.clearGuildId(channel.guildId));
},
LOAD_MESSAGES_SUCCESS: handleReadStateChange,
MESSAGE_ACK: handleReadStateChange,
MESSAGE_CREATE: function handleMessageCreate(a0) {
return c3594_21.nonPositionalChannelIdUpdate(a0.channelId);
},
MESSAGE_DELETE_BULK: handleReadStateChange,
MESSAGE_DELETE: handleReadStateChange,
NOTIFICATION_SETTINGS_UPDATE: handleReset,
OVERLAY_INITIALIZE: handleReset,
PASSIVE_UPDATE_V2: function handlePassiveUpdateV2(a0) {
return c3594_21.clearGuildId(a0.guildId);
},
RECOMPUTE_READ_STATES: handleReset,
RESORT_THREADS: handleReadStateChange,
SET_RECENTLY_ACTIVE_COLLAPSED: handleReset,
THREAD_CREATE: handleThreadUpdate,
THREAD_DELETE: function handleThreadDelete(a0) {
return c3594_21.nonPositionalChannelUpdate(a0.channel);
},
THREAD_LIST_SYNC: handleRebuildGuildId,
THREAD_MEMBER_UPDATE: handleThreadMemberUpdate,
THREAD_MEMBERS_UPDATE: handleThreadMemberUpdate,
THREAD_UPDATE: handleThreadUpdate,
TRY_ACK: handleReadStateChange,
UPDATE_CHANNEL_DIMENSIONS: handleReadStateChange,
UPDATE_CHANNEL_LIST_SUBTITLES: function handleUpdateSubtitles(a0) {
c3594_21.updateSubtitles(a0.guildId);
},
USER_GUILD_SETTINGS_CHANNEL_UPDATE_BULK: handleRebuildGuildId,
USER_GUILD_SETTINGS_CHANNEL_UPDATE: handleRebuildGuildId,
USER_GUILD_SETTINGS_FULL_UPDATE: function handleUserGuildSettingsFullUpdate(a0) {
a0.userGuildSettings.forEach((userGuildSetting) => c3594_21.clearGuildId(userGuildSetting.guild_id));
},
USER_GUILD_SETTINGS_GUILD_AND_CHANNELS_UPDATE: handleRebuildGuildId,
USER_GUILD_SETTINGS_GUILD_UPDATE: handleRebuildGuildId,
USER_SETTINGS_PROTO_UPDATE: function handleSettingsProtoUpdate({ settings }) {
if (settings.type !== UserSettingsTypes.PRELOADED_USER_SETTINGS) {
return false;
}
const guilds = settings.proto.guilds?.guilds;
let c15145_1 = false;
if (guilds != null) {
SnowflakeUtils.keys(guilds).forEach((item) => {
if (guilds[item].guildRecentsDismissedAt != null) {
c15145_1 = c3594_21.updateRecentsCategory(item) || c15145_1;
}
});
}
return c15145_1;
},
VOICE_CATEGORY_COLLAPSE: handleVoiceChannelsChange,
VOICE_CATEGORY_EXPAND: handleVoiceChannelsChange,
VOICE_CHANNEL_SELECT: handleChannelSelect,
VOICE_CHANNEL_STATUS_UPDATE: function handleVoiceChannelStatusUpdate(a0) {
return c3594_21.nonPositionalChannelIdUpdate(a0.id);
},
VOICE_STATE_UPDATES: function handleVoiceStateUpdates({ voiceStates }) {
let r25 = handleChannelSelect();
const set = new Set();
for (const item of voiceStates) {
const { channelId: channelId2, oldChannelId } = item;
if (!(oldChannelId == null || set.has(oldChannelId))) {
if (c3594_21.nonPositionalChannelIdUpdate(oldChannelId)) {
r25 = true;
}
set.add(oldChannelId);
}
if (!(channelId2 == null || set.has(channelId2))) {
if (c3594_21.nonPositionalChannelIdUpdate(channelId2)) {
r25 = true;
}
set.add(channelId2);
}
}
return r25;
},
WINDOW_FOCUS: function handleCurrentChannelReadStateChange() {
return channelId != null && c3594_21.nonPositionalChannelIdUpdate(channelId);
}
});
export default channelListStore;
@@ -0,0 +1,19 @@
// Metro module 4373 (f4374).
export function hasStream(a0) {
if (a0 == null) {
return false;
}
const length = a0.length;
let r0 = 0;
if (0 < length) {
do {
const selfStream = a0[r0].voiceState.selfStream;
const r1 = r0;
if (selfStream) {
return true;
}
r0 = r1 + 1;
} while (r0 < a0.length);
}
return false;
}
@@ -0,0 +1,37 @@
// Metro module 5787 (f5788).
import Module589 from "../../_bundle/Module589";
import Dispatcher from "../../Dispatcher";
let c3602_0;
const handleChange = function handleChange({ guildId, expand }) {
if (expand) {
c3602_0[guildId] = true;
} else {
delete c3602_0[guildId];
}
};
c3602_0 = {};
class ChannelListVoiceCategoryStore extends Module589.PersistedStore {
static displayName = "ChannelListVoiceCategoryStore";
static persistKey = "ChannelListVoiceCategoryStore";
initialize(a0) {
c3602_0 = a0 == null ? {} : a0;
}
isVoiceCategoryExpanded(a0) {
let r1 = a0 != null && c3602_0[a0];
if (r1 == null) {
r1 = false;
}
return r1;
}
isVoiceCategoryCollapsed(a0) {
return !this.isVoiceCategoryExpanded(a0);
}
getState() {
return c3602_0;
}
}
const channelListVoiceCategoryStore = new ChannelListVoiceCategoryStore(Dispatcher, {
VOICE_CATEGORY_COLLAPSE: handleChange,
VOICE_CATEGORY_EXPAND: handleChange
});
export default channelListVoiceCategoryStore;
@@ -0,0 +1,405 @@
// Metro module 15231 (f15232).
import { useState, useMemo, useEffect } from "react";
import EmbeddedActivitiesStore from "../activities/EmbeddedActivitiesStore";
import FavoriteStore from "../favorites/FavoriteStore";
import { createFavoritesGuildChannelRecord } from "../favorites/utils/createFavoritesGuildChannelRecord";
import GatewayConnectionStore from "../gateway/GatewayConnectionStore";
import GuildScheduledEventStore from "../guild_scheduled_events/GuildScheduledEventStore";
import ActiveJoinedThreadsStore from "../threads/ActiveJoinedThreadsStore";
import JoinedThreadsStore from "../threads/JoinedThreadsStore";
import { THREAD_CHANNEL_TYPES } from "../../records/ChannelRecord";
import CategoryCollapseStore from "../../stores/CategoryCollapseStore";
import ChannelStore from "../../stores/ChannelStore";
import "../../stores/CollapsedVoiceChannelStore";
import DetectableGameStore from "../../stores/DetectableGameStore";
import PermissionStore from "../../stores/PermissionStore";
import ReadStateStore from "../../stores/ReadStateStore";
import SelectedChannelStore from "../../stores/SelectedChannelStore";
import UserGuildSettingsStore from "../../stores/UserGuildSettingsStore";
import { FAVORITES_RAW_GUILD_ID, MAX_FAVORITE_CHANNELS } from "../favorites/FavoritesConstants";
import "../../_bundle/Module505";
import { SECTION_INDEX_CHANNEL_NOTICES, SECTION_INDEX_GUILD_ACTIONS, SECTION_INDEX_FAVORITES, SECTION_INDEX_RECENTS, SECTION_INDEX_UNCATEGORIZED_CHANNELS, SECTION_INDEX_FIRST_NAMED_CATEGORY } from "./ChannelListState";
import { FavoriteChannelType } from "../../_bundle/Module1306";
import LazyLoadedThreadManager from "../threads/LazyLoadedThreadManager";
import { getFavoritesCategories, useFavoritesAccess } from "../favorites/FavoritesHooks";
import Module12 from "../../_bundle/Module12";
import { isNotNullish } from "../../utils/GlobalUtils";
function $mk110699($env) {
return (a0) => {
if (!a0.isPrivate()) {
const r27 = $env.$parent.$parent;
if (!r27[16].can(r27[22].VIEW_CHANNEL, a0)) {
return null;
}
}
const r12 = $env.$parent;
const r17 = r12[2];
const r2 = r17 != null && (r17.id === a0.id || r12[3] === a0.id);
const r14 = r17 != null && r17.isThread() && r17.parent_id === a0.id;
const r9 = $env;
let r44 = !r2 && (!r14 && r9[1]) ? $env.$parent.$parent[8].getActiveJoinedUnreadThreadsForParent(a0.guild_id, a0.id) : $env.$parent.$parent[8].getActiveJoinedRelevantThreadsForParent(a0.guild_id, a0.id);
if (r44 == null) {
r44 = {};
}
const r49 = $env.$parent.$parent;
const r16 = r49[0];
const r50 = r49[2];
const r15 = r16(r50[20]);
const r21 = r12[3];
const r52 = r12[1];
const threadIds = r15.computeThreadIds(a0, r44, r17, r21, r52);
const isCollapsed = r49[15].isCollapsed(a0.id);
const isThread = a0.isThread();
const r59 = r44;
const isMuted = isThread ? r49[9].isMuted(a0.id) : r49[19].isChannelMuted(a0.guild_id, a0.id);
const r74 = r49[1];
const r68 = {
id: a0.id,
record: a0,
category: r9[0],
position: r12[0][a0.id].order,
threadIds,
threadCount: r74(r50[24]).size(threadIds),
isCollapsed,
isMuted,
isFirstVoiceChannel: false,
subtitle: r16(r50[20]).computeSubtitle(a0, isCollapsed, false)
};
if (!r2 && !r14 && r74(r50[24]).isEmpty(r59)) {
const r88 = r49[17];
if (!(r88.getMentionCount(a0.id) > 0)) {
if (r52 && isMuted) {
return null;
}
L33: {
if (r9[1]) {
if (!isMuted && !r9[2] && !(0, r49[12])(a0.type)) {
if (!(0, r49[11])(a0.type)) {
break L33;
}
if (r88.hasUnread(a0.id) === false) {
return null;
}
break L33;
}
return null;
}
}
return r68;
}
}
return r68;
};
}
function $mk110700() {
return (a0) => {
const isGuildVocal = a0.record.isGuildVocal();
const position = a0.position;
return isGuildVocal ? position + 10000 : position;
};
}
let computeFavoritesState, c10816_23;
let env10816 = {};
const getMissingFavoriteThreadIds = function getMissingFavoriteThreadIds({ limit, includeLoading }) {
const favoriteChannels = FavoriteStore.getFavoriteChannels();
const r22 = [];
for (const key in favoriteChannels) {
if (r22.length >= limit) {
break;
}
const r17 = favoriteChannels[key];
if (r17.type === FavoriteChannelType.REFERENCE_ORIGINAL && r17.channelType != null && THREAD_CHANNEL_TYPES.has(r17.channelType) && ChannelStore.getChannel(key) == null) {
const loadState = LazyLoadedThreadManager.getLoadState(key);
if (loadState !== "NOT_FOUND" && (includeLoading || loadState !== "LOADING")) {
r22.push(key);
}
}
}
return r22;
};
computeFavoritesState = function computeFavoritesState(a0) {
const r8 = a0 == null ? FavoriteStore.getFavoriteChannels() : a0;
let env21786 = {
$parent: env10816
};
env21786[0] = r8;
const isGuildCollapsed = UserGuildSettingsStore.isGuildCollapsed(FAVORITES_RAW_GUILD_ID);
env21786[1] = isGuildCollapsed;
env21786[2] = ChannelStore.getChannel(SelectedChannelStore.getChannelId());
env21786[3] = SelectedChannelStore.getVoiceChannelId();
const r13 = [];
env21786[4] = r13;
const r12 = {};
env21786[5] = r12;
for (const key in r8) {
const r47 = r8[key];
const channel = ChannelStore.getChannel(r47.id);
if (channel != null) {
if (r47.type !== FavoriteChannelType.CATEGORY) {
const r55 = (0, createFavoritesGuildChannelRecord)(r8, r47, channel);
if (r47.parentId != null && r8[r47.parentId] != null && r8[r47.parentId].type === FavoriteChannelType.CATEGORY) {
const parentId = r47.parentId;
if (!(parentId in r12)) {
r12[parentId] = [];
}
r12[parentId].push(r55);
continue;
}
r13.push(r55);
}
}
}
env21786[6] = null;
const r75 = {
isMuted: false,
isCollapsed: false,
position: 0,
getChannelRecords: () => env21786[4],
getShownChannelIds: () => env21786[4].map((item) => item.id),
getShownChannelAndThreadIds: () => env21786[4].map((item) => item.id),
isEmpty: () => env21786[4].length === 0
};
Object.defineProperty(r75, "channelList", {
get: function() {
if (env21786[6] == null) {
let env27965;
const r6 = env21786[4];
const r3 = env27965 = {
$parent: env21786
};
env27965[0] = this;
env27965[1] = this.isCollapsed;
env27965[2] = this.isMuted;
env21786[6] = Module12(r6).map($mk110699(r3)).filter(isNotNullish).sortBy($mk110700()).value();
}
return env21786[6];
},
set: void 0,
enumerable: true,
configurable: true
});
env21786[7] = r75;
const r95 = getFavoritesCategories(r8).filter((item) => item.id != null).map(({ id }) => {
const categoryRecord = FavoriteStore.getCategoryRecord(id);
if (categoryRecord == null) {
return null;
}
let r15 = env21786[5][id];
if (r15 == null) {
r15 = [];
}
let c27966_0 = r15;
const isChannelMuted = UserGuildSettingsStore.isChannelMuted(FAVORITES_RAW_GUILD_ID, id);
const isCollapsed = CategoryCollapseStore.isCollapsed(id);
let c27966_1 = null;
let position = env21786[0][id]?.order;
if (position == null) {
position = 0;
}
const r21 = {
isMuted: isChannelMuted,
isCollapsed,
record: categoryRecord,
id,
position,
getChannelRecords: () => c27966_0,
getShownChannelIds: () => c27966_0.map((item) => item.id),
getShownChannelAndThreadIds: () => c27966_0.map((item) => item.id),
isEmpty: () => c27966_0.length === 0
};
Object.defineProperty(r21, "channelList", {
get: function() {
if (c27966_1 == null) {
let env30854;
const r8 = env21786;
const r3 = env30854 = {
$parent: r8
};
env30854[0] = this;
env30854[1] = this.isCollapsed;
env30854[2] = this.isMuted;
c27966_1 = Module12(c27966_0).map($mk110699(r3)).filter(isNotNullish).sortBy($mk110700()).value();
}
return c27966_1;
},
set: void 0,
enumerable: true,
configurable: true
});
return r21;
}).filter((item) => item != null);
env21786[8] = r95;
let r96 = 0;
const r97 = [r75, ...r95];
for (const item of r97) {
const position = r96 + 1;
r96 = position;
item.position = position;
for (const item2 of item.channelList) {
const position2 = r96 + 1;
r96 = position2;
item2.position = position2;
}
}
env21786[9] = {
isEmpty: () => true,
getRows: () => [],
getRow: () => null
};
env21786[10] = {
isEmpty: () => true,
getRows: () => [],
getRow: () => null
};
return {
id: FAVORITES_RAW_GUILD_ID,
hideMutedChannels: isGuildCollapsed,
favoritesSectionNumber: 1,
recentsSectionNumber: 2,
voiceChannelsSectionNumber: -999,
getSections: () => {
let r39;
const r5 = [];
let r0 = 0;
r5[SECTION_INDEX_CHANNEL_NOTICES] = 0;
r5[SECTION_INDEX_GUILD_ACTIONS] = 0;
r5[SECTION_INDEX_FAVORITES] = 0;
r5[SECTION_INDEX_RECENTS] = 0;
r5[SECTION_INDEX_UNCATEGORIZED_CHANNELS] = env21786[7].channelList.length;
if (0 < env21786[8].length) {
do {
const r11 = SECTION_INDEX_FIRST_NAMED_CATEGORY + r0;
const r13 = Math;
r39 = env21786[8];
r5[r11] = r13.max(1, r39[r0].channelList.length);
r0 = r0 + 1;
} while (r0 < r39.length);
}
return r5;
},
isPlaceholderRow: (a0, a1) => {
const r1 = a0 < SECTION_INDEX_FIRST_NAMED_CATEGORY || a1 !== 0;
return r1 ? !r1 : env21786[8][a0 - SECTION_INDEX_FIRST_NAMED_CATEGORY].channelList.length === 0;
},
getCategoryFromSection: (a0) => a0 === SECTION_INDEX_UNCATEGORIZED_CHANNELS ? env21786[7] : env21786[8][a0 - SECTION_INDEX_FIRST_NAMED_CATEGORY],
getNamedCategoryFromSection: (a0) => env21786[8][a0 - SECTION_INDEX_FIRST_NAMED_CATEGORY],
getChannelFromSectionRow: function getChannelFromSectionRow(a0, a1) {
const categoryFromSection = this.getCategoryFromSection(a0);
return categoryFromSection == null ? null : categoryFromSection.channelList[a1] == null ? null : {
category: categoryFromSection,
channel: categoryFromSection.channelList[a1]
};
},
getGuildActionSection: () => env21786[9],
getChannelNoticeSection: () => env21786[10],
getFirstVoiceChannel: () => null,
getSectionRowsFromChannel: (a0) => {
const r9 = [env21786[7], ...env21786[8]];
const r7 = 0 < r9.length;
let r4 = 0;
if (r7) {
do {
const r19 = 0 < r9[r4].channelList.length;
const r1 = r4;
let r0 = 0;
if (r19) {
do {
const id = r9[r1].channelList[r0].id;
const row = r0;
if (id === a0) {
return [{
section: r1 + SECTION_INDEX_UNCATEGORIZED_CHANNELS,
row
}];
}
r0 = row + 1;
} while (r0 < r9[r1].channelList.length);
}
r4 = r1 + 1;
} while (r4 < r9.length);
}
return [];
},
forEachShownChannel: (a0) => {
const r1 = [env21786[7], ...env21786[8]];
for (const item of r1) {
for (const item2 of item.channelList) {
a0(item2.record);
for (const threadId of item2.threadIds) {
const channel = ChannelStore.getChannel(threadId);
if (channel != null) {
a0(channel);
}
}
}
}
},
forEachChannel: (a0) => {
const r0 = [env21786[7], ...env21786[8]];
for (const item of r0) {
for (const item2 of item.getChannelRecords()) {
a0(item2);
}
}
},
getSlicedChannels: (a0) => [[], a0, []],
getChannels: () => []
};
};
c10816_23 = [EmbeddedActivitiesStore, FavoriteStore, GatewayConnectionStore, GuildScheduledEventStore, ActiveJoinedThreadsStore, JoinedThreadsStore, CategoryCollapseStore, ChannelStore, DetectableGameStore, PermissionStore, ReadStateStore, SelectedChannelStore, UserGuildSettingsStore];
export function useFavoritesGuildChannelList() {
let isConnected;
let hasAccess2 = useFavoritesAccess("FavoritesGuildChannelList").hasAccess;
const hasAccess = hasAccess2;
const [state, setState] = useState(() => computeFavoritesState());
isConnected = GatewayConnectionStore.isConnected();
let guildChannels = useMemo(() => computeFavoritesState({}), []);
useEffect(() => {
let c27967_0 = Module12.throttle(() => setState(computeFavoritesState()), 100);
c10816_23.forEach((item) => item.addChangeListener(c27967_0));
return () => c10816_23.forEach((item) => item.removeChangeListener(c27967_0));
}, []);
useEffect(() => {
let r2 = hasAccess;
if (hasAccess) {
r2 = isConnected;
}
if (r2) {
const missingFavoriteThreadIds = getMissingFavoriteThreadIds({
limit: MAX_FAVORITE_CHANNELS,
includeLoading: false
});
if (missingFavoriteThreadIds.length === 0) {
Promise.resolve();
} else {
LazyLoadedThreadManager.loadThreadsBulk(missingFavoriteThreadIds);
}
}
}, [hasAccess, isConnected]);
if (hasAccess) {
guildChannels = state;
}
if (hasAccess) {
hasAccess2 = getMissingFavoriteThreadIds({
limit: 1,
includeLoading: true
}).length > 0;
}
const r3 = guildChannels.getSections().length > SECTION_INDEX_FIRST_NAMED_CATEGORY;
let shouldShowEmptyState = false;
if (!r3) {
let c21788_0 = false;
guildChannels.forEachShownChannel(() => {
c21788_0 = true;
});
shouldShowEmptyState = !c21788_0;
}
if (shouldShowEmptyState) {
shouldShowEmptyState = !hasAccess2;
}
return {
guildChannels,
shouldShowEmptyState
};
}
export { computeFavoritesState };
@@ -0,0 +1,34 @@
// Metro module 5788 (f5789).
const r10 = {
GUILD_PREMIUM_PROGRESS_BAR: "guild-premium-progress-bar",
GUILD_SCHEDULED_EVENTS: "guild-scheduled-events",
GUILD_HUB_HEADER_OPTIONS: "guild-hub-header-options",
GUILD_FAVORITES: "favorites",
GUILD_CHANNEL_LIST_OPT_IN_NOTICE: "guild-channel-list-opt-in-notice",
GUILD_SPACE: "guild-space",
GUILD_ROLE_SUBSCRIPTIONS: "role-subscriptions",
GUILD_GAME_SHOP: "game-shop",
GUILD_SHOP: "shop",
GUILD_HOME: "@home",
GUILD_VIBEGRATIONS: "conjuring",
CHANNELS_AND_ROLES: "channels-and-roles",
BROWSE_CHANNELS: "browse-channels",
GUILD_DIRECTORY: "guild-directory",
GUILD_NEW_MEMBER_ACTIONS_PROGRESS_BAR: "guild-new-member-actions-progress-bar",
GUILD_MOD_DASH_MEMBER_SAFETY: "guild-mod-dash-member-safety",
GUILD_BOOSTS: "guild-boosts",
GAME_SERVERS: "game-servers",
GAME_SERVERS_EMPTY: "game-servers-empty",
GUILD_OFFICIAL_MESSAGES: "official-messages"
};
const r31 = {
SPACER: "spacer",
GUILD_PROGRESS: "guild-progress",
MFA_WARNING: "mfa-warning",
LIVE_CHANNEL_NOTICE: "live-channel-notice",
GAME_CLAIM: "game-claim",
APPLICATION_ACCOUNT_LINK: "application-account-link"
};
export { r10 as ChannelListGuildActionRow };
export { r31 as ChannelListChannelNoticeRow };
export const STANDARD_GUILD_SIDEBAR_POPOVER_GAP = 17;
@@ -0,0 +1,85 @@
// Metro module 15205 (f15206).
import CategoryCollapseStore from "../../stores/CategoryCollapseStore";
import "../../stores/PermissionStore";
import { ChannelListGuildActionRow } from "./GuildSidebarConstants";
import "../../Constants";
import { SECTION_INDEX_GUILD_ACTIONS, SECTION_INDEX_FAVORITES, SECTION_INDEX_UNCATEGORIZED_CHANNELS } from "./ChannelListState";
import { isFavoritesGuildId } from "../favorites/FavoritesUtils";
function $mk95703($env) {
return (a0) => {
const r3 = $env.$parent;
if (r3[3].can(r3[5].VIEW_CHANNEL, a0)) {
const r11 = $env;
let r14 = r11[0][a0.id];
if (r14 == null) {
r14 = [];
}
return a0.id !== r11[2] && a0.id !== r11[1] && r14.length > 0;
}
return false;
};
}
let env10795 = {};
export function getSectionFooterConfig(a0, a1, a2) {
let r2, r22;
if (a2 === SECTION_INDEX_GUILD_ACTIONS) {
const rows = a0.getGuildActionSection().getRows();
r22 = rows.length === 1 && rows[0] === ChannelListGuildActionRow.GUILD_PREMIUM_PROGRESS_BAR || a0.getGuildActionSection().isEmpty();
} else {
r22 = a0.getSections(false)[a2] === 0;
}
let hasDivider = !r22;
if (!r22) {
let r7 = a2 === SECTION_INDEX_GUILD_ACTIONS;
if (!r7) {
if (isFavoritesGuildId(a0.id)) {
r2 = a2 !== a0.getSections(false).length - 1;
} else {
r2 = a2 === SECTION_INDEX_FAVORITES;
if (!r2) {
let r47 = !!a1;
if (r47) {
let r6 = a2 !== SECTION_INDEX_UNCATEGORIZED_CHANNELS;
if (r6) {
let r5 = a2 === a0.recentsSectionNumber;
if (!r5) {
a0.voiceChannelsSectionNumber;
r5 = false;
}
r6 = r5;
}
r47 = r6;
}
r2 = r47;
}
}
r7 = r2;
}
hasDivider = r7;
}
return {
hasDivider,
canHaveVoiceSummary: !(a2 === SECTION_INDEX_GUILD_ACTIONS || a2 === SECTION_INDEX_FAVORITES || a2 === SECTION_INDEX_UNCATEGORIZED_CHANNELS || a2 === a0.recentsSectionNumber || a2 === a0.voiceChannelsSectionNumber)
};
}
export function getSectionFooterActiveVoiceChannels(a0) {
let env21763;
const r1 = env21763 = {
$parent: env10795
};
const category = a0.category;
env21763[0] = a0.voiceStates;
env21763[1] = a0.selectedChannelId;
env21763[2] = a0.selectedVoiceChannelId;
return CategoryCollapseStore.isCollapsed(category.record.id) !== true ? [] : category.getChannelRecords().filter($mk95703(r1));
}
export function isSectionFooterWithActiveVoiceChannels({ category, voiceStates, selectedChannelId, selectedVoiceChannelId }) {
let env21764;
const r7 = env21764 = {
$parent: env10795
};
env21764[0] = voiceStates;
env21764[1] = selectedChannelId;
env21764[2] = selectedVoiceChannelId;
return (CategoryCollapseStore.isCollapsed(category.record.id) !== true ? [] : category.getChannelRecords().filter($mk95703(r7))).length > 0;
}
@@ -0,0 +1,20 @@
// Metro module 8448 (f8449).
import { create } from "../../_bundle/Module644";
let c5412_0 = create(() => ({}));
export { c5412_0 as SidebarVisibilityMethodStore };
export function setGetVisibleGuildIds(a0) {
c5412_0.setState({
getVisibleGuildIds: a0
});
}
export function getVisibleGuildIdsMethod() {
return c5412_0.getState().getVisibleGuildIds;
}
export function setGetVisibleChannelIds(a0) {
c5412_0.setState({
getVisibleChannelIds: a0
});
}
export function getVisibleChannelIdsMethod() {
return c5412_0.getState().getVisibleChannelIds;
}
@@ -0,0 +1,16 @@
// Metro module 15167 (f15168).
import Dispatcher from "../../Dispatcher";
export function voiceCategoryExpand(a0) {
Dispatcher.dispatch({
type: "VOICE_CATEGORY_EXPAND",
guildId: a0,
expand: true
});
}
export function voiceCategoryCollapse(a0) {
Dispatcher.dispatch({
type: "VOICE_CATEGORY_COLLAPSE",
guildId: a0,
expand: false
});
}
@@ -0,0 +1,247 @@
// Metro module 11478 (f11479).
import { useMemo } from "react";
import { View } from "react-native";
import { CHANNEL_TITLE_LINE_HEIGHT } from "../../channel_list_v2/native/RedesignChannelListConstants";
import { UnreadSetting } from "../../read_states/ReadStateConstants";
import { createStyles } from "../../../design/components/Styles/native/createStyles";
import Module712 from "../../../_bundle/Module712";
import { Text } from "../../../design/components/Text/native/Text";
import { isAndroid } from "../../../_bundle/Module501";
import { Icon } from "../../../design/void/native";
import StaticChannelIndicator from "../../channel_list_v2/native/components/StaticChannelIndicator";
import { AnimatedPressableHighlight } from "../../../design/components/experimental/native";
import TouchableBackground from "../../../components_native/common/TouchableBackground";
let useStyles, c7815_10;
const BaseChannelSubtitle = function BaseChannelSubtitle(props) {
let props2;
const { mode: mode2, subtitle } = props;
if (mode2 !== c7815_10.UNREAD_IMPORTANT && (mode2 !== c7815_10.RELEVANT && mode2 !== c7815_10.SELECTED)) {
c7815_10.MUTED;
props2 = {
variant: "text-xs/medium",
color: "text-muted"
};
} else {
props2 = {
variant: "text-xs/medium",
color: "redesign-channel-name-text"
};
}
return subtitle != null ? <Text experimental_useNativeText={!isAndroid()} lineClamp={1} {...props2}>{subtitle}</Text> : null;
};
useStyles = createStyles((a0) => ({
rowPaddingNoIcon: {
paddingHorizontal: 6
},
rowSelected: {
borderRadius: Module712.modules.mobile.CHANNEL_ITEM_RADIUS,
backgroundColor: Module712.colors.MOBILE_CHANNEL_ITEM_BACKGROUND_SELECTED
},
unreadIndicator: {
left: -Module712.space.PX_8
},
channelIcon: {
width: 16,
height: 16,
marginRight: 8,
opacity: a0 === c7815_10.MUTED ? 0.5 : 1
},
redesignedChannelIcon: {
marginRight: 8,
opacity: a0 === c7815_10.MUTED ? 0.5 : 1
},
channelIconNormal: {
tintColor: Module712.colors.CHANNEL_ICON
},
channelIconUnread: {
tintColor: Module712.colors.INTERACTIVE_TEXT_ACTIVE
},
channelIconMuted: {
tintColor: Module712.colors.ICON_MUTED
},
channel: {
paddingHorizontal: 8,
paddingVertical: 8,
flexDirection: "row",
alignItems: "center",
position: "relative"
},
channelNameContainer: {
flex: 1,
flexDirection: "column",
alignItems: "stretch",
justifyContent: "center"
},
channelName: {
flexGrow: 1,
textAlign: "left",
lineHeight: CHANNEL_TITLE_LINE_HEIGHT,
opacity: a0 === c7815_10.MUTED ? 0.5 : 1
}
}));
c7815_10 = {
SELECTED: "Selected",
LOCKED: "Locked",
MUTED: "Muted",
RELEVANT: "Relevant",
UNREAD_LESS_IMPORTANT: "UnreadLessImportant",
UNREAD_IMPORTANT: "UnreadImportant",
DEFAULT: "Default"
};
export default function BaseChannelItem(props) {
const { icon, name, mode, hideIcon, disableHighlightOnPress = false, channelInfo, children, unread = false, ...props2 } = props;
const styles = useStyles(mode);
const r42 = <View style={useMemo(() => {
const r0 = [styles.channel, , ,];
let r4 = hideIcon;
if (hideIcon) {
r4 = styles.rowPaddingNoIcon;
}
r0[1] = r4;
r0[2] = mode === c7815_10.SELECTED && styles.rowSelected;
return r0;
}, [hideIcon, mode, styles])}>
{hideIcon ? !hideIcon : <StaticChannelIndicator style={styles.unreadIndicator} unread={unread} resolvedUnreadSetting={mode === c7815_10.UNREAD_LESS_IMPORTANT ? UnreadSetting.ONLY_MENTIONS : UnreadSetting.ALL_MESSAGES} />}
{hideIcon ? !hideIcon : icon}
{name}
{channelInfo}
</View>;
return disableHighlightOnPress ? <TouchableBackground {...props2}>
{r42}
{children}
</TouchableBackground> : <AnimatedPressableHighlight {...props2}>
{r42}
{children}
</AnimatedPressableHighlight>;
};
export { c7815_10 as ChannelModes };
export { BaseChannelSubtitle };
export function BaseChannelIcon(props) {
let channelIconMuted;
const { disableColor, mode: mode2, source, IconComponent, style, isChannelLive } = props;
const styles2 = useStyles(mode2);
const r2 = mode2 === c7815_10.MUTED;
const r3 = mode2 === c7815_10.UNREAD_IMPORTANT;
const r4 = mode2 === c7815_10.SELECTED;
const style2 = [styles2.channelIcon];
if (disableColor !== true) {
L8: {
if (r2) {
channelIconMuted = styles2.channelIconMuted;
} else {
if (!r3 && !r4) {
channelIconMuted = styles2.channelIconNormal;
break L8;
}
channelIconMuted = styles2.channelIconUnread;
}
}
style2.push(channelIconMuted);
}
if (style != null) {
style2.push(style);
}
return IconComponent != null ? <IconComponent size="sm" style={styles2.redesignedChannelIcon} color={isChannelLive ? "status-positive" : r2 ? "icon-muted" : r3 ? "interactive-text-active" : r4 ? "interactive-text-active" : "channel-icon"} /> : <Icon disableColor={disableColor} size={Icon.Sizes.CUSTOM} style={style2} source={source} />;
}
export function useChannelNameTextProps(a0) {
let r8;
L13: {
if (a0 !== c7815_10.UNREAD_IMPORTANT && a0 !== c7815_10.RELEVANT) {
if (a0 === c7815_10.UNREAD_LESS_IMPORTANT) {
r8 = {
variant: "text-md/medium",
color: "redesign-channel-name-muted-text"
};
break L13;
}
if (a0 === c7815_10.MUTED) {
r8 = {
variant: "text-md/medium",
color: "text-muted"
};
break L13;
}
if (a0 === c7815_10.SELECTED) {
r8 = {
variant: "text-md/medium",
color: "redesign-channel-name-text"
};
break L13;
}
r8 = {
variant: "text-md/medium",
color: "redesign-channel-name-muted-text"
};
} else {
r8 = {
variant: "text-md/semibold",
color: "redesign-channel-name-text"
};
}
}
return r8;
}
export function getChannelSubtitleTextProps(a0) {
let r7;
if (a0 !== c7815_10.UNREAD_IMPORTANT && (a0 !== c7815_10.RELEVANT && a0 !== c7815_10.SELECTED)) {
c7815_10.MUTED;
r7 = {
variant: "text-xs/medium",
color: "text-muted"
};
} else {
r7 = {
variant: "text-xs/medium",
color: "redesign-channel-name-text"
};
}
return r7;
}
export function BaseChannelName(props) {
let mode2, name, props2, props3, styles2, subtitle, textStyle;
L13: {
mode2 = props.mode;
name = props.name;
subtitle = props.subtitle;
textStyle = props.textStyle;
styles2 = useStyles(mode2);
props2 = {
style: styles2.channelNameContainer,
children: null
};
if (mode2 !== c7815_10.UNREAD_IMPORTANT && mode2 !== c7815_10.RELEVANT) {
if (mode2 === c7815_10.UNREAD_LESS_IMPORTANT) {
props3 = {
variant: "text-md/medium",
color: "redesign-channel-name-muted-text"
};
break L13;
}
if (mode2 === c7815_10.MUTED) {
props3 = {
variant: "text-md/medium",
color: "text-muted"
};
break L13;
}
if (mode2 === c7815_10.SELECTED) {
props3 = {
variant: "text-md/medium",
color: "redesign-channel-name-text"
};
break L13;
}
props3 = {
variant: "text-md/medium",
color: "redesign-channel-name-muted-text"
};
} else {
props3 = {
variant: "text-md/semibold",
color: "redesign-channel-name-text"
};
}
}
props2.children = [<Text experimental_useNativeText {...props3} lineClamp={1} style={[styles2.channelName, textStyle]}>{name}</Text>, <BaseChannelSubtitle mode={mode2} subtitle={subtitle} />];
return <View {...props2} />;
}
@@ -0,0 +1,28 @@
// Metro module 15194 (f15195).
import { View } from "react-native";
import LocaleStore from "../../user_settings/LocaleStore";
import { createStyles } from "../../../design/components/Styles/native/createStyles";
import { useStateFromStores } from "../../../_bundle/defaultAreStatesEqual";
import MentionsBadge from "./MentionsBadge";
import NewBadge from "../../channel_list_v2/native/components/NewBadge";
import { Text } from "../../../design/components/Text/native/Text";
import { humanizeValue } from "../../../utils/NumberUtils";
const useStyles = createStyles(() => ({
channelInfoContainer: {
paddingStart: 4
}
}));
export default function ChannelBadge(props) {
const { mentionCount, isMentionLowImportance, isNewChannel, postsWithUnreadsCount, muted } = props;
const styles = useStyles();
const stateFromStores = useStateFromStores([LocaleStore], () => LocaleStore.locale);
return mentionCount != null && mentionCount > 0 ? <View style={styles.channelInfoContainer}>
<MentionsBadge mentionsCount={mentionCount} isMentionLowImportance={isMentionLowImportance} />
</View> : isNewChannel ? <View style={styles.channelInfoContainer}>
<NewBadge />
</View> : muted != null ? muted ? null : postsWithUnreadsCount != null ? postsWithUnreadsCount > 0 ? <View style={styles.channelInfoContainer}>
<Text variant="text-xs/semibold" color="text-muted">
{humanizeValue(postsWithUnreadsCount, stateFromStores)}
</Text>
</View> : null : null : null;
};
@@ -0,0 +1,126 @@
// Metro module 15192 (f15193).
import NewChannelsStore from "../../recent_channels/NewChannelsStore";
import GuildStore from "../../../stores/GuildStore";
import PermissionStore from "../../../stores/PermissionStore";
import ReadStateStore from "../../../stores/ReadStateStore";
import VoiceStateStore from "../../../stores/VoiceStateStore";
import { GuildFeatures, Permissions, Fonts } from "../../../Constants";
import { createStyles } from "../../../design/components/Styles/native/createStyles";
import { useStateFromStoresObject } from "../../../_bundle/Module589";
import useEmbeddedAppsForChannel from "../../activities/useEmbeddedAppsForChannel";
import { useOptInEnabledForGuild } from "../../opt_in_channels/isOptInEnabled";
import { useUnreadThreadsCountForParent } from "../../forums/ForumHooks";
import showChannelBadge from "../showChannelBadge";
import ChannelBadge from "./ChannelBadge";
import { hasStream } from "../ChannelListUtils";
import { LiveTag } from "../../../design/void/native";
import { showChannelItemEmbeddedActivities } from "../showChannelItemEmbeddedActivities";
import ChannelItemEmbeddedActivities from "./ChannelItemEmbeddedActivities";
import GuildRoleSubscriptionGatedChannelIcon from "../../guild_role_subscriptions/native/premium_channel/GuildRoleSubscriptionGatedChannelIcon";
import { getStageHasMedia } from "../../stage_channels/StageMediaHooks";
import useShowConnectedUserLimit from "../useShowConnectedUserLimit";
import { ConnectedUserLimit } from "./ConnectedUserLimit";
import { useStartTime } from "../../channel/useVoiceChannelStartTime";
import { ActiveTimestamp } from "../../icymi/native/content_inventory/Badges";
let useStyles, DurationInfo;
const LimitAndDurationInfo = function LimitAndDurationInfo(props) {
let r29;
const { channel, voiceStatesCount, selected } = props;
const stateFromStoresObject = useStateFromStoresObject([VoiceStateStore, PermissionStore], () => {
const hasVideo = VoiceStateStore.hasVideo(channel.id);
const hasMedia = channel.isGuildStageVoice() && getStageHasMedia(channel.id);
return {
isLocked: !PermissionStore.can(Permissions.CONNECT, channel),
hasVideo,
hasMedia
};
});
const isLocked = stateFromStoresObject.isLocked;
let hasVideo = stateFromStoresObject.hasVideo;
const hasMedia = stateFromStoresObject.hasMedia;
if (useShowConnectedUserLimit({
channel,
locked: isLocked,
video: hasVideo ? hasVideo : hasMedia,
selected
})) {
if (!hasVideo) {
hasVideo = hasMedia;
}
r29 = <ConnectedUserLimit userCount={voiceStatesCount} video={hasVideo} channel={channel} />;
} else {
r29 = <DurationInfo channel={channel} />;
}
return r29;
};
DurationInfo = function DurationInfo(props) {
const channel3 = props.channel;
const styles = useStyles();
const startTime = useStartTime(channel3);
return startTime != null ? <ActiveTimestamp entry={{
start: startTime
}} style={styles.activeTimestamp} /> : null;
};
useStyles = createStyles({
activeTimestamp: {
fontFamily: Fonts.CODE_NORMAL,
fontSize: 12,
lineHeight: 16
}
});
export default function ChannelInfo(props) {
let r64;
let channel2;
L32: {
channel2 = props.channel;
const { isChannelSelected, isChannelCollapsed, voiceStates, enableConnectedUserLimit, enableActivities, muted, isSubscriptionGated, needSubscriptionToAccess } = props;
const stateFromStoresObject = useStateFromStoresObject([GuildStore, ReadStateStore, NewChannelsStore], () => ({
guild: GuildStore.getGuild(channel2.guild_id),
mentionsCount: ReadStateStore.getMentionCount(channel2.id),
isMentionLowImportance: ReadStateStore.getIsMentionLowImportance(channel2.id),
isNewChannel: NewChannelsStore.shouldIndicateNewChannel(channel2.guild_id, channel2.id)
}));
const { guild, mentionsCount, isMentionLowImportance } = stateFromStoresObject;
let isNewChannel = stateFromStoresObject.isNewChannel;
const embeddedAppsForChannel = useEmbeddedAppsForChannel(channel2);
const optInEnabledForGuild = useOptInEnabledForGuild(channel2.guild_id);
const unreadThreadsCountForParent = useUnreadThreadsCountForParent(channel2.guild_id, channel2.id);
if (showChannelBadge({
mentionsCount,
isNewChannel,
postsWithUnreadsCount: unreadThreadsCountForParent,
muted
})) {
if (isNewChannel) {
isNewChannel = optInEnabledForGuild;
}
r64 = <ChannelBadge mentionCount={mentionsCount} isMentionLowImportance={isMentionLowImportance} isNewChannel={isNewChannel} postsWithUnreadsCount={channel2.isForumLikeChannel() ? unreadThreadsCountForParent : null} muted={muted} />;
} else {
if (isChannelCollapsed != null && isChannelCollapsed && (guild == null ? void 0 : guild.features.has(GuildFeatures.COMMUNITY)) && hasStream(voiceStates)) {
r64 = <LiveTag />;
break L32;
}
if (enableActivities != null && enableActivities && showChannelItemEmbeddedActivities(embeddedAppsForChannel)) {
r64 = <ChannelItemEmbeddedActivities embeddedApps={embeddedAppsForChannel} muted={muted} />;
break L32;
}
if (isSubscriptionGated != null && needSubscriptionToAccess != null && isSubscriptionGated) {
r64 = <GuildRoleSubscriptionGatedChannelIcon locked={needSubscriptionToAccess} />;
break L32;
}
const r63 = enableConnectedUserLimit != null;
r64 = null;
if (r63) {
r64 = null;
if (enableConnectedUserLimit) {
let voiceStatesCount = voiceStates?.length;
if (voiceStatesCount == null) {
voiceStatesCount = 0;
}
r64 = <LimitAndDurationInfo channel={channel2} voiceStatesCount={voiceStatesCount} selected={isChannelSelected} />;
}
}
}
}
return r64;
};
@@ -0,0 +1,141 @@
// Metro module 15104 (f15105).
import { memo } from "react";
import { View } from "react-native";
import PresenceStore from "../../../stores/PresenceStore";
import RelationshipStore from "../../../stores/RelationshipStore";
import UserStore from "../../../stores/UserStore";
import { ChannelTypes, Routes } from "../../../Constants";
import { StaticChannelRoute } from "../../channel/ChannelConstants";
import { UnreadSetting } from "../../read_states/ReadStateConstants";
import { createStyles } from "../../../design/components/Styles/native/createStyles";
import Module712 from "../../../_bundle/Module712";
import { DARK_393C42_LIGHT_DEE0E4 } from "../../../design/migrations/native/LegacyTokens";
import BaseChannelItem, { ChannelModes, BaseChannelIcon, BaseChannelName } from "./BaseChannelItem";
import AvatarUtils from "../../../utils/AvatarUtils";
import FastImage from "../../../components_native/common/FastImage";
import Module15105 from "../../../_bundle/Module15105";
import { BookCheckIcon } from "../../../design/components/Icon/native/redesign/generated/BookCheckIcon";
import { getChannelIcon, getChannelIconComponent } from "../../../utils/native/ChannelUtils";
import { useStateFromStores, useStateFromStoresObject } from "../../../_bundle/Module589";
import { Avatar, AvatarSizes } from "../../../design/void/native";
import useChannelRoleSubscriptionStatus from "../../guild_role_subscriptions/useChannelRoleSubscriptionStatus";
import GuildRoleSubscriptionGatedChannelIcon from "../../guild_role_subscriptions/native/premium_channel/GuildRoleSubscriptionGatedChannelIcon";
import { computeChannelName } from "../../channel/useChannelName";
import { transitionTo } from "../../routing/router_utils";
let _excluded, c10706_15, useStyles, ChannelIcon, DMChannelIcon;
const getChannelMode = function getChannelMode(a0) {
const { muted, selected, unread, locked, channel: channel2 } = a0;
return selected ? channel2.isGuildVocal() ? unread ? ChannelModes.UNREAD_IMPORTANT : ChannelModes.RELEVANT : ChannelModes.SELECTED : locked ? ChannelModes.LOCKED : muted ? ChannelModes.MUTED : unread ? a0.resolvedUnreadSetting === UnreadSetting.ALL_MESSAGES ? ChannelModes.UNREAD_IMPORTANT : ChannelModes.UNREAD_LESS_IMPORTANT : ChannelModes.DEFAULT;
};
ChannelIcon = function ChannelIcon(props) {
let BookCheckIcon2, source;
const styles = useStyles();
const { channel: channel2, locked, isRulesChannel, isChannelLive } = props;
let selected = props.selected;
const mode = props.mode;
if (channel2.type === ChannelTypes.DM) {
const props2 = {
userId: channel2.getRecipientId(),
selected: null
};
if (selected == null) {
selected = false;
}
props2.selected = selected;
return <DMChannelIcon {...props2} />;
}
if (channel2.type === ChannelTypes.GROUP_DM) {
const channelIconSource = AvatarUtils.getChannelIconSource({
id: channel2.id,
icon: channel2.icon,
applicationId: channel2.getApplicationId(),
size: 20
});
if (channelIconSource != null) {
return <FastImage style={styles.groupDmAvatar} source={channelIconSource} />;
}
}
if (isRulesChannel) {
source = Module15105;
BookCheckIcon2 = BookCheckIcon;
} else {
const channelIcon = getChannelIcon(channel2, {
isRulesChannel: false,
locked
});
BookCheckIcon2 = getChannelIconComponent(channel2, {
isRulesChannel: false,
locked
});
source = channelIcon;
}
return <BaseChannelIcon mode={mode} source={source} isChannelLive={isChannelLive} style={isChannelLive ? styles.channelIconLive : void 0} {...BookCheckIcon2 != null ? {
IconComponent: BookCheckIcon2
} : {}} />;
};
DMChannelIcon = function DMChannelIcon(props) {
const userId = props.userId;
let selected = props.selected;
const styles = useStyles();
const stateFromStores = useStateFromStores([UserStore], () => UserStore.getUser(userId), [userId]);
const stateFromStoresObject = useStateFromStoresObject([PresenceStore], () => ({
status: PresenceStore.getStatus(userId),
isMobileOnline: PresenceStore.isMobileOnline(userId),
isVROnline: PresenceStore.isVROnline(userId)
}), [userId]);
const { status, isMobileOnline } = stateFromStoresObject;
const statusStyle = [styles.avatarStatus, ,];
if (selected) {
selected = styles.avatarStatusSelected;
}
statusStyle[1] = selected;
return <Avatar user={stateFromStores} guildId={void 0} size={AvatarSizes.XSMALL_20} style={styles.dmAvatar} status={status} isMobileOnline={isMobileOnline} isVROnline={stateFromStoresObject.isVROnline} statusStyle={statusStyle} />;
};
_excluded = ["channel", "subtitle", "hideIcon", "children", "textStyle", "channelInfo", "onPress"];
c10706_15 = new Set([ChannelTypes.GUILD_VOICE, ChannelTypes.GUILD_STAGE_VOICE]);
useStyles = createStyles({
channelIconLive: {
tintColor: Module712.unsafe_rawColors.GREEN_360
},
dmAvatar: {
marginRight: 8
},
avatarStatus: {
backgroundColor: Module712.colors.BACKGROUND_BASE_LOW
},
groupDmAvatar: {
width: 20,
height: 20,
borderRadius: 10,
marginRight: 8
},
channelInfoContainer: {
paddingStart: 4
},
avatarStatusSelected: {
backgroundColor: DARK_393C42_LIGHT_DEE0E4
}
});
const r79 = memo(function(a0) {
const styles = useStyles();
const { channel, subtitle, hideIcon, children, textStyle, channelInfo, onPress: onPress2, ...rest } = a0;
const channelRoleSubscriptionStatus = useChannelRoleSubscriptionStatus(channel.id);
const { isSubscriptionGated, needSubscriptionToAccess } = channelRoleSubscriptionStatus;
const channelMode = getChannelMode(a0);
const channelInfo2 = channelInfo == null ? isSubscriptionGated ? <View style={styles.channelInfoContainer}>
{channelInfo}
{isSubscriptionGated ? <GuildRoleSubscriptionGatedChannelIcon locked={needSubscriptionToAccess} /> : null}
</View> : null : <View style={styles.channelInfoContainer}>
{channelInfo}
{isSubscriptionGated ? <GuildRoleSubscriptionGatedChannelIcon locked={needSubscriptionToAccess} /> : null}
</View>;
return <BaseChannelItem mode={channelMode} unread={channelMode === ChannelModes.UNREAD_IMPORTANT || channelMode === ChannelModes.UNREAD_LESS_IMPORTANT} hideIcon={hideIcon} name={<BaseChannelName mode={channelMode} name={computeChannelName(channel, UserStore, RelationshipStore)} subtitle={subtitle} textStyle={textStyle} />} icon={<ChannelIcon {...a0} mode={channelMode} />} channelInfo={channelInfo2} onPress={function onPress(event) {
if (needSubscriptionToAccess && c10706_15.has(channel.type)) {
transitionTo(Routes.CHANNEL(channel.guild_id, StaticChannelRoute.ROLE_SUBSCRIPTIONS));
} else if (onPress2 != null) {
onPress2(event);
}
}} {...rest}>{children}</BaseChannelItem>;
});
export default r79;
export { getChannelMode };
@@ -0,0 +1,59 @@
// Metro module 15197 (f15198).
import { View } from "react-native";
import { createStyles } from "../../../design/components/Styles/native/createStyles";
import Module712 from "../../../_bundle/Module712";
import GameIcon, { GameIconSizes, GameIconImageSize } from "../../game_detection/native/GameIcon";
import { Text } from "../../../design/components/Text/native/Text";
const useStyles = createStyles({
overflow: {
lineHeight: 16,
textAlign: "center",
textAlignVertical: "center",
padding: 4
},
overflowContainer: {
backgroundColor: Module712.colors.BACKGROUND_BASE_LOWEST,
borderRadius: Module712.radii.xs,
display: "flex",
alignItems: "center",
justifyContent: "center"
},
container: {
display: "flex",
flexDirection: "row"
},
modeMuted: {
opacity: 0.3
}
});
export default function ChannelItemEmbeddedActivities(props) {
const { embeddedApps, size = GameIconSizes.SIZE_24 } = props;
let muted = props.muted;
const styles = useStyles();
if (embeddedApps.length <= 0) {
return null;
}
if (embeddedApps.length === 1) {
if (muted) {
muted = styles.modeMuted;
}
return <GameIcon game={embeddedApps[0].application} size={size} style={muted} />;
}
const application2 = embeddedApps[0].application;
const application = embeddedApps[1].application;
const r32 = embeddedApps.length - 1;
const height = GameIconImageSize[size];
return <View style={styles.container}>
<GameIcon game={application2} size={size} style={{
marginRight: 4
}} />
{embeddedApps.length === 2 ? <GameIcon game={application} size={size} /> : <View style={[styles.overflowContainer, {
height,
minWidth: height
}]}>
<Text style={styles.overflow} variant="text-xs/bold">
{`+${r32}`}
</Text>
</View>}
</View>;
};
@@ -0,0 +1,21 @@
// Metro module 15107 (f15108).
import useChannelVideoLimit from "../../video_calls/useChannelVideoLimit";
import VoiceChannelUserLimit from "./VoiceChannelUserLimit";
export function ConnectedUserLimit(props) {
const channel = props.channel;
let video = props.video;
const userCount = props.userCount;
const limit = useChannelVideoLimit(channel).limit;
const r13 = channel.userLimit > 0 ? channel.userLimit : -1;
if (video) {
video = limit > 0;
}
let videoLimit = false;
let total = r13;
if (video) {
const r1 = r13 < 0 || limit < r13;
total = r13 > 0 ? Math.min(r13, limit) : limit;
videoLimit = r1;
}
return <VoiceChannelUserLimit users={userCount} total={total} videoLimit={videoLimit} />;
}
@@ -0,0 +1,49 @@
// Metro module 15176 (f15177).
import { memo, useCallback } from "react";
import ChannelStore from "../../../stores/ChannelStore";
import GuildChannelStore from "../../../stores/GuildChannelStore";
import { CHANNEL_MARGIN_VERTICAL } from "../../channel_list_v2/native/RedesignChannelListConstants";
import { UnreadSetting } from "../../read_states/ReadStateConstants";
import { createStyles } from "../../../design/components/Styles/native/createStyles";
import Module712 from "../../../_bundle/Module712";
import { useStateFromStores } from "../../../_bundle/defaultAreStatesEqual";
import { transitionToGuild } from "../../routing/router_utils";
import { openChannelLongPressActionSheet } from "../../channel/native/openChannelLongPressActionSheet";
import ChannelItem from "./ChannelItem";
import getChannelA11yLabel from "../../channel/getChannelA11yLabel";
const useStyles = createStyles({
container: {
marginVertical: CHANNEL_MARGIN_VERTICAL,
marginHorizontal: 8,
borderRadius: Module712.radii.md
}
});
const r40 = memo(function(a0) {
let id;
const { guildId, selectedChannelId } = a0;
let selected = a0.selected;
id = void 0;
const styles = useStyles();
const stateFromStores = useStateFromStores([ChannelStore, GuildChannelStore], () => {
const directoryChannelIds = GuildChannelStore.getDirectoryChannelIds(guildId);
return directoryChannelIds.length !== 0 ? ChannelStore.getChannel(directoryChannelIds[0]) : null;
});
id = stateFromStores?.id;
if (!selected) {
selected = id === selectedChannelId;
}
const callback = useCallback(() => {
transitionToGuild(guildId, id);
}, [guildId, id]);
const callback2 = useCallback(() => {
if (id != null) {
openChannelLongPressActionSheet(id);
}
}, [id]);
return stateFromStores == null ? null : <ChannelItem onPress={callback} onLongPress={callback2} style={styles.container} accessible accessibilityRole="button" accessibilityLabel={getChannelA11yLabel({
channel: stateFromStores
})} accessibilityState={{
selected
}} channel={stateFromStores} selected={selected} resolvedUnreadSetting={UnreadSetting.ONLY_MENTIONS} />;
});
export default r40;
@@ -0,0 +1,54 @@
// Metro module 15175 (f15176).
import { useCallback } from "react";
import { View } from "react-native";
import NewChannelsStore from "../../recent_channels/NewChannelsStore";
import ReadStateStore from "../../../stores/ReadStateStore";
import { CHANNEL_MARGIN_VERTICAL } from "../../channel_list_v2/native/RedesignChannelListConstants";
import { CHANNELS_AND_ROLES_MODAL_KEY } from "../../guild_onboarding/native/GuildOnboardingConstants";
import { ReadStateTypes } from "../../read_states/ReadStateConstants";
import { createStyles } from "../../../design/components/Styles/native/createStyles";
import Module712 from "../../../_bundle/Module712";
import useGuildOnboardingAvailable from "../../guild_onboarding/useGuildOnboardingAvailable";
import { useIsDismissibleContentDismissed_UNSAFE } from "../../dismissible_content/DismissibleContentUnsafeUtils";
import { DismissibleContent } from "../../../_bundle/Module1358";
import { useStateFromStores } from "../../../_bundle/defaultAreStatesEqual";
import { MAX_NEW_CHANNELS_TO_SHOW } from "../ChannelListState";
import ModalActionCreators from "../../../actions/ModalActionCreators";
import BaseChannelItem, { ChannelModes, BaseChannelName, BaseChannelIcon } from "./BaseChannelItem";
import { NewBadge } from "../../channel_list_v2/native/components/index";
import { intl, t } from "../../../intl/index.native";
import { ChannelListMagnifyingGlassIcon } from "../../../design/components/Icon/native/redesign/generated/ChannelListMagnifyingGlassIcon";
const useStyles = createStyles({
container: {
marginVertical: CHANNEL_MARGIN_VERTICAL,
marginHorizontal: 8,
borderRadius: Module712.radii.md
},
channelInfoContainer: {
paddingStart: 4
}
});
export function GuildRolesAndChannelsRow(props) {
const { guild, selected } = props;
const styles = useStyles();
const guildOnboardingAvailable = useGuildOnboardingAvailable(guild);
const id = guild.id;
const isDismissibleContentDismissed_UNSAFE = useIsDismissibleContentDismissed_UNSAFE(DismissibleContent.CHANNEL_BROWSER_NEW_BADGE_NUX);
const stateFromStores = useStateFromStores([ReadStateStore], () => ReadStateStore.hasUnread(guild.id, ReadStateTypes.GUILD_ONBOARDING_QUESTION));
const stateFromStores2 = useStateFromStores([NewChannelsStore], () => NewChannelsStore.getNewChannelIds(guild.id).size > MAX_NEW_CHANNELS_TO_SHOW);
const callback = useCallback(() => {
ModalActionCreators.pushLazy(import("../../guild_onboarding/native/ChannelsAndRolesModal"), {
guildId: id
}, CHANNELS_AND_ROLES_MODAL_KEY);
}, [id]);
let DEFAULT = ChannelModes.DEFAULT;
if (selected) {
DEFAULT = ChannelModes.SELECTED;
}
const channelInfo = (isDismissibleContentDismissed_UNSAFE ? stateFromStores : !isDismissibleContentDismissed_UNSAFE) || stateFromStores2 ? <View style={styles.channelInfoContainer}>
<NewBadge />
</View> : null;
return <BaseChannelItem onPress={callback} style={styles.container} accessible accessibilityLabel={guildOnboardingAvailable ? intl.string(t.h9mGOP) : intl.string(t.et6wav)} accessibilityState={{
selected
}} mode={DEFAULT} name={<BaseChannelName name={guildOnboardingAvailable ? intl.string(t.h9mGOP) : intl.string(t.et6wav)} mode={DEFAULT} />} icon={<BaseChannelIcon mode={DEFAULT} IconComponent={ChannelListMagnifyingGlassIcon} />} channelInfo={channelInfo} />;
}
@@ -0,0 +1,51 @@
// Metro module 15170 (f15171).
import { Image as Image2 } from "react-native";
import { HelpdeskArticles, Fonts } from "../../../Constants";
import { createStyles } from "../../../design/components/Styles/native/createStyles";
import Module712 from "../../../_bundle/Module712";
import { scaleTextLineHeight } from "../../screen/native/useScaledTextLineHeight.android";
import Linking from "../../../lib/native/Linking";
import { PressableOpacity } from "../../../design/void/Pressables/native/Pressables";
import Module15171 from "../../../_bundle/Module15171";
import { Text } from "../../../design/components/Text/native/Text";
import { intl, t } from "../../../intl/index.native";
import { LegacyText } from "../../../design/void/native";
let useStyles;
const handlePress = async function handlePress() {
let c27957_1;
c27957_1 = void 0;
let c30851_0 = (await import("../../../utils/HelpdeskUtils")).default;
Linking.openURL(c30851_0.getArticleURL(HelpdeskArticles.SETTING_UP_TWO_FACTOR));
};
useStyles = createStyles({
MFAWarning: {
backgroundColor: Module712.colors.BACKGROUND_BASE_LOW,
padding: 10,
alignItems: "center"
},
MFAWarningIcon: {
marginVertical: 10,
width: 98,
height: 53
},
MFAWarningLink: {
color: Module712.unsafe_rawColors.BLUE_345,
fontFamily: Fonts.PRIMARY_SEMIBOLD
}
});
export default function GuildMFAWarning() {
const styles = useStyles();
return <PressableOpacity accessibilityRole="button" style={styles.MFAWarning} onPress={handlePress}>
<Image2 style={styles.MFAWarningIcon} source={Module15171} />
<Text variant="text-xs/medium" color="text-default">
{intl.string(t.ZIf8Ag)}
<LegacyText style={styles.MFAWarningLink}>
{" "}
{intl.string(t.hvVgAZ)}
</LegacyText>
</Text>
</PressableOpacity>;
};
export function getScaledGuildMFAWarningHeight(a0) {
return 83 + 5 * scaleTextLineHeight("text-xs/medium", a0) + 10 + 10;
}
@@ -0,0 +1,93 @@
// Metro module 15208 (f15209).
import { useState, useEffect } from "react";
import { DismissibleContentGroupName } from "../../dismissible_content/DismissibleContentConstants";
import { useCanSeeNUFChannelsForGuild } from "../../nuf_channels/native/useCanSeeNUFChannelsForGuild";
import { DismissibleContent } from "../../../_bundle/Module1358";
import { useCanSeeCreatorMonetizationOnboardingV2Upsell } from "../../creator_monetization_eligibility/feature_education/OnboardingV2Utils";
import useIsGuildEligibleForRoleSubscriptionsUpsell from "../../guild_role_subscriptions/useIsGuildEligibleForRoleSubscriptionsUpsell";
import { useCanUseRoleSubscriptionIAP } from "../../guild_role_subscriptions/feature_gating/IAPEligibility";
import useIsEligibleForTierTemplateUpsell from "../../guild_role_subscriptions/tier_templates/useIsEligibleForTierTemplateUpsell";
import SelectedDismissibleContent from "../../dismissible_content/native/SelectedDismissibleContent";
import { DismissibleActionSheet } from "../../dismissible_content/native/DismissibleActionSheet";
import * as _ReanimatedRexport from "../../reanimated/ReanimatedRexport";
import { runOnUI } from "../../reanimated/ReanimatedRexport";
let actionSheetKey, GuildRoleSubscriptionsUpsellActionSheetImporter, GuildRoleSubscriptionsIAPUpsellActionSheetImporter, CreatorMonetizationOnboardingV2UpsellActionSheetImporter, TierTemplatesUpsellActionSheetImporter, GuildTooltipActionSheets, __initData;
const NUFChannelsActionSheetImporter = function NUFChannelsActionSheetImporter() {
return import("../../nuf_channels/native/components/NUFChannelsActionSheet");
};
GuildRoleSubscriptionsUpsellActionSheetImporter = function GuildRoleSubscriptionsUpsellActionSheetImporter() {
return import("../../guild_role_subscriptions/native/guild_sidebar/GuildRoleSubscriptionsUpsellActionSheet");
};
GuildRoleSubscriptionsIAPUpsellActionSheetImporter = function GuildRoleSubscriptionsIAPUpsellActionSheetImporter() {
return import("../../guild_role_subscriptions/native/feature_education/IAPUpsellActionSheet");
};
CreatorMonetizationOnboardingV2UpsellActionSheetImporter = function CreatorMonetizationOnboardingV2UpsellActionSheetImporter() {
return import("../../guild_role_subscriptions/native/feature_education/CreatorMonetizationOnboardingV2UpsellActionSheet");
};
TierTemplatesUpsellActionSheetImporter = function TierTemplatesUpsellActionSheetImporter() {
return import("../../guild_role_subscriptions/native/guild_settings/tier_templates/GuildRoleSubscriptionTierTemplateUpsellActionSheet");
};
GuildTooltipActionSheets = function GuildTooltipActionSheets(props) {
const guild = props.guild;
let inRedesign = props.inRedesign;
const id = guild.id;
const canSeeNUFChannelsForGuild = useCanSeeNUFChannelsForGuild(id);
if (inRedesign) {
inRedesign = canSeeNUFChannelsForGuild;
}
const contentTypes = [];
if (inRedesign) {
contentTypes.push(DismissibleContent.NUX_GUILD_CHANNEL_EXPLAINER);
}
if (useCanSeeCreatorMonetizationOnboardingV2Upsell(id)) {
contentTypes.push(DismissibleContent.CREATOR_MONETIZATION_ONBOARDING_V2_UPSELL);
}
if (useIsGuildEligibleForRoleSubscriptionsUpsell(id)) {
contentTypes.push(DismissibleContent.GUILD_HEADER_ROLE_SUBSCRIPTION_UPSELL);
}
if (useCanUseRoleSubscriptionIAP(id)) {
contentTypes.push(DismissibleContent.GUILD_ROLE_SUBSCRIPTION_IAP_UPSELL);
}
if (useIsEligibleForTierTemplateUpsell(id)) {
contentTypes.push(DismissibleContent.SERVER_SUBSCRIPTION_TIER_TEMPLATE_UPSELL);
}
return <SelectedDismissibleContent contentTypes={contentTypes} groupName={DismissibleContentGroupName.GUILD_HEADER_TOOLTIPS}>
{({ visibleContent, markAsDismissed: markAsDismissed2 }) => {
if (DismissibleContent.GUILD_HEADER_ROLE_SUBSCRIPTION_UPSELL === visibleContent) {
return <DismissibleActionSheet markAsDismissed={markAsDismissed2} importer={GuildRoleSubscriptionsUpsellActionSheetImporter} actionSheetKey={actionSheetKey} guildId={id} />;
}
if (DismissibleContent.GUILD_ROLE_SUBSCRIPTION_IAP_UPSELL === visibleContent) {
return <DismissibleActionSheet markAsDismissed={markAsDismissed2} importer={GuildRoleSubscriptionsIAPUpsellActionSheetImporter} actionSheetKey={actionSheetKey} guildId={id} />;
}
if (DismissibleContent.CREATOR_MONETIZATION_ONBOARDING_V2_UPSELL === visibleContent) {
return <DismissibleActionSheet markAsDismissed={markAsDismissed2} importer={CreatorMonetizationOnboardingV2UpsellActionSheetImporter} actionSheetKey={actionSheetKey} guildId={id} />;
}
if (DismissibleContent.SERVER_SUBSCRIPTION_TIER_TEMPLATE_UPSELL === visibleContent) {
return <DismissibleActionSheet actionSheetKey={actionSheetKey} importer={TierTemplatesUpsellActionSheetImporter} markAsDismissed={markAsDismissed2} guildId={id} />;
}
if (DismissibleContent.NUX_GUILD_CHANNEL_EXPLAINER === visibleContent) {
return <DismissibleActionSheet markAsDismissed={(a0) => markAsDismissed2(a0)} actionSheetKey={actionSheetKey} importer={NUFChannelsActionSheetImporter} />;
}
return null;
}}
</SelectedDismissibleContent>;
};
actionSheetKey = "GuildTooltipActionSheet";
__initData = {
code: "function GuildTooltipActionSheetsTsx1(){const{runOnJS,setShouldRender}=this.__closure;return runOnJS(setShouldRender)(true);}"
};
export default function GuildTooltipActionSheetsGuard(props) {
const [state, setState] = useState(false);
useEffect(() => {
const t = () => _ReanimatedRexport.runOnJS(setState)(true);
t.__closure = {
runOnJS: _ReanimatedRexport.runOnJS,
setShouldRender: setState
};
t.__workletHash = 6076095421855;
t.__initData = __initData;
runOnUI(t)();
}, []);
return state ? <GuildTooltipActionSheets {...props} /> : null;
};
export { GuildTooltipActionSheets };
@@ -0,0 +1,9 @@
// Metro module 11451 (f11452).
import { AlertModal, AlertActionButton } from "../../../design/components/AlertModal/native/AlertModal.native";
import { intl, t } from "../../../intl/index.native";
import { AlertActions } from "../../../design/components/AlertModal/native/AlertModal.native";
export default function InvitesDisabledAlertModal() {
return <AlertModal title={intl.string(t.LpUfEt)} content={intl.string(t.QRXqzO)} actions={<AlertActions>
<AlertActionButton key="okay" text={intl.string(t.BddRzS)} />
</AlertActions>} />;
};
@@ -0,0 +1,5 @@
// Metro module 15195 (f15196).
import { Badge } from "../../../design/void/native";
export default function MentionsBadge(props) {
return <Badge value={props.mentionsCount} isMentionLowImportance={props.isMentionLowImportance} />;
};
@@ -0,0 +1,70 @@
// Metro module 15108 (f15109).
import { memo } from "react";
import { View } from "react-native";
import { createStyles } from "../../../design/components/Styles/native/createStyles";
import Module712 from "../../../_bundle/Module712";
import { Icon } from "../../../design/void/native";
import Module12848 from "../../../_bundle/Module12848";
import { Text } from "../../../design/components/Text/native/Text";
const useStyles = createStyles({
videoIcon: {
height: 16,
width: 16,
marginRight: 4,
tintColor: Module712.colors.VOICE_CHANNEL_USER_LIMIT_ICON
},
wrapper: {
backgroundColor: Module712.colors.VOICE_CHANNEL_USER_LIMIT_BACKGROUND,
alignItems: "center",
flexDirection: "row",
borderRadius: 10,
borderWidth: Module712.modules.mobile.VOICE_CHANNEL_USER_LIMIT_BORDER_WIDTH,
borderColor: Module712.colors.BORDER_SUBTLE,
overflow: "hidden"
},
left: {
height: 20,
flexDirection: "row",
paddingLeft: 6,
alignItems: "center",
justifyContent: "center",
backgroundColor: Module712.colors.VOICE_CHANNEL_USER_LIMIT_BACKGROUND
},
mid: {
borderTopWidth: 20,
borderBottomWidth: 0,
borderTopColor: "transparent",
borderBottomColor: "transparent",
borderRightWidth: 6,
borderRightColor: Module712.colors.VOICE_CHANNEL_USER_LIMIT_ACCENT_BACKGROUND,
paddingRight: 2
},
right: {
height: 20,
flexDirection: "row",
paddingRight: 6,
paddingLeft: 2,
alignItems: "center",
justifyContent: "center",
backgroundColor: Module712.colors.VOICE_CHANNEL_USER_LIMIT_ACCENT_BACKGROUND
}
});
const r63 = memo(function VoiceChannelUserLimit(props) {
const { users, total, videoLimit } = props;
const styles = useStyles();
return <View style={styles.wrapper}>
<View style={styles.left}>
{videoLimit ? <Icon source={Module12848} size={Icon.Sizes.REFRESH_SMALL_16} style={styles.videoIcon} /> : null}
<Text variant="text-xs/medium" lineClamp={1} color="voice-channel-user-limit-text">
{users.toString().padStart(2, "0")}
</Text>
</View>
<View style={styles.mid} />
<View style={styles.right}>
<Text variant="text-xs/medium" lineClamp={1} color="voice-channel-user-limit-text">
{total.toString().padStart(2, "0")}
</Text>
</View>
</View>;
});
export default r63;
@@ -0,0 +1,49 @@
// Metro module 15110 (f15111).
import EmbeddedActivitiesStore from "../../activities/EmbeddedActivitiesStore";
import ChannelRTCStore from "../../calls/ChannelRTCStore";
import ApplicationStreamingStore from "../../../stores/ApplicationStreamingStore";
import AuthenticationStore from "../../../stores/AuthenticationStore";
import MediaEngineStore from "../../../stores/MediaEngineStore";
import SessionsStore from "../../../stores/SessionsStore";
import VoiceStateStore from "../../../stores/VoiceStateStore";
import { useStateFromStoresObject, useStateFromStores } from "../../../_bundle/Module589";
import VoiceUserItem from "./VoiceUserItem";
export default function VoiceUserConnected(props) {
const { channel, user, sessionId, member, selfMute, selfDeaf } = props;
let selfVideo = props.selfVideo;
let mute = props.mute;
const { deaf, suppress, collapsed, isGuest } = props;
const r1 = AuthenticationStore.getId() === user.id;
let c21683_3 = r1;
const stateFromStoresObject = useStateFromStoresObject([MediaEngineStore], () => c21683_3 ? {
localMute: false,
localDeaf: false,
localVideo: MediaEngineStore.isVideoEnabled()
} : {
localMute: MediaEngineStore.isLocalMute(user.id),
localDeaf: false,
localVideo: false
});
const { localMute, localVideo } = stateFromStoresObject;
const stateFromStores = useStateFromStores([ApplicationStreamingStore], () => ApplicationStreamingStore.getStreamForUser(user.id, channel.getGuildId()));
const stateFromStores2 = useStateFromStores([SessionsStore], () => {
const r1 = sessionId != null;
let r7 = void 0;
if (r1) {
const sessionById = SessionsStore.getSessionById(sessionId);
r7 = sessionById == null ? void 0 : sessionById.clientInfo.os;
}
return r7;
});
const stateFromStores3 = useStateFromStores([VoiceStateStore], () => VoiceStateStore.getVoicePlatformForChannel(channel.id, user.id), [channel.id, user.id]);
const r0 = sessionId != null && r1 && sessionId !== AuthenticationStore.getSessionId();
const stateFromStores4 = useStateFromStores([EmbeddedActivitiesStore], () => EmbeddedActivitiesStore.getEmbeddedActivitiesForChannel(channel.id).find((item) => item.userIds.has(user.id)), [user.id, channel.id]);
const stateFromStores5 = useStateFromStores([ChannelRTCStore], () => ChannelRTCStore.getGuildRingingUsers(channel.id).has(user.id));
if (!mute) {
mute = suppress;
}
if (!selfVideo) {
selfVideo = localVideo;
}
return <VoiceUserItem guildId={channel.guild_id} member={member} user={user} collapsed={collapsed} serverMute={mute} serverDeaf={deaf} mute={selfMute} deaf={selfDeaf} localMute={localMute} video={selfVideo} stream={stateFromStores?.channelId === channel.id} platform={stateFromStores2} disabled={stateFromStores2 == null && r0} isInEmbeddedActivity={stateFromStores4 != null} isGuest={isGuest} voicePlatform={stateFromStores3} ringing={stateFromStores5} />;
};
@@ -0,0 +1,128 @@
// Metro module 15111 (f15112).
import { memo } from "react";
import { View } from "react-native";
import AccessibilityStore from "../../a11y/AccessibilityStore";
import { AvatarSizes, Avatar, Icon, LiveTag, AVATAR_SIZE_MAP } from "../../../design/void/native";
import { scaleTextLineHeight } from "../../screen/native/useScaledTextLineHeight.android";
import { createStyles } from "../../../design/components/Styles/native/createStyles";
import Module712 from "../../../_bundle/Module712";
import { makeSizeStyle } from "../../main_tabs_v2/native/shared_components/guild_channels/layouts/ChannelListLayout";
import { useStateFromStores } from "../../../_bundle/Module589";
import * as _ReanimatedRexport from "../../reanimated/ReanimatedRexport";
import ReanimatedRexport, { useAnimatedStyle } from "../../reanimated/ReanimatedRexport";
import * as _timing from "../../../design/animation/reanimated/timing/timing";
import AvatarUtils from "../../../utils/AvatarUtils";
import VoiceUserNameItem from "./VoiceUserNameItem";
import { MicrophoneDenyIcon } from "../../../design/components/Icon/native/redesign/generated/MicrophoneDenyIcon";
import { MicrophoneSlashIcon } from "../../../design/components/Icon/native/redesign/generated/MicrophoneSlashIcon";
import { HeadphonesDenyIcon } from "../../../design/components/Icon/native/redesign/generated/HeadphonesDenyIcon";
import { HeadphonesSlashIcon } from "../../../design/components/Icon/native/redesign/generated/HeadphonesSlashIcon";
import { VideoIcon } from "../../../design/components/Icon/native/redesign/generated/VideoIcon";
import Module6614 from "../../../_bundle/Module6614";
import getConsoleIcon, { getConsoleIconForVoicePlatform } from "../../game_console/native/getConsoleIcon";
const variant = "text-sm/medium";
const color = "redesign-channel-name-muted-text";
const XSMALL_20 = AvatarSizes.XSMALL_20;
const useStyles = createStyles({
voiceState: {
flex: 1,
flexDirection: "row",
alignItems: "center",
paddingVertical: 5
},
disabled: {
opacity: 0.5
},
voiceStateCollapsed: {
marginTop: 4,
marginRight: 8,
width: 32,
height: 32,
borderRadius: Module712.radii.lg,
borderWidth: 4,
borderColor: Module712.colors.BACKGROUND_BASE_LOW,
alignItems: "center",
overflow: "hidden"
},
voiceStateIcon: {
marginLeft: 6,
...makeSizeStyle(14)
},
legacyVoiceStateIcon: {
tintColor: Module712.colors.REDESIGN_CHANNEL_NAME_MUTED_TEXT,
marginLeft: 6
}
});
const __initData = {
code: "function VoiceUserItemTsx1(){const{ringing,shouldAnimate,PULSE_ENDING_OPACITY,withRepeat,withSequence,withDelay,INNER_PULSE_DELAY,withTiming,PULSE_DURATION,Easing,PULSE_STARTING_OPACITY,FADE_DURATION}=this.__closure;if(!ringing){return{opacity:1.0};}else if(!shouldAnimate){return{opacity:PULSE_ENDING_OPACITY};}return{opacity:withRepeat(withSequence(withDelay(INNER_PULSE_DELAY,withTiming(PULSE_ENDING_OPACITY,{duration:PULSE_DURATION,easing:Easing.bezier(0.4,0.0,1,1)})),withDelay(PULSE_DURATION,withTiming(PULSE_STARTING_OPACITY,{duration:FADE_DURATION}))),-1)};}"
};
const r63 = memo(function VoiceUserItem(props) {
let r154;
let member, user, guildId, ringing, stateFromStores;
const getSource = function getSource() {
return member != null && member.avatar != null ? AvatarUtils.getGuildMemberAvatarSource(member, user) : user.getAvatarSource(guildId);
};
member = props.member;
user = props.user;
guildId = props.guildId;
const { collapsed, stream, serverMute, serverDeaf, mute, deaf, localMute, video, disabled } = props;
let platform2 = props.platform;
const { isInEmbeddedActivity, voicePlatform } = props;
ringing = props.ringing;
const styles = useStyles();
stateFromStores = useStateFromStores([AccessibilityStore], () => !AccessibilityStore.useReducedMotion);
const c = function c() {
return ringing ? stateFromStores ? {
opacity: _ReanimatedRexport.withRepeat(_ReanimatedRexport.withSequence(_ReanimatedRexport.withDelay(100, _timing.withTiming(0.4, {
duration: 250,
easing: _ReanimatedRexport.Easing.bezier(0.4, 0, 1, 1)
})), _ReanimatedRexport.withDelay(250, _timing.withTiming(0.1, {
duration: 500
}))), -1)
} : {
opacity: 0.4
} : {
opacity: 1
};
};
c.__closure = {
ringing,
shouldAnimate: stateFromStores,
PULSE_ENDING_OPACITY: 0.4,
withRepeat: _ReanimatedRexport.withRepeat,
withSequence: _ReanimatedRexport.withSequence,
withDelay: _ReanimatedRexport.withDelay,
INNER_PULSE_DELAY: 100,
withTiming: _timing.withTiming,
PULSE_DURATION: 250,
Easing: _ReanimatedRexport.Easing,
PULSE_STARTING_OPACITY: 0.1,
FADE_DURATION: 500
};
c.__workletHash = 9430639809025;
c.__initData = __initData;
const animatedStyle = useAnimatedStyle(c);
if (collapsed) {
r154 = <View style={styles.voiceStateCollapsed}>
<Avatar source={getSource} size={XSMALL_20} />
</View>;
} else {
const style = [styles.voiceState, disabled && styles.disabled, animatedStyle];
const r75 = [<Avatar source={getSource} size={XSMALL_20} />, <VoiceUserNameItem variant={variant} color={color} {...props} />, disabled ? null : serverMute ? <MicrophoneDenyIcon style={styles.voiceStateIcon} color="text-feedback-critical" size="custom" /> : localMute ? <MicrophoneDenyIcon style={styles.voiceStateIcon} size="custom" color={color} /> : mute ? <MicrophoneSlashIcon style={styles.voiceStateIcon} size="custom" color={color} /> : null, disabled ? null : serverDeaf ? <HeadphonesDenyIcon style={styles.voiceStateIcon} color="text-feedback-critical" size="custom" /> : deaf ? <HeadphonesSlashIcon style={styles.voiceStateIcon} size="custom" color={color} /> : null, video ? disabled ? null : <VideoIcon size="custom" color={color} style={styles.voiceStateIcon} /> : null, isInEmbeddedActivity ? <Icon source={Module6614} size={Icon.Sizes.REFRESH_SMALL_16} style={styles.legacyVoiceStateIcon} /> : null, , ,];
if (platform2 == null) {
platform2 = "";
}
let source = getConsoleIcon(platform2);
if (source == null) {
source = getConsoleIconForVoicePlatform(voicePlatform);
}
r75[6] = source != null ? <Icon source={source} size={Icon.Sizes.REFRESH_SMALL_16} style={styles.legacyVoiceStateIcon} /> : null;
r75[7] = stream ? <LiveTag style={styles.legacyVoiceStateIcon} /> : null;
r154 = <ReanimatedRexport.View style={style}>{r75}</ReanimatedRexport.View>;
}
return r154;
});
export default r63;
export function getVoiceUserHeight(a0) {
return Math.max(scaleTextLineHeight(variant, a0), AVATAR_SIZE_MAP[XSMALL_20]) + 10;
}
@@ -0,0 +1,78 @@
// Metro module 15112 (f15113).
import { useState, useCallback } from "react";
import { View } from "react-native";
import { createStyles } from "../../../design/components/Styles/native/createStyles";
import useDisplayNameStyles from "../../display_name_styles/hooks/useDisplayNameStyles";
import { useDisplayNameStylesFont } from "../../display_name_styles/native/useDisplayNameStylesFont";
import { Text } from "../../../design/components/Text/native/Text";
import UserUtils from "../../../utils/UserUtils";
import { intl, t } from "../../../intl/index.native";
import VoiceGuildTag from "../../guild_tag/native/VoiceGuildTag";
const useStyles = createStyles({
container: {
marginLeft: 8,
flex: 1,
flexDirection: "row"
},
tag: {
flexDirection: "row",
alignItems: "center",
paddingLeft: 8
},
measuringTag: {
opacity: 0
}
});
export default function VoiceUserNameItem(props) {
const { member, user, guildId } = props;
let isGuest = props.isGuest;
const { color, variant } = props;
const styles = useStyles();
const displayNameStylesFont = useDisplayNameStylesFont({
displayNameStyles: useDisplayNameStyles({
userId: user.id,
guildId
})
});
const [state, setState] = useState(0);
const [state2, setState2] = useState(0);
let [state3, setState3] = useState(true);
const [state4, setState4] = useState(0);
const callback2 = useCallback((a0) => {
setState(a0.nativeEvent.layout.width);
}, []);
const callback = useCallback((a0) => {
setState2(a0.nativeEvent.layout.width);
}, []);
const callback3 = useCallback((a0) => {
setState4(a0.nativeEvent.layout.width);
setState3(false);
}, []);
const style = [styles.container, state3 ? styles.measuringTag : state3];
const style2 = displayNameStylesFont != null && {
fontFamily: displayNameStylesFont
};
let r77 = member?.nick;
if (r77 == null) {
r77 = UserUtils.getName(user);
}
const r81 = [r77, ,];
if (isGuest) {
isGuest = <Text variant="text-sm/normal" lineClamp={1} color="status-positive">
{" "}
{intl.string(t["pFO/Ph"])}
</Text>;
}
r81[1] = isGuest;
const r96 = [<Text variant={variant} color={color} lineClamp={1} onLayout={callback} style={style2}>{r81}</Text>, ,];
if (!state3) {
state3 = state !== 0 && state2 !== 0 && state4 !== 0 && state >= state2 + state4;
}
if (state3) {
state3 = <View onLayout={callback3} style={styles.tag}>
<VoiceGuildTag userId={user.id} />
</View>;
}
r96[1] = state3;
return <View onLayout={callback2} style={style}>{r96}</View>;
};
@@ -0,0 +1,53 @@
// Metro module 15115 (f15116).
import { memo } from "react";
import { View } from "react-native";
import { CutoutDirection, SummarizedIconRow, OverflowTextSmall, CutoutableAvatarImage, AvatarSizes } from "../../../design/void/native";
import { createStyles } from "../../../design/components/Styles/native/createStyles";
import useIsUsingClientTheme from "../../client_themes/native/useIsUsingClientTheme";
import { useClientThemesOverride } from "../../client_themes/native/ClientThemesOverrides";
import { StageIcon } from "../../../design/components/Icon/native/redesign/generated/StageIcon";
import { VoiceNormalIcon } from "../../../design/components/Icon/native/redesign/generated/VoiceNormalIcon";
const cutout = Object.freeze({
direction: CutoutDirection.RIGHT,
inset: -2
});
const useStyles = createStyles({
container: {
flexDirection: "row",
alignItems: "center",
paddingHorizontal: 16,
height: 40
},
containerNoPadding: {
flexDirection: "row",
alignItems: "center",
height: 40
},
iconContainer: {
height: 40
},
redesignChannelIcon: {
marginRight: 4
},
overflow: {
height: 20,
paddingHorizontal: 4,
paddingVertical: 0,
display: "flex",
flexDirection: "row",
alignItems: "center"
},
transparentBorder: {
borderColor: "transparent"
}
});
const r44 = memo(function({ users, max, guildId, renderIcon, noPadding, stageIcon }) {
const styles = useStyles();
const r14 = useIsUsingClientTheme() ? styles.transparentBorder : null;
return <View style={[noPadding ? styles.containerNoPadding : styles.container, useClientThemesOverride()]}>
{renderIcon && stageIcon ? <StageIcon size="sm" color="channel-icon" style={styles.redesignChannelIcon} /> : <VoiceNormalIcon size="sm" color="channel-icon" style={styles.redesignChannelIcon} />}
<SummarizedIconRow offsetAmount={-6} style={styles.iconContainer} overflowStyle={[styles.overflow, r14]} overflowComponent={OverflowTextSmall} items={users} max={max} renderItem={(info, a1) => <CutoutableAvatarImage user={info} guildId={guildId} size={AvatarSizes.XSMALL_20} cutout={a1 ? void 0 : cutout} />} />
</View>;
});
export default r44;
export const VOICE_USER_SUMMARY_HEIGHT = 40;
+103
View File
@@ -0,0 +1,103 @@
// Metro module 15109 (f15110).
import { memo } from "react";
import { View } from "react-native";
import GuildMemberStore from "../../../stores/GuildMemberStore";
import { createStyles } from "../../../design/components/Styles/native/createStyles";
import Module712 from "../../../_bundle/Module712";
import { makeSizeStyle } from "../../main_tabs_v2/native/shared_components/guild_channels/layouts/ChannelListLayout";
import useIsUsingClientTheme from "../../client_themes/native/useIsUsingClientTheme";
import { useStateFromStoresObject } from "../../../_bundle/Module589";
import VoiceUser from "./VoiceUser";
import { scaleTextLineHeight } from "../../screen/native/useScaledTextLineHeight.android";
import { intl, t } from "../../../intl/index.native";
import { HeadphonesIcon } from "../../../design/components/Icon/native/redesign/generated/HeadphonesIcon";
import { Text } from "../../../design/components/Text/native/Text";
import VoiceUsersItem from "./VoiceUsersItem";
let variant, useStyles, Component;
const AudienceItem = function AudienceItem(props) {
const { audienceCount, collapsed: collapsed2 } = props;
const styles = useStyles(useIsUsingClientTheme());
return <View style={collapsed2 ? styles.listenersCollapsed : styles.listeners}>
<View style={styles.listenersIconWrapper}>
<HeadphonesIcon color="redesign-channel-name-muted-text" size="custom" style={styles.headphonesIcon} />
</View>
<Text style={styles.listenersText} variant={variant} color="redesign-channel-name-muted-text">
{collapsed2 ? audienceCount : intl.formatToPlainString(t["+v2pN2"], {
count: audienceCount
})}
</Text>
</View>;
};
variant = "text-sm/medium";
useStyles = createStyles((a0) => {
const backgroundColor = a0 ? Module712.colors.MOBILE_EXPRESSION_PICKER_BACKGROUND_DEFAULT : Module712.colors.BACKGROUND_BASE_LOWEST;
const round = Module712.radii.round;
return {
listeners: {
display: "flex",
flexDirection: "row",
alignItems: "center",
padding: 4,
marginTop: 4,
marginLeft: -8
},
listenersCollapsed: {
flexDirection: "row",
alignItems: "center",
backgroundColor,
borderRadius: round,
marginLeft: -16,
marginTop: 4,
paddingLeft: 2,
paddingRight: 6
},
listenersIconWrapper: {
alignItems: "center",
justifyContent: "center",
backgroundColor,
marginRight: 8,
marginLeft: 4,
borderRadius: round,
...makeSizeStyle(20)
},
listenersText: {
marginRight: 4
},
userCollapsedOverlap: {
marginLeft: -20
},
headphonesIcon: makeSizeStyle(14)
};
});
Component = memo(function(a0) {
const voiceState = a0.voiceState;
const user = voiceState.user;
let member = voiceState.member;
const voiceState2 = voiceState.voiceState;
const { channel, collapsed: collapsed2, isFirst } = a0;
const styles = useStyles(useIsUsingClientTheme());
const stateFromStoresObject = useStateFromStoresObject([GuildMemberStore], () => ({
storeMember: GuildMemberStore.getMember(channel.guild_id, user.id),
isGuest: GuildMemberStore.isGuestOrLurker(channel.guild_id, user.id)
}), [channel.guild_id, user.id]);
const { storeMember, isGuest } = stateFromStoresObject;
const style = collapsed2 ? isFirst ? null : styles.userCollapsedOverlap : null;
if (member == null) {
member = storeMember;
}
return <View style={style}>
<VoiceUser key={user.id} user={user} member={member} mute={voiceState2.mute} deaf={voiceState2.deaf} selfVideo={voiceState2.selfVideo} selfMute={voiceState2.selfMute} selfDeaf={voiceState2.selfDeaf} suppress={voiceState2.suppress} collapsed={collapsed2} sessionId={voiceState2.sessionId} channel={channel} isGuest={isGuest} />
</View>;
});
export default function VoiceUsers(props) {
const { collapsed, channel: channel2, voiceStates, audienceCount } = props;
return voiceStates.length !== 0 ? <VoiceUsersItem collapsed={collapsed}>
{voiceStates.map(function(a0, index) {
return <Component key={`voice-user-item-${a0.user.id}-${a0.voiceState.sessionId}`} voiceState={a0} channel={channel2} collapsed={collapsed} isFirst={index === 0} />;
})}
{audienceCount != null && audienceCount > 0 && <AudienceItem audienceCount={audienceCount} collapsed={collapsed} />}
</VoiceUsersItem> : null;
};
export function getAudienceItemHeight(a0) {
return 8 + Math.max(20, scaleTextLineHeight(variant, a0));
}
@@ -0,0 +1,25 @@
// Metro module 15114 (f15115).
import { View } from "react-native";
import { createStyles } from "../../../design/components/Styles/native/createStyles";
const useStyles = createStyles({
voiceStates: {
paddingRight: 8
},
voiceStatesCollapsed: {
paddingRight: 0,
flexDirection: "row",
flexWrap: "wrap",
alignItems: "center"
}
});
export default function VoiceUsersItem(props) {
let collapsed = props.collapsed;
const children = props.children;
const styles = useStyles();
const style = [collapsed ? !collapsed : styles.voiceStates, ,];
if (collapsed) {
collapsed = styles.voiceStatesCollapsed;
}
style[1] = collapsed;
return <View style={style}>{children}</View>;
};
@@ -0,0 +1,106 @@
// Metro module 15226 (f15227).
import { useEffect, useMemo } from "react";
import GuildProgressStore from "../../guild_progress/GuildProgressStore";
import GuildChannelStore from "../../../stores/GuildChannelStore";
import GuildStore from "../../../stores/GuildStore";
import UserStore from "../../../stores/UserStore";
import { ChannelListChannelNoticeRow } from "../GuildSidebarConstants";
import { MFALevels } from "../../../Constants";
import { ContentDismissActionType, DismissibleContentGroupName } from "../../dismissible_content/DismissibleContentConstants";
import mobileAccountLinkingExperiment from "../../application_account_linking/experiments/mobileAccountLinkingExperiment";
import { useStateFromStores, useStateFromStoresArray } from "../../../_bundle/defaultAreStatesEqual";
import { useApplication } from "../../applications/ApplicationActionCreators";
import useStartAuthorize from "../../application_account_linking/native/useStartAuthorize";
import { useDefaultAuthorizationNotifiers } from "../../application_account_linking/native/useDefaultAuthorizationNotifiers";
import { useSelectedSingleUseGuildDismissibleContent } from "../../dismissible_content/hooks/useSelectedDismissibleContent";
import { DismissibleContent } from "../../../_bundle/Module1358";
import { UNSAFE_markSingleUseGuildDismissibleContentAsDismissed } from "../../dismissible_content/DismissibleContentUnsafeUtils";
import { useGuildHasLiveChannelNotice } from "../../guild_scheduled_events/useGuildHasLiveChannelNotice";
import { useCanShowGameClaimCoachmark } from "../../game_claim/useGameClaimCoachmark";
export default function useChannelNoticeRows(a0) {
let currentUser, stateFromStores2, guildHasLiveChannelNotice, c21781_6, c21781_7;
const id = a0.id;
const stateFromStores = useStateFromStores([GuildProgressStore], () => GuildProgressStore.hasProgress(id));
currentUser = UserStore.getCurrentUser();
stateFromStores2 = useStateFromStores([GuildChannelStore], () => currentUser != null && a0.mfaLevel === MFALevels.ELEVATED && !currentUser.mfaEnabled && GuildChannelStore.hasElevatedPermissions(id), [currentUser, a0.mfaLevel, id]);
guildHasLiveChannelNotice = useGuildHasLiveChannelNotice(id);
const r53 = useCanShowGameClaimCoachmark(id) ? [DismissibleContent.GAME_CLAIM_COACHMARK] : [];
let hasAlreadyLinked;
const [r63, gameClaimMarkAsDismissed] = useSelectedSingleUseGuildDismissibleContent(r53, id, DismissibleContentGroupName.CHANNEL_NOTICES, true);
const r4 = r63 != null;
c21781_6 = r4;
const id2 = id;
hasAlreadyLinked = void 0;
let enabled = mobileAccountLinkingExperiment.useConfig({
location: "useMobileAccountLinkRow"
}).enabled;
const r76 = useStateFromStoresArray([GuildStore], () => {
let r8 = GuildStore.getGuild(id2)?.gameApplicationIds;
if (r8 == null) {
r8 = [];
}
return r8;
})[0];
const startAuthorize = useStartAuthorize(useApplication(enabled ? r76 : null).data);
const fetched = startAuthorize.fetched;
hasAlreadyLinked = startAuthorize.hasAlreadyLinked;
const { canStartAuthorization, startAuthorization, connectionApp } = startAuthorize;
const defaultAuthorizationNotifiers = useDefaultAuthorizationNotifiers(startAuthorization, hasAlreadyLinked);
if (enabled) {
enabled = fetched;
}
if (enabled) {
enabled = !hasAlreadyLinked;
}
if (enabled) {
enabled = canStartAuthorization;
}
if (enabled) {
enabled = connectionApp != null;
}
if (enabled) {
enabled = connectionApp.applicationAccountLinkBenefitConfig != null;
}
if (enabled) {
enabled = connectionApp.applicationAccountLinkBenefitConfig.reward_name != null;
}
if (enabled) {
enabled = connectionApp.applicationAccountLinkBenefitConfig.reward_image != null;
}
const [r114, applicationAccountLinkMarkAsDismissed] = useSelectedSingleUseGuildDismissibleContent(enabled ? [DismissibleContent.MOBILE_ACCOUNT_LINKING_BANNER] : [], id, DismissibleContentGroupName.CHANNEL_NOTICES, true);
useEffect(() => {
if (hasAlreadyLinked) {
UNSAFE_markSingleUseGuildDismissibleContentAsDismissed(DismissibleContent.MOBILE_ACCOUNT_LINKING_BANNER, id2, {
dismissAction: ContentDismissActionType.INDIRECT_ACTION,
guildId: id2,
groupName: DismissibleContentGroupName.CHANNEL_NOTICES
});
}
}, [id, hasAlreadyLinked]);
const r121 = r114 != null;
c21781_7 = r121;
return {
rows: useMemo(() => {
const r6 = [ChannelListChannelNoticeRow.SPACER];
if (c21781_6) {
r6.push(ChannelListChannelNoticeRow.GAME_CLAIM);
}
if (c21781_7) {
r6.push(ChannelListChannelNoticeRow.APPLICATION_ACCOUNT_LINK);
}
if (stateFromStores) {
r6.push(ChannelListChannelNoticeRow.GUILD_PROGRESS);
} else if (stateFromStores2) {
r6.push(ChannelListChannelNoticeRow.MFA_WARNING);
}
if (guildHasLiveChannelNotice) {
r6.push(ChannelListChannelNoticeRow.LIVE_CHANNEL_NOTICE);
}
return r6;
}, [stateFromStores, stateFromStores2, guildHasLiveChannelNotice, r4, r121]),
gameClaimMarkAsDismissed,
applicationAccountLinkMarkAsDismissed,
startApplicationAccountLinkAuthorization: defaultAuthorizationNotifiers,
accountLinkApplication: connectionApp
};
};
@@ -0,0 +1,58 @@
// Metro module 15230 (f15231).
import { useState, useEffect } from "react";
import CacheStore from "../../cache/CacheStore";
import GatewayConnectionStore from "../../gateway/GatewayConnectionStore";
import { ComponentActions } from "../../../Constants";
import { coerceGuildsRoute } from "../../main_tabs_v2/helpers/NavigationRouteUtils.native";
import { getRootNavigationRef } from "../../main_tabs_v2/RootNavigationRef.native";
import { ComponentDispatch } from "../../../utils/ComponentDispatchUtils";
let c10815_7 = false;
export function useShouldRenderChannelList() {
const [state, setState] = useState(c10815_7);
useEffect(() => {
let handleGatewayChange2, handleCacheChange2, handleNavigationChange2;
const allowRender2 = function allowRender() {
c10815_7 = true;
setState(true);
};
handleGatewayChange2 = function handleGatewayChange() {
if (GatewayConnectionStore.isConnected()) {
c10815_7 = true;
setState(true);
}
};
handleCacheChange2 = function handleCacheChange() {
if (CacheStore.getLazyCacheStatus() === "cache-loaded") {
c10815_7 = true;
setState(true);
}
};
handleNavigationChange2 = function handleNavigationChange() {
const rootNavigationRef = getRootNavigationRef();
if (coerceGuildsRoute(rootNavigationRef == null ? void 0 : rootNavigationRef.getCurrentRoute()) != null) {
c10815_7 = true;
setState(true);
}
};
if (state) {
return void 0;
}
GatewayConnectionStore.addReactChangeListener(handleGatewayChange2);
CacheStore.addReactChangeListener(handleCacheChange2);
ComponentDispatch.subscribe(ComponentActions.BOTTOM_CHANNEL_SCREEN_DRAG_START, allowRender2);
const rootNavigationRef = getRootNavigationRef();
if (rootNavigationRef != null) {
rootNavigationRef.addListener("state", handleNavigationChange2);
}
return () => {
GatewayConnectionStore.removeReactChangeListener(handleGatewayChange2);
CacheStore.addReactChangeListener(handleCacheChange2);
ComponentDispatch.unsubscribe(ComponentActions.BOTTOM_CHANNEL_SCREEN_DRAG_START, allowRender2);
const rootNavigationRef = getRootNavigationRef();
if (rootNavigationRef != null) {
rootNavigationRef.removeListener("state", handleNavigationChange2);
}
};
}, [state]);
return state;
}
@@ -0,0 +1,4 @@
// Metro module 15193 (f15194).
export default function showChannelBadge({ mentionsCount, isNewChannel, postsWithUnreadsCount, muted }) {
return mentionsCount != null && mentionsCount > 0 || isNewChannel || muted != null && !muted && postsWithUnreadsCount != null && postsWithUnreadsCount > 0;
};
@@ -0,0 +1,4 @@
// Metro module 15196 (f15197).
export function showChannelItemEmbeddedActivities(a0) {
return a0.length > 0;
}
@@ -0,0 +1,103 @@
// Metro module 15224 (f15225).
import GuildOnboardingHomeSettingsStore from "../guild_onboarding_home/GuildOnboardingHomeSettingsStore";
import { ChannelListGuildActionRow } from "./GuildSidebarConstants";
import { GuildFeatures } from "../../Constants";
import useCanSeeEventsInChannelList from "../guild_scheduled_events/useCanSeeEventsInChannelList";
import { useCanReviewGuildMemberApplications } from "../guild_member_verification/canReviewGuildMemberApplications";
import { useShowRoleSubscriptionsInChannelList } from "../guild_role_subscriptions/useRoleSubscriptionsVisibleInGuild";
import { useGuildShopVisibleInGuild } from "../creator_monetization/guild_shop/useGuildShopVisibleInGuild";
import * as _SlayerStorefrontUtils from "../slayer_storefront/SlayerStorefrontUtils";
import { useCanSeeOnboardingHome } from "../guild_onboarding_home/OnboardingHomeUtils";
import { useStateFromStores } from "../../_bundle/defaultAreStatesEqual";
import { useCanManageVibegrations } from "../vibegrations/lib/VibegrationsUtils";
import useIsNewMember from "../guild_onboarding_home/useIsNewMember";
import { useAllActionsCompleted } from "../guild_onboarding_home/MemberActionUtils";
import { useCanAccessMemberSafetyPage } from "../guild_mod_dash_member_safety/MemberSafetyPermissionsUtils";
import { useCanUseGuildSpace } from "../guild_space/canUseGuildSpace";
import useHasAllocateBoostPermission from "../premium/powerups/hooks/useHasAllocateBoostPermission";
import { useMobileBoostProgressBarEnabled } from "../premium/powerups/experiments/MobileBoostProgressBarExperiment";
import useTotalPossibleBoostCount from "../premium/powerups/hooks/useTotalPossibleBoostCount";
import { useIsGuildOfficialMessagesEnabled } from "../messages/GuildOfficialMessageUtils";
import { useGameServerEnabled } from "../premium/game_server/GameServerExperiment";
import { useIsGameServerTabAlwaysOnEnabled } from "../premium/game_server/experiments/GameServerTabAlwaysOnExperiment";
import { useSelectedDismissibleContent } from "../dismissible_content/hooks/useSelectedDismissibleContent";
import { DismissibleContent } from "../../_bundle/Module1358";
export default function useGuildActionRows(a0) {
const canSeeEventsInChannelList = useCanSeeEventsInChannelList(a0.id);
let r11 = useCanReviewGuildMemberApplications(a0.id);
const showRoleSubscriptionsInChannelList = useShowRoleSubscriptionsInChannelList(a0.id);
const guildShopVisibleInGuild = useGuildShopVisibleInGuild(a0);
const hasSocialLayerStorefront = _SlayerStorefrontUtils.hasSocialLayerStorefront(a0);
const canSeeOnboardingHome = useCanSeeOnboardingHome(a0.id);
const stateFromStores = useStateFromStores([GuildOnboardingHomeSettingsStore], () => GuildOnboardingHomeSettingsStore.getNewMemberActions(a0.id), [a0.id]);
const canManageVibegrations = useCanManageVibegrations(a0, "useGuildActionRows");
const isNewMember = useIsNewMember(a0.id);
const allActionsCompleted = useAllActionsCompleted(a0.id);
useCanAccessMemberSafetyPage(a0.id);
const canUseGuildSpace2 = useCanUseGuildSpace(a0, "useGuildActionRows");
const r19 = a0.features.has(GuildFeatures.HUB);
const r80 = a0.features.has(GuildFeatures.COMMUNITY);
a0.features.has(GuildFeatures.ENABLED_MODERATION_EXPERIENCE_FOR_NON_COMMUNITY);
const hasAllocateBoostPermission = useHasAllocateBoostPermission(a0.id);
const mobileBoostProgressBarEnabled = useMobileBoostProgressBarEnabled("useGuildActionRows");
const totalPossibleBoostCount = useTotalPossibleBoostCount(a0);
const isGuildOfficialMessagesEnabled = useIsGuildOfficialMessagesEnabled(a0.id, "useGuildActionRows");
const gameServerEnabled = useGameServerEnabled(a0.id, "useGuildActionRows");
const r105 = a0.features.has(GuildFeatures.GAME_SERVERS);
const isGameServerTabAlwaysOnEnabled = useIsGameServerTabAlwaysOnEnabled("useGuildActionRows");
const r117 = gameServerEnabled && (isGameServerTabAlwaysOnEnabled && !r105) ? [DismissibleContent.EMPTY_GAME_SERVER_TAB] : [];
const r118 = [];
const [r122] = useSelectedDismissibleContent(r117, void 0, true);
if (canUseGuildSpace2) {
r118.push(ChannelListGuildActionRow.GUILD_SPACE);
}
if (r19) {
r118.push(ChannelListGuildActionRow.GUILD_HUB_HEADER_OPTIONS);
}
if (!allActionsCompleted && (canSeeOnboardingHome && (isNewMember && (stateFromStores != null && stateFromStores.length > 0)))) {
r118.push(ChannelListGuildActionRow.GUILD_NEW_MEMBER_ACTIONS_PROGRESS_BAR);
} else if (a0.premiumProgressBarEnabled && mobileBoostProgressBarEnabled && totalPossibleBoostCount > 0) {
r118.push(ChannelListGuildActionRow.GUILD_PREMIUM_PROGRESS_BAR);
}
if (r19 ? !r19 : canSeeOnboardingHome) {
r118.push(ChannelListGuildActionRow.GUILD_HOME);
}
if (canSeeEventsInChannelList) {
r118.push(ChannelListGuildActionRow.GUILD_SCHEDULED_EVENTS);
}
if (r19 ? !r19 : r80) {
r118.push(ChannelListGuildActionRow.CHANNELS_AND_ROLES);
}
if (showRoleSubscriptionsInChannelList) {
r118.push(ChannelListGuildActionRow.GUILD_ROLE_SUBSCRIPTIONS);
}
if (guildShopVisibleInGuild) {
r118.push(ChannelListGuildActionRow.GUILD_SHOP);
}
if (hasSocialLayerStorefront) {
r118.push(ChannelListGuildActionRow.GUILD_GAME_SHOP);
}
if (r11) {
r11 = a0.features.has(GuildFeatures.MEMBER_VERIFICATION_MANUAL_APPROVAL);
}
if (r11) {
r118.push(ChannelListGuildActionRow.GUILD_MOD_DASH_MEMBER_SAFETY);
}
if (hasAllocateBoostPermission) {
r118.push(ChannelListGuildActionRow.GUILD_BOOSTS);
}
if (isGuildOfficialMessagesEnabled) {
r118.push(ChannelListGuildActionRow.GUILD_OFFICIAL_MESSAGES);
}
if (gameServerEnabled) {
if (r105) {
r118.push(ChannelListGuildActionRow.GAME_SERVERS);
} else if (r122 != null) {
r118.push(ChannelListGuildActionRow.GAME_SERVERS_EMPTY);
}
}
if (canManageVibegrations) {
r118.push(ChannelListGuildActionRow.GUILD_VIBEGRATIONS);
}
return r118;
};
@@ -0,0 +1,57 @@
// Metro module 11447 (f11448).
import { MAX_STAGE_VOICE_USER_LIMIT } from "../../Constants";
import useChannelVideoLimit from "../video_calls/useChannelVideoLimit";
export default function useShowConnectedUserLimit({ channel, locked, video, selected }) {
const r5 = {
channel,
video
};
const channel2 = r5.channel;
let video2 = r5.video;
let considerMaxStageVoiceUserLimit = r5.considerMaxStageVoiceUserLimit;
if (considerMaxStageVoiceUserLimit === void 0) {
considerMaxStageVoiceUserLimit = true;
}
const limit = useChannelVideoLimit(channel2).limit;
const r11 = channel2.userLimit > 0 ? channel2.userLimit : -1;
if (video2) {
video2 = limit > 0;
}
const r22 = video2 ? r11 > 0 ? Math.min(r11, limit) : limit : r11;
return (considerMaxStageVoiceUserLimit ? r22 !== MAX_STAGE_VOICE_USER_LIMIT ? r22 : 0 : r22) > 0 && !locked && !selected;
};
export function useConnectedUserLimit(a0) {
const channel = a0.channel;
let video = a0.video;
let considerMaxStageVoiceUserLimit = a0.considerMaxStageVoiceUserLimit;
if (considerMaxStageVoiceUserLimit === void 0) {
considerMaxStageVoiceUserLimit = true;
}
const limit = useChannelVideoLimit(channel).limit;
const r9 = channel.userLimit > 0 ? channel.userLimit : -1;
if (video) {
video = limit > 0;
}
const r18 = video ? r9 > 0 ? Math.min(r9, limit) : limit : r9;
return considerMaxStageVoiceUserLimit ? r18 !== MAX_STAGE_VOICE_USER_LIMIT ? r18 : 0 : r18;
}
export function useConnectedUserLimitFormatted({ channel, video, userCount }) {
const r14 = {
channel,
video
};
const channel2 = r14.channel;
let video2 = r14.video;
let considerMaxStageVoiceUserLimit = r14.considerMaxStageVoiceUserLimit;
if (considerMaxStageVoiceUserLimit === void 0) {
considerMaxStageVoiceUserLimit = true;
}
const limit = useChannelVideoLimit(channel2).limit;
const r12 = channel2.userLimit > 0 ? channel2.userLimit : -1;
if (video2) {
video2 = limit > 0;
}
const r23 = video2 ? r12 > 0 ? Math.min(r12, limit) : limit : r12;
const r29 = considerMaxStageVoiceUserLimit ? r23 !== MAX_STAGE_VOICE_USER_LIMIT ? r23 : 0 : r23;
return r29 <= 0 ? null : userCount != null ? `${userCount >= 1000 ? `${Math.floor(userCount / 1000)}k${userCount % 1000 !== 0 ? "+" : ""}` : userCount.toFixed(0).padStart(2, "0")}/${r29 >= 1000 ? `${Math.floor(r29 / 1000)}k${r29 % 1000 !== 0 ? "+" : ""}` : r29.toFixed(0).padStart(2, "0")}` : r29 >= 1000 ? `${Math.floor(r29 / 1000)}k${r29 % 1000 !== 0 ? "+" : ""}` : r29.toFixed(0).padStart(2, "0");
}