"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.humanizeWaitStep = humanizeWaitStep;
exports.waitStepToAIString = waitStepToAIString;
const BaseStep_1 = __importDefault(require("./BaseStep"));
const mablscript_step_types_1 = require("../../mablscript-step-types");
const yaml_utils_1 = require("../yaml-utils");
class WaitStep extends BaseStep_1.default {
    static getStepType() {
        return mablscript_step_types_1.StepType.WAIT;
    }
    constructor(waitTimeMilliSeconds) {
        super(WaitStep.getStepType());
        this.options = {
            editable: true,
            executionContext: 'background',
        };
        this.waitTimeMilliSeconds = waitTimeMilliSeconds;
    }
    generateMablscript() {
        return `wait(${this.waitTimeMilliSeconds})`;
    }
    inputVariables() {
        return [];
    }
    static generateStepFromMablStep(mablWaitStep) {
        return new WaitStep(mablWaitStep.milliseconds);
    }
    static create(descriptor) {
        const step = new WaitStep(descriptor.milliseconds);
        step.generateStepId();
        return step;
    }
}
exports.default = WaitStep;
function humanizeWaitStep(step) {
    return `Wait for ${step.waitTimeMilliSeconds / 1000} seconds`;
}
function waitStepToAIString(step) {
    return (0, yaml_utils_1.toYaml)({
        stepType: step.stepType,
        duration_ms: step.waitTimeMilliSeconds,
    });
}
