intl-tel-input 24.4.0 → 24.5.1

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/vue/README.md CHANGED
@@ -34,44 +34,44 @@ See the [Validation demo](https://github.com/jackocnr/intl-tel-input/blob/master
34
34
  "vue:demo": "vite --config vue/demo/[demo variant]/vite.config.js"
35
35
  ```
36
36
 
37
- A note on the utils script (~260KB): if you're lazy loading the IntlTelInput chunk (and so less worried about filesize) then you can just import IntlTelInput from `"intl-tel-input/vueWithUtils"`, to include the utils script. Alternatively, if you use the main `"intl-tel-input/vue"` import, then you should couple this with the `utilsScript` initialisation option - you will need to host the [utils.js](https://github.com/jackocnr/intl-tel-input/blob/master/build/js/utils.js) file, and then set the `utilsScript` option to that URL, or alternatively just point it to a CDN hosted version e.g. `"https://cdn.jsdelivr.net/npm/intl-tel-input@24.4.0/build/js/utils.js"`.
37
+ A note on the utils script (~260KB): if you're lazy loading the IntlTelInput chunk (and so less worried about filesize) then you can just import IntlTelInput from `"intl-tel-input/vueWithUtils"`, to include the utils script. Alternatively, if you use the main `"intl-tel-input/vue"` import, then you should couple this with the `utilsScript` initialisation option - you will need to host the [utils.js](https://github.com/jackocnr/intl-tel-input/blob/master/build/js/utils.js) file, and then set the `utilsScript` option to that URL, or alternatively just point it to a CDN hosted version e.g. `"https://cdn.jsdelivr.net/npm/intl-tel-input@24.5.1/build/js/utils.js"`.
38
38
 
39
39
  ## Props
40
40
  Here's a list of all of the current props you can pass to the IntlTelInput Vue component.
41
41
 
42
- **disabled**
43
- Type: `Boolean`, Default: `false`
42
+ **disabled**
43
+ Type: `Boolean`, Default: `false`
44
44
  Sets the disabled attribute of both the telephone input and selected country button. *Note: we recommend using this instead of `inputProps.disabled`.*
45
45
 
46
- **inputProps**
47
- Type: `Object`
46
+ **inputProps**
47
+ Type: `Object`
48
48
  The props to pass to the input element e.g. `id`, `class`, `placeholder`, `required`, `onBlur` etc. *Note: we recommend using the separate `disabled` prop instead of `inputProps.disabled`.*
49
49
 
50
- **options**
51
- Type: `Object`
50
+ **options**
51
+ Type: `Object`
52
52
  An object containing the [initialisation options](https://github.com/jackocnr/intl-tel-input?tab=readme-ov-file#initialisation-options) to pass to the plugin. You can use these exactly the same way as with the main JavaScript plugin.
53
53
 
54
- **value**
55
- Type: `String`
54
+ **value**
55
+ Type: `String`
56
56
  The initial value to put in the input. This will get auto-formatted on init (according to `formatOnDisplay` initialisation option). IntlTelInput is an uncontrolled input, and so will ignore any changes to this value.
57
57
 
58
58
  ## Events
59
59
  Here's a list of all of the current events you can listen to on the IntlTelInput Vue component.
60
60
 
61
- **changeCountry**
62
- Type: `Function`
61
+ **changeCountry**
62
+ Type: `Function`
63
63
  A handler to be called when the selected country changes. It will be passed the new country iso2 code e.g. "gb" for UK.
64
64
 
65
- **changeErrorCode**
66
- Type: `Function`
65
+ **changeErrorCode**
66
+ Type: `Function`
67
67
  A handler to be called when the number validation error changes. It will be passed the new error code (or `null`).
68
68
 
69
- **changeNumber**
70
- Type: `Function`
69
+ **changeNumber**
70
+ Type: `Function`
71
71
  A handler to be called when the number changes. It will be passed the new number.
72
72
 
73
- **changeValidity**
74
- Type: `Function`
73
+ **changeValidity**
74
+ Type: `Function`
75
75
  A handler to be called when the number validity changes e.g. to true/false. It will be passed the new isValid boolean.
76
76
 
77
77
  ## Accessing Instance Methods
@@ -1,4 +1,4 @@
1
- import { mergeModels as L, useModel as P, ref as v, onMounted as x, watch as E, onUnmounted as M, withDirectives as B, openBlock as O, createElementBlock as V, mergeProps as F, vModelText as z } from "vue";
1
+ import { mergeModels as L, useModel as x, ref as v, onMounted as E, watch as M, onUnmounted as F, withDirectives as B, openBlock as O, createElementBlock as V, mergeProps as z, vModelText as R } from "vue";
2
2
  const D = [
3
3
  [
4
4
  "af",
@@ -1318,7 +1318,7 @@ for (let u = 0; u < D.length; u++) {
1318
1318
  nodeById: {}
1319
1319
  };
1320
1320
  }
1321
- const R = {
1321
+ const $ = {
1322
1322
  ad: "Andorra",
1323
1323
  ae: "United Arab Emirates",
1324
1324
  af: "Afghanistan",
@@ -1561,7 +1561,7 @@ const R = {
1561
1561
  za: "South Africa",
1562
1562
  zm: "Zambia",
1563
1563
  zw: "Zimbabwe"
1564
- }, $ = {
1564
+ }, j = {
1565
1565
  selectedCountryAriaLabel: "Selected country",
1566
1566
  noCountrySelected: "No country selected",
1567
1567
  countryListAriaLabel: "List of countries",
@@ -1572,10 +1572,10 @@ const R = {
1572
1572
  // additional countries (not supported by country-list library)
1573
1573
  ac: "Ascension Island",
1574
1574
  xk: "Kosovo"
1575
- }, S = { ...R, ...$ };
1575
+ }, S = { ...$, ...j };
1576
1576
  for (let u = 0; u < b.length; u++)
1577
1577
  b[u].name = S[b[u].iso2];
1578
- let j = 0;
1578
+ let K = 0;
1579
1579
  const k = {
1580
1580
  //* Whether or not to allow the dropdown.
1581
1581
  allowDropdown: !0,
@@ -1631,7 +1631,7 @@ const k = {
1631
1631
  utilsScript: "",
1632
1632
  //* The number type to enforce during validation.
1633
1633
  validationNumberType: "MOBILE"
1634
- }, K = [
1634
+ }, U = [
1635
1635
  "800",
1636
1636
  "822",
1637
1637
  "833",
@@ -1649,14 +1649,14 @@ const k = {
1649
1649
  "887",
1650
1650
  "888",
1651
1651
  "889"
1652
- ], I = (u) => u.replace(/\D/g, ""), N = (u = "") => u.normalize("NFD").replace(/[\u0300-\u036f]/g, "").toLowerCase(), A = (u) => {
1653
- const t = I(u);
1652
+ ], w = (u) => u.replace(/\D/g, ""), N = (u = "") => u.normalize("NFD").replace(/[\u0300-\u036f]/g, "").toLowerCase(), A = (u) => {
1653
+ const t = w(u);
1654
1654
  if (t.charAt(0) === "1") {
1655
1655
  const e = t.substr(1, 3);
1656
- return K.indexOf(e) !== -1;
1656
+ return U.indexOf(e) !== -1;
1657
1657
  }
1658
1658
  return !1;
1659
- }, U = (u, t, e, i) => {
1659
+ }, H = (u, t, e, i) => {
1660
1660
  if (e === 0 && !i)
1661
1661
  return 0;
1662
1662
  let s = 0;
@@ -1674,9 +1674,9 @@ const k = {
1674
1674
  const { instances: t } = l;
1675
1675
  Object.values(t).forEach((e) => e[u]());
1676
1676
  };
1677
- class H {
1677
+ class G {
1678
1678
  constructor(t, e = {}) {
1679
- this.id = j++, this.telInput = t, this.highlightedItem = null, this.options = Object.assign({}, k, e), this.hadInitialPlaceholder = !!t.getAttribute("placeholder");
1679
+ this.id = K++, this.telInput = t, this.highlightedItem = null, this.options = Object.assign({}, k, e), this.hadInitialPlaceholder = !!t.getAttribute("placeholder");
1680
1680
  }
1681
1681
  //* Can't be private as it's called from intlTelInput convenience wrapper.
1682
1682
  _init() {
@@ -1781,16 +1781,16 @@ class H {
1781
1781
  fixDropdownWidth: a,
1782
1782
  useFullscreenPopup: r,
1783
1783
  countrySearch: p,
1784
- i18n: d
1784
+ i18n: c
1785
1785
  } = this.options;
1786
- let C = "iti";
1787
- t && (C += " iti--allow-dropdown"), i && (C += " iti--show-flags"), s && (C += ` ${s}`), r || (C += " iti--inline-dropdown");
1788
- const c = y("div", { class: C });
1789
- if ((h = this.telInput.parentNode) == null || h.insertBefore(c, this.telInput), t || i || e) {
1786
+ let d = "iti";
1787
+ t && (d += " iti--allow-dropdown"), i && (d += " iti--show-flags"), s && (d += ` ${s}`), r || (d += " iti--inline-dropdown");
1788
+ const C = y("div", { class: d });
1789
+ if ((h = this.telInput.parentNode) == null || h.insertBefore(C, this.telInput), t || i || e) {
1790
1790
  this.countryContainer = y(
1791
1791
  "div",
1792
1792
  { class: "iti__country-container" },
1793
- c
1793
+ C
1794
1794
  ), this.showSelectedCountryOnLeft ? this.countryContainer.style.left = "0px" : this.countryContainer.style.right = "0px", t ? (this.selectedCountry = y(
1795
1795
  "button",
1796
1796
  {
@@ -1831,10 +1831,10 @@ class H {
1831
1831
  {
1832
1832
  type: "text",
1833
1833
  class: "iti__search-input",
1834
- placeholder: d.searchPlaceholder,
1834
+ placeholder: c.searchPlaceholder,
1835
1835
  role: "combobox",
1836
1836
  "aria-expanded": "true",
1837
- "aria-label": d.searchPlaceholder,
1837
+ "aria-label": c.searchPlaceholder,
1838
1838
  "aria-controls": `iti-${this.id}__country-listbox`,
1839
1839
  "aria-autocomplete": "list",
1840
1840
  autocomplete: "off"
@@ -1850,7 +1850,7 @@ class H {
1850
1850
  class: "iti__country-list",
1851
1851
  id: `iti-${this.id}__country-listbox`,
1852
1852
  role: "listbox",
1853
- "aria-label": d.countryListAriaLabel
1853
+ "aria-label": c.countryListAriaLabel
1854
1854
  },
1855
1855
  this.dropdownContent
1856
1856
  ), this._appendListItems(), p && this._updateSearchResultsText(), o) {
@@ -1860,15 +1860,15 @@ class H {
1860
1860
  this.countryContainer.appendChild(this.dropdownContent);
1861
1861
  }
1862
1862
  }
1863
- if (c.appendChild(this.telInput), this._updateInputPadding(), n) {
1863
+ if (C.appendChild(this.telInput), this._updateInputPadding(), n) {
1864
1864
  const m = this.telInput.getAttribute("name") || "", f = n(m);
1865
1865
  f.phone && (this.hiddenInput = y("input", {
1866
1866
  type: "hidden",
1867
1867
  name: f.phone
1868
- }), c.appendChild(this.hiddenInput)), f.country && (this.hiddenInputCountry = y("input", {
1868
+ }), C.appendChild(this.hiddenInput)), f.country && (this.hiddenInputCountry = y("input", {
1869
1869
  type: "hidden",
1870
1870
  name: f.country
1871
- }), c.appendChild(this.hiddenInputCountry));
1871
+ }), C.appendChild(this.hiddenInputCountry));
1872
1872
  }
1873
1873
  }
1874
1874
  //* For each country: add a country list item <li> to the countryList <ul> container.
@@ -1896,12 +1896,12 @@ class H {
1896
1896
  //* 1. Extracting a dial code from the given number
1897
1897
  //* 2. Using explicit initialCountry
1898
1898
  _setInitialState(t = !1) {
1899
- const e = this.telInput.getAttribute("value"), i = this.telInput.value, n = e && e.charAt(0) === "+" && (!i || i.charAt(0) !== "+") ? e : i, o = this._getDialCode(n), a = A(n), { initialCountry: r, geoIpLookup: p } = this.options, d = r === "auto" && p;
1899
+ const e = this.telInput.getAttribute("value"), i = this.telInput.value, n = e && e.charAt(0) === "+" && (!i || i.charAt(0) !== "+") ? e : i, o = this._getDialCode(n), a = A(n), { initialCountry: r, geoIpLookup: p } = this.options, c = r === "auto" && p;
1900
1900
  if (o && !a)
1901
1901
  this._updateCountryFromNumber(n);
1902
- else if (!d || t) {
1903
- const C = r ? r.toLowerCase() : "";
1904
- C && this._getCountryData(C, !0) ? this._setCountry(C) : o && a ? this._setCountry("us") : this._setCountry();
1902
+ else if (!c || t) {
1903
+ const d = r ? r.toLowerCase() : "";
1904
+ d && this._getCountryData(d, !0) ? this._setCountry(d) : o && a ? this._setCountry("us") : this._setCountry();
1905
1905
  }
1906
1906
  n && this._updateValFromNumber(n);
1907
1907
  }
@@ -1962,17 +1962,17 @@ class H {
1962
1962
  let a = !1;
1963
1963
  new RegExp("\\p{L}", "u").test(this.telInput.value) && (a = !0), this._handleInputEvent = (r) => {
1964
1964
  if (this.isAndroid && (r == null ? void 0 : r.data) === "+" && i && n && o) {
1965
- const c = this.telInput.selectionStart || 0, h = this.telInput.value.substring(0, c - 1), m = this.telInput.value.substring(c);
1965
+ const C = this.telInput.selectionStart || 0, h = this.telInput.value.substring(0, C - 1), m = this.telInput.value.substring(C);
1966
1966
  this.telInput.value = h + m, this._openDropdownWithPlus();
1967
1967
  return;
1968
1968
  }
1969
1969
  this._updateCountryFromNumber(this.telInput.value) && this._triggerCountryChange();
1970
- const p = (r == null ? void 0 : r.data) && /[^+0-9]/.test(r.data), d = (r == null ? void 0 : r.inputType) === "insertFromPaste" && this.telInput.value;
1971
- p || d && !t ? a = !0 : /[^+0-9]/.test(this.telInput.value) || (a = !1);
1972
- const C = (r == null ? void 0 : r.detail) && r.detail.isSetNumber && !s;
1973
- if (e && !a && !C) {
1974
- const c = this.telInput.selectionStart || 0, m = this.telInput.value.substring(0, c).replace(/[^+0-9]/g, "").length, f = (r == null ? void 0 : r.inputType) === "deleteContentForward", g = this._formatNumberAsYouType(), w = U(m, g, c, f);
1975
- this.telInput.value = g, this.telInput.setSelectionRange(w, w);
1970
+ const p = (r == null ? void 0 : r.data) && /[^+0-9]/.test(r.data), c = (r == null ? void 0 : r.inputType) === "insertFromPaste" && this.telInput.value;
1971
+ p || c && !t ? a = !0 : /[^+0-9]/.test(this.telInput.value) || (a = !1);
1972
+ const d = (r == null ? void 0 : r.detail) && r.detail.isSetNumber && !s;
1973
+ if (e && !a && !d) {
1974
+ const C = this.telInput.selectionStart || 0, m = this.telInput.value.substring(0, C).replace(/[^+0-9]/g, "").length, f = (r == null ? void 0 : r.inputType) === "deleteContentForward", g = this._formatNumberAsYouType(), I = H(m, g, C, f);
1975
+ this.telInput.value = g, this.telInput.setSelectionRange(I, I);
1976
1976
  }
1977
1977
  }, this.telInput.addEventListener("input", this._handleInputEvent), (t || i) && (this._handleKeydownEvent = (r) => {
1978
1978
  if (r.key && r.key.length === 1 && !r.altKey && !r.ctrlKey && !r.metaKey) {
@@ -1981,12 +1981,20 @@ class H {
1981
1981
  return;
1982
1982
  }
1983
1983
  if (t) {
1984
- const p = this.telInput.selectionStart === 0 && r.key === "+", d = /^[0-9]$/.test(r.key), C = i ? d : p || d, c = this._getFullNumber(), h = l.utils.getCoreNumber(c, this.selectedCountryData.iso2), m = this.maxCoreNumberLength && h.length >= this.maxCoreNumberLength, f = this.telInput.value.substring(this.telInput.selectionStart, this.telInput.selectionEnd), g = /\d/.test(f), T = (this.telInput.selectionStart || 0) === this.telInput.value.length;
1985
- (!C || m && !g && T) && r.preventDefault();
1984
+ const p = this.telInput.value, d = !(p.charAt(0) === "+") && this.telInput.selectionStart === 0 && r.key === "+", C = /^[0-9]$/.test(r.key), h = i ? C : d || C, m = this._getFullNumber(), f = l.utils.getCoreNumber(m, this.selectedCountryData.iso2), g = this.maxCoreNumberLength && f.length >= this.maxCoreNumberLength, I = p.substring(this.telInput.selectionStart, this.telInput.selectionEnd), T = /\d/.test(I), P = d ? !0 : this._isChangingDialCode(r.key);
1985
+ (!h || g && !T && !P) && r.preventDefault();
1986
1986
  }
1987
1987
  }
1988
1988
  }, this.telInput.addEventListener("keydown", this._handleKeydownEvent));
1989
1989
  }
1990
+ _isChangingDialCode(t) {
1991
+ const e = this.telInput.value;
1992
+ if (e.charAt(0) === "+") {
1993
+ const i = this.selectedCountryData.iso2, s = e.slice(0, this.telInput.selectionStart) + t + e.slice(this.telInput.selectionEnd), n = this._getFullNumber(s);
1994
+ return this._getCountryFromNumber(n) !== i;
1995
+ }
1996
+ return !1;
1997
+ }
1990
1998
  //* Adhere to the input's maxlength attr.
1991
1999
  _cap(t) {
1992
2000
  const e = parseInt(this.telInput.getAttribute("maxlength") || "", 10);
@@ -2073,10 +2081,10 @@ class H {
2073
2081
  this.countryList.innerHTML = "";
2074
2082
  const s = N(t);
2075
2083
  for (let n = 0; n < this.countries.length; n++) {
2076
- const o = this.countries[n], a = N(o.name), r = o.name.split(/[^a-zA-ZÀ-ÿа-яА-Я]/).map((d) => d[0]).join("").toLowerCase(), p = `+${o.dialCode}`;
2084
+ const o = this.countries[n], a = N(o.name), r = o.name.split(/[^a-zA-ZÀ-ÿа-яА-Я]/).map((c) => c[0]).join("").toLowerCase(), p = `+${o.dialCode}`;
2077
2085
  if (e || a.includes(s) || p.includes(s) || o.iso2.includes(s) || r.includes(s)) {
2078
- const d = o.nodeById[this.id];
2079
- d && this.countryList.appendChild(d), i && (this._highlightListItem(d, !1), i = !1);
2086
+ const c = o.nodeById[this.id];
2087
+ c && this.countryList.appendChild(c), i && (this._highlightListItem(c, !1), i = !1);
2080
2088
  }
2081
2089
  }
2082
2090
  i && this._highlightListItem(null, !1), this.countryList.scrollTop = 0, this._updateSearchResultsText();
@@ -2114,23 +2122,29 @@ class H {
2114
2122
  //* Check if need to select a new country based on the given number
2115
2123
  //* Note: called from _setInitialState, keyup handler, setNumber.
2116
2124
  _updateCountryFromNumber(t) {
2125
+ const e = this._getCountryFromNumber(t);
2126
+ return e !== null ? this._setCountry(e) : !1;
2127
+ }
2128
+ _getCountryFromNumber(t) {
2117
2129
  const e = t.indexOf("+");
2118
2130
  let i = e ? t.substring(e) : t;
2119
2131
  const s = this.selectedCountryData.dialCode;
2120
2132
  i && s === "1" && i.charAt(0) !== "+" && (i.charAt(0) !== "1" && (i = `1${i}`), i = `+${i}`), this.options.separateDialCode && s && i.charAt(0) !== "+" && (i = `+${s}${i}`);
2121
- const o = this._getDialCode(i, !0), a = I(i);
2122
- let r = null;
2133
+ const o = this._getDialCode(i, !0), a = w(i);
2123
2134
  if (o) {
2124
- const p = this.dialCodeToIso2Map[I(o)], d = p.indexOf(this.selectedCountryData.iso2) !== -1 && a.length <= o.length - 1;
2125
- if (!(s === "1" && A(a)) && !d) {
2126
- for (let c = 0; c < p.length; c++)
2127
- if (p[c]) {
2128
- r = p[c];
2129
- break;
2130
- }
2135
+ const r = this.dialCodeToIso2Map[w(o)], p = r.indexOf(this.selectedCountryData.iso2) !== -1 && a.length <= o.length - 1;
2136
+ if (!(s === "1" && A(a)) && !p) {
2137
+ for (let d = 0; d < r.length; d++)
2138
+ if (r[d])
2139
+ return r[d];
2131
2140
  }
2132
- } else i.charAt(0) === "+" && a.length ? r = "" : (!i || i === "+") && !this.selectedCountryData.iso2 && (r = this.defaultCountry);
2133
- return r !== null ? this._setCountry(r) : !1;
2141
+ } else {
2142
+ if (i.charAt(0) === "+" && a.length)
2143
+ return "";
2144
+ if ((!i || i === "+") && !this.selectedCountryData.iso2)
2145
+ return this.defaultCountry;
2146
+ }
2147
+ return null;
2134
2148
  }
2135
2149
  //* Remove highlighting from other list items and highlight the given item.
2136
2150
  _highlightListItem(t, e) {
@@ -2252,12 +2266,12 @@ class H {
2252
2266
  }
2253
2267
  //* Check if an element is visible within it's container, else scroll until it is.
2254
2268
  _scrollTo(t) {
2255
- const e = this.countryList, i = document.documentElement.scrollTop, s = e.offsetHeight, n = e.getBoundingClientRect().top + i, o = n + s, a = t.offsetHeight, r = t.getBoundingClientRect().top + i, p = r + a, d = r - n + e.scrollTop;
2269
+ const e = this.countryList, i = document.documentElement.scrollTop, s = e.offsetHeight, n = e.getBoundingClientRect().top + i, o = n + s, a = t.offsetHeight, r = t.getBoundingClientRect().top + i, p = r + a, c = r - n + e.scrollTop;
2256
2270
  if (r < n)
2257
- e.scrollTop = d;
2271
+ e.scrollTop = c;
2258
2272
  else if (p > o) {
2259
- const C = s - a;
2260
- e.scrollTop = d - C;
2273
+ const d = s - a;
2274
+ e.scrollTop = c - d;
2261
2275
  }
2262
2276
  }
2263
2277
  //* Replace any existing dial code with the new one
@@ -2293,11 +2307,11 @@ class H {
2293
2307
  return i;
2294
2308
  }
2295
2309
  //* Get the input val, adding the dial code if separateDialCode is enabled.
2296
- _getFullNumber() {
2297
- const t = this.telInput.value.trim(), { dialCode: e } = this.selectedCountryData;
2298
- let i;
2299
- const s = I(t);
2300
- return this.options.separateDialCode && t.charAt(0) !== "+" && e && s ? i = `+${e}` : i = "", i + t;
2310
+ _getFullNumber(t) {
2311
+ const e = t || this.telInput.value.trim(), { dialCode: i } = this.selectedCountryData;
2312
+ let s;
2313
+ const n = w(e);
2314
+ return this.options.separateDialCode && e.charAt(0) !== "+" && i && n ? s = `+${i}` : s = "", s + e;
2301
2315
  }
2302
2316
  //* Remove the dial code if separateDialCode is enabled also cap the length if the input has a maxlength attribute
2303
2317
  _beforeSetNumber(t) {
@@ -2439,7 +2453,7 @@ class H {
2439
2453
  this.telInput.disabled = t, t ? this.selectedCountry.setAttribute("disabled", "true") : this.selectedCountry.removeAttribute("disabled");
2440
2454
  }
2441
2455
  }
2442
- const G = (u) => !l.utils && !l.startedLoadingUtilsScript ? (l.startedLoadingUtilsScript = !0, new Promise((t, e) => {
2456
+ const W = (u) => !l.utils && !l.startedLoadingUtilsScript ? (l.startedLoadingUtilsScript = !0, new Promise((t, e) => {
2443
2457
  import(
2444
2458
  /* webpackIgnore: true */
2445
2459
  /* @vite-ignore */
@@ -2451,7 +2465,7 @@ const G = (u) => !l.utils && !l.startedLoadingUtilsScript ? (l.startedLoadingUti
2451
2465
  });
2452
2466
  })) : null, l = Object.assign(
2453
2467
  (u, t) => {
2454
- const e = new H(u, t);
2468
+ const e = new G(u, t);
2455
2469
  return e._init(), u.setAttribute("data-intl-tel-input-id", e.id.toString()), l.instances[e.id] = e, e;
2456
2470
  },
2457
2471
  {
@@ -2467,10 +2481,10 @@ const G = (u) => !l.utils && !l.startedLoadingUtilsScript ? (l.startedLoadingUti
2467
2481
  },
2468
2482
  //* A map from instance ID to instance object.
2469
2483
  instances: {},
2470
- loadUtils: G,
2471
- version: "24.4.0"
2484
+ loadUtils: W,
2485
+ version: "24.5.1"
2472
2486
  }
2473
- ), q = {
2487
+ ), Y = {
2474
2488
  __name: "IntlTelInput",
2475
2489
  props: /* @__PURE__ */ L({
2476
2490
  disabled: {
@@ -2503,42 +2517,42 @@ const G = (u) => !l.utils && !l.startedLoadingUtilsScript ? (l.startedLoadingUti
2503
2517
  "changeErrorCode"
2504
2518
  ], ["update:modelValue"]),
2505
2519
  setup(u, { expose: t, emit: e }) {
2506
- const i = P(u, "modelValue"), s = u, n = e, o = v(), a = v(), r = v(!1), p = () => a.value ? s.options.strictMode ? a.value.isValidNumberPrecise() : a.value.isValidNumber() : null, d = () => {
2520
+ const i = x(u, "modelValue"), s = u, n = e, o = v(), a = v(), r = v(!1), p = () => a.value ? s.options.strictMode ? a.value.isValidNumberPrecise() : a.value.isValidNumber() : null, c = () => {
2507
2521
  let h = p();
2508
2522
  r.value !== h && (r.value = h, n("changeValidity", !!h), n(
2509
2523
  "changeErrorCode",
2510
2524
  h ? null : a.value.getValidationError()
2511
2525
  ));
2512
- }, C = () => {
2526
+ }, d = () => {
2513
2527
  var h;
2514
- n("changeNumber", ((h = a.value) == null ? void 0 : h.getNumber()) ?? ""), d();
2515
- }, c = () => {
2528
+ n("changeNumber", ((h = a.value) == null ? void 0 : h.getNumber()) ?? ""), c();
2529
+ }, C = () => {
2516
2530
  var h;
2517
- n("changeCountry", ((h = a.value) == null ? void 0 : h.getSelectedCountryData().iso2) ?? ""), C(), d();
2531
+ n("changeCountry", ((h = a.value) == null ? void 0 : h.getSelectedCountryData().iso2) ?? ""), d(), c();
2518
2532
  };
2519
- return x(() => {
2533
+ return E(() => {
2520
2534
  o.value && (a.value = l(o.value, s.options), s.value && a.value.setNumber(s.value), s.disabled && a.value.setDisabled(s.disabled));
2521
- }), E(
2535
+ }), M(
2522
2536
  () => s.disabled,
2523
2537
  (h) => {
2524
2538
  var m;
2525
2539
  return (m = a.value) == null ? void 0 : m.setDisabled(h);
2526
2540
  }
2527
- ), M(() => {
2541
+ ), F(() => {
2528
2542
  var h;
2529
2543
  return (h = a.value) == null ? void 0 : h.destroy();
2530
- }), t({ instance: a, input: o }), (h, m) => B((O(), V("input", F({
2544
+ }), t({ instance: a, input: o }), (h, m) => B((O(), V("input", z({
2531
2545
  ref_key: "input",
2532
2546
  ref: o,
2533
2547
  "onUpdate:modelValue": m[0] || (m[0] = (f) => i.value = f),
2534
2548
  type: "tel",
2535
- onCountrychange: c,
2536
- onInput: C
2549
+ onCountrychange: C,
2550
+ onInput: d
2537
2551
  }, u.inputProps), null, 16)), [
2538
- [z, i.value]
2552
+ [R, i.value]
2539
2553
  ]);
2540
2554
  }
2541
2555
  };
2542
2556
  export {
2543
- q as default
2557
+ Y as default
2544
2558
  };