'use strict';

var z = require('zod');
var Validate = require('../dashboard-visualisation/Validate.js');

const scorecardKey = z.z.object({
    id: z.z.string(),
    optional: z.z.boolean().default(false),
});
const scorecardMeasure = z.z.object({
    id: z.z.string(),
    unit: z.z.enum(Validate.UnitType).optional(),
});
const ScorecardMeasuresSchema = z.z.array(scorecardMeasure).length(1, 'Measure must contain a single item');
const ScorecardSchema = z.z.object({
    ...Validate.DashboardVisualisationSchema.shape,
    type: z.z.literal('scorecard'),
    display: z.z.string(),
    description: z.z.undefined(),
    options: z.z.object(Validate.BucketOptionsSchema.shape).optional(),
    columns: z.z.object({
        ...Validate.DashboardColumns.shape,
        keys: z.z.array(scorecardKey).min(1),
        measures: ScorecardMeasuresSchema,
    }),
});
var ScorecardSchemas = {
    ScorecardSchema};

module.exports = ScorecardSchemas;
//# sourceMappingURL=validate.js.map
