intl-tel-input 25.10.6 → 25.10.8

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.
Files changed (35) hide show
  1. package/README.md +5 -5
  2. package/angular/README.md +1 -1
  3. package/angular/build/IntlTelInput.js +415 -316
  4. package/angular/build/IntlTelInputWithUtils.js +466 -338
  5. package/angular/build/types/intl-tel-input/angular.d.ts +2 -1
  6. package/angular/build/types/intl-tel-input/angularWithUtils.d.ts +2 -1
  7. package/angular/build/types/intl-tel-input/data.d.ts +3 -1
  8. package/angular/build/types/intl-tel-input/i18n/types.d.ts +2 -245
  9. package/angular/build/types/intl-tel-input.d.ts +17 -87
  10. package/angular/build/types/modules/core/options.d.ts +3 -0
  11. package/angular/build/types/modules/data/country-data.d.ts +12 -0
  12. package/angular/build/types/modules/data/nanp-regionless.d.ts +2 -0
  13. package/angular/build/types/modules/format/caret.d.ts +1 -0
  14. package/angular/build/types/modules/format/formatting.d.ts +3 -0
  15. package/angular/build/types/modules/types/public-api.d.ts +79 -0
  16. package/angular/build/types/modules/utils/dom.d.ts +1 -0
  17. package/angular/build/types/modules/utils/string.d.ts +2 -0
  18. package/build/js/data.js +3 -2
  19. package/build/js/data.min.js +2 -2
  20. package/build/js/intlTelInput.d.ts +100 -292
  21. package/build/js/intlTelInput.js +461 -357
  22. package/build/js/intlTelInput.min.js +13 -13
  23. package/build/js/intlTelInputWithUtils.js +512 -379
  24. package/build/js/intlTelInputWithUtils.min.js +13 -13
  25. package/build/js/utils.js +18 -15
  26. package/package.json +1 -1
  27. package/react/README.md +1 -1
  28. package/react/build/IntlTelInput.cjs +460 -356
  29. package/react/build/IntlTelInput.d.ts +104 -294
  30. package/react/build/IntlTelInput.js +460 -356
  31. package/react/build/IntlTelInputWithUtils.cjs +511 -378
  32. package/react/build/IntlTelInputWithUtils.js +511 -378
  33. package/vue/README.md +1 -1
  34. package/vue/build/IntlTelInput.mjs +506 -452
  35. package/vue/build/IntlTelInputWithUtils.mjs +1096 -1013
