const require_rolldown_runtime = require('../../../../../../../_virtual/rolldown_runtime.js');
const require_applyInternationalSeparatorStyle$1 = require('./applyInternationalSeparatorStyle.js');

//#region ../../node_modules/.pnpm/libphonenumber-js@1.11.3/node_modules/libphonenumber-js/build/helpers/formatNationalNumberUsingFormat.js
var require_formatNationalNumberUsingFormat = /* @__PURE__ */ require_rolldown_runtime.__commonJS({ "../../node_modules/.pnpm/libphonenumber-js@1.11.3/node_modules/libphonenumber-js/build/helpers/formatNationalNumberUsingFormat.js": ((exports) => {
	Object.defineProperty(exports, "__esModule", { value: true });
	exports["default"] = formatNationalNumberUsingFormat;
	var _applyInternationalSeparatorStyle = _interopRequireDefault(require_applyInternationalSeparatorStyle$1.require_applyInternationalSeparatorStyle());
	function _interopRequireDefault(obj) {
		return obj && obj.__esModule ? obj : { "default": obj };
	}
	var FIRST_GROUP_PATTERN = /(\$\d)/;
	exports.FIRST_GROUP_PATTERN = FIRST_GROUP_PATTERN;
	function formatNationalNumberUsingFormat(number, format, _ref) {
		var useInternationalFormat = _ref.useInternationalFormat, withNationalPrefix = _ref.withNationalPrefix;
		_ref.carrierCode;
		_ref.metadata;
		var formattedNumber = number.replace(new RegExp(format.pattern()), useInternationalFormat ? format.internationalFormat() : withNationalPrefix && format.nationalPrefixFormattingRule() ? format.format().replace(FIRST_GROUP_PATTERN, format.nationalPrefixFormattingRule()) : format.format());
		if (useInternationalFormat) return (0, _applyInternationalSeparatorStyle["default"])(formattedNumber);
		return formattedNumber;
	}
}) });

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