2026-08-24 06:08:38 +00:00
|
|
|
// Module ID: 6897
|
|
|
|
|
// Function ID: 6898
|
2026-07-20 16:05:17 +00:00
|
|
|
// Name: isValidFormResponse
|
2026-08-24 06:08:38 +00:00
|
|
|
// Dependencies: [6898, 676, 4204, 1370, 2]
|
2026-07-20 16:05:17 +00:00
|
|
|
// Exports: guildHasVerificationGate, isAutomaticApprovalFormField, isManualApprovalFormField, isValidFormResponse, removeInternalFields
|
|
|
|
|
|
2026-08-24 06:08:38 +00:00
|
|
|
// Module 6897 (isValidFormResponse)
|
|
|
|
|
import set from "set" /* 2 */;
|
|
|
|
|
import ME from "ME" /* 676 */;
|
|
|
|
|
import MAX_RESULTS_PER_PAGE from "MAX_RESULTS_PER_PAGE" /* 4204 */;
|
|
|
|
|
import items from "items" /* 6898 */;
|
2026-07-23 10:11:24 +00:00
|
|
|
|
2026-07-29 08:29:29 +00:00
|
|
|
({ AUTOMATIC_APPROVAL_FORM_FIELDS: obj1, MANUAL_APPROVAL_FORM_FIELDS: c3 } = items);
|
2026-08-24 06:08:38 +00:00
|
|
|
const GuildFeatures = ME.GuildFeatures;
|
|
|
|
|
const result = set.fileFinishedImporting("modules/guild_member_verification/MemberVerificationUtils.tsx");
|
2026-07-20 16:05:17 +00:00
|
|
|
|
|
|
|
|
export const isValidFormResponse = function isValidFormResponse(required) {
|
|
|
|
|
({ response, field_type } = required);
|
|
|
|
|
if (required.required) {
|
|
|
|
|
if (null == response) {
|
|
|
|
|
return false;
|
|
|
|
|
} else {
|
2026-08-24 06:08:38 +00:00
|
|
|
if (MAX_RESULTS_PER_PAGE.VerificationFormFieldTypes.TERMS !== field_type) {
|
|
|
|
|
if (tmp4(4204).VerificationFormFieldTypes.VERIFICATION !== field_type) {
|
|
|
|
|
if (tmp4(4204).VerificationFormFieldTypes.TEXT_INPUT !== field_type) {
|
|
|
|
|
if (tmp4(4204).VerificationFormFieldTypes.PARAGRAPH !== field_type) {
|
|
|
|
|
if (tmp4(4204).VerificationFormFieldTypes.MULTIPLE_CHOICE === field_type) {
|
2026-08-04 21:03:28 +00:00
|
|
|
return typeof response === "number";
|
2026-07-20 16:05:17 +00:00
|
|
|
} else {
|
2026-08-11 06:20:06 +00:00
|
|
|
return tmp4(1370).assertNever(field_type);
|
2026-07-20 16:05:17 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2026-08-04 21:03:28 +00:00
|
|
|
let tmp2 = typeof response === "string";
|
|
|
|
|
if (typeof response === "string") {
|
2026-07-29 08:29:29 +00:00
|
|
|
tmp2 = "" !== response.trim();
|
2026-07-20 16:05:17 +00:00
|
|
|
}
|
2026-07-29 08:29:29 +00:00
|
|
|
return tmp2;
|
2026-07-20 16:05:17 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
const _Boolean = Boolean;
|
|
|
|
|
return Boolean(response);
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
export const removeInternalFields = function removeInternalFields(arr) {
|
2026-07-29 08:29:29 +00:00
|
|
|
return arr.filter((field_type) => field_type.field_type !== callback(table[2]).VerificationFormFieldTypes.VERIFICATION);
|
2026-07-20 16:05:17 +00:00
|
|
|
};
|
|
|
|
|
export const isAutomaticApprovalFormField = function isAutomaticApprovalFormField(field_type) {
|
|
|
|
|
field_type = undefined;
|
2026-07-29 08:29:29 +00:00
|
|
|
if (field_type != null) {
|
2026-07-20 16:05:17 +00:00
|
|
|
field_type = field_type.field_type;
|
|
|
|
|
}
|
|
|
|
|
return set.has(field_type);
|
|
|
|
|
};
|
|
|
|
|
export const isManualApprovalFormField = function isManualApprovalFormField(field_type) {
|
|
|
|
|
field_type = undefined;
|
2026-07-29 08:29:29 +00:00
|
|
|
if (field_type != null) {
|
2026-07-20 16:05:17 +00:00
|
|
|
field_type = field_type.field_type;
|
|
|
|
|
}
|
|
|
|
|
return set2.has(field_type);
|
|
|
|
|
};
|
|
|
|
|
export const guildHasVerificationGate = function guildHasVerificationGate(guild) {
|
|
|
|
|
let hasItem = null != guild;
|
|
|
|
|
if (hasItem) {
|
|
|
|
|
const features = guild.features;
|
|
|
|
|
hasItem = features.has(GuildFeatures.MEMBER_VERIFICATION_GATE_ENABLED);
|
|
|
|
|
}
|
|
|
|
|
return hasItem;
|
|
|
|
|
};
|