2026-09-16 07:03:15 +00:00
|
|
|
// Module ID: 11423
|
|
|
|
|
// Function ID: 11424
|
2026-09-10 05:38:07 +00:00
|
|
|
// Name: SharedCaptchaUtils
|
2026-09-16 07:03:15 +00:00
|
|
|
// Dependencies: [11424, 11425, 2]
|
2026-07-20 16:05:17 +00:00
|
|
|
// Exports: emitCaptchaDistributionMetric, extractCaptchaPropsFromResponse
|
|
|
|
|
|
2026-09-16 07:03:15 +00:00
|
|
|
// Module 11423 (SharedCaptchaUtils)
|
|
|
|
|
import CaptchaConstants from "CaptchaConstants" /* 11425 */;
|
|
|
|
|
import CaptchaStore from "CaptchaStore" /* 11424 */;
|
2026-09-10 05:38:07 +00:00
|
|
|
import size from "module_2" /* 2 */;
|
2026-07-23 10:11:24 +00:00
|
|
|
|
2026-09-10 05:38:07 +00:00
|
|
|
({ incrementCaptchaServeVolume: closure_0, flushCaptchaServeVolume: closure_1, isCaptchaStoreVolumeEmpty: c2 } = CaptchaStore);
|
|
|
|
|
let closure_3 = CaptchaConstants.CAPTCHA_SERVE_VOLUME_DISTRIBUTION_AGGREGATION_WINDOW_MS;
|
2026-07-29 08:29:29 +00:00
|
|
|
const prototype = function CaptchaCancelError() {
|
2026-09-10 05:38:07 +00:00
|
|
|
return new tmp("Captcha cancelled", new.target);
|
2026-07-29 08:29:29 +00:00
|
|
|
}.prototype;
|
|
|
|
|
class prototype extends Error {
|
2026-07-20 16:05:17 +00:00
|
|
|
}
|
2026-09-10 05:38:07 +00:00
|
|
|
const result = size.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-09-10 05:38:07 +00:00
|
|
|
const obj = { captchaService: body.captcha_service, sitekey: body.captcha_sitekey, captchaSessionId: body.captcha_session_id, options: null };
|
|
|
|
|
const obj2 = { rqdata: body.captcha_rqdata, rqtoken: body.captcha_rqtoken, serveInvisible: null, userflow: null };
|
2026-07-29 08:29:29 +00:00
|
|
|
let flag = body.should_serve_invisible;
|
|
|
|
|
if (flag == null) {
|
|
|
|
|
flag = false;
|
|
|
|
|
}
|
2026-09-10 05:38:07 +00:00
|
|
|
obj2.serveInvisible = flag;
|
|
|
|
|
obj2.userflow = body.user_flow;
|
|
|
|
|
obj.options = obj2;
|
2026-07-20 16:05:17 +00:00
|
|
|
return obj;
|
|
|
|
|
};
|
2026-09-10 05:38:07 +00:00
|
|
|
export const emitCaptchaDistributionMetric = function emitCaptchaDistributionMetric(arg0) {
|
|
|
|
|
if (React2()) {
|
2026-07-20 16:05:17 +00:00
|
|
|
const _setTimeout = setTimeout;
|
2026-09-10 05:38:07 +00:00
|
|
|
const timerId = setTimeout(() => closure_1_1(), closure_3);
|
2026-07-20 16:05:17 +00:00
|
|
|
}
|
2026-09-10 05:38:07 +00:00
|
|
|
React(arg0);
|
2026-07-20 16:05:17 +00:00
|
|
|
};
|
2026-07-29 08:29:29 +00:00
|
|
|
export const CaptchaCancelError = prototype;
|