decord/beta/source/modules/captcha/CaptchaStore.tsx

76 lines
2.6 KiB
TypeScript
Raw Permalink Normal View History

2026-10-12 16:32:48 +00:00
// Module ID: 5728
// Function ID: 5729
// Name: CaptchaStore
2026-10-12 16:32:48 +00:00
// Dependencies: [32, 570, 1272, 5729, 5734, 2]
// Exports: flushCaptchaServeVolume, incrementCaptchaServeVolume, isCaptchaStoreVolumeEmpty
2026-10-12 16:32:48 +00:00
// Module 5728 (CaptchaStore)
import react_native from "react-native" /* 1272 */;
import MonitoringAgentDefault from "MonitoringAgent" /* 5729 */;
import MetricEvents from "MetricEvents" /* 5734 */;
2026-10-01 14:13:23 +00:00
import _slicedToArray from "_slicedToArray" /* 32 */;
2026-10-02 13:37:24 +00:00
import module_570 from "module_570" /* 570 */;
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
const useCaptchaStore = module_570.create(() => ({ captchaServeVolume: {} }));
const result = size.fileFinishedImporting("modules/captcha/CaptchaStore.tsx");
2026-10-01 14:13:23 +00:00
export { useCaptchaStore };
export const isCaptchaStoreVolumeEmpty = function isCaptchaStoreVolumeEmpty() {
2026-10-01 14:13:23 +00:00
return 0 === Object.keys(obj.getState().captchaServeVolume).length;
};
export const incrementCaptchaServeVolume = function incrementCaptchaServeVolume(arg0) {
2026-10-01 14:13:23 +00:00
let closure_0;
_require = arg0;
2026-10-01 14:13:23 +00:00
let obj = require("react-native");
obj.batchUpdates(() => {
let obj;
obj.setState((captchaServeVolume) => {
let tmp2 = captchaServeVolume;
if (null != closure_1_0) {
let tmp6;
const obj = { captchaServeVolume: null };
const obj2 = {};
2026-10-01 14:13:23 +00:00
const tmp3 = closure_1_0 in captchaServeVolume.captchaServeVolume;
const merged = Object.assign(captchaServeVolume.captchaServeVolume);
if (tmp3) {
2026-10-01 14:13:23 +00:00
obj2[closure_1_0] = captchaServeVolume.captchaServeVolume[closure_1_0] + 1;
obj.captchaServeVolume = obj2;
2026-10-01 14:13:23 +00:00
tmp6 = obj;
} else {
2026-10-01 14:13:23 +00:00
obj2[closure_1_0] = 1;
obj.captchaServeVolume = obj2;
2026-10-01 14:13:23 +00:00
tmp6 = obj;
}
2026-10-01 14:13:23 +00:00
tmp2 = tmp6;
}
2026-10-01 14:13:23 +00:00
return tmp2;
});
});
};
export const flushCaptchaServeVolume = function flushCaptchaServeVolume() {
2026-10-01 14:13:23 +00:00
let items;
let obj;
let state;
let tmp6;
let tmp7;
const entries = Object.entries(obj.getState().captchaServeVolume);
const tmp2 = entries[Symbol.iterator]();
while (tmp2 !== undefined) {
let tmp5 = _slicedToArray(tmp3, 2);
[tmp6, tmp7] = tmp5;
2026-10-01 14:13:23 +00:00
let tmp10 = MonitoringAgentDefault;
obj = { name: MetricEvents.MetricEvents.CAPTCHA_SERVE_VOLUME_DISTRIBUTION, tags: items };
let distribution = tmp10.distribution;
let _HermesInternal = HermesInternal;
2026-10-01 14:13:23 +00:00
items = ["user_flow:" + tmp6];
let distributionResult = distribution(obj, tmp7, true);
continue;
}
2026-10-01 14:13:23 +00:00
const obj2 = react_native;
obj2.batchUpdates(() => state.setState({ captchaServeVolume: {} }));
};