intl-tel-input 25.7.0 → 25.8.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.
@@ -1,4 +1,4 @@
1
- import { mergeModels as r2, useModel as M2, ref as I1, onMounted as D2, watch as P2, onUnmounted as x2, withDirectives as R2, createElementBlock as B2, openBlock as k2, mergeProps as O2, vModelText as G2 } from "vue";
1
+ import { mergeModels as r2, useModel as D2, ref as v1, onMounted as x2, watch as P2, onUnmounted as R2, withDirectives as B2, createElementBlock as k2, openBlock as O2, mergeProps as G2, vModelText as U2 } from "vue";
2
2
  const F2 = [
3
3
  [
4
4
  "af",
@@ -1322,9 +1322,9 @@ const F2 = [
1322
1322
  // Zimbabwe
1323
1323
  "263"
1324
1324
  ]
1325
- ], J = [];
1325
+ ], q = [];
1326
1326
  for (const y of F2)
1327
- J.push({
1327
+ q.push({
1328
1328
  name: "",
1329
1329
  // populated in the plugin
1330
1330
  iso2: y[0],
@@ -1335,7 +1335,7 @@ for (const y of F2)
1335
1335
  // populated by the plugin
1336
1336
  nationalPrefix: y[4] || null
1337
1337
  });
1338
- const U2 = {
1338
+ const V2 = {
1339
1339
  ad: "Andorra",
1340
1340
  ae: "United Arab Emirates",
1341
1341
  af: "Afghanistan",
@@ -1578,28 +1578,29 @@ const U2 = {
1578
1578
  za: "South Africa",
1579
1579
  zm: "Zambia",
1580
1580
  zw: "Zimbabwe"
1581
- }, V2 = {
1581
+ }, K2 = {
1582
1582
  selectedCountryAriaLabel: "Selected country",
1583
1583
  noCountrySelected: "No country selected",
1584
1584
  countryListAriaLabel: "List of countries",
1585
1585
  searchPlaceholder: "Search",
1586
+ clearSearchAriaLabel: "Clear search",
1586
1587
  zeroSearchResults: "No results found",
1587
1588
  oneSearchResult: "1 result found",
1588
1589
  multipleSearchResults: "${count} results found",
1589
1590
  // additional countries (not supported by country-list library)
1590
1591
  ac: "Ascension Island",
1591
1592
  xk: "Kosovo"
1592
- }, u2 = { ...U2, ...V2 };
1593
- for (const y of J)
1593
+ }, u2 = { ...V2, ...K2 };
1594
+ for (const y of q)
1594
1595
  y.name = u2[y.iso2];
1595
- let K2 = 0;
1596
- const v1 = (y) => typeof window < "u" && typeof window.matchMedia == "function" && window.matchMedia(y).matches, H2 = () => {
1596
+ let H2 = 0;
1597
+ const S1 = (y) => typeof window < "u" && typeof window.matchMedia == "function" && window.matchMedia(y).matches, j2 = () => {
1597
1598
  if (typeof navigator < "u" && typeof window < "u") {
1598
- const y = /Android.+Mobile|webOS|iPhone|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent), e = v1("(max-width: 500px)"), n = v1("(max-height: 600px)"), r = v1("(pointer: coarse)");
1599
- return y || e || r && n;
1599
+ const y = /Android.+Mobile|webOS|iPhone|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent), e = S1("(max-width: 500px)"), i = S1("(max-height: 600px)"), s = S1("(pointer: coarse)");
1600
+ return y || e || s && i;
1600
1601
  }
1601
1602
  return !1;
1602
- }, a2 = {
1603
+ }, l2 = {
1603
1604
  //* Whether or not to allow the dropdown.
1604
1605
  allowDropdown: !0,
1605
1606
  //* Add a placeholder in the input with an example number for the selected country.
@@ -1645,10 +1646,10 @@ const v1 = (y) => typeof window < "u" && typeof window.matchMedia == "function"
1645
1646
  //* Only allow certain chars e.g. a plus followed by numeric digits, and cap at max valid length.
1646
1647
  strictMode: !1,
1647
1648
  //* Use full screen popup instead of dropdown for country list.
1648
- useFullscreenPopup: H2(),
1649
+ useFullscreenPopup: j2(),
1649
1650
  //* The number type to enforce during validation.
1650
1651
  validationNumberTypes: ["MOBILE"]
1651
- }, j2 = [
1652
+ }, W2 = [
1652
1653
  "800",
1653
1654
  "822",
1654
1655
  "833",
@@ -1666,46 +1667,53 @@ const v1 = (y) => typeof window < "u" && typeof window.matchMedia == "function"
1666
1667
  "887",
1667
1668
  "888",
1668
1669
  "889"
1669
- ], c1 = (y) => y.replace(/\D/g, ""), s2 = (y = "") => y.normalize("NFD").replace(/[\u0300-\u036f]/g, "").toLowerCase(), o2 = (y) => {
1670
- const e = c1(y);
1670
+ ], f1 = (y) => y.replace(/\D/g, ""), o2 = (y = "") => y.normalize("NFD").replace(/[\u0300-\u036f]/g, "").toLowerCase(), a2 = (y) => {
1671
+ const e = f1(y);
1671
1672
  if (e.charAt(0) === "1") {
1672
- const n = e.substring(1, 4);
1673
- return j2.includes(n);
1673
+ const i = e.substring(1, 4);
1674
+ return W2.includes(i);
1674
1675
  }
1675
1676
  return !1;
1676
- }, W2 = (y, e, n, r) => {
1677
- if (n === 0 && !r)
1677
+ }, z2 = (y, e, i, s) => {
1678
+ if (i === 0 && !s)
1678
1679
  return 0;
1679
- let s = 0;
1680
+ let r = 0;
1680
1681
  for (let l = 0; l < e.length; l++) {
1681
- if (/[+0-9]/.test(e[l]) && s++, s === y && !r)
1682
+ if (/[+0-9]/.test(e[l]) && r++, r === y && !s)
1682
1683
  return l + 1;
1683
- if (r && s === y + 1)
1684
+ if (s && r === y + 1)
1684
1685
  return l;
1685
1686
  }
1686
1687
  return e.length;
1687
- }, A = (y, e, n) => {
1688
- const r = document.createElement(y);
1689
- return e && Object.entries(e).forEach(([s, l]) => r.setAttribute(s, l)), n && n.appendChild(r), r;
1690
- }, $1 = (y, ...e) => {
1691
- const { instances: n } = m;
1692
- Object.values(n).forEach((r) => r[y](...e));
1688
+ }, T = (y, e, i) => {
1689
+ const s = document.createElement(y);
1690
+ return e && Object.entries(e).forEach(([r, l]) => s.setAttribute(r, l)), i && i.appendChild(s), s;
1691
+ }, i1 = (y, ...e) => {
1692
+ const { instances: i } = m;
1693
+ Object.values(i).forEach((s) => s[y](...e));
1693
1694
  };
1694
- class z2 {
1695
- constructor(e, n = {}) {
1696
- this.id = K2++, this.telInput = e, this.highlightedItem = null, this.options = Object.assign({}, a2, n), this.hadInitialPlaceholder = !!e.getAttribute("placeholder");
1695
+ class p1 {
1696
+ /**
1697
+ * Build a space-delimited class string from an object map of className -> truthy/falsey.
1698
+ * Only keys with truthy values are included.
1699
+ */
1700
+ static _buildClassNames(e) {
1701
+ return Object.keys(e).filter((i) => !!e[i]).join(" ");
1702
+ }
1703
+ constructor(e, i = {}) {
1704
+ this.id = H2++, this.telInput = e, this.highlightedItem = null, this.options = Object.assign({}, l2, i), this.hadInitialPlaceholder = !!e.getAttribute("placeholder");
1697
1705
  }
1698
1706
  //* Can't be private as it's called from intlTelInput convenience wrapper.
1699
1707
  _init() {
1700
1708
  this.options.useFullscreenPopup && (this.options.fixDropdownWidth = !1), this.options.onlyCountries.length === 1 && (this.options.initialCountry = this.options.onlyCountries[0]), this.options.separateDialCode && (this.options.nationalMode = !1), this.options.allowDropdown && !this.options.showFlags && !this.options.separateDialCode && (this.options.nationalMode = !1), this.options.useFullscreenPopup && !this.options.dropdownContainer && (this.options.dropdownContainer = document.body), this.isAndroid = typeof navigator < "u" ? /Android/i.test(navigator.userAgent) : !1, this.isRTL = !!this.telInput.closest("[dir=rtl]"), this.telInput.dir = "ltr";
1701
1709
  const e = this.options.allowDropdown || this.options.separateDialCode;
1702
1710
  this.showSelectedCountryOnLeft = this.isRTL ? !e : e, this.options.separateDialCode && (this.isRTL ? this.originalPaddingRight = this.telInput.style.paddingRight : this.originalPaddingLeft = this.telInput.style.paddingLeft), this.options.i18n = { ...u2, ...this.options.i18n };
1703
- const n = new Promise((s, l) => {
1704
- this.resolveAutoCountryPromise = s, this.rejectAutoCountryPromise = l;
1705
- }), r = new Promise((s, l) => {
1706
- this.resolveUtilsScriptPromise = s, this.rejectUtilsScriptPromise = l;
1711
+ const i = new Promise((r, l) => {
1712
+ this.resolveAutoCountryPromise = r, this.rejectAutoCountryPromise = l;
1713
+ }), s = new Promise((r, l) => {
1714
+ this.resolveUtilsScriptPromise = r, this.rejectUtilsScriptPromise = l;
1707
1715
  });
1708
- this.promise = Promise.all([n, r]), this.selectedCountryData = {}, this._processCountryData(), this._generateMarkup(), this._setInitialState(), this._initListeners(), this._initRequests();
1716
+ this.promise = Promise.all([i, s]), this.selectedCountryData = {}, this._processCountryData(), this._generateMarkup(), this._setInitialState(), this._initListeners(), this._initRequests();
1709
1717
  }
1710
1718
  //********************
1711
1719
  //* PRIVATE METHODS
@@ -1717,54 +1725,54 @@ class z2 {
1717
1725
  //* Precompute and cache country search tokens to speed up filtering
1718
1726
  _cacheSearchTokens() {
1719
1727
  for (const e of this.countries)
1720
- e.normalisedName = s2(e.name), e.initials = e.name.split(/[^a-zA-ZÀ-ÿа-яА-Я]/).map((n) => n[0]).join("").toLowerCase(), e.dialCodePlus = `+${e.dialCode}`;
1728
+ e.normalisedName = o2(e.name), e.initials = e.name.split(/[^a-zA-ZÀ-ÿа-яА-Я]/).map((i) => i[0]).join("").toLowerCase(), e.dialCodePlus = `+${e.dialCode}`;
1721
1729
  }
1722
1730
  //* Sort countries by countryOrder option (if present), then name.
1723
1731
  _sortCountries() {
1724
- this.options.countryOrder && (this.options.countryOrder = this.options.countryOrder.map((e) => e.toLowerCase())), this.countries.sort((e, n) => {
1725
- const { countryOrder: r } = this.options;
1726
- if (r) {
1727
- const s = r.indexOf(e.iso2), l = r.indexOf(n.iso2), c = s > -1, C = l > -1;
1732
+ this.options.countryOrder && (this.options.countryOrder = this.options.countryOrder.map((e) => e.toLowerCase())), this.countries.sort((e, i) => {
1733
+ const { countryOrder: s } = this.options;
1734
+ if (s) {
1735
+ const r = s.indexOf(e.iso2), l = s.indexOf(i.iso2), c = r > -1, C = l > -1;
1728
1736
  if (c || C)
1729
- return c && C ? s - l : c ? -1 : 1;
1737
+ return c && C ? r - l : c ? -1 : 1;
1730
1738
  }
1731
- return e.name.localeCompare(n.name);
1739
+ return e.name.localeCompare(i.name);
1732
1740
  });
1733
1741
  }
1734
1742
  //* Add a dial code to this.dialCodeToIso2Map.
1735
- _addToDialCodeMap(e, n, r) {
1736
- n.length > this.dialCodeMaxLen && (this.dialCodeMaxLen = n.length), this.dialCodeToIso2Map.hasOwnProperty(n) || (this.dialCodeToIso2Map[n] = []);
1737
- const s = this.dialCodeToIso2Map[n];
1738
- if (s.includes(e))
1743
+ _addToDialCodeMap(e, i, s) {
1744
+ i.length > this.dialCodeMaxLen && (this.dialCodeMaxLen = i.length), this.dialCodeToIso2Map.hasOwnProperty(i) || (this.dialCodeToIso2Map[i] = []);
1745
+ const r = this.dialCodeToIso2Map[i];
1746
+ if (r.includes(e))
1739
1747
  return;
1740
- const l = r !== void 0 ? r : s.length;
1741
- s[l] = e;
1748
+ const l = s !== void 0 ? s : r.length;
1749
+ r[l] = e;
1742
1750
  }
1743
1751
  //* Process onlyCountries or excludeCountries array if present.
1744
1752
  _processAllCountries() {
1745
- const { onlyCountries: e, excludeCountries: n } = this.options;
1753
+ const { onlyCountries: e, excludeCountries: i } = this.options;
1746
1754
  if (e.length) {
1747
- const r = e.map(
1748
- (s) => s.toLowerCase()
1755
+ const s = e.map(
1756
+ (r) => r.toLowerCase()
1749
1757
  );
1750
- this.countries = J.filter(
1751
- (s) => r.includes(s.iso2)
1758
+ this.countries = q.filter(
1759
+ (r) => s.includes(r.iso2)
1752
1760
  );
1753
- } else if (n.length) {
1754
- const r = n.map(
1755
- (s) => s.toLowerCase()
1761
+ } else if (i.length) {
1762
+ const s = i.map(
1763
+ (r) => r.toLowerCase()
1756
1764
  );
1757
- this.countries = J.filter(
1758
- (s) => !r.includes(s.iso2)
1765
+ this.countries = q.filter(
1766
+ (r) => !s.includes(r.iso2)
1759
1767
  );
1760
1768
  } else
1761
- this.countries = J;
1769
+ this.countries = q;
1762
1770
  }
1763
1771
  //* Translate Countries by object literal provided on config.
1764
1772
  _translateCountryNames() {
1765
1773
  for (const e of this.countries) {
1766
- const n = e.iso2.toLowerCase();
1767
- this.options.i18n.hasOwnProperty(n) && (e.name = this.options.i18n[n]);
1774
+ const i = e.iso2.toLowerCase();
1775
+ this.options.i18n.hasOwnProperty(i) && (e.name = this.options.i18n[i]);
1768
1776
  }
1769
1777
  }
1770
1778
  //* Generate this.dialCodes and this.dialCodeToIso2Map.
@@ -1774,121 +1782,179 @@ class z2 {
1774
1782
  this.dialCodes.has(e.dialCode) || this.dialCodes.add(e.dialCode), this._addToDialCodeMap(e.iso2, e.dialCode, e.priority);
1775
1783
  for (const e of this.countries)
1776
1784
  if (e.areaCodes) {
1777
- const n = this.dialCodeToIso2Map[e.dialCode][0];
1778
- for (const r of e.areaCodes) {
1779
- for (let s = 1; s < r.length; s++) {
1780
- const l = r.substring(0, s), c = e.dialCode + l;
1781
- this._addToDialCodeMap(n, c), this._addToDialCodeMap(e.iso2, c);
1785
+ const i = this.dialCodeToIso2Map[e.dialCode][0];
1786
+ for (const s of e.areaCodes) {
1787
+ for (let r = 1; r < s.length; r++) {
1788
+ const l = s.substring(0, r), c = e.dialCode + l;
1789
+ this._addToDialCodeMap(i, c), this._addToDialCodeMap(e.iso2, c);
1782
1790
  }
1783
- this._addToDialCodeMap(e.iso2, e.dialCode + r);
1791
+ this._addToDialCodeMap(e.iso2, e.dialCode + s);
1784
1792
  }
1785
1793
  }
1786
1794
  }
1787
1795
  //* Generate all of the markup for the plugin: the selected country overlay, and the dropdown.
1788
1796
  _generateMarkup() {
1789
- var f, I, G;
1797
+ var p, I, G;
1790
1798
  this.telInput.classList.add("iti__tel-input"), !this.telInput.hasAttribute("autocomplete") && !(this.telInput.form && this.telInput.form.hasAttribute("autocomplete")) && this.telInput.setAttribute("autocomplete", "off");
1791
1799
  const {
1792
1800
  allowDropdown: e,
1793
- separateDialCode: n,
1794
- showFlags: r,
1795
- containerClass: s,
1801
+ separateDialCode: i,
1802
+ showFlags: s,
1803
+ containerClass: r,
1796
1804
  hiddenInput: l,
1797
1805
  dropdownContainer: c,
1798
1806
  fixDropdownWidth: C,
1799
- useFullscreenPopup: p,
1800
- countrySearch: w,
1801
- i18n: b
1802
- } = this.options;
1803
- let v = "iti";
1804
- e && (v += " iti--allow-dropdown"), r && (v += " iti--show-flags"), s && (v += ` ${s}`), p || (v += " iti--inline-dropdown");
1805
- const L = A("div", { class: v });
1806
- if ((f = this.telInput.parentNode) == null || f.insertBefore(L, this.telInput), e || r || n) {
1807
- this.countryContainer = A(
1807
+ useFullscreenPopup: f,
1808
+ countrySearch: S,
1809
+ i18n: w
1810
+ } = this.options, b = p1._buildClassNames({
1811
+ iti: !0,
1812
+ "iti--allow-dropdown": e,
1813
+ "iti--show-flags": s,
1814
+ "iti--inline-dropdown": !f,
1815
+ [r]: !!r
1816
+ }), L = T("div", { class: b });
1817
+ if ((p = this.telInput.parentNode) == null || p.insertBefore(L, this.telInput), e || s || i) {
1818
+ this.countryContainer = T(
1808
1819
  "div",
1809
1820
  { class: "iti__country-container" },
1810
1821
  L
1811
- ), this.showSelectedCountryOnLeft ? this.countryContainer.style.left = "0px" : this.countryContainer.style.right = "0px", e ? (this.selectedCountry = A(
1822
+ ), this.showSelectedCountryOnLeft ? this.countryContainer.style.left = "0px" : this.countryContainer.style.right = "0px", e ? (this.selectedCountry = T(
1812
1823
  "button",
1813
1824
  {
1814
1825
  type: "button",
1815
1826
  class: "iti__selected-country",
1816
1827
  "aria-expanded": "false",
1817
1828
  "aria-label": this.options.i18n.selectedCountryAriaLabel,
1818
- "aria-haspopup": "true",
1819
- "aria-controls": `iti-${this.id}__dropdown-content`,
1820
- role: "combobox"
1829
+ "aria-haspopup": "dialog",
1830
+ "aria-controls": `iti-${this.id}__dropdown-content`
1821
1831
  },
1822
1832
  this.countryContainer
1823
- ), this.telInput.disabled && this.selectedCountry.setAttribute("disabled", "true")) : this.selectedCountry = A(
1833
+ ), this.telInput.disabled && this.selectedCountry.setAttribute("disabled", "true")) : this.selectedCountry = T(
1824
1834
  "div",
1825
1835
  { class: "iti__selected-country" },
1826
1836
  this.countryContainer
1827
1837
  );
1828
- const F = A("div", { class: "iti__selected-country-primary" }, this.selectedCountry);
1829
- if (this.selectedCountryInner = A("div", { class: "iti__flag" }, F), this.selectedCountryA11yText = A(
1838
+ const U = T("div", { class: "iti__selected-country-primary" }, this.selectedCountry);
1839
+ if (this.selectedCountryInner = T("div", { class: "iti__flag" }, U), this.selectedCountryA11yText = T(
1830
1840
  "span",
1831
1841
  { class: "iti__a11y-text" },
1832
1842
  this.selectedCountryInner
1833
- ), e && (this.dropdownArrow = A(
1843
+ ), e && (this.dropdownArrow = T(
1834
1844
  "div",
1835
1845
  { class: "iti__arrow", "aria-hidden": "true" },
1836
- F
1837
- )), n && (this.selectedDialCode = A(
1846
+ U
1847
+ )), i && (this.selectedDialCode = T(
1838
1848
  "div",
1839
1849
  { class: "iti__selected-dial-code", "aria-hidden": "true", dir: "ltr" },
1840
1850
  this.selectedCountry
1841
1851
  )), e) {
1842
1852
  const D = C ? "" : "iti--flexible-dropdown-width";
1843
- if (this.dropdownContent = A("div", {
1853
+ if (this.dropdownContent = T("div", {
1844
1854
  id: `iti-${this.id}__dropdown-content`,
1845
- class: `iti__dropdown-content iti__hide ${D}`
1846
- }), w && (this.searchInput = A(
1847
- "input",
1848
- {
1849
- type: "text",
1850
- class: "iti__search-input",
1851
- placeholder: b.searchPlaceholder,
1852
- role: "combobox",
1853
- "aria-expanded": "true",
1854
- "aria-label": b.searchPlaceholder,
1855
- "aria-controls": `iti-${this.id}__country-listbox`,
1856
- "aria-autocomplete": "list",
1857
- autocomplete: "off"
1858
- },
1859
- this.dropdownContent
1860
- ), this.searchResultsA11yText = A(
1861
- "span",
1862
- { class: "iti__a11y-text" },
1863
- this.dropdownContent
1864
- )), this.countryList = A(
1855
+ class: `iti__dropdown-content iti__hide ${D}`,
1856
+ role: "dialog",
1857
+ "aria-modal": "true"
1858
+ }), S) {
1859
+ const P = T(
1860
+ "div",
1861
+ { class: "iti__search-input-wrapper" },
1862
+ this.dropdownContent
1863
+ );
1864
+ this.searchIcon = T(
1865
+ "span",
1866
+ {
1867
+ class: "iti__search-icon",
1868
+ "aria-hidden": "true"
1869
+ },
1870
+ P
1871
+ ), this.searchIcon.innerHTML = `
1872
+ <svg class="iti__search-icon-svg" width="14" height="14" viewBox="0 0 24 24" focusable="false" aria-hidden="true">
1873
+ <circle cx="11" cy="11" r="7" />
1874
+ <line x1="21" y1="21" x2="16.65" y2="16.65" />
1875
+ </svg>`, this.searchInput = T(
1876
+ "input",
1877
+ {
1878
+ id: `iti-${this.id}__search-input`,
1879
+ // Chrome says inputs need either a name or an id
1880
+ type: "search",
1881
+ class: "iti__search-input",
1882
+ placeholder: w.searchPlaceholder,
1883
+ // role=combobox + aria-autocomplete=list + aria-activedescendant allows maintaining focus on the search input while allowing users to navigate search results with up/down keyboard keys
1884
+ role: "combobox",
1885
+ "aria-expanded": "true",
1886
+ "aria-label": w.searchPlaceholder,
1887
+ "aria-controls": `iti-${this.id}__country-listbox`,
1888
+ "aria-autocomplete": "list",
1889
+ autocomplete: "off"
1890
+ },
1891
+ P
1892
+ ), this.searchClearButton = T(
1893
+ "button",
1894
+ {
1895
+ type: "button",
1896
+ class: "iti__search-clear iti__hide",
1897
+ "aria-label": w.clearSearchAriaLabel,
1898
+ tabindex: "-1"
1899
+ },
1900
+ P
1901
+ );
1902
+ const Y = `iti-${this.id}-clear-mask`;
1903
+ this.searchClearButton.innerHTML = `
1904
+ <svg class="iti__search-clear-svg" width="12" height="12" viewBox="0 0 16 16" aria-hidden="true" focusable="false">
1905
+ <mask id="${Y}" maskUnits="userSpaceOnUse">
1906
+ <rect width="16" height="16" fill="white" />
1907
+ <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" />
1908
+ </mask>
1909
+ <circle cx="8" cy="8" r="8" class="iti__search-clear-bg" mask="url(#${Y})" />
1910
+ </svg>`, this.searchResultsA11yText = T(
1911
+ "span",
1912
+ { class: "iti__a11y-text" },
1913
+ this.dropdownContent
1914
+ ), this.searchNoResults = T(
1915
+ "div",
1916
+ {
1917
+ class: "iti__no-results iti__hide",
1918
+ "aria-hidden": "true"
1919
+ // all a11y messaging happens in this.searchResultsA11yText
1920
+ },
1921
+ this.dropdownContent
1922
+ ), this.searchNoResults.textContent = w.zeroSearchResults;
1923
+ }
1924
+ if (this.countryList = T(
1865
1925
  "ul",
1866
1926
  {
1867
1927
  class: "iti__country-list",
1868
1928
  id: `iti-${this.id}__country-listbox`,
1869
1929
  role: "listbox",
1870
- "aria-label": b.countryListAriaLabel
1930
+ "aria-label": w.countryListAriaLabel
1871
1931
  },
1872
1932
  this.dropdownContent
1873
- ), this._appendListItems(), w && this._updateSearchResultsText(), c) {
1874
- let k = "iti iti--container";
1875
- s && (k += ` ${s}`), p ? k += " iti--fullscreen-popup" : k += " iti--inline-dropdown", this.dropdown = A("div", { class: k }), this.dropdown.appendChild(this.dropdownContent);
1933
+ ), this._appendListItems(), S && this._updateSearchResultsA11yText(), c) {
1934
+ const P = p1._buildClassNames({
1935
+ iti: !0,
1936
+ "iti--container": !0,
1937
+ "iti--fullscreen-popup": f,
1938
+ "iti--inline-dropdown": !f,
1939
+ [r]: !!r
1940
+ });
1941
+ this.dropdown = T("div", { class: P }), this.dropdown.appendChild(this.dropdownContent);
1876
1942
  } else
1877
1943
  this.countryContainer.appendChild(this.dropdownContent);
1878
1944
  }
1879
1945
  }
1880
1946
  if (L.appendChild(this.telInput), this._updateInputPadding(), l) {
1881
- const F = this.telInput.getAttribute("name") || "", D = l(F);
1947
+ const U = this.telInput.getAttribute("name") || "", D = l(U);
1882
1948
  if (D.phone) {
1883
- const k = (I = this.telInput.form) == null ? void 0 : I.querySelector(`input[name="${D.phone}"]`);
1884
- k ? this.hiddenInput = k : (this.hiddenInput = A("input", {
1949
+ const P = (I = this.telInput.form) == null ? void 0 : I.querySelector(`input[name="${D.phone}"]`);
1950
+ P ? this.hiddenInput = P : (this.hiddenInput = T("input", {
1885
1951
  type: "hidden",
1886
1952
  name: D.phone
1887
1953
  }), L.appendChild(this.hiddenInput));
1888
1954
  }
1889
1955
  if (D.country) {
1890
- const k = (G = this.telInput.form) == null ? void 0 : G.querySelector(`input[name="${D.country}"]`);
1891
- k ? this.hiddenInputCountry = k : (this.hiddenInputCountry = A("input", {
1956
+ const P = (G = this.telInput.form) == null ? void 0 : G.querySelector(`input[name="${D.country}"]`);
1957
+ P ? this.hiddenInputCountry = P : (this.hiddenInputCountry = T("input", {
1892
1958
  type: "hidden",
1893
1959
  name: D.country
1894
1960
  }), L.appendChild(this.hiddenInputCountry));
@@ -1898,34 +1964,34 @@ class z2 {
1898
1964
  //* For each country: add a country list item <li> to the countryList <ul> container.
1899
1965
  _appendListItems() {
1900
1966
  for (let e = 0; e < this.countries.length; e++) {
1901
- const n = this.countries[e], r = e === 0 ? "iti__highlight" : "", s = A(
1967
+ const i = this.countries[e], s = e === 0 ? "iti__highlight" : "", r = T(
1902
1968
  "li",
1903
1969
  {
1904
- id: `iti-${this.id}__item-${n.iso2}`,
1905
- class: `iti__country ${r}`,
1970
+ id: `iti-${this.id}__item-${i.iso2}`,
1971
+ class: `iti__country ${s}`,
1906
1972
  tabindex: "-1",
1907
1973
  role: "option",
1908
- "data-dial-code": n.dialCode,
1909
- "data-country-code": n.iso2,
1974
+ "data-dial-code": i.dialCode,
1975
+ "data-country-code": i.iso2,
1910
1976
  "aria-selected": "false"
1911
1977
  },
1912
1978
  this.countryList
1913
1979
  );
1914
- n.nodeById[this.id] = s;
1980
+ i.nodeById[this.id] = r;
1915
1981
  let l = "";
1916
- this.options.showFlags && (l += `<div class='iti__flag iti__${n.iso2}'></div>`), l += `<span class='iti__country-name'>${n.name}</span>`, l += `<span class='iti__dial-code' dir='ltr'>+${n.dialCode}</span>`, s.insertAdjacentHTML("beforeend", l);
1982
+ this.options.showFlags && (l += `<div class='iti__flag iti__${i.iso2}'></div>`), l += `<span class='iti__country-name'>${i.name}</span>`, l += `<span class='iti__dial-code' dir='ltr'>+${i.dialCode}</span>`, r.insertAdjacentHTML("beforeend", l);
1917
1983
  }
1918
1984
  }
1919
1985
  //* Set the initial state of the input value and the selected country by:
1920
1986
  //* 1. Extracting a dial code from the given number
1921
1987
  //* 2. Using explicit initialCountry
1922
1988
  _setInitialState(e = !1) {
1923
- const n = this.telInput.getAttribute("value"), r = this.telInput.value, l = n && n.charAt(0) === "+" && (!r || r.charAt(0) !== "+") ? n : r, c = this._getDialCode(l), C = o2(l), { initialCountry: p, geoIpLookup: w } = this.options, b = p === "auto" && w;
1989
+ const i = this.telInput.getAttribute("value"), s = this.telInput.value, l = i && i.charAt(0) === "+" && (!s || s.charAt(0) !== "+") ? i : s, c = this._getDialCode(l), C = a2(l), { initialCountry: f, geoIpLookup: S } = this.options, w = f === "auto" && S;
1924
1990
  if (c && !C)
1925
1991
  this._updateCountryFromNumber(l);
1926
- else if (!b || e) {
1927
- const v = p ? p.toLowerCase() : "";
1928
- v && this._getCountryData(v, !0) ? this._setCountry(v) : c && C ? this._setCountry("us") : this._setCountry();
1992
+ else if (!w || e) {
1993
+ const b = f ? f.toLowerCase() : "";
1994
+ b && this._getCountryData(b, !0) ? this._setCountry(b) : c && C ? this._setCountry("us") : this._setCountry();
1929
1995
  }
1930
1996
  l && this._updateValFromNumber(l);
1931
1997
  }
@@ -1945,14 +2011,14 @@ class z2 {
1945
2011
  }
1946
2012
  //* initialise the dropdown listeners.
1947
2013
  _initDropdownListeners() {
1948
- this._handleLabelClick = (n) => {
1949
- this.dropdownContent.classList.contains("iti__hide") ? this.telInput.focus() : n.preventDefault();
2014
+ this._handleLabelClick = (i) => {
2015
+ this.dropdownContent.classList.contains("iti__hide") ? this.telInput.focus() : i.preventDefault();
1950
2016
  };
1951
2017
  const e = this.telInput.closest("label");
1952
2018
  e && e.addEventListener("click", this._handleLabelClick), this._handleClickSelectedCountry = () => {
1953
2019
  this.dropdownContent.classList.contains("iti__hide") && !this.telInput.disabled && !this.telInput.readOnly && this._openDropdown();
1954
- }, this.selectedCountry.addEventListener("click", this._handleClickSelectedCountry), this._handleCountryContainerKeydown = (n) => {
1955
- this.dropdownContent.classList.contains("iti__hide") && ["ArrowUp", "ArrowDown", " ", "Enter"].includes(n.key) && (n.preventDefault(), n.stopPropagation(), this._openDropdown()), n.key === "Tab" && this._closeDropdown();
2020
+ }, this.selectedCountry.addEventListener("click", this._handleClickSelectedCountry), this._handleCountryContainerKeydown = (i) => {
2021
+ this.dropdownContent.classList.contains("iti__hide") && ["ArrowUp", "ArrowDown", " ", "Enter"].includes(i.key) && (i.preventDefault(), i.stopPropagation(), this._openDropdown()), i.key === "Tab" && this._closeDropdown();
1956
2022
  }, this.countryContainer.addEventListener(
1957
2023
  "keydown",
1958
2024
  this._handleCountryContainerKeydown
@@ -1960,22 +2026,22 @@ class z2 {
1960
2026
  }
1961
2027
  //* Init many requests: utils script / geo ip lookup.
1962
2028
  _initRequests() {
1963
- let { loadUtils: e, initialCountry: n, geoIpLookup: r } = this.options;
2029
+ let { loadUtils: e, initialCountry: i, geoIpLookup: s } = this.options;
1964
2030
  e && !m.utils ? (this._handlePageLoad = () => {
1965
2031
  var l;
1966
2032
  window.removeEventListener("load", this._handlePageLoad), (l = m.attachUtils(e)) == null || l.catch(() => {
1967
2033
  });
1968
- }, m.documentReady() ? this._handlePageLoad() : window.addEventListener("load", this._handlePageLoad)) : this.resolveUtilsScriptPromise(), n === "auto" && r && !this.selectedCountryData.iso2 ? this._loadAutoCountry() : this.resolveAutoCountryPromise();
2034
+ }, m.documentReady() ? this._handlePageLoad() : window.addEventListener("load", this._handlePageLoad)) : this.resolveUtilsScriptPromise(), i === "auto" && s && !this.selectedCountryData.iso2 ? this._loadAutoCountry() : this.resolveAutoCountryPromise();
1969
2035
  }
1970
2036
  //* Perform the geo ip lookup.
1971
2037
  _loadAutoCountry() {
1972
2038
  m.autoCountry ? this.handleAutoCountry() : m.startedLoadingAutoCountry || (m.startedLoadingAutoCountry = !0, typeof this.options.geoIpLookup == "function" && this.options.geoIpLookup(
1973
2039
  (e = "") => {
1974
- const n = e.toLowerCase();
1975
- n && this._getCountryData(n, !0) ? (m.autoCountry = n, setTimeout(() => $1("handleAutoCountry"))) : (this._setInitialState(!0), $1("rejectAutoCountryPromise"));
2040
+ const i = e.toLowerCase();
2041
+ i && this._getCountryData(i, !0) ? (m.autoCountry = i, setTimeout(() => i1("handleAutoCountry"))) : (this._setInitialState(!0), i1("rejectAutoCountryPromise"));
1976
2042
  },
1977
2043
  () => {
1978
- this._setInitialState(!0), $1("rejectAutoCountryPromise");
2044
+ this._setInitialState(!0), i1("rejectAutoCountryPromise");
1979
2045
  }
1980
2046
  ));
1981
2047
  }
@@ -1984,77 +2050,77 @@ class z2 {
1984
2050
  }
1985
2051
  //* Initialize the tel input listeners.
1986
2052
  _initTelInputListeners() {
1987
- const { strictMode: e, formatAsYouType: n, separateDialCode: r, formatOnDisplay: s, allowDropdown: l, countrySearch: c } = this.options;
2053
+ const { strictMode: e, formatAsYouType: i, separateDialCode: s, formatOnDisplay: r, allowDropdown: l, countrySearch: c } = this.options;
1988
2054
  let C = !1;
1989
- new RegExp("\\p{L}", "u").test(this.telInput.value) && (C = !0), this._handleInputEvent = (p) => {
1990
- if (this.isAndroid && (p == null ? void 0 : p.data) === "+" && r && l && c) {
1991
- const L = this.telInput.selectionStart || 0, f = this.telInput.value.substring(0, L - 1), I = this.telInput.value.substring(L);
1992
- this.telInput.value = f + I, this._openDropdownWithPlus();
2055
+ new RegExp("\\p{L}", "u").test(this.telInput.value) && (C = !0), this._handleInputEvent = (f) => {
2056
+ if (this.isAndroid && (f == null ? void 0 : f.data) === "+" && s && l && c) {
2057
+ const L = this.telInput.selectionStart || 0, p = this.telInput.value.substring(0, L - 1), I = this.telInput.value.substring(L);
2058
+ this.telInput.value = p + I, this._openDropdownWithPlus();
1993
2059
  return;
1994
2060
  }
1995
2061
  this._updateCountryFromNumber(this.telInput.value) && this._triggerCountryChange();
1996
- const w = (p == null ? void 0 : p.data) && /[^+0-9]/.test(p.data), b = (p == null ? void 0 : p.inputType) === "insertFromPaste" && this.telInput.value;
1997
- w || b && !e ? C = !0 : /[^+0-9]/.test(this.telInput.value) || (C = !1);
1998
- const v = (p == null ? void 0 : p.detail) && p.detail.isSetNumber && !s;
1999
- if (n && !C && !v) {
2000
- const L = this.telInput.selectionStart || 0, I = this.telInput.value.substring(0, L).replace(/[^+0-9]/g, "").length, G = (p == null ? void 0 : p.inputType) === "deleteContentForward", F = this._formatNumberAsYouType(), D = W2(I, F, L, G);
2001
- this.telInput.value = F, this.telInput.setSelectionRange(D, D);
2062
+ const S = (f == null ? void 0 : f.data) && /[^+0-9]/.test(f.data), w = (f == null ? void 0 : f.inputType) === "insertFromPaste" && this.telInput.value;
2063
+ S || w && !e ? C = !0 : /[^+0-9]/.test(this.telInput.value) || (C = !1);
2064
+ const b = (f == null ? void 0 : f.detail) && f.detail.isSetNumber && !r;
2065
+ if (i && !C && !b) {
2066
+ const L = this.telInput.selectionStart || 0, I = this.telInput.value.substring(0, L).replace(/[^+0-9]/g, "").length, G = (f == null ? void 0 : f.inputType) === "deleteContentForward", U = this._formatNumberAsYouType(), D = z2(I, U, L, G);
2067
+ this.telInput.value = U, this.telInput.setSelectionRange(D, D);
2002
2068
  }
2003
- }, this.telInput.addEventListener("input", this._handleInputEvent), (e || r) && (this._handleKeydownEvent = (p) => {
2004
- if (p.key && p.key.length === 1 && !p.altKey && !p.ctrlKey && !p.metaKey) {
2005
- if (r && l && c && p.key === "+") {
2006
- p.preventDefault(), this._openDropdownWithPlus();
2069
+ }, this.telInput.addEventListener("input", this._handleInputEvent), (e || s) && (this._handleKeydownEvent = (f) => {
2070
+ if (f.key && f.key.length === 1 && !f.altKey && !f.ctrlKey && !f.metaKey) {
2071
+ if (s && l && c && f.key === "+") {
2072
+ f.preventDefault(), this._openDropdownWithPlus();
2007
2073
  return;
2008
2074
  }
2009
2075
  if (e) {
2010
- const w = this.telInput.value, v = !(w.charAt(0) === "+") && this.telInput.selectionStart === 0 && p.key === "+", L = /^[0-9]$/.test(p.key), f = r ? L : v || L, I = w.slice(0, this.telInput.selectionStart) + p.key + w.slice(this.telInput.selectionEnd), G = this._getFullNumber(I), F = m.utils.getCoreNumber(G, this.selectedCountryData.iso2), D = this.maxCoreNumberLength && F.length > this.maxCoreNumberLength, f1 = this._getNewCountryFromNumber(G) !== null;
2011
- (!f || D && !f1 && !v) && p.preventDefault();
2076
+ const S = this.telInput.value, b = !(S.charAt(0) === "+") && this.telInput.selectionStart === 0 && f.key === "+", L = /^[0-9]$/.test(f.key), p = s ? L : b || L, I = S.slice(0, this.telInput.selectionStart) + f.key + S.slice(this.telInput.selectionEnd), G = this._getFullNumber(I), U = m.utils.getCoreNumber(G, this.selectedCountryData.iso2), D = this.maxCoreNumberLength && U.length > this.maxCoreNumberLength, Y = this._getNewCountryFromNumber(G) !== null;
2077
+ (!p || D && !Y && !b) && f.preventDefault();
2012
2078
  }
2013
2079
  }
2014
2080
  }, this.telInput.addEventListener("keydown", this._handleKeydownEvent));
2015
2081
  }
2016
2082
  //* Adhere to the input's maxlength attr.
2017
2083
  _cap(e) {
2018
- const n = parseInt(this.telInput.getAttribute("maxlength") || "", 10);
2019
- return n && e.length > n ? e.substring(0, n) : e;
2084
+ const i = parseInt(this.telInput.getAttribute("maxlength") || "", 10);
2085
+ return i && e.length > i ? e.substring(0, i) : e;
2020
2086
  }
2021
2087
  //* Trigger a custom event on the input.
2022
- _trigger(e, n = {}) {
2023
- const r = new CustomEvent(e, {
2088
+ _trigger(e, i = {}) {
2089
+ const s = new CustomEvent(e, {
2024
2090
  bubbles: !0,
2025
2091
  cancelable: !0,
2026
- detail: n
2092
+ detail: i
2027
2093
  });
2028
- this.telInput.dispatchEvent(r);
2094
+ this.telInput.dispatchEvent(s);
2029
2095
  }
2030
2096
  //* Open the dropdown.
2031
2097
  _openDropdown() {
2032
- const { fixDropdownWidth: e, countrySearch: n } = this.options;
2033
- if (e && (this.dropdownContent.style.width = `${this.telInput.offsetWidth}px`), this.dropdownContent.classList.remove("iti__hide"), this.selectedCountry.setAttribute("aria-expanded", "true"), this._setDropdownPosition(), n) {
2034
- const r = this.countryList.firstElementChild;
2035
- r && (this._highlightListItem(r, !1), this.countryList.scrollTop = 0), this.searchInput.focus();
2098
+ const { fixDropdownWidth: e, countrySearch: i } = this.options;
2099
+ if (e && (this.dropdownContent.style.width = `${this.telInput.offsetWidth}px`), this.dropdownContent.classList.remove("iti__hide"), this.selectedCountry.setAttribute("aria-expanded", "true"), this._setDropdownPosition(), i) {
2100
+ const s = this.countryList.firstElementChild;
2101
+ s && (this._highlightListItem(s, !1), this.countryList.scrollTop = 0), this.searchInput.focus();
2036
2102
  }
2037
2103
  this._bindDropdownListeners(), this.dropdownArrow.classList.add("iti__arrow--up"), this._trigger("open:countrydropdown");
2038
2104
  }
2039
2105
  //* Set the dropdown position
2040
2106
  _setDropdownPosition() {
2041
2107
  if (this.options.dropdownContainer && this.options.dropdownContainer.appendChild(this.dropdown), !this.options.useFullscreenPopup) {
2042
- const e = this.telInput.getBoundingClientRect(), n = this.telInput.offsetHeight;
2043
- this.options.dropdownContainer && (this.dropdown.style.top = `${e.top + n}px`, this.dropdown.style.left = `${e.left}px`, this._handleWindowScroll = () => this._closeDropdown(), window.addEventListener("scroll", this._handleWindowScroll));
2108
+ const e = this.telInput.getBoundingClientRect(), i = this.telInput.offsetHeight;
2109
+ this.options.dropdownContainer && (this.dropdown.style.top = `${e.top + i}px`, this.dropdown.style.left = `${e.left}px`, this._handleWindowScroll = () => this._closeDropdown(), window.addEventListener("scroll", this._handleWindowScroll));
2044
2110
  }
2045
2111
  }
2046
2112
  //* We only bind dropdown listeners when the dropdown is open.
2047
2113
  _bindDropdownListeners() {
2048
- this._handleMouseoverCountryList = (s) => {
2114
+ this._handleMouseoverCountryList = (r) => {
2049
2115
  var c;
2050
- const l = (c = s.target) == null ? void 0 : c.closest(".iti__country");
2116
+ const l = (c = r.target) == null ? void 0 : c.closest(".iti__country");
2051
2117
  l && this._highlightListItem(l, !1);
2052
2118
  }, this.countryList.addEventListener(
2053
2119
  "mouseover",
2054
2120
  this._handleMouseoverCountryList
2055
- ), this._handleClickCountryList = (s) => {
2121
+ ), this._handleClickCountryList = (r) => {
2056
2122
  var c;
2057
- const l = (c = s.target) == null ? void 0 : c.closest(".iti__country");
2123
+ const l = (c = r.target) == null ? void 0 : c.closest(".iti__country");
2058
2124
  l && this._selectListItem(l);
2059
2125
  }, this.countryList.addEventListener("click", this._handleClickCountryList);
2060
2126
  let e = !0;
@@ -2064,65 +2130,67 @@ class z2 {
2064
2130
  "click",
2065
2131
  this._handleClickOffToClose
2066
2132
  );
2067
- let n = "", r = null;
2068
- if (this._handleKeydownOnDropdown = (s) => {
2069
- ["ArrowUp", "ArrowDown", "Enter", "Escape"].includes(s.key) && (s.preventDefault(), s.stopPropagation(), s.key === "ArrowUp" || s.key === "ArrowDown" ? this._handleUpDownKey(s.key) : s.key === "Enter" ? this._handleEnterKey() : s.key === "Escape" && this._closeDropdown()), !this.options.countrySearch && /^[a-zA-ZÀ-ÿа-яА-Я ]$/.test(s.key) && (s.stopPropagation(), r && clearTimeout(r), n += s.key.toLowerCase(), this._searchForCountry(n), r = setTimeout(() => {
2070
- n = "";
2133
+ let i = "", s = null;
2134
+ if (this._handleKeydownOnDropdown = (r) => {
2135
+ ["ArrowUp", "ArrowDown", "Enter", "Escape"].includes(r.key) && (r.preventDefault(), r.stopPropagation(), r.key === "ArrowUp" || r.key === "ArrowDown" ? this._handleUpDownKey(r.key) : r.key === "Enter" ? this._handleEnterKey() : r.key === "Escape" && this._closeDropdown()), !this.options.countrySearch && /^[a-zA-ZÀ-ÿа-яА-Я ]$/.test(r.key) && (r.stopPropagation(), s && clearTimeout(s), i += r.key.toLowerCase(), this._searchForCountry(i), s = setTimeout(() => {
2136
+ i = "";
2071
2137
  }, 1e3));
2072
2138
  }, document.addEventListener("keydown", this._handleKeydownOnDropdown), this.options.countrySearch) {
2073
- const s = () => {
2139
+ const r = () => {
2074
2140
  const c = this.searchInput.value.trim();
2075
- c ? this._filterCountries(c) : this._filterCountries("", !0);
2141
+ c ? this._filterCountries(c) : this._filterCountries("", !0), this.searchInput.value ? this.searchClearButton.classList.remove("iti__hide") : this.searchClearButton.classList.add("iti__hide");
2076
2142
  };
2077
2143
  let l = null;
2078
2144
  this._handleSearchChange = () => {
2079
2145
  l && clearTimeout(l), l = setTimeout(() => {
2080
- s(), l = null;
2146
+ r(), l = null;
2081
2147
  }, 100);
2082
- }, this.searchInput.addEventListener("input", this._handleSearchChange), this.searchInput.addEventListener("click", (c) => c.stopPropagation());
2148
+ }, this.searchInput.addEventListener("input", this._handleSearchChange), this._handleSearchClear = (c) => {
2149
+ c.stopPropagation(), this.searchInput.value = "", this.searchInput.focus(), r();
2150
+ }, this.searchClearButton.addEventListener("click", this._handleSearchClear), this.searchInput.addEventListener("click", (c) => c.stopPropagation());
2083
2151
  }
2084
2152
  }
2085
2153
  //* Hidden search (countrySearch disabled): Find the first list item whose name starts with the query string.
2086
2154
  _searchForCountry(e) {
2087
- for (const n of this.countries)
2088
- if (n.name.substring(0, e.length).toLowerCase() === e) {
2089
- const s = n.nodeById[this.id];
2090
- this._highlightListItem(s, !1), this._scrollTo(s);
2155
+ for (const i of this.countries)
2156
+ if (i.name.substring(0, e.length).toLowerCase() === e) {
2157
+ const r = i.nodeById[this.id];
2158
+ this._highlightListItem(r, !1), this._scrollTo(r);
2091
2159
  break;
2092
2160
  }
2093
2161
  }
2094
2162
  //* Country search enabled: Filter the countries according to the search query.
2095
- _filterCountries(e, n = !1) {
2096
- let r = !0;
2163
+ _filterCountries(e, i = !1) {
2164
+ let s = !0;
2097
2165
  this.countryList.innerHTML = "";
2098
- const s = s2(e), l = s.length, c = [], C = [], p = [], w = [], b = [], v = [];
2099
- for (const f of this.countries)
2100
- n || l === 0 ? p.push(f) : f.iso2 === s ? c.push(f) : f.normalisedName.startsWith(s) ? C.push(f) : f.normalisedName.includes(s) ? p.push(f) : s === f.dialCode || s === f.dialCodePlus ? w.push(f) : f.dialCodePlus.includes(s) ? b.push(f) : f.initials.includes(s) && v.push(f);
2166
+ const r = o2(e), l = r.length, c = [], C = [], f = [], S = [], w = [], b = [];
2167
+ for (const p of this.countries)
2168
+ i || l === 0 ? f.push(p) : p.iso2 === r ? c.push(p) : p.normalisedName.startsWith(r) ? C.push(p) : p.normalisedName.includes(r) ? f.push(p) : r === p.dialCode || r === p.dialCodePlus ? S.push(p) : p.dialCodePlus.includes(r) ? w.push(p) : p.initials.includes(r) && b.push(p);
2101
2169
  const L = [
2102
- ...c.sort((f, I) => f.priority - I.priority),
2103
- ...C.sort((f, I) => f.priority - I.priority),
2104
- ...p.sort((f, I) => f.priority - I.priority),
2105
- ...w.sort((f, I) => f.priority - I.priority),
2106
- ...b.sort((f, I) => f.priority - I.priority),
2107
- ...v.sort((f, I) => f.priority - I.priority)
2170
+ ...c.sort((p, I) => p.priority - I.priority),
2171
+ ...C.sort((p, I) => p.priority - I.priority),
2172
+ ...f.sort((p, I) => p.priority - I.priority),
2173
+ ...S.sort((p, I) => p.priority - I.priority),
2174
+ ...w.sort((p, I) => p.priority - I.priority),
2175
+ ...b.sort((p, I) => p.priority - I.priority)
2108
2176
  ];
2109
- for (const f of L) {
2110
- const I = f.nodeById[this.id];
2111
- I && (this.countryList.appendChild(I), r && (this._highlightListItem(I, !1), r = !1));
2177
+ for (const p of L) {
2178
+ const I = p.nodeById[this.id];
2179
+ I && (this.countryList.appendChild(I), s && (this._highlightListItem(I, !1), s = !1));
2112
2180
  }
2113
- r && this._highlightListItem(null, !1), this.countryList.scrollTop = 0, this._updateSearchResultsText();
2181
+ s ? (this._highlightListItem(null, !1), this.searchNoResults && this.searchNoResults.classList.remove("iti__hide")) : this.searchNoResults && this.searchNoResults.classList.add("iti__hide"), this.countryList.scrollTop = 0, this._updateSearchResultsA11yText();
2114
2182
  }
2115
2183
  //* Update search results text (for a11y).
2116
- _updateSearchResultsText() {
2117
- const { i18n: e } = this.options, n = this.countryList.childElementCount;
2118
- let r;
2119
- "searchResultsText" in e ? r = e.searchResultsText(n) : n === 0 ? r = e.zeroSearchResults : n === 1 ? r = e.oneSearchResult : r = e.multipleSearchResults.replace("${count}", n.toString()), this.searchResultsA11yText.textContent = r;
2184
+ _updateSearchResultsA11yText() {
2185
+ const { i18n: e } = this.options, i = this.countryList.childElementCount;
2186
+ let s;
2187
+ "searchResultsText" in e ? s = e.searchResultsText(i) : i === 0 ? s = e.zeroSearchResults : i === 1 ? s = e.oneSearchResult : s = e.multipleSearchResults.replace("${count}", i.toString()), this.searchResultsA11yText.textContent = s;
2120
2188
  }
2121
2189
  //* Highlight the next/prev item in the list (and ensure it is visible).
2122
2190
  _handleUpDownKey(e) {
2123
- var r, s;
2124
- let n = e === "ArrowUp" ? (r = this.highlightedItem) == null ? void 0 : r.previousElementSibling : (s = this.highlightedItem) == null ? void 0 : s.nextElementSibling;
2125
- !n && this.countryList.childElementCount > 1 && (n = e === "ArrowUp" ? this.countryList.lastElementChild : this.countryList.firstElementChild), n && (this._scrollTo(n), this._highlightListItem(n, !1));
2191
+ var s, r;
2192
+ let i = e === "ArrowUp" ? (s = this.highlightedItem) == null ? void 0 : s.previousElementSibling : (r = this.highlightedItem) == null ? void 0 : r.nextElementSibling;
2193
+ !i && this.countryList.childElementCount > 1 && (i = e === "ArrowUp" ? this.countryList.lastElementChild : this.countryList.firstElementChild), i && (this._scrollTo(i), this._highlightListItem(i, !1));
2126
2194
  }
2127
2195
  //* Select the currently highlighted item.
2128
2196
  _handleEnterKey() {
@@ -2131,86 +2199,85 @@ class z2 {
2131
2199
  //* Update the input's value to the given val (format first if possible)
2132
2200
  //* NOTE: this is called from _setInitialState, handleUtils and setNumber.
2133
2201
  _updateValFromNumber(e) {
2134
- let n = e;
2202
+ let i = e;
2135
2203
  if (this.options.formatOnDisplay && m.utils && this.selectedCountryData) {
2136
- const r = this.options.nationalMode || n.charAt(0) !== "+" && !this.options.separateDialCode, { NATIONAL: s, INTERNATIONAL: l } = m.utils.numberFormat, c = r ? s : l;
2137
- n = m.utils.formatNumber(
2138
- n,
2204
+ const s = this.options.nationalMode || i.charAt(0) !== "+" && !this.options.separateDialCode, { NATIONAL: r, INTERNATIONAL: l } = m.utils.numberFormat, c = s ? r : l;
2205
+ i = m.utils.formatNumber(
2206
+ i,
2139
2207
  this.selectedCountryData.iso2,
2140
2208
  c
2141
2209
  );
2142
2210
  }
2143
- n = this._beforeSetNumber(n), this.telInput.value = n;
2211
+ i = this._beforeSetNumber(i), this.telInput.value = i;
2144
2212
  }
2145
2213
  //* Check if need to select a new country based on the given number
2146
2214
  //* Note: called from _setInitialState, keyup handler, setNumber.
2147
2215
  _updateCountryFromNumber(e) {
2148
- const n = this._getNewCountryFromNumber(e);
2149
- return n !== null ? this._setCountry(n) : !1;
2216
+ const i = this._getNewCountryFromNumber(e);
2217
+ return i !== null ? this._setCountry(i) : !1;
2150
2218
  }
2151
2219
  _ensureHasDialCode(e) {
2152
- const { dialCode: n, nationalPrefix: r } = this.selectedCountryData;
2153
- if (e.charAt(0) === "+" || !n)
2220
+ const { dialCode: i, nationalPrefix: s } = this.selectedCountryData;
2221
+ if (e.charAt(0) === "+" || !i)
2154
2222
  return e;
2155
- const c = r && e.charAt(0) === r && !this.options.separateDialCode ? e.substring(1) : e;
2156
- return `+${n}${c}`;
2223
+ const c = s && e.charAt(0) === s && !this.options.separateDialCode ? e.substring(1) : e;
2224
+ return `+${i}${c}`;
2157
2225
  }
2158
2226
  // Get the country ISO2 code from the given number
2159
2227
  // BUT ONLY IF ITS CHANGED FROM THE CURRENTLY SELECTED COUNTRY
2160
2228
  // NOTE: consider refactoring this to be more clear
2161
2229
  _getNewCountryFromNumber(e) {
2162
- const n = e.indexOf("+");
2163
- let r = n ? e.substring(n) : e;
2164
- const s = this.selectedCountryData.iso2, l = this.selectedCountryData.dialCode;
2165
- r = this._ensureHasDialCode(r);
2166
- const c = this._getDialCode(r, !0), C = c1(r);
2230
+ const i = e.indexOf("+");
2231
+ let s = i ? e.substring(i) : e;
2232
+ const r = this.selectedCountryData.iso2, l = this.selectedCountryData.dialCode;
2233
+ s = this._ensureHasDialCode(s);
2234
+ const c = this._getDialCode(s, !0), C = f1(s);
2167
2235
  if (c) {
2168
- const p = c1(c), w = this.dialCodeToIso2Map[p];
2169
- if (!s && this.defaultCountry && w.includes(this.defaultCountry))
2236
+ const f = f1(c), S = this.dialCodeToIso2Map[f];
2237
+ if (!r && this.defaultCountry && S.includes(this.defaultCountry))
2170
2238
  return this.defaultCountry;
2171
- const b = this.selectedCountryData.areaCodes && C.length > p.length, v = s && w.includes(s) && !b;
2172
- if (!(l === "1" && o2(C)) && !v) {
2173
- for (const f of w)
2174
- if (f)
2175
- return f;
2239
+ const w = this.selectedCountryData.areaCodes && C.length > f.length, b = r && S.includes(r) && !w;
2240
+ if (!(l === "1" && a2(C)) && !b) {
2241
+ for (const p of S)
2242
+ if (p)
2243
+ return p;
2176
2244
  }
2177
2245
  } else {
2178
- if (r.charAt(0) === "+" && C.length)
2246
+ if (s.charAt(0) === "+" && C.length)
2179
2247
  return "";
2180
- if ((!r || r === "+") && !this.selectedCountryData.iso2)
2248
+ if ((!s || s === "+") && !this.selectedCountryData.iso2)
2181
2249
  return this.defaultCountry;
2182
2250
  }
2183
2251
  return null;
2184
2252
  }
2185
2253
  //* Remove highlighting from other list items and highlight the given item.
2186
- _highlightListItem(e, n) {
2187
- const r = this.highlightedItem;
2188
- if (r && (r.classList.remove("iti__highlight"), r.setAttribute("aria-selected", "false")), this.highlightedItem = e, this.highlightedItem) {
2189
- this.highlightedItem.classList.add("iti__highlight"), this.highlightedItem.setAttribute("aria-selected", "true");
2190
- const s = this.highlightedItem.getAttribute("id") || "";
2191
- this.selectedCountry.setAttribute("aria-activedescendant", s), this.options.countrySearch && this.searchInput.setAttribute("aria-activedescendant", s);
2254
+ _highlightListItem(e, i) {
2255
+ const s = this.highlightedItem;
2256
+ if (s && (s.classList.remove("iti__highlight"), s.setAttribute("aria-selected", "false")), this.highlightedItem = e, this.highlightedItem && (this.highlightedItem.classList.add("iti__highlight"), this.highlightedItem.setAttribute("aria-selected", "true"), this.options.countrySearch)) {
2257
+ const r = this.highlightedItem.getAttribute("id") || "";
2258
+ this.searchInput.setAttribute("aria-activedescendant", r);
2192
2259
  }
2193
- n && this.highlightedItem.focus();
2260
+ i && this.highlightedItem.focus();
2194
2261
  }
2195
2262
  //* Find the country data for the given iso2 code
2196
2263
  //* the allowFail option is only used during init() for the initialCountry option, and for the iso2 returned from geoIpLookup - in these 2 cases we don't want to error out
2197
- _getCountryData(e, n) {
2198
- const r = this.countryByIso2.get(e);
2199
- if (r)
2200
- return r;
2201
- if (n)
2264
+ _getCountryData(e, i) {
2265
+ const s = this.countryByIso2.get(e);
2266
+ if (s)
2267
+ return s;
2268
+ if (i)
2202
2269
  return null;
2203
2270
  throw new Error(`No country data for '${e}'`);
2204
2271
  }
2205
2272
  //* Update the selected country, dial code (if separateDialCode), placeholder, title, and active list item.
2206
2273
  //* Note: called from _setInitialState, _updateCountryFromNumber, _selectListItem, setCountry.
2207
2274
  _setCountry(e) {
2208
- const { separateDialCode: n, showFlags: r, i18n: s } = this.options, l = this.selectedCountryData.iso2 ? this.selectedCountryData : {};
2275
+ const { separateDialCode: i, showFlags: s, i18n: r } = this.options, l = this.selectedCountryData.iso2 ? this.selectedCountryData : {};
2209
2276
  if (this.selectedCountryData = e ? this._getCountryData(e, !1) || {} : {}, this.selectedCountryData.iso2 && (this.defaultCountry = this.selectedCountryData.iso2), this.selectedCountryInner) {
2210
2277
  let c = "", C = "";
2211
- e && r ? (c = `iti__flag iti__${e}`, C = `${this.selectedCountryData.name} +${this.selectedCountryData.dialCode}`) : (c = "iti__flag iti__globe", C = s.noCountrySelected), this.selectedCountryInner.className = c, this.selectedCountryA11yText.textContent = C;
2278
+ e && s ? (c = `iti__flag iti__${e}`, C = `${this.selectedCountryData.name} +${this.selectedCountryData.dialCode}`) : (c = "iti__flag iti__globe", C = r.noCountrySelected), this.selectedCountryInner.className = c, this.selectedCountryA11yText.textContent = C;
2212
2279
  }
2213
- if (this._setSelectedCountryTitleAttribute(e, n), n) {
2280
+ if (this._setSelectedCountryTitleAttribute(e, i), i) {
2214
2281
  const c = this.selectedCountryData.dialCode ? `+${this.selectedCountryData.dialCode}` : "";
2215
2282
  this.selectedDialCode.innerHTML = c, this._updateInputPadding();
2216
2283
  }
@@ -2219,34 +2286,34 @@ class z2 {
2219
2286
  //* Update the input padding to make space for the selected country/dial code.
2220
2287
  _updateInputPadding() {
2221
2288
  if (this.selectedCountry) {
2222
- const n = (this.selectedCountry.offsetWidth || this._getHiddenSelectedCountryWidth()) + 6;
2223
- this.showSelectedCountryOnLeft ? this.telInput.style.paddingLeft = `${n}px` : this.telInput.style.paddingRight = `${n}px`;
2289
+ const i = (this.selectedCountry.offsetWidth || this._getHiddenSelectedCountryWidth()) + 6;
2290
+ this.showSelectedCountryOnLeft ? this.telInput.style.paddingLeft = `${i}px` : this.telInput.style.paddingRight = `${i}px`;
2224
2291
  }
2225
2292
  }
2226
2293
  //* Update the maximum valid number length for the currently selected country.
2227
2294
  _updateMaxLength() {
2228
- const { strictMode: e, placeholderNumberType: n, validationNumberTypes: r } = this.options, { iso2: s } = this.selectedCountryData;
2295
+ const { strictMode: e, placeholderNumberType: i, validationNumberTypes: s } = this.options, { iso2: r } = this.selectedCountryData;
2229
2296
  if (e && m.utils)
2230
- if (s) {
2231
- const l = m.utils.numberType[n];
2297
+ if (r) {
2298
+ const l = m.utils.numberType[i];
2232
2299
  let c = m.utils.getExampleNumber(
2233
- s,
2300
+ r,
2234
2301
  !1,
2235
2302
  l,
2236
2303
  !0
2237
2304
  ), C = c;
2238
- for (; m.utils.isPossibleNumber(c, s, r); )
2305
+ for (; m.utils.isPossibleNumber(c, r, s); )
2239
2306
  C = c, c += "0";
2240
- const p = m.utils.getCoreNumber(C, s);
2241
- this.maxCoreNumberLength = p.length, s === "by" && (this.maxCoreNumberLength = p.length + 1);
2307
+ const f = m.utils.getCoreNumber(C, r);
2308
+ this.maxCoreNumberLength = f.length, r === "by" && (this.maxCoreNumberLength = f.length + 1);
2242
2309
  } else
2243
2310
  this.maxCoreNumberLength = null;
2244
2311
  }
2245
- _setSelectedCountryTitleAttribute(e = null, n) {
2312
+ _setSelectedCountryTitleAttribute(e = null, i) {
2246
2313
  if (!this.selectedCountry)
2247
2314
  return;
2248
- let r;
2249
- e && !n ? r = `${this.selectedCountryData.name}: +${this.selectedCountryData.dialCode}` : e ? r = this.selectedCountryData.name : r = "Unknown", this.selectedCountry.setAttribute("title", r);
2315
+ let s;
2316
+ e && !i ? s = `${this.selectedCountryData.name}: +${this.selectedCountryData.dialCode}` : e ? s = this.selectedCountryData.name : s = "Unknown", this.selectedCountry.setAttribute("title", s);
2250
2317
  }
2251
2318
  //* When the input is in a hidden container during initialisation, we must inject some markup
2252
2319
  //* into the end of the DOM to calculate the correct offsetWidth.
@@ -2256,12 +2323,12 @@ class z2 {
2256
2323
  if (this.telInput.parentNode) {
2257
2324
  const e = this.telInput.parentNode.cloneNode(!1);
2258
2325
  e.style.visibility = "hidden", document.body.appendChild(e);
2259
- const n = this.countryContainer.cloneNode();
2260
- e.appendChild(n);
2261
- const r = this.selectedCountry.cloneNode(!0);
2262
- n.appendChild(r);
2263
- const s = r.offsetWidth;
2264
- return document.body.removeChild(e), s;
2326
+ const i = this.countryContainer.cloneNode();
2327
+ e.appendChild(i);
2328
+ const s = this.selectedCountry.cloneNode(!0);
2329
+ i.appendChild(s);
2330
+ const r = s.offsetWidth;
2331
+ return document.body.removeChild(e), r;
2265
2332
  }
2266
2333
  return 0;
2267
2334
  }
@@ -2269,30 +2336,30 @@ class z2 {
2269
2336
  _updatePlaceholder() {
2270
2337
  const {
2271
2338
  autoPlaceholder: e,
2272
- placeholderNumberType: n,
2273
- nationalMode: r,
2274
- customPlaceholder: s
2339
+ placeholderNumberType: i,
2340
+ nationalMode: s,
2341
+ customPlaceholder: r
2275
2342
  } = this.options, l = e === "aggressive" || !this.hadInitialPlaceholder && e === "polite";
2276
2343
  if (m.utils && l) {
2277
- const c = m.utils.numberType[n];
2344
+ const c = m.utils.numberType[i];
2278
2345
  let C = this.selectedCountryData.iso2 ? m.utils.getExampleNumber(
2279
2346
  this.selectedCountryData.iso2,
2280
- r,
2347
+ s,
2281
2348
  c
2282
2349
  ) : "";
2283
- C = this._beforeSetNumber(C), typeof s == "function" && (C = s(C, this.selectedCountryData)), this.telInput.setAttribute("placeholder", C);
2350
+ C = this._beforeSetNumber(C), typeof r == "function" && (C = r(C, this.selectedCountryData)), this.telInput.setAttribute("placeholder", C);
2284
2351
  }
2285
2352
  }
2286
2353
  //* Called when the user selects a list item from the dropdown.
2287
2354
  _selectListItem(e) {
2288
- const n = this._setCountry(
2355
+ const i = this._setCountry(
2289
2356
  e.getAttribute("data-country-code")
2290
2357
  );
2291
- this._closeDropdown(), this._updateDialCode(e.getAttribute("data-dial-code")), this.telInput.focus(), n && this._triggerCountryChange();
2358
+ this._closeDropdown(), this._updateDialCode(e.getAttribute("data-dial-code")), this.telInput.focus(), i && this._triggerCountryChange();
2292
2359
  }
2293
2360
  //* Close the dropdown and unbind any listeners.
2294
2361
  _closeDropdown() {
2295
- this.dropdownContent.classList.add("iti__hide"), this.selectedCountry.setAttribute("aria-expanded", "false"), this.selectedCountry.removeAttribute("aria-activedescendant"), this.highlightedItem && this.highlightedItem.setAttribute("aria-selected", "false"), this.options.countrySearch && this.searchInput.removeAttribute("aria-activedescendant"), this.dropdownArrow.classList.remove("iti__arrow--up"), document.removeEventListener("keydown", this._handleKeydownOnDropdown), this.options.countrySearch && this.searchInput.removeEventListener("input", this._handleSearchChange), document.documentElement.removeEventListener(
2362
+ this.dropdownContent.classList.add("iti__hide"), this.selectedCountry.setAttribute("aria-expanded", "false"), this.highlightedItem && this.highlightedItem.setAttribute("aria-selected", "false"), this.options.countrySearch && this.searchInput.removeAttribute("aria-activedescendant"), this.dropdownArrow.classList.remove("iti__arrow--up"), this.options.countrySearch && (this.searchInput.removeEventListener("input", this._handleSearchChange), this.searchClearButton.removeEventListener("click", this._handleSearchClear)), document.documentElement.removeEventListener(
2296
2363
  "click",
2297
2364
  this._handleClickOffToClose
2298
2365
  ), this.countryList.removeEventListener(
@@ -2302,65 +2369,65 @@ class z2 {
2302
2369
  }
2303
2370
  //* Check if an element is visible within it's container, else scroll until it is.
2304
2371
  _scrollTo(e) {
2305
- const n = this.countryList, r = document.documentElement.scrollTop, s = n.offsetHeight, l = n.getBoundingClientRect().top + r, c = l + s, C = e.offsetHeight, p = e.getBoundingClientRect().top + r, w = p + C, b = p - l + n.scrollTop;
2306
- if (p < l)
2307
- n.scrollTop = b;
2308
- else if (w > c) {
2309
- const v = s - C;
2310
- n.scrollTop = b - v;
2372
+ const i = this.countryList, s = document.documentElement.scrollTop, r = i.offsetHeight, l = i.getBoundingClientRect().top + s, c = l + r, C = e.offsetHeight, f = e.getBoundingClientRect().top + s, S = f + C, w = f - l + i.scrollTop;
2373
+ if (f < l)
2374
+ i.scrollTop = w;
2375
+ else if (S > c) {
2376
+ const b = r - C;
2377
+ i.scrollTop = w - b;
2311
2378
  }
2312
2379
  }
2313
2380
  //* Replace any existing dial code with the new one
2314
2381
  //* Note: called from _selectListItem and setCountry
2315
2382
  _updateDialCode(e) {
2316
- const n = this.telInput.value, r = `+${e}`;
2317
- let s;
2318
- if (n.charAt(0) === "+") {
2319
- const l = this._getDialCode(n);
2320
- l ? s = n.replace(l, r) : s = r, this.telInput.value = s;
2383
+ const i = this.telInput.value, s = `+${e}`;
2384
+ let r;
2385
+ if (i.charAt(0) === "+") {
2386
+ const l = this._getDialCode(i);
2387
+ l ? r = i.replace(l, s) : r = s, this.telInput.value = r;
2321
2388
  }
2322
2389
  }
2323
2390
  //* Try and extract a valid international dial code from a full telephone number.
2324
2391
  //* Note: returns the raw string inc plus character and any whitespace/dots etc.
2325
- _getDialCode(e, n) {
2326
- let r = "";
2392
+ _getDialCode(e, i) {
2393
+ let s = "";
2327
2394
  if (e.charAt(0) === "+") {
2328
- let s = "";
2395
+ let r = "";
2329
2396
  for (let l = 0; l < e.length; l++) {
2330
2397
  const c = e.charAt(l);
2331
2398
  if (!isNaN(parseInt(c, 10))) {
2332
- if (s += c, n)
2333
- this.dialCodeToIso2Map[s] && (r = e.substring(0, l + 1));
2334
- else if (this.dialCodes.has(s)) {
2335
- r = e.substring(0, l + 1);
2399
+ if (r += c, i)
2400
+ this.dialCodeToIso2Map[r] && (s = e.substring(0, l + 1));
2401
+ else if (this.dialCodes.has(r)) {
2402
+ s = e.substring(0, l + 1);
2336
2403
  break;
2337
2404
  }
2338
- if (s.length === this.dialCodeMaxLen)
2405
+ if (r.length === this.dialCodeMaxLen)
2339
2406
  break;
2340
2407
  }
2341
2408
  }
2342
2409
  }
2343
- return r;
2410
+ return s;
2344
2411
  }
2345
2412
  //* Get the input val, adding the dial code if separateDialCode is enabled.
2346
2413
  _getFullNumber(e) {
2347
- const n = e || this.telInput.value.trim(), { dialCode: r } = this.selectedCountryData;
2348
- let s;
2349
- const l = c1(n);
2350
- return this.options.separateDialCode && n.charAt(0) !== "+" && r && l ? s = `+${r}` : s = "", s + n;
2414
+ const i = e || this.telInput.value.trim(), { dialCode: s } = this.selectedCountryData;
2415
+ let r;
2416
+ const l = f1(i);
2417
+ return this.options.separateDialCode && i.charAt(0) !== "+" && s && l ? r = `+${s}` : r = "", r + i;
2351
2418
  }
2352
2419
  //* Remove the dial code if separateDialCode is enabled also cap the length if the input has a maxlength attribute
2353
2420
  _beforeSetNumber(e) {
2354
- let n = e;
2421
+ let i = e;
2355
2422
  if (this.options.separateDialCode) {
2356
- let r = this._getDialCode(n);
2357
- if (r) {
2358
- r = `+${this.selectedCountryData.dialCode}`;
2359
- const s = n[r.length] === " " || n[r.length] === "-" ? r.length + 1 : r.length;
2360
- n = n.substring(s);
2423
+ let s = this._getDialCode(i);
2424
+ if (s) {
2425
+ s = `+${this.selectedCountryData.dialCode}`;
2426
+ const r = i[s.length] === " " || i[s.length] === "-" ? s.length + 1 : s.length;
2427
+ i = i.substring(r);
2361
2428
  }
2362
2429
  }
2363
- return this._cap(n);
2430
+ return this._cap(i);
2364
2431
  }
2365
2432
  //* Trigger the 'countrychange' event.
2366
2433
  _triggerCountryChange() {
@@ -2368,8 +2435,8 @@ class z2 {
2368
2435
  }
2369
2436
  //* Format the number as the user types.
2370
2437
  _formatNumberAsYouType() {
2371
- const e = this._getFullNumber(), n = m.utils ? m.utils.formatNumberAsYouType(e, this.selectedCountryData.iso2) : e, { dialCode: r } = this.selectedCountryData;
2372
- return this.options.separateDialCode && this.telInput.value.charAt(0) !== "+" && n.includes(`+${r}`) ? (n.split(`+${r}`)[1] || "").trim() : n;
2438
+ const e = this._getFullNumber(), i = m.utils ? m.utils.formatNumberAsYouType(e, this.selectedCountryData.iso2) : e, { dialCode: s } = this.selectedCountryData;
2439
+ return this.options.separateDialCode && this.telInput.value.charAt(0) !== "+" && i.includes(`+${s}`) ? (i.split(`+${s}`)[1] || "").trim() : i;
2373
2440
  }
2374
2441
  //**************************
2375
2442
  //* SECRET PUBLIC METHODS
@@ -2389,7 +2456,7 @@ class z2 {
2389
2456
  destroy() {
2390
2457
  var l, c;
2391
2458
  this.telInput.iti = void 0;
2392
- const { allowDropdown: e, separateDialCode: n } = this.options;
2459
+ const { allowDropdown: e, separateDialCode: i } = this.options;
2393
2460
  if (e) {
2394
2461
  this._closeDropdown(), this.selectedCountry.removeEventListener(
2395
2462
  "click",
@@ -2401,10 +2468,10 @@ class z2 {
2401
2468
  const C = this.telInput.closest("label");
2402
2469
  C && C.removeEventListener("click", this._handleLabelClick);
2403
2470
  }
2404
- const { form: r } = this.telInput;
2405
- this._handleHiddenInputSubmit && r && r.removeEventListener("submit", this._handleHiddenInputSubmit), this.telInput.removeEventListener("input", this._handleInputEvent), this._handleKeydownEvent && this.telInput.removeEventListener("keydown", this._handleKeydownEvent), this.telInput.removeAttribute("data-intl-tel-input-id"), n && (this.isRTL ? this.telInput.style.paddingRight = this.originalPaddingRight : this.telInput.style.paddingLeft = this.originalPaddingLeft);
2406
- const s = this.telInput.parentNode;
2407
- (l = s == null ? void 0 : s.parentNode) == null || l.insertBefore(this.telInput, s), (c = s == null ? void 0 : s.parentNode) == null || c.removeChild(s), delete m.instances[this.id];
2471
+ const { form: s } = this.telInput;
2472
+ this._handleHiddenInputSubmit && s && s.removeEventListener("submit", this._handleHiddenInputSubmit), this.telInput.removeEventListener("input", this._handleInputEvent), this._handleKeydownEvent && this.telInput.removeEventListener("keydown", this._handleKeydownEvent), this.telInput.removeAttribute("data-intl-tel-input-id"), i && (this.isRTL ? this.telInput.style.paddingRight = this.originalPaddingRight : this.telInput.style.paddingLeft = this.originalPaddingLeft);
2473
+ const r = this.telInput.parentNode;
2474
+ (l = r == null ? void 0 : r.parentNode) == null || l.insertBefore(this.telInput, r), (c = r == null ? void 0 : r.parentNode) == null || c.removeChild(r), delete m.instances[this.id];
2408
2475
  }
2409
2476
  //* Get the extension from the current number.
2410
2477
  getExtension() {
@@ -2416,10 +2483,10 @@ class z2 {
2416
2483
  //* Format the number to the given format.
2417
2484
  getNumber(e) {
2418
2485
  if (m.utils) {
2419
- const { iso2: n } = this.selectedCountryData;
2486
+ const { iso2: i } = this.selectedCountryData;
2420
2487
  return m.utils.formatNumber(
2421
2488
  this._getFullNumber(),
2422
- n,
2489
+ i,
2423
2490
  e
2424
2491
  );
2425
2492
  }
@@ -2459,25 +2526,25 @@ class z2 {
2459
2526
  _validateNumber(e) {
2460
2527
  if (!this.selectedCountryData.iso2)
2461
2528
  return !1;
2462
- const n = this._getFullNumber(), r = n.search(new RegExp("\\p{L}", "u")), s = (l) => e ? this._utilsIsValidNumber(l) : this._utilsIsPossibleNumber(l);
2463
- if (r > -1) {
2464
- const l = n.substring(0, r), c = s(l), C = s(n);
2529
+ const i = this._getFullNumber(), s = i.search(new RegExp("\\p{L}", "u")), r = (l) => e ? this._utilsIsValidNumber(l) : this._utilsIsPossibleNumber(l);
2530
+ if (s > -1) {
2531
+ const l = i.substring(0, s), c = r(l), C = r(i);
2465
2532
  return c && C;
2466
2533
  }
2467
- return s(n);
2534
+ return r(i);
2468
2535
  }
2469
2536
  _utilsIsValidNumber(e) {
2470
2537
  return m.utils ? m.utils.isValidNumber(e, this.selectedCountryData.iso2, this.options.validationNumberTypes) : null;
2471
2538
  }
2472
2539
  //* Update the selected country, and update the input val accordingly.
2473
2540
  setCountry(e) {
2474
- const n = e == null ? void 0 : e.toLowerCase(), r = this.selectedCountryData.iso2;
2475
- (e && n !== r || !e && r) && (this._setCountry(n), this._updateDialCode(this.selectedCountryData.dialCode), this._triggerCountryChange());
2541
+ const i = e == null ? void 0 : e.toLowerCase(), s = this.selectedCountryData.iso2;
2542
+ (e && i !== s || !e && s) && (this._setCountry(i), this._updateDialCode(this.selectedCountryData.dialCode), this._triggerCountryChange());
2476
2543
  }
2477
2544
  //* Set the input value and update the country.
2478
2545
  setNumber(e) {
2479
- const n = this._updateCountryFromNumber(e);
2480
- this._updateValFromNumber(e), n && this._triggerCountryChange(), this._trigger("input", { isSetNumber: !0 });
2546
+ const i = this._updateCountryFromNumber(e);
2547
+ this._updateValFromNumber(e), i && this._triggerCountryChange(), this._trigger("input", { isSetNumber: !0 });
2481
2548
  }
2482
2549
  //* Set the placeholder number typ
2483
2550
  setPlaceholderNumberType(e) {
@@ -2493,32 +2560,32 @@ const Z2 = (y) => {
2493
2560
  if (typeof y == "function")
2494
2561
  try {
2495
2562
  e = Promise.resolve(y());
2496
- } catch (n) {
2497
- return Promise.reject(n);
2563
+ } catch (i) {
2564
+ return Promise.reject(i);
2498
2565
  }
2499
2566
  else
2500
2567
  return Promise.reject(new TypeError(`The argument passed to attachUtils must be a function that returns a promise for the utilities module, not ${typeof y}`));
2501
- return m.startedLoadingUtilsScript = !0, e.then((n) => {
2502
- const r = n == null ? void 0 : n.default;
2503
- if (!r || typeof r != "object")
2568
+ return m.startedLoadingUtilsScript = !0, e.then((i) => {
2569
+ const s = i == null ? void 0 : i.default;
2570
+ if (!s || typeof s != "object")
2504
2571
  throw new TypeError("The loader function passed to attachUtils did not resolve to a module object with utils as its default export.");
2505
- return m.utils = r, $1("handleUtils"), !0;
2506
- }).catch((n) => {
2507
- throw $1("rejectUtilsScriptPromise", n), n;
2572
+ return m.utils = s, i1("handleUtils"), !0;
2573
+ }).catch((i) => {
2574
+ throw i1("rejectUtilsScriptPromise", i), i;
2508
2575
  });
2509
2576
  }
2510
2577
  return null;
2511
2578
  }, m = Object.assign(
2512
2579
  (y, e) => {
2513
- const n = new z2(y, e);
2514
- return n._init(), y.setAttribute("data-intl-tel-input-id", n.id.toString()), m.instances[n.id] = n, y.iti = n, n;
2580
+ const i = new p1(y, e);
2581
+ return i._init(), y.setAttribute("data-intl-tel-input-id", i.id.toString()), m.instances[i.id] = i, y.iti = i, i;
2515
2582
  },
2516
2583
  {
2517
- defaults: a2,
2584
+ defaults: l2,
2518
2585
  //* Using a static var like this allows us to mock it in the tests.
2519
2586
  documentReady: () => document.readyState === "complete",
2520
2587
  //* Get the country data object.
2521
- getCountryData: () => J,
2588
+ getCountryData: () => q,
2522
2589
  //* A getter for the plugin instance.
2523
2590
  getInstance: (y) => {
2524
2591
  const e = y.getAttribute("data-intl-tel-input-id");
@@ -2529,7 +2596,7 @@ const Z2 = (y) => {
2529
2596
  attachUtils: Z2,
2530
2597
  startedLoadingUtilsScript: !1,
2531
2598
  startedLoadingAutoCountry: !1,
2532
- version: "25.7.0"
2599
+ version: "25.8.1"
2533
2600
  }
2534
2601
  );
2535
2602
  (function() {
@@ -2538,23 +2605,23 @@ const Z2 = (y) => {
2538
2605
  d = d.split(".");
2539
2606
  var $ = y;
2540
2607
  d[0] in $ || typeof $.execScript > "u" || $.execScript("var " + d[0]);
2541
- for (var i; d.length && (i = d.shift()); ) d.length || t === void 0 ? $[i] && $[i] !== Object.prototype[i] ? $ = $[i] : $ = $[i] = {} : $[i] = t;
2608
+ for (var n; d.length && (n = d.shift()); ) d.length || t === void 0 ? $[n] && $[n] !== Object.prototype[n] ? $ = $[n] : $ = $[n] = {} : $[n] = t;
2542
2609
  }
2543
- function n(d, t) {
2610
+ function i(d, t) {
2544
2611
  function $() {
2545
2612
  }
2546
- $.prototype = t.prototype, d.ma = t.prototype, d.prototype = new $(), d.prototype.constructor = d, d.sa = function(i, o, u) {
2547
- for (var a = Array(arguments.length - 2), h = 2; h < arguments.length; h++) a[h - 2] = arguments[h];
2548
- return t.prototype[o].apply(i, a);
2613
+ $.prototype = t.prototype, d.ma = t.prototype, d.prototype = new $(), d.prototype.constructor = d, d.sa = function(n, o, a) {
2614
+ for (var u = Array(arguments.length - 2), h = 2; h < arguments.length; h++) u[h - 2] = arguments[h];
2615
+ return t.prototype[o].apply(n, u);
2549
2616
  };
2550
2617
  }
2551
- function r(d) {
2618
+ function s(d) {
2552
2619
  const t = [];
2553
2620
  let $ = 0;
2554
- for (const i in d) t[$++] = d[i];
2621
+ for (const n in d) t[$++] = d[n];
2555
2622
  return t;
2556
2623
  }
2557
- var s = class {
2624
+ var r = class {
2558
2625
  constructor(d) {
2559
2626
  if (l !== l) throw Error("SafeUrl is not meant to be built directly");
2560
2627
  this.g = d;
@@ -2563,7 +2630,7 @@ const Z2 = (y) => {
2563
2630
  return this.g.toString();
2564
2631
  }
2565
2632
  }, l = {};
2566
- new s("about:invalid#zClosurez"), new s("about:blank");
2633
+ new r("about:invalid#zClosurez"), new r("about:blank");
2567
2634
  const c = {};
2568
2635
  class C {
2569
2636
  constructor() {
@@ -2574,83 +2641,83 @@ const Z2 = (y) => {
2574
2641
  }
2575
2642
  }
2576
2643
  new C();
2577
- const p = {};
2578
- class w {
2644
+ const f = {};
2645
+ class S {
2579
2646
  constructor() {
2580
- if (p !== p) throw Error("SafeStyleSheet is not meant to be built directly");
2647
+ if (f !== f) throw Error("SafeStyleSheet is not meant to be built directly");
2581
2648
  }
2582
2649
  toString() {
2583
2650
  return "";
2584
2651
  }
2585
2652
  }
2586
- new w();
2587
- const b = {};
2588
- class v {
2653
+ new S();
2654
+ const w = {};
2655
+ class b {
2589
2656
  constructor() {
2590
2657
  var t = y.trustedTypes && y.trustedTypes.emptyHTML || "";
2591
- if (b !== b) throw Error("SafeHtml is not meant to be built directly");
2658
+ if (w !== w) throw Error("SafeHtml is not meant to be built directly");
2592
2659
  this.g = t;
2593
2660
  }
2594
2661
  toString() {
2595
2662
  return this.g.toString();
2596
2663
  }
2597
2664
  }
2598
- new v();
2665
+ new b();
2599
2666
  function L(d, t) {
2600
2667
  switch (this.g = d, this.l = !!t.aa, this.h = t.i, this.s = t.type, this.o = !1, this.h) {
2601
2668
  case G:
2602
- case F:
2669
+ case U:
2603
2670
  case D:
2604
- case k:
2605
- case f1:
2671
+ case P:
2672
+ case Y:
2606
2673
  case I:
2607
- case f:
2674
+ case p:
2608
2675
  this.o = !0;
2609
2676
  }
2610
2677
  this.j = t.defaultValue;
2611
2678
  }
2612
- var f = 1, I = 2, G = 3, F = 4, D = 6, k = 16, f1 = 18;
2613
- function h2(d, t) {
2679
+ var p = 1, I = 2, G = 3, U = 4, D = 6, P = 16, Y = 18;
2680
+ function c2(d, t) {
2614
2681
  for (this.h = d, this.g = {}, d = 0; d < t.length; d++) {
2615
2682
  var $ = t[d];
2616
2683
  this.g[$.g] = $;
2617
2684
  }
2618
2685
  }
2619
- function c2(d) {
2620
- return d = r(d.g), d.sort(function(t, $) {
2686
+ function f2(d) {
2687
+ return d = s(d.g), d.sort(function(t, $) {
2621
2688
  return t.g - $.g;
2622
2689
  }), d;
2623
2690
  }
2624
- function x() {
2691
+ function R() {
2625
2692
  this.h = {}, this.j = this.m().g, this.g = this.l = null;
2626
2693
  }
2627
- x.prototype.has = function(d) {
2628
- return R(this, d.g);
2629
- }, x.prototype.get = function(d, t) {
2694
+ R.prototype.has = function(d) {
2695
+ return B(this, d.g);
2696
+ }, R.prototype.get = function(d, t) {
2630
2697
  return g(this, d.g, t);
2631
- }, x.prototype.set = function(d, t) {
2698
+ }, R.prototype.set = function(d, t) {
2632
2699
  E(this, d.g, t);
2633
- }, x.prototype.add = function(d, t) {
2634
- w1(this, d.g, t);
2700
+ }, R.prototype.add = function(d, t) {
2701
+ b1(this, d.g, t);
2635
2702
  };
2636
- function S1(d, t) {
2637
- for (var $ = c2(d.m()), i = 0; i < $.length; i++) {
2638
- var o = $[i], u = o.g;
2639
- if (R(t, u)) {
2703
+ function w1(d, t) {
2704
+ for (var $ = f2(d.m()), n = 0; n < $.length; n++) {
2705
+ var o = $[n], a = o.g;
2706
+ if (B(t, a)) {
2640
2707
  d.g && delete d.g[o.g];
2641
- var a = o.h == 11 || o.h == 10;
2708
+ var u = o.h == 11 || o.h == 10;
2642
2709
  if (o.l) {
2643
- o = P(t, u);
2644
- for (var h = 0; h < o.length; h++) w1(d, u, a ? o[h].clone() : o[h]);
2645
- } else o = n1(t, u), a ? (a = n1(d, u)) ? S1(a, o) : E(d, u, o.clone()) : E(d, u, o);
2710
+ o = x(t, a);
2711
+ for (var h = 0; h < o.length; h++) b1(d, a, u ? o[h].clone() : o[h]);
2712
+ } else o = n1(t, a), u ? (u = n1(d, a)) ? w1(u, o) : E(d, a, o.clone()) : E(d, a, o);
2646
2713
  }
2647
2714
  }
2648
2715
  }
2649
- x.prototype.clone = function() {
2716
+ R.prototype.clone = function() {
2650
2717
  var d = new this.constructor();
2651
- return d != this && (d.h = {}, d.g && (d.g = {}), S1(d, this)), d;
2718
+ return d != this && (d.h = {}, d.g && (d.g = {}), w1(d, this)), d;
2652
2719
  };
2653
- function R(d, t) {
2720
+ function B(d, t) {
2654
2721
  return d.h[t] != null;
2655
2722
  }
2656
2723
  function n1(d, t) {
@@ -2658,11 +2725,11 @@ const Z2 = (y) => {
2658
2725
  if ($ == null) return null;
2659
2726
  if (d.l) {
2660
2727
  if (!(t in d.g)) {
2661
- var i = d.l, o = d.j[t];
2728
+ var n = d.l, o = d.j[t];
2662
2729
  if ($ != null) if (o.l) {
2663
- for (var u = [], a = 0; a < $.length; a++) u[a] = i.h(o, $[a]);
2664
- $ = u;
2665
- } else $ = i.h(o, $);
2730
+ for (var a = [], u = 0; u < $.length; u++) a[u] = n.h(o, $[u]);
2731
+ $ = a;
2732
+ } else $ = n.h(o, $);
2666
2733
  return d.g[t] = $;
2667
2734
  }
2668
2735
  return d.g[t];
@@ -2670,11 +2737,11 @@ const Z2 = (y) => {
2670
2737
  return $;
2671
2738
  }
2672
2739
  function g(d, t, $) {
2673
- var i = n1(d, t);
2674
- return d.j[t].l ? i[$ || 0] : i;
2740
+ var n = n1(d, t);
2741
+ return d.j[t].l ? n[$ || 0] : n;
2675
2742
  }
2676
- function S(d, t) {
2677
- if (R(d, t)) d = g(d, t);
2743
+ function v(d, t) {
2744
+ if (B(d, t)) d = g(d, t);
2678
2745
  else d: {
2679
2746
  if (d = d.j[t], d.j === void 0) if (t = d.s, t === Boolean) d.j = !1;
2680
2747
  else if (t === Number) d.j = 0;
@@ -2687,88 +2754,88 @@ const Z2 = (y) => {
2687
2754
  }
2688
2755
  return d;
2689
2756
  }
2690
- function P(d, t) {
2757
+ function x(d, t) {
2691
2758
  return n1(d, t) || [];
2692
2759
  }
2693
2760
  function K(d, t) {
2694
- return d.j[t].l ? R(d, t) ? d.h[t].length : 0 : R(d, t) ? 1 : 0;
2761
+ return d.j[t].l ? B(d, t) ? d.h[t].length : 0 : B(d, t) ? 1 : 0;
2695
2762
  }
2696
2763
  function E(d, t, $) {
2697
2764
  d.h[t] = $, d.g && (d.g[t] = $);
2698
2765
  }
2699
- function w1(d, t, $) {
2766
+ function b1(d, t, $) {
2700
2767
  d.h[t] || (d.h[t] = []), d.h[t].push($), d.g && delete d.g[t];
2701
2768
  }
2702
- function i1(d, t) {
2703
- var $ = [], i;
2704
- for (i in t) i != 0 && $.push(new L(i, t[i]));
2705
- return new h2(d, $);
2769
+ function s1(d, t) {
2770
+ var $ = [], n;
2771
+ for (n in t) n != 0 && $.push(new L(n, t[n]));
2772
+ return new c2(d, $);
2706
2773
  }
2707
2774
  function r1() {
2708
2775
  }
2709
2776
  r1.prototype.g = function(d) {
2710
2777
  throw new d.h(), Error("Unimplemented");
2711
2778
  }, r1.prototype.h = function(d, t) {
2712
- if (d.h == 11 || d.h == 10) return t instanceof x ? t : this.g(d.s.prototype.m(), t);
2713
- if (d.h == 14) return typeof t == "string" && b1.test(t) && (d = Number(t), 0 < d) ? d : t;
2779
+ if (d.h == 11 || d.h == 10) return t instanceof R ? t : this.g(d.s.prototype.m(), t);
2780
+ if (d.h == 14) return typeof t == "string" && L1.test(t) && (d = Number(t), 0 < d) ? d : t;
2714
2781
  if (!d.o) return t;
2715
2782
  if (d = d.s, d === String) {
2716
2783
  if (typeof t == "number") return String(t);
2717
- } else if (d === Number && typeof t == "string" && (t === "Infinity" || t === "-Infinity" || t === "NaN" || b1.test(t))) return Number(t);
2784
+ } else if (d === Number && typeof t == "string" && (t === "Infinity" || t === "-Infinity" || t === "NaN" || L1.test(t))) return Number(t);
2718
2785
  return t;
2719
2786
  };
2720
- var b1 = /^-?[0-9]+$/;
2721
- function p1() {
2787
+ var L1 = /^-?[0-9]+$/;
2788
+ function g1() {
2722
2789
  }
2723
- n(p1, r1), p1.prototype.g = function(d, t) {
2790
+ i(g1, r1), g1.prototype.g = function(d, t) {
2724
2791
  return d = new d.h(), d.l = this, d.h = t, d.g = {}, d;
2725
2792
  };
2726
- function q() {
2793
+ function X() {
2727
2794
  }
2728
- n(q, p1), q.prototype.h = function(d, t) {
2795
+ i(X, g1), X.prototype.h = function(d, t) {
2729
2796
  return d.h == 8 ? !!t : r1.prototype.h.apply(this, arguments);
2730
- }, q.prototype.g = function(d, t) {
2731
- return q.ma.g.call(this, d, t);
2797
+ }, X.prototype.g = function(d, t) {
2798
+ return X.ma.g.call(this, d, t);
2732
2799
  };
2733
- function T(d, t) {
2800
+ function A(d, t) {
2734
2801
  d != null && this.g.apply(this, arguments);
2735
2802
  }
2736
- T.prototype.h = "", T.prototype.set = function(d) {
2803
+ A.prototype.h = "", A.prototype.set = function(d) {
2737
2804
  this.h = "" + d;
2738
- }, T.prototype.g = function(d, t, $) {
2739
- if (this.h += String(d), t != null) for (let i = 1; i < arguments.length; i++) this.h += arguments[i];
2805
+ }, A.prototype.g = function(d, t, $) {
2806
+ if (this.h += String(d), t != null) for (let n = 1; n < arguments.length; n++) this.h += arguments[n];
2740
2807
  return this;
2741
2808
  };
2742
- function B(d) {
2809
+ function k(d) {
2743
2810
  d.h = "";
2744
2811
  }
2745
- T.prototype.toString = function() {
2812
+ A.prototype.toString = function() {
2746
2813
  return this.h;
2747
2814
  };
2748
2815
  function W() {
2749
- x.call(this);
2816
+ R.call(this);
2750
2817
  }
2751
- n(W, x);
2752
- var L1 = null;
2818
+ i(W, R);
2819
+ var N1 = null;
2753
2820
  function N() {
2754
- x.call(this);
2821
+ R.call(this);
2755
2822
  }
2756
- n(N, x);
2757
- var N1 = null;
2823
+ i(N, R);
2824
+ var T1 = null;
2758
2825
  function z() {
2759
- x.call(this);
2826
+ R.call(this);
2760
2827
  }
2761
- n(z, x);
2762
- var T1 = null;
2828
+ i(z, R);
2829
+ var A1 = null;
2763
2830
  W.prototype.m = function() {
2764
- var d = L1;
2765
- return d || (L1 = d = i1(W, { 0: { name: "NumberFormat", ia: "i18n.phonenumbers.NumberFormat" }, 1: { name: "pattern", required: !0, i: 9, type: String }, 2: { name: "format", required: !0, i: 9, type: String }, 3: { name: "leading_digits_pattern", aa: !0, i: 9, type: String }, 4: { name: "national_prefix_formatting_rule", i: 9, type: String }, 6: { name: "national_prefix_optional_when_formatting", i: 8, defaultValue: !1, type: Boolean }, 5: { name: "domestic_carrier_code_formatting_rule", i: 9, type: String } })), d;
2766
- }, W.m = W.prototype.m, N.prototype.m = function() {
2767
2831
  var d = N1;
2768
- return d || (N1 = d = i1(N, { 0: { name: "PhoneNumberDesc", ia: "i18n.phonenumbers.PhoneNumberDesc" }, 2: { name: "national_number_pattern", i: 9, type: String }, 9: { name: "possible_length", aa: !0, i: 5, type: Number }, 10: { name: "possible_length_local_only", aa: !0, i: 5, type: Number }, 6: { name: "example_number", i: 9, type: String } })), d;
2769
- }, N.m = N.prototype.m, z.prototype.m = function() {
2832
+ return d || (N1 = d = s1(W, { 0: { name: "NumberFormat", ia: "i18n.phonenumbers.NumberFormat" }, 1: { name: "pattern", required: !0, i: 9, type: String }, 2: { name: "format", required: !0, i: 9, type: String }, 3: { name: "leading_digits_pattern", aa: !0, i: 9, type: String }, 4: { name: "national_prefix_formatting_rule", i: 9, type: String }, 6: { name: "national_prefix_optional_when_formatting", i: 8, defaultValue: !1, type: Boolean }, 5: { name: "domestic_carrier_code_formatting_rule", i: 9, type: String } })), d;
2833
+ }, W.m = W.prototype.m, N.prototype.m = function() {
2770
2834
  var d = T1;
2771
- return d || (T1 = d = i1(z, {
2835
+ return d || (T1 = d = s1(N, { 0: { name: "PhoneNumberDesc", ia: "i18n.phonenumbers.PhoneNumberDesc" }, 2: { name: "national_number_pattern", i: 9, type: String }, 9: { name: "possible_length", aa: !0, i: 5, type: Number }, 10: { name: "possible_length_local_only", aa: !0, i: 5, type: Number }, 6: { name: "example_number", i: 9, type: String } })), d;
2836
+ }, N.m = N.prototype.m, z.prototype.m = function() {
2837
+ var d = A1;
2838
+ return d || (A1 = d = s1(z, {
2772
2839
  0: { name: "PhoneMetadata", ia: "i18n.phonenumbers.PhoneMetadata" },
2773
2840
  1: { name: "general_desc", i: 11, type: N },
2774
2841
  2: { name: "fixed_line", i: 11, type: N },
@@ -2807,19 +2874,19 @@ const Z2 = (y) => {
2807
2874
  })), d;
2808
2875
  }, z.m = z.prototype.m;
2809
2876
  function H() {
2810
- x.call(this);
2877
+ R.call(this);
2811
2878
  }
2812
- n(H, x);
2813
- var A1 = null, f2 = { ra: 0, qa: 1, pa: 5, oa: 10, na: 20 };
2879
+ i(H, R);
2880
+ var E1 = null, p2 = { ra: 0, qa: 1, pa: 5, oa: 10, na: 20 };
2814
2881
  H.prototype.m = function() {
2815
- var d = A1;
2816
- return d || (A1 = d = i1(H, { 0: { name: "PhoneNumber", ia: "i18n.phonenumbers.PhoneNumber" }, 1: { name: "country_code", required: !0, i: 5, type: Number }, 2: { name: "national_number", required: !0, i: 4, type: Number }, 3: { name: "extension", i: 9, type: String }, 4: { name: "italian_leading_zero", i: 8, type: Boolean }, 8: { name: "number_of_leading_zeros", i: 5, defaultValue: 1, type: Number }, 5: { name: "raw_input", i: 9, type: String }, 6: { name: "country_code_source", i: 14, defaultValue: 0, type: f2 }, 7: {
2882
+ var d = E1;
2883
+ return d || (E1 = d = s1(H, { 0: { name: "PhoneNumber", ia: "i18n.phonenumbers.PhoneNumber" }, 1: { name: "country_code", required: !0, i: 5, type: Number }, 2: { name: "national_number", required: !0, i: 4, type: Number }, 3: { name: "extension", i: 9, type: String }, 4: { name: "italian_leading_zero", i: 8, type: Boolean }, 8: { name: "number_of_leading_zeros", i: 5, defaultValue: 1, type: Number }, 5: { name: "raw_input", i: 9, type: String }, 6: { name: "country_code_source", i: 14, defaultValue: 0, type: p2 }, 7: {
2817
2884
  name: "preferred_domestic_carrier_code",
2818
2885
  i: 9,
2819
2886
  type: String
2820
2887
  } })), d;
2821
2888
  }, H.ctor = H, H.ctor.m = H.prototype.m;
2822
- var X = {
2889
+ var Q = {
2823
2890
  1: "US AG AI AS BB BM BS CA DM DO GD GU JM KN KY LC MP MS PR SX TC TT VC VG VI".split(" "),
2824
2891
  7: ["RU", "KZ"],
2825
2892
  20: ["EG"],
@@ -3035,7 +3102,7 @@ const Z2 = (y) => {
3035
3102
  995: ["GE"],
3036
3103
  996: ["KG"],
3037
3104
  998: ["UZ"]
3038
- }, E1 = {
3105
+ }, M1 = {
3039
3106
  AC: [, [
3040
3107
  ,
3041
3108
  ,
@@ -8146,7 +8213,7 @@ const Z2 = (y) => {
8146
8213
  M.h = void 0, M.g = function() {
8147
8214
  return M.h ? M.h : M.h = new M();
8148
8215
  };
8149
- var g1 = { 0: "0", 1: "1", 2: "2", 3: "3", 4: "4", 5: "5", 6: "6", 7: "7", 8: "8", 9: "9", "0": "0", "1": "1", "2": "2", "3": "3", "4": "4", "5": "5", "6": "6", "7": "7", "8": "8", "9": "9", "٠": "0", "١": "1", "٢": "2", "٣": "3", "٤": "4", "٥": "5", "٦": "6", "٧": "7", "٨": "8", "٩": "9", "۰": "0", "۱": "1", "۲": "2", "۳": "3", "۴": "4", "۵": "5", "۶": "6", "۷": "7", "۸": "8", "۹": "9" }, p2 = {
8216
+ var C1 = { 0: "0", 1: "1", 2: "2", 3: "3", 4: "4", 5: "5", 6: "6", 7: "7", 8: "8", 9: "9", "0": "0", "1": "1", "2": "2", "3": "3", "4": "4", "5": "5", "6": "6", "7": "7", "8": "8", "9": "9", "٠": "0", "١": "1", "٢": "2", "٣": "3", "٤": "4", "٥": "5", "٦": "6", "٧": "7", "٨": "8", "٩": "9", "۰": "0", "۱": "1", "۲": "2", "۳": "3", "۴": "4", "۵": "5", "۶": "6", "۷": "7", "۸": "8", "۹": "9" }, g2 = {
8150
8217
  0: "0",
8151
8218
  1: "1",
8152
8219
  2: "2",
@@ -8160,7 +8227,7 @@ const Z2 = (y) => {
8160
8227
  "+": "+",
8161
8228
  "*": "*",
8162
8229
  "#": "#"
8163
- }, g2 = {
8230
+ }, C2 = {
8164
8231
  0: "0",
8165
8232
  1: "1",
8166
8233
  2: "2",
@@ -8227,83 +8294,83 @@ const Z2 = (y) => {
8227
8294
  X: "9",
8228
8295
  Y: "9",
8229
8296
  Z: "9"
8230
- }, C2 = RegExp("[++]+"), Q = RegExp("^[++]+"), M1 = RegExp("([0-90-9٠-٩۰-۹])"), m2 = RegExp("[++0-90-9٠-٩۰-۹]"), y2 = /[\\\/] *x/, _2 = RegExp("[^0-90-9٠-٩۰-۹A-Za-z#]+$"), I2 = /(?:.*?[A-Za-z]){3}.*/, v2 = RegExp("^\\+([0-90-9٠-٩۰-۹]|[\\-\\.\\(\\)]?)*[0-90-9٠-٩۰-۹]([0-90-9٠-٩۰-۹]|[\\-\\.\\(\\)]?)*$"), S2 = RegExp("^([A-Za-z0-90-9٠-٩۰-۹]+((\\-)*[A-Za-z0-90-9٠-٩۰-۹])*\\.)*[A-Za-z]+((\\-)*[A-Za-z0-90-9٠-٩۰-۹])*\\.?$");
8231
- function Y(d) {
8297
+ }, m2 = RegExp("[++]+"), d1 = RegExp("^[++]+"), D1 = RegExp("([0-90-9٠-٩۰-۹])"), y2 = RegExp("[++0-90-9٠-٩۰-۹]"), _2 = /[\\\/] *x/, I2 = RegExp("[^0-90-9٠-٩۰-۹A-Za-z#]+$"), v2 = /(?:.*?[A-Za-z]){3}.*/, S2 = RegExp("^\\+([0-90-9٠-٩۰-۹]|[\\-\\.\\(\\)]?)*[0-90-9٠-٩۰-۹]([0-90-9٠-٩۰-۹]|[\\-\\.\\(\\)]?)*$"), w2 = RegExp("^([A-Za-z0-90-9٠-٩۰-۹]+((\\-)*[A-Za-z0-90-9٠-٩۰-۹])*\\.)*[A-Za-z]+((\\-)*[A-Za-z0-90-9٠-٩۰-۹])*\\.?$");
8298
+ function J(d) {
8232
8299
  return "([0-90-9٠-٩۰-۹]{1," + d + "})";
8233
8300
  }
8234
- function D1() {
8235
- return ";ext=" + Y("20") + "|[  \\t,]*(?:e?xt(?:ensi(?:ó?|ó))?n?|e?xtn?|доб|anexo)[:\\..]?[  \\t,-]*" + (Y("20") + "#?|[  \\t,]*(?:[xx##~~]|int|int)[:\\..]?[  \\t,-]*") + (Y("9") + "#?|[- ]+") + (Y("6") + "#|[  \\t]*(?:,{2}|;)[:\\..]?[  \\t,-]*") + (Y("15") + "#?|[  \\t]*(?:,)+[:\\..]?[  \\t,-]*") + (Y("9") + "#?");
8236
- }
8237
- var P1 = new RegExp("(?:" + D1() + ")$", "i"), w2 = new RegExp("^[0-90-9٠-٩۰-۹]{2}$|^[++]*(?:[-x‐-―−ー--/  ­​⁠ ()()[].\\[\\]/~⁓∼~*]*[0-90-9٠-٩۰-۹]){3,}[-x‐-―−ー--/  ­​⁠ ()()[].\\[\\]/~⁓∼~*A-Za-z0-90-9٠-٩۰-۹]*(?:" + D1() + ")?$", "i"), b2 = /(\$\d)/, L2 = /^\(?\$1\)?$/;
8238
- function x1(d) {
8239
- return 2 > d.length ? !1 : U(w2, d);
8301
+ function x1() {
8302
+ return ";ext=" + J("20") + "|[  \\t,]*(?:e?xt(?:ensi(?:ó?|ó))?n?|e?xtn?|доб|anexo)[:\\..]?[  \\t,-]*" + (J("20") + "#?|[  \\t,]*(?:[xx##~~]|int|int)[:\\..]?[  \\t,-]*") + (J("9") + "#?|[- ]+") + (J("6") + "#|[  \\t]*(?:,{2}|;)[:\\..]?[  \\t,-]*") + (J("15") + "#?|[  \\t]*(?:,)+[:\\..]?[  \\t,-]*") + (J("9") + "#?");
8240
8303
  }
8304
+ var P1 = new RegExp("(?:" + x1() + ")$", "i"), b2 = new RegExp("^[0-90-9٠-٩۰-۹]{2}$|^[++]*(?:[-x‐-―−ー--/  ­​⁠ ()()[].\\[\\]/~⁓∼~*]*[0-90-9٠-٩۰-۹]){3,}[-x‐-―−ー--/  ­​⁠ ()()[].\\[\\]/~⁓∼~*A-Za-z0-90-9٠-٩۰-۹]*(?:" + x1() + ")?$", "i"), L2 = /(\$\d)/, N2 = /^\(?\$1\)?$/;
8241
8305
  function R1(d) {
8242
- return U(I2, d) ? s1(d, g2) : s1(d, g1);
8306
+ return 2 > d.length ? !1 : F(b2, d);
8243
8307
  }
8244
8308
  function B1(d) {
8245
- var t = R1(d.toString());
8246
- B(d), d.g(t);
8309
+ return F(v2, d) ? o1(d, C2) : o1(d, C1);
8247
8310
  }
8248
8311
  function k1(d) {
8249
- return d != null && (K(d, 9) != 1 || P(d, 9)[0] != -1);
8312
+ var t = B1(d.toString());
8313
+ k(d), d.g(t);
8250
8314
  }
8251
- function s1(d, t) {
8252
- for (var $ = new T(), i, o = d.length, u = 0; u < o; ++u) i = d.charAt(u), i = t[i.toUpperCase()], i != null && $.g(i);
8315
+ function O1(d) {
8316
+ return d != null && (K(d, 9) != 1 || x(d, 9)[0] != -1);
8317
+ }
8318
+ function o1(d, t) {
8319
+ for (var $ = new A(), n, o = d.length, a = 0; a < o; ++a) n = d.charAt(a), n = t[n.toUpperCase()], n != null && $.g(n);
8253
8320
  return $.toString();
8254
8321
  }
8255
- function O1(d) {
8256
- return d.length == 0 || L2.test(d);
8322
+ function G1(d) {
8323
+ return d.length == 0 || N2.test(d);
8257
8324
  }
8258
- function o1(d) {
8259
- return d != null && isNaN(d) && d.toUpperCase() in E1;
8325
+ function a1(d) {
8326
+ return d != null && isNaN(d) && d.toUpperCase() in M1;
8260
8327
  }
8261
8328
  M.prototype.format = function(d, t) {
8262
- if (g(d, 2) == 0 && R(d, 5)) {
8263
- var $ = S(d, 5);
8329
+ if (g(d, 2) == 0 && B(d, 5)) {
8330
+ var $ = v(d, 5);
8264
8331
  if (0 < $.length) return $;
8265
8332
  }
8266
- $ = S(d, 1);
8267
- var i = t1(d);
8268
- if (t == 0) return G1($, 0, i, "");
8269
- if (!($ in X)) return i;
8270
- var o = d1(this, $, e1($));
8271
- d = R(d, 3) && g(d, 3).length != 0 ? t == 3 ? ";ext=" + g(d, 3) : R(o, 13) ? g(o, 13) + S(d, 3) : " ext. " + S(d, 3) : "";
8333
+ $ = v(d, 1);
8334
+ var n = e1(d);
8335
+ if (t == 0) return U1($, 0, n, "");
8336
+ if (!($ in Q)) return n;
8337
+ var o = t1(this, $, $1($));
8338
+ d = B(d, 3) && g(d, 3).length != 0 ? t == 3 ? ";ext=" + g(d, 3) : B(o, 13) ? g(o, 13) + v(d, 3) : " ext. " + v(d, 3) : "";
8272
8339
  d: {
8273
- o = P(o, 20).length == 0 || t == 2 ? P(o, 19) : P(o, 20);
8274
- for (var u, a = o.length, h = 0; h < a; ++h) {
8275
- u = o[h];
8276
- var _ = K(u, 3);
8277
- if ((_ == 0 || i.search(g(u, 3, _ - 1)) == 0) && (_ = new RegExp(g(u, 1)), U(_, i))) {
8278
- o = u;
8340
+ o = x(o, 20).length == 0 || t == 2 ? x(o, 19) : x(o, 20);
8341
+ for (var a, u = o.length, h = 0; h < u; ++h) {
8342
+ a = o[h];
8343
+ var _ = K(a, 3);
8344
+ if ((_ == 0 || n.search(g(a, 3, _ - 1)) == 0) && (_ = new RegExp(g(a, 1)), F(_, n))) {
8345
+ o = a;
8279
8346
  break d;
8280
8347
  }
8281
8348
  }
8282
8349
  o = null;
8283
8350
  }
8284
- return o != null && (a = o, o = S(a, 2), u = new RegExp(g(a, 1)), S(
8285
- a,
8351
+ return o != null && (u = o, o = v(u, 2), a = new RegExp(g(u, 1)), v(
8352
+ u,
8286
8353
  5
8287
- ), a = S(a, 4), i = t == 2 && a != null && 0 < a.length ? i.replace(u, o.replace(b2, a)) : i.replace(u, o), t == 3 && (i = i.replace(RegExp("^[-x‐-―−ー--/  ­​⁠ ()()[].\\[\\]/~⁓∼~]+"), ""), i = i.replace(RegExp("[-x‐-―−ー--/  ­​⁠ ()()[].\\[\\]/~⁓∼~]+", "g"), "-"))), G1($, t, i, d);
8354
+ ), u = v(u, 4), n = t == 2 && u != null && 0 < u.length ? n.replace(a, o.replace(L2, u)) : n.replace(a, o), t == 3 && (n = n.replace(RegExp("^[-x‐-―−ー--/  ­​⁠ ()()[].\\[\\]/~⁓∼~]+"), ""), n = n.replace(RegExp("[-x‐-―−ー--/  ­​⁠ ()()[].\\[\\]/~⁓∼~]+", "g"), "-"))), U1($, t, n, d);
8288
8355
  };
8289
- function d1(d, t, $) {
8356
+ function t1(d, t, $) {
8290
8357
  return $ == "001" ? j(d, "" + t) : j(d, $);
8291
8358
  }
8292
- function t1(d) {
8293
- if (!R(d, 2)) return "";
8359
+ function e1(d) {
8360
+ if (!B(d, 2)) return "";
8294
8361
  var t = "" + g(d, 2);
8295
- return R(d, 4) && g(d, 4) && 0 < S(d, 8) ? Array(S(d, 8) + 1).join("0") + t : t;
8362
+ return B(d, 4) && g(d, 4) && 0 < v(d, 8) ? Array(v(d, 8) + 1).join("0") + t : t;
8296
8363
  }
8297
- function G1(d, t, $, i) {
8364
+ function U1(d, t, $, n) {
8298
8365
  switch (t) {
8299
8366
  case 0:
8300
- return "+" + d + $ + i;
8367
+ return "+" + d + $ + n;
8301
8368
  case 1:
8302
- return "+" + d + " " + $ + i;
8369
+ return "+" + d + " " + $ + n;
8303
8370
  case 3:
8304
- return "tel:+" + d + "-" + $ + i;
8371
+ return "tel:+" + d + "-" + $ + n;
8305
8372
  default:
8306
- return $ + i;
8373
+ return $ + n;
8307
8374
  }
8308
8375
  }
8309
8376
  function u1(d, t) {
@@ -8334,10 +8401,10 @@ const Z2 = (y) => {
8334
8401
  }
8335
8402
  }
8336
8403
  function F1(d, t) {
8337
- var $ = U1(d, t);
8338
- return d = d1(d, S(t, 1), $), d == null ? -1 : (t = t1(t), C1(t, d));
8404
+ var $ = V1(d, t);
8405
+ return d = t1(d, v(t, 1), $), d == null ? -1 : (t = e1(t), m1(t, d));
8339
8406
  }
8340
- function C1(d, t) {
8407
+ function m1(d, t) {
8341
8408
  return O(d, g(t, 1)) ? O(d, g(t, 5)) ? 4 : O(d, g(t, 4)) ? 3 : O(d, g(t, 6)) ? 5 : O(d, g(t, 8)) ? 6 : O(d, g(t, 7)) ? 7 : O(d, g(t, 21)) ? 8 : O(d, g(t, 25)) ? 9 : O(d, g(t, 28)) ? 10 : O(d, g(t, 2)) ? g(t, 18) || O(d, g(t, 3)) ? 2 : 0 : !g(t, 18) && O(d, g(t, 3)) ? 1 : -1 : -1;
8342
8409
  }
8343
8410
  function j(d, t) {
@@ -8345,36 +8412,36 @@ const Z2 = (y) => {
8345
8412
  t = t.toUpperCase();
8346
8413
  var $ = d.g[t];
8347
8414
  if ($ == null) {
8348
- if ($ = E1[t], $ == null) return null;
8349
- $ = new q().g(z.m(), $), d.g[t] = $;
8415
+ if ($ = M1[t], $ == null) return null;
8416
+ $ = new X().g(z.m(), $), d.g[t] = $;
8350
8417
  }
8351
8418
  return $;
8352
8419
  }
8353
8420
  function O(d, t) {
8354
8421
  var $ = d.length;
8355
- return 0 < K(t, 9) && P(t, 9).indexOf($) == -1 ? !1 : U(S(t, 2), d);
8422
+ return 0 < K(t, 9) && x(t, 9).indexOf($) == -1 ? !1 : F(v(t, 2), d);
8356
8423
  }
8357
- function N2(d, t) {
8358
- var $ = U1(d, t), i = S(t, 1), o = d1(d, i, $);
8359
- return o == null || $ != "001" && i != V1(d, $) ? o = !1 : (d = t1(t), o = C1(d, o) != -1), o;
8424
+ function T2(d, t) {
8425
+ var $ = V1(d, t), n = v(t, 1), o = t1(d, n, $);
8426
+ return o == null || $ != "001" && n != K1(d, $) ? o = !1 : (d = e1(t), o = m1(d, o) != -1), o;
8360
8427
  }
8361
- function U1(d, t) {
8428
+ function V1(d, t) {
8362
8429
  if (t == null) return null;
8363
- var $ = S(t, 1);
8364
- if ($ = X[$], $ == null) d = null;
8430
+ var $ = v(t, 1);
8431
+ if ($ = Q[$], $ == null) d = null;
8365
8432
  else if ($.length == 1) d = $[0];
8366
8433
  else d: {
8367
- t = t1(t);
8368
- for (var i, o = $.length, u = 0; u < o; u++) {
8369
- i = $[u];
8370
- var a = j(d, i);
8371
- if (R(a, 23)) {
8372
- if (t.search(g(a, 23)) == 0) {
8373
- d = i;
8434
+ t = e1(t);
8435
+ for (var n, o = $.length, a = 0; a < o; a++) {
8436
+ n = $[a];
8437
+ var u = j(d, n);
8438
+ if (B(u, 23)) {
8439
+ if (t.search(g(u, 23)) == 0) {
8440
+ d = n;
8374
8441
  break d;
8375
8442
  }
8376
- } else if (C1(t, a) != -1) {
8377
- d = i;
8443
+ } else if (m1(t, u) != -1) {
8444
+ d = n;
8378
8445
  break d;
8379
8446
  }
8380
8447
  }
@@ -8382,151 +8449,151 @@ const Z2 = (y) => {
8382
8449
  }
8383
8450
  return d;
8384
8451
  }
8385
- function e1(d) {
8386
- return d = X[d], d == null ? "ZZ" : d[0];
8452
+ function $1(d) {
8453
+ return d = Q[d], d == null ? "ZZ" : d[0];
8387
8454
  }
8388
- function V1(d, t) {
8455
+ function K1(d, t) {
8389
8456
  if (d = j(d, t), d == null) throw Error("Invalid region code: " + t);
8390
- return S(d, 10);
8457
+ return v(d, 10);
8391
8458
  }
8392
- function a1(d, t, $, i) {
8393
- var o = u1($, i), u = K(o, 9) == 0 ? P(g($, 1), 9) : P(o, 9);
8394
- if (o = P(o, 10), i == 2) if (k1(u1($, 0))) d = u1($, 1), k1(d) && (u = u.concat(K(d, 9) == 0 ? P(g($, 1), 9) : P(d, 9)), u.sort(), o.length == 0 ? o = P(d, 10) : (o = o.concat(P(d, 10)), o.sort()));
8395
- else return a1(d, t, $, 1);
8396
- return u[0] == -1 ? 5 : (t = t.length, -1 < o.indexOf(t) ? 4 : ($ = u[0], $ == t ? 0 : $ > t ? 2 : u[u.length - 1] < t ? 3 : -1 < u.indexOf(t, 1) ? 0 : 5));
8459
+ function l1(d, t, $, n) {
8460
+ var o = u1($, n), a = K(o, 9) == 0 ? x(g($, 1), 9) : x(o, 9);
8461
+ if (o = x(o, 10), n == 2) if (O1(u1($, 0))) d = u1($, 1), O1(d) && (a = a.concat(K(d, 9) == 0 ? x(g($, 1), 9) : x(d, 9)), a.sort(), o.length == 0 ? o = x(d, 10) : (o = o.concat(x(d, 10)), o.sort()));
8462
+ else return l1(d, t, $, 1);
8463
+ return a[0] == -1 ? 5 : (t = t.length, -1 < o.indexOf(t) ? 4 : ($ = a[0], $ == t ? 0 : $ > t ? 2 : a[a.length - 1] < t ? 3 : -1 < a.indexOf(t, 1) ? 0 : 5));
8397
8464
  }
8398
- function l1(d, t, $) {
8399
- var i = t1(t);
8400
- return t = S(t, 1), t in X ? (t = d1(d, t, e1(t)), a1(d, i, t, $)) : 1;
8465
+ function h1(d, t, $) {
8466
+ var n = e1(t);
8467
+ return t = v(t, 1), t in Q ? (t = t1(d, t, $1(t)), l1(d, n, t, $)) : 1;
8401
8468
  }
8402
- function K1(d, t) {
8469
+ function H1(d, t) {
8403
8470
  if (d = d.toString(), d.length == 0 || d.charAt(0) == "0") return 0;
8404
- for (var $, i = d.length, o = 1; 3 >= o && o <= i; ++o) if ($ = parseInt(d.substring(0, o), 10), $ in X) return t.g(d.substring(o)), $;
8471
+ for (var $, n = d.length, o = 1; 3 >= o && o <= n; ++o) if ($ = parseInt(d.substring(0, o), 10), $ in Q) return t.g(d.substring(o)), $;
8405
8472
  return 0;
8406
8473
  }
8407
- function H1(d, t, $, i, o, u) {
8474
+ function j1(d, t, $, n, o, a) {
8408
8475
  if (t.length == 0) return 0;
8409
- t = new T(t);
8410
- var a;
8411
- $ != null && (a = g($, 11)), a == null && (a = "NonMatch");
8476
+ t = new A(t);
8477
+ var u;
8478
+ $ != null && (u = g($, 11)), u == null && (u = "NonMatch");
8412
8479
  var h = t.toString();
8413
- if (h.length == 0) a = 20;
8414
- else if (Q.test(h)) h = h.replace(Q, ""), B(t), t.g(R1(h)), a = 1;
8480
+ if (h.length == 0) u = 20;
8481
+ else if (d1.test(h)) h = h.replace(d1, ""), k(t), t.g(B1(h)), u = 1;
8415
8482
  else {
8416
- if (h = new RegExp(a), B1(t), a = t.toString(), a.search(h) == 0) {
8417
- h = a.match(h)[0].length;
8418
- var _ = a.substring(h).match(M1);
8419
- _ && _[1] != null && 0 < _[1].length && s1(_[1], g1) == "0" ? a = !1 : (B(t), t.g(a.substring(h)), a = !0);
8420
- } else a = !1;
8421
- a = a ? 5 : 20;
8483
+ if (h = new RegExp(u), k1(t), u = t.toString(), u.search(h) == 0) {
8484
+ h = u.match(h)[0].length;
8485
+ var _ = u.substring(h).match(D1);
8486
+ _ && _[1] != null && 0 < _[1].length && o1(_[1], C1) == "0" ? u = !1 : (k(t), t.g(u.substring(h)), u = !0);
8487
+ } else u = !1;
8488
+ u = u ? 5 : 20;
8422
8489
  }
8423
- if (o && E(u, 6, a), a != 20) {
8490
+ if (o && E(a, 6, u), u != 20) {
8424
8491
  if (2 >= t.h.length) throw Error("Phone number too short after IDD");
8425
- if (d = K1(t, i), d != 0) return E(u, 1, d), d;
8492
+ if (d = H1(t, n), d != 0) return E(a, 1, d), d;
8426
8493
  throw Error("Invalid country calling code");
8427
8494
  }
8428
- return $ != null && (a = S($, 10), h = "" + a, _ = t.toString(), _.lastIndexOf(h, 0) == 0 && (h = new T(_.substring(h.length)), _ = g($, 1), _ = new RegExp(S(_, 2)), j1(h, $, null), h = h.toString(), !U(_, t.toString()) && U(_, h) || a1(d, t.toString(), $, -1) == 3)) ? (i.g(h), o && E(u, 6, 10), E(u, 1, a), a) : (E(u, 1, 0), 0);
8429
- }
8430
- function j1(d, t, $) {
8431
- var i = d.toString(), o = i.length, u = g(t, 15);
8432
- if (o != 0 && u != null && u.length != 0) {
8433
- var a = new RegExp("^(?:" + u + ")");
8434
- if (o = a.exec(i)) {
8435
- u = new RegExp(S(g(t, 1), 2));
8436
- var h = U(u, i), _ = o.length - 1;
8437
- t = g(t, 16), t == null || t.length == 0 || o[_] == null || o[_].length == 0 ? (!h || U(u, i.substring(o[0].length))) && ($ != null && 0 < _ && o[_] != null && $.g(o[1]), d.set(i.substring(o[0].length))) : (i = i.replace(a, t), (!h || U(u, i)) && ($ != null && 0 < _ && $.g(o[1]), d.set(i)));
8495
+ return $ != null && (u = v($, 10), h = "" + u, _ = t.toString(), _.lastIndexOf(h, 0) == 0 && (h = new A(_.substring(h.length)), _ = g($, 1), _ = new RegExp(v(_, 2)), W1(h, $, null), h = h.toString(), !F(_, t.toString()) && F(_, h) || l1(d, t.toString(), $, -1) == 3)) ? (n.g(h), o && E(a, 6, 10), E(a, 1, u), u) : (E(a, 1, 0), 0);
8496
+ }
8497
+ function W1(d, t, $) {
8498
+ var n = d.toString(), o = n.length, a = g(t, 15);
8499
+ if (o != 0 && a != null && a.length != 0) {
8500
+ var u = new RegExp("^(?:" + a + ")");
8501
+ if (o = u.exec(n)) {
8502
+ a = new RegExp(v(g(t, 1), 2));
8503
+ var h = F(a, n), _ = o.length - 1;
8504
+ t = g(t, 16), t == null || t.length == 0 || o[_] == null || o[_].length == 0 ? (!h || F(a, n.substring(o[0].length))) && ($ != null && 0 < _ && o[_] != null && $.g(o[1]), d.set(n.substring(o[0].length))) : (n = n.replace(u, t), (!h || F(a, n)) && ($ != null && 0 < _ && $.g(o[1]), d.set(n)));
8438
8505
  }
8439
8506
  }
8440
8507
  }
8441
8508
  function Z(d, t, $) {
8442
- if (!o1($) && 0 < t.length && t.charAt(0) != "+") throw Error("Invalid country calling code");
8443
- return W1(d, t, $, !0);
8509
+ if (!a1($) && 0 < t.length && t.charAt(0) != "+") throw Error("Invalid country calling code");
8510
+ return z1(d, t, $, !0);
8444
8511
  }
8445
- function W1(d, t, $, i) {
8512
+ function z1(d, t, $, n) {
8446
8513
  if (t == null) throw Error("The string supplied did not seem to be a phone number");
8447
8514
  if (250 < t.length) throw Error("The string supplied is too long to be a phone number");
8448
- var o = new T(), u = t.indexOf(";phone-context=");
8449
- if (u === -1) u = null;
8450
- else if (u += 15, u >= t.length) u = "";
8515
+ var o = new A(), a = t.indexOf(";phone-context=");
8516
+ if (a === -1) a = null;
8517
+ else if (a += 15, a >= t.length) a = "";
8451
8518
  else {
8452
- var a = t.indexOf(";", u);
8453
- u = a !== -1 ? t.substring(u, a) : t.substring(u);
8519
+ var u = t.indexOf(";", a);
8520
+ a = u !== -1 ? t.substring(a, u) : t.substring(a);
8454
8521
  }
8455
- var h = u;
8456
- if (h == null ? a = !0 : h.length === 0 ? a = !1 : (a = v2.exec(h), h = S2.exec(h), a = a !== null || h !== null), !a || (u != null ? (u.charAt(0) === "+" && o.g(u), u = t.indexOf("tel:"), o.g(t.substring(0 <= u ? u + 4 : 0, t.indexOf(";phone-context=")))) : (u = o.g, a = t ?? "", h = a.search(m2), 0 <= h ? (a = a.substring(h), a = a.replace(_2, ""), h = a.search(y2), 0 <= h && (a = a.substring(0, h))) : a = "", u.call(o, a)), u = o.toString(), a = u.indexOf(";isub="), 0 < a && (B(o), o.g(u.substring(0, a))), !x1(o.toString()))) throw Error("The string supplied did not seem to be a phone number");
8457
- if (u = o.toString(), !(o1($) || u != null && 0 < u.length && Q.test(u))) throw Error("Invalid country calling code");
8458
- u = new H(), i && E(u, 5, t);
8522
+ var h = a;
8523
+ if (h == null ? u = !0 : h.length === 0 ? u = !1 : (u = S2.exec(h), h = w2.exec(h), u = u !== null || h !== null), !u || (a != null ? (a.charAt(0) === "+" && o.g(a), a = t.indexOf("tel:"), o.g(t.substring(0 <= a ? a + 4 : 0, t.indexOf(";phone-context=")))) : (a = o.g, u = t ?? "", h = u.search(y2), 0 <= h ? (u = u.substring(h), u = u.replace(I2, ""), h = u.search(_2), 0 <= h && (u = u.substring(0, h))) : u = "", a.call(o, u)), a = o.toString(), u = a.indexOf(";isub="), 0 < u && (k(o), o.g(a.substring(0, u))), !R1(o.toString()))) throw Error("The string supplied did not seem to be a phone number");
8524
+ if (a = o.toString(), !(a1($) || a != null && 0 < a.length && d1.test(a))) throw Error("Invalid country calling code");
8525
+ a = new H(), n && E(a, 5, t);
8459
8526
  d: {
8460
- if (t = o.toString(), a = t.search(P1), 0 <= a && x1(t.substring(0, a))) {
8527
+ if (t = o.toString(), u = t.search(P1), 0 <= u && R1(t.substring(0, u))) {
8461
8528
  h = t.match(P1);
8462
8529
  for (var _ = h.length, V = 1; V < _; ++V) if (h[V] != null && 0 < h[V].length) {
8463
- B(o), o.g(t.substring(0, a)), t = h[V];
8530
+ k(o), o.g(t.substring(0, u)), t = h[V];
8464
8531
  break d;
8465
8532
  }
8466
8533
  }
8467
8534
  t = "";
8468
8535
  }
8469
- 0 < t.length && E(u, 3, t), a = j(d, $), t = new T(), h = 0, _ = o.toString();
8536
+ 0 < t.length && E(a, 3, t), u = j(d, $), t = new A(), h = 0, _ = o.toString();
8470
8537
  try {
8471
- h = H1(d, _, a, t, i, u);
8472
- } catch (_1) {
8473
- if (_1.message == "Invalid country calling code" && Q.test(_)) {
8474
- if (_ = _.replace(Q, ""), h = H1(d, _, a, t, i, u), h == 0) throw _1;
8475
- } else throw _1;
8538
+ h = j1(d, _, u, t, n, a);
8539
+ } catch (I1) {
8540
+ if (I1.message == "Invalid country calling code" && d1.test(_)) {
8541
+ if (_ = _.replace(d1, ""), h = j1(d, _, u, t, n, a), h == 0) throw I1;
8542
+ } else throw I1;
8476
8543
  }
8477
- if (h != 0 ? (o = e1(h), o != $ && (a = d1(d, h, o))) : (B1(o), t.g(o.toString()), $ != null ? (h = S(a, 10), E(
8478
- u,
8544
+ if (h != 0 ? (o = $1(h), o != $ && (u = t1(d, h, o))) : (k1(o), t.g(o.toString()), $ != null ? (h = v(u, 10), E(
8545
+ a,
8479
8546
  1,
8480
8547
  h
8481
- )) : i && (delete u.h[6], u.g && delete u.g[6])), 2 > t.h.length || (a != null && ($ = new T(), o = new T(t.toString()), j1(o, a, $), d = a1(d, o.toString(), a, -1), d != 2 && d != 4 && d != 5 && (t = o, i && 0 < $.toString().length && E(u, 7, $.toString()))), i = t.toString(), d = i.length, 2 > d)) throw Error("The string supplied is too short to be a phone number");
8548
+ )) : n && (delete a.h[6], a.g && delete a.g[6])), 2 > t.h.length || (u != null && ($ = new A(), o = new A(t.toString()), W1(o, u, $), d = l1(d, o.toString(), u, -1), d != 2 && d != 4 && d != 5 && (t = o, n && 0 < $.toString().length && E(a, 7, $.toString()))), n = t.toString(), d = n.length, 2 > d)) throw Error("The string supplied is too short to be a phone number");
8482
8549
  if (17 < d) throw Error("The string supplied is too long to be a phone number");
8483
- if (1 < i.length && i.charAt(0) == "0") {
8484
- for (E(u, 4, !0), d = 1; d < i.length - 1 && i.charAt(d) == "0"; ) d++;
8485
- d != 1 && E(u, 8, d);
8550
+ if (1 < n.length && n.charAt(0) == "0") {
8551
+ for (E(a, 4, !0), d = 1; d < n.length - 1 && n.charAt(d) == "0"; ) d++;
8552
+ d != 1 && E(a, 8, d);
8486
8553
  }
8487
- return E(u, 2, parseInt(i, 10)), u;
8554
+ return E(a, 2, parseInt(n, 10)), a;
8488
8555
  }
8489
- function U(d, t) {
8556
+ function F(d, t) {
8490
8557
  return !!((d = t.match(new RegExp("^(?:" + (typeof d == "string" ? d : d.source) + ")$", "i"))) && d[0].length == t.length);
8491
8558
  }
8492
- function T2(d) {
8493
- this.fa = RegExp(" "), this.ja = "", this.v = new T(), this.da = "", this.s = new T(), this.ba = new T(), this.u = !0, this.ea = this.ca = this.la = !1, this.ga = M.g(), this.$ = 0, this.h = new T(), this.ha = !1, this.o = "", this.g = new T(), this.j = [], this.ka = d, this.l = Y1(this, this.ka);
8559
+ function A2(d) {
8560
+ this.fa = RegExp(" "), this.ja = "", this.v = new A(), this.da = "", this.s = new A(), this.ba = new A(), this.u = !0, this.ea = this.ca = this.la = !1, this.ga = M.g(), this.$ = 0, this.h = new A(), this.ha = !1, this.o = "", this.g = new A(), this.j = [], this.ka = d, this.l = J1(this, this.ka);
8494
8561
  }
8495
- var z1 = new z();
8496
- E(z1, 11, "NA");
8497
- var A2 = RegExp("^[-x‐-―−ー--/  ­​⁠ ()()[].\\[\\]/~⁓∼~]*\\$1[-x‐-―−ー--/  ­​⁠ ()()[].\\[\\]/~⁓∼~]*(\\$\\d[-x‐-―−ー--/  ­​⁠ ()()[].\\[\\]/~⁓∼~]*)*$"), Z1 = /[- ]/;
8498
- function Y1(d, t) {
8562
+ var Z1 = new z();
8563
+ E(Z1, 11, "NA");
8564
+ var E2 = RegExp("^[-x‐-―−ー--/  ­​⁠ ()()[].\\[\\]/~⁓∼~]*\\$1[-x‐-―−ー--/  ­​⁠ ()()[].\\[\\]/~⁓∼~]*(\\$\\d[-x‐-―−ー--/  ­​⁠ ()()[].\\[\\]/~⁓∼~]*)*$"), Y1 = /[- ]/;
8565
+ function J1(d, t) {
8499
8566
  var $ = d.ga;
8500
- return t = o1(t) ? V1($, t) : 0, d = j(d.ga, e1(t)), d ?? z1;
8567
+ return t = a1(t) ? K1($, t) : 0, d = j(d.ga, $1(t)), d ?? Z1;
8501
8568
  }
8502
- function J1(d) {
8569
+ function q1(d) {
8503
8570
  for (var t = d.j.length, $ = 0; $ < t; ++$) {
8504
- var i = d.j[$], o = S(i, 1);
8571
+ var n = d.j[$], o = v(n, 1);
8505
8572
  if (d.da == o) return !1;
8506
- var u = d, a = i, h = S(a, 1);
8507
- B(u.v);
8508
- var _ = u;
8509
- a = S(a, 2);
8573
+ var a = d, u = n, h = v(u, 1);
8574
+ k(a.v);
8575
+ var _ = a;
8576
+ u = v(u, 2);
8510
8577
  var V = "999999999999999".match(h)[0];
8511
- if (V.length < _.g.h.length ? _ = "" : (_ = V.replace(new RegExp(h, "g"), a), _ = _.replace(RegExp("9", "g"), " ")), 0 < _.length ? (u.v.g(_), u = !0) : u = !1, u) return d.da = o, d.ha = Z1.test(g(i, 4)), d.$ = 0, !0;
8578
+ if (V.length < _.g.h.length ? _ = "" : (_ = V.replace(new RegExp(h, "g"), u), _ = _.replace(RegExp("9", "g"), " ")), 0 < _.length ? (a.v.g(_), a = !0) : a = !1, a) return d.da = o, d.ha = Y1.test(g(n, 4)), d.$ = 0, !0;
8512
8579
  }
8513
8580
  return d.u = !1;
8514
8581
  }
8515
- function q1(d, t) {
8516
- for (var $ = [], i = t.length - 3, o = d.j.length, u = 0; u < o; ++u) {
8517
- var a = d.j[u];
8518
- K(a, 3) == 0 ? $.push(d.j[u]) : (a = g(a, 3, Math.min(i, K(a, 3) - 1)), t.search(a) == 0 && $.push(d.j[u]));
8582
+ function X1(d, t) {
8583
+ for (var $ = [], n = t.length - 3, o = d.j.length, a = 0; a < o; ++a) {
8584
+ var u = d.j[a];
8585
+ K(u, 3) == 0 ? $.push(d.j[a]) : (u = g(u, 3, Math.min(n, K(u, 3) - 1)), t.search(u) == 0 && $.push(d.j[a]));
8519
8586
  }
8520
8587
  d.j = $;
8521
8588
  }
8522
- function E2(d, t) {
8589
+ function M2(d, t) {
8523
8590
  d.s.g(t);
8524
8591
  var $ = t;
8525
- if (M1.test($) || d.s.h.length == 1 && C2.test($) ? (t == "+" ? ($ = t, d.ba.g(t)) : ($ = g1[t], d.ba.g($), d.g.g($)), t = $) : (d.u = !1, d.la = !0), !d.u) {
8592
+ if (D1.test($) || d.s.h.length == 1 && m2.test($) ? (t == "+" ? ($ = t, d.ba.g(t)) : ($ = C1[t], d.ba.g($), d.g.g($)), t = $) : (d.u = !1, d.la = !0), !d.u) {
8526
8593
  if (!d.la) {
8527
- if (e2(d)) {
8528
- if ($2(d)) return X1(d);
8529
- } else if (0 < d.o.length && (t = d.g.toString(), B(d.g), d.g.g(d.o), d.g.g(t), t = d.h.toString(), $ = t.lastIndexOf(d.o), B(d.h), d.h.g(t.substring(0, $))), d.o != t2(d)) return d.h.g(" "), X1(d);
8594
+ if ($2(d)) {
8595
+ if (i2(d)) return Q1(d);
8596
+ } else if (0 < d.o.length && (t = d.g.toString(), k(d.g), d.g.g(d.o), d.g.g(t), t = d.h.toString(), $ = t.lastIndexOf(d.o), k(d.h), d.h.g(t.substring(0, $))), d.o != e2(d)) return d.h.g(" "), Q1(d);
8530
8597
  }
8531
8598
  return d.s.toString();
8532
8599
  }
@@ -8536,99 +8603,99 @@ const Z2 = (y) => {
8536
8603
  case 2:
8537
8604
  return d.s.toString();
8538
8605
  case 3:
8539
- if (e2(d)) d.ea = !0;
8540
- else return d.o = t2(d), m1(d);
8606
+ if ($2(d)) d.ea = !0;
8607
+ else return d.o = e2(d), y1(d);
8541
8608
  default:
8542
- return d.ea ? ($2(d) && (d.ea = !1), d.h.toString() + d.g.toString()) : 0 < d.j.length ? (t = n2(d, t), $ = Q1(d), 0 < $.length ? $ : (q1(d, d.g.toString()), J1(d) ? d2(d) : d.u ? h1(d, t) : d.s.toString())) : m1(d);
8609
+ return d.ea ? (i2(d) && (d.ea = !1), d.h.toString() + d.g.toString()) : 0 < d.j.length ? (t = n2(d, t), $ = d2(d), 0 < $.length ? $ : (X1(d, d.g.toString()), q1(d) ? t2(d) : d.u ? c1(d, t) : d.s.toString())) : y1(d);
8543
8610
  }
8544
8611
  }
8545
- function X1(d) {
8546
- return d.u = !0, d.ea = !1, d.j = [], d.$ = 0, B(d.v), d.da = "", m1(d);
8547
- }
8548
8612
  function Q1(d) {
8549
- for (var t = d.g.toString(), $ = d.j.length, i = 0; i < $; ++i) {
8550
- var o = d.j[i], u = S(o, 1);
8551
- if (new RegExp("^(?:" + u + ")$").test(t) && (d.ha = Z1.test(g(o, 4)), o = t.replace(new RegExp(u, "g"), g(o, 2)), o = h1(d, o), s1(o, p2) == d.ba)) return o;
8613
+ return d.u = !0, d.ea = !1, d.j = [], d.$ = 0, k(d.v), d.da = "", y1(d);
8614
+ }
8615
+ function d2(d) {
8616
+ for (var t = d.g.toString(), $ = d.j.length, n = 0; n < $; ++n) {
8617
+ var o = d.j[n], a = v(o, 1);
8618
+ if (new RegExp("^(?:" + a + ")$").test(t) && (d.ha = Y1.test(g(o, 4)), o = t.replace(new RegExp(a, "g"), g(o, 2)), o = c1(d, o), o1(o, g2) == d.ba)) return o;
8552
8619
  }
8553
8620
  return "";
8554
8621
  }
8555
- function h1(d, t) {
8622
+ function c1(d, t) {
8556
8623
  var $ = d.h.h.length;
8557
8624
  return d.ha && 0 < $ && d.h.toString().charAt($ - 1) != " " ? d.h + " " + t : d.h + t;
8558
8625
  }
8559
- function m1(d) {
8626
+ function y1(d) {
8560
8627
  var t = d.g.toString();
8561
8628
  if (3 <= t.length) {
8562
- for (var $ = d.ca && d.o.length == 0 && 0 < K(d.l, 20) ? P(d.l, 20) : P(d.l, 19), i = $.length, o = 0; o < i; ++o) {
8563
- var u = $[o];
8564
- 0 < d.o.length && O1(S(u, 4)) && !g(u, 6) && !R(u, 5) || (d.o.length != 0 || d.ca || O1(S(u, 4)) || g(u, 6)) && A2.test(S(u, 2)) && d.j.push(u);
8629
+ for (var $ = d.ca && d.o.length == 0 && 0 < K(d.l, 20) ? x(d.l, 20) : x(d.l, 19), n = $.length, o = 0; o < n; ++o) {
8630
+ var a = $[o];
8631
+ 0 < d.o.length && G1(v(a, 4)) && !g(a, 6) && !B(a, 5) || (d.o.length != 0 || d.ca || G1(v(a, 4)) || g(a, 6)) && E2.test(v(a, 2)) && d.j.push(a);
8565
8632
  }
8566
- return q1(d, t), t = Q1(d), 0 < t.length ? t : J1(d) ? d2(d) : d.s.toString();
8633
+ return X1(d, t), t = d2(d), 0 < t.length ? t : q1(d) ? t2(d) : d.s.toString();
8567
8634
  }
8568
- return h1(d, t);
8635
+ return c1(d, t);
8569
8636
  }
8570
- function d2(d) {
8637
+ function t2(d) {
8571
8638
  var t = d.g.toString(), $ = t.length;
8572
8639
  if (0 < $) {
8573
- for (var i = "", o = 0; o < $; o++) i = n2(d, t.charAt(o));
8574
- return d.u ? h1(d, i) : d.s.toString();
8640
+ for (var n = "", o = 0; o < $; o++) n = n2(d, t.charAt(o));
8641
+ return d.u ? c1(d, n) : d.s.toString();
8575
8642
  }
8576
8643
  return d.h.toString();
8577
8644
  }
8578
- function t2(d) {
8645
+ function e2(d) {
8579
8646
  var t = d.g.toString(), $ = 0;
8580
- if (g(d.l, 10) != 1) var i = !1;
8581
- else i = d.g.toString(), i = i.charAt(0) == "1" && i.charAt(1) != "0" && i.charAt(1) != "1";
8582
- return i ? ($ = 1, d.h.g("1").g(" "), d.ca = !0) : R(d.l, 15) && (i = new RegExp("^(?:" + g(d.l, 15) + ")"), i = t.match(i), i != null && i[0] != null && 0 < i[0].length && (d.ca = !0, $ = i[0].length, d.h.g(t.substring(0, $)))), B(d.g), d.g.g(t.substring($)), t.substring(0, $);
8647
+ if (g(d.l, 10) != 1) var n = !1;
8648
+ else n = d.g.toString(), n = n.charAt(0) == "1" && n.charAt(1) != "0" && n.charAt(1) != "1";
8649
+ return n ? ($ = 1, d.h.g("1").g(" "), d.ca = !0) : B(d.l, 15) && (n = new RegExp("^(?:" + g(d.l, 15) + ")"), n = t.match(n), n != null && n[0] != null && 0 < n[0].length && (d.ca = !0, $ = n[0].length, d.h.g(t.substring(0, $)))), k(d.g), d.g.g(t.substring($)), t.substring(0, $);
8583
8650
  }
8584
- function e2(d) {
8651
+ function $2(d) {
8585
8652
  var t = d.ba.toString(), $ = new RegExp("^(?:\\+|" + g(d.l, 11) + ")");
8586
- return $ = t.match($), $ != null && $[0] != null && 0 < $[0].length ? (d.ca = !0, $ = $[0].length, B(d.g), d.g.g(t.substring($)), B(d.h), d.h.g(t.substring(0, $)), t.charAt(0) != "+" && d.h.g(" "), !0) : !1;
8653
+ return $ = t.match($), $ != null && $[0] != null && 0 < $[0].length ? (d.ca = !0, $ = $[0].length, k(d.g), d.g.g(t.substring($)), k(d.h), d.h.g(t.substring(0, $)), t.charAt(0) != "+" && d.h.g(" "), !0) : !1;
8587
8654
  }
8588
- function $2(d) {
8655
+ function i2(d) {
8589
8656
  if (d.g.h.length == 0) return !1;
8590
- var t = new T(), $ = K1(d.g, t);
8591
- return $ == 0 ? !1 : (B(d.g), d.g.g(t.toString()), t = e1($), t == "001" ? d.l = j(d.ga, "" + $) : t != d.ka && (d.l = Y1(d, t)), d.h.g("" + $).g(" "), d.o = "", !0);
8657
+ var t = new A(), $ = H1(d.g, t);
8658
+ return $ == 0 ? !1 : (k(d.g), d.g.g(t.toString()), t = $1($), t == "001" ? d.l = j(d.ga, "" + $) : t != d.ka && (d.l = J1(d, t)), d.h.g("" + $).g(" "), d.o = "", !0);
8592
8659
  }
8593
8660
  function n2(d, t) {
8594
8661
  var $ = d.v.toString();
8595
8662
  if (0 <= $.substring(d.$).search(d.fa)) {
8596
- var i = $.search(d.fa);
8597
- return t = $.replace(d.fa, t), B(d.v), d.v.g(t), d.$ = i, t.substring(0, d.$ + 1);
8663
+ var n = $.search(d.fa);
8664
+ return t = $.replace(d.fa, t), k(d.v), d.v.g(t), d.$ = n, t.substring(0, d.$ + 1);
8598
8665
  }
8599
8666
  return d.j.length == 1 && (d.u = !1), d.da = "", d.s.toString();
8600
8667
  }
8601
- const i2 = (d) => {
8668
+ const s2 = (d) => {
8602
8669
  const t = [];
8603
8670
  return d.includes("FIXED_LINE_OR_MOBILE") ? (d.includes("MOBILE") || t.push("MOBILE"), d.includes("FIXED_LINE") || t.push("FIXED_LINE")) : (d.includes("MOBILE") || d.includes("FIXED_LINE")) && t.push("FIXED_LINE_OR_MOBILE"), d.concat(t);
8604
- }, y1 = { FIXED_LINE: 0, MOBILE: 1, FIXED_LINE_OR_MOBILE: 2, TOLL_FREE: 3, PREMIUM_RATE: 4, SHARED_COST: 5, VOIP: 6, PERSONAL_NUMBER: 7, PAGER: 8, UAN: 9, VOICEMAIL: 10, UNKNOWN: -1 };
8671
+ }, _1 = { FIXED_LINE: 0, MOBILE: 1, FIXED_LINE_OR_MOBILE: 2, TOLL_FREE: 3, PREMIUM_RATE: 4, SHARED_COST: 5, VOIP: 6, PERSONAL_NUMBER: 7, PAGER: 8, UAN: 9, VOICEMAIL: 10, UNKNOWN: -1 };
8605
8672
  e("intlTelInputUtilsTemp", {}), e("intlTelInputUtilsTemp.formatNumberAsYouType", (d, t) => {
8606
8673
  try {
8607
- const $ = d.replace(/[^+0-9]/g, ""), i = new T2(t);
8674
+ const $ = d.replace(/[^+0-9]/g, ""), n = new A2(t);
8608
8675
  t = "";
8609
- for (let o = 0; o < $.length; o++) i.ja = E2(i, $.charAt(o)), t = i.ja;
8676
+ for (let o = 0; o < $.length; o++) n.ja = M2(n, $.charAt(o)), t = n.ja;
8610
8677
  return t;
8611
8678
  } catch {
8612
8679
  return d;
8613
8680
  }
8614
8681
  }), e("intlTelInputUtilsTemp.formatNumber", (d, t, $) => {
8615
8682
  try {
8616
- const o = M.g(), u = Z(o, d, t);
8617
- var i = l1(o, u, -1);
8618
- return i == 0 || i == 4 ? o.format(u, typeof $ > "u" ? 0 : $) : d;
8683
+ const o = M.g(), a = Z(o, d, t);
8684
+ var n = h1(o, a, -1);
8685
+ return n == 0 || n == 4 ? o.format(a, typeof $ > "u" ? 0 : $) : d;
8619
8686
  } catch {
8620
8687
  return d;
8621
8688
  }
8622
- }), e("intlTelInputUtilsTemp.getExampleNumber", (d, t, $, i) => {
8689
+ }), e("intlTelInputUtilsTemp.getExampleNumber", (d, t, $, n) => {
8623
8690
  try {
8624
8691
  const _ = M.g();
8625
8692
  d: {
8626
8693
  var o = _;
8627
- if (o1(d)) {
8628
- var u = u1(j(o, d), $);
8694
+ if (a1(d)) {
8695
+ var a = u1(j(o, d), $);
8629
8696
  try {
8630
- if (R(u, 6)) {
8631
- var a = g(u, 6), h = W1(o, a, d, !1);
8697
+ if (B(a, 6)) {
8698
+ var u = g(a, 6), h = z1(o, u, d, !1);
8632
8699
  break d;
8633
8700
  }
8634
8701
  } catch {
@@ -8636,7 +8703,7 @@ const Z2 = (y) => {
8636
8703
  }
8637
8704
  h = null;
8638
8705
  }
8639
- return _.format(h, i ? 0 : t ? 2 : 1);
8706
+ return _.format(h, n ? 0 : t ? 2 : 1);
8640
8707
  } catch {
8641
8708
  return "";
8642
8709
  }
@@ -8648,39 +8715,39 @@ const Z2 = (y) => {
8648
8715
  }
8649
8716
  }), e("intlTelInputUtilsTemp.getNumberType", (d, t) => {
8650
8717
  try {
8651
- const $ = M.g(), i = Z($, d, t);
8652
- return F1($, i);
8718
+ const $ = M.g(), n = Z($, d, t);
8719
+ return F1($, n);
8653
8720
  } catch {
8654
8721
  return -99;
8655
8722
  }
8656
8723
  }), e("intlTelInputUtilsTemp.getValidationError", (d, t) => {
8657
8724
  if (!t) return 1;
8658
8725
  try {
8659
- const $ = M.g(), i = Z($, d, t);
8660
- return l1($, i, -1);
8726
+ const $ = M.g(), n = Z($, d, t);
8727
+ return h1($, n, -1);
8661
8728
  } catch ($) {
8662
8729
  return $.message === "Invalid country calling code" ? 1 : 3 >= d.length || $.message === "Phone number too short after IDD" || $.message === "The string supplied is too short to be a phone number" ? 2 : $.message === "The string supplied is too long to be a phone number" ? 3 : -99;
8663
8730
  }
8664
8731
  }), e("intlTelInputUtilsTemp.isValidNumber", (d, t, $) => {
8665
8732
  try {
8666
- const i = M.g(), o = Z(i, d, t), u = N2(i, o);
8733
+ const n = M.g(), o = Z(n, d, t), a = T2(n, o);
8667
8734
  if ($) {
8668
- const a = i2($).map((h) => y1[h]);
8669
- return u && a.includes(F1(i, o));
8735
+ const u = s2($).map((h) => _1[h]);
8736
+ return a && u.includes(F1(n, o));
8670
8737
  }
8671
- return u;
8738
+ return a;
8672
8739
  } catch {
8673
8740
  return !1;
8674
8741
  }
8675
8742
  }), e("intlTelInputUtilsTemp.isPossibleNumber", (d, t, $) => {
8676
8743
  try {
8677
- const i = M.g(), o = Z(i, d, t);
8744
+ const n = M.g(), o = Z(n, d, t);
8678
8745
  if ($) {
8679
- const u = i2($);
8680
- for (let a of u) if (l1(i, o, y1[a]) === 0) return !0;
8746
+ const a = s2($);
8747
+ for (let u of a) if (h1(n, o, _1[u]) === 0) return !0;
8681
8748
  return !1;
8682
8749
  }
8683
- return l1(i, o, -1) === 0;
8750
+ return h1(n, o, -1) === 0;
8684
8751
  } catch {
8685
8752
  return !1;
8686
8753
  }
@@ -8690,10 +8757,10 @@ const Z2 = (y) => {
8690
8757
  } catch {
8691
8758
  return "";
8692
8759
  }
8693
- }), e("intlTelInputUtilsTemp.numberFormat", { E164: 0, INTERNATIONAL: 1, NATIONAL: 2, RFC3966: 3 }), e("intlTelInputUtilsTemp.numberType", y1), e("intlTelInputUtilsTemp.validationError", { IS_POSSIBLE: 0, INVALID_COUNTRY_CODE: 1, TOO_SHORT: 2, TOO_LONG: 3, IS_POSSIBLE_LOCAL_ONLY: 4, INVALID_LENGTH: 5 });
8760
+ }), e("intlTelInputUtilsTemp.numberFormat", { E164: 0, INTERNATIONAL: 1, NATIONAL: 2, RFC3966: 3 }), e("intlTelInputUtilsTemp.numberType", _1), e("intlTelInputUtilsTemp.validationError", { IS_POSSIBLE: 0, INVALID_COUNTRY_CODE: 1, TOO_SHORT: 2, TOO_LONG: 3, IS_POSSIBLE_LOCAL_ONLY: 4, INVALID_LENGTH: 5 });
8694
8761
  })();
8695
- const l2 = typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : void 0, Y2 = l2.intlTelInputUtilsTemp;
8696
- delete l2.intlTelInputUtilsTemp;
8762
+ const h2 = typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : void 0, Y2 = h2.intlTelInputUtilsTemp;
8763
+ delete h2.intlTelInputUtilsTemp;
8697
8764
  m.utils = Y2;
8698
8765
  const q2 = {
8699
8766
  __name: "IntlTelInputWithUtils",
@@ -8727,42 +8794,42 @@ const q2 = {
8727
8794
  "changeValidity",
8728
8795
  "changeErrorCode"
8729
8796
  ], ["update:modelValue"]),
8730
- setup(y, { expose: e, emit: n }) {
8731
- const r = M2(y, "modelValue"), s = y, l = n, c = I1(), C = I1(), p = I1(!1), w = () => C.value ? s.options.strictMode ? C.value.isValidNumberPrecise() : C.value.isValidNumber() : null, b = () => {
8732
- let f = w();
8733
- p.value !== f && (p.value = f, l("changeValidity", !!f), l(
8797
+ setup(y, { expose: e, emit: i }) {
8798
+ const s = D2(y, "modelValue"), r = y, l = i, c = v1(), C = v1(), f = v1(!1), S = () => C.value ? r.options.strictMode ? C.value.isValidNumberPrecise() : C.value.isValidNumber() : null, w = () => {
8799
+ let p = S();
8800
+ f.value !== p && (f.value = p, l("changeValidity", !!p), l(
8734
8801
  "changeErrorCode",
8735
- f ? null : C.value.getValidationError()
8802
+ p ? null : C.value.getValidationError()
8736
8803
  ));
8737
- }, v = () => {
8738
- var f;
8739
- l("changeNumber", ((f = C.value) == null ? void 0 : f.getNumber()) ?? ""), b();
8804
+ }, b = () => {
8805
+ var p;
8806
+ l("changeNumber", ((p = C.value) == null ? void 0 : p.getNumber()) ?? ""), w();
8740
8807
  }, L = () => {
8741
- var f;
8742
- l("changeCountry", ((f = C.value) == null ? void 0 : f.getSelectedCountryData().iso2) ?? ""), v(), b();
8808
+ var p;
8809
+ l("changeCountry", ((p = C.value) == null ? void 0 : p.getSelectedCountryData().iso2) ?? ""), b(), w();
8743
8810
  };
8744
- return D2(() => {
8745
- c.value && (C.value = m(c.value, s.options), s.value && C.value.setNumber(s.value), s.disabled && C.value.setDisabled(s.disabled), p.value = w());
8811
+ return x2(() => {
8812
+ c.value && (C.value = m(c.value, r.options), r.value && C.value.setNumber(r.value), r.disabled && C.value.setDisabled(r.disabled), f.value = S());
8746
8813
  }), P2(
8747
- () => s.disabled,
8748
- (f) => {
8814
+ () => r.disabled,
8815
+ (p) => {
8749
8816
  var I;
8750
- return (I = C.value) == null ? void 0 : I.setDisabled(f);
8817
+ return (I = C.value) == null ? void 0 : I.setDisabled(p);
8751
8818
  }
8752
- ), x2(() => {
8753
- var f;
8754
- return (f = C.value) == null ? void 0 : f.destroy();
8755
- }), e({ instance: C, input: c }), (f, I) => R2((k2(), B2("input", O2({
8819
+ ), R2(() => {
8820
+ var p;
8821
+ return (p = C.value) == null ? void 0 : p.destroy();
8822
+ }), e({ instance: C, input: c }), (p, I) => B2((O2(), k2("input", G2({
8756
8823
  ref_key: "input",
8757
8824
  ref: c,
8758
- "onUpdate:modelValue": I[0] || (I[0] = (G) => r.value = G),
8825
+ "onUpdate:modelValue": I[0] || (I[0] = (G) => s.value = G),
8759
8826
  type: "tel",
8760
8827
  onCountrychange: L,
8761
- onInput: v
8828
+ onInput: b
8762
8829
  }, y.inputProps), null, 16)), [
8763
8830
  [
8764
- G2,
8765
- r.value,
8831
+ U2,
8832
+ s.value,
8766
8833
  void 0,
8767
8834
  { lazy: !0 }
8768
8835
  ]