Files
discord-decomp/sources/modules/calls/ChannelRTCStore.tsx
T
2026-07-27 16:20:00 +03:00

1002 lines
48 KiB
TypeScript

/* Metro module 4606; source: modules/calls/ChannelRTCStore.tsx; dependencies: [6, 7, 15, 17, 18, 57, 1378, 4295, 4492, 1226, 4258, 1379, 4396, 1934, 4607, 1878, 4609, 4297, 4299, 661, 3, 4610, 22, 44, 4619, 4285, 566, 694, 2] */
function _fun39390(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#39390, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4784:6, offset: 0x010e1003, size: 1212 bytes, params: 8, frame: 27
const env0_0 = require;
const _arrayLikeToArray_39396 = function(a0, a1) {
var r0;
var r1;
var r2;
var value3;
var length;
var value5;
var value = undefined;
var value2 = value == null;
reducibleJoin2: while (true) {
if (value2) {
r0 = value2;
break reducibleJoin2;
}
value3 = value > a0.length;
r0 = value3;
break reducibleJoin2;
}
reducibleJoin4: while (true) {
if (r0) {
length = a0.length;
r1 = length;
break reducibleJoin4;
}
r1 = value;
break reducibleJoin4;
}
value = (0, global.Array)(r1);
var value4 = 0;
if (value4 < r1) {
r2 = value4;
reducibleLoop5: while (true) {
value[r2] = a0[r2];
value5 = typeof r2 === 'bigint' ? r2 + 1n : +r2 + 1;
if (value5 < r1) {
r2 = value5;
continue reducibleLoop5;
}
break reducibleLoop5;
}
}
return value;
};
const closure = CONNECTION_OPEN_SUPPLEMENTAL_39411;
const handleEmbeddedActivityChange = function() {
return updateParticipants(_fun39414);
};
const closure2 = function({userId}) {
return updateParticipants(_fun39416);
};
const closure3 = function({user}) {
return updateParticipant(user.id);
};
const closure4 = function({channelId}) {
return updateParticipants(_fun39419, [channelId]);
};
const closure5 = CHANNEL_DELETE_39420;
const closure6 = function({streamKey}) {
var value2 = require(dependencyMap[25]).decodeStreamKey(streamKey);
return updateParticipant(value2.ownerId, [value2.channelId]);
};
let Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_3 = importDefault(6) /* metro dependency 6 */;
const env0_4 = importDefault(7) /* metro dependency 7 */;
const env0_5 = importDefault(15) /* metro dependency 15 */;
const env0_6 = importDefault(17) /* metro dependency 17 */;
const env0_7 = importDefault(18) /* metro dependency 18 */;
const env0_8 = importDefault(57) /* metro dependency 57 */;
const embeddedActivitiesStore = importDefault(1378) /* metro dependency 1378: EmbeddedActivitiesStore */;
const gameConsoleStore = importDefault(4295) /* metro dependency 4295: GameConsoleStore */;
const applicationStreamingStore = importDefault(4492) /* metro dependency 4492: ApplicationStreamingStore */;
const authenticationStore = importDefault(1226) /* metro dependency 1226: AuthenticationStore */;
const callStore = importDefault(4258) /* metro dependency 4258: CallStore */;
const channelStore = importDefault(1379) /* metro dependency 1379: ChannelStore */;
const presenceStore = importDefault(4396) /* metro dependency 4396: PresenceStore */;
const selectedChannelStore = importDefault(1934) /* metro dependency 1934: SelectedChannelStore */;
const speakingStore = importDefault(4607) /* metro dependency 4607: SpeakingStore */;
const userStore = importDefault(1878) /* metro dependency 1878: UserStore */;
const videoStreamStore = importDefault(4609) /* metro dependency 4609: VideoStreamStore */;
const voiceStateStore = importDefault(4297) /* metro dependency 4297: VoiceStateStore */;
let value = require(4299) /* metro dependency 4299: CallConstants */;
const env0_21 = value.ParticipantTypes;
const env0_22 = value.ParticipantSelectionTypes;
const env0_23 = value.isStreamParticipant;
value = require(661) /* metro dependency 661: Constants */;
const env0_24 = value.ChannelLayouts;
const env0_25 = value.ChannelModes;
const env0_26 = value.ChannelTypes;
const env0_27 = value.AppContext;
value = importDefault(3) /* metro dependency 3: Logger */;
value = new value('ChannelRTCStore');
value.enableNativeLogger(true);
Object = global.Object;
value = Object.freeze([]);
const env0_30 = [];
const env0_31 = {};
const env0_32 = {};
const env0_33 = {};
const env0_34 = {};
const env0_35 = {};
const env0_36 = {};
const env0_37 = {};
const env0_38 = {};
const env0_39 = {};
const env0_40 = {};
const PersistedStore = (importDefault(566) /* metro dependency 566: flux */).PersistedStore;
let value3 = _fun39423(PersistedStore);
value3.displayName = 'ChannelRTCStore';
value3.persistKey = 'ChannelRTCStore';
const value6 = new value3(importDefault(694) /* metro dependency 694: Dispatcher */,
{CONNECTION_OPEN: CONNECTION_OPEN_39451, CONNECTION_OPEN_SUPPLEMENTAL: closure, THREAD_LIST_SYNC: closure,
OVERLAY_INITIALIZE: closure, VOICE_CHANNEL_SELECT: VOICE_CHANNEL_SELECT_39452,
CHANNEL_SELECT: CHANNEL_SELECT_39455, CHANNEL_RTC_ACTIVE_CHANNELS: closure,
VOICE_STATE_UPDATES: function({voiceStates, initial}) {
return voiceStates.reduce(_fun39457, false);
}, CHANNEL_CREATE: CHANNEL_CREATE_39458, CHANNEL_DELETE: closure5, THREAD_DELETE: closure5, CALL_CREATE: closure4,
CALL_UPDATE: closure4, CALL_DELETE: function({channelId}) {
clearChannel(channelId);
}, CHANNEL_RTC_SELECT_PARTICIPANT: CHANNEL_RTC_SELECT_PARTICIPANT_39460,
CHANNEL_RTC_POPOUT_PARTICIPANT: CHANNEL_RTC_POPOUT_PARTICIPANT,
CHANNEL_RTC_RETURN_PARTICIPANT: function({channelId, participantId}) {
var value2 = _getParticipants(channelId);
value2.updateParticipantPoppedOut(participantId, false);
var value3 = value2.getParticipant(participantId);
if (value3 != null && value3.type !== ParticipantTypes.ACTIVITY) {
updateParticipant(value3.user.id, [channelId]);
}
}, CHANNEL_RTC_UPDATE_LAYOUT: CHANNEL_RTC_UPDATE_LAYOUT,
CHANNEL_RTC_UPDATE_PARTICIPANTS_OPEN: CHANNEL_RTC_UPDATE_PARTICIPANTS_OPEN,
CHANNEL_RTC_UPDATE_VOICE_PARTICIPANTS_HIDDEN: CHANNEL_RTC_UPDATE_VOICE_PARTICIPANTS_HIDDEN,
CHANNEL_RTC_UPDATE_STAGE_STREAM_SIZE: CHANNEL_RTC_UPDATE_STAGE_STREAM_SIZE,
CHANNEL_RTC_UPDATE_STAGE_VIDEO_LIMIT_BOOST_UPSELL_DISMISSED: CHANNEL_RTC_UPDATE_STAGE_VIDEO_LIMIT_BOOST_UPSELL_DISMISSED,
STREAM_UPDATE_SELF_HIDDEN: STREAM_UPDATE_SELF_HIDDEN_39469,
CHANNEL_RTC_UPDATE_CHAT_OPEN: CHANNEL_RTC_UPDATE_CHAT_OPEN_39470, RTC_CONNECTION_VIDEO: function({channelId,
userId}) {
return updateParticipant(userId, [channelId]);
}, RTC_CONNECTION_PLATFORM: function({channelId, userId}) {
return updateParticipant(userId, [channelId]);
}, AUDIO_SET_LOCAL_VIDEO_DISABLED: function({userId}) {
return updateParticipant(userId);
}, MEDIA_ENGINE_VIDEO_SOURCE_QUALITY_CHANGED: function({channelId, senderUserId, maxResolution, maxFrameRate}) {
return updateParticipants(_fun39475, [channelId]);
}, STREAM_CLOSE: closure6, STREAM_DELETE: closure6, STREAM_WATCH: function({streamKey}) {
var value2 = require(dependencyMap[25]).decodeStreamKey(streamKey);
return updateParticipant(value2.ownerId, [value2.channelId]);
}, SPEAKING: closure2, GUILD_SOUNDBOARD_SOUND_PLAY_START: closure2, GUILD_SOUNDBOARD_SOUND_PLAY_END: closure2,
PUSH_TO_TALK_STATE_CHANGE: function() {
return updateParticipants(_fun39478);
}, GUILD_RING_START: GUILD_RING_START, GUILD_RING_STOP: GUILD_RING_STOP, USER_UPDATE: closure3,
GUILD_MEMBER_UPDATE: closure3, GUILD_DELETE: GUILD_DELETE_39485});
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/calls/ChannelRTCStore.tsx');
exports.default = value6;
exports.NO_PARTICIPANTS = value;
}
function _isNativeReflectConstruct_39391() { // fn#39391, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4784:455, offset: 0x010e14bf, size: 94 bytes, params: 1, frame: 18
var Boolean;
var prototype;
var valueOf;
var call;
var Reflect;
var construct;
var closure;
var value;
var error;
try {
Boolean = global.Boolean;
prototype = Boolean.prototype;
valueOf = prototype.valueOf;
call = valueOf.call;
Reflect = global.Reflect;
construct = Reflect.construct;
Boolean = global.Boolean;
closure = function() {
};
value = Reflect.apply(construct, Reflect, [Boolean, [], closure]);
value = Reflect.apply(call, valueOf, [value]);
var result = !value;
} catch (error) {
}
return (_isNativeReflectConstruct_39391_isNativeReflectConstruct = function() {
return !!result;
})();
}
function _createForOfIteratorHelperLoose_39394(a0, a1) { // fn#39394, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4784:648, offset: 0x010e151d, size: 370 bytes, params: 3, frame: 20
var r6;
var r9;
var r5;
var value3;
var regexp;
const env0_0 = a0;
const Symbol = global.Symbol;
let value = typeof Symbol !== 'undefined';
let r1 = value && a0[global.Symbol.iterator];
r1 = !r1 ? a0['@@iterator'] : r1;
if (r1) {
value = r1.call(a0);
return value.next.bind(value);
}
const Array = global.Array;
if (Array.isArray(a0)) {
if (r1) {
}
return _fun39395;
}
value = undefined;
if (a0) {
if (typeof a0 === 'string') {
value = _arrayLikeToArray_39396(a0, value);
r5 = value;
} else {
value3 = ({}).toString.call(a0).slice(8, -1);
r6 = value3 === 'Object' && a0.constructor;
r9 = r6 ? a0.constructor.name : value3;
if (r9 === 'Map') {
r6 = global.Array.from(a0);
} else if (r9 === 'Set') {
r6 = global.Array.from(a0);
} else if (r9 === 'Arguments') {
value = _arrayLikeToArray_39396(a0, value);
r6 = value;
} else {
regexp = RegExp('^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$', '');
if (regexp.test(r9)) {
value = _arrayLikeToArray_39396(a0, value);
r6 = value;
} else {
r6 = value;
}
}
r5 = r6;
}
} else {
r5 = value;
}
if (r5) {
if (r5) {
}
return _fun39395;
}
const TypeError = global.TypeError;
throw new TypeError('Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.');
}
function _getParticipants(a0) { // fn#39397, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4784:1701, offset: 0x010e168f, size: 78 bytes, params: 2, frame: 14
var r0;
var value3;
const property = env0_31[a0];
if (property != null) {
r0 = property;
} else {
value3 = new (importDefault(4610) /* metro dependency 4610: ChannelRTCParticipants */)(a0);
env0_31[a0] = value3;
r0 = value3;
}
return r0;
}
function updateParticipants(a0) { // fn#39398, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4784:1787, offset: 0x010e16dd, size: 46 bytes, params: 2, frame: 13
const value = a1;
const env0_0 = a0;
return (value !== undefined ? value : env0_30).reduce(_fun39399, false);
}
function updateParticipant(a0) { // fn#39403, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4784:3022, offset: 0x010e1a86, size: 45 bytes, params: 2, frame: 13
const value = a1;
const env0_0 = a0;
return updateParticipants(_fun39404, value !== undefined ? value : env0_30);
}
function _getSelectedParticipantId(a0) { // fn#39405, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4784:3113, offset: 0x010e1aca, size: 85 bytes, params: 2, frame: 13
var r0;
var items2;
const channel = ChannelStore.getChannel(a0);
if (channel != null) {
channel.isDM();
}
let NONE = ParticipantSelectionTypes.NONE;
const property = env0_32[a0];
if (property != null) {
r0 = property;
} else {
items2 = [NONE];
NONE = ParticipantSelectionTypes.NONE;
items2[1] = NONE;
r0 = items2;
}
return r0;
}
function getHasSelectedParticipant(a0) { // fn#39406, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4784:3239, offset: 0x010e1b1f, size: 68 bytes, params: 2, frame: 15
return env0_32[a0] != null && env0_8(env0_32[a0], 1)[0] !== ParticipantSelectionTypes.NONE;
}
function updateElapsedSelectedParticipantStats(a0) { // fn#39407, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4784:3318, offset: 0x010e1b63, size: 131 bytes, params: 2, frame: 14
if (env0_33[a0] == null) {
env0_33[a0] = {'gridDurationMs': 0, 'focusDurationMs': 0, 'toggleCount': 0, 'lastUpdate': 0};
}
const property = env0_33[a0];
const value2 = global.performance.now();
if (property.lastUpdate > 0) {
property[getHasSelectedParticipant(a0) ? 'focusDurationMs' : 'gridDurationMs'] += value2 - property.lastUpdate;
}
property.lastUpdate = value2;
}
function setSelectedParticipantId(a0, a1) { // fn#39408, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4784:3611, offset: 0x010e1be6, size: 91 bytes, params: 3, frame: 14
var property;
var toggleCount;
updateElapsedSelectedParticipantStats(a0);
const hasSelectedParticipant = getHasSelectedParticipant(a0);
if (a1 == null) {
delete env0_32[a0];
} else {
env0_32[a0] = a1;
}
if (hasSelectedParticipant !== getHasSelectedParticipant(a0)) {
property = env0_33[a0];
toggleCount = property.toggleCount;
property.toggleCount = typeof toggleCount === 'bigint' ? toggleCount + 1n : +toggleCount + 1;
}
}
function hasVideo(a0) { // fn#39409, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4784:3806, offset: 0x010e1c41, size: 119 bytes, params: 2, frame: 16
const size = a0.size;
const ChannelRTCParticipantsIndexes = (require(4610) /* metro dependency 4610: ChannelRTCParticipants */).ChannelRTCParticipantsIndexes;
const STREAM = ChannelRTCParticipantsIndexes.STREAM;
let r0 = Reflect.apply(size, a0, [STREAM]) > 0 || a0.size(ChannelRTCParticipantsIndexes.VIDEO) > 0;
r0 = !r0 ? a0.hasEmbeddedActivity() : r0;
return r0;
}
function clearChannel(a0) { // fn#39410, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4784:3973, offset: 0x010e1cb8, size: 42 bytes, params: 2, frame: 3
delete env0_31[a0];
delete env0_32[a0];
delete env0_34[a0];
delete env0_35[a0];
}
function CHANNEL_RTC_ACTIVE_CHANNELS() { // fn#39411, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4784:4046, offset: 0x010e1ce2, size: 267 bytes, params: 1, frame: 19
const updateParticipantsBinding = updateParticipants;
const items2 = [];
const channelId = SelectedChannelStore.getChannelId();
if (channelId != null) {
items2.push(channelId);
}
const voiceChannelId = SelectedChannelStore.getVoiceChannelId();
if (!(voiceChannelId == null || items2.includes(voiceChannelId))) {
items2.push(voiceChannelId);
}
const remoteSessionId = GameConsoleStore.getRemoteSessionId();
const getVoiceStateForSession = VoiceStateStore.getVoiceStateForSession;
const getId = AuthenticationStore.getId;
const value7 = Reflect.apply(getVoiceStateForSession, VoiceStateStore, [Reflect.apply(getId, AuthenticationStore,
[]), remoteSessionId]);
const value8 = undefined;
if ((value7 == null ? value8 : value7.channelId) != null) {
items2.push(value7 == null ? value8 : value7.channelId);
}
const value9 = (importDefault(22) /* metro dependency 22 */).difference(env0_30, items2);
value9.forEach(clearChannel);
return updateParticipantsBinding(function(a0) {
return a0.rebuild();
}, (importDefault(22) /* metro dependency 22 */).difference(items2, env0_30));
}
function handleEmbeddedActivityChange() { // fn#39413, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4784:4508, offset: 0x010e1dfc, size: 23 bytes, params: 1, frame: 11
return updateParticipants(function(a0) {
return a0.updateEmbeddedActivities();
});
}
function GUILD_SOUNDBOARD_SOUND_PLAY_END({userId}) { // fn#39415, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4784:4609, offset: 0x010e1e22, size: 35 bytes, params: 2, frame: 11
return updateParticipants(function(a0) {
return a0.updateParticipantSpeaking(userId);
});
}
function CALL_CREATE_39418({channelId}) { // fn#39418, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4784:4775, offset: 0x010e1e79, size: 40 bytes, params: 2, frame: 13
return updateParticipants(function(a0) {
return a0.rebuild();
}, [channelId]);
}
function CHANNEL_DELETE_39420({channel}) { // fn#39420, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4784:4864, offset: 0x010e1ea1, size: 45 bytes, params: 2, frame: 11
const id = channel.id;
delete env0_38[id];
delete env0_39[id];
clearChannel(id);
}
function isGuildVocalOrThread(a0) { // fn#39422, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4784:5089, offset: 0x010e1f1a, size: 58 bytes, params: 2, frame: 13
var r0;
const Boolean = global.Boolean;
let value = ChannelStore.getChannel(a0);
if (value == null) {
r0 = undefined;
} else {
value = value.isGuildVocalOrThread();
r0 = value;
}
return Boolean(r0);
}
function _fun39423(a0) { // fn#39423, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4784:5208, offset: 0x010e1f54, size: 638 bytes, params: 2, frame: 16
const closure = ChannelRTCStore;
env0_7(closure, a0);
return env0_4(closure, [{key: 'initialize', value: value_39425}, {key: 'getState', value: value_39426},
{key: 'getParticipantsVersion', value: function(a0) {
return _getParticipants(a0).version;
}}, {key: 'getParticipants', value: value_39428}, {key: 'getSpeakingParticipants', value: value_39429},
{key: 'getFilteredParticipants', value: value_39430}, {key: 'getVideoParticipants', value: value_39431},
{key: 'getStreamParticipants', value: value_39432}, {key: 'getActivityParticipants', value: value_39433},
{key: 'getParticipant', value: value_39434}, {key: 'getUserParticipantCount', value: value_39435},
{key: 'getParticipantsOpen', value: value_39436}, {key: 'getVoiceParticipantsHidden', value: value_39437},
{key: 'getSelectedParticipantId', value: value_39438}, {key: 'getSelectedParticipant', value: value_39439},
{key: 'getSelectedParticipantStats', value: value_39440}, {key: 'getGuildRingingUsers', value: function(a0) {
return _getParticipants(a0).guildRingingUsers;
}}, {key: 'getMode', value: value_39442}, {key: 'getLayout', value: value_39443}, {key: 'getChatOpen',
value: value_39444}, {key: 'getAllChatOpen', value: value_39445}, {key: 'isFullscreenInContext',
value: value_39446}, {key: 'getStageStreamSize', value: value_39448},
{key: 'getStageVideoLimitBoostUpsellDismissed', value: value_39449}, {key: 'isParticipantPoppedOut',
value: function(a0, a1) {
var value = this.getParticipant(a0, a1);
return value != null && ('isPoppedOut' in value && value.isPoppedOut);
}}]);
}
function CONNECTION_OPEN_39451() { // fn#39451, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4784:8775, offset: 0x010e2819, size: 69 bytes, params: 1, frame: 14
var r3;
var clearChannelBinding;
var value4;
var value5;
const value2 = _createForOfIteratorHelperLoose_39394(env0_30);
const value3 = value2();
let done = value3.done;
if (!done) {
for (r3 = value3; true; r3 = value5) {
clearChannelBinding = clearChannel;
value4 = r3.value;
clearChannelBinding(value4);
value5 = value2();
done = value5.done;
if (done) {
break;
}
}
}
CONNECTION_OPEN_SUPPLEMENTAL_39411();
}
function VOICE_CHANNEL_SELECT_39452({channelId, currentVoiceChannelId}) { // fn#39452, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4784:9093, offset: 0x010e285e, size: 167 bytes, params: 2, frame: 17
var r0;
if (channelId != null) {
delete env0_33[channelId];
} else if (currentVoiceChannelId != null) {
delete env0_38[currentVoiceChannelId];
delete env0_39[currentVoiceChannelId];
updateElapsedSelectedParticipantStats(currentVoiceChannelId);
}
const value = false;
if (channelId === currentVoiceChannelId) {
r0 = value;
} else if (currentVoiceChannelId != null) {
_getParticipants(currentVoiceChannelId).guildRingingUsers.forEach(_fun39453);
r0 = updateParticipants(function(a0) {
return a0.rebuild();
}, [currentVoiceChannelId]);
} else {
r0 = value;
}
r0 = !r0 ? CONNECTION_OPEN_SUPPLEMENTAL_39411() : r0;
return r0;
}
function CHANNEL_SELECT_39455({channelId, messageId}) { // fn#39455, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4784:9489, offset: 0x010e291f, size: 107 bytes, params: 2, frame: 14
var r2;
var r1;
var value;
const value2 = CONNECTION_OPEN_SUPPLEMENTAL_39411();
if (channelId == null) {
return value2;
}
if (messageId == null) {
return value2;
}
if (env0_38[channelId]) {
return value2;
}
const channel = ChannelStore.getChannel(channelId);
if (channel == null) {
r1 = value2;
} else {
if (channel.isGuildVocal()) {
value = true;
env0_38[channelId] = value;
r2 = value;
} else {
r2 = value2;
}
r1 = r2;
}
return r1;
}
function VOICE_STATE_UPDATES_39456({voiceStates, initial}) { // fn#39456, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4784:9786, offset: 0x010e298a, size: 42 bytes, params: 2, frame: 13
return voiceStates.reduce(_fun39457, false);
}
function CHANNEL_CREATE_39458({channel}) { // fn#39458, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4784:10156, offset: 0x010e2a72, size: 125 bytes, params: 2, frame: 9
var r3;
var binding;
var id;
var APP;
const type = channel.type;
const GROUP_DM = ChannelTypes.GROUP_DM;
if (type === GROUP_DM) {
var originChannelId = channel.originChannelId;
if (originChannelId != null) {
binding = env0_35;
id = channel.id;
APP = AppContext.APP;
r3 = env0_35[originChannelId]?.[AppContext.APP];
r3 = r3 ?? ChannelLayouts.NORMAL;
binding[id] = {[APP]: r3};
return true;
}
}
return false;
}
function CHANNEL_RTC_SELECT_PARTICIPANT_39460({channelId, id}) { // fn#39460, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4784:10586, offset: 0x010e2b07, size: 384 bytes, params: 2, frame: 22
var moduleValue2;
var value6;
var ownerId;
var id2;
var value8;
var error;
var binding;
const value2 = _getParticipants(channelId);
if (id == null) {
value2.toArray(require(dependencyMap[21]).ChannelRTCParticipantsIndexes.STREAM).forEach(_fun39461);
}
let property = env0_8(_getSelectedParticipantId(channelId), 2)[1];
setSelectedParticipantId(channelId, [id ?? ParticipantSelectionTypes.NONE, property]);
const moduleValue = require(dependencyMap[25]);
if (moduleValue.isStreamKey(id)) {
try {
property = dependencyMap[25];
moduleValue2 = require(property);
value6 = moduleValue2.decodeStreamKey(id);
ownerId = value6.ownerId;
id2 = AuthenticationStore.getId();
value8 = ownerId !== id2;
if (!value8) {
updateParticipant(ownerId, [channelId]);
}
} catch (error) {
binding = env0_28;
binding.warn('INVALID STREAM KEY FORMAT ' + id, error);
}
if (!hasVideo(value2)) {
env0_36[channelId] = false;
}
}
}
function CHANNEL_RTC_POPOUT_PARTICIPANT({channelId, participantId}) { // fn#39462, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4784:11105, offset: 0x010e2cb9, size: 158 bytes, params: 2, frame: 18
if (env0_8(_getSelectedParticipantId(channelId), 1)[0] === participantId) {
setSelectedParticipantId(channelId, null);
}
const value4 = _getParticipants(channelId);
const participant = value4.getParticipant(participantId);
if (participant != null && participant.type !== ParticipantTypes.ACTIVITY) {
value4.updateParticipantPoppedOut(participantId, true);
updateParticipant(participant.user.id, [channelId]);
}
}
function CHANNEL_RTC_UPDATE_LAYOUT({channelId, layout, appContext}) { // fn#39464, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4784:11673, offset: 0x010e2dc9, size: 53 bytes, params: 2, frame: 15
const binding = env0_35;
const object2 = {};
copyDataProperties(object2, binding[channelId], undefined);
object2[appContext] = layout;
binding[channelId] = object2;
}
function CHANNEL_RTC_UPDATE_PARTICIPANTS_OPEN({channelId, participantsOpen}) { // fn#39465, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4784:11795, offset: 0x010e2dfe, size: 29 bytes, params: 2, frame: 3
env0_36[channelId] = participantsOpen;
}
function CHANNEL_RTC_UPDATE_VOICE_PARTICIPANTS_HIDDEN({channelId, voiceParticipantsHidden}) { // fn#39466, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4784:11920, offset: 0x010e2e1b, size: 29 bytes, params: 2, frame: 3
env0_37[channelId] = voiceParticipantsHidden;
}
function CHANNEL_RTC_UPDATE_STAGE_STREAM_SIZE({channelId, large}) { // fn#39467, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4784:12051, offset: 0x010e2e38, size: 29 bytes, params: 2, frame: 3
env0_39[channelId] = large;
}
function CHANNEL_RTC_UPDATE_STAGE_VIDEO_LIMIT_BOOST_UPSELL_DISMISSED({channelId, dismissed}) { // fn#39468, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4784:12179, offset: 0x010e2e55, size: 29 bytes, params: 2, frame: 3
env0_40[channelId] = dismissed;
}
function STREAM_UPDATE_SELF_HIDDEN_39469({channelId, selfStreamHidden}) { // fn#39469, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4784:12297, offset: 0x010e2e72, size: 145 bytes, params: 2, frame: 17
var property;
const id = AuthenticationStore.getId();
if (selfStreamHidden) {
property = env0_8(_getSelectedParticipantId(channelId), 1)[0];
if ((require(4285) /* metro dependency 4285: StreamKeyUtils */).isStreamKey(property) && property.includes(id)) {
setSelectedParticipantId(channelId, null);
}
}
updateParticipant(id, [channelId]);
}
function CHANNEL_RTC_UPDATE_CHAT_OPEN_39470({channelId, chatOpen}) { // fn#39470, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4784:12567, offset: 0x010e2f03, size: 29 bytes, params: 2, frame: 3
env0_38[channelId] = chatOpen;
}
function MEDIA_ENGINE_VIDEO_SOURCE_QUALITY_CHANGED({channelId, senderUserId, maxResolution, maxFrameRate}) { // fn#39474, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4784:13023, offset: 0x010e2f5e, size: 70 bytes, params: 2, frame: 13
return updateParticipants(function(a0) {
return a0.updateParticipantQuality(senderUserId, maxResolution, maxFrameRate);
}, [channelId]);
}
function PUSH_TO_TALK_STATE_CHANGE() { // fn#39477, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4784:13543, offset: 0x010e2fc7, size: 23 bytes, params: 1, frame: 11
return updateParticipants(function(a0) {
return a0.updateParticipantSpeaking(AuthenticationStore.getId());
});
}
function GUILD_RING_START({channelId, guildId, ongoingRings}) { // fn#39479, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4784:13671, offset: 0x010e2fff, size: 160 bytes, params: 2, frame: 18
var env0_0;
const defaultImport = importDefault(4619) /* metro dependency 4619: GuildVoiceRingingExperiment */;
const getCurrentConfig = defaultImport.getCurrentConfig;
if (Reflect.apply(getCurrentConfig, defaultImport, [{guildId: guildId, location: 'guild_ring_start'}]).enabled) {
env0_0 = _getParticipants(channelId);
global.Object.keys(ongoingRings).forEach(_fun39480);
return updateParticipants(function(a0) {
return a0.rebuild();
}, [channelId]);
}
return false;
}
function GUILD_RING_STOP({channelId, guildId, ringing}) { // fn#39482, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4784:13981, offset: 0x010e30b9, size: 142 bytes, params: 2, frame: 18
var env0_0;
const defaultImport = importDefault(4619) /* metro dependency 4619: GuildVoiceRingingExperiment */;
const getCurrentConfig = defaultImport.getCurrentConfig;
if (Reflect.apply(getCurrentConfig, defaultImport, [{guildId: guildId, location: 'guild_ring_start'}]).enabled) {
env0_0 = _getParticipants(channelId);
ringing.forEach(_fun39483);
return updateParticipants(function(a0) {
return a0.rebuild();
}, [channelId]);
}
return false;
}
function GUILD_DELETE_39485({guild}) { // fn#39485, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4784:14335, offset: 0x010e3147, size: 117 bytes, params: 2, frame: 18
const items2 = [];
const defaultImport = importDefault(22) /* metro dependency 22 */;
defaultImport.forEach(env0_30, _fun39486);
if (items2.length === 0) {
return false;
}
defaultImport.forEach(items2, function(a0) {
clearChannel(a0);
});
}
function _fun39399(a0, a1) { // fn#39399, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4784:1839, offset: 0x010e170b, size: 214 bytes, params: 3, frame: 15
var r5;
var r0;
let value = a0;
if (env0_0(_getParticipants(a1))) {
value = _getParticipants(a1);
if (value.size() !== 0) {
r5 = isGuildVocalOrThread(a1) || hasVideo(value) ? ChannelModes.VIDEO : ChannelModes.VOICE;
if (r5 === ChannelModes.VOICE) {
r5 = env1_35[a1]?.[AppContext.APP];
delete env1_34[a1];
if (r5 !== ChannelLayouts.HAVEN) {
delete env1_35[a1];
}
} else {
env1_34[a1] = r5;
}
}
updateSelectedParticipantId(a1);
value = true;
r0 = value;
} else {
r0 = value;
}
return r0;
}
function ChannelRTCStore() { // fn#39424, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4784:5220, offset: 0x010e21d2, size: 113 bytes, params: 1, frame: 20
const value = environment.__proto__;
env1_3(this, ChannelRTCStore);
const value3 = env1_6(ChannelRTCStore);
return env1_5(this, _isNativeReflectConstruct_39391() ? global.Reflect.construct(value3, arguments,
env1_6(this).constructor) : value3.apply(this, arguments));
}
function value_39425(a0) { // fn#39425, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4784:5513, offset: 0x010e2243, size: 188 bytes, params: 2, frame: 35
var Object;
this.waitFor(ApplicationStreamingStore, AuthenticationStore, CallStore, ChannelStore, EmbeddedActivitiesStore,
GameConsoleStore, PresenceStore, SelectedChannelStore, SpeakingStore, UserStore, VideoStreamStore,
VoiceStateStore);
this.syncWith([EmbeddedActivitiesStore], handleEmbeddedActivityChange);
this.syncWith([GameConsoleStore], CONNECTION_OPEN_SUPPLEMENTAL_39411);
const value2 = undefined;
if (value2 !== (a0 == null ? value2 : a0.voiceParticipantsHidden)) {
Object = global.Object;
Object.assign(env1_37, a0 == null ? value2 : a0.voiceParticipantsHidden);
}
return value2;
}
function value_39426() { // fn#39426, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4784:5793, offset: 0x010e22ff, size: 16 bytes, params: 1, frame: 2
return {voiceParticipantsHidden: env1_37};
}
function value_39428(a0) { // fn#39428, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4784:5954, offset: 0x010e2328, size: 39 bytes, params: 2, frame: 12
return _getParticipants(a0).toArray() ?? env1_29;
}
function value_39429(a0) { // fn#39429, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4784:6062, offset: 0x010e234f, size: 72 bytes, params: 2, frame: 15
const value2 = _getParticipants(a0);
const toArray = value2.toArray;
const ChannelRTCParticipantsIndexes = (require(4610) /* metro dependency 4610: ChannelRTCParticipants */).ChannelRTCParticipantsIndexes;
const SPEAKING = ChannelRTCParticipantsIndexes.SPEAKING;
return Reflect.apply(toArray, value2, [SPEAKING]) ?? env1_29;
}
function value_39430(a0) { // fn#39430, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4784:6218, offset: 0x010e2397, size: 124 bytes, params: 2, frame: 15
const ChannelRTCParticipantsIndexes = (require(4610) /* metro dependency 4610: ChannelRTCParticipants */).ChannelRTCParticipantsIndexes;
const value = environment.__proto__;
const value2 = _getParticipants(a0);
const property = env1_37[a0];
return property == null ? value2.toArray(ChannelRTCParticipantsIndexes.NOT_POPPED_OUT) : property ? value2.toArray(ChannelRTCParticipantsIndexes.FILTERED) : value2.toArray(ChannelRTCParticipantsIndexes.NOT_POPPED_OUT);
}
function value_39431(a0) { // fn#39431, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4784:6445, offset: 0x010e2413, size: 72 bytes, params: 2, frame: 15
const value2 = _getParticipants(a0);
const toArray = value2.toArray;
const ChannelRTCParticipantsIndexes = (require(4610) /* metro dependency 4610: ChannelRTCParticipants */).ChannelRTCParticipantsIndexes;
const VIDEO = ChannelRTCParticipantsIndexes.VIDEO;
return Reflect.apply(toArray, value2, [VIDEO]) ?? env1_29;
}
function value_39432(a0) { // fn#39432, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4784:6596, offset: 0x010e245b, size: 72 bytes, params: 2, frame: 15
const value2 = _getParticipants(a0);
const toArray = value2.toArray;
const ChannelRTCParticipantsIndexes = (require(4610) /* metro dependency 4610: ChannelRTCParticipants */).ChannelRTCParticipantsIndexes;
const STREAM = ChannelRTCParticipantsIndexes.STREAM;
return Reflect.apply(toArray, value2, [STREAM]) ?? env1_29;
}
function value_39433(a0) { // fn#39433, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4784:6750, offset: 0x010e24a3, size: 72 bytes, params: 2, frame: 15
const value2 = _getParticipants(a0);
const toArray = value2.toArray;
const ChannelRTCParticipantsIndexes = (require(4610) /* metro dependency 4610: ChannelRTCParticipants */).ChannelRTCParticipantsIndexes;
const ACTIVITY = ChannelRTCParticipantsIndexes.ACTIVITY;
return Reflect.apply(toArray, value2, [ACTIVITY]) ?? env1_29;
}
function value_39434(a0, a1) { // fn#39434, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4784:6897, offset: 0x010e24eb, size: 33 bytes, params: 3, frame: 11
const value = environment.__proto__;
return _getParticipants(a0).getParticipant(a1);
}
function value_39435(a0) { // fn#39435, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4784:6995, offset: 0x010e250c, size: 109 bytes, params: 2, frame: 16
let value = environment.__proto__;
const value2 = _getParticipants(a0);
let size = value2.size;
const value3 = Reflect.apply(size, value2, []);
size = value2.size;
const ChannelRTCParticipantsIndexes = (require(4610) /* metro dependency 4610: ChannelRTCParticipants */).ChannelRTCParticipantsIndexes;
const STREAM = ChannelRTCParticipantsIndexes.STREAM;
value = value3 - Reflect.apply(size, value2, [STREAM]);
size = value2.size;
const ACTIVITY = ChannelRTCParticipantsIndexes.ACTIVITY;
return value - Reflect.apply(size, value2, [ACTIVITY]);
}
function value_39436(a0) { // fn#39436, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4784:7196, offset: 0x010e2579, size: 28 bytes, params: 2, frame: 3
const value = environment.__proto__;
const property = env1_36[a0];
return property == null || property;
}
function value_39437(a0) { // fn#39437, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4784:7281, offset: 0x010e2595, size: 28 bytes, params: 2, frame: 3
const value = environment.__proto__;
const property = env1_37[a0];
return property != null && property;
}
function value_39438(a0) { // fn#39438, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4784:7364, offset: 0x010e25b1, size: 116 bytes, params: 2, frame: 16
const value3 = env1_8(_getSelectedParticipantId(a0), 2);
const property = value3[0];
const property2 = value3[1];
const NONE = ParticipantSelectionTypes.NONE;
const value4 = null;
return property === NONE ? value4 : property !== ParticipantSelectionTypes.AUTO ? property : property2 === ParticipantSelectionTypes.NONE || property2 === ParticipantSelectionTypes.AUTO ? value4 : property2;
}
function value_39439(a0) { // fn#39439, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4784:7538, offset: 0x010e2625, size: 53 bytes, params: 2, frame: 13
var r0;
var value3;
let value = this.getSelectedParticipantId(a0);
const value2 = null;
if (value2 == value) {
r0 = value2;
} else {
value3 = environment.__proto__;
value = _getParticipants(a0).getParticipant(value);
r0 = value;
}
return r0;
}
function value_39440(a0) { // fn#39440, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4784:7690, offset: 0x010e265a, size: 103 bytes, params: 2, frame: 14
var r0;
var object2;
var Math;
const property = env1_33[a0];
if (property == null) {
r0 = {};
} else {
object2 = {};
Math = global.Math;
object2.view_mode_grid_duration_ms = Math.floor(property.gridDurationMs);
Math = global.Math;
object2.view_mode_focus_duration_ms = Math.floor(property.focusDurationMs);
object2.view_mode_toggle_count = property.toggleCount;
r0 = object2;
}
return r0;
}
function value_39442(a0) { // fn#39442, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4784:8000, offset: 0x010e26da, size: 57 bytes, params: 2, frame: 13
return env1_34[a0] ?? (isGuildVocalOrThread(a0) ? ChannelModes.VIDEO : ChannelModes.VOICE);
}
function value_39443(a0) { // fn#39443, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4784:8107, offset: 0x010e2713, size: 37 bytes, params: 2, frame: 2
var value;
if (a1 === undefined) {
value = environment.__proto__;
AppContext.APP;
}
return ChannelLayouts.NORMAL;
}
function value_39444(a0) { // fn#39444, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4784:8170, offset: 0x010e2738, size: 28 bytes, params: 2, frame: 3
const value = environment.__proto__;
const property = env1_38[a0];
return property != null && property;
}
function value_39446() { // fn#39446, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4784:8300, offset: 0x010e275d, size: 71 bytes, params: 1, frame: 12
var environment;
let value = a0;
const env0_0 = value !== undefined ? value : AppContext.APP;
const Object = global.Object;
const values = Object.values;
value = environment.__proto__;
return Reflect.apply(values, Object, [env1_35]).some(_fun39447);
}
function value_39448(a0) { // fn#39448, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4784:8408, offset: 0x010e27c5, size: 16 bytes, params: 2, frame: 2
return env1_39[a0];
}
function value_39449(a0) { // fn#39449, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4784:8486, offset: 0x010e27d5, size: 16 bytes, params: 2, frame: 2
return env1_40[a0];
}
function _fun39453(a0) { // fn#39453, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4784:9345, offset: 0x010e2905, size: 26 bytes, params: 2, frame: 13
return env0_0.updateGuildRingingUsers(a0, false);
}
function _fun39457(a0, {userId, channelId, guildId}) { // fn#39457, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4784:9863, offset: 0x010e29b4, size: 190 bytes, params: 3, frame: 21
var value4;
var defaultImport;
const value = a0;
if (guildId != null && channelId != null) {
value4 = environment.__proto__;
defaultImport = importDefault(4619) /* metro dependency 4619: GuildVoiceRingingExperiment */;
if (defaultImport.getCurrentConfig({guildId: guildId, location: 'voice_status_update'},
{autoTrackExposure: false}).enabled) {
_getParticipants(channelId).updateGuildRingingUsers(userId, false);
}
}
return initial ? channelId == null || env1_30.includes(channelId) ? updateParticipant(userId) || value : value : updateParticipant(userId) || value;
}
function _fun39461(a0) { // fn#39461, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4784:10741, offset: 0x010e2c87, size: 50 bytes, params: 2, frame: 12
var binding;
if (isStreamParticipant(a0)) {
binding = env0_0;
binding.updateParticipant(a0.user.id);
}
}
function _fun39480(a0) { // fn#39480, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4784:13886, offset: 0x010e309f, size: 26 bytes, params: 2, frame: 13
return env0_0.updateGuildRingingUsers(a0, true);
}
function _fun39486(a0) { // fn#39486, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4784:14405, offset: 0x010e31bc, size: 79 bytes, params: 2, frame: 12
var r0;
let value = environment.__proto__;
const value2 = ChannelStore.getChannel(a0) != null;
if (value2) {
value = value.getGuildId();
value = value !== guild.id;
r0 = value;
} else {
r0 = value2;
}
if (!r0) {
env0_1.push(a0);
}
}
function updateSelectedParticipantId(a0) { // fn#39400, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4784:2134, offset: 0x010e17e1, size: 569 bytes, params: 2, frame: 24
var r6;
var r5;
var value10;
var participant;
const id = AuthenticationStore.getId();
const _getParticipantsBinding = _getParticipants;
const value3 = undefined;
const value4 = _getParticipantsBinding(a0);
if (value4.size() === 0) {
setSelectedParticipantId(a0, null);
} else {
var getVoiceChannelId = SelectedChannelStore.getVoiceChannelId;
if (Reflect.apply(getVoiceChannelId, SelectedChannelStore, []) !== a0) {
setSelectedParticipantId(a0, null);
return value3;
}
ParticipantSelectionTypes.NONE;
var toArray = value4.toArray;
var ChannelRTCParticipantsIndexes = (require(4610) /* metro dependency 4610: ChannelRTCParticipants */).ChannelRTCParticipantsIndexes;
var STREAM = ChannelRTCParticipantsIndexes.STREAM;
var value7 = Reflect.apply(toArray, value4, [STREAM]).find(_fun39401);
if (value7 != null) {
(importDefault(44) /* metro dependency 44 */)(value7.type === ParticipantTypes.STREAM,
'Impossible condition');
r5 = value7.id;
} else if (value4.size() === 1) {
r5 = id;
} else if (value4.size(ChannelRTCParticipantsIndexes.VIDEO) === 1) {
r5 = env2_8(value4.toArray(ChannelRTCParticipantsIndexes.VIDEO), 1)[0].id;
} else {
value10 = value4.toArray().find(_fun39402);
r5 = (value10 == null ? value3 : value10.id) ?? id;
}
var property = env2_8(_getSelectedParticipantId(a0), 1)[0];
var AUTO = ParticipantSelectionTypes.AUTO;
if (property === AUTO) {
r6 = property;
} else if (property === ParticipantSelectionTypes.NONE) {
r6 = property;
} else {
participant = value4.getParticipant(property);
r6 = participant == null || participant.type === ParticipantTypes.STREAM && ApplicationStreamingStore.getActiveStreamForStreamKey(participant.id) == null ? ParticipantSelectionTypes.NONE : property;
}
setSelectedParticipantId(a0, [r6, r5]);
}
return value3;
}
function _fun39447(a0) { // fn#39447, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4784:8348, offset: 0x010e27a4, size: 33 bytes, params: 2, frame: 2
const property = a0[env0_0];
const FULL_SCREEN = ChannelLayouts.FULL_SCREEN;
return property === FULL_SCREEN;
}
function _fun39401(a0) { // fn#39401, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4784:2379, offset: 0x010e1a1a, size: 50 bytes, params: 2, frame: 12
const type = a0.type;
const value = environment.__proto__.__proto__.__proto__;
const STREAM = ParticipantTypes.STREAM;
return type === STREAM && ApplicationStreamingStore.getActiveStreamForStreamKey(a0.id);
}
function _fun39402(a0) { // fn#39402, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4784:2709, offset: 0x010e1a4c, size: 58 bytes, params: 2, frame: 4
const type = a0.type;
const value = environment.__proto__.__proto__.__proto__;
const USER = ParticipantTypes.USER;
return type === USER && a0.id !== env0_0 && !a0.ringing;
}