decord/stable/source/modules/frames/FramesManager.tsx
github-actions e2bc0408ee chore: update source for stable 346.13
Skipped 1 file(s) >100MB (GitHub limit): source/__polyfill/04xxx/module_4821.js (118.4 MB)
2026-09-22 22:11:40 +00:00

107 lines
4.6 KiB
TypeScript

// Module ID: 9699
// Function ID: 9700
// Name: FramesManager
// Dependencies: [9640, 9641, 1074, 4541, 7221, 9648, 1240, 573, 2]
// Module 9699 (FramesManager)
import DispatcherDefault from "Dispatcher" /* 573 */;
import AnalyticsUtilsDefault from "AnalyticsUtils" /* 1240 */;
import FramesStore from "FramesStore" /* 9640 */;
import AutomaticLifecycleManager from "AutomaticLifecycleManager" /* 7221 */;
let require = fn;
const EmbeddedSurfaceType = fn(9641).EmbeddedSurfaceType;
const Constants = fn(1074);
({ AnalyticEvents: hasOwnProperty, RPCCloseCodes: metroRequire } = Constants);
const TransportTypes = fn(4541).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(9648).trackFrameSessionStart(applicationId, analyticsContext);
},
FRAME_LAUNCH_FAIL(arg0) {
({ applicationId, error, analyticsContext } = arg0);
const result = applyArgumentsResult(9648).trackFrameSessionStartFailed(applicationId, error, analyticsContext);
},
FRAME_STOP(applicationId) {
applyArgumentsResult(9648).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;