intl-tel-input 27.0.11 → 27.0.16

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/CHANGELOG.md CHANGED
@@ -1,6 +1,6 @@
1
1
  See the Github Releases page for changelog: https://github.com/jackocnr/intl-tel-input/releases
2
2
 
3
- Or to view a specific version, e.g. v27.0.11, update the URL accordingly, e.g. https://github.com/jackocnr/intl-tel-input/releases/tag/v27.0.11
3
+ Or to view a specific version, e.g. v27.0.16, update the URL accordingly, e.g. https://github.com/jackocnr/intl-tel-input/releases/tag/v27.0.16
4
4
 
5
5
  ## Breaking changes
6
6
 
@@ -1862,7 +1862,9 @@ var DATA_KEYS = {
1862
1862
  // e.g. <li data-country-code="us"> for country items in dropdown
1863
1863
  // in the future, the value should be changed to "iso2", but this is a breaking change for another day
1864
1864
  ISO2: "countryCode",
1865
- DIAL_CODE: "dialCode"
1865
+ DIAL_CODE: "dialCode",
1866
+ // e.g. <input data-intl-tel-input-id="0"> on the input element
1867
+ INSTANCE_ID: "intlTelInputId"
1866
1868
  };
1867
1869
  var ARIA = {
1868
1870
  EXPANDED: "aria-expanded",
@@ -1983,7 +1985,7 @@ var warnOption = (optionName, expectedType, actualValue) => {
1983
1985
  );
1984
1986
  };
