"use strict";var _a;Object.defineProperty(exports,"__esModule",{value:!0}),exports.Step=void 0;const jsiiDeprecationWarnings=require("../../../.warnings.jsii.js"),JSII_RTTI_SYMBOL_1=Symbol.for("jsii.rtti"),core_1=require("../../../core"),step_output_1=require("../helpers-internal/step-output");class Step{constructor(id){if(this.id=id,this.dependencyFileSets=[],this.isSource=!1,this._dependencies=new Set,core_1.Token.isUnresolved(id))throw new Error(`Step id cannot be unresolved, got '${id}'`)}static sequence(steps){for(let i=1;i<steps.length;i++)steps[i].addStepDependency(steps[i-1]);return steps}get dependencies(){return Array.from(new Set([...this.dependencyFileSets.map(f=>f.producer),...this._dependencies]))}toString(){return`${this.constructor.name}(${this.id})`}get primaryOutput(){return this._primaryOutput}addStepDependency(step){try{jsiiDeprecationWarnings.aws_cdk_lib_pipelines_Step(step)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.addStepDependency),error}this._dependencies.add(step)}addDependencyFileSet(fs){try{jsiiDeprecationWarnings.aws_cdk_lib_pipelines_FileSet(fs)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.addDependencyFileSet),error}this.dependencyFileSets.push(fs)}configurePrimaryOutput(fs){try{jsiiDeprecationWarnings.aws_cdk_lib_pipelines_FileSet(fs)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.configurePrimaryOutput),error}this._primaryOutput=fs}discoverReferencedOutputs(structure){for(const output of step_output_1.StepOutput.findAll(structure))this._dependencies.add(output.step),step_output_1.StepOutput.recordProducer(output)}}exports.Step=Step,_a=JSII_RTTI_SYMBOL_1,Step[_a]={fqn:"aws-cdk-lib.pipelines.Step",version:"2.29.0"};
//# sourceMappingURL=step.js.map
