118 lines
7.5 KiB
TypeScript
118 lines
7.5 KiB
TypeScript
/* Metro module 15397; source: modules/frames/native/FrameView.tsx; dependencies: [57, 31, 8065, 8066, 4237, 33, 566, 6772, 694, 8069, 10704, 15398, 15399, 10716, 2] */
|
|
import Module00057 from '../../../by-id/module-00057.js'; /* Metro dependency 57 */
|
|
import FramesStore from '../FramesStore.tsx'; /* Metro dependency 8065 */
|
|
import FrameWebView from './FrameWebView.tsx'; /* Metro dependency 15399 */
|
|
import * as FileImportTrackerModule from '../../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
|
|
import * as ReactModule from '../../../by-id/module-00031-React.js'; /* Metro dependency 31 */
|
|
import * as JsxRuntimeModule from '../../../by-id/module-00033-JsxRuntime.js'; /* Metro dependency 33 */
|
|
import * as ConstantsModule from '../../activities/Constants.tsx'; /* Metro dependency 4237 */
|
|
import * as ApplicationActionCreatorsModule from '../../applications/ApplicationActionCreators.tsx'; /* Metro dependency 6772 */
|
|
import * as FramesConstantsModule from '../FramesConstants.tsx'; /* Metro dependency 8066 */
|
|
import * as FramesNativeManagerModule from './FramesNativeManager.tsx'; /* Metro dependency 8069 */
|
|
import * as EmbeddedActivityViewModule from '../../activities/native/EmbeddedActivityView.tsx'; /* Metro dependency 10704 */
|
|
|
|
function _fun117689(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#117689, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15594:6, offset: 0x024bde7a, size: 236 bytes, params: 8, frame: 19
|
|
const env0_0 = require;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
let value = ReactModule;
|
|
value = value.memo(FrameViewInner);
|
|
(FileImportTrackerModule).fileFinishedImporting('modules/frames/native/FrameView.tsx');
|
|
exports.default = value;
|
|
exports.FrameView = value;
|
|
function FrameViewInner({layoutMode, portraitSafeAreasConfig, landscapeSafeAreasConfig}) { // fn#117690, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15594:208, offset: 0x024bdf66, size: 703 bytes, params: 2, frame: 31
|
|
let env0_3 = undefined;
|
|
const connectedFrame = (require(566) /* metro dependency 566: flux */).useStateFromStores([FramesStore],
|
|
function() {
|
|
return FramesStore.getConnectedFrame();
|
|
});
|
|
const useApplication = ApplicationActionCreatorsModule.useApplication;
|
|
let applicationId = connectedFrame?.applicationId;
|
|
const data = Reflect.apply(useApplication, ApplicationActionCreatorsModule, [applicationId]).data;
|
|
const value3 = (require(566) /* metro dependency 566: flux */).useStateFromStores([FramesStore], _fun117692,
|
|
[connectedFrame]);
|
|
const binding = env0_4;
|
|
const [property, property2] = env0_3(binding.useState(true), 2);
|
|
binding.useLayoutEffect(_fun117693, [layoutMode]);
|
|
applicationId = connectedFrame?.applicationId;
|
|
const value6 = env0_4.useCallback(_fun117694, [applicationId]);
|
|
let r6 = connectedFrame == null || property;
|
|
r6 = !r6 ? applicationId == null : r6;
|
|
r6 = !r6 ? data == null : r6;
|
|
const useBaseActivityView = EmbeddedActivityViewModule.useBaseActivityView;
|
|
object = {orientationLockState: value3, showLoadingIndicator: r6,
|
|
setShowLoadingStateForLockingOrientation: property2, application: data};
|
|
object.setOrientationLockState = (require(15398) /* metro dependency 15398: getDefaultOrientationLockState */).setOrientationLockState;
|
|
const value10 = Reflect.apply(useBaseActivityView, EmbeddedActivityViewModule, [object]);
|
|
const isResetting = value10.isResetting;
|
|
env0_3 = value10.setIsResetting;
|
|
const isLandscape = value10.isLandscape;
|
|
if (connectedFrame == null) {
|
|
return null;
|
|
}
|
|
object = {instance_id: 'example-cl-instance'};
|
|
const MOBILE = ActivityPlatform.MOBILE;
|
|
object.platform = MOBILE;
|
|
if (connectedFrame.proxyTicket != null) {
|
|
object.discord_proxy_ticket = connectedFrame.proxyTicket;
|
|
}
|
|
const BaseActivityView = EmbeddedActivityViewModule.BaseActivityView;
|
|
const defaultImportProps = {onActivityCrash: function() {
|
|
setIsResetting(true);
|
|
global.setTimeout(_fun117696, 0);
|
|
}, applicationId: applicationId, activityUrl: connectedFrame.url, queryParams: object, onLoadError: value6,
|
|
allowPopups: (require(10716) /* metro dependency 10716: allowPopups */).allowPopups(data),
|
|
referrerPolicy: 'origin'};
|
|
const PIP = FrameLayoutModes.PIP;
|
|
defaultImportProps.isPipOrGridMode = layoutMode === PIP;
|
|
const FRAME_WEB_VIEW_KEY = (FramesNativeManagerModule).FRAME_WEB_VIEW_KEY;
|
|
defaultImportProps.webViewKey = FRAME_WEB_VIEW_KEY;
|
|
defaultImportProps.safeAreasConfig = isLandscape ? landscapeSafeAreasConfig : portraitSafeAreasConfig;
|
|
return (
|
|
<BaseActivityView
|
|
wakeLockKey="FrameActivities"
|
|
showLoadingIndicator={r6}
|
|
isResetting={isResetting}
|
|
>
|
|
<FrameWebView {...defaultImportProps} />
|
|
</BaseActivityView>
|
|
);
|
|
function _fun117692() { // fn#117692, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15594:463, offset: 0x024be225, size: 47 bytes, params: 1, frame: 12
|
|
return connectedFrame != null ? FramesStore.getOrientationLockStateForApp(connectedFrame.applicationId) : undefined;
|
|
}
|
|
|
|
function _fun117693() { // fn#117693, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15594:596, offset: 0x024be254, size: 86 bytes, params: 1, frame: 13
|
|
var value2;
|
|
if (connectedFrame != null) {
|
|
value2 = environment.__proto__;
|
|
(importDefault(694) /* metro dependency 694: Dispatcher */).dispatch({type: 'FRAME_UPDATE_LAYOUT_MODE',
|
|
layoutMode: layoutMode, applicationId: connectedFrame.applicationId});
|
|
}
|
|
}
|
|
|
|
function _fun117694() { // fn#117694, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15594:766, offset: 0x024be2aa, size: 63 bytes, params: 1, frame: 12
|
|
var value2;
|
|
if (applicationId != null) {
|
|
value2 = environment.__proto__;
|
|
(importDefault(8069) /* metro dependency 8069: FramesNativeManager */).leaveFrame({applicationId: applicationId});
|
|
}
|
|
}
|
|
|
|
function FrameViewInnerOnActivityCrash() { // fn#117695, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15594:1384, owner: FrameViewInner.onActivityCrash, offset: 0x024be2e9, size: 43 bytes, params: 1, frame: 13
|
|
setIsResetting(true);
|
|
global.setTimeout(function() {
|
|
return setIsResetting(false);
|
|
}, 0);
|
|
function _fun117696() { // fn#117696, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15594:1407, offset: 0x01ef13d1, size: 18 bytes, params: 1, frame: 11
|
|
return setIsResetting(false);
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
global.__d(_fun117689, 15397, [57, 31, 8065, 8066, 4237, 33, 566, 6772, 694, 8069, 10704, 15398, 15399, 10716,
|
|
2]) /* metro module 15397, dependencies: [57, 31, 8065, 8066, 4237, 33, 566, 6772, 694, 8069, 10704, 15398, 15399, 10716, 2] */;
|