547 lines
31 KiB
TypeScript
547 lines
31 KiB
TypeScript
/* Metro module 1418; source: utils/GuildRecordUtils.tsx; dependencies: [1419, 1422, 661, 1421, 44, 1866, 2] */
|
|
import * as FileImportTrackerModule from '../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
|
|
import * as ConstantsModule from '../Constants.tsx'; /* Metro dependency 661 */
|
|
import * as PlainRecordModule from '../lib/PlainRecord.tsx'; /* Metro dependency 1419 */
|
|
import * as SetUtilsModule from '../external/discord_common/js/shared/utils/SetUtils.tsx'; /* Metro dependency 1421 */
|
|
|
|
function _fun16554(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#16554, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1545:6, offset: 0x00e529e5, size: 425 bytes, params: 8, frame: 20
|
|
const env0_0 = require;
|
|
const fromGuildPropertiesWithAdditionalFields2 = fromGuildPropertiesWithAdditionalFields;
|
|
const closure2 = function(a0) {
|
|
var constructGuildInPlaceBinding = constructGuildInPlace;
|
|
var object = {};
|
|
copyDataProperties(object, GUILD_DEFAULT_PROPERTY_VALUES, constructGuildInPlaceBinding);
|
|
copyDataProperties(object, a0, constructGuildInPlaceBinding);
|
|
return constructGuildInPlaceBinding(object);
|
|
};
|
|
const constructGuildInPlace = function(a0) {
|
|
return constructInPlace(GuildRecordTypeTag, a0);
|
|
};
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
let value = PlainRecordModule;
|
|
const env0_3 = value.constructInPlace;
|
|
const env0_4 = value.merge;
|
|
const env0_5 = value.objectIsPlainRecordOfType;
|
|
const env0_6 = value.tryReuseExistingInPlacePlainRecord;
|
|
value = require(1422) /* metro dependency 1422: GuildRecord */;
|
|
const env0_7 = value.GUILD_DEFAULT_PROPERTY_VALUES;
|
|
const env0_8 = value.GuildRecordTypeTag;
|
|
(FileImportTrackerModule).fileFinishedImporting('utils/GuildRecordUtils.tsx');
|
|
exports.isGuildRecord = function(a0) {
|
|
return objectIsPlainRecordOfType(GuildRecordTypeTag, a0);
|
|
};
|
|
exports.fromGuildPropertiesWithAdditionalFields = fromGuildPropertiesWithAdditionalFields2;
|
|
exports.fromServer = fromServer;
|
|
exports.attachSerializedData = attachSerializedData;
|
|
exports.fromBackgroundSync = fromBackgroundSync;
|
|
exports.fromGuild = fromGuild;
|
|
exports.fromInviteGuild = fromInviteGuild;
|
|
exports.fromGuildProfile = fromGuildProfile;
|
|
exports.fromStoreListingGuild = fromStoreListingGuild;
|
|
exports.fromDirectoryGuild = fromDirectoryGuild;
|
|
exports.fromGuildDirectoryEntry = fromGuildDirectoryEntry;
|
|
exports.fromVerificationGateGuild = fromVerificationGateGuild;
|
|
exports.fromClientDiscoverableGuild = fromClientDiscoverableGuild;
|
|
exports.fromGuildBasic = fromGuildBasic;
|
|
exports.dangerouslyConstructGuildRecordFromUntypedObject = dangerouslyConstructGuildRecordFromUntypedObject;
|
|
exports.toGuildProperties = toGuildProperties;
|
|
exports.fromSerializedGuildRecord = fromSerializedGuildRecord;
|
|
exports.constructFromPartialGuildRecord = closure2;
|
|
function fromGuildPropertiesWithAdditionalFields(a0, {joinedAt, premiumSubscriberCount}, a2) { // fn#16555, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1545:305, offset: 0x00e52b8e, size: 1083 bytes, params: 4, frame: 22
|
|
var date;
|
|
const tryReuseExistingInPlacePlainRecordBinding = tryReuseExistingInPlacePlainRecord;
|
|
const object = {};
|
|
object.id = a0.id;
|
|
object.joinedAt = joinedAt;
|
|
object.premiumSubscriberCount = premiumSubscriberCount;
|
|
object.name = a0.name;
|
|
object.description = a0.description ?? null;
|
|
object.icon = a0.icon ?? null;
|
|
object.splash = a0.splash ?? null;
|
|
object.banner = a0.banner ?? null;
|
|
object.homeHeader = a0.home_header ?? null;
|
|
object.features = SetUtilsModule.toSetInplace(a0.features);
|
|
let r8 = a0.preferred_locale ?? GUILD_DEFAULT_PROPERTY_VALUES.preferredLocale;
|
|
object.preferredLocale = r8;
|
|
object.ownerId = a0.owner_id;
|
|
object.application_id = a0.application_id ?? null;
|
|
object.afkChannelId = a0.afk_channel_id ?? null;
|
|
object.afkTimeout = a0.afk_timeout ?? GUILD_DEFAULT_PROPERTY_VALUES.afkTimeout;
|
|
object.systemChannelId = a0.system_channel_id ?? null;
|
|
object.verificationLevel = a0.verification_level ?? GUILD_DEFAULT_PROPERTY_VALUES.verificationLevel;
|
|
object.explicitContentFilter = a0.explicit_content_filter ?? GUILD_DEFAULT_PROPERTY_VALUES.explicitContentFilter;
|
|
object.defaultMessageNotifications = a0.default_message_notifications;
|
|
object.mfaLevel = a0.mfa_level ?? GUILD_DEFAULT_PROPERTY_VALUES.mfaLevel;
|
|
object.vanityURLCode = a0.vanity_url_code ?? null;
|
|
object.premiumTier = a0.premium_tier ?? GUILD_DEFAULT_PROPERTY_VALUES.premiumTier;
|
|
object.premiumProgressBarEnabled = a0.premium_progress_bar_enabled || GUILD_DEFAULT_PROPERTY_VALUES.premiumProgressBarEnabled;
|
|
if (a0.premium_progress_bar_enabled_user_updated_at != null) {
|
|
date = new global.Date(a0.premium_progress_bar_enabled_user_updated_at);
|
|
} else {
|
|
r8 = null;
|
|
}
|
|
object.premiumProgressBarEnabledUserUpdatedAt = r8;
|
|
object.systemChannelFlags = a0.system_channel_flags;
|
|
object.discoverySplash = a0.discovery_splash ?? null;
|
|
object.rulesChannelId = a0.rules_channel_id ?? null;
|
|
object.safetyAlertsChannelId = a0.safety_alerts_channel_id ?? null;
|
|
object.publicUpdatesChannelId = a0.public_updates_channel_id ?? null;
|
|
object.maxStageVideoChannelUsers = a0.max_stage_video_channel_users ?? GUILD_DEFAULT_PROPERTY_VALUES.maxStageVideoChannelUsers;
|
|
object.maxVideoChannelUsers = a0.max_video_channel_users ?? GUILD_DEFAULT_PROPERTY_VALUES.maxVideoChannelUsers;
|
|
object.maxMembers = a0.max_members ?? GUILD_DEFAULT_PROPERTY_VALUES.maxMembers;
|
|
object.nsfwLevel = a0.nsfw_level ?? GUILD_DEFAULT_PROPERTY_VALUES.nsfwLevel;
|
|
object.ownerConfiguredContentLevel = a0.owner_configured_content_level ?? null;
|
|
object.hubType = a0.hub_type ?? null;
|
|
object.latestOnboardingQuestionId = a0.latest_onboarding_question_id ?? null;
|
|
object.profile = a0.profile ?? null;
|
|
object.guildTheme = resolveGuildTheme(a0.theme, a2);
|
|
object.premiumFeatures = a0.premium_features != null ? {features: a0.premium_features.features,
|
|
additionalEmojiSlots: a0.premium_features.additional_emoji_slots,
|
|
additionalStickerSlots: a0.premium_features.additional_sticker_slots,
|
|
additionalSoundSlots: a0.premium_features.additional_sound_slots} : null;
|
|
object.moderatorReporting = a0.moderator_reporting != null ? {moderatorReportingEnabled: a0.moderator_reporting.moderator_reporting_enabled,
|
|
moderatorReportChannelId: a0.moderator_reporting.moderator_report_channel_id} : null;
|
|
object.verificationRoleId = a0.verification_role_id ?? null;
|
|
object.gameApplicationIds = a0.game_application_ids ?? null;
|
|
object.officialMessageColor = a0.official_message_color ?? null;
|
|
return tryReuseExistingInPlacePlainRecordBinding(GuildRecordTypeTag, a2, object);
|
|
}
|
|
|
|
function resolveGuildTheme(a0, a1) { // fn#16558, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1545:3199, offset: 0x00e53008, size: 110 bytes, params: 3, frame: 16
|
|
var r0;
|
|
var guildTheme;
|
|
var value2;
|
|
var value4;
|
|
let value = undefined;
|
|
if (value === a0) {
|
|
value4 = null;
|
|
guildTheme = value4 == a1 ? value : a1.guildTheme;
|
|
r0 = value4 != guildTheme ? guildTheme : value4;
|
|
} else {
|
|
value2 = null;
|
|
if (value2 != a0) {
|
|
value = require(1866) /* metro dependency 1866: guildThemeSerialization */;
|
|
value = value.fromServerGuildTheme(a0);
|
|
r0 = value2 != value ? value : {'enabled': false, 'themeSettings': null};
|
|
} else {
|
|
r0 = value2;
|
|
}
|
|
}
|
|
return r0;
|
|
}
|
|
|
|
function fromServer(a0, a1) { // fn#16560, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1545:3603, offset: 0x00e5308e, size: 210 bytes, params: 3, frame: 19
|
|
var joinedAt;
|
|
var r6;
|
|
var r0;
|
|
var date;
|
|
const joined_at = a0.joined_at;
|
|
let value = null;
|
|
if (value != joined_at) {
|
|
date = new global.Date(a0.joined_at);
|
|
} else {
|
|
joinedAt = value == a1 ? undefined : a1.joinedAt;
|
|
r6 = value != joinedAt ? joinedAt : value;
|
|
}
|
|
const premium_subscription_count = a0.premium_subscription_count;
|
|
const r5 = value != premium_subscription_count ? premium_subscription_count : 0;
|
|
if (value == a0.properties) {
|
|
(importDefault(44) /* metro dependency 44 */)(value != a1,
|
|
'If guild.properties is null, existingGuild must be passed in');
|
|
value = merge(a1, {joinedAt: r6, premiumSubscriberCount: r5});
|
|
r0 = value;
|
|
} else {
|
|
r0 = fromGuildPropertiesWithAdditionalFields(a0.properties, {joinedAt: r6, premiumSubscriberCount: r5}, a1);
|
|
}
|
|
return r0;
|
|
}
|
|
|
|
function fromBackgroundSync(a0, a1) { // fn#16562, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1545:4401, offset: 0x00e5321e, size: 69 bytes, params: 3, frame: 16
|
|
var r0;
|
|
let value = a1;
|
|
if (a0.properties == null) {
|
|
r0 = value;
|
|
} else {
|
|
value = fromGuildPropertiesWithAdditionalFields(a0.properties, {joinedAt: value.joinedAt,
|
|
premiumSubscriberCount: value.premiumSubscriberCount}, value);
|
|
r0 = value;
|
|
}
|
|
return r0;
|
|
}
|
|
|
|
function fromGuild(a0, a1) { // fn#16563, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1545:4601, offset: 0x00e53263, size: 117 bytes, params: 3, frame: 18
|
|
const fromGuildPropertiesWithAdditionalFieldsBinding = fromGuildPropertiesWithAdditionalFields;
|
|
const joined_at = a0.joined_at;
|
|
const value = null;
|
|
return fromGuildPropertiesWithAdditionalFieldsBinding(a0,
|
|
{joinedAt: value != joined_at ? new global.Date(a0.joined_at) : value != (value == a1 ? undefined : a1.joinedAt) ? value == a1 ? undefined : a1.joinedAt : value,
|
|
premiumSubscriberCount: a0.premium_subscription_count}, a1);
|
|
}
|
|
|
|
function fromInviteGuild({id, name, description, icon, splash, banner, features, verification_level, vanity_url_code, premium_subscription_count, nsfw_level, premium_tier, home_header}) { // fn#16564, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1545:4848, offset: 0x00e532d8, size: 187 bytes, params: 2, frame: 15
|
|
const constructFromPartialGuildRecordBinding = constructFromPartialGuildRecord;
|
|
const object = {};
|
|
object.id = id;
|
|
object.name = name;
|
|
object.description = description;
|
|
object.icon = icon;
|
|
object.splash = splash;
|
|
object.banner = banner;
|
|
object.features = (require(1421) /* metro dependency 1421: SetUtils */).toSetInplace(features);
|
|
object.verificationLevel = verification_level;
|
|
object.vanityURLCode = vanity_url_code;
|
|
object.premiumSubscriberCount = premium_subscription_count;
|
|
object.nsfwLevel = nsfw_level;
|
|
object.premiumTier = premium_tier;
|
|
object.homeHeader = home_header;
|
|
return constructFromPartialGuildRecordBinding(object);
|
|
}
|
|
|
|
function fromGuildProfile({id, name, description, icon, premiumSubscriberCount, premiumTier, features}) { // fn#16565, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1545:5268, offset: 0x00e53393, size: 151 bytes, params: 2, frame: 15
|
|
const constructFromPartialGuildRecordBinding = constructFromPartialGuildRecord;
|
|
const object = {};
|
|
object.id = id;
|
|
object.name = name;
|
|
object.description = description;
|
|
object.icon = icon;
|
|
premiumSubscriberCount = premiumSubscriberCount ?? GUILD_DEFAULT_PROPERTY_VALUES.premiumSubscriberCount;
|
|
object.premiumSubscriberCount = premiumSubscriberCount;
|
|
premiumTier = premiumTier ?? GUILD_DEFAULT_PROPERTY_VALUES.premiumTier;
|
|
object.premiumTier = premiumTier;
|
|
object.features = (require(1421) /* metro dependency 1421: SetUtils */).toSetInplace(features);
|
|
return constructFromPartialGuildRecordBinding(object);
|
|
}
|
|
|
|
function fromStoreListingGuild({id, name, icon}) { // fn#16566, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1545:5609, offset: 0x00e5342a, size: 60 bytes, params: 2, frame: 13
|
|
return constructFromPartialGuildRecord({id: id, name: name, icon: icon ?? null});
|
|
}
|
|
|
|
function fromDirectoryGuild({id, name, icon, description, splash, features}) { // fn#16567, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1545:5762, offset: 0x00e53466, size: 148 bytes, params: 2, frame: 16
|
|
const constructFromPartialGuildRecordBinding = constructFromPartialGuildRecord;
|
|
const object = {};
|
|
object.id = id;
|
|
object.name = name;
|
|
object.icon = icon ?? null;
|
|
object.description = description ?? null;
|
|
object.splash = splash ?? null;
|
|
object.features = (require(1421) /* metro dependency 1421: SetUtils */).toSetInplace(features);
|
|
return constructFromPartialGuildRecordBinding(object);
|
|
}
|
|
|
|
function fromGuildDirectoryEntry({guildId, name, icon, description, splash, features}) { // fn#16568, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1545:6039, offset: 0x00e534fa, size: 162 bytes, params: 2, frame: 16
|
|
const constructFromPartialGuildRecordBinding = constructFromPartialGuildRecord;
|
|
const object = {};
|
|
object.id = guildId;
|
|
object.name = name ?? '';
|
|
object.icon = icon ?? null;
|
|
object.description = description ?? null;
|
|
object.splash = splash ?? null;
|
|
object.features = (require(1421) /* metro dependency 1421: SetUtils */).toSetInplace(features);
|
|
return constructFromPartialGuildRecordBinding(object);
|
|
}
|
|
|
|
function fromVerificationGateGuild({id, name, icon, description, splash, features, verification_level}) { // fn#16569, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1545:6345, offset: 0x00e5359c, size: 173 bytes, params: 2, frame: 17
|
|
const constructFromPartialGuildRecordBinding = constructFromPartialGuildRecord;
|
|
const object = {};
|
|
object.id = id;
|
|
object.name = name;
|
|
object.icon = icon ?? null;
|
|
object.description = description ?? null;
|
|
object.splash = splash ?? null;
|
|
object.features = (require(1421) /* metro dependency 1421: SetUtils */).toSetInplace(features);
|
|
object.verificationLevel = verification_level ?? GUILD_DEFAULT_PROPERTY_VALUES.verificationLevel;
|
|
return constructFromPartialGuildRecordBinding(object);
|
|
}
|
|
|
|
function fromClientDiscoverableGuild({id, name, description, splash, banner, preferredLocale, icon, features, premiumSubscriptionCount, discoverySplash}) { // fn#16570, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1545:6706, offset: 0x00e53649, size: 244 bytes, params: 2, frame: 17
|
|
const constructFromPartialGuildRecordBinding = constructFromPartialGuildRecord;
|
|
const object = {};
|
|
object.id = id;
|
|
object.name = name;
|
|
object.description = description ?? null;
|
|
object.splash = splash ?? null;
|
|
object.banner = banner ?? null;
|
|
preferredLocale = preferredLocale ?? GUILD_DEFAULT_PROPERTY_VALUES.preferredLocale;
|
|
object.preferredLocale = preferredLocale;
|
|
object.icon = icon ?? null;
|
|
object.features = (require(1421) /* metro dependency 1421: SetUtils */).toSetInplace(features);
|
|
object.premiumSubscriberCount = premiumSubscriptionCount ?? GUILD_DEFAULT_PROPERTY_VALUES.premiumSubscriberCount;
|
|
object.discoverySplash = discoverySplash ?? null;
|
|
return constructFromPartialGuildRecordBinding(object);
|
|
}
|
|
|
|
function fromGuildBasic({id, name, icon, description, splash, discovery_splash, features}) { // fn#16571, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1545:7226, offset: 0x00e5373d, size: 171 bytes, params: 2, frame: 16
|
|
const constructFromPartialGuildRecordBinding = constructFromPartialGuildRecord;
|
|
const object = {};
|
|
object.id = id;
|
|
object.name = name;
|
|
object.icon = icon ?? null;
|
|
object.description = description ?? null;
|
|
object.splash = splash ?? null;
|
|
object.discoverySplash = discovery_splash ?? null;
|
|
object.features = (require(1421) /* metro dependency 1421: SetUtils */).toSetInplace(features);
|
|
return constructFromPartialGuildRecordBinding(object);
|
|
}
|
|
|
|
function dangerouslyConstructGuildRecordFromUntypedObject(a0) { // fn#16572, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1545:7578, offset: 0x00e537e8, size: 998 bytes, params: 2, frame: 19
|
|
var r3;
|
|
var date;
|
|
var value17;
|
|
const constructGuildInPlaceBinding = constructGuildInPlace;
|
|
const object = {};
|
|
object.id = a0.id;
|
|
let name = a0.name;
|
|
name = !name ? '' : name;
|
|
object.name = name;
|
|
let description = a0.description;
|
|
description = !description ? null : description;
|
|
object.description = description;
|
|
let ownerId = a0.ownerId;
|
|
ownerId = !ownerId ? null : ownerId;
|
|
object.ownerId = ownerId;
|
|
let icon = a0.icon;
|
|
icon = !icon ? null : icon;
|
|
object.icon = icon;
|
|
let splash = a0.splash;
|
|
splash = !splash ? null : splash;
|
|
object.splash = splash;
|
|
let banner = a0.banner;
|
|
banner = !banner ? null : banner;
|
|
object.banner = banner;
|
|
let homeHeader = a0.homeHeader;
|
|
homeHeader = !homeHeader ? null : homeHeader;
|
|
object.homeHeader = homeHeader;
|
|
object.features = SetUtilsModule.toSetInplace(a0.features);
|
|
let preferredLocale = a0.preferredLocale;
|
|
preferredLocale = !preferredLocale ? GUILD_DEFAULT_PROPERTY_VALUES.preferredLocale : preferredLocale;
|
|
object.preferredLocale = preferredLocale;
|
|
let afkChannelId = a0.afkChannelId;
|
|
afkChannelId = !afkChannelId ? null : afkChannelId;
|
|
object.afkChannelId = afkChannelId;
|
|
object.afkTimeout = a0.afkTimeout;
|
|
let systemChannelId = a0.systemChannelId;
|
|
systemChannelId = !systemChannelId ? null : systemChannelId;
|
|
object.systemChannelId = systemChannelId;
|
|
let verificationLevel = a0.verificationLevel;
|
|
verificationLevel = !verificationLevel ? GUILD_DEFAULT_PROPERTY_VALUES.verificationLevel : verificationLevel;
|
|
object.verificationLevel = verificationLevel;
|
|
let joinedAt = a0.joinedAt;
|
|
let Date = global.Date;
|
|
const value11 = joinedAt instanceof Date;
|
|
joinedAt = a0.joinedAt;
|
|
if (value11) {
|
|
r3 = joinedAt;
|
|
} else if (joinedAt != null) {
|
|
date = new global.Date(a0.joinedAt);
|
|
} else {
|
|
r3 = a0.joinedAt;
|
|
}
|
|
object.joinedAt = r3;
|
|
let defaultMessageNotifications = a0.defaultMessageNotifications;
|
|
defaultMessageNotifications = !defaultMessageNotifications ? GUILD_DEFAULT_PROPERTY_VALUES.defaultMessageNotifications : defaultMessageNotifications;
|
|
object.defaultMessageNotifications = defaultMessageNotifications;
|
|
let mfaLevel = a0.mfaLevel;
|
|
mfaLevel = !mfaLevel ? GUILD_DEFAULT_PROPERTY_VALUES.mfaLevel : mfaLevel;
|
|
object.mfaLevel = mfaLevel;
|
|
let application_id = a0.application_id;
|
|
application_id = !application_id ? null : application_id;
|
|
object.application_id = application_id;
|
|
let explicitContentFilter = a0.explicitContentFilter;
|
|
explicitContentFilter = !explicitContentFilter ? GUILD_DEFAULT_PROPERTY_VALUES.explicitContentFilter : explicitContentFilter;
|
|
object.explicitContentFilter = explicitContentFilter;
|
|
let vanityURLCode = a0.vanityURLCode;
|
|
vanityURLCode = !vanityURLCode ? null : vanityURLCode;
|
|
object.vanityURLCode = vanityURLCode;
|
|
let premiumTier = a0.premiumTier;
|
|
premiumTier = !premiumTier ? GUILD_DEFAULT_PROPERTY_VALUES.premiumTier : premiumTier;
|
|
object.premiumTier = premiumTier;
|
|
let premiumSubscriberCount = a0.premiumSubscriberCount;
|
|
premiumSubscriberCount = !premiumSubscriberCount ? GUILD_DEFAULT_PROPERTY_VALUES.premiumSubscriberCount : premiumSubscriberCount;
|
|
object.premiumSubscriberCount = premiumSubscriberCount;
|
|
let premiumProgressBarEnabled = a0.premiumProgressBarEnabled;
|
|
premiumProgressBarEnabled = !premiumProgressBarEnabled ? GUILD_DEFAULT_PROPERTY_VALUES.premiumProgressBarEnabled : premiumProgressBarEnabled;
|
|
object.premiumProgressBarEnabled = premiumProgressBarEnabled;
|
|
let premiumProgressBarEnabledUserUpdatedAt = a0.premiumProgressBarEnabledUserUpdatedAt;
|
|
Date = global.Date;
|
|
const value16 = premiumProgressBarEnabledUserUpdatedAt instanceof Date;
|
|
premiumProgressBarEnabledUserUpdatedAt = a0.premiumProgressBarEnabledUserUpdatedAt;
|
|
if (value16) {
|
|
r3 = premiumProgressBarEnabledUserUpdatedAt;
|
|
} else {
|
|
value17 = null;
|
|
if (value17 != premiumProgressBarEnabledUserUpdatedAt) {
|
|
date = new global.Date(a0.premiumProgressBarEnabledUserUpdatedAt);
|
|
} else {
|
|
r3 = value17;
|
|
}
|
|
}
|
|
object.premiumProgressBarEnabledUserUpdatedAt = r3;
|
|
object.systemChannelFlags = a0.systemChannelFlags;
|
|
let discoverySplash = a0.discoverySplash;
|
|
discoverySplash = !discoverySplash ? null : discoverySplash;
|
|
object.discoverySplash = discoverySplash;
|
|
let rulesChannelId = a0.rulesChannelId;
|
|
rulesChannelId = !rulesChannelId ? null : rulesChannelId;
|
|
object.rulesChannelId = rulesChannelId;
|
|
let safetyAlertsChannelId = a0.safetyAlertsChannelId;
|
|
safetyAlertsChannelId = !safetyAlertsChannelId ? null : safetyAlertsChannelId;
|
|
object.safetyAlertsChannelId = safetyAlertsChannelId;
|
|
let publicUpdatesChannelId = a0.publicUpdatesChannelId;
|
|
publicUpdatesChannelId = !publicUpdatesChannelId ? null : publicUpdatesChannelId;
|
|
object.publicUpdatesChannelId = publicUpdatesChannelId;
|
|
let maxStageVideoChannelUsers = a0.maxStageVideoChannelUsers;
|
|
maxStageVideoChannelUsers = !maxStageVideoChannelUsers ? GUILD_DEFAULT_PROPERTY_VALUES.maxStageVideoChannelUsers : maxStageVideoChannelUsers;
|
|
object.maxStageVideoChannelUsers = maxStageVideoChannelUsers;
|
|
let maxVideoChannelUsers = a0.maxVideoChannelUsers;
|
|
maxVideoChannelUsers = !maxVideoChannelUsers ? GUILD_DEFAULT_PROPERTY_VALUES.maxVideoChannelUsers : maxVideoChannelUsers;
|
|
object.maxVideoChannelUsers = maxVideoChannelUsers;
|
|
let maxMembers = a0.maxMembers;
|
|
maxMembers = !maxMembers ? GUILD_DEFAULT_PROPERTY_VALUES.maxMembers : maxMembers;
|
|
object.maxMembers = maxMembers;
|
|
let nsfwLevel = a0.nsfwLevel;
|
|
const value24 = null;
|
|
nsfwLevel = value24 == nsfwLevel ? GUILD_DEFAULT_PROPERTY_VALUES.nsfwLevel : nsfwLevel;
|
|
object.nsfwLevel = nsfwLevel;
|
|
const ownerConfiguredContentLevel = a0.ownerConfiguredContentLevel;
|
|
object.ownerConfiguredContentLevel = value24 != ownerConfiguredContentLevel ? ownerConfiguredContentLevel : value24;
|
|
object.hubType = a0.hubType;
|
|
const latestOnboardingQuestionId = a0.latestOnboardingQuestionId;
|
|
object.latestOnboardingQuestionId = value24 != latestOnboardingQuestionId ? latestOnboardingQuestionId : value24;
|
|
const profile = a0.profile;
|
|
object.profile = value24 != profile ? profile : value24;
|
|
const guildTheme = a0.guildTheme;
|
|
object.guildTheme = value24 != guildTheme ? guildTheme : value24;
|
|
const premiumFeatures = a0.premiumFeatures;
|
|
object.premiumFeatures = value24 != premiumFeatures ? premiumFeatures : value24;
|
|
const moderatorReporting = a0.moderatorReporting;
|
|
object.moderatorReporting = value24 != moderatorReporting ? moderatorReporting : value24;
|
|
const gameApplicationIds = a0.gameApplicationIds;
|
|
object.gameApplicationIds = value24 != gameApplicationIds ? gameApplicationIds : value24;
|
|
const officialMessageColor = a0.officialMessageColor;
|
|
object.officialMessageColor = value24 != officialMessageColor ? officialMessageColor : value24;
|
|
const verificationRoleId = a0.verificationRoleId;
|
|
object.verificationRoleId = value24 != verificationRoleId ? verificationRoleId : value24;
|
|
return constructGuildInPlaceBinding(object);
|
|
}
|
|
|
|
function toGuildProperties(a0) { // fn#16573, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1545:9924, offset: 0x00e53bce, size: 751 bytes, params: 2, frame: 19
|
|
var object;
|
|
var moduleValue;
|
|
const object3 = {};
|
|
object3.id = a0.id;
|
|
object3.name = a0.name;
|
|
object3.description = a0.description;
|
|
object3.icon = a0.icon;
|
|
object3.splash = a0.splash;
|
|
object3.banner = a0.banner;
|
|
object3.home_header = a0.homeHeader;
|
|
const Array = global.Array;
|
|
object3.features = Array.from(a0.features);
|
|
object3.preferred_locale = a0.preferredLocale;
|
|
object3.owner_id = a0.ownerId;
|
|
object3.application_id = a0.application_id;
|
|
object3.afk_channel_id = a0.afkChannelId;
|
|
object3.afk_timeout = a0.afkTimeout;
|
|
object3.system_channel_id = a0.systemChannelId;
|
|
object3.verification_level = a0.verificationLevel;
|
|
object3.explicit_content_filter = a0.explicitContentFilter;
|
|
object3.default_message_notifications = a0.defaultMessageNotifications;
|
|
object3.mfa_level = a0.mfaLevel;
|
|
const vanityURLCode = a0.vanityURLCode;
|
|
const value = null;
|
|
let r3 = value != vanityURLCode ? vanityURLCode : value;
|
|
object3.vanity_url_code = r3;
|
|
object3.premium_tier = a0.premiumTier;
|
|
object3.premium_progress_bar_enabled = a0.premiumProgressBarEnabled;
|
|
const premiumProgressBarEnabledUserUpdatedAt = a0.premiumProgressBarEnabledUserUpdatedAt;
|
|
const r4 = value == premiumProgressBarEnabledUserUpdatedAt ? undefined : premiumProgressBarEnabledUserUpdatedAt.toISOString();
|
|
object3.premium_progress_bar_enabled_user_updated_at = value != r4 ? r4 : value;
|
|
object3.premium_features = value != a0.premiumFeatures ? {features: a0.premiumFeatures.features,
|
|
additional_emoji_slots: a0.premiumFeatures.additionalEmojiSlots,
|
|
additional_sticker_slots: a0.premiumFeatures.additionalStickerSlots,
|
|
additional_sound_slots: a0.premiumFeatures.additionalSoundSlots} : value;
|
|
object3.system_channel_flags = a0.systemChannelFlags;
|
|
object3.discovery_splash = a0.discoverySplash;
|
|
object3.rules_channel_id = a0.rulesChannelId;
|
|
object3.safety_alerts_channel_id = a0.safetyAlertsChannelId;
|
|
object3.public_updates_channel_id = a0.publicUpdatesChannelId;
|
|
object3.max_stage_video_channel_users = a0.maxStageVideoChannelUsers;
|
|
object3.max_video_channel_users = a0.maxVideoChannelUsers;
|
|
object3.max_members = a0.maxMembers;
|
|
object3.nsfw_level = a0.nsfwLevel;
|
|
const AGE_RESTRICTED = GuildNSFWContentLevel.AGE_RESTRICTED;
|
|
const items2 = [AGE_RESTRICTED];
|
|
const EXPLICIT = GuildNSFWContentLevel.EXPLICIT;
|
|
items2[1] = EXPLICIT;
|
|
object3.nsfw = items2.includes(a0.nsfwLevel);
|
|
object3.owner_configured_content_level = a0.ownerConfiguredContentLevel;
|
|
object3.hub_type = a0.hubType;
|
|
object3.latest_onboarding_question_id = a0.latestOnboardingQuestionId;
|
|
object3.profile = a0.profile;
|
|
let guildTheme = a0.guildTheme;
|
|
if (value != guildTheme) {
|
|
guildTheme = a0.guildTheme;
|
|
object = {};
|
|
object.enabled = guildTheme.enabled;
|
|
moduleValue = require(dependencyMap[5]);
|
|
copyDataProperties(object, moduleValue.toServerGuildThemeSettings(guildTheme.themeSettings), dependencyMap);
|
|
r3 = object;
|
|
} else {
|
|
r3 = value;
|
|
}
|
|
object3.theme = r3;
|
|
object3.moderator_reporting = value != a0.moderatorReporting ? {moderator_reporting_enabled: a0.moderatorReporting.moderatorReportingEnabled,
|
|
moderator_report_channel_id: a0.moderatorReporting.moderatorReportChannelId} : value;
|
|
object3.official_message_color = a0.officialMessageColor;
|
|
object3.incidents_data = value;
|
|
object3.game_application_ids = a0.gameApplicationIds;
|
|
object3.verification_role_id = a0.verificationRoleId;
|
|
return object3;
|
|
}
|
|
|
|
function fromSerializedGuildRecord(a0) { // fn#16574, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1545:12040, offset: 0x00e53ebd, size: 205 bytes, params: 2, frame: 18
|
|
var r6;
|
|
var r4;
|
|
var date;
|
|
const object = {};
|
|
copyDataProperties(object, a0, undefined);
|
|
object['features'] = SetUtilsModule.toSetInplace(a0.features);
|
|
const joinedAt = a0.joinedAt;
|
|
const value3 = null;
|
|
if (value3 != joinedAt) {
|
|
date = new global.Date(a0.joinedAt);
|
|
} else {
|
|
r6 = value3;
|
|
}
|
|
object['joinedAt'] = r6;
|
|
if (value3 != a0.premiumProgressBarEnabledUserUpdatedAt) {
|
|
date = new global.Date(a0.premiumProgressBarEnabledUserUpdatedAt);
|
|
} else {
|
|
r4 = value3;
|
|
}
|
|
object['premiumProgressBarEnabledUserUpdatedAt'] = r4;
|
|
delete object.roles;
|
|
delete object.member;
|
|
return constructGuildInPlace(object);
|
|
}
|
|
|
|
}
|
|
|
|
function attachSerializedData(a0, a1, a2) { // fn#16561, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1545:4035, offset: 0x00e53160, size: 190 bytes, params: 4, frame: 16
|
|
const object = {};
|
|
copyDataProperties(object, a0, undefined);
|
|
const joinedAt = a0.joinedAt;
|
|
const value = null;
|
|
object['joinedAt'] = value != joinedAt ? a0.joinedAt.toISOString() : value;
|
|
object['premiumProgressBarEnabledUserUpdatedAt'] = value != a0.premiumProgressBarEnabledUserUpdatedAt ? a0.premiumProgressBarEnabledUserUpdatedAt.toISOString() : value;
|
|
const Array = global.Array;
|
|
object['features'] = Array.from(a0.features);
|
|
object['roles'] = a1;
|
|
object['member'] = value != a2 ? {userId: a2.userId, roles: a2.roles} : value;
|
|
return object;
|
|
}
|
|
|
|
global.__d(_fun16554, 1418, [1419, 1422, 661, 1421, 44, 1866,
|
|
2]) /* metro module 1418, dependencies: [1419, 1422, 661, 1421, 44, 1866, 2] */;
|