"use strict";var _a;Object.defineProperty(exports,"__esModule",{value:!0}),exports.SfnStateMachine=void 0;const jsiiDeprecationWarnings=require("../../.warnings.jsii.js"),JSII_RTTI_SYMBOL_1=Symbol.for("jsii.rtti"),iam=require("../../aws-iam"),util_1=require("./util");class SfnStateMachine{constructor(machine,props={}){var _b;this.machine=machine,this.props=props,jsiiDeprecationWarnings.aws_cdk_lib_aws_stepfunctions_IStateMachine(machine),jsiiDeprecationWarnings.aws_cdk_lib_aws_events_targets_SfnStateMachineProps(props),props.role&&props.role.grant(new iam.ServicePrincipal("events.amazonaws.com")),this.role=(_b=props.role)!==null&&_b!==void 0?_b:util_1.singletonEventRole(machine,[]),machine.grantStartExecution(this.role)}bind(_rule,_id){return jsiiDeprecationWarnings.aws_cdk_lib_aws_events_IRule(_rule),this.props.deadLetterQueue&&util_1.addToDeadLetterQueueResourcePolicy(_rule,this.props.deadLetterQueue),{...util_1.bindBaseTargetConfig(this.props),arn:this.machine.stateMachineArn,role:this.role,input:this.props.input,targetResource:this.machine}}}exports.SfnStateMachine=SfnStateMachine,_a=JSII_RTTI_SYMBOL_1,SfnStateMachine[_a]={fqn:"aws-cdk-lib.aws_events_targets.SfnStateMachine",version:"2.13.0"};
//# sourceMappingURL=state-machine.js.map
