"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.ContentBlock = exports.ContentBase = exports.ContentItem = void 0;
const schema_1 = require("../../components/Image/schema.js");
const common_1 = require("../../gravity-blocks/schema/validators/common.js");
const utils_1 = require("../../gravity-blocks/schema/validators/utils.js");
exports.ContentItem = {
    additionalProperties: false,
    oneOf: [
        {
            required: ['icon'],
        },
        {
            required: ['gravityIcon'],
        },
    ],
    properties: {
        title: {
            type: 'string',
            contentType: 'text',
        },
        text: {
            type: 'string',
            contentType: 'yfm',
        },
        icon: (0, common_1.withTheme)(schema_1.ImageProps),
        gravityIcon: (0, common_1.withTheme)(common_1.GravityIconProps),
    },
};
exports.ContentBase = {
    title: {
        oneOf: [
            {
                type: 'string',
                contentType: 'text',
                optionName: 'text',
            },
            {
                ...common_1.TitleProps,
                optionName: 'options',
            },
        ],
    },
    text: {
        type: 'string',
        contentType: 'yfm',
        inputType: 'textarea',
    },
    additionalInfo: {
        type: 'string',
        contentType: 'yfm',
    },
    size: {
        type: 'string',
        enum: common_1.contentSizes,
    },
    links: (0, utils_1.filteredArray)(common_1.LinkProps),
    buttons: (0, utils_1.filteredArray)(common_1.ButtonBlock),
    theme: {
        type: 'string',
        enum: common_1.contentThemes,
    },
    list: (0, utils_1.filteredArray)(exports.ContentItem),
    controlPosition: {
        type: 'string',
        enum: ['default', 'bottom'],
    },
};
exports.ContentBlock = {
    content: {
        type: 'object',
        additionalProperties: false,
        properties: {
            ...exports.ContentBase,
            colSizes: common_1.containerSizesArray.reduce((acc, size) => ({ ...acc, [size]: common_1.sizeNumber }), {}),
            centered: {
                type: 'boolean',
            },
        },
    },
};
//# sourceMappingURL=schema.js.map
