"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.EvaluateExpression=void 0;var jsiiDeprecationWarnings=()=>{var tmp=require("../../.warnings.jsii.js");return jsiiDeprecationWarnings=()=>tmp,tmp};const JSII_RTTI_SYMBOL_1=Symbol.for("jsii.rtti");var iam=()=>{var tmp=require("../../aws-iam");return iam=()=>tmp,tmp},lambda=()=>{var tmp=require("../../aws-lambda");return lambda=()=>tmp,tmp},sfn=()=>{var tmp=require("../../aws-stepfunctions");return sfn=()=>tmp,tmp},core_1=()=>{var tmp=require("../../core");return core_1=()=>tmp,tmp},literal_string_1=()=>{var tmp=require("../../core/lib/private/literal-string");return literal_string_1=()=>tmp,tmp},eval_nodejs_provider_generated_1=()=>{var tmp=require("../../custom-resource-handlers/dist/aws-stepfunctions-tasks/eval-nodejs-provider.generated");return eval_nodejs_provider_generated_1=()=>tmp,tmp};class EvaluateExpression extends sfn().TaskStateBase{props;static[JSII_RTTI_SYMBOL_1]={fqn:"aws-cdk-lib.aws_stepfunctions_tasks.EvaluateExpression",version:"2.256.1"};taskMetrics;taskPolicies;evalFn;constructor(scope,id,props){super(scope,id,props),this.props=props;try{jsiiDeprecationWarnings().aws_cdk_lib_aws_stepfunctions_tasks_EvaluateExpressionProps(props)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,EvaluateExpression),error}this.evalFn=createEvalFn(this.props.runtime,this.props.architecture,this),this.taskPolicies=[new(iam()).PolicyStatement({resources:this.evalFn.resourceArnsForGrantInvoke,actions:["lambda:InvokeFunction"]})]}_renderTask(){const matches=this.props.expression.match(/\$[.\[][.a-zA-Z[\]0-9-_]+/g);let expressionAttributeValues={};matches&&(expressionAttributeValues=matches.reduce((acc,m)=>({...acc,[m]:sfn().JsonPath.stringAt(m)}),{}));const parameters={expression:this.props.expression,expressionAttributeValues};return{Resource:this.evalFn.functionArn,Parameters:sfn().FieldUtils.renderObject(parameters)}}}exports.EvaluateExpression=EvaluateExpression;function createEvalFn(runtime,architecture,scope){const NO_RUNTIME=Symbol.for("no-runtime"),lambdaPurpose="Eval",nodeJsGuids={[lambda().Runtime.NODEJS_22_X.name]:"b64e1fb8-9c89-4f7d-8a34-2e2a1c5f6d7e",[lambda().Runtime.NODEJS_20_X.name]:"9757c267-6d7c-45c2-af77-37a30d93d2c6",[lambda().Runtime.NODEJS_18_X.name]:"078d40d3-fb4e-4d53-94a7-9c46fc11fe02",[lambda().Runtime.NODEJS_16_X.name]:"2a430b68-eb4b-4026-9232-ee39b71c1db8",[lambda().Runtime.NODEJS_14_X.name]:"da2d1181-604e-4a45-8694-1a6abd7fe42d",[lambda().Runtime.NODEJS_12_X.name]:"2b81e383-aad2-44db-8aaf-b4809ae0e3b4",[lambda().Runtime.NODEJS_10_X.name]:"a0d2ce44-871b-4e74-87a1-f5e63d7c3bdc",[NO_RUNTIME]:"41256dc5-4457-4273-8ed9-17bc818694e5"},nodeJsArmGuids={[lambda().Runtime.NODEJS_22_X.name]:"672bfe19-76c9-448b-9584-ee75ca09edbf",[lambda().Runtime.NODEJS_20_X.name]:"105f0693-c082-4e9b-83f3-9007507676f0",[lambda().Runtime.NODEJS_18_X.name]:"b1565b13-7d88-4f24-ac63-f9b23c325a55",[lambda().Runtime.NODEJS_16_X.name]:"8fa21b46-1d7c-445d-be08-6bbea646eb37",[lambda().Runtime.NODEJS_14_X.name]:"cadc099b-465f-4267-afe0-e0037d263401",[lambda().Runtime.NODEJS_12_X.name]:"abcd5ad4-b1eb-48f1-bec5-41d6f5c82caa",[lambda().Runtime.NODEJS_10_X.name]:"886204b9-1f2d-40bd-8a7e-628543da4f93",[NO_RUNTIME]:"be6d8ca1-9d2c-4db3-aeeb-f6f27f3f2f10"},runtimeKey=runtime?.name??NO_RUNTIME,uuid=(architecture===lambda().Architecture.ARM_64?nodeJsArmGuids:nodeJsGuids)[runtimeKey];if(!uuid)throw new(core_1()).UnscopedValidationError((0,literal_string_1().lit)`RuntimeCurrentlySupported`,`The runtime ${runtime?.name} is currently not supported.`);return new(eval_nodejs_provider_generated_1()).EvalNodejsSingletonFunction(scope,"EvalFunction",{uuid,lambdaPurpose,runtime,architecture})}