@@ -1,5 +1,5 @@
1
- import { mergeModels as r2, useModel as D2, ref as v1, onMounted as P2, watch as x2, onUnmounted as R2, withDirectives as B2, createElementBlock as k2, openBlock as O2, mergeProps as G2, vModelText as F2 } from "vue";
2
- const U2 = [
1
+ import { mergeModels as r2, useModel as P2, ref as I1, onMounted as x2, watch as B2, onUnmounted as R2, withDirectives as k2, createElementBlock as O2, openBlock as G2, mergeProps as U2, vModelText as F2 } from "vue";
2
+ const K2 = [
3
3
  [
4
4
  "af",
5
5
  // Afghanistan
@@ -1322,18 +1322,18 @@ const U2 = [
1322
1322
  // Zimbabwe
1323
1323
  "263"
1324
1324
  ]
1325
- ], J = [];
1326
- for (const m of U2)
1327
- J.push({
1325
+ ], Z = [];
1326
+ for (const f of K2)
1327
+ Z.push({
1328
1328
  name: "",
1329
1329
  // populated in the plugin
1330
- iso2: m[0],
1331
- dialCode: m[1],
1332
- priority: m[2] || 0,
1333
- areaCodes: m[3] || null,
1330
+ iso2: f[0],
1331
+ dialCode: f[1],
1332
+ priority: f[2] || 0,
1333
+ areaCodes: f[3] || null,
1334
1334
  nodeById: {},
1335
1335
  // populated by the plugin
1336
- nationalPrefix: m[4] || null
1336
+ nationalPrefix: f[4] || null
1337
1337
  });
1338
1338
  const V2 = {
1339
1339
  ad: "Andorra",
@@ -1578,7 +1578,7 @@ const V2 = {
1578
1578
  za: "South Africa",
1579
1579
  zm: "Zambia",
1580
1580
  zw: "Zimbabwe"
1581
- }, K2 = {
1581
+ }, H2 = {
1582
1582
  selectedCountryAriaLabel: "Change country, selected ${countryName} (${dialCode})",
1583
1583
  noCountrySelected: "Select country",
1584
1584
  countryListAriaLabel: "List of countries",
@@ -1590,17 +1590,13 @@ const V2 = {
1590
1590
  // additional countries (not supported by country-list library)
1591
1591
  ac: "Ascension Island",
1592
1592
  xk: "Kosovo"
1593
- }, u2 = { ...V2, ...K2 };
1594
- for (const m of J)
1595
- m.name = u2[m.iso2];
1596
- let H2 = 0;
1597
- const w1 = (m) => typeof window < "u" && typeof window.matchMedia == "function" && window.matchMedia(m).matches, j2 = () => {
1593
+ }, a2 = { ...V2, ...H2 }, v1 = (f) => typeof window < "u" && typeof window.matchMedia == "function" && window.matchMedia(f).matches, j2 = () => {
1598
1594
  if (typeof navigator < "u" && typeof window < "u") {
1599
- const m = /Android.+Mobile|webOS|iPhone|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent), e = w1("(max-width: 500px)"), i = w1("(max-height: 600px)"), n = w1("(pointer: coarse)");
1600
- return m || e || n && i;
1595
+ const f = /Android.+Mobile|webOS|iPhone|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent), e = v1("(max-width: 500px)"), $ = v1("(max-height: 600px)"), i = v1("(pointer: coarse)");
1596
+ return f || e || i && $;
1601
1597
  }
1602
1598
  return !1;
1603
- }, l2 = {
1599
+ }, u2 = {
1604
1600
  // Allow alphanumeric "phonewords" (e.g. +1 800 FLOWERS) as valid numbers
1605
1601
  allowPhonewords: !1,
1606
1602
  //* Whether or not to allow the dropdown.
@@ -1651,7 +1647,103 @@ const w1 = (m) => typeof window < "u" && typeof window.matchMedia == "function"
1651
1647
  useFullscreenPopup: j2(),
1652
1648
  //* The number type to enforce during validation.
1653
1649
  validationNumberTypes: ["MOBILE"]
1654
- }, W2 = [
1650
+ };
1651
+ function W2(f) {
1652
+ f.useFullscreenPopup && (f.fixDropdownWidth = !1), f.onlyCountries.length === 1 && (f.initialCountry = f.onlyCountries[0]), f.separateDialCode && (f.nationalMode = !1), f.allowDropdown && !f.showFlags && !f.separateDialCode && (f.nationalMode = !1), f.useFullscreenPopup && !f.dropdownContainer && (f.dropdownContainer = document.body), f.i18n = { ...a2, ...f.i18n };
1653
+ }
1654
+ const h1 = (f) => f.replace(/\D/g, ""), l2 = (f = "") => f.normalize("NFD").replace(/[\u0300-\u036f]/g, "").toLowerCase(), L = (f, e, $) => {
1655
+ const i = document.createElement(f);
1656
+ return e && Object.entries(e).forEach(([s, u]) => i.setAttribute(s, u)), $ && $.appendChild(i), i;
1657
+ };
1658
+ function z2(f) {
1659
+ const { onlyCountries: e, excludeCountries: $ } = f;
1660
+ if (e.length) {
1661
+ const i = e.map((s) => s.toLowerCase());
1662
+ return Z.filter((s) => i.includes(s.iso2));
1663
+ } else if ($.length) {
1664
+ const i = $.map((s) => s.toLowerCase());
1665
+ return Z.filter((s) => !i.includes(s.iso2));
1666
+ }
1667
+ return Z;
1668
+ }
1669
+ function Z2(f, e) {
1670
+ for (const $ of f) {
1671
+ const i = $.iso2.toLowerCase();
1672
+ e.i18n[i] && ($.name = e.i18n[i]);
1673
+ }
1674
+ }
1675
+ function Y2(f, e) {
1676
+ const $ = /* @__PURE__ */ new Set();
1677
+ let i = 0;
1678
+ const s = {}, u = (h, c, C) => {
1679
+ if (!h || !c)
1680
+ return;
1681
+ c.length > i && (i = c.length), s.hasOwnProperty(c) || (s[c] = []);
1682
+ const g = s[c];
1683
+ if (g.includes(h))
1684
+ return;
1685
+ const I = C !== void 0 ? C : g.length;
1686
+ g[I] = h;
1687
+ };
1688
+ for (const h of f)
1689
+ $.has(h.dialCode) || $.add(h.dialCode), u(h.iso2, h.dialCode, h.priority);
1690
+ (e.onlyCountries.length || e.excludeCountries.length) && $.forEach((h) => {
1691
+ s[h] = s[h].filter(Boolean);
1692
+ });
1693
+ for (const h of f)
1694
+ if (h.areaCodes) {
1695
+ const c = s[h.dialCode][0];
1696
+ for (const C of h.areaCodes) {
1697
+ for (let g = 1; g < C.length; g++) {
1698
+ const I = C.substring(0, g), S = h.dialCode + I;
1699
+ u(c, S), u(h.iso2, S);
1700
+ }
1701
+ u(h.iso2, h.dialCode + C);
1702
+ }
1703
+ }
1704
+ return { dialCodes: $, dialCodeMaxLen: i, dialCodeToIso2Map: s };
1705
+ }
1706
+ function J2(f, e) {
1707
+ e.countryOrder && (e.countryOrder = e.countryOrder.map(($) => $.toLowerCase())), f.sort(($, i) => {
1708
+ const { countryOrder: s } = e;
1709
+ if (s) {
1710
+ const u = s.indexOf($.iso2), h = s.indexOf(i.iso2), c = u > -1, C = h > -1;
1711
+ if (c || C)
1712
+ return c && C ? u - h : c ? -1 : 1;
1713
+ }
1714
+ return $.name.localeCompare(i.name);
1715
+ });
1716
+ }
1717
+ function q2(f) {
1718
+ for (const e of f)
1719
+ e.normalisedName = l2(e.name), e.initials = e.name.split(/[^a-zA-ZÀ-ÿа-яА-Я]/).map(($) => $[0]).join("").toLowerCase(), e.dialCodePlus = `+${e.dialCode}`;
1720
+ }
1721
+ function X2(f, e, $, i) {
1722
+ let s = f;
1723
+ if ($ && e) {
1724
+ e = `+${i.dialCode}`;
1725
+ const u = s[e.length] === " " || s[e.length] === "-" ? e.length + 1 : e.length;
1726
+ s = s.substring(u);
1727
+ }
1728
+ return s;
1729
+ }
1730
+ function Q2(f, e, $, i, s) {
1731
+ const u = $ ? $.formatNumberAsYouType(f, i.iso2) : f, { dialCode: h } = i;
1732
+ return s && e.charAt(0) !== "+" && u.includes(`+${h}`) ? (u.split(`+${h}`)[1] || "").trim() : u;
1733
+ }
1734
+ function d0(f, e, $, i) {
1735
+ if ($ === 0 && !i)
1736
+ return 0;
1737
+ let s = 0;
1738
+ for (let u = 0; u < e.length; u++) {
1739
+ if (/[+0-9]/.test(e[u]) && s++, s === f && !i)
1740
+ return u + 1;
1741
+ if (i && s === f + 1)
1742
+ return u;
1743
+ }
1744
+ return e.length;
1745
+ }
1746
+ const t0 = [
1655
1747
  "800",
1656
1748
  "822",
1657
1749
  "833",
@@ -1669,165 +1761,96 @@ const w1 = (m) => typeof window < "u" && typeof window.matchMedia == "function"
1669
1761
  "887",
1670
1762
  "888",
1671
1763
  "889"
1672
- ], f1 = (m) => m.replace(/\D/g, ""), o2 = (m = "") => m.normalize("NFD").replace(/[\u0300-\u036f]/g, "").toLowerCase(), a2 = (m) => {
1673
- const e = f1(m);
1764
+ ], o2 = (f) => {
1765
+ const e = h1(f);
1674
1766
  if (e.charAt(0) === "1") {
1675
- const i = e.substring(1, 4);
1676
- return W2.includes(i);
1767
+ const $ = e.substring(1, 4);
1768
+ return t0.includes($);
1677
1769
  }
1678
1770
  return !1;
1679
- }, z2 = (m, e, i, n) => {
1680
- if (i === 0 && !n)
1681
- return 0;
1682
- let o = 0;
1683
- for (let l = 0; l < e.length; l++) {
1684
- if (/[+0-9]/.test(e[l]) && o++, o === m && !n)
1685
- return l + 1;
1686
- if (n && o === m + 1)
1687
- return l;
1688
- }
1689
- return e.length;
1690
- }, N = (m, e, i) => {
1691
- const n = document.createElement(m);
1692
- return e && Object.entries(e).forEach(([o, l]) => n.setAttribute(o, l)), i && i.appendChild(n), n;
1693
- }, $1 = (m, ...e) => {
1694
- const { instances: i } = C;
1695
- Object.values(i).forEach((n) => n[m](...e));
1696
1771
  };
1697
- class p1 {
1772
+ for (const f of Z)
1773
+ f.name = a2[f.iso2];
1774
+ let e0 = 0;
1775
+ const $0 = new Set(Z.map((f) => f.iso2)), w1 = (f) => $0.has(f), e1 = (f, ...e) => {
1776
+ const { instances: $ } = y;
1777
+ Object.values($).forEach((i) => i[f](...e));
1778
+ };
1779
+ class c1 {
1698
1780
  /**
1699
1781
  * Build a space-delimited class string from an object map of className -> truthy/falsey.
1700
1782
  * Only keys with truthy values are included.
1701
1783
  */
1702
1784
  static _buildClassNames(e) {
1703
- return Object.keys(e).filter((i) => !!e[i]).join(" ");
1785
+ return Object.keys(e).filter(($) => !!e[$]).join(" ");
1704
1786
  }
1705
- constructor(e, i = {}) {
1706
- this.id = H2++, this.telInput = e, this.highlightedItem = null, this.options = Object.assign({}, l2, i), this.hadInitialPlaceholder = !!e.getAttribute("placeholder");
1787
+ constructor(e, $ = {}) {
1788
+ this.id = e0++, this.telInput = e, this.highlightedItem = null, this.options = Object.assign({}, u2, $), this.hadInitialPlaceholder = !!e.getAttribute("placeholder");
1707
1789
  }
1708
- //* Can't be private as it's called from intlTelInput convenience wrapper.
1709
- _init() {
1710
- 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";
1790
+ _detectEnvironmentAndLayout() {
1791
+ this.isAndroid = typeof navigator < "u" ? /Android/i.test(navigator.userAgent) : !1, this.isRTL = !!this.telInput.closest("[dir=rtl]"), this.telInput.dir = "ltr";
1711
1792
  const e = this.options.allowDropdown || this.options.separateDialCode;
1712
- 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 };
1713
- const i = new Promise((o, l) => {
1714
- this.resolveAutoCountryPromise = o, this.rejectAutoCountryPromise = l;
1715
- }), n = new Promise((o, l) => {
1716
- this.resolveUtilsScriptPromise = o, this.rejectUtilsScriptPromise = l;
1793
+ this.showSelectedCountryOnLeft = this.isRTL ? !e : e, this.options.separateDialCode && (this.isRTL ? this.originalPaddingRight = this.telInput.style.paddingRight : this.originalPaddingLeft = this.telInput.style.paddingLeft);
1794
+ }
1795
+ _createInitPromises() {
1796
+ const e = new Promise((i, s) => {
1797
+ this.resolveAutoCountryPromise = i, this.rejectAutoCountryPromise = s;
1798
+ }), $ = new Promise((i, s) => {
1799
+ this.resolveUtilsScriptPromise = i, this.rejectUtilsScriptPromise = s;
1717
1800
  });
1718
- this.promise = Promise.all([i, n]), this.selectedCountryData = {}, this._processCountryData(), this._generateMarkup(), this._setInitialState(), this._initListeners(), this._initRequests();
1801
+ this.promise = Promise.all([e, $]);
1802
+ }
1803
+ //* Can't be private as it's called from intlTelInput convenience wrapper.
1804
+ _init() {
1805
+ W2(this.options), this._detectEnvironmentAndLayout(), this._createInitPromises(), this.selectedCountryData = {}, this._processCountryData(), this._generateMarkup(), this._setInitialState(), this._initListeners(), this._initRequests();
1719
1806
  }
1720
1807
  //********************
1721
1808
  //* PRIVATE METHODS
1722
1809
  //********************
1723
1810
  //* Prepare all of the country data, including onlyCountries, excludeCountries, countryOrder options.
1724
1811
  _processCountryData() {
1725
- this._processAllCountries(), this._processDialCodes(), this._translateCountryNames(), this._sortCountries(), this.countryByIso2 = new Map(this.countries.map((e) => [e.iso2, e])), this._cacheSearchTokens();
1726
- }
1727
- //* Precompute and cache country search tokens to speed up filtering
1728
- _cacheSearchTokens() {
1729
- for (const e of this.countries)
1730
- e.normalisedName = o2(e.name), e.initials = e.name.split(/[^a-zA-ZÀ-ÿа-яА-Я]/).map((i) => i[0]).join("").toLowerCase(), e.dialCodePlus = `+${e.dialCode}`;
1731
- }
1732
- //* Sort countries by countryOrder option (if present), then name.
1733
- _sortCountries() {
1734
- this.options.countryOrder && (this.options.countryOrder = this.options.countryOrder.map((e) => e.toLowerCase())), this.countries.sort((e, i) => {
1735
- const { countryOrder: n } = this.options;
1736
- if (n) {
1737
- const o = n.indexOf(e.iso2), l = n.indexOf(i.iso2), f = o > -1, h = l > -1;
1738
- if (f || h)
1739
- return f && h ? o - l : f ? -1 : 1;
1740
- }
1741
- return e.name.localeCompare(i.name);
1742
- });
1743
- }
1744
- //* Add a dial code to this.dialCodeToIso2Map.
1745
- _addToDialCodeMap(e, i, n) {
1746
- if (!e || !i)
1747
- return;
1748
- i.length > this.dialCodeMaxLen && (this.dialCodeMaxLen = i.length), this.dialCodeToIso2Map.hasOwnProperty(i) || (this.dialCodeToIso2Map[i] = []);
1749
- const o = this.dialCodeToIso2Map[i];
1750
- if (o.includes(e))
1751
- return;
1752
- const l = n !== void 0 ? n : o.length;
1753
- o[l] = e;
1754
- }
1755
- //* Process onlyCountries or excludeCountries array if present.
1756
- _processAllCountries() {
1757
- const { onlyCountries: e, excludeCountries: i } = this.options;
1758
- if (e.length) {
1759
- const n = e.map(
1760
- (o) => o.toLowerCase()
1761
- );
1762
- this.countries = J.filter(
1763
- (o) => n.includes(o.iso2)
1764
- );
1765
- } else if (i.length) {
1766
- const n = i.map(
1767
- (o) => o.toLowerCase()
1768
- );
1769
- this.countries = J.filter(
1770
- (o) => !n.includes(o.iso2)
1771
- );
1772
- } else
1773
- this.countries = J;
1774
- }
1775
- //* Translate Countries by object literal provided on config.
1776
- _translateCountryNames() {
1777
- for (const e of this.countries) {
1778
- const i = e.iso2.toLowerCase();
1779
- this.options.i18n.hasOwnProperty(i) && (e.name = this.options.i18n[i]);
1780
- }
1781
- }
1782
- //* Generate this.dialCodes and this.dialCodeToIso2Map.
1783
- _processDialCodes() {
1784
- this.dialCodes = /* @__PURE__ */ new Set(), this.dialCodeMaxLen = 0, this.dialCodeToIso2Map = {};
1785
- for (const e of this.countries)
1786
- this.dialCodes.has(e.dialCode) || this.dialCodes.add(e.dialCode), this._addToDialCodeMap(e.iso2, e.dialCode, e.priority);
1787
- (this.options.onlyCountries.length || this.options.excludeCountries.length) && this.dialCodes.forEach((e) => {
1788
- this.dialCodeToIso2Map[e] = this.dialCodeToIso2Map[e].filter(Boolean);
1789
- });
1790
- for (const e of this.countries)
1791
- if (e.areaCodes) {
1792
- const i = this.dialCodeToIso2Map[e.dialCode][0];
1793
- for (const n of e.areaCodes) {
1794
- for (let o = 1; o < n.length; o++) {
1795
- const l = n.substring(0, o), f = e.dialCode + l;
1796
- this._addToDialCodeMap(i, f), this._addToDialCodeMap(e.iso2, f);
1797
- }
1798
- this._addToDialCodeMap(e.iso2, e.dialCode + n);
1799
- }
1800
- }
1812
+ this.countries = z2(this.options);
1813
+ const e = Y2(this.countries, this.options);
1814
+ this.dialCodes = e.dialCodes, this.dialCodeMaxLen = e.dialCodeMaxLen, this.dialCodeToIso2Map = e.dialCodeToIso2Map, Z2(this.countries, this.options), J2(this.countries, this.options), this.countryByIso2 = new Map(this.countries.map(($) => [$.iso2, $])), q2(this.countries);
1801
1815
  }
1802
1816
  //* Generate all of the markup for the plugin: the selected country overlay, and the dropdown.
1803
1817
  _generateMarkup() {
1804
- var S, M, O;
1818
+ this._prepareTelInput();
1819
+ const e = this._createWrapperAndInsert();
1820
+ this._maybeBuildCountryContainer(e), e.appendChild(this.telInput), this._maybeUpdateInputPaddingAndReveal(), this._maybeBuildHiddenInputs(e);
1821
+ }
1822
+ _prepareTelInput() {
1805
1823
  this.telInput.classList.add("iti__tel-input"), !this.telInput.hasAttribute("autocomplete") && !(this.telInput.form && this.telInput.form.hasAttribute("autocomplete")) && this.telInput.setAttribute("autocomplete", "off");
1824
+ }
1825
+ _createWrapperAndInsert() {
1826
+ var c;
1806
1827
  const {
1807
1828
  allowDropdown: e,
1808
- separateDialCode: i,
1809
- showFlags: n,
1810
- containerClass: o,
1811
- hiddenInput: l,
1812
- dropdownContainer: f,
1813
- fixDropdownWidth: h,
1814
- useFullscreenPopup: _,
1815
- countrySearch: v,
1816
- i18n: w
1817
- } = this.options, g = p1._buildClassNames({
1829
+ showFlags: $,
1830
+ containerClass: i,
1831
+ useFullscreenPopup: s
1832
+ } = this.options, u = c1._buildClassNames({
1818
1833
  iti: !0,
1819
1834
  "iti--allow-dropdown": e,
1820
- "iti--show-flags": n,
1821
- "iti--inline-dropdown": !_,
1822
- [o]: !!o
1823
- }), I = N("div", { class: g });
1824
- if ((S = this.telInput.parentNode) == null || S.insertBefore(I, this.telInput), e || n || i) {
1825
- this.countryContainer = N(
1835
+ "iti--show-flags": $,
1836
+ "iti--inline-dropdown": !s,
1837
+ [i]: !!i
1838
+ }), h = L("div", { class: u });
1839
+ return (c = this.telInput.parentNode) == null || c.insertBefore(h, this.telInput), h;
1840
+ }
1841
+ _maybeBuildCountryContainer(e) {
1842
+ const {
1843
+ allowDropdown: $,
1844
+ separateDialCode: i,
1845
+ showFlags: s
1846
+ } = this.options;
1847
+ if ($ || s || i) {
1848
+ this.countryContainer = L(
1826
1849
  "div",
1827
1850
  // visibly hidden until we measure it's width to set the input padding correctly
1828
1851
  { class: "iti__country-container iti__v-hide" },
1829
- I
1830
- ), this.showSelectedCountryOnLeft ? this.countryContainer.style.left = "0px" : this.countryContainer.style.right = "0px", e ? (this.selectedCountry = N(
1852
+ e
1853
+ ), this.showSelectedCountryOnLeft ? this.countryContainer.style.left = "0px" : this.countryContainer.style.right = "0px", $ ? (this.selectedCountry = L(
1831
1854
  "button",
1832
1855
  {
1833
1856
  type: "button",
@@ -1838,174 +1861,189 @@ class p1 {
1838
1861
  "aria-controls": `iti-${this.id}__dropdown-content`
1839
1862
  },
1840
1863
  this.countryContainer
1841
- ), this.telInput.disabled && this.selectedCountry.setAttribute("disabled", "true")) : this.selectedCountry = N(
1864
+ ), this.telInput.disabled && this.selectedCountry.setAttribute("disabled", "true")) : this.selectedCountry = L(
1842
1865
  "div",
1843
1866
  { class: "iti__selected-country" },
1844
1867
  this.countryContainer
1845
1868
  );
1846
- const G = N(
1869
+ const u = L(
1847
1870
  "div",
1848
1871
  { class: "iti__selected-country-primary" },
1849
1872
  this.selectedCountry
1850
1873
  );
1851
- if (this.selectedCountryInner = N(
1874
+ this.selectedCountryInner = L(
1852
1875
  "div",
1853
1876
  { class: "iti__flag" },
1854
- G
1855
- ), e && (this.dropdownArrow = N(
1877
+ u
1878
+ ), $ && (this.dropdownArrow = L(
1856
1879
  "div",
1857
1880
  { class: "iti__arrow", "aria-hidden": "true" },
1858
- G
1859
- )), i && (this.selectedDialCode = N(
1881
+ u
1882
+ )), i && (this.selectedDialCode = L(
1860
1883
  "div",
1861
1884
  { class: "iti__selected-dial-code", dir: "ltr" },
1862
1885
  this.selectedCountry
1863
- )), e) {
1864
- const F = h ? "" : "iti--flexible-dropdown-width";
1865
- if (this.dropdownContent = N("div", {
1866
- id: `iti-${this.id}__dropdown-content`,
1867
- class: `iti__dropdown-content iti__hide ${F}`,
1868
- role: "dialog",
1869
- "aria-modal": "true"
1870
- }), v) {
1871
- const D = N(
1872
- "div",
1873
- { class: "iti__search-input-wrapper" },
1874
- this.dropdownContent
1875
- );
1876
- this.searchIcon = N(
1877
- "span",
1878
- {
1879
- class: "iti__search-icon",
1880
- "aria-hidden": "true"
1881
- },
1882
- D
1883
- ), this.searchIcon.innerHTML = `
1884
- <svg class="iti__search-icon-svg" width="14" height="14" viewBox="0 0 24 24" focusable="false" aria-hidden="true">
1885
- <circle cx="11" cy="11" r="7" />
1886
- <line x1="21" y1="21" x2="16.65" y2="16.65" />
1887
- </svg>`, this.searchInput = N(
1888
- "input",
1889
- {
1890
- id: `iti-${this.id}__search-input`,
1891
- // Chrome says inputs need either a name or an id
1892
- type: "search",
1893
- class: "iti__search-input",
1894
- placeholder: w.searchPlaceholder,
1895
- // 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
1896
- role: "combobox",
1897
- "aria-expanded": "true",
1898
- "aria-label": w.searchPlaceholder,
1899
- "aria-controls": `iti-${this.id}__country-listbox`,
1900
- "aria-autocomplete": "list",
1901
- autocomplete: "off"
1902
- },
1903
- D
1904
- ), this.searchClearButton = N(
1905
- "button",
1906
- {
1907
- type: "button",
1908
- class: "iti__search-clear iti__hide",
1909
- "aria-label": w.clearSearchAriaLabel,
1910
- tabindex: "-1"
1911
- },
1912
- D
1913
- );
1914
- const i1 = `iti-${this.id}-clear-mask`;
1915
- this.searchClearButton.innerHTML = `
1916
- <svg class="iti__search-clear-svg" width="12" height="12" viewBox="0 0 16 16" aria-hidden="true" focusable="false">
1917
- <mask id="${i1}" maskUnits="userSpaceOnUse">
1918
- <rect width="16" height="16" fill="white" />
1919
- <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" />
1920
- </mask>
1921
- <circle cx="8" cy="8" r="8" class="iti__search-clear-bg" mask="url(#${i1})" />
1922
- </svg>`, this.searchResultsA11yText = N(
1923
- "span",
1924
- { class: "iti__a11y-text" },
1925
- this.dropdownContent
1926
- ), this.searchNoResults = N(
1927
- "div",
1928
- {
1929
- class: "iti__no-results iti__hide",
1930
- "aria-hidden": "true"
1931
- // all a11y messaging happens in this.searchResultsA11yText
1932
- },
1933
- this.dropdownContent
1934
- ), this.searchNoResults.textContent = w.zeroSearchResults;
1935
- }
1936
- if (this.countryList = N(
1937
- "ul",
1938
- {
1939
- class: "iti__country-list",
1940
- id: `iti-${this.id}__country-listbox`,
1941
- role: "listbox",
1942
- "aria-label": w.countryListAriaLabel
1943
- },
1944
- this.dropdownContent
1945
- ), this._appendListItems(), v && this._updateSearchResultsA11yText(), f) {
1946
- const D = p1._buildClassNames({
1947
- iti: !0,
1948
- "iti--container": !0,
1949
- "iti--fullscreen-popup": _,
1950
- "iti--inline-dropdown": !_,
1951
- [o]: !!o
1952
- });
1953
- this.dropdown = N("div", { class: D }), this.dropdown.appendChild(this.dropdownContent);
1954
- } else
1955
- this.countryContainer.appendChild(this.dropdownContent);
1956
- }
1886
+ )), $ && this._buildDropdownContent();
1957
1887
  }
1958
- if (I.appendChild(this.telInput), this.countryContainer && (this._updateInputPadding(), this.countryContainer.classList.remove("iti__v-hide")), l) {
1959
- const G = this.telInput.getAttribute("name") || "", F = l(G);
1960
- if (F.phone) {
1961
- const D = (M = this.telInput.form) == null ? void 0 : M.querySelector(`input[name="${F.phone}"]`);
1962
- D ? this.hiddenInput = D : (this.hiddenInput = N("input", {
1888
+ }
1889
+ _buildDropdownContent() {
1890
+ const {
1891
+ fixDropdownWidth: e,
1892
+ useFullscreenPopup: $,
1893
+ countrySearch: i,
1894
+ i18n: s,
1895
+ dropdownContainer: u,
1896
+ containerClass: h
1897
+ } = this.options, c = e ? "" : "iti--flexible-dropdown-width";
1898
+ if (this.dropdownContent = L("div", {
1899
+ id: `iti-${this.id}__dropdown-content`,
1900
+ class: `iti__dropdown-content iti__hide ${c}`,
1901
+ role: "dialog",
1902
+ "aria-modal": "true"
1903
+ }), i && this._buildSearchUI(), this.countryList = L(
1904
+ "ul",
1905
+ {
1906
+ class: "iti__country-list",
1907
+ id: `iti-${this.id}__country-listbox`,
1908
+ role: "listbox",
1909
+ "aria-label": s.countryListAriaLabel
1910
+ },
1911
+ this.dropdownContent
1912
+ ), this._appendListItems(), i && this._updateSearchResultsA11yText(), u) {
1913
+ const C = c1._buildClassNames({
1914
+ iti: !0,
1915
+ "iti--container": !0,
1916
+ "iti--fullscreen-popup": $,
1917
+ "iti--inline-dropdown": !$,
1918
+ [h]: !!h
1919
+ });
1920
+ this.dropdown = L("div", { class: C }), this.dropdown.appendChild(this.dropdownContent);
1921
+ } else
1922
+ this.countryContainer.appendChild(this.dropdownContent);
1923
+ }
1924
+ _buildSearchUI() {
1925
+ const { i18n: e } = this.options, $ = L(
1926
+ "div",
1927
+ { class: "iti__search-input-wrapper" },
1928
+ this.dropdownContent
1929
+ );
1930
+ this.searchIcon = L(
1931
+ "span",
1932
+ {
1933
+ class: "iti__search-icon",
1934
+ "aria-hidden": "true"
1935
+ },
1936
+ $
1937
+ ), this.searchIcon.innerHTML = `
1938
+ <svg class="iti__search-icon-svg" width="14" height="14" viewBox="0 0 24 24" focusable="false" aria-hidden="true">
1939
+ <circle cx="11" cy="11" r="7" />
1940
+ <line x1="21" y1="21" x2="16.65" y2="16.65" />
1941
+ </svg>`, this.searchInput = L(
1942
+ "input",
1943
+ {
1944
+ id: `iti-${this.id}__search-input`,
1945
+ // Chrome says inputs need either a name or an id
1946
+ type: "search",
1947
+ class: "iti__search-input",
1948
+ placeholder: e.searchPlaceholder,
1949
+ // 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
1950
+ role: "combobox",
1951
+ "aria-expanded": "true",
1952
+ "aria-label": e.searchPlaceholder,
1953
+ "aria-controls": `iti-${this.id}__country-listbox`,
1954
+ "aria-autocomplete": "list",
1955
+ autocomplete: "off"
1956
+ },
1957
+ $
1958
+ ), this.searchClearButton = L(
1959
+ "button",
1960
+ {
1961
+ type: "button",
1962
+ class: "iti__search-clear iti__hide",
1963
+ "aria-label": e.clearSearchAriaLabel,
1964
+ tabindex: "-1"
1965
+ },
1966
+ $
1967
+ );
1968
+ const i = `iti-${this.id}-clear-mask`;
1969
+ this.searchClearButton.innerHTML = `
1970
+ <svg class="iti__search-clear-svg" width="12" height="12" viewBox="0 0 16 16" aria-hidden="true" focusable="false">
1971
+ <mask id="${i}" maskUnits="userSpaceOnUse">
1972
+ <rect width="16" height="16" fill="white" />
1973
+ <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" />
1974
+ </mask>
1975
+ <circle cx="8" cy="8" r="8" class="iti__search-clear-bg" mask="url(#${i})" />
1976
+ </svg>`, this.searchResultsA11yText = L(
1977
+ "span",
1978
+ { class: "iti__a11y-text" },
1979
+ this.dropdownContent
1980
+ ), this.searchNoResults = L(
1981
+ "div",
1982
+ {
1983
+ class: "iti__no-results iti__hide",
1984
+ "aria-hidden": "true"
1985
+ // all a11y messaging happens in this.searchResultsA11yText
1986
+ },
1987
+ this.dropdownContent
1988
+ ), this.searchNoResults.textContent = e.zeroSearchResults;
1989
+ }
1990
+ _maybeUpdateInputPaddingAndReveal() {
1991
+ this.countryContainer && (this._updateInputPadding(), this.countryContainer.classList.remove("iti__v-hide"));
1992
+ }
1993
+ _maybeBuildHiddenInputs(e) {
1994
+ var i, s;
1995
+ const { hiddenInput: $ } = this.options;
1996
+ if ($) {
1997
+ const u = this.telInput.getAttribute("name") || "", h = $(u);
1998
+ if (h.phone) {
1999
+ const c = (i = this.telInput.form) == null ? void 0 : i.querySelector(`input[name="${h.phone}"]`);
2000
+ c ? this.hiddenInput = c : (this.hiddenInput = L("input", {
1963
2001
  type: "hidden",
1964
- name: F.phone
1965
- }), I.appendChild(this.hiddenInput));
2002
+ name: h.phone
2003
+ }), e.appendChild(this.hiddenInput));
1966
2004
  }
1967
- if (F.country) {
1968
- const D = (O = this.telInput.form) == null ? void 0 : O.querySelector(`input[name="${F.country}"]`);
1969
- D ? this.hiddenInputCountry = D : (this.hiddenInputCountry = N("input", {
2005
+ if (h.country) {
2006
+ const c = (s = this.telInput.form) == null ? void 0 : s.querySelector(`input[name="${h.country}"]`);
2007
+ c ? this.hiddenInputCountry = c : (this.hiddenInputCountry = L("input", {
1970
2008
  type: "hidden",
1971
- name: F.country
1972
- }), I.appendChild(this.hiddenInputCountry));
2009
+ name: h.country
2010
+ }), e.appendChild(this.hiddenInputCountry));
1973
2011
  }
1974
2012
  }
1975
2013
  }
1976
2014
  //* For each country: add a country list item <li> to the countryList <ul> container.
1977
2015
  _appendListItems() {
1978
2016
  for (let e = 0; e < this.countries.length; e++) {
1979
- const i = this.countries[e], n = e === 0 ? "iti__highlight" : "", o = N(
2017
+ const $ = this.countries[e], i = e === 0 ? "iti__highlight" : "", s = L(
1980
2018
  "li",
1981
2019
  {
1982
- id: `iti-${this.id}__item-${i.iso2}`,
1983
- class: `iti__country ${n}`,
2020
+ id: `iti-${this.id}__item-${$.iso2}`,
2021
+ class: `iti__country ${i}`,
1984
2022
  tabindex: "-1",
1985
2023
  role: "option",
1986
- "data-dial-code": i.dialCode,
1987
- "data-country-code": i.iso2,
2024
+ "data-dial-code": $.dialCode,
2025
+ "data-country-code": $.iso2,
1988
2026
  "aria-selected": "false"
1989
2027
  },
1990
2028
  this.countryList
1991
2029
  );
1992
- i.nodeById[this.id] = o;
1993
- let l = "";
1994
- 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>`, o.insertAdjacentHTML("beforeend", l);
2030
+ $.nodeById[this.id] = s;
2031
+ let u = "";
2032
+ this.options.showFlags && (u += `<div class='iti__flag iti__${$.iso2}'></div>`), u += `<span class='iti__country-name'>${$.name}</span>`, u += `<span class='iti__dial-code' dir='ltr'>+${$.dialCode}</span>`, s.insertAdjacentHTML("beforeend", u);
1995
2033
  }
1996
2034
  }
1997
2035
  //* Set the initial state of the input value and the selected country by:
1998
2036
  //* 1. Extracting a dial code from the given number
1999
2037
  //* 2. Using explicit initialCountry
2000
2038
  _setInitialState(e = !1) {
2001
- const i = this.telInput.getAttribute("value"), n = this.telInput.value, l = i && i.charAt(0) === "+" && (!n || n.charAt(0) !== "+") ? i : n, f = this._getDialCode(l), h = a2(l), { initialCountry: _, geoIpLookup: v } = this.options, w = _ === "auto" && v;
2002
- if (f && !h)
2003
- this._updateCountryFromNumber(l);
2004
- else if (!w || e) {
2005
- const g = _ ? _.toLowerCase() : "";
2006
- g && this._getCountryData(g, !0) ? this._setCountry(g) : f && h ? this._setCountry("us") : this._setCountry();
2039
+ const $ = this.telInput.getAttribute("value"), i = this.telInput.value, u = $ && $.charAt(0) === "+" && (!i || i.charAt(0) !== "+") ? $ : i, h = this._getDialCode(u), c = o2(u), { initialCountry: C, geoIpLookup: g } = this.options, I = C === "auto" && g;
2040
+ if (h && !c)
2041
+ this._updateCountryFromNumber(u);
2042
+ else if (!I || e) {
2043
+ const S = C ? C.toLowerCase() : "";
2044
+ w1(S) ? this._setCountry(S) : h && c ? this._setCountry("us") : this._setCountry("");
2007
2045
  }
2008
- l && this._updateValFromNumber(l);
2046
+ u && this._updateValFromNumber(u);
2009
2047
  }
2010
2048
  //* Initialise the main event listeners: input keyup, and click selected country.
2011
2049
  _initListeners() {
@@ -2023,14 +2061,14 @@ class p1 {
2023
2061
  }
2024
2062
  //* initialise the dropdown listeners.
2025
2063
  _initDropdownListeners() {
2026
- this._handleLabelClick = (i) => {
2027
- this.dropdownContent.classList.contains("iti__hide") ? this.telInput.focus() : i.preventDefault();
2064
+ this._handleLabelClick = ($) => {
2065
+ this.dropdownContent.classList.contains("iti__hide") ? this.telInput.focus() : $.preventDefault();
2028
2066
  };
2029
2067
  const e = this.telInput.closest("label");
2030
2068
  e && e.addEventListener("click", this._handleLabelClick), this._handleClickSelectedCountry = () => {
2031
2069
  this.dropdownContent.classList.contains("iti__hide") && !this.telInput.disabled && !this.telInput.readOnly && this._openDropdown();
2032
- }, this.selectedCountry.addEventListener("click", this._handleClickSelectedCountry), this._handleCountryContainerKeydown = (i) => {
2033
- this.dropdownContent.classList.contains("iti__hide") && ["ArrowUp", "ArrowDown", " ", "Enter"].includes(i.key) && (i.preventDefault(), i.stopPropagation(), this._openDropdown()), i.key === "Tab" && this._closeDropdown();
2070
+ }, this.selectedCountry.addEventListener("click", this._handleClickSelectedCountry), this._handleCountryContainerKeydown = ($) => {
2071
+ this.dropdownContent.classList.contains("iti__hide") && ["ArrowUp", "ArrowDown", " ", "Enter"].includes($.key) && ($.preventDefault(), $.stopPropagation(), this._openDropdown()), $.key === "Tab" && this._closeDropdown();
2034
2072
  }, this.countryContainer.addEventListener(
2035
2073
  "keydown",
2036
2074
  this._handleCountryContainerKeydown
@@ -2038,22 +2076,22 @@ class p1 {
2038
2076
  }
2039
2077
  //* Init many requests: utils script / geo ip lookup.
2040
2078
  _initRequests() {
2041
- let { loadUtils: e, initialCountry: i, geoIpLookup: n } = this.options;
2042
- e && !C.utils ? (this._handlePageLoad = () => {
2043
- var l;
2044
- window.removeEventListener("load", this._handlePageLoad), (l = C.attachUtils(e)) == null || l.catch(() => {
2079
+ let { loadUtils: e, initialCountry: $, geoIpLookup: i } = this.options;
2080
+ e && !y.utils ? (this._handlePageLoad = () => {
2081
+ var u;
2082
+ window.removeEventListener("load", this._handlePageLoad), (u = y.attachUtils(e)) == null || u.catch(() => {
2045
2083
  });
2046
- }, C.documentReady() ? this._handlePageLoad() : window.addEventListener("load", this._handlePageLoad)) : this.resolveUtilsScriptPromise(), i === "auto" && n && !this.selectedCountryData.iso2 ? this._loadAutoCountry() : this.resolveAutoCountryPromise();
2084
+ }, y.documentReady() ? this._handlePageLoad() : window.addEventListener("load", this._handlePageLoad)) : this.resolveUtilsScriptPromise(), $ === "auto" && i && !this.selectedCountryData.iso2 ? this._loadAutoCountry() : this.resolveAutoCountryPromise();
2047
2085
  }
2048
2086
  //* Perform the geo ip lookup.
2049
2087
  _loadAutoCountry() {
2050
- C.autoCountry ? this.handleAutoCountry() : C.startedLoadingAutoCountry || (C.startedLoadingAutoCountry = !0, typeof this.options.geoIpLookup == "function" && this.options.geoIpLookup(
2088
+ y.autoCountry ? this.handleAutoCountry() : y.startedLoadingAutoCountry || (y.startedLoadingAutoCountry = !0, typeof this.options.geoIpLookup == "function" && this.options.geoIpLookup(
2051
2089
  (e = "") => {
2052
- const i = e.toLowerCase();
2053
- i && this._getCountryData(i, !0) ? (C.autoCountry = i, setTimeout(() => $1("handleAutoCountry"))) : (this._setInitialState(!0), $1("rejectAutoCountryPromise"));
2090
+ const $ = e.toLowerCase();
2091
+ w1($) ? (y.autoCountry = $, setTimeout(() => e1("handleAutoCountry"))) : (this._setInitialState(!0), e1("rejectAutoCountryPromise"));
2054
2092
  },
2055
2093
  () => {
2056
- this._setInitialState(!0), $1("rejectAutoCountryPromise");
2094
+ this._setInitialState(!0), e1("rejectAutoCountryPromise");
2057
2095
  }
2058
2096
  ));
2059
2097
  }
@@ -2062,153 +2100,184 @@ class p1 {
2062
2100
  }
2063
2101
  //* Initialize the tel input listeners.
2064
2102
  _initTelInputListeners() {
2065
- const { strictMode: e, formatAsYouType: i, separateDialCode: n, allowDropdown: o, countrySearch: l } = this.options;
2066
- let f = !1;
2067
- new RegExp("\\p{L}", "u").test(this.telInput.value) && (f = !0), this._handleInputEvent = (h) => {
2068
- if (this.isAndroid && (h == null ? void 0 : h.data) === "+" && n && o && l) {
2069
- const g = this.telInput.selectionStart || 0, I = this.telInput.value.substring(0, g - 1), S = this.telInput.value.substring(g);
2070
- this.telInput.value = I + S, this._openDropdownWithPlus();
2103
+ this._bindInputListener(), this._maybeBindKeydownListener(), this._maybeBindPasteListener();
2104
+ }
2105
+ _bindInputListener() {
2106
+ const { strictMode: e, formatAsYouType: $, separateDialCode: i, allowDropdown: s, countrySearch: u } = this.options;
2107
+ let h = !1;
2108
+ new RegExp("\\p{L}", "u").test(this.telInput.value) && (h = !0), this._handleInputEvent = (c) => {
2109
+ if (this.isAndroid && (c == null ? void 0 : c.data) === "+" && i && s && u) {
2110
+ const S = this.telInput.selectionStart || 0, R = this.telInput.value.substring(0, S - 1), v = this.telInput.value.substring(S);
2111
+ this.telInput.value = R + v, this._openDropdownWithPlus();
2071
2112
  return;
2072
2113
  }
2073
2114
  this._updateCountryFromNumber(this.telInput.value) && this._triggerCountryChange();
2074
- const _ = (h == null ? void 0 : h.data) && /[^+0-9]/.test(h.data), v = (h == null ? void 0 : h.inputType) === "insertFromPaste" && this.telInput.value;
2075
- _ || v && !e ? f = !0 : /[^+0-9]/.test(this.telInput.value) || (f = !1);
2076
- const w = (h == null ? void 0 : h.detail) && h.detail.isSetNumber;
2077
- if (i && !f && !w) {
2078
- const g = this.telInput.selectionStart || 0, S = this.telInput.value.substring(0, g).replace(/[^+0-9]/g, "").length, M = (h == null ? void 0 : h.inputType) === "deleteContentForward", O = this._formatNumberAsYouType(), G = z2(S, O, g, M);
2079
- this.telInput.value = O, this.telInput.setSelectionRange(G, G);
2115
+ const C = (c == null ? void 0 : c.data) && /[^+0-9]/.test(c.data), g = (c == null ? void 0 : c.inputType) === "insertFromPaste" && this.telInput.value;
2116
+ C || g && !e ? h = !0 : /[^+0-9]/.test(this.telInput.value) || (h = !1);
2117
+ const I = (c == null ? void 0 : c.detail) && c.detail.isSetNumber;
2118
+ if ($ && !h && !I) {
2119
+ const S = this.telInput.selectionStart || 0, v = this.telInput.value.substring(0, S).replace(/[^+0-9]/g, "").length, D = (c == null ? void 0 : c.inputType) === "deleteContentForward", A = this._getFullNumber(), k = Q2(
2120
+ A,
2121
+ this.telInput.value,
2122
+ y.utils,
2123
+ this.selectedCountryData,
2124
+ this.options.separateDialCode
2125
+ ), H = d0(v, k, S, D);
2126
+ this.telInput.value = k, this.telInput.setSelectionRange(H, H);
2080
2127
  }
2081
- }, this.telInput.addEventListener("input", this._handleInputEvent), (e || n) && (this._handleKeydownEvent = (h) => {
2082
- if (h.key && h.key.length === 1 && !h.altKey && !h.ctrlKey && !h.metaKey) {
2083
- if (n && o && l && h.key === "+") {
2084
- h.preventDefault(), this._openDropdownWithPlus();
2128
+ }, this.telInput.addEventListener("input", this._handleInputEvent);
2129
+ }
2130
+ _maybeBindKeydownListener() {
2131
+ const { strictMode: e, separateDialCode: $, allowDropdown: i, countrySearch: s } = this.options;
2132
+ (e || $) && (this._handleKeydownEvent = (u) => {
2133
+ if (u.key && u.key.length === 1 && !u.altKey && !u.ctrlKey && !u.metaKey) {
2134
+ if ($ && i && s && u.key === "+") {
2135
+ u.preventDefault(), this._openDropdownWithPlus();
2085
2136
  return;
2086
2137
  }
2087
2138
  if (e) {
2088
- const _ = this.telInput.value, w = !(_.charAt(0) === "+") && this.telInput.selectionStart === 0 && h.key === "+", g = /^[0-9]$/.test(h.key), I = n ? g : w || g, S = _.slice(0, this.telInput.selectionStart) + h.key + _.slice(this.telInput.selectionEnd), M = this._getFullNumber(S), O = C.utils.getCoreNumber(M, this.selectedCountryData.iso2), G = this.maxCoreNumberLength && O.length > this.maxCoreNumberLength, D = this._getNewCountryFromNumber(M) !== null;
2089
- (!I || G && !D && !w) && h.preventDefault();
2139
+ const h = this.telInput.value, C = !(h.charAt(0) === "+") && this.telInput.selectionStart === 0 && u.key === "+", g = /^[0-9]$/.test(u.key), I = $ ? g : C || g, S = h.slice(0, this.telInput.selectionStart) + u.key + h.slice(this.telInput.selectionEnd), R = this._getFullNumber(S), v = y.utils.getCoreNumber(R, this.selectedCountryData.iso2), D = this.maxCoreNumberLength && v.length > this.maxCoreNumberLength, k = this._getNewCountryFromNumber(R) !== null;
2140
+ (!I || D && !k && !C) && u.preventDefault();
2090
2141
  }
2091
2142
  }
2092
2143
  }, this.telInput.addEventListener("keydown", this._handleKeydownEvent));
2093
2144
  }
2145
+ _maybeBindPasteListener() {
2146
+ this.options.strictMode && (this._handlePasteEvent = (e) => {
2147
+ e.preventDefault();
2148
+ const $ = this.telInput, i = $.selectionStart, s = $.selectionEnd, u = $.value.slice(0, i), h = $.value.slice(s), c = this.selectedCountryData.iso2, C = e.clipboardData.getData("text"), g = i === 0 && s > 0, I = !$.value.startsWith("+") || g, S = C.replace(/[^0-9+]/g, ""), R = S.startsWith("+"), v = S.replace(/\+/g, ""), D = R && I ? `+${v}` : v;
2149
+ let A = u + D + h, k = y.utils.getCoreNumber(A, c);
2150
+ for (; k.length === 0 && A.length > 0; )
2151
+ A = A.slice(0, -1), k = y.utils.getCoreNumber(A, c);
2152
+ if (!k)
2153
+ return;
2154
+ if (this.maxCoreNumberLength && k.length > this.maxCoreNumberLength)
2155
+ if ($.selectionEnd === $.value.length) {
2156
+ const f1 = k.length - this.maxCoreNumberLength;
2157
+ A = A.slice(0, A.length - f1);
2158
+ } else
2159
+ return;
2160
+ $.value = A;
2161
+ const H = i + D.length;
2162
+ $.setSelectionRange(H, H), $.dispatchEvent(new InputEvent("input", { bubbles: !0 }));
2163
+ }, this.telInput.addEventListener("paste", this._handlePasteEvent));
2164
+ }
2094
2165
  //* Adhere to the input's maxlength attr.
2095
2166
  _cap(e) {
2096
- const i = parseInt(this.telInput.getAttribute("maxlength") || "", 10);
2097
- return i && e.length > i ? e.substring(0, i) : e;
2167
+ const $ = parseInt(this.telInput.getAttribute("maxlength") || "", 10);
2168
+ return $ && e.length > $ ? e.substring(0, $) : e;
2098
2169
  }
2099
2170
  //* Trigger a custom event on the input.
2100
- _trigger(e, i = {}) {
2101
- const n = new CustomEvent(e, {
2171
+ _trigger(e, $ = {}) {
2172
+ const i = new CustomEvent(e, {
2102
2173
  bubbles: !0,
2103
2174
  cancelable: !0,
2104
- detail: i
2175
+ detail: $
2105
2176
  });
2106
- this.telInput.dispatchEvent(n);
2177
+ this.telInput.dispatchEvent(i);
2107
2178
  }
2108
2179
  //* Open the dropdown.
2109
2180
  _openDropdown() {
2110
- const { fixDropdownWidth: e, countrySearch: i } = this.options;
2111
- 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) {
2112
- const n = this.countryList.firstElementChild;
2113
- n && (this._highlightListItem(n, !1), this.countryList.scrollTop = 0), this.searchInput.focus();
2181
+ const { fixDropdownWidth: e, countrySearch: $ } = this.options;
2182
+ if (e && (this.dropdownContent.style.width = `${this.telInput.offsetWidth}px`), this.dropdownContent.classList.remove("iti__hide"), this.selectedCountry.setAttribute("aria-expanded", "true"), this._setDropdownPosition(), $) {
2183
+ const i = this.countryList.firstElementChild;
2184
+ i && (this._highlightListItem(i, !1), this.countryList.scrollTop = 0), this.searchInput.focus();
2114
2185
  }
2115
2186
  this._bindDropdownListeners(), this.dropdownArrow.classList.add("iti__arrow--up"), this._trigger("open:countrydropdown");
2116
2187
  }
2117
2188
  //* Set the dropdown position
2118
2189
  _setDropdownPosition() {
2119
2190
  if (this.options.dropdownContainer && this.options.dropdownContainer.appendChild(this.dropdown), !this.options.useFullscreenPopup) {
2120
- const e = this.telInput.getBoundingClientRect(), i = this.telInput.offsetHeight;
2121
- 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));
2191
+ const e = this.telInput.getBoundingClientRect(), $ = this.telInput.offsetHeight;
2192
+ this.options.dropdownContainer && (this.dropdown.style.top = `${e.top + $}px`, this.dropdown.style.left = `${e.left}px`, this._handleWindowScroll = () => this._closeDropdown(), window.addEventListener("scroll", this._handleWindowScroll));
2122
2193
  }
2123
2194
  }
2124
2195
  //* We only bind dropdown listeners when the dropdown is open.
2125
2196
  _bindDropdownListeners() {
2126
- this._handleMouseoverCountryList = (n) => {
2127
- var l;
2128
- const o = (l = n.target) == null ? void 0 : l.closest(".iti__country");
2129
- o && this._highlightListItem(o, !1);
2197
+ this._handleMouseoverCountryList = (i) => {
2198
+ var u;
2199
+ const s = (u = i.target) == null ? void 0 : u.closest(".iti__country");
2200
+ s && this._highlightListItem(s, !1);
2130
2201
  }, this.countryList.addEventListener(
2131
2202
  "mouseover",
2132
2203
  this._handleMouseoverCountryList
2133
- ), this._handleClickCountryList = (n) => {
2134
- var l;
2135
- const o = (l = n.target) == null ? void 0 : l.closest(".iti__country");
2136
- o && this._selectListItem(o);
2137
- }, this.countryList.addEventListener("click", this._handleClickCountryList), this._handleClickOffToClose = (n) => {
2138
- !!n.target.closest(`#iti-${this.id}__dropdown-content`) || this._closeDropdown();
2204
+ ), this._handleClickCountryList = (i) => {
2205
+ var u;
2206
+ const s = (u = i.target) == null ? void 0 : u.closest(".iti__country");
2207
+ s && this._selectListItem(s);
2208
+ }, this.countryList.addEventListener("click", this._handleClickCountryList), this._handleClickOffToClose = (i) => {
2209
+ !!i.target.closest(`#iti-${this.id}__dropdown-content`) || this._closeDropdown();
2139
2210
  }, setTimeout(() => {
2140
2211
  document.documentElement.addEventListener(
2141
2212
  "click",
2142
2213
  this._handleClickOffToClose
2143
2214
  );
2144
2215
  }, 0);
2145
- let e = "", i = null;
2146
- if (this._handleKeydownOnDropdown = (n) => {
2147
- ["ArrowUp", "ArrowDown", "Enter", "Escape"].includes(n.key) && (n.preventDefault(), n.stopPropagation(), n.key === "ArrowUp" || n.key === "ArrowDown" ? this._handleUpDownKey(n.key) : n.key === "Enter" ? this._handleEnterKey() : n.key === "Escape" && this._closeDropdown()), !this.options.countrySearch && /^[a-zA-ZÀ-ÿа-яА-Я ]$/.test(n.key) && (n.stopPropagation(), i && clearTimeout(i), e += n.key.toLowerCase(), this._searchForCountry(e), i = setTimeout(() => {
2216
+ let e = "", $ = null;
2217
+ if (this._handleKeydownOnDropdown = (i) => {
2218
+ ["ArrowUp", "ArrowDown", "Enter", "Escape"].includes(i.key) && (i.preventDefault(), i.stopPropagation(), i.key === "ArrowUp" || i.key === "ArrowDown" ? this._handleUpDownKey(i.key) : i.key === "Enter" ? this._handleEnterKey() : i.key === "Escape" && this._closeDropdown()), !this.options.countrySearch && /^[a-zA-ZÀ-ÿа-яА-Я ]$/.test(i.key) && (i.stopPropagation(), $ && clearTimeout($), e += i.key.toLowerCase(), this._searchForCountry(e), $ = setTimeout(() => {
2148
2219
  e = "";
2149
2220
  }, 1e3));
2150
2221
  }, document.addEventListener("keydown", this._handleKeydownOnDropdown), this.options.countrySearch) {
2151
- const n = () => {
2152
- const l = this.searchInput.value.trim();
2153
- this._filterCountries(l), this.searchInput.value ? this.searchClearButton.classList.remove("iti__hide") : this.searchClearButton.classList.add("iti__hide");
2222
+ const i = () => {
2223
+ const u = this.searchInput.value.trim();
2224
+ this._filterCountries(u), this.searchInput.value ? this.searchClearButton.classList.remove("iti__hide") : this.searchClearButton.classList.add("iti__hide");
2154
2225
  };
2155
- let o = null;
2226
+ let s = null;
2156
2227
  this._handleSearchChange = () => {
2157
- o && clearTimeout(o), o = setTimeout(() => {
2158
- n(), o = null;
2228
+ s && clearTimeout(s), s = setTimeout(() => {
2229
+ i(), s = null;
2159
2230
  }, 100);
2160
2231
  }, this.searchInput.addEventListener("input", this._handleSearchChange), this._handleSearchClear = () => {
2161
- this.searchInput.value = "", this.searchInput.focus(), n();
2232
+ this.searchInput.value = "", this.searchInput.focus(), i();
2162
2233
  }, this.searchClearButton.addEventListener("click", this._handleSearchClear);
2163
2234
  }
2164
2235
  }
2165
2236
  //* Hidden search (countrySearch disabled): Find the first list item whose name starts with the query string.
2166
2237
  _searchForCountry(e) {
2167
- for (const i of this.countries)
2168
- if (i.name.substring(0, e.length).toLowerCase() === e) {
2169
- const o = i.nodeById[this.id];
2170
- this._highlightListItem(o, !1), this._scrollTo(o);
2238
+ for (const $ of this.countries)
2239
+ if ($.name.substring(0, e.length).toLowerCase() === e) {
2240
+ const s = $.nodeById[this.id];
2241
+ this._highlightListItem(s, !1), this._scrollTo(s);
2171
2242
  break;
2172
2243
  }
2173
2244
  }
2174
2245
  //* Country search enabled: Filter the countries according to the search query.
2175
2246
  _filterCountries(e) {
2176
- let i = !0;
2177
2247
  this.countryList.innerHTML = "";
2178
- const n = o2(e);
2179
- let o;
2180
- if (e === "")
2181
- o = this.countries;
2182
- else {
2183
- const l = [], f = [], h = [], _ = [], v = [], w = [];
2184
- for (const g of this.countries)
2185
- g.iso2 === n ? l.push(g) : g.normalisedName.startsWith(n) ? f.push(g) : g.normalisedName.includes(n) ? h.push(g) : n === g.dialCode || n === g.dialCodePlus ? _.push(g) : g.dialCodePlus.includes(n) ? v.push(g) : g.initials.includes(n) && w.push(g);
2186
- o = [
2187
- ...l.sort((g, I) => g.priority - I.priority),
2188
- ...f.sort((g, I) => g.priority - I.priority),
2189
- ...h.sort((g, I) => g.priority - I.priority),
2190
- ..._.sort((g, I) => g.priority - I.priority),
2191
- ...v.sort((g, I) => g.priority - I.priority),
2192
- ...w.sort((g, I) => g.priority - I.priority)
2193
- ];
2194
- }
2195
- for (const l of o) {
2196
- const f = l.nodeById[this.id];
2197
- f && (this.countryList.appendChild(f), i && (this._highlightListItem(f, !1), i = !1));
2248
+ let $;
2249
+ e === "" ? $ = this.countries : $ = this._getMatchedCountries(e);
2250
+ let i = !0;
2251
+ for (const s of $) {
2252
+ const u = s.nodeById[this.id];
2253
+ u && (this.countryList.appendChild(u), i && (this._highlightListItem(u, !1), i = !1));
2198
2254
  }
2199
2255
  i ? (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();
2200
2256
  }
2257
+ _getMatchedCountries(e) {
2258
+ const $ = l2(e), i = [], s = [], u = [], h = [], c = [], C = [];
2259
+ for (const g of this.countries)
2260
+ g.iso2 === $ ? i.push(g) : g.normalisedName.startsWith($) ? s.push(g) : g.normalisedName.includes($) ? u.push(g) : $ === g.dialCode || $ === g.dialCodePlus ? h.push(g) : g.dialCodePlus.includes($) ? c.push(g) : g.initials.includes($) && C.push(g);
2261
+ return [
2262
+ ...i.sort((g, I) => g.priority - I.priority),
2263
+ ...s.sort((g, I) => g.priority - I.priority),
2264
+ ...u.sort((g, I) => g.priority - I.priority),
2265
+ ...h.sort((g, I) => g.priority - I.priority),
2266
+ ...c.sort((g, I) => g.priority - I.priority),
2267
+ ...C.sort((g, I) => g.priority - I.priority)
2268
+ ];
2269
+ }
2201
2270
  //* Update search results text (for a11y).
2202
2271
  _updateSearchResultsA11yText() {
2203
- const { i18n: e } = this.options, i = this.countryList.childElementCount;
2204
- let n;
2205
- i === 0 ? n = e.zeroSearchResults : e.searchResultsText ? n = e.searchResultsText(i) : i === 1 ? n = e.oneSearchResult : n = e.multipleSearchResults.replace("${count}", i.toString()), this.searchResultsA11yText.textContent = n;
2272
+ const { i18n: e } = this.options, $ = this.countryList.childElementCount;
2273
+ let i;
2274
+ $ === 0 ? i = e.zeroSearchResults : e.searchResultsText ? i = e.searchResultsText($) : $ === 1 ? i = e.oneSearchResult : i = e.multipleSearchResults.replace("${count}", $.toString()), this.searchResultsA11yText.textContent = i;
2206
2275
  }
2207
2276
  //* Highlight the next/prev item in the list (and ensure it is visible).
2208
2277
  _handleUpDownKey(e) {
2209
- var n, o;
2210
- let i = e === "ArrowUp" ? (n = this.highlightedItem) == null ? void 0 : n.previousElementSibling : (o = this.highlightedItem) == null ? void 0 : o.nextElementSibling;
2211
- !i && this.countryList.childElementCount > 1 && (i = e === "ArrowUp" ? this.countryList.lastElementChild : this.countryList.firstElementChild), i && (this._scrollTo(i), this._highlightListItem(i, !1));
2278
+ var i, s;
2279
+ let $ = e === "ArrowUp" ? (i = this.highlightedItem) == null ? void 0 : i.previousElementSibling : (s = this.highlightedItem) == null ? void 0 : s.nextElementSibling;
2280
+ !$ && this.countryList.childElementCount > 1 && ($ = e === "ArrowUp" ? this.countryList.lastElementChild : this.countryList.firstElementChild), $ && (this._scrollTo($), this._highlightListItem($, !1));
2212
2281
  }
2213
2282
  //* Select the currently highlighted item.
2214
2283
  _handleEnterKey() {
@@ -2217,120 +2286,110 @@ class p1 {
2217
2286
  //* Update the input's value to the given val (format first if possible)
2218
2287
  //* NOTE: this is called from _setInitialState, handleUtils and setNumber.
2219
2288
  _updateValFromNumber(e) {
2220
- let i = e;
2221
- if (this.options.formatOnDisplay && C.utils && this.selectedCountryData) {
2222
- const n = this.options.nationalMode || i.charAt(0) !== "+" && !this.options.separateDialCode, { NATIONAL: o, INTERNATIONAL: l } = C.utils.numberFormat, f = n ? o : l;
2223
- i = C.utils.formatNumber(
2224
- i,
2289
+ let $ = e;
2290
+ if (this.options.formatOnDisplay && y.utils && this.selectedCountryData) {
2291
+ const i = this.options.nationalMode || $.charAt(0) !== "+" && !this.options.separateDialCode, { NATIONAL: s, INTERNATIONAL: u } = y.utils.numberFormat, h = i ? s : u;
2292
+ $ = y.utils.formatNumber(
2293
+ $,
2225
2294
  this.selectedCountryData.iso2,
2226
- f
2295
+ h
2227
2296
  );
2228
2297
  }
2229
- i = this._beforeSetNumber(i), this.telInput.value = i;
2298
+ $ = this._beforeSetNumber($), this.telInput.value = $;
2230
2299
  }
2231
2300
  //* Check if need to select a new country based on the given number
2232
2301
  //* Note: called from _setInitialState, keyup handler, setNumber.
2233
2302
  _updateCountryFromNumber(e) {
2234
- const i = this._getNewCountryFromNumber(e);
2235
- return i !== null ? this._setCountry(i) : !1;
2303
+ const $ = this._getNewCountryFromNumber(e);
2304
+ return $ !== null ? this._setCountry($) : !1;
2236
2305
  }
2237
2306
  _ensureHasDialCode(e) {
2238
- const { dialCode: i, nationalPrefix: n } = this.selectedCountryData;
2239
- if (e.charAt(0) === "+" || !i)
2307
+ const { dialCode: $, nationalPrefix: i } = this.selectedCountryData;
2308
+ if (e.charAt(0) === "+" || !$)
2240
2309
  return e;
2241
- const f = n && e.charAt(0) === n && !this.options.separateDialCode ? e.substring(1) : e;
2242
- return `+${i}${f}`;
2310
+ const h = i && e.charAt(0) === i && !this.options.separateDialCode ? e.substring(1) : e;
2311
+ return `+${$}${h}`;
2243
2312
  }
2244
2313
  // Get the country ISO2 code from the given number
2245
2314
  // BUT ONLY IF ITS CHANGED FROM THE CURRENTLY SELECTED COUNTRY
2246
2315
  // NOTE: consider refactoring this to be more clear
2247
2316
  _getNewCountryFromNumber(e) {
2248
- const i = e.indexOf("+");
2249
- let n = i ? e.substring(i) : e;
2250
- const o = this.selectedCountryData.iso2, l = this.selectedCountryData.dialCode;
2251
- n = this._ensureHasDialCode(n);
2252
- const f = this._getDialCode(n, !0), h = f1(n);
2253
- if (f) {
2254
- const _ = f1(f), v = this.dialCodeToIso2Map[_];
2255
- if (v.length === 1)
2256
- return v[0] === o ? null : v[0];
2257
- if (!o && this.defaultCountry && v.includes(this.defaultCountry))
2317
+ const $ = e.indexOf("+");
2318
+ let i = $ ? e.substring($) : e;
2319
+ const s = this.selectedCountryData.iso2, u = this.selectedCountryData.dialCode;
2320
+ i = this._ensureHasDialCode(i);
2321
+ const h = this._getDialCode(i, !0), c = h1(i);
2322
+ if (h) {
2323
+ const C = h1(h), g = this.dialCodeToIso2Map[C];
2324
+ if (g.length === 1)
2325
+ return g[0] === s ? null : g[0];
2326
+ if (!s && this.defaultCountry && g.includes(this.defaultCountry))
2258
2327
  return this.defaultCountry;
2259
- if (l === "1" && a2(h))
2328
+ if (u === "1" && o2(c))
2260
2329
  return null;
2261
- const g = this.selectedCountryData.areaCodes && h.length > _.length;
2262
- if (!(o && v.includes(o) && !g))
2263
- return v[0];
2330
+ const S = this.selectedCountryData.areaCodes && c.length > C.length;
2331
+ if (!(s && g.includes(s) && !S))
2332
+ return g[0];
2264
2333
  } else {
2265
- if (n.charAt(0) === "+" && h.length)
2334
+ if (i.charAt(0) === "+" && c.length)
2266
2335
  return "";
2267
- if ((!n || n === "+") && !o)
2336
+ if ((!i || i === "+") && !s)
2268
2337
  return this.defaultCountry;
2269
2338
  }
2270
2339
  return null;
2271
2340
  }
2272
2341
  //* Remove highlighting from other list items and highlight the given item.
2273
- _highlightListItem(e, i) {
2274
- const n = this.highlightedItem;
2275
- if (n && (n.classList.remove("iti__highlight"), n.setAttribute("aria-selected", "false")), this.highlightedItem = e, this.highlightedItem && (this.highlightedItem.classList.add("iti__highlight"), this.highlightedItem.setAttribute("aria-selected", "true"), this.options.countrySearch)) {
2276
- const o = this.highlightedItem.getAttribute("id") || "";
2277
- this.searchInput.setAttribute("aria-activedescendant", o);
2342
+ _highlightListItem(e, $) {
2343
+ const i = this.highlightedItem;
2344
+ if (i && (i.classList.remove("iti__highlight"), i.setAttribute("aria-selected", "false")), this.highlightedItem = e, this.highlightedItem && (this.highlightedItem.classList.add("iti__highlight"), this.highlightedItem.setAttribute("aria-selected", "true"), this.options.countrySearch)) {
2345
+ const s = this.highlightedItem.getAttribute("id") || "";
2346
+ this.searchInput.setAttribute("aria-activedescendant", s);
2278
2347
  }
2279
- i && this.highlightedItem.focus();
2280
- }
2281
- //* Find the country data for the given iso2 code
2282
- //* 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
2283
- _getCountryData(e, i) {
2284
- const n = this.countryByIso2.get(e);
2285
- if (n)
2286
- return n;
2287
- if (i)
2288
- return null;
2289
- throw new Error(`No country data for '${e}'`);
2348
+ $ && this.highlightedItem.focus();
2290
2349
  }
2291
2350
  //* Update the selected country, dial code (if separateDialCode), placeholder, title, and active list item.
2292
2351
  //* Note: called from _setInitialState, _updateCountryFromNumber, _selectListItem, setCountry.
2293
2352
  _setCountry(e) {
2294
- const { separateDialCode: i, showFlags: n, i18n: o } = this.options, l = this.selectedCountryData.iso2 || "";
2295
- if (this.selectedCountryData = e ? this._getCountryData(e, !1) || {} : {}, this.selectedCountryData.iso2 && (this.defaultCountry = this.selectedCountryData.iso2), this.selectedCountry) {
2296
- const f = e && n ? `iti__flag iti__${e}` : "iti__flag iti__globe";
2297
- let h, _;
2353
+ const { separateDialCode: $, showFlags: i, i18n: s } = this.options, u = this.selectedCountryData.iso2 || "";
2354
+ if (this.selectedCountryData = e ? this.countryByIso2.get(e) : {}, this.selectedCountryData.iso2 && (this.defaultCountry = this.selectedCountryData.iso2), this.selectedCountry) {
2355
+ const h = e && i ? `iti__flag iti__${e}` : "iti__flag iti__globe";
2356
+ let c, C;
2298
2357
  if (e) {
2299
- const { name: v, dialCode: w } = this.selectedCountryData;
2300
- _ = v, h = o.selectedCountryAriaLabel.replace("${countryName}", v).replace("${dialCode}", `+${w}`);
2358
+ const { name: g, dialCode: I } = this.selectedCountryData;
2359
+ C = g, c = s.selectedCountryAriaLabel.replace("${countryName}", g).replace("${dialCode}", `+${I}`);
2301
2360
  } else
2302
- _ = o.noCountrySelected, h = o.noCountrySelected;
2303
- this.selectedCountryInner.className = f, this.selectedCountry.setAttribute("title", _), this.selectedCountry.setAttribute("aria-label", h);
2361
+ C = s.noCountrySelected, c = s.noCountrySelected;
2362
+ this.selectedCountryInner.className = h, this.selectedCountry.setAttribute("title", C), this.selectedCountry.setAttribute("aria-label", c);
2304
2363
  }
2305
- if (i) {
2306
- const f = this.selectedCountryData.dialCode ? `+${this.selectedCountryData.dialCode}` : "";
2307
- this.selectedDialCode.innerHTML = f, this._updateInputPadding();
2364
+ if ($) {
2365
+ const h = this.selectedCountryData.dialCode ? `+${this.selectedCountryData.dialCode}` : "";
2366
+ this.selectedDialCode.innerHTML = h, this._updateInputPadding();
2308
2367
  }
2309
- return this._updatePlaceholder(), this._updateMaxLength(), l !== e;
2368
+ return this._updatePlaceholder(), this._updateMaxLength(), u !== e;
2310
2369
  }
2311
2370
  //* Update the input padding to make space for the selected country/dial code.
2312
2371
  _updateInputPadding() {
2313
2372
  if (this.selectedCountry) {
2314
- const e = this.options.separateDialCode ? 78 : 42, n = (this.selectedCountry.offsetWidth || this._getHiddenSelectedCountryWidth() || e) + 6;
2315
- this.showSelectedCountryOnLeft ? this.telInput.style.paddingLeft = `${n}px` : this.telInput.style.paddingRight = `${n}px`;
2373
+ const e = this.options.separateDialCode ? 78 : 42, i = (this.selectedCountry.offsetWidth || this._getHiddenSelectedCountryWidth() || e) + 6;
2374
+ this.showSelectedCountryOnLeft ? this.telInput.style.paddingLeft = `${i}px` : this.telInput.style.paddingRight = `${i}px`;
2316
2375
  }
2317
2376
  }
2318
2377
  //* Update the maximum valid number length for the currently selected country.
2319
2378
  _updateMaxLength() {
2320
- const { strictMode: e, placeholderNumberType: i, validationNumberTypes: n } = this.options, { iso2: o } = this.selectedCountryData;
2321
- if (e && C.utils)
2322
- if (o) {
2323
- const l = C.utils.numberType[i];
2324
- let f = C.utils.getExampleNumber(
2325
- o,
2379
+ const { strictMode: e, placeholderNumberType: $, validationNumberTypes: i } = this.options, { iso2: s } = this.selectedCountryData;
2380
+ if (e && y.utils)
2381
+ if (s) {
2382
+ const u = y.utils.numberType[$];
2383
+ let h = y.utils.getExampleNumber(
2384
+ s,
2326
2385
  !1,
2327
- l,
2386
+ u,
2328
2387
  !0
2329
- ), h = f;
2330
- for (; C.utils.isPossibleNumber(f, o, n); )
2331
- h = f, f += "0";
2332
- const _ = C.utils.getCoreNumber(h, o);
2333
- this.maxCoreNumberLength = _.length, o === "by" && (this.maxCoreNumberLength = _.length + 1);
2388
+ ), c = h;
2389
+ for (; y.utils.isPossibleNumber(h, s, i); )
2390
+ c = h, h += "0";
2391
+ const C = y.utils.getCoreNumber(c, s);
2392
+ this.maxCoreNumberLength = C.length, s === "by" && (this.maxCoreNumberLength = C.length + 1);
2334
2393
  } else
2335
2394
  this.maxCoreNumberLength = null;
2336
2395
  }
@@ -2346,14 +2405,14 @@ class p1 {
2346
2405
  } catch {
2347
2406
  e = document.body;
2348
2407
  }
2349
- const i = this.telInput.parentNode.cloneNode(!1);
2350
- i.style.visibility = "hidden", e.appendChild(i);
2351
- const n = this.countryContainer.cloneNode();
2352
- i.appendChild(n);
2353
- const o = this.selectedCountry.cloneNode(!0);
2354
- n.appendChild(o);
2355
- const l = o.offsetWidth;
2356
- return e.removeChild(i), l;
2408
+ const $ = this.telInput.parentNode.cloneNode(!1);
2409
+ $.style.visibility = "hidden", e.appendChild($);
2410
+ const i = this.countryContainer.cloneNode();
2411
+ $.appendChild(i);
2412
+ const s = this.selectedCountry.cloneNode(!0);
2413
+ i.appendChild(s);
2414
+ const u = s.offsetWidth;
2415
+ return e.removeChild($), u;
2357
2416
  }
2358
2417
  return 0;
2359
2418
  }
@@ -2361,26 +2420,26 @@ class p1 {
2361
2420
  _updatePlaceholder() {
2362
2421
  const {
2363
2422
  autoPlaceholder: e,
2364
- placeholderNumberType: i,
2365
- nationalMode: n,
2366
- customPlaceholder: o
2367
- } = this.options, l = e === "aggressive" || !this.hadInitialPlaceholder && e === "polite";
2368
- if (C.utils && l) {
2369
- const f = C.utils.numberType[i];
2370
- let h = this.selectedCountryData.iso2 ? C.utils.getExampleNumber(
2423
+ placeholderNumberType: $,
2424
+ nationalMode: i,
2425
+ customPlaceholder: s
2426
+ } = this.options, u = e === "aggressive" || !this.hadInitialPlaceholder && e === "polite";
2427
+ if (y.utils && u) {
2428
+ const h = y.utils.numberType[$];
2429
+ let c = this.selectedCountryData.iso2 ? y.utils.getExampleNumber(
2371
2430
  this.selectedCountryData.iso2,
2372
- n,
2373
- f
2431
+ i,
2432
+ h
2374
2433
  ) : "";
2375
- h = this._beforeSetNumber(h), typeof o == "function" && (h = o(h, this.selectedCountryData)), this.telInput.setAttribute("placeholder", h);
2434
+ c = this._beforeSetNumber(c), typeof s == "function" && (c = s(c, this.selectedCountryData)), this.telInput.setAttribute("placeholder", c);
2376
2435
  }
2377
2436
  }
2378
2437
  //* Called when the user selects a list item from the dropdown.
2379
2438
  _selectListItem(e) {
2380
- const i = this._setCountry(
2381
- e.getAttribute("data-country-code")
2382
- );
2383
- this._closeDropdown(), this._updateDialCode(e.getAttribute("data-dial-code")), this.options.formatOnDisplay && this._updateValFromNumber(this.telInput.value), this.telInput.focus(), i && this._triggerCountryChange();
2439
+ const $ = e.getAttribute("data-country-code"), i = this._setCountry($);
2440
+ this._closeDropdown();
2441
+ const s = e.getAttribute("data-dial-code");
2442
+ this._updateDialCode(s), this.options.formatOnDisplay && this._updateValFromNumber(this.telInput.value), this.telInput.focus(), i && this._triggerCountryChange();
2384
2443
  }
2385
2444
  //* Close the dropdown and unbind any listeners.
2386
2445
  _closeDropdown() {
@@ -2394,94 +2453,86 @@ class p1 {
2394
2453
  }
2395
2454
  //* Check if an element is visible within it's container, else scroll until it is.
2396
2455
  _scrollTo(e) {
2397
- const i = this.countryList, n = document.documentElement.scrollTop, o = i.offsetHeight, l = i.getBoundingClientRect().top + n, f = l + o, h = e.offsetHeight, _ = e.getBoundingClientRect().top + n, v = _ + h, w = _ - l + i.scrollTop;
2398
- if (_ < l)
2399
- i.scrollTop = w;
2400
- else if (v > f) {
2401
- const g = o - h;
2402
- i.scrollTop = w - g;
2456
+ const $ = this.countryList, i = document.documentElement.scrollTop, s = $.offsetHeight, u = $.getBoundingClientRect().top + i, h = u + s, c = e.offsetHeight, C = e.getBoundingClientRect().top + i, g = C + c, I = C - u + $.scrollTop;
2457
+ if (C < u)
2458
+ $.scrollTop = I;
2459
+ else if (g > h) {
2460
+ const S = s - c;
2461
+ $.scrollTop = I - S;
2403
2462
  }
2404
2463
  }
2405
2464
  //* Replace any existing dial code with the new one
2406
2465
  //* Note: called from _selectListItem and setCountry
2407
2466
  _updateDialCode(e) {
2408
- const i = this.telInput.value, n = `+${e}`;
2409
- let o;
2410
- if (i.charAt(0) === "+") {
2411
- const l = this._getDialCode(i);
2412
- l ? o = i.replace(l, n) : o = n, this.telInput.value = o;
2467
+ const $ = this.telInput.value, i = `+${e}`;
2468
+ let s;
2469
+ if ($.charAt(0) === "+") {
2470
+ const u = this._getDialCode($);
2471
+ u ? s = $.replace(u, i) : s = i, this.telInput.value = s;
2413
2472
  }
2414
2473
  }
2415
2474
  //* Try and extract a valid international dial code from a full telephone number.
2416
2475
  //* Note: returns the raw string inc plus character and any whitespace/dots etc.
2417
- _getDialCode(e, i) {
2418
- let n = "";
2476
+ _getDialCode(e, $) {
2477
+ let i = "";
2419
2478
  if (e.charAt(0) === "+") {
2420
- let o = "";
2421
- for (let l = 0; l < e.length; l++) {
2422
- const f = e.charAt(l);
2423
- if (!isNaN(parseInt(f, 10))) {
2424
- if (o += f, i)
2425
- this.dialCodeToIso2Map[o] && (n = e.substring(0, l + 1));
2426
- else if (this.dialCodes.has(o)) {
2427
- n = e.substring(0, l + 1);
2479
+ let s = "";
2480
+ for (let u = 0; u < e.length; u++) {
2481
+ const h = e.charAt(u);
2482
+ if (!isNaN(parseInt(h, 10))) {
2483
+ if (s += h, $)
2484
+ this.dialCodeToIso2Map[s] && (i = e.substring(0, u + 1));
2485
+ else if (this.dialCodes.has(s)) {
2486
+ i = e.substring(0, u + 1);
2428
2487
  break;
2429
2488
  }
2430
- if (o.length === this.dialCodeMaxLen)
2489
+ if (s.length === this.dialCodeMaxLen)
2431
2490
  break;
2432
2491
  }
2433
2492
  }
2434
2493
  }
2435
- return n;
2494
+ return i;
2436
2495
  }
2437
2496
  //* Get the input val, adding the dial code if separateDialCode is enabled.
2438
2497
  _getFullNumber(e) {
2439
- const i = e || this.telInput.value.trim(), { dialCode: n } = this.selectedCountryData;
2440
- let o;
2441
- const l = f1(i);
2442
- return this.options.separateDialCode && i.charAt(0) !== "+" && n && l ? o = `+${n}` : o = "", o + i;
2498
+ const $ = e || this.telInput.value.trim(), { dialCode: i } = this.selectedCountryData;
2499
+ let s;
2500
+ const u = h1($);
2501
+ return this.options.separateDialCode && $.charAt(0) !== "+" && i && u ? s = `+${i}` : s = "", s + $;
2443
2502
  }
2444
2503
  //* Remove the dial code if separateDialCode is enabled also cap the length if the input has a maxlength attribute
2445
2504
  _beforeSetNumber(e) {
2446
- let i = e;
2447
- if (this.options.separateDialCode) {
2448
- let n = this._getDialCode(i);
2449
- if (n) {
2450
- n = `+${this.selectedCountryData.dialCode}`;
2451
- const o = i[n.length] === " " || i[n.length] === "-" ? n.length + 1 : n.length;
2452
- i = i.substring(o);
2453
- }
2454
- }
2505
+ const $ = this._getDialCode(e), i = X2(
2506
+ e,
2507
+ $,
2508
+ this.options.separateDialCode,
2509
+ this.selectedCountryData
2510
+ );
2455
2511
  return this._cap(i);
2456
2512
  }
2457
2513
  //* Trigger the 'countrychange' event.
2458
2514
  _triggerCountryChange() {
2459
2515
  this._trigger("countrychange");
2460
2516
  }
2461
- //* Format the number as the user types.
2462
- _formatNumberAsYouType() {
2463
- const e = this._getFullNumber(), i = C.utils ? C.utils.formatNumberAsYouType(e, this.selectedCountryData.iso2) : e, { dialCode: n } = this.selectedCountryData;
2464
- return this.options.separateDialCode && this.telInput.value.charAt(0) !== "+" && i.includes(`+${n}`) ? (i.split(`+${n}`)[1] || "").trim() : i;
2465
- }
2466
2517
  //**************************
2467
2518
  //* SECRET PUBLIC METHODS
2468
2519
  //**************************
2469
2520
  //* This is called when the geoip call returns.
2470
2521
  handleAutoCountry() {
2471
- this.options.initialCountry === "auto" && C.autoCountry && (this.defaultCountry = C.autoCountry, this.selectedCountryData.iso2 || this.selectedCountryInner.classList.contains("iti__globe") || this.setCountry(this.defaultCountry), this.resolveAutoCountryPromise());
2522
+ this.options.initialCountry === "auto" && y.autoCountry && (this.defaultCountry = y.autoCountry, this.selectedCountryData.iso2 || this.selectedCountryInner.classList.contains("iti__globe") || this.setCountry(this.defaultCountry), this.resolveAutoCountryPromise());
2472
2523
  }
2473
2524
  //* This is called when the utils request completes.
2474
2525
  handleUtils() {
2475
- C.utils && (this.telInput.value && this._updateValFromNumber(this.telInput.value), this.selectedCountryData.iso2 && (this._updatePlaceholder(), this._updateMaxLength())), this.resolveUtilsScriptPromise();
2526
+ y.utils && (this.telInput.value && this._updateValFromNumber(this.telInput.value), this.selectedCountryData.iso2 && (this._updatePlaceholder(), this._updateMaxLength())), this.resolveUtilsScriptPromise();
2476
2527
  }
2477
2528
  //********************
2478
2529
  //* PUBLIC METHODS
2479
2530
  //********************
2480
2531
  //* Remove plugin.
2481
2532
  destroy() {
2482
- var l, f;
2533
+ var u, h;
2483
2534
  this.telInput.iti = void 0;
2484
- const { allowDropdown: e, separateDialCode: i } = this.options;
2535
+ const { allowDropdown: e, separateDialCode: $ } = this.options;
2485
2536
  if (e) {
2486
2537
  this._closeDropdown(), this.selectedCountry.removeEventListener(
2487
2538
  "click",
@@ -2490,28 +2541,28 @@ class p1 {
2490
2541
  "keydown",
2491
2542
  this._handleCountryContainerKeydown
2492
2543
  );
2493
- const h = this.telInput.closest("label");
2494
- h && h.removeEventListener("click", this._handleLabelClick);
2544
+ const c = this.telInput.closest("label");
2545
+ c && c.removeEventListener("click", this._handleLabelClick);
2495
2546
  }
2496
- const { form: n } = this.telInput;
2497
- this._handleHiddenInputSubmit && n && n.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);
2498
- const o = this.telInput.parentNode;
2499
- (l = o == null ? void 0 : o.parentNode) == null || l.insertBefore(this.telInput, o), (f = o == null ? void 0 : o.parentNode) == null || f.removeChild(o), delete C.instances[this.id];
2547
+ const { form: i } = this.telInput;
2548
+ this._handleHiddenInputSubmit && i && i.removeEventListener("submit", this._handleHiddenInputSubmit), this.telInput.removeEventListener("input", this._handleInputEvent), this._handleKeydownEvent && this.telInput.removeEventListener("keydown", this._handleKeydownEvent), this._handlePasteEvent && this.telInput.removeEventListener("paste", this._handlePasteEvent), this.telInput.removeAttribute("data-intl-tel-input-id"), $ && (this.isRTL ? this.telInput.style.paddingRight = this.originalPaddingRight : this.telInput.style.paddingLeft = this.originalPaddingLeft);
2549
+ const s = this.telInput.parentNode;
2550
+ (u = s == null ? void 0 : s.parentNode) == null || u.insertBefore(this.telInput, s), (h = s == null ? void 0 : s.parentNode) == null || h.removeChild(s), delete y.instances[this.id];
2500
2551
  }
2501
2552
  //* Get the extension from the current number.
2502
2553
  getExtension() {
2503
- return C.utils ? C.utils.getExtension(
2554
+ return y.utils ? y.utils.getExtension(
2504
2555
  this._getFullNumber(),
2505
2556
  this.selectedCountryData.iso2
2506
2557
  ) : "";
2507
2558
  }
2508
2559
  //* Format the number to the given format.
2509
2560
  getNumber(e) {
2510
- if (C.utils) {
2511
- const { iso2: i } = this.selectedCountryData;
2512
- return C.utils.formatNumber(
2561
+ if (y.utils) {
2562
+ const { iso2: $ } = this.selectedCountryData;
2563
+ return y.utils.formatNumber(
2513
2564
  this._getFullNumber(),
2514
- i,
2565
+ $,
2515
2566
  e
2516
2567
  );
2517
2568
  }
@@ -2519,7 +2570,7 @@ class p1 {
2519
2570
  }
2520
2571
  //* Get the type of the entered number e.g. landline/mobile.
2521
2572
  getNumberType() {
2522
- return C.utils ? C.utils.getNumberType(
2573
+ return y.utils ? y.utils.getNumberType(
2523
2574
  this._getFullNumber(),
2524
2575
  this.selectedCountryData.iso2
2525
2576
  ) : -99;
@@ -2530,9 +2581,9 @@ class p1 {
2530
2581
  }
2531
2582
  //* Get the validation error.
2532
2583
  getValidationError() {
2533
- if (C.utils) {
2584
+ if (y.utils) {
2534
2585
  const { iso2: e } = this.selectedCountryData;
2535
- return C.utils.getValidationError(this._getFullNumber(), e);
2586
+ return y.utils.getValidationError(this._getFullNumber(), e);
2536
2587
  }
2537
2588
  return -99;
2538
2589
  }
@@ -2545,31 +2596,34 @@ class p1 {
2545
2596
  return this._validateNumber(!0);
2546
2597
  }
2547
2598
  _utilsIsPossibleNumber(e) {
2548
- return C.utils ? C.utils.isPossibleNumber(e, this.selectedCountryData.iso2, this.options.validationNumberTypes) : null;
2599
+ return y.utils ? y.utils.isPossibleNumber(e, this.selectedCountryData.iso2, this.options.validationNumberTypes) : null;
2549
2600
  }
2550
2601
  //* Shared internal validation logic to handle alpha character extension rules.
2551
2602
  _validateNumber(e) {
2552
2603
  if (!this.selectedCountryData.iso2)
2553
2604
  return !1;
2554
- const i = (f) => e ? this._utilsIsValidNumber(f) : this._utilsIsPossibleNumber(f), n = this._getFullNumber(), o = n.search(new RegExp("\\p{L}", "u"));
2555
- if (o > -1 && !this.options.allowPhonewords) {
2556
- const f = n.substring(0, o), h = i(f), _ = i(n);
2557
- return h && _;
2605
+ const $ = (h) => e ? this._utilsIsValidNumber(h) : this._utilsIsPossibleNumber(h), i = this._getFullNumber(), s = i.search(new RegExp("\\p{L}", "u"));
2606
+ if (s > -1 && !this.options.allowPhonewords) {
2607
+ const h = i.substring(0, s), c = $(h), C = $(i);
2608
+ return c && C;
2558
2609
  }
2559
- return i(n);
2610
+ return $(i);
2560
2611
  }
2561
2612
  _utilsIsValidNumber(e) {
2562
- return C.utils ? C.utils.isValidNumber(e, this.selectedCountryData.iso2, this.options.validationNumberTypes) : null;
2613
+ return y.utils ? y.utils.isValidNumber(e, this.selectedCountryData.iso2, this.options.validationNumberTypes) : null;
2563
2614
  }
2564
2615
  //* Update the selected country, and update the input val accordingly.
2565
2616
  setCountry(e) {
2566
- const i = e == null ? void 0 : e.toLowerCase(), n = this.selectedCountryData.iso2;
2567
- (e && i !== n || !e && n) && (this._setCountry(i), this._updateDialCode(this.selectedCountryData.dialCode), this.options.formatOnDisplay && this._updateValFromNumber(this.telInput.value), this._triggerCountryChange());
2617
+ const $ = e == null ? void 0 : e.toLowerCase();
2618
+ if (!w1($))
2619
+ throw new Error(`Invalid country code: '${$}'`);
2620
+ const i = this.selectedCountryData.iso2;
2621
+ (e && $ !== i || !e && i) && (this._setCountry($), this._updateDialCode(this.selectedCountryData.dialCode), this.options.formatOnDisplay && this._updateValFromNumber(this.telInput.value), this._triggerCountryChange());
2568
2622
  }
2569
2623
  //* Set the input value and update the country.
2570
2624
  setNumber(e) {
2571
- const i = this._updateCountryFromNumber(e);
2572
- this._updateValFromNumber(e), i && this._triggerCountryChange(), this._trigger("input", { isSetNumber: !0 });
2625
+ const $ = this._updateCountryFromNumber(e);
2626
+ this._updateValFromNumber(e), $ && this._triggerCountryChange(), this._trigger("input", { isSetNumber: !0 });
2573
2627
  }
2574
2628
  //* Set the placeholder number typ
2575
2629
  setPlaceholderNumberType(e) {
@@ -2579,194 +2633,194 @@ class p1 {
2579
2633
  this.telInput.disabled = e, e ? this.selectedCountry.setAttribute("disabled", "true") : this.selectedCountry.removeAttribute("disabled");
2580
2634
  }
2581
2635
  }
2582
- const Z2 = (m) => {
2583
- if (!C.utils && !C.startedLoadingUtilsScript) {
2636
+ const n0 = (f) => {
2637
+ if (!y.utils && !y.startedLoadingUtilsScript) {
2584
2638
  let e;
2585
- if (typeof m == "function")
2639
+ if (typeof f == "function")
2586
2640
  try {
2587
- e = Promise.resolve(m());
2588
- } catch (i) {
2589
- return Promise.reject(i);
2641
+ e = Promise.resolve(f());
2642
+ } catch ($) {
2643
+ return Promise.reject($);
2590
2644
  }
2591
2645
  else
2592
- return Promise.reject(new TypeError(`The argument passed to attachUtils must be a function that returns a promise for the utilities module, not ${typeof m}`));
2593
- return C.startedLoadingUtilsScript = !0, e.then((i) => {
2594
- const n = i == null ? void 0 : i.default;
2595
- if (!n || typeof n != "object")
2646
+ return Promise.reject(new TypeError(`The argument passed to attachUtils must be a function that returns a promise for the utilities module, not ${typeof f}`));
2647
+ return y.startedLoadingUtilsScript = !0, e.then(($) => {
2648
+ const i = $ == null ? void 0 : $.default;
2649
+ if (!i || typeof i != "object")
2596
2650
  throw new TypeError("The loader function passed to attachUtils did not resolve to a module object with utils as its default export.");
2597
- return C.utils = n, $1("handleUtils"), !0;
2598
- }).catch((i) => {
2599
- throw $1("rejectUtilsScriptPromise", i), i;
2651
+ return y.utils = i, e1("handleUtils"), !0;
2652
+ }).catch(($) => {
2653
+ throw e1("rejectUtilsScriptPromise", $), $;
2600
2654
  });
2601
2655
  }
2602
2656
  return null;
2603
- }, C = Object.assign(
2604
- (m, e) => {
2605
- const i = new p1(m, e);
2606
- return i._init(), m.setAttribute("data-intl-tel-input-id", i.id.toString()), C.instances[i.id] = i, m.iti = i, i;
2657
+ }, y = Object.assign(
2658
+ (f, e) => {
2659
+ const $ = new c1(f, e);
2660
+ return $._init(), f.setAttribute("data-intl-tel-input-id", $.id.toString()), y.instances[$.id] = $, f.iti = $, $;
2607
2661
  },
2608
2662
  {
2609
- defaults: l2,
2663
+ defaults: u2,
2610
2664
  //* Using a static var like this allows us to mock it in the tests.
2611
2665
  documentReady: () => document.readyState === "complete",
2612
2666
  //* Get the country data object.
2613
- getCountryData: () => J,
2667
+ getCountryData: () => Z,
2614
2668
  //* A getter for the plugin instance.
2615
- getInstance: (m) => {
2616
- const e = m.getAttribute("data-intl-tel-input-id");
2617
- return e ? C.instances[e] : null;
2669
+ getInstance: (f) => {
2670
+ const e = f.getAttribute("data-intl-tel-input-id");
2671
+ return e ? y.instances[e] : null;
2618
2672
  },
2619
2673
  //* A map from instance ID to instance object.
2620
2674
  instances: {},
2621
- attachUtils: Z2,
2675
+ attachUtils: n0,
2622
2676
  startedLoadingUtilsScript: !1,
2623
2677
  startedLoadingAutoCountry: !1,
2624
- version: "25.10.6"
2678
+ version: "25.10.8"
2625
2679
  }
2626
2680
  );
2627
2681
  (function() {
2628
- var m = this || self;
2682
+ var f = this || self;
2629
2683
  function e(d, t) {
2630
2684
  d = d.split(".");
2631
- var $ = m;
2632
- d[0] in $ || typeof $.execScript > "u" || $.execScript("var " + d[0]);
2633
- for (var s; d.length && (s = d.shift()); ) d.length || t === void 0 ? $[s] && $[s] !== Object.prototype[s] ? $ = $[s] : $ = $[s] = {} : $[s] = t;
2685
+ var n = f;
2686
+ d[0] in n || typeof n.execScript > "u" || n.execScript("var " + d[0]);
2687
+ for (var r; d.length && (r = d.shift()); ) d.length || t === void 0 ? n[r] && n[r] !== Object.prototype[r] ? n = n[r] : n = n[r] = {} : n[r] = t;
2634
2688
  }
2635
- function i(d, t) {
2636
- function $() {
2689
+ function $(d, t) {
2690
+ function n() {
2637
2691
  }
2638
- $.prototype = t.prototype, d.ma = t.prototype, d.prototype = new $(), d.prototype.constructor = d, d.sa = function(s, r, a) {
2639
- for (var u = Array(arguments.length - 2), c = 2; c < arguments.length; c++) u[c - 2] = arguments[c];
2640
- return t.prototype[r].apply(s, u);
2692
+ n.prototype = t.prototype, d.ma = t.prototype, d.prototype = new n(), d.prototype.constructor = d, d.sa = function(r, o, a) {
2693
+ for (var l = Array(arguments.length - 2), p = 2; p < arguments.length; p++) l[p - 2] = arguments[p];
2694
+ return t.prototype[o].apply(r, l);
2641
2695
  };
2642
2696
  }
2643
- function n(d) {
2697
+ function i(d) {
2644
2698
  const t = [];
2645
- let $ = 0;
2646
- for (const s in d) t[$++] = d[s];
2699
+ let n = 0;
2700
+ for (const r in d) t[n++] = d[r];
2647
2701
  return t;
2648
2702
  }
2649
- var o = class {
2703
+ var s = class {
2650
2704
  constructor(d) {
2651
- if (l !== l) throw Error("SafeUrl is not meant to be built directly");
2705
+ if (u !== u) throw Error("SafeUrl is not meant to be built directly");
2652
2706
  this.g = d;
2653
2707
  }
2654
2708
  toString() {
2655
2709
  return this.g.toString();
2656
2710
  }
2657
- }, l = {};
2658
- new o("about:invalid#zClosurez"), new o("about:blank");
2659
- const f = {};
2660
- class h {
2711
+ }, u = {};
2712
+ new s("about:invalid#zClosurez"), new s("about:blank");
2713
+ const h = {};
2714
+ class c {
2661
2715
  constructor() {
2662
- if (f !== f) throw Error("SafeStyle is not meant to be built directly");
2716
+ if (h !== h) throw Error("SafeStyle is not meant to be built directly");
2663
2717
  }
2664
2718
  toString() {
2665
2719
  return "";
2666
2720
  }
2667
2721
  }
2668
- new h();
2669
- const _ = {};
2670
- class v {
2722
+ new c();
2723
+ const C = {};
2724
+ class g {
2671
2725
  constructor() {
2672
- if (_ !== _) throw Error("SafeStyleSheet is not meant to be built directly");
2726
+ if (C !== C) throw Error("SafeStyleSheet is not meant to be built directly");
2673
2727
  }
2674
2728
  toString() {
2675
2729
  return "";
2676
2730
  }
2677
2731
  }
2678
- new v();
2679
- const w = {};
2680
- class g {
2732
+ new g();
2733
+ const I = {};
2734
+ class S {
2681
2735
  constructor() {
2682
- var t = m.trustedTypes && m.trustedTypes.emptyHTML || "";
2683
- if (w !== w) throw Error("SafeHtml is not meant to be built directly");
2736
+ var t = f.trustedTypes && f.trustedTypes.emptyHTML || "";
2737
+ if (I !== I) throw Error("SafeHtml is not meant to be built directly");
2684
2738
  this.g = t;
2685
2739
  }
2686
2740
  toString() {
2687
2741
  return this.g.toString();
2688
2742
  }
2689
2743
  }
2690
- new g();
2691
- function I(d, t) {
2744
+ new S();
2745
+ function R(d, t) {
2692
2746
  switch (this.g = d, this.l = !!t.aa, this.h = t.i, this.s = t.type, this.o = !1, this.h) {
2693
- case O:
2694
- case G:
2695
- case F:
2747
+ case A:
2748
+ case k:
2749
+ case H:
2750
+ case f1:
2751
+ case c2:
2696
2752
  case D:
2697
- case i1:
2698
- case M:
2699
- case S:
2753
+ case v:
2700
2754
  this.o = !0;
2701
2755
  }
2702
2756
  this.j = t.defaultValue;
2703
2757
  }
2704
- var S = 1, M = 2, O = 3, G = 4, F = 6, D = 16, i1 = 18;
2705
- function c2(d, t) {
2758
+ var v = 1, D = 2, A = 3, k = 4, H = 6, f1 = 16, c2 = 18;
2759
+ function f2(d, t) {
2706
2760
  for (this.h = d, this.g = {}, d = 0; d < t.length; d++) {
2707
- var $ = t[d];
2708
- this.g[$.g] = $;
2761
+ var n = t[d];
2762
+ this.g[n.g] = n;
2709
2763
  }
2710
2764
  }
2711
- function f2(d) {
2712
- return d = n(d.g), d.sort(function(t, $) {
2713
- return t.g - $.g;
2765
+ function p2(d) {
2766
+ return d = i(d.g), d.sort(function(t, n) {
2767
+ return t.g - n.g;
2714
2768
  }), d;
2715
2769
  }
2716
- function x() {
2770
+ function P() {
2717
2771
  this.h = {}, this.j = this.m().g, this.g = this.l = null;
2718
2772
  }
2719
- x.prototype.has = function(d) {
2720
- return R(this, d.g);
2721
- }, x.prototype.get = function(d, t) {
2722
- return p(this, d.g, t);
2723
- }, x.prototype.set = function(d, t) {
2724
- A(this, d.g, t);
2725
- }, x.prototype.add = function(d, t) {
2773
+ P.prototype.has = function(d) {
2774
+ return x(this, d.g);
2775
+ }, P.prototype.get = function(d, t) {
2776
+ return m(this, d.g, t);
2777
+ }, P.prototype.set = function(d, t) {
2778
+ E(this, d.g, t);
2779
+ }, P.prototype.add = function(d, t) {
2726
2780
  b1(this, d.g, t);
2727
2781
  };
2728
2782
  function S1(d, t) {
2729
- for (var $ = f2(d.m()), s = 0; s < $.length; s++) {
2730
- var r = $[s], a = r.g;
2731
- if (R(t, a)) {
2732
- d.g && delete d.g[r.g];
2733
- var u = r.h == 11 || r.h == 10;
2734
- if (r.l) {
2735
- r = P(t, a);
2736
- for (var c = 0; c < r.length; c++) b1(d, a, u ? r[c].clone() : r[c]);
2737
- } else r = n1(t, a), u ? (u = n1(d, a)) ? S1(u, r) : A(d, a, r.clone()) : A(d, a, r);
2783
+ for (var n = p2(d.m()), r = 0; r < n.length; r++) {
2784
+ var o = n[r], a = o.g;
2785
+ if (x(t, a)) {
2786
+ d.g && delete d.g[o.g];
2787
+ var l = o.h == 11 || o.h == 10;
2788
+ if (o.l) {
2789
+ o = M(t, a);
2790
+ for (var p = 0; p < o.length; p++) b1(d, a, l ? o[p].clone() : o[p]);
2791
+ } else o = $1(t, a), l ? (l = $1(d, a)) ? S1(l, o) : E(d, a, o.clone()) : E(d, a, o);
2738
2792
  }
2739
2793
  }
2740
2794
  }
2741
- x.prototype.clone = function() {
2795
+ P.prototype.clone = function() {
2742
2796
  var d = new this.constructor();
2743
2797
  return d != this && (d.h = {}, d.g && (d.g = {}), S1(d, this)), d;
2744
2798
  };
2745
- function R(d, t) {
2799
+ function x(d, t) {
2746
2800
  return d.h[t] != null;
2747
2801
  }
2748
- function n1(d, t) {
2749
- var $ = d.h[t];
2750
- if ($ == null) return null;
2802
+ function $1(d, t) {
2803
+ var n = d.h[t];
2804
+ if (n == null) return null;
2751
2805
  if (d.l) {
2752
2806
  if (!(t in d.g)) {
2753
- var s = d.l, r = d.j[t];
2754
- if ($ != null) if (r.l) {
2755
- for (var a = [], u = 0; u < $.length; u++) a[u] = s.h(r, $[u]);
2756
- $ = a;
2757
- } else $ = s.h(r, $);
2758
- return d.g[t] = $;
2807
+ var r = d.l, o = d.j[t];
2808
+ if (n != null) if (o.l) {
2809
+ for (var a = [], l = 0; l < n.length; l++) a[l] = r.h(o, n[l]);
2810
+ n = a;
2811
+ } else n = r.h(o, n);
2812
+ return d.g[t] = n;
2759
2813
  }
2760
2814
  return d.g[t];
2761
2815
  }
2762
- return $;
2816
+ return n;
2763
2817
  }
2764
- function p(d, t, $) {
2765
- var s = n1(d, t);
2766
- return d.j[t].l ? s[$ || 0] : s;
2818
+ function m(d, t, n) {
2819
+ var r = $1(d, t);
2820
+ return d.j[t].l ? r[n || 0] : r;
2767
2821
  }
2768
- function b(d, t) {
2769
- if (R(d, t)) d = p(d, t);
2822
+ function w(d, t) {
2823
+ if (x(d, t)) d = m(d, t);
2770
2824
  else d: {
2771
2825
  if (d = d.j[t], d.j === void 0) if (t = d.s, t === Boolean) d.j = !1;
2772
2826
  else if (t === Number) d.j = 0;
@@ -2779,29 +2833,29 @@ const Z2 = (m) => {
2779
2833
  }
2780
2834
  return d;
2781
2835
  }
2782
- function P(d, t) {
2783
- return n1(d, t) || [];
2836
+ function M(d, t) {
2837
+ return $1(d, t) || [];
2784
2838
  }
2785
- function K(d, t) {
2786
- return d.j[t].l ? R(d, t) ? d.h[t].length : 0 : R(d, t) ? 1 : 0;
2839
+ function F(d, t) {
2840
+ return d.j[t].l ? x(d, t) ? d.h[t].length : 0 : x(d, t) ? 1 : 0;
2787
2841
  }
2788
- function A(d, t, $) {
2789
- d.h[t] = $, d.g && (d.g[t] = $);
2842
+ function E(d, t, n) {
2843
+ d.h[t] = n, d.g && (d.g[t] = n);
2790
2844
  }
2791
- function b1(d, t, $) {
2792
- d.h[t] || (d.h[t] = []), d.h[t].push($), d.g && delete d.g[t];
2845
+ function b1(d, t, n) {
2846
+ d.h[t] || (d.h[t] = []), d.h[t].push(n), d.g && delete d.g[t];
2793
2847
  }
2794
- function s1(d, t) {
2795
- var $ = [], s;
2796
- for (s in t) s != 0 && $.push(new I(s, t[s]));
2797
- return new c2(d, $);
2848
+ function n1(d, t) {
2849
+ var n = [], r;
2850
+ for (r in t) r != 0 && n.push(new R(r, t[r]));
2851
+ return new f2(d, n);
2798
2852
  }
2799
- function r1() {
2853
+ function i1() {
2800
2854
  }
2801
- r1.prototype.g = function(d) {
2855
+ i1.prototype.g = function(d) {
2802
2856
  throw new d.h(), Error("Unimplemented");
2803
- }, r1.prototype.h = function(d, t) {
2804
- if (d.h == 11 || d.h == 10) return t instanceof x ? t : this.g(d.s.prototype.m(), t);
2857
+ }, i1.prototype.h = function(d, t) {
2858
+ if (d.h == 11 || d.h == 10) return t instanceof P ? t : this.g(d.s.prototype.m(), t);
2805
2859
  if (d.h == 14) return typeof t == "string" && L1.test(t) && (d = Number(t), 0 < d) ? d : t;
2806
2860
  if (!d.o) return t;
2807
2861
  if (d = d.s, d === String) {
@@ -2810,75 +2864,75 @@ const Z2 = (m) => {
2810
2864
  return t;
2811
2865
  };
2812
2866
  var L1 = /^-?[0-9]+$/;
2813
- function g1() {
2867
+ function p1() {
2814
2868
  }
2815
- i(g1, r1), g1.prototype.g = function(d, t) {
2869
+ $(p1, i1), p1.prototype.g = function(d, t) {
2816
2870
  return d = new d.h(), d.l = this, d.h = t, d.g = {}, d;
2817
2871
  };
2818
- function q() {
2872
+ function J() {
2819
2873
  }
2820
- i(q, g1), q.prototype.h = function(d, t) {
2821
- return d.h == 8 ? !!t : r1.prototype.h.apply(this, arguments);
2822
- }, q.prototype.g = function(d, t) {
2823
- return q.ma.g.call(this, d, t);
2874
+ $(J, p1), J.prototype.h = function(d, t) {
2875
+ return d.h == 8 ? !!t : i1.prototype.h.apply(this, arguments);
2876
+ }, J.prototype.g = function(d, t) {
2877
+ return J.ma.g.call(this, d, t);
2824
2878
  };
2825
- function T(d, t) {
2879
+ function N(d, t) {
2826
2880
  d != null && this.g.apply(this, arguments);
2827
2881
  }
2828
- T.prototype.h = "", T.prototype.set = function(d) {
2882
+ N.prototype.h = "", N.prototype.set = function(d) {
2829
2883
  this.h = "" + d;
2830
- }, T.prototype.g = function(d, t, $) {
2831
- if (this.h += String(d), t != null) for (let s = 1; s < arguments.length; s++) this.h += arguments[s];
2884
+ }, N.prototype.g = function(d, t, n) {
2885
+ if (this.h += String(d), t != null) for (let r = 1; r < arguments.length; r++) this.h += arguments[r];
2832
2886
  return this;
2833
2887
  };
2834
2888
  function B(d) {
2835
2889
  d.h = "";
2836
2890
  }
2837
- T.prototype.toString = function() {
2891
+ N.prototype.toString = function() {
2838
2892
  return this.h;
2839
2893
  };
2840
- function W() {
2841
- x.call(this);
2894
+ function j() {
2895
+ P.call(this);
2842
2896
  }
2843
- i(W, x);
2897
+ $(j, P);
2844
2898
  var N1 = null;
2845
- function L() {
2846
- x.call(this);
2847
- }
2848
- i(L, x);
2849
- var T1 = null;
2850
- function z() {
2851
- x.call(this);
2899
+ function b() {
2900
+ P.call(this);
2852
2901
  }
2853
- i(z, x);
2902
+ $(b, P);
2854
2903
  var A1 = null;
2855
- W.prototype.m = function() {
2904
+ function W() {
2905
+ P.call(this);
2906
+ }
2907
+ $(W, P);
2908
+ var E1 = null;
2909
+ j.prototype.m = function() {
2856
2910
  var d = N1;
2857
- 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;
2858
- }, W.m = W.prototype.m, L.prototype.m = function() {
2859
- var d = T1;
2860
- return d || (T1 = d = s1(L, { 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;
2861
- }, L.m = L.prototype.m, z.prototype.m = function() {
2911
+ return d || (N1 = d = n1(j, { 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;
2912
+ }, j.m = j.prototype.m, b.prototype.m = function() {
2862
2913
  var d = A1;
2863
- return d || (A1 = d = s1(z, {
2914
+ return d || (A1 = d = n1(b, { 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;
2915
+ }, b.m = b.prototype.m, W.prototype.m = function() {
2916
+ var d = E1;
2917
+ return d || (E1 = d = n1(W, {
2864
2918
  0: { name: "PhoneMetadata", ia: "i18n.phonenumbers.PhoneMetadata" },
2865
- 1: { name: "general_desc", i: 11, type: L },
2866
- 2: { name: "fixed_line", i: 11, type: L },
2867
- 3: { name: "mobile", i: 11, type: L },
2868
- 4: { name: "toll_free", i: 11, type: L },
2869
- 5: { name: "premium_rate", i: 11, type: L },
2870
- 6: { name: "shared_cost", i: 11, type: L },
2871
- 7: { name: "personal_number", i: 11, type: L },
2872
- 8: { name: "voip", i: 11, type: L },
2873
- 21: { name: "pager", i: 11, type: L },
2874
- 25: { name: "uan", i: 11, type: L },
2875
- 27: { name: "emergency", i: 11, type: L },
2876
- 28: { name: "voicemail", i: 11, type: L },
2877
- 29: { name: "short_code", i: 11, type: L },
2878
- 30: { name: "standard_rate", i: 11, type: L },
2879
- 31: { name: "carrier_specific", i: 11, type: L },
2880
- 33: { name: "sms_services", i: 11, type: L },
2881
- 24: { name: "no_international_dialling", i: 11, type: L },
2919
+ 1: { name: "general_desc", i: 11, type: b },
2920
+ 2: { name: "fixed_line", i: 11, type: b },
2921
+ 3: { name: "mobile", i: 11, type: b },
2922
+ 4: { name: "toll_free", i: 11, type: b },
2923
+ 5: { name: "premium_rate", i: 11, type: b },
2924
+ 6: { name: "shared_cost", i: 11, type: b },
2925
+ 7: { name: "personal_number", i: 11, type: b },
2926
+ 8: { name: "voip", i: 11, type: b },
2927
+ 21: { name: "pager", i: 11, type: b },
2928
+ 25: { name: "uan", i: 11, type: b },
2929
+ 27: { name: "emergency", i: 11, type: b },
2930
+ 28: { name: "voicemail", i: 11, type: b },
2931
+ 29: { name: "short_code", i: 11, type: b },
2932
+ 30: { name: "standard_rate", i: 11, type: b },
2933
+ 31: { name: "carrier_specific", i: 11, type: b },
2934
+ 33: { name: "sms_services", i: 11, type: b },
2935
+ 24: { name: "no_international_dialling", i: 11, type: b },
2882
2936
  9: { name: "id", required: !0, i: 9, type: String },
2883
2937
  10: { name: "country_code", i: 5, type: Number },
2884
2938
  11: { name: "international_prefix", i: 9, type: String },
@@ -2892,26 +2946,26 @@ const Z2 = (m) => {
2892
2946
  },
2893
2947
  16: { name: "national_prefix_transform_rule", i: 9, type: String },
2894
2948
  18: { name: "same_mobile_and_fixed_line_pattern", i: 8, defaultValue: !1, type: Boolean },
2895
- 19: { name: "number_format", aa: !0, i: 11, type: W },
2896
- 20: { name: "intl_number_format", aa: !0, i: 11, type: W },
2949
+ 19: { name: "number_format", aa: !0, i: 11, type: j },
2950
+ 20: { name: "intl_number_format", aa: !0, i: 11, type: j },
2897
2951
  22: { name: "main_country_for_code", i: 8, defaultValue: !1, type: Boolean },
2898
2952
  23: { name: "leading_digits", i: 9, type: String }
2899
2953
  })), d;
2900
- }, z.m = z.prototype.m;
2901
- function H() {
2902
- x.call(this);
2954
+ }, W.m = W.prototype.m;
2955
+ function K() {
2956
+ P.call(this);
2903
2957
  }
2904
- i(H, x);
2905
- var E1 = null, p2 = { ra: 0, qa: 1, pa: 5, oa: 10, na: 20 };
2906
- H.prototype.m = function() {
2907
- var d = E1;
2908
- 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: {
2958
+ $(K, P);
2959
+ var T1 = null, g2 = { ra: 0, qa: 1, pa: 5, oa: 10, na: 20 };
2960
+ K.prototype.m = function() {
2961
+ var d = T1;
2962
+ return d || (T1 = d = n1(K, { 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: g2 }, 7: {
2909
2963
  name: "preferred_domestic_carrier_code",
2910
2964
  i: 9,
2911
2965
  type: String
2912
2966
  } })), d;
2913
- }, H.ctor = H, H.ctor.m = H.prototype.m;
2914
- var X = {
2967
+ }, K.ctor = K, K.ctor.m = K.prototype.m;
2968
+ var q = {
2915
2969
  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(" "),
2916
2970
  7: ["RU", "KZ"],
2917
2971
  20: ["EG"],
@@ -4315,12 +4369,12 @@ const Z2 = (m) => {
4315
4369
  ,
4316
4370
  ,
4317
4371
  [9]
4318
- ], [, , "(?:60[1-8]\\d|7(?:0(?:[2-5]\\d|60)|19[0-4]|[2379]\\d\\d))\\d{5}", , , , "601123456", , , [9]], [, , "800\\d{6}", , , , "800123456", , , [9]], [, , "9(?:0[05689]|76)\\d{6}", , , , "900123456", , , [9]], [, , "8[134]\\d{7}", , , , "811234567", , , [9]], [, , "70[01]\\d{6}", , , , "700123456", , , [9]], [, , "9[17]0\\d{6}", , , , "910123456", , , [9]], "CZ", 420, "00", , , , , , , , [
4319
- [, "(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["[2-8]|9[015-7]"]],
4320
- [, "(\\d{2})(\\d{3})(\\d{3})(\\d{2})", "$1 $2 $3 $4", ["96"]],
4321
- [, "(\\d{2})(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3 $4", ["9"]],
4322
- [, "(\\d{3})(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3 $4", ["9"]]
4323
- ], , [, , , , , , , , , [-1]], , , [, , , , , , , , , [-1]], [, , "9(?:5\\d|7[2-4])\\d{6}", , , , "972123456", , , [9]], , , [, , "9(?:3\\d{9}|6\\d{7,10})", , , , "93123456789"]],
4372
+ ], [, , "7(?:060\\d|19(?:[0-4]\\d|50))\\d{4}|(?:60[1-8]|7(?:0[2-5]|[2379]\\d))\\d{6}", , , , "601123456", , , [9]], [, , "800\\d{6}", , , , "800123456", , , [9]], [, , "9(?:0[05689]|76)\\d{6}", , , , "900123456", , , [9]], [, , "8[134]\\d{7}", , , , "811234567", , , [9]], [, , "70[01]\\d{6}", , , , "700123456", , , [9]], [, , "9[17]0\\d{6}", , , , "910123456", , , [9]], "CZ", 420, "00", , , , , , , , [[, "(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["[2-8]|9[015-7]"]], [, "(\\d{2})(\\d{3})(\\d{3})(\\d{2})", "$1 $2 $3 $4", ["96"]], [
4373
+ ,
4374
+ "(\\d{2})(\\d{3})(\\d{3})(\\d{3})",
4375
+ "$1 $2 $3 $4",
4376
+ ["9"]
4377
+ ], [, "(\\d{3})(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3 $4", ["9"]]], , [, , , , , , , , , [-1]], , , [, , , , , , , , , [-1]], [, , "9(?:5\\d|7[2-4])\\d{6}", , , , "972123456", , , [9]], , , [, , "9(?:3\\d{9}|6\\d{7,10})", , , , "93123456789"]],
4324
4378
  DE: [, [, , "[2579]\\d{5,14}|49(?:[34]0|69|8\\d)\\d\\d?|49(?:37|49|60|7[089]|9\\d)\\d{1,3}|49(?:2[024-9]|3[2-689]|7[1-7])\\d{1,8}|(?:1|[368]\\d|4[0-8])\\d{3,13}|49(?:[015]\\d|2[13]|31|[46][1-8])\\d{1,9}", , , , , , , [4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15], [2, 3]], [
4325
4379
  ,
4326
4380
  ,
@@ -4341,6 +4395,7 @@ const Z2 = (m) => {
4341
4395
  ["3[02]|40|[68]9"],
4342
4396
  "0$1"
4343
4397
  ],
4398
+ [, "(\\d{6})", "$1", ["227", "2277"]],
4344
4399
  [, "(\\d{3})(\\d{3,12})", "$1 $2", ["2(?:0[1-389]|1[124]|2[18]|3[14])|3(?:[35-9][15]|4[015])|906|(?:2[4-9]|4[2-9]|[579][1-9]|[68][1-8])1", "2(?:0[1-389]|12[0-8])|3(?:[35-9][15]|4[015])|906|2(?:[13][14]|2[18])|(?:2[4-9]|4[2-9]|[579][1-9]|[68][1-8])1"], "0$1"],
4345
4400
  [
4346
4401
  ,
@@ -4364,7 +4419,38 @@ const Z2 = (m) => {
4364
4419
  [, "(\\d{3})(\\d{2})(\\d{7,8})", "$1 $2 $3", ["1(?:6[023]|7)"], "0$1"],
4365
4420
  [, "(\\d{4})(\\d{2})(\\d{7})", "$1 $2 $3", ["15[279]"], "0$1"],
4366
4421
  [, "(\\d{3})(\\d{2})(\\d{8})", "$1 $2 $3", ["15"], "0$1"]
4367
- ], , [, , "16(?:4\\d{1,10}|[89]\\d{1,11})", , , , "16412345", , , [4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14]], , , [, , , , , , , , , [-1]], [, , "18(?:1\\d{5,11}|[2-9]\\d{8})", , , , "18500123456", , , [8, 9, 10, 11, 12, 13, 14]], , , [
4422
+ ], [
4423
+ [, "(\\d{2})(\\d{3,13})", "$1 $2", ["3[02]|40|[68]9"], "0$1"],
4424
+ [
4425
+ ,
4426
+ "(\\d{3})(\\d{3,12})",
4427
+ "$1 $2",
4428
+ ["2(?:0[1-389]|1[124]|2[18]|3[14])|3(?:[35-9][15]|4[015])|906|(?:2[4-9]|4[2-9]|[579][1-9]|[68][1-8])1", "2(?:0[1-389]|12[0-8])|3(?:[35-9][15]|4[015])|906|2(?:[13][14]|2[18])|(?:2[4-9]|4[2-9]|[579][1-9]|[68][1-8])1"],
4429
+ "0$1"
4430
+ ],
4431
+ [
4432
+ ,
4433
+ "(\\d{4})(\\d{2,11})",
4434
+ "$1 $2",
4435
+ ["[24-6]|3(?:[3569][02-46-9]|4[2-4679]|7[2-467]|8[2-46-8])|70[2-8]|8(?:0[2-9]|[1-8])|90[7-9]|[79][1-9]", "[24-6]|3(?:3(?:0[1-467]|2[127-9]|3[124578]|7[1257-9]|8[1256]|9[145])|4(?:2[135]|4[13578]|9[1346])|5(?:0[14]|2[1-3589]|6[1-4]|7[13468]|8[13568])|6(?:2[1-489]|3[124-6]|6[13]|7[12579]|8[1-356]|9[135])|7(?:2[1-7]|4[145]|6[1-5]|7[1-4])|8(?:21|3[1468]|6|7[1467]|8[136])|9(?:0[12479]|2[1358]|4[134679]|6[1-9]|7[136]|8[147]|9[1468]))|70[2-8]|8(?:0[2-9]|[1-8])|90[7-9]|[79][1-9]|3[68]4[1347]|3(?:47|60)[1356]|3(?:3[46]|46|5[49])[1246]|3[4579]3[1357]"],
4436
+ "0$1"
4437
+ ],
4438
+ [, "(\\d{3})(\\d{4})", "$1 $2", ["138"], "0$1"],
4439
+ [, "(\\d{5})(\\d{2,10})", "$1 $2", ["3"], "0$1"],
4440
+ [, "(\\d{3})(\\d{5,11})", "$1 $2", ["181"], "0$1"],
4441
+ [, "(\\d{3})(\\d)(\\d{4,10})", "$1 $2 $3", ["1(?:3|80)|9"], "0$1"],
4442
+ [, "(\\d{3})(\\d{7,8})", "$1 $2", ["1[67]"], "0$1"],
4443
+ [, "(\\d{3})(\\d{7,12})", "$1 $2", ["8"], "0$1"],
4444
+ [, "(\\d{5})(\\d{6})", "$1 $2", ["185", "1850", "18500"], "0$1"],
4445
+ [, "(\\d{3})(\\d{4})(\\d{4})", "$1 $2 $3", ["7"], "0$1"],
4446
+ [, "(\\d{4})(\\d{7})", "$1 $2", ["18[68]"], "0$1"],
4447
+ [, "(\\d{4})(\\d{7})", "$1 $2", ["15[1279]"], "0$1"],
4448
+ [, "(\\d{5})(\\d{6})", "$1 $2", ["15[03568]", "15(?:[0568]|3[13])"], "0$1"],
4449
+ [, "(\\d{3})(\\d{8})", "$1 $2", ["18"], "0$1"],
4450
+ [, "(\\d{3})(\\d{2})(\\d{7,8})", "$1 $2 $3", ["1(?:6[023]|7)"], "0$1"],
4451
+ [, "(\\d{4})(\\d{2})(\\d{7})", "$1 $2 $3", ["15[279]"], "0$1"],
4452
+ [, "(\\d{3})(\\d{2})(\\d{8})", "$1 $2 $3", ["15"], "0$1"]
4453
+ ], [, , "16(?:4\\d{1,10}|[89]\\d{1,11})", , , , "16412345", , , [4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14]], , , [, , , , , , , , , [-1]], [, , "18(?:1\\d{5,11}|[2-9]\\d{8})", , , , "18500123456", , , [8, 9, 10, 11, 12, 13, 14]], , , [
4368
4454
  ,
4369
4455
  ,
4370
4456
  "1(?:6(?:013|255|399)|7(?:(?:[015]1|[69]3)3|[2-4]55|[78]99))\\d{7,8}|15(?:(?:[03-68]00|113)\\d|2\\d55|7\\d99|9\\d33)\\d{7}",
@@ -5462,17 +5548,14 @@ const Z2 = (m) => {
5462
5548
  ,
5463
5549
  [7]
5464
5550
  ], [, , , , , , , , , [-1]], [, , , , , , , , , [-1]], [, , "49[0-24-79]\\d{4}", , , , "4921234", , , [7]], "IS", 354, "00|1(?:0(?:01|[12]0)|100)", , , , , , "00", , [[, "(\\d{3})(\\d{4})", "$1 $2", ["[4-9]"]], [, "(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["3"]]], , [, , , , , , , , , [-1]], , , [, , , , , , , , , [-1]], [, , "809\\d{4}", , , , "8091234", , , [7]], , , [, , "(?:689|8(?:7[18]|80)|95[48])\\d{4}", , , , "6891234", , , [7]]],
5465
- IT: [, [, , "0\\d{5,10}|1\\d{8,10}|3(?:[0-8]\\d{7,10}|9\\d{7,8})|(?:43|55|70)\\d{8}|8\\d{5}(?:\\d{2,4})?", , , , , , , [6, 7, 8, 9, 10, 11, 12]], [
5466
- ,
5551
+ IT: [, [, , "0\\d{5,11}|1\\d{8,10}|3(?:[0-8]\\d{7,10}|9\\d{7,8})|(?:43|55|70)\\d{8}|8\\d{5}(?:\\d{2,4})?", , , , , , , [6, 7, 8, 9, 10, 11, 12]], [
5467
5552
  ,
5468
- "0669[0-79]\\d{1,6}|0(?:1(?:[0159]\\d|[27][1-5]|31|4[1-4]|6[1356]|8[2-57])|2\\d\\d|3(?:[0159]\\d|2[1-4]|3[12]|[48][1-6]|6[2-59]|7[1-7])|4(?:[0159]\\d|[23][1-9]|4[245]|6[1-5]|7[1-4]|81)|5(?:[0159]\\d|2[1-5]|3[2-6]|4[1-79]|6[4-6]|7[1-578]|8[3-8])|6(?:[0-57-9]\\d|6[0-8])|7(?:[0159]\\d|2[12]|3[1-7]|4[2-46]|6[13569]|7[13-6]|8[1-59])|8(?:[0159]\\d|2[3-578]|3[1-356]|[6-8][1-5])|9(?:[0159]\\d|[238][1-5]|4[12]|6[1-8]|7[1-6]))\\d{2,7}",
5469
5553
  ,
5554
+ "0(?:669[0-79]\\d{1,6}|831\\d{2,8})|0(?:1(?:[0159]\\d|[27][1-5]|31|4[1-4]|6[1356]|8[2-57])|2\\d\\d|3(?:[0159]\\d|2[1-4]|3[12]|[48][1-6]|6[2-59]|7[1-7])|4(?:[0159]\\d|[23][1-9]|4[245]|6[1-5]|7[1-4]|81)|5(?:[0159]\\d|2[1-5]|3[2-6]|4[1-79]|6[4-6]|7[1-578]|8[3-8])|6(?:[0-57-9]\\d|6[0-8])|7(?:[0159]\\d|2[12]|3[1-7]|4[2-46]|6[13569]|7[13-6]|8[1-59])|8(?:[0159]\\d|2[3-578]|3[2356]|[6-8][1-5])|9(?:[0159]\\d|[238][1-5]|4[12]|6[1-8]|7[1-6]))\\d{2,7}",
5470
5555
  ,
5471
5556
  ,
5472
- "0212345678",
5473
5557
  ,
5474
- ,
5475
- [6, 7, 8, 9, 10, 11]
5558
+ "0212345678"
5476
5559
  ], [, , "3[2-9]\\d{7,8}|(?:31|43)\\d{8}", , , , "3123456789", , , [9, 10]], [, , "80(?:0\\d{3}|3)\\d{3}", , , , "800123456", , , [6, 9]], [, , "(?:0878\\d{3}|89(?:2\\d|3[04]|4(?:[0-4]|[5-9]\\d\\d)|5[0-4]))\\d\\d|(?:1(?:44|6[346])|89(?:38|5[5-9]|9))\\d{6}", , , , "899123456", , , [6, 8, 9, 10]], [, , "84(?:[08]\\d{3}|[17])\\d{3}", , , , "848123456", , , [6, 9]], [, , "1(?:78\\d|99)\\d{6}", , , , "1781234567", , , [9, 10]], [, , "55\\d{8}", , , , "5512345678", , , [10]], "IT", 39, "00", , , , , , , , [
5477
5560
  [, "(\\d{4,5})", "$1", ["1(?:0|9[246])", "1(?:0|9(?:2[2-9]|[46]))"]],
5478
5561
  [, "(\\d{6})", "$1", ["1(?:1|92)"]],
@@ -5485,13 +5568,13 @@ const Z2 = (m) => {
5485
5568
  [, "(\\d{3})(\\d{3,4})(\\d{4})", "$1 $2 $3", ["0[13-57-9][0159]|14"]],
5486
5569
  [, "(\\d{2})(\\d{4})(\\d{5})", "$1 $2 $3", ["0[26]"]],
5487
5570
  [, "(\\d{4})(\\d{3})(\\d{4})", "$1 $2 $3", ["0"]],
5488
- [, "(\\d{3})(\\d{4})(\\d{4,5})", "$1 $2 $3", ["3"]]
5571
+ [, "(\\d{3})(\\d{4})(\\d{4,5})", "$1 $2 $3", ["[03]"]]
5489
5572
  ], [[, "(\\d{2})(\\d{4,6})", "$1 $2", ["0[26]"]], [, "(\\d{3})(\\d{3,6})", "$1 $2", ["0[13-57-9][0159]|8(?:03|4[17]|9[2-5])", "0[13-57-9][0159]|8(?:03|4[17]|9(?:2|3[04]|[45][0-4]))"]], [, "(\\d{4})(\\d{2,6})", "$1 $2", ["0(?:[13-579][2-46-8]|8[236-8])"]], [, "(\\d{4})(\\d{4})", "$1 $2", ["894"]], [, "(\\d{2})(\\d{3,4})(\\d{4})", "$1 $2 $3", ["0[26]|5"]], [
5490
5573
  ,
5491
5574
  "(\\d{3})(\\d{3})(\\d{3,4})",
5492
5575
  "$1 $2 $3",
5493
5576
  ["1(?:44|[679])|[378]|43"]
5494
- ], [, "(\\d{3})(\\d{3,4})(\\d{4})", "$1 $2 $3", ["0[13-57-9][0159]|14"]], [, "(\\d{2})(\\d{4})(\\d{5})", "$1 $2 $3", ["0[26]"]], [, "(\\d{4})(\\d{3})(\\d{4})", "$1 $2 $3", ["0"]], [, "(\\d{3})(\\d{4})(\\d{4,5})", "$1 $2 $3", ["3"]]], [, , , , , , , , , [-1]], 1, , [, , "848\\d{6}", , , , , , , [9]], [, , , , , , , , , [-1]], , , [, , "3[2-8]\\d{9,10}", , , , "33101234501", , , [11, 12]]],
5577
+ ], [, "(\\d{3})(\\d{3,4})(\\d{4})", "$1 $2 $3", ["0[13-57-9][0159]|14"]], [, "(\\d{2})(\\d{4})(\\d{5})", "$1 $2 $3", ["0[26]"]], [, "(\\d{4})(\\d{3})(\\d{4})", "$1 $2 $3", ["0"]], [, "(\\d{3})(\\d{4})(\\d{4,5})", "$1 $2 $3", ["[03]"]]], [, , , , , , , , , [-1]], 1, , [, , "848\\d{6}", , , , , , , [9]], [, , , , , , , , , [-1]], , , [, , "3[2-8]\\d{9,10}", , , , "33101234501", , , [11, 12]]],
5495
5578
  JE: [, [, , "1534\\d{6}|(?:[3578]\\d|90)\\d{8}", , , , , , , [10], [6]], [, , "1534[0-24-8]\\d{5}", , , , "1534456789", , , , [6]], [
5496
5579
  ,
5497
5580
  ,
@@ -5874,7 +5957,7 @@ const Z2 = (m) => {
5874
5957
  ,
5875
5958
  "5002345678"
5876
5959
  ], [, , , , , , , , , [-1]], "LC", 1, "011", "1", , , "([2-8]\\d{6})$|1", "758$1", , , , , [, , , , , , , , , [-1]], , "758", [, , , , , , , , , [-1]], [, , , , , , , , , [-1]], , , [, , , , , , , , , [-1]]],
5877
- LI: [, [, , "[68]\\d{8}|(?:[2378]\\d|90)\\d{5}", , , , , , , [7, 9]], [, , "(?:2(?:01|1[27]|2[024]|3\\d|6[02-578]|96)|3(?:[24]0|33|7[0135-7]|8[048]|9[0269]))\\d{4}", , , , "2345678", , , [7]], [, , "(?:6(?:(?:4[5-9]|5[0-46-9])\\d|6(?:[024-6]\\d|[17]0|3[7-9]))\\d|7(?:[37-9]\\d|42|56))\\d{4}", , , , "660234567"], [, , "8002[28]\\d\\d|80(?:05\\d|9)\\d{4}", , , , "8002222"], [
5960
+ LI: [, [, , "[68]\\d{8}|(?:[2378]\\d|90)\\d{5}", , , , , , , [7, 9]], [, , "(?:2(?:01|1[27]|2[024]|3\\d|6[02-578]|96)|3(?:[24]0|33|7[0135-7]|8[048]|9[0269]))\\d{4}", , , , "2345678", , , [7]], [, , "(?:6(?:(?:4[5-9]|5\\d)\\d|6(?:[024-6]\\d|[17]0|3[7-9]))\\d|7(?:[37-9]\\d|42|56))\\d{4}", , , , "660234567"], [, , "8002[28]\\d\\d|80(?:05\\d|9)\\d{4}", , , , "8002222"], [
5878
5961
  ,
5879
5962
  ,
5880
5963
  "90(?:02[258]|1(?:23|3[14])|66[136])\\d\\d",
@@ -5983,7 +6066,7 @@ const Z2 = (m) => {
5983
6066
  ,
5984
6067
  "$CC $1"
5985
6068
  ], [, "(\\d{2})(\\d{2})(\\d{2})(\\d{3})", "$1 $2 $3 $4", ["20"], , "$CC $1"], [, "(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["6"], , "$CC $1"], [, "(\\d{2})(\\d{2})(\\d{2})(\\d{2})(\\d{1,2})", "$1 $2 $3 $4 $5", ["2(?:[0367]|4[3-8])"], , "$CC $1"], [, "(\\d{2})(\\d{2})(\\d{2})(\\d{1,5})", "$1 $2 $3 $4", ["[3-57]|8[13-9]|9(?:0[89]|[2-579])|(?:2|80)[2-9]"], , "$CC $1"]], , [, , , , , , , , , [-1]], , , [, , , , , , , , , [-1]], [, , , , , , , , , [-1]], , , [, , , , , , , , , [-1]]],
5986
- LV: [, [, , "(?:[268]\\d|90)\\d{6}", , , , , , , [8]], [
6069
+ LV: [, [, , "(?:[268]\\d|78|90)\\d{6}", , , , , , , [8]], [
5987
6070
  ,
5988
6071
  ,
5989
6072
  "6\\d{7}",
@@ -5991,7 +6074,7 @@ const Z2 = (m) => {
5991
6074
  ,
5992
6075
  ,
5993
6076
  "63123456"
5994
- ], [, , "2333[0-8]\\d{3}|2(?:[0-24-9]\\d\\d|3(?:0[07]|[14-9]\\d|2[02-9]|3[0-24-9]))\\d{4}", , , , "21234567"], [, , "80\\d{6}", , , , "80123456"], [, , "90\\d{6}", , , , "90123456"], [, , "81\\d{6}", , , , "81123456"], [, , , , , , , , , [-1]], [, , , , , , , , , [-1]], "LV", 371, "00", , , , , , , , [[, "(\\d{2})(\\d{3})(\\d{3})", "$1 $2 $3", ["[269]|8[01]"]]], , [, , , , , , , , , [-1]], , , [, , , , , , , , , [-1]], [, , , , , , , , , [-1]], , , [, , , , , , , , , [-1]]],
6077
+ ], [, , "2333[0-8]\\d{3}|2(?:[0-24-9]\\d\\d|3(?:0[07]|[14-9]\\d|2[02-9]|3[0-24-9]))\\d{4}", , , , "21234567"], [, , "80\\d{6}", , , , "80123456"], [, , "90\\d{6}", , , , "90123456"], [, , "81\\d{6}", , , , "81123456"], [, , , , , , , , , [-1]], [, , , , , , , , , [-1]], "LV", 371, "00", , , , , , , , [[, "(\\d{2})(\\d{3})(\\d{3})", "$1 $2 $3", ["[2679]|8[01]"]]], , [, , , , , , , , , [-1]], , , [, , , , , , , , , [-1]], [, , , , , , , , , [-1]], , , [, , , , , , , , , [-1]]],
5995
6078
  LY: [, [, , "[2-9]\\d{8}", , , , , , , [9], [7]], [
5996
6079
  ,
5997
6080
  ,
@@ -6053,7 +6136,7 @@ const Z2 = (m) => {
6053
6136
  ,
6054
6137
  [8],
6055
6138
  [6]
6056
- ], [, , "6(?:[07-9]\\d|3[024]|6[0-25])\\d{5}", , , , "67622901", , , [8]], [, , "80(?:[0-2578]|9\\d)\\d{5}", , , , "80080002"], [, , "9(?:4[1568]|5[178])\\d{5}", , , , "94515151", , , [8]], [, , , , , , , , , [-1]], [, , , , , , , , , [-1]], [, , "78[1-49]\\d{5}", , , , "78108780", , , [8]], "ME", 382, "00", "0", , , "0", , , , [[, "(\\d{2})(\\d{3})(\\d{3,4})", "$1 $2 $3", ["[2-9]"], "0$1"]], , [, , , , , , , , , [-1]], , , [, , , , , , , , , [-1]], [, , "77[1-9]\\d{5}", , , , "77273012", , , [8]], , , [, , , , , , , , , [-1]]],
6139
+ ], [, , "6(?:[07-9]\\d|3[024]|6[0-25])\\d{5}", , , , "60123456", , , [8]], [, , "80(?:[0-2578]|9\\d)\\d{5}", , , , "80080002"], [, , "9(?:4[1568]|5[178])\\d{5}", , , , "94515151", , , [8]], [, , , , , , , , , [-1]], [, , , , , , , , , [-1]], [, , "78[1-49]\\d{5}", , , , "78108780", , , [8]], "ME", 382, "00", "0", , , "0", , , , [[, "(\\d{2})(\\d{3})(\\d{3,4})", "$1 $2 $3", ["[2-9]"], "0$1"]], , [, , , , , , , , , [-1]], , , [, , , , , , , , , [-1]], [, , "77[1-9]\\d{5}", , , , "77273012", , , [8]], , , [, , , , , , , , , [-1]]],
6057
6140
  MF: [
6058
6141
  ,
6059
6142
  [, , "(?:590\\d|7090)\\d{5}|(?:69|80|9\\d)\\d{7}", , , , , , , [9]],
@@ -7141,7 +7224,7 @@ const Z2 = (m) => {
7141
7224
  ,
7142
7225
  ,
7143
7226
  [8]
7144
- ], [, , "8980\\d{4}|(?:8(?:0[1-9]|[1-8]\\d|9[0-7])|9[0-8]\\d)\\d{5}", , , , "81234567", , , [8]], [, , "(?:18|8)00\\d{7}", , , , "18001234567", , , [10, 11]], [, , "1900\\d{7}", , , , "19001234567", , , [11]], [, , , , , , , , , [-1]], [, , , , , , , , , [-1]], [, , "(?:3[12]\\d|666)\\d{5}", , , , "31234567", , , [8]], "SG", 65, "0[0-3]\\d", , , , , , , , [[, "(\\d{4,5})", "$1", ["1[013-9]|77", "1(?:[013-8]|9(?:0[1-9]|[1-9]))|77"]], [, "(\\d{4})(\\d{4})", "$1 $2", ["[369]|8(?:0[1-9]|[1-9])"]], [, "(\\d{3})(\\d{3})(\\d{4})", "$1 $2 $3", ["8"]], [
7227
+ ], [, , "898[02-8]\\d{4}|(?:8(?:0[1-9]|[1-8]\\d|9[0-7])|9[0-8]\\d)\\d{5}", , , , "81234567", , , [8]], [, , "(?:18|8)00\\d{7}", , , , "18001234567", , , [10, 11]], [, , "1900\\d{7}", , , , "19001234567", , , [11]], [, , , , , , , , , [-1]], [, , , , , , , , , [-1]], [, , "(?:3[12]\\d|666)\\d{5}", , , , "31234567", , , [8]], "SG", 65, "0[0-3]\\d", , , , , , , , [[, "(\\d{4,5})", "$1", ["1[013-9]|77", "1(?:[013-8]|9(?:0[1-9]|[1-9]))|77"]], [, "(\\d{4})(\\d{4})", "$1 $2", ["[369]|8(?:0[1-9]|[1-9])"]], [, "(\\d{3})(\\d{3})(\\d{4})", "$1 $2 $3", ["8"]], [
7145
7228
  ,
7146
7229
  "(\\d{4})(\\d{4})(\\d{3})",
7147
7230
  "$1 $2 $3",
@@ -7719,7 +7802,7 @@ const Z2 = (m) => {
7719
7802
  ], [
7720
7803
  ,
7721
7804
  ,
7722
- "(?:3052(?:0[0-8]|[1-9]\\d)|5056(?:[0-35-9]\\d|4[0-68]))\\d{4}|(?:2742|305[3-9]|(?:472|983)[2-47-9]|505[2-57-9])\\d{6}|(?:2(?:0[1-35-9]|1[02-9]|2[03-57-9]|3[1459]|4[08]|5[1-46]|6[0279]|7[0269]|8[13])|3(?:0[1-47-9]|1[02-9]|2[0135-79]|3[0-24679]|4[167]|5[0-2]|6[01349]|8[056])|4(?:0[124-9]|1[02-579]|2[3-5]|3[0245]|4[023578]|58|6[349]|7[0589]|8[04])|5(?:0[1-47-9]|1[0235-8]|20|3[0149]|4[01]|5[179]|6[1-47]|7[0-5]|8[0256])|6(?:0[1-35-9]|1[024-9]|2[03689]|3[016]|4[0156]|5[01679]|6[0-279]|78|8[0-29])|7(?:0[1-46-8]|1[2-9]|2[04-8]|3[0-247]|4[0378]|5[47]|6[02359]|7[0-59]|8[156])|8(?:0[1-68]|1[02-8]|2[0168]|3[0-2589]|4[03578]|5[046-9]|6[02-5]|7[028])|9(?:0[1346-9]|1[02-9]|2[0589]|3[0146-8]|4[01357-9]|5[12469]|7[0-3589]|8[04-69]))[2-9]\\d{6}",
7805
+ "(?:3052(?:0[0-8]|[1-9]\\d)|5056(?:[0-35-9]\\d|4[0-68]))\\d{4}|(?:2742|305[3-9]|(?:472|983)[2-47-9]|505[2-57-9])\\d{6}|(?:2(?:0[1-35-9]|1[02-9]|2[03-57-9]|3[1459]|4[08]|5[1-46]|6[0279]|7[0269]|8[13])|3(?:0[1-47-9]|1[02-9]|2[0135-79]|3[0-24679]|4[167]|5[0-2]|6[01349]|8[056])|4(?:0[124-9]|1[02-579]|2[3-5]|3[0245]|4[023578]|58|6[349]|7[0589]|8[04])|5(?:0[1-47-9]|1[0235-8]|20|3[0149]|4[01]|5[179]|6[1-47]|7[0-5]|8[0256])|6(?:0[1-35-9]|1[024-9]|2[03689]|3[016]|4[0156]|5[01679]|6[0-279]|78|8[0-269])|7(?:0[1-46-8]|1[2-9]|2[04-8]|3[0-247]|4[0378]|5[47]|6[02359]|7[0-59]|8[156])|8(?:0[1-68]|1[02-8]|2[0168]|3[0-2589]|4[03578]|5[046-9]|6[02-5]|7[028])|9(?:0[1346-9]|1[02-9]|2[0589]|3[0146-8]|4[01357-9]|5[12469]|7[0-3589]|8[04-69]))[2-9]\\d{6}",
7723
7806
  ,
7724
7807
  ,
7725
7808
  ,
@@ -7731,7 +7814,7 @@ const Z2 = (m) => {
7731
7814
  ], [
7732
7815
  ,
7733
7816
  ,
7734
- "(?:3052(?:0[0-8]|[1-9]\\d)|5056(?:[0-35-9]\\d|4[0-68]))\\d{4}|(?:2742|305[3-9]|(?:472|983)[2-47-9]|505[2-57-9])\\d{6}|(?:2(?:0[1-35-9]|1[02-9]|2[03-57-9]|3[1459]|4[08]|5[1-46]|6[0279]|7[0269]|8[13])|3(?:0[1-47-9]|1[02-9]|2[0135-79]|3[0-24679]|4[167]|5[0-2]|6[01349]|8[056])|4(?:0[124-9]|1[02-579]|2[3-5]|3[0245]|4[023578]|58|6[349]|7[0589]|8[04])|5(?:0[1-47-9]|1[0235-8]|20|3[0149]|4[01]|5[179]|6[1-47]|7[0-5]|8[0256])|6(?:0[1-35-9]|1[024-9]|2[03689]|3[016]|4[0156]|5[01679]|6[0-279]|78|8[0-29])|7(?:0[1-46-8]|1[2-9]|2[04-8]|3[0-247]|4[0378]|5[47]|6[02359]|7[0-59]|8[156])|8(?:0[1-68]|1[02-8]|2[0168]|3[0-2589]|4[03578]|5[046-9]|6[02-5]|7[028])|9(?:0[1346-9]|1[02-9]|2[0589]|3[0146-8]|4[01357-9]|5[12469]|7[0-3589]|8[04-69]))[2-9]\\d{6}",
7817
+ "(?:3052(?:0[0-8]|[1-9]\\d)|5056(?:[0-35-9]\\d|4[0-68]))\\d{4}|(?:2742|305[3-9]|(?:472|983)[2-47-9]|505[2-57-9])\\d{6}|(?:2(?:0[1-35-9]|1[02-9]|2[03-57-9]|3[1459]|4[08]|5[1-46]|6[0279]|7[0269]|8[13])|3(?:0[1-47-9]|1[02-9]|2[0135-79]|3[0-24679]|4[167]|5[0-2]|6[01349]|8[056])|4(?:0[124-9]|1[02-579]|2[3-5]|3[0245]|4[023578]|58|6[349]|7[0589]|8[04])|5(?:0[1-47-9]|1[0235-8]|20|3[0149]|4[01]|5[179]|6[1-47]|7[0-5]|8[0256])|6(?:0[1-35-9]|1[024-9]|2[03689]|3[016]|4[0156]|5[01679]|6[0-279]|78|8[0-269])|7(?:0[1-46-8]|1[2-9]|2[04-8]|3[0-247]|4[0378]|5[47]|6[02359]|7[0-59]|8[156])|8(?:0[1-68]|1[02-8]|2[0168]|3[0-2589]|4[03578]|5[046-9]|6[02-5]|7[028])|9(?:0[1346-9]|1[02-9]|2[0589]|3[0146-8]|4[01357-9]|5[12469]|7[0-3589]|8[04-69]))[2-9]\\d{6}",
7735
7818
  ,
7736
7819
  ,
7737
7820
  ,
@@ -8232,13 +8315,13 @@ const Z2 = (m) => {
8232
8315
  ], [, , , , , , , , , [-1]], [, , , , , , , , , [-1]], "001", 888, , , , , , , , 1, [[, "(\\d{3})(\\d{3})(\\d{5})", "$1 $2 $3"]], , [, , , , , , , , , [-1]], , , [, , , , , , , , , [-1]], [, , "\\d{11}", , , , "12345678901"], , , [, , , , , , , , , [-1]]],
8233
8316
  979: [, [, , "[1359]\\d{8}", , , , , , , [9], [8]], [, , , , , , , , , [-1]], [, , , , , , , , , [-1]], [, , , , , , , , , [-1]], [, , "[1359]\\d{8}", , , , "123456789", , , , [8]], [, , , , , , , , , [-1]], [, , , , , , , , , [-1]], [, , , , , , , , , [-1]], "001", 979, , , , , , , , 1, [[, "(\\d)(\\d{4})(\\d{4})", "$1 $2 $3", ["[1359]"]]], , [, , , , , , , , , [-1]], , , [, , , , , , , , , [-1]], [, , , , , , , , , [-1]], , , [, , , , , , , , , [-1]]]
8234
8317
  };
8235
- function E() {
8318
+ function T() {
8236
8319
  this.g = {};
8237
8320
  }
8238
- E.h = void 0, E.g = function() {
8239
- return E.h ? E.h : E.h = new E();
8321
+ T.h = void 0, T.g = function() {
8322
+ return T.h ? T.h : T.h = new T();
8240
8323
  };
8241
- 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 = {
8324
+ 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" }, m2 = {
8242
8325
  0: "0",
8243
8326
  1: "1",
8244
8327
  2: "2",
@@ -8319,154 +8402,154 @@ const Z2 = (m) => {
8319
8402
  X: "9",
8320
8403
  Y: "9",
8321
8404
  Z: "9"
8322
- }, m2 = RegExp("[++]+"), Q = 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}.*/, w2 = 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٠-٩۰-۹])*\\.?$");
8405
+ }, y2 = RegExp("[++]+"), X = RegExp("^[++]+"), D1 = RegExp("([0-90-9٠-٩۰-۹])"), _2 = RegExp("[++0-90-9٠-٩۰-۹]"), I2 = /[\\\/] *x/, v2 = RegExp("[^0-90-9٠-٩۰-۹A-Za-z#]+$"), w2 = /(?:.*?[A-Za-z]){3}.*/, S2 = RegExp("^\\+([0-90-9٠-٩۰-۹]|[\\-\\.\\(\\)]?)*[0-90-9٠-٩۰-۹]([0-90-9٠-٩۰-۹]|[\\-\\.\\(\\)]?)*$"), b2 = RegExp("^([A-Za-z0-90-9٠-٩۰-۹]+((\\-)*[A-Za-z0-90-9٠-٩۰-۹])*\\.)*[A-Za-z]+((\\-)*[A-Za-z0-90-9٠-٩۰-۹])*\\.?$");
8323
8406
  function Y(d) {
8324
8407
  return "([0-90-9٠-٩۰-۹]{1," + d + "})";
8325
8408
  }
8326
8409
  function P1() {
8327
8410
  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") + "#?");
8328
8411
  }
8329
- var x1 = new RegExp("(?:" + P1() + ")$", "i"), b2 = new RegExp("^[0-90-9٠-٩۰-۹]{2}$|^[++]*(?:[-x‐-―−ー--/  ­​⁠ ()()[].\\[\\]/~⁓∼~*]*[0-90-9٠-٩۰-۹]){3,}[-x‐-―−ー--/  ­​⁠ ()()[].\\[\\]/~⁓∼~*A-Za-z0-90-9٠-٩۰-۹]*(?:" + P1() + ")?$", "i"), L2 = /(\$\d)/, N2 = /^\(?\$1\)?$/;
8330
- function R1(d) {
8331
- return 2 > d.length ? !1 : U(b2, d);
8332
- }
8412
+ var x1 = new RegExp("(?:" + P1() + ")$", "i"), L2 = new RegExp("^[0-90-9٠-٩۰-۹]{2}$|^[++]*(?:[-x‐-―−ー--/  ­​⁠ ()()[].\\[\\]/~⁓∼~*]*[0-90-9٠-٩۰-۹]){3,}[-x‐-―−ー--/  ­​⁠ ()()[].\\[\\]/~⁓∼~*A-Za-z0-90-9٠-٩۰-۹]*(?:" + P1() + ")?$", "i"), N2 = /(\$\d)/, A2 = /^\(?\$1\)?$/;
8333
8413
  function B1(d) {
8334
- return U(v2, d) ? o1(d, C2) : o1(d, C1);
8414
+ return 2 > d.length ? !1 : G(L2, d);
8415
+ }
8416
+ function R1(d) {
8417
+ return G(w2, d) ? s1(d, C2) : s1(d, g1);
8335
8418
  }
8336
8419
  function k1(d) {
8337
- var t = B1(d.toString());
8420
+ var t = R1(d.toString());
8338
8421
  B(d), d.g(t);
8339
8422
  }
8340
8423
  function O1(d) {
8341
- return d != null && (K(d, 9) != 1 || P(d, 9)[0] != -1);
8424
+ return d != null && (F(d, 9) != 1 || M(d, 9)[0] != -1);
8342
8425
  }
8343
- function o1(d, t) {
8344
- for (var $ = new T(), s, r = d.length, a = 0; a < r; ++a) s = d.charAt(a), s = t[s.toUpperCase()], s != null && $.g(s);
8345
- return $.toString();
8426
+ function s1(d, t) {
8427
+ for (var n = new N(), r, o = d.length, a = 0; a < o; ++a) r = d.charAt(a), r = t[r.toUpperCase()], r != null && n.g(r);
8428
+ return n.toString();
8346
8429
  }
8347
8430
  function G1(d) {
8348
- return d.length == 0 || N2.test(d);
8431
+ return d.length == 0 || A2.test(d);
8349
8432
  }
8350
- function a1(d) {
8433
+ function r1(d) {
8351
8434
  return d != null && isNaN(d) && d.toUpperCase() in M1;
8352
8435
  }
8353
- E.prototype.format = function(d, t) {
8354
- if (p(d, 2) == 0 && R(d, 5)) {
8355
- var $ = b(d, 5);
8356
- if (0 < $.length) return $;
8436
+ T.prototype.format = function(d, t) {
8437
+ if (m(d, 2) == 0 && x(d, 5)) {
8438
+ var n = w(d, 5);
8439
+ if (0 < n.length) return n;
8357
8440
  }
8358
- $ = b(d, 1);
8359
- var s = t1(d);
8360
- if (t == 0) return F1($, 0, s, "");
8361
- if (!($ in X)) return s;
8362
- var r = d1(this, $, e1($));
8363
- d = R(d, 3) && p(d, 3).length != 0 ? t == 3 ? ";ext=" + p(d, 3) : R(r, 13) ? p(r, 13) + b(d, 3) : " ext. " + b(d, 3) : "";
8441
+ n = w(d, 1);
8442
+ var r = d1(d);
8443
+ if (t == 0) return U1(n, 0, r, "");
8444
+ if (!(n in q)) return r;
8445
+ var o = Q(this, n, t1(n));
8446
+ d = x(d, 3) && m(d, 3).length != 0 ? t == 3 ? ";ext=" + m(d, 3) : x(o, 13) ? m(o, 13) + w(d, 3) : " ext. " + w(d, 3) : "";
8364
8447
  d: {
8365
- r = P(r, 20).length == 0 || t == 2 ? P(r, 19) : P(r, 20);
8366
- for (var a, u = r.length, c = 0; c < u; ++c) {
8367
- a = r[c];
8368
- var y = K(a, 3);
8369
- if ((y == 0 || s.search(p(a, 3, y - 1)) == 0) && (y = new RegExp(p(a, 1)), U(y, s))) {
8370
- r = a;
8448
+ o = M(o, 20).length == 0 || t == 2 ? M(o, 19) : M(o, 20);
8449
+ for (var a, l = o.length, p = 0; p < l; ++p) {
8450
+ a = o[p];
8451
+ var _ = F(a, 3);
8452
+ if ((_ == 0 || r.search(m(a, 3, _ - 1)) == 0) && (_ = new RegExp(m(a, 1)), G(_, r))) {
8453
+ o = a;
8371
8454
  break d;
8372
8455
  }
8373
8456
  }
8374
- r = null;
8457
+ o = null;
8375
8458
  }
8376
- return r != null && (u = r, r = b(u, 2), a = new RegExp(p(u, 1)), b(
8377
- u,
8459
+ return o != null && (l = o, o = w(l, 2), a = new RegExp(m(l, 1)), w(
8460
+ l,
8378
8461
  5
8379
- ), u = b(u, 4), s = t == 2 && u != null && 0 < u.length ? s.replace(a, r.replace(L2, u)) : s.replace(a, r), t == 3 && (s = s.replace(RegExp("^[-x‐-―−ー--/  ­​⁠ ()()[].\\[\\]/~⁓∼~]+"), ""), s = s.replace(RegExp("[-x‐-―−ー--/  ­​⁠ ()()[].\\[\\]/~⁓∼~]+", "g"), "-"))), F1($, t, s, d);
8462
+ ), l = w(l, 4), r = t == 2 && l != null && 0 < l.length ? r.replace(a, o.replace(N2, l)) : r.replace(a, o), t == 3 && (r = r.replace(RegExp("^[-x‐-―−ー--/  ­​⁠ ()()[].\\[\\]/~⁓∼~]+"), ""), r = r.replace(RegExp("[-x‐-―−ー--/  ­​⁠ ()()[].\\[\\]/~⁓∼~]+", "g"), "-"))), U1(n, t, r, d);
8380
8463
  };
8381
- function d1(d, t, $) {
8382
- return $ == "001" ? j(d, "" + t) : j(d, $);
8464
+ function Q(d, t, n) {
8465
+ return n == "001" ? V(d, "" + t) : V(d, n);
8383
8466
  }
8384
- function t1(d) {
8385
- if (!R(d, 2)) return "";
8386
- var t = "" + p(d, 2);
8387
- return R(d, 4) && p(d, 4) && 0 < b(d, 8) ? Array(b(d, 8) + 1).join("0") + t : t;
8467
+ function d1(d) {
8468
+ if (!x(d, 2)) return "";
8469
+ var t = "" + m(d, 2);
8470
+ return x(d, 4) && m(d, 4) && 0 < w(d, 8) ? Array(w(d, 8) + 1).join("0") + t : t;
8388
8471
  }
8389
- function F1(d, t, $, s) {
8472
+ function U1(d, t, n, r) {
8390
8473
  switch (t) {
8391
8474
  case 0:
8392
- return "+" + d + $ + s;
8475
+ return "+" + d + n + r;
8393
8476
  case 1:
8394
- return "+" + d + " " + $ + s;
8477
+ return "+" + d + " " + n + r;
8395
8478
  case 3:
8396
- return "tel:+" + d + "-" + $ + s;
8479
+ return "tel:+" + d + "-" + n + r;
8397
8480
  default:
8398
- return $ + s;
8481
+ return n + r;
8399
8482
  }
8400
8483
  }
8401
- function u1(d, t) {
8484
+ function o1(d, t) {
8402
8485
  switch (t) {
8403
8486
  case 4:
8404
- return p(d, 5);
8487
+ return m(d, 5);
8405
8488
  case 3:
8406
- return p(d, 4);
8489
+ return m(d, 4);
8407
8490
  case 1:
8408
- return p(d, 3);
8491
+ return m(d, 3);
8409
8492
  case 0:
8410
8493
  case 2:
8411
- return p(d, 2);
8494
+ return m(d, 2);
8412
8495
  case 5:
8413
- return p(d, 6);
8496
+ return m(d, 6);
8414
8497
  case 6:
8415
- return p(d, 8);
8498
+ return m(d, 8);
8416
8499
  case 7:
8417
- return p(d, 7);
8500
+ return m(d, 7);
8418
8501
  case 8:
8419
- return p(d, 21);
8502
+ return m(d, 21);
8420
8503
  case 9:
8421
- return p(d, 25);
8504
+ return m(d, 25);
8422
8505
  case 10:
8423
- return p(d, 28);
8506
+ return m(d, 28);
8424
8507
  default:
8425
- return p(d, 1);
8508
+ return m(d, 1);
8426
8509
  }
8427
8510
  }
8428
- function U1(d, t) {
8429
- var $ = V1(d, t);
8430
- return d = d1(d, b(t, 1), $), d == null ? -1 : (t = t1(t), m1(t, d));
8511
+ function F1(d, t) {
8512
+ var n = K1(d, t);
8513
+ return d = Q(d, w(t, 1), n), d == null ? -1 : (t = d1(t), m1(t, d));
8431
8514
  }
8432
8515
  function m1(d, t) {
8433
- return k(d, p(t, 1)) ? k(d, p(t, 5)) ? 4 : k(d, p(t, 4)) ? 3 : k(d, p(t, 6)) ? 5 : k(d, p(t, 8)) ? 6 : k(d, p(t, 7)) ? 7 : k(d, p(t, 21)) ? 8 : k(d, p(t, 25)) ? 9 : k(d, p(t, 28)) ? 10 : k(d, p(t, 2)) ? p(t, 18) || k(d, p(t, 3)) ? 2 : 0 : !p(t, 18) && k(d, p(t, 3)) ? 1 : -1 : -1;
8516
+ return O(d, m(t, 1)) ? O(d, m(t, 5)) ? 4 : O(d, m(t, 4)) ? 3 : O(d, m(t, 6)) ? 5 : O(d, m(t, 8)) ? 6 : O(d, m(t, 7)) ? 7 : O(d, m(t, 21)) ? 8 : O(d, m(t, 25)) ? 9 : O(d, m(t, 28)) ? 10 : O(d, m(t, 2)) ? m(t, 18) || O(d, m(t, 3)) ? 2 : 0 : !m(t, 18) && O(d, m(t, 3)) ? 1 : -1 : -1;
8434
8517
  }
8435
- function j(d, t) {
8518
+ function V(d, t) {
8436
8519
  if (t == null) return null;
8437
8520
  t = t.toUpperCase();
8438
- var $ = d.g[t];
8439
- if ($ == null) {
8440
- if ($ = M1[t], $ == null) return null;
8441
- $ = new q().g(z.m(), $), d.g[t] = $;
8521
+ var n = d.g[t];
8522
+ if (n == null) {
8523
+ if (n = M1[t], n == null) return null;
8524
+ n = new J().g(W.m(), n), d.g[t] = n;
8442
8525
  }
8443
- return $;
8526
+ return n;
8444
8527
  }
8445
- function k(d, t) {
8446
- var $ = d.length;
8447
- return 0 < K(t, 9) && P(t, 9).indexOf($) == -1 ? !1 : U(b(t, 2), d);
8528
+ function O(d, t) {
8529
+ var n = d.length;
8530
+ return 0 < F(t, 9) && M(t, 9).indexOf(n) == -1 ? !1 : G(w(t, 2), d);
8448
8531
  }
8449
- function T2(d, t) {
8450
- var $ = V1(d, t), s = b(t, 1), r = d1(d, s, $);
8451
- return r == null || $ != "001" && s != K1(d, $) ? r = !1 : (d = t1(t), r = m1(d, r) != -1), r;
8532
+ function E2(d, t) {
8533
+ var n = K1(d, t), r = w(t, 1), o = Q(d, r, n);
8534
+ return o == null || n != "001" && r != V1(d, n) ? o = !1 : (d = d1(t), o = m1(d, o) != -1), o;
8452
8535
  }
8453
- function V1(d, t) {
8536
+ function K1(d, t) {
8454
8537
  if (t == null) return null;
8455
- var $ = b(t, 1);
8456
- if ($ = X[$], $ == null) d = null;
8457
- else if ($.length == 1) d = $[0];
8538
+ var n = w(t, 1);
8539
+ if (n = q[n], n == null) d = null;
8540
+ else if (n.length == 1) d = n[0];
8458
8541
  else d: {
8459
- t = t1(t);
8460
- for (var s, r = $.length, a = 0; a < r; a++) {
8461
- s = $[a];
8462
- var u = j(d, s);
8463
- if (R(u, 23)) {
8464
- if (t.search(p(u, 23)) == 0) {
8465
- d = s;
8542
+ t = d1(t);
8543
+ for (var r, o = n.length, a = 0; a < o; a++) {
8544
+ r = n[a];
8545
+ var l = V(d, r);
8546
+ if (x(l, 23)) {
8547
+ if (t.search(m(l, 23)) == 0) {
8548
+ d = r;
8466
8549
  break d;
8467
8550
  }
8468
- } else if (m1(t, u) != -1) {
8469
- d = s;
8551
+ } else if (m1(t, l) != -1) {
8552
+ d = r;
8470
8553
  break d;
8471
8554
  }
8472
8555
  }
@@ -8474,151 +8557,151 @@ const Z2 = (m) => {
8474
8557
  }
8475
8558
  return d;
8476
8559
  }
8477
- function e1(d) {
8478
- return d = X[d], d == null ? "ZZ" : d[0];
8560
+ function t1(d) {
8561
+ return d = q[d], d == null ? "ZZ" : d[0];
8479
8562
  }
8480
- function K1(d, t) {
8481
- if (d = j(d, t), d == null) throw Error("Invalid region code: " + t);
8482
- return b(d, 10);
8563
+ function V1(d, t) {
8564
+ if (d = V(d, t), d == null) throw Error("Invalid region code: " + t);
8565
+ return w(d, 10);
8483
8566
  }
8484
- function l1(d, t, $, s) {
8485
- var r = u1($, s), a = K(r, 9) == 0 ? P(p($, 1), 9) : P(r, 9);
8486
- if (r = P(r, 10), s == 2) if (O1(u1($, 0))) d = u1($, 1), O1(d) && (a = a.concat(K(d, 9) == 0 ? P(p($, 1), 9) : P(d, 9)), a.sort(), r.length == 0 ? r = P(d, 10) : (r = r.concat(P(d, 10)), r.sort()));
8487
- else return l1(d, t, $, 1);
8488
- return a[0] == -1 ? 5 : (t = t.length, -1 < r.indexOf(t) ? 4 : ($ = a[0], $ == t ? 0 : $ > t ? 2 : a[a.length - 1] < t ? 3 : -1 < a.indexOf(t, 1) ? 0 : 5));
8567
+ function a1(d, t, n, r) {
8568
+ var o = o1(n, r), a = F(o, 9) == 0 ? M(m(n, 1), 9) : M(o, 9);
8569
+ if (o = M(o, 10), r == 2) if (O1(o1(n, 0))) d = o1(n, 1), O1(d) && (a = a.concat(F(d, 9) == 0 ? M(m(n, 1), 9) : M(d, 9)), a.sort(), o.length == 0 ? o = M(d, 10) : (o = o.concat(M(d, 10)), o.sort()));
8570
+ else return a1(d, t, n, 1);
8571
+ return a[0] == -1 ? 5 : (t = t.length, -1 < o.indexOf(t) ? 4 : (n = a[0], n == t ? 0 : n > t ? 2 : a[a.length - 1] < t ? 3 : -1 < a.indexOf(t, 1) ? 0 : 5));
8489
8572
  }
8490
- function h1(d, t, $) {
8491
- var s = t1(t);
8492
- return t = b(t, 1), t in X ? (t = d1(d, t, e1(t)), l1(d, s, t, $)) : 1;
8573
+ function u1(d, t, n) {
8574
+ var r = d1(t);
8575
+ return t = w(t, 1), t in q ? (t = Q(d, t, t1(t)), a1(d, r, t, n)) : 1;
8493
8576
  }
8494
8577
  function H1(d, t) {
8495
8578
  if (d = d.toString(), d.length == 0 || d.charAt(0) == "0") return 0;
8496
- for (var $, s = d.length, r = 1; 3 >= r && r <= s; ++r) if ($ = parseInt(d.substring(0, r), 10), $ in X) return t.g(d.substring(r)), $;
8579
+ for (var n, r = d.length, o = 1; 3 >= o && o <= r; ++o) if (n = parseInt(d.substring(0, o), 10), n in q) return t.g(d.substring(o)), n;
8497
8580
  return 0;
8498
8581
  }
8499
- function j1(d, t, $, s, r, a) {
8582
+ function j1(d, t, n, r, o, a) {
8500
8583
  if (t.length == 0) return 0;
8501
- t = new T(t);
8502
- var u;
8503
- $ != null && (u = p($, 11)), u == null && (u = "NonMatch");
8504
- var c = t.toString();
8505
- if (c.length == 0) u = 20;
8506
- else if (Q.test(c)) c = c.replace(Q, ""), B(t), t.g(B1(c)), u = 1;
8584
+ t = new N(t);
8585
+ var l;
8586
+ n != null && (l = m(n, 11)), l == null && (l = "NonMatch");
8587
+ var p = t.toString();
8588
+ if (p.length == 0) l = 20;
8589
+ else if (X.test(p)) p = p.replace(X, ""), B(t), t.g(R1(p)), l = 1;
8507
8590
  else {
8508
- if (c = new RegExp(u), k1(t), u = t.toString(), u.search(c) == 0) {
8509
- c = u.match(c)[0].length;
8510
- var y = u.substring(c).match(D1);
8511
- y && y[1] != null && 0 < y[1].length && o1(y[1], C1) == "0" ? u = !1 : (B(t), t.g(u.substring(c)), u = !0);
8512
- } else u = !1;
8513
- u = u ? 5 : 20;
8591
+ if (p = new RegExp(l), k1(t), l = t.toString(), l.search(p) == 0) {
8592
+ p = l.match(p)[0].length;
8593
+ var _ = l.substring(p).match(D1);
8594
+ _ && _[1] != null && 0 < _[1].length && s1(_[1], g1) == "0" ? l = !1 : (B(t), t.g(l.substring(p)), l = !0);
8595
+ } else l = !1;
8596
+ l = l ? 5 : 20;
8514
8597
  }
8515
- if (r && A(a, 6, u), u != 20) {
8598
+ if (o && E(a, 6, l), l != 20) {
8516
8599
  if (2 >= t.h.length) throw Error("Phone number too short after IDD");
8517
- if (d = H1(t, s), d != 0) return A(a, 1, d), d;
8600
+ if (d = H1(t, r), d != 0) return E(a, 1, d), d;
8518
8601
  throw Error("Invalid country calling code");
8519
8602
  }
8520
- return $ != null && (u = b($, 10), c = "" + u, y = t.toString(), y.lastIndexOf(c, 0) == 0 && (c = new T(y.substring(c.length)), y = p($, 1), y = new RegExp(b(y, 2)), W1(c, $, null), c = c.toString(), !U(y, t.toString()) && U(y, c) || l1(d, t.toString(), $, -1) == 3)) ? (s.g(c), r && A(a, 6, 10), A(a, 1, u), u) : (A(a, 1, 0), 0);
8521
- }
8522
- function W1(d, t, $) {
8523
- var s = d.toString(), r = s.length, a = p(t, 15);
8524
- if (r != 0 && a != null && a.length != 0) {
8525
- var u = new RegExp("^(?:" + a + ")");
8526
- if (r = u.exec(s)) {
8527
- a = new RegExp(b(p(t, 1), 2));
8528
- var c = U(a, s), y = r.length - 1;
8529
- t = p(t, 16), t == null || t.length == 0 || r[y] == null || r[y].length == 0 ? (!c || U(a, s.substring(r[0].length))) && ($ != null && 0 < y && r[y] != null && $.g(r[1]), d.set(s.substring(r[0].length))) : (s = s.replace(u, t), (!c || U(a, s)) && ($ != null && 0 < y && $.g(r[1]), d.set(s)));
8603
+ return n != null && (l = w(n, 10), p = "" + l, _ = t.toString(), _.lastIndexOf(p, 0) == 0 && (p = new N(_.substring(p.length)), _ = m(n, 1), _ = new RegExp(w(_, 2)), W1(p, n, null), p = p.toString(), !G(_, t.toString()) && G(_, p) || a1(d, t.toString(), n, -1) == 3)) ? (r.g(p), o && E(a, 6, 10), E(a, 1, l), l) : (E(a, 1, 0), 0);
8604
+ }
8605
+ function W1(d, t, n) {
8606
+ var r = d.toString(), o = r.length, a = m(t, 15);
8607
+ if (o != 0 && a != null && a.length != 0) {
8608
+ var l = new RegExp("^(?:" + a + ")");
8609
+ if (o = l.exec(r)) {
8610
+ a = new RegExp(w(m(t, 1), 2));
8611
+ var p = G(a, r), _ = o.length - 1;
8612
+ t = m(t, 16), t == null || t.length == 0 || o[_] == null || o[_].length == 0 ? (!p || G(a, r.substring(o[0].length))) && (n != null && 0 < _ && o[_] != null && n.g(o[1]), d.set(r.substring(o[0].length))) : (r = r.replace(l, t), (!p || G(a, r)) && (n != null && 0 < _ && n.g(o[1]), d.set(r)));
8530
8613
  }
8531
8614
  }
8532
8615
  }
8533
- function Z(d, t, $) {
8534
- if (!a1($) && 0 < t.length && t.charAt(0) != "+") throw Error("Invalid country calling code");
8535
- return z1(d, t, $, !0);
8616
+ function z(d, t, n) {
8617
+ if (!r1(n) && 0 < t.length && t.charAt(0) != "+") throw Error("Invalid country calling code");
8618
+ return z1(d, t, n, !0);
8536
8619
  }
8537
- function z1(d, t, $, s) {
8620
+ function z1(d, t, n, r) {
8538
8621
  if (t == null) throw Error("The string supplied did not seem to be a phone number");
8539
8622
  if (250 < t.length) throw Error("The string supplied is too long to be a phone number");
8540
- var r = new T(), a = t.indexOf(";phone-context=");
8623
+ var o = new N(), a = t.indexOf(";phone-context=");
8541
8624
  if (a === -1) a = null;
8542
8625
  else if (a += 15, a >= t.length) a = "";
8543
8626
  else {
8544
- var u = t.indexOf(";", a);
8545
- a = u !== -1 ? t.substring(a, u) : t.substring(a);
8627
+ var l = t.indexOf(";", a);
8628
+ a = l !== -1 ? t.substring(a, l) : t.substring(a);
8546
8629
  }
8547
- var c = a;
8548
- if (c == null ? u = !0 : c.length === 0 ? u = !1 : (u = w2.exec(c), c = S2.exec(c), u = u !== null || c !== null), !u || (a != null ? (a.charAt(0) === "+" && r.g(a), a = t.indexOf("tel:"), r.g(t.substring(0 <= a ? a + 4 : 0, t.indexOf(";phone-context=")))) : (a = r.g, u = t ?? "", c = u.search(y2), 0 <= c ? (u = u.substring(c), u = u.replace(I2, ""), c = u.search(_2), 0 <= c && (u = u.substring(0, c))) : u = "", a.call(r, u)), a = r.toString(), u = a.indexOf(";isub="), 0 < u && (B(r), r.g(a.substring(0, u))), !R1(r.toString()))) throw Error("The string supplied did not seem to be a phone number");
8549
- if (a = r.toString(), !(a1($) || a != null && 0 < a.length && Q.test(a))) throw Error("Invalid country calling code");
8550
- a = new H(), s && A(a, 5, t);
8630
+ var p = a;
8631
+ if (p == null ? l = !0 : p.length === 0 ? l = !1 : (l = S2.exec(p), p = b2.exec(p), l = l !== null || p !== null), !l || (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, l = t ?? "", p = l.search(_2), 0 <= p ? (l = l.substring(p), l = l.replace(v2, ""), p = l.search(I2), 0 <= p && (l = l.substring(0, p))) : l = "", a.call(o, l)), a = o.toString(), l = a.indexOf(";isub="), 0 < l && (B(o), o.g(a.substring(0, l))), !B1(o.toString()))) throw Error("The string supplied did not seem to be a phone number");
8632
+ if (a = o.toString(), !(r1(n) || a != null && 0 < a.length && X.test(a))) throw Error("Invalid country calling code");
8633
+ a = new K(), r && E(a, 5, t);
8551
8634
  d: {
8552
- if (t = r.toString(), u = t.search(x1), 0 <= u && R1(t.substring(0, u))) {
8553
- c = t.match(x1);
8554
- for (var y = c.length, V = 1; V < y; ++V) if (c[V] != null && 0 < c[V].length) {
8555
- B(r), r.g(t.substring(0, u)), t = c[V];
8635
+ if (t = o.toString(), l = t.search(x1), 0 <= l && B1(t.substring(0, l))) {
8636
+ p = t.match(x1);
8637
+ for (var _ = p.length, U = 1; U < _; ++U) if (p[U] != null && 0 < p[U].length) {
8638
+ B(o), o.g(t.substring(0, l)), t = p[U];
8556
8639
  break d;
8557
8640
  }
8558
8641
  }
8559
8642
  t = "";
8560
8643
  }
8561
- 0 < t.length && A(a, 3, t), u = j(d, $), t = new T(), c = 0, y = r.toString();
8644
+ 0 < t.length && E(a, 3, t), l = V(d, n), t = new N(), p = 0, _ = o.toString();
8562
8645
  try {
8563
- c = j1(d, y, u, t, s, a);
8564
- } catch (I1) {
8565
- if (I1.message == "Invalid country calling code" && Q.test(y)) {
8566
- if (y = y.replace(Q, ""), c = j1(d, y, u, t, s, a), c == 0) throw I1;
8567
- } else throw I1;
8646
+ p = j1(d, _, l, t, r, a);
8647
+ } catch (_1) {
8648
+ if (_1.message == "Invalid country calling code" && X.test(_)) {
8649
+ if (_ = _.replace(X, ""), p = j1(d, _, l, t, r, a), p == 0) throw _1;
8650
+ } else throw _1;
8568
8651
  }
8569
- if (c != 0 ? (r = e1(c), r != $ && (u = d1(d, c, r))) : (k1(r), t.g(r.toString()), $ != null ? (c = b(u, 10), A(
8652
+ if (p != 0 ? (o = t1(p), o != n && (l = Q(d, p, o))) : (k1(o), t.g(o.toString()), n != null ? (p = w(l, 10), E(
8570
8653
  a,
8571
8654
  1,
8572
- c
8573
- )) : s && (delete a.h[6], a.g && delete a.g[6])), 2 > t.h.length || (u != null && ($ = new T(), r = new T(t.toString()), W1(r, u, $), d = l1(d, r.toString(), u, -1), d != 2 && d != 4 && d != 5 && (t = r, s && 0 < $.toString().length && A(a, 7, $.toString()))), s = t.toString(), d = s.length, 2 > d)) throw Error("The string supplied is too short to be a phone number");
8655
+ p
8656
+ )) : r && (delete a.h[6], a.g && delete a.g[6])), 2 > t.h.length || (l != null && (n = new N(), o = new N(t.toString()), W1(o, l, n), d = a1(d, o.toString(), l, -1), d != 2 && d != 4 && d != 5 && (t = o, r && 0 < n.toString().length && E(a, 7, n.toString()))), r = t.toString(), d = r.length, 2 > d)) throw Error("The string supplied is too short to be a phone number");
8574
8657
  if (17 < d) throw Error("The string supplied is too long to be a phone number");
8575
- if (1 < s.length && s.charAt(0) == "0") {
8576
- for (A(a, 4, !0), d = 1; d < s.length - 1 && s.charAt(d) == "0"; ) d++;
8577
- d != 1 && A(a, 8, d);
8658
+ if (1 < r.length && r.charAt(0) == "0") {
8659
+ for (E(a, 4, !0), d = 1; d < r.length - 1 && r.charAt(d) == "0"; ) d++;
8660
+ d != 1 && E(a, 8, d);
8578
8661
  }
8579
- return A(a, 2, parseInt(s, 10)), a;
8662
+ return E(a, 2, parseInt(r, 10)), a;
8580
8663
  }
8581
- function U(d, t) {
8664
+ function G(d, t) {
8582
8665
  return !!((d = t.match(new RegExp("^(?:" + (typeof d == "string" ? d : d.source) + ")$", "i"))) && d[0].length == t.length);
8583
8666
  }
8584
- function A2(d) {
8585
- 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 = E.g(), this.$ = 0, this.h = new T(), this.ha = !1, this.o = "", this.g = new T(), this.j = [], this.ka = d, this.l = J1(this, this.ka);
8667
+ function T2(d) {
8668
+ this.fa = RegExp(" "), this.ja = "", this.v = new N(), this.da = "", this.s = new N(), this.ba = new N(), this.u = !0, this.ea = this.ca = this.la = !1, this.ga = T.g(), this.$ = 0, this.h = new N(), this.ha = !1, this.o = "", this.g = new N(), this.j = [], this.ka = d, this.l = J1(this, this.ka);
8586
8669
  }
8587
- var Z1 = new z();
8588
- A(Z1, 11, "NA");
8589
- var E2 = RegExp("^[-x‐-―−ー--/  ­​⁠ ()()[].\\[\\]/~⁓∼~]*\\$1[-x‐-―−ー--/  ­​⁠ ()()[].\\[\\]/~⁓∼~]*(\\$\\d[-x‐-―−ー--/  ­​⁠ ()()[].\\[\\]/~⁓∼~]*)*$"), Y1 = /[- ]/;
8670
+ var Z1 = new W();
8671
+ E(Z1, 11, "NA");
8672
+ var M2 = RegExp("^[-x‐-―−ー--/  ­​⁠ ()()[].\\[\\]/~⁓∼~]*\\$1[-x‐-―−ー--/  ­​⁠ ()()[].\\[\\]/~⁓∼~]*(\\$\\d[-x‐-―−ー--/  ­​⁠ ()()[].\\[\\]/~⁓∼~]*)*$"), Y1 = /[- ]/;
8590
8673
  function J1(d, t) {
8591
- var $ = d.ga;
8592
- return t = a1(t) ? K1($, t) : 0, d = j(d.ga, e1(t)), d ?? Z1;
8674
+ var n = d.ga;
8675
+ return t = r1(t) ? V1(n, t) : 0, d = V(d.ga, t1(t)), d ?? Z1;
8593
8676
  }
8594
8677
  function q1(d) {
8595
- for (var t = d.j.length, $ = 0; $ < t; ++$) {
8596
- var s = d.j[$], r = b(s, 1);
8597
- if (d.da == r) return !1;
8598
- var a = d, u = s, c = b(u, 1);
8678
+ for (var t = d.j.length, n = 0; n < t; ++n) {
8679
+ var r = d.j[n], o = w(r, 1);
8680
+ if (d.da == o) return !1;
8681
+ var a = d, l = r, p = w(l, 1);
8599
8682
  B(a.v);
8600
- var y = a;
8601
- u = b(u, 2);
8602
- var V = "999999999999999".match(c)[0];
8603
- if (V.length < y.g.h.length ? y = "" : (y = V.replace(new RegExp(c, "g"), u), y = y.replace(RegExp("9", "g"), " ")), 0 < y.length ? (a.v.g(y), a = !0) : a = !1, a) return d.da = r, d.ha = Y1.test(p(s, 4)), d.$ = 0, !0;
8683
+ var _ = a;
8684
+ l = w(l, 2);
8685
+ var U = "999999999999999".match(p)[0];
8686
+ if (U.length < _.g.h.length ? _ = "" : (_ = U.replace(new RegExp(p, "g"), l), _ = _.replace(RegExp("9", "g"), " ")), 0 < _.length ? (a.v.g(_), a = !0) : a = !1, a) return d.da = o, d.ha = Y1.test(m(r, 4)), d.$ = 0, !0;
8604
8687
  }
8605
8688
  return d.u = !1;
8606
8689
  }
8607
8690
  function X1(d, t) {
8608
- for (var $ = [], s = t.length - 3, r = d.j.length, a = 0; a < r; ++a) {
8609
- var u = d.j[a];
8610
- K(u, 3) == 0 ? $.push(d.j[a]) : (u = p(u, 3, Math.min(s, K(u, 3) - 1)), t.search(u) == 0 && $.push(d.j[a]));
8691
+ for (var n = [], r = t.length - 3, o = d.j.length, a = 0; a < o; ++a) {
8692
+ var l = d.j[a];
8693
+ F(l, 3) == 0 ? n.push(d.j[a]) : (l = m(l, 3, Math.min(r, F(l, 3) - 1)), t.search(l) == 0 && n.push(d.j[a]));
8611
8694
  }
8612
- d.j = $;
8695
+ d.j = n;
8613
8696
  }
8614
- function M2(d, t) {
8697
+ function D2(d, t) {
8615
8698
  d.s.g(t);
8616
- var $ = t;
8617
- 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) {
8699
+ var n = t;
8700
+ if (D1.test(n) || d.s.h.length == 1 && y2.test(n) ? (t == "+" ? (n = t, d.ba.g(t)) : (n = g1[t], d.ba.g(n), d.g.g(n)), t = n) : (d.u = !1, d.la = !0), !d.u) {
8618
8701
  if (!d.la) {
8619
8702
  if ($2(d)) {
8620
- if (i2(d)) return Q1(d);
8621
- } 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 != e2(d)) return d.h.g(" "), Q1(d);
8703
+ if (n2(d)) return Q1(d);
8704
+ } 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(), n = t.lastIndexOf(d.o), B(d.h), d.h.g(t.substring(0, n))), d.o != e2(d)) return d.h.g(" "), Q1(d);
8622
8705
  }
8623
8706
  return d.s.toString();
8624
8707
  }
@@ -8629,165 +8712,165 @@ const Z2 = (m) => {
8629
8712
  return d.s.toString();
8630
8713
  case 3:
8631
8714
  if ($2(d)) d.ea = !0;
8632
- else return d.o = e2(d), y1(d);
8715
+ else return d.o = e2(d), C1(d);
8633
8716
  default:
8634
- 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);
8717
+ return d.ea ? (n2(d) && (d.ea = !1), d.h.toString() + d.g.toString()) : 0 < d.j.length ? (t = i2(d, t), n = d2(d), 0 < n.length ? n : (X1(d, d.g.toString()), q1(d) ? t2(d) : d.u ? l1(d, t) : d.s.toString())) : C1(d);
8635
8718
  }
8636
8719
  }
8637
8720
  function Q1(d) {
8638
- return d.u = !0, d.ea = !1, d.j = [], d.$ = 0, B(d.v), d.da = "", y1(d);
8721
+ return d.u = !0, d.ea = !1, d.j = [], d.$ = 0, B(d.v), d.da = "", C1(d);
8639
8722
  }
8640
8723
  function d2(d) {
8641
- for (var t = d.g.toString(), $ = d.j.length, s = 0; s < $; ++s) {
8642
- var r = d.j[s], a = b(r, 1);
8643
- if (new RegExp("^(?:" + a + ")$").test(t) && (d.ha = Y1.test(p(r, 4)), r = t.replace(new RegExp(a, "g"), p(r, 2)), r = c1(d, r), o1(r, g2) == d.ba)) return r;
8724
+ for (var t = d.g.toString(), n = d.j.length, r = 0; r < n; ++r) {
8725
+ var o = d.j[r], a = w(o, 1);
8726
+ if (new RegExp("^(?:" + a + ")$").test(t) && (d.ha = Y1.test(m(o, 4)), o = t.replace(new RegExp(a, "g"), m(o, 2)), o = l1(d, o), s1(o, m2) == d.ba)) return o;
8644
8727
  }
8645
8728
  return "";
8646
8729
  }
8647
- function c1(d, t) {
8648
- var $ = d.h.h.length;
8649
- return d.ha && 0 < $ && d.h.toString().charAt($ - 1) != " " ? d.h + " " + t : d.h + t;
8730
+ function l1(d, t) {
8731
+ var n = d.h.h.length;
8732
+ return d.ha && 0 < n && d.h.toString().charAt(n - 1) != " " ? d.h + " " + t : d.h + t;
8650
8733
  }
8651
- function y1(d) {
8734
+ function C1(d) {
8652
8735
  var t = d.g.toString();
8653
8736
  if (3 <= t.length) {
8654
- for (var $ = d.ca && d.o.length == 0 && 0 < K(d.l, 20) ? P(d.l, 20) : P(d.l, 19), s = $.length, r = 0; r < s; ++r) {
8655
- var a = $[r];
8656
- 0 < d.o.length && G1(b(a, 4)) && !p(a, 6) && !R(a, 5) || (d.o.length != 0 || d.ca || G1(b(a, 4)) || p(a, 6)) && E2.test(b(a, 2)) && d.j.push(a);
8737
+ for (var n = d.ca && d.o.length == 0 && 0 < F(d.l, 20) ? M(d.l, 20) : M(d.l, 19), r = n.length, o = 0; o < r; ++o) {
8738
+ var a = n[o];
8739
+ 0 < d.o.length && G1(w(a, 4)) && !m(a, 6) && !x(a, 5) || (d.o.length != 0 || d.ca || G1(w(a, 4)) || m(a, 6)) && M2.test(w(a, 2)) && d.j.push(a);
8657
8740
  }
8658
8741
  return X1(d, t), t = d2(d), 0 < t.length ? t : q1(d) ? t2(d) : d.s.toString();
8659
8742
  }
8660
- return c1(d, t);
8743
+ return l1(d, t);
8661
8744
  }
8662
8745
  function t2(d) {
8663
- var t = d.g.toString(), $ = t.length;
8664
- if (0 < $) {
8665
- for (var s = "", r = 0; r < $; r++) s = n2(d, t.charAt(r));
8666
- return d.u ? c1(d, s) : d.s.toString();
8746
+ var t = d.g.toString(), n = t.length;
8747
+ if (0 < n) {
8748
+ for (var r = "", o = 0; o < n; o++) r = i2(d, t.charAt(o));
8749
+ return d.u ? l1(d, r) : d.s.toString();
8667
8750
  }
8668
8751
  return d.h.toString();
8669
8752
  }
8670
8753
  function e2(d) {
8671
- var t = d.g.toString(), $ = 0;
8672
- if (p(d.l, 10) != 1) var s = !1;
8673
- else s = d.g.toString(), s = s.charAt(0) == "1" && s.charAt(1) != "0" && s.charAt(1) != "1";
8674
- return s ? ($ = 1, d.h.g("1").g(" "), d.ca = !0) : R(d.l, 15) && (s = new RegExp("^(?:" + p(d.l, 15) + ")"), s = t.match(s), s != null && s[0] != null && 0 < s[0].length && (d.ca = !0, $ = s[0].length, d.h.g(t.substring(0, $)))), B(d.g), d.g.g(t.substring($)), t.substring(0, $);
8754
+ var t = d.g.toString(), n = 0;
8755
+ if (m(d.l, 10) != 1) var r = !1;
8756
+ else r = d.g.toString(), r = r.charAt(0) == "1" && r.charAt(1) != "0" && r.charAt(1) != "1";
8757
+ return r ? (n = 1, d.h.g("1").g(" "), d.ca = !0) : x(d.l, 15) && (r = new RegExp("^(?:" + m(d.l, 15) + ")"), r = t.match(r), r != null && r[0] != null && 0 < r[0].length && (d.ca = !0, n = r[0].length, d.h.g(t.substring(0, n)))), B(d.g), d.g.g(t.substring(n)), t.substring(0, n);
8675
8758
  }
8676
8759
  function $2(d) {
8677
- var t = d.ba.toString(), $ = new RegExp("^(?:\\+|" + p(d.l, 11) + ")");
8678
- 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;
8760
+ var t = d.ba.toString(), n = new RegExp("^(?:\\+|" + m(d.l, 11) + ")");
8761
+ return n = t.match(n), n != null && n[0] != null && 0 < n[0].length ? (d.ca = !0, n = n[0].length, B(d.g), d.g.g(t.substring(n)), B(d.h), d.h.g(t.substring(0, n)), t.charAt(0) != "+" && d.h.g(" "), !0) : !1;
8679
8762
  }
8680
- function i2(d) {
8763
+ function n2(d) {
8681
8764
  if (d.g.h.length == 0) return !1;
8682
- var t = new T(), $ = H1(d.g, t);
8683
- 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 = J1(d, t)), d.h.g("" + $).g(" "), d.o = "", !0);
8684
- }
8685
- function n2(d, t) {
8686
- var $ = d.v.toString();
8687
- if (0 <= $.substring(d.$).search(d.fa)) {
8688
- var s = $.search(d.fa);
8689
- return t = $.replace(d.fa, t), B(d.v), d.v.g(t), d.$ = s, t.substring(0, d.$ + 1);
8765
+ var t = new N(), n = H1(d.g, t);
8766
+ return n == 0 ? !1 : (B(d.g), d.g.g(t.toString()), t = t1(n), t == "001" ? d.l = V(d.ga, "" + n) : t != d.ka && (d.l = J1(d, t)), d.h.g("" + n).g(" "), d.o = "", !0);
8767
+ }
8768
+ function i2(d, t) {
8769
+ var n = d.v.toString();
8770
+ if (0 <= n.substring(d.$).search(d.fa)) {
8771
+ var r = n.search(d.fa);
8772
+ return t = n.replace(d.fa, t), B(d.v), d.v.g(t), d.$ = r, t.substring(0, d.$ + 1);
8690
8773
  }
8691
8774
  return d.j.length == 1 && (d.u = !1), d.da = "", d.s.toString();
8692
8775
  }
8693
8776
  const s2 = (d) => {
8694
8777
  const t = [];
8695
8778
  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);
8696
- }, _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 };
8779
+ }, 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 };
8697
8780
  e("intlTelInputUtilsTemp", {}), e("intlTelInputUtilsTemp.formatNumberAsYouType", (d, t) => {
8698
8781
  try {
8699
- const $ = d.replace(/[^+0-9]/g, ""), s = new A2(t);
8782
+ const n = d.replace(/[^+0-9]/g, ""), r = new T2(t);
8700
8783
  t = "";
8701
- for (let r = 0; r < $.length; r++) s.ja = M2(s, $.charAt(r)), t = s.ja;
8784
+ for (let o = 0; o < n.length; o++) r.ja = D2(r, n.charAt(o)), t = r.ja;
8702
8785
  return t;
8703
8786
  } catch {
8704
8787
  return d;
8705
8788
  }
8706
- }), e("intlTelInputUtilsTemp.formatNumber", (d, t, $) => {
8789
+ }), e("intlTelInputUtilsTemp.formatNumber", (d, t, n) => {
8707
8790
  try {
8708
- const r = E.g(), a = Z(r, d, t);
8709
- var s = h1(r, a, -1);
8710
- return s == 0 || s == 4 ? r.format(a, typeof $ > "u" ? 0 : $) : d;
8791
+ const o = T.g(), a = z(o, d, t);
8792
+ var r = u1(o, a, -1);
8793
+ return r == 0 || r == 4 ? o.format(a, typeof n > "u" ? 0 : n) : d;
8711
8794
  } catch {
8712
8795
  return d;
8713
8796
  }
8714
- }), e("intlTelInputUtilsTemp.getExampleNumber", (d, t, $, s) => {
8797
+ }), e("intlTelInputUtilsTemp.getExampleNumber", (d, t, n, r) => {
8715
8798
  try {
8716
- const y = E.g();
8799
+ const _ = T.g();
8717
8800
  d: {
8718
- var r = y;
8719
- if (a1(d)) {
8720
- var a = u1(j(r, d), $);
8801
+ var o = _;
8802
+ if (r1(d)) {
8803
+ var a = o1(V(o, d), n);
8721
8804
  try {
8722
- if (R(a, 6)) {
8723
- var u = p(a, 6), c = z1(r, u, d, !1);
8805
+ if (x(a, 6)) {
8806
+ var l = m(a, 6), p = z1(o, l, d, !1);
8724
8807
  break d;
8725
8808
  }
8726
8809
  } catch {
8727
8810
  }
8728
8811
  }
8729
- c = null;
8812
+ p = null;
8730
8813
  }
8731
- return y.format(c, s ? 0 : t ? 2 : 1);
8814
+ return _.format(p, r ? 0 : t ? 2 : 1);
8732
8815
  } catch {
8733
8816
  return "";
8734
8817
  }
8735
8818
  }), e("intlTelInputUtilsTemp.getExtension", (d, t) => {
8736
8819
  try {
8737
- return p(Z(E.g(), d, t), 3);
8820
+ return m(z(T.g(), d, t), 3);
8738
8821
  } catch {
8739
8822
  return "";
8740
8823
  }
8741
8824
  }), e("intlTelInputUtilsTemp.getNumberType", (d, t) => {
8742
8825
  try {
8743
- const $ = E.g(), s = Z($, d, t);
8744
- return U1($, s);
8826
+ const n = T.g(), r = z(n, d, t);
8827
+ return F1(n, r);
8745
8828
  } catch {
8746
8829
  return -99;
8747
8830
  }
8748
8831
  }), e("intlTelInputUtilsTemp.getValidationError", (d, t) => {
8749
8832
  if (!t) return 1;
8750
8833
  try {
8751
- const $ = E.g(), s = Z($, d, t);
8752
- return h1($, s, -1);
8753
- } catch ($) {
8754
- 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;
8834
+ const n = T.g(), r = z(n, d, t);
8835
+ return u1(n, r, -1);
8836
+ } catch (n) {
8837
+ return n.message === "Invalid country calling code" ? 1 : 3 >= d.length || n.message === "Phone number too short after IDD" || n.message === "The string supplied is too short to be a phone number" ? 2 : n.message === "The string supplied is too long to be a phone number" ? 3 : -99;
8755
8838
  }
8756
- }), e("intlTelInputUtilsTemp.isValidNumber", (d, t, $) => {
8839
+ }), e("intlTelInputUtilsTemp.isValidNumber", (d, t, n) => {
8757
8840
  try {
8758
- const s = E.g(), r = Z(s, d, t), a = T2(s, r);
8759
- if ($) {
8760
- const u = s2($).map((c) => _1[c]);
8761
- return a && u.includes(U1(s, r));
8841
+ const r = T.g(), o = z(r, d, t), a = E2(r, o);
8842
+ if (n) {
8843
+ const l = s2(n).map((p) => y1[p]);
8844
+ return a && l.includes(F1(r, o));
8762
8845
  }
8763
8846
  return a;
8764
8847
  } catch {
8765
8848
  return !1;
8766
8849
  }
8767
- }), e("intlTelInputUtilsTemp.isPossibleNumber", (d, t, $) => {
8850
+ }), e("intlTelInputUtilsTemp.isPossibleNumber", (d, t, n) => {
8768
8851
  try {
8769
- const s = E.g(), r = Z(s, d, t);
8770
- if ($) {
8771
- const a = s2($);
8772
- for (let u of a) if (h1(s, r, _1[u]) === 0) return !0;
8852
+ const r = T.g(), o = z(r, d, t);
8853
+ if (n) {
8854
+ const a = s2(n);
8855
+ for (let l of a) if (u1(r, o, y1[l]) === 0) return !0;
8773
8856
  return !1;
8774
8857
  }
8775
- return h1(s, r, -1) === 0;
8858
+ return u1(r, o, -1) === 0;
8776
8859
  } catch {
8777
8860
  return !1;
8778
8861
  }
8779
8862
  }), e("intlTelInputUtilsTemp.getCoreNumber", (d, t) => {
8780
8863
  try {
8781
- return p(Z(E.g(), d, t), 2).toString();
8864
+ return m(z(T.g(), d, t), 2).toString();
8782
8865
  } catch {
8783
8866
  return "";
8784
8867
  }
8785
- }), 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 });
8868
+ }), 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 });
8786
8869
  })();
8787
- const h2 = typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : void 0, Y2 = h2.intlTelInputUtilsTemp;
8870
+ const h2 = typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : void 0, i0 = h2.intlTelInputUtilsTemp;
8788
8871
  delete h2.intlTelInputUtilsTemp;
8789
- C.utils = Y2;
8790
- const q2 = {
8872
+ y.utils = i0;
8873
+ const r0 = {
8791
8874
  __name: "IntlTelInputWithUtils",
8792
8875
  props: /* @__PURE__ */ r2({
8793
8876
  disabled: {
@@ -8819,42 +8902,42 @@ const q2 = {
8819
8902
  "changeValidity",
8820
8903
  "changeErrorCode"
8821
8904
  ], ["update:modelValue"]),
8822
- setup(m, { expose: e, emit: i }) {
8823
- const n = D2(m, "modelValue"), o = m, l = i, f = v1(), h = v1(), _ = v1(!1), v = () => h.value ? o.options.strictMode ? h.value.isValidNumberPrecise() : h.value.isValidNumber() : null, w = () => {
8824
- let S = v();
8825
- _.value !== S && (_.value = S, l("changeValidity", !!S), l(
8905
+ setup(f, { expose: e, emit: $ }) {
8906
+ const i = P2(f, "modelValue"), s = f, u = $, h = I1(), c = I1(), C = I1(!1), g = () => c.value ? s.options.strictMode ? c.value.isValidNumberPrecise() : c.value.isValidNumber() : null, I = () => {
8907
+ let v = g();
8908
+ C.value !== v && (C.value = v, u("changeValidity", !!v), u(
8826
8909
  "changeErrorCode",
8827
- S ? null : h.value.getValidationError()
8910
+ v ? null : c.value.getValidationError()
8828
8911
  ));
8829
- }, g = () => {
8830
- var S;
8831
- l("changeNumber", ((S = h.value) == null ? void 0 : S.getNumber()) ?? ""), w();
8832
- }, I = () => {
8833
- var S;
8834
- l("changeCountry", ((S = h.value) == null ? void 0 : S.getSelectedCountryData().iso2) ?? ""), g(), w();
8912
+ }, S = () => {
8913
+ var v;
8914
+ u("changeNumber", ((v = c.value) == null ? void 0 : v.getNumber()) ?? ""), I();
8915
+ }, R = () => {
8916
+ var v;
8917
+ u("changeCountry", ((v = c.value) == null ? void 0 : v.getSelectedCountryData().iso2) ?? ""), S(), I();
8835
8918
  };
8836
- return P2(() => {
8837
- f.value && (h.value = C(f.value, o.options), o.value && h.value.setNumber(o.value), o.disabled && h.value.setDisabled(o.disabled), _.value = v());
8838
- }), x2(
8839
- () => o.disabled,
8840
- (S) => {
8841
- var M;
8842
- return (M = h.value) == null ? void 0 : M.setDisabled(S);
8919
+ return x2(() => {
8920
+ h.value && (c.value = y(h.value, s.options), s.value && c.value.setNumber(s.value), s.disabled && c.value.setDisabled(s.disabled), C.value = g());
8921
+ }), B2(
8922
+ () => s.disabled,
8923
+ (v) => {
8924
+ var D;
8925
+ return (D = c.value) == null ? void 0 : D.setDisabled(v);
8843
8926
  }
8844
8927
  ), R2(() => {
8845
- var S;
8846
- return (S = h.value) == null ? void 0 : S.destroy();
8847
- }), e({ instance: h, input: f }), (S, M) => B2((O2(), k2("input", G2({
8928
+ var v;
8929
+ return (v = c.value) == null ? void 0 : v.destroy();
8930
+ }), e({ instance: c, input: h }), (v, D) => k2((G2(), O2("input", U2({
8848
8931
  ref_key: "input",
8849
- ref: f,
8850
- "onUpdate:modelValue": M[0] || (M[0] = (O) => n.value = O),
8932
+ ref: h,
8933
+ "onUpdate:modelValue": D[0] || (D[0] = (A) => i.value = A),
8851
8934
  type: "tel",
8852
- onCountrychange: I,
8853
- onInput: g
8854
- }, m.inputProps), null, 16)), [
8935
+ onCountrychange: R,
8936
+ onInput: S
8937
+ }, f.inputProps), null, 16)), [
8855
8938
  [
8856
8939
  F2,
8857
- n.value,
8940
+ i.value,
8858
8941
  void 0,
8859
8942
  { lazy: !0 }
8860
8943
  ]
@@ -8862,5 +8945,5 @@ const q2 = {
8862
8945
  }
8863
8946
  };
8864
8947
  export {
8865
- q2 as default
8948
+ r0 as default
8866
8949
  };