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EA6BO,SAASqC,EAAsBjQ,EAAS6D,GAC7C,IAAI5D,EAAW,IAAIsN,EAAS1J,GAC5B,GAAI5D,EAASoL,WAAWrL,GACtB,OAAOC,EAASI,oBAAoBL,GAASiE,qBAE/C,MAAM,IAAIjF,MAAM,oBAAoBC,OAAOe,GAC7C,CAqBA,SAAS0N,EAAWzN,GAClB,IAAIiQ,EAAUjQ,EAASiQ,QACA,iBAAZA,GACT1C,KAAKM,GAAiB,IAAZoC,EACV1C,KAAKlE,GAAiB,IAAZ4G,EACV1C,KAAKO,GAAiB,IAAZmC,EACV1C,KAAK2C,GAAiB,IAAZD,GAELA,GAEgC,KAA1B,OAAQA,EA3oBd,SA4oBH1C,KAAKlE,IAAK,GACyB,KAA1B,OAAQ4G,EA1oBd,UA2oBH1C,KAAKO,IAAK,EAEVP,KAAK2C,IAAK,EANV3C,KAAKM,IAAK,CAShB,C","sources":["webpack://iadviser/./node_modules/libphonenumber-js/es6/helpers/RFC3966.js","webpack://iadviser/./node_modules/libphonenumber-js/es6/helpers/applyInternationalSeparatorStyle.js","webpack://iadviser/./node_modules/libphonenumber-js/es6/helpers/mergeArrays.js","webpack://iadviser/./node_modules/libphonenumber-js/es6/helpers/checkNumberLength.js","webpack://iadviser/./node_modules/libphonenumber-js/es6/helpers/extension/createExtensionPattern.js","webpack://iadviser/./node_modules/libphonenumber-js/es6/helpers/extension/extractExtension.js","webpack://iadviser/./node_modules/libphonenumber-js/es6/helpers/extractCountryCallingCode.js","webpack://iadviser/./node_modules/libphonenumber-js/es6/helpers/extractCountryCallingCodeFromInternationalNumberWithoutPlusSign.js","webpack://iadviser/./node_modules/libphonenumber-js/es6/helpers/extractPhoneContext.js","webpack://iadviser/./node_modules/libphonenumber-js/es6/helpers/extractFormattedPhoneNumberFromPossibleRfc3966NumberUri.js","webpack://iadviser/./node_modules/libphonenumber-js/es6/helpers/extractNationalNumber.js","webpack://iadviser/./node_modules/libphonenumber-js/es6/helpers/extractNationalNumberFromPossiblyIncompleteNumber.js","webpack://iadviser/./node_modules/libphonenumber-js/es6/helpers/formatNationalNumberUsingFormat.js","webpack://iadviser/./node_modules/libphonenumber-js/es6/helpers/isCountryCode.js","webpack://iadviser/./node_modules/libphonenumber-js/es6/helpers/getCountryAndCallingCodeFromOneOfThem.js","webpack://iadviser/./node_modules/libphonenumber-js/es6/helpers/getCountryByCallingCode.js","webpack://iadviser/./node_modules/libphonenumber-js/es6/helpers/getCountryByNationalNumber.js","webpack://iadviser/./node_modules/libphonenumber-js/es6/helpers/getIddPrefix.js","webpack://iadviser/./node_modules/libphonenumber-js/es6/helpers/getNumberType.js","webpack://iadviser/./node_modules/libphonenumber-js/es6/helpers/getPossibleCountriesForNumber.js","webpack://iadviser/./node_modules/libphonenumber-js/es6/helpers/isObject.js","webpack://iadviser/./node_modules/libphonenumber-js/es6/helpers/isViablePhoneNumber.js","webpack://iadviser/./node_modules/libphonenumber-js/es6/helpers/matchesEntirely.js","webpack://iadviser/./node_modules/libphonenumber-js/es6/helpers/parseDigits.js","webpack://iadviser/./node_modules/libphonenumber-js/es6/helpers/stripIddPrefix.js","webpack://iadviser/./node_modules/libphonenumber-js/es6/isPossible.js","webpack://iadviser/./node_modules/libphonenumber-js/es6/isValid.js","webpack://iadviser/./node_modules/libphonenumber-js/es6/legacy/format.js","webpack://iadviser/./node_modules/libphonenumber-js/es6/legacy/isValidNumber.js","webpack://iadviser/./node_modules/libphonenumber-js/es6/legacy/getNumberType.js","webpack://iadviser/./node_modules/libphonenumber-js/es6/legacy/parse.js","webpack://iadviser/./node_modules/libphonenumber-js/es6/helpers/isCallingCode.js","webpack://iadviser/./node_modules/libphonenumber-js/es6/metadata.js"],"sourcesContent":["function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\nfunction _iterableToArrayLimit(r, l) { var t = null == r ? null : \"undefined\" != typeof Symbol && r[Symbol.iterator] || r[\"@@iterator\"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t[\"return\"] && (u = t[\"return\"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }\nfunction _arrayWithHoles(r) { if (Array.isArray(r)) return r; }\nfunction _createForOfIteratorHelperLoose(r, e) { var t = \"undefined\" != typeof Symbol && r[Symbol.iterator] || r[\"@@iterator\"]; if (t) return (t = t.call(r)).next.bind(t); if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && \"number\" == typeof r.length) { t && (r = t); var o = 0; return function () { return o >= r.length ? { done: !0 } : { done: !1, value: r[o++] }; }; } throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\nfunction _unsupportedIterableToArray(r, a) { if (r) { if (\"string\" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return \"Object\" === t && r.constructor && (t = r.constructor.name), \"Map\" === t || \"Set\" === t ? Array.from(r) : \"Arguments\" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }\nfunction _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }\nimport isViablePhoneNumber from './isViablePhoneNumber.js';\n\n// https://www.ietf.org/rfc/rfc3966.txt\n\n/**\n * @param {string} text - Phone URI (RFC 3966).\n * @return {object} `{ ?number, ?ext }`.\n */\nexport function parseRFC3966(text) {\n var number;\n var ext;\n\n // Replace \"tel:\" with \"tel=\" for parsing convenience.\n text = text.replace(/^tel:/, 'tel=');\n for (var _iterator = _createForOfIteratorHelperLoose(text.split(';')), _step; !(_step = _iterator()).done;) {\n var part = _step.value;\n var _part$split = part.split('='),\n _part$split2 = _slicedToArray(_part$split, 2),\n name = _part$split2[0],\n value = _part$split2[1];\n switch (name) {\n case 'tel':\n number = value;\n break;\n case 'ext':\n ext = value;\n break;\n case 'phone-context':\n // Only \"country contexts\" are supported.\n // \"Domain contexts\" are ignored.\n if (value[0] === '+') {\n number = value + number;\n }\n break;\n }\n }\n\n // If the phone number is not viable, then abort.\n if (!isViablePhoneNumber(number)) {\n return {};\n }\n var result = {\n number: number\n };\n if (ext) {\n result.ext = ext;\n }\n return result;\n}\n\n/**\n * @param {object} - `{ ?number, ?extension }`.\n * @return {string} Phone URI (RFC 3966).\n */\nexport function formatRFC3966(_ref) {\n var number = _ref.number,\n ext = _ref.ext;\n if (!number) {\n return '';\n }\n if (number[0] !== '+') {\n throw new Error(\"\\\"formatRFC3966()\\\" expects \\\"number\\\" to be in E.164 format.\");\n }\n return \"tel:\".concat(number).concat(ext ? ';ext=' + ext : '');\n}\n//# sourceMappingURL=RFC3966.js.map","import { VALID_PUNCTUATION } from '../constants.js';\n\n// Removes brackets and replaces dashes with spaces.\n//\n// E.g. \"(999) 111-22-33\" -> \"999 111 22 33\"\n//\n// For some reason Google's metadata contains ``s with brackets and dashes.\n// Meanwhile, there's no single opinion about using punctuation in international phone numbers.\n//\n// For example, Google's `` for USA is `+1 213-373-4253`.\n// And here's a quote from WikiPedia's \"North American Numbering Plan\" page:\n// https://en.wikipedia.org/wiki/North_American_Numbering_Plan\n//\n// \"The country calling code for all countries participating in the NANP is 1.\n// In international format, an NANP number should be listed as +1 301 555 01 00,\n// where 301 is an area code (Maryland).\"\n//\n// I personally prefer the international format without any punctuation.\n// For example, brackets are remnants of the old age, meaning that the\n// phone number part in brackets (so called \"area code\") can be omitted\n// if dialing within the same \"area\".\n// And hyphens were clearly introduced for splitting local numbers into memorizable groups.\n// For example, remembering \"5553535\" is difficult but \"555-35-35\" is much simpler.\n// Imagine a man taking a bus from home to work and seeing an ad with a phone number.\n// He has a couple of seconds to memorize that number until it passes by.\n// If it were spaces instead of hyphens the man wouldn't necessarily get it,\n// but with hyphens instead of spaces the grouping is more explicit.\n// I personally think that hyphens introduce visual clutter,\n// so I prefer replacing them with spaces in international numbers.\n// In the modern age all output is done on displays where spaces are clearly distinguishable\n// so hyphens can be safely replaced with spaces without losing any legibility.\n//\nexport default function applyInternationalSeparatorStyle(formattedNumber) {\n return formattedNumber.replace(new RegExp(\"[\".concat(VALID_PUNCTUATION, \"]+\"), 'g'), ' ').trim();\n}\n//# sourceMappingURL=applyInternationalSeparatorStyle.js.map","function _createForOfIteratorHelperLoose(r, e) { var t = \"undefined\" != typeof Symbol && r[Symbol.iterator] || r[\"@@iterator\"]; if (t) return (t = t.call(r)).next.bind(t); if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && \"number\" == typeof r.length) { t && (r = t); var o = 0; return function () { return o >= r.length ? { done: !0 } : { done: !1, value: r[o++] }; }; } throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\nfunction _unsupportedIterableToArray(r, a) { if (r) { if (\"string\" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return \"Object\" === t && r.constructor && (t = r.constructor.name), \"Map\" === t || \"Set\" === t ? Array.from(r) : \"Arguments\" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }\nfunction _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }\n/**\n * Merges two arrays.\n * @param {*} a\n * @param {*} b\n * @return {*}\n */\nexport default function mergeArrays(a, b) {\n var merged = a.slice();\n for (var _iterator = _createForOfIteratorHelperLoose(b), _step; !(_step = _iterator()).done;) {\n var element = _step.value;\n if (a.indexOf(element) < 0) {\n merged.push(element);\n }\n }\n return merged.sort(function (a, b) {\n return a - b;\n });\n\n // ES6 version, requires Set polyfill.\n // let merged = new Set(a)\n // for (const element of b) {\n // \tmerged.add(i)\n // }\n // return Array.from(merged).sort((a, b) => a - b)\n}\n//# sourceMappingURL=mergeArrays.js.map","import Metadata from '../metadata.js';\nimport mergeArrays from './mergeArrays.js';\n\n/**\n * Checks phone number length against the phone numbering plan selected in metadata.\n * Optionally, it could be restrained by a specific country.\n * @param {string} nationalNumber\n * @param {string?} country — Specific country to use rather than the one that is pre-selected in the metadata instance.\n * @param {Metadata} metadata — Metadata instance with a selected numbering plan.\n * @returns {string}\n */\nexport default function checkNumberLength(nationalNumber, country, metadata) {\n return checkNumberLengthForType(nationalNumber, undefined, country, metadata);\n}\n\n/**\n * Checks phone number length against the phone numbering plan selected in metadata.\n * Optionally, it could be restrained by a specific phone number type or a specific country.\n * @param {string} nationalNumber\n * @param {string?} type — Specific phone number type.\n * @param {string?} country — Specific country to use instead of the one that is pre-selected in the metadata instance.\n * @param {Metadata} metadata — Metadata instance with a selected numbering plan.\n * @returns {string} See the README on `validatePhoneNumberLength()` function, with an addition of a special case: when phone numbers of type `type` aren't possible in the telephone numbering plan, it will return \"INVALID_LENGTH\".\n */\n// Checks whether a number is possible for a certain `country` based on the number length.\n//\n// This function is not supported by metadata generated with ancient versions of\n// `libphonenumber-js` (before version `1.0.18`) which didn't include \"possible lengths\".\n//\n// There was also a known issue with `checkNumberLength()` function:\n// if a number is possible only in a certain `country` among several `countries`\n// that share the same \"country calling code\", that function would check\n// the possibility of the phone number only in the \"main\" `country` for the \"country calling code\"\n// and would not check if it's actually be possible in the speciifc `country`.\n//\n// For example, \"+1310xxxx\" numbers are valid in Canada.\n// However, they are not possible in the US due to being too short.\n// Since Canada and the US share the same country calling code — \"+1\" —\n// `checkNumberLength()` function used to return not \"IS_POSSIBLE\" for \"+1310xxxx\" numbers.\n//\n// In such cases, when using \"/max\" metadata, `isValid()` could output `true`\n// but at the same time `isPossible()` could output `false`, which was contradictory.\n//\n// See https://issuetracker.google.com/issues/335892662 for the discusson in Google's issues.\n//\n// The solution suggested by Google was implemented: an optional `country` argument\n// was added to `checkNumberLength()` function. If present, that `country` will be used\n// to check phone number length for that specific `country` rather than the \"main\" country\n// for the shared \"country calling code\".\n//\nexport function checkNumberLengthForType(nationalNumber, type, country, metadata) {\n if (country) {\n // If a specific `country` is specified, re-create a metadata instance with it.\n metadata = new Metadata(metadata.metadata);\n metadata.selectNumberingPlan(country);\n }\n var type_info = metadata.type(type);\n\n // There should always be \"\" set for every type element.\n // This is declared in the XML schema.\n // For size efficiency, where a sub-description (e.g. fixed-line)\n // has the same \"\" as the \"general description\", this is missing,\n // so we fall back to the \"general description\". Where no numbers of the type\n // exist at all, there is one possible length (-1) which is guaranteed\n // not to match the length of any real phone number.\n var possible_lengths = type_info && type_info.possibleLengths() || metadata.possibleLengths();\n // let local_lengths = type_info && type.possibleLengthsLocal() || metadata.possibleLengthsLocal()\n\n // Metadata before version `1.0.18` didn't contain `possible_lengths`.\n if (!possible_lengths) {\n return 'IS_POSSIBLE';\n }\n if (type === 'FIXED_LINE_OR_MOBILE') {\n // No such country in metadata.\n /* istanbul ignore next */\n if (!metadata.type('FIXED_LINE')) {\n // The rare case has been encountered where no fixedLine data is available\n // (true for some non-geographic entities), so we just check mobile.\n return checkNumberLengthForType(nationalNumber, 'MOBILE', country, metadata);\n }\n var mobile_type = metadata.type('MOBILE');\n if (mobile_type) {\n // Merge the mobile data in if there was any. \"Concat\" creates a new\n // array, it doesn't edit possible_lengths in place, so we don't need a copy.\n // Note that when adding the possible lengths from mobile, we have\n // to again check they aren't empty since if they are this indicates\n // they are the same as the general desc and should be obtained from there.\n possible_lengths = mergeArrays(possible_lengths, mobile_type.possibleLengths());\n // The current list is sorted; we need to merge in the new list and\n // re-sort (duplicates are okay). Sorting isn't so expensive because\n // the lists are very small.\n\n // if (local_lengths) {\n // \tlocal_lengths = mergeArrays(local_lengths, mobile_type.possibleLengthsLocal())\n // } else {\n // \tlocal_lengths = mobile_type.possibleLengthsLocal()\n // }\n }\n }\n // If the type doesn't exist then return 'INVALID_LENGTH'.\n else if (type && !type_info) {\n return 'INVALID_LENGTH';\n }\n var actual_length = nationalNumber.length;\n\n // In `libphonenumber-js` all \"local-only\" formats are dropped for simplicity.\n // // This is safe because there is never an overlap beween the possible lengths\n // // and the local-only lengths; this is checked at build time.\n // if (local_lengths && local_lengths.indexOf(nationalNumber.length) >= 0)\n // {\n // \treturn 'IS_POSSIBLE_LOCAL_ONLY'\n // }\n\n var minimum_length = possible_lengths[0];\n if (minimum_length === actual_length) {\n return 'IS_POSSIBLE';\n }\n if (minimum_length > actual_length) {\n return 'TOO_SHORT';\n }\n if (possible_lengths[possible_lengths.length - 1] < actual_length) {\n return 'TOO_LONG';\n }\n\n // We skip the first element since we've already checked it.\n return possible_lengths.indexOf(actual_length, 1) >= 0 ? 'IS_POSSIBLE' : 'INVALID_LENGTH';\n}\n//# sourceMappingURL=checkNumberLength.js.map","import { VALID_DIGITS } from '../../constants.js';\n\n// The RFC 3966 format for extensions.\nvar RFC3966_EXTN_PREFIX = ';ext=';\n\n/**\n * Helper method for constructing regular expressions for parsing. Creates\n * an expression that captures up to max_length digits.\n * @return {string} RegEx pattern to capture extension digits.\n */\nvar getExtensionDigitsPattern = function getExtensionDigitsPattern(maxLength) {\n return \"([\".concat(VALID_DIGITS, \"]{1,\").concat(maxLength, \"})\");\n};\n\n/**\n * Helper initialiser method to create the regular-expression pattern to match\n * extensions.\n * Copy-pasted from Google's `libphonenumber`:\n * https://github.com/google/libphonenumber/blob/55b2646ec9393f4d3d6661b9c82ef9e258e8b829/javascript/i18n/phonenumbers/phonenumberutil.js#L759-L766\n * @return {string} RegEx pattern to capture extensions.\n */\nexport default function createExtensionPattern(purpose) {\n // We cap the maximum length of an extension based on the ambiguity of the way\n // the extension is prefixed. As per ITU, the officially allowed length for\n // extensions is actually 40, but we don't support this since we haven't seen real\n // examples and this introduces many false interpretations as the extension labels\n // are not standardized.\n /** @type {string} */\n var extLimitAfterExplicitLabel = '20';\n /** @type {string} */\n var extLimitAfterLikelyLabel = '15';\n /** @type {string} */\n var extLimitAfterAmbiguousChar = '9';\n /** @type {string} */\n var extLimitWhenNotSure = '6';\n\n /** @type {string} */\n var possibleSeparatorsBetweenNumberAndExtLabel = \"[ \\xA0\\\\t,]*\";\n // Optional full stop (.) or colon, followed by zero or more spaces/tabs/commas.\n /** @type {string} */\n var possibleCharsAfterExtLabel = \"[:\\\\.\\uFF0E]?[ \\xA0\\\\t,-]*\";\n /** @type {string} */\n var optionalExtnSuffix = \"#?\";\n\n // Here the extension is called out in more explicit way, i.e mentioning it obvious\n // patterns like \"ext.\".\n /** @type {string} */\n var explicitExtLabels = \"(?:e?xt(?:ensi(?:o\\u0301?|\\xF3))?n?|\\uFF45?\\uFF58\\uFF54\\uFF4E?|\\u0434\\u043E\\u0431|anexo)\";\n // One-character symbols that can be used to indicate an extension, and less\n // commonly used or more ambiguous extension labels.\n /** @type {string} */\n var ambiguousExtLabels = \"(?:[x\\uFF58#\\uFF03~\\uFF5E]|int|\\uFF49\\uFF4E\\uFF54)\";\n // When extension is not separated clearly.\n /** @type {string} */\n var ambiguousSeparator = \"[- ]+\";\n // This is the same as possibleSeparatorsBetweenNumberAndExtLabel, but not matching\n // comma as extension label may have it.\n /** @type {string} */\n var possibleSeparatorsNumberExtLabelNoComma = \"[ \\xA0\\\\t]*\";\n // \",,\" is commonly used for auto dialling the extension when connected. First\n // comma is matched through possibleSeparatorsBetweenNumberAndExtLabel, so we do\n // not repeat it here. Semi-colon works in Iphone and Android also to pop up a\n // button with the extension number following.\n /** @type {string} */\n var autoDiallingAndExtLabelsFound = \"(?:,{2}|;)\";\n\n /** @type {string} */\n var rfcExtn = RFC3966_EXTN_PREFIX + getExtensionDigitsPattern(extLimitAfterExplicitLabel);\n /** @type {string} */\n var explicitExtn = possibleSeparatorsBetweenNumberAndExtLabel + explicitExtLabels + possibleCharsAfterExtLabel + getExtensionDigitsPattern(extLimitAfterExplicitLabel) + optionalExtnSuffix;\n /** @type {string} */\n var ambiguousExtn = possibleSeparatorsBetweenNumberAndExtLabel + ambiguousExtLabels + possibleCharsAfterExtLabel + getExtensionDigitsPattern(extLimitAfterAmbiguousChar) + optionalExtnSuffix;\n /** @type {string} */\n var americanStyleExtnWithSuffix = ambiguousSeparator + getExtensionDigitsPattern(extLimitWhenNotSure) + \"#\";\n\n /** @type {string} */\n var autoDiallingExtn = possibleSeparatorsNumberExtLabelNoComma + autoDiallingAndExtLabelsFound + possibleCharsAfterExtLabel + getExtensionDigitsPattern(extLimitAfterLikelyLabel) + optionalExtnSuffix;\n /** @type {string} */\n var onlyCommasExtn = possibleSeparatorsNumberExtLabelNoComma + \"(?:,)+\" + possibleCharsAfterExtLabel + getExtensionDigitsPattern(extLimitAfterAmbiguousChar) + optionalExtnSuffix;\n\n // The first regular expression covers RFC 3966 format, where the extension is added\n // using \";ext=\". The second more generic where extension is mentioned with explicit\n // labels like \"ext:\". In both the above cases we allow more numbers in extension than\n // any other extension labels. The third one captures when single character extension\n // labels or less commonly used labels are used. In such cases we capture fewer\n // extension digits in order to reduce the chance of falsely interpreting two\n // numbers beside each other as a number + extension. The fourth one covers the\n // special case of American numbers where the extension is written with a hash\n // at the end, such as \"- 503#\". The fifth one is exclusively for extension\n // autodialling formats which are used when dialling and in this case we accept longer\n // extensions. The last one is more liberal on the number of commas that acts as\n // extension labels, so we have a strict cap on the number of digits in such extensions.\n return rfcExtn + \"|\" + explicitExtn + \"|\" + ambiguousExtn + \"|\" + americanStyleExtnWithSuffix + \"|\" + autoDiallingExtn + \"|\" + onlyCommasExtn;\n}\n//# sourceMappingURL=createExtensionPattern.js.map","import createExtensionPattern from './createExtensionPattern.js';\n\n// Regexp of all known extension prefixes used by different regions followed by\n// 1 or more valid digits, for use when parsing.\nvar EXTN_PATTERN = new RegExp('(?:' + createExtensionPattern() + ')$', 'i');\n\n// Strips any extension (as in, the part of the number dialled after the call is\n// connected, usually indicated with extn, ext, x or similar) from the end of\n// the number, and returns it.\nexport default function extractExtension(number) {\n var start = number.search(EXTN_PATTERN);\n if (start < 0) {\n return {};\n }\n // If we find a potential extension, and the number preceding this is a viable\n // number, we assume it is an extension.\n var numberWithoutExtension = number.slice(0, start);\n var matches = number.match(EXTN_PATTERN);\n var i = 1;\n while (i < matches.length) {\n if (matches[i]) {\n return {\n number: numberWithoutExtension,\n ext: matches[i]\n };\n }\n i++;\n }\n}\n//# sourceMappingURL=extractExtension.js.map","import stripIddPrefix from './stripIddPrefix.js';\nimport extractCountryCallingCodeFromInternationalNumberWithoutPlusSign from './extractCountryCallingCodeFromInternationalNumberWithoutPlusSign.js';\nimport Metadata from '../metadata.js';\nimport { MAX_LENGTH_COUNTRY_CODE } from '../constants.js';\n\n/**\n * Attempts to extract a calling code from a phone number.\n * * If the phone number is found to be \"international\":\n * * It will attempt to identify the calling code part of it and whether that part is complete and valid.\n * * If the calling code part is complete and valid, it will return two properties:\n * that calling code part (without `+`) and the rest of the digits.\n * * Otherwise, i.e. if the calling code part is incomplete or invalid,\n * it will return an empty object.\n * * Otherwise, i.e. if the phone number is national, there's no callind code to extract\n * so it will just return the originally-passed `number` string as the only property.\n * @param {string} number — Phone number digits (possibly with a `+`).\n * @param {string} [country] — Country.\n * @param {string} [defaultCountry] — Default country.\n * @param {string} [defaultCallingCode] — Default calling code (some phone numbering plans are non-geographic).\n * @param {object} metadataJson\n * @return {object} `{ countryCallingCodeSource: string?, countryCallingCode: string?, number: string }`, where `countryCallingCodeSource` tells how the returned calling code was extracted (if it was extracted), `countryCallingCode` is the calling code that was extracted from the input `number` string, and `number` is the originally passed `number` without the extracted calling code (and without a `+`). If the calling code is present but incomplete or invalid, it will return an empty object.\n * @example\n * // Returns `{ countryCallingCode: \"1\", number: \"2133734253\" }`.\n * extractCountryCallingCode('2133734253', 'US', null, null, metadata)\n * extractCountryCallingCode('2133734253', null, 'US', null, metadata)\n * extractCountryCallingCode('2133734253', null, null, '1', metadata)\n * extractCountryCallingCode('+12133734253', null, null, null, metadata)\n * extractCountryCallingCode('+12133734253', null, 'RU', null, metadata)\n */\nexport default function extractCountryCallingCode(number, country, defaultCountry, defaultCallingCode, metadataJson) {\n if (!number) {\n return {};\n }\n var isNumberWithIddPrefix;\n\n // If this is not an international phone number,\n // then either extract an \"IDD\" prefix, or extract a\n // country calling code from a number by autocorrecting it\n // by prepending a leading `+` in cases when it starts\n // with the country calling code.\n // https://wikitravel.org/en/International_dialling_prefix\n // https://github.com/catamphetamine/libphonenumber-js/issues/376\n if (number[0] !== '+') {\n // Convert an \"out-of-country\" dialing phone number\n // to a proper international phone number.\n var numberWithoutIDD = stripIddPrefix(number, country || defaultCountry, defaultCallingCode, metadataJson);\n // If an IDD prefix was stripped then\n // convert the number to international one\n // for subsequent parsing.\n if (numberWithoutIDD && numberWithoutIDD !== number) {\n isNumberWithIddPrefix = true;\n number = '+' + numberWithoutIDD;\n } else {\n // Check to see if the number starts with the country calling code\n // for the default country. If so, we remove the country calling code,\n // and do some checks on the validity of the number before and after.\n // https://github.com/catamphetamine/libphonenumber-js/issues/376\n if (country || defaultCountry || defaultCallingCode) {\n var _extractCountryCallin = extractCountryCallingCodeFromInternationalNumberWithoutPlusSign(number, country, defaultCountry, defaultCallingCode, metadataJson),\n countryCallingCode = _extractCountryCallin.countryCallingCode,\n shorterNumber = _extractCountryCallin.number;\n if (countryCallingCode) {\n return {\n countryCallingCodeSource: 'FROM_NUMBER_WITHOUT_PLUS_SIGN',\n countryCallingCode: countryCallingCode,\n number: shorterNumber\n };\n }\n }\n return {\n // No need to set it to `UNSPECIFIED`. It can be just `undefined`.\n // countryCallingCodeSource: 'UNSPECIFIED',\n number: number\n };\n }\n }\n\n // `number` can only be international at this point.\n\n // Fast abortion: country codes do not begin with a '0'\n if (number[1] === '0') {\n return {};\n }\n var metadata = new Metadata(metadataJson);\n\n // The thing with country phone codes\n // is that they are orthogonal to each other\n // i.e. there's no such country phone code A\n // for which country phone code B exists\n // where B starts with A.\n // Therefore, while scanning digits,\n // if a valid country code is found,\n // that means that it is the country code.\n //\n var i = 2;\n while (i - 1 <= MAX_LENGTH_COUNTRY_CODE && i <= number.length) {\n var _countryCallingCode = number.slice(1, i);\n if (metadata.hasCallingCode(_countryCallingCode)) {\n metadata.selectNumberingPlan(_countryCallingCode);\n return {\n countryCallingCodeSource: isNumberWithIddPrefix ? 'FROM_NUMBER_WITH_IDD' : 'FROM_NUMBER_WITH_PLUS_SIGN',\n countryCallingCode: _countryCallingCode,\n number: number.slice(i)\n };\n }\n i++;\n }\n return {};\n}\n\n// The possible values for the returned `countryCallingCodeSource` are:\n//\n// Copy-pasted from:\n// https://github.com/google/libphonenumber/blob/master/resources/phonenumber.proto\n//\n// // The source from which the country_code is derived. This is not set in the\n// // general parsing method, but in the method that parses and keeps raw_input.\n// // New fields could be added upon request.\n// enum CountryCodeSource {\n// // Default value returned if this is not set, because the phone number was\n// // created using parse, not parseAndKeepRawInput. hasCountryCodeSource will\n// // return false if this is the case.\n// UNSPECIFIED = 0;\n//\n// // The country_code is derived based on a phone number with a leading \"+\",\n// // e.g. the French number \"+33 1 42 68 53 00\".\n// FROM_NUMBER_WITH_PLUS_SIGN = 1;\n//\n// // The country_code is derived based on a phone number with a leading IDD,\n// // e.g. the French number \"011 33 1 42 68 53 00\", as it is dialled from US.\n// FROM_NUMBER_WITH_IDD = 5;\n//\n// // The country_code is derived based on a phone number without a leading\n// // \"+\", e.g. the French number \"33 1 42 68 53 00\" when defaultCountry is\n// // supplied as France.\n// FROM_NUMBER_WITHOUT_PLUS_SIGN = 10;\n//\n// // The country_code is derived NOT based on the phone number itself, but\n// // from the defaultCountry parameter provided in the parsing function by the\n// // clients. This happens mostly for numbers written in the national format\n// // (without country code). For example, this would be set when parsing the\n// // French number \"01 42 68 53 00\", when defaultCountry is supplied as\n// // France.\n// FROM_DEFAULT_COUNTRY = 20;\n// }\n//# sourceMappingURL=extractCountryCallingCode.js.map","import Metadata from '../metadata.js';\nimport matchesEntirely from './matchesEntirely.js';\nimport extractNationalNumber from './extractNationalNumber.js';\nimport checkNumberLength from './checkNumberLength.js';\nimport getCountryCallingCode from '../getCountryCallingCode.js';\n\n/**\n * Sometimes some people incorrectly input international phone numbers\n * without the leading `+`. This function corrects such input.\n * @param {string} number — Phone number digits (only digits, no `+`).\n * @param {string} [country] — Exact country of the phone number.\n * @param {string} [defaultCountry]\n * @param {string} [defaultCallingCode]\n * @param {object} metadataJson\n * @return {object} `{ countryCallingCode: string?, number: string }`, where `countryCallingCode` is the calling code that was extracted from the input `number` string, and `number` is the originally passed `number` without the extracted calling code.\n */\nexport default function extractCountryCallingCodeFromInternationalNumberWithoutPlusSign(number, country, defaultCountry, defaultCallingCode, metadataJson) {\n // Validate arguments.\n // The `number` is known to be in a non-international form\n // because there's no leading \"+\" character.\n // Therefore, there must be either `country` or `defaultCountry` or `defaultCallingCode`.\n // Otherwise, there'd be no source for the calling code to search for in the `number`.\n if (!(country || defaultCountry || defaultCallingCode)) {\n // There's no source for the calling code to search for in the `number`.\n return {\n number: number\n };\n }\n var countryCallingCode = country || defaultCountry ? getCountryCallingCode(country || defaultCountry, metadataJson) : defaultCallingCode;\n if (number.indexOf(countryCallingCode) === 0) {\n var metadata = new Metadata(metadataJson);\n metadata.selectNumberingPlan(country || defaultCountry || defaultCallingCode);\n var possibleShorterNumber = number.slice(countryCallingCode.length);\n var _extractNationalNumbe = extractNationalNumber(possibleShorterNumber, undefined, metadata),\n possibleShorterNationalNumber = _extractNationalNumbe.nationalNumber;\n var _extractNationalNumbe2 = extractNationalNumber(number, undefined, metadata),\n nationalNumber = _extractNationalNumbe2.nationalNumber;\n\n // If the number was not valid before but is valid now,\n // or if it was too long before, we consider the number\n // with the country calling code stripped to be a better result\n // and keep that instead.\n // For example, in Germany (+49), `49` is a valid area code,\n // so if a number starts with `49`, it could be both a valid\n // national German number or an international number without\n // a leading `+`.\n if (!matchesEntirely(nationalNumber, metadata.nationalNumberPattern()) && matchesEntirely(possibleShorterNationalNumber, metadata.nationalNumberPattern()) || checkNumberLength(nationalNumber, undefined, metadata) === 'TOO_LONG') {\n return {\n countryCallingCode: countryCallingCode,\n number: possibleShorterNumber\n };\n }\n }\n return {\n number: number\n };\n}\n//# sourceMappingURL=extractCountryCallingCodeFromInternationalNumberWithoutPlusSign.js.map","// When phone numbers are written in `RFC3966` format — `\"tel:+12133734253\"` —\n// they can have their \"calling code\" part written separately in a `phone-context` parameter.\n// Example: `\"tel:12133734253;phone-context=+1\"`.\n// This function parses the full phone number from the local number and the `phone-context`\n// when the `phone-context` contains a `+` sign.\n\nimport { VALID_DIGITS\n// PLUS_CHARS\n} from '../constants.js';\nexport var PLUS_SIGN = '+';\nvar RFC3966_VISUAL_SEPARATOR_ = '[\\\\-\\\\.\\\\(\\\\)]?';\nvar RFC3966_PHONE_DIGIT_ = '(' + '[' + VALID_DIGITS + ']' + '|' + RFC3966_VISUAL_SEPARATOR_ + ')';\nvar RFC3966_GLOBAL_NUMBER_DIGITS_ = '^' + '\\\\' + PLUS_SIGN + RFC3966_PHONE_DIGIT_ + '*' + '[' + VALID_DIGITS + ']' + RFC3966_PHONE_DIGIT_ + '*' + '$';\n\n/**\n * Regular expression of valid global-number-digits for the phone-context\n * parameter, following the syntax defined in RFC3966.\n */\nvar RFC3966_GLOBAL_NUMBER_DIGITS_PATTERN_ = new RegExp(RFC3966_GLOBAL_NUMBER_DIGITS_, 'g');\n\n// In this port of Google's library, we don't accept alpha characters in phone numbers.\n// const ALPHANUM_ = VALID_ALPHA_ + VALID_DIGITS\nvar ALPHANUM_ = VALID_DIGITS;\nvar RFC3966_DOMAINLABEL_ = '[' + ALPHANUM_ + ']+((\\\\-)*[' + ALPHANUM_ + '])*';\nvar VALID_ALPHA_ = 'a-zA-Z';\nvar RFC3966_TOPLABEL_ = '[' + VALID_ALPHA_ + ']+((\\\\-)*[' + ALPHANUM_ + '])*';\nvar RFC3966_DOMAINNAME_ = '^(' + RFC3966_DOMAINLABEL_ + '\\\\.)*' + RFC3966_TOPLABEL_ + '\\\\.?$';\n\n/**\n * Regular expression of valid domainname for the phone-context parameter,\n * following the syntax defined in RFC3966.\n */\nvar RFC3966_DOMAINNAME_PATTERN_ = new RegExp(RFC3966_DOMAINNAME_, 'g');\nexport var RFC3966_PREFIX_ = 'tel:';\nexport var RFC3966_PHONE_CONTEXT_ = ';phone-context=';\nexport var RFC3966_ISDN_SUBADDRESS_ = ';isub=';\n\n/**\n * Extracts the value of the phone-context parameter of `numberToExtractFrom`,\n * following the syntax defined in RFC3966.\n *\n * @param {string} numberToExtractFrom\n * @return {string|null} the extracted string (possibly empty), or `null` if no phone-context parameter is found.\n */\nexport default function extractPhoneContext(numberToExtractFrom) {\n var indexOfPhoneContext = numberToExtractFrom.indexOf(RFC3966_PHONE_CONTEXT_);\n // If no phone-context parameter is present\n if (indexOfPhoneContext < 0) {\n return null;\n }\n var phoneContextStart = indexOfPhoneContext + RFC3966_PHONE_CONTEXT_.length;\n // If phone-context parameter is empty\n if (phoneContextStart >= numberToExtractFrom.length) {\n return '';\n }\n var phoneContextEnd = numberToExtractFrom.indexOf(';', phoneContextStart);\n // If phone-context is not the last parameter\n if (phoneContextEnd >= 0) {\n return numberToExtractFrom.substring(phoneContextStart, phoneContextEnd);\n } else {\n return numberToExtractFrom.substring(phoneContextStart);\n }\n}\n\n/**\n * Returns whether the value of phoneContext follows the syntax defined in RFC3966.\n *\n * @param {string|null} phoneContext\n * @return {boolean}\n */\nexport function isPhoneContextValid(phoneContext) {\n if (phoneContext === null) {\n return true;\n }\n if (phoneContext.length === 0) {\n return false;\n }\n\n // Does phone-context value match pattern of global-number-digits or domainname.\n return RFC3966_GLOBAL_NUMBER_DIGITS_PATTERN_.test(phoneContext) || RFC3966_DOMAINNAME_PATTERN_.test(phoneContext);\n}\n//# sourceMappingURL=extractPhoneContext.js.map","import extractPhoneContext, { isPhoneContextValid, PLUS_SIGN, RFC3966_PREFIX_, RFC3966_PHONE_CONTEXT_, RFC3966_ISDN_SUBADDRESS_ } from './extractPhoneContext.js';\nimport ParseError from '../ParseError.js';\n\n/**\n * @param {string} numberToParse\n * @param {string} nationalNumber\n * @return {}\n */\nexport default function extractFormattedPhoneNumberFromPossibleRfc3966NumberUri(numberToParse, _ref) {\n var extractFormattedPhoneNumber = _ref.extractFormattedPhoneNumber;\n var phoneContext = extractPhoneContext(numberToParse);\n if (!isPhoneContextValid(phoneContext)) {\n throw new ParseError('NOT_A_NUMBER');\n }\n var phoneNumberString;\n if (phoneContext === null) {\n // Extract a possible number from the string passed in.\n // (this strips leading characters that could not be the start of a phone number)\n phoneNumberString = extractFormattedPhoneNumber(numberToParse) || '';\n } else {\n phoneNumberString = '';\n\n // If the phone context contains a phone number prefix, we need to capture\n // it, whereas domains will be ignored.\n if (phoneContext.charAt(0) === PLUS_SIGN) {\n phoneNumberString += phoneContext;\n }\n\n // Now append everything between the \"tel:\" prefix and the phone-context.\n // This should include the national number, an optional extension or\n // isdn-subaddress component. Note we also handle the case when \"tel:\" is\n // missing, as we have seen in some of the phone number inputs.\n // In that case, we append everything from the beginning.\n var indexOfRfc3966Prefix = numberToParse.indexOf(RFC3966_PREFIX_);\n var indexOfNationalNumber;\n // RFC 3966 \"tel:\" prefix is preset at this stage because\n // `isPhoneContextValid()` requires it to be present.\n /* istanbul ignore else */\n if (indexOfRfc3966Prefix >= 0) {\n indexOfNationalNumber = indexOfRfc3966Prefix + RFC3966_PREFIX_.length;\n } else {\n indexOfNationalNumber = 0;\n }\n var indexOfPhoneContext = numberToParse.indexOf(RFC3966_PHONE_CONTEXT_);\n phoneNumberString += numberToParse.substring(indexOfNationalNumber, indexOfPhoneContext);\n }\n\n // Delete the isdn-subaddress and everything after it if it is present.\n // Note extension won't appear at the same time with isdn-subaddress\n // according to paragraph 5.3 of the RFC3966 spec.\n var indexOfIsdn = phoneNumberString.indexOf(RFC3966_ISDN_SUBADDRESS_);\n if (indexOfIsdn > 0) {\n phoneNumberString = phoneNumberString.substring(0, indexOfIsdn);\n }\n // If both phone context and isdn-subaddress are absent but other\n // parameters are present, the parameters are left in nationalNumber.\n // This is because we are concerned about deleting content from a potential\n // number string when there is no strong evidence that the number is\n // actually written in RFC3966.\n\n if (phoneNumberString !== '') {\n return phoneNumberString;\n }\n}\n//# sourceMappingURL=extractFormattedPhoneNumberFromPossibleRfc3966NumberUri.js.map","import extractNationalNumberFromPossiblyIncompleteNumber from './extractNationalNumberFromPossiblyIncompleteNumber.js';\nimport matchesEntirely from './matchesEntirely.js';\nimport checkNumberLength from './checkNumberLength.js';\nimport getCountryByCallingCode from './getCountryByCallingCode.js';\n\n/**\n * Strips national prefix and carrier code from a complete phone number.\n * The difference from the non-\"FromCompleteNumber\" function is that\n * it won't extract national prefix if the resultant number is too short\n * to be a complete number for the selected phone numbering plan.\n * @param {string} number — Complete phone number digits.\n * @param {string?} country — Specific country to use instead of the one that is pre-selected in the metadata instance.\n * @param {Metadata} metadata — Metadata instance with a selected numbering plan.\n * @return {object} `{ nationalNumber: string, carrierCode: string? }`.\n */\nexport default function extractNationalNumber(number, country, metadata) {\n // Parsing national prefixes and carrier codes\n // is only required for local phone numbers\n // but some people don't understand that\n // and sometimes write international phone numbers\n // with national prefixes (or maybe even carrier codes).\n // http://ucken.blogspot.ru/2016/03/trunk-prefixes-in-skype4b.html\n // Google's original library forgives such mistakes\n // and so does this library, because it has been requested:\n // https://github.com/catamphetamine/libphonenumber-js/issues/127\n var _extractNationalNumbe = extractNationalNumberFromPossiblyIncompleteNumber(number, metadata),\n carrierCode = _extractNationalNumbe.carrierCode,\n nationalNumber = _extractNationalNumbe.nationalNumber;\n if (nationalNumber !== number) {\n if (!shouldHaveExtractedNationalPrefix(number, nationalNumber, metadata)) {\n // Don't strip the national prefix.\n return {\n nationalNumber: number\n };\n }\n // Check the national (significant) number length after extracting national prefix and carrier code.\n // Legacy generated metadata (before `1.0.18`) didn't support the \"possible lengths\" feature,\n // so this `if` will only be executed with newer metadata.\n if (metadata.numberingPlan.possibleLengths()) {\n // If an exact `country` is not specified, attempt to detect it from the assumed national number.\n if (!country) {\n country = getCountryByCallingCode(metadata.numberingPlan.callingCode(), {\n nationalNumber: nationalNumber,\n metadata: metadata\n });\n }\n\n // The number remaining after stripping the national prefix and carrier code\n // should be long enough to have a possible length for the country.\n // Otherwise, don't strip the national prefix and carrier code,\n // since the original number could be a valid number.\n // This check has been copy-pasted \"as is\" from Google's original library:\n // https://github.com/google/libphonenumber/blob/876268eb1ad6cdc1b7b5bef17fc5e43052702d57/java/libphonenumber/src/com/google/i18n/phonenumbers/PhoneNumberUtil.java#L3236-L3250\n // It doesn't check for the \"possibility\" of the original `number`.\n // I guess it's fine not checking that one. It works as is anyway.\n if (!isPossibleIncompleteNationalNumber(nationalNumber, country, metadata)) {\n // Don't strip the national prefix.\n return {\n nationalNumber: number\n };\n }\n }\n }\n return {\n nationalNumber: nationalNumber,\n carrierCode: carrierCode\n };\n}\n\n// In some countries, the same digit could be a national prefix\n// or a leading digit of a valid phone number.\n// For example, in Russia, national prefix is `8`,\n// and also `800 555 35 35` is a valid number\n// in which `8` is not a national prefix, but the first digit\n// of a national (significant) number.\n// Same's with Belarus:\n// `82004910060` is a valid national (significant) number,\n// but `2004910060` is not.\n// To support such cases (to prevent the code from always stripping\n// national prefix), a condition is imposed: a national prefix\n// is not extracted when the original number is \"viable\" and the\n// resultant number is not, a \"viable\" national number being the one\n// that matches `national_number_pattern`.\nfunction shouldHaveExtractedNationalPrefix(nationalNumberBefore, nationalNumberAfter, metadata) {\n // The equivalent in Google's code is:\n // https://github.com/google/libphonenumber/blob/e326fa1fc4283bb05eb35cb3c15c18f98a31af33/java/libphonenumber/src/com/google/i18n/phonenumbers/PhoneNumberUtil.java#L2969-L3004\n if (matchesEntirely(nationalNumberBefore, metadata.nationalNumberPattern()) && !matchesEntirely(nationalNumberAfter, metadata.nationalNumberPattern())) {\n return false;\n }\n // This \"is possible\" national number (length) check has been commented out\n // because it's superceded by the (effectively) same check done in the\n // `extractNationalNumber()` function after it calls `shouldHaveExtractedNationalPrefix()`.\n // In other words, why run the same check twice if it could only be run once.\n // // Check the national (significant) number length after extracting national prefix and carrier code.\n // // Fixes a minor \"weird behavior\" bug: https://gitlab.com/catamphetamine/libphonenumber-js/-/issues/57\n // // (Legacy generated metadata (before `1.0.18`) didn't support the \"possible lengths\" feature).\n // if (metadata.possibleLengths()) {\n // \tif (isPossibleIncompleteNationalNumber(nationalNumberBefore, metadata) &&\n // \t\t!isPossibleIncompleteNationalNumber(nationalNumberAfter, metadata)) {\n // \t\treturn false\n // \t}\n // }\n return true;\n}\n\n/**\n * Tells if a given incomplete national number is possible or not.\n * @param {string} nationalNumber\n * @param {string?} country — Specific country rather than the one that is pre-selected in the metadata instance.\n * @param {Metadata} metadata — Metadata instance with a selected numbering plan.\n * @returns {boolean}\n */\nfunction isPossibleIncompleteNationalNumber(nationalNumber, country, metadata) {\n switch (checkNumberLength(nationalNumber, country, metadata)) {\n case 'TOO_SHORT':\n case 'INVALID_LENGTH':\n // This library ignores \"local-only\" phone numbers (for simplicity).\n // See the readme for more info on what are \"local-only\" phone numbers.\n // case 'IS_POSSIBLE_LOCAL_ONLY':\n return false;\n default:\n return true;\n }\n}\n//# sourceMappingURL=extractNationalNumber.js.map","/**\n * Strips any national prefix (such as 0, 1) present in a\n * (possibly incomplete) number provided.\n * \"Carrier codes\" are only used in Colombia and Brazil,\n * and only when dialing within those countries from a mobile phone to a fixed line number.\n * Sometimes it won't actually strip national prefix\n * and will instead prepend some digits to the `number`:\n * for example, when number `2345678` is passed with `VI` country selected,\n * it will return `{ number: \"3402345678\" }`, because `340` area code is prepended.\n * @param {string} number — National number digits.\n * @param {object} metadata — Metadata with country selected.\n * @return {object} `{ nationalNumber: string, nationalPrefix: string? carrierCode: string? }`. Even if a national prefix was extracted, it's not necessarily present in the returned object, so don't rely on its presence in the returned object in order to find out whether a national prefix has been extracted or not.\n */\nexport default function extractNationalNumberFromPossiblyIncompleteNumber(number, metadata) {\n if (number && metadata.numberingPlan.nationalPrefixForParsing()) {\n // See METADATA.md for the description of\n // `national_prefix_for_parsing` and `national_prefix_transform_rule`.\n // Attempt to parse the first digits as a national prefix.\n var prefixPattern = new RegExp('^(?:' + metadata.numberingPlan.nationalPrefixForParsing() + ')');\n var prefixMatch = prefixPattern.exec(number);\n if (prefixMatch) {\n var nationalNumber;\n var carrierCode;\n // https://gitlab.com/catamphetamine/libphonenumber-js/-/blob/master/METADATA.md#national_prefix_for_parsing--national_prefix_transform_rule\n // If a `national_prefix_for_parsing` has any \"capturing groups\"\n // then it means that the national (significant) number is equal to\n // those \"capturing groups\" transformed via `national_prefix_transform_rule`,\n // and nothing could be said about the actual national prefix:\n // what is it and was it even there.\n // If a `national_prefix_for_parsing` doesn't have any \"capturing groups\",\n // then everything it matches is a national prefix.\n // To determine whether `national_prefix_for_parsing` matched any\n // \"capturing groups\", the value of the result of calling `.exec()`\n // is looked at, and if it has non-undefined values where there're\n // \"capturing groups\" in the regular expression, then it means\n // that \"capturing groups\" have been matched.\n // It's not possible to tell whether there'll be any \"capturing gropus\"\n // before the matching process, because a `national_prefix_for_parsing`\n // could exhibit both behaviors.\n var capturedGroupsCount = prefixMatch.length - 1;\n var hasCapturedGroups = capturedGroupsCount > 0 && prefixMatch[capturedGroupsCount];\n if (metadata.nationalPrefixTransformRule() && hasCapturedGroups) {\n nationalNumber = number.replace(prefixPattern, metadata.nationalPrefixTransformRule());\n // If there's more than one captured group,\n // then carrier code is the second one.\n if (capturedGroupsCount > 1) {\n carrierCode = prefixMatch[1];\n }\n }\n // If there're no \"capturing groups\",\n // or if there're \"capturing groups\" but no\n // `national_prefix_transform_rule`,\n // then just strip the national prefix from the number,\n // and possibly a carrier code.\n // Seems like there could be more.\n else {\n // `prefixBeforeNationalNumber` is the whole substring matched by\n // the `national_prefix_for_parsing` regular expression.\n // There seem to be no guarantees that it's just a national prefix.\n // For example, if there's a carrier code, it's gonna be a\n // part of `prefixBeforeNationalNumber` too.\n var prefixBeforeNationalNumber = prefixMatch[0];\n nationalNumber = number.slice(prefixBeforeNationalNumber.length);\n // If there's at least one captured group,\n // then carrier code is the first one.\n if (hasCapturedGroups) {\n carrierCode = prefixMatch[1];\n }\n }\n // Tries to guess whether a national prefix was present in the input.\n // This is not something copy-pasted from Google's library:\n // they don't seem to have an equivalent for that.\n // So this isn't an \"officially approved\" way of doing something like that.\n // But since there seems no other existing method, this library uses it.\n var nationalPrefix;\n if (hasCapturedGroups) {\n var possiblePositionOfTheFirstCapturedGroup = number.indexOf(prefixMatch[1]);\n var possibleNationalPrefix = number.slice(0, possiblePositionOfTheFirstCapturedGroup);\n // Example: an Argentinian (AR) phone number `0111523456789`.\n // `prefixMatch[0]` is `01115`, and `$1` is `11`,\n // and the rest of the phone number is `23456789`.\n // The national number is transformed via `9$1` to `91123456789`.\n // National prefix `0` is detected being present at the start.\n // if (possibleNationalPrefix.indexOf(metadata.numberingPlan.nationalPrefix()) === 0) {\n if (possibleNationalPrefix === metadata.numberingPlan.nationalPrefix()) {\n nationalPrefix = metadata.numberingPlan.nationalPrefix();\n }\n } else {\n nationalPrefix = prefixMatch[0];\n }\n return {\n nationalNumber: nationalNumber,\n nationalPrefix: nationalPrefix,\n carrierCode: carrierCode\n };\n }\n }\n return {\n nationalNumber: number\n };\n}\n//# sourceMappingURL=extractNationalNumberFromPossiblyIncompleteNumber.js.map","import applyInternationalSeparatorStyle from './applyInternationalSeparatorStyle.js';\n\n// This was originally set to $1 but there are some countries for which the\n// first group is not used in the national pattern (e.g. Argentina) so the $1\n// group does not match correctly. Therefore, we use `\\d`, so that the first\n// group actually used in the pattern will be matched.\nexport var FIRST_GROUP_PATTERN = /(\\$\\d)/;\nexport default function formatNationalNumberUsingFormat(number, format, _ref) {\n var useInternationalFormat = _ref.useInternationalFormat,\n withNationalPrefix = _ref.withNationalPrefix,\n carrierCode = _ref.carrierCode,\n metadata = _ref.metadata;\n var formattedNumber = number.replace(new RegExp(format.pattern()), useInternationalFormat ? format.internationalFormat() :\n // This library doesn't use `domestic_carrier_code_formatting_rule`,\n // because that one is only used when formatting phone numbers\n // for dialing from a mobile phone, and this is not a dialing library.\n // carrierCode && format.domesticCarrierCodeFormattingRule()\n // \t// First, replace the $CC in the formatting rule with the desired carrier code.\n // \t// Then, replace the $FG in the formatting rule with the first group\n // \t// and the carrier code combined in the appropriate way.\n // \t? format.format().replace(FIRST_GROUP_PATTERN, format.domesticCarrierCodeFormattingRule().replace('$CC', carrierCode))\n // \t: (\n // \t\twithNationalPrefix && format.nationalPrefixFormattingRule()\n // \t\t\t? format.format().replace(FIRST_GROUP_PATTERN, format.nationalPrefixFormattingRule())\n // \t\t\t: format.format()\n // \t)\n withNationalPrefix && format.nationalPrefixFormattingRule() ? format.format().replace(FIRST_GROUP_PATTERN, format.nationalPrefixFormattingRule()) : format.format());\n if (useInternationalFormat) {\n return applyInternationalSeparatorStyle(formattedNumber);\n }\n return formattedNumber;\n}\n//# sourceMappingURL=formatNationalNumberUsingFormat.js.map","var COUNTRY_CODE_REG_EXP = /^[A-Z]{2}$/;\nexport default function isCountryCode(string) {\n return COUNTRY_CODE_REG_EXP.test(string);\n}\n//# sourceMappingURL=isCountryCode.js.map","import Metadata from '../metadata.js';\nimport isCountryCode from './isCountryCode.js';\nvar USE_NON_GEOGRAPHIC_COUNTRY_CODE = false;\nexport default function getCountryAndCallingCodeFromOneOfThem(countryOrCallingCode, metadataJson) {\n var country;\n var callingCode;\n var metadata = new Metadata(metadataJson);\n // If country code is passed then derive `countryCallingCode` from it.\n // Also store the country code as `.country`.\n if (isCountryCode(countryOrCallingCode)) {\n country = countryOrCallingCode;\n metadata.selectNumberingPlan(country);\n callingCode = metadata.countryCallingCode();\n } else {\n callingCode = countryOrCallingCode;\n /* istanbul ignore if */\n if (USE_NON_GEOGRAPHIC_COUNTRY_CODE) {\n if (metadata.isNonGeographicCallingCode(callingCode)) {\n country = '001';\n }\n }\n }\n return {\n country: country,\n callingCode: callingCode\n };\n}\n//# sourceMappingURL=getCountryAndCallingCodeFromOneOfThem.js.map","import getCountryByNationalNumber from './getCountryByNationalNumber.js';\nvar USE_NON_GEOGRAPHIC_COUNTRY_CODE = false;\n\n/**\n * Returns the exact country that a given national (significant) number belongs to\n * in case of ambiguity, i.e. when multiple countries share the same \"country calling code\".\n * @param {string} [callingCode]\n * @param {string} [options.nationalNumber] — National (significant) number.\n * @param {Metadata} options.metadata — Metadata instance.\n * @returns {string?} Returns the most suitable country for this calling code and national (significant) number.\n */\nexport default function getCountryByCallingCode(callingCode, _ref) {\n var nationalNumber = _ref.nationalNumber,\n metadata = _ref.metadata;\n /* istanbul ignore if */\n if (USE_NON_GEOGRAPHIC_COUNTRY_CODE) {\n if (metadata.isNonGeographicCallingCode(callingCode)) {\n return '001';\n }\n }\n var possibleCountries = metadata.getCountryCodesForCallingCode(callingCode);\n if (!possibleCountries) {\n return;\n }\n // If there's just one country corresponding to the country code,\n // then just return it, without further phone number digits validation.\n if (possibleCountries.length === 1) {\n return possibleCountries[0];\n }\n return getCountryByNationalNumber(nationalNumber, possibleCountries, metadata.metadata);\n}\n//# sourceMappingURL=getCountryByCallingCode.js.map","function _createForOfIteratorHelperLoose(r, e) { var t = \"undefined\" != typeof Symbol && r[Symbol.iterator] || r[\"@@iterator\"]; if (t) return (t = t.call(r)).next.bind(t); if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && \"number\" == typeof r.length) { t && (r = t); var o = 0; return function () { return o >= r.length ? { done: !0 } : { done: !1, value: r[o++] }; }; } throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\nfunction _unsupportedIterableToArray(r, a) { if (r) { if (\"string\" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return \"Object\" === t && r.constructor && (t = r.constructor.name), \"Map\" === t || \"Set\" === t ? Array.from(r) : \"Arguments\" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }\nfunction _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }\nimport Metadata from '../metadata.js';\nimport getNumberType from './getNumberType.js';\n\n/**\n * Returns the exact country that a given national (significant) number belongs to\n * in case of ambiguity, i.e. when multiple countries share the same \"country calling code\".\n * @param {string} [nationalNumber]\n * @param {string[]} countries — A list of countries that share the same calling code.\n * @param {object} metadata — Metadata JSON.\n * @returns {string?} Returns the exact country this number belongs to, or `undefined` if the exact country couldn't be determined.\n */\nexport default function getCountryByNationalNumber(nationalNumber, countries, metadataJson) {\n // Create a new `metadata` instance because it will be selecting a `country`.\n var metadata = new Metadata(metadataJson);\n\n // const matchingCountries = []\n\n for (var _iterator = _createForOfIteratorHelperLoose(countries), _step; !(_step = _iterator()).done;) {\n var country = _step.value;\n metadata.selectNumberingPlan(country);\n // \"Leading digits\" patterns are only defined for about 20% of all countries.\n // By definition, matching \"leading digits\" is a sufficient but not a necessary\n // condition for a phone number to belong to a country.\n // The point of \"leading digits\" check is that it's the fastest one to get a match.\n // https://gitlab.com/catamphetamine/libphonenumber-js/blob/master/METADATA.md#leading_digits\n // I'd suppose that \"leading digits\" patterns are mutually exclusive for different countries\n // because of the intended use of that feature.\n if (metadata.leadingDigits()) {\n if (nationalNumber && nationalNumber.search(metadata.leadingDigits()) === 0) {\n return country;\n }\n }\n // Else perform full validation with all of those\n // fixed-line/mobile/etc regular expressions.\n else if (getNumberType({\n phone: nationalNumber,\n country: country\n }, undefined, metadata.metadata)) {\n // When multiple countries share the same \"country calling code\",\n // type patterns aren't guaranteed to be unique among them.\n // For example, both `US` and `CA` have the same pattern for `toll_free` numbers.\n // https://gitlab.com/catamphetamine/libphonenumber-js/-/issues/103#note_1417147572\n //\n // That means that this `if` condition could be `true` for multiple countries from the list.\n // Currently, it just returns the first one, which is also the \"main\" country for the \"country calling code\".\n // In an example with `toll_free` numbers above, `\"US\"` would be returned even though\n // it could as well be `\"CA\"`.\n //\n // There was also a time when this attempted to be overly smart\n // and kept track of all such multiple matching countries\n // and then picked the one that matched the `defaultCountry`, if provided.\n // For example, with `toll_free` numbers above, and with `defaultCountry: \"CA\"`,\n // it would've returned `\"CA\"` instead of `\"US\"`.\n // Later it turned out that such \"overly smart\" behavior turned out to be just confusing,\n // so this \"overly smart\" country detection was reverted to returning the \"main\" country\n // for the \"country calling code\".\n // https://gitlab.com/catamphetamine/libphonenumber-js/-/issues/154\n //\n return country;\n //\n // The \"overly smart\" behavior code:\n //\n // if (defaultCountry) {\n // \tif (country === defaultCountry) {\n // \t\treturn country\n // \t} else {\n // \t\tmatchingCountries.push(country)\n // \t}\n // } else {\n // \treturn country\n // }\n }\n }\n\n // // Return the first (\"main\") one of the `matchingCountries`.\n // if (matchingCountries.length > 0) {\n // \treturn matchingCountries[0]\n // }\n}\n//# sourceMappingURL=getCountryByNationalNumber.js.map","import Metadata from '../metadata.js';\n\n/**\n * Pattern that makes it easy to distinguish whether a region has a single\n * international dialing prefix or not. If a region has a single international\n * prefix (e.g. 011 in USA), it will be represented as a string that contains\n * a sequence of ASCII digits, and possibly a tilde, which signals waiting for\n * the tone. If there are multiple available international prefixes in a\n * region, they will be represented as a regex string that always contains one\n * or more characters that are not ASCII digits or a tilde.\n */\nvar SINGLE_IDD_PREFIX_REG_EXP = /^[\\d]+(?:[~\\u2053\\u223C\\uFF5E][\\d]+)?$/;\n\n// If the `country` supports IDD calling, it returns a preferred IDD prefix.\n// If the `country` doesn't support IDD calling, it returns `undefined`.\nexport default function getIddPrefix(country, callingCode, metadata) {\n var countryMetadata = new Metadata(metadata);\n countryMetadata.selectNumberingPlan(country || callingCode);\n if (countryMetadata.defaultIDDPrefix()) {\n return countryMetadata.defaultIDDPrefix();\n }\n if (SINGLE_IDD_PREFIX_REG_EXP.test(countryMetadata.IDDPrefix())) {\n return countryMetadata.IDDPrefix();\n }\n}\n//# sourceMappingURL=getIddPrefix.js.map","function _createForOfIteratorHelperLoose(r, e) { var t = \"undefined\" != typeof Symbol && r[Symbol.iterator] || r[\"@@iterator\"]; if (t) return (t = t.call(r)).next.bind(t); if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && \"number\" == typeof r.length) { t && (r = t); var o = 0; return function () { return o >= r.length ? { done: !0 } : { done: !1, value: r[o++] }; }; } throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\nfunction _unsupportedIterableToArray(r, a) { if (r) { if (\"string\" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return \"Object\" === t && r.constructor && (t = r.constructor.name), \"Map\" === t || \"Set\" === t ? Array.from(r) : \"Arguments\" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }\nfunction _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }\nimport Metadata from '../metadata.js';\nimport matchesEntirely from './matchesEntirely.js';\nvar NON_FIXED_LINE_PHONE_TYPES = ['MOBILE', 'PREMIUM_RATE', 'TOLL_FREE', 'SHARED_COST', 'VOIP', 'PERSONAL_NUMBER', 'PAGER', 'UAN', 'VOICEMAIL'];\n\n// Finds out national phone number type (fixed line, mobile, etc)\nexport default function getNumberType(input, options, metadataJson) {\n // If assigning the `{}` default value is moved to the arguments above,\n // code coverage would decrease for some weird reason.\n options = options || {};\n\n // When `parse()` returns an empty object — `{}` —\n // that means that the phone number is malformed,\n // so it can't possibly be valid.\n if (!input.country && !input.countryCallingCode) {\n return;\n }\n var metadata = new Metadata(metadataJson);\n metadata.selectNumberingPlan(input.country || input.countryCallingCode);\n var nationalNumber = options.v2 ? input.nationalNumber : input.phone;\n\n // The following is copy-pasted from the original function:\n // https://github.com/googlei18n/libphonenumber/blob/3ea547d4fbaa2d0b67588904dfa5d3f2557c27ff/javascript/i18n/phonenumbers/phonenumberutil.js#L2835\n\n // Is this national number even valid for this country\n if (!matchesEntirely(nationalNumber, metadata.nationalNumberPattern())) {\n return;\n }\n\n // Is it fixed line number\n if (isNumberTypeEqualTo(nationalNumber, 'FIXED_LINE', metadata)) {\n // Because duplicate regular expressions are removed\n // to reduce metadata size, if \"mobile\" pattern is \"\"\n // then it means it was removed due to being a duplicate of the fixed-line pattern.\n //\n if (metadata.type('MOBILE') && metadata.type('MOBILE').pattern() === '') {\n return 'FIXED_LINE_OR_MOBILE';\n }\n\n // `MOBILE` type pattern isn't included if it matched `FIXED_LINE` one.\n // For example, for \"US\" country.\n // Old metadata (< `1.0.18`) had a specific \"types\" data structure\n // that happened to be `undefined` for `MOBILE` in that case.\n // Newer metadata (>= `1.0.18`) has another data structure that is\n // not `undefined` for `MOBILE` in that case (it's just an empty array).\n // So this `if` is just for backwards compatibility with old metadata.\n if (!metadata.type('MOBILE')) {\n return 'FIXED_LINE_OR_MOBILE';\n }\n\n // Check if the number happens to qualify as both fixed line and mobile.\n // (no such country in the minimal metadata set)\n /* istanbul ignore if */\n if (isNumberTypeEqualTo(nationalNumber, 'MOBILE', metadata)) {\n return 'FIXED_LINE_OR_MOBILE';\n }\n return 'FIXED_LINE';\n }\n for (var _iterator = _createForOfIteratorHelperLoose(NON_FIXED_LINE_PHONE_TYPES), _step; !(_step = _iterator()).done;) {\n var type = _step.value;\n if (isNumberTypeEqualTo(nationalNumber, type, metadata)) {\n return type;\n }\n }\n}\nexport function isNumberTypeEqualTo(nationalNumber, type, metadata) {\n var typeDefinition = metadata.type(type);\n if (!typeDefinition || !typeDefinition.pattern()) {\n return false;\n }\n\n // Check if any possible number lengths are present;\n // if so, we use them to avoid checking\n // the validation pattern if they don't match.\n // If they are absent, this means they match\n // the general description, which we have\n // already checked before a specific number type.\n if (typeDefinition.possibleLengths() && typeDefinition.possibleLengths().indexOf(nationalNumber.length) < 0) {\n return false;\n }\n return matchesEntirely(nationalNumber, typeDefinition.pattern());\n}\n//# sourceMappingURL=getNumberType.js.map","import Metadata from '../metadata.js';\n\n/**\n * Returns a list of countries that the phone number could potentially belong to.\n * @param {string} callingCode — Calling code.\n * @param {string} nationalNumber — National (significant) number.\n * @param {object} metadata — Metadata.\n * @return {string[]} A list of possible countries.\n */\nexport default function getPossibleCountriesForNumber(callingCode, nationalNumber, metadata) {\n var _metadata = new Metadata(metadata);\n var possibleCountries = _metadata.getCountryCodesForCallingCode(callingCode);\n if (!possibleCountries) {\n return [];\n }\n return possibleCountries.filter(function (country) {\n return couldNationalNumberBelongToCountry(nationalNumber, country, metadata);\n });\n}\nfunction couldNationalNumberBelongToCountry(nationalNumber, country, metadataJson) {\n var metadata = new Metadata(metadataJson);\n metadata.selectNumberingPlan(country);\n return metadata.numberingPlan.possibleLengths().indexOf(nationalNumber.length) >= 0;\n}\n//# sourceMappingURL=getPossibleCountriesForNumber.js.map","var objectConstructor = {}.constructor;\nexport default function isObject(object) {\n return object !== undefined && object !== null && object.constructor === objectConstructor;\n}\n//# sourceMappingURL=isObject.js.map","import { MIN_LENGTH_FOR_NSN, VALID_DIGITS, VALID_PUNCTUATION, PLUS_CHARS } from '../constants.js';\nimport createExtensionPattern from './extension/createExtensionPattern.js';\n\n// Regular expression of viable phone numbers. This is location independent.\n// Checks we have at least three leading digits, and only valid punctuation,\n// alpha characters and digits in the phone number. Does not include extension\n// data. The symbol 'x' is allowed here as valid punctuation since it is often\n// used as a placeholder for carrier codes, for example in Brazilian phone\n// numbers. We also allow multiple '+' characters at the start.\n//\n// Corresponds to the following:\n// [digits]{minLengthNsn}|\n// plus_sign*\n// (([punctuation]|[star])*[digits]){3,}([punctuation]|[star]|[digits]|[alpha])*\n//\n// The first reg-ex is to allow short numbers (two digits long) to be parsed if\n// they are entered as \"15\" etc, but only if there is no punctuation in them.\n// The second expression restricts the number of digits to three or more, but\n// then allows them to be in international form, and to have alpha-characters\n// and punctuation. We split up the two reg-exes here and combine them when\n// creating the reg-ex VALID_PHONE_NUMBER_PATTERN itself so we can prefix it\n// with ^ and append $ to each branch.\n//\n// \"Note VALID_PUNCTUATION starts with a -,\n// so must be the first in the range\" (c) Google devs.\n// (wtf did they mean by saying that; probably nothing)\n//\nvar MIN_LENGTH_PHONE_NUMBER_PATTERN = '[' + VALID_DIGITS + ']{' + MIN_LENGTH_FOR_NSN + '}';\n//\n// And this is the second reg-exp:\n// (see MIN_LENGTH_PHONE_NUMBER_PATTERN for a full description of this reg-exp)\n//\nexport var VALID_PHONE_NUMBER = '[' + PLUS_CHARS + ']{0,1}' + '(?:' + '[' + VALID_PUNCTUATION + ']*' + '[' + VALID_DIGITS + ']' + '){3,}' + '[' + VALID_PUNCTUATION + VALID_DIGITS + ']*';\n\n// This regular expression isn't present in Google's `libphonenumber`\n// and is only used to determine whether the phone number being input\n// is too short for it to even consider it a \"valid\" number.\n// This is just a way to differentiate between a really invalid phone\n// number like \"abcde\" and a valid phone number that a user has just\n// started inputting, like \"+1\" or \"1\": both these cases would be\n// considered `NOT_A_NUMBER` by Google's `libphonenumber`, but this\n// library can provide a more detailed error message — whether it's\n// really \"not a number\", or is it just a start of a valid phone number.\nvar VALID_PHONE_NUMBER_START_REG_EXP = new RegExp('^' + '[' + PLUS_CHARS + ']{0,1}' + '(?:' + '[' + VALID_PUNCTUATION + ']*' + '[' + VALID_DIGITS + ']' + '){1,2}' + '$', 'i');\nexport var VALID_PHONE_NUMBER_WITH_EXTENSION = VALID_PHONE_NUMBER +\n// Phone number extensions\n'(?:' + createExtensionPattern() + ')?';\n\n// The combined regular expression for valid phone numbers:\n//\nvar VALID_PHONE_NUMBER_PATTERN = new RegExp(\n// Either a short two-digit-only phone number\n'^' + MIN_LENGTH_PHONE_NUMBER_PATTERN + '$' + '|' +\n// Or a longer fully parsed phone number (min 3 characters)\n'^' + VALID_PHONE_NUMBER_WITH_EXTENSION + '$', 'i');\n\n// Checks to see if the string of characters could possibly be a phone number at\n// all. At the moment, checks to see that the string begins with at least 2\n// digits, ignoring any punctuation commonly found in phone numbers. This method\n// does not require the number to be normalized in advance - but does assume\n// that leading non-number symbols have been removed, such as by the method\n// `extract_possible_number`.\n//\nexport default function isViablePhoneNumber(number) {\n return number.length >= MIN_LENGTH_FOR_NSN && VALID_PHONE_NUMBER_PATTERN.test(number);\n}\n\n// This is just a way to differentiate between a really invalid phone\n// number like \"abcde\" and a valid phone number that a user has just\n// started inputting, like \"+1\" or \"1\": both these cases would be\n// considered `NOT_A_NUMBER` by Google's `libphonenumber`, but this\n// library can provide a more detailed error message — whether it's\n// really \"not a number\", or is it just a start of a valid phone number.\nexport function isViablePhoneNumberStart(number) {\n return VALID_PHONE_NUMBER_START_REG_EXP.test(number);\n}\n//# sourceMappingURL=isViablePhoneNumber.js.map","/**\n * Checks whether the entire input sequence can be matched\n * against the regular expression.\n * @return {boolean}\n */\nexport default function matchesEntirely(text, regularExpressionText) {\n // If the assigning of the `''` default value is moved to the arguments above,\n // the code coverage would decrease for some weird reason.\n text = text || '';\n return new RegExp('^(?:' + regularExpressionText + ')$').test(text);\n}\n//# sourceMappingURL=matchesEntirely.js.map","function _createForOfIteratorHelperLoose(r, e) { var t = \"undefined\" != typeof Symbol && r[Symbol.iterator] || r[\"@@iterator\"]; if (t) return (t = t.call(r)).next.bind(t); if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && \"number\" == typeof r.length) { t && (r = t); var o = 0; return function () { return o >= r.length ? { done: !0 } : { done: !1, value: r[o++] }; }; } throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\nfunction _unsupportedIterableToArray(r, a) { if (r) { if (\"string\" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return \"Object\" === t && r.constructor && (t = r.constructor.name), \"Map\" === t || \"Set\" === t ? Array.from(r) : \"Arguments\" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }\nfunction _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }\n// These mappings map a character (key) to a specific digit that should\n// replace it for normalization purposes. Non-European digits that\n// may be used in phone numbers are mapped to a European equivalent.\n//\n// E.g. in Iraq they don't write `+442323234` but rather `+٤٤٢٣٢٣٢٣٤`.\n//\nexport var DIGITS = {\n '0': '0',\n '1': '1',\n '2': '2',\n '3': '3',\n '4': '4',\n '5': '5',\n '6': '6',\n '7': '7',\n '8': '8',\n '9': '9',\n \"\\uFF10\": '0',\n // Fullwidth digit 0\n \"\\uFF11\": '1',\n // Fullwidth digit 1\n \"\\uFF12\": '2',\n // Fullwidth digit 2\n \"\\uFF13\": '3',\n // Fullwidth digit 3\n \"\\uFF14\": '4',\n // Fullwidth digit 4\n \"\\uFF15\": '5',\n // Fullwidth digit 5\n \"\\uFF16\": '6',\n // Fullwidth digit 6\n \"\\uFF17\": '7',\n // Fullwidth digit 7\n \"\\uFF18\": '8',\n // Fullwidth digit 8\n \"\\uFF19\": '9',\n // Fullwidth digit 9\n \"\\u0660\": '0',\n // Arabic-indic digit 0\n \"\\u0661\": '1',\n // Arabic-indic digit 1\n \"\\u0662\": '2',\n // Arabic-indic digit 2\n \"\\u0663\": '3',\n // Arabic-indic digit 3\n \"\\u0664\": '4',\n // Arabic-indic digit 4\n \"\\u0665\": '5',\n // Arabic-indic digit 5\n \"\\u0666\": '6',\n // Arabic-indic digit 6\n \"\\u0667\": '7',\n // Arabic-indic digit 7\n \"\\u0668\": '8',\n // Arabic-indic digit 8\n \"\\u0669\": '9',\n // Arabic-indic digit 9\n \"\\u06F0\": '0',\n // Eastern-Arabic digit 0\n \"\\u06F1\": '1',\n // Eastern-Arabic digit 1\n \"\\u06F2\": '2',\n // Eastern-Arabic digit 2\n \"\\u06F3\": '3',\n // Eastern-Arabic digit 3\n \"\\u06F4\": '4',\n // Eastern-Arabic digit 4\n \"\\u06F5\": '5',\n // Eastern-Arabic digit 5\n \"\\u06F6\": '6',\n // Eastern-Arabic digit 6\n \"\\u06F7\": '7',\n // Eastern-Arabic digit 7\n \"\\u06F8\": '8',\n // Eastern-Arabic digit 8\n \"\\u06F9\": '9' // Eastern-Arabic digit 9\n};\nexport function parseDigit(character) {\n return DIGITS[character];\n}\n\n/**\n * Parses phone number digits from a string.\n * Drops all punctuation leaving only digits.\n * Also converts wide-ascii and arabic-indic numerals to conventional numerals.\n * E.g. in Iraq they don't write `+442323234` but rather `+٤٤٢٣٢٣٢٣٤`.\n * @param {string} string\n * @return {string}\n * @example\n * ```js\n * parseDigits('8 (800) 555')\n * // Outputs '8800555'.\n * ```\n */\nexport default function parseDigits(string) {\n var result = '';\n // Using `.split('')` here instead of normal `for ... of`\n // because the importing application doesn't neccessarily include an ES6 polyfill.\n // The `.split('')` approach discards \"exotic\" UTF-8 characters\n // (the ones consisting of four bytes) but digits\n // (including non-European ones) don't fall into that range\n // so such \"exotic\" characters would be discarded anyway.\n for (var _iterator = _createForOfIteratorHelperLoose(string.split('')), _step; !(_step = _iterator()).done;) {\n var character = _step.value;\n var digit = parseDigit(character);\n if (digit) {\n result += digit;\n }\n }\n return result;\n}\n//# sourceMappingURL=parseDigits.js.map","import Metadata from '../metadata.js';\nimport { VALID_DIGITS } from '../constants.js';\nvar CAPTURING_DIGIT_PATTERN = new RegExp('([' + VALID_DIGITS + '])');\nexport default function stripIddPrefix(number, country, callingCode, metadataJson) {\n if (!country) {\n return;\n }\n\n // Get the IDD prefix pattern.\n var metadata = new Metadata(metadataJson);\n metadata.selectNumberingPlan(country || callingCode);\n var IDDPrefixPattern = new RegExp(metadata.IDDPrefix());\n\n // Check if the number is IDD-prefixed.\n if (number.search(IDDPrefixPattern) !== 0) {\n return;\n }\n\n // Strip IDD prefix.\n number = number.slice(number.match(IDDPrefixPattern)[0].length);\n\n // If there're any digits after an IDD prefix,\n // then those digits are a country calling code.\n // Since no country code starts with a `0`,\n // the code below validates that the next digit (if present) is not `0`.\n var matchedGroups = number.match(CAPTURING_DIGIT_PATTERN);\n if (matchedGroups && matchedGroups[1] != null && matchedGroups[1].length > 0) {\n if (matchedGroups[1] === '0') {\n return;\n }\n }\n return number;\n}\n//# sourceMappingURL=stripIddPrefix.js.map","import Metadata from './metadata.js';\nimport checkNumberLength from './helpers/checkNumberLength.js';\n\n/**\n * Checks if a phone number is \"possible\" (basically just checks its length).\n *\n * isPossible(phoneNumberInstance, { ..., v2: true }, metadata)\n *\n * isPossible({ phone: '8005553535', country: 'RU' }, { ... }, metadata)\n * isPossible({ phone: '8005553535', country: 'RU' }, undefined, metadata)\n *\n * @param {object|PhoneNumber} input — If `options.v2: true` flag is passed, the `input` should be a `PhoneNumber` instance. Otherwise, it should be an object of shape `{ phone: '...', country: '...' }`.\n * @param {object} [options]\n * @param {object} metadataJson\n * @return {string}\n */\nexport default function isPossiblePhoneNumber(input, options, metadataJson) {\n /* istanbul ignore if */\n if (options === undefined) {\n options = {};\n }\n var metadata = new Metadata(metadataJson);\n if (options.v2) {\n if (!input.countryCallingCode) {\n throw new Error('Invalid phone number object passed');\n }\n metadata.selectNumberingPlan(input.country || input.countryCallingCode);\n } else {\n if (!input.phone) {\n return false;\n }\n if (input.country) {\n if (!metadata.hasCountry(input.country)) {\n throw new Error(\"Unknown country: \".concat(input.country));\n }\n metadata.selectNumberingPlan(input.country);\n } else {\n if (!input.countryCallingCode) {\n throw new Error('Invalid phone number object passed');\n }\n metadata.selectNumberingPlan(input.countryCallingCode);\n }\n }\n\n // Old (legacy) metadata (< 1.0.18) had no \"possible length\" data.\n // So `isPossibleNumber()` function is supported only for non-legacy metadata.\n if (metadata.possibleLengths()) {\n return isPossibleNumber(input.phone || input.nationalNumber, metadata);\n }\n\n // There was a bug in versions from `1.7.35` to `1.7.37` of `libphonenumber-js`\n // where \"possible_lengths\" property was missing from \"non-geographical\" numbering plans' metadata.\n // After that, the bug was noticed and fixed.\n // So for versions from `1.7.35` to `1.7.37`, just assume that all \"non=geotraphical\" numbers are possible.\n // The reason is that the bug was noticed relatively quickly (within a day or so)\n // and it's unlikely that anyone generated their custom metadata in that short time span.\n // And if they didn't generate any custom metadata then a follow-up package update would've silently fixed the bug.\n if (input.countryCallingCode && metadata.isNonGeographicCallingCode(input.countryCallingCode)) {\n return true;\n }\n\n // `isPossibleNumber()` function is not supported.\n throw new Error('Missing \"possibleLengths\" in metadata. Perhaps the metadata has been generated before v1.0.18.');\n}\n\n/**\n * Tells if a given national (significant) number is possible\n * @param {string} nationalNumber\n * @param {Metadata} metadata = Metadata instance with a pre-selected telephone numbering plan.\n * @returns {boolean}\n */\nexport function isPossibleNumber(nationalNumber, metadata) {\n switch (checkNumberLength(nationalNumber, undefined, metadata)) {\n case 'IS_POSSIBLE':\n return true;\n // This library ignores \"local-only\" phone numbers (for simplicity).\n // See the readme for more info on what are \"local-only\" phone numbers.\n // case 'IS_POSSIBLE_LOCAL_ONLY':\n // \treturn !isInternational\n default:\n return false;\n }\n}\n//# sourceMappingURL=isPossible.js.map","import Metadata from './metadata.js';\nimport matchesEntirely from './helpers/matchesEntirely.js';\nimport getNumberType from './helpers/getNumberType.js';\n\n/**\n * Checks if a given phone number is valid.\n *\n * isValid(phoneNumberInstance, { ..., v2: true }, metadata)\n *\n * isPossible({ phone: '8005553535', country: 'RU' }, { ... }, metadata)\n * isPossible({ phone: '8005553535', country: 'RU' }, undefined, metadata)\n *\n * If the `number` is a string, it will be parsed to an object,\n * but only if it contains only valid phone number characters (including punctuation).\n * If the `number` is an object, it is used as is.\n *\n * The optional `defaultCountry` argument is the default country.\n * I.e. it does not restrict to just that country,\n * e.g. in those cases where several countries share\n * the same phone numbering rules (NANPA, Britain, etc).\n * For example, even though the number `07624 369230`\n * belongs to the Isle of Man (\"IM\" country code)\n * calling `isValidNumber('07624369230', 'GB', metadata)`\n * still returns `true` because the country is not restricted to `GB`,\n * it's just that `GB` is the default one for the phone numbering rules.\n * For restricting the country see `isValidNumberForRegion()`\n * though restricting a country might not be a good idea.\n * https://github.com/googlei18n/libphonenumber/blob/master/FAQ.md#when-should-i-use-isvalidnumberforregion\n *\n * Examples:\n *\n * ```js\n * isValidNumber('+78005553535', metadata)\n * isValidNumber('8005553535', 'RU', metadata)\n * isValidNumber('88005553535', 'RU', metadata)\n * isValidNumber({ phone: '8005553535', country: 'RU' }, metadata)\n * ```\n */\nexport default function isValidNumber(input, options, metadataJson) {\n // If assigning the `{}` default value is moved to the arguments above,\n // code coverage would decrease for some weird reason.\n options = options || {};\n var metadata = new Metadata(metadataJson);\n metadata.selectNumberingPlan(input.country || input.countryCallingCode);\n\n // By default, countries only have type regexps when it's required for\n // distinguishing different countries having the same `countryCallingCode`.\n if (metadata.hasTypes()) {\n return getNumberType(input, options, metadata.metadata) !== undefined;\n }\n\n // If there are no type regexps for this country in metadata then use\n // `nationalNumberPattern` as a \"better than nothing\" replacement.\n var nationalNumber = options.v2 ? input.nationalNumber : input.phone;\n return matchesEntirely(nationalNumber, metadata.nationalNumberPattern());\n}\n//# sourceMappingURL=isValid.js.map","import _formatNumber from '../format.js';\nimport parse from '../parse.js';\nimport isObject from '../helpers/isObject.js';\nexport default function formatNumber() {\n var _normalizeArguments = normalizeArguments(arguments),\n input = _normalizeArguments.input,\n format = _normalizeArguments.format,\n options = _normalizeArguments.options,\n metadata = _normalizeArguments.metadata;\n return _formatNumber(input, format, options, metadata);\n}\n\n// Sort out arguments\nfunction normalizeArguments(args) {\n // This line of code appeared to not work correctly with `babel`/`istanbul`:\n // for some weird reason, it caused coverage less than 100%.\n // That's because `babel`/`istanbul`, for some weird reason,\n // apparently doesn't know how to properly exclude Babel polyfills from code coverage.\n //\n // const [arg_1, arg_2, arg_3, arg_4, arg_5] = Array.prototype.slice.call(args)\n\n var arg_1 = args[0];\n var arg_2 = args[1];\n var arg_3 = args[2];\n var arg_4 = args[3];\n var arg_5 = args[4];\n var input;\n var format;\n var options;\n var metadata;\n\n // Sort out arguments.\n\n // If the phone number is passed as a string.\n // `format('8005553535', ...)`.\n if (typeof arg_1 === 'string') {\n // If country code is supplied.\n // `format('8005553535', 'RU', 'NATIONAL', [options], metadata)`.\n if (typeof arg_3 === 'string') {\n format = arg_3;\n if (arg_5) {\n options = arg_4;\n metadata = arg_5;\n } else {\n metadata = arg_4;\n }\n input = parse(arg_1, {\n defaultCountry: arg_2,\n extended: true\n }, metadata);\n }\n // Just an international phone number is supplied\n // `format('+78005553535', 'NATIONAL', [options], metadata)`.\n else {\n if (typeof arg_2 !== 'string') {\n throw new Error('`format` argument not passed to `formatNumber(number, format)`');\n }\n format = arg_2;\n if (arg_4) {\n options = arg_3;\n metadata = arg_4;\n } else {\n metadata = arg_3;\n }\n input = parse(arg_1, {\n extended: true\n }, metadata);\n }\n }\n // If the phone number is passed as a parsed number object.\n // `format({ phone: '8005553535', country: 'RU' }, 'NATIONAL', [options], metadata)`.\n else if (isObject(arg_1)) {\n input = arg_1;\n format = arg_2;\n if (arg_4) {\n options = arg_3;\n metadata = arg_4;\n } else {\n metadata = arg_3;\n }\n } else throw new TypeError('A phone number must either be a string or an object of shape { phone, [country] }.');\n\n // Legacy lowercase formats.\n if (format === 'International') {\n format = 'INTERNATIONAL';\n } else if (format === 'National') {\n format = 'NATIONAL';\n }\n return {\n input: input,\n format: format,\n options: options,\n metadata: metadata\n };\n}\n//# sourceMappingURL=format.js.map","import _isValidNumber from '../isValid.js';\nimport { normalizeArguments } from './getNumberType.js';\n\n// Finds out national phone number type (fixed line, mobile, etc)\nexport default function isValidNumber() {\n var _normalizeArguments = normalizeArguments(arguments),\n input = _normalizeArguments.input,\n options = _normalizeArguments.options,\n metadata = _normalizeArguments.metadata;\n // `parseNumber()` would return `{}` when no phone number could be parsed from the input.\n if (!input.phone) {\n return false;\n }\n return _isValidNumber(input, options, metadata);\n}\n//# sourceMappingURL=isValidNumber.js.map","import isViablePhoneNumber from '../helpers/isViablePhoneNumber.js';\nimport _getNumberType from '../helpers/getNumberType.js';\nimport isObject from '../helpers/isObject.js';\nimport parse from '../parse.js';\n\n// Finds out national phone number type (fixed line, mobile, etc)\nexport default function getNumberType() {\n var _normalizeArguments = normalizeArguments(arguments),\n input = _normalizeArguments.input,\n options = _normalizeArguments.options,\n metadata = _normalizeArguments.metadata;\n // `parseNumber()` would return `{}` when no phone number could be parsed from the input.\n if (!input.phone) {\n return;\n }\n return _getNumberType(input, options, metadata);\n}\n\n// Sort out arguments\nexport function normalizeArguments(args) {\n // This line of code appeared to not work correctly with `babel`/`istanbul`:\n // for some weird reason, it caused coverage less than 100%.\n // That's because `babel`/`istanbul`, for some weird reason,\n // apparently doesn't know how to properly exclude Babel polyfills from code coverage.\n //\n // const [arg_1, arg_2, arg_3, arg_4] = Array.prototype.slice.call(args)\n\n var arg_1 = args[0];\n var arg_2 = args[1];\n var arg_3 = args[2];\n var arg_4 = args[3];\n var input;\n var options = {};\n var metadata;\n\n // If the phone number is passed as a string.\n // `getNumberType('88005553535', ...)`.\n if (typeof arg_1 === 'string') {\n // If \"default country\" argument is being passed\n // then convert it to an `options` object.\n // `getNumberType('88005553535', 'RU', metadata)`.\n if (!isObject(arg_2)) {\n if (arg_4) {\n options = arg_3;\n metadata = arg_4;\n } else {\n metadata = arg_3;\n }\n\n // `parse` extracts phone numbers from raw text,\n // therefore it will cut off all \"garbage\" characters,\n // while this `validate` function needs to verify\n // that the phone number contains no \"garbage\"\n // therefore the explicit `isViablePhoneNumber` check.\n if (isViablePhoneNumber(arg_1)) {\n input = parse(arg_1, {\n defaultCountry: arg_2\n }, metadata);\n } else {\n input = {};\n }\n }\n // No \"resrict country\" argument is being passed.\n // International phone number is passed.\n // `getNumberType('+78005553535', metadata)`.\n else {\n if (arg_3) {\n options = arg_2;\n metadata = arg_3;\n } else {\n metadata = arg_2;\n }\n\n // `parse` extracts phone numbers from raw text,\n // therefore it will cut off all \"garbage\" characters,\n // while this `validate` function needs to verify\n // that the phone number contains no \"garbage\"\n // therefore the explicit `isViablePhoneNumber` check.\n if (isViablePhoneNumber(arg_1)) {\n input = parse(arg_1, undefined, metadata);\n } else {\n input = {};\n }\n }\n }\n // If the phone number is passed as a parsed phone number.\n // `getNumberType({ phone: '88005553535', country: 'RU' }, ...)`.\n else if (isObject(arg_1)) {\n input = arg_1;\n if (arg_3) {\n options = arg_2;\n metadata = arg_3;\n } else {\n metadata = arg_2;\n }\n } else throw new TypeError('A phone number must either be a string or an object of shape { phone, [country] }.');\n return {\n input: input,\n options: options,\n metadata: metadata\n };\n}\n//# sourceMappingURL=getNumberType.js.map","import _parseNumber from '../parse.js';\nimport normalizeArguments from '../normalizeArguments.js';\nexport default function parseNumber() {\n var _normalizeArguments = normalizeArguments(arguments),\n text = _normalizeArguments.text,\n options = _normalizeArguments.options,\n metadata = _normalizeArguments.metadata;\n return _parseNumber(text, options, metadata);\n}\n//# sourceMappingURL=parse.js.map","var CALLING_CODE_REG_EXP = /^\\d+$/;\nexport default function isCallingCode(string) {\n return CALLING_CODE_REG_EXP.test(string);\n}\n//# sourceMappingURL=isCallingCode.js.map","function _readOnlyError(r) { throw new TypeError('\"' + r + '\" is read-only'); }\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError(\"Cannot call a class as a function\"); }\nfunction _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, \"value\" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }\nfunction _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, \"prototype\", { writable: !1 }), e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nimport compare from './tools/semver-compare.js';\nimport isObject from './helpers/isObject.js';\nimport isCallingCode from './helpers/isCallingCode.js';\n\n// Added \"possibleLengths\" and renamed\n// \"country_phone_code_to_countries\" to \"country_calling_codes\".\nvar V2 = '1.0.18';\n\n// Added \"idd_prefix\" and \"default_idd_prefix\".\nvar V3 = '1.2.0';\n\n// Moved `001` country code to \"nonGeographic\" section of metadata.\nvar V4 = '1.7.35';\nvar DEFAULT_EXT_PREFIX = ' ext. ';\n\n/**\n * See: https://gitlab.com/catamphetamine/libphonenumber-js/blob/master/METADATA.md\n */\nvar Metadata = /*#__PURE__*/function () {\n /**\n * @param {object} metadata — Metadata JSON.\n */\n function Metadata(metadata) {\n _classCallCheck(this, Metadata);\n validateMetadata(metadata);\n this.metadata = metadata;\n setVersion.call(this, metadata);\n }\n return _createClass(Metadata, [{\n key: \"getCountries\",\n value: function getCountries() {\n return Object.keys(this.metadata.countries).filter(function (_) {\n return _ !== '001';\n });\n }\n }, {\n key: \"getCountryMetadata\",\n value: function getCountryMetadata(countryCode) {\n return this.metadata.countries[countryCode];\n }\n }, {\n key: \"nonGeographic\",\n value: function nonGeographic() {\n if (this.v1 || this.v2 || this.v3) return;\n // `nonGeographical` was a typo.\n // It's present in metadata generated from `1.7.35` to `1.7.37`.\n // The test case could be found by searching for \"nonGeographical\".\n return this.metadata.nonGeographic || this.metadata.nonGeographical;\n }\n }, {\n key: \"hasCountry\",\n value: function hasCountry(country) {\n return this.getCountryMetadata(country) !== undefined;\n }\n }, {\n key: \"hasCallingCode\",\n value: function hasCallingCode(callingCode) {\n if (this.getCountryCodesForCallingCode(callingCode)) {\n return true;\n }\n if (this.nonGeographic()) {\n if (this.nonGeographic()[callingCode]) {\n return true;\n }\n } else {\n // A hacky workaround for old custom metadata (generated before V4).\n var countryCodes = this.countryCallingCodes()[callingCode];\n if (countryCodes && countryCodes.length === 1 && countryCodes[0] === '001') {\n return true;\n }\n }\n }\n }, {\n key: \"isNonGeographicCallingCode\",\n value: function isNonGeographicCallingCode(callingCode) {\n if (this.nonGeographic()) {\n return this.nonGeographic()[callingCode] ? true : false;\n } else {\n return this.getCountryCodesForCallingCode(callingCode) ? false : true;\n }\n }\n\n // Deprecated.\n }, {\n key: \"country\",\n value: function country(countryCode) {\n return this.selectNumberingPlan(countryCode);\n }\n\n /**\n * Selects a telephone numbering plan based on either a country code or a calling code.\n * @param {string} argument — Country code or calling code.\n * @param {string} legacyArgumentCallingCode — Legacy argument: calling code, if the first argument is not passed.\n */\n }, {\n key: \"selectNumberingPlan\",\n value: function selectNumberingPlan(argument, legacyArgumentCallingCode) {\n var countryCode;\n var callingCode;\n if (argument) {\n if (isCallingCode(argument)) {\n callingCode = argument;\n } else {\n countryCode = argument;\n }\n }\n // Previously, the signature of this method was: `.selectNumberingPlan(country, callingCode)`.\n // And if `country` argument wasn't passed, it looked into the second argument `callingCode`.\n // Now it's preferred to only pass either `country` or `callingCode` as the first argument.\n if (legacyArgumentCallingCode) {\n callingCode = legacyArgumentCallingCode;\n }\n\n // Select a telephone numbering plan.\n if (countryCode && countryCode !== '001') {\n var countryMetadata = this.getCountryMetadata(countryCode);\n if (!countryMetadata) {\n throw new Error(\"Unknown country: \".concat(countryCode));\n }\n this.numberingPlan = new NumberingPlan(countryMetadata, this);\n } else if (callingCode) {\n if (!this.hasCallingCode(callingCode)) {\n throw new Error(\"Unknown calling code: \".concat(callingCode));\n }\n this.numberingPlan = new NumberingPlan(this.getNumberingPlanMetadata(callingCode), this);\n } else {\n this.numberingPlan = undefined;\n }\n return this;\n }\n }, {\n key: \"getCountryCodesForCallingCode\",\n value: function getCountryCodesForCallingCode(callingCode) {\n var countryCodes = this.countryCallingCodes()[callingCode];\n if (countryCodes) {\n // Metadata before V4 included \"non-geographic entity\" calling codes\n // inside `country_calling_codes` (for example, `\"881\":[\"001\"]`).\n // Now the semantics of `country_calling_codes` has changed:\n // it's specifically for \"countries\" now.\n // Older versions of custom metadata will simply skip parsing\n // \"non-geographic entity\" phone numbers with new versions\n // of this library: it's not considered a bug,\n // because such numbers are extremely rare,\n // and developers extremely rarely use custom metadata.\n if (countryCodes.length === 1 && countryCodes[0].length === 3) {\n return;\n }\n return countryCodes;\n }\n }\n }, {\n key: \"getCountryCodeForCallingCode\",\n value: function getCountryCodeForCallingCode(callingCode) {\n var countryCodes = this.getCountryCodesForCallingCode(callingCode);\n if (countryCodes) {\n return countryCodes[0];\n }\n }\n }, {\n key: \"getNumberingPlanMetadata\",\n value: function getNumberingPlanMetadata(callingCode) {\n // If a calling code is specified, choose the telephone numbering plan\n // of the \"default\" country for this calling code.\n // For example, if calling code `1` is passed,\n // the telephone numbering plan of `US` will be selected.\n var countryCode = this.getCountryCodeForCallingCode(callingCode);\n if (countryCode) {\n return this.getCountryMetadata(countryCode);\n }\n if (this.nonGeographic()) {\n var metadata = this.nonGeographic()[callingCode];\n if (metadata) {\n return metadata;\n }\n } else {\n // A hacky workaround for old custom metadata (generated before V4).\n // In that metadata, there was no concept of \"non-geographic\" metadata\n // so metadata for `001` country code was stored along with other countries.\n // The test case can be found by searching for:\n // \"should work around `nonGeographic` metadata not existing\".\n var countryCodes = this.countryCallingCodes()[callingCode];\n if (countryCodes && countryCodes.length === 1 && countryCodes[0] === '001') {\n return this.metadata.countries['001'];\n }\n }\n }\n\n // Deprecated.\n }, {\n key: \"countryCallingCode\",\n value: function countryCallingCode() {\n return this.numberingPlan.callingCode();\n }\n\n // Deprecated.\n }, {\n key: \"IDDPrefix\",\n value: function IDDPrefix() {\n return this.numberingPlan.IDDPrefix();\n }\n\n // Deprecated.\n }, {\n key: \"defaultIDDPrefix\",\n value: function defaultIDDPrefix() {\n return this.numberingPlan.defaultIDDPrefix();\n }\n\n // Deprecated.\n }, {\n key: \"nationalNumberPattern\",\n value: function nationalNumberPattern() {\n return this.numberingPlan.nationalNumberPattern();\n }\n\n // Deprecated.\n }, {\n key: \"possibleLengths\",\n value: function possibleLengths() {\n return this.numberingPlan.possibleLengths();\n }\n\n // Deprecated.\n }, {\n key: \"formats\",\n value: function formats() {\n return this.numberingPlan.formats();\n }\n\n // Deprecated.\n }, {\n key: \"nationalPrefixForParsing\",\n value: function nationalPrefixForParsing() {\n return this.numberingPlan.nationalPrefixForParsing();\n }\n\n // Deprecated.\n }, {\n key: \"nationalPrefixTransformRule\",\n value: function nationalPrefixTransformRule() {\n return this.numberingPlan.nationalPrefixTransformRule();\n }\n\n // Deprecated.\n }, {\n key: \"leadingDigits\",\n value: function leadingDigits() {\n return this.numberingPlan.leadingDigits();\n }\n\n // Deprecated.\n }, {\n key: \"hasTypes\",\n value: function hasTypes() {\n return this.numberingPlan.hasTypes();\n }\n\n // Deprecated.\n }, {\n key: \"type\",\n value: function type(_type) {\n return this.numberingPlan.type(_type);\n }\n\n // Deprecated.\n }, {\n key: \"ext\",\n value: function ext() {\n return this.numberingPlan.ext();\n }\n }, {\n key: \"countryCallingCodes\",\n value: function countryCallingCodes() {\n if (this.v1) return this.metadata.country_phone_code_to_countries;\n return this.metadata.country_calling_codes;\n }\n\n // Deprecated.\n }, {\n key: \"chooseCountryByCountryCallingCode\",\n value: function chooseCountryByCountryCallingCode(callingCode) {\n return this.selectNumberingPlan(callingCode);\n }\n }, {\n key: \"hasSelectedNumberingPlan\",\n value: function hasSelectedNumberingPlan() {\n return this.numberingPlan !== undefined;\n }\n }]);\n}();\nexport { Metadata as default };\nvar NumberingPlan = /*#__PURE__*/function () {\n function NumberingPlan(metadata, globalMetadataObject) {\n _classCallCheck(this, NumberingPlan);\n this.globalMetadataObject = globalMetadataObject;\n this.metadata = metadata;\n setVersion.call(this, globalMetadataObject.metadata);\n }\n return _createClass(NumberingPlan, [{\n key: \"callingCode\",\n value: function callingCode() {\n return this.metadata[0];\n }\n\n // When multiple countries share the same calling code,\n // all phone number formatting rules are included in the metadata\n // of the \"default\" country for that calling code.\n // Any other countries' metdata doesn't include any formatting rules.\n // Google developers said that such storage architecture was chosen for performance reasons.\n //\n // For example, for NANPA region (\"North American Numbering Plan Administration\",\n // which includes USA, Canada, Cayman Islands, Bahamas, etc) all formatting rules\n // are contained in the metadata of `US` country.\n //\n // This is not public API.\n //\n }, {\n key: \"_getDefaultCountryMetadataForThisCallingCode\",\n value: function _getDefaultCountryMetadataForThisCallingCode() {\n return this.globalMetadataObject.getNumberingPlanMetadata(this.callingCode());\n }\n\n // Deprecated.\n }, {\n key: \"getDefaultCountryMetadataForRegion\",\n value: function getDefaultCountryMetadataForRegion() {\n return this._getDefaultCountryMetadataForThisCallingCode();\n }\n\n // Is always present.\n }, {\n key: \"IDDPrefix\",\n value: function IDDPrefix() {\n if (this.v1 || this.v2) return;\n return this.metadata[1];\n }\n\n // Is only present when a country supports multiple IDD prefixes.\n }, {\n key: \"defaultIDDPrefix\",\n value: function defaultIDDPrefix() {\n if (this.v1 || this.v2) return;\n return this.metadata[12];\n }\n }, {\n key: \"nationalNumberPattern\",\n value: function nationalNumberPattern() {\n if (this.v1 || this.v2) return this.metadata[1];\n return this.metadata[2];\n }\n\n // \"possible length\" data is always present in Google's metadata.\n }, {\n key: \"possibleLengths\",\n value: function possibleLengths() {\n if (this.v1) return;\n return this.metadata[this.v2 ? 2 : 3];\n }\n }, {\n key: \"_getFormats\",\n value: function _getFormats(metadata) {\n return metadata[this.v1 ? 2 : this.v2 ? 3 : 4];\n }\n\n // For countries of the same region (e.g. NANPA)\n // formats are all stored in the \"main\" country for that region.\n // E.g. \"RU\" and \"KZ\", \"US\" and \"CA\".\n }, {\n key: \"formats\",\n value: function formats() {\n var _this = this;\n var formats = this._getFormats(this.metadata) || this._getFormats(this._getDefaultCountryMetadataForThisCallingCode()) || [];\n return formats.map(function (_) {\n return new Format(_, _this);\n });\n }\n }, {\n key: \"nationalPrefix\",\n value: function nationalPrefix() {\n return this.metadata[this.v1 ? 3 : this.v2 ? 4 : 5];\n }\n }, {\n key: \"_getNationalPrefixFormattingRule\",\n value: function _getNationalPrefixFormattingRule(metadata) {\n return metadata[this.v1 ? 4 : this.v2 ? 5 : 6];\n }\n\n // For countries of the same region (e.g. NANPA)\n // national prefix formatting rule is stored in the \"main\" country for that region.\n // E.g. \"RU\" and \"KZ\", \"US\" and \"CA\".\n }, {\n key: \"nationalPrefixFormattingRule\",\n value: function nationalPrefixFormattingRule() {\n return this._getNationalPrefixFormattingRule(this.metadata) || this._getNationalPrefixFormattingRule(this._getDefaultCountryMetadataForThisCallingCode());\n }\n }, {\n key: \"_nationalPrefixForParsing\",\n value: function _nationalPrefixForParsing() {\n return this.metadata[this.v1 ? 5 : this.v2 ? 6 : 7];\n }\n }, {\n key: \"nationalPrefixForParsing\",\n value: function nationalPrefixForParsing() {\n // If `national_prefix_for_parsing` is not set explicitly,\n // then infer it from `national_prefix` (if any)\n return this._nationalPrefixForParsing() || this.nationalPrefix();\n }\n }, {\n key: \"nationalPrefixTransformRule\",\n value: function nationalPrefixTransformRule() {\n return this.metadata[this.v1 ? 6 : this.v2 ? 7 : 8];\n }\n }, {\n key: \"_getNationalPrefixIsOptionalWhenFormatting\",\n value: function _getNationalPrefixIsOptionalWhenFormatting() {\n return !!this.metadata[this.v1 ? 7 : this.v2 ? 8 : 9];\n }\n\n // For countries of the same region (e.g. NANPA)\n // \"national prefix is optional when formatting\" flag is\n // stored in the \"main\" country for that region.\n // E.g. \"RU\" and \"KZ\", \"US\" and \"CA\".\n }, {\n key: \"nationalPrefixIsOptionalWhenFormattingInNationalFormat\",\n value: function nationalPrefixIsOptionalWhenFormattingInNationalFormat() {\n return this._getNationalPrefixIsOptionalWhenFormatting(this.metadata) || this._getNationalPrefixIsOptionalWhenFormatting(this._getDefaultCountryMetadataForThisCallingCode());\n }\n }, {\n key: \"leadingDigits\",\n value: function leadingDigits() {\n return this.metadata[this.v1 ? 8 : this.v2 ? 9 : 10];\n }\n }, {\n key: \"types\",\n value: function types() {\n return this.metadata[this.v1 ? 9 : this.v2 ? 10 : 11];\n }\n }, {\n key: \"hasTypes\",\n value: function hasTypes() {\n // Versions 1.2.0 - 1.2.4: can be `[]`.\n /* istanbul ignore next */\n if (this.types() && this.types().length === 0) {\n return false;\n }\n // Versions <= 1.2.4: can be `undefined`.\n // Version >= 1.2.5: can be `0`.\n return !!this.types();\n }\n }, {\n key: \"type\",\n value: function type(_type2) {\n if (this.hasTypes() && getType(this.types(), _type2)) {\n return new Type(getType(this.types(), _type2), this);\n }\n }\n }, {\n key: \"ext\",\n value: function ext() {\n if (this.v1 || this.v2) return DEFAULT_EXT_PREFIX;\n return this.metadata[13] || DEFAULT_EXT_PREFIX;\n }\n }]);\n}();\nvar Format = /*#__PURE__*/function () {\n function Format(format, metadata) {\n _classCallCheck(this, Format);\n this._format = format;\n this.metadata = metadata;\n }\n return _createClass(Format, [{\n key: \"pattern\",\n value: function pattern() {\n return this._format[0];\n }\n }, {\n key: \"format\",\n value: function format() {\n return this._format[1];\n }\n }, {\n key: \"leadingDigitsPatterns\",\n value: function leadingDigitsPatterns() {\n return this._format[2] || [];\n }\n }, {\n key: \"nationalPrefixFormattingRule\",\n value: function nationalPrefixFormattingRule() {\n return this._format[3] || this.metadata.nationalPrefixFormattingRule();\n }\n }, {\n key: \"nationalPrefixIsOptionalWhenFormattingInNationalFormat\",\n value: function nationalPrefixIsOptionalWhenFormattingInNationalFormat() {\n return !!this._format[4] || this.metadata.nationalPrefixIsOptionalWhenFormattingInNationalFormat();\n }\n }, {\n key: \"nationalPrefixIsMandatoryWhenFormattingInNationalFormat\",\n value: function nationalPrefixIsMandatoryWhenFormattingInNationalFormat() {\n // National prefix is omitted if there's no national prefix formatting rule\n // set for this country, or when the national prefix formatting rule\n // contains no national prefix itself, or when this rule is set but\n // national prefix is optional for this phone number format\n // (and it is not enforced explicitly)\n return this.usesNationalPrefix() && !this.nationalPrefixIsOptionalWhenFormattingInNationalFormat();\n }\n\n // Checks whether national prefix formatting rule contains national prefix.\n }, {\n key: \"usesNationalPrefix\",\n value: function usesNationalPrefix() {\n return this.nationalPrefixFormattingRule() &&\n // Check that national prefix formatting rule is not a \"dummy\" one.\n !FIRST_GROUP_ONLY_PREFIX_PATTERN.test(this.nationalPrefixFormattingRule())\n // In compressed metadata, `this.nationalPrefixFormattingRule()` is `0`\n // when `national_prefix_formatting_rule` is not present.\n // So, `true` or `false` are returned explicitly here, so that\n // `0` number isn't returned.\n ? true : false;\n }\n }, {\n key: \"internationalFormat\",\n value: function internationalFormat() {\n return this._format[5] || this.format();\n }\n }]);\n}();\n/**\n * A pattern that is used to determine if the national prefix formatting rule\n * has the first group only, i.e., does not start with the national prefix.\n * Note that the pattern explicitly allows for unbalanced parentheses.\n */\nvar FIRST_GROUP_ONLY_PREFIX_PATTERN = /^\\(?\\$1\\)?$/;\nvar Type = /*#__PURE__*/function () {\n function Type(type, metadata) {\n _classCallCheck(this, Type);\n this.type = type;\n this.metadata = metadata;\n }\n return _createClass(Type, [{\n key: \"pattern\",\n value: function pattern() {\n if (this.metadata.v1) return this.type;\n return this.type[0];\n }\n }, {\n key: \"possibleLengths\",\n value: function possibleLengths() {\n if (this.metadata.v1) return;\n return this.type[1] || this.metadata.possibleLengths();\n }\n }]);\n}();\nfunction getType(types, type) {\n switch (type) {\n case 'FIXED_LINE':\n return types[0];\n case 'MOBILE':\n return types[1];\n case 'TOLL_FREE':\n return types[2];\n case 'PREMIUM_RATE':\n return types[3];\n case 'PERSONAL_NUMBER':\n return types[4];\n case 'VOICEMAIL':\n return types[5];\n case 'UAN':\n return types[6];\n case 'PAGER':\n return types[7];\n case 'VOIP':\n return types[8];\n case 'SHARED_COST':\n return types[9];\n }\n}\nexport function validateMetadata(metadata) {\n if (!metadata) {\n throw new Error('[libphonenumber-js] `metadata` argument not passed. Check your arguments.');\n }\n\n // `country_phone_code_to_countries` was renamed to `country_calling_codes` in `1.0.18`.\n // For that reason, it's not used in this detection algorithm.\n // Instead, it detects by `countries: {}` property existence.\n if (!isObject(metadata) || !isObject(metadata.countries)) {\n throw new Error(\"[libphonenumber-js] `metadata` argument was passed but it's not a valid metadata. Must be an object having `.countries` child object property. Got \".concat(isObject(metadata) ? 'an object of shape: { ' + Object.keys(metadata).join(', ') + ' }' : 'a ' + typeOf(metadata) + ': ' + metadata, \".\"));\n }\n}\n\n// Babel transforms `typeof` into some \"branches\"\n// so istanbul will show this as \"branch not covered\".\n/* istanbul ignore next */\nvar typeOf = function typeOf(_) {\n return _typeof(_);\n};\n\n/**\n * Returns extension prefix for a country.\n * @param {string} country\n * @param {object} metadata\n * @return {string?}\n * @example\n * // Returns \" ext. \"\n * getExtPrefix(\"US\")\n */\nexport function getExtPrefix(country, metadataJson) {\n var metadata = new Metadata(metadataJson);\n if (metadata.hasCountry(country)) {\n return metadata.selectNumberingPlan(country).ext();\n }\n return DEFAULT_EXT_PREFIX;\n}\n\n/**\n * Returns \"country calling code\" for a country.\n * Throws an error if the country doesn't exist or isn't supported by this library.\n * @param {string} country\n * @param {object} metadataJson\n * @return {string}\n * @example\n * // Returns \"44\"\n * getCountryCallingCode(\"GB\")\n */\nexport function getCountryCallingCode(country, metadataJson) {\n var metadata = new Metadata(metadataJson);\n if (metadata.hasCountry(country)) {\n return metadata.selectNumberingPlan(country).countryCallingCode();\n }\n throw new Error(\"Unknown country: \".concat(country));\n}\n\n/**\n * Tells if a country code is supported.\n * @param {string} country\n * @param {object} metadataJson\n * @return {boolean}\n * @example\n * // Returns `true`\n * isSupportedCountry(\"GB\")\n */\nexport function isSupportedCountry(country, metadataJson) {\n // const metadata = new Metadata(metadataJson)\n // return metadata.hasCountry(country)\n return metadataJson.countries.hasOwnProperty(country);\n}\n\n/**\n * Sets `v1`/`v2`/`v3`/`v4` properties on `this` object.\n * @param {object} metadata — Metadata JSON\n */\nfunction setVersion(metadata) {\n var version = metadata.version;\n if (typeof version === 'number') {\n this.v1 = version === 1;\n this.v2 = version === 2;\n this.v3 = version === 3;\n this.v4 = version === 4;\n } else {\n if (!version) {\n this.v1 = true;\n } else if (compare(version, V3) === -1) {\n this.v2 = true;\n } else if (compare(version, V4) === -1) {\n this.v3 = true;\n } else {\n this.v4 = true;\n }\n }\n}\n//# sourceMappingURL=metadata.js.map"],"names":["formatRFC3966","_ref","number","ext","Error","concat","applyInternationalSeparatorStyle","formattedNumber","replace","RegExp","trim","_arrayLikeToArray","r","a","length","e","n","Array","checkNumberLength","nationalNumber","country","metadata","checkNumberLengthForType","undefined","type","selectNumberingPlan","type_info","possible_lengths","possibleLengths","mobile_type","b","_step","merged","slice","_iterator","t","Symbol","iterator","call","next","bind","isArray","toString","constructor","name","from","test","_unsupportedIterableToArray","o","done","value","TypeError","_createForOfIteratorHelperLoose","element","indexOf","push","sort","mergeArrays","actual_length","minimum_length","RFC3966_EXTN_PREFIX","getExtensionDigitsPattern","maxLength","createExtensionPattern","purpose","possibleSeparatorsBetweenNumberAndExtLabel","possibleCharsAfterExtLabel","optionalExtnSuffix","possibleSeparatorsNumberExtLabelNoComma","rfcExtn","EXTN_PATTERN","extractExtension","start","search","numberWithoutExtension","matches","match","i","extractCountryCallingCode","defaultCountry","defaultCallingCode","metadataJson","isNumberWithIddPrefix","numberWithoutIDD","_extractCountryCallin","countryCallingCode","shorterNumber","countryCallingCodeSource","_countryCallingCode","hasCallingCode","extractCountryCallingCodeFromInternationalNumberWithoutPlusSign","possibleShorterNumber","possibleShorterNationalNumber","nationalNumberPattern","PLUS_SIGN","RFC3966_PHONE_DIGIT_","RFC3966_GLOBAL_NUMBER_DIGITS_","RFC3966_GLOBAL_NUMBER_DIGITS_PATTERN_","ALPHANUM_","RFC3966_DOMAINNAME_PATTERN_","RFC3966_PREFIX_","RFC3966_PHONE_CONTEXT_","RFC3966_ISDN_SUBADDRESS_","extractFormattedPhoneNumberFromPossibleRfc3966NumberUri","numberToParse","phoneNumberString","extractFormattedPhoneNumber","phoneContext","numberToExtractFrom","indexOfPhoneContext","phoneContextStart","phoneContextEnd","substring","extractPhoneContext","isPhoneContextValid","ParseError","charAt","indexOfNationalNumber","indexOfRfc3966Prefix","indexOfIsdn","extractNationalNumber","_extractNationalNumbe","carrierCode","nationalNumberBefore","nationalNumberAfter","shouldHaveExtractedNationalPrefix","numberingPlan","callingCode","isPossibleIncompleteNationalNumber","extractNationalNumberFromPossiblyIncompleteNumber","nationalPrefixForParsing","prefixPattern","prefixMatch","exec","nationalPrefix","capturedGroupsCount","hasCapturedGroups","nationalPrefixTransformRule","prefixBeforeNationalNumber","possiblePositionOfTheFirstCapturedGroup","FIRST_GROUP_PATTERN","formatNationalNumberUsingFormat","format","useInternationalFormat","withNationalPrefix","pattern","internationalFormat","nationalPrefixFormattingRule","COUNTRY_CODE_REG_EXP","USE_NON_GEOGRAPHIC_COUNTRY_CODE","getCountryAndCallingCodeFromOneOfThem","countryOrCallingCode","string","isNonGeographicCallingCode","getCountryByCallingCode","possibleCountries","getCountryCodesForCallingCode","getCountryByNationalNumber","countries","leadingDigits","phone","SINGLE_IDD_PREFIX_REG_EXP","getIddPrefix","countryMetadata","defaultIDDPrefix","IDDPrefix","NON_FIXED_LINE_PHONE_TYPES","getNumberType","input","options","v2","isNumberTypeEqualTo","typeDefinition","getPossibleCountriesForNumber","filter","couldNationalNumberBelongToCountry","objectConstructor","isObject","object","MIN_LENGTH_PHONE_NUMBER_PATTERN","VALID_PHONE_NUMBER","VALID_PHONE_NUMBER_START_REG_EXP","VALID_PHONE_NUMBER_WITH_EXTENSION","VALID_PHONE_NUMBER_PATTERN","isViablePhoneNumber","isViablePhoneNumberStart","matchesEntirely","text","regularExpressionText","DIGITS","parseDigit","character","parseDigits","result","split","digit","CAPTURING_DIGIT_PATTERN","stripIddPrefix","IDDPrefixPattern","matchedGroups","isPossiblePhoneNumber","hasCountry","isPossibleNumber","isValidNumber","hasTypes","formatNumber","_normalizeArguments","args","arg_1","arg_2","arg_3","arg_4","arg_5","extended","normalizeArguments","arguments","parse","parseNumber","CALLING_CODE_REG_EXP","_typeof","prototype","_classCallCheck","_defineProperties","enumerable","configurable","writable","Object","defineProperty","_toPropertyKey","key","_createClass","toPrimitive","String","_toPrimitive","DEFAULT_EXT_PREFIX","Metadata","this","validateMetadata","setVersion","keys","_","countryCode","v1","v3","nonGeographic","nonGeographical","getCountryMetadata","countryCodes","countryCallingCodes","argument","legacyArgumentCallingCode","NumberingPlan","getNumberingPlanMetadata","getCountryCodeForCallingCode","formats","_type","country_phone_code_to_countries","country_calling_codes","globalMetadataObject","_getDefaultCountryMetadataForThisCallingCode","_this","_getFormats","map","Format","_getNationalPrefixFormattingRule","_nationalPrefixForParsing","_getNationalPrefixIsOptionalWhenFormatting","types","_type2","getType","Type","_format","nationalPrefixIsOptionalWhenFormattingInNationalFormat","usesNationalPrefix","FIRST_GROUP_ONLY_PREFIX_PATTERN","join","typeOf","getCountryCallingCode","version","v4"],"sourceRoot":""}