Lines Matching refs:i18n
53 i18n.phonenumbers.PhoneNumberUtil = function() {
60 goog.addSingletonGetter(i18n.phonenumbers.PhoneNumberUtil);
68 i18n.phonenumbers.Error = {
92 i18n.phonenumbers.PhoneNumberUtil.NANPA_COUNTRY_CODE_ = 1;
102 i18n.phonenumbers.PhoneNumberUtil.MIN_LENGTH_FOR_NSN_ = 2;
113 i18n.phonenumbers.PhoneNumberUtil.MAX_LENGTH_FOR_NSN_ = 17;
123 i18n.phonenumbers.PhoneNumberUtil.MAX_LENGTH_COUNTRY_CODE_ = 3;
134 i18n.phonenumbers.PhoneNumberUtil.MAX_INPUT_STRING_LENGTH_ = 250;
144 i18n.phonenumbers.PhoneNumberUtil.UNKNOWN_REGION_ = 'ZZ';
155 i18n.phonenumbers.PhoneNumberUtil.COLOMBIA_MOBILE_TO_FIXED_LINE_PREFIX_ = '3';
168 i18n.phonenumbers.PhoneNumberUtil.MOBILE_TOKEN_MAPPINGS_ = {
182 i18n.phonenumbers.PhoneNumberUtil.GEO_MOBILE_COUNTRIES_ = [
195 i18n.phonenumbers.PhoneNumberUtil.PLUS_SIGN = '+';
203 i18n.phonenumbers.PhoneNumberUtil.STAR_SIGN_ = '*';
213 i18n.phonenumbers.PhoneNumberUtil.RFC3966_EXTN_PREFIX_ = ';ext=';
221 i18n.phonenumbers.PhoneNumberUtil.RFC3966_PREFIX_ = 'tel:';
229 i18n.phonenumbers.PhoneNumberUtil.RFC3966_PHONE_CONTEXT_ = ';phone-context=';
237 i18n.phonenumbers.PhoneNumberUtil.RFC3966_ISDN_SUBADDRESS_ = ';isub=';
248 i18n.phonenumbers.PhoneNumberUtil.DIGIT_MAPPINGS = {
301 i18n.phonenumbers.PhoneNumberUtil.DIALLABLE_CHAR_MAPPINGS_ = {
312 '+': i18n.phonenumbers.PhoneNumberUtil.PLUS_SIGN,
325 i18n.phonenumbers.PhoneNumberUtil.ALPHA_MAPPINGS_ = {
362 i18n.phonenumbers.PhoneNumberUtil.ALL_NORMALIZATION_MAPPINGS_ = {
441 i18n.phonenumbers.PhoneNumberUtil.ALL_PLUS_NUMBER_GROUPING_SYMBOLS_ = {
536 i18n.phonenumbers.PhoneNumberUtil.SINGLE_INTERNATIONAL_PREFIX_ =
552 i18n.phonenumbers.PhoneNumberUtil.VALID_PUNCTUATION =
565 i18n.phonenumbers.PhoneNumberUtil.VALID_DIGITS_ =
577 i18n.phonenumbers.PhoneNumberUtil.VALID_ALPHA_ = 'A-Za-z';
585 i18n.phonenumbers.PhoneNumberUtil.PLUS_CHARS_ = '+\uFF0B';
592 i18n.phonenumbers.PhoneNumberUtil.PLUS_CHARS_PATTERN =
593 new RegExp('[' + i18n.phonenumbers.PhoneNumberUtil.PLUS_CHARS_ + ']+');
601 i18n.phonenumbers.PhoneNumberUtil.LEADING_PLUS_CHARS_PATTERN =
602 new RegExp('^[' + i18n.phonenumbers.PhoneNumberUtil.PLUS_CHARS_ + ']+');
610 i18n.phonenumbers.PhoneNumberUtil.SEPARATOR_PATTERN_ =
611 '[' + i18n.phonenumbers.PhoneNumberUtil.VALID_PUNCTUATION + ']+';
618 i18n.phonenumbers.PhoneNumberUtil.CAPTURING_DIGIT_PATTERN =
619 new RegExp('([' + i18n.phonenumbers.PhoneNumberUtil.VALID_DIGITS_ + '])');
635 i18n.phonenumbers.PhoneNumberUtil.VALID_START_CHAR_PATTERN_ =
636 new RegExp('[' + i18n.phonenumbers.PhoneNumberUtil.PLUS_CHARS_ +
637 i18n.phonenumbers.PhoneNumberUtil.VALID_DIGITS_ + ']');
652 i18n.phonenumbers.PhoneNumberUtil.SECOND_NUMBER_START_PATTERN_ = /[\\\/] *x/;
664 i18n.phonenumbers.PhoneNumberUtil.UNWANTED_END_CHAR_PATTERN_ =
665 new RegExp('[^' + i18n.phonenumbers.PhoneNumberUtil.VALID_DIGITS_ +
666 i18n.phonenumbers.PhoneNumberUtil.VALID_ALPHA_ + '#]+$');
678 i18n.phonenumbers.PhoneNumberUtil.VALID_ALPHA_PHONE_PATTERN_ =
708 i18n.phonenumbers.PhoneNumberUtil.MIN_LENGTH_PHONE_NUMBER_PATTERN_ =
709 '[' + i18n.phonenumbers.PhoneNumberUtil.VALID_DIGITS_ + ']{' +
710 i18n.phonenumbers.PhoneNumberUtil.MIN_LENGTH_FOR_NSN_ + '}';
720 i18n.phonenumbers.PhoneNumberUtil.VALID_PHONE_NUMBER_ =
721 '[' + i18n.phonenumbers.PhoneNumberUtil.PLUS_CHARS_ + ']*(?:[' +
722 i18n.phonenumbers.PhoneNumberUtil.VALID_PUNCTUATION +
723 i18n.phonenumbers.PhoneNumberUtil.STAR_SIGN_ + ']*[' +
724 i18n.phonenumbers.PhoneNumberUtil.VALID_DIGITS_ + ']){3,}[' +
725 i18n.phonenumbers.PhoneNumberUtil.VALID_PUNCTUATION +
726 i18n.phonenumbers.PhoneNumberUtil.STAR_SIGN_ +
727 i18n.phonenumbers.PhoneNumberUtil.VALID_ALPHA_ +
728 i18n.phonenumbers.PhoneNumberUtil.VALID_DIGITS_ + ']*';
742 i18n.phonenumbers.PhoneNumberUtil.DEFAULT_EXTN_PREFIX_ = ' ext. ';
752 i18n.phonenumbers.PhoneNumberUtil.extnDigits_ =
754 return ('([' + i18n.phonenumbers.PhoneNumberUtil.VALID_DIGITS_ + ']'
765 i18n.phonenumbers.PhoneNumberUtil.createExtnPattern_ =
813 var rfcExtn = i18n.phonenumbers.PhoneNumberUtil.RFC3966_EXTN_PREFIX_
814 + i18n.phonenumbers.PhoneNumberUtil.extnDigits_(extLimitAfterExplicitLabel);
818 + i18n.phonenumbers.PhoneNumberUtil.extnDigits_(extLimitAfterExplicitLabel)
823 + i18n.phonenumbers.PhoneNumberUtil.extnDigits_(extLimitAfterAmbiguousChar)
827 + i18n.phonenumbers.PhoneNumberUtil.extnDigits_(extLimitWhenNotSure) + "#";
832 + i18n.phonenumbers.PhoneNumberUtil.extnDigits_(extLimitAfterLikelyLabel)
837 + i18n.phonenumbers.PhoneNumberUtil.extnDigits_(extLimitAfterAmbiguousChar)
869 i18n.phonenumbers.PhoneNumberUtil.EXTN_PATTERN_ =
871 i18n.phonenumbers.PhoneNumberUtil.createExtnPattern_() +
883 i18n.phonenumbers.PhoneNumberUtil.VALID_PHONE_NUMBER_PATTERN_ =
886 i18n.phonenumbers.PhoneNumberUtil.MIN_LENGTH_PHONE_NUMBER_PATTERN_ +
888 '^' + i18n.phonenumbers.PhoneNumberUtil.VALID_PHONE_NUMBER_ +
889 '(?:' + i18n.phonenumbers.PhoneNumberUtil.createExtnPattern_() +
898 i18n.phonenumbers.PhoneNumberUtil.NON_DIGITS_PATTERN_ = /\D+/;
910 i18n.phonenumbers.PhoneNumberUtil.FIRST_GROUP_PATTERN_ = /(\$\d)/;
918 i18n.phonenumbers.PhoneNumberUtil.NP_PATTERN_ = /\$NP/;
926 i18n.phonenumbers.PhoneNumberUtil.FG_PATTERN_ = /\$FG/;
934 i18n.phonenumbers.PhoneNumberUtil.CC_PATTERN_ = /\$CC/;
945 i18n.phonenumbers.PhoneNumberUtil.FIRST_GROUP_ONLY_PREFIX_PATTERN_ =
953 i18n.phonenumbers.PhoneNumberUtil.REGION_CODE_FOR_NON_GEO_ENTITY = '001';
972 i18n.phonenumbers.PhoneNumberFormat = {
985 i18n.phonenumbers.PhoneNumberType = {
1023 i18n.phonenumbers.PhoneNumberUtil.MatchType = {
1037 i18n.phonenumbers.PhoneNumberUtil.ValidationResult = {
1081 i18n.phonenumbers.PhoneNumberUtil.extractPossibleNumber = function(number) {
1087 .search(i18n.phonenumbers.PhoneNumberUtil.VALID_START_CHAR_PATTERN_);
1092 i18n.phonenumbers.PhoneNumberUtil.UNWANTED_END_CHAR_PATTERN_, '');
1097 .search(i18n.phonenumbers.PhoneNumberUtil.SECOND_NUMBER_START_PATTERN_);
1120 i18n.phonenumbers.PhoneNumberUtil.isViablePhoneNumber = function(number) {
1121 if (number.length < i18n.phonenumbers.PhoneNumberUtil.MIN_LENGTH_FOR_NSN_) {
1124 return i18n.phonenumbers.PhoneNumberUtil.matchesEntirely(
1125 i18n.phonenumbers.PhoneNumberUtil.VALID_PHONE_NUMBER_PATTERN_, number);
1146 i18n.phonenumbers.PhoneNumberUtil.normalize = function(number) {
1147 if (i18n.phonenumbers.PhoneNumberUtil.matchesEntirely(
1148 i18n.phonenumbers.PhoneNumberUtil.VALID_ALPHA_PHONE_PATTERN_, number)) {
1149 return i18n.phonenumbers.PhoneNumberUtil.normalizeHelper_(number,
1150 i18n.phonenumbers.PhoneNumberUtil.ALL_NORMALIZATION_MAPPINGS_, true);
1152 return i18n.phonenumbers.PhoneNumberUtil.normalizeDigitsOnly(number);
1166 i18n.phonenumbers.PhoneNumberUtil.normalizeSB_ = function(number) {
1168 var normalizedNumber = i18n.phonenumbers.PhoneNumberUtil.normalize(number
1183 i18n.phonenumbers.PhoneNumberUtil.normalizeDigitsOnly = function(number) {
1184 return i18n.phonenumbers.PhoneNumberUtil.normalizeHelper_(number,
1185 i18n.phonenumbers.PhoneNumberUtil.DIGIT_MAPPINGS, true);
1197 i18n.phonenumbers.PhoneNumberUtil.normalizeDiallableCharsOnly =
1200 return i18n.phonenumbers.PhoneNumberUtil.normalizeHelper_(number,
1201 i18n.phonenumbers.PhoneNumberUtil.DIALLABLE_CHAR_MAPPINGS_,
1214 i18n.phonenumbers.PhoneNumberUtil.convertAlphaCharactersInNumber =
1217 return i18n.phonenumbers.PhoneNumberUtil.normalizeHelper_(number,
1218 i18n.phonenumbers.PhoneNumberUtil.ALL_NORMALIZATION_MAPPINGS_, false);
1268 i18n.phonenumbers.PhoneNumberUtil.prototype.getLengthOfGeographicalAreaCode =
1331 i18n.phonenumbers.PhoneNumberUtil.prototype.getLengthOfNationalDestinationCode =
1348 i18n.phonenumbers.PhoneNumberFormat.INTERNATIONAL);
1351 i18n.phonenumbers.PhoneNumberUtil.NON_DIGITS_PATTERN_);
1366 if (this.getNumberType(number) == i18n.phonenumbers.PhoneNumberType.MOBILE) {
1374 var mobileToken = i18n.phonenumbers.PhoneNumberUtil.getCountryMobileToken(
1394 i18n.phonenumbers.PhoneNumberUtil.getCountryMobileToken =
1396 return i18n.phonenumbers.PhoneNumberUtil.MOBILE_TOKEN_MAPPINGS_[
1407 i18n.phonenumbers.PhoneNumberUtil.prototype.getSupportedRegions = function() {
1408 return Object.keys(i18n.phonenumbers.metadata.countryToMetadata)
1421 i18n.phonenumbers.PhoneNumberUtil.prototype
1424 Object.keys(i18n.phonenumbers.metadata.countryToMetadata)
1443 i18n.phonenumbers.PhoneNumberUtil.prototype.getSupportedCallingCodes =
1446 Object.keys(i18n.phonenumbers.metadata.countryCodeToRegionCodeMap);
1464 i18n.phonenumbers.PhoneNumberUtil.descHasPossibleNumberData_ = function(desc) {
1479 i18n.phonenumbers.PhoneNumberUtil.descHasData_ = function(desc) {
1486 i18n.phonenumbers.PhoneNumberUtil.descHasPossibleNumberData_(desc) ||
1500 i18n.phonenumbers.PhoneNumberUtil.getSupportedTypesForMetadata_ =
1504 goog.object.forEach(i18n.phonenumbers.PhoneNumberType,
1506 if (type == i18n.phonenumbers.PhoneNumberType.FIXED_LINE_OR_MOBILE ||
1507 type == i18n.phonenumbers.PhoneNumberType.UNKNOWN) {
1514 var desc = i18n.phonenumbers.PhoneNumberUtil.getNumberDescByType_(
1516 if (i18n.phonenumbers.PhoneNumberUtil.descHasData_(desc)) {
1536 i18n.phonenumbers.PhoneNumberUtil.prototype.getSupportedTypesForRegion =
1541 return i18n.phonenumbers.PhoneNumberUtil.getSupportedTypesForMetadata_(
1561 i18n.phonenumbers.PhoneNumberUtil.prototype.getSupportedTypesForNonGeoEntity =
1568 return i18n.phonenumbers.PhoneNumberUtil.getSupportedTypesForMetadata_(
1588 i18n.phonenumbers.PhoneNumberUtil.normalizeHelper_ =
1622 i18n.phonenumbers.PhoneNumberUtil.prototype.formattingRuleHasFirstGroupOnly =
1625 i18n.phonenumbers.PhoneNumberUtil.FIRST_GROUP_ONLY_PREFIX_PATTERN_.
1638 i18n.phonenumbers.PhoneNumberUtil.prototype.isNumberGeographical =
1643 return numberType == i18n.phonenumbers.PhoneNumberType.FIXED_LINE ||
1644 numberType == i18n.phonenumbers.PhoneNumberType.FIXED_LINE_OR_MOBILE ||
1645 (i18n.phonenumbers.PhoneNumberUtil.GEO_MOBILE_COUNTRIES_.includes(
1647 numberType == i18n.phonenumbers.PhoneNumberType.MOBILE);
1658 i18n.phonenumbers.PhoneNumberUtil.prototype.isValidRegionCode_ =
1671 regionCode.toUpperCase() in i18n.phonenumbers.metadata.countryToMetadata;
1682 i18n.phonenumbers.PhoneNumberUtil.prototype.hasValidCountryCallingCode_ =
1686 i18n.phonenumbers.metadata.countryCodeToRegionCodeMap;
1707 i18n.phonenumbers.PhoneNumberUtil.prototype.format =
1726 if (numberFormat == i18n.phonenumbers.PhoneNumberFormat.E164) {
1731 countryCallingCode, i18n.phonenumbers.PhoneNumberFormat.E164,
1779 i18n.phonenumbers.PhoneNumberUtil.prototype.formatByPattern =
1824 .replace(i18n.phonenumbers.PhoneNumberUtil.NP_PATTERN_,
1826 .replace(i18n.phonenumbers.PhoneNumberUtil.FG_PATTERN_, '$1');
1862 i18n.phonenumbers.PhoneNumberUtil.prototype.
1885 number, metadata, i18n.phonenumbers.PhoneNumberFormat.NATIONAL);
1889 i18n.phonenumbers.PhoneNumberFormat.NATIONAL, carrierCode);
1891 countryCallingCode, i18n.phonenumbers.PhoneNumberFormat.NATIONAL,
1902 i18n.phonenumbers.PhoneNumberUtil.prototype.getMetadataForRegionOrCallingCode_ =
1904 return i18n.phonenumbers.PhoneNumberUtil.REGION_CODE_FOR_NON_GEO_ENTITY ==
1931 i18n.phonenumbers.PhoneNumberUtil.prototype.
1959 i18n.phonenumbers.PhoneNumberUtil.prototype.formatNumberForMobileDialing =
1980 var isValidNumber = (numberType != i18n.phonenumbers.PhoneNumberType.UNKNOWN);
1984 (numberType == i18n.phonenumbers.PhoneNumberType.FIXED_LINE) ||
1985 (numberType == i18n.phonenumbers.PhoneNumberType.MOBILE) ||
1986 (numberType == i18n.phonenumbers.PhoneNumberType.FIXED_LINE_OR_MOBILE);
1989 numberType == i18n.phonenumbers.PhoneNumberType.FIXED_LINE) {
1992 i18n.phonenumbers.PhoneNumberUtil
2008 i18n.phonenumbers.PhoneNumberUtil.NANPA_COUNTRY_CODE_) {
2018 i18n.phonenumbers.PhoneNumberUtil.ValidationResult.TOO_SHORT) {
2020 numberNoExt, i18n.phonenumbers.PhoneNumberFormat.INTERNATIONAL);
2023 numberNoExt, i18n.phonenumbers.PhoneNumberFormat.NATIONAL);
2030 i18n.phonenumbers.PhoneNumberUtil.REGION_CODE_FOR_NON_GEO_ENTITY ||
2052 numberNoExt, i18n.phonenumbers.PhoneNumberFormat.INTERNATIONAL);
2055 numberNoExt, i18n.phonenumbers.PhoneNumberFormat.NATIONAL);
2064 i18n.phonenumbers.PhoneNumberFormat.INTERNATIONAL) :
2065 this.format(numberNoExt, i18n.phonenumbers.PhoneNumberFormat.E164);
2069 i18n.phonenumbers.PhoneNumberUtil.normalizeDiallableCharsOnly(
2095 i18n.phonenumbers.PhoneNumberUtil.prototype.formatOutOfCountryCallingNumber =
2100 i18n.phonenumbers.PhoneNumberFormat.INTERNATIONAL);
2110 i18n.phonenumbers.PhoneNumberUtil.NANPA_COUNTRY_CODE_) {
2115 this.format(number, i18n.phonenumbers.PhoneNumberFormat.NATIONAL);
2128 i18n.phonenumbers.PhoneNumberFormat.NATIONAL);
2146 } else if (i18n.phonenumbers.PhoneNumberUtil.matchesEntirely(
2147 i18n.phonenumbers.PhoneNumberUtil.SINGLE_INTERNATIONAL_PREFIX_,
2161 i18n.phonenumbers.PhoneNumberFormat.INTERNATIONAL);
2164 metadataForRegion, i18n.phonenumbers.PhoneNumberFormat.INTERNATIONAL);
2169 countryCallingCode, i18n.phonenumbers.PhoneNumberFormat.INTERNATIONAL,
2192 i18n.phonenumbers.PhoneNumberUtil.prototype.formatInOriginalFormat =
2201 return this.format(number, i18n.phonenumbers.PhoneNumberFormat.NATIONAL);
2206 case i18n.phonenumbers.PhoneNumber.CountryCodeSource
2209 i18n.phonenumbers.PhoneNumberFormat.INTERNATIONAL);
2211 case i18n.phonenumbers.PhoneNumber.CountryCodeSource.FROM_NUMBER_WITH_IDD:
2215 case i18n.phonenumbers.PhoneNumber.CountryCodeSource
2218 i18n.phonenumbers.PhoneNumberFormat.INTERNATIONAL).substring(1);
2220 case i18n.phonenumbers.PhoneNumber.CountryCodeSource.FROM_DEFAULT_COUNTRY:
2232 this.format(number, i18n.phonenumbers.PhoneNumberFormat.NATIONAL);
2282 candidateNationalPrefixRule = i18n.phonenumbers.PhoneNumberUtil
2294 i18n.phonenumbers.PhoneNumberFormat.NATIONAL, [numFormatCopy]);
2305 i18n.phonenumbers.PhoneNumberUtil.normalizeDiallableCharsOnly(
2309 i18n.phonenumbers.PhoneNumberUtil.normalizeDiallableCharsOnly(rawInput);
2327 i18n.phonenumbers.PhoneNumberUtil.prototype.rawInputContainsNationalPrefix_ =
2332 i18n.phonenumbers.PhoneNumberUtil.normalizeDigitsOnly(rawInput);
2356 i18n.phonenumbers.PhoneNumberUtil.prototype.hasFormattingPatternForNumber_ =
2404 i18n.phonenumbers.PhoneNumberUtil.prototype.
2422 rawInput = i18n.phonenumbers.PhoneNumberUtil.normalizeHelper_(
2424 i18n.phonenumbers.PhoneNumberUtil.ALL_PLUS_NUMBER_GROUPING_SYMBOLS_,
2443 if (countryCode == i18n.phonenumbers.PhoneNumberUtil.NANPA_COUNTRY_CODE_) {
2471 i18n.phonenumbers.PhoneNumberFormat.NATIONAL);
2483 i18n.phonenumbers.PhoneNumberUtil.matchesEntirely(
2484 i18n.phonenumbers.PhoneNumberUtil.SINGLE_INTERNATIONAL_PREFIX_,
2498 i18n.phonenumbers.PhoneNumberFormat.INTERNATIONAL);
2507 countryCode, i18n.phonenumbers.PhoneNumberFormat.INTERNATIONAL,
2522 i18n.phonenumbers.PhoneNumberUtil.prototype.getNationalSignificantNumber =
2555 i18n.phonenumbers.PhoneNumberUtil.prototype.
2562 case i18n.phonenumbers.PhoneNumberFormat.E164:
2563 return i18n.phonenumbers.PhoneNumberUtil.PLUS_SIGN + countryCallingCode +
2565 case i18n.phonenumbers.PhoneNumberFormat.INTERNATIONAL:
2566 return i18n.phonenumbers.PhoneNumberUtil.PLUS_SIGN + countryCallingCode +
2568 case i18n.phonenumbers.PhoneNumberFormat.RFC3966:
2569 return i18n.phonenumbers.PhoneNumberUtil.RFC3966_PREFIX_ +
2570 i18n.phonenumbers.PhoneNumberUtil.PLUS_SIGN + countryCallingCode +
2572 case i18n.phonenumbers.PhoneNumberFormat.NATIONAL:
2595 i18n.phonenumbers.PhoneNumberUtil.prototype.formatNsn_ =
2605 numberFormat == i18n.phonenumbers.PhoneNumberFormat.NATIONAL) ?
2625 i18n.phonenumbers.PhoneNumberUtil.prototype.chooseFormattingPatternForNumber_ =
2643 if (i18n.phonenumbers.PhoneNumberUtil.matchesEntirely(patternToMatch,
2667 i18n.phonenumbers.PhoneNumberUtil.prototype.formatNsnUsingPattern_ =
2679 if (numberFormat == i18n.phonenumbers.PhoneNumberFormat.NATIONAL &&
2685 .replace(i18n.phonenumbers.PhoneNumberUtil.CC_PATTERN_,
2690 i18n.phonenumbers.PhoneNumberUtil.FIRST_GROUP_PATTERN_,
2699 if (numberFormat == i18n.phonenumbers.PhoneNumberFormat.NATIONAL &&
2704 i18n.phonenumbers.PhoneNumberUtil.FIRST_GROUP_PATTERN_,
2711 if (numberFormat == i18n.phonenumbers.PhoneNumberFormat.RFC3966) {
2714 new RegExp('^' + i18n.phonenumbers.PhoneNumberUtil.SEPARATOR_PATTERN_),
2718 new RegExp(i18n.phonenumbers.PhoneNumberUtil.SEPARATOR_PATTERN_, 'g'),
2735 i18n.phonenumbers.PhoneNumberUtil.prototype.getExampleNumber =
2739 i18n.phonenumbers.PhoneNumberType.FIXED_LINE);
2755 i18n.phonenumbers.PhoneNumberUtil.prototype.getExampleNumberForType =
2763 var desc = i18n.phonenumbers.PhoneNumberUtil.getNumberDescByType_(
2786 i18n.phonenumbers.PhoneNumberUtil.prototype.getExampleNumberForNonGeoEntity =
2825 i18n.phonenumbers.PhoneNumberUtil.prototype.maybeGetFormattedExtension_ =
2831 if (numberFormat == i18n.phonenumbers.PhoneNumberFormat.RFC3966) {
2832 return i18n.phonenumbers.PhoneNumberUtil.RFC3966_EXTN_PREFIX_ +
2839 return i18n.phonenumbers.PhoneNumberUtil.DEFAULT_EXTN_PREFIX_ +
2853 i18n.phonenumbers.PhoneNumberUtil.getNumberDescByType_ =
2857 case i18n.phonenumbers.PhoneNumberType.PREMIUM_RATE:
2859 case i18n.phonenumbers.PhoneNumberType.TOLL_FREE:
2861 case i18n.phonenumbers.PhoneNumberType.MOBILE:
2863 case i18n.phonenumbers.PhoneNumberType.FIXED_LINE:
2864 case i18n.phonenumbers.PhoneNumberType.FIXED_LINE_OR_MOBILE:
2866 case i18n.phonenumbers.PhoneNumberType.SHARED_COST:
2868 case i18n.phonenumbers.PhoneNumberType.VOIP:
2870 case i18n.phonenumbers.PhoneNumberType.PERSONAL_NUMBER:
2872 case i18n.phonenumbers.PhoneNumberType.PAGER:
2874 case i18n.phonenumbers.PhoneNumberType.UAN:
2876 case i18n.phonenumbers.PhoneNumberType.VOICEMAIL:
2892 i18n.phonenumbers.PhoneNumberUtil.prototype.getNumberType =
2901 return i18n.phonenumbers.PhoneNumberType.UNKNOWN;
2915 i18n.phonenumbers.PhoneNumberUtil.prototype.getNumberTypeHelper_ =
2919 return i18n.phonenumbers.PhoneNumberType.UNKNOWN;
2923 return i18n.phonenumbers.PhoneNumberType.PREMIUM_RATE;
2926 return i18n.phonenumbers.PhoneNumberType.TOLL_FREE;
2929 return i18n.phonenumbers.PhoneNumberType.SHARED_COST;
2932 return i18n.phonenumbers.PhoneNumberType.VOIP;
2936 return i18n.phonenumbers.PhoneNumberType.PERSONAL_NUMBER;
2939 return i18n.phonenumbers.PhoneNumberType.PAGER;
2942 return i18n.phonenumbers.PhoneNumberType.UAN;
2945 return i18n.phonenumbers.PhoneNumberType.VOICEMAIL;
2953 return i18n.phonenumbers.PhoneNumberType.FIXED_LINE_OR_MOBILE;
2956 return i18n.phonenumbers.PhoneNumberType.FIXED_LINE_OR_MOBILE;
2958 return i18n.phonenumbers.PhoneNumberType.FIXED_LINE;
2964 return i18n.phonenumbers.PhoneNumberType.MOBILE;
2966 return i18n.phonenumbers.PhoneNumberType.UNKNOWN;
2977 i18n.phonenumbers.PhoneNumberUtil.prototype.getMetadataForRegion =
2991 i18n.phonenumbers.metadata.countryToMetadata[regionCode];
2996 serializer.deserialize(i18n.phonenumbers.PhoneMetadata.getDescriptor(),
3008 i18n.phonenumbers.PhoneNumberUtil.prototype.
3021 i18n.phonenumbers.PhoneNumberUtil.prototype.isNumberMatchingDesc_ =
3032 return i18n.phonenumbers.PhoneNumberUtil.matchesEntirely(
3053 i18n.phonenumbers.PhoneNumberUtil.prototype.isValidNumber = function(number) {
3080 i18n.phonenumbers.PhoneNumberUtil.prototype.isValidNumberForRegion =
3089 (i18n.phonenumbers.PhoneNumberUtil.REGION_CODE_FOR_NON_GEO_ENTITY !=
3100 i18n.phonenumbers.PhoneNumberType.UNKNOWN;
3114 i18n.phonenumbers.PhoneNumberUtil.prototype.getRegionCodeForNumber =
3124 i18n.phonenumbers.metadata.countryCodeToRegionCodeMap[countryCode];
3142 i18n.phonenumbers.PhoneNumberUtil.prototype.
3163 i18n.phonenumbers.PhoneNumberType.UNKNOWN) {
3180 i18n.phonenumbers.PhoneNumberUtil.prototype.getRegionCodeForCountryCode =
3185 i18n.phonenumbers.metadata.countryCodeToRegionCodeMap[countryCallingCode];
3187 i18n.phonenumbers.PhoneNumberUtil.UNKNOWN_REGION_ : regionCodes[0];
3200 i18n.phonenumbers.PhoneNumberUtil.prototype.getRegionCodesForCountryCode =
3205 i18n.phonenumbers.metadata.countryCodeToRegionCodeMap[countryCallingCode];
3219 i18n.phonenumbers.PhoneNumberUtil.prototype.getCountryCodeForRegion =
3241 i18n.phonenumbers.PhoneNumberUtil.prototype.getCountryCodeForValidRegion_ =
3272 i18n.phonenumbers.PhoneNumberUtil.prototype.getNddPrefixForRegion = function(
3301 i18n.phonenumbers.PhoneNumberUtil.prototype.isNANPACountry = function(
3304 i18n.phonenumbers.metadata
3305 .countryCodeToRegionCodeMap[i18n.phonenumbers.PhoneNumberUtil
3322 i18n.phonenumbers.PhoneNumberUtil.prototype.isAlphaNumber = function(number) {
3323 if (!i18n.phonenumbers.PhoneNumberUtil.isViablePhoneNumber(number)) {
3330 return i18n.phonenumbers.PhoneNumberUtil.matchesEntirely(
3331 i18n.phonenumbers.PhoneNumberUtil.VALID_ALPHA_PHONE_PATTERN_,
3350 i18n.phonenumbers.PhoneNumberUtil.prototype.isPossibleNumber =
3355 i18n.phonenumbers.PhoneNumberUtil.ValidationResult.IS_POSSIBLE ||
3357 i18n.phonenumbers.PhoneNumberUtil.ValidationResult.IS_POSSIBLE_LOCAL_ONLY;
3376 i18n.phonenumbers.PhoneNumberUtil.prototype.isPossibleNumberForType =
3381 i18n.phonenumbers.PhoneNumberUtil.ValidationResult.IS_POSSIBLE ||
3383 i18n.phonenumbers.PhoneNumberUtil.ValidationResult.IS_POSSIBLE_LOCAL_ONLY;
3397 i18n.phonenumbers.PhoneNumberUtil.prototype.testNumberLength_ =
3400 number, metadata, i18n.phonenumbers.PhoneNumberType.UNKNOWN);
3414 i18n.phonenumbers.PhoneNumberUtil.prototype.testNumberLengthForType_ =
3417 i18n.phonenumbers.PhoneNumberUtil.getNumberDescByType_(metadata, type);
3431 if (type == i18n.phonenumbers.PhoneNumberType.FIXED_LINE_OR_MOBILE) {
3432 if (!i18n.phonenumbers.PhoneNumberUtil.descHasPossibleNumberData_(
3433 i18n.phonenumbers.PhoneNumberUtil.getNumberDescByType_(
3434 metadata, i18n.phonenumbers.PhoneNumberType.FIXED_LINE))) {
3439 number, metadata, i18n.phonenumbers.PhoneNumberType.MOBILE);
3441 var mobileDesc = i18n.phonenumbers.PhoneNumberUtil.getNumberDescByType_(
3442 metadata, i18n.phonenumbers.PhoneNumberType.MOBILE);
3443 if (i18n.phonenumbers.PhoneNumberUtil.descHasPossibleNumberData_(
3474 return i18n.phonenumbers.PhoneNumberUtil.ValidationResult.INVALID_LENGTH;
3481 return i18n.phonenumbers.PhoneNumberUtil.ValidationResult
3486 return i18n.phonenumbers.PhoneNumberUtil.ValidationResult.IS_POSSIBLE;
3488 return i18n.phonenumbers.PhoneNumberUtil.ValidationResult.TOO_SHORT;
3490 return i18n.phonenumbers.PhoneNumberUtil.ValidationResult.TOO_LONG;
3494 i18n.phonenumbers.PhoneNumberUtil.ValidationResult.IS_POSSIBLE :
3495 i18n.phonenumbers.PhoneNumberUtil.ValidationResult.INVALID_LENGTH;
3524 i18n.phonenumbers.PhoneNumberUtil.prototype.isPossibleNumberWithReason =
3527 number, i18n.phonenumbers.PhoneNumberType.UNKNOWN);
3554 i18n.phonenumbers.PhoneNumberUtil.prototype.isPossibleNumberForTypeWithReason =
3570 return i18n.phonenumbers.PhoneNumberUtil.ValidationResult
3606 i18n.phonenumbers.PhoneNumberUtil.prototype.isPossibleNumberString =
3626 i18n.phonenumbers.PhoneNumberUtil.prototype.truncateTooLongNumber =
3641 i18n.phonenumbers.PhoneNumberUtil.ValidationResult.TOO_SHORT) {
3660 i18n.phonenumbers.PhoneNumberUtil.prototype.extractCountryCode =
3674 i <= i18n.phonenumbers.PhoneNumberUtil.MAX_LENGTH_COUNTRY_CODE_ &&
3678 i18n.phonenumbers.metadata.countryCodeToRegionCodeMap) {
3727 i18n.phonenumbers.PhoneNumberUtil.prototype.maybeExtractCountryCode =
3753 i18n.phonenumbers.PhoneNumber.CountryCodeSource.FROM_DEFAULT_COUNTRY) {
3755 i18n.phonenumbers.PhoneNumberUtil.MIN_LENGTH_FOR_NSN_) {
3756 throw new Error(i18n.phonenumbers.Error.TOO_SHORT_AFTER_IDD);
3768 throw new Error(i18n.phonenumbers.Error.INVALID_COUNTRY_CODE);
3796 if ((!i18n.phonenumbers.PhoneNumberUtil.matchesEntirely(
3798 i18n.phonenumbers.PhoneNumberUtil.matchesEntirely(
3802 i18n.phonenumbers.PhoneNumberUtil.ValidationResult.TOO_LONG) {
3806 i18n.phonenumbers.PhoneNumber.CountryCodeSource
3831 i18n.phonenumbers.PhoneNumberUtil.prototype.parsePrefixAsIdd_ =
3841 i18n.phonenumbers.PhoneNumberUtil.CAPTURING_DIGIT_PATTERN);
3846 i18n.phonenumbers.PhoneNumberUtil.normalizeDigitsOnly(
3874 i18n.phonenumbers.PhoneNumberUtil.prototype.
3880 return i18n.phonenumbers.PhoneNumber.CountryCodeSource.FROM_DEFAULT_COUNTRY;
3883 if (i18n.phonenumbers.PhoneNumberUtil.LEADING_PLUS_CHARS_PATTERN
3886 i18n.phonenumbers.PhoneNumberUtil.LEADING_PLUS_CHARS_PATTERN, '');
3890 number.append(i18n.phonenumbers.PhoneNumberUtil.normalize(numberStr));
3891 return i18n.phonenumbers.PhoneNumber.CountryCodeSource
3897 i18n.phonenumbers.PhoneNumberUtil.normalizeSB_(number);
3899 i18n.phonenumbers.PhoneNumber.CountryCodeSource.FROM_NUMBER_WITH_IDD :
3900 i18n.phonenumbers.PhoneNumber.CountryCodeSource.FROM_DEFAULT_COUNTRY;
3916 i18n.phonenumbers.PhoneNumberUtil.prototype.
3942 i18n.phonenumbers.PhoneNumberUtil.matchesEntirely(
3959 !i18n.phonenumbers.PhoneNumberUtil.matchesEntirely(
3978 !i18n.phonenumbers.PhoneNumberUtil.matchesEntirely(
4002 i18n.phonenumbers.PhoneNumberUtil.prototype.maybeStripExtension =
4009 numberStr.search(i18n.phonenumbers.PhoneNumberUtil.EXTN_PATTERN_);
4012 if (mStart >= 0 && i18n.phonenumbers.PhoneNumberUtil.isViablePhoneNumber(
4017 numberStr.match(i18n.phonenumbers.PhoneNumberUtil.EXTN_PATTERN_);
4045 i18n.phonenumbers.PhoneNumberUtil.prototype.checkRegionForParsing_ = function(
4050 i18n.phonenumbers.PhoneNumberUtil.LEADING_PLUS_CHARS_PATTERN.test(
4093 i18n.phonenumbers.PhoneNumberUtil.prototype.parse = function(numberToParse,
4116 i18n.phonenumbers.PhoneNumberUtil.prototype.parseAndKeepRawInput =
4121 i18n.phonenumbers.PhoneNumberUtil.PLUS_SIGN) {
4122 throw new Error(i18n.phonenumbers.Error.INVALID_COUNTRY_CODE);
4138 i18n.phonenumbers.PhoneNumberUtil.setItalianLeadingZerosForPhoneNumber_ =
4181 i18n.phonenumbers.PhoneNumberUtil.prototype.parseHelper_ =
4185 throw new Error(i18n.phonenumbers.Error.NOT_A_NUMBER);
4187 i18n.phonenumbers.PhoneNumberUtil.MAX_INPUT_STRING_LENGTH_) {
4188 throw new Error(i18n.phonenumbers.Error.TOO_LONG);
4195 if (!i18n.phonenumbers.PhoneNumberUtil.isViablePhoneNumber(
4197 throw new Error(i18n.phonenumbers.Error.NOT_A_NUMBER);
4204 throw new Error(i18n.phonenumbers.Error.INVALID_COUNTRY_CODE);
4208 var phoneNumber = new i18n.phonenumbers.PhoneNumber();
4234 if (e.message == i18n.phonenumbers.Error.INVALID_COUNTRY_CODE &&
4235 i18n.phonenumbers.PhoneNumberUtil.LEADING_PLUS_CHARS_PATTERN
4239 i18n.phonenumbers.PhoneNumberUtil.LEADING_PLUS_CHARS_PATTERN, '');
4261 i18n.phonenumbers.PhoneNumberUtil.normalizeSB_(nationalNumber);
4271 i18n.phonenumbers.PhoneNumberUtil.MIN_LENGTH_FOR_NSN_) {
4272 throw new Error(i18n.phonenumbers.Error.TOO_SHORT_NSN);
4289 var validationResults = i18n.phonenumbers.PhoneNumberUtil.ValidationResult;
4304 i18n.phonenumbers.PhoneNumberUtil.MIN_LENGTH_FOR_NSN_) {
4305 throw new Error(i18n.phonenumbers.Error.TOO_SHORT_NSN);
4308 i18n.phonenumbers.PhoneNumberUtil.MAX_LENGTH_FOR_NSN_) {
4309 throw new Error(i18n.phonenumbers.Error.TOO_LONG);
4311 i18n.phonenumbers.PhoneNumberUtil.setItalianLeadingZerosForPhoneNumber_(
4330 i18n.phonenumbers.PhoneNumberUtil.prototype.buildNationalNumberForParsing_ =
4335 i18n.phonenumbers.PhoneNumberUtil.RFC3966_PHONE_CONTEXT_);
4338 i18n.phonenumbers.PhoneNumberUtil.RFC3966_PHONE_CONTEXT_.length;
4344 i18n.phonenumbers.PhoneNumberUtil.PLUS_SIGN) {
4363 i18n.phonenumbers.PhoneNumberUtil.RFC3966_PREFIX_);
4366 i18n.phonenumbers.PhoneNumberUtil.RFC3966_PREFIX_.length : 0;
4373 i18n.phonenumbers.PhoneNumberUtil.extractPossibleNumber(numberToParse));
4382 i18n.phonenumbers.PhoneNumberUtil.RFC3966_ISDN_SUBADDRESS_);
4407 i18n.phonenumbers.PhoneNumberUtil.copyCoreFieldsOnly_ = function(numberIn) {
4409 var phoneNumber = new i18n.phonenumbers.PhoneNumber();
4448 i18n.phonenumbers.PhoneNumberUtil.prototype.isNumberMatch =
4463 firstNumberIn, i18n.phonenumbers.PhoneNumberUtil.UNKNOWN_REGION_);
4465 if (e.message != i18n.phonenumbers.Error.INVALID_COUNTRY_CODE) {
4466 return i18n.phonenumbers.PhoneNumberUtil.MatchType.NOT_A_NUMBER;
4477 i18n.phonenumbers.PhoneNumberUtil.UNKNOWN_REGION_) {
4481 return i18n.phonenumbers.PhoneNumberUtil.MatchType.NOT_A_NUMBER;
4486 i18n.phonenumbers.PhoneNumberUtil.MatchType.EXACT_MATCH) {
4487 return i18n.phonenumbers.PhoneNumberUtil.MatchType.NSN_MATCH;
4497 return i18n.phonenumbers.PhoneNumberUtil.MatchType.NOT_A_NUMBER;
4506 secondNumberIn, i18n.phonenumbers.PhoneNumberUtil.UNKNOWN_REGION_);
4509 if (e.message != i18n.phonenumbers.Error.INVALID_COUNTRY_CODE) {
4510 return i18n.phonenumbers.PhoneNumberUtil.MatchType.NOT_A_NUMBER;
4518 i18n.phonenumbers.PhoneNumberUtil.copyCoreFieldsOnly_(firstNumber);
4520 i18n.phonenumbers.PhoneNumberUtil.copyCoreFieldsOnly_(secondNumber);
4527 return i18n.phonenumbers.PhoneNumberUtil.MatchType.NO_MATCH;
4536 return i18n.phonenumbers.PhoneNumberUtil.MatchType.EXACT_MATCH;
4544 return i18n.phonenumbers.PhoneNumberUtil.MatchType.SHORT_NSN_MATCH;
4547 return i18n.phonenumbers.PhoneNumberUtil.MatchType.NO_MATCH;
4556 return i18n.phonenumbers.PhoneNumberUtil.MatchType.NSN_MATCH;
4560 return i18n.phonenumbers.PhoneNumberUtil.MatchType.SHORT_NSN_MATCH;
4562 return i18n.phonenumbers.PhoneNumberUtil.MatchType.NO_MATCH;
4577 i18n.phonenumbers.PhoneNumberUtil.prototype.isNationalNumberSuffixOfTheOther_ =
4604 i18n.phonenumbers.PhoneNumberUtil.prototype.canBeInternationallyDialled =
4629 i18n.phonenumbers.PhoneNumberUtil.matchesEntirely = function(regex, str) {
4650 i18n.phonenumbers.PhoneNumberUtil.matchesPrefix = function(regex, str) {