intl-tel-input 25.0.2 → 25.1.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.
package/README.md CHANGED
@@ -75,16 +75,16 @@ _Note: We have now dropped support for all versions of Internet Explorer because
75
75
  ## Getting Started (Using a CDN)
76
76
  1. Add the CSS
77
77
  ```html
78
- <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/intl-tel-input@25.0.2/build/css/intlTelInput.css">
78
+ <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/intl-tel-input@25.1.0/build/css/intlTelInput.css">
79
79
  ```
80
80
 
81
81
  2. Add the plugin script and initialise it on your input element
82
82
  ```html
83
- <script src="https://cdn.jsdelivr.net/npm/intl-tel-input@25.0.2/build/js/intlTelInput.min.js"></script>
83
+ <script src="https://cdn.jsdelivr.net/npm/intl-tel-input@25.1.0/build/js/intlTelInput.min.js"></script>
84
84
  <script>
85
85
  const input = document.querySelector("#phone");
86
86
  window.intlTelInput(input, {
87
- loadUtils: () => import("https://cdn.jsdelivr.net/npm/intl-tel-input@25.0.2/build/js/utils.js"),
87
+ loadUtils: () => import("https://cdn.jsdelivr.net/npm/intl-tel-input@25.1.0/build/js/utils.js"),
88
88
  });
89
89
  </script>
90
90
  ```
@@ -317,7 +317,7 @@ The `loadUtils` option takes a function which returns a Promise which resolves t
317
317
  ```js
318
318
  // (A) import utils module from a CDN
319
319
  intlTelInput(htmlInputElement, {
320
- loadUtils: () => import("https://cdn.jsdelivr.net/npm/intl-tel-input@25.0.2/build/js/utils.js"),
320
+ loadUtils: () => import("https://cdn.jsdelivr.net/npm/intl-tel-input@25.1.0/build/js/utils.js"),
321
321
  });
322
322
 
323
323
  // (B) import utils module from your own hosted version of utils.js
@@ -598,7 +598,7 @@ The `loadUtils` option takes a function which returns a Promise which resolves t
598
598
  ```js
599
599
  // (A) import utils module from a CDN
600
600
  intlTelInput(htmlInputElement, {
601
- loadUtils: () => import("https://cdn.jsdelivr.net/npm/intl-tel-input@25.0.2/build/js/utils.js"),
601
+ loadUtils: () => import("https://cdn.jsdelivr.net/npm/intl-tel-input@25.1.0/build/js/utils.js"),
602
602
  });
603
603
 
604
604
  // (B) import utils module from your own hosted version of utils.js
package/build/js/data.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*
2
- * International Telephone Input v25.0.2
2
+ * International Telephone Input v25.1.0
3
3
  * https://github.com/jackocnr/intl-tel-input.git
4
4
  * Licensed under the MIT license
5
5
  */
