decord/source/components_native/AppContainer.tsx

279 lines
11 KiB
TypeScript
Raw Normal View History

2026-08-15 05:55:55 +00:00
// Module ID: 13919
// Function ID: 13920
2026-07-20 16:05:17 +00:00
// Name: GestureWrapper
2026-08-15 05:55:55 +00:00
// Dependencies: [32, 19, 17, 7291, 1391, 1979, 676, 1398, 21, 4661, 712, 4115, 8944, 13920, 5263, 1231, 1209, 4230, 4670, 6546, 13922, 13923, 4229, 1222, 4310, 698, 4231, 13924, 6552, 1501, 1370, 13925, 500, 10725, 13926, 13934, 4160, 13936, 1497, 12472, 12634, 12640, 13937, 4244, 13938, 13940, 13942, 13943, 13944, 15198, 15206, 1208, 2]
2026-07-20 16:05:17 +00:00
2026-08-15 05:55:55 +00:00
// Module 13919 (GestureWrapper)
2026-07-29 08:29:29 +00:00
import set from "set";
import designConfig from "designConfig";
import { NativeModules } from "getRootNavigationRef";
import { handleHistoryStoreNavigationChange as closure_7 } from "getIdFromHistoryItem";
import ensureGuildLoaded from "ensureGuildLoaded";
import handleConnectionOpen from "handleConnectionOpen";
2026-07-23 10:11:24 +00:00
import ME from "ME";
2026-07-24 07:16:23 +00:00
import { isStaticChannelRoute } from "set";
2026-07-29 08:29:29 +00:00
import jsxProd from "getChannelDetailsFromRoute";
import createCacheKey from "createCacheKey";
2026-08-15 05:55:55 +00:00
import module_4115 from "module_4115";
2026-07-23 10:11:24 +00:00
2026-07-29 08:29:29 +00:00
let c10;
2026-07-23 10:11:24 +00:00
let closure_12;
2026-07-24 07:16:23 +00:00
let closure_14;
let closure_15;
2026-07-29 08:29:29 +00:00
let unpackModuleId;
2026-07-23 10:11:24 +00:00
const require = arg1;
2026-07-20 16:05:17 +00:00
function GestureWrapper(children) {
2026-07-29 08:29:29 +00:00
let c0;
let isScreenLandscape;
const tmp = createCacheKey();
c0 = tmp;
2026-08-15 05:55:55 +00:00
isScreenLandscape = isScreenLandscape(8944).useIsScreenLandscape();
2026-07-23 10:11:24 +00:00
let items = [isScreenLandscape, tmp];
2026-07-20 16:05:17 +00:00
const style = React.useMemo(() => {
2026-07-29 08:29:29 +00:00
const items = [_undefined.flex, ];
2026-07-20 16:05:17 +00:00
let rootBackgroundColor;
if (isScreenLandscape) {
2026-07-29 08:29:29 +00:00
rootBackgroundColor = _undefined.rootBackgroundColor;
2026-07-20 16:05:17 +00:00
}
items[1] = rootBackgroundColor;
return items;
}, items);
2026-08-15 05:55:55 +00:00
return callback2(importDefault(13920), { style, children: children.children });
2026-07-20 16:05:17 +00:00
}
function handleNavigationOnReady() {
2026-08-15 05:55:55 +00:00
importDefault(5263).flush();
2026-07-29 08:29:29 +00:00
const ComponentDispatch = require(1231) /* ComponentDispatcher */.ComponentDispatch;
2026-07-20 16:05:17 +00:00
ComponentDispatch.dispatch(constants.NAVIGATOR_READY);
2026-07-29 08:29:29 +00:00
const routingInstrumentation = require(1209) /* _maybeBackfillMissingBreadcrumbsFromTelemetryRing */.routingInstrumentation;
2026-08-15 05:55:55 +00:00
const obj = importDefault(5263);
const result = routingInstrumentation.registerNavigationContainer(require(4230) /* getRootNavigationRef */.getRootNavigationRef());
2026-07-23 10:11:24 +00:00
callback();
2026-07-20 16:05:17 +00:00
}
function AppNavigationContainer(children) {
2026-07-29 08:29:29 +00:00
let closure_0;
let _require;
closure_0 = React.useRef(undefined);
2026-07-23 10:11:24 +00:00
const callback = React.useCallback(() => {
2026-07-24 07:16:23 +00:00
const rootNavigationRef = ref2(outer1_3[17]).getRootNavigationRef();
2026-07-20 16:05:17 +00:00
if (null != rootNavigationRef) {
if (rootNavigationRef.isReady()) {
const currentRoute = rootNavigationRef.getCurrentRoute();
2026-07-29 08:29:29 +00:00
let tmpResult = tmp(tmp2[22]);
tmpResult = tmp(tmp2[22]);
const tmp4 = null != tmpResult.coerceGuildsRoute(currentRoute);
const tmp5 = ref;
2026-07-20 16:05:17 +00:00
if (tmp6) {
2026-07-29 08:29:29 +00:00
outer1_2(tmp2[25]).track(outer1_10.NAV_DRAWER_OPENED);
const obj5 = outer1_2(tmp2[25]);
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
tmp5.current = currentRoute;
tmp6 = null != tmpResult.coerceChannelRoute(ref.current) && null != tmpResult.coerceGuildsRoute(currentRoute);
const tmp14 = outer1_4(outer1_2(tmp2[21])(currentRoute, true), 2)[1];
if (null != tmp14) {
if (outer1_13(tmp14)) {
if (tmp14 !== outer1_9.getChannelId()) {
const coerceChannelRouteResult = tmp(tmp2[22]).coerceChannelRoute(currentRoute);
if (!tmp18) {
tmp(tmp2[23]).transitionTo(outer1_12.CHANNEL(tmp13, tmp14), { openChannel: true, navigationReplace: false });
const tmpResult2 = tmp(tmp2[23]);
2026-07-24 07:16:23 +00:00
}
2026-07-29 08:29:29 +00:00
tmp18 = null != coerceChannelRouteResult && coerceChannelRouteResult.params.showCreateThread;
const tmpResult1 = tmp(tmp2[22]);
2026-07-20 16:05:17 +00:00
}
}
}
2026-07-29 08:29:29 +00:00
const tmp12 = outer1_4(outer1_2(tmp2[21])(currentRoute, true), 2);
2026-07-20 16:05:17 +00:00
}
}
2026-07-23 10:11:24 +00:00
outer1_7();
2026-07-20 16:05:17 +00:00
}, []);
const memo = React.useMemo(() => {
2026-08-15 05:55:55 +00:00
const tmp = callback(4231)();
2026-07-20 16:05:17 +00:00
let name;
2026-07-29 08:29:29 +00:00
if (tmp != null) {
2026-07-20 16:05:17 +00:00
const first = tmp.routes[0];
2026-07-29 08:29:29 +00:00
if (first != null) {
2026-07-20 16:05:17 +00:00
name = first.name;
}
}
2026-08-15 05:55:55 +00:00
callback(13924).log("Initial Screen: " + name);
2026-07-20 16:05:17 +00:00
return tmp;
}, []);
2026-07-29 08:29:29 +00:00
_require = React.useRef(true);
2026-07-20 16:05:17 +00:00
const effect = React.useEffect(() => {
if (ref2.current) {
2026-07-29 08:29:29 +00:00
tmp.current = false;
2026-07-20 16:05:17 +00:00
} else {
const _setTimeout = setTimeout;
const timeout = setTimeout(() => {
2026-07-29 08:29:29 +00:00
const rootNavigationRef = callback(table[17]).getRootNavigationRef();
2026-07-20 16:05:17 +00:00
if (null != rootNavigationRef) {
if (rootNavigationRef.isReady()) {
const routes = rootNavigationRef.getState().routes;
const found = routes.filter((name) => "modal" === name.name);
2026-07-29 08:29:29 +00:00
rootNavigationRef.reset(callback2(table[26])(found));
2026-07-20 16:05:17 +00:00
}
}
}, 0);
return () => {
clearTimeout(closure_0);
};
}
}, []);
2026-08-15 05:55:55 +00:00
let obj = _require(6552);
const navigationTheme = obj.useNavigationTheme(importDefault(4310)());
2026-08-06 08:05:19 +00:00
obj = { theme: navigationTheme, ref: null, onReady: null, onStateChange: null, initialState: null, navigationInChildEnabled: true, children: null };
2026-08-15 05:55:55 +00:00
let tmp = importDefault(4310)();
obj[1] = _require(4230).getRootNavigationRef();
2026-07-29 08:29:29 +00:00
obj[2] = handleNavigationOnReady;
obj[3] = callback;
obj[4] = memo;
2026-08-06 08:05:19 +00:00
obj[6] = children.children;
2026-08-15 05:55:55 +00:00
return callback2(_require(1501).NavigationContainer, obj);
2026-07-20 16:05:17 +00:00
}
function ShareNavigationContainer(children) {
2026-08-15 05:55:55 +00:00
const tmp = importDefault(4310)();
const theme = require(6552) /* useNavigationTheme */.useNavigationTheme(tmp);
return callback2(require(1501) /* createStandardNavigationFactories */.NavigationContainer, { theme, navigationInChildEnabled: true, children: children.children });
2026-07-20 16:05:17 +00:00
}
function AppNavigationContainerOrEmpty(arg0) {
let appEntryKey;
let children;
({ children, appEntryKey } = arg0);
if ("main" === appEntryKey) {
2026-07-29 08:29:29 +00:00
let obj = { children: null };
obj[0] = children;
2026-07-23 10:11:24 +00:00
return callback2(AppNavigationContainer, obj);
2026-07-20 16:05:17 +00:00
} else if ("share" === appEntryKey) {
2026-07-29 08:29:29 +00:00
obj = { children: null };
obj[0] = children;
2026-07-23 10:11:24 +00:00
return callback2(ShareNavigationContainer, obj);
2026-07-20 16:05:17 +00:00
} else {
2026-08-11 06:20:06 +00:00
obj = require(1370) /* isDiscordFrontendDevelopment */;
2026-07-20 16:05:17 +00:00
return obj.assertNever(appEntryKey);
}
}
2026-07-29 08:29:29 +00:00
({ AnalyticEvents: c10, ComponentActions: unpackModuleId, Routes: closure_12 } = ME);
2026-07-24 07:16:23 +00:00
({ jsx: closure_14, jsxs: closure_15 } = jsxProd);
2026-07-29 08:29:29 +00:00
createCacheKey = { flex: { flex: 1 }, rootBackgroundColor: null };
createCacheKey = { backgroundColor: require("Themes").colors.ANDROID_NAVIGATION_BAR_BACKGROUND };
createCacheKey[1] = createCacheKey;
createCacheKey = createCacheKey.createStyles(createCacheKey);
2026-08-15 05:55:55 +00:00
let result = module_4115.configureReanimatedLogger({ level: require("module_4115").ReanimatedLogLevel.error, strict: false });
2026-07-29 08:29:29 +00:00
try {
require("enableScreens").enableFreeze();
let obj6 = require("enableScreens");
let obj2 = { useTrackNavigatorScreenImpression: null };
obj2[0] = require("useTrackNavigatorScreenImpression").useTrackNavigatorScreenImpression;
require("designConfig").setDesignConfig(obj2);
let c22 = false;
let closure_23 = { code: "function AppContainerTsx1(){const{RNScreensTurboModule}=this.__closure;global.RNScreensTurboModule=RNScreensTurboModule;}" };
let obj7 = require("designConfig");
const result1 = require("module_1208").profiledRootComponent(function AppContainer(children) {
children = children.children;
2026-08-11 06:20:06 +00:00
let riveAppStatePlaybackExperiment = children;
2026-07-29 08:29:29 +00:00
const appEntryKey = children.appEntryKey;
2026-08-11 06:20:06 +00:00
let memo = appEntryKey;
2026-07-29 08:29:29 +00:00
let memo1;
2026-08-15 05:55:55 +00:00
const requestGatewaySocket = memo(13925).useRequestGatewaySocket("AppContainer:" + appEntryKey);
2026-07-29 08:29:29 +00:00
const effect = React.useEffect(() => {
if (!c22) {
RNScreensTurboModule = RNScreensTurboModule.RNScreensTurboModule;
2026-08-15 05:55:55 +00:00
let obj = memo(4115);
2026-07-29 08:29:29 +00:00
const fn = function e() {
RNScreensTurboModule.RNScreensTurboModule = RNScreensTurboModule;
};
obj = { RNScreensTurboModule: null };
obj[0] = RNScreensTurboModule;
fn.__closure = obj;
fn.__workletHash = 8891274578898;
fn.__initData = closure_23;
obj.runOnUI(fn)();
c22 = true;
}
}, []);
const effect1 = React.useEffect(() => {
2026-08-11 06:20:06 +00:00
let SplashScreenManager = memo(500).isIOS();
2026-07-29 08:29:29 +00:00
if (SplashScreenManager) {
SplashScreenManager = closure_6.SplashScreenManager;
}
if (SplashScreenManager) {
const SplashScreenManager2 = closure_6.SplashScreenManager;
SplashScreenManager2.hideSplashScreen();
}
}, []);
riveAppStatePlaybackExperiment = undefined;
2026-08-11 06:20:06 +00:00
memo = undefined;
2026-08-15 05:55:55 +00:00
let obj = memo(13925);
riveAppStatePlaybackExperiment = memo(15206).useRiveAppStatePlaybackExperiment("AppContainer");
2026-08-11 06:20:06 +00:00
let items = [riveAppStatePlaybackExperiment];
memo = React.useMemo(() => {
2026-07-20 16:05:17 +00:00
const items = [];
if (riveAppStatePlaybackExperiment) {
items.push("rive-app-state-playback");
}
return items;
}, items);
2026-07-29 08:29:29 +00:00
let items1 = [memo];
memo1 = React.useMemo(() => {
2026-07-23 10:11:24 +00:00
obj = {
2026-07-20 16:05:17 +00:00
experiments: obj,
captureException(arg0, tags) {
2026-08-11 06:20:06 +00:00
let obj = callback(table[51]);
2026-07-20 16:05:17 +00:00
obj = { tags };
return obj.captureException(arg0, obj);
}
};
2026-08-11 06:20:06 +00:00
obj = { enabledExperiments: memo };
2026-07-20 16:05:17 +00:00
return obj;
}, items1);
2026-07-29 08:29:29 +00:00
const items2 = [appEntryKey, children, memo1];
return React.useMemo(() => {
let obj = { profile: null, children: null };
2026-08-11 06:20:06 +00:00
obj[0] = memo(outer1_3[33]).Profiles.AppContainer;
2026-07-29 08:29:29 +00:00
obj = { children: null };
obj = { children: null };
const obj1 = { value: memo1, children: null };
const obj2 = { children: null };
const tmp = memo1(outer1_3[33]);
2026-08-11 06:20:06 +00:00
const obj3 = { value: memo, children: null };
const obj4 = { appEntryKey: memo, children: null };
2026-07-29 08:29:29 +00:00
const obj5 = { children: null };
const obj6 = { history: null, children: null };
let obj9 = memo1(outer1_3[41]);
obj6[0] = obj9.getHistory();
const obj7 = { children: null };
const obj8 = { children: null };
const tmp2 = memo1(outer1_3[37]);
obj9 = { children: null };
const obj10 = { children: null };
const obj11 = { children: null };
const tmp3 = memo1(outer1_3[42]);
const items = [outer1_14(memo1(outer1_3[46]), {}), ];
const obj12 = { children: null };
2026-08-11 06:20:06 +00:00
const items1 = [riveAppStatePlaybackExperiment, outer1_14(memo(outer1_3[47]).SafeAreaReporter, {}), outer1_14(memo1(outer1_3[48]), {}), outer1_14(memo1(outer1_3[49]), {})];
2026-07-29 08:29:29 +00:00
obj12[0] = items1;
2026-08-11 06:20:06 +00:00
items[1] = outer1_15(memo(outer1_3[47]).SafeAreaProvider, obj12);
2026-07-29 08:29:29 +00:00
obj11[0] = items;
obj10[0] = outer1_15(memo1(outer1_3[45]), obj11);
obj9[0] = outer1_14(memo1(outer1_3[44]).Component, obj10);
2026-08-11 06:20:06 +00:00
obj8[0] = outer1_14(memo(outer1_3[43]).PortalProvider, obj9);
2026-07-29 08:29:29 +00:00
obj7[0] = outer1_14(tmp3, obj8);
obj6[1] = outer1_14(outer1_17, obj7);
2026-08-11 06:20:06 +00:00
obj5[0] = outer1_14(memo(outer1_3[40]).Router, obj6);
obj4[1] = outer1_14(memo(outer1_3[39]).WebViewContextProvider, obj5);
2026-07-29 08:29:29 +00:00
obj3[1] = outer1_14(outer1_21, obj4);
2026-08-11 06:20:06 +00:00
obj2[0] = outer1_14(memo(outer1_3[38]).AppEntryKeyContext.Provider, obj3);
2026-07-29 08:29:29 +00:00
obj1[1] = outer1_14(tmp2, obj2);
2026-08-11 06:20:06 +00:00
obj[0] = outer1_14(memo(outer1_3[36]).ManaContextProvider, obj1);
obj[0] = outer1_14(memo(outer1_3[35]).RootThemeContextProvider, obj);
obj[1] = outer1_14(memo(outer1_3[34]).ReanimatedScreenProvider, obj);
2026-07-29 08:29:29 +00:00
return outer1_14(tmp, obj);
}, items2);
});
const importDefaultResult = require("module_1208");
const result2 = require("get ActivityIndicator").fileFinishedImporting("components_native/AppContainer.tsx");
exports.default = result1;
} catch (err) {
}