@hanzo/react 0.1.2 → 1.0.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 (52) hide show
  1. package/README.md +317 -53
  2. package/dist/index.d.mts +255 -0
  3. package/dist/index.d.ts +255 -0
  4. package/dist/index.js +548 -0
  5. package/dist/index.js.map +1 -0
  6. package/dist/index.mjs +539 -0
  7. package/dist/index.mjs.map +1 -0
  8. package/package.json +84 -91
  9. package/src/components/HanzoProvider.test.tsx +346 -0
  10. package/src/components/HanzoProvider.tsx +508 -0
  11. package/src/hooks/index.ts +39 -0
  12. package/src/hooks/types.ts +162 -0
  13. package/src/hooks/useAuth.ts +0 -0
  14. package/src/hooks/useComponent.ts +0 -0
  15. package/src/hooks/useGenerativeUI.ts +0 -0
  16. package/src/hooks/useMCP.ts +0 -0
  17. package/src/hooks/useMessage.ts +105 -0
  18. package/src/hooks/useModelConfig.ts +0 -0
  19. package/src/hooks/useStreaming.ts +161 -0
  20. package/src/hooks/useSuggestions.ts +0 -0
  21. package/src/hooks/useThread.ts +0 -0
  22. package/src/hooks/useTool.ts +0 -0
  23. package/src/index.ts +40 -0
  24. package/src/types/index.ts +25 -0
  25. package/src/utils/cn.ts +6 -0
  26. package/src/utils/id.ts +6 -0
  27. package/src/utils/stream.ts +33 -0
  28. package/LICENSE +0 -21
  29. package/dist/index.cjs.js +0 -15755
  30. package/dist/index.cjs.js.map +0 -1
  31. package/dist/index.css +0 -789
  32. package/dist/index.esm.js +0 -15736
  33. package/dist/index.esm.js.map +0 -1
  34. package/dist/index.umd.js +0 -15756
  35. package/dist/index.umd.js.map +0 -1
  36. package/src/controls/.DS_Store +0 -0
  37. package/src/controls/MUICheckbox.js +0 -108
  38. package/src/controls/MUIKeyboardDatePicker.js +0 -90
  39. package/src/controls/MUIPhone.js +0 -33
  40. package/src/controls/MUISwitch.js +0 -107
  41. package/src/controls/MUIText.js +0 -298
  42. package/src/controls/NumericFormats.js +0 -57
  43. package/src/controls/control.js +0 -148
  44. package/src/controls/index.js +0 -7
  45. package/src/controls/material-ui-phone-number/components/Item.js +0 -66
  46. package/src/controls/material-ui-phone-number/components/flags.css +0 -789
  47. package/src/controls/material-ui-phone-number/components/index.js +0 -884
  48. package/src/controls/material-ui-phone-number/components/polyfills.js +0 -82
  49. package/src/controls/material-ui-phone-number/country_data.js +0 -1536
  50. package/src/controls/material-ui-phone-number/index.js +0 -3
  51. package/src/index.js +0 -1
  52. /package/src/{core/index.js → hooks/useAttachments.ts} +0 -0