@@ -114,7 +114,9 @@ var factoryOutput = (() => {
114
114
  "au",
115
115
  // Australia
116
116
  "61",
117
- 0
117
+ 0,
118
+ null,
119
+ "0"
118
120
  ],
119
121
  [
120
122
  "at",
@@ -295,14 +297,16 @@ var factoryOutput = (() => {
295
297
  // Christmas Island
296
298
  "61",
297
299
  2,
298
- ["89164"]
300
+ ["89164"],
301
+ "0"
299
302
  ],
300
303
  [
301
304
  "cc",
302
305
  // Cocos (Keeling) Islands
303
306
  "61",
304
307
  1,
305
- ["89162"]
308
+ ["89162"],
309
+ "0"
306
310
  ],
307
311
  [
308
312
  "co",
@@ -535,7 +539,8 @@ var factoryOutput = (() => {
535
539
  // Guernsey
536
540
  "44",
537
541
  1,
538
- ["1481", "7781", "7839", "7911"]
542
+ ["1481", "7781", "7839", "7911"],
543
+ "0"
539
544
  ],
540
545
  [
541
546
  "gn",
@@ -607,7 +612,8 @@ var factoryOutput = (() => {
607
612
  // Isle of Man
608
613
  "44",
609
614
  2,
610
- ["1624", "74576", "7524", "7924", "7624"]
615
+ ["1624", "74576", "7524", "7924", "7624"],
616
+ "0"
611
617
  ],
612
618
  [
613
619
  "il",
@@ -637,7 +643,8 @@ var factoryOutput = (() => {
637
643
  // Jersey
638
644
  "44",
639
645
  3,
640
- ["1534", "7509", "7700", "7797", "7829", "7937"]
646
+ ["1534", "7509", "7700", "7797", "7829", "7937"],
647
+ "0"
641
648
  ],
642
649
  [
643
650
  "jo",
@@ -649,7 +656,8 @@ var factoryOutput = (() => {
649
656
  // Kazakhstan
650
657
  "7",
651
658
  1,
652
- ["33", "7"]
659
+ ["33", "7"],
660
+ "8"
653
661
  ],
654
662
  [
655
663
  "ke",
@@ -781,7 +789,8 @@ var factoryOutput = (() => {
781
789
  // Mayotte
782
790
  "262",
783
791
  1,
784
- ["269", "639"]
792
+ ["269", "639"],
793
+ "0"
785
794
  ],
786
795
  [
787
796
  "mx",
@@ -824,7 +833,9 @@ var factoryOutput = (() => {
824
833
  "ma",
825
834
  // Morocco
826
835
  "212",
827
- 0
836
+ 0,
837
+ null,
838
+ "0"
828
839
  ],
829
840
  [
830
841
  "mz",
@@ -985,7 +996,9 @@ var factoryOutput = (() => {
985
996
  "re",
986
997
  // Réunion
987
998
  "262",
988
- 0
999
+ 0,
1000
+ null,
1001
+ "0"
989
1002
  ],
990
1003
  [
991
1004
  "ro",
@@ -996,7 +1009,9 @@ var factoryOutput = (() => {
996
1009
  "ru",
997
1010
  // Russia
998
1011
  "7",
999
- 0
1012
+ 0,
1013
+ null,
1014
+ "8"
1000
1015
  ],
1001
1016
  [
1002
1017
  "rw",
@@ -1268,7 +1283,9 @@ var factoryOutput = (() => {
1268
1283
  "gb",
1269
1284
  // United Kingdom
1270
1285
  "44",
1271
- 0
1286
+ 0,
1287
+ null,
1288
+ "0"
1272
1289
  ],
1273
1290
  [
1274
1291
  "us",
@@ -1325,7 +1342,8 @@ var factoryOutput = (() => {
1325
1342
  // Western Sahara
1326
1343
  "212",
1327
1344
  1,
1328
- ["5288", "5289"]
1345
+ ["5288", "5289"],
1346
+ "0"
1329
1347
  ],
1330
1348
  [
1331
1349
  "ye",
@@ -1353,8 +1371,8 @@ var factoryOutput = (() => {
1353
1371
  dialCode: c[1],
1354
1372
  priority: c[2] || 0,
1355
1373
  areaCodes: c[3] || null,
1356
- partialAreaCodes: null,
1357
- nodeById: {}
1374
+ nodeById: {},
1375
+ nationalPrefix: c[4] || null
1358
1376
  };
1359
1377
  }
1360
1378
  var data_default = allCountries;
@@ -1,5 +1,5 @@
1
1
  /*
2
- * International Telephone Input v25.0.2
2
+ * International Telephone Input v25.1.0
3
3
  * https://github.com/jackocnr/intl-tel-input.git
4
4
  * Licensed under the MIT license
5
5
  */
@@ -13,7 +13,7 @@
13
13
  }
14
14
  }(() => {
15
15
 
16
- var factoryOutput=(()=>{var a=Object.defineProperty;var i=Object.getOwnPropertyDescriptor;var l=Object.getOwnPropertyNames;var o=Object.prototype.hasOwnProperty;var c=(n,t)=>{for(var s in t)a(n,s,{get:t[s],enumerable:!0})},b=(n,t,s,e)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of l(t))!o.call(n,r)&&r!==s&&a(n,r,{get:()=>t[r],enumerable:!(e=i(t,r))||e.enumerable});return n};var d=n=>b(a({},"__esModule",{value:!0}),n);var p={};c(p,{default:()=>u});var m=[["af","93"],["ax","358",1],["al","355"],["dz","213"],["as","1",5,["684"]],["ad","376"],["ao","244"],["ai","1",6,["264"]],["ag","1",7,["268"]],["ar","54"],["am","374"],["aw","297"],["ac","247"],["au","61",0],["at","43"],["az","994"],["bs","1",8,["242"]],["bh","973"],["bd","880"],["bb","1",9,["246"]],["by","375"],["be","32"],["bz","501"],["bj","229"],["bm","1",10,["441"]],["bt","975"],["bo","591"],["ba","387"],["bw","267"],["br","55"],["io","246"],["vg","1",11,["284"]],["bn","673"],["bg","359"],["bf","226"],["bi","257"],["kh","855"],["cm","237"],["ca","1",1,["204","226","236","249","250","263","289","306","343","354","365","367","368","382","387","403","416","418","428","431","437","438","450","584","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"]],["cv","238"],["bq","599",1,["3","4","7"]],["ky","1",12,["345"]],["cf","236"],["td","235"],["cl","56"],["cn","86"],["cx","61",2,["89164"]],["cc","61",1,["89162"]],["co","57"],["km","269"],["cg","242"],["cd","243"],["ck","682"],["cr","506"],["ci","225"],["hr","385"],["cu","53"],["cw","599",0],["cy","357"],["cz","420"],["dk","45"],["dj","253"],["dm","1",13,["767"]],["do","1",2,["809","829","849"]],["ec","593"],["eg","20"],["sv","503"],["gq","240"],["er","291"],["ee","372"],["sz","268"],["et","251"],["fk","500"],["fo","298"],["fj","679"],["fi","358",0],["fr","33"],["gf","594"],["pf","689"],["ga","241"],["gm","220"],["ge","995"],["de","49"],["gh","233"],["gi","350"],["gr","30"],["gl","299"],["gd","1",14,["473"]],["gp","590",0],["gu","1",15,["671"]],["gt","502"],["gg","44",1,["1481","7781","7839","7911"]],["gn","224"],["gw","245"],["gy","592"],["ht","509"],["hn","504"],["hk","852"],["hu","36"],["is","354"],["in","91"],["id","62"],["ir","98"],["iq","964"],["ie","353"],["im","44",2,["1624","74576","7524","7924","7624"]],["il","972"],["it","39",0],["jm","1",4,["876","658"]],["jp","81"],["je","44",3,["1534","7509","7700","7797","7829","7937"]],["jo","962"],["kz","7",1,["33","7"]],["ke","254"],["ki","686"],["xk","383"],["kw","965"],["kg","996"],["la","856"],["lv","371"],["lb","961"],["ls","266"],["lr","231"],["ly","218"],["li","423"],["lt","370"],["lu","352"],["mo","853"],["mg","261"],["mw","265"],["my","60"],["mv","960"],["ml","223"],["mt","356"],["mh","692"],["mq","596"],["mr","222"],["mu","230"],["yt","262",1,["269","639"]],["mx","52"],["fm","691"],["md","373"],["mc","377"],["mn","976"],["me","382"],["ms","1",16,["664"]],["ma","212",0],["mz","258"],["mm","95"],["na","264"],["nr","674"],["np","977"],["nl","31"],["nc","687"],["nz","64"],["ni","505"],["ne","227"],["ng","234"],["nu","683"],["nf","672"],["kp","850"],["mk","389"],["mp","1",17,["670"]],["no","47",0],["om","968"],["pk","92"],["pw","680"],["ps","970"],["pa","507"],["pg","675"],["py","595"],["pe","51"],["ph","63"],["pl","48"],["pt","351"],["pr","1",3,["787","939"]],["qa","974"],["re","262",0],["ro","40"],["ru","7",0],["rw","250"],["ws","685"],["sm","378"],["st","239"],["sa","966"],["sn","221"],["rs","381"],["sc","248"],["sl","232"],["sg","65"],["sx","1",21,["721"]],["sk","421"],["si","386"],["sb","677"],["so","252"],["za","27"],["kr","82"],["ss","211"],["es","34"],["lk","94"],["bl","590",1],["sh","290"],["kn","1",18,["869"]],["lc","1",19,["758"]],["mf","590",2],["pm","508"],["vc","1",20,["784"]],["sd","249"],["sr","597"],["sj","47",1,["79"]],["se","46"],["ch","41"],["sy","963"],["tw","886"],["tj","992"],["tz","255"],["th","66"],["tl","670"],["tg","228"],["tk","690"],["to","676"],["tt","1",22,["868"]],["tn","216"],["tr","90"],["tm","993"],["tc","1",23,["649"]],["tv","688"],["ug","256"],["ua","380"],["ae","971"],["gb","44",0],["us","1",0],["uy","598"],["vi","1",24,["340"]],["uz","998"],["vu","678"],["va","39",1,["06698"]],["ve","58"],["vn","84"],["wf","681"],["eh","212",1,["5288","5289"]],["ye","967"],["zm","260"],["zw","263"]],g=[];for(let n=0;n<m.length;n++){let t=m[n];g[n]={name:"",iso2:t[0],dialCode:t[1],priority:t[2]||0,areaCodes:t[3]||null,partialAreaCodes:null,nodeById:{}}}var u=g;return d(p);})();
16
+ var factoryOutput=(()=>{var l=Object.defineProperty;var m=Object.getOwnPropertyDescriptor;var g=Object.getOwnPropertyNames;var o=Object.prototype.hasOwnProperty;var c=(t,n)=>{for(var s in n)l(t,s,{get:n[s],enumerable:!0})},u=(t,n,s,a)=>{if(n&&typeof n=="object"||typeof n=="function")for(let r of g(n))!o.call(t,r)&&r!==s&&l(t,r,{get:()=>n[r],enumerable:!(a=m(n,r))||a.enumerable});return t};var b=t=>u(l({},"__esModule",{value:!0}),t);var p={};c(p,{default:()=>d});var e=[["af","93"],["ax","358",1],["al","355"],["dz","213"],["as","1",5,["684"]],["ad","376"],["ao","244"],["ai","1",6,["264"]],["ag","1",7,["268"]],["ar","54"],["am","374"],["aw","297"],["ac","247"],["au","61",0,null,"0"],["at","43"],["az","994"],["bs","1",8,["242"]],["bh","973"],["bd","880"],["bb","1",9,["246"]],["by","375"],["be","32"],["bz","501"],["bj","229"],["bm","1",10,["441"]],["bt","975"],["bo","591"],["ba","387"],["bw","267"],["br","55"],["io","246"],["vg","1",11,["284"]],["bn","673"],["bg","359"],["bf","226"],["bi","257"],["kh","855"],["cm","237"],["ca","1",1,["204","226","236","249","250","263","289","306","343","354","365","367","368","382","387","403","416","418","428","431","437","438","450","584","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"]],["cv","238"],["bq","599",1,["3","4","7"]],["ky","1",12,["345"]],["cf","236"],["td","235"],["cl","56"],["cn","86"],["cx","61",2,["89164"],"0"],["cc","61",1,["89162"],"0"],["co","57"],["km","269"],["cg","242"],["cd","243"],["ck","682"],["cr","506"],["ci","225"],["hr","385"],["cu","53"],["cw","599",0],["cy","357"],["cz","420"],["dk","45"],["dj","253"],["dm","1",13,["767"]],["do","1",2,["809","829","849"]],["ec","593"],["eg","20"],["sv","503"],["gq","240"],["er","291"],["ee","372"],["sz","268"],["et","251"],["fk","500"],["fo","298"],["fj","679"],["fi","358",0],["fr","33"],["gf","594"],["pf","689"],["ga","241"],["gm","220"],["ge","995"],["de","49"],["gh","233"],["gi","350"],["gr","30"],["gl","299"],["gd","1",14,["473"]],["gp","590",0],["gu","1",15,["671"]],["gt","502"],["gg","44",1,["1481","7781","7839","7911"],"0"],["gn","224"],["gw","245"],["gy","592"],["ht","509"],["hn","504"],["hk","852"],["hu","36"],["is","354"],["in","91"],["id","62"],["ir","98"],["iq","964"],["ie","353"],["im","44",2,["1624","74576","7524","7924","7624"],"0"],["il","972"],["it","39",0],["jm","1",4,["876","658"]],["jp","81"],["je","44",3,["1534","7509","7700","7797","7829","7937"],"0"],["jo","962"],["kz","7",1,["33","7"],"8"],["ke","254"],["ki","686"],["xk","383"],["kw","965"],["kg","996"],["la","856"],["lv","371"],["lb","961"],["ls","266"],["lr","231"],["ly","218"],["li","423"],["lt","370"],["lu","352"],["mo","853"],["mg","261"],["mw","265"],["my","60"],["mv","960"],["ml","223"],["mt","356"],["mh","692"],["mq","596"],["mr","222"],["mu","230"],["yt","262",1,["269","639"],"0"],["mx","52"],["fm","691"],["md","373"],["mc","377"],["mn","976"],["me","382"],["ms","1",16,["664"]],["ma","212",0,null,"0"],["mz","258"],["mm","95"],["na","264"],["nr","674"],["np","977"],["nl","31"],["nc","687"],["nz","64"],["ni","505"],["ne","227"],["ng","234"],["nu","683"],["nf","672"],["kp","850"],["mk","389"],["mp","1",17,["670"]],["no","47",0],["om","968"],["pk","92"],["pw","680"],["ps","970"],["pa","507"],["pg","675"],["py","595"],["pe","51"],["ph","63"],["pl","48"],["pt","351"],["pr","1",3,["787","939"]],["qa","974"],["re","262",0,null,"0"],["ro","40"],["ru","7",0,null,"8"],["rw","250"],["ws","685"],["sm","378"],["st","239"],["sa","966"],["sn","221"],["rs","381"],["sc","248"],["sl","232"],["sg","65"],["sx","1",21,["721"]],["sk","421"],["si","386"],["sb","677"],["so","252"],["za","27"],["kr","82"],["ss","211"],["es","34"],["lk","94"],["bl","590",1],["sh","290"],["kn","1",18,["869"]],["lc","1",19,["758"]],["mf","590",2],["pm","508"],["vc","1",20,["784"]],["sd","249"],["sr","597"],["sj","47",1,["79"]],["se","46"],["ch","41"],["sy","963"],["tw","886"],["tj","992"],["tz","255"],["th","66"],["tl","670"],["tg","228"],["tk","690"],["to","676"],["tt","1",22,["868"]],["tn","216"],["tr","90"],["tm","993"],["tc","1",23,["649"]],["tv","688"],["ug","256"],["ua","380"],["ae","971"],["gb","44",0,null,"0"],["us","1",0],["uy","598"],["vi","1",24,["340"]],["uz","998"],["vu","678"],["va","39",1,["06698"]],["ve","58"],["vn","84"],["wf","681"],["eh","212",1,["5288","5289"],"0"],["ye","967"],["zm","260"],["zw","263"]],i=[];for(let t=0;t<e.length;t++){let n=e[t];i[t]={name:"",iso2:n[0],dialCode:n[1],priority:n[2]||0,areaCodes:n[3]||null,nodeById:{},nationalPrefix:n[4]||null}}var d=i;return b(p);})();
17
17
 
18
18
  // UMD
19
19
  return factoryOutput.default;
@@ -5,8 +5,8 @@ declare module "intl-tel-input/data" {
5
5
  dialCode: string;
6
6
  priority: number;
7
7
  areaCodes: string[] | null;
8
- partialAreaCodes: string[] | null;
9
8
  nodeById: object;
9
+ nationalPrefix: string | null;
10
10
  };
11
11
  const allCountries: Country[];
12
12
  export default allCountries;
@@ -330,7 +330,7 @@ declare module "intl-tel-input" {
330
330
  iso2?: string;
331
331
  dialCode?: string;
332
332
  areaCodes?: string[];
333
- partialAreaCodes?: string[];
333
+ nationalPrefix?: string;
334
334
  };
335
335
  interface AllOptions {
336
336
  allowDropdown: boolean;
@@ -394,6 +394,7 @@ declare module "intl-tel-input" {
394
394
  private defaultCountry;
395
395
  private originalPaddingRight;
396
396
  private originalPaddingLeft;
397
+ private prevDialCodeMatch;
397
398
  private _handleHiddenInputSubmit;
398
399
  private _handleLabelClick;
399
400
  private _handleClickSelectedCountry;
@@ -441,7 +442,7 @@ declare module "intl-tel-input" {
441
442
  private _handleEnterKey;
442
443
  private _updateValFromNumber;
443
444
  private _updateCountryFromNumber;
444
- private _isAreaCodeMatch;
445
+ private _ensureHasDialCode;
445
446
  private _getCountryFromNumber;
446
447
  private _highlightListItem;
447
448
  private _getCountryData;
@@ -1,5 +1,5 @@
1
1
  /*
2
- * International Telephone Input v25.0.2
2
+ * International Telephone Input v25.1.0
3
3
  * https://github.com/jackocnr/intl-tel-input.git
4
4
  * Licensed under the MIT license
5
5
  */
@@ -117,7 +117,9 @@ var factoryOutput = (() => {
117
117
  "au",
118
118
  // Australia
119
119
  "61",
120
- 0
120
+ 0,
121
+ null,
122
+ "0"
121
123
  ],
122
124
  [
123
125
  "at",
@@ -298,14 +300,16 @@ var factoryOutput = (() => {
298
300
  // Christmas Island
299
301
  "61",
300
302
  2,
301
- ["89164"]
303
+ ["89164"],
304
+ "0"
302
305
  ],
303
306
  [
304
307
  "cc",
305
308
  // Cocos (Keeling) Islands
306
309
  "61",
307
310
  1,
308
- ["89162"]
311
+ ["89162"],
312
+ "0"
309
313
  ],
310
314
  [
311
315
  "co",
@@ -538,7 +542,8 @@ var factoryOutput = (() => {
538
542
  // Guernsey
539
543
  "44",
540
544
  1,
541
- ["1481", "7781", "7839", "7911"]
545
+ ["1481", "7781", "7839", "7911"],
546
+ "0"
542
547
  ],
543
548
  [
544
549
  "gn",
@@ -610,7 +615,8 @@ var factoryOutput = (() => {
610
615
  // Isle of Man
611
616
  "44",
612
617
  2,
613
- ["1624", "74576", "7524", "7924", "7624"]
618
+ ["1624", "74576", "7524", "7924", "7624"],
619
+ "0"
614
620
  ],
615
621
  [
616
622
  "il",
@@ -640,7 +646,8 @@ var factoryOutput = (() => {
640
646
  // Jersey
641
647
  "44",
642
648
  3,
643
- ["1534", "7509", "7700", "7797", "7829", "7937"]
649
+ ["1534", "7509", "7700", "7797", "7829", "7937"],
650
+ "0"
644
651
  ],
645
652
  [
646
653
  "jo",
@@ -652,7 +659,8 @@ var factoryOutput = (() => {
652
659
  // Kazakhstan
653
660
  "7",
654
661
  1,
655
- ["33", "7"]
662
+ ["33", "7"],
663
+ "8"
656
664
  ],
657
665
  [
658
666
  "ke",
@@ -784,7 +792,8 @@ var factoryOutput = (() => {
784
792
  // Mayotte
785
793
  "262",
786
794
  1,
787
- ["269", "639"]
795
+ ["269", "639"],
796
+ "0"
788
797
  ],
789
798
  [
790
799
  "mx",
@@ -827,7 +836,9 @@ var factoryOutput = (() => {
827
836
  "ma",
828
837
  // Morocco
829
838
  "212",
830
- 0
839
+ 0,
840
+ null,
841
+ "0"
831
842
  ],
832
843
  [
833
844
  "mz",
@@ -988,7 +999,9 @@ var factoryOutput = (() => {
988
999
  "re",
989
1000
  // Réunion
990
1001
  "262",
991
- 0
1002
+ 0,
1003
+ null,
1004
+ "0"
992
1005
  ],
993
1006
  [
994
1007
  "ro",
@@ -999,7 +1012,9 @@ var factoryOutput = (() => {
999
1012
  "ru",
1000
1013
  // Russia
1001
1014
  "7",
1002
- 0
1015
+ 0,
1016
+ null,
1017
+ "8"
1003
1018
  ],
1004
1019
  [
1005
1020
  "rw",
@@ -1271,7 +1286,9 @@ var factoryOutput = (() => {
1271
1286
  "gb",
1272
1287
  // United Kingdom
1273
1288
  "44",
1274
- 0
1289
+ 0,
1290
+ null,
1291
+ "0"
1275
1292
  ],
1276
1293
  [
1277
1294
  "us",
@@ -1328,7 +1345,8 @@ var factoryOutput = (() => {
1328
1345
  // Western Sahara
1329
1346
  "212",
1330
1347
  1,
1331
- ["5288", "5289"]
1348
+ ["5288", "5289"],
1349
+ "0"
1332
1350
  ],
1333
1351
  [
1334
1352
  "ye",
@@ -1356,8 +1374,8 @@ var factoryOutput = (() => {
1356
1374
  dialCode: c[1],
1357
1375
  priority: c[2] || 0,
1358
1376
  areaCodes: c[3] || null,
1359
- partialAreaCodes: null,
1360
- nodeById: {}
1377
+ nodeById: {},
1378
+ nationalPrefix: c[4] || null
1361
1379
  };
1362
1380
  }
1363
1381
  var data_default = allCountries;
@@ -1881,7 +1899,7 @@ var factoryOutput = (() => {
1881
1899
  }
1882
1900
  }
1883
1901
  }
1884
- //* Generate this.dialCodes and this.dialCodeToIso2Map and country.partialAreaCodes.
1902
+ //* Generate this.dialCodes and this.dialCodeToIso2Map.
1885
1903
  _processDialCodes() {
1886
1904
  this.dialCodes = {};
1887
1905
  this.dialCodeMaxLen = 0;
@@ -1904,12 +1922,6 @@ var factoryOutput = (() => {
1904
1922
  const partialDialCode = c.dialCode + partialAreaCode;
1905
1923
  this._addToDialCodeMap(rootIso2Code, partialDialCode);
1906
1924
  this._addToDialCodeMap(c.iso2, partialDialCode);
1907
- if (!c.partialAreaCodes) {
1908
- c.partialAreaCodes = [];
1909
- }
1910
- if (!c.partialAreaCodes.includes(partialAreaCode)) {
1911
- c.partialAreaCodes.push(partialAreaCode);
1912
- }
1913
1925
  }
1914
1926
  this._addToDialCodeMap(c.iso2, c.dialCode + areaCode);
1915
1927
  }
@@ -2567,49 +2579,37 @@ var factoryOutput = (() => {
2567
2579
  }
2568
2580
  return false;
2569
2581
  }
2570
- //* Check if the given number matches an area code from the selected country.
2571
- _isAreaCodeMatch(numeric, dialCodeNumerics) {
2572
- const { areaCodes, partialAreaCodes, dialCode } = this.selectedCountryData;
2573
- const typedNumber = numeric.substring(dialCode.length);
2574
- const typedAreaCode = dialCodeNumerics.substring(dialCode.length);
2575
- if (areaCodes.includes(typedAreaCode)) {
2576
- return true;
2582
+ _ensureHasDialCode(number) {
2583
+ const { dialCode, nationalPrefix } = this.selectedCountryData;
2584
+ const alreadyHasPlus = number.charAt(0) === "+";
2585
+ if (alreadyHasPlus || !dialCode) {
2586
+ return number;
2577
2587
  }
2578
- if (partialAreaCodes.includes(typedNumber)) {
2579
- return true;
2580
- }
2581
- return false;
2588
+ const hasPrefix = nationalPrefix && number.charAt(0) === nationalPrefix && !this.options.separateDialCode;
2589
+ const cleanNumber = hasPrefix ? number.substring(1) : number;
2590
+ return `+${dialCode}${cleanNumber}`;
2582
2591
  }
2583
2592
  _getCountryFromNumber(fullNumber) {
2584
2593
  const plusIndex = fullNumber.indexOf("+");
2585
2594
  let number = plusIndex ? fullNumber.substring(plusIndex) : fullNumber;
2595
+ const selectedIso2 = this.selectedCountryData.iso2;
2586
2596
  const selectedDialCode = this.selectedCountryData.dialCode;
2587
- const isNanp = selectedDialCode === "1";
2588
- if (number && isNanp && number.charAt(0) !== "+") {
2589
- if (number.charAt(0) !== "1") {
2590
- number = `1${number}`;
2591
- }
2592
- number = `+${number}`;
2593
- }
2594
- if (this.options.separateDialCode && selectedDialCode && number.charAt(0) !== "+") {
2595
- number = `+${selectedDialCode}${number}`;
2597
+ number = this._ensureHasDialCode(number);
2598
+ const dialCodeMatch = this._getDialCode(number, true);
2599
+ if (dialCodeMatch && dialCodeMatch === this.prevDialCodeMatch) {
2600
+ return null;
2596
2601
  }
2597
- const dialCode = this._getDialCode(number, true);
2602
+ this.prevDialCodeMatch = dialCodeMatch;
2598
2603
  const numeric = getNumeric(number);
2599
- if (dialCode) {
2600
- const dialCodeNumerics = getNumeric(dialCode);
2601
- const iso2Codes = this.dialCodeToIso2Map[dialCodeNumerics];
2602
- const alreadySelected = this.selectedCountryData.iso2 && iso2Codes.includes(this.selectedCountryData.iso2);
2603
- let areaCodeMatch = false;
2604
- if (alreadySelected) {
2605
- if (this.selectedCountryData.areaCodes && numeric.length > selectedDialCode.length) {
2606
- areaCodeMatch = this._isAreaCodeMatch(numeric, dialCodeNumerics);
2607
- } else {
2608
- areaCodeMatch = true;
2609
- }
2604
+ if (dialCodeMatch) {
2605
+ const dialCodeMatchNumeric = getNumeric(dialCodeMatch);
2606
+ const iso2Codes = this.dialCodeToIso2Map[dialCodeMatchNumeric];
2607
+ if (!selectedIso2 && this.defaultCountry && iso2Codes.includes(this.defaultCountry)) {
2608
+ return this.defaultCountry;
2610
2609
  }
2610
+ const alreadySelected = selectedIso2 && iso2Codes.includes(selectedIso2) && numeric.length === dialCodeMatchNumeric.length;
2611
2611
  const isRegionlessNanpNumber = selectedDialCode === "1" && isRegionlessNanp(numeric);
2612
- if (!isRegionlessNanpNumber && (!alreadySelected || !areaCodeMatch)) {
2612
+ if (!isRegionlessNanpNumber && !alreadySelected) {
2613
2613
  for (let j = 0; j < iso2Codes.length; j++) {
2614
2614
  if (iso2Codes[j]) {
2615
2615
  return iso2Codes[j];
@@ -3173,7 +3173,7 @@ var factoryOutput = (() => {
3173
3173
  attachUtils,
3174
3174
  startedLoadingUtilsScript: false,
3175
3175
  startedLoadingAutoCountry: false,
3176
- version: "25.0.2"
3176
+ version: "25.1.0"
3177
3177
  }
3178
3178
  );
3179
3179
  var intl_tel_input_default = intlTelInput;