246 lines
6.9 KiB
TypeScript
246 lines
6.9 KiB
TypeScript
// Module ID: 10928
|
|
// Function ID: 10929
|
|
// Name: _submitPollVote
|
|
// Dependencies: [5, 676, 530, 4277, 2]
|
|
// Exports: endPollEarly, submitPollVote
|
|
|
|
// Module 10928 (_submitPollVote)
|
|
import closure_2 from "asyncGeneratorStep" /* 5 */;
|
|
import { Endpoints } from "ME" /* 676 */;
|
|
|
|
const require = arg1;
|
|
function _submitPollVote() {
|
|
const self = this;
|
|
const tmp = callback((arg0) => {
|
|
closure_0 = arg0;
|
|
c5 = 0;
|
|
c6 = 0;
|
|
c4 = 0;
|
|
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 {
|
|
return { value: "HermesInternal", done: null };
|
|
}
|
|
} 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;
|
|
dependencyMap = tmp5;
|
|
let callback;
|
|
dependencyMap = undefined;
|
|
c2 = undefined;
|
|
({ channelId: c0, messageId: c1, answerIds: c2 } = callback);
|
|
c5 = 1;
|
|
c6 = 1;
|
|
return { value: "ct", done: true };
|
|
}
|
|
} else if (1 === tmp8) {
|
|
if (arg0 === 1) {
|
|
c6 = 3;
|
|
throw arg1;
|
|
} else if (arg0 === 2) {
|
|
c6 = 3;
|
|
obj1 = { value: null, done: true };
|
|
obj1[0] = arg1;
|
|
return obj1;
|
|
} else {
|
|
c4 = 1;
|
|
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;
|
|
const aPIError = new callback(4277).APIError(closure_3);
|
|
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;
|
|
return { value: "HermesInternal", done: null };
|
|
}
|
|
} catch (tmp21) {
|
|
closure_3 = tmp21;
|
|
if (tmp4 === c4) {
|
|
c6 = tmp2;
|
|
throw tmp21;
|
|
} else {
|
|
c5 = tmp;
|
|
}
|
|
}
|
|
}
|
|
})();
|
|
iter.next();
|
|
return iter;
|
|
});
|
|
closure_4 = tmp;
|
|
const apply = tmp.apply;
|
|
if (typeof apply === "unknown") {
|
|
let applyArgumentsResult = HermesBuiltin.applyArguments(self);
|
|
} else {
|
|
applyArgumentsResult = apply(self, arguments);
|
|
}
|
|
return applyArgumentsResult;
|
|
}
|
|
function _endPollEarly() {
|
|
const self = this;
|
|
const tmp = callback((arg0) => {
|
|
closure_0 = arg0;
|
|
c5 = 0;
|
|
c6 = 0;
|
|
c4 = 0;
|
|
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 {
|
|
return { value: "HermesInternal", done: null };
|
|
}
|
|
} 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 {
|
|
closure_2 = tmp3;
|
|
dependencyMap = tmp5;
|
|
let callback;
|
|
dependencyMap = undefined;
|
|
({ channelId: c0, messageId: c1 } = callback);
|
|
c5 = 1;
|
|
c6 = 1;
|
|
return { value: "ct", done: true };
|
|
}
|
|
} else if (1 === tmp8) {
|
|
if (arg0 === 1) {
|
|
c6 = 3;
|
|
throw arg1;
|
|
} else if (arg0 === 2) {
|
|
c6 = 3;
|
|
obj1 = { value: null, done: true };
|
|
obj1[0] = arg1;
|
|
return obj1;
|
|
} else {
|
|
c4 = 1;
|
|
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;
|
|
closure_2 = closure_3;
|
|
const aPIError = new callback(4277).APIError(closure_2);
|
|
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;
|
|
return { value: "HermesInternal", done: null };
|
|
}
|
|
} catch (tmp28) {
|
|
closure_3 = tmp28;
|
|
if (tmp4 === c4) {
|
|
c6 = tmp2;
|
|
throw tmp28;
|
|
} else {
|
|
c5 = tmp;
|
|
}
|
|
}
|
|
}
|
|
})();
|
|
iter.next();
|
|
return iter;
|
|
});
|
|
closure_5 = tmp;
|
|
const apply = tmp.apply;
|
|
if (typeof apply === "unknown") {
|
|
let applyArgumentsResult = HermesBuiltin.applyArguments(self);
|
|
} else {
|
|
applyArgumentsResult = apply(self, arguments);
|
|
}
|
|
return applyArgumentsResult;
|
|
}
|
|
const result = require("set").fileFinishedImporting("modules/polls/PollsHttpApi.tsx");
|
|
|
|
export const submitPollVote = function submitPollVote(arg0) {
|
|
const self = this;
|
|
const apply = _submitPollVote.apply;
|
|
if (typeof apply === "unknown") {
|
|
let applyArgumentsResult = HermesBuiltin.applyArguments(self);
|
|
} else {
|
|
applyArgumentsResult = apply(self, arguments);
|
|
}
|
|
return applyArgumentsResult;
|
|
};
|
|
export const endPollEarly = function endPollEarly() {
|
|
const self = this;
|
|
const apply = _endPollEarly.apply;
|
|
if (typeof apply === "unknown") {
|
|
let applyArgumentsResult = HermesBuiltin.applyArguments(self);
|
|
} else {
|
|
applyArgumentsResult = apply(self, arguments);
|
|
}
|
|
return applyArgumentsResult;
|
|
};
|