intl-tel-input 23.0.5 → 23.0.7
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 +3 -3
- package/build/js/data.js +1 -1
- package/build/js/data.min.js +1 -1
- package/build/js/intlTelInput.js +2 -2
- package/build/js/intlTelInput.min.js +2 -2
- package/build/js/intlTelInputWithUtils.js +110 -199
- package/build/js/intlTelInputWithUtils.min.js +2 -2
- package/package.json +3 -3
- package/react/build/IntlTelInput.cjs +17 -5
- package/react/build/IntlTelInput.d.ts +10 -4
- package/react/build/IntlTelInput.js +18 -6
- package/react/build/IntlTelInputWithUtils.cjs +125 -202
- package/react/build/IntlTelInputWithUtils.js +126 -203
|
@@ -29,7 +29,8 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
29
29
|
// react/src/intl-tel-input/reactWithUtils.tsx
|
|
30
30
|
var reactWithUtils_exports = {};
|
|
31
31
|
__export(reactWithUtils_exports, {
|
|
32
|
-
default: () => reactWithUtils_default
|
|
32
|
+
default: () => reactWithUtils_default,
|
|
33
|
+
intlTelInput: () => intlTelInputWithUtils_default
|
|
33
34
|
});
|
|
34
35
|
module.exports = __toCommonJS(reactWithUtils_exports);
|
|
35
36
|
|
|
@@ -2773,7 +2774,7 @@ var intlTelInput = Object.assign(
|
|
|
2773
2774
|
//* A map from instance ID to instance object.
|
|
2774
2775
|
instances: {},
|
|
2775
2776
|
loadUtils,
|
|
2776
|
-
version: "23.0.
|
|
2777
|
+
version: "23.0.7"
|
|
2777
2778
|
}
|
|
2778
2779
|
);
|
|
2779
2780
|
var intl_tel_input_default = intlTelInput;
|
|
@@ -2785,8 +2786,7 @@ var intl_tel_input_default = intlTelInput;
|
|
|
2785
2786
|
a = a.split(".");
|
|
2786
2787
|
var c = k;
|
|
2787
2788
|
a[0] in c || "undefined" == typeof c.execScript || c.execScript("var " + a[0]);
|
|
2788
|
-
for (var d; a.length && (d = a.shift()); )
|
|
2789
|
-
a.length || void 0 === b ? c[d] && c[d] !== Object.prototype[d] ? c = c[d] : c = c[d] = {} : c[d] = b;
|
|
2789
|
+
for (var d; a.length && (d = a.shift()); ) a.length || void 0 === b ? c[d] && c[d] !== Object.prototype[d] ? c = c[d] : c = c[d] = {} : c[d] = b;
|
|
2790
2790
|
}
|
|
2791
2791
|
function n(a, b) {
|
|
2792
2792
|
function c() {
|
|
@@ -2796,8 +2796,7 @@ var intl_tel_input_default = intlTelInput;
|
|
|
2796
2796
|
a.prototype = new c();
|
|
2797
2797
|
a.prototype.constructor = a;
|
|
2798
2798
|
a.sa = function(d, e, f) {
|
|
2799
|
-
for (var g = Array(arguments.length - 2), h = 2; h < arguments.length; h++)
|
|
2800
|
-
g[h - 2] = arguments[h];
|
|
2799
|
+
for (var g = Array(arguments.length - 2), h = 2; h < arguments.length; h++) g[h - 2] = arguments[h];
|
|
2801
2800
|
return b.prototype[e].apply(d, g);
|
|
2802
2801
|
};
|
|
2803
2802
|
}
|
|
@@ -2805,15 +2804,13 @@ var intl_tel_input_default = intlTelInput;
|
|
|
2805
2804
|
function aa(a) {
|
|
2806
2805
|
const b = [];
|
|
2807
2806
|
let c = 0;
|
|
2808
|
-
for (const d in a)
|
|
2809
|
-
b[c++] = a[d];
|
|
2807
|
+
for (const d in a) b[c++] = a[d];
|
|
2810
2808
|
return b;
|
|
2811
2809
|
}
|
|
2812
2810
|
;
|
|
2813
2811
|
var da = class {
|
|
2814
2812
|
constructor(a) {
|
|
2815
|
-
if (ba !== ba)
|
|
2816
|
-
throw Error("SafeUrl is not meant to be built directly");
|
|
2813
|
+
if (ba !== ba) throw Error("SafeUrl is not meant to be built directly");
|
|
2817
2814
|
this.g = a;
|
|
2818
2815
|
}
|
|
2819
2816
|
toString() {
|
|
@@ -2825,8 +2822,7 @@ var intl_tel_input_default = intlTelInput;
|
|
|
2825
2822
|
const ea = {};
|
|
2826
2823
|
class fa {
|
|
2827
2824
|
constructor() {
|
|
2828
|
-
if (ea !== ea)
|
|
2829
|
-
throw Error("SafeStyle is not meant to be built directly");
|
|
2825
|
+
if (ea !== ea) throw Error("SafeStyle is not meant to be built directly");
|
|
2830
2826
|
}
|
|
2831
2827
|
toString() {
|
|
2832
2828
|
return "".toString();
|
|
@@ -2836,8 +2832,7 @@ var intl_tel_input_default = intlTelInput;
|
|
|
2836
2832
|
const ha = {};
|
|
2837
2833
|
class ia {
|
|
2838
2834
|
constructor() {
|
|
2839
|
-
if (ha !== ha)
|
|
2840
|
-
throw Error("SafeStyleSheet is not meant to be built directly");
|
|
2835
|
+
if (ha !== ha) throw Error("SafeStyleSheet is not meant to be built directly");
|
|
2841
2836
|
}
|
|
2842
2837
|
toString() {
|
|
2843
2838
|
return "".toString();
|
|
@@ -2848,8 +2843,7 @@ var intl_tel_input_default = intlTelInput;
|
|
|
2848
2843
|
class ka {
|
|
2849
2844
|
constructor() {
|
|
2850
2845
|
var a = k.trustedTypes && k.trustedTypes.emptyHTML || "";
|
|
2851
|
-
if (ja !== ja)
|
|
2852
|
-
throw Error("SafeHtml is not meant to be built directly");
|
|
2846
|
+
if (ja !== ja) throw Error("SafeHtml is not meant to be built directly");
|
|
2853
2847
|
this.g = a;
|
|
2854
2848
|
}
|
|
2855
2849
|
toString() {
|
|
@@ -2917,10 +2911,8 @@ var intl_tel_input_default = intlTelInput;
|
|
|
2917
2911
|
var g = 11 == e.h || 10 == e.h;
|
|
2918
2912
|
if (e.l) {
|
|
2919
2913
|
e = u(b, f);
|
|
2920
|
-
for (var h = 0; h < e.length; h++)
|
|
2921
|
-
|
|
2922
|
-
} else
|
|
2923
|
-
e = v(b, f), g ? (g = v(a, f)) ? wa(g, e) : t(a, f, e.clone()) : t(a, f, e);
|
|
2914
|
+
for (var h = 0; h < e.length; h++) va(a, f, g ? e[h].clone() : e[h]);
|
|
2915
|
+
} else e = v(b, f), g ? (g = v(a, f)) ? wa(g, e) : t(a, f, e.clone()) : t(a, f, e);
|
|
2924
2916
|
}
|
|
2925
2917
|
}
|
|
2926
2918
|
}
|
|
@@ -2934,18 +2926,14 @@ var intl_tel_input_default = intlTelInput;
|
|
|
2934
2926
|
}
|
|
2935
2927
|
function v(a, b) {
|
|
2936
2928
|
var c = a.h[b];
|
|
2937
|
-
if (null == c)
|
|
2938
|
-
return null;
|
|
2929
|
+
if (null == c) return null;
|
|
2939
2930
|
if (a.l) {
|
|
2940
2931
|
if (!(b in a.g)) {
|
|
2941
2932
|
var d = a.l, e = a.j[b];
|
|
2942
|
-
if (null != c)
|
|
2943
|
-
|
|
2944
|
-
|
|
2945
|
-
|
|
2946
|
-
c = f;
|
|
2947
|
-
} else
|
|
2948
|
-
c = d.h(e, c);
|
|
2933
|
+
if (null != c) if (e.l) {
|
|
2934
|
+
for (var f = [], g = 0; g < c.length; g++) f[g] = d.h(e, c[g]);
|
|
2935
|
+
c = f;
|
|
2936
|
+
} else c = d.h(e, c);
|
|
2949
2937
|
return a.g[b] = c;
|
|
2950
2938
|
}
|
|
2951
2939
|
return a.g[b];
|
|
@@ -2957,24 +2945,18 @@ var intl_tel_input_default = intlTelInput;
|
|
|
2957
2945
|
return a.j[b].l ? d[c || 0] : d;
|
|
2958
2946
|
}
|
|
2959
2947
|
function w(a, b) {
|
|
2960
|
-
if (q(a, b))
|
|
2961
|
-
|
|
2962
|
-
|
|
2963
|
-
a
|
|
2964
|
-
|
|
2965
|
-
|
|
2966
|
-
|
|
2967
|
-
|
|
2968
|
-
|
|
2969
|
-
a.j = 0;
|
|
2970
|
-
else if (b === String)
|
|
2971
|
-
a.j = a.o ? "0" : "";
|
|
2972
|
-
else {
|
|
2973
|
-
a = new b();
|
|
2974
|
-
break a;
|
|
2975
|
-
}
|
|
2976
|
-
a = a.j;
|
|
2948
|
+
if (q(a, b)) a = r(a, b);
|
|
2949
|
+
else a: {
|
|
2950
|
+
a = a.j[b];
|
|
2951
|
+
if (void 0 === a.j) if (b = a.s, b === Boolean) a.j = false;
|
|
2952
|
+
else if (b === Number) a.j = 0;
|
|
2953
|
+
else if (b === String) a.j = a.o ? "0" : "";
|
|
2954
|
+
else {
|
|
2955
|
+
a = new b();
|
|
2956
|
+
break a;
|
|
2977
2957
|
}
|
|
2958
|
+
a = a.j;
|
|
2959
|
+
}
|
|
2978
2960
|
return a;
|
|
2979
2961
|
}
|
|
2980
2962
|
function u(a, b) {
|
|
@@ -2994,8 +2976,7 @@ var intl_tel_input_default = intlTelInput;
|
|
|
2994
2976
|
}
|
|
2995
2977
|
function y(a, b) {
|
|
2996
2978
|
var c = [], d;
|
|
2997
|
-
for (d in b)
|
|
2998
|
-
0 != d && c.push(new la(d, b[d]));
|
|
2979
|
+
for (d in b) 0 != d && c.push(new la(d, b[d]));
|
|
2999
2980
|
return new ta(a, c);
|
|
3000
2981
|
}
|
|
3001
2982
|
;
|
|
@@ -3006,18 +2987,13 @@ var intl_tel_input_default = intlTelInput;
|
|
|
3006
2987
|
throw Error("Unimplemented");
|
|
3007
2988
|
};
|
|
3008
2989
|
z.prototype.h = function(a, b) {
|
|
3009
|
-
if (11 == a.h || 10 == a.h)
|
|
3010
|
-
|
|
3011
|
-
if (
|
|
3012
|
-
return "string" === typeof b && xa.test(b) && (a = Number(b), 0 < a) ? a : b;
|
|
3013
|
-
if (!a.o)
|
|
3014
|
-
return b;
|
|
2990
|
+
if (11 == a.h || 10 == a.h) return b instanceof p ? b : this.g(a.s.prototype.m(), b);
|
|
2991
|
+
if (14 == a.h) return "string" === typeof b && xa.test(b) && (a = Number(b), 0 < a) ? a : b;
|
|
2992
|
+
if (!a.o) return b;
|
|
3015
2993
|
a = a.s;
|
|
3016
2994
|
if (a === String) {
|
|
3017
|
-
if ("number" === typeof b)
|
|
3018
|
-
|
|
3019
|
-
} else if (a === Number && "string" === typeof b && ("Infinity" === b || "-Infinity" === b || "NaN" === b || xa.test(b)))
|
|
3020
|
-
return Number(b);
|
|
2995
|
+
if ("number" === typeof b) return String(b);
|
|
2996
|
+
} else if (a === Number && "string" === typeof b && ("Infinity" === b || "-Infinity" === b || "NaN" === b || xa.test(b))) return Number(b);
|
|
3021
2997
|
return b;
|
|
3022
2998
|
};
|
|
3023
2999
|
var xa = /^-?[0-9]+$/;
|
|
@@ -3049,9 +3025,7 @@ var intl_tel_input_default = intlTelInput;
|
|
|
3049
3025
|
};
|
|
3050
3026
|
D.prototype.g = function(a, b, c) {
|
|
3051
3027
|
this.h += String(a);
|
|
3052
|
-
if (null != b)
|
|
3053
|
-
for (let d = 1; d < arguments.length; d++)
|
|
3054
|
-
this.h += arguments[d];
|
|
3028
|
+
if (null != b) for (let d = 1; d < arguments.length; d++) this.h += arguments[d];
|
|
3055
3029
|
return this;
|
|
3056
3030
|
};
|
|
3057
3031
|
function E(a) {
|
|
@@ -8437,8 +8411,7 @@ var intl_tel_input_default = intlTelInput;
|
|
|
8437
8411
|
return null != a && (1 != x(a, 9) || -1 != u(a, 9)[0]);
|
|
8438
8412
|
}
|
|
8439
8413
|
function O(a, b) {
|
|
8440
|
-
for (var c = new D(), d, e = a.length, f = 0; f < e; ++f)
|
|
8441
|
-
d = a.charAt(f), d = b[d.toUpperCase()], null != d && c.g(d);
|
|
8414
|
+
for (var c = new D(), d, e = a.length, f = 0; f < e; ++f) d = a.charAt(f), d = b[d.toUpperCase()], null != d && c.g(d);
|
|
8442
8415
|
return c.toString();
|
|
8443
8416
|
}
|
|
8444
8417
|
function Ya(a) {
|
|
@@ -8450,15 +8423,12 @@ var intl_tel_input_default = intlTelInput;
|
|
|
8450
8423
|
K.prototype.format = function(a, b) {
|
|
8451
8424
|
if (0 == r(a, 2) && q(a, 5)) {
|
|
8452
8425
|
var c = w(a, 5);
|
|
8453
|
-
if (0 < c.length)
|
|
8454
|
-
return c;
|
|
8426
|
+
if (0 < c.length) return c;
|
|
8455
8427
|
}
|
|
8456
8428
|
c = w(a, 1);
|
|
8457
8429
|
var d = Q(a);
|
|
8458
|
-
if (0 == b)
|
|
8459
|
-
|
|
8460
|
-
if (!(c in J))
|
|
8461
|
-
return d;
|
|
8430
|
+
if (0 == b) return Za(c, 0, d, "");
|
|
8431
|
+
if (!(c in J)) return d;
|
|
8462
8432
|
var e = R(this, c, S(c));
|
|
8463
8433
|
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) : "";
|
|
8464
8434
|
a: {
|
|
@@ -8485,8 +8455,7 @@ var intl_tel_input_default = intlTelInput;
|
|
|
8485
8455
|
return "001" == c ? T(a, "" + b) : T(a, c);
|
|
8486
8456
|
}
|
|
8487
8457
|
function Q(a) {
|
|
8488
|
-
if (!q(a, 2))
|
|
8489
|
-
return "";
|
|
8458
|
+
if (!q(a, 2)) return "";
|
|
8490
8459
|
var b = "" + r(a, 2);
|
|
8491
8460
|
return q(a, 4) && r(a, 4) && 0 < w(a, 8) ? Array(w(a, 8) + 1).join("0") + b : b;
|
|
8492
8461
|
}
|
|
@@ -8533,14 +8502,12 @@ var intl_tel_input_default = intlTelInput;
|
|
|
8533
8502
|
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;
|
|
8534
8503
|
}
|
|
8535
8504
|
function T(a, b) {
|
|
8536
|
-
if (null == b)
|
|
8537
|
-
return null;
|
|
8505
|
+
if (null == b) return null;
|
|
8538
8506
|
b = b.toUpperCase();
|
|
8539
8507
|
var c = a.g[b];
|
|
8540
8508
|
if (null == c) {
|
|
8541
8509
|
c = Da[b];
|
|
8542
|
-
if (null == c)
|
|
8543
|
-
return null;
|
|
8510
|
+
if (null == c) return null;
|
|
8544
8511
|
c = new C().g(H.m(), c);
|
|
8545
8512
|
a.g[b] = c;
|
|
8546
8513
|
}
|
|
@@ -8551,32 +8518,28 @@ var intl_tel_input_default = intlTelInput;
|
|
|
8551
8518
|
return 0 < x(b, 9) && -1 == u(b, 9).indexOf(c) ? false : N(w(b, 2), a);
|
|
8552
8519
|
}
|
|
8553
8520
|
function ab(a, b) {
|
|
8554
|
-
if (null == b)
|
|
8555
|
-
return null;
|
|
8521
|
+
if (null == b) return null;
|
|
8556
8522
|
var c = w(b, 1);
|
|
8557
8523
|
c = J[c];
|
|
8558
|
-
if (null == c)
|
|
8559
|
-
|
|
8560
|
-
else
|
|
8561
|
-
|
|
8562
|
-
|
|
8563
|
-
|
|
8564
|
-
|
|
8565
|
-
|
|
8566
|
-
|
|
8567
|
-
var g = T(a, d);
|
|
8568
|
-
if (q(g, 23)) {
|
|
8569
|
-
if (0 == b.search(r(g, 23))) {
|
|
8570
|
-
a = d;
|
|
8571
|
-
break a;
|
|
8572
|
-
}
|
|
8573
|
-
} else if (-1 != $a(b, g)) {
|
|
8524
|
+
if (null == c) a = null;
|
|
8525
|
+
else if (1 == c.length) a = c[0];
|
|
8526
|
+
else a: {
|
|
8527
|
+
b = Q(b);
|
|
8528
|
+
for (var d, e = c.length, f = 0; f < e; f++) {
|
|
8529
|
+
d = c[f];
|
|
8530
|
+
var g = T(a, d);
|
|
8531
|
+
if (q(g, 23)) {
|
|
8532
|
+
if (0 == b.search(r(g, 23))) {
|
|
8574
8533
|
a = d;
|
|
8575
8534
|
break a;
|
|
8576
8535
|
}
|
|
8536
|
+
} else if (-1 != $a(b, g)) {
|
|
8537
|
+
a = d;
|
|
8538
|
+
break a;
|
|
8577
8539
|
}
|
|
8578
|
-
a = null;
|
|
8579
8540
|
}
|
|
8541
|
+
a = null;
|
|
8542
|
+
}
|
|
8580
8543
|
return a;
|
|
8581
8544
|
}
|
|
8582
8545
|
function S(a) {
|
|
@@ -8585,55 +8548,42 @@ var intl_tel_input_default = intlTelInput;
|
|
|
8585
8548
|
}
|
|
8586
8549
|
function bb(a, b) {
|
|
8587
8550
|
a = T(a, b);
|
|
8588
|
-
if (null == a)
|
|
8589
|
-
throw Error("Invalid region code: " + b);
|
|
8551
|
+
if (null == a) throw Error("Invalid region code: " + b);
|
|
8590
8552
|
return w(a, 10);
|
|
8591
8553
|
}
|
|
8592
8554
|
function W(a, b, c, d) {
|
|
8593
8555
|
var e = U(c, d), f = 0 == x(e, 9) ? u(r(c, 1), 9) : u(e, 9);
|
|
8594
8556
|
e = u(e, 10);
|
|
8595
|
-
if (2 == d)
|
|
8596
|
-
|
|
8597
|
-
|
|
8598
|
-
else
|
|
8599
|
-
return W(a, b, c, 1);
|
|
8600
|
-
if (-1 == f[0])
|
|
8601
|
-
return 5;
|
|
8557
|
+
if (2 == d) if (Xa(U(c, 0))) 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()));
|
|
8558
|
+
else return W(a, b, c, 1);
|
|
8559
|
+
if (-1 == f[0]) return 5;
|
|
8602
8560
|
b = b.length;
|
|
8603
|
-
if (-1 < e.indexOf(b))
|
|
8604
|
-
return 4;
|
|
8561
|
+
if (-1 < e.indexOf(b)) return 4;
|
|
8605
8562
|
c = f[0];
|
|
8606
8563
|
return c == b ? 0 : c > b ? 2 : f[f.length - 1] < b ? 3 : -1 < f.indexOf(b, 1) ? 0 : 5;
|
|
8607
8564
|
}
|
|
8608
8565
|
function X(a, b, c) {
|
|
8609
8566
|
var d = Q(b);
|
|
8610
8567
|
b = w(b, 1);
|
|
8611
|
-
if (!(b in J))
|
|
8612
|
-
return 1;
|
|
8568
|
+
if (!(b in J)) return 1;
|
|
8613
8569
|
b = R(a, b, S(b));
|
|
8614
8570
|
return W(a, d, b, c);
|
|
8615
8571
|
}
|
|
8616
8572
|
function cb(a, b) {
|
|
8617
8573
|
a = a.toString();
|
|
8618
|
-
if (0 == a.length || "0" == a.charAt(0))
|
|
8619
|
-
|
|
8620
|
-
for (var c, d = a.length, e = 1; 3 >= e && e <= d; ++e)
|
|
8621
|
-
if (c = parseInt(a.substring(0, e), 10), c in J)
|
|
8622
|
-
return b.g(a.substring(e)), c;
|
|
8574
|
+
if (0 == a.length || "0" == a.charAt(0)) return 0;
|
|
8575
|
+
for (var c, d = a.length, e = 1; 3 >= e && e <= d; ++e) if (c = parseInt(a.substring(0, e), 10), c in J) return b.g(a.substring(e)), c;
|
|
8623
8576
|
return 0;
|
|
8624
8577
|
}
|
|
8625
8578
|
function db(a, b, c, d, e, f) {
|
|
8626
|
-
if (0 == b.length)
|
|
8627
|
-
return 0;
|
|
8579
|
+
if (0 == b.length) return 0;
|
|
8628
8580
|
b = new D(b);
|
|
8629
8581
|
var g;
|
|
8630
8582
|
null != c && (g = r(c, 11));
|
|
8631
8583
|
null == g && (g = "NonMatch");
|
|
8632
8584
|
var h = b.toString();
|
|
8633
|
-
if (0 == h.length)
|
|
8634
|
-
|
|
8635
|
-
else if (L.test(h))
|
|
8636
|
-
h = h.replace(L, ""), E(b), b.g(Va(h)), g = 1;
|
|
8585
|
+
if (0 == h.length) g = 20;
|
|
8586
|
+
else if (L.test(h)) h = h.replace(L, ""), E(b), b.g(Va(h)), g = 1;
|
|
8637
8587
|
else {
|
|
8638
8588
|
h = new RegExp(g);
|
|
8639
8589
|
Wa(b);
|
|
@@ -8642,21 +8592,17 @@ var intl_tel_input_default = intlTelInput;
|
|
|
8642
8592
|
h = g.match(h)[0].length;
|
|
8643
8593
|
var l = g.substring(h).match(Ia);
|
|
8644
8594
|
l && null != l[1] && 0 < l[1].length && "0" == O(l[1], Ea) ? g = false : (E(b), b.g(g.substring(h)), g = true);
|
|
8645
|
-
} else
|
|
8646
|
-
g = false;
|
|
8595
|
+
} else g = false;
|
|
8647
8596
|
g = g ? 5 : 20;
|
|
8648
8597
|
}
|
|
8649
8598
|
e && t(f, 6, g);
|
|
8650
8599
|
if (20 != g) {
|
|
8651
|
-
if (2 >= b.h.length)
|
|
8652
|
-
throw Error("Phone number too short after IDD");
|
|
8600
|
+
if (2 >= b.h.length) throw Error("Phone number too short after IDD");
|
|
8653
8601
|
a = cb(b, d);
|
|
8654
|
-
if (0 != a)
|
|
8655
|
-
return t(f, 1, a), a;
|
|
8602
|
+
if (0 != a) return t(f, 1, a), a;
|
|
8656
8603
|
throw Error("Invalid country calling code");
|
|
8657
8604
|
}
|
|
8658
|
-
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)), eb(h, c, null), h = h.toString(), !N(l, b.toString()) && N(l, h) || 3 == W(a, b.toString(), c, -1))))
|
|
8659
|
-
return d.g(h), e && t(f, 6, 10), t(f, 1, g), g;
|
|
8605
|
+
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)), eb(h, c, null), h = h.toString(), !N(l, b.toString()) && N(l, h) || 3 == W(a, b.toString(), c, -1)))) return d.g(h), e && t(f, 6, 10), t(f, 1, g), g;
|
|
8660
8606
|
t(f, 1, 0);
|
|
8661
8607
|
return 0;
|
|
8662
8608
|
}
|
|
@@ -8669,46 +8615,36 @@ var intl_tel_input_default = intlTelInput;
|
|
|
8669
8615
|
var h = N(f, d), l = e.length - 1;
|
|
8670
8616
|
b = r(b, 16);
|
|
8671
8617
|
if (null == b || 0 == b.length || null == e[l] || 0 == e[l].length) {
|
|
8672
|
-
if (!h || N(f, d.substring(e[0].length)))
|
|
8673
|
-
|
|
8674
|
-
} else if (d = d.replace(g, b), !h || N(f, d))
|
|
8675
|
-
null != c && 0 < l && c.g(e[1]), a.set(d);
|
|
8618
|
+
if (!h || N(f, d.substring(e[0].length))) null != c && 0 < l && null != e[l] && c.g(e[1]), a.set(d.substring(e[0].length));
|
|
8619
|
+
} else if (d = d.replace(g, b), !h || N(f, d)) null != c && 0 < l && c.g(e[1]), a.set(d);
|
|
8676
8620
|
}
|
|
8677
8621
|
}
|
|
8678
8622
|
}
|
|
8679
8623
|
function Y(a, b, c) {
|
|
8680
|
-
if (!P(c) && 0 < b.length && "+" != b.charAt(0))
|
|
8681
|
-
throw Error("Invalid country calling code");
|
|
8624
|
+
if (!P(c) && 0 < b.length && "+" != b.charAt(0)) throw Error("Invalid country calling code");
|
|
8682
8625
|
return fb(a, b, c, true);
|
|
8683
8626
|
}
|
|
8684
8627
|
function fb(a, b, c, d) {
|
|
8685
|
-
if (null == b)
|
|
8686
|
-
|
|
8687
|
-
if (250 < b.length)
|
|
8688
|
-
throw Error("The string supplied is too long to be a phone number");
|
|
8628
|
+
if (null == b) throw Error("The string supplied did not seem to be a phone number");
|
|
8629
|
+
if (250 < b.length) throw Error("The string supplied is too long to be a phone number");
|
|
8689
8630
|
var e = new D();
|
|
8690
8631
|
var f = b.indexOf(";phone-context=");
|
|
8691
|
-
if (-1 === f)
|
|
8692
|
-
|
|
8693
|
-
else if (f += 15, f >= b.length)
|
|
8694
|
-
f = "";
|
|
8632
|
+
if (-1 === f) f = null;
|
|
8633
|
+
else if (f += 15, f >= b.length) f = "";
|
|
8695
8634
|
else {
|
|
8696
8635
|
var g = b.indexOf(";", f);
|
|
8697
8636
|
f = -1 !== g ? b.substring(f, g) : b.substring(f);
|
|
8698
8637
|
}
|
|
8699
8638
|
var h = f;
|
|
8700
8639
|
null == h ? g = true : 0 === h.length ? g = false : (g = Na.exec(h), h = Oa.exec(h), g = null !== g || null !== h);
|
|
8701
|
-
if (!g)
|
|
8702
|
-
throw Error("The string supplied did not seem to be a phone number");
|
|
8640
|
+
if (!g) throw Error("The string supplied did not seem to be a phone number");
|
|
8703
8641
|
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 ?? "", 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));
|
|
8704
8642
|
f = e.toString();
|
|
8705
8643
|
g = f.indexOf(";isub=");
|
|
8706
8644
|
0 < g && (E(e), e.g(f.substring(0, g)));
|
|
8707
|
-
if (!Ua(e.toString()))
|
|
8708
|
-
throw Error("The string supplied did not seem to be a phone number");
|
|
8645
|
+
if (!Ua(e.toString())) throw Error("The string supplied did not seem to be a phone number");
|
|
8709
8646
|
f = e.toString();
|
|
8710
|
-
if (!(P(c) || null != f && 0 < f.length && L.test(f)))
|
|
8711
|
-
throw Error("Invalid country calling code");
|
|
8647
|
+
if (!(P(c) || null != f && 0 < f.length && L.test(f))) throw Error("Invalid country calling code");
|
|
8712
8648
|
f = new I();
|
|
8713
8649
|
d && t(f, 5, b);
|
|
8714
8650
|
a: {
|
|
@@ -8716,13 +8652,12 @@ var intl_tel_input_default = intlTelInput;
|
|
|
8716
8652
|
g = b.search(Qa);
|
|
8717
8653
|
if (0 <= g && Ua(b.substring(0, g))) {
|
|
8718
8654
|
h = b.match(Qa);
|
|
8719
|
-
for (var l = h.length, A = 1; A < l; ++A)
|
|
8720
|
-
|
|
8721
|
-
|
|
8722
|
-
|
|
8723
|
-
|
|
8724
|
-
|
|
8725
|
-
}
|
|
8655
|
+
for (var l = h.length, A = 1; A < l; ++A) if (null != h[A] && 0 < h[A].length) {
|
|
8656
|
+
E(e);
|
|
8657
|
+
e.g(b.substring(0, g));
|
|
8658
|
+
b = h[A];
|
|
8659
|
+
break a;
|
|
8660
|
+
}
|
|
8726
8661
|
}
|
|
8727
8662
|
b = "";
|
|
8728
8663
|
}
|
|
@@ -8735,29 +8670,23 @@ var intl_tel_input_default = intlTelInput;
|
|
|
8735
8670
|
h = db(a, l, g, b, d, f);
|
|
8736
8671
|
} catch (ca) {
|
|
8737
8672
|
if ("Invalid country calling code" == ca.message && L.test(l)) {
|
|
8738
|
-
if (l = l.replace(L, ""), h = db(a, l, g, b, d, f), 0 == h)
|
|
8739
|
-
|
|
8740
|
-
} else
|
|
8741
|
-
throw ca;
|
|
8673
|
+
if (l = l.replace(L, ""), h = db(a, l, g, b, d, f), 0 == h) throw ca;
|
|
8674
|
+
} else throw ca;
|
|
8742
8675
|
}
|
|
8743
8676
|
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(
|
|
8744
8677
|
f,
|
|
8745
8678
|
1,
|
|
8746
8679
|
h
|
|
8747
8680
|
)) : d && (delete f.h[6], f.g && delete f.g[6]));
|
|
8748
|
-
if (2 > b.h.length)
|
|
8749
|
-
throw Error("The string supplied is too short to be a phone number");
|
|
8681
|
+
if (2 > b.h.length) throw Error("The string supplied is too short to be a phone number");
|
|
8750
8682
|
null != g && (c = new D(), e = new D(b.toString()), eb(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())));
|
|
8751
8683
|
d = b.toString();
|
|
8752
8684
|
a = d.length;
|
|
8753
|
-
if (2 > a)
|
|
8754
|
-
|
|
8755
|
-
if (17 < a)
|
|
8756
|
-
throw Error("The string supplied is too long to be a phone number");
|
|
8685
|
+
if (2 > a) throw Error("The string supplied is too short to be a phone number");
|
|
8686
|
+
if (17 < a) throw Error("The string supplied is too long to be a phone number");
|
|
8757
8687
|
if (1 < d.length && "0" == d.charAt(0)) {
|
|
8758
8688
|
t(f, 4, true);
|
|
8759
|
-
for (a = 1; a < d.length - 1 && "0" == d.charAt(a); )
|
|
8760
|
-
a++;
|
|
8689
|
+
for (a = 1; a < d.length - 1 && "0" == d.charAt(a); ) a++;
|
|
8761
8690
|
1 != a && t(f, 8, a);
|
|
8762
8691
|
}
|
|
8763
8692
|
t(f, 2, parseInt(d, 10));
|
|
@@ -8798,8 +8727,7 @@ var intl_tel_input_default = intlTelInput;
|
|
|
8798
8727
|
function lb(a) {
|
|
8799
8728
|
for (var b = a.j.length, c = 0; c < b; ++c) {
|
|
8800
8729
|
var d = a.j[c], e = w(d, 1);
|
|
8801
|
-
if (a.da == e)
|
|
8802
|
-
return false;
|
|
8730
|
+
if (a.da == e) return false;
|
|
8803
8731
|
var f = a;
|
|
8804
8732
|
var g = d, h = w(g, 1);
|
|
8805
8733
|
E(f.v);
|
|
@@ -8808,8 +8736,7 @@ var intl_tel_input_default = intlTelInput;
|
|
|
8808
8736
|
var A = "999999999999999".match(h)[0];
|
|
8809
8737
|
A.length < l.g.h.length ? l = "" : (l = A.replace(new RegExp(h, "g"), g), l = l.replace(RegExp("9", "g"), "\u2008"));
|
|
8810
8738
|
0 < l.length ? (f.v.g(l), f = true) : f = false;
|
|
8811
|
-
if (f)
|
|
8812
|
-
return a.da = e, a.ha = kb.test(r(d, 4)), a.$ = 0, true;
|
|
8739
|
+
if (f) return a.da = e, a.ha = kb.test(r(d, 4)), a.$ = 0, true;
|
|
8813
8740
|
}
|
|
8814
8741
|
return a.u = false;
|
|
8815
8742
|
}
|
|
@@ -8827,10 +8754,8 @@ var intl_tel_input_default = intlTelInput;
|
|
|
8827
8754
|
if (!a.u) {
|
|
8828
8755
|
if (!a.la) {
|
|
8829
8756
|
if (ob(a)) {
|
|
8830
|
-
if (pb(a))
|
|
8831
|
-
|
|
8832
|
-
} 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 != rb(a))
|
|
8833
|
-
return a.h.g(" "), qb(a);
|
|
8757
|
+
if (pb(a)) return qb(a);
|
|
8758
|
+
} 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 != rb(a)) return a.h.g(" "), qb(a);
|
|
8834
8759
|
}
|
|
8835
8760
|
return a.s.toString();
|
|
8836
8761
|
}
|
|
@@ -8840,18 +8765,14 @@ var intl_tel_input_default = intlTelInput;
|
|
|
8840
8765
|
case 2:
|
|
8841
8766
|
return a.s.toString();
|
|
8842
8767
|
case 3:
|
|
8843
|
-
if (ob(a))
|
|
8844
|
-
|
|
8845
|
-
else
|
|
8846
|
-
return a.o = rb(a), sb(a);
|
|
8768
|
+
if (ob(a)) a.ea = true;
|
|
8769
|
+
else return a.o = rb(a), sb(a);
|
|
8847
8770
|
default:
|
|
8848
|
-
if (a.ea)
|
|
8849
|
-
return pb(a) && (a.ea = false), a.h.toString() + a.g.toString();
|
|
8771
|
+
if (a.ea) return pb(a) && (a.ea = false), a.h.toString() + a.g.toString();
|
|
8850
8772
|
if (0 < a.j.length) {
|
|
8851
8773
|
b = tb(a, b);
|
|
8852
8774
|
c = ub(a);
|
|
8853
|
-
if (0 < c.length)
|
|
8854
|
-
return c;
|
|
8775
|
+
if (0 < c.length) return c;
|
|
8855
8776
|
mb(a, a.g.toString());
|
|
8856
8777
|
return lb(a) ? vb(a) : a.u ? Z(a, b) : a.s.toString();
|
|
8857
8778
|
}
|
|
@@ -8870,8 +8791,7 @@ var intl_tel_input_default = intlTelInput;
|
|
|
8870
8791
|
function ub(a) {
|
|
8871
8792
|
for (var b = a.g.toString(), c = a.j.length, d = 0; d < c; ++d) {
|
|
8872
8793
|
var e = a.j[d], f = w(e, 1);
|
|
8873
|
-
if (new RegExp("^(?:" + f + ")$").test(b) && (a.ha = kb.test(r(e, 4)), e = b.replace(new RegExp(f, "g"), r(e, 2)), e = Z(a, e), O(e, Fa) == a.ba))
|
|
8874
|
-
return e;
|
|
8794
|
+
if (new RegExp("^(?:" + f + ")$").test(b) && (a.ha = kb.test(r(e, 4)), e = b.replace(new RegExp(f, "g"), r(e, 2)), e = Z(a, e), O(e, Fa) == a.ba)) return e;
|
|
8875
8795
|
}
|
|
8876
8796
|
return "";
|
|
8877
8797
|
}
|
|
@@ -8895,18 +8815,15 @@ var intl_tel_input_default = intlTelInput;
|
|
|
8895
8815
|
function vb(a) {
|
|
8896
8816
|
var b = a.g.toString(), c = b.length;
|
|
8897
8817
|
if (0 < c) {
|
|
8898
|
-
for (var d = "", e = 0; e < c; e++)
|
|
8899
|
-
d = tb(a, b.charAt(e));
|
|
8818
|
+
for (var d = "", e = 0; e < c; e++) d = tb(a, b.charAt(e));
|
|
8900
8819
|
return a.u ? Z(a, d) : a.s.toString();
|
|
8901
8820
|
}
|
|
8902
8821
|
return a.h.toString();
|
|
8903
8822
|
}
|
|
8904
8823
|
function rb(a) {
|
|
8905
8824
|
var b = a.g.toString(), c = 0;
|
|
8906
|
-
if (1 != r(a.l, 10))
|
|
8907
|
-
|
|
8908
|
-
else
|
|
8909
|
-
d = a.g.toString(), d = "1" == d.charAt(0) && "0" != d.charAt(1) && "1" != d.charAt(1);
|
|
8825
|
+
if (1 != r(a.l, 10)) var d = false;
|
|
8826
|
+
else d = a.g.toString(), d = "1" == d.charAt(0) && "0" != d.charAt(1) && "1" != d.charAt(1);
|
|
8910
8827
|
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))));
|
|
8911
8828
|
E(a.g);
|
|
8912
8829
|
a.g.g(b.substring(c));
|
|
@@ -8918,11 +8835,9 @@ var intl_tel_input_default = intlTelInput;
|
|
|
8918
8835
|
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;
|
|
8919
8836
|
}
|
|
8920
8837
|
function pb(a) {
|
|
8921
|
-
if (0 == a.g.h.length)
|
|
8922
|
-
return false;
|
|
8838
|
+
if (0 == a.g.h.length) return false;
|
|
8923
8839
|
var b = new D(), c = cb(a.g, b);
|
|
8924
|
-
if (0 == c)
|
|
8925
|
-
return false;
|
|
8840
|
+
if (0 == c) return false;
|
|
8926
8841
|
E(a.g);
|
|
8927
8842
|
a.g.g(b.toString());
|
|
8928
8843
|
b = S(c);
|
|
@@ -8952,8 +8867,7 @@ var intl_tel_input_default = intlTelInput;
|
|
|
8952
8867
|
try {
|
|
8953
8868
|
const c = a.replace(/[^+0-9]/g, ""), d = new gb(b);
|
|
8954
8869
|
b = "";
|
|
8955
|
-
for (let e = 0; e < c.length; e++)
|
|
8956
|
-
d.ja = nb(d, c.charAt(e)), b = d.ja;
|
|
8870
|
+
for (let e = 0; e < c.length; e++) d.ja = nb(d, c.charAt(e)), b = d.ja;
|
|
8957
8871
|
return b;
|
|
8958
8872
|
} catch (c) {
|
|
8959
8873
|
return a;
|
|
@@ -9002,8 +8916,7 @@ var intl_tel_input_default = intlTelInput;
|
|
|
9002
8916
|
try {
|
|
9003
8917
|
const g = K.g(), h = Y(g, a, b);
|
|
9004
8918
|
var c = ab(g, h), d = R(g, w(h, 1), c);
|
|
9005
|
-
if (null == d)
|
|
9006
|
-
var e = -1;
|
|
8919
|
+
if (null == d) var e = -1;
|
|
9007
8920
|
else {
|
|
9008
8921
|
var f = Q(h);
|
|
9009
8922
|
e = $a(f, d);
|
|
@@ -9027,8 +8940,7 @@ var intl_tel_input_default = intlTelInput;
|
|
|
9027
8940
|
var c = Y(l, a, b), d = ab(l, c);
|
|
9028
8941
|
a = l;
|
|
9029
8942
|
var e = w(c, 1), f = R(a, e, d);
|
|
9030
|
-
if (null == f || "001" != d && e != bb(a, d))
|
|
9031
|
-
var g = false;
|
|
8943
|
+
if (null == f || "001" != d && e != bb(a, d)) var g = false;
|
|
9032
8944
|
else {
|
|
9033
8945
|
var h = Q(c);
|
|
9034
8946
|
g = -1 != $a(h, f);
|
|
@@ -9067,7 +8979,7 @@ var intlTelInputWithUtils_default = intl_tel_input_default;
|
|
|
9067
8979
|
|
|
9068
8980
|
// react/src/intl-tel-input/reactWithUtils.tsx
|
|
9069
8981
|
var import_react = __toESM(require("react"));
|
|
9070
|
-
var IntlTelInput = ({
|
|
8982
|
+
var IntlTelInput = (0, import_react.forwardRef)(function IntlTelInput2({
|
|
9071
8983
|
initialValue = "",
|
|
9072
8984
|
onChangeNumber = () => {
|
|
9073
8985
|
},
|
|
@@ -9080,9 +8992,20 @@ var IntlTelInput = ({
|
|
|
9080
8992
|
usePreciseValidation = false,
|
|
9081
8993
|
initOptions = {},
|
|
9082
8994
|
inputProps = {}
|
|
9083
|
-
})
|
|
8995
|
+
}, ref) {
|
|
9084
8996
|
const inputRef = (0, import_react.useRef)(null);
|
|
9085
8997
|
const itiRef = (0, import_react.useRef)(null);
|
|
8998
|
+
(0, import_react.useImperativeHandle)(ref, () => ({
|
|
8999
|
+
getInstance: () => ({
|
|
9000
|
+
setCountry: (country) => itiRef.current?.setCountry(country),
|
|
9001
|
+
// override setNumber to also call update, to trigger onChangeNumber etc
|
|
9002
|
+
setNumber: (num) => {
|
|
9003
|
+
itiRef.current?.setNumber(num);
|
|
9004
|
+
update();
|
|
9005
|
+
}
|
|
9006
|
+
}),
|
|
9007
|
+
getInput: () => inputRef.current
|
|
9008
|
+
}));
|
|
9086
9009
|
const update = () => {
|
|
9087
9010
|
const num = itiRef.current?.getNumber() || "";
|
|
9088
9011
|
const countryIso = itiRef.current?.getSelectedCountryData().iso2 || "";
|
|
@@ -9124,5 +9047,5 @@ var IntlTelInput = ({
|
|
|
9124
9047
|
...inputProps
|
|
9125
9048
|
}
|
|
9126
9049
|
);
|
|
9127
|
-
};
|
|
9050
|
+
});
|
|
9128
9051
|
var reactWithUtils_default = IntlTelInput;
|