decord/beta/source/modules/rtc/hooks/useIsSecureFramesVerified.tsx

303 lines
10 KiB
TypeScript
Raw Normal View History

2026-10-07 22:43:51 +00:00
// Module ID: 9345
// Function ID: 9346
// Name: useIsSecureFramesVerified
2026-10-07 22:43:51 +00:00
// Dependencies: [502, 4913, 9346, 9347, 9348, 558, 576, 9384, 504, 9387, 4942, 2]
2026-10-07 22:43:51 +00:00
// Module 9345 (useIsSecureFramesVerified)
import StreamKeyUtils from "StreamKeyUtils" /* 4942 */;
import AuthenticationStore from "AuthenticationStore" /* 502 */;
2026-10-07 22:43:51 +00:00
import RTCConnectionStore from "RTCConnectionStore" /* 4913 */;
import SecureFramesVerifiedStore from "SecureFramesVerifiedStore" /* 9346 */;
import TransientKeyStore from "TransientKeyStore" /* 9347 */;
import VerifiedKeyStore from "VerifiedKeyStore" /* 9348 */;
2026-10-02 13:37:24 +00:00
import ReactCompilerGating_mod from "ReactCompilerGating" /* 558 */;
2026-10-01 14:13:23 +00:00
import size from "module_2" /* 2 */;
2026-10-02 13:37:24 +00:00
let streamKey, userId;
2026-10-02 13:37:24 +00:00
let ReactCompilerGating = ReactCompilerGating_mod;
let tmp2 = ReactCompilerGating.isReactCompilerEnabled() ? ((userId) => {
let channelId;
let tmp4;
let tmp6;
let userKey;
const tmp = userId;
const obj = userId(userKey[6]);
const cResult = obj.c(8);
userId = userId.userId;
({ channelId, userKey } = userId);
if (cResult[0] !== channelId) {
const obj2 = { channelId };
cResult[0] = channelId;
cResult[1] = obj2;
tmp4 = obj2;
} else {
tmp4 = cResult[1];
}
const tmpResult = tmp(userKey[7]);
const isSecureFramesUIEnabled = tmpResult.useIsSecureFramesUIEnabled(tmp4);
if (cResult[2] === Symbol.for("react.memo_cache_sentinel")) {
const items = [SecureFramesVerifiedStore, , , , ];
items[1] = isSecureFramesUIEnabled;
items[2] = RTCConnectionStore;
items[3] = VerifiedKeyStore;
items[4] = TransientKeyStore;
cResult[2] = items;
tmp6 = items;
} else {
tmp6 = cResult[2];
}
if (cResult[3] === isSecureFramesUIEnabled) {
if (cResult[4] === userId) {
let tmp12;
let tmp13;
if (cResult[5] === userKey) {
tmp12 = cResult[6];
tmp13 = cResult[7];
}
const tmpResult2 = tmp(userKey[8]);
return tmpResult2.useStateFromStores(tmp6, tmp12, tmp13);
}
}
const fn = function h() {
if (null != userId) {
const tmp13 = isSecureFramesUIEnabled;
if (tmp13) {
if (RTCConnectionStore.isUserConnected(userId)) {
if (AuthenticationStore.getId() !== userId) {
if (undefined === userKey) {
return SecureFramesVerifiedStore.isUserVerified(userId);
} else if (null === userKey) {
return false;
} else {
const _Uint8Array = Uint8Array;
const self = this;
const self2 = this;
const uint8Array = new Uint8Array(tmp4);
const isKeyVerifiedResult = VerifiedKeyStore.isKeyVerified(tmp, uint8Array) || TransientKeyStore.isKeyVerified(tmp, uint8Array);
return isKeyVerifiedResult;
}
}
}
}
}
return false;
};
const items1 = [isSecureFramesUIEnabled, userId, userKey];
cResult[3] = isSecureFramesUIEnabled;
cResult[4] = userId;
cResult[5] = userKey;
cResult[6] = fn;
cResult[7] = items1;
tmp13 = items1;
tmp12 = fn;
}) : ((userId) => {
2026-10-01 14:13:23 +00:00
userId = userId.userId;
const userKey = userId.userKey;
const channelId = userId.channelId;
2026-10-02 13:37:24 +00:00
const obj = userId(userKey[7]);
2026-10-01 14:13:23 +00:00
const isSecureFramesUIEnabled = obj.useIsSecureFramesUIEnabled({ channelId });
const items = [SecureFramesVerifiedStore, isSecureFramesUIEnabled, RTCConnectionStore, VerifiedKeyStore, TransientKeyStore];
const items1 = [isSecureFramesUIEnabled, userId, userKey];
2026-10-02 13:37:24 +00:00
const obj2 = userId(userKey[8]);
2026-10-01 14:13:23 +00:00
return obj2.useStateFromStores(items, function() {
if (null != userId) {
2026-10-01 14:13:23 +00:00
const tmp13 = isSecureFramesUIEnabled;
if (tmp13) {
if (RTCConnectionStore.isUserConnected(userId)) {
if (AuthenticationStore.getId() !== userId) {
if (undefined === userKey) {
2026-10-01 14:13:23 +00:00
return SecureFramesVerifiedStore.isUserVerified(userId);
} else if (null === userKey) {
return false;
} else {
const _Uint8Array = Uint8Array;
2026-10-01 14:13:23 +00:00
const self = this;
const self2 = this;
const uint8Array = new Uint8Array(tmp4);
2026-10-01 14:13:23 +00:00
const isKeyVerifiedResult = VerifiedKeyStore.isKeyVerified(tmp, uint8Array) || TransientKeyStore.isKeyVerified(tmp, uint8Array);
return isKeyVerifiedResult;
}
}
}
}
}
return false;
}, items1);
2026-10-02 13:37:24 +00:00
});
ReactCompilerGating = ReactCompilerGating_mod;
const tmp3 = ReactCompilerGating.isReactCompilerEnabled() ? ((streamKey) => {
let isSecureFramesUIEnabled;
let tmp4;
let tmp7;
let tmp = streamKey;
let tmp2 = isSecureFramesUIEnabled;
let obj = streamKey(isSecureFramesUIEnabled[6]);
const cResult = obj.c(8);
streamKey = streamKey.streamKey;
const channelId = streamKey.channelId;
if (cResult[0] !== channelId) {
const obj2 = { channelId };
cResult[0] = channelId;
cResult[1] = obj2;
tmp4 = obj2;
} else {
tmp4 = cResult[1];
}
const tmpResult = tmp(tmp2[7]);
isSecureFramesUIEnabled = tmpResult.useIsSecureFramesUIEnabled(tmp4);
const tmpResult3 = tmp(tmp2[9]);
const isStreamRTCConnectionEmpty = tmpResult3.useIsStreamRTCConnectionEmpty(streamKey);
if (cResult[2] === Symbol.for("react.memo_cache_sentinel")) {
const items = [SecureFramesVerifiedStore, isStreamRTCConnectionEmpty];
cResult[2] = items;
tmp7 = items;
} else {
tmp7 = cResult[2];
}
if (cResult[3] === isStreamRTCConnectionEmpty) {
if (cResult[4] === isSecureFramesUIEnabled) {
let tmp10;
let tmp11;
if (cResult[5] === streamKey) {
tmp10 = cResult[6];
tmp11 = cResult[7];
}
const tmpResult4 = tmp(tmp2[8]);
return tmpResult4.useStateFromStores(tmp7, tmp10, tmp11);
}
}
const fn = function f() {
const tmp = isSecureFramesUIEnabled;
if (tmp) {
const tmp2 = isStreamRTCConnectionEmpty;
if (!tmp2) {
if (null == streamKey) {
return false;
} else {
const id = AuthenticationStore.getId();
const obj = StreamKeyUtils;
const isStreamVerifiedResult = obj.decodeStreamKey(tmp3).ownerId !== id && SecureFramesVerifiedStore.isStreamVerified(tmp3);
return isStreamVerifiedResult;
}
}
}
return false;
};
const items1 = [isStreamRTCConnectionEmpty, isSecureFramesUIEnabled, streamKey];
cResult[3] = isStreamRTCConnectionEmpty;
cResult[4] = isSecureFramesUIEnabled;
cResult[5] = streamKey;
cResult[6] = fn;
cResult[7] = items1;
tmp11 = items1;
tmp10 = fn;
}) : ((streamKey) => {
2026-10-01 14:13:23 +00:00
streamKey = streamKey.streamKey;
let isSecureFramesUIEnabled;
2026-10-01 14:13:23 +00:00
const channelId = streamKey.channelId;
2026-10-02 13:37:24 +00:00
let obj = streamKey(isSecureFramesUIEnabled[7]);
2026-10-01 14:13:23 +00:00
isSecureFramesUIEnabled = obj.useIsSecureFramesUIEnabled({ channelId });
2026-10-02 13:37:24 +00:00
const obj2 = streamKey(isSecureFramesUIEnabled[9]);
2026-10-01 14:13:23 +00:00
const isStreamRTCConnectionEmpty = obj2.useIsStreamRTCConnectionEmpty(streamKey);
const items = [SecureFramesVerifiedStore, isStreamRTCConnectionEmpty];
const items1 = [isStreamRTCConnectionEmpty, isSecureFramesUIEnabled, streamKey];
2026-10-02 13:37:24 +00:00
const obj3 = streamKey(isSecureFramesUIEnabled[8]);
2026-10-01 14:13:23 +00:00
return obj3.useStateFromStores(items, () => {
const tmp = isSecureFramesUIEnabled;
if (tmp) {
const tmp2 = isStreamRTCConnectionEmpty;
if (!tmp2) {
if (null == streamKey) {
return false;
} else {
const id = AuthenticationStore.getId();
2026-10-01 14:13:23 +00:00
const obj = StreamKeyUtils;
const isStreamVerifiedResult = obj.decodeStreamKey(tmp3).ownerId !== id && SecureFramesVerifiedStore.isStreamVerified(tmp3);
return isStreamVerifiedResult;
}
}
}
return false;
}, items1);
2026-10-02 13:37:24 +00:00
});
ReactCompilerGating = ReactCompilerGating_mod;
let tmp4 = ReactCompilerGating.isReactCompilerEnabled() ? ((channelId) => {
let isCallRTCConnectionEmpty;
let isSecureFramesUIEnabled;
let tmp4;
let tmp7;
let tmp = isSecureFramesUIEnabled;
const obj = isSecureFramesUIEnabled(isCallRTCConnectionEmpty[6]);
const cResult = obj.c(7);
channelId = channelId.channelId;
if (cResult[0] !== channelId) {
const obj2 = { channelId };
cResult[0] = channelId;
cResult[1] = obj2;
tmp4 = obj2;
} else {
tmp4 = cResult[1];
}
const tmpResult = tmp(isCallRTCConnectionEmpty[7]);
isSecureFramesUIEnabled = tmpResult.useIsSecureFramesUIEnabled(tmp4);
const tmpResult3 = tmp(isCallRTCConnectionEmpty[9]);
isCallRTCConnectionEmpty = tmpResult3.useIsCallRTCConnectionEmpty();
if (cResult[2] === Symbol.for("react.memo_cache_sentinel")) {
const items = [SecureFramesVerifiedStore];
cResult[2] = items;
tmp7 = items;
} else {
tmp7 = cResult[2];
}
if (cResult[3] === isCallRTCConnectionEmpty) {
let tmp9;
let tmp10;
if (cResult[4] === isSecureFramesUIEnabled) {
tmp9 = cResult[5];
tmp10 = cResult[6];
}
const tmpResult4 = tmp(isCallRTCConnectionEmpty[8]);
return tmpResult4.useStateFromStores(tmp7, tmp9, tmp10);
}
const fn = function o() {
let tmp = !isSecureFramesUIEnabled;
if (isSecureFramesUIEnabled) {
tmp = isCallRTCConnectionEmpty;
}
const isCallVerifiedResult = !tmp && SecureFramesVerifiedStore.isCallVerified();
return isCallVerifiedResult;
};
const items1 = [isCallRTCConnectionEmpty, isSecureFramesUIEnabled];
cResult[3] = isCallRTCConnectionEmpty;
cResult[4] = isSecureFramesUIEnabled;
cResult[5] = fn;
cResult[6] = items1;
tmp10 = items1;
tmp9 = fn;
}) : ((channelId) => {
let isSecureFramesUIEnabled;
let isCallRTCConnectionEmpty;
2026-10-01 14:13:23 +00:00
channelId = channelId.channelId;
2026-10-02 13:37:24 +00:00
const obj = isSecureFramesUIEnabled(isCallRTCConnectionEmpty[7]);
2026-10-01 14:13:23 +00:00
isSecureFramesUIEnabled = obj.useIsSecureFramesUIEnabled({ channelId });
2026-10-02 13:37:24 +00:00
const obj2 = isSecureFramesUIEnabled(isCallRTCConnectionEmpty[9]);
2026-10-01 14:13:23 +00:00
isCallRTCConnectionEmpty = obj2.useIsCallRTCConnectionEmpty();
const items = [SecureFramesVerifiedStore];
const items1 = [isCallRTCConnectionEmpty, isSecureFramesUIEnabled];
2026-10-02 13:37:24 +00:00
const obj3 = isSecureFramesUIEnabled(isCallRTCConnectionEmpty[8]);
2026-10-01 14:13:23 +00:00
return obj3.useStateFromStores(items, () => {
let tmp = !isSecureFramesUIEnabled;
if (isSecureFramesUIEnabled) {
tmp = isCallRTCConnectionEmpty;
}
2026-10-01 14:13:23 +00:00
const isCallVerifiedResult = !tmp && SecureFramesVerifiedStore.isCallVerified();
return isCallVerifiedResult;
}, items1);
2026-10-02 13:37:24 +00:00
});
const result = size.fileFinishedImporting("modules/rtc/hooks/useIsSecureFramesVerified.tsx");
export const useIsUserSecureFramesVerified = tmp2;
export const useIsStreamSecureFramesVerified = tmp3;
export const useIsCallSecureFramesVerified = tmp4;