decord/alpha/source/modules/unique_usernames/UniqueUsernamesUtils.tsx

54 lines
1.9 KiB
TypeScript
Raw Normal View History

2026-10-03 08:58:59 +00:00
// Module ID: 14517
// Function ID: 14518
// Name: UniqueUsernamesUtils
2026-10-03 08:58:59 +00:00
// Dependencies: [5075, 14512, 1126, 2]
2026-07-20 16:05:17 +00:00
// Exports: formatUsernameLiveCheckValidation
2026-10-03 08:58:59 +00:00
// Module 14517 (UniqueUsernamesUtils)
import intl2 from "intl" /* 1126 */;
import merged5 from "merged5" /* 5075 */;
import UniqueUsernamesTypes from "UniqueUsernamesTypes" /* 14512 */;
import size from "module_2" /* 2 */;
2026-08-24 06:08:38 +00:00
const result = size.fileFinishedImporting("modules/unique_usernames/UniqueUsernamesUtils.tsx");
2026-07-20 16:05:17 +00:00
2026-07-29 08:29:29 +00:00
export const formatUsernameLiveCheckValidation = function formatUsernameLiveCheckValidation(arg0) {
2026-10-03 08:58:59 +00:00
let P;
const f117053 = () => {
let intl;
const obj = { type: UniqueUsernamesTypes.NameValidationState.RATE_LIMIT, message: intl.string(intl2.t.T15lqn) };
intl = intl2.intl;
2026-07-20 16:05:17 +00:00
return obj;
2026-10-03 08:58:59 +00:00
};
const str = merged5;
const match = str.match(arg0);
let obj = { error: P.not(merged5.P.nullish) };
const _with = match.with({ rateLimited: true }, f117053).with;
match.with({ rateLimited: true }, f117053);
P = merged5.P;
const _withResult = _with(obj, (error) => {
const obj = { type: UniqueUsernamesTypes.NameValidationState.ERROR, message: error.error };
2026-07-20 16:05:17 +00:00
return obj;
});
2026-10-03 08:58:59 +00:00
const withResult1 = _withResult.with({ taken: false }, () => {
let intl;
const obj = { type: UniqueUsernamesTypes.NameValidationState.AVAILABLE, message: intl.string(intl2.t.PgfBSx) };
intl = intl2.intl;
2026-07-20 16:05:17 +00:00
return obj;
2026-10-03 08:58:59 +00:00
});
const withResult2 = withResult1.with({ taken: true }, () => {
let intl;
const obj = { type: UniqueUsernamesTypes.NameValidationState.ERROR, message: intl.string(intl2.t.mCrAUb) };
intl = intl2.intl;
2026-07-20 16:05:17 +00:00
return obj;
2026-10-03 08:58:59 +00:00
});
const obj2 = { error: merged5.P.nullish };
const withResult3 = withResult2.with(obj2, () => {
const obj = { type: UniqueUsernamesTypes.NameValidationState.INTERNAL_ERROR, message: "" };
2026-07-20 16:05:17 +00:00
return obj;
});
2026-10-03 08:58:59 +00:00
return withResult3.otherwise(() => {
2026-07-20 16:05:17 +00:00
});
};