intl-tel-input 19.2.19 → 19.2.20

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.
@@ -24508,23 +24508,23 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
24508
24508
  }), i && i.appendChild(o), o;
24509
24509
  } }, { key: "_generateMarkup", value: function() {
24510
24510
  this.telInput.classList.add("iti__tel-input"), !this.telInput.hasAttribute("autocomplete") && !(this.telInput.form && this.telInput.form.hasAttribute("autocomplete")) && this.telInput.setAttribute("autocomplete", "off");
24511
- var t = this.options, e = t.allowDropdown, i = t.showSelectedDialCode, o = t.showFlags, r = t.containerClass, a = t.hiddenInput, l = t.dropdownContainer, u = t.fixDropdownWidth, h = t.useFullscreenPopup, v = t.countrySearch, f = "iti";
24511
+ var t = this.options, e = t.allowDropdown, i = t.showSelectedDialCode, o = t.showFlags, r = t.containerClass, a = t.hiddenInput, l = t.dropdownContainer, u = t.fixDropdownWidth, h = t.useFullscreenPopup, g = t.countrySearch, f = "iti";
24512
24512
  e && (f += " iti--allow-dropdown"), i && (f += " iti--show-selected-dial-code"), o && (f += " iti--show-flags"), r && (f += " ".concat(r)), h || (f += " iti--inline-dropdown");
24513
- var g = this._createEl("div", { class: f });
24514
- this.telInput.parentNode.insertBefore(g, this.telInput);
24513
+ var v = this._createEl("div", { class: f });
24514
+ this.telInput.parentNode.insertBefore(v, this.telInput);
24515
24515
  var A = e || o || i;
24516
- if (A && (this.flagsContainer = this._createEl("div", { class: "iti__flag-container" }, g)), g.appendChild(this.telInput), A && (this.selectedFlag = this._createEl("div", C({ class: "iti__selected-flag" }, e && { role: "combobox", "aria-haspopup": "listbox", "aria-controls": "iti-".concat(this.id, "__country-listbox"), "aria-expanded": "false", "aria-label": this.options.i18n.selectedCountryAriaLabel || "Selected country" }), this.flagsContainer)), o && (this.selectedFlagInner = this._createEl("div", { class: "iti__flag" }, this.selectedFlag)), this.selectedFlag && this.telInput.disabled && this.selectedFlag.setAttribute("aria-disabled", "true"), i && (this.selectedDialCode = this._createEl("div", { class: "iti__selected-dial-code" }, this.selectedFlag)), e) {
24516
+ if (A && (this.flagsContainer = this._createEl("div", { class: "iti__flag-container" }, v)), v.appendChild(this.telInput), A && (this.selectedFlag = this._createEl("div", C({ class: "iti__selected-flag" }, e && { role: "combobox", "aria-haspopup": "listbox", "aria-controls": "iti-".concat(this.id, "__country-listbox"), "aria-expanded": "false", "aria-label": this.options.i18n.selectedCountryAriaLabel || "Selected country" }), this.flagsContainer)), o && (this.selectedFlagInner = this._createEl("div", { class: "iti__flag" }, this.selectedFlag)), this.selectedFlag && this.telInput.disabled && this.selectedFlag.setAttribute("aria-disabled", "true"), i && (this.selectedDialCode = this._createEl("div", { class: "iti__selected-dial-code" }, this.selectedFlag)), e) {
24517
24517
  this.telInput.disabled || this.selectedFlag.setAttribute("tabindex", "0"), this.dropdownArrow = this._createEl("div", { class: "iti__arrow" }, this.selectedFlag);
24518
24518
  var Y = u ? "" : "iti--flexible-dropdown-width";
24519
- if (this.dropdownContent = this._createEl("div", { class: "iti__dropdown-content iti__hide ".concat(Y) }), v && (this.searchInput = this._createEl("input", { type: "text", class: "iti__search-input", placeholder: this.options.i18n.searchPlaceholder || "Search" }, this.dropdownContent)), this.countryList = this._createEl("ul", { class: "iti__country-list", id: "iti-".concat(this.id, "__country-listbox"), role: "listbox", "aria-label": this.options.i18n.countryListAriaLabel || "List of countries" }, this.dropdownContent), this.preferredCountries.length && !v && (this._appendListItems(this.preferredCountries, "iti__preferred", true), this._createEl("li", { class: "iti__divider", "aria-hidden": "true" }, this.countryList)), this._appendListItems(this.countries, "iti__standard"), l) {
24519
+ if (this.dropdownContent = this._createEl("div", { class: "iti__dropdown-content iti__hide ".concat(Y) }), g && (this.searchInput = this._createEl("input", { type: "text", class: "iti__search-input", placeholder: this.options.i18n.searchPlaceholder || "Search" }, this.dropdownContent)), this.countryList = this._createEl("ul", { class: "iti__country-list", id: "iti-".concat(this.id, "__country-listbox"), role: "listbox", "aria-label": this.options.i18n.countryListAriaLabel || "List of countries" }, this.dropdownContent), this.preferredCountries.length && !g && (this._appendListItems(this.preferredCountries, "iti__preferred", true), this._createEl("li", { class: "iti__divider", "aria-hidden": "true" }, this.countryList)), this._appendListItems(this.countries, "iti__standard"), l) {
24520
24520
  var E = "iti iti--container";
24521
- h ? E += " iti--fullscreen-popup" : E += " iti--inline-dropdown", v && (E += " iti--country-search"), this.dropdown = this._createEl("div", { class: E }), this.dropdown.appendChild(this.dropdownContent);
24521
+ h ? E += " iti--fullscreen-popup" : E += " iti--inline-dropdown", g && (E += " iti--country-search"), this.dropdown = this._createEl("div", { class: E }), this.dropdown.appendChild(this.dropdownContent);
24522
24522
  } else
24523
24523
  this.flagsContainer.appendChild(this.dropdownContent);
24524
24524
  }
24525
24525
  if (a) {
24526
24526
  var J = this.telInput.getAttribute("name"), j = a(J);
24527
- this.hiddenInput = this._createEl("input", { type: "hidden", name: j }), g.appendChild(this.hiddenInput), this.hiddenInputCountry = this._createEl("input", { type: "hidden", name: "".concat(j, "_country") }), g.appendChild(this.hiddenInputCountry);
24527
+ this.hiddenInput = this._createEl("input", { type: "hidden", name: j }), v.appendChild(this.hiddenInput), this.hiddenInputCountry = this._createEl("input", { type: "hidden", name: "".concat(j, "_country") }), v.appendChild(this.hiddenInputCountry);
24528
24528
  }
24529
24529
  } }, { key: "_appendListItems", value: function(t, e, i) {
24530
24530
  for (var o = 0; o < t.length; o++) {
@@ -24534,12 +24534,12 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
24534
24534
  this.options.showFlags && (u += "<div class='iti__flag-box'><div class='iti__flag iti__".concat(r.iso2, "'></div></div>")), u += "<span class='iti__country-name'>".concat(r.name, "</span>"), u += "<span class='iti__dial-code'>+".concat(r.dialCode, "</span>"), l.insertAdjacentHTML("beforeend", u);
24535
24535
  }
24536
24536
  } }, { key: "_setInitialState", value: function() {
24537
- var t = arguments.length > 0 && arguments[0] !== c ? arguments[0] : false, e = this.telInput.getAttribute("value"), i = this.telInput.value, o = e && e.charAt(0) === "+" && (!i || i.charAt(0) !== "+"), r = o ? e : i, a = this._getDialCode(r), l = this._isRegionlessNanp(r), u = this.options, h = u.initialCountry, v = u.autoInsertDialCode;
24537
+ var t = arguments.length > 0 && arguments[0] !== c ? arguments[0] : false, e = this.telInput.getAttribute("value"), i = this.telInput.value, o = e && e.charAt(0) === "+" && (!i || i.charAt(0) !== "+"), r = o ? e : i, a = this._getDialCode(r), l = this._isRegionlessNanp(r), u = this.options, h = u.initialCountry, g = u.autoInsertDialCode;
24538
24538
  if (a && !l)
24539
24539
  this._updateFlagFromNumber(r);
24540
24540
  else if (h !== "auto" || t) {
24541
- var f = h && !!this._getCountryData(h, true);
24542
- f ? this._setFlag(h.toLowerCase()) : a && l ? this._setFlag("us") : (this.defaultCountry = this.preferredCountries.length ? this.preferredCountries[0].iso2 : this.countries[0].iso2, r || this._setFlag(this.defaultCountry)), !r && v && (this.telInput.value = "+".concat(this.selectedCountryData.dialCode));
24541
+ var f = h ? h.toLowerCase() : "", v = f && this._getCountryData(f, true);
24542
+ v ? this._setFlag(f) : a && l ? this._setFlag("us") : (this.defaultCountry = this.preferredCountries.length ? this.preferredCountries[0].iso2 : this.countries[0].iso2, r || this._setFlag(this.defaultCountry)), !r && g && (this.telInput.value = "+".concat(this.selectedCountryData.dialCode));
24543
24543
  }
24544
24544
  r && this._updateValFromNumber(r);
24545
24545
  } }, { key: "_initListeners", value: function() {
@@ -24569,7 +24569,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
24569
24569
  } }, { key: "_loadAutoCountry", value: function() {
24570
24570
  var t = this;
24571
24571
  window.intlTelInputGlobals.autoCountry ? this.handleAutoCountry() : window.intlTelInputGlobals.startedLoadingAutoCountry || (window.intlTelInputGlobals.startedLoadingAutoCountry = true, typeof this.options.geoIpLookup == "function" && this.options.geoIpLookup(function() {
24572
- var e = arguments.length > 0 && arguments[0] !== c ? arguments[0] : "", i = e.toLowerCase(), o = !!t._getCountryData(i, true);
24572
+ var e = arguments.length > 0 && arguments[0] !== c ? arguments[0] : "", i = e.toLowerCase(), o = i && t._getCountryData(i, true);
24573
24573
  o ? (window.intlTelInputGlobals.autoCountry = i, setTimeout(function() {
24574
24574
  return S("handleAutoCountry");
24575
24575
  })) : (t._setInitialState(true), S("rejectAutoCountryPromise"));
@@ -24704,11 +24704,11 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
24704
24704
  i && r && i.charAt(0) !== "+" && (i.charAt(0) !== "1" && (i = "1".concat(i)), i = "+".concat(i)), this.options.showSelectedDialCode && o && i.charAt(0) !== "+" && (i = "+".concat(o).concat(i));
24705
24705
  var a = this._getDialCode(i, true), l = this._getNumeric(i), u = null;
24706
24706
  if (a) {
24707
- var h = this.countryCodes[this._getNumeric(a)], v = h.indexOf(this.selectedCountryData.iso2) !== -1 && l.length <= a.length - 1, f = o === "1" && this._isRegionlessNanp(l);
24708
- if (!f && !v) {
24709
- for (var g = 0; g < h.length; g++)
24710
- if (h[g]) {
24711
- u = h[g];
24707
+ var h = this.countryCodes[this._getNumeric(a)], g = h.indexOf(this.selectedCountryData.iso2) !== -1 && l.length <= a.length - 1, f = o === "1" && this._isRegionlessNanp(l);
24708
+ if (!f && !g) {
24709
+ for (var v = 0; v < h.length; v++)
24710
+ if (h[v]) {
24711
+ u = h[v];
24712
24712
  break;
24713
24713
  }
24714
24714
  }
@@ -24741,8 +24741,8 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
24741
24741
  this.isRTL ? this.telInput.style.paddingRight = "".concat(h + 6, "px") : this.telInput.style.paddingLeft = "".concat(h + 6, "px");
24742
24742
  }
24743
24743
  if (this._updatePlaceholder(), i && !a) {
24744
- var v = this.activeItem;
24745
- if (v && (v.classList.remove("iti__active"), v.setAttribute("aria-selected", "false")), t) {
24744
+ var g = this.activeItem;
24745
+ if (g && (g.classList.remove("iti__active"), g.setAttribute("aria-selected", "false")), t) {
24746
24746
  var f = this.countryList.querySelector("#iti-".concat(this.id, "__item-").concat(t, "-preferred")) || this.countryList.querySelector("#iti-".concat(this.id, "__item-").concat(t));
24747
24747
  f.setAttribute("aria-selected", "true"), f.classList.add("iti__active"), this.activeItem = f;
24748
24748
  }
@@ -24774,11 +24774,11 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
24774
24774
  } }, { key: "_closeDropdown", value: function() {
24775
24775
  this.dropdownContent.classList.add("iti__hide"), this.selectedFlag.setAttribute("aria-expanded", "false"), this.selectedFlag.removeAttribute("aria-activedescendant"), this.dropdownArrow.classList.remove("iti__arrow--up"), document.removeEventListener("keydown", this._handleKeydownOnDropdown), this.options.countrySearch && this.searchInput.removeEventListener("input", this._handleSearchChange), document.documentElement.removeEventListener("click", this._handleClickOffToClose), this.countryList.removeEventListener("mouseover", this._handleMouseoverCountryList), this.countryList.removeEventListener("click", this._handleClickCountryList), this.options.dropdownContainer && (this.options.useFullscreenPopup || window.removeEventListener("scroll", this._handleWindowScroll), this.dropdown.parentNode && this.dropdown.parentNode.removeChild(this.dropdown)), this._trigger("close:countrydropdown");
24776
24776
  } }, { key: "_scrollTo", value: function(t, e) {
24777
- var i = this.countryList, o = document.documentElement.scrollTop, r = i.offsetHeight, a = i.getBoundingClientRect().top + o, l = a + r, u = t.offsetHeight, h = t.getBoundingClientRect().top + o, v = h + u, f = h - a + i.scrollTop, g = r / 2 - u / 2;
24777
+ var i = this.countryList, o = document.documentElement.scrollTop, r = i.offsetHeight, a = i.getBoundingClientRect().top + o, l = a + r, u = t.offsetHeight, h = t.getBoundingClientRect().top + o, g = h + u, f = h - a + i.scrollTop, v = r / 2 - u / 2;
24778
24778
  if (h < a)
24779
- e && (f -= g), i.scrollTop = f;
24780
- else if (v > l) {
24781
- e && (f += g);
24779
+ e && (f -= v), i.scrollTop = f;
24780
+ else if (g > l) {
24781
+ e && (f += v);
24782
24782
  var A = r - u;
24783
24783
  i.scrollTop = f - A;
24784
24784
  }
@@ -24897,7 +24897,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
24897
24897
  B(s);
24898
24898
  }
24899
24899
  return null;
24900
- }, L.defaults = M, L.version = "19.2.19", function(s, n) {
24900
+ }, L.defaults = M, L.version = "19.2.20", function(s, n) {
24901
24901
  var t = new q(s, n);
24902
24902
  return t._init(), s.setAttribute("data-intl-tel-input-id", t.id), window.intlTelInputGlobals.instances[t.id] = t, t;
24903
24903
  };
@@ -24508,23 +24508,23 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
24508
24508
  }), i && i.appendChild(o), o;
24509
24509
  } }, { key: "_generateMarkup", value: function() {
24510
24510
  this.telInput.classList.add("iti__tel-input"), !this.telInput.hasAttribute("autocomplete") && !(this.telInput.form && this.telInput.form.hasAttribute("autocomplete")) && this.telInput.setAttribute("autocomplete", "off");
24511
- var t = this.options, e = t.allowDropdown, i = t.showSelectedDialCode, o = t.showFlags, r = t.containerClass, a = t.hiddenInput, l = t.dropdownContainer, u = t.fixDropdownWidth, h = t.useFullscreenPopup, v = t.countrySearch, f = "iti";
24511
+ var t = this.options, e = t.allowDropdown, i = t.showSelectedDialCode, o = t.showFlags, r = t.containerClass, a = t.hiddenInput, l = t.dropdownContainer, u = t.fixDropdownWidth, h = t.useFullscreenPopup, g = t.countrySearch, f = "iti";
24512
24512
  e && (f += " iti--allow-dropdown"), i && (f += " iti--show-selected-dial-code"), o && (f += " iti--show-flags"), r && (f += " ".concat(r)), h || (f += " iti--inline-dropdown");
24513
- var g = this._createEl("div", { class: f });
24514
- this.telInput.parentNode.insertBefore(g, this.telInput);
24513
+ var v = this._createEl("div", { class: f });
24514
+ this.telInput.parentNode.insertBefore(v, this.telInput);
24515
24515
  var A = e || o || i;
24516
- if (A && (this.flagsContainer = this._createEl("div", { class: "iti__flag-container" }, g)), g.appendChild(this.telInput), A && (this.selectedFlag = this._createEl("div", C({ class: "iti__selected-flag" }, e && { role: "combobox", "aria-haspopup": "listbox", "aria-controls": "iti-".concat(this.id, "__country-listbox"), "aria-expanded": "false", "aria-label": this.options.i18n.selectedCountryAriaLabel || "Selected country" }), this.flagsContainer)), o && (this.selectedFlagInner = this._createEl("div", { class: "iti__flag" }, this.selectedFlag)), this.selectedFlag && this.telInput.disabled && this.selectedFlag.setAttribute("aria-disabled", "true"), i && (this.selectedDialCode = this._createEl("div", { class: "iti__selected-dial-code" }, this.selectedFlag)), e) {
24516
+ if (A && (this.flagsContainer = this._createEl("div", { class: "iti__flag-container" }, v)), v.appendChild(this.telInput), A && (this.selectedFlag = this._createEl("div", C({ class: "iti__selected-flag" }, e && { role: "combobox", "aria-haspopup": "listbox", "aria-controls": "iti-".concat(this.id, "__country-listbox"), "aria-expanded": "false", "aria-label": this.options.i18n.selectedCountryAriaLabel || "Selected country" }), this.flagsContainer)), o && (this.selectedFlagInner = this._createEl("div", { class: "iti__flag" }, this.selectedFlag)), this.selectedFlag && this.telInput.disabled && this.selectedFlag.setAttribute("aria-disabled", "true"), i && (this.selectedDialCode = this._createEl("div", { class: "iti__selected-dial-code" }, this.selectedFlag)), e) {
24517
24517
  this.telInput.disabled || this.selectedFlag.setAttribute("tabindex", "0"), this.dropdownArrow = this._createEl("div", { class: "iti__arrow" }, this.selectedFlag);
24518
24518
  var Y = u ? "" : "iti--flexible-dropdown-width";
24519
- if (this.dropdownContent = this._createEl("div", { class: "iti__dropdown-content iti__hide ".concat(Y) }), v && (this.searchInput = this._createEl("input", { type: "text", class: "iti__search-input", placeholder: this.options.i18n.searchPlaceholder || "Search" }, this.dropdownContent)), this.countryList = this._createEl("ul", { class: "iti__country-list", id: "iti-".concat(this.id, "__country-listbox"), role: "listbox", "aria-label": this.options.i18n.countryListAriaLabel || "List of countries" }, this.dropdownContent), this.preferredCountries.length && !v && (this._appendListItems(this.preferredCountries, "iti__preferred", true), this._createEl("li", { class: "iti__divider", "aria-hidden": "true" }, this.countryList)), this._appendListItems(this.countries, "iti__standard"), l) {
24519
+ if (this.dropdownContent = this._createEl("div", { class: "iti__dropdown-content iti__hide ".concat(Y) }), g && (this.searchInput = this._createEl("input", { type: "text", class: "iti__search-input", placeholder: this.options.i18n.searchPlaceholder || "Search" }, this.dropdownContent)), this.countryList = this._createEl("ul", { class: "iti__country-list", id: "iti-".concat(this.id, "__country-listbox"), role: "listbox", "aria-label": this.options.i18n.countryListAriaLabel || "List of countries" }, this.dropdownContent), this.preferredCountries.length && !g && (this._appendListItems(this.preferredCountries, "iti__preferred", true), this._createEl("li", { class: "iti__divider", "aria-hidden": "true" }, this.countryList)), this._appendListItems(this.countries, "iti__standard"), l) {
24520
24520
  var E = "iti iti--container";
24521
- h ? E += " iti--fullscreen-popup" : E += " iti--inline-dropdown", v && (E += " iti--country-search"), this.dropdown = this._createEl("div", { class: E }), this.dropdown.appendChild(this.dropdownContent);
24521
+ h ? E += " iti--fullscreen-popup" : E += " iti--inline-dropdown", g && (E += " iti--country-search"), this.dropdown = this._createEl("div", { class: E }), this.dropdown.appendChild(this.dropdownContent);
24522
24522
  } else
24523
24523
  this.flagsContainer.appendChild(this.dropdownContent);
24524
24524
  }
24525
24525
  if (a) {
24526
24526
  var J = this.telInput.getAttribute("name"), j = a(J);
24527
- this.hiddenInput = this._createEl("input", { type: "hidden", name: j }), g.appendChild(this.hiddenInput), this.hiddenInputCountry = this._createEl("input", { type: "hidden", name: "".concat(j, "_country") }), g.appendChild(this.hiddenInputCountry);
24527
+ this.hiddenInput = this._createEl("input", { type: "hidden", name: j }), v.appendChild(this.hiddenInput), this.hiddenInputCountry = this._createEl("input", { type: "hidden", name: "".concat(j, "_country") }), v.appendChild(this.hiddenInputCountry);
24528
24528
  }
24529
24529
  } }, { key: "_appendListItems", value: function(t, e, i) {
24530
24530
  for (var o = 0; o < t.length; o++) {
@@ -24534,12 +24534,12 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
24534
24534
  this.options.showFlags && (u += "<div class='iti__flag-box'><div class='iti__flag iti__".concat(r.iso2, "'></div></div>")), u += "<span class='iti__country-name'>".concat(r.name, "</span>"), u += "<span class='iti__dial-code'>+".concat(r.dialCode, "</span>"), l.insertAdjacentHTML("beforeend", u);
24535
24535
  }
24536
24536
  } }, { key: "_setInitialState", value: function() {
24537
- var t = arguments.length > 0 && arguments[0] !== c ? arguments[0] : false, e = this.telInput.getAttribute("value"), i = this.telInput.value, o = e && e.charAt(0) === "+" && (!i || i.charAt(0) !== "+"), r = o ? e : i, a = this._getDialCode(r), l = this._isRegionlessNanp(r), u = this.options, h = u.initialCountry, v = u.autoInsertDialCode;
24537
+ var t = arguments.length > 0 && arguments[0] !== c ? arguments[0] : false, e = this.telInput.getAttribute("value"), i = this.telInput.value, o = e && e.charAt(0) === "+" && (!i || i.charAt(0) !== "+"), r = o ? e : i, a = this._getDialCode(r), l = this._isRegionlessNanp(r), u = this.options, h = u.initialCountry, g = u.autoInsertDialCode;
24538
24538
  if (a && !l)
24539
24539
  this._updateFlagFromNumber(r);
24540
24540
  else if (h !== "auto" || t) {
24541
- var f = h && !!this._getCountryData(h, true);
24542
- f ? this._setFlag(h.toLowerCase()) : a && l ? this._setFlag("us") : (this.defaultCountry = this.preferredCountries.length ? this.preferredCountries[0].iso2 : this.countries[0].iso2, r || this._setFlag(this.defaultCountry)), !r && v && (this.telInput.value = "+".concat(this.selectedCountryData.dialCode));
24541
+ var f = h ? h.toLowerCase() : "", v = f && this._getCountryData(f, true);
24542
+ v ? this._setFlag(f) : a && l ? this._setFlag("us") : (this.defaultCountry = this.preferredCountries.length ? this.preferredCountries[0].iso2 : this.countries[0].iso2, r || this._setFlag(this.defaultCountry)), !r && g && (this.telInput.value = "+".concat(this.selectedCountryData.dialCode));
24543
24543
  }
24544
24544
  r && this._updateValFromNumber(r);
24545
24545
  } }, { key: "_initListeners", value: function() {
@@ -24569,7 +24569,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
24569
24569
  } }, { key: "_loadAutoCountry", value: function() {
24570
24570
  var t = this;
24571
24571
  window.intlTelInputGlobals.autoCountry ? this.handleAutoCountry() : window.intlTelInputGlobals.startedLoadingAutoCountry || (window.intlTelInputGlobals.startedLoadingAutoCountry = true, typeof this.options.geoIpLookup == "function" && this.options.geoIpLookup(function() {
24572
- var e = arguments.length > 0 && arguments[0] !== c ? arguments[0] : "", i = e.toLowerCase(), o = !!t._getCountryData(i, true);
24572
+ var e = arguments.length > 0 && arguments[0] !== c ? arguments[0] : "", i = e.toLowerCase(), o = i && t._getCountryData(i, true);
24573
24573
  o ? (window.intlTelInputGlobals.autoCountry = i, setTimeout(function() {
24574
24574
  return S("handleAutoCountry");
24575
24575
  })) : (t._setInitialState(true), S("rejectAutoCountryPromise"));
@@ -24704,11 +24704,11 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
24704
24704
  i && r && i.charAt(0) !== "+" && (i.charAt(0) !== "1" && (i = "1".concat(i)), i = "+".concat(i)), this.options.showSelectedDialCode && o && i.charAt(0) !== "+" && (i = "+".concat(o).concat(i));
24705
24705
  var a = this._getDialCode(i, true), l = this._getNumeric(i), u = null;
24706
24706
  if (a) {
24707
- var h = this.countryCodes[this._getNumeric(a)], v = h.indexOf(this.selectedCountryData.iso2) !== -1 && l.length <= a.length - 1, f = o === "1" && this._isRegionlessNanp(l);
24708
- if (!f && !v) {
24709
- for (var g = 0; g < h.length; g++)
24710
- if (h[g]) {
24711
- u = h[g];
24707
+ var h = this.countryCodes[this._getNumeric(a)], g = h.indexOf(this.selectedCountryData.iso2) !== -1 && l.length <= a.length - 1, f = o === "1" && this._isRegionlessNanp(l);
24708
+ if (!f && !g) {
24709
+ for (var v = 0; v < h.length; v++)
24710
+ if (h[v]) {
24711
+ u = h[v];
24712
24712
  break;
24713
24713
  }
24714
24714
  }
@@ -24741,8 +24741,8 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
24741
24741
  this.isRTL ? this.telInput.style.paddingRight = "".concat(h + 6, "px") : this.telInput.style.paddingLeft = "".concat(h + 6, "px");
24742
24742
  }
24743
24743
  if (this._updatePlaceholder(), i && !a) {
24744
- var v = this.activeItem;
24745
- if (v && (v.classList.remove("iti__active"), v.setAttribute("aria-selected", "false")), t) {
24744
+ var g = this.activeItem;
24745
+ if (g && (g.classList.remove("iti__active"), g.setAttribute("aria-selected", "false")), t) {
24746
24746
  var f = this.countryList.querySelector("#iti-".concat(this.id, "__item-").concat(t, "-preferred")) || this.countryList.querySelector("#iti-".concat(this.id, "__item-").concat(t));
24747
24747
  f.setAttribute("aria-selected", "true"), f.classList.add("iti__active"), this.activeItem = f;
24748
24748
  }
@@ -24774,11 +24774,11 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
24774
24774
  } }, { key: "_closeDropdown", value: function() {
24775
24775
  this.dropdownContent.classList.add("iti__hide"), this.selectedFlag.setAttribute("aria-expanded", "false"), this.selectedFlag.removeAttribute("aria-activedescendant"), this.dropdownArrow.classList.remove("iti__arrow--up"), document.removeEventListener("keydown", this._handleKeydownOnDropdown), this.options.countrySearch && this.searchInput.removeEventListener("input", this._handleSearchChange), document.documentElement.removeEventListener("click", this._handleClickOffToClose), this.countryList.removeEventListener("mouseover", this._handleMouseoverCountryList), this.countryList.removeEventListener("click", this._handleClickCountryList), this.options.dropdownContainer && (this.options.useFullscreenPopup || window.removeEventListener("scroll", this._handleWindowScroll), this.dropdown.parentNode && this.dropdown.parentNode.removeChild(this.dropdown)), this._trigger("close:countrydropdown");
24776
24776
  } }, { key: "_scrollTo", value: function(t, e) {
24777
- var i = this.countryList, o = document.documentElement.scrollTop, r = i.offsetHeight, a = i.getBoundingClientRect().top + o, l = a + r, u = t.offsetHeight, h = t.getBoundingClientRect().top + o, v = h + u, f = h - a + i.scrollTop, g = r / 2 - u / 2;
24777
+ var i = this.countryList, o = document.documentElement.scrollTop, r = i.offsetHeight, a = i.getBoundingClientRect().top + o, l = a + r, u = t.offsetHeight, h = t.getBoundingClientRect().top + o, g = h + u, f = h - a + i.scrollTop, v = r / 2 - u / 2;
24778
24778
  if (h < a)
24779
- e && (f -= g), i.scrollTop = f;
24780
- else if (v > l) {
24781
- e && (f += g);
24779
+ e && (f -= v), i.scrollTop = f;
24780
+ else if (g > l) {
24781
+ e && (f += v);
24782
24782
  var A = r - u;
24783
24783
  i.scrollTop = f - A;
24784
24784
  }
@@ -24897,7 +24897,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
24897
24897
  B(s);
24898
24898
  }
24899
24899
  return null;
24900
- }, L.defaults = M, L.version = "19.2.19", function(s, n) {
24900
+ }, L.defaults = M, L.version = "19.2.20", function(s, n) {
24901
24901
  var t = new q(s, n);
24902
24902
  return t._init(), s.setAttribute("data-intl-tel-input-id", t.id), window.intlTelInputGlobals.instances[t.id] = t, t;
24903
24903
  };
@@ -589,10 +589,11 @@ class Iti {
589
589
  if (dialCode && !isRegionlessNanp) {
590
590
  this._updateFlagFromNumber(val);
591
591
  } else if (initialCountry !== "auto" || overrideAutoCountry) {
592
- const isValidInitialCountry = initialCountry && !!this._getCountryData(initialCountry, true);
592
+ const lowerInitialCountry = initialCountry ? initialCountry.toLowerCase() : "";
593
+ const isValidInitialCountry = lowerInitialCountry && this._getCountryData(lowerInitialCountry, true);
593
594
  // see if we should select a flag
594
595
  if (isValidInitialCountry) {
595
- this._setFlag(initialCountry.toLowerCase());
596
+ this._setFlag(lowerInitialCountry);
596
597
  } else {
597
598
  if (dialCode && isRegionlessNanp) {
598
599
  // has intl dial code, is regionless nanp, and no initialCountry, so default to US
@@ -750,8 +751,8 @@ class Iti {
750
751
  this.options.geoIpLookup(
751
752
  (countryCode = "") => {
752
753
  const lowerCountryCode = countryCode.toLowerCase();
753
- const isValid = !!this._getCountryData(lowerCountryCode, true);
754
- if (isValid) {
754
+ const isValidCountryCode = lowerCountryCode && this._getCountryData(lowerCountryCode, true);
755
+ if (isValidCountryCode) {
755
756
  window.intlTelInputGlobals.autoCountry = lowerCountryCode;
756
757
  // tell all instances the auto country is ready
757
758
  // TODO: this should just be the current instances