// Metro module 4212 (f4213). import Record from "../lib/Record"; import CompanyRecord from "./CompanyRecord"; import UserRecord from "./UserRecord"; import * as _Constants from "../modules/activities/Constants"; import { ApplicationTypes } from "../modules/applications/ApplicationConstants"; import { getIsRiotSocialSDKMigrationEnabled } from "../modules/application_account_linking/experiments/socialSDKMigration"; import { getIsValorantSocialSDKEnabled } from "../modules/application_account_linking/experiments/valorantSocialSDKExperiment"; import AvatarUtils from "../utils/AvatarUtils"; import { ApplicationOverlayMethodFlags } from "../_bundle/Module4218"; import { deserialize } from "../_bundle/HighLow"; import SnowflakeUtils from "../utils/SnowflakeUtils"; let c2432_7; const createExecutable = function createExecutable(a0) { const r1 = { os: a0.os, name: a0.name }; if (a0.arguments != null) { r1.arguments = a0.arguments; } if (a0.is_launcher != null) { r1.isLauncher = a0.is_launcher; } return r1; }; const { END_GAME_APPLICATION_ID, POKER_NIGHT_APPLICATION_ID } = _Constants; const r28 = {}; r28[POKER_NIGHT_APPLICATION_ID] = 7; r28[END_GAME_APPLICATION_ID] = 12; c2432_7 = r28; class BasicApplicationRecord extends Record { constructor(a0) { super(); this.id = a0.id; this.name = a0.name; this.icon = a0.icon; this.splash = a0.splash; this.primarySkuId = a0.primarySkuId; let thirdPartySkus = a0.thirdPartySkus; if (thirdPartySkus == null) { thirdPartySkus = []; } this.thirdPartySkus = thirdPartySkus; this.description = a0.description; this.bot = a0.bot; this.coverImage = a0.coverImage; this.type = a0.type; let is_monetized = a0.is_monetized; if (is_monetized == null) { is_monetized = a0.isMonetized; } this.isMonetized = is_monetized; let is_verified = a0.is_verified; if (is_verified == null) { is_verified = a0.isVerified; } this.isVerified = is_verified; let role_connections_verification_url = a0.role_connections_verification_url; if (role_connections_verification_url == null) { role_connections_verification_url = a0.roleConnectionsVerificationUrl; } this.roleConnectionsVerificationUrl = role_connections_verification_url; let parent_id = a0.parent_id; if (parent_id == null) { parent_id = a0.parentId; } this.parentId = parent_id; let connection_entrypoint_url = a0.connection_entrypoint_url; if (connection_entrypoint_url == null) { connection_entrypoint_url = a0._connectionEntrypointUrl; } this._connectionEntrypointUrl = connection_entrypoint_url; let content_classification = a0.content_classification; if (content_classification == null) { content_classification = a0.contentClassification; } this.contentClassification = content_classification; } static createFromServer(a0) { return new BasicApplicationRecord({ ...a0, coverImage: a0.cover_image, primarySkuId: a0.primary_sku_id, bot: a0.bot != null ? new UserRecord(a0.bot) : null, thirdPartySkus: a0.third_party_skus, roleConnectionsVerificationUrl: a0.role_connections_verification_url, parentId: a0.parent_id, _connectionEntrypointUrl: a0.connection_entrypoint_url, contentClassification: a0.content_classification }); } get connectionEntrypointUrl() { let r21; L5: { L4: { if (["1443349464290168976", "1443350165678198935", "1443033465766281327"].includes(this.id)) { if (this.id === "1443350165678198935" && !getIsValorantSocialSDKEnabled({ location: "ApplicationRecord" })) { break L4; } const isRiotSocialSDKMigrationEnabled = getIsRiotSocialSDKMigrationEnabled({ location: "ApplicationRecord" }); r21 = "https://aes.sgp.pvp.net/providers/discord/link/v1?origin=Discord"; if (isRiotSocialSDKMigrationEnabled) { break L5; } } } r21 = this._connectionEntrypointUrl; } return r21; } getIconURL(a0, a1) { return this.icon != null ? AvatarUtils.getGameAssetURL({ id: this.id, hash: this.icon, size: a0, format: a1 }) : null; } getIconSource(a0, a1) { return this.icon != null ? AvatarUtils.getGameAssetSource({ id: this.id, hash: this.icon, size: a0, format: a1 }) : null; } getSplashURL(a0, a1) { return this.splash != null ? AvatarUtils.getGameAssetURL({ id: this.id, hash: this.splash, size: a0, keepAspectRatio: true, format: a1 }) : null; } getCoverImageURL(a0) { return this.coverImage != null ? AvatarUtils.getApplicationIconURL({ id: this.id, icon: this.coverImage, size: a0, keepAspectRatio: true }) : null; } } class ApplicationRecord extends BasicApplicationRecord { constructor(a0) { super(a0); let overlay = a0.overlay; if (overlay == null) { overlay = false; } this.overlay = overlay; let overlayWarn = a0.overlayWarn; if (overlayWarn == null) { overlayWarn = false; } this.overlayWarn = overlayWarn; let overlayCompatibilityHook = a0.overlayCompatibilityHook; if (overlayCompatibilityHook == null) { overlayCompatibilityHook = false; } this.overlayCompatibilityHook = overlayCompatibilityHook; let overlayMethods = a0.overlayMethods; if (overlayMethods == null) { overlayMethods = ApplicationOverlayMethodFlags.DEFAULT; } this.overlayMethods = overlayMethods; let hook = a0.hook; if (hook == null) { hook = true; } this.hook = hook; let aliases = a0.aliases; if (aliases == null) { aliases = []; } this.aliases = aliases; let publishers = a0.publishers; if (publishers == null) { publishers = []; } this.publishers = publishers; let developers = a0.developers; if (developers == null) { developers = []; } this.developers = developers; this.storeListingSkuId = a0.storeListingSkuId; this.guildId = a0.guildId; this.guild = a0.guild; let executables = a0.executables; if (executables == null) { executables = []; } this.executables = executables.map(createExecutable); let hashes = a0.hashes; if (hashes == null) { hashes = []; } this.hashes = hashes; this.eulaId = a0.eulaId; this.slug = a0.slug; let flags = a0.flags; if (flags == null) { flags = 0; } this.flags = deserialize(flags); let tags = a0.tags; if (tags == null) { tags = []; } this.tags = tags; this.maxParticipants = a0.maxParticipants; let embedded_activity_config = a0.embedded_activity_config; if (embedded_activity_config == null) { embedded_activity_config = a0.embeddedActivityConfig; } this.embeddedActivityConfig = embedded_activity_config; this.team = a0.team; this.integrationTypesConfig = a0.integrationTypesConfig; this.storefront_available = a0.storefront_available; this.termsOfServiceUrl = a0.termsOfServiceUrl; this.privacyPolicyUrl = a0.privacyPolicyUrl; let is_discoverable = a0.is_discoverable; if (is_discoverable == null) { is_discoverable = a0.isDiscoverable; } this.isDiscoverable = is_discoverable; let custom_install_url = a0.custom_install_url; if (custom_install_url == null) { custom_install_url = a0.customInstallUrl; } this.customInstallUrl = custom_install_url; let install_params = a0.install_params; if (install_params == null) { install_params = a0.installParams; } this.installParams = install_params; let directory_entry = a0.directory_entry; if (directory_entry == null) { directory_entry = a0.directoryEntry; } this.directoryEntry = directory_entry; this.categories = a0.categories; const linked_games = a0.linked_games; let linkedGames2 = linked_games == null ? void 0 : linked_games.map((linked_game) => ({ ...linked_game, application: linked_game.application != null ? ApplicationRecord.createFromServer(linked_game.application) : void 0 })); if (linkedGames2 == null) { linkedGames2 = a0.linkedGames; } this.linkedGames = linkedGames2; let deepLinkUri = a0.deepLinkUri; if (deepLinkUri == null) { deepLinkUri = a0.deeplink_uri; } this.deepLinkUri = deepLinkUri; let applicationAccountLinkBenefitConfig = a0.applicationAccountLinkBenefitConfig; if (applicationAccountLinkBenefitConfig == null) { applicationAccountLinkBenefitConfig = a0.application_account_link_benefit_config; } this.applicationAccountLinkBenefitConfig = applicationAccountLinkBenefitConfig; let parentId = a0.parentId; if (parentId == null) { parentId = a0.parent_id; } this.parentId = parentId; } static createFromServer(a0) { const bot = a0.bot != null ? new UserRecord(a0.bot) : null; let overlay_methods = a0.overlay_methods; if (overlay_methods == null) { overlay_methods = ApplicationOverlayMethodFlags.DEFAULT; } const publishers = a0.publishers != null ? a0.publishers.map(CompanyRecord.createFromServer) : []; const developers = a0.developers != null ? a0.developers.map(CompanyRecord.createFromServer) : []; let flags_new = a0.flags_new; if (flags_new == null) { flags_new = a0.flags; } if (flags_new == null) { flags_new = 0; } const r4 = { ...a0, coverImage: a0.cover_image, primarySkuId: a0.primary_sku_id, bot, thirdPartySkus: a0.third_party_skus, roleConnectionsVerificationUrl: a0.role_connections_verification_url, overlayWarn: a0.overlay_warn, overlayCompatibilityHook: a0.overlay_compatibility_hook, overlayMethods: overlay_methods, hook: a0.hook, storeListingSkuId: a0.store_listing_sku_id, guildId: a0.guild_id, guild: a0.guild, publishers, developers, eulaId: a0.eula_id, slug: a0.slug, flags: deserialize(flags_new), maxParticipants: a0.max_participants, tags: a0.tags, embeddedActivityConfig: a0.embedded_activity_config, integrationTypesConfig: a0.integration_types_config != null ? Object.fromEntries(Object.entries(a0.integration_types_config).map((item) => { let [r13, r14] = item; const r16 = [r13, ,]; if (r14 == null) { r14 = {}; } r16[1] = { oauth2InstallParams: r14.oauth2_install_params }; return r16; })) : void 0, termsOfServiceUrl: a0.terms_of_service_url, privacyPolicyUrl: a0.privacy_policy_url, isDiscoverable: a0.is_discoverable, directoryEntry: a0.directory_entry, categories: a0.categories }; const linked_games = a0.linked_games; r4.linkedGames = linked_games == null ? void 0 : linked_games.map((linked_game) => ({ ...linked_game, application: linked_game.application != null ? ApplicationRecord.createFromServer(linked_game.application) : void 0 })); r4.deepLinkUri = a0.deeplink_uri; r4.applicationAccountLinkBenefitConfig = a0.application_account_link_benefit_config; r4.parentId = a0.parent_id; return new ApplicationRecord(r4); } getCanonicalGameId() { let r10; if (this.type === ApplicationTypes.GAME) { r10 = SnowflakeUtils.cast(this.id); } else { const linkedGames2 = this.linkedGames; r10 = linkedGames2 == null ? void 0 : linkedGames2.find((item) => item.application?.type === ApplicationTypes.GAME)?.id; if (r10 == null) { r10 = null; } } return r10; } mergeFromApplicationUpdate(a0) { let id = a0.id; if (id == null) { id = this.id; } let name = a0.name; if (name == null) { name = this.name; } let icon = a0.icon; if (icon == null) { icon = this.icon; } let splash = a0.splash; if (splash == null) { splash = this.splash; } let overlay = a0.overlay; if (overlay == null) { overlay = this.overlay; } let overlayWarn = a0.overlayWarn; if (overlayWarn == null) { overlayWarn = this.overlayWarn; } let overlayCompatibilityHook = a0.overlayCompatibilityHook; if (overlayCompatibilityHook == null) { overlayCompatibilityHook = this.overlayCompatibilityHook; } let overlayMethods = a0.overlayMethods; if (overlayMethods == null) { overlayMethods = this.overlayMethods; } let hook = a0.hook; if (hook == null) { hook = this.hook; } let aliases = a0.aliases; if (aliases == null) { aliases = this.aliases; } let publishers = a0.publishers; if (publishers == null) { publishers = this.publishers; } let developers = a0.developers; if (developers == null) { developers = this.developers; } let primarySkuId = a0.primarySkuId; if (primarySkuId == null) { primarySkuId = this.primarySkuId; } let storeListingSkuId = a0.storeListingSkuId; if (storeListingSkuId == null) { storeListingSkuId = this.storeListingSkuId; } let thirdPartySkus = a0.thirdPartySkus; if (thirdPartySkus == null) { thirdPartySkus = this.thirdPartySkus; } let guildId = a0.guildId; if (guildId == null) { guildId = this.guildId; } let guild = a0.guild; if (guild == null) { guild = this.guild; } let executables = a0.executables; if (executables == null) { executables = this.executables; } let hashes = a0.hashes; if (hashes == null) { hashes = this.hashes; } let description = a0.description; if (description == null) { description = this.description; } let eulaId = a0.eulaId; if (eulaId == null) { eulaId = this.eulaId; } let slug = a0.slug; if (slug == null) { slug = this.slug; } let coverImage = a0.coverImage; if (coverImage == null) { coverImage = this.coverImage; } let bot = a0.bot; if (bot == null) { bot = this.bot; } let flags = a0.flags; if (flags == null) { flags = this.flags; } let maxParticipants = a0.maxParticipants; if (maxParticipants == null) { maxParticipants = this.maxParticipants; } let tags = a0.tags; if (tags == null) { tags = this.tags; } let embeddedActivityConfig = a0.embeddedActivityConfig; if (embeddedActivityConfig == null) { embeddedActivityConfig = this.embeddedActivityConfig != null ? { ...this.embeddedActivityConfig } : void 0; } let type = a0.type; if (type == null) { type = this.type; } let team = a0.team; if (team == null) { team = this.team; } let roleConnectionsVerificationUrl = a0.roleConnectionsVerificationUrl; if (roleConnectionsVerificationUrl == null) { roleConnectionsVerificationUrl = this.roleConnectionsVerificationUrl; } let _connectionEntrypointUrl = a0._connectionEntrypointUrl; if (_connectionEntrypointUrl == null) { _connectionEntrypointUrl = this._connectionEntrypointUrl; } let integrationTypesConfig2 = a0.integrationTypesConfig; if (integrationTypesConfig2 == null) { integrationTypesConfig2 = this.integrationTypesConfig; } let isMonetized = a0.isMonetized; if (isMonetized == null) { isMonetized = this.isMonetized; } let storefront_available = a0.storefront_available; if (storefront_available == null) { storefront_available = this.storefront_available; } let termsOfServiceUrl = a0.termsOfServiceUrl; if (termsOfServiceUrl == null) { termsOfServiceUrl = this.termsOfServiceUrl; } let privacyPolicyUrl = a0.privacyPolicyUrl; if (privacyPolicyUrl == null) { privacyPolicyUrl = this.privacyPolicyUrl; } let isVerified = a0.isVerified; if (isVerified == null) { isVerified = this.isVerified; } let customInstallUrl = a0.customInstallUrl; if (customInstallUrl == null) { customInstallUrl = this.customInstallUrl; } let installParams = a0.installParams; if (installParams == null) { installParams = this.installParams; } let isDiscoverable = a0.isDiscoverable; if (isDiscoverable == null) { isDiscoverable = this.isDiscoverable; } let directoryEntry = a0.directoryEntry; if (directoryEntry == null) { directoryEntry = this.directoryEntry; } let categories = a0.categories; if (categories == null) { categories = this.categories; } const linkedGames2 = a0.linkedGames; const linkedGames = this.linkedGames; const linkedGames3 = linkedGames2 != null ? linkedGames != null ? linkedGames2.map((item) => { if (item.application != null) { return item; } const r12 = linkedGames.find((linkedGame) => linkedGame.id === item.id); return r12?.application != null ? { ...item, application: r12.application } : item; }) : linkedGames2 : linkedGames; let deepLinkUri = a0.deepLinkUri; if (deepLinkUri == null) { deepLinkUri = this.deepLinkUri; } let applicationAccountLinkBenefitConfig = a0.applicationAccountLinkBenefitConfig; if (applicationAccountLinkBenefitConfig == null) { applicationAccountLinkBenefitConfig = this.applicationAccountLinkBenefitConfig; } let contentClassification = a0.contentClassification; if (contentClassification == null) { contentClassification = this.contentClassification; } let parentId = a0.parentId; if (parentId == null) { parentId = this.parentId; } return new ApplicationRecord({ id, name, icon, splash, overlay, overlayWarn, overlayCompatibilityHook, overlayMethods, hook, aliases, publishers, developers, primarySkuId, storeListingSkuId, thirdPartySkus, guildId, guild, executables, hashes, description, eulaId, slug, coverImage, bot, flags, maxParticipants, tags, embeddedActivityConfig, type, team, roleConnectionsVerificationUrl, _connectionEntrypointUrl, integrationTypesConfig: integrationTypesConfig2, isMonetized, storefront_available, termsOfServiceUrl, privacyPolicyUrl, isVerified, customInstallUrl, installParams, isDiscoverable, directoryEntry, categories, linkedGames: linkedGames3, deepLinkUri, applicationAccountLinkBenefitConfig, contentClassification, parentId }); } getMaxParticipants() { let maxParticipants = this.maxParticipants; if (maxParticipants == null) { maxParticipants = c2432_7[this.id]; } if (maxParticipants == null) { maxParticipants = 0; } return maxParticipants; } supportsIntegrationTypes(...args) { const integrationTypesConfig = this.integrationTypesConfig; return integrationTypesConfig != null && args.every((arg) => arg in integrationTypesConfig); } get destinationSkuId() { return this.storeListingSkuId != null ? this.storeListingSkuId : this.primarySkuId; } get supportsOutOfProcessOverlay() { return ApplicationRecord.supportsOutOfProcessOverlay(this.overlayMethods); } static supportsOutOfProcessOverlay(a0) { const OUT_OF_PROCESS = ApplicationOverlayMethodFlags.OUT_OF_PROCESS; return a0 != null && (a0 & OUT_OF_PROCESS) === OUT_OF_PROCESS; } } export default ApplicationRecord; export { createExecutable }; export { BasicApplicationRecord };