decord/beta/source/modules/captcha/CaptchaUtils.native.tsx

140 lines
4.4 KiB
TypeScript
Raw Permalink Normal View History

2026-10-12 16:32:48 +00:00
// Module ID: 18017
// Function ID: 18018
// Name: captcha/CaptchaUtils
2026-10-12 16:32:48 +00:00
// Dependencies: [4802, 5735, 558, 576, 504, 5056, 18018, 2000, 5727, 2]
2026-10-12 16:32:48 +00:00
// Module 18017 (captcha/CaptchaUtils)
2026-10-02 13:37:24 +00:00
import react from "react" /* 576 */;
2026-10-12 16:32:48 +00:00
import ActionSheetActionCreatorsDefault from "ActionSheetActionCreators" /* 5056 */;
import SharedCaptchaUtils from "SharedCaptchaUtils" /* 5727 */;
import CaptchaConstants from "CaptchaConstants" /* 5735 */;
import ActionSheetStore from "ActionSheetStore" /* 4802 */;
2026-10-02 13:37:24 +00:00
import ReactCompilerGating_mod from "ReactCompilerGating" /* 558 */;
2026-10-01 14:13:23 +00:00
import size from "module_2" /* 2 */;
const require = globalThis.__r;
2026-10-01 14:13:23 +00:00
let _require;
2026-10-02 13:37:24 +00:00
let ReactCompilerGating;
let tmp;
const get_initialized = tmp(504);
2026-10-01 14:13:23 +00:00
const CAPTCHA_MODAL_KEY = CaptchaConstants.CAPTCHA_MODAL_KEY;
let obj = {
showCaptcha(options, arg1) {
2026-10-01 14:13:23 +00:00
let captchaService;
let closure_0;
let sitekey;
_require = arg1;
let obj = arg2;
if (arg2 === undefined) {
obj = {};
}
2026-10-01 14:13:23 +00:00
options = options.options;
({ sitekey, captchaService } = options);
2026-10-01 14:13:23 +00:00
const openLazy = ActionSheetActionCreatorsDefault.openLazy;
const obj2 = {
sitekey,
captchaService,
onCaptchaVerify(captcha_key, captcha_rqtoken) {
2026-10-01 14:13:23 +00:00
const obj = { captcha_key, captcha_rqtoken };
return closure_0(obj);
},
close() {
2026-10-01 14:13:23 +00:00
const obj = ActionSheetActionCreatorsDefault;
return obj.hideActionSheet(CAPTCHA_MODAL_KEY);
}
};
2026-10-01 14:13:23 +00:00
ActionSheetActionCreatorsDefault;
2026-10-12 16:32:48 +00:00
const tmp2 = require("asyncRequire")(18018, dependencyMap.paths);
const merged = Object.assign(obj);
2026-10-01 14:13:23 +00:00
const merged1 = Object.assign(options);
openLazy(tmp2, CAPTCHA_MODAL_KEY, obj2);
},
2026-10-01 14:13:23 +00:00
showCaptchaAsync(arg0) {
let c1;
let c2;
let c3;
let c4;
let captchaService;
let obj = arg1;
if (arg1 === undefined) {
2026-10-01 14:13:23 +00:00
obj = {};
}
c1 = undefined;
c2 = undefined;
c3 = undefined;
c4 = undefined;
2026-10-01 14:13:23 +00:00
({ sitekey: c1, captchaService: c2, captchaSessionId: c3, options: c4 } = arg0);
const promise = new Promise((arg0, arg1) => {
let captcha_session_id;
let closure_1;
let closure_0 = arg0;
sitekey = arg1;
2026-10-02 13:37:24 +00:00
let tmp = sitekey(captchaService[5]);
2026-10-01 14:13:23 +00:00
const openLazy = tmp.openLazy;
2026-10-02 13:37:24 +00:00
const tmp2 = obj(captchaService[7])(captchaService[6], captchaService.paths);
2026-10-01 14:13:23 +00:00
obj = {
sitekey,
captchaService,
onCaptchaVerify(captcha_key, captcha_rqtoken) {
2026-10-01 14:13:23 +00:00
obj = { captcha_key, captcha_rqtoken, captcha_session_id };
return closure_0(obj);
},
onReject(dependencyMap) {
if (dependencyMap === SharedCaptchaUtils.CaptchaError.CANCEL) {
2026-10-01 14:13:23 +00:00
const self3 = this;
const self4 = this;
const captchaCancelError = new SharedCaptchaUtils.CaptchaCancelError();
closure_1(captchaCancelError);
} else {
const _Error = Error;
const _HermesInternal = HermesInternal;
2026-10-01 14:13:23 +00:00
const self = this;
const self2 = this;
const error = new Error("Failed to display captcha for service " + c2 + ".");
closure_1(error);
}
},
close() {
2026-10-02 13:37:24 +00:00
obj = closure_1(captchaService[5]);
2026-10-01 14:13:23 +00:00
return obj.hideActionSheet(closure_1_4);
}
2026-10-01 14:13:23 +00:00
};
const merged = Object.assign(closure_0);
const merged1 = Object.assign(c4);
openLazy(tmp2, c4, obj, "stack");
});
2026-10-01 14:13:23 +00:00
return promise;
},
2026-10-12 16:32:48 +00:00
useIsCaptchaModalOpen: ReactCompilerGating.isReactCompilerEnabled() ? (function useIsCaptchaModalOpen() {
2026-10-02 13:37:24 +00:00
let key;
let tmp4;
let tmp5;
const obj = react;
const cResult = obj.c(2);
if (cResult[0] === Symbol.for("react.memo_cache_sentinel")) {
const items = [ActionSheetStore];
2026-10-12 16:32:48 +00:00
const fn = function s() {
2026-10-02 13:37:24 +00:00
return key.getKey() === CAPTCHA_MODAL_KEY;
};
cResult[0] = items;
cResult[1] = fn;
tmp4 = items;
tmp5 = fn;
} else {
[tmp4, tmp5] = cResult;
}
const tmpResult = get_initialized;
return tmpResult.useStateFromStores(tmp4, tmp5);
2026-10-12 16:32:48 +00:00
}) : (function useIsCaptchaModalOpen() {
2026-10-01 14:13:23 +00:00
let key;
const items = [ActionSheetStore];
2026-10-01 14:13:23 +00:00
const obj = get_initialized;
return obj.useStateFromStores(items, () => key.getKey() === CAPTCHA_MODAL_KEY);
2026-10-02 13:37:24 +00:00
})
};
2026-10-02 13:37:24 +00:00
ReactCompilerGating = ReactCompilerGating_mod;
2026-10-01 14:13:23 +00:00
const result = size.fileFinishedImporting("modules/captcha/CaptchaUtils.native.tsx");
export default obj;