PATH:
opt
/
bitninja-dispatcher
/
node_modules
/
libphonenumber-js
/
es6
{"version":3,"file":"AsYouTypeState.js","names":["AsYouTypeState","onCountryChange","onCallingCodeChange","defaultCountry","defaultCallingCode","international","IDDPrefix","undefined","missingPlus","callingCode","digits","resetNationalSignificantNumber","initCountryAndCallingCode","nationalSignificantNumber","getNationalDigits","nationalSignificantNumberMatchesInput","nationalPrefix","carrierCode","complexPrefixBeforeNationalSignificantNumber","properties","Object","keys","key","country","setCountry","setCallingCode","nextDigits","slice","length"],"sources":["../source/AsYouTypeState.js"],"sourcesContent":["export default class AsYouTypeState {\r\n\tconstructor({ onCountryChange, onCallingCodeChange }) {\r\n\t\tthis.onCountryChange = onCountryChange\r\n\t\tthis.onCallingCodeChange = onCallingCodeChange\r\n\t}\r\n\r\n\treset(defaultCountry, defaultCallingCode) {\r\n\t\tthis.international = false\r\n\t\tthis.IDDPrefix = undefined\r\n\t\tthis.missingPlus = undefined\r\n\t\tthis.callingCode = undefined\r\n\t\tthis.digits = ''\r\n\t\tthis.resetNationalSignificantNumber()\r\n\t\tthis.initCountryAndCallingCode(defaultCountry, defaultCallingCode)\r\n\t}\r\n\r\n\tresetNationalSignificantNumber() {\r\n\t\tthis.nationalSignificantNumber = this.getNationalDigits()\r\n\t\tthis.nationalSignificantNumberMatchesInput = true\r\n\t\tthis.nationalPrefix = undefined\r\n\t\tthis.carrierCode = undefined\r\n\t\tthis.complexPrefixBeforeNationalSignificantNumber = undefined\r\n\t}\r\n\r\n\tupdate(properties) {\r\n\t\tfor (const key of Object.keys(properties)) {\r\n\t\t\tthis[key] = properties[key]\r\n\t\t}\r\n\t}\r\n\r\n\tinitCountryAndCallingCode(country, callingCode) {\r\n\t\tthis.setCountry(country)\r\n\t\tthis.setCallingCode(callingCode)\r\n\t}\r\n\r\n\tsetCountry(country) {\r\n\t\tthis.country = country\r\n\t\tthis.onCountryChange(country)\r\n\t}\r\n\r\n\tsetCallingCode(callingCode) {\r\n\t\tthis.callingCode = callingCode\r\n\t\tthis.onCallingCodeChange(callingCode, this.country)\r\n\t}\r\n\r\n\tstartInternationalNumber(country, callingCode) {\r\n\t\t// Prepend the `+` to parsed input.\r\n\t\tthis.international = true\r\n\t\t// If a default country was set then reset it\r\n\t\t// because an explicitly international phone\r\n\t\t// number is being entered.\r\n\t\tthis.initCountryAndCallingCode(country, callingCode)\r\n\t}\r\n\r\n\tappendDigits(nextDigits) {\r\n\t\tthis.digits += nextDigits\r\n\t}\r\n\r\n\tappendNationalSignificantNumberDigits(nextDigits) {\r\n\t\tthis.nationalSignificantNumber += nextDigits\r\n\t}\r\n\r\n\t/**\r\n\t * Returns the part of `this.digits` that corresponds to the national number.\r\n\t * Basically, all digits that have been input by the user, except for the\r\n\t * international prefix and the country calling code part\r\n\t * (if the number is an international one).\r\n\t * @return {string}\r\n\t */\r\n\tgetNationalDigits() {\r\n\t\tif (this.international) {\r\n\t\t\treturn this.digits.slice(\r\n\t\t\t\t(this.IDDPrefix ? this.IDDPrefix.length : 0) +\r\n\t\t\t\t(this.callingCode ? this.callingCode.length : 0)\r\n\t\t\t)\r\n\t\t}\r\n\t\treturn this.digits\r\n\t}\r\n\r\n\tgetDigitsWithoutInternationalPrefix() {\r\n\t\tif (this.international) {\r\n\t\t\tif (this.IDDPrefix) {\r\n\t\t\t\treturn this.digits.slice(this.IDDPrefix.length)\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn this.digits\r\n\t}\r\n}"],"mappings":";;;;;;IAAqBA,c;EACpB,8BAAsD;IAAA,IAAxCC,eAAwC,QAAxCA,eAAwC;IAAA,IAAvBC,mBAAuB,QAAvBA,mBAAuB;;IAAA;;IACrD,KAAKD,eAAL,GAAuBA,eAAvB;IACA,KAAKC,mBAAL,GAA2BA,mBAA3B;EACA;;;;WAED,eAAMC,cAAN,EAAsBC,kBAAtB,EAA0C;MACzC,KAAKC,aAAL,GAAqB,KAArB;MACA,KAAKC,SAAL,GAAiBC,SAAjB;MACA,KAAKC,WAAL,GAAmBD,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BAAoB;MACnB,IAAI,KAAKrB,aAAT,EAAwB;QACvB,OAAO,KAAKK,MAAL,CAAYiB,KAAZ,CACN,CAAC,KAAKrB,SAAL,GAAiB,KAAKA,SAAL,CAAesB,MAAhC,GAAyC,CAA1C,KACC,KAAKnB,WAAL,GAAmB,KAAKA,WAAL,CAAiBmB,MAApC,GAA6C,CAD9C,CADM,CAAP;MAIA;;MACD,OAAO,KAAKlB,MAAZ;IACA;;;WAED,+CAAsC;MACrC,IAAI,KAAKL,aAAT,EAAwB;QACvB,IAAI,KAAKC,SAAT,EAAoB;UACnB,OAAO,KAAKI,MAAL,CAAYiB,KAAZ,CAAkB,KAAKrB,SAAL,CAAesB,MAAjC,CAAP;QACA;MACD;;MACD,OAAO,KAAKlB,MAAZ;IACA;;;;;;SAtFmBV,c"}
[+]
..
[-] parsePhoneNumberFromString.test.js
[edit]
[-] AsYouTypeFormatter.PatternMatcher.js.map
[edit]
[-] parseIncompletePhoneNumber.js.map
[edit]
[-] metadata.js
[edit]
[-] isPossibleNumber_.js.map
[edit]
[-] PhoneNumber.js
[edit]
[-] findNumbers.js.map
[edit]
[-] parsePhoneNumber.js
[edit]
[-] isPossibleNumber.test.js.map
[edit]
[-] isPossiblePhoneNumber.test.js
[edit]
[-] findNumbers.js
[edit]
[-] isPossibleNumber.js
[edit]
[-] getNumberType.js
[edit]
[-] getNumberType.js.map
[edit]
[-] AsYouTypeFormatter.PatternMatcher.js
[edit]
[-] parseIncompletePhoneNumber.test.js.map
[edit]
[-] parse_.js
[edit]
[-] getExampleNumber.js.map
[edit]
[-] format.test.js.map
[edit]
[-] parsePhoneNumber_.js.map
[edit]
[-] getExampleNumber.test.js
[edit]
[-] AsYouTypeState.js.map
[edit]
[-] formatNumberForMobileDialing.js.map
[edit]
[-] formatIncompletePhoneNumber.test.js.map
[edit]
[-] AsYouTypeParser.js
[edit]
[-] getExampleNumber.test.js.map
[edit]
[-] validate_.js
[edit]
[-] PhoneNumberMatcher.js.map
[edit]
[-] parsePhoneNumberFromString_.js
[edit]
[-] getNumberType.test.js.map
[edit]
[-] getCountryCallingCode.js.map
[edit]
[-] AsYouTypeFormatter.PatternMatcher.test.js.map
[edit]
[-] searchPhoneNumbersInText.test.js
[edit]
[-] isValidPhoneNumber.test.js.map
[edit]
[-] format_.js.map
[edit]
[-] constants.js.map
[edit]
[-] parse.js.map
[edit]
[-] AsYouTypeFormatter.js.map
[edit]
[-] getCountries.test.js
[edit]
[-] searchPhoneNumbersInText.js
[edit]
[-] AsYouTypeFormatter.PatternParser.test.js
[edit]
[-] isPossiblePhoneNumber.test.js.map
[edit]
[-] PhoneNumber.test.js.map
[edit]
[-] parsePhoneNumber.test.js.map
[edit]
[-] formatNumberForMobileDialing.js
[edit]
[-] AsYouTypeFormatter.util.test.js.map
[edit]
[-] getCountryCallingCode.js
[edit]
[-] searchNumbers.test.js.map
[edit]
[-] findPhoneNumbers.test.js
[edit]
[-] isPossibleNumber.js.map
[edit]
[-] parsePhoneNumber.test.js
[edit]
[-] isValidPhoneNumber.test.js
[edit]
[-] metadata.test.js.map
[edit]
[-] searchPhoneNumbersInText.test.js.map
[edit]
[-] AsYouTypeFormatter.PatternParser.test.js.map
[edit]
[-] AsYouType.test.js
[edit]
[-] isPossiblePhoneNumber.js.map
[edit]
[-] getCountries.js
[edit]
[-] validate.test.js
[edit]
[-] getCountryCallingCode.test.js.map
[edit]
[-] AsYouTypeFormatter.js
[edit]
[-] PhoneNumberMatcher.js
[edit]
[-] validate.test.js.map
[edit]
[-] findNumbers_.js
[edit]
[-] getCountries.js.map
[edit]
[-] formatIncompletePhoneNumber.test.js
[edit]
[-] format.test.js
[edit]
[-] findPhoneNumbers.js
[edit]
[-] searchNumbers.js
[edit]
[-] findPhoneNumbersInText.test.js.map
[edit]
[-] findPhoneNumbersInText.js
[edit]
[-] findPhoneNumbersInText.test.js
[edit]
[-] metadata.test.js
[edit]
[-] validatePhoneNumberLength.test.js.map
[edit]
[-] parse.js
[edit]
[-] validate_.js.map
[edit]
[-] validatePhoneNumberLength.test.js
[edit]
[-] format.js.map
[edit]
[-] findNumbers.test.js
[edit]
[-] AsYouTypeFormatter.complete.js.map
[edit]
[+]
tools
[-] AsYouTypeParser.js.map
[edit]
[-] parsePhoneNumberFromString.js
[edit]
[-] getCountryCallingCode.test.js
[edit]
[-] isPossibleNumber.test.js
[edit]
[-] findPhoneNumbers.test.js.map
[edit]
[-] AsYouTypeFormatter.PatternParser.js.map
[edit]
[-] parse.test.js
[edit]
[-] parsePhoneNumber_.js
[edit]
[-] parsePhoneNumberFromString_.js.map
[edit]
[-] ParseError.js
[edit]
[-] searchNumbers.js.map
[edit]
[-] PhoneNumber.test.js
[edit]
[-] AsYouTypeFormatter.PatternMatcher.test.js
[edit]
[-] getNumberType.test.js
[edit]
[-] AsYouTypeFormatter.PatternParser.js
[edit]
[-] validatePhoneNumberLength.js
[edit]
[-] isValidPhoneNumber.js
[edit]
[-] PhoneNumber.js.map
[edit]
[-] parsePhoneNumberFromString.js.map
[edit]
[-] isValidNumberForRegion.js.map
[edit]
[+]
helpers
[-] parseIncompletePhoneNumber.test.js
[edit]
[-] formatNumberForMobileDialing.test.js
[edit]
[-] isValidNumberForRegion_.js.map
[edit]
[-] parse.test.js.map
[edit]
[-] isValidNumberForRegion_.js
[edit]
[-] PhoneNumberMatcher.test.js
[edit]
[-] isPossibleNumber_.js
[edit]
[-] AsYouTypeFormatter.util.js
[edit]
[-] format.js
[edit]
[-] isValidNumberForRegion.test.js
[edit]
[-] AsYouType.js
[edit]
[-] AsYouTypeFormatter.complete.js
[edit]
[-] formatNumberForMobileDialing.test.js.map
[edit]
[+]
findNumbers
[-] findNumbers_.js.map
[edit]
[-] getExampleNumber.js
[edit]
[-] format_.js
[edit]
[-] isPossiblePhoneNumber.js
[edit]
[-] findPhoneNumbers_.js
[edit]
[-] isValidNumberForRegion.test.js.map
[edit]
[-] AsYouType.test.js.map
[edit]
[-] isValidNumberForRegion.js
[edit]
[-] ParseError.js.map
[edit]
[-] parsePhoneNumberFromString.test.js.map
[edit]
[-] findPhoneNumbersInText.js.map
[edit]
[-] findPhoneNumbers.js.map
[edit]
[-] getCountries.test.js.map
[edit]
[-] validate.js
[edit]
[-] AsYouTypeState.js
[edit]
[-] parsePhoneNumber.js.map
[edit]
[-] formatIncompletePhoneNumber.js
[edit]
[-] AsYouTypeFormatter.util.js.map
[edit]
[-] constants.js
[edit]
[-] validate.js.map
[edit]
[-] PhoneNumberMatcher.test.js.map
[edit]
[-] parse_.js.map
[edit]
[-] findNumbers.test.js.map
[edit]
[-] findPhoneNumbers_.js.map
[edit]
[-] metadata.js.map
[edit]
[-] parseIncompletePhoneNumber.js
[edit]
[-] searchNumbers.test.js
[edit]
[-] AsYouType.js.map
[edit]
[-] searchPhoneNumbersInText.js.map
[edit]
[-] validatePhoneNumberLength.js.map
[edit]
[-] AsYouTypeFormatter.util.test.js
[edit]
[-] formatIncompletePhoneNumber.js.map
[edit]
[-] isValidPhoneNumber.js.map
[edit]