decord/source/stores/InstantInviteStore.tsx

271 lines
8 KiB
TypeScript
Raw Normal View History

2026-07-25 08:10:48 +00:00
// Module ID: 6639
// Function ID: 58779
2026-07-20 16:05:17 +00:00
// Name: _isNativeReflectConstruct
2026-07-25 08:10:48 +00:00
// Dependencies: [6, 7, 15, 17, 18, 6640, 5969, 6641, 6643, 6644, 566, 686, 2]
2026-07-23 10:11:24 +00:00
2026-07-25 08:10:48 +00:00
// Module 6639 (_isNativeReflectConstruct)
2026-07-23 10:11:24 +00:00
import InviteSendStates from "InviteSendStates";
import head from "head";
import _possibleConstructorReturn from "_possibleConstructorReturn";
import _getPrototypeOf from "_getPrototypeOf";
import _inherits from "_inherits";
import _isNativeReflectConstruct from "_isNativeReflectConstruct";
import { InviteTargetTypes } from "InviteSendStates";
2026-07-20 16:05:17 +00:00
function _isNativeReflectConstruct() {
let closure_0 = !valueOf.call(Reflect.construct(Boolean, [], () => {
}));
function _isNativeReflectConstruct() {
return closure_0;
}
const result = _isNativeReflectConstruct();
}
function normalizeInviteCodeForInstallationId(inviteCode) {
return inviteCode.toLowerCase();
}
function handleReceivedInstallationIdClear(inviteCode) {
const tmp = normalizeInviteCodeForInstallationId(inviteCode.inviteCode);
if (map.has(tmp)) {
const _Map = Map;
2026-07-23 10:11:24 +00:00
map = new Map(map);
2026-07-20 16:05:17 +00:00
map.delete(tmp);
} else {
return false;
}
}
let closure_10 = {};
let closure_11 = {};
let closure_12 = {};
let closure_13 = {};
2026-07-23 10:11:24 +00:00
let c14 = false;
let c15 = false;
let c16 = false;
let map = new Map();
let tmp3 = ((Store) => {
2026-07-20 16:05:17 +00:00
class InstantInviteStore {
constructor() {
self = this;
2026-07-23 10:11:24 +00:00
tmp = outer1_2(this, InstantInviteStore);
obj = outer1_5(InstantInviteStore);
tmp2 = outer1_4;
if (outer1_18()) {
2026-07-20 16:05:17 +00:00
tmp6 = globalThis;
_Reflect = Reflect;
2026-07-23 10:11:24 +00:00
tmp7 = outer1_5;
2026-07-20 16:05:17 +00:00
tmp8 = arguments;
2026-07-23 10:11:24 +00:00
constructResult = Reflect.construct(obj, arguments, outer1_5(self).constructor);
2026-07-20 16:05:17 +00:00
} else {
tmp3 = arguments;
tmp4 = arguments;
constructResult = obj(...arguments);
}
return tmp2(self, constructResult);
}
}
callback2(InstantInviteStore, Store);
let obj = {
key: "getInvite",
value(arg0) {
let targetApplicationId;
let targetType;
let targetUserId;
let obj = arg1;
if (arg1 === undefined) {
obj = {};
}
({ targetType, targetUserId, targetApplicationId } = obj);
2026-07-23 10:11:24 +00:00
if (targetType === outer1_8.STREAM) {
2026-07-20 16:05:17 +00:00
if (null != targetUserId) {
let tmp9;
2026-07-23 10:11:24 +00:00
if (null != outer1_11[arg0]) {
2026-07-20 16:05:17 +00:00
tmp9 = tmp8[targetUserId];
}
let tmp3 = tmp9;
}
return tmp3;
}
2026-07-23 10:11:24 +00:00
if (targetType === outer1_8.EMBEDDED_APPLICATION) {
2026-07-20 16:05:17 +00:00
if (null != targetApplicationId) {
let tmp6;
2026-07-23 10:11:24 +00:00
if (null != outer1_12[arg0]) {
2026-07-20 16:05:17 +00:00
tmp6 = tmp5[targetApplicationId];
}
tmp3 = tmp6;
}
}
2026-07-23 10:11:24 +00:00
tmp3 = outer1_10[arg0];
2026-07-20 16:05:17 +00:00
}
};
const items = [obj, , , , ];
obj = {
key: "getFriendInvite",
value() {
2026-07-23 10:11:24 +00:00
return outer1_9;
2026-07-20 16:05:17 +00:00
}
};
items[1] = obj;
obj = {
key: "getFriendInvitesFetching",
value() {
2026-07-23 10:11:24 +00:00
return outer1_14;
2026-07-20 16:05:17 +00:00
}
};
items[2] = obj;
items[3] = {
key: "canRevokeFriendInvite",
value() {
2026-07-23 10:11:24 +00:00
let tmp = null != outer1_9;
2026-07-20 16:05:17 +00:00
if (tmp) {
2026-07-23 10:11:24 +00:00
tmp = !outer1_15;
2026-07-20 16:05:17 +00:00
}
if (tmp) {
2026-07-23 10:11:24 +00:00
tmp = !outer1_16;
2026-07-20 16:05:17 +00:00
}
return tmp;
}
};
items[4] = {
key: "getReceivedInstallationIdForInviteCode",
value(arg0) {
2026-07-23 10:11:24 +00:00
return outer1_17.get(outer1_19(arg0));
2026-07-20 16:05:17 +00:00
}
};
return callback(InstantInviteStore, items);
2026-07-23 10:11:24 +00:00
})(require("initialize").Store);
2026-07-20 16:05:17 +00:00
tmp3.displayName = "InstantInviteStore";
2026-07-23 10:11:24 +00:00
tmp3 = new tmp3(require("dispatcher"), {
2026-07-20 16:05:17 +00:00
CONNECTION_OPEN: function handleConnectionOpen() {
let closure_10 = {};
let closure_11 = {};
let closure_12 = {};
let closure_13 = {};
2026-07-23 10:11:24 +00:00
let c9 = null;
let c15 = false;
let c16 = false;
let c14 = false;
2026-07-20 16:05:17 +00:00
},
CHANNEL_DELETE: function handleDeleteChannel(channel) {
channel = channel.channel;
2026-07-23 10:11:24 +00:00
delete tmp4[tmp3];
delete tmp4[tmp3];
delete tmp2[tmp];
2026-07-20 16:05:17 +00:00
},
FRIEND_INVITE_CREATE_SUCCESS: function handleFriendInviteCreateSuccess(invite) {
2026-07-23 10:11:24 +00:00
closure_13[invite.invite.code] = _isNativeReflectConstruct.createFromServer(invite.invite);
2026-07-25 08:10:48 +00:00
const tmp = importDefault(6641);
const tmp2 = importDefault(6643);
const tmpResult = tmp(tmp2(importDefault(6644)(Object.values(closure_13), "createdAt")));
2026-07-20 16:05:17 +00:00
let tmp5 = null;
if (null != tmpResult) {
tmp5 = tmpResult;
}
2026-07-23 10:11:24 +00:00
let closure_9 = tmp5;
let c16 = false;
2026-07-20 16:05:17 +00:00
},
FRIEND_INVITE_CREATE_FAILURE: function handleFriendInviteCreateFailure() {
2026-07-23 10:11:24 +00:00
let c16 = false;
2026-07-20 16:05:17 +00:00
},
FRIEND_INVITE_REVOKE_SUCCESS: function handleFriendInviteRevokeSuccess(invites) {
if (null != invites.invites) {
invites = invites.invites;
const item = invites.forEach((code) => {
2026-07-23 10:11:24 +00:00
if (null != outer1_13[code.code]) {
2026-07-20 16:05:17 +00:00
code = code.code;
2026-07-23 10:11:24 +00:00
delete tmp2[tmp];
2026-07-20 16:05:17 +00:00
}
});
}
2026-07-25 08:10:48 +00:00
const tmp2 = importDefault(6641);
const tmp3 = importDefault(6643);
const tmp2Result = tmp2(tmp3(importDefault(6644)(Object.values(closure_13), "createdAt")));
2026-07-20 16:05:17 +00:00
let tmp6 = null;
if (null != tmp2Result) {
tmp6 = tmp2Result;
}
2026-07-23 10:11:24 +00:00
let closure_9 = tmp6;
let c15 = false;
2026-07-20 16:05:17 +00:00
},
INSTANT_INVITE_CREATE_SUCCESS: function handleInstantInviteCreateSuccess(channelId) {
channelId = channelId.channelId;
2026-07-23 10:11:24 +00:00
const fromServer = _isNativeReflectConstruct.createFromServer(channelId.invite);
2026-07-20 16:05:17 +00:00
if (fromServer.targetType === InviteTargetTypes.STREAM) {
if (null != fromServer.targetUser) {
2026-07-23 10:11:24 +00:00
if (null == dependencyMap[channelId]) {
dependencyMap[channelId] = {};
2026-07-20 16:05:17 +00:00
}
const _String = String;
2026-07-23 10:11:24 +00:00
dependencyMap[channelId][String(fromServer.targetUser.id)] = fromServer;
2026-07-20 16:05:17 +00:00
}
}
if (fromServer.targetType === InviteTargetTypes.EMBEDDED_APPLICATION) {
if (null != fromServer.targetApplication) {
2026-07-23 10:11:24 +00:00
if (null == dependencyMap2[channelId]) {
dependencyMap2[channelId] = {};
2026-07-20 16:05:17 +00:00
}
2026-07-23 10:11:24 +00:00
dependencyMap2[channelId][fromServer.targetApplication.id] = fromServer;
2026-07-20 16:05:17 +00:00
}
}
closure_10[channelId] = fromServer;
},
INSTANT_INVITE_CREATE_FAILURE: function handleInstantInviteCreateFailure(channelId) {
closure_10[channelId.channelId] = null;
},
INSTANT_INVITE_REVOKE_SUCCESS: function handleInstantInviteRevokeSuccess(channelId) {
closure_10[channelId.channelId] = null;
},
FRIEND_INVITE_REVOKE_REQUEST: function handleFriendInviteRevokeRequest() {
2026-07-23 10:11:24 +00:00
let c15 = true;
2026-07-20 16:05:17 +00:00
},
FRIEND_INVITE_CREATE_REQUEST: function handleFriendInviteCreateRequest() {
2026-07-23 10:11:24 +00:00
let c16 = true;
2026-07-20 16:05:17 +00:00
},
FRIEND_INVITES_FETCH_REQUEST: function handleFriendInviteFetchRequest() {
2026-07-23 10:11:24 +00:00
let c14 = true;
2026-07-20 16:05:17 +00:00
},
FRIEND_INVITES_FETCH_RESPONSE: function handleFriendInviteFetchResponse(invites) {
let closure_13 = {};
invites = invites.invites;
const item = invites.forEach((code) => {
2026-07-23 10:11:24 +00:00
closure_13[code.code] = outer1_7.createFromServer(code);
2026-07-20 16:05:17 +00:00
});
2026-07-25 08:10:48 +00:00
const tmp2 = importDefault(6641);
const tmp3 = importDefault(6643);
const tmp2Result = tmp2(tmp3(importDefault(6644)(Object.values(closure_13), "createdAt")));
2026-07-20 16:05:17 +00:00
let tmp6 = null;
if (null != tmp2Result) {
tmp6 = tmp2Result;
}
2026-07-23 10:11:24 +00:00
let closure_9 = tmp6;
let c14 = false;
2026-07-20 16:05:17 +00:00
},
INSTANT_INVITE_CLEAR: function handleInstantInviteClear(arg0) {
2026-07-23 10:11:24 +00:00
delete tmp2[tmp];
2026-07-20 16:05:17 +00:00
},
INSTANT_INVITE_RECEIVED_INSTALLATION_ID_SET: function handleReceivedInstallationIdSet(inviteCode) {
2026-07-23 10:11:24 +00:00
map = new Map(map);
2026-07-20 16:05:17 +00:00
const result = map.set(normalizeInviteCodeForInstallationId(inviteCode.inviteCode), inviteCode.receivedInstallationId);
},
INSTANT_INVITE_RECEIVED_INSTALLATION_ID_CLEAR: handleReceivedInstallationIdClear,
INVITE_MODAL_CLOSE: function handleInviteModalClose(inviteCode) {
inviteCode = inviteCode.inviteCode;
let tmp = null != inviteCode;
if (tmp) {
const obj = { inviteCode };
tmp = handleReceivedInstallationIdClear(obj);
}
return tmp;
},
LOGOUT: function handleLogout() {
if (0 === map.size) {
return false;
} else {
const _Map = Map;
2026-07-23 10:11:24 +00:00
map = new Map();
2026-07-20 16:05:17 +00:00
}
}
});
2026-07-23 10:11:24 +00:00
let result = require("_possibleConstructorReturn").fileFinishedImporting("stores/InstantInviteStore.tsx");
2026-07-20 16:05:17 +00:00
export default tmp3;