1985
1987
  var validateIso2Array = (key, value) => {
1986
- const expectedType = "an array of ISO2 country code strings";
1988
+ const expectedType = "an array of iso2 country code strings";
1987
1989
  if (!Array.isArray(value)) {
1988
1990
  warnOption(key, expectedType, value);
1989
1991
  return false;
@@ -1996,7 +1998,7 @@ var validateIso2Array = (key, value) => {
1996
1998
  }
1997
1999
  const lower = v.toLowerCase();
1998
2000
  if (!isIso2(lower)) {
1999
- warn(`Invalid country code in '${key}': '${v}'. Skipping.`);
2001
+ warn(`Invalid iso2 code in '${key}': '${v}'. Skipping.`);
2000
2002
  } else {
2001
2003
  valid.push(v);
2002
2004
  }
@@ -2111,7 +2113,7 @@ var validateOptions = (customOptions) => {
2111
2113
  if (lower && lower !== INITIAL_COUNTRY.AUTO && !isIso2(lower)) {
2112
2114
  warnOption(
2113
2115
  "initialCountry",
2114
- "a valid ISO2 country code or 'auto'",
2116
+ "a valid iso2 country code or 'auto'",
2115
2117
  value
2116
2118
  );
2117
2119
  break;
@@ -2316,7 +2318,7 @@ var UI = class _UI {
2316
2318
  telInputEl;
2317
2319
  hadInitialPlaceholder;
2318
2320
  constructor(input, options, id) {
2319
- input.dataset.intlTelInputId = id.toString();
2321
+ input.dataset[DATA_KEYS.INSTANCE_ID] = id.toString();
2320
2322
  this.telInputEl = input;
2321
2323
  this.#options = options;
2322
2324
  this.#id = id;
@@ -2617,8 +2619,8 @@ var UI = class _UI {
2617
2619
  role: "option",
2618
2620
  [ARIA.SELECTED]: "false"
2619
2621
  });
2620
- listItem.dataset.dialCode = c.dialCode;
2621
- listItem.dataset.countryCode = c.iso2;
2622
+ listItem.dataset[DATA_KEYS.DIAL_CODE] = c.dialCode;
2623
+ listItem.dataset[DATA_KEYS.ISO2] = c.iso2;
2622
2624
  this.#listItemByIso2.set(c.iso2, listItem);
2623
2625
  if (this.#options.showFlags) {
2624
2626
  createEl("div", { class: `${CLASSES.FLAG} iti__${c.iso2}` }, listItem);
@@ -3018,7 +3020,7 @@ var UI = class _UI {
3018
3020
  }
3019
3021
  // Update the selected list item in the dropdown
3020
3022
  #updateSelectedListItem(iso2) {
3021
- if (this.#selectedListItemEl && this.#selectedListItemEl.dataset.countryCode !== iso2) {
3023
+ if (this.#selectedListItemEl && this.#selectedListItemEl.dataset[DATA_KEYS.ISO2] !== iso2) {
3022
3024
  this.#selectedListItemEl.setAttribute(ARIA.SELECTED, "false");
3023
3025
  this.#selectedListItemEl.querySelector(".iti__country-check")?.remove();
3024
3026
  this.#selectedListItemEl = null;
@@ -3200,7 +3202,7 @@ var UI = class _UI {
3200
3202
  }
3201
3203
  destroy() {
3202
3204
  this.telInputEl.iti = void 0;
3203
- delete this.telInputEl.dataset.intlTelInputId;
3205
+ delete this.telInputEl.dataset[DATA_KEYS.INSTANCE_ID];
3204
3206
  this.telInputEl.style.paddingLeft = this.#originalPaddingLeft;
3205
3207
  const wrapper = this.telInputEl.parentNode;
3206
3208
  if (wrapper) {
@@ -4331,7 +4333,7 @@ var Iti = class _Iti {
4331
4333
  }
4332
4334
  const iso2Lower = iso2?.toLowerCase();
4333
4335
  if (!isIso2(iso2Lower)) {
4334
- throw new Error(`Invalid country code: '${iso2Lower}'`);
4336
+ throw new Error(`Invalid iso2 code: '${iso2Lower}'`);
4335
4337
  }
4336
4338
  const currentCountry = this.#selectedCountry?.iso2;
4337
4339
  const isCountryChange = iso2 && iso2Lower !== currentCountry || !iso2 && currentCountry;
@@ -4460,7 +4462,7 @@ var intlTelInput = Object.assign(
4460
4462
  getCountryData: () => data_default,
4461
4463
  //* A getter for the plugin instance.
4462
4464
  getInstance: (input) => {
4463
- const id = input.dataset.intlTelInputId;
4465
+ const id = input.dataset[DATA_KEYS.INSTANCE_ID];
4464
4466
  return id ? intlTelInput.instances.get(id) ?? null : null;
4465
4467
  },
4466
4468
  //* A map from instance ID to instance object.
@@ -4468,7 +4470,7 @@ var intlTelInput = Object.assign(
4468
4470
  attachUtils,
4469
4471
  startedLoadingUtils: false,
4470
4472
  startedLoadingAutoCountry: false,
4471
- version: "27.0.11"
4473
+ version: "27.0.16"
4472
4474
  }
4473
4475
  );
4474
4476
  var intlTelInput_default = intlTelInput;
@@ -4918,7 +4920,7 @@ var IntlTelInput = class _IntlTelInput {
4918
4920
  }] });
4919
4921
  })();
4920
4922
  (() => {
4921
- (typeof ngDevMode === "undefined" || ngDevMode) && i0.\u0275setClassDebugInfo(IntlTelInput, { className: "IntlTelInput", filePath: "intltelinput.ts", lineNumber: 62 });
4923
+ (typeof ngDevMode === "undefined" || ngDevMode) && i0.\u0275setClassDebugInfo(IntlTelInput, { className: "IntlTelInput", filePath: "IntlTelInput.ts", lineNumber: 62 });
4922
4924
  })();
4923
4925
  var IntlTelInput_default = IntlTelInput;
4924
4926
  export {
@@ -1862,7 +1862,9 @@ var DATA_KEYS = {
1862
1862
  // e.g. <li data-country-code="us"> for country items in dropdown
1863
1863
  // in the future, the value should be changed to "iso2", but this is a breaking change for another day
1864
1864
  ISO2: "countryCode",
1865
- DIAL_CODE: "dialCode"
1865
+ DIAL_CODE: "dialCode",
1866
+ // e.g. <input data-intl-tel-input-id="0"> on the input element
1867
+ INSTANCE_ID: "intlTelInputId"
1866
1868
  };
1867
1869
  var ARIA = {
1868
1870
  EXPANDED: "aria-expanded",
@@ -1983,7 +1985,7 @@ var warnOption = (optionName, expectedType, actualValue) => {
1983
1985
  );
1984
1986
  };
1985
1987
  var validateIso2Array = (key, value) => {
1986
- const expectedType = "an array of ISO2 country code strings";
1988
+ const expectedType = "an array of iso2 country code strings";
1987
1989
  if (!Array.isArray(value)) {
1988
1990
  warnOption(key, expectedType, value);
1989
1991
  return false;
@@ -1996,7 +1998,7 @@ var validateIso2Array = (key, value) => {
1996
1998
  }
1997
1999
  const lower = v.toLowerCase();
1998
2000
  if (!isIso2(lower)) {
1999
- warn(`Invalid country code in '${key}': '${v}'. Skipping.`);
2001
+ warn(`Invalid iso2 code in '${key}': '${v}'. Skipping.`);
2000
2002
  } else {
2001
2003
  valid.push(v);
2002
2004
  }
@@ -2111,7 +2113,7 @@ var validateOptions = (customOptions) => {
2111
2113
  if (lower && lower !== INITIAL_COUNTRY.AUTO && !isIso2(lower)) {
2112
2114
  warnOption(
2113
2115
  "initialCountry",
2114
- "a valid ISO2 country code or 'auto'",
2116
+ "a valid iso2 country code or 'auto'",
2115
2117
  value
2116
2118
  );
2117
2119
  break;
@@ -2316,7 +2318,7 @@ var UI = class _UI {
2316
2318
  telInputEl;
2317
2319
  hadInitialPlaceholder;
2318
2320
  constructor(input, options, id) {
2319
- input.dataset.intlTelInputId = id.toString();
2321
+ input.dataset[DATA_KEYS.INSTANCE_ID] = id.toString();
2320
2322
  this.telInputEl = input;
2321
2323
  this.#options = options;
2322
2324
  this.#id = id;
@@ -2617,8 +2619,8 @@ var UI = class _UI {
2617
2619
  role: "option",
2618
2620
  [ARIA.SELECTED]: "false"
2619
2621
  });
2620
- listItem.dataset.dialCode = c.dialCode;
2621
- listItem.dataset.countryCode = c.iso2;
2622
+ listItem.dataset[DATA_KEYS.DIAL_CODE] = c.dialCode;
2623
+ listItem.dataset[DATA_KEYS.ISO2] = c.iso2;
2622
2624
  this.#listItemByIso2.set(c.iso2, listItem);
2623
2625
  if (this.#options.showFlags) {
2624
2626
  createEl("div", { class: `${CLASSES.FLAG} iti__${c.iso2}` }, listItem);
@@ -3018,7 +3020,7 @@ var UI = class _UI {
3018
3020
  }
3019
3021
  // Update the selected list item in the dropdown
3020
3022
  #updateSelectedListItem(iso2) {
3021
- if (this.#selectedListItemEl && this.#selectedListItemEl.dataset.countryCode !== iso2) {
3023
+ if (this.#selectedListItemEl && this.#selectedListItemEl.dataset[DATA_KEYS.ISO2] !== iso2) {
3022
3024
  this.#selectedListItemEl.setAttribute(ARIA.SELECTED, "false");
3023
3025
  this.#selectedListItemEl.querySelector(".iti__country-check")?.remove();
3024
3026
  this.#selectedListItemEl = null;
@@ -3200,7 +3202,7 @@ var UI = class _UI {
3200
3202
  }
3201
3203
  destroy() {
3202
3204
  this.telInputEl.iti = void 0;
3203
- delete this.telInputEl.dataset.intlTelInputId;
3205
+ delete this.telInputEl.dataset[DATA_KEYS.INSTANCE_ID];
3204
3206
  this.telInputEl.style.paddingLeft = this.#originalPaddingLeft;
3205
3207
  const wrapper = this.telInputEl.parentNode;
3206
3208
  if (wrapper) {
@@ -4331,7 +4333,7 @@ var Iti = class _Iti {
4331
4333
  }
4332
4334
  const iso2Lower = iso2?.toLowerCase();
4333
4335
  if (!isIso2(iso2Lower)) {
4334
- throw new Error(`Invalid country code: '${iso2Lower}'`);
4336
+ throw new Error(`Invalid iso2 code: '${iso2Lower}'`);
4335
4337
  }
4336
4338
  const currentCountry = this.#selectedCountry?.iso2;
4337
4339
  const isCountryChange = iso2 && iso2Lower !== currentCountry || !iso2 && currentCountry;
@@ -4460,7 +4462,7 @@ var intlTelInput = Object.assign(
4460
4462
  getCountryData: () => data_default,
4461
4463
  //* A getter for the plugin instance.
4462
4464
  getInstance: (input) => {
4463
- const id = input.dataset.intlTelInputId;
4465
+ const id = input.dataset[DATA_KEYS.INSTANCE_ID];
4464
4466
  return id ? intlTelInput.instances.get(id) ?? null : null;
4465
4467
  },
4466
4468
  //* A map from instance ID to instance object.
@@ -4468,7 +4470,7 @@ var intlTelInput = Object.assign(
4468
4470
  attachUtils,
4469
4471
  startedLoadingUtils: false,
4470
4472
  startedLoadingAutoCountry: false,
4471
- version: "27.0.11"
4473
+ version: "27.0.16"
4472
4474
  }
4473
4475
  );
4474
4476
  var intlTelInput_default = intlTelInput;
@@ -11231,7 +11233,7 @@ var IntlTelInput = class _IntlTelInput {
11231
11233
  }] });
11232
11234
  })();
11233
11235
  (() => {
11234
- (typeof ngDevMode === "undefined" || ngDevMode) && i0.\u0275setClassDebugInfo(IntlTelInput, { className: "IntlTelInput", filePath: "intltelinput.ts", lineNumber: 62 });
11236
+ (typeof ngDevMode === "undefined" || ngDevMode) && i0.\u0275setClassDebugInfo(IntlTelInput, { className: "IntlTelInput", filePath: "IntlTelInput.ts", lineNumber: 62 });
11235
11237
  })();
11236
11238
  var IntlTelInput_default = IntlTelInput;
11237
11239
 
package/dist/js/data.js CHANGED
@@ -1,6 +1,6 @@
1
1
  /*
2
- * International Telephone Input v27.0.11
3
- * https://github.com/jackocnr/intl-tel-input.git
2
+ * International Telephone Input v27.0.16
3
+ * git+https://github.com/jackocnr/intl-tel-input.git
4
4
  * Licensed under the MIT license
5
5
  */
6
6
  "use strict";
@@ -1,6 +1,6 @@
1
1
  /*
2
- * International Telephone Input v27.0.11
3
- * https://github.com/jackocnr/intl-tel-input.git
2
+ * International Telephone Input v27.0.16
3
+ * git+https://github.com/jackocnr/intl-tel-input.git
4
4
  * Licensed under the MIT license
5
5
  */
6
6
  "use strict";var _factory=(()=>{var t=Object.defineProperty;var r=Object.getOwnPropertyDescriptor;var m=Object.getOwnPropertyNames;var g=Object.prototype.hasOwnProperty;var c=(l,n)=>{for(var s in n)t(l,s,{get:n[s],enumerable:!0})},p=(l,n,s,e)=>{if(n&&typeof n=="object"||typeof n=="function")for(let u of m(n))!g.call(l,u)&&u!==s&&t(l,u,{get:()=>n[u],enumerable:!(e=r(n,u))||e.enumerable});return l};var d=l=>p(t({},"__esModule",{value:!0}),l);var y={};c(y,{default:()=>k,isIso2:()=>b,iso2Set:()=>i,rawCountryData:()=>o});var o=[["af","93",0,null,"0"],["ax","358",1,["18","4"],"0"],["al","355",0,null,"0"],["dz","213",0,null,"0"],["as","1",5,["684"],"1"],["ad","376"],["ao","244"],["ai","1",6,["264"],"1"],["ag","1",7,["268"],"1"],["ar","54",0,null,"0"],["am","374",0,null,"0"],["aw","297"],["ac","247"],["au","61",0,["4"],"0"],["at","43",0,null,"0"],["az","994",0,null,"0"],["bs","1",8,["242"],"1"],["bh","973"],["bd","880",0,null,"0"],["bb","1",9,["246"],"1"],["by","375",0,null,"8"],["be","32",0,null,"0"],["bz","501"],["bj","229"],["bm","1",10,["441"],"1"],["bt","975"],["bo","591",0,null,"0"],["ba","387",0,null,"0"],["bw","267"],["br","55",0,null,"0"],["io","246"],["vg","1",11,["284"],"1"],["bn","673"],["bg","359",0,null,"0"],["bf","226"],["bi","257"],["kh","855",0,null,"0"],["cm","237"],["ca","1",1,["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"],"1"],["cv","238"],["bq","599",1,["3","4","7"]],["ky","1",12,["345"],"1"],["cf","236"],["td","235"],["cl","56"],["cn","86",0,null,"0"],["cx","61",2,["4","89164"],"0"],["cc","61",1,["4","89162"],"0"],["co","57",0,null,"0"],["km","269"],["cg","242"],["cd","243",0,null,"0"],["ck","682"],["cr","506"],["ci","225"],["hr","385",0,null,"0"],["cu","53",0,null,"0"],["cw","599",0],["cy","357"],["cz","420"],["dk","45"],["dj","253"],["dm","1",13,["767"],"1"],["do","1",2,["809","829","849"],"1"],["ec","593",0,null,"0"],["eg","20",0,null,"0"],["sv","503"],["gq","240"],["er","291",0,null,"0"],["ee","372"],["sz","268"],["et","251",0,null,"0"],["fk","500"],["fo","298"],["fj","679"],["fi","358",0,["4"],"0"],["fr","33",0,null,"0"],["gf","594",0,null,"0"],["pf","689"],["ga","241"],["gm","220"],["ge","995",0,null,"0"],["de","49",0,null,"0"],["gh","233",0,null,"0"],["gi","350"],["gr","30"],["gl","299"],["gd","1",14,["473"],"1"],["gp","590",0,null,"0"],["gu","1",15,["671"],"1"],["gt","502"],["gg","44",1,["1481","7781","7839","7911"],"0"],["gn","224"],["gw","245"],["gy","592"],["ht","509"],["hn","504"],["hk","852"],["hu","36",0,null,"06"],["is","354"],["in","91",0,null,"0"],["id","62",0,null,"0"],["ir","98",0,null,"0"],["iq","964",0,null,"0"],["ie","353",0,null,"0"],["im","44",2,["1624","74576","7524","7624","7924"],"0"],["il","972",0,null,"0"],["it","39",0,["3"]],["jm","1",4,["658","876"],"1"],["jp","81",0,null,"0"],["je","44",3,["1534","7509","7700","7797","7829","7937"],"0"],["jo","962",0,null,"0"],["kz","7",1,["33","7"],"8"],["ke","254",0,null,"0"],["ki","686",0,null,"0"],["xk","383",0,null,"0"],["kw","965"],["kg","996",0,null,"0"],["la","856",0,null,"0"],["lv","371"],["lb","961",0,null,"0"],["ls","266"],["lr","231",0,null,"0"],["ly","218",0,null,"0"],["li","423",0,null,"0"],["lt","370",0,null,"0"],["lu","352"],["mo","853"],["mg","261",0,null,"0"],["mw","265",0,null,"0"],["my","60",0,null,"0"],["mv","960"],["ml","223"],["mt","356"],["mh","692",0,null,"1"],["mq","596",0,null,"0"],["mr","222"],["mu","230"],["yt","262",1,["269","639"],"0"],["mx","52"],["fm","691"],["md","373",0,null,"0"],["mc","377",0,null,"0"],["mn","976",0,null,"0"],["me","382",0,null,"0"],["ms","1",16,["664"],"1"],["ma","212",0,["6","7"],"0"],["mz","258"],["mm","95",0,null,"0"],["na","264",0,null,"0"],["nr","674"],["np","977",0,null,"0"],["nl","31",0,null,"0"],["nc","687"],["nz","64",0,null,"0"],["ni","505"],["ne","227"],["ng","234",0,null,"0"],["nu","683"],["nf","672"],["kp","850",0,null,"0"],["mk","389",0,null,"0"],["mp","1",17,["670"],"1"],["no","47",0,["4","9"]],["om","968"],["pk","92",0,null,"0"],["pw","680"],["ps","970",0,null,"0"],["pa","507"],["pg","675"],["py","595",0,null,"0"],["pe","51",0,null,"0"],["ph","63",0,null,"0"],["pl","48"],["pt","351"],["pr","1",3,["787","939"],"1"],["qa","974"],["re","262",0,null,"0"],["ro","40",0,null,"0"],["ru","7",0,["33"],"8"],["rw","250",0,null,"0"],["ws","685"],["sm","378"],["st","239"],["sa","966",0,null,"0"],["sn","221"],["rs","381",0,null,"0"],["sc","248"],["sl","232",0,null,"0"],["sg","65"],["sx","1",21,["721"],"1"],["sk","421",0,null,"0"],["si","386",0,null,"0"],["sb","677"],["so","252",0,null,"0"],["za","27",0,null,"0"],["kr","82",0,null,"0"],["ss","211",0,null,"0"],["es","34"],["lk","94",0,null,"0"],["bl","590",1,null,"0"],["sh","290"],["kn","1",18,["869"],"1"],["lc","1",19,["758"],"1"],["mf","590",2,null,"0"],["pm","508",0,null,"0"],["vc","1",20,["784"],"1"],["sd","249",0,null,"0"],["sr","597"],["sj","47",1,["4","79","9"]],["se","46",0,null,"0"],["ch","41",0,null,"0"],["sy","963",0,null,"0"],["tw","886",0,null,"0"],["tj","992"],["tz","255",0,null,"0"],["th","66",0,null,"0"],["tl","670"],["tg","228"],["tk","690"],["to","676"],["tt","1",22,["868"],"1"],["tn","216"],["tr","90",0,null,"0"],["tm","993",0,null,"8"],["tc","1",23,["649"],"1"],["tv","688"],["vi","1",24,["340"],"1"],["ug","256",0,null,"0"],["ua","380",0,null,"0"],["ae","971",0,null,"0"],["gb","44",0,null,"0"],["us","1",0,null,"1"],["uy","598",0,null,"0"],["uz","998"],["vu","678"],["va","39",1,["06698","3"]],["ve","58",0,null,"0"],["vn","84",0,null,"0"],["wf","681"],["eh","212",1,["5288","5289","6","7"],"0"],["ye","967",0,null,"0"],["zm","260",0,null,"0"],["zw","263",0,null,"0"]],a=[];for(let l of o)a.push({name:"",iso2:l[0],dialCode:l[1],priority:l[2]||0,areaCodes:l[3]||null,nationalPrefix:l[4]||null,normalisedName:"",initials:"",dialCodePlus:""});var i=new Set(a.map(l=>l.iso2)),b=l=>i.has(l),k=a;return d(y);})();
@@ -1,6 +1,6 @@
1
1
  /*
2
- * International Telephone Input v27.0.11
3
- * https://github.com/jackocnr/intl-tel-input.git
2
+ * International Telephone Input v27.0.16
3
+ * git+https://github.com/jackocnr/intl-tel-input.git
4
4
  * Licensed under the MIT license
5
5
  */
6
6
  "use strict";
@@ -1896,7 +1896,9 @@ var _factory = (() => {
1896
1896
  // e.g. <li data-country-code="us"> for country items in dropdown
1897
1897
  // in the future, the value should be changed to "iso2", but this is a breaking change for another day
1898
1898
  ISO2: "countryCode",
1899
- DIAL_CODE: "dialCode"
1899
+ DIAL_CODE: "dialCode",
1900
+ // e.g. <input data-intl-tel-input-id="0"> on the input element
1901
+ INSTANCE_ID: "intlTelInputId"
1900
1902
  };
1901
1903
  var ARIA = {
1902
1904
  EXPANDED: "aria-expanded",
@@ -2021,7 +2023,7 @@ var _factory = (() => {
2021
2023
  );
2022
2024
  };
2023
2025
  var validateIso2Array = (key, value) => {
2024
- const expectedType = "an array of ISO2 country code strings";
2026
+ const expectedType = "an array of iso2 country code strings";
2025
2027
  if (!Array.isArray(value)) {
2026
2028
  warnOption(key, expectedType, value);
2027
2029
  return false;
@@ -2034,7 +2036,7 @@ var _factory = (() => {
2034
2036
  }
2035
2037
  const lower = v.toLowerCase();
2036
2038
  if (!isIso2(lower)) {
2037
- warn(`Invalid country code in '${key}': '${v}'. Skipping.`);
2039
+ warn(`Invalid iso2 code in '${key}': '${v}'. Skipping.`);
2038
2040
  } else {
2039
2041
  valid.push(v);
2040
2042
  }
@@ -2149,7 +2151,7 @@ var _factory = (() => {
2149
2151
  if (lower && lower !== INITIAL_COUNTRY.AUTO && !isIso2(lower)) {
2150
2152
  warnOption(
2151
2153
  "initialCountry",
2152
- "a valid ISO2 country code or 'auto'",
2154
+ "a valid iso2 country code or 'auto'",
2153
2155
  value
2154
2156
  );
2155
2157
  break;
@@ -2364,7 +2366,7 @@ var _factory = (() => {
2364
2366
  telInputEl;
2365
2367
  hadInitialPlaceholder;
2366
2368
  constructor(input, options, id) {
2367
- input.dataset.intlTelInputId = id.toString();
2369
+ input.dataset[DATA_KEYS.INSTANCE_ID] = id.toString();
2368
2370
  this.telInputEl = input;
2369
2371
  this.#options = options;
2370
2372
  this.#id = id;
@@ -2665,8 +2667,8 @@ var _factory = (() => {
2665
2667
  role: "option",
2666
2668
  [ARIA.SELECTED]: "false"
2667
2669
  });
2668
- listItem.dataset.dialCode = c.dialCode;
2669
- listItem.dataset.countryCode = c.iso2;
2670
+ listItem.dataset[DATA_KEYS.DIAL_CODE] = c.dialCode;
2671
+ listItem.dataset[DATA_KEYS.ISO2] = c.iso2;
2670
2672
  this.#listItemByIso2.set(c.iso2, listItem);
2671
2673
  if (this.#options.showFlags) {
2672
2674
  createEl("div", { class: `${CLASSES.FLAG} iti__${c.iso2}` }, listItem);
@@ -3066,7 +3068,7 @@ var _factory = (() => {
3066
3068
  }
3067
3069
  // Update the selected list item in the dropdown
3068
3070
  #updateSelectedListItem(iso2) {
3069
- if (this.#selectedListItemEl && this.#selectedListItemEl.dataset.countryCode !== iso2) {
3071
+ if (this.#selectedListItemEl && this.#selectedListItemEl.dataset[DATA_KEYS.ISO2] !== iso2) {
3070
3072
  this.#selectedListItemEl.setAttribute(ARIA.SELECTED, "false");
3071
3073
  this.#selectedListItemEl.querySelector(".iti__country-check")?.remove();
3072
3074
  this.#selectedListItemEl = null;
@@ -3248,7 +3250,7 @@ var _factory = (() => {
3248
3250
  }
3249
3251
  destroy() {
3250
3252
  this.telInputEl.iti = void 0;
3251
- delete this.telInputEl.dataset.intlTelInputId;
3253
+ delete this.telInputEl.dataset[DATA_KEYS.INSTANCE_ID];
3252
3254
  this.telInputEl.style.paddingLeft = this.#originalPaddingLeft;
3253
3255
  const wrapper = this.telInputEl.parentNode;
3254
3256
  if (wrapper) {
@@ -4393,7 +4395,7 @@ var _factory = (() => {
4393
4395
  }
4394
4396
  const iso2Lower = iso2?.toLowerCase();
4395
4397
  if (!isIso2(iso2Lower)) {
4396
- throw new Error(`Invalid country code: '${iso2Lower}'`);
4398
+ throw new Error(`Invalid iso2 code: '${iso2Lower}'`);
4397
4399
  }
4398
4400
  const currentCountry = this.#selectedCountry?.iso2;
4399
4401
  const isCountryChange = iso2 && iso2Lower !== currentCountry || !iso2 && currentCountry;
@@ -4522,7 +4524,7 @@ var _factory = (() => {
4522
4524
  getCountryData: () => data_default,
4523
4525
  //* A getter for the plugin instance.
4524
4526
  getInstance: (input) => {
4525
- const id = input.dataset.intlTelInputId;
4527
+ const id = input.dataset[DATA_KEYS.INSTANCE_ID];
4526
4528
  return id ? intlTelInput.instances.get(id) ?? null : null;
4527
4529
  },
4528
4530
  //* A map from instance ID to instance object.
@@ -4530,7 +4532,7 @@ var _factory = (() => {
4530
4532
  attachUtils,
4531
4533
  startedLoadingUtils: false,
4532
4534
  startedLoadingAutoCountry: false,
4533
- version: "27.0.11"
4535
+ version: "27.0.16"
4534
4536
  }
4535
4537
  );
4536
4538
  var intlTelInput_default = intlTelInput;