Skipped 1 file(s) >100MB (GitHub limit): source/__polyfill/04xxx/module_4973.js (118.4 MB)
107 lines
4.6 KiB
TypeScript
107 lines
4.6 KiB
TypeScript
// Module ID: 9597
|
|
// Function ID: 9598
|
|
// Name: FramesManager
|
|
// Dependencies: [9345, 9346, 1074, 4692, 7395, 9598, 1241, 573, 2]
|
|
|
|
// Module 9597 (FramesManager)
|
|
import DispatcherDefault from "Dispatcher" /* 573 */;
|
|
import AnalyticsUtilsDefault from "AnalyticsUtils" /* 1241 */;
|
|
import FramesStore from "FramesStore" /* 9345 */;
|
|
import AutomaticLifecycleManager from "AutomaticLifecycleManager" /* 7395 */;
|
|
|
|
let require = fn;
|
|
const EmbeddedSurfaceType = fn(9346).EmbeddedSurfaceType;
|
|
const Constants = fn(1074);
|
|
({ AnalyticEvents: hasOwnProperty, RPCCloseCodes: metroRequire } = Constants);
|
|
const TransportTypes = fn(4692).TransportTypes;
|
|
class FramesManager extends tmp3 {
|
|
constructor() {
|
|
applyArgumentsResult = HermesBuiltin.applyArguments(new.target, new.target);
|
|
closure_0 = applyArgumentsResult;
|
|
applyArgumentsResult.actions = {
|
|
RPC_APP_DISCONNECTED(arg0) {
|
|
applyArgumentsResult.handleRPCDisconnect(arg0);
|
|
},
|
|
FRAME_LAUNCH(arg0) {
|
|
({ applicationId, analyticsContext } = arg0);
|
|
const result = applyArgumentsResult(9598).trackFrameSessionStart(applicationId, analyticsContext);
|
|
},
|
|
FRAME_LAUNCH_FAIL(arg0) {
|
|
({ applicationId, error, analyticsContext } = arg0);
|
|
const result = applyArgumentsResult(9598).trackFrameSessionStartFailed(applicationId, error, analyticsContext);
|
|
},
|
|
FRAME_STOP(applicationId) {
|
|
applyArgumentsResult(9598).trackFrameSessionEnd(applicationId.applicationId);
|
|
},
|
|
VOICE_CHANNEL_SELECT(arg0) {
|
|
const result = applyArgumentsResult.handleVoiceChannelSelect(arg0);
|
|
},
|
|
CHANNEL_DELETE(channel) {
|
|
const framesForChannel = FramesStore.getFramesForChannel(channel.channel.id);
|
|
for (const item10010 of framesForChannel) {
|
|
let leaveFrameResult = applyArgumentsResult.leaveFrame(item10010.id);
|
|
continue;
|
|
}
|
|
},
|
|
CHANNEL_UPDATES(arg0) {
|
|
for (const item10008 of tmp) {
|
|
let tmp2 = item10008;
|
|
let framesForChannel = FramesStore.getFramesForChannel(item10008.id);
|
|
for (const item10018 of framesForChannel) {
|
|
if (item10018.applicationId !== tmp2.application_id) {
|
|
let leaveFrameResult = applyArgumentsResult.leaveFrame(tmp7.id);
|
|
}
|
|
continue;
|
|
}
|
|
continue;
|
|
}
|
|
}
|
|
};
|
|
applyArgumentsResult.handleVoiceChannelSelect = function handleVoiceChannelSelect(currentVoiceChannelId) {
|
|
currentVoiceChannelId = currentVoiceChannelId.currentVoiceChannelId;
|
|
if (null != currentVoiceChannelId) {
|
|
if (currentVoiceChannelId !== currentVoiceChannelId.channelId) {
|
|
const obj = { type: EmbeddedSurfaceType.VOICE_CHANNEL, channelId: currentVoiceChannelId };
|
|
const framesForSurface = FramesStore.getFramesForSurface(obj);
|
|
for (const item10014 of framesForSurface) {
|
|
let leaveFrameResult = applyArgumentsResult.leaveFrame(item10014.id);
|
|
continue;
|
|
}
|
|
}
|
|
}
|
|
};
|
|
applyArgumentsResult.handleRPCDisconnect = function handleRPCDisconnect(arg0) {
|
|
({ reason, source } = arg0);
|
|
if (null != reason) {
|
|
if (source.type === TransportTypes.POST_MESSAGE) {
|
|
const frameByIframeId = FramesStore.getFrameByIframeId(source.iframeId);
|
|
if (null != frameByIframeId) {
|
|
applyArgumentsResult.leaveFrame(frameByIframeId.id);
|
|
if (reason.code !== constants2.CLOSE_NORMAL) {
|
|
const obj4 = { rpc_close_code: null, rpc_message: null, application_id: null };
|
|
({ code: obj2.rpc_close_code, message: obj2.rpc_message } = reason);
|
|
obj4.application_id = frameByIframeId.applicationId;
|
|
AnalyticsUtilsDefault.track(constants.ACTIVITY_CLOSED_RPC_ERROR, obj4);
|
|
const result = obj3.showRPCDisconnectErrorUI(reason);
|
|
}
|
|
obj3 = applyArgumentsResult;
|
|
}
|
|
}
|
|
}
|
|
};
|
|
return applyArgumentsResult;
|
|
}
|
|
}
|
|
FramesManager.prototype["leaveFrame"] = function leaveFrame(frameId) {
|
|
const frame = FramesStore.getFrame(frameId);
|
|
if (null != frame) {
|
|
({ applicationId: obj2.applicationId, id: obj2.frameId } = frame);
|
|
DispatcherDefault.dispatch({ type: "FRAME_STOP", applicationId: null, frameId: null });
|
|
const obj3 = { type: "FRAME_STOP", applicationId: null, frameId: null };
|
|
}
|
|
};
|
|
FramesManager.displayName = "FramesManager";
|
|
const size = fn(2);
|
|
let result = size.fileFinishedImporting("modules/frames/FramesManager.tsx");
|
|
|
|
export default FramesManager;
|