@ticketmaster/tm-global-address 0.3.0 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (70) hide show
  1. package/dist/components/AddressForm/AddressForm.js +174 -192
  2. package/dist/data/countries.d.ts +18 -0
  3. package/dist/data/countries.js +261 -0
  4. package/dist/data/countryConfig.d.ts +9 -0
  5. package/dist/data/countryConfig.js +87 -0
  6. package/dist/data/countryData.d.ts +7 -9
  7. package/dist/data/countryData.js +25 -542
  8. package/dist/data/index.d.ts +22 -0
  9. package/dist/data/postalPatterns.d.ts +22 -0
  10. package/dist/data/postalPatterns.js +183 -0
  11. package/dist/data/states.d.ts +15 -0
  12. package/dist/data/states.js +1405 -0
  13. package/dist/index.d.ts +12 -1
  14. package/dist/index.js +38 -15
  15. package/dist/node_modules/.pnpm/libphonenumber-js@1.12.41/node_modules/libphonenumber-js/es6/ParseError.js +89 -0
  16. package/dist/node_modules/.pnpm/libphonenumber-js@1.12.41/node_modules/libphonenumber-js/es6/PhoneNumber.js +188 -0
  17. package/dist/node_modules/.pnpm/libphonenumber-js@1.12.41/node_modules/libphonenumber-js/es6/constants.js +10 -0
  18. package/dist/node_modules/.pnpm/libphonenumber-js@1.12.41/node_modules/libphonenumber-js/es6/format.js +92 -0
  19. package/dist/node_modules/.pnpm/libphonenumber-js@1.12.41/node_modules/libphonenumber-js/es6/helpers/RFC3966.js +11 -0
  20. package/dist/node_modules/.pnpm/libphonenumber-js@1.12.41/node_modules/libphonenumber-js/es6/helpers/applyInternationalSeparatorStyle.js +7 -0
  21. package/dist/node_modules/.pnpm/libphonenumber-js@1.12.41/node_modules/libphonenumber-js/es6/helpers/checkNumberLength.js +16 -0
  22. package/dist/node_modules/.pnpm/libphonenumber-js@1.12.41/node_modules/libphonenumber-js/es6/helpers/extension/createExtensionPattern.js +11 -0
  23. package/dist/node_modules/.pnpm/libphonenumber-js@1.12.41/node_modules/libphonenumber-js/es6/helpers/extension/extractExtension.js +18 -0
  24. package/dist/node_modules/.pnpm/libphonenumber-js@1.12.41/node_modules/libphonenumber-js/es6/helpers/extractCountryCallingCode.js +47 -0
  25. package/dist/node_modules/.pnpm/libphonenumber-js@1.12.41/node_modules/libphonenumber-js/es6/helpers/extractCountryCallingCodeFromInternationalNumberWithoutPlusSign.js +22 -0
  26. package/dist/node_modules/.pnpm/libphonenumber-js@1.12.41/node_modules/libphonenumber-js/es6/helpers/extractFormattedPhoneNumberFromPossibleRfc3966NumberUri.js +23 -0
  27. package/dist/node_modules/.pnpm/libphonenumber-js@1.12.41/node_modules/libphonenumber-js/es6/helpers/extractNationalNumber.js +39 -0
  28. package/dist/node_modules/.pnpm/libphonenumber-js@1.12.41/node_modules/libphonenumber-js/es6/helpers/extractNationalNumberFromPossiblyIncompleteNumber.js +31 -0
  29. package/dist/node_modules/.pnpm/libphonenumber-js@1.12.41/node_modules/libphonenumber-js/es6/helpers/extractPhoneContext.js +23 -0
  30. package/dist/node_modules/.pnpm/libphonenumber-js@1.12.41/node_modules/libphonenumber-js/es6/helpers/formatNationalNumberUsingFormat.js +25 -0
  31. package/dist/node_modules/.pnpm/libphonenumber-js@1.12.41/node_modules/libphonenumber-js/es6/helpers/getCountryByCallingCode.js +12 -0
  32. package/dist/node_modules/.pnpm/libphonenumber-js@1.12.41/node_modules/libphonenumber-js/es6/helpers/getCountryByNationalNumber.js +45 -0
  33. package/dist/node_modules/.pnpm/libphonenumber-js@1.12.41/node_modules/libphonenumber-js/es6/helpers/getIddPrefix.js +12 -0
  34. package/dist/node_modules/.pnpm/libphonenumber-js@1.12.41/node_modules/libphonenumber-js/es6/helpers/getNumberType.js +51 -0
  35. package/dist/node_modules/.pnpm/libphonenumber-js@1.12.41/node_modules/libphonenumber-js/es6/helpers/getPossibleCountriesForNumber.js +14 -0
  36. package/dist/node_modules/.pnpm/libphonenumber-js@1.12.41/node_modules/libphonenumber-js/es6/helpers/isObject.js +7 -0
  37. package/dist/node_modules/.pnpm/libphonenumber-js@1.12.41/node_modules/libphonenumber-js/es6/helpers/isViablePhoneNumber.js +20 -0
  38. package/dist/node_modules/.pnpm/libphonenumber-js@1.12.41/node_modules/libphonenumber-js/es6/helpers/matchesEntirely.js +6 -0
  39. package/dist/node_modules/.pnpm/libphonenumber-js@1.12.41/node_modules/libphonenumber-js/es6/helpers/parseDigits.js +79 -0
  40. package/dist/node_modules/.pnpm/libphonenumber-js@1.12.41/node_modules/libphonenumber-js/es6/helpers/stripIddPrefix.js +19 -0
  41. package/dist/node_modules/.pnpm/libphonenumber-js@1.12.41/node_modules/libphonenumber-js/es6/isPossible.js +38 -0
  42. package/dist/node_modules/.pnpm/libphonenumber-js@1.12.41/node_modules/libphonenumber-js/es6/isValid.js +12 -0
  43. package/dist/node_modules/.pnpm/libphonenumber-js@1.12.41/node_modules/libphonenumber-js/es6/metadata.js +473 -0
  44. package/dist/node_modules/.pnpm/libphonenumber-js@1.12.41/node_modules/libphonenumber-js/es6/normalizeArguments.js +108 -0
  45. package/dist/node_modules/.pnpm/libphonenumber-js@1.12.41/node_modules/libphonenumber-js/es6/parse.js +119 -0
  46. package/dist/node_modules/.pnpm/libphonenumber-js@1.12.41/node_modules/libphonenumber-js/es6/parseIncompletePhoneNumber.js +40 -0
  47. package/dist/node_modules/.pnpm/libphonenumber-js@1.12.41/node_modules/libphonenumber-js/es6/parsePhoneNumber.js +9 -0
  48. package/dist/node_modules/.pnpm/libphonenumber-js@1.12.41/node_modules/libphonenumber-js/es6/parsePhoneNumberWithError_.js +55 -0
  49. package/dist/node_modules/.pnpm/libphonenumber-js@1.12.41/node_modules/libphonenumber-js/es6/parsePhoneNumber_.js +62 -0
  50. package/dist/node_modules/.pnpm/libphonenumber-js@1.12.41/node_modules/libphonenumber-js/es6/tools/semver-compare.js +14 -0
  51. package/dist/node_modules/.pnpm/libphonenumber-js@1.12.41/node_modules/libphonenumber-js/max/exports/parsePhoneNumber.js +8 -0
  52. package/dist/node_modules/.pnpm/libphonenumber-js@1.12.41/node_modules/libphonenumber-js/max/exports/withMetadataArgument.js +8 -0
  53. package/dist/node_modules/.pnpm/libphonenumber-js@1.12.41/node_modules/libphonenumber-js/metadata.max.json.js +4 -0
  54. package/dist/validation/constants.d.ts +2 -0
  55. package/dist/validation/constants.js +152 -0
  56. package/dist/validation/index.d.ts +15 -0
  57. package/dist/validation/sanitize.d.ts +13 -0
  58. package/dist/validation/sanitize.js +6 -0
  59. package/dist/validation/types.d.ts +46 -0
  60. package/dist/validation/validateForm.d.ts +7 -0
  61. package/dist/validation/validateForm.js +22 -0
  62. package/dist/validation/validatePhoneNumber.d.ts +3 -0
  63. package/dist/validation/validatePhoneNumber.js +17 -0
  64. package/dist/validation/validatePostalCode.d.ts +3 -0
  65. package/dist/validation/validatePostalCode.js +22 -0
  66. package/dist/validation/validateState.d.ts +3 -0
  67. package/dist/validation/validateState.js +23 -0
  68. package/dist/validation/validateTextField.d.ts +2 -0
  69. package/dist/validation/validateTextField.js +36 -0
  70. package/package.json +4 -1
