@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
@@ -1,549 +1,32 @@
1
- const i = [
2
- { code: "AU", name: "Australia", flag: "🇦🇺" },
3
- { code: "AT", name: "Austria", flag: "🇦🇹" },
4
- { code: "BE", name: "Belgium", flag: "🇧🇪" },
5
- { code: "BR", name: "Brazil", flag: "🇧🇷" },
6
- { code: "CA", name: "Canada", flag: "🇨🇦" },
7
- { code: "CN", name: "China", flag: "🇨🇳" },
8
- { code: "CZ", name: "Czech Republic", flag: "🇨🇿" },
9
- { code: "DK", name: "Denmark", flag: "🇩🇰" },
10
- { code: "FI", name: "Finland", flag: "🇫🇮" },
11
- { code: "FR", name: "France", flag: "🇫🇷" },
12
- { code: "DE", name: "Germany", flag: "🇩🇪" },
13
- { code: "HK", name: "Hong Kong", flag: "🇭🇰" },
14
- { code: "IN", name: "India", flag: "🇮🇳" },
15
- { code: "IE", name: "Ireland", flag: "🇮🇪" },
16
- { code: "IT", name: "Italy", flag: "🇮🇹" },
17
- { code: "JP", name: "Japan", flag: "🇯🇵" },
18
- { code: "KR", name: "Korea, Republic of", flag: "🇰🇷" },
19
- { code: "MX", name: "Mexico", flag: "🇲🇽" },
20
- { code: "NL", name: "Netherlands", flag: "🇳🇱" },
21
- { code: "NZ", name: "New Zealand", flag: "🇳🇿" },
22
- { code: "NO", name: "Norway", flag: "🇳🇴" },
23
- { code: "PL", name: "Poland", flag: "🇵🇱" },
24
- { code: "PT", name: "Portugal", flag: "🇵🇹" },
25
- { code: "SA", name: "Saudi Arabia", flag: "🇸🇦" },
26
- { code: "ES", name: "Spain", flag: "🇪🇸" },
27
- { code: "SE", name: "Sweden", flag: "🇸🇪" },
28
- { code: "CH", name: "Switzerland", flag: "🇨🇭" },
29
- { code: "GB", name: "United Kingdom", flag: "🇬🇧" },
30
- { code: "US", name: "United States", flag: "🇺🇸" },
31
- { code: "ZA", name: "South Africa", flag: "🇿🇦" }
32
- ], a = {
33
- US: [
34
- { code: "AL", name: "Alabama" },
35
- { code: "AK", name: "Alaska" },
36
- { code: "AZ", name: "Arizona" },
37
- { code: "AR", name: "Arkansas" },
38
- { code: "CA", name: "California" },
39
- { code: "CO", name: "Colorado" },
40
- { code: "CT", name: "Connecticut" },
41
- { code: "DE", name: "Delaware" },
42
- { code: "DC", name: "District of Columbia" },
43
- { code: "FL", name: "Florida" },
44
- { code: "GA", name: "Georgia" },
45
- { code: "HI", name: "Hawaii" },
46
- { code: "ID", name: "Idaho" },
47
- { code: "IL", name: "Illinois" },
48
- { code: "IN", name: "Indiana" },
49
- { code: "IA", name: "Iowa" },
50
- { code: "KS", name: "Kansas" },
51
- { code: "KY", name: "Kentucky" },
52
- { code: "LA", name: "Louisiana" },
53
- { code: "ME", name: "Maine" },
54
- { code: "MD", name: "Maryland" },
55
- { code: "MA", name: "Massachusetts" },
56
- { code: "MI", name: "Michigan" },
57
- { code: "MN", name: "Minnesota" },
58
- { code: "MS", name: "Mississippi" },
59
- { code: "MO", name: "Missouri" },
60
- { code: "MT", name: "Montana" },
61
- { code: "NE", name: "Nebraska" },
62
- { code: "NV", name: "Nevada" },
63
- { code: "NH", name: "New Hampshire" },
64
- { code: "NJ", name: "New Jersey" },
65
- { code: "NM", name: "New Mexico" },
66
- { code: "NY", name: "New York" },
67
- { code: "NC", name: "North Carolina" },
68
- { code: "ND", name: "North Dakota" },
69
- { code: "OH", name: "Ohio" },
70
- { code: "OK", name: "Oklahoma" },
71
- { code: "OR", name: "Oregon" },
72
- { code: "PA", name: "Pennsylvania" },
73
- { code: "RI", name: "Rhode Island" },
74
- { code: "SC", name: "South Carolina" },
75
- { code: "SD", name: "South Dakota" },
76
- { code: "TN", name: "Tennessee" },
77
- { code: "TX", name: "Texas" },
78
- { code: "UT", name: "Utah" },
79
- { code: "VT", name: "Vermont" },
80
- { code: "VA", name: "Virginia" },
81
- { code: "WA", name: "Washington" },
82
- { code: "WV", name: "West Virginia" },
83
- { code: "WI", name: "Wisconsin" },
84
- { code: "WY", name: "Wyoming" },
85
- { code: "AS", name: "American Samoa" },
86
- { code: "GU", name: "Guam" },
87
- { code: "MP", name: "Northern Mariana Islands" },
88
- { code: "PR", name: "Puerto Rico" },
89
- { code: "VI", name: "U.S. Virgin Islands" }
90
- ],
91
- CA: [
92
- { code: "AB", name: "Alberta" },
93
- { code: "BC", name: "British Columbia" },
94
- { code: "MB", name: "Manitoba" },
95
- { code: "NB", name: "New Brunswick" },
96
- { code: "NL", name: "Newfoundland and Labrador" },
97
- { code: "NS", name: "Nova Scotia" },
98
- { code: "NT", name: "Northwest Territories" },
99
- { code: "NU", name: "Nunavut" },
100
- { code: "ON", name: "Ontario" },
101
- { code: "PE", name: "Prince Edward Island" },
102
- { code: "QC", name: "Quebec" },
103
- { code: "SK", name: "Saskatchewan" },
104
- { code: "YT", name: "Yukon" }
105
- ],
106
- AU: [
107
- { code: "ACT", name: "Australian Capital Territory" },
108
- { code: "NSW", name: "New South Wales" },
109
- { code: "NT", name: "Northern Territory" },
110
- { code: "QLD", name: "Queensland" },
111
- { code: "SA", name: "South Australia" },
112
- { code: "TAS", name: "Tasmania" },
113
- { code: "VIC", name: "Victoria" },
114
- { code: "WA", name: "Western Australia" }
115
- ],
116
- BR: [
117
- { code: "AC", name: "Acre" },
118
- { code: "AL", name: "Alagoas" },
119
- { code: "AP", name: "Amapá" },
120
- { code: "AM", name: "Amazonas" },
121
- { code: "BA", name: "Bahia" },
122
- { code: "CE", name: "Ceará" },
123
- { code: "DF", name: "Distrito Federal" },
124
- { code: "ES", name: "Espírito Santo" },
125
- { code: "GO", name: "Goiás" },
126
- { code: "MA", name: "Maranhão" },
127
- { code: "MT", name: "Mato Grosso" },
128
- { code: "MS", name: "Mato Grosso do Sul" },
129
- { code: "MG", name: "Minas Gerais" },
130
- { code: "PA", name: "Pará" },
131
- { code: "PB", name: "Paraíba" },
132
- { code: "PR", name: "Paraná" },
133
- { code: "PE", name: "Pernambuco" },
134
- { code: "PI", name: "Piauí" },
135
- { code: "RJ", name: "Rio de Janeiro" },
136
- { code: "RN", name: "Rio Grande do Norte" },
137
- { code: "RS", name: "Rio Grande do Sul" },
138
- { code: "RO", name: "Rondônia" },
139
- { code: "RR", name: "Roraima" },
140
- { code: "SC", name: "Santa Catarina" },
141
- { code: "SP", name: "São Paulo" },
142
- { code: "SE", name: "Sergipe" },
143
- { code: "TO", name: "Tocantins" }
144
- ],
145
- JP: [
146
- { code: "JP-01", name: "Hokkaido" },
147
- { code: "JP-02", name: "Aomori" },
148
- { code: "JP-03", name: "Iwate" },
149
- { code: "JP-04", name: "Miyagi" },
150
- { code: "JP-05", name: "Akita" },
151
- { code: "JP-06", name: "Yamagata" },
152
- { code: "JP-07", name: "Fukushima" },
153
- { code: "JP-08", name: "Ibaraki" },
154
- { code: "JP-09", name: "Tochigi" },
155
- { code: "JP-10", name: "Gunma" },
156
- { code: "JP-11", name: "Saitama" },
157
- { code: "JP-12", name: "Chiba" },
158
- { code: "JP-13", name: "Tokyo" },
159
- { code: "JP-14", name: "Kanagawa" },
160
- { code: "JP-15", name: "Niigata" },
161
- { code: "JP-16", name: "Toyama" },
162
- { code: "JP-17", name: "Ishikawa" },
163
- { code: "JP-18", name: "Fukui" },
164
- { code: "JP-19", name: "Yamanashi" },
165
- { code: "JP-20", name: "Nagano" },
166
- { code: "JP-21", name: "Gifu" },
167
- { code: "JP-22", name: "Shizuoka" },
168
- { code: "JP-23", name: "Aichi" },
169
- { code: "JP-24", name: "Mie" },
170
- { code: "JP-25", name: "Shiga" },
171
- { code: "JP-26", name: "Kyoto" },
172
- { code: "JP-27", name: "Osaka" },
173
- { code: "JP-28", name: "Hyogo" },
174
- { code: "JP-29", name: "Nara" },
175
- { code: "JP-30", name: "Wakayama" },
176
- { code: "JP-31", name: "Tottori" },
177
- { code: "JP-32", name: "Shimane" },
178
- { code: "JP-33", name: "Okayama" },
179
- { code: "JP-34", name: "Hiroshima" },
180
- { code: "JP-35", name: "Yamaguchi" },
181
- { code: "JP-36", name: "Tokushima" },
182
- { code: "JP-37", name: "Kagawa" },
183
- { code: "JP-38", name: "Ehime" },
184
- { code: "JP-39", name: "Kochi" },
185
- { code: "JP-40", name: "Fukuoka" },
186
- { code: "JP-41", name: "Saga" },
187
- { code: "JP-42", name: "Nagasaki" },
188
- { code: "JP-43", name: "Kumamoto" },
189
- { code: "JP-44", name: "Oita" },
190
- { code: "JP-45", name: "Miyazaki" },
191
- { code: "JP-46", name: "Kagoshima" },
192
- { code: "JP-47", name: "Okinawa" }
193
- ],
194
- MX: [
195
- { code: "Ags.", name: "Aguascalientes" },
196
- { code: "B.C.", name: "Baja California" },
197
- { code: "B.C.S.", name: "Baja California Sur" },
198
- { code: "Camp.", name: "Campeche" },
199
- { code: "CDMX", name: "Ciudad de México" },
200
- { code: "Chis.", name: "Chiapas" },
201
- { code: "Chih.", name: "Chihuahua" },
202
- { code: "Coah.", name: "Coahuila de Zaragoza" },
203
- { code: "Col.", name: "Colima" },
204
- { code: "Dgo.", name: "Durango" },
205
- { code: "Mex.", name: "Estado de México" },
206
- { code: "Gto.", name: "Guanajuato" },
207
- { code: "Gro.", name: "Guerrero" },
208
- { code: "Hgo.", name: "Hidalgo" },
209
- { code: "Jal.", name: "Jalisco" },
210
- { code: "Mich.", name: "Michoacán" },
211
- { code: "Mor.", name: "Morelos" },
212
- { code: "Nay.", name: "Nayarit" },
213
- { code: "N.L.", name: "Nuevo León" },
214
- { code: "Oax.", name: "Oaxaca" },
215
- { code: "Pue.", name: "Puebla" },
216
- { code: "Qro.", name: "Querétaro" },
217
- { code: "Q.R.", name: "Quintana Roo" },
218
- { code: "S.L.P.", name: "San Luis Potosí" },
219
- { code: "Sin.", name: "Sinaloa" },
220
- { code: "Son.", name: "Sonora" },
221
- { code: "Tab.", name: "Tabasco" },
222
- { code: "Tamps.", name: "Tamaulipas" },
223
- { code: "Tlax.", name: "Tlaxcala" },
224
- { code: "Ver.", name: "Veracruz" },
225
- { code: "Yuc.", name: "Yucatán" },
226
- { code: "Zac.", name: "Zacatecas" }
227
- ]
228
- };
229
- var d, n, t, c, s, m;
230
- const r = {
231
- US: {
232
- cc: "US",
233
- stateRequired: !0,
234
- stateCodes: ((d = a.US) == null ? void 0 : d.map((e) => e.code)) ?? [],
235
- postalRegex: /^(\d{5})(?:[ -](\d{4}))?$/,
236
- postalExamples: "95014, 22162-1010",
237
- postalInputMode: "numeric",
238
- dialCode: "+1",
239
- phoneCountryCode: "US"
240
- },
241
- CA: {
242
- cc: "CA",
243
- stateRequired: !0,
244
- stateCodes: ((n = a.CA) == null ? void 0 : n.map((e) => e.code)) ?? [],
245
- postalRegex: /^[ABCEGHJKLMNPRSTVXY]\d[ABCEGHJ-NPRSTV-Z] ?\d[ABCEGHJ-NPRSTV-Z]\d$/i,
246
- postalExamples: "H3Z 2Y7, K1A 0B1",
247
- postalInputMode: "text",
248
- dialCode: "+1",
249
- phoneCountryCode: "CA"
250
- },
251
- GB: {
252
- cc: "GB",
253
- stateRequired: !1,
254
- stateCodes: [],
255
- postalRegex: /^[A-Z]{1,2}\d[A-Z\d]? ?\d[A-Z]{2}$/i,
256
- postalExamples: "EC1Y 8SY, M2 5BQ",
257
- postalInputMode: "text",
258
- dialCode: "+44",
259
- phoneCountryCode: "GB"
260
- },
261
- DE: {
262
- cc: "DE",
263
- stateRequired: !1,
264
- stateCodes: [],
265
- postalRegex: /^\d{5}$/,
266
- postalExamples: "26133, 53225",
267
- postalInputMode: "numeric",
268
- dialCode: "+49",
269
- phoneCountryCode: "DE"
270
- },
271
- FR: {
272
- cc: "FR",
273
- stateRequired: !1,
274
- stateCodes: [],
275
- postalRegex: /^\d{2} ?\d{3}$/,
276
- postalExamples: "33380, 34092",
277
- postalInputMode: "numeric",
278
- dialCode: "+33",
279
- phoneCountryCode: "FR"
280
- },
281
- JP: {
282
- cc: "JP",
283
- stateRequired: !0,
284
- stateCodes: ((t = a.JP) == null ? void 0 : t.map((e) => e.code)) ?? [],
285
- postalRegex: /^\d{3}-?\d{4}$/,
286
- postalExamples: "154-0023, 112-0001",
287
- postalInputMode: "numeric",
288
- dialCode: "+81",
289
- phoneCountryCode: "JP"
290
- },
291
- AU: {
292
- cc: "AU",
293
- stateRequired: !0,
294
- stateCodes: ((c = a.AU) == null ? void 0 : c.map((e) => e.code)) ?? [],
295
- postalRegex: /^\d{4}$/,
296
- postalExamples: "2060, 3171",
297
- postalInputMode: "numeric",
298
- dialCode: "+61",
299
- phoneCountryCode: "AU"
300
- },
301
- SA: {
302
- cc: "SA",
303
- stateRequired: !1,
304
- stateCodes: [],
305
- postalRegex: /^\d{5}$/,
306
- postalExamples: "11564, 11187",
307
- postalInputMode: "numeric",
308
- dialCode: "+966",
309
- phoneCountryCode: "SA"
310
- },
311
- MX: {
312
- cc: "MX",
313
- stateRequired: !0,
314
- stateCodes: ((s = a.MX) == null ? void 0 : s.map((e) => e.code)) ?? [],
315
- postalRegex: /^\d{5}$/,
316
- postalExamples: "02860, 77520",
317
- postalInputMode: "numeric",
318
- dialCode: "+52",
319
- phoneCountryCode: "MX"
320
- },
321
- BR: {
322
- cc: "BR",
323
- stateRequired: !0,
324
- stateCodes: ((m = a.BR) == null ? void 0 : m.map((e) => e.code)) ?? [],
325
- postalRegex: /^\d{5}-?\d{3}$/,
326
- postalExamples: "40301-110, 70002-900",
327
- postalInputMode: "numeric",
328
- dialCode: "+55",
329
- phoneCountryCode: "BR"
330
- },
331
- IN: {
332
- cc: "IN",
333
- stateRequired: !1,
334
- stateCodes: [],
335
- postalRegex: /^\d{6}$/,
336
- postalExamples: "110034, 110001",
337
- postalInputMode: "numeric",
338
- dialCode: "+91",
339
- phoneCountryCode: "IN"
340
- },
341
- KR: {
342
- cc: "KR",
343
- stateRequired: !1,
344
- stateCodes: [],
345
- postalRegex: /^\d{5}$/,
346
- postalExamples: "03051",
347
- postalInputMode: "numeric",
348
- dialCode: "+82",
349
- phoneCountryCode: "KR"
350
- },
351
- CN: {
352
- cc: "CN",
353
- stateRequired: !1,
354
- stateCodes: [],
355
- postalRegex: /^\d{6}$/,
356
- postalExamples: "266033, 100096",
357
- postalInputMode: "numeric",
358
- dialCode: "+86",
359
- phoneCountryCode: "CN"
360
- },
361
- NL: {
362
- cc: "NL",
363
- stateRequired: !1,
364
- stateCodes: [],
365
- postalRegex: /^[1-9]\d{3} ?(?:[A-RT-Z][A-Z]|S[BCE-RT-Z])$/i,
366
- postalExamples: "1234 AB",
367
- postalInputMode: "text",
368
- dialCode: "+31",
369
- phoneCountryCode: "NL"
370
- },
371
- SE: {
372
- cc: "SE",
373
- stateRequired: !1,
374
- stateCodes: [],
375
- postalRegex: /^\d{3} ?\d{2}$/,
376
- postalExamples: "111 22, 12345",
377
- postalInputMode: "numeric",
378
- dialCode: "+46",
379
- phoneCountryCode: "SE"
380
- },
381
- IT: {
382
- cc: "IT",
383
- stateRequired: !1,
384
- stateCodes: [],
385
- postalRegex: /^\d{5}$/,
386
- postalExamples: "20121, 00100",
387
- postalInputMode: "numeric",
388
- dialCode: "+39",
389
- phoneCountryCode: "IT"
390
- },
391
- ES: {
392
- cc: "ES",
393
- stateRequired: !1,
394
- stateCodes: [],
395
- postalRegex: /^\d{5}$/,
396
- postalExamples: "28001, 08001",
397
- postalInputMode: "numeric",
398
- dialCode: "+34",
399
- phoneCountryCode: "ES"
400
- },
401
- PL: {
402
- cc: "PL",
403
- stateRequired: !1,
404
- stateCodes: [],
405
- postalRegex: /^\d{2}-\d{3}$/,
406
- postalExamples: "00-001, 30-001",
407
- postalInputMode: "numeric",
408
- dialCode: "+48",
409
- phoneCountryCode: "PL"
410
- },
411
- PT: {
412
- cc: "PT",
413
- stateRequired: !1,
414
- stateCodes: [],
415
- postalRegex: /^\d{4}-\d{3}$/,
416
- postalExamples: "1000-001",
417
- postalInputMode: "numeric",
418
- dialCode: "+351",
419
- phoneCountryCode: "PT"
420
- },
421
- CH: {
422
- cc: "CH",
423
- stateRequired: !1,
424
- stateCodes: [],
425
- postalRegex: /^\d{4}$/,
426
- postalExamples: "8001, 3000",
427
- postalInputMode: "numeric",
428
- dialCode: "+41",
429
- phoneCountryCode: "CH"
430
- },
431
- AT: {
432
- cc: "AT",
433
- stateRequired: !1,
434
- stateCodes: [],
435
- postalRegex: /^\d{4}$/,
436
- postalExamples: "1010, 4020",
437
- postalInputMode: "numeric",
438
- dialCode: "+43",
439
- phoneCountryCode: "AT"
440
- },
441
- BE: {
442
- cc: "BE",
443
- stateRequired: !1,
444
- stateCodes: [],
445
- postalRegex: /^\d{4}$/,
446
- postalExamples: "1000, 2000",
447
- postalInputMode: "numeric",
448
- dialCode: "+32",
449
- phoneCountryCode: "BE"
450
- },
451
- DK: {
452
- cc: "DK",
453
- stateRequired: !1,
454
- stateCodes: [],
455
- postalRegex: /^\d{4}$/,
456
- postalExamples: "1000, 2000",
457
- postalInputMode: "numeric",
458
- dialCode: "+45",
459
- phoneCountryCode: "DK"
460
- },
461
- FI: {
462
- cc: "FI",
463
- stateRequired: !1,
464
- stateCodes: [],
465
- postalRegex: /^\d{5}$/,
466
- postalExamples: "00100, 33100",
467
- postalInputMode: "numeric",
468
- dialCode: "+358",
469
- phoneCountryCode: "FI"
470
- },
471
- NO: {
472
- cc: "NO",
473
- stateRequired: !1,
474
- stateCodes: [],
475
- postalRegex: /^\d{4}$/,
476
- postalExamples: "0010, 5003",
477
- postalInputMode: "numeric",
478
- dialCode: "+47",
479
- phoneCountryCode: "NO"
480
- },
481
- NZ: {
482
- cc: "NZ",
483
- stateRequired: !1,
484
- stateCodes: [],
485
- postalRegex: /^\d{4}$/,
486
- postalExamples: "1010, 6011",
487
- postalInputMode: "numeric",
488
- dialCode: "+64",
489
- phoneCountryCode: "NZ"
490
- },
491
- IE: {
492
- cc: "IE",
493
- stateRequired: !1,
494
- stateCodes: [],
495
- // Ireland Eircode — 3 char routing key + space + 4 char unique identifier
496
- postalRegex: /^[A-Z]\d{2} ?[A-Z0-9]{4}$/i,
497
- postalExamples: "D02 XY45, A65 F4E2",
498
- postalInputMode: "text",
499
- dialCode: "+353",
500
- phoneCountryCode: "IE"
501
- },
502
- ZA: {
503
- cc: "ZA",
504
- stateRequired: !1,
505
- stateCodes: [],
506
- postalRegex: /^\d{4}$/,
507
- postalExamples: "2000, 8001",
508
- postalInputMode: "numeric",
509
- dialCode: "+27",
510
- phoneCountryCode: "ZA"
511
- },
512
- HK: {
513
- cc: "HK",
514
- stateRequired: !1,
515
- stateCodes: [],
516
- postalRegex: null,
517
- postalExamples: "",
518
- postalInputMode: "text",
519
- dialCode: "+852",
520
- phoneCountryCode: "HK"
521
- }
522
- };
523
- function p(e) {
524
- return r[e] ?? {
525
- cc: e,
526
- stateRequired: !1,
527
- stateCodes: [],
528
- postalRegex: null,
529
- postalExamples: "",
530
- postalInputMode: "text",
531
- dialCode: "",
532
- phoneCountryCode: e
533
- };
1
+ import { COUNTRIES as t } from "./countries.js";
2
+ import { getSubdivisions as i, SUBDIVISIONS as m } from "./states.js";
3
+ import { getCountryConfig as r } from "./countryConfig.js";
4
+ const a = t.map((e) => ({
5
+ code: e.code,
6
+ name: e.name,
7
+ flag: e.flag
8
+ }));
9
+ Object.fromEntries(
10
+ Object.entries(m).map(([e, n]) => [
11
+ e,
12
+ n.map((o) => ({ code: o.code, name: o.name }))
13
+ ])
14
+ );
15
+ const c = {};
16
+ function d(e) {
17
+ return r(e);
534
18
  }
535
- function u(e) {
536
- return a[e] ?? [];
19
+ function s(e) {
20
+ return i(e).map((n) => ({ code: n.code, name: n.name }));
537
21
  }
538
22
  function C(e) {
539
- var o;
540
- return ((o = i.find((l) => l.code === e)) == null ? void 0 : o.name) ?? e;
23
+ var n;
24
+ return ((n = a.find((o) => o.code === e)) == null ? void 0 : n.name) ?? e;
541
25
  }
542
26
  export {
543
- r as COUNTRY_CONFIGS,
544
- i as COUNTRY_OPTIONS,
545
- a as SUBDIVISIONS,
546
- p as getCountryConfig,
27
+ c as COUNTRY_CONFIGS,
28
+ a as COUNTRY_OPTIONS,
29
+ d as getCountryConfig,
547
30
  C as getCountryName,
548
- u as getSubdivisions
31
+ s as getSubdivisions
549
32
  };
@@ -0,0 +1,22 @@
1
+ /**
2
+ * src/data/index.ts — Public exports for embedded reference data.
3
+ *
4
+ * Tree-shakeable: import only what you need.
5
+ *
6
+ * Phase 4 data modules:
7
+ * - countries.ts All 249 ISO 3166-1 alpha-2 countries (name, flag, dialCode)
8
+ * - states.ts State/province lists for 44 countries (from chromium i18n)
9
+ * - postalPatterns.ts Per-country postal regex (174 countries from chromium i18n)
10
+ * - countryConfig.ts CountryValidationConfig per country (lazy-built, cached)
11
+ *
12
+ * Backward-compat API (Phase 2 consumers):
13
+ * - countryData.ts Re-exports as CountryOption/SubdivisionOption shapes
14
+ */
15
+ export type { CountryRecord } from './countries';
16
+ export { COUNTRIES, getCountryByCode } from './countries';
17
+ export type { SubdivisionRecord } from './states';
18
+ export { SUBDIVISIONS, getSubdivisions } from './states';
19
+ export type { PostalPattern } from './postalPatterns';
20
+ export { POSTAL_PATTERNS, getPostalPattern } from './postalPatterns';
21
+ export { getCountryConfig, STATE_REQUIRED_CODES } from './countryConfig';
22
+ export { COUNTRY_OPTIONS, COUNTRY_CONFIGS, getCountryName, } from './countryData';
@@ -0,0 +1,22 @@
1
+ /**
2
+ * postalPatterns.ts — Per-country postal code regex patterns from Google libaddressinput.
3
+ *
4
+ * Auto-generated from resources/countries-data-analysis/all-countries-merged.json
5
+ * 174 countries have specific patterns. The remaining use generic OpenAPI fallback.
6
+ * Source: https://www.gstatic.com/chrome/autofill/libaddressinput/chromium-i18n/ssl-address/data/{CC}
7
+ */
8
+ export interface PostalPattern {
9
+ /** Regex pattern string (from chromium zip field) */
10
+ readonly pattern: string;
11
+ /** Example postal codes (from chromium zipex field) */
12
+ readonly examples: string;
13
+ /** HTML inputMode hint */
14
+ readonly inputMode: 'numeric' | 'text';
15
+ }
16
+ /**
17
+ * Postal patterns keyed by ISO 3166-1 alpha-2 country code.
18
+ * Countries not listed here use the generic OpenAPI fallback pattern.
19
+ */
20
+ export declare const POSTAL_PATTERNS: Readonly<Record<string, PostalPattern>>;
21
+ /** Get postal pattern for a country. Returns undefined if no specific pattern. */
22
+ export declare function getPostalPattern(countryCode: string): PostalPattern | undefined;