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AKM,EACH,OAEF,OAAOuT,EAAavT,EAAiBuN,EAAM6E,IAAK1S,EAAUgI,EAAQoL,iBACpE,QACE,MAAM,IAAI9R,MAAM,0DAA+DnB,OAAOJ,EAAQ,MAEpG,CACA,SAASQ,EAAqBuL,EAAQ9N,EAAaiW,EAAUjU,EAAUgI,GACrE,IAWoCkM,EAAkB3H,EAXlDxM,GAWgCmU,EAXDlU,EAAS0F,UAWU6G,EAXCT,EA+EzD,SAAkCqI,EAAUC,GAE1C,IADA,IAAIjY,EAAI,EACDA,EAAIgY,EAASxY,QAAQ,CAC1B,GAAIyY,EAAaD,EAAShY,IACxB,OAAOgY,EAAShY,GAElBA,GACF,CACF,CApESkY,CAAyBH,EAAkB,SAAUnU,GAI1D,GAAIA,EAAOmH,wBAAwBvL,OAAS,EAAG,CAE7C,IAAI2Y,EAA2BvU,EAAOmH,wBAAwBnH,EAAOmH,wBAAwBvL,OAAS,GAEtG,GAAwD,IAApD4Q,EAAevD,OAAOsL,GACxB,OAAO,CAEX,CAEA,OAAO,OAAgB/H,EAAgBxM,EAAOK,UAChD,IAhCA,OAAKL,GAGE,OAAgC+L,EAAQ/L,EAAQ,CACrDc,uBAAqC,kBAAboT,EACxBnT,oBAAoBf,EAAOgH,2DAA4DiB,IAAsC,IAA3BA,EAAQjK,eAC1GC,YAAaA,EACbgC,SAAUA,IANH8L,CAQX,CAyBA,SAAS+H,EAAavT,EAAiBoS,EAAK1S,EAAUoT,GACpD,OAAOV,EAAMU,EAAgB9S,EAAiBoS,EAAK1S,GAAYM,CACjE,C","sources":["webpack://iadviser/./node_modules/libphonenumber-js/es6/AsYouTypeState.js","webpack://iadviser/./node_modules/libphonenumber-js/es6/AsYouTypeFormatter.util.js","webpack://iadviser/./node_modules/libphonenumber-js/es6/AsYouTypeFormatter.complete.js","webpack://iadviser/./node_modules/libphonenumber-js/es6/AsYouTypeFormatter.PatternParser.js","webpack://iadviser/./node_modules/libphonenumber-js/es6/AsYouTypeFormatter.PatternMatcher.js","webpack://iadviser/./node_modules/libphonenumber-js/es6/AsYouTypeFormatter.js","webpack://iadviser/./node_modules/libphonenumber-js/es6/AsYouTypeParser.js","webpack://iadviser/./node_modules/libphonenumber-js/es6/AsYouType.js","webpack://iadviser/./node_modules/libphonenumber-js/es6/ParseError.js","webpack://iadviser/./node_modules/libphonenumber-js/es6/PhoneNumber.js","webpack://iadviser/./node_modules/libphonenumber-js/es6/constants.js","webpack://iadviser/./node_modules/libphonenumber-js/es6/format.js"],"sourcesContent":["function _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError(\"Cannot call a class as a function\"); }\nfunction _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, \"value\" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }\nfunction _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, \"prototype\", { writable: !1 }), e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\n// This \"state\" object simply holds the state of the \"AsYouType\" parser:\n//\n// Sidenote:\n// `state.callingCode` and `state.country` are somewhat independent from one another\n// and there could be situations when one is defined but the other is not.\n// * Situations when `state.country` would be defined but `state.callingCode` would be `undefined`:\n// \t\t * When `defaultCountry` is specified and inputting a phone number not in \"international\" format.\n// * When `defaultCountry` is specified and inputting a phone number in \"international\" format,\n// but before the `+` character has been input.\n// * Situations when `state.country` would be `undefined` but `state.callingCode` would be defined:\n// * When `defaultCountry` is not specified and inputting a phone number in \"international\" format,\n// and the \"calling code\" part is already complete, but multiple countries share this \"calling code\"\n// and there's not enough national (significant) number digits yet to determine the exact country.\n// * In any other sigutations, `state.country` and `state.callingCode` are either both defined or both `undefined`.\n// * When they're both defined, `state.callingCode` always corresponds to `state.country`.\n// So both are always consistent in this case.\n//\n// * `country?: string` — The exact country of the phone number, if it could be determined.\n// When inputting a phone number in \"international\" format, it will derive the `country` from \"country calling code\" and the phone number digits.\n// When inputting a phone number in \"national\" format, it will derive the `country` from `defaultCountry` that was specified when creating the `AsYouType` formatter.\n// Sidenote: If `USE_NON_GEOGRAPHIC_COUNTRY_CODE` flag was `true`, then for \"non-geographic phone numbers\" `state.country` would've been \"001\".\n// * `callingCode?: string` — \"Country calling code\" that has been extracted from the input phone number.\n// When inputting a phone number in \"international\" format, it will extract the \"country calling code\" from the digits that follow the \"+\" character.\n// When inputting a phone number in \"national\" format, `callingCode` will be `undefined`.\n// * `digits: string` — Phone number digits that have been input so far, including the \"+\" character, if present. In case of inputting non-arabic digits, those will be converted to arabic ones.\n// * `international: boolean` — Whether the phone number is being input in \"international\" format, i.e. with a \"+\" character.\n// * `missingPlus: boolean` — Whether it's a phone number in \"international\" format that is missing the leading \"+\" character for some reason — apparently, Google thinks that it's a common mistake when inputting a phone number.\n// * `IDDPrefix?: string` — An \"IDD prefix\", when the phone number is being input in an \"out-of-country dialing\" format. https://wikitravel.org/en/International_dialling_prefix\n// * `carrierCode?: string` — A \"carrier code\", if the phone number contains it. Normally, those can only be present in Colombia or Brazil, and only when calling from mobile phones to fixed-line numbers.\n// * `nationalPrefix?: string` — \"National prefix\", if present in the phone number input.\n// * `nationalSignificantNumber?: string` — National (significant) number digits that have been input so far.\n// * `nationalSignificantNumberIsModified: boolean` — Tells if the parsed national (significant) number is present as-is in the input string. For example, when inputting \"0343515551212999\" Argentinian mobile number, the parsed national (significant) number is \"93435551212999\". There, one can see how it stripped \"0\" national prefix and prepended a \"9\", because that's how it is instructed to do in Argentina's metadata. So in the described example, the parsed national (significant) number is not present as-is in the input string. Instead, it's \"modified\" in the input string. https://gitlab.com/caamphetamine/libphonenumber-js/-/blob/master/METADATA.md#national_prefix_for_parsing--national_prefix_transform_rule\n// * `prefixBeforeNationalSignificantNumberThatIsNotNationalPrefix?: string` — In some countries, a phone number could have a prefix that is not a \"national prefix\" but rather some other type of \"utility\" prefix.\n// For example, when calling within Australia, one could prepend `1831` prefix to hide caller's phone number.\n// https://gitlab.com/catamphetamine/libphonenumber-js/-/blob/master/METADATA.md#national_prefix_for_parsing--national_prefix_transform_rule\n//\nvar AsYouTypeState = /*#__PURE__*/function () {\n function AsYouTypeState(_ref) {\n var onCountryChange = _ref.onCountryChange,\n onCallingCodeChange = _ref.onCallingCodeChange;\n _classCallCheck(this, AsYouTypeState);\n this.onCountryChange = onCountryChange;\n this.onCallingCodeChange = onCallingCodeChange;\n }\n return _createClass(AsYouTypeState, [{\n key: \"reset\",\n value: function reset(_ref2) {\n var country = _ref2.country,\n callingCode = _ref2.callingCode;\n this.international = false;\n this.missingPlus = false;\n this.IDDPrefix = undefined;\n this.callingCode = undefined;\n this.digits = '';\n this.resetNationalSignificantNumber();\n this.initCountryAndCallingCode(country, callingCode);\n }\n }, {\n key: \"resetNationalSignificantNumber\",\n value: function resetNationalSignificantNumber() {\n this.nationalSignificantNumber = this.getNationalDigits();\n this.nationalSignificantNumberIsModified = false;\n this.nationalPrefix = undefined;\n this.carrierCode = undefined;\n this.prefixBeforeNationalSignificantNumberThatIsNotNationalPrefix = undefined;\n }\n }, {\n key: \"update\",\n value: function update(properties) {\n for (var _i = 0, _Object$keys = Object.keys(properties); _i < _Object$keys.length; _i++) {\n var key = _Object$keys[_i];\n this[key] = properties[key];\n }\n }\n }, {\n key: \"initCountryAndCallingCode\",\n value: function initCountryAndCallingCode(country, callingCode) {\n this.setCountry(country);\n this.setCallingCode(callingCode);\n }\n }, {\n key: \"setCountry\",\n value: function setCountry(country) {\n this.country = country;\n this.onCountryChange(country);\n }\n }, {\n key: \"setCallingCode\",\n value: function setCallingCode(callingCode) {\n this.callingCode = callingCode;\n this.onCallingCodeChange(callingCode, this.country);\n }\n }, {\n key: \"startInternationalNumber\",\n value: function startInternationalNumber(country, callingCode) {\n // Prepend the `+` to parsed input.\n this.international = true;\n // If a default country was set then reset it\n // because an explicitly international phone\n // number is being entered.\n this.initCountryAndCallingCode(country, callingCode);\n }\n }, {\n key: \"appendDigits\",\n value: function appendDigits(nextDigits) {\n this.digits += nextDigits;\n }\n }, {\n key: \"appendNationalSignificantNumberDigits\",\n value: function appendNationalSignificantNumberDigits(nextDigits) {\n this.nationalSignificantNumber += nextDigits;\n }\n\n /**\n * Returns the part of `this.digits` that corresponds to the national number.\n * Basically, all digits that have been input by the user, except for the\n * international prefix and the country calling code part\n * (if the number is an international one).\n * @return {string}\n */\n }, {\n key: \"getNationalDigits\",\n value: function getNationalDigits() {\n if (this.international) {\n return this.digits.slice((this.IDDPrefix ? this.IDDPrefix.length : 0) + (this.callingCode ? this.callingCode.length : 0));\n }\n return this.digits;\n }\n }, {\n key: \"getDigitsWithoutInternationalPrefix\",\n value: function getDigitsWithoutInternationalPrefix() {\n if (this.international) {\n if (this.IDDPrefix) {\n return this.digits.slice(this.IDDPrefix.length);\n }\n }\n return this.digits;\n }\n }]);\n}();\nexport { AsYouTypeState as default };\n//# sourceMappingURL=AsYouTypeState.js.map","function _createForOfIteratorHelperLoose(r, e) { var t = \"undefined\" != typeof Symbol && r[Symbol.iterator] || r[\"@@iterator\"]; if (t) return (t = t.call(r)).next.bind(t); if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && \"number\" == typeof r.length) { t && (r = t); var o = 0; return function () { return o >= r.length ? { done: !0 } : { done: !1, value: r[o++] }; }; } throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\nfunction _unsupportedIterableToArray(r, a) { if (r) { if (\"string\" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return \"Object\" === t && r.constructor && (t = r.constructor.name), \"Map\" === t || \"Set\" === t ? Array.from(r) : \"Arguments\" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }\nfunction _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }\n// Should be the same as `DIGIT_PLACEHOLDER` in `libphonenumber-metadata-generator`.\nexport var DIGIT_PLACEHOLDER = 'x'; // '\\u2008' (punctuation space)\nvar DIGIT_PLACEHOLDER_MATCHER = new RegExp(DIGIT_PLACEHOLDER);\n\n// Counts all occurences of a symbol in a string.\n// Unicode-unsafe (because using `.split()`).\nexport function countOccurences(symbol, string) {\n var count = 0;\n // Using `.split('')` to iterate through a string here\n // to avoid requiring `Symbol.iterator` polyfill.\n // `.split('')` is generally not safe for Unicode,\n // but in this particular case for counting brackets it is safe.\n // for (const character of string)\n for (var _iterator = _createForOfIteratorHelperLoose(string.split('')), _step; !(_step = _iterator()).done;) {\n var character = _step.value;\n if (character === symbol) {\n count++;\n }\n }\n return 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 if (times < 1) {\n return '';\n }\n var result = '';\n while (times > 1) {\n if (times & 1) {\n result += string;\n }\n times >>= 1;\n string += string;\n }\n return result + string;\n}\nexport function cutAndStripNonPairedParens(string, cutBeforeIndex) {\n if (string[cutBeforeIndex] === ')') {\n cutBeforeIndex++;\n }\n return stripNonPairedParens(string.slice(0, cutBeforeIndex));\n}\nexport function closeNonPairedParens(template, cut_before) {\n var retained_template = template.slice(0, cut_before);\n var opening_braces = countOccurences('(', retained_template);\n var closing_braces = countOccurences(')', retained_template);\n var dangling_braces = opening_braces - closing_braces;\n while (dangling_braces > 0 && cut_before < template.length) {\n if (template[cut_before] === ')') {\n dangling_braces--;\n }\n cut_before++;\n }\n return template.slice(0, cut_before);\n}\nexport function stripNonPairedParens(string) {\n var dangling_braces = [];\n var i = 0;\n while (i < string.length) {\n if (string[i] === '(') {\n dangling_braces.push(i);\n } else if (string[i] === ')') {\n dangling_braces.pop();\n }\n i++;\n }\n var start = 0;\n var cleared_string = '';\n dangling_braces.push(string.length);\n for (var _i = 0, _dangling_braces = dangling_braces; _i < _dangling_braces.length; _i++) {\n var index = _dangling_braces[_i];\n cleared_string += string.slice(start, index);\n start = index + 1;\n }\n return cleared_string;\n}\nexport function populateTemplateWithDigits(template, position, digits) {\n // Using `.split('')` to iterate through a string here\n // to avoid requiring `Symbol.iterator` polyfill.\n // `.split('')` is generally not safe for Unicode,\n // but in this particular case for `digits` it is safe.\n // for (const digit of digits)\n for (var _iterator2 = _createForOfIteratorHelperLoose(digits.split('')), _step2; !(_step2 = _iterator2()).done;) {\n var digit = _step2.value;\n // If there is room for more digits in current `template`,\n // then set the next digit in the `template`,\n // and return the formatted digits so far.\n // If more digits are entered than the current format could handle.\n if (template.slice(position + 1).search(DIGIT_PLACEHOLDER_MATCHER) < 0) {\n return;\n }\n position = template.search(DIGIT_PLACEHOLDER_MATCHER);\n template = template.replace(DIGIT_PLACEHOLDER_MATCHER, digit);\n }\n return [template, position];\n}\n//# sourceMappingURL=AsYouTypeFormatter.util.js.map","import checkNumberLength from './helpers/checkNumberLength.js';\nimport parseDigits from './helpers/parseDigits.js';\nimport formatNationalNumberUsingFormat from './helpers/formatNationalNumberUsingFormat.js';\nexport default function formatCompleteNumber(state, format, _ref) {\n var metadata = _ref.metadata,\n shouldTryNationalPrefixFormattingRule = _ref.shouldTryNationalPrefixFormattingRule,\n getSeparatorAfterNationalPrefix = _ref.getSeparatorAfterNationalPrefix;\n var matcher = new RegExp(\"^(?:\".concat(format.pattern(), \")$\"));\n if (matcher.test(state.nationalSignificantNumber)) {\n return formatNationalNumberWithAndWithoutNationalPrefixFormattingRule(state, format, {\n metadata: metadata,\n shouldTryNationalPrefixFormattingRule: shouldTryNationalPrefixFormattingRule,\n getSeparatorAfterNationalPrefix: getSeparatorAfterNationalPrefix\n });\n }\n}\nexport function canFormatCompleteNumber(nationalSignificantNumber, metadata) {\n return checkNumberLength(nationalSignificantNumber, undefined, metadata) === 'IS_POSSIBLE';\n}\nfunction formatNationalNumberWithAndWithoutNationalPrefixFormattingRule(state, format, _ref2) {\n var metadata = _ref2.metadata,\n shouldTryNationalPrefixFormattingRule = _ref2.shouldTryNationalPrefixFormattingRule,\n getSeparatorAfterNationalPrefix = _ref2.getSeparatorAfterNationalPrefix;\n // `format` has already been checked for `nationalPrefix` requirement.\n\n var nationalSignificantNumber = state.nationalSignificantNumber,\n international = state.international,\n nationalPrefix = state.nationalPrefix,\n carrierCode = state.carrierCode;\n\n // Format the number with using `national_prefix_formatting_rule`.\n // If the resulting formatted number is a valid formatted number, then return it.\n //\n // Google's AsYouType formatter is different in a way that it doesn't try\n // to format using the \"national prefix formatting rule\", and instead it\n // simply prepends a national prefix followed by a \" \" character.\n // This code does that too, but as a fallback.\n // The reason is that \"national prefix formatting rule\" may use parentheses,\n // which wouldn't be included has it used the simpler Google's way.\n //\n if (shouldTryNationalPrefixFormattingRule(format)) {\n var formattedNumber = formatNationalNumber(state, format, {\n useNationalPrefixFormattingRule: true,\n getSeparatorAfterNationalPrefix: getSeparatorAfterNationalPrefix,\n metadata: metadata\n });\n if (formattedNumber) {\n return formattedNumber;\n }\n }\n\n // Format the number without using `national_prefix_formatting_rule`.\n return formatNationalNumber(state, format, {\n useNationalPrefixFormattingRule: false,\n getSeparatorAfterNationalPrefix: getSeparatorAfterNationalPrefix,\n metadata: metadata\n });\n}\nfunction formatNationalNumber(state, format, _ref3) {\n var metadata = _ref3.metadata,\n useNationalPrefixFormattingRule = _ref3.useNationalPrefixFormattingRule,\n getSeparatorAfterNationalPrefix = _ref3.getSeparatorAfterNationalPrefix;\n var formattedNationalNumber = formatNationalNumberUsingFormat(state.nationalSignificantNumber, format, {\n carrierCode: state.carrierCode,\n useInternationalFormat: state.international,\n withNationalPrefix: useNationalPrefixFormattingRule,\n metadata: metadata\n });\n if (!useNationalPrefixFormattingRule) {\n if (state.nationalPrefix) {\n // If a national prefix was extracted, then just prepend it,\n // followed by a \" \" character.\n formattedNationalNumber = state.nationalPrefix + getSeparatorAfterNationalPrefix(format) + formattedNationalNumber;\n } else if (state.prefixBeforeNationalSignificantNumberThatIsNotNationalPrefix) {\n formattedNationalNumber = state.prefixBeforeNationalSignificantNumberThatIsNotNationalPrefix + ' ' + formattedNationalNumber;\n }\n }\n if (isValidFormattedNationalNumber(formattedNationalNumber, state)) {\n return formattedNationalNumber;\n }\n}\n\n// Check that the formatted phone number contains exactly\n// the same digits that have been input by the user.\n// For example, when \"0111523456789\" is input for `AR` country,\n// the extracted `this.nationalSignificantNumber` is \"91123456789\",\n// which means that the national part of `this.digits` isn't simply equal to\n// `this.nationalPrefix` + `this.nationalSignificantNumber`.\n//\n// Also, a `format` can add extra digits to the `this.nationalSignificantNumber`\n// being formatted via `metadata[country].national_prefix_transform_rule`.\n// For example, for `VI` country, it prepends `340` to the national number,\n// and if this check hasn't been implemented, then there would be a bug\n// when `340` \"area coude\" is \"duplicated\" during input for `VI` country:\n// https://github.com/catamphetamine/libphonenumber-js/issues/318\n//\n// So, all these \"gotchas\" are filtered out.\n//\n// In the original Google's code, the comments say:\n// \"Check that we didn't remove nor add any extra digits when we matched\n// this formatting pattern. This usually happens after we entered the last\n// digit during AYTF. Eg: In case of MX, we swallow mobile token (1) when\n// formatted but AYTF should retain all the number entered and not change\n// in order to match a format (of same leading digits and length) display\n// in that way.\"\n// \"If it's the same (i.e entered number and format is same), then it's\n// safe to return this in formatted number as nothing is lost / added.\"\n// Otherwise, don't use this format.\n// https://github.com/google/libphonenumber/commit/3e7c1f04f5e7200f87fb131e6f85c6e99d60f510#diff-9149457fa9f5d608a11bb975c6ef4bc5\n// https://github.com/google/libphonenumber/commit/3ac88c7106e7dcb553bcc794b15f19185928a1c6#diff-2dcb77e833422ee304da348b905cde0b\n//\nfunction isValidFormattedNationalNumber(formattedNationalNumber, state) {\n return parseDigits(formattedNationalNumber) === state.getNationalDigits();\n}\n//# sourceMappingURL=AsYouTypeFormatter.complete.js.map","function _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError(\"Cannot call a class as a function\"); }\nfunction _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, \"value\" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }\nfunction _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, \"prototype\", { writable: !1 }), e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nvar PatternParser = /*#__PURE__*/function () {\n function PatternParser() {\n _classCallCheck(this, PatternParser);\n }\n return _createClass(PatternParser, [{\n key: \"parse\",\n value: function parse(pattern) {\n this.context = [{\n or: true,\n instructions: []\n }];\n this.parsePattern(pattern);\n if (this.context.length !== 1) {\n throw new Error('Non-finalized contexts left when pattern parse ended');\n }\n var _this$context$ = this.context[0],\n branches = _this$context$.branches,\n instructions = _this$context$.instructions;\n if (branches) {\n return {\n op: '|',\n args: branches.concat([expandSingleElementArray(instructions)])\n };\n }\n\n /* istanbul ignore if */\n if (instructions.length === 0) {\n throw new Error('Pattern is required');\n }\n if (instructions.length === 1) {\n return instructions[0];\n }\n return instructions;\n }\n }, {\n key: \"startContext\",\n value: function startContext(context) {\n this.context.push(context);\n }\n }, {\n key: \"endContext\",\n value: function endContext() {\n this.context.pop();\n }\n }, {\n key: \"getContext\",\n value: function getContext() {\n return this.context[this.context.length - 1];\n }\n }, {\n key: \"parsePattern\",\n value: function parsePattern(pattern) {\n if (!pattern) {\n throw new Error('Pattern is required');\n }\n var match = pattern.match(OPERATOR);\n if (!match) {\n if (ILLEGAL_CHARACTER_REGEXP.test(pattern)) {\n throw new Error(\"Illegal characters found in a pattern: \".concat(pattern));\n }\n this.getContext().instructions = this.getContext().instructions.concat(pattern.split(''));\n return;\n }\n var operator = match[1];\n var before = pattern.slice(0, match.index);\n var rightPart = pattern.slice(match.index + operator.length);\n switch (operator) {\n case '(?:':\n if (before) {\n this.parsePattern(before);\n }\n this.startContext({\n or: true,\n instructions: [],\n branches: []\n });\n break;\n case ')':\n if (!this.getContext().or) {\n throw new Error('\")\" operator must be preceded by \"(?:\" operator');\n }\n if (before) {\n this.parsePattern(before);\n }\n if (this.getContext().instructions.length === 0) {\n throw new Error('No instructions found after \"|\" operator in an \"or\" group');\n }\n var _this$getContext = this.getContext(),\n branches = _this$getContext.branches;\n branches.push(expandSingleElementArray(this.getContext().instructions));\n this.endContext();\n this.getContext().instructions.push({\n op: '|',\n args: branches\n });\n break;\n case '|':\n if (!this.getContext().or) {\n throw new Error('\"|\" operator can only be used inside \"or\" groups');\n }\n if (before) {\n this.parsePattern(before);\n }\n // The top-level is an implicit \"or\" group, if required.\n if (!this.getContext().branches) {\n // `branches` are not defined only for the root implicit \"or\" operator.\n /* istanbul ignore else */\n if (this.context.length === 1) {\n this.getContext().branches = [];\n } else {\n throw new Error('\"branches\" not found in an \"or\" group context');\n }\n }\n this.getContext().branches.push(expandSingleElementArray(this.getContext().instructions));\n this.getContext().instructions = [];\n break;\n case '[':\n if (before) {\n this.parsePattern(before);\n }\n this.startContext({\n oneOfSet: true\n });\n break;\n case ']':\n if (!this.getContext().oneOfSet) {\n throw new Error('\"]\" operator must be preceded by \"[\" operator');\n }\n this.endContext();\n this.getContext().instructions.push({\n op: '[]',\n args: parseOneOfSet(before)\n });\n break;\n\n /* istanbul ignore next */\n default:\n throw new Error(\"Unknown operator: \".concat(operator));\n }\n if (rightPart) {\n this.parsePattern(rightPart);\n }\n }\n }]);\n}();\nexport { PatternParser as default };\nfunction parseOneOfSet(pattern) {\n var values = [];\n var i = 0;\n while (i < pattern.length) {\n if (pattern[i] === '-') {\n if (i === 0 || i === pattern.length - 1) {\n throw new Error(\"Couldn't parse a one-of set pattern: \".concat(pattern));\n }\n var prevValue = pattern[i - 1].charCodeAt(0) + 1;\n var nextValue = pattern[i + 1].charCodeAt(0) - 1;\n var value = prevValue;\n while (value <= nextValue) {\n values.push(String.fromCharCode(value));\n value++;\n }\n } else {\n values.push(pattern[i]);\n }\n i++;\n }\n return values;\n}\nvar ILLEGAL_CHARACTER_REGEXP = /[\\(\\)\\[\\]\\?\\:\\|]/;\nvar OPERATOR = new RegExp(\n// any of:\n'(' +\n// or operator\n'\\\\|' +\n// or\n'|' +\n// or group start\n'\\\\(\\\\?\\\\:' +\n// or\n'|' +\n// or group end\n'\\\\)' +\n// or\n'|' +\n// one-of set start\n'\\\\[' +\n// or\n'|' +\n// one-of set end\n'\\\\]' + ')');\nfunction expandSingleElementArray(array) {\n if (array.length === 1) {\n return array[0];\n }\n return array;\n}\n//# sourceMappingURL=AsYouTypeFormatter.PatternParser.js.map","function _createForOfIteratorHelperLoose(r, e) { var t = \"undefined\" != typeof Symbol && r[Symbol.iterator] || r[\"@@iterator\"]; if (t) return (t = t.call(r)).next.bind(t); if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && \"number\" == typeof r.length) { t && (r = t); var o = 0; return function () { return o >= r.length ? { done: !0 } : { done: !1, value: r[o++] }; }; } throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\nfunction _unsupportedIterableToArray(r, a) { if (r) { if (\"string\" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return \"Object\" === t && r.constructor && (t = r.constructor.name), \"Map\" === t || \"Set\" === t ? Array.from(r) : \"Arguments\" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }\nfunction _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError(\"Cannot call a class as a function\"); }\nfunction _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, \"value\" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }\nfunction _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, \"prototype\", { writable: !1 }), e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nimport PatternParser from './AsYouTypeFormatter.PatternParser.js';\nvar PatternMatcher = /*#__PURE__*/function () {\n function PatternMatcher(pattern) {\n _classCallCheck(this, PatternMatcher);\n this.matchTree = new PatternParser().parse(pattern);\n }\n return _createClass(PatternMatcher, [{\n key: \"match\",\n value: function match(string) {\n var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},\n allowOverflow = _ref.allowOverflow;\n if (!string) {\n throw new Error('String is required');\n }\n var result = _match(string.split(''), this.matchTree, true);\n if (result && result.match) {\n delete result.matchedChars;\n }\n if (result && result.overflow) {\n if (!allowOverflow) {\n return;\n }\n }\n return result;\n }\n }]);\n}();\n/**\n * Matches `characters` against a pattern compiled into a `tree`.\n * @param {string[]} characters\n * @param {Tree} tree — A pattern compiled into a `tree`. See the `*.d.ts` file for the description of the `tree` structure.\n * @param {boolean} last — Whether it's the last (rightmost) subtree on its level of the match tree.\n * @return {object} See the `*.d.ts` file for the description of the result object.\n */\nexport { PatternMatcher as default };\nfunction _match(characters, tree, last) {\n // If `tree` is a string, then `tree` is a single character.\n // That's because when a pattern is parsed, multi-character-string parts\n // of a pattern are compiled into arrays of single characters.\n // I still wrote this piece of code for a \"general\" hypothetical case\n // when `tree` could be a string of several characters, even though\n // such case is not possible with the current implementation.\n if (typeof tree === 'string') {\n var characterString = characters.join('');\n if (tree.indexOf(characterString) === 0) {\n // `tree` is always a single character.\n // If `tree.indexOf(characterString) === 0`\n // then `characters.length === tree.length`.\n /* istanbul ignore else */\n if (characters.length === tree.length) {\n return {\n match: true,\n matchedChars: characters\n };\n }\n // `tree` is always a single character.\n // If `tree.indexOf(characterString) === 0`\n // then `characters.length === tree.length`.\n /* istanbul ignore next */\n return {\n partialMatch: true\n // matchedChars: characters\n };\n }\n if (characterString.indexOf(tree) === 0) {\n if (last) {\n // The `else` path is not possible because `tree` is always a single character.\n // The `else` case for `characters.length > tree.length` would be\n // `characters.length <= tree.length` which means `characters.length <= 1`.\n // `characters` array can't be empty, so that means `characters === [tree]`,\n // which would also mean `tree.indexOf(characterString) === 0` and that'd mean\n // that the `if (tree.indexOf(characterString) === 0)` condition before this\n // `if` condition would be entered, and returned from there, not reaching this code.\n /* istanbul ignore else */\n if (characters.length > tree.length) {\n return {\n overflow: true\n };\n }\n }\n return {\n match: true,\n matchedChars: characters.slice(0, tree.length)\n };\n }\n return;\n }\n if (Array.isArray(tree)) {\n var restCharacters = characters.slice();\n var i = 0;\n while (i < tree.length) {\n var subtree = tree[i];\n var result = _match(restCharacters, subtree, last && i === tree.length - 1);\n if (!result) {\n return;\n } else if (result.overflow) {\n return result;\n } else if (result.match) {\n // Continue with the next subtree with the rest of the characters.\n restCharacters = restCharacters.slice(result.matchedChars.length);\n if (restCharacters.length === 0) {\n if (i === tree.length - 1) {\n return {\n match: true,\n matchedChars: characters\n };\n } else {\n return {\n partialMatch: true\n // matchedChars: characters\n };\n }\n }\n } else {\n /* istanbul ignore else */\n if (result.partialMatch) {\n return {\n partialMatch: true\n // matchedChars: characters\n };\n } else {\n throw new Error(\"Unsupported match result:\\n\".concat(JSON.stringify(result, null, 2)));\n }\n }\n i++;\n }\n // If `last` then overflow has already been checked\n // by the last element of the `tree` array.\n /* istanbul ignore if */\n if (last) {\n return {\n overflow: true\n };\n }\n return {\n match: true,\n matchedChars: characters.slice(0, characters.length - restCharacters.length)\n };\n }\n switch (tree.op) {\n case '|':\n var partialMatch;\n for (var _iterator = _createForOfIteratorHelperLoose(tree.args), _step; !(_step = _iterator()).done;) {\n var branch = _step.value;\n var _result = _match(characters, branch, last);\n if (_result) {\n if (_result.overflow) {\n return _result;\n } else if (_result.match) {\n return {\n match: true,\n matchedChars: _result.matchedChars\n };\n } else {\n /* istanbul ignore else */\n if (_result.partialMatch) {\n partialMatch = true;\n } else {\n throw new Error(\"Unsupported match result:\\n\".concat(JSON.stringify(_result, null, 2)));\n }\n }\n }\n }\n if (partialMatch) {\n return {\n partialMatch: true\n // matchedChars: ...\n };\n }\n // Not even a partial match.\n return;\n case '[]':\n for (var _iterator2 = _createForOfIteratorHelperLoose(tree.args), _step2; !(_step2 = _iterator2()).done;) {\n var _char = _step2.value;\n if (characters[0] === _char) {\n if (characters.length === 1) {\n return {\n match: true,\n matchedChars: characters\n };\n }\n if (last) {\n return {\n overflow: true\n };\n }\n return {\n match: true,\n matchedChars: [_char]\n };\n }\n }\n // No character matches.\n return;\n\n /* istanbul ignore next */\n default:\n throw new Error(\"Unsupported instruction tree: \".concat(tree));\n }\n}\n//# sourceMappingURL=AsYouTypeFormatter.PatternMatcher.js.map","function _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _createForOfIteratorHelperLoose(r, e) { var t = \"undefined\" != typeof Symbol && r[Symbol.iterator] || r[\"@@iterator\"]; if (t) return (t = t.call(r)).next.bind(t); if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && \"number\" == typeof r.length) { t && (r = t); var o = 0; return function () { return o >= r.length ? { done: !0 } : { done: !1, value: r[o++] }; }; } throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\nfunction _unsupportedIterableToArray(r, a) { if (r) { if (\"string\" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return \"Object\" === t && r.constructor && (t = r.constructor.name), \"Map\" === t || \"Set\" === t ? Array.from(r) : \"Arguments\" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }\nfunction _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }\nfunction _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError(\"Cannot call a class as a function\"); }\nfunction _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, \"value\" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }\nfunction _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, \"prototype\", { writable: !1 }), e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nimport { DIGIT_PLACEHOLDER, countOccurences, repeat, cutAndStripNonPairedParens, closeNonPairedParens, stripNonPairedParens, populateTemplateWithDigits } from './AsYouTypeFormatter.util.js';\nimport formatCompleteNumber, { canFormatCompleteNumber } from './AsYouTypeFormatter.complete.js';\nimport PatternMatcher from './AsYouTypeFormatter.PatternMatcher.js';\nimport parseDigits from './helpers/parseDigits.js';\nexport { DIGIT_PLACEHOLDER } from './AsYouTypeFormatter.util.js';\nimport { FIRST_GROUP_PATTERN } from './helpers/formatNationalNumberUsingFormat.js';\nimport { VALID_PUNCTUATION } from './constants.js';\nimport applyInternationalSeparatorStyle from './helpers/applyInternationalSeparatorStyle.js';\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// A set of characters that, if found in a national prefix formatting rules, are an indicator to\n// us that we should separate the national prefix from the number when formatting.\nvar NATIONAL_PREFIX_SEPARATORS_PATTERN = /[- ]/;\n\n// Deprecated: Google has removed some formatting pattern related code from their repo.\n// https://github.com/googlei18n/libphonenumber/commit/a395b4fef3caf57c4bc5f082e1152a4d2bd0ba4c\n// \"We no longer have numbers in formatting matching patterns, only \\d.\"\n// Because this library supports generating custom metadata\n// some users may still be using old metadata so the relevant\n// code seems to stay until some next major version update.\nvar SUPPORT_LEGACY_FORMATTING_PATTERNS = true;\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 = SUPPORT_LEGACY_FORMATTING_PATTERNS && function () {\n return /\\[([^\\[\\]])*\\]/g;\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 = SUPPORT_LEGACY_FORMATTING_PATTERNS && function () {\n return /\\d(?=[^,}][^,}])/g;\n};\n\n// A regular expression that is used to determine if a `format` is\n// suitable to be used in the \"as you type formatter\".\n// A `format` is suitable when the resulting formatted number has\n// the same digits as the user has entered.\n//\n// In the simplest case, that would mean that the format\n// doesn't add any additional digits when formatting a number.\n// Google says that it also shouldn't add \"star\" (`*`) characters,\n// like it does in some Israeli formats.\n// Such basic format would only contain \"valid punctuation\"\n// and \"captured group\" identifiers ($1, $2, etc).\n//\n// An example of a format that adds additional digits:\n//\n// Country: `AR` (Argentina).\n// Format:\n// {\n// \"pattern\": \"(\\\\d)(\\\\d{2})(\\\\d{4})(\\\\d{4})\",\n// \"leading_digits_patterns\": [\"91\"],\n// \"national_prefix_formatting_rule\": \"0$1\",\n// \"format\": \"$2 15-$3-$4\",\n// \"international_format\": \"$1 $2 $3-$4\"\n// }\n//\n// In the format above, the `format` adds `15` to the digits when formatting a number.\n// A sidenote: this format actually is suitable because `national_prefix_for_parsing`\n// has previously removed `15` from a national number, so re-adding `15` in `format`\n// doesn't actually result in any extra digits added to user's input.\n// But verifying that would be a complex procedure, so the code chooses a simpler path:\n// it simply filters out all `format`s that contain anything but \"captured group\" ids.\n//\n// This regular expression is called `ELIGIBLE_FORMAT_PATTERN` in Google's\n// `libphonenumber` code.\n//\nvar NON_ALTERING_FORMAT_REG_EXP = new RegExp('[' + VALID_PUNCTUATION + ']*' +\n// Google developers say:\n// \"We require that the first matching group is present in the\n// output pattern to ensure no data is lost while formatting.\"\n'\\\\$1' + '[' + 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;\nvar AsYouTypeFormatter = /*#__PURE__*/function () {\n function AsYouTypeFormatter(_ref) {\n var state = _ref.state,\n metadata = _ref.metadata;\n _classCallCheck(this, AsYouTypeFormatter);\n this.metadata = metadata;\n this.resetFormat();\n }\n return _createClass(AsYouTypeFormatter, [{\n key: \"resetFormat\",\n value: function resetFormat() {\n this.chosenFormat = undefined;\n this.template = undefined;\n this.nationalNumberTemplate = undefined;\n this.populatedNationalNumberTemplate = undefined;\n this.populatedNationalNumberTemplatePosition = -1;\n }\n }, {\n key: \"reset\",\n value: function reset(numberingPlan, state) {\n this.resetFormat();\n if (numberingPlan) {\n this.isNANP = numberingPlan.callingCode() === '1';\n this.matchingFormats = numberingPlan.formats();\n if (state.nationalSignificantNumber) {\n this.narrowDownMatchingFormats(state);\n }\n } else {\n this.isNANP = undefined;\n this.matchingFormats = [];\n }\n }\n\n /**\n * Formats an updated phone number.\n * @param {string} nextDigits — Additional phone number digits.\n * @param {object} state — `AsYouType` state.\n * @return {[string]} Returns undefined if the updated phone number can't be formatted using any of the available formats.\n */\n }, {\n key: \"format\",\n value: function format(nextDigits, state) {\n var _this = this;\n // See if the phone number digits can be formatted as a complete phone number.\n // If not, use the results from `formatNationalNumberWithNextDigits()`,\n // which formats based on the chosen formatting pattern.\n //\n // Attempting to format complete phone number first is how it's done\n // in Google's `libphonenumber`, so this library just follows it.\n // Google's `libphonenumber` code doesn't explain in detail why does it\n // attempt to format digits as a complete phone number\n // instead of just going with a previoulsy (or newly) chosen `format`:\n //\n // \"Checks to see if there is an exact pattern match for these digits.\n // If so, we should use this instead of any other formatting template\n // whose leadingDigitsPattern also matches the input.\"\n //\n if (canFormatCompleteNumber(state.nationalSignificantNumber, this.metadata)) {\n for (var _iterator = _createForOfIteratorHelperLoose(this.matchingFormats), _step; !(_step = _iterator()).done;) {\n var _format = _step.value;\n var formattedCompleteNumber = formatCompleteNumber(state, _format, {\n metadata: this.metadata,\n shouldTryNationalPrefixFormattingRule: function shouldTryNationalPrefixFormattingRule(format) {\n return _this.shouldTryNationalPrefixFormattingRule(format, {\n international: state.international,\n nationalPrefix: state.nationalPrefix\n });\n },\n getSeparatorAfterNationalPrefix: function getSeparatorAfterNationalPrefix(format) {\n return _this.getSeparatorAfterNationalPrefix(format);\n }\n });\n if (formattedCompleteNumber) {\n this.resetFormat();\n this.chosenFormat = _format;\n this.setNationalNumberTemplate(formattedCompleteNumber.replace(/\\d/g, DIGIT_PLACEHOLDER), state);\n this.populatedNationalNumberTemplate = formattedCompleteNumber;\n // With a new formatting template, the matched position\n // using the old template needs to be reset.\n this.populatedNationalNumberTemplatePosition = this.template.lastIndexOf(DIGIT_PLACEHOLDER);\n return formattedCompleteNumber;\n }\n }\n }\n // Format the digits as a partial (incomplete) phone number\n // using the previously chosen formatting pattern (or a newly chosen one).\n return this.formatNationalNumberWithNextDigits(nextDigits, state);\n }\n\n // Formats the next phone number digits.\n }, {\n key: \"formatNationalNumberWithNextDigits\",\n value: function formatNationalNumberWithNextDigits(nextDigits, state) {\n var previouslyChosenFormat = this.chosenFormat;\n\n // Choose a format from the list of matching ones.\n var newlyChosenFormat = this.chooseFormat(state);\n if (newlyChosenFormat) {\n if (newlyChosenFormat === previouslyChosenFormat) {\n // If it can format the next (current) digits\n // using the previously chosen phone number format\n // then return the updated formatted number.\n return this.formatNextNationalNumberDigits(nextDigits);\n } else {\n // If a more appropriate phone number format\n // has been chosen for these \"leading digits\",\n // then re-format the national phone number part\n // using the newly selected format.\n return this.formatNextNationalNumberDigits(state.getNationalDigits());\n }\n }\n }\n }, {\n key: \"narrowDownMatchingFormats\",\n value: function narrowDownMatchingFormats(_ref2) {\n var _this2 = this;\n var nationalSignificantNumber = _ref2.nationalSignificantNumber,\n nationalPrefix = _ref2.nationalPrefix,\n international = _ref2.international;\n var leadingDigits = nationalSignificantNumber;\n\n // \"leading digits\" pattern list starts with a\n // \"leading digits\" pattern fitting a maximum of 3 leading digits.\n // So, after a user inputs 3 digits of a national (significant) phone number\n // this national (significant) number can already be formatted.\n // The next \"leading digits\" pattern is for 4 leading digits max,\n // and the \"leading digits\" pattern after it is for 5 leading digits max, etc.\n\n // This implementation is different from Google's\n // in that it searches for a fitting format\n // even if the user has entered less than\n // `MIN_LEADING_DIGITS_LENGTH` digits of a national number.\n // Because some leading digit patterns already match for a single first digit.\n var leadingDigitsPatternIndex = leadingDigits.length - MIN_LEADING_DIGITS_LENGTH;\n if (leadingDigitsPatternIndex < 0) {\n leadingDigitsPatternIndex = 0;\n }\n this.matchingFormats = this.matchingFormats.filter(function (format) {\n return _this2.formatSuits(format, international, nationalPrefix) && _this2.formatMatches(format, leadingDigits, leadingDigitsPatternIndex);\n });\n\n // If there was a phone number format chosen\n // and it no longer holds given the new leading digits then reset it.\n // The test for this `if` condition is marked as:\n // \"Reset a chosen format when it no longer holds given the new leading digits\".\n // To construct a valid test case for this one can find a country\n // in `PhoneNumberMetadata.xml` yielding one format for 3 ``\n // and yielding another format for 4 `` (Australia in this case).\n if (this.chosenFormat && this.matchingFormats.indexOf(this.chosenFormat) === -1) {\n this.resetFormat();\n }\n }\n }, {\n key: \"formatSuits\",\n value: function formatSuits(format, international, nationalPrefix) {\n // When a prefix before a national (significant) number is\n // simply a national prefix, then it's parsed as `this.nationalPrefix`.\n // In more complex cases, a prefix before national (significant) number\n // could include a national prefix as well as some \"capturing groups\",\n // and in that case there's no info whether a national prefix has been parsed.\n // If national prefix is not used when formatting a phone number\n // using this format, but a national prefix has been entered by the user,\n // and was extracted, then discard such phone number format.\n // In Google's \"AsYouType\" formatter code, the equivalent would be this part:\n // https://github.com/google/libphonenumber/blob/0a45cfd96e71cad8edb0e162a70fcc8bd9728933/java/libphonenumber/src/com/google/i18n/phonenumbers/AsYouTypeFormatter.java#L175-L184\n if (nationalPrefix && !format.usesNationalPrefix() &&\n // !format.domesticCarrierCodeFormattingRule() &&\n !format.nationalPrefixIsOptionalWhenFormattingInNationalFormat()) {\n return false;\n }\n // If national prefix is mandatory for this phone number format\n // and there're no guarantees that a national prefix is present in user input\n // then discard this phone number format as not suitable.\n // In Google's \"AsYouType\" formatter code, the equivalent would be this part:\n // https://github.com/google/libphonenumber/blob/0a45cfd96e71cad8edb0e162a70fcc8bd9728933/java/libphonenumber/src/com/google/i18n/phonenumbers/AsYouTypeFormatter.java#L185-L193\n if (!international && !nationalPrefix && format.nationalPrefixIsMandatoryWhenFormattingInNationalFormat()) {\n return false;\n }\n return true;\n }\n }, {\n key: \"formatMatches\",\n value: function formatMatches(format, leadingDigits, leadingDigitsPatternIndex) {\n var leadingDigitsPatternsCount = format.leadingDigitsPatterns().length;\n\n // If this format is not restricted to a certain\n // leading digits pattern then it fits.\n // The test case could be found by searching for \"leadingDigitsPatternsCount === 0\".\n if (leadingDigitsPatternsCount === 0) {\n return true;\n }\n\n // Start narrowing down the list of possible formats based on the leading digits.\n // (only previously matched formats take part in the narrowing down process)\n\n // `leading_digits_patterns` start with 3 digits min\n // and then go up from there one digit at a time.\n leadingDigitsPatternIndex = Math.min(leadingDigitsPatternIndex, leadingDigitsPatternsCount - 1);\n var leadingDigitsPattern = format.leadingDigitsPatterns()[leadingDigitsPatternIndex];\n\n // Google imposes a requirement on the leading digits\n // to be minimum 3 digits long in order to be eligible\n // for checking those with a leading digits pattern.\n //\n // Since `leading_digits_patterns` start with 3 digits min,\n // Google's original `libphonenumber` library only starts\n // excluding any non-matching formats only when the\n // national number entered so far is at least 3 digits long,\n // otherwise format matching would give false negatives.\n //\n // For example, when the digits entered so far are `2`\n // and the leading digits pattern is `21` –\n // it's quite obvious in this case that the format could be the one\n // but due to the absence of further digits it would give false negative.\n //\n // Also, `leading_digits_patterns` doesn't always correspond to a single\n // digits count. For example, `60|8` pattern would already match `8`\n // but the `60` part would require having at least two leading digits,\n // so the whole pattern would require inputting two digits first in order to\n // decide on whether it matches the input, even when the input is \"80\".\n //\n // This library — `libphonenumber-js` — allows filtering by `leading_digits_patterns`\n // even when there's only 1 or 2 digits of the national (significant) number.\n // To do that, it uses a non-strict pattern matcher written specifically for that.\n //\n if (leadingDigits.length < MIN_LEADING_DIGITS_LENGTH) {\n // Before leading digits < 3 matching was implemented:\n // return true\n //\n // After leading digits < 3 matching was implemented:\n try {\n return new PatternMatcher(leadingDigitsPattern).match(leadingDigits, {\n allowOverflow: true\n }) !== undefined;\n } catch (error) /* istanbul ignore next */{\n // There's a slight possibility that there could be some undiscovered bug\n // in the pattern matcher code. Since the \"leading digits < 3 matching\"\n // feature is not \"essential\" for operation, it can fall back to the old way\n // in case of any issues rather than halting the application's execution.\n console.error(error);\n return true;\n }\n }\n\n // If at least `MIN_LEADING_DIGITS_LENGTH` digits of a national number are\n // available then use the usual regular expression matching.\n //\n // The whole pattern is wrapped in round brackets (`()`) because\n // the pattern can use \"or\" operator (`|`) at the top level of the pattern.\n //\n return new RegExp(\"^(\".concat(leadingDigitsPattern, \")\")).test(leadingDigits);\n }\n }, {\n key: \"getFormatFormat\",\n value: function getFormatFormat(format, international) {\n return international ? format.internationalFormat() : format.format();\n }\n }, {\n key: \"chooseFormat\",\n value: function chooseFormat(state) {\n var _this3 = this;\n var _loop = function _loop() {\n var format = _step2.value;\n // If this format is currently being used\n // and is still suitable, then stick to it.\n if (_this3.chosenFormat === format) {\n return 0; // break\n }\n // Sometimes, a formatting rule inserts additional digits in a phone number,\n // and \"as you type\" formatter can't do that: it should only use the digits\n // that the user has input.\n //\n // For example, in Argentina, there's a format for mobile phone numbers:\n //\n // {\n // \"pattern\": \"(\\\\d)(\\\\d{2})(\\\\d{4})(\\\\d{4})\",\n // \"leading_digits_patterns\": [\"91\"],\n // \"national_prefix_formatting_rule\": \"0$1\",\n // \"format\": \"$2 15-$3-$4\",\n // \"international_format\": \"$1 $2 $3-$4\"\n // }\n //\n // In that format, `international_format` is used instead of `format`\n // because `format` inserts `15` in the formatted number,\n // and `AsYouType` formatter should only use the digits\n // the user has actually input, without adding any extra digits.\n // In this case, it wouldn't make a difference, because the `15`\n // is first stripped when applying `national_prefix_for_parsing`\n // and then re-added when using `format`, so in reality it doesn't\n // add any new digits to the number, but to detect that, the code\n // would have to be more complex: it would have to try formatting\n // the digits using the format and then see if any digits have\n // actually been added or removed, and then, every time a new digit\n // is input, it should re-check whether the chosen format doesn't\n // alter the digits.\n //\n // Google's code doesn't go that far, and so does this library:\n // it simply requires that a `format` doesn't add any additonal\n // digits to user's input.\n //\n // Also, people in general should move from inputting phone numbers\n // in national format (possibly with national prefixes)\n // and use international phone number format instead:\n // it's a logical thing in the modern age of mobile phones,\n // globalization and the internet.\n //\n /* istanbul ignore if */\n if (!NON_ALTERING_FORMAT_REG_EXP.test(_this3.getFormatFormat(format, state.international))) {\n return 1; // continue\n }\n if (!_this3.createTemplateForFormat(format, state)) {\n // Remove the format if it can't generate a template.\n _this3.matchingFormats = _this3.matchingFormats.filter(function (_) {\n return _ !== format;\n });\n return 1; // continue\n }\n _this3.chosenFormat = format;\n return 0; // break\n },\n _ret;\n // When there are multiple available formats, the formatter uses the first\n // format where a formatting template could be created.\n //\n // For some weird reason, `istanbul` says \"else path not taken\"\n // for the `for of` line below. Supposedly that means that\n // the loop doesn't ever go over the last element in the list.\n // That's true because there always is `this.chosenFormat`\n // when `this.matchingFormats` is non-empty.\n // And, for some weird reason, it doesn't think that the case\n // with empty `this.matchingFormats` qualifies for a valid \"else\" path.\n // So simply muting this `istanbul` warning.\n // It doesn't skip the contents of the `for of` loop,\n // it just skips the `for of` line.\n //\n /* istanbul ignore next */\n for (var _iterator2 = _createForOfIteratorHelperLoose(this.matchingFormats.slice()), _step2; !(_step2 = _iterator2()).done;) {\n _ret = _loop();\n if (_ret === 0) break;\n if (_ret === 1) continue;\n }\n if (!this.chosenFormat) {\n // No format matches the national (significant) phone number.\n this.resetFormat();\n }\n return this.chosenFormat;\n }\n }, {\n key: \"createTemplateForFormat\",\n value: function createTemplateForFormat(format, state) {\n // The formatter doesn't format numbers when numberPattern contains '|', e.g.\n // (20|3)\\d{4}. In those cases we quickly return.\n // (Though there's no such format in current metadata)\n /* istanbul ignore if */\n if (SUPPORT_LEGACY_FORMATTING_PATTERNS && format.pattern().indexOf('|') >= 0) {\n return;\n }\n // Get formatting template for this phone number format\n var template = this.getTemplateForFormat(format, state);\n // If the national number entered is too long\n // for any phone number format, then abort.\n if (template) {\n this.setNationalNumberTemplate(template, state);\n return true;\n }\n }\n }, {\n key: \"getSeparatorAfterNationalPrefix\",\n value: function getSeparatorAfterNationalPrefix(format) {\n // `US` metadata doesn't have a `national_prefix_formatting_rule`,\n // so the `if` condition below doesn't apply to `US`,\n // but in reality there shoudl be a separator\n // between a national prefix and a national (significant) number.\n // So `US` national prefix separator is a \"special\" \"hardcoded\" case.\n if (this.isNANP) {\n return ' ';\n }\n // If a `format` has a `national_prefix_formatting_rule`\n // and that rule has a separator after a national prefix,\n // then it means that there should be a separator\n // between a national prefix and a national (significant) number.\n if (format && format.nationalPrefixFormattingRule() && NATIONAL_PREFIX_SEPARATORS_PATTERN.test(format.nationalPrefixFormattingRule())) {\n return ' ';\n }\n // At this point, there seems to be no clear evidence that\n // there should be a separator between a national prefix\n // and a national (significant) number. So don't insert one.\n return '';\n }\n }, {\n key: \"getInternationalPrefixBeforeCountryCallingCode\",\n value: function getInternationalPrefixBeforeCountryCallingCode(_ref3, options) {\n var IDDPrefix = _ref3.IDDPrefix,\n missingPlus = _ref3.missingPlus;\n if (IDDPrefix) {\n return options && options.spacing === false ? IDDPrefix : IDDPrefix + ' ';\n }\n if (missingPlus) {\n return '';\n }\n return '+';\n }\n }, {\n key: \"getTemplate\",\n value: function getTemplate(state) {\n if (!this.template) {\n return;\n }\n // `this.template` holds the template for a \"complete\" phone number.\n // The currently entered phone number is most likely not \"complete\",\n // so trim all non-populated digits.\n var index = -1;\n var i = 0;\n var internationalPrefix = state.international ? this.getInternationalPrefixBeforeCountryCallingCode(state, {\n spacing: false\n }) : '';\n while (i < internationalPrefix.length + state.getDigitsWithoutInternationalPrefix().length) {\n index = this.template.indexOf(DIGIT_PLACEHOLDER, index + 1);\n i++;\n }\n return cutAndStripNonPairedParens(this.template, index + 1);\n }\n }, {\n key: \"setNationalNumberTemplate\",\n value: function setNationalNumberTemplate(template, state) {\n this.nationalNumberTemplate = template;\n this.populatedNationalNumberTemplate = template;\n // With a new formatting template, the matched position\n // using the old template needs to be reset.\n this.populatedNationalNumberTemplatePosition = -1;\n // For convenience, the public `.template` property\n // contains the whole international number\n // if the phone number being input is international:\n // 'x' for the '+' sign, 'x'es for the country phone code,\n // a spacebar and then the template for the formatted national number.\n if (state.international) {\n this.template = this.getInternationalPrefixBeforeCountryCallingCode(state).replace(/[\\d\\+]/g, DIGIT_PLACEHOLDER) + repeat(DIGIT_PLACEHOLDER, state.callingCode.length) + ' ' + template;\n } else {\n this.template = template;\n }\n }\n\n /**\n * Generates formatting template for a national phone number,\n * optionally containing a national prefix, for a format.\n * @param {Format} format\n * @param {string} nationalPrefix\n * @return {string}\n */\n }, {\n key: \"getTemplateForFormat\",\n value: function getTemplateForFormat(format, _ref4) {\n var nationalSignificantNumber = _ref4.nationalSignificantNumber,\n international = _ref4.international,\n nationalPrefix = _ref4.nationalPrefix,\n prefixBeforeNationalSignificantNumberThatIsNotNationalPrefix = _ref4.prefixBeforeNationalSignificantNumberThatIsNotNationalPrefix;\n var pattern = format.pattern();\n\n /* istanbul ignore else */\n if (SUPPORT_LEGACY_FORMATTING_PATTERNS) {\n pattern = pattern\n // Replace anything in the form of [..] with \\d\n .replace(CREATE_CHARACTER_CLASS_PATTERN(), '\\\\d')\n // Replace any standalone digit (not the one in `{}`) with \\d\n .replace(CREATE_STANDALONE_DIGIT_PATTERN(), '\\\\d');\n }\n\n // Generate a dummy national number (consisting of `9`s)\n // that fits this format's `pattern`.\n //\n // This match will always succeed,\n // because the \"longest dummy phone number\"\n // has enough length to accomodate any possible\n // national phone number format pattern.\n //\n var digits = LONGEST_DUMMY_PHONE_NUMBER.match(pattern)[0];\n\n // If the national number entered is too long\n // for any phone number format, then abort.\n if (nationalSignificantNumber.length > digits.length) {\n return;\n }\n\n // Get a formatting template which can be used to efficiently format\n // a partial number where digits are added one by one.\n\n // Below `strictPattern` is used for the\n // regular expression (with `^` and `$`).\n // This wasn't originally in Google's `libphonenumber`\n // and I guess they don't really need it\n // because they're not using \"templates\" to format phone numbers\n // but I added `strictPattern` after encountering\n // South Korean phone number formatting bug.\n //\n // Non-strict regular expression bug demonstration:\n //\n // this.nationalSignificantNumber : `111111111` (9 digits)\n //\n // pattern : (\\d{2})(\\d{3,4})(\\d{4})\n // format : `$1 $2 $3`\n // digits : `9999999999` (10 digits)\n //\n // '9999999999'.replace(new RegExp(/(\\d{2})(\\d{3,4})(\\d{4})/g), '$1 $2 $3') = \"99 9999 9999\"\n //\n // template : xx xxxx xxxx\n //\n // But the correct template in this case is `xx xxx xxxx`.\n // The template was generated incorrectly because of the\n // `{3,4}` variability in the `pattern`.\n //\n // The fix is, if `this.nationalSignificantNumber` has already sufficient length\n // to satisfy the `pattern` completely then `this.nationalSignificantNumber`\n // is used instead of `digits`.\n\n var strictPattern = new RegExp('^' + pattern + '$');\n var nationalNumberDummyDigits = nationalSignificantNumber.replace(/\\d/g, DUMMY_DIGIT);\n\n // If `this.nationalSignificantNumber` has already sufficient length\n // to satisfy the `pattern` completely then use it\n // instead of `digits`.\n if (strictPattern.test(nationalNumberDummyDigits)) {\n digits = nationalNumberDummyDigits;\n }\n var numberFormat = this.getFormatFormat(format, international);\n var nationalPrefixIncludedInTemplate;\n\n // If a user did input a national prefix (and that's guaranteed),\n // and if a `format` does have a national prefix formatting rule,\n // then see if that national prefix formatting rule\n // prepends exactly the same national prefix the user has input.\n // If that's the case, then use the `format` with the national prefix formatting rule.\n // Otherwise, use the `format` without the national prefix formatting rule,\n // and prepend a national prefix manually to it.\n if (this.shouldTryNationalPrefixFormattingRule(format, {\n international: international,\n nationalPrefix: nationalPrefix\n })) {\n var numberFormatWithNationalPrefix = numberFormat.replace(FIRST_GROUP_PATTERN, format.nationalPrefixFormattingRule());\n // If `national_prefix_formatting_rule` of a `format` simply prepends\n // national prefix at the start of a national (significant) number,\n // then such formatting can be used with `AsYouType` formatter.\n // There seems to be no `else` case: everywhere in metadata,\n // national prefix formatting rule is national prefix + $1,\n // or `($1)`, in which case such format isn't even considered\n // when the user has input a national prefix.\n /* istanbul ignore else */\n if (parseDigits(format.nationalPrefixFormattingRule()) === (nationalPrefix || '') + parseDigits('$1')) {\n numberFormat = numberFormatWithNationalPrefix;\n nationalPrefixIncludedInTemplate = true;\n // Replace all digits of the national prefix in the formatting template\n // with `DIGIT_PLACEHOLDER`s.\n if (nationalPrefix) {\n var i = nationalPrefix.length;\n while (i > 0) {\n numberFormat = numberFormat.replace(/\\d/, DIGIT_PLACEHOLDER);\n i--;\n }\n }\n }\n }\n\n // Generate formatting template for this phone number format.\n var template = digits\n // Format the dummy phone number according to the format.\n .replace(new RegExp(pattern), numberFormat)\n // Replace each dummy digit with a DIGIT_PLACEHOLDER.\n .replace(new RegExp(DUMMY_DIGIT, 'g'), DIGIT_PLACEHOLDER);\n\n // If a prefix of a national (significant) number is not as simple\n // as just a basic national prefix, then just prepend such prefix\n // before the national (significant) number, optionally spacing\n // the two with a whitespace.\n if (!nationalPrefixIncludedInTemplate) {\n if (prefixBeforeNationalSignificantNumberThatIsNotNationalPrefix) {\n // Prepend the prefix to the template manually.\n template = repeat(DIGIT_PLACEHOLDER, prefixBeforeNationalSignificantNumberThatIsNotNationalPrefix.length) + ' ' + template;\n } else if (nationalPrefix) {\n // Prepend national prefix to the template manually.\n template = repeat(DIGIT_PLACEHOLDER, nationalPrefix.length) + this.getSeparatorAfterNationalPrefix(format) + template;\n }\n }\n if (international) {\n template = applyInternationalSeparatorStyle(template);\n }\n return template;\n }\n }, {\n key: \"formatNextNationalNumberDigits\",\n value: function formatNextNationalNumberDigits(digits) {\n var result = populateTemplateWithDigits(this.populatedNationalNumberTemplate, this.populatedNationalNumberTemplatePosition, digits);\n if (!result) {\n // Reset the format.\n this.resetFormat();\n return;\n }\n this.populatedNationalNumberTemplate = result[0];\n this.populatedNationalNumberTemplatePosition = result[1];\n\n // Return the formatted phone number so far.\n return cutAndStripNonPairedParens(this.populatedNationalNumberTemplate, this.populatedNationalNumberTemplatePosition + 1);\n\n // The old way which was good for `input-format` but is not so good\n // for `react-phone-number-input`'s default input (`InputBasic`).\n // return closeNonPairedParens(this.populatedNationalNumberTemplate, this.populatedNationalNumberTemplatePosition + 1)\n // \t.replace(new RegExp(DIGIT_PLACEHOLDER, 'g'), ' ')\n }\n }, {\n key: \"shouldTryNationalPrefixFormattingRule\",\n value: function shouldTryNationalPrefixFormattingRule(format, _ref5) {\n var international = _ref5.international,\n nationalPrefix = _ref5.nationalPrefix;\n if (format.nationalPrefixFormattingRule()) {\n // In some countries, `national_prefix_formatting_rule` is `($1)`,\n // so it applies even if the user hasn't input a national prefix.\n // `format.usesNationalPrefix()` detects such cases.\n var usesNationalPrefix = format.usesNationalPrefix();\n if (usesNationalPrefix && nationalPrefix || !usesNationalPrefix && !international) {\n return true;\n }\n }\n }\n }]);\n}();\nexport { AsYouTypeFormatter as default };\n//# sourceMappingURL=AsYouTypeFormatter.js.map","function _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\nfunction _unsupportedIterableToArray(r, a) { if (r) { if (\"string\" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return \"Object\" === t && r.constructor && (t = r.constructor.name), \"Map\" === t || \"Set\" === t ? Array.from(r) : \"Arguments\" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }\nfunction _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }\nfunction _iterableToArrayLimit(r, l) { var t = null == r ? null : \"undefined\" != typeof Symbol && r[Symbol.iterator] || r[\"@@iterator\"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t[\"return\"] && (u = t[\"return\"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }\nfunction _arrayWithHoles(r) { if (Array.isArray(r)) return r; }\nfunction _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError(\"Cannot call a class as a function\"); }\nfunction _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, \"value\" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }\nfunction _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, \"prototype\", { writable: !1 }), e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nimport _extractCountryCallingCode from './helpers/extractCountryCallingCode.js';\nimport extractCountryCallingCodeFromInternationalNumberWithoutPlusSign from './helpers/extractCountryCallingCodeFromInternationalNumberWithoutPlusSign.js';\nimport extractNationalNumberFromPossiblyIncompleteNumber from './helpers/extractNationalNumberFromPossiblyIncompleteNumber.js';\nimport stripIddPrefix from './helpers/stripIddPrefix.js';\nimport parseDigits from './helpers/parseDigits.js';\nimport { VALID_DIGITS, VALID_PUNCTUATION, PLUS_CHARS } from './constants.js';\nvar VALID_FORMATTED_PHONE_NUMBER_DIGITS_PART = '[' + VALID_PUNCTUATION + VALID_DIGITS + ']+';\nvar VALID_FORMATTED_PHONE_NUMBER_DIGITS_PART_PATTERN = new RegExp('^' + VALID_FORMATTED_PHONE_NUMBER_DIGITS_PART + '$', 'i');\nvar VALID_FORMATTED_PHONE_NUMBER_PART = '(?:' + '[' + PLUS_CHARS + ']' + '[' + VALID_PUNCTUATION + VALID_DIGITS + ']*' + '|' + '[' + VALID_PUNCTUATION + VALID_DIGITS + ']+' + ')';\nvar AFTER_PHONE_NUMBER_DIGITS_END_PATTERN = new RegExp('[^' + VALID_PUNCTUATION + VALID_DIGITS + ']+' + '.*' + '$');\n\n// Tests whether `national_prefix_for_parsing` could match\n// different national prefixes.\n// Matches anything that's not a digit or a square bracket.\nvar COMPLEX_NATIONAL_PREFIX = /[^\\d\\[\\]]/;\nvar AsYouTypeParser = /*#__PURE__*/function () {\n function AsYouTypeParser(_ref) {\n var defaultCountry = _ref.defaultCountry,\n defaultCallingCode = _ref.defaultCallingCode,\n metadata = _ref.metadata,\n onNationalSignificantNumberChange = _ref.onNationalSignificantNumberChange;\n _classCallCheck(this, AsYouTypeParser);\n this.defaultCountry = defaultCountry;\n this.defaultCallingCode = defaultCallingCode;\n this.metadata = metadata;\n this.onNationalSignificantNumberChange = onNationalSignificantNumberChange;\n }\n return _createClass(AsYouTypeParser, [{\n key: \"input\",\n value: function input(text, state) {\n var _extractFormattedDigi = extractFormattedDigitsAndPlus(text),\n _extractFormattedDigi2 = _slicedToArray(_extractFormattedDigi, 2),\n formattedDigits = _extractFormattedDigi2[0],\n hasPlus = _extractFormattedDigi2[1];\n var digits = parseDigits(formattedDigits);\n // Checks for a special case: just a leading `+` has been entered.\n var justLeadingPlus;\n if (hasPlus) {\n if (!state.digits) {\n state.startInternationalNumber(undefined, undefined);\n if (!digits) {\n justLeadingPlus = true;\n }\n }\n }\n if (digits) {\n this.inputDigits(digits, state);\n }\n return {\n digits: digits,\n justLeadingPlus: justLeadingPlus\n };\n }\n\n /**\n * Inputs \"next\" phone number digits.\n * @param {string} digits\n * @return {string} [formattedNumber] Formatted national phone number (if it can be formatted at this stage). Returning `undefined` means \"don't format the national phone number at this stage\".\n */\n }, {\n key: \"inputDigits\",\n value: function inputDigits(nextDigits, state) {\n var digits = state.digits;\n var hasReceivedThreeLeadingDigits = digits.length < 3 && digits.length + nextDigits.length >= 3;\n\n // Append phone number digits.\n state.appendDigits(nextDigits);\n\n // Attempt to extract IDD prefix:\n // Some users input their phone number in international format,\n // but in an \"out-of-country\" dialing format instead of using the leading `+`.\n // https://github.com/catamphetamine/libphonenumber-js/issues/185\n // Detect such numbers as soon as there're at least 3 digits.\n // Google's library attempts to extract IDD prefix at 3 digits,\n // so this library just copies that behavior.\n // I guess that's because the most commot IDD prefixes are\n // `00` (Europe) and `011` (US).\n // There exist really long IDD prefixes too:\n // for example, in Australia the default IDD prefix is `0011`,\n // and it could even be as long as `14880011`.\n // An IDD prefix is extracted here, and then every time when\n // there's a new digit and the number couldn't be formatted.\n if (hasReceivedThreeLeadingDigits) {\n this.extractIddPrefix(state);\n }\n if (this.isWaitingForCountryCallingCode(state)) {\n if (!this.extractCountryCallingCode(state)) {\n return;\n }\n } else {\n state.appendNationalSignificantNumberDigits(nextDigits);\n }\n\n // If a phone number is being input in international format,\n // then it's not valid for it to have a national prefix.\n // Still, some people incorrectly input such numbers with a national prefix.\n // In such cases, only attempt to strip a national prefix if the number becomes too long.\n // (but that is done later, not here)\n if (!state.international) {\n if (!this.hasExtractedNationalSignificantNumber) {\n this.extractNationalSignificantNumber(state.getNationalDigits(), function (stateUpdate) {\n return state.update(stateUpdate);\n });\n }\n }\n }\n }, {\n key: \"isWaitingForCountryCallingCode\",\n value: function isWaitingForCountryCallingCode(_ref2) {\n var international = _ref2.international,\n callingCode = _ref2.callingCode;\n return international && !callingCode;\n }\n\n // Extracts a country calling code from a number\n // being entered in internatonal format.\n }, {\n key: \"extractCountryCallingCode\",\n value: function extractCountryCallingCode(state) {\n var _extractCountryCallin = _extractCountryCallingCode('+' + state.getDigitsWithoutInternationalPrefix(), state.country, this.defaultCountry, this.defaultCallingCode, this.metadata.metadata),\n countryCallingCode = _extractCountryCallin.countryCallingCode,\n number = _extractCountryCallin.number;\n if (countryCallingCode) {\n state.setCallingCode(countryCallingCode);\n state.update({\n nationalSignificantNumber: number\n });\n return true;\n }\n }\n }, {\n key: \"reset\",\n value: function reset(numberingPlan) {\n if (numberingPlan) {\n this.hasSelectedNumberingPlan = true;\n var nationalPrefixForParsing = numberingPlan._nationalPrefixForParsing();\n this.couldPossiblyExtractAnotherNationalSignificantNumber = nationalPrefixForParsing && COMPLEX_NATIONAL_PREFIX.test(nationalPrefixForParsing);\n } else {\n this.hasSelectedNumberingPlan = undefined;\n this.couldPossiblyExtractAnotherNationalSignificantNumber = undefined;\n }\n }\n\n /**\n * Extracts a national (significant) number from user input.\n * Google's library is different in that it only applies `national_prefix_for_parsing`\n * and doesn't apply `national_prefix_transform_rule` after that.\n * https://github.com/google/libphonenumber/blob/a3d70b0487875475e6ad659af404943211d26456/java/libphonenumber/src/com/google/i18n/phonenumbers/AsYouTypeFormatter.java#L539\n * @return {boolean} [extracted]\n */\n }, {\n key: \"extractNationalSignificantNumber\",\n value: function extractNationalSignificantNumber(nationalDigits, setState) {\n if (!this.hasSelectedNumberingPlan) {\n return;\n }\n var _extractNationalNumbe = extractNationalNumberFromPossiblyIncompleteNumber(nationalDigits, this.metadata),\n nationalPrefix = _extractNationalNumbe.nationalPrefix,\n nationalNumber = _extractNationalNumbe.nationalNumber,\n carrierCode = _extractNationalNumbe.carrierCode;\n if (nationalNumber === nationalDigits) {\n return;\n }\n this.onExtractedNationalNumber(nationalPrefix, carrierCode, nationalNumber, nationalDigits, setState);\n return true;\n }\n\n /**\n * In Google's code this function is called \"attempt to extract longer NDD\".\n * \"Some national prefixes are a substring of others\", they say.\n * @return {boolean} [result] — Returns `true` if extracting a national prefix produced different results from what they were.\n */\n }, {\n key: \"extractAnotherNationalSignificantNumber\",\n value: function extractAnotherNationalSignificantNumber(nationalDigits, prevNationalSignificantNumber, setState) {\n if (!this.hasExtractedNationalSignificantNumber) {\n return this.extractNationalSignificantNumber(nationalDigits, setState);\n }\n if (!this.couldPossiblyExtractAnotherNationalSignificantNumber) {\n return;\n }\n var _extractNationalNumbe2 = extractNationalNumberFromPossiblyIncompleteNumber(nationalDigits, this.metadata),\n nationalPrefix = _extractNationalNumbe2.nationalPrefix,\n nationalNumber = _extractNationalNumbe2.nationalNumber,\n carrierCode = _extractNationalNumbe2.carrierCode;\n // If a national prefix has been extracted previously,\n // then it's always extracted as additional digits are added.\n // That's assuming `extractNationalNumberFromPossiblyIncompleteNumber()`\n // doesn't do anything different from what it currently does.\n // So, just in case, here's this check, though it doesn't occur.\n /* istanbul ignore if */\n if (nationalNumber === prevNationalSignificantNumber) {\n return;\n }\n this.onExtractedNationalNumber(nationalPrefix, carrierCode, nationalNumber, nationalDigits, setState);\n return true;\n }\n }, {\n key: \"onExtractedNationalNumber\",\n value: function onExtractedNationalNumber(nationalPrefix, carrierCode, nationalSignificantNumber, nationalDigits, setState) {\n // Tells if the parsed national (significant) number is present as-is in the input string.\n // For example, when inputting \"0343515551212999\" Argentinian mobile number,\n // the parsed national (significant) number is \"93435551212999\".\n // There, one can see how it stripped \"0\" national prefix and prepended a \"9\",\n // because that's how it is instructed to do in Argentina's metadata.\n // So in the described example, the parsed national (significant) number is not present\n // as-is in the input string. Instead, it's \"modified\" in the input string.\n // https://gitlab.com/catamphetamine/libphonenumber-js/-/blob/master/METADATA.md#national_prefix_for_parsing--national_prefix_transform_rule\n var nationalSignificantNumberIsModified = false;\n\n // In some countries, a phone number could have a prefix that is not a \"national prefix\"\n // but rather some other type of \"utility\" prefix.\n // For example, when calling within Australia, one could prepend `1831` prefix to hide\n // caller's phone number.\n // https://gitlab.com/catamphetamine/libphonenumber-js/-/blob/master/METADATA.md#national_prefix_for_parsing--national_prefix_transform_rule\n var prefixBeforeNationalSignificantNumberThatIsNotNationalPrefix;\n\n // `nationalSignificantNumber` could be empty. In that case, `.lastIndexOf()` still works correctly.\n var nationalSignificantNumberIndex = nationalDigits.lastIndexOf(nationalSignificantNumber);\n\n // If the parsed national (significant) number is the last substring of the `nationalDigits`,\n // then it means that it's present as-is in the input string.\n // In any other case, the parsed national (significant) number is \"modified\" in the input string.\n if (nationalSignificantNumberIndex < 0 || nationalSignificantNumberIndex !== nationalDigits.length - nationalSignificantNumber.length) {\n nationalSignificantNumberIsModified = true;\n } else {\n var prefixBeforeNationalNumber = nationalDigits.slice(0, nationalSignificantNumberIndex);\n // When national (significant) number is equal to the `nationalDigits`,\n // this `onExtractedNationalNumber()` function simply doesn't get called.\n // This means that at this point, `prefixBeforeNationalNumber` is always non-empty.\n // Still, added this `if` check just to prevent potential silly bugs.\n // The `!prefixBeforeNationalNumber` case is not really testable\n // so this line is exluded from the code coverage.\n /* istanbul ignore if */\n if (prefixBeforeNationalNumber) {\n if (prefixBeforeNationalNumber !== nationalPrefix) {\n prefixBeforeNationalSignificantNumberThatIsNotNationalPrefix = prefixBeforeNationalNumber;\n }\n }\n }\n setState({\n nationalPrefix: nationalPrefix,\n carrierCode: carrierCode,\n nationalSignificantNumber: nationalSignificantNumber,\n nationalSignificantNumberIsModified: nationalSignificantNumberIsModified,\n prefixBeforeNationalSignificantNumberThatIsNotNationalPrefix: prefixBeforeNationalSignificantNumberThatIsNotNationalPrefix\n });\n // `onExtractedNationalNumber()` is only called when\n // the national (significant) number actually did change.\n this.hasExtractedNationalSignificantNumber = true;\n this.onNationalSignificantNumberChange();\n }\n }, {\n key: \"reExtractNationalSignificantNumber\",\n value: function reExtractNationalSignificantNumber(state) {\n // Attempt to extract a national prefix.\n //\n // Some people incorrectly input national prefix\n // in an international phone number.\n // For example, some people write British phone numbers as `+44(0)...`.\n //\n // Also, in some rare cases, it is valid for a national prefix\n // to be a part of an international phone number.\n // For example, mobile phone numbers in Mexico are supposed to be\n // dialled internationally using a `1` national prefix,\n // so the national prefix will be part of an international number.\n //\n // Quote from:\n // https://www.mexperience.com/dialing-cell-phones-in-mexico/\n //\n // \"Dialing a Mexican cell phone from abroad\n // When you are calling a cell phone number in Mexico from outside Mexico,\n // it’s necessary to dial an additional “1” after Mexico’s country code\n // (which is “52”) and before the area code.\n // You also ignore the 045, and simply dial the area code and the\n // cell phone’s number.\n //\n // If you don’t add the “1”, you’ll receive a recorded announcement\n // asking you to redial using it.\n //\n // For example, if you are calling from the USA to a cell phone\n // in Mexico City, you would dial +52 – 1 – 55 – 1234 5678.\n // (Note that this is different to calling a land line in Mexico City\n // from abroad, where the number dialed would be +52 – 55 – 1234 5678)\".\n //\n // Google's demo output:\n // https://libphonenumber.appspot.com/phonenumberparser?number=%2b5215512345678&country=MX\n //\n if (this.extractAnotherNationalSignificantNumber(state.getNationalDigits(), state.nationalSignificantNumber, function (stateUpdate) {\n return state.update(stateUpdate);\n })) {\n return true;\n }\n // If no format matches the phone number, then it could be\n // \"a really long IDD\" (quote from a comment in Google's library).\n // An IDD prefix is first extracted when the user has entered at least 3 digits,\n // and then here — every time when there's a new digit and the number\n // couldn't be formatted.\n // For example, in Australia the default IDD prefix is `0011`,\n // and it could even be as long as `14880011`.\n //\n // Could also check `!hasReceivedThreeLeadingDigits` here\n // to filter out the case when this check duplicates the one\n // already performed when there're 3 leading digits,\n // but it's not a big deal, and in most cases there\n // will be a suitable `format` when there're 3 leading digits.\n //\n if (this.extractIddPrefix(state)) {\n this.extractCallingCodeAndNationalSignificantNumber(state);\n return true;\n }\n // Google's AsYouType formatter supports sort of an \"autocorrection\" feature\n // when it \"autocorrects\" numbers that have been input for a country\n // with that country's calling code.\n // Such \"autocorrection\" feature looks weird, but different people have been requesting it:\n // https://github.com/catamphetamine/libphonenumber-js/issues/376\n // https://github.com/catamphetamine/libphonenumber-js/issues/375\n // https://github.com/catamphetamine/libphonenumber-js/issues/316\n if (this.fixMissingPlus(state)) {\n this.extractCallingCodeAndNationalSignificantNumber(state);\n return true;\n }\n }\n }, {\n key: \"extractIddPrefix\",\n value: function extractIddPrefix(state) {\n // An IDD prefix can't be present in a number written with a `+`.\n // Also, don't re-extract an IDD prefix if has already been extracted.\n var international = state.international,\n IDDPrefix = state.IDDPrefix,\n digits = state.digits,\n nationalSignificantNumber = state.nationalSignificantNumber;\n if (international || IDDPrefix) {\n return;\n }\n // Some users input their phone number in \"out-of-country\"\n // dialing format instead of using the leading `+`.\n // https://github.com/catamphetamine/libphonenumber-js/issues/185\n // Detect such numbers.\n var numberWithoutIDD = stripIddPrefix(digits, this.defaultCountry, this.defaultCallingCode, this.metadata.metadata);\n if (numberWithoutIDD !== undefined && numberWithoutIDD !== digits) {\n // If an IDD prefix was stripped then convert the IDD-prefixed number\n // to international number for subsequent parsing.\n state.update({\n IDDPrefix: digits.slice(0, digits.length - numberWithoutIDD.length)\n });\n this.startInternationalNumber(state, {\n country: undefined,\n callingCode: undefined\n });\n return true;\n }\n }\n }, {\n key: \"fixMissingPlus\",\n value: function fixMissingPlus(state) {\n if (!state.international) {\n var _extractCountryCallin2 = extractCountryCallingCodeFromInternationalNumberWithoutPlusSign(state.digits, state.country, this.defaultCountry, this.defaultCallingCode, this.metadata.metadata),\n newCallingCode = _extractCountryCallin2.countryCallingCode;\n if (newCallingCode) {\n state.update({\n missingPlus: true\n });\n this.startInternationalNumber(state, {\n country: state.country,\n callingCode: newCallingCode\n });\n return true;\n }\n }\n }\n }, {\n key: \"startInternationalNumber\",\n value: function startInternationalNumber(state, _ref3) {\n var country = _ref3.country,\n callingCode = _ref3.callingCode;\n state.startInternationalNumber(country, callingCode);\n // If a national (significant) number has been extracted before, reset it.\n if (state.nationalSignificantNumber) {\n state.resetNationalSignificantNumber();\n this.onNationalSignificantNumberChange();\n this.hasExtractedNationalSignificantNumber = undefined;\n }\n }\n }, {\n key: \"extractCallingCodeAndNationalSignificantNumber\",\n value: function extractCallingCodeAndNationalSignificantNumber(state) {\n if (this.extractCountryCallingCode(state)) {\n // `this.extractCallingCode()` is currently called when the number\n // couldn't be formatted during the standard procedure.\n // Normally, the national prefix would be re-extracted\n // for an international number if such number couldn't be formatted,\n // but since it's already not able to be formatted,\n // there won't be yet another retry, so also extract national prefix here.\n this.extractNationalSignificantNumber(state.getNationalDigits(), function (stateUpdate) {\n return state.update(stateUpdate);\n });\n }\n }\n }]);\n}();\n/**\n * Extracts formatted phone number from text (if there's any).\n * @param {string} text\n * @return {string} [formattedPhoneNumber]\n */\nexport { AsYouTypeParser as default };\nfunction extractFormattedPhoneNumber(text) {\n // Attempt to extract a possible number from the string passed in.\n var startsAt = text.search(VALID_FORMATTED_PHONE_NUMBER_PART);\n if (startsAt < 0) {\n return;\n }\n // Trim everything to the left of the phone number.\n text = text.slice(startsAt);\n // Trim the `+`.\n var hasPlus;\n if (text[0] === '+') {\n hasPlus = true;\n text = text.slice('+'.length);\n }\n // Trim everything to the right of the phone number.\n text = text.replace(AFTER_PHONE_NUMBER_DIGITS_END_PATTERN, '');\n // Re-add the previously trimmed `+`.\n if (hasPlus) {\n text = '+' + text;\n }\n return text;\n}\n\n/**\n * Extracts formatted phone number digits (and a `+`) from text (if there're any).\n * @param {string} text\n * @return {any[]}\n */\nfunction _extractFormattedDigitsAndPlus(text) {\n // Extract a formatted phone number part from text.\n var extractedNumber = extractFormattedPhoneNumber(text) || '';\n // Trim a `+`.\n if (extractedNumber[0] === '+') {\n return [extractedNumber.slice('+'.length), true];\n }\n return [extractedNumber];\n}\n\n/**\n * Extracts formatted phone number digits (and a `+`) from text (if there're any).\n * @param {string} text\n * @return {any[]}\n */\nexport function extractFormattedDigitsAndPlus(text) {\n var _extractFormattedDigi3 = _extractFormattedDigitsAndPlus(text),\n _extractFormattedDigi4 = _slicedToArray(_extractFormattedDigi3, 2),\n formattedDigits = _extractFormattedDigi4[0],\n hasPlus = _extractFormattedDigi4[1];\n // If the extracted phone number part\n // can possibly be a part of some valid phone number\n // then parse phone number characters from a formatted phone number.\n if (!VALID_FORMATTED_PHONE_NUMBER_DIGITS_PART_PATTERN.test(formattedDigits)) {\n formattedDigits = '';\n }\n return [formattedDigits, hasPlus];\n}\n//# sourceMappingURL=AsYouTypeParser.js.map","function _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\nfunction _unsupportedIterableToArray(r, a) { if (r) { if (\"string\" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return \"Object\" === t && r.constructor && (t = r.constructor.name), \"Map\" === t || \"Set\" === t ? Array.from(r) : \"Arguments\" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }\nfunction _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }\nfunction _iterableToArrayLimit(r, l) { var t = null == r ? null : \"undefined\" != typeof Symbol && r[Symbol.iterator] || r[\"@@iterator\"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t[\"return\"] && (u = t[\"return\"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }\nfunction _arrayWithHoles(r) { if (Array.isArray(r)) return r; }\nfunction _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError(\"Cannot call a class as a function\"); }\nfunction _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, \"value\" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }\nfunction _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, \"prototype\", { writable: !1 }), e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nimport Metadata from './metadata.js';\nimport PhoneNumber from './PhoneNumber.js';\nimport checkNumberLength from './helpers/checkNumberLength.js';\nimport AsYouTypeState from './AsYouTypeState.js';\nimport AsYouTypeFormatter, { DIGIT_PLACEHOLDER } from './AsYouTypeFormatter.js';\nimport AsYouTypeParser, { extractFormattedDigitsAndPlus } from './AsYouTypeParser.js';\nimport getCountryByCallingCode from './helpers/getCountryByCallingCode.js';\nimport getCountryByNationalNumber from './helpers/getCountryByNationalNumber.js';\nimport isObject from './helpers/isObject.js';\nvar USE_NON_GEOGRAPHIC_COUNTRY_CODE = false;\nvar AsYouType = /*#__PURE__*/function () {\n /**\n * @param {(string|object)?} [optionsOrDefaultCountry] - The default country used for parsing non-international phone numbers. Can also be an `options` object.\n * @param {Object} metadata\n */\n function AsYouType(optionsOrDefaultCountry, metadata) {\n _classCallCheck(this, AsYouType);\n // Metadata instance is created once and stays constant.\n // This is required because other utility classes such as `AsYouTypeFormatter`\n // will use this metadata instance \"reference\" and will assume that it stays constant.\n this.metadata = new Metadata(metadata);\n var _this$getCountryAndCa = this.getCountryAndCallingCode(optionsOrDefaultCountry),\n _this$getCountryAndCa2 = _slicedToArray(_this$getCountryAndCa, 2),\n defaultCountry = _this$getCountryAndCa2[0],\n defaultCallingCode = _this$getCountryAndCa2[1];\n // `this.defaultCountry` and `this.defaultCallingCode` aren't required to be in sync.\n // For example, `this.defaultCountry` could be `\"AR\"` and `this.defaultCallingCode` could be `undefined`.\n // So `this.defaultCountry` and `this.defaultCallingCode` are totally independent.\n this.defaultCountry = defaultCountry;\n this.defaultCallingCode = defaultCallingCode;\n this.reset();\n }\n return _createClass(AsYouType, [{\n key: \"getCountryAndCallingCode\",\n value: function getCountryAndCallingCode(optionsOrDefaultCountry) {\n // Set `defaultCountry` and `defaultCallingCode` options.\n var defaultCountry;\n var defaultCallingCode;\n // Turns out `null` also has type \"object\". Weird.\n if (optionsOrDefaultCountry) {\n if (isObject(optionsOrDefaultCountry)) {\n defaultCountry = optionsOrDefaultCountry.defaultCountry;\n defaultCallingCode = optionsOrDefaultCountry.defaultCallingCode;\n } else {\n defaultCountry = optionsOrDefaultCountry;\n }\n }\n if (defaultCountry && !this.metadata.hasCountry(defaultCountry)) {\n defaultCountry = undefined;\n }\n if (defaultCallingCode) {\n /* istanbul ignore if */\n if (USE_NON_GEOGRAPHIC_COUNTRY_CODE) {\n if (this.metadata.isNonGeographicCallingCode(defaultCallingCode)) {\n defaultCountry = '001';\n }\n }\n }\n return [defaultCountry, defaultCallingCode];\n }\n\n /**\n * Inputs \"next\" phone number characters.\n * @param {string} text\n * @return {string} Formatted phone number characters that have been input so far.\n */\n }, {\n key: \"input\",\n value: function input(text) {\n var _this$parser$input = this.parser.input(text, this.state),\n digits = _this$parser$input.digits,\n justLeadingPlus = _this$parser$input.justLeadingPlus;\n if (justLeadingPlus) {\n this.formattedOutput = '+';\n } else if (digits) {\n this.determineTheCountryIfNeeded();\n // Match the available formats by the currently available leading digits.\n if (this.state.nationalSignificantNumber) {\n this.formatter.narrowDownMatchingFormats(this.state);\n }\n var formattedNationalNumber;\n if (this.metadata.hasSelectedNumberingPlan()) {\n formattedNationalNumber = this.formatter.format(digits, this.state);\n }\n if (formattedNationalNumber === undefined) {\n // See if another national (significant) number could be re-extracted.\n if (this.parser.reExtractNationalSignificantNumber(this.state)) {\n this.determineTheCountryIfNeeded();\n // If it could, then re-try formatting the new national (significant) number.\n var nationalDigits = this.state.getNationalDigits();\n if (nationalDigits) {\n formattedNationalNumber = this.formatter.format(nationalDigits, this.state);\n }\n }\n }\n this.formattedOutput = formattedNationalNumber ? this.getFullNumber(formattedNationalNumber) : this.getNonFormattedNumber();\n }\n return this.formattedOutput;\n }\n }, {\n key: \"reset\",\n value: function reset() {\n var _this = this;\n this.state = new AsYouTypeState({\n onCountryChange: function onCountryChange(country) {\n // Before version `1.6.0`, the official `AsYouType` formatter API\n // included a `.country` property on an `AsYouType` instance.\n // Since that property (along with the others) have been moved to\n // `this.state`, `this.country` property is emulated for compatibility\n // with the old versions.\n _this.country = country;\n },\n onCallingCodeChange: function onCallingCodeChange(callingCode, country) {\n _this.metadata.selectNumberingPlan(country || callingCode);\n _this.formatter.reset(_this.metadata.numberingPlan, _this.state);\n _this.parser.reset(_this.metadata.numberingPlan);\n }\n });\n this.formatter = new AsYouTypeFormatter({\n state: this.state,\n metadata: this.metadata\n });\n this.parser = new AsYouTypeParser({\n defaultCountry: this.defaultCountry,\n defaultCallingCode: this.defaultCallingCode,\n metadata: this.metadata,\n state: this.state,\n onNationalSignificantNumberChange: function onNationalSignificantNumberChange() {\n _this.determineTheCountryIfNeeded();\n _this.formatter.reset(_this.metadata.numberingPlan, _this.state);\n }\n });\n this.state.reset({\n country: this.defaultCountry,\n callingCode: this.defaultCallingCode\n });\n this.formattedOutput = '';\n return this;\n }\n\n /**\n * Returns `true` if the phone number is being input in international format.\n * In other words, returns `true` if and only if the parsed phone number starts with a `\"+\"`.\n * @return {boolean}\n */\n }, {\n key: \"isInternational\",\n value: function isInternational() {\n return this.state.international;\n }\n\n /**\n * Returns the \"calling code\" part of the phone number when it's being input\n * in an international format.\n * If no valid calling code has been entered so far, returns `undefined`.\n * @return {string} [callingCode]\n */\n }, {\n key: \"getCallingCode\",\n value: function getCallingCode() {\n // If the number is being input in national format and some \"default calling code\"\n // has been passed to `AsYouType` constructor, then `this.state.callingCode`\n // is equal to that \"default calling code\".\n //\n // If the number is being input in national format and no \"default calling code\"\n // has been passed to `AsYouType` constructor, then returns `undefined`,\n // even if a \"default country\" has been passed to `AsYouType` constructor.\n //\n if (this.isInternational()) {\n return this.state.callingCode;\n }\n }\n\n // A legacy alias.\n }, {\n key: \"getCountryCallingCode\",\n value: function getCountryCallingCode() {\n return this.getCallingCode();\n }\n\n /**\n * Returns a two-letter country code of the phone number.\n * Returns `undefined` for \"non-geographic\" phone numbering plans.\n * Returns `undefined` if no phone number has been input yet.\n * @return {string} [country]\n */\n }, {\n key: \"getCountry\",\n value: function getCountry() {\n var digits = this.state.digits;\n // Return `undefined` if no digits have been input yet.\n if (digits) {\n return this._getCountry();\n }\n }\n\n /**\n * Returns a two-letter country code of the phone number.\n * Returns `undefined` for \"non-geographic\" phone numbering plans.\n * @return {string} [country]\n */\n }, {\n key: \"_getCountry\",\n value: function _getCountry() {\n var country = this.state.country;\n /* istanbul ignore if */\n if (USE_NON_GEOGRAPHIC_COUNTRY_CODE) {\n // `AsYouType.getCountry()` returns `undefined`\n // for \"non-geographic\" phone numbering plans.\n if (country === '001') {\n return;\n }\n }\n return country;\n }\n }, {\n key: \"determineTheCountryIfNeeded\",\n value: function determineTheCountryIfNeeded() {\n // Suppose a user enters a phone number in international format,\n // and there're several countries corresponding to that country calling code,\n // and a country has been derived from the number, and then\n // a user enters one more digit and the number is no longer\n // valid for the derived country, so the country should be re-derived\n // on every new digit in those cases.\n //\n // If the phone number is being input in national format,\n // then it could be a case when `defaultCountry` wasn't specified\n // when creating `AsYouType` instance, and just `defaultCallingCode` was specified,\n // and that \"calling code\" could correspond to a \"non-geographic entity\",\n // or there could be several countries corresponding to that country calling code.\n // In those cases, `this.country` is `undefined` and should be derived\n // from the number. Again, if country calling code is ambiguous, then\n // `this.country` should be re-derived with each new digit.\n //\n if (!this.state.country || this.isCountryCallingCodeAmbiguous()) {\n this.determineTheCountry();\n }\n }\n\n // Prepends `+CountryCode ` in case of an international phone number\n }, {\n key: \"getFullNumber\",\n value: function getFullNumber(formattedNationalNumber) {\n var _this2 = this;\n if (this.isInternational()) {\n var prefix = function prefix(text) {\n return _this2.formatter.getInternationalPrefixBeforeCountryCallingCode(_this2.state, {\n spacing: text ? true : false\n }) + text;\n };\n var callingCode = this.state.callingCode;\n if (!callingCode) {\n return prefix(\"\".concat(this.state.getDigitsWithoutInternationalPrefix()));\n }\n if (!formattedNationalNumber) {\n return prefix(callingCode);\n }\n return prefix(\"\".concat(callingCode, \" \").concat(formattedNationalNumber));\n }\n return formattedNationalNumber;\n }\n }, {\n key: \"getNonFormattedNationalNumberWithPrefix\",\n value: function getNonFormattedNationalNumberWithPrefix() {\n var _this$state = this.state,\n nationalSignificantNumber = _this$state.nationalSignificantNumber,\n prefixBeforeNationalSignificantNumberThatIsNotNationalPrefix = _this$state.prefixBeforeNationalSignificantNumberThatIsNotNationalPrefix,\n nationalPrefix = _this$state.nationalPrefix;\n var number = nationalSignificantNumber;\n var prefix = prefixBeforeNationalSignificantNumberThatIsNotNationalPrefix || nationalPrefix;\n if (prefix) {\n number = prefix + number;\n }\n return number;\n }\n }, {\n key: \"getNonFormattedNumber\",\n value: function getNonFormattedNumber() {\n var nationalSignificantNumberIsModified = this.state.nationalSignificantNumberIsModified;\n return this.getFullNumber(nationalSignificantNumberIsModified ? this.state.getNationalDigits() : this.getNonFormattedNationalNumberWithPrefix());\n }\n }, {\n key: \"getNonFormattedTemplate\",\n value: function getNonFormattedTemplate() {\n var number = this.getNonFormattedNumber();\n if (number) {\n return number.replace(/[\\+\\d]/g, DIGIT_PLACEHOLDER);\n }\n }\n }, {\n key: \"isCountryCallingCodeAmbiguous\",\n value: function isCountryCallingCodeAmbiguous() {\n var callingCode = this.state.callingCode;\n var countryCodes = this.metadata.getCountryCodesForCallingCode(callingCode);\n return countryCodes && countryCodes.length > 1;\n }\n\n // Determines the exact country of the phone number\n // entered so far based on the country phone code\n // and the national phone number.\n }, {\n key: \"determineTheCountry\",\n value: function determineTheCountry() {\n // Get a more precise country code for this national number.\n // It is possible that the precise country couldn't be determined\n // in cases when there're multiple countries sharing the same calling code.\n // In that case, `country` will be `undefined`.\n var country = getCountryByCallingCode(this.isInternational() ? this.state.callingCode : this.defaultCallingCode, {\n nationalNumber: this.state.nationalSignificantNumber,\n metadata: this.metadata\n });\n // If the derived country is indeed more precise,\n // or if no country could be derived for the updated phone number.\n if (country !== this.state.country) {\n // Set (or reset) the more precise country.\n this.state.setCountry(country);\n // If a more precise country could be derived.\n if (country) {\n // Select a more precise telephone numbering plan.\n // For example, consider that `AsYouType` instance was created with `defaultCountry: \"US\"` argument.\n // In that case, the metadata instance will be using \"US\" metadata.\n // But then the user could input a Canadian phone number, in which case\n // the metadata instance should be switched to Canadian telephone numbering plan.\n // It is required to do that because later `canFormatCompleteNumber()` function will be called,\n // and that function relies on the precise country being pre-selected in the metadata instance.\n // Or, for example, `checkNumberLength()` function also relies on same thing.\n this.metadata.selectNumberingPlan(country);\n }\n }\n }\n\n /**\n * Returns a E.164 phone number value for the user's input.\n *\n * For example, for country `\"US\"` and input `\"(222) 333-4444\"`\n * it will return `\"+12223334444\"`.\n *\n * For international phone number input, it will also auto-correct\n * some minor errors such as using a national prefix when writing\n * an international phone number. For example, if the user inputs\n * `\"+44 0 7400 000000\"` then it will return an auto-corrected\n * `\"+447400000000\"` phone number value.\n *\n * Will return `undefined` if no digits have been input,\n * or when inputting a phone number in national format and no\n * default country or default \"country calling code\" have been set.\n *\n * @return {string} [value]\n */\n }, {\n key: \"getNumberValue\",\n value: function getNumberValue() {\n var _this$state2 = this.state,\n digits = _this$state2.digits,\n callingCode = _this$state2.callingCode,\n country = _this$state2.country,\n nationalSignificantNumber = _this$state2.nationalSignificantNumber;\n\n // Will return `undefined` if no digits have been input.\n if (!digits) {\n return;\n }\n if (this.isInternational()) {\n if (callingCode) {\n return '+' + callingCode + nationalSignificantNumber;\n } else {\n return '+' + digits;\n }\n } else {\n if (country || callingCode) {\n var callingCode_ = country ? this.metadata.countryCallingCode() : callingCode;\n return '+' + callingCode_ + nationalSignificantNumber;\n }\n }\n }\n\n /**\n * Returns an instance of `PhoneNumber` class.\n * Will return `undefined` if no national (significant) number\n * digits have been entered so far, or if no `defaultCountry` has been\n * set and the user enters a phone number not in international format.\n */\n }, {\n key: \"getNumber\",\n value: function getNumber() {\n var _this$state3 = this.state,\n nationalSignificantNumber = _this$state3.nationalSignificantNumber,\n carrierCode = _this$state3.carrierCode,\n callingCode = _this$state3.callingCode;\n if (!nationalSignificantNumber) {\n return;\n }\n\n // `this._getCountry()` is basically same as `this.state.country`\n // with the only change that it returns `undefined` in case of a\n // \"non-geographic\" numbering plan instead of `\"001\"` \"internal use\" value.\n var country = this._getCountry();\n\n // Sidenote:\n // `state.callingCode` and `state.country` are somewhat independent from one another\n // and there could be situations when one is defined but the other is not.\n // See the comment in `AsYouTypeState.js` for more info on when that is possible.\n\n if (!country && !callingCode) {\n return;\n }\n\n // By default, if `defaultCountry` parameter was passed when\n // creating `AsYouType` instance, `state.country` is gonna be\n // that `defaultCountry`, which doesn't entirely conform with\n // `parsePhoneNumber()`'s behavior where it attempts to determine\n // the country more precisely in cases when multiple countries\n // could correspond to the same `countryCallingCode`.\n // https://gitlab.com/catamphetamine/libphonenumber-js/-/issues/103#note_1417192969\n //\n // Because `AsYouType.getNumber()` method is supposed to be a 1:1\n // equivalent for `parsePhoneNumber(AsYouType.getNumberValue())`,\n // it means that it should also behave accordingly in such cases of `country` ambiguity.\n // That's how users of this library would expect it to behave anyway.\n //\n // So here it checks if `state.country` is same as the `defaultCountry`,\n // and if it is, it attempts to get rid of any potential ambiguity.\n //\n if (country) {\n if (country === this.defaultCountry) {\n // // Create a `Metadata` instance just to get the calling code of the `country`.\n // const metadata = new Metadata(this.metadata.metadata)\n // // `state.callingCode` and `state.country` are somewhat independent from one another\n // // and there could be situations when one is defined but the other is not.\n // // See the comment in `AsYouTypeState.js` for more info on when that is possible.\n // // Here, it only passes `state.country` because there's no need to pass `state.callingCode`\n // // because `state.country` is known to be defined.\n // metadata.selectNumberingPlan(country)\n // const countryCallingCode = metadata.numberingPlan.callingCode()\n\n // Instead of getting `countryCallingCode` value above,\n // it could simply read it from the existing metadata instance.\n var countryCallingCode = this.metadata.numberingPlan.callingCode();\n\n // Attempt to rule out any potential country code ambiguity, if present.\n var exactCountry = getExactCountryForMultiCountryCallingCode(countryCallingCode, nationalSignificantNumber, this.metadata);\n if (exactCountry) {\n country = exactCountry;\n }\n }\n }\n var phoneNumber = new PhoneNumber(country || callingCode, nationalSignificantNumber, this.metadata.metadata);\n if (carrierCode) {\n phoneNumber.carrierCode = carrierCode;\n }\n // Phone number extensions are not supported by \"As You Type\" formatter.\n return phoneNumber;\n }\n\n /**\n * Returns `true` if the phone number is \"possible\".\n * Is just a shortcut for `PhoneNumber.isPossible()`.\n * @return {boolean}\n */\n }, {\n key: \"isPossible\",\n value: function isPossible() {\n var phoneNumber = this.getNumber();\n if (!phoneNumber) {\n return false;\n }\n return phoneNumber.isPossible();\n }\n\n /**\n * Returns `true` if the phone number is \"valid\".\n * Is just a shortcut for `PhoneNumber.isValid()`.\n * @return {boolean}\n */\n }, {\n key: \"isValid\",\n value: function isValid() {\n var phoneNumber = this.getNumber();\n if (!phoneNumber) {\n return false;\n }\n return phoneNumber.isValid();\n }\n\n /**\n * Checks if the phone number length is valid.\n * If it is, nothing is returned.\n * Otherwise, a rejection reason is returned.\n * @return {string?}\n */\n }, {\n key: \"validateLength\",\n value: function validateLength() {\n var _this$state4 = this.state,\n digits = _this$state4.digits,\n nationalSignificantNumber = _this$state4.nationalSignificantNumber;\n if (!digits) {\n return 'NOT_A_NUMBER';\n }\n if (!this.metadata.numberingPlan) {\n return 'INVALID_COUNTRY';\n }\n if (!nationalSignificantNumber) {\n return 'TOO_SHORT';\n }\n\n // `state.callingCode` and `state.country` are somewhat independent from one another\n // and there could be situations when one is defined but the other is not.\n // See the comment in `AsYouTypeState.js` for more info on when that is possible.\n // Here, it uses both: if `country` is defined then it will use that,\n // otherwise it will use `callingCode`.\n var result = checkNumberLength(nationalSignificantNumber, undefined, this.metadata);\n if (result !== 'IS_POSSIBLE') {\n return result;\n }\n }\n\n /**\n * @deprecated\n * This method is used in `react-phone-number-input/source/input-control.js`\n * in versions before `3.0.16`.\n */\n }, {\n key: \"getNationalNumber\",\n value: function getNationalNumber() {\n return this.state.nationalSignificantNumber;\n }\n\n /**\n * Returns the phone number characters entered by the user.\n * @return {string}\n */\n }, {\n key: \"getChars\",\n value: function getChars() {\n return (this.state.international ? '+' : '') + this.state.digits;\n }\n\n /**\n * Returns the template for the formatted phone number.\n * @return {string}\n */\n }, {\n key: \"getTemplate\",\n value: function getTemplate() {\n return this.formatter.getTemplate(this.state) || this.getNonFormattedTemplate() || '';\n }\n }]);\n}(); // In situations when multiple countries use the same calling code,\n// this function tells what exact country does a given national (significant) number belong to.\nexport { AsYouType as default };\nfunction getExactCountryForMultiCountryCallingCode(callingCode, nationalSignificantNumber, metadata) {\n var ambiguousCountries = metadata.getCountryCodesForCallingCode(callingCode);\n if (ambiguousCountries.length > 1) {\n return getCountryByNationalNumber(nationalSignificantNumber, ambiguousCountries, metadata.metadata);\n }\n}\n//# sourceMappingURL=AsYouType.js.map","function _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, \"value\" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }\nfunction _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, \"prototype\", { writable: !1 }), e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nfunction _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError(\"Cannot call a class as a function\"); }\nfunction _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }\nfunction _possibleConstructorReturn(t, e) { if (e && (\"object\" == _typeof(e) || \"function\" == typeof e)) return e; if (void 0 !== e) throw new TypeError(\"Derived constructors may only return object or undefined\"); return _assertThisInitialized(t); }\nfunction _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); return e; }\nfunction _inherits(t, e) { if (\"function\" != typeof e && null !== e) throw new TypeError(\"Super expression must either be null or a function\"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, \"prototype\", { writable: !1 }), e && _setPrototypeOf(t, e); }\nfunction _wrapNativeSuper(t) { var r = \"function\" == typeof Map ? new Map() : void 0; return _wrapNativeSuper = function _wrapNativeSuper(t) { if (null === t || !_isNativeFunction(t)) return t; if (\"function\" != typeof t) throw new TypeError(\"Super expression must either be null or a function\"); if (void 0 !== r) { if (r.has(t)) return r.get(t); r.set(t, Wrapper); } function Wrapper() { return _construct(t, arguments, _getPrototypeOf(this).constructor); } return Wrapper.prototype = Object.create(t.prototype, { constructor: { value: Wrapper, enumerable: !1, writable: !0, configurable: !0 } }), _setPrototypeOf(Wrapper, t); }, _wrapNativeSuper(t); }\nfunction _construct(t, e, r) { if (_isNativeReflectConstruct()) return Reflect.construct.apply(null, arguments); var o = [null]; o.push.apply(o, e); var p = new (t.bind.apply(t, o))(); return r && _setPrototypeOf(p, r.prototype), p; }\nfunction _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }\nfunction _isNativeFunction(t) { try { return -1 !== Function.toString.call(t).indexOf(\"[native code]\"); } catch (n) { return \"function\" == typeof t; } }\nfunction _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }\nfunction _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); }\n// https://stackoverflow.com/a/46971044/970769\n// \"Breaking changes in Typescript 2.1\"\n// \"Extending built-ins like Error, Array, and Map may no longer work.\"\n// \"As a recommendation, you can manually adjust the prototype immediately after any super(...) calls.\"\n// https://github.com/Microsoft/TypeScript-wiki/blob/main/Breaking-Changes.md#extending-built-ins-like-error-array-and-map-may-no-longer-work\nvar ParseError = /*#__PURE__*/function (_Error) {\n function ParseError(code) {\n var _this;\n _classCallCheck(this, ParseError);\n _this = _callSuper(this, ParseError, [code]);\n // Set the prototype explicitly.\n // Any subclass of FooError will have to manually set the prototype as well.\n Object.setPrototypeOf(_this, ParseError.prototype);\n _this.name = _this.constructor.name;\n return _this;\n }\n _inherits(ParseError, _Error);\n return _createClass(ParseError);\n}(/*#__PURE__*/_wrapNativeSuper(Error));\nexport { ParseError as default };\n//# sourceMappingURL=ParseError.js.map","function _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }\nfunction _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError(\"Cannot call a class as a function\"); }\nfunction _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, \"value\" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }\nfunction _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, \"prototype\", { writable: !1 }), e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nimport Metadata, { validateMetadata } from './metadata.js';\nimport isPossibleNumber from './isPossible.js';\nimport isValidNumber from './isValid.js';\nimport getNumberType from './helpers/getNumberType.js';\nimport getCountryAndCallingCodeFromOneOfThem from './helpers/getCountryAndCallingCodeFromOneOfThem.js';\nimport getPossibleCountriesForNumber from './helpers/getPossibleCountriesForNumber.js';\nimport extractCountryCallingCode from './helpers/extractCountryCallingCode.js';\nimport isObject from './helpers/isObject.js';\nimport formatNumber from './format.js';\nvar USE_NON_GEOGRAPHIC_COUNTRY_CODE = false;\nvar PhoneNumber = /*#__PURE__*/function () {\n /**\n * @param {string} countryOrCountryCallingCode\n * @param {string} nationalNumber\n * @param {object} metadata — Metadata JSON\n * @return {PhoneNumber}\n */\n function PhoneNumber(countryOrCountryCallingCode, nationalNumber, metadata) {\n _classCallCheck(this, PhoneNumber);\n // Validate `countryOrCountryCallingCode` argument.\n if (!countryOrCountryCallingCode) {\n throw new TypeError('First argument is required');\n }\n if (typeof countryOrCountryCallingCode !== 'string') {\n throw new TypeError('First argument must be a string');\n }\n\n // In case of public API use: `constructor(number, metadata)`.\n // Transform the arguments from `constructor(number, metadata)` to\n // `constructor(countryOrCountryCallingCode, nationalNumber, metadata)`.\n if (countryOrCountryCallingCode[0] === '+' && !nationalNumber) {\n throw new TypeError('`metadata` argument not passed');\n }\n if (isObject(nationalNumber) && isObject(nationalNumber.countries)) {\n metadata = nationalNumber;\n var e164Number = countryOrCountryCallingCode;\n if (!E164_NUMBER_REGEXP.test(e164Number)) {\n throw new Error('Invalid `number` argument passed: must consist of a \"+\" followed by digits');\n }\n var _extractCountryCallin = extractCountryCallingCode(e164Number, undefined, undefined, undefined, metadata),\n _countryCallingCode = _extractCountryCallin.countryCallingCode,\n number = _extractCountryCallin.number;\n nationalNumber = number;\n countryOrCountryCallingCode = _countryCallingCode;\n if (!nationalNumber) {\n throw new Error('Invalid `number` argument passed: too short');\n }\n }\n\n // Validate `nationalNumber` argument.\n if (!nationalNumber) {\n throw new TypeError('`nationalNumber` argument is required');\n }\n if (typeof nationalNumber !== 'string') {\n throw new TypeError('`nationalNumber` argument must be a string');\n }\n\n // Validate `metadata` argument.\n validateMetadata(metadata);\n\n // Initialize properties.\n var _getCountryAndCalling = getCountryAndCallingCodeFromOneOfThem(countryOrCountryCallingCode, metadata),\n country = _getCountryAndCalling.country,\n countryCallingCode = _getCountryAndCalling.callingCode;\n this.country = country;\n this.countryCallingCode = countryCallingCode;\n this.nationalNumber = nationalNumber;\n this.number = '+' + this.countryCallingCode + this.nationalNumber;\n // Exclude `metadata` property output from `PhoneNumber.toString()`\n // so that it doesn't clutter the console output of Node.js.\n // Previously, when Node.js did `console.log(new PhoneNumber(...))`,\n // it would output the whole internal structure of the `metadata` object.\n this.getMetadata = function () {\n return metadata;\n };\n }\n return _createClass(PhoneNumber, [{\n key: \"setExt\",\n value: function setExt(ext) {\n this.ext = ext;\n }\n }, {\n key: \"getPossibleCountries\",\n value: function getPossibleCountries() {\n if (this.country) {\n return [this.country];\n }\n return getPossibleCountriesForNumber(this.countryCallingCode, this.nationalNumber, this.getMetadata());\n }\n }, {\n key: \"isPossible\",\n value: function isPossible() {\n return isPossibleNumber(this, {\n v2: true\n }, this.getMetadata());\n }\n }, {\n key: \"isValid\",\n value: function isValid() {\n return isValidNumber(this, {\n v2: true\n }, this.getMetadata());\n }\n }, {\n key: \"isNonGeographic\",\n value: function isNonGeographic() {\n var metadata = new Metadata(this.getMetadata());\n return metadata.isNonGeographicCallingCode(this.countryCallingCode);\n }\n }, {\n key: \"isEqual\",\n value: function isEqual(phoneNumber) {\n return this.number === phoneNumber.number && this.ext === phoneNumber.ext;\n }\n\n // `validateLength()` method was originally meant to be an equivalent for `validatePhoneNumberLength()`.\n //\n // Later, it became apparent that it's not really a true equivalent.\n // The reason is that a `PhoneNumber` instance is not created\n // when the phone number string is too short for it to be considered a valid phone number:\n // * When there must be at least 2 national (significant) number digits: `\"1\"`.\n // * When the country calling code part of an international number is incomplete: `\"+12\"`.\n //\n // So leaving this `validateLength()` method here would suggest a hidden anti-pattern\n // of using it instead of `validatePhoneNumberLength()` while ignoring\n // the \"too short to be even possible\" case from phone number length validation.\n // And ignoring that case wouldn't make any sense in a real-world application\n // because it would still be a valid case that should be handled.\n //\n // Because of that, this method was eventually commented out in order to not introduce\n // that kind of an anti-pattern.\n //\n // validateLength() {\n // \tconst result = checkNumberLength(\n // \t\tthis.nationalNumber,\n // \t\tundefined,\n // \t\tthis.getMetadata()\n // \t)\n // \tif (result !== 'IS_POSSIBLE') {\n // \t\treturn result\n // \t}\n // }\n }, {\n key: \"getType\",\n value: function getType() {\n return getNumberType(this, {\n v2: true\n }, this.getMetadata());\n }\n }, {\n key: \"format\",\n value: function format(_format, options) {\n return formatNumber(this, _format, options ? _objectSpread(_objectSpread({}, options), {}, {\n v2: true\n }) : {\n v2: true\n }, this.getMetadata());\n }\n }, {\n key: \"formatNational\",\n value: function formatNational(options) {\n return this.format('NATIONAL', options);\n }\n }, {\n key: \"formatInternational\",\n value: function formatInternational(options) {\n return this.format('INTERNATIONAL', options);\n }\n }, {\n key: \"getURI\",\n value: function getURI(options) {\n return this.format('RFC3966', options);\n }\n }]);\n}();\nexport { PhoneNumber as default };\nvar E164_NUMBER_REGEXP = /^\\+\\d+$/;\n//# sourceMappingURL=PhoneNumber.js.map","// The minimum length of the national significant number.\nexport var MIN_LENGTH_FOR_NSN = 2;\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// 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// `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// 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 = \"\".concat(DASHES).concat(SLASHES).concat(DOTS).concat(WHITESPACE).concat(BRACKETS).concat(TILDES);\nexport var PLUS_CHARS = \"+\\uFF0B\";\n// const LEADING_PLUS_CHARS_PATTERN = new RegExp('^[' + PLUS_CHARS + ']+')\n//# sourceMappingURL=constants.js.map","// This is a port of Google Android `libphonenumber`'s\n// `phonenumberutil.js` of December 31th, 2018.\n//\n// https://github.com/googlei18n/libphonenumber/commits/master/javascript/i18n/phonenumbers/phonenumberutil.js\n\nimport matchesEntirely from './helpers/matchesEntirely.js';\nimport formatNationalNumberUsingFormat from './helpers/formatNationalNumberUsingFormat.js';\nimport Metadata, { getCountryCallingCode } from './metadata.js';\nimport getIddPrefix from './helpers/getIddPrefix.js';\nimport { formatRFC3966 } from './helpers/RFC3966.js';\nvar DEFAULT_OPTIONS = {\n formatExtension: function formatExtension(formattedNumber, extension, metadata) {\n return \"\".concat(formattedNumber).concat(metadata.ext()).concat(extension);\n }\n};\n\n/**\n * Formats a phone number.\n *\n * format(phoneNumberInstance, 'INTERNATIONAL', { ..., v2: true }, metadata)\n * format(phoneNumberInstance, 'NATIONAL', { ..., v2: true }, metadata)\n *\n * format({ phone: '8005553535', country: 'RU' }, 'INTERNATIONAL', { ... }, metadata)\n * format({ phone: '8005553535', country: 'RU' }, 'NATIONAL', undefined, metadata)\n *\n * @param {object|PhoneNumber} input — If `options.v2: true` flag is passed, the `input` should be a `PhoneNumber` instance. Otherwise, it should be an object of shape `{ phone: '...', country: '...' }`.\n * @param {string} format\n * @param {object} [options]\n * @param {object} metadataJson\n * @return {string}\n */\nexport default function formatNumber(input, format, options, metadataJson) {\n // Apply default options.\n if (options) {\n // Using ES6 \"rest spread\" syntax here didn't work with `babel`/`istanbul`\n // for some weird reason: this line of code would cause the code coverage\n // to show as not 100%. That's because `babel`/`istanbul`, for some weird reason,\n // apparently doesn't know how to properly exclude Babel polyfills from code coverage.\n //\n // options = { ...DEFAULT_OPTIONS, ...options }\n //\n options = merge({}, DEFAULT_OPTIONS, options);\n } else {\n options = DEFAULT_OPTIONS;\n }\n var metadata = new Metadata(metadataJson);\n\n // Normally, the `input` object is supposed to be a `PhoneNumber` class instance.\n // Also, according to the `PhoneNumber` class source code, `country` can't be \"001\".\n // It means that normally `input.country` or `input.countryCallingCode` is supposed\n // to be present because either of the two is always required to exist in a `PhoneNumber` instance.\n // This means that realistically, it's gonna step into either the first `if`\n // or the following `else if`, and normally it won't even reach the legacy-compatibility\n // `else return input.phone || ''` part.\n // So normally, it won't ever return an empty string here.\n if (input.country && input.country !== '001') {\n // Validate `input.country`.\n if (!metadata.hasCountry(input.country)) {\n throw new Error(\"Unknown country: \".concat(input.country));\n }\n metadata.selectNumberingPlan(input.country);\n } else if (input.countryCallingCode) {\n metadata.selectNumberingPlan(input.countryCallingCode);\n } else return input.phone || '';\n var countryCallingCode = metadata.countryCallingCode();\n var nationalNumber = options.v2 ? input.nationalNumber : input.phone;\n\n // This variable should have been declared inside `case`s\n // but Babel has a bug and it says \"duplicate variable declaration\".\n var number;\n switch (format) {\n case 'NATIONAL':\n // Normally, the `input` object is supposed to be a `PhoneNumber` class instance,\n // and a `PhoneNumber` class instance is always required to have a `nationalNumber`.\n // This means that the `if (!nationalNumber)` below is just for legacy-compatibility\n // and it normally can't really happen, so normally it won't ever return an empty string here.\n if (!nationalNumber) {\n return '';\n }\n number = formatNationalNumber(nationalNumber, input.carrierCode, 'NATIONAL', metadata, options);\n return addExtension(number, input.ext, metadata, options.formatExtension);\n case 'INTERNATIONAL':\n // Legacy argument support.\n // (`{ country: ..., phone: '' }`)\n if (!nationalNumber) {\n return \"+\".concat(countryCallingCode);\n }\n number = formatNationalNumber(nationalNumber, null, 'INTERNATIONAL', metadata, options);\n number = \"+\".concat(countryCallingCode, \" \").concat(number);\n return addExtension(number, input.ext, metadata, options.formatExtension);\n case 'E.164':\n // `E.164` doesn't define \"phone number extensions\".\n return \"+\".concat(countryCallingCode).concat(nationalNumber);\n case 'RFC3966':\n return formatRFC3966({\n number: \"+\".concat(countryCallingCode).concat(nationalNumber),\n ext: input.ext\n });\n\n // For reference, here's Google's IDD formatter:\n // https://github.com/google/libphonenumber/blob/32719cf74e68796788d1ca45abc85dcdc63ba5b9/java/libphonenumber/src/com/google/i18n/phonenumbers/PhoneNumberUtil.java#L1546\n // Not saying that this IDD formatter replicates it 1:1, but it seems to work.\n // Who would even need to format phone numbers in IDD format anyway?\n case 'IDD':\n // If the required `fromCountry` parameter is not passed, it will return `undefined`.\n if (!options.fromCountry) {\n return;\n // throw new Error('`fromCountry` option not passed for IDD-prefixed formatting.')\n }\n var formattedNumber = formatIDD(nationalNumber, input.carrierCode, countryCallingCode, options.fromCountry, metadata);\n // If the country of the phone number doesn't support IDD calling, it will return `undefined`.\n if (!formattedNumber) {\n return;\n }\n return addExtension(formattedNumber, input.ext, metadata, options.formatExtension);\n default:\n throw new Error(\"Unknown \\\"format\\\" argument passed to \\\"formatNumber()\\\": \\\"\".concat(format, \"\\\"\"));\n }\n}\nfunction formatNationalNumber(number, carrierCode, formatAs, metadata, options) {\n var format = chooseFormatForNumber(metadata.formats(), number);\n if (!format) {\n return number;\n }\n return formatNationalNumberUsingFormat(number, format, {\n useInternationalFormat: formatAs === 'INTERNATIONAL',\n withNationalPrefix: format.nationalPrefixIsOptionalWhenFormattingInNationalFormat() && options && options.nationalPrefix === false ? false : true,\n carrierCode: carrierCode,\n metadata: metadata\n });\n}\nexport function chooseFormatForNumber(availableFormats, nationalNumber) {\n // Using a `for ... of` loop here didn't work with `babel`/`istanbul`:\n // for some weird reason, it showed code coverage less than 100%.\n // That's because `babel`/`istanbul`, for some weird reason,\n // apparently doesn't know how to properly exclude Babel polyfills from code coverage.\n //\n // for (const format of availableFormats) { ... }\n //\n return pickFirstMatchingElement(availableFormats, function (format) {\n // Validate leading digits.\n // The test case for \"else path\" could be found by searching for\n // \"format.leadingDigitsPatterns().length === 0\".\n if (format.leadingDigitsPatterns().length > 0) {\n // The last leading_digits_pattern is used here, as it is the most detailed\n var lastLeadingDigitsPattern = format.leadingDigitsPatterns()[format.leadingDigitsPatterns().length - 1];\n // If leading digits don't match then move on to the next phone number format\n if (nationalNumber.search(lastLeadingDigitsPattern) !== 0) {\n return false;\n }\n }\n // Check that the national number matches the phone number format regular expression\n return matchesEntirely(nationalNumber, format.pattern());\n });\n}\nfunction addExtension(formattedNumber, ext, metadata, formatExtension) {\n return ext ? formatExtension(formattedNumber, ext, metadata) : formattedNumber;\n}\nfunction formatIDD(nationalNumber, carrierCode, countryCallingCode, fromCountry, metadata) {\n var fromCountryCallingCode = getCountryCallingCode(fromCountry, metadata.metadata);\n // When calling within the same country calling code.\n if (fromCountryCallingCode === countryCallingCode) {\n var formattedNumber = formatNationalNumber(nationalNumber, carrierCode, 'NATIONAL', metadata);\n // For NANPA regions, return the national format for these regions\n // but prefix it with the country calling code.\n if (countryCallingCode === '1') {\n return countryCallingCode + ' ' + formattedNumber;\n }\n // If regions share a country calling code, the country calling code need\n // not be dialled. This also applies when dialling within a region, so this\n // if clause covers both these cases. Technically this is the case for\n // dialling from La Reunion to other overseas departments of France (French\n // Guiana, Martinique, Guadeloupe), but not vice versa - so we don't cover\n // this edge case for now and for those cases return the version including\n // country calling code. Details here:\n // http://www.petitfute.com/voyage/225-info-pratiques-reunion\n //\n return formattedNumber;\n }\n var iddPrefix = getIddPrefix(fromCountry, undefined, metadata.metadata);\n if (iddPrefix) {\n return \"\".concat(iddPrefix, \" \").concat(countryCallingCode, \" \").concat(formatNationalNumber(nationalNumber, null, 'INTERNATIONAL', metadata));\n }\n}\nfunction merge() {\n var i = 1;\n for (var _len = arguments.length, objects = new Array(_len), _key = 0; _key < _len; _key++) {\n objects[_key] = arguments[_key];\n }\n while (i < objects.length) {\n if (objects[i]) {\n for (var key in objects[i]) {\n objects[0][key] = objects[i][key];\n }\n }\n i++;\n }\n return objects[0];\n}\nfunction pickFirstMatchingElement(elements, testFunction) {\n var i = 0;\n while (i < elements.length) {\n if (testFunction(elements[i])) {\n return elements[i];\n }\n i++;\n }\n}\n//# sourceMappingURL=format.js.map"],"names":["_typeof","o","Symbol","iterator","constructor","prototype","_defineProperties","e","r","t","length","enumerable","configurable","writable","Object","defineProperty","_toPropertyKey","key","i","toPrimitive","call","TypeError","String","_toPrimitive","AsYouTypeState","_ref","onCountryChange","onCallingCodeChange","a","n","_classCallCheck","this","value","_ref2","country","callingCode","international","missingPlus","IDDPrefix","undefined","digits","resetNationalSignificantNumber","initCountryAndCallingCode","nationalSignificantNumber","getNationalDigits","nationalSignificantNumberIsModified","nationalPrefix","carrierCode","prefixBeforeNationalSignificantNumberThatIsNotNationalPrefix","properties","_i","_Object$keys","keys","setCountry","setCallingCode","nextDigits","slice","_arrayLikeToArray","Array","DIGIT_PLACEHOLDER","DIGIT_PLACEHOLDER_MATCHER","RegExp","repeat","string","times","result","cutAndStripNonPairedParens","cutBeforeIndex","dangling_braces","push","pop","start","cleared_string","_dangling_braces","index","stripNonPairedParens","formatCompleteNumber","state","format","metadata","shouldTryNationalPrefixFormattingRule","getSeparatorAfterNationalPrefix","concat","pattern","test","formattedNumber","formatNationalNumber","useNationalPrefixFormattingRule","formatNationalNumberWithAndWithoutNationalPrefixFormattingRule","_ref3","formattedNationalNumber","formatNationalNumberUsingFormat","useInternationalFormat","withNationalPrefix","parseDigits","isValidFormattedNationalNumber","PatternParser","context","or","instructions","parsePattern","Error","_this$context$","branches","op","args","expandSingleElementArray","match","OPERATOR","operator","before","rightPart","startContext","getContext","endContext","oneOfSet","parseOneOfSet","ILLEGAL_CHARACTER_REGEXP","split","values","prevValue","charCodeAt","nextValue","fromCharCode","array","next","bind","isArray","toString","name","from","done","PatternMatcher","matchTree","parse","allowOverflow","arguments","_match","matchedChars","overflow","characters","tree","last","characterString","join","indexOf","partialMatch","restCharacters","JSON","stringify","_step","_iterator","_result","_step2","_iterator2","_char","LONGEST_DUMMY_PHONE_NUMBER","NATIONAL_PREFIX_SEPARATORS_PATTERN","NON_ALTERING_FORMAT_REG_EXP","AsYouTypeFormatter","resetFormat","chosenFormat","template","nationalNumberTemplate","populatedNationalNumberTemplate","populatedNationalNumberTemplatePosition","numberingPlan","isNANP","matchingFormats","formats","narrowDownMatchingFormats","_this","checkNumberLength","_format","formattedCompleteNumber","setNationalNumberTemplate","replace","lastIndexOf","formatNationalNumberWithNextDigits","previouslyChosenFormat","newlyChosenFormat","chooseFormat","formatNextNationalNumberDigits","_this2","leadingDigits","leadingDigitsPatternIndex","filter","formatSuits","formatMatches","usesNationalPrefix","nationalPrefixIsOptionalWhenFormattingInNationalFormat","nationalPrefixIsMandatoryWhenFormattingInNationalFormat","leadingDigitsPatternsCount","leadingDigitsPatterns","Math","min","leadingDigitsPattern","error","console","internationalFormat","_this3","_loop","getFormatFormat","createTemplateForFormat","_","getTemplateForFormat","nationalPrefixFormattingRule","options","spacing","internationalPrefix","getInternationalPrefixBeforeCountryCallingCode","getDigitsWithoutInternationalPrefix","_ref4","strictPattern","nationalNumberDummyDigits","nationalPrefixIncludedInTemplate","numberFormat","numberFormatWithNationalPrefix","applyInternationalSeparatorStyle","position","_unsupportedIterableToArray","_createForOfIteratorHelperLoose","digit","search","populateTemplateWithDigits","_ref5","_slicedToArray","_arrayWithHoles","l","u","f","_iterableToArrayLimit","_nonIterableRest","VALID_FORMATTED_PHONE_NUMBER_DIGITS_PART","VALID_FORMATTED_PHONE_NUMBER_DIGITS_PART_PATTERN","VALID_FORMATTED_PHONE_NUMBER_PART","AFTER_PHONE_NUMBER_DIGITS_END_PATTERN","COMPLEX_NATIONAL_PREFIX","AsYouTypeParser","defaultCountry","defaultCallingCode","onNationalSignificantNumberChange","text","justLeadingPlus","_extractFormattedDigi","_extractFormattedDigi3","extractedNumber","hasPlus","startsAt","extractFormattedPhoneNumber","_extractFormattedDigitsAndPlus","_extractFormattedDigi4","formattedDigits","extractFormattedDigitsAndPlus","_extractFormattedDigi2","startInternationalNumber","inputDigits","hasReceivedThreeLeadingDigits","appendDigits","extractIddPrefix","isWaitingForCountryCallingCode","extractCountryCallingCode","appendNationalSignificantNumberDigits","hasExtractedNationalSignificantNumber","extractNationalSignificantNumber","stateUpdate","update","_extractCountryCallin","countryCallingCode","number","hasSelectedNumberingPlan","nationalPrefixForParsing","_nationalPrefixForParsing","couldPossiblyExtractAnotherNationalSignificantNumber","nationalDigits","setState","_extractNationalNumbe","extractNationalNumberFromPossiblyIncompleteNumber","nationalNumber","onExtractedNationalNumber","prevNationalSignificantNumber","_extractNationalNumbe2","nationalSignificantNumberIndex","prefixBeforeNationalNumber","extractAnotherNationalSignificantNumber","fixMissingPlus","extractCallingCodeAndNationalSignificantNumber","numberWithoutIDD","stripIddPrefix","newCallingCode","extractCountryCallingCodeFromInternationalNumberWithoutPlusSign","AsYouType","optionsOrDefaultCountry","_this$getCountryAndCa2","getCountryAndCallingCode","reset","isObject","hasCountry","_this$parser$input","parser","input","formattedOutput","determineTheCountryIfNeeded","formatter","reExtractNationalSignificantNumber","getFullNumber","getNonFormattedNumber","selectNumberingPlan","isInternational","getCallingCode","_getCountry","isCountryCallingCodeAmbiguous","determineTheCountry","_this$state","prefix","getNonFormattedNationalNumberWithPrefix","countryCodes","getCountryCodesForCallingCode","getCountryByCallingCode","_this$state2","_this$state3","exactCountry","ambiguousCountries","getCountryByNationalNumber","getExactCountryForMultiCountryCallingCode","phoneNumber","PhoneNumber","getNumber","isPossible","isValid","_this$state4","getTemplate","getNonFormattedTemplate","_wrapNativeSuper","Map","Function","_isNativeFunction","has","get","set","Wrapper","_isNativeReflectConstruct","Reflect","construct","apply","p","_setPrototypeOf","_construct","_getPrototypeOf","create","Boolean","valueOf","setPrototypeOf","__proto__","getPrototypeOf","ParseError","_Error","code","ReferenceError","_assertThisInitialized","_possibleConstructorReturn","_callSuper","_inherits","ownKeys","getOwnPropertySymbols","getOwnPropertyDescriptor","_objectSpread","forEach","_defineProperty","getOwnPropertyDescriptors","defineProperties","countryOrCountryCallingCode","countries","e164Number","E164_NUMBER_REGEXP","_getCountryAndCalling","getMetadata","ext","v2","isNonGeographicCallingCode","MIN_LENGTH_FOR_NSN","MAX_LENGTH_FOR_NSN","MAX_LENGTH_COUNTRY_CODE","VALID_DIGITS","VALID_PUNCTUATION","PLUS_CHARS","DEFAULT_OPTIONS","formatExtension","extension","formatNumber","metadataJson","_len","objects","_key","merge","phone","addExtension","fromCountry","iddPrefix","formatIDD","formatAs","availableFormats","elements","testFunction","pickFirstMatchingElement","lastLeadingDigitsPattern"],"sourceRoot":""}