This commit is contained in:
janisslsm committed 2026-11-01 12:12:55 +02:00
1 parent 1781d25a15
commit 732c0ad767
33051 files changed
+2591613 -3019689

No files matched your search

@@ -0,0 +1,121 @@
// Metro module 15769 (f15770).
import AuthorizedAppsStore from "../oauth2/AuthorizedAppsStore";
import AccountLinkStore from "./AccountLinkStore";
import { AppStates, Endpoints } from "../../Constants";
import Durations from "../../utils/Durations";
import { HTTP } from "../../_bundle/sendRequest";
import AutomaticLifecycleManager from "../../lib/AutomaticLifecycleManager";
let c11269_8 = 20 * Durations.Millis.MINUTE;
class AccountLinkManager extends AutomaticLifecycleManager {
static displayName = "AccountLinkManager";
actions = {
OAUTH2_TOKEN_CREATE: (a0) => this.handleOAuth2TokenCreate(a0),
USER_AUTHORIZED_APPS_UPDATE: () => this.handleAuthorizedAppsUpdate(),
APP_STATE_UPDATE: (a0) => this.handleAppStateUpdate(a0),
ACCOUNT_LINK_AUTHORIZATION_COMPLETED: (a0) => this.handleAccountLinkAuthorizationCompleted(a0)
};
evaluatePending() {
const pendingAuthorizations = AccountLinkStore.getPendingAuthorizations();
if (pendingAuthorizations.size !== 0) {
const r6 = Date.now();
for (const item of pendingAuthorizations) {
const [r37, r38] = item;
if (r6 - r38.startedAt > c11269_8) {
AccountLinkStore.deletePendingAuthorization(r37);
const accountLinkCallbacks2 = r38.accountLinkCallbacks;
if (accountLinkCallbacks2 != null) {
const onError = accountLinkCallbacks2.onError;
if (onError != null) {
onError.call(accountLinkCallbacks2, "Account link authorization timed out");
}
}
} else if (AuthorizedAppsStore.getNewestTokenForApplication(r37) != null) {
const accountLinkCallbacks = r38.accountLinkCallbacks;
if (accountLinkCallbacks != null) {
const onSuccess = accountLinkCallbacks.onSuccess;
if (onSuccess != null) {
onSuccess.call(accountLinkCallbacks);
}
}
AccountLinkStore.deletePendingAuthorization(r37);
}
}
}
}
handleOAuth2TokenCreate(a0) {
if (AccountLinkStore.getPendingAuthorizations().has(a0.application.id)) {
this.evaluatePending();
}
}
handleAuthorizedAppsUpdate() {
this.evaluatePending();
}
handleAccountLinkAuthorizationCompleted(a0) {
if (AccountLinkStore.getPendingAuthorizations().has(a0.applicationId)) {
this.evaluatePending();
}
}
handleAppStateUpdate(a0) {
if (a0.state === AppStates.ACTIVE) {
this.evaluatePending();
}
}
}
const accountLinkManager = new AccountLinkManager();
export default accountLinkManager;
export async function claimIncentivizedAccountLinkingReward(c28153_0) {
let c28153_3;
let c28153_4 = 0;
let c30918_0, c30918_1, c30918_2, c30918_3;
L14: {
try {
c30918_0 = void 0;
c30918_1 = void 0;
c30918_2 = void 0;
c30918_0 = c28153_0.applicationId;
c30918_1 = c28153_0.onSuccess;
c30918_2 = c28153_0.onError;
await void 0;
c28153_4 = 1;
await HTTP.post({
url: Endpoints.OAUTH2_ACCOUNT_LINKING_ACHIEVEMENT,
body: {
application_id: c30918_0
},
rejectWithError: true
});
const r77 = c30918_1;
if (r77 != null) {
r77();
}
c28153_4 = 0;
} catch ($e) {
const r27 = $e;
let r8 = r27;
c28153_3 = r27;
if (c28153_4 !== 0) {
while (true) {
try {
const r86 = c28153_3;
c28153_4 = 0;
c30918_3 = r86;
const r88 = c30918_2;
if (r88 == null) {
break L14;
}
r88(c30918_3);
break L14;
} catch (r83) {
r8 = r83;
c28153_3 = r83;
if (c28153_4 === 0) {
break;
}
}
}
}
throw r8;
}
}
}
export { AccountLinkManager };
@@ -0,0 +1,36 @@
// Metro module 15770 (f15771).
import AuthorizedAppsStore from "../oauth2/AuthorizedAppsStore";
import Module589 from "../../_bundle/Module589";
import Dispatcher from "../../Dispatcher";
let c11270_1 = new Map();
let c11270_2 = new Set();
class AccountLinkStore extends Module589.Store {
static displayName = "AccountLinkStore";
initialize() {
this.waitFor(AuthorizedAppsStore);
}
getPendingAuthorizations() {
return c11270_1;
}
deletePendingAuthorization(a0) {
c11270_1.delete(a0);
}
getGloballyDisabledAuthorizationFlows() {
return c11270_2;
}
}
const accountLinkStore = new AccountLinkStore(Dispatcher, {
ACCOUNT_LINK_AUTHORIZATION_STARTED: function handleAuthorizationStarted(a0) {
if (AuthorizedAppsStore.getNewestTokenForApplication(a0.applicationId) == null && a0.accountLinkCallbacks != null) {
c11270_1.set(a0.applicationId, {
applicationId: a0.applicationId,
startedAt: Date.now(),
accountLinkCallbacks: a0.accountLinkCallbacks
});
}
},
ACCOUNT_LINK_DEVTOOLS_SET_GLOBALLY_DISBLED_FLOWS: function handleSetGloballyDisabledFlows(a0) {
c11270_2 = new Set(a0.flows);
}
});
export default accountLinkStore;
@@ -0,0 +1,132 @@
// Metro module 2837 (f2838).
import { loadJsonAsset } from "../asset_json/native/AssetJsonUtils";
import * as _Module2838 from "../../_bundle/Module2838";
import * as _Module2839 from "../../_bundle/Module2839";
import * as _Module2840 from "../../_bundle/Module2840";
import * as _Module2841 from "../../_bundle/Module2841";
import * as _Module2842 from "../../_bundle/Module2842";
import * as _Module2843 from "../../_bundle/Module2843";
import * as _Module2844 from "../../_bundle/Module2844";
import * as _Module2845 from "../../_bundle/Module2845";
import * as _Module2846 from "../../_bundle/Module2846";
import * as _Module2847 from "../../_bundle/Module2847";
import * as _Module2848 from "../../_bundle/Module2848";
import * as _Module2849 from "../../_bundle/Module2849";
import * as _Module2850 from "../../_bundle/Module2850";
import * as _Module2851 from "../../_bundle/Module2851";
import * as _Module2852 from "../../_bundle/Module2852";
import * as _Module2853 from "../../_bundle/Module2853";
import * as _Module2854 from "../../_bundle/Module2854";
import * as _Module2855 from "../../_bundle/Module2855";
import * as _Module2856 from "../../_bundle/Module2856";
import * as _Module2857 from "../../_bundle/Module2857";
import * as _Module2858 from "../../_bundle/Module2858";
import * as _Module2859 from "../../_bundle/Module2859";
import * as _Module2860 from "../../_bundle/Module2860";
import * as _Module2861 from "../../_bundle/Module2861";
import * as _Module2862 from "../../_bundle/Module2862";
import * as _Module2863 from "../../_bundle/Module2863";
import * as _Module2864 from "../../_bundle/Module2864";
import * as _Module2865 from "../../_bundle/Module2865";
import * as _Module2866 from "../../_bundle/Module2866";
import * as _Module2867 from "../../_bundle/Module2867";
import * as _Module2868 from "../../_bundle/Module2868";
import { createLoader, makeMessagesProxy } from "../../_bundle/Module1274";
const loader = createLoader({
bg: () => loadJsonAsset(_Module2838).then((result) => ({
default: result
})),
cs: () => loadJsonAsset(_Module2839).then((result) => ({
default: result
})),
da: () => loadJsonAsset(_Module2840).then((result) => ({
default: result
})),
de: () => loadJsonAsset(_Module2841).then((result) => ({
default: result
})),
el: () => loadJsonAsset(_Module2842).then((result) => ({
default: result
})),
"en-GB": () => loadJsonAsset(_Module2843).then((result) => ({
default: result
})),
"es-419": () => loadJsonAsset(_Module2844).then((result) => ({
default: result
})),
"es-ES": () => loadJsonAsset(_Module2845).then((result) => ({
default: result
})),
fi: () => loadJsonAsset(_Module2846).then((result) => ({
default: result
})),
fr: () => loadJsonAsset(_Module2847).then((result) => ({
default: result
})),
hi: () => loadJsonAsset(_Module2848).then((result) => ({
default: result
})),
hr: () => loadJsonAsset(_Module2849).then((result) => ({
default: result
})),
hu: () => loadJsonAsset(_Module2850).then((result) => ({
default: result
})),
it: () => loadJsonAsset(_Module2851).then((result) => ({
default: result
})),
ja: () => loadJsonAsset(_Module2852).then((result) => ({
default: result
})),
ko: () => loadJsonAsset(_Module2853).then((result) => ({
default: result
})),
lt: () => loadJsonAsset(_Module2854).then((result) => ({
default: result
})),
nl: () => loadJsonAsset(_Module2855).then((result) => ({
default: result
})),
no: () => loadJsonAsset(_Module2856).then((result) => ({
default: result
})),
pl: () => loadJsonAsset(_Module2857).then((result) => ({
default: result
})),
"pt-BR": () => loadJsonAsset(_Module2858).then((result) => ({
default: result
})),
ro: () => loadJsonAsset(_Module2859).then((result) => ({
default: result
})),
ru: () => loadJsonAsset(_Module2860).then((result) => ({
default: result
})),
"sv-SE": () => loadJsonAsset(_Module2861).then((result) => ({
default: result
})),
th: () => loadJsonAsset(_Module2862).then((result) => ({
default: result
})),
tr: () => loadJsonAsset(_Module2863).then((result) => ({
default: result
})),
uk: () => loadJsonAsset(_Module2864).then((result) => ({
default: result
})),
vi: () => loadJsonAsset(_Module2865).then((result) => ({
default: result
})),
"zh-CN": () => loadJsonAsset(_Module2866).then((result) => ({
default: result
})),
"zh-TW": () => loadJsonAsset(_Module2867).then((result) => ({
default: result
})),
"en-US": () => loadJsonAsset(_Module2868).then((result) => ({
default: result
}))
}, "en-US");
const r51 = makeMessagesProxy(loader);
export default r51;
export { loader as messagesLoader };
@@ -0,0 +1,21 @@
// Metro module 5524 (f5525).
import Dispatcher from "../../Dispatcher";
export function accountLinkAuthorizationStarted(a0, a1) {
Dispatcher.dispatch({
type: "ACCOUNT_LINK_AUTHORIZATION_STARTED",
applicationId: a0,
accountLinkCallbacks: a1
});
}
export function accountLinkAuthorizationCompleted(a0) {
Dispatcher.dispatch({
type: "ACCOUNT_LINK_AUTHORIZATION_COMPLETED",
applicationId: a0
});
}
export function devtoolsSetGloballyDisabledAuthorizationFlows(a0) {
Dispatcher.dispatch({
type: "ACCOUNT_LINK_DEVTOOLS_SET_GLOBALLY_DISBLED_FLOWS",
flows: a0
});
}
@@ -0,0 +1,132 @@
// Metro module 2773 (f2774).
import { loadJsonAsset } from "../asset_json/native/AssetJsonUtils";
import * as _Module2774 from "../../_bundle/Module2774";
import * as _Module2775 from "../../_bundle/Module2775";
import * as _Module2776 from "../../_bundle/Module2776";
import * as _Module2777 from "../../_bundle/Module2777";
import * as _Module2778 from "../../_bundle/Module2778";
import * as _Module2779 from "../../_bundle/Module2779";
import * as _Module2780 from "../../_bundle/Module2780";
import * as _Module2781 from "../../_bundle/Module2781";
import * as _Module2782 from "../../_bundle/Module2782";
import * as _Module2783 from "../../_bundle/Module2783";
import * as _Module2784 from "../../_bundle/Module2784";
import * as _Module2785 from "../../_bundle/Module2785";
import * as _Module2786 from "../../_bundle/Module2786";
import * as _Module2787 from "../../_bundle/Module2787";
import * as _Module2788 from "../../_bundle/Module2788";
import * as _Module2789 from "../../_bundle/Module2789";
import * as _Module2790 from "../../_bundle/Module2790";
import * as _Module2791 from "../../_bundle/Module2791";
import * as _Module2792 from "../../_bundle/Module2792";
import * as _Module2793 from "../../_bundle/Module2793";
import * as _Module2794 from "../../_bundle/Module2794";
import * as _Module2795 from "../../_bundle/Module2795";
import * as _Module2796 from "../../_bundle/Module2796";
import * as _Module2797 from "../../_bundle/Module2797";
import * as _Module2798 from "../../_bundle/Module2798";
import * as _Module2799 from "../../_bundle/Module2799";
import * as _Module2800 from "../../_bundle/Module2800";
import * as _Module2801 from "../../_bundle/Module2801";
import * as _Module2802 from "../../_bundle/Module2802";
import * as _Module2803 from "../../_bundle/Module2803";
import * as _Module2804 from "../../_bundle/Module2804";
import { createLoader, makeMessagesProxy } from "../../_bundle/Module1274";
const loader = createLoader({
bg: () => loadJsonAsset(_Module2774).then((result) => ({
default: result
})),
cs: () => loadJsonAsset(_Module2775).then((result) => ({
default: result
})),
da: () => loadJsonAsset(_Module2776).then((result) => ({
default: result
})),
de: () => loadJsonAsset(_Module2777).then((result) => ({
default: result
})),
el: () => loadJsonAsset(_Module2778).then((result) => ({
default: result
})),
"en-GB": () => loadJsonAsset(_Module2779).then((result) => ({
default: result
})),
"es-419": () => loadJsonAsset(_Module2780).then((result) => ({
default: result
})),
"es-ES": () => loadJsonAsset(_Module2781).then((result) => ({
default: result
})),
fi: () => loadJsonAsset(_Module2782).then((result) => ({
default: result
})),
fr: () => loadJsonAsset(_Module2783).then((result) => ({
default: result
})),
hi: () => loadJsonAsset(_Module2784).then((result) => ({
default: result
})),
hr: () => loadJsonAsset(_Module2785).then((result) => ({
default: result
})),
hu: () => loadJsonAsset(_Module2786).then((result) => ({
default: result
})),
it: () => loadJsonAsset(_Module2787).then((result) => ({
default: result
})),
ja: () => loadJsonAsset(_Module2788).then((result) => ({
default: result
})),
ko: () => loadJsonAsset(_Module2789).then((result) => ({
default: result
})),
lt: () => loadJsonAsset(_Module2790).then((result) => ({
default: result
})),
nl: () => loadJsonAsset(_Module2791).then((result) => ({
default: result
})),
no: () => loadJsonAsset(_Module2792).then((result) => ({
default: result
})),
pl: () => loadJsonAsset(_Module2793).then((result) => ({
default: result
})),
"pt-BR": () => loadJsonAsset(_Module2794).then((result) => ({
default: result
})),
ro: () => loadJsonAsset(_Module2795).then((result) => ({
default: result
})),
ru: () => loadJsonAsset(_Module2796).then((result) => ({
default: result
})),
"sv-SE": () => loadJsonAsset(_Module2797).then((result) => ({
default: result
})),
th: () => loadJsonAsset(_Module2798).then((result) => ({
default: result
})),
tr: () => loadJsonAsset(_Module2799).then((result) => ({
default: result
})),
uk: () => loadJsonAsset(_Module2800).then((result) => ({
default: result
})),
vi: () => loadJsonAsset(_Module2801).then((result) => ({
default: result
})),
"zh-CN": () => loadJsonAsset(_Module2802).then((result) => ({
default: result
})),
"zh-TW": () => loadJsonAsset(_Module2803).then((result) => ({
default: result
})),
"en-US": () => loadJsonAsset(_Module2804).then((result) => ({
default: result
}))
}, "en-US");
const r51 = makeMessagesProxy(loader);
export default r51;
export { loader as messagesLoader };
@@ -0,0 +1,10 @@
// Metro module 5519 (f5520).
const r15 = {
RPC: "rpc",
WEB: "web"
};
const date = new Date("2026-07-10Z-07:00");
const date2 = new Date("2026-09-22Z-07:00");
export { r15 as AuthorizeFlow };
export { date as RIOT_CONNECTION_DEPRECATION_DATE };
export { date2 as BATTLENET_CONNECTION_DEPRECATION_DATE };
@@ -0,0 +1,132 @@
// Metro module 2869 (f2870).
import { loadJsonAsset } from "../asset_json/native/AssetJsonUtils";
import * as _Module2838 from "../../_bundle/Module2838";
import * as _Module2839 from "../../_bundle/Module2839";
import * as _Module2840 from "../../_bundle/Module2840";
import * as _Module2841 from "../../_bundle/Module2841";
import * as _Module2842 from "../../_bundle/Module2842";
import * as _Module2843 from "../../_bundle/Module2843";
import * as _Module2844 from "../../_bundle/Module2844";
import * as _Module2845 from "../../_bundle/Module2845";
import * as _Module2846 from "../../_bundle/Module2846";
import * as _Module2847 from "../../_bundle/Module2847";
import * as _Module2848 from "../../_bundle/Module2848";
import * as _Module2849 from "../../_bundle/Module2849";
import * as _Module2850 from "../../_bundle/Module2850";
import * as _Module2851 from "../../_bundle/Module2851";
import * as _Module2852 from "../../_bundle/Module2852";
import * as _Module2853 from "../../_bundle/Module2853";
import * as _Module2854 from "../../_bundle/Module2854";
import * as _Module2855 from "../../_bundle/Module2855";
import * as _Module2856 from "../../_bundle/Module2856";
import * as _Module2857 from "../../_bundle/Module2857";
import * as _Module2858 from "../../_bundle/Module2858";
import * as _Module2859 from "../../_bundle/Module2859";
import * as _Module2860 from "../../_bundle/Module2860";
import * as _Module2861 from "../../_bundle/Module2861";
import * as _Module2862 from "../../_bundle/Module2862";
import * as _Module2863 from "../../_bundle/Module2863";
import * as _Module2864 from "../../_bundle/Module2864";
import * as _Module2865 from "../../_bundle/Module2865";
import * as _Module2866 from "../../_bundle/Module2866";
import * as _Module2867 from "../../_bundle/Module2867";
import * as _Module2870 from "../../_bundle/Module2870";
import { createLoader, makeMessagesProxy } from "../../_bundle/Module1274";
const loader = createLoader({
bg: () => loadJsonAsset(_Module2838).then((result) => ({
default: result
})),
cs: () => loadJsonAsset(_Module2839).then((result) => ({
default: result
})),
da: () => loadJsonAsset(_Module2840).then((result) => ({
default: result
})),
de: () => loadJsonAsset(_Module2841).then((result) => ({
default: result
})),
el: () => loadJsonAsset(_Module2842).then((result) => ({
default: result
})),
"en-GB": () => loadJsonAsset(_Module2843).then((result) => ({
default: result
})),
"es-419": () => loadJsonAsset(_Module2844).then((result) => ({
default: result
})),
"es-ES": () => loadJsonAsset(_Module2845).then((result) => ({
default: result
})),
fi: () => loadJsonAsset(_Module2846).then((result) => ({
default: result
})),
fr: () => loadJsonAsset(_Module2847).then((result) => ({
default: result
})),
hi: () => loadJsonAsset(_Module2848).then((result) => ({
default: result
})),
hr: () => loadJsonAsset(_Module2849).then((result) => ({
default: result
})),
hu: () => loadJsonAsset(_Module2850).then((result) => ({
default: result
})),
it: () => loadJsonAsset(_Module2851).then((result) => ({
default: result
})),
ja: () => loadJsonAsset(_Module2852).then((result) => ({
default: result
})),
ko: () => loadJsonAsset(_Module2853).then((result) => ({
default: result
})),
lt: () => loadJsonAsset(_Module2854).then((result) => ({
default: result
})),
nl: () => loadJsonAsset(_Module2855).then((result) => ({
default: result
})),
no: () => loadJsonAsset(_Module2856).then((result) => ({
default: result
})),
pl: () => loadJsonAsset(_Module2857).then((result) => ({
default: result
})),
"pt-BR": () => loadJsonAsset(_Module2858).then((result) => ({
default: result
})),
ro: () => loadJsonAsset(_Module2859).then((result) => ({
default: result
})),
ru: () => loadJsonAsset(_Module2860).then((result) => ({
default: result
})),
"sv-SE": () => loadJsonAsset(_Module2861).then((result) => ({
default: result
})),
th: () => loadJsonAsset(_Module2862).then((result) => ({
default: result
})),
tr: () => loadJsonAsset(_Module2863).then((result) => ({
default: result
})),
uk: () => loadJsonAsset(_Module2864).then((result) => ({
default: result
})),
vi: () => loadJsonAsset(_Module2865).then((result) => ({
default: result
})),
"zh-CN": () => loadJsonAsset(_Module2866).then((result) => ({
default: result
})),
"zh-TW": () => loadJsonAsset(_Module2867).then((result) => ({
default: result
})),
"en-US": () => loadJsonAsset(_Module2870).then((result) => ({
default: result
}))
}, "en-US");
const r51 = makeMessagesProxy(loader);
export default r51;
export { loader as messagesLoader };
@@ -0,0 +1,28 @@
// Metro module 15165 (f15166).
import { createApexExperiment } from "../../experiments/apex/index";
const r13 = {
MEDIUM: "medium",
LARGE: "large"
};
const apexExperiment = createApexExperiment({
name: "2026-02-mobile-account-linking",
kind: "user",
defaultConfig: {
enabled: false
},
variations: {
0: {
enabled: false
},
1: {
enabled: true,
bannerSize: r13.LARGE
},
2: {
enabled: true,
bannerSize: r13.MEDIUM
}
}
});
export default apexExperiment;
export { r13 as MobileAccountLinkingBannerSize };
@@ -0,0 +1,50 @@
// Metro module 4216 (f4217).
import { createApexExperiment } from "../../experiments/apex/index";
const variations = {
0: {
enabled: false
},
1: {
enabled: true
}
};
const defaultConfig = {
enabled: false
};
const apexExperiment = createApexExperiment({
name: "2026-04-riot-social-sdk-migration",
kind: "user",
defaultConfig,
variations
});
const apexExperiment2 = createApexExperiment({
name: "2026-05-riot-social-sdk-migration-us--canada",
kind: "user",
defaultConfig,
variations
});
const apexExperiment3 = createApexExperiment({
name: "2026-05-riot-social-sdk-migration-all-regions",
kind: "user",
defaultConfig,
variations
});
const apexExperiment4 = createApexExperiment({
name: "2026-06-battlenet-social-sdk-migration",
kind: "user",
defaultConfig,
variations
});
export function useIsRiotSocialSDKMigrationEnabled(a0) {
const config = apexExperiment.useConfig(a0);
const config2 = apexExperiment2.useConfig(a0);
const config3 = apexExperiment3.useConfig(a0);
return config.enabled || config2.enabled || config3.enabled;
}
export function getIsRiotSocialSDKMigrationEnabled(a0) {
const config = apexExperiment.getConfig(a0);
const config2 = apexExperiment2.getConfig(a0);
const config3 = apexExperiment3.getConfig(a0);
return config.enabled || config2.enabled || config3.enabled;
}
export { apexExperiment4 as battlenetSocialSDKMigrationExperiment };
@@ -0,0 +1,37 @@
// Metro module 4217 (f4218).
import { createApexExperiment } from "../../experiments/apex/index";
const variations = {
0: {
enabled: false
},
1: {
enabled: true
}
};
const defaultConfig = {
enabled: false
};
const apexExperiment = createApexExperiment({
name: "2026-04-valorant-social-sdk",
kind: "user",
defaultConfig,
variations
});
const apexExperiment2 = createApexExperiment({
name: "2026-05-valorant-social-sdk-us--canada",
kind: "user",
defaultConfig,
variations
});
const apexExperiment3 = createApexExperiment({
name: "2026-05-valorant-social-sdk-all-regions",
kind: "user",
defaultConfig,
variations
});
export function getIsValorantSocialSDKEnabled(a0) {
const config = apexExperiment.getConfig(a0);
const config2 = apexExperiment2.getConfig(a0);
const config3 = apexExperiment3.getConfig(a0);
return config.enabled || config2.enabled || config3.enabled;
}
@@ -0,0 +1,67 @@
// Metro module 5520 (f5521).
import { useMemo } from "react";
import ApplicationStore from "../../applications/ApplicationStore";
import ApplicationRecord from "../../../records/ApplicationRecord";
import { ApplicationTypes } from "../../applications/ApplicationConstants";
import { GameLinkTypes } from "../../../flow/Server";
import { useGetOrFetchApplication } from "../../applications/useGetOrFetchApplications";
let $mk76428 = function() {
return (a0) => a0.type === GameLinkTypes.OFFICIAL;
};
export function getAuthorizationApp(a0) {
if (a0 == null) {
return null;
}
if (a0.type !== ApplicationTypes.GAME) {
return a0;
}
const linkedGames = a0.linkedGames;
const r7 = linkedGames == null ? void 0 : linkedGames.find($mk76428());
let r13 = r7?.application;
if (r13 == null) {
r13 = ApplicationStore.getApplication(r7?.id);
}
if (r13 == null) {
r13 = null;
}
return r13;
}
export function useAuthorizationApp(a0) {
const getOrFetchApplication = useGetOrFetchApplication(a0 == null ? void 0 : a0 instanceof ApplicationRecord ? void 0 : a0.getOfficialApplicationId());
return useMemo(() => {
let r12;
const r1 = a0 == null;
let r2 = null;
if (!r1) {
if (a0 instanceof ApplicationRecord) {
const r13 = a0 == null;
let r14 = null;
if (!r13) {
const type = a0.type;
const GAME = ApplicationTypes.GAME;
r14 = a0;
if (type === GAME) {
const linkedGames = a0.linkedGames;
const r9 = linkedGames == null ? void 0 : linkedGames.find($mk76428());
let r20 = r9?.application;
if (r20 == null) {
r20 = ApplicationStore.getApplication(r9?.id);
}
if (r20 == null) {
r20 = null;
}
r14 = r20;
}
}
r12 = r14;
} else {
r12 = getOrFetchApplication;
if (getOrFetchApplication == null) {
r12 = null;
}
}
r2 = r12;
}
return r2;
}, [a0, getOrFetchApplication]);
}
@@ -0,0 +1,54 @@
// Metro module 5522 (f5523).
import { useEffect, useMemo } from "react";
import AuthorizedAppsStore, { FetchState } from "../../oauth2/AuthorizedAppsStore";
import { useStateFromStoresArray, useStateFromStores } from "../../../_bundle/Module589";
import { isNotNullish } from "../../../utils/GlobalUtils";
import AuthorizedAppsActionCreators from "../../oauth2/AuthorizedAppsActionCreators";
const useAuthorizedAppsTokens = function useAuthorizedAppsTokens(a0, a1) {
let stateFromStoresArray;
const disableFetch2 = (a1 == null ? {} : a1).disableFetch;
const disableFetch = disableFetch2 !== void 0 && disableFetch2;
const stateFromStoresArray2 = useStateFromStoresArray([AuthorizedAppsStore], () => {
let r8 = a0 == null ? void 0 : a0.map((item) => AuthorizedAppsStore.getNewestTokenForApplication(item)).filter(isNotNullish);
if (r8 == null) {
r8 = [];
}
return r8;
}, [a0]);
const stateFromStores = useStateFromStores([AuthorizedAppsStore], () => {
let r6 = a0 == null ? void 0 : a0.every((item) => AuthorizedAppsStore.getFetchStateForApplication(item) === FetchState.FETCHED);
if (r6 == null) {
r6 = false;
}
return r6;
}, [a0]);
stateFromStoresArray = useStateFromStoresArray([AuthorizedAppsStore], () => {
let r6 = a0 == null ? void 0 : a0.filter((item) => AuthorizedAppsStore.getFetchStateForApplication(item) === FetchState.NOT_FETCHED);
if (r6 == null) {
r6 = [];
}
return r6;
}, [a0]);
useEffect(() => {
let r3 = disableFetch;
if (!disableFetch) {
r3 = stateFromStoresArray.length === 0;
}
if (!r3) {
AuthorizedAppsActionCreators.fetch(stateFromStoresArray);
}
}, [disableFetch, stateFromStoresArray]);
return {
tokens: stateFromStoresArray2,
fetched: stateFromStores
};
};
export { useAuthorizedAppsTokens };
export function useAuthorizedAppsToken(a0, a1) {
const authorizedAppsTokens = useAuthorizedAppsTokens(useMemo(() => a0 != null ? [a0] : null, [a0]), a1);
const tokens = authorizedAppsTokens.tokens;
return {
token: tokens.length > 0 ? tokens[0] : null,
fetched: authorizedAppsTokens.fetched
};
}
@@ -0,0 +1,82 @@
// Metro module 5534 (f5535).
import { useCallback } from "react";
import ConnectedAccountsStore from "../../../stores/ConnectedAccountsStore";
import { useStateFromStores } from "../../../_bundle/Module589";
import ConnectedAccountsActionCreators from "../../../actions/ConnectedAccountsActionCreators";
let env3402 = {};
export function useProviderConnection(a0) {
let env14907 = {
$parent: env3402
};
env14907[0] = a0;
const stateFromStores = useStateFromStores([ConnectedAccountsStore], () => {
const r5 = env14907[0];
return r5 != null ? ConnectedAccountsStore.getAccount(null, r5) : null;
});
const stateFromStores2 = useStateFromStores([ConnectedAccountsStore], () => ConnectedAccountsStore.isFetching());
const hasConnection = stateFromStores != null && !stateFromStores.revoked;
let c14908_0 = async (c29521_0) => {
let r59;
let location2;
let c29521_5 = 0;
let c31373_0;
L20: {
try {
c31373_0 = void 0;
const r18 = env14907[0];
if (r18 == null) {
break L20;
}
c29521_5 = 1;
location2 = c29521_0;
if (c29521_0 == null) {
location2 = "Account Linking";
}
c31373_0 = await ConnectedAccountsActionCreators.authorize(r18, {
location: location2
});
r59 = c31373_0.ok ? c31373_0.body?.url != null ? {
success: true,
url: c31373_0.body.url
} : {
success: false
} : {
success: false
};
c29521_5 = 0;
} catch ($e) {
let r7 = $e;
if (c29521_5 !== 0) {
while (true) {
try {
c29521_5 = 0;
} catch ($e) {
r7 = $e;
if (c29521_5 === 0) {
break;
}
continue;
}
return {
success: false
};
}
}
throw r7;
}
return r59;
}
return {
success: false
};
};
return {
loading: stateFromStores2,
hasConnection,
canConnect: a0 != null,
startConnection: useCallback(function() {
return c14908_0.apply(this, arguments);
}, [a0]),
account: stateFromStores
};
}
@@ -0,0 +1,197 @@
// Metro module 15164 (f15165).
import { memo } from "react";
import { Image as Image2, View } from "react-native";
import UserStore from "../../../stores/UserStore";
import { ContentDismissActionType } from "../../dismissible_content/DismissibleContentConstants";
import Module712 from "../../../_bundle/Module712";
import GameIcon, { GameIconSizes, GameIconImageSize } from "../../game_detection/native/GameIcon";
import mobileAccountLinkingExperiment, { MobileAccountLinkingBannerSize } from "../experiments/mobileAccountLinkingExperiment";
import { scaleTextLineHeight } from "../../screen/native/useScaledTextLineHeight.android";
import { MEDIUM_BUTTON_HEIGHT, SMALL_BUTTON_HEIGHT } from "../../../design/components/Button/native/ButtonConstants.native";
import { createStyles } from "../../../design/components/Styles/native/createStyles";
import { useStateFromStores } from "../../../_bundle/defaultAreStatesEqual";
import useAnalyticsLocations from "../../app_analytics/useAnalyticsLocations";
import AnalyticsLocation from "../../app_analytics/AnalyticsLocation";
import { Card } from "../../../design/components/Card/native/Card.native";
import { PressableOpacity } from "../../../design/void/Pressables/native/Pressables";
import { XSmallIcon } from "../../../design/components/Icon/native/redesign/generated/XSmallIcon";
import { Avatar, AvatarSizes } from "../../../design/void/native";
import { Text } from "../../../design/components/Text/native/Text";
import { intl, t } from "../../../intl/index.native";
import { Button } from "../../../design/components/Button/native/Button.native";
import { ExperimentalGameControllerLinkIcon } from "../../../design/components/Icon/native/redesign/generated/ExperimentalGameControllerLinkIcon";
let PX_8, PX_82, PX_12, PX_16, PX_4, NORMAL, c10760_16, variant, variant2, PX_162, PX_122, useStyles, useStyles2, AccountLinkMediumBanner;
const AccountLinkLargeBanner = function AccountLinkLargeBanner(props) {
let analyticsLocations;
const { application, markAsDismissed, startAuthorization } = props;
analyticsLocations = void 0;
const styles = useStyles();
const stateFromStores = useStateFromStores([UserStore], () => UserStore.getCurrentUser());
analyticsLocations = useAnalyticsLocations(AnalyticsLocation.MOBILE_ACCOUNT_LINK_LARGE_BANNER).analyticsLocations;
const name = application.name;
const reward_name = application.applicationAccountLinkBenefitConfig?.reward_name;
return reward_name == null ? null : <Card variant="secondary" style={styles.card}>
<PressableOpacity accessibilityRole="button" onPress={() => markAsDismissed(ContentDismissActionType.USER_DISMISS)} style={styles.closeButton}>
<XSmallIcon size="sm" color="text-muted" />
</PressableOpacity>
<View style={styles.imagesContainer}>
<GameIcon game={application} size={NORMAL} />
<View style={styles.ellipsisContainer}>
<View style={styles.ellipsisDot} />
<View style={styles.ellipsisDot} />
<View style={styles.ellipsisDot} />
</View>
<Avatar user={stateFromStores} size={AvatarSizes.LARGE_48} guildId={void 0} />
</View>
<Text variant={variant} color="mobile-text-heading-primary" style={styles.title}>
{intl.formatToPlainString(t["3gpxqO"], {
gameName: name
})}
</Text>
<Text variant={variant2} color="text-muted" style={styles.body}>
{intl.formatToPlainString(t.vxvKMm, {
rewardName: reward_name
})}
</Text>
<View style={styles.ctaContainer}>
<Button variant="secondary" size="md" text={intl.string(t["0mvtKL"])} onPress={() => {
startAuthorization({
analyticsLocations
});
}} icon={<ExperimentalGameControllerLinkIcon size="sm" />} />
</View>
</Card>;
};
AccountLinkMediumBanner = function AccountLinkMediumBanner(props) {
const { application, markAsDismissed: markAsDismissed2, startAuthorization: startAuthorization2 } = props;
const styles2 = useStyles2();
const analyticsLocations2 = useAnalyticsLocations(AnalyticsLocation.MOBILE_ACCOUNT_LINK_MEDIUM_BANNER).analyticsLocations;
const name = application.name;
const reward_name = application.applicationAccountLinkBenefitConfig?.reward_name;
const reward_image = application.applicationAccountLinkBenefitConfig?.reward_image;
return reward_name == null ? null : reward_image == null ? null : <Card variant="secondary" style={styles2.card}>
<View style={styles2.contentContainer}>
<Image2 source={{
uri: reward_image
}} style={styles2.rewardImage} resizeMode="contain" />
<Text variant="heading-sm/semibold" color="mobile-text-heading-primary" style={styles2.bodyText}>
{intl.formatToPlainString(t["V/C76E"], {
gameName: name,
rewardName: reward_name
})}
</Text>
<PressableOpacity accessibilityRole="button" onPress={() => markAsDismissed2(ContentDismissActionType.USER_DISMISS)} style={styles2.closeButton}>
<XSmallIcon size="sm" color="text-muted" />
</PressableOpacity>
</View>
<View style={styles2.ctaContainer}>
<Button variant="secondary" size="sm" text={intl.string(t["0mvtKL"])} onPress={() => {
startAuthorization2({
analyticsLocations: analyticsLocations2
});
}} icon={<ExperimentalGameControllerLinkIcon size="xs" />} />
</View>
</Card>;
};
PX_8 = Module712.space.PX_8;
PX_82 = Module712.space.PX_8;
PX_12 = Module712.space.PX_12;
PX_16 = Module712.space.PX_16;
PX_4 = Module712.space.PX_4;
NORMAL = GameIconSizes.NORMAL;
c10760_16 = GameIconImageSize[NORMAL];
variant = "heading-md/bold";
variant2 = "text-sm/medium";
PX_162 = Module712.space.PX_16;
PX_122 = Module712.space.PX_12;
useStyles = createStyles({
card: {
padding: PX_12
},
closeButton: {
position: "absolute",
top: Module712.space.PX_12,
right: Module712.space.PX_12,
width: 24,
height: 24,
alignItems: "center",
justifyContent: "center",
zIndex: 1
},
imagesContainer: {
flexDirection: "row",
alignItems: "center",
justifyContent: "center"
},
ellipsisContainer: {
flexDirection: "row",
alignItems: "center",
marginHorizontal: Module712.space.PX_8,
gap: Module712.space.PX_4
},
ellipsisDot: {
width: Module712.space.PX_4,
height: Module712.space.PX_4,
borderRadius: Module712.space.PX_4 / 2,
backgroundColor: Module712.colors.INTERACTIVE_MUTED
},
title: {
marginTop: PX_16,
textAlign: "center"
},
body: {
marginTop: PX_4,
textAlign: "center"
},
ctaContainer: {
marginTop: PX_162
}
});
useStyles2 = createStyles({
card: {
padding: PX_12
},
closeButton: {
width: 24,
height: 24,
alignItems: "center",
justifyContent: "center",
alignSelf: "flex-start"
},
contentContainer: {
flexDirection: "row",
gap: Module712.space.PX_12
},
rewardImage: {
width: 48,
height: 48
},
bodyText: {
flexGrow: 1,
flexShrink: 1,
alignSelf: "center"
},
ctaContainer: {
marginTop: PX_122,
width: "100%"
}
});
const r133 = memo(function(a0) {
const config = mobileAccountLinkingExperiment.useConfig({
location: "AccountLinkBanner"
});
const { enabled, bannerSize } = config;
return enabled ? <>
{[bannerSize === MobileAccountLinkingBannerSize.LARGE && <AccountLinkLargeBanner {...a0} />, bannerSize === MobileAccountLinkingBannerSize.MEDIUM && <AccountLinkMediumBanner {...a0} />]}
</> : null;
});
export default r133;
export { PX_8 as ACCOUNT_LINK_BANNER_MARGIN_TOP };
export { PX_82 as ACCOUNT_LINK_BANNER_MARGIN_BOTTOM };
export function getScaledAccountLinkBannerHeight(a0) {
const config = mobileAccountLinkingExperiment.getConfig({
location: "getScaledAccountLinkBannerHeight"
});
const { enabled, bannerSize } = config;
return enabled ? bannerSize === MobileAccountLinkingBannerSize.LARGE ? PX_8 + PX_12 + c10760_16 + PX_16 + scaleTextLineHeight(variant, a0) + PX_4 + 2 * scaleTextLineHeight(variant2, a0) + PX_162 + MEDIUM_BUTTON_HEIGHT + PX_12 + PX_82 : bannerSize === MobileAccountLinkingBannerSize.MEDIUM ? PX_8 + PX_12 + 48 + PX_122 + SMALL_BUTTON_HEIGHT + PX_12 + PX_82 : 0 : 0;
}
@@ -0,0 +1,35 @@
// Metro module 16728 (f16729).
import { AccountLinkManager } from "../AccountLinkManager";
import { subscribeToIsInAppBrowserOpen } from "../../links/native/BrowserManager";
let prototype, AccountLinkManagerNative;
const AccountLinkManagerNative2 = class AccountLinkManagerNative extends AccountLinkManager {
unsubscribeBrowser = null;
isBrowserOpen = false;
_initialize() {
Reflect.get(Object.getPrototypeOf(prototype), "_initialize", this).call(this);
this.unsubscribeBrowser = subscribeToIsInAppBrowserOpen((a0, a1) => {
this.isBrowserOpen = a0;
if (a1) {
this.evaluatePending();
}
});
}
_terminate() {
Reflect.get(Object.getPrototypeOf(prototype), "_terminate", this).call(this);
const unsubscribeBrowser = this.unsubscribeBrowser;
if (unsubscribeBrowser != null) {
unsubscribeBrowser.call(this);
}
this.unsubscribeBrowser = null;
}
evaluatePending() {
if (!this.isBrowserOpen) {
Reflect.get(Object.getPrototypeOf(prototype), "evaluatePending", this).call(this);
}
}
};
const prototype2 = AccountLinkManagerNative2.prototype;
AccountLinkManagerNative = AccountLinkManagerNative2;
prototype = prototype2;
const accountLinkManagerNative = new AccountLinkManagerNative();
export default accountLinkManagerNative;
@@ -0,0 +1,166 @@
// Metro module 15768 (f15769).
import { useCallback } from "react";
import { View } from "react-native";
import ApplicationStore from "../../applications/ApplicationStore";
import ConnectedAccountsStore from "../../../stores/ConnectedAccountsStore";
import { ContentDismissActionType } from "../../dismissible_content/DismissibleContentConstants";
import { createStyles } from "../../../design/components/Styles/native/createStyles";
import Module712 from "../../../_bundle/Module712";
import { useThemeContext } from "../../../_bundle/Module3901";
import useSafeAreaInsets_native from "../../safe_area/useSafeAreaInsets.native";
import { useStateFromStores, useStateFromStoresObject } from "../../../_bundle/Module589";
import Platforms from "../../../lib/Platforms";
import useStartAuthorize from "./useStartAuthorize";
import useAnalyticsLocations from "../../app_analytics/useAnalyticsLocations";
import AnalyticsLocation from "../../app_analytics/AnalyticsLocation";
import { claimIncentivizedAccountLinkingReward } from "../AccountLinkManager";
import ActionSheetActionCreators from "../../action_sheet/native/ActionSheetActionCreators";
import { BottomSheetTitleHeader } from "../../../design/components/Sheet/native/BottomSheetTitleHeader.native";
import { BottomSheet } from "../../../design/components/Sheet/native/BottomSheet.native";
import { Stack } from "../../../design/components/Stack/native/Stack.native";
import { UnionIcon } from "../../local_app_detection/native/RobloxConnectionCoachmark";
import { Text } from "../../../design/components/Text/native/Text";
import { intl, t } from "../../../intl/index.native";
import ApplicationAccountLinking_messages from "../ApplicationAccountLinking.messages";
import { OrbsIcon } from "../../../design/components/Icon/native/redesign/generated/OrbsIcon";
import { Button } from "../../../design/components/Button/native/Button.native";
import { WindowLaunchIcon } from "../../../design/components/Icon/native/redesign/generated/WindowLaunchIcon";
import * as _themes from "../../../design/utils/shared/themes";
import { makeSource } from "../../../utils/AvatarUtils";
import Icon, { IconSizes } from "../../../design/void/Icon/native/Icon";
import GameIcon, { GameIconSizes } from "../../game_detection/native/GameIcon";
import { useGetOrFetchApplication } from "../../applications/useGetOrFetchApplications";
let useStyles, ApplicationIcon;
const ConnectionIcon = function ConnectionIcon(props) {
const { platform: platform2, theme } = props;
const styles = useStyles();
const isThemeDark = _themes.isThemeDark(theme);
const icon = platform2.icon;
return <View style={styles.iconContainer}>
<Icon size={IconSizes.CUSTOM} source={makeSource(isThemeDark ? icon.darkPNG : icon.lightPNG)} disableColor style={styles.connectionIcon} />
</View>;
};
ApplicationIcon = function ApplicationIcon(props) {
const application = props.application;
return <View style={useStyles().iconContainer}>
{application != null ? <GameIcon game={application} size={GameIconSizes.NORMAL} /> : null}
</View>;
};
useStyles = createStyles({
iconContainer: {
width: 56,
height: 56,
alignItems: "center",
justifyContent: "center"
},
content: {
paddingHorizontal: Module712.space.PX_16
},
text: {
textAlign: "center"
},
connectionIcon: {
height: 48,
width: 48
}
});
export default function ConnectionDeprecationBottomSheet(props) {
let replacedBy, startAuthorization, analyticsLocations, callback;
const platformTypes = props.platformTypes;
let applicationName = props.applicationName;
const markAsDismissed = props.markAsDismissed;
replacedBy = void 0;
startAuthorization = void 0;
analyticsLocations = void 0;
callback = void 0;
const styles = useStyles();
const theme = useThemeContext().theme;
const bottom = useSafeAreaInsets_native().bottom;
const stateFromStores2 = useStateFromStores([ConnectedAccountsStore], () => ConnectedAccountsStore.getAccounts().find((item) => platformTypes.includes(item.type))?.type);
const platform2 = stateFromStores2 != null ? Platforms.get(stateFromStores2) : null;
replacedBy = platform2 == null ? void 0 : platform2.migrationData?.replacedBy;
const stateFromStores = useStateFromStores([ApplicationStore], () => ApplicationStore.getApplication(replacedBy));
startAuthorization = useStartAuthorize(stateFromStores).startAuthorization;
analyticsLocations = useAnalyticsLocations(AnalyticsLocation.ACTION_SHEET).analyticsLocations;
callback = useCallback(() => {
claimIncentivizedAccountLinkingReward({
applicationId: replacedBy,
onSuccess: () => {
ActionSheetActionCreators.openLazy(import("./IncentivizedAccountLinkConfirmationBottomSheet"), "IncentivizedAccountLinkConfirmationBottomSheet");
}
});
}, [replacedBy]);
const callback2 = useCallback(() => {
ActionSheetActionCreators.hideActionSheet();
if (markAsDismissed != null) {
markAsDismissed(ContentDismissActionType.PRIMARY);
}
startAuthorization({
analyticsLocations,
onSuccess: callback
});
}, [analyticsLocations, startAuthorization, markAsDismissed, callback]);
if (platform2 != null && stateFromStores != null) {
if (applicationName == null) {
applicationName = stateFromStores.name;
}
return <BottomSheet startExpanded contentStyles={styles.content} header={<BottomSheetTitleHeader title={null} />} onDismiss={() => markAsDismissed(ContentDismissActionType.DISMISS)}>
<Stack spacing={24} style={{
paddingBottom: bottom
}}>
<Stack justify="center" align="center" direction="horizontal">
<ConnectionIcon theme={theme} platform={platform2} />
<UnionIcon theme={theme} />
<ApplicationIcon application={stateFromStores} />
</Stack>
<Stack justify="center">
<Text variant="heading-xl/bold" style={styles.text}>
{intl.string(ApplicationAccountLinking_messages.vycLU2)}
</Text>
<Text variant="text-md/medium" style={styles.text}>
{intl.format(ApplicationAccountLinking_messages.DfSSdL, {
connectionName: platform2.name,
applicationName,
orbCount: 200,
orbsIconHook: () => <OrbsIcon size="xs" color={Module712.colors.TEXT_STRONG} />
})}
</Text>
</Stack>
<Stack>
<Button text={intl.string(ApplicationAccountLinking_messages.ZeOhh9)} icon={<WindowLaunchIcon size="sm" color={Module712.colors.WHITE} />} iconPosition="end" size="lg" onPress={callback2} />
<Button text={intl.string(t.TulDPl)} variant="secondary" size="lg" onPress={function onPress() {
ActionSheetActionCreators.hideActionSheet();
if (markAsDismissed != null) {
markAsDismissed(ContentDismissActionType.DISMISS);
}
}} />
</Stack>
</Stack>
</BottomSheet>;
}
return false;
};
export function useShouldShowConnectionDeprecationBottomSheet({ deprecatedPlatformTypes }) {
const stateFromStoresObject = useStateFromStoresObject([ConnectedAccountsStore], () => ({
fetchingConnections: ConnectedAccountsStore.isFetching(),
matchingPlatform: ConnectedAccountsStore.getAccounts().map((item) => Platforms.get(item.type)).find((item) => {
const migrationData = item.migrationData;
return (migrationData == null ? void 0 : migrationData.getMigrationExperimentEnabled("ConnectionDeprecationBottomSheet")) && deprecatedPlatformTypes.includes(item.type);
})
}));
let fetchingConnections = stateFromStoresObject.fetchingConnections;
const matchingPlatform = stateFromStoresObject.matchingPlatform;
const getOrFetchApplication = useGetOrFetchApplication(matchingPlatform == null ? void 0 : matchingPlatform.migrationData?.replacedBy);
const startAuthorize = useStartAuthorize(getOrFetchApplication);
const { hasAlreadyLinked, canStartAuthorization, fetched } = startAuthorize;
if (!fetchingConnections) {
fetchingConnections = !fetched;
}
if (!fetchingConnections) {
fetchingConnections = !canStartAuthorization;
}
if (!fetchingConnections) {
fetchingConnections = getOrFetchApplication == null;
}
return fetchingConnections ? !fetchingConnections : !hasAlreadyLinked;
}
@@ -0,0 +1,43 @@
// Metro module 15771 (f15772).
import { Image as Image2 } from "react-native";
import AccessibilityStore from "../../a11y/AccessibilityStore";
import { HelpdeskArticles } from "../../../Constants";
import { useStateFromStores } from "../../../_bundle/Module589";
import Module14628 from "../../../_bundle/Module14628";
import { isAndroid } from "../../../utils/PlatformUtils";
import Module6208 from "../../../_bundle/Module6208";
import Module14629 from "../../../_bundle/Module14629";
import FastImage from "../../../components_native/common/FastImage";
import { Button } from "../../../design/components/Button/native/Button.native";
import { intl, t } from "../../../intl/index.native";
import { WindowLaunchIcon } from "../../../design/components/Icon/native/redesign/generated/WindowLaunchIcon";
import Module712 from "../../../_bundle/Module712";
import ActionSheetActionCreators from "../../action_sheet/native/ActionSheetActionCreators";
import Linking from "../../../lib/native/Linking";
import HelpdeskUtils from "../../../utils/HelpdeskUtils";
import { PromoSheet } from "../../../design/components/Sheet/native/PromoSheet.native";
import IncentivizedAccountLinking_messages from "../IncentivizedAccountLinking.messages";
const width = 150;
export default function IncentivizedAccountLinkConfirmationBottomSheet() {
const illustration = useStateFromStores([AccessibilityStore], () => AccessibilityStore.useReducedMotion) ? <Image2 source={{
uri: Module14628
}} style={{
width,
height: width
}} /> : isAndroid() ? <Module6208 url={Module14629} style={{
width,
height: width
}} /> : <FastImage source={{
uri: Module14629
}} resizeMode="contain" style={{
width,
height: width
}} />;
const actions = <Button text={intl.string(t.aRIFWD)} icon={<WindowLaunchIcon size="sm" color={Module712.colors.WHITE} />} iconPosition="end" size="lg" onPress={function onPress() {
ActionSheetActionCreators.hideActionSheet();
Linking.openURL(HelpdeskUtils.getArticleURL(HelpdeskArticles.IN_GAME_FEATURES));
}} />;
return <PromoSheet title={intl.string(IncentivizedAccountLinking_messages.ublzTG)} description={intl.string(IncentivizedAccountLinking_messages.JgM2xu)} actions={actions} illustration={illustration} onDismiss={function onDismiss() {
ActionSheetActionCreators.hideActionSheet();
}} />;
};
@@ -0,0 +1,32 @@
// Metro module 10955 (f10956).
import AuthorizedAppsStore, { FetchState } from "../../oauth2/AuthorizedAppsStore";
import { getAuthorizationApp } from "../hooks/useAuthorizationApp";
import AuthorizedAppsActionCreators from "../../oauth2/AuthorizedAppsActionCreators";
export function getShouldShowAppAuthPrompt(a0) {
let r29;
if (a0 == null) {
return false;
}
const authorizationApp = getAuthorizationApp(a0);
if (authorizationApp == null) {
return false;
}
if (authorizationApp?.connectionEntrypointUrl != null) {
let r17 = authorizationApp?.parentId;
if (r17 == null) {
r17 = authorizationApp?.id;
}
let r20 = r17 != null;
if (r20) {
if (AuthorizedAppsStore.getFetchStateForApplication(r17) === FetchState.NOT_FETCHED) {
AuthorizedAppsActionCreators.fetch([r17]);
r29 = false;
} else {
r29 = !(AuthorizedAppsStore.getFetchStateForApplication(r17) === FetchState.FETCHED && AuthorizedAppsStore.getNewestTokenForApplication(r17) != null);
}
r20 = r29;
}
return r20;
}
return false;
}
@@ -0,0 +1,51 @@
// Metro module 10956 (f10957).
import { AnalyticEvents } from "../../../Constants";
import { getAuthorizationApp } from "../hooks/useAuthorizationApp";
import Linking from "../../../lib/native/Linking";
import AnalyticsUtils from "../../../utils/AnalyticsUtils";
export async function startAuthorizationNoHook(c26876_0, c26876_1) {
let c26876_5 = 0;
let c30312_0, c30312_1;
L16: {
L15: {
try {
c30312_0 = c26876_1;
c30312_1 = void 0;
if (c26876_0 == null) {
break L16;
}
const authorizationApp = getAuthorizationApp(c26876_0);
c30312_1 = authorizationApp;
if (authorizationApp?.connectionEntrypointUrl != null) {
c26876_5 = 1;
await Linking.openURL(authorizationApp.connectionEntrypointUrl);
AnalyticsUtils.track(AnalyticEvents.ON_PLATFORM_ACCOUNT_LINK_FLOW_STARTED, {
location_stack: c30312_0,
application_id: c30312_1.id,
flow_type: "web"
});
c26876_5 = 0;
break L15;
}
break L16;
} catch ($e) {
let r8 = $e;
if (c26876_5 !== 0) {
while (true) {
try {
c26876_5 = 0;
break L15;
} catch ($e) {
r8 = $e;
if (c26876_5 === 0) {
break;
}
}
}
}
throw r8;
}
}
return void 0;
}
}
@@ -0,0 +1,53 @@
// Metro module 15227 (f15228).
import { useRef, useCallback, useEffect } from "react";
import AppStateStore from "../../../stores/native/AppStateStore";
import { AppStates } from "../../../Constants";
import { useStateFromStores } from "../../../_bundle/Module589";
import { useIsInAppBrowserOpen } from "../../links/native/BrowserManager";
import { usePreviousWhen } from "../../../hooks/usePrevious";
import ToastActionCreators from "../../toast/native/ToastActionCreators";
import { intl } from "../../../intl/index.native";
import AccountLinking_messages from "../AccountLinking.messages";
export function useDefaultAuthorizationNotifiers(a0, a1) {
let c21783_4, previousWhen;
let c21783_0 = a0;
let r4 = arguments[2];
if (r4 === void 0) {
r4 = {};
}
let showToastOnSuccess = r4.showToastOnSuccess;
if (showToastOnSuccess === void 0) {
showToastOnSuccess = true;
}
let c21783_2 = showToastOnSuccess;
c21783_4 = void 0;
previousWhen = void 0;
const ref = useRef(false);
let shouldUpdate = useStateFromStores([AppStateStore], () => AppStateStore.getState() === AppStates.ACTIVE);
const isInAppBrowserOpen = useIsInAppBrowserOpen();
const callback = useCallback((a0) => {
ref.current = true;
return c21783_0(a0);
}, [a0]);
if (shouldUpdate) {
shouldUpdate = !isInAppBrowserOpen;
}
c21783_4 = shouldUpdate;
previousWhen = usePreviousWhen({
value: a1,
shouldUpdate
});
useEffect(() => {
if (ref.current && previousWhen === false && a1 === true && c21783_4) {
ref.current = false;
if (!c21783_2) {
return void 0;
}
ToastActionCreators.open({
content: intl.string(AccountLinking_messages.uG6teD),
key: "account-linked-toast"
});
}
}, [a1, previousWhen, showToastOnSuccess, shouldUpdate]);
return callback;
}
@@ -0,0 +1,117 @@
// Metro module 5518 (f5519).
import { useCallback } from "react";
import { AuthorizeFlow } from "../ApplicationAccountLinkingConstants";
import { AnalyticEvents } from "../../../Constants";
import { useAuthorizationApp } from "../hooks/useAuthorizationApp";
import { useAuthorizedAppsToken } from "../hooks/useAuthorizedAppsToken";
import Linking from "../../../lib/native/Linking";
import AnalyticsUtils from "../../../utils/AnalyticsUtils";
import { accountLinkAuthorizationStarted } from "../AccountLinkingActionCreators";
let env3391 = {};
export default function useStartAuthorize(a0, r5 = {}) {
let env14896 = {
$parent: env3391
};
env14896[0] = void 0;
const debug = r5.debug;
const r6 = debug !== void 0 && debug;
const authorizationApp = useAuthorizationApp(a0);
env14896[0] = authorizationApp;
const canStartAuthorization = authorizationApp?.connectionEntrypointUrl != null;
const chosenFlow = canStartAuthorization ? AuthorizeFlow.WEB : null;
let r26 = authorizationApp?.parentId;
if (r26 == null) {
r26 = authorizationApp?.id;
}
const authorizedAppsToken = useAuthorizedAppsToken(r26);
const token = authorizedAppsToken.token;
let fetched = authorizedAppsToken.fetched;
let c14897_0 = async (c29518_0) => {
let c29518_3;
let c29518_4 = 0;
let c31371_0, c31371_1;
L16: {
try {
c31371_0 = c29518_0;
if (env14896[0]?.connectionEntrypointUrl == null) {
break L16;
}
c29518_4 = 1;
await Linking.openURL(env14896[0].connectionEntrypointUrl);
const r62 = c31371_0;
const onConfirm = r62.onConfirm;
if (onConfirm != null) {
onConfirm.call(r62);
}
AnalyticsUtils.track(AnalyticEvents.ON_PLATFORM_ACCOUNT_LINK_FLOW_STARTED, {
location_stack: c31371_0.analyticsLocations,
application_id: env14896[0].id,
flow_type: AuthorizeFlow.WEB
});
accountLinkAuthorizationStarted(env14896[0].id, {
onSuccess: c31371_0.onSuccess,
onError: c31371_0.onError
});
c29518_4 = 0;
} catch ($e) {
const r29 = $e;
let r7 = r29;
c29518_3 = r29;
if (c29518_4 !== 0) {
while (true) {
try {
const r99 = c29518_3;
c29518_4 = 0;
c31371_1 = r99;
const r101 = c31371_0;
const onError = r101.onError;
if (onError != null) {
onError.call(r101, c31371_1);
}
} catch (r96) {
r7 = r96;
c29518_3 = r96;
if (c29518_4 === 0) {
break;
}
continue;
}
return false;
}
}
throw r7;
}
return true;
}
return false;
};
const callback = useCallback(function() {
return c14897_0.apply(this, arguments);
}, [authorizationApp]);
const r38 = {
fetched,
hasAlreadyLinked: null,
canStartAuthorization: null,
startAuthorization: null,
connectionApp: null,
chosenFlow: null,
token: null,
debug: null
};
if (fetched) {
fetched = token != null;
}
r38.hasAlreadyLinked = fetched;
r38.canStartAuthorization = canStartAuthorization;
r38.startAuthorization = callback;
r38.connectionApp = authorizationApp;
r38.chosenFlow = chosenFlow;
r38.token = token;
r38.debug = r6 ? {
isSubscribedToAuthorizeRequest: false,
oauth2Token: token,
hasConnectionEntrypointUrl: authorizationApp?.connectionEntrypointUrl != null,
validFlows: canStartAuthorization ? [AuthorizeFlow.WEB] : []
} : void 0;
return r38;
};
@@ -0,0 +1,70 @@
// Metro module 5533 (f5534).
import { useCallback } from "react";
import { useProviderConnection } from "../hooks/useProviderConnection";
import Linking from "../../../lib/native/Linking";
let env3401 = {};
export function useStartProviderConnection(a0) {
let env14905 = {
$parent: env3401
};
const providerConnection = useProviderConnection(a0);
const { loading, hasConnection, canConnect, startConnection } = providerConnection;
env14905[0] = startConnection;
const account = providerConnection.account;
let c14906_0 = async (c29520_0) => {
let c29520_4 = 0;
let c31372_0;
L15: {
L14: {
try {
c31372_0 = void 0;
c31372_0 = await (0, env14905[0])(c29520_0);
if (!c31372_0.success) {
break L15;
}
if (c31372_0.url != null) {
c29520_4 = 1;
await Linking.openURL(c31372_0.url);
c29520_4 = 0;
break L14;
}
break L15;
} catch ($e) {
let r7 = $e;
if (c29520_4 !== 0) {
while (true) {
try {
c29520_4 = 0;
} catch ($e) {
r7 = $e;
if (c29520_4 === 0) {
break;
}
continue;
}
return {
success: false
};
}
}
throw r7;
}
}
return {
success: true
};
}
return {
success: false
};
};
return {
loading,
hasConnection,
canConnect,
startConnection: useCallback(function() {
return c14906_0.apply(this, arguments);
}, [startConnection]),
account
};
}