import { v4 as uuidV4 } from "uuid";
import { messages } from "../../../../errors.js";
export const DUPLICATE_PUBLICATION_ERRORS = new Set([
    messages.ERR_DUPLICATE_COMMENT,
    messages.ERR_DUPLICATE_COMMENT_EDIT,
    messages.ERR_DUPLICATE_COMMENT_MODERATION
]);
export const defaultChallengeQuestionText = "What is the answer to this community's challenge? (check community.settings.challenges to see the answer, or set your own challenge)";
export function generateDefaultChallenges(answer) {
    return [
        {
            name: "question",
            options: {
                question: defaultChallengeQuestionText,
                answer: answer ?? uuidV4()
            }
        }
    ];
}
export function isDefaultChallengeStructure(challenges) {
    if (!challenges || challenges.length !== 1)
        return false;
    const c = challenges[0];
    return (c.name === "question" &&
        c.options?.question === defaultChallengeQuestionText &&
        typeof c.options?.answer === "string" &&
        c.options.answer.length > 0);
}
//# sourceMappingURL=defaults.js.map