// Module ID: 12478 // Function ID: 12479 // Name: authorizeCallback // Dependencies: [8811, 5265, 9815, 2008, 1487, 12479, 4344, 691, 4093, 2] // Exports: default // Module 12478 (authorizeCallback) import set from "set" /* 2 */; import keys from "keys" /* 691 */; import isDiscordProxiedAssetUrlDefault from "isDiscordProxiedAssetUrl" /* 1487 */; import asyncRequireImpl from "asyncRequireImpl" /* 2008 */; import _modDef4093 from "module_4093" /* 4093 */; import NativeModules from "NativeModules" /* 4344 */; import _modDef5265 from "module_5265" /* 5265 */; import OAUTH2_AUTHORIZE_MODAL_KEY from "OAUTH2_AUTHORIZE_MODAL_KEY" /* 8811 */; ({ OAUTH2_SUCCESS_RESULT_MODAL_KEY: c3, OAUTH2_ERROR_RESULT_MODAL_KEY: c4 } = OAUTH2_AUTHORIZE_MODAL_KEY); const re5 = /oauth2\/authorized/; const re6 = /oauth2\/error/; const result = set.fileFinishedImporting("modules/oauth2/native/authorizeCallback.tsx"); export default function authorizeCallback(arg0) { ({ location: _location, canceled, wasDeepLink } = arg0); if (null != _location) { let toURLSafeResult = isDiscordProxiedAssetUrlDefault.toURLSafe(_location); if (toURLSafeResult == null) { toURLSafeResult = {}; } ({ host, pathname, searchParams } = toURLSafeResult); if (null != host) { let tmp8Result = tmp8(1487); if (tmp8Result.isDiscordHostname(host)) { if (null != pathname) { if (null != pathname.match(closure_5)) { tmp8Result = tmp8(5265); let obj = { application: null, guild: null }; obj[0] = tmp; obj[1] = tmp2; tmp8Result.pushLazy(asyncRequireImpl(12479, tmp9.paths), obj, closure_3); } else if (null != pathname.match(closure_6)) { if (!canceled) { let str; const tmp8Result1 = tmp8(5265); if (searchParams != null) { str = "error_description"; const str2 = searchParams.get("error_description"); if (str2 != null) { str = str2.toString(); } } if (str == null) { let str1; if (searchParams != null) { const str4 = searchParams.get("error"); if (str4 != null) { str1 = str4.toString(); } } str = str1; } obj = { error: null }; obj[0] = str; tmp8Result1.pushLazy(asyncRequireImpl(9815, tmp9.paths), obj, closure_4); const tmp17 = asyncRequireImpl(9815, tmp9.paths); } } } } } if (wasDeepLink) { const browserManagerSelectedBrowser = NativeModules.getBrowserManagerSelectedBrowser(); wasDeepLink = browserManagerSelectedBrowser === keys.WebBrowserType.IN_APP; const obj5 = NativeModules; } const obj2 = isDiscordProxiedAssetUrlDefault; let SAFARI; if (wasDeepLink) { SAFARI = keys.WebBrowserType.SAFARI; } _modDef4093.openURL(_location, SAFARI); const tmp8Result2 = _modDef4093; } else if (!canceled) { obj = _modDef5265; obj.pushLazy(asyncRequireImpl(9815, dependencyMap.paths), undefined, closure_4); } };