@@ -1,1536 +0,0 @@
1
- // Country model:
2
- // [
3
- // Country name,
4
- // Regions,
5
- // iso2 code,
6
- // International dial code,
7
- // Format (if available),
8
- // Order (if >1 country with same dial code),
9
- // Area codes (if >1 country with same dial code)
10
- // ]
11
- //
12
- // Regions:
13
- // ['america', 'europe', 'asia', 'oceania', 'africa']
14
- //
15
- // Sub-regions:
16
- // ['north-america', 'south-america', 'central-america', 'carribean',
17
- // 'european-union', 'ex-ussr', 'middle-east', 'north-africa']
18
-
19
- const rawAllCountries = [
20
- [
21
- 'Afghanistan',
22
- ['asia'],
23
- 'af',
24
- '93',
25
- ],
26
- [
27
- 'Albania',
28
- ['europe'],
29
- 'al',
30
- '355',
31
- ],
32
- [
33
- 'Algeria',
34
- ['africa', 'north-africa'],
35
- 'dz',
36
- '213',
37
- ],
38
- [
39
- 'American Samoa',
40
- ['oceania'],
41
- 'as',
42
- '1684',
43
- ],
44
- [
45
- 'Andorra',
46
- ['europe'],
47
- 'ad',
48
- '376',
49
- ],
50
- [
51
- 'Angola',
52
- ['africa'],
53
- 'ao',
54
- '244',
55
- ],
56
- [
57
- 'Anguilla',
58
- ['america', 'carribean'],
59
- 'ai',
60
- '1264',
61
- ],
62
- [
63
- 'Antigua and Barbuda',
64
- ['america', 'carribean'],
65
- 'ag',
66
- '1268',
67
- ],
68
- [
69
- 'Argentina',
70
- ['america', 'south-america'],
71
- 'ar',
72
- '54',
73
- '+.. (..) ........',
74
- ],
75
- [
76
- 'Armenia',
77
- ['asia', 'ex-ussr'],
78
- 'am',
79
- '374',
80
- ],
81
- [
82
- 'Aruba',
83
- ['america', 'carribean'],
84
- 'aw',
85
- '297',
86
- ],
87
- [
88
- 'Australia',
89
- ['oceania'],
90
- 'au',
91
- '61',
92
- '+.. ... ... ...',
93
- ],
94
- [
95
- 'Austria',
96
- ['europe', 'european-union'],
97
- 'at',
98
- '43',
99
- ],
100
- [
101
- 'Azerbaijan',
102
- ['asia', 'ex-ussr'],
103
- 'az',
104
- '994',
105
- ],
106
- [
107
- 'Bahamas',
108
- ['america', 'carribean'],
109
- 'bs',
110
- '1242',
111
- ],
112
- [
113
- 'Bahrain',
114
- ['middle-east'],
115
- 'bh',
116
- '973',
117
- ],
118
- [
119
- 'Bangladesh',
120
- ['asia'],
121
- 'bd',
122
- '880',
123
- ],
124
- [
125
- 'Barbados',
126
- ['america', 'carribean'],
127
- 'bb',
128
- '1246',
129
- ],
130
- [
131
- 'Belarus',
132
- ['europe', 'ex-ussr'],
133
- 'by',
134
- '375',
135
- '+... (..) ... .. ..',
136
- ],
137
- [
138
- 'Belgium',
139
- ['europe', 'european-union'],
140
- 'be',
141
- '32',
142
- '+.. ... .. .. ..',
143
- ],
144
- [
145
- 'Belize',
146
- ['america', 'central-america'],
147
- 'bz',
148
- '501',
149
- ],
150
- [
151
- 'Benin',
152
- ['africa'],
153
- 'bj',
154
- '229',
155
- ],
156
- [
157
- 'Bermuda',
158
- ['america', 'north-america'],
159
- 'bm',
160
- '1441',
161
- ],
162
- [
163
- 'Bhutan',
164
- ['asia'],
165
- 'bt',
166
- '975',
167
- ],
168
- [
169
- 'Bolivia',
170
- ['america', 'south-america'],
171
- 'bo',
172
- '591',
173
- ],
174
- [
175
- 'Bosnia and Herzegovina',
176
- ['europe'],
177
- 'ba',
178
- '387',
179
- ],
180
- [
181
- 'Botswana',
182
- ['africa'],
183
- 'bw',
184
- '267',
185
- ],
186
- [
187
- 'Brazil',
188
- ['america', 'south-america'],
189
- 'br',
190
- '55',
191
- '+.. (..) .........',
192
- ],
193
- [
194
- 'British Indian Ocean Territory',
195
- ['asia'],
196
- 'io',
197
- '246',
198
- ],
199
- [
200
- 'British Virgin Islands',
201
- ['america', 'carribean'],
202
- 'vg',
203
- '1284',
204
- ],
205
- [
206
- 'Brunei',
207
- ['asia'],
208
- 'bn',
209
- '673',
210
- ],
211
- [
212
- 'Bulgaria',
213
- ['europe', 'european-union'],
214
- 'bg',
215
- '359',
216
- ],
217
- [
218
- 'Burkina Faso',
219
- ['africa'],
220
- 'bf',
221
- '226',
222
- ],
223
- [
224
- 'Burundi',
225
- ['africa'],
226
- 'bi',
227
- '257',
228
- ],
229
- [
230
- 'Cambodia',
231
- ['asia'],
232
- 'kh',
233
- '855',
234
- ],
235
- [
236
- 'Cameroon',
237
- ['africa'],
238
- 'cm',
239
- '237',
240
- ],
241
- [
242
- 'Canada',
243
- ['america', 'north-america'],
244
- 'ca',
245
- '1',
246
- '+. (...) ...-....',
247
- 1, ['204', '236', '249', '250', '289', '306', '343', '365', '387', '403', '416', '418', '431', '437', '438', '450', '506', '514', '519', '548', '579', '581', '587', '604', '613', '639', '647', '672', '705', '709', '742', '778', '780', '782', '807', '819', '825', '867', '873', '902', '905'],
248
- ],
249
- [
250
- 'Cape Verde',
251
- ['africa'],
252
- 'cv',
253
- '238',
254
- ],
255
- [
256
- 'Caribbean Netherlands',
257
- ['america', 'carribean'],
258
- 'bq',
259
- '599',
260
- '',
261
- 1,
262
- ],
263
- [
264
- 'Cayman Islands',
265
- ['america', 'carribean'],
266
- 'ky',
267
- '1345',
268
- ],
269
- [
270
- 'Central African Republic',
271
- ['africa'],
272
- 'cf',
273
- '236',
274
- ],
275
- [
276
- 'Chad',
277
- ['africa'],
278
- 'td',
279
- '235',
280
- ],
281
- [
282
- 'Chile',
283
- ['america', 'south-america'],
284
- 'cl',
285
- '56',
286
- ],
287
- [
288
- 'China',
289
- ['asia'],
290
- 'cn',
291
- '86',
292
- '+.. ..-.........',
293
- ],
294
- [
295
- 'Colombia',
296
- ['america', 'south-america'],
297
- 'co',
298
- '57',
299
- ],
300
- [
301
- 'Comoros',
302
- ['africa'],
303
- 'km',
304
- '269',
305
- ],
306
- [
307
- 'Congo',
308
- ['africa'],
309
- 'cd',
310
- '243',
311
- ],
312
- [
313
- 'Congo',
314
- ['africa'],
315
- 'cg',
316
- '242',
317
- ],
318
- [
319
- 'Cook Islands',
320
- ['oceania'],
321
- 'ck',
322
- '682',
323
- ],
324
- [
325
- 'Costa Rica',
326
- ['america', 'central-america'],
327
- 'cr',
328
- '506',
329
- '+... ....-....',
330
- ],
331
- [
332
- 'Côte d’Ivoire',
333
- ['africa'],
334
- 'ci',
335
- '225',
336
- ],
337
- [
338
- 'Croatia',
339
- ['europe', 'european-union'],
340
- 'hr',
341
- '385',
342
- ],
343
- [
344
- 'Cuba',
345
- ['america', 'carribean'],
346
- 'cu',
347
- '53',
348
- ],
349
- [
350
- 'Curaçao',
351
- ['america', 'carribean'],
352
- 'cw',
353
- '599',
354
- '',
355
- 0,
356
- ],
357
- [
358
- 'Cyprus',
359
- ['europe', 'european-union'],
360
- 'cy',
361
- '357',
362
- '+... .. ......',
363
- ],
364
- [
365
- 'Czech Republic',
366
- ['europe', 'european-union'],
367
- 'cz',
368
- '420',
369
- ],
370
- [
371
- 'Denmark',
372
- ['europe', 'european-union'],
373
- 'dk',
374
- '45',
375
- '+.. .. .. .. ..',
376
- ],
377
- [
378
- 'Djibouti',
379
- ['africa'],
380
- 'dj',
381
- '253',
382
- ],
383
- [
384
- 'Dominica',
385
- ['america', 'carribean'],
386
- 'dm',
387
- '1767',
388
- ],
389
- [
390
- 'Dominican Republic',
391
- ['america', 'carribean'],
392
- 'do',
393
- '1',
394
- '',
395
- 2, ['809', '829', '849'],
396
- ],
397
- [
398
- 'Ecuador',
399
- ['america', 'south-america'],
400
- 'ec',
401
- '593',
402
- ],
403
- [
404
- 'Egypt',
405
- ['africa', 'north-africa'],
406
- 'eg',
407
- '20',
408
- ],
409
- [
410
- 'El Salvador',
411
- ['america', 'central-america'],
412
- 'sv',
413
- '503',
414
- '+... ....-....',
415
- ],
416
- [
417
- 'Equatorial Guinea',
418
- ['africa'],
419
- 'gq',
420
- '240',
421
- ],
422
- [
423
- 'Eritrea',
424
- ['africa'],
425
- 'er',
426
- '291',
427
- ],
428
- [
429
- 'Estonia',
430
- ['europe', 'european-union', 'ex-ussr'],
431
- 'ee',
432
- '372',
433
- '+... .... ......',
434
- ],
435
- [
436
- 'Ethiopia',
437
- ['africa'],
438
- 'et',
439
- '251',
440
- ],
441
- [
442
- 'Falkland Islands',
443
- ['america', 'south-america'],
444
- 'fk',
445
- '500',
446
- ],
447
- [
448
- 'Faroe Islands',
449
- ['europe'],
450
- 'fo',
451
- '298',
452
- ],
453
- [
454
- 'Fiji',
455
- ['oceania'],
456
- 'fj',
457
- '679',
458
- ],
459
- [
460
- 'Finland',
461
- ['europe', 'european-union'],
462
- 'fi',
463
- '358',
464
- '+... .. ... .. ..',
465
- ],
466
- [
467
- 'France',
468
- ['europe', 'european-union'],
469
- 'fr',
470
- '33',
471
- '+.. . .. .. .. ..',
472
- ],
473
- [
474
- 'French Guiana',
475
- ['america', 'south-america'],
476
- 'gf',
477
- '594',
478
- ],
479
- [
480
- 'French Polynesia',
481
- ['oceania'],
482
- 'pf',
483
- '689',
484
- ],
485
- [
486
- 'Gabon',
487
- ['africa'],
488
- 'ga',
489
- '241',
490
- ],
491
- [
492
- 'Gambia',
493
- ['africa'],
494
- 'gm',
495
- '220',
496
- ],
497
- [
498
- 'Georgia',
499
- ['asia', 'ex-ussr'],
500
- 'ge',
501
- '995',
502
- ],
503
- [
504
- 'Germany',
505
- ['europe', 'european-union'],
506
- 'de',
507
- '49',
508
- '+.. .... ........',
509
- ],
510
- [
511
- 'Ghana',
512
- ['africa'],
513
- 'gh',
514
- '233',
515
- ],
516
- [
517
- 'Gibraltar',
518
- ['europe'],
519
- 'gi',
520
- '350',
521
- ],
522
- [
523
- 'Greece',
524
- ['europe', 'european-union'],
525
- 'gr',
526
- '30',
527
- ],
528
- [
529
- 'Greenland',
530
- ['america'],
531
- 'gl',
532
- '299',
533
- ],
534
- [
535
- 'Grenada',
536
- ['america', 'carribean'],
537
- 'gd',
538
- '1473',
539
- ],
540
- [
541
- 'Guadeloupe',
542
- ['america', 'carribean'],
543
- 'gp',
544
- '590',
545
- '',
546
- 0,
547
- ],
548
- [
549
- 'Guam',
550
- ['oceania'],
551
- 'gu',
552
- '1671',
553
- ],
554
- [
555
- 'Guatemala',
556
- ['america', 'central-america'],
557
- 'gt',
558
- '502',
559
- '+... ....-....',
560
- ],
561
- [
562
- 'Guinea',
563
- ['africa'],
564
- 'gn',
565
- '224',
566
- ],
567
- [
568
- 'Guinea-Bissau',
569
- ['africa'],
570
- 'gw',
571
- '245',
572
- ],
573
- [
574
- 'Guyana',
575
- ['america', 'south-america'],
576
- 'gy',
577
- '592',
578
- ],
579
- [
580
- 'Haiti',
581
- ['america', 'carribean'],
582
- 'ht',
583
- '509',
584
- '+... ....-....',
585
- ],
586
- [
587
- 'Honduras',
588
- ['america', 'central-america'],
589
- 'hn',
590
- '504',
591
- ],
592
- [
593
- 'Hong Kong',
594
- ['asia'],
595
- 'hk',
596
- '852',
597
- '+... .... ....',
598
- ],
599
- [
600
- 'Hungary',
601
- ['europe', 'european-union'],
602
- 'hu',
603
- '36',
604
- ],
605
- [
606
- 'Iceland',
607
- ['europe'],
608
- 'is',
609
- '354',
610
- '+... ... ....',
611
- ],
612
- [
613
- 'India',
614
- ['asia'],
615
- 'in',
616
- '91',
617
- '+.. .....-.....',
618
- ],
619
- [
620
- 'Indonesia',
621
- ['asia'],
622
- 'id',
623
- '62',
624
- ],
625
- [
626
- 'Iran',
627
- ['middle-east'],
628
- 'ir',
629
- '98',
630
- ],
631
- [
632
- 'Iraq',
633
- ['middle-east'],
634
- 'iq',
635
- '964',
636
- ],
637
- [
638
- 'Ireland',
639
- ['europe', 'european-union'],
640
- 'ie',
641
- '353',
642
- '+... .. .......',
643
- ],
644
- [
645
- 'Israel',
646
- ['middle-east'],
647
- 'il',
648
- '972',
649
- '+... ... ... ....',
650
- ],
651
- [
652
- 'Italy',
653
- ['europe', 'european-union'],
654
- 'it',
655
- '39',
656
- '+.. ... .......',
657
- 0,
658
- ],
659
- [
660
- 'Jamaica',
661
- ['america', 'carribean'],
662
- 'jm',
663
- '1876',
664
- ],
665
- [
666
- 'Japan',
667
- ['asia'],
668
- 'jp',
669
- '81',
670
- '+.. .. .... ....',
671
- ],
672
- [
673
- 'Jordan',
674
- ['middle-east'],
675
- 'jo',
676
- '962',
677
- ],
678
- [
679
- 'Kazakhstan',
680
- ['asia', 'ex-ussr'],
681
- 'kz',
682
- '7',
683
- '+. ... ...-..-..',
684
- 1, ['313', '327', '7172', '312', '73622', '321', '324', '336', '318', '315', '325', '311', '326', '310'],
685
- ],
686
- [
687
- 'Kenya',
688
- ['africa'],
689
- 'ke',
690
- '254',
691
- ],
692
- [
693
- 'Kiribati',
694
- ['oceania'],
695
- 'ki',
696
- '686',
697
- ],
698
- [
699
- 'Kuwait',
700
- ['middle-east'],
701
- 'kw',
702
- '965',
703
- ],
704
- [
705
- 'Kyrgyzstan',
706
- ['asia', 'ex-ussr'],
707
- 'kg',
708
- '996',
709
- ],
710
- [
711
- 'Laos',
712
- ['asia'],
713
- 'la',
714
- '856',
715
- ],
716
- [
717
- 'Latvia',
718
- ['europe', 'european-union', 'ex-ussr'],
719
- 'lv',
720
- '371',
721
- ],
722
- [
723
- 'Lebanon',
724
- ['middle-east'],
725
- 'lb',
726
- '961',
727
- ],
728
- [
729
- 'Lesotho',
730
- ['africa'],
731
- 'ls',
732
- '266',
733
- ],
734
- [
735
- 'Liberia',
736
- ['africa'],
737
- 'lr',
738
- '231',
739
- ],
740
- [
741
- 'Libya',
742
- ['africa', 'north-africa'],
743
- 'ly',
744
- '218',
745
- ],
746
- [
747
- 'Liechtenstein',
748
- ['europe'],
749
- 'li',
750
- '423',
751
- ],
752
- [
753
- 'Lithuania',
754
- ['europe', 'european-union', 'ex-ussr'],
755
- 'lt',
756
- '370',
757
- ],
758
- [
759
- 'Luxembourg',
760
- ['europe', 'european-union'],
761
- 'lu',
762
- '352',
763
- ],
764
- [
765
- 'Macau',
766
- ['asia'],
767
- 'mo',
768
- '853',
769
- ],
770
- [
771
- 'Macedonia',
772
- ['europe'],
773
- 'mk',
774
- '389',
775
- ],
776
- [
777
- 'Madagascar',
778
- ['africa'],
779
- 'mg',
780
- '261',
781
- ],
782
- [
783
- 'Malawi',
784
- ['africa'],
785
- 'mw',
786
- '265',
787
- ],
788
- [
789
- 'Malaysia',
790
- ['asia'],
791
- 'my',
792
- '60',
793
- '+.. ..-....-....',
794
- ],
795
- [
796
- 'Maldives',
797
- ['asia'],
798
- 'mv',
799
- '960',
800
- ],
801
- [
802
- 'Mali',
803
- ['africa'],
804
- 'ml',
805
- '223',
806
- ],
807
- [
808
- 'Malta',
809
- ['europe', 'european-union'],
810
- 'mt',
811
- '356',
812
- ],
813
- [
814
- 'Marshall Islands',
815
- ['oceania'],
816
- 'mh',
817
- '692',
818
- ],
819
- [
820
- 'Martinique',
821
- ['america', 'carribean'],
822
- 'mq',
823
- '596',
824
- ],
825
- [
826
- 'Mauritania',
827
- ['africa'],
828
- 'mr',
829
- '222',
830
- ],
831
- [
832
- 'Mauritius',
833
- ['africa'],
834
- 'mu',
835
- '230',
836
- ],
837
- [
838
- 'Mexico',
839
- ['america', 'central-america'],
840
- 'mx',
841
- '52',
842
- ],
843
- [
844
- 'Micronesia',
845
- ['oceania'],
846
- 'fm',
847
- '691',
848
- ],
849
- [
850
- 'Moldova',
851
- ['europe'],
852
- 'md',
853
- '373',
854
- '+... (..) ..-..-..',
855
- ],
856
- [
857
- 'Monaco',
858
- ['europe'],
859
- 'mc',
860
- '377',
861
- ],
862
- [
863
- 'Mongolia',
864
- ['asia'],
865
- 'mn',
866
- '976',
867
- ],
868
- [
869
- 'Montenegro',
870
- ['europe'],
871
- 'me',
872
- '382',
873
- ],
874
- [
875
- 'Montserrat',
876
- ['america', 'carribean'],
877
- 'ms',
878
- '1664',
879
- ],
880
- [
881
- 'Morocco',
882
- ['africa', 'north-africa'],
883
- 'ma',
884
- '212',
885
- ],
886
- [
887
- 'Mozambique',
888
- ['africa'],
889
- 'mz',
890
- '258',
891
- ],
892
- [
893
- 'Myanmar',
894
- ['asia'],
895
- 'mm',
896
- '95',
897
- ],
898
- [
899
- 'Namibia',
900
- ['africa'],
901
- 'na',
902
- '264',
903
- ],
904
- [
905
- 'Nauru',
906
- ['africa'],
907
- 'nr',
908
- '674',
909
- ],
910
- [
911
- 'Nepal',
912
- ['asia'],
913
- 'np',
914
- '977',
915
- ],
916
- [
917
- 'Netherlands',
918
- ['europe', 'european-union'],
919
- 'nl',
920
- '31',
921
- '+.. .. ........',
922
- ],
923
- [
924
- 'New Caledonia',
925
- ['oceania'],
926
- 'nc',
927
- '687',
928
- ],
929
- [
930
- 'New Zealand',
931
- ['oceania'],
932
- 'nz',
933
- '64',
934
- '+.. ...-...-....',
935
- ],
936
- [
937
- 'Nicaragua',
938
- ['america', 'central-america'],
939
- 'ni',
940
- '505',
941
- ],
942
- [
943
- 'Niger',
944
- ['africa'],
945
- 'ne',
946
- '227',
947
- ],
948
- [
949
- 'Nigeria',
950
- ['africa'],
951
- 'ng',
952
- '234',
953
- ],
954
- [
955
- 'Niue',
956
- ['asia'],
957
- 'nu',
958
- '683',
959
- ],
960
- [
961
- 'Norfolk Island',
962
- ['oceania'],
963
- 'nf',
964
- '672',
965
- ],
966
- [
967
- 'North Korea',
968
- ['asia'],
969
- 'kp',
970
- '850',
971
- ],
972
- [
973
- 'Northern Mariana Islands',
974
- ['oceania'],
975
- 'mp',
976
- '1670',
977
- ],
978
- [
979
- 'Norway',
980
- ['europe'],
981
- 'no',
982
- '47',
983
- '+.. ... .. ...',
984
- ],
985
- [
986
- 'Oman',
987
- ['middle-east'],
988
- 'om',
989
- '968',
990
- ],
991
- [
992
- 'Pakistan',
993
- ['asia'],
994
- 'pk',
995
- '92',
996
- '+.. ...-.......',
997
- ],
998
- [
999
- 'Palau',
1000
- ['oceania'],
1001
- 'pw',
1002
- '680',
1003
- ],
1004
- [
1005
- 'Palestine',
1006
- ['middle-east'],
1007
- 'ps',
1008
- '970',
1009
- ],
1010
- [
1011
- 'Panama',
1012
- ['america', 'central-america'],
1013
- 'pa',
1014
- '507',
1015
- ],
1016
- [
1017
- 'Papua New Guinea',
1018
- ['oceania'],
1019
- 'pg',
1020
- '675',
1021
- ],
1022
- [
1023
- 'Paraguay',
1024
- ['america', 'south-america'],
1025
- 'py',
1026
- '595',
1027
- ],
1028
- [
1029
- 'Peru',
1030
- ['america', 'south-america'],
1031
- 'pe',
1032
- '51',
1033
- ],
1034
- [
1035
- 'Philippines',
1036
- ['asia'],
1037
- 'ph',
1038
- '63',
1039
- '+.. .... .......',
1040
- ],
1041
- [
1042
- 'Poland',
1043
- ['europe', 'european-union'],
1044
- 'pl',
1045
- '48',
1046
- '+.. ...-...-...',
1047
- ],
1048
- [
1049
- 'Portugal',
1050
- ['europe', 'european-union'],
1051
- 'pt',
1052
- '351',
1053
- ],
1054
- [
1055
- 'Puerto Rico',
1056
- ['america', 'carribean'],
1057
- 'pr',
1058
- '1',
1059
- '',
1060
- 3, ['787', '939'],
1061
- ],
1062
- [
1063
- 'Qatar',
1064
- ['middle-east'],
1065
- 'qa',
1066
- '974',
1067
- ],
1068
- [
1069
- 'Réunion',
1070
- ['africa'],
1071
- 're',
1072
- '262',
1073
- ],
1074
- [
1075
- 'Romania',
1076
- ['europe', 'european-union'],
1077
- 'ro',
1078
- '40',
1079
- ],
1080
- [
1081
- 'Russia',
1082
- ['europe', 'asia', 'ex-ussr'],
1083
- 'ru',
1084
- '7',
1085
- '+. (...) ...-..-..',
1086
- 0,
1087
- ],
1088
- [
1089
- 'Rwanda',
1090
- ['africa'],
1091
- 'rw',
1092
- '250',
1093
- ],
1094
- [
1095
- 'Saint Barthélemy',
1096
- ['america', 'carribean'],
1097
- 'bl',
1098
- '590',
1099
- '',
1100
- 1,
1101
- ],
1102
- [
1103
- 'Saint Helena',
1104
- ['africa'],
1105
- 'sh',
1106
- '290',
1107
- ],
1108
- [
1109
- 'Saint Kitts and Nevis',
1110
- ['america', 'carribean'],
1111
- 'kn',
1112
- '1869',
1113
- ],
1114
- [
1115
- 'Saint Lucia',
1116
- ['america', 'carribean'],
1117
- 'lc',
1118
- '1758',
1119
- ],
1120
- [
1121
- 'Saint Martin',
1122
- ['america', 'carribean'],
1123
- 'mf',
1124
- '590',
1125
- '',
1126
- 2,
1127
- ],
1128
- [
1129
- 'Saint Pierre and Miquelon',
1130
- ['america', 'north-america'],
1131
- 'pm',
1132
- '508',
1133
- ],
1134
- [
1135
- 'Saint Vincent and the Grenadines',
1136
- ['america', 'carribean'],
1137
- 'vc',
1138
- '1784',
1139
- ],
1140
- [
1141
- 'Samoa',
1142
- ['oceania'],
1143
- 'ws',
1144
- '685',
1145
- ],
1146
- [
1147
- 'San Marino',
1148
- ['europe'],
1149
- 'sm',
1150
- '378',
1151
- ],
1152
- [
1153
- 'São Tomé and Príncipe',
1154
- ['africa'],
1155
- 'st',
1156
- '239',
1157
- ],
1158
- [
1159
- 'Saudi Arabia',
1160
- ['middle-east'],
1161
- 'sa',
1162
- '966',
1163
- ],
1164
- [
1165
- 'Senegal',
1166
- ['africa'],
1167
- 'sn',
1168
- '221',
1169
- ],
1170
- [
1171
- 'Serbia',
1172
- ['europe'],
1173
- 'rs',
1174
- '381',
1175
- ],
1176
- [
1177
- 'Seychelles',
1178
- ['africa'],
1179
- 'sc',
1180
- '248',
1181
- ],
1182
- [
1183
- 'Sierra Leone',
1184
- ['africa'],
1185
- 'sl',
1186
- '232',
1187
- ],
1188
- [
1189
- 'Singapore',
1190
- ['asia'],
1191
- 'sg',
1192
- '65',
1193
- '+.. ....-....',
1194
- ],
1195
- [
1196
- 'Sint Maarten',
1197
- ['america', 'carribean'],
1198
- 'sx',
1199
- '1721',
1200
- ],
1201
- [
1202
- 'Slovakia',
1203
- ['europe', 'european-union'],
1204
- 'sk',
1205
- '421',
1206
- ],
1207
- [
1208
- 'Slovenia',
1209
- ['europe', 'european-union'],
1210
- 'si',
1211
- '386',
1212
- ],
1213
- [
1214
- 'Solomon Islands',
1215
- ['oceania'],
1216
- 'sb',
1217
- '677',
1218
- ],
1219
- [
1220
- 'Somalia',
1221
- ['africa'],
1222
- 'so',
1223
- '252',
1224
- ],
1225
- [
1226
- 'South Africa',
1227
- ['africa'],
1228
- 'za',
1229
- '27',
1230
- ],
1231
- [
1232
- 'South Korea',
1233
- ['asia'],
1234
- 'kr',
1235
- '82',
1236
- '+.. ... .... ....',
1237
- ],
1238
- [
1239
- 'South Sudan',
1240
- ['africa', 'north-africa'],
1241
- 'ss',
1242
- '211',
1243
- ],
1244
- [
1245
- 'Spain',
1246
- ['europe', 'european-union'],
1247
- 'es',
1248
- '34',
1249
- '+.. ... ... ...',
1250
- ],
1251
- [
1252
- 'Sri Lanka',
1253
- ['asia'],
1254
- 'lk',
1255
- '94',
1256
- ],
1257
- [
1258
- 'Sudan',
1259
- ['africa'],
1260
- 'sd',
1261
- '249',
1262
- ],
1263
- [
1264
- 'Suriname',
1265
- ['america', 'south-america'],
1266
- 'sr',
1267
- '597',
1268
- ],
1269
- [
1270
- 'Swaziland',
1271
- ['africa'],
1272
- 'sz',
1273
- '268',
1274
- ],
1275
- [
1276
- 'Sweden',
1277
- ['europe', 'european-union'],
1278
- 'se',
1279
- '46',
1280
- '+.. (..) ...-..-..',
1281
- ],
1282
- [
1283
- 'Switzerland',
1284
- ['europe'],
1285
- 'ch',
1286
- '41',
1287
- '+.. .. ... .. ..',
1288
- ],
1289
- [
1290
- 'Syria',
1291
- ['middle-east'],
1292
- 'sy',
1293
- '963',
1294
- ],
1295
- [
1296
- 'Taiwan',
1297
- ['asia'],
1298
- 'tw',
1299
- '886',
1300
- ],
1301
- [
1302
- 'Tajikistan',
1303
- ['asia', 'ex-ussr'],
1304
- 'tj',
1305
- '992',
1306
- ],
1307
- [
1308
- 'Tanzania',
1309
- ['africa'],
1310
- 'tz',
1311
- '255',
1312
- ],
1313
- [
1314
- 'Thailand',
1315
- ['asia'],
1316
- 'th',
1317
- '66',
1318
- ],
1319
- [
1320
- 'Timor-Leste',
1321
- ['asia'],
1322
- 'tl',
1323
- '670',
1324
- ],
1325
- [
1326
- 'Togo',
1327
- ['africa'],
1328
- 'tg',
1329
- '228',
1330
- ],
1331
- [
1332
- 'Tokelau',
1333
- ['oceania'],
1334
- 'tk',
1335
- '690',
1336
- ],
1337
- [
1338
- 'Tonga',
1339
- ['oceania'],
1340
- 'to',
1341
- '676',
1342
- ],
1343
- [
1344
- 'Trinidad and Tobago',
1345
- ['america', 'carribean'],
1346
- 'tt',
1347
- '1868',
1348
- ],
1349
- [
1350
- 'Tunisia',
1351
- ['africa', 'north-africa'],
1352
- 'tn',
1353
- '216',
1354
- ],
1355
- [
1356
- 'Turkey',
1357
- ['europe'],
1358
- 'tr',
1359
- '90',
1360
- '+.. ... ... .. ..',
1361
- ],
1362
- [
1363
- 'Turkmenistan',
1364
- ['asia', 'ex-ussr'],
1365
- 'tm',
1366
- '993',
1367
- ],
1368
- [
1369
- 'Turks and Caicos Islands',
1370
- ['america', 'carribean'],
1371
- 'tc',
1372
- '1649',
1373
- ],
1374
- [
1375
- 'Tuvalu',
1376
- ['asia'],
1377
- 'tv',
1378
- '688',
1379
- ],
1380
- [
1381
- 'U.S. Virgin Islands',
1382
- ['america', 'carribean'],
1383
- 'vi',
1384
- '1340',
1385
- ],
1386
- [
1387
- 'Uganda',
1388
- ['africa'],
1389
- 'ug',
1390
- '256',
1391
- ],
1392
- [
1393
- 'Ukraine',
1394
- ['europe', 'ex-ussr'],
1395
- 'ua',
1396
- '380',
1397
- '+... (..) ... .. ..',
1398
- ],
1399
- [
1400
- 'United Arab Emirates',
1401
- ['middle-east'],
1402
- 'ae',
1403
- '971',
1404
- ],
1405
- [
1406
- 'United Kingdom',
1407
- ['europe', 'european-union'],
1408
- 'gb',
1409
- '44',
1410
- '+.. .... ......',
1411
- ],
1412
- [
1413
- 'United States',
1414
- ['america', 'north-america'],
1415
- 'us',
1416
- '1',
1417
- '+. (...) ...-....',
1418
- 0, ['907', '205', '251', '256', '334', '479', '501', '870', '480', '520', '602', '623', '928', '209', '213', '310', '323', '408', '415', '510', '530', '559', '562', '619', '626', '650', '661', '707', '714', '760', '805', '818', '831', '858', '909', '916', '925', '949', '951', '303', '719', '970', '203', '860', '202', '302', '239', '305', '321', '352', '386', '407', '561', '727', '772', '813', '850', '863', '904', '941', '954', '229', '404', '478', '706', '770', '912', '808', '319', '515', '563', '641', '712', '208', '217', '309', '312', '618', '630', '708', '773', '815', '847', '219', '260', '317', '574', '765', '812', '316', '620', '785', '913', '270', '502', '606', '859', '225', '318', '337', '504', '985', '413', '508', '617', '781', '978', '301', '410', '207', '231', '248', '269', '313', '517', '586', '616', '734', '810', '906', '989', '218', '320', '507', '612', '651', '763', '952', '314', '417', '573', '636', '660', '816', '228', '601', '662', '406', '252', '336', '704', '828', '910', '919', '701', '308', '402', '603', '201', '609', '732', '856', '908', '973', '505', '575', '702', '775', '212', '315', '516', '518', '585', '607', '631', '716', '718', '845', '914', '216', '330', '419', '440', '513', '614', '740', '937', '405', '580', '918', '503', '541', '215', '412', '570', '610', '717', '724', '814', '401', '803', '843', '864', '605', '423', '615', '731', '865', '901', '931', '210', '214', '254', '281', '325', '361', '409', '432', '512', '713', '806', '817', '830', '903', '915', '936', '940', '956', '972', '979', '435', '801', '276', '434', '540', '703', '757', '804', '802', '206', '253', '360', '425', '509', '262', '414', '608', '715', '920', '304', '307'],
1419
- ],
1420
- [
1421
- 'Uruguay',
1422
- ['america', 'south-america'],
1423
- 'uy',
1424
- '598',
1425
- ],
1426
- [
1427
- 'Uzbekistan',
1428
- ['asia', 'ex-ussr'],
1429
- 'uz',
1430
- '998',
1431
- ],
1432
- [
1433
- 'Vanuatu',
1434
- ['oceania'],
1435
- 'vu',
1436
- '678',
1437
- ],
1438
- [
1439
- 'Vatican City',
1440
- ['europe'],
1441
- 'va',
1442
- '39',
1443
- '+.. .. .... ....',
1444
- 1,
1445
- ],
1446
- [
1447
- 'Venezuela',
1448
- ['america', 'south-america'],
1449
- 've',
1450
- '58',
1451
- ],
1452
- [
1453
- 'Vietnam',
1454
- ['asia'],
1455
- 'vn',
1456
- '84',
1457
- ],
1458
- [
1459
- 'Wallis and Futuna',
1460
- ['oceania'],
1461
- 'wf',
1462
- '681',
1463
- ],
1464
- [
1465
- 'Yemen',
1466
- ['middle-east'],
1467
- 'ye',
1468
- '967',
1469
- ],
1470
- [
1471
- 'Zambia',
1472
- ['africa'],
1473
- 'zm',
1474
- '260',
1475
- ],
1476
- [
1477
- 'Zimbabwe',
1478
- ['africa'],
1479
- 'zw',
1480
- '263',
1481
- ],
1482
- ];
1483
-
1484
- let allCountryCodes = {};
1485
-
1486
- function addCountryCode(iso2, dialCode, priority) {
1487
- if (!(dialCode in allCountryCodes)) {
1488
- allCountryCodes[dialCode] = [];
1489
- }
1490
- const index = priority || 0;
1491
- allCountryCodes[dialCode][index] = iso2;
1492
- }
1493
-
1494
- const allCountries = [].concat(...rawAllCountries.map((country) => {
1495
- const [name, regions, iso2, dialCode, format, priority, areaCodes] = country;
1496
-
1497
- const countryItem = {
1498
- name,
1499
- regions,
1500
- iso2,
1501
- dialCode,
1502
- priority,
1503
- format: format || undefined,
1504
- hasAreaCodes: areaCodes,
1505
- };
1506
-
1507
- const areaItems = [];
1508
-
1509
- if (countryItem.hasAreaCodes) {
1510
- areaCodes.forEach((areaCode) => {
1511
- const areaItem = {
1512
- ...countryItem,
1513
- regions,
1514
- dialCode: `${dialCode}${areaCode}`,
1515
- isAreaCode: true,
1516
- };
1517
-
1518
- areaItems.push(areaItem);
1519
-
1520
- addCountryCode(iso2, areaItem.dialCode);
1521
- });
1522
- }
1523
-
1524
- addCountryCode(
1525
- countryItem.iso2,
1526
- countryItem.dialCode,
1527
- countryItem.hasAreaCodes,
1528
- );
1529
-
1530
- return (areaItems.length > 0) ? [countryItem, ...areaItems] : [countryItem];
1531
- }));
1532
-
1533
- export default {
1534
- allCountries,
1535
- allCountryCodes,
1536
- }