decord/source/modules/polls/PollsHttpApi.tsx

247 lines
6.9 KiB
TypeScript
Raw Normal View History

2026-08-24 06:08:38 +00:00
// Module ID: 10928
// Function ID: 10929
2026-07-20 16:05:17 +00:00
// Name: _submitPollVote
2026-08-24 06:08:38 +00:00
// Dependencies: [5, 676, 530, 4277, 2]
2026-07-20 16:05:17 +00:00
// Exports: endPollEarly, submitPollVote
2026-08-24 06:08:38 +00:00
// Module 10928 (_submitPollVote)
import closure_2 from "asyncGeneratorStep" /* 5 */;
import { Endpoints } from "ME" /* 676 */;
2026-07-23 10:11:24 +00:00
const require = arg1;
2026-07-20 16:05:17 +00:00
function _submitPollVote() {
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;
c5 = 0;
c6 = 0;
c4 = 0;
2026-07-29 08:29:29 +00:00
const iter = (function*(arg0) {
if (c6 === 2) {
c6 = 3;
HermesBuiltin.throwTypeError();
} else if (tmp7 === 3) {
if (arg0 === 1) {
throw arg1;
} else if (arg0 === 2) {
let obj = { value: null, done: true };
obj[0] = arg1;
return obj;
} else {
2026-08-24 06:08:38 +00:00
return { value: "HermesInternal", done: null };
2026-07-29 08:29:29 +00:00
}
} else {
try {
c6 = 2;
if (0 === c5) {
if (arg0 === 1) {
c6 = 3;
throw arg1;
} else if (arg0 === 2) {
c6 = 3;
obj = { value: null, done: true };
obj[0] = arg1;
return obj;
} else {
c2 = tmp3;
2026-08-24 06:08:38 +00:00
dependencyMap = tmp5;
2026-07-29 08:29:29 +00:00
let callback;
dependencyMap = undefined;
c2 = undefined;
({ channelId: c0, messageId: c1, answerIds: c2 } = callback);
c5 = 1;
c6 = 1;
2026-08-12 06:57:52 +00:00
return { value: "ct", done: true };
2026-07-29 08:29:29 +00:00
}
} else if (1 === tmp8) {
if (arg0 === 1) {
c6 = 3;
throw arg1;
} else if (arg0 === 2) {
c6 = 3;
2026-08-24 06:08:38 +00:00
obj1 = { value: null, done: true };
2026-07-29 08:29:29 +00:00
obj1[0] = arg1;
return obj1;
} else {
2026-08-24 06:08:38 +00:00
c4 = 1;
2026-07-29 08:29:29 +00:00
const HTTP = callback(530).HTTP;
const obj2 = { url: null, body: null, rejectWithError: false };
obj2[0] = closure_3.POLL_ANSWERS(callback, dependencyMap);
const obj3 = { answer_ids: null };
obj3[0] = c2;
obj2[1] = obj3;
c5 = 3;
c6 = 1;
const obj4 = { value: null, done: false };
obj4[0] = HTTP.put(obj2);
return obj4;
}
} else if (2 === tmp8) {
c4 = 0;
2026-08-24 06:08:38 +00:00
const aPIError = new callback(4277).APIError(closure_3);
2026-07-29 08:29:29 +00:00
throw aPIError;
} else if (arg0 === 1) {
c6 = 3;
throw arg1;
} else if (arg0 === 2) {
c4 = 0;
c6 = 3;
obj = { value: null, done: true };
obj[0] = arg1;
return obj;
} else {
c4 = 0;
c6 = 3;
2026-08-24 06:08:38 +00:00
return { value: "HermesInternal", done: null };
2026-07-29 08:29:29 +00:00
}
} catch (tmp21) {
closure_3 = tmp21;
if (tmp4 === c4) {
c6 = tmp2;
throw tmp21;
} else {
c5 = tmp;
}
}
}
})();
iter.next();
return iter;
});
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
}
function _endPollEarly() {
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;
c5 = 0;
c6 = 0;
c4 = 0;
2026-07-29 08:29:29 +00:00
const iter = (function*(arg0) {
if (c6 === 2) {
c6 = 3;
HermesBuiltin.throwTypeError();
} else if (tmp7 === 3) {
if (arg0 === 1) {
throw arg1;
} else if (arg0 === 2) {
let obj = { value: null, done: true };
obj[0] = arg1;
return obj;
} else {
2026-08-24 06:08:38 +00:00
return { value: "HermesInternal", done: null };
2026-07-29 08:29:29 +00:00
}
} else {
try {
c6 = 2;
if (0 === c5) {
if (arg0 === 1) {
c6 = 3;
throw arg1;
} else if (arg0 === 2) {
c6 = 3;
obj = { value: null, done: true };
obj[0] = arg1;
return obj;
} else {
2026-08-24 06:08:38 +00:00
closure_2 = tmp3;
dependencyMap = tmp5;
2026-07-29 08:29:29 +00:00
let callback;
dependencyMap = undefined;
({ channelId: c0, messageId: c1 } = callback);
c5 = 1;
c6 = 1;
2026-08-12 06:57:52 +00:00
return { value: "ct", done: true };
2026-07-29 08:29:29 +00:00
}
} else if (1 === tmp8) {
if (arg0 === 1) {
c6 = 3;
throw arg1;
} else if (arg0 === 2) {
c6 = 3;
2026-08-24 06:08:38 +00:00
obj1 = { value: null, done: true };
2026-07-29 08:29:29 +00:00
obj1[0] = arg1;
return obj1;
} else {
2026-08-24 06:08:38 +00:00
c4 = 1;
2026-07-29 08:29:29 +00:00
const HTTP = callback(530).HTTP;
const obj2 = { url: null, rejectWithError: false };
obj2[0] = closure_3.POLL_EXPIRE(callback, dependencyMap);
c5 = 3;
c6 = 1;
const obj3 = { value: null, done: false };
obj3[0] = HTTP.post(obj2);
return obj3;
}
} else if (2 === tmp8) {
c4 = 0;
2026-08-24 06:08:38 +00:00
closure_2 = closure_3;
const aPIError = new callback(4277).APIError(closure_2);
2026-07-29 08:29:29 +00:00
throw aPIError;
} else if (arg0 === 1) {
c6 = 3;
throw arg1;
} else if (arg0 === 2) {
c4 = 0;
c6 = 3;
obj = { value: null, done: true };
obj[0] = arg1;
return obj;
} else {
c4 = 0;
c6 = 3;
2026-08-24 06:08:38 +00:00
return { value: "HermesInternal", done: null };
2026-07-29 08:29:29 +00:00
}
} catch (tmp28) {
closure_3 = tmp28;
if (tmp4 === c4) {
c6 = tmp2;
throw tmp28;
} else {
c5 = tmp;
}
}
}
})();
iter.next();
return iter;
});
2026-08-24 06:08:38 +00:00
closure_5 = 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/polls/PollsHttpApi.tsx");
2026-07-20 16:05:17 +00:00
export const submitPollVote = function submitPollVote(arg0) {
2026-07-29 08:29:29 +00:00
const self = this;
const apply = _submitPollVote.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
};
export const endPollEarly = function endPollEarly() {
2026-07-29 08:29:29 +00:00
const self = this;
const apply = _endPollEarly.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
};