"use strict";var _a;Object.defineProperty(exports,"__esModule",{value:!0}),exports.Names=void 0;const jsiiDeprecationWarnings=require("../../.warnings.jsii.js"),JSII_RTTI_SYMBOL_1=Symbol.for("jsii.rtti"),constructs_1=require("constructs"),encoding_1=require("./private/encoding"),unique_resource_name_1=require("./private/unique-resource-name"),uniqueid_1=require("./private/uniqueid"),stack_1=require("./stack");class Names{constructor(){}static uniqueId(construct){const components=constructs_1.Node.of(construct).scopes.slice(1).map(c=>constructs_1.Node.of(c).id);return components.length>0?uniqueid_1.makeUniqueId(components):""}static nodeUniqueId(node){const components=node.scopes.slice(1).map(c=>constructs_1.Node.of(c).id);return components.length>0?uniqueid_1.makeUniqueId(components):""}static uniqueResourceName(construct,options){try{jsiiDeprecationWarnings.aws_cdk_lib_UniqueResourceNameOptions(options)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.uniqueResourceName),error}const node=constructs_1.Node.of(construct),componentsPath=node.scopes.slice(node.scopes.indexOf(node.scopes.reverse().find(component=>stack_1.Stack.isStack(component)&&!encoding_1.unresolved(component.stackName)))).map(component=>stack_1.Stack.isStack(component)&&!encoding_1.unresolved(component.stackName)?component.stackName:constructs_1.Node.of(component).id);return unique_resource_name_1.makeUniqueResourceName(componentsPath,options)}}exports.Names=Names,_a=JSII_RTTI_SYMBOL_1,Names[_a]={fqn:"aws-cdk-lib.Names",version:"2.46.0"};
//# sourceMappingURL=names.js.map
