decord/source/modules/rpc/server/events/subscriptionHelpers.tsx

133 lines
4.6 KiB
TypeScript
Raw Normal View History

2026-08-08 06:10:11 +00:00
// Module ID: 13768
// Function ID: 13769
2026-07-20 16:05:17 +00:00
// Name: getInitialSubscriptionPayload
2026-08-08 06:10:11 +00:00
// Dependencies: [1371, 10591, 7160, 4206, 676, 4328, 10592, 10975, 4849, 13731, 7183, 2]
2026-07-20 16:05:17 +00:00
// Exports: getInitialSubscriptionPayload
2026-08-08 06:10:11 +00:00
// Module 13768 (getInitialSubscriptionPayload)
2026-07-29 08:29:29 +00:00
import participantFromServer from "participantFromServer";
import map from "map";
import initializeState from "initializeState";
2026-08-06 08:05:19 +00:00
import { TransportTypes } from "RPC_SCOPE_CONFIG";
2026-07-23 10:11:24 +00:00
import { RPCEvents } from "ME";
import items3 from "items3";
2026-08-06 08:05:19 +00:00
import { asLaunched } from "FrameLayoutModes";
2026-07-20 16:05:17 +00:00
2026-07-29 08:29:29 +00:00
let error;
2026-08-06 08:05:19 +00:00
let metroImportAll;
2026-07-23 10:11:24 +00:00
const require = arg1;
2026-08-06 08:05:19 +00:00
({ ActivityLayoutMode: error, ActivityScreenOrientation: metroImportAll } = items3);
2026-07-29 08:29:29 +00:00
const result = require("initializeState").fileFinishedImporting("modules/rpc/server/events/subscriptionHelpers.tsx");
2026-07-23 10:11:24 +00:00
2026-07-29 08:29:29 +00:00
export const getInitialSubscriptionPayload = function getInitialSubscriptionPayload(closure_1, participantFromServer, c3) {
if (RPCEvents.ACTIVITY_PIP_MODE_UPDATE === participantFromServer) {
2026-08-06 08:05:19 +00:00
const application3 = closure_1.application;
2026-07-20 16:05:17 +00:00
let id;
2026-08-06 08:05:19 +00:00
if (application3 != null) {
id = application3.id;
2026-07-20 16:05:17 +00:00
}
let layoutModeForApp = null;
if (null != id) {
layoutModeForApp = store.getLayoutModeForApp(id);
}
2026-08-06 08:05:19 +00:00
let tmp39 = null;
2026-07-20 16:05:17 +00:00
if (null != layoutModeForApp) {
2026-07-29 08:29:29 +00:00
let obj = { is_pip_mode: null };
obj[0] = layoutModeForApp !== constants.FOCUSED;
2026-08-06 08:05:19 +00:00
tmp39 = obj;
2026-07-20 16:05:17 +00:00
}
2026-08-06 08:05:19 +00:00
return tmp39;
2026-07-29 08:29:29 +00:00
} else if (tmp.ACTIVITY_LAYOUT_MODE_UPDATE === participantFromServer) {
2026-08-06 08:05:19 +00:00
const application2 = closure_1.application;
2026-07-20 16:05:17 +00:00
let id1;
2026-08-06 08:05:19 +00:00
if (application2 != null) {
id1 = application2.id;
2026-07-20 16:05:17 +00:00
}
let layoutModeForApp1 = null;
if (null != id1) {
layoutModeForApp1 = store.getLayoutModeForApp(id1);
}
2026-08-06 08:05:19 +00:00
let tmp34 = null;
2026-07-20 16:05:17 +00:00
if (null != layoutModeForApp1) {
2026-07-29 08:29:29 +00:00
obj = { layout_mode: null };
obj[0] = layoutModeForApp1;
2026-08-06 08:05:19 +00:00
tmp34 = obj;
2026-07-20 16:05:17 +00:00
}
2026-08-06 08:05:19 +00:00
return tmp34;
2026-07-29 08:29:29 +00:00
} else if (tmp.FRAME_LAYOUT_MODE_UPDATE === participantFromServer) {
2026-08-06 08:05:19 +00:00
if (closure_1.source.type !== TransportTypes.POST_MESSAGE) {
return null;
} else {
const tmp27 = asLaunched(frameByIframeId.getFrameByIframeId(closure_1.source.iframeId));
let tmp28 = null;
if (null != tmp27) {
const obj1 = { layout_mode: null };
obj1[0] = tmp27.data.layoutMode;
tmp28 = obj1;
2026-07-20 16:05:17 +00:00
}
2026-08-06 08:05:19 +00:00
return tmp28;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
} else if (tmp.THERMAL_STATE_UPDATE === participantFromServer) {
2026-08-08 06:10:11 +00:00
const thermalState = require(10975) /* useThermalState */.getThermalState();
2026-07-20 16:05:17 +00:00
let tmp23 = null;
2026-08-08 06:10:11 +00:00
if (thermalState !== require(10975) /* useThermalState */.ThermalStates.UNHANDLED) {
2026-07-29 08:29:29 +00:00
let obj2 = { thermal_state: null };
obj2[0] = thermalState;
2026-07-20 16:05:17 +00:00
tmp23 = obj2;
}
return tmp23;
2026-07-29 08:29:29 +00:00
} else if (tmp.ORIENTATION_UPDATE === participantFromServer) {
2026-08-08 06:10:11 +00:00
let obj3 = require(4849) /* getIsScreenLandscape */;
2026-07-29 08:29:29 +00:00
obj3 = { screen_orientation: null };
2026-08-06 08:05:19 +00:00
obj3[0] = obj3.getIsScreenLandscape() ? closure_8.LANDSCAPE : closure_8.PORTRAIT;
2026-07-20 16:05:17 +00:00
return obj3;
2026-07-29 08:29:29 +00:00
} else if (tmp.ACTIVITY_INSTANCE_PARTICIPANTS_UPDATE === participantFromServer) {
2026-08-08 06:10:11 +00:00
obj2 = require(13731) /* activityInstanceConnectedParticipants */;
2026-07-20 16:05:17 +00:00
return obj2.activityInstanceConnectedParticipants();
2026-07-29 08:29:29 +00:00
} else if (tmp.QUEST_ENROLLMENT_STATUS_UPDATE === participantFromServer) {
const quest_id = c3.quest_id;
2026-07-20 16:05:17 +00:00
if (quest_id) {
2026-07-23 10:11:24 +00:00
quest = quest.getQuest(quest_id);
2026-08-08 06:10:11 +00:00
obj = require(7183) /* getApplicationIdsByTaskTypes */;
2026-07-20 16:05:17 +00:00
const activityApplicationId = obj.getActivityApplicationId(quest);
2026-07-29 08:29:29 +00:00
let tmp11 = null;
2026-07-20 16:05:17 +00:00
if (null != quest) {
2026-07-29 08:29:29 +00:00
tmp11 = null;
2026-07-20 16:05:17 +00:00
if (null != activityApplicationId) {
2026-07-29 08:29:29 +00:00
const application = closure_1.application;
2026-08-06 08:05:19 +00:00
let id2;
2026-07-29 08:29:29 +00:00
if (application != null) {
2026-08-06 08:05:19 +00:00
id2 = application.id;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
tmp11 = null;
2026-08-06 08:05:19 +00:00
if (activityApplicationId === id2) {
2026-07-29 08:29:29 +00:00
const obj4 = { quest_id: null, is_enrolled: null, enrolled_at: null };
obj4[0] = quest_id;
2026-07-20 16:05:17 +00:00
const userStatus = quest.userStatus;
let enrolledAt;
2026-07-29 08:29:29 +00:00
if (userStatus != null) {
2026-07-20 16:05:17 +00:00
enrolledAt = userStatus.enrolledAt;
}
2026-07-29 08:29:29 +00:00
obj4[1] = null != enrolledAt;
2026-07-20 16:05:17 +00:00
const userStatus2 = quest.userStatus;
let enrolledAt1;
2026-07-29 08:29:29 +00:00
if (userStatus2 != null) {
2026-07-20 16:05:17 +00:00
enrolledAt1 = userStatus2.enrolledAt;
}
2026-07-29 08:29:29 +00:00
if (enrolledAt1 == null) {
enrolledAt1 = null;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
obj4[2] = enrolledAt1;
tmp11 = obj4;
2026-07-20 16:05:17 +00:00
}
}
}
2026-07-29 08:29:29 +00:00
return tmp11;
2026-07-20 16:05:17 +00:00
} else {
return null;
}
} else {
return null;
}
};