intl-tel-input 25.5.0 → 25.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -5
- package/angular/build/IntlTelInput.js +258 -316
- package/angular/build/IntlTelInputWithUtils.js +472 -446
- package/angular/build/intl-tel-input.js +4 -2
- package/build/js/data.js +1 -1
- package/build/js/data.min.js +1 -1
- package/build/js/intlTelInput.js +3 -3
- package/build/js/intlTelInput.min.js +2 -2
- package/build/js/intlTelInputWithUtils.js +3 -3
- package/build/js/intlTelInputWithUtils.min.js +2 -2
- package/package.json +4 -4
- package/react/README.md +1 -1
- package/react/build/IntlTelInput.cjs +2 -2
- package/react/build/IntlTelInput.js +2 -2
- package/react/build/IntlTelInputWithUtils.cjs +2 -2
- package/react/build/IntlTelInputWithUtils.js +2 -2
- package/vue/README.md +1 -1
- package/vue/build/IntlTelInput.mjs +2 -2
- package/vue/build/IntlTelInputWithUtils.mjs +2 -2
- package/angular/build/IntlTelInput.cjs +0 -3358
- package/angular/build/IntlTelInput.d.ts +0 -1671
- package/angular/build/IntlTelInputWithUtils.cjs +0 -9732
- package/angular/build/intl-tel-input/angular.js +0 -205
- package/angular/build/intl-tel-input/angularWithUtils.js +0 -206
- package/angular/build/intl-tel-input/data.js +0 -1096
- package/angular/build/intl-tel-input/i18n/ar/countries.js +0 -245
- package/angular/build/intl-tel-input/i18n/ar/index.js +0 -5
- package/angular/build/intl-tel-input/i18n/ar/interface.js +0 -13
- package/angular/build/intl-tel-input/i18n/bg/countries.js +0 -245
- package/angular/build/intl-tel-input/i18n/bg/index.js +0 -5
- package/angular/build/intl-tel-input/i18n/bg/interface.js +0 -13
- package/angular/build/intl-tel-input/i18n/bn/countries.js +0 -245
- package/angular/build/intl-tel-input/i18n/bn/index.js +0 -5
- package/angular/build/intl-tel-input/i18n/bn/interface.js +0 -13
- package/angular/build/intl-tel-input/i18n/bs/countries.js +0 -245
- package/angular/build/intl-tel-input/i18n/bs/index.js +0 -5
- package/angular/build/intl-tel-input/i18n/bs/interface.js +0 -13
- package/angular/build/intl-tel-input/i18n/ca/countries.js +0 -245
- package/angular/build/intl-tel-input/i18n/ca/index.js +0 -5
- package/angular/build/intl-tel-input/i18n/ca/interface.js +0 -13
- package/angular/build/intl-tel-input/i18n/cs/countries.js +0 -245
- package/angular/build/intl-tel-input/i18n/cs/index.js +0 -5
- package/angular/build/intl-tel-input/i18n/cs/interface.js +0 -13
- package/angular/build/intl-tel-input/i18n/da/countries.js +0 -245
- package/angular/build/intl-tel-input/i18n/da/index.js +0 -5
- package/angular/build/intl-tel-input/i18n/da/interface.js +0 -13
- package/angular/build/intl-tel-input/i18n/de/countries.js +0 -245
- package/angular/build/intl-tel-input/i18n/de/index.js +0 -5
- package/angular/build/intl-tel-input/i18n/de/interface.js +0 -13
- package/angular/build/intl-tel-input/i18n/ee/countries.js +0 -245
- package/angular/build/intl-tel-input/i18n/ee/index.js +0 -5
- package/angular/build/intl-tel-input/i18n/ee/interface.js +0 -13
- package/angular/build/intl-tel-input/i18n/el/countries.js +0 -245
- package/angular/build/intl-tel-input/i18n/el/index.js +0 -5
- package/angular/build/intl-tel-input/i18n/el/interface.js +0 -13
- package/angular/build/intl-tel-input/i18n/en/countries.js +0 -245
- package/angular/build/intl-tel-input/i18n/en/index.js +0 -5
- package/angular/build/intl-tel-input/i18n/en/interface.js +0 -13
- package/angular/build/intl-tel-input/i18n/es/countries.js +0 -245
- package/angular/build/intl-tel-input/i18n/es/index.js +0 -5
- package/angular/build/intl-tel-input/i18n/es/interface.js +0 -13
- package/angular/build/intl-tel-input/i18n/fa/countries.js +0 -245
- package/angular/build/intl-tel-input/i18n/fa/index.js +0 -5
- package/angular/build/intl-tel-input/i18n/fa/interface.js +0 -13
- package/angular/build/intl-tel-input/i18n/fi/countries.js +0 -245
- package/angular/build/intl-tel-input/i18n/fi/index.js +0 -5
- package/angular/build/intl-tel-input/i18n/fi/interface.js +0 -13
- package/angular/build/intl-tel-input/i18n/fr/countries.js +0 -245
- package/angular/build/intl-tel-input/i18n/fr/index.js +0 -5
- package/angular/build/intl-tel-input/i18n/fr/interface.js +0 -13
- package/angular/build/intl-tel-input/i18n/hi/countries.js +0 -245
- package/angular/build/intl-tel-input/i18n/hi/index.js +0 -5
- package/angular/build/intl-tel-input/i18n/hi/interface.js +0 -13
- package/angular/build/intl-tel-input/i18n/hr/countries.js +0 -245
- package/angular/build/intl-tel-input/i18n/hr/index.js +0 -5
- package/angular/build/intl-tel-input/i18n/hr/interface.js +0 -13
- package/angular/build/intl-tel-input/i18n/hu/countries.js +0 -245
- package/angular/build/intl-tel-input/i18n/hu/index.js +0 -5
- package/angular/build/intl-tel-input/i18n/hu/interface.js +0 -13
- package/angular/build/intl-tel-input/i18n/id/countries.js +0 -245
- package/angular/build/intl-tel-input/i18n/id/index.js +0 -5
- package/angular/build/intl-tel-input/i18n/id/interface.js +0 -13
- package/angular/build/intl-tel-input/i18n/index.js +0 -40
- package/angular/build/intl-tel-input/i18n/it/countries.js +0 -245
- package/angular/build/intl-tel-input/i18n/it/index.js +0 -5
- package/angular/build/intl-tel-input/i18n/it/interface.js +0 -13
- package/angular/build/intl-tel-input/i18n/ja/countries.js +0 -245
- package/angular/build/intl-tel-input/i18n/ja/index.js +0 -5
- package/angular/build/intl-tel-input/i18n/ja/interface.js +0 -13
- package/angular/build/intl-tel-input/i18n/ko/countries.js +0 -245
- package/angular/build/intl-tel-input/i18n/ko/index.js +0 -5
- package/angular/build/intl-tel-input/i18n/ko/interface.js +0 -13
- package/angular/build/intl-tel-input/i18n/mr/countries.js +0 -245
- package/angular/build/intl-tel-input/i18n/mr/index.js +0 -5
- package/angular/build/intl-tel-input/i18n/mr/interface.js +0 -13
- package/angular/build/intl-tel-input/i18n/nl/countries.js +0 -245
- package/angular/build/intl-tel-input/i18n/nl/index.js +0 -5
- package/angular/build/intl-tel-input/i18n/nl/interface.js +0 -13
- package/angular/build/intl-tel-input/i18n/no/countries.js +0 -245
- package/angular/build/intl-tel-input/i18n/no/index.js +0 -5
- package/angular/build/intl-tel-input/i18n/no/interface.js +0 -13
- package/angular/build/intl-tel-input/i18n/pl/countries.js +0 -245
- package/angular/build/intl-tel-input/i18n/pl/index.js +0 -5
- package/angular/build/intl-tel-input/i18n/pl/interface.js +0 -24
- package/angular/build/intl-tel-input/i18n/pt/countries.js +0 -245
- package/angular/build/intl-tel-input/i18n/pt/index.js +0 -5
- package/angular/build/intl-tel-input/i18n/pt/interface.js +0 -13
- package/angular/build/intl-tel-input/i18n/ro/countries.js +0 -245
- package/angular/build/intl-tel-input/i18n/ro/index.js +0 -5
- package/angular/build/intl-tel-input/i18n/ro/interface.js +0 -13
- package/angular/build/intl-tel-input/i18n/ru/countries.js +0 -245
- package/angular/build/intl-tel-input/i18n/ru/index.js +0 -5
- package/angular/build/intl-tel-input/i18n/ru/interface.js +0 -13
- package/angular/build/intl-tel-input/i18n/sk/countries.js +0 -245
- package/angular/build/intl-tel-input/i18n/sk/index.js +0 -5
- package/angular/build/intl-tel-input/i18n/sk/interface.js +0 -13
- package/angular/build/intl-tel-input/i18n/sv/countries.js +0 -245
- package/angular/build/intl-tel-input/i18n/sv/index.js +0 -5
- package/angular/build/intl-tel-input/i18n/sv/interface.js +0 -13
- package/angular/build/intl-tel-input/i18n/te/countries.js +0 -245
- package/angular/build/intl-tel-input/i18n/te/index.js +0 -5
- package/angular/build/intl-tel-input/i18n/te/interface.js +0 -13
- package/angular/build/intl-tel-input/i18n/th/countries.js +0 -245
- package/angular/build/intl-tel-input/i18n/th/index.js +0 -5
- package/angular/build/intl-tel-input/i18n/th/interface.js +0 -13
- package/angular/build/intl-tel-input/i18n/tr/countries.js +0 -245
- package/angular/build/intl-tel-input/i18n/tr/index.js +0 -5
- package/angular/build/intl-tel-input/i18n/tr/interface.js +0 -13
- package/angular/build/intl-tel-input/i18n/types.js +0 -1
- package/angular/build/intl-tel-input/i18n/uk/countries.js +0 -245
- package/angular/build/intl-tel-input/i18n/uk/index.js +0 -5
- package/angular/build/intl-tel-input/i18n/uk/interface.js +0 -13
- package/angular/build/intl-tel-input/i18n/ur/countries.js +0 -245
- package/angular/build/intl-tel-input/i18n/ur/index.js +0 -5
- package/angular/build/intl-tel-input/i18n/ur/interface.js +0 -13
- package/angular/build/intl-tel-input/i18n/uz/countries.js +0 -245
- package/angular/build/intl-tel-input/i18n/uz/index.js +0 -5
- package/angular/build/intl-tel-input/i18n/uz/interface.js +0 -13
- package/angular/build/intl-tel-input/i18n/vi/countries.js +0 -245
- package/angular/build/intl-tel-input/i18n/vi/index.js +0 -5
- package/angular/build/intl-tel-input/i18n/vi/interface.js +0 -13
- package/angular/build/intl-tel-input/i18n/zh/countries.js +0 -245
- package/angular/build/intl-tel-input/i18n/zh/index.js +0 -5
- package/angular/build/intl-tel-input/i18n/zh/interface.js +0 -13
- package/angular/build/intl-tel-input/intlTelInputWithUtils.js +0 -4
- package/angular/build/intl-tel-input/utils.js +0 -1341
|
@@ -1,15 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
-
var __decorateClass = (decorators, target, key, kind) => {
|
|
4
|
-
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
|
|
5
|
-
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
6
|
-
if (decorator = decorators[i])
|
|
7
|
-
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
8
|
-
if (kind && result) __defProp(target, key, result);
|
|
9
|
-
return result;
|
|
10
|
-
};
|
|
11
|
-
|
|
12
|
-
// src/js/intl-tel-input/data.ts
|
|
1
|
+
// angular/build/temp/intl-tel-input/data.js
|
|
13
2
|
var rawCountryData = [
|
|
14
3
|
[
|
|
15
4
|
"af",
|
|
@@ -1350,7 +1339,7 @@ for (let i = 0; i < rawCountryData.length; i++) {
|
|
|
1350
1339
|
}
|
|
1351
1340
|
var data_default = allCountries;
|
|
1352
1341
|
|
|
1353
|
-
//
|
|
1342
|
+
// angular/build/temp/intl-tel-input/i18n/en/countries.js
|
|
1354
1343
|
var countryTranslations = {
|
|
1355
1344
|
ad: "Andorra",
|
|
1356
1345
|
ae: "United Arab Emirates",
|
|
@@ -1597,7 +1586,7 @@ var countryTranslations = {
|
|
|
1597
1586
|
};
|
|
1598
1587
|
var countries_default = countryTranslations;
|
|
1599
1588
|
|
|
1600
|
-
//
|
|
1589
|
+
// angular/build/temp/intl-tel-input/i18n/en/interface.js
|
|
1601
1590
|
var interfaceTranslations = {
|
|
1602
1591
|
selectedCountryAriaLabel: "Selected country",
|
|
1603
1592
|
noCountrySelected: "No country selected",
|
|
@@ -1612,11 +1601,11 @@ var interfaceTranslations = {
|
|
|
1612
1601
|
};
|
|
1613
1602
|
var interface_default = interfaceTranslations;
|
|
1614
1603
|
|
|
1615
|
-
//
|
|
1616
|
-
var allTranslations = {
|
|
1604
|
+
// angular/build/temp/intl-tel-input/i18n/en/index.js
|
|
1605
|
+
var allTranslations = Object.assign(Object.assign({}, countries_default), interface_default);
|
|
1617
1606
|
var en_default = allTranslations;
|
|
1618
1607
|
|
|
1619
|
-
//
|
|
1608
|
+
// angular/build/temp/intl-tel-input.js
|
|
1620
1609
|
for (let i = 0; i < data_default.length; i++) {
|
|
1621
1610
|
data_default[i].name = en_default[data_default[i].iso2];
|
|
1622
1611
|
}
|
|
@@ -1670,9 +1659,7 @@ var defaults = {
|
|
|
1670
1659
|
useFullscreenPopup: typeof navigator !== "undefined" && typeof window !== "undefined" ? (
|
|
1671
1660
|
//* We cannot just test screen size as some smartphones/website meta tags will report desktop resolutions.
|
|
1672
1661
|
//* Note: to target Android Mobiles (and not Tablets), we must find 'Android' and 'Mobile'
|
|
1673
|
-
/Android.+Mobile|webOS|iPhone|iPod|BlackBerry|IEMobile|Opera Mini/i.test(
|
|
1674
|
-
navigator.userAgent
|
|
1675
|
-
) || window.innerWidth <= 500
|
|
1662
|
+
/Android.+Mobile|webOS|iPhone|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) || window.innerWidth <= 500
|
|
1676
1663
|
) : false,
|
|
1677
1664
|
//* The number type to enforce during validation.
|
|
1678
1665
|
validationNumberTypes: ["MOBILE"]
|
|
@@ -1774,7 +1761,7 @@ var Iti = class {
|
|
|
1774
1761
|
this.originalPaddingLeft = this.telInput.style.paddingLeft;
|
|
1775
1762
|
}
|
|
1776
1763
|
}
|
|
1777
|
-
this.options.i18n = {
|
|
1764
|
+
this.options.i18n = Object.assign(Object.assign({}, en_default), this.options.i18n);
|
|
1778
1765
|
const autoCountryPromise = new Promise((resolve, reject) => {
|
|
1779
1766
|
this.resolveAutoCountryPromise = resolve;
|
|
1780
1767
|
this.rejectAutoCountryPromise = reject;
|
|
@@ -1843,19 +1830,11 @@ var Iti = class {
|
|
|
1843
1830
|
_processAllCountries() {
|
|
1844
1831
|
const { onlyCountries, excludeCountries } = this.options;
|
|
1845
1832
|
if (onlyCountries.length) {
|
|
1846
|
-
const lowerCaseOnlyCountries = onlyCountries.map(
|
|
1847
|
-
|
|
1848
|
-
);
|
|
1849
|
-
this.countries = data_default.filter(
|
|
1850
|
-
(country) => lowerCaseOnlyCountries.includes(country.iso2)
|
|
1851
|
-
);
|
|
1833
|
+
const lowerCaseOnlyCountries = onlyCountries.map((country) => country.toLowerCase());
|
|
1834
|
+
this.countries = data_default.filter((country) => lowerCaseOnlyCountries.includes(country.iso2));
|
|
1852
1835
|
} else if (excludeCountries.length) {
|
|
1853
|
-
const lowerCaseExcludeCountries = excludeCountries.map(
|
|
1854
|
-
|
|
1855
|
-
);
|
|
1856
|
-
this.countries = data_default.filter(
|
|
1857
|
-
(country) => !lowerCaseExcludeCountries.includes(country.iso2)
|
|
1858
|
-
);
|
|
1836
|
+
const lowerCaseExcludeCountries = excludeCountries.map((country) => country.toLowerCase());
|
|
1837
|
+
this.countries = data_default.filter((country) => !lowerCaseExcludeCountries.includes(country.iso2));
|
|
1859
1838
|
} else {
|
|
1860
1839
|
this.countries = data_default;
|
|
1861
1840
|
}
|
|
@@ -1900,22 +1879,12 @@ var Iti = class {
|
|
|
1900
1879
|
}
|
|
1901
1880
|
//* Generate all of the markup for the plugin: the selected country overlay, and the dropdown.
|
|
1902
1881
|
_generateMarkup() {
|
|
1882
|
+
var _a, _b, _c;
|
|
1903
1883
|
this.telInput.classList.add("iti__tel-input");
|
|
1904
1884
|
if (!this.telInput.hasAttribute("autocomplete") && !(this.telInput.form && this.telInput.form.hasAttribute("autocomplete"))) {
|
|
1905
1885
|
this.telInput.setAttribute("autocomplete", "off");
|
|
1906
1886
|
}
|
|
1907
|
-
const {
|
|
1908
|
-
allowDropdown,
|
|
1909
|
-
separateDialCode,
|
|
1910
|
-
showFlags,
|
|
1911
|
-
containerClass,
|
|
1912
|
-
hiddenInput,
|
|
1913
|
-
dropdownContainer,
|
|
1914
|
-
fixDropdownWidth,
|
|
1915
|
-
useFullscreenPopup,
|
|
1916
|
-
countrySearch,
|
|
1917
|
-
i18n
|
|
1918
|
-
} = this.options;
|
|
1887
|
+
const { allowDropdown, separateDialCode, showFlags, containerClass, hiddenInput, dropdownContainer, fixDropdownWidth, useFullscreenPopup, countrySearch, i18n } = this.options;
|
|
1919
1888
|
let parentClass = "iti";
|
|
1920
1889
|
if (allowDropdown) {
|
|
1921
1890
|
parentClass += " iti--allow-dropdown";
|
|
@@ -1930,62 +1899,38 @@ var Iti = class {
|
|
|
1930
1899
|
parentClass += " iti--inline-dropdown";
|
|
1931
1900
|
}
|
|
1932
1901
|
const wrapper = createEl("div", { class: parentClass });
|
|
1933
|
-
this.telInput.parentNode
|
|
1902
|
+
(_a = this.telInput.parentNode) === null || _a === void 0 ? void 0 : _a.insertBefore(wrapper, this.telInput);
|
|
1934
1903
|
if (allowDropdown || showFlags || separateDialCode) {
|
|
1935
|
-
this.countryContainer = createEl(
|
|
1936
|
-
"div",
|
|
1937
|
-
{ class: "iti__country-container" },
|
|
1938
|
-
wrapper
|
|
1939
|
-
);
|
|
1904
|
+
this.countryContainer = createEl("div", { class: "iti__country-container" }, wrapper);
|
|
1940
1905
|
if (this.showSelectedCountryOnLeft) {
|
|
1941
1906
|
this.countryContainer.style.left = "0px";
|
|
1942
1907
|
} else {
|
|
1943
1908
|
this.countryContainer.style.right = "0px";
|
|
1944
1909
|
}
|
|
1945
1910
|
if (allowDropdown) {
|
|
1946
|
-
this.selectedCountry = createEl(
|
|
1947
|
-
"button",
|
|
1948
|
-
|
|
1949
|
-
|
|
1950
|
-
|
|
1951
|
-
|
|
1952
|
-
|
|
1953
|
-
|
|
1954
|
-
|
|
1955
|
-
"role": "combobox"
|
|
1956
|
-
},
|
|
1957
|
-
this.countryContainer
|
|
1958
|
-
);
|
|
1911
|
+
this.selectedCountry = createEl("button", {
|
|
1912
|
+
type: "button",
|
|
1913
|
+
class: "iti__selected-country",
|
|
1914
|
+
"aria-expanded": "false",
|
|
1915
|
+
"aria-label": this.options.i18n.selectedCountryAriaLabel,
|
|
1916
|
+
"aria-haspopup": "true",
|
|
1917
|
+
"aria-controls": `iti-${this.id}__dropdown-content`,
|
|
1918
|
+
"role": "combobox"
|
|
1919
|
+
}, this.countryContainer);
|
|
1959
1920
|
if (this.telInput.disabled) {
|
|
1960
1921
|
this.selectedCountry.setAttribute("disabled", "true");
|
|
1961
1922
|
}
|
|
1962
1923
|
} else {
|
|
1963
|
-
this.selectedCountry = createEl(
|
|
1964
|
-
"div",
|
|
1965
|
-
{ class: "iti__selected-country" },
|
|
1966
|
-
this.countryContainer
|
|
1967
|
-
);
|
|
1924
|
+
this.selectedCountry = createEl("div", { class: "iti__selected-country" }, this.countryContainer);
|
|
1968
1925
|
}
|
|
1969
1926
|
const selectedCountryPrimary = createEl("div", { class: "iti__selected-country-primary" }, this.selectedCountry);
|
|
1970
1927
|
this.selectedCountryInner = createEl("div", { class: "iti__flag" }, selectedCountryPrimary);
|
|
1971
|
-
this.selectedCountryA11yText = createEl(
|
|
1972
|
-
"span",
|
|
1973
|
-
{ class: "iti__a11y-text" },
|
|
1974
|
-
this.selectedCountryInner
|
|
1975
|
-
);
|
|
1928
|
+
this.selectedCountryA11yText = createEl("span", { class: "iti__a11y-text" }, this.selectedCountryInner);
|
|
1976
1929
|
if (allowDropdown) {
|
|
1977
|
-
this.dropdownArrow = createEl(
|
|
1978
|
-
"div",
|
|
1979
|
-
{ class: "iti__arrow", "aria-hidden": "true" },
|
|
1980
|
-
selectedCountryPrimary
|
|
1981
|
-
);
|
|
1930
|
+
this.dropdownArrow = createEl("div", { class: "iti__arrow", "aria-hidden": "true" }, selectedCountryPrimary);
|
|
1982
1931
|
}
|
|
1983
1932
|
if (separateDialCode) {
|
|
1984
|
-
this.selectedDialCode = createEl(
|
|
1985
|
-
"div",
|
|
1986
|
-
{ class: "iti__selected-dial-code" },
|
|
1987
|
-
this.selectedCountry
|
|
1988
|
-
);
|
|
1933
|
+
this.selectedDialCode = createEl("div", { class: "iti__selected-dial-code", "aria-hidden": "true" }, this.selectedCountry);
|
|
1989
1934
|
}
|
|
1990
1935
|
if (allowDropdown) {
|
|
1991
1936
|
const extraClasses = fixDropdownWidth ? "" : "iti--flexible-dropdown-width";
|
|
@@ -1994,37 +1939,25 @@ var Iti = class {
|
|
|
1994
1939
|
class: `iti__dropdown-content iti__hide ${extraClasses}`
|
|
1995
1940
|
});
|
|
1996
1941
|
if (countrySearch) {
|
|
1997
|
-
this.searchInput = createEl(
|
|
1998
|
-
"
|
|
1999
|
-
|
|
2000
|
-
|
|
2001
|
-
|
|
2002
|
-
|
|
2003
|
-
|
|
2004
|
-
|
|
2005
|
-
|
|
2006
|
-
|
|
2007
|
-
|
|
2008
|
-
|
|
2009
|
-
},
|
|
2010
|
-
this.dropdownContent
|
|
2011
|
-
);
|
|
2012
|
-
this.searchResultsA11yText = createEl(
|
|
2013
|
-
"span",
|
|
2014
|
-
{ class: "iti__a11y-text" },
|
|
2015
|
-
this.dropdownContent
|
|
2016
|
-
);
|
|
1942
|
+
this.searchInput = createEl("input", {
|
|
1943
|
+
type: "text",
|
|
1944
|
+
class: "iti__search-input",
|
|
1945
|
+
placeholder: i18n.searchPlaceholder,
|
|
1946
|
+
role: "combobox",
|
|
1947
|
+
"aria-expanded": "true",
|
|
1948
|
+
"aria-label": i18n.searchPlaceholder,
|
|
1949
|
+
"aria-controls": `iti-${this.id}__country-listbox`,
|
|
1950
|
+
"aria-autocomplete": "list",
|
|
1951
|
+
"autocomplete": "off"
|
|
1952
|
+
}, this.dropdownContent);
|
|
1953
|
+
this.searchResultsA11yText = createEl("span", { class: "iti__a11y-text" }, this.dropdownContent);
|
|
2017
1954
|
}
|
|
2018
|
-
this.countryList = createEl(
|
|
2019
|
-
"
|
|
2020
|
-
{
|
|
2021
|
-
|
|
2022
|
-
|
|
2023
|
-
|
|
2024
|
-
"aria-label": i18n.countryListAriaLabel
|
|
2025
|
-
},
|
|
2026
|
-
this.dropdownContent
|
|
2027
|
-
);
|
|
1955
|
+
this.countryList = createEl("ul", {
|
|
1956
|
+
class: "iti__country-list",
|
|
1957
|
+
id: `iti-${this.id}__country-listbox`,
|
|
1958
|
+
role: "listbox",
|
|
1959
|
+
"aria-label": i18n.countryListAriaLabel
|
|
1960
|
+
}, this.dropdownContent);
|
|
2028
1961
|
this._appendListItems();
|
|
2029
1962
|
if (countrySearch) {
|
|
2030
1963
|
this._updateSearchResultsText();
|
|
@@ -2052,7 +1985,7 @@ var Iti = class {
|
|
|
2052
1985
|
const telInputName = this.telInput.getAttribute("name") || "";
|
|
2053
1986
|
const names = hiddenInput(telInputName);
|
|
2054
1987
|
if (names.phone) {
|
|
2055
|
-
const existingInput = this.telInput.form
|
|
1988
|
+
const existingInput = (_b = this.telInput.form) === null || _b === void 0 ? void 0 : _b.querySelector(`input[name="${names.phone}"]`);
|
|
2056
1989
|
if (existingInput) {
|
|
2057
1990
|
this.hiddenInput = existingInput;
|
|
2058
1991
|
} else {
|
|
@@ -2064,7 +1997,7 @@ var Iti = class {
|
|
|
2064
1997
|
}
|
|
2065
1998
|
}
|
|
2066
1999
|
if (names.country) {
|
|
2067
|
-
const existingInput = this.telInput.form
|
|
2000
|
+
const existingInput = (_c = this.telInput.form) === null || _c === void 0 ? void 0 : _c.querySelector(`input[name="${names.country}"]`);
|
|
2068
2001
|
if (existingInput) {
|
|
2069
2002
|
this.hiddenInputCountry = existingInput;
|
|
2070
2003
|
} else {
|
|
@@ -2082,19 +2015,15 @@ var Iti = class {
|
|
|
2082
2015
|
for (let i = 0; i < this.countries.length; i++) {
|
|
2083
2016
|
const c = this.countries[i];
|
|
2084
2017
|
const extraClass = i === 0 ? "iti__highlight" : "";
|
|
2085
|
-
const listItem = createEl(
|
|
2086
|
-
|
|
2087
|
-
{
|
|
2088
|
-
|
|
2089
|
-
|
|
2090
|
-
|
|
2091
|
-
|
|
2092
|
-
|
|
2093
|
-
|
|
2094
|
-
"aria-selected": "false"
|
|
2095
|
-
},
|
|
2096
|
-
this.countryList
|
|
2097
|
-
);
|
|
2018
|
+
const listItem = createEl("li", {
|
|
2019
|
+
id: `iti-${this.id}__item-${c.iso2}`,
|
|
2020
|
+
class: `iti__country ${extraClass}`,
|
|
2021
|
+
tabindex: "-1",
|
|
2022
|
+
role: "option",
|
|
2023
|
+
"data-dial-code": c.dialCode,
|
|
2024
|
+
"data-country-code": c.iso2,
|
|
2025
|
+
"aria-selected": "false"
|
|
2026
|
+
}, this.countryList);
|
|
2098
2027
|
c.nodeById[this.id] = listItem;
|
|
2099
2028
|
let content = "";
|
|
2100
2029
|
if (this.options.showFlags) {
|
|
@@ -2148,6 +2077,7 @@ var Iti = class {
|
|
|
2148
2077
|
}
|
|
2149
2078
|
//* Update hidden input on form submit.
|
|
2150
2079
|
_initHiddenInputListener() {
|
|
2080
|
+
var _a;
|
|
2151
2081
|
this._handleHiddenInputSubmit = () => {
|
|
2152
2082
|
if (this.hiddenInput) {
|
|
2153
2083
|
this.hiddenInput.value = this.getNumber();
|
|
@@ -2156,10 +2086,7 @@ var Iti = class {
|
|
|
2156
2086
|
this.hiddenInputCountry.value = this.getSelectedCountryData().iso2 || "";
|
|
2157
2087
|
}
|
|
2158
2088
|
};
|
|
2159
|
-
this.telInput.form
|
|
2160
|
-
"submit",
|
|
2161
|
-
this._handleHiddenInputSubmit
|
|
2162
|
-
);
|
|
2089
|
+
(_a = this.telInput.form) === null || _a === void 0 ? void 0 : _a.addEventListener("submit", this._handleHiddenInputSubmit);
|
|
2163
2090
|
}
|
|
2164
2091
|
//* initialise the dropdown listeners.
|
|
2165
2092
|
_initDropdownListeners() {
|
|
@@ -2191,18 +2118,16 @@ var Iti = class {
|
|
|
2191
2118
|
this._closeDropdown();
|
|
2192
2119
|
}
|
|
2193
2120
|
};
|
|
2194
|
-
this.countryContainer.addEventListener(
|
|
2195
|
-
"keydown",
|
|
2196
|
-
this._handleCountryContainerKeydown
|
|
2197
|
-
);
|
|
2121
|
+
this.countryContainer.addEventListener("keydown", this._handleCountryContainerKeydown);
|
|
2198
2122
|
}
|
|
2199
2123
|
//* Init many requests: utils script / geo ip lookup.
|
|
2200
2124
|
_initRequests() {
|
|
2201
2125
|
let { loadUtils, initialCountry, geoIpLookup } = this.options;
|
|
2202
2126
|
if (loadUtils && !intlTelInput.utils) {
|
|
2203
2127
|
this._handlePageLoad = () => {
|
|
2128
|
+
var _a;
|
|
2204
2129
|
window.removeEventListener("load", this._handlePageLoad);
|
|
2205
|
-
intlTelInput.attachUtils(loadUtils)
|
|
2130
|
+
(_a = intlTelInput.attachUtils(loadUtils)) === null || _a === void 0 ? void 0 : _a.catch(() => {
|
|
2206
2131
|
});
|
|
2207
2132
|
};
|
|
2208
2133
|
if (intlTelInput.documentReady()) {
|
|
@@ -2227,23 +2152,20 @@ var Iti = class {
|
|
|
2227
2152
|
} else if (!intlTelInput.startedLoadingAutoCountry) {
|
|
2228
2153
|
intlTelInput.startedLoadingAutoCountry = true;
|
|
2229
2154
|
if (typeof this.options.geoIpLookup === "function") {
|
|
2230
|
-
this.options.geoIpLookup(
|
|
2231
|
-
|
|
2232
|
-
|
|
2233
|
-
|
|
2234
|
-
|
|
2235
|
-
|
|
2236
|
-
|
|
2237
|
-
} else {
|
|
2238
|
-
this._setInitialState(true);
|
|
2239
|
-
forEachInstance("rejectAutoCountryPromise");
|
|
2240
|
-
}
|
|
2241
|
-
},
|
|
2242
|
-
() => {
|
|
2155
|
+
this.options.geoIpLookup((iso2 = "") => {
|
|
2156
|
+
const iso2Lower = iso2.toLowerCase();
|
|
2157
|
+
const isValidIso2 = iso2Lower && this._getCountryData(iso2Lower, true);
|
|
2158
|
+
if (isValidIso2) {
|
|
2159
|
+
intlTelInput.autoCountry = iso2Lower;
|
|
2160
|
+
setTimeout(() => forEachInstance("handleAutoCountry"));
|
|
2161
|
+
} else {
|
|
2243
2162
|
this._setInitialState(true);
|
|
2244
2163
|
forEachInstance("rejectAutoCountryPromise");
|
|
2245
2164
|
}
|
|
2246
|
-
)
|
|
2165
|
+
}, () => {
|
|
2166
|
+
this._setInitialState(true);
|
|
2167
|
+
forEachInstance("rejectAutoCountryPromise");
|
|
2168
|
+
});
|
|
2247
2169
|
}
|
|
2248
2170
|
}
|
|
2249
2171
|
}
|
|
@@ -2260,7 +2182,7 @@ var Iti = class {
|
|
|
2260
2182
|
userOverrideFormatting = true;
|
|
2261
2183
|
}
|
|
2262
2184
|
this._handleInputEvent = (e) => {
|
|
2263
|
-
if (this.isAndroid && e
|
|
2185
|
+
if (this.isAndroid && (e === null || e === void 0 ? void 0 : e.data) === "+" && separateDialCode && allowDropdown && countrySearch) {
|
|
2264
2186
|
const currentCaretPos = this.telInput.selectionStart || 0;
|
|
2265
2187
|
const valueBeforeCaret = this.telInput.value.substring(0, currentCaretPos - 1);
|
|
2266
2188
|
const valueAfterCaret = this.telInput.value.substring(currentCaretPos);
|
|
@@ -2271,19 +2193,19 @@ var Iti = class {
|
|
|
2271
2193
|
if (this._updateCountryFromNumber(this.telInput.value)) {
|
|
2272
2194
|
this._triggerCountryChange();
|
|
2273
2195
|
}
|
|
2274
|
-
const isFormattingChar = e
|
|
2275
|
-
const isPaste = e
|
|
2196
|
+
const isFormattingChar = (e === null || e === void 0 ? void 0 : e.data) && /[^+0-9]/.test(e.data);
|
|
2197
|
+
const isPaste = (e === null || e === void 0 ? void 0 : e.inputType) === "insertFromPaste" && this.telInput.value;
|
|
2276
2198
|
if (isFormattingChar || isPaste && !strictMode) {
|
|
2277
2199
|
userOverrideFormatting = true;
|
|
2278
2200
|
} else if (!/[^+0-9]/.test(this.telInput.value)) {
|
|
2279
2201
|
userOverrideFormatting = false;
|
|
2280
2202
|
}
|
|
2281
|
-
const disableFormatOnSetNumber = e
|
|
2203
|
+
const disableFormatOnSetNumber = (e === null || e === void 0 ? void 0 : e.detail) && e.detail["isSetNumber"] && !formatOnDisplay;
|
|
2282
2204
|
if (formatAsYouType && !userOverrideFormatting && !disableFormatOnSetNumber) {
|
|
2283
2205
|
const currentCaretPos = this.telInput.selectionStart || 0;
|
|
2284
2206
|
const valueBeforeCaret = this.telInput.value.substring(0, currentCaretPos);
|
|
2285
2207
|
const relevantCharsBeforeCaret = valueBeforeCaret.replace(/[^+0-9]/g, "").length;
|
|
2286
|
-
const isDeleteForwards = e
|
|
2208
|
+
const isDeleteForwards = (e === null || e === void 0 ? void 0 : e.inputType) === "deleteContentForward";
|
|
2287
2209
|
const formattedValue = this._formatNumberAsYouType();
|
|
2288
2210
|
const newCaretPos = translateCursorPosition(relevantCharsBeforeCaret, formattedValue, currentCaretPos, isDeleteForwards);
|
|
2289
2211
|
this.telInput.value = formattedValue;
|
|
@@ -2374,17 +2296,16 @@ var Iti = class {
|
|
|
2374
2296
|
//* We only bind dropdown listeners when the dropdown is open.
|
|
2375
2297
|
_bindDropdownListeners() {
|
|
2376
2298
|
this._handleMouseoverCountryList = (e) => {
|
|
2377
|
-
|
|
2299
|
+
var _a;
|
|
2300
|
+
const listItem = (_a = e.target) === null || _a === void 0 ? void 0 : _a.closest(".iti__country");
|
|
2378
2301
|
if (listItem) {
|
|
2379
2302
|
this._highlightListItem(listItem, false);
|
|
2380
2303
|
}
|
|
2381
2304
|
};
|
|
2382
|
-
this.countryList.addEventListener(
|
|
2383
|
-
"mouseover",
|
|
2384
|
-
this._handleMouseoverCountryList
|
|
2385
|
-
);
|
|
2305
|
+
this.countryList.addEventListener("mouseover", this._handleMouseoverCountryList);
|
|
2386
2306
|
this._handleClickCountryList = (e) => {
|
|
2387
|
-
|
|
2307
|
+
var _a;
|
|
2308
|
+
const listItem = (_a = e.target) === null || _a === void 0 ? void 0 : _a.closest(".iti__country");
|
|
2388
2309
|
if (listItem) {
|
|
2389
2310
|
this._selectListItem(listItem);
|
|
2390
2311
|
}
|
|
@@ -2397,10 +2318,7 @@ var Iti = class {
|
|
|
2397
2318
|
}
|
|
2398
2319
|
isOpening = false;
|
|
2399
2320
|
};
|
|
2400
|
-
document.documentElement.addEventListener(
|
|
2401
|
-
"click",
|
|
2402
|
-
this._handleClickOffToClose
|
|
2403
|
-
);
|
|
2321
|
+
document.documentElement.addEventListener("click", this._handleClickOffToClose);
|
|
2404
2322
|
let query = "";
|
|
2405
2323
|
let queryTimer = null;
|
|
2406
2324
|
this._handleKeydownOnDropdown = (e) => {
|
|
@@ -2469,16 +2387,45 @@ var Iti = class {
|
|
|
2469
2387
|
let noCountriesAddedYet = true;
|
|
2470
2388
|
this.countryList.innerHTML = "";
|
|
2471
2389
|
const normalisedQuery = normaliseString(query);
|
|
2390
|
+
const queryLength = normalisedQuery.length;
|
|
2391
|
+
const iso2Matches = [];
|
|
2392
|
+
const nameStartWith = [];
|
|
2393
|
+
const nameContains = [];
|
|
2394
|
+
const dialCodeMatches = [];
|
|
2395
|
+
const dialCodeContains = [];
|
|
2396
|
+
const initialsMatches = [];
|
|
2472
2397
|
for (let i = 0; i < this.countries.length; i++) {
|
|
2473
2398
|
const c = this.countries[i];
|
|
2474
2399
|
const normalisedCountryName = normaliseString(c.name);
|
|
2475
2400
|
const countryInitials = c.name.split(/[^a-zA-ZÀ-ÿа-яА-Я]/).map((word) => word[0]).join("").toLowerCase();
|
|
2476
|
-
|
|
2477
|
-
|
|
2478
|
-
|
|
2479
|
-
|
|
2480
|
-
|
|
2481
|
-
|
|
2401
|
+
if (isReset || queryLength === 0) {
|
|
2402
|
+
nameContains.push(c);
|
|
2403
|
+
} else if (c.iso2.toLowerCase() === normalisedQuery) {
|
|
2404
|
+
iso2Matches.push(c);
|
|
2405
|
+
} else if (normalisedCountryName.startsWith(normalisedQuery)) {
|
|
2406
|
+
nameStartWith.push(c);
|
|
2407
|
+
} else if (normalisedCountryName.includes(normalisedQuery)) {
|
|
2408
|
+
nameContains.push(c);
|
|
2409
|
+
} else if (normalisedQuery === c.dialCode || normalisedQuery === `+${c.dialCode}`) {
|
|
2410
|
+
dialCodeMatches.push(c);
|
|
2411
|
+
} else if (`+${c.dialCode}`.includes(normalisedQuery)) {
|
|
2412
|
+
dialCodeContains.push(c);
|
|
2413
|
+
} else if (countryInitials.includes(normalisedQuery)) {
|
|
2414
|
+
initialsMatches.push(c);
|
|
2415
|
+
}
|
|
2416
|
+
}
|
|
2417
|
+
const matchedCountries = [
|
|
2418
|
+
...iso2Matches.sort((a, b) => a.priority - b.priority),
|
|
2419
|
+
...nameStartWith.sort((a, b) => a.priority - b.priority),
|
|
2420
|
+
...nameContains.sort((a, b) => a.priority - b.priority),
|
|
2421
|
+
...dialCodeMatches.sort((a, b) => a.priority - b.priority),
|
|
2422
|
+
...dialCodeContains.sort((a, b) => a.priority - b.priority),
|
|
2423
|
+
...initialsMatches.sort((a, b) => a.priority - b.priority)
|
|
2424
|
+
];
|
|
2425
|
+
for (const c of matchedCountries) {
|
|
2426
|
+
const listItem = c.nodeById[this.id];
|
|
2427
|
+
if (listItem) {
|
|
2428
|
+
this.countryList.appendChild(listItem);
|
|
2482
2429
|
if (noCountriesAddedYet) {
|
|
2483
2430
|
this._highlightListItem(listItem, false);
|
|
2484
2431
|
noCountriesAddedYet = false;
|
|
@@ -2511,7 +2458,8 @@ var Iti = class {
|
|
|
2511
2458
|
}
|
|
2512
2459
|
//* Highlight the next/prev item in the list (and ensure it is visible).
|
|
2513
2460
|
_handleUpDownKey(key) {
|
|
2514
|
-
|
|
2461
|
+
var _a, _b;
|
|
2462
|
+
let next = key === "ArrowUp" ? (_a = this.highlightedItem) === null || _a === void 0 ? void 0 : _a.previousElementSibling : (_b = this.highlightedItem) === null || _b === void 0 ? void 0 : _b.nextElementSibling;
|
|
2515
2463
|
if (!next && this.countryList.childElementCount > 1) {
|
|
2516
2464
|
next = key === "ArrowUp" ? this.countryList.lastElementChild : this.countryList.firstElementChild;
|
|
2517
2465
|
}
|
|
@@ -2534,11 +2482,7 @@ var Iti = class {
|
|
|
2534
2482
|
const useNational = this.options.nationalMode || number.charAt(0) !== "+" && !this.options.separateDialCode;
|
|
2535
2483
|
const { NATIONAL, INTERNATIONAL } = intlTelInput.utils.numberFormat;
|
|
2536
2484
|
const format = useNational ? NATIONAL : INTERNATIONAL;
|
|
2537
|
-
number = intlTelInput.utils.formatNumber(
|
|
2538
|
-
number,
|
|
2539
|
-
this.selectedCountryData.iso2,
|
|
2540
|
-
format
|
|
2541
|
-
);
|
|
2485
|
+
number = intlTelInput.utils.formatNumber(number, this.selectedCountryData.iso2, format);
|
|
2542
2486
|
}
|
|
2543
2487
|
number = this._beforeSetNumber(number);
|
|
2544
2488
|
this.telInput.value = number;
|
|
@@ -2681,12 +2625,7 @@ var Iti = class {
|
|
|
2681
2625
|
if (strictMode && intlTelInput.utils) {
|
|
2682
2626
|
if (iso2) {
|
|
2683
2627
|
const numberType = intlTelInput.utils.numberType[placeholderNumberType];
|
|
2684
|
-
let exampleNumber = intlTelInput.utils.getExampleNumber(
|
|
2685
|
-
iso2,
|
|
2686
|
-
false,
|
|
2687
|
-
numberType,
|
|
2688
|
-
true
|
|
2689
|
-
);
|
|
2628
|
+
let exampleNumber = intlTelInput.utils.getExampleNumber(iso2, false, numberType, true);
|
|
2690
2629
|
let validNumber = exampleNumber;
|
|
2691
2630
|
while (intlTelInput.utils.isPossibleNumber(exampleNumber, iso2, validationNumberTypes)) {
|
|
2692
2631
|
validNumber = exampleNumber;
|
|
@@ -2737,20 +2676,11 @@ var Iti = class {
|
|
|
2737
2676
|
}
|
|
2738
2677
|
//* Update the input placeholder to an example number from the currently selected country.
|
|
2739
2678
|
_updatePlaceholder() {
|
|
2740
|
-
const {
|
|
2741
|
-
autoPlaceholder,
|
|
2742
|
-
placeholderNumberType,
|
|
2743
|
-
nationalMode,
|
|
2744
|
-
customPlaceholder
|
|
2745
|
-
} = this.options;
|
|
2679
|
+
const { autoPlaceholder, placeholderNumberType, nationalMode, customPlaceholder } = this.options;
|
|
2746
2680
|
const shouldSetPlaceholder = autoPlaceholder === "aggressive" || !this.hadInitialPlaceholder && autoPlaceholder === "polite";
|
|
2747
2681
|
if (intlTelInput.utils && shouldSetPlaceholder) {
|
|
2748
2682
|
const numberType = intlTelInput.utils.numberType[placeholderNumberType];
|
|
2749
|
-
let placeholder = this.selectedCountryData.iso2 ? intlTelInput.utils.getExampleNumber(
|
|
2750
|
-
this.selectedCountryData.iso2,
|
|
2751
|
-
nationalMode,
|
|
2752
|
-
numberType
|
|
2753
|
-
) : "";
|
|
2683
|
+
let placeholder = this.selectedCountryData.iso2 ? intlTelInput.utils.getExampleNumber(this.selectedCountryData.iso2, nationalMode, numberType) : "";
|
|
2754
2684
|
placeholder = this._beforeSetNumber(placeholder);
|
|
2755
2685
|
if (typeof customPlaceholder === "function") {
|
|
2756
2686
|
placeholder = customPlaceholder(placeholder, this.selectedCountryData);
|
|
@@ -2760,9 +2690,7 @@ var Iti = class {
|
|
|
2760
2690
|
}
|
|
2761
2691
|
//* Called when the user selects a list item from the dropdown.
|
|
2762
2692
|
_selectListItem(listItem) {
|
|
2763
|
-
const countryChanged = this._setCountry(
|
|
2764
|
-
listItem.getAttribute("data-country-code")
|
|
2765
|
-
);
|
|
2693
|
+
const countryChanged = this._setCountry(listItem.getAttribute("data-country-code"));
|
|
2766
2694
|
this._closeDropdown();
|
|
2767
2695
|
this._updateDialCode(listItem.getAttribute("data-dial-code"));
|
|
2768
2696
|
this.telInput.focus();
|
|
@@ -2786,14 +2714,8 @@ var Iti = class {
|
|
|
2786
2714
|
if (this.options.countrySearch) {
|
|
2787
2715
|
this.searchInput.removeEventListener("input", this._handleSearchChange);
|
|
2788
2716
|
}
|
|
2789
|
-
document.documentElement.removeEventListener(
|
|
2790
|
-
|
|
2791
|
-
this._handleClickOffToClose
|
|
2792
|
-
);
|
|
2793
|
-
this.countryList.removeEventListener(
|
|
2794
|
-
"mouseover",
|
|
2795
|
-
this._handleMouseoverCountryList
|
|
2796
|
-
);
|
|
2717
|
+
document.documentElement.removeEventListener("click", this._handleClickOffToClose);
|
|
2718
|
+
this.countryList.removeEventListener("mouseover", this._handleMouseoverCountryList);
|
|
2797
2719
|
this.countryList.removeEventListener("click", this._handleClickCountryList);
|
|
2798
2720
|
if (this.options.dropdownContainer) {
|
|
2799
2721
|
if (!this.options.useFullscreenPopup) {
|
|
@@ -2943,18 +2865,13 @@ var Iti = class {
|
|
|
2943
2865
|
//********************
|
|
2944
2866
|
//* Remove plugin.
|
|
2945
2867
|
destroy() {
|
|
2868
|
+
var _a, _b;
|
|
2946
2869
|
this.telInput.iti = void 0;
|
|
2947
2870
|
const { allowDropdown, separateDialCode } = this.options;
|
|
2948
2871
|
if (allowDropdown) {
|
|
2949
2872
|
this._closeDropdown();
|
|
2950
|
-
this.selectedCountry.removeEventListener(
|
|
2951
|
-
|
|
2952
|
-
this._handleClickSelectedCountry
|
|
2953
|
-
);
|
|
2954
|
-
this.countryContainer.removeEventListener(
|
|
2955
|
-
"keydown",
|
|
2956
|
-
this._handleCountryContainerKeydown
|
|
2957
|
-
);
|
|
2873
|
+
this.selectedCountry.removeEventListener("click", this._handleClickSelectedCountry);
|
|
2874
|
+
this.countryContainer.removeEventListener("keydown", this._handleCountryContainerKeydown);
|
|
2958
2875
|
const label = this.telInput.closest("label");
|
|
2959
2876
|
if (label) {
|
|
2960
2877
|
label.removeEventListener("click", this._handleLabelClick);
|
|
@@ -2977,17 +2894,14 @@ var Iti = class {
|
|
|
2977
2894
|
}
|
|
2978
2895
|
}
|
|
2979
2896
|
const wrapper = this.telInput.parentNode;
|
|
2980
|
-
wrapper
|
|
2981
|
-
wrapper
|
|
2897
|
+
(_a = wrapper === null || wrapper === void 0 ? void 0 : wrapper.parentNode) === null || _a === void 0 ? void 0 : _a.insertBefore(this.telInput, wrapper);
|
|
2898
|
+
(_b = wrapper === null || wrapper === void 0 ? void 0 : wrapper.parentNode) === null || _b === void 0 ? void 0 : _b.removeChild(wrapper);
|
|
2982
2899
|
delete intlTelInput.instances[this.id];
|
|
2983
2900
|
}
|
|
2984
2901
|
//* Get the extension from the current number.
|
|
2985
2902
|
getExtension() {
|
|
2986
2903
|
if (intlTelInput.utils) {
|
|
2987
|
-
return intlTelInput.utils.getExtension(
|
|
2988
|
-
this._getFullNumber(),
|
|
2989
|
-
this.selectedCountryData.iso2
|
|
2990
|
-
);
|
|
2904
|
+
return intlTelInput.utils.getExtension(this._getFullNumber(), this.selectedCountryData.iso2);
|
|
2991
2905
|
}
|
|
2992
2906
|
return "";
|
|
2993
2907
|
}
|
|
@@ -2995,21 +2909,14 @@ var Iti = class {
|
|
|
2995
2909
|
getNumber(format) {
|
|
2996
2910
|
if (intlTelInput.utils) {
|
|
2997
2911
|
const { iso2 } = this.selectedCountryData;
|
|
2998
|
-
return intlTelInput.utils.formatNumber(
|
|
2999
|
-
this._getFullNumber(),
|
|
3000
|
-
iso2,
|
|
3001
|
-
format
|
|
3002
|
-
);
|
|
2912
|
+
return intlTelInput.utils.formatNumber(this._getFullNumber(), iso2, format);
|
|
3003
2913
|
}
|
|
3004
2914
|
return "";
|
|
3005
2915
|
}
|
|
3006
2916
|
//* Get the type of the entered number e.g. landline/mobile.
|
|
3007
2917
|
getNumberType() {
|
|
3008
2918
|
if (intlTelInput.utils) {
|
|
3009
|
-
return intlTelInput.utils.getNumberType(
|
|
3010
|
-
this._getFullNumber(),
|
|
3011
|
-
this.selectedCountryData.iso2
|
|
3012
|
-
);
|
|
2919
|
+
return intlTelInput.utils.getNumberType(this._getFullNumber(), this.selectedCountryData.iso2);
|
|
3013
2920
|
}
|
|
3014
2921
|
return -99;
|
|
3015
2922
|
}
|
|
@@ -3063,7 +2970,7 @@ var Iti = class {
|
|
|
3063
2970
|
}
|
|
3064
2971
|
//* Update the selected country, and update the input val accordingly.
|
|
3065
2972
|
setCountry(iso2) {
|
|
3066
|
-
const iso2Lower = iso2
|
|
2973
|
+
const iso2Lower = iso2 === null || iso2 === void 0 ? void 0 : iso2.toLowerCase();
|
|
3067
2974
|
const currentCountry = this.selectedCountryData.iso2;
|
|
3068
2975
|
const isCountryChange = iso2 && iso2Lower !== currentCountry || !iso2 && currentCountry;
|
|
3069
2976
|
if (isCountryChange) {
|
|
@@ -3109,7 +3016,7 @@ var attachUtils = (source) => {
|
|
|
3109
3016
|
}
|
|
3110
3017
|
intlTelInput.startedLoadingUtilsScript = true;
|
|
3111
3018
|
return loadCall.then((module) => {
|
|
3112
|
-
const utils2 = module
|
|
3019
|
+
const utils2 = module === null || module === void 0 ? void 0 : module.default;
|
|
3113
3020
|
if (!utils2 || typeof utils2 !== "object") {
|
|
3114
3021
|
throw new TypeError("The loader function passed to attachUtils did not resolve to a module object with utils as its default export.");
|
|
3115
3022
|
}
|
|
@@ -3123,44 +3030,42 @@ var attachUtils = (source) => {
|
|
|
3123
3030
|
}
|
|
3124
3031
|
return null;
|
|
3125
3032
|
};
|
|
3126
|
-
var intlTelInput = Object.assign(
|
|
3127
|
-
(input, options)
|
|
3128
|
-
|
|
3129
|
-
|
|
3130
|
-
|
|
3131
|
-
|
|
3132
|
-
|
|
3133
|
-
|
|
3033
|
+
var intlTelInput = Object.assign((input, options) => {
|
|
3034
|
+
const iti = new Iti(input, options);
|
|
3035
|
+
iti._init();
|
|
3036
|
+
input.setAttribute("data-intl-tel-input-id", iti.id.toString());
|
|
3037
|
+
intlTelInput.instances[iti.id] = iti;
|
|
3038
|
+
input.iti = iti;
|
|
3039
|
+
return iti;
|
|
3040
|
+
}, {
|
|
3041
|
+
defaults,
|
|
3042
|
+
//* Using a static var like this allows us to mock it in the tests.
|
|
3043
|
+
documentReady: () => document.readyState === "complete",
|
|
3044
|
+
//* Get the country data object.
|
|
3045
|
+
getCountryData: () => data_default,
|
|
3046
|
+
//* A getter for the plugin instance.
|
|
3047
|
+
getInstance: (input) => {
|
|
3048
|
+
const id2 = input.getAttribute("data-intl-tel-input-id");
|
|
3049
|
+
return id2 ? intlTelInput.instances[id2] : null;
|
|
3134
3050
|
},
|
|
3135
|
-
|
|
3136
|
-
|
|
3137
|
-
|
|
3138
|
-
|
|
3139
|
-
|
|
3140
|
-
|
|
3141
|
-
|
|
3142
|
-
getInstance: (input) => {
|
|
3143
|
-
const id2 = input.getAttribute("data-intl-tel-input-id");
|
|
3144
|
-
return id2 ? intlTelInput.instances[id2] : null;
|
|
3145
|
-
},
|
|
3146
|
-
//* A map from instance ID to instance object.
|
|
3147
|
-
instances: {},
|
|
3148
|
-
attachUtils,
|
|
3149
|
-
startedLoadingUtilsScript: false,
|
|
3150
|
-
startedLoadingAutoCountry: false,
|
|
3151
|
-
version: "25.4.7"
|
|
3152
|
-
}
|
|
3153
|
-
);
|
|
3051
|
+
//* A map from instance ID to instance object.
|
|
3052
|
+
instances: {},
|
|
3053
|
+
attachUtils,
|
|
3054
|
+
startedLoadingUtilsScript: false,
|
|
3055
|
+
startedLoadingAutoCountry: false,
|
|
3056
|
+
version: "25.5.1"
|
|
3057
|
+
});
|
|
3154
3058
|
var intl_tel_input_default = intlTelInput;
|
|
3155
3059
|
|
|
3156
|
-
// build/
|
|
3060
|
+
// angular/build/temp/intl-tel-input/utils.js
|
|
3157
3061
|
(function() {
|
|
3158
3062
|
var k = this || self;
|
|
3159
3063
|
function m(a, b) {
|
|
3160
3064
|
a = a.split(".");
|
|
3161
3065
|
var c = k;
|
|
3162
3066
|
a[0] in c || "undefined" == typeof c.execScript || c.execScript("var " + a[0]);
|
|
3163
|
-
for (var d; a.length && (d = a.shift()); )
|
|
3067
|
+
for (var d; a.length && (d = a.shift()); )
|
|
3068
|
+
a.length || void 0 === b ? c[d] && c[d] !== Object.prototype[d] ? c = c[d] : c = c[d] = {} : c[d] = b;
|
|
3164
3069
|
}
|
|
3165
3070
|
function n(a, b) {
|
|
3166
3071
|
function c() {
|
|
@@ -3170,7 +3075,8 @@ var intl_tel_input_default = intlTelInput;
|
|
|
3170
3075
|
a.prototype = new c();
|
|
3171
3076
|
a.prototype.constructor = a;
|
|
3172
3077
|
a.sa = function(d, e, f) {
|
|
3173
|
-
for (var g = Array(arguments.length - 2), h = 2; h < arguments.length; h++)
|
|
3078
|
+
for (var g = Array(arguments.length - 2), h = 2; h < arguments.length; h++)
|
|
3079
|
+
g[h - 2] = arguments[h];
|
|
3174
3080
|
return b.prototype[e].apply(d, g);
|
|
3175
3081
|
};
|
|
3176
3082
|
}
|
|
@@ -3178,13 +3084,15 @@ var intl_tel_input_default = intlTelInput;
|
|
|
3178
3084
|
function aa(a) {
|
|
3179
3085
|
const b = [];
|
|
3180
3086
|
let c = 0;
|
|
3181
|
-
for (const d in a)
|
|
3087
|
+
for (const d in a)
|
|
3088
|
+
b[c++] = a[d];
|
|
3182
3089
|
return b;
|
|
3183
3090
|
}
|
|
3184
3091
|
;
|
|
3185
3092
|
var da = class {
|
|
3186
3093
|
constructor(a) {
|
|
3187
|
-
if (ba !== ba)
|
|
3094
|
+
if (ba !== ba)
|
|
3095
|
+
throw Error("SafeUrl is not meant to be built directly");
|
|
3188
3096
|
this.g = a;
|
|
3189
3097
|
}
|
|
3190
3098
|
toString() {
|
|
@@ -3196,7 +3104,8 @@ var intl_tel_input_default = intlTelInput;
|
|
|
3196
3104
|
const ea = {};
|
|
3197
3105
|
class fa {
|
|
3198
3106
|
constructor() {
|
|
3199
|
-
if (ea !== ea)
|
|
3107
|
+
if (ea !== ea)
|
|
3108
|
+
throw Error("SafeStyle is not meant to be built directly");
|
|
3200
3109
|
}
|
|
3201
3110
|
toString() {
|
|
3202
3111
|
return "".toString();
|
|
@@ -3206,7 +3115,8 @@ var intl_tel_input_default = intlTelInput;
|
|
|
3206
3115
|
const ha = {};
|
|
3207
3116
|
class ia {
|
|
3208
3117
|
constructor() {
|
|
3209
|
-
if (ha !== ha)
|
|
3118
|
+
if (ha !== ha)
|
|
3119
|
+
throw Error("SafeStyleSheet is not meant to be built directly");
|
|
3210
3120
|
}
|
|
3211
3121
|
toString() {
|
|
3212
3122
|
return "".toString();
|
|
@@ -3217,7 +3127,8 @@ var intl_tel_input_default = intlTelInput;
|
|
|
3217
3127
|
class ka {
|
|
3218
3128
|
constructor() {
|
|
3219
3129
|
var a = k.trustedTypes && k.trustedTypes.emptyHTML || "";
|
|
3220
|
-
if (ja !== ja)
|
|
3130
|
+
if (ja !== ja)
|
|
3131
|
+
throw Error("SafeHtml is not meant to be built directly");
|
|
3221
3132
|
this.g = a;
|
|
3222
3133
|
}
|
|
3223
3134
|
toString() {
|
|
@@ -3285,8 +3196,10 @@ var intl_tel_input_default = intlTelInput;
|
|
|
3285
3196
|
var g = 11 == e.h || 10 == e.h;
|
|
3286
3197
|
if (e.l) {
|
|
3287
3198
|
e = u(b, f);
|
|
3288
|
-
for (var h = 0; h < e.length; h++)
|
|
3289
|
-
|
|
3199
|
+
for (var h = 0; h < e.length; h++)
|
|
3200
|
+
va(a, f, g ? e[h].clone() : e[h]);
|
|
3201
|
+
} else
|
|
3202
|
+
e = v(b, f), g ? (g = v(a, f)) ? wa(g, e) : t(a, f, e.clone()) : t(a, f, e);
|
|
3290
3203
|
}
|
|
3291
3204
|
}
|
|
3292
3205
|
}
|
|
@@ -3300,14 +3213,18 @@ var intl_tel_input_default = intlTelInput;
|
|
|
3300
3213
|
}
|
|
3301
3214
|
function v(a, b) {
|
|
3302
3215
|
var c = a.h[b];
|
|
3303
|
-
if (null == c)
|
|
3216
|
+
if (null == c)
|
|
3217
|
+
return null;
|
|
3304
3218
|
if (a.l) {
|
|
3305
3219
|
if (!(b in a.g)) {
|
|
3306
3220
|
var d = a.l, e = a.j[b];
|
|
3307
|
-
if (null != c)
|
|
3308
|
-
|
|
3309
|
-
|
|
3310
|
-
|
|
3221
|
+
if (null != c)
|
|
3222
|
+
if (e.l) {
|
|
3223
|
+
for (var f = [], g = 0; g < c.length; g++)
|
|
3224
|
+
f[g] = d.h(e, c[g]);
|
|
3225
|
+
c = f;
|
|
3226
|
+
} else
|
|
3227
|
+
c = d.h(e, c);
|
|
3311
3228
|
return a.g[b] = c;
|
|
3312
3229
|
}
|
|
3313
3230
|
return a.g[b];
|
|
@@ -3319,18 +3236,24 @@ var intl_tel_input_default = intlTelInput;
|
|
|
3319
3236
|
return a.j[b].l ? d[c || 0] : d;
|
|
3320
3237
|
}
|
|
3321
3238
|
function w(a, b) {
|
|
3322
|
-
if (q(a, b))
|
|
3323
|
-
|
|
3324
|
-
|
|
3325
|
-
|
|
3326
|
-
|
|
3327
|
-
|
|
3328
|
-
|
|
3329
|
-
|
|
3330
|
-
|
|
3239
|
+
if (q(a, b))
|
|
3240
|
+
a = r(a, b);
|
|
3241
|
+
else
|
|
3242
|
+
a: {
|
|
3243
|
+
a = a.j[b];
|
|
3244
|
+
if (void 0 === a.j)
|
|
3245
|
+
if (b = a.s, b === Boolean)
|
|
3246
|
+
a.j = false;
|
|
3247
|
+
else if (b === Number)
|
|
3248
|
+
a.j = 0;
|
|
3249
|
+
else if (b === String)
|
|
3250
|
+
a.j = a.o ? "0" : "";
|
|
3251
|
+
else {
|
|
3252
|
+
a = new b();
|
|
3253
|
+
break a;
|
|
3254
|
+
}
|
|
3255
|
+
a = a.j;
|
|
3331
3256
|
}
|
|
3332
|
-
a = a.j;
|
|
3333
|
-
}
|
|
3334
3257
|
return a;
|
|
3335
3258
|
}
|
|
3336
3259
|
function u(a, b) {
|
|
@@ -3350,7 +3273,8 @@ var intl_tel_input_default = intlTelInput;
|
|
|
3350
3273
|
}
|
|
3351
3274
|
function y(a, b) {
|
|
3352
3275
|
var c = [], d;
|
|
3353
|
-
for (d in b)
|
|
3276
|
+
for (d in b)
|
|
3277
|
+
0 != d && c.push(new la(d, b[d]));
|
|
3354
3278
|
return new ta(a, c);
|
|
3355
3279
|
}
|
|
3356
3280
|
;
|
|
@@ -3361,13 +3285,18 @@ var intl_tel_input_default = intlTelInput;
|
|
|
3361
3285
|
throw Error("Unimplemented");
|
|
3362
3286
|
};
|
|
3363
3287
|
z.prototype.h = function(a, b) {
|
|
3364
|
-
if (11 == a.h || 10 == a.h)
|
|
3365
|
-
|
|
3366
|
-
if (
|
|
3288
|
+
if (11 == a.h || 10 == a.h)
|
|
3289
|
+
return b instanceof p ? b : this.g(a.s.prototype.m(), b);
|
|
3290
|
+
if (14 == a.h)
|
|
3291
|
+
return "string" === typeof b && xa.test(b) && (a = Number(b), 0 < a) ? a : b;
|
|
3292
|
+
if (!a.o)
|
|
3293
|
+
return b;
|
|
3367
3294
|
a = a.s;
|
|
3368
3295
|
if (a === String) {
|
|
3369
|
-
if ("number" === typeof b)
|
|
3370
|
-
|
|
3296
|
+
if ("number" === typeof b)
|
|
3297
|
+
return String(b);
|
|
3298
|
+
} else if (a === Number && "string" === typeof b && ("Infinity" === b || "-Infinity" === b || "NaN" === b || xa.test(b)))
|
|
3299
|
+
return Number(b);
|
|
3371
3300
|
return b;
|
|
3372
3301
|
};
|
|
3373
3302
|
var xa = /^-?[0-9]+$/;
|
|
@@ -3399,7 +3328,9 @@ var intl_tel_input_default = intlTelInput;
|
|
|
3399
3328
|
};
|
|
3400
3329
|
D.prototype.g = function(a, b, c) {
|
|
3401
3330
|
this.h += String(a);
|
|
3402
|
-
if (null != b)
|
|
3331
|
+
if (null != b)
|
|
3332
|
+
for (let d = 1; d < arguments.length; d++)
|
|
3333
|
+
this.h += arguments[d];
|
|
3403
3334
|
return this;
|
|
3404
3335
|
};
|
|
3405
3336
|
function E(a) {
|
|
@@ -8947,7 +8878,8 @@ var intl_tel_input_default = intlTelInput;
|
|
|
8947
8878
|
return null != a && (1 != x(a, 9) || -1 != u(a, 9)[0]);
|
|
8948
8879
|
}
|
|
8949
8880
|
function O(a, b) {
|
|
8950
|
-
for (var c = new D(), d, e = a.length, f = 0; f < e; ++f)
|
|
8881
|
+
for (var c = new D(), d, e = a.length, f = 0; f < e; ++f)
|
|
8882
|
+
d = a.charAt(f), d = b[d.toUpperCase()], null != d && c.g(d);
|
|
8951
8883
|
return c.toString();
|
|
8952
8884
|
}
|
|
8953
8885
|
function Ya(a) {
|
|
@@ -8959,12 +8891,15 @@ var intl_tel_input_default = intlTelInput;
|
|
|
8959
8891
|
K.prototype.format = function(a, b) {
|
|
8960
8892
|
if (0 == r(a, 2) && q(a, 5)) {
|
|
8961
8893
|
var c = w(a, 5);
|
|
8962
|
-
if (0 < c.length)
|
|
8894
|
+
if (0 < c.length)
|
|
8895
|
+
return c;
|
|
8963
8896
|
}
|
|
8964
8897
|
c = w(a, 1);
|
|
8965
8898
|
var d = Q(a);
|
|
8966
|
-
if (0 == b)
|
|
8967
|
-
|
|
8899
|
+
if (0 == b)
|
|
8900
|
+
return Za(c, 0, d, "");
|
|
8901
|
+
if (!(c in J))
|
|
8902
|
+
return d;
|
|
8968
8903
|
var e = R(this, c, S(c));
|
|
8969
8904
|
a = q(a, 3) && 0 != r(a, 3).length ? 3 == b ? ";ext=" + r(a, 3) : q(e, 13) ? r(e, 13) + w(a, 3) : " ext. " + w(a, 3) : "";
|
|
8970
8905
|
a: {
|
|
@@ -8981,17 +8916,15 @@ var intl_tel_input_default = intlTelInput;
|
|
|
8981
8916
|
}
|
|
8982
8917
|
e = null;
|
|
8983
8918
|
}
|
|
8984
|
-
null != e && (g = e, e = w(g, 2), f = new RegExp(r(g, 1)), w(
|
|
8985
|
-
g,
|
|
8986
|
-
5
|
|
8987
|
-
), g = w(g, 4), d = 2 == b && null != g && 0 < g.length ? d.replace(f, e.replace(Sa, g)) : d.replace(f, e), 3 == b && (d = d.replace(RegExp("^[-x\u2010-\u2015\u2212\u30FC\uFF0D-\uFF0F \xA0\xAD\u200B\u2060\u3000()\uFF08\uFF09\uFF3B\uFF3D.\\[\\]/~\u2053\u223C\uFF5E]+"), ""), d = d.replace(RegExp("[-x\u2010-\u2015\u2212\u30FC\uFF0D-\uFF0F \xA0\xAD\u200B\u2060\u3000()\uFF08\uFF09\uFF3B\uFF3D.\\[\\]/~\u2053\u223C\uFF5E]+", "g"), "-")));
|
|
8919
|
+
null != e && (g = e, e = w(g, 2), f = new RegExp(r(g, 1)), w(g, 5), g = w(g, 4), d = 2 == b && null != g && 0 < g.length ? d.replace(f, e.replace(Sa, g)) : d.replace(f, e), 3 == b && (d = d.replace(RegExp("^[-x\u2010-\u2015\u2212\u30FC\uFF0D-\uFF0F \xA0\xAD\u200B\u2060\u3000()\uFF08\uFF09\uFF3B\uFF3D.\\[\\]/~\u2053\u223C\uFF5E]+"), ""), d = d.replace(RegExp("[-x\u2010-\u2015\u2212\u30FC\uFF0D-\uFF0F \xA0\xAD\u200B\u2060\u3000()\uFF08\uFF09\uFF3B\uFF3D.\\[\\]/~\u2053\u223C\uFF5E]+", "g"), "-")));
|
|
8988
8920
|
return Za(c, b, d, a);
|
|
8989
8921
|
};
|
|
8990
8922
|
function R(a, b, c) {
|
|
8991
8923
|
return "001" == c ? T(a, "" + b) : T(a, c);
|
|
8992
8924
|
}
|
|
8993
8925
|
function Q(a) {
|
|
8994
|
-
if (!q(a, 2))
|
|
8926
|
+
if (!q(a, 2))
|
|
8927
|
+
return "";
|
|
8995
8928
|
var b = "" + r(a, 2);
|
|
8996
8929
|
return q(a, 4) && r(a, 4) && 0 < w(a, 8) ? Array(w(a, 8) + 1).join("0") + b : b;
|
|
8997
8930
|
}
|
|
@@ -9037,7 +8970,8 @@ var intl_tel_input_default = intlTelInput;
|
|
|
9037
8970
|
function $a(a, b) {
|
|
9038
8971
|
var c = ab(a, b);
|
|
9039
8972
|
a = R(a, w(b, 1), c);
|
|
9040
|
-
if (null == a)
|
|
8973
|
+
if (null == a)
|
|
8974
|
+
return -1;
|
|
9041
8975
|
b = Q(b);
|
|
9042
8976
|
return bb(b, a);
|
|
9043
8977
|
}
|
|
@@ -9045,12 +8979,14 @@ var intl_tel_input_default = intlTelInput;
|
|
|
9045
8979
|
return V(a, r(b, 1)) ? V(a, r(b, 5)) ? 4 : V(a, r(b, 4)) ? 3 : V(a, r(b, 6)) ? 5 : V(a, r(b, 8)) ? 6 : V(a, r(b, 7)) ? 7 : V(a, r(b, 21)) ? 8 : V(a, r(b, 25)) ? 9 : V(a, r(b, 28)) ? 10 : V(a, r(b, 2)) ? r(b, 18) || V(a, r(b, 3)) ? 2 : 0 : !r(b, 18) && V(a, r(b, 3)) ? 1 : -1 : -1;
|
|
9046
8980
|
}
|
|
9047
8981
|
function T(a, b) {
|
|
9048
|
-
if (null == b)
|
|
8982
|
+
if (null == b)
|
|
8983
|
+
return null;
|
|
9049
8984
|
b = b.toUpperCase();
|
|
9050
8985
|
var c = a.g[b];
|
|
9051
8986
|
if (null == c) {
|
|
9052
8987
|
c = Da[b];
|
|
9053
|
-
if (null == c)
|
|
8988
|
+
if (null == c)
|
|
8989
|
+
return null;
|
|
9054
8990
|
c = new C().g(H.m(), c);
|
|
9055
8991
|
a.g[b] = c;
|
|
9056
8992
|
}
|
|
@@ -9068,28 +9004,32 @@ var intl_tel_input_default = intlTelInput;
|
|
|
9068
9004
|
return e;
|
|
9069
9005
|
}
|
|
9070
9006
|
function ab(a, b) {
|
|
9071
|
-
if (null == b)
|
|
9007
|
+
if (null == b)
|
|
9008
|
+
return null;
|
|
9072
9009
|
var c = w(b, 1);
|
|
9073
9010
|
c = J[c];
|
|
9074
|
-
if (null == c)
|
|
9075
|
-
|
|
9076
|
-
else
|
|
9077
|
-
|
|
9078
|
-
|
|
9079
|
-
|
|
9080
|
-
|
|
9081
|
-
|
|
9082
|
-
|
|
9011
|
+
if (null == c)
|
|
9012
|
+
a = null;
|
|
9013
|
+
else if (1 == c.length)
|
|
9014
|
+
a = c[0];
|
|
9015
|
+
else
|
|
9016
|
+
a: {
|
|
9017
|
+
b = Q(b);
|
|
9018
|
+
for (var d, e = c.length, f = 0; f < e; f++) {
|
|
9019
|
+
d = c[f];
|
|
9020
|
+
var g = T(a, d);
|
|
9021
|
+
if (q(g, 23)) {
|
|
9022
|
+
if (0 == b.search(r(g, 23))) {
|
|
9023
|
+
a = d;
|
|
9024
|
+
break a;
|
|
9025
|
+
}
|
|
9026
|
+
} else if (-1 != bb(b, g)) {
|
|
9083
9027
|
a = d;
|
|
9084
9028
|
break a;
|
|
9085
9029
|
}
|
|
9086
|
-
} else if (-1 != bb(b, g)) {
|
|
9087
|
-
a = d;
|
|
9088
|
-
break a;
|
|
9089
9030
|
}
|
|
9031
|
+
a = null;
|
|
9090
9032
|
}
|
|
9091
|
-
a = null;
|
|
9092
|
-
}
|
|
9093
9033
|
return a;
|
|
9094
9034
|
}
|
|
9095
9035
|
function S(a) {
|
|
@@ -9098,42 +9038,55 @@ var intl_tel_input_default = intlTelInput;
|
|
|
9098
9038
|
}
|
|
9099
9039
|
function db(a, b) {
|
|
9100
9040
|
a = T(a, b);
|
|
9101
|
-
if (null == a)
|
|
9041
|
+
if (null == a)
|
|
9042
|
+
throw Error("Invalid region code: " + b);
|
|
9102
9043
|
return w(a, 10);
|
|
9103
9044
|
}
|
|
9104
9045
|
function W(a, b, c, d) {
|
|
9105
9046
|
var e = U(c, d), f = 0 == x(e, 9) ? u(r(c, 1), 9) : u(e, 9);
|
|
9106
9047
|
e = u(e, 10);
|
|
9107
|
-
if (2 == d)
|
|
9108
|
-
|
|
9109
|
-
|
|
9048
|
+
if (2 == d)
|
|
9049
|
+
if (Xa(U(c, 0)))
|
|
9050
|
+
a = U(c, 1), Xa(a) && (f = f.concat(0 == x(a, 9) ? u(r(c, 1), 9) : u(a, 9)), f.sort(), 0 == e.length ? e = u(a, 10) : (e = e.concat(u(a, 10)), e.sort()));
|
|
9051
|
+
else
|
|
9052
|
+
return W(a, b, c, 1);
|
|
9053
|
+
if (-1 == f[0])
|
|
9054
|
+
return 5;
|
|
9110
9055
|
b = b.length;
|
|
9111
|
-
if (-1 < e.indexOf(b))
|
|
9056
|
+
if (-1 < e.indexOf(b))
|
|
9057
|
+
return 4;
|
|
9112
9058
|
c = f[0];
|
|
9113
9059
|
return c == b ? 0 : c > b ? 2 : f[f.length - 1] < b ? 3 : -1 < f.indexOf(b, 1) ? 0 : 5;
|
|
9114
9060
|
}
|
|
9115
9061
|
function X(a, b, c) {
|
|
9116
9062
|
var d = Q(b);
|
|
9117
9063
|
b = w(b, 1);
|
|
9118
|
-
if (!(b in J))
|
|
9064
|
+
if (!(b in J))
|
|
9065
|
+
return 1;
|
|
9119
9066
|
b = R(a, b, S(b));
|
|
9120
9067
|
return W(a, d, b, c);
|
|
9121
9068
|
}
|
|
9122
9069
|
function eb(a, b) {
|
|
9123
9070
|
a = a.toString();
|
|
9124
|
-
if (0 == a.length || "0" == a.charAt(0))
|
|
9125
|
-
|
|
9071
|
+
if (0 == a.length || "0" == a.charAt(0))
|
|
9072
|
+
return 0;
|
|
9073
|
+
for (var c, d = a.length, e = 1; 3 >= e && e <= d; ++e)
|
|
9074
|
+
if (c = parseInt(a.substring(0, e), 10), c in J)
|
|
9075
|
+
return b.g(a.substring(e)), c;
|
|
9126
9076
|
return 0;
|
|
9127
9077
|
}
|
|
9128
9078
|
function fb(a, b, c, d, e, f) {
|
|
9129
|
-
if (0 == b.length)
|
|
9079
|
+
if (0 == b.length)
|
|
9080
|
+
return 0;
|
|
9130
9081
|
b = new D(b);
|
|
9131
9082
|
var g;
|
|
9132
9083
|
null != c && (g = r(c, 11));
|
|
9133
9084
|
null == g && (g = "NonMatch");
|
|
9134
9085
|
var h = b.toString();
|
|
9135
|
-
if (0 == h.length)
|
|
9136
|
-
|
|
9086
|
+
if (0 == h.length)
|
|
9087
|
+
g = 20;
|
|
9088
|
+
else if (L.test(h))
|
|
9089
|
+
h = h.replace(L, ""), E(b), b.g(Va(h)), g = 1;
|
|
9137
9090
|
else {
|
|
9138
9091
|
h = new RegExp(g);
|
|
9139
9092
|
Wa(b);
|
|
@@ -9142,17 +9095,21 @@ var intl_tel_input_default = intlTelInput;
|
|
|
9142
9095
|
h = g.match(h)[0].length;
|
|
9143
9096
|
var l = g.substring(h).match(Ia);
|
|
9144
9097
|
l && null != l[1] && 0 < l[1].length && "0" == O(l[1], Ea) ? g = false : (E(b), b.g(g.substring(h)), g = true);
|
|
9145
|
-
} else
|
|
9098
|
+
} else
|
|
9099
|
+
g = false;
|
|
9146
9100
|
g = g ? 5 : 20;
|
|
9147
9101
|
}
|
|
9148
9102
|
e && t(f, 6, g);
|
|
9149
9103
|
if (20 != g) {
|
|
9150
|
-
if (2 >= b.h.length)
|
|
9104
|
+
if (2 >= b.h.length)
|
|
9105
|
+
throw Error("Phone number too short after IDD");
|
|
9151
9106
|
a = eb(b, d);
|
|
9152
|
-
if (0 != a)
|
|
9107
|
+
if (0 != a)
|
|
9108
|
+
return t(f, 1, a), a;
|
|
9153
9109
|
throw Error("Invalid country calling code");
|
|
9154
9110
|
}
|
|
9155
|
-
if (null != c && (g = w(c, 10), h = "" + g, l = b.toString(), 0 == l.lastIndexOf(h, 0) && (h = new D(l.substring(h.length)), l = r(c, 1), l = new RegExp(w(l, 2)), gb(h, c, null), h = h.toString(), !N(l, b.toString()) && N(l, h) || 3 == W(a, b.toString(), c, -1))))
|
|
9111
|
+
if (null != c && (g = w(c, 10), h = "" + g, l = b.toString(), 0 == l.lastIndexOf(h, 0) && (h = new D(l.substring(h.length)), l = r(c, 1), l = new RegExp(w(l, 2)), gb(h, c, null), h = h.toString(), !N(l, b.toString()) && N(l, h) || 3 == W(a, b.toString(), c, -1))))
|
|
9112
|
+
return d.g(h), e && t(f, 6, 10), t(f, 1, g), g;
|
|
9156
9113
|
t(f, 1, 0);
|
|
9157
9114
|
return 0;
|
|
9158
9115
|
}
|
|
@@ -9165,36 +9122,46 @@ var intl_tel_input_default = intlTelInput;
|
|
|
9165
9122
|
var h = N(f, d), l = e.length - 1;
|
|
9166
9123
|
b = r(b, 16);
|
|
9167
9124
|
if (null == b || 0 == b.length || null == e[l] || 0 == e[l].length) {
|
|
9168
|
-
if (!h || N(f, d.substring(e[0].length)))
|
|
9169
|
-
|
|
9125
|
+
if (!h || N(f, d.substring(e[0].length)))
|
|
9126
|
+
null != c && 0 < l && null != e[l] && c.g(e[1]), a.set(d.substring(e[0].length));
|
|
9127
|
+
} else if (d = d.replace(g, b), !h || N(f, d))
|
|
9128
|
+
null != c && 0 < l && c.g(e[1]), a.set(d);
|
|
9170
9129
|
}
|
|
9171
9130
|
}
|
|
9172
9131
|
}
|
|
9173
9132
|
function Y(a, b, c) {
|
|
9174
|
-
if (!P(c) && 0 < b.length && "+" != b.charAt(0))
|
|
9133
|
+
if (!P(c) && 0 < b.length && "+" != b.charAt(0))
|
|
9134
|
+
throw Error("Invalid country calling code");
|
|
9175
9135
|
return hb(a, b, c, true);
|
|
9176
9136
|
}
|
|
9177
9137
|
function hb(a, b, c, d) {
|
|
9178
|
-
if (null == b)
|
|
9179
|
-
|
|
9138
|
+
if (null == b)
|
|
9139
|
+
throw Error("The string supplied did not seem to be a phone number");
|
|
9140
|
+
if (250 < b.length)
|
|
9141
|
+
throw Error("The string supplied is too long to be a phone number");
|
|
9180
9142
|
var e = new D();
|
|
9181
9143
|
var f = b.indexOf(";phone-context=");
|
|
9182
|
-
if (-1 === f)
|
|
9183
|
-
|
|
9144
|
+
if (-1 === f)
|
|
9145
|
+
f = null;
|
|
9146
|
+
else if (f += 15, f >= b.length)
|
|
9147
|
+
f = "";
|
|
9184
9148
|
else {
|
|
9185
9149
|
var g = b.indexOf(";", f);
|
|
9186
9150
|
f = -1 !== g ? b.substring(f, g) : b.substring(f);
|
|
9187
9151
|
}
|
|
9188
9152
|
var h = f;
|
|
9189
9153
|
null == h ? g = true : 0 === h.length ? g = false : (g = Na.exec(h), h = Oa.exec(h), g = null !== g || null !== h);
|
|
9190
|
-
if (!g)
|
|
9191
|
-
|
|
9154
|
+
if (!g)
|
|
9155
|
+
throw Error("The string supplied did not seem to be a phone number");
|
|
9156
|
+
null != f ? ("+" === f.charAt(0) && e.g(f), f = b.indexOf("tel:"), e.g(b.substring(0 <= f ? f + 4 : 0, b.indexOf(";phone-context=")))) : (f = e.g, g = b !== null && b !== void 0 ? b : "", h = g.search(Ja), 0 <= h ? (g = g.substring(h), g = g.replace(La, ""), h = g.search(Ka), 0 <= h && (g = g.substring(0, h))) : g = "", f.call(e, g));
|
|
9192
9157
|
f = e.toString();
|
|
9193
9158
|
g = f.indexOf(";isub=");
|
|
9194
9159
|
0 < g && (E(e), e.g(f.substring(0, g)));
|
|
9195
|
-
if (!Ua(e.toString()))
|
|
9160
|
+
if (!Ua(e.toString()))
|
|
9161
|
+
throw Error("The string supplied did not seem to be a phone number");
|
|
9196
9162
|
f = e.toString();
|
|
9197
|
-
if (!(P(c) || null != f && 0 < f.length && L.test(f)))
|
|
9163
|
+
if (!(P(c) || null != f && 0 < f.length && L.test(f)))
|
|
9164
|
+
throw Error("Invalid country calling code");
|
|
9198
9165
|
f = new I();
|
|
9199
9166
|
d && t(f, 5, b);
|
|
9200
9167
|
a: {
|
|
@@ -9202,12 +9169,13 @@ var intl_tel_input_default = intlTelInput;
|
|
|
9202
9169
|
g = b.search(Qa);
|
|
9203
9170
|
if (0 <= g && Ua(b.substring(0, g))) {
|
|
9204
9171
|
h = b.match(Qa);
|
|
9205
|
-
for (var l = h.length, A = 1; A < l; ++A)
|
|
9206
|
-
|
|
9207
|
-
|
|
9208
|
-
|
|
9209
|
-
|
|
9210
|
-
|
|
9172
|
+
for (var l = h.length, A = 1; A < l; ++A)
|
|
9173
|
+
if (null != h[A] && 0 < h[A].length) {
|
|
9174
|
+
E(e);
|
|
9175
|
+
e.g(b.substring(0, g));
|
|
9176
|
+
b = h[A];
|
|
9177
|
+
break a;
|
|
9178
|
+
}
|
|
9211
9179
|
}
|
|
9212
9180
|
b = "";
|
|
9213
9181
|
}
|
|
@@ -9220,23 +9188,25 @@ var intl_tel_input_default = intlTelInput;
|
|
|
9220
9188
|
h = fb(a, l, g, b, d, f);
|
|
9221
9189
|
} catch (ca) {
|
|
9222
9190
|
if ("Invalid country calling code" == ca.message && L.test(l)) {
|
|
9223
|
-
if (l = l.replace(L, ""), h = fb(a, l, g, b, d, f), 0 == h)
|
|
9224
|
-
|
|
9225
|
-
|
|
9226
|
-
|
|
9227
|
-
|
|
9228
|
-
|
|
9229
|
-
|
|
9230
|
-
|
|
9231
|
-
if (2 > b.h.length) throw Error("The string supplied is too short to be a phone number");
|
|
9191
|
+
if (l = l.replace(L, ""), h = fb(a, l, g, b, d, f), 0 == h)
|
|
9192
|
+
throw ca;
|
|
9193
|
+
} else
|
|
9194
|
+
throw ca;
|
|
9195
|
+
}
|
|
9196
|
+
0 != h ? (e = S(h), e != c && (g = R(a, h, e))) : (Wa(e), b.g(e.toString()), null != c ? (h = w(g, 10), t(f, 1, h)) : d && (delete f.h[6], f.g && delete f.g[6]));
|
|
9197
|
+
if (2 > b.h.length)
|
|
9198
|
+
throw Error("The string supplied is too short to be a phone number");
|
|
9232
9199
|
null != g && (c = new D(), e = new D(b.toString()), gb(e, g, c), a = W(a, e.toString(), g, -1), 2 != a && 4 != a && 5 != a && (b = e, d && 0 < c.toString().length && t(f, 7, c.toString())));
|
|
9233
9200
|
d = b.toString();
|
|
9234
9201
|
a = d.length;
|
|
9235
|
-
if (2 > a)
|
|
9236
|
-
|
|
9202
|
+
if (2 > a)
|
|
9203
|
+
throw Error("The string supplied is too short to be a phone number");
|
|
9204
|
+
if (17 < a)
|
|
9205
|
+
throw Error("The string supplied is too long to be a phone number");
|
|
9237
9206
|
if (1 < d.length && "0" == d.charAt(0)) {
|
|
9238
9207
|
t(f, 4, true);
|
|
9239
|
-
for (a = 1; a < d.length - 1 && "0" == d.charAt(a); )
|
|
9208
|
+
for (a = 1; a < d.length - 1 && "0" == d.charAt(a); )
|
|
9209
|
+
a++;
|
|
9240
9210
|
1 != a && t(f, 8, a);
|
|
9241
9211
|
}
|
|
9242
9212
|
t(f, 2, parseInt(d, 10));
|
|
@@ -9277,7 +9247,8 @@ var intl_tel_input_default = intlTelInput;
|
|
|
9277
9247
|
function nb(a) {
|
|
9278
9248
|
for (var b = a.j.length, c = 0; c < b; ++c) {
|
|
9279
9249
|
var d = a.j[c], e = w(d, 1);
|
|
9280
|
-
if (a.da == e)
|
|
9250
|
+
if (a.da == e)
|
|
9251
|
+
return false;
|
|
9281
9252
|
var f = a;
|
|
9282
9253
|
var g = d, h = w(g, 1);
|
|
9283
9254
|
E(f.v);
|
|
@@ -9286,7 +9257,8 @@ var intl_tel_input_default = intlTelInput;
|
|
|
9286
9257
|
var A = "999999999999999".match(h)[0];
|
|
9287
9258
|
A.length < l.g.h.length ? l = "" : (l = A.replace(new RegExp(h, "g"), g), l = l.replace(RegExp("9", "g"), "\u2008"));
|
|
9288
9259
|
0 < l.length ? (f.v.g(l), f = true) : f = false;
|
|
9289
|
-
if (f)
|
|
9260
|
+
if (f)
|
|
9261
|
+
return a.da = e, a.ha = mb.test(r(d, 4)), a.$ = 0, true;
|
|
9290
9262
|
}
|
|
9291
9263
|
return a.u = false;
|
|
9292
9264
|
}
|
|
@@ -9304,8 +9276,10 @@ var intl_tel_input_default = intlTelInput;
|
|
|
9304
9276
|
if (!a.u) {
|
|
9305
9277
|
if (!a.la) {
|
|
9306
9278
|
if (qb(a)) {
|
|
9307
|
-
if (rb(a))
|
|
9308
|
-
|
|
9279
|
+
if (rb(a))
|
|
9280
|
+
return sb(a);
|
|
9281
|
+
} else if (0 < a.o.length && (b = a.g.toString(), E(a.g), a.g.g(a.o), a.g.g(b), b = a.h.toString(), c = b.lastIndexOf(a.o), E(a.h), a.h.g(b.substring(0, c))), a.o != tb(a))
|
|
9282
|
+
return a.h.g(" "), sb(a);
|
|
9309
9283
|
}
|
|
9310
9284
|
return a.s.toString();
|
|
9311
9285
|
}
|
|
@@ -9315,14 +9289,18 @@ var intl_tel_input_default = intlTelInput;
|
|
|
9315
9289
|
case 2:
|
|
9316
9290
|
return a.s.toString();
|
|
9317
9291
|
case 3:
|
|
9318
|
-
if (qb(a))
|
|
9319
|
-
|
|
9292
|
+
if (qb(a))
|
|
9293
|
+
a.ea = true;
|
|
9294
|
+
else
|
|
9295
|
+
return a.o = tb(a), ub(a);
|
|
9320
9296
|
default:
|
|
9321
|
-
if (a.ea)
|
|
9297
|
+
if (a.ea)
|
|
9298
|
+
return rb(a) && (a.ea = false), a.h.toString() + a.g.toString();
|
|
9322
9299
|
if (0 < a.j.length) {
|
|
9323
9300
|
b = vb(a, b);
|
|
9324
9301
|
c = wb(a);
|
|
9325
|
-
if (0 < c.length)
|
|
9302
|
+
if (0 < c.length)
|
|
9303
|
+
return c;
|
|
9326
9304
|
ob(a, a.g.toString());
|
|
9327
9305
|
return nb(a) ? xb(a) : a.u ? Z(a, b) : a.s.toString();
|
|
9328
9306
|
}
|
|
@@ -9341,7 +9319,8 @@ var intl_tel_input_default = intlTelInput;
|
|
|
9341
9319
|
function wb(a) {
|
|
9342
9320
|
for (var b = a.g.toString(), c = a.j.length, d = 0; d < c; ++d) {
|
|
9343
9321
|
var e = a.j[d], f = w(e, 1);
|
|
9344
|
-
if (new RegExp("^(?:" + f + ")$").test(b) && (a.ha = mb.test(r(e, 4)), e = b.replace(new RegExp(f, "g"), r(e, 2)), e = Z(a, e), O(e, Fa) == a.ba))
|
|
9322
|
+
if (new RegExp("^(?:" + f + ")$").test(b) && (a.ha = mb.test(r(e, 4)), e = b.replace(new RegExp(f, "g"), r(e, 2)), e = Z(a, e), O(e, Fa) == a.ba))
|
|
9323
|
+
return e;
|
|
9345
9324
|
}
|
|
9346
9325
|
return "";
|
|
9347
9326
|
}
|
|
@@ -9365,15 +9344,18 @@ var intl_tel_input_default = intlTelInput;
|
|
|
9365
9344
|
function xb(a) {
|
|
9366
9345
|
var b = a.g.toString(), c = b.length;
|
|
9367
9346
|
if (0 < c) {
|
|
9368
|
-
for (var d = "", e = 0; e < c; e++)
|
|
9347
|
+
for (var d = "", e = 0; e < c; e++)
|
|
9348
|
+
d = vb(a, b.charAt(e));
|
|
9369
9349
|
return a.u ? Z(a, d) : a.s.toString();
|
|
9370
9350
|
}
|
|
9371
9351
|
return a.h.toString();
|
|
9372
9352
|
}
|
|
9373
9353
|
function tb(a) {
|
|
9374
9354
|
var b = a.g.toString(), c = 0;
|
|
9375
|
-
if (1 != r(a.l, 10))
|
|
9376
|
-
|
|
9355
|
+
if (1 != r(a.l, 10))
|
|
9356
|
+
var d = false;
|
|
9357
|
+
else
|
|
9358
|
+
d = a.g.toString(), d = "1" == d.charAt(0) && "0" != d.charAt(1) && "1" != d.charAt(1);
|
|
9377
9359
|
d ? (c = 1, a.h.g("1").g(" "), a.ca = true) : q(a.l, 15) && (d = new RegExp("^(?:" + r(a.l, 15) + ")"), d = b.match(d), null != d && null != d[0] && 0 < d[0].length && (a.ca = true, c = d[0].length, a.h.g(b.substring(0, c))));
|
|
9378
9360
|
E(a.g);
|
|
9379
9361
|
a.g.g(b.substring(c));
|
|
@@ -9385,9 +9367,11 @@ var intl_tel_input_default = intlTelInput;
|
|
|
9385
9367
|
return null != c && null != c[0] && 0 < c[0].length ? (a.ca = true, c = c[0].length, E(a.g), a.g.g(b.substring(c)), E(a.h), a.h.g(b.substring(0, c)), "+" != b.charAt(0) && a.h.g(" "), true) : false;
|
|
9386
9368
|
}
|
|
9387
9369
|
function rb(a) {
|
|
9388
|
-
if (0 == a.g.h.length)
|
|
9370
|
+
if (0 == a.g.h.length)
|
|
9371
|
+
return false;
|
|
9389
9372
|
var b = new D(), c = eb(a.g, b);
|
|
9390
|
-
if (0 == c)
|
|
9373
|
+
if (0 == c)
|
|
9374
|
+
return false;
|
|
9391
9375
|
E(a.g);
|
|
9392
9376
|
a.g.g(b.toString());
|
|
9393
9377
|
b = S(c);
|
|
@@ -9419,9 +9403,10 @@ var intl_tel_input_default = intlTelInput;
|
|
|
9419
9403
|
try {
|
|
9420
9404
|
const c = a.replace(/[^+0-9]/g, ""), d = new ib(b);
|
|
9421
9405
|
b = "";
|
|
9422
|
-
for (let e = 0; e < c.length; e++)
|
|
9406
|
+
for (let e = 0; e < c.length; e++)
|
|
9407
|
+
d.ja = pb(d, c.charAt(e)), b = d.ja;
|
|
9423
9408
|
return b;
|
|
9424
|
-
} catch {
|
|
9409
|
+
} catch (_a) {
|
|
9425
9410
|
return a;
|
|
9426
9411
|
}
|
|
9427
9412
|
});
|
|
@@ -9430,7 +9415,7 @@ var intl_tel_input_default = intlTelInput;
|
|
|
9430
9415
|
const e = K.g(), f = Y(e, a, b);
|
|
9431
9416
|
var d = X(e, f, -1);
|
|
9432
9417
|
return 0 == d || 4 == d ? e.format(f, "undefined" === typeof c ? 0 : c) : a;
|
|
9433
|
-
} catch {
|
|
9418
|
+
} catch (_a) {
|
|
9434
9419
|
return a;
|
|
9435
9420
|
}
|
|
9436
9421
|
});
|
|
@@ -9453,14 +9438,14 @@ var intl_tel_input_default = intlTelInput;
|
|
|
9453
9438
|
h = null;
|
|
9454
9439
|
}
|
|
9455
9440
|
return l.format(h, d ? 0 : b ? 2 : 1);
|
|
9456
|
-
} catch {
|
|
9441
|
+
} catch (_a) {
|
|
9457
9442
|
return "";
|
|
9458
9443
|
}
|
|
9459
9444
|
});
|
|
9460
9445
|
m("intlTelInputUtilsTemp.getExtension", (a, b) => {
|
|
9461
9446
|
try {
|
|
9462
9447
|
return r(Y(K.g(), a, b), 3);
|
|
9463
|
-
} catch {
|
|
9448
|
+
} catch (_a) {
|
|
9464
9449
|
return "";
|
|
9465
9450
|
}
|
|
9466
9451
|
});
|
|
@@ -9468,12 +9453,13 @@ var intl_tel_input_default = intlTelInput;
|
|
|
9468
9453
|
try {
|
|
9469
9454
|
const c = K.g(), d = Y(c, a, b);
|
|
9470
9455
|
return $a(c, d);
|
|
9471
|
-
} catch {
|
|
9456
|
+
} catch (_a) {
|
|
9472
9457
|
return -99;
|
|
9473
9458
|
}
|
|
9474
9459
|
});
|
|
9475
9460
|
m("intlTelInputUtilsTemp.getValidationError", (a, b) => {
|
|
9476
|
-
if (!b)
|
|
9461
|
+
if (!b)
|
|
9462
|
+
return 1;
|
|
9477
9463
|
try {
|
|
9478
9464
|
const c = K.g(), d = Y(c, a, b);
|
|
9479
9465
|
return X(c, d, -1);
|
|
@@ -9490,7 +9476,7 @@ var intl_tel_input_default = intlTelInput;
|
|
|
9490
9476
|
return f && g.includes($a(d, e));
|
|
9491
9477
|
}
|
|
9492
9478
|
return f;
|
|
9493
|
-
} catch {
|
|
9479
|
+
} catch (_a) {
|
|
9494
9480
|
return false;
|
|
9495
9481
|
}
|
|
9496
9482
|
});
|
|
@@ -9499,18 +9485,20 @@ var intl_tel_input_default = intlTelInput;
|
|
|
9499
9485
|
const d = K.g(), e = Y(d, a, b);
|
|
9500
9486
|
if (c) {
|
|
9501
9487
|
yb(c);
|
|
9502
|
-
for (let f of c)
|
|
9488
|
+
for (let f of c)
|
|
9489
|
+
if (0 === X(d, e, zb[f]))
|
|
9490
|
+
return true;
|
|
9503
9491
|
return false;
|
|
9504
9492
|
}
|
|
9505
9493
|
return 0 === X(d, e, -1);
|
|
9506
|
-
} catch {
|
|
9494
|
+
} catch (_a) {
|
|
9507
9495
|
return false;
|
|
9508
9496
|
}
|
|
9509
9497
|
});
|
|
9510
9498
|
m("intlTelInputUtilsTemp.getCoreNumber", (a, b) => {
|
|
9511
9499
|
try {
|
|
9512
9500
|
return r(Y(K.g(), a, b), 2).toString();
|
|
9513
|
-
} catch {
|
|
9501
|
+
} catch (_a) {
|
|
9514
9502
|
return "";
|
|
9515
9503
|
}
|
|
9516
9504
|
});
|
|
@@ -9523,13 +9511,15 @@ var utils = globalContext.intlTelInputUtilsTemp;
|
|
|
9523
9511
|
delete globalContext.intlTelInputUtilsTemp;
|
|
9524
9512
|
var utils_default = utils;
|
|
9525
9513
|
|
|
9526
|
-
//
|
|
9514
|
+
// angular/build/temp/intl-tel-input/intlTelInputWithUtils.js
|
|
9527
9515
|
intl_tel_input_default.utils = utils_default;
|
|
9528
9516
|
var intlTelInputWithUtils_default = intl_tel_input_default;
|
|
9529
9517
|
|
|
9530
|
-
// angular/
|
|
9531
|
-
import { Component, Input, ViewChild, Output, EventEmitter, forwardRef } from "@angular/core";
|
|
9518
|
+
// angular/build/temp/intl-tel-input/angularWithUtils.js
|
|
9519
|
+
import { Component, Input, ViewChild, ElementRef, Output, EventEmitter, forwardRef } from "@angular/core";
|
|
9532
9520
|
import { NG_VALUE_ACCESSOR, NG_VALIDATORS } from "@angular/forms";
|
|
9521
|
+
import * as i0 from "@angular/core";
|
|
9522
|
+
var _c0 = ["inputRef"];
|
|
9533
9523
|
var PHONE_ERROR_MESSAGES = [
|
|
9534
9524
|
"invalid",
|
|
9535
9525
|
"invalid-country-code",
|
|
@@ -9550,13 +9540,10 @@ var IntlTelInputComponent = class {
|
|
|
9550
9540
|
this.errorCodeChange = new EventEmitter();
|
|
9551
9541
|
this.iti = null;
|
|
9552
9542
|
this.countryChangeHandler = () => this.handleInput();
|
|
9553
|
-
// eslint-disable-next-line class-methods-use-this
|
|
9554
9543
|
this.onChange = () => {
|
|
9555
9544
|
};
|
|
9556
|
-
// eslint-disable-next-line class-methods-use-this
|
|
9557
9545
|
this.onTouched = () => {
|
|
9558
9546
|
};
|
|
9559
|
-
// eslint-disable-next-line class-methods-use-this
|
|
9560
9547
|
this.onValidatorChange = () => {
|
|
9561
9548
|
};
|
|
9562
9549
|
}
|
|
@@ -9573,12 +9560,14 @@ var IntlTelInputComponent = class {
|
|
|
9573
9560
|
}
|
|
9574
9561
|
}
|
|
9575
9562
|
ngAfterViewInit() {
|
|
9563
|
+
var _a;
|
|
9576
9564
|
if (this.initialValue) {
|
|
9577
|
-
this.iti
|
|
9565
|
+
(_a = this.iti) === null || _a === void 0 ? void 0 : _a.setNumber(this.initialValue);
|
|
9578
9566
|
}
|
|
9579
9567
|
}
|
|
9580
9568
|
handleInput() {
|
|
9581
|
-
if (!this.iti)
|
|
9569
|
+
if (!this.iti)
|
|
9570
|
+
return;
|
|
9582
9571
|
const num = this.iti.getNumber() || "";
|
|
9583
9572
|
const countryIso = this.iti.getSelectedCountryData().iso2 || "";
|
|
9584
9573
|
this.numberChange.emit(num);
|
|
@@ -9604,7 +9593,8 @@ var IntlTelInputComponent = class {
|
|
|
9604
9593
|
return this.inputRef.nativeElement;
|
|
9605
9594
|
}
|
|
9606
9595
|
ngOnDestroy() {
|
|
9607
|
-
|
|
9596
|
+
var _a;
|
|
9597
|
+
(_a = this.iti) === null || _a === void 0 ? void 0 : _a.destroy();
|
|
9608
9598
|
this.inputRef.nativeElement.removeEventListener("countrychange", this.countryChangeHandler);
|
|
9609
9599
|
}
|
|
9610
9600
|
applyInputProps() {
|
|
@@ -9649,41 +9639,52 @@ var IntlTelInputComponent = class {
|
|
|
9649
9639
|
this.onValidatorChange = fn;
|
|
9650
9640
|
}
|
|
9651
9641
|
};
|
|
9652
|
-
|
|
9653
|
-
|
|
9654
|
-
|
|
9655
|
-
|
|
9656
|
-
|
|
9657
|
-
|
|
9658
|
-
|
|
9659
|
-
|
|
9660
|
-
|
|
9661
|
-
|
|
9662
|
-
|
|
9663
|
-
|
|
9664
|
-
|
|
9665
|
-
|
|
9666
|
-
|
|
9667
|
-
|
|
9668
|
-
|
|
9669
|
-
|
|
9670
|
-
|
|
9671
|
-
|
|
9672
|
-
|
|
9673
|
-
|
|
9674
|
-
|
|
9675
|
-
|
|
9676
|
-
|
|
9677
|
-
|
|
9678
|
-
|
|
9679
|
-
|
|
9680
|
-
|
|
9681
|
-
|
|
9682
|
-
|
|
9683
|
-
|
|
9684
|
-
|
|
9685
|
-
|
|
9686
|
-
|
|
9642
|
+
IntlTelInputComponent.\u0275fac = function IntlTelInputComponent_Factory(__ngFactoryType__) {
|
|
9643
|
+
return new (__ngFactoryType__ || IntlTelInputComponent)();
|
|
9644
|
+
};
|
|
9645
|
+
IntlTelInputComponent.\u0275cmp = /* @__PURE__ */ i0.\u0275\u0275defineComponent({ type: IntlTelInputComponent, selectors: [["intl-tel-input"]], viewQuery: function IntlTelInputComponent_Query(rf, ctx) {
|
|
9646
|
+
if (rf & 1) {
|
|
9647
|
+
i0.\u0275\u0275viewQuery(_c0, 7);
|
|
9648
|
+
}
|
|
9649
|
+
if (rf & 2) {
|
|
9650
|
+
let _t;
|
|
9651
|
+
i0.\u0275\u0275queryRefresh(_t = i0.\u0275\u0275loadQuery()) && (ctx.inputRef = _t.first);
|
|
9652
|
+
}
|
|
9653
|
+
}, inputs: { initialValue: "initialValue", usePreciseValidation: "usePreciseValidation", inputProps: "inputProps", disabled: "disabled", initOptions: "initOptions" }, outputs: { numberChange: "numberChange", countryChange: "countryChange", validityChange: "validityChange", errorCodeChange: "errorCodeChange" }, features: [i0.\u0275\u0275ProvidersFeature([
|
|
9654
|
+
{
|
|
9655
|
+
provide: NG_VALUE_ACCESSOR,
|
|
9656
|
+
useExisting: forwardRef(() => IntlTelInputComponent),
|
|
9657
|
+
multi: true
|
|
9658
|
+
},
|
|
9659
|
+
{
|
|
9660
|
+
provide: NG_VALIDATORS,
|
|
9661
|
+
useExisting: forwardRef(() => IntlTelInputComponent),
|
|
9662
|
+
multi: true
|
|
9663
|
+
}
|
|
9664
|
+
])], decls: 2, vars: 1, consts: [["inputRef", ""], ["type", "tel", 3, "input", "blur", "disabled"]], template: function IntlTelInputComponent_Template(rf, ctx) {
|
|
9665
|
+
if (rf & 1) {
|
|
9666
|
+
const _r1 = i0.\u0275\u0275getCurrentView();
|
|
9667
|
+
i0.\u0275\u0275elementStart(0, "input", 1, 0);
|
|
9668
|
+
i0.\u0275\u0275listener("input", function IntlTelInputComponent_Template_input_input_0_listener() {
|
|
9669
|
+
i0.\u0275\u0275restoreView(_r1);
|
|
9670
|
+
return i0.\u0275\u0275resetView(ctx.handleInput());
|
|
9671
|
+
})("blur", function IntlTelInputComponent_Template_input_blur_0_listener() {
|
|
9672
|
+
i0.\u0275\u0275restoreView(_r1);
|
|
9673
|
+
return i0.\u0275\u0275resetView(ctx.handleBlur());
|
|
9674
|
+
});
|
|
9675
|
+
i0.\u0275\u0275elementEnd();
|
|
9676
|
+
}
|
|
9677
|
+
if (rf & 2) {
|
|
9678
|
+
i0.\u0275\u0275property("disabled", ctx.disabled);
|
|
9679
|
+
}
|
|
9680
|
+
}, encapsulation: 2 });
|
|
9681
|
+
(() => {
|
|
9682
|
+
(typeof ngDevMode === "undefined" || ngDevMode) && i0.\u0275setClassMetadata(IntlTelInputComponent, [{
|
|
9683
|
+
type: Component,
|
|
9684
|
+
args: [{
|
|
9685
|
+
selector: "intl-tel-input",
|
|
9686
|
+
standalone: true,
|
|
9687
|
+
template: `
|
|
9687
9688
|
<input
|
|
9688
9689
|
type="tel"
|
|
9689
9690
|
#inputRef
|
|
@@ -9692,20 +9693,45 @@ IntlTelInputComponent = __decorateClass([
|
|
|
9692
9693
|
[disabled]="disabled"
|
|
9693
9694
|
/>
|
|
9694
9695
|
`,
|
|
9695
|
-
|
|
9696
|
-
|
|
9697
|
-
|
|
9698
|
-
|
|
9699
|
-
|
|
9700
|
-
|
|
9701
|
-
|
|
9702
|
-
|
|
9703
|
-
|
|
9704
|
-
|
|
9705
|
-
|
|
9706
|
-
|
|
9707
|
-
|
|
9708
|
-
],
|
|
9696
|
+
providers: [
|
|
9697
|
+
{
|
|
9698
|
+
provide: NG_VALUE_ACCESSOR,
|
|
9699
|
+
useExisting: forwardRef(() => IntlTelInputComponent),
|
|
9700
|
+
multi: true
|
|
9701
|
+
},
|
|
9702
|
+
{
|
|
9703
|
+
provide: NG_VALIDATORS,
|
|
9704
|
+
useExisting: forwardRef(() => IntlTelInputComponent),
|
|
9705
|
+
multi: true
|
|
9706
|
+
}
|
|
9707
|
+
]
|
|
9708
|
+
}]
|
|
9709
|
+
}], null, { inputRef: [{
|
|
9710
|
+
type: ViewChild,
|
|
9711
|
+
args: ["inputRef", { static: true }]
|
|
9712
|
+
}], initialValue: [{
|
|
9713
|
+
type: Input
|
|
9714
|
+
}], usePreciseValidation: [{
|
|
9715
|
+
type: Input
|
|
9716
|
+
}], inputProps: [{
|
|
9717
|
+
type: Input
|
|
9718
|
+
}], disabled: [{
|
|
9719
|
+
type: Input
|
|
9720
|
+
}], initOptions: [{
|
|
9721
|
+
type: Input
|
|
9722
|
+
}], numberChange: [{
|
|
9723
|
+
type: Output
|
|
9724
|
+
}], countryChange: [{
|
|
9725
|
+
type: Output
|
|
9726
|
+
}], validityChange: [{
|
|
9727
|
+
type: Output
|
|
9728
|
+
}], errorCodeChange: [{
|
|
9729
|
+
type: Output
|
|
9730
|
+
}] });
|
|
9731
|
+
})();
|
|
9732
|
+
(() => {
|
|
9733
|
+
(typeof ngDevMode === "undefined" || ngDevMode) && i0.\u0275setClassDebugInfo(IntlTelInputComponent, { className: "IntlTelInputComponent", filePath: "intl-tel-input/angularwithutils.ts", lineNumber: 43 });
|
|
9734
|
+
})();
|
|
9709
9735
|
export {
|
|
9710
9736
|
IntlTelInputComponent,
|
|
9711
9737
|
PHONE_ERROR_MESSAGES,
|