{"version":3,"sources":["webpack://libphonenumber/webpack/universalModuleDefinition","webpack://libphonenumber/webpack/bootstrap","webpack://libphonenumber/./es6/common.js","webpack://libphonenumber/./es6/metadata.js","webpack://libphonenumber/./es6/parse.js","webpack://libphonenumber/./es6/getNumberType.js","webpack://libphonenumber/./es6/validate.js","webpack://libphonenumber/./es6/PhoneNumber.js","webpack://libphonenumber/./es6/findNumbers/util.js","webpack://libphonenumber/./es6/format.js","webpack://libphonenumber/./es6/parseIncompletePhoneNumber.js","webpack://libphonenumber/./es6/PhoneNumberMatcher.js","webpack://libphonenumber/./es6/findPhoneNumbers.js","webpack://libphonenumber/./es6/RFC3966.js","webpack://libphonenumber/./es6/isPossibleNumber.js","webpack://libphonenumber/./es6/AsYouType.js","webpack://libphonenumber/./es6/findNumbers/utf-8.js","webpack://libphonenumber/./es6/findNumbers/isValidCandidate.js","webpack://libphonenumber/./es6/findNumbers/isValidPreCandidate.js","webpack://libphonenumber/./es6/findNumbers/parsePreCandidate.js","webpack://libphonenumber/./es6/getCountryCallingCode.js","webpack://libphonenumber/./es6/IDD.js","webpack://libphonenumber/./es6/formatIncompletePhoneNumber.js","webpack://libphonenumber/./es6/searchNumbers.js","webpack://libphonenumber/./es6/findNumbers/Leniency.js","webpack://libphonenumber/./es6/findNumbers.js","webpack://libphonenumber/./es6/isValidNumberForRegion.js","webpack://libphonenumber/./es6/getExampleNumber.js","webpack://libphonenumber/./es6/parsePhoneNumber.js","webpack://libphonenumber/./node_modules/semver-compare/index.js","webpack://libphonenumber/./index.es6.js"],"names":["root","factory","exports","module","define","amd","window","installedModules","__webpack_require__","moduleId","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","configurable","enumerable","get","r","value","n","__esModule","object","property","prototype","hasOwnProperty","p","s","parseDigit","character","DIGITS","extractCountryCallingCode","number","country","metadata","_parseIncompletePhoneNumber2","default","numberWithoutIDD","_IDD","stripIDDPrefix","_metadata2","MAX_LENGTH_COUNTRY_CODE","length","countryCallingCode","slice","countryCallingCodes","matches_entirely","text","arguments","undefined","regular_expression","RegExp","test","create_extension_pattern","purpose","single_extension_characters","RFC3966_EXTN_PREFIX","CAPTURING_EXTN_DIGITS","VALID_DIGITS","WHITESPACE","PLUS_CHARS","VALID_PUNCTUATION","MAX_LENGTH_FOR_NSN","0","1","2","3","4","5","6","7","8","9","0","1","2","3","4","5","6","7","8","9","٠","١","٢","٣","٤","٥","٦","٧","٨","٩","۰","۱","۲","۳","۴","۵","۶","۷","۸","۹","validateMetadata","getExtPrefix","Metadata","ext","_semverCompare","_typeof","Symbol","_typeof2","iterator","obj","constructor","_createClass","defineProperties","target","props","descriptor","writable","key","Constructor","protoProps","staticProps","_classCallCheck","instance","TypeError","V3","this","v1","version","v2","_semverCompare2","v3","countries","_country","country_metadata","hasCountry","Error","_this","formats","_getFormats","getDefaultCountryMetadataForRegion","map","_","Format","_getNationalPrefixFormattingRule","nationalPrefix","_getNationalPrefixIsOptionalWhenFormatting","types","_type","hasTypes","getType","Type","country_phone_code_to_countries","country_calling_codes","country_calling_code","format","_format","nationalPrefixFormattingRule","nationalPrefixIsOptionalWhenFormatting","usesNationalPrefix","replace","type","possibleLengths","is_object","keys","join","type_of","arg_1","arg_2","arg_3","arg_4","_sort_out_arguments","options","_extends","defaultCountry","default_options","sort_out_arguments","_parse_input","indexOf","_RFC","parseRFC3966","extract_formatted_phone_number","is_viable_phone_number","with_extension_stripped","start","search","EXTN_PATTERN","number_without_extension","matches","match","strip_extension","parse_input","formatted_phone_number","_parse_phone_number","default_country","_extractCountryCallin","_common","chooseCountryByCountryCallingCode","_getCountryCallingCode2","_parse_national_numbe","national_number","carrier_code","_strip_national_prefi","strip_national_prefix_and_carrier_code","potential_national_number","carrierCode","_getNumberType","check_number_length_for_type","nationalNumberPattern","parse_national_number","exactCountry","find_country_code","parse_phone_number","nationalNumber","selectedCountry","MIN_LENGTH_FOR_NSN","phoneNumber","_PhoneNumber2","valid","extended","result","phone","possible","_isPossibleNumber","is_possible_number","assign","source","MAX_INPUT_STRING_LENGTH","EXTN_PATTERNS_FOR_PARSING","MIN_LENGTH_PHONE_NUMBER_PATTERN","VALID_PHONE_NUMBER","VALID_PHONE_NUMBER_PATTERN","PHONE_NUMBER_START_PATTERN","AFTER_PHONE_NUMBER_END_PATTERN","starts_at","nationalPrefixForParsing","national_prefix_pattern","national_prefix_matcher","exec","national_significant_number","captured_groups_count","nationalPrefixTransformRule","national_phone_number","possible_countries","_iterator","_isArray","Array","isArray","_i","_ref","next","done","leadingDigits","_getNumberType2","_find_country_code","input","is_of_type","pattern","non_fixed_line_types","type_info","possible_lengths","mobile_type","merge_arrays","actual_length","minimum_length","_parse","_parse2","a","b","merged","_iterator2","_isArray2","_i2","_ref2","element","push","sort","PhoneNumber","isCountryCode","_metadata","_metadata3","_isPossibleNumber2","_validate2","_format3","limit","lower","upper","trimAfterFirstMatch","regexp","string","index","startsWith","substring","endsWith","arg_5","format_type","defaultOptions","format_national_number","add_extension","formatExtension","formatRFC3966","fromCountry","IDDPrefix","getIDDPrefix","humanReadable","formattedForSameCountryCallingCode","formatIDDSameCountryCallingCodeNumber","format_national_number_using_format","choose_format_for_number","local_to_international_style","extension","FIRST_GROUP_PATTERN","international","enforce_national_prefix","format_pattern_matcher","national_prefix_may_be_omitted","formatted_number","internationalFormat","format_as","available_formats","leadingDigitsPatterns","last_leading_digits_pattern","local","trim","toCountryCallingCode","toCountryMetadata","fromCountryMetadata","split","parsePhoneNumberCharacter","_util","_utf","_isValidCandidate","INNER_MATCHES","pZ","PZ","leadLimit","punctuationLimit","digitBlockLimit","blockLimit","punctuation","digitSequence","pNd","PATTERN","LEAD_CLASS","UNWANTED_END_CHAR_PATTERN","_pN","_pL","MAX_SAFE_INTEGER","Number","Math","pow","PhoneNumberMatcher","state","searchIndex","leniency","maxTries","_Leniency2","candidate","offset","_parsePreCandidate2","_isValidPreCandidate2","parseAndVerify","extractInnerMatch","startsAt","endsAt","isFirstMatch","possibleInnerMatch","_group","_match","group","_isValidCandidate2","lastMatch","find","hasNext","PhoneNumberSearch","phones","searchPhoneNumbers","_sort_out_arguments2","_defineProperty","WHITESPACE_IN_THE_BEGINNING_PATTERN","PUNCTUATION_IN_THE_END_PATTERN","parseCandidate","last_match","part","_part$split","_part$split2","_slicedToArray","arr","_arr","_n","_d","_e","_s","err","sliceIterator","is_international","strip_dangling_braces","cut_stripping_dangling_braces","close_dangling_braces","template","cut_before","retained_template","opening_braces","count_occurences","closing_braces","dangling_braces","repeat","LONGEST_DUMMY_PHONE_NUMBER","DIGIT_PLACEHOLDER","DIGIT_PLACEHOLDER_MATCHER","ELIGIBLE_FORMAT_PATTERN","VALID_INCOMPLETE_PHONE_NUMBER","VALID_INCOMPLETE_PHONE_NUMBER_PATTERN","AsYouType","country_code","reset","extracted_number","process_input","current_output","parsed_input","reset_countriness","determine_the_country","extract_country_calling_code","initialize_phone_number_formats_for_this_country_calling_code","reset_format","previous_national_prefix","national_prefix","extract_national_prefix","matching_formats","format_as_non_formatted_number","match_formats_by_leading_digits","formatted_national_phone_number","format_national_phone_number","full_phone_number","next_digits","national_number_formatted_with_previous_format","chosen_format","format_next_national_number_digits","attempt_to_format_complete_phone_number","choose_another_format","reformat_national_number","reset_country","partially_populated_template","last_match_position","filter","leading_digits","index_of_leading_digits_pattern","had_enough_leading_digits","should_format","leading_digits_patterns_count","leading_digits_pattern_index","min","leading_digits_pattern","is_format_applicable","create_formatting_template","full_number","formatted_national_number","nationalPrefixIsMandatoryWhenFormatting","get_template_for_phone_number_format_pattern","number_pattern","dummy_phone_number_matching_format_pattern","number_format","get_format_format","strict_pattern","national_number_dummy_digits","digits","_iterator3","_isArray3","_i3","_ref3","digit","pop","cleared_string","_iterator4","_isArray4","_i4","_ref4","cut_before_index","symbol","count","_iterator5","_isArray5","_i5","_ref5","times","isLatinLetter","letter","pL_regexp","pMn_regexp","latinLetterRegexp","isInvalidPunctuationSymbol","pSc_regexp","_pZ","MATCHING_BRACKETS_ENTIRE","PUB_PAGES","LEAD_CLASS_LEADING","previousChar","lastCharIndex","nextChar","BRACKET_PAIR_LIMIT","SLASH_SEPARATED_DATES","TIME_STAMPS","followingText","TIME_STAMPS_SUFFIX_LEADING","SECOND_NUMBER_START_PATTERN","countryMetadata","SINGLE_IDD_PREFIX","defaultIDDPrefix","IDDPrefixPattern","matchedGroups","CAPTURING_DIGIT_PATTERN","_AsYouType2","_AsYouType","_findPhoneNumbers","matcher","_PhoneNumberMatcher2","_PhoneNumberMatcher","containsMoreThanOneSlashInNationalNumber","containsOnlyValidXChars","charAtIndex","charAt","charAtNextIndex","util","isNumberMatch","MatchType","NSN_MATCH","parseDigits","isNationalPrefixPresentIfRequired","getCountryCodeSource","phoneNumberRegion","getRegionCodeForCountryCode","getCountryCode","getMetadataForRegion","getNationalSignificantNumber","formatRule","chooseFormattingPatternForNumber","numberFormats","getNationalPrefixFormattingRule","getNationalPrefixOptionalWhenFormatting","PhoneNumberUtil","formattingRuleHasFirstGroupOnly","rawInputCopy","normalizeDigitsOnly","getRawInput","maybeStripNationalPrefixAndCarrierCode","firstSlashInBodyIndex","secondSlashInBodyIndex","CountryCodeSource","FROM_NUMBER_WITH_PLUS_SIGN","FROM_NUMBER_WITHOUT_PLUS_SIGN","String","checkNumberGroupingIsValid","checkGroups","normalizedCandidate","normalizeDigits","formattedNumberGroups","getNationalNumberGroups","alternateFormats","MetadataManager","getAlternateFormatsForCountry","formattingPattern","nationalSignificantNumber","formatNsnUsingPattern","rfc3966Format","formatNumber","endIndex","startIndex","allNumberGroupsAreExactlyPresent","candidateGroups","NON_DIGITS_PATTERN","candidateNumberGroupIndex","hasExtension","contains","formattedNumberGroupIndex","allNumberGroupsRemainGrouped","fromIndex","FROM_DEFAULT_COUNTRY","countryCode","region","getNddPrefixForRegion","Character","isDigit","getExtension","POSSIBLE","VALID","toString","STRICT_GROUPING","candidateString","EXACT_GROUPING","results","_validate","examples","_PhoneNumber","isObject","pa","pb","na","nb","isNaN","parsePhoneNumber","parameters","_metadataMin2","_parsePhoneNumber2","apply","parseNumber","parse","_format2","getNumberType","getExampleNumber","_getExampleNumber2","isPossibleNumber","isValidNumber","isValidNumberForRegion","_isValidNumberForRegion2","findPhoneNumbers","_findPhoneNumbers2","findNumbers","_findNumbers2","searchNumbers","_searchNumbers2","formatIncompletePhoneNumber","_formatIncompletePhoneNumber2","_getCountryCallingCode","getCountryCallingCode","getPhoneCode","getPhoneCodeCustom","create"],"mappings":"CAAA,SAAAA,EAAAC,GACA,iBAAAC,SAAA,iBAAAC,OACAA,OAAAD,QAAAD,IACA,mBAAAG,eAAAC,IACAD,OAAA,oBAAAH,GACA,iBAAAC,QACAA,QAAA,eAAAD,IAEAD,EAAA,eAAAC,IARA,CASCK,OAAA,WACD,mBCTA,IAAAC,KAGA,SAAAC,EAAAC,GAGA,GAAAF,EAAAE,GACA,OAAAF,EAAAE,GAAAP,QAGA,IAAAC,EAAAI,EAAAE,IACAC,EAAAD,EACAE,GAAA,EACAT,YAUA,OANAU,EAAAH,GAAAI,KAAAV,EAAAD,QAAAC,IAAAD,QAAAM,GAGAL,EAAAQ,GAAA,EAGAR,EAAAD,QA2CA,OAtCAM,EAAAM,EAAAF,EAGAJ,EAAAO,EAAAR,EAGAC,EAAAQ,EAAA,SAAAd,EAAAe,EAAAC,GACAV,EAAAW,EAAAjB,EAAAe,IACAG,OAAAC,eAAAnB,EAAAe,GACAK,cAAA,EACAC,YAAA,EACAC,IAAAN,KAMAV,EAAAiB,EAAA,SAAAvB,GACAkB,OAAAC,eAAAnB,EAAA,cAAiDwB,OAAA,KAIjDlB,EAAAmB,EAAA,SAAAxB,GACA,IAAAe,EAAAf,KAAAyB,WACA,WAA2B,OAAAzB,EAAA,SAC3B,WAAiC,OAAAA,GAEjC,OADAK,EAAAQ,EAAAE,EAAA,IAAAA,GACAA,GAIAV,EAAAW,EAAA,SAAAU,EAAAC,GAAsD,OAAAV,OAAAW,UAAAC,eAAAnB,KAAAgB,EAAAC,IAGtDtB,EAAAyB,EAAA,GAIAzB,IAAA0B,EA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A4BllB,EAASC,GAE3C,OAAO,EAAAsK,EAAApK,SAA4BH,EAASC,IA9N7C,QAAAjC,EAAA,SAEAA,EAAA,8BAKAA,EAAA,SACAA,EAAA,gBAEAA,EAAA,gBAKAA,EAAA,SACAA,EAAA,SACAA,EAAA,kBAOAoL,EAAApL,EAAA,QACAA,EAAA,wDA8FO,SAASuX,EAAkBzU,EAAM+H,GAEvCqV,EAAA3I,kBAAwBlX,KAAK0H,KAAMjF,EAAM+H,EAAzC6a,EAAAvjB,SAqBM,SAAS6T,EAAmBlT,EAAM+H,GAExCuV,EAAAje,QAAyB9B,KAAK0H,KAAMjF,EAAM+H,EAA1C6a,EAAAvjB,SAMM,SAAS2X,EAAU9X,GAEzBge,EAAA7d,QAAgB9B,KAAK0H,KAAM/F,EAA3B0jB,EAAAvjB,SAwDM,SAAS6kB,EAAsBhlB,GAErC,OAAO,EAAAuK,EAAApK,SAA4BH,EAA5B0jB,EAAAvjB,SArFRoV,EAAkBhW,UAAYX,OAAOumB,OAAOjH,EAAA3I,kBAAwBhW,cACpEgW,EAAkBhW,UAAUyF,YAAcuQ,EAqB1CvB,EAAmBzU,UAAYX,OAAOumB,OAAO/G,EAAAje,QAAyBZ,cACtEyU,EAAmBzU,UAAUyF,YAAcgP,EAO3C8D,EAAUvY,UAAYX,OAAOumB,OAAOnH,EAAA7d,QAAgBZ,cACpDuY,EAAUvY,UAAUyF,YAAc8S","file":"libphonenumber-js.min.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine(\"libphonenumber\", [], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"libphonenumber\"] = factory();\n\telse\n\t\troot[\"libphonenumber\"] = factory();\n})(window, function() {\nreturn "," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, {\n \t\t\t\tconfigurable: false,\n \t\t\t\tenumerable: true,\n \t\t\t\tget: getter\n \t\t\t});\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 29);\n","import { stripIDDPrefix } from './IDD';\nimport Metadata from './metadata';\n\nimport parseIncompletePhoneNumber from './parseIncompletePhoneNumber';\n\n// `DASHES` will be right after the opening square bracket of the \"character class\"\nvar DASHES = '-\\u2010-\\u2015\\u2212\\u30FC\\uFF0D';\nvar SLASHES = '\\uFF0F/';\nvar DOTS = '\\uFF0E.';\nexport var WHITESPACE = ' \\xA0\\xAD\\u200B\\u2060\\u3000';\nvar BRACKETS = '()\\uFF08\\uFF09\\uFF3B\\uFF3D\\\\[\\\\]';\n// export const OPENING_BRACKETS = '(\\uFF08\\uFF3B\\\\\\['\nvar TILDES = '~\\u2053\\u223C\\uFF5E';\n\n// Digits accepted in phone numbers\n// (ascii, fullwidth, arabic-indic, and eastern arabic digits).\nexport var VALID_DIGITS = '0-9\\uFF10-\\uFF19\\u0660-\\u0669\\u06F0-\\u06F9';\n\n// Regular expression of acceptable punctuation found in phone numbers. This\n// excludes punctuation found as a leading character only. This consists of dash\n// characters, white space characters, full stops, slashes, square brackets,\n// parentheses and tildes. Full-width variants are also present.\nexport var VALID_PUNCTUATION = '' + DASHES + SLASHES + DOTS + WHITESPACE + BRACKETS + TILDES;\n\nexport var PLUS_CHARS = '+\\uFF0B';\nvar LEADING_PLUS_CHARS_PATTERN = new RegExp('^[' + PLUS_CHARS + ']+');\n\n// The ITU says the maximum length should be 15,\n// but one can find longer numbers in Germany.\nexport var MAX_LENGTH_FOR_NSN = 17;\n\n// The maximum length of the country calling code.\nexport var MAX_LENGTH_COUNTRY_CODE = 3;\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\t'0': '0',\n\t'1': '1',\n\t'2': '2',\n\t'3': '3',\n\t'4': '4',\n\t'5': '5',\n\t'6': '6',\n\t'7': '7',\n\t'8': '8',\n\t'9': '9',\n\t'\\uFF10': '0', // Fullwidth digit 0\n\t'\\uFF11': '1', // Fullwidth digit 1\n\t'\\uFF12': '2', // Fullwidth digit 2\n\t'\\uFF13': '3', // Fullwidth digit 3\n\t'\\uFF14': '4', // Fullwidth digit 4\n\t'\\uFF15': '5', // Fullwidth digit 5\n\t'\\uFF16': '6', // Fullwidth digit 6\n\t'\\uFF17': '7', // Fullwidth digit 7\n\t'\\uFF18': '8', // Fullwidth digit 8\n\t'\\uFF19': '9', // Fullwidth digit 9\n\t'\\u0660': '0', // Arabic-indic digit 0\n\t'\\u0661': '1', // Arabic-indic digit 1\n\t'\\u0662': '2', // Arabic-indic digit 2\n\t'\\u0663': '3', // Arabic-indic digit 3\n\t'\\u0664': '4', // Arabic-indic digit 4\n\t'\\u0665': '5', // Arabic-indic digit 5\n\t'\\u0666': '6', // Arabic-indic digit 6\n\t'\\u0667': '7', // Arabic-indic digit 7\n\t'\\u0668': '8', // Arabic-indic digit 8\n\t'\\u0669': '9', // Arabic-indic digit 9\n\t'\\u06F0': '0', // Eastern-Arabic digit 0\n\t'\\u06F1': '1', // Eastern-Arabic digit 1\n\t'\\u06F2': '2', // Eastern-Arabic digit 2\n\t'\\u06F3': '3', // Eastern-Arabic digit 3\n\t'\\u06F4': '4', // Eastern-Arabic digit 4\n\t'\\u06F5': '5', // Eastern-Arabic digit 5\n\t'\\u06F6': '6', // Eastern-Arabic digit 6\n\t'\\u06F7': '7', // Eastern-Arabic digit 7\n\t'\\u06F8': '8', // Eastern-Arabic digit 8\n\t'\\u06F9': '9' // Eastern-Arabic digit 9\n};\n\nexport function parseDigit(character) {\n\treturn DIGITS[character];\n}\n\n// Parses a formatted phone number\n// and returns `{ countryCallingCode, number }`\n// where `number` is just the \"number\" part\n// which is left after extracting `countryCallingCode`\n// and is not necessarily a \"national (significant) number\"\n// and might as well contain national prefix.\n//\nexport function extractCountryCallingCode(number, country, metadata) {\n\tnumber = parseIncompletePhoneNumber(number);\n\n\tif (!number) {\n\t\treturn {};\n\t}\n\n\t// If this is not an international phone number,\n\t// then don't extract country phone code.\n\tif (number[0] !== '+') {\n\t\t// Convert an \"out-of-country\" dialing phone number\n\t\t// to a proper international phone number.\n\t\tvar numberWithoutIDD = stripIDDPrefix(number, country, metadata);\n\n\t\t// If an IDD prefix was stripped then\n\t\t// convert the number to international one\n\t\t// for subsequent parsing.\n\t\tif (numberWithoutIDD && numberWithoutIDD !== number) {\n\t\t\tnumber = '+' + numberWithoutIDD;\n\t\t} else {\n\t\t\treturn { number: number };\n\t\t}\n\t}\n\n\t// Fast abortion: country codes do not begin with a '0'\n\tif (number[1] === '0') {\n\t\treturn {};\n\t}\n\n\tmetadata = new Metadata(metadata);\n\n\t// The thing with country phone codes\n\t// is that they are orthogonal to each other\n\t// i.e. there's no such country phone code A\n\t// for which country phone code B exists\n\t// where B starts with A.\n\t// Therefore, while scanning digits,\n\t// if a valid country code is found,\n\t// that means that it is the country code.\n\t//\n\tvar i = 2;\n\twhile (i - 1 <= MAX_LENGTH_COUNTRY_CODE && i <= number.length) {\n\t\tvar countryCallingCode = number.slice(1, i);\n\n\t\tif (metadata.countryCallingCodes()[countryCallingCode]) {\n\t\t\treturn {\n\t\t\t\tcountryCallingCode: countryCallingCode,\n\t\t\t\tnumber: number.slice(i)\n\t\t\t};\n\t\t}\n\n\t\ti++;\n\t}\n\n\treturn {};\n}\n\n// Checks whether the entire input sequence can be matched\n// against the regular expression.\nexport function matches_entirely() {\n\tvar text = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';\n\tvar regular_expression = arguments[1];\n\n\treturn new RegExp('^(?:' + regular_expression + ')$').test(text);\n}\n\n// The RFC 3966 format for extensions.\nvar RFC3966_EXTN_PREFIX = ';ext=';\n\n// Pattern to capture digits used in an extension.\n// Places a maximum length of '7' for an extension.\nvar CAPTURING_EXTN_DIGITS = '([' + VALID_DIGITS + ']{1,7})';\n\n/**\n * Regexp of all possible ways to write extensions, for use when parsing. This\n * will be run as a case-insensitive regexp match. Wide character versions are\n * also provided after each ASCII version. There are three regular expressions\n * here. The first covers RFC 3966 format, where the extension is added using\n * ';ext='. The second more generic one starts with optional white space and\n * ends with an optional full stop (.), followed by zero or more spaces/tabs\n * /commas and then the numbers themselves. The other one covers the special\n * case of American numbers where the extension is written with a hash at the\n * end, such as '- 503#'. Note that the only capturing groups should be around\n * the digits that you want to capture as part of the extension, or else parsing\n * will fail! We allow two options for representing the accented o - the\n * character itself, and one in the unicode decomposed form with the combining\n * acute accent.\n */\nexport function create_extension_pattern(purpose) {\n\t// One-character symbols that can be used to indicate an extension.\n\tvar single_extension_characters = 'x\\uFF58#\\uFF03~\\uFF5E';\n\n\tswitch (purpose) {\n\t\t// For parsing, we are slightly more lenient in our interpretation than for matching. Here we\n\t\t// allow \"comma\" and \"semicolon\" as possible extension indicators. When matching, these are\n\t\tcase 'parsing':\n\t\t\tsingle_extension_characters = ',;' + single_extension_characters;\n\t}\n\n\treturn RFC3966_EXTN_PREFIX + CAPTURING_EXTN_DIGITS + '|' + '[ \\xA0\\\\t,]*' + '(?:e?xt(?:ensi(?:o\\u0301?|\\xF3))?n?|\\uFF45?\\uFF58\\uFF54\\uFF4E?|' +\n\t// \"доб.\"\n\t'\\u0434\\u043E\\u0431|' + '[' + single_extension_characters + ']|int|anexo|\\uFF49\\uFF4E\\uFF54)' + '[:\\\\.\\uFF0E]?[ \\xA0\\\\t,-]*' + CAPTURING_EXTN_DIGITS + '#?|' + '[- ]+([' + VALID_DIGITS + ']{1,5})#';\n}\n//# sourceMappingURL=common.js.map","var _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; };\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nimport compare from 'semver-compare';\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\nvar DEFAULT_EXT_PREFIX = ' ext. ';\n\nvar Metadata = function () {\n\tfunction Metadata(metadata) {\n\t\t_classCallCheck(this, Metadata);\n\n\t\tvalidateMetadata(metadata);\n\n\t\tthis.metadata = metadata;\n\n\t\tthis.v1 = !metadata.version;\n\t\tthis.v2 = metadata.version !== undefined && compare(metadata.version, V3) === -1;\n\t\tthis.v3 = metadata.version !== undefined; // && compare(metadata.version, V4) === -1\n\t}\n\n\t_createClass(Metadata, [{\n\t\tkey: 'hasCountry',\n\t\tvalue: function hasCountry(country) {\n\t\t\treturn this.metadata.countries[country] !== undefined;\n\t\t}\n\t}, {\n\t\tkey: 'country',\n\t\tvalue: function country(_country) {\n\t\t\tif (!_country) {\n\t\t\t\tthis._country = undefined;\n\t\t\t\tthis.country_metadata = undefined;\n\t\t\t\treturn this;\n\t\t\t}\n\n\t\t\tif (!this.hasCountry(_country)) {\n\t\t\t\tthrow new Error('Unknown country: ' + _country);\n\t\t\t}\n\n\t\t\tthis._country = _country;\n\t\t\tthis.country_metadata = this.metadata.countries[_country];\n\t\t\treturn this;\n\t\t}\n\t}, {\n\t\tkey: 'getDefaultCountryMetadataForRegion',\n\t\tvalue: function getDefaultCountryMetadataForRegion() {\n\t\t\treturn this.metadata.countries[this.countryCallingCodes()[this.countryCallingCode()][0]];\n\t\t}\n\t}, {\n\t\tkey: 'countryCallingCode',\n\t\tvalue: function countryCallingCode() {\n\t\t\treturn this.country_metadata[0];\n\t\t}\n\t}, {\n\t\tkey: 'IDDPrefix',\n\t\tvalue: function IDDPrefix() {\n\t\t\tif (this.v1 || this.v2) return;\n\t\t\treturn this.country_metadata[1];\n\t\t}\n\t}, {\n\t\tkey: 'defaultIDDPrefix',\n\t\tvalue: function defaultIDDPrefix() {\n\t\t\tif (this.v1 || this.v2) return;\n\t\t\treturn this.country_metadata[12];\n\t\t}\n\t}, {\n\t\tkey: 'nationalNumberPattern',\n\t\tvalue: function nationalNumberPattern() {\n\t\t\tif (this.v1 || this.v2) return this.country_metadata[1];\n\t\t\treturn this.country_metadata[2];\n\t\t}\n\t}, {\n\t\tkey: 'possibleLengths',\n\t\tvalue: function possibleLengths() {\n\t\t\tif (this.v1) return;\n\t\t\treturn this.country_metadata[this.v2 ? 2 : 3];\n\t\t}\n\t}, {\n\t\tkey: '_getFormats',\n\t\tvalue: function _getFormats(country_metadata) {\n\t\t\treturn country_metadata[this.v1 ? 2 : this.v2 ? 3 : 4];\n\t\t}\n\n\t\t// For countries of the same region (e.g. NANPA)\n\t\t// formats are all stored in the \"main\" country for that region.\n\t\t// E.g. \"RU\" and \"KZ\", \"US\" and \"CA\".\n\n\t}, {\n\t\tkey: 'formats',\n\t\tvalue: function formats() {\n\t\t\tvar _this = this;\n\n\t\t\tvar formats = this._getFormats(this.country_metadata) || this._getFormats(this.getDefaultCountryMetadataForRegion()) || [];\n\t\t\treturn formats.map(function (_) {\n\t\t\t\treturn new Format(_, _this);\n\t\t\t});\n\t\t}\n\t}, {\n\t\tkey: 'nationalPrefix',\n\t\tvalue: function nationalPrefix() {\n\t\t\treturn this.country_metadata[this.v1 ? 3 : this.v2 ? 4 : 5];\n\t\t}\n\t}, {\n\t\tkey: '_getNationalPrefixFormattingRule',\n\t\tvalue: function _getNationalPrefixFormattingRule(country_metadata) {\n\t\t\treturn country_metadata[this.v1 ? 4 : this.v2 ? 5 : 6];\n\t\t}\n\n\t\t// For countries of the same region (e.g. NANPA)\n\t\t// national prefix formatting rule is stored in the \"main\" country for that region.\n\t\t// E.g. \"RU\" and \"KZ\", \"US\" and \"CA\".\n\n\t}, {\n\t\tkey: 'nationalPrefixFormattingRule',\n\t\tvalue: function nationalPrefixFormattingRule() {\n\t\t\treturn this._getNationalPrefixFormattingRule(this.country_metadata) || this._getNationalPrefixFormattingRule(this.getDefaultCountryMetadataForRegion());\n\t\t}\n\t}, {\n\t\tkey: 'nationalPrefixForParsing',\n\t\tvalue: function nationalPrefixForParsing() {\n\t\t\t// If `national_prefix_for_parsing` is not set explicitly,\n\t\t\t// then infer it from `national_prefix` (if any)\n\t\t\treturn this.country_metadata[this.v1 ? 5 : this.v2 ? 6 : 7] || this.nationalPrefix();\n\t\t}\n\t}, {\n\t\tkey: 'nationalPrefixTransformRule',\n\t\tvalue: function nationalPrefixTransformRule() {\n\t\t\treturn this.country_metadata[this.v1 ? 6 : this.v2 ? 7 : 8];\n\t\t}\n\t}, {\n\t\tkey: '_getNationalPrefixIsOptionalWhenFormatting',\n\t\tvalue: function _getNationalPrefixIsOptionalWhenFormatting() {\n\t\t\treturn !!this.country_metadata[this.v1 ? 7 : this.v2 ? 8 : 9];\n\t\t}\n\n\t\t// For countries of the same region (e.g. NANPA)\n\t\t// \"national prefix is optional when parsing\" flag is\n\t\t// stored in the \"main\" country for that region.\n\t\t// E.g. \"RU\" and \"KZ\", \"US\" and \"CA\".\n\n\t}, {\n\t\tkey: 'nationalPrefixIsOptionalWhenFormatting',\n\t\tvalue: function nationalPrefixIsOptionalWhenFormatting() {\n\t\t\treturn this._getNationalPrefixIsOptionalWhenFormatting(this.country_metadata) || this._getNationalPrefixIsOptionalWhenFormatting(this.getDefaultCountryMetadataForRegion());\n\t\t}\n\t}, {\n\t\tkey: 'leadingDigits',\n\t\tvalue: function leadingDigits() {\n\t\t\treturn this.country_metadata[this.v1 ? 8 : this.v2 ? 9 : 10];\n\t\t}\n\t}, {\n\t\tkey: 'types',\n\t\tvalue: function types() {\n\t\t\treturn this.country_metadata[this.v1 ? 9 : this.v2 ? 10 : 11];\n\t\t}\n\t}, {\n\t\tkey: 'hasTypes',\n\t\tvalue: function hasTypes() {\n\t\t\t// Versions 1.2.0 - 1.2.4: can be `[]`.\n\t\t\t/* istanbul ignore next */\n\t\t\tif (this.types() && this.types().length === 0) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t// Versions <= 1.2.4: can be `undefined`.\n\t\t\t// Version >= 1.2.5: can be `0`.\n\t\t\treturn !!this.types();\n\t\t}\n\t}, {\n\t\tkey: 'type',\n\t\tvalue: function type(_type) {\n\t\t\tif (this.hasTypes() && getType(this.types(), _type)) {\n\t\t\t\treturn new Type(getType(this.types(), _type), this);\n\t\t\t}\n\t\t}\n\t}, {\n\t\tkey: 'ext',\n\t\tvalue: function ext() {\n\t\t\tif (this.v1 || this.v2) return DEFAULT_EXT_PREFIX;\n\t\t\treturn this.country_metadata[13] || DEFAULT_EXT_PREFIX;\n\t\t}\n\t}, {\n\t\tkey: 'countryCallingCodes',\n\t\tvalue: function countryCallingCodes() {\n\t\t\tif (this.v1) return this.metadata.country_phone_code_to_countries;\n\t\t\treturn this.metadata.country_calling_codes;\n\t\t}\n\n\t\t// Formatting information for regions which share\n\t\t// a country calling code is contained by only one region\n\t\t// for performance reasons. For example, for NANPA region\n\t\t// (\"North American Numbering Plan Administration\",\n\t\t// which includes USA, Canada, Cayman Islands, Bahamas, etc)\n\t\t// it will be contained in the metadata for `US`.\n\t\t//\n\t\t// `country_calling_code` is always valid.\n\t\t// But the actual country may not necessarily be part of the metadata.\n\t\t//\n\n\t}, {\n\t\tkey: 'chooseCountryByCountryCallingCode',\n\t\tvalue: function chooseCountryByCountryCallingCode(country_calling_code) {\n\t\t\tvar country = this.countryCallingCodes()[country_calling_code][0];\n\n\t\t\t// Do not want to test this case.\n\t\t\t// (custom metadata, not all countries).\n\t\t\t/* istanbul ignore else */\n\t\t\tif (this.hasCountry(country)) {\n\t\t\t\tthis.country(country);\n\t\t\t}\n\t\t}\n\t}, {\n\t\tkey: 'selectedCountry',\n\t\tvalue: function selectedCountry() {\n\t\t\treturn this._country;\n\t\t}\n\t}]);\n\n\treturn Metadata;\n}();\n\nexport default Metadata;\n\nvar Format = function () {\n\tfunction Format(format, metadata) {\n\t\t_classCallCheck(this, Format);\n\n\t\tthis._format = format;\n\t\tthis.metadata = metadata;\n\t}\n\n\t_createClass(Format, [{\n\t\tkey: 'pattern',\n\t\tvalue: function pattern() {\n\t\t\treturn this._format[0];\n\t\t}\n\t}, {\n\t\tkey: 'format',\n\t\tvalue: function format() {\n\t\t\treturn this._format[1];\n\t\t}\n\t}, {\n\t\tkey: 'leadingDigitsPatterns',\n\t\tvalue: function leadingDigitsPatterns() {\n\t\t\treturn this._format[2] || [];\n\t\t}\n\t}, {\n\t\tkey: 'nationalPrefixFormattingRule',\n\t\tvalue: function nationalPrefixFormattingRule() {\n\t\t\treturn this._format[3] || this.metadata.nationalPrefixFormattingRule();\n\t\t}\n\t}, {\n\t\tkey: 'nationalPrefixIsOptionalWhenFormatting',\n\t\tvalue: function nationalPrefixIsOptionalWhenFormatting() {\n\t\t\treturn !!this._format[4] || this.metadata.nationalPrefixIsOptionalWhenFormatting();\n\t\t}\n\t}, {\n\t\tkey: 'nationalPrefixIsMandatoryWhenFormatting',\n\t\tvalue: function nationalPrefixIsMandatoryWhenFormatting() {\n\t\t\t// National prefix is omitted if there's no national prefix formatting rule\n\t\t\t// set for this country, or when the national prefix formatting rule\n\t\t\t// contains no national prefix itself, or when this rule is set but\n\t\t\t// national prefix is optional for this phone number format\n\t\t\t// (and it is not enforced explicitly)\n\t\t\treturn this.nationalPrefixFormattingRule() &&\n\t\t\t// Check that national prefix formatting rule is not a dummy one.\n\t\t\t// Check that national prefix formatting rule actually has national prefix digit(s).\n\t\t\tthis.usesNationalPrefix() &&\n\t\t\t// Or maybe national prefix is optional for this format\n\t\t\t!this.nationalPrefixIsOptionalWhenFormatting();\n\t\t}\n\n\t\t// Checks whether national prefix formatting rule contains national prefix\n\n\t}, {\n\t\tkey: 'usesNationalPrefix',\n\t\tvalue: function usesNationalPrefix() {\n\t\t\t// Check that national prefix formatting rule is not a dummy one\n\t\t\treturn this.nationalPrefixFormattingRule() !== '$1' &&\n\t\t\t// Check that national prefix formatting rule actually has national prefix digit(s)\n\t\t\t/\\d/.test(this.nationalPrefixFormattingRule().replace('$1', ''));\n\t\t}\n\t}, {\n\t\tkey: 'internationalFormat',\n\t\tvalue: function internationalFormat() {\n\t\t\treturn this._format[5] || this.format();\n\t\t}\n\t}]);\n\n\treturn Format;\n}();\n\nvar Type = function () {\n\tfunction Type(type, metadata) {\n\t\t_classCallCheck(this, Type);\n\n\t\tthis.type = type;\n\t\tthis.metadata = metadata;\n\t}\n\n\t_createClass(Type, [{\n\t\tkey: 'pattern',\n\t\tvalue: function pattern() {\n\t\t\tif (this.metadata.v1) return this.type;\n\t\t\treturn this.type[0];\n\t\t}\n\t}, {\n\t\tkey: 'possibleLengths',\n\t\tvalue: function possibleLengths() {\n\t\t\tif (this.metadata.v1) return;\n\t\t\treturn this.type[1] || this.metadata.possibleLengths();\n\t\t}\n\t}]);\n\n\treturn Type;\n}();\n\nfunction getType(types, type) {\n\tswitch (type) {\n\t\tcase 'FIXED_LINE':\n\t\t\treturn types[0];\n\t\tcase 'MOBILE':\n\t\t\treturn types[1];\n\t\tcase 'TOLL_FREE':\n\t\t\treturn types[2];\n\t\tcase 'PREMIUM_RATE':\n\t\t\treturn types[3];\n\t\tcase 'PERSONAL_NUMBER':\n\t\t\treturn types[4];\n\t\tcase 'VOICEMAIL':\n\t\t\treturn types[5];\n\t\tcase 'UAN':\n\t\t\treturn types[6];\n\t\tcase 'PAGER':\n\t\t\treturn types[7];\n\t\tcase 'VOIP':\n\t\t\treturn types[8];\n\t\tcase 'SHARED_COST':\n\t\t\treturn types[9];\n\t}\n}\n\nexport function validateMetadata(metadata) {\n\tif (!metadata) {\n\t\tthrow new Error('[libphonenumber-js] `metadata` argument not passed. Check your arguments.');\n\t}\n\n\t// `country_phone_code_to_countries` was renamed to\n\t// `country_calling_codes` in `1.0.18`.\n\tif (!is_object(metadata) || !is_object(metadata.countries) || !is_object(metadata.country_calling_codes) && !is_object(metadata.country_phone_code_to_countries)) {\n\t\tthrow new Error('[libphonenumber-js] `metadata` argument was passed but it\\'s not a valid metadata. Must be an object having `.countries` and `.country_calling_codes` child object properties. Got ' + (is_object(metadata) ? 'an object of shape: { ' + Object.keys(metadata).join(', ') + ' }' : 'a ' + type_of(metadata) + ': ' + metadata) + '.');\n\t}\n}\n\n// Babel transforms `typeof` into some \"branches\"\n// so istanbul will show this as \"branch not covered\".\n/* istanbul ignore next */\nvar is_object = function is_object(_) {\n\treturn (typeof _ === 'undefined' ? 'undefined' : _typeof(_)) === 'object';\n};\n\n// Babel transforms `typeof` into some \"branches\"\n// so istanbul will show this as \"branch not covered\".\n/* istanbul ignore next */\nvar type_of = function type_of(_) {\n\treturn typeof _ === 'undefined' ? 'undefined' : _typeof(_);\n};\n\nexport function getExtPrefix(country, metadata) {\n\treturn new Metadata(metadata).country(country).ext();\n}\n//# sourceMappingURL=metadata.js.map","var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };\n\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; };\n\n// This is a port of Google Android `libphonenumber`'s\n// `phonenumberutil.js` of 17th November, 2016.\n//\n// https://github.com/googlei18n/libphonenumber/commits/master/javascript/i18n/phonenumbers/phonenumberutil.js\n\nimport { extractCountryCallingCode, VALID_DIGITS, VALID_PUNCTUATION, PLUS_CHARS, MAX_LENGTH_FOR_NSN, matches_entirely, create_extension_pattern } from './common';\n\nimport parseIncompletePhoneNumber from './parseIncompletePhoneNumber';\n\nimport Metadata from './metadata';\n\nimport getCountryCallingCode from './getCountryCallingCode';\n\nimport get_number_type, { check_number_length_for_type } from './getNumberType';\n\nimport { is_possible_number } from './isPossibleNumber';\n\nimport { parseRFC3966 } from './RFC3966';\n\nimport PhoneNumber from './PhoneNumber';\n\n// The minimum length of the national significant number.\nvar MIN_LENGTH_FOR_NSN = 2;\n\n// We don't allow input strings for parsing to be longer than 250 chars.\n// This prevents malicious input from consuming CPU.\nvar MAX_INPUT_STRING_LENGTH = 250;\n\n/**\n * Regexp of all possible ways to write extensions, for use when parsing. This\n * will be run as a case-insensitive regexp match. Wide character versions are\n * also provided after each ASCII version. There are three regular expressions\n * here. The first covers RFC 3966 format, where the extension is added using\n * ';ext='. The second more generic one starts with optional white space and\n * ends with an optional full stop (.), followed by zero or more spaces/tabs\n * /commas and then the numbers themselves. The other one covers the special\n * case of American numbers where the extension is written with a hash at the\n * end, such as '- 503#'. Note that the only capturing groups should be around\n * the digits that you want to capture as part of the extension, or else parsing\n * will fail! We allow two options for representing the accented o - the\n * character itself, and one in the unicode decomposed form with the combining\n * acute accent.\n */\nvar EXTN_PATTERNS_FOR_PARSING = create_extension_pattern('parsing');\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('(?:' + EXTN_PATTERNS_FOR_PARSING + ')$', 'i');\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//\nvar VALID_PHONE_NUMBER = '[' + PLUS_CHARS + ']{0,1}' + '(?:' + '[' + VALID_PUNCTUATION + ']*' + '[' + VALID_DIGITS + ']' + '){3,}' + '[' + VALID_PUNCTUATION + VALID_DIGITS + ']*';\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 +\n// Phone number extensions\n'(?:' + EXTN_PATTERNS_FOR_PARSING + ')?' + '$', 'i');\n\n// This consists of the plus symbol, digits, and arabic-indic digits.\nvar PHONE_NUMBER_START_PATTERN = new RegExp('[' + PLUS_CHARS + VALID_DIGITS + ']');\n\n// Regular expression of trailing characters that we want to remove.\nvar AFTER_PHONE_NUMBER_END_PATTERN = new RegExp('[^' + VALID_DIGITS + ']+$');\n\nvar default_options = {\n\tcountry: {}\n\n\t// `options`:\n\t// {\n\t// country:\n\t// {\n\t// restrict - (a two-letter country code)\n\t// the phone number must be in this country\n\t//\n\t// default - (a two-letter country code)\n\t// default country to use for phone number parsing and validation\n\t// (if no country code could be derived from the phone number)\n\t// }\n\t// }\n\t//\n\t// Returns `{ country, number }`\n\t//\n\t// Example use cases:\n\t//\n\t// ```js\n\t// parse('8 (800) 555-35-35', 'RU')\n\t// parse('8 (800) 555-35-35', 'RU', metadata)\n\t// parse('8 (800) 555-35-35', { country: { default: 'RU' } })\n\t// parse('8 (800) 555-35-35', { country: { default: 'RU' } }, metadata)\n\t// parse('+7 800 555 35 35')\n\t// parse('+7 800 555 35 35', metadata)\n\t// ```\n\t//\n};export default function parse(arg_1, arg_2, arg_3, arg_4) {\n\tvar _sort_out_arguments = sort_out_arguments(arg_1, arg_2, arg_3, arg_4),\n\t text = _sort_out_arguments.text,\n\t options = _sort_out_arguments.options,\n\t metadata = _sort_out_arguments.metadata;\n\n\t// Validate `defaultCountry`.\n\n\n\tif (options.defaultCountry && !metadata.hasCountry(options.defaultCountry)) {\n\t\tif (options.v2) {\n\t\t\tthrow new Error('INVALID_COUNTRY');\n\t\t}\n\t\tthrow new Error('Unknown country: ' + options.defaultCountry);\n\t}\n\n\t// Parse the phone number.\n\n\tvar _parse_input = parse_input(text, options.v2),\n\t formatted_phone_number = _parse_input.number,\n\t ext = _parse_input.ext;\n\n\t// If the phone number is not viable then return nothing.\n\n\n\tif (!formatted_phone_number) {\n\t\tif (options.v2) {\n\t\t\tthrow new Error('NOT_A_NUMBER');\n\t\t}\n\t\treturn {};\n\t}\n\n\tvar _parse_phone_number = parse_phone_number(formatted_phone_number, options.defaultCountry, metadata),\n\t country = _parse_phone_number.country,\n\t nationalNumber = _parse_phone_number.national_number,\n\t countryCallingCode = _parse_phone_number.countryCallingCode,\n\t carrierCode = _parse_phone_number.carrierCode;\n\n\tif (!metadata.selectedCountry()) {\n\t\tif (options.v2) {\n\t\t\tthrow new Error('INVALID_COUNTRY');\n\t\t}\n\t\treturn {};\n\t}\n\n\t// Validate national (significant) number length.\n\tif (nationalNumber.length < MIN_LENGTH_FOR_NSN) {\n\t\t// Won't throw here because the regexp already demands length > 1.\n\t\t/* istanbul ignore if */\n\t\tif (options.v2) {\n\t\t\tthrow new Error('TOO_SHORT');\n\t\t}\n\t\t// Google's demo just throws an error in this case.\n\t\treturn {};\n\t}\n\n\t// Validate national (significant) number length.\n\t//\n\t// A sidenote:\n\t//\n\t// They say that sometimes national (significant) numbers\n\t// can be longer than `MAX_LENGTH_FOR_NSN` (e.g. in Germany).\n\t// https://github.com/googlei18n/libphonenumber/blob/7e1748645552da39c4e1ba731e47969d97bdb539/resources/phonenumber.proto#L36\n\t// Such numbers will just be discarded.\n\t//\n\tif (nationalNumber.length > MAX_LENGTH_FOR_NSN) {\n\t\tif (options.v2) {\n\t\t\tthrow new Error('TOO_LONG');\n\t\t}\n\t\t// Google's demo just throws an error in this case.\n\t\treturn {};\n\t}\n\n\tif (options.v2) {\n\t\tvar phoneNumber = new PhoneNumber(countryCallingCode, nationalNumber, metadata.metadata);\n\n\t\tif (country) {\n\t\t\tphoneNumber.country = country;\n\t\t}\n\t\tif (carrierCode) {\n\t\t\tphoneNumber.carrierCode = carrierCode;\n\t\t}\n\t\tif (ext) {\n\t\t\tphoneNumber.ext = ext;\n\t\t}\n\n\t\treturn phoneNumber;\n\t}\n\n\t// Check if national phone number pattern matches the number\n\t// National number pattern is different for each country,\n\t// even for those ones which are part of the \"NANPA\" group.\n\tvar valid = country && matches_entirely(nationalNumber, metadata.nationalNumberPattern()) ? true : false;\n\n\tif (!options.extended) {\n\t\treturn valid ? result(country, nationalNumber, ext) : {};\n\t}\n\n\treturn {\n\t\tcountry: country,\n\t\tcountryCallingCode: countryCallingCode,\n\t\tcarrierCode: carrierCode,\n\t\tvalid: valid,\n\t\tpossible: valid ? true : options.extended === true && metadata.possibleLengths() && is_possible_number(nationalNumber, countryCallingCode !== undefined, metadata),\n\t\tphone: nationalNumber,\n\t\text: ext\n\t};\n}\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 function is_viable_phone_number(number) {\n\treturn number.length >= MIN_LENGTH_FOR_NSN && VALID_PHONE_NUMBER_PATTERN.test(number);\n}\n\n/**\n * Extracts a parseable phone number.\n * @param {string} text - Input.\n * @return {string}.\n */\nexport function extract_formatted_phone_number(text, v2) {\n\tif (!text) {\n\t\treturn;\n\t}\n\n\tif (text.length > MAX_INPUT_STRING_LENGTH) {\n\t\tif (v2) {\n\t\t\tthrow new Error('TOO_LONG');\n\t\t}\n\t\treturn;\n\t}\n\n\t// Attempt to extract a possible number from the string passed in\n\n\tvar starts_at = text.search(PHONE_NUMBER_START_PATTERN);\n\n\tif (starts_at < 0) {\n\t\treturn;\n\t}\n\n\treturn text\n\t// Trim everything to the left of the phone number\n\t.slice(starts_at)\n\t// Remove trailing non-numerical characters\n\t.replace(AFTER_PHONE_NUMBER_END_PATTERN, '');\n}\n\n// Strips any national prefix (such as 0, 1) present in the 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.\nexport function strip_national_prefix_and_carrier_code(number, metadata) {\n\tif (!number || !metadata.nationalPrefixForParsing()) {\n\t\treturn { number: number };\n\t}\n\n\t// Attempt to parse the first digits as a national prefix\n\tvar national_prefix_pattern = new RegExp('^(?:' + metadata.nationalPrefixForParsing() + ')');\n\tvar national_prefix_matcher = national_prefix_pattern.exec(number);\n\n\t// If no national prefix is present in the phone number,\n\t// but the national prefix is optional for this country,\n\t// then consider this phone number valid.\n\t//\n\t// Google's reference `libphonenumber` implementation\n\t// wouldn't recognize such phone numbers as valid,\n\t// but I think it would perfectly make sense\n\t// to consider such phone numbers as valid\n\t// because if a national phone number was originally\n\t// formatted without the national prefix\n\t// then it must be parseable back into the original national number.\n\t// In other words, `parse(format(number))`\n\t// must always be equal to `number`.\n\t//\n\tif (!national_prefix_matcher) {\n\t\treturn { number: number };\n\t}\n\n\tvar national_significant_number = void 0;\n\n\t// `national_prefix_for_parsing` capturing groups\n\t// (used only for really messy cases: Argentina, Brazil, Mexico, Somalia)\n\tvar captured_groups_count = national_prefix_matcher.length - 1;\n\n\t// If the national number tranformation is needed then do it.\n\t//\n\t// I don't know what did they mean by `&& national_prefix_matcher[captured_groups_count]`.\n\t// https://github.com/googlei18n/libphonenumber/blob/d978e59c2e6b1ddfb6816cd190e1b62d9a96bc3b/javascript/i18n/phonenumbers/phonenumberutil.js#L3885\n\t// https://github.com/googlei18n/libphonenumber/blob/d978e59c2e6b1ddfb6816cd190e1b62d9a96bc3b/java/libphonenumber/src/com/google/i18n/phonenumbers/PhoneNumberUtil.java#L2906\n\t//\n\tif (metadata.nationalPrefixTransformRule() && national_prefix_matcher[captured_groups_count]) {\n\t\tnational_significant_number = number.replace(national_prefix_pattern, metadata.nationalPrefixTransformRule());\n\t}\n\t// Else, no transformation is necessary,\n\t// and just strip the national prefix.\n\telse {\n\t\t\tnational_significant_number = number.slice(national_prefix_matcher[0].length);\n\t\t}\n\n\tvar carrierCode = void 0;\n\tif (captured_groups_count > 0) {\n\t\tcarrierCode = national_prefix_matcher[1];\n\t}\n\n\t// The following is done in `get_country_and_national_number_for_local_number()` instead.\n\t//\n\t// // Verify the parsed national (significant) number for this country\n\t// const national_number_rule = new RegExp(metadata.nationalNumberPattern())\n\t// //\n\t// // If the original number (before stripping national prefix) was viable,\n\t// // and the resultant number is not, then prefer the original phone number.\n\t// // This is because for some countries (e.g. Russia) the same digit could be both\n\t// // a national prefix and a leading digit of a valid national phone number,\n\t// // like `8` is the national prefix for Russia and both\n\t// // `8 800 555 35 35` and `800 555 35 35` are valid numbers.\n\t// if (matches_entirely(number, national_number_rule) &&\n\t// \t\t!matches_entirely(national_significant_number, national_number_rule))\n\t// {\n\t// \treturn number\n\t// }\n\n\t// Return the parsed national (significant) number\n\treturn {\n\t\tnumber: national_significant_number,\n\t\tcarrierCode: carrierCode\n\t};\n}\n\nexport function find_country_code(country_calling_code, national_phone_number, metadata) {\n\t// Is always non-empty, because `country_calling_code` is always valid\n\tvar possible_countries = metadata.countryCallingCodes()[country_calling_code];\n\n\t// If there's just one country corresponding to the country code,\n\t// then just return it, without further phone number digits validation.\n\tif (possible_countries.length === 1) {\n\t\treturn possible_countries[0];\n\t}\n\n\treturn _find_country_code(possible_countries, national_phone_number, metadata.metadata);\n}\n\n// Changes `metadata` `country`.\nfunction _find_country_code(possible_countries, national_phone_number, metadata) {\n\tmetadata = new Metadata(metadata);\n\n\tfor (var _iterator = possible_countries, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {\n\t\tvar _ref;\n\n\t\tif (_isArray) {\n\t\t\tif (_i >= _iterator.length) break;\n\t\t\t_ref = _iterator[_i++];\n\t\t} else {\n\t\t\t_i = _iterator.next();\n\t\t\tif (_i.done) break;\n\t\t\t_ref = _i.value;\n\t\t}\n\n\t\tvar country = _ref;\n\n\t\tmetadata.country(country);\n\n\t\t// Leading digits check would be the simplest one\n\t\tif (metadata.leadingDigits()) {\n\t\t\tif (national_phone_number && national_phone_number.search(metadata.leadingDigits()) === 0) {\n\t\t\t\treturn country;\n\t\t\t}\n\t\t}\n\t\t// Else perform full validation with all of those\n\t\t// fixed-line/mobile/etc regular expressions.\n\t\telse if (get_number_type({ phone: national_phone_number, country: country }, metadata.metadata)) {\n\t\t\t\treturn country;\n\t\t\t}\n\t}\n}\n\n// Sort out arguments\nfunction sort_out_arguments(arg_1, arg_2, arg_3, arg_4) {\n\tvar text = void 0;\n\tvar options = void 0;\n\tvar metadata = void 0;\n\n\t// If the phone number is passed as a string.\n\t// `parse('88005553535', ...)`.\n\tif (typeof arg_1 === 'string') {\n\t\ttext = arg_1;\n\t} else throw new TypeError('A phone number for parsing must be a string.');\n\n\t// If \"default country\" argument is being passed\n\t// then move it to `options`.\n\t// `parse('88005553535', 'RU', [options], metadata)`.\n\tif ((typeof arg_2 === 'undefined' ? 'undefined' : _typeof(arg_2)) !== 'object') {\n\t\tif (arg_4) {\n\t\t\toptions = _extends({ defaultCountry: arg_2 }, arg_3);\n\t\t\tmetadata = arg_4;\n\t\t} else {\n\t\t\toptions = { defaultCountry: arg_2 };\n\t\t\tmetadata = arg_3;\n\t\t}\n\t}\n\t// No \"default country\" argument is being passed.\n\t// International phone number is passed.\n\t// `parse('+78005553535', [options], metadata)`.\n\telse {\n\t\t\tif (arg_3) {\n\t\t\t\toptions = arg_2;\n\t\t\t\tmetadata = arg_3;\n\t\t\t} else {\n\t\t\t\tmetadata = arg_2;\n\t\t\t}\n\t\t}\n\n\t// Apply default options.\n\tif (options) {\n\t\toptions = _extends({}, default_options, options);\n\t} else {\n\t\toptions = default_options;\n\t}\n\n\treturn { text: text, options: options, metadata: new Metadata(metadata) };\n}\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.\nfunction strip_extension(number) {\n\tvar start = number.search(EXTN_PATTERN);\n\tif (start < 0) {\n\t\treturn {};\n\t}\n\n\t// If we find a potential extension, and the number preceding this is a viable\n\t// number, we assume it is an extension.\n\tvar number_without_extension = number.slice(0, start);\n\t/* istanbul ignore if - seems a bit of a redundant check */\n\tif (!is_viable_phone_number(number_without_extension)) {\n\t\treturn {};\n\t}\n\n\tvar matches = number.match(EXTN_PATTERN);\n\tvar i = 1;\n\twhile (i < matches.length) {\n\t\tif (matches[i] != null && matches[i].length > 0) {\n\t\t\treturn {\n\t\t\t\tnumber: number_without_extension,\n\t\t\t\text: matches[i]\n\t\t\t};\n\t\t}\n\t\ti++;\n\t}\n}\n\n/**\n * @param {string} text - Input.\n * @return {object} `{ ?number, ?ext }`.\n */\nfunction parse_input(text, v2) {\n\t// Parse RFC 3966 phone number URI.\n\tif (text && text.indexOf('tel:') === 0) {\n\t\treturn parseRFC3966(text);\n\t}\n\n\tvar number = extract_formatted_phone_number(text, v2);\n\n\t// If the phone number is not viable, then abort.\n\tif (!number || !is_viable_phone_number(number)) {\n\t\treturn {};\n\t}\n\n\t// Attempt to parse extension first, since it doesn't require region-specific\n\t// data and we want to have the non-normalised number here.\n\tvar with_extension_stripped = strip_extension(number);\n\tif (with_extension_stripped.ext) {\n\t\treturn with_extension_stripped;\n\t}\n\n\treturn { number: number };\n}\n\n/**\n * Creates `parse()` result object.\n */\nfunction result(country, national_number, ext) {\n\tvar result = {\n\t\tcountry: country,\n\t\tphone: national_number\n\t};\n\n\tif (ext) {\n\t\tresult.ext = ext;\n\t}\n\n\treturn result;\n}\n\n/**\n * Parses a viable phone number.\n * Returns `{ country, countryCallingCode, national_number }`.\n */\nfunction parse_phone_number(formatted_phone_number, default_country, metadata) {\n\tvar _extractCountryCallin = extractCountryCallingCode(formatted_phone_number, default_country, metadata.metadata),\n\t countryCallingCode = _extractCountryCallin.countryCallingCode,\n\t number = _extractCountryCallin.number;\n\n\tif (!number) {\n\t\treturn { countryCallingCode: countryCallingCode };\n\t}\n\n\tvar country = void 0;\n\n\tif (countryCallingCode) {\n\t\tmetadata.chooseCountryByCountryCallingCode(countryCallingCode);\n\t} else if (default_country) {\n\t\tmetadata.country(default_country);\n\t\tcountry = default_country;\n\t\tcountryCallingCode = getCountryCallingCode(default_country, metadata.metadata);\n\t} else return {};\n\n\tvar _parse_national_numbe = parse_national_number(number, metadata),\n\t national_number = _parse_national_numbe.national_number,\n\t carrier_code = _parse_national_numbe.carrier_code;\n\n\t// Sometimes there are several countries\n\t// corresponding to the same country phone code\n\t// (e.g. NANPA countries all having `1` country phone code).\n\t// Therefore, to reliably determine the exact country,\n\t// national (significant) number should have been parsed first.\n\t//\n\t// When `metadata.json` is generated, all \"ambiguous\" country phone codes\n\t// get their countries populated with the full set of\n\t// \"phone number type\" regular expressions.\n\t//\n\n\n\tvar exactCountry = find_country_code(countryCallingCode, national_number, metadata);\n\tif (exactCountry) {\n\t\tcountry = exactCountry;\n\t\tmetadata.country(country);\n\t}\n\n\treturn {\n\t\tcountry: country,\n\t\tcountryCallingCode: countryCallingCode,\n\t\tnational_number: national_number,\n\t\tcarrierCode: carrier_code\n\t};\n}\n\nfunction parse_national_number(number, metadata) {\n\tvar national_number = parseIncompletePhoneNumber(number);\n\tvar carrier_code = void 0;\n\n\t// Only strip national prefixes for non-international phone numbers\n\t// because national prefixes can't be present in international phone numbers.\n\t// Otherwise, while forgiving, it would parse a NANPA number `+1 1877 215 5230`\n\t// first to `1877 215 5230` and then, stripping the leading `1`, to `877 215 5230`,\n\t// and then it would assume that's a valid number which it isn't.\n\t// So no forgiveness for grandmas here.\n\t// The issue asking for this fix:\n\t// https://github.com/catamphetamine/libphonenumber-js/issues/159\n\n\tvar _strip_national_prefi = strip_national_prefix_and_carrier_code(national_number, metadata),\n\t potential_national_number = _strip_national_prefi.number,\n\t carrierCode = _strip_national_prefi.carrierCode;\n\n\t// If metadata has \"possible lengths\" then employ the new algorythm.\n\n\n\tif (metadata.possibleLengths()) {\n\t\t// We require that the NSN remaining after stripping the national prefix and\n\t\t// carrier code be long enough to be a possible length for the region.\n\t\t// Otherwise, we don't do the stripping, since the original number could be\n\t\t// a valid short number.\n\t\tswitch (check_number_length_for_type(potential_national_number, undefined, metadata)) {\n\t\t\tcase 'TOO_SHORT':\n\t\t\t// case 'IS_POSSIBLE_LOCAL_ONLY':\n\t\t\tcase 'INVALID_LENGTH':\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tnational_number = potential_national_number;\n\t\t\t\tcarrier_code = carrierCode;\n\t\t}\n\t} else {\n\t\t// If the original number (before stripping national prefix) was viable,\n\t\t// and the resultant number is not, then prefer the original phone number.\n\t\t// This is because for some countries (e.g. Russia) the same digit could be both\n\t\t// a national prefix and a leading digit of a valid national phone number,\n\t\t// like `8` is the national prefix for Russia and both\n\t\t// `8 800 555 35 35` and `800 555 35 35` are valid numbers.\n\t\tif (matches_entirely(national_number, metadata.nationalNumberPattern()) && !matches_entirely(potential_national_number, metadata.nationalNumberPattern())) {\n\t\t\t// Keep the number without stripping national prefix.\n\t\t} else {\n\t\t\tnational_number = potential_national_number;\n\t\t\tcarrier_code = carrierCode;\n\t\t}\n\t}\n\n\treturn {\n\t\tnational_number: national_number,\n\t\tcarrier_code: carrier_code\n\t};\n}\n\n// Determines the country for a given (possibly incomplete) phone number.\n// export function get_country_from_phone_number(number, metadata)\n// {\n// \treturn parse_phone_number(number, null, metadata).country\n// }\n//# sourceMappingURL=parse.js.map","var _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; };\n\nimport parse, { is_viable_phone_number } from './parse';\n\nimport { matches_entirely } from './common';\n\nimport Metadata from './metadata';\n\nvar non_fixed_line_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 get_number_type(arg_1, arg_2, arg_3, arg_4) {\n\tvar _sort_out_arguments = sort_out_arguments(arg_1, arg_2, arg_3, arg_4),\n\t input = _sort_out_arguments.input,\n\t options = _sort_out_arguments.options,\n\t metadata = _sort_out_arguments.metadata;\n\n\t// When `parse()` returned `{}`\n\t// meaning that the phone number is not a valid one.\n\n\n\tif (!input.country) {\n\t\treturn;\n\t}\n\n\tif (!metadata.hasCountry(input.country)) {\n\t\tthrow new Error('Unknown country: ' + input.country);\n\t}\n\n\tvar nationalNumber = options.v2 ? input.nationalNumber : input.phone;\n\tmetadata.country(input.country);\n\n\t// The following is copy-pasted from the original function:\n\t// https://github.com/googlei18n/libphonenumber/blob/3ea547d4fbaa2d0b67588904dfa5d3f2557c27ff/javascript/i18n/phonenumbers/phonenumberutil.js#L2835\n\n\t// Is this national number even valid for this country\n\tif (!matches_entirely(nationalNumber, metadata.nationalNumberPattern())) {\n\t\treturn;\n\t}\n\n\t// Is it fixed line number\n\tif (is_of_type(nationalNumber, 'FIXED_LINE', metadata)) {\n\t\t// Because duplicate regular expressions are removed\n\t\t// to reduce metadata size, if \"mobile\" pattern is \"\"\n\t\t// then it means it was removed due to being a duplicate of the fixed-line pattern.\n\t\t//\n\t\tif (metadata.type('MOBILE') && metadata.type('MOBILE').pattern() === '') {\n\t\t\treturn 'FIXED_LINE_OR_MOBILE';\n\t\t}\n\n\t\t// v1 metadata.\n\t\t// Legacy.\n\t\t// Deprecated.\n\t\tif (!metadata.type('MOBILE')) {\n\t\t\treturn 'FIXED_LINE_OR_MOBILE';\n\t\t}\n\n\t\t// Check if the number happens to qualify as both fixed line and mobile.\n\t\t// (no such country in the minimal metadata set)\n\t\t/* istanbul ignore if */\n\t\tif (is_of_type(nationalNumber, 'MOBILE', metadata)) {\n\t\t\treturn 'FIXED_LINE_OR_MOBILE';\n\t\t}\n\n\t\treturn 'FIXED_LINE';\n\t}\n\n\tfor (var _iterator = non_fixed_line_types, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {\n\t\tvar _ref;\n\n\t\tif (_isArray) {\n\t\t\tif (_i >= _iterator.length) break;\n\t\t\t_ref = _iterator[_i++];\n\t\t} else {\n\t\t\t_i = _iterator.next();\n\t\t\tif (_i.done) break;\n\t\t\t_ref = _i.value;\n\t\t}\n\n\t\tvar _type = _ref;\n\n\t\tif (is_of_type(nationalNumber, _type, metadata)) {\n\t\t\treturn _type;\n\t\t}\n\t}\n}\n\nexport function is_of_type(nationalNumber, type, metadata) {\n\ttype = metadata.type(type);\n\n\tif (!type || !type.pattern()) {\n\t\treturn false;\n\t}\n\n\t// Check if any possible number lengths are present;\n\t// if so, we use them to avoid checking\n\t// the validation pattern if they don't match.\n\t// If they are absent, this means they match\n\t// the general description, which we have\n\t// already checked before a specific number type.\n\tif (type.possibleLengths() && type.possibleLengths().indexOf(nationalNumber.length) < 0) {\n\t\treturn false;\n\t}\n\n\treturn matches_entirely(nationalNumber, type.pattern());\n}\n\n// Sort out arguments\nexport function sort_out_arguments(arg_1, arg_2, arg_3, arg_4) {\n\tvar input = void 0;\n\tvar options = {};\n\tvar metadata = void 0;\n\n\t// If the phone number is passed as a string.\n\t// `getNumberType('88005553535', ...)`.\n\tif (typeof arg_1 === 'string') {\n\t\t// If \"default country\" argument is being passed\n\t\t// then convert it to an `options` object.\n\t\t// `getNumberType('88005553535', 'RU', metadata)`.\n\t\tif ((typeof arg_2 === 'undefined' ? 'undefined' : _typeof(arg_2)) !== 'object') {\n\t\t\tif (arg_4) {\n\t\t\t\toptions = arg_3;\n\t\t\t\tmetadata = arg_4;\n\t\t\t} else {\n\t\t\t\tmetadata = arg_3;\n\t\t\t}\n\n\t\t\t// `parse` extracts phone numbers from raw text,\n\t\t\t// therefore it will cut off all \"garbage\" characters,\n\t\t\t// while this `validate` function needs to verify\n\t\t\t// that the phone number contains no \"garbage\"\n\t\t\t// therefore the explicit `is_viable_phone_number` check.\n\t\t\tif (is_viable_phone_number(arg_1)) {\n\t\t\t\tinput = parse(arg_1, arg_2, metadata);\n\t\t\t} else {\n\t\t\t\tinput = {};\n\t\t\t}\n\t\t}\n\t\t// No \"resrict country\" argument is being passed.\n\t\t// International phone number is passed.\n\t\t// `getNumberType('+78005553535', metadata)`.\n\t\telse {\n\t\t\t\tif (arg_3) {\n\t\t\t\t\toptions = arg_2;\n\t\t\t\t\tmetadata = arg_3;\n\t\t\t\t} else {\n\t\t\t\t\tmetadata = arg_2;\n\t\t\t\t}\n\n\t\t\t\t// `parse` extracts phone numbers from raw text,\n\t\t\t\t// therefore it will cut off all \"garbage\" characters,\n\t\t\t\t// while this `validate` function needs to verify\n\t\t\t\t// that the phone number contains no \"garbage\"\n\t\t\t\t// therefore the explicit `is_viable_phone_number` check.\n\t\t\t\tif (is_viable_phone_number(arg_1)) {\n\t\t\t\t\tinput = parse(arg_1, metadata);\n\t\t\t\t} else {\n\t\t\t\t\tinput = {};\n\t\t\t\t}\n\t\t\t}\n\t}\n\t// If the phone number is passed as a parsed phone number.\n\t// `getNumberType({ phone: '88005553535', country: 'RU' }, ...)`.\n\telse if (is_object(arg_1)) {\n\t\t\tinput = arg_1;\n\n\t\t\tif (arg_3) {\n\t\t\t\toptions = arg_2;\n\t\t\t\tmetadata = arg_3;\n\t\t\t} else {\n\t\t\t\tmetadata = arg_2;\n\t\t\t}\n\t\t} else throw new TypeError('A phone number must either be a string or an object of shape { phone, [country] }.');\n\n\treturn { input: input, options: options, metadata: new Metadata(metadata) };\n}\n\n// Should only be called for the \"new\" metadata which has \"possible lengths\".\nexport function check_number_length_for_type(nationalNumber, type, metadata) {\n\tvar type_info = metadata.type(type);\n\n\t// There should always be \"\" set for every type element.\n\t// This is declared in the XML schema.\n\t// For size efficiency, where a sub-description (e.g. fixed-line)\n\t// has the same \"\" as the \"general description\", this is missing,\n\t// so we fall back to the \"general description\". Where no numbers of the type\n\t// exist at all, there is one possible length (-1) which is guaranteed\n\t// not to match the length of any real phone number.\n\tvar possible_lengths = type_info && type_info.possibleLengths() || metadata.possibleLengths();\n\t// let local_lengths = type_info && type.possibleLengthsLocal() || metadata.possibleLengthsLocal()\n\n\tif (type === 'FIXED_LINE_OR_MOBILE') {\n\t\t// No such country in metadata.\n\t\t/* istanbul ignore next */\n\t\tif (!metadata.type('FIXED_LINE')) {\n\t\t\t// The rare case has been encountered where no fixedLine data is available\n\t\t\t// (true for some non-geographical entities), so we just check mobile.\n\t\t\treturn check_number_length_for_type(nationalNumber, 'MOBILE', metadata);\n\t\t}\n\n\t\tvar mobile_type = metadata.type('MOBILE');\n\n\t\tif (mobile_type) {\n\t\t\t// Merge the mobile data in if there was any. \"Concat\" creates a new\n\t\t\t// array, it doesn't edit possible_lengths in place, so we don't need a copy.\n\t\t\t// Note that when adding the possible lengths from mobile, we have\n\t\t\t// to again check they aren't empty since if they are this indicates\n\t\t\t// they are the same as the general desc and should be obtained from there.\n\t\t\tpossible_lengths = merge_arrays(possible_lengths, mobile_type.possibleLengths());\n\t\t\t// The current list is sorted; we need to merge in the new list and\n\t\t\t// re-sort (duplicates are okay). Sorting isn't so expensive because\n\t\t\t// the lists are very small.\n\n\t\t\t// if (local_lengths)\n\t\t\t// {\n\t\t\t// \tlocal_lengths = merge_arrays(local_lengths, mobile_type.possibleLengthsLocal())\n\t\t\t// }\n\t\t\t// else\n\t\t\t// {\n\t\t\t// \tlocal_lengths = mobile_type.possibleLengthsLocal()\n\t\t\t// }\n\t\t}\n\t}\n\t// If the type doesn't exist then return 'INVALID_LENGTH'.\n\telse if (type && !type_info) {\n\t\t\treturn 'INVALID_LENGTH';\n\t\t}\n\n\tvar actual_length = nationalNumber.length;\n\n\t// In `libphonenumber-js` all \"local-only\" formats are dropped for simplicity.\n\t// // This is safe because there is never an overlap beween the possible lengths\n\t// // and the local-only lengths; this is checked at build time.\n\t// if (local_lengths && local_lengths.indexOf(nationalNumber.length) >= 0)\n\t// {\n\t// \treturn 'IS_POSSIBLE_LOCAL_ONLY'\n\t// }\n\n\tvar minimum_length = possible_lengths[0];\n\n\tif (minimum_length === actual_length) {\n\t\treturn 'IS_POSSIBLE';\n\t}\n\n\tif (minimum_length > actual_length) {\n\t\treturn 'TOO_SHORT';\n\t}\n\n\tif (possible_lengths[possible_lengths.length - 1] < actual_length) {\n\t\treturn 'TOO_LONG';\n\t}\n\n\t// We skip the first element since we've already checked it.\n\treturn possible_lengths.indexOf(actual_length, 1) >= 0 ? 'IS_POSSIBLE' : 'INVALID_LENGTH';\n}\n\n// Babel transforms `typeof` into some \"branches\"\n// so istanbul will show this as \"branch not covered\".\n/* istanbul ignore next */\nvar is_object = function is_object(_) {\n\treturn (typeof _ === 'undefined' ? 'undefined' : _typeof(_)) === 'object';\n};\n\nexport function merge_arrays(a, b) {\n\tvar merged = a.slice();\n\n\tfor (var _iterator2 = b, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : _iterator2[Symbol.iterator]();;) {\n\t\tvar _ref2;\n\n\t\tif (_isArray2) {\n\t\t\tif (_i2 >= _iterator2.length) break;\n\t\t\t_ref2 = _iterator2[_i2++];\n\t\t} else {\n\t\t\t_i2 = _iterator2.next();\n\t\t\tif (_i2.done) break;\n\t\t\t_ref2 = _i2.value;\n\t\t}\n\n\t\tvar element = _ref2;\n\n\t\tif (a.indexOf(element) < 0) {\n\t\t\tmerged.push(element);\n\t\t}\n\t}\n\n\treturn merged.sort(function (a, b) {\n\t\treturn a - b;\n\t});\n\n\t// ES6 version, requires Set polyfill.\n\t// let merged = new Set(a)\n\t// for (const element of b)\n\t// {\n\t// \tmerged.add(i)\n\t// }\n\t// return Array.from(merged).sort((a, b) => a - b)\n}\n//# sourceMappingURL=getNumberType.js.map","import get_number_type, { sort_out_arguments } from './getNumberType';\nimport { matches_entirely } from './common';\n\n/**\n * Checks if a given phone number is valid.\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(arg_1, arg_2, arg_3, arg_4) {\n var _sort_out_arguments = sort_out_arguments(arg_1, arg_2, arg_3, arg_4),\n input = _sort_out_arguments.input,\n options = _sort_out_arguments.options,\n metadata = _sort_out_arguments.metadata;\n\n // This is just to support `isValidNumber({})`\n // for cases when `parseNumber()` returns `{}`.\n\n\n if (!input.country) {\n return false;\n }\n\n if (!metadata.hasCountry(input.country)) {\n throw new Error('Unknown country: ' + input.country);\n }\n\n metadata.country(input.country);\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 get_number_type(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 national_number = options.v2 ? input.nationalNumber : input.phone;\n return matches_entirely(national_number, metadata.nationalNumberPattern());\n}\n//# sourceMappingURL=validate.js.map","var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nimport Metadata from './metadata';\nimport isPossibleNumber from './isPossibleNumber';\nimport isValidNumber from './validate';\nimport getNumberType from './getNumberType';\nimport formatNumber from './format';\n\nvar PhoneNumber = function () {\n\tfunction PhoneNumber(countryCallingCode, nationalNumber, metadata) {\n\t\t_classCallCheck(this, PhoneNumber);\n\n\t\tif (!countryCallingCode) {\n\t\t\tthrow new TypeError('`countryCallingCode` not passed');\n\t\t}\n\t\tif (!nationalNumber) {\n\t\t\tthrow new TypeError('`nationalNumber` not passed');\n\t\t}\n\t\t// If country code is passed then derive `countryCallingCode` from it.\n\t\t// Also store the country code as `.country`.\n\t\tif (isCountryCode(countryCallingCode)) {\n\t\t\tthis.country = countryCallingCode;\n\t\t\tvar _metadata = new Metadata(metadata);\n\t\t\t_metadata.country(countryCallingCode);\n\t\t\tcountryCallingCode = _metadata.countryCallingCode();\n\t\t}\n\t\tthis.countryCallingCode = countryCallingCode;\n\t\tthis.nationalNumber = nationalNumber;\n\t\tthis.number = '+' + this.countryCallingCode + this.nationalNumber;\n\t\tthis.metadata = metadata;\n\t}\n\n\t_createClass(PhoneNumber, [{\n\t\tkey: 'isPossible',\n\t\tvalue: function isPossible() {\n\t\t\treturn isPossibleNumber(this, { v2: true }, this.metadata);\n\t\t}\n\t}, {\n\t\tkey: 'isValid',\n\t\tvalue: function isValid() {\n\t\t\treturn isValidNumber(this, { v2: true }, this.metadata);\n\t\t}\n\t}, {\n\t\tkey: 'getType',\n\t\tvalue: function getType() {\n\t\t\treturn getNumberType(this, { v2: true }, this.metadata);\n\t\t}\n\t}, {\n\t\tkey: 'format',\n\t\tvalue: function format(_format, options) {\n\t\t\treturn formatNumber(this, _format, options ? _extends({}, options, { v2: true }) : { v2: true }, this.metadata);\n\t\t}\n\t}, {\n\t\tkey: 'formatNational',\n\t\tvalue: function formatNational(options) {\n\t\t\treturn this.format('NATIONAL', options);\n\t\t}\n\t}, {\n\t\tkey: 'formatInternational',\n\t\tvalue: function formatInternational(options) {\n\t\t\treturn this.format('INTERNATIONAL', options);\n\t\t}\n\t}, {\n\t\tkey: 'getURI',\n\t\tvalue: function getURI(options) {\n\t\t\treturn this.format('RFC3966', options);\n\t\t}\n\t}]);\n\n\treturn PhoneNumber;\n}();\n\nexport default PhoneNumber;\n\n\nvar isCountryCode = function isCountryCode(value) {\n\treturn (/^[A-Z]{2}$/.test(value)\n\t);\n};\n//# sourceMappingURL=PhoneNumber.js.map","/** Returns a regular expression quantifier with an upper and lower limit. */\nexport function limit(lower, upper) {\n\tif (lower < 0 || upper <= 0 || upper < lower) {\n\t\tthrow new TypeError();\n\t}\n\treturn \"{\" + lower + \",\" + upper + \"}\";\n}\n\n/**\n * Trims away any characters after the first match of {@code pattern} in {@code candidate},\n * returning the trimmed version.\n */\nexport function trimAfterFirstMatch(regexp, string) {\n\tvar index = string.search(regexp);\n\n\tif (index >= 0) {\n\t\treturn string.slice(0, index);\n\t}\n\n\treturn string;\n}\n\nexport function startsWith(string, substring) {\n\treturn string.indexOf(substring) === 0;\n}\n\nexport function endsWith(string, substring) {\n\treturn string.indexOf(substring, string.length - substring.length) === string.length - substring.length;\n}\n//# sourceMappingURL=util.js.map","var _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; };\n\nvar _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };\n\n// This is a port of Google Android `libphonenumber`'s\n// `phonenumberutil.js` of 17th November, 2016.\n//\n// https://github.com/googlei18n/libphonenumber/commits/master/javascript/i18n/phonenumbers/phonenumberutil.js\n\nimport {\n// extractCountryCallingCode,\nVALID_PUNCTUATION, matches_entirely } from './common';\n\nimport parse from './parse';\n\nimport { getIDDPrefix } from './IDD';\n\nimport Metadata from './metadata';\n\nimport { formatRFC3966 } from './RFC3966';\n\nvar defaultOptions = {\n\tformatExtension: function formatExtension(number, extension, metadata) {\n\t\treturn '' + number + metadata.ext() + extension;\n\t}\n\n\t// Formats a phone number\n\t//\n\t// Example use cases:\n\t//\n\t// ```js\n\t// format('8005553535', 'RU', 'INTERNATIONAL')\n\t// format('8005553535', 'RU', 'INTERNATIONAL', metadata)\n\t// format({ phone: '8005553535', country: 'RU' }, 'INTERNATIONAL')\n\t// format({ phone: '8005553535', country: 'RU' }, 'INTERNATIONAL', metadata)\n\t// format('+78005553535', 'NATIONAL')\n\t// format('+78005553535', 'NATIONAL', metadata)\n\t// ```\n\t//\n};export default function format(arg_1, arg_2, arg_3, arg_4, arg_5) {\n\tvar _sort_out_arguments = sort_out_arguments(arg_1, arg_2, arg_3, arg_4, arg_5),\n\t input = _sort_out_arguments.input,\n\t format_type = _sort_out_arguments.format_type,\n\t options = _sort_out_arguments.options,\n\t metadata = _sort_out_arguments.metadata;\n\n\tif (input.country) {\n\t\t// Validate `input.country`.\n\t\tif (!metadata.hasCountry(input.country)) {\n\t\t\tthrow new Error('Unknown country: ' + input.country);\n\t\t}\n\t\tmetadata.country(input.country);\n\t} else if (input.countryCallingCode) {\n\t\tmetadata.chooseCountryByCountryCallingCode(input.countryCallingCode);\n\t} else return input.phone || '';\n\n\tvar countryCallingCode = metadata.countryCallingCode();\n\n\tvar nationalNumber = options.v2 ? input.nationalNumber : input.phone;\n\n\t// This variable should have been declared inside `case`s\n\t// but Babel has a bug and it says \"duplicate variable declaration\".\n\tvar number = void 0;\n\n\tswitch (format_type) {\n\t\tcase 'INTERNATIONAL':\n\t\t\t// Legacy argument support.\n\t\t\t// (`{ country: ..., phone: '' }`)\n\t\t\tif (!nationalNumber) {\n\t\t\t\treturn '+' + countryCallingCode;\n\t\t\t}\n\t\t\tnumber = format_national_number(nationalNumber, 'INTERNATIONAL', false, metadata);\n\t\t\tnumber = '+' + countryCallingCode + ' ' + number;\n\t\t\treturn add_extension(number, input.ext, metadata, options.formatExtension);\n\n\t\tcase 'E.164':\n\t\t\t// `E.164` doesn't define \"phone number extensions\".\n\t\t\treturn '+' + countryCallingCode + nationalNumber;\n\n\t\tcase 'RFC3966':\n\t\t\treturn formatRFC3966({\n\t\t\t\tnumber: '+' + countryCallingCode + nationalNumber,\n\t\t\t\text: input.ext\n\t\t\t});\n\n\t\tcase 'IDD':\n\t\t\tif (!options.fromCountry) {\n\t\t\t\treturn;\n\t\t\t\t// throw new Error('`fromCountry` option not passed for IDD-prefixed formatting.')\n\t\t\t}\n\t\t\tvar IDDPrefix = getIDDPrefix(options.fromCountry, metadata.metadata);\n\t\t\tif (!IDDPrefix) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (options.humanReadable) {\n\t\t\t\tvar formattedForSameCountryCallingCode = countryCallingCode && formatIDDSameCountryCallingCodeNumber(nationalNumber, metadata.countryCallingCode(), options.fromCountry, metadata);\n\t\t\t\tif (formattedForSameCountryCallingCode) {\n\t\t\t\t\tnumber = formattedForSameCountryCallingCode;\n\t\t\t\t} else {\n\t\t\t\t\tnumber = IDDPrefix + ' ' + countryCallingCode + ' ' + format_national_number(nationalNumber, 'INTERNATIONAL', false, metadata);\n\t\t\t\t}\n\t\t\t\treturn add_extension(number, input.ext, metadata, options.formatExtension);\n\t\t\t}\n\t\t\treturn '' + IDDPrefix + countryCallingCode + nationalNumber;\n\n\t\tcase 'NATIONAL':\n\t\t\t// Legacy argument support.\n\t\t\t// (`{ country: ..., phone: '' }`)\n\t\t\tif (!nationalNumber) {\n\t\t\t\treturn '';\n\t\t\t}\n\t\t\tnumber = format_national_number(nationalNumber, 'NATIONAL', true, metadata);\n\t\t\treturn add_extension(number, input.ext, metadata, options.formatExtension);\n\t}\n}\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)/;\n\nexport function format_national_number_using_format(number, format, international, enforce_national_prefix, metadata) {\n\tvar format_pattern_matcher = new RegExp(format.pattern());\n\n\t// National prefix is omitted if there's no national prefix formatting rule\n\t// set for this country, or when this rule is set but\n\t// national prefix is optional for this phone number format\n\t// (and it is not enforced explicitly)\n\tvar national_prefix_may_be_omitted = !format.nationalPrefixFormattingRule() || format.nationalPrefixFormattingRule() && format.nationalPrefixIsOptionalWhenFormatting() && !enforce_national_prefix;\n\n\tif (!international && !national_prefix_may_be_omitted) {\n\t\treturn number.replace(format_pattern_matcher, format.format().replace(FIRST_GROUP_PATTERN, format.nationalPrefixFormattingRule()));\n\t}\n\n\tvar formatted_number = number.replace(format_pattern_matcher, international ? format.internationalFormat() : format.format());\n\n\tif (international) {\n\t\treturn local_to_international_style(formatted_number);\n\t}\n\n\treturn formatted_number;\n}\n\nfunction format_national_number(number, format_as, enforce_national_prefix, metadata) {\n\tvar format = choose_format_for_number(metadata.formats(), number);\n\n\tif (!format) {\n\t\treturn number;\n\t}\n\n\treturn format_national_number_using_format(number, format, format_as === 'INTERNATIONAL', enforce_national_prefix, metadata);\n}\n\nexport function choose_format_for_number(available_formats, national_number) {\n\tfor (var _iterator = available_formats, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {\n\t\tvar _ref;\n\n\t\tif (_isArray) {\n\t\t\tif (_i >= _iterator.length) break;\n\t\t\t_ref = _iterator[_i++];\n\t\t} else {\n\t\t\t_i = _iterator.next();\n\t\t\tif (_i.done) break;\n\t\t\t_ref = _i.value;\n\t\t}\n\n\t\tvar _format = _ref;\n\n\t\t// Validate leading digits\n\t\tif (_format.leadingDigitsPatterns().length > 0) {\n\t\t\t// The last leading_digits_pattern is used here, as it is the most detailed\n\t\t\tvar last_leading_digits_pattern = _format.leadingDigitsPatterns()[_format.leadingDigitsPatterns().length - 1];\n\n\t\t\t// If leading digits don't match then move on to the next phone number format\n\t\t\tif (national_number.search(last_leading_digits_pattern) !== 0) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t}\n\n\t\t// Check that the national number matches the phone number format regular expression\n\t\tif (matches_entirely(national_number, _format.pattern())) {\n\t\t\treturn _format;\n\t\t}\n\t}\n}\n\n// Removes brackets and replaces dashes with spaces.\n//\n// E.g. \"(999) 111-22-33\" -> \"999 111 22 33\"\n//\nexport function local_to_international_style(local) {\n\treturn local.replace(new RegExp('[' + VALID_PUNCTUATION + ']+', 'g'), ' ').trim();\n}\n\n// Sort out arguments\nfunction sort_out_arguments(arg_1, arg_2, arg_3, arg_4, arg_5) {\n\tvar input = void 0;\n\tvar format_type = void 0;\n\tvar options = void 0;\n\tvar metadata = void 0;\n\n\t// Sort out arguments.\n\n\t// If the phone number is passed as a string.\n\t// `format('8005553535', ...)`.\n\tif (typeof arg_1 === 'string') {\n\t\t// If country code is supplied.\n\t\t// `format('8005553535', 'RU', 'NATIONAL', [options], metadata)`.\n\t\tif (typeof arg_3 === 'string') {\n\t\t\tformat_type = arg_3;\n\n\t\t\tif (arg_5) {\n\t\t\t\toptions = arg_4;\n\t\t\t\tmetadata = arg_5;\n\t\t\t} else {\n\t\t\t\tmetadata = arg_4;\n\t\t\t}\n\n\t\t\tinput = parse(arg_1, { defaultCountry: arg_2, extended: true }, metadata);\n\t\t}\n\t\t// Just an international phone number is supplied\n\t\t// `format('+78005553535', 'NATIONAL', [options], metadata)`.\n\t\telse {\n\t\t\t\tif (typeof arg_2 !== 'string') {\n\t\t\t\t\tthrow new Error('`format` argument not passed to `formatNumber(number, format)`');\n\t\t\t\t}\n\n\t\t\t\tformat_type = arg_2;\n\n\t\t\t\tif (arg_4) {\n\t\t\t\t\toptions = arg_3;\n\t\t\t\t\tmetadata = arg_4;\n\t\t\t\t} else {\n\t\t\t\t\tmetadata = arg_3;\n\t\t\t\t}\n\n\t\t\t\tinput = parse(arg_1, { extended: true }, metadata);\n\t\t\t}\n\t}\n\t// If the phone number is passed as a parsed number object.\n\t// `format({ phone: '8005553535', country: 'RU' }, 'NATIONAL', [options], metadata)`.\n\telse if (is_object(arg_1)) {\n\t\t\tinput = arg_1;\n\t\t\tformat_type = arg_2;\n\n\t\t\tif (arg_4) {\n\t\t\t\toptions = arg_3;\n\t\t\t\tmetadata = arg_4;\n\t\t\t} else {\n\t\t\t\tmetadata = arg_3;\n\t\t\t}\n\t\t} else throw new TypeError('A phone number must either be a string or an object of shape { phone, [country] }.');\n\n\tif (format_type === 'International') {\n\t\tformat_type = 'INTERNATIONAL';\n\t} else if (format_type === 'National') {\n\t\tformat_type = 'NATIONAL';\n\t}\n\n\t// Validate `format_type`.\n\tswitch (format_type) {\n\t\tcase 'E.164':\n\t\tcase 'INTERNATIONAL':\n\t\tcase 'NATIONAL':\n\t\tcase 'RFC3966':\n\t\tcase 'IDD':\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tthrow new Error('Unknown format type argument passed to \"format()\": \"' + format_type + '\"');\n\t}\n\n\t// Apply default options.\n\tif (options) {\n\t\toptions = _extends({}, defaultOptions, options);\n\t} else {\n\t\toptions = defaultOptions;\n\t}\n\n\treturn { input: input, format_type: format_type, options: options, metadata: new Metadata(metadata) };\n}\n\n// Babel transforms `typeof` into some \"branches\"\n// so istanbul will show this as \"branch not covered\".\n/* istanbul ignore next */\nvar is_object = function is_object(_) {\n\treturn (typeof _ === 'undefined' ? 'undefined' : _typeof(_)) === 'object';\n};\n\nfunction add_extension(number, ext, metadata, formatExtension) {\n\treturn ext ? formatExtension(number, ext, metadata) : number;\n}\n\nexport function formatIDDSameCountryCallingCodeNumber(number, toCountryCallingCode, fromCountry, toCountryMetadata) {\n\tvar fromCountryMetadata = new Metadata(toCountryMetadata.metadata);\n\tfromCountryMetadata.country(fromCountry);\n\n\t// If calling within the same country calling code.\n\tif (toCountryCallingCode === fromCountryMetadata.countryCallingCode()) {\n\t\t// For NANPA regions, return the national format for these regions\n\t\t// but prefix it with the country calling code.\n\t\tif (toCountryCallingCode === '1') {\n\t\t\treturn toCountryCallingCode + ' ' + format_national_number(number, 'NATIONAL', false, toCountryMetadata);\n\t\t}\n\n\t\t// If regions share a country calling code, the country calling code need\n\t\t// not be dialled. This also applies when dialling within a region, so this\n\t\t// if clause covers both these cases. Technically this is the case for\n\t\t// dialling from La Reunion to other overseas departments of France (French\n\t\t// Guiana, Martinique, Guadeloupe), but not vice versa - so we don't cover\n\t\t// this edge case for now and for those cases return the version including\n\t\t// country calling code. Details here:\n\t\t// http://www.petitfute.com/voyage/225-info-pratiques-reunion\n\t\treturn format_national_number(number, 'NATIONAL', false, toCountryMetadata);\n\t}\n}\n//# sourceMappingURL=format.js.map","import { parseDigit } from './common';\n\n/**\n * Parses phone number characters from a string.\n * Drops all punctuation leaving only digits and the leading `+` sign (if any).\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 * parseIncompletePhoneNumber('8 (800) 555')\n * // Outputs '8800555'.\n * parseIncompletePhoneNumber('+7 800 555')\n * // Outputs '+7800555'.\n * ```\n */\nexport default function parseIncompletePhoneNumber(string) {\n\tvar result = '';\n\n\t// Using `.split('')` here instead of normal `for ... of`\n\t// because the importing application doesn't neccessarily include an ES6 polyfill.\n\t// The `.split('')` approach discards \"exotic\" UTF-8 characters\n\t// (the ones consisting of four bytes) but digits\n\t// (including non-European ones) don't fall into that range\n\t// so such \"exotic\" characters would be discarded anyway.\n\tfor (var _iterator = string.split(''), _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {\n\t\tvar _ref;\n\n\t\tif (_isArray) {\n\t\t\tif (_i >= _iterator.length) break;\n\t\t\t_ref = _iterator[_i++];\n\t\t} else {\n\t\t\t_i = _iterator.next();\n\t\t\tif (_i.done) break;\n\t\t\t_ref = _i.value;\n\t\t}\n\n\t\tvar character = _ref;\n\n\t\tresult += parsePhoneNumberCharacter(character, result) || '';\n\t}\n\n\treturn result;\n}\n\n/**\n * `input-format` `parse()` function.\n * https://github.com/catamphetamine/input-format\n * @param {string} character - Yet another character from raw input string.\n * @param {string} value - The value parsed so far.\n * @param {object} meta - Optional custom use-case-specific metadata.\n * @return {string?} The parsed character.\n */\nexport function parsePhoneNumberCharacter(character, value) {\n\t// Only allow a leading `+`.\n\tif (character === '+') {\n\t\t// If this `+` is not the first parsed character\n\t\t// then discard it.\n\t\tif (value) {\n\t\t\treturn;\n\t\t}\n\n\t\treturn '+';\n\t}\n\n\t// Allow digits.\n\treturn parseDigit(character);\n}\n//# sourceMappingURL=parseIncompletePhoneNumber.js.map","var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/**\n * A port of Google's `PhoneNumberMatcher.java`.\n * https://github.com/googlei18n/libphonenumber/blob/master/java/libphonenumber/src/com/google/i18n/phonenumbers/PhoneNumberMatcher.java\n * Date: 08.03.2018.\n */\n\nimport PhoneNumber from './PhoneNumber';\n\nimport { MAX_LENGTH_FOR_NSN, MAX_LENGTH_COUNTRY_CODE, VALID_PUNCTUATION, create_extension_pattern } from './common';\n\nimport { limit, trimAfterFirstMatch } from './findNumbers/util';\n\nimport { _pL, _pN, pZ, PZ, pNd } from './findNumbers/utf-8';\n\nimport Leniency from './findNumbers/Leniency';\nimport parsePreCandidate from './findNumbers/parsePreCandidate';\nimport isValidPreCandidate from './findNumbers/isValidPreCandidate';\nimport isValidCandidate, { LEAD_CLASS } from './findNumbers/isValidCandidate';\n\nimport formatNumber from './format';\nimport parseNumber from './parse';\nimport isValidNumber from './validate';\n\n/**\n * Patterns used to extract phone numbers from a larger phone-number-like pattern. These are\n * ordered according to specificity. For example, white-space is last since that is frequently\n * used in numbers, not just to separate two numbers. We have separate patterns since we don't\n * want to break up the phone-number-like text on more than one different kind of symbol at one\n * time, although symbols of the same type (e.g. space) can be safely grouped together.\n *\n * Note that if there is a match, we will always check any text found up to the first match as\n * well.\n */\nvar INNER_MATCHES = [\n// Breaks on the slash - e.g. \"651-234-2345/332-445-1234\"\n'\\\\/+(.*)/',\n\n// Note that the bracket here is inside the capturing group, since we consider it part of the\n// phone number. Will match a pattern like \"(650) 223 3345 (754) 223 3321\".\n'(\\\\([^(]*)',\n\n// Breaks on a hyphen - e.g. \"12345 - 332-445-1234 is my number.\"\n// We require a space on either side of the hyphen for it to be considered a separator.\n'(?:' + pZ + '-|-' + pZ + ')' + pZ + '*(.+)',\n\n// Various types of wide hyphens. Note we have decided not to enforce a space here, since it's\n// possible that it's supposed to be used to break two numbers without spaces, and we haven't\n// seen many instances of it used within a number.\n'[\\u2012-\\u2015\\uFF0D]' + pZ + '*(.+)',\n\n// Breaks on a full stop - e.g. \"12345. 332-445-1234 is my number.\"\n'\\\\.+' + pZ + '*([^.]+)',\n\n// Breaks on space - e.g. \"3324451234 8002341234\"\npZ + '+(' + PZ + '+)'];\n\n// Limit on the number of leading (plus) characters.\nvar leadLimit = limit(0, 2);\n\n// Limit on the number of consecutive punctuation characters.\nvar punctuationLimit = limit(0, 4);\n\n/* The maximum number of digits allowed in a digit-separated block. As we allow all digits in a\n * single block, set high enough to accommodate the entire national number and the international\n * country code. */\nvar digitBlockLimit = MAX_LENGTH_FOR_NSN + MAX_LENGTH_COUNTRY_CODE;\n\n// Limit on the number of blocks separated by punctuation.\n// Uses digitBlockLimit since some formats use spaces to separate each digit.\nvar blockLimit = limit(0, digitBlockLimit);\n\n/* A punctuation sequence allowing white space. */\nvar punctuation = '[' + VALID_PUNCTUATION + ']' + punctuationLimit;\n\n// A digits block without punctuation.\nvar digitSequence = pNd + limit(1, digitBlockLimit);\n\n/**\n * Phone number pattern allowing optional punctuation.\n * The phone number pattern used by `find()`, similar to\n * VALID_PHONE_NUMBER, but with the following differences:\n * \n */\nvar PATTERN = '(?:' + LEAD_CLASS + punctuation + ')' + leadLimit + digitSequence + '(?:' + punctuation + digitSequence + ')' + blockLimit + '(?:' + create_extension_pattern('matching') + ')?';\n\n// Regular expression of trailing characters that we want to remove.\n// We remove all characters that are not alpha or numerical characters.\n// The hash character is retained here, as it may signify\n// the previous block was an extension.\n//\n// // Don't know what does '&&' mean here.\n// const UNWANTED_END_CHAR_PATTERN = new RegExp(`[[\\\\P{N}&&\\\\P{L}]&&[^#]]+$`)\n//\nvar UNWANTED_END_CHAR_PATTERN = new RegExp('[^' + _pN + _pL + '#]+$');\n\nvar NON_DIGITS_PATTERN = /(\\D+)/;\n\nvar MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER || Math.pow(2, 53) - 1;\n\n/**\n * A stateful class that finds and extracts telephone numbers from {@linkplain CharSequence text}.\n * Instances can be created using the {@linkplain PhoneNumberUtil#findNumbers factory methods} in\n * {@link PhoneNumberUtil}.\n *\n *

Vanity numbers (phone numbers using alphabetic digits such as 1-800-SIX-FLAGS are\n * not found.\n *\n *

This class is not thread-safe.\n */\n\nvar PhoneNumberMatcher = function () {\n\n /**\n * Creates a new instance. See the factory methods in {@link PhoneNumberUtil} on how to obtain a\n * new instance.\n *\n * @param util the phone number util to use\n * @param text the character sequence that we will search, null for no text\n * @param country the country to assume for phone numbers not written in international format\n * (with a leading plus, or with the international dialing prefix of the specified region).\n * May be null or \"ZZ\" if only numbers with a leading plus should be\n * considered.\n * @param leniency the leniency to use when evaluating candidate phone numbers\n * @param maxTries the maximum number of invalid numbers to try before giving up on the text.\n * This is to cover degenerate cases where the text has a lot of false positives in it. Must\n * be {@code >= 0}.\n */\n\n /** The iteration tristate. */\n function PhoneNumberMatcher() {\n var text = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var metadata = arguments[2];\n\n _classCallCheck(this, PhoneNumberMatcher);\n\n this.state = 'NOT_READY';\n this.searchIndex = 0;\n\n options = _extends({}, options, {\n leniency: options.leniency || options.extended ? 'POSSIBLE' : 'VALID',\n maxTries: options.maxTries || MAX_SAFE_INTEGER\n });\n\n if (!options.leniency) {\n throw new TypeError('`Leniency` not supplied');\n }\n\n if (options.maxTries < 0) {\n throw new TypeError('`maxTries` not supplied');\n }\n\n this.text = text;\n this.options = options;\n this.metadata = metadata;\n\n /** The degree of validation requested. */\n this.leniency = Leniency[options.leniency];\n\n if (!this.leniency) {\n throw new TypeError('Unknown leniency: ' + options.leniency + '.');\n }\n\n /** The maximum number of retries after matching an invalid number. */\n this.maxTries = options.maxTries;\n\n this.PATTERN = new RegExp(PATTERN, 'ig');\n }\n\n /**\n * Attempts to find the next subsequence in the searched sequence on or after {@code searchIndex}\n * that represents a phone number. Returns the next match, null if none was found.\n *\n * @param index the search index to start searching at\n * @return the phone number match found, null if none can be found\n */\n\n\n /** The next index to start searching at. Undefined in {@link State#DONE}. */\n\n\n _createClass(PhoneNumberMatcher, [{\n key: 'find',\n value: function find() // (index)\n {\n // // Reset the regular expression.\n // this.PATTERN.lastIndex = index\n\n var matches = void 0;\n while (this.maxTries > 0 && (matches = this.PATTERN.exec(this.text)) !== null) {\n var candidate = matches[0];\n var offset = matches.index;\n\n candidate = parsePreCandidate(candidate);\n\n if (isValidPreCandidate(candidate, offset, this.text)) {\n var match =\n // Try to come up with a valid match given the entire candidate.\n this.parseAndVerify(candidate, offset, this.text)\n // If that failed, try to find an \"inner match\" -\n // there might be a phone number within this candidate.\n || this.extractInnerMatch(candidate, offset, this.text);\n\n if (match) {\n if (this.options.v2) {\n var phoneNumber = new PhoneNumber(match.country, match.phone, this.metadata.metadata);\n if (match.ext) {\n phoneNumber.ext = match.ext;\n }\n return {\n startsAt: match.startsAt,\n endsAt: match.endsAt,\n number: phoneNumber\n };\n }\n return match;\n }\n }\n\n this.maxTries--;\n }\n }\n\n /**\n * Attempts to extract a match from `candidate`\n * if the whole candidate does not qualify as a match.\n */\n\n }, {\n key: 'extractInnerMatch',\n value: function extractInnerMatch(candidate, offset, text) {\n for (var _iterator = INNER_MATCHES, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {\n var _ref;\n\n if (_isArray) {\n if (_i >= _iterator.length) break;\n _ref = _iterator[_i++];\n } else {\n _i = _iterator.next();\n if (_i.done) break;\n _ref = _i.value;\n }\n\n var innerMatchPattern = _ref;\n\n var isFirstMatch = true;\n var matches = void 0;\n var possibleInnerMatch = new RegExp(innerMatchPattern, 'g');\n while ((matches = possibleInnerMatch.exec(candidate)) !== null && this.maxTries > 0) {\n if (isFirstMatch) {\n // We should handle any group before this one too.\n var _group = trimAfterFirstMatch(UNWANTED_END_CHAR_PATTERN, candidate.slice(0, matches.index));\n\n var _match = this.parseAndVerify(_group, offset, text);\n if (_match) {\n return _match;\n }\n\n this.maxTries--;\n isFirstMatch = false;\n }\n\n var group = trimAfterFirstMatch(UNWANTED_END_CHAR_PATTERN, matches[1]);\n\n // Java code does `groupMatcher.start(1)` here,\n // but there's no way in javascript to get a group match start index,\n // therefore using the overall match start index `matches.index`.\n var match = this.parseAndVerify(group, offset + matches.index, text);\n if (match) {\n return match;\n }\n\n this.maxTries--;\n }\n }\n }\n\n /**\n * Parses a phone number from the `candidate` using `parseNumber` and\n * verifies it matches the requested `leniency`. If parsing and verification succeed,\n * a corresponding `PhoneNumberMatch` is returned, otherwise this method returns `null`.\n *\n * @param candidate the candidate match\n * @param offset the offset of {@code candidate} within {@link #text}\n * @return the parsed and validated phone number match, or null\n */\n\n }, {\n key: 'parseAndVerify',\n value: function parseAndVerify(candidate, offset, text) {\n if (!isValidCandidate(candidate, offset, text, this.options.leniency)) {\n return;\n }\n\n var number = parseNumber(candidate, {\n extended: true,\n defaultCountry: this.options.defaultCountry\n }, this.metadata.metadata);\n\n if (!number.possible) {\n return;\n }\n\n if (this.leniency(number, candidate, this.metadata.metadata)) {\n // // We used parseAndKeepRawInput to create this number,\n // // but for now we don't return the extra values parsed.\n // // TODO: stop clearing all values here and switch all users over\n // // to using rawInput() rather than the rawString() of PhoneNumberMatch.\n // number.clearCountryCodeSource()\n // number.clearRawInput()\n // number.clearPreferredDomesticCarrierCode()\n\n var result = {\n startsAt: offset,\n endsAt: offset + candidate.length,\n country: number.country,\n phone: number.phone\n };\n\n if (number.ext) {\n result.ext = number.ext;\n }\n\n return result;\n }\n }\n }, {\n key: 'hasNext',\n value: function hasNext() {\n if (this.state === 'NOT_READY') {\n this.lastMatch = this.find(); // (this.searchIndex)\n\n if (this.lastMatch) {\n // this.searchIndex = this.lastMatch.endsAt\n this.state = 'READY';\n } else {\n this.state = 'DONE';\n }\n }\n\n return this.state === 'READY';\n }\n }, {\n key: 'next',\n value: function next() {\n // Check the state and find the next match as a side-effect if necessary.\n if (!this.hasNext()) {\n throw new Error('No next element');\n }\n\n // Don't retain that memory any longer than necessary.\n var result = this.lastMatch;\n this.lastMatch = null;\n this.state = 'NOT_READY';\n return result;\n }\n }]);\n\n return PhoneNumberMatcher;\n}();\n\nexport default PhoneNumberMatcher;\n//# sourceMappingURL=PhoneNumberMatcher.js.map","var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };\n\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; };\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nimport parse from './parse';\nimport Metadata from './metadata';\n\nimport { PLUS_CHARS, VALID_PUNCTUATION, VALID_DIGITS, WHITESPACE, create_extension_pattern } from './common';\n\nimport parsePreCandidate from './findNumbers/parsePreCandidate';\nimport isValidPreCandidate from './findNumbers/isValidPreCandidate';\nimport isValidCandidate from './findNumbers/isValidCandidate';\n\n// Copy-pasted from `./parse.js`.\nvar VALID_PHONE_NUMBER = '[' + PLUS_CHARS + ']{0,1}' + '(?:' + '[' + VALID_PUNCTUATION + ']*' + '[' + VALID_DIGITS + ']' + '){3,}' + '[' + VALID_PUNCTUATION + VALID_DIGITS + ']*';\n\nvar EXTN_PATTERNS_FOR_PARSING = create_extension_pattern('parsing');\n\nvar WHITESPACE_IN_THE_BEGINNING_PATTERN = new RegExp('^[' + WHITESPACE + ']+');\nvar PUNCTUATION_IN_THE_END_PATTERN = new RegExp('[' + VALID_PUNCTUATION + ']+$');\n\n// // Regular expression for getting opening brackets for a valid number\n// // found using `PHONE_NUMBER_START_PATTERN` for prepending those brackets to the number.\n// const BEFORE_NUMBER_DIGITS_PUNCTUATION = new RegExp('[' + OPENING_BRACKETS + ']+' + '[' + WHITESPACE + ']*' + '$')\n\nvar VALID_PRECEDING_CHARACTER_PATTERN = /[^a-zA-Z0-9]/;\n\nexport default function findPhoneNumbers(arg_1, arg_2, arg_3, arg_4) {\n\tvar _sort_out_arguments = sort_out_arguments(arg_1, arg_2, arg_3, arg_4),\n\t text = _sort_out_arguments.text,\n\t options = _sort_out_arguments.options,\n\t metadata = _sort_out_arguments.metadata;\n\n\tvar search = new PhoneNumberSearch(text, options, metadata.metadata);\n\n\tvar phones = [];\n\n\twhile (search.hasNext()) {\n\t\tphones.push(search.next());\n\t}\n\n\treturn phones;\n}\n\n/**\n * @return ES6 `for ... of` iterator.\n */\nexport function searchPhoneNumbers(arg_1, arg_2, arg_3, arg_4) {\n\tvar _sort_out_arguments2 = sort_out_arguments(arg_1, arg_2, arg_3, arg_4),\n\t text = _sort_out_arguments2.text,\n\t options = _sort_out_arguments2.options,\n\t metadata = _sort_out_arguments2.metadata;\n\n\tvar search = new PhoneNumberSearch(text, options, metadata.metadata);\n\n\treturn _defineProperty({}, Symbol.iterator, function () {\n\t\treturn {\n\t\t\tnext: function next() {\n\t\t\t\tif (search.hasNext()) {\n\t\t\t\t\treturn {\n\t\t\t\t\t\tdone: false,\n\t\t\t\t\t\tvalue: search.next()\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t\treturn {\n\t\t\t\t\tdone: true\n\t\t\t\t};\n\t\t\t}\n\t\t};\n\t});\n}\n\n/**\n * Extracts a parseable phone number including any opening brackets, etc.\n * @param {string} text - Input.\n * @return {object} `{ ?number, ?startsAt, ?endsAt }`.\n */\nexport var PhoneNumberSearch = function () {\n\tfunction PhoneNumberSearch(text) {\n\t\tvar options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\t\tvar metadata = arguments[2];\n\n\t\t_classCallCheck(this, PhoneNumberSearch);\n\n\t\tthis.state = 'NOT_READY';\n\n\t\tthis.text = text;\n\t\tthis.options = options;\n\t\tthis.metadata = metadata;\n\n\t\tthis.regexp = new RegExp(VALID_PHONE_NUMBER +\n\t\t// Phone number extensions\n\t\t'(?:' + EXTN_PATTERNS_FOR_PARSING + ')?', 'ig');\n\n\t\t// this.searching_from = 0\n\t}\n\t// Iteration tristate.\n\n\n\t_createClass(PhoneNumberSearch, [{\n\t\tkey: 'find',\n\t\tvalue: function find() {\n\t\t\tvar matches = this.regexp.exec(this.text);\n\n\t\t\tif (!matches) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tvar number = matches[0];\n\t\t\tvar startsAt = matches.index;\n\n\t\t\tnumber = number.replace(WHITESPACE_IN_THE_BEGINNING_PATTERN, '');\n\t\t\tstartsAt += matches[0].length - number.length;\n\t\t\t// Fixes not parsing numbers with whitespace in the end.\n\t\t\t// Also fixes not parsing numbers with opening parentheses in the end.\n\t\t\t// https://github.com/catamphetamine/libphonenumber-js/issues/252\n\t\t\tnumber = number.replace(PUNCTUATION_IN_THE_END_PATTERN, '');\n\n\t\t\tnumber = parsePreCandidate(number);\n\n\t\t\tvar result = this.parseCandidate(number, startsAt);\n\n\t\t\tif (result) {\n\t\t\t\treturn result;\n\t\t\t}\n\n\t\t\t// Tail recursion.\n\t\t\t// Try the next one if this one is not a valid phone number.\n\t\t\treturn this.find();\n\t\t}\n\t}, {\n\t\tkey: 'parseCandidate',\n\t\tvalue: function parseCandidate(number, startsAt) {\n\t\t\tif (!isValidPreCandidate(number, startsAt, this.text)) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Don't parse phone numbers which are non-phone numbers\n\t\t\t// due to being part of something else (e.g. a UUID).\n\t\t\t// https://github.com/catamphetamine/libphonenumber-js/issues/213\n\t\t\t// Copy-pasted from Google's `PhoneNumberMatcher.js` (`.parseAndValidate()`).\n\t\t\tif (!isValidCandidate(number, startsAt, this.text, this.options.extended ? 'POSSIBLE' : 'VALID')) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// // Prepend any opening brackets left behind by the\n\t\t\t// // `PHONE_NUMBER_START_PATTERN` regexp.\n\t\t\t// const text_before_number = text.slice(this.searching_from, startsAt)\n\t\t\t// const full_number_starts_at = text_before_number.search(BEFORE_NUMBER_DIGITS_PUNCTUATION)\n\t\t\t// if (full_number_starts_at >= 0)\n\t\t\t// {\n\t\t\t// \tnumber = text_before_number.slice(full_number_starts_at) + number\n\t\t\t// \tstartsAt = full_number_starts_at\n\t\t\t// }\n\t\t\t//\n\t\t\t// this.searching_from = matches.lastIndex\n\n\t\t\tvar result = parse(number, this.options, this.metadata);\n\n\t\t\tif (!result.phone) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tresult.startsAt = startsAt;\n\t\t\tresult.endsAt = startsAt + number.length;\n\n\t\t\treturn result;\n\t\t}\n\t}, {\n\t\tkey: 'hasNext',\n\t\tvalue: function hasNext() {\n\t\t\tif (this.state === 'NOT_READY') {\n\t\t\t\tthis.last_match = this.find();\n\n\t\t\t\tif (this.last_match) {\n\t\t\t\t\tthis.state = 'READY';\n\t\t\t\t} else {\n\t\t\t\t\tthis.state = 'DONE';\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn this.state === 'READY';\n\t\t}\n\t}, {\n\t\tkey: 'next',\n\t\tvalue: function next() {\n\t\t\t// Check the state and find the next match as a side-effect if necessary.\n\t\t\tif (!this.hasNext()) {\n\t\t\t\tthrow new Error('No next element');\n\t\t\t}\n\n\t\t\t// Don't retain that memory any longer than necessary.\n\t\t\tvar result = this.last_match;\n\t\t\tthis.last_match = null;\n\t\t\tthis.state = 'NOT_READY';\n\t\t\treturn result;\n\t\t}\n\t}]);\n\n\treturn PhoneNumberSearch;\n}();\n\nexport function sort_out_arguments(arg_1, arg_2, arg_3, arg_4) {\n\tvar text = void 0;\n\tvar options = void 0;\n\tvar metadata = void 0;\n\n\t// If the phone number is passed as a string.\n\t// `parse('88005553535', ...)`.\n\tif (typeof arg_1 === 'string') {\n\t\ttext = arg_1;\n\t} else throw new TypeError('A text for parsing must be a string.');\n\n\t// If \"default country\" argument is being passed\n\t// then move it to `options`.\n\t// `findNumbers('88005553535', 'RU', [options], metadata)`.\n\tif ((typeof arg_2 === 'undefined' ? 'undefined' : _typeof(arg_2)) !== 'object') {\n\t\tif (arg_4) {\n\t\t\toptions = _extends({ defaultCountry: arg_2 }, arg_3);\n\t\t\tmetadata = arg_4;\n\t\t} else {\n\t\t\toptions = { defaultCountry: arg_2 };\n\t\t\tmetadata = arg_3;\n\t\t}\n\t}\n\t// No \"default country\" argument is being passed.\n\t// Only international phone numbers are passed.\n\t// `findNumbers('+78005553535', [options], metadata)`.\n\telse {\n\t\t\tif (arg_3) {\n\t\t\t\toptions = arg_2;\n\t\t\t\tmetadata = arg_3;\n\t\t\t} else {\n\t\t\t\tmetadata = arg_2;\n\t\t\t}\n\t\t}\n\n\tif (!options) {\n\t\toptions = {};\n\t}\n\n\t// // Apply default options.\n\t// if (options)\n\t// {\n\t// \toptions = { ...default_options, ...options }\n\t// }\n\t// else\n\t// {\n\t// \toptions = default_options\n\t// }\n\n\treturn { text: text, options: options, metadata: new Metadata(metadata) };\n}\n//# sourceMappingURL=findPhoneNumbers.js.map","var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"]) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError(\"Invalid attempt to destructure non-iterable instance\"); } }; }();\n\nimport { is_viable_phone_number } from './parse';\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\tvar number = void 0;\n\tvar ext = void 0;\n\n\t// Replace \"tel:\" with \"tel=\" for parsing convenience.\n\ttext = text.replace(/^tel:/, 'tel=');\n\n\tfor (var _iterator = text.split(';'), _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {\n\t\tvar _ref;\n\n\t\tif (_isArray) {\n\t\t\tif (_i >= _iterator.length) break;\n\t\t\t_ref = _iterator[_i++];\n\t\t} else {\n\t\t\t_i = _iterator.next();\n\t\t\tif (_i.done) break;\n\t\t\t_ref = _i.value;\n\t\t}\n\n\t\tvar part = _ref;\n\n\t\tvar _part$split = part.split('='),\n\t\t _part$split2 = _slicedToArray(_part$split, 2),\n\t\t name = _part$split2[0],\n\t\t value = _part$split2[1];\n\n\t\tswitch (name) {\n\t\t\tcase 'tel':\n\t\t\t\tnumber = value;\n\t\t\t\tbreak;\n\t\t\tcase 'ext':\n\t\t\t\text = value;\n\t\t\t\tbreak;\n\t\t\tcase 'phone-context':\n\t\t\t\t// Only \"country contexts\" are supported.\n\t\t\t\t// \"Domain contexts\" are ignored.\n\t\t\t\tif (value[0] === '+') {\n\t\t\t\t\tnumber = value + number;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t}\n\t}\n\n\t// If the phone number is not viable, then abort.\n\tif (!is_viable_phone_number(number)) {\n\t\treturn {};\n\t}\n\n\tvar result = { number: number };\n\tif (ext) {\n\t\tresult.ext = ext;\n\t}\n\treturn result;\n}\n\n/**\n * @param {object} - `{ ?number, ?extension }`.\n * @return {string} Phone URI (RFC 3966).\n */\nexport function formatRFC3966(_ref2) {\n\tvar number = _ref2.number,\n\t ext = _ref2.ext;\n\n\tif (!number) {\n\t\treturn '';\n\t}\n\n\tif (number[0] !== '+') {\n\t\tthrow new Error('\"formatRFC3966()\" expects \"number\" to be in E.164 format.');\n\t}\n\n\treturn 'tel:' + number + (ext ? ';ext=' + ext : '');\n}\n//# sourceMappingURL=RFC3966.js.map","import { sort_out_arguments, check_number_length_for_type } from './getNumberType';\n\n/**\n * Checks if a given phone number is possible.\n * Which means it only checks phone number length\n * and doesn't test any regular expressions.\n *\n * Examples:\n *\n * ```js\n * isPossibleNumber('+78005553535', metadata)\n * isPossibleNumber('8005553535', 'RU', metadata)\n * isPossibleNumber('88005553535', 'RU', metadata)\n * isPossibleNumber({ phone: '8005553535', country: 'RU' }, metadata)\n * ```\n */\nexport default function isPossibleNumber(arg_1, arg_2, arg_3, arg_4) {\n\tvar _sort_out_arguments = sort_out_arguments(arg_1, arg_2, arg_3, arg_4),\n\t input = _sort_out_arguments.input,\n\t options = _sort_out_arguments.options,\n\t metadata = _sort_out_arguments.metadata;\n\n\tif (options.v2) {\n\t\tif (!input.countryCallingCode) {\n\t\t\tthrow new Error('Invalid phone number object passed');\n\t\t}\n\t\tmetadata.chooseCountryByCountryCallingCode(input.countryCallingCode);\n\t} else {\n\t\tif (!input.phone) {\n\t\t\treturn false;\n\t\t}\n\t\tif (input.country) {\n\t\t\tif (!metadata.hasCountry(input.country)) {\n\t\t\t\tthrow new Error('Unknown country: ' + input.country);\n\t\t\t}\n\t\t\tmetadata.country(input.country);\n\t\t} else {\n\t\t\tif (!input.countryCallingCode) {\n\t\t\t\tthrow new Error('Invalid phone number object passed');\n\t\t\t}\n\t\t\tmetadata.chooseCountryByCountryCallingCode(input.countryCallingCode);\n\t\t}\n\t}\n\n\tif (!metadata.possibleLengths()) {\n\t\tthrow new Error('Metadata too old');\n\t}\n\n\treturn is_possible_number(input.phone || input.nationalNumber, undefined, metadata);\n}\n\nexport function is_possible_number(national_number, is_international, metadata) {\n\tswitch (check_number_length_for_type(national_number, undefined, metadata)) {\n\t\tcase 'IS_POSSIBLE':\n\t\t\treturn true;\n\t\t// case 'IS_POSSIBLE_LOCAL_ONLY':\n\t\t// \treturn !is_international\n\t\tdefault:\n\t\t\treturn false;\n\t}\n}\n//# sourceMappingURL=isPossibleNumber.js.map","var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n// This is an enhanced port of Google Android `libphonenumber`'s\n// `asyoutypeformatter.js` of October 26th, 2018.\n//\n// https://github.com/googlei18n/libphonenumber/blob/8d21a365061de2ba0675c878a710a7b24f74d2ae/javascript/i18n/phonenumbers/asyoutypeformatter.js\n//\n// Simplified: does not differentiate between \"local-only\" numbers\n// and \"internationally dialable\" numbers.\n// For example, doesn't include changes like this:\n// https://github.com/googlei18n/libphonenumber/commit/865da605da12b01053c4f053310bac7c5fbb7935\n\nimport Metadata from './metadata';\n\nimport PhoneNumber from './PhoneNumber';\n\nimport { matches_entirely, VALID_DIGITS, VALID_PUNCTUATION, PLUS_CHARS, extractCountryCallingCode } from './common';\n\nimport { extract_formatted_phone_number, find_country_code, strip_national_prefix_and_carrier_code } from './parse';\n\nimport { FIRST_GROUP_PATTERN, format_national_number_using_format, local_to_international_style } from './format';\n\nimport { check_number_length_for_type } from './getNumberType';\n\nimport parseIncompletePhoneNumber from './parseIncompletePhoneNumber';\n\n// Used in phone number format template creation.\n// Could be any digit, I guess.\nvar DUMMY_DIGIT = '9';\n// I don't know why is it exactly `15`\nvar LONGEST_NATIONAL_PHONE_NUMBER_LENGTH = 15;\n// Create a phone number consisting only of the digit 9 that matches the\n// `number_pattern` by applying the pattern to the \"longest phone number\" string.\nvar LONGEST_DUMMY_PHONE_NUMBER = repeat(DUMMY_DIGIT, LONGEST_NATIONAL_PHONE_NUMBER_LENGTH);\n\n// The digits that have not been entered yet will be represented by a \\u2008,\n// the punctuation space.\nexport var DIGIT_PLACEHOLDER = 'x'; // '\\u2008' (punctuation space)\nvar DIGIT_PLACEHOLDER_MATCHER = new RegExp(DIGIT_PLACEHOLDER);\n\n// A pattern that is used to match character classes in regular expressions.\n// An example of a character class is \"[1-4]\".\nvar CREATE_CHARACTER_CLASS_PATTERN = function CREATE_CHARACTER_CLASS_PATTERN() {\n\treturn (/\\[([^\\[\\]])*\\]/g\n\t);\n};\n\n// Any digit in a regular expression that actually denotes a digit. For\n// example, in the regular expression \"80[0-2]\\d{6,10}\", the first 2 digits\n// (8 and 0) are standalone digits, but the rest are not.\n// Two look-aheads are needed because the number following \\\\d could be a\n// two-digit number, since the phone number can be as long as 15 digits.\nvar CREATE_STANDALONE_DIGIT_PATTERN = function CREATE_STANDALONE_DIGIT_PATTERN() {\n\treturn (/\\d(?=[^,}][^,}])/g\n\t);\n};\n\n// A pattern that is used to determine if a `format` is eligible\n// to be used by the \"as you type formatter\".\n// It is eligible when the `format` contains groups of the dollar sign\n// followed by a single digit, separated by valid phone number punctuation.\n// This prevents invalid punctuation (such as the star sign in Israeli star numbers)\n// getting into the output of the \"as you type formatter\".\nvar ELIGIBLE_FORMAT_PATTERN = new RegExp('^' + '[' + VALID_PUNCTUATION + ']*' + '(\\\\$\\\\d[' + VALID_PUNCTUATION + ']*)+' + '$');\n\n// This is the minimum length of the leading digits of a phone number\n// to guarantee the first \"leading digits pattern\" for a phone number format\n// to be preemptive.\nvar MIN_LEADING_DIGITS_LENGTH = 3;\n\nvar VALID_INCOMPLETE_PHONE_NUMBER = '[' + PLUS_CHARS + ']{0,1}' + '[' + VALID_PUNCTUATION + VALID_DIGITS + ']*';\n\nvar VALID_INCOMPLETE_PHONE_NUMBER_PATTERN = new RegExp('^' + VALID_INCOMPLETE_PHONE_NUMBER + '$', 'i');\n\nvar AsYouType = function () {\n\n\t/**\n * @param {string} [country_code] - The default country used for parsing non-international phone numbers.\n * @param {Object} metadata\n */\n\tfunction AsYouType(country_code, metadata) {\n\t\t_classCallCheck(this, AsYouType);\n\n\t\tthis.options = {};\n\n\t\tthis.metadata = new Metadata(metadata);\n\n\t\tif (country_code && this.metadata.hasCountry(country_code)) {\n\t\t\tthis.default_country = country_code;\n\t\t}\n\n\t\tthis.reset();\n\t}\n\t// Not setting `options` to a constructor argument\n\t// not to break backwards compatibility\n\t// for older versions of the library.\n\n\n\t_createClass(AsYouType, [{\n\t\tkey: 'input',\n\t\tvalue: function input(text) {\n\t\t\t// Parse input\n\n\t\t\tvar extracted_number = extract_formatted_phone_number(text) || '';\n\n\t\t\t// Special case for a lone '+' sign\n\t\t\t// since it's not considered a possible phone number.\n\t\t\tif (!extracted_number) {\n\t\t\t\tif (text && text.indexOf('+') >= 0) {\n\t\t\t\t\textracted_number = '+';\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Validate possible first part of a phone number\n\t\t\tif (!VALID_INCOMPLETE_PHONE_NUMBER_PATTERN.test(extracted_number)) {\n\t\t\t\treturn this.current_output;\n\t\t\t}\n\n\t\t\treturn this.process_input(parseIncompletePhoneNumber(extracted_number));\n\t\t}\n\t}, {\n\t\tkey: 'process_input',\n\t\tvalue: function process_input(input) {\n\t\t\t// If an out of position '+' sign detected\n\t\t\t// (or a second '+' sign),\n\t\t\t// then just drop it from the input.\n\t\t\tif (input[0] === '+') {\n\t\t\t\tif (!this.parsed_input) {\n\t\t\t\t\tthis.parsed_input += '+';\n\n\t\t\t\t\t// If a default country was set\n\t\t\t\t\t// then reset it because an explicitly international\n\t\t\t\t\t// phone number is being entered\n\t\t\t\t\tthis.reset_countriness();\n\t\t\t\t}\n\n\t\t\t\tinput = input.slice(1);\n\t\t\t}\n\n\t\t\t// Raw phone number\n\t\t\tthis.parsed_input += input;\n\n\t\t\t// // Reset phone number validation state\n\t\t\t// this.valid = false\n\n\t\t\t// Add digits to the national number\n\t\t\tthis.national_number += input;\n\n\t\t\t// TODO: Deprecated: rename `this.national_number`\n\t\t\t// to `this.nationalNumber` and remove `.getNationalNumber()`.\n\n\t\t\t// Try to format the parsed input\n\n\t\t\tif (this.is_international()) {\n\t\t\t\tif (!this.countryCallingCode) {\n\t\t\t\t\t// No need to format anything\n\t\t\t\t\t// if there's no national phone number.\n\t\t\t\t\t// (e.g. just the country calling code)\n\t\t\t\t\tif (!this.national_number) {\n\t\t\t\t\t\t// Return raw phone number\n\t\t\t\t\t\treturn this.parsed_input;\n\t\t\t\t\t}\n\n\t\t\t\t\t// If one looks at country phone codes\n\t\t\t\t\t// then he can notice that no one country phone code\n\t\t\t\t\t// is ever a (leftmost) substring of another country phone code.\n\t\t\t\t\t// So if a valid country code is extracted so far\n\t\t\t\t\t// then it means that this is the country code.\n\n\t\t\t\t\t// If no country phone code could be extracted so far,\n\t\t\t\t\t// then just return the raw phone number,\n\t\t\t\t\t// because it has no way of knowing\n\t\t\t\t\t// how to format the phone number so far.\n\t\t\t\t\tif (!this.extract_country_calling_code()) {\n\t\t\t\t\t\t// Return raw phone number\n\t\t\t\t\t\treturn this.parsed_input;\n\t\t\t\t\t}\n\n\t\t\t\t\t// Initialize country-specific data\n\t\t\t\t\tthis.initialize_phone_number_formats_for_this_country_calling_code();\n\t\t\t\t\tthis.reset_format();\n\t\t\t\t\tthis.determine_the_country();\n\t\t\t\t}\n\t\t\t\t// `this.country` could be `undefined`,\n\t\t\t\t// for instance, when there is ambiguity\n\t\t\t\t// in a form of several different countries\n\t\t\t\t// each corresponding to the same country phone code\n\t\t\t\t// (e.g. NANPA: USA, Canada, etc),\n\t\t\t\t// and there's not enough digits entered\n\t\t\t\t// to reliably determine the country\n\t\t\t\t// the phone number belongs to.\n\t\t\t\t// Therefore, in cases of such ambiguity,\n\t\t\t\t// each time something is input,\n\t\t\t\t// try to determine the country\n\t\t\t\t// (if it's not determined yet).\n\t\t\t\telse if (!this.country) {\n\t\t\t\t\t\tthis.determine_the_country();\n\t\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// Some national prefixes are substrings of other national prefixes\n\t\t\t\t// (for the same country), therefore try to extract national prefix each time\n\t\t\t\t// because a longer national prefix might be available at some point in time.\n\n\t\t\t\tvar previous_national_prefix = this.national_prefix;\n\t\t\t\tthis.national_number = this.national_prefix + this.national_number;\n\n\t\t\t\t// Possibly extract a national prefix\n\t\t\t\tthis.extract_national_prefix();\n\n\t\t\t\tif (this.national_prefix !== previous_national_prefix) {\n\t\t\t\t\t// National number has changed\n\t\t\t\t\t// (due to another national prefix been extracted)\n\t\t\t\t\t// therefore national number has changed\n\t\t\t\t\t// therefore reset all previous formatting data.\n\t\t\t\t\t// (and leading digits matching state)\n\t\t\t\t\tthis.matching_formats = undefined;\n\t\t\t\t\tthis.reset_format();\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// if (!this.should_format())\n\t\t\t// {\n\t\t\t// \treturn this.format_as_non_formatted_number()\n\t\t\t// }\n\n\t\t\tif (!this.national_number) {\n\t\t\t\treturn this.format_as_non_formatted_number();\n\t\t\t}\n\n\t\t\t// Check the available phone number formats\n\t\t\t// based on the currently available leading digits.\n\t\t\tthis.match_formats_by_leading_digits();\n\n\t\t\t// Format the phone number (given the next digits)\n\t\t\tvar formatted_national_phone_number = this.format_national_phone_number(input);\n\n\t\t\t// If the phone number could be formatted,\n\t\t\t// then return it, possibly prepending with country phone code\n\t\t\t// (for international phone numbers only)\n\t\t\tif (formatted_national_phone_number) {\n\t\t\t\treturn this.full_phone_number(formatted_national_phone_number);\n\t\t\t}\n\n\t\t\t// If the phone number couldn't be formatted,\n\t\t\t// then just fall back to the raw phone number.\n\t\t\treturn this.format_as_non_formatted_number();\n\t\t}\n\t}, {\n\t\tkey: 'format_as_non_formatted_number',\n\t\tvalue: function format_as_non_formatted_number() {\n\t\t\t// Strip national prefix for incorrectly inputted international phones.\n\t\t\tif (this.is_international() && this.countryCallingCode) {\n\t\t\t\treturn '+' + this.countryCallingCode + this.national_number;\n\t\t\t}\n\n\t\t\treturn this.parsed_input;\n\t\t}\n\t}, {\n\t\tkey: 'format_national_phone_number',\n\t\tvalue: function format_national_phone_number(next_digits) {\n\t\t\t// Format the next phone number digits\n\t\t\t// using the previously chosen phone number format.\n\t\t\t//\n\t\t\t// This is done here because if `attempt_to_format_complete_phone_number`\n\t\t\t// was placed before this call then the `template`\n\t\t\t// wouldn't reflect the situation correctly (and would therefore be inconsistent)\n\t\t\t//\n\t\t\tvar national_number_formatted_with_previous_format = void 0;\n\t\t\tif (this.chosen_format) {\n\t\t\t\tnational_number_formatted_with_previous_format = this.format_next_national_number_digits(next_digits);\n\t\t\t}\n\n\t\t\t// See if the input digits can be formatted properly already. If not,\n\t\t\t// use the results from format_next_national_number_digits(), which does formatting\n\t\t\t// based on the formatting pattern chosen.\n\n\t\t\tvar formatted_number = this.attempt_to_format_complete_phone_number();\n\n\t\t\t// Just because a phone number doesn't have a suitable format\n\t\t\t// that doesn't mean that the phone is invalid\n\t\t\t// because phone number formats only format phone numbers,\n\t\t\t// they don't validate them and some (rare) phone numbers\n\t\t\t// are meant to stay non-formatted.\n\t\t\tif (formatted_number) {\n\t\t\t\treturn formatted_number;\n\t\t\t}\n\n\t\t\t// For some phone number formats national prefix\n\n\t\t\t// If the previously chosen phone number format\n\t\t\t// didn't match the next (current) digit being input\n\t\t\t// (leading digits pattern didn't match).\n\t\t\tif (this.choose_another_format()) {\n\t\t\t\t// And a more appropriate phone number format\n\t\t\t\t// has been chosen for these `leading digits`,\n\t\t\t\t// then format the national phone number (so far)\n\t\t\t\t// using the newly selected phone number pattern.\n\n\t\t\t\t// Will return `undefined` if it couldn't format\n\t\t\t\t// the supplied national number\n\t\t\t\t// using the selected phone number pattern.\n\n\t\t\t\treturn this.reformat_national_number();\n\t\t\t}\n\n\t\t\t// If could format the next (current) digit\n\t\t\t// using the previously chosen phone number format\n\t\t\t// then return the formatted number so far.\n\n\t\t\t// If no new phone number format could be chosen,\n\t\t\t// and couldn't format the supplied national number\n\t\t\t// using the selected phone number pattern,\n\t\t\t// then it will return `undefined`.\n\n\t\t\treturn national_number_formatted_with_previous_format;\n\t\t}\n\t}, {\n\t\tkey: 'reset',\n\t\tvalue: function reset() {\n\t\t\t// Input stripped of non-phone-number characters.\n\t\t\t// Can only contain a possible leading '+' sign and digits.\n\t\t\tthis.parsed_input = '';\n\n\t\t\tthis.current_output = '';\n\n\t\t\t// This contains the national prefix that has been extracted. It contains only\n\t\t\t// digits without formatting.\n\t\t\tthis.national_prefix = '';\n\n\t\t\tthis.national_number = '';\n\t\t\tthis.carrierCode = '';\n\n\t\t\tthis.reset_countriness();\n\n\t\t\tthis.reset_format();\n\n\t\t\t// this.valid = false\n\n\t\t\treturn this;\n\t\t}\n\t}, {\n\t\tkey: 'reset_country',\n\t\tvalue: function reset_country() {\n\t\t\tif (this.is_international()) {\n\t\t\t\tthis.country = undefined;\n\t\t\t} else {\n\t\t\t\tthis.country = this.default_country;\n\t\t\t}\n\t\t}\n\t}, {\n\t\tkey: 'reset_countriness',\n\t\tvalue: function reset_countriness() {\n\t\t\tthis.reset_country();\n\n\t\t\tif (this.default_country && !this.is_international()) {\n\t\t\t\tthis.metadata.country(this.default_country);\n\t\t\t\tthis.countryCallingCode = this.metadata.countryCallingCode();\n\n\t\t\t\tthis.initialize_phone_number_formats_for_this_country_calling_code();\n\t\t\t} else {\n\t\t\t\tthis.metadata.country(undefined);\n\t\t\t\tthis.countryCallingCode = undefined;\n\n\t\t\t\t// \"Available formats\" are all formats available for the country.\n\t\t\t\t// \"Matching formats\" are only formats eligible for the national number being entered.\n\t\t\t\tthis.available_formats = [];\n\t\t\t\tthis.matching_formats = undefined;\n\t\t\t}\n\t\t}\n\t}, {\n\t\tkey: 'reset_format',\n\t\tvalue: function reset_format() {\n\t\t\tthis.chosen_format = undefined;\n\t\t\tthis.template = undefined;\n\t\t\tthis.partially_populated_template = undefined;\n\t\t\tthis.last_match_position = -1;\n\t\t}\n\n\t\t// Format each digit of national phone number (so far)\n\t\t// using the newly selected phone number pattern.\n\n\t}, {\n\t\tkey: 'reformat_national_number',\n\t\tvalue: function reformat_national_number() {\n\t\t\t// Format each digit of national phone number (so far)\n\t\t\t// using the selected phone number pattern.\n\t\t\treturn this.format_next_national_number_digits(this.national_number);\n\t\t}\n\t}, {\n\t\tkey: 'initialize_phone_number_formats_for_this_country_calling_code',\n\t\tvalue: function initialize_phone_number_formats_for_this_country_calling_code() {\n\t\t\t// Get all \"eligible\" phone number formats for this country\n\t\t\tthis.available_formats = this.metadata.formats().filter(function (format) {\n\t\t\t\treturn ELIGIBLE_FORMAT_PATTERN.test(format.internationalFormat());\n\t\t\t});\n\n\t\t\tthis.matching_formats = undefined;\n\t\t}\n\t}, {\n\t\tkey: 'match_formats_by_leading_digits',\n\t\tvalue: function match_formats_by_leading_digits() {\n\t\t\tvar leading_digits = this.national_number;\n\n\t\t\t// \"leading digits\" pattern list starts with a\n\t\t\t// \"leading digits\" pattern fitting a maximum of 3 leading digits.\n\t\t\t// So, after a user inputs 3 digits of a national (significant) phone number\n\t\t\t// this national (significant) number can already be formatted.\n\t\t\t// The next \"leading digits\" pattern is for 4 leading digits max,\n\t\t\t// and the \"leading digits\" pattern after it is for 5 leading digits max, etc.\n\n\t\t\t// This implementation is different from Google's\n\t\t\t// in that it searches for a fitting format\n\t\t\t// even if the user has entered less than\n\t\t\t// `MIN_LEADING_DIGITS_LENGTH` digits of a national number.\n\t\t\t// Because some leading digits patterns already match for a single first digit.\n\t\t\tvar index_of_leading_digits_pattern = leading_digits.length - MIN_LEADING_DIGITS_LENGTH;\n\t\t\tif (index_of_leading_digits_pattern < 0) {\n\t\t\t\tindex_of_leading_digits_pattern = 0;\n\t\t\t}\n\n\t\t\t// \"Available formats\" are all formats available for the country.\n\t\t\t// \"Matching formats\" are only formats eligible for the national number being entered.\n\n\t\t\t// If at least `MIN_LEADING_DIGITS_LENGTH` digits of a national number are available\n\t\t\t// then format matching starts narrowing down the list of possible formats\n\t\t\t// (only previously matched formats are considered for next digits).\n\t\t\tvar available_formats = this.had_enough_leading_digits && this.matching_formats || this.available_formats;\n\t\t\tthis.had_enough_leading_digits = this.should_format();\n\n\t\t\tthis.matching_formats = available_formats.filter(function (format) {\n\t\t\t\tvar leading_digits_patterns_count = format.leadingDigitsPatterns().length;\n\n\t\t\t\t// If this format is not restricted to a certain\n\t\t\t\t// leading digits pattern then it fits.\n\t\t\t\tif (leading_digits_patterns_count === 0) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\n\t\t\t\tvar leading_digits_pattern_index = Math.min(index_of_leading_digits_pattern, leading_digits_patterns_count - 1);\n\t\t\t\tvar leading_digits_pattern = format.leadingDigitsPatterns()[leading_digits_pattern_index];\n\n\t\t\t\t// Brackets are required for `^` to be applied to\n\t\t\t\t// all or-ed (`|`) parts, not just the first one.\n\t\t\t\treturn new RegExp('^(' + leading_digits_pattern + ')').test(leading_digits);\n\t\t\t});\n\n\t\t\t// If there was a phone number format chosen\n\t\t\t// and it no longer holds given the new leading digits then reset it.\n\t\t\t// The test for this `if` condition is marked as:\n\t\t\t// \"Reset a chosen format when it no longer holds given the new leading digits\".\n\t\t\t// To construct a valid test case for this one can find a country\n\t\t\t// in `PhoneNumberMetadata.xml` yielding one format for 3 ``\n\t\t\t// and yielding another format for 4 `` (Australia in this case).\n\t\t\tif (this.chosen_format && this.matching_formats.indexOf(this.chosen_format) === -1) {\n\t\t\t\tthis.reset_format();\n\t\t\t}\n\t\t}\n\t}, {\n\t\tkey: 'should_format',\n\t\tvalue: function should_format() {\n\t\t\t// Start matching any formats at all when the national number\n\t\t\t// entered so far is at least 3 digits long,\n\t\t\t// otherwise format matching would give false negatives\n\t\t\t// like when the digits entered so far are `2`\n\t\t\t// and the leading digits pattern is `21` –\n\t\t\t// it's quite obvious in this case that the format could be the one\n\t\t\t// but due to the absence of further digits it would give false negative.\n\t\t\t//\n\t\t\t// Presumably the limitation of \"3 digits min\"\n\t\t\t// is imposed to exclude false matches,\n\t\t\t// e.g. when there are two different formats\n\t\t\t// each one fitting one or two leading digits being input.\n\t\t\t// But for this case I would propose a specific `if/else` condition.\n\t\t\t//\n\t\t\treturn this.national_number.length >= MIN_LEADING_DIGITS_LENGTH;\n\t\t}\n\n\t\t// Check to see if there is an exact pattern match for these digits. If so, we\n\t\t// should use this instead of any other formatting template whose\n\t\t// `leadingDigitsPattern` also matches the input.\n\n\t}, {\n\t\tkey: 'attempt_to_format_complete_phone_number',\n\t\tvalue: function attempt_to_format_complete_phone_number() {\n\t\t\tfor (var _iterator = this.matching_formats, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {\n\t\t\t\tvar _ref;\n\n\t\t\t\tif (_isArray) {\n\t\t\t\t\tif (_i >= _iterator.length) break;\n\t\t\t\t\t_ref = _iterator[_i++];\n\t\t\t\t} else {\n\t\t\t\t\t_i = _iterator.next();\n\t\t\t\t\tif (_i.done) break;\n\t\t\t\t\t_ref = _i.value;\n\t\t\t\t}\n\n\t\t\t\tvar format = _ref;\n\n\t\t\t\tvar matcher = new RegExp('^(?:' + format.pattern() + ')$');\n\n\t\t\t\tif (!matcher.test(this.national_number)) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tif (!this.is_format_applicable(format)) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t// To leave the formatter in a consistent state\n\t\t\t\tthis.reset_format();\n\t\t\t\tthis.chosen_format = format;\n\n\t\t\t\tvar formatted_number = format_national_number_using_format(this.national_number, format, this.is_international(), this.national_prefix.length > 0, this.metadata);\n\n\t\t\t\t// Set `this.template` and `this.partially_populated_template`.\n\t\t\t\t//\n\t\t\t\t// `else` case doesn't ever happen\n\t\t\t\t// with the current metadata,\n\t\t\t\t// but just in case.\n\t\t\t\t//\n\t\t\t\t/* istanbul ignore else */\n\t\t\t\tif (this.create_formatting_template(format)) {\n\t\t\t\t\t// Populate `this.partially_populated_template`\n\t\t\t\t\tthis.reformat_national_number();\n\t\t\t\t} else {\n\t\t\t\t\t// Prepend `+CountryCode` in case of an international phone number\n\t\t\t\t\tvar full_number = this.full_phone_number(formatted_number);\n\t\t\t\t\tthis.template = full_number.replace(/[\\d\\+]/g, DIGIT_PLACEHOLDER);\n\t\t\t\t\tthis.partially_populated_template = full_number;\n\t\t\t\t}\n\n\t\t\t\treturn formatted_number;\n\t\t\t}\n\t\t}\n\n\t\t// Prepends `+CountryCode` in case of an international phone number\n\n\t}, {\n\t\tkey: 'full_phone_number',\n\t\tvalue: function full_phone_number(formatted_national_number) {\n\t\t\tif (this.is_international()) {\n\t\t\t\treturn '+' + this.countryCallingCode + ' ' + formatted_national_number;\n\t\t\t}\n\n\t\t\treturn formatted_national_number;\n\t\t}\n\n\t\t// Extracts the country calling code from the beginning\n\t\t// of the entered `national_number` (so far),\n\t\t// and places the remaining input into the `national_number`.\n\n\t}, {\n\t\tkey: 'extract_country_calling_code',\n\t\tvalue: function extract_country_calling_code() {\n\t\t\tvar _extractCountryCallin = extractCountryCallingCode(this.parsed_input, this.default_country, this.metadata.metadata),\n\t\t\t countryCallingCode = _extractCountryCallin.countryCallingCode,\n\t\t\t number = _extractCountryCallin.number;\n\n\t\t\tif (!countryCallingCode) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tthis.countryCallingCode = countryCallingCode;\n\n\t\t\t// Sometimes people erroneously write national prefix\n\t\t\t// as part of an international number, e.g. +44 (0) ....\n\t\t\t// This violates the standards for international phone numbers,\n\t\t\t// so \"As You Type\" formatter assumes no national prefix\n\t\t\t// when parsing a phone number starting from `+`.\n\t\t\t// Even if it did attempt to filter-out that national prefix\n\t\t\t// it would look weird for a user trying to enter a digit\n\t\t\t// because from user's perspective the keyboard \"wouldn't be working\".\n\t\t\tthis.national_number = number;\n\n\t\t\tthis.metadata.chooseCountryByCountryCallingCode(countryCallingCode);\n\t\t\treturn this.metadata.selectedCountry() !== undefined;\n\t\t}\n\t}, {\n\t\tkey: 'extract_national_prefix',\n\t\tvalue: function extract_national_prefix() {\n\t\t\tthis.national_prefix = '';\n\n\t\t\tif (!this.metadata.selectedCountry()) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Only strip national prefixes for non-international phone numbers\n\t\t\t// because national prefixes can't be present in international phone numbers.\n\t\t\t// Otherwise, while forgiving, it would parse a NANPA number `+1 1877 215 5230`\n\t\t\t// first to `1877 215 5230` and then, stripping the leading `1`, to `877 215 5230`,\n\t\t\t// and then it would assume that's a valid number which it isn't.\n\t\t\t// So no forgiveness for grandmas here.\n\t\t\t// The issue asking for this fix:\n\t\t\t// https://github.com/catamphetamine/libphonenumber-js/issues/159\n\n\t\t\tvar _strip_national_prefi = strip_national_prefix_and_carrier_code(this.national_number, this.metadata),\n\t\t\t potential_national_number = _strip_national_prefi.number,\n\t\t\t carrierCode = _strip_national_prefi.carrierCode;\n\n\t\t\tif (carrierCode) {\n\t\t\t\tthis.carrierCode = carrierCode;\n\t\t\t}\n\n\t\t\t// We require that the NSN remaining after stripping the national prefix and\n\t\t\t// carrier code be long enough to be a possible length for the region.\n\t\t\t// Otherwise, we don't do the stripping, since the original number could be\n\t\t\t// a valid short number.\n\t\t\tif (!this.metadata.possibleLengths() || this.is_possible_number(this.national_number) && !this.is_possible_number(potential_national_number)) {\n\t\t\t\t// Verify the parsed national (significant) number for this country\n\t\t\t\t//\n\t\t\t\t// If the original number (before stripping national prefix) was viable,\n\t\t\t\t// and the resultant number is not, then prefer the original phone number.\n\t\t\t\t// This is because for some countries (e.g. Russia) the same digit could be both\n\t\t\t\t// a national prefix and a leading digit of a valid national phone number,\n\t\t\t\t// like `8` is the national prefix for Russia and both\n\t\t\t\t// `8 800 555 35 35` and `800 555 35 35` are valid numbers.\n\t\t\t\tif (matches_entirely(this.national_number, this.metadata.nationalNumberPattern()) && !matches_entirely(potential_national_number, this.metadata.nationalNumberPattern())) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tthis.national_prefix = this.national_number.slice(0, this.national_number.length - potential_national_number.length);\n\t\t\tthis.national_number = potential_national_number;\n\n\t\t\treturn this.national_prefix;\n\t\t}\n\t}, {\n\t\tkey: 'is_possible_number',\n\t\tvalue: function is_possible_number(number) {\n\t\t\tvar validation_result = check_number_length_for_type(number, undefined, this.metadata);\n\t\t\tswitch (validation_result) {\n\t\t\t\tcase 'IS_POSSIBLE':\n\t\t\t\t\treturn true;\n\t\t\t\t// case 'IS_POSSIBLE_LOCAL_ONLY':\n\t\t\t\t// \treturn !this.is_international()\n\t\t\t\tdefault:\n\t\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t}, {\n\t\tkey: 'choose_another_format',\n\t\tvalue: function choose_another_format() {\n\t\t\t// When there are multiple available formats, the formatter uses the first\n\t\t\t// format where a formatting template could be created.\n\t\t\tfor (var _iterator2 = this.matching_formats, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : _iterator2[Symbol.iterator]();;) {\n\t\t\t\tvar _ref2;\n\n\t\t\t\tif (_isArray2) {\n\t\t\t\t\tif (_i2 >= _iterator2.length) break;\n\t\t\t\t\t_ref2 = _iterator2[_i2++];\n\t\t\t\t} else {\n\t\t\t\t\t_i2 = _iterator2.next();\n\t\t\t\t\tif (_i2.done) break;\n\t\t\t\t\t_ref2 = _i2.value;\n\t\t\t\t}\n\n\t\t\t\tvar format = _ref2;\n\n\t\t\t\t// If this format is currently being used\n\t\t\t\t// and is still possible, then stick to it.\n\t\t\t\tif (this.chosen_format === format) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// If this `format` is suitable for \"as you type\",\n\t\t\t\t// then extract the template from this format\n\t\t\t\t// and use it to format the phone number being input.\n\n\t\t\t\tif (!this.is_format_applicable(format)) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tif (!this.create_formatting_template(format)) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tthis.chosen_format = format;\n\n\t\t\t\t// With a new formatting template, the matched position\n\t\t\t\t// using the old template needs to be reset.\n\t\t\t\tthis.last_match_position = -1;\n\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\t// No format matches the phone number,\n\t\t\t// therefore set `country` to `undefined`\n\t\t\t// (or to the default country).\n\t\t\tthis.reset_country();\n\n\t\t\t// No format matches the national phone number entered\n\t\t\tthis.reset_format();\n\t\t}\n\t}, {\n\t\tkey: 'is_format_applicable',\n\t\tvalue: function is_format_applicable(format) {\n\t\t\t// If national prefix is mandatory for this phone number format\n\t\t\t// and the user didn't input the national prefix,\n\t\t\t// then this phone number format isn't suitable.\n\t\t\tif (!this.is_international() && !this.national_prefix && format.nationalPrefixIsMandatoryWhenFormatting()) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\treturn true;\n\t\t}\n\t}, {\n\t\tkey: 'create_formatting_template',\n\t\tvalue: function create_formatting_template(format) {\n\t\t\t// The formatter doesn't format numbers when numberPattern contains '|', e.g.\n\t\t\t// (20|3)\\d{4}. In those cases we quickly return.\n\t\t\t// (Though there's no such format in current metadata)\n\t\t\t/* istanbul ignore if */\n\t\t\tif (format.pattern().indexOf('|') >= 0) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Get formatting template for this phone number format\n\t\t\tvar template = this.get_template_for_phone_number_format_pattern(format);\n\n\t\t\t// If the national number entered is too long\n\t\t\t// for any phone number format, then abort.\n\t\t\tif (!template) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// This one is for national number only\n\t\t\tthis.partially_populated_template = template;\n\n\t\t\t// For convenience, the public `.template` property\n\t\t\t// contains the whole international number\n\t\t\t// if the phone number being input is international:\n\t\t\t// 'x' for the '+' sign, 'x'es for the country phone code,\n\t\t\t// a spacebar and then the template for the formatted national number.\n\t\t\tif (this.is_international()) {\n\t\t\t\tthis.template = DIGIT_PLACEHOLDER + repeat(DIGIT_PLACEHOLDER, this.countryCallingCode.length) + ' ' + template;\n\t\t\t}\n\t\t\t// For local numbers, replace national prefix\n\t\t\t// with a digit placeholder.\n\t\t\telse {\n\t\t\t\t\tthis.template = template.replace(/\\d/g, DIGIT_PLACEHOLDER);\n\t\t\t\t}\n\n\t\t\t// This one is for the full phone number\n\t\t\treturn this.template;\n\t\t}\n\n\t\t// Generates formatting template for a phone number format\n\n\t}, {\n\t\tkey: 'get_template_for_phone_number_format_pattern',\n\t\tvalue: function get_template_for_phone_number_format_pattern(format) {\n\t\t\t// A very smart trick by the guys at Google\n\t\t\tvar number_pattern = format.pattern()\n\t\t\t// Replace anything in the form of [..] with \\d\n\t\t\t.replace(CREATE_CHARACTER_CLASS_PATTERN(), '\\\\d')\n\t\t\t// Replace any standalone digit (not the one in `{}`) with \\d\n\t\t\t.replace(CREATE_STANDALONE_DIGIT_PATTERN(), '\\\\d');\n\n\t\t\t// This match will always succeed,\n\t\t\t// because the \"longest dummy phone number\"\n\t\t\t// has enough length to accomodate any possible\n\t\t\t// national phone number format pattern.\n\t\t\tvar dummy_phone_number_matching_format_pattern = LONGEST_DUMMY_PHONE_NUMBER.match(number_pattern)[0];\n\n\t\t\t// If the national number entered is too long\n\t\t\t// for any phone number format, then abort.\n\t\t\tif (this.national_number.length > dummy_phone_number_matching_format_pattern.length) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Prepare the phone number format\n\t\t\tvar number_format = this.get_format_format(format);\n\n\t\t\t// Get a formatting template which can be used to efficiently format\n\t\t\t// a partial number where digits are added one by one.\n\n\t\t\t// Below `strict_pattern` is used for the\n\t\t\t// regular expression (with `^` and `$`).\n\t\t\t// This wasn't originally in Google's `libphonenumber`\n\t\t\t// and I guess they don't really need it\n\t\t\t// because they're not using \"templates\" to format phone numbers\n\t\t\t// but I added `strict_pattern` after encountering\n\t\t\t// South Korean phone number formatting bug.\n\t\t\t//\n\t\t\t// Non-strict regular expression bug demonstration:\n\t\t\t//\n\t\t\t// this.national_number : `111111111` (9 digits)\n\t\t\t//\n\t\t\t// number_pattern : (\\d{2})(\\d{3,4})(\\d{4})\n\t\t\t// number_format : `$1 $2 $3`\n\t\t\t// dummy_phone_number_matching_format_pattern : `9999999999` (10 digits)\n\t\t\t//\n\t\t\t// '9999999999'.replace(new RegExp(/(\\d{2})(\\d{3,4})(\\d{4})/g), '$1 $2 $3') = \"99 9999 9999\"\n\t\t\t//\n\t\t\t// template : xx xxxx xxxx\n\t\t\t//\n\t\t\t// But the correct template in this case is `xx xxx xxxx`.\n\t\t\t// The template was generated incorrectly because of the\n\t\t\t// `{3,4}` variability in the `number_pattern`.\n\t\t\t//\n\t\t\t// The fix is, if `this.national_number` has already sufficient length\n\t\t\t// to satisfy the `number_pattern` completely then `this.national_number` is used\n\t\t\t// instead of `dummy_phone_number_matching_format_pattern`.\n\n\t\t\tvar strict_pattern = new RegExp('^' + number_pattern + '$');\n\t\t\tvar national_number_dummy_digits = this.national_number.replace(/\\d/g, DUMMY_DIGIT);\n\n\t\t\t// If `this.national_number` has already sufficient length\n\t\t\t// to satisfy the `number_pattern` completely then use it\n\t\t\t// instead of `dummy_phone_number_matching_format_pattern`.\n\t\t\tif (strict_pattern.test(national_number_dummy_digits)) {\n\t\t\t\tdummy_phone_number_matching_format_pattern = national_number_dummy_digits;\n\t\t\t}\n\n\t\t\t// Generate formatting template for this phone number format\n\t\t\treturn dummy_phone_number_matching_format_pattern\n\t\t\t// Format the dummy phone number according to the format\n\t\t\t.replace(new RegExp(number_pattern), number_format)\n\t\t\t// Replace each dummy digit with a DIGIT_PLACEHOLDER\n\t\t\t.replace(new RegExp(DUMMY_DIGIT, 'g'), DIGIT_PLACEHOLDER);\n\t\t}\n\t}, {\n\t\tkey: 'format_next_national_number_digits',\n\t\tvalue: function format_next_national_number_digits(digits) {\n\t\t\t// Using `.split('')` to iterate through a string here\n\t\t\t// to avoid requiring `Symbol.iterator` polyfill.\n\t\t\t// `.split('')` is generally not safe for Unicode,\n\t\t\t// but in this particular case for `digits` it is safe.\n\t\t\t// for (const digit of digits)\n\t\t\tfor (var _iterator3 = digits.split(''), _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : _iterator3[Symbol.iterator]();;) {\n\t\t\t\tvar _ref3;\n\n\t\t\t\tif (_isArray3) {\n\t\t\t\t\tif (_i3 >= _iterator3.length) break;\n\t\t\t\t\t_ref3 = _iterator3[_i3++];\n\t\t\t\t} else {\n\t\t\t\t\t_i3 = _iterator3.next();\n\t\t\t\t\tif (_i3.done) break;\n\t\t\t\t\t_ref3 = _i3.value;\n\t\t\t\t}\n\n\t\t\t\tvar digit = _ref3;\n\n\t\t\t\t// If there is room for more digits in current `template`,\n\t\t\t\t// then set the next digit in the `template`,\n\t\t\t\t// and return the formatted digits so far.\n\n\t\t\t\t// If more digits are entered than the current format could handle\n\t\t\t\tif (this.partially_populated_template.slice(this.last_match_position + 1).search(DIGIT_PLACEHOLDER_MATCHER) === -1) {\n\t\t\t\t\t// Reset the current format,\n\t\t\t\t\t// so that the new format will be chosen\n\t\t\t\t\t// in a subsequent `this.choose_another_format()` call\n\t\t\t\t\t// later in code.\n\t\t\t\t\tthis.chosen_format = undefined;\n\t\t\t\t\tthis.template = undefined;\n\t\t\t\t\tthis.partially_populated_template = undefined;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tthis.last_match_position = this.partially_populated_template.search(DIGIT_PLACEHOLDER_MATCHER);\n\t\t\t\tthis.partially_populated_template = this.partially_populated_template.replace(DIGIT_PLACEHOLDER_MATCHER, digit);\n\t\t\t}\n\n\t\t\t// Return the formatted phone number so far.\n\t\t\treturn cut_stripping_dangling_braces(this.partially_populated_template, this.last_match_position + 1);\n\n\t\t\t// The old way which was good for `input-format` but is not so good\n\t\t\t// for `react-phone-number-input`'s default input (`InputBasic`).\n\t\t\t// return close_dangling_braces(this.partially_populated_template, this.last_match_position + 1)\n\t\t\t// \t.replace(DIGIT_PLACEHOLDER_MATCHER_GLOBAL, ' ')\n\t\t}\n\t}, {\n\t\tkey: 'is_international',\n\t\tvalue: function is_international() {\n\t\t\treturn this.parsed_input && this.parsed_input[0] === '+';\n\t\t}\n\t}, {\n\t\tkey: 'get_format_format',\n\t\tvalue: function get_format_format(format) {\n\t\t\tif (this.is_international()) {\n\t\t\t\treturn local_to_international_style(format.internationalFormat());\n\t\t\t}\n\n\t\t\t// If national prefix formatting rule is set\n\t\t\t// for this phone number format\n\t\t\tif (format.nationalPrefixFormattingRule()) {\n\t\t\t\t// If the user did input the national prefix\n\t\t\t\t// (or if the national prefix formatting rule does not require national prefix)\n\t\t\t\t// then maybe make it part of the phone number template\n\t\t\t\tif (this.national_prefix || !format.usesNationalPrefix()) {\n\t\t\t\t\t// Make the national prefix part of the phone number template\n\t\t\t\t\treturn format.format().replace(FIRST_GROUP_PATTERN, format.nationalPrefixFormattingRule());\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn format.format();\n\t\t}\n\n\t\t// Determines the country of the phone number\n\t\t// entered so far based on the country phone code\n\t\t// and the national phone number.\n\n\t}, {\n\t\tkey: 'determine_the_country',\n\t\tvalue: function determine_the_country() {\n\t\t\tthis.country = find_country_code(this.countryCallingCode, this.national_number, this.metadata);\n\t\t}\n\t}, {\n\t\tkey: 'getNumber',\n\t\tvalue: function getNumber() {\n\t\t\tif (!this.countryCallingCode || !this.national_number) {\n\t\t\t\treturn undefined;\n\t\t\t}\n\t\t\tvar phoneNumber = new PhoneNumber(this.country || this.countryCallingCode, this.national_number, this.metadata.metadata);\n\t\t\tif (this.carrierCode) {\n\t\t\t\tphoneNumber.carrierCode = this.carrierCode;\n\t\t\t}\n\t\t\t// Phone number extensions are not supported by \"As You Type\" formatter.\n\t\t\treturn phoneNumber;\n\t\t}\n\t}, {\n\t\tkey: 'getNationalNumber',\n\t\tvalue: function getNationalNumber() {\n\t\t\treturn this.national_number;\n\t\t}\n\t}, {\n\t\tkey: 'getTemplate',\n\t\tvalue: function getTemplate() {\n\t\t\tif (!this.template) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tvar index = -1;\n\n\t\t\tvar i = 0;\n\t\t\twhile (i < this.parsed_input.length) {\n\t\t\t\tindex = this.template.indexOf(DIGIT_PLACEHOLDER, index + 1);\n\t\t\t\ti++;\n\t\t\t}\n\n\t\t\treturn cut_stripping_dangling_braces(this.template, index + 1);\n\t\t}\n\t}]);\n\n\treturn AsYouType;\n}();\n\nexport default AsYouType;\n\n\nexport function strip_dangling_braces(string) {\n\tvar dangling_braces = [];\n\tvar i = 0;\n\twhile (i < string.length) {\n\t\tif (string[i] === '(') {\n\t\t\tdangling_braces.push(i);\n\t\t} else if (string[i] === ')') {\n\t\t\tdangling_braces.pop();\n\t\t}\n\t\ti++;\n\t}\n\n\tvar start = 0;\n\tvar cleared_string = '';\n\tdangling_braces.push(string.length);\n\tfor (var _iterator4 = dangling_braces, _isArray4 = Array.isArray(_iterator4), _i4 = 0, _iterator4 = _isArray4 ? _iterator4 : _iterator4[Symbol.iterator]();;) {\n\t\tvar _ref4;\n\n\t\tif (_isArray4) {\n\t\t\tif (_i4 >= _iterator4.length) break;\n\t\t\t_ref4 = _iterator4[_i4++];\n\t\t} else {\n\t\t\t_i4 = _iterator4.next();\n\t\t\tif (_i4.done) break;\n\t\t\t_ref4 = _i4.value;\n\t\t}\n\n\t\tvar index = _ref4;\n\n\t\tcleared_string += string.slice(start, index);\n\t\tstart = index + 1;\n\t}\n\n\treturn cleared_string;\n}\n\nexport function cut_stripping_dangling_braces(string, cut_before_index) {\n\tif (string[cut_before_index] === ')') {\n\t\tcut_before_index++;\n\t}\n\treturn strip_dangling_braces(string.slice(0, cut_before_index));\n}\n\nexport function close_dangling_braces(template, cut_before) {\n\tvar retained_template = template.slice(0, cut_before);\n\n\tvar opening_braces = count_occurences('(', retained_template);\n\tvar closing_braces = count_occurences(')', retained_template);\n\n\tvar dangling_braces = opening_braces - closing_braces;\n\twhile (dangling_braces > 0 && cut_before < template.length) {\n\t\tif (template[cut_before] === ')') {\n\t\t\tdangling_braces--;\n\t\t}\n\t\tcut_before++;\n\t}\n\n\treturn template.slice(0, cut_before);\n}\n\n// Counts all occurences of a symbol in a string.\n// Unicode-unsafe (because using `.split()`).\nexport function count_occurences(symbol, string) {\n\tvar count = 0;\n\n\t// Using `.split('')` to iterate through a string here\n\t// to avoid requiring `Symbol.iterator` polyfill.\n\t// `.split('')` is generally not safe for Unicode,\n\t// but in this particular case for counting brackets it is safe.\n\t// for (const character of string)\n\tfor (var _iterator5 = string.split(''), _isArray5 = Array.isArray(_iterator5), _i5 = 0, _iterator5 = _isArray5 ? _iterator5 : _iterator5[Symbol.iterator]();;) {\n\t\tvar _ref5;\n\n\t\tif (_isArray5) {\n\t\t\tif (_i5 >= _iterator5.length) break;\n\t\t\t_ref5 = _iterator5[_i5++];\n\t\t} else {\n\t\t\t_i5 = _iterator5.next();\n\t\t\tif (_i5.done) break;\n\t\t\t_ref5 = _i5.value;\n\t\t}\n\n\t\tvar character = _ref5;\n\n\t\tif (character === symbol) {\n\t\t\tcount++;\n\t\t}\n\t}\n\n\treturn count;\n}\n\n// Repeats a string (or a symbol) N times.\n// http://stackoverflow.com/questions/202605/repeat-string-javascript\nexport function repeat(string, times) {\n\tif (times < 1) {\n\t\treturn '';\n\t}\n\n\tvar result = '';\n\n\twhile (times > 1) {\n\t\tif (times & 1) {\n\t\t\tresult += string;\n\t\t}\n\n\t\ttimes >>= 1;\n\t\tstring += string;\n\t}\n\n\treturn result + string;\n}\n//# sourceMappingURL=AsYouType.js.map","// Javascript doesn't support UTF-8 regular expressions.\n// So mimicking them here.\n\n// Copy-pasted from `PhoneNumberMatcher.js`.\n\n/**\n * \"\\p{Z}\" is any kind of whitespace or invisible separator (\"Separator\").\n * http://www.regular-expressions.info/unicode.html\n * \"\\P{Z}\" is the reverse of \"\\p{Z}\".\n * \"\\p{N}\" is any kind of numeric character in any script (\"Number\").\n * \"\\p{Nd}\" is a digit zero through nine in any script except \"ideographic scripts\" (\"Decimal_Digit_Number\").\n * \"\\p{Sc}\" is a currency symbol (\"Currency_Symbol\").\n * \"\\p{L}\" is any kind of letter from any language (\"Letter\").\n * \"\\p{Mn}\" is \"non-spacing mark\".\n *\n * Javascript doesn't support Unicode Regular Expressions\n * so substituting it with this explicit set of characters.\n *\n * https://stackoverflow.com/questions/13210194/javascript-regex-equivalent-of-a-za-z-using-pl\n * https://github.com/danielberndt/babel-plugin-utf-8-regex/blob/master/src/transformer.js\n */\n\nvar _pZ = ' \\xA0\\u1680\\u180E\\u2000-\\u200A\\u2028\\u2029\\u202F\\u205F\\u3000';\nexport var pZ = '[' + _pZ + ']';\nexport var PZ = '[^' + _pZ + ']';\n\nexport var _pN = '0-9\\xB2\\xB3\\xB9\\xBC-\\xBE\\u0660-\\u0669\\u06F0-\\u06F9\\u07C0-\\u07C9\\u0966-\\u096F\\u09E6-\\u09EF\\u09F4-\\u09F9\\u0A66-\\u0A6F\\u0AE6-\\u0AEF\\u0B66-\\u0B6F\\u0B72-\\u0B77\\u0BE6-\\u0BF2\\u0C66-\\u0C6F\\u0C78-\\u0C7E\\u0CE6-\\u0CEF\\u0D66-\\u0D75\\u0E50-\\u0E59\\u0ED0-\\u0ED9\\u0F20-\\u0F33\\u1040-\\u1049\\u1090-\\u1099\\u1369-\\u137C\\u16EE-\\u16F0\\u17E0-\\u17E9\\u17F0-\\u17F9\\u1810-\\u1819\\u1946-\\u194F\\u19D0-\\u19DA\\u1A80-\\u1A89\\u1A90-\\u1A99\\u1B50-\\u1B59\\u1BB0-\\u1BB9\\u1C40-\\u1C49\\u1C50-\\u1C59\\u2070\\u2074-\\u2079\\u2080-\\u2089\\u2150-\\u2182\\u2185-\\u2189\\u2460-\\u249B\\u24EA-\\u24FF\\u2776-\\u2793\\u2CFD\\u3007\\u3021-\\u3029\\u3038-\\u303A\\u3192-\\u3195\\u3220-\\u3229\\u3248-\\u324F\\u3251-\\u325F\\u3280-\\u3289\\u32B1-\\u32BF\\uA620-\\uA629\\uA6E6-\\uA6EF\\uA830-\\uA835\\uA8D0-\\uA8D9\\uA900-\\uA909\\uA9D0-\\uA9D9\\uAA50-\\uAA59\\uABF0-\\uABF9\\uFF10-\\uFF19';\n// const pN = `[${_pN}]`\n\nvar _pNd = '0-9\\u0660-\\u0669\\u06F0-\\u06F9\\u07C0-\\u07C9\\u0966-\\u096F\\u09E6-\\u09EF\\u0A66-\\u0A6F\\u0AE6-\\u0AEF\\u0B66-\\u0B6F\\u0BE6-\\u0BEF\\u0C66-\\u0C6F\\u0CE6-\\u0CEF\\u0D66-\\u0D6F\\u0E50-\\u0E59\\u0ED0-\\u0ED9\\u0F20-\\u0F29\\u1040-\\u1049\\u1090-\\u1099\\u17E0-\\u17E9\\u1810-\\u1819\\u1946-\\u194F\\u19D0-\\u19D9\\u1A80-\\u1A89\\u1A90-\\u1A99\\u1B50-\\u1B59\\u1BB0-\\u1BB9\\u1C40-\\u1C49\\u1C50-\\u1C59\\uA620-\\uA629\\uA8D0-\\uA8D9\\uA900-\\uA909\\uA9D0-\\uA9D9\\uAA50-\\uAA59\\uABF0-\\uABF9\\uFF10-\\uFF19';\nexport var pNd = '[' + _pNd + ']';\n\nexport var _pL = 'A-Za-z\\xAA\\xB5\\xBA\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0370-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u048A-\\u0527\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u05D0-\\u05EA\\u05F0-\\u05F2\\u0620-\\u064A\\u066E\\u066F\\u0671-\\u06D3\\u06D5\\u06E5\\u06E6\\u06EE\\u06EF\\u06FA-\\u06FC\\u06FF\\u0710\\u0712-\\u072F\\u074D-\\u07A5\\u07B1\\u07CA-\\u07EA\\u07F4\\u07F5\\u07FA\\u0800-\\u0815\\u081A\\u0824\\u0828\\u0840-\\u0858\\u08A0\\u08A2-\\u08AC\\u0904-\\u0939\\u093D\\u0950\\u0958-\\u0961\\u0971-\\u0977\\u0979-\\u097F\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BD\\u09CE\\u09DC\\u09DD\\u09DF-\\u09E1\\u09F0\\u09F1\\u0A05-\\u0A0A\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39\\u0A59-\\u0A5C\\u0A5E\\u0A72-\\u0A74\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2\\u0AB3\\u0AB5-\\u0AB9\\u0ABD\\u0AD0\\u0AE0\\u0AE1\\u0B05-\\u0B0C\\u0B0F\\u0B10\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32\\u0B33\\u0B35-\\u0B39\\u0B3D\\u0B5C\\u0B5D\\u0B5F-\\u0B61\\u0B71\\u0B83\\u0B85-\\u0B8A\\u0B8E-\\u0B90\\u0B92-\\u0B95\\u0B99\\u0B9A\\u0B9C\\u0B9E\\u0B9F\\u0BA3\\u0BA4\\u0BA8-\\u0BAA\\u0BAE-\\u0BB9\\u0BD0\\u0C05-\\u0C0C\\u0C0E-\\u0C10\\u0C12-\\u0C28\\u0C2A-\\u0C33\\u0C35-\\u0C39\\u0C3D\\u0C58\\u0C59\\u0C60\\u0C61\\u0C85-\\u0C8C\\u0C8E-\\u0C90\\u0C92-\\u0CA8\\u0CAA-\\u0CB3\\u0CB5-\\u0CB9\\u0CBD\\u0CDE\\u0CE0\\u0CE1\\u0CF1\\u0CF2\\u0D05-\\u0D0C\\u0D0E-\\u0D10\\u0D12-\\u0D3A\\u0D3D\\u0D4E\\u0D60\\u0D61\\u0D7A-\\u0D7F\\u0D85-\\u0D96\\u0D9A-\\u0DB1\\u0DB3-\\u0DBB\\u0DBD\\u0DC0-\\u0DC6\\u0E01-\\u0E30\\u0E32\\u0E33\\u0E40-\\u0E46\\u0E81\\u0E82\\u0E84\\u0E87\\u0E88\\u0E8A\\u0E8D\\u0E94-\\u0E97\\u0E99-\\u0E9F\\u0EA1-\\u0EA3\\u0EA5\\u0EA7\\u0EAA\\u0EAB\\u0EAD-\\u0EB0\\u0EB2\\u0EB3\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EDC-\\u0EDF\\u0F00\\u0F40-\\u0F47\\u0F49-\\u0F6C\\u0F88-\\u0F8C\\u1000-\\u102A\\u103F\\u1050-\\u1055\\u105A-\\u105D\\u1061\\u1065\\u1066\\u106E-\\u1070\\u1075-\\u1081\\u108E\\u10A0-\\u10C5\\u10C7\\u10CD\\u10D0-\\u10FA\\u10FC-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u1380-\\u138F\\u13A0-\\u13F4\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u1700-\\u170C\\u170E-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176C\\u176E-\\u1770\\u1780-\\u17B3\\u17D7\\u17DC\\u1820-\\u1877\\u1880-\\u18A8\\u18AA\\u18B0-\\u18F5\\u1900-\\u191C\\u1950-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19C1-\\u19C7\\u1A00-\\u1A16\\u1A20-\\u1A54\\u1AA7\\u1B05-\\u1B33\\u1B45-\\u1B4B\\u1B83-\\u1BA0\\u1BAE\\u1BAF\\u1BBA-\\u1BE5\\u1C00-\\u1C23\\u1C4D-\\u1C4F\\u1C5A-\\u1C7D\\u1CE9-\\u1CEC\\u1CEE-\\u1CF1\\u1CF5\\u1CF6\\u1D00-\\u1DBF\\u1E00-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u2071\\u207F\\u2090-\\u209C\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u212D\\u212F-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2183\\u2184\\u2C00-\\u2C2E\\u2C30-\\u2C5E\\u2C60-\\u2CE4\\u2CEB-\\u2CEE\\u2CF2\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D80-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2E2F\\u3005\\u3006\\u3031-\\u3035\\u303B\\u303C\\u3041-\\u3096\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312D\\u3131-\\u318E\\u31A0-\\u31BA\\u31F0-\\u31FF\\u3400-\\u4DB5\\u4E00-\\u9FCC\\uA000-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA61F\\uA62A\\uA62B\\uA640-\\uA66E\\uA67F-\\uA697\\uA6A0-\\uA6E5\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA78E\\uA790-\\uA793\\uA7A0-\\uA7AA\\uA7F8-\\uA801\\uA803-\\uA805\\uA807-\\uA80A\\uA80C-\\uA822\\uA840-\\uA873\\uA882-\\uA8B3\\uA8F2-\\uA8F7\\uA8FB\\uA90A-\\uA925\\uA930-\\uA946\\uA960-\\uA97C\\uA984-\\uA9B2\\uA9CF\\uAA00-\\uAA28\\uAA40-\\uAA42\\uAA44-\\uAA4B\\uAA60-\\uAA76\\uAA7A\\uAA80-\\uAAAF\\uAAB1\\uAAB5\\uAAB6\\uAAB9-\\uAABD\\uAAC0\\uAAC2\\uAADB-\\uAADD\\uAAE0-\\uAAEA\\uAAF2-\\uAAF4\\uAB01-\\uAB06\\uAB09-\\uAB0E\\uAB11-\\uAB16\\uAB20-\\uAB26\\uAB28-\\uAB2E\\uABC0-\\uABE2\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D\\uFB1F-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF21-\\uFF3A\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC';\nvar pL = '[' + _pL + ']';\nvar pL_regexp = new RegExp(pL);\n\nvar _pSc = '$\\xA2-\\xA5\\u058F\\u060B\\u09F2\\u09F3\\u09FB\\u0AF1\\u0BF9\\u0E3F\\u17DB\\u20A0-\\u20B9\\uA838\\uFDFC\\uFE69\\uFF04\\uFFE0\\uFFE1\\uFFE5\\uFFE6';\nvar pSc = '[' + _pSc + ']';\nvar pSc_regexp = new RegExp(pSc);\n\nvar _pMn = '\\u0300-\\u036F\\u0483-\\u0487\\u0591-\\u05BD\\u05BF\\u05C1\\u05C2\\u05C4\\u05C5\\u05C7\\u0610-\\u061A\\u064B-\\u065F\\u0670\\u06D6-\\u06DC\\u06DF-\\u06E4\\u06E7\\u06E8\\u06EA-\\u06ED\\u0711\\u0730-\\u074A\\u07A6-\\u07B0\\u07EB-\\u07F3\\u0816-\\u0819\\u081B-\\u0823\\u0825-\\u0827\\u0829-\\u082D\\u0859-\\u085B\\u08E4-\\u08FE\\u0900-\\u0902\\u093A\\u093C\\u0941-\\u0948\\u094D\\u0951-\\u0957\\u0962\\u0963\\u0981\\u09BC\\u09C1-\\u09C4\\u09CD\\u09E2\\u09E3\\u0A01\\u0A02\\u0A3C\\u0A41\\u0A42\\u0A47\\u0A48\\u0A4B-\\u0A4D\\u0A51\\u0A70\\u0A71\\u0A75\\u0A81\\u0A82\\u0ABC\\u0AC1-\\u0AC5\\u0AC7\\u0AC8\\u0ACD\\u0AE2\\u0AE3\\u0B01\\u0B3C\\u0B3F\\u0B41-\\u0B44\\u0B4D\\u0B56\\u0B62\\u0B63\\u0B82\\u0BC0\\u0BCD\\u0C3E-\\u0C40\\u0C46-\\u0C48\\u0C4A-\\u0C4D\\u0C55\\u0C56\\u0C62\\u0C63\\u0CBC\\u0CBF\\u0CC6\\u0CCC\\u0CCD\\u0CE2\\u0CE3\\u0D41-\\u0D44\\u0D4D\\u0D62\\u0D63\\u0DCA\\u0DD2-\\u0DD4\\u0DD6\\u0E31\\u0E34-\\u0E3A\\u0E47-\\u0E4E\\u0EB1\\u0EB4-\\u0EB9\\u0EBB\\u0EBC\\u0EC8-\\u0ECD\\u0F18\\u0F19\\u0F35\\u0F37\\u0F39\\u0F71-\\u0F7E\\u0F80-\\u0F84\\u0F86\\u0F87\\u0F8D-\\u0F97\\u0F99-\\u0FBC\\u0FC6\\u102D-\\u1030\\u1032-\\u1037\\u1039\\u103A\\u103D\\u103E\\u1058\\u1059\\u105E-\\u1060\\u1071-\\u1074\\u1082\\u1085\\u1086\\u108D\\u109D\\u135D-\\u135F\\u1712-\\u1714\\u1732-\\u1734\\u1752\\u1753\\u1772\\u1773\\u17B4\\u17B5\\u17B7-\\u17BD\\u17C6\\u17C9-\\u17D3\\u17DD\\u180B-\\u180D\\u18A9\\u1920-\\u1922\\u1927\\u1928\\u1932\\u1939-\\u193B\\u1A17\\u1A18\\u1A56\\u1A58-\\u1A5E\\u1A60\\u1A62\\u1A65-\\u1A6C\\u1A73-\\u1A7C\\u1A7F\\u1B00-\\u1B03\\u1B34\\u1B36-\\u1B3A\\u1B3C\\u1B42\\u1B6B-\\u1B73\\u1B80\\u1B81\\u1BA2-\\u1BA5\\u1BA8\\u1BA9\\u1BAB\\u1BE6\\u1BE8\\u1BE9\\u1BED\\u1BEF-\\u1BF1\\u1C2C-\\u1C33\\u1C36\\u1C37\\u1CD0-\\u1CD2\\u1CD4-\\u1CE0\\u1CE2-\\u1CE8\\u1CED\\u1CF4\\u1DC0-\\u1DE6\\u1DFC-\\u1DFF\\u20D0-\\u20DC\\u20E1\\u20E5-\\u20F0\\u2CEF-\\u2CF1\\u2D7F\\u2DE0-\\u2DFF\\u302A-\\u302D\\u3099\\u309A\\uA66F\\uA674-\\uA67D\\uA69F\\uA6F0\\uA6F1\\uA802\\uA806\\uA80B\\uA825\\uA826\\uA8C4\\uA8E0-\\uA8F1\\uA926-\\uA92D\\uA947-\\uA951\\uA980-\\uA982\\uA9B3\\uA9B6-\\uA9B9\\uA9BC\\uAA29-\\uAA2E\\uAA31\\uAA32\\uAA35\\uAA36\\uAA43\\uAA4C\\uAAB0\\uAAB2-\\uAAB4\\uAAB7\\uAAB8\\uAABE\\uAABF\\uAAC1\\uAAEC\\uAAED\\uAAF6\\uABE5\\uABE8\\uABED\\uFB1E\\uFE00-\\uFE0F\\uFE20-\\uFE26';\nvar pMn = '[' + _pMn + ']';\nvar pMn_regexp = new RegExp(pMn);\n\nvar _InBasic_Latin = '\\0-\\x7F';\nvar _InLatin_1_Supplement = '\\x80-\\xFF';\nvar _InLatin_Extended_A = '\\u0100-\\u017F';\nvar _InLatin_Extended_Additional = '\\u1E00-\\u1EFF';\nvar _InLatin_Extended_B = '\\u0180-\\u024F';\nvar _InCombining_Diacritical_Marks = '\\u0300-\\u036F';\n\nvar latinLetterRegexp = new RegExp('[' + _InBasic_Latin + _InLatin_1_Supplement + _InLatin_Extended_A + _InLatin_Extended_Additional + _InLatin_Extended_B + _InCombining_Diacritical_Marks + ']');\n\n/**\n * Helper method to determine if a character is a Latin-script letter or not.\n * For our purposes, combining marks should also return true since we assume\n * they have been added to a preceding Latin character.\n */\nexport function isLatinLetter(letter) {\n // Combining marks are a subset of non-spacing-mark.\n if (!pL_regexp.test(letter) && !pMn_regexp.test(letter)) {\n return false;\n }\n\n return latinLetterRegexp.test(letter);\n}\n\nexport function isInvalidPunctuationSymbol(character) {\n return character === '%' || pSc_regexp.test(character);\n}\n//# sourceMappingURL=utf-8.js.map","// Copy-pasted from `PhoneNumberMatcher.js`.\n\nimport { PLUS_CHARS } from '../common';\n\nimport { limit } from './util';\n\nimport { isLatinLetter, isInvalidPunctuationSymbol } from './utf-8';\n\nvar OPENING_PARENS = '(\\\\[\\uFF08\\uFF3B';\nvar CLOSING_PARENS = ')\\\\]\\uFF09\\uFF3D';\nvar NON_PARENS = '[^' + OPENING_PARENS + CLOSING_PARENS + ']';\n\nexport var LEAD_CLASS = '[' + OPENING_PARENS + PLUS_CHARS + ']';\n\n// Punctuation that may be at the start of a phone number - brackets and plus signs.\nvar LEAD_CLASS_LEADING = new RegExp('^' + LEAD_CLASS);\n\n// Limit on the number of pairs of brackets in a phone number.\nvar BRACKET_PAIR_LIMIT = limit(0, 3);\n\n/**\n * Pattern to check that brackets match. Opening brackets should be closed within a phone number.\n * This also checks that there is something inside the brackets. Having no brackets at all is also\n * fine.\n *\n * An opening bracket at the beginning may not be closed, but subsequent ones should be. It's\n * also possible that the leading bracket was dropped, so we shouldn't be surprised if we see a\n * closing bracket first. We limit the sets of brackets in a phone number to four.\n */\nvar MATCHING_BRACKETS_ENTIRE = new RegExp('^' + \"(?:[\" + OPENING_PARENS + \"])?\" + \"(?:\" + NON_PARENS + \"+\" + \"[\" + CLOSING_PARENS + \"])?\" + NON_PARENS + \"+\" + \"(?:[\" + OPENING_PARENS + \"]\" + NON_PARENS + \"+[\" + CLOSING_PARENS + \"])\" + BRACKET_PAIR_LIMIT + NON_PARENS + \"*\" + '$');\n\n/**\n * Matches strings that look like publication pages. Example:\n *

Computing Complete Answers to Queries in the Presence of Limited Access Patterns.\n * Chen Li. VLDB J. 12(3): 211-227 (2003).
\n *\n * The string \"211-227 (2003)\" is not a telephone number.\n */\nvar PUB_PAGES = /\\d{1,5}-+\\d{1,5}\\s{0,4}\\(\\d{1,4}/;\n\nexport default function isValidCandidate(candidate, offset, text, leniency) {\n\t// Check the candidate doesn't contain any formatting\n\t// which would indicate that it really isn't a phone number.\n\tif (!MATCHING_BRACKETS_ENTIRE.test(candidate) || PUB_PAGES.test(candidate)) {\n\t\treturn;\n\t}\n\n\t// If leniency is set to VALID or stricter, we also want to skip numbers that are surrounded\n\t// by Latin alphabetic characters, to skip cases like abc8005001234 or 8005001234def.\n\tif (leniency !== 'POSSIBLE') {\n\t\t// If the candidate is not at the start of the text,\n\t\t// and does not start with phone-number punctuation,\n\t\t// check the previous character.\n\t\tif (offset > 0 && !LEAD_CLASS_LEADING.test(candidate)) {\n\t\t\tvar previousChar = text[offset - 1];\n\t\t\t// We return null if it is a latin letter or an invalid punctuation symbol.\n\t\t\tif (isInvalidPunctuationSymbol(previousChar) || isLatinLetter(previousChar)) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\tvar lastCharIndex = offset + candidate.length;\n\t\tif (lastCharIndex < text.length) {\n\t\t\tvar nextChar = text[lastCharIndex];\n\t\t\tif (isInvalidPunctuationSymbol(nextChar) || isLatinLetter(nextChar)) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t}\n\n\treturn true;\n}\n//# sourceMappingURL=isValidCandidate.js.map","// Matches strings that look like dates using \"/\" as a separator.\n// Examples: 3/10/2011, 31/10/96 or 08/31/95.\nvar SLASH_SEPARATED_DATES = /(?:(?:[0-3]?\\d\\/[01]?\\d)|(?:[01]?\\d\\/[0-3]?\\d))\\/(?:[12]\\d)?\\d{2}/;\n\n// Matches timestamps.\n// Examples: \"2012-01-02 08:00\".\n// Note that the reg-ex does not include the\n// trailing \":\\d\\d\" -- that is covered by TIME_STAMPS_SUFFIX.\nvar TIME_STAMPS = /[12]\\d{3}[-/]?[01]\\d[-/]?[0-3]\\d +[0-2]\\d$/;\nvar TIME_STAMPS_SUFFIX_LEADING = /^:[0-5]\\d/;\n\nexport default function isValidPreCandidate(candidate, offset, text) {\n\t// Skip a match that is more likely to be a date.\n\tif (SLASH_SEPARATED_DATES.test(candidate)) {\n\t\treturn false;\n\t}\n\n\t// Skip potential time-stamps.\n\tif (TIME_STAMPS.test(candidate)) {\n\t\tvar followingText = text.slice(offset + candidate.length);\n\t\tif (TIME_STAMPS_SUFFIX_LEADING.test(followingText)) {\n\t\t\treturn false;\n\t\t}\n\t}\n\n\treturn true;\n}\n//# sourceMappingURL=isValidPreCandidate.js.map","import { trimAfterFirstMatch } from './util';\n\n// Regular expression of characters typically used to start a second phone number for the purposes\n// of parsing. This allows us to strip off parts of the number that are actually the start of\n// another number, such as for: (530) 583-6985 x302/x2303 -> the second extension here makes this\n// actually two phone numbers, (530) 583-6985 x302 and (530) 583-6985 x2303. We remove the second\n// extension so that the first number is parsed correctly.\n//\n// Matches a slash (\\ or /) followed by a space followed by an `x`.\n//\nvar SECOND_NUMBER_START_PATTERN = /[\\\\/] *x/;\n\nexport default function parsePreCandidate(candidate) {\n\t// Check for extra numbers at the end.\n\t// TODO: This is the place to start when trying to support extraction of multiple phone number\n\t// from split notations (+41 79 123 45 67 / 68).\n\treturn trimAfterFirstMatch(SECOND_NUMBER_START_PATTERN, candidate);\n}\n//# sourceMappingURL=parsePreCandidate.js.map","import Metadata from './metadata';\n\nexport default function (country, metadata) {\n\tmetadata = new Metadata(metadata);\n\n\tif (!metadata.hasCountry(country)) {\n\t\tthrow new Error('Unknown country: ' + country);\n\t}\n\n\treturn metadata.country(country).countryCallingCode();\n}\n//# sourceMappingURL=getCountryCallingCode.js.map","import Metadata from './metadata';\nimport { matches_entirely, VALID_DIGITS } from './common';\n\nvar CAPTURING_DIGIT_PATTERN = new RegExp('([' + VALID_DIGITS + '])');\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 = /^[\\d]+(?:[~\\u2053\\u223C\\uFF5E][\\d]+)?$/;\n\n// For regions that have multiple IDD prefixes\n// a preferred IDD prefix is returned.\nexport function getIDDPrefix(country, metadata) {\n\tvar countryMetadata = new Metadata(metadata);\n\tcountryMetadata.country(country);\n\n\tif (SINGLE_IDD_PREFIX.test(countryMetadata.IDDPrefix())) {\n\t\treturn countryMetadata.IDDPrefix();\n\t}\n\n\treturn countryMetadata.defaultIDDPrefix();\n}\n\nexport function stripIDDPrefix(number, country, metadata) {\n\tif (!country) {\n\t\treturn;\n\t}\n\n\t// Check if the number is IDD-prefixed.\n\n\tvar countryMetadata = new Metadata(metadata);\n\tcountryMetadata.country(country);\n\n\tvar IDDPrefixPattern = new RegExp(countryMetadata.IDDPrefix());\n\n\tif (number.search(IDDPrefixPattern) !== 0) {\n\t\treturn;\n\t}\n\n\t// Strip IDD prefix.\n\tnumber = number.slice(number.match(IDDPrefixPattern)[0].length);\n\n\t// Some kind of a weird edge case.\n\t// No explanation from Google given.\n\tvar matchedGroups = number.match(CAPTURING_DIGIT_PATTERN);\n\t/* istanbul ignore next */\n\tif (matchedGroups && matchedGroups[1] != null && matchedGroups[1].length > 0) {\n\t\tif (matchedGroups[1] === '0') {\n\t\t\treturn;\n\t\t}\n\t}\n\n\treturn number;\n}\n//# sourceMappingURL=IDD.js.map","import AsYouType from './AsYouType';\n\n/**\n * Formats a (possibly incomplete) phone number.\n * The phone number can be either in E.164 format\n * or in a form of national number digits.\n * @param {string} value - A possibly incomplete phone number. Either in E.164 format or in a form of national number digits.\n * @param {string?} country - Two-letter (\"ISO 3166-1 alpha-2\") country code.\n * @return {string} Formatted (possibly incomplete) phone number.\n */\nexport default function formatIncompletePhoneNumber(value, country, metadata) {\n if (!metadata) {\n metadata = country;\n country = undefined;\n }\n return new AsYouType(country, metadata).input(value);\n}\n//# sourceMappingURL=formatIncompletePhoneNumber.js.map","function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nimport { sort_out_arguments } from './findPhoneNumbers';\nimport PhoneNumberMatcher from './PhoneNumberMatcher';\n\n/**\n * @return ES6 `for ... of` iterator.\n */\nexport default function searchNumbers(arg_1, arg_2, arg_3, arg_4) {\n\tvar _sort_out_arguments = sort_out_arguments(arg_1, arg_2, arg_3, arg_4),\n\t text = _sort_out_arguments.text,\n\t options = _sort_out_arguments.options,\n\t metadata = _sort_out_arguments.metadata;\n\n\tvar matcher = new PhoneNumberMatcher(text, options, metadata);\n\n\treturn _defineProperty({}, Symbol.iterator, function () {\n\t\treturn {\n\t\t\tnext: function next() {\n\t\t\t\tif (matcher.hasNext()) {\n\t\t\t\t\treturn {\n\t\t\t\t\t\tdone: false,\n\t\t\t\t\t\tvalue: matcher.next()\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t\treturn {\n\t\t\t\t\tdone: true\n\t\t\t\t};\n\t\t\t}\n\t\t};\n\t});\n}\n//# sourceMappingURL=searchNumbers.js.map","import parseNumber from '../parse';\nimport isValidNumber from '../validate';\nimport { parseDigit } from '../common';\n\nimport { startsWith, endsWith } from './util';\n\n/**\n * Leniency when finding potential phone numbers in text segments\n * The levels here are ordered in increasing strictness.\n */\nexport default {\n /**\n * Phone numbers accepted are \"possible\", but not necessarily \"valid\".\n */\n POSSIBLE: function POSSIBLE(number, candidate, metadata) {\n return true;\n },\n\n\n /**\n * Phone numbers accepted are \"possible\" and \"valid\".\n * Numbers written in national format must have their national-prefix\n * present if it is usually written for a number of this type.\n */\n VALID: function VALID(number, candidate, metadata) {\n if (!isValidNumber(number, metadata) || !containsOnlyValidXChars(number, candidate.toString(), metadata)) {\n return false;\n }\n\n // Skipped for simplicity.\n // return isNationalPrefixPresentIfRequired(number, metadata)\n return true;\n },\n\n\n /**\n * Phone numbers accepted are \"valid\" and\n * are grouped in a possible way for this locale. For example, a US number written as\n * \"65 02 53 00 00\" and \"650253 0000\" are not accepted at this leniency level, whereas\n * \"650 253 0000\", \"650 2530000\" or \"6502530000\" are.\n * Numbers with more than one '/' symbol in the national significant number\n * are also dropped at this level.\n *\n * Warning: This level might result in lower coverage especially for regions outside of\n * country code \"+1\". If you are not sure about which level to use,\n * email the discussion group libphonenumber-discuss@googlegroups.com.\n */\n STRICT_GROUPING: function STRICT_GROUPING(number, candidate, metadata) {\n var candidateString = candidate.toString();\n\n if (!isValidNumber(number, metadata) || !containsOnlyValidXChars(number, candidateString, metadata) || containsMoreThanOneSlashInNationalNumber(number, candidateString) || !isNationalPrefixPresentIfRequired(number, metadata)) {\n return false;\n }\n\n return checkNumberGroupingIsValid(number, candidate, metadata, allNumberGroupsRemainGrouped);\n },\n\n\n /**\n * Phone numbers accepted are {@linkplain PhoneNumberUtil#isValidNumber(PhoneNumber) valid} and\n * are grouped in the same way that we would have formatted it, or as a single block. For\n * example, a US number written as \"650 2530000\" is not accepted at this leniency level, whereas\n * \"650 253 0000\" or \"6502530000\" are.\n * Numbers with more than one '/' symbol are also dropped at this level.\n *

\n * Warning: This level might result in lower coverage especially for regions outside of country\n * code \"+1\". If you are not sure about which level to use, email the discussion group\n * libphonenumber-discuss@googlegroups.com.\n */\n EXACT_GROUPING: function EXACT_GROUPING(number, candidate, metadata) {\n var candidateString = candidate.toString();\n\n if (!isValidNumber(number, metadata) || !containsOnlyValidXChars(number, candidateString, metadata) || containsMoreThanOneSlashInNationalNumber(number, candidateString) || !isNationalPrefixPresentIfRequired(number, metadata)) {\n return false;\n }\n\n return checkNumberGroupingIsValid(number, candidate, metadata, allNumberGroupsAreExactlyPresent);\n }\n};\n\nfunction containsOnlyValidXChars(number, candidate, metadata) {\n // The characters 'x' and 'X' can be (1) a carrier code, in which case they always precede the\n // national significant number or (2) an extension sign, in which case they always precede the\n // extension number. We assume a carrier code is more than 1 digit, so the first case has to\n // have more than 1 consecutive 'x' or 'X', whereas the second case can only have exactly 1 'x'\n // or 'X'. We ignore the character if it appears as the last character of the string.\n for (var index = 0; index < candidate.length - 1; index++) {\n var charAtIndex = candidate.charAt(index);\n\n if (charAtIndex === 'x' || charAtIndex === 'X') {\n var charAtNextIndex = candidate.charAt(index + 1);\n\n if (charAtNextIndex === 'x' || charAtNextIndex === 'X') {\n // This is the carrier code case, in which the 'X's always precede the national\n // significant number.\n index++;\n if (util.isNumberMatch(number, candidate.substring(index)) != MatchType.NSN_MATCH) {\n return false;\n }\n // This is the extension sign case, in which the 'x' or 'X' should always precede the\n // extension number.\n } else if (parseDigits(candidate.substring(index)) !== number.ext) {\n return false;\n }\n }\n }\n\n return true;\n}\n\nfunction isNationalPrefixPresentIfRequired(number, _metadata) {\n // First, check how we deduced the country code. If it was written in international format, then\n // the national prefix is not required.\n if (number.getCountryCodeSource() != 'FROM_DEFAULT_COUNTRY') {\n return true;\n }\n\n var phoneNumberRegion = util.getRegionCodeForCountryCode(number.getCountryCode());\n\n var metadata = util.getMetadataForRegion(phoneNumberRegion);\n if (metadata == null) {\n return true;\n }\n\n // Check if a national prefix should be present when formatting this number.\n var nationalNumber = util.getNationalSignificantNumber(number);\n var formatRule = util.chooseFormattingPatternForNumber(metadata.numberFormats(), nationalNumber);\n\n // To do this, we check that a national prefix formatting rule was present\n // and that it wasn't just the first-group symbol ($1) with punctuation.\n if (formatRule && formatRule.getNationalPrefixFormattingRule().length > 0) {\n if (formatRule.getNationalPrefixOptionalWhenFormatting()) {\n // The national-prefix is optional in these cases, so we don't need to check if it was\n // present.\n return true;\n }\n\n if (PhoneNumberUtil.formattingRuleHasFirstGroupOnly(formatRule.getNationalPrefixFormattingRule())) {\n // National Prefix not needed for this number.\n return true;\n }\n\n // Normalize the remainder.\n var rawInputCopy = PhoneNumberUtil.normalizeDigitsOnly(number.getRawInput());\n\n // Check if we found a national prefix and/or carrier code at the start of the raw input, and\n // return the result.\n return util.maybeStripNationalPrefixAndCarrierCode(rawInputCopy, metadata, null);\n }\n\n return true;\n}\n\nexport function containsMoreThanOneSlashInNationalNumber(number, candidate) {\n var firstSlashInBodyIndex = candidate.indexOf('/');\n if (firstSlashInBodyIndex < 0) {\n // No slashes, this is okay.\n return false;\n }\n\n // Now look for a second one.\n var secondSlashInBodyIndex = candidate.indexOf('/', firstSlashInBodyIndex + 1);\n if (secondSlashInBodyIndex < 0) {\n // Only one slash, this is okay.\n return false;\n }\n\n // If the first slash is after the country calling code, this is permitted.\n var candidateHasCountryCode = number.getCountryCodeSource() === CountryCodeSource.FROM_NUMBER_WITH_PLUS_SIGN || number.getCountryCodeSource() === CountryCodeSource.FROM_NUMBER_WITHOUT_PLUS_SIGN;\n\n if (candidateHasCountryCode && PhoneNumberUtil.normalizeDigitsOnly(candidate.substring(0, firstSlashInBodyIndex)) === String(number.getCountryCode())) {\n // Any more slashes and this is illegal.\n return candidate.slice(secondSlashInBodyIndex + 1).indexOf('/') >= 0;\n }\n\n return true;\n}\n\nfunction checkNumberGroupingIsValid(number, candidate, metadata, checkGroups) {\n // TODO: Evaluate how this works for other locales (testing has been limited to NANPA regions)\n // and optimise if necessary.\n var normalizedCandidate = normalizeDigits(candidate, true /* keep non-digits */);\n var formattedNumberGroups = getNationalNumberGroups(metadata, number, null);\n if (checkGroups(metadata, number, normalizedCandidate, formattedNumberGroups)) {\n return true;\n }\n\n // If this didn't pass, see if there are any alternate formats, and try them instead.\n var alternateFormats = MetadataManager.getAlternateFormatsForCountry(number.getCountryCode());\n\n if (alternateFormats) {\n for (var _iterator = alternateFormats.numberFormats(), _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {\n var _ref;\n\n if (_isArray) {\n if (_i >= _iterator.length) break;\n _ref = _iterator[_i++];\n } else {\n _i = _iterator.next();\n if (_i.done) break;\n _ref = _i.value;\n }\n\n var alternateFormat = _ref;\n\n formattedNumberGroups = getNationalNumberGroups(metadata, number, alternateFormat);\n\n if (checkGroups(metadata, number, normalizedCandidate, formattedNumberGroups)) {\n return true;\n }\n }\n }\n\n return false;\n}\n\n/**\n * Helper method to get the national-number part of a number, formatted without any national\n * prefix, and return it as a set of digit blocks that would be formatted together.\n */\nfunction getNationalNumberGroups(metadata, number, formattingPattern) {\n if (formattingPattern) {\n // We format the NSN only, and split that according to the separator.\n var nationalSignificantNumber = util.getNationalSignificantNumber(number);\n return util.formatNsnUsingPattern(nationalSignificantNumber, formattingPattern, 'RFC3966', metadata).split('-');\n }\n\n // This will be in the format +CC-DG;ext=EXT where DG represents groups of digits.\n var rfc3966Format = formatNumber(number, 'RFC3966', metadata);\n\n // We remove the extension part from the formatted string before splitting it into different\n // groups.\n var endIndex = rfc3966Format.indexOf(';');\n if (endIndex < 0) {\n endIndex = rfc3966Format.length;\n }\n\n // The country-code will have a '-' following it.\n var startIndex = rfc3966Format.indexOf('-') + 1;\n return rfc3966Format.slice(startIndex, endIndex).split('-');\n}\n\nfunction allNumberGroupsAreExactlyPresent(metadata, number, normalizedCandidate, formattedNumberGroups) {\n var candidateGroups = normalizedCandidate.split(NON_DIGITS_PATTERN);\n\n // Set this to the last group, skipping it if the number has an extension.\n var candidateNumberGroupIndex = number.hasExtension() ? candidateGroups.length - 2 : candidateGroups.length - 1;\n\n // First we check if the national significant number is formatted as a block.\n // We use contains and not equals, since the national significant number may be present with\n // a prefix such as a national number prefix, or the country code itself.\n if (candidateGroups.length == 1 || candidateGroups[candidateNumberGroupIndex].contains(util.getNationalSignificantNumber(number))) {\n return true;\n }\n\n // Starting from the end, go through in reverse, excluding the first group, and check the\n // candidate and number groups are the same.\n var formattedNumberGroupIndex = formattedNumberGroups.length - 1;\n while (formattedNumberGroupIndex > 0 && candidateNumberGroupIndex >= 0) {\n if (candidateGroups[candidateNumberGroupIndex] !== formattedNumberGroups[formattedNumberGroupIndex]) {\n return false;\n }\n formattedNumberGroupIndex--;\n candidateNumberGroupIndex--;\n }\n\n // Now check the first group. There may be a national prefix at the start, so we only check\n // that the candidate group ends with the formatted number group.\n return candidateNumberGroupIndex >= 0 && endsWith(candidateGroups[candidateNumberGroupIndex], formattedNumberGroups[0]);\n}\n\nfunction allNumberGroupsRemainGrouped(metadata, number, normalizedCandidate, formattedNumberGroups) {\n var fromIndex = 0;\n if (number.getCountryCodeSource() !== CountryCodeSource.FROM_DEFAULT_COUNTRY) {\n // First skip the country code if the normalized candidate contained it.\n var countryCode = String(number.getCountryCode());\n fromIndex = normalizedCandidate.indexOf(countryCode) + countryCode.length();\n }\n\n // Check each group of consecutive digits are not broken into separate groupings in the\n // {@code normalizedCandidate} string.\n for (var i = 0; i < formattedNumberGroups.length; i++) {\n // Fails if the substring of {@code normalizedCandidate} starting from {@code fromIndex}\n // doesn't contain the consecutive digits in formattedNumberGroups[i].\n fromIndex = normalizedCandidate.indexOf(formattedNumberGroups[i], fromIndex);\n if (fromIndex < 0) {\n return false;\n }\n // Moves {@code fromIndex} forward.\n fromIndex += formattedNumberGroups[i].length();\n if (i == 0 && fromIndex < normalizedCandidate.length()) {\n // We are at the position right after the NDC. We get the region used for formatting\n // information based on the country code in the phone number, rather than the number itself,\n // as we do not need to distinguish between different countries with the same country\n // calling code and this is faster.\n var region = util.getRegionCodeForCountryCode(number.getCountryCode());\n if (util.getNddPrefixForRegion(region, true) != null && Character.isDigit(normalizedCandidate.charAt(fromIndex))) {\n // This means there is no formatting symbol after the NDC. In this case, we only\n // accept the number if there is no formatting symbol at all in the number, except\n // for extensions. This is only important for countries with national prefixes.\n var nationalSignificantNumber = util.getNationalSignificantNumber(number);\n return startsWith(normalizedCandidate.slice(fromIndex - formattedNumberGroups[i].length), nationalSignificantNumber);\n }\n }\n }\n\n // The check here makes sure that we haven't mistakenly already used the extension to\n // match the last group of the subscriber number. Note the extension cannot have\n // formatting in-between digits.\n return normalizedCandidate.slice(fromIndex).contains(number.getExtension());\n}\n\nfunction parseDigits(string) {\n var result = '';\n\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 _iterator2 = string.split(''), _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : _iterator2[Symbol.iterator]();;) {\n var _ref2;\n\n if (_isArray2) {\n if (_i2 >= _iterator2.length) break;\n _ref2 = _iterator2[_i2++];\n } else {\n _i2 = _iterator2.next();\n if (_i2.done) break;\n _ref2 = _i2.value;\n }\n\n var character = _ref2;\n\n var digit = parseDigit(character);\n if (digit) {\n result += digit;\n }\n }\n\n return result;\n}\n//# sourceMappingURL=Leniency.js.map","import { sort_out_arguments } from './findPhoneNumbers';\nimport PhoneNumberMatcher from './PhoneNumberMatcher';\n\nexport default function findNumbers(arg_1, arg_2, arg_3, arg_4) {\n\tvar _sort_out_arguments = sort_out_arguments(arg_1, arg_2, arg_3, arg_4),\n\t text = _sort_out_arguments.text,\n\t options = _sort_out_arguments.options,\n\t metadata = _sort_out_arguments.metadata;\n\n\tvar matcher = new PhoneNumberMatcher(text, options, metadata);\n\n\tvar results = [];\n\twhile (matcher.hasNext()) {\n\t\tresults.push(matcher.next());\n\t}\n\treturn results;\n}\n//# sourceMappingURL=findNumbers.js.map","import { sort_out_arguments } from './getNumberType';\nimport isValidNumber from './validate';\n\n/**\n * Checks if a given phone number is valid.\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.\n * If the `number` is an object, it is used as is.\n *\n * The `country` argument is the country the number must belong to.\n * This is a stricter version of `isValidNumber(number, defaultCountry)`.\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 * Doesn't accept `number` object, only `number` string with a `country` string.\n */\nexport default function isValidNumberForRegion(number, country, _metadata) {\n if (typeof number !== 'string') {\n throw new TypeError('number must be a string');\n }\n\n if (typeof country !== 'string') {\n throw new TypeError('country must be a string');\n }\n\n var _sort_out_arguments = sort_out_arguments(number, country, _metadata),\n input = _sort_out_arguments.input,\n metadata = _sort_out_arguments.metadata;\n\n return input.country === country && isValidNumber(input, metadata.metadata);\n}\n//# sourceMappingURL=isValidNumberForRegion.js.map","import PhoneNumber from './PhoneNumber';\n\nexport default function getExampleNumber(country, examples, metadata) {\n\treturn new PhoneNumber(country, examples[country], metadata);\n}\n//# sourceMappingURL=getExampleNumber.js.map","var _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; };\n\nimport PhoneNumber from './PhoneNumber';\nimport parse from './parse';\n\nexport default function parsePhoneNumber(text, defaultCountry, metadata) {\n\tif (isObject(defaultCountry)) {\n\t\tmetadata = defaultCountry;\n\t\tdefaultCountry = undefined;\n\t}\n\treturn parse(text, { defaultCountry: defaultCountry, v2: true }, metadata);\n}\n\n// so istanbul will show this as \"branch not covered\".\n/* istanbul ignore next */\nvar isObject = function isObject(_) {\n\treturn (typeof _ === 'undefined' ? 'undefined' : _typeof(_)) === 'object';\n};\n//# sourceMappingURL=parsePhoneNumber.js.map","module.exports = function cmp (a, b) {\n var pa = a.split('.');\n var pb = b.split('.');\n for (var i = 0; i < 3; i++) {\n var na = Number(pa[i]);\n var nb = Number(pb[i]);\n if (na > nb) return 1;\n if (nb > na) return -1;\n if (!isNaN(na) && isNaN(nb)) return 1;\n if (isNaN(na) && !isNaN(nb)) return -1;\n }\n return 0;\n};\n","import metadata from './metadata.min.json'\n\nimport parsePhoneNumberCustom from './es6/parsePhoneNumber'\n\nimport parseNumberCustom from './es6/parse'\nimport formatNumberCustom from './es6/format'\nimport getNumberTypeCustom from './es6/getNumberType'\nimport getExampleNumberCustom from './es6/getExampleNumber'\nimport isPossibleNumberCustom from './es6/isPossibleNumber'\nimport isValidNumberCustom from './es6/validate'\nimport isValidNumberForRegionCustom from './es6/isValidNumberForRegion'\n\n// Deprecated\nimport findPhoneNumbersCustom, { searchPhoneNumbers as searchPhoneNumbersCustom, PhoneNumberSearch as PhoneNumberSearchCustom } from './es6/findPhoneNumbers'\n\nimport findNumbersCustom from './es6/findNumbers'\nimport searchNumbersCustom from './es6/searchNumbers'\nimport PhoneNumberMatcherCustom from './es6/PhoneNumberMatcher'\n\nimport AsYouTypeCustom from './es6/AsYouType'\n\nimport getCountryCallingCodeCustom from './es6/getCountryCallingCode'\nexport { default as Metadata } from './es6/metadata'\nimport { getExtPrefix as getExtPrefixCustom } from './es6/metadata'\nimport { parseRFC3966 as parseRFC3966Custom, formatRFC3966 as formatRFC3966Custom } from './es6/RFC3966'\nimport formatIncompletePhoneNumberCustom from './es6/formatIncompletePhoneNumber'\nexport { default as parseIncompletePhoneNumber, parsePhoneNumberCharacter } from './es6/parseIncompletePhoneNumber'\n\nexport function parsePhoneNumber()\n{\n\tvar parameters = Array.prototype.slice.call(arguments)\n\tparameters.push(metadata)\n\treturn parsePhoneNumberCustom.apply(this, parameters)\n}\n\nexport function parseNumber()\n{\n\tvar parameters = Array.prototype.slice.call(arguments)\n\tparameters.push(metadata)\n\treturn parseNumberCustom.apply(this, parameters)\n}\n\n// Deprecated: remove `parse()` export in 2.0.0.\n// (renamed to `parseNumber()`)\nexport function parse()\n{\n\tvar parameters = Array.prototype.slice.call(arguments)\n\tparameters.push(metadata)\n\treturn parseNumberCustom.apply(this, parameters)\n}\n\nexport function formatNumber()\n{\n\tvar parameters = Array.prototype.slice.call(arguments)\n\tparameters.push(metadata)\n\treturn formatNumberCustom.apply(this, parameters)\n}\n\n// Deprecated: remove `format()` export in 2.0.0.\n// (renamed to `formatNumber()`)\nexport function format()\n{\n\tvar parameters = Array.prototype.slice.call(arguments)\n\tparameters.push(metadata)\n\treturn formatNumberCustom.apply(this, parameters)\n}\n\nexport function getNumberType()\n{\n\tvar parameters = Array.prototype.slice.call(arguments)\n\tparameters.push(metadata)\n\treturn getNumberTypeCustom.apply(this, parameters)\n}\n\nexport function getExampleNumber()\n{\n\tvar parameters = Array.prototype.slice.call(arguments)\n\tparameters.push(metadata)\n\treturn getExampleNumberCustom.apply(this, parameters)\n}\n\nexport function isPossibleNumber()\n{\n\tvar parameters = Array.prototype.slice.call(arguments)\n\tparameters.push(metadata)\n\treturn isPossibleNumberCustom.apply(this, parameters)\n}\n\nexport function isValidNumber()\n{\n\tvar parameters = Array.prototype.slice.call(arguments)\n\tparameters.push(metadata)\n\treturn isValidNumberCustom.apply(this, parameters)\n}\n\nexport function isValidNumberForRegion()\n{\n\tvar parameters = Array.prototype.slice.call(arguments)\n\tparameters.push(metadata)\n\treturn isValidNumberForRegionCustom.apply(this, parameters)\n}\n\n// Deprecated.\nexport function findPhoneNumbers()\n{\n\tvar parameters = Array.prototype.slice.call(arguments)\n\tparameters.push(metadata)\n\treturn findPhoneNumbersCustom.apply(this, parameters)\n}\n\n// Deprecated.\nexport function searchPhoneNumbers()\n{\n\tvar parameters = Array.prototype.slice.call(arguments)\n\tparameters.push(metadata)\n\treturn searchPhoneNumbersCustom.apply(this, parameters)\n}\n\n// Deprecated.\nexport function PhoneNumberSearch(text, options)\n{\n\tPhoneNumberSearchCustom.call(this, text, options, metadata)\n}\n\n// Deprecated.\nPhoneNumberSearch.prototype = Object.create(PhoneNumberSearchCustom.prototype, {})\nPhoneNumberSearch.prototype.constructor = PhoneNumberSearch\n\nexport function findNumbers()\n{\n\tvar parameters = Array.prototype.slice.call(arguments)\n\tparameters.push(metadata)\n\treturn findNumbersCustom.apply(this, parameters)\n}\n\nexport function searchNumbers()\n{\n\tvar parameters = Array.prototype.slice.call(arguments)\n\tparameters.push(metadata)\n\treturn searchNumbersCustom.apply(this, parameters)\n}\n\nexport function PhoneNumberMatcher(text, options)\n{\n\tPhoneNumberMatcherCustom.call(this, text, options, metadata)\n}\n\nPhoneNumberMatcher.prototype = Object.create(PhoneNumberMatcherCustom.prototype, {})\nPhoneNumberMatcher.prototype.constructor = PhoneNumberMatcher\n\nexport function AsYouType(country)\n{\n\tAsYouTypeCustom.call(this, country, metadata)\n}\n\nAsYouType.prototype = Object.create(AsYouTypeCustom.prototype, {})\nAsYouType.prototype.constructor = AsYouType\n\nexport function getExtPrefix()\n{\n\tvar parameters = Array.prototype.slice.call(arguments)\n\tparameters.push(metadata)\n\treturn getExtPrefixCustom.apply(this, parameters)\n}\n\nexport function parseRFC3966()\n{\n\tvar parameters = Array.prototype.slice.call(arguments)\n\tparameters.push(metadata)\n\treturn parseRFC3966Custom.apply(this, parameters)\n}\n\nexport function formatRFC3966()\n{\n\tvar parameters = Array.prototype.slice.call(arguments)\n\tparameters.push(metadata)\n\treturn formatRFC3966Custom.apply(this, parameters)\n}\n\nexport function formatIncompletePhoneNumber()\n{\n\tvar parameters = Array.prototype.slice.call(arguments)\n\tparameters.push(metadata)\n\treturn formatIncompletePhoneNumberCustom.apply(this, parameters)\n}\n\n// Deprecated: remove DIGITS export in 2.0.0 (unused).\nexport { DIGITS } from './es6/common'\n\n// Deprecated: remove this in 2.0.0 and make `custom.js` in ES6\n// (the old `custom.js` becomes `custom.commonjs.js`).\nexport { default as parseCustom } from './es6/parse'\nexport { default as formatCustom } from './es6/format'\nexport { default as isValidNumberCustom } from './es6/validate'\nexport { default as findPhoneNumbersCustom } from './es6/findPhoneNumbers'\nexport { searchPhoneNumbers as searchPhoneNumbersCustom } from './es6/findPhoneNumbers'\nexport { PhoneNumberSearch as PhoneNumberSearchCustom } from './es6/findPhoneNumbers'\nexport { default as getNumberTypeCustom } from './es6/getNumberType'\nexport { default as getCountryCallingCodeCustom } from './es6/getCountryCallingCode'\n\nexport\n{\n\tdefault as AsYouTypeCustom,\n\t// `DIGIT_PLACEHOLDER` is used by `react-phone-number-input`.\n\tDIGIT_PLACEHOLDER\n}\nfrom './es6/AsYouType'\n\nexport function getCountryCallingCode(country)\n{\n\treturn getCountryCallingCodeCustom(country, metadata)\n}\n\n// `getPhoneCode` name is deprecated, use `getCountryCallingCode` instead.\nexport function getPhoneCode(country)\n{\n\treturn getCountryCallingCode(country)\n}\n\n// `getPhoneCodeCustom` name is deprecated, use `getCountryCallingCodeCustom` instead.\nexport function getPhoneCodeCustom(country, metadata)\n{\n\treturn getCountryCallingCodeCustom(country, metadata)\n}"],"sourceRoot":""}