// Metro module 10638 (f10639). import DeveloperActivityShelfStore, { DevShelfFetchState } from "../DeveloperActivityShelfStore"; import { AbortCodes } from "../../../Constants"; import { intl, t } from "../../../intl/index.native"; import EmbeddedActivityClientError from "../../errors/EmbeddedActivityClientError"; import { DeveloperMode } from "../../user_settings/UserSettings"; import { fetchDeveloperApplications } from "../EmbeddedActivitiesActionCreators"; import InteractionCallbackError from "../../errors/InteractionCallbackError"; import { interactionCallbackErrorReason } from "../../interactions/InteractionUtils"; let c7139_7 = { ClientError: 0, 0: "ClientError", CallbackError: 1, 1: "CallbackError", ApiError: 2, 2: "ApiError" }; export { c7139_7 as ActivityLaunchFailErrorType }; export async function getActivityLaunchErrorInfo(c26768_0, c26768_1) { let r317; let c26768_2, c26768_4; let c30271_0, c30271_1, c30271_2, c30271_3, c30271_4, c30271_5; L46: { c26768_4 = void 0; c30271_0 = c26768_0; c30271_1 = c26768_1; c30271_2 = void 0; c30271_3 = void 0; c30271_4 = void 0; c30271_5 = void 0; c30271_5 = intl.string(t["IOy+I5"]); if (c26768_0 instanceof EmbeddedActivityClientError) { c30271_2 = c7139_7.ClientError; c30271_4 = c26768_0.reason; const fetchState = DeveloperActivityShelfStore.getFetchState(); if (DeveloperMode.getSetting() && fetchState !== DevShelfFetchState.LOADED) { await fetchDeveloperApplications(); const reason2 = c30271_0.reason; if (EmbeddedActivityClientError.Reasons.PRIMARY_APP_COMMAND_NOT_FOUND === reason2) { if (DeveloperActivityShelfStore.inDevModeForApplication(c30271_1)) { c30271_5 = intl.string(t.hXRXfz); } } else if (EmbeddedActivityClientError.Reasons.INVALID_CHANNEL === reason2) { c30271_5 = intl.string(t.j29zCr); } else if (EmbeddedActivityClientError.Reasons.LEGACY_LAUNCH_CLIENT_VALIDATION_FAILED === reason2) { c30271_3 = c30271_0.detailCode; } r317 = { message: c30271_5, errorType: c30271_2, errorStatus: c30271_3, errorCode: c30271_4 }; break L46; } const reason = c30271_0.reason; if (EmbeddedActivityClientError.Reasons.PRIMARY_APP_COMMAND_NOT_FOUND === reason) { if (DeveloperActivityShelfStore.inDevModeForApplication(c30271_1)) { c30271_5 = intl.string(t.hXRXfz); } } else if (EmbeddedActivityClientError.Reasons.INVALID_CHANNEL === reason) { c30271_5 = intl.string(t.j29zCr); } else if (EmbeddedActivityClientError.Reasons.LEGACY_LAUNCH_CLIENT_VALIDATION_FAILED === reason) { c30271_3 = c30271_0.detailCode; } } else if (c26768_0 instanceof InteractionCallbackError) { c30271_2 = c7139_7.CallbackError; c30271_4 = c26768_0.reason; const r71 = interactionCallbackErrorReason(c26768_0.reason, c26768_1); c26768_2 = r71; if (r71 == null) { c26768_2 = c30271_5; } c30271_5 = c26768_2; } else { c30271_2 = c7139_7.ApiError; c30271_3 = c26768_0.status; c30271_4 = c26768_0.code; const code = c26768_0.code; if (AbortCodes.INVALID_ACTIVITY_LAUNCH_NO_ACCESS === code) { c30271_5 = intl.string(t.GyzcrS); } else if (AbortCodes.INVALID_ACTIVITY_LAUNCH_PREMIUM_TIER === code) { c30271_5 = intl.string(t.zxv7EF); } else if (AbortCodes.INVALID_PERMISSIONS === code) { c30271_5 = intl.string(t.hHGrWz); } else if (AbortCodes.INVALID_ACTIVITY_LAUNCH_AFK_CHANNEL === code) { c30271_5 = intl.string(t.j29zCr); } else if (AbortCodes.INVALID_ACTIVITY_LAUNCH_AGE_GATED === code) { c30271_5 = intl.string(t["4WuFRE"]); } else if (AbortCodes.INVALID_ACTIVITY_LAUNCH_DEV_PREVIEW_GUILD_SIZE === code) { c30271_5 = intl.string(t.RvkXdb); } else if (AbortCodes.ACTIVITY_CONFIGURATION_DOES_NOT_SUPPORT_PLATFORM === code) { c30271_5 = intl.string(t.uGDCcw); } } return { message: c30271_5, errorType: c30271_2, errorStatus: c30271_3, errorCode: c30271_4 }; } return r317; }