"use strict";var _a;Object.defineProperty(exports,"__esModule",{value:!0}),exports.GeoRestriction=void 0;const JSII_RTTI_SYMBOL_1=Symbol.for("jsii.rtti");class GeoRestriction{static allowlist(...locations){return new GeoRestriction("whitelist",GeoRestriction.validateLocations(locations))}static denylist(...locations){return new GeoRestriction("blacklist",GeoRestriction.validateLocations(locations))}static whitelist(...locations){return GeoRestriction.allowlist(...locations)}static blacklist(...locations){return GeoRestriction.denylist(...locations)}static validateLocations(locations){if(locations.length===0)throw new Error("Should provide at least 1 location");return locations.forEach(location=>{if(!GeoRestriction.LOCATION_REGEX.test(location))throw new Error(`Invalid location format for location: ${location}, location should be two-letter and uppercase country ISO 3166-1-alpha-2 code`)}),locations}constructor(restrictionType,locations){this.restrictionType=restrictionType,this.locations=locations}}exports.GeoRestriction=GeoRestriction,_a=JSII_RTTI_SYMBOL_1,GeoRestriction[_a]={fqn:"aws-cdk-lib.aws_cloudfront.GeoRestriction",version:"2.148.1"},GeoRestriction.LOCATION_REGEX=/^[A-Z]{2}$/;
