83 lines
4.3 KiB
TypeScript
83 lines
4.3 KiB
TypeScript
/* Metro module 6665; source: modules/guild_member_verification/MemberVerificationUtils.tsx; dependencies: [6666, 661, 3972, 1360, 2] */
|
|
function _fun52616(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#52616, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6843:6, offset: 0x0133334d, size: 195 bytes, params: 8, frame: 18
|
|
const env0_0 = require;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
const memberVerificationConstantsModule = require(6666) /* metro dependency 6666: MemberVerificationConstants */;
|
|
const env0_2 = memberVerificationConstantsModule.AUTOMATIC_APPROVAL_FORM_FIELDS;
|
|
const env0_3 = memberVerificationConstantsModule.MANUAL_APPROVAL_FORM_FIELDS;
|
|
const env0_4 = (require(661) /* metro dependency 661: Constants */).GuildFeatures;
|
|
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/guild_member_verification/MemberVerificationUtils.tsx');
|
|
exports.isValidFormResponse = isValidFormResponse;
|
|
exports.removeInternalFields = function(a0) {
|
|
return a0.filter(_fun52619);
|
|
};
|
|
exports.isAutomaticApprovalFormField = isAutomaticApprovalFormField;
|
|
exports.isManualApprovalFormField = isManualApprovalFormField;
|
|
exports.guildHasVerificationGate = guildHasVerificationGate;
|
|
}
|
|
|
|
function isValidFormResponse({required, response, field_type}) { // fn#52617, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6843:314, offset: 0x01333410, size: 315 bytes, params: 2, frame: 15
|
|
var r0;
|
|
var value;
|
|
const VerificationFormFieldTypes = (require(3972) /* metro dependency 3972: MemberVerificationTypes */).VerificationFormFieldTypes;
|
|
if (required) {
|
|
if (response == null) {
|
|
return false;
|
|
}
|
|
if (VerificationFormFieldTypes.TERMS === field_type) {
|
|
return global.Boolean(response);
|
|
}
|
|
if (VerificationFormFieldTypes.VERIFICATION === field_type) {
|
|
return global.Boolean(response);
|
|
}
|
|
if (VerificationFormFieldTypes.TEXT_INPUT === field_type) {
|
|
value = typeof response === 'string';
|
|
if (value) {
|
|
value = response.trim();
|
|
value = value !== '';
|
|
r0 = value;
|
|
} else {
|
|
r0 = value;
|
|
}
|
|
return r0;
|
|
}
|
|
if (VerificationFormFieldTypes.PARAGRAPH === field_type) {
|
|
value = typeof response === 'string';
|
|
if (value) {
|
|
value = response.trim();
|
|
value = value !== '';
|
|
r0 = value;
|
|
} else {
|
|
r0 = value;
|
|
}
|
|
return r0;
|
|
}
|
|
if (VerificationFormFieldTypes.MULTIPLE_CHOICE === field_type) {
|
|
return typeof response === 'number';
|
|
}
|
|
value = require(1360) /* metro dependency 1360: GlobalUtils */;
|
|
return value.assertNever(field_type);
|
|
}
|
|
return true;
|
|
}
|
|
|
|
function removeInternalFields(a0) { // fn#52618, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6843:810, offset: 0x0133354b, size: 22 bytes, params: 2, frame: 11
|
|
return a0.filter(function({field_type}) {
|
|
return field_type !== require(dependencyMap[2]).VerificationFormFieldTypes.VERIFICATION;
|
|
});
|
|
}
|
|
|
|
function isAutomaticApprovalFormField(a0) { // fn#52620, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6843:964, offset: 0x01333595, size: 39 bytes, params: 2, frame: 13
|
|
return AUTOMATIC_APPROVAL_FORM_FIELDS.has(a0?.field_type);
|
|
}
|
|
|
|
function isManualApprovalFormField(a0) { // fn#52621, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6843:1076, offset: 0x013335bc, size: 39 bytes, params: 2, frame: 13
|
|
return MANUAL_APPROVAL_FORM_FIELDS.has(a0?.field_type);
|
|
}
|
|
|
|
function guildHasVerificationGate(a0) { // fn#52622, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6843:1184, offset: 0x013335e3, size: 43 bytes, params: 2, frame: 12
|
|
return a0 != null && a0.features.has(GuildFeatures.MEMBER_VERIFICATION_GATE_ENABLED);
|
|
}
|
|
|