intl-tel-input 25.8.3 → 25.8.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +7 -7
- package/angular/README.md +1 -1
- package/angular/build/IntlTelInput.js +10 -4
- package/angular/build/IntlTelInputWithUtils.js +10 -4
- package/build/js/data.js +1 -1
- package/build/js/data.min.js +1 -1
- package/build/js/intlTelInput.js +11 -5
- package/build/js/intlTelInput.min.js +4 -4
- package/build/js/intlTelInputWithUtils.js +11 -5
- package/build/js/intlTelInputWithUtils.min.js +4 -4
- package/package.json +1 -1
- package/react/README.md +1 -1
- package/react/build/IntlTelInput.cjs +10 -4
- package/react/build/IntlTelInput.js +10 -4
- package/react/build/IntlTelInputWithUtils.cjs +10 -4
- package/react/build/IntlTelInputWithUtils.js +10 -4
- package/vue/README.md +1 -1
- package/vue/build/IntlTelInput.mjs +204 -204
- package/vue/build/IntlTelInputWithUtils.mjs +390 -390
|
@@ -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
|
|
2
|
-
const
|
|
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 = [
|
|
3
3
|
[
|
|
4
4
|
"af",
|
|
5
5
|
// Afghanistan
|
|
@@ -1322,18 +1322,18 @@ const F2 = [
|
|
|
1322
1322
|
// Zimbabwe
|
|
1323
1323
|
"263"
|
|
1324
1324
|
]
|
|
1325
|
-
],
|
|
1326
|
-
for (const
|
|
1327
|
-
|
|
1325
|
+
], J = [];
|
|
1326
|
+
for (const m of U2)
|
|
1327
|
+
J.push({
|
|
1328
1328
|
name: "",
|
|
1329
1329
|
// populated in the plugin
|
|
1330
|
-
iso2:
|
|
1331
|
-
dialCode:
|
|
1332
|
-
priority:
|
|
1333
|
-
areaCodes:
|
|
1330
|
+
iso2: m[0],
|
|
1331
|
+
dialCode: m[1],
|
|
1332
|
+
priority: m[2] || 0,
|
|
1333
|
+
areaCodes: m[3] || null,
|
|
1334
1334
|
nodeById: {},
|
|
1335
1335
|
// populated by the plugin
|
|
1336
|
-
nationalPrefix:
|
|
1336
|
+
nationalPrefix: m[4] || null
|
|
1337
1337
|
});
|
|
1338
1338
|
const V2 = {
|
|
1339
1339
|
ad: "Andorra",
|
|
@@ -1591,13 +1591,13 @@ const V2 = {
|
|
|
1591
1591
|
ac: "Ascension Island",
|
|
1592
1592
|
xk: "Kosovo"
|
|
1593
1593
|
}, a2 = { ...V2, ...K2 };
|
|
1594
|
-
for (const
|
|
1595
|
-
|
|
1594
|
+
for (const m of J)
|
|
1595
|
+
m.name = a2[m.iso2];
|
|
1596
1596
|
let H2 = 0;
|
|
1597
|
-
const S1 = (
|
|
1597
|
+
const S1 = (m) => typeof window < "u" && typeof window.matchMedia == "function" && window.matchMedia(m).matches, j2 = () => {
|
|
1598
1598
|
if (typeof navigator < "u" && typeof window < "u") {
|
|
1599
|
-
const
|
|
1600
|
-
return
|
|
1599
|
+
const m = /Android.+Mobile|webOS|iPhone|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent), e = S1("(max-width: 500px)"), i = S1("(max-height: 600px)"), n = S1("(pointer: coarse)");
|
|
1600
|
+
return m || e || n && i;
|
|
1601
1601
|
}
|
|
1602
1602
|
return !1;
|
|
1603
1603
|
}, l2 = {
|
|
@@ -1667,30 +1667,30 @@ const S1 = (y) => typeof window < "u" && typeof window.matchMedia == "function"
|
|
|
1667
1667
|
"887",
|
|
1668
1668
|
"888",
|
|
1669
1669
|
"889"
|
|
1670
|
-
], f1 = (
|
|
1671
|
-
const e = f1(
|
|
1670
|
+
], f1 = (m) => m.replace(/\D/g, ""), o2 = (m = "") => m.normalize("NFD").replace(/[\u0300-\u036f]/g, "").toLowerCase(), u2 = (m) => {
|
|
1671
|
+
const e = f1(m);
|
|
1672
1672
|
if (e.charAt(0) === "1") {
|
|
1673
1673
|
const i = e.substring(1, 4);
|
|
1674
1674
|
return W2.includes(i);
|
|
1675
1675
|
}
|
|
1676
1676
|
return !1;
|
|
1677
|
-
}, z2 = (
|
|
1677
|
+
}, z2 = (m, e, i, n) => {
|
|
1678
1678
|
if (i === 0 && !n)
|
|
1679
1679
|
return 0;
|
|
1680
1680
|
let o = 0;
|
|
1681
1681
|
for (let l = 0; l < e.length; l++) {
|
|
1682
|
-
if (/[+0-9]/.test(e[l]) && o++, o ===
|
|
1682
|
+
if (/[+0-9]/.test(e[l]) && o++, o === m && !n)
|
|
1683
1683
|
return l + 1;
|
|
1684
|
-
if (n && o ===
|
|
1684
|
+
if (n && o === m + 1)
|
|
1685
1685
|
return l;
|
|
1686
1686
|
}
|
|
1687
1687
|
return e.length;
|
|
1688
|
-
},
|
|
1689
|
-
const n = document.createElement(
|
|
1688
|
+
}, N = (m, e, i) => {
|
|
1689
|
+
const n = document.createElement(m);
|
|
1690
1690
|
return e && Object.entries(e).forEach(([o, l]) => n.setAttribute(o, l)), i && i.appendChild(n), n;
|
|
1691
|
-
},
|
|
1692
|
-
const { instances: i } =
|
|
1693
|
-
Object.values(i).forEach((n) => n[
|
|
1691
|
+
}, $1 = (m, ...e) => {
|
|
1692
|
+
const { instances: i } = C;
|
|
1693
|
+
Object.values(i).forEach((n) => n[m](...e));
|
|
1694
1694
|
};
|
|
1695
1695
|
class p1 {
|
|
1696
1696
|
/**
|
|
@@ -1732,9 +1732,9 @@ class p1 {
|
|
|
1732
1732
|
this.options.countryOrder && (this.options.countryOrder = this.options.countryOrder.map((e) => e.toLowerCase())), this.countries.sort((e, i) => {
|
|
1733
1733
|
const { countryOrder: n } = this.options;
|
|
1734
1734
|
if (n) {
|
|
1735
|
-
const o = n.indexOf(e.iso2), l = n.indexOf(i.iso2),
|
|
1736
|
-
if (
|
|
1737
|
-
return
|
|
1735
|
+
const o = n.indexOf(e.iso2), l = n.indexOf(i.iso2), g = o > -1, h = l > -1;
|
|
1736
|
+
if (g || h)
|
|
1737
|
+
return g && h ? o - l : g ? -1 : 1;
|
|
1738
1738
|
}
|
|
1739
1739
|
return e.name.localeCompare(i.name);
|
|
1740
1740
|
});
|
|
@@ -1755,18 +1755,18 @@ class p1 {
|
|
|
1755
1755
|
const n = e.map(
|
|
1756
1756
|
(o) => o.toLowerCase()
|
|
1757
1757
|
);
|
|
1758
|
-
this.countries =
|
|
1758
|
+
this.countries = J.filter(
|
|
1759
1759
|
(o) => n.includes(o.iso2)
|
|
1760
1760
|
);
|
|
1761
1761
|
} else if (i.length) {
|
|
1762
1762
|
const n = i.map(
|
|
1763
1763
|
(o) => o.toLowerCase()
|
|
1764
1764
|
);
|
|
1765
|
-
this.countries =
|
|
1765
|
+
this.countries = J.filter(
|
|
1766
1766
|
(o) => !n.includes(o.iso2)
|
|
1767
1767
|
);
|
|
1768
1768
|
} else
|
|
1769
|
-
this.countries =
|
|
1769
|
+
this.countries = J;
|
|
1770
1770
|
}
|
|
1771
1771
|
//* Translate Countries by object literal provided on config.
|
|
1772
1772
|
_translateCountryNames() {
|
|
@@ -1785,8 +1785,8 @@ class p1 {
|
|
|
1785
1785
|
const i = this.dialCodeToIso2Map[e.dialCode][0];
|
|
1786
1786
|
for (const n of e.areaCodes) {
|
|
1787
1787
|
for (let o = 1; o < n.length; o++) {
|
|
1788
|
-
const l = n.substring(0, o),
|
|
1789
|
-
this._addToDialCodeMap(i,
|
|
1788
|
+
const l = n.substring(0, o), g = e.dialCode + l;
|
|
1789
|
+
this._addToDialCodeMap(i, g), this._addToDialCodeMap(e.iso2, g);
|
|
1790
1790
|
}
|
|
1791
1791
|
this._addToDialCodeMap(e.iso2, e.dialCode + n);
|
|
1792
1792
|
}
|
|
@@ -1794,7 +1794,7 @@ class p1 {
|
|
|
1794
1794
|
}
|
|
1795
1795
|
//* Generate all of the markup for the plugin: the selected country overlay, and the dropdown.
|
|
1796
1796
|
_generateMarkup() {
|
|
1797
|
-
var f, I,
|
|
1797
|
+
var f, I, O;
|
|
1798
1798
|
this.telInput.classList.add("iti__tel-input"), !this.telInput.hasAttribute("autocomplete") && !(this.telInput.form && this.telInput.form.hasAttribute("autocomplete")) && this.telInput.setAttribute("autocomplete", "off");
|
|
1799
1799
|
const {
|
|
1800
1800
|
allowDropdown: e,
|
|
@@ -1802,24 +1802,24 @@ class p1 {
|
|
|
1802
1802
|
showFlags: n,
|
|
1803
1803
|
containerClass: o,
|
|
1804
1804
|
hiddenInput: l,
|
|
1805
|
-
dropdownContainer:
|
|
1806
|
-
fixDropdownWidth:
|
|
1807
|
-
useFullscreenPopup:
|
|
1808
|
-
countrySearch:
|
|
1809
|
-
i18n:
|
|
1810
|
-
} = this.options,
|
|
1805
|
+
dropdownContainer: g,
|
|
1806
|
+
fixDropdownWidth: h,
|
|
1807
|
+
useFullscreenPopup: _,
|
|
1808
|
+
countrySearch: L,
|
|
1809
|
+
i18n: v
|
|
1810
|
+
} = this.options, S = p1._buildClassNames({
|
|
1811
1811
|
iti: !0,
|
|
1812
1812
|
"iti--allow-dropdown": e,
|
|
1813
1813
|
"iti--show-flags": n,
|
|
1814
|
-
"iti--inline-dropdown": !
|
|
1814
|
+
"iti--inline-dropdown": !_,
|
|
1815
1815
|
[o]: !!o
|
|
1816
|
-
}),
|
|
1817
|
-
if ((f = this.telInput.parentNode) == null || f.insertBefore(
|
|
1818
|
-
this.countryContainer =
|
|
1816
|
+
}), T = N("div", { class: S });
|
|
1817
|
+
if ((f = this.telInput.parentNode) == null || f.insertBefore(T, this.telInput), e || n || i) {
|
|
1818
|
+
this.countryContainer = N(
|
|
1819
1819
|
"div",
|
|
1820
1820
|
{ class: "iti__country-container" },
|
|
1821
|
-
|
|
1822
|
-
), this.showSelectedCountryOnLeft ? this.countryContainer.style.left = "0px" : this.countryContainer.style.right = "0px", e ? (this.selectedCountry =
|
|
1821
|
+
T
|
|
1822
|
+
), this.showSelectedCountryOnLeft ? this.countryContainer.style.left = "0px" : this.countryContainer.style.right = "0px", e ? (this.selectedCountry = N(
|
|
1823
1823
|
"button",
|
|
1824
1824
|
{
|
|
1825
1825
|
type: "button",
|
|
@@ -1830,92 +1830,92 @@ class p1 {
|
|
|
1830
1830
|
"aria-controls": `iti-${this.id}__dropdown-content`
|
|
1831
1831
|
},
|
|
1832
1832
|
this.countryContainer
|
|
1833
|
-
), this.telInput.disabled && this.selectedCountry.setAttribute("disabled", "true")) : this.selectedCountry =
|
|
1833
|
+
), this.telInput.disabled && this.selectedCountry.setAttribute("disabled", "true")) : this.selectedCountry = N(
|
|
1834
1834
|
"div",
|
|
1835
1835
|
{ class: "iti__selected-country" },
|
|
1836
1836
|
this.countryContainer
|
|
1837
1837
|
);
|
|
1838
|
-
const
|
|
1838
|
+
const G = N(
|
|
1839
1839
|
"div",
|
|
1840
1840
|
{ class: "iti__selected-country-primary" },
|
|
1841
1841
|
this.selectedCountry
|
|
1842
1842
|
);
|
|
1843
|
-
if (this.selectedCountryInner =
|
|
1843
|
+
if (this.selectedCountryInner = N(
|
|
1844
1844
|
"div",
|
|
1845
1845
|
{ class: "iti__flag" },
|
|
1846
|
-
|
|
1847
|
-
), e && (this.dropdownArrow =
|
|
1846
|
+
G
|
|
1847
|
+
), e && (this.dropdownArrow = N(
|
|
1848
1848
|
"div",
|
|
1849
1849
|
{ class: "iti__arrow", "aria-hidden": "true" },
|
|
1850
|
-
|
|
1851
|
-
)), i && (this.selectedDialCode =
|
|
1850
|
+
G
|
|
1851
|
+
)), i && (this.selectedDialCode = N(
|
|
1852
1852
|
"div",
|
|
1853
1853
|
{ class: "iti__selected-dial-code", dir: "ltr" },
|
|
1854
1854
|
this.selectedCountry
|
|
1855
1855
|
)), e) {
|
|
1856
|
-
const
|
|
1857
|
-
if (this.dropdownContent =
|
|
1856
|
+
const F = h ? "" : "iti--flexible-dropdown-width";
|
|
1857
|
+
if (this.dropdownContent = N("div", {
|
|
1858
1858
|
id: `iti-${this.id}__dropdown-content`,
|
|
1859
|
-
class: `iti__dropdown-content iti__hide ${
|
|
1859
|
+
class: `iti__dropdown-content iti__hide ${F}`,
|
|
1860
1860
|
role: "dialog",
|
|
1861
1861
|
"aria-modal": "true"
|
|
1862
|
-
}),
|
|
1863
|
-
const
|
|
1862
|
+
}), L) {
|
|
1863
|
+
const D = N(
|
|
1864
1864
|
"div",
|
|
1865
1865
|
{ class: "iti__search-input-wrapper" },
|
|
1866
1866
|
this.dropdownContent
|
|
1867
1867
|
);
|
|
1868
|
-
this.searchIcon =
|
|
1868
|
+
this.searchIcon = N(
|
|
1869
1869
|
"span",
|
|
1870
1870
|
{
|
|
1871
1871
|
class: "iti__search-icon",
|
|
1872
1872
|
"aria-hidden": "true"
|
|
1873
1873
|
},
|
|
1874
|
-
|
|
1874
|
+
D
|
|
1875
1875
|
), this.searchIcon.innerHTML = `
|
|
1876
1876
|
<svg class="iti__search-icon-svg" width="14" height="14" viewBox="0 0 24 24" focusable="false" aria-hidden="true">
|
|
1877
1877
|
<circle cx="11" cy="11" r="7" />
|
|
1878
1878
|
<line x1="21" y1="21" x2="16.65" y2="16.65" />
|
|
1879
|
-
</svg>`, this.searchInput =
|
|
1879
|
+
</svg>`, this.searchInput = N(
|
|
1880
1880
|
"input",
|
|
1881
1881
|
{
|
|
1882
1882
|
id: `iti-${this.id}__search-input`,
|
|
1883
1883
|
// Chrome says inputs need either a name or an id
|
|
1884
1884
|
type: "search",
|
|
1885
1885
|
class: "iti__search-input",
|
|
1886
|
-
placeholder:
|
|
1886
|
+
placeholder: v.searchPlaceholder,
|
|
1887
1887
|
// 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
|
|
1888
1888
|
role: "combobox",
|
|
1889
1889
|
"aria-expanded": "true",
|
|
1890
|
-
"aria-label":
|
|
1890
|
+
"aria-label": v.searchPlaceholder,
|
|
1891
1891
|
"aria-controls": `iti-${this.id}__country-listbox`,
|
|
1892
1892
|
"aria-autocomplete": "list",
|
|
1893
1893
|
autocomplete: "off"
|
|
1894
1894
|
},
|
|
1895
|
-
|
|
1896
|
-
), this.searchClearButton =
|
|
1895
|
+
D
|
|
1896
|
+
), this.searchClearButton = N(
|
|
1897
1897
|
"button",
|
|
1898
1898
|
{
|
|
1899
1899
|
type: "button",
|
|
1900
1900
|
class: "iti__search-clear iti__hide",
|
|
1901
|
-
"aria-label":
|
|
1901
|
+
"aria-label": v.clearSearchAriaLabel,
|
|
1902
1902
|
tabindex: "-1"
|
|
1903
1903
|
},
|
|
1904
|
-
|
|
1904
|
+
D
|
|
1905
1905
|
);
|
|
1906
|
-
const
|
|
1906
|
+
const i1 = `iti-${this.id}-clear-mask`;
|
|
1907
1907
|
this.searchClearButton.innerHTML = `
|
|
1908
1908
|
<svg class="iti__search-clear-svg" width="12" height="12" viewBox="0 0 16 16" aria-hidden="true" focusable="false">
|
|
1909
|
-
<mask id="${
|
|
1909
|
+
<mask id="${i1}" maskUnits="userSpaceOnUse">
|
|
1910
1910
|
<rect width="16" height="16" fill="white" />
|
|
1911
1911
|
<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" />
|
|
1912
1912
|
</mask>
|
|
1913
|
-
<circle cx="8" cy="8" r="8" class="iti__search-clear-bg" mask="url(#${
|
|
1914
|
-
</svg>`, this.searchResultsA11yText =
|
|
1913
|
+
<circle cx="8" cy="8" r="8" class="iti__search-clear-bg" mask="url(#${i1})" />
|
|
1914
|
+
</svg>`, this.searchResultsA11yText = N(
|
|
1915
1915
|
"span",
|
|
1916
1916
|
{ class: "iti__a11y-text" },
|
|
1917
1917
|
this.dropdownContent
|
|
1918
|
-
), this.searchNoResults =
|
|
1918
|
+
), this.searchNoResults = N(
|
|
1919
1919
|
"div",
|
|
1920
1920
|
{
|
|
1921
1921
|
class: "iti__no-results iti__hide",
|
|
@@ -1923,52 +1923,52 @@ class p1 {
|
|
|
1923
1923
|
// all a11y messaging happens in this.searchResultsA11yText
|
|
1924
1924
|
},
|
|
1925
1925
|
this.dropdownContent
|
|
1926
|
-
), this.searchNoResults.textContent =
|
|
1926
|
+
), this.searchNoResults.textContent = v.zeroSearchResults;
|
|
1927
1927
|
}
|
|
1928
|
-
if (this.countryList =
|
|
1928
|
+
if (this.countryList = N(
|
|
1929
1929
|
"ul",
|
|
1930
1930
|
{
|
|
1931
1931
|
class: "iti__country-list",
|
|
1932
1932
|
id: `iti-${this.id}__country-listbox`,
|
|
1933
1933
|
role: "listbox",
|
|
1934
|
-
"aria-label":
|
|
1934
|
+
"aria-label": v.countryListAriaLabel
|
|
1935
1935
|
},
|
|
1936
1936
|
this.dropdownContent
|
|
1937
|
-
), this._appendListItems(),
|
|
1938
|
-
const
|
|
1937
|
+
), this._appendListItems(), L && this._updateSearchResultsA11yText(), g) {
|
|
1938
|
+
const D = p1._buildClassNames({
|
|
1939
1939
|
iti: !0,
|
|
1940
1940
|
"iti--container": !0,
|
|
1941
|
-
"iti--fullscreen-popup":
|
|
1942
|
-
"iti--inline-dropdown": !
|
|
1941
|
+
"iti--fullscreen-popup": _,
|
|
1942
|
+
"iti--inline-dropdown": !_,
|
|
1943
1943
|
[o]: !!o
|
|
1944
1944
|
});
|
|
1945
|
-
this.dropdown =
|
|
1945
|
+
this.dropdown = N("div", { class: D }), this.dropdown.appendChild(this.dropdownContent);
|
|
1946
1946
|
} else
|
|
1947
1947
|
this.countryContainer.appendChild(this.dropdownContent);
|
|
1948
1948
|
}
|
|
1949
1949
|
}
|
|
1950
|
-
if (
|
|
1951
|
-
const
|
|
1952
|
-
if (
|
|
1953
|
-
const
|
|
1954
|
-
|
|
1950
|
+
if (T.appendChild(this.telInput), this._updateInputPadding(), l) {
|
|
1951
|
+
const G = this.telInput.getAttribute("name") || "", F = l(G);
|
|
1952
|
+
if (F.phone) {
|
|
1953
|
+
const D = (I = this.telInput.form) == null ? void 0 : I.querySelector(`input[name="${F.phone}"]`);
|
|
1954
|
+
D ? this.hiddenInput = D : (this.hiddenInput = N("input", {
|
|
1955
1955
|
type: "hidden",
|
|
1956
|
-
name:
|
|
1957
|
-
}),
|
|
1956
|
+
name: F.phone
|
|
1957
|
+
}), T.appendChild(this.hiddenInput));
|
|
1958
1958
|
}
|
|
1959
|
-
if (
|
|
1960
|
-
const
|
|
1961
|
-
|
|
1959
|
+
if (F.country) {
|
|
1960
|
+
const D = (O = this.telInput.form) == null ? void 0 : O.querySelector(`input[name="${F.country}"]`);
|
|
1961
|
+
D ? this.hiddenInputCountry = D : (this.hiddenInputCountry = N("input", {
|
|
1962
1962
|
type: "hidden",
|
|
1963
|
-
name:
|
|
1964
|
-
}),
|
|
1963
|
+
name: F.country
|
|
1964
|
+
}), T.appendChild(this.hiddenInputCountry));
|
|
1965
1965
|
}
|
|
1966
1966
|
}
|
|
1967
1967
|
}
|
|
1968
1968
|
//* For each country: add a country list item <li> to the countryList <ul> container.
|
|
1969
1969
|
_appendListItems() {
|
|
1970
1970
|
for (let e = 0; e < this.countries.length; e++) {
|
|
1971
|
-
const i = this.countries[e], n = e === 0 ? "iti__highlight" : "", o =
|
|
1971
|
+
const i = this.countries[e], n = e === 0 ? "iti__highlight" : "", o = N(
|
|
1972
1972
|
"li",
|
|
1973
1973
|
{
|
|
1974
1974
|
id: `iti-${this.id}__item-${i.iso2}`,
|
|
@@ -1990,12 +1990,12 @@ class p1 {
|
|
|
1990
1990
|
//* 1. Extracting a dial code from the given number
|
|
1991
1991
|
//* 2. Using explicit initialCountry
|
|
1992
1992
|
_setInitialState(e = !1) {
|
|
1993
|
-
const i = this.telInput.getAttribute("value"), n = this.telInput.value, l = i && i.charAt(0) === "+" && (!n || n.charAt(0) !== "+") ? i : n,
|
|
1994
|
-
if (
|
|
1993
|
+
const i = this.telInput.getAttribute("value"), n = this.telInput.value, l = i && i.charAt(0) === "+" && (!n || n.charAt(0) !== "+") ? i : n, g = this._getDialCode(l), h = u2(l), { initialCountry: _, geoIpLookup: L } = this.options, v = _ === "auto" && L;
|
|
1994
|
+
if (g && !h)
|
|
1995
1995
|
this._updateCountryFromNumber(l);
|
|
1996
|
-
else if (!
|
|
1997
|
-
const
|
|
1998
|
-
|
|
1996
|
+
else if (!v || e) {
|
|
1997
|
+
const S = _ ? _.toLowerCase() : "";
|
|
1998
|
+
S && this._getCountryData(S, !0) ? this._setCountry(S) : g && h ? this._setCountry("us") : this._setCountry();
|
|
1999
1999
|
}
|
|
2000
2000
|
l && this._updateValFromNumber(l);
|
|
2001
2001
|
}
|
|
@@ -2031,21 +2031,21 @@ class p1 {
|
|
|
2031
2031
|
//* Init many requests: utils script / geo ip lookup.
|
|
2032
2032
|
_initRequests() {
|
|
2033
2033
|
let { loadUtils: e, initialCountry: i, geoIpLookup: n } = this.options;
|
|
2034
|
-
e && !
|
|
2034
|
+
e && !C.utils ? (this._handlePageLoad = () => {
|
|
2035
2035
|
var l;
|
|
2036
|
-
window.removeEventListener("load", this._handlePageLoad), (l =
|
|
2036
|
+
window.removeEventListener("load", this._handlePageLoad), (l = C.attachUtils(e)) == null || l.catch(() => {
|
|
2037
2037
|
});
|
|
2038
|
-
},
|
|
2038
|
+
}, C.documentReady() ? this._handlePageLoad() : window.addEventListener("load", this._handlePageLoad)) : this.resolveUtilsScriptPromise(), i === "auto" && n && !this.selectedCountryData.iso2 ? this._loadAutoCountry() : this.resolveAutoCountryPromise();
|
|
2039
2039
|
}
|
|
2040
2040
|
//* Perform the geo ip lookup.
|
|
2041
2041
|
_loadAutoCountry() {
|
|
2042
|
-
|
|
2042
|
+
C.autoCountry ? this.handleAutoCountry() : C.startedLoadingAutoCountry || (C.startedLoadingAutoCountry = !0, typeof this.options.geoIpLookup == "function" && this.options.geoIpLookup(
|
|
2043
2043
|
(e = "") => {
|
|
2044
2044
|
const i = e.toLowerCase();
|
|
2045
|
-
i && this._getCountryData(i, !0) ? (
|
|
2045
|
+
i && this._getCountryData(i, !0) ? (C.autoCountry = i, setTimeout(() => $1("handleAutoCountry"))) : (this._setInitialState(!0), $1("rejectAutoCountryPromise"));
|
|
2046
2046
|
},
|
|
2047
2047
|
() => {
|
|
2048
|
-
this._setInitialState(!0),
|
|
2048
|
+
this._setInitialState(!0), $1("rejectAutoCountryPromise");
|
|
2049
2049
|
}
|
|
2050
2050
|
));
|
|
2051
2051
|
}
|
|
@@ -2054,31 +2054,31 @@ class p1 {
|
|
|
2054
2054
|
}
|
|
2055
2055
|
//* Initialize the tel input listeners.
|
|
2056
2056
|
_initTelInputListeners() {
|
|
2057
|
-
const { strictMode: e, formatAsYouType: i, separateDialCode: n,
|
|
2057
|
+
const { strictMode: e, formatAsYouType: i, separateDialCode: n, allowDropdown: o, countrySearch: l } = this.options;
|
|
2058
2058
|
let g = !1;
|
|
2059
|
-
new RegExp("\\p{L}", "u").test(this.telInput.value) && (g = !0), this._handleInputEvent = (
|
|
2060
|
-
if (this.isAndroid && (
|
|
2061
|
-
const
|
|
2062
|
-
this.telInput.value =
|
|
2059
|
+
new RegExp("\\p{L}", "u").test(this.telInput.value) && (g = !0), this._handleInputEvent = (h) => {
|
|
2060
|
+
if (this.isAndroid && (h == null ? void 0 : h.data) === "+" && n && o && l) {
|
|
2061
|
+
const S = this.telInput.selectionStart || 0, T = this.telInput.value.substring(0, S - 1), f = this.telInput.value.substring(S);
|
|
2062
|
+
this.telInput.value = T + f, this._openDropdownWithPlus();
|
|
2063
2063
|
return;
|
|
2064
2064
|
}
|
|
2065
2065
|
this._updateCountryFromNumber(this.telInput.value) && this._triggerCountryChange();
|
|
2066
|
-
const
|
|
2067
|
-
|
|
2068
|
-
const
|
|
2069
|
-
if (i && !g && !
|
|
2070
|
-
const
|
|
2071
|
-
this.telInput.value =
|
|
2066
|
+
const _ = (h == null ? void 0 : h.data) && /[^+0-9]/.test(h.data), L = (h == null ? void 0 : h.inputType) === "insertFromPaste" && this.telInput.value;
|
|
2067
|
+
_ || L && !e ? g = !0 : /[^+0-9]/.test(this.telInput.value) || (g = !1);
|
|
2068
|
+
const v = (h == null ? void 0 : h.detail) && h.detail.isSetNumber;
|
|
2069
|
+
if (i && !g && !v) {
|
|
2070
|
+
const S = this.telInput.selectionStart || 0, f = this.telInput.value.substring(0, S).replace(/[^+0-9]/g, "").length, I = (h == null ? void 0 : h.inputType) === "deleteContentForward", O = this._formatNumberAsYouType(), G = z2(f, O, S, I);
|
|
2071
|
+
this.telInput.value = O, this.telInput.setSelectionRange(G, G);
|
|
2072
2072
|
}
|
|
2073
|
-
}, this.telInput.addEventListener("input", this._handleInputEvent), (e || n) && (this._handleKeydownEvent = (
|
|
2074
|
-
if (
|
|
2075
|
-
if (n &&
|
|
2076
|
-
|
|
2073
|
+
}, this.telInput.addEventListener("input", this._handleInputEvent), (e || n) && (this._handleKeydownEvent = (h) => {
|
|
2074
|
+
if (h.key && h.key.length === 1 && !h.altKey && !h.ctrlKey && !h.metaKey) {
|
|
2075
|
+
if (n && o && l && h.key === "+") {
|
|
2076
|
+
h.preventDefault(), this._openDropdownWithPlus();
|
|
2077
2077
|
return;
|
|
2078
2078
|
}
|
|
2079
2079
|
if (e) {
|
|
2080
|
-
const
|
|
2081
|
-
(!
|
|
2080
|
+
const _ = this.telInput.value, v = !(_.charAt(0) === "+") && this.telInput.selectionStart === 0 && h.key === "+", S = /^[0-9]$/.test(h.key), T = n ? S : v || S, f = _.slice(0, this.telInput.selectionStart) + h.key + _.slice(this.telInput.selectionEnd), I = this._getFullNumber(f), O = C.utils.getCoreNumber(I, this.selectedCountryData.iso2), G = this.maxCoreNumberLength && O.length > this.maxCoreNumberLength, D = this._getNewCountryFromNumber(I) !== null;
|
|
2081
|
+
(!T || G && !D && !v) && h.preventDefault();
|
|
2082
2082
|
}
|
|
2083
2083
|
}
|
|
2084
2084
|
}, this.telInput.addEventListener("keydown", this._handleKeydownEvent));
|
|
@@ -2167,18 +2167,18 @@ class p1 {
|
|
|
2167
2167
|
_filterCountries(e, i = !1) {
|
|
2168
2168
|
let n = !0;
|
|
2169
2169
|
this.countryList.innerHTML = "";
|
|
2170
|
-
const o = o2(e), l = o.length,
|
|
2170
|
+
const o = o2(e), l = o.length, g = [], h = [], _ = [], L = [], v = [], S = [];
|
|
2171
2171
|
for (const f of this.countries)
|
|
2172
|
-
i || l === 0 ?
|
|
2173
|
-
const
|
|
2174
|
-
...C.sort((f, I) => f.priority - I.priority),
|
|
2172
|
+
i || l === 0 ? _.push(f) : f.iso2 === o ? g.push(f) : f.normalisedName.startsWith(o) ? h.push(f) : f.normalisedName.includes(o) ? _.push(f) : o === f.dialCode || o === f.dialCodePlus ? L.push(f) : f.dialCodePlus.includes(o) ? v.push(f) : f.initials.includes(o) && S.push(f);
|
|
2173
|
+
const T = [
|
|
2175
2174
|
...g.sort((f, I) => f.priority - I.priority),
|
|
2176
|
-
...
|
|
2177
|
-
...
|
|
2178
|
-
...
|
|
2179
|
-
...
|
|
2175
|
+
...h.sort((f, I) => f.priority - I.priority),
|
|
2176
|
+
..._.sort((f, I) => f.priority - I.priority),
|
|
2177
|
+
...L.sort((f, I) => f.priority - I.priority),
|
|
2178
|
+
...v.sort((f, I) => f.priority - I.priority),
|
|
2179
|
+
...S.sort((f, I) => f.priority - I.priority)
|
|
2180
2180
|
];
|
|
2181
|
-
for (const f of
|
|
2181
|
+
for (const f of T) {
|
|
2182
2182
|
const I = f.nodeById[this.id];
|
|
2183
2183
|
I && (this.countryList.appendChild(I), n && (this._highlightListItem(I, !1), n = !1));
|
|
2184
2184
|
}
|
|
@@ -2204,12 +2204,12 @@ class p1 {
|
|
|
2204
2204
|
//* NOTE: this is called from _setInitialState, handleUtils and setNumber.
|
|
2205
2205
|
_updateValFromNumber(e) {
|
|
2206
2206
|
let i = e;
|
|
2207
|
-
if (this.options.formatOnDisplay &&
|
|
2208
|
-
const n = this.options.nationalMode || i.charAt(0) !== "+" && !this.options.separateDialCode, { NATIONAL: o, INTERNATIONAL: l } =
|
|
2209
|
-
i =
|
|
2207
|
+
if (this.options.formatOnDisplay && C.utils && this.selectedCountryData) {
|
|
2208
|
+
const n = this.options.nationalMode || i.charAt(0) !== "+" && !this.options.separateDialCode, { NATIONAL: o, INTERNATIONAL: l } = C.utils.numberFormat, g = n ? o : l;
|
|
2209
|
+
i = C.utils.formatNumber(
|
|
2210
2210
|
i,
|
|
2211
2211
|
this.selectedCountryData.iso2,
|
|
2212
|
-
|
|
2212
|
+
g
|
|
2213
2213
|
);
|
|
2214
2214
|
}
|
|
2215
2215
|
i = this._beforeSetNumber(i), this.telInput.value = i;
|
|
@@ -2224,8 +2224,8 @@ class p1 {
|
|
|
2224
2224
|
const { dialCode: i, nationalPrefix: n } = this.selectedCountryData;
|
|
2225
2225
|
if (e.charAt(0) === "+" || !i)
|
|
2226
2226
|
return e;
|
|
2227
|
-
const
|
|
2228
|
-
return `+${i}${
|
|
2227
|
+
const g = n && e.charAt(0) === n && !this.options.separateDialCode ? e.substring(1) : e;
|
|
2228
|
+
return `+${i}${g}`;
|
|
2229
2229
|
}
|
|
2230
2230
|
// Get the country ISO2 code from the given number
|
|
2231
2231
|
// BUT ONLY IF ITS CHANGED FROM THE CURRENTLY SELECTED COUNTRY
|
|
@@ -2235,19 +2235,19 @@ class p1 {
|
|
|
2235
2235
|
let n = i ? e.substring(i) : e;
|
|
2236
2236
|
const o = this.selectedCountryData.iso2, l = this.selectedCountryData.dialCode;
|
|
2237
2237
|
n = this._ensureHasDialCode(n);
|
|
2238
|
-
const
|
|
2239
|
-
if (
|
|
2240
|
-
const
|
|
2241
|
-
if (!o && this.defaultCountry &&
|
|
2238
|
+
const g = this._getDialCode(n, !0), h = f1(n);
|
|
2239
|
+
if (g) {
|
|
2240
|
+
const _ = f1(g), L = this.dialCodeToIso2Map[_];
|
|
2241
|
+
if (!o && this.defaultCountry && L.includes(this.defaultCountry))
|
|
2242
2242
|
return this.defaultCountry;
|
|
2243
|
-
const
|
|
2244
|
-
if (!(l === "1" && u2(
|
|
2245
|
-
for (const f of
|
|
2243
|
+
const v = this.selectedCountryData.areaCodes && h.length > _.length, S = o && L.includes(o) && !v;
|
|
2244
|
+
if (!(l === "1" && u2(h)) && !S) {
|
|
2245
|
+
for (const f of L)
|
|
2246
2246
|
if (f)
|
|
2247
2247
|
return f;
|
|
2248
2248
|
}
|
|
2249
2249
|
} else {
|
|
2250
|
-
if (n.charAt(0) === "+" &&
|
|
2250
|
+
if (n.charAt(0) === "+" && h.length)
|
|
2251
2251
|
return "";
|
|
2252
2252
|
if ((!n || n === "+") && !this.selectedCountryData.iso2)
|
|
2253
2253
|
return this.defaultCountry;
|
|
@@ -2278,13 +2278,13 @@ class p1 {
|
|
|
2278
2278
|
_setCountry(e) {
|
|
2279
2279
|
const { separateDialCode: i, showFlags: n, i18n: o } = this.options, l = this.selectedCountryData.iso2 ? this.selectedCountryData : {};
|
|
2280
2280
|
if (this.selectedCountryData = e ? this._getCountryData(e, !1) || {} : {}, this.selectedCountryData.iso2 && (this.defaultCountry = this.selectedCountryData.iso2), this.selectedCountry) {
|
|
2281
|
-
const
|
|
2282
|
-
let
|
|
2283
|
-
e ? (
|
|
2281
|
+
const g = e && n ? `iti__flag iti__${e}` : "iti__flag iti__globe";
|
|
2282
|
+
let h, _;
|
|
2283
|
+
e ? (_ = this.selectedCountryData.name, h = o.selectedCountryAriaLabel.replace("${country}", this.selectedCountryData.name)) : (_ = o.noCountrySelected, h = o.noCountrySelected), this.selectedCountryInner.className = g, this.selectedCountry.setAttribute("title", _), this.selectedCountry.setAttribute("aria-label", h);
|
|
2284
2284
|
}
|
|
2285
2285
|
if (i) {
|
|
2286
|
-
const
|
|
2287
|
-
this.selectedDialCode.innerHTML =
|
|
2286
|
+
const g = this.selectedCountryData.dialCode ? `+${this.selectedCountryData.dialCode}` : "";
|
|
2287
|
+
this.selectedDialCode.innerHTML = g, this._updateInputPadding();
|
|
2288
2288
|
}
|
|
2289
2289
|
return this._updatePlaceholder(), this._updateMaxLength(), l.iso2 !== e;
|
|
2290
2290
|
}
|
|
@@ -2298,19 +2298,19 @@ class p1 {
|
|
|
2298
2298
|
//* Update the maximum valid number length for the currently selected country.
|
|
2299
2299
|
_updateMaxLength() {
|
|
2300
2300
|
const { strictMode: e, placeholderNumberType: i, validationNumberTypes: n } = this.options, { iso2: o } = this.selectedCountryData;
|
|
2301
|
-
if (e &&
|
|
2301
|
+
if (e && C.utils)
|
|
2302
2302
|
if (o) {
|
|
2303
|
-
const l =
|
|
2304
|
-
let
|
|
2303
|
+
const l = C.utils.numberType[i];
|
|
2304
|
+
let g = C.utils.getExampleNumber(
|
|
2305
2305
|
o,
|
|
2306
2306
|
!1,
|
|
2307
2307
|
l,
|
|
2308
2308
|
!0
|
|
2309
|
-
),
|
|
2310
|
-
for (;
|
|
2311
|
-
|
|
2312
|
-
const
|
|
2313
|
-
this.maxCoreNumberLength =
|
|
2309
|
+
), h = g;
|
|
2310
|
+
for (; C.utils.isPossibleNumber(g, o, n); )
|
|
2311
|
+
h = g, g += "0";
|
|
2312
|
+
const _ = C.utils.getCoreNumber(h, o);
|
|
2313
|
+
this.maxCoreNumberLength = _.length, o === "by" && (this.maxCoreNumberLength = _.length + 1);
|
|
2314
2314
|
} else
|
|
2315
2315
|
this.maxCoreNumberLength = null;
|
|
2316
2316
|
}
|
|
@@ -2339,14 +2339,14 @@ class p1 {
|
|
|
2339
2339
|
nationalMode: n,
|
|
2340
2340
|
customPlaceholder: o
|
|
2341
2341
|
} = this.options, l = e === "aggressive" || !this.hadInitialPlaceholder && e === "polite";
|
|
2342
|
-
if (
|
|
2343
|
-
const
|
|
2344
|
-
let
|
|
2342
|
+
if (C.utils && l) {
|
|
2343
|
+
const g = C.utils.numberType[i];
|
|
2344
|
+
let h = this.selectedCountryData.iso2 ? C.utils.getExampleNumber(
|
|
2345
2345
|
this.selectedCountryData.iso2,
|
|
2346
2346
|
n,
|
|
2347
|
-
|
|
2347
|
+
g
|
|
2348
2348
|
) : "";
|
|
2349
|
-
|
|
2349
|
+
h = this._beforeSetNumber(h), typeof o == "function" && (h = o(h, this.selectedCountryData)), this.telInput.setAttribute("placeholder", h);
|
|
2350
2350
|
}
|
|
2351
2351
|
}
|
|
2352
2352
|
//* Called when the user selects a list item from the dropdown.
|
|
@@ -2354,7 +2354,7 @@ class p1 {
|
|
|
2354
2354
|
const i = this._setCountry(
|
|
2355
2355
|
e.getAttribute("data-country-code")
|
|
2356
2356
|
);
|
|
2357
|
-
this._closeDropdown(), this._updateDialCode(e.getAttribute("data-dial-code")), this.telInput.focus(), i && this._triggerCountryChange();
|
|
2357
|
+
this._closeDropdown(), this._updateDialCode(e.getAttribute("data-dial-code")), this.options.formatOnDisplay && this._updateValFromNumber(this.telInput.value), this.telInput.focus(), i && this._triggerCountryChange();
|
|
2358
2358
|
}
|
|
2359
2359
|
//* Close the dropdown and unbind any listeners.
|
|
2360
2360
|
_closeDropdown() {
|
|
@@ -2368,12 +2368,12 @@ class p1 {
|
|
|
2368
2368
|
}
|
|
2369
2369
|
//* Check if an element is visible within it's container, else scroll until it is.
|
|
2370
2370
|
_scrollTo(e) {
|
|
2371
|
-
const i = this.countryList, n = document.documentElement.scrollTop, o = i.offsetHeight, l = i.getBoundingClientRect().top + n,
|
|
2372
|
-
if (
|
|
2373
|
-
i.scrollTop =
|
|
2374
|
-
else if (
|
|
2375
|
-
const
|
|
2376
|
-
i.scrollTop =
|
|
2371
|
+
const i = this.countryList, n = document.documentElement.scrollTop, o = i.offsetHeight, l = i.getBoundingClientRect().top + n, g = l + o, h = e.offsetHeight, _ = e.getBoundingClientRect().top + n, L = _ + h, v = _ - l + i.scrollTop;
|
|
2372
|
+
if (_ < l)
|
|
2373
|
+
i.scrollTop = v;
|
|
2374
|
+
else if (L > g) {
|
|
2375
|
+
const S = o - h;
|
|
2376
|
+
i.scrollTop = v - S;
|
|
2377
2377
|
}
|
|
2378
2378
|
}
|
|
2379
2379
|
//* Replace any existing dial code with the new one
|
|
@@ -2393,9 +2393,9 @@ class p1 {
|
|
|
2393
2393
|
if (e.charAt(0) === "+") {
|
|
2394
2394
|
let o = "";
|
|
2395
2395
|
for (let l = 0; l < e.length; l++) {
|
|
2396
|
-
const
|
|
2397
|
-
if (!isNaN(parseInt(
|
|
2398
|
-
if (o +=
|
|
2396
|
+
const g = e.charAt(l);
|
|
2397
|
+
if (!isNaN(parseInt(g, 10))) {
|
|
2398
|
+
if (o += g, i)
|
|
2399
2399
|
this.dialCodeToIso2Map[o] && (n = e.substring(0, l + 1));
|
|
2400
2400
|
else if (this.dialCodes.has(o)) {
|
|
2401
2401
|
n = e.substring(0, l + 1);
|
|
@@ -2434,7 +2434,7 @@ class p1 {
|
|
|
2434
2434
|
}
|
|
2435
2435
|
//* Format the number as the user types.
|
|
2436
2436
|
_formatNumberAsYouType() {
|
|
2437
|
-
const e = this._getFullNumber(), i =
|
|
2437
|
+
const e = this._getFullNumber(), i = C.utils ? C.utils.formatNumberAsYouType(e, this.selectedCountryData.iso2) : e, { dialCode: n } = this.selectedCountryData;
|
|
2438
2438
|
return this.options.separateDialCode && this.telInput.value.charAt(0) !== "+" && i.includes(`+${n}`) ? (i.split(`+${n}`)[1] || "").trim() : i;
|
|
2439
2439
|
}
|
|
2440
2440
|
//**************************
|
|
@@ -2442,18 +2442,18 @@ class p1 {
|
|
|
2442
2442
|
//**************************
|
|
2443
2443
|
//* This is called when the geoip call returns.
|
|
2444
2444
|
handleAutoCountry() {
|
|
2445
|
-
this.options.initialCountry === "auto" &&
|
|
2445
|
+
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());
|
|
2446
2446
|
}
|
|
2447
2447
|
//* This is called when the utils request completes.
|
|
2448
2448
|
handleUtils() {
|
|
2449
|
-
|
|
2449
|
+
C.utils && (this.telInput.value && this._updateValFromNumber(this.telInput.value), this.selectedCountryData.iso2 && (this._updatePlaceholder(), this._updateMaxLength())), this.resolveUtilsScriptPromise();
|
|
2450
2450
|
}
|
|
2451
2451
|
//********************
|
|
2452
2452
|
//* PUBLIC METHODS
|
|
2453
2453
|
//********************
|
|
2454
2454
|
//* Remove plugin.
|
|
2455
2455
|
destroy() {
|
|
2456
|
-
var l,
|
|
2456
|
+
var l, g;
|
|
2457
2457
|
this.telInput.iti = void 0;
|
|
2458
2458
|
const { allowDropdown: e, separateDialCode: i } = this.options;
|
|
2459
2459
|
if (e) {
|
|
@@ -2464,26 +2464,26 @@ class p1 {
|
|
|
2464
2464
|
"keydown",
|
|
2465
2465
|
this._handleCountryContainerKeydown
|
|
2466
2466
|
);
|
|
2467
|
-
const
|
|
2468
|
-
|
|
2467
|
+
const h = this.telInput.closest("label");
|
|
2468
|
+
h && h.removeEventListener("click", this._handleLabelClick);
|
|
2469
2469
|
}
|
|
2470
2470
|
const { form: n } = this.telInput;
|
|
2471
2471
|
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);
|
|
2472
2472
|
const o = this.telInput.parentNode;
|
|
2473
|
-
(l = o == null ? void 0 : o.parentNode) == null || l.insertBefore(this.telInput, o), (
|
|
2473
|
+
(l = o == null ? void 0 : o.parentNode) == null || l.insertBefore(this.telInput, o), (g = o == null ? void 0 : o.parentNode) == null || g.removeChild(o), delete C.instances[this.id];
|
|
2474
2474
|
}
|
|
2475
2475
|
//* Get the extension from the current number.
|
|
2476
2476
|
getExtension() {
|
|
2477
|
-
return
|
|
2477
|
+
return C.utils ? C.utils.getExtension(
|
|
2478
2478
|
this._getFullNumber(),
|
|
2479
2479
|
this.selectedCountryData.iso2
|
|
2480
2480
|
) : "";
|
|
2481
2481
|
}
|
|
2482
2482
|
//* Format the number to the given format.
|
|
2483
2483
|
getNumber(e) {
|
|
2484
|
-
if (
|
|
2484
|
+
if (C.utils) {
|
|
2485
2485
|
const { iso2: i } = this.selectedCountryData;
|
|
2486
|
-
return
|
|
2486
|
+
return C.utils.formatNumber(
|
|
2487
2487
|
this._getFullNumber(),
|
|
2488
2488
|
i,
|
|
2489
2489
|
e
|
|
@@ -2493,7 +2493,7 @@ class p1 {
|
|
|
2493
2493
|
}
|
|
2494
2494
|
//* Get the type of the entered number e.g. landline/mobile.
|
|
2495
2495
|
getNumberType() {
|
|
2496
|
-
return
|
|
2496
|
+
return C.utils ? C.utils.getNumberType(
|
|
2497
2497
|
this._getFullNumber(),
|
|
2498
2498
|
this.selectedCountryData.iso2
|
|
2499
2499
|
) : -99;
|
|
@@ -2504,9 +2504,9 @@ class p1 {
|
|
|
2504
2504
|
}
|
|
2505
2505
|
//* Get the validation error.
|
|
2506
2506
|
getValidationError() {
|
|
2507
|
-
if (
|
|
2507
|
+
if (C.utils) {
|
|
2508
2508
|
const { iso2: e } = this.selectedCountryData;
|
|
2509
|
-
return
|
|
2509
|
+
return C.utils.getValidationError(this._getFullNumber(), e);
|
|
2510
2510
|
}
|
|
2511
2511
|
return -99;
|
|
2512
2512
|
}
|
|
@@ -2519,7 +2519,7 @@ class p1 {
|
|
|
2519
2519
|
return this._validateNumber(!0);
|
|
2520
2520
|
}
|
|
2521
2521
|
_utilsIsPossibleNumber(e) {
|
|
2522
|
-
return
|
|
2522
|
+
return C.utils ? C.utils.isPossibleNumber(e, this.selectedCountryData.iso2, this.options.validationNumberTypes) : null;
|
|
2523
2523
|
}
|
|
2524
2524
|
//* Shared internal validation logic to handle alpha character extension rules.
|
|
2525
2525
|
_validateNumber(e) {
|
|
@@ -2527,18 +2527,18 @@ class p1 {
|
|
|
2527
2527
|
return !1;
|
|
2528
2528
|
const i = this._getFullNumber(), n = i.search(new RegExp("\\p{L}", "u")), o = (l) => e ? this._utilsIsValidNumber(l) : this._utilsIsPossibleNumber(l);
|
|
2529
2529
|
if (n > -1) {
|
|
2530
|
-
const l = i.substring(0, n),
|
|
2531
|
-
return
|
|
2530
|
+
const l = i.substring(0, n), g = o(l), h = o(i);
|
|
2531
|
+
return g && h;
|
|
2532
2532
|
}
|
|
2533
2533
|
return o(i);
|
|
2534
2534
|
}
|
|
2535
2535
|
_utilsIsValidNumber(e) {
|
|
2536
|
-
return
|
|
2536
|
+
return C.utils ? C.utils.isValidNumber(e, this.selectedCountryData.iso2, this.options.validationNumberTypes) : null;
|
|
2537
2537
|
}
|
|
2538
2538
|
//* Update the selected country, and update the input val accordingly.
|
|
2539
2539
|
setCountry(e) {
|
|
2540
2540
|
const i = e == null ? void 0 : e.toLowerCase(), n = this.selectedCountryData.iso2;
|
|
2541
|
-
(e && i !== n || !e && n) && (this._setCountry(i), this._updateDialCode(this.selectedCountryData.dialCode), this._triggerCountryChange());
|
|
2541
|
+
(e && i !== n || !e && n) && (this._setCountry(i), this._updateDialCode(this.selectedCountryData.dialCode), this.options.formatOnDisplay && this._updateValFromNumber(this.telInput.value), this._triggerCountryChange());
|
|
2542
2542
|
}
|
|
2543
2543
|
//* Set the input value and update the country.
|
|
2544
2544
|
setNumber(e) {
|
|
@@ -2553,56 +2553,56 @@ class p1 {
|
|
|
2553
2553
|
this.telInput.disabled = e, e ? this.selectedCountry.setAttribute("disabled", "true") : this.selectedCountry.removeAttribute("disabled");
|
|
2554
2554
|
}
|
|
2555
2555
|
}
|
|
2556
|
-
const Z2 = (
|
|
2557
|
-
if (!
|
|
2556
|
+
const Z2 = (m) => {
|
|
2557
|
+
if (!C.utils && !C.startedLoadingUtilsScript) {
|
|
2558
2558
|
let e;
|
|
2559
|
-
if (typeof
|
|
2559
|
+
if (typeof m == "function")
|
|
2560
2560
|
try {
|
|
2561
|
-
e = Promise.resolve(
|
|
2561
|
+
e = Promise.resolve(m());
|
|
2562
2562
|
} catch (i) {
|
|
2563
2563
|
return Promise.reject(i);
|
|
2564
2564
|
}
|
|
2565
2565
|
else
|
|
2566
|
-
return Promise.reject(new TypeError(`The argument passed to attachUtils must be a function that returns a promise for the utilities module, not ${typeof
|
|
2567
|
-
return
|
|
2566
|
+
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}`));
|
|
2567
|
+
return C.startedLoadingUtilsScript = !0, e.then((i) => {
|
|
2568
2568
|
const n = i == null ? void 0 : i.default;
|
|
2569
2569
|
if (!n || typeof n != "object")
|
|
2570
2570
|
throw new TypeError("The loader function passed to attachUtils did not resolve to a module object with utils as its default export.");
|
|
2571
|
-
return
|
|
2571
|
+
return C.utils = n, $1("handleUtils"), !0;
|
|
2572
2572
|
}).catch((i) => {
|
|
2573
|
-
throw
|
|
2573
|
+
throw $1("rejectUtilsScriptPromise", i), i;
|
|
2574
2574
|
});
|
|
2575
2575
|
}
|
|
2576
2576
|
return null;
|
|
2577
|
-
},
|
|
2578
|
-
(
|
|
2579
|
-
const i = new p1(
|
|
2580
|
-
return i._init(),
|
|
2577
|
+
}, C = Object.assign(
|
|
2578
|
+
(m, e) => {
|
|
2579
|
+
const i = new p1(m, e);
|
|
2580
|
+
return i._init(), m.setAttribute("data-intl-tel-input-id", i.id.toString()), C.instances[i.id] = i, m.iti = i, i;
|
|
2581
2581
|
},
|
|
2582
2582
|
{
|
|
2583
2583
|
defaults: l2,
|
|
2584
2584
|
//* Using a static var like this allows us to mock it in the tests.
|
|
2585
2585
|
documentReady: () => document.readyState === "complete",
|
|
2586
2586
|
//* Get the country data object.
|
|
2587
|
-
getCountryData: () =>
|
|
2587
|
+
getCountryData: () => J,
|
|
2588
2588
|
//* A getter for the plugin instance.
|
|
2589
|
-
getInstance: (
|
|
2590
|
-
const e =
|
|
2591
|
-
return e ?
|
|
2589
|
+
getInstance: (m) => {
|
|
2590
|
+
const e = m.getAttribute("data-intl-tel-input-id");
|
|
2591
|
+
return e ? C.instances[e] : null;
|
|
2592
2592
|
},
|
|
2593
2593
|
//* A map from instance ID to instance object.
|
|
2594
2594
|
instances: {},
|
|
2595
2595
|
attachUtils: Z2,
|
|
2596
2596
|
startedLoadingUtilsScript: !1,
|
|
2597
2597
|
startedLoadingAutoCountry: !1,
|
|
2598
|
-
version: "25.8.
|
|
2598
|
+
version: "25.8.4"
|
|
2599
2599
|
}
|
|
2600
2600
|
);
|
|
2601
2601
|
(function() {
|
|
2602
|
-
var
|
|
2602
|
+
var m = this || self;
|
|
2603
2603
|
function e(d, t) {
|
|
2604
2604
|
d = d.split(".");
|
|
2605
|
-
var $ =
|
|
2605
|
+
var $ = m;
|
|
2606
2606
|
d[0] in $ || typeof $.execScript > "u" || $.execScript("var " + d[0]);
|
|
2607
2607
|
for (var s; d.length && (s = d.shift()); ) d.length || t === void 0 ? $[s] && $[s] !== Object.prototype[s] ? $ = $[s] : $ = $[s] = {} : $[s] = t;
|
|
2608
2608
|
}
|
|
@@ -2610,7 +2610,7 @@ const Z2 = (y) => {
|
|
|
2610
2610
|
function $() {
|
|
2611
2611
|
}
|
|
2612
2612
|
$.prototype = t.prototype, d.ma = t.prototype, d.prototype = new $(), d.prototype.constructor = d, d.sa = function(s, r, u) {
|
|
2613
|
-
for (var a = Array(arguments.length - 2),
|
|
2613
|
+
for (var a = Array(arguments.length - 2), c = 2; c < arguments.length; c++) a[c - 2] = arguments[c];
|
|
2614
2614
|
return t.prototype[r].apply(s, a);
|
|
2615
2615
|
};
|
|
2616
2616
|
}
|
|
@@ -2630,52 +2630,52 @@ const Z2 = (y) => {
|
|
|
2630
2630
|
}
|
|
2631
2631
|
}, l = {};
|
|
2632
2632
|
new o("about:invalid#zClosurez"), new o("about:blank");
|
|
2633
|
-
const
|
|
2634
|
-
class
|
|
2633
|
+
const g = {};
|
|
2634
|
+
class h {
|
|
2635
2635
|
constructor() {
|
|
2636
|
-
if (
|
|
2636
|
+
if (g !== g) throw Error("SafeStyle is not meant to be built directly");
|
|
2637
2637
|
}
|
|
2638
2638
|
toString() {
|
|
2639
2639
|
return "";
|
|
2640
2640
|
}
|
|
2641
2641
|
}
|
|
2642
|
-
new
|
|
2643
|
-
const
|
|
2644
|
-
class
|
|
2642
|
+
new h();
|
|
2643
|
+
const _ = {};
|
|
2644
|
+
class L {
|
|
2645
2645
|
constructor() {
|
|
2646
|
-
if (
|
|
2646
|
+
if (_ !== _) throw Error("SafeStyleSheet is not meant to be built directly");
|
|
2647
2647
|
}
|
|
2648
2648
|
toString() {
|
|
2649
2649
|
return "";
|
|
2650
2650
|
}
|
|
2651
2651
|
}
|
|
2652
|
-
new
|
|
2653
|
-
const
|
|
2654
|
-
class
|
|
2652
|
+
new L();
|
|
2653
|
+
const v = {};
|
|
2654
|
+
class S {
|
|
2655
2655
|
constructor() {
|
|
2656
|
-
var t =
|
|
2657
|
-
if (
|
|
2656
|
+
var t = m.trustedTypes && m.trustedTypes.emptyHTML || "";
|
|
2657
|
+
if (v !== v) throw Error("SafeHtml is not meant to be built directly");
|
|
2658
2658
|
this.g = t;
|
|
2659
2659
|
}
|
|
2660
2660
|
toString() {
|
|
2661
2661
|
return this.g.toString();
|
|
2662
2662
|
}
|
|
2663
2663
|
}
|
|
2664
|
-
new
|
|
2665
|
-
function
|
|
2664
|
+
new S();
|
|
2665
|
+
function T(d, t) {
|
|
2666
2666
|
switch (this.g = d, this.l = !!t.aa, this.h = t.i, this.s = t.type, this.o = !1, this.h) {
|
|
2667
|
+
case O:
|
|
2667
2668
|
case G:
|
|
2668
|
-
case
|
|
2669
|
+
case F:
|
|
2669
2670
|
case D:
|
|
2670
|
-
case
|
|
2671
|
-
case Y:
|
|
2671
|
+
case i1:
|
|
2672
2672
|
case I:
|
|
2673
2673
|
case f:
|
|
2674
2674
|
this.o = !0;
|
|
2675
2675
|
}
|
|
2676
2676
|
this.j = t.defaultValue;
|
|
2677
2677
|
}
|
|
2678
|
-
var f = 1, I = 2,
|
|
2678
|
+
var f = 1, I = 2, O = 3, G = 4, F = 6, D = 16, i1 = 18;
|
|
2679
2679
|
function c2(d, t) {
|
|
2680
2680
|
for (this.h = d, this.g = {}, d = 0; d < t.length; d++) {
|
|
2681
2681
|
var $ = t[d];
|
|
@@ -2687,36 +2687,36 @@ const Z2 = (y) => {
|
|
|
2687
2687
|
return t.g - $.g;
|
|
2688
2688
|
}), d;
|
|
2689
2689
|
}
|
|
2690
|
-
function
|
|
2690
|
+
function x() {
|
|
2691
2691
|
this.h = {}, this.j = this.m().g, this.g = this.l = null;
|
|
2692
2692
|
}
|
|
2693
|
-
|
|
2694
|
-
return
|
|
2695
|
-
},
|
|
2693
|
+
x.prototype.has = function(d) {
|
|
2694
|
+
return R(this, d.g);
|
|
2695
|
+
}, x.prototype.get = function(d, t) {
|
|
2696
2696
|
return p(this, d.g, t);
|
|
2697
|
-
},
|
|
2697
|
+
}, x.prototype.set = function(d, t) {
|
|
2698
2698
|
E(this, d.g, t);
|
|
2699
|
-
},
|
|
2699
|
+
}, x.prototype.add = function(d, t) {
|
|
2700
2700
|
b1(this, d.g, t);
|
|
2701
2701
|
};
|
|
2702
2702
|
function w1(d, t) {
|
|
2703
2703
|
for (var $ = f2(d.m()), s = 0; s < $.length; s++) {
|
|
2704
2704
|
var r = $[s], u = r.g;
|
|
2705
|
-
if (
|
|
2705
|
+
if (R(t, u)) {
|
|
2706
2706
|
d.g && delete d.g[r.g];
|
|
2707
2707
|
var a = r.h == 11 || r.h == 10;
|
|
2708
2708
|
if (r.l) {
|
|
2709
2709
|
r = P(t, u);
|
|
2710
|
-
for (var
|
|
2710
|
+
for (var c = 0; c < r.length; c++) b1(d, u, a ? r[c].clone() : r[c]);
|
|
2711
2711
|
} else r = n1(t, u), a ? (a = n1(d, u)) ? w1(a, r) : E(d, u, r.clone()) : E(d, u, r);
|
|
2712
2712
|
}
|
|
2713
2713
|
}
|
|
2714
2714
|
}
|
|
2715
|
-
|
|
2715
|
+
x.prototype.clone = function() {
|
|
2716
2716
|
var d = new this.constructor();
|
|
2717
2717
|
return d != this && (d.h = {}, d.g && (d.g = {}), w1(d, this)), d;
|
|
2718
2718
|
};
|
|
2719
|
-
function
|
|
2719
|
+
function R(d, t) {
|
|
2720
2720
|
return d.h[t] != null;
|
|
2721
2721
|
}
|
|
2722
2722
|
function n1(d, t) {
|
|
@@ -2739,8 +2739,8 @@ const Z2 = (y) => {
|
|
|
2739
2739
|
var s = n1(d, t);
|
|
2740
2740
|
return d.j[t].l ? s[$ || 0] : s;
|
|
2741
2741
|
}
|
|
2742
|
-
function
|
|
2743
|
-
if (
|
|
2742
|
+
function w(d, t) {
|
|
2743
|
+
if (R(d, t)) d = p(d, t);
|
|
2744
2744
|
else d: {
|
|
2745
2745
|
if (d = d.j[t], d.j === void 0) if (t = d.s, t === Boolean) d.j = !1;
|
|
2746
2746
|
else if (t === Number) d.j = 0;
|
|
@@ -2757,7 +2757,7 @@ const Z2 = (y) => {
|
|
|
2757
2757
|
return n1(d, t) || [];
|
|
2758
2758
|
}
|
|
2759
2759
|
function K(d, t) {
|
|
2760
|
-
return d.j[t].l ?
|
|
2760
|
+
return d.j[t].l ? R(d, t) ? d.h[t].length : 0 : R(d, t) ? 1 : 0;
|
|
2761
2761
|
}
|
|
2762
2762
|
function E(d, t, $) {
|
|
2763
2763
|
d.h[t] = $, d.g && (d.g[t] = $);
|
|
@@ -2767,7 +2767,7 @@ const Z2 = (y) => {
|
|
|
2767
2767
|
}
|
|
2768
2768
|
function s1(d, t) {
|
|
2769
2769
|
var $ = [], s;
|
|
2770
|
-
for (s in t) s != 0 && $.push(new
|
|
2770
|
+
for (s in t) s != 0 && $.push(new T(s, t[s]));
|
|
2771
2771
|
return new c2(d, $);
|
|
2772
2772
|
}
|
|
2773
2773
|
function r1() {
|
|
@@ -2775,7 +2775,7 @@ const Z2 = (y) => {
|
|
|
2775
2775
|
r1.prototype.g = function(d) {
|
|
2776
2776
|
throw new d.h(), Error("Unimplemented");
|
|
2777
2777
|
}, r1.prototype.h = function(d, t) {
|
|
2778
|
-
if (d.h == 11 || d.h == 10) return t instanceof
|
|
2778
|
+
if (d.h == 11 || d.h == 10) return t instanceof x ? t : this.g(d.s.prototype.m(), t);
|
|
2779
2779
|
if (d.h == 14) return typeof t == "string" && L1.test(t) && (d = Number(t), 0 < d) ? d : t;
|
|
2780
2780
|
if (!d.o) return t;
|
|
2781
2781
|
if (d = d.s, d === String) {
|
|
@@ -2789,12 +2789,12 @@ const Z2 = (y) => {
|
|
|
2789
2789
|
i(g1, r1), g1.prototype.g = function(d, t) {
|
|
2790
2790
|
return d = new d.h(), d.l = this, d.h = t, d.g = {}, d;
|
|
2791
2791
|
};
|
|
2792
|
-
function
|
|
2792
|
+
function q() {
|
|
2793
2793
|
}
|
|
2794
|
-
i(
|
|
2794
|
+
i(q, g1), q.prototype.h = function(d, t) {
|
|
2795
2795
|
return d.h == 8 ? !!t : r1.prototype.h.apply(this, arguments);
|
|
2796
|
-
},
|
|
2797
|
-
return
|
|
2796
|
+
}, q.prototype.g = function(d, t) {
|
|
2797
|
+
return q.ma.g.call(this, d, t);
|
|
2798
2798
|
};
|
|
2799
2799
|
function A(d, t) {
|
|
2800
2800
|
d != null && this.g.apply(this, arguments);
|
|
@@ -2805,54 +2805,54 @@ const Z2 = (y) => {
|
|
|
2805
2805
|
if (this.h += String(d), t != null) for (let s = 1; s < arguments.length; s++) this.h += arguments[s];
|
|
2806
2806
|
return this;
|
|
2807
2807
|
};
|
|
2808
|
-
function
|
|
2808
|
+
function B(d) {
|
|
2809
2809
|
d.h = "";
|
|
2810
2810
|
}
|
|
2811
2811
|
A.prototype.toString = function() {
|
|
2812
2812
|
return this.h;
|
|
2813
2813
|
};
|
|
2814
2814
|
function W() {
|
|
2815
|
-
|
|
2815
|
+
x.call(this);
|
|
2816
2816
|
}
|
|
2817
|
-
i(W,
|
|
2817
|
+
i(W, x);
|
|
2818
2818
|
var N1 = null;
|
|
2819
|
-
function
|
|
2820
|
-
|
|
2819
|
+
function b() {
|
|
2820
|
+
x.call(this);
|
|
2821
2821
|
}
|
|
2822
|
-
i(
|
|
2822
|
+
i(b, x);
|
|
2823
2823
|
var T1 = null;
|
|
2824
2824
|
function z() {
|
|
2825
|
-
|
|
2825
|
+
x.call(this);
|
|
2826
2826
|
}
|
|
2827
|
-
i(z,
|
|
2827
|
+
i(z, x);
|
|
2828
2828
|
var A1 = null;
|
|
2829
2829
|
W.prototype.m = function() {
|
|
2830
2830
|
var d = N1;
|
|
2831
2831
|
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;
|
|
2832
|
-
}, W.m = W.prototype.m,
|
|
2832
|
+
}, W.m = W.prototype.m, b.prototype.m = function() {
|
|
2833
2833
|
var d = T1;
|
|
2834
|
-
return d || (T1 = d = s1(
|
|
2835
|
-
},
|
|
2834
|
+
return d || (T1 = d = s1(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;
|
|
2835
|
+
}, b.m = b.prototype.m, z.prototype.m = function() {
|
|
2836
2836
|
var d = A1;
|
|
2837
2837
|
return d || (A1 = d = s1(z, {
|
|
2838
2838
|
0: { name: "PhoneMetadata", ia: "i18n.phonenumbers.PhoneMetadata" },
|
|
2839
|
-
1: { name: "general_desc", i: 11, type:
|
|
2840
|
-
2: { name: "fixed_line", i: 11, type:
|
|
2841
|
-
3: { name: "mobile", i: 11, type:
|
|
2842
|
-
4: { name: "toll_free", i: 11, type:
|
|
2843
|
-
5: { name: "premium_rate", i: 11, type:
|
|
2844
|
-
6: { name: "shared_cost", i: 11, type:
|
|
2845
|
-
7: { name: "personal_number", i: 11, type:
|
|
2846
|
-
8: { name: "voip", i: 11, type:
|
|
2847
|
-
21: { name: "pager", i: 11, type:
|
|
2848
|
-
25: { name: "uan", i: 11, type:
|
|
2849
|
-
27: { name: "emergency", i: 11, type:
|
|
2850
|
-
28: { name: "voicemail", i: 11, type:
|
|
2851
|
-
29: { name: "short_code", i: 11, type:
|
|
2852
|
-
30: { name: "standard_rate", i: 11, type:
|
|
2853
|
-
31: { name: "carrier_specific", i: 11, type:
|
|
2854
|
-
33: { name: "sms_services", i: 11, type:
|
|
2855
|
-
24: { name: "no_international_dialling", i: 11, type:
|
|
2839
|
+
1: { name: "general_desc", i: 11, type: b },
|
|
2840
|
+
2: { name: "fixed_line", i: 11, type: b },
|
|
2841
|
+
3: { name: "mobile", i: 11, type: b },
|
|
2842
|
+
4: { name: "toll_free", i: 11, type: b },
|
|
2843
|
+
5: { name: "premium_rate", i: 11, type: b },
|
|
2844
|
+
6: { name: "shared_cost", i: 11, type: b },
|
|
2845
|
+
7: { name: "personal_number", i: 11, type: b },
|
|
2846
|
+
8: { name: "voip", i: 11, type: b },
|
|
2847
|
+
21: { name: "pager", i: 11, type: b },
|
|
2848
|
+
25: { name: "uan", i: 11, type: b },
|
|
2849
|
+
27: { name: "emergency", i: 11, type: b },
|
|
2850
|
+
28: { name: "voicemail", i: 11, type: b },
|
|
2851
|
+
29: { name: "short_code", i: 11, type: b },
|
|
2852
|
+
30: { name: "standard_rate", i: 11, type: b },
|
|
2853
|
+
31: { name: "carrier_specific", i: 11, type: b },
|
|
2854
|
+
33: { name: "sms_services", i: 11, type: b },
|
|
2855
|
+
24: { name: "no_international_dialling", i: 11, type: b },
|
|
2856
2856
|
9: { name: "id", required: !0, i: 9, type: String },
|
|
2857
2857
|
10: { name: "country_code", i: 5, type: Number },
|
|
2858
2858
|
11: { name: "international_prefix", i: 9, type: String },
|
|
@@ -2873,9 +2873,9 @@ const Z2 = (y) => {
|
|
|
2873
2873
|
})), d;
|
|
2874
2874
|
}, z.m = z.prototype.m;
|
|
2875
2875
|
function H() {
|
|
2876
|
-
|
|
2876
|
+
x.call(this);
|
|
2877
2877
|
}
|
|
2878
|
-
i(H,
|
|
2878
|
+
i(H, x);
|
|
2879
2879
|
var E1 = null, p2 = { ra: 0, qa: 1, pa: 5, oa: 10, na: 20 };
|
|
2880
2880
|
H.prototype.m = function() {
|
|
2881
2881
|
var d = E1;
|
|
@@ -2885,7 +2885,7 @@ const Z2 = (y) => {
|
|
|
2885
2885
|
type: String
|
|
2886
2886
|
} })), d;
|
|
2887
2887
|
}, H.ctor = H, H.ctor.m = H.prototype.m;
|
|
2888
|
-
var
|
|
2888
|
+
var X = {
|
|
2889
2889
|
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(" "),
|
|
2890
2890
|
7: ["RU", "KZ"],
|
|
2891
2891
|
20: ["EG"],
|
|
@@ -8293,23 +8293,23 @@ const Z2 = (y) => {
|
|
|
8293
8293
|
X: "9",
|
|
8294
8294
|
Y: "9",
|
|
8295
8295
|
Z: "9"
|
|
8296
|
-
}, m2 = RegExp("[++]+"),
|
|
8297
|
-
function
|
|
8296
|
+
}, 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}.*/, S2 = RegExp("^\\+([0-90-9٠-٩۰-۹]|[\\-\\.\\(\\)]?)*[0-90-9٠-٩۰-۹]([0-90-9٠-٩۰-۹]|[\\-\\.\\(\\)]?)*$"), w2 = RegExp("^([A-Za-z0-90-9٠-٩۰-۹]+((\\-)*[A-Za-z0-90-9٠-٩۰-۹])*\\.)*[A-Za-z]+((\\-)*[A-Za-z0-90-9٠-٩۰-۹])*\\.?$");
|
|
8297
|
+
function Y(d) {
|
|
8298
8298
|
return "([0-90-9٠-٩۰-۹]{1," + d + "})";
|
|
8299
8299
|
}
|
|
8300
8300
|
function P1() {
|
|
8301
|
-
return ";ext=" +
|
|
8301
|
+
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") + "#?");
|
|
8302
8302
|
}
|
|
8303
8303
|
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\)?$/;
|
|
8304
8304
|
function R1(d) {
|
|
8305
|
-
return 2 > d.length ? !1 :
|
|
8305
|
+
return 2 > d.length ? !1 : U(b2, d);
|
|
8306
8306
|
}
|
|
8307
8307
|
function B1(d) {
|
|
8308
|
-
return
|
|
8308
|
+
return U(v2, d) ? o1(d, C2) : o1(d, C1);
|
|
8309
8309
|
}
|
|
8310
8310
|
function k1(d) {
|
|
8311
8311
|
var t = B1(d.toString());
|
|
8312
|
-
|
|
8312
|
+
B(d), d.g(t);
|
|
8313
8313
|
}
|
|
8314
8314
|
function O1(d) {
|
|
8315
8315
|
return d != null && (K(d, 9) != 1 || P(d, 9)[0] != -1);
|
|
@@ -8325,42 +8325,42 @@ const Z2 = (y) => {
|
|
|
8325
8325
|
return d != null && isNaN(d) && d.toUpperCase() in M1;
|
|
8326
8326
|
}
|
|
8327
8327
|
M.prototype.format = function(d, t) {
|
|
8328
|
-
if (p(d, 2) == 0 &&
|
|
8329
|
-
var $ =
|
|
8328
|
+
if (p(d, 2) == 0 && R(d, 5)) {
|
|
8329
|
+
var $ = w(d, 5);
|
|
8330
8330
|
if (0 < $.length) return $;
|
|
8331
8331
|
}
|
|
8332
|
-
$ =
|
|
8333
|
-
var s =
|
|
8334
|
-
if (t == 0) return
|
|
8335
|
-
if (!($ in
|
|
8336
|
-
var r =
|
|
8337
|
-
d =
|
|
8332
|
+
$ = w(d, 1);
|
|
8333
|
+
var s = t1(d);
|
|
8334
|
+
if (t == 0) return F1($, 0, s, "");
|
|
8335
|
+
if (!($ in X)) return s;
|
|
8336
|
+
var r = d1(this, $, e1($));
|
|
8337
|
+
d = R(d, 3) && p(d, 3).length != 0 ? t == 3 ? ";ext=" + p(d, 3) : R(r, 13) ? p(r, 13) + w(d, 3) : " ext. " + w(d, 3) : "";
|
|
8338
8338
|
d: {
|
|
8339
8339
|
r = P(r, 20).length == 0 || t == 2 ? P(r, 19) : P(r, 20);
|
|
8340
|
-
for (var u, a = r.length,
|
|
8341
|
-
u = r[
|
|
8342
|
-
var
|
|
8343
|
-
if ((
|
|
8340
|
+
for (var u, a = r.length, c = 0; c < a; ++c) {
|
|
8341
|
+
u = r[c];
|
|
8342
|
+
var y = K(u, 3);
|
|
8343
|
+
if ((y == 0 || s.search(p(u, 3, y - 1)) == 0) && (y = new RegExp(p(u, 1)), U(y, s))) {
|
|
8344
8344
|
r = u;
|
|
8345
8345
|
break d;
|
|
8346
8346
|
}
|
|
8347
8347
|
}
|
|
8348
8348
|
r = null;
|
|
8349
8349
|
}
|
|
8350
|
-
return r != null && (a = r, r =
|
|
8350
|
+
return r != null && (a = r, r = w(a, 2), u = new RegExp(p(a, 1)), w(
|
|
8351
8351
|
a,
|
|
8352
8352
|
5
|
|
8353
|
-
), a =
|
|
8353
|
+
), a = w(a, 4), s = t == 2 && a != null && 0 < a.length ? s.replace(u, r.replace(L2, a)) : s.replace(u, r), t == 3 && (s = s.replace(RegExp("^[-x‐-―−ー--/ ()()[].\\[\\]/~⁓∼~]+"), ""), s = s.replace(RegExp("[-x‐-―−ー--/ ()()[].\\[\\]/~⁓∼~]+", "g"), "-"))), F1($, t, s, d);
|
|
8354
8354
|
};
|
|
8355
|
-
function
|
|
8355
|
+
function d1(d, t, $) {
|
|
8356
8356
|
return $ == "001" ? j(d, "" + t) : j(d, $);
|
|
8357
8357
|
}
|
|
8358
|
-
function
|
|
8359
|
-
if (!
|
|
8358
|
+
function t1(d) {
|
|
8359
|
+
if (!R(d, 2)) return "";
|
|
8360
8360
|
var t = "" + p(d, 2);
|
|
8361
|
-
return
|
|
8361
|
+
return R(d, 4) && p(d, 4) && 0 < w(d, 8) ? Array(w(d, 8) + 1).join("0") + t : t;
|
|
8362
8362
|
}
|
|
8363
|
-
function
|
|
8363
|
+
function F1(d, t, $, s) {
|
|
8364
8364
|
switch (t) {
|
|
8365
8365
|
case 0:
|
|
8366
8366
|
return "+" + d + $ + s;
|
|
@@ -8399,12 +8399,12 @@ const Z2 = (y) => {
|
|
|
8399
8399
|
return p(d, 1);
|
|
8400
8400
|
}
|
|
8401
8401
|
}
|
|
8402
|
-
function
|
|
8402
|
+
function U1(d, t) {
|
|
8403
8403
|
var $ = V1(d, t);
|
|
8404
|
-
return d =
|
|
8404
|
+
return d = d1(d, w(t, 1), $), d == null ? -1 : (t = t1(t), m1(t, d));
|
|
8405
8405
|
}
|
|
8406
8406
|
function m1(d, t) {
|
|
8407
|
-
return
|
|
8407
|
+
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;
|
|
8408
8408
|
}
|
|
8409
8409
|
function j(d, t) {
|
|
8410
8410
|
if (t == null) return null;
|
|
@@ -8412,29 +8412,29 @@ const Z2 = (y) => {
|
|
|
8412
8412
|
var $ = d.g[t];
|
|
8413
8413
|
if ($ == null) {
|
|
8414
8414
|
if ($ = M1[t], $ == null) return null;
|
|
8415
|
-
$ = new
|
|
8415
|
+
$ = new q().g(z.m(), $), d.g[t] = $;
|
|
8416
8416
|
}
|
|
8417
8417
|
return $;
|
|
8418
8418
|
}
|
|
8419
|
-
function
|
|
8419
|
+
function k(d, t) {
|
|
8420
8420
|
var $ = d.length;
|
|
8421
|
-
return 0 < K(t, 9) && P(t, 9).indexOf($) == -1 ? !1 :
|
|
8421
|
+
return 0 < K(t, 9) && P(t, 9).indexOf($) == -1 ? !1 : U(w(t, 2), d);
|
|
8422
8422
|
}
|
|
8423
8423
|
function T2(d, t) {
|
|
8424
|
-
var $ = V1(d, t), s =
|
|
8425
|
-
return r == null || $ != "001" && s != K1(d, $) ? r = !1 : (d =
|
|
8424
|
+
var $ = V1(d, t), s = w(t, 1), r = d1(d, s, $);
|
|
8425
|
+
return r == null || $ != "001" && s != K1(d, $) ? r = !1 : (d = t1(t), r = m1(d, r) != -1), r;
|
|
8426
8426
|
}
|
|
8427
8427
|
function V1(d, t) {
|
|
8428
8428
|
if (t == null) return null;
|
|
8429
|
-
var $ =
|
|
8430
|
-
if ($ =
|
|
8429
|
+
var $ = w(t, 1);
|
|
8430
|
+
if ($ = X[$], $ == null) d = null;
|
|
8431
8431
|
else if ($.length == 1) d = $[0];
|
|
8432
8432
|
else d: {
|
|
8433
|
-
t =
|
|
8433
|
+
t = t1(t);
|
|
8434
8434
|
for (var s, r = $.length, u = 0; u < r; u++) {
|
|
8435
8435
|
s = $[u];
|
|
8436
8436
|
var a = j(d, s);
|
|
8437
|
-
if (
|
|
8437
|
+
if (R(a, 23)) {
|
|
8438
8438
|
if (t.search(p(a, 23)) == 0) {
|
|
8439
8439
|
d = s;
|
|
8440
8440
|
break d;
|
|
@@ -8448,12 +8448,12 @@ const Z2 = (y) => {
|
|
|
8448
8448
|
}
|
|
8449
8449
|
return d;
|
|
8450
8450
|
}
|
|
8451
|
-
function
|
|
8452
|
-
return d =
|
|
8451
|
+
function e1(d) {
|
|
8452
|
+
return d = X[d], d == null ? "ZZ" : d[0];
|
|
8453
8453
|
}
|
|
8454
8454
|
function K1(d, t) {
|
|
8455
8455
|
if (d = j(d, t), d == null) throw Error("Invalid region code: " + t);
|
|
8456
|
-
return
|
|
8456
|
+
return w(d, 10);
|
|
8457
8457
|
}
|
|
8458
8458
|
function l1(d, t, $, s) {
|
|
8459
8459
|
var r = a1($, s), u = K(r, 9) == 0 ? P(p($, 1), 9) : P(r, 9);
|
|
@@ -8462,12 +8462,12 @@ const Z2 = (y) => {
|
|
|
8462
8462
|
return u[0] == -1 ? 5 : (t = t.length, -1 < r.indexOf(t) ? 4 : ($ = u[0], $ == t ? 0 : $ > t ? 2 : u[u.length - 1] < t ? 3 : -1 < u.indexOf(t, 1) ? 0 : 5));
|
|
8463
8463
|
}
|
|
8464
8464
|
function h1(d, t, $) {
|
|
8465
|
-
var s =
|
|
8466
|
-
return t =
|
|
8465
|
+
var s = t1(t);
|
|
8466
|
+
return t = w(t, 1), t in X ? (t = d1(d, t, e1(t)), l1(d, s, t, $)) : 1;
|
|
8467
8467
|
}
|
|
8468
8468
|
function H1(d, t) {
|
|
8469
8469
|
if (d = d.toString(), d.length == 0 || d.charAt(0) == "0") return 0;
|
|
8470
|
-
for (var $, s = d.length, r = 1; 3 >= r && r <= s; ++r) if ($ = parseInt(d.substring(0, r), 10), $ in
|
|
8470
|
+
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)), $;
|
|
8471
8471
|
return 0;
|
|
8472
8472
|
}
|
|
8473
8473
|
function j1(d, t, $, s, r, u) {
|
|
@@ -8475,14 +8475,14 @@ const Z2 = (y) => {
|
|
|
8475
8475
|
t = new A(t);
|
|
8476
8476
|
var a;
|
|
8477
8477
|
$ != null && (a = p($, 11)), a == null && (a = "NonMatch");
|
|
8478
|
-
var
|
|
8479
|
-
if (
|
|
8480
|
-
else if (
|
|
8478
|
+
var c = t.toString();
|
|
8479
|
+
if (c.length == 0) a = 20;
|
|
8480
|
+
else if (Q.test(c)) c = c.replace(Q, ""), B(t), t.g(B1(c)), a = 1;
|
|
8481
8481
|
else {
|
|
8482
|
-
if (
|
|
8483
|
-
|
|
8484
|
-
var
|
|
8485
|
-
|
|
8482
|
+
if (c = new RegExp(a), k1(t), a = t.toString(), a.search(c) == 0) {
|
|
8483
|
+
c = a.match(c)[0].length;
|
|
8484
|
+
var y = a.substring(c).match(D1);
|
|
8485
|
+
y && y[1] != null && 0 < y[1].length && o1(y[1], C1) == "0" ? a = !1 : (B(t), t.g(a.substring(c)), a = !0);
|
|
8486
8486
|
} else a = !1;
|
|
8487
8487
|
a = a ? 5 : 20;
|
|
8488
8488
|
}
|
|
@@ -8491,16 +8491,16 @@ const Z2 = (y) => {
|
|
|
8491
8491
|
if (d = H1(t, s), d != 0) return E(u, 1, d), d;
|
|
8492
8492
|
throw Error("Invalid country calling code");
|
|
8493
8493
|
}
|
|
8494
|
-
return $ != null && (a =
|
|
8494
|
+
return $ != null && (a = w($, 10), c = "" + a, y = t.toString(), y.lastIndexOf(c, 0) == 0 && (c = new A(y.substring(c.length)), y = p($, 1), y = new RegExp(w(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 && E(u, 6, 10), E(u, 1, a), a) : (E(u, 1, 0), 0);
|
|
8495
8495
|
}
|
|
8496
8496
|
function W1(d, t, $) {
|
|
8497
8497
|
var s = d.toString(), r = s.length, u = p(t, 15);
|
|
8498
8498
|
if (r != 0 && u != null && u.length != 0) {
|
|
8499
8499
|
var a = new RegExp("^(?:" + u + ")");
|
|
8500
8500
|
if (r = a.exec(s)) {
|
|
8501
|
-
u = new RegExp(
|
|
8502
|
-
var
|
|
8503
|
-
t = p(t, 16), t == null || t.length == 0 || r[
|
|
8501
|
+
u = new RegExp(w(p(t, 1), 2));
|
|
8502
|
+
var c = U(u, s), y = r.length - 1;
|
|
8503
|
+
t = p(t, 16), t == null || t.length == 0 || r[y] == null || r[y].length == 0 ? (!c || U(u, s.substring(r[0].length))) && ($ != null && 0 < y && r[y] != null && $.g(r[1]), d.set(s.substring(r[0].length))) : (s = s.replace(a, t), (!c || U(u, s)) && ($ != null && 0 < y && $.g(r[1]), d.set(s)));
|
|
8504
8504
|
}
|
|
8505
8505
|
}
|
|
8506
8506
|
}
|
|
@@ -8518,32 +8518,32 @@ const Z2 = (y) => {
|
|
|
8518
8518
|
var a = t.indexOf(";", u);
|
|
8519
8519
|
u = a !== -1 ? t.substring(u, a) : t.substring(u);
|
|
8520
8520
|
}
|
|
8521
|
-
var
|
|
8522
|
-
if (
|
|
8523
|
-
if (u = r.toString(), !(u1($) || u != null && 0 < u.length &&
|
|
8521
|
+
var c = u;
|
|
8522
|
+
if (c == null ? a = !0 : c.length === 0 ? a = !1 : (a = S2.exec(c), c = w2.exec(c), a = a !== null || c !== null), !a || (u != null ? (u.charAt(0) === "+" && r.g(u), u = t.indexOf("tel:"), r.g(t.substring(0 <= u ? u + 4 : 0, t.indexOf(";phone-context=")))) : (u = r.g, a = t ?? "", c = a.search(y2), 0 <= c ? (a = a.substring(c), a = a.replace(I2, ""), c = a.search(_2), 0 <= c && (a = a.substring(0, c))) : a = "", u.call(r, a)), u = r.toString(), a = u.indexOf(";isub="), 0 < a && (B(r), r.g(u.substring(0, a))), !R1(r.toString()))) throw Error("The string supplied did not seem to be a phone number");
|
|
8523
|
+
if (u = r.toString(), !(u1($) || u != null && 0 < u.length && Q.test(u))) throw Error("Invalid country calling code");
|
|
8524
8524
|
u = new H(), s && E(u, 5, t);
|
|
8525
8525
|
d: {
|
|
8526
8526
|
if (t = r.toString(), a = t.search(x1), 0 <= a && R1(t.substring(0, a))) {
|
|
8527
|
-
|
|
8528
|
-
for (var
|
|
8529
|
-
|
|
8527
|
+
c = t.match(x1);
|
|
8528
|
+
for (var y = c.length, V = 1; V < y; ++V) if (c[V] != null && 0 < c[V].length) {
|
|
8529
|
+
B(r), r.g(t.substring(0, a)), t = c[V];
|
|
8530
8530
|
break d;
|
|
8531
8531
|
}
|
|
8532
8532
|
}
|
|
8533
8533
|
t = "";
|
|
8534
8534
|
}
|
|
8535
|
-
0 < t.length && E(u, 3, t), a = j(d, $), t = new A(),
|
|
8535
|
+
0 < t.length && E(u, 3, t), a = j(d, $), t = new A(), c = 0, y = r.toString();
|
|
8536
8536
|
try {
|
|
8537
|
-
|
|
8537
|
+
c = j1(d, y, a, t, s, u);
|
|
8538
8538
|
} catch (I1) {
|
|
8539
|
-
if (I1.message == "Invalid country calling code" &&
|
|
8540
|
-
if (
|
|
8539
|
+
if (I1.message == "Invalid country calling code" && Q.test(y)) {
|
|
8540
|
+
if (y = y.replace(Q, ""), c = j1(d, y, a, t, s, u), c == 0) throw I1;
|
|
8541
8541
|
} else throw I1;
|
|
8542
8542
|
}
|
|
8543
|
-
if (
|
|
8543
|
+
if (c != 0 ? (r = e1(c), r != $ && (a = d1(d, c, r))) : (k1(r), t.g(r.toString()), $ != null ? (c = w(a, 10), E(
|
|
8544
8544
|
u,
|
|
8545
8545
|
1,
|
|
8546
|
-
|
|
8546
|
+
c
|
|
8547
8547
|
)) : s && (delete u.h[6], u.g && delete u.g[6])), 2 > t.h.length || (a != null && ($ = new A(), r = new A(t.toString()), W1(r, a, $), d = l1(d, r.toString(), a, -1), d != 2 && d != 4 && d != 5 && (t = r, s && 0 < $.toString().length && E(u, 7, $.toString()))), s = t.toString(), d = s.length, 2 > d)) throw Error("The string supplied is too short to be a phone number");
|
|
8548
8548
|
if (17 < d) throw Error("The string supplied is too long to be a phone number");
|
|
8549
8549
|
if (1 < s.length && s.charAt(0) == "0") {
|
|
@@ -8552,7 +8552,7 @@ const Z2 = (y) => {
|
|
|
8552
8552
|
}
|
|
8553
8553
|
return E(u, 2, parseInt(s, 10)), u;
|
|
8554
8554
|
}
|
|
8555
|
-
function
|
|
8555
|
+
function U(d, t) {
|
|
8556
8556
|
return !!((d = t.match(new RegExp("^(?:" + (typeof d == "string" ? d : d.source) + ")$", "i"))) && d[0].length == t.length);
|
|
8557
8557
|
}
|
|
8558
8558
|
function A2(d) {
|
|
@@ -8563,18 +8563,18 @@ const Z2 = (y) => {
|
|
|
8563
8563
|
var E2 = RegExp("^[-x‐-―−ー--/ ()()[].\\[\\]/~⁓∼~]*\\$1[-x‐-―−ー--/ ()()[].\\[\\]/~⁓∼~]*(\\$\\d[-x‐-―−ー--/ ()()[].\\[\\]/~⁓∼~]*)*$"), Y1 = /[- ]/;
|
|
8564
8564
|
function J1(d, t) {
|
|
8565
8565
|
var $ = d.ga;
|
|
8566
|
-
return t = u1(t) ? K1($, t) : 0, d = j(d.ga,
|
|
8566
|
+
return t = u1(t) ? K1($, t) : 0, d = j(d.ga, e1(t)), d ?? Z1;
|
|
8567
8567
|
}
|
|
8568
8568
|
function q1(d) {
|
|
8569
8569
|
for (var t = d.j.length, $ = 0; $ < t; ++$) {
|
|
8570
|
-
var s = d.j[$], r =
|
|
8570
|
+
var s = d.j[$], r = w(s, 1);
|
|
8571
8571
|
if (d.da == r) return !1;
|
|
8572
|
-
var u = d, a = s,
|
|
8573
|
-
|
|
8574
|
-
var
|
|
8575
|
-
a =
|
|
8576
|
-
var V = "999999999999999".match(
|
|
8577
|
-
if (V.length <
|
|
8572
|
+
var u = d, a = s, c = w(a, 1);
|
|
8573
|
+
B(u.v);
|
|
8574
|
+
var y = u;
|
|
8575
|
+
a = w(a, 2);
|
|
8576
|
+
var V = "999999999999999".match(c)[0];
|
|
8577
|
+
if (V.length < y.g.h.length ? y = "" : (y = V.replace(new RegExp(c, "g"), a), y = y.replace(RegExp("9", "g"), " ")), 0 < y.length ? (u.v.g(y), u = !0) : u = !1, u) return d.da = r, d.ha = Y1.test(p(s, 4)), d.$ = 0, !0;
|
|
8578
8578
|
}
|
|
8579
8579
|
return d.u = !1;
|
|
8580
8580
|
}
|
|
@@ -8592,7 +8592,7 @@ const Z2 = (y) => {
|
|
|
8592
8592
|
if (!d.la) {
|
|
8593
8593
|
if ($2(d)) {
|
|
8594
8594
|
if (i2(d)) return Q1(d);
|
|
8595
|
-
} else if (0 < d.o.length && (t = d.g.toString(),
|
|
8595
|
+
} 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);
|
|
8596
8596
|
}
|
|
8597
8597
|
return d.s.toString();
|
|
8598
8598
|
}
|
|
@@ -8609,11 +8609,11 @@ const Z2 = (y) => {
|
|
|
8609
8609
|
}
|
|
8610
8610
|
}
|
|
8611
8611
|
function Q1(d) {
|
|
8612
|
-
return d.u = !0, d.ea = !1, d.j = [], d.$ = 0,
|
|
8612
|
+
return d.u = !0, d.ea = !1, d.j = [], d.$ = 0, B(d.v), d.da = "", y1(d);
|
|
8613
8613
|
}
|
|
8614
8614
|
function d2(d) {
|
|
8615
8615
|
for (var t = d.g.toString(), $ = d.j.length, s = 0; s < $; ++s) {
|
|
8616
|
-
var r = d.j[s], u =
|
|
8616
|
+
var r = d.j[s], u = w(r, 1);
|
|
8617
8617
|
if (new RegExp("^(?:" + u + ")$").test(t) && (d.ha = Y1.test(p(r, 4)), r = t.replace(new RegExp(u, "g"), p(r, 2)), r = c1(d, r), o1(r, g2) == d.ba)) return r;
|
|
8618
8618
|
}
|
|
8619
8619
|
return "";
|
|
@@ -8627,7 +8627,7 @@ const Z2 = (y) => {
|
|
|
8627
8627
|
if (3 <= t.length) {
|
|
8628
8628
|
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) {
|
|
8629
8629
|
var u = $[r];
|
|
8630
|
-
0 < d.o.length && G1(
|
|
8630
|
+
0 < d.o.length && G1(w(u, 4)) && !p(u, 6) && !R(u, 5) || (d.o.length != 0 || d.ca || G1(w(u, 4)) || p(u, 6)) && E2.test(w(u, 2)) && d.j.push(u);
|
|
8631
8631
|
}
|
|
8632
8632
|
return X1(d, t), t = d2(d), 0 < t.length ? t : q1(d) ? t2(d) : d.s.toString();
|
|
8633
8633
|
}
|
|
@@ -8645,22 +8645,22 @@ const Z2 = (y) => {
|
|
|
8645
8645
|
var t = d.g.toString(), $ = 0;
|
|
8646
8646
|
if (p(d.l, 10) != 1) var s = !1;
|
|
8647
8647
|
else s = d.g.toString(), s = s.charAt(0) == "1" && s.charAt(1) != "0" && s.charAt(1) != "1";
|
|
8648
|
-
return s ? ($ = 1, d.h.g("1").g(" "), d.ca = !0) :
|
|
8648
|
+
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, $);
|
|
8649
8649
|
}
|
|
8650
8650
|
function $2(d) {
|
|
8651
8651
|
var t = d.ba.toString(), $ = new RegExp("^(?:\\+|" + p(d.l, 11) + ")");
|
|
8652
|
-
return $ = t.match($), $ != null && $[0] != null && 0 < $[0].length ? (d.ca = !0, $ = $[0].length,
|
|
8652
|
+
return $ = t.match($), $ != null && $[0] != null && 0 < $[0].length ? (d.ca = !0, $ = $[0].length, B(d.g), d.g.g(t.substring($)), B(d.h), d.h.g(t.substring(0, $)), t.charAt(0) != "+" && d.h.g(" "), !0) : !1;
|
|
8653
8653
|
}
|
|
8654
8654
|
function i2(d) {
|
|
8655
8655
|
if (d.g.h.length == 0) return !1;
|
|
8656
8656
|
var t = new A(), $ = H1(d.g, t);
|
|
8657
|
-
return $ == 0 ? !1 : (
|
|
8657
|
+
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);
|
|
8658
8658
|
}
|
|
8659
8659
|
function n2(d, t) {
|
|
8660
8660
|
var $ = d.v.toString();
|
|
8661
8661
|
if (0 <= $.substring(d.$).search(d.fa)) {
|
|
8662
8662
|
var s = $.search(d.fa);
|
|
8663
|
-
return t = $.replace(d.fa, t),
|
|
8663
|
+
return t = $.replace(d.fa, t), B(d.v), d.v.g(t), d.$ = s, t.substring(0, d.$ + 1);
|
|
8664
8664
|
}
|
|
8665
8665
|
return d.j.length == 1 && (d.u = !1), d.da = "", d.s.toString();
|
|
8666
8666
|
}
|
|
@@ -8687,22 +8687,22 @@ const Z2 = (y) => {
|
|
|
8687
8687
|
}
|
|
8688
8688
|
}), e("intlTelInputUtilsTemp.getExampleNumber", (d, t, $, s) => {
|
|
8689
8689
|
try {
|
|
8690
|
-
const
|
|
8690
|
+
const y = M.g();
|
|
8691
8691
|
d: {
|
|
8692
|
-
var r =
|
|
8692
|
+
var r = y;
|
|
8693
8693
|
if (u1(d)) {
|
|
8694
8694
|
var u = a1(j(r, d), $);
|
|
8695
8695
|
try {
|
|
8696
|
-
if (
|
|
8697
|
-
var a = p(u, 6),
|
|
8696
|
+
if (R(u, 6)) {
|
|
8697
|
+
var a = p(u, 6), c = z1(r, a, d, !1);
|
|
8698
8698
|
break d;
|
|
8699
8699
|
}
|
|
8700
8700
|
} catch {
|
|
8701
8701
|
}
|
|
8702
8702
|
}
|
|
8703
|
-
|
|
8703
|
+
c = null;
|
|
8704
8704
|
}
|
|
8705
|
-
return
|
|
8705
|
+
return y.format(c, s ? 0 : t ? 2 : 1);
|
|
8706
8706
|
} catch {
|
|
8707
8707
|
return "";
|
|
8708
8708
|
}
|
|
@@ -8715,7 +8715,7 @@ const Z2 = (y) => {
|
|
|
8715
8715
|
}), e("intlTelInputUtilsTemp.getNumberType", (d, t) => {
|
|
8716
8716
|
try {
|
|
8717
8717
|
const $ = M.g(), s = Z($, d, t);
|
|
8718
|
-
return
|
|
8718
|
+
return U1($, s);
|
|
8719
8719
|
} catch {
|
|
8720
8720
|
return -99;
|
|
8721
8721
|
}
|
|
@@ -8731,8 +8731,8 @@ const Z2 = (y) => {
|
|
|
8731
8731
|
try {
|
|
8732
8732
|
const s = M.g(), r = Z(s, d, t), u = T2(s, r);
|
|
8733
8733
|
if ($) {
|
|
8734
|
-
const a = s2($).map((
|
|
8735
|
-
return u && a.includes(
|
|
8734
|
+
const a = s2($).map((c) => _1[c]);
|
|
8735
|
+
return u && a.includes(U1(s, r));
|
|
8736
8736
|
}
|
|
8737
8737
|
return u;
|
|
8738
8738
|
} catch {
|
|
@@ -8760,7 +8760,7 @@ const Z2 = (y) => {
|
|
|
8760
8760
|
})();
|
|
8761
8761
|
const h2 = typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : void 0, Y2 = h2.intlTelInputUtilsTemp;
|
|
8762
8762
|
delete h2.intlTelInputUtilsTemp;
|
|
8763
|
-
|
|
8763
|
+
C.utils = Y2;
|
|
8764
8764
|
const q2 = {
|
|
8765
8765
|
__name: "IntlTelInputWithUtils",
|
|
8766
8766
|
props: /* @__PURE__ */ r2({
|
|
@@ -8793,41 +8793,41 @@ const q2 = {
|
|
|
8793
8793
|
"changeValidity",
|
|
8794
8794
|
"changeErrorCode"
|
|
8795
8795
|
], ["update:modelValue"]),
|
|
8796
|
-
setup(
|
|
8797
|
-
const n = D2(
|
|
8798
|
-
let f =
|
|
8799
|
-
|
|
8796
|
+
setup(m, { expose: e, emit: i }) {
|
|
8797
|
+
const n = D2(m, "modelValue"), o = m, l = i, g = v1(), h = v1(), _ = v1(!1), L = () => h.value ? o.options.strictMode ? h.value.isValidNumberPrecise() : h.value.isValidNumber() : null, v = () => {
|
|
8798
|
+
let f = L();
|
|
8799
|
+
_.value !== f && (_.value = f, l("changeValidity", !!f), l(
|
|
8800
8800
|
"changeErrorCode",
|
|
8801
|
-
f ? null :
|
|
8801
|
+
f ? null : h.value.getValidationError()
|
|
8802
8802
|
));
|
|
8803
|
-
},
|
|
8803
|
+
}, S = () => {
|
|
8804
8804
|
var f;
|
|
8805
|
-
l("changeNumber", ((f =
|
|
8806
|
-
},
|
|
8805
|
+
l("changeNumber", ((f = h.value) == null ? void 0 : f.getNumber()) ?? ""), v();
|
|
8806
|
+
}, T = () => {
|
|
8807
8807
|
var f;
|
|
8808
|
-
l("changeCountry", ((f =
|
|
8808
|
+
l("changeCountry", ((f = h.value) == null ? void 0 : f.getSelectedCountryData().iso2) ?? ""), S(), v();
|
|
8809
8809
|
};
|
|
8810
8810
|
return P2(() => {
|
|
8811
|
-
|
|
8811
|
+
g.value && (h.value = C(g.value, o.options), o.value && h.value.setNumber(o.value), o.disabled && h.value.setDisabled(o.disabled), _.value = L());
|
|
8812
8812
|
}), x2(
|
|
8813
8813
|
() => o.disabled,
|
|
8814
8814
|
(f) => {
|
|
8815
8815
|
var I;
|
|
8816
|
-
return (I =
|
|
8816
|
+
return (I = h.value) == null ? void 0 : I.setDisabled(f);
|
|
8817
8817
|
}
|
|
8818
8818
|
), R2(() => {
|
|
8819
8819
|
var f;
|
|
8820
|
-
return (f =
|
|
8821
|
-
}), e({ instance:
|
|
8820
|
+
return (f = h.value) == null ? void 0 : f.destroy();
|
|
8821
|
+
}), e({ instance: h, input: g }), (f, I) => B2((O2(), k2("input", G2({
|
|
8822
8822
|
ref_key: "input",
|
|
8823
|
-
ref:
|
|
8824
|
-
"onUpdate:modelValue": I[0] || (I[0] = (
|
|
8823
|
+
ref: g,
|
|
8824
|
+
"onUpdate:modelValue": I[0] || (I[0] = (O) => n.value = O),
|
|
8825
8825
|
type: "tel",
|
|
8826
|
-
onCountrychange:
|
|
8827
|
-
onInput:
|
|
8828
|
-
},
|
|
8826
|
+
onCountrychange: T,
|
|
8827
|
+
onInput: S
|
|
8828
|
+
}, m.inputProps), null, 16)), [
|
|
8829
8829
|
[
|
|
8830
|
-
|
|
8830
|
+
F2,
|
|
8831
8831
|
n.value,
|
|
8832
8832
|
void 0,
|
|
8833
8833
|
{ lazy: !0 }
|