const require_rolldown_runtime = require('../../../../../../../_virtual/rolldown_runtime.js');
const require_mergeArrays$1 = require('./mergeArrays.js');

//#region ../../node_modules/.pnpm/libphonenumber-js@1.11.3/node_modules/libphonenumber-js/build/helpers/checkNumberLength.js
var require_checkNumberLength = /* @__PURE__ */ require_rolldown_runtime.__commonJS({ "../../node_modules/.pnpm/libphonenumber-js@1.11.3/node_modules/libphonenumber-js/build/helpers/checkNumberLength.js": ((exports) => {
	Object.defineProperty(exports, "__esModule", { value: true });
	exports.checkNumberLengthForType = checkNumberLengthForType;
	exports["default"] = checkNumberLength;
	var _mergeArrays = _interopRequireDefault(require_mergeArrays$1.require_mergeArrays());
	function _interopRequireDefault(obj) {
		return obj && obj.__esModule ? obj : { "default": obj };
	}
	function checkNumberLength(nationalNumber, metadata) {
		return checkNumberLengthForType(nationalNumber, void 0, metadata);
	}
	function checkNumberLengthForType(nationalNumber, type, metadata) {
		var type_info = metadata.type(type);
		var possible_lengths = type_info && type_info.possibleLengths() || metadata.possibleLengths();
		if (!possible_lengths) return "IS_POSSIBLE";
		if (type === "FIXED_LINE_OR_MOBILE") {
			/* istanbul ignore next */
			if (!metadata.type("FIXED_LINE")) return checkNumberLengthForType(nationalNumber, "MOBILE", metadata);
			var mobile_type = metadata.type("MOBILE");
			if (mobile_type) possible_lengths = (0, _mergeArrays["default"])(possible_lengths, mobile_type.possibleLengths());
		} else if (type && !type_info) return "INVALID_LENGTH";
		var actual_length = nationalNumber.length;
		var minimum_length = possible_lengths[0];
		if (minimum_length === actual_length) return "IS_POSSIBLE";
		if (minimum_length > actual_length) return "TOO_SHORT";
		if (possible_lengths[possible_lengths.length - 1] < actual_length) return "TOO_LONG";
		return possible_lengths.indexOf(actual_length, 1) >= 0 ? "IS_POSSIBLE" : "INVALID_LENGTH";
	}
}) });

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