"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const FlowValidationClass_1 = require("./FlowValidationClass");
const mablscript_step_types_1 = require("../mablscript-step-types");
class FlowValidationStepGroups extends FlowValidationClass_1.FlowValidationClass {
    constructor() {
        super();
        this.emptyStepGroups = [];
    }
    processStep(step, humanizedStep, _flow) {
        if (humanizedStep.isDisabledStep) {
            return;
        }
        if ((0, mablscript_step_types_1.isStepGroupStep)(step) && step.stepsInGroup.length === 0) {
            this.emptyStepGroups.push(humanizedStep);
        }
    }
    finalizeValidations(_humanizedSteps) {
        this.emptyStepGroups.forEach((emptyGroup) => {
            emptyGroup.validation.push({
                name: 'emptyStepGroup',
                humanized: 'Add at least one step or remove this before saving.',
            });
        });
    }
}
exports.default = FlowValidationStepGroups;
