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,EACnE,GAAG,CAAC2wB,EAAa5c,EAAOxM,EAAQvH,EAAUggB,IAE1C,OAAOuB,EAAAA,cAAoB1C,EAAgB9f,EAAS,CAAC,EAAGmB,EAAM,CAC5D2T,IAAKgd,EACLl0B,MAAO4K,EAAOypB,EAAar0B,GAAS,GAAKA,GAAOyG,KAChD4c,UAAW8Q,EACX9wB,SAAUkU,IAEd,EAEAJ,EAAQyN,EAAAA,WAAiBzN,IACnB9S,UAAY,CAEhB+S,MAAOkd,IAAAA,KAAe9vB,WAEtBoG,OAAQ0pB,IAAAA,KAAe9vB,WAEvB8S,eAAgBgd,IAAAA,YAAsB9vB,WAEtC8d,KAAMgS,IAAAA,OAAiB9vB,WAEvBxE,MAAOs0B,IAAAA,OAEPjxB,SAAUixB,IAAAA,KAAe9vB,WAEzB6e,UAAWiR,IAAAA,KACXC,MAAOD,IAAAA,KACPE,QAASF,IAAAA,MAEXnd,EAAMlR,aAAe,CAEnBqR,eAAgB,QAEhBgL,KAAM,QAER,QAEA,SAAS+R,EAAar0B,GACpB,OAAOA,OACT,C,oFC1DA,GAJAy0B,E,QAAAA,IAAQ,SAAmB5b,EAAG6b,GAC5B,OAAY,MAALA,GAAaA,GAAMA,EAAI7b,EAAI6b,CACpC,I,WCAA,GAJAC,EAAAA,EAAAA,IAAQ,SAAgB9b,EAAGoD,EAAGvb,GAC5B,OAAOk0B,EAAU/b,GAAGgc,EAAAA,EAAAA,GAAK5Y,EAAGvb,GAC9B,G","sources":["webpack://@pb/react/./node_modules/@pb/components/node_modules/core-js/internals/array-from.js","webpack://@pb/react/./node_modules/@pb/components/node_modules/core-js/internals/call-with-safe-iteration-closing.js","webpack://@pb/react/./node_modules/@pb/components/node_modules/react-phone-number-input/commonjs/CountrySelect.js","webpack://@pb/react/./node_modules/@pb/components/node_modules/libphonenumber-js/es6/isValidPhoneNumber.js","webpack://@pb/react/./node_modules/@pb/components/node_modules/libphonenumber-js/es6/isPossiblePhoneNumber.js","webpack://@pb/react/./node_modules/@pb/components/node_modules/react-phone-number-input/modules/PropTypes.js","webpack://@pb/react/./node_modules/@pb/components/node_modules/libphonenumber-js/es6/AsYouTypeState.js","webpack://@pb/react/./node_modules/@pb/components/node_modules/libphonenumber-js/es6/AsYouTypeFormatter.util.js","webpack://@pb/react/./node_modules/@pb/components/node_modules/libphonenumber-js/es6/AsYouTypeFormatter.complete.js","webpack://@pb/react/./node_modules/@pb/components/node_modules/libphonenumber-js/es6/AsYouTypeFormatter.js","webpack://@pb/react/./node_modules/@pb/components/node_modules/libphonenumber-js/es6/AsYouTypeParser.js","webpack://@pb/react/./node_modules/@pb/components/node_modules/libphonenumber-js/es6/AsYouType.js","webpack://@pb/react/./node_modules/@pb/components/node_modules/react-phone-number-input/modules/helpers/inputValuePrefix.js","webpack://@pb/react/./node_modules/@pb/components/node_modules/react-phone-number-input/modules/InputSmart.js","webpack://@pb/react/./node_modules/@pb/components/node_modules/react-phone-number-input/modules/InputBasic.js","webpack://@pb/react/./node_modules/@pb/components/node_modules/libphonenumber-js/es6/formatIncompletePhoneNumber.js","webpack://@pb/react/./node_modules/@pb/components/node_modules/react-phone-number-input/modules/Flag.js","webpack://@pb/react/./node_modules/@pb/components/node_modules/react-phone-number-input/modules/InternationalIcon.js","webpack://@pb/react/./node_modules/@pb/components/node_modules/react-phone-number-input/modules/helpers/countries.js","webpack://@pb/react/./node_modules/@pb/components/node_modules/libphonenumber-js/es6/getCountries.js","webpack://@pb/react/./node_modules/@pb/components/node_modules/react-phone-number-input/modules/CountryIcon.js","webpack://@pb/react/./node_modules/@pb/components/node_modules/react-phone-number-input/modules/helpers/getInternationalPhoneNumberPrefix.js","webpack://@pb/react/./node_modules/@pb/components/node_modules/react-phone-number-input/modules/helpers/phoneInputHelpers.js","webpack://@pb/react/./node_modules/@pb/components/node_modules/react-phone-number-input/modules/helpers/getPhoneInputWithCountryStateUpdateFromNewProps.js","webpack://@pb/react/./node_modules/@pb/components/node_modules/react-phone-number-input/modules/PhoneInputWithCountry.js","webpack://@pb/react/./node_modules/@pb/components/node_modules/react-phone-number-input/modules/CountrySelect.js","webpack://@pb/react/./node_modules/@pb/components/node_modules/react-phone-number-input/modules/PhoneInputWithCountryDefault.js","webpack://@pb/react/./node_modules/@pb/components/node_modules/react-phone-number-input/min/index.js","webpack://@pb/react/./node_modules/@pb/components/dist/esm/ui/Fields/PhoneNumberInput/PhoneNumberInput.module.scss","webpack://@pb/react/./node_modules/@pb/components/dist/esm/ui/Fields/PhoneNumberInput/PhoneNumberInput.module.scss?5567","webpack://@pb/react/./node_modules/@pb/components/dist/esm/ui/Fields/PhoneNumberInput/PhoneNumberInput.js","webpack://@pb/react/./node_modules/@pb/components/dist/esm/ui/Icon/HmIcons/CrossIcon.js","webpack://@pb/react/./node_modules/@pb/components/node_modules/libphonenumber-js/es6/helpers/getIddPrefix.js","webpack://@pb/react/./node_modules/@pb/components/node_modules/libphonenumber-js/es6/format_.js","webpack://@pb/react/./node_modules/@pb/components/node_modules/libphonenumber-js/es6/PhoneNumber.js","webpack://@pb/react/./node_modules/@pb/components/node_modules/libphonenumber-js/es6/validate_.js","webpack://@pb/react/./node_modules/@pb/components/node_modules/libphonenumber-js/es6/constants.js","webpack://@pb/react/./node_modules/@pb/components/node_modules/libphonenumber-js/es6/helpers/RFC3966.js","webpack://@pb/react/./node_modules/@pb/components/node_modules/libphonenumber-js/es6/helpers/applyInternationalSeparatorStyle.js","webpack://@pb/react/./node_modules/@pb/components/node_modules/libphonenumber-js/es6/helpers/checkNumberLength.js","webpack://@pb/react/./node_modules/@pb/components/node_modules/libphonenumber-js/es6/helpers/mergeArrays.js","webpack://@pb/react/./node_modules/@pb/components/node_modules/libphonenumber-js/es6/helpers/extension/createExtensionPattern.js","webpack://@pb/react/./node_modules/@pb/components/node_modules/libphonenumber-js/es6/helpers/extractCountryCallingCode.js","webpack://@pb/react/./node_modules/@pb/components/node_modules/libphonenumber-js/es6/helpers/extractCountryCallingCodeFromInternationalNumberWithoutPlusSign.js","webpack://@pb/react/./node_modules/@pb/components/node_modules/libphonenumber-js/es6/helpers/extractNationalNumber.js","webpack://@pb/react/./node_modules/@pb/components/node_modules/libphonenumber-js/es6/helpers/extractNationalNumberFromPossiblyIncompleteNumber.js","webpack://@pb/react/./node_modules/@pb/components/node_modules/libphonenumber-js/es6/helpers/formatNationalNumberUsingFormat.js","webpack://@pb/react/./node_modules/@pb/components/node_modules/libphonenumber-js/es6/helpers/getCountryByCallingCode.js","webpack://@pb/react/./node_modules/@pb/components/node_modules/libphonenumber-js/es6/helpers/getNumberType.js","webpack://@pb/react/./node_modules/@pb/components/node_modules/libphonenumber-js/es6/helpers/isViablePhoneNumber.js","webpack://@pb/react/./node_modules/@pb/components/node_modules/libphonenumber-js/es6/helpers/matchesEntirely.js","webpack://@pb/react/./node_modules/@pb/components/node_modules/libphonenumber-js/es6/helpers/parseDigits.js","webpack://@pb/react/./node_modules/@pb/components/node_modules/libphonenumber-js/es6/helpers/stripIddPrefix.js","webpack://@pb/react/./node_modules/@pb/components/node_modules/libphonenumber-js/es6/isPossibleNumber_.js","webpack://@pb/react/./node_modules/@pb/components/node_modules/libphonenumber-js/es6/tools/semver-compare.js","webpack://@pb/react/./node_modules/@pb/components/node_modules/libphonenumber-js/es6/metadata.js","webpack://@pb/react/./node_modules/@pb/components/node_modules/libphonenumber-js/es6/parseIncompletePhoneNumber.js","webpack://@pb/react/./node_modules/@pb/components/node_modules/libphonenumber-js/es6/parsePhoneNumber.js","webpack://@pb/react/./node_modules/@pb/components/node_modules/libphonenumber-js/es6/parsePhoneNumberFromString.js","webpack://@pb/react/./node_modules/@pb/components/node_modules/libphonenumber-js/es6/ParseError.js","webpack://@pb/react/./node_modules/@pb/components/node_modules/libphonenumber-js/es6/helpers/extension/extractExtension.js","webpack://@pb/react/./node_modules/@pb/components/node_modules/libphonenumber-js/es6/parse_.js","webpack://@pb/react/./node_modules/@pb/components/node_modules/libphonenumber-js/es6/parsePhoneNumber_.js","webpack://@pb/react/./node_modules/@pb/components/node_modules/libphonenumber-js/es6/parsePhoneNumberFromString_.js","webpack://@pb/react/./node_modules/country-flag-icons/modules/unicode.js","webpack://@pb/react/./node_modules/input-format/modules/helpers.js","webpack://@pb/react/./node_modules/input-format/modules/dom.js","webpack://@pb/react/./node_modules/input-format/modules/inputControl.js","webpack://@pb/react/./node_modules/input-format/modules/parse.js","webpack://@pb/react/./node_modules/input-format/modules/edit.js","webpack://@pb/react/./node_modules/input-format/modules/format.js","webpack://@pb/react/./node_modules/input-format/modules/templateFormatter.js","webpack://@pb/react/./node_modules/input-format/modules/closeBraces.js","webpack://@pb/react/./node_modules/input-format/modules/react/Input.js","webpack://@pb/react/./node_modules/ramda/es/defaultTo.js","webpack://@pb/react/./node_modules/ramda/es/pathOr.js"],"sourcesContent":["'use strict';\nvar global = require('../internals/global');\nvar bind = require('../internals/function-bind-context');\nvar call = require('../internals/function-call');\nvar toObject = require('../internals/to-object');\nvar callWithSafeIterationClosing = require('../internals/call-with-safe-iteration-closing');\nvar isArrayIteratorMethod = require('../internals/is-array-iterator-method');\nvar isConstructor = require('../internals/is-constructor');\nvar lengthOfArrayLike = require('../internals/length-of-array-like');\nvar createProperty = require('../internals/create-property');\nvar getIterator = require('../internals/get-iterator');\nvar getIteratorMethod = require('../internals/get-iterator-method');\n\nvar Array = global.Array;\n\n// `Array.from` method implementation\n// https://tc39.es/ecma262/#sec-array.from\nmodule.exports = function from(arrayLike /* , mapfn = undefined, thisArg = undefined */) {\n var O = toObject(arrayLike);\n var IS_CONSTRUCTOR = isConstructor(this);\n var argumentsLength = arguments.length;\n var mapfn = argumentsLength > 1 ? arguments[1] : undefined;\n var mapping = mapfn !== undefined;\n if (mapping) mapfn = bind(mapfn, argumentsLength > 2 ? arguments[2] : undefined);\n var iteratorMethod = getIteratorMethod(O);\n var index = 0;\n var length, result, step, iterator, next, value;\n // if the target is not iterable or it's an array with the default iterator - use a simple case\n if (iteratorMethod && !(this == Array && isArrayIteratorMethod(iteratorMethod))) {\n iterator = getIterator(O, iteratorMethod);\n next = iterator.next;\n result = IS_CONSTRUCTOR ? new this() : [];\n for (;!(step = call(next, iterator)).done; index++) {\n value = mapping ? callWithSafeIterationClosing(iterator, mapfn, [step.value, index], true) : step.value;\n createProperty(result, index, value);\n }\n } else {\n length = lengthOfArrayLike(O);\n result = IS_CONSTRUCTOR ? new this(length) : Array(length);\n for (;length > index; index++) {\n value = mapping ? mapfn(O[index], index) : O[index];\n createProperty(result, index, value);\n }\n }\n result.length = index;\n return result;\n};\n","var anObject = require('../internals/an-object');\nvar iteratorClose = require('../internals/iterator-close');\n\n// call something on iterator step with safe closing on error\nmodule.exports = function (iterator, fn, value, ENTRIES) {\n try {\n return ENTRIES ? fn(anObject(value)[0], value[1]) : fn(value);\n } catch (error) {\n iteratorClose(iterator, 'throw', error);\n }\n};\n","\"use strict\";\n\nfunction _typeof(obj) { if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports[\"default\"] = CountrySelect;\nexports.CountrySelectWithIcon = CountrySelectWithIcon;\n\nvar _react = _interopRequireWildcard(require(\"react\"));\n\nvar _propTypes = _interopRequireDefault(require(\"prop-types\"));\n\nvar _classnames = _interopRequireDefault(require(\"classnames\"));\n\nvar _unicode = _interopRequireDefault(require(\"country-flag-icons/unicode\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { \"default\": obj }; }\n\nfunction _getRequireWildcardCache() { if (typeof WeakMap !== \"function\") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== \"object\" && typeof obj !== \"function\") { return { \"default\": obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj[\"default\"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }\n\nfunction _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\n\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\n\nfunction CountrySelect(_ref) {\n var value = _ref.value,\n onChange = _ref.onChange,\n options = _ref.options,\n rest = _objectWithoutProperties(_ref, [\"value\", \"onChange\", \"options\"]);\n\n var onChange_ = (0, _react.useCallback)(function (event) {\n var value = event.target.value;\n onChange(value === 'ZZ' ? undefined : value);\n }, [onChange]);\n var selectedOption = (0, _react.useMemo)(function () {\n return getSelectedOption(options, value);\n }, [options, value]); // \"ZZ\" means \"International\".\n // (HTML requires each `` have some string `value`).\n\n return _react[\"default\"].createElement(\"select\", _extends({}, rest, {\n value: value || 'ZZ',\n onChange: onChange_\n }), options.map(function (_ref2) {\n var value = _ref2.value,\n label = _ref2.label,\n divider = _ref2.divider;\n return _react[\"default\"].createElement(\"option\", {\n key: divider ? '|' : value || 'ZZ',\n value: divider ? '|' : value || 'ZZ',\n disabled: divider ? true : false,\n style: divider ? DIVIDER_STYLE : undefined\n }, label);\n }));\n}\n\nCountrySelect.propTypes = {\n /**\r\n * A two-letter country code.\r\n * Example: \"US\", \"RU\", etc.\r\n */\n value: _propTypes[\"default\"].string,\n\n /**\r\n * Updates the `value`.\r\n */\n onChange: _propTypes[\"default\"].func.isRequired,\n // `` options.\n options: _propTypes[\"default\"].arrayOf(_propTypes[\"default\"].shape({\n value: _propTypes[\"default\"].string,\n label: _propTypes[\"default\"].string,\n divider: _propTypes[\"default\"].bool\n })).isRequired\n};\nvar DIVIDER_STYLE = {\n fontSize: '1px',\n backgroundColor: 'currentColor',\n color: 'inherit'\n};\n\nfunction CountrySelectWithIcon(_ref3) {\n var value = _ref3.value,\n options = _ref3.options,\n className = _ref3.className,\n Icon = _ref3.iconComponent,\n getIconAspectRatio = _ref3.getIconAspectRatio,\n Arrow = _ref3.arrowComponent,\n unicodeFlags = _ref3.unicodeFlags,\n rest = _objectWithoutProperties(_ref3, [\"value\", \"options\", \"className\", \"iconComponent\", \"getIconAspectRatio\", \"arrowComponent\", \"unicodeFlags\"]);\n\n var selectedOption = (0, _react.useMemo)(function () {\n return getSelectedOption(options, value);\n }, [options, value]);\n return _react[\"default\"].createElement(\"div\", {\n className: \"PhoneInputCountry\"\n }, _react[\"default\"].createElement(CountrySelect, _extends({}, rest, {\n value: value,\n options: options,\n className: (0, _classnames[\"default\"])('PhoneInputCountrySelect', className)\n })), unicodeFlags && value && _react[\"default\"].createElement(\"div\", {\n className: \"PhoneInputCountryIconUnicode\"\n }, (0, _unicode[\"default\"])(value)), !(unicodeFlags && value) && _react[\"default\"].createElement(Icon, {\n country: value,\n label: selectedOption && selectedOption.label,\n aspectRatio: unicodeFlags ? 1 : undefined\n }), _react[\"default\"].createElement(Arrow, null));\n}\n\nCountrySelectWithIcon.propTypes = {\n // Country flag component.\n iconComponent: _propTypes[\"default\"].elementType,\n // Select arrow component.\n arrowComponent: _propTypes[\"default\"].elementType.isRequired,\n // Set to `true` to render Unicode flag icons instead of SVG images.\n unicodeFlags: _propTypes[\"default\"].bool\n};\nCountrySelectWithIcon.defaultProps = {\n // Is \"International\" icon square?\n arrowComponent: function arrowComponent() {\n return _react[\"default\"].createElement(\"div\", {\n className: \"PhoneInputCountrySelectArrow\"\n });\n }\n};\n\nfunction getSelectedOption(options, value) {\n for (var _iterator = options, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {\n var _ref4;\n\n if (_isArray) {\n if (_i >= _iterator.length) break;\n _ref4 = _iterator[_i++];\n } else {\n _i = _iterator.next();\n if (_i.done) break;\n _ref4 = _i.value;\n }\n\n var option = _ref4;\n\n if (!option.divider && option.value === value) {\n return option;\n }\n }\n}\n//# sourceMappingURL=CountrySelect.js.map","function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty(target, key, source[key]); }); } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nimport { normalizeArguments } from './parsePhoneNumber';\nimport parsePhoneNumberFromString from './parsePhoneNumberFromString_';\nexport default function isValidPhoneNumber() {\n var _normalizeArguments = normalizeArguments(arguments),\n text = _normalizeArguments.text,\n options = _normalizeArguments.options,\n metadata = _normalizeArguments.metadata;\n\n options = _objectSpread({}, options, {\n extract: false\n });\n var phoneNumber = parsePhoneNumberFromString(text, options, metadata);\n return phoneNumber && phoneNumber.isValid() || false;\n}\n//# sourceMappingURL=isValidPhoneNumber.js.map","function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty(target, key, source[key]); }); } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nimport { normalizeArguments } from './parsePhoneNumber';\nimport parsePhoneNumberFromString from './parsePhoneNumberFromString_';\nexport default function isPossiblePhoneNumber() {\n var _normalizeArguments = normalizeArguments(arguments),\n text = _normalizeArguments.text,\n options = _normalizeArguments.options,\n metadata = _normalizeArguments.metadata;\n\n options = _objectSpread({}, options, {\n extract: false\n });\n var phoneNumber = parsePhoneNumberFromString(text, options, metadata);\n return phoneNumber && phoneNumber.isPossible() || false;\n}\n//# sourceMappingURL=isPossiblePhoneNumber.js.map","import PropTypes from 'prop-types';\nexport var metadata = PropTypes.shape({\n country_calling_codes: PropTypes.object.isRequired,\n countries: PropTypes.object.isRequired\n});\nexport var labels = PropTypes.objectOf(PropTypes.string);\n//# sourceMappingURL=PropTypes.js.map","function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nvar AsYouTypeState =\n/*#__PURE__*/\nfunction () {\n function AsYouTypeState(_ref) {\n var _this = this;\n\n var onCountryChange = _ref.onCountryChange,\n onCallingCodeChange = _ref.onCallingCodeChange;\n\n _classCallCheck(this, AsYouTypeState);\n\n _defineProperty(this, \"update\", function (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 this.onCountryChange = onCountryChange;\n this.onCallingCodeChange = onCallingCodeChange;\n }\n\n _createClass(AsYouTypeState, [{\n key: \"reset\",\n value: function reset(defaultCountry, defaultCallingCode) {\n this.international = false;\n this.IDDPrefix = undefined;\n this.missingPlus = undefined;\n this.callingCode = undefined;\n this.digits = '';\n this.resetNationalSignificantNumber();\n this.initCountryAndCallingCode(defaultCountry, defaultCallingCode);\n }\n }, {\n key: \"resetNationalSignificantNumber\",\n value: function resetNationalSignificantNumber() {\n this.nationalSignificantNumber = this.getNationalDigits();\n this.nationalSignificantNumberMatchesInput = true;\n this.nationalPrefix = undefined;\n this.carrierCode = undefined;\n this.complexPrefixBeforeNationalSignificantNumber = undefined;\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 return this.onCallingCodeChange(this.country, callingCode);\n }\n }, {\n key: \"startInternationalNumber\",\n value: function startInternationalNumber() {\n // Prepend the `+` to parsed input.\n this.international = true; // If a default country was set then reset it\n // because an explicitly international phone\n // number is being entered.\n\n this.initCountryAndCallingCode();\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 /**\r\n * Returns the part of `this.digits` that corresponds to the national number.\r\n * Basically, all digits that have been input by the user, except for the\r\n * international prefix and the country calling code part\r\n * (if the number is an international one).\r\n * @return {string}\r\n */\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\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\n return this.digits;\n }\n }]);\n\n return AsYouTypeState;\n}();\n\nexport { AsYouTypeState as default };\n//# sourceMappingURL=AsYouTypeState.js.map","// Should be the same as `DIGIT_PLACEHOLDER` in `libphonenumber-metadata-generator`.\nexport var DIGIT_PLACEHOLDER = 'x'; // '\\u2008' (punctuation space)\n\nvar DIGIT_PLACEHOLDER_MATCHER = new RegExp(DIGIT_PLACEHOLDER); // Counts all occurences of a symbol in a string.\n// Unicode-unsafe (because using `.split()`).\n\nexport function countOccurences(symbol, string) {\n var count = 0; // 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\n for (var _iterator = string.split(''), _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {\n var _ref;\n\n if (_isArray) {\n if (_i >= _iterator.length) break;\n _ref = _iterator[_i++];\n } else {\n _i = _iterator.next();\n if (_i.done) break;\n _ref = _i.value;\n }\n\n var character = _ref;\n\n if (character === symbol) {\n count++;\n }\n }\n\n return count;\n} // Repeats a string (or a symbol) N times.\n// http://stackoverflow.com/questions/202605/repeat-string-javascript\n\nexport function repeat(string, times) {\n if (times < 1) {\n return '';\n }\n\n var result = '';\n\n while (times > 1) {\n if (times & 1) {\n result += string;\n }\n\n times >>= 1;\n string += string;\n }\n\n return result + string;\n}\nexport function cutAndStripNonPairedParens(string, cutBeforeIndex) {\n if (string[cutBeforeIndex] === ')') {\n cutBeforeIndex++;\n }\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\n while (dangling_braces > 0 && cut_before < template.length) {\n if (template[cut_before] === ')') {\n dangling_braces--;\n }\n\n cut_before++;\n }\n\n return template.slice(0, cut_before);\n}\nexport function stripNonPairedParens(string) {\n var dangling_braces = [];\n var i = 0;\n\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\n i++;\n }\n\n var start = 0;\n var cleared_string = '';\n dangling_braces.push(string.length);\n\n for (var _i2 = 0, _dangling_braces = dangling_braces; _i2 < _dangling_braces.length; _i2++) {\n var index = _dangling_braces[_i2];\n cleared_string += string.slice(start, index);\n start = index + 1;\n }\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 = digits.split(''), _isArray2 = Array.isArray(_iterator2), _i3 = 0, _iterator2 = _isArray2 ? _iterator2 : _iterator2[Symbol.iterator]();;) {\n var _ref2;\n\n if (_isArray2) {\n if (_i3 >= _iterator2.length) break;\n _ref2 = _iterator2[_i3++];\n } else {\n _i3 = _iterator2.next();\n if (_i3.done) break;\n _ref2 = _i3.value;\n }\n\n var digit = _ref2;\n\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\n position = template.search(DIGIT_PLACEHOLDER_MATCHER);\n template = template.replace(DIGIT_PLACEHOLDER_MATCHER, digit);\n }\n\n return [template, position];\n}\n//# sourceMappingURL=AsYouTypeFormatter.util.js.map","import checkNumberLength from './helpers/checkNumberLength';\nimport parseDigits from './helpers/parseDigits';\nimport formatNationalNumberUsingFormat from './helpers/formatNationalNumberUsingFormat';\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\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, metadata) === 'IS_POSSIBLE';\n}\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 var nationalSignificantNumber = state.nationalSignificantNumber,\n international = state.international,\n nationalPrefix = state.nationalPrefix,\n carrierCode = state.carrierCode; // 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\n if (shouldTryNationalPrefixFormattingRule(format)) {\n var formattedNumber = formatNationalNumber(state, format, {\n useNationalPrefixFormattingRule: true,\n getSeparatorAfterNationalPrefix: getSeparatorAfterNationalPrefix,\n metadata: metadata\n });\n\n if (formattedNumber) {\n return formattedNumber;\n }\n } // Format the number without using `national_prefix_formatting_rule`.\n\n\n return formatNationalNumber(state, format, {\n useNationalPrefixFormattingRule: false,\n getSeparatorAfterNationalPrefix: getSeparatorAfterNationalPrefix,\n metadata: metadata\n });\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\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.complexPrefixBeforeNationalSignificantNumber) {\n formattedNationalNumber = state.complexPrefixBeforeNationalSignificantNumber + ' ' + formattedNationalNumber;\n }\n }\n\n if (isValidFormattedNationalNumber(formattedNationalNumber, state)) {\n return formattedNationalNumber;\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//\n\n\nfunction isValidFormattedNationalNumber(formattedNationalNumber, state) {\n return parseDigits(formattedNationalNumber) === state.getNationalDigits();\n}\n//# sourceMappingURL=AsYouTypeFormatter.complete.js.map","function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nimport { DIGIT_PLACEHOLDER, countOccurences, repeat, cutAndStripNonPairedParens, closeNonPairedParens, stripNonPairedParens, populateTemplateWithDigits } from './AsYouTypeFormatter.util';\nimport formatCompleteNumber, { canFormatCompleteNumber } from './AsYouTypeFormatter.complete';\nimport parseDigits from './helpers/parseDigits';\nexport { DIGIT_PLACEHOLDER } from './AsYouTypeFormatter.util';\nimport { FIRST_GROUP_PATTERN } from './helpers/formatNationalNumberUsingFormat';\nimport { VALID_PUNCTUATION } from './constants';\nimport applyInternationalSeparatorStyle from './helpers/applyInternationalSeparatorStyle'; // Used in phone number format template creation.\n// Could be any digit, I guess.\n\nvar DUMMY_DIGIT = '9'; // I don't know why is it exactly `15`\n\nvar LONGEST_NATIONAL_PHONE_NUMBER_LENGTH = 15; // 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.\n\nvar LONGEST_DUMMY_PHONE_NUMBER = repeat(DUMMY_DIGIT, LONGEST_NATIONAL_PHONE_NUMBER_LENGTH); // 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.\n\nvar NATIONAL_PREFIX_SEPARATORS_PATTERN = /[- ]/; // 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.\n\nvar SUPPORT_LEGACY_FORMATTING_PATTERNS = true; // A pattern that is used to match character classes in regular expressions.\n// An example of a character class is \"[1-4]\".\n\nvar CREATE_CHARACTER_CLASS_PATTERN = SUPPORT_LEGACY_FORMATTING_PATTERNS && function () {\n return /\\[([^\\[\\]])*\\]/g;\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.\n\n\nvar CREATE_STANDALONE_DIGIT_PATTERN = SUPPORT_LEGACY_FORMATTING_PATTERNS && function () {\n return /\\d(?=[^,}][^,}])/g;\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//\n\n\nvar NON_ALTERING_FORMAT_REG_EXP = new RegExp('^' + '[' + VALID_PUNCTUATION + ']*' + '(\\\\$\\\\d[' + VALID_PUNCTUATION + ']*)+' + '$'); // 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.\n\nvar MIN_LEADING_DIGITS_LENGTH = 3;\n\nvar AsYouTypeFormatter =\n/*#__PURE__*/\nfunction () {\n function AsYouTypeFormatter(_ref) {\n var _this = this;\n\n var state = _ref.state,\n metadata = _ref.metadata;\n\n _classCallCheck(this, AsYouTypeFormatter);\n\n _defineProperty(this, \"getSeparatorAfterNationalPrefix\", function (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 } // 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\n\n if (format && format.nationalPrefixFormattingRule() && NATIONAL_PREFIX_SEPARATORS_PATTERN.test(format.nationalPrefixFormattingRule())) {\n return ' ';\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\n\n return '';\n });\n\n _defineProperty(this, \"shouldTryNationalPrefixFormattingRule\", function (format, _ref2) {\n var international = _ref2.international,\n nationalPrefix = _ref2.nationalPrefix;\n\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\n if (usesNationalPrefix && nationalPrefix || !usesNationalPrefix && !international) {\n return true;\n }\n }\n });\n\n this.metadata = metadata;\n this.resetFormat();\n }\n\n _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\n if (numberingPlan) {\n this.isNANP = numberingPlan.callingCode() === '1';\n this.matchingFormats = numberingPlan.formats();\n\n if (state.nationalSignificantNumber) {\n this.narrowDownMatchingFormats(state);\n }\n } else {\n this.isNANP = undefined;\n this.matchingFormats = [];\n }\n }\n }, {\n key: \"format\",\n value: function format(nextDigits, state) {\n var _this2 = this;\n\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 = this.matchingFormats, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {\n var _ref3;\n\n if (_isArray) {\n if (_i >= _iterator.length) break;\n _ref3 = _iterator[_i++];\n } else {\n _i = _iterator.next();\n if (_i.done) break;\n _ref3 = _i.value;\n }\n\n var format = _ref3;\n var formattedCompleteNumber = formatCompleteNumber(state, format, {\n metadata: this.metadata,\n shouldTryNationalPrefixFormattingRule: function shouldTryNationalPrefixFormattingRule(format) {\n return _this2.shouldTryNationalPrefixFormattingRule(format, {\n international: state.international,\n nationalPrefix: state.nationalPrefix\n });\n },\n getSeparatorAfterNationalPrefix: this.getSeparatorAfterNationalPrefix\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; // With a new formatting template, the matched position\n // using the old template needs to be reset.\n\n this.populatedNationalNumberTemplatePosition = this.template.lastIndexOf(DIGIT_PLACEHOLDER);\n return formattedCompleteNumber;\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\n\n return this.formatNationalNumberWithNextDigits(nextDigits, state);\n } // Formats the next phone number digits.\n\n }, {\n key: \"formatNationalNumberWithNextDigits\",\n value: function formatNationalNumberWithNextDigits(nextDigits, state) {\n var previouslyChosenFormat = this.chosenFormat; // Choose a format from the list of matching ones.\n\n var newlyChosenFormat = this.chooseFormat(state);\n\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(_ref4) {\n var _this3 = this;\n\n var nationalSignificantNumber = _ref4.nationalSignificantNumber,\n nationalPrefix = _ref4.nationalPrefix,\n international = _ref4.international;\n var leadingDigits = nationalSignificantNumber; // \"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 // 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\n var leadingDigitsPatternIndex = leadingDigits.length - MIN_LEADING_DIGITS_LENGTH;\n\n if (leadingDigitsPatternIndex < 0) {\n leadingDigitsPatternIndex = 0;\n }\n\n this.matchingFormats = this.matchingFormats.filter(function (format) {\n return _this3.formatSuits(format, international, nationalPrefix) && _this3.formatMatches(format, leadingDigits, leadingDigitsPatternIndex);\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\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() && // !format.domesticCarrierCodeFormattingRule() &&\n !format.nationalPrefixIsOptionalWhenFormattingInNationalFormat()) {\n return false;\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\n\n if (!international && !nationalPrefix && format.nationalPrefixIsMandatoryWhenFormattingInNationalFormat()) {\n return false;\n }\n\n return true;\n }\n }, {\n key: \"formatMatches\",\n value: function formatMatches(format, leadingDigits, leadingDigitsPatternIndex) {\n var leadingDigitsPatternsCount = format.leadingDigitsPatterns().length; // If this format is not restricted to a certain\n // leading digits pattern then it fits.\n\n if (leadingDigitsPatternsCount === 0) {\n return true;\n } // Start 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 // 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\n if (leadingDigits.length < MIN_LEADING_DIGITS_LENGTH) {\n return true;\n } // If at least `MIN_LEADING_DIGITS_LENGTH` digits of a national number are available\n // then format matching starts narrowing down the list of possible formats\n // (only previously matched formats are considered for next digits).\n\n\n leadingDigitsPatternIndex = Math.min(leadingDigitsPatternIndex, leadingDigitsPatternsCount - 1);\n var leadingDigitsPattern = format.leadingDigitsPatterns()[leadingDigitsPatternIndex]; // Brackets are required for `^` to be applied to\n // all or-ed (`|`) parts, not just the first one.\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 _this4 = this;\n\n var _loop2 = function _loop2() {\n if (_isArray2) {\n if (_i2 >= _iterator2.length) return \"break\";\n _ref5 = _iterator2[_i2++];\n } else {\n _i2 = _iterator2.next();\n if (_i2.done) return \"break\";\n _ref5 = _i2.value;\n }\n\n var format = _ref5;\n\n // If this format is currently being used\n // and is still suitable, then stick to it.\n if (_this4.chosenFormat === format) {\n return \"break\";\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\n /* istanbul ignore if */\n\n\n if (!NON_ALTERING_FORMAT_REG_EXP.test(_this4.getFormatFormat(format, state.international))) {\n return \"continue\";\n }\n\n if (!_this4.createTemplateForFormat(format, state)) {\n // Remove the format if it can't generate a template.\n _this4.matchingFormats = _this4.matchingFormats.filter(function (_) {\n return _ !== format;\n });\n return \"continue\";\n }\n\n _this4.chosenFormat = format;\n return \"break\";\n };\n\n // When there are multiple available formats, the formatter uses the first\n // format where a formatting template could be created.\n _loop: for (var _iterator2 = this.matchingFormats.slice(), _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : _iterator2[Symbol.iterator]();;) {\n var _ref5;\n\n var _ret = _loop2();\n\n switch (_ret) {\n case \"break\":\n break _loop;\n\n case \"continue\":\n continue;\n }\n }\n\n if (!this.chosenFormat) {\n // No format matches the national (significant) phone number.\n this.resetFormat();\n }\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\n /* istanbul ignore if */\n if (SUPPORT_LEGACY_FORMATTING_PATTERNS && format.pattern().indexOf('|') >= 0) {\n return;\n } // Get formatting template for this phone number format\n\n\n var template = this.getTemplateForFormat(format, state); // If the national number entered is too long\n // for any phone number format, then abort.\n\n if (template) {\n this.setNationalNumberTemplate(template, state);\n return true;\n }\n }\n }, {\n key: \"getInternationalPrefixBeforeCountryCallingCode\",\n value: function getInternationalPrefixBeforeCountryCallingCode(_ref6, options) {\n var IDDPrefix = _ref6.IDDPrefix,\n missingPlus = _ref6.missingPlus;\n\n if (IDDPrefix) {\n return options && options.spacing === false ? IDDPrefix : IDDPrefix + ' ';\n }\n\n if (missingPlus) {\n return '';\n }\n\n return '+';\n }\n }, {\n key: \"getTemplate\",\n value: function getTemplate(state) {\n if (!this.template) {\n return;\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\n\n var index = -1;\n var i = 0;\n var internationalPrefix = state.international ? this.getInternationalPrefixBeforeCountryCallingCode(state, {\n spacing: false\n }) : '';\n\n while (i < internationalPrefix.length + state.getDigitsWithoutInternationalPrefix().length) {\n index = this.template.indexOf(DIGIT_PLACEHOLDER, index + 1);\n i++;\n }\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; // With a new formatting template, the matched position\n // using the old template needs to be reset.\n\n this.populatedNationalNumberTemplatePosition = -1; // 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\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 /**\r\n * Generates formatting template for a national phone number,\r\n * optionally containing a national prefix, for a format.\r\n * @param {Format} format\r\n * @param {string} nationalPrefix\r\n * @return {string}\r\n */\n\n }, {\n key: \"getTemplateForFormat\",\n value: function getTemplateForFormat(format, _ref7) {\n var nationalSignificantNumber = _ref7.nationalSignificantNumber,\n international = _ref7.international,\n nationalPrefix = _ref7.nationalPrefix,\n complexPrefixBeforeNationalSignificantNumber = _ref7.complexPrefixBeforeNationalSignificantNumber;\n var pattern = format.pattern();\n /* istanbul ignore else */\n\n if (SUPPORT_LEGACY_FORMATTING_PATTERNS) {\n pattern = pattern // Replace anything in the form of [..] with \\d\n .replace(CREATE_CHARACTER_CLASS_PATTERN(), '\\\\d') // Replace any standalone digit (not the one in `{}`) with \\d\n .replace(CREATE_STANDALONE_DIGIT_PATTERN(), '\\\\d');\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\n\n var digits = LONGEST_DUMMY_PHONE_NUMBER.match(pattern)[0]; // If the national number entered is too long\n // for any phone number format, then abort.\n\n if (nationalSignificantNumber.length > digits.length) {\n return;\n } // Get a formatting template which can be used to efficiently format\n // a partial number where digits are added one by one.\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\n var strictPattern = new RegExp('^' + pattern + '$');\n var nationalNumberDummyDigits = nationalSignificantNumber.replace(/\\d/g, DUMMY_DIGIT); // If `this.nationalSignificantNumber` has already sufficient length\n // to satisfy the `pattern` completely then use it\n // instead of `digits`.\n\n if (strictPattern.test(nationalNumberDummyDigits)) {\n digits = nationalNumberDummyDigits;\n }\n\n var numberFormat = this.getFormatFormat(format, international);\n var nationalPrefixIncludedInTemplate; // 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\n if (this.shouldTryNationalPrefixFormattingRule(format, {\n international: international,\n nationalPrefix: nationalPrefix\n })) {\n var numberFormatWithNationalPrefix = numberFormat.replace(FIRST_GROUP_PATTERN, format.nationalPrefixFormattingRule()); // 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\n /* istanbul ignore else */\n\n if (parseDigits(format.nationalPrefixFormattingRule()) === (nationalPrefix || '') + parseDigits('$1')) {\n numberFormat = numberFormatWithNationalPrefix;\n nationalPrefixIncludedInTemplate = true; // Replace all digits of the national prefix in the formatting template\n // with `DIGIT_PLACEHOLDER`s.\n\n if (nationalPrefix) {\n var i = nationalPrefix.length;\n\n while (i > 0) {\n numberFormat = numberFormat.replace(/\\d/, DIGIT_PLACEHOLDER);\n i--;\n }\n }\n }\n } // Generate formatting template for this phone number format.\n\n\n var template = digits // Format the dummy phone number according to the format.\n .replace(new RegExp(pattern), numberFormat) // Replace each dummy digit with a DIGIT_PLACEHOLDER.\n .replace(new RegExp(DUMMY_DIGIT, 'g'), DIGIT_PLACEHOLDER); // 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\n if (!nationalPrefixIncludedInTemplate) {\n if (complexPrefixBeforeNationalSignificantNumber) {\n // Prepend the prefix to the template manually.\n template = repeat(DIGIT_PLACEHOLDER, complexPrefixBeforeNationalSignificantNumber.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\n if (international) {\n template = applyInternationalSeparatorStyle(template);\n }\n\n return template;\n }\n }, {\n key: \"formatNextNationalNumberDigits\",\n value: function formatNextNationalNumberDigits(digits) {\n var result = populateTemplateWithDigits(this.populatedNationalNumberTemplate, this.populatedNationalNumberTemplatePosition, digits);\n\n if (!result) {\n // Reset the format.\n this.resetFormat();\n return;\n }\n\n this.populatedNationalNumberTemplate = result[0];\n this.populatedNationalNumberTemplatePosition = result[1]; // Return the formatted phone number so far.\n\n return cutAndStripNonPairedParens(this.populatedNationalNumberTemplate, this.populatedNationalNumberTemplatePosition + 1); // 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\n return AsYouTypeFormatter;\n}();\n\nexport { AsYouTypeFormatter as default };\n//# sourceMappingURL=AsYouTypeFormatter.js.map","function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); }\n\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance\"); }\n\nfunction _iterableToArrayLimit(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"] != null) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; }\n\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nimport _extractCountryCallingCode from './helpers/extractCountryCallingCode';\nimport extractCountryCallingCodeFromInternationalNumberWithoutPlusSign from './helpers/extractCountryCallingCodeFromInternationalNumberWithoutPlusSign';\nimport extractNationalNumberFromPossiblyIncompleteNumber from './helpers/extractNationalNumberFromPossiblyIncompleteNumber';\nimport stripIddPrefix from './helpers/stripIddPrefix';\nimport parseDigits from './helpers/parseDigits';\nimport { VALID_DIGITS, VALID_PUNCTUATION, PLUS_CHARS } from './constants';\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 + ']+' + '.*' + '$'); // Tests whether `national_prefix_for_parsing` could match\n// different national prefixes.\n// Matches anything that's not a digit or a square bracket.\n\nvar COMPLEX_NATIONAL_PREFIX = /[^\\d\\[\\]]/;\n\nvar AsYouTypeParser =\n/*#__PURE__*/\nfunction () {\n function AsYouTypeParser(_ref) {\n var defaultCountry = _ref.defaultCountry,\n defaultCallingCode = _ref.defaultCallingCode,\n metadata = _ref.metadata,\n onNationalSignificantNumberChange = _ref.onNationalSignificantNumberChange;\n\n _classCallCheck(this, AsYouTypeParser);\n\n this.defaultCountry = defaultCountry;\n this.defaultCallingCode = defaultCallingCode;\n this.metadata = metadata;\n this.onNationalSignificantNumberChange = onNationalSignificantNumberChange;\n }\n\n _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\n var digits = parseDigits(formattedDigits); // Checks for a special case: just a leading `+` has been entered.\n\n var justLeadingPlus;\n\n if (hasPlus) {\n if (!state.digits) {\n state.startInternationalNumber();\n\n if (!digits) {\n justLeadingPlus = true;\n }\n }\n }\n\n if (digits) {\n this.inputDigits(digits, state);\n }\n\n return {\n digits: digits,\n justLeadingPlus: justLeadingPlus\n };\n }\n /**\r\n * Inputs \"next\" phone number digits.\r\n * @param {string} digits\r\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\".\r\n */\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; // Append phone number digits.\n\n state.appendDigits(nextDigits); // 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\n if (hasReceivedThreeLeadingDigits) {\n this.extractIddPrefix(state);\n }\n\n if (this.isWaitingForCountryCallingCode(state)) {\n if (!this.extractCountryCallingCode(state)) {\n return;\n }\n } else {\n state.appendNationalSignificantNumberDigits(nextDigits);\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\n\n if (!state.international) {\n if (!this.hasExtractedNationalSignificantNumber) {\n this.extractNationalSignificantNumber(state.getNationalDigits(), state.update);\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 } // Extracts a country calling code from a number\n // being entered in internatonal format.\n\n }, {\n key: \"extractCountryCallingCode\",\n value: function extractCountryCallingCode(state) {\n var _extractCountryCallin = _extractCountryCallingCode('+' + state.getDigitsWithoutInternationalPrefix(), this.defaultCountry, this.defaultCallingCode, this.metadata.metadata),\n countryCallingCode = _extractCountryCallin.countryCallingCode,\n number = _extractCountryCallin.number;\n\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\n var nationalPrefixForParsing = numberingPlan._nationalPrefixForParsing();\n\n this.couldPossiblyExtractAnotherNationalSignificantNumber = nationalPrefixForParsing && COMPLEX_NATIONAL_PREFIX.test(nationalPrefixForParsing);\n } else {\n this.hasSelectedNumberingPlan = undefined;\n this.couldPossiblyExtractAnotherNationalSignificantNumber = undefined;\n }\n }\n /**\r\n * Extracts a national (significant) number from user input.\r\n * Google's library is different in that it only applies `national_prefix_for_parsing`\r\n * and doesn't apply `national_prefix_transform_rule` after that.\r\n * https://github.com/google/libphonenumber/blob/a3d70b0487875475e6ad659af404943211d26456/java/libphonenumber/src/com/google/i18n/phonenumbers/AsYouTypeFormatter.java#L539\r\n * @return {boolean} [extracted]\r\n */\n\n }, {\n key: \"extractNationalSignificantNumber\",\n value: function extractNationalSignificantNumber(nationalDigits, setState) {\n if (!this.hasSelectedNumberingPlan) {\n return;\n }\n\n var _extractNationalNumbe = extractNationalNumberFromPossiblyIncompleteNumber(nationalDigits, this.metadata),\n nationalPrefix = _extractNationalNumbe.nationalPrefix,\n nationalNumber = _extractNationalNumbe.nationalNumber,\n carrierCode = _extractNationalNumbe.carrierCode;\n\n if (nationalNumber === nationalDigits) {\n return;\n }\n\n this.onExtractedNationalNumber(nationalPrefix, carrierCode, nationalNumber, nationalDigits, setState);\n return true;\n }\n /**\r\n * In Google's code this function is called \"attempt to extract longer NDD\".\r\n * \"Some national prefixes are a substring of others\", they say.\r\n * @return {boolean} [result] — Returns `true` if extracting a national prefix produced different results from what they were.\r\n */\n\n }, {\n key: \"extractAnotherNationalSignificantNumber\",\n value: function extractAnotherNationalSignificantNumber(nationalDigits, prevNationalSignificantNumber, setState) {\n if (!this.hasExtractedNationalSignificantNumber) {\n return this.extractNationalSignificantNumber(nationalDigits, setState);\n }\n\n if (!this.couldPossiblyExtractAnotherNationalSignificantNumber) {\n return;\n }\n\n var _extractNationalNumbe2 = extractNationalNumberFromPossiblyIncompleteNumber(nationalDigits, this.metadata),\n nationalPrefix = _extractNationalNumbe2.nationalPrefix,\n nationalNumber = _extractNationalNumbe2.nationalNumber,\n carrierCode = _extractNationalNumbe2.carrierCode; // 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\n /* istanbul ignore if */\n\n\n if (nationalNumber === prevNationalSignificantNumber) {\n return;\n }\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 var complexPrefixBeforeNationalSignificantNumber;\n var nationalSignificantNumberMatchesInput; // This check also works with empty `this.nationalSignificantNumber`.\n\n var nationalSignificantNumberIndex = nationalDigits.lastIndexOf(nationalSignificantNumber); // If the extracted national (significant) number is the\n // last substring of the `digits`, then it means that it hasn't been altered:\n // no digits have been removed from the national (significant) number\n // while applying `national_prefix_transform_rule`.\n // https://gitlab.com/catamphetamine/libphonenumber-js/-/blob/master/METADATA.md#national_prefix_for_parsing--national_prefix_transform_rule\n\n if (nationalSignificantNumberIndex >= 0 && nationalSignificantNumberIndex === nationalDigits.length - nationalSignificantNumber.length) {\n nationalSignificantNumberMatchesInput = true; // If a prefix of a national (significant) number is not as simple\n // as just a basic national prefix, then such prefix is stored in\n // `this.complexPrefixBeforeNationalSignificantNumber` property and will be\n // prepended \"as is\" to the national (significant) number to produce\n // a formatted result.\n\n var prefixBeforeNationalNumber = nationalDigits.slice(0, nationalSignificantNumberIndex); // `prefixBeforeNationalNumber` is always non-empty,\n // because `onExtractedNationalNumber()` isn't called\n // when a national (significant) number hasn't been actually \"extracted\":\n // when a national (significant) number is equal to the national part of `digits`,\n // then `onExtractedNationalNumber()` doesn't get called.\n\n if (prefixBeforeNationalNumber !== nationalPrefix) {\n complexPrefixBeforeNationalSignificantNumber = prefixBeforeNationalNumber;\n }\n }\n\n setState({\n nationalPrefix: nationalPrefix,\n carrierCode: carrierCode,\n nationalSignificantNumber: nationalSignificantNumber,\n nationalSignificantNumberMatchesInput: nationalSignificantNumberMatchesInput,\n complexPrefixBeforeNationalSignificantNumber: complexPrefixBeforeNationalSignificantNumber\n }); // `onExtractedNationalNumber()` is only called when\n // the national (significant) number actually did change.\n\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, state.update)) {\n return true;\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\n\n if (this.extractIddPrefix(state)) {\n this.extractCallingCodeAndNationalSignificantNumber(state);\n return true;\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\n\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\n if (international || IDDPrefix) {\n return;\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\n\n var numberWithoutIDD = stripIddPrefix(digits, this.defaultCountry, this.defaultCallingCode, this.metadata.metadata);\n\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 return true;\n }\n }\n }, {\n key: \"fixMissingPlus\",\n value: function fixMissingPlus(state) {\n if (!state.international) {\n var _extractCountryCallin2 = extractCountryCallingCodeFromInternationalNumberWithoutPlusSign(state.digits, this.defaultCountry, this.defaultCallingCode, this.metadata.metadata),\n newCallingCode = _extractCountryCallin2.countryCallingCode,\n number = _extractCountryCallin2.number;\n\n if (newCallingCode) {\n state.update({\n missingPlus: true\n });\n this.startInternationalNumber(state);\n return true;\n }\n }\n }\n }, {\n key: \"startInternationalNumber\",\n value: function startInternationalNumber(state) {\n state.startInternationalNumber(); // If a national (significant) number has been extracted before, reset it.\n\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(), state.update);\n }\n }\n }]);\n\n return AsYouTypeParser;\n}();\n/**\r\n * Extracts formatted phone number from text (if there's any).\r\n * @param {string} text\r\n * @return {string} [formattedPhoneNumber]\r\n */\n\n\nexport { AsYouTypeParser as default };\n\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\n if (startsAt < 0) {\n return;\n } // Trim everything to the left of the phone number.\n\n\n text = text.slice(startsAt); // Trim the `+`.\n\n var hasPlus;\n\n if (text[0] === '+') {\n hasPlus = true;\n text = text.slice('+'.length);\n } // Trim everything to the right of the phone number.\n\n\n text = text.replace(AFTER_PHONE_NUMBER_DIGITS_END_PATTERN, ''); // Re-add the previously trimmed `+`.\n\n if (hasPlus) {\n text = '+' + text;\n }\n\n return text;\n}\n/**\r\n * Extracts formatted phone number digits (and a `+`) from text (if there're any).\r\n * @param {string} text\r\n * @return {any[]}\r\n */\n\n\nfunction _extractFormattedDigitsAndPlus(text) {\n // Extract a formatted phone number part from text.\n var extractedNumber = extractFormattedPhoneNumber(text) || ''; // Trim a `+`.\n\n if (extractedNumber[0] === '+') {\n return [extractedNumber.slice('+'.length), true];\n }\n\n return [extractedNumber];\n}\n/**\r\n * Extracts formatted phone number digits (and a `+`) from text (if there're any).\r\n * @param {string} text\r\n * @return {any[]}\r\n */\n\n\nexport function extractFormattedDigitsAndPlus(text) {\n var _extractFormattedDigi3 = _extractFormattedDigitsAndPlus(text),\n _extractFormattedDigi4 = _slicedToArray(_extractFormattedDigi3, 2),\n formattedDigits = _extractFormattedDigi4[0],\n hasPlus = _extractFormattedDigi4[1]; // 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\n\n if (!VALID_FORMATTED_PHONE_NUMBER_DIGITS_PART_PATTERN.test(formattedDigits)) {\n formattedDigits = '';\n }\n\n return [formattedDigits, hasPlus];\n}\n//# sourceMappingURL=AsYouTypeParser.js.map","function _typeof(obj) { if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nfunction _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); }\n\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance\"); }\n\nfunction _iterableToArrayLimit(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"] != null) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; }\n\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nimport Metadata from './metadata';\nimport PhoneNumber from './PhoneNumber';\nimport AsYouTypeState from './AsYouTypeState';\nimport AsYouTypeFormatter, { DIGIT_PLACEHOLDER } from './AsYouTypeFormatter';\nimport AsYouTypeParser, { extractFormattedDigitsAndPlus } from './AsYouTypeParser';\nimport getCountryByCallingCode from './helpers/getCountryByCallingCode';\nvar USE_NON_GEOGRAPHIC_COUNTRY_CODE = false;\n\nvar AsYouType =\n/*#__PURE__*/\nfunction () {\n /**\r\n * @param {(string|object)?} [optionsOrDefaultCountry] - The default country used for parsing non-international phone numbers. Can also be an `options` object.\r\n * @param {Object} metadata\r\n */\n function AsYouType(optionsOrDefaultCountry, metadata) {\n _classCallCheck(this, AsYouType);\n\n this.metadata = new Metadata(metadata);\n\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\n this.defaultCountry = defaultCountry;\n this.defaultCallingCode = defaultCallingCode;\n this.reset();\n }\n\n _createClass(AsYouType, [{\n key: \"getCountryAndCallingCode\",\n value: function getCountryAndCallingCode(optionsOrDefaultCountry) {\n // Set `defaultCountry` and `defaultCallingCode` options.\n var defaultCountry;\n var defaultCallingCode; // Turns out `null` also has type \"object\". Weird.\n\n if (optionsOrDefaultCountry) {\n if (_typeof(optionsOrDefaultCountry) === 'object') {\n defaultCountry = optionsOrDefaultCountry.defaultCountry;\n defaultCallingCode = optionsOrDefaultCountry.defaultCallingCode;\n } else {\n defaultCountry = optionsOrDefaultCountry;\n }\n }\n\n if (defaultCountry && !this.metadata.hasCountry(defaultCountry)) {\n defaultCountry = undefined;\n }\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\n return [defaultCountry, defaultCallingCode];\n }\n /**\r\n * Inputs \"next\" phone number characters.\r\n * @param {string} text\r\n * @return {string} Formatted phone number characters that have been input so far.\r\n */\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\n if (justLeadingPlus) {\n this.formattedOutput = '+';\n } else if (digits) {\n this.determineTheCountryIfNeeded(); // Match the available formats by the currently available leading digits.\n\n if (this.state.nationalSignificantNumber) {\n this.formatter.narrowDownMatchingFormats(this.state);\n }\n\n var formattedNationalNumber;\n\n if (this.metadata.hasSelectedNumberingPlan()) {\n formattedNationalNumber = this.formatter.format(digits, this.state);\n }\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(); // If it could, then re-try formatting the new national (significant) number.\n\n var nationalDigits = this.state.getNationalDigits();\n\n if (nationalDigits) {\n formattedNationalNumber = this.formatter.format(nationalDigits, this.state);\n }\n }\n }\n\n this.formattedOutput = formattedNationalNumber ? this.getFullNumber(formattedNationalNumber) : this.getNonFormattedNumber();\n }\n\n return this.formattedOutput;\n }\n }, {\n key: \"reset\",\n value: function reset() {\n var _this = this;\n\n this.state = new AsYouTypeState({\n onCountryChange: function onCountryChange(country) {\n // Before version `1.6.0`, the official `AsYouType` formatter API\n // included the `.country` property of 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(country, callingCode) {\n _this.metadata.selectNumberingPlan(country, callingCode);\n\n _this.formatter.reset(_this.metadata.numberingPlan, _this.state);\n\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\n _this.formatter.reset(_this.metadata.numberingPlan, _this.state);\n }\n });\n this.state.reset(this.defaultCountry, this.defaultCallingCode);\n this.formattedOutput = '';\n return this;\n }\n /**\r\n * Returns `true` if the phone number is being input in international format.\r\n * In other words, returns `true` if and only if the parsed phone number starts with a `\"+\"`.\r\n * @return {boolean}\r\n */\n\n }, {\n key: \"isInternational\",\n value: function isInternational() {\n return this.state.international;\n }\n /**\r\n * Returns the \"country calling code\" part of the phone number.\r\n * Returns `undefined` if the number is not being input in international format.\r\n * Returns \"country calling code\" for \"non-geographic\" phone numbering plans too.\r\n * @return {string} [callingCode]\r\n */\n\n }, {\n key: \"getCallingCode\",\n value: function getCallingCode() {\n return this.state.callingCode;\n } // A legacy alias.\n\n }, {\n key: \"getCountryCallingCode\",\n value: function getCountryCallingCode() {\n return this.getCallingCode();\n }\n /**\r\n * Returns a two-letter country code of the phone number.\r\n * Returns `undefined` for \"non-geographic\" phone numbering plans.\r\n * Returns `undefined` if no phone number has been input yet.\r\n * @return {string} [country]\r\n */\n\n }, {\n key: \"getCountry\",\n value: function getCountry() {\n var _this$state = this.state,\n digits = _this$state.digits,\n country = _this$state.country; // If no digits have been input yet,\n // then `this.country` is the `defaultCountry`.\n // Won't return the `defaultCountry` in such case.\n\n if (!digits) {\n return;\n }\n\n var countryCode = country;\n /* istanbul ignore if */\n\n if (USE_NON_GEOGRAPHIC_COUNTRY_CODE) {\n // `AsYouType.getCountry()` returns `undefined`\n // for \"non-geographic\" phone numbering plans.\n if (countryCode === '001') {\n countryCode = undefined;\n }\n }\n\n return countryCode;\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 } // Prepends `+CountryCode ` in case of an international phone number\n\n }, {\n key: \"getFullNumber\",\n value: function getFullNumber(formattedNationalNumber) {\n var _this2 = this;\n\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\n var callingCode = this.state.callingCode;\n\n if (!callingCode) {\n return prefix(\"\".concat(this.state.getDigitsWithoutInternationalPrefix()));\n }\n\n if (!formattedNationalNumber) {\n return prefix(callingCode);\n }\n\n return prefix(\"\".concat(callingCode, \" \").concat(formattedNationalNumber));\n }\n\n return formattedNationalNumber;\n }\n }, {\n key: \"getNonFormattedNationalNumberWithPrefix\",\n value: function getNonFormattedNationalNumberWithPrefix() {\n var _this$state2 = this.state,\n nationalSignificantNumber = _this$state2.nationalSignificantNumber,\n complexPrefixBeforeNationalSignificantNumber = _this$state2.complexPrefixBeforeNationalSignificantNumber,\n nationalPrefix = _this$state2.nationalPrefix;\n var number = nationalSignificantNumber;\n var prefix = complexPrefixBeforeNationalSignificantNumber || nationalPrefix;\n\n if (prefix) {\n number = prefix + number;\n }\n\n return number;\n }\n }, {\n key: \"getNonFormattedNumber\",\n value: function getNonFormattedNumber() {\n var nationalSignificantNumberMatchesInput = this.state.nationalSignificantNumberMatchesInput;\n return this.getFullNumber(nationalSignificantNumberMatchesInput ? this.getNonFormattedNationalNumberWithPrefix() : this.state.getNationalDigits());\n }\n }, {\n key: \"getNonFormattedTemplate\",\n value: function getNonFormattedTemplate() {\n var number = this.getNonFormattedNumber();\n\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 } // Determines the country of the phone number\n // entered so far based on the country phone code\n // and the national phone number.\n\n }, {\n key: \"determineTheCountry\",\n value: function determineTheCountry() {\n this.state.setCountry(getCountryByCallingCode(this.isInternational() ? this.state.callingCode : this.defaultCallingCode, this.state.nationalSignificantNumber, this.metadata));\n }\n /**\r\n * Returns an instance of `PhoneNumber` class.\r\n * Will return `undefined` if no national (significant) number\r\n * digits have been entered so far, or if no `defaultCountry` has been\r\n * set and the user enters a phone number not in international format.\r\n */\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\n if (this.isInternational()) {\n if (!this.state.callingCode) {\n return;\n }\n } else {\n if (!this.state.country && !this.defaultCallingCode) {\n return;\n }\n }\n\n if (!nationalSignificantNumber) {\n return;\n }\n\n var countryCode = this.getCountry();\n var callingCode = this.getCountryCallingCode() || this.defaultCallingCode;\n var phoneNumber = new PhoneNumber(countryCode || callingCode, nationalSignificantNumber, this.metadata.metadata);\n\n if (carrierCode) {\n phoneNumber.carrierCode = carrierCode;\n } // Phone number extensions are not supported by \"As You Type\" formatter.\n\n\n return phoneNumber;\n }\n /**\r\n * Returns `true` if the phone number is \"possible\".\r\n * Is just a shortcut for `PhoneNumber.isPossible()`.\r\n * @return {boolean}\r\n */\n\n }, {\n key: \"isPossible\",\n value: function isPossible() {\n var phoneNumber = this.getNumber();\n\n if (!phoneNumber) {\n return false;\n }\n\n return phoneNumber.isPossible();\n }\n /**\r\n * Returns `true` if the phone number is \"valid\".\r\n * Is just a shortcut for `PhoneNumber.isValid()`.\r\n * @return {boolean}\r\n */\n\n }, {\n key: \"isValid\",\n value: function isValid() {\n var phoneNumber = this.getNumber();\n\n if (!phoneNumber) {\n return false;\n }\n\n return phoneNumber.isValid();\n }\n /**\r\n * @deprecated\r\n * This method is used in `react-phone-number-input/source/input-control.js`\r\n * in versions before `3.0.16`.\r\n */\n\n }, {\n key: \"getNationalNumber\",\n value: function getNationalNumber() {\n return this.state.nationalSignificantNumber;\n }\n /**\r\n * Returns the phone number characters entered by the user.\r\n * @return {string}\r\n */\n\n }, {\n key: \"getChars\",\n value: function getChars() {\n return (this.state.international ? '+' : '') + this.state.digits;\n }\n /**\r\n * Returns the template for the formatted phone number.\r\n * @return {string}\r\n */\n\n }, {\n key: \"getTemplate\",\n value: function getTemplate() {\n return this.formatter.getTemplate(this.state) || this.getNonFormattedTemplate() || '';\n }\n }]);\n\n return AsYouType;\n}();\n\nexport { AsYouType as default };\n//# sourceMappingURL=AsYouType.js.map","import { getCountryCallingCode } from 'libphonenumber-js/core';\nexport function getInputValuePrefix(_ref) {\n var country = _ref.country,\n international = _ref.international,\n withCountryCallingCode = _ref.withCountryCallingCode,\n metadata = _ref.metadata;\n return country && international && !withCountryCallingCode ? \"+\".concat(getCountryCallingCode(country, metadata)) : '';\n}\nexport function removeInputValuePrefix(value, prefix) {\n if (prefix) {\n value = value.slice(prefix.length);\n\n if (value[0] === ' ') {\n value = value.slice(1);\n }\n }\n\n return value;\n}\n//# sourceMappingURL=inputValuePrefix.js.map","function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\n\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\n\nimport React, { useCallback } from 'react';\nimport PropTypes from 'prop-types';\nimport Input from 'input-format/react';\nimport { AsYouType, parsePhoneNumberCharacter } from 'libphonenumber-js/core';\nimport { getInputValuePrefix, removeInputValuePrefix } from './helpers/inputValuePrefix';\n/**\r\n * This input uses `input-format` library\r\n * for \"smart\" caret positioning.\r\n */\n\nexport function createInput(defaultMetadata) {\n function InputSmart(_ref, ref) {\n var country = _ref.country,\n international = _ref.international,\n withCountryCallingCode = _ref.withCountryCallingCode,\n metadata = _ref.metadata,\n rest = _objectWithoutProperties(_ref, [\"country\", \"international\", \"withCountryCallingCode\", \"metadata\"]);\n\n var format = useCallback(function (value) {\n // \"As you type\" formatter.\n var formatter = new AsYouType(country, metadata);\n var prefix = getInputValuePrefix({\n country: country,\n international: international,\n withCountryCallingCode: withCountryCallingCode,\n metadata: metadata\n }); // Format the number.\n\n var text = formatter.input(prefix + value);\n var template = formatter.getTemplate();\n\n if (prefix) {\n text = removeInputValuePrefix(text, prefix); // `AsYouType.getTemplate()` can be `undefined`.\n\n if (template) {\n template = removeInputValuePrefix(template, prefix);\n }\n }\n\n return {\n text: text,\n template: template\n };\n }, [country, metadata]);\n return React.createElement(Input, _extends({}, rest, {\n ref: ref,\n parse: parsePhoneNumberCharacter,\n format: format\n }));\n }\n\n InputSmart = React.forwardRef(InputSmart);\n InputSmart.propTypes = {\n /**\r\n * A two-letter country code for formatting `value`\r\n * as a national phone number (e.g. `(800) 555 35 35`).\r\n * E.g. \"US\", \"RU\", etc.\r\n * If no `country` is passed then `value`\r\n * is formatted as an international phone number.\r\n * (e.g. `+7 800 555 35 35`)\r\n * Perhaps the `country` property should have been called `defaultCountry`\r\n * because if `value` is an international number then `country` is ignored.\r\n */\n country: PropTypes.string,\n\n /**\r\n * If `country` property is passed along with `international={true}` property\r\n * then the phone number will be input in \"international\" format for that `country`\r\n * (without \"country calling code\").\r\n * For example, if `country=\"US\"` property is passed to \"without country select\" input\r\n * then the phone number will be input in the \"national\" format for `US` (`(213) 373-4253`).\r\n * But if both `country=\"US\"` and `international={true}` properties are passed then\r\n * the phone number will be input in the \"international\" format for `US` (`213 373 4253`)\r\n * (without \"country calling code\" `+1`).\r\n */\n international: PropTypes.bool,\n\n /**\r\n * If `country` and `international` properties are set,\r\n * then by default it won't include \"country calling code\" in the input field.\r\n * To change that, pass `withCountryCallingCode` property,\r\n * and it will include \"country calling code\" in the input field.\r\n */\n withCountryCallingCode: PropTypes.bool,\n\n /**\r\n * `libphonenumber-js` metadata.\r\n */\n metadata: PropTypes.object.isRequired\n };\n InputSmart.defaultProps = {\n metadata: defaultMetadata\n };\n return InputSmart;\n}\nexport default createInput();\n//# sourceMappingURL=InputSmart.js.map","function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\n\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\n\nimport React, { useCallback } from 'react';\nimport PropTypes from 'prop-types';\nimport { parseIncompletePhoneNumber, formatIncompletePhoneNumber } from 'libphonenumber-js/core';\nimport { getInputValuePrefix, removeInputValuePrefix } from './helpers/inputValuePrefix';\nexport function createInput(defaultMetadata) {\n /**\r\n * `InputBasic`'s caret is not as \"smart\" as the default `inputComponent`'s\r\n * but still works good enough. When erasing or inserting digits in the middle\r\n * of a phone number the caret usually jumps to the end: this is the expected\r\n * behaviour and it's the workaround for the [Samsung Galaxy smart caret positioning bug](https://github.com/catamphetamine/react-phone-number-input/issues/75).\r\n */\n function InputBasic(_ref, ref) {\n var value = _ref.value,\n onChange = _ref.onChange,\n country = _ref.country,\n international = _ref.international,\n withCountryCallingCode = _ref.withCountryCallingCode,\n metadata = _ref.metadata,\n Input = _ref.inputComponent,\n rest = _objectWithoutProperties(_ref, [\"value\", \"onChange\", \"country\", \"international\", \"withCountryCallingCode\", \"metadata\", \"inputComponent\"]);\n\n var prefix = getInputValuePrefix({\n country: country,\n international: international,\n withCountryCallingCode: withCountryCallingCode,\n metadata: metadata\n });\n\n var _onChange = useCallback(function (event) {\n var newValue = parseIncompletePhoneNumber(event.target.value); // By default, if a value is something like `\"(123)\"`\n // then Backspace would only erase the rightmost brace\n // becoming something like `\"(123\"`\n // which would give the same `\"123\"` value\n // which would then be formatted back to `\"(123)\"`\n // and so a user wouldn't be able to erase the phone number.\n // Working around this issue with this simple hack.\n\n if (newValue === value) {\n var newValueFormatted = format(prefix, newValue, country, metadata);\n\n if (newValueFormatted.indexOf(event.target.value) === 0) {\n // Trim the last digit (or plus sign).\n newValue = newValue.slice(0, -1);\n }\n }\n\n onChange(newValue);\n }, [prefix, value, onChange, country, metadata]);\n\n return React.createElement(Input, _extends({}, rest, {\n ref: ref,\n value: format(prefix, value, country, metadata),\n onChange: _onChange\n }));\n }\n\n InputBasic = React.forwardRef(InputBasic);\n InputBasic.propTypes = {\n /**\r\n * The parsed phone number.\r\n * \"Parsed\" not in a sense of \"E.164\"\r\n * but rather in a sense of \"having only\r\n * digits and possibly a leading plus character\".\r\n * Examples: `\"\"`, `\"+\"`, `\"+123\"`, `\"123\"`.\r\n */\n value: PropTypes.string.isRequired,\n\n /**\r\n * Updates the `value`.\r\n */\n onChange: PropTypes.func.isRequired,\n\n /**\r\n * A two-letter country code for formatting `value`\r\n * as a national phone number (e.g. `(800) 555 35 35`).\r\n * E.g. \"US\", \"RU\", etc.\r\n * If no `country` is passed then `value`\r\n * is formatted as an international phone number.\r\n * (e.g. `+7 800 555 35 35`)\r\n * Perhaps the `country` property should have been called `defaultCountry`\r\n * because if `value` is an international number then `country` is ignored.\r\n */\n country: PropTypes.string,\n\n /**\r\n * If `country` property is passed along with `international={true}` property\r\n * then the phone number will be input in \"international\" format for that `country`\r\n * (without \"country calling code\").\r\n * For example, if `country=\"US\"` property is passed to \"without country select\" input\r\n * then the phone number will be input in the \"national\" format for `US` (`(213) 373-4253`).\r\n * But if both `country=\"US\"` and `international={true}` properties are passed then\r\n * the phone number will be input in the \"international\" format for `US` (`213 373 4253`)\r\n * (without \"country calling code\" `+1`).\r\n */\n international: PropTypes.bool,\n\n /**\r\n * If `country` and `international` properties are set,\r\n * then by default it won't include \"country calling code\" in the input field.\r\n * To change that, pass `withCountryCallingCode` property,\r\n * and it will include \"country calling code\" in the input field.\r\n */\n withCountryCallingCode: PropTypes.bool,\n\n /**\r\n * `libphonenumber-js` metadata.\r\n */\n metadata: PropTypes.object.isRequired,\n\n /**\r\n * The `` component.\r\n */\n inputComponent: PropTypes.elementType.isRequired\n };\n InputBasic.defaultProps = {\n metadata: defaultMetadata,\n inputComponent: 'input'\n };\n return InputBasic;\n}\nexport default createInput();\n\nfunction format(prefix, value, country, metadata) {\n return removeInputValuePrefix(formatIncompletePhoneNumber(prefix + value, country, metadata), prefix);\n}\n//# sourceMappingURL=InputBasic.js.map","import AsYouType from './AsYouType';\n/**\r\n * Formats a (possibly incomplete) phone number.\r\n * The phone number can be either in E.164 format\r\n * or in a form of national number digits.\r\n * @param {string} value - A possibly incomplete phone number. Either in E.164 format or in a form of national number digits.\r\n * @param {string?} country - Two-letter (\"ISO 3166-1 alpha-2\") country code.\r\n * @return {string} Formatted (possibly incomplete) phone number.\r\n */\n\nexport default function formatIncompletePhoneNumber(value, country, metadata) {\n if (!metadata) {\n metadata = country;\n country = undefined;\n }\n\n return new AsYouType(country, metadata).input(value);\n}\n//# sourceMappingURL=formatIncompletePhoneNumber.js.map","function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\n\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\n\nimport React from 'react';\nimport PropTypes from 'prop-types';\nimport classNames from 'classnames'; // Default country flag icon.\n// `` is wrapped in a `` to prevent SVGs from exploding in size in IE 11.\n// https://github.com/catamphetamine/react-phone-number-input/issues/111\n\nexport default function FlagComponent(_ref) {\n var country = _ref.country,\n countryName = _ref.countryName,\n flags = _ref.flags,\n flagUrl = _ref.flagUrl,\n rest = _objectWithoutProperties(_ref, [\"country\", \"countryName\", \"flags\", \"flagUrl\"]);\n\n if (flags && flags[country]) {\n return flags[country]({\n title: countryName\n });\n }\n\n return React.createElement(\"img\", _extends({}, rest, {\n alt: countryName,\n role: countryName ? undefined : \"presentation\",\n src: flagUrl.replace('{XX}', country).replace('{xx}', country.toLowerCase())\n }));\n}\nFlagComponent.propTypes = {\n // The country to be selected by default.\n // Two-letter country code (\"ISO 3166-1 alpha-2\").\n country: PropTypes.string.isRequired,\n // Will be HTML `title` attribute of the ``.\n countryName: PropTypes.string.isRequired,\n // Country flag icon components.\n // By default flag icons are inserted as ``s\n // with their `src` pointed to `country-flag-icons` gitlab pages website.\n // There might be cases (e.g. an offline application)\n // where having a large (3 megabyte) `` flags\n // bundle is more appropriate.\n // `import flags from 'react-phone-number-input/flags'`.\n flags: PropTypes.objectOf(PropTypes.elementType),\n // A URL for a country flag icon.\n // By default it points to `country-flag-icons` gitlab pages website.\n flagUrl: PropTypes.string.isRequired\n};\n//# sourceMappingURL=Flag.js.map","function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\n\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\n\nimport React from 'react';\nimport PropTypes from 'prop-types';\nexport default function InternationalIcon(_ref) {\n var aspectRatio = _ref.aspectRatio,\n rest = _objectWithoutProperties(_ref, [\"aspectRatio\"]);\n\n if (aspectRatio === 1) {\n return React.createElement(InternationalIcon1x1, rest);\n } else {\n return React.createElement(InternationalIcon3x2, rest);\n }\n}\nInternationalIcon.propTypes = {\n title: PropTypes.string.isRequired,\n aspectRatio: PropTypes.number\n}; // 3x2.\n// Using `` in ``s:\n// https://developer.mozilla.org/en-US/docs/Web/SVG/Element/title\n\nfunction InternationalIcon3x2(_ref2) {\n var title = _ref2.title,\n rest = _objectWithoutProperties(_ref2, [\"title\"]);\n\n return React.createElement(\"svg\", _extends({}, rest, {\n xmlns: \"http://www.w3.org/2000/svg\",\n viewBox: \"0 0 75 50\"\n }), React.createElement(\"title\", null, title), React.createElement(\"g\", {\n className: \"PhoneInputInternationalIconGlobe\",\n stroke: \"currentColor\",\n fill: \"none\",\n strokeWidth: \"2\",\n strokeMiterlimit: \"10\"\n }, React.createElement(\"path\", {\n strokeLinecap: \"round\",\n d: \"M47.2,36.1C48.1,36,49,36,50,36c7.4,0,14,1.7,18.5,4.3\"\n }), React.createElement(\"path\", {\n d: \"M68.6,9.6C64.2,12.3,57.5,14,50,14c-7.4,0-14-1.7-18.5-4.3\"\n }), React.createElement(\"line\", {\n x1: \"26\",\n y1: \"25\",\n x2: \"74\",\n y2: \"25\"\n }), React.createElement(\"line\", {\n x1: \"50\",\n y1: \"1\",\n x2: \"50\",\n y2: \"49\"\n }), React.createElement(\"path\", {\n strokeLinecap: \"round\",\n d: \"M46.3,48.7c1.2,0.2,2.5,0.3,3.7,0.3c13.3,0,24-10.7,24-24S63.3,1,50,1S26,11.7,26,25c0,2,0.3,3.9,0.7,5.8\"\n }), React.createElement(\"path\", {\n strokeLinecap: \"round\",\n d: \"M46.8,48.2c1,0.6,2.1,0.8,3.2,0.8c6.6,0,12-10.7,12-24S56.6,1,50,1S38,11.7,38,25c0,1.4,0.1,2.7,0.2,4c0,0.1,0,0.2,0,0.2\"\n })), React.createElement(\"path\", {\n className: \"PhoneInputInternationalIconPhone\",\n stroke: \"none\",\n fill: \"currentColor\",\n d: \"M12.4,17.9c2.9-2.9,5.4-4.8,0.3-11.2S4.1,5.2,1.3,8.1C-2,11.4,1.1,23.5,13.1,35.6s24.3,15.2,27.5,11.9c2.8-2.8,7.8-6.3,1.4-11.5s-8.3-2.6-11.2,0.3c-2,2-7.2-2.2-11.7-6.7S10.4,19.9,12.4,17.9z\"\n }));\n}\n\nInternationalIcon3x2.propTypes = {\n title: PropTypes.string.isRequired\n}; // 1x1.\n// Using `` in ``s:\n// https://developer.mozilla.org/en-US/docs/Web/SVG/Element/title\n\nfunction InternationalIcon1x1(_ref3) {\n var title = _ref3.title,\n rest = _objectWithoutProperties(_ref3, [\"title\"]);\n\n return React.createElement(\"svg\", _extends({}, rest, {\n xmlns: \"http://www.w3.org/2000/svg\",\n viewBox: \"0 0 50 50\"\n }), React.createElement(\"title\", null, title), React.createElement(\"g\", {\n className: \"PhoneInputInternationalIconGlobe\",\n stroke: \"currentColor\",\n fill: \"none\",\n strokeWidth: \"2\",\n strokeLinecap: \"round\"\n }, React.createElement(\"path\", {\n d: \"M8.45,13A21.44,21.44,0,1,1,37.08,41.56\"\n }), React.createElement(\"path\", {\n d: \"M19.36,35.47a36.9,36.9,0,0,1-2.28-13.24C17.08,10.39,21.88.85,27.8.85s10.72,9.54,10.72,21.38c0,6.48-1.44,12.28-3.71,16.21\"\n }), React.createElement(\"path\", {\n d: \"M17.41,33.4A39,39,0,0,1,27.8,32.06c6.62,0,12.55,1.5,16.48,3.86\"\n }), React.createElement(\"path\", {\n d: \"M44.29,8.53c-3.93,2.37-9.86,3.88-16.49,3.88S15.25,10.9,11.31,8.54\"\n }), React.createElement(\"line\", {\n x1: \"27.8\",\n y1: \"0.85\",\n x2: \"27.8\",\n y2: \"34.61\"\n }), React.createElement(\"line\", {\n x1: \"15.2\",\n y1: \"22.23\",\n x2: \"49.15\",\n y2: \"22.23\"\n })), React.createElement(\"path\", {\n className: \"PhoneInputInternationalIconPhone\",\n stroke: \"transparent\",\n fill: \"currentColor\",\n d: \"M9.42,26.64c2.22-2.22,4.15-3.59.22-8.49S3.08,17,.93,19.17c-2.49,2.48-.13,11.74,9,20.89s18.41,11.5,20.89,9c2.15-2.15,5.91-4.77,1-8.71s-6.27-2-8.49.22c-1.55,1.55-5.48-1.69-8.86-5.08S7.87,28.19,9.42,26.64Z\"\n }));\n}\n\nInternationalIcon1x1.propTypes = {\n title: PropTypes.string.isRequired\n};\n//# sourceMappingURL=InternationalIcon.js.map","import { isSupportedCountry } from 'libphonenumber-js/core';\nexport { getCountries } from 'libphonenumber-js/core';\n/**\r\n * Sorts country `` options.\r\n * Can move some country `` options\r\n * to the top of the list, for example.\r\n * @param {object[]} countryOptions — Country `` options.\r\n * @param {string[]} [countryOptionsOrder] — Country `` options order. Example: `[\"US\", \"CA\", \"AU\", \"|\", \"...\"]`.\r\n * @return {object[]}\r\n */\n\nexport function sortCountryOptions(options, order) {\n if (!order) {\n return options;\n }\n\n var optionsOnTop = [];\n var optionsOnBottom = [];\n var appendTo = optionsOnTop;\n\n for (var _iterator = order, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {\n var _ref;\n\n if (_isArray) {\n if (_i >= _iterator.length) break;\n _ref = _iterator[_i++];\n } else {\n _i = _iterator.next();\n if (_i.done) break;\n _ref = _i.value;\n }\n\n var element = _ref;\n\n if (element === '|') {\n appendTo.push({\n divider: true\n });\n } else if (element === '...' || element === '…') {\n appendTo = optionsOnBottom;\n } else {\n (function () {\n var countryCode = void 0;\n\n if (element === '🌐') {\n countryCode = undefined;\n } else {\n countryCode = element;\n } // Find the position of the option.\n\n\n var index = options.indexOf(options.filter(function (option) {\n return option.value === countryCode;\n })[0]); // Get the option.\n\n var option = options[index]; // Remove the option from its default position.\n\n options.splice(index, 1); // Add the option on top.\n\n appendTo.push(option);\n })();\n }\n }\n\n return optionsOnTop.concat(options).concat(optionsOnBottom);\n}\nexport function getSupportedCountryOptions(countryOptions, metadata) {\n if (countryOptions) {\n countryOptions = countryOptions.filter(function (option) {\n switch (option) {\n case '🌐':\n case '|':\n case '...':\n case '…':\n return true;\n\n default:\n return isCountrySupportedWithError(option, metadata);\n }\n });\n\n if (countryOptions.length > 0) {\n return countryOptions;\n }\n }\n}\nexport function isCountrySupportedWithError(country, metadata) {\n if (isSupportedCountry(country, metadata)) {\n return true;\n } else {\n console.error(\"Country not found: \".concat(country));\n return false;\n }\n}\nexport function getSupportedCountries(countries, metadata) {\n if (countries) {\n countries = countries.filter(function (country) {\n return isCountrySupportedWithError(country, metadata);\n });\n\n if (countries.length === 0) {\n countries = undefined;\n }\n }\n\n return countries;\n}\n//# sourceMappingURL=countries.js.map","import Metadata from './metadata';\nexport default function getCountries(metadata) {\n return new Metadata(metadata).getCountries();\n}\n//# sourceMappingURL=getCountries.js.map","import React from 'react';\nimport PropTypes from 'prop-types';\nimport classNames from 'classnames';\nimport DefaultInternationalIcon from './InternationalIcon';\nimport Flag from './Flag';\nexport function createCountryIconComponent(_ref) {\n var flags = _ref.flags,\n flagUrl = _ref.flagUrl,\n FlagComponent = _ref.flagComponent,\n InternationalIcon = _ref.internationalIcon;\n\n function CountryIcon(_ref2) {\n var country = _ref2.country,\n label = _ref2.label,\n aspectRatio = _ref2.aspectRatio;\n\n // `aspectRatio` is currently a hack for the default \"International\" icon\n // to render it as a square when Unicode flag icons are used.\n // So `aspectRatio` property is only used with the default \"International\" icon.\n var _aspectRatio = InternationalIcon === DefaultInternationalIcon ? aspectRatio : undefined;\n\n return React.createElement(\"div\", {\n className: classNames('PhoneInputCountryIcon', {\n 'PhoneInputCountryIcon--square': _aspectRatio === 1,\n 'PhoneInputCountryIcon--border': country\n })\n }, country ? React.createElement(FlagComponent, {\n country: country,\n countryName: label,\n flags: flags,\n flagUrl: flagUrl,\n className: \"PhoneInputCountryIconImg\"\n }) : React.createElement(InternationalIcon, {\n title: label,\n aspectRatio: _aspectRatio,\n className: \"PhoneInputCountryIconImg\"\n }));\n }\n\n CountryIcon.propTypes = {\n country: PropTypes.string,\n label: PropTypes.string.isRequired,\n aspectRatio: PropTypes.number\n };\n return CountryIcon;\n}\nexport default createCountryIconComponent({\n // Must be equal to `defaultProps.flagUrl` in `./PhoneInputWithCountry.js`.\n flagUrl: 'https://purecatamphetamine.github.io/country-flag-icons/3x2/{XX}.svg',\n flagComponent: Flag,\n internationalIcon: DefaultInternationalIcon\n});\n//# sourceMappingURL=CountryIcon.js.map","import { getCountryCallingCode, Metadata } from 'libphonenumber-js/core';\nvar ONLY_DIGITS_REGEXP = /^\\d+$/;\nexport default function getInternationalPhoneNumberPrefix(country, metadata) {\n // Standard international phone number prefix: \"+\" and \"country calling code\".\n var prefix = '+' + getCountryCallingCode(country, metadata); // Get \"leading digits\" for a phone number of the country.\n // If there're \"leading digits\" then they can be part of the prefix too.\n\n metadata = new Metadata(metadata);\n metadata.country(country);\n\n if (metadata.numberingPlan.leadingDigits() && ONLY_DIGITS_REGEXP.test(metadata.numberingPlan.leadingDigits())) {\n prefix += metadata.numberingPlan.leadingDigits();\n }\n\n return prefix;\n}\n//# sourceMappingURL=getInternationalPhoneNumberPrefix.js.map","import { parsePhoneNumberFromString, getCountryCallingCode, AsYouType, Metadata } from 'libphonenumber-js/core';\nimport getInternationalPhoneNumberPrefix from './getInternationalPhoneNumberPrefix';\n/**\r\n * Decides which country should be pre-selected\r\n * when the phone number input component is first mounted.\r\n * @param {object?} phoneNumber - An instance of `PhoneNumber` class.\r\n * @param {string?} country - Pre-defined country (two-letter code).\r\n * @param {string[]?} countries - A list of countries available.\r\n * @param {object} metadata - `libphonenumber-js` metadata\r\n * @return {string?}\r\n */\n\nexport function getPreSelectedCountry(_ref) {\n var value = _ref.value,\n phoneNumber = _ref.phoneNumber,\n defaultCountry = _ref.defaultCountry,\n getAnyCountry = _ref.getAnyCountry,\n countries = _ref.countries,\n required = _ref.required,\n metadata = _ref.metadata;\n var country; // If can get country from E.164 phone number\n // then it overrides the `country` passed (or not passed).\n\n if (phoneNumber && phoneNumber.country) {\n // `country` will be left `undefined` in case of non-detection.\n country = phoneNumber.country;\n } else if (defaultCountry) {\n if (!value || couldNumberBelongToCountry(value, defaultCountry, metadata)) {\n country = defaultCountry;\n }\n } // Only pre-select a country if it's in the available `countries` list.\n\n\n if (countries && countries.indexOf(country) < 0) {\n country = undefined;\n } // If there will be no \"International\" option\n // then some `country` must be selected.\n // It will still be the wrong country though.\n // But still country `` can't be left in a broken state.\n\n\n if (!country && required && countries && countries.length > 0) {\n country = getAnyCountry(); // noCountryMatchesTheNumber = true\n }\n\n return country;\n}\n/**\r\n * Generates a sorted list of country `` options.\r\n * @param {string[]} countries - A list of two-letter (\"ISO 3166-1 alpha-2\") country codes.\r\n * @param {object} labels - Custom country labels. E.g. `{ RU: 'Россия', US: 'США', ... }`.\r\n * @param {boolean} addInternationalOption - Whether should include \"International\" option at the top of the list.\r\n * @return {object[]} A list of objects having shape `{ value : string, label : string }`.\r\n */\n\nexport function getCountrySelectOptions(_ref2) {\n var countries = _ref2.countries,\n countryNames = _ref2.countryNames,\n addInternationalOption = _ref2.addInternationalOption,\n compareStringsLocales = _ref2.compareStringsLocales,\n _compareStrings = _ref2.compareStrings;\n\n // Default country name comparator uses `String.localeCompare()`.\n if (!_compareStrings) {\n _compareStrings = compareStrings;\n } // Generates a `` option for each country.\n\n\n var countrySelectOptions = countries.map(function (country) {\n return {\n value: country,\n // All `locale` country names included in this library\n // include all countries (this is checked at build time).\n // The only case when a country name might be missing\n // is when a developer supplies their own `labels` property.\n // To guard against such cases, a missing country name\n // is substituted by country code.\n label: countryNames[country] || country\n };\n }); // Sort the list of countries alphabetically.\n\n countrySelectOptions.sort(function (a, b) {\n return _compareStrings(a.label, b.label, compareStringsLocales);\n }); // Add the \"International\" option to the country list (if suitable)\n\n if (addInternationalOption) {\n countrySelectOptions.unshift({\n label: countryNames.ZZ\n });\n }\n\n return countrySelectOptions;\n}\n/**\r\n * Parses a E.164 phone number to an instance of `PhoneNumber` class.\r\n * @param {string?} value = E.164 phone number.\r\n * @param {object} metadata - `libphonenumber-js` metadata\r\n * @return {object} Object having shape `{ country: string?, countryCallingCode: string, number: string }`. `PhoneNumber`: https://gitlab.com/catamphetamine/libphonenumber-js#phonenumber.\r\n * @example\r\n * parsePhoneNumber('+78005553535')\r\n */\n\nexport function parsePhoneNumber(value, metadata) {\n return parsePhoneNumberFromString(value || '', metadata);\n}\n/**\r\n * Generates national number digits for a parsed phone.\r\n * May prepend national prefix.\r\n * The phone number must be a complete and valid phone number.\r\n * @param {object} phoneNumber - An instance of `PhoneNumber` class.\r\n * @param {object} metadata - `libphonenumber-js` metadata\r\n * @return {string}\r\n * @example\r\n * getNationalNumberDigits({ country: 'RU', phone: '8005553535' })\r\n * // returns '88005553535'\r\n */\n\nexport function generateNationalNumberDigits(phoneNumber) {\n return phoneNumber.formatNational().replace(/\\D/g, '');\n}\n/**\r\n * Migrates parsed `` `value` for the newly selected `country`.\r\n * @param {string?} phoneDigits - Phone number digits (and `+`) parsed from phone number `` (it's not the same as the `value` property).\r\n * @param {string?} prevCountry - Previously selected country.\r\n * @param {string?} newCountry - Newly selected country. Can't be same as previously selected country.\r\n * @param {object} metadata - `libphonenumber-js` metadata.\r\n * @param {boolean} useNationalFormat - whether should attempt to convert from international to national number for the new country.\r\n * @return {string?}\r\n */\n\nexport function getPhoneDigitsForNewCountry(phoneDigits, _ref3) {\n var prevCountry = _ref3.prevCountry,\n newCountry = _ref3.newCountry,\n metadata = _ref3.metadata,\n useNationalFormat = _ref3.useNationalFormat;\n\n // If `parsed_input` is empty\n // then no need to migrate anything.\n if (!phoneDigits) {\n if (useNationalFormat) {\n return '';\n } else {\n // If `phoneDigits` is empty then set `phoneDigits` to\n // `+{getCountryCallingCode(newCountry)}`.\n return getInternationalPhoneNumberPrefix(newCountry, metadata);\n }\n } // If switching to some country.\n // (from \"International\" or another country)\n // If switching from \"International\" then `phoneDigits` starts with a `+`.\n // Otherwise it may or may not start with a `+`.\n\n\n if (newCountry) {\n // If the phone number was entered in international format\n // then migrate it to the newly selected country.\n // The phone number may be incomplete.\n // The phone number entered not necessarily starts with\n // the previously selected country phone prefix.\n if (phoneDigits[0] === '+') {\n // If the international phone number is for the new country\n // then convert it to local if required.\n if (useNationalFormat) {\n // // If a phone number is being input in international form\n // // and the country can already be derived from it,\n // // and if it is the new country, then format as a national number.\n // const derived_country = getCountryFromPossiblyIncompleteInternationalPhoneNumber(phoneDigits, metadata)\n // if (derived_country === newCountry) {\n // \treturn stripCountryCallingCode(phoneDigits, derived_country, metadata)\n // }\n // Actually, the two countries don't necessarily need to match:\n // the condition could be looser here, because several countries\n // might share the same international phone number format\n // (for example, \"NANPA\" countries like US, Canada, etc).\n // The looser condition would be just \"same nternational phone number format\"\n // which would mean \"same country calling code\" in the context of `libphonenumber-js`.\n if (phoneDigits.indexOf('+' + getCountryCallingCode(newCountry, metadata)) === 0) {\n return stripCountryCallingCode(phoneDigits, newCountry, metadata);\n } // Simply discard the previously entered international phone number,\n // because otherwise any \"smart\" transformation like getting the\n // \"national (significant) number\" part and then prepending the\n // newly selected country's \"country calling code\" to it\n // would just be confusing for a user without being actually useful.\n\n\n return ''; // // Simply strip the leading `+` character\n // // therefore simply converting all digits into a \"local\" phone number.\n // // https://github.com/catamphetamine/react-phone-number-input/issues/287\n // return phoneDigits.slice(1)\n }\n\n if (prevCountry) {\n var newCountryPrefix = getInternationalPhoneNumberPrefix(newCountry, metadata);\n\n if (phoneDigits.indexOf(newCountryPrefix) === 0) {\n return phoneDigits;\n } else {\n return newCountryPrefix;\n }\n } else {\n var defaultValue = getInternationalPhoneNumberPrefix(newCountry, metadata); // If `phoneDigits`'s country calling code part is the same\n // as for the new `country`, then leave `phoneDigits` as is.\n\n if (phoneDigits.indexOf(defaultValue) === 0) {\n return phoneDigits;\n } // If `phoneDigits`'s country calling code part is not the same\n // as for the new `country`, then set `phoneDigits` to\n // `+{getCountryCallingCode(newCountry)}`.\n\n\n return defaultValue;\n } // // If the international phone number already contains\n // // any country calling code then trim the country calling code part.\n // // (that could also be the newly selected country phone code prefix as well)\n // // `phoneDigits` doesn't neccessarily belong to `prevCountry`.\n // // (e.g. if a user enters an international number\n // // not belonging to any of the reduced `countries` list).\n // phoneDigits = stripCountryCallingCode(phoneDigits, prevCountry, metadata)\n // // Prepend country calling code prefix\n // // for the newly selected country.\n // return e164(phoneDigits, newCountry, metadata) || `+${getCountryCallingCode(newCountry, metadata)}`\n\n }\n } // If switching to \"International\" from a country.\n else {\n // If the phone number was entered in national format.\n if (phoneDigits[0] !== '+') {\n // Format the national phone number as an international one.\n // The phone number entered not necessarily even starts with\n // the previously selected country phone prefix.\n // Even if the phone number belongs to whole another country\n // it will still be parsed into some national phone number.\n return e164(phoneDigits, prevCountry, metadata) || '';\n }\n }\n\n return phoneDigits;\n}\n/**\r\n * Converts phone number digits to a (possibly incomplete) E.164 phone number.\r\n * @param {string?} number - A possibly incomplete phone number digits string. Can be a possibly incomplete E.164 phone number.\r\n * @param {string?} country\r\n * @param {[object} metadata - `libphonenumber-js` metadata.\r\n * @return {string?}\r\n */\n\nexport function e164(number, country, metadata) {\n if (!number) {\n return;\n } // If the phone number is being input in international format.\n\n\n if (number[0] === '+') {\n // If it's just the `+` sign then return nothing.\n if (number === '+') {\n return;\n } // If there are any digits then the `value` is returned as is.\n\n\n return number;\n } // For non-international phone numbers\n // an accompanying country code is required.\n\n\n if (!country) {\n return;\n }\n\n var partial_national_significant_number = getNationalSignificantNumberDigits(number, country, metadata);\n\n if (partial_national_significant_number) {\n return \"+\".concat(getCountryCallingCode(country, metadata)).concat(partial_national_significant_number);\n }\n}\n/**\r\n * Trims phone number digits if they exceed the maximum possible length\r\n * for a national (significant) number for the country.\r\n * @param {string} number - A possibly incomplete phone number digits string. Can be a possibly incomplete E.164 phone number.\r\n * @param {string} country\r\n * @param {object} metadata - `libphonenumber-js` metadata.\r\n * @return {string} Can be empty.\r\n */\n\nexport function trimNumber(number, country, metadata) {\n var nationalSignificantNumberPart = getNationalSignificantNumberDigits(number, country, metadata);\n\n if (nationalSignificantNumberPart) {\n var overflowDigitsCount = nationalSignificantNumberPart.length - getMaxNumberLength(country, metadata);\n\n if (overflowDigitsCount > 0) {\n return number.slice(0, number.length - overflowDigitsCount);\n }\n }\n\n return number;\n}\n\nfunction getMaxNumberLength(country, metadata) {\n // Get \"possible lengths\" for a phone number of the country.\n metadata = new Metadata(metadata);\n metadata.country(country); // Return the last \"possible length\".\n\n return metadata.numberingPlan.possibleLengths()[metadata.numberingPlan.possibleLengths().length - 1];\n} // If the phone number being input is an international one\n// then tries to derive the country from the phone number.\n// (regardless of whether there's any country currently selected)\n\n/**\r\n * @param {string} partialE164Number - A possibly incomplete E.164 phone number.\r\n * @param {string?} country - Currently selected country.\r\n * @param {string[]?} countries - A list of available countries. If not passed then \"all countries\" are assumed.\r\n * @param {object} metadata - `libphonenumber-js` metadata.\r\n * @return {string?}\r\n */\n\n\nexport function getCountryForPartialE164Number(partialE164Number, _ref4) {\n var country = _ref4.country,\n countries = _ref4.countries,\n required = _ref4.required,\n metadata = _ref4.metadata;\n\n if (partialE164Number === '+') {\n // Don't change the currently selected country yet.\n return country;\n }\n\n var derived_country = getCountryFromPossiblyIncompleteInternationalPhoneNumber(partialE164Number, metadata); // If a phone number is being input in international form\n // and the country can already be derived from it,\n // then select that country.\n\n if (derived_country && (!countries || countries.indexOf(derived_country) >= 0)) {\n return derived_country;\n } // If \"International\" country option has not been disabled\n // and the international phone number entered doesn't correspond\n // to the currently selected country then reset the currently selected country.\n else if (country && !required && !couldNumberBelongToCountry(partialE164Number, country, metadata)) {\n return undefined;\n } // Don't change the currently selected country.\n\n\n return country;\n}\n/**\r\n * Parses `` value. Derives `country` from `input`. Derives an E.164 `value`.\r\n * @param {string?} phoneDigits — Parsed `` value. Examples: `\"\"`, `\"+\"`, `\"+123\"`, `\"123\"`.\r\n * @param {string?} prevPhoneDigits — Previous parsed `` value. Examples: `\"\"`, `\"+\"`, `\"+123\"`, `\"123\"`.\r\n * @param {string?} country - Currently selected country.\r\n * @param {boolean} countryRequired - Is selecting some country required.\r\n * @param {function} getAnyCountry - Can be used to get any country when selecting some country required.\r\n * @param {string[]?} countries - A list of available countries. If not passed then \"all countries\" are assumed.\r\n * @param {boolean} international - Set to `true` to force international phone number format (leading `+`). Set to `false` to force \"national\" phone number format. Is `undefined` by default.\r\n * @param {boolean} limitMaxLength — Whether to enable limiting phone number max length.\r\n * @param {object} metadata - `libphonenumber-js` metadata.\r\n * @return {object} An object of shape `{ input, country, value }`.\r\n */\n\nexport function onPhoneDigitsChange(phoneDigits, _ref5) {\n var prevPhoneDigits = _ref5.prevPhoneDigits,\n country = _ref5.country,\n defaultCountry = _ref5.defaultCountry,\n countryRequired = _ref5.countryRequired,\n getAnyCountry = _ref5.getAnyCountry,\n countries = _ref5.countries,\n international = _ref5.international,\n limitMaxLength = _ref5.limitMaxLength,\n countryCallingCodeEditable = _ref5.countryCallingCodeEditable,\n metadata = _ref5.metadata;\n\n if (international && countryCallingCodeEditable === false) {\n var prefix = getInternationalPhoneNumberPrefix(country, metadata); // The `` value must start with the country calling code.\n\n if (phoneDigits.indexOf(prefix) !== 0) {\n var _value; // If a phone number input is declared as\n // `international` and `withCountryCallingCode`,\n // then it's gonna be non-empty even before the user\n // has input anything in it.\n // This will result in its contents (the country calling code part)\n // being selected when the user tabs into such field.\n // If the user then starts inputting the national part digits,\n // then `` value changes from `+xxx` to `y`\n // because inputting anything while having the `` value\n // selected results in erasing the `` value\n // So, the component handles such case by restoring\n // the intended ``` value: `+xxxy`.\n // https://gitlab.com/catamphetamine/react-phone-number-input/-/issues/43\n\n\n if (phoneDigits && phoneDigits[0] !== '+') {\n phoneDigits = prefix + phoneDigits;\n _value = phoneDigits;\n } else {\n phoneDigits = prefix;\n }\n\n return {\n phoneDigits: phoneDigits,\n value: _value,\n country: country\n };\n }\n } // If `international` property is `false`, then it means\n // \"enforce national-only format during input\",\n // so, if that's the case, then remove all `+` characters,\n // but only if some country is currently selected.\n // (not if \"International\" country is selected).\n\n\n if (international === false && country && phoneDigits && phoneDigits[0] === '+') {\n phoneDigits = convertInternationalPhoneDigitsToNational(phoneDigits, country, metadata);\n } // Trim the input to not exceed the maximum possible number length.\n\n\n if (phoneDigits && country && limitMaxLength) {\n phoneDigits = trimNumber(phoneDigits, country, metadata);\n } // If this `onChange()` event was triggered\n // as a result of selecting \"International\" country,\n // then force-prepend a `+` sign if the phone number\n // `` value isn't in international format.\n // Also, force-prepend a `+` sign if international\n // phone number input format is set.\n\n\n if (phoneDigits && phoneDigits[0] !== '+' && (!country || international)) {\n phoneDigits = '+' + phoneDigits;\n } // If the previously entered phone number\n // has been entered in international format\n // and the user decides to erase it,\n // then also reset the `country`\n // because it was most likely automatically selected\n // while the user was typing in the phone number\n // in international format.\n // This fixes the issue when a user is presented\n // with a phone number input with no country selected\n // and then types in their local phone number\n // then discovers that the input's messed up\n // (a `+` has been prepended at the start of their input\n // and a random country has been selected),\n // decides to undo it all by erasing everything\n // and then types in their local phone number again\n // resulting in a seemingly correct phone number\n // but in reality that phone number has incorrect country.\n // https://github.com/catamphetamine/react-phone-number-input/issues/273\n\n\n if (!phoneDigits && prevPhoneDigits && prevPhoneDigits[0] === '+') {\n if (international) {\n country = undefined;\n } else {\n country = defaultCountry;\n }\n } // Also resets such \"randomly\" selected country\n // as soon as the user erases the number\n // digit-by-digit up to the leading `+` sign.\n\n\n if (phoneDigits === '+' && prevPhoneDigits && prevPhoneDigits[0] === '+' && prevPhoneDigits.length > '+'.length) {\n country = undefined;\n } // Generate the new `value` property.\n\n\n var value;\n\n if (phoneDigits) {\n if (phoneDigits[0] === '+') {\n if (phoneDigits === '+') {\n value = undefined;\n } else if (country && getInternationalPhoneNumberPrefix(country, metadata).indexOf(phoneDigits) === 0) {\n value = undefined;\n } else {\n value = phoneDigits;\n }\n } else {\n value = e164(phoneDigits, country, metadata);\n }\n } // Derive the country from the phone number.\n // (regardless of whether there's any country currently selected,\n // because there could be several countries corresponding to one country calling code)\n\n\n if (value) {\n country = getCountryForPartialE164Number(value, {\n country: country,\n countries: countries,\n metadata: metadata\n }); // If `international` property is `false`, then it means\n // \"enforce national-only format during input\",\n // so, if that's the case, then remove all `+` characters,\n // but only if some country is currently selected.\n // (not if \"International\" country is selected).\n\n if (international === false && country && phoneDigits && phoneDigits[0] === '+') {\n phoneDigits = convertInternationalPhoneDigitsToNational(phoneDigits, country, metadata); // Re-calculate `value` because `phoneDigits` has changed.\n\n value = e164(phoneDigits, country, metadata);\n }\n }\n\n if (!country && countryRequired) {\n country = defaultCountry || getAnyCountry();\n }\n\n return {\n phoneDigits: phoneDigits,\n country: country,\n value: value\n };\n}\n\nfunction convertInternationalPhoneDigitsToNational(input, country, metadata) {\n // Handle the case when a user might have pasted\n // a phone number in international format.\n if (input.indexOf(getInternationalPhoneNumberPrefix(country, metadata)) === 0) {\n // Create \"as you type\" formatter.\n var formatter = new AsYouType(country, metadata); // Input partial national phone number.\n\n formatter.input(input); // Return the parsed partial national phone number.\n\n var phoneNumber = formatter.getNumber();\n\n if (phoneNumber) {\n // Transform the number to a national one,\n // and remove all non-digits.\n return phoneNumber.formatNational().replace(/\\D/g, '');\n } else {\n return '';\n }\n } else {\n // Just remove the `+` sign.\n return input.replace(/\\D/g, '');\n }\n}\n/**\r\n * Determines the country for a given (possibly incomplete) E.164 phone number.\r\n * @param {string} number - A possibly incomplete E.164 phone number.\r\n * @param {object} metadata - `libphonenumber-js` metadata.\r\n * @return {string?}\r\n */\n\n\nexport function getCountryFromPossiblyIncompleteInternationalPhoneNumber(number, metadata) {\n var formatter = new AsYouType(null, metadata);\n formatter.input(number); // // `001` is a special \"non-geograpical entity\" code\n // // in Google's `libphonenumber` library.\n // if (formatter.getCountry() === '001') {\n // \treturn\n // }\n\n return formatter.getCountry();\n}\n/**\r\n * Compares two strings.\r\n * A helper for `Array.sort()`.\r\n * @param {string} a — First string.\r\n * @param {string} b — Second string.\r\n * @param {(string[]|string)} [locales] — The `locales` argument of `String.localeCompare`.\r\n */\n\nexport function compareStrings(a, b, locales) {\n // Use `String.localeCompare` if it's available.\n // https://developer.mozilla.org/ru/docs/Web/JavaScript/Reference/Global_Objects/String/localeCompare\n // Which means everyone except IE <= 10 and Safari <= 10.\n // `localeCompare()` is available in latest Node.js versions.\n\n /* istanbul ignore else */\n if (String.prototype.localeCompare) {\n return a.localeCompare(b, locales);\n }\n /* istanbul ignore next */\n\n\n return a < b ? -1 : a > b ? 1 : 0;\n}\n/**\r\n * Strips `+${countryCallingCode}` prefix from an E.164 phone number.\r\n * @param {string} number - (possibly incomplete) E.164 phone number.\r\n * @param {string?} country - A possible country for this phone number.\r\n * @param {object} metadata - `libphonenumber-js` metadata.\r\n * @return {string}\r\n */\n\nexport function stripCountryCallingCode(number, country, metadata) {\n // Just an optimization, so that it\n // doesn't have to iterate through all country calling codes.\n if (country) {\n var countryCallingCodePrefix = '+' + getCountryCallingCode(country, metadata); // If `country` fits the actual `number`.\n\n if (number.length < countryCallingCodePrefix.length) {\n if (countryCallingCodePrefix.indexOf(number) === 0) {\n return '';\n }\n } else {\n if (number.indexOf(countryCallingCodePrefix) === 0) {\n return number.slice(countryCallingCodePrefix.length);\n }\n }\n } // If `country` doesn't fit the actual `number`.\n // Try all available country calling codes.\n\n\n for (var _i = 0, _Object$keys = Object.keys(metadata.country_calling_codes); _i < _Object$keys.length; _i++) {\n var country_calling_code = _Object$keys[_i];\n\n if (number.indexOf(country_calling_code) === '+'.length) {\n return number.slice('+'.length + country_calling_code.length);\n }\n }\n\n return '';\n}\n/**\r\n * Parses a partially entered national phone number digits\r\n * (or a partially entered E.164 international phone number)\r\n * and returns the national significant number part.\r\n * National significant number returned doesn't come with a national prefix.\r\n * @param {string} number - National number digits. Or possibly incomplete E.164 phone number.\r\n * @param {string?} country\r\n * @param {object} metadata - `libphonenumber-js` metadata.\r\n * @return {string} [result]\r\n */\n\nexport function getNationalSignificantNumberDigits(number, country, metadata) {\n // Create \"as you type\" formatter.\n var formatter = new AsYouType(country, metadata); // Input partial national phone number.\n\n formatter.input(number); // Return the parsed partial national phone number.\n\n var phoneNumber = formatter.getNumber();\n return phoneNumber && phoneNumber.nationalNumber;\n}\n/**\r\n * Checks if a partially entered E.164 phone number could belong to a country.\r\n * @param {string} number\r\n * @param {string} country\r\n * @return {boolean}\r\n */\n\nexport function couldNumberBelongToCountry(number, country, metadata) {\n var intlPhoneNumberPrefix = getInternationalPhoneNumberPrefix(country, metadata);\n var i = 0;\n\n while (i < number.length && i < intlPhoneNumberPrefix.length) {\n if (number[i] !== intlPhoneNumberPrefix[i]) {\n return false;\n }\n\n i++;\n }\n\n return true;\n}\n/**\r\n * Gets initial \"phone digits\" (including `+`, if using international format).\r\n * @return {string} [phoneDigits] Returns `undefined` if there should be no initial \"phone digits\".\r\n */\n\nexport function getInitialPhoneDigits(_ref6) {\n var value = _ref6.value,\n phoneNumber = _ref6.phoneNumber,\n defaultCountry = _ref6.defaultCountry,\n international = _ref6.international,\n useNationalFormat = _ref6.useNationalFormat,\n metadata = _ref6.metadata;\n\n // If the `value` (E.164 phone number)\n // belongs to the currently selected country\n // and `useNationalFormat` is `true`\n // then convert `value` (E.164 phone number)\n // to a local phone number digits.\n // E.g. '+78005553535' -> '88005553535'.\n if ((international === false || useNationalFormat) && phoneNumber && phoneNumber.country) {\n return generateNationalNumberDigits(phoneNumber);\n } // If `international` property is `true`,\n // meaning \"enforce international phone number format\",\n // then always show country calling code in the input field.\n\n\n if (!value && international && defaultCountry) {\n return getInternationalPhoneNumberPrefix(defaultCountry, metadata);\n }\n\n return value;\n}\n//# sourceMappingURL=phoneInputHelpers.js.map","function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nimport { getInitialPhoneDigits, getCountryForPartialE164Number, parsePhoneNumber } from './phoneInputHelpers';\nimport { isCountrySupportedWithError, getSupportedCountries } from './countries';\nexport default function getPhoneInputWithCountryStateUpdateFromNewProps(props, prevProps, state) {\n var metadata = props.metadata,\n countries = props.countries,\n newDefaultCountry = props.defaultCountry,\n newValue = props.value,\n newReset = props.reset,\n international = props.international,\n displayInitialValueAsLocalNumber = props.displayInitialValueAsLocalNumber,\n initialValueFormat = props.initialValueFormat;\n var prevDefaultCountry = prevProps.defaultCountry,\n prevValue = prevProps.value,\n prevReset = prevProps.reset;\n var country = state.country,\n value = state.value,\n hasUserSelectedACountry = state.hasUserSelectedACountry;\n\n var _getInitialPhoneDigits = function _getInitialPhoneDigits(parameters) {\n return getInitialPhoneDigits(_objectSpread({}, parameters, {\n international: international,\n useNationalFormat: displayInitialValueAsLocalNumber || initialValueFormat === 'national',\n metadata: metadata\n }));\n }; // Some users requested a way to reset the component\n // (both number `` and country ``).\n // Whenever `reset` property changes both number ``\n // and country `` are reset.\n // It's not implemented as some instance `.reset()` method\n // because `ref` is forwarded to ``.\n // It's also not replaced with just resetting `country` on\n // external `value` reset, because a user could select a country\n // and then not input any `value`, and so the selected country\n // would be \"stuck\", if not using this `reset` property.\n // https://github.com/catamphetamine/react-phone-number-input/issues/300\n\n\n if (newReset !== prevReset) {\n return {\n phoneDigits: _getInitialPhoneDigits({\n value: undefined,\n defaultCountry: newDefaultCountry\n }),\n value: undefined,\n country: newDefaultCountry,\n hasUserSelectedACountry: undefined\n };\n } // `value` is the value currently shown in the component:\n // it's stored in the component's `state`, and it's not the `value` property.\n // `prevValue` is \"previous `value` property\".\n // `newValue` is \"new `value` property\".\n // If the default country changed\n // (e.g. in case of ajax GeoIP detection after page loaded)\n // then select it, but only if the user hasn't already manually\n // selected a country, and no phone number has been manually entered so far.\n // Because if the user has already started inputting a phone number\n // then they're okay with no country being selected at all (\"International\")\n // and they don't want to be disturbed, don't want their input to be screwed, etc.\n\n\n if (newDefaultCountry !== prevDefaultCountry) {\n var isNewDefaultCountrySupported = !newDefaultCountry || isCountrySupportedWithError(newDefaultCountry, metadata);\n\n var noValueHasBeenEnteredByTheUser = // By default, \"no value has been entered\" means `value` is `undefined`.\n !value || // When `international` is `true`, and some country has been pre-selected,\n // then the `` contains a pre-filled value of `+${countryCallingCode}${leadingDigits}`,\n // so in case of `international` being `true`, \"the user hasn't entered anything\" situation\n // doesn't just mean `value` is `undefined`, but could also mean `value` is `+${countryCallingCode}`.\n international && value === _getInitialPhoneDigits({\n value: undefined,\n defaultCountry: prevDefaultCountry\n }); // Only update the `defaultCountry` property if no phone number\n // has been entered by the user or pre-set by the application.\n\n\n var noValueHasBeenEntered = !newValue && noValueHasBeenEnteredByTheUser;\n\n if (!hasUserSelectedACountry && isNewDefaultCountrySupported && noValueHasBeenEntered) {\n return {\n country: newDefaultCountry,\n // If `phoneDigits` is empty, then automatically select the new `country`\n // and set `phoneDigits` to `+{getCountryCallingCode(newCountry)}`.\n // The code assumes that \"no phone number has been entered by the user\",\n // and no `value` property has been passed, so the `phoneNumber` parameter\n // of `_getInitialPhoneDigits({ value, phoneNumber, ... })` is `undefined`.\n phoneDigits: _getInitialPhoneDigits({\n value: undefined,\n defaultCountry: newDefaultCountry\n }),\n // `value` is `undefined` and it stays so.\n value: undefined\n };\n }\n } // If a new `value` is set externally.\n // (e.g. as a result of an ajax API request\n // to get user's phone after page loaded)\n // The first part — `newValue !== prevValue` —\n // is basically `props.value !== prevProps.value`\n // so it means \"if value property was changed externally\".\n // The second part — `newValue !== value` —\n // is for ignoring the `getDerivedStateFromProps()` call\n // which happens in `this.onChange()` right after `this.setState()`.\n // If this `getDerivedStateFromProps()` call isn't ignored\n // then the country flag would reset on each input.\n\n\n if (newValue !== prevValue && newValue !== value) {\n var phoneNumber;\n var parsedCountry;\n\n if (newValue) {\n phoneNumber = parsePhoneNumber(newValue, metadata);\n var supportedCountries = getSupportedCountries(countries, metadata);\n\n if (phoneNumber && phoneNumber.country) {\n // Ignore `else` because all countries are supported in metadata.\n\n /* istanbul ignore next */\n if (!supportedCountries || supportedCountries.indexOf(phoneNumber.country) >= 0) {\n parsedCountry = phoneNumber.country;\n }\n } else {\n parsedCountry = getCountryForPartialE164Number(newValue, {\n country: undefined,\n countries: supportedCountries,\n metadata: metadata\n });\n }\n }\n\n var hasUserSelectedACountryUpdate;\n\n if (!newValue) {\n // Reset `hasUserSelectedACountry` flag in `state`.\n hasUserSelectedACountryUpdate = {\n hasUserSelectedACountry: undefined\n };\n }\n\n return _objectSpread({}, hasUserSelectedACountryUpdate, {\n phoneDigits: _getInitialPhoneDigits({\n phoneNumber: phoneNumber,\n value: newValue,\n defaultCountry: newDefaultCountry\n }),\n value: newValue,\n country: newValue ? parsedCountry : newDefaultCountry\n });\n } // `defaultCountry` didn't change.\n // `value` didn't change.\n // `phoneDigits` didn't change, because `value` didn't change.\n //\n // So no need to update state.\n\n}\n//# sourceMappingURL=getPhoneInputWithCountryStateUpdateFromNewProps.js.map","function _typeof(obj) { if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\n\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nimport React from 'react';\nimport PropTypes from 'prop-types';\nimport classNames from 'classnames';\nimport InputSmart from './InputSmart';\nimport InputBasic from './InputBasic';\nimport Flag from './Flag';\nimport InternationalIcon from './InternationalIcon';\nimport { sortCountryOptions, isCountrySupportedWithError, getSupportedCountries, getSupportedCountryOptions, getCountries } from './helpers/countries';\nimport { createCountryIconComponent } from './CountryIcon';\nimport { metadata as metadataPropType, labels as labelsPropType } from './PropTypes';\nimport { getPreSelectedCountry, getCountrySelectOptions as _getCountrySelectOptions, parsePhoneNumber, generateNationalNumberDigits, getPhoneDigitsForNewCountry, getInitialPhoneDigits, onPhoneDigitsChange, e164 } from './helpers/phoneInputHelpers';\nimport getPhoneInputWithCountryStateUpdateFromNewProps from './helpers/getPhoneInputWithCountryStateUpdateFromNewProps';\n\nvar PhoneNumberInput_ =\n/*#__PURE__*/\nfunction (_React$PureComponent) {\n _inherits(PhoneNumberInput_, _React$PureComponent);\n\n function PhoneNumberInput_(props) {\n var _this;\n\n _classCallCheck(this, PhoneNumberInput_);\n\n _this = _possibleConstructorReturn(this, _getPrototypeOf(PhoneNumberInput_).call(this, props));\n\n _defineProperty(_assertThisInitialized(_this), \"inputRef\", React.createRef());\n\n _defineProperty(_assertThisInitialized(_this), \"setInputRef\", function (instance) {\n _this.inputRef.current = instance;\n var ref = _this.props.inputRef;\n\n if (ref) {\n if (typeof ref === 'function') {\n ref(instance);\n } else {\n ref.current = instance;\n }\n }\n });\n\n _defineProperty(_assertThisInitialized(_this), \"isCountrySupportedWithError\", function (country) {\n var metadata = _this.props.metadata;\n return isCountrySupportedWithError(country, metadata);\n });\n\n _defineProperty(_assertThisInitialized(_this), \"onCountryChange\", function (newCountry) {\n var _this$props = _this.props,\n international = _this$props.international,\n metadata = _this$props.metadata,\n onChange = _this$props.onChange,\n focusInputOnCountrySelection = _this$props.focusInputOnCountrySelection;\n var _this$state = _this.state,\n prevPhoneDigits = _this$state.phoneDigits,\n prevCountry = _this$state.country; // After the new `country` has been selected,\n // if the phone number `` holds any digits\n // then migrate those digits for the new `country`.\n\n var newPhoneDigits = getPhoneDigitsForNewCountry(prevPhoneDigits, {\n prevCountry: prevCountry,\n newCountry: newCountry,\n metadata: metadata,\n // Convert the phone number to \"national\" format\n // when the user changes the selected country by hand.\n useNationalFormat: !international\n });\n var newValue = e164(newPhoneDigits, newCountry, metadata); // Focus phone number `` upon country selection.\n\n if (focusInputOnCountrySelection) {\n _this.inputRef.current.focus();\n } // If the user has already manually selected a country\n // then don't override that already selected country\n // if the `defaultCountry` property changes.\n // That's what `hasUserSelectedACountry` flag is for.\n\n\n _this.setState({\n country: newCountry,\n hasUserSelectedACountry: true,\n phoneDigits: newPhoneDigits,\n value: newValue\n }, function () {\n // Update the new `value` property.\n // Doing it after the `state` has been updated\n // because `onChange()` will trigger `getDerivedStateFromProps()`\n // with the new `value` which will be compared to `state.value` there.\n onChange(newValue);\n });\n });\n\n _defineProperty(_assertThisInitialized(_this), \"onChange\", function (_phoneDigits) {\n var _this$props2 = _this.props,\n defaultCountry = _this$props2.defaultCountry,\n onChange = _this$props2.onChange,\n addInternationalOption = _this$props2.addInternationalOption,\n international = _this$props2.international,\n limitMaxLength = _this$props2.limitMaxLength,\n countryCallingCodeEditable = _this$props2.countryCallingCodeEditable,\n metadata = _this$props2.metadata;\n var _this$state2 = _this.state,\n countries = _this$state2.countries,\n prevPhoneDigits = _this$state2.phoneDigits,\n currentlySelectedCountry = _this$state2.country;\n\n var _onPhoneDigitsChange = onPhoneDigitsChange(_phoneDigits, {\n prevPhoneDigits: prevPhoneDigits,\n country: currentlySelectedCountry,\n countryRequired: !addInternationalOption,\n defaultCountry: defaultCountry,\n getAnyCountry: function getAnyCountry() {\n return _this.getFirstSupportedCountry({\n countries: countries\n });\n },\n countries: countries,\n international: international,\n limitMaxLength: limitMaxLength,\n countryCallingCodeEditable: countryCallingCodeEditable,\n metadata: metadata\n }),\n phoneDigits = _onPhoneDigitsChange.phoneDigits,\n country = _onPhoneDigitsChange.country,\n value = _onPhoneDigitsChange.value;\n\n var stateUpdate = {\n phoneDigits: phoneDigits,\n value: value,\n country: country\n };\n\n if (countryCallingCodeEditable === false) {\n // If it simply did `setState({ phoneDigits: intlPrefix })` here,\n // then it would have no effect when erasing an inital international prefix\n // via Backspace, because `phoneDigits` in `state` wouldn't change\n // as a result, because it was `prefix` and it became `prefix`,\n // so the component wouldn't rerender, and the user would be able\n // to erase the country calling code part, and that part is\n // assumed to be non-eraseable. That's why the component is\n // forcefully rerendered here.\n // https://github.com/catamphetamine/react-phone-number-input/issues/367#issuecomment-721703501\n if (!value && phoneDigits === _this.state.phoneDigits) {\n // Force a re-render of the `` in order to reset its value.\n stateUpdate.forceRerender = {};\n }\n }\n\n _this.setState(stateUpdate, // Update the new `value` property.\n // Doing it after the `state` has been updated\n // because `onChange()` will trigger `getDerivedStateFromProps()`\n // with the new `value` which will be compared to `state.value` there.\n function () {\n return onChange(value);\n });\n });\n\n _defineProperty(_assertThisInitialized(_this), \"_onFocus\", function () {\n return _this.setState({\n isFocused: true\n });\n });\n\n _defineProperty(_assertThisInitialized(_this), \"_onBlur\", function () {\n return _this.setState({\n isFocused: false\n });\n });\n\n _defineProperty(_assertThisInitialized(_this), \"onFocus\", function (event) {\n _this._onFocus();\n\n var onFocus = _this.props.onFocus;\n\n if (onFocus) {\n onFocus(event);\n }\n });\n\n _defineProperty(_assertThisInitialized(_this), \"onBlur\", function (event) {\n var onBlur = _this.props.onBlur;\n\n _this._onBlur();\n\n if (onBlur) {\n onBlur(event);\n }\n });\n\n _defineProperty(_assertThisInitialized(_this), \"onCountryFocus\", function (event) {\n _this._onFocus(); // this.setState({ countrySelectFocused: true })\n\n\n var countrySelectProps = _this.props.countrySelectProps;\n\n if (countrySelectProps) {\n var onFocus = countrySelectProps.onFocus;\n\n if (onFocus) {\n onFocus(event);\n }\n }\n });\n\n _defineProperty(_assertThisInitialized(_this), \"onCountryBlur\", function (event) {\n _this._onBlur(); // this.setState({ countrySelectFocused: false })\n\n\n var countrySelectProps = _this.props.countrySelectProps;\n\n if (countrySelectProps) {\n var onBlur = countrySelectProps.onBlur;\n\n if (onBlur) {\n onBlur(event);\n }\n }\n });\n\n var _this$props3 = _this.props,\n _value = _this$props3.value,\n labels = _this$props3.labels,\n _international = _this$props3.international,\n _addInternationalOption = _this$props3.addInternationalOption,\n displayInitialValueAsLocalNumber = _this$props3.displayInitialValueAsLocalNumber,\n initialValueFormat = _this$props3.initialValueFormat,\n _metadata = _this$props3.metadata;\n var _this$props4 = _this.props,\n _defaultCountry = _this$props4.defaultCountry,\n _countries = _this$props4.countries; // Validate `defaultCountry`.\n\n if (_defaultCountry) {\n if (!_this.isCountrySupportedWithError(_defaultCountry)) {\n _defaultCountry = undefined;\n }\n } // Validate `countries`.\n\n\n _countries = getSupportedCountries(_countries, _metadata);\n var phoneNumber = parsePhoneNumber(_value, _metadata);\n _this.CountryIcon = createCountryIconComponent(_this.props);\n var preSelectedCountry = getPreSelectedCountry({\n value: _value,\n phoneNumber: phoneNumber,\n defaultCountry: _defaultCountry,\n required: !_addInternationalOption,\n countries: _countries || getCountries(_metadata),\n getAnyCountry: function getAnyCountry() {\n return _this.getFirstSupportedCountry({\n countries: _countries\n });\n },\n metadata: _metadata\n });\n _this.state = {\n // Workaround for `this.props` inside `getDerivedStateFromProps()`.\n props: _this.props,\n // The country selected.\n country: preSelectedCountry,\n // `countries` are stored in `this.state` because they're filtered.\n // For example, a developer might theoretically pass some unsupported\n // countries as part of the `countries` property, and because of that\n // the component uses `this.state.countries` (which are filtered)\n // instead of `this.props.countries`\n // (which could potentially contain unsupported countries).\n countries: _countries,\n // `phoneDigits` state property holds non-formatted user's input.\n // The reason is that there's no way of finding out\n // in which form should `value` be displayed: international or national.\n // E.g. if `value` is `+78005553535` then it could be input\n // by a user both as `8 (800) 555-35-35` and `+7 800 555 35 35`.\n // Hence storing just `value` is not sufficient for correct formatting.\n // E.g. if a user entered `8 (800) 555-35-35`\n // then value is `+78005553535` and `phoneDigits` are `88005553535`\n // and if a user entered `+7 800 555 35 35`\n // then value is `+78005553535` and `phoneDigits` are `+78005553535`.\n phoneDigits: getInitialPhoneDigits({\n value: _value,\n phoneNumber: phoneNumber,\n defaultCountry: _defaultCountry,\n international: _international,\n useNationalFormat: displayInitialValueAsLocalNumber || initialValueFormat === 'national',\n metadata: _metadata\n }),\n // `value` property is duplicated in state.\n // The reason is that `getDerivedStateFromProps()`\n // needs this `value` to compare to the new `value` property\n // to find out if `phoneDigits` needs updating:\n // If the `value` property was changed externally\n // then it won't be equal to `state.value`\n // in which case `phoneDigits` and `country` should be updated.\n value: _value\n };\n return _this;\n }\n\n _createClass(PhoneNumberInput_, [{\n key: \"componentDidMount\",\n value: function componentDidMount() {\n var onCountryChange = this.props.onCountryChange;\n var defaultCountry = this.props.defaultCountry;\n var selectedCountry = this.state.country;\n\n if (onCountryChange) {\n if (defaultCountry) {\n if (!this.isCountrySupportedWithError(defaultCountry)) {\n defaultCountry = undefined;\n }\n }\n\n if (selectedCountry !== defaultCountry) {\n onCountryChange(selectedCountry);\n }\n }\n }\n }, {\n key: \"componentDidUpdate\",\n value: function componentDidUpdate(prevProps, prevState) {\n var onCountryChange = this.props.onCountryChange;\n var country = this.state.country; // Call `onCountryChange` when user selects another country.\n\n if (onCountryChange && country !== prevState.country) {\n onCountryChange(country);\n }\n }\n }, {\n key: \"getCountrySelectOptions\",\n value: function getCountrySelectOptions(_ref) {\n var countries = _ref.countries;\n var _this$props5 = this.props,\n international = _this$props5.international,\n countryCallingCodeEditable = _this$props5.countryCallingCodeEditable,\n countryOptionsOrder = _this$props5.countryOptionsOrder,\n addInternationalOption = _this$props5.addInternationalOption,\n labels = _this$props5.labels,\n locales = _this$props5.locales,\n metadata = _this$props5.metadata;\n return useMemoCountrySelectOptions(function () {\n return sortCountryOptions(_getCountrySelectOptions({\n countries: countries || getCountries(metadata),\n countryNames: labels,\n addInternationalOption: international && countryCallingCodeEditable === false ? false : addInternationalOption,\n compareStringsLocales: locales // compareStrings\n\n }), getSupportedCountryOptions(countryOptionsOrder, metadata));\n }, [countries, countryOptionsOrder, addInternationalOption, labels, metadata]);\n }\n }, {\n key: \"getFirstSupportedCountry\",\n value: function getFirstSupportedCountry(_ref2) {\n var countries = _ref2.countries;\n var countryOptions = this.getCountrySelectOptions({\n countries: countries\n });\n return countryOptions[0].value;\n } // A shorthand for not passing `metadata` as a second argument.\n\n }, {\n key: \"render\",\n value: function render() {\n var _this$props6 = this.props,\n name = _this$props6.name,\n disabled = _this$props6.disabled,\n autoComplete = _this$props6.autoComplete,\n style = _this$props6.style,\n className = _this$props6.className,\n inputRef = _this$props6.inputRef,\n inputComponent = _this$props6.inputComponent,\n numberInputProps = _this$props6.numberInputProps,\n smartCaret = _this$props6.smartCaret,\n CountrySelectComponent = _this$props6.countrySelectComponent,\n countrySelectProps = _this$props6.countrySelectProps,\n ContainerComponent = _this$props6.containerComponent,\n defaultCountry = _this$props6.defaultCountry,\n countriesProperty = _this$props6.countries,\n countryOptionsOrder = _this$props6.countryOptionsOrder,\n labels = _this$props6.labels,\n flags = _this$props6.flags,\n flagComponent = _this$props6.flagComponent,\n flagUrl = _this$props6.flagUrl,\n addInternationalOption = _this$props6.addInternationalOption,\n internationalIcon = _this$props6.internationalIcon,\n displayInitialValueAsLocalNumber = _this$props6.displayInitialValueAsLocalNumber,\n initialValueFormat = _this$props6.initialValueFormat,\n onCountryChange = _this$props6.onCountryChange,\n limitMaxLength = _this$props6.limitMaxLength,\n countryCallingCodeEditable = _this$props6.countryCallingCodeEditable,\n focusInputOnCountrySelection = _this$props6.focusInputOnCountrySelection,\n reset = _this$props6.reset,\n metadata = _this$props6.metadata,\n international = _this$props6.international,\n locales = _this$props6.locales,\n rest = _objectWithoutProperties(_this$props6, [\"name\", \"disabled\", \"autoComplete\", \"style\", \"className\", \"inputRef\", \"inputComponent\", \"numberInputProps\", \"smartCaret\", \"countrySelectComponent\", \"countrySelectProps\", \"containerComponent\", \"defaultCountry\", \"countries\", \"countryOptionsOrder\", \"labels\", \"flags\", \"flagComponent\", \"flagUrl\", \"addInternationalOption\", \"internationalIcon\", \"displayInitialValueAsLocalNumber\", \"initialValueFormat\", \"onCountryChange\", \"limitMaxLength\", \"countryCallingCodeEditable\", \"focusInputOnCountrySelection\", \"reset\", \"metadata\", \"international\", \"locales\"]);\n\n var _this$state3 = this.state,\n country = _this$state3.country,\n countries = _this$state3.countries,\n phoneDigits = _this$state3.phoneDigits,\n isFocused = _this$state3.isFocused;\n var InputComponent = smartCaret ? InputSmart : InputBasic;\n var countrySelectOptions = this.getCountrySelectOptions({\n countries: countries\n });\n return React.createElement(ContainerComponent, {\n style: style,\n className: classNames(className, 'PhoneInput', {\n 'PhoneInput--focus': isFocused\n })\n }, React.createElement(CountrySelectComponent, _extends({\n name: name ? \"\".concat(name, \"Country\") : undefined,\n \"aria-label\": labels.country\n }, countrySelectProps, {\n value: country,\n options: countrySelectOptions,\n onChange: this.onCountryChange,\n onFocus: this.onCountryFocus,\n onBlur: this.onCountryBlur,\n disabled: disabled || countrySelectProps && countrySelectProps.disabled,\n iconComponent: this.CountryIcon\n })), React.createElement(InputComponent, _extends({\n ref: this.setInputRef,\n type: \"tel\",\n autoComplete: autoComplete\n }, numberInputProps, rest, {\n name: name,\n metadata: metadata,\n country: country,\n value: phoneDigits || '',\n onChange: this.onChange,\n onFocus: this.onFocus,\n onBlur: this.onBlur,\n disabled: disabled,\n inputComponent: inputComponent,\n className: classNames('PhoneInputInput', numberInputProps && numberInputProps.className, rest.className)\n })));\n }\n }], [{\n key: \"getDerivedStateFromProps\",\n // `state` holds previous props as `props`, and also:\n // * `country` — The currently selected country, e.g. `\"RU\"`.\n // * `value` — The currently entered phone number (E.164), e.g. `+78005553535`.\n // * `phoneDigits` — The parsed `` value, e.g. `8005553535`.\n // (and a couple of other less significant properties)\n value: function getDerivedStateFromProps(props, state) {\n return _objectSpread({\n // Emulate `prevProps` via `state.props`.\n props: props\n }, getPhoneInputWithCountryStateUpdateFromNewProps(props, state.props, state));\n }\n }]);\n\n return PhoneNumberInput_;\n}(React.PureComponent); // This wrapper is only to `.forwardRef()` to the ``.\n\n\nvar PhoneNumberInput = React.forwardRef(function (props, ref) {\n return React.createElement(PhoneNumberInput_, _extends({}, props, {\n inputRef: ref\n }));\n});\nPhoneNumberInput.propTypes = {\n /**\r\n * Phone number in `E.164` format.\r\n *\r\n * Example:\r\n *\r\n * `\"+12223333333\"`\r\n */\n value: PropTypes.string,\n\n /**\r\n * Updates the `value` as the user inputs the phone number.\r\n */\n onChange: PropTypes.func.isRequired,\n\n /**\r\n * Toggles the `--focus` CSS class.\r\n * @ignore\r\n */\n onFocus: PropTypes.func,\n\n /**\r\n * `onBlur` is usually passed by `redux-form`.\r\n * @ignore\r\n */\n onBlur: PropTypes.func,\n\n /**\r\n * `onKeyDown` handler (e.g. to handle Enter key press).\r\n * @ignore\r\n */\n onKeyDown: PropTypes.func,\n\n /**\r\n * Set to `true` to disable both the phone number ``\r\n * and the country ``.\r\n */\n disabled: PropTypes.bool,\n\n /**\r\n * Sets `autoComplete` property for phone number ``.\r\n *\r\n * Web browser's \"autocomplete\" feature\r\n * remembers the phone number being input\r\n * and can also autofill the ``\r\n * with previously remembered phone numbers.\r\n *\r\n * https://developers.google.com\r\n * /web/updates/2015/06/checkout-faster-with-autofill\r\n *\r\n * For example, can be used to turn it off:\r\n *\r\n * \"So when should you use `autocomplete=\"off\"`?\r\n * One example is when you've implemented your own version\r\n * of autocomplete for search. Another example is any form field\r\n * where users will input and submit different kinds of information\r\n * where it would not be useful to have the browser remember\r\n * what was submitted previously\".\r\n */\n // (is `\"tel\"` by default)\n autoComplete: PropTypes.string.isRequired,\n\n /**\r\n * Set to `\"national\"` to show the initial `value` in\r\n * \"national\" format rather than \"international\".\r\n *\r\n * For example, if `initialValueFormat` is `\"national\"`\r\n * and the initial `value=\"+12133734253\"` is passed\r\n * then the `` value will be `\"(213) 373-4253\"`.\r\n *\r\n * By default, `initialValueFormat` is `undefined`,\r\n * meaning that if the initial `value=\"+12133734253\"` is passed\r\n * then the `` value will be `\"+1 213 373 4253\"`.\r\n *\r\n * The reason for such default behaviour is that\r\n * the newer generation grows up when there are no stationary phones\r\n * and therefore everyone inputs phone numbers in international format\r\n * in their smartphones so people gradually get more accustomed to\r\n * writing phone numbers in international format rather than in local format.\r\n * Future people won't be using \"national\" format, only \"international\".\r\n */\n // (is `undefined` by default)\n initialValueFormat: PropTypes.oneOf(['national']),\n // `displayInitialValueAsLocalNumber` property has been\n // superceded by `initialValueFormat` property.\n displayInitialValueAsLocalNumber: PropTypes.bool,\n\n /**\r\n * The country to be selected by default.\r\n * For example, can be set after a GeoIP lookup.\r\n *\r\n * Example: `\"US\"`.\r\n */\n // A two-letter country code (\"ISO 3166-1 alpha-2\").\n defaultCountry: PropTypes.string,\n\n /**\r\n * If specified, only these countries will be available for selection.\r\n *\r\n * Example:\r\n *\r\n * `[\"RU\", \"UA\", \"KZ\"]`\r\n */\n countries: PropTypes.arrayOf(PropTypes.string),\n\n /**\r\n * Custom country `` option names.\r\n * Also some labels like \"ext\" and country `` `aria-label`.\r\n *\r\n * Example:\r\n *\r\n * `{ \"ZZ\": \"Международный\", RU: \"Россия\", US: \"США\", ... }`\r\n *\r\n * See the `locales` directory for examples.\r\n */\n labels: labelsPropType.isRequired,\n\n /**\r\n * Country `` options are sorted by their labels.\r\n * The default sorting function uses `a.localeCompare(b, locales)`,\r\n * and, if that's not available, falls back to simple `a > b` / `a < b`.\r\n * Some languages, like Chinese, support multiple sorting variants\r\n * (called \"collations\"), and the user might prefer one or another.\r\n * Also, sometimes the Operating System language is not always\r\n * the preferred language for a person using a website or an application,\r\n * so there should be a way to specify custom locale.\r\n * This `locales` property mimicks the `locales` argument of `Intl` constructors,\r\n * and can be either a Unicode BCP 47 locale identifier or an array of such locale identifiers.\r\n * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl#locales_argument\r\n */\n locales: PropTypes.oneOfType([PropTypes.string, PropTypes.arrayOf(PropTypes.string)]),\n\n /*\r\n * Custom country `` options sorting function.\r\n * The default one uses `a.localeCompare(b)`, and,\r\n * if that's not available, falls back to simple `a > b`/`a < b`.\r\n * There have been requests to add custom sorter for cases\r\n * like Chinese language and \"pinyin\" (non-default) sorting order.\r\n * https://stackoverflow.com/questions/22907288/chinese-sorting-by-pinyin-in-javascript-with-localecompare\r\n compareStrings: PropTypes.func,\r\n */\n\n /**\r\n * A URL template of a country flag, where\r\n * \"{XX}\" is a two-letter country code in upper case,\r\n * or where \"{xx}\" is a two-letter country code in lower case.\r\n * By default it points to `country-flag-icons` gitlab pages website.\r\n * I imagine someone might want to download those country flag icons\r\n * and host them on their own servers instead\r\n * (all flags are available in the `country-flag-icons` library).\r\n * There's a catch though: new countries may be added in future,\r\n * so when hosting country flag icons on your own server\r\n * one should check the `CHANGELOG.md` every time before updating this library,\r\n * otherwise there's a possibility that some new country flag would be missing.\r\n */\n flagUrl: PropTypes.string.isRequired,\n\n /**\r\n * Custom country flag icon components.\r\n * These flags will be used instead of the default ones.\r\n * The the \"Flags\" section of the readme for more info.\r\n *\r\n * The shape is an object where keys are country codes\r\n * and values are flag icon components.\r\n * Flag icon components receive the same properties\r\n * as `flagComponent` (see below).\r\n *\r\n * Example:\r\n *\r\n * `{ \"RU\": (props) => }`\r\n *\r\n * Example:\r\n *\r\n * `import flags from 'country-flag-icons/react/3x2'`\r\n *\r\n * `import PhoneInput from 'react-phone-number-input'`\r\n *\r\n * ``\r\n */\n flags: PropTypes.objectOf(PropTypes.elementType),\n\n /**\r\n * Country flag icon component.\r\n *\r\n * Takes properties:\r\n *\r\n * * `country: string` — The country code.\r\n * * `countryName: string` — The country name.\r\n * * `flagUrl: string` — The `flagUrl` property (see above).\r\n * * `flags: object` — The `flags` property (see above).\r\n */\n flagComponent: PropTypes.elementType.isRequired,\n\n /**\r\n * Set to `false` to remove the \"International\" option from country ``.\r\n */\n addInternationalOption: PropTypes.bool.isRequired,\n\n /**\r\n * \"International\" icon component.\r\n * Should have the same aspect ratio.\r\n *\r\n * Receives properties:\r\n *\r\n * * `title: string` — \"International\" country option label.\r\n */\n internationalIcon: PropTypes.elementType.isRequired,\n\n /**\r\n * Can be used to place some countries on top of the list of country `` options.\r\n *\r\n * * `\"XX\"` — inserts an option for \"XX\" country.\r\n * * `\"🌐\"` — inserts \"International\" option.\r\n * * `\"|\"` — inserts a separator.\r\n * * `\"...\"` — inserts options for the rest of the countries (can be omitted, in which case it will be automatically added at the end).\r\n *\r\n * Example:\r\n *\r\n * `[\"US\", \"CA\", \"AU\", \"|\", \"...\"]`\r\n */\n countryOptionsOrder: PropTypes.arrayOf(PropTypes.string),\n\n /**\r\n * `` component CSS style object.\r\n */\n style: PropTypes.object,\n\n /**\r\n * `` component CSS class.\r\n */\n className: PropTypes.string,\n\n /**\r\n * Country `` component.\r\n *\r\n * Receives properties:\r\n *\r\n * * `name: string?` — HTML `name` attribute.\r\n * * `value: string?` — The currently selected country code.\r\n * * `onChange(value: string?)` — Updates the `value`.\r\n * * `onFocus()` — Is used to toggle the `--focus` CSS class.\r\n * * `onBlur()` — Is used to toggle the `--focus` CSS class.\r\n * * `options: object[]` — The list of all selectable countries (including \"International\") each being an object of shape `{ value: string?, label: string }`.\r\n * * `iconComponent: PropTypes.elementType` — React component that renders a country icon: ``. If `country` is `undefined` then it renders an \"International\" icon.\r\n * * `disabled: boolean?` — HTML `disabled` attribute.\r\n * * `tabIndex: (number|string)?` — HTML `tabIndex` attribute.\r\n * * `className: string` — CSS class name.\r\n */\n countrySelectComponent: PropTypes.elementType.isRequired,\n\n /**\r\n * Country `` component props.\r\n * Along with the usual DOM properties such as `aria-label` and `tabIndex`,\r\n * some custom properties are supported, such as `arrowComponent` and `unicodeFlags`.\r\n */\n countrySelectProps: PropTypes.object,\n\n /**\r\n * Phone number `` component.\r\n *\r\n * Receives properties:\r\n *\r\n * * `value: string` — The formatted `value`.\r\n * * `onChange(event: Event)` — Updates the formatted `value` from `event.target.value`.\r\n * * `onFocus()` — Is used to toggle the `--focus` CSS class.\r\n * * `onBlur()` — Is used to toggle the `--focus` CSS class.\r\n * * Other properties like `type=\"tel\"` or `autoComplete=\"tel\"` that should be passed through to the DOM ``.\r\n *\r\n * Must also either use `React.forwardRef()` to \"forward\" `ref` to the `` or implement `.focus()` method.\r\n */\n inputComponent: PropTypes.elementType.isRequired,\n\n /**\r\n * Wrapping `` component.\r\n *\r\n * Receives properties:\r\n *\r\n * * `style: object` — A component CSS style object.\r\n * * `className: string` — Classes to attach to the component, typically changes when component focuses or blurs.\r\n */\n containerComponent: PropTypes.elementType.isRequired,\n\n /**\r\n * Phone number `` component props.\r\n */\n numberInputProps: PropTypes.object,\n\n /**\r\n * By default, the caret position is being \"intelligently\" managed\r\n * while a user inputs a phone number.\r\n * This \"smart\" caret behavior can be turned off\r\n * by passing `smartCaret={false}` property.\r\n * This is just an \"escape hatch\" for any possible caret position issues.\r\n */\n // Is `true` by default.\n smartCaret: PropTypes.bool.isRequired,\n\n /**\r\n * Set to `true` to force \"international\" phone number format.\r\n * Set to `false` to force \"national\" phone number format.\r\n * By default it's `undefined` meaning that it doesn't enforce any phone number format.\r\n */\n international: PropTypes.bool,\n\n /**\r\n * If set to `true`, the phone number input will get trimmed\r\n * if it exceeds the maximum length for the country.\r\n */\n limitMaxLength: PropTypes.bool.isRequired,\n\n /**\r\n * If set to `false`, and `international` is `true`, then\r\n * users won't be able to erase the \"country calling part\"\r\n * of a phone number in the ``.\r\n */\n countryCallingCodeEditable: PropTypes.bool.isRequired,\n\n /**\r\n * `libphonenumber-js` metadata.\r\n *\r\n * Can be used to pass custom `libphonenumber-js` metadata\r\n * to reduce the overall bundle size for those who compile \"custom\" metadata.\r\n */\n metadata: metadataPropType.isRequired,\n\n /**\r\n * Is called every time the selected country changes:\r\n * either programmatically or when user selects it manually from the list.\r\n */\n // People have been asking for a way to get the selected country.\n // @see https://github.com/catamphetamine/react-phone-number-input/issues/128\n // For some it's just a \"business requirement\".\n // I guess it's about gathering as much info on the user as a website can\n // without introducing any addional fields that would complicate the form\n // therefore reducing \"conversion\" (that's a marketing term).\n // Assuming that the phone number's country is the user's country\n // is not 100% correct but in most cases I guess it's valid.\n onCountryChange: PropTypes.func,\n\n /**\r\n * If set to `false`, will not focus the `` component\r\n * when the user selects a country from the list of countries.\r\n * This can be used to conform to the Web Content Accessibility Guidelines (WCAG).\r\n * Quote:\r\n * \"On input: Changing the setting of any user interface component\r\n * does not automatically cause a change of context unless the user\r\n * has been advised of the behaviour before using the component.\"\r\n */\n focusInputOnCountrySelection: PropTypes.bool.isRequired\n};\nPhoneNumberInput.defaultProps = {\n /**\r\n * Remember (and autofill) the value as a phone number.\r\n */\n autoComplete: 'tel',\n\n /**\r\n * Flag icon component.\r\n */\n flagComponent: Flag,\n\n /**\r\n * By default, uses icons from `country-flag-icons` gitlab pages website.\r\n */\n // Must be equal to `flagUrl` in `./CountryIcon.js`.\n flagUrl: 'https://purecatamphetamine.github.io/country-flag-icons/3x2/{XX}.svg',\n\n /**\r\n * Default \"International\" country `` option icon.\r\n */\n internationalIcon: InternationalIcon,\n\n /**\r\n * Phone number `` component.\r\n */\n inputComponent: 'input',\n\n /**\r\n * Wrapping `` component.\r\n */\n containerComponent: 'div',\n\n /**\r\n * Some users requested a way to reset the component:\r\n * both number `` and country ``.\r\n * Whenever `reset` property changes both number ``\r\n * and country `` are reset.\r\n * It's not implemented as some instance `.reset()` method\r\n * because `ref` is forwarded to ``.\r\n * It's also not replaced with just resetting `country` on\r\n * external `value` reset, because a user could select a country\r\n * and then not input any `value`, and so the selected country\r\n * would be \"stuck\", if not using this `reset` property.\r\n */\n // https://github.com/catamphetamine/react-phone-number-input/issues/300\n reset: PropTypes.any,\n\n /**\r\n *\r\n */\n\n /**\r\n * Set to `false` to use \"basic\" caret instead of the \"smart\" one.\r\n */\n smartCaret: true,\n\n /**\r\n * Whether to add the \"International\" option\r\n * to the list of countries.\r\n */\n addInternationalOption: true,\n\n /**\r\n * If set to `true` the phone number input will get trimmed\r\n * if it exceeds the maximum length for the country.\r\n */\n limitMaxLength: false,\n\n /**\r\n * If set to `false`, and `international` is `true`, then\r\n * users won't be able to erase the \"country calling part\"\r\n * of a phone number in the ``.\r\n */\n countryCallingCodeEditable: true,\n\n /**\r\n * If set to `false`, will not focus the `` component\r\n * when the user selects a country from the list of countries.\r\n * This can be used to conform to the Web Content Accessibility Guidelines (WCAG).\r\n * Quote:\r\n * \"On input: Changing the setting of any user interface component\r\n * does not automatically cause a change of context unless the user\r\n * has been advised of the behaviour before using the component.\"\r\n */\n focusInputOnCountrySelection: true\n};\nexport default PhoneNumberInput;\nvar countrySelectOptionsMemo;\nvar countrySelectOptionsMemoDependencies;\n\nfunction useMemoCountrySelectOptions(generator, dependencies) {\n if (!countrySelectOptionsMemoDependencies || !areEqualArrays(dependencies, countrySelectOptionsMemoDependencies)) {\n countrySelectOptionsMemo = generator();\n countrySelectOptionsMemoDependencies = dependencies;\n }\n\n return countrySelectOptionsMemo;\n}\n\nfunction areEqualArrays(a, b) {\n if (a.length !== b.length) {\n return false;\n }\n\n var i = 0;\n\n while (i < a.length) {\n if (a[i] !== b[i]) {\n return false;\n }\n\n i++;\n }\n\n return true;\n}\n//# sourceMappingURL=PhoneInputWithCountry.js.map","function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\n\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\n\nimport React, { useCallback, useMemo } from 'react';\nimport PropTypes from 'prop-types';\nimport classNames from 'classnames';\nimport getUnicodeFlagIcon from 'country-flag-icons/unicode';\nexport default function CountrySelect(_ref) {\n var value = _ref.value,\n onChange = _ref.onChange,\n options = _ref.options,\n rest = _objectWithoutProperties(_ref, [\"value\", \"onChange\", \"options\"]);\n\n var onChange_ = useCallback(function (event) {\n var value = event.target.value;\n onChange(value === 'ZZ' ? undefined : value);\n }, [onChange]);\n var selectedOption = useMemo(function () {\n return getSelectedOption(options, value);\n }, [options, value]); // \"ZZ\" means \"International\".\n // (HTML requires each `` have some string `value`).\n\n return React.createElement(\"select\", _extends({}, rest, {\n value: value || 'ZZ',\n onChange: onChange_\n }), options.map(function (_ref2) {\n var value = _ref2.value,\n label = _ref2.label,\n divider = _ref2.divider;\n return React.createElement(\"option\", {\n key: divider ? '|' : value || 'ZZ',\n value: divider ? '|' : value || 'ZZ',\n disabled: divider ? true : false,\n style: divider ? DIVIDER_STYLE : undefined\n }, label);\n }));\n}\nCountrySelect.propTypes = {\n /**\r\n * A two-letter country code.\r\n * Example: \"US\", \"RU\", etc.\r\n */\n value: PropTypes.string,\n\n /**\r\n * Updates the `value`.\r\n */\n onChange: PropTypes.func.isRequired,\n // `` options.\n options: PropTypes.arrayOf(PropTypes.shape({\n value: PropTypes.string,\n label: PropTypes.string,\n divider: PropTypes.bool\n })).isRequired\n};\nvar DIVIDER_STYLE = {\n fontSize: '1px',\n backgroundColor: 'currentColor',\n color: 'inherit'\n};\nexport function CountrySelectWithIcon(_ref3) {\n var value = _ref3.value,\n options = _ref3.options,\n className = _ref3.className,\n Icon = _ref3.iconComponent,\n getIconAspectRatio = _ref3.getIconAspectRatio,\n Arrow = _ref3.arrowComponent,\n unicodeFlags = _ref3.unicodeFlags,\n rest = _objectWithoutProperties(_ref3, [\"value\", \"options\", \"className\", \"iconComponent\", \"getIconAspectRatio\", \"arrowComponent\", \"unicodeFlags\"]);\n\n var selectedOption = useMemo(function () {\n return getSelectedOption(options, value);\n }, [options, value]);\n return React.createElement(\"div\", {\n className: \"PhoneInputCountry\"\n }, React.createElement(CountrySelect, _extends({}, rest, {\n value: value,\n options: options,\n className: classNames('PhoneInputCountrySelect', className)\n })), unicodeFlags && value && React.createElement(\"div\", {\n className: \"PhoneInputCountryIconUnicode\"\n }, getUnicodeFlagIcon(value)), !(unicodeFlags && value) && React.createElement(Icon, {\n country: value,\n label: selectedOption && selectedOption.label,\n aspectRatio: unicodeFlags ? 1 : undefined\n }), React.createElement(Arrow, null));\n}\nCountrySelectWithIcon.propTypes = {\n // Country flag component.\n iconComponent: PropTypes.elementType,\n // Select arrow component.\n arrowComponent: PropTypes.elementType.isRequired,\n // Set to `true` to render Unicode flag icons instead of SVG images.\n unicodeFlags: PropTypes.bool\n};\nCountrySelectWithIcon.defaultProps = {\n // Is \"International\" icon square?\n arrowComponent: function arrowComponent() {\n return React.createElement(\"div\", {\n className: \"PhoneInputCountrySelectArrow\"\n });\n }\n};\n\nfunction getSelectedOption(options, value) {\n for (var _iterator = options, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {\n var _ref4;\n\n if (_isArray) {\n if (_i >= _iterator.length) break;\n _ref4 = _iterator[_i++];\n } else {\n _i = _iterator.next();\n if (_i.done) break;\n _ref4 = _i.value;\n }\n\n var option = _ref4;\n\n if (!option.divider && option.value === value) {\n return option;\n }\n }\n}\n//# sourceMappingURL=CountrySelect.js.map","function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n\nimport React from 'react';\nimport PropTypes from 'prop-types';\nimport labels from '../locale/en.json';\nimport { metadata as metadataPropType, labels as labelsPropType } from './PropTypes';\nimport PhoneInput from './PhoneInputWithCountry';\nimport { CountrySelectWithIcon as CountrySelect } from './CountrySelect';\nexport function createPhoneInput(defaultMetadata) {\n var PhoneInputDefault = React.forwardRef(function (props, ref) {\n return React.createElement(PhoneInput, _extends({\n ref: ref\n }, props));\n });\n PhoneInputDefault.propTypes = {\n metadata: metadataPropType.isRequired,\n labels: labelsPropType.isRequired,\n countrySelectComponent: PropTypes.elementType.isRequired\n };\n PhoneInputDefault.defaultProps = {\n metadata: defaultMetadata,\n labels: labels,\n countrySelectComponent: CountrySelect\n };\n return PhoneInputDefault;\n}\nexport default createPhoneInput();\n//# sourceMappingURL=PhoneInputWithCountryDefault.js.map","import metadata from 'libphonenumber-js/metadata.min.json'\r\n\r\nimport {\r\n\tparsePhoneNumber as _parsePhoneNumber,\r\n\tformatPhoneNumber as _formatPhoneNumber,\r\n\tformatPhoneNumberIntl as _formatPhoneNumberIntl,\r\n\tisValidPhoneNumber as _isValidPhoneNumber,\r\n\tisPossiblePhoneNumber as _isPossiblePhoneNumber,\r\n\tgetCountries as _getCountries,\r\n\tgetCountryCallingCode as _getCountryCallingCode,\r\n\tisSupportedCountry as _isSupportedCountry\r\n} from '../core/index'\r\n\r\nimport { createPhoneInput } from '../modules/PhoneInputWithCountryDefault'\r\n\r\nfunction call(func, _arguments) {\r\n\tvar args = Array.prototype.slice.call(_arguments)\r\n\targs.push(metadata)\r\n\treturn func.apply(this, args)\r\n}\r\n\r\nexport default createPhoneInput(metadata)\r\n\r\nexport function parsePhoneNumber() {\r\n\treturn call(_parsePhoneNumber, arguments)\r\n}\r\n\r\nexport function formatPhoneNumber() {\r\n\treturn call(_formatPhoneNumber, arguments)\r\n}\r\n\r\nexport function formatPhoneNumberIntl() {\r\n\treturn call(_formatPhoneNumberIntl, arguments)\r\n}\r\n\r\nexport function isValidPhoneNumber() {\r\n\treturn call(_isValidPhoneNumber, arguments)\r\n}\r\n\r\nexport function isPossiblePhoneNumber() {\r\n\treturn call(_isPossiblePhoneNumber, arguments)\r\n}\r\n\r\nexport function getCountries() {\r\n\treturn call(_getCountries, arguments)\r\n}\r\n\r\nexport function getCountryCallingCode() {\r\n\treturn call(_getCountryCallingCode, arguments)\r\n}\r\n\r\nexport function isSupportedCountry() {\r\n\treturn call(_isSupportedCountry, arguments)\r\n}","// Imports\nvar ___CSS_LOADER_API_IMPORT___ = require(\"../../../../../../../css-loader/dist/runtime/api.js\");\nexports = ___CSS_LOADER_API_IMPORT___(true);\n// Module\nexports.push([module.id, \"#portal .PhoneNumberInput-module--wrapper__2S5Mm,#root .PhoneNumberInput-module--wrapper__2S5Mm,#app .PhoneNumberInput-module--wrapper__2S5Mm{background:#fff}#portal .PhoneNumberInput-module--wrapper__2S5Mm.PhoneNumberInput-module--invalid__1T3cy .PhoneInput,#root .PhoneNumberInput-module--wrapper__2S5Mm.PhoneNumberInput-module--invalid__1T3cy .PhoneInput,#app .PhoneNumberInput-module--wrapper__2S5Mm.PhoneNumberInput-module--invalid__1T3cy .PhoneInput{border-color:#f20074}#portal .PhoneNumberInput-module--wrapper__2S5Mm.PhoneNumberInput-module--valid__yTfoR .PhoneInput,#root .PhoneNumberInput-module--wrapper__2S5Mm.PhoneNumberInput-module--valid__yTfoR .PhoneInput,#app .PhoneNumberInput-module--wrapper__2S5Mm.PhoneNumberInput-module--valid__yTfoR .PhoneInput{border-color:#1f313a}#portal .PhoneNumberInput-module--wrapper__2S5Mm .PhoneInput,#root .PhoneNumberInput-module--wrapper__2S5Mm .PhoneInput,#app .PhoneNumberInput-module--wrapper__2S5Mm .PhoneInput{border:1px solid #1f313a;box-sizing:border-box;height:48px;padding:8px;display:flex;align-items:center}#portal .PhoneNumberInput-module--wrapper__2S5Mm .PhoneInputInput,#root .PhoneNumberInput-module--wrapper__2S5Mm .PhoneInputInput,#app .PhoneNumberInput-module--wrapper__2S5Mm .PhoneInputInput{border:0;padding:0 0 0 8px;flex:1;min-width:0}#portal .PhoneNumberInput-module--wrapper__2S5Mm .PhoneInputCountry,#root .PhoneNumberInput-module--wrapper__2S5Mm .PhoneInputCountry,#app .PhoneNumberInput-module--wrapper__2S5Mm .PhoneInputCountry{border-right:1px solid #1f313a;margin:0;padding-right:8px;position:relative;-ms-grid-row-align:stretch;align-self:stretch;display:flex;align-items:center}#portal .PhoneNumberInput-module--wrapper__2S5Mm .PhoneInputCountrySelect,#root .PhoneNumberInput-module--wrapper__2S5Mm .PhoneInputCountrySelect,#app .PhoneNumberInput-module--wrapper__2S5Mm .PhoneInputCountrySelect{position:absolute;top:0;left:0;height:100%;width:100%;z-index:1;border:0;cursor:pointer;background:transparent;color:transparent;opacity:1;-webkit-appearance:none;appearance:none}#portal .PhoneNumberInput-module--wrapper__2S5Mm .PhoneInputCountrySelect option,#root .PhoneNumberInput-module--wrapper__2S5Mm .PhoneInputCountrySelect option,#app .PhoneNumberInput-module--wrapper__2S5Mm .PhoneInputCountrySelect option{color:#1f313a}#portal .PhoneNumberInput-module--wrapper__2S5Mm .PhoneInputCountryIcon,#root .PhoneNumberInput-module--wrapper__2S5Mm .PhoneInputCountryIcon,#app .PhoneNumberInput-module--wrapper__2S5Mm .PhoneInputCountryIcon{border:0;height:.93em;width:1.25em}#portal .PhoneNumberInput-module--wrapper__2S5Mm .PhoneInputCountryIconImg,#root .PhoneNumberInput-module--wrapper__2S5Mm .PhoneInputCountryIconImg,#app .PhoneNumberInput-module--wrapper__2S5Mm .PhoneInputCountryIconImg{display:block;height:100%;width:100%}#portal .PhoneNumberInput-module--wrapper__2S5Mm .PhoneInputCountryIcon--border,#root .PhoneNumberInput-module--wrapper__2S5Mm .PhoneInputCountryIcon--border,#app .PhoneNumberInput-module--wrapper__2S5Mm .PhoneInputCountryIcon--border{border:0}#portal .PhoneNumberInput-module--disabled__3eg9s,#root .PhoneNumberInput-module--disabled__3eg9s,#app .PhoneNumberInput-module--disabled__3eg9s{background:#c6c6c6}#portal .PhoneNumberInput-module--disabled__3eg9s input,#root .PhoneNumberInput-module--disabled__3eg9s input,#app .PhoneNumberInput-module--disabled__3eg9s input{background:#c6c6c6}#portal .PhoneNumberInput-module--chevron__RlrbD,#root .PhoneNumberInput-module--chevron__RlrbD,#app .PhoneNumberInput-module--chevron__RlrbD{height:20px;padding-left:8px;width:20px}html[dir=rtl] #portal .PhoneNumberInput-module--wrapper__2S5Mm .PhoneInputInput,html[dir=rtl] #root .PhoneNumberInput-module--wrapper__2S5Mm .PhoneInputInput,html[dir=rtl] #app .PhoneNumberInput-module--wrapper__2S5Mm .PhoneInputInput{padding:0 8px 0 0;text-align:right;direction:ltr}html[dir=rtl] #portal .PhoneNumberInput-module--wrapper__2S5Mm .PhoneInputCountry,html[dir=rtl] #root .PhoneNumberInput-module--wrapper__2S5Mm .PhoneInputCountry,html[dir=rtl] #app .PhoneNumberInput-module--wrapper__2S5Mm .PhoneInputCountry{border-left:1px solid #1f313a;border-right:0;padding-left:8px;padding-right:0}html[dir=rtl] #portal .PhoneNumberInput-module--chevron__RlrbD,html[dir=rtl] #root .PhoneNumberInput-module--chevron__RlrbD,html[dir=rtl] #app .PhoneNumberInput-module--chevron__RlrbD{padding-left:0;padding-right:8px}\", \"\",{\"version\":3,\"sources\":[\"/home/vsts/work/1/s/packages/hm-react/node_modules/@pb/components/dist/esm/ui/Fields/PhoneNumberInput/PhoneNumberInput.module.scss\",\"/home/vsts/work/1/s/packages/hm-react/node_modules/@pb/components/dist/esm/assets/scss/_spacings.scss\"],\"names\":[],\"mappings\":\"AAQE,8IACE,eATkD,CAYhD,0SACE,oBAbu2C,CAkBz2C,oSACE,oBAnBu0C,CAwBz0C,kLACE,wBAAA,CACA,qBAAA,CACA,WCtBO,CDuBP,WA5Bg6Z,CA6Bh6Z,YAAA,CACA,kBAAA,CAEA,iMACE,QAAA,CACA,iBAAA,CACA,MAAA,CACA,WAAA,CAGF,uMACE,8BAAA,CACA,QAAA,CACA,iBA1C85Z,CA2C95Z,iBAAA,CACA,0BAAA,CAAA,kBAAA,CACA,YAAA,CACA,kBAAA,CAEA,yNACE,iBAAA,CACA,KAAA,CACA,MAAA,CACA,WAAA,CACA,UAAA,CACA,SAAA,CACA,QAAA,CACA,cAAA,CACA,sBAAA,CACA,iBAAA,CACA,SAAA,CACA,uBAAA,CAAA,eAAA,CAEA,8OACE,aA/DwZ,CAmE5Z,mNACE,QAAA,CACA,YAAA,CACA,YAAA,CAEA,4NACE,aAAA,CACA,WAAA,CACA,UAAA,CAGF,2OACE,QAAA,CAQZ,iJACE,kBAxFyyC,CA0FzyC,mKACE,kBA3FuyC,CA+F3yC,8IACE,WAAA,CACA,gBAjGo6Z,CAkGp6Z,UAAA,CAYM,2OACE,iBAAA,CACA,gBAAA,CACA,aAAA,CAGF,iPACE,6BAAA,CACA,cAAA,CACA,gBAvH45Z,CAwH55Z,eAAA,CAKR,wLACE,cAAA,CACA,iBA/Hk6Z\",\"file\":\"PhoneNumberInput.module.scss\",\"sourcesContent\":[\"$base-background-default: #FFF;$base-background-card: #FFF;$base-background-overlay: rgba(255, 255, 255, 0.7);$base-background-footer: #FECDD3;$base-background-row-alternate: #E6E6E6;$base-background-row-hover: #F4F4F4;$base-background-success: #BDDDB6;$base-background-selected: #F4F4F4;$base-background-error: #FDCBE3;$base-background-warning: #FFD4CD;$base-background-info: #DEDBED;$base-favourite: #E50010;$base-text: #1F313A;$base-text-meta: #1F313A;$base-text-placeholder: #1F313A;$base-text-disabled: #C6C6C6;$base-primary-interactive: #1F313A;$base-primary-interactive-active: rgba(31, 49, 58, 0.5);$base-primary-interactive-hover: rgba(31, 49, 58, 0.75);$base-primary-interactive-visited: #1F313A;$base-secondary-interactive: #1F313A;$base-secondary-interactive-active: #1F313A;$base-secondary-interactive-hover: #C6C6C6;$base-tertiary-interactive: #1F313A;$base-tertiary-interactive-active: #1F313A;$base-tertiary-interactive-hover: #1F313A;$base-tertiary-interactive-disabled: #8C9599;$base-quaternary-interactive: #1F313A;$base-quaternary-interactive-active: #1F313A;$base-quaternary-interactive-hover: #1F313A;$base-quaternary-interactive-disabled: #8C9599;$base-primary-reverse: #FFF;$base-primary-reverse-interactive-active: #D9D9D9;$base-primary-reverse-interactive-hover: #E6E6E6;$base-interactive-disabled: #C6C6C6;$base-validation-success: #1F313A;$base-validation-error: #F20074;$base-notification: #F20074;$base-background-skeleton: #F4F4F4;$base-z-axis-shadow: rgba(31, 49, 58, 0.2);$product-sale: #E71D18;$product-sustainability: #FFF;$product-new: #FECDD3;$product-offer-product-marker: #E71D18;$product-membership: #FECDD3;$product-online-exclusive: #1F313A;$product-scarcity: #A50AFF;$base-brand-logo: #1F313A;$base-decoration-primary: #1F313A;$base-decoration-secondary: #C6C6C6;$responsive-width-xsmall: 320px !default;$responsive-width-small: 420px !default;$responsive-width-medium: 768px !default;$responsive-width-large: 1024px !default;$responsive-width-xlarge: 1280px !default;$responsive-width-xxl: 2560px !default;$energy-class-app: #27974F;$energy-class-ap: #59AD4F;$energy-class-a: #BBCE4C;$energy-class-b: #FFED42;$energy-class-c: #F0B041;$energy-class-d: #DE6637;$energy-class-e: #D22531;$color-paypal-blue: #223954;$color-paypal-blue-light: #169BD7;$color-kakao-yellow: #FEE500;$color-kakao-yellow-active: #F0D700;$color-kakao-text: rgba(0, 0, 0, 0.85);$color-kakao-icon: #000;$color-facebook: #39579B;$color-twitter: #1EA9E3;$color-pinterest: #CD1D1E;$color-instagram: #125688;$color-spotify: #00E461;$color-snapchat: #FFFC00;$color-tumblr: #35465C;$color-google-plus: #D34836;$color-youtube: #F00;$color-linkedin: #0077B7;$tag-swatch-beige: #ECCC9B;$tag-swatch-black: #000000;$tag-swatch-blue: #0000FF;$tag-swatch-bronze: #CD7F32;$tag-swatch-brown: #A52A2A;$tag-swatch-gold: #D89A00;$tag-swatch-green: #008000;$tag-swatch-grey: #808080;$tag-swatch-orange: #FFA500;$tag-swatch-pink: #FFC0CB;$tag-swatch-purple: #800080;$tag-swatch-red: #FF0000;$tag-swatch-silver: #C0C0C0;$tag-swatch-turquoise: #40E0D0;$tag-swatch-white: #FFFFFF;$tag-swatch-yellow: #FFDA00;$focus-fallback: #0091FF;$high-contrast-dark: #000000;$high-contrast-light: #FFFFFF;$editorial-fonts: ('display-quote': ('font-family': (\\\"InterTight\\\", \\\"Circular-Book-S\\\", \\\"Helvetica Neue-Light\\\", \\\"Helvetica Neue\\\", \\\"Helvetica\\\", Arial, sans-serif),'font-weight': 700,'text-transform': none,'default-size': ('line-height': 1.25,'font-size': 2.5rem,),'breakpoint-medium': ('line-height': 1.09375,'font-size': 4rem,),),'preamble': ('font-family': (\\\"InterTight\\\", \\\"Circular-Book-S\\\", \\\"Helvetica Neue-Light\\\", \\\"Helvetica Neue\\\", \\\"Helvetica\\\", Arial, sans-serif),'font-weight': 400,'text-transform': none,'default-size': ('line-height': 1.5,'font-size': 1rem,),),'body-text': ('font-family': (\\\"InterTight\\\", \\\"Circular-Book-S\\\", \\\"Helvetica Neue-Light\\\", \\\"Helvetica Neue\\\", \\\"Helvetica\\\", Arial, sans-serif),'font-weight': 400,'text-transform': none,'default-size': ('line-height': 1.5,'font-size': 1rem,),),'text-link': ('font-family': (\\\"InterTight\\\", \\\"Circular-Book-S\\\", \\\"Helvetica Neue-Light\\\", \\\"Helvetica Neue\\\", \\\"Helvetica\\\", Arial, sans-serif),'font-weight': 400,'text-transform': none,'text-decoration': underline,'default-size': ('line-height': 1.5,'font-size': 1rem,),),);$body-text-fonts: ('default': ('font-family': (\\\"InterTight\\\", \\\"Circular-Book-S\\\", \\\"Helvetica Neue-Light\\\", \\\"Helvetica Neue\\\", \\\"Helvetica\\\", Arial, sans-serif),'font-weight': 400,'text-transform': none,'default-size': ('line-height': 1.5,'font-size': 1rem,),),'meta': ('font-family': (\\\"InterTight\\\", \\\"Circular-Book-S\\\", \\\"Helvetica Neue-Light\\\", \\\"Helvetica Neue\\\", \\\"Helvetica\\\", Arial, sans-serif),'font-weight': 400,'text-transform': none,'default-size': ('line-height': 1.538461538,'font-size': 0.8125rem,),),'paragraph': ('font-family': (\\\"InterTight\\\", \\\"Circular-Book-S\\\", \\\"Helvetica Neue-Light\\\", \\\"Helvetica Neue\\\", \\\"Helvetica\\\", Arial, sans-serif),'font-weight': 400,'text-transform': none,'default-size': ('line-height': 1.5,'font-size': 1rem,),),'preamble': ('font-family': (\\\"InterTight\\\", \\\"Circular-Book-S\\\", \\\"Helvetica Neue-Light\\\", \\\"Helvetica Neue\\\", \\\"Helvetica\\\", Arial, sans-serif),'font-weight': 400,'text-transform': none,'default-size': ('line-height': 1.5,'font-size': 1rem,),),);$button-fonts: ('s': ('font-family': (\\\"InterTight\\\", \\\"Circular-Book-S\\\", \\\"Helvetica Neue-Light\\\", \\\"Helvetica Neue\\\", \\\"Helvetica\\\", Arial, sans-serif),'font-weight': 700,'text-transform': none,'default-size': ('line-height': 1.4,'font-size': 1.25rem,),),);$heading-fonts: ('xs': ('font-family': (\\\"InterTight\\\", \\\"Circular-Book-S\\\", \\\"Helvetica Neue-Light\\\", \\\"Helvetica Neue\\\", \\\"Helvetica\\\", Arial, sans-serif),'font-weight': 400,'text-transform': none,'default-size': ('line-height': 1.538461538,'font-size': 0.8125rem,),),'s': ('font-family': (\\\"InterTight\\\", \\\"Circular-Book-S\\\", \\\"Helvetica Neue-Light\\\", \\\"Helvetica Neue\\\", \\\"Helvetica\\\", Arial, sans-serif),'font-weight': 700,'text-transform': none,'default-size': ('line-height': 1.5,'font-size': 1rem,),),'m': ('font-family': (\\\"InterTight\\\", \\\"Circular-Book-S\\\", \\\"Helvetica Neue-Light\\\", \\\"Helvetica Neue\\\", \\\"Helvetica\\\", Arial, sans-serif),'font-weight': 700,'text-transform': none,'default-size': ('line-height': 1.3333,'font-size': 1.125rem,),),'l': ('font-family': (\\\"InterTight\\\", \\\"Circular-Book-S\\\", \\\"Helvetica Neue-Light\\\", \\\"Helvetica Neue\\\", \\\"Helvetica\\\", Arial, sans-serif),'font-weight': 700,'text-transform': none,'default-size': ('line-height': 1.4,'font-size': 1.25rem,),'breakpoint-medium': ('line-height': 1.25,'font-size': 1.5rem,),),'xl': ('font-family': (\\\"InterTight\\\", \\\"Circular-Book-S\\\", \\\"Helvetica Neue-Light\\\", \\\"Helvetica Neue\\\", \\\"Helvetica\\\", Arial, sans-serif),'font-weight': 700,'text-transform': none,'default-size': ('line-height': 1.25,'font-size': 1.5rem,),'breakpoint-medium': ('line-height': 1.25,'font-size': 2rem,),),'pre-heading': ('font-family': (\\\"InterTight\\\", \\\"Circular-Book-S\\\", \\\"Helvetica Neue-Light\\\", \\\"Helvetica Neue\\\", \\\"Helvetica\\\", Arial, sans-serif),'font-weight': 400,'text-transform': none,'default-size': ('line-height': 1.5,'font-size': 1rem,),),);$display-fonts: ('default': ('font-family': (\\\"InterTight\\\", \\\"Circular-Book-S\\\", \\\"Helvetica Neue-Light\\\", \\\"Helvetica Neue\\\", \\\"Helvetica\\\", Arial, sans-serif),'font-weight': 700,'text-transform': none,'default-size': ('line-height': 1.25,'font-size': 2.125rem,),'breakpoint-medium': ('line-height': 1.09375,'font-size': 4rem,),),'quote': ('font-family': (\\\"InterTight\\\", \\\"Circular-Book-S\\\", \\\"Helvetica Neue-Light\\\", \\\"Helvetica Neue\\\", \\\"Helvetica\\\", Arial, sans-serif),'font-weight': 700,'text-transform': none,'font-style': italic,'default-size': ('line-height': 1.5,'font-size': 3rem,),'breakpoint-medium': ('line-height': 1.09375,'font-size': 4rem,),),);$price-fonts: ('original-default': ('font-family': (\\\"InterTight\\\", \\\"Circular-Book-S\\\", \\\"Helvetica Neue-Light\\\", \\\"Helvetica Neue\\\", \\\"Helvetica\\\", Arial, sans-serif),'font-weight': 400,'text-transform': none,'text-decoration': line-through,'default-size': ('line-height': 1.5,'font-size': 1rem,),),'original-large': ('font-family': (\\\"InterTight\\\", \\\"Circular-Book-S\\\", \\\"Helvetica Neue-Light\\\", \\\"Helvetica Neue\\\", \\\"Helvetica\\\", Arial, sans-serif),'font-weight': 400,'text-transform': none,'text-decoration': line-through,'default-size': ('line-height': 1.5,'font-size': 1rem,),),'black-default': ('font-family': (\\\"InterTight\\\", \\\"Circular-Book-S\\\", \\\"Helvetica Neue-Light\\\", \\\"Helvetica Neue\\\", \\\"Helvetica\\\", Arial, sans-serif),'font-weight': 400,'text-transform': none,'default-size': ('line-height': 1.5,'font-size': 1rem,),),'black-large': ('font-family': (\\\"InterTight\\\", \\\"Circular-Book-S\\\", \\\"Helvetica Neue-Light\\\", \\\"Helvetica Neue\\\", \\\"Helvetica\\\", Arial, sans-serif),'font-weight': 400,'text-transform': none,'default-size': ('line-height': 1.5,'font-size': 1rem,),),'previous-meta': ('font-family': (\\\"InterTight\\\", \\\"Circular-Book-S\\\", \\\"Helvetica Neue-Light\\\", \\\"Helvetica Neue\\\", \\\"Helvetica\\\", Arial, sans-serif),'font-weight': 400,'text-transform': none,'text-decoration': line-through,'default-size': ('line-height': 1.538461538,'font-size': 0.8125rem,),),);$label-fonts: ('form-label': ('font-family': (\\\"InterTight\\\", \\\"Circular-Book-S\\\", \\\"Helvetica Neue-Light\\\", \\\"Helvetica Neue\\\", \\\"Helvetica\\\", Arial, sans-serif),'font-weight': 400,'text-transform': none,'default-size': ('line-height': 1.5,'font-size': 1rem,),),);$interactive-fonts: ('navigation-parent': ('font-family': (\\\"InterTight\\\", \\\"Circular-Book-S\\\", \\\"Helvetica Neue-Light\\\", \\\"Helvetica Neue\\\", \\\"Helvetica\\\", Arial, sans-serif),'font-weight': 400,'text-transform': none,'text-decoration': none,'default-size': ('line-height': 1.2857,'font-size': 1.75rem,),'breakpoint-medium': ('line-height': 1.5,'font-size': 1rem,),),'navigation-child': ('font-family': (\\\"InterTight\\\", \\\"Circular-Book-S\\\", \\\"Helvetica Neue-Light\\\", \\\"Helvetica Neue\\\", \\\"Helvetica\\\", Arial, sans-serif),'font-weight': 400,'text-transform': none,'text-decoration': none,'default-size': ('line-height': 1.5,'font-size': 1rem,),),'navigation-large': ('font-family': (\\\"InterTight\\\", \\\"Circular-Book-S\\\", \\\"Helvetica Neue-Light\\\", \\\"Helvetica Neue\\\", \\\"Helvetica\\\", Arial, sans-serif),'font-weight': 400,'text-transform': none,'text-decoration': none,'default-size': ('line-height': 1.2857,'font-size': 1.75rem,),'breakpoint-medium': ('line-height': 1.5,'font-size': 1rem,),),'navigation-medium': ('font-family': (\\\"InterTight\\\", \\\"Circular-Book-S\\\", \\\"Helvetica Neue-Light\\\", \\\"Helvetica Neue\\\", \\\"Helvetica\\\", Arial, sans-serif),'font-weight': 400,'text-transform': none,'text-decoration': none,'default-size': ('line-height': 1.5,'font-size': 1rem,),),'navigation-small': ('font-family': (\\\"InterTight\\\", \\\"Circular-Book-S\\\", \\\"Helvetica Neue-Light\\\", \\\"Helvetica Neue\\\", \\\"Helvetica\\\", Arial, sans-serif),'font-weight': 400,'text-transform': none,'text-decoration': none,'default-size': ('line-height': 1.2307,'font-size': 0.8125rem,),),'inline-link-default': ('font-family': (\\\"InterTight\\\", \\\"Circular-Book-S\\\", \\\"Helvetica Neue-Light\\\", \\\"Helvetica Neue\\\", \\\"Helvetica\\\", Arial, sans-serif),'font-weight': 400,'text-transform': none,'text-decoration': underline,'default-size': ('line-height': 1.5,'font-size': 1rem,),),'inline-link-meta': ('font-family': (\\\"InterTight\\\", \\\"Circular-Book-S\\\", \\\"Helvetica Neue-Light\\\", \\\"Helvetica Neue\\\", \\\"Helvetica\\\", Arial, sans-serif),'font-weight': 400,'text-transform': none,'text-decoration': underline,'default-size': ('line-height': 1.538461538,'font-size': 0.8125rem,),),'inline-link-paragraph': ('font-family': (\\\"InterTight\\\", \\\"Circular-Book-S\\\", \\\"Helvetica Neue-Light\\\", \\\"Helvetica Neue\\\", \\\"Helvetica\\\", Arial, sans-serif),'font-weight': 400,'text-transform': none,'text-decoration': underline,'default-size': ('line-height': 1.5,'font-size': 1rem,),),'inline-link-preamble': ('font-family': (\\\"InterTight\\\", \\\"Circular-Book-S\\\", \\\"Helvetica Neue-Light\\\", \\\"Helvetica Neue\\\", \\\"Helvetica\\\", Arial, sans-serif),'font-weight': 400,'text-transform': none,'text-decoration': underline,'default-size': ('line-height': 1.5,'font-size': 1rem,),),'standalone-link': ('font-family': (\\\"InterTight\\\", \\\"Circular-Book-S\\\", \\\"Helvetica Neue-Light\\\", \\\"Helvetica Neue\\\", \\\"Helvetica\\\", Arial, sans-serif),'font-weight': 700,'text-transform': none,'default-size': ('line-height': 1.5,'font-size': 1rem,),),'standalone-link-default': ('font-family': (\\\"InterTight\\\", \\\"Circular-Book-S\\\", \\\"Helvetica Neue-Light\\\", \\\"Helvetica Neue\\\", \\\"Helvetica\\\", Arial, sans-serif),'font-weight': 400,'text-transform': none,'text-decoration': none,'default-size': ('line-height': 1.52,'font-size': 1rem,),),'standalone-link-underline': ('font-family': (\\\"InterTight\\\", \\\"Circular-Book-S\\\", \\\"Helvetica Neue-Light\\\", \\\"Helvetica Neue\\\", \\\"Helvetica\\\", Arial, sans-serif),'font-weight': 400,'text-decoration': underline,'text-transform': none,'default-size': ('line-height': 1.52,'font-size': 1rem,),),'input-text': ('font-family': (\\\"InterTight\\\", \\\"Circular-Book-S\\\", \\\"Helvetica Neue-Light\\\", \\\"Helvetica Neue\\\", \\\"Helvetica\\\", Arial, sans-serif),'font-weight': 400,'text-transform': none,'default-size': ('line-height': 1.3333,'font-size': 1.125rem,),),'element': ('font-family': (\\\"InterTight\\\", \\\"Circular-Book-S\\\", \\\"Helvetica Neue-Light\\\", \\\"Helvetica Neue\\\", \\\"Helvetica\\\", Arial, sans-serif),'font-weight': 700,'text-transform': none,'default-size': ('line-height': 1.4,'font-size': 1.25rem,),),);$spacing-xxxs: 2px;$spacing-xxs: 4px;$spacing-xs: 8px;$spacing-s: 16px;$spacing-m: 24px;$spacing-l: 32px;$spacing-xl: 40px;$spacing-xxl: 48px;$spacing-xxxl: 64px;$spacing-xxxxl: 96px;$spacing-xxxxxl: 128px;$spacing-xxxxxxl: 160px;$spacing-xs-deprecated: 12px;$is-development: true;$is-staging: false;$is-production: false;$interactive-border: ('radius': 0,'width': 1px,);$card-border: ('radius': 0,'width': 0px,);$section-border: ('radius': 0,'width': 0px,);$available-palettes: ();$default-palette: ('background': $base-background-default,'text': $base-text,'headline': $base-text,'logo': $base-brand-logo,'interactive': $base-decoration-secondary,'interactive-hover': $base-primary-interactive,'interactive-active': $base-primary-interactive-hover,'interactive-reverse': $base-primary-interactive-active,);$theme: 'monki';\\n/* stylelint-disable selector-max-compound-selectors, max-nesting-depth */\\n\\n@import \\\"../../../assets/scss/variables\\\";\\n\\n:global(#portal),\\n:global(#root),\\n:global(#app) {\\n .wrapper {\\n background: $base-background-card;\\n\\n &.invalid {\\n :global .PhoneInput {\\n border-color: $base-validation-error;\\n }\\n }\\n\\n &.valid {\\n :global .PhoneInput {\\n border-color: $base-validation-success;\\n }\\n }\\n\\n :global {\\n .PhoneInput {\\n border: 1px solid $base-tertiary-interactive;\\n box-sizing: border-box;\\n height: $field-height;\\n padding: $spacing-xs;\\n display: flex;\\n align-items: center;\\n\\n &Input {\\n border: 0;\\n padding: 0 0 0 $spacing-xs;\\n flex: 1;\\n min-width: 0;\\n }\\n\\n &Country {\\n border-right: 1px solid $base-tertiary-interactive;\\n margin: 0;\\n padding-right: $spacing-xs;\\n position: relative;\\n align-self: stretch;\\n display: flex;\\n align-items: center;\\n\\n &Select {\\n position: absolute;\\n top: 0;\\n left: 0;\\n height: 100%;\\n width: 100%;\\n z-index: 1;\\n border: 0;\\n cursor: pointer;\\n background: transparent;\\n color: transparent;\\n opacity: 1;\\n appearance: none;\\n\\n option {\\n color: $base-text;\\n }\\n }\\n\\n &Icon {\\n border: 0;\\n height: 0.93em;\\n width: 1.25em;\\n\\n &Img {\\n display: block;\\n height: 100%;\\n width: 100%;\\n }\\n\\n &--border {\\n border: 0;\\n }\\n }\\n }\\n }\\n }\\n }\\n\\n .disabled {\\n background: $base-interactive-disabled;\\n\\n input {\\n background: $base-interactive-disabled;\\n }\\n }\\n\\n .chevron {\\n height: 20px;\\n padding-left: $spacing-xs;\\n width: 20px;\\n }\\n}\\n\\n//rtl\\nhtml[dir='rtl'] {\\n :global(#portal),\\n :global(#root),\\n :global(#app) {\\n .wrapper {\\n :global {\\n .PhoneInput {\\n &Input {\\n padding: 0 $spacing-xs 0 0;\\n text-align: right;\\n direction: ltr;\\n }\\n\\n &Country {\\n border-left: 1px solid $base-tertiary-interactive;\\n border-right: 0;\\n padding-left: $spacing-xs;\\n padding-right: 0;\\n }\\n }\\n }\\n }\\n .chevron {\\n padding-left: 0;\\n padding-right: $spacing-xs;\\n }\\n }\\n}\\n\\n/* stylelint-enable */\\n\",\"// Detail spacing (used within a component)\\n$base-unit: 8px !default;\\n\\n// All spacing after this comment need clean up and alignment with UI\\n// DO NOT USE\\n$field-height: 48px;\\n$mobile-header-height: 72px;\\n@if $theme == 'northstar' {\\n $field-height: 56px;\\n $mobile-header-height: 64px;\\n}\\n$button-standard-height: $field-height;\\n\\n$vertical-scroll-breakpoint-desktop: 1001px;\\n$swipe-in-sidebarpluscontent: 1062px;\\n$grid-column-width: 58px;\\n$grid-column-gutter: $spacing-m;\\n$grid-gutter: $spacing-m;\\n$grid-gutter-pixels: $spacing-m;\\n$grid-side-gutter: $spacing-m;\\n$grid-gutter-level-one-percent: 2.5%;\\n$grid-gutter-level-two-percent: 3.35%;\\n\\n//Toolbox margins and gutters\\n$teaser-gutter: 15px;\\n$teaser-s-gutter: 20px;\\n$teaser-m-gutter: 30px;\\n$teaser-l-gutter: 40px;\\n$teaser-gutter-3x2: 12.5%;\\n$side-margins-xs: 15px;\\n$background-plate-gutter: 20px;\\n$modal-padding: $spacing-xxxl;\\n$modal-mobile-padding: $spacing-m;\\n$mobile-height: 72px;\\n$desktop-height: $mobile-height;\\n$hamburger-menu-height: 30px;\\n$megamenu-height: 72px;\\n$option-max-height: 103px;\\n$side-margins: 60px;\\n$side-margins-large: 80px;\\n$meta-min-width: 85px;\\n$form-input-height: 52px;\\n$sidebar-width: 224px;\\n$centerd-block-width: 714px;\\n$sidebar-width-pixels: 224px;\\n$spinner-small: 16px;\\n$spinner-medium: 24px;\\n$spinner-large: 32px;\\n\\n$other-spacings-set: (\\n '$field-height': $field-height,\\n '$button-standard-height': $button-standard-height,\\n '$mobile-header-height': $mobile-header-height,\\n '$vertical-scroll-breakpoint-desktop': $vertical-scroll-breakpoint-desktop,\\n '$swipe-in-sidebarpluscontent': $swipe-in-sidebarpluscontent,\\n '$grid-column-width': $grid-column-width,\\n '$grid-column-gutter': $grid-column-gutter,\\n '$grid-gutter': $grid-gutter,\\n '$grid-gutter-pixels': $grid-gutter-pixels,\\n '$grid-side-gutter': $grid-side-gutter,\\n '$grid-gutter-level-one-percent': $grid-gutter-level-one-percent,\\n '$grid-gutter-level-two-percent': $grid-gutter-level-two-percent,\\n '$teaser-gutter': $teaser-gutter,\\n '$teaser-s-gutter': $teaser-s-gutter,\\n '$teaser-m-gutter': $teaser-m-gutter,\\n '$teaser-l-gutter': $teaser-l-gutter,\\n '$teaser-gutter-3x2': $teaser-gutter-3x2,\\n '$side-margins-xs': $side-margins-xs,\\n '$background-plate-gutter': $background-plate-gutter,\\n '$modal-padding': $modal-padding,\\n '$modal-mobile-padding': $modal-mobile-padding,\\n '$mobile-height': $mobile-height,\\n '$desktop-height': $desktop-height,\\n '$hamburger-menu-height': $hamburger-menu-height,\\n '$megamenu-height': $megamenu-height,\\n '$option-max-height': $option-max-height,\\n '$side-margins': $side-margins,\\n '$side-margins-large': $side-margins-large,\\n '$meta-min-width': $meta-min-width,\\n '$form-input-height': $form-input-height,\\n '$sidebar-width': $sidebar-width,\\n '$centerd-block-width': $centerd-block-width,\\n '$sidebar-width-pixels': $sidebar-width-pixels,\\n '$spinner-small': $spinner-small,\\n '$spinner-medium': $spinner-medium,\\n '$spinner-large': $spinner-large,\\n);\\n\"]}]);\n// Exports\nexports.locals = {\n\t\"wrapper\": \"PhoneNumberInput-module--wrapper__2S5Mm\",\n\t\"invalid\": \"PhoneNumberInput-module--invalid__1T3cy\",\n\t\"valid\": \"PhoneNumberInput-module--valid__yTfoR\",\n\t\"disabled\": \"PhoneNumberInput-module--disabled__3eg9s\",\n\t\"chevron\": \"PhoneNumberInput-module--chevron__RlrbD\"\n};\nmodule.exports = exports;\n","import api from \"!../../../../../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import content from \"!!../../../../../../../css-loader/dist/cjs.js??ruleSet[1].rules[0].use[1]!../../../../../../../postcss-loader/dist/cjs.js!../../../../../../../sass-loader/dist/cjs.js??ruleSet[1].rules[0].use[3]!./PhoneNumberInput.module.scss\";\n\nvar options = {};\n\noptions.insert = \"head\";\noptions.singleton = false;\n\nvar update = api(content, options);\n\n\n\nexport default content.locals || {};","import { __rest } from \"tslib\";\nimport React, { useEffect, useState } from 'react';\nimport { default as useIsMounted } from \"@pb/utils/reactHooks/useIsMounted\";\nimport cn from 'classnames';\nimport PhoneInput, { isValidPhoneNumber, isPossiblePhoneNumber } from 'react-phone-number-input';\nimport { CountrySelectWithIcon } from 'react-phone-number-input/commonjs/CountrySelect';\nimport { ChevronDownIcon } from '../../Icon';\nimport Field from '../Field';\nimport styles from './PhoneNumberInput.module.scss';\nconst LANG_PROP_TO_LABEL_FILE_MAP = {\n en_gb: () => import('react-phone-number-input/locale/en.json'),\n ru_ru: () => import('react-phone-number-input/locale/ru.json'),\n sv_se: () => import('react-phone-number-input/locale/sv.json'),\n de_de: () => import('react-phone-number-input/locale/de.json'),\n};\nconst CountrySelect = (_a) => {\n var { options } = _a, props = __rest(_a, [\"options\"]);\n const [isRendered, setIsRendered] = useState(false);\n // Postpone render of options to fix animation glitches caused by enormous amount of select options\n useEffect(() => {\n const timeout = window.setTimeout(() => {\n setIsRendered(true);\n }, 300);\n return () => {\n window.clearTimeout(timeout);\n };\n }, []);\n return (React.createElement(CountrySelectWithIcon, Object.assign({ arrowComponent: () => React.createElement(ChevronDownIcon, { className: styles.chevron }), options: isRendered ? options : [] }, props)));\n};\nconst PhoneNumberInput = (_a) => {\n var { name, label, hint, shouldShowValidationIcon, shouldDisableValidation, disableLabel, error, onChange, value, className, disabled, required = false, defaultCountry, lang = 'en_gb', shouldValidateOnBlur, onErrorCallBack, validationFunctions, onBlurCallBack, placeholder, country, international = true, addInternationalOption = false, countries } = _a, restProps = __rest(_a, [\"name\", \"label\", \"hint\", \"shouldShowValidationIcon\", \"shouldDisableValidation\", \"disableLabel\", \"error\", \"onChange\", \"value\", \"className\", \"disabled\", \"required\", \"defaultCountry\", \"lang\", \"shouldValidateOnBlur\", \"onErrorCallBack\", \"validationFunctions\", \"onBlurCallBack\", \"placeholder\", \"country\", \"international\", \"addInternationalOption\", \"countries\"]);\n const [localeLabels, setLocaleLabels] = useState(undefined);\n const getIsMounted = useIsMounted();\n useEffect(() => {\n const getLocaleFile = LANG_PROP_TO_LABEL_FILE_MAP[lang];\n if (!getLocaleFile) {\n return;\n }\n getLocaleFile().then((labels) => {\n if (getIsMounted()) {\n setLocaleLabels(labels);\n }\n });\n }, [lang]);\n useEffect(() => {\n if (validationFunctions === null || validationFunctions === void 0 ? void 0 : validationFunctions.current) {\n validationFunctions.current.isValidPhoneNumber = isValidPhoneNumber;\n validationFunctions.current.isPossibleNumber = isPossiblePhoneNumber;\n }\n }, []);\n const handleChange = (newValue) => {\n if (onChange) {\n onChange(newValue);\n }\n };\n const handleBlur = (event) => {\n var _a;\n if (shouldValidateOnBlur) {\n const { value: targetValue } = (_a = event === null || event === void 0 ? void 0 : event.target) !== null && _a !== void 0 ? _a : {};\n const isValidNumber = isValidPhoneNumber(targetValue);\n const isPossibleNumber = isPossiblePhoneNumber(targetValue);\n onErrorCallBack === null || onErrorCallBack === void 0 ? void 0 : onErrorCallBack({ isValidNumber, isPossibleNumber });\n }\n onBlurCallBack === null || onBlurCallBack === void 0 ? void 0 : onBlurCallBack(event);\n };\n return (React.createElement(Field, { required: required, name: name, hint: hint, label: label, shouldDisableValidation: shouldDisableValidation, shouldShowValidationIcon: shouldShowValidationIcon, disableLabel: disableLabel, error: error, className: className, value: value, render: ({ validationStatus }) => {\n return (React.createElement(\"div\", { className: cn(styles.wrapper, validationStatus === 'valid' && styles.valid, validationStatus === 'invalid' && styles.invalid, disabled && styles.disabled) },\n React.createElement(PhoneInput, Object.assign({ international: international, id: name, \"aria-required\": required, required: required, value: value, onChange: handleChange, onBlur: handleBlur, type: \"tel\", inputMode: \"tel\", countrySelectComponent: CountrySelect, defaultCountry: defaultCountry, labels: localeLabels, placeholder: placeholder, country: country, countries: countries, addInternationalOption: addInternationalOption }, restProps))));\n } }));\n};\nexport default PhoneNumberInput;\n//# sourceMappingURL=PhoneNumberInput.js.map","import React from 'react';\nimport IconWrapper from '../IconWrapper';\nconst CrossIcon = (props) => {\n const brand = process.env.BRAND || process.env.BRAND_PREFIX;\n switch (brand) {\n case 'arket':\n return (React.createElement(IconWrapper, Object.assign({}, props, { viewBox: \"0 0 18 18\" }),\n React.createElement(\"path\", { d: \"M12.915 1.728C11.627 0.991999 10.247 0.600999 8.729 0.600999C7.188 0.600999 5.785 0.991999 4.52 1.751C3.232 2.51 2.22 3.522 1.484 4.81C0.748 6.098 0.38 7.478 0.38 8.95C0.38 10.468 0.748 11.848 1.507 13.136C2.243 14.424 3.255 15.459 4.543 16.195C5.831 16.954 7.211 17.322 8.729 17.322C10.247 17.322 11.627 16.954 12.915 16.195C14.18 15.459 15.192 14.424 15.951 13.136C16.687 11.848 17.078 10.468 17.078 8.95C17.078 7.432 16.687 6.052 15.951 4.764C15.215 3.499 14.203 2.487 12.915 1.728ZM12.133 14.815C11.098 15.413 9.971 15.712 8.729 15.712C7.487 15.712 6.337 15.413 5.325 14.792C4.29 14.194 3.485 13.366 2.887 12.331C2.289 11.296 1.99 10.169 1.99 8.95C1.99 7.754 2.289 6.65 2.91 5.615C3.508 4.58 4.336 3.752 5.371 3.131C6.383 2.533 7.51 2.211 8.729 2.211C9.948 2.211 11.075 2.533 12.11 3.131C13.122 3.729 13.95 4.557 14.548 5.569C15.146 6.604 15.468 7.731 15.468 8.95C15.468 10.192 15.169 11.342 14.571 12.377C13.973 13.412 13.145 14.217 12.133 14.815ZM12.984 5.822L11.857 4.695L8.729 7.823L5.601 4.695L4.474 5.822L7.602 8.95L4.474 12.078L5.601 13.205L8.729 10.077L11.857 13.205L12.984 12.078L9.856 8.95L12.984 5.822Z\" })));\n case 'northstar':\n return (React.createElement(IconWrapper, Object.assign({}, props),\n React.createElement(\"path\", { d: \"M7.98236 6.92185L14.4645 0.439453L15.5252 1.50009L9.043 7.98253L15.5253 14.465L14.4646 15.5257L7.98236 9.04321L1.50013 15.5257L0.439453 14.465L6.92172 7.98253L0.439526 1.50009L1.50021 0.439453L7.98236 6.92185Z\" })));\n default:\n return (React.createElement(IconWrapper, Object.assign({}, props),\n React.createElement(\"path\", { d: \"M12 11.29L21.29 2l.71.71L12.71 12 22 21.29l-.71.71L12 12.71 2.71 22 2 21.29 11.29 12 2 2.71 2.71 2 12 11.29z\" })));\n }\n};\nexport default CrossIcon;\n//# sourceMappingURL=CrossIcon.js.map","import Metadata from '../metadata';\n/**\r\n * Pattern that makes it easy to distinguish whether a region has a single\r\n * international dialing prefix or not. If a region has a single international\r\n * prefix (e.g. 011 in USA), it will be represented as a string that contains\r\n * a sequence of ASCII digits, and possibly a tilde, which signals waiting for\r\n * the tone. If there are multiple available international prefixes in a\r\n * region, they will be represented as a regex string that always contains one\r\n * or more characters that are not ASCII digits or a tilde.\r\n */\n\nvar SINGLE_IDD_PREFIX_REG_EXP = /^[\\d]+(?:[~\\u2053\\u223C\\uFF5E][\\d]+)?$/; // For regions that have multiple IDD prefixes\n// a preferred IDD prefix is returned.\n\nexport default function getIddPrefix(country, callingCode, metadata) {\n var countryMetadata = new Metadata(metadata);\n countryMetadata.selectNumberingPlan(country, callingCode);\n\n if (countryMetadata.defaultIDDPrefix()) {\n return countryMetadata.defaultIDDPrefix();\n }\n\n if (SINGLE_IDD_PREFIX_REG_EXP.test(countryMetadata.IDDPrefix())) {\n return countryMetadata.IDDPrefix();\n }\n}\n//# sourceMappingURL=getIddPrefix.js.map","function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty(target, key, source[key]); }); } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\n// 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\nimport matchesEntirely from './helpers/matchesEntirely';\nimport formatNationalNumberUsingFormat from './helpers/formatNationalNumberUsingFormat';\nimport Metadata, { getCountryCallingCode } from './metadata';\nimport getIddPrefix from './helpers/getIddPrefix';\nimport { formatRFC3966 } from './helpers/RFC3966';\nvar DEFAULT_OPTIONS = {\n formatExtension: function formatExtension(formattedNumber, extension, metadata) {\n return \"\".concat(formattedNumber).concat(metadata.ext()).concat(extension);\n } // Formats a phone number\n //\n // Example use cases:\n //\n // ```js\n // formatNumber('8005553535', 'RU', 'INTERNATIONAL')\n // formatNumber('8005553535', 'RU', 'INTERNATIONAL', metadata)\n // formatNumber({ phone: '8005553535', country: 'RU' }, 'INTERNATIONAL')\n // formatNumber({ phone: '8005553535', country: 'RU' }, 'INTERNATIONAL', metadata)\n // formatNumber('+78005553535', 'NATIONAL')\n // formatNumber('+78005553535', 'NATIONAL', metadata)\n // ```\n //\n\n};\nexport default function formatNumber(input, format, options, metadata) {\n // Apply default options.\n if (options) {\n options = _objectSpread({}, DEFAULT_OPTIONS, options);\n } else {\n options = DEFAULT_OPTIONS;\n }\n\n metadata = new Metadata(metadata);\n\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\n metadata.country(input.country);\n } else if (input.countryCallingCode) {\n metadata.selectNumberingPlan(input.countryCallingCode);\n } else return input.phone || '';\n\n var countryCallingCode = metadata.countryCallingCode();\n var nationalNumber = options.v2 ? input.nationalNumber : input.phone; // This variable should have been declared inside `case`s\n // but Babel has a bug and it says \"duplicate variable declaration\".\n\n var number;\n\n switch (format) {\n case 'NATIONAL':\n // Legacy argument support.\n // (`{ country: ..., phone: '' }`)\n if (!nationalNumber) {\n return '';\n }\n\n number = formatNationalNumber(nationalNumber, input.carrierCode, 'NATIONAL', metadata, options);\n return addExtension(number, input.ext, metadata, options.formatExtension);\n\n case 'INTERNATIONAL':\n // Legacy argument support.\n // (`{ country: ..., phone: '' }`)\n if (!nationalNumber) {\n return \"+\".concat(countryCallingCode);\n }\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\n case 'E.164':\n // `E.164` doesn't define \"phone number extensions\".\n return \"+\".concat(countryCallingCode).concat(nationalNumber);\n\n case 'RFC3966':\n return formatRFC3966({\n number: \"+\".concat(countryCallingCode).concat(nationalNumber),\n ext: input.ext\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\n case 'IDD':\n if (!options.fromCountry) {\n return; // throw new Error('`fromCountry` option not passed for IDD-prefixed formatting.')\n }\n\n var formattedNumber = formatIDD(nationalNumber, input.carrierCode, countryCallingCode, options.fromCountry, metadata);\n return addExtension(formattedNumber, input.ext, metadata, options.formatExtension);\n\n default:\n throw new Error(\"Unknown \\\"format\\\" argument passed to \\\"formatNumber()\\\": \\\"\".concat(format, \"\\\"\"));\n }\n}\n\nfunction formatNationalNumber(number, carrierCode, formatAs, metadata, options) {\n var format = chooseFormatForNumber(metadata.formats(), number);\n\n if (!format) {\n return number;\n }\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}\n\nfunction chooseFormatForNumber(availableFormats, nationalNnumber) {\n for (var _iterator = availableFormats, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {\n var _ref;\n\n if (_isArray) {\n if (_i >= _iterator.length) break;\n _ref = _iterator[_i++];\n } else {\n _i = _iterator.next();\n if (_i.done) break;\n _ref = _i.value;\n }\n\n var format = _ref;\n\n // Validate leading digits\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]; // If leading digits don't match then move on to the next phone number format\n\n if (nationalNnumber.search(lastLeadingDigitsPattern) !== 0) {\n continue;\n }\n } // Check that the national number matches the phone number format regular expression\n\n\n if (matchesEntirely(nationalNnumber, format.pattern())) {\n return format;\n }\n }\n}\n\nfunction addExtension(formattedNumber, ext, metadata, formatExtension) {\n return ext ? formatExtension(formattedNumber, ext, metadata) : formattedNumber;\n}\n\nfunction formatIDD(nationalNumber, carrierCode, countryCallingCode, fromCountry, metadata) {\n var fromCountryCallingCode = getCountryCallingCode(fromCountry, metadata.metadata); // When calling within the same country calling code.\n\n if (fromCountryCallingCode === countryCallingCode) {\n var formattedNumber = formatNationalNumber(nationalNumber, carrierCode, 'NATIONAL', metadata); // For NANPA regions, return the national format for these regions\n // but prefix it with the country calling code.\n\n if (countryCallingCode === '1') {\n return countryCallingCode + ' ' + formattedNumber;\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\n\n return formattedNumber;\n }\n\n var iddPrefix = getIddPrefix(fromCountry, undefined, metadata.metadata);\n\n if (iddPrefix) {\n return \"\".concat(iddPrefix, \" \").concat(countryCallingCode, \" \").concat(formatNationalNumber(nationalNumber, null, 'INTERNATIONAL', metadata));\n }\n}\n//# sourceMappingURL=format_.js.map","function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty(target, key, source[key]); }); } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nimport Metadata from './metadata';\nimport isPossibleNumber from './isPossibleNumber_';\nimport isValidNumber from './validate_';\nimport isValidNumberForRegion from './isValidNumberForRegion_';\nimport getNumberType from './helpers/getNumberType';\nimport formatNumber from './format_';\nvar USE_NON_GEOGRAPHIC_COUNTRY_CODE = false;\n\nvar PhoneNumber =\n/*#__PURE__*/\nfunction () {\n function PhoneNumber(countryCallingCode, nationalNumber, metadata) {\n _classCallCheck(this, PhoneNumber);\n\n if (!countryCallingCode) {\n throw new TypeError('`country` or `countryCallingCode` not passed');\n }\n\n if (!nationalNumber) {\n throw new TypeError('`nationalNumber` not passed');\n }\n\n if (!metadata) {\n throw new TypeError('`metadata` not passed');\n }\n\n var _metadata = new Metadata(metadata); // If country code is passed then derive `countryCallingCode` from it.\n // Also store the country code as `.country`.\n\n\n if (isCountryCode(countryCallingCode)) {\n this.country = countryCallingCode;\n\n _metadata.country(countryCallingCode);\n\n countryCallingCode = _metadata.countryCallingCode();\n } else {\n /* istanbul ignore if */\n if (USE_NON_GEOGRAPHIC_COUNTRY_CODE) {\n if (_metadata.isNonGeographicCallingCode(countryCallingCode)) {\n this.country = '001';\n }\n }\n }\n\n this.countryCallingCode = countryCallingCode;\n this.nationalNumber = nationalNumber;\n this.number = '+' + this.countryCallingCode + this.nationalNumber;\n this.metadata = metadata;\n }\n\n _createClass(PhoneNumber, [{\n key: \"isPossible\",\n value: function isPossible() {\n return isPossibleNumber(this, {\n v2: true\n }, this.metadata);\n }\n }, {\n key: \"isValid\",\n value: function isValid() {\n return isValidNumber(this, {\n v2: true\n }, this.metadata);\n }\n }, {\n key: \"isNonGeographic\",\n value: function isNonGeographic() {\n var metadata = new Metadata(this.metadata);\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 } // // Is just an alias for `this.isValid() && this.country === country`.\n // // https://github.com/googlei18n/libphonenumber/blob/master/FAQ.md#when-should-i-use-isvalidnumberforregion\n // isValidForRegion(country) {\n // \treturn isValidNumberForRegion(this, country, { v2: true }, this.metadata)\n // }\n\n }, {\n key: \"getType\",\n value: function getType() {\n return getNumberType(this, {\n v2: true\n }, this.metadata);\n }\n }, {\n key: \"format\",\n value: function format(_format, options) {\n return formatNumber(this, _format, options ? _objectSpread({}, options, {\n v2: true\n }) : {\n v2: true\n }, this.metadata);\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\n return PhoneNumber;\n}();\n\nexport { PhoneNumber as default };\n\nvar isCountryCode = function isCountryCode(value) {\n return /^[A-Z]{2}$/.test(value);\n};\n//# sourceMappingURL=PhoneNumber.js.map","import Metadata from './metadata';\nimport matchesEntirely from './helpers/matchesEntirely';\nimport getNumberType from './helpers/getNumberType';\n/**\r\n * Checks if a given phone number is valid.\r\n *\r\n * If the `number` is a string, it will be parsed to an object,\r\n * but only if it contains only valid phone number characters (including punctuation).\r\n * If the `number` is an object, it is used as is.\r\n *\r\n * The optional `defaultCountry` argument is the default country.\r\n * I.e. it does not restrict to just that country,\r\n * e.g. in those cases where several countries share\r\n * the same phone numbering rules (NANPA, Britain, etc).\r\n * For example, even though the number `07624 369230`\r\n * belongs to the Isle of Man (\"IM\" country code)\r\n * calling `isValidNumber('07624369230', 'GB', metadata)`\r\n * still returns `true` because the country is not restricted to `GB`,\r\n * it's just that `GB` is the default one for the phone numbering rules.\r\n * For restricting the country see `isValidNumberForRegion()`\r\n * though restricting a country might not be a good idea.\r\n * https://github.com/googlei18n/libphonenumber/blob/master/FAQ.md#when-should-i-use-isvalidnumberforregion\r\n *\r\n * Examples:\r\n *\r\n * ```js\r\n * isValidNumber('+78005553535', metadata)\r\n * isValidNumber('8005553535', 'RU', metadata)\r\n * isValidNumber('88005553535', 'RU', metadata)\r\n * isValidNumber({ phone: '8005553535', country: 'RU' }, metadata)\r\n * ```\r\n */\n\nexport default function isValidNumber(input, options, metadata) {\n // If assigning the `{}` default value is moved to the arguments above,\n // code coverage would decrease for some weird reason.\n options = options || {};\n metadata = new Metadata(metadata); // This is just to support `isValidNumber({})`\n // for cases when `parseNumber()` returns `{}`.\n\n if (!input.country) {\n return false;\n }\n\n metadata.selectNumberingPlan(input.country, input.countryCallingCode); // By default, countries only have type regexps when it's required for\n // distinguishing different countries having the same `countryCallingCode`.\n\n if (metadata.hasTypes()) {\n return getNumberType(input, options, metadata.metadata) !== undefined;\n } // If there are no type regexps for this country in metadata then use\n // `nationalNumberPattern` as a \"better than nothing\" replacement.\n\n\n var national_number = options.v2 ? input.nationalNumber : input.phone;\n return matchesEntirely(national_number, metadata.nationalNumberPattern());\n}\n//# sourceMappingURL=validate_.js.map","// The minimum length of the national significant number.\nexport var MIN_LENGTH_FOR_NSN = 2; // The ITU says the maximum length should be 15,\n// but one can find longer numbers in Germany.\n\nexport var MAX_LENGTH_FOR_NSN = 17; // The maximum length of the country calling code.\n\nexport var MAX_LENGTH_COUNTRY_CODE = 3; // Digits accepted in phone numbers\n// (ascii, fullwidth, arabic-indic, and eastern arabic digits).\n\nexport var VALID_DIGITS = \"0-9\\uFF10-\\uFF19\\u0660-\\u0669\\u06F0-\\u06F9\"; // `DASHES` will be right after the opening square bracket of the \"character class\"\n\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\\\\[\\\\]\"; // export const OPENING_BRACKETS = '(\\uFF08\\uFF3B\\\\\\['\n\nvar TILDES = \"~\\u2053\\u223C\\uFF5E\"; // 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.\n\nexport var VALID_PUNCTUATION = \"\".concat(DASHES).concat(SLASHES).concat(DOTS).concat(WHITESPACE).concat(BRACKETS).concat(TILDES);\nexport var PLUS_CHARS = \"+\\uFF0B\"; // const LEADING_PLUS_CHARS_PATTERN = new RegExp('^[' + PLUS_CHARS + ']+')\n//# sourceMappingURL=constants.js.map","function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); }\n\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance\"); }\n\nfunction _iterableToArrayLimit(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"] != null) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; }\n\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\n\nimport isViablePhoneNumber from './isViablePhoneNumber'; // https://www.ietf.org/rfc/rfc3966.txt\n\n/**\r\n * @param {string} text - Phone URI (RFC 3966).\r\n * @return {object} `{ ?number, ?ext }`.\r\n */\n\nexport function parseRFC3966(text) {\n var number;\n var ext; // Replace \"tel:\" with \"tel=\" for parsing convenience.\n\n text = text.replace(/^tel:/, 'tel=');\n\n for (var _iterator = text.split(';'), _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {\n var _ref;\n\n if (_isArray) {\n if (_i >= _iterator.length) break;\n _ref = _iterator[_i++];\n } else {\n _i = _iterator.next();\n if (_i.done) break;\n _ref = _i.value;\n }\n\n var part = _ref;\n\n var _part$split = part.split('='),\n _part$split2 = _slicedToArray(_part$split, 2),\n name = _part$split2[0],\n value = _part$split2[1];\n\n switch (name) {\n case 'tel':\n number = value;\n break;\n\n case 'ext':\n ext = value;\n break;\n\n case 'phone-context':\n // Only \"country contexts\" are supported.\n // \"Domain contexts\" are ignored.\n if (value[0] === '+') {\n number = value + number;\n }\n\n break;\n }\n } // If the phone number is not viable, then abort.\n\n\n if (!isViablePhoneNumber(number)) {\n return {};\n }\n\n var result = {\n number: number\n };\n\n if (ext) {\n result.ext = ext;\n }\n\n return result;\n}\n/**\r\n * @param {object} - `{ ?number, ?extension }`.\r\n * @return {string} Phone URI (RFC 3966).\r\n */\n\nexport function formatRFC3966(_ref2) {\n var number = _ref2.number,\n ext = _ref2.ext;\n\n if (!number) {\n return '';\n }\n\n if (number[0] !== '+') {\n throw new Error(\"\\\"formatRFC3966()\\\" expects \\\"number\\\" to be in E.164 format.\");\n }\n\n return \"tel:\".concat(number).concat(ext ? ';ext=' + ext : '');\n}\n//# sourceMappingURL=RFC3966.js.map","import { VALID_PUNCTUATION } from '../constants'; // Removes brackets and replaces dashes with spaces.\n//\n// E.g. \"(999) 111-22-33\" -> \"999 111 22 33\"\n//\n// For some reason Google's metadata contains ``s with brackets and dashes.\n// Meanwhile, there's no single opinion about using punctuation in international phone numbers.\n//\n// For example, Google's `` for USA is `+1 213-373-4253`.\n// And here's a quote from WikiPedia's \"North American Numbering Plan\" page:\n// https://en.wikipedia.org/wiki/North_American_Numbering_Plan\n//\n// \"The country calling code for all countries participating in the NANP is 1.\n// In international format, an NANP number should be listed as +1 301 555 01 00,\n// where 301 is an area code (Maryland).\"\n//\n// I personally prefer the international format without any punctuation.\n// For example, brackets are remnants of the old age, meaning that the\n// phone number part in brackets (so called \"area code\") can be omitted\n// if dialing within the same \"area\".\n// And hyphens were clearly introduced for splitting local numbers into memorizable groups.\n// For example, remembering \"5553535\" is difficult but \"555-35-35\" is much simpler.\n// Imagine a man taking a bus from home to work and seeing an ad with a phone number.\n// He has a couple of seconds to memorize that number until it passes by.\n// If it were spaces instead of hyphens the man wouldn't necessarily get it,\n// but with hyphens instead of spaces the grouping is more explicit.\n// I personally think that hyphens introduce visual clutter,\n// so I prefer replacing them with spaces in international numbers.\n// In the modern age all output is done on displays where spaces are clearly distinguishable\n// so hyphens can be safely replaced with spaces without losing any legibility.\n//\n\nexport default function applyInternationalSeparatorStyle(formattedNumber) {\n return formattedNumber.replace(new RegExp(\"[\".concat(VALID_PUNCTUATION, \"]+\"), 'g'), ' ').trim();\n}\n//# sourceMappingURL=applyInternationalSeparatorStyle.js.map","import mergeArrays from './mergeArrays';\nexport default function checkNumberLength(nationalNumber, metadata) {\n return checkNumberLengthForType(nationalNumber, undefined, metadata);\n} // Checks whether a number is possible for the country based on its length.\n// Should only be called for the \"new\" metadata which has \"possible lengths\".\n\nexport function checkNumberLengthForType(nationalNumber, type, metadata) {\n var type_info = metadata.type(type); // There should always be \"\" set for every type element.\n // This is declared in the XML schema.\n // For size efficiency, where a sub-description (e.g. fixed-line)\n // has the same \"\" as the \"general description\", this is missing,\n // so we fall back to the \"general description\". Where no numbers of the type\n // exist at all, there is one possible length (-1) which is guaranteed\n // not to match the length of any real phone number.\n\n var possible_lengths = type_info && type_info.possibleLengths() || metadata.possibleLengths(); // let local_lengths = type_info && type.possibleLengthsLocal() || metadata.possibleLengthsLocal()\n // Metadata before version `1.0.18` didn't contain `possible_lengths`.\n\n if (!possible_lengths) {\n return 'IS_POSSIBLE';\n }\n\n if (type === 'FIXED_LINE_OR_MOBILE') {\n // No such country in metadata.\n\n /* istanbul ignore next */\n if (!metadata.type('FIXED_LINE')) {\n // The rare case has been encountered where no fixedLine data is available\n // (true for some non-geographic entities), so we just check mobile.\n return checkNumberLengthForType(nationalNumber, 'MOBILE', metadata);\n }\n\n var mobile_type = metadata.type('MOBILE');\n\n if (mobile_type) {\n // Merge the mobile data in if there was any. \"Concat\" creates a new\n // array, it doesn't edit possible_lengths in place, so we don't need a copy.\n // Note that when adding the possible lengths from mobile, we have\n // to again check they aren't empty since if they are this indicates\n // they are the same as the general desc and should be obtained from there.\n possible_lengths = mergeArrays(possible_lengths, mobile_type.possibleLengths()); // The current list is sorted; we need to merge in the new list and\n // re-sort (duplicates are okay). Sorting isn't so expensive because\n // the lists are very small.\n // if (local_lengths) {\n // \tlocal_lengths = mergeArrays(local_lengths, mobile_type.possibleLengthsLocal())\n // } else {\n // \tlocal_lengths = mobile_type.possibleLengthsLocal()\n // }\n }\n } // If the type doesn't exist then return 'INVALID_LENGTH'.\n else if (type && !type_info) {\n return 'INVALID_LENGTH';\n }\n\n var actual_length = nationalNumber.length; // In `libphonenumber-js` all \"local-only\" formats are dropped for simplicity.\n // // This is safe because there is never an overlap beween the possible lengths\n // // and the local-only lengths; this is checked at build time.\n // if (local_lengths && local_lengths.indexOf(nationalNumber.length) >= 0)\n // {\n // \treturn 'IS_POSSIBLE_LOCAL_ONLY'\n // }\n\n var minimum_length = possible_lengths[0];\n\n if (minimum_length === actual_length) {\n return 'IS_POSSIBLE';\n }\n\n if (minimum_length > actual_length) {\n return 'TOO_SHORT';\n }\n\n if (possible_lengths[possible_lengths.length - 1] < actual_length) {\n return 'TOO_LONG';\n } // We skip the first element since we've already checked it.\n\n\n return possible_lengths.indexOf(actual_length, 1) >= 0 ? 'IS_POSSIBLE' : 'INVALID_LENGTH';\n}\n//# sourceMappingURL=checkNumberLength.js.map","/**\r\n * Merges two arrays.\r\n * @param {*} a\r\n * @param {*} b\r\n * @return {*}\r\n */\nexport default function mergeArrays(a, b) {\n var merged = a.slice();\n\n for (var _iterator = b, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {\n var _ref;\n\n if (_isArray) {\n if (_i >= _iterator.length) break;\n _ref = _iterator[_i++];\n } else {\n _i = _iterator.next();\n if (_i.done) break;\n _ref = _i.value;\n }\n\n var element = _ref;\n\n if (a.indexOf(element) < 0) {\n merged.push(element);\n }\n }\n\n return merged.sort(function (a, b) {\n return a - b;\n }); // ES6 version, requires Set polyfill.\n // let merged = new Set(a)\n // for (const element of b) {\n // \tmerged.add(i)\n // }\n // return Array.from(merged).sort((a, b) => a - b)\n}\n//# sourceMappingURL=mergeArrays.js.map","import { VALID_DIGITS } from '../../constants'; // The RFC 3966 format for extensions.\n\nvar RFC3966_EXTN_PREFIX = ';ext=';\n/**\r\n * Helper method for constructing regular expressions for parsing. Creates\r\n * an expression that captures up to max_length digits.\r\n * @return {string} RegEx pattern to capture extension digits.\r\n */\n\nvar getExtensionDigitsPattern = function getExtensionDigitsPattern(maxLength) {\n return \"([\".concat(VALID_DIGITS, \"]{1,\").concat(maxLength, \"})\");\n};\n/**\r\n * Helper initialiser method to create the regular-expression pattern to match\r\n * extensions.\r\n * Copy-pasted from Google's `libphonenumber`:\r\n * https://github.com/google/libphonenumber/blob/55b2646ec9393f4d3d6661b9c82ef9e258e8b829/javascript/i18n/phonenumbers/phonenumberutil.js#L759-L766\r\n * @return {string} RegEx pattern to capture extensions.\r\n */\n\n\nexport default function createExtensionPattern(purpose) {\n // We cap the maximum length of an extension based on the ambiguity of the way\n // the extension is prefixed. As per ITU, the officially allowed length for\n // extensions is actually 40, but we don't support this since we haven't seen real\n // examples and this introduces many false interpretations as the extension labels\n // are not standardized.\n\n /** @type {string} */\n var extLimitAfterExplicitLabel = '20';\n /** @type {string} */\n\n var extLimitAfterLikelyLabel = '15';\n /** @type {string} */\n\n var extLimitAfterAmbiguousChar = '9';\n /** @type {string} */\n\n var extLimitWhenNotSure = '6';\n /** @type {string} */\n\n var possibleSeparatorsBetweenNumberAndExtLabel = \"[ \\xA0\\\\t,]*\"; // Optional full stop (.) or colon, followed by zero or more spaces/tabs/commas.\n\n /** @type {string} */\n\n var possibleCharsAfterExtLabel = \"[:\\\\.\\uFF0E]?[ \\xA0\\\\t,-]*\";\n /** @type {string} */\n\n var optionalExtnSuffix = \"#?\"; // Here the extension is called out in more explicit way, i.e mentioning it obvious\n // patterns like \"ext.\".\n\n /** @type {string} */\n\n var explicitExtLabels = \"(?:e?xt(?:ensi(?:o\\u0301?|\\xF3))?n?|\\uFF45?\\uFF58\\uFF54\\uFF4E?|\\u0434\\u043E\\u0431|anexo)\"; // One-character symbols that can be used to indicate an extension, and less\n // commonly used or more ambiguous extension labels.\n\n /** @type {string} */\n\n var ambiguousExtLabels = \"(?:[x\\uFF58#\\uFF03~\\uFF5E]|int|\\uFF49\\uFF4E\\uFF54)\"; // When extension is not separated clearly.\n\n /** @type {string} */\n\n var ambiguousSeparator = \"[- ]+\"; // This is the same as possibleSeparatorsBetweenNumberAndExtLabel, but not matching\n // comma as extension label may have it.\n\n /** @type {string} */\n\n var possibleSeparatorsNumberExtLabelNoComma = \"[ \\xA0\\\\t]*\"; // \",,\" is commonly used for auto dialling the extension when connected. First\n // comma is matched through possibleSeparatorsBetweenNumberAndExtLabel, so we do\n // not repeat it here. Semi-colon works in Iphone and Android also to pop up a\n // button with the extension number following.\n\n /** @type {string} */\n\n var autoDiallingAndExtLabelsFound = \"(?:,{2}|;)\";\n /** @type {string} */\n\n var rfcExtn = RFC3966_EXTN_PREFIX + getExtensionDigitsPattern(extLimitAfterExplicitLabel);\n /** @type {string} */\n\n var explicitExtn = possibleSeparatorsBetweenNumberAndExtLabel + explicitExtLabels + possibleCharsAfterExtLabel + getExtensionDigitsPattern(extLimitAfterExplicitLabel) + optionalExtnSuffix;\n /** @type {string} */\n\n var ambiguousExtn = possibleSeparatorsBetweenNumberAndExtLabel + ambiguousExtLabels + possibleCharsAfterExtLabel + getExtensionDigitsPattern(extLimitAfterAmbiguousChar) + optionalExtnSuffix;\n /** @type {string} */\n\n var americanStyleExtnWithSuffix = ambiguousSeparator + getExtensionDigitsPattern(extLimitWhenNotSure) + \"#\";\n /** @type {string} */\n\n var autoDiallingExtn = possibleSeparatorsNumberExtLabelNoComma + autoDiallingAndExtLabelsFound + possibleCharsAfterExtLabel + getExtensionDigitsPattern(extLimitAfterLikelyLabel) + optionalExtnSuffix;\n /** @type {string} */\n\n var onlyCommasExtn = possibleSeparatorsNumberExtLabelNoComma + \"(?:,)+\" + possibleCharsAfterExtLabel + getExtensionDigitsPattern(extLimitAfterAmbiguousChar) + optionalExtnSuffix; // The first regular expression covers RFC 3966 format, where the extension is added\n // using \";ext=\". The second more generic where extension is mentioned with explicit\n // labels like \"ext:\". In both the above cases we allow more numbers in extension than\n // any other extension labels. The third one captures when single character extension\n // labels or less commonly used labels are used. In such cases we capture fewer\n // extension digits in order to reduce the chance of falsely interpreting two\n // numbers beside each other as a number + extension. The fourth one covers the\n // special case of American numbers where the extension is written with a hash\n // at the end, such as \"- 503#\". The fifth one is exclusively for extension\n // autodialling formats which are used when dialling and in this case we accept longer\n // extensions. The last one is more liberal on the number of commas that acts as\n // extension labels, so we have a strict cap on the number of digits in such extensions.\n\n return rfcExtn + \"|\" + explicitExtn + \"|\" + ambiguousExtn + \"|\" + americanStyleExtnWithSuffix + \"|\" + autoDiallingExtn + \"|\" + onlyCommasExtn;\n}\n//# sourceMappingURL=createExtensionPattern.js.map","import stripIddPrefix from './stripIddPrefix';\nimport extractCountryCallingCodeFromInternationalNumberWithoutPlusSign from './extractCountryCallingCodeFromInternationalNumberWithoutPlusSign';\nimport Metadata from '../metadata';\nimport { MAX_LENGTH_COUNTRY_CODE } from '../constants';\n/**\r\n * Converts a phone number digits (possibly with a `+`)\r\n * into a calling code and the rest phone number digits.\r\n * The \"rest phone number digits\" could include\r\n * a national prefix, carrier code, and national\r\n * (significant) number.\r\n * @param {string} number — Phone number digits (possibly with a `+`).\r\n * @param {string} [country] — Default country.\r\n * @param {string} [callingCode] — Default calling code (some phone numbering plans are non-geographic).\r\n * @param {object} metadata\r\n * @return {object} `{ countryCallingCode: string?, number: string }`\r\n * @example\r\n * // Returns `{ countryCallingCode: \"1\", number: \"2133734253\" }`.\r\n * extractCountryCallingCode('2133734253', 'US', null, metadata)\r\n * extractCountryCallingCode('2133734253', null, '1', metadata)\r\n * extractCountryCallingCode('+12133734253', null, null, metadata)\r\n * extractCountryCallingCode('+12133734253', 'RU', null, metadata)\r\n */\n\nexport default function extractCountryCallingCode(number, country, callingCode, metadata) {\n if (!number) {\n return {};\n } // If this is not an international phone number,\n // then either extract an \"IDD\" prefix, or extract a\n // country calling code from a number by autocorrecting it\n // by prepending a leading `+` in cases when it starts\n // with the country calling code.\n // https://wikitravel.org/en/International_dialling_prefix\n // https://github.com/catamphetamine/libphonenumber-js/issues/376\n\n\n if (number[0] !== '+') {\n // Convert an \"out-of-country\" dialing phone number\n // to a proper international phone number.\n var numberWithoutIDD = stripIddPrefix(number, country, callingCode, metadata); // If an IDD prefix was stripped then\n // convert the number to international one\n // for subsequent parsing.\n\n if (numberWithoutIDD && numberWithoutIDD !== number) {\n number = '+' + numberWithoutIDD;\n } else {\n // Check to see if the number starts with the country calling code\n // for the default country. If so, we remove the country calling code,\n // and do some checks on the validity of the number before and after.\n // https://github.com/catamphetamine/libphonenumber-js/issues/376\n if (country || callingCode) {\n var _extractCountryCallin = extractCountryCallingCodeFromInternationalNumberWithoutPlusSign(number, country, callingCode, metadata),\n countryCallingCode = _extractCountryCallin.countryCallingCode,\n shorterNumber = _extractCountryCallin.number;\n\n if (countryCallingCode) {\n return {\n countryCallingCode: countryCallingCode,\n number: shorterNumber\n };\n }\n }\n\n return {\n number: number\n };\n }\n } // Fast abortion: country codes do not begin with a '0'\n\n\n if (number[1] === '0') {\n return {};\n }\n\n metadata = new Metadata(metadata); // The thing with country phone codes\n // is that they are orthogonal to each other\n // i.e. there's no such country phone code A\n // for which country phone code B exists\n // where B starts with A.\n // Therefore, while scanning digits,\n // if a valid country code is found,\n // that means that it is the country code.\n //\n\n var i = 2;\n\n while (i - 1 <= MAX_LENGTH_COUNTRY_CODE && i <= number.length) {\n var _countryCallingCode = number.slice(1, i);\n\n if (metadata.hasCallingCode(_countryCallingCode)) {\n metadata.selectNumberingPlan(_countryCallingCode);\n return {\n countryCallingCode: _countryCallingCode,\n number: number.slice(i)\n };\n }\n\n i++;\n }\n\n return {};\n}\n//# sourceMappingURL=extractCountryCallingCode.js.map","import Metadata from '../metadata';\nimport matchesEntirely from './matchesEntirely';\nimport extractNationalNumber from './extractNationalNumber';\nimport checkNumberLength from './checkNumberLength';\nimport getCountryCallingCode from '../getCountryCallingCode';\n/**\r\n * Sometimes some people incorrectly input international phone numbers\r\n * without the leading `+`. This function corrects such input.\r\n * @param {string} number — Phone number digits.\r\n * @param {string?} country\r\n * @param {string?} callingCode\r\n * @param {object} metadata\r\n * @return {object} `{ countryCallingCode: string?, number: string }`.\r\n */\n\nexport default function extractCountryCallingCodeFromInternationalNumberWithoutPlusSign(number, country, callingCode, metadata) {\n var countryCallingCode = country ? getCountryCallingCode(country, metadata) : callingCode;\n\n if (number.indexOf(countryCallingCode) === 0) {\n metadata = new Metadata(metadata);\n metadata.selectNumberingPlan(country, callingCode);\n var possibleShorterNumber = number.slice(countryCallingCode.length);\n\n var _extractNationalNumbe = extractNationalNumber(possibleShorterNumber, metadata),\n possibleShorterNationalNumber = _extractNationalNumbe.nationalNumber;\n\n var _extractNationalNumbe2 = extractNationalNumber(number, metadata),\n nationalNumber = _extractNationalNumbe2.nationalNumber; // If the number was not valid before but is valid now,\n // or if it was too long before, we consider the number\n // with the country calling code stripped to be a better result\n // and keep that instead.\n // For example, in Germany (+49), `49` is a valid area code,\n // so if a number starts with `49`, it could be both a valid\n // national German number or an international number without\n // a leading `+`.\n\n\n if (!matchesEntirely(nationalNumber, metadata.nationalNumberPattern()) && matchesEntirely(possibleShorterNationalNumber, metadata.nationalNumberPattern()) || checkNumberLength(nationalNumber, metadata) === 'TOO_LONG') {\n return {\n countryCallingCode: countryCallingCode,\n number: possibleShorterNumber\n };\n }\n }\n\n return {\n number: number\n };\n}\n//# sourceMappingURL=extractCountryCallingCodeFromInternationalNumberWithoutPlusSign.js.map","import extractNationalNumberFromPossiblyIncompleteNumber from './extractNationalNumberFromPossiblyIncompleteNumber';\nimport matchesEntirely from './matchesEntirely';\nimport checkNumberLength from './checkNumberLength';\n/**\r\n * Strips national prefix and carrier code from a complete phone number.\r\n * The difference from the non-\"FromCompleteNumber\" function is that\r\n * it won't extract national prefix if the resultant number is too short\r\n * to be a complete number for the selected phone numbering plan.\r\n * @param {string} number — Complete phone number digits.\r\n * @param {Metadata} metadata — Metadata with a phone numbering plan selected.\r\n * @return {object} `{ nationalNumber: string, carrierCode: string? }`.\r\n */\n\nexport default function extractNationalNumber(number, metadata) {\n // Parsing national prefixes and carrier codes\n // is only required for local phone numbers\n // but some people don't understand that\n // and sometimes write international phone numbers\n // with national prefixes (or maybe even carrier codes).\n // http://ucken.blogspot.ru/2016/03/trunk-prefixes-in-skype4b.html\n // Google's original library forgives such mistakes\n // and so does this library, because it has been requested:\n // https://github.com/catamphetamine/libphonenumber-js/issues/127\n var _extractNationalNumbe = extractNationalNumberFromPossiblyIncompleteNumber(number, metadata),\n nationalNumber = _extractNationalNumbe.nationalNumber,\n carrierCode = _extractNationalNumbe.carrierCode;\n\n if (!shouldExtractNationalPrefix(number, nationalNumber, metadata)) {\n // Don't strip the national prefix.\n return {\n nationalNumber: number\n };\n } // If a national prefix has been extracted, check to see\n // if the resultant number isn't too short.\n // Same code in Google's `libphonenumber`:\n // https://github.com/google/libphonenumber/blob/e326fa1fc4283bb05eb35cb3c15c18f98a31af33/java/libphonenumber/src/com/google/i18n/phonenumbers/PhoneNumberUtil.java#L3291-L3302\n // For some reason, they do this check right after the `national_number_pattern` check\n // this library does in `shouldExtractNationalPrefix()` function.\n // Why is there a second \"resultant\" number validity check?\n // They don't provide an explanation.\n // This library just copies the behavior.\n\n\n if (number.length !== nationalNumber.length + (carrierCode ? carrierCode.length : 0)) {\n // If not using legacy generated metadata (before version `1.0.18`)\n // then it has \"possible lengths\", so use those to validate the number length.\n if (metadata.possibleLengths()) {\n // \"We require that the NSN remaining after stripping the national prefix and\n // carrier code be long enough to be a possible length for the region.\n // Otherwise, we don't do the stripping, since the original number could be\n // a valid short number.\"\n // https://github.com/google/libphonenumber/blob/876268eb1ad6cdc1b7b5bef17fc5e43052702d57/java/libphonenumber/src/com/google/i18n/phonenumbers/PhoneNumberUtil.java#L3236-L3250\n switch (checkNumberLength(nationalNumber, metadata)) {\n case 'TOO_SHORT':\n case 'INVALID_LENGTH':\n // case 'IS_POSSIBLE_LOCAL_ONLY':\n // Don't strip the national prefix.\n return {\n nationalNumber: number\n };\n }\n }\n }\n\n return {\n nationalNumber: nationalNumber,\n carrierCode: carrierCode\n };\n} // In some countries, the same digit could be a national prefix\n// or a leading digit of a valid phone number.\n// For example, in Russia, national prefix is `8`,\n// and also `800 555 35 35` is a valid number\n// in which `8` is not a national prefix, but the first digit\n// of a national (significant) number.\n// Same's with Belarus:\n// `82004910060` is a valid national (significant) number,\n// but `2004910060` is not.\n// To support such cases (to prevent the code from always stripping\n// national prefix), a condition is imposed: a national prefix\n// is not extracted when the original number is \"viable\" and the\n// resultant number is not, a \"viable\" national number being the one\n// that matches `national_number_pattern`.\n\nfunction shouldExtractNationalPrefix(number, nationalSignificantNumber, metadata) {\n // The equivalent in Google's code is:\n // https://github.com/google/libphonenumber/blob/e326fa1fc4283bb05eb35cb3c15c18f98a31af33/java/libphonenumber/src/com/google/i18n/phonenumbers/PhoneNumberUtil.java#L2969-L3004\n if (matchesEntirely(number, metadata.nationalNumberPattern()) && !matchesEntirely(nationalSignificantNumber, metadata.nationalNumberPattern())) {\n return false;\n } // Just \"possible\" number check would be more relaxed, so it's not used.\n // if (isPossibleNumber(number, metadata) &&\n // \t!isPossibleNumber(numberWithNationalPrefixExtracted, metadata)) {\n // \treturn false\n // }\n\n\n return true;\n}\n//# sourceMappingURL=extractNationalNumber.js.map","/**\r\n * Strips any national prefix (such as 0, 1) present in a\r\n * (possibly incomplete) number provided.\r\n * \"Carrier codes\" are only used in Colombia and Brazil,\r\n * and only when dialing within those countries from a mobile phone to a fixed line number.\r\n * Sometimes it won't actually strip national prefix\r\n * and will instead prepend some digits to the `number`:\r\n * for example, when number `2345678` is passed with `VI` country selected,\r\n * it will return `{ number: \"3402345678\" }`, because `340` area code is prepended.\r\n * @param {string} number — National number digits.\r\n * @param {object} metadata — Metadata with country selected.\r\n * @return {object} `{ nationalNumber: string, nationalPrefix: string? carrierCode: string? }`.\r\n */\nexport default function extractNationalNumberFromPossiblyIncompleteNumber(number, metadata) {\n if (number && metadata.numberingPlan.nationalPrefixForParsing()) {\n // See METADATA.md for the description of\n // `national_prefix_for_parsing` and `national_prefix_transform_rule`.\n // Attempt to parse the first digits as a national prefix.\n var prefixPattern = new RegExp('^(?:' + metadata.numberingPlan.nationalPrefixForParsing() + ')');\n var prefixMatch = prefixPattern.exec(number);\n\n if (prefixMatch) {\n var nationalNumber;\n var carrierCode; // https://gitlab.com/catamphetamine/libphonenumber-js/-/blob/master/METADATA.md#national_prefix_for_parsing--national_prefix_transform_rule\n // If a `national_prefix_for_parsing` has any \"capturing groups\"\n // then it means that the national (significant) number is equal to\n // those \"capturing groups\" transformed via `national_prefix_transform_rule`,\n // and nothing could be said about the actual national prefix:\n // what is it and was it even there.\n // If a `national_prefix_for_parsing` doesn't have any \"capturing groups\",\n // then everything it matches is a national prefix.\n // To determine whether `national_prefix_for_parsing` matched any\n // \"capturing groups\", the value of the result of calling `.exec()`\n // is looked at, and if it has non-undefined values where there're\n // \"capturing groups\" in the regular expression, then it means\n // that \"capturing groups\" have been matched.\n // It's not possible to tell whether there'll be any \"capturing gropus\"\n // before the matching process, because a `national_prefix_for_parsing`\n // could exhibit both behaviors.\n\n var capturedGroupsCount = prefixMatch.length - 1;\n var hasCapturedGroups = capturedGroupsCount > 0 && prefixMatch[capturedGroupsCount];\n\n if (metadata.nationalPrefixTransformRule() && hasCapturedGroups) {\n nationalNumber = number.replace(prefixPattern, metadata.nationalPrefixTransformRule()); // If there's more than one captured group,\n // then carrier code is the second one.\n\n if (capturedGroupsCount > 1) {\n carrierCode = prefixMatch[1];\n }\n } // If there're no \"capturing groups\",\n // or if there're \"capturing groups\" but no\n // `national_prefix_transform_rule`,\n // then just strip the national prefix from the number,\n // and possibly a carrier code.\n // Seems like there could be more.\n else {\n // `prefixBeforeNationalNumber` is the whole substring matched by\n // the `national_prefix_for_parsing` regular expression.\n // There seem to be no guarantees that it's just a national prefix.\n // For example, if there's a carrier code, it's gonna be a\n // part of `prefixBeforeNationalNumber` too.\n var prefixBeforeNationalNumber = prefixMatch[0];\n nationalNumber = number.slice(prefixBeforeNationalNumber.length); // If there's at least one captured group,\n // then carrier code is the first one.\n\n if (hasCapturedGroups) {\n carrierCode = prefixMatch[1];\n }\n } // Tries to guess whether a national prefix was present in the input.\n // This is not something copy-pasted from Google's library:\n // they don't seem to have an equivalent for that.\n // So this isn't an \"officially approved\" way of doing something like that.\n // But since there seems no other existing method, this library uses it.\n\n\n var nationalPrefix;\n\n if (hasCapturedGroups) {\n var possiblePositionOfTheFirstCapturedGroup = number.indexOf(prefixMatch[1]);\n var possibleNationalPrefix = number.slice(0, possiblePositionOfTheFirstCapturedGroup); // Example: an Argentinian (AR) phone number `0111523456789`.\n // `prefixMatch[0]` is `01115`, and `$1` is `11`,\n // and the rest of the phone number is `23456789`.\n // The national number is transformed via `9$1` to `91123456789`.\n // National prefix `0` is detected being present at the start.\n // if (possibleNationalPrefix.indexOf(metadata.numberingPlan.nationalPrefix()) === 0) {\n\n if (possibleNationalPrefix === metadata.numberingPlan.nationalPrefix()) {\n nationalPrefix = metadata.numberingPlan.nationalPrefix();\n }\n } else {\n nationalPrefix = prefixMatch[0];\n }\n\n return {\n nationalNumber: nationalNumber,\n nationalPrefix: nationalPrefix,\n carrierCode: carrierCode\n };\n }\n }\n\n return {\n nationalNumber: number\n };\n}\n//# sourceMappingURL=extractNationalNumberFromPossiblyIncompleteNumber.js.map","import applyInternationalSeparatorStyle from './applyInternationalSeparatorStyle'; // This was originally set to $1 but there are some countries for which the\n// first group is not used in the national pattern (e.g. Argentina) so the $1\n// group does not match correctly. Therefore, we use `\\d`, so that the first\n// group actually used in the pattern will be matched.\n\nexport var FIRST_GROUP_PATTERN = /(\\$\\d)/;\nexport default function formatNationalNumberUsingFormat(number, format, _ref) {\n var useInternationalFormat = _ref.useInternationalFormat,\n withNationalPrefix = _ref.withNationalPrefix,\n carrierCode = _ref.carrierCode,\n metadata = _ref.metadata;\n var formattedNumber = number.replace(new RegExp(format.pattern()), useInternationalFormat ? format.internationalFormat() : // This library doesn't use `domestic_carrier_code_formatting_rule`,\n // because that one is only used when formatting phone numbers\n // for dialing from a mobile phone, and this is not a dialing library.\n // carrierCode && format.domesticCarrierCodeFormattingRule()\n // \t// First, replace the $CC in the formatting rule with the desired carrier code.\n // \t// Then, replace the $FG in the formatting rule with the first group\n // \t// and the carrier code combined in the appropriate way.\n // \t? format.format().replace(FIRST_GROUP_PATTERN, format.domesticCarrierCodeFormattingRule().replace('$CC', carrierCode))\n // \t: (\n // \t\twithNationalPrefix && format.nationalPrefixFormattingRule()\n // \t\t\t? format.format().replace(FIRST_GROUP_PATTERN, format.nationalPrefixFormattingRule())\n // \t\t\t: format.format()\n // \t)\n withNationalPrefix && format.nationalPrefixFormattingRule() ? format.format().replace(FIRST_GROUP_PATTERN, format.nationalPrefixFormattingRule()) : format.format());\n\n if (useInternationalFormat) {\n return applyInternationalSeparatorStyle(formattedNumber);\n }\n\n return formattedNumber;\n}\n//# sourceMappingURL=formatNationalNumberUsingFormat.js.map","import Metadata from '../metadata';\nimport getNumberType from './getNumberType';\nvar USE_NON_GEOGRAPHIC_COUNTRY_CODE = false;\nexport default function getCountryByCallingCode(callingCode, nationalPhoneNumber, metadata) {\n /* istanbul ignore if */\n if (USE_NON_GEOGRAPHIC_COUNTRY_CODE) {\n if (metadata.isNonGeographicCallingCode(callingCode)) {\n return '001';\n }\n } // Is always non-empty, because `callingCode` is always valid\n\n\n var possibleCountries = metadata.getCountryCodesForCallingCode(callingCode);\n\n if (!possibleCountries) {\n return;\n } // If there's just one country corresponding to the country code,\n // then just return it, without further phone number digits validation.\n\n\n if (possibleCountries.length === 1) {\n return possibleCountries[0];\n }\n\n return selectCountryFromList(possibleCountries, nationalPhoneNumber, metadata.metadata);\n}\n\nfunction selectCountryFromList(possibleCountries, nationalPhoneNumber, metadata) {\n // Re-create `metadata` because it will be selecting a `country`.\n metadata = new Metadata(metadata);\n\n for (var _iterator = possibleCountries, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {\n var _ref;\n\n if (_isArray) {\n if (_i >= _iterator.length) break;\n _ref = _iterator[_i++];\n } else {\n _i = _iterator.next();\n if (_i.done) break;\n _ref = _i.value;\n }\n\n var country = _ref;\n metadata.country(country); // Leading digits check would be the simplest one\n\n if (metadata.leadingDigits()) {\n if (nationalPhoneNumber && nationalPhoneNumber.search(metadata.leadingDigits()) === 0) {\n return country;\n }\n } // Else perform full validation with all of those\n // fixed-line/mobile/etc regular expressions.\n else if (getNumberType({\n phone: nationalPhoneNumber,\n country: country\n }, undefined, metadata.metadata)) {\n return country;\n }\n }\n}\n//# sourceMappingURL=getCountryByCallingCode.js.map","import Metadata from '../metadata';\nimport matchesEntirely from './matchesEntirely';\nvar NON_FIXED_LINE_PHONE_TYPES = ['MOBILE', 'PREMIUM_RATE', 'TOLL_FREE', 'SHARED_COST', 'VOIP', 'PERSONAL_NUMBER', 'PAGER', 'UAN', 'VOICEMAIL']; // Finds out national phone number type (fixed line, mobile, etc)\n\nexport default function getNumberType(input, options, metadata) {\n // If assigning the `{}` default value is moved to the arguments above,\n // code coverage would decrease for some weird reason.\n options = options || {}; // When `parse()` returned `{}`\n // meaning that the phone number is not a valid one.\n\n if (!input.country) {\n return;\n }\n\n metadata = new Metadata(metadata);\n metadata.selectNumberingPlan(input.country, input.countryCallingCode);\n var nationalNumber = options.v2 ? input.nationalNumber : input.phone; // The following is copy-pasted from the original function:\n // https://github.com/googlei18n/libphonenumber/blob/3ea547d4fbaa2d0b67588904dfa5d3f2557c27ff/javascript/i18n/phonenumbers/phonenumberutil.js#L2835\n // Is this national number even valid for this country\n\n if (!matchesEntirely(nationalNumber, metadata.nationalNumberPattern())) {\n return;\n } // Is it fixed line number\n\n\n if (isNumberTypeEqualTo(nationalNumber, 'FIXED_LINE', metadata)) {\n // Because duplicate regular expressions are removed\n // to reduce metadata size, if \"mobile\" pattern is \"\"\n // then it means it was removed due to being a duplicate of the fixed-line pattern.\n //\n if (metadata.type('MOBILE') && metadata.type('MOBILE').pattern() === '') {\n return 'FIXED_LINE_OR_MOBILE';\n } // v1 metadata.\n // Legacy.\n // Deprecated.\n\n\n if (!metadata.type('MOBILE')) {\n return 'FIXED_LINE_OR_MOBILE';\n } // Check if the number happens to qualify as both fixed line and mobile.\n // (no such country in the minimal metadata set)\n\n /* istanbul ignore if */\n\n\n if (isNumberTypeEqualTo(nationalNumber, 'MOBILE', metadata)) {\n return 'FIXED_LINE_OR_MOBILE';\n }\n\n return 'FIXED_LINE';\n }\n\n for (var _i = 0, _NON_FIXED_LINE_PHONE = NON_FIXED_LINE_PHONE_TYPES; _i < _NON_FIXED_LINE_PHONE.length; _i++) {\n var type = _NON_FIXED_LINE_PHONE[_i];\n\n if (isNumberTypeEqualTo(nationalNumber, type, metadata)) {\n return type;\n }\n }\n}\nexport function isNumberTypeEqualTo(nationalNumber, type, metadata) {\n type = metadata.type(type);\n\n if (!type || !type.pattern()) {\n return false;\n } // Check if any possible number lengths are present;\n // if so, we use them to avoid checking\n // the validation pattern if they don't match.\n // If they are absent, this means they match\n // the general description, which we have\n // already checked before a specific number type.\n\n\n if (type.possibleLengths() && type.possibleLengths().indexOf(nationalNumber.length) < 0) {\n return false;\n }\n\n return matchesEntirely(nationalNumber, type.pattern());\n}\n//# sourceMappingURL=getNumberType.js.map","import { MIN_LENGTH_FOR_NSN, VALID_DIGITS, VALID_PUNCTUATION, PLUS_CHARS } from '../constants';\nimport createExtensionPattern from './extension/createExtensionPattern'; // Regular expression of viable phone numbers. This is location independent.\n// Checks we have at least three leading digits, and only valid punctuation,\n// alpha characters and digits in the phone number. Does not include extension\n// data. The symbol 'x' is allowed here as valid punctuation since it is often\n// used as a placeholder for carrier codes, for example in Brazilian phone\n// numbers. We also allow multiple '+' characters at the start.\n//\n// Corresponds to the following:\n// [digits]{minLengthNsn}|\n// plus_sign*\n// (([punctuation]|[star])*[digits]){3,}([punctuation]|[star]|[digits]|[alpha])*\n//\n// The first reg-ex is to allow short numbers (two digits long) to be parsed if\n// they are entered as \"15\" etc, but only if there is no punctuation in them.\n// The second expression restricts the number of digits to three or more, but\n// then allows them to be in international form, and to have alpha-characters\n// and punctuation. We split up the two reg-exes here and combine them when\n// creating the reg-ex VALID_PHONE_NUMBER_PATTERN itself so we can prefix it\n// with ^ and append $ to each branch.\n//\n// \"Note VALID_PUNCTUATION starts with a -,\n// so must be the first in the range\" (c) Google devs.\n// (wtf did they mean by saying that; probably nothing)\n//\n\nvar MIN_LENGTH_PHONE_NUMBER_PATTERN = '[' + VALID_DIGITS + ']{' + MIN_LENGTH_FOR_NSN + '}'; //\n// And this is the second reg-exp:\n// (see MIN_LENGTH_PHONE_NUMBER_PATTERN for a full description of this reg-exp)\n//\n\nexport var VALID_PHONE_NUMBER = '[' + PLUS_CHARS + ']{0,1}' + '(?:' + '[' + VALID_PUNCTUATION + ']*' + '[' + VALID_DIGITS + ']' + '){3,}' + '[' + VALID_PUNCTUATION + VALID_DIGITS + ']*';\nexport var VALID_PHONE_NUMBER_WITH_EXTENSION = VALID_PHONE_NUMBER + // Phone number extensions\n'(?:' + createExtensionPattern() + ')?'; // The combined regular expression for valid phone numbers:\n//\n\nvar VALID_PHONE_NUMBER_PATTERN = new RegExp( // Either a short two-digit-only phone number\n'^' + MIN_LENGTH_PHONE_NUMBER_PATTERN + '$' + '|' + // Or a longer fully parsed phone number (min 3 characters)\n'^' + VALID_PHONE_NUMBER_WITH_EXTENSION + '$', 'i'); // Checks to see if the string of characters could possibly be a phone number at\n// all. At the moment, checks to see that the string begins with at least 2\n// digits, ignoring any punctuation commonly found in phone numbers. This method\n// does not require the number to be normalized in advance - but does assume\n// that leading non-number symbols have been removed, such as by the method\n// `extract_possible_number`.\n//\n\nexport default function isViablePhoneNumber(number) {\n return number.length >= MIN_LENGTH_FOR_NSN && VALID_PHONE_NUMBER_PATTERN.test(number);\n}\n//# sourceMappingURL=isViablePhoneNumber.js.map","/**\r\n * Checks whether the entire input sequence can be matched\r\n * against the regular expression.\r\n * @return {boolean}\r\n */\nexport default function matchesEntirely(text, regular_expression) {\n // If assigning the `''` default value is moved to the arguments above,\n // code coverage would decrease for some weird reason.\n text = text || '';\n return new RegExp('^(?:' + regular_expression + ')$').test(text);\n}\n//# sourceMappingURL=matchesEntirely.js.map","// These mappings map a character (key) to a specific digit that should\n// replace it for normalization purposes. Non-European digits that\n// may be used in phone numbers are mapped to a European equivalent.\n//\n// E.g. in Iraq they don't write `+442323234` but rather `+٤٤٢٣٢٣٢٣٤`.\n//\nexport var DIGITS = {\n '0': '0',\n '1': '1',\n '2': '2',\n '3': '3',\n '4': '4',\n '5': '5',\n '6': '6',\n '7': '7',\n '8': '8',\n '9': '9',\n \"\\uFF10\": '0',\n // Fullwidth digit 0\n \"\\uFF11\": '1',\n // Fullwidth digit 1\n \"\\uFF12\": '2',\n // Fullwidth digit 2\n \"\\uFF13\": '3',\n // Fullwidth digit 3\n \"\\uFF14\": '4',\n // Fullwidth digit 4\n \"\\uFF15\": '5',\n // Fullwidth digit 5\n \"\\uFF16\": '6',\n // Fullwidth digit 6\n \"\\uFF17\": '7',\n // Fullwidth digit 7\n \"\\uFF18\": '8',\n // Fullwidth digit 8\n \"\\uFF19\": '9',\n // Fullwidth digit 9\n \"\\u0660\": '0',\n // Arabic-indic digit 0\n \"\\u0661\": '1',\n // Arabic-indic digit 1\n \"\\u0662\": '2',\n // Arabic-indic digit 2\n \"\\u0663\": '3',\n // Arabic-indic digit 3\n \"\\u0664\": '4',\n // Arabic-indic digit 4\n \"\\u0665\": '5',\n // Arabic-indic digit 5\n \"\\u0666\": '6',\n // Arabic-indic digit 6\n \"\\u0667\": '7',\n // Arabic-indic digit 7\n \"\\u0668\": '8',\n // Arabic-indic digit 8\n \"\\u0669\": '9',\n // Arabic-indic digit 9\n \"\\u06F0\": '0',\n // Eastern-Arabic digit 0\n \"\\u06F1\": '1',\n // Eastern-Arabic digit 1\n \"\\u06F2\": '2',\n // Eastern-Arabic digit 2\n \"\\u06F3\": '3',\n // Eastern-Arabic digit 3\n \"\\u06F4\": '4',\n // Eastern-Arabic digit 4\n \"\\u06F5\": '5',\n // Eastern-Arabic digit 5\n \"\\u06F6\": '6',\n // Eastern-Arabic digit 6\n \"\\u06F7\": '7',\n // Eastern-Arabic digit 7\n \"\\u06F8\": '8',\n // Eastern-Arabic digit 8\n \"\\u06F9\": '9' // Eastern-Arabic digit 9\n\n};\nexport function parseDigit(character) {\n return DIGITS[character];\n}\n/**\r\n * Parses phone number digits from a string.\r\n * Drops all punctuation leaving only digits.\r\n * Also converts wide-ascii and arabic-indic numerals to conventional numerals.\r\n * E.g. in Iraq they don't write `+442323234` but rather `+٤٤٢٣٢٣٢٣٤`.\r\n * @param {string} string\r\n * @return {string}\r\n * @example\r\n * ```js\r\n * parseDigits('8 (800) 555')\r\n * // Outputs '8800555'.\r\n * ```\r\n */\n\nexport default function parseDigits(string) {\n var result = ''; // Using `.split('')` here instead of normal `for ... of`\n // because the importing application doesn't neccessarily include an ES6 polyfill.\n // The `.split('')` approach discards \"exotic\" UTF-8 characters\n // (the ones consisting of four bytes) but digits\n // (including non-European ones) don't fall into that range\n // so such \"exotic\" characters would be discarded anyway.\n\n for (var _iterator = string.split(''), _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {\n var _ref;\n\n if (_isArray) {\n if (_i >= _iterator.length) break;\n _ref = _iterator[_i++];\n } else {\n _i = _iterator.next();\n if (_i.done) break;\n _ref = _i.value;\n }\n\n var character = _ref;\n var digit = parseDigit(character);\n\n if (digit) {\n result += digit;\n }\n }\n\n return result;\n}\n//# sourceMappingURL=parseDigits.js.map","import Metadata from '../metadata';\nimport { VALID_DIGITS } from '../constants';\nvar CAPTURING_DIGIT_PATTERN = new RegExp('([' + VALID_DIGITS + '])');\nexport default function stripIddPrefix(number, country, callingCode, metadata) {\n if (!country) {\n return;\n } // Check if the number is IDD-prefixed.\n\n\n var countryMetadata = new Metadata(metadata);\n countryMetadata.selectNumberingPlan(country, callingCode);\n var IDDPrefixPattern = new RegExp(countryMetadata.IDDPrefix());\n\n if (number.search(IDDPrefixPattern) !== 0) {\n return;\n } // Strip IDD prefix.\n\n\n number = number.slice(number.match(IDDPrefixPattern)[0].length); // If there're any digits after an IDD prefix,\n // then those digits are a country calling code.\n // Since no country code starts with a `0`,\n // the code below validates that the next digit (if present) is not `0`.\n\n var matchedGroups = number.match(CAPTURING_DIGIT_PATTERN);\n\n if (matchedGroups && matchedGroups[1] != null && matchedGroups[1].length > 0) {\n if (matchedGroups[1] === '0') {\n return;\n }\n }\n\n return number;\n}\n//# sourceMappingURL=stripIddPrefix.js.map","import Metadata from './metadata';\nimport checkNumberLength from './helpers/checkNumberLength';\nexport default function isPossiblePhoneNumber(input, options, metadata) {\n /* istanbul ignore if */\n if (options === undefined) {\n options = {};\n }\n\n metadata = new Metadata(metadata);\n\n if (options.v2) {\n if (!input.countryCallingCode) {\n throw new Error('Invalid phone number object passed');\n }\n\n metadata.selectNumberingPlan(input.countryCallingCode);\n } else {\n if (!input.phone) {\n return false;\n }\n\n if (input.country) {\n if (!metadata.hasCountry(input.country)) {\n throw new Error(\"Unknown country: \".concat(input.country));\n }\n\n metadata.country(input.country);\n } else {\n if (!input.countryCallingCode) {\n throw new Error('Invalid phone number object passed');\n }\n\n metadata.selectNumberingPlan(input.countryCallingCode);\n }\n }\n\n if (metadata.possibleLengths()) {\n return isPossibleNumber(input.phone || input.nationalNumber, metadata);\n } else {\n // There was a bug between `1.7.35` and `1.7.37` where \"possible_lengths\"\n // were missing for \"non-geographical\" numbering plans.\n // Just assume the number is possible in such cases:\n // it's unlikely that anyone generated their custom metadata\n // in that short period of time (one day).\n // This code can be removed in some future major version update.\n if (input.countryCallingCode && metadata.isNonGeographicCallingCode(input.countryCallingCode)) {\n // \"Non-geographic entities\" did't have `possibleLengths`\n // due to a bug in metadata generation process.\n return true;\n } else {\n throw new Error('Missing \"possibleLengths\" in metadata. Perhaps the metadata has been generated before v1.0.18.');\n }\n }\n}\nexport function isPossibleNumber(nationalNumber, metadata) {\n //, isInternational) {\n switch (checkNumberLength(nationalNumber, metadata)) {\n case 'IS_POSSIBLE':\n return true;\n // This library ignores \"local-only\" phone numbers (for simplicity).\n // See the readme for more info on what are \"local-only\" phone numbers.\n // case 'IS_POSSIBLE_LOCAL_ONLY':\n // \treturn !isInternational\n\n default:\n return false;\n }\n}\n//# sourceMappingURL=isPossibleNumber_.js.map","// Copy-pasted from:\n// https://github.com/substack/semver-compare/blob/master/index.js\n//\n// Inlining this function because some users reported issues with\n// importing from `semver-compare` in a browser with ES6 \"native\" modules.\n//\n// Fixes `semver-compare` not being able to compare versions with alpha/beta/etc \"tags\".\n// https://github.com/catamphetamine/libphonenumber-js/issues/381\nexport default function (a, b) {\n a = a.split('-');\n b = b.split('-');\n var pa = a[0].split('.');\n var pb = b[0].split('.');\n\n for (var i = 0; i < 3; i++) {\n var na = Number(pa[i]);\n var nb = Number(pb[i]);\n if (na > nb) return 1;\n if (nb > na) return -1;\n if (!isNaN(na) && isNaN(nb)) return 1;\n if (isNaN(na) && !isNaN(nb)) return -1;\n }\n\n if (a[1] && b[1]) {\n return a[1] > b[1] ? 1 : a[1] < b[1] ? -1 : 0;\n }\n\n return !a[1] && b[1] ? 1 : a[1] && !b[1] ? -1 : 0;\n}\n//# sourceMappingURL=semver-compare.js.map","function _typeof(obj) { if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nimport compare from './tools/semver-compare'; // Added \"possibleLengths\" and renamed\n// \"country_phone_code_to_countries\" to \"country_calling_codes\".\n\nvar V2 = '1.0.18'; // Added \"idd_prefix\" and \"default_idd_prefix\".\n\nvar V3 = '1.2.0'; // Moved `001` country code to \"nonGeographic\" section of metadata.\n\nvar V4 = '1.7.35';\nvar DEFAULT_EXT_PREFIX = ' ext. ';\nvar CALLING_CODE_REG_EXP = /^\\d+$/;\n/**\r\n * See: https://gitlab.com/catamphetamine/libphonenumber-js/blob/master/METADATA.md\r\n */\n\nvar Metadata =\n/*#__PURE__*/\nfunction () {\n function Metadata(metadata) {\n _classCallCheck(this, Metadata);\n\n validateMetadata(metadata);\n this.metadata = metadata;\n setVersion.call(this, metadata);\n }\n\n _createClass(Metadata, [{\n key: \"getCountries\",\n value: function getCountries() {\n return Object.keys(this.metadata.countries).filter(function (_) {\n return _ !== '001';\n });\n }\n }, {\n key: \"getCountryMetadata\",\n value: function getCountryMetadata(countryCode) {\n return this.metadata.countries[countryCode];\n }\n }, {\n key: \"nonGeographic\",\n value: function nonGeographic() {\n if (this.v1 || this.v2 || this.v3) return; // `nonGeographical` was a typo.\n // It's present in metadata generated from `1.7.35` to `1.7.37`.\n\n return this.metadata.nonGeographic || this.metadata.nonGeographical;\n }\n }, {\n key: \"hasCountry\",\n value: function hasCountry(country) {\n return this.getCountryMetadata(country) !== undefined;\n }\n }, {\n key: \"hasCallingCode\",\n value: function hasCallingCode(callingCode) {\n if (this.getCountryCodesForCallingCode(callingCode)) {\n return true;\n }\n\n if (this.nonGeographic()) {\n if (this.nonGeographic()[callingCode]) {\n return true;\n }\n } else {\n // A hacky workaround for old custom metadata (generated before V4).\n var countryCodes = this.countryCallingCodes()[callingCode];\n\n if (countryCodes && countryCodes.length === 1 && countryCodes[0] === '001') {\n return true;\n }\n }\n }\n }, {\n key: \"isNonGeographicCallingCode\",\n value: function isNonGeographicCallingCode(callingCode) {\n if (this.nonGeographic()) {\n return this.nonGeographic()[callingCode] ? true : false;\n } else {\n return this.getCountryCodesForCallingCode(callingCode) ? false : true;\n }\n } // Deprecated.\n\n }, {\n key: \"country\",\n value: function country(countryCode) {\n return this.selectNumberingPlan(countryCode);\n }\n }, {\n key: \"selectNumberingPlan\",\n value: function selectNumberingPlan(countryCode, callingCode) {\n // Supports just passing `callingCode` as the first argument.\n if (countryCode && CALLING_CODE_REG_EXP.test(countryCode)) {\n callingCode = countryCode;\n countryCode = null;\n }\n\n if (countryCode && countryCode !== '001') {\n if (!this.hasCountry(countryCode)) {\n throw new Error(\"Unknown country: \".concat(countryCode));\n }\n\n this.numberingPlan = new NumberingPlan(this.getCountryMetadata(countryCode), this);\n } else if (callingCode) {\n if (!this.hasCallingCode(callingCode)) {\n throw new Error(\"Unknown calling code: \".concat(callingCode));\n }\n\n this.numberingPlan = new NumberingPlan(this.getNumberingPlanMetadata(callingCode), this);\n } else {\n this.numberingPlan = undefined;\n }\n\n return this;\n }\n }, {\n key: \"getCountryCodesForCallingCode\",\n value: function getCountryCodesForCallingCode(callingCode) {\n var countryCodes = this.countryCallingCodes()[callingCode];\n\n if (countryCodes) {\n // Metadata before V4 included \"non-geographic entity\" calling codes\n // inside `country_calling_codes` (for example, `\"881\":[\"001\"]`).\n // Now the semantics of `country_calling_codes` has changed:\n // it's specifically for \"countries\" now.\n // Older versions of custom metadata will simply skip parsing\n // \"non-geographic entity\" phone numbers with new versions\n // of this library: it's not considered a bug,\n // because such numbers are extremely rare,\n // and developers extremely rarely use custom metadata.\n if (countryCodes.length === 1 && countryCodes[0].length === 3) {\n return;\n }\n\n return countryCodes;\n }\n }\n }, {\n key: \"getCountryCodeForCallingCode\",\n value: function getCountryCodeForCallingCode(callingCode) {\n var countryCodes = this.getCountryCodesForCallingCode(callingCode);\n\n if (countryCodes) {\n return countryCodes[0];\n }\n }\n }, {\n key: \"getNumberingPlanMetadata\",\n value: function getNumberingPlanMetadata(callingCode) {\n var countryCode = this.getCountryCodeForCallingCode(callingCode);\n\n if (countryCode) {\n return this.getCountryMetadata(countryCode);\n }\n\n if (this.nonGeographic()) {\n var metadata = this.nonGeographic()[callingCode];\n\n if (metadata) {\n return metadata;\n }\n } else {\n // A hacky workaround for old custom metadata (generated before V4).\n var countryCodes = this.countryCallingCodes()[callingCode];\n\n if (countryCodes && countryCodes.length === 1 && countryCodes[0] === '001') {\n return this.metadata.countries['001'];\n }\n }\n } // Deprecated.\n\n }, {\n key: \"countryCallingCode\",\n value: function countryCallingCode() {\n return this.numberingPlan.callingCode();\n } // Deprecated.\n\n }, {\n key: \"IDDPrefix\",\n value: function IDDPrefix() {\n return this.numberingPlan.IDDPrefix();\n } // Deprecated.\n\n }, {\n key: \"defaultIDDPrefix\",\n value: function defaultIDDPrefix() {\n return this.numberingPlan.defaultIDDPrefix();\n } // Deprecated.\n\n }, {\n key: \"nationalNumberPattern\",\n value: function nationalNumberPattern() {\n return this.numberingPlan.nationalNumberPattern();\n } // Deprecated.\n\n }, {\n key: \"possibleLengths\",\n value: function possibleLengths() {\n return this.numberingPlan.possibleLengths();\n } // Deprecated.\n\n }, {\n key: \"formats\",\n value: function formats() {\n return this.numberingPlan.formats();\n } // Deprecated.\n\n }, {\n key: \"nationalPrefixForParsing\",\n value: function nationalPrefixForParsing() {\n return this.numberingPlan.nationalPrefixForParsing();\n } // Deprecated.\n\n }, {\n key: \"nationalPrefixTransformRule\",\n value: function nationalPrefixTransformRule() {\n return this.numberingPlan.nationalPrefixTransformRule();\n } // Deprecated.\n\n }, {\n key: \"leadingDigits\",\n value: function leadingDigits() {\n return this.numberingPlan.leadingDigits();\n } // Deprecated.\n\n }, {\n key: \"hasTypes\",\n value: function hasTypes() {\n return this.numberingPlan.hasTypes();\n } // Deprecated.\n\n }, {\n key: \"type\",\n value: function type(_type) {\n return this.numberingPlan.type(_type);\n } // Deprecated.\n\n }, {\n key: \"ext\",\n value: function ext() {\n return this.numberingPlan.ext();\n }\n }, {\n key: \"countryCallingCodes\",\n value: function countryCallingCodes() {\n if (this.v1) return this.metadata.country_phone_code_to_countries;\n return this.metadata.country_calling_codes;\n } // Deprecated.\n\n }, {\n key: \"chooseCountryByCountryCallingCode\",\n value: function chooseCountryByCountryCallingCode(callingCode) {\n return this.selectNumberingPlan(callingCode);\n }\n }, {\n key: \"hasSelectedNumberingPlan\",\n value: function hasSelectedNumberingPlan() {\n return this.numberingPlan !== undefined;\n }\n }]);\n\n return Metadata;\n}();\n\nexport { Metadata as default };\n\nvar NumberingPlan =\n/*#__PURE__*/\nfunction () {\n function NumberingPlan(metadata, globalMetadataObject) {\n _classCallCheck(this, NumberingPlan);\n\n this.globalMetadataObject = globalMetadataObject;\n this.metadata = metadata;\n setVersion.call(this, globalMetadataObject.metadata);\n }\n\n _createClass(NumberingPlan, [{\n key: \"callingCode\",\n value: function callingCode() {\n return this.metadata[0];\n } // Formatting information for regions which share\n // a country calling code is contained by only one region\n // for performance reasons. For example, for NANPA region\n // (\"North American Numbering Plan Administration\",\n // which includes USA, Canada, Cayman Islands, Bahamas, etc)\n // it will be contained in the metadata for `US`.\n\n }, {\n key: \"getDefaultCountryMetadataForRegion\",\n value: function getDefaultCountryMetadataForRegion() {\n return this.globalMetadataObject.getNumberingPlanMetadata(this.callingCode());\n }\n }, {\n key: \"IDDPrefix\",\n value: function IDDPrefix() {\n if (this.v1 || this.v2) return;\n return this.metadata[1];\n }\n }, {\n key: \"defaultIDDPrefix\",\n value: function defaultIDDPrefix() {\n if (this.v1 || this.v2) return;\n return this.metadata[12];\n }\n }, {\n key: \"nationalNumberPattern\",\n value: function nationalNumberPattern() {\n if (this.v1 || this.v2) return this.metadata[1];\n return this.metadata[2];\n }\n }, {\n key: \"possibleLengths\",\n value: function possibleLengths() {\n if (this.v1) return;\n return this.metadata[this.v2 ? 2 : 3];\n }\n }, {\n key: \"_getFormats\",\n value: function _getFormats(metadata) {\n return metadata[this.v1 ? 2 : this.v2 ? 3 : 4];\n } // For countries of the same region (e.g. NANPA)\n // formats are all stored in the \"main\" country for that region.\n // E.g. \"RU\" and \"KZ\", \"US\" and \"CA\".\n\n }, {\n key: \"formats\",\n value: function formats() {\n var _this = this;\n\n var formats = this._getFormats(this.metadata) || this._getFormats(this.getDefaultCountryMetadataForRegion()) || [];\n return formats.map(function (_) {\n return new Format(_, _this);\n });\n }\n }, {\n key: \"nationalPrefix\",\n value: function nationalPrefix() {\n return this.metadata[this.v1 ? 3 : this.v2 ? 4 : 5];\n }\n }, {\n key: \"_getNationalPrefixFormattingRule\",\n value: function _getNationalPrefixFormattingRule(metadata) {\n return metadata[this.v1 ? 4 : this.v2 ? 5 : 6];\n } // For countries of the same region (e.g. NANPA)\n // national prefix formatting rule is stored in the \"main\" country for that region.\n // E.g. \"RU\" and \"KZ\", \"US\" and \"CA\".\n\n }, {\n key: \"nationalPrefixFormattingRule\",\n value: function nationalPrefixFormattingRule() {\n return this._getNationalPrefixFormattingRule(this.metadata) || this._getNationalPrefixFormattingRule(this.getDefaultCountryMetadataForRegion());\n }\n }, {\n key: \"_nationalPrefixForParsing\",\n value: function _nationalPrefixForParsing() {\n return this.metadata[this.v1 ? 5 : this.v2 ? 6 : 7];\n }\n }, {\n key: \"nationalPrefixForParsing\",\n value: function nationalPrefixForParsing() {\n // If `national_prefix_for_parsing` is not set explicitly,\n // then infer it from `national_prefix` (if any)\n return this._nationalPrefixForParsing() || this.nationalPrefix();\n }\n }, {\n key: \"nationalPrefixTransformRule\",\n value: function nationalPrefixTransformRule() {\n return this.metadata[this.v1 ? 6 : this.v2 ? 7 : 8];\n }\n }, {\n key: \"_getNationalPrefixIsOptionalWhenFormatting\",\n value: function _getNationalPrefixIsOptionalWhenFormatting() {\n return !!this.metadata[this.v1 ? 7 : this.v2 ? 8 : 9];\n } // For countries of the same region (e.g. NANPA)\n // \"national prefix is optional when formatting\" flag is\n // stored in the \"main\" country for that region.\n // E.g. \"RU\" and \"KZ\", \"US\" and \"CA\".\n\n }, {\n key: \"nationalPrefixIsOptionalWhenFormattingInNationalFormat\",\n value: function nationalPrefixIsOptionalWhenFormattingInNationalFormat() {\n return this._getNationalPrefixIsOptionalWhenFormatting(this.metadata) || this._getNationalPrefixIsOptionalWhenFormatting(this.getDefaultCountryMetadataForRegion());\n }\n }, {\n key: \"leadingDigits\",\n value: function leadingDigits() {\n return this.metadata[this.v1 ? 8 : this.v2 ? 9 : 10];\n }\n }, {\n key: \"types\",\n value: function types() {\n return this.metadata[this.v1 ? 9 : this.v2 ? 10 : 11];\n }\n }, {\n key: \"hasTypes\",\n value: function hasTypes() {\n // Versions 1.2.0 - 1.2.4: can be `[]`.\n\n /* istanbul ignore next */\n if (this.types() && this.types().length === 0) {\n return false;\n } // Versions <= 1.2.4: can be `undefined`.\n // Version >= 1.2.5: can be `0`.\n\n\n return !!this.types();\n }\n }, {\n key: \"type\",\n value: function type(_type2) {\n if (this.hasTypes() && getType(this.types(), _type2)) {\n return new Type(getType(this.types(), _type2), this);\n }\n }\n }, {\n key: \"ext\",\n value: function ext() {\n if (this.v1 || this.v2) return DEFAULT_EXT_PREFIX;\n return this.metadata[13] || DEFAULT_EXT_PREFIX;\n }\n }]);\n\n return NumberingPlan;\n}();\n\nvar Format =\n/*#__PURE__*/\nfunction () {\n function Format(format, metadata) {\n _classCallCheck(this, Format);\n\n this._format = format;\n this.metadata = metadata;\n }\n\n _createClass(Format, [{\n key: \"pattern\",\n value: function pattern() {\n return this._format[0];\n }\n }, {\n key: \"format\",\n value: function format() {\n return this._format[1];\n }\n }, {\n key: \"leadingDigitsPatterns\",\n value: function leadingDigitsPatterns() {\n return this._format[2] || [];\n }\n }, {\n key: \"nationalPrefixFormattingRule\",\n value: function nationalPrefixFormattingRule() {\n return this._format[3] || this.metadata.nationalPrefixFormattingRule();\n }\n }, {\n key: \"nationalPrefixIsOptionalWhenFormattingInNationalFormat\",\n value: function nationalPrefixIsOptionalWhenFormattingInNationalFormat() {\n return !!this._format[4] || this.metadata.nationalPrefixIsOptionalWhenFormattingInNationalFormat();\n }\n }, {\n key: \"nationalPrefixIsMandatoryWhenFormattingInNationalFormat\",\n value: function nationalPrefixIsMandatoryWhenFormattingInNationalFormat() {\n // National prefix is omitted if there's no national prefix formatting rule\n // set for this country, or when the national prefix formatting rule\n // contains no national prefix itself, or when this rule is set but\n // national prefix is optional for this phone number format\n // (and it is not enforced explicitly)\n return this.usesNationalPrefix() && !this.nationalPrefixIsOptionalWhenFormattingInNationalFormat();\n } // Checks whether national prefix formatting rule contains national prefix.\n\n }, {\n key: \"usesNationalPrefix\",\n value: function usesNationalPrefix() {\n return this.nationalPrefixFormattingRule() && // Check that national prefix formatting rule is not a \"dummy\" one.\n !FIRST_GROUP_ONLY_PREFIX_PATTERN.test(this.nationalPrefixFormattingRule()) // In compressed metadata, `this.nationalPrefixFormattingRule()` is `0`\n // when `national_prefix_formatting_rule` is not present.\n // So, `true` or `false` are returned explicitly here, so that\n // `0` number isn't returned.\n ? true : false;\n }\n }, {\n key: \"internationalFormat\",\n value: function internationalFormat() {\n return this._format[5] || this.format();\n }\n }]);\n\n return Format;\n}();\n/**\r\n * A pattern that is used to determine if the national prefix formatting rule\r\n * has the first group only, i.e., does not start with the national prefix.\r\n * Note that the pattern explicitly allows for unbalanced parentheses.\r\n */\n\n\nvar FIRST_GROUP_ONLY_PREFIX_PATTERN = /^\\(?\\$1\\)?$/;\n\nvar Type =\n/*#__PURE__*/\nfunction () {\n function Type(type, metadata) {\n _classCallCheck(this, Type);\n\n this.type = type;\n this.metadata = metadata;\n }\n\n _createClass(Type, [{\n key: \"pattern\",\n value: function pattern() {\n if (this.metadata.v1) return this.type;\n return this.type[0];\n }\n }, {\n key: \"possibleLengths\",\n value: function possibleLengths() {\n if (this.metadata.v1) return;\n return this.type[1] || this.metadata.possibleLengths();\n }\n }]);\n\n return Type;\n}();\n\nfunction getType(types, type) {\n switch (type) {\n case 'FIXED_LINE':\n return types[0];\n\n case 'MOBILE':\n return types[1];\n\n case 'TOLL_FREE':\n return types[2];\n\n case 'PREMIUM_RATE':\n return types[3];\n\n case 'PERSONAL_NUMBER':\n return types[4];\n\n case 'VOICEMAIL':\n return types[5];\n\n case 'UAN':\n return types[6];\n\n case 'PAGER':\n return types[7];\n\n case 'VOIP':\n return types[8];\n\n case 'SHARED_COST':\n return types[9];\n }\n}\n\nexport function validateMetadata(metadata) {\n if (!metadata) {\n throw new Error('[libphonenumber-js] `metadata` argument not passed. Check your arguments.');\n } // `country_phone_code_to_countries` was renamed to\n // `country_calling_codes` in `1.0.18`.\n\n\n if (!is_object(metadata) || !is_object(metadata.countries)) {\n throw new Error(\"[libphonenumber-js] `metadata` argument was passed but it's not a valid metadata. Must be an object having `.countries` child object property. Got \".concat(is_object(metadata) ? 'an object of shape: { ' + Object.keys(metadata).join(', ') + ' }' : 'a ' + type_of(metadata) + ': ' + metadata, \".\"));\n }\n} // Babel transforms `typeof` into some \"branches\"\n// so istanbul will show this as \"branch not covered\".\n\n/* istanbul ignore next */\n\nvar is_object = function is_object(_) {\n return _typeof(_) === 'object';\n}; // Babel transforms `typeof` into some \"branches\"\n// so istanbul will show this as \"branch not covered\".\n\n/* istanbul ignore next */\n\n\nvar type_of = function type_of(_) {\n return _typeof(_);\n};\n/**\r\n * Returns extension prefix for a country.\r\n * @param {string} country\r\n * @param {object} metadata\r\n * @return {string?}\r\n * @example\r\n * // Returns \" ext. \"\r\n * getExtPrefix(\"US\")\r\n */\n\n\nexport function getExtPrefix(country, metadata) {\n metadata = new Metadata(metadata);\n\n if (metadata.hasCountry(country)) {\n return metadata.country(country).ext();\n }\n\n return DEFAULT_EXT_PREFIX;\n}\n/**\r\n * Returns \"country calling code\" for a country.\r\n * Throws an error if the country doesn't exist or isn't supported by this library.\r\n * @param {string} country\r\n * @param {object} metadata\r\n * @return {string}\r\n * @example\r\n * // Returns \"44\"\r\n * getCountryCallingCode(\"GB\")\r\n */\n\nexport function getCountryCallingCode(country, metadata) {\n metadata = new Metadata(metadata);\n\n if (metadata.hasCountry(country)) {\n return metadata.country(country).countryCallingCode();\n }\n\n throw new Error(\"Unknown country: \".concat(country));\n}\nexport function isSupportedCountry(country, metadata) {\n // metadata = new Metadata(metadata)\n // return metadata.hasCountry(country)\n return metadata.countries[country] !== undefined;\n}\n\nfunction setVersion(metadata) {\n var version = metadata.version;\n\n if (typeof version === 'number') {\n this.v1 = version === 1;\n this.v2 = version === 2;\n this.v3 = version === 3;\n this.v4 = version === 4;\n } else {\n if (!version) {\n this.v1 = true;\n } else if (compare(version, V3) === -1) {\n this.v2 = true;\n } else if (compare(version, V4) === -1) {\n this.v3 = true;\n } else {\n this.v4 = true;\n }\n }\n} // const ISO_COUNTRY_CODE = /^[A-Z]{2}$/\n// function isCountryCode(countryCode) {\n// \treturn ISO_COUNTRY_CODE.test(countryCodeOrCountryCallingCode)\n// }\n//# sourceMappingURL=metadata.js.map","import { parseDigit } from './helpers/parseDigits';\n/**\r\n * Parses phone number characters from a string.\r\n * Drops all punctuation leaving only digits and the leading `+` sign (if any).\r\n * Also converts wide-ascii and arabic-indic numerals to conventional numerals.\r\n * E.g. in Iraq they don't write `+442323234` but rather `+٤٤٢٣٢٣٢٣٤`.\r\n * @param {string} string\r\n * @return {string}\r\n * @example\r\n * ```js\r\n * // Outputs '8800555'.\r\n * parseIncompletePhoneNumber('8 (800) 555')\r\n * // Outputs '+7800555'.\r\n * parseIncompletePhoneNumber('+7 800 555')\r\n * ```\r\n */\n\nexport default function parseIncompletePhoneNumber(string) {\n var result = ''; // Using `.split('')` here instead of normal `for ... of`\n // because the importing application doesn't neccessarily include an ES6 polyfill.\n // The `.split('')` approach discards \"exotic\" UTF-8 characters\n // (the ones consisting of four bytes) but digits\n // (including non-European ones) don't fall into that range\n // so such \"exotic\" characters would be discarded anyway.\n\n for (var _iterator = string.split(''), _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {\n var _ref;\n\n if (_isArray) {\n if (_i >= _iterator.length) break;\n _ref = _iterator[_i++];\n } else {\n _i = _iterator.next();\n if (_i.done) break;\n _ref = _i.value;\n }\n\n var character = _ref;\n result += parsePhoneNumberCharacter(character, result) || '';\n }\n\n return result;\n}\n/**\r\n * Parses next character while parsing phone number digits (including a `+`)\r\n * from text: discards everything except `+` and digits, and `+` is only allowed\r\n * at the start of a phone number.\r\n * For example, is used in `react-phone-number-input` where it uses\r\n * [`input-format`](https://gitlab.com/catamphetamine/input-format).\r\n * @param {string} character - Yet another character from raw input string.\r\n * @param {string?} prevParsedCharacters - Previous parsed characters.\r\n * @param {object} meta - Optional custom use-case-specific metadata.\r\n * @return {string?} The parsed character.\r\n */\n\nexport function parsePhoneNumberCharacter(character, prevParsedCharacters) {\n // Only allow a leading `+`.\n if (character === '+') {\n // If this `+` is not the first parsed character\n // then discard it.\n if (prevParsedCharacters) {\n return;\n }\n\n return '+';\n } // Allow digits.\n\n\n return parseDigit(character);\n}\n//# sourceMappingURL=parseIncompletePhoneNumber.js.map","function _typeof(obj) { if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty(target, key, source[key]); }); } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nfunction _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); }\n\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance\"); }\n\nfunction _iterableToArrayLimit(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"] != null) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; }\n\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\n\nimport parsePhoneNumber_ from './parsePhoneNumber_';\nexport default function parsePhoneNumber() {\n var _normalizeArguments = normalizeArguments(arguments),\n text = _normalizeArguments.text,\n options = _normalizeArguments.options,\n metadata = _normalizeArguments.metadata;\n\n return parsePhoneNumber_(text, options, metadata);\n}\nexport function normalizeArguments(args) {\n var _Array$prototype$slic = Array.prototype.slice.call(args),\n _Array$prototype$slic2 = _slicedToArray(_Array$prototype$slic, 4),\n arg_1 = _Array$prototype$slic2[0],\n arg_2 = _Array$prototype$slic2[1],\n arg_3 = _Array$prototype$slic2[2],\n arg_4 = _Array$prototype$slic2[3];\n\n var text;\n var options;\n var metadata; // If the phone number is passed as a string.\n // `parsePhoneNumber('88005553535', ...)`.\n\n if (typeof arg_1 === 'string') {\n text = arg_1;\n } else throw new TypeError('A text for parsing must be a string.'); // If \"default country\" argument is being passed then move it to `options`.\n // `parsePhoneNumber('88005553535', 'RU', [options], metadata)`.\n\n\n if (!arg_2 || typeof arg_2 === 'string') {\n if (arg_4) {\n options = arg_3;\n metadata = arg_4;\n } else {\n options = undefined;\n metadata = arg_3;\n }\n\n if (arg_2) {\n options = _objectSpread({\n defaultCountry: arg_2\n }, options);\n }\n } // `defaultCountry` is not passed.\n // Example: `parsePhoneNumber('+78005553535', [options], metadata)`.\n else if (isObject(arg_2)) {\n if (arg_3) {\n options = arg_2;\n metadata = arg_3;\n } else {\n metadata = arg_2;\n }\n } else throw new Error(\"Invalid second argument: \".concat(arg_2));\n\n return {\n text: text,\n options: options,\n metadata: metadata\n };\n} // Otherwise istanbul would show this as \"branch not covered\".\n\n/* istanbul ignore next */\n\nvar isObject = function isObject(_) {\n return _typeof(_) === 'object';\n};\n//# sourceMappingURL=parsePhoneNumber.js.map","import { normalizeArguments } from './parsePhoneNumber';\nimport parsePhoneNumberFromString_ from './parsePhoneNumberFromString_';\nexport default function parsePhoneNumberFromString() {\n var _normalizeArguments = normalizeArguments(arguments),\n text = _normalizeArguments.text,\n options = _normalizeArguments.options,\n metadata = _normalizeArguments.metadata;\n\n return parsePhoneNumberFromString_(text, options, metadata);\n}\n//# sourceMappingURL=parsePhoneNumberFromString.js.map","function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n// https://stackoverflow.com/a/46971044/970769\nvar ParseError = function ParseError(code) {\n _classCallCheck(this, ParseError);\n\n this.name = this.constructor.name;\n this.message = code;\n this.stack = new Error(code).stack;\n};\n\nexport { ParseError as default };\nParseError.prototype = Object.create(Error.prototype);\nParseError.prototype.constructor = ParseError;\n//# sourceMappingURL=ParseError.js.map","import createExtensionPattern from './createExtensionPattern'; // Regexp of all known extension prefixes used by different regions followed by\n// 1 or more valid digits, for use when parsing.\n\nvar EXTN_PATTERN = new RegExp('(?:' + createExtensionPattern() + ')$', 'i'); // Strips any extension (as in, the part of the number dialled after the call is\n// connected, usually indicated with extn, ext, x or similar) from the end of\n// the number, and returns it.\n\nexport default function extractExtension(number) {\n var start = number.search(EXTN_PATTERN);\n\n if (start < 0) {\n return {};\n } // If we find a potential extension, and the number preceding this is a viable\n // number, we assume it is an extension.\n\n\n var numberWithoutExtension = number.slice(0, start);\n var matches = number.match(EXTN_PATTERN);\n var i = 1;\n\n while (i < matches.length) {\n if (matches[i]) {\n return {\n number: numberWithoutExtension,\n ext: matches[i]\n };\n }\n\n i++;\n }\n}\n//# sourceMappingURL=extractExtension.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\nimport { VALID_DIGITS, PLUS_CHARS, MIN_LENGTH_FOR_NSN, MAX_LENGTH_FOR_NSN } from './constants';\nimport ParseError from './ParseError';\nimport Metadata from './metadata';\nimport isViablePhoneNumber from './helpers/isViablePhoneNumber';\nimport extractExtension from './helpers/extension/extractExtension';\nimport parseIncompletePhoneNumber from './parseIncompletePhoneNumber';\nimport getCountryCallingCode from './getCountryCallingCode';\nimport { isPossibleNumber } from './isPossibleNumber_';\nimport { parseRFC3966 } from './helpers/RFC3966';\nimport PhoneNumber from './PhoneNumber';\nimport matchesEntirely from './helpers/matchesEntirely';\nimport extractCountryCallingCode from './helpers/extractCountryCallingCode';\nimport extractCountryCallingCodeFromInternationalNumberWithoutPlusSign from './helpers/extractCountryCallingCodeFromInternationalNumberWithoutPlusSign';\nimport extractNationalNumber from './helpers/extractNationalNumber';\nimport stripIddPrefix from './helpers/stripIddPrefix';\nimport getCountryByCallingCode from './helpers/getCountryByCallingCode'; // We don't allow input strings for parsing to be longer than 250 chars.\n// This prevents malicious input from consuming CPU.\n\nvar MAX_INPUT_STRING_LENGTH = 250; // This consists of the plus symbol, digits, and arabic-indic digits.\n\nvar PHONE_NUMBER_START_PATTERN = new RegExp('[' + PLUS_CHARS + VALID_DIGITS + ']'); // Regular expression of trailing characters that we want to remove.\n// A trailing `#` is sometimes used when writing phone numbers with extensions in US.\n// Example: \"+1 (645) 123 1234-910#\" number has extension \"910\".\n\nvar AFTER_PHONE_NUMBER_END_PATTERN = new RegExp('[^' + VALID_DIGITS + '#' + ']+$');\nvar USE_NON_GEOGRAPHIC_COUNTRY_CODE = false; // Examples:\n//\n// ```js\n// parse('8 (800) 555-35-35', 'RU')\n// parse('8 (800) 555-35-35', 'RU', metadata)\n// parse('8 (800) 555-35-35', { country: { default: 'RU' } })\n// parse('8 (800) 555-35-35', { country: { default: 'RU' } }, metadata)\n// parse('+7 800 555 35 35')\n// parse('+7 800 555 35 35', metadata)\n// ```\n//\n\nexport default function parse(text, options, metadata) {\n // If assigning the `{}` default value is moved to the arguments above,\n // code coverage would decrease for some weird reason.\n options = options || {};\n metadata = new Metadata(metadata); // Validate `defaultCountry`.\n\n if (options.defaultCountry && !metadata.hasCountry(options.defaultCountry)) {\n if (options.v2) {\n throw new ParseError('INVALID_COUNTRY');\n }\n\n throw new Error(\"Unknown country: \".concat(options.defaultCountry));\n } // Parse the phone number.\n\n\n var _parseInput = parseInput(text, options.v2, options.extract),\n formattedPhoneNumber = _parseInput.number,\n ext = _parseInput.ext; // If the phone number is not viable then return nothing.\n\n\n if (!formattedPhoneNumber) {\n if (options.v2) {\n throw new ParseError('NOT_A_NUMBER');\n }\n\n return {};\n }\n\n var _parsePhoneNumber = parsePhoneNumber(formattedPhoneNumber, options.defaultCountry, options.defaultCallingCode, metadata),\n country = _parsePhoneNumber.country,\n nationalNumber = _parsePhoneNumber.nationalNumber,\n countryCallingCode = _parsePhoneNumber.countryCallingCode,\n carrierCode = _parsePhoneNumber.carrierCode;\n\n if (!metadata.hasSelectedNumberingPlan()) {\n if (options.v2) {\n throw new ParseError('INVALID_COUNTRY');\n }\n\n return {};\n } // Validate national (significant) number length.\n\n\n if (!nationalNumber || nationalNumber.length < MIN_LENGTH_FOR_NSN) {\n // Won't throw here because the regexp already demands length > 1.\n\n /* istanbul ignore if */\n if (options.v2) {\n throw new ParseError('TOO_SHORT');\n } // Google's demo just throws an error in this case.\n\n\n return {};\n } // Validate national (significant) number length.\n //\n // A sidenote:\n //\n // They say that sometimes national (significant) numbers\n // can be longer than `MAX_LENGTH_FOR_NSN` (e.g. in Germany).\n // https://github.com/googlei18n/libphonenumber/blob/7e1748645552da39c4e1ba731e47969d97bdb539/resources/phonenumber.proto#L36\n // Such numbers will just be discarded.\n //\n\n\n if (nationalNumber.length > MAX_LENGTH_FOR_NSN) {\n if (options.v2) {\n throw new ParseError('TOO_LONG');\n } // Google's demo just throws an error in this case.\n\n\n return {};\n }\n\n if (options.v2) {\n var phoneNumber = new PhoneNumber(countryCallingCode, nationalNumber, metadata.metadata);\n\n if (country) {\n phoneNumber.country = country;\n }\n\n if (carrierCode) {\n phoneNumber.carrierCode = carrierCode;\n }\n\n if (ext) {\n phoneNumber.ext = ext;\n }\n\n return phoneNumber;\n } // Check if national phone number pattern matches the number.\n // National number pattern is different for each country,\n // even for those ones which are part of the \"NANPA\" group.\n\n\n var valid = (options.extended ? metadata.hasSelectedNumberingPlan() : country) ? matchesEntirely(nationalNumber, metadata.nationalNumberPattern()) : false;\n\n if (!options.extended) {\n return valid ? result(country, nationalNumber, ext) : {};\n } // isInternational: countryCallingCode !== undefined\n\n\n return {\n country: country,\n countryCallingCode: countryCallingCode,\n carrierCode: carrierCode,\n valid: valid,\n possible: valid ? true : options.extended === true && metadata.possibleLengths() && isPossibleNumber(nationalNumber, metadata) ? true : false,\n phone: nationalNumber,\n ext: ext\n };\n}\n/**\r\n * Extracts a formatted phone number from text.\r\n * Doesn't guarantee that the extracted phone number\r\n * is a valid phone number (for example, doesn't validate its length).\r\n * @param {string} text\r\n * @param {boolean} [extract] — If `false`, then will parse the entire `text` as a phone number.\r\n * @param {boolean} [throwOnError] — By default, it won't throw if the text is too long.\r\n * @return {string}\r\n * @example\r\n * // Returns \"(213) 373-4253\".\r\n * extractFormattedPhoneNumber(\"Call (213) 373-4253 for assistance.\")\r\n */\n\nfunction extractFormattedPhoneNumber(text, extract, throwOnError) {\n if (!text) {\n return;\n }\n\n if (text.length > MAX_INPUT_STRING_LENGTH) {\n if (throwOnError) {\n throw new ParseError('TOO_LONG');\n }\n\n return;\n }\n\n if (extract === false) {\n return text;\n } // Attempt to extract a possible number from the string passed in\n\n\n var startsAt = text.search(PHONE_NUMBER_START_PATTERN);\n\n if (startsAt < 0) {\n return;\n }\n\n return text // Trim everything to the left of the phone number\n .slice(startsAt) // Remove trailing non-numerical characters\n .replace(AFTER_PHONE_NUMBER_END_PATTERN, '');\n}\n/**\r\n * @param {string} text - Input.\r\n * @param {boolean} v2 - Legacy API functions don't pass `v2: true` flag.\r\n * @param {boolean} [extract] - Whether to extract a phone number from `text`, or attempt to parse the entire text as a phone number.\r\n * @return {object} `{ ?number, ?ext }`.\r\n */\n\n\nfunction parseInput(text, v2, extract) {\n // Parse RFC 3966 phone number URI.\n if (text && text.indexOf('tel:') === 0) {\n return parseRFC3966(text);\n }\n\n var number = extractFormattedPhoneNumber(text, extract, v2); // If the phone number is not viable, then abort.\n\n if (!number || !isViablePhoneNumber(number)) {\n return {};\n } // Attempt to parse extension first, since it doesn't require region-specific\n // data and we want to have the non-normalised number here.\n\n\n var withExtensionStripped = extractExtension(number);\n\n if (withExtensionStripped.ext) {\n return withExtensionStripped;\n }\n\n return {\n number: number\n };\n}\n/**\r\n * Creates `parse()` result object.\r\n */\n\n\nfunction result(country, nationalNumber, ext) {\n var result = {\n country: country,\n phone: nationalNumber\n };\n\n if (ext) {\n result.ext = ext;\n }\n\n return result;\n}\n/**\r\n * Parses a viable phone number.\r\n * @param {string} formattedPhoneNumber — Example: \"(213) 373-4253\".\r\n * @param {string} [defaultCountry]\r\n * @param {string} [defaultCallingCode]\r\n * @param {Metadata} metadata\r\n * @return {object} Returns `{ country: string?, countryCallingCode: string?, nationalNumber: string? }`.\r\n */\n\n\nfunction parsePhoneNumber(formattedPhoneNumber, defaultCountry, defaultCallingCode, metadata) {\n // Extract calling code from phone number.\n var _extractCountryCallin = extractCountryCallingCode(parseIncompletePhoneNumber(formattedPhoneNumber), defaultCountry, defaultCallingCode, metadata.metadata),\n countryCallingCode = _extractCountryCallin.countryCallingCode,\n number = _extractCountryCallin.number; // Choose a country by `countryCallingCode`.\n\n\n var country;\n\n if (countryCallingCode) {\n metadata.selectNumberingPlan(countryCallingCode);\n } // If `formattedPhoneNumber` is in \"national\" format\n // then `number` is defined and `countryCallingCode` isn't.\n else if (number && (defaultCountry || defaultCallingCode)) {\n metadata.selectNumberingPlan(defaultCountry, defaultCallingCode);\n\n if (defaultCountry) {\n country = defaultCountry;\n } else {\n /* istanbul ignore if */\n if (USE_NON_GEOGRAPHIC_COUNTRY_CODE) {\n if (metadata.isNonGeographicCallingCode(defaultCallingCode)) {\n country = '001';\n }\n }\n }\n\n countryCallingCode = defaultCallingCode || getCountryCallingCode(defaultCountry, metadata.metadata);\n } else return {};\n\n if (!number) {\n return {\n countryCallingCode: countryCallingCode\n };\n }\n\n var _extractNationalNumbe = extractNationalNumber(parseIncompletePhoneNumber(number), metadata),\n nationalNumber = _extractNationalNumbe.nationalNumber,\n carrierCode = _extractNationalNumbe.carrierCode; // Sometimes there are several countries\n // corresponding to the same country phone code\n // (e.g. NANPA countries all having `1` country phone code).\n // Therefore, to reliably determine the exact country,\n // national (significant) number should have been parsed first.\n //\n // When `metadata.json` is generated, all \"ambiguous\" country phone codes\n // get their countries populated with the full set of\n // \"phone number type\" regular expressions.\n //\n\n\n var exactCountry = getCountryByCallingCode(countryCallingCode, nationalNumber, metadata);\n\n if (exactCountry) {\n country = exactCountry;\n /* istanbul ignore if */\n\n if (exactCountry === '001') {// Can't happen with `USE_NON_GEOGRAPHIC_COUNTRY_CODE` being `false`.\n // If `USE_NON_GEOGRAPHIC_COUNTRY_CODE` is set to `true` for some reason,\n // then remove the \"istanbul ignore if\".\n } else {\n metadata.country(country);\n }\n }\n\n return {\n country: country,\n countryCallingCode: countryCallingCode,\n nationalNumber: nationalNumber,\n carrierCode: carrierCode\n };\n}\n//# sourceMappingURL=parse_.js.map","function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty(target, key, source[key]); }); } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nimport parseNumber from './parse_';\nexport default function parsePhoneNumber(text, options, metadata) {\n return parseNumber(text, _objectSpread({}, options, {\n v2: true\n }), metadata);\n}\n//# sourceMappingURL=parsePhoneNumber_.js.map","function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty(target, key, source[key]); }); } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nimport parsePhoneNumber from './parsePhoneNumber_';\nimport ParseError from './ParseError';\nimport { isSupportedCountry } from './metadata';\nexport default function parsePhoneNumberFromString(text, options, metadata) {\n // Validate `defaultCountry`.\n if (options && options.defaultCountry && !isSupportedCountry(options.defaultCountry, metadata)) {\n options = _objectSpread({}, options, {\n defaultCountry: undefined\n });\n } // Parse phone number.\n\n\n try {\n return parsePhoneNumber(text, options, metadata);\n } catch (error) {\n /* istanbul ignore else */\n if (error instanceof ParseError) {//\n } else {\n throw error;\n }\n }\n}\n//# sourceMappingURL=parsePhoneNumberFromString_.js.map","/**\r\n * Creates Unicode flag from a two-letter ISO country code.\r\n * https://stackoverflow.com/questions/24050671/how-to-put-japan-flag-character-in-a-string\r\n * @param {string} country — A two-letter ISO country code (case-insensitive).\r\n * @return {string}\r\n */\nexport default function getCountryFlag(country) {\n return getRegionalIndicatorSymbol(country[0]) + getRegionalIndicatorSymbol(country[1]);\n}\n/**\r\n * Converts a letter to a Regional Indicator Symbol.\r\n * @param {string} letter\r\n * @return {string}\r\n */\n\nfunction getRegionalIndicatorSymbol(letter) {\n return String.fromCodePoint(0x1F1E6 - 65 + letter.toUpperCase().charCodeAt(0));\n}\n//# sourceMappingURL=unicode.js.map","// Counts all occurences of a symbol in a string\nexport function count_occurences(symbol, string) {\n var count = 0; // Using `.split('')` here instead of normal `for ... of`\n // because the importing application doesn't neccessarily include an ES6 polyfill.\n // The `.split('')` approach discards \"exotic\" UTF-8 characters\n // (the ones consisting of four bytes)\n // but template placeholder characters don't fall into that range\n // so skipping such miscellaneous \"exotic\" characters\n // won't matter here for just counting placeholder character occurrences.\n\n for (var _iterator = string.split(''), _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {\n var _ref;\n\n if (_isArray) {\n if (_i >= _iterator.length) break;\n _ref = _iterator[_i++];\n } else {\n _i = _iterator.next();\n if (_i.done) break;\n _ref = _i.value;\n }\n\n var character = _ref;\n\n if (character === symbol) {\n count++;\n }\n }\n\n return count;\n}\n//# sourceMappingURL=helpers.js.map","// Gets selection bounds\nexport function getSelection(element) {\n // If no selection, return nothing\n if (element.selectionStart === element.selectionEnd) {\n return;\n }\n\n return {\n start: element.selectionStart,\n end: element.selectionEnd\n };\n} // Key codes\n\nexport var Keys = {\n Backspace: 8,\n Delete: 46\n}; // Finds out the operation to be intercepted and performed\n// based on the key down event `keyCode`.\n\nexport function getOperation(event) {\n switch (event.keyCode) {\n case Keys.Backspace:\n return 'Backspace';\n\n case Keys.Delete:\n return 'Delete';\n }\n} // Gets caret position\n\nexport function getCaretPosition(element) {\n return element.selectionStart;\n} // Sets caret position\n\nexport function setCaretPosition(element, caret_position) {\n // Sanity check\n if (caret_position === undefined) {\n return;\n } // Set caret position.\n // There has been an issue with caret positioning on Android devices.\n // https://github.com/catamphetamine/input-format/issues/2\n // I was revisiting this issue and looked for similar issues in other libraries.\n // For example, there's [`text-mask`](https://github.com/text-mask/text-mask) library.\n // They've had exactly the same issue when the caret seemingly refused to be repositioned programmatically.\n // The symptoms were the same: whenever the caret passed through a non-digit character of a mask (a whitespace, a bracket, a dash, etc), it looked as if it placed itself one character before its correct position.\n // https://github.com/text-mask/text-mask/issues/300\n // They seem to have found a basic fix for it: calling `input.setSelectionRange()` in a timeout rather than instantly for Android devices.\n // https://github.com/text-mask/text-mask/pull/400/files\n // I've implemented the same workaround here.\n\n\n if (isAndroid()) {\n setTimeout(function () {\n return element.setSelectionRange(caret_position, caret_position);\n }, 0);\n } else {\n element.setSelectionRange(caret_position, caret_position);\n }\n}\n\nfunction isAndroid() {\n // `navigator` is not defined when running mocha tests.\n if (typeof navigator !== 'undefined') {\n return ANDROID_USER_AGENT_REG_EXP.test(navigator.userAgent);\n }\n}\n\nvar ANDROID_USER_AGENT_REG_EXP = /Android/i;\n//# sourceMappingURL=dom.js.map","import edit from './edit';\nimport parse from './parse';\nimport format from './format';\nimport { getOperation, getSelection, getCaretPosition, setCaretPosition } from './dom'; // Deprecated.\n// I don't know why this function exists.\n\nexport function onCut(event, input, _parse, _format, on_change) {\n // The actual cut hasn't happened just yet hence the timeout.\n setTimeout(function () {\n return formatInputText(input, _parse, _format, undefined, on_change);\n }, 0);\n} // Deprecated.\n// I don't know why this function exists.\n\nexport function onPaste(event, input, _parse, _format, on_change) {\n var selection = getSelection(input); // If selection is made,\n // just erase the selected text\n // prior to pasting\n\n if (selection) {\n eraseSelection(input, selection);\n }\n\n formatInputText(input, _parse, _format, undefined, on_change);\n}\nexport function onChange(event, input, _parse, _format, on_change) {\n formatInputText(input, _parse, _format, undefined, on_change);\n} // \"Delete\" and \"Backspace\" keys are special\n// in a way that they're not handled by the regular `onChange()` handler\n// and instead are intercepted and re-applied manually.\n// The reason is that normally hitting \"Backspace\" or \"Delete\"\n// results in erasing a character, but that character might be any character,\n// while it would be a better \"user experience\" if it erased not just any character\n// but the closest \"meaningful\" character.\n// For example, if a template is `(xxx) xxx-xxxx`,\n// and the `` value is `(111) 222-3333`,\n// then, if a user begins erasing the `3333` part via \"Backspace\"\n// and reaches the \"-\" character, then it would just erase the \"-\" character.\n// Nothing wrong with that, but it would be a better \"user experience\"\n// if hitting \"Backspace\" at that position would erase the closest \"meaningful\"\n// character, which would be the rightmost `2`.\n// So, what this `onKeyDown()` handler does is it intercepts\n// \"Backspace\" and \"Delete\" keys and re-applies those operations manually\n// following the logic described above.\n\nexport function onKeyDown(event, input, _parse, _format, on_change) {\n var operation = getOperation(event);\n\n switch (operation) {\n case 'Delete':\n case 'Backspace':\n // Intercept this operation and perform it manually.\n event.preventDefault();\n var selection = getSelection(input); // If a selection is made, just erase the selected text.\n\n if (selection) {\n eraseSelection(input, selection);\n return formatInputText(input, _parse, _format, undefined, on_change);\n } // Else, perform the (character erasing) operation manually.\n\n\n return formatInputText(input, _parse, _format, operation, on_change);\n\n default: // Will be handled normally as part of the `onChange` handler.\n\n }\n}\n/**\r\n * Erases the selected text inside an ``.\r\n * @param {DOMElement} input\r\n * @param {Selection} selection\r\n */\n\nfunction eraseSelection(input, selection) {\n var text = input.value;\n text = text.slice(0, selection.start) + text.slice(selection.end);\n input.value = text;\n setCaretPosition(input, selection.start);\n}\n/**\r\n * Parses and re-formats `` textual value.\r\n * E.g. when a user enters something into the ``\r\n * that raw input must first be parsed and the re-formatted properly.\r\n * Is called either after some user input (e.g. entered a character, pasted something)\r\n * or after the user performed an `operation` (e.g. \"Backspace\", \"Delete\").\r\n * @param {DOMElement} input\r\n * @param {Function} parse\r\n * @param {Function} format\r\n * @param {string} [operation] - The operation that triggered `` textual value change. E.g. \"Backspace\", \"Delete\".\r\n * @param {Function} onChange\r\n */\n\n\nfunction formatInputText(input, _parse, _format, operation, on_change) {\n // Parse `` textual value.\n // Get the `value` and `caret` position.\n var _parse2 = parse(input.value, getCaretPosition(input), _parse),\n value = _parse2.value,\n caret = _parse2.caret; // If a user performed an operation (\"Backspace\", \"Delete\")\n // then apply that operation and get the new `value` and `caret` position.\n\n\n if (operation) {\n var newValueAndCaret = edit(value, caret, operation);\n value = newValueAndCaret.value;\n caret = newValueAndCaret.caret;\n } // Format the `value`.\n // (and reposition the caret accordingly)\n\n\n var formatted = format(value, caret, _format);\n var text = formatted.text;\n caret = formatted.caret; // Set `` textual value manually\n // to prevent React from resetting the caret position\n // later inside a subsequent `render()`.\n // Doesn't work for custom `inputComponent`s for some reason.\n\n input.value = text; // Position the caret properly.\n\n setCaretPosition(input, caret); // If the `` textual value did change,\n // then the parsed `value` may have changed too.\n\n on_change(value);\n}\n//# sourceMappingURL=inputControl.js.map","// Parses the `text`.\n//\n// Returns `{ value, caret }` where `caret` is\n// the caret position inside `value`\n// corresponding to the `caret_position` inside `text`.\n//\n// The `text` is parsed by feeding each character sequentially to\n// `parse_character(character, value)` function\n// and appending the result (if it's not `undefined`) to `value`.\n//\n// Example:\n//\n// `text` is `8 (800) 555-35-35`,\n// `caret_position` is `4` (before the first `0`).\n// `parse_character` is `(character, value) =>\n// if (character >= '0' && character <= '9') { return character }`.\n//\n// then `parse()` outputs `{ value: '88005553535', caret: 2 }`.\n//\nexport default function parse(text, caret_position, parse_character) {\n var value = '';\n var focused_input_character_index = 0;\n var index = 0;\n\n while (index < text.length) {\n var character = parse_character(text[index], value);\n\n if (character !== undefined) {\n value += character;\n\n if (caret_position !== undefined) {\n if (caret_position === index) {\n focused_input_character_index = value.length - 1;\n } else if (caret_position > index) {\n focused_input_character_index = value.length;\n }\n }\n }\n\n index++;\n } // If caret position wasn't specified\n\n\n if (caret_position === undefined) {\n // Then set caret position to \"after the last input character\"\n focused_input_character_index = value.length;\n }\n\n var result = {\n value: value,\n caret: focused_input_character_index\n };\n return result;\n}\n//# sourceMappingURL=parse.js.map","// Edits text `value` (if `operation` is passed) and repositions the `caret` if needed.\n//\n// Example:\n//\n// value - '88005553535'\n// caret - 2 // starting from 0; is positioned before the first zero\n// operation - 'Backspace'\n//\n// Returns\n// {\n// \tvalue: '8005553535'\n// \tcaret: 1\n// }\n//\n// Currently supports just 'Delete' and 'Backspace' operations\n//\nexport default function edit(value, caret, operation) {\n switch (operation) {\n case 'Backspace':\n // If there exists the previous character,\n // then erase it and reposition the caret.\n if (caret > 0) {\n // Remove the previous character\n value = value.slice(0, caret - 1) + value.slice(caret); // Position the caret where the previous (erased) character was\n\n caret--;\n }\n\n break;\n\n case 'Delete':\n // Remove current digit (if any)\n value = value.slice(0, caret) + value.slice(caret + 1);\n break;\n }\n\n return {\n value: value,\n caret: caret\n };\n}\n//# sourceMappingURL=edit.js.map","import template_formatter from './templateFormatter'; // Formats `value` value preserving `caret` at the same character.\n//\n// `{ value, caret }` attribute is the result of `parse()` function call.\n//\n// Returns `{ text, caret }` where the new `caret` is the caret position\n// inside `text` text corresponding to the original `caret` position inside `value`.\n//\n// `formatter(value)` is a function returning `{ text, template }`.\n//\n// `text` is the `value` value formatted using `template`.\n// It may either cut off the non-filled right part of the `template`\n// or it may fill the non-filled character placeholders\n// in the right part of the `template` with `spacer`\n// which is a space (' ') character by default.\n//\n// `template` is the template used to format the `value`.\n// It can be either a full-length template or a partial template.\n//\n// `formatter` can also be a string — a `template`\n// where character placeholders are denoted by 'x'es.\n// In this case `formatter` function is automatically created.\n//\n// Example:\n//\n// `value` is '880',\n// `caret` is `2` (before the first `0`)\n//\n// `formatter` is `'880' =>\n// { text: '8 (80 )', template: 'x (xxx) xxx-xx-xx' }`\n//\n// The result is `{ text: '8 (80 )', caret: 4 }`.\n//\n\nexport default function format(value, caret, formatter) {\n if (typeof formatter === 'string') {\n formatter = template_formatter(formatter);\n }\n\n var _ref = formatter(value) || {},\n text = _ref.text,\n template = _ref.template;\n\n if (text === undefined) {\n text = value;\n }\n\n if (template) {\n if (caret === undefined) {\n caret = text.length;\n } else {\n var index = 0;\n var found = false;\n var possibly_last_input_character_index = -1;\n\n while (index < text.length && index < template.length) {\n // Character placeholder found\n if (text[index] !== template[index]) {\n if (caret === 0) {\n found = true;\n caret = index;\n break;\n }\n\n possibly_last_input_character_index = index;\n caret--;\n }\n\n index++;\n } // If the caret was positioned after last input character,\n // then the text caret index is just after the last input character.\n\n\n if (!found) {\n caret = possibly_last_input_character_index + 1;\n }\n }\n }\n\n return {\n text: text,\n caret: caret\n };\n}\n//# sourceMappingURL=format.js.map","import { count_occurences } from './helpers';\nimport close_braces from './closeBraces'; // Takes a `template` where character placeholders\n// are denoted by 'x'es (e.g. 'x (xxx) xxx-xx-xx').\n//\n// Returns a function which takes `value` characters\n// and returns the `template` filled with those characters.\n// If the `template` can only be partially filled\n// then it is cut off.\n//\n// If `should_close_braces` is `true`,\n// then it will also make sure all dangling braces are closed,\n// e.g. \"8 (8\" -> \"8 (8 )\" (iPhone style phone number input).\n//\n\nexport default function (template) {\n var placeholder = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'x';\n var should_close_braces = arguments.length > 2 ? arguments[2] : undefined;\n\n if (!template) {\n return function (value) {\n return {\n text: value\n };\n };\n }\n\n var characters_in_template = count_occurences(placeholder, template);\n return function (value) {\n if (!value) {\n return {\n text: '',\n template: template\n };\n }\n\n var value_character_index = 0;\n var filled_in_template = ''; // Using `.split('')` here instead of normal `for ... of`\n // because the importing application doesn't neccessarily include an ES6 polyfill.\n // The `.split('')` approach discards \"exotic\" UTF-8 characters\n // (the ones consisting of four bytes)\n // but template placeholder characters don't fall into that range\n // and appending UTF-8 characters to a string in parts still works.\n\n for (var _iterator = template.split(''), _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {\n var _ref;\n\n if (_isArray) {\n if (_i >= _iterator.length) break;\n _ref = _iterator[_i++];\n } else {\n _i = _iterator.next();\n if (_i.done) break;\n _ref = _i.value;\n }\n\n var character = _ref;\n\n if (character !== placeholder) {\n filled_in_template += character;\n continue;\n }\n\n filled_in_template += value[value_character_index];\n value_character_index++; // If the last available value character has been filled in,\n // then return the filled in template\n // (either trim the right part or retain it,\n // if no more character placeholders in there)\n\n if (value_character_index === value.length) {\n // If there are more character placeholders\n // in the right part of the template\n // then simply trim it.\n if (value.length < characters_in_template) {\n break;\n }\n }\n }\n\n if (should_close_braces) {\n filled_in_template = close_braces(filled_in_template, template);\n }\n\n return {\n text: filled_in_template,\n template: template\n };\n };\n}\n//# sourceMappingURL=templateFormatter.js.map","import { count_occurences } from './helpers';\nexport default function closeBraces(retained_template, template) {\n var placeholder = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'x';\n var empty_placeholder = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : ' ';\n var cut_before = retained_template.length;\n var opening_braces = count_occurences('(', retained_template);\n var closing_braces = count_occurences(')', retained_template);\n var dangling_braces = opening_braces - closing_braces;\n\n while (dangling_braces > 0 && cut_before < template.length) {\n retained_template += template[cut_before].replace(placeholder, empty_placeholder);\n\n if (template[cut_before] === ')') {\n dangling_braces--;\n }\n\n cut_before++;\n }\n\n return retained_template;\n}\n//# sourceMappingURL=closeBraces.js.map","function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\n\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\n\n// This is just `./ReactInput.js` rewritten in Hooks.\nimport React, { useCallback, useRef } from 'react';\nimport PropTypes from 'prop-types';\nimport { onChange as onInputChange, onKeyDown as onInputKeyDown } from '../inputControl'; // Usage:\n//\n// this.setState({ phone })}\n// \tparse={character => character}\n// \tformat={value => ({ text: value, template: 'xxxxxxxx' })}/>\n//\n\nfunction Input(_ref, ref) {\n var value = _ref.value,\n parse = _ref.parse,\n format = _ref.format,\n InputComponent = _ref.inputComponent,\n onChange = _ref.onChange,\n onKeyDown = _ref.onKeyDown,\n rest = _objectWithoutProperties(_ref, [\"value\", \"parse\", \"format\", \"inputComponent\", \"onChange\", \"onKeyDown\"]);\n\n var internalRef = useRef();\n var setRef = useCallback(function (instance) {\n internalRef.current = instance;\n\n if (ref) {\n if (typeof ref === 'function') {\n ref(instance);\n } else {\n ref.current = instance;\n }\n }\n }, [ref]);\n\n var _onChange = useCallback(function (event) {\n return onInputChange(event, internalRef.current, parse, format, onChange);\n }, [internalRef, parse, format, onChange]);\n\n var _onKeyDown = useCallback(function (event) {\n if (onKeyDown) {\n onKeyDown(event);\n }\n\n return onInputKeyDown(event, internalRef.current, parse, format, onChange);\n }, [internalRef, parse, format, onChange, onKeyDown]);\n\n return React.createElement(InputComponent, _extends({}, rest, {\n ref: setRef,\n value: format(isEmptyValue(value) ? '' : value).text,\n onKeyDown: _onKeyDown,\n onChange: _onChange\n }));\n}\n\nInput = React.forwardRef(Input);\nInput.propTypes = {\n // Parses a single characher of `` text.\n parse: PropTypes.func.isRequired,\n // Formats `value` into `` text.\n format: PropTypes.func.isRequired,\n // Renders `` by default.\n inputComponent: PropTypes.elementType.isRequired,\n // `` `type` attribute.\n type: PropTypes.string.isRequired,\n // Is parsed from text.\n value: PropTypes.string,\n // This handler is called each time `` text is changed.\n onChange: PropTypes.func.isRequired,\n // Passthrough\n onKeyDown: PropTypes.func,\n onCut: PropTypes.func,\n onPaste: PropTypes.func\n};\nInput.defaultProps = {\n // Renders `` by default.\n inputComponent: 'input',\n // `` `type` attribute.\n type: 'text'\n};\nexport default Input;\n\nfunction isEmptyValue(value) {\n return value === undefined || value === null;\n}\n//# sourceMappingURL=Input.js.map","import _curry2 from \"./internal/_curry2.js\";\n/**\n * Returns the second argument if it is not `null`, `undefined` or `NaN`;\n * otherwise the first argument is returned.\n *\n * @func\n * @memberOf R\n * @since v0.10.0\n * @category Logic\n * @sig a -> b -> a | b\n * @param {a} default The default value.\n * @param {b} val `val` will be returned instead of `default` unless `val` is `null`, `undefined` or `NaN`.\n * @return {*} The second value if it is not `null`, `undefined` or `NaN`, otherwise the default value\n * @example\n *\n * const defaultTo42 = R.defaultTo(42);\n *\n * defaultTo42(null); //=> 42\n * defaultTo42(undefined); //=> 42\n * defaultTo42(false); //=> false\n * defaultTo42('Ramda'); //=> 'Ramda'\n * // parseInt('string') results in NaN\n * defaultTo42(parseInt('string')); //=> 42\n */\n\nvar defaultTo =\n/*#__PURE__*/\n_curry2(function defaultTo(d, v) {\n return v == null || v !== v ? d : v;\n});\n\nexport default defaultTo;","import _curry3 from \"./internal/_curry3.js\";\nimport defaultTo from \"./defaultTo.js\";\nimport path from \"./path.js\";\n/**\n * If the given, non-null object has a value at the given path, returns the\n * value at that path. Otherwise returns the provided default value.\n *\n * @func\n * @memberOf R\n * @since v0.18.0\n * @category Object\n * @typedefn Idx = String | Int\n * @sig a -> [Idx] -> {a} -> a\n * @param {*} d The default value.\n * @param {Array} p The path to use.\n * @param {Object} obj The object to retrieve the nested property from.\n * @return {*} The data at `path` of the supplied object or the default value.\n * @example\n *\n * R.pathOr('N/A', ['a', 'b'], {a: {b: 2}}); //=> 2\n * R.pathOr('N/A', ['a', 'b'], {c: {b: 2}}); //=> \"N/A\"\n */\n\nvar pathOr =\n/*#__PURE__*/\n_curry3(function pathOr(d, p, obj) {\n return defaultTo(d, path(p, obj));\n});\n\nexport default pathOr;"],"names":["global","bind","call","toObject","callWithSafeIterationClosing","isArrayIteratorMethod","isConstructor","lengthOfArrayLike","createProperty","getIterator","getIteratorMethod","Array","module","exports","arrayLike","O","IS_CONSTRUCTOR","this","argumentsLength","arguments","length","mapfn","undefined","mapping","result","step","iterator","next","value","iteratorMethod","index","done","anObject","iteratorClose","fn","ENTRIES","error","_typeof","obj","Symbol","constructor","prototype","CountrySelectWithIcon","_react","__esModule","cache","_getRequireWildcardCache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","hasOwnProperty","desc","set","_interopRequireWildcard","_propTypes","_interopRequireDefault","_classnames","_unicode","WeakMap","_extends","assign","target","i","source","apply","_objectWithoutProperties","excluded","sourceKeys","keys","indexOf","_objectWithoutPropertiesLoose","getOwnPropertySymbols","sourceSymbolKeys","propertyIsEnumerable","CountrySelect","_ref","onChange","options","rest","onChange_","useCallback","event","useMemo","getSelectedOption","createElement","map","_ref2","label","divider","disabled","style","DIVIDER_STYLE","propTypes","string","func","isRequired","arrayOf","shape","bool","fontSize","backgroundColor","color","_ref3","className","Icon","iconComponent","Arrow","getIconAspectRatio","arrowComponent","unicodeFlags","selectedOption","country","aspectRatio","_iterator","_isArray","isArray","_i","_ref4","option","elementType","defaultProps","_defineProperty","enumerable","configurable","writable","isValidPhoneNumber","_normalizeArguments","normalizeArguments","text","metadata","ownKeys","concat","filter","sym","forEach","_objectSpread","extract","phoneNumber","parsePhoneNumberFromString","isValid","isPossiblePhoneNumber","isPossible","country_calling_codes","countries","labels","_defineProperties","props","descriptor","AsYouTypeState","_this","onCountryChange","onCallingCodeChange","instance","Constructor","TypeError","_classCallCheck","properties","_Object$keys","protoProps","defaultCountry","defaultCallingCode","international","IDDPrefix","missingPlus","callingCode","digits","resetNationalSignificantNumber","initCountryAndCallingCode","nationalSignificantNumber","getNationalDigits","nationalSignificantNumberMatchesInput","nationalPrefix","carrierCode","complexPrefixBeforeNationalSignificantNumber","setCountry","setCallingCode","nextDigits","slice","DIGIT_PLACEHOLDER","DIGIT_PLACEHOLDER_MATCHER","RegExp","repeat","times","cutAndStripNonPairedParens","cutBeforeIndex","dangling_braces","push","pop","start","cleared_string","_i2","_dangling_braces","stripNonPairedParens","formatCompleteNumber","state","format","shouldTryNationalPrefixFormattingRule","getSeparatorAfterNationalPrefix","pattern","test","formattedNumber","formatNationalNumber","useNationalPrefixFormattingRule","formatNationalNumberWithAndWithoutNationalPrefixFormattingRule","formattedNationalNumber","formatNationalNumberUsingFormat","useInternationalFormat","withNationalPrefix","parseDigits","isValidFormattedNationalNumber","LONGEST_DUMMY_PHONE_NUMBER","NATIONAL_PREFIX_SEPARATORS_PATTERN","NON_ALTERING_FORMAT_REG_EXP","VALID_PUNCTUATION","AsYouTypeFormatter","isNANP","nationalPrefixFormattingRule","usesNationalPrefix","resetFormat","chosenFormat","template","nationalNumberTemplate","populatedNationalNumberTemplate","populatedNationalNumberTemplatePosition","numberingPlan","matchingFormats","formats","narrowDownMatchingFormats","_this2","checkNumberLength","canFormatCompleteNumber","formattedCompleteNumber","setNationalNumberTemplate","replace","lastIndexOf","formatNationalNumberWithNextDigits","previouslyChosenFormat","newlyChosenFormat","chooseFormat","formatNextNationalNumberDigits","_this3","leadingDigits","leadingDigitsPatternIndex","formatSuits","formatMatches","nationalPrefixIsOptionalWhenFormattingInNationalFormat","nationalPrefixIsMandatoryWhenFormattingInNationalFormat","leadingDigitsPatternsCount","leadingDigitsPatterns","Math","min","leadingDigitsPattern","internationalFormat","_this4","_loop2","_isArray2","_iterator2","_ref5","getFormatFormat","createTemplateForFormat","_","_loop","getTemplateForFormat","_ref6","spacing","internationalPrefix","getInternationalPrefixBeforeCountryCallingCode","getDigitsWithoutInternationalPrefix","_ref7","match","strictPattern","nationalNumberDummyDigits","nationalPrefixIncludedInTemplate","numberFormat","numberFormatWithNationalPrefix","FIRST_GROUP_PATTERN","applyInternationalSeparatorStyle","position","split","_i3","digit","search","populateTemplateWithDigits","_slicedToArray","arr","_arrayWithHoles","_arr","_n","_d","_e","_s","err","_iterableToArrayLimit","_nonIterableRest","VALID_FORMATTED_PHONE_NUMBER_DIGITS_PART","VALID_DIGITS","VALID_FORMATTED_PHONE_NUMBER_DIGITS_PART_PATTERN","VALID_FORMATTED_PHONE_NUMBER_PART","PLUS_CHARS","AFTER_PHONE_NUMBER_DIGITS_END_PATTERN","COMPLEX_NATIONAL_PREFIX","AsYouTypeParser","onNationalSignificantNumberChange","justLeadingPlus","_extractFormattedDigi","_extractFormattedDigi3","extractedNumber","hasPlus","startsAt","extractFormattedPhoneNumber","_extractFormattedDigitsAndPlus","_extractFormattedDigi4","formattedDigits","extractFormattedDigitsAndPlus","_extractFormattedDigi2","startInternationalNumber","inputDigits","hasReceivedThreeLeadingDigits","appendDigits","extractIddPrefix","isWaitingForCountryCallingCode","extractCountryCallingCode","appendNationalSignificantNumberDigits","hasExtractedNationalSignificantNumber","extractNationalSignificantNumber","update","_extractCountryCallin","_extractCountryCallingCode","countryCallingCode","number","hasSelectedNumberingPlan","nationalPrefixForParsing","_nationalPrefixForParsing","couldPossiblyExtractAnotherNationalSignificantNumber","nationalDigits","setState","_extractNationalNumbe","extractNationalNumberFromPossiblyIncompleteNumber","nationalNumber","onExtractedNationalNumber","prevNationalSignificantNumber","_extractNationalNumbe2","nationalSignificantNumberIndex","prefixBeforeNationalNumber","extractAnotherNationalSignificantNumber","fixMissingPlus","extractCallingCodeAndNationalSignificantNumber","numberWithoutIDD","stripIddPrefix","_extractCountryCallin2","extractCountryCallingCodeFromInternationalNumberWithoutPlusSign","newCallingCode","AsYouType","optionsOrDefaultCountry","Metadata","_this$getCountryAndCa2","getCountryAndCallingCode","reset","hasCountry","_this$parser$input","parser","input","formattedOutput","determineTheCountryIfNeeded","formatter","reExtractNationalSignificantNumber","getFullNumber","getNonFormattedNumber","selectNumberingPlan","getCallingCode","_this$state","isCountryCallingCodeAmbiguous","determineTheCountry","isInternational","_this$state2","prefix","getNonFormattedNationalNumberWithPrefix","countryCodes","getCountryCodesForCallingCode","getCountryByCallingCode","_this$state3","countryCode","getCountry","getCountryCallingCode","PhoneNumber","getNumber","getTemplate","getNonFormattedTemplate","getInputValuePrefix","withCountryCallingCode","removeInputValuePrefix","defaultMetadata","InputSmart","ref","Input","parse","InputBasic","inputComponent","_onChange","newValue","parseIncompletePhoneNumber","formatIncompletePhoneNumber","FlagComponent","countryName","flags","flagUrl","title","alt","role","src","toLowerCase","InternationalIcon1x1","InternationalIcon3x2","xmlns","viewBox","stroke","fill","strokeWidth","strokeMiterlimit","strokeLinecap","d","x1","y1","x2","y2","isCountrySupportedWithError","console","getSupportedCountries","getCountries","createCountryIconComponent","flagComponent","InternationalIcon","internationalIcon","CountryIcon","_aspectRatio","ONLY_DIGITS_REGEXP","getInternationalPhoneNumberPrefix","e164","partial_national_significant_number","getNationalSignificantNumberDigits","getCountryForPartialE164Number","partialE164Number","required","derived_country","getCountryFromPossiblyIncompleteInternationalPhoneNumber","couldNumberBelongToCountry","convertInternationalPhoneDigitsToNational","formatNational","compareStrings","a","b","locales","String","localeCompare","intlPhoneNumberPrefix","getInitialPhoneDigits","useNationalFormat","generateNationalNumberDigits","object","enumerableOnly","symbols","getOwnPropertyDescriptors","defineProperties","_getPrototypeOf","o","setPrototypeOf","getPrototypeOf","__proto__","_assertThisInitialized","self","ReferenceError","_setPrototypeOf","p","PhoneNumberInput_","_React$PureComponent","_possibleConstructorReturn","inputRef","current","newCountry","_this$props","focusInputOnCountrySelection","newPhoneDigits","phoneDigits","prevCountry","countryCallingCodePrefix","country_calling_code","stripCountryCallingCode","newCountryPrefix","defaultValue","getPhoneDigitsForNewCountry","focus","hasUserSelectedACountry","_phoneDigits","_this$props2","addInternationalOption","limitMaxLength","countryCallingCodeEditable","_onPhoneDigitsChange","prevPhoneDigits","countryRequired","getAnyCountry","_value","nationalSignificantNumberPart","overflowDigitsCount","possibleLengths","getMaxNumberLength","trimNumber","onPhoneDigitsChange","getFirstSupportedCountry","stateUpdate","forceRerender","isFocused","_onFocus","onFocus","onBlur","_onBlur","countrySelectProps","_this$props3","_international","_addInternationalOption","displayInitialValueAsLocalNumber","initialValueFormat","_metadata","_this$props4","_defaultCountry","_countries","preSelectedCountry","getPreSelectedCountry","staticProps","subClass","superClass","create","_inherits","selectedCountry","prevProps","prevState","generator","dependencies","_this$props5","countryOptionsOrder","order","optionsOnTop","optionsOnBottom","appendTo","element","splice","sortCountryOptions","countryNames","compareStringsLocales","_compareStrings","countrySelectOptions","sort","unshift","ZZ","countryOptions","getSupportedCountryOptions","countrySelectOptionsMemoDependencies","areEqualArrays","countrySelectOptionsMemo","getCountrySelectOptions","_this$props6","name","autoComplete","numberInputProps","smartCaret","CountrySelectComponent","countrySelectComponent","ContainerComponent","containerComponent","InputComponent","onCountryFocus","onCountryBlur","setInputRef","type","newDefaultCountry","newReset","prevDefaultCountry","prevValue","prevReset","_getInitialPhoneDigits","parameters","isNewDefaultCountrySupported","noValueHasBeenEnteredByTheUser","parsedCountry","hasUserSelectedACountryUpdate","supportedCountries","getPhoneInputWithCountryStateUpdateFromNewProps","PhoneNumberInput","onKeyDown","createPhoneInput","PhoneInputDefault","_arguments","args","___CSS_LOADER_API_IMPORT___","id","locals","LANG_PROP_TO_LABEL_FILE_MAP","en_gb","ru_ru","sv_se","de_de","_a","__rest","useState","isRendered","setIsRendered","useEffect","timeout","window","setTimeout","clearTimeout","React","ChevronDownIcon","styles","chevron","hint","shouldShowValidationIcon","shouldDisableValidation","disableLabel","lang","shouldValidateOnBlur","onErrorCallBack","validationFunctions","onBlurCallBack","placeholder","restProps","localeLabels","setLocaleLabels","getIsMounted","useIsMounted","getLocaleFile","then","isPossibleNumber","handleChange","handleBlur","isValidNumber","targetValue","Field","render","validationStatus","cn","wrapper","valid","invalid","PhoneInput","inputMode","IconWrapper","SINGLE_IDD_PREFIX_REG_EXP","DEFAULT_OPTIONS","formatExtension","extension","ext","formatAs","availableFormats","nationalNnumber","lastLeadingDigitsPattern","matchesEntirely","chooseFormatForNumber","addExtension","isCountryCode","v2","hasTypes","getNumberType","national_number","phone","nationalNumberPattern","isNonGeographicCallingCode","_format","Error","formatRFC3966","fromCountry","iddPrefix","countryMetadata","defaultIDDPrefix","getIddPrefix","formatIDD","formatNumber","MIN_LENGTH_FOR_NSN","MAX_LENGTH_FOR_NSN","MAX_LENGTH_COUNTRY_CODE","parseRFC3966","_part$split2","isViablePhoneNumber","trim","checkNumberLengthForType","type_info","possible_lengths","mobile_type","merged","mergeArrays","actual_length","minimum_length","RFC3966_EXTN_PREFIX","getExtensionDigitsPattern","maxLength","createExtensionPattern","purpose","possibleSeparatorsBetweenNumberAndExtLabel","possibleCharsAfterExtLabel","optionalExtnSuffix","possibleSeparatorsNumberExtLabelNoComma","rfcExtn","shorterNumber","_countryCallingCode","hasCallingCode","possibleShorterNumber","possibleShorterNationalNumber","extractNationalNumber","shouldExtractNationalPrefix","prefixPattern","prefixMatch","exec","capturedGroupsCount","hasCapturedGroups","nationalPrefixTransformRule","possiblePositionOfTheFirstCapturedGroup","USE_NON_GEOGRAPHIC_COUNTRY_CODE","nationalPhoneNumber","possibleCountries","selectCountryFromList","NON_FIXED_LINE_PHONE_TYPES","isNumberTypeEqualTo","_NON_FIXED_LINE_PHONE","MIN_LENGTH_PHONE_NUMBER_PATTERN","VALID_PHONE_NUMBER_WITH_EXTENSION","VALID_PHONE_NUMBER","VALID_PHONE_NUMBER_PATTERN","regular_expression","DIGITS","parseDigit","character","CAPTURING_DIGIT_PATTERN","IDDPrefixPattern","matchedGroups","pa","pb","na","Number","nb","isNaN","_createClass","DEFAULT_EXT_PREFIX","CALLING_CODE_REG_EXP","is_object","join","type_of","validateMetadata","setVersion","v1","v3","nonGeographic","nonGeographical","getCountryMetadata","countryCallingCodes","NumberingPlan","getNumberingPlanMetadata","getCountryCodeForCallingCode","_type","country_phone_code_to_countries","globalMetadataObject","_getFormats","getDefaultCountryMetadataForRegion","Format","_getNationalPrefixFormattingRule","_getNationalPrefixIsOptionalWhenFormatting","types","_type2","getType","Type","FIRST_GROUP_ONLY_PREFIX_PATTERN","isSupportedCountry","version","v4","compare","parsePhoneNumberCharacter","prevParsedCharacters","_Array$prototype$slic2","arg_1","arg_2","arg_3","arg_4","isObject","parsePhoneNumberFromString_","ParseError","code","message","stack","EXTN_PATTERN","MAX_INPUT_STRING_LENGTH","PHONE_NUMBER_START_PATTERN","AFTER_PHONE_NUMBER_END_PATTERN","parsePhoneNumber","_parseInput","throwOnError","withExtensionStripped","numberWithoutExtension","matches","extractExtension","parseInput","formattedPhoneNumber","_parsePhoneNumber","exactCountry","extended","possible","parseNumber","getCountryFlag","getRegionalIndicatorSymbol","letter","fromCodePoint","toUpperCase","charCodeAt","count_occurences","symbol","count","Keys","Backspace","Delete","setCaretPosition","caret_position","navigator","ANDROID_USER_AGENT_REG_EXP","userAgent","isAndroid","setSelectionRange","_parse","on_change","operation","keyCode","getOperation","preventDefault","selection","selectionStart","selectionEnd","end","getSelection","eraseSelection","formatInputText","_parse2","parse_character","focused_input_character_index","caret","newValueAndCaret","edit","formatted","should_close_braces","characters_in_template","value_character_index","filled_in_template","retained_template","empty_placeholder","cut_before","close_braces","template_formatter","found","possibly_last_input_character_index","internalRef","useRef","setRef","_onKeyDown","onInputKeyDown","isEmptyValue","PropTypes","onCut","onPaste","_curry2","v","_curry3","defaultTo","path"],"sourceRoot":""}