"use strict";var _a;Object.defineProperty(exports,"__esModule",{value:!0}),exports.LambdaInsightsVersion=void 0;const JSII_RTTI_SYMBOL_1=Symbol.for("jsii.rtti");var architecture_1=()=>{var tmp=require("./architecture");return architecture_1=()=>tmp,tmp},core_1=()=>{var tmp=require("../../core");return core_1=()=>tmp,tmp},region_info_1=()=>{var tmp=require("../../region-info");return region_info_1=()=>tmp,tmp};class LambdaInsightsVersion{constructor(){this.layerVersionArn=""}static fromInsightVersionArn(arn){class InsightsArn extends LambdaInsightsVersion{constructor(){super(...arguments),this.layerVersionArn=arn}_bind(_scope,_function){return{arn}}}return new InsightsArn}static fromInsightsVersion(insightsVersion){class InsightsVersion extends LambdaInsightsVersion{constructor(){super(...arguments),this.layerVersionArn=core_1().Lazy.uncachedString({produce:context=>getVersionArn(context.scope,insightsVersion)})}_bind(_scope,_function){const arch=_function.architecture?.name??architecture_1().Architecture.X86_64.name;if(!region_info_1().RegionInfo.regions.some(regionInfo=>regionInfo.cloudwatchLambdaInsightsArn(insightsVersion,arch)))throw new Error(`Insights version ${insightsVersion} does not exist.`);return{arn:getVersionArn(_scope,insightsVersion,arch)}}}return new InsightsVersion}}exports.LambdaInsightsVersion=LambdaInsightsVersion,_a=JSII_RTTI_SYMBOL_1,LambdaInsightsVersion[_a]={fqn:"aws-cdk-lib.aws_lambda.LambdaInsightsVersion",version:"2.159.0"},LambdaInsightsVersion.VERSION_1_0_54_0=LambdaInsightsVersion.fromInsightsVersion("1.0.54.0"),LambdaInsightsVersion.VERSION_1_0_86_0=LambdaInsightsVersion.fromInsightsVersion("1.0.86.0"),LambdaInsightsVersion.VERSION_1_0_89_0=LambdaInsightsVersion.fromInsightsVersion("1.0.89.0"),LambdaInsightsVersion.VERSION_1_0_98_0=LambdaInsightsVersion.fromInsightsVersion("1.0.98.0"),LambdaInsightsVersion.VERSION_1_0_119_0=LambdaInsightsVersion.fromInsightsVersion("1.0.119.0"),LambdaInsightsVersion.VERSION_1_0_135_0=LambdaInsightsVersion.fromInsightsVersion("1.0.135.0"),LambdaInsightsVersion.VERSION_1_0_143_0=LambdaInsightsVersion.fromInsightsVersion("1.0.143.0"),LambdaInsightsVersion.VERSION_1_0_178_0=LambdaInsightsVersion.fromInsightsVersion("1.0.178.0"),LambdaInsightsVersion.VERSION_1_0_229_0=LambdaInsightsVersion.fromInsightsVersion("1.0.229.0"),LambdaInsightsVersion.VERSION_1_0_273_0=LambdaInsightsVersion.fromInsightsVersion("1.0.273.0"),LambdaInsightsVersion.VERSION_1_0_275_0=LambdaInsightsVersion.fromInsightsVersion("1.0.275.0"),LambdaInsightsVersion.VERSION_1_0_295_0=LambdaInsightsVersion.fromInsightsVersion("1.0.295.0"),LambdaInsightsVersion.VERSION_1_0_317_0=LambdaInsightsVersion.fromInsightsVersion("1.0.317.0");function getVersionArn(scope,insightsVersion,architecture){const scopeStack=core_1().Stack.of(scope),region=scopeStack.region,arch=architecture??architecture_1().Architecture.X86_64.name;if(region!==void 0&&!core_1().Token.isUnresolved(region)){const arn=region_info_1().RegionInfo.get(region).cloudwatchLambdaInsightsArn(insightsVersion,arch);if(arn===void 0)throw new Error(`Insights version ${insightsVersion} is not supported in region ${region}`);return arn}return scopeStack.regionalFact(region_info_1().FactName.cloudwatchLambdaInsightsVersion(insightsVersion,arch))}
