decord/source/modules/mobile_web_handoff/MobileWebHandoffUtils.tsx

113 lines
3.2 KiB
TypeScript
Raw Normal View History

2026-09-02 09:53:35 +00:00
// Module ID: 6172
// Function ID: 6173
2026-07-20 16:05:17 +00:00
// Name: _createHandoffToken
2026-09-02 09:53:35 +00:00
// Dependencies: [5, 673, 511, 527, 2]
2026-07-21 22:01:30 +00:00
2026-09-02 09:53:35 +00:00
// Module 6172 (_createHandoffToken)
import v1 from "v1" /* 511 */;
2026-08-24 06:08:38 +00:00
import closure_2 from "asyncGeneratorStep" /* 5 */;
2026-09-02 09:53:35 +00:00
import { Endpoints } from "ME" /* 673 */;
2026-07-23 10:11:24 +00:00
2026-08-24 06:08:38 +00:00
require = arg1;
2026-07-25 08:10:48 +00:00
function _createHandoffToken() {
2026-07-29 08:29:29 +00:00
const self = this;
const tmp = callback((arg0) => {
2026-08-24 06:08:38 +00:00
closure_0 = arg0;
c2 = 0;
c3 = 0;
2026-07-29 08:29:29 +00:00
return (function*(arg0, body) {
if (constants === 2) {
constants = 3;
HermesBuiltin.throwTypeError();
} else if (tmp3 === 3) {
if (arg0 === 1) {
throw body;
} else if (arg0 === 2) {
let obj = { value: null, done: true };
obj[0] = body;
return obj;
} else {
2026-09-01 10:26:29 +00:00
return { value: "HermesInternal", done: null };
2026-07-29 08:29:29 +00:00
}
} else {
try {
constants = 2;
if (0 === c2) {
if (arg0 === 1) {
constants = 3;
throw body;
} else if (arg0 === 2) {
constants = 3;
obj = { value: null, done: true };
obj[0] = body;
return obj;
} else {
2026-08-24 06:08:38 +00:00
closure_1 = tmp4;
2026-07-29 08:29:29 +00:00
let handoff_token;
2026-08-24 06:08:38 +00:00
const HTTP = callback(closure_1_1[3]).HTTP;
obj1 = { url: null, body: null, oldFormErrors: true, retries: 1, rejectWithError: false };
2026-07-29 08:29:29 +00:00
obj1[0] = constants.HANDOFF;
const obj2 = { key: null };
obj2[0] = handoff_token;
obj1[1] = obj2;
c2 = 1;
constants = 1;
const obj3 = { value: null, done: false };
obj3[0] = HTTP.post(obj1);
return obj3;
}
} else if (arg0 === 1) {
constants = 3;
throw body;
} else if (arg0 === 2) {
constants = 3;
const obj4 = { value: null, done: true };
obj4[0] = body;
return obj4;
} else {
handoff_token = body.body.handoff_token;
if (null != handoff_token) {
constants = 3;
obj = { value: null, done: true };
obj[0] = handoff_token;
return obj;
} else {
const _Error = Error;
2026-08-24 06:08:38 +00:00
error = new Error("Missing handoff token!");
2026-07-29 08:29:29 +00:00
throw error;
}
}
} catch (tmp14) {
constants = tmp;
throw tmp14;
}
}
})();
});
2026-08-24 06:08:38 +00:00
closure_4 = tmp;
2026-07-29 08:29:29 +00:00
const apply = tmp.apply;
if (typeof apply === "unknown") {
let applyArgumentsResult = HermesBuiltin.applyArguments(self);
} else {
applyArgumentsResult = apply(self, arguments);
}
return applyArgumentsResult;
2026-07-20 16:05:17 +00:00
}
2026-08-24 06:08:38 +00:00
const result = require("set").fileFinishedImporting("modules/mobile_web_handoff/MobileWebHandoffUtils.tsx");
2026-07-20 16:05:17 +00:00
export default {
generateNonce() {
2026-08-24 06:08:38 +00:00
return v1.v4();
2026-07-20 16:05:17 +00:00
},
2026-07-23 10:11:24 +00:00
createHandoffToken(closure_0) {
2026-07-29 08:29:29 +00:00
const self = this;
const apply = _createHandoffToken.apply;
if (typeof apply === "unknown") {
let applyArgumentsResult = HermesBuiltin.applyArguments(self);
} else {
applyArgumentsResult = apply(self, arguments);
}
return applyArgumentsResult;
2026-07-20 16:05:17 +00:00
}
};