const require_rolldown_runtime = require('../../../../../../../_virtual/rolldown_runtime.js');
const require_constants$1 = require('../constants.js');
const require_metadata$1 = require('../metadata.js');

//#region ../../node_modules/.pnpm/libphonenumber-js@1.11.3/node_modules/libphonenumber-js/build/helpers/stripIddPrefix.js
var require_stripIddPrefix = /* @__PURE__ */ require_rolldown_runtime.__commonJS({ "../../node_modules/.pnpm/libphonenumber-js@1.11.3/node_modules/libphonenumber-js/build/helpers/stripIddPrefix.js": ((exports) => {
	Object.defineProperty(exports, "__esModule", { value: true });
	exports["default"] = stripIddPrefix;
	var _metadata = _interopRequireDefault(require_metadata$1.require_metadata());
	var _constants = require_constants$1.require_constants();
	function _interopRequireDefault(obj) {
		return obj && obj.__esModule ? obj : { "default": obj };
	}
	var CAPTURING_DIGIT_PATTERN = /* @__PURE__ */ new RegExp("([" + _constants.VALID_DIGITS + "])");
	function stripIddPrefix(number, country, callingCode, metadata) {
		if (!country) return;
		var countryMetadata = new _metadata["default"](metadata);
		countryMetadata.selectNumberingPlan(country, callingCode);
		var IDDPrefixPattern = new RegExp(countryMetadata.IDDPrefix());
		if (number.search(IDDPrefixPattern) !== 0) return;
		number = number.slice(number.match(IDDPrefixPattern)[0].length);
		var matchedGroups = number.match(CAPTURING_DIGIT_PATTERN);
		if (matchedGroups && matchedGroups[1] != null && matchedGroups[1].length > 0) {
			if (matchedGroups[1] === "0") return;
		}
		return number;
	}
}) });

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