decord/source/modules/captcha/CaptchaStore.tsx
github-actions 777dc50a28 chore: update source for alpha 346.3
Skipped 1 file(s) >100MB (GitHub limit): source/__polyfill/04xxx/module_4790.js (118.4 MB)
2026-09-10 19:12:31 +00:00

65 lines
2.3 KiB
TypeScript

// Module ID: 11350
// Function ID: 11351
// Name: CaptchaStore
// Dependencies: [32, 560, 1249, 7653, 7658, 2]
// Exports: flushCaptchaServeVolume, incrementCaptchaServeVolume, isCaptchaStoreVolumeEmpty
// Module 11350 (CaptchaStore)
import ReactBatchUpdates from "ReactBatchUpdates" /* 1249 */;
import MonitoringAgentDefault from "MonitoringAgent" /* 7653 */;
import MetricEvents from "MetricEvents" /* 7658 */;
import _slicedToArray from "module_32" /* 32 */;
const require = globalThis.__r;
require = fn;
const module_560 = fn(560);
let obj3 = module_560.create(() => ({ captchaServeVolume: {} }));
const size = fn(2);
const result = size.fileFinishedImporting("modules/captcha/CaptchaStore.tsx");
export const useCaptchaStore = obj3;
export const isCaptchaStoreVolumeEmpty = function isCaptchaStoreVolumeEmpty() {
return 0 === Object.keys(obj3.getState().captchaServeVolume).length;
};
export const incrementCaptchaServeVolume = function incrementCaptchaServeVolume(arg0) {
_require = arg0;
require("ReactBatchUpdates").batchUpdates(() => {
obj3.setState((arg0) => {
let sum = arg0;
if (null == closure_1_0) {
return sum;
} else {
const obj = { captchaServeVolume: null };
const obj2 = {};
const merged = Object.assign(sum.captchaServeVolume);
if (tmp3) {
sum = sum.captchaServeVolume[tmp2] + 1;
obj2[tmp2] = sum;
obj.captchaServeVolume = obj2;
} else {
obj2[tmp2] = 1;
obj.captchaServeVolume = obj2;
}
tmp3 = tmp2 in sum.captchaServeVolume;
}
});
});
};
export const flushCaptchaServeVolume = function flushCaptchaServeVolume() {
const entries = Object.entries(obj3.getState().captchaServeVolume);
while (tmp2 !== undefined) {
let tmp5 = _slicedToArray(tmp3, 2);
[tmp6, tmp7] = tmp5;
let obj = MonitoringAgentDefault;
let obj2 = { name: null, tags: null };
obj2.name = MetricEvents.MetricEvents.CAPTCHA_SERVE_VOLUME_DISTRIBUTION;
let _HermesInternal = HermesInternal;
let items = ["user_flow:" + tmp6];
obj2.tags = items;
let distributionResult = obj.distribution(obj2, tmp7, true);
continue;
}
obj3 = ReactBatchUpdates;
obj3.batchUpdates(() => state.setState({ captchaServeVolume: {} }));
};