decord/source/modules/polls/PollAttachmentUtils.tsx

65 lines
2.1 KiB
TypeScript
Raw Normal View History

2026-08-05 07:35:12 +00:00
// Module ID: 11474
// Function ID: 11475
2026-07-20 16:05:17 +00:00
// Name: _downloadPollGif
2026-08-05 07:35:12 +00:00
// Dependencies: [5, 7182, 2]
2026-07-20 16:05:17 +00:00
// Exports: downloadPollGif, getFileNameFromGifUrl, getFilePathForGif
2026-08-05 07:35:12 +00:00
// Module 11474 (_downloadPollGif)
2026-07-23 10:11:24 +00:00
import asyncGeneratorStep from "asyncGeneratorStep";
import { POLL_ATTACHMENT_FOLDER } from "POLL_ATTACHMENT_FOLDER";
2026-07-20 16:05:17 +00:00
function _downloadPollGif() {
2026-07-29 08:29:29 +00:00
const self = this;
const tmp = callback((arg0) => {
let asyncGeneratorStep = arg0;
let c3 = 0;
let c4 = 0;
return (function*(arg0) {
2026-08-04 21:03:28 +00:00
const _fetch = fetch;
asyncGeneratorStep = yield fetch(asyncGeneratorStep);
function convertBlobToBase64(arg0) {
let asyncGeneratorStep = arg0;
const fileReader = new FileReader();
return new Promise((asyncGeneratorStep, onerror) => {
fileReader.onload = function onload() { ... };
fileReader.onerror = onerror;
const asDataURL = fileReader.readAsDataURL(asyncGeneratorStep);
});
2026-07-29 08:29:29 +00:00
}
2026-08-04 21:03:28 +00:00
yield asyncGeneratorStep.blob();
return convertBlobToBase64(arg1);
2026-07-29 08:29:29 +00:00
})();
});
const _downloadPollGif = tmp;
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-07-23 10:11:24 +00:00
const result = require("set").fileFinishedImporting("modules/polls/PollAttachmentUtils.tsx");
2026-07-20 16:05:17 +00:00
2026-07-29 08:29:29 +00:00
export const getFileNameFromGifUrl = function getFileNameFromGifUrl(closure_1, closure_2) {
const parts = decodeURIComponent(closure_2).split("/");
let str2 = parts.pop();
if (str2 == null) {
str2 = "temp.gif";
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
return "" + closure_1 + "-" + str2;
2026-07-20 16:05:17 +00:00
};
2026-07-29 08:29:29 +00:00
export const getFilePathForGif = function getFilePathForGif(closure_2) {
return POLL_ATTACHMENT_FOLDER + "/" + closure_2;
2026-07-20 16:05:17 +00:00
};
2026-07-29 08:29:29 +00:00
export const downloadPollGif = function downloadPollGif(closure_2) {
const self = this;
const apply = _downloadPollGif.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
};