@intl-tel-input/vue 28.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.
@@ -0,0 +1,2691 @@
1
+ import { computed as e, createElementBlock as t, defineComponent as n, getCurrentInstance as r, mergeProps as i, onMounted as a, onUnmounted as o, openBlock as s, ref as c, shallowRef as l, watch as u } from "vue";
2
+ //#region packages/core/dist/js/intlTelInput.mjs
3
+ var d = [
4
+ [
5
+ "af",
6
+ "93",
7
+ 0,
8
+ null,
9
+ "0"
10
+ ],
11
+ [
12
+ "ax",
13
+ "358",
14
+ 1,
15
+ ["18", "4"],
16
+ "0"
17
+ ],
18
+ [
19
+ "al",
20
+ "355",
21
+ 0,
22
+ null,
23
+ "0"
24
+ ],
25
+ [
26
+ "dz",
27
+ "213",
28
+ 0,
29
+ null,
30
+ "0"
31
+ ],
32
+ [
33
+ "as",
34
+ "1",
35
+ 5,
36
+ ["684"],
37
+ "1"
38
+ ],
39
+ ["ad", "376"],
40
+ ["ao", "244"],
41
+ [
42
+ "ai",
43
+ "1",
44
+ 6,
45
+ ["264"],
46
+ "1"
47
+ ],
48
+ [
49
+ "ag",
50
+ "1",
51
+ 7,
52
+ ["268"],
53
+ "1"
54
+ ],
55
+ [
56
+ "ar",
57
+ "54",
58
+ 0,
59
+ null,
60
+ "0"
61
+ ],
62
+ [
63
+ "am",
64
+ "374",
65
+ 0,
66
+ null,
67
+ "0"
68
+ ],
69
+ ["aw", "297"],
70
+ ["ac", "247"],
71
+ [
72
+ "au",
73
+ "61",
74
+ 0,
75
+ ["4"],
76
+ "0"
77
+ ],
78
+ [
79
+ "at",
80
+ "43",
81
+ 0,
82
+ null,
83
+ "0"
84
+ ],
85
+ [
86
+ "az",
87
+ "994",
88
+ 0,
89
+ null,
90
+ "0"
91
+ ],
92
+ [
93
+ "bs",
94
+ "1",
95
+ 8,
96
+ ["242"],
97
+ "1"
98
+ ],
99
+ ["bh", "973"],
100
+ [
101
+ "bd",
102
+ "880",
103
+ 0,
104
+ null,
105
+ "0"
106
+ ],
107
+ [
108
+ "bb",
109
+ "1",
110
+ 9,
111
+ ["246"],
112
+ "1"
113
+ ],
114
+ [
115
+ "by",
116
+ "375",
117
+ 0,
118
+ null,
119
+ "8"
120
+ ],
121
+ [
122
+ "be",
123
+ "32",
124
+ 0,
125
+ null,
126
+ "0"
127
+ ],
128
+ ["bz", "501"],
129
+ ["bj", "229"],
130
+ [
131
+ "bm",
132
+ "1",
133
+ 10,
134
+ ["441"],
135
+ "1"
136
+ ],
137
+ ["bt", "975"],
138
+ [
139
+ "bo",
140
+ "591",
141
+ 0,
142
+ null,
143
+ "0"
144
+ ],
145
+ [
146
+ "ba",
147
+ "387",
148
+ 0,
149
+ null,
150
+ "0"
151
+ ],
152
+ ["bw", "267"],
153
+ [
154
+ "br",
155
+ "55",
156
+ 0,
157
+ null,
158
+ "0"
159
+ ],
160
+ ["io", "246"],
161
+ [
162
+ "vg",
163
+ "1",
164
+ 11,
165
+ ["284"],
166
+ "1"
167
+ ],
168
+ ["bn", "673"],
169
+ [
170
+ "bg",
171
+ "359",
172
+ 0,
173
+ null,
174
+ "0"
175
+ ],
176
+ ["bf", "226"],
177
+ ["bi", "257"],
178
+ [
179
+ "kh",
180
+ "855",
181
+ 0,
182
+ null,
183
+ "0"
184
+ ],
185
+ ["cm", "237"],
186
+ [
187
+ "ca",
188
+ "1",
189
+ 1,
190
+ /* @__PURE__ */ "204.226.236.249.250.257.263.289.306.343.354.365.367.368.382.403.416.418.428.431.437.438.450.468.474.506.514.519.548.579.581.584.587.604.613.639.647.672.683.705.709.742.753.778.780.782.807.819.825.867.873.879.902.905.942".split("."),
191
+ "1"
192
+ ],
193
+ ["cv", "238"],
194
+ [
195
+ "bq",
196
+ "599",
197
+ 1,
198
+ [
199
+ "3",
200
+ "4",
201
+ "7"
202
+ ]
203
+ ],
204
+ [
205
+ "ky",
206
+ "1",
207
+ 12,
208
+ ["345"],
209
+ "1"
210
+ ],
211
+ ["cf", "236"],
212
+ ["td", "235"],
213
+ ["cl", "56"],
214
+ [
215
+ "cn",
216
+ "86",
217
+ 0,
218
+ null,
219
+ "0"
220
+ ],
221
+ [
222
+ "cx",
223
+ "61",
224
+ 2,
225
+ ["4", "89164"],
226
+ "0"
227
+ ],
228
+ [
229
+ "cc",
230
+ "61",
231
+ 1,
232
+ ["4", "89162"],
233
+ "0"
234
+ ],
235
+ [
236
+ "co",
237
+ "57",
238
+ 0,
239
+ null,
240
+ "0"
241
+ ],
242
+ ["km", "269"],
243
+ ["cg", "242"],
244
+ [
245
+ "cd",
246
+ "243",
247
+ 0,
248
+ null,
249
+ "0"
250
+ ],
251
+ ["ck", "682"],
252
+ ["cr", "506"],
253
+ ["ci", "225"],
254
+ [
255
+ "hr",
256
+ "385",
257
+ 0,
258
+ null,
259
+ "0"
260
+ ],
261
+ [
262
+ "cu",
263
+ "53",
264
+ 0,
265
+ null,
266
+ "0"
267
+ ],
268
+ [
269
+ "cw",
270
+ "599",
271
+ 0
272
+ ],
273
+ ["cy", "357"],
274
+ ["cz", "420"],
275
+ ["dk", "45"],
276
+ ["dj", "253"],
277
+ [
278
+ "dm",
279
+ "1",
280
+ 13,
281
+ ["767"],
282
+ "1"
283
+ ],
284
+ [
285
+ "do",
286
+ "1",
287
+ 2,
288
+ [
289
+ "809",
290
+ "829",
291
+ "849"
292
+ ],
293
+ "1"
294
+ ],
295
+ [
296
+ "ec",
297
+ "593",
298
+ 0,
299
+ null,
300
+ "0"
301
+ ],
302
+ [
303
+ "eg",
304
+ "20",
305
+ 0,
306
+ null,
307
+ "0"
308
+ ],
309
+ ["sv", "503"],
310
+ ["gq", "240"],
311
+ [
312
+ "er",
313
+ "291",
314
+ 0,
315
+ null,
316
+ "0"
317
+ ],
318
+ ["ee", "372"],
319
+ ["sz", "268"],
320
+ [
321
+ "et",
322
+ "251",
323
+ 0,
324
+ null,
325
+ "0"
326
+ ],
327
+ ["fk", "500"],
328
+ ["fo", "298"],
329
+ ["fj", "679"],
330
+ [
331
+ "fi",
332
+ "358",
333
+ 0,
334
+ ["4"],
335
+ "0"
336
+ ],
337
+ [
338
+ "fr",
339
+ "33",
340
+ 0,
341
+ null,
342
+ "0"
343
+ ],
344
+ [
345
+ "gf",
346
+ "594",
347
+ 0,
348
+ null,
349
+ "0"
350
+ ],
351
+ ["pf", "689"],
352
+ ["ga", "241"],
353
+ ["gm", "220"],
354
+ [
355
+ "ge",
356
+ "995",
357
+ 0,
358
+ null,
359
+ "0"
360
+ ],
361
+ [
362
+ "de",
363
+ "49",
364
+ 0,
365
+ null,
366
+ "0"
367
+ ],
368
+ [
369
+ "gh",
370
+ "233",
371
+ 0,
372
+ null,
373
+ "0"
374
+ ],
375
+ ["gi", "350"],
376
+ ["gr", "30"],
377
+ ["gl", "299"],
378
+ [
379
+ "gd",
380
+ "1",
381
+ 14,
382
+ ["473"],
383
+ "1"
384
+ ],
385
+ [
386
+ "gp",
387
+ "590",
388
+ 0,
389
+ null,
390
+ "0"
391
+ ],
392
+ [
393
+ "gu",
394
+ "1",
395
+ 15,
396
+ ["671"],
397
+ "1"
398
+ ],
399
+ ["gt", "502"],
400
+ [
401
+ "gg",
402
+ "44",
403
+ 1,
404
+ [
405
+ "1481",
406
+ "7781",
407
+ "7839",
408
+ "7911"
409
+ ],
410
+ "0"
411
+ ],
412
+ ["gn", "224"],
413
+ ["gw", "245"],
414
+ ["gy", "592"],
415
+ ["ht", "509"],
416
+ ["hn", "504"],
417
+ ["hk", "852"],
418
+ [
419
+ "hu",
420
+ "36",
421
+ 0,
422
+ null,
423
+ "06"
424
+ ],
425
+ ["is", "354"],
426
+ [
427
+ "in",
428
+ "91",
429
+ 0,
430
+ null,
431
+ "0"
432
+ ],
433
+ [
434
+ "id",
435
+ "62",
436
+ 0,
437
+ null,
438
+ "0"
439
+ ],
440
+ [
441
+ "ir",
442
+ "98",
443
+ 0,
444
+ null,
445
+ "0"
446
+ ],
447
+ [
448
+ "iq",
449
+ "964",
450
+ 0,
451
+ null,
452
+ "0"
453
+ ],
454
+ [
455
+ "ie",
456
+ "353",
457
+ 0,
458
+ null,
459
+ "0"
460
+ ],
461
+ [
462
+ "im",
463
+ "44",
464
+ 2,
465
+ [
466
+ "1624",
467
+ "74576",
468
+ "7524",
469
+ "7624",
470
+ "7924"
471
+ ],
472
+ "0"
473
+ ],
474
+ [
475
+ "il",
476
+ "972",
477
+ 0,
478
+ null,
479
+ "0"
480
+ ],
481
+ [
482
+ "it",
483
+ "39",
484
+ 0,
485
+ ["3"]
486
+ ],
487
+ [
488
+ "jm",
489
+ "1",
490
+ 4,
491
+ ["658", "876"],
492
+ "1"
493
+ ],
494
+ [
495
+ "jp",
496
+ "81",
497
+ 0,
498
+ null,
499
+ "0"
500
+ ],
501
+ [
502
+ "je",
503
+ "44",
504
+ 3,
505
+ [
506
+ "1534",
507
+ "7509",
508
+ "7700",
509
+ "7797",
510
+ "7829",
511
+ "7937"
512
+ ],
513
+ "0"
514
+ ],
515
+ [
516
+ "jo",
517
+ "962",
518
+ 0,
519
+ null,
520
+ "0"
521
+ ],
522
+ [
523
+ "kz",
524
+ "7",
525
+ 1,
526
+ ["33", "7"],
527
+ "8"
528
+ ],
529
+ [
530
+ "ke",
531
+ "254",
532
+ 0,
533
+ null,
534
+ "0"
535
+ ],
536
+ [
537
+ "ki",
538
+ "686",
539
+ 0,
540
+ null,
541
+ "0"
542
+ ],
543
+ [
544
+ "xk",
545
+ "383",
546
+ 0,
547
+ null,
548
+ "0"
549
+ ],
550
+ ["kw", "965"],
551
+ [
552
+ "kg",
553
+ "996",
554
+ 0,
555
+ null,
556
+ "0"
557
+ ],
558
+ [
559
+ "la",
560
+ "856",
561
+ 0,
562
+ null,
563
+ "0"
564
+ ],
565
+ ["lv", "371"],
566
+ [
567
+ "lb",
568
+ "961",
569
+ 0,
570
+ null,
571
+ "0"
572
+ ],
573
+ ["ls", "266"],
574
+ [
575
+ "lr",
576
+ "231",
577
+ 0,
578
+ null,
579
+ "0"
580
+ ],
581
+ [
582
+ "ly",
583
+ "218",
584
+ 0,
585
+ null,
586
+ "0"
587
+ ],
588
+ [
589
+ "li",
590
+ "423",
591
+ 0,
592
+ null,
593
+ "0"
594
+ ],
595
+ [
596
+ "lt",
597
+ "370",
598
+ 0,
599
+ null,
600
+ "0"
601
+ ],
602
+ ["lu", "352"],
603
+ ["mo", "853"],
604
+ [
605
+ "mg",
606
+ "261",
607
+ 0,
608
+ null,
609
+ "0"
610
+ ],
611
+ [
612
+ "mw",
613
+ "265",
614
+ 0,
615
+ null,
616
+ "0"
617
+ ],
618
+ [
619
+ "my",
620
+ "60",
621
+ 0,
622
+ null,
623
+ "0"
624
+ ],
625
+ ["mv", "960"],
626
+ ["ml", "223"],
627
+ ["mt", "356"],
628
+ [
629
+ "mh",
630
+ "692",
631
+ 0,
632
+ null,
633
+ "1"
634
+ ],
635
+ [
636
+ "mq",
637
+ "596",
638
+ 0,
639
+ null,
640
+ "0"
641
+ ],
642
+ ["mr", "222"],
643
+ ["mu", "230"],
644
+ [
645
+ "yt",
646
+ "262",
647
+ 1,
648
+ ["269", "639"],
649
+ "0"
650
+ ],
651
+ ["mx", "52"],
652
+ ["fm", "691"],
653
+ [
654
+ "md",
655
+ "373",
656
+ 0,
657
+ null,
658
+ "0"
659
+ ],
660
+ [
661
+ "mc",
662
+ "377",
663
+ 0,
664
+ null,
665
+ "0"
666
+ ],
667
+ [
668
+ "mn",
669
+ "976",
670
+ 0,
671
+ null,
672
+ "0"
673
+ ],
674
+ [
675
+ "me",
676
+ "382",
677
+ 0,
678
+ null,
679
+ "0"
680
+ ],
681
+ [
682
+ "ms",
683
+ "1",
684
+ 16,
685
+ ["664"],
686
+ "1"
687
+ ],
688
+ [
689
+ "ma",
690
+ "212",
691
+ 0,
692
+ ["6", "7"],
693
+ "0"
694
+ ],
695
+ ["mz", "258"],
696
+ [
697
+ "mm",
698
+ "95",
699
+ 0,
700
+ null,
701
+ "0"
702
+ ],
703
+ [
704
+ "na",
705
+ "264",
706
+ 0,
707
+ null,
708
+ "0"
709
+ ],
710
+ ["nr", "674"],
711
+ [
712
+ "np",
713
+ "977",
714
+ 0,
715
+ null,
716
+ "0"
717
+ ],
718
+ [
719
+ "nl",
720
+ "31",
721
+ 0,
722
+ null,
723
+ "0"
724
+ ],
725
+ ["nc", "687"],
726
+ [
727
+ "nz",
728
+ "64",
729
+ 0,
730
+ null,
731
+ "0"
732
+ ],
733
+ ["ni", "505"],
734
+ ["ne", "227"],
735
+ [
736
+ "ng",
737
+ "234",
738
+ 0,
739
+ null,
740
+ "0"
741
+ ],
742
+ ["nu", "683"],
743
+ ["nf", "672"],
744
+ [
745
+ "kp",
746
+ "850",
747
+ 0,
748
+ null,
749
+ "0"
750
+ ],
751
+ [
752
+ "mk",
753
+ "389",
754
+ 0,
755
+ null,
756
+ "0"
757
+ ],
758
+ [
759
+ "mp",
760
+ "1",
761
+ 17,
762
+ ["670"],
763
+ "1"
764
+ ],
765
+ [
766
+ "no",
767
+ "47",
768
+ 0,
769
+ ["4", "9"]
770
+ ],
771
+ ["om", "968"],
772
+ [
773
+ "pk",
774
+ "92",
775
+ 0,
776
+ null,
777
+ "0"
778
+ ],
779
+ ["pw", "680"],
780
+ [
781
+ "ps",
782
+ "970",
783
+ 0,
784
+ null,
785
+ "0"
786
+ ],
787
+ ["pa", "507"],
788
+ ["pg", "675"],
789
+ [
790
+ "py",
791
+ "595",
792
+ 0,
793
+ null,
794
+ "0"
795
+ ],
796
+ [
797
+ "pe",
798
+ "51",
799
+ 0,
800
+ null,
801
+ "0"
802
+ ],
803
+ [
804
+ "ph",
805
+ "63",
806
+ 0,
807
+ null,
808
+ "0"
809
+ ],
810
+ ["pl", "48"],
811
+ ["pt", "351"],
812
+ [
813
+ "pr",
814
+ "1",
815
+ 3,
816
+ ["787", "939"],
817
+ "1"
818
+ ],
819
+ ["qa", "974"],
820
+ [
821
+ "re",
822
+ "262",
823
+ 0,
824
+ null,
825
+ "0"
826
+ ],
827
+ [
828
+ "ro",
829
+ "40",
830
+ 0,
831
+ null,
832
+ "0"
833
+ ],
834
+ [
835
+ "ru",
836
+ "7",
837
+ 0,
838
+ ["33"],
839
+ "8"
840
+ ],
841
+ [
842
+ "rw",
843
+ "250",
844
+ 0,
845
+ null,
846
+ "0"
847
+ ],
848
+ ["ws", "685"],
849
+ ["sm", "378"],
850
+ ["st", "239"],
851
+ [
852
+ "sa",
853
+ "966",
854
+ 0,
855
+ null,
856
+ "0"
857
+ ],
858
+ ["sn", "221"],
859
+ [
860
+ "rs",
861
+ "381",
862
+ 0,
863
+ null,
864
+ "0"
865
+ ],
866
+ ["sc", "248"],
867
+ [
868
+ "sl",
869
+ "232",
870
+ 0,
871
+ null,
872
+ "0"
873
+ ],
874
+ ["sg", "65"],
875
+ [
876
+ "sx",
877
+ "1",
878
+ 21,
879
+ ["721"],
880
+ "1"
881
+ ],
882
+ [
883
+ "sk",
884
+ "421",
885
+ 0,
886
+ null,
887
+ "0"
888
+ ],
889
+ [
890
+ "si",
891
+ "386",
892
+ 0,
893
+ null,
894
+ "0"
895
+ ],
896
+ ["sb", "677"],
897
+ [
898
+ "so",
899
+ "252",
900
+ 0,
901
+ null,
902
+ "0"
903
+ ],
904
+ [
905
+ "za",
906
+ "27",
907
+ 0,
908
+ null,
909
+ "0"
910
+ ],
911
+ [
912
+ "kr",
913
+ "82",
914
+ 0,
915
+ null,
916
+ "0"
917
+ ],
918
+ [
919
+ "ss",
920
+ "211",
921
+ 0,
922
+ null,
923
+ "0"
924
+ ],
925
+ ["es", "34"],
926
+ [
927
+ "lk",
928
+ "94",
929
+ 0,
930
+ null,
931
+ "0"
932
+ ],
933
+ [
934
+ "bl",
935
+ "590",
936
+ 1,
937
+ null,
938
+ "0"
939
+ ],
940
+ ["sh", "290"],
941
+ [
942
+ "kn",
943
+ "1",
944
+ 18,
945
+ ["869"],
946
+ "1"
947
+ ],
948
+ [
949
+ "lc",
950
+ "1",
951
+ 19,
952
+ ["758"],
953
+ "1"
954
+ ],
955
+ [
956
+ "mf",
957
+ "590",
958
+ 2,
959
+ null,
960
+ "0"
961
+ ],
962
+ [
963
+ "pm",
964
+ "508",
965
+ 0,
966
+ null,
967
+ "0"
968
+ ],
969
+ [
970
+ "vc",
971
+ "1",
972
+ 20,
973
+ ["784"],
974
+ "1"
975
+ ],
976
+ [
977
+ "sd",
978
+ "249",
979
+ 0,
980
+ null,
981
+ "0"
982
+ ],
983
+ ["sr", "597"],
984
+ [
985
+ "sj",
986
+ "47",
987
+ 1,
988
+ [
989
+ "4",
990
+ "79",
991
+ "9"
992
+ ]
993
+ ],
994
+ [
995
+ "se",
996
+ "46",
997
+ 0,
998
+ null,
999
+ "0"
1000
+ ],
1001
+ [
1002
+ "ch",
1003
+ "41",
1004
+ 0,
1005
+ null,
1006
+ "0"
1007
+ ],
1008
+ [
1009
+ "sy",
1010
+ "963",
1011
+ 0,
1012
+ null,
1013
+ "0"
1014
+ ],
1015
+ [
1016
+ "tw",
1017
+ "886",
1018
+ 0,
1019
+ null,
1020
+ "0"
1021
+ ],
1022
+ ["tj", "992"],
1023
+ [
1024
+ "tz",
1025
+ "255",
1026
+ 0,
1027
+ null,
1028
+ "0"
1029
+ ],
1030
+ [
1031
+ "th",
1032
+ "66",
1033
+ 0,
1034
+ null,
1035
+ "0"
1036
+ ],
1037
+ ["tl", "670"],
1038
+ ["tg", "228"],
1039
+ ["tk", "690"],
1040
+ ["to", "676"],
1041
+ [
1042
+ "tt",
1043
+ "1",
1044
+ 22,
1045
+ ["868"],
1046
+ "1"
1047
+ ],
1048
+ ["tn", "216"],
1049
+ [
1050
+ "tr",
1051
+ "90",
1052
+ 0,
1053
+ null,
1054
+ "0"
1055
+ ],
1056
+ [
1057
+ "tm",
1058
+ "993",
1059
+ 0,
1060
+ null,
1061
+ "8"
1062
+ ],
1063
+ [
1064
+ "tc",
1065
+ "1",
1066
+ 23,
1067
+ ["649"],
1068
+ "1"
1069
+ ],
1070
+ ["tv", "688"],
1071
+ [
1072
+ "vi",
1073
+ "1",
1074
+ 24,
1075
+ ["340"],
1076
+ "1"
1077
+ ],
1078
+ [
1079
+ "ug",
1080
+ "256",
1081
+ 0,
1082
+ null,
1083
+ "0"
1084
+ ],
1085
+ [
1086
+ "ua",
1087
+ "380",
1088
+ 0,
1089
+ null,
1090
+ "0"
1091
+ ],
1092
+ [
1093
+ "ae",
1094
+ "971",
1095
+ 0,
1096
+ null,
1097
+ "0"
1098
+ ],
1099
+ [
1100
+ "gb",
1101
+ "44",
1102
+ 0,
1103
+ null,
1104
+ "0"
1105
+ ],
1106
+ [
1107
+ "us",
1108
+ "1",
1109
+ 0,
1110
+ null,
1111
+ "1"
1112
+ ],
1113
+ [
1114
+ "uy",
1115
+ "598",
1116
+ 0,
1117
+ null,
1118
+ "0"
1119
+ ],
1120
+ ["uz", "998"],
1121
+ ["vu", "678"],
1122
+ [
1123
+ "va",
1124
+ "39",
1125
+ 1,
1126
+ ["06698", "3"]
1127
+ ],
1128
+ [
1129
+ "ve",
1130
+ "58",
1131
+ 0,
1132
+ null,
1133
+ "0"
1134
+ ],
1135
+ [
1136
+ "vn",
1137
+ "84",
1138
+ 0,
1139
+ null,
1140
+ "0"
1141
+ ],
1142
+ ["wf", "681"],
1143
+ [
1144
+ "eh",
1145
+ "212",
1146
+ 1,
1147
+ [
1148
+ "5288",
1149
+ "5289",
1150
+ "6",
1151
+ "7"
1152
+ ],
1153
+ "0"
1154
+ ],
1155
+ [
1156
+ "ye",
1157
+ "967",
1158
+ 0,
1159
+ null,
1160
+ "0"
1161
+ ],
1162
+ [
1163
+ "zm",
1164
+ "260",
1165
+ 0,
1166
+ null,
1167
+ "0"
1168
+ ],
1169
+ [
1170
+ "zw",
1171
+ "263",
1172
+ 0,
1173
+ null,
1174
+ "0"
1175
+ ]
1176
+ ], f = [];
1177
+ for (let e of d) f.push({
1178
+ name: "",
1179
+ iso2: e[0],
1180
+ dialCode: e[1],
1181
+ priority: e[2] || 0,
1182
+ areaCodes: e[3] || null,
1183
+ nationalPrefix: e[4] || null
1184
+ });
1185
+ var p = new Set(f.map((e) => e.iso2)), m = (e) => p.has(e), h = f, g = {
1186
+ OPEN_COUNTRY_DROPDOWN: "open:countrydropdown",
1187
+ CLOSE_COUNTRY_DROPDOWN: "close:countrydropdown",
1188
+ COUNTRY_CHANGE: "countrychange",
1189
+ INPUT: "input",
1190
+ STRICT_REJECT: "strict:reject"
1191
+ }, _ = {
1192
+ HIDE: "iti__hide",
1193
+ V_HIDE: "iti__v-hide",
1194
+ ARROW_UP: "iti__arrow--up",
1195
+ GLOBE: "iti__globe",
1196
+ FLAG: "iti__flag",
1197
+ LOADING: "iti__loading",
1198
+ COUNTRY_ITEM: "iti__country",
1199
+ HIGHLIGHT: "iti__highlight"
1200
+ }, v = {
1201
+ ARROW_UP: "ArrowUp",
1202
+ ARROW_DOWN: "ArrowDown",
1203
+ SPACE: " ",
1204
+ ENTER: "Enter",
1205
+ ESC: "Escape",
1206
+ TAB: "Tab"
1207
+ }, y = {
1208
+ PASTE: "insertFromPaste",
1209
+ DELETE_FORWARD: "deleteContentForward"
1210
+ }, b = {
1211
+ ALPHA_UNICODE: /\p{L}/u,
1212
+ NON_PLUS_NUMERIC: /[^+0-9]/,
1213
+ NON_PLUS_NUMERIC_GLOBAL: /[^+0-9]/g,
1214
+ HIDDEN_SEARCH_CHAR: /^[a-zA-ZÀ-ÿа-яА-Я ]$/
1215
+ }, x = {
1216
+ SEARCH_DEBOUNCE_MS: 100,
1217
+ HIDDEN_SEARCH_RESET_MS: 1e3,
1218
+ NEXT_TICK: 0
1219
+ }, S = {
1220
+ NARROW_VIEWPORT_WIDTH: 500,
1221
+ FALLBACK_SELECTED_WITH_DIAL_WIDTH: 78,
1222
+ FALLBACK_SELECTED_NO_DIAL_WIDTH: 42,
1223
+ INPUT_PADDING_EXTRA_LEFT: 6,
1224
+ DROPDOWN_MARGIN: 3,
1225
+ FALLBACK_DROPDOWN_HEIGHT: 200
1226
+ }, C = {
1227
+ PLUS: "+",
1228
+ NANP: "1"
1229
+ }, w = {
1230
+ ISO2: "gb",
1231
+ DIAL_CODE: "44",
1232
+ MOBILE_PREFIX: "7",
1233
+ MOBILE_CORE_LENGTH: 10
1234
+ }, T = {
1235
+ ISO2: "us",
1236
+ DIAL_CODE: "1"
1237
+ }, E = {
1238
+ AGGRESSIVE: "aggressive",
1239
+ POLITE: "polite",
1240
+ OFF: "off"
1241
+ }, D = { AUTO: "auto" }, O = [
1242
+ "E164",
1243
+ "INTERNATIONAL",
1244
+ "NATIONAL",
1245
+ "RFC3966"
1246
+ ], k = [
1247
+ "FIXED_LINE",
1248
+ "MOBILE",
1249
+ "FIXED_LINE_OR_MOBILE",
1250
+ "TOLL_FREE",
1251
+ "PREMIUM_RATE",
1252
+ "SHARED_COST",
1253
+ "VOIP",
1254
+ "PERSONAL_NUMBER",
1255
+ "PAGER",
1256
+ "UAN",
1257
+ "VOICEMAIL",
1258
+ "UNKNOWN"
1259
+ ], A = [
1260
+ "IS_POSSIBLE",
1261
+ "INVALID_COUNTRY_CODE",
1262
+ "TOO_SHORT",
1263
+ "TOO_LONG",
1264
+ "IS_POSSIBLE_LOCAL_ONLY",
1265
+ "INVALID_LENGTH"
1266
+ ], j = (e) => Object.fromEntries(e.map((e) => [e, e])), M = j(O), N = j(k), P = j(A), F = {
1267
+ ISO2: "iso2",
1268
+ DIAL_CODE: "dialCode",
1269
+ INSTANCE_ID: "intlTelInputId"
1270
+ }, I = {
1271
+ EXPANDED: "aria-expanded",
1272
+ LABEL: "aria-label",
1273
+ SELECTED: "aria-selected",
1274
+ ACTIVE_DESCENDANT: "aria-activedescendant",
1275
+ HASPOPUP: "aria-haspopup",
1276
+ CONTROLS: "aria-controls",
1277
+ HIDDEN: "aria-hidden",
1278
+ AUTOCOMPLETE: "aria-autocomplete",
1279
+ MODAL: "aria-modal"
1280
+ }, ee = {
1281
+ selectedCountryAriaLabel: "Change country for phone number, currently selected ${countryName} (${dialCode})",
1282
+ noCountrySelected: "Select country for phone number",
1283
+ countryListAriaLabel: "List of countries",
1284
+ searchPlaceholder: "Search",
1285
+ clearSearchAriaLabel: "Clear search",
1286
+ searchEmptyState: "No results found",
1287
+ searchSummaryAria(e) {
1288
+ return e === 0 ? "No results found" : e === 1 ? "1 result found" : `${e} results found`;
1289
+ }
1290
+ }, L = (e) => typeof window < "u" && typeof window.matchMedia == "function" && window.matchMedia(e).matches, R = () => L(`(max-width: ${S.NARROW_VIEWPORT_WIDTH}px)`), z = {
1291
+ allowDropdown: !0,
1292
+ allowedNumberTypes: [N.MOBILE, N.FIXED_LINE],
1293
+ allowNumberExtensions: !1,
1294
+ allowPhonewords: !1,
1295
+ autoPlaceholder: E.POLITE,
1296
+ containerClass: "",
1297
+ countryNameLocale: "en",
1298
+ countryNameOverrides: {},
1299
+ countryOrder: null,
1300
+ countrySearch: !0,
1301
+ customPlaceholder: null,
1302
+ dropdownAlwaysOpen: !1,
1303
+ dropdownContainer: null,
1304
+ excludeCountries: null,
1305
+ fixDropdownWidth: !0,
1306
+ formatAsYouType: !0,
1307
+ formatOnDisplay: !0,
1308
+ geoIpLookup: null,
1309
+ hiddenInput: null,
1310
+ i18n: {},
1311
+ initialCountry: "",
1312
+ loadUtils: null,
1313
+ nationalMode: !0,
1314
+ onlyCountries: null,
1315
+ placeholderNumberType: N.MOBILE,
1316
+ searchInputClass: "",
1317
+ separateDialCode: !0,
1318
+ strictRejectAnimation: !0,
1319
+ showFlags: !0,
1320
+ strictMode: !0,
1321
+ useFullscreenPopup: (() => {
1322
+ if (typeof navigator < "u" && typeof window < "u") {
1323
+ let e = L("(max-height: 600px)"), t = L("(pointer: coarse)");
1324
+ return R() || t && e;
1325
+ }
1326
+ return !1;
1327
+ })()
1328
+ }, te = (e) => JSON.stringify(e), B = (e) => !!e && typeof e == "object" && !Array.isArray(e), ne = (e) => typeof e == "function", re = (e) => {
1329
+ if (!e || typeof e != "object") return !1;
1330
+ let t = e;
1331
+ return t.nodeType === 1 && typeof t.tagName == "string" && typeof t.appendChild == "function";
1332
+ }, V = new Set(Object.values(E)), H = (e) => {
1333
+ console.warn(`[intl-tel-input] ${e}`);
1334
+ }, U = (e, t, n) => {
1335
+ H(`Option '${e}' must be ${t}; got ${te(n)}. Ignoring.`);
1336
+ }, W = (e, t) => {
1337
+ let n = "an array of iso2 country code strings";
1338
+ if (!Array.isArray(t)) return U(e, n, t), !1;
1339
+ let r = [];
1340
+ for (let i of t) {
1341
+ if (typeof i != "string") return U(e, n, t), !1;
1342
+ m(i.toLowerCase()) ? r.push(i) : H(`Invalid iso2 code in '${e}': '${i}'. Skipping.`);
1343
+ }
1344
+ return r;
1345
+ }, ie = (e) => {
1346
+ if (e === void 0) return {};
1347
+ if (!B(e)) return H(`The second argument must be an options object; got ${te(e)}. Using defaults.`), {};
1348
+ let t = {};
1349
+ for (let [n, r] of Object.entries(e)) {
1350
+ if (!Object.hasOwn(z, n)) {
1351
+ H(`Unknown option '${n}'. Ignoring.`);
1352
+ continue;
1353
+ }
1354
+ switch (n) {
1355
+ case "allowDropdown":
1356
+ case "allowNumberExtensions":
1357
+ case "allowPhonewords":
1358
+ case "countrySearch":
1359
+ case "dropdownAlwaysOpen":
1360
+ case "fixDropdownWidth":
1361
+ case "formatAsYouType":
1362
+ case "formatOnDisplay":
1363
+ case "nationalMode":
1364
+ case "showFlags":
1365
+ case "separateDialCode":
1366
+ case "strictMode":
1367
+ case "strictRejectAnimation":
1368
+ case "useFullscreenPopup":
1369
+ if (typeof r != "boolean") {
1370
+ U(n, "a boolean", r);
1371
+ break;
1372
+ }
1373
+ t[n] = r;
1374
+ break;
1375
+ case "autoPlaceholder":
1376
+ if (typeof r != "string" || !V.has(r)) {
1377
+ U("autoPlaceholder", `one of ${Array.from(V).join(", ")}`, r);
1378
+ break;
1379
+ }
1380
+ t[n] = r;
1381
+ break;
1382
+ case "containerClass":
1383
+ case "searchInputClass":
1384
+ case "countryNameLocale":
1385
+ if (typeof r != "string") {
1386
+ U(n, "a string", r);
1387
+ break;
1388
+ }
1389
+ t[n] = r;
1390
+ break;
1391
+ case "countryOrder":
1392
+ if (r === null) t[n] = r;
1393
+ else {
1394
+ let e = W(n, r);
1395
+ e !== !1 && (t[n] = e);
1396
+ }
1397
+ break;
1398
+ case "customPlaceholder":
1399
+ case "geoIpLookup":
1400
+ case "hiddenInput":
1401
+ case "loadUtils":
1402
+ if (r !== null && !ne(r)) {
1403
+ U(n, "a function or null", r);
1404
+ break;
1405
+ }
1406
+ t[n] = r;
1407
+ break;
1408
+ case "dropdownContainer":
1409
+ if (r !== null && !re(r)) {
1410
+ U("dropdownContainer", "an HTMLElement or null", r);
1411
+ break;
1412
+ }
1413
+ t[n] = r;
1414
+ break;
1415
+ case "excludeCountries":
1416
+ case "onlyCountries":
1417
+ if (r === null) t[n] = r;
1418
+ else {
1419
+ let e = W(n, r);
1420
+ e !== !1 && (t[n] = e);
1421
+ }
1422
+ break;
1423
+ case "i18n":
1424
+ if (r && !B(r)) {
1425
+ U("i18n", "an object", r);
1426
+ break;
1427
+ }
1428
+ t[n] = r;
1429
+ break;
1430
+ case "countryNameOverrides":
1431
+ if (r && !B(r)) {
1432
+ U("countryNameOverrides", "an object", r);
1433
+ break;
1434
+ }
1435
+ t[n] = r;
1436
+ break;
1437
+ case "initialCountry": {
1438
+ if (typeof r != "string") {
1439
+ U("initialCountry", "a string", r);
1440
+ break;
1441
+ }
1442
+ let e = r.toLowerCase();
1443
+ if (e && e !== D.AUTO && !m(e)) {
1444
+ U("initialCountry", "a valid iso2 country code or 'auto'", r);
1445
+ break;
1446
+ }
1447
+ t[n] = r;
1448
+ break;
1449
+ }
1450
+ case "placeholderNumberType":
1451
+ if (typeof r != "string" || !k.includes(r)) {
1452
+ U("placeholderNumberType", `one of ${k.join(", ")}`, r);
1453
+ break;
1454
+ }
1455
+ t[n] = r;
1456
+ break;
1457
+ case "allowedNumberTypes":
1458
+ if (r !== null) {
1459
+ if (!Array.isArray(r)) {
1460
+ U("allowedNumberTypes", "an array of number types or null", r);
1461
+ break;
1462
+ }
1463
+ let e = !0;
1464
+ for (let t of r) if (typeof t != "string" || !k.includes(t)) {
1465
+ U("allowedNumberTypes", `an array of valid number types (${k.join(", ")})`, t), e = !1;
1466
+ break;
1467
+ }
1468
+ e && (t[n] = r);
1469
+ } else t[n] = null;
1470
+ break;
1471
+ }
1472
+ }
1473
+ return t;
1474
+ }, ae = (e) => {
1475
+ e.initialCountry &&= e.initialCountry.toLowerCase(), e.onlyCountries?.length && (e.onlyCountries = e.onlyCountries.map((e) => e.toLowerCase())), e.excludeCountries?.length && (e.excludeCountries = e.excludeCountries.map((e) => e.toLowerCase())), e.countryOrder &&= e.countryOrder.map((e) => e.toLowerCase());
1476
+ }, oe = (e) => {
1477
+ e.dropdownAlwaysOpen && (e.useFullscreenPopup = !1, e.allowDropdown = !0), e.useFullscreenPopup ? e.fixDropdownWidth = !1 : R() && (e.fixDropdownWidth = !0), e.onlyCountries?.length === 1 && (e.initialCountry = e.onlyCountries[0]), e.separateDialCode && (e.nationalMode = !1), e.allowDropdown && !e.showFlags && !e.separateDialCode && (e.nationalMode = !1), e.useFullscreenPopup && !e.dropdownContainer && (e.dropdownContainer = document.body), e.i18n = {
1478
+ ...ee,
1479
+ ...e.i18n
1480
+ };
1481
+ }, G = (e) => e.replace(/\D/g, ""), K = (e = "") => e.normalize("NFD").replace(/[\u0300-\u036f]/g, "").toLowerCase(), q = (e) => Object.keys(e).filter((t) => !!e[t]).join(" "), J = (e, t, n) => {
1482
+ let r = document.createElement(e);
1483
+ return t && Object.entries(t).forEach(([e, t]) => r.setAttribute(e, t)), n && n.appendChild(r), r;
1484
+ }, se = () => `
1485
+ <svg class="iti__search-icon-svg" width="14" height="14" viewBox="0 0 24 24" focusable="false" ${I.HIDDEN}="true">
1486
+ <circle cx="11" cy="11" r="7" />
1487
+ <line x1="21" y1="21" x2="16.65" y2="16.65" />
1488
+ </svg>`, ce = (e) => {
1489
+ let t = `iti-${e}-clear-mask`;
1490
+ return `
1491
+ <svg class="iti__search-clear-svg" width="12" height="12" viewBox="0 0 16 16" ${I.HIDDEN}="true" focusable="false">
1492
+ <mask id="${t}" maskUnits="userSpaceOnUse">
1493
+ <rect width="16" height="16" fill="white" />
1494
+ <path d="M5.2 5.2 L10.8 10.8 M10.8 5.2 L5.2 10.8" stroke="black" stroke-linecap="round" class="iti__search-clear-x" />
1495
+ </mask>
1496
+ <circle cx="8" cy="8" r="8" class="iti__search-clear-bg" mask="url(#${t})" />
1497
+ </svg>`;
1498
+ }, le = () => `
1499
+ <svg class="iti__country-check-svg" width="14" height="14" viewBox="0 0 16 16" fill="currentColor" focusable="false" ${I.HIDDEN}="true">
1500
+ <path d="M16 8A8 8 0 1 1 0 8a8 8 0 0 1 16 0m-3.97-3.03a.75.75 0 0 0-1.08.022L7.477 9.417 5.384 7.323a.75.75 0 0 0-1.06 1.06L6.97 11.03a.75.75 0 0 0 1.079-.02l3.992-4.99a.75.75 0 0 0-.01-1.05z"/>
1501
+ </svg>`, Y = () => "\n <svg width=\"256\" height=\"256\" viewBox=\"0 0 512 512\" class=\"iti__globe-svg\">\n <path d=\"M508 213a240 240 0 0 0-449-87l-2 5-2 5c-8 14-13 30-17 46a65 65 0 0 1 56 4c16-10 35-19 56-27l9-3c-6 23-10 48-10 74h-16l4 6c3 4 5 8 6 13h6c0 22 3 44 8 65l2 10-25-10-4 5 12 18 9 3 6 2 8 3 9 26 1 2 16-7h1l-5-13-1-2c24 6 49 9 75 10v26l11 10 7 7v-30l1-13c22 0 44-3 65-8l10-2-21 48-1 1a317 317 0 0 1-14 23l-21 5h-2c6 16 7 33 1 50a240 240 0 0 0 211-265m-401-56-11 6c19-44 54-79 98-98-11 20-21 44-29 69-21 6-40 15-58 23m154 182v4c-29-1-57-6-81-13-7-25-12-52-13-81h94zm0-109h-94c1-29 6-56 13-81 24-7 52-12 81-13zm0-112c-22 1-44 4-65 8l-10 2 12-30 9-17 1-2a332 332 0 0 1 13-23c13-4 26-6 40-7zm187 69 6 4c4 12 6 25 6 38v1h-68c-1-26-4-51-10-74l48 20 1 1 14 8zm-14-44 10 20c-20-11-43-21-68-29-8-25-18-49-29-69 37 16 67 44 87 78M279 49h1c13 1 27 3 39 7l14 23 1 2a343 343 0 0 1 12 26l2 5 6 16c-23-6-48-9-74-10h-1zm0 87h1c29 1 56 6 81 13 7 24 12 51 12 80v1h-94zm2 207h-2v-94h95c-1 29-6 56-13 81-24 7-51 12-80 13m86 60-20 10c11-20 21-43 29-68 25-8 48-18 68-29-16 37-43 67-77 87m87-115-7 5-16 9-2 1a337 337 0 0 1-47 21c6-24 9-49 10-75h68c0 13-2 27-6 39\"/>\n <path d=\"m261 428-2-2-22-21a40 40 0 0 0-32-11h-1a37 37 0 0 0-18 8l-1 1-4 2-2 2-5 4c-9-3-36-31-47-44s-32-45-34-55l3-2a151 151 0 0 0 11-9v-1a39 39 0 0 0 5-48l-3-3-11-19-3-4-5-7h-1l-3-3-4-3-5-2a35 35 0 0 0-16-3h-5c-4 1-14 5-24 11l-4 2-4 3-4 2c-9 8-17 17-18 27a380 380 0 0 0 212 259h3c12 0 25-10 36-21l10-12 6-11a39 39 0 0 0-8-40\"/>\n </svg>", ue = (e) => {
1502
+ let t = /* @__PURE__ */ new Map();
1503
+ for (let n of e) {
1504
+ let e = K(n.name), r = e.split(/[^a-z]/).map((e) => e[0]).join("");
1505
+ t.set(n.iso2, {
1506
+ normalisedName: e,
1507
+ initials: r,
1508
+ dialCodePlus: `+${n.dialCode}`
1509
+ });
1510
+ }
1511
+ return t;
1512
+ }, de = (e, t, n) => {
1513
+ let r = K(n), i = [], a = [], o = [], s = [], c = [], l = [];
1514
+ for (let n of e) {
1515
+ let e = t.get(n.iso2);
1516
+ n.iso2 === r ? i.push(n) : e.normalisedName.startsWith(r) ? a.push(n) : e.normalisedName.includes(r) ? o.push(n) : r === n.dialCode || r === e.dialCodePlus ? s.push(n) : e.dialCodePlus.includes(r) ? c.push(n) : e.initials.includes(r) && l.push(n);
1517
+ }
1518
+ let u = (e, t) => e.priority - t.priority;
1519
+ return [
1520
+ ...i,
1521
+ ...a,
1522
+ ...o,
1523
+ ...s.sort(u),
1524
+ ...c.sort(u),
1525
+ ...l
1526
+ ];
1527
+ }, fe = (e, t, n) => {
1528
+ let r = K(n);
1529
+ for (let n of e) {
1530
+ let { normalisedName: e } = t.get(n.iso2);
1531
+ if (e.startsWith(r)) return n;
1532
+ }
1533
+ return null;
1534
+ }, pe = class e {
1535
+ #e;
1536
+ static toAscii(e) {
1537
+ return e ? e.replace(/[٠-٩]/g, (e) => String.fromCharCode(48 + (e.charCodeAt(0) - 1632))).replace(/[۰-۹]/g, (e) => String.fromCharCode(48 + (e.charCodeAt(0) - 1776))) : "";
1538
+ }
1539
+ constructor(e) {
1540
+ e && this.#t(e);
1541
+ }
1542
+ #t(e) {
1543
+ /[٠-٩]/.test(e) ? this.#e = "arabic-indic" : /[۰-۹]/.test(e) ? this.#e = "persian" : this.#e = "ascii";
1544
+ }
1545
+ denormalise(e) {
1546
+ if (!this.#e || this.#e === "ascii") return e;
1547
+ let t = this.#e === "arabic-indic" ? 1632 : 1776;
1548
+ return e.replace(/[0-9]/g, (e) => String.fromCharCode(t + Number(e)));
1549
+ }
1550
+ normalise(t) {
1551
+ return t ? (this.#t(t), this.#e === "ascii" ? t : e.toAscii(t)) : "";
1552
+ }
1553
+ isAscii() {
1554
+ return !this.#e || this.#e === "ascii";
1555
+ }
1556
+ }, me = class e {
1557
+ #e;
1558
+ #t;
1559
+ #n;
1560
+ #r = "";
1561
+ #i;
1562
+ #a;
1563
+ #o = null;
1564
+ #s;
1565
+ #c;
1566
+ #l;
1567
+ #u;
1568
+ #d;
1569
+ #f;
1570
+ #p;
1571
+ #m;
1572
+ #h;
1573
+ #g;
1574
+ #_;
1575
+ #v;
1576
+ #y;
1577
+ #b;
1578
+ #x;
1579
+ #S;
1580
+ #C = null;
1581
+ #w = null;
1582
+ #T = /* @__PURE__ */ new Map();
1583
+ #E = null;
1584
+ telInputEl;
1585
+ hadInitialPlaceholder;
1586
+ constructor(e, t, n) {
1587
+ e.dataset[F.INSTANCE_ID] = n.toString(), this.telInputEl = e, this.#e = t, this.#t = n, this.hadInitialPlaceholder = !!e.getAttribute("placeholder"), this.#n = !!this.telInputEl.closest("[dir=rtl]"), this.#r = this.telInputEl.style.paddingLeft;
1588
+ }
1589
+ static validateInput(e) {
1590
+ let t = e?.tagName;
1591
+ if (!(e && typeof e == "object" && t === "INPUT" && typeof e.setAttribute == "function")) {
1592
+ let t = Object.prototype.toString.call(e);
1593
+ throw TypeError(`The first argument must be an HTMLInputElement, not ${t}`);
1594
+ }
1595
+ }
1596
+ buildMarkup(e, t) {
1597
+ this.#i = e, this.#a = t, this.telInputEl.classList.add("iti__tel-input"), this.telInputEl.hasAttribute("type") || this.telInputEl.setAttribute("type", "tel"), this.telInputEl.hasAttribute("autocomplete") || this.telInputEl.setAttribute("autocomplete", "tel"), this.telInputEl.hasAttribute("inputmode") || this.telInputEl.setAttribute("inputmode", "tel");
1598
+ let n = this.#D();
1599
+ this.#O(n), n.appendChild(this.telInputEl), this.#j(), this.#M(n), this.ensureDropdownWidthSet();
1600
+ }
1601
+ #D() {
1602
+ let { allowDropdown: e, showFlags: t, containerClass: n, useFullscreenPopup: r } = this.#e, i = J("div", { class: q({
1603
+ iti: !0,
1604
+ "iti--allow-dropdown": e,
1605
+ "iti--show-flags": t,
1606
+ "iti--inline-dropdown": !r,
1607
+ [n]: !!n
1608
+ }) });
1609
+ return this.#n && i.setAttribute("dir", "ltr"), this.telInputEl.before(i), i;
1610
+ }
1611
+ #O(e) {
1612
+ let { allowDropdown: t, separateDialCode: n, showFlags: r } = this.#e;
1613
+ if (!t && !r && !n) return;
1614
+ this.#c = J("div", { class: `iti__country-container ${_.V_HIDE}` }, e), t ? (this.#l = J("button", {
1615
+ type: "button",
1616
+ class: "iti__selected-country",
1617
+ [I.EXPANDED]: "false",
1618
+ [I.LABEL]: this.#e.i18n.noCountrySelected,
1619
+ [I.HASPOPUP]: "dialog",
1620
+ [I.CONTROLS]: `iti-${this.#t}__dropdown-content`
1621
+ }, this.#c), this.telInputEl.disabled && this.#l.setAttribute("disabled", "true")) : this.#l = J("div", { class: "iti__selected-country" }, this.#c);
1622
+ let i = J("div", { class: "iti__selected-country-primary" }, this.#l);
1623
+ this.#u = J("div", { class: _.FLAG }, i), t && (this.#f = J("div", {
1624
+ class: "iti__arrow",
1625
+ [I.HIDDEN]: "true"
1626
+ }, i)), n && (this.#d = J("div", { class: "iti__selected-dial-code" }, this.#l)), t && this.#k();
1627
+ }
1628
+ ensureDropdownWidthSet() {
1629
+ let { fixDropdownWidth: e, allowDropdown: t } = this.#e;
1630
+ if (!t || !e || this.#p.style.width) return;
1631
+ let n = this.telInputEl.offsetWidth;
1632
+ n > 0 && (this.#p.style.width = `${n}px`);
1633
+ }
1634
+ #k() {
1635
+ let { fixDropdownWidth: e, useFullscreenPopup: t, countrySearch: n, i18n: r, dropdownContainer: i, containerClass: a } = this.#e, o = e ? "" : "iti--flexible-dropdown-width";
1636
+ this.#p = J("div", {
1637
+ id: `iti-${this.#t}__dropdown-content`,
1638
+ class: `iti__dropdown-content ${_.HIDE} ${o}`,
1639
+ role: "dialog",
1640
+ [I.MODAL]: "true"
1641
+ }), this.#n && this.#p.setAttribute("dir", "rtl"), n && this.#A(), this.#_ = J("ul", {
1642
+ class: "iti__country-list",
1643
+ id: `iti-${this.#t}__country-listbox`,
1644
+ role: "listbox",
1645
+ [I.LABEL]: r.countryListAriaLabel
1646
+ }, this.#p), this.#N(), n && this.#R(), t || (this.#s = this.#L(), n && (this.#p.style.height = `${this.#s}px`)), i ? (this.#S = J("div", { class: q({
1647
+ iti: !0,
1648
+ "iti--container": !0,
1649
+ "iti--fullscreen-popup": t,
1650
+ "iti--inline-dropdown": !t,
1651
+ [a]: !!a
1652
+ }) }), this.#S.appendChild(this.#p)) : this.#c.appendChild(this.#p);
1653
+ }
1654
+ #A() {
1655
+ let { i18n: e, searchInputClass: t } = this.#e, n = J("div", { class: "iti__search-input-wrapper" }, this.#p);
1656
+ this.#m = J("span", {
1657
+ class: "iti__search-icon",
1658
+ [I.HIDDEN]: "true"
1659
+ }, n), this.#m.innerHTML = se(), this.#h = J("input", {
1660
+ id: `iti-${this.#t}__search-input`,
1661
+ type: "search",
1662
+ class: `iti__search-input ${t}`,
1663
+ placeholder: e.searchPlaceholder,
1664
+ role: "combobox",
1665
+ [I.EXPANDED]: "true",
1666
+ [I.LABEL]: e.searchPlaceholder,
1667
+ [I.CONTROLS]: `iti-${this.#t}__country-listbox`,
1668
+ [I.AUTOCOMPLETE]: "list",
1669
+ autocomplete: "off"
1670
+ }, n), this.#g = J("button", {
1671
+ type: "button",
1672
+ class: `iti__search-clear ${_.HIDE}`,
1673
+ [I.LABEL]: e.clearSearchAriaLabel,
1674
+ tabindex: "-1"
1675
+ }, n), this.#g.innerHTML = ce(this.#t), this.#x = J("span", { class: "iti__a11y-text" }, this.#p), this.#b = J("div", {
1676
+ class: `iti__no-results ${_.HIDE}`,
1677
+ [I.HIDDEN]: "true"
1678
+ }, this.#p), this.#b.textContent = e.searchEmptyState ?? null;
1679
+ }
1680
+ #j() {
1681
+ this.#c && (this.#P(), this.#c.classList.remove(_.V_HIDE));
1682
+ }
1683
+ #M(e) {
1684
+ let { hiddenInput: t } = this.#e;
1685
+ if (!t) return;
1686
+ let n = t(this.telInputEl.getAttribute("name") || "");
1687
+ if (n.phone) {
1688
+ let t = this.telInputEl.form?.querySelector(`input[name="${n.phone}"]`);
1689
+ t ? this.#v = t : (this.#v = J("input", {
1690
+ type: "hidden",
1691
+ name: n.phone
1692
+ }), e.appendChild(this.#v));
1693
+ }
1694
+ if (n.country) {
1695
+ let t = this.telInputEl.form?.querySelector(`input[name="${n.country}"]`);
1696
+ t ? this.#y = t : (this.#y = J("input", {
1697
+ type: "hidden",
1698
+ name: n.country
1699
+ }), e.appendChild(this.#y));
1700
+ }
1701
+ }
1702
+ #N() {
1703
+ let e = document.createDocumentFragment();
1704
+ for (let t = 0; t < this.#i.length; t++) {
1705
+ let n = this.#i[t], r = q({ [_.COUNTRY_ITEM]: !0 }), i = J("li", {
1706
+ id: `iti-${this.#t}__item-${n.iso2}`,
1707
+ class: r,
1708
+ tabindex: "-1",
1709
+ role: "option",
1710
+ [I.SELECTED]: "false"
1711
+ });
1712
+ i.dataset[F.DIAL_CODE] = n.dialCode, i.dataset[F.ISO2] = n.iso2, this.#T.set(n.iso2, i), this.#e.showFlags && J("div", { class: `${_.FLAG} iti__${n.iso2}` }, i);
1713
+ let a = J("span", { class: "iti__country-name" }, i);
1714
+ a.textContent = `${n.name} `;
1715
+ let o = J("span", { class: "iti__dial-code" }, a);
1716
+ this.#n && o.setAttribute("dir", "ltr"), o.textContent = `(+${n.dialCode})`, e.appendChild(i);
1717
+ }
1718
+ this.#_.appendChild(e);
1719
+ }
1720
+ #P() {
1721
+ if (this.#l) {
1722
+ let e = this.#e.separateDialCode ? S.FALLBACK_SELECTED_WITH_DIAL_WIDTH : S.FALLBACK_SELECTED_NO_DIAL_WIDTH, t = (this.#l.offsetWidth || this.#I() || e) + S.INPUT_PADDING_EXTRA_LEFT;
1723
+ this.telInputEl.style.paddingLeft = `${t}px`;
1724
+ }
1725
+ }
1726
+ static #F() {
1727
+ let e;
1728
+ try {
1729
+ e = window.top.document.body;
1730
+ } catch {
1731
+ e = document.body;
1732
+ }
1733
+ return e;
1734
+ }
1735
+ #I() {
1736
+ if (!this.telInputEl.parentNode) return 0;
1737
+ let t = e.#F(), n = this.telInputEl.parentNode.cloneNode(!1);
1738
+ n.style.visibility = "hidden", t.appendChild(n);
1739
+ let r = this.#c.cloneNode();
1740
+ n.appendChild(r);
1741
+ let i = this.#l.cloneNode(!0);
1742
+ r.appendChild(i);
1743
+ let a = i.offsetWidth;
1744
+ return t.removeChild(n), a;
1745
+ }
1746
+ #L() {
1747
+ let t = e.#F();
1748
+ this.#p.classList.remove(_.HIDE);
1749
+ let n = J("div", { class: "iti iti--inline-dropdown" });
1750
+ n.appendChild(this.#p), n.style.visibility = "hidden", t.appendChild(n);
1751
+ let r = this.#p.offsetHeight;
1752
+ return t.removeChild(n), n.style.visibility = "", this.#p.classList.add(_.HIDE), r > 0 ? r : S.FALLBACK_DROPDOWN_HEIGHT;
1753
+ }
1754
+ #R() {
1755
+ let { i18n: e } = this.#e, t = this.#_.childElementCount;
1756
+ this.#x.textContent = e.searchSummaryAria(t);
1757
+ }
1758
+ #z(e) {
1759
+ let t;
1760
+ if (e === "") t = this.#i;
1761
+ else {
1762
+ let n = pe.toAscii(e);
1763
+ t = de(this.#i, this.#a, n);
1764
+ }
1765
+ this.#ee(t);
1766
+ }
1767
+ prefillSearchWithPlus() {
1768
+ this.#h.value = "+", this.#h.focus(), this.#z("");
1769
+ }
1770
+ #B() {
1771
+ let e = this.#h.value.trim();
1772
+ this.#z(e), this.#h.value ? this.#g.classList.remove(_.HIDE) : this.#g.classList.add(_.HIDE);
1773
+ }
1774
+ #V() {
1775
+ this.#o && clearTimeout(this.#o), this.#o = setTimeout(() => {
1776
+ this.#B(), this.#o = null;
1777
+ }, x.SEARCH_DEBOUNCE_MS);
1778
+ }
1779
+ #H() {
1780
+ this.#h.value = "", this.#h.focus(), this.#B();
1781
+ }
1782
+ #U(e) {
1783
+ let t = this.#_, n = t.getBoundingClientRect(), r = e.getBoundingClientRect(), i = r.top - n.top + t.scrollTop;
1784
+ r.top < n.top ? t.scrollTop = i : r.bottom > n.bottom && (t.scrollTop = i - n.height + r.height);
1785
+ }
1786
+ #W(e, t = !0) {
1787
+ if (this.#w?.classList.remove(_.HIGHLIGHT), e) {
1788
+ if (e.classList.add(_.HIGHLIGHT), this.#e.countrySearch) {
1789
+ let t = e.getAttribute("id") || "";
1790
+ this.#h.setAttribute(I.ACTIVE_DESCENDANT, t);
1791
+ }
1792
+ t && this.#U(e), this.#w = e;
1793
+ } else this.#w = null;
1794
+ }
1795
+ bindHiddenInputSubmitListener(e, t, n) {
1796
+ let r = this.telInputEl.form;
1797
+ !r || !this.#v && !this.#y || r.addEventListener("submit", () => {
1798
+ this.#v && (this.#v.value = t()), this.#y && (this.#y.value = n());
1799
+ }, { signal: e });
1800
+ }
1801
+ bindAllInitialDropdownListeners(e, t, n) {
1802
+ let r = this.telInputEl.closest("label");
1803
+ r && r.addEventListener("click", (e) => {
1804
+ this.isDropdownOpen() ? e.preventDefault() : this.telInputEl.focus();
1805
+ }, { signal: e }), this.#l.addEventListener("click", () => {
1806
+ !this.isDropdownOpen() && !this.telInputEl.disabled && !this.telInputEl.readOnly && t();
1807
+ }, { signal: e }), this.#c.addEventListener("keydown", (e) => {
1808
+ let r = [
1809
+ v.ARROW_UP,
1810
+ v.ARROW_DOWN,
1811
+ v.SPACE,
1812
+ v.ENTER
1813
+ ];
1814
+ !this.isDropdownOpen() && r.includes(e.key) && (e.preventDefault(), e.stopPropagation(), t()), e.key === v.TAB && n();
1815
+ }, { signal: e });
1816
+ }
1817
+ openDropdown(e, t) {
1818
+ let { countrySearch: n, dropdownAlwaysOpen: r, dropdownContainer: i } = this.#e;
1819
+ if (this.#E = new AbortController(), this.ensureDropdownWidthSet(), i) this.#ne();
1820
+ else {
1821
+ let e = this.#te(), t = this.telInputEl.offsetHeight + S.DROPDOWN_MARGIN;
1822
+ e ? this.#p.style.top = `${t}px` : this.#p.style.bottom = `${t}px`;
1823
+ }
1824
+ this.#p.classList.remove(_.HIDE), this.#l.setAttribute(I.EXPANDED, "true");
1825
+ let a = this.#C ?? this.#_.firstElementChild;
1826
+ a && this.#W(a), n && !r && this.#h.focus(), this.#e.useFullscreenPopup && this.#S && window.visualViewport && window.visualViewport.addEventListener("resize", () => {
1827
+ this.#re(), this.#w && this.#U(this.#w);
1828
+ }, { signal: this.#E.signal }), this.#f.classList.add(_.ARROW_UP), this.#G(e, t);
1829
+ }
1830
+ #G(e, t) {
1831
+ let n = this.#E.signal;
1832
+ this.#K(n), this.#q(n, e), this.#e.dropdownAlwaysOpen || this.#J(n, t), this.#Y(n, e, t), this.#e.countrySearch && this.#X(n), !this.#e.useFullscreenPopup && this.#e.dropdownContainer && window.addEventListener("scroll", t, { signal: n });
1833
+ }
1834
+ #K(e) {
1835
+ this.#_.addEventListener("mouseover", (e) => {
1836
+ let t = e.target?.closest(`.${_.COUNTRY_ITEM}`);
1837
+ t && this.#W(t, !1);
1838
+ }, { signal: e });
1839
+ }
1840
+ #q(e, t) {
1841
+ this.#_.addEventListener("click", (e) => {
1842
+ let n = e.target?.closest(`.${_.COUNTRY_ITEM}`);
1843
+ n && t(n);
1844
+ }, { signal: e });
1845
+ }
1846
+ #J(e, t) {
1847
+ setTimeout(() => {
1848
+ document.documentElement.addEventListener("click", (e) => {
1849
+ this.#p.contains(e.target) || t();
1850
+ }, { signal: e });
1851
+ }, 0);
1852
+ }
1853
+ #Y(e, t, n) {
1854
+ let r = "", i = null;
1855
+ document.addEventListener("keydown", (e) => {
1856
+ [
1857
+ v.ARROW_UP,
1858
+ v.ARROW_DOWN,
1859
+ v.ENTER,
1860
+ v.ESC
1861
+ ].includes(e.key) && (e.preventDefault(), e.stopPropagation(), e.key === v.ARROW_UP || e.key === v.ARROW_DOWN ? this.#Q(e.key) : e.key === v.ENTER && !e.isComposing ? t(this.#w) : e.key === v.ESC && (n(), this.#l.focus())), !this.#e.countrySearch && e.target !== this.telInputEl && b.HIDDEN_SEARCH_CHAR.test(e.key) && (e.stopPropagation(), i && clearTimeout(i), r += e.key.toLowerCase(), this.#Z(r), i = setTimeout(() => {
1862
+ r = "";
1863
+ }, x.HIDDEN_SEARCH_RESET_MS));
1864
+ }, { signal: e });
1865
+ }
1866
+ #X(e) {
1867
+ this.#h.addEventListener("input", () => this.#V(), { signal: e }), this.#g.addEventListener("click", () => this.#H(), { signal: e });
1868
+ }
1869
+ #Z(e) {
1870
+ let t = fe(this.#i, this.#a, e);
1871
+ if (t) {
1872
+ let e = this.#T.get(t.iso2);
1873
+ this.#W(e);
1874
+ }
1875
+ }
1876
+ #Q(e) {
1877
+ let t = e === v.ARROW_UP ? this.#w?.previousElementSibling : this.#w?.nextElementSibling;
1878
+ !t && this.#_.childElementCount > 1 && (t = e === v.ARROW_UP ? this.#_.lastElementChild : this.#_.firstElementChild), t && this.#W(t);
1879
+ }
1880
+ #$(e) {
1881
+ if (this.#C && this.#C.dataset[F.ISO2] !== e && (this.#C.setAttribute(I.SELECTED, "false"), this.#C.querySelector(".iti__country-check")?.remove(), this.#C = null), e && !this.#C) {
1882
+ let t = this.#_.querySelector(`[data-iso2="${e}"]`);
1883
+ if (t) {
1884
+ t.setAttribute(I.SELECTED, "true");
1885
+ let e = J("span", {
1886
+ class: "iti__country-check",
1887
+ [I.HIDDEN]: "true"
1888
+ }, t);
1889
+ e.innerHTML = le(), this.#C = t, this.#e.dropdownAlwaysOpen && this.#W(t);
1890
+ }
1891
+ }
1892
+ }
1893
+ #ee(e) {
1894
+ this.#_.replaceChildren();
1895
+ let t = !0;
1896
+ for (let n of e) {
1897
+ let e = this.#T.get(n.iso2);
1898
+ e && (this.#_.appendChild(e), t &&= (this.#W(e, !1), !1));
1899
+ }
1900
+ t ? (this.#W(null), this.#b && this.#b.classList.remove(_.HIDE)) : this.#b && this.#b.classList.add(_.HIDE), this.#_.scrollTop = 0, this.#R();
1901
+ }
1902
+ closeDropdown() {
1903
+ let { countrySearch: e, dropdownContainer: t } = this.#e;
1904
+ this.#E.abort(), this.#E = null, this.#p.classList.add(_.HIDE), this.#l.setAttribute(I.EXPANDED, "false"), e && (this.#h.removeAttribute(I.ACTIVE_DESCENDANT), this.#h.value = "", this.#B(), this.#w &&= (this.#w.classList.remove(_.HIGHLIGHT), null)), this.#f.classList.remove(_.ARROW_UP), t ? (this.#S.remove(), this.#S.style.top = "", this.#S.style.bottom = "", this.#S.style.paddingLeft = "", this.#S.style.paddingRight = "") : (this.#p.style.top = "", this.#p.style.bottom = "");
1905
+ }
1906
+ #te() {
1907
+ if (this.#e.dropdownAlwaysOpen) return !0;
1908
+ let e = this.telInputEl.getBoundingClientRect(), t = e.top, n = window.innerHeight - e.bottom;
1909
+ return n >= this.#s || n >= t;
1910
+ }
1911
+ #ne() {
1912
+ let { dropdownContainer: e, useFullscreenPopup: t } = this.#e;
1913
+ if (t) {
1914
+ if (window.innerWidth >= S.NARROW_VIEWPORT_WIDTH) {
1915
+ let e = this.telInputEl.getBoundingClientRect();
1916
+ this.#S.style.paddingLeft = `${e.left}px`, this.#S.style.paddingRight = `${window.innerWidth - e.right}px`;
1917
+ }
1918
+ } else {
1919
+ let e = this.telInputEl.getBoundingClientRect();
1920
+ this.#S.style.left = `${e.left}px`, this.#te() ? this.#S.style.top = `${e.bottom + S.DROPDOWN_MARGIN}px` : (this.#S.style.top = "unset", this.#S.style.bottom = `${window.innerHeight - e.top + S.DROPDOWN_MARGIN}px`);
1921
+ }
1922
+ e.appendChild(this.#S);
1923
+ }
1924
+ #re() {
1925
+ let e = window.visualViewport;
1926
+ if (!e || !this.#S) return;
1927
+ let t = window.innerHeight - e.height;
1928
+ this.#S.style.bottom = `${t}px`;
1929
+ }
1930
+ isDropdownOpen() {
1931
+ return !this.#p.classList.contains(_.HIDE);
1932
+ }
1933
+ setLoading(e) {
1934
+ this.#u.classList.toggle(_.LOADING, e);
1935
+ }
1936
+ isLoading() {
1937
+ return this.#u.classList.contains(_.LOADING);
1938
+ }
1939
+ setDisabled(e) {
1940
+ this.telInputEl.disabled = e, this.#l && (e ? this.#l.setAttribute("disabled", "true") : this.#l.removeAttribute("disabled"));
1941
+ }
1942
+ setReadonly(e) {
1943
+ this.telInputEl.readOnly = e, this.#l && (e ? this.#l.setAttribute("disabled", "true") : this.#l.removeAttribute("disabled"));
1944
+ }
1945
+ setCountry(e) {
1946
+ let { allowDropdown: t, showFlags: n, separateDialCode: r, i18n: i } = this.#e, a = e?.name, o = e?.dialCode, s = e?.iso2 ?? "";
1947
+ if (t && this.#$(s), this.#l) {
1948
+ let e = s && n ? `${_.FLAG} iti__${s}` : `${_.FLAG} ${_.GLOBE}`, t, r, c;
1949
+ s ? (r = a, t = i.selectedCountryAriaLabel.replace("${countryName}", a).replace("${dialCode}", `+${o}`), c = n ? "" : Y()) : (r = i.noCountrySelected, t = i.noCountrySelected, c = Y()), this.#u.className = e, this.#l.setAttribute("title", r), this.#l.setAttribute(I.LABEL, t), this.#u.innerHTML = c;
1950
+ }
1951
+ if (r) {
1952
+ let e = o ? `+${o}` : "";
1953
+ this.#d.textContent = e, this.#P();
1954
+ }
1955
+ }
1956
+ destroy() {
1957
+ this.telInputEl.iti = void 0, delete this.telInputEl.dataset[F.INSTANCE_ID], this.telInputEl.style.paddingLeft = this.#r;
1958
+ let e = this.telInputEl.parentNode;
1959
+ e && (e.before(this.telInputEl), e.remove()), this.#T.clear();
1960
+ }
1961
+ }, he = (e) => {
1962
+ let { onlyCountries: t, excludeCountries: n } = e;
1963
+ return t?.length ? h.filter((e) => t.includes(e.iso2)) : n?.length ? h.filter((e) => !n.includes(e.iso2)) : [...h];
1964
+ }, ge = (e, t) => {
1965
+ let { countryNameLocale: n, countryNameOverrides: r } = t, i;
1966
+ try {
1967
+ i = typeof Intl < "u" && typeof Intl.DisplayNames == "function" ? new Intl.DisplayNames(n, { type: "region" }) : null;
1968
+ } catch (e) {
1969
+ console.error(e), i = null;
1970
+ }
1971
+ for (let t of e) t.name = r[t.iso2] || i?.of(t.iso2.toUpperCase()) || "";
1972
+ }, _e = (e) => {
1973
+ let t = /* @__PURE__ */ new Set(), n = 0, r = {}, i = (e, t) => {
1974
+ if (!e || !t) return;
1975
+ t.length > n && (n = t.length), Object.hasOwn(r, t) || (r[t] = []);
1976
+ let i = r[t];
1977
+ i.includes(e) || i.push(e);
1978
+ }, a = [...e].sort((e, t) => e.priority - t.priority);
1979
+ for (let e of a) {
1980
+ t.has(e.dialCode) || t.add(e.dialCode);
1981
+ for (let t = 1; t < e.dialCode.length; t++) {
1982
+ let n = e.dialCode.substring(0, t);
1983
+ i(e.iso2, n);
1984
+ }
1985
+ if (i(e.iso2, e.dialCode), e.areaCodes) {
1986
+ let t = r[e.dialCode][0];
1987
+ for (let n of e.areaCodes) {
1988
+ for (let r = 1; r < n.length; r++) {
1989
+ let a = n.substring(0, r), o = e.dialCode + a;
1990
+ i(t, o), i(e.iso2, o);
1991
+ }
1992
+ i(e.iso2, e.dialCode + n);
1993
+ }
1994
+ }
1995
+ }
1996
+ return {
1997
+ dialCodes: t,
1998
+ dialCodeMaxLength: n,
1999
+ dialCodeToIso2Map: r
2000
+ };
2001
+ }, ve = (e, t) => {
2002
+ let { countryOrder: n } = t;
2003
+ e.sort((e, t) => {
2004
+ if (n) {
2005
+ let r = n.indexOf(e.iso2), i = n.indexOf(t.iso2), a = r > -1, o = i > -1;
2006
+ if (a || o) return a && o ? r - i : a ? -1 : 1;
2007
+ }
2008
+ return e.name.localeCompare(t.name);
2009
+ });
2010
+ }, ye = /* @__PURE__ */ new Set([
2011
+ "800",
2012
+ "808",
2013
+ "870",
2014
+ "881",
2015
+ "882",
2016
+ "883",
2017
+ "888",
2018
+ "979"
2019
+ ]), be = (e) => {
2020
+ let t = G(e).slice(0, 3);
2021
+ return e.startsWith("+") && ye.has(t);
2022
+ }, xe = (e, t, n, r) => {
2023
+ if (!n || !t) return e;
2024
+ let i = `+${r.dialCode}`, a = e[i.length] === " " || e[i.length] === "-" ? i.length + 1 : i.length;
2025
+ return e.substring(a);
2026
+ }, Se = (e, t, n, r, i) => {
2027
+ let a = n ? n.formatNumberAsYouType(e, r?.iso2) : e, o = r?.dialCode;
2028
+ return i && t.charAt(0) !== "+" && a.includes(`+${o}`) ? (a.split(`+${o}`)[1] || "").trim() : a;
2029
+ }, Ce = (e, t, n, r) => {
2030
+ if (n === 0 && !r) return 0;
2031
+ let i = 0;
2032
+ for (let n = 0; n < t.length; n++) {
2033
+ if (/[+0-9]/.test(t[n]) && i++, i === e && !r) return n + 1;
2034
+ if (r && i === e + 1) return n;
2035
+ }
2036
+ return t.length;
2037
+ }, we = /* @__PURE__ */ new Set([
2038
+ "800",
2039
+ "822",
2040
+ "833",
2041
+ "844",
2042
+ "855",
2043
+ "866",
2044
+ "877",
2045
+ "880",
2046
+ "881",
2047
+ "882",
2048
+ "883",
2049
+ "884",
2050
+ "885",
2051
+ "886",
2052
+ "887",
2053
+ "888",
2054
+ "889"
2055
+ ]), Te = (e) => {
2056
+ let t = G(e);
2057
+ if (t.startsWith(C.NANP) && t.length >= 4) {
2058
+ let e = t.substring(1, 4);
2059
+ return we.has(e);
2060
+ }
2061
+ return !1;
2062
+ }, Ee = 0, X = (e) => {
2063
+ if (!Q.utils) throw Error(`intlTelInput.utils is required for ${e}(). See: https://intl-tel-input.com/docs/utils`);
2064
+ }, De = () => {
2065
+ let e, t;
2066
+ return {
2067
+ promise: new Promise((n, r) => {
2068
+ e = n, t = r;
2069
+ }),
2070
+ resolve: e,
2071
+ reject: t
2072
+ };
2073
+ }, Z = class e {
2074
+ id;
2075
+ promise;
2076
+ #e;
2077
+ #t;
2078
+ #n;
2079
+ #r;
2080
+ #i;
2081
+ #a;
2082
+ #o;
2083
+ #s;
2084
+ #c;
2085
+ #l = null;
2086
+ #u = null;
2087
+ #d;
2088
+ #f = !0;
2089
+ #p;
2090
+ #m;
2091
+ #h = !1;
2092
+ #g;
2093
+ #_;
2094
+ constructor(e, t = {}) {
2095
+ this.id = Ee++, me.validateInput(e);
2096
+ let n = ie(t);
2097
+ this.#t = {
2098
+ ...z,
2099
+ ...n
2100
+ }, ae(this.#t), oe(this.#t), this.#e = new me(e, this.#t, this.id), this.#n = typeof navigator < "u" && /Android/i.test(navigator.userAgent), this.#m = new pe(e.value), this.promise = this.#b(this.#t), this.#r = he(this.#t);
2101
+ let { dialCodes: r, dialCodeMaxLength: i, dialCodeToIso2Map: a } = _e(this.#r);
2102
+ this.#o = r, this.#i = i, this.#a = a, this.#s = new Map(this.#r.map((e) => [e.iso2, e])), this.#x();
2103
+ }
2104
+ #v() {
2105
+ let e = this.#e.telInputEl.value.trim();
2106
+ return this.#m.normalise(e);
2107
+ }
2108
+ #y(e) {
2109
+ this.#e.telInputEl.value = this.#m.denormalise(e);
2110
+ }
2111
+ #b(e) {
2112
+ let { initialCountry: t, geoIpLookup: n, loadUtils: r } = e, i = t === D.AUTO && !!n, a = !!r && !Q.utils;
2113
+ return i && (this.#g = De()), a && (this.#_ = De()), Promise.all([this.#g?.promise, this.#_?.promise]).then(() => {});
2114
+ }
2115
+ #x() {
2116
+ this.#p = new AbortController(), this.#S(), this.#e.buildMarkup(this.#r, this.#c), this.#C(), this.#w(), this.#T(), this.#t.dropdownAlwaysOpen && this.#U();
2117
+ }
2118
+ #S() {
2119
+ ge(this.#r, this.#t), ve(this.#r, this.#t), this.#c = ue(this.#r);
2120
+ }
2121
+ #C(e = !1) {
2122
+ let t = this.#e.telInputEl.getAttribute("value"), n = this.#m.normalise(t ?? ""), r = this.#v(), i = n && n.startsWith("+") && (!r || !r.startsWith("+")) ? n : r, a = this.#te(i), o = Te(i), { initialCountry: s, geoIpLookup: c } = this.#t, l = s === D.AUTO && c, u = l && Q.autoCountry ? Q.autoCountry : s, d = l && !e && !Q.autoCountry, f = m(u);
2123
+ a ? o ? f ? this.#Y(u) : d || this.#Y(T.ISO2) : (f && this.#Y(u), this.#G(i)) : f ? this.#Y(u) : d || this.#Y(""), i && this.#W(i);
2124
+ }
2125
+ #w() {
2126
+ this.#k(), this.#t.allowDropdown && this.#e.bindAllInitialDropdownListeners(this.#p.signal, () => this.#U(), () => this.#$()), this.#e.bindHiddenInputSubmitListener(this.#p.signal, () => this.getNumber(), () => this.#l?.iso2 || "");
2127
+ }
2128
+ #T() {
2129
+ if (this.#_) {
2130
+ let { loadUtils: e } = this.#t, t = () => {
2131
+ Q.attachUtils(e).catch(() => {});
2132
+ };
2133
+ Q.documentReady() ? t() : window.addEventListener("load", t, { signal: this.#p.signal });
2134
+ }
2135
+ this.#g && (this.#l ? this.#g.resolve() : this.#E());
2136
+ }
2137
+ async #E() {
2138
+ if (Q.autoCountry) {
2139
+ this.#oe();
2140
+ return;
2141
+ }
2142
+ if (this.#e.setLoading(!0), !Q.startedLoadingAutoCountry && (Q.startedLoadingAutoCountry = !0, typeof this.#t.geoIpLookup == "function")) try {
2143
+ let t = await this.#t.geoIpLookup(), n = typeof t == "string" ? t.toLowerCase() : "";
2144
+ if (!m(n)) {
2145
+ e.forEachInstance("handleAutoCountryFailure");
2146
+ return;
2147
+ }
2148
+ Q.autoCountry = n, setTimeout(() => e.forEachInstance("handleAutoCountryLoaded"));
2149
+ } catch {
2150
+ e.forEachInstance("handleAutoCountryFailure");
2151
+ }
2152
+ }
2153
+ #D() {
2154
+ this.#U(), this.#e.prefillSearchWithPlus();
2155
+ }
2156
+ #O(e) {
2157
+ let t = this.#e.telInputEl.selectionStart || 0, n = e.substring(0, t - 1), r = e.substring(t);
2158
+ return this.#y(n + r), t - 1;
2159
+ }
2160
+ #k() {
2161
+ this.#P(), this.#I(), this.#R();
2162
+ }
2163
+ #A(e) {
2164
+ this.#O(e), this.#D();
2165
+ }
2166
+ #j(e, t) {
2167
+ let n = this.#O(e);
2168
+ this.#e.telInputEl.setSelectionRange(n, n), this.#V(), this.#H(g.STRICT_REJECT, {
2169
+ source: "key",
2170
+ rejectedInput: t,
2171
+ reason: "invalid"
2172
+ });
2173
+ }
2174
+ #M(e, t) {
2175
+ let n = this.#e.telInputEl.selectionStart || 0, r = e.substring(0, n).replace(b.NON_PLUS_NUMERIC_GLOBAL, "").length, i = Se(this.#re(), e, Q.utils, this.#l, this.#t.separateDialCode), a = Ce(r, i, n, t);
2176
+ this.#y(i), this.#e.telInputEl.setSelectionRange(a, a);
2177
+ }
2178
+ #N(e) {
2179
+ if (e.startsWith("+") && this.#l && this.#te(e)) {
2180
+ let t = xe(e, !0, !0, this.#l);
2181
+ this.#y(t);
2182
+ }
2183
+ }
2184
+ #P() {
2185
+ this.#h = b.ALPHA_UNICODE.test(this.#v()), this.#e.telInputEl.addEventListener("input", this.#F, { signal: this.#p.signal });
2186
+ }
2187
+ #F = (e) => {
2188
+ let { strictMode: t, formatAsYouType: n, separateDialCode: r, allowDropdown: i, countrySearch: a } = this.#t, o = e?.detail;
2189
+ if (o?.isCountryChange) return;
2190
+ let s = this.#v();
2191
+ if (this.#n && e?.data === "+" && r && i && a) {
2192
+ this.#A(s);
2193
+ return;
2194
+ }
2195
+ if (this.#n && t && (e?.data === " " || e?.data === "-" || e?.data === ".")) {
2196
+ this.#j(s, e.data);
2197
+ return;
2198
+ }
2199
+ this.#G(s) && this.#ae();
2200
+ let c = e?.data && b.NON_PLUS_NUMERIC.test(e.data), l = e?.inputType === y.PASTE && s;
2201
+ c || l && !t ? this.#h = !0 : b.NON_PLUS_NUMERIC.test(s) || (this.#h = !1), n && !this.#h && !o?.isSetNumber && this.#m.isAscii() && this.#M(s, e?.inputType === y.DELETE_FORWARD), r && this.#N(s);
2202
+ };
2203
+ #I() {
2204
+ let { strictMode: e, separateDialCode: t } = this.#t;
2205
+ !e && !t || this.#e.telInputEl.addEventListener("keydown", this.#L, { signal: this.#p.signal });
2206
+ }
2207
+ #L = (e) => {
2208
+ let { strictMode: t, separateDialCode: n, allowDropdown: r, countrySearch: i } = this.#t;
2209
+ if (!e.key || e.key.length !== 1 || e.altKey || e.ctrlKey || e.metaKey) return;
2210
+ if (n && r && i && e.key === "+") {
2211
+ e.preventDefault(), this.#D();
2212
+ return;
2213
+ }
2214
+ if (!t) return;
2215
+ let a = this.#v(), o = !a.startsWith("+") && this.#e.telInputEl.selectionStart === 0 && e.key === "+", s = this.#m.normalise(e.key), c = /^[0-9]$/.test(s), l = n ? c : o || c, u = this.#e.telInputEl, d = u.selectionStart, f = u.selectionEnd, p = a.slice(0, d ?? void 0), m = a.slice(f ?? void 0), h = p + s + m, _ = this.#ne(h), v = !1;
2216
+ Q.utils && this.#u && (v = Q.utils.getCoreNumber(_, this.#l?.iso2).length > this.#u);
2217
+ let y = this.#q(_) !== null;
2218
+ (!l || v && !y && !o) && (this.#V(), this.#H(g.STRICT_REJECT, {
2219
+ source: "key",
2220
+ rejectedInput: e.key,
2221
+ reason: l ? "max-length" : "invalid"
2222
+ }), e.preventDefault());
2223
+ };
2224
+ #R() {
2225
+ this.#t.strictMode && this.#e.telInputEl.addEventListener("paste", this.#z, { signal: this.#p.signal });
2226
+ }
2227
+ #z = (e) => {
2228
+ e.preventDefault();
2229
+ let t = this.#e.telInputEl, n = t.selectionStart, r = t.selectionEnd, i = this.#v(), a = i.slice(0, n ?? void 0), o = i.slice(r ?? void 0), s = this.#l?.iso2, c = e.clipboardData.getData("text"), l = this.#m.normalise(c), u = n === 0 && r > 0, d = !i.startsWith("+") || u, f = l.replace(b.NON_PLUS_NUMERIC_GLOBAL, ""), p = f.startsWith("+"), m = f.replace(/\+/g, ""), h = p && d ? `+${m}` : m, _ = a + h + o, v = h === l ? null : "invalid";
2230
+ if (_.length > 30) {
2231
+ this.#V(), this.#H(g.STRICT_REJECT, {
2232
+ source: "paste",
2233
+ rejectedInput: c,
2234
+ reason: "max-length"
2235
+ });
2236
+ return;
2237
+ }
2238
+ if (_.length > 5 && Q.utils) {
2239
+ let e = Q.utils.getCoreNumber(_, s);
2240
+ for (; e.length === 0 && _.length > 0;) _ = _.slice(0, -1), e = Q.utils.getCoreNumber(_, s);
2241
+ if (!e) {
2242
+ this.#V(), this.#H(g.STRICT_REJECT, {
2243
+ source: "paste",
2244
+ rejectedInput: c,
2245
+ reason: "max-length"
2246
+ });
2247
+ return;
2248
+ }
2249
+ if (this.#u && e.length > this.#u) if (t.selectionEnd === i.length) {
2250
+ let t = e.length - this.#u;
2251
+ _ = _.slice(0, _.length - t), v = "max-length";
2252
+ } else {
2253
+ this.#V(), this.#H(g.STRICT_REJECT, {
2254
+ source: "paste",
2255
+ rejectedInput: c,
2256
+ reason: "max-length"
2257
+ });
2258
+ return;
2259
+ }
2260
+ }
2261
+ this.#y(_);
2262
+ let y = n + h.length;
2263
+ t.setSelectionRange(y, y), t.dispatchEvent(new InputEvent("input", { bubbles: !0 })), v && (l.length > 0 && h.length === 0 && this.#V(), this.#H(g.STRICT_REJECT, {
2264
+ source: "paste",
2265
+ rejectedInput: c,
2266
+ reason: v
2267
+ }));
2268
+ };
2269
+ #B(e) {
2270
+ let t = Number(this.#e.telInputEl.getAttribute("maxlength"));
2271
+ return t && e.length > t ? e.substring(0, t) : e;
2272
+ }
2273
+ #V() {
2274
+ if (!this.#t.strictRejectAnimation) return;
2275
+ let e = this.#e.telInputEl.parentElement;
2276
+ e && (e.classList.remove("iti__strict-reject-animation"), e.offsetWidth, e.classList.add("iti__strict-reject-animation"));
2277
+ }
2278
+ #H(e, t = {}) {
2279
+ let n = new CustomEvent(e, {
2280
+ bubbles: !0,
2281
+ cancelable: !0,
2282
+ detail: t
2283
+ });
2284
+ this.#e.telInputEl.dispatchEvent(n);
2285
+ }
2286
+ #U() {
2287
+ this.#e.openDropdown((e) => this.#Q(e), () => this.#$()), this.#H(g.OPEN_COUNTRY_DROPDOWN);
2288
+ }
2289
+ #W(e) {
2290
+ let { formatOnDisplay: t, nationalMode: n, separateDialCode: r } = this.#t, i = e;
2291
+ if (t && Q.utils && this.#l) {
2292
+ let t = be(e), a = n && !t || !i.startsWith("+") && !r ? M.NATIONAL : M.INTERNATIONAL;
2293
+ i = Q.utils.formatNumber(i, this.#l?.iso2, a);
2294
+ }
2295
+ i = this.#ie(i), this.#y(i);
2296
+ }
2297
+ #G(e) {
2298
+ let t = this.#q(e);
2299
+ return t === null ? !1 : this.#Y(t);
2300
+ }
2301
+ #K(e) {
2302
+ let t = this.#l?.dialCode, n = this.#l?.nationalPrefix;
2303
+ return e.startsWith("+") || !t ? e : `+${t}${n && e.startsWith(n) && !this.#t.separateDialCode ? e.substring(1) : e}`;
2304
+ }
2305
+ #q(e) {
2306
+ let t = e.indexOf("+"), n = t > 0 ? e.substring(t) : e, r = this.#l?.iso2;
2307
+ n = this.#K(n);
2308
+ let i = this.#te(n, !0), a = G(n);
2309
+ if (i) {
2310
+ let e = G(i), t = this.#a[e];
2311
+ return t.length === 1 ? t[0] === r ? null : t[0] : this.#J(t, e, a);
2312
+ } else if (n.startsWith("+") && a.length) {
2313
+ let e = this.#l?.dialCode || "";
2314
+ return e && e.startsWith(a) ? null : "";
2315
+ } else if ((!n || n === "+") && !r && this.#d) return this.#d;
2316
+ return null;
2317
+ }
2318
+ #J(e, t, n) {
2319
+ let r = this.#l?.iso2, i = this.#l?.dialCode;
2320
+ if (!r && this.#d && e.includes(this.#d)) return this.#d;
2321
+ if (i === C.NANP && Te(n)) return null;
2322
+ let a = this.#l?.areaCodes, o = this.#l?.priority;
2323
+ if (a) {
2324
+ let e = a.map((e) => `${i}${e}`);
2325
+ for (let t of e) if (n.startsWith(t)) return null;
2326
+ }
2327
+ let s = a && o !== 0 && n.length > t.length, c = r && e.includes(r) && !s, l = r === e[0];
2328
+ return !c && !l ? e[0] : null;
2329
+ }
2330
+ #Y(e) {
2331
+ let t = this.#l?.iso2 || "";
2332
+ return this.#l = e ? this.#s.get(e) : null, this.#l && (this.#d = this.#l.iso2), this.#e.setCountry(this.#l), this.#Z(), this.#X(), t !== e;
2333
+ }
2334
+ #X() {
2335
+ let { strictMode: e, placeholderNumberType: t, allowedNumberTypes: n } = this.#t;
2336
+ if (!e || !Q.utils) return;
2337
+ let r = this.#l?.iso2;
2338
+ if (!r) {
2339
+ this.#u = null;
2340
+ return;
2341
+ }
2342
+ let i = Q.utils.getExampleNumber(r, !1, t, !0), a = i;
2343
+ for (; Q.utils.isPossibleNumber(i, r, n);) a = i, i += "0";
2344
+ let o = Q.utils.getCoreNumber(a, r);
2345
+ this.#u = o.length, r === "by" && (this.#u = o.length + 1);
2346
+ }
2347
+ #Z() {
2348
+ let { autoPlaceholder: e, placeholderNumberType: t, nationalMode: n, customPlaceholder: r } = this.#t, i = e === E.AGGRESSIVE || !this.#e.hadInitialPlaceholder && e === E.POLITE;
2349
+ if (!Q.utils || !i) return;
2350
+ let a = this.#l ? Q.utils.getExampleNumber(this.#l.iso2, n, t) : "";
2351
+ a = this.#ie(a), typeof r == "function" && (a = r(a, this.#l)), this.#e.telInputEl.setAttribute("placeholder", a);
2352
+ }
2353
+ #Q(e) {
2354
+ if (!e) return;
2355
+ let t = e.dataset[F.ISO2], n = this.#Y(t);
2356
+ this.#$();
2357
+ let r = e.dataset[F.DIAL_CODE];
2358
+ if (this.#ee(r), this.#t.formatOnDisplay) {
2359
+ let e = this.#v();
2360
+ this.#W(e);
2361
+ }
2362
+ this.#e.telInputEl.focus(), n && (this.#ae(), this.#H(g.INPUT, { isCountryChange: !0 }));
2363
+ }
2364
+ #$(e) {
2365
+ !this.#e.isDropdownOpen() || this.#t.dropdownAlwaysOpen && !e || (this.#e.closeDropdown(), this.#H(g.CLOSE_COUNTRY_DROPDOWN));
2366
+ }
2367
+ #ee(e) {
2368
+ let t = this.#v();
2369
+ if (!t.startsWith("+")) return;
2370
+ let n = `+${e}`, r = this.#te(t), i;
2371
+ i = r ? t.replace(r, n) : n, this.#y(i);
2372
+ }
2373
+ #te(e, t) {
2374
+ if (!e.startsWith("+")) return "";
2375
+ let n = "", r = "", i = !1;
2376
+ for (let a = 0; a < e.length; a++) {
2377
+ let o = e.charAt(a);
2378
+ if (/[0-9]/.test(o)) {
2379
+ if (r += o, !this.#a[r]) break;
2380
+ if (this.#o.has(r)) {
2381
+ if (n = e.substring(0, a + 1), i = !0, !t) break;
2382
+ } else t && i && (n = e.substring(0, a + 1));
2383
+ if (r.length === this.#i) break;
2384
+ }
2385
+ }
2386
+ return n;
2387
+ }
2388
+ #ne(e) {
2389
+ let t = this.#l?.dialCode, n = G(e);
2390
+ return (this.#t.separateDialCode && !e.startsWith("+") && t && n ? `+${t}` : "") + e;
2391
+ }
2392
+ #re() {
2393
+ let e = this.#v();
2394
+ return this.#ne(e);
2395
+ }
2396
+ #ie(e) {
2397
+ let t = xe(e, !!this.#te(e), this.#t.separateDialCode, this.#l);
2398
+ return this.#B(t);
2399
+ }
2400
+ #ae() {
2401
+ this.#H(g.COUNTRY_CHANGE, this.#l ?? null);
2402
+ }
2403
+ #oe() {
2404
+ if (!(!this.#g || !Q.autoCountry)) {
2405
+ if (!this.#f) {
2406
+ this.#g.resolve();
2407
+ return;
2408
+ }
2409
+ this.#e.isLoading() ? this.setCountry(Q.autoCountry) : this.#d = Q.autoCountry, this.#e.setLoading(!1), this.#g.resolve();
2410
+ }
2411
+ }
2412
+ #se() {
2413
+ if (!this.#f) {
2414
+ this.#g?.reject();
2415
+ return;
2416
+ }
2417
+ this.#C(!0), this.#e.setLoading(!1), this.#g?.reject();
2418
+ }
2419
+ #ce() {
2420
+ if (!this.#f) {
2421
+ this.#_?.resolve();
2422
+ return;
2423
+ }
2424
+ if (!Q.utils) {
2425
+ this.#_?.resolve();
2426
+ return;
2427
+ }
2428
+ let e = this.#v();
2429
+ e && this.#W(e), this.#l && (this.#Z(), this.#X()), this.#_?.resolve();
2430
+ }
2431
+ #le(e) {
2432
+ if (!this.#f) {
2433
+ this.#_?.reject(e);
2434
+ return;
2435
+ }
2436
+ this.#_?.reject(e);
2437
+ }
2438
+ destroy() {
2439
+ this.#f && (this.#f = !1, this.#t.allowDropdown && this.#$(!0), this.#p.abort(), this.#e.destroy(), Q.instances.delete(String(this.id)));
2440
+ }
2441
+ isActive() {
2442
+ return this.#f;
2443
+ }
2444
+ getExtension() {
2445
+ return this.#f ? (X("getExtension"), Q.utils.getExtension(this.#re(), this.#l?.iso2)) : "";
2446
+ }
2447
+ getNumber(e) {
2448
+ if (!this.#f) return "";
2449
+ X("getNumber");
2450
+ let t = this.#l?.iso2, n = this.#re(), r = Q.utils.formatNumber(n, t, e);
2451
+ return this.#m.denormalise(r);
2452
+ }
2453
+ getNumberType() {
2454
+ return this.#f ? (X("getNumberType"), Q.utils.getNumberType(this.#re(), this.#l?.iso2)) : null;
2455
+ }
2456
+ getSelectedCountryData() {
2457
+ return this.#l ?? null;
2458
+ }
2459
+ getValidationError() {
2460
+ if (!this.#f) return null;
2461
+ X("getValidationError");
2462
+ let e = this.#l?.iso2;
2463
+ return Q.utils.getValidationError(this.#re(), e);
2464
+ }
2465
+ isValidNumber() {
2466
+ if (!this.#f) return null;
2467
+ X("isValidNumber");
2468
+ let e = this.#l?.dialCode, t = this.#l?.iso2, n = this.#re(), r = Q.utils.getCoreNumber(n, t);
2469
+ if (r) {
2470
+ if (e === w.DIAL_CODE && r[0] === w.MOBILE_PREFIX && r.length !== w.MOBILE_CORE_LENGTH) return !1;
2471
+ if (!b.ALPHA_UNICODE.test(n) && e) {
2472
+ let t = G(n.startsWith("+") ? n.slice(1 + e.length) : n).length;
2473
+ if (r.length > t) return !1;
2474
+ }
2475
+ }
2476
+ return this.#ue("possible");
2477
+ }
2478
+ isValidNumberPrecise() {
2479
+ return this.#f ? (X("isValidNumberPrecise"), this.#ue("precise")) : null;
2480
+ }
2481
+ #ue(e) {
2482
+ let { allowNumberExtensions: t, allowPhonewords: n, allowedNumberTypes: r } = this.#t, i = this.#l?.iso2, a = this.#re();
2483
+ return !this.#l && !be(a) || !(e === "precise" ? Q.utils.isValidNumber : Q.utils.isPossibleNumber)(a, i, r) ? !1 : b.ALPHA_UNICODE.test(a) ? Q.utils.getExtension(a, i) ? t : n : !0;
2484
+ }
2485
+ setCountry(e) {
2486
+ if (!this.#f) return;
2487
+ let t = e?.toLowerCase();
2488
+ if (!m(t)) throw Error(`Invalid iso2 code: '${t}'`);
2489
+ let n = this.#l?.iso2;
2490
+ if (e && t !== n || !e && n) {
2491
+ if (this.#Y(t), this.#ee(this.#l?.dialCode || ""), this.#t.formatOnDisplay) {
2492
+ let e = this.#v();
2493
+ this.#W(e);
2494
+ }
2495
+ this.#ae(), this.#H(g.INPUT, { isCountryChange: !0 });
2496
+ }
2497
+ }
2498
+ setNumber(e) {
2499
+ if (!this.#f) return;
2500
+ let t = this.#m.normalise(e), n = this.#G(t);
2501
+ this.#W(t), n && this.#ae(), this.#H(g.INPUT, { isSetNumber: !0 });
2502
+ }
2503
+ setPlaceholderNumberType(e) {
2504
+ this.#f && (this.#t.placeholderNumberType = e, this.#Z());
2505
+ }
2506
+ setDisabled(e) {
2507
+ this.#f && this.#e.setDisabled(e);
2508
+ }
2509
+ setReadonly(e) {
2510
+ this.#f && this.#e.setReadonly(e);
2511
+ }
2512
+ static forEachInstance(t, ...n) {
2513
+ let r = [...Q.instances.values()], i = n[0];
2514
+ r.forEach((n) => {
2515
+ if (n instanceof e) switch (t) {
2516
+ case "handleUtilsLoaded":
2517
+ n.#ce();
2518
+ break;
2519
+ case "handleUtilsFailure":
2520
+ n.#le(i);
2521
+ break;
2522
+ case "handleAutoCountryLoaded":
2523
+ n.#oe();
2524
+ break;
2525
+ case "handleAutoCountryFailure":
2526
+ n.#se();
2527
+ break;
2528
+ }
2529
+ });
2530
+ }
2531
+ }, Q = Object.assign((e, t) => {
2532
+ let n = new Z(e, t);
2533
+ return Q.instances.set(String(n.id), n), e.iti = n, n;
2534
+ }, {
2535
+ defaults: z,
2536
+ documentReady: () => document.readyState === "complete",
2537
+ getCountryData: () => h,
2538
+ getInstance: (e) => {
2539
+ let t = e.dataset[F.INSTANCE_ID];
2540
+ return t ? Q.instances.get(t) ?? null : null;
2541
+ },
2542
+ instances: /* @__PURE__ */ new Map(),
2543
+ attachUtils: async (e) => {
2544
+ if (Q.utils || Q.startedLoadingUtils) return null;
2545
+ if (typeof e != "function") throw TypeError(`The argument passed to attachUtils must be a function that returns a promise for the utils module, not ${typeof e}`);
2546
+ Q.startedLoadingUtils = !0;
2547
+ try {
2548
+ let t = (await e())?.default;
2549
+ if (!t || typeof t != "object") throw TypeError("The loader function passed to attachUtils did not resolve to a module object with utils as its default export.");
2550
+ return Q.utils = t, Z.forEachInstance("handleUtilsLoaded"), !0;
2551
+ } catch (e) {
2552
+ throw Z.forEachInstance("handleUtilsFailure", e), e;
2553
+ }
2554
+ },
2555
+ startedLoadingUtils: !1,
2556
+ startedLoadingAutoCountry: !1,
2557
+ version: "28.0.0",
2558
+ NUMBER_FORMAT: M,
2559
+ NUMBER_TYPE: N,
2560
+ VALIDATION_ERROR: P
2561
+ }), $ = Q, Oe = /* @__PURE__ */ n({
2562
+ inheritAttrs: !1,
2563
+ __name: "IntlTelInput",
2564
+ props: {
2565
+ usePreciseValidation: {
2566
+ type: Boolean,
2567
+ default: !1
2568
+ },
2569
+ disabled: {
2570
+ type: Boolean,
2571
+ default: !1
2572
+ },
2573
+ readonly: {
2574
+ type: Boolean,
2575
+ default: !1
2576
+ },
2577
+ inputProps: { default: () => ({}) },
2578
+ initialValue: {},
2579
+ modelValue: {},
2580
+ allowDropdown: { type: Boolean },
2581
+ allowedNumberTypes: {},
2582
+ allowNumberExtensions: { type: Boolean },
2583
+ allowPhonewords: { type: Boolean },
2584
+ autoPlaceholder: {},
2585
+ containerClass: {},
2586
+ countryNameLocale: {},
2587
+ countryNameOverrides: {},
2588
+ countryOrder: {},
2589
+ countrySearch: { type: Boolean },
2590
+ customPlaceholder: {},
2591
+ dropdownAlwaysOpen: { type: Boolean },
2592
+ dropdownContainer: {},
2593
+ excludeCountries: {},
2594
+ fixDropdownWidth: { type: Boolean },
2595
+ formatAsYouType: { type: Boolean },
2596
+ formatOnDisplay: { type: Boolean },
2597
+ geoIpLookup: {},
2598
+ hiddenInput: {},
2599
+ i18n: {},
2600
+ initialCountry: {},
2601
+ loadUtils: {},
2602
+ nationalMode: { type: Boolean },
2603
+ onlyCountries: {},
2604
+ placeholderNumberType: {},
2605
+ searchInputClass: {},
2606
+ separateDialCode: { type: Boolean },
2607
+ strictRejectAnimation: { type: Boolean },
2608
+ showFlags: { type: Boolean },
2609
+ strictMode: { type: Boolean },
2610
+ useFullscreenPopup: { type: Boolean }
2611
+ },
2612
+ emits: [
2613
+ "changeNumber",
2614
+ "changeCountry",
2615
+ "changeValidity",
2616
+ "changeErrorCode",
2617
+ "openCountryDropdown",
2618
+ "closeCountryDropdown",
2619
+ "strictReject",
2620
+ "update:modelValue"
2621
+ ],
2622
+ setup(n, { expose: d, emit: f }) {
2623
+ let p = n, m = f, h = (e) => {
2624
+ console.warn(`intl-tel-input: ignoring inputProps.${e} - see docs for more info.`);
2625
+ }, g = new Set([
2626
+ "type",
2627
+ "value",
2628
+ "disabled",
2629
+ "readonly",
2630
+ "onInput",
2631
+ "oninput"
2632
+ ]), _ = c(""), v = e(() => {
2633
+ let e = p.inputProps ?? {}, t = {};
2634
+ for (let [n, r] of Object.entries(e)) g.has(n) ? h(n) : n === "class" ? t[n] = `${_.value} ${r}` : t[n] = r;
2635
+ return t;
2636
+ }), y = e(() => p.modelValue ?? p.initialValue ?? ""), b = r(), x = Object.keys($.defaults), S = e(() => {
2637
+ let e = b?.vnode.props ?? {}, t = new Set(Object.keys(e).map((e) => e.replace(/-([a-z])/g, (e, t) => t.toUpperCase()))), n = {};
2638
+ return x.forEach((e) => {
2639
+ if (!t.has(e)) return;
2640
+ let r = p[e];
2641
+ r !== void 0 && (n[e] = r);
2642
+ }), n;
2643
+ }), C = c(null), w = l(null), T = c(), E = c(), D = c(), O = c(), k = !1, A = () => (p.usePreciseValidation ? w.value.isValidNumberPrecise() : w.value.isValidNumber()) ?? !1, j = () => {
2644
+ if (!w.value?.isActive()) return;
2645
+ if (!$.utils) {
2646
+ k = !0;
2647
+ return;
2648
+ }
2649
+ let e = A(), t = e ? null : w.value.getValidationError();
2650
+ e !== D.value && (D.value = e, m("changeValidity", e)), t !== O.value && (O.value = t, m("changeErrorCode", t));
2651
+ }, M = () => {
2652
+ if (!w.value?.isActive()) return;
2653
+ if (!$.utils) {
2654
+ k = !0;
2655
+ return;
2656
+ }
2657
+ let e = w.value.getNumber() ?? "";
2658
+ e !== T.value && (T.value = e, m("changeNumber", e), m("update:modelValue", e)), j();
2659
+ }, N = () => {
2660
+ if (!w.value?.isActive()) return;
2661
+ let e = w.value.getSelectedCountryData()?.iso2 ?? "";
2662
+ e !== E.value && (E.value = e, m("changeCountry", e)), M();
2663
+ }, P = () => m("openCountryDropdown"), F = () => m("closeCountryDropdown"), I = (e) => {
2664
+ let { source: t, rejectedInput: n, reason: r } = e.detail;
2665
+ m("strictReject", t, n, r);
2666
+ };
2667
+ return a(() => {
2668
+ C.value && (w.value = $(C.value, S.value), _.value = C.value.className, C.value.addEventListener("open:countrydropdown", P), C.value.addEventListener("close:countrydropdown", F), C.value.addEventListener("strict:reject", I), p.disabled && w.value.setDisabled(p.disabled), p.readonly && w.value.setReadonly(p.readonly), E.value = w.value.getSelectedCountryData()?.iso2 ?? "", w.value.promise.then(() => {
2669
+ w.value?.isActive() && (y.value && w.value.setNumber(y.value), k ? (k = !1, N()) : (T.value = w.value.getNumber() ?? "", D.value = A(), O.value = D.value ? null : w.value.getValidationError()));
2670
+ }));
2671
+ }), u(() => p.disabled, (e) => w.value?.setDisabled(e)), u(() => p.readonly, (e) => w.value?.setReadonly(e)), u(() => y.value, (e) => {
2672
+ w.value && w.value.promise.then(() => {
2673
+ if (!w.value?.isActive()) return;
2674
+ let t = e ?? "", n = w.value.getNumber() ?? "";
2675
+ document.activeElement === C.value || n === t || (w.value.setNumber(t), j());
2676
+ });
2677
+ }, { flush: "post" }), o(() => {
2678
+ C.value && (C.value.removeEventListener("open:countrydropdown", P), C.value.removeEventListener("close:countrydropdown", F), C.value.removeEventListener("strict:reject", I)), w.value?.destroy();
2679
+ }), d({
2680
+ instance: w,
2681
+ input: C
2682
+ }), (e, n) => (s(), t("input", i(v.value, {
2683
+ ref_key: "input",
2684
+ ref: C,
2685
+ type: "tel",
2686
+ onInput: N
2687
+ }), null, 16));
2688
+ }
2689
+ });
2690
+ //#endregion
2691
+ export { $ as n, Oe as t };