decord/source/modules/captcha/SharedCaptchaUtils.tsx

44 lines
1.8 KiB
TypeScript
Raw Normal View History

2026-08-25 06:04:03 +00:00
// Module ID: 10534
// Function ID: 10535
2026-07-29 08:29:29 +00:00
// Name: prototype
2026-08-25 06:04:03 +00:00
// Dependencies: [10535, 10536, 2]
2026-07-20 16:05:17 +00:00
// Exports: emitCaptchaDistributionMetric, extractCaptchaPropsFromResponse
2026-08-25 06:04:03 +00:00
// Module 10534 (prototype)
2026-08-24 06:08:38 +00:00
import set from "set" /* 2 */;
2026-08-25 06:04:03 +00:00
import CAPTCHA_SERVE_VOLUME_DISTRIBUTION_AGGREGATION_WINDOW_MS from "CAPTCHA_SERVE_VOLUME_DISTRIBUTION_AGGREGATION_WINDOW_MS" /* 10536 */;
import useCaptchaStore from "useCaptchaStore" /* 10535 */;
2026-07-23 10:11:24 +00:00
2026-07-29 08:29:29 +00:00
({ incrementCaptchaServeVolume: c0, flushCaptchaServeVolume: closure_1, isCaptchaStoreVolumeEmpty: obj1 } = useCaptchaStore);
2026-08-24 06:08:38 +00:00
let closure_3 = CAPTCHA_SERVE_VOLUME_DISTRIBUTION_AGGREGATION_WINDOW_MS.CAPTCHA_SERVE_VOLUME_DISTRIBUTION_AGGREGATION_WINDOW_MS;
2026-07-29 08:29:29 +00:00
const prototype = function CaptchaCancelError() {
tmp = new tmp("Captcha cancelled", new.target);
// ThrowIfThisInitialized (0x7c)
return tmp;
}.prototype;
class prototype extends Error {
2026-07-20 16:05:17 +00:00
}
2026-08-24 06:08:38 +00:00
const result = set.fileFinishedImporting("modules/captcha/SharedCaptchaUtils.tsx");
2026-07-20 16:05:17 +00:00
export const CaptchaError = { CANCEL: "cancel", ERROR: "error", EXPIRED: "expired" };
export const extractCaptchaPropsFromResponse = function extractCaptchaPropsFromResponse(body) {
2026-07-29 08:29:29 +00:00
let obj = { captchaService: body.captcha_service, sitekey: body.captcha_sitekey, captchaSessionId: body.captcha_session_id, options: null };
obj = { rqdata: body.captcha_rqdata, rqtoken: body.captcha_rqtoken, serveInvisible: null, userflow: null };
let flag = body.should_serve_invisible;
if (flag == null) {
flag = false;
}
obj[2] = flag;
obj[3] = body.user_flow;
obj[3] = obj;
2026-07-20 16:05:17 +00:00
return obj;
};
export const emitCaptchaDistributionMetric = function emitCaptchaDistributionMetric(closure_7) {
2026-07-29 08:29:29 +00:00
if (callback2()) {
2026-07-20 16:05:17 +00:00
const _setTimeout = setTimeout;
2026-07-29 08:29:29 +00:00
const timerId = setTimeout(() => callback(), closure_3);
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
callback(closure_7);
2026-07-20 16:05:17 +00:00
};
2026-07-29 08:29:29 +00:00
export const CaptchaCancelError = prototype;