const require_rolldown_runtime = require('../../../../../../../_virtual/rolldown_runtime.js');
const require_LRUCache$1 = require('./LRUCache.js');

//#region ../../node_modules/.pnpm/libphonenumber-js@1.11.3/node_modules/libphonenumber-js/build/findNumbers/RegExpCache.js
var require_RegExpCache = /* @__PURE__ */ require_rolldown_runtime.__commonJS({ "../../node_modules/.pnpm/libphonenumber-js@1.11.3/node_modules/libphonenumber-js/build/findNumbers/RegExpCache.js": ((exports) => {
	Object.defineProperty(exports, "__esModule", { value: true });
	var _LRUCache = _interopRequireDefault(require_LRUCache$1.require_LRUCache());
	function _interopRequireDefault(obj) {
		return obj && obj.__esModule ? obj : { "default": obj };
	}
	function _classCallCheck(instance, Constructor) {
		if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function");
	}
	function _defineProperties(target, props) {
		for (var i = 0; i < props.length; i++) {
			var descriptor = props[i];
			descriptor.enumerable = descriptor.enumerable || false;
			descriptor.configurable = true;
			if ("value" in descriptor) descriptor.writable = true;
			Object.defineProperty(target, descriptor.key, descriptor);
		}
	}
	function _createClass(Constructor, protoProps, staticProps) {
		if (protoProps) _defineProperties(Constructor.prototype, protoProps);
		if (staticProps) _defineProperties(Constructor, staticProps);
		Object.defineProperty(Constructor, "prototype", { writable: false });
		return Constructor;
	}
	var RegExpCache = /* @__PURE__ */ function() {
		function RegExpCache$1(size) {
			_classCallCheck(this, RegExpCache$1);
			this.cache = new _LRUCache["default"](size);
		}
		_createClass(RegExpCache$1, [{
			key: "getPatternForRegExp",
			value: function getPatternForRegExp(pattern) {
				var regExp = this.cache.get(pattern);
				if (!regExp) {
					regExp = /* @__PURE__ */ new RegExp("^" + pattern);
					this.cache.put(pattern, regExp);
				}
				return regExp;
			}
		}]);
		return RegExpCache$1;
	}();
	exports["default"] = RegExpCache;
}) });

//#endregion
Object.defineProperty(exports, 'default', {
  enumerable: true,
  get: function () {
    return require_RegExpCache();
  }
});