// convert-build-catalog.ts — WorldProject build catalog → engine BuildCatalog
/**
 * Convert project build catalog → engine build catalog (or `undefined` if
 * none authored).
 *
 * **Precondition:** `validateProject(project).valid === true`. Converters do
 * not guard against missing nested properties and will throw if input is
 * malformed. (AIR-B-006)
 */
export function convertBuildCatalog(project) {
    if (!project.buildCatalog)
        return undefined;
    const bc = project.buildCatalog;
    return {
        packId: project.id,
        statBudget: bc.statBudget,
        maxTraits: bc.maxTraits,
        requiredFlaws: bc.requiredFlaws,
        archetypes: bc.archetypes.map((a) => ({ ...a })),
        backgrounds: bc.backgrounds.map((b) => ({ ...b })),
        traits: bc.traits.map((t) => ({ ...t })),
        disciplines: bc.disciplines.map((d) => ({ ...d })),
        crossTitles: bc.crossTitles.map((ct) => ({ ...ct })),
        entanglements: bc.entanglements.map((e) => ({ ...e })),
    };
}
//# sourceMappingURL=convert-build-catalog.js.map