export function normalizeComposerPrompt(value) {
    return typeof value === "string" ? value : null;
}
export function normalizeComposerInsertedPrompts(value) {
    if (!Array.isArray(value))
        return [];
    return value.flatMap((entry) => {
        if (!entry || typeof entry !== "object")
            return [];
        const item = entry;
        if (typeof item.id !== "string" ||
            typeof item.name !== "string" ||
            typeof item.text !== "string") {
            return [];
        }
        return [{
                id: item.id,
                name: item.name,
                text: item.text,
                placement: item.placement === "after" ? "after" : "before",
            }];
    });
}
