decord/source/modules/rtc/hooks/useSecureFramesPairwiseFingerprint.tsx
github-actions da5b5e5efe chore: update source for alpha 346.6
Skipped 1 file(s) >100MB (GitHub limit): source/__polyfill/04xxx/module_4821.js (118.4 MB)
2026-09-12 13:45:10 +00:00

253 lines
8.3 KiB
TypeScript

// Module ID: 9285
// Function ID: 9286
// Name: useSecureFramesPairwiseFingerprint
// Dependencies: [32, 5, 19, 502, 1908, 4659, 9281, 4661, 206, 504, 38, 9286, 2]
// Exports: useSecureFramesPairwiseFingerprint
// Module 9285 (useSecureFramesPairwiseFingerprint)
import _slicedToArray from "module_32" /* 32 */;
import asyncGeneratorStep from "asyncGeneratorStep" /* 5 */;
import noop from "module_19" /* 19 */;
import AuthenticationStore from "AuthenticationStore" /* 502 */;
import MediaEngineStore from "MediaEngineStore" /* 1908 */;
import RTCConnectionStore from "RTCConnectionStore" /* 4659 */;
const require = fn;
let closure_12 = async function _computeNativeDisplayPair(arg0, value) {
if (c4 === 2) {
c4 = 3;
throw new TypeError("Generator functions may not be called on executing generators");
} else if (tmp3 === 3) {
if (arg0 === 1) {
throw value;
} else if (arg0 === 2) {
const obj3 = { value, done: true };
return obj3;
} else {
return { value: "HermesInternal", done: null };
}
} else {
try {
c4 = 2;
if (0 === c3) {
if (arg0 === 1) {
c4 = 3;
throw value;
} else if (arg0 === 2) {
c4 = 3;
const obj4 = { value, done: true };
return obj4;
} else {
let mLSPairwiseFingerprint = tmp4;
c1 = 0;
closure_129_0 = closure_0;
closure_129_1 = undefined;
closure_129_2 = undefined;
closure_129_3 = undefined;
const secureFramesRosterMapEntry = RTCConnectionStore.getSecureFramesRosterMapEntry(closure_0);
closure_129_1 = secureFramesRosterMapEntry;
const rTCConnection = RTCConnectionStore.getRTCConnection();
closure_129_2 = rTCConnection;
if (null != secureFramesRosterMapEntry) {
if (null != rTCConnection) {
const promise = new Promise((arg0) => {
closure_0 = arg0;
mLSPairwiseFingerprint = mLSPairwiseFingerprint.getMLSPairwiseFingerprint(closure_2_9, closure_1_0, (arg0) => {
const uint8Array = new Uint8Array(arg0);
return closure_0(uint8Array);
});
});
c3 = 1;
c4 = 1;
const obj5 = { value: promise, done: false };
return obj5;
}
}
c4 = 3;
return { value: null, done: true };
}
} else if (arg0 === 1) {
c4 = 3;
throw value;
} else if (arg0 === 2) {
c4 = 3;
const obj6 = { value, done: true };
return obj6;
} else {
closure_129_3 = value;
value = { fingerprint: closure_130_1(closure_130_2[8]).fromByteArray(closure_129_3), fingerprintUserKey: closure_129_1 };
c4 = 3;
const obj7 = { value, done: true };
return obj7;
}
} catch (tmp16) {
c4 = tmp;
throw tmp16;
}
}
};
let closure_9 = fn(9281).SECURE_FRAMES_GENERATE_FINGERPRINT_VERSION;
const Features = fn(4661).Features;
const SecureFramesPairwiseFingerprintMode = { FROZEN: "frozen", LIVE: "live" };
const size = fn(2);
const result = size.fileFinishedImporting("modules/rtc/hooks/useSecureFramesPairwiseFingerprint.tsx");
export { SecureFramesPairwiseFingerprintMode };
export const useSecureFramesPairwiseFingerprint = function useSecureFramesPairwiseFingerprint(userId) {
userId = userId.userId;
let FROZEN = userId.mode;
if (FROZEN === undefined) {
FROZEN = constants.FROZEN;
}
let stateFromStores;
let first;
let first1;
let id;
let stateFromStores2;
const items = [id];
stateFromStores = userId(stateFromStores[9]).useStateFromStores(items, () => id.getId());
FROZEN(stateFromStores[10])(stateFromStores !== userId, "[useSecureFramesPairwiseFingerprint] Should not pass current user id.");
const tmp4 = first(first1.useState(null), 2);
first = tmp4[0];
asyncGeneratorStep = tmp4[1];
const tmp6 = first(first1.useState(false), 2);
first1 = tmp6[0];
id = tmp6[1];
obj = userId(stateFromStores[9]);
const items1 = [stateFromStores2];
const stateFromStores1 = userId(stateFromStores[9]).useStateFromStores(items1, () => RTCConnectionStore.getSecureFramesRosterMapEntry(userId));
let obj2 = userId(stateFromStores[9]);
const items2 = [stateFromStores2];
stateFromStores2 = userId(stateFromStores[9]).useStateFromStores(items2, () => RTCConnectionStore.getSecureFramesRosterMapEntry(stateFromStores));
const items3 = [userId];
const callback = first1.useCallback(asyncGeneratorStep(async (arg0, value) => {
if (v3 === 2) {
v3 = 3;
throw new TypeError("Generator functions may not be called on executing generators");
} else if (tmp3 === 3) {
if (arg0 === 1) {
throw value;
} else if (arg0 === 2) {
const obj2 = { value, done: true };
return obj2;
} else {
return { value: "HermesInternal", done: null };
}
} else {
try {
v3 = 2;
if (0 === c1) {
if (arg0 === 1) {
v3 = 3;
throw value;
} else if (arg0 === 2) {
v3 = 3;
const obj3 = { value, done: true };
return obj3;
} else if (stateFromStores1.supports(constants.MLS_PAIRWISE_FINGERPRINTS)) {
c1 = 2;
v3 = 1;
const obj5 = {
value: (function computeNativeDisplayPair() {
const self = this;
const apply = closure_1_12.apply;
if (typeof apply === "unknown") {
let applyArgumentsResult = HermesBuiltin.applyArguments(self);
} else {
applyArgumentsResult = apply(self, arguments);
}
return applyArgumentsResult;
})(userId),
done: false
};
return obj5;
} else {
c1 = 1;
v3 = 1;
const obj6 = { value: v3(stateFromStores[11]).computeBoundPairwiseFingerprint(userId), done: false };
return obj6;
}
} else {
if (1 === tmp4) {
if (arg0 === 1) {
v3 = 3;
throw value;
} else if (arg0 === 2) {
v3 = 3;
const obj7 = { value, done: true };
return obj7;
}
} else if (arg0 === 1) {
v3 = 3;
throw value;
} else if (arg0 === 2) {
v3 = 3;
obj = { value, done: true };
return obj;
}
v3 = 3;
const obj8 = { value, done: true };
return obj8;
}
} catch (tmp9) {
v3 = tmp;
throw tmp9;
}
}
}), items3);
first1.useRef(0);
constants = first1.useRef(null);
first1.useRef(false);
const items4 = [FROZEN, callback, stateFromStores1, stateFromStores2];
const effect = first1.useEffect(() => {
if (null != stateFromStores1) {
if (null != stateFromStores2) {
if (FROZEN !== constants.FROZEN) {
ref2.current = true;
const sum = ref.current + 1;
ref.current = sum;
userId = sum;
const _setTimeout = setTimeout;
constants.current = setTimeout(() => {
closure_6(true);
callback().then((result) => {
if (closure_1_0 === ref.current) {
if (null != result) {
closure_2_4(result);
}
id(false);
}
});
}, 0);
}
}
}
}, items4);
const effect1 = first1.useEffect(() => () => {
if (null != ref.current) {
const _clearTimeout = clearTimeout;
clearTimeout(tmp.current);
}
}, []);
const items5 = [first, first1];
return first1.useMemo(() => {
let fingerprint;
if (first != null) {
fingerprint = tmp.fingerprint;
}
if (fingerprint == null) {
fingerprint = null;
}
obj = { fingerprint, fingerprintUserKey: null, loading: null };
let fingerprintUserKey;
if (first != null) {
fingerprintUserKey = tmp.fingerprintUserKey;
}
if (fingerprintUserKey == null) {
fingerprintUserKey = null;
}
obj.fingerprintUserKey = fingerprintUserKey;
obj.loading = first1;
return obj;
}, items5);
};