181 lines
9.4 KiB
TypeScript
181 lines
9.4 KiB
TypeScript
/* Metro module 1230; source: modules/routing/router_utils.tsx; dependencies: [661, 3, 1231, 1239, 1242, 2] */
|
|
import * as FileImportTrackerModule from '../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
|
|
import * as ConstantsModule from '../../Constants.tsx'; /* Metro dependency 661 */
|
|
|
|
function _fun13788(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#13788, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1357:6, offset: 0x00df4e9a, size: 403 bytes, params: 8, frame: 21
|
|
const env0_0 = require;
|
|
const closure = function() {
|
|
var ComponentDispatch = require(dependencyMap[3]).ComponentDispatch;
|
|
return !ComponentDispatch.hasSubscribers(ComponentActions.MODAL_CLOSE);
|
|
};
|
|
const transitionTo2 = transitionTo;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
let value = ConstantsModule;
|
|
const env0_5 = value.Routes;
|
|
const env0_6 = value.PageAnalyticsLocations;
|
|
const env0_7 = value.ComponentActions;
|
|
const RelativeMarketingURLs = value.RelativeMarketingURLs;
|
|
value = importDefault(3) /* metro dependency 3: Logger */;
|
|
value = new value('Routing/Utils');
|
|
const DEVELOPER_PORTAL = RelativeMarketingURLs.DEVELOPER_PORTAL;
|
|
object = [DEVELOPER_PORTAL];
|
|
value = require(1231) /* metro dependency 1231 */;
|
|
value = value.createMemoryHistory();
|
|
const env0_10 = value.listen(_fun13793);
|
|
(FileImportTrackerModule).fileFinishedImporting('modules/routing/router_utils.tsx');
|
|
exports.shouldNavigate = closure;
|
|
exports.transitionTo = transitionTo2;
|
|
exports.transitionToGuild = transitionToGuild;
|
|
exports.currentRouteHasBackNavigation = currentRouteHasBackNavigation;
|
|
exports.replaceWith = replaceWith;
|
|
exports.getHistory = getHistory;
|
|
exports.getLastRouteChangeSource = getLastRouteChangeSource;
|
|
exports.getLastRouteChangeSourceLocationStack = getLastRouteChangeSourceLocationStack;
|
|
exports.isValidFingerprintRoute = isValidFingerprintRoute;
|
|
exports.getFingerprintLocation = getFingerprintLocation;
|
|
exports.hasNavigated = function() {
|
|
return false;
|
|
};
|
|
exports.back = back_13803;
|
|
exports.forward = forward;
|
|
function maybeExternallyNavigate(a0, a1) { // fn#13790, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1357:419, offset: 0x00df5066, size: 179 bytes, params: 3, frame: 19
|
|
var r0;
|
|
var window;
|
|
var dispatchEvent;
|
|
var event;
|
|
const env0_0 = a0;
|
|
const r2 = typeof a0 !== 'string' || !env0_9.some(_fun13791);
|
|
if (r2) {
|
|
r0 = !r2;
|
|
} else {
|
|
env0_8.log('' + a1 + ' - route to external path ' + a0);
|
|
window = global.window;
|
|
dispatchEvent = window.dispatchEvent;
|
|
event = new global.Event('beforeunload');
|
|
Reflect.apply(dispatchEvent, window, [event]);
|
|
window = global.window;
|
|
window.location[a1](a0);
|
|
event = true;
|
|
r0 = event;
|
|
}
|
|
return r0;
|
|
function _fun13791(a0) { // fn#13791, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1357:494, offset: 0x00df5119, size: 23 bytes, params: 2, frame: 11
|
|
return env0_0.startsWith(a0);
|
|
}
|
|
|
|
}
|
|
|
|
function transitionTo(a0, a1) { // fn#13792, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1357:636, offset: 0x00df5130, size: 258 bytes, params: 3, frame: 20
|
|
var source;
|
|
var sourceLocationStack;
|
|
var binding;
|
|
var URL;
|
|
var value3;
|
|
var uRL;
|
|
var push;
|
|
var object;
|
|
var search;
|
|
const maybeExternallyNavigateBinding = maybeExternallyNavigate;
|
|
const value2 = undefined;
|
|
if (!maybeExternallyNavigateBinding(a0, 'assign')) {
|
|
binding = env0_8;
|
|
binding.log('transitionTo - Transitioning to ' + a0);
|
|
source = a1 == null ? value2 : a1.source;
|
|
sourceLocationStack = a1 == null ? value2 : a1.sourceLocationStack;
|
|
if (a1 == null) {
|
|
env0_2.push(a0);
|
|
} else {
|
|
URL = global.URL;
|
|
value3 = 'https:' + global.window.GLOBAL_ENV.WEBAPP_ENDPOINT;
|
|
uRL = new URL(a0);
|
|
binding = env0_2;
|
|
push = binding.push;
|
|
object = {};
|
|
object.pathname = uRL.pathname;
|
|
search = uRL.search;
|
|
object.search = search;
|
|
object.hash = uRL.hash;
|
|
copyDataProperties(object, a1, search);
|
|
Reflect.apply(push, binding, [object]);
|
|
}
|
|
}
|
|
return value2;
|
|
}
|
|
|
|
function _fun13793(a0, a1) { // fn#13793, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1357:300, offset: 0x00df5232, size: 30 bytes, params: 3, frame: 9
|
|
if (a1 !== 'REPLACE') {
|
|
env0_10();
|
|
}
|
|
}
|
|
|
|
function transitionToGuild(a0, a1, a2, a3) { // fn#13794, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1357:1125, offset: 0x00df5250, size: 116 bytes, params: 5, frame: 21
|
|
const binding = env0_8;
|
|
const log = binding.log;
|
|
const JSON = global.JSON;
|
|
Reflect.apply(log, binding, ['transitionToGuild - Transitioning to ' + JSON.stringify({guildId: a0, channelId: a1,
|
|
messageId: a2})]);
|
|
transitionTo(Routes.CHANNEL(a0, a1, a2), a3);
|
|
}
|
|
|
|
function currentRouteHasBackNavigation() { // fn#13795, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1357:1328, offset: 0x00df52c4, size: 60 bytes, params: 1, frame: 13
|
|
return env0_3 != null && (require(1242) /* metro dependency 1242: RoutingSources */).ChannelBackNavigationSources.has(env0_3);
|
|
}
|
|
|
|
function replaceWith(a0, a1, a2) { // fn#13796, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1357:1444, offset: 0x00df5300, size: 118 bytes, params: 4, frame: 16
|
|
if (!maybeExternallyNavigate(a0, 'replace')) {
|
|
env0_8.log('Replacing route with ' + a0);
|
|
if (typeof a0 === 'string') {
|
|
env0_2.replace(a0, a1);
|
|
} else {
|
|
env0_2.replace(a0);
|
|
}
|
|
env0_3 = a2;
|
|
}
|
|
}
|
|
|
|
function getHistory() { // fn#13797, offset: 0x00c36b39, size: 9 bytes, params: 1, frame: 1
|
|
return env0_2;
|
|
}
|
|
|
|
function getLastRouteChangeSource() { // fn#13798, offset: 0x00c7c381, size: 9 bytes, params: 1, frame: 1
|
|
return env0_3;
|
|
}
|
|
|
|
function getLastRouteChangeSourceLocationStack() { // fn#13799, offset: 0x00d16d26, size: 9 bytes, params: 1, frame: 1
|
|
return env0_4;
|
|
}
|
|
|
|
function isValidFingerprintRoute(a0) { // fn#13800, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1357:1842, offset: 0x00df5376, size: 35 bytes, params: 2, frame: 2
|
|
if (a0 == null) {
|
|
env0_2.location.pathname != null;
|
|
}
|
|
return true;
|
|
}
|
|
|
|
function getFingerprintLocation(a0) { // fn#13801, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1357:1968, offset: 0x00df5399, size: 595 bytes, params: 2, frame: 14
|
|
var r0;
|
|
const startsWith = (a0 ?? (env0_2.location.pathname ?? '')).startsWith;
|
|
const LOGIN = Routes.LOGIN;
|
|
r0 = Reflect.apply(startsWith, r0,
|
|
[LOGIN]) ? PageAnalyticsLocations.LOGIN : r0.startsWith(Routes.REGISTER) ? PageAnalyticsLocations.REGISTER : r0.startsWith(Routes.INVITE('')) ? PageAnalyticsLocations.INVITE : r0.startsWith(Routes.VERIFY) ? PageAnalyticsLocations.VERIFY : r0.startsWith(Routes.DISABLE_EMAIL_NOTIFICATIONS) ? PageAnalyticsLocations.DISABLE_EMAIL_NOTIFICATIONS : r0.startsWith(Routes.DISABLE_SERVER_HIGHLIGHT_NOTIFICATIONS) ? PageAnalyticsLocations.DISABLE_SERVER_HIGHLIGHT_NOTIFICATIONS : r0.startsWith(Routes.REJECT_IP) ? PageAnalyticsLocations.REJECT_IP : r0.startsWith(Routes.REJECT_MFA) ? PageAnalyticsLocations.REJECT_MFA : r0.startsWith(Routes.AUTHORIZE_IP) ? PageAnalyticsLocations.AUTHORIZE_IP : r0.startsWith(Routes.AUTHORIZE_PAYMENT) ? PageAnalyticsLocations.AUTHORIZE_PAYMENT : r0.startsWith(Routes.RESET) ? PageAnalyticsLocations.RESET : r0.startsWith(Routes.REPORT) ? PageAnalyticsLocations.REPORT : r0.startsWith(Routes.REPORT_SECOND_LOOK) ? PageAnalyticsLocations.REPORT_SECOND_LOOK : r0.startsWith(Routes.ACCOUNT_REVERT('')) ? PageAnalyticsLocations.ACCOUNT_REVERT : r0;
|
|
return r0;
|
|
}
|
|
|
|
function back_13803() { // fn#13803, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1357:2773, offset: 0x00df55ec, size: 38 bytes, params: 1, frame: 10
|
|
if (shouldNavigate()) {
|
|
env0_2.goBack();
|
|
}
|
|
}
|
|
|
|
function forward() { // fn#13804, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1357:2838, offset: 0x00df5612, size: 38 bytes, params: 1, frame: 10
|
|
if (shouldNavigate()) {
|
|
env0_2.goForward();
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
global.__d(_fun13788, 1230, [661, 3, 1231, 1239, 1242,
|
|
2]) /* metro module 1230, dependencies: [661, 3, 1231, 1239, 1242, 2] */;
|