intl-tel-input 25.13.0 → 25.13.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -5
- package/angular/README.md +1 -1
- package/angular/build/IntlTelInput.js +34 -25
- package/angular/build/IntlTelInputWithUtils.js +34 -25
- package/angular/build/types/modules/core/ui.d.ts +3 -1
- package/angular/build/types/modules/data/country-data.d.ts +1 -1
- package/build/js/data.js +1 -1
- package/build/js/data.min.js +1 -1
- package/build/js/intlTelInput.d.ts +4 -2
- package/build/js/intlTelInput.js +37 -27
- package/build/js/intlTelInput.min.js +3 -3
- package/build/js/intlTelInputWithUtils.js +37 -27
- package/build/js/intlTelInputWithUtils.min.js +3 -3
- package/package.json +1 -1
- package/react/README.md +1 -1
- package/react/build/IntlTelInput.cjs +36 -26
- package/react/build/IntlTelInput.d.ts +4 -2
- package/react/build/IntlTelInput.js +36 -26
- package/react/build/IntlTelInputWithUtils.cjs +36 -26
- package/react/build/IntlTelInputWithUtils.js +36 -26
- package/vue/README.md +1 -1
- package/vue/build/IntlTelInput.mjs +223 -225
- package/vue/build/IntlTelInputWithUtils.mjs +147 -149
|
@@ -1950,7 +1950,7 @@ const $2 = {
|
|
|
1950
1950
|
// additional countries (not supported by country-list library)
|
|
1951
1951
|
ac: "Ascension Island",
|
|
1952
1952
|
xk: "Kosovo"
|
|
1953
|
-
},
|
|
1953
|
+
}, L0 = { ...$2, ...n2 }, _1 = {
|
|
1954
1954
|
OPEN_COUNTRY_DROPDOWN: "open:countrydropdown",
|
|
1955
1955
|
CLOSE_COUNTRY_DROPDOWN: "close:countrydropdown",
|
|
1956
1956
|
COUNTRY_CHANGE: "countrychange",
|
|
@@ -1995,7 +1995,7 @@ const $2 = {
|
|
|
1995
1995
|
// px width fallback when no separate dial code
|
|
1996
1996
|
INPUT_PADDING_EXTRA_LEFT: 6
|
|
1997
1997
|
// px gap between selected country container and input text
|
|
1998
|
-
},
|
|
1998
|
+
}, b0 = {
|
|
1999
1999
|
NANP: "1"
|
|
2000
2000
|
// North American Numbering Plan
|
|
2001
2001
|
}, v1 = {
|
|
@@ -2033,7 +2033,7 @@ const $2 = {
|
|
|
2033
2033
|
return h || e || i && $;
|
|
2034
2034
|
}
|
|
2035
2035
|
return !1;
|
|
2036
|
-
},
|
|
2036
|
+
}, T0 = {
|
|
2037
2037
|
// Allow alphanumeric "phonewords" (e.g. +1 800 FLOWERS) as valid numbers
|
|
2038
2038
|
allowPhonewords: !1,
|
|
2039
2039
|
//* Whether or not to allow the dropdown.
|
|
@@ -2090,7 +2090,7 @@ const $2 = {
|
|
|
2090
2090
|
const $ = A0(e), i = [], s = [], a = [], u = [], f = [], C = [];
|
|
2091
2091
|
for (const _ of h)
|
|
2092
2092
|
_.iso2 === $ ? i.push(_) : _.normalisedName.startsWith($) ? s.push(_) : _.normalisedName.includes($) ? a.push(_) : $ === _.dialCode || $ === _.dialCodePlus ? u.push(_) : _.dialCodePlus.includes($) ? f.push(_) : _.initials.includes($) && C.push(_);
|
|
2093
|
-
const y = (_,
|
|
2093
|
+
const y = (_, E) => _.priority - E.priority;
|
|
2094
2094
|
return [
|
|
2095
2095
|
...i.sort(y),
|
|
2096
2096
|
...s.sort(y),
|
|
@@ -2105,7 +2105,7 @@ const $2 = {
|
|
|
2105
2105
|
if (i.name.toLowerCase().startsWith($))
|
|
2106
2106
|
return i;
|
|
2107
2107
|
return null;
|
|
2108
|
-
}, R1 = (h) => Object.keys(h).filter((e) => !!h[e]).join(" "),
|
|
2108
|
+
}, R1 = (h) => Object.keys(h).filter((e) => !!h[e]).join(" "), T = (h, e, $) => {
|
|
2109
2109
|
const i = document.createElement(h);
|
|
2110
2110
|
return e && Object.entries(e).forEach(
|
|
2111
2111
|
([s, a]) => i.setAttribute(s, a)
|
|
@@ -2127,7 +2127,7 @@ const $2 = {
|
|
|
2127
2127
|
};
|
|
2128
2128
|
class h2 {
|
|
2129
2129
|
constructor(e, $, i) {
|
|
2130
|
-
this.highlightedItem = null, e.dataset.intlTelInputId = i.toString(), this.telInput = e, this.options = $, this.id = i, this.hadInitialPlaceholder = !!e.getAttribute("placeholder"), this.isRTL = !!this.telInput.closest("[dir=rtl]"), this.options.separateDialCode && (this.originalPaddingLeft = this.telInput.style.paddingLeft);
|
|
2130
|
+
this.highlightedItem = null, this.selectedItem = null, e.dataset.intlTelInputId = i.toString(), this.telInput = e, this.options = $, this.id = i, this.hadInitialPlaceholder = !!e.getAttribute("placeholder"), this.isRTL = !!this.telInput.closest("[dir=rtl]"), this.options.separateDialCode && (this.originalPaddingLeft = this.telInput.style.paddingLeft);
|
|
2131
2131
|
}
|
|
2132
2132
|
//* Generate all of the markup for the plugin: the selected country overlay, and the dropdown.
|
|
2133
2133
|
generateMarkup(e) {
|
|
@@ -2146,18 +2146,18 @@ class h2 {
|
|
|
2146
2146
|
"iti--show-flags": $,
|
|
2147
2147
|
"iti--inline-dropdown": !s,
|
|
2148
2148
|
[i]: !!i
|
|
2149
|
-
}), u =
|
|
2149
|
+
}), u = T("div", { class: a });
|
|
2150
2150
|
return this.isRTL && u.setAttribute("dir", "ltr"), this.telInput.before(u), u;
|
|
2151
2151
|
}
|
|
2152
2152
|
_maybeBuildCountryContainer(e) {
|
|
2153
2153
|
const { allowDropdown: $, separateDialCode: i, showFlags: s } = this.options;
|
|
2154
2154
|
if ($ || s || i) {
|
|
2155
|
-
this.countryContainer =
|
|
2155
|
+
this.countryContainer = T(
|
|
2156
2156
|
"div",
|
|
2157
2157
|
// visibly hidden until we measure it's width to set the input padding correctly
|
|
2158
2158
|
{ class: `iti__country-container ${N.V_HIDE}` },
|
|
2159
2159
|
e
|
|
2160
|
-
), $ ? (this.selectedCountry =
|
|
2160
|
+
), $ ? (this.selectedCountry = T(
|
|
2161
2161
|
"button",
|
|
2162
2162
|
{
|
|
2163
2163
|
type: "button",
|
|
@@ -2168,25 +2168,25 @@ class h2 {
|
|
|
2168
2168
|
[b.CONTROLS]: `iti-${this.id}__dropdown-content`
|
|
2169
2169
|
},
|
|
2170
2170
|
this.countryContainer
|
|
2171
|
-
), this.telInput.disabled && this.selectedCountry.setAttribute("disabled", "true")) : this.selectedCountry =
|
|
2171
|
+
), this.telInput.disabled && this.selectedCountry.setAttribute("disabled", "true")) : this.selectedCountry = T(
|
|
2172
2172
|
"div",
|
|
2173
2173
|
{ class: "iti__selected-country" },
|
|
2174
2174
|
this.countryContainer
|
|
2175
2175
|
);
|
|
2176
|
-
const a =
|
|
2176
|
+
const a = T(
|
|
2177
2177
|
"div",
|
|
2178
2178
|
{ class: "iti__selected-country-primary" },
|
|
2179
2179
|
this.selectedCountry
|
|
2180
2180
|
);
|
|
2181
|
-
this.selectedCountryInner =
|
|
2181
|
+
this.selectedCountryInner = T(
|
|
2182
2182
|
"div",
|
|
2183
2183
|
{ class: N.FLAG },
|
|
2184
2184
|
a
|
|
2185
|
-
), $ && (this.dropdownArrow =
|
|
2185
|
+
), $ && (this.dropdownArrow = T(
|
|
2186
2186
|
"div",
|
|
2187
2187
|
{ class: "iti__arrow", [b.HIDDEN]: "true" },
|
|
2188
2188
|
a
|
|
2189
|
-
)), i && (this.selectedDialCode =
|
|
2189
|
+
)), i && (this.selectedDialCode = T(
|
|
2190
2190
|
"div",
|
|
2191
2191
|
{ class: "iti__selected-dial-code" },
|
|
2192
2192
|
this.selectedCountry
|
|
@@ -2202,12 +2202,12 @@ class h2 {
|
|
|
2202
2202
|
dropdownContainer: a,
|
|
2203
2203
|
containerClass: u
|
|
2204
2204
|
} = this.options, f = e ? "" : "iti--flexible-dropdown-width";
|
|
2205
|
-
if (this.dropdownContent =
|
|
2205
|
+
if (this.dropdownContent = T("div", {
|
|
2206
2206
|
id: `iti-${this.id}__dropdown-content`,
|
|
2207
2207
|
class: `iti__dropdown-content ${N.HIDE} ${f}`,
|
|
2208
2208
|
role: "dialog",
|
|
2209
2209
|
[b.MODAL]: "true"
|
|
2210
|
-
}), this.isRTL && this.dropdownContent.setAttribute("dir", "rtl"), i && this._buildSearchUI(), this.countryList =
|
|
2210
|
+
}), this.isRTL && this.dropdownContent.setAttribute("dir", "rtl"), i && this._buildSearchUI(), this.countryList = T(
|
|
2211
2211
|
"ul",
|
|
2212
2212
|
{
|
|
2213
2213
|
class: "iti__country-list",
|
|
@@ -2224,24 +2224,24 @@ class h2 {
|
|
|
2224
2224
|
"iti--inline-dropdown": !$,
|
|
2225
2225
|
[u]: !!u
|
|
2226
2226
|
});
|
|
2227
|
-
this.dropdown =
|
|
2227
|
+
this.dropdown = T("div", { class: C }), this.dropdown.appendChild(this.dropdownContent);
|
|
2228
2228
|
} else
|
|
2229
2229
|
this.countryContainer.appendChild(this.dropdownContent);
|
|
2230
2230
|
}
|
|
2231
2231
|
_buildSearchUI() {
|
|
2232
|
-
const { i18n: e } = this.options, $ =
|
|
2232
|
+
const { i18n: e } = this.options, $ = T(
|
|
2233
2233
|
"div",
|
|
2234
2234
|
{ class: "iti__search-input-wrapper" },
|
|
2235
2235
|
this.dropdownContent
|
|
2236
2236
|
);
|
|
2237
|
-
this.searchIcon =
|
|
2237
|
+
this.searchIcon = T(
|
|
2238
2238
|
"span",
|
|
2239
2239
|
{
|
|
2240
2240
|
class: "iti__search-icon",
|
|
2241
2241
|
[b.HIDDEN]: "true"
|
|
2242
2242
|
},
|
|
2243
2243
|
$
|
|
2244
|
-
), this.searchIcon.innerHTML = a2(), this.searchInput =
|
|
2244
|
+
), this.searchIcon.innerHTML = a2(), this.searchInput = T(
|
|
2245
2245
|
"input",
|
|
2246
2246
|
{
|
|
2247
2247
|
id: `iti-${this.id}__search-input`,
|
|
@@ -2258,7 +2258,7 @@ class h2 {
|
|
|
2258
2258
|
autocomplete: "off"
|
|
2259
2259
|
},
|
|
2260
2260
|
$
|
|
2261
|
-
), this.searchClearButton =
|
|
2261
|
+
), this.searchClearButton = T(
|
|
2262
2262
|
"button",
|
|
2263
2263
|
{
|
|
2264
2264
|
type: "button",
|
|
@@ -2267,11 +2267,11 @@ class h2 {
|
|
|
2267
2267
|
tabindex: "-1"
|
|
2268
2268
|
},
|
|
2269
2269
|
$
|
|
2270
|
-
), this.searchClearButton.innerHTML = c2(this.id), this.searchResultsA11yText =
|
|
2270
|
+
), this.searchClearButton.innerHTML = c2(this.id), this.searchResultsA11yText = T(
|
|
2271
2271
|
"span",
|
|
2272
2272
|
{ class: "iti__a11y-text" },
|
|
2273
2273
|
this.dropdownContent
|
|
2274
|
-
), this.searchNoResults =
|
|
2274
|
+
), this.searchNoResults = T(
|
|
2275
2275
|
"div",
|
|
2276
2276
|
{
|
|
2277
2277
|
class: `iti__no-results ${N.HIDE}`,
|
|
@@ -2293,7 +2293,7 @@ class h2 {
|
|
|
2293
2293
|
const f = (i = this.telInput.form) == null ? void 0 : i.querySelector(
|
|
2294
2294
|
`input[name="${u.phone}"]`
|
|
2295
2295
|
);
|
|
2296
|
-
f ? this.hiddenInput = f : (this.hiddenInput =
|
|
2296
|
+
f ? this.hiddenInput = f : (this.hiddenInput = T("input", {
|
|
2297
2297
|
type: "hidden",
|
|
2298
2298
|
name: u.phone
|
|
2299
2299
|
}), e.appendChild(this.hiddenInput));
|
|
@@ -2302,7 +2302,7 @@ class h2 {
|
|
|
2302
2302
|
const f = (s = this.telInput.form) == null ? void 0 : s.querySelector(
|
|
2303
2303
|
`input[name="${u.country}"]`
|
|
2304
2304
|
);
|
|
2305
|
-
f ? this.hiddenInputCountry = f : (this.hiddenInputCountry =
|
|
2305
|
+
f ? this.hiddenInputCountry = f : (this.hiddenInputCountry = T("input", {
|
|
2306
2306
|
type: "hidden",
|
|
2307
2307
|
name: u.country
|
|
2308
2308
|
}), e.appendChild(this.hiddenInputCountry));
|
|
@@ -2314,19 +2314,18 @@ class h2 {
|
|
|
2314
2314
|
const e = document.createDocumentFragment();
|
|
2315
2315
|
for (let $ = 0; $ < this.countries.length; $++) {
|
|
2316
2316
|
const i = this.countries[$], s = R1({
|
|
2317
|
-
[N.COUNTRY_ITEM]: !0
|
|
2318
|
-
|
|
2319
|
-
}), a = L("li", {
|
|
2317
|
+
[N.COUNTRY_ITEM]: !0
|
|
2318
|
+
}), a = T("li", {
|
|
2320
2319
|
id: `iti-${this.id}__item-${i.iso2}`,
|
|
2321
2320
|
class: s,
|
|
2322
2321
|
tabindex: "-1",
|
|
2323
2322
|
role: "option",
|
|
2324
2323
|
[b.SELECTED]: "false"
|
|
2325
2324
|
});
|
|
2326
|
-
a.dataset.dialCode = i.dialCode, a.dataset.countryCode = i.iso2, i.nodeById[this.id] = a, this.options.showFlags &&
|
|
2327
|
-
const u =
|
|
2325
|
+
a.dataset.dialCode = i.dialCode, a.dataset.countryCode = i.iso2, i.nodeById[this.id] = a, this.options.showFlags && T("div", { class: `${N.FLAG} iti__${i.iso2}` }, a);
|
|
2326
|
+
const u = T("span", { class: "iti__country-name" }, a);
|
|
2328
2327
|
u.textContent = i.name;
|
|
2329
|
-
const f =
|
|
2328
|
+
const f = T("span", { class: "iti__dial-code" }, a);
|
|
2330
2329
|
this.isRTL && f.setAttribute("dir", "ltr"), f.textContent = `+${i.dialCode}`, e.appendChild(a);
|
|
2331
2330
|
}
|
|
2332
2331
|
this.countryList.appendChild(e);
|
|
@@ -2380,19 +2379,27 @@ class h2 {
|
|
|
2380
2379
|
if (C < a)
|
|
2381
2380
|
$.scrollTop = _;
|
|
2382
2381
|
else if (y > u) {
|
|
2383
|
-
const
|
|
2384
|
-
$.scrollTop = _ -
|
|
2382
|
+
const E = s - f;
|
|
2383
|
+
$.scrollTop = _ - E;
|
|
2385
2384
|
}
|
|
2386
2385
|
}
|
|
2387
|
-
//* Remove highlighting from
|
|
2386
|
+
//* Remove highlighting from the previous list item and highlight the new one.
|
|
2388
2387
|
highlightListItem(e, $) {
|
|
2389
2388
|
const i = this.highlightedItem;
|
|
2390
|
-
if (i &&
|
|
2389
|
+
if (i && i.classList.remove(N.HIGHLIGHT), this.highlightedItem = e, this.highlightedItem && (this.highlightedItem.classList.add(N.HIGHLIGHT), this.options.countrySearch)) {
|
|
2391
2390
|
const s = this.highlightedItem.getAttribute("id") || "";
|
|
2392
2391
|
this.searchInput.setAttribute(b.ACTIVE_DESCENDANT, s);
|
|
2393
2392
|
}
|
|
2394
2393
|
$ && this.highlightedItem.focus();
|
|
2395
2394
|
}
|
|
2395
|
+
updateSelectedItem(e) {
|
|
2396
|
+
if (this.selectedItem && this.selectedItem.dataset.countryCode !== e && (this.selectedItem.setAttribute(b.SELECTED, "false"), this.selectedItem = null), e && !this.selectedItem) {
|
|
2397
|
+
const $ = this.countryList.querySelector(
|
|
2398
|
+
`[data-country-code="${e}"]`
|
|
2399
|
+
);
|
|
2400
|
+
$ && ($.setAttribute(b.SELECTED, "true"), this.selectedItem = $);
|
|
2401
|
+
}
|
|
2402
|
+
}
|
|
2396
2403
|
//* Country search: Filter the country list to the given array of countries.
|
|
2397
2404
|
filterCountries(e) {
|
|
2398
2405
|
this.countryList.innerHTML = "";
|
|
@@ -2406,7 +2413,7 @@ class h2 {
|
|
|
2406
2413
|
destroy() {
|
|
2407
2414
|
this.telInput.iti = void 0, delete this.telInput.dataset.intlTelInputId, this.options.separateDialCode && (this.telInput.style.paddingLeft = this.originalPaddingLeft);
|
|
2408
2415
|
const e = this.telInput.parentNode;
|
|
2409
|
-
e.before(this.telInput), e.remove(), this.telInput = null, this.countryContainer = null, this.selectedCountry = null, this.selectedCountryInner = null, this.selectedDialCode = null, this.dropdownArrow = null, this.dropdownContent = null, this.searchInput = null, this.searchIcon = null, this.searchClearButton = null, this.searchNoResults = null, this.searchResultsA11yText = null, this.countryList = null, this.dropdown = null, this.hiddenInput = null, this.hiddenInputCountry = null, this.highlightedItem = null;
|
|
2416
|
+
e.before(this.telInput), e.remove(), this.telInput = null, this.countryContainer = null, this.selectedCountry = null, this.selectedCountryInner = null, this.selectedDialCode = null, this.dropdownArrow = null, this.dropdownContent = null, this.searchInput = null, this.searchIcon = null, this.searchClearButton = null, this.searchNoResults = null, this.searchResultsA11yText = null, this.countryList = null, this.dropdown = null, this.hiddenInput = null, this.hiddenInputCountry = null, this.highlightedItem = null, this.selectedItem = null;
|
|
2410
2417
|
for (const $ of this.countries)
|
|
2411
2418
|
delete $.nodeById[this.id];
|
|
2412
2419
|
this.countries = null;
|
|
@@ -2435,42 +2442,34 @@ const f2 = (h) => {
|
|
|
2435
2442
|
const i = $.iso2.toLowerCase();
|
|
2436
2443
|
e.i18n[i] && ($.name = e.i18n[i]);
|
|
2437
2444
|
}
|
|
2438
|
-
}, C2 = (h
|
|
2439
|
-
const
|
|
2440
|
-
let
|
|
2441
|
-
const
|
|
2445
|
+
}, C2 = (h) => {
|
|
2446
|
+
const e = /* @__PURE__ */ new Set();
|
|
2447
|
+
let $ = 0;
|
|
2448
|
+
const i = {}, s = (u, f) => {
|
|
2442
2449
|
if (!u || !f)
|
|
2443
2450
|
return;
|
|
2444
|
-
f.length >
|
|
2445
|
-
const
|
|
2446
|
-
|
|
2447
|
-
|
|
2448
|
-
|
|
2449
|
-
|
|
2450
|
-
};
|
|
2451
|
-
for (const u of h) {
|
|
2452
|
-
$.has(u.dialCode) || $.add(u.dialCode);
|
|
2451
|
+
f.length > $ && ($ = f.length), i.hasOwnProperty(f) || (i[f] = []);
|
|
2452
|
+
const C = i[f];
|
|
2453
|
+
C.includes(u) || C.push(u);
|
|
2454
|
+
}, a = [...h].sort((u, f) => u.priority - f.priority);
|
|
2455
|
+
for (const u of a) {
|
|
2456
|
+
e.has(u.dialCode) || e.add(u.dialCode);
|
|
2453
2457
|
for (let f = 1; f < u.dialCode.length; f++) {
|
|
2454
2458
|
const C = u.dialCode.substring(0, f);
|
|
2455
|
-
|
|
2459
|
+
s(u.iso2, C);
|
|
2456
2460
|
}
|
|
2457
|
-
|
|
2458
|
-
|
|
2459
|
-
(e.onlyCountries.length || e.excludeCountries.length) && $.forEach((u) => {
|
|
2460
|
-
s[u] = s[u].filter(Boolean);
|
|
2461
|
-
});
|
|
2462
|
-
for (const u of h)
|
|
2463
|
-
if (u.areaCodes) {
|
|
2464
|
-
const f = s[u.dialCode][0];
|
|
2461
|
+
if (s(u.iso2, u.dialCode), u.areaCodes) {
|
|
2462
|
+
const f = i[u.dialCode][0];
|
|
2465
2463
|
for (const C of u.areaCodes) {
|
|
2466
2464
|
for (let y = 1; y < C.length; y++) {
|
|
2467
|
-
const _ = C.substring(0, y),
|
|
2468
|
-
|
|
2465
|
+
const _ = C.substring(0, y), E = u.dialCode + _;
|
|
2466
|
+
s(f, E), s(u.iso2, E);
|
|
2469
2467
|
}
|
|
2470
|
-
|
|
2468
|
+
s(u.iso2, u.dialCode + C);
|
|
2471
2469
|
}
|
|
2472
2470
|
}
|
|
2473
|
-
|
|
2471
|
+
}
|
|
2472
|
+
return { dialCodes: e, dialCodeMaxLen: $, dialCodeToIso2Map: i };
|
|
2474
2473
|
}, g2 = (h, e) => {
|
|
2475
2474
|
e.countryOrder && (e.countryOrder = e.countryOrder.map(
|
|
2476
2475
|
($) => $.toLowerCase()
|
|
@@ -2528,22 +2527,21 @@ const f2 = (h) => {
|
|
|
2528
2527
|
"889"
|
|
2529
2528
|
], S0 = (h) => {
|
|
2530
2529
|
const e = N1(h);
|
|
2531
|
-
if (e.startsWith(
|
|
2530
|
+
if (e.startsWith(b0.NANP) && e.length >= 4) {
|
|
2532
2531
|
const $ = e.substring(1, 4);
|
|
2533
2532
|
return N2.includes($);
|
|
2534
2533
|
}
|
|
2535
2534
|
return !1;
|
|
2536
2535
|
};
|
|
2537
2536
|
for (const h of t1)
|
|
2538
|
-
h.name =
|
|
2537
|
+
h.name = L0[h.iso2];
|
|
2539
2538
|
let E2 = 0;
|
|
2540
2539
|
const S2 = new Set(t1.map((h) => h.iso2)), O1 = (h) => S2.has(h);
|
|
2541
2540
|
class B1 {
|
|
2542
2541
|
constructor(e, $ = {}) {
|
|
2543
|
-
this.id = E2++, this.options = { ...
|
|
2542
|
+
this.id = E2++, this.options = { ...T0, ...$ }, o2(this.options, L0), this.ui = new h2(e, this.options, this.id), this.isAndroid = B1._getIsAndroid(), this.promise = this._createInitPromises(), this.countries = f2(this.options);
|
|
2544
2543
|
const { dialCodes: i, dialCodeMaxLen: s, dialCodeToIso2Map: a } = C2(
|
|
2545
|
-
this.countries
|
|
2546
|
-
this.options
|
|
2544
|
+
this.countries
|
|
2547
2545
|
);
|
|
2548
2546
|
this.dialCodes = i, this.dialCodeMaxLen = s, this.dialCodeToIso2Map = a, this.countryByIso2 = new Map(this.countries.map((u) => [u.iso2, u])), this._init();
|
|
2549
2547
|
}
|
|
@@ -2598,10 +2596,10 @@ class B1 {
|
|
|
2598
2596
|
//* 1. Extracting a dial code from the given number
|
|
2599
2597
|
//* 2. Using explicit initialCountry
|
|
2600
2598
|
_setInitialState(e = !1) {
|
|
2601
|
-
const $ = this.ui.telInput.getAttribute("value"), i = this._normaliseNumerals($), s = this._getTelInputValue(), u = i && i.startsWith("+") && (!s || !s.startsWith("+")) ? i : s, f = this._getDialCode(u), C = S0(u), { initialCountry: y, geoIpLookup: _ } = this.options,
|
|
2599
|
+
const $ = this.ui.telInput.getAttribute("value"), i = this._normaliseNumerals($), s = this._getTelInputValue(), u = i && i.startsWith("+") && (!s || !s.startsWith("+")) ? i : s, f = this._getDialCode(u), C = S0(u), { initialCountry: y, geoIpLookup: _ } = this.options, E = y === P1.AUTO && _;
|
|
2602
2600
|
if (f && !C)
|
|
2603
2601
|
this._updateCountryFromNumber(u);
|
|
2604
|
-
else if (!
|
|
2602
|
+
else if (!E || e) {
|
|
2605
2603
|
const B = y ? y.toLowerCase() : "";
|
|
2606
2604
|
O1(B) ? this._setCountry(B) : f && C ? this._setCountry(s2.ISO2) : this._setCountry("");
|
|
2607
2605
|
}
|
|
@@ -2710,10 +2708,10 @@ class B1 {
|
|
|
2710
2708
|
return;
|
|
2711
2709
|
}
|
|
2712
2710
|
this._updateCountryFromNumber(y) && this._triggerCountryChange();
|
|
2713
|
-
const _ = (C == null ? void 0 : C.data) && d1.NON_PLUS_NUMERIC.test(C.data),
|
|
2714
|
-
_ ||
|
|
2715
|
-
const B = (C == null ? void 0 : C.detail) && C.detail.isSetNumber,
|
|
2716
|
-
if ($ && !u && !B &&
|
|
2711
|
+
const _ = (C == null ? void 0 : C.data) && d1.NON_PLUS_NUMERIC.test(C.data), E = (C == null ? void 0 : C.inputType) === _0.PASTE && y;
|
|
2712
|
+
_ || E && !e ? u = !0 : d1.NON_PLUS_NUMERIC.test(y) || (u = !1);
|
|
2713
|
+
const B = (C == null ? void 0 : C.detail) && C.detail.isSetNumber, S = this.userNumeralSet === "ascii";
|
|
2714
|
+
if ($ && !u && !B && S) {
|
|
2717
2715
|
const w = this.ui.telInput.selectionStart || 0, k = y.substring(
|
|
2718
2716
|
0,
|
|
2719
2717
|
w
|
|
@@ -2753,7 +2751,7 @@ class B1 {
|
|
|
2753
2751
|
return;
|
|
2754
2752
|
}
|
|
2755
2753
|
if (e) {
|
|
2756
|
-
const f = this._getTelInputValue(), y = !f.startsWith("+") && this.ui.telInput.selectionStart === 0 && u.key === "+", _ = this._normaliseNumerals(u.key),
|
|
2754
|
+
const f = this._getTelInputValue(), y = !f.startsWith("+") && this.ui.telInput.selectionStart === 0 && u.key === "+", _ = this._normaliseNumerals(u.key), E = /^[0-9]$/.test(_), B = $ ? E : y || E, S = this.ui.telInput, w = S.selectionStart, H = S.selectionEnd, k = f.slice(0, w), W = f.slice(H), D = k + u.key + W, K = this._getFullNumber(D), V = m.utils.getCoreNumber(
|
|
2757
2755
|
K,
|
|
2758
2756
|
this.selectedCountryData.iso2
|
|
2759
2757
|
), $1 = this.maxCoreNumberLength && V.length > this.maxCoreNumberLength, a1 = this._getNewCountryFromNumber(K) !== null;
|
|
@@ -2770,7 +2768,7 @@ class B1 {
|
|
|
2770
2768
|
if (this.options.strictMode) {
|
|
2771
2769
|
const e = ($) => {
|
|
2772
2770
|
$.preventDefault();
|
|
2773
|
-
const i = this.ui.telInput, s = i.selectionStart, a = i.selectionEnd, u = this._getTelInputValue(), f = u.slice(0, s), C = u.slice(a), y = this.selectedCountryData.iso2, _ = $.clipboardData.getData("text"),
|
|
2771
|
+
const i = this.ui.telInput, s = i.selectionStart, a = i.selectionEnd, u = this._getTelInputValue(), f = u.slice(0, s), C = u.slice(a), y = this.selectedCountryData.iso2, _ = $.clipboardData.getData("text"), E = this._normaliseNumerals(_), B = s === 0 && a > 0, S = !u.startsWith("+") || B, w = E.replace(d1.NON_PLUS_NUMERIC_GLOBAL, ""), H = w.startsWith("+"), k = w.replace(/\+/g, ""), W = H && S ? `+${k}` : k;
|
|
2774
2772
|
let D = f + W + C;
|
|
2775
2773
|
if (D.length > 5) {
|
|
2776
2774
|
let V = m.utils.getCoreNumber(D, y);
|
|
@@ -2988,18 +2986,18 @@ class B1 {
|
|
|
2988
2986
|
return y[0] === s ? null : y[0];
|
|
2989
2987
|
if (!s && this.defaultCountry && y.includes(this.defaultCountry))
|
|
2990
2988
|
return this.defaultCountry;
|
|
2991
|
-
if (a ===
|
|
2989
|
+
if (a === b0.NANP && S0(f))
|
|
2992
2990
|
return null;
|
|
2993
|
-
const { areaCodes:
|
|
2994
|
-
if (
|
|
2995
|
-
const W =
|
|
2991
|
+
const { areaCodes: E, priority: B } = this.selectedCountryData;
|
|
2992
|
+
if (E) {
|
|
2993
|
+
const W = E.map(
|
|
2996
2994
|
(D) => `${a}${D}`
|
|
2997
2995
|
);
|
|
2998
2996
|
for (const D of W)
|
|
2999
2997
|
if (f.startsWith(D))
|
|
3000
2998
|
return null;
|
|
3001
2999
|
}
|
|
3002
|
-
const w =
|
|
3000
|
+
const w = E && !(B === 0) && f.length > C.length, H = s && y.includes(s) && !w, k = s === y[0];
|
|
3003
3001
|
if (!H && !k)
|
|
3004
3002
|
return y[0];
|
|
3005
3003
|
} else if (i.startsWith("+") && f.length) {
|
|
@@ -3009,25 +3007,25 @@ class B1 {
|
|
|
3009
3007
|
return this.defaultCountry;
|
|
3010
3008
|
return null;
|
|
3011
3009
|
}
|
|
3012
|
-
//* Update the selected country, dial code (if separateDialCode), placeholder, title, and
|
|
3010
|
+
//* Update the selected country, dial code (if separateDialCode), placeholder, title, and selected list item.
|
|
3013
3011
|
//* Note: called from _setInitialState, _updateCountryFromNumber, _selectListItem, setCountry.
|
|
3014
3012
|
_setCountry(e) {
|
|
3015
|
-
const { separateDialCode: $, showFlags: i, i18n: s } = this.options,
|
|
3016
|
-
if (this.selectedCountryData = e ? this.countryByIso2.get(e) : {}, this.selectedCountryData.iso2 && (this.defaultCountry = this.selectedCountryData.iso2), this.ui.selectedCountry) {
|
|
3017
|
-
const
|
|
3018
|
-
let
|
|
3013
|
+
const { separateDialCode: $, showFlags: i, i18n: s, allowDropdown: a } = this.options, u = this.selectedCountryData.iso2 || "";
|
|
3014
|
+
if (a && this.ui.updateSelectedItem(e), this.selectedCountryData = e ? this.countryByIso2.get(e) : {}, this.selectedCountryData.iso2 && (this.defaultCountry = this.selectedCountryData.iso2), this.ui.selectedCountry) {
|
|
3015
|
+
const f = e && i ? `${N.FLAG} iti__${e}` : `${N.FLAG} ${N.GLOBE}`;
|
|
3016
|
+
let C, y;
|
|
3019
3017
|
if (e) {
|
|
3020
|
-
const { name:
|
|
3021
|
-
|
|
3018
|
+
const { name: _, dialCode: E } = this.selectedCountryData;
|
|
3019
|
+
y = _, C = s.selectedCountryAriaLabel.replace("${countryName}", _).replace("${dialCode}", `+${E}`);
|
|
3022
3020
|
} else
|
|
3023
|
-
|
|
3024
|
-
this.ui.selectedCountryInner.className =
|
|
3021
|
+
y = s.noCountrySelected, C = s.noCountrySelected;
|
|
3022
|
+
this.ui.selectedCountryInner.className = f, this.ui.selectedCountry.setAttribute("title", y), this.ui.selectedCountry.setAttribute(b.LABEL, C);
|
|
3025
3023
|
}
|
|
3026
3024
|
if ($) {
|
|
3027
|
-
const
|
|
3028
|
-
this.ui.selectedDialCode.textContent =
|
|
3025
|
+
const f = this.selectedCountryData.dialCode ? `+${this.selectedCountryData.dialCode}` : "";
|
|
3026
|
+
this.ui.selectedDialCode.textContent = f, this.ui.updateInputPadding();
|
|
3029
3027
|
}
|
|
3030
|
-
return this._updatePlaceholder(), this._updateMaxLength(),
|
|
3028
|
+
return this._updatePlaceholder(), this._updateMaxLength(), u !== e;
|
|
3031
3029
|
}
|
|
3032
3030
|
//* Update the maximum valid number length for the currently selected country.
|
|
3033
3031
|
_updateMaxLength() {
|
|
@@ -3083,7 +3081,7 @@ class B1 {
|
|
|
3083
3081
|
}
|
|
3084
3082
|
//* Close the dropdown and unbind any listeners.
|
|
3085
3083
|
_closeDropdown() {
|
|
3086
|
-
this.ui.dropdownContent.classList.contains(N.HIDE) || (this.ui.dropdownContent.classList.add(N.HIDE), this.ui.selectedCountry.setAttribute(b.EXPANDED, "false"), this.
|
|
3084
|
+
this.ui.dropdownContent.classList.contains(N.HIDE) || (this.ui.dropdownContent.classList.add(N.HIDE), this.ui.selectedCountry.setAttribute(b.EXPANDED, "false"), this.options.countrySearch && (this.ui.searchInput.removeAttribute(b.ACTIVE_DESCENDANT), this.ui.highlightedItem && (this.ui.highlightedItem.classList.remove(N.HIGHLIGHT), this.ui.highlightedItem = null)), this.ui.dropdownArrow.classList.remove(N.ARROW_UP), this.dropdownAbortController.abort(), this.dropdownAbortController = null, this.options.dropdownContainer && this.ui.dropdown.remove(), this._trigger(_1.CLOSE_COUNTRY_DROPDOWN));
|
|
3087
3085
|
}
|
|
3088
3086
|
//* Replace any existing dial code with the new one
|
|
3089
3087
|
//* Note: called from _selectListItem and setCountry
|
|
@@ -3266,7 +3264,7 @@ class B1 {
|
|
|
3266
3264
|
this.ui.telInput.disabled = e, e ? this.ui.selectedCountry.setAttribute("disabled", "true") : this.ui.selectedCountry.removeAttribute("disabled");
|
|
3267
3265
|
}
|
|
3268
3266
|
}
|
|
3269
|
-
const
|
|
3267
|
+
const L2 = (h) => {
|
|
3270
3268
|
if (!m.utils && !m.startedLoadingUtilsScript) {
|
|
3271
3269
|
let e;
|
|
3272
3270
|
if (typeof h == "function")
|
|
@@ -3304,7 +3302,7 @@ const b2 = (h) => {
|
|
|
3304
3302
|
return m.instances[$.id] = $, h.iti = $, $;
|
|
3305
3303
|
},
|
|
3306
3304
|
{
|
|
3307
|
-
defaults:
|
|
3305
|
+
defaults: T0,
|
|
3308
3306
|
//* Using a static var like this allows us to mock it in the tests.
|
|
3309
3307
|
documentReady: () => document.readyState === "complete",
|
|
3310
3308
|
//* Get the country data object.
|
|
@@ -3316,10 +3314,10 @@ const b2 = (h) => {
|
|
|
3316
3314
|
},
|
|
3317
3315
|
//* A map from instance ID to instance object.
|
|
3318
3316
|
instances: {},
|
|
3319
|
-
attachUtils:
|
|
3317
|
+
attachUtils: L2,
|
|
3320
3318
|
startedLoadingUtilsScript: !1,
|
|
3321
3319
|
startedLoadingAutoCountry: !1,
|
|
3322
|
-
version: "25.13.
|
|
3320
|
+
version: "25.13.2"
|
|
3323
3321
|
}
|
|
3324
3322
|
);
|
|
3325
3323
|
(function() {
|
|
@@ -3375,7 +3373,7 @@ const b2 = (h) => {
|
|
|
3375
3373
|
}
|
|
3376
3374
|
new y();
|
|
3377
3375
|
const _ = {};
|
|
3378
|
-
class
|
|
3376
|
+
class E {
|
|
3379
3377
|
constructor() {
|
|
3380
3378
|
var t = h.trustedTypes && h.trustedTypes.emptyHTML || "";
|
|
3381
3379
|
if (_ !== _) throw Error("SafeHtml is not meant to be built directly");
|
|
@@ -3385,7 +3383,7 @@ const b2 = (h) => {
|
|
|
3385
3383
|
return this.g.toString();
|
|
3386
3384
|
}
|
|
3387
3385
|
}
|
|
3388
|
-
new
|
|
3386
|
+
new E();
|
|
3389
3387
|
function B(d, t) {
|
|
3390
3388
|
switch (this.g = d, this.l = !!t.aa, this.h = t.i, this.s = t.type, this.o = !1, this.h) {
|
|
3391
3389
|
case H:
|
|
@@ -3394,12 +3392,12 @@ const b2 = (h) => {
|
|
|
3394
3392
|
case D:
|
|
3395
3393
|
case K:
|
|
3396
3394
|
case w:
|
|
3397
|
-
case
|
|
3395
|
+
case S:
|
|
3398
3396
|
this.o = !0;
|
|
3399
3397
|
}
|
|
3400
3398
|
this.j = t.defaultValue;
|
|
3401
3399
|
}
|
|
3402
|
-
var
|
|
3400
|
+
var S = 1, w = 2, H = 3, k = 4, W = 6, D = 16, K = 18;
|
|
3403
3401
|
function V(d, t) {
|
|
3404
3402
|
for (this.h = d, this.g = {}, d = 0; d < t.length; d++) {
|
|
3405
3403
|
var n = t[d];
|
|
@@ -3463,7 +3461,7 @@ const b2 = (h) => {
|
|
|
3463
3461
|
var r = c1(d, t);
|
|
3464
3462
|
return d.j[t].l ? r[n || 0] : r;
|
|
3465
3463
|
}
|
|
3466
|
-
function
|
|
3464
|
+
function L(d, t) {
|
|
3467
3465
|
if (U(d, t)) d = g(d, t);
|
|
3468
3466
|
else d: {
|
|
3469
3467
|
if (d = d.j[t], d.j === void 0) if (t = d.s, t === Boolean) d.j = !1;
|
|
@@ -9011,15 +9009,15 @@ const b2 = (h) => {
|
|
|
9011
9009
|
}
|
|
9012
9010
|
M.prototype.format = function(d, t) {
|
|
9013
9011
|
if (g(d, 2) == 0 && U(d, 5)) {
|
|
9014
|
-
var n =
|
|
9012
|
+
var n = L(d, 5);
|
|
9015
9013
|
if (0 < n.length) return n;
|
|
9016
9014
|
}
|
|
9017
|
-
n =
|
|
9015
|
+
n = L(d, 1);
|
|
9018
9016
|
var r = o1(d);
|
|
9019
9017
|
if (t == 0) return Q1(n, 0, r, "");
|
|
9020
9018
|
if (!(n in i1)) return r;
|
|
9021
9019
|
var o = r1(this, n, u1(n));
|
|
9022
|
-
d = U(d, 3) && g(d, 3).length != 0 ? t == 3 ? ";ext=" + g(d, 3) : U(o, 13) ? g(o, 13) +
|
|
9020
|
+
d = U(d, 3) && g(d, 3).length != 0 ? t == 3 ? ";ext=" + g(d, 3) : U(o, 13) ? g(o, 13) + L(d, 3) : " ext. " + L(d, 3) : "";
|
|
9023
9021
|
d: {
|
|
9024
9022
|
o = O(o, 20).length == 0 || t == 2 ? O(o, 19) : O(o, 20);
|
|
9025
9023
|
for (var l, c = o.length, p = 0; p < c; ++p) {
|
|
@@ -9032,10 +9030,10 @@ const b2 = (h) => {
|
|
|
9032
9030
|
}
|
|
9033
9031
|
o = null;
|
|
9034
9032
|
}
|
|
9035
|
-
return o != null && (c = o, o =
|
|
9033
|
+
return o != null && (c = o, o = L(c, 2), l = new RegExp(g(c, 1)), L(
|
|
9036
9034
|
c,
|
|
9037
9035
|
5
|
|
9038
|
-
), c =
|
|
9036
|
+
), c = L(c, 4), r = t == 2 && c != null && 0 < c.length ? r.replace(l, o.replace(k0, c)) : r.replace(l, o), t == 3 && (r = r.replace(RegExp("^[-x‐-―−ー--/ ()()[].\\[\\]/~⁓∼~]+"), ""), r = r.replace(RegExp("[-x‐-―−ー--/ ()()[].\\[\\]/~⁓∼~]+", "g"), "-"))), Q1(n, t, r, d);
|
|
9039
9037
|
};
|
|
9040
9038
|
function r1(d, t, n) {
|
|
9041
9039
|
return n == "001" ? J(d, "" + t) : J(d, n);
|
|
@@ -9043,7 +9041,7 @@ const b2 = (h) => {
|
|
|
9043
9041
|
function o1(d) {
|
|
9044
9042
|
if (!U(d, 2)) return "";
|
|
9045
9043
|
var t = "" + g(d, 2);
|
|
9046
|
-
return U(d, 4) && g(d, 4) && 0 <
|
|
9044
|
+
return U(d, 4) && g(d, 4) && 0 < L(d, 8) ? Array(L(d, 8) + 1).join("0") + t : t;
|
|
9047
9045
|
}
|
|
9048
9046
|
function Q1(d, t, n, r) {
|
|
9049
9047
|
switch (t) {
|
|
@@ -9086,9 +9084,9 @@ const b2 = (h) => {
|
|
|
9086
9084
|
}
|
|
9087
9085
|
function d0(d, t) {
|
|
9088
9086
|
var n = t0(d, t);
|
|
9089
|
-
return d = r1(d,
|
|
9087
|
+
return d = r1(d, L(t, 1), n), d == null ? -1 : (t = o1(t), L1(t, d));
|
|
9090
9088
|
}
|
|
9091
|
-
function
|
|
9089
|
+
function L1(d, t) {
|
|
9092
9090
|
return F(d, g(t, 1)) ? F(d, g(t, 5)) ? 4 : F(d, g(t, 4)) ? 3 : F(d, g(t, 6)) ? 5 : F(d, g(t, 8)) ? 6 : F(d, g(t, 7)) ? 7 : F(d, g(t, 21)) ? 8 : F(d, g(t, 25)) ? 9 : F(d, g(t, 28)) ? 10 : F(d, g(t, 2)) ? g(t, 18) || F(d, g(t, 3)) ? 2 : 0 : !g(t, 18) && F(d, g(t, 3)) ? 1 : -1 : -1;
|
|
9093
9091
|
}
|
|
9094
9092
|
function J(d, t) {
|
|
@@ -9103,15 +9101,15 @@ const b2 = (h) => {
|
|
|
9103
9101
|
}
|
|
9104
9102
|
function F(d, t) {
|
|
9105
9103
|
var n = d.length;
|
|
9106
|
-
return 0 < z(t, 9) && O(t, 9).indexOf(n) == -1 ? !1 : j(
|
|
9104
|
+
return 0 < z(t, 9) && O(t, 9).indexOf(n) == -1 ? !1 : j(L(t, 2), d);
|
|
9107
9105
|
}
|
|
9108
9106
|
function F0(d, t) {
|
|
9109
|
-
var n = t0(d, t), r =
|
|
9110
|
-
return o == null || n != "001" && r != e0(d, n) ? o = !1 : (d = o1(t), o =
|
|
9107
|
+
var n = t0(d, t), r = L(t, 1), o = r1(d, r, n);
|
|
9108
|
+
return o == null || n != "001" && r != e0(d, n) ? o = !1 : (d = o1(t), o = L1(d, o) != -1), o;
|
|
9111
9109
|
}
|
|
9112
9110
|
function t0(d, t) {
|
|
9113
9111
|
if (t == null) return null;
|
|
9114
|
-
var n =
|
|
9112
|
+
var n = L(t, 1);
|
|
9115
9113
|
if (n = i1[n], n == null) d = null;
|
|
9116
9114
|
else if (n.length == 1) d = n[0];
|
|
9117
9115
|
else d: {
|
|
@@ -9124,7 +9122,7 @@ const b2 = (h) => {
|
|
|
9124
9122
|
d = r;
|
|
9125
9123
|
break d;
|
|
9126
9124
|
}
|
|
9127
|
-
} else if (
|
|
9125
|
+
} else if (L1(t, c) != -1) {
|
|
9128
9126
|
d = r;
|
|
9129
9127
|
break d;
|
|
9130
9128
|
}
|
|
@@ -9138,7 +9136,7 @@ const b2 = (h) => {
|
|
|
9138
9136
|
}
|
|
9139
9137
|
function e0(d, t) {
|
|
9140
9138
|
if (d = J(d, t), d == null) throw Error("Invalid region code: " + t);
|
|
9141
|
-
return
|
|
9139
|
+
return L(d, 10);
|
|
9142
9140
|
}
|
|
9143
9141
|
function m1(d, t, n, r) {
|
|
9144
9142
|
var o = g1(n, r), l = z(o, 9) == 0 ? O(g(n, 1), 9) : O(o, 9);
|
|
@@ -9148,7 +9146,7 @@ const b2 = (h) => {
|
|
|
9148
9146
|
}
|
|
9149
9147
|
function y1(d, t, n) {
|
|
9150
9148
|
var r = o1(t);
|
|
9151
|
-
return t =
|
|
9149
|
+
return t = L(t, 1), t in i1 ? (t = r1(d, t, u1(t)), m1(d, r, t, n)) : 1;
|
|
9152
9150
|
}
|
|
9153
9151
|
function $0(d, t) {
|
|
9154
9152
|
if (d = d.toString(), d.length == 0 || d.charAt(0) == "0") return 0;
|
|
@@ -9176,14 +9174,14 @@ const b2 = (h) => {
|
|
|
9176
9174
|
if (d = $0(t, r), d != 0) return P(l, 1, d), d;
|
|
9177
9175
|
throw Error("Invalid country calling code");
|
|
9178
9176
|
}
|
|
9179
|
-
return n != null && (c =
|
|
9177
|
+
return n != null && (c = L(n, 10), p = "" + c, I = t.toString(), I.lastIndexOf(p, 0) == 0 && (p = new v(I.substring(p.length)), I = g(n, 1), I = new RegExp(L(I, 2)), i0(p, n, null), p = p.toString(), !j(I, t.toString()) && j(I, p) || m1(d, t.toString(), n, -1) == 3)) ? (r.g(p), o && P(l, 6, 10), P(l, 1, c), c) : (P(l, 1, 0), 0);
|
|
9180
9178
|
}
|
|
9181
9179
|
function i0(d, t, n) {
|
|
9182
9180
|
var r = d.toString(), o = r.length, l = g(t, 15);
|
|
9183
9181
|
if (o != 0 && l != null && l.length != 0) {
|
|
9184
9182
|
var c = new RegExp("^(?:" + l + ")");
|
|
9185
9183
|
if (o = c.exec(r)) {
|
|
9186
|
-
l = new RegExp(
|
|
9184
|
+
l = new RegExp(L(g(t, 1), 2));
|
|
9187
9185
|
var p = j(l, r), I = o.length - 1;
|
|
9188
9186
|
t = g(t, 16), t == null || t.length == 0 || o[I] == null || o[I].length == 0 ? (!p || j(l, r.substring(o[0].length))) && (n != null && 0 < I && o[I] != null && n.g(o[1]), d.set(r.substring(o[0].length))) : (r = r.replace(c, t), (!p || j(l, r)) && (n != null && 0 < I && n.g(o[1]), d.set(r)));
|
|
9189
9187
|
}
|
|
@@ -9225,7 +9223,7 @@ const b2 = (h) => {
|
|
|
9225
9223
|
if (I = I.replace(s1, ""), p = n0(d, I, c, t, r, l), p == 0) throw A1;
|
|
9226
9224
|
} else throw A1;
|
|
9227
9225
|
}
|
|
9228
|
-
if (p != 0 ? (o = u1(p), o != n && (c = r1(d, p, o))) : (J1(o), t.g(o.toString()), n != null ? (p =
|
|
9226
|
+
if (p != 0 ? (o = u1(p), o != n && (c = r1(d, p, o))) : (J1(o), t.g(o.toString()), n != null ? (p = L(c, 10), P(
|
|
9229
9227
|
l,
|
|
9230
9228
|
1,
|
|
9231
9229
|
p
|
|
@@ -9252,12 +9250,12 @@ const b2 = (h) => {
|
|
|
9252
9250
|
}
|
|
9253
9251
|
function l0(d) {
|
|
9254
9252
|
for (var t = d.j.length, n = 0; n < t; ++n) {
|
|
9255
|
-
var r = d.j[n], o =
|
|
9253
|
+
var r = d.j[n], o = L(r, 1);
|
|
9256
9254
|
if (d.da == o) return !1;
|
|
9257
|
-
var l = d, c = r, p =
|
|
9255
|
+
var l = d, c = r, p = L(c, 1);
|
|
9258
9256
|
G(l.v);
|
|
9259
9257
|
var I = l;
|
|
9260
|
-
c =
|
|
9258
|
+
c = L(c, 2);
|
|
9261
9259
|
var Y = "999999999999999".match(p)[0];
|
|
9262
9260
|
if (Y.length < I.g.h.length ? I = "" : (I = Y.replace(new RegExp(p, "g"), c), I = I.replace(RegExp("9", "g"), " ")), 0 < I.length ? (l.v.g(I), l = !0) : l = !1, l) return d.da = o, d.ha = o0.test(g(r, 4)), d.$ = 0, !0;
|
|
9263
9261
|
}
|
|
@@ -9288,17 +9286,17 @@ const b2 = (h) => {
|
|
|
9288
9286
|
return d.s.toString();
|
|
9289
9287
|
case 3:
|
|
9290
9288
|
if (C0(d)) d.ea = !0;
|
|
9291
|
-
else return d.o = p0(d),
|
|
9289
|
+
else return d.o = p0(d), b1(d);
|
|
9292
9290
|
default:
|
|
9293
|
-
return d.ea ? (g0(d) && (d.ea = !1), d.h.toString() + d.g.toString()) : 0 < d.j.length ? (t = m0(d, t), n = h0(d), 0 < n.length ? n : (a0(d, d.g.toString()), l0(d) ? f0(d) : d.u ? I1(d, t) : d.s.toString())) :
|
|
9291
|
+
return d.ea ? (g0(d) && (d.ea = !1), d.h.toString() + d.g.toString()) : 0 < d.j.length ? (t = m0(d, t), n = h0(d), 0 < n.length ? n : (a0(d, d.g.toString()), l0(d) ? f0(d) : d.u ? I1(d, t) : d.s.toString())) : b1(d);
|
|
9294
9292
|
}
|
|
9295
9293
|
}
|
|
9296
9294
|
function c0(d) {
|
|
9297
|
-
return d.u = !0, d.ea = !1, d.j = [], d.$ = 0, G(d.v), d.da = "",
|
|
9295
|
+
return d.u = !0, d.ea = !1, d.j = [], d.$ = 0, G(d.v), d.da = "", b1(d);
|
|
9298
9296
|
}
|
|
9299
9297
|
function h0(d) {
|
|
9300
9298
|
for (var t = d.g.toString(), n = d.j.length, r = 0; r < n; ++r) {
|
|
9301
|
-
var o = d.j[r], l =
|
|
9299
|
+
var o = d.j[r], l = L(o, 1);
|
|
9302
9300
|
if (new RegExp("^(?:" + l + ")$").test(t) && (d.ha = o0.test(g(o, 4)), o = t.replace(new RegExp(l, "g"), g(o, 2)), o = I1(d, o), p1(o, v0) == d.ba)) return o;
|
|
9303
9301
|
}
|
|
9304
9302
|
return "";
|
|
@@ -9307,12 +9305,12 @@ const b2 = (h) => {
|
|
|
9307
9305
|
var n = d.h.h.length;
|
|
9308
9306
|
return d.ha && 0 < n && d.h.toString().charAt(n - 1) != " " ? d.h + " " + t : d.h + t;
|
|
9309
9307
|
}
|
|
9310
|
-
function
|
|
9308
|
+
function b1(d) {
|
|
9311
9309
|
var t = d.g.toString();
|
|
9312
9310
|
if (3 <= t.length) {
|
|
9313
9311
|
for (var n = d.ca && d.o.length == 0 && 0 < z(d.l, 20) ? O(d.l, 20) : O(d.l, 19), r = n.length, o = 0; o < r; ++o) {
|
|
9314
9312
|
var l = n[o];
|
|
9315
|
-
0 < d.o.length && q1(
|
|
9313
|
+
0 < d.o.length && q1(L(l, 4)) && !g(l, 6) && !U(l, 5) || (d.o.length != 0 || d.ca || q1(L(l, 4)) || g(l, 6)) && K0.test(L(l, 2)) && d.j.push(l);
|
|
9316
9314
|
}
|
|
9317
9315
|
return a0(d, t), t = h0(d), 0 < t.length ? t : l0(d) ? f0(d) : d.s.toString();
|
|
9318
9316
|
}
|
|
@@ -9352,7 +9350,7 @@ const b2 = (h) => {
|
|
|
9352
9350
|
const y0 = (d) => {
|
|
9353
9351
|
const t = [];
|
|
9354
9352
|
return d.includes("FIXED_LINE_OR_MOBILE") ? (d.includes("MOBILE") || t.push("MOBILE"), d.includes("FIXED_LINE") || t.push("FIXED_LINE")) : (d.includes("MOBILE") || d.includes("FIXED_LINE")) && t.push("FIXED_LINE_OR_MOBILE"), d.concat(t);
|
|
9355
|
-
},
|
|
9353
|
+
}, T1 = { FIXED_LINE: 0, MOBILE: 1, FIXED_LINE_OR_MOBILE: 2, TOLL_FREE: 3, PREMIUM_RATE: 4, SHARED_COST: 5, VOIP: 6, PERSONAL_NUMBER: 7, PAGER: 8, UAN: 9, VOICEMAIL: 10, UNKNOWN: -1 };
|
|
9356
9354
|
e("intlTelInputUtilsTemp", {}), e("intlTelInputUtilsTemp.formatNumberAsYouType", (d, t) => {
|
|
9357
9355
|
try {
|
|
9358
9356
|
const n = d.replace(/[^+0-9]/g, ""), r = new W0(t);
|
|
@@ -9416,7 +9414,7 @@ const b2 = (h) => {
|
|
|
9416
9414
|
try {
|
|
9417
9415
|
const r = M.g(), o = Q(r, d, t), l = F0(r, o);
|
|
9418
9416
|
if (n) {
|
|
9419
|
-
const c = y0(n).map((p) =>
|
|
9417
|
+
const c = y0(n).map((p) => T1[p]);
|
|
9420
9418
|
return l && c.includes(d0(r, o));
|
|
9421
9419
|
}
|
|
9422
9420
|
return l;
|
|
@@ -9428,7 +9426,7 @@ const b2 = (h) => {
|
|
|
9428
9426
|
const r = M.g(), o = Q(r, d, t);
|
|
9429
9427
|
if (n) {
|
|
9430
9428
|
const l = y0(n);
|
|
9431
|
-
for (let c of l) if (y1(r, o,
|
|
9429
|
+
for (let c of l) if (y1(r, o, T1[c]) === 0) return !0;
|
|
9432
9430
|
return !1;
|
|
9433
9431
|
}
|
|
9434
9432
|
return y1(r, o, -1) === 0;
|
|
@@ -9441,11 +9439,11 @@ const b2 = (h) => {
|
|
|
9441
9439
|
} catch {
|
|
9442
9440
|
return "";
|
|
9443
9441
|
}
|
|
9444
|
-
}), e("intlTelInputUtilsTemp.numberFormat", { E164: 0, INTERNATIONAL: 1, NATIONAL: 2, RFC3966: 3 }), e("intlTelInputUtilsTemp.numberType",
|
|
9442
|
+
}), e("intlTelInputUtilsTemp.numberFormat", { E164: 0, INTERNATIONAL: 1, NATIONAL: 2, RFC3966: 3 }), e("intlTelInputUtilsTemp.numberType", T1), e("intlTelInputUtilsTemp.validationError", { IS_POSSIBLE: 0, INVALID_COUNTRY_CODE: 1, TOO_SHORT: 2, TOO_LONG: 3, IS_POSSIBLE_LOCAL_ONLY: 4, INVALID_LENGTH: 5 });
|
|
9445
9443
|
})();
|
|
9446
|
-
const w0 = typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : void 0,
|
|
9444
|
+
const w0 = typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : void 0, b2 = w0.intlTelInputUtilsTemp;
|
|
9447
9445
|
delete w0.intlTelInputUtilsTemp;
|
|
9448
|
-
m.utils =
|
|
9446
|
+
m.utils = b2;
|
|
9449
9447
|
const A2 = {
|
|
9450
9448
|
__name: "IntlTelInputWithUtils",
|
|
9451
9449
|
props: /* @__PURE__ */ I0({
|
|
@@ -9480,36 +9478,36 @@ const A2 = {
|
|
|
9480
9478
|
], ["update:modelValue"]),
|
|
9481
9479
|
setup(h, { expose: e, emit: $ }) {
|
|
9482
9480
|
const i = Y0(h, "modelValue"), s = h, a = $, u = w1(), f = w1(), C = w1(!1), y = () => f.value ? s.options.strictMode ? f.value.isValidNumberPrecise() : f.value.isValidNumber() : null, _ = () => {
|
|
9483
|
-
let
|
|
9484
|
-
C.value !==
|
|
9481
|
+
let S = y();
|
|
9482
|
+
C.value !== S && (C.value = S, a("changeValidity", !!S), a(
|
|
9485
9483
|
"changeErrorCode",
|
|
9486
|
-
|
|
9484
|
+
S ? null : f.value.getValidationError()
|
|
9487
9485
|
));
|
|
9488
|
-
},
|
|
9489
|
-
var
|
|
9490
|
-
a("changeNumber", ((
|
|
9486
|
+
}, E = () => {
|
|
9487
|
+
var S;
|
|
9488
|
+
a("changeNumber", ((S = f.value) == null ? void 0 : S.getNumber()) ?? ""), _();
|
|
9491
9489
|
}, B = () => {
|
|
9492
|
-
var
|
|
9493
|
-
a("changeCountry", ((
|
|
9490
|
+
var S;
|
|
9491
|
+
a("changeCountry", ((S = f.value) == null ? void 0 : S.getSelectedCountryData().iso2) ?? ""), E(), _();
|
|
9494
9492
|
};
|
|
9495
9493
|
return z0(() => {
|
|
9496
9494
|
u.value && (f.value = m(u.value, s.options), s.value && f.value.setNumber(s.value), s.disabled && f.value.setDisabled(s.disabled), C.value = y());
|
|
9497
9495
|
}), Z0(
|
|
9498
9496
|
() => s.disabled,
|
|
9499
|
-
(
|
|
9497
|
+
(S) => {
|
|
9500
9498
|
var w;
|
|
9501
|
-
return (w = f.value) == null ? void 0 : w.setDisabled(
|
|
9499
|
+
return (w = f.value) == null ? void 0 : w.setDisabled(S);
|
|
9502
9500
|
}
|
|
9503
9501
|
), J0(() => {
|
|
9504
|
-
var
|
|
9505
|
-
return (
|
|
9506
|
-
}), e({ instance: f, input: u }), (
|
|
9502
|
+
var S;
|
|
9503
|
+
return (S = f.value) == null ? void 0 : S.destroy();
|
|
9504
|
+
}), e({ instance: f, input: u }), (S, w) => X0((Q0(), q0("input", d2({
|
|
9507
9505
|
ref_key: "input",
|
|
9508
9506
|
ref: u,
|
|
9509
9507
|
"onUpdate:modelValue": w[0] || (w[0] = (H) => i.value = H),
|
|
9510
9508
|
type: "tel",
|
|
9511
9509
|
onCountrychange: B,
|
|
9512
|
-
onInput:
|
|
9510
|
+
onInput: E
|
|
9513
9511
|
}, h.inputProps), null, 16)), [
|
|
9514
9512
|
[
|
|
9515
9513
|
t2,
|