Files
discord-decomp/sources/stores/PrivateChannelRecipientsInviteStore.tsx
T
2026-07-28 01:06:53 +03:00

864 lines
41 KiB
TypeScript

/* Metro module 12601; source: stores/PrivateChannelRecipientsInviteStore.tsx; dependencies: [6, 7, 15, 17, 18, 4107, 5221, 1383, 1379, 5078, 6586, 1945, 1867, 3793, 1878, 661, 12602, 6592, 1861, 3995, 3829, 7238, 566, 694, 2] */
import ClassCallCheck from '../by-id/module-00006-ClassCallCheck.js'; /* Metro dependency 6 */
import CreateClass from '../by-id/module-00007-CreateClass.js'; /* Metro dependency 7 */
import PossibleConstructorReturn from '../by-id/module-00015-PossibleConstructorReturn.js'; /* Metro dependency 15 */
import Module00017 from '../by-id/module-00017.js'; /* Metro dependency 17 */
import Inherits from '../by-id/module-00018-Inherits.js'; /* Metro dependency 18 */
import Flux from '../external/discord_common/js/packages/flux/index.tsx'; /* Metro dependency 566 */
import ChannelStore from './ChannelStore.tsx'; /* Metro dependency 1379 */
import GuildStore from './GuildStore.tsx'; /* Metro dependency 1867 */
import UserStore from './UserStore.tsx'; /* Metro dependency 1878 */
import GuildMemberStore from './GuildMemberStore.tsx'; /* Metro dependency 1945 */
import RelationshipStore from './RelationshipStore.tsx'; /* Metro dependency 3793 */
import UserUtils from '../utils/UserUtils.tsx'; /* Metro dependency 3995 */
import ExperimentStore from '../modules/experiments/ExperimentStore.tsx'; /* Metro dependency 4107 */
import ConsentStore from './ConsentStore.tsx'; /* Metro dependency 5078 */
import UserAffinitiesV2Store from '../modules/user_affinities/UserAffinitiesV2Store.tsx'; /* Metro dependency 5221 */
import FrecencyStore from './FrecencyStore.tsx'; /* Metro dependency 6586 */
import UserSearchManager from '../modules/autocompleter/UserSearchManager.tsx'; /* Metro dependency 7238 */
import * as FileImportTrackerModule from '../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
import * as ConstantsModule from '../Constants.tsx'; /* Metro dependency 661 */
import * as ChannelRecordModule from '../records/ChannelRecord.tsx'; /* Metro dependency 1383 */
import * as StringUtilsModule from '../utils/StringUtils.tsx'; /* Metro dependency 1861 */
import * as UserSettingsModule from '../modules/user_settings/UserSettings.tsx'; /* Metro dependency 3829 */
import * as FrictionlessGDMsExperimentModule from '../modules/header_bar/FrictionlessGDMsExperiment.tsx'; /* Metro dependency 12602 */
function _fun96616(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#96616, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12791:6, offset: 0x02161b2f, size: 850 bytes, params: 8, frame: 23
const env0_0 = require;
const _arrayLikeToArray_96622 = 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 reset_96623 = function() {
env0_21 = '';
env0_22 = 0;
env0_23 = [];
var Set = global.Set;
var value3 = new Set();
env0_20 = false;
env0_27 = null;
env0_25 = false;
};
const setQuery = function(a0) {
env0_21 = a0;
env0_22 = 0;
return performQuery();
};
const closure = function({key}) {
if (key !== NEW_GROUP_DM_POPOUT_ID) {
return false;
}
env0_20 = true;
updateHasFriends();
env0_19 = createSearchContext();
env0_27 = null;
setQuery('');
};
const closure2 = function({key}) {
if (key !== NEW_GROUP_DM_POPOUT_ID) {
return false;
}
PRIVATE_CHANNEL_RECIPIENTS_INVITE_CLOSE();
};
const PRIVATE_CHANNEL_RECIPIENTS_INVITE_CLOSE2 = PRIVATE_CHANNEL_RECIPIENTS_INVITE_CLOSE;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
ConstantsModule.Consents;
let env0_23 = [];
let Set = global.Set;
let set = new Set();
const Store = (Flux).Store;
_fun96649(Store).displayName = 'PrivateChannelRecipientsInviteStore';
set = new set(importDefault(694) /* metro dependency 694: Dispatcher */, {CONNECTION_OPEN: function() {
reset_96623();
}, GUILD_MEMBERS_CHUNK_BATCH: GUILD_MEMBERS_CHUNK_BATCH_96658, GUILD_MEMBERS_REQUEST: GUILD_MEMBERS_REQUEST_96659,
CHANNEL_SELECT: CHANNEL_SELECT_96660, MODAL_PUSH: closure, SHOW_ACTION_SHEET: closure,
PRIVATE_CHANNEL_RECIPIENTS_INVITE_OPEN: function(a0) {
env0_20 = true;
updateHasFriends();
env0_19 = createSearchContext();
env0_27 = a0.channelId;
setQuery('');
}, MODAL_POP: closure2, HIDE_ACTION_SHEET: closure2,
PRIVATE_CHANNEL_RECIPIENTS_INVITE_CLOSE: PRIVATE_CHANNEL_RECIPIENTS_INVITE_CLOSE2,
PRIVATE_CHANNEL_RECIPIENTS_INVITE_QUERY: function(a0) {
env0_27 = a0.channelId;
setQuery(a0.query);
}, PRIVATE_CHANNEL_RECIPIENTS_INVITE_SELECT: function(a0) {
env0_22 = a0.row;
}, PRIVATE_CHANNEL_RECIPIENTS_ADD_USER: PRIVATE_CHANNEL_RECIPIENTS_ADD_USER,
PRIVATE_CHANNEL_RECIPIENTS_REMOVE_USER: PRIVATE_CHANNEL_RECIPIENTS_REMOVE_USER});
(FileImportTrackerModule).fileFinishedImporting('stores/PrivateChannelRecipientsInviteStore.tsx');
exports.default = set;
function _isNativeReflectConstruct_96617() { // fn#96617, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12791:327, offset: 0x02161e81, size: 98 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_96617_isNativeReflectConstruct = function() {
return !!result;
})();
}
function _createForOfIteratorHelperLoose_96620(a0, a1) { // fn#96620, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12791:520, offset: 0x02161ee3, size: 372 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 _fun96621;
}
value = undefined;
if (a0) {
if (typeof a0 === 'string') {
value = _arrayLikeToArray_96622(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_96622(a0, value);
r6 = value;
} else {
regexp = RegExp('^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$', '');
if (regexp.test(r9)) {
value = _arrayLikeToArray_96622(a0, value);
r6 = value;
} else {
r6 = value;
}
}
r5 = r6;
}
} else {
r5 = value;
}
if (r5) {
if (r5) {
}
return _fun96621;
}
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 _fun96621() { // fn#96621, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12791:1091, offset: 0x00c39d73, size: 69 bytes, params: 1, frame: 5
return env0_1 >= env0_0.length ? {done: true} : {done: false,
value: env0_0[typeof env0_1 === 'bigint' ? env0_1 : +env0_1]};
}
}
function setLoading(a0) { // fn#96624, offset: 0x021620a4, size: 25 bytes, params: 2, frame: 4
return env0_25 !== a0 && true;
}
function performQuery() { // fn#96626, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12791:1637, offset: 0x021620d9, size: 346 bytes, params: 1, frame: 19
var r1;
var r9;
var channel;
var binding;
var currentUser;
var value4;
var frictionlessGDMsEnabled;
var object;
var setQuery;
if (env0_20) {
channel = ChannelStore.getChannel(env0_27);
binding = env0_21;
if (binding.trim().length === 0) {
if (env0_19 != null) {
env0_19.clearQuery();
}
env0_23 = getDefaultResults(channel);
setLoading(false);
return true;
}
currentUser = UserStore.getCurrentUser();
value4 = undefined;
r1 = currentUser == null ? value4 : currentUser.isStaff();
r9 = r1 != null && r1;
frictionlessGDMsEnabled = (require(12602) /* metro dependency 12602: FrictionlessGDMsExperiment */).getFrictionlessGDMsEnabled('PrivateChannelRecipientsInviteStore');
if (frictionlessGDMsEnabled) {
(importDefault(6592) /* metro dependency 6592: GuildUtils */).requestMembers(null, env0_21);
}
if (env0_19 != null) {
binding = env0_19;
setQuery = binding.setQuery;
object = {query: env0_21};
object.filters = frictionlessGDMsEnabled ? value4 : {'friends': true, 'staff': null, 'provisional': false,
staff: r9};
object.blacklist = channel != null ? channel.recipients : [];
object.boosters = getUserBoosterMap();
Reflect.apply(setQuery, binding, [object]);
}
}
return false;
function getDefaultResults(a0) { // fn#96627, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12791:1760, owner: performQuery.getDefaultResults, offset: 0x02162233, size: 533 bytes, params: 2, frame: 23
var r12;
var r8;
var r5;
var value6;
var Array;
var from;
var Set;
var items2;
var prototype;
var value7;
var set;
var value10;
var value11;
var value12;
var value17;
var value18;
const env0_0 = a0;
const currentUser = UserStore.getCurrentUser();
const frictionlessGDMsEnabled = (FrictionlessGDMsExperimentModule).getFrictionlessGDMsEnabled('PrivateChannelRecipientsInviteStore');
const friendIDs = RelationshipStore.getFriendIDs();
let items3 = [];
arraySpread(items3, friendIDs, 0, r12);
if (currentUser == null) {
r8 = items3;
} else if (currentUser.isStaff()) {
value6 = UserStore.filter(_fun96628, false).map(function(a0) {
return a0.id;
});
Array = global.Array;
from = Array.from;
Set = global.Set;
items2 = [];
arraySpread(items2, value6, arraySpread(items2, items3, 0, value6), value6);
value7 = Object.create(Set.prototype, {constructor: {value: Set}});
set = new Set();
r8 = Reflect.apply(from, Array, [set instanceof Object ? set : value7]);
r12 = value6;
} else {
r8 = items3;
}
if (frictionlessGDMsEnabled) {
Set = global.Set;
value10 = GuildStore.getGuildIds();
prototype = Set.prototype;
value11 = Object.create(prototype, {constructor: {value: Set}});
set = new Set();
value12 = set instanceof Object ? set : value11;
value17 = UserAffinitiesV2Store.getUserAffinities().map(function(a0) {
return a0.otherUserId;
}).filter(_fun96631).filter(_fun96632).filter(_fun96633);
Array = global.Array;
from = Array.from;
Set = global.Set;
items3 = [];
arraySpread(items3, value17, arraySpread(items3, r8, 0, r12), r12);
prototype = Set.prototype;
value18 = Object.create(prototype, {constructor: {value: Set}});
set = new Set(items3);
r5 = Reflect.apply(from, Array, [set instanceof Object ? set : value18]);
} else {
r5 = r8;
}
const value23 = (a0 != null && a0.isGroupDM() ? r5.filter(_fun96634) : r5).reduce(_fun96635, []);
return value23.sort(sortUserList);
function _fun96628(a0) { // fn#96628, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12791:1958, offset: 0x02162448, size: 39 bytes, params: 2, frame: 10
return a0.isStaff() && a0.id !== env0_1.id;
}
function _fun96631(a0) { // fn#96631, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12791:2145, offset: 0x0216246f, size: 36 bytes, params: 2, frame: 3
return a0 !== env0_1?.id;
}
function _fun96632(a0) { // fn#96632, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12791:2184, offset: 0x02162493, size: 26 bytes, params: 2, frame: 11
const relationshipStoreBinding = RelationshipStore;
return !relationshipStoreBinding.isBlockedOrIgnored(a0);
}
function _fun96633(a0) { // fn#96633, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12791:2222, offset: 0x021624ad, size: 26 bytes, params: 2, frame: 11
const relationshipStoreBinding = RelationshipStore;
return !relationshipStoreBinding.isFriend(a0);
}
function _fun96634(a0) { // fn#96634, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12791:2314, offset: 0x021624c7, size: 31 bytes, params: 2, frame: 11
const recipients = env0_0.recipients;
return !recipients.includes(a0);
}
function _fun96635(a0, a1) { // fn#96635, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12791:2362, offset: 0x021624e6, size: 288 bytes, params: 3, frame: 19
var binding;
var object;
var relationshipStoreBinding;
var isFriend;
var id;
var getMutualGuildsWithCurrentUserBinding;
let value = environment.__proto__.__proto__;
const user = UserStore.getUser(a1);
if (user != null) {
if (user.isProvisional) {
return a0;
}
if (user.bot) {
if (user.isStaff()) {
if (env0_1 == null) {
return a0;
}
binding = env0_1;
if (binding.isStaff()) {
object = {user: user};
object.comparator = (importDefault(3995) /* metro dependency 3995: UserUtils */).getName(user);
if (env0_2) {
if (ClassCallCheck == null) {
a0.push(object);
return a0;
}
relationshipStoreBinding = RelationshipStore;
isFriend = relationshipStoreBinding.isFriend;
id = user.id;
if (Reflect.apply(isFriend, relationshipStoreBinding, [id])) {
a0.push(object);
return a0;
}
getMutualGuildsWithCurrentUserBinding = getMutualGuildsWithCurrentUser;
id = user.id;
value = getMutualGuildsWithCurrentUserBinding(id, ClassCallCheck);
if (value.length !== 0) {
if (value.length > 0) {
object.mutualGuilds = value;
}
a0.push(object);
return a0;
}
if (user.isStaff()) {
if (env0_1 == null) {
return a0;
}
binding = env0_1;
if (binding.isStaff()) {
if (value.length > 0) {
object.mutualGuilds = value;
}
a0.push(object);
return a0;
}
return a0;
}
return a0;
}
a0.push(object);
return a0;
}
return a0;
}
return a0;
}
object = {user: user};
object.comparator = (importDefault(3995) /* metro dependency 3995: UserUtils */).getName(user);
if (env0_2) {
if (ClassCallCheck == null) {
a0.push(object);
return a0;
}
relationshipStoreBinding = RelationshipStore;
isFriend = relationshipStoreBinding.isFriend;
id = user.id;
if (Reflect.apply(isFriend, relationshipStoreBinding, [id])) {
a0.push(object);
return a0;
}
getMutualGuildsWithCurrentUserBinding = getMutualGuildsWithCurrentUser;
id = user.id;
value = getMutualGuildsWithCurrentUserBinding(id, ClassCallCheck);
if (value.length !== 0) {
if (value.length > 0) {
object.mutualGuilds = value;
}
a0.push(object);
return a0;
}
if (user.isStaff()) {
if (env0_1 == null) {
return a0;
}
binding = env0_1;
if (binding.isStaff()) {
if (value.length > 0) {
object.mutualGuilds = value;
}
a0.push(object);
return a0;
}
return a0;
}
return a0;
}
a0.push(object);
}
return a0;
}
}
}
function updateHasFriends() { // fn#96636, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12791:3111, offset: 0x02162606, size: 48 bytes, params: 1, frame: 11
if (env0_20) {
return RelationshipStore.getFriendCount() > 0 !== result;
}
return false;
}
function sortUserList({user}, {user}) { // fn#96637, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12791:3197, offset: 0x02162636, size: 152 bytes, params: 3, frame: 19
let stripDiacritics = StringUtilsModule.stripDiacritics;
let value = UserUtils;
value = value.getName(user);
value = Reflect.apply(stripDiacritics, StringUtilsModule, [value.toLocaleLowerCase()]);
const localeCompare = value.localeCompare;
stripDiacritics = StringUtilsModule.stripDiacritics;
const name = (UserUtils).getName(user);
return Reflect.apply(localeCompare, value, [Reflect.apply(stripDiacritics, StringUtilsModule,
[name.toLocaleLowerCase()])]);
}
function getMutualGuildsWithCurrentUser(a0, a1) { // fn#96638, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12791:3390, offset: 0x021626ce, size: 177 bytes, params: 3, frame: 22
var r3;
var value5;
var includes;
var guildMemberStoreBinding;
var isMember;
var guild;
var value7;
const RestrictedGuildIds = (UserSettingsModule).RestrictedGuildIds;
const setting = RestrictedGuildIds.getSetting();
const items2 = [];
const value3 = _createForOfIteratorHelperLoose_96620(a1);
const value4 = value3();
let done = value4.done;
if (!done) {
r3 = value4;
while (true) {
value5 = r3.value;
includes = setting.includes;
if (!Reflect.apply(includes, setting, [value5])) {
guildMemberStoreBinding = GuildMemberStore;
isMember = guildMemberStoreBinding.isMember;
if (Reflect.apply(isMember, guildMemberStoreBinding, [value5, a0])) {
guild = GuildStore.getGuild(value5);
if (guild == null) {
break;
}
items2.push(guild);
break;
}
break;
}
value7 = value3();
done = value7.done;
if (done) {
break;
}
r3 = value7;
continue;
}
}
return items2;
}
function parseUserResults_96639({results}) { // fn#96639, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12791:3646, offset: 0x0216277f, size: 565 bytes, params: 2, frame: 30
var r9;
var r6;
var userStoreBinding;
var getCurrentUser;
var value2;
var moduleValue;
var getFrictionlessGDMsEnabled;
var value3;
var value4;
var Set;
var guildStoreBinding;
var getGuildIds;
var value5;
var prototype;
var value6;
var set;
var value7;
var items2;
var value8;
var value9;
var done;
var value10;
var id;
var comparator;
var id2;
var getUser;
var value11;
var isProvisional;
var bot;
var isStaff;
var object;
var relationshipStoreBinding;
var isFriend;
var getMutualGuildsWithCurrentUserBinding;
var mutualGuildsWithCurrentUserBinding;
var length;
var push;
var value13;
var binding;
var emitChange;
reducibleJoin25: while (true) {
if (env0_20) {
if (env0_21 === '') {
break reducibleJoin25;
}
userStoreBinding = UserStore;
getCurrentUser = userStoreBinding.getCurrentUser;
value2 = Reflect.apply(getCurrentUser, userStoreBinding, []);
moduleValue = require(12602) /* metro dependency 12602: FrictionlessGDMsExperiment */;
getFrictionlessGDMsEnabled = moduleValue.getFrictionlessGDMsEnabled;
value3 = Reflect.apply(getFrictionlessGDMsEnabled, moduleValue, ['PrivateChannelRecipientsInviteStore']);
value4 = null;
reducibleJoin4: while (true) {
if (value3) {
Set = global.Set;
guildStoreBinding = GuildStore;
getGuildIds = guildStoreBinding.getGuildIds;
value5 = Reflect.apply(getGuildIds, guildStoreBinding, []);
prototype = Set.prototype;
value6 = Object.create(prototype, {constructor: {value: Set}});
set = new Set();
value7 = set instanceof Object ? set : value6;
r9 = value7;
break reducibleJoin4;
}
r9 = value4;
break reducibleJoin4;
}
items2 = [];
value8 = _createForOfIteratorHelperLoose_96620(results);
value9 = value8();
done = value9.done;
if (!done) {
r6 = value9;
reducibleLoop5: while (true) {
value10 = r6.value;
id = value10.id;
comparator = value10.comparator;
reducibleJoin23: while (true) {
reducibleJoin7: while (true) {
if (value4 == value2) {
break reducibleJoin7;
}
id2 = value2.id;
if (id === id2) {
break reducibleJoin23;
}
break reducibleJoin7;
}
userStoreBinding = UserStore;
getUser = userStoreBinding.getUser;
value11 = Reflect.apply(getUser, userStoreBinding, [id]);
if (value4 == value11) {
break reducibleJoin23;
}
isProvisional = value11.isProvisional;
if (isProvisional) {
break reducibleJoin23;
}
bot = value11.bot;
if (bot) {
isStaff = value11.isStaff;
if (!Reflect.apply(isStaff, value11, [])) {
break reducibleJoin23;
}
if (value4 == value2) {
break reducibleJoin23;
}
isStaff = value2.isStaff;
if (!Reflect.apply(isStaff, value2, [])) {
break reducibleJoin23;
}
}
object = {user: value11, comparator: comparator};
if (value3) {
if (value4 != r9) {
relationshipStoreBinding = RelationshipStore;
isFriend = relationshipStoreBinding.isFriend;
id = value11.id;
if (!Reflect.apply(isFriend, relationshipStoreBinding, [id])) {
getMutualGuildsWithCurrentUserBinding = getMutualGuildsWithCurrentUser;
id = value11.id;
mutualGuildsWithCurrentUserBinding = getMutualGuildsWithCurrentUserBinding(id, r9);
length = mutualGuildsWithCurrentUserBinding.length;
if (length === 0) {
isStaff = value11.isStaff;
if (!Reflect.apply(isStaff, value11, [])) {
break reducibleJoin23;
}
if (value4 == value2) {
break reducibleJoin23;
}
isStaff = value2.isStaff;
if (!Reflect.apply(isStaff, value2, [])) {
break reducibleJoin23;
}
}
length = mutualGuildsWithCurrentUserBinding.length;
reducibleJoin22: while (true) {
if (length > 0) {
object.mutualGuilds = mutualGuildsWithCurrentUserBinding;
break reducibleJoin22;
}
break reducibleJoin22;
}
}
}
}
push = items2.push;
Reflect.apply(push, items2, [object]);
break reducibleJoin23;
}
value13 = value8();
done = value13.done;
if (done) {
break reducibleLoop5;
}
r6 = value13;
continue reducibleLoop5;
}
}
env0_23 = items2;
binding = env0_28;
emitChange = binding.emitChange;
Reflect.apply(emitChange, binding, []);
break reducibleJoin25;
}
break reducibleJoin25;
}
}
function getUserBoosterMap() { // fn#96640, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12791:4285, offset: 0x021629b4, size: 121 bytes, params: 1, frame: 17
let value = FrecencyStore.getFrequentlyWithoutFetchingLatest();
value = value.filter(_fun96641);
const Math = global.Math;
const max = Math.max;
const value2 = value.map(function({id}) {
return FrecencyStore.getScoreWithoutFetchingLatest(id);
});
const items2 = [];
arraySpread(items2, value2, 0, undefined);
const env0_0 = apply(max, items2, Math, undefined);
value.forEach(_fun96643);
return {};
function _fun96641(a0) { // fn#96641, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12791:4367, offset: 0x02162a2d, size: 29 bytes, params: 2, frame: 10
const value = environment.__proto__;
return a0 instanceof PrivateChannelRecord && a0.isDM();
}
function _fun96643(a0) { // fn#96643, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12791:4489, offset: 0x02162a66, size: 140 bytes, params: 2, frame: 14
const value = environment.__proto__;
const scoreWithoutFetchingLatest = FrecencyStore.getScoreWithoutFetchingLatest(a0.id);
const recipientId = a0.getRecipientId();
const isFriend2 = RelationshipStore.isFriend(recipientId);
const value4 = 0;
env0_1[recipientId] = 1 + scoreWithoutFetchingLatest / env0_0 + (isFriend2 ? 0.2 : value4) + (ChannelStore.getDMFromUserId(recipientId) != null ? 0.1 : value4);
}
}
function createSearchContext() { // fn#96644, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12791:4633, offset: 0x02162af2, size: 77 bytes, params: 1, frame: 13
if (env0_19 != null) {
env0_19.destroy();
}
return (UserSearchManager).getUserSearchContext(parseUserResults_96639,
1000);
}
function PRIVATE_CHANNEL_RECIPIENTS_INVITE_CLOSE() { // fn#96647, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12791:4955, offset: 0x02162baa, size: 43 bytes, params: 1, frame: 11
if (env0_19 != null) {
env0_19.destroy();
}
reset_96623();
}
function performQueryOnAffinityChange() { // fn#96648, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12791:5016, offset: 0x02162bd5, size: 73 bytes, params: 1, frame: 13
var r2;
var moduleValue;
const binding = env0_20;
if (binding) {
moduleValue = require(12602) /* metro dependency 12602: FrictionlessGDMsExperiment */;
r2 = !moduleValue.getFrictionlessGDMsEnabled('PrivateChannelRecipientsInviteStore');
} else {
r2 = !binding;
}
return !r2 && performQuery();
}
function _fun96649(a0) { // fn#96649, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12791:5168, offset: 0x02162c1e, size: 201 bytes, params: 2, frame: 16
const PrivateChannelRecipientsInviteStoreClass2 = PrivateChannelRecipientsInviteStoreClass;
Inherits(PrivateChannelRecipientsInviteStoreClass2, a0);
return CreateClass(PrivateChannelRecipientsInviteStoreClass2, [{key: 'initialize', value: value_96651},
{key: 'getResults', value: value_96652}, {key: 'hasFriends', value: value_96653}, {key: 'getSelectedUsers',
value: value_96654}, {key: 'getQuery', value: value_96655}, {key: 'getState', value: value_96656}]);
function PrivateChannelRecipientsInviteStoreClass() { // fn#96650, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12791:5180, offset: 0x0111e3cd, size: 113 bytes, params: 1, frame: 20
const value = environment.__proto__;
env1_3(this, PrivateChannelRecipientsInviteStoreClass);
const value3 = env1_6(PrivateChannelRecipientsInviteStoreClass);
return env1_5(this, _isNativeReflectConstruct_96617() ? global.Reflect.construct(value3, arguments,
env1_6(this).constructor) : value3.apply(this, arguments));
}
function value_96651() { // fn#96651, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12791:5598, offset: 0x02162ce7, size: 151 bytes, params: 1, frame: 28
this.waitFor(ChannelStore, ConsentStore, ExperimentStore, FrecencyStore, GuildMemberStore, GuildStore,
RelationshipStore, UserAffinitiesV2Store, UserStore);
this.syncWith([UserStore, ChannelStore], performQuery);
this.syncWith([UserAffinitiesV2Store], performQueryOnAffinityChange);
this.syncWith([RelationshipStore], updateHasFriends);
}
function value_96652() { // fn#96652, offset: 0x00df3ac4, size: 9 bytes, params: 1, frame: 1
return env1_23;
}
function value_96653() { // fn#96653, offset: 0x00df3acd, size: 9 bytes, params: 1, frame: 1
return env1_24;
}
function value_96654() { // fn#96654, offset: 0x00df3adf, size: 9 bytes, params: 1, frame: 1
return env1_26;
}
function value_96655() { // fn#96655, offset: 0x00f854d6, size: 9 bytes, params: 1, frame: 1
return env1_21;
}
function value_96656() { // fn#96656, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12791:5971, offset: 0x02162d7e, size: 65 bytes, params: 1, frame: 3
return {query: env1_21, selectedRow: env1_22, selectedUsers: env1_26, results: env1_23, hasFriends: env1_24,
isLoading: env1_25};
}
}
function GUILD_MEMBERS_CHUNK_BATCH_96658() { // fn#96658, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12791:6241, offset: 0x02162dce, size: 76 bytes, params: 1, frame: 13
var r2;
var moduleValue;
const binding = env0_20;
if (binding) {
moduleValue = require(12602) /* metro dependency 12602: FrictionlessGDMsExperiment */;
r2 = !moduleValue.getFrictionlessGDMsEnabled('PrivateChannelRecipientsInviteStore');
} else {
r2 = !binding;
}
return !r2 && setLoading(false);
}
function GUILD_MEMBERS_REQUEST_96659({query}) { // fn#96659, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12791:6410, offset: 0x02162e1a, size: 109 bytes, params: 2, frame: 14
var r1;
var moduleValue;
const binding = env0_20;
if (binding) {
moduleValue = require(12602) /* metro dependency 12602: FrictionlessGDMsExperiment */;
r1 = !moduleValue.getFrictionlessGDMsEnabled('PrivateChannelRecipientsInviteStore');
} else {
r1 = !binding;
}
return !r1 && (query === env0_21.toLocaleLowerCase() && setLoading(true));
}
function CHANNEL_SELECT_96660({guildId, channelId}) { // fn#96660, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12791:6607, offset: 0x02162e87, size: 58 bytes, params: 2, frame: 12
if (guildId != null) {
return false;
}
reset_96623();
return performQuery();
}
function PRIVATE_CHANNEL_RECIPIENTS_ADD_USER({userId}) { // fn#96664, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12791:7293, offset: 0x02162f31, size: 65 bytes, params: 2, frame: 12
env0_26.add(userId);
const Set = global.Set;
const set = new Set(env0_26);
}
function PRIVATE_CHANNEL_RECIPIENTS_REMOVE_USER({userId}) { // fn#96665, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12791:7390, offset: 0x02162f72, size: 65 bytes, params: 2, frame: 12
env0_26.delete(userId);
const Set = global.Set;
const set = new Set(env0_26);
}
}
global.__d(_fun96616, 12601, [6, 7, 15, 17, 18, 4107, 5221, 1383, 1379, 5078, 6586, 1945, 1867, 3793, 1878, 661,
12602, 6592, 1861, 3995, 3829, 7238, 566, 694,
2]) /* metro module 12601, dependencies: [6, 7, 15, 17, 18, 4107, 5221, 1383, 1379, 5078, 6586, 1945, 1867, 3793, 1878, 661, 12602, 6592, 1861, 3995, 3829, 7238, 566, 694, 2] */;