intl-tel-input 28.0.5 → 28.0.6

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.
@@ -3767,17 +3767,32 @@ var Iti = class _Iti {
3767
3767
  }
3768
3768
  intlTelInput.startedLoadingAutoCountry = true;
3769
3769
  if (typeof this.#options.geoIpLookup === "function") {
3770
+ let timeoutId;
3770
3771
  try {
3771
- const iso2 = await this.#options.geoIpLookup();
3772
+ const iso2 = await Promise.race([
3773
+ this.#options.geoIpLookup(),
3774
+ new Promise((_, reject) => {
3775
+ timeoutId = setTimeout(
3776
+ () => reject(new Error("intl-tel-input: geoIpLookup timed out after 10s")),
3777
+ 1e4
3778
+ );
3779
+ })
3780
+ ]);
3772
3781
  const iso2Lower = typeof iso2 === "string" ? iso2.toLowerCase() : "";
3773
3782
  if (!isIso2(iso2Lower)) {
3783
+ intlTelInput.startedLoadingAutoCountry = false;
3774
3784
  _Iti.forEachInstance("handleAutoCountryFailure");
3775
3785
  return;
3776
3786
  }
3777
3787
  intlTelInput.autoCountry = iso2Lower;
3778
3788
  setTimeout(() => _Iti.forEachInstance("handleAutoCountryLoaded"));
3779
3789
  } catch {
3790
+ intlTelInput.startedLoadingAutoCountry = false;
3780
3791
  _Iti.forEachInstance("handleAutoCountryFailure");
3792
+ } finally {
3793
+ if (timeoutId !== void 0) {
3794
+ clearTimeout(timeoutId);
3795
+ }
3781
3796
  }
3782
3797
  }
3783
3798
  }
@@ -4683,7 +4698,7 @@ var intlTelInput = Object.assign(
4683
4698
  attachUtils,
4684
4699
  startedLoadingUtils: false,
4685
4700
  startedLoadingAutoCountry: false,
4686
- version: "28.0.5",
4701
+ version: "28.0.6",
4687
4702
  NUMBER_FORMAT,
4688
4703
  NUMBER_TYPE,
4689
4704
  VALIDATION_ERROR
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "intl-tel-input",
3
- "version": "28.0.5",
3
+ "version": "28.0.6",
4
4
  "description": "A JavaScript library for entering, formatting, and validating international telephone numbers",
5
5
  "type": "module",
6
6
  "license": "MIT",