const require_rolldown_runtime = require('../../../../../../_virtual/rolldown_runtime.js');
const require_metadata$1 = require('./metadata.js');
const require_matchesEntirely$1 = require('./helpers/matchesEntirely.js');
const require_getNumberType$1 = require('./helpers/getNumberType.js');

//#region ../../node_modules/.pnpm/libphonenumber-js@1.11.3/node_modules/libphonenumber-js/build/isValid.js
var require_isValid = /* @__PURE__ */ require_rolldown_runtime.__commonJS({ "../../node_modules/.pnpm/libphonenumber-js@1.11.3/node_modules/libphonenumber-js/build/isValid.js": ((exports) => {
	Object.defineProperty(exports, "__esModule", { value: true });
	exports["default"] = isValidNumber;
	var _metadata = _interopRequireDefault(require_metadata$1.require_metadata());
	var _matchesEntirely = _interopRequireDefault(require_matchesEntirely$1.require_matchesEntirely());
	var _getNumberType = _interopRequireDefault(require_getNumberType$1.require_getNumberType());
	function _interopRequireDefault(obj) {
		return obj && obj.__esModule ? obj : { "default": obj };
	}
	/**
	* Checks if a given phone number is valid.
	*
	* isValid(phoneNumberInstance, { ..., v2: true }, metadata)
	*
	* isPossible({ phone: '8005553535', country: 'RU' }, { ... }, metadata)
	* isPossible({ phone: '8005553535', country: 'RU' }, undefined, metadata)
	*
	* If the `number` is a string, it will be parsed to an object,
	* but only if it contains only valid phone number characters (including punctuation).
	* If the `number` is an object, it is used as is.
	*
	* The optional `defaultCountry` argument is the default country.
	* I.e. it does not restrict to just that country,
	* e.g. in those cases where several countries share
	* the same phone numbering rules (NANPA, Britain, etc).
	* For example, even though the number `07624 369230`
	* belongs to the Isle of Man ("IM" country code)
	* calling `isValidNumber('07624369230', 'GB', metadata)`
	* still returns `true` because the country is not restricted to `GB`,
	* it's just that `GB` is the default one for the phone numbering rules.
	* For restricting the country see `isValidNumberForRegion()`
	* though restricting a country might not be a good idea.
	* https://github.com/googlei18n/libphonenumber/blob/master/FAQ.md#when-should-i-use-isvalidnumberforregion
	*
	* Examples:
	*
	* ```js
	* isValidNumber('+78005553535', metadata)
	* isValidNumber('8005553535', 'RU', metadata)
	* isValidNumber('88005553535', 'RU', metadata)
	* isValidNumber({ phone: '8005553535', country: 'RU' }, metadata)
	* ```
	*/
	function isValidNumber(input, options, metadata) {
		options = options || {};
		metadata = new _metadata["default"](metadata);
		metadata.selectNumberingPlan(input.country, input.countryCallingCode);
		if (metadata.hasTypes()) return (0, _getNumberType["default"])(input, options, metadata.metadata) !== void 0;
		var nationalNumber = options.v2 ? input.nationalNumber : input.phone;
		return (0, _matchesEntirely["default"])(nationalNumber, metadata.nationalNumberPattern());
	}
}) });

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