@@ -0,0 +1,183 @@
1
+ const t = {
2
+ AD: { pattern: "AD[1-7]0\\d", examples: "AD100,AD501,AD700", inputMode: "text" },
3
+ AF: { pattern: "\\d{4}", examples: "1001,2601,3801", inputMode: "numeric" },
4
+ AI: { pattern: "(?:AI-)?2640", examples: "2640", inputMode: "text" },
5
+ AL: { pattern: "\\d{4}", examples: "1001,1017,3501", inputMode: "numeric" },
6
+ AM: { pattern: "(?:37)?\\d{4}", examples: "375010,0002,0010", inputMode: "numeric" },
7
+ AR: { pattern: "((?:[A-HJ-NP-Z])?\\d{4})([A-Z]{3})?", examples: "C1070AAM,C1000WAM,B1000TBU,X5187XAB", inputMode: "text" },
8
+ AS: { pattern: "(96799)(?:[ \\-](\\d{4}))?", examples: "96799", inputMode: "numeric" },
9
+ AT: { pattern: "\\d{4}", examples: "1010,3741", inputMode: "numeric" },
10
+ AU: { pattern: "\\d{4}", examples: "2060,3171,6430,4000,4006,3001", inputMode: "numeric" },
11
+ AX: { pattern: "22\\d{3}", examples: "22150,22550,22240,22710,22270,22730,22430", inputMode: "numeric" },
12
+ AZ: { pattern: "\\d{4}", examples: "1000", inputMode: "numeric" },
13
+ BA: { pattern: "\\d{5}", examples: "71000", inputMode: "numeric" },
14
+ BB: { pattern: "BB\\d{5}", examples: "BB23026,BB22025", inputMode: "text" },
15
+ BD: { pattern: "\\d{4}", examples: "1340,1000", inputMode: "numeric" },
16
+ BE: { pattern: "\\d{4}", examples: "4000,1000", inputMode: "numeric" },
17
+ BG: { pattern: "\\d{4}", examples: "1000,1700", inputMode: "numeric" },
18
+ BH: { pattern: "(?:^|\\b)(?:1[0-2]|[1-9])\\d{2}(?:$|\\b)", examples: "317", inputMode: "text" },
19
+ BL: { pattern: "9[78][01]\\d{2}", examples: "97100", inputMode: "numeric" },
20
+ BM: { pattern: "[A-Z]{2} ?[A-Z0-9]{2}", examples: "FL 07,HM GX,HM 12", inputMode: "text" },
21
+ BN: { pattern: "[A-Z]{2} ?\\d{4}", examples: "BT2328,KA1131,BA1511", inputMode: "text" },
22
+ BR: { pattern: "\\d{5}-?\\d{3}", examples: "40301-110,70002-900", inputMode: "numeric" },
23
+ BT: { pattern: "\\d{5}", examples: "11001,31101,35003", inputMode: "numeric" },
24
+ BY: { pattern: "\\d{6}", examples: "223016,225860,220050", inputMode: "numeric" },
25
+ CA: { pattern: "[ABCEGHJKLMNPRSTVXY]\\d[ABCEGHJ-NPRSTV-Z] ?\\d[ABCEGHJ-NPRSTV-Z]\\d", examples: "H3Z 2Y7,V8X 3X4,T0L 1K0,T0H 1A0,K1A 0B1", inputMode: "text" },
26
+ CC: { pattern: "6799", examples: "6799", inputMode: "numeric" },
27
+ CH: { pattern: "\\d{4}", examples: "2544,1211,1556,3030", inputMode: "numeric" },
28
+ CL: { pattern: "\\d{7}", examples: "8340457,8720019,1230000,8329100", inputMode: "numeric" },
29
+ CN: { pattern: "\\d{6}", examples: "266033,317204,100096,100808", inputMode: "numeric" },
30
+ CO: { pattern: "\\d{6}", examples: "111221,130001,760011", inputMode: "numeric" },
31
+ CR: { pattern: "\\d{4,5}|\\d{3}-\\d{4}", examples: "1000,2010,1001", inputMode: "numeric" },
32
+ CV: { pattern: "\\d{4}", examples: "7600", inputMode: "numeric" },
33
+ CX: { pattern: "6798", examples: "6798", inputMode: "numeric" },
34
+ CY: { pattern: "\\d{4}", examples: "2008,3304,1900", inputMode: "numeric" },
35
+ CZ: { pattern: "\\d{3} ?\\d{2}", examples: "100 00,251 66,530 87,110 00,225 99", inputMode: "numeric" },
36
+ DE: { pattern: "\\d{5}", examples: "26133,53225", inputMode: "numeric" },
37
+ DK: { pattern: "\\d{4}", examples: "8660,1566", inputMode: "numeric" },
38
+ DO: { pattern: "\\d{5}", examples: "11903,10101", inputMode: "numeric" },
39
+ DZ: { pattern: "\\d{5}", examples: "40304,16027", inputMode: "numeric" },
40
+ EC: { pattern: "\\d{6}", examples: "090105,092301", inputMode: "numeric" },
41
+ EE: { pattern: "\\d{5}", examples: "69501,11212", inputMode: "numeric" },
42
+ EG: { pattern: "\\d{5}", examples: "12411,11599", inputMode: "numeric" },
43
+ EH: { pattern: "\\d{5}", examples: "70000,72000", inputMode: "numeric" },
44
+ ES: { pattern: "\\d{5}", examples: "28039,28300,28070", inputMode: "numeric" },
45
+ ET: { pattern: "\\d{4}", examples: "1000", inputMode: "numeric" },
46
+ FI: { pattern: "\\d{5}", examples: "00550,00011", inputMode: "numeric" },
47
+ FK: { pattern: "FIQQ 1ZZ", examples: "FIQQ 1ZZ", inputMode: "text" },
48
+ FM: { pattern: "(9694[1-4])(?:[ \\-](\\d{4}))?", examples: "96941,96944", inputMode: "numeric" },
49
+ FO: { pattern: "\\d{3}", examples: "100", inputMode: "numeric" },
50
+ FR: { pattern: "\\d{2} ?\\d{3}", examples: "33380,34092,33506", inputMode: "numeric" },
51
+ GB: { pattern: "GIR ?0AA|(?:(?:AB|AL|B|BA|BB|BD|BF|BH|BL|BN|BR|BS|BT|BX|CA|CB|CF|CH|CM|CO|CR|CT|CV|CW|DA|DD|DE|DG|DH|DL|DN|DT|DY|E|EC|EH|EN|EX|FK|FY|G|GL|GY|GU|HA|HD|HG|HP|HR|HS|HU|HX|IG|IM|IP|IV|JE|KA|KT|KW|KY|L|LA|LD|LE|LL|LN|LS|LU|M|ME|MK|ML|N|NE|NG|NN|NP|NR|NW|OL|OX|PA|PE|PH|PL|PO|PR|RG|RH|RM|S|SA|SE|SG|SK|SL|SM|SN|SO|SP|SR|SS|ST|SW|SY|TA|TD|TF|TN|TQ|TR|TS|TW|UB|W|WA|WC|WD|WF|WN|WR|WS|WV|YO|ZE)(?:\\d[\\dA-Z]? ?\\d[ABD-HJLN-UW-Z]{2}))|BFPO ?\\d{1,4}", examples: "EC1Y 8SY,GIR 0AA,M2 5BQ,M34 4AB,CR0 2YR,DN16 9AA,W1A 4ZZ,EC1A 1HQ,OX14 4PG,BS18 8HF,NR25 7HG,RH6 0NP,BH23 6AA,B6 5BA,SO23 9AP,PO1 3AX,BFPO 61", inputMode: "text" },
52
+ GE: { pattern: "\\d{4}", examples: "0101", inputMode: "numeric" },
53
+ GF: { pattern: "9[78]3\\d{2}", examples: "97300", inputMode: "numeric" },
54
+ GG: { pattern: "GY\\d[\\dA-Z]? ?\\d[ABD-HJLN-UW-Z]{2}", examples: "GY1 1AA,GY2 2BT", inputMode: "text" },
55
+ GI: { pattern: "GX11 1AA", examples: "GX11 1AA", inputMode: "text" },
56
+ GL: { pattern: "39\\d{2}", examples: "3900,3950,3911", inputMode: "numeric" },
57
+ GN: { pattern: "\\d{3}", examples: "001,200,100", inputMode: "numeric" },
58
+ GP: { pattern: "9[78][01]\\d{2}", examples: "97100", inputMode: "numeric" },
59
+ GR: { pattern: "\\d{3} ?\\d{2}", examples: "151 24,151 10,101 88", inputMode: "numeric" },
60
+ GS: { pattern: "SIQQ 1ZZ", examples: "SIQQ 1ZZ", inputMode: "text" },
61
+ GT: { pattern: "\\d{5}", examples: "09001,01501", inputMode: "numeric" },
62
+ GU: { pattern: "(969(?:[12]\\d|3[12]))(?:[ \\-](\\d{4}))?", examples: "96910,96931", inputMode: "numeric" },
63
+ GW: { pattern: "\\d{4}", examples: "1000,1011", inputMode: "numeric" },
64
+ HM: { pattern: "\\d{4}", examples: "7050", inputMode: "numeric" },
65
+ HN: { pattern: "\\d{5}", examples: "31301", inputMode: "numeric" },
66
+ HR: { pattern: "\\d{5}", examples: "10000,21001,10002", inputMode: "numeric" },
67
+ HT: { pattern: "\\d{4}", examples: "6120,5310,6110,8510", inputMode: "numeric" },
68
+ HU: { pattern: "\\d{4}", examples: "1037,2380,1540", inputMode: "numeric" },
69
+ ID: { pattern: "\\d{5}", examples: "40115", inputMode: "numeric" },
70
+ IE: { pattern: "[\\dA-Z]{3} ?[\\dA-Z]{4}", examples: "A65 F4E2", inputMode: "text" },
71
+ IL: { pattern: "\\d{5}(?:\\d{2})?", examples: "9614303", inputMode: "numeric" },
72
+ IM: { pattern: "IM\\d[\\dA-Z]? ?\\d[ABD-HJLN-UW-Z]{2}", examples: "IM2 1AA,IM99 1PS", inputMode: "text" },
73
+ IN: { pattern: "\\d{6}", examples: "110034,110001", inputMode: "numeric" },
74
+ IO: { pattern: "BBND 1ZZ", examples: "BBND 1ZZ", inputMode: "text" },
75
+ IQ: { pattern: "\\d{5}", examples: "31001", inputMode: "numeric" },
76
+ IS: { pattern: "\\d{3}", examples: "320,121,220,110", inputMode: "numeric" },
77
+ IT: { pattern: "\\d{5}", examples: "00144,47037,39049", inputMode: "numeric" },
78
+ JE: { pattern: "JE\\d[\\dA-Z]? ?\\d[ABD-HJLN-UW-Z]{2}", examples: "JE1 1AA,JE2 2BT", inputMode: "text" },
79
+ JO: { pattern: "\\d{5}", examples: "11937,11190", inputMode: "numeric" },
80
+ JP: { pattern: "\\d{3}-?\\d{4}", examples: "154-0023,350-1106,951-8073,112-0001,208-0032,231-0012", inputMode: "numeric" },
81
+ KE: { pattern: "\\d{5}", examples: "20100,00100", inputMode: "numeric" },
82
+ KG: { pattern: "\\d{6}", examples: "720001", inputMode: "numeric" },
83
+ KH: { pattern: "\\d{5,6}", examples: "120101,120108", inputMode: "numeric" },
84
+ KR: { pattern: "\\d{5}", examples: "03051", inputMode: "numeric" },
85
+ KW: { pattern: "\\d{5}", examples: "54541,54551,54404,13009", inputMode: "numeric" },
86
+ KY: { pattern: "KY\\d-\\d{4}", examples: "KY1-1100,KY1-1702,KY2-2101", inputMode: "text" },
87
+ KZ: { pattern: "\\d{6}", examples: "040900,050012", inputMode: "numeric" },
88
+ LA: { pattern: "\\d{5}", examples: "01160,01000", inputMode: "numeric" },
89
+ LB: { pattern: "(?:\\d{4})(?: ?(?:\\d{4}))?", examples: "2038 3054,1107 2810,1000", inputMode: "numeric" },
90
+ LI: { pattern: "948[5-9]|949[0-8]", examples: "9496,9491,9490,9485", inputMode: "numeric" },
91
+ LK: { pattern: "\\d{5}", examples: "20000,00100", inputMode: "numeric" },
92
+ LR: { pattern: "\\d{4}", examples: "1000", inputMode: "numeric" },
93
+ LS: { pattern: "\\d{3}", examples: "100", inputMode: "numeric" },
94
+ LT: { pattern: "\\d{5}", examples: "04340,03500", inputMode: "numeric" },
95
+ LU: { pattern: "\\d{4}", examples: "4750,2998", inputMode: "numeric" },
96
+ LV: { pattern: "LV-\\d{4}", examples: "LV-1073,LV-1000", inputMode: "text" },
97
+ MA: { pattern: "\\d{5}", examples: "53000,10000,20050,16052", inputMode: "numeric" },
98
+ MC: { pattern: "980\\d{2}", examples: "98000,98020,98011,98001", inputMode: "numeric" },
99
+ MD: { pattern: "\\d{4}", examples: "2012,2019", inputMode: "numeric" },
100
+ ME: { pattern: "8\\d{4}", examples: "81257,81258,81217,84314,85366", inputMode: "numeric" },
101
+ MF: { pattern: "9[78][01]\\d{2}", examples: "97100", inputMode: "numeric" },
102
+ MG: { pattern: "\\d{3}", examples: "501,101", inputMode: "numeric" },
103
+ MH: { pattern: "(969[67]\\d)(?:[ \\-](\\d{4}))?", examples: "96960,96970", inputMode: "numeric" },
104
+ MK: { pattern: "\\d{4}", examples: "1314,1321,1443,1062", inputMode: "numeric" },
105
+ MM: { pattern: "\\d{5}", examples: "11181", inputMode: "numeric" },
106
+ MN: { pattern: "\\d{5}", examples: "65030,65270", inputMode: "numeric" },
107
+ MP: { pattern: "(9695[012])(?:[ \\-](\\d{4}))?", examples: "96950,96951,96952", inputMode: "numeric" },
108
+ MQ: { pattern: "9[78]2\\d{2}", examples: "97220", inputMode: "numeric" },
109
+ MT: { pattern: "[A-Z]{3} ?\\d{2,4}", examples: "NXR 01,ZTN 05,GPO 01,BZN 1130,SPB 6031,VCT 1753", inputMode: "text" },
110
+ MU: { pattern: "\\d{3}(?:\\d{2}|[A-Z]{2}\\d{3})", examples: "42602", inputMode: "text" },
111
+ MV: { pattern: "\\d{5}", examples: "20026", inputMode: "numeric" },
112
+ MX: { pattern: "\\d{5}", examples: "02860,77520,06082", inputMode: "numeric" },
113
+ MZ: { pattern: "\\d{4}", examples: "1102,1119,3212", inputMode: "numeric" },
114
+ NA: { pattern: "\\d{5}", examples: "10001,10017", inputMode: "numeric" },
115
+ NC: { pattern: "988\\d{2}", examples: "98814,98800,98810", inputMode: "numeric" },
116
+ NE: { pattern: "\\d{4}", examples: "8001", inputMode: "numeric" },
117
+ NF: { pattern: "2899", examples: "2899", inputMode: "numeric" },
118
+ NG: { pattern: "\\d{6}", examples: "930283,300001,931104", inputMode: "numeric" },
119
+ NI: { pattern: "\\d{5}", examples: "52000", inputMode: "numeric" },
120
+ NL: { pattern: "[1-9]\\d{3} ?(?:[A-RT-Z][A-Z]|S[BCE-RT-Z])", examples: "1234 AB,2490 AA", inputMode: "text" },
121
+ NO: { pattern: "\\d{4}", examples: "0025,0107,6631", inputMode: "numeric" },
122
+ NP: { pattern: "\\d{5}", examples: "44601", inputMode: "numeric" },
123
+ NZ: { pattern: "\\d{4}", examples: "6001,6015,6332,8252,1030", inputMode: "numeric" },
124
+ OM: { pattern: "(?:PC )?\\d{3}", examples: "133,112,111", inputMode: "text" },
125
+ PE: { pattern: "(?:LIMA \\d{1,2}|CALLAO 0?\\d)|[0-2]\\d{4}", examples: "LIMA 23,LIMA 42,CALLAO 2,02001", inputMode: "text" },
126
+ PF: { pattern: "987\\d{2}", examples: "98709", inputMode: "numeric" },
127
+ PG: { pattern: "\\d{3}", examples: "111", inputMode: "numeric" },
128
+ PH: { pattern: "\\d{4}", examples: "1008,1050,1135,1207,2000,1000", inputMode: "numeric" },
129
+ PK: { pattern: "\\d{5}", examples: "44000", inputMode: "numeric" },
130
+ PL: { pattern: "\\d{2}-\\d{3}", examples: "00-950,05-470,48-300,32-015,00-940", inputMode: "numeric" },
131
+ PM: { pattern: "9[78]5\\d{2}", examples: "97500", inputMode: "numeric" },
132
+ PN: { pattern: "PCRN 1ZZ", examples: "PCRN 1ZZ", inputMode: "text" },
133
+ PR: { pattern: "(00[679]\\d{2})(?:[ \\-](\\d{4}))?", examples: "00930", inputMode: "numeric" },
134
+ PT: { pattern: "\\d{4}-\\d{3}", examples: "2725-079,1250-096,1201-950,2860-571,1208-148", inputMode: "numeric" },
135
+ PW: { pattern: "(969(?:39|40))(?:[ \\-](\\d{4}))?", examples: "96940", inputMode: "numeric" },
136
+ PY: { pattern: "\\d{4}", examples: "1536,1538,1209", inputMode: "numeric" },
137
+ RE: { pattern: "9[78]4\\d{2}", examples: "97400", inputMode: "numeric" },
138
+ RO: { pattern: "\\d{6}", examples: "060274,061357,200716", inputMode: "numeric" },
139
+ RS: { pattern: "\\d{5,6}", examples: "106314", inputMode: "numeric" },
140
+ RU: { pattern: "\\d{6}", examples: "247112,103375,188300", inputMode: "numeric" },
141
+ SA: { pattern: "\\d{5}", examples: "11564,11187,11142", inputMode: "numeric" },
142
+ SE: { pattern: "\\d{3} ?\\d{2}", examples: "11455,12345,10500", inputMode: "numeric" },
143
+ SG: { pattern: "\\d{6}", examples: "546080,308125,408600", inputMode: "numeric" },
144
+ SH: { pattern: "(?:ASCN|STHL) 1ZZ", examples: "STHL 1ZZ", inputMode: "text" },
145
+ SI: { pattern: "\\d{4}", examples: "4000,1001,2500", inputMode: "numeric" },
146
+ SJ: { pattern: "\\d{4}", examples: "9170", inputMode: "numeric" },
147
+ SK: { pattern: "\\d{3} ?\\d{2}", examples: "010 01,023 14,972 48,921 01,975 99", inputMode: "numeric" },
148
+ SM: { pattern: "4789\\d", examples: "47890,47891,47895,47899", inputMode: "numeric" },
149
+ SN: { pattern: "\\d{5}", examples: "12500,46024,16556,10000", inputMode: "numeric" },
150
+ SO: { pattern: "[A-Z]{2} ?\\d{5}", examples: "JH 09010,AD 11010", inputMode: "text" },
151
+ SV: { pattern: "CP [1-3][1-7][0-2]\\d", examples: "CP 1101", inputMode: "text" },
152
+ SZ: { pattern: "[HLMS]\\d{3}", examples: "H100", inputMode: "text" },
153
+ TC: { pattern: "TKCA 1ZZ", examples: "TKCA 1ZZ", inputMode: "text" },
154
+ TH: { pattern: "\\d{5}", examples: "10150,10210", inputMode: "numeric" },
155
+ TJ: { pattern: "\\d{6}", examples: "735450,734025", inputMode: "numeric" },
156
+ TM: { pattern: "\\d{6}", examples: "744000", inputMode: "numeric" },
157
+ TN: { pattern: "\\d{4}", examples: "1002,8129,3100,1030", inputMode: "numeric" },
158
+ TR: { pattern: "\\d{5}", examples: "01960,06101", inputMode: "numeric" },
159
+ TW: { pattern: "\\d{3}(?:\\d{2,3})?", examples: "104,106,10603,40867", inputMode: "numeric" },
160
+ TZ: { pattern: "\\d{4,5}", examples: "6090,34413", inputMode: "numeric" },
161
+ UA: { pattern: "\\d{5}", examples: "15432,01055,01001", inputMode: "numeric" },
162
+ UM: { pattern: "96898", examples: "96898", inputMode: "numeric" },
163
+ US: { pattern: "(\\d{5})(?:[ \\-](\\d{4}))?", examples: "95014,22162-1010", inputMode: "numeric" },
164
+ UY: { pattern: "\\d{5}", examples: "11600", inputMode: "numeric" },
165
+ UZ: { pattern: "\\d{6}", examples: "702100,700000", inputMode: "numeric" },
166
+ VA: { pattern: "00120", examples: "00120", inputMode: "numeric" },
167
+ VC: { pattern: "VC\\d{4}", examples: "VC0100,VC0110,VC0400", inputMode: "text" },
168
+ VE: { pattern: "\\d{4}", examples: "1010,3001,8011,1020", inputMode: "numeric" },
169
+ VG: { pattern: "VG\\d{4}", examples: "VG1110,VG1150,VG1160", inputMode: "text" },
170
+ VI: { pattern: "(008(?:(?:[0-4]\\d)|(?:5[01])))(?:[ \\-](\\d{4}))?", examples: "00802-1222,00850-9802", inputMode: "numeric" },
171
+ VN: { pattern: "\\d{5}\\d?", examples: "70010,55999", inputMode: "numeric" },
172
+ WF: { pattern: "986\\d{2}", examples: "98600", inputMode: "numeric" },
173
+ YT: { pattern: "976\\d{2}", examples: "97600", inputMode: "numeric" },
174
+ ZA: { pattern: "\\d{4}", examples: "0083,1451,0001", inputMode: "numeric" },
175
+ ZM: { pattern: "\\d{5}", examples: "50100,50101", inputMode: "numeric" }
176
+ };
177
+ function p(e) {
178
+ return t[e];
179
+ }
180
+ export {
181
+ t as POSTAL_PATTERNS,
182
+ p as getPostalPattern
183
+ };
@@ -0,0 +1,15 @@
1
+ /**
2
+ * states.ts — State/province/subdivision lists per country.
3
+ *
4
+ * Auto-generated from resources/countries-data-analysis/all-countries-merged.json
5
+ * 44 countries have subdivision data from Google libaddressinput.
6
+ * Sorted alphabetically by subdivision name.
7
+ */
8
+ export interface SubdivisionRecord {
9
+ readonly code: string;
10
+ readonly name: string;
11
+ }
12
+ /** Subdivision lists keyed by ISO 3166-1 alpha-2 country code. */
13
+ export declare const SUBDIVISIONS: Readonly<Record<string, readonly SubdivisionRecord[]>>;
14
+ /** Get subdivisions for a country. Returns empty array if none. */
15
+ export declare function getSubdivisions(countryCode: string): readonly SubdivisionRecord[];