intl-tel-input 25.10.7 → 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.
- package/README.md +5 -5
- package/angular/README.md +1 -1
- package/angular/build/IntlTelInput.js +385 -319
- package/angular/build/IntlTelInputWithUtils.js +436 -341
- package/angular/build/types/intl-tel-input/angular.d.ts +2 -1
- package/angular/build/types/intl-tel-input/angularWithUtils.d.ts +2 -1
- package/angular/build/types/intl-tel-input/data.d.ts +3 -1
- package/angular/build/types/intl-tel-input/i18n/types.d.ts +2 -245
- package/angular/build/types/intl-tel-input.d.ts +16 -87
- package/angular/build/types/modules/core/options.d.ts +3 -0
- package/angular/build/types/modules/data/country-data.d.ts +12 -0
- package/angular/build/types/modules/data/nanp-regionless.d.ts +2 -0
- package/angular/build/types/modules/format/caret.d.ts +1 -0
- package/angular/build/types/modules/format/formatting.d.ts +3 -0
- package/angular/build/types/modules/types/public-api.d.ts +79 -0
- package/angular/build/types/modules/utils/dom.d.ts +1 -0
- package/angular/build/types/modules/utils/string.d.ts +2 -0
- package/build/js/data.js +3 -2
- package/build/js/data.min.js +2 -2
- package/build/js/intlTelInput.d.ts +99 -292
- package/build/js/intlTelInput.js +431 -360
- package/build/js/intlTelInput.min.js +13 -13
- package/build/js/intlTelInputWithUtils.js +482 -382
- package/build/js/intlTelInputWithUtils.min.js +13 -13
- package/build/js/utils.js +18 -15
- package/package.json +1 -1
- package/react/README.md +1 -1
- package/react/build/IntlTelInput.cjs +430 -359
- package/react/build/IntlTelInput.d.ts +103 -294
- package/react/build/IntlTelInput.js +430 -359
- package/react/build/IntlTelInputWithUtils.cjs +481 -381
- package/react/build/IntlTelInputWithUtils.js +481 -381
- package/vue/README.md +1 -1
- package/vue/build/IntlTelInput.mjs +483 -443
- package/vue/build/IntlTelInputWithUtils.mjs +1128 -1059
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { mergeModels as
|
|
2
|
-
const
|
|
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
|
-
],
|
|
1326
|
-
for (const
|
|
1327
|
-
|
|
1325
|
+
], Z = [];
|
|
1326
|
+
for (const f of K2)
|
|
1327
|
+
Z.push({
|
|
1328
1328
|
name: "",
|
|
1329
1329
|
// populated in the plugin
|
|
1330
|
-
iso2:
|
|
1331
|
-
dialCode:
|
|
1332
|
-
priority:
|
|
1333
|
-
areaCodes:
|
|
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:
|
|
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
|
-
},
|
|
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
|
-
},
|
|
1594
|
-
for (const y of q)
|
|
1595
|
-
y.name = h2[y.iso2];
|
|
1596
|
-
let H2 = 0;
|
|
1597
|
-
const b1 = (y) => typeof window < "u" && typeof window.matchMedia == "function" && window.matchMedia(y).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
|
|
1600
|
-
return
|
|
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
|
-
},
|
|
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 b1 = (y) => 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
|
-
}
|
|
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 b1 = (y) => typeof window < "u" && typeof window.matchMedia == "function"
|
|
|
1669
1761
|
"887",
|
|
1670
1762
|
"888",
|
|
1671
1763
|
"889"
|
|
1672
|
-
],
|
|
1673
|
-
const e =
|
|
1764
|
+
], o2 = (f) => {
|
|
1765
|
+
const e = h1(f);
|
|
1674
1766
|
if (e.charAt(0) === "1") {
|
|
1675
|
-
const
|
|
1676
|
-
return
|
|
1767
|
+
const $ = e.substring(1, 4);
|
|
1768
|
+
return t0.includes($);
|
|
1677
1769
|
}
|
|
1678
1770
|
return !1;
|
|
1679
|
-
}, z2 = (y, 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 === y && !n)
|
|
1685
|
-
return l + 1;
|
|
1686
|
-
if (n && o === y + 1)
|
|
1687
|
-
return l;
|
|
1688
|
-
}
|
|
1689
|
-
return e.length;
|
|
1690
|
-
}, T = (y, e, i) => {
|
|
1691
|
-
const n = document.createElement(y);
|
|
1692
|
-
return e && Object.entries(e).forEach(([o, l]) => n.setAttribute(o, l)), i && i.appendChild(n), n;
|
|
1693
|
-
}, i1 = (y, ...e) => {
|
|
1694
|
-
const { instances: i } = m;
|
|
1695
|
-
Object.values(i).forEach((n) => n[y](...e));
|
|
1696
1771
|
};
|
|
1697
|
-
|
|
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((
|
|
1785
|
+
return Object.keys(e).filter(($) => !!e[$]).join(" ");
|
|
1704
1786
|
}
|
|
1705
|
-
constructor(e,
|
|
1706
|
-
this.id =
|
|
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
|
-
|
|
1709
|
-
|
|
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)
|
|
1713
|
-
|
|
1714
|
-
|
|
1715
|
-
|
|
1716
|
-
this.
|
|
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([
|
|
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.
|
|
1726
|
-
|
|
1727
|
-
|
|
1728
|
-
_cacheSearchTokens() {
|
|
1729
|
-
for (const e of this.countries)
|
|
1730
|
-
e.normalisedName = u2(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 = q.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 = q.filter(
|
|
1770
|
-
(o) => !n.includes(o.iso2)
|
|
1771
|
-
);
|
|
1772
|
-
} else
|
|
1773
|
-
this.countries = q;
|
|
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
|
-
|
|
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
|
-
|
|
1809
|
-
|
|
1810
|
-
|
|
1811
|
-
|
|
1812
|
-
dropdownContainer: f,
|
|
1813
|
-
fixDropdownWidth: h,
|
|
1814
|
-
useFullscreenPopup: C,
|
|
1815
|
-
countrySearch: I,
|
|
1816
|
-
i18n: v
|
|
1817
|
-
} = this.options, g = g1._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":
|
|
1821
|
-
"iti--inline-dropdown": !
|
|
1822
|
-
[
|
|
1823
|
-
}),
|
|
1824
|
-
|
|
1825
|
-
|
|
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
|
-
|
|
1830
|
-
), this.showSelectedCountryOnLeft ? this.countryContainer.style.left = "0px" : this.countryContainer.style.right = "0px",
|
|
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 g1 {
|
|
|
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 =
|
|
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
|
|
1869
|
+
const u = L(
|
|
1847
1870
|
"div",
|
|
1848
1871
|
{ class: "iti__selected-country-primary" },
|
|
1849
1872
|
this.selectedCountry
|
|
1850
1873
|
);
|
|
1851
|
-
|
|
1874
|
+
this.selectedCountryInner = L(
|
|
1852
1875
|
"div",
|
|
1853
1876
|
{ class: "iti__flag" },
|
|
1854
|
-
|
|
1855
|
-
),
|
|
1877
|
+
u
|
|
1878
|
+
), $ && (this.dropdownArrow = L(
|
|
1856
1879
|
"div",
|
|
1857
1880
|
{ class: "iti__arrow", "aria-hidden": "true" },
|
|
1858
|
-
|
|
1859
|
-
)), i && (this.selectedDialCode =
|
|
1881
|
+
u
|
|
1882
|
+
)), i && (this.selectedDialCode = L(
|
|
1860
1883
|
"div",
|
|
1861
1884
|
{ class: "iti__selected-dial-code", dir: "ltr" },
|
|
1862
1885
|
this.selectedCountry
|
|
1863
|
-
)),
|
|
1864
|
-
const R = h ? "" : "iti--flexible-dropdown-width";
|
|
1865
|
-
if (this.dropdownContent = T("div", {
|
|
1866
|
-
id: `iti-${this.id}__dropdown-content`,
|
|
1867
|
-
class: `iti__dropdown-content iti__hide ${R}`,
|
|
1868
|
-
role: "dialog",
|
|
1869
|
-
"aria-modal": "true"
|
|
1870
|
-
}), I) {
|
|
1871
|
-
const N = T(
|
|
1872
|
-
"div",
|
|
1873
|
-
{ class: "iti__search-input-wrapper" },
|
|
1874
|
-
this.dropdownContent
|
|
1875
|
-
);
|
|
1876
|
-
this.searchIcon = T(
|
|
1877
|
-
"span",
|
|
1878
|
-
{
|
|
1879
|
-
class: "iti__search-icon",
|
|
1880
|
-
"aria-hidden": "true"
|
|
1881
|
-
},
|
|
1882
|
-
N
|
|
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 = T(
|
|
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: v.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": v.searchPlaceholder,
|
|
1899
|
-
"aria-controls": `iti-${this.id}__country-listbox`,
|
|
1900
|
-
"aria-autocomplete": "list",
|
|
1901
|
-
autocomplete: "off"
|
|
1902
|
-
},
|
|
1903
|
-
N
|
|
1904
|
-
), this.searchClearButton = T(
|
|
1905
|
-
"button",
|
|
1906
|
-
{
|
|
1907
|
-
type: "button",
|
|
1908
|
-
class: "iti__search-clear iti__hide",
|
|
1909
|
-
"aria-label": v.clearSearchAriaLabel,
|
|
1910
|
-
tabindex: "-1"
|
|
1911
|
-
},
|
|
1912
|
-
N
|
|
1913
|
-
);
|
|
1914
|
-
const W = `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="${W}" 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(#${W})" />
|
|
1922
|
-
</svg>`, this.searchResultsA11yText = T(
|
|
1923
|
-
"span",
|
|
1924
|
-
{ class: "iti__a11y-text" },
|
|
1925
|
-
this.dropdownContent
|
|
1926
|
-
), this.searchNoResults = T(
|
|
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 = v.zeroSearchResults;
|
|
1935
|
-
}
|
|
1936
|
-
if (this.countryList = T(
|
|
1937
|
-
"ul",
|
|
1938
|
-
{
|
|
1939
|
-
class: "iti__country-list",
|
|
1940
|
-
id: `iti-${this.id}__country-listbox`,
|
|
1941
|
-
role: "listbox",
|
|
1942
|
-
"aria-label": v.countryListAriaLabel
|
|
1943
|
-
},
|
|
1944
|
-
this.dropdownContent
|
|
1945
|
-
), this._appendListItems(), I && this._updateSearchResultsA11yText(), f) {
|
|
1946
|
-
const N = g1._buildClassNames({
|
|
1947
|
-
iti: !0,
|
|
1948
|
-
"iti--container": !0,
|
|
1949
|
-
"iti--fullscreen-popup": C,
|
|
1950
|
-
"iti--inline-dropdown": !C,
|
|
1951
|
-
[o]: !!o
|
|
1952
|
-
});
|
|
1953
|
-
this.dropdown = T("div", { class: N }), this.dropdown.appendChild(this.dropdownContent);
|
|
1954
|
-
} else
|
|
1955
|
-
this.countryContainer.appendChild(this.dropdownContent);
|
|
1956
|
-
}
|
|
1886
|
+
)), $ && this._buildDropdownContent();
|
|
1957
1887
|
}
|
|
1958
|
-
|
|
1959
|
-
|
|
1960
|
-
|
|
1961
|
-
|
|
1962
|
-
|
|
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:
|
|
1965
|
-
}),
|
|
2002
|
+
name: h.phone
|
|
2003
|
+
}), e.appendChild(this.hiddenInput));
|
|
1966
2004
|
}
|
|
1967
|
-
if (
|
|
1968
|
-
const
|
|
1969
|
-
|
|
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:
|
|
1972
|
-
}),
|
|
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
|
|
2017
|
+
const $ = this.countries[e], i = e === 0 ? "iti__highlight" : "", s = L(
|
|
1980
2018
|
"li",
|
|
1981
2019
|
{
|
|
1982
|
-
id: `iti-${this.id}__item-${
|
|
1983
|
-
class: `iti__country ${
|
|
2020
|
+
id: `iti-${this.id}__item-${$.iso2}`,
|
|
2021
|
+
class: `iti__country ${i}`,
|
|
1984
2022
|
tabindex: "-1",
|
|
1985
2023
|
role: "option",
|
|
1986
|
-
"data-dial-code":
|
|
1987
|
-
"data-country-code":
|
|
2024
|
+
"data-dial-code": $.dialCode,
|
|
2025
|
+
"data-country-code": $.iso2,
|
|
1988
2026
|
"aria-selected": "false"
|
|
1989
2027
|
},
|
|
1990
2028
|
this.countryList
|
|
1991
2029
|
);
|
|
1992
|
-
|
|
1993
|
-
let
|
|
1994
|
-
this.options.showFlags && (
|
|
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
|
|
2002
|
-
if (
|
|
2003
|
-
this._updateCountryFromNumber(
|
|
2004
|
-
else if (!
|
|
2005
|
-
const
|
|
2006
|
-
|
|
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
|
-
|
|
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 g1 {
|
|
|
2023
2061
|
}
|
|
2024
2062
|
//* initialise the dropdown listeners.
|
|
2025
2063
|
_initDropdownListeners() {
|
|
2026
|
-
this._handleLabelClick = (
|
|
2027
|
-
this.dropdownContent.classList.contains("iti__hide") ? this.telInput.focus() :
|
|
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 = (
|
|
2033
|
-
this.dropdownContent.classList.contains("iti__hide") && ["ArrowUp", "ArrowDown", " ", "Enter"].includes(
|
|
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 g1 {
|
|
|
2038
2076
|
}
|
|
2039
2077
|
//* Init many requests: utils script / geo ip lookup.
|
|
2040
2078
|
_initRequests() {
|
|
2041
|
-
let { loadUtils: e, initialCountry:
|
|
2042
|
-
e && !
|
|
2043
|
-
var
|
|
2044
|
-
window.removeEventListener("load", this._handlePageLoad), (
|
|
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
|
-
},
|
|
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
|
-
|
|
2088
|
+
y.autoCountry ? this.handleAutoCountry() : y.startedLoadingAutoCountry || (y.startedLoadingAutoCountry = !0, typeof this.options.geoIpLookup == "function" && this.options.geoIpLookup(
|
|
2051
2089
|
(e = "") => {
|
|
2052
|
-
const
|
|
2053
|
-
|
|
2090
|
+
const $ = e.toLowerCase();
|
|
2091
|
+
w1($) ? (y.autoCountry = $, setTimeout(() => e1("handleAutoCountry"))) : (this._setInitialState(!0), e1("rejectAutoCountryPromise"));
|
|
2054
2092
|
},
|
|
2055
2093
|
() => {
|
|
2056
|
-
this._setInitialState(!0),
|
|
2094
|
+
this._setInitialState(!0), e1("rejectAutoCountryPromise");
|
|
2057
2095
|
}
|
|
2058
2096
|
));
|
|
2059
2097
|
}
|
|
@@ -2062,167 +2100,184 @@ class g1 {
|
|
|
2062
2100
|
}
|
|
2063
2101
|
//* Initialize the tel input listeners.
|
|
2064
2102
|
_initTelInputListeners() {
|
|
2065
|
-
|
|
2066
|
-
|
|
2067
|
-
|
|
2068
|
-
|
|
2069
|
-
|
|
2070
|
-
|
|
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 C = (
|
|
2075
|
-
C ||
|
|
2076
|
-
const
|
|
2077
|
-
if (
|
|
2078
|
-
const
|
|
2079
|
-
|
|
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)
|
|
2082
|
-
|
|
2083
|
-
|
|
2084
|
-
|
|
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
|
|
2089
|
-
(!
|
|
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
|
-
}, this.telInput.addEventListener("keydown", this._handleKeydownEvent))
|
|
2093
|
-
|
|
2094
|
-
|
|
2095
|
-
|
|
2096
|
-
|
|
2097
|
-
|
|
2098
|
-
|
|
2099
|
-
|
|
2100
|
-
|
|
2143
|
+
}, this.telInput.addEventListener("keydown", this._handleKeydownEvent));
|
|
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);
|
|
2101
2158
|
} else
|
|
2102
2159
|
return;
|
|
2103
|
-
|
|
2104
|
-
const
|
|
2105
|
-
|
|
2160
|
+
$.value = A;
|
|
2161
|
+
const H = i + D.length;
|
|
2162
|
+
$.setSelectionRange(H, H), $.dispatchEvent(new InputEvent("input", { bubbles: !0 }));
|
|
2106
2163
|
}, this.telInput.addEventListener("paste", this._handlePasteEvent));
|
|
2107
2164
|
}
|
|
2108
2165
|
//* Adhere to the input's maxlength attr.
|
|
2109
2166
|
_cap(e) {
|
|
2110
|
-
const
|
|
2111
|
-
return
|
|
2167
|
+
const $ = parseInt(this.telInput.getAttribute("maxlength") || "", 10);
|
|
2168
|
+
return $ && e.length > $ ? e.substring(0, $) : e;
|
|
2112
2169
|
}
|
|
2113
2170
|
//* Trigger a custom event on the input.
|
|
2114
|
-
_trigger(e,
|
|
2115
|
-
const
|
|
2171
|
+
_trigger(e, $ = {}) {
|
|
2172
|
+
const i = new CustomEvent(e, {
|
|
2116
2173
|
bubbles: !0,
|
|
2117
2174
|
cancelable: !0,
|
|
2118
|
-
detail:
|
|
2175
|
+
detail: $
|
|
2119
2176
|
});
|
|
2120
|
-
this.telInput.dispatchEvent(
|
|
2177
|
+
this.telInput.dispatchEvent(i);
|
|
2121
2178
|
}
|
|
2122
2179
|
//* Open the dropdown.
|
|
2123
2180
|
_openDropdown() {
|
|
2124
|
-
const { fixDropdownWidth: e, countrySearch:
|
|
2125
|
-
if (e && (this.dropdownContent.style.width = `${this.telInput.offsetWidth}px`), this.dropdownContent.classList.remove("iti__hide"), this.selectedCountry.setAttribute("aria-expanded", "true"), this._setDropdownPosition(),
|
|
2126
|
-
const
|
|
2127
|
-
|
|
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();
|
|
2128
2185
|
}
|
|
2129
2186
|
this._bindDropdownListeners(), this.dropdownArrow.classList.add("iti__arrow--up"), this._trigger("open:countrydropdown");
|
|
2130
2187
|
}
|
|
2131
2188
|
//* Set the dropdown position
|
|
2132
2189
|
_setDropdownPosition() {
|
|
2133
2190
|
if (this.options.dropdownContainer && this.options.dropdownContainer.appendChild(this.dropdown), !this.options.useFullscreenPopup) {
|
|
2134
|
-
const e = this.telInput.getBoundingClientRect(),
|
|
2135
|
-
this.options.dropdownContainer && (this.dropdown.style.top = `${e.top +
|
|
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));
|
|
2136
2193
|
}
|
|
2137
2194
|
}
|
|
2138
2195
|
//* We only bind dropdown listeners when the dropdown is open.
|
|
2139
2196
|
_bindDropdownListeners() {
|
|
2140
|
-
this._handleMouseoverCountryList = (
|
|
2141
|
-
var
|
|
2142
|
-
const
|
|
2143
|
-
|
|
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);
|
|
2144
2201
|
}, this.countryList.addEventListener(
|
|
2145
2202
|
"mouseover",
|
|
2146
2203
|
this._handleMouseoverCountryList
|
|
2147
|
-
), this._handleClickCountryList = (
|
|
2148
|
-
var
|
|
2149
|
-
const
|
|
2150
|
-
|
|
2151
|
-
}, this.countryList.addEventListener("click", this._handleClickCountryList), this._handleClickOffToClose = (
|
|
2152
|
-
!!
|
|
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();
|
|
2153
2210
|
}, setTimeout(() => {
|
|
2154
2211
|
document.documentElement.addEventListener(
|
|
2155
2212
|
"click",
|
|
2156
2213
|
this._handleClickOffToClose
|
|
2157
2214
|
);
|
|
2158
2215
|
}, 0);
|
|
2159
|
-
let e = "",
|
|
2160
|
-
if (this._handleKeydownOnDropdown = (
|
|
2161
|
-
["ArrowUp", "ArrowDown", "Enter", "Escape"].includes(
|
|
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(() => {
|
|
2162
2219
|
e = "";
|
|
2163
2220
|
}, 1e3));
|
|
2164
2221
|
}, document.addEventListener("keydown", this._handleKeydownOnDropdown), this.options.countrySearch) {
|
|
2165
|
-
const
|
|
2166
|
-
const
|
|
2167
|
-
this._filterCountries(
|
|
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");
|
|
2168
2225
|
};
|
|
2169
|
-
let
|
|
2226
|
+
let s = null;
|
|
2170
2227
|
this._handleSearchChange = () => {
|
|
2171
|
-
|
|
2172
|
-
|
|
2228
|
+
s && clearTimeout(s), s = setTimeout(() => {
|
|
2229
|
+
i(), s = null;
|
|
2173
2230
|
}, 100);
|
|
2174
2231
|
}, this.searchInput.addEventListener("input", this._handleSearchChange), this._handleSearchClear = () => {
|
|
2175
|
-
this.searchInput.value = "", this.searchInput.focus(),
|
|
2232
|
+
this.searchInput.value = "", this.searchInput.focus(), i();
|
|
2176
2233
|
}, this.searchClearButton.addEventListener("click", this._handleSearchClear);
|
|
2177
2234
|
}
|
|
2178
2235
|
}
|
|
2179
2236
|
//* Hidden search (countrySearch disabled): Find the first list item whose name starts with the query string.
|
|
2180
2237
|
_searchForCountry(e) {
|
|
2181
|
-
for (const
|
|
2182
|
-
if (
|
|
2183
|
-
const
|
|
2184
|
-
this._highlightListItem(
|
|
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);
|
|
2185
2242
|
break;
|
|
2186
2243
|
}
|
|
2187
2244
|
}
|
|
2188
2245
|
//* Country search enabled: Filter the countries according to the search query.
|
|
2189
2246
|
_filterCountries(e) {
|
|
2190
|
-
let i = !0;
|
|
2191
2247
|
this.countryList.innerHTML = "";
|
|
2192
|
-
|
|
2193
|
-
|
|
2194
|
-
|
|
2195
|
-
|
|
2196
|
-
|
|
2197
|
-
|
|
2198
|
-
for (const g of this.countries)
|
|
2199
|
-
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 ? C.push(g) : g.dialCodePlus.includes(n) ? I.push(g) : g.initials.includes(n) && v.push(g);
|
|
2200
|
-
o = [
|
|
2201
|
-
...l.sort((g, w) => g.priority - w.priority),
|
|
2202
|
-
...f.sort((g, w) => g.priority - w.priority),
|
|
2203
|
-
...h.sort((g, w) => g.priority - w.priority),
|
|
2204
|
-
...C.sort((g, w) => g.priority - w.priority),
|
|
2205
|
-
...I.sort((g, w) => g.priority - w.priority),
|
|
2206
|
-
...v.sort((g, w) => g.priority - w.priority)
|
|
2207
|
-
];
|
|
2208
|
-
}
|
|
2209
|
-
for (const l of o) {
|
|
2210
|
-
const f = l.nodeById[this.id];
|
|
2211
|
-
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));
|
|
2212
2254
|
}
|
|
2213
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();
|
|
2214
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
|
+
}
|
|
2215
2270
|
//* Update search results text (for a11y).
|
|
2216
2271
|
_updateSearchResultsA11yText() {
|
|
2217
|
-
const { i18n: e } = this.options,
|
|
2218
|
-
let
|
|
2219
|
-
|
|
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;
|
|
2220
2275
|
}
|
|
2221
2276
|
//* Highlight the next/prev item in the list (and ensure it is visible).
|
|
2222
2277
|
_handleUpDownKey(e) {
|
|
2223
|
-
var
|
|
2224
|
-
let
|
|
2225
|
-
|
|
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));
|
|
2226
2281
|
}
|
|
2227
2282
|
//* Select the currently highlighted item.
|
|
2228
2283
|
_handleEnterKey() {
|
|
@@ -2231,120 +2286,110 @@ class g1 {
|
|
|
2231
2286
|
//* Update the input's value to the given val (format first if possible)
|
|
2232
2287
|
//* NOTE: this is called from _setInitialState, handleUtils and setNumber.
|
|
2233
2288
|
_updateValFromNumber(e) {
|
|
2234
|
-
let
|
|
2235
|
-
if (this.options.formatOnDisplay &&
|
|
2236
|
-
const
|
|
2237
|
-
|
|
2238
|
-
|
|
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
|
+
$,
|
|
2239
2294
|
this.selectedCountryData.iso2,
|
|
2240
|
-
|
|
2295
|
+
h
|
|
2241
2296
|
);
|
|
2242
2297
|
}
|
|
2243
|
-
|
|
2298
|
+
$ = this._beforeSetNumber($), this.telInput.value = $;
|
|
2244
2299
|
}
|
|
2245
2300
|
//* Check if need to select a new country based on the given number
|
|
2246
2301
|
//* Note: called from _setInitialState, keyup handler, setNumber.
|
|
2247
2302
|
_updateCountryFromNumber(e) {
|
|
2248
|
-
const
|
|
2249
|
-
return
|
|
2303
|
+
const $ = this._getNewCountryFromNumber(e);
|
|
2304
|
+
return $ !== null ? this._setCountry($) : !1;
|
|
2250
2305
|
}
|
|
2251
2306
|
_ensureHasDialCode(e) {
|
|
2252
|
-
const { dialCode:
|
|
2253
|
-
if (e.charAt(0) === "+" ||
|
|
2307
|
+
const { dialCode: $, nationalPrefix: i } = this.selectedCountryData;
|
|
2308
|
+
if (e.charAt(0) === "+" || !$)
|
|
2254
2309
|
return e;
|
|
2255
|
-
const
|
|
2256
|
-
return `+${
|
|
2310
|
+
const h = i && e.charAt(0) === i && !this.options.separateDialCode ? e.substring(1) : e;
|
|
2311
|
+
return `+${$}${h}`;
|
|
2257
2312
|
}
|
|
2258
2313
|
// Get the country ISO2 code from the given number
|
|
2259
2314
|
// BUT ONLY IF ITS CHANGED FROM THE CURRENTLY SELECTED COUNTRY
|
|
2260
2315
|
// NOTE: consider refactoring this to be more clear
|
|
2261
2316
|
_getNewCountryFromNumber(e) {
|
|
2262
|
-
const
|
|
2263
|
-
let
|
|
2264
|
-
const
|
|
2265
|
-
|
|
2266
|
-
const
|
|
2267
|
-
if (
|
|
2268
|
-
const C =
|
|
2269
|
-
if (
|
|
2270
|
-
return
|
|
2271
|
-
if (!
|
|
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))
|
|
2272
2327
|
return this.defaultCountry;
|
|
2273
|
-
if (
|
|
2328
|
+
if (u === "1" && o2(c))
|
|
2274
2329
|
return null;
|
|
2275
|
-
const
|
|
2276
|
-
if (!(
|
|
2277
|
-
return
|
|
2330
|
+
const S = this.selectedCountryData.areaCodes && c.length > C.length;
|
|
2331
|
+
if (!(s && g.includes(s) && !S))
|
|
2332
|
+
return g[0];
|
|
2278
2333
|
} else {
|
|
2279
|
-
if (
|
|
2334
|
+
if (i.charAt(0) === "+" && c.length)
|
|
2280
2335
|
return "";
|
|
2281
|
-
if ((!
|
|
2336
|
+
if ((!i || i === "+") && !s)
|
|
2282
2337
|
return this.defaultCountry;
|
|
2283
2338
|
}
|
|
2284
2339
|
return null;
|
|
2285
2340
|
}
|
|
2286
2341
|
//* Remove highlighting from other list items and highlight the given item.
|
|
2287
|
-
_highlightListItem(e,
|
|
2288
|
-
const
|
|
2289
|
-
if (
|
|
2290
|
-
const
|
|
2291
|
-
this.searchInput.setAttribute("aria-activedescendant",
|
|
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);
|
|
2292
2347
|
}
|
|
2293
|
-
|
|
2294
|
-
}
|
|
2295
|
-
//* Find the country data for the given iso2 code
|
|
2296
|
-
//* 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
|
|
2297
|
-
_getCountryData(e, i) {
|
|
2298
|
-
const n = this.countryByIso2.get(e);
|
|
2299
|
-
if (n)
|
|
2300
|
-
return n;
|
|
2301
|
-
if (i)
|
|
2302
|
-
return null;
|
|
2303
|
-
throw new Error(`No country data for '${e}'`);
|
|
2348
|
+
$ && this.highlightedItem.focus();
|
|
2304
2349
|
}
|
|
2305
2350
|
//* Update the selected country, dial code (if separateDialCode), placeholder, title, and active list item.
|
|
2306
2351
|
//* Note: called from _setInitialState, _updateCountryFromNumber, _selectListItem, setCountry.
|
|
2307
2352
|
_setCountry(e) {
|
|
2308
|
-
const { separateDialCode:
|
|
2309
|
-
if (this.selectedCountryData = e ? this.
|
|
2310
|
-
const
|
|
2311
|
-
let
|
|
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;
|
|
2312
2357
|
if (e) {
|
|
2313
|
-
const { name:
|
|
2314
|
-
C =
|
|
2358
|
+
const { name: g, dialCode: I } = this.selectedCountryData;
|
|
2359
|
+
C = g, c = s.selectedCountryAriaLabel.replace("${countryName}", g).replace("${dialCode}", `+${I}`);
|
|
2315
2360
|
} else
|
|
2316
|
-
C =
|
|
2317
|
-
this.selectedCountryInner.className =
|
|
2361
|
+
C = s.noCountrySelected, c = s.noCountrySelected;
|
|
2362
|
+
this.selectedCountryInner.className = h, this.selectedCountry.setAttribute("title", C), this.selectedCountry.setAttribute("aria-label", c);
|
|
2318
2363
|
}
|
|
2319
|
-
if (
|
|
2320
|
-
const
|
|
2321
|
-
this.selectedDialCode.innerHTML =
|
|
2364
|
+
if ($) {
|
|
2365
|
+
const h = this.selectedCountryData.dialCode ? `+${this.selectedCountryData.dialCode}` : "";
|
|
2366
|
+
this.selectedDialCode.innerHTML = h, this._updateInputPadding();
|
|
2322
2367
|
}
|
|
2323
|
-
return this._updatePlaceholder(), this._updateMaxLength(),
|
|
2368
|
+
return this._updatePlaceholder(), this._updateMaxLength(), u !== e;
|
|
2324
2369
|
}
|
|
2325
2370
|
//* Update the input padding to make space for the selected country/dial code.
|
|
2326
2371
|
_updateInputPadding() {
|
|
2327
2372
|
if (this.selectedCountry) {
|
|
2328
|
-
const e = this.options.separateDialCode ? 78 : 42,
|
|
2329
|
-
this.showSelectedCountryOnLeft ? this.telInput.style.paddingLeft = `${
|
|
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`;
|
|
2330
2375
|
}
|
|
2331
2376
|
}
|
|
2332
2377
|
//* Update the maximum valid number length for the currently selected country.
|
|
2333
2378
|
_updateMaxLength() {
|
|
2334
|
-
const { strictMode: e, placeholderNumberType:
|
|
2335
|
-
if (e &&
|
|
2336
|
-
if (
|
|
2337
|
-
const
|
|
2338
|
-
let
|
|
2339
|
-
|
|
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,
|
|
2340
2385
|
!1,
|
|
2341
|
-
|
|
2386
|
+
u,
|
|
2342
2387
|
!0
|
|
2343
|
-
),
|
|
2344
|
-
for (;
|
|
2345
|
-
|
|
2346
|
-
const C =
|
|
2347
|
-
this.maxCoreNumberLength = C.length,
|
|
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);
|
|
2348
2393
|
} else
|
|
2349
2394
|
this.maxCoreNumberLength = null;
|
|
2350
2395
|
}
|
|
@@ -2360,14 +2405,14 @@ class g1 {
|
|
|
2360
2405
|
} catch {
|
|
2361
2406
|
e = document.body;
|
|
2362
2407
|
}
|
|
2363
|
-
const
|
|
2364
|
-
|
|
2365
|
-
const
|
|
2366
|
-
|
|
2367
|
-
const
|
|
2368
|
-
|
|
2369
|
-
const
|
|
2370
|
-
return e.removeChild(
|
|
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;
|
|
2371
2416
|
}
|
|
2372
2417
|
return 0;
|
|
2373
2418
|
}
|
|
@@ -2375,26 +2420,26 @@ class g1 {
|
|
|
2375
2420
|
_updatePlaceholder() {
|
|
2376
2421
|
const {
|
|
2377
2422
|
autoPlaceholder: e,
|
|
2378
|
-
placeholderNumberType:
|
|
2379
|
-
nationalMode:
|
|
2380
|
-
customPlaceholder:
|
|
2381
|
-
} = this.options,
|
|
2382
|
-
if (
|
|
2383
|
-
const
|
|
2384
|
-
let
|
|
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(
|
|
2385
2430
|
this.selectedCountryData.iso2,
|
|
2386
|
-
|
|
2387
|
-
|
|
2431
|
+
i,
|
|
2432
|
+
h
|
|
2388
2433
|
) : "";
|
|
2389
|
-
|
|
2434
|
+
c = this._beforeSetNumber(c), typeof s == "function" && (c = s(c, this.selectedCountryData)), this.telInput.setAttribute("placeholder", c);
|
|
2390
2435
|
}
|
|
2391
2436
|
}
|
|
2392
2437
|
//* Called when the user selects a list item from the dropdown.
|
|
2393
2438
|
_selectListItem(e) {
|
|
2394
|
-
const i = this._setCountry(
|
|
2395
|
-
|
|
2396
|
-
);
|
|
2397
|
-
this.
|
|
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();
|
|
2398
2443
|
}
|
|
2399
2444
|
//* Close the dropdown and unbind any listeners.
|
|
2400
2445
|
_closeDropdown() {
|
|
@@ -2408,94 +2453,86 @@ class g1 {
|
|
|
2408
2453
|
}
|
|
2409
2454
|
//* Check if an element is visible within it's container, else scroll until it is.
|
|
2410
2455
|
_scrollTo(e) {
|
|
2411
|
-
const
|
|
2412
|
-
if (C <
|
|
2413
|
-
|
|
2414
|
-
else if (
|
|
2415
|
-
const
|
|
2416
|
-
|
|
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;
|
|
2417
2462
|
}
|
|
2418
2463
|
}
|
|
2419
2464
|
//* Replace any existing dial code with the new one
|
|
2420
2465
|
//* Note: called from _selectListItem and setCountry
|
|
2421
2466
|
_updateDialCode(e) {
|
|
2422
|
-
const
|
|
2423
|
-
let
|
|
2424
|
-
if (
|
|
2425
|
-
const
|
|
2426
|
-
|
|
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;
|
|
2427
2472
|
}
|
|
2428
2473
|
}
|
|
2429
2474
|
//* Try and extract a valid international dial code from a full telephone number.
|
|
2430
2475
|
//* Note: returns the raw string inc plus character and any whitespace/dots etc.
|
|
2431
|
-
_getDialCode(e,
|
|
2432
|
-
let
|
|
2476
|
+
_getDialCode(e, $) {
|
|
2477
|
+
let i = "";
|
|
2433
2478
|
if (e.charAt(0) === "+") {
|
|
2434
|
-
let
|
|
2435
|
-
for (let
|
|
2436
|
-
const
|
|
2437
|
-
if (!isNaN(parseInt(
|
|
2438
|
-
if (
|
|
2439
|
-
this.dialCodeToIso2Map[
|
|
2440
|
-
else if (this.dialCodes.has(
|
|
2441
|
-
|
|
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);
|
|
2442
2487
|
break;
|
|
2443
2488
|
}
|
|
2444
|
-
if (
|
|
2489
|
+
if (s.length === this.dialCodeMaxLen)
|
|
2445
2490
|
break;
|
|
2446
2491
|
}
|
|
2447
2492
|
}
|
|
2448
2493
|
}
|
|
2449
|
-
return
|
|
2494
|
+
return i;
|
|
2450
2495
|
}
|
|
2451
2496
|
//* Get the input val, adding the dial code if separateDialCode is enabled.
|
|
2452
2497
|
_getFullNumber(e) {
|
|
2453
|
-
const
|
|
2454
|
-
let
|
|
2455
|
-
const
|
|
2456
|
-
return this.options.separateDialCode &&
|
|
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 + $;
|
|
2457
2502
|
}
|
|
2458
2503
|
//* Remove the dial code if separateDialCode is enabled also cap the length if the input has a maxlength attribute
|
|
2459
2504
|
_beforeSetNumber(e) {
|
|
2460
|
-
|
|
2461
|
-
|
|
2462
|
-
|
|
2463
|
-
|
|
2464
|
-
|
|
2465
|
-
|
|
2466
|
-
i = i.substring(o);
|
|
2467
|
-
}
|
|
2468
|
-
}
|
|
2505
|
+
const $ = this._getDialCode(e), i = X2(
|
|
2506
|
+
e,
|
|
2507
|
+
$,
|
|
2508
|
+
this.options.separateDialCode,
|
|
2509
|
+
this.selectedCountryData
|
|
2510
|
+
);
|
|
2469
2511
|
return this._cap(i);
|
|
2470
2512
|
}
|
|
2471
2513
|
//* Trigger the 'countrychange' event.
|
|
2472
2514
|
_triggerCountryChange() {
|
|
2473
2515
|
this._trigger("countrychange");
|
|
2474
2516
|
}
|
|
2475
|
-
//* Format the number as the user types.
|
|
2476
|
-
_formatNumberAsYouType() {
|
|
2477
|
-
const e = this._getFullNumber(), i = m.utils ? m.utils.formatNumberAsYouType(e, this.selectedCountryData.iso2) : e, { dialCode: n } = this.selectedCountryData;
|
|
2478
|
-
return this.options.separateDialCode && this.telInput.value.charAt(0) !== "+" && i.includes(`+${n}`) ? (i.split(`+${n}`)[1] || "").trim() : i;
|
|
2479
|
-
}
|
|
2480
2517
|
//**************************
|
|
2481
2518
|
//* SECRET PUBLIC METHODS
|
|
2482
2519
|
//**************************
|
|
2483
2520
|
//* This is called when the geoip call returns.
|
|
2484
2521
|
handleAutoCountry() {
|
|
2485
|
-
this.options.initialCountry === "auto" &&
|
|
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());
|
|
2486
2523
|
}
|
|
2487
2524
|
//* This is called when the utils request completes.
|
|
2488
2525
|
handleUtils() {
|
|
2489
|
-
|
|
2526
|
+
y.utils && (this.telInput.value && this._updateValFromNumber(this.telInput.value), this.selectedCountryData.iso2 && (this._updatePlaceholder(), this._updateMaxLength())), this.resolveUtilsScriptPromise();
|
|
2490
2527
|
}
|
|
2491
2528
|
//********************
|
|
2492
2529
|
//* PUBLIC METHODS
|
|
2493
2530
|
//********************
|
|
2494
2531
|
//* Remove plugin.
|
|
2495
2532
|
destroy() {
|
|
2496
|
-
var
|
|
2533
|
+
var u, h;
|
|
2497
2534
|
this.telInput.iti = void 0;
|
|
2498
|
-
const { allowDropdown: e, separateDialCode:
|
|
2535
|
+
const { allowDropdown: e, separateDialCode: $ } = this.options;
|
|
2499
2536
|
if (e) {
|
|
2500
2537
|
this._closeDropdown(), this.selectedCountry.removeEventListener(
|
|
2501
2538
|
"click",
|
|
@@ -2504,28 +2541,28 @@ class g1 {
|
|
|
2504
2541
|
"keydown",
|
|
2505
2542
|
this._handleCountryContainerKeydown
|
|
2506
2543
|
);
|
|
2507
|
-
const
|
|
2508
|
-
|
|
2544
|
+
const c = this.telInput.closest("label");
|
|
2545
|
+
c && c.removeEventListener("click", this._handleLabelClick);
|
|
2509
2546
|
}
|
|
2510
|
-
const { form:
|
|
2511
|
-
this._handleHiddenInputSubmit &&
|
|
2512
|
-
const
|
|
2513
|
-
(
|
|
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];
|
|
2514
2551
|
}
|
|
2515
2552
|
//* Get the extension from the current number.
|
|
2516
2553
|
getExtension() {
|
|
2517
|
-
return
|
|
2554
|
+
return y.utils ? y.utils.getExtension(
|
|
2518
2555
|
this._getFullNumber(),
|
|
2519
2556
|
this.selectedCountryData.iso2
|
|
2520
2557
|
) : "";
|
|
2521
2558
|
}
|
|
2522
2559
|
//* Format the number to the given format.
|
|
2523
2560
|
getNumber(e) {
|
|
2524
|
-
if (
|
|
2525
|
-
const { iso2:
|
|
2526
|
-
return
|
|
2561
|
+
if (y.utils) {
|
|
2562
|
+
const { iso2: $ } = this.selectedCountryData;
|
|
2563
|
+
return y.utils.formatNumber(
|
|
2527
2564
|
this._getFullNumber(),
|
|
2528
|
-
|
|
2565
|
+
$,
|
|
2529
2566
|
e
|
|
2530
2567
|
);
|
|
2531
2568
|
}
|
|
@@ -2533,7 +2570,7 @@ class g1 {
|
|
|
2533
2570
|
}
|
|
2534
2571
|
//* Get the type of the entered number e.g. landline/mobile.
|
|
2535
2572
|
getNumberType() {
|
|
2536
|
-
return
|
|
2573
|
+
return y.utils ? y.utils.getNumberType(
|
|
2537
2574
|
this._getFullNumber(),
|
|
2538
2575
|
this.selectedCountryData.iso2
|
|
2539
2576
|
) : -99;
|
|
@@ -2544,9 +2581,9 @@ class g1 {
|
|
|
2544
2581
|
}
|
|
2545
2582
|
//* Get the validation error.
|
|
2546
2583
|
getValidationError() {
|
|
2547
|
-
if (
|
|
2584
|
+
if (y.utils) {
|
|
2548
2585
|
const { iso2: e } = this.selectedCountryData;
|
|
2549
|
-
return
|
|
2586
|
+
return y.utils.getValidationError(this._getFullNumber(), e);
|
|
2550
2587
|
}
|
|
2551
2588
|
return -99;
|
|
2552
2589
|
}
|
|
@@ -2559,31 +2596,34 @@ class g1 {
|
|
|
2559
2596
|
return this._validateNumber(!0);
|
|
2560
2597
|
}
|
|
2561
2598
|
_utilsIsPossibleNumber(e) {
|
|
2562
|
-
return
|
|
2599
|
+
return y.utils ? y.utils.isPossibleNumber(e, this.selectedCountryData.iso2, this.options.validationNumberTypes) : null;
|
|
2563
2600
|
}
|
|
2564
2601
|
//* Shared internal validation logic to handle alpha character extension rules.
|
|
2565
2602
|
_validateNumber(e) {
|
|
2566
2603
|
if (!this.selectedCountryData.iso2)
|
|
2567
2604
|
return !1;
|
|
2568
|
-
const
|
|
2569
|
-
if (
|
|
2570
|
-
const
|
|
2571
|
-
return
|
|
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;
|
|
2572
2609
|
}
|
|
2573
|
-
return i
|
|
2610
|
+
return $(i);
|
|
2574
2611
|
}
|
|
2575
2612
|
_utilsIsValidNumber(e) {
|
|
2576
|
-
return
|
|
2613
|
+
return y.utils ? y.utils.isValidNumber(e, this.selectedCountryData.iso2, this.options.validationNumberTypes) : null;
|
|
2577
2614
|
}
|
|
2578
2615
|
//* Update the selected country, and update the input val accordingly.
|
|
2579
2616
|
setCountry(e) {
|
|
2580
|
-
const
|
|
2581
|
-
(
|
|
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());
|
|
2582
2622
|
}
|
|
2583
2623
|
//* Set the input value and update the country.
|
|
2584
2624
|
setNumber(e) {
|
|
2585
|
-
const
|
|
2586
|
-
this._updateValFromNumber(e),
|
|
2625
|
+
const $ = this._updateCountryFromNumber(e);
|
|
2626
|
+
this._updateValFromNumber(e), $ && this._triggerCountryChange(), this._trigger("input", { isSetNumber: !0 });
|
|
2587
2627
|
}
|
|
2588
2628
|
//* Set the placeholder number typ
|
|
2589
2629
|
setPlaceholderNumberType(e) {
|
|
@@ -2593,95 +2633,95 @@ class g1 {
|
|
|
2593
2633
|
this.telInput.disabled = e, e ? this.selectedCountry.setAttribute("disabled", "true") : this.selectedCountry.removeAttribute("disabled");
|
|
2594
2634
|
}
|
|
2595
2635
|
}
|
|
2596
|
-
const
|
|
2597
|
-
if (!
|
|
2636
|
+
const n0 = (f) => {
|
|
2637
|
+
if (!y.utils && !y.startedLoadingUtilsScript) {
|
|
2598
2638
|
let e;
|
|
2599
|
-
if (typeof
|
|
2639
|
+
if (typeof f == "function")
|
|
2600
2640
|
try {
|
|
2601
|
-
e = Promise.resolve(
|
|
2602
|
-
} catch (
|
|
2603
|
-
return Promise.reject(
|
|
2641
|
+
e = Promise.resolve(f());
|
|
2642
|
+
} catch ($) {
|
|
2643
|
+
return Promise.reject($);
|
|
2604
2644
|
}
|
|
2605
2645
|
else
|
|
2606
|
-
return Promise.reject(new TypeError(`The argument passed to attachUtils must be a function that returns a promise for the utilities module, not ${typeof
|
|
2607
|
-
return
|
|
2608
|
-
const
|
|
2609
|
-
if (!
|
|
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")
|
|
2610
2650
|
throw new TypeError("The loader function passed to attachUtils did not resolve to a module object with utils as its default export.");
|
|
2611
|
-
return
|
|
2612
|
-
}).catch((
|
|
2613
|
-
throw
|
|
2651
|
+
return y.utils = i, e1("handleUtils"), !0;
|
|
2652
|
+
}).catch(($) => {
|
|
2653
|
+
throw e1("rejectUtilsScriptPromise", $), $;
|
|
2614
2654
|
});
|
|
2615
2655
|
}
|
|
2616
2656
|
return null;
|
|
2617
|
-
},
|
|
2618
|
-
(
|
|
2619
|
-
const
|
|
2620
|
-
return
|
|
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 = $, $;
|
|
2621
2661
|
},
|
|
2622
2662
|
{
|
|
2623
|
-
defaults:
|
|
2663
|
+
defaults: u2,
|
|
2624
2664
|
//* Using a static var like this allows us to mock it in the tests.
|
|
2625
2665
|
documentReady: () => document.readyState === "complete",
|
|
2626
2666
|
//* Get the country data object.
|
|
2627
|
-
getCountryData: () =>
|
|
2667
|
+
getCountryData: () => Z,
|
|
2628
2668
|
//* A getter for the plugin instance.
|
|
2629
|
-
getInstance: (
|
|
2630
|
-
const e =
|
|
2631
|
-
return e ?
|
|
2669
|
+
getInstance: (f) => {
|
|
2670
|
+
const e = f.getAttribute("data-intl-tel-input-id");
|
|
2671
|
+
return e ? y.instances[e] : null;
|
|
2632
2672
|
},
|
|
2633
2673
|
//* A map from instance ID to instance object.
|
|
2634
2674
|
instances: {},
|
|
2635
|
-
attachUtils:
|
|
2675
|
+
attachUtils: n0,
|
|
2636
2676
|
startedLoadingUtilsScript: !1,
|
|
2637
2677
|
startedLoadingAutoCountry: !1,
|
|
2638
|
-
version: "25.10.
|
|
2678
|
+
version: "25.10.8"
|
|
2639
2679
|
}
|
|
2640
2680
|
);
|
|
2641
2681
|
(function() {
|
|
2642
|
-
var
|
|
2682
|
+
var f = this || self;
|
|
2643
2683
|
function e(d, t) {
|
|
2644
2684
|
d = d.split(".");
|
|
2645
|
-
var
|
|
2646
|
-
d[0] in
|
|
2647
|
-
for (var
|
|
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;
|
|
2648
2688
|
}
|
|
2649
|
-
function
|
|
2650
|
-
function
|
|
2689
|
+
function $(d, t) {
|
|
2690
|
+
function n() {
|
|
2651
2691
|
}
|
|
2652
|
-
|
|
2653
|
-
for (var
|
|
2654
|
-
return t.prototype[
|
|
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);
|
|
2655
2695
|
};
|
|
2656
2696
|
}
|
|
2657
|
-
function
|
|
2697
|
+
function i(d) {
|
|
2658
2698
|
const t = [];
|
|
2659
|
-
let
|
|
2660
|
-
for (const
|
|
2699
|
+
let n = 0;
|
|
2700
|
+
for (const r in d) t[n++] = d[r];
|
|
2661
2701
|
return t;
|
|
2662
2702
|
}
|
|
2663
|
-
var
|
|
2703
|
+
var s = class {
|
|
2664
2704
|
constructor(d) {
|
|
2665
|
-
if (
|
|
2705
|
+
if (u !== u) throw Error("SafeUrl is not meant to be built directly");
|
|
2666
2706
|
this.g = d;
|
|
2667
2707
|
}
|
|
2668
2708
|
toString() {
|
|
2669
2709
|
return this.g.toString();
|
|
2670
2710
|
}
|
|
2671
|
-
},
|
|
2672
|
-
new
|
|
2673
|
-
const
|
|
2674
|
-
class
|
|
2711
|
+
}, u = {};
|
|
2712
|
+
new s("about:invalid#zClosurez"), new s("about:blank");
|
|
2713
|
+
const h = {};
|
|
2714
|
+
class c {
|
|
2675
2715
|
constructor() {
|
|
2676
|
-
if (
|
|
2716
|
+
if (h !== h) throw Error("SafeStyle is not meant to be built directly");
|
|
2677
2717
|
}
|
|
2678
2718
|
toString() {
|
|
2679
2719
|
return "";
|
|
2680
2720
|
}
|
|
2681
2721
|
}
|
|
2682
|
-
new
|
|
2722
|
+
new c();
|
|
2683
2723
|
const C = {};
|
|
2684
|
-
class
|
|
2724
|
+
class g {
|
|
2685
2725
|
constructor() {
|
|
2686
2726
|
if (C !== C) throw Error("SafeStyleSheet is not meant to be built directly");
|
|
2687
2727
|
}
|
|
@@ -2689,98 +2729,98 @@ const Z2 = (y) => {
|
|
|
2689
2729
|
return "";
|
|
2690
2730
|
}
|
|
2691
2731
|
}
|
|
2692
|
-
new
|
|
2693
|
-
const
|
|
2694
|
-
class
|
|
2732
|
+
new g();
|
|
2733
|
+
const I = {};
|
|
2734
|
+
class S {
|
|
2695
2735
|
constructor() {
|
|
2696
|
-
var t =
|
|
2697
|
-
if (
|
|
2736
|
+
var t = f.trustedTypes && f.trustedTypes.emptyHTML || "";
|
|
2737
|
+
if (I !== I) throw Error("SafeHtml is not meant to be built directly");
|
|
2698
2738
|
this.g = t;
|
|
2699
2739
|
}
|
|
2700
2740
|
toString() {
|
|
2701
2741
|
return this.g.toString();
|
|
2702
2742
|
}
|
|
2703
2743
|
}
|
|
2704
|
-
new
|
|
2705
|
-
function
|
|
2744
|
+
new S();
|
|
2745
|
+
function R(d, t) {
|
|
2706
2746
|
switch (this.g = d, this.l = !!t.aa, this.h = t.i, this.s = t.type, this.o = !1, this.h) {
|
|
2707
|
-
case G:
|
|
2708
|
-
case x:
|
|
2709
|
-
case R:
|
|
2710
|
-
case N:
|
|
2711
|
-
case W:
|
|
2712
2747
|
case A:
|
|
2713
|
-
case
|
|
2748
|
+
case k:
|
|
2749
|
+
case H:
|
|
2750
|
+
case f1:
|
|
2751
|
+
case c2:
|
|
2752
|
+
case D:
|
|
2753
|
+
case v:
|
|
2714
2754
|
this.o = !0;
|
|
2715
2755
|
}
|
|
2716
2756
|
this.j = t.defaultValue;
|
|
2717
2757
|
}
|
|
2718
|
-
var
|
|
2719
|
-
function
|
|
2758
|
+
var v = 1, D = 2, A = 3, k = 4, H = 6, f1 = 16, c2 = 18;
|
|
2759
|
+
function f2(d, t) {
|
|
2720
2760
|
for (this.h = d, this.g = {}, d = 0; d < t.length; d++) {
|
|
2721
|
-
var
|
|
2722
|
-
this.g[
|
|
2761
|
+
var n = t[d];
|
|
2762
|
+
this.g[n.g] = n;
|
|
2723
2763
|
}
|
|
2724
2764
|
}
|
|
2725
|
-
function
|
|
2726
|
-
return d =
|
|
2727
|
-
return t.g -
|
|
2765
|
+
function p2(d) {
|
|
2766
|
+
return d = i(d.g), d.sort(function(t, n) {
|
|
2767
|
+
return t.g - n.g;
|
|
2728
2768
|
}), d;
|
|
2729
2769
|
}
|
|
2730
|
-
function
|
|
2770
|
+
function P() {
|
|
2731
2771
|
this.h = {}, this.j = this.m().g, this.g = this.l = null;
|
|
2732
2772
|
}
|
|
2733
|
-
|
|
2734
|
-
return
|
|
2735
|
-
},
|
|
2736
|
-
return
|
|
2737
|
-
},
|
|
2738
|
-
|
|
2739
|
-
},
|
|
2740
|
-
|
|
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) {
|
|
2780
|
+
b1(this, d.g, t);
|
|
2741
2781
|
};
|
|
2742
|
-
function
|
|
2743
|
-
for (var
|
|
2744
|
-
var
|
|
2745
|
-
if (
|
|
2746
|
-
d.g && delete d.g[
|
|
2747
|
-
var
|
|
2748
|
-
if (
|
|
2749
|
-
|
|
2750
|
-
for (var
|
|
2751
|
-
} else
|
|
2782
|
+
function S1(d, t) {
|
|
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);
|
|
2752
2792
|
}
|
|
2753
2793
|
}
|
|
2754
2794
|
}
|
|
2755
|
-
|
|
2795
|
+
P.prototype.clone = function() {
|
|
2756
2796
|
var d = new this.constructor();
|
|
2757
|
-
return d != this && (d.h = {}, d.g && (d.g = {}),
|
|
2797
|
+
return d != this && (d.h = {}, d.g && (d.g = {}), S1(d, this)), d;
|
|
2758
2798
|
};
|
|
2759
|
-
function
|
|
2799
|
+
function x(d, t) {
|
|
2760
2800
|
return d.h[t] != null;
|
|
2761
2801
|
}
|
|
2762
|
-
function
|
|
2763
|
-
var
|
|
2764
|
-
if (
|
|
2802
|
+
function $1(d, t) {
|
|
2803
|
+
var n = d.h[t];
|
|
2804
|
+
if (n == null) return null;
|
|
2765
2805
|
if (d.l) {
|
|
2766
2806
|
if (!(t in d.g)) {
|
|
2767
|
-
var
|
|
2768
|
-
if (
|
|
2769
|
-
for (var a = [],
|
|
2770
|
-
|
|
2771
|
-
} else
|
|
2772
|
-
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;
|
|
2773
2813
|
}
|
|
2774
2814
|
return d.g[t];
|
|
2775
2815
|
}
|
|
2776
|
-
return
|
|
2816
|
+
return n;
|
|
2777
2817
|
}
|
|
2778
|
-
function
|
|
2779
|
-
var
|
|
2780
|
-
return d.j[t].l ?
|
|
2818
|
+
function m(d, t, n) {
|
|
2819
|
+
var r = $1(d, t);
|
|
2820
|
+
return d.j[t].l ? r[n || 0] : r;
|
|
2781
2821
|
}
|
|
2782
|
-
function
|
|
2783
|
-
if (
|
|
2822
|
+
function w(d, t) {
|
|
2823
|
+
if (x(d, t)) d = m(d, t);
|
|
2784
2824
|
else d: {
|
|
2785
2825
|
if (d = d.j[t], d.j === void 0) if (t = d.s, t === Boolean) d.j = !1;
|
|
2786
2826
|
else if (t === Number) d.j = 0;
|
|
@@ -2793,106 +2833,106 @@ const Z2 = (y) => {
|
|
|
2793
2833
|
}
|
|
2794
2834
|
return d;
|
|
2795
2835
|
}
|
|
2796
|
-
function
|
|
2797
|
-
return
|
|
2836
|
+
function M(d, t) {
|
|
2837
|
+
return $1(d, t) || [];
|
|
2798
2838
|
}
|
|
2799
|
-
function
|
|
2800
|
-
return d.j[t].l ?
|
|
2839
|
+
function F(d, t) {
|
|
2840
|
+
return d.j[t].l ? x(d, t) ? d.h[t].length : 0 : x(d, t) ? 1 : 0;
|
|
2801
2841
|
}
|
|
2802
|
-
function
|
|
2803
|
-
d.h[t] =
|
|
2842
|
+
function E(d, t, n) {
|
|
2843
|
+
d.h[t] = n, d.g && (d.g[t] = n);
|
|
2804
2844
|
}
|
|
2805
|
-
function
|
|
2806
|
-
d.h[t] || (d.h[t] = []), d.h[t].push(
|
|
2845
|
+
function b1(d, t, n) {
|
|
2846
|
+
d.h[t] || (d.h[t] = []), d.h[t].push(n), d.g && delete d.g[t];
|
|
2807
2847
|
}
|
|
2808
|
-
function
|
|
2809
|
-
var
|
|
2810
|
-
for (
|
|
2811
|
-
return new
|
|
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);
|
|
2812
2852
|
}
|
|
2813
|
-
function
|
|
2853
|
+
function i1() {
|
|
2814
2854
|
}
|
|
2815
|
-
|
|
2855
|
+
i1.prototype.g = function(d) {
|
|
2816
2856
|
throw new d.h(), Error("Unimplemented");
|
|
2817
|
-
},
|
|
2818
|
-
if (d.h == 11 || d.h == 10) return t instanceof
|
|
2819
|
-
if (d.h == 14) return typeof t == "string" &&
|
|
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);
|
|
2859
|
+
if (d.h == 14) return typeof t == "string" && L1.test(t) && (d = Number(t), 0 < d) ? d : t;
|
|
2820
2860
|
if (!d.o) return t;
|
|
2821
2861
|
if (d = d.s, d === String) {
|
|
2822
2862
|
if (typeof t == "number") return String(t);
|
|
2823
|
-
} else if (d === Number && typeof t == "string" && (t === "Infinity" || t === "-Infinity" || t === "NaN" ||
|
|
2863
|
+
} else if (d === Number && typeof t == "string" && (t === "Infinity" || t === "-Infinity" || t === "NaN" || L1.test(t))) return Number(t);
|
|
2824
2864
|
return t;
|
|
2825
2865
|
};
|
|
2826
|
-
var
|
|
2827
|
-
function
|
|
2866
|
+
var L1 = /^-?[0-9]+$/;
|
|
2867
|
+
function p1() {
|
|
2828
2868
|
}
|
|
2829
|
-
|
|
2869
|
+
$(p1, i1), p1.prototype.g = function(d, t) {
|
|
2830
2870
|
return d = new d.h(), d.l = this, d.h = t, d.g = {}, d;
|
|
2831
2871
|
};
|
|
2832
|
-
function
|
|
2872
|
+
function J() {
|
|
2833
2873
|
}
|
|
2834
|
-
|
|
2835
|
-
return d.h == 8 ? !!t :
|
|
2836
|
-
},
|
|
2837
|
-
return
|
|
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);
|
|
2838
2878
|
};
|
|
2839
|
-
function
|
|
2879
|
+
function N(d, t) {
|
|
2840
2880
|
d != null && this.g.apply(this, arguments);
|
|
2841
2881
|
}
|
|
2842
|
-
|
|
2882
|
+
N.prototype.h = "", N.prototype.set = function(d) {
|
|
2843
2883
|
this.h = "" + d;
|
|
2844
|
-
},
|
|
2845
|
-
if (this.h += String(d), t != null) for (let
|
|
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];
|
|
2846
2886
|
return this;
|
|
2847
2887
|
};
|
|
2848
|
-
function
|
|
2888
|
+
function B(d) {
|
|
2849
2889
|
d.h = "";
|
|
2850
2890
|
}
|
|
2851
|
-
|
|
2891
|
+
N.prototype.toString = function() {
|
|
2852
2892
|
return this.h;
|
|
2853
2893
|
};
|
|
2854
|
-
function
|
|
2855
|
-
|
|
2894
|
+
function j() {
|
|
2895
|
+
P.call(this);
|
|
2896
|
+
}
|
|
2897
|
+
$(j, P);
|
|
2898
|
+
var N1 = null;
|
|
2899
|
+
function b() {
|
|
2900
|
+
P.call(this);
|
|
2856
2901
|
}
|
|
2857
|
-
|
|
2902
|
+
$(b, P);
|
|
2858
2903
|
var A1 = null;
|
|
2859
|
-
function
|
|
2860
|
-
|
|
2904
|
+
function W() {
|
|
2905
|
+
P.call(this);
|
|
2861
2906
|
}
|
|
2862
|
-
|
|
2907
|
+
$(W, P);
|
|
2863
2908
|
var E1 = null;
|
|
2864
|
-
function
|
|
2865
|
-
|
|
2866
|
-
|
|
2867
|
-
|
|
2868
|
-
var M1 = null;
|
|
2869
|
-
z.prototype.m = function() {
|
|
2909
|
+
j.prototype.m = function() {
|
|
2910
|
+
var d = N1;
|
|
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() {
|
|
2870
2913
|
var d = A1;
|
|
2871
|
-
return d || (A1 = d =
|
|
2872
|
-
},
|
|
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() {
|
|
2873
2916
|
var d = E1;
|
|
2874
|
-
return d || (E1 = d =
|
|
2875
|
-
}, L.m = L.prototype.m, Z.prototype.m = function() {
|
|
2876
|
-
var d = M1;
|
|
2877
|
-
return d || (M1 = d = r1(Z, {
|
|
2917
|
+
return d || (E1 = d = n1(W, {
|
|
2878
2918
|
0: { name: "PhoneMetadata", ia: "i18n.phonenumbers.PhoneMetadata" },
|
|
2879
|
-
1: { name: "general_desc", i: 11, type:
|
|
2880
|
-
2: { name: "fixed_line", i: 11, type:
|
|
2881
|
-
3: { name: "mobile", i: 11, type:
|
|
2882
|
-
4: { name: "toll_free", i: 11, type:
|
|
2883
|
-
5: { name: "premium_rate", i: 11, type:
|
|
2884
|
-
6: { name: "shared_cost", i: 11, type:
|
|
2885
|
-
7: { name: "personal_number", i: 11, type:
|
|
2886
|
-
8: { name: "voip", i: 11, type:
|
|
2887
|
-
21: { name: "pager", i: 11, type:
|
|
2888
|
-
25: { name: "uan", i: 11, type:
|
|
2889
|
-
27: { name: "emergency", i: 11, type:
|
|
2890
|
-
28: { name: "voicemail", i: 11, type:
|
|
2891
|
-
29: { name: "short_code", i: 11, type:
|
|
2892
|
-
30: { name: "standard_rate", i: 11, type:
|
|
2893
|
-
31: { name: "carrier_specific", i: 11, type:
|
|
2894
|
-
33: { name: "sms_services", i: 11, type:
|
|
2895
|
-
24: { name: "no_international_dialling", i: 11, type:
|
|
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 },
|
|
2896
2936
|
9: { name: "id", required: !0, i: 9, type: String },
|
|
2897
2937
|
10: { name: "country_code", i: 5, type: Number },
|
|
2898
2938
|
11: { name: "international_prefix", i: 9, type: String },
|
|
@@ -2906,26 +2946,26 @@ const Z2 = (y) => {
|
|
|
2906
2946
|
},
|
|
2907
2947
|
16: { name: "national_prefix_transform_rule", i: 9, type: String },
|
|
2908
2948
|
18: { name: "same_mobile_and_fixed_line_pattern", i: 8, defaultValue: !1, type: Boolean },
|
|
2909
|
-
19: { name: "number_format", aa: !0, i: 11, type:
|
|
2910
|
-
20: { name: "intl_number_format", aa: !0, i: 11, type:
|
|
2949
|
+
19: { name: "number_format", aa: !0, i: 11, type: j },
|
|
2950
|
+
20: { name: "intl_number_format", aa: !0, i: 11, type: j },
|
|
2911
2951
|
22: { name: "main_country_for_code", i: 8, defaultValue: !1, type: Boolean },
|
|
2912
2952
|
23: { name: "leading_digits", i: 9, type: String }
|
|
2913
2953
|
})), d;
|
|
2914
|
-
},
|
|
2915
|
-
function
|
|
2916
|
-
|
|
2917
|
-
}
|
|
2918
|
-
|
|
2919
|
-
var
|
|
2920
|
-
|
|
2921
|
-
var d =
|
|
2922
|
-
return d || (
|
|
2954
|
+
}, W.m = W.prototype.m;
|
|
2955
|
+
function K() {
|
|
2956
|
+
P.call(this);
|
|
2957
|
+
}
|
|
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: {
|
|
2923
2963
|
name: "preferred_domestic_carrier_code",
|
|
2924
2964
|
i: 9,
|
|
2925
2965
|
type: String
|
|
2926
2966
|
} })), d;
|
|
2927
|
-
},
|
|
2928
|
-
var
|
|
2967
|
+
}, K.ctor = K, K.ctor.m = K.prototype.m;
|
|
2968
|
+
var q = {
|
|
2929
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(" "),
|
|
2930
2970
|
7: ["RU", "KZ"],
|
|
2931
2971
|
20: ["EG"],
|
|
@@ -3141,7 +3181,7 @@ const Z2 = (y) => {
|
|
|
3141
3181
|
995: ["GE"],
|
|
3142
3182
|
996: ["KG"],
|
|
3143
3183
|
998: ["UZ"]
|
|
3144
|
-
},
|
|
3184
|
+
}, M1 = {
|
|
3145
3185
|
AC: [, [
|
|
3146
3186
|
,
|
|
3147
3187
|
,
|
|
@@ -4329,12 +4369,12 @@ const Z2 = (y) => {
|
|
|
4329
4369
|
,
|
|
4330
4370
|
,
|
|
4331
4371
|
[9]
|
|
4332
|
-
], [, , "(?:
|
|
4333
|
-
|
|
4334
|
-
|
|
4335
|
-
|
|
4336
|
-
[
|
|
4337
|
-
], , [, , , , , , , , , [-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"]],
|
|
4338
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]], [
|
|
4339
4379
|
,
|
|
4340
4380
|
,
|
|
@@ -4355,6 +4395,7 @@ const Z2 = (y) => {
|
|
|
4355
4395
|
["3[02]|40|[68]9"],
|
|
4356
4396
|
"0$1"
|
|
4357
4397
|
],
|
|
4398
|
+
[, "(\\d{6})", "$1", ["227", "2277"]],
|
|
4358
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"],
|
|
4359
4400
|
[
|
|
4360
4401
|
,
|
|
@@ -4378,7 +4419,38 @@ const Z2 = (y) => {
|
|
|
4378
4419
|
[, "(\\d{3})(\\d{2})(\\d{7,8})", "$1 $2 $3", ["1(?:6[023]|7)"], "0$1"],
|
|
4379
4420
|
[, "(\\d{4})(\\d{2})(\\d{7})", "$1 $2 $3", ["15[279]"], "0$1"],
|
|
4380
4421
|
[, "(\\d{3})(\\d{2})(\\d{8})", "$1 $2 $3", ["15"], "0$1"]
|
|
4381
|
-
],
|
|
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]], , , [
|
|
4382
4454
|
,
|
|
4383
4455
|
,
|
|
4384
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}",
|
|
@@ -5476,17 +5548,14 @@ const Z2 = (y) => {
|
|
|
5476
5548
|
,
|
|
5477
5549
|
[7]
|
|
5478
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]]],
|
|
5479
|
-
IT: [, [, , "0\\d{5,
|
|
5480
|
-
,
|
|
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]], [
|
|
5481
5552
|
,
|
|
5482
|
-
"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}",
|
|
5483
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}",
|
|
5484
5555
|
,
|
|
5485
5556
|
,
|
|
5486
|
-
"0212345678",
|
|
5487
5557
|
,
|
|
5488
|
-
|
|
5489
|
-
[6, 7, 8, 9, 10, 11]
|
|
5558
|
+
"0212345678"
|
|
5490
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", , , , , , , , [
|
|
5491
5560
|
[, "(\\d{4,5})", "$1", ["1(?:0|9[246])", "1(?:0|9(?:2[2-9]|[46]))"]],
|
|
5492
5561
|
[, "(\\d{6})", "$1", ["1(?:1|92)"]],
|
|
@@ -5499,13 +5568,13 @@ const Z2 = (y) => {
|
|
|
5499
5568
|
[, "(\\d{3})(\\d{3,4})(\\d{4})", "$1 $2 $3", ["0[13-57-9][0159]|14"]],
|
|
5500
5569
|
[, "(\\d{2})(\\d{4})(\\d{5})", "$1 $2 $3", ["0[26]"]],
|
|
5501
5570
|
[, "(\\d{4})(\\d{3})(\\d{4})", "$1 $2 $3", ["0"]],
|
|
5502
|
-
[, "(\\d{3})(\\d{4})(\\d{4,5})", "$1 $2 $3", ["
|
|
5571
|
+
[, "(\\d{3})(\\d{4})(\\d{4,5})", "$1 $2 $3", ["[03]"]]
|
|
5503
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"]], [
|
|
5504
5573
|
,
|
|
5505
5574
|
"(\\d{3})(\\d{3})(\\d{3,4})",
|
|
5506
5575
|
"$1 $2 $3",
|
|
5507
5576
|
["1(?:44|[679])|[378]|43"]
|
|
5508
|
-
], [, "(\\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", ["
|
|
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]]],
|
|
5509
5578
|
JE: [, [, , "1534\\d{6}|(?:[3578]\\d|90)\\d{8}", , , , , , , [10], [6]], [, , "1534[0-24-8]\\d{5}", , , , "1534456789", , , , [6]], [
|
|
5510
5579
|
,
|
|
5511
5580
|
,
|
|
@@ -5888,7 +5957,7 @@ const Z2 = (y) => {
|
|
|
5888
5957
|
,
|
|
5889
5958
|
"5002345678"
|
|
5890
5959
|
], [, , , , , , , , , [-1]], "LC", 1, "011", "1", , , "([2-8]\\d{6})$|1", "758$1", , , , , [, , , , , , , , , [-1]], , "758", [, , , , , , , , , [-1]], [, , , , , , , , , [-1]], , , [, , , , , , , , , [-1]]],
|
|
5891
|
-
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
|
|
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"], [
|
|
5892
5961
|
,
|
|
5893
5962
|
,
|
|
5894
5963
|
"90(?:02[258]|1(?:23|3[14])|66[136])\\d\\d",
|
|
@@ -5997,7 +6066,7 @@ const Z2 = (y) => {
|
|
|
5997
6066
|
,
|
|
5998
6067
|
"$CC $1"
|
|
5999
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]]],
|
|
6000
|
-
LV: [, [, , "(?:[268]\\d|90)\\d{6}", , , , , , , [8]], [
|
|
6069
|
+
LV: [, [, , "(?:[268]\\d|78|90)\\d{6}", , , , , , , [8]], [
|
|
6001
6070
|
,
|
|
6002
6071
|
,
|
|
6003
6072
|
"6\\d{7}",
|
|
@@ -6005,7 +6074,7 @@ const Z2 = (y) => {
|
|
|
6005
6074
|
,
|
|
6006
6075
|
,
|
|
6007
6076
|
"63123456"
|
|
6008
|
-
], [, , "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", ["[
|
|
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]]],
|
|
6009
6078
|
LY: [, [, , "[2-9]\\d{8}", , , , , , , [9], [7]], [
|
|
6010
6079
|
,
|
|
6011
6080
|
,
|
|
@@ -6067,7 +6136,7 @@ const Z2 = (y) => {
|
|
|
6067
6136
|
,
|
|
6068
6137
|
[8],
|
|
6069
6138
|
[6]
|
|
6070
|
-
], [, , "6(?:[07-9]\\d|3[024]|6[0-25])\\d{5}", , , , "
|
|
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]]],
|
|
6071
6140
|
MF: [
|
|
6072
6141
|
,
|
|
6073
6142
|
[, , "(?:590\\d|7090)\\d{5}|(?:69|80|9\\d)\\d{7}", , , , , , , [9]],
|
|
@@ -7155,7 +7224,7 @@ const Z2 = (y) => {
|
|
|
7155
7224
|
,
|
|
7156
7225
|
,
|
|
7157
7226
|
[8]
|
|
7158
|
-
], [, , "
|
|
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"]], [
|
|
7159
7228
|
,
|
|
7160
7229
|
"(\\d{4})(\\d{4})(\\d{3})",
|
|
7161
7230
|
"$1 $2 $3",
|
|
@@ -7733,7 +7802,7 @@ const Z2 = (y) => {
|
|
|
7733
7802
|
], [
|
|
7734
7803
|
,
|
|
7735
7804
|
,
|
|
7736
|
-
"(?: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-
|
|
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}",
|
|
7737
7806
|
,
|
|
7738
7807
|
,
|
|
7739
7808
|
,
|
|
@@ -7745,7 +7814,7 @@ const Z2 = (y) => {
|
|
|
7745
7814
|
], [
|
|
7746
7815
|
,
|
|
7747
7816
|
,
|
|
7748
|
-
"(?: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-
|
|
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}",
|
|
7749
7818
|
,
|
|
7750
7819
|
,
|
|
7751
7820
|
,
|
|
@@ -8246,13 +8315,13 @@ const Z2 = (y) => {
|
|
|
8246
8315
|
], [, , , , , , , , , [-1]], [, , , , , , , , , [-1]], "001", 888, , , , , , , , 1, [[, "(\\d{3})(\\d{3})(\\d{5})", "$1 $2 $3"]], , [, , , , , , , , , [-1]], , , [, , , , , , , , , [-1]], [, , "\\d{11}", , , , "12345678901"], , , [, , , , , , , , , [-1]]],
|
|
8247
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]]]
|
|
8248
8317
|
};
|
|
8249
|
-
function
|
|
8318
|
+
function T() {
|
|
8250
8319
|
this.g = {};
|
|
8251
8320
|
}
|
|
8252
|
-
|
|
8253
|
-
return
|
|
8321
|
+
T.h = void 0, T.g = function() {
|
|
8322
|
+
return T.h ? T.h : T.h = new T();
|
|
8254
8323
|
};
|
|
8255
|
-
var
|
|
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 = {
|
|
8256
8325
|
0: "0",
|
|
8257
8326
|
1: "1",
|
|
8258
8327
|
2: "2",
|
|
@@ -8333,154 +8402,154 @@ const Z2 = (y) => {
|
|
|
8333
8402
|
X: "9",
|
|
8334
8403
|
Y: "9",
|
|
8335
8404
|
Z: "9"
|
|
8336
|
-
},
|
|
8337
|
-
function
|
|
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٠-٩۰-۹])*\\.?$");
|
|
8406
|
+
function Y(d) {
|
|
8338
8407
|
return "([0-90-9٠-٩۰-۹]{1," + d + "})";
|
|
8339
8408
|
}
|
|
8340
|
-
function
|
|
8341
|
-
return ";ext=" +
|
|
8409
|
+
function P1() {
|
|
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") + "#?");
|
|
8342
8411
|
}
|
|
8343
|
-
var
|
|
8344
|
-
function
|
|
8345
|
-
return 2 > d.length ? !1 :
|
|
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\)?$/;
|
|
8413
|
+
function B1(d) {
|
|
8414
|
+
return 2 > d.length ? !1 : G(L2, d);
|
|
8346
8415
|
}
|
|
8347
|
-
function
|
|
8348
|
-
return
|
|
8416
|
+
function R1(d) {
|
|
8417
|
+
return G(w2, d) ? s1(d, C2) : s1(d, g1);
|
|
8349
8418
|
}
|
|
8350
|
-
function
|
|
8351
|
-
var t =
|
|
8352
|
-
|
|
8419
|
+
function k1(d) {
|
|
8420
|
+
var t = R1(d.toString());
|
|
8421
|
+
B(d), d.g(t);
|
|
8353
8422
|
}
|
|
8354
|
-
function
|
|
8355
|
-
return d != null && (
|
|
8423
|
+
function O1(d) {
|
|
8424
|
+
return d != null && (F(d, 9) != 1 || M(d, 9)[0] != -1);
|
|
8356
8425
|
}
|
|
8357
|
-
function
|
|
8358
|
-
for (var
|
|
8359
|
-
return
|
|
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();
|
|
8360
8429
|
}
|
|
8361
|
-
function
|
|
8362
|
-
return d.length == 0 ||
|
|
8430
|
+
function G1(d) {
|
|
8431
|
+
return d.length == 0 || A2.test(d);
|
|
8363
8432
|
}
|
|
8364
|
-
function
|
|
8365
|
-
return d != null && isNaN(d) && d.toUpperCase() in
|
|
8433
|
+
function r1(d) {
|
|
8434
|
+
return d != null && isNaN(d) && d.toUpperCase() in M1;
|
|
8366
8435
|
}
|
|
8367
|
-
|
|
8368
|
-
if (
|
|
8369
|
-
var
|
|
8370
|
-
if (0 <
|
|
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;
|
|
8371
8440
|
}
|
|
8372
|
-
|
|
8373
|
-
var
|
|
8374
|
-
if (t == 0) return
|
|
8375
|
-
if (!(
|
|
8376
|
-
var
|
|
8377
|
-
d =
|
|
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) : "";
|
|
8378
8447
|
d: {
|
|
8379
|
-
|
|
8380
|
-
for (var a,
|
|
8381
|
-
a =
|
|
8382
|
-
var _ =
|
|
8383
|
-
if ((_ == 0 ||
|
|
8384
|
-
|
|
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;
|
|
8385
8454
|
break d;
|
|
8386
8455
|
}
|
|
8387
8456
|
}
|
|
8388
|
-
|
|
8457
|
+
o = null;
|
|
8389
8458
|
}
|
|
8390
|
-
return
|
|
8391
|
-
|
|
8459
|
+
return o != null && (l = o, o = w(l, 2), a = new RegExp(m(l, 1)), w(
|
|
8460
|
+
l,
|
|
8392
8461
|
5
|
|
8393
|
-
),
|
|
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);
|
|
8394
8463
|
};
|
|
8395
|
-
function
|
|
8396
|
-
return
|
|
8464
|
+
function Q(d, t, n) {
|
|
8465
|
+
return n == "001" ? V(d, "" + t) : V(d, n);
|
|
8397
8466
|
}
|
|
8398
|
-
function
|
|
8399
|
-
if (!
|
|
8400
|
-
var t = "" +
|
|
8401
|
-
return
|
|
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;
|
|
8402
8471
|
}
|
|
8403
|
-
function
|
|
8472
|
+
function U1(d, t, n, r) {
|
|
8404
8473
|
switch (t) {
|
|
8405
8474
|
case 0:
|
|
8406
|
-
return "+" + d +
|
|
8475
|
+
return "+" + d + n + r;
|
|
8407
8476
|
case 1:
|
|
8408
|
-
return "+" + d + " " +
|
|
8477
|
+
return "+" + d + " " + n + r;
|
|
8409
8478
|
case 3:
|
|
8410
|
-
return "tel:+" + d + "-" +
|
|
8479
|
+
return "tel:+" + d + "-" + n + r;
|
|
8411
8480
|
default:
|
|
8412
|
-
return
|
|
8481
|
+
return n + r;
|
|
8413
8482
|
}
|
|
8414
8483
|
}
|
|
8415
|
-
function
|
|
8484
|
+
function o1(d, t) {
|
|
8416
8485
|
switch (t) {
|
|
8417
8486
|
case 4:
|
|
8418
|
-
return
|
|
8487
|
+
return m(d, 5);
|
|
8419
8488
|
case 3:
|
|
8420
|
-
return
|
|
8489
|
+
return m(d, 4);
|
|
8421
8490
|
case 1:
|
|
8422
|
-
return
|
|
8491
|
+
return m(d, 3);
|
|
8423
8492
|
case 0:
|
|
8424
8493
|
case 2:
|
|
8425
|
-
return
|
|
8494
|
+
return m(d, 2);
|
|
8426
8495
|
case 5:
|
|
8427
|
-
return
|
|
8496
|
+
return m(d, 6);
|
|
8428
8497
|
case 6:
|
|
8429
|
-
return
|
|
8498
|
+
return m(d, 8);
|
|
8430
8499
|
case 7:
|
|
8431
|
-
return
|
|
8500
|
+
return m(d, 7);
|
|
8432
8501
|
case 8:
|
|
8433
|
-
return
|
|
8502
|
+
return m(d, 21);
|
|
8434
8503
|
case 9:
|
|
8435
|
-
return
|
|
8504
|
+
return m(d, 25);
|
|
8436
8505
|
case 10:
|
|
8437
|
-
return
|
|
8506
|
+
return m(d, 28);
|
|
8438
8507
|
default:
|
|
8439
|
-
return
|
|
8508
|
+
return m(d, 1);
|
|
8440
8509
|
}
|
|
8441
8510
|
}
|
|
8442
|
-
function
|
|
8443
|
-
var
|
|
8444
|
-
return 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));
|
|
8445
8514
|
}
|
|
8446
|
-
function
|
|
8447
|
-
return
|
|
8515
|
+
function m1(d, t) {
|
|
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;
|
|
8448
8517
|
}
|
|
8449
|
-
function
|
|
8518
|
+
function V(d, t) {
|
|
8450
8519
|
if (t == null) return null;
|
|
8451
8520
|
t = t.toUpperCase();
|
|
8452
|
-
var
|
|
8453
|
-
if (
|
|
8454
|
-
if (
|
|
8455
|
-
|
|
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;
|
|
8456
8525
|
}
|
|
8457
|
-
return
|
|
8526
|
+
return n;
|
|
8458
8527
|
}
|
|
8459
|
-
function
|
|
8460
|
-
var
|
|
8461
|
-
return 0 <
|
|
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);
|
|
8462
8531
|
}
|
|
8463
|
-
function
|
|
8464
|
-
var
|
|
8465
|
-
return
|
|
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;
|
|
8466
8535
|
}
|
|
8467
|
-
function
|
|
8536
|
+
function K1(d, t) {
|
|
8468
8537
|
if (t == null) return null;
|
|
8469
|
-
var
|
|
8470
|
-
if (
|
|
8471
|
-
else if (
|
|
8538
|
+
var n = w(t, 1);
|
|
8539
|
+
if (n = q[n], n == null) d = null;
|
|
8540
|
+
else if (n.length == 1) d = n[0];
|
|
8472
8541
|
else d: {
|
|
8473
|
-
t =
|
|
8474
|
-
for (var
|
|
8475
|
-
|
|
8476
|
-
var
|
|
8477
|
-
if (
|
|
8478
|
-
if (t.search(
|
|
8479
|
-
d =
|
|
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;
|
|
8480
8549
|
break d;
|
|
8481
8550
|
}
|
|
8482
|
-
} else if (
|
|
8483
|
-
d =
|
|
8551
|
+
} else if (m1(t, l) != -1) {
|
|
8552
|
+
d = r;
|
|
8484
8553
|
break d;
|
|
8485
8554
|
}
|
|
8486
8555
|
}
|
|
@@ -8488,151 +8557,151 @@ const Z2 = (y) => {
|
|
|
8488
8557
|
}
|
|
8489
8558
|
return d;
|
|
8490
8559
|
}
|
|
8491
|
-
function
|
|
8492
|
-
return d =
|
|
8560
|
+
function t1(d) {
|
|
8561
|
+
return d = q[d], d == null ? "ZZ" : d[0];
|
|
8493
8562
|
}
|
|
8494
|
-
function
|
|
8495
|
-
if (d =
|
|
8496
|
-
return
|
|
8563
|
+
function V1(d, t) {
|
|
8564
|
+
if (d = V(d, t), d == null) throw Error("Invalid region code: " + t);
|
|
8565
|
+
return w(d, 10);
|
|
8497
8566
|
}
|
|
8498
|
-
function
|
|
8499
|
-
var
|
|
8500
|
-
if (
|
|
8501
|
-
else return
|
|
8502
|
-
return a[0] == -1 ? 5 : (t = t.length, -1 <
|
|
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));
|
|
8503
8572
|
}
|
|
8504
|
-
function
|
|
8505
|
-
var
|
|
8506
|
-
return t =
|
|
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;
|
|
8507
8576
|
}
|
|
8508
|
-
function
|
|
8577
|
+
function H1(d, t) {
|
|
8509
8578
|
if (d = d.toString(), d.length == 0 || d.charAt(0) == "0") return 0;
|
|
8510
|
-
for (var
|
|
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;
|
|
8511
8580
|
return 0;
|
|
8512
8581
|
}
|
|
8513
|
-
function
|
|
8582
|
+
function j1(d, t, n, r, o, a) {
|
|
8514
8583
|
if (t.length == 0) return 0;
|
|
8515
|
-
t = new
|
|
8516
|
-
var
|
|
8517
|
-
|
|
8518
|
-
var
|
|
8519
|
-
if (
|
|
8520
|
-
else if (
|
|
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;
|
|
8521
8590
|
else {
|
|
8522
|
-
if (
|
|
8523
|
-
|
|
8524
|
-
var _ =
|
|
8525
|
-
_ && _[1] != null && 0 < _[1].length &&
|
|
8526
|
-
} else
|
|
8527
|
-
|
|
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;
|
|
8528
8597
|
}
|
|
8529
|
-
if (
|
|
8598
|
+
if (o && E(a, 6, l), l != 20) {
|
|
8530
8599
|
if (2 >= t.h.length) throw Error("Phone number too short after IDD");
|
|
8531
|
-
if (d =
|
|
8600
|
+
if (d = H1(t, r), d != 0) return E(a, 1, d), d;
|
|
8532
8601
|
throw Error("Invalid country calling code");
|
|
8533
8602
|
}
|
|
8534
|
-
return
|
|
8535
|
-
}
|
|
8536
|
-
function
|
|
8537
|
-
var
|
|
8538
|
-
if (
|
|
8539
|
-
var
|
|
8540
|
-
if (
|
|
8541
|
-
a = new RegExp(
|
|
8542
|
-
var
|
|
8543
|
-
t =
|
|
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)));
|
|
8544
8613
|
}
|
|
8545
8614
|
}
|
|
8546
8615
|
}
|
|
8547
|
-
function
|
|
8548
|
-
if (!
|
|
8549
|
-
return
|
|
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);
|
|
8550
8619
|
}
|
|
8551
|
-
function
|
|
8620
|
+
function z1(d, t, n, r) {
|
|
8552
8621
|
if (t == null) throw Error("The string supplied did not seem to be a phone number");
|
|
8553
8622
|
if (250 < t.length) throw Error("The string supplied is too long to be a phone number");
|
|
8554
|
-
var
|
|
8623
|
+
var o = new N(), a = t.indexOf(";phone-context=");
|
|
8555
8624
|
if (a === -1) a = null;
|
|
8556
8625
|
else if (a += 15, a >= t.length) a = "";
|
|
8557
8626
|
else {
|
|
8558
|
-
var
|
|
8559
|
-
a =
|
|
8627
|
+
var l = t.indexOf(";", a);
|
|
8628
|
+
a = l !== -1 ? t.substring(a, l) : t.substring(a);
|
|
8560
8629
|
}
|
|
8561
|
-
var
|
|
8562
|
-
if (
|
|
8563
|
-
if (a =
|
|
8564
|
-
a = new
|
|
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);
|
|
8565
8634
|
d: {
|
|
8566
|
-
if (t =
|
|
8567
|
-
|
|
8568
|
-
for (var _ =
|
|
8569
|
-
|
|
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];
|
|
8570
8639
|
break d;
|
|
8571
8640
|
}
|
|
8572
8641
|
}
|
|
8573
8642
|
t = "";
|
|
8574
8643
|
}
|
|
8575
|
-
0 < t.length &&
|
|
8644
|
+
0 < t.length && E(a, 3, t), l = V(d, n), t = new N(), p = 0, _ = o.toString();
|
|
8576
8645
|
try {
|
|
8577
|
-
|
|
8578
|
-
} catch (
|
|
8579
|
-
if (
|
|
8580
|
-
if (_ = _.replace(
|
|
8581
|
-
} else throw
|
|
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;
|
|
8582
8651
|
}
|
|
8583
|
-
if (
|
|
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(
|
|
8584
8653
|
a,
|
|
8585
8654
|
1,
|
|
8586
|
-
|
|
8587
|
-
)) :
|
|
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");
|
|
8588
8657
|
if (17 < d) throw Error("The string supplied is too long to be a phone number");
|
|
8589
|
-
if (1 <
|
|
8590
|
-
for (
|
|
8591
|
-
d != 1 &&
|
|
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);
|
|
8592
8661
|
}
|
|
8593
|
-
return
|
|
8662
|
+
return E(a, 2, parseInt(r, 10)), a;
|
|
8594
8663
|
}
|
|
8595
|
-
function
|
|
8664
|
+
function G(d, t) {
|
|
8596
8665
|
return !!((d = t.match(new RegExp("^(?:" + (typeof d == "string" ? d : d.source) + ")$", "i"))) && d[0].length == t.length);
|
|
8597
8666
|
}
|
|
8598
|
-
function
|
|
8599
|
-
this.fa = RegExp(" "), this.ja = "", this.v = new
|
|
8600
|
-
}
|
|
8601
|
-
var
|
|
8602
|
-
|
|
8603
|
-
var
|
|
8604
|
-
function
|
|
8605
|
-
var
|
|
8606
|
-
return t =
|
|
8607
|
-
}
|
|
8608
|
-
function
|
|
8609
|
-
for (var t = d.j.length,
|
|
8610
|
-
var
|
|
8611
|
-
if (d.da ==
|
|
8612
|
-
var a = d,
|
|
8613
|
-
|
|
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);
|
|
8669
|
+
}
|
|
8670
|
+
var Z1 = new W();
|
|
8671
|
+
E(Z1, 11, "NA");
|
|
8672
|
+
var M2 = RegExp("^[-x‐-―−ー--/ ()()[].\\[\\]/~⁓∼~]*\\$1[-x‐-―−ー--/ ()()[].\\[\\]/~⁓∼~]*(\\$\\d[-x‐-―−ー--/ ()()[].\\[\\]/~⁓∼~]*)*$"), Y1 = /[- ]/;
|
|
8673
|
+
function J1(d, t) {
|
|
8674
|
+
var n = d.ga;
|
|
8675
|
+
return t = r1(t) ? V1(n, t) : 0, d = V(d.ga, t1(t)), d ?? Z1;
|
|
8676
|
+
}
|
|
8677
|
+
function q1(d) {
|
|
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);
|
|
8682
|
+
B(a.v);
|
|
8614
8683
|
var _ = a;
|
|
8615
|
-
|
|
8616
|
-
var
|
|
8617
|
-
if (
|
|
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;
|
|
8618
8687
|
}
|
|
8619
8688
|
return d.u = !1;
|
|
8620
8689
|
}
|
|
8621
|
-
function
|
|
8622
|
-
for (var
|
|
8623
|
-
var
|
|
8624
|
-
|
|
8690
|
+
function X1(d, t) {
|
|
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]));
|
|
8625
8694
|
}
|
|
8626
|
-
d.j =
|
|
8695
|
+
d.j = n;
|
|
8627
8696
|
}
|
|
8628
|
-
function
|
|
8697
|
+
function D2(d, t) {
|
|
8629
8698
|
d.s.g(t);
|
|
8630
|
-
var
|
|
8631
|
-
if (
|
|
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) {
|
|
8632
8701
|
if (!d.la) {
|
|
8633
|
-
if (
|
|
8634
|
-
if (
|
|
8635
|
-
} else if (0 < d.o.length && (t = d.g.toString(),
|
|
8702
|
+
if ($2(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);
|
|
8636
8705
|
}
|
|
8637
8706
|
return d.s.toString();
|
|
8638
8707
|
}
|
|
@@ -8642,168 +8711,168 @@ const Z2 = (y) => {
|
|
|
8642
8711
|
case 2:
|
|
8643
8712
|
return d.s.toString();
|
|
8644
8713
|
case 3:
|
|
8645
|
-
if (
|
|
8646
|
-
else return d.o =
|
|
8714
|
+
if ($2(d)) d.ea = !0;
|
|
8715
|
+
else return d.o = e2(d), C1(d);
|
|
8647
8716
|
default:
|
|
8648
|
-
return d.ea ? (
|
|
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);
|
|
8649
8718
|
}
|
|
8650
8719
|
}
|
|
8651
|
-
function
|
|
8652
|
-
return d.u = !0, d.ea = !1, d.j = [], d.$ = 0,
|
|
8720
|
+
function Q1(d) {
|
|
8721
|
+
return d.u = !0, d.ea = !1, d.j = [], d.$ = 0, B(d.v), d.da = "", C1(d);
|
|
8653
8722
|
}
|
|
8654
|
-
function
|
|
8655
|
-
for (var t = d.g.toString(),
|
|
8656
|
-
var
|
|
8657
|
-
if (new RegExp("^(?:" + a + ")$").test(t) && (d.ha =
|
|
8723
|
+
function d2(d) {
|
|
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;
|
|
8658
8727
|
}
|
|
8659
8728
|
return "";
|
|
8660
8729
|
}
|
|
8661
|
-
function
|
|
8662
|
-
var
|
|
8663
|
-
return d.ha && 0 <
|
|
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;
|
|
8664
8733
|
}
|
|
8665
|
-
function
|
|
8734
|
+
function C1(d) {
|
|
8666
8735
|
var t = d.g.toString();
|
|
8667
8736
|
if (3 <= t.length) {
|
|
8668
|
-
for (var
|
|
8669
|
-
var a =
|
|
8670
|
-
0 < d.o.length &&
|
|
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);
|
|
8671
8740
|
}
|
|
8672
|
-
return
|
|
8741
|
+
return X1(d, t), t = d2(d), 0 < t.length ? t : q1(d) ? t2(d) : d.s.toString();
|
|
8673
8742
|
}
|
|
8674
|
-
return
|
|
8743
|
+
return l1(d, t);
|
|
8675
8744
|
}
|
|
8676
|
-
function
|
|
8677
|
-
var t = d.g.toString(),
|
|
8678
|
-
if (0 <
|
|
8679
|
-
for (var
|
|
8680
|
-
return d.u ?
|
|
8745
|
+
function t2(d) {
|
|
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();
|
|
8681
8750
|
}
|
|
8682
8751
|
return d.h.toString();
|
|
8683
8752
|
}
|
|
8684
|
-
function
|
|
8685
|
-
var t = d.g.toString(),
|
|
8686
|
-
if (
|
|
8687
|
-
else
|
|
8688
|
-
return
|
|
8753
|
+
function e2(d) {
|
|
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);
|
|
8758
|
+
}
|
|
8759
|
+
function $2(d) {
|
|
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;
|
|
8689
8762
|
}
|
|
8690
8763
|
function n2(d) {
|
|
8691
|
-
var t = d.ba.toString(), $ = new RegExp("^(?:\\+|" + p(d.l, 11) + ")");
|
|
8692
|
-
return $ = t.match($), $ != null && $[0] != null && 0 < $[0].length ? (d.ca = !0, $ = $[0].length, O(d.g), d.g.g(t.substring($)), O(d.h), d.h.g(t.substring(0, $)), t.charAt(0) != "+" && d.h.g(" "), !0) : !1;
|
|
8693
|
-
}
|
|
8694
|
-
function s2(d) {
|
|
8695
8764
|
if (d.g.h.length == 0) return !1;
|
|
8696
|
-
var t = new
|
|
8697
|
-
return
|
|
8698
|
-
}
|
|
8699
|
-
function
|
|
8700
|
-
var
|
|
8701
|
-
if (0 <=
|
|
8702
|
-
var
|
|
8703
|
-
return t =
|
|
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);
|
|
8704
8773
|
}
|
|
8705
8774
|
return d.j.length == 1 && (d.u = !1), d.da = "", d.s.toString();
|
|
8706
8775
|
}
|
|
8707
|
-
const
|
|
8776
|
+
const s2 = (d) => {
|
|
8708
8777
|
const t = [];
|
|
8709
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);
|
|
8710
|
-
},
|
|
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 };
|
|
8711
8780
|
e("intlTelInputUtilsTemp", {}), e("intlTelInputUtilsTemp.formatNumberAsYouType", (d, t) => {
|
|
8712
8781
|
try {
|
|
8713
|
-
const
|
|
8782
|
+
const n = d.replace(/[^+0-9]/g, ""), r = new T2(t);
|
|
8714
8783
|
t = "";
|
|
8715
|
-
for (let
|
|
8784
|
+
for (let o = 0; o < n.length; o++) r.ja = D2(r, n.charAt(o)), t = r.ja;
|
|
8716
8785
|
return t;
|
|
8717
8786
|
} catch {
|
|
8718
8787
|
return d;
|
|
8719
8788
|
}
|
|
8720
|
-
}), e("intlTelInputUtilsTemp.formatNumber", (d, t,
|
|
8789
|
+
}), e("intlTelInputUtilsTemp.formatNumber", (d, t, n) => {
|
|
8721
8790
|
try {
|
|
8722
|
-
const
|
|
8723
|
-
var
|
|
8724
|
-
return
|
|
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;
|
|
8725
8794
|
} catch {
|
|
8726
8795
|
return d;
|
|
8727
8796
|
}
|
|
8728
|
-
}), e("intlTelInputUtilsTemp.getExampleNumber", (d, t,
|
|
8797
|
+
}), e("intlTelInputUtilsTemp.getExampleNumber", (d, t, n, r) => {
|
|
8729
8798
|
try {
|
|
8730
|
-
const _ =
|
|
8799
|
+
const _ = T.g();
|
|
8731
8800
|
d: {
|
|
8732
|
-
var
|
|
8733
|
-
if (
|
|
8734
|
-
var a =
|
|
8801
|
+
var o = _;
|
|
8802
|
+
if (r1(d)) {
|
|
8803
|
+
var a = o1(V(o, d), n);
|
|
8735
8804
|
try {
|
|
8736
|
-
if (
|
|
8737
|
-
var
|
|
8805
|
+
if (x(a, 6)) {
|
|
8806
|
+
var l = m(a, 6), p = z1(o, l, d, !1);
|
|
8738
8807
|
break d;
|
|
8739
8808
|
}
|
|
8740
8809
|
} catch {
|
|
8741
8810
|
}
|
|
8742
8811
|
}
|
|
8743
|
-
|
|
8812
|
+
p = null;
|
|
8744
8813
|
}
|
|
8745
|
-
return _.format(
|
|
8814
|
+
return _.format(p, r ? 0 : t ? 2 : 1);
|
|
8746
8815
|
} catch {
|
|
8747
8816
|
return "";
|
|
8748
8817
|
}
|
|
8749
8818
|
}), e("intlTelInputUtilsTemp.getExtension", (d, t) => {
|
|
8750
8819
|
try {
|
|
8751
|
-
return
|
|
8820
|
+
return m(z(T.g(), d, t), 3);
|
|
8752
8821
|
} catch {
|
|
8753
8822
|
return "";
|
|
8754
8823
|
}
|
|
8755
8824
|
}), e("intlTelInputUtilsTemp.getNumberType", (d, t) => {
|
|
8756
8825
|
try {
|
|
8757
|
-
const
|
|
8758
|
-
return
|
|
8826
|
+
const n = T.g(), r = z(n, d, t);
|
|
8827
|
+
return F1(n, r);
|
|
8759
8828
|
} catch {
|
|
8760
8829
|
return -99;
|
|
8761
8830
|
}
|
|
8762
8831
|
}), e("intlTelInputUtilsTemp.getValidationError", (d, t) => {
|
|
8763
8832
|
if (!t) return 1;
|
|
8764
8833
|
try {
|
|
8765
|
-
const
|
|
8766
|
-
return
|
|
8767
|
-
} catch (
|
|
8768
|
-
return
|
|
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;
|
|
8769
8838
|
}
|
|
8770
|
-
}), e("intlTelInputUtilsTemp.isValidNumber", (d, t,
|
|
8839
|
+
}), e("intlTelInputUtilsTemp.isValidNumber", (d, t, n) => {
|
|
8771
8840
|
try {
|
|
8772
|
-
const
|
|
8773
|
-
if (
|
|
8774
|
-
const
|
|
8775
|
-
return a &&
|
|
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));
|
|
8776
8845
|
}
|
|
8777
8846
|
return a;
|
|
8778
8847
|
} catch {
|
|
8779
8848
|
return !1;
|
|
8780
8849
|
}
|
|
8781
|
-
}), e("intlTelInputUtilsTemp.isPossibleNumber", (d, t,
|
|
8850
|
+
}), e("intlTelInputUtilsTemp.isPossibleNumber", (d, t, n) => {
|
|
8782
8851
|
try {
|
|
8783
|
-
const
|
|
8784
|
-
if (
|
|
8785
|
-
const a =
|
|
8786
|
-
for (let
|
|
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;
|
|
8787
8856
|
return !1;
|
|
8788
8857
|
}
|
|
8789
|
-
return
|
|
8858
|
+
return u1(r, o, -1) === 0;
|
|
8790
8859
|
} catch {
|
|
8791
8860
|
return !1;
|
|
8792
8861
|
}
|
|
8793
8862
|
}), e("intlTelInputUtilsTemp.getCoreNumber", (d, t) => {
|
|
8794
8863
|
try {
|
|
8795
|
-
return
|
|
8864
|
+
return m(z(T.g(), d, t), 2).toString();
|
|
8796
8865
|
} catch {
|
|
8797
8866
|
return "";
|
|
8798
8867
|
}
|
|
8799
|
-
}), e("intlTelInputUtilsTemp.numberFormat", { E164: 0, INTERNATIONAL: 1, NATIONAL: 2, RFC3966: 3 }), e("intlTelInputUtilsTemp.numberType",
|
|
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 });
|
|
8800
8869
|
})();
|
|
8801
|
-
const
|
|
8802
|
-
delete
|
|
8803
|
-
|
|
8804
|
-
const
|
|
8870
|
+
const h2 = typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : void 0, i0 = h2.intlTelInputUtilsTemp;
|
|
8871
|
+
delete h2.intlTelInputUtilsTemp;
|
|
8872
|
+
y.utils = i0;
|
|
8873
|
+
const r0 = {
|
|
8805
8874
|
__name: "IntlTelInputWithUtils",
|
|
8806
|
-
props: /* @__PURE__ */
|
|
8875
|
+
props: /* @__PURE__ */ r2({
|
|
8807
8876
|
disabled: {
|
|
8808
8877
|
type: Boolean,
|
|
8809
8878
|
default: !1
|
|
@@ -8827,48 +8896,48 @@ const q2 = {
|
|
|
8827
8896
|
},
|
|
8828
8897
|
modelModifiers: {}
|
|
8829
8898
|
}),
|
|
8830
|
-
emits: /* @__PURE__ */
|
|
8899
|
+
emits: /* @__PURE__ */ r2([
|
|
8831
8900
|
"changeNumber",
|
|
8832
8901
|
"changeCountry",
|
|
8833
8902
|
"changeValidity",
|
|
8834
8903
|
"changeErrorCode"
|
|
8835
8904
|
], ["update:modelValue"]),
|
|
8836
|
-
setup(
|
|
8837
|
-
const
|
|
8838
|
-
let
|
|
8839
|
-
C.value !==
|
|
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(
|
|
8840
8909
|
"changeErrorCode",
|
|
8841
|
-
|
|
8910
|
+
v ? null : c.value.getValidationError()
|
|
8842
8911
|
));
|
|
8843
|
-
},
|
|
8844
|
-
var
|
|
8845
|
-
|
|
8846
|
-
},
|
|
8847
|
-
var
|
|
8848
|
-
|
|
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();
|
|
8849
8918
|
};
|
|
8850
|
-
return
|
|
8851
|
-
|
|
8852
|
-
}),
|
|
8853
|
-
() =>
|
|
8854
|
-
(
|
|
8855
|
-
var
|
|
8856
|
-
return (
|
|
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);
|
|
8857
8926
|
}
|
|
8858
8927
|
), R2(() => {
|
|
8859
|
-
var
|
|
8860
|
-
return (
|
|
8861
|
-
}), e({ instance:
|
|
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({
|
|
8862
8931
|
ref_key: "input",
|
|
8863
|
-
ref:
|
|
8864
|
-
"onUpdate:modelValue":
|
|
8932
|
+
ref: h,
|
|
8933
|
+
"onUpdate:modelValue": D[0] || (D[0] = (A) => i.value = A),
|
|
8865
8934
|
type: "tel",
|
|
8866
|
-
onCountrychange:
|
|
8867
|
-
onInput:
|
|
8868
|
-
},
|
|
8935
|
+
onCountrychange: R,
|
|
8936
|
+
onInput: S
|
|
8937
|
+
}, f.inputProps), null, 16)), [
|
|
8869
8938
|
[
|
|
8870
8939
|
F2,
|
|
8871
|
-
|
|
8940
|
+
i.value,
|
|
8872
8941
|
void 0,
|
|
8873
8942
|
{ lazy: !0 }
|
|
8874
8943
|
]
|
|
@@ -8876,5 +8945,5 @@ const q2 = {
|
|
|
8876
8945
|
}
|
|
8877
8946
|
};
|
|
8878
8947
|
export {
|
|
8879
|
-
|
|
8948
|
+
r0 as default
|
|
8880
8949
|
};
|