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