855 lines
40 KiB
TypeScript
855 lines
40 KiB
TypeScript
/* Metro module 5105; source: modules/guild_onboarding/GuildOnboardingUtils.tsx; dependencies: [1379, 5040, 1935, 1867, 3784, 5106, 661, 3772, 566, 1391, 5107, 5108, 3789, 1360, 628, 1861, 5109, 2] */
|
|
import ChannelStore from '../../stores/ChannelStore.tsx'; /* Metro dependency 1379 */
|
|
import GuildStore from '../../stores/GuildStore.tsx'; /* Metro dependency 1867 */
|
|
import GuildChannelStore from '../../stores/GuildChannelStore.tsx'; /* Metro dependency 1935 */
|
|
import PermissionStore from '../../stores/PermissionStore.tsx'; /* Metro dependency 3784 */
|
|
import ConnectedAccountsStore from '../../stores/ConnectedAccountsStore.tsx'; /* Metro dependency 5040 */
|
|
import * as FileImportTrackerModule from '../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
|
|
import * as FluxModule from '../../external/discord_common/js/packages/flux/index.tsx'; /* Metro dependency 566 */
|
|
import * as ConstantsModule from '../../Constants.tsx'; /* Metro dependency 661 */
|
|
import * as StringUtilsModule from '../../utils/StringUtils.tsx'; /* Metro dependency 1861 */
|
|
import * as GuildChannelStoreModule from '../../stores/GuildChannelStore.tsx'; /* Metro dependency 1935 */
|
|
import * as GuildMemberConstantsModule from '../guild_member/GuildMemberConstants.tsx'; /* Metro dependency 3772 */
|
|
import * as GuildOnboardingPromptsConstantsModule from './GuildOnboardingPromptsConstants.tsx'; /* Metro dependency 5106 */
|
|
import * as AuthorizedAppsStoreModule from '../../stores/AuthorizedAppsStore.tsx'; /* Metro dependency 5109 */
|
|
|
|
function _fun44554(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#44554, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5283:6, offset: 0x01173aa3, size: 556 bytes, params: 8, frame: 21
|
|
let env0_0 = require;
|
|
const _arrayLikeToArray_44557 = 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 isChattableChannel2 = isChattableChannel;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
const Date = global.Date;
|
|
const date = new Date(1682488800000);
|
|
(FileImportTrackerModule).fileFinishedImporting('modules/guild_onboarding/GuildOnboardingUtils.tsx');
|
|
exports.ONBOARDING_EPOCH = date;
|
|
exports.useGuildOnboardingSettingsAvailable = function(a0) {
|
|
var env0_0 = a0;
|
|
return require(dependencyMap[8]).useStateFromStores([GuildStore, PermissionStore], _fun44572);
|
|
};
|
|
exports.isGuildOnboardingSettingsAvailable = isGuildOnboardingSettingsAvailable;
|
|
exports.isBlockedByOnboarding = isBlockedByOnboarding;
|
|
exports.showRulesInOnboarding = showRulesInOnboarding;
|
|
exports.getChannelCoverageForOnboarding = getChannelCoverageForOnboarding;
|
|
exports.useChannelCoverageForOnboarding = useChannelCoverageForOnboarding;
|
|
exports.isChattableChannelId = isChattableChannelId;
|
|
exports.isChattableChannel = isChattableChannel2;
|
|
exports.useIsChattableChannel = function(a0) {
|
|
var env0_0 = a0;
|
|
return require(dependencyMap[8]).useStateFromStores([ChannelStore], _fun44583);
|
|
};
|
|
exports.getMinimumSetOfDefaultChannelIds = getMinimumSetOfDefaultChannelIds;
|
|
exports.getChattableDefaultChannels = getChattableDefaultChannels;
|
|
exports.useChattableDefaultChannels = function(a0, a1) {
|
|
var env0_0 = a0;
|
|
var env0_1 = a1;
|
|
return require(dependencyMap[8]).useStateFromStores([GuildChannelStore], _fun44597, [a0, a1],
|
|
areStatesEqual_44570);
|
|
};
|
|
exports.getSelectedRoleIds = function(a0) {
|
|
var Set = global.Set;
|
|
var value = a0.map(_fun44599);
|
|
value = value.flat();
|
|
value = value.filter(require(dependencyMap[13]).isNotNullish);
|
|
var value3 = Object.create(Set.prototype, {constructor: {value: Set}});
|
|
value = new Set(value);
|
|
return value instanceof Object ? value : value3;
|
|
};
|
|
exports.getSelectedChannelIds = function(a0) {
|
|
var Set = global.Set;
|
|
var value = a0.map(_fun44601);
|
|
value = value.flat();
|
|
value = value.filter(require(dependencyMap[13]).isNotNullish);
|
|
var value3 = Object.create(Set.prototype, {constructor: {value: Set}});
|
|
value = new Set(value);
|
|
return value instanceof Object ? value : value3;
|
|
};
|
|
exports.getProviderConnectionState = function(a0) {
|
|
a0.filter(_fun44603).forEach(_fun44604);
|
|
return {connected: [], notConnected: []};
|
|
};
|
|
exports.getApplicationConnectionState = function(a0) {
|
|
var value = a0.filter(_fun44606);
|
|
var env0_2 = require(dependencyMap[16]).default;
|
|
var env0_3 = require(dependencyMap[16]).FetchState;
|
|
value.forEach(_fun44607);
|
|
return {connected: [], notConnected: []};
|
|
};
|
|
function _createForOfIteratorHelperLoose_44555(a0, a1) { // fn#44555, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5283:300, offset: 0x01173ccf, 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 _fun44556;
|
|
}
|
|
value = undefined;
|
|
if (a0) {
|
|
if (typeof a0 === 'string') {
|
|
value = _arrayLikeToArray_44557(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_44557(a0, value);
|
|
r6 = value;
|
|
} else {
|
|
regexp = RegExp('^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$', '');
|
|
if (regexp.test(r9)) {
|
|
value = _arrayLikeToArray_44557(a0, value);
|
|
r6 = value;
|
|
} else {
|
|
r6 = value;
|
|
}
|
|
}
|
|
r5 = r6;
|
|
}
|
|
} else {
|
|
r5 = value;
|
|
}
|
|
if (r5) {
|
|
if (r5) {
|
|
}
|
|
return _fun44556;
|
|
}
|
|
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 _fun44556() { // fn#44556, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5283:871, 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 getChannelCoverage(a0, a1, a2) { // fn#44558, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5283:1237, offset: 0x01173e41, size: 132 bytes, params: 4, frame: 14
|
|
const Set = global.Set;
|
|
let set = new Set();
|
|
a0.forEach(function({options}) {
|
|
options.forEach(_fun44560);
|
|
});
|
|
a1.forEach(_fun44562);
|
|
set = a2.filter(_fun44563);
|
|
const items2 = [set.filter(_fun44564)];
|
|
items2[1] = set.filter(_fun44565);
|
|
return items2;
|
|
function _fun44559({options}) { // fn#44559, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5283:1297, offset: 0x01173ec5, size: 29 bytes, params: 2, frame: 11
|
|
options.forEach(function(a0) {
|
|
var r1;
|
|
var r3;
|
|
var channelIds;
|
|
var value = a0 == null;
|
|
var value2 = undefined;
|
|
if (value) {
|
|
r1 = value;
|
|
r3 = value2;
|
|
} else {
|
|
channelIds = a0.channelIds;
|
|
r1 = channelIds == null;
|
|
r3 = channelIds;
|
|
}
|
|
if (!r1) {
|
|
r3.forEach(_fun44561);
|
|
}
|
|
return value2;
|
|
});
|
|
function _fun44560(a0) { // fn#44560, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5283:1320, offset: 0x01173ee2, size: 51 bytes, params: 2, frame: 14
|
|
var r1;
|
|
var r3;
|
|
var channelIds;
|
|
const value = a0 == null;
|
|
const value2 = undefined;
|
|
if (value) {
|
|
r1 = value;
|
|
r3 = value2;
|
|
} else {
|
|
channelIds = a0.channelIds;
|
|
r1 = channelIds == null;
|
|
r3 = channelIds;
|
|
}
|
|
if (!r1) {
|
|
r3.forEach(_fun44561);
|
|
}
|
|
return value2;
|
|
function _fun44561(a0) { // fn#44561, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5283:1374, offset: 0x01173f15, size: 24 bytes, params: 2, frame: 11
|
|
env2_0.add(a0);
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
function _fun44562(a0) { // fn#44562, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5283:1407, offset: 0x00c37e1f, size: 22 bytes, params: 2, frame: 11
|
|
return env0_0.add(a0);
|
|
}
|
|
|
|
function _fun44563(a0) { // fn#44563, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5283:1437, offset: 0x01173f2d, size: 70 bytes, params: 2, frame: 13
|
|
let value = a0.isCategory();
|
|
let r0 = !value && !a0.isThread();
|
|
if (r0) {
|
|
value = environment.__proto__;
|
|
value = !(importDefault(5107) /* metro dependency 5107: isRoleRequired */)(a0);
|
|
r0 = value;
|
|
}
|
|
return r0;
|
|
}
|
|
|
|
function _fun44564(a0) { // fn#44564, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5283:1504, offset: 0x01173f73, size: 68 bytes, params: 2, frame: 13
|
|
const binding = env0_0;
|
|
return binding.has(a0.id) || a0.parent_id != null && env0_0.has(a0.parent_id);
|
|
}
|
|
|
|
function _fun44565(a0) { // fn#44565, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5283:1570, offset: 0x01173fb7, size: 71 bytes, params: 2, frame: 13
|
|
const binding = env0_0;
|
|
return !(binding.has(a0.id) || a0.parent_id != null && env0_0.has(a0.parent_id));
|
|
}
|
|
|
|
}
|
|
|
|
function isChattableChannel(a0) { // fn#44566, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5283:1630, offset: 0x01173ffe, size: 148 bytes, params: 2, frame: 18
|
|
var r1;
|
|
var r0;
|
|
var moduleValue;
|
|
var canChannelBeDefault2;
|
|
var isForumChannel2;
|
|
var moduleValue2;
|
|
var canEveryoneRole;
|
|
const value = a0 != null;
|
|
if (value) {
|
|
moduleValue = require(5108) /* metro dependency 5108: DefaultChannelUtils */;
|
|
canChannelBeDefault2 = moduleValue.canChannelBeDefault(a0.guild_id, a0.id);
|
|
if (canChannelBeDefault2) {
|
|
isForumChannel2 = a0.isForumChannel();
|
|
moduleValue2 = importAll(3789) /* metro dependency 3789: PermissionUtils */;
|
|
canEveryoneRole = moduleValue2.canEveryoneRole;
|
|
r1 = isForumChannel2 ? Reflect.apply(canEveryoneRole, moduleValue2, [Permissions.SEND_MESSAGES_IN_THREADS,
|
|
a0]) : Reflect.apply(canEveryoneRole, moduleValue2, [Permissions.SEND_MESSAGES, a0]);
|
|
} else {
|
|
r1 = !!canChannelBeDefault2;
|
|
}
|
|
r0 = r1;
|
|
} else {
|
|
r0 = value;
|
|
}
|
|
return r0;
|
|
}
|
|
|
|
function getFlattenedDefaultChannels(a0, a1) { // fn#44567, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5283:1851, offset: 0x01174092, size: 287 bytes, params: 3, frame: 25
|
|
var r10;
|
|
var r9;
|
|
var r3;
|
|
var closure;
|
|
var value6;
|
|
var channel;
|
|
var moduleValue;
|
|
var canChannelBeDefault;
|
|
var guild_id;
|
|
var id;
|
|
var includes;
|
|
var isCategory;
|
|
var isThread;
|
|
var parent_id;
|
|
var value7;
|
|
var push;
|
|
var value8;
|
|
const value = a2;
|
|
const value2 = a3;
|
|
reducibleJoin2: while (true) {
|
|
if (value !== undefined) {
|
|
r10 = value;
|
|
break reducibleJoin2;
|
|
}
|
|
closure = function(a0) {
|
|
return a0;
|
|
};
|
|
r10 = closure;
|
|
break reducibleJoin2;
|
|
}
|
|
reducibleJoin4: while (true) {
|
|
if (value2 !== undefined) {
|
|
r9 = value2;
|
|
break reducibleJoin4;
|
|
}
|
|
closure = function() {
|
|
return true;
|
|
};
|
|
r9 = closure;
|
|
break reducibleJoin4;
|
|
}
|
|
const items2 = [];
|
|
const value4 = _createForOfIteratorHelperLoose_44555(GuildChannelStore.getChannels(a0)[GUILD_SELECTABLE_CHANNELS_KEY]);
|
|
const value5 = value4();
|
|
let done = value5.done;
|
|
if (!done) {
|
|
r3 = value5;
|
|
reducibleLoop5: while (true) {
|
|
value6 = r3.value;
|
|
channel = value6.channel;
|
|
moduleValue = require(5108) /* metro dependency 5108: DefaultChannelUtils */;
|
|
canChannelBeDefault = moduleValue.canChannelBeDefault;
|
|
guild_id = channel.guild_id;
|
|
id = channel.id;
|
|
reducibleJoin13: while (true) {
|
|
if (Reflect.apply(canChannelBeDefault, moduleValue, [guild_id, id])) {
|
|
includes = a1.includes;
|
|
id = channel.id;
|
|
if (Reflect.apply(includes, a1, [id])) {
|
|
isCategory = channel.isCategory;
|
|
if (!Reflect.apply(isCategory, channel, [])) {
|
|
value7 = r10(channel);
|
|
if (r9(value7)) {
|
|
push = items2.push;
|
|
Reflect.apply(push, items2, [value7]);
|
|
break reducibleJoin13;
|
|
}
|
|
break reducibleJoin13;
|
|
}
|
|
}
|
|
isThread = channel.isThread;
|
|
if (Reflect.apply(isThread, channel, [])) {
|
|
break reducibleJoin13;
|
|
}
|
|
parent_id = channel.parent_id;
|
|
if (parent_id == null) {
|
|
break reducibleJoin13;
|
|
}
|
|
includes = a1.includes;
|
|
parent_id = channel.parent_id;
|
|
if (Reflect.apply(includes, a1, [parent_id])) {
|
|
value7 = r10(channel);
|
|
if (r9(value7)) {
|
|
push = items2.push;
|
|
Reflect.apply(push, items2, [value7]);
|
|
break reducibleJoin13;
|
|
}
|
|
break reducibleJoin13;
|
|
}
|
|
break reducibleJoin13;
|
|
}
|
|
break reducibleJoin13;
|
|
}
|
|
value8 = value4();
|
|
done = value8.done;
|
|
if (done) {
|
|
break reducibleLoop5;
|
|
}
|
|
r3 = value8;
|
|
continue reducibleLoop5;
|
|
}
|
|
}
|
|
return items2;
|
|
}
|
|
|
|
function areStatesEqual_44570(a0, a1) { // fn#44570, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5283:2201, offset: 0x011741b1, size: 142 bytes, params: 3, frame: 18
|
|
var r1;
|
|
var value2;
|
|
let value = a0[0].length === a1[0].length;
|
|
let r0 = value && a0[1].length === a1[1].length;
|
|
if (r0) {
|
|
value2 = (importDefault(628) /* metro dependency 628: shallowEqual */)(a0[0], a1[0]);
|
|
if (value2) {
|
|
value = importDefault(628) /* metro dependency 628: shallowEqual */;
|
|
value = value(a0[1], a1[1]);
|
|
r1 = value;
|
|
} else {
|
|
r1 = value2;
|
|
}
|
|
r0 = r1;
|
|
}
|
|
return r0;
|
|
}
|
|
|
|
function useGuildOnboardingSettingsAvailable(a0) { // fn#44571, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5283:2480, offset: 0x0117423f, size: 72 bytes, params: 2, frame: 15
|
|
const env0_0 = a0;
|
|
return (FluxModule).useStateFromStores([GuildStore, PermissionStore], _fun44572);
|
|
function _fun44572() { // fn#44572, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5283:2570, offset: 0x01174287, size: 128 bytes, params: 1, frame: 16
|
|
const value = environment.__proto__;
|
|
const guild = GuildStore.getGuild(env0_0);
|
|
const r3 = guild == null || !guild.features.has(GuildFeatures.COMMUNITY);
|
|
const value6 = !r3;
|
|
const permissionStoreBinding = PermissionStore;
|
|
let can = permissionStoreBinding.can;
|
|
const MANAGE_GUILD = Permissions.MANAGE_GUILD;
|
|
const value7 = Reflect.apply(can, permissionStoreBinding, [MANAGE_GUILD, guild]);
|
|
can = permissionStoreBinding.can;
|
|
const MANAGE_ROLES = Permissions.MANAGE_ROLES;
|
|
return (r3 ? value6 : value7) && Reflect.apply(can, permissionStoreBinding, [MANAGE_ROLES, guild]);
|
|
}
|
|
|
|
}
|
|
|
|
function isGuildOnboardingSettingsAvailable(a0) { // fn#44573, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5283:2747, offset: 0x01174307, size: 124 bytes, params: 2, frame: 16
|
|
const guild = GuildStore.getGuild(a0);
|
|
const r3 = guild == null || !guild.features.has(GuildFeatures.COMMUNITY);
|
|
const value5 = !r3;
|
|
const permissionStoreBinding = PermissionStore;
|
|
let can = permissionStoreBinding.can;
|
|
const MANAGE_GUILD = Permissions.MANAGE_GUILD;
|
|
const value6 = Reflect.apply(can, permissionStoreBinding, [MANAGE_GUILD, guild]);
|
|
can = permissionStoreBinding.can;
|
|
const MANAGE_ROLES = Permissions.MANAGE_ROLES;
|
|
return (r3 ? value5 : value6) && Reflect.apply(can, permissionStoreBinding, [MANAGE_ROLES, guild]);
|
|
}
|
|
|
|
function isBlockedByOnboarding(a0, a1) { // fn#44574, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5283:2950, offset: 0x01174383, size: 235 bytes, params: 3, frame: 16
|
|
var r2;
|
|
var r0;
|
|
var joinedAt;
|
|
var Date;
|
|
var value2;
|
|
var date;
|
|
var moduleValue;
|
|
var hasFlag2;
|
|
var moduleValue2;
|
|
if (a0 != null) {
|
|
var features = a0.features;
|
|
var has = features.has;
|
|
var value;
|
|
var GUILD_ONBOARDING = GuildFeatures.GUILD_ONBOARDING;
|
|
if (Reflect.apply(has, features, [GUILD_ONBOARDING])) {
|
|
if (a1 == null) {
|
|
return false;
|
|
}
|
|
joinedAt = a1.joinedAt;
|
|
if (joinedAt == null) {
|
|
return false;
|
|
}
|
|
Date = global.Date;
|
|
joinedAt = a1.joinedAt;
|
|
value2 = Object.create(Date.prototype, {constructor: {value: Date}});
|
|
date = new Date();
|
|
if ((date instanceof Object ? date : value2) < env0_14) {
|
|
return false;
|
|
}
|
|
r2 = a1.flags ?? 0;
|
|
moduleValue = importAll(1391) /* metro dependency 1391: FlagUtils */;
|
|
hasFlag2 = moduleValue.hasFlag(r2, GuildMemberFlags.STARTED_ONBOARDING);
|
|
if (hasFlag2) {
|
|
moduleValue2 = importAll(1391) /* metro dependency 1391: FlagUtils */;
|
|
r0 = !moduleValue2.hasFlag(r2, GuildMemberFlags.COMPLETED_ONBOARDING);
|
|
} else {
|
|
r0 = hasFlag2;
|
|
}
|
|
return r0;
|
|
}
|
|
}
|
|
return false;
|
|
}
|
|
|
|
function showRulesInOnboarding(a0, a1) { // fn#44575, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5283:3269, offset: 0x0117446e, size: 88 bytes, params: 3, frame: 14
|
|
let r0 = a0 != null && a0.features.has(GuildFeatures.MEMBER_VERIFICATION_MANUAL_APPROVAL) && a0.features.has(GuildFeatures.MEMBER_VERIFICATION_GATE_ENABLED);
|
|
r0 = !r0 && a1 != null;
|
|
return r0;
|
|
}
|
|
|
|
function getChannelCoverageForOnboarding(a0, a1, a2) { // fn#44576, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5283:3474, offset: 0x011744c6, size: 67 bytes, params: 4, frame: 15
|
|
return getChannelCoverage(a1, a2,
|
|
GuildChannelStore.getChannels(a0)[GUILD_SELECTABLE_CHANNELS_KEY].map(function(a0) {
|
|
return a0.channel;
|
|
}));
|
|
}
|
|
|
|
function useChannelCoverageForOnboarding(a0, a1, a2) { // fn#44578, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5283:3633, offset: 0x01174513, size: 104 bytes, params: 4, frame: 18
|
|
const env0_0 = a0;
|
|
const getChannelCoverageBinding = getChannelCoverage;
|
|
const useStateFromStores = FluxModule.useStateFromStores;
|
|
return getChannelCoverageBinding(a1, a2, Reflect.apply(useStateFromStores, FluxModule, [[GuildChannelStore],
|
|
_fun44579])[GUILD_SELECTABLE_CHANNELS_KEY].map(function(a0) {
|
|
return a0.channel;
|
|
}));
|
|
function _fun44579() { // fn#44579, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5283:3744, offset: 0x0117457b, size: 27 bytes, params: 1, frame: 11
|
|
return GuildChannelStore.getChannels(env0_0);
|
|
}
|
|
|
|
}
|
|
|
|
function isChattableChannelId(a0) { // fn#44581, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5283:3820, offset: 0x01174596, size: 33 bytes, params: 2, frame: 12
|
|
return isChattableChannel(ChannelStore.getChannel(a0));
|
|
}
|
|
|
|
function useIsChattableChannel(a0) { // fn#44582, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5283:3963, offset: 0x011745b7, size: 64 bytes, params: 2, frame: 14
|
|
const env0_0 = a0;
|
|
return (FluxModule).useStateFromStores([ChannelStore], _fun44583);
|
|
function _fun44583() { // fn#44583, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5283:4037, offset: 0x011745f7, size: 71 bytes, params: 1, frame: 13
|
|
const value = environment.__proto__;
|
|
const channel = ChannelStore.getChannel(env0_0);
|
|
return (require(1360) /* metro dependency 1360: GlobalUtils */).isNotNullish(channel) && isChattableChannel(channel);
|
|
}
|
|
|
|
}
|
|
|
|
function getMinimumSetOfDefaultChannelIds(a0, a1, a2) { // fn#44584, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5283:4160, offset: 0x0117463e, size: 82 bytes, params: 4, frame: 19
|
|
let value = a3;
|
|
const env0_0 = a0;
|
|
value = getFlattenedDefaultChannels(a0, a1, function(a0) {
|
|
return a0.id;
|
|
}, value !== undefined ? value : function() {
|
|
return true;
|
|
});
|
|
a2.forEach(_fun44587);
|
|
return value;
|
|
function _fun44587(a0) { // fn#44587, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5283:4287, offset: 0x01174690, size: 139 bytes, params: 2, frame: 21
|
|
var environment;
|
|
var value;
|
|
var getFlattenedDefaultChannelsBinding;
|
|
var binding;
|
|
var options;
|
|
var property;
|
|
var value2;
|
|
var items2;
|
|
var flattenedDefaultChannelsBinding;
|
|
var value5;
|
|
var push;
|
|
if (a0.required) {
|
|
value = environment.__proto__;
|
|
getFlattenedDefaultChannelsBinding = getFlattenedDefaultChannels;
|
|
binding = env0_0;
|
|
options = a0.options;
|
|
property = options[0];
|
|
value2 = property == null;
|
|
flattenedDefaultChannelsBinding = getFlattenedDefaultChannelsBinding(binding,
|
|
(value2 ? undefined : property.channelIds) ?? [], function(a0) {
|
|
return a0.id;
|
|
});
|
|
options = a0.options;
|
|
value5 = options.reduce(_fun44589, flattenedDefaultChannelsBinding);
|
|
binding = env0_2;
|
|
push = binding.push;
|
|
items2 = [];
|
|
arraySpread(items2, value5, 0, value2);
|
|
apply(push, items2, binding, value2);
|
|
}
|
|
function _fun44589(a0, a1) { // fn#44589, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5283:4439, offset: 0x0117471b, size: 81 bytes, params: 3, frame: 18
|
|
const value = a0;
|
|
if (a1.channelIds == null) {
|
|
return [];
|
|
}
|
|
const flattenedDefaultChannels = getFlattenedDefaultChannels(env1_0, a1.channelIds, function(a0) {
|
|
return a0.id;
|
|
}, _fun44591);
|
|
return flattenedDefaultChannels.length < value.length ? flattenedDefaultChannels : value;
|
|
function _fun44591(a0) { // fn#44591, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5283:4538, offset: 0x0117476c, size: 39 bytes, params: 2, frame: 12
|
|
const value = environment.__proto__.__proto__;
|
|
return env2_1(a0) && !env2_2.includes(a0);
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
function getChattableDefaultChannels(a0, a1) { // fn#44592, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5283:4649, offset: 0x01174793, size: 143 bytes, params: 3, frame: 18
|
|
var r5;
|
|
var value5;
|
|
var channel;
|
|
var id;
|
|
var value6;
|
|
const flattenedDefaultChannels = getFlattenedDefaultChannels(a0, a1);
|
|
const object = {};
|
|
let value = _createForOfIteratorHelperLoose_44555(GuildChannelStore.getChannels(a0)[GUILD_SELECTABLE_CHANNELS_KEY]);
|
|
const value4 = value();
|
|
let done = value4.done;
|
|
if (!done) {
|
|
for (r5 = value4; true; r5 = value6) {
|
|
value5 = r5.value;
|
|
channel = value5.channel;
|
|
id = channel.id;
|
|
object[id] = value5;
|
|
value6 = value();
|
|
done = value6.done;
|
|
if (done) {
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
value = flattenedDefaultChannels.map(function(a0) {
|
|
return a0.id;
|
|
});
|
|
value = ((a0, a1) => {
|
|
var env0_0 = a1;
|
|
return a0.filter(_fun44594);
|
|
})(value, object);
|
|
return [value, flattenedDefaultChannels];
|
|
function filterChattableChannels(a0, a1) { // fn#44593, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5283:4851, owner: getChattableDefaultChannels.filterChattableChannels, offset: 0x01174822, size: 29 bytes, params: 3, frame: 11
|
|
const env0_0 = a1;
|
|
return a0.filter(_fun44594);
|
|
function _fun44594(a0) { // fn#44594, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5283:4906, offset: 0x0117483f, size: 46 bytes, params: 2, frame: 13
|
|
const value = environment.__proto__.__proto__;
|
|
return isChattableChannel(require[a0]?.channel);
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
function useChattableDefaultChannels(a0, a1) { // fn#44596, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5283:5038, offset: 0x0117486d, size: 94 bytes, params: 3, frame: 19
|
|
const env0_0 = a0;
|
|
const env0_1 = a1;
|
|
return (FluxModule).useStateFromStores([GuildChannelStore], _fun44597, [a0, a1],
|
|
areStatesEqual_44570);
|
|
function _fun44597() { // fn#44597, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5283:5120, offset: 0x011748cb, size: 350 bytes, params: 1, frame: 26
|
|
var r3;
|
|
var r12;
|
|
var r13;
|
|
var r11;
|
|
var value6;
|
|
var moduleValue;
|
|
var canChannelBeDefault;
|
|
var channel;
|
|
var guild_id;
|
|
var id;
|
|
var canChannelBeDefault2;
|
|
var has;
|
|
var value7;
|
|
var isCategory;
|
|
var value8;
|
|
var isThread2;
|
|
var value9;
|
|
var parent_id;
|
|
var value10;
|
|
var value11;
|
|
var push;
|
|
var isChattableChannelBinding;
|
|
var value12;
|
|
const items3 = [];
|
|
const items2 = [];
|
|
const object = {};
|
|
const value4 = _createForOfIteratorHelperLoose_44555(GuildChannelStore.getChannels(env0_0)[GUILD_SELECTABLE_CHANNELS_KEY]);
|
|
const value5 = value4();
|
|
let done = value5.done;
|
|
if (!done) {
|
|
r3 = value5;
|
|
while (true) {
|
|
value6 = r3.value;
|
|
moduleValue = require(5108) /* metro dependency 5108: DefaultChannelUtils */;
|
|
canChannelBeDefault = moduleValue.canChannelBeDefault;
|
|
channel = value6.channel;
|
|
guild_id = channel.guild_id;
|
|
channel = value6.channel;
|
|
id = channel.id;
|
|
canChannelBeDefault2 = Reflect.apply(canChannelBeDefault, moduleValue, [guild_id, id]);
|
|
if (canChannelBeDefault2) {
|
|
has = require.has;
|
|
channel = value6.channel;
|
|
value7 = Reflect.apply(has, require, [channel.id]);
|
|
if (!value7) {
|
|
r12 = value7;
|
|
continue;
|
|
}
|
|
channel = value6.channel;
|
|
isCategory = channel.isCategory;
|
|
value8 = !Reflect.apply(isCategory, channel, []);
|
|
r12 = value8;
|
|
if (r12) {
|
|
continue;
|
|
}
|
|
channel = value6.channel;
|
|
isThread2 = channel.isThread();
|
|
value9 = !isThread2;
|
|
if (isThread2) {
|
|
r13 = value9;
|
|
continue;
|
|
}
|
|
channel = value6.channel;
|
|
parent_id = channel.parent_id;
|
|
value10 = parent_id != null;
|
|
r13 = value10;
|
|
if (!r13) {
|
|
continue;
|
|
}
|
|
has = require.has;
|
|
channel = value6.channel;
|
|
parent_id = channel.parent_id;
|
|
value11 = Reflect.apply(has, require, [parent_id]);
|
|
r13 = value11;
|
|
r12 = r13;
|
|
r11 = r12;
|
|
} else {
|
|
r11 = canChannelBeDefault2;
|
|
}
|
|
if (!r11) {
|
|
continue;
|
|
}
|
|
channel = value6.channel;
|
|
id = channel.id;
|
|
object[id] = value6;
|
|
push = items3.push;
|
|
channel = value6.channel;
|
|
Reflect.apply(push, items3, [channel]);
|
|
isChattableChannelBinding = isChattableChannel;
|
|
channel = value6.channel;
|
|
if (!isChattableChannelBinding(channel)) {
|
|
continue;
|
|
}
|
|
push = items2.push;
|
|
channel = value6.channel;
|
|
id = channel.id;
|
|
Reflect.apply(push, items2, [id]);
|
|
value12 = value4();
|
|
done = value12.done;
|
|
if (done) {
|
|
break;
|
|
}
|
|
r3 = value12;
|
|
continue;
|
|
}
|
|
}
|
|
return [items2, items3];
|
|
}
|
|
|
|
}
|
|
|
|
function getSelectedRoleIds(a0) { // fn#44598, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5283:5574, offset: 0x01174a29, size: 101 bytes, params: 2, frame: 14
|
|
const Set = global.Set;
|
|
let value = a0.map(function(a0) {
|
|
return a0.roleIds;
|
|
});
|
|
value = value.flat();
|
|
value = value.filter((require(1360) /* metro dependency 1360: GlobalUtils */).isNotNullish);
|
|
const value3 = Object.create(Set.prototype, {constructor: {value: Set}});
|
|
const set = new Set(value);
|
|
return set instanceof Object ? set : value3;
|
|
}
|
|
|
|
function getSelectedChannelIds(a0) { // fn#44600, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5283:5707, offset: 0x01174a99, size: 101 bytes, params: 2, frame: 14
|
|
const Set = global.Set;
|
|
let value = a0.map(function(a0) {
|
|
return a0.channelIds;
|
|
});
|
|
value = value.flat();
|
|
value = value.filter((require(1360) /* metro dependency 1360: GlobalUtils */).isNotNullish);
|
|
const value3 = Object.create(Set.prototype, {constructor: {value: Set}});
|
|
const set = new Set(value);
|
|
return set instanceof Object ? set : value3;
|
|
}
|
|
|
|
function getProviderConnectionState(a0) { // fn#44602, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5283:5851, offset: 0x01174b09, size: 65 bytes, params: 2, frame: 13
|
|
a0.filter(_fun44603).forEach(_fun44604);
|
|
return {connected: [], notConnected: []};
|
|
function _fun44603(a0) { // fn#44603, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5283:5906, offset: 0x01174b4a, size: 37 bytes, params: 2, frame: 3
|
|
const connection_type = a0.connection_type;
|
|
const value = environment.__proto__;
|
|
const PROVIDER_CONNECTED_ACCOUNT = OnboardingConnectionType.PROVIDER_CONNECTED_ACCOUNT;
|
|
return connection_type === PROVIDER_CONNECTED_ACCOUNT && a0.provider_id;
|
|
}
|
|
|
|
function _fun44604({provider_id}) { // fn#44604, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5283:6003, offset: 0x01174b6f, size: 117 bytes, params: 2, frame: 14
|
|
let value = environment.__proto__;
|
|
if (!StringUtilsModule.isNullOrEmpty(provider_id)) {
|
|
value = ConnectedAccountsStore.getAccount(null, provider_id);
|
|
if (value == null) {
|
|
env0_1.push(provider_id);
|
|
} else if (value.revoked) {
|
|
env0_1.push(provider_id);
|
|
} else {
|
|
env0_0.push(provider_id);
|
|
}
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
function getApplicationConnectionState(a0) { // fn#44605, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5283:6192, offset: 0x01174be4, size: 118 bytes, params: 2, frame: 17
|
|
const value = a0.filter(_fun44606);
|
|
value.forEach(_fun44607);
|
|
return {connected: [], notConnected: []};
|
|
function _fun44606(a0) { // fn#44606, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5283:6250, offset: 0x01174c5a, size: 37 bytes, params: 2, frame: 3
|
|
const connection_type = a0.connection_type;
|
|
const value = environment.__proto__;
|
|
const APPLICATION = OnboardingConnectionType.APPLICATION;
|
|
return connection_type === APPLICATION && a0.application_id;
|
|
}
|
|
|
|
function _fun44607({application_id}) { // fn#44607, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5283:6378, offset: 0x01174c7f, size: 129 bytes, params: 2, frame: 14
|
|
var binding;
|
|
let value = environment.__proto__;
|
|
value = require(1861) /* metro dependency 1861: StringUtils */;
|
|
if (!value.isNullOrEmpty(application_id)) {
|
|
binding = AuthorizedAppsStoreModule.default;
|
|
if (binding.getFetchStateForApplication(application_id) !== FetchState.FETCHED) {
|
|
env0_1.push(application_id);
|
|
} else if (binding.getNewestTokenForApplication(application_id) != null) {
|
|
env0_0.push(application_id);
|
|
} else {
|
|
env0_1.push(application_id);
|
|
}
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
function _fun44599(a0) { // fn#44599, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5283:5627, offset: 0x01174a8e, size: 11 bytes, params: 2, frame: 1
|
|
return a0.roleIds;
|
|
}
|
|
|
|
function _fun44601(a0) { // fn#44601, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5283:5763, offset: 0x01174afe, size: 11 bytes, params: 2, frame: 1
|
|
return a0.channelIds;
|
|
}
|
|
|
|
global.__d(_fun44554, 5105, [1379, 5040, 1935, 1867, 3784, 5106, 661, 3772, 566, 1391, 5107, 5108, 3789, 1360, 628,
|
|
1861, 5109,
|
|
2]) /* metro module 5105, dependencies: [1379, 5040, 1935, 1867, 3784, 5106, 661, 3772, 566, 1391, 5107, 5108, 3789, 1360, 628, 1861, 5109, 2] */;
|