@samline/formatter 1.0.0
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/LICENSE +21 -0
- package/README.md +128 -0
- package/dist/browser/global.d.ts +84 -0
- package/dist/browser/global.global.js +4098 -0
- package/dist/index.cjs +308 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +158 -0
- package/dist/index.d.ts +158 -0
- package/dist/index.js +295 -0
- package/dist/index.js.map +1 -0
- package/dist/vanilla/index.cjs +308 -0
- package/dist/vanilla/index.cjs.map +1 -0
- package/dist/vanilla/index.d.cts +158 -0
- package/dist/vanilla/index.d.ts +158 -0
- package/dist/vanilla/index.js +295 -0
- package/dist/vanilla/index.js.map +1 -0
- package/package.json +79 -0
|
@@ -0,0 +1,4098 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var Formatter = (() => {
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
20
|
+
|
|
21
|
+
// src/browser/global.ts
|
|
22
|
+
var global_exports = {};
|
|
23
|
+
__export(global_exports, {
|
|
24
|
+
default: () => global_default
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
// node_modules/.pnpm/cleave-zen@0.0.17/node_modules/cleave-zen/dist/cleave-zen.module.js
|
|
28
|
+
var e;
|
|
29
|
+
var r;
|
|
30
|
+
var t;
|
|
31
|
+
var i = function(e2) {
|
|
32
|
+
return e2.replace(/[^\d]/g, "");
|
|
33
|
+
};
|
|
34
|
+
var n = function(e2) {
|
|
35
|
+
return e2.reduce(function(e3, r2) {
|
|
36
|
+
return e3 + r2;
|
|
37
|
+
}, 0);
|
|
38
|
+
};
|
|
39
|
+
var a = function(e2, r2) {
|
|
40
|
+
return e2.slice(0, r2);
|
|
41
|
+
};
|
|
42
|
+
var l = function(e2) {
|
|
43
|
+
var r2 = e2.value;
|
|
44
|
+
return e2.delimiters.forEach(function(e3) {
|
|
45
|
+
e3.split("").forEach(function(e4) {
|
|
46
|
+
r2 = r2.replace(new RegExp(e4.replace(/([.?*+^$[\]\\(){}|-])/g, "\\$1"), "g"), "");
|
|
47
|
+
});
|
|
48
|
+
}), r2;
|
|
49
|
+
};
|
|
50
|
+
var u = function(e2) {
|
|
51
|
+
var r2 = e2.blocks, t2 = e2.delimiter, i2 = void 0 === t2 ? "" : t2, n2 = e2.delimiters, a2 = void 0 === n2 ? [] : n2, l2 = e2.delimiterLazyShow, u2 = void 0 !== l2 && l2, c = "", s2 = e2.value, o2 = "";
|
|
52
|
+
return r2.forEach(function(e3, t3) {
|
|
53
|
+
if (s2.length > 0) {
|
|
54
|
+
var n3, l3 = s2.slice(0, e3), d = s2.slice(e3);
|
|
55
|
+
o2 = a2.length > 0 ? null != (n3 = a2[u2 ? t3 - 1 : t3]) ? n3 : o2 : i2, u2 ? (t3 > 0 && (c += o2), c += l3) : (c += l3, l3.length === e3 && t3 < r2.length - 1 && (c += o2)), s2 = d;
|
|
56
|
+
}
|
|
57
|
+
}), c;
|
|
58
|
+
};
|
|
59
|
+
var s = function(e2, r2) {
|
|
60
|
+
var t2 = r2.blocks, n2 = r2.delimiter, a2 = void 0 === n2 ? "" : n2, c = r2.delimiters, s2 = void 0 === c ? [] : c, o2 = r2.delimiterLazyShow, d = void 0 !== o2 && o2, v2 = r2.prefix, m2 = void 0 === v2 ? "" : v2, f2 = r2.numericOnly, p2 = void 0 !== f2 && f2, h2 = r2.uppercase, E2 = void 0 !== h2 && h2, g2 = r2.lowercase, I2 = void 0 !== g2 && g2;
|
|
61
|
+
return a2.length > 0 && s2.push(a2), e2 = (function(e3) {
|
|
62
|
+
var r3 = e3.value, t3 = e3.prefix, i2 = e3.tailPrefix, n3 = t3.length;
|
|
63
|
+
return 0 === n3 ? r3 : r3 === t3 && "" !== r3 ? "" : r3.slice(0, n3) === t3 || i2 ? r3.slice(-n3) !== t3 && i2 ? "" : i2 ? r3.slice(0, -n3) : r3.slice(n3) : "";
|
|
64
|
+
})({ value: e2 = l({ value: e2, delimiters: s2 }), prefix: m2, tailPrefix: false }), e2 = p2 ? i(e2) : e2, e2 = E2 ? e2.toUpperCase() : e2, e2 = I2 ? e2.toLowerCase() : e2, m2.length > 0 && (e2 = m2 + e2), u({ value: e2, blocks: t2, delimiter: a2, delimiters: s2, delimiterLazyShow: d });
|
|
65
|
+
};
|
|
66
|
+
var o = function(e2, r2) {
|
|
67
|
+
var t2 = r2.delimiter, i2 = r2.delimiters;
|
|
68
|
+
return l({ value: e2, delimiters: [].concat(void 0 === i2 ? [] : i2, [void 0 === t2 ? "" : t2]) });
|
|
69
|
+
};
|
|
70
|
+
!(function(e2) {
|
|
71
|
+
e2.UATP = "uatp", e2.AMEX = "amex", e2.DINERS = "diners", e2.DISCOVER = "discover", e2.MASTERCARD = "mastercard", e2.DANKORT = "dankort", e2.INSTAPAYMENT = "instapayment", e2.JCB15 = "jcb15", e2.JCB = "jcb", e2.MAESTRO = "maestro", e2.VISA = "visa", e2.MIR = "mir", e2.UNIONPAY = "unionpay", e2.GENERAL = "general";
|
|
72
|
+
})(t || (t = {}));
|
|
73
|
+
var v;
|
|
74
|
+
var m = ((e = {})[t.UATP] = [4, 5, 6], e[t.AMEX] = [4, 6, 5], e[t.DINERS] = [4, 6, 4], e[t.DISCOVER] = [4, 4, 4, 4], e[t.MASTERCARD] = [4, 4, 4, 4], e[t.DANKORT] = [4, 4, 4, 4], e[t.INSTAPAYMENT] = [4, 4, 4, 4], e[t.JCB15] = [4, 6, 5], e[t.JCB] = [4, 4, 4, 4], e[t.MAESTRO] = [4, 4, 4, 4], e[t.VISA] = [4, 4, 4, 4], e[t.MIR] = [4, 4, 4, 4], e[t.UNIONPAY] = [4, 4, 4, 4], e[t.GENERAL] = [4, 4, 4, 4], e);
|
|
75
|
+
var f = ((r = {})[t.UATP] = /^(?!1800)1\d{0,14}/, r[t.AMEX] = /^3[47]\d{0,13}/, r[t.DISCOVER] = /^(?:6011|65\d{0,2}|64[4-9]\d?)\d{0,12}/, r[t.DINERS] = /^3(?:0([0-5]|9)|[689]\d?)\d{0,11}/, r[t.MASTERCARD] = /^(5[1-5]\d{0,2}|22[2-9]\d{0,1}|2[3-7]\d{0,2})\d{0,12}/, r[t.DANKORT] = /^(5019|4175|4571)\d{0,12}/, r[t.INSTAPAYMENT] = /^63[7-9]\d{0,13}/, r[t.JCB15] = /^(?:2131|1800)\d{0,11}/, r[t.JCB] = /^(?:35\d{0,2})\d{0,12}/, r[t.MAESTRO] = /^(?:5[0678]\d{0,2}|6304|67\d{0,2})\d{0,12}/, r[t.MIR] = /^220[0-4]\d{0,12}/, r[t.VISA] = /^4\d{0,15}/, r[t.UNIONPAY] = /^(62|81)\d{0,14}/, r);
|
|
76
|
+
var p = function(e2) {
|
|
77
|
+
var r2 = e2.reduce(function(e3, r3) {
|
|
78
|
+
return e3 + r3;
|
|
79
|
+
}, 0);
|
|
80
|
+
return e2.concat(19 - r2);
|
|
81
|
+
};
|
|
82
|
+
var h = function(e2) {
|
|
83
|
+
for (var r2 = e2.value, i2 = e2.strictMode, n2 = 0, a2 = Object.keys(f); n2 < a2.length; n2++) {
|
|
84
|
+
var l2 = a2[n2];
|
|
85
|
+
if (f[l2].test(r2)) {
|
|
86
|
+
var u2 = m[l2];
|
|
87
|
+
return { type: l2, blocks: null != i2 && i2 ? p(u2) : u2 };
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
return { type: t.GENERAL, blocks: null != i2 && i2 ? p(m.general) : m.general };
|
|
91
|
+
};
|
|
92
|
+
var E = function(e2, r2) {
|
|
93
|
+
var t2 = null != r2 ? r2 : {}, c = t2.delimiter, s2 = void 0 === c ? " " : c, o2 = t2.delimiterLazyShow, d = void 0 !== o2 && o2, v2 = t2.strictMode, m2 = void 0 !== v2 && v2;
|
|
94
|
+
e2 = i(e2), e2 = l({ value: e2, delimiters: [s2] });
|
|
95
|
+
var f2 = h({ value: e2, strictMode: m2 }).blocks, p2 = n(f2);
|
|
96
|
+
return e2 = a(e2, p2), u({ value: e2, blocks: f2, delimiter: s2, delimiterLazyShow: d });
|
|
97
|
+
};
|
|
98
|
+
var g = function(e2, r2) {
|
|
99
|
+
return e2 = i(e2), e2 = l({ value: e2, delimiters: [null != r2 ? r2 : " "] }), h({ value: e2 }).type;
|
|
100
|
+
};
|
|
101
|
+
var I = function(e2) {
|
|
102
|
+
return i(e2);
|
|
103
|
+
};
|
|
104
|
+
!(function(e2) {
|
|
105
|
+
e2.THOUSAND = "thousand", e2.LAKH = "lakh", e2.WAN = "wan", e2.NONE = "none";
|
|
106
|
+
})(v || (v = {}));
|
|
107
|
+
var x = v.THOUSAND;
|
|
108
|
+
var M = function(e2, r2) {
|
|
109
|
+
var t2 = null != r2 ? r2 : {}, i2 = t2.delimiter, n2 = t2.numeralThousandsGroupStyle, a2 = t2.numeralIntegerScale, l2 = t2.numeralDecimalMark, u2 = t2.numeralDecimalScale, c = t2.stripLeadingZeroes, s2 = t2.numeralPositiveOnly, o2 = t2.tailPrefix, d = t2.signBeforePrefix, m2 = t2.prefix;
|
|
110
|
+
return (function(e3) {
|
|
111
|
+
var r3, t3, i3, n3 = e3.delimiter, a3 = e3.numeralDecimalMark, l3 = e3.numeralDecimalScale, u3 = e3.stripLeadingZeroes, c2 = e3.numeralPositiveOnly, s3 = e3.numeralIntegerScale, o3 = e3.numeralThousandsGroupStyle, d2 = e3.signBeforePrefix, m3 = e3.tailPrefix, f2 = e3.prefix, p2 = "", h2 = e3.value.replace(/[A-Za-z]/g, "").replace(a3, "M").replace(/[^\dM-]/g, "").replace(/^-/, "N").replace(/-/g, "").replace("N", null != c2 && c2 ? "" : "-").replace("M", a3);
|
|
112
|
+
u3 && (h2 = h2.replace(/^(-)?0+(?=\d)/, "$1"));
|
|
113
|
+
var E2 = "-" === h2.slice(0, 1) ? "-" : "";
|
|
114
|
+
switch (t3 = d2 ? E2 + f2 : f2 + E2, i3 = h2, h2.includes(a3) && (i3 = (r3 = h2.split(a3))[0], p2 = a3 + r3[1].slice(0, l3)), "-" === E2 && (i3 = i3.slice(1)), s3 > 0 && (i3 = i3.slice(0, s3)), o3) {
|
|
115
|
+
case v.LAKH:
|
|
116
|
+
i3 = i3.replace(/(\d)(?=(\d\d)+\d$)/g, "$1" + n3);
|
|
117
|
+
break;
|
|
118
|
+
case v.WAN:
|
|
119
|
+
i3 = i3.replace(/(\d)(?=(\d{4})+$)/g, "$1" + n3);
|
|
120
|
+
break;
|
|
121
|
+
case v.THOUSAND:
|
|
122
|
+
i3 = i3.replace(/(\d)(?=(\d{3})+$)/g, "$1" + n3);
|
|
123
|
+
}
|
|
124
|
+
return m3 ? E2 + i3 + (l3 > 0 ? p2 : "") + f2 : t3 + i3 + (l3 > 0 ? p2 : "");
|
|
125
|
+
})({ value: e2, delimiter: void 0 === i2 ? "," : i2, numeralIntegerScale: void 0 === a2 ? 0 : a2, numeralDecimalMark: void 0 === l2 ? "." : l2, numeralDecimalScale: void 0 === u2 ? 2 : u2, stripLeadingZeroes: void 0 === c || c, numeralPositiveOnly: void 0 !== s2 && s2, numeralThousandsGroupStyle: void 0 === n2 ? x : n2, tailPrefix: void 0 !== o2 && o2, signBeforePrefix: void 0 !== d && d, prefix: void 0 === m2 ? "" : m2 });
|
|
126
|
+
};
|
|
127
|
+
var S = function(e2, r2) {
|
|
128
|
+
var t2 = (null != r2 ? r2 : {}).numeralDecimalMark;
|
|
129
|
+
return e2.replace(void 0 === t2 ? "." : t2, "M").replace(/[^0-9-M]/g, "").replace("M", ".");
|
|
130
|
+
};
|
|
131
|
+
var k = ["d", "m", "Y"];
|
|
132
|
+
var C = function(e2, r2) {
|
|
133
|
+
return r2 ? (e2 < 10 ? "000" : e2 < 100 ? "00" : e2 < 1e3 ? "0" : "") + e2 : (e2 < 10 ? "0" : "") + e2;
|
|
134
|
+
};
|
|
135
|
+
var L = function(e2) {
|
|
136
|
+
return (e2 < 10 ? "0" : "") + e2;
|
|
137
|
+
};
|
|
138
|
+
var P = function(e2, r2, t2) {
|
|
139
|
+
var i2;
|
|
140
|
+
return e2 = Math.min(e2, 31), t2 = null != (i2 = t2) ? i2 : 0, ((r2 = Math.min(r2, 12)) < 7 && r2 % 2 == 0 || r2 > 8 && r2 % 2 == 1) && (e2 = Math.min(e2, 2 === r2 ? (function(e3) {
|
|
141
|
+
return e3 % 4 == 0 && e3 % 100 != 0 || e3 % 400 == 0;
|
|
142
|
+
})(t2) ? 29 : 28 : 30)), [e2, r2, t2];
|
|
143
|
+
};
|
|
144
|
+
var y = function(e2, r2) {
|
|
145
|
+
var t2 = null != r2 ? r2 : {}, c = t2.delimiterLazyShow, s2 = void 0 !== c && c, o2 = t2.delimiter, d = void 0 === o2 ? "/" : o2, v2 = t2.datePattern, m2 = void 0 === v2 ? k : v2, f2 = t2.dateMax, p2 = void 0 === f2 ? "" : f2, h2 = t2.dateMin, E2 = void 0 === h2 ? "" : h2;
|
|
146
|
+
e2 = i(e2);
|
|
147
|
+
var g2 = (function(e3) {
|
|
148
|
+
var r3 = [];
|
|
149
|
+
return e3.forEach(function(e4) {
|
|
150
|
+
r3.push("Y" === e4 ? 4 : 2);
|
|
151
|
+
}), r3;
|
|
152
|
+
})(m2), I2 = (function(e3) {
|
|
153
|
+
var r3 = e3.dateMax, t3 = e3.dateMin.split("-").reverse().map(function(e4) {
|
|
154
|
+
return parseInt(e4, 10);
|
|
155
|
+
});
|
|
156
|
+
2 === t3.length && t3.unshift(0);
|
|
157
|
+
var i2 = r3.split("-").reverse().map(function(e4) {
|
|
158
|
+
return parseInt(e4, 10);
|
|
159
|
+
});
|
|
160
|
+
return 2 === i2.length && i2.unshift(0), { min: t3, max: i2 };
|
|
161
|
+
})({ dateMax: p2, dateMin: E2 });
|
|
162
|
+
e2 = (function(e3) {
|
|
163
|
+
var r3 = e3.value, t3 = void 0 === r3 ? "" : r3, i2 = e3.blocks, n2 = e3.datePattern, a2 = e3.min, l2 = e3.max, u2 = "";
|
|
164
|
+
return (void 0 === i2 ? [] : i2).forEach(function(e4, r4) {
|
|
165
|
+
if (t3.length > 0) {
|
|
166
|
+
var i3 = t3.slice(0, e4), a3 = i3.slice(0, 1), l3 = t3.slice(e4);
|
|
167
|
+
switch (n2[r4]) {
|
|
168
|
+
case "d":
|
|
169
|
+
"00" === i3 ? i3 = "01" : parseInt(a3, 10) > 3 ? i3 = "0" + a3 : parseInt(i3, 10) > 31 && (i3 = "31");
|
|
170
|
+
break;
|
|
171
|
+
case "m":
|
|
172
|
+
"00" === i3 ? i3 = "01" : parseInt(a3, 10) > 1 ? i3 = "0" + a3 : parseInt(i3, 10) > 12 && (i3 = "12");
|
|
173
|
+
}
|
|
174
|
+
u2 += i3, t3 = l3;
|
|
175
|
+
}
|
|
176
|
+
}), (function(e4) {
|
|
177
|
+
var r4, t4, i3, n3 = e4.value, a3 = void 0 === n3 ? "" : n3, l3 = e4.datePattern, u3 = e4.min, c2 = e4.max, s3 = [], o3 = 0, d2 = 0, v3 = 0, m3 = 0, f3 = 0, p3 = 0, h3 = false;
|
|
178
|
+
return 4 === a3.length && "y" !== l3[0].toLowerCase() && "y" !== l3[1].toLowerCase() && (f3 = 2 - (m3 = "d" === l3[0] ? 0 : 2), r4 = parseInt(a3.slice(m3, m3 + 2), 10), t4 = parseInt(a3.slice(f3, f3 + 2), 10), s3 = P(r4, t4, 0)), 8 === a3.length && (l3.forEach(function(e5, r5) {
|
|
179
|
+
switch (e5) {
|
|
180
|
+
case "d":
|
|
181
|
+
o3 = r5;
|
|
182
|
+
break;
|
|
183
|
+
case "m":
|
|
184
|
+
d2 = r5;
|
|
185
|
+
break;
|
|
186
|
+
default:
|
|
187
|
+
v3 = r5;
|
|
188
|
+
}
|
|
189
|
+
}), p3 = 2 * v3, m3 = o3 <= v3 ? 2 * o3 : 2 * o3 + 2, f3 = d2 <= v3 ? 2 * d2 : 2 * d2 + 2, r4 = parseInt(a3.slice(m3, m3 + 2), 10), t4 = parseInt(a3.slice(f3, f3 + 2), 10), i3 = parseInt(a3.slice(p3, p3 + 4), 10), h3 = 4 === a3.slice(p3, p3 + 4).length, s3 = P(r4, t4, i3)), 4 !== a3.length || "y" !== l3[0] && "y" !== l3[1] || (p3 = 2 - (f3 = "m" === l3[0] ? 0 : 2), t4 = parseInt(a3.slice(f3, f3 + 2), 10), i3 = parseInt(a3.slice(p3, p3 + 2), 10), h3 = 2 === a3.slice(p3, p3 + 2).length, s3 = [0, t4, i3]), 6 !== a3.length || "Y" !== l3[0] && "Y" !== l3[1] || (p3 = 2 - 0.5 * (f3 = "m" === l3[0] ? 0 : 4), t4 = parseInt(a3.slice(f3, f3 + 2), 10), i3 = parseInt(a3.slice(p3, p3 + 4), 10), h3 = 4 === a3.slice(p3, p3 + 4).length, s3 = [0, t4, i3]), 0 === (s3 = (function(e5) {
|
|
190
|
+
var r5 = e5.date, t5 = void 0 === r5 ? [] : r5, i4 = e5.min, n4 = e5.max;
|
|
191
|
+
return 0 === t5.length || i4.length < 3 && n4.length < 3 || e5.datePattern.filter(function(e6) {
|
|
192
|
+
return "y" === e6.toLowerCase();
|
|
193
|
+
}).length > 0 && 0 === t5[2] ? t5 : n4.length > 0 && (n4[2] < t5[2] || n4[2] === t5[2] && (n4[1] < t5[1] || n4[1] === t5[1] && n4[0] < t5[0])) ? n4 : i4.length > 0 && (i4[2] > t5[2] || i4[2] === t5[2] && (i4[1] > t5[1] || i4[1] === t5[1] && i4[0] > t5[0])) ? i4 : t5;
|
|
194
|
+
})({ date: s3, datePattern: l3, min: u3, max: c2 })).length ? a3 : l3.reduce(function(e5, r5) {
|
|
195
|
+
switch (r5) {
|
|
196
|
+
case "d":
|
|
197
|
+
return e5 + (0 === s3[0] ? "" : L(s3[0]));
|
|
198
|
+
case "m":
|
|
199
|
+
return e5 + (0 === s3[1] ? "" : L(s3[1]));
|
|
200
|
+
case "y":
|
|
201
|
+
return e5 + (h3 ? C(s3[2], false) : "");
|
|
202
|
+
case "Y":
|
|
203
|
+
return e5 + (h3 ? C(s3[2], true) : "");
|
|
204
|
+
}
|
|
205
|
+
return e5;
|
|
206
|
+
}, "");
|
|
207
|
+
})({ value: u2, datePattern: n2, min: a2, max: l2 });
|
|
208
|
+
})({ value: e2, blocks: g2, datePattern: m2, min: I2.min, max: I2.max }), e2 = l({ value: e2, delimiters: [d] });
|
|
209
|
+
var A = n(g2);
|
|
210
|
+
return e2 = a(e2, A), u({ value: e2, blocks: g2, delimiter: d, delimiterLazyShow: s2 });
|
|
211
|
+
};
|
|
212
|
+
var R = ["h", "m", "s"];
|
|
213
|
+
var T = function(e2) {
|
|
214
|
+
return (e2 < 10 ? "0" : "") + e2;
|
|
215
|
+
};
|
|
216
|
+
var b = function(e2, r2, t2) {
|
|
217
|
+
return t2 = Math.min(t2, 60), r2 = Math.min(r2, 60), [e2 = Math.min(e2, 60), r2, t2];
|
|
218
|
+
};
|
|
219
|
+
var w = function(e2, r2) {
|
|
220
|
+
var t2 = null != r2 ? r2 : {}, c = t2.delimiterLazyShow, s2 = void 0 !== c && c, o2 = t2.delimiter, d = void 0 === o2 ? ":" : o2, v2 = t2.timePattern, m2 = void 0 === v2 ? R : v2, f2 = t2.timeFormat, p2 = void 0 === f2 ? "24" : f2;
|
|
221
|
+
e2 = i(e2);
|
|
222
|
+
var h2 = (function(e3) {
|
|
223
|
+
var r3 = [];
|
|
224
|
+
return e3.forEach(function() {
|
|
225
|
+
r3.push(2);
|
|
226
|
+
}), r3;
|
|
227
|
+
})(m2);
|
|
228
|
+
e2 = (function(e3) {
|
|
229
|
+
var r3 = e3.value, t3 = e3.timePattern, i2 = "", n2 = "12" === e3.timeFormat ? { maxHourFirstDigit: 1, maxHours: 12, maxMinutesFirstDigit: 5, maxMinutes: 60 } : { maxHourFirstDigit: 2, maxHours: 23, maxMinutesFirstDigit: 5, maxMinutes: 60 };
|
|
230
|
+
return e3.blocks.forEach(function(e4, a2) {
|
|
231
|
+
if (r3.length > 0) {
|
|
232
|
+
var l2 = r3.slice(0, e4), u2 = l2.slice(0, 1), c2 = r3.slice(e4);
|
|
233
|
+
switch (t3[a2]) {
|
|
234
|
+
case "h":
|
|
235
|
+
parseInt(u2, 10) > n2.maxHourFirstDigit ? l2 = "0" + u2 : parseInt(l2, 10) > n2.maxHours && (l2 = n2.maxHours + "");
|
|
236
|
+
break;
|
|
237
|
+
case "m":
|
|
238
|
+
case "s":
|
|
239
|
+
parseInt(u2, 10) > n2.maxMinutesFirstDigit ? l2 = "0" + u2 : parseInt(l2, 10) > n2.maxMinutes && (l2 = n2.maxMinutes + "");
|
|
240
|
+
}
|
|
241
|
+
i2 += l2, r3 = c2;
|
|
242
|
+
}
|
|
243
|
+
}), (function(e4) {
|
|
244
|
+
var r4, t4, i3, n3 = e4.value, a2 = e4.timePattern, l2 = [], u2 = 0, c2 = 0, s3 = 0, o3 = 0, d2 = 0, v3 = 0;
|
|
245
|
+
return 6 === n3.length && (a2.forEach(function(e5, r5) {
|
|
246
|
+
switch (e5) {
|
|
247
|
+
case "s":
|
|
248
|
+
u2 = 2 * r5;
|
|
249
|
+
break;
|
|
250
|
+
case "m":
|
|
251
|
+
c2 = 2 * r5;
|
|
252
|
+
break;
|
|
253
|
+
case "h":
|
|
254
|
+
s3 = 2 * r5;
|
|
255
|
+
}
|
|
256
|
+
}), v3 = s3, d2 = c2, o3 = u2, r4 = parseInt(n3.slice(o3, o3 + 2), 10), t4 = parseInt(n3.slice(d2, d2 + 2), 10), i3 = parseInt(n3.slice(v3, v3 + 2), 10), l2 = b(i3, t4, r4)), 4 !== n3.length || a2.includes("s") || (a2.forEach(function(e5, r5) {
|
|
257
|
+
switch (e5) {
|
|
258
|
+
case "m":
|
|
259
|
+
c2 = 2 * r5;
|
|
260
|
+
break;
|
|
261
|
+
case "h":
|
|
262
|
+
s3 = 2 * r5;
|
|
263
|
+
}
|
|
264
|
+
}), v3 = s3, d2 = c2, r4 = 0, t4 = parseInt(n3.slice(d2, d2 + 2), 10), i3 = parseInt(n3.slice(v3, v3 + 2), 10), l2 = b(i3, t4, r4)), 0 === l2.length ? n3 : a2.reduce(function(e5, r5) {
|
|
265
|
+
switch (r5) {
|
|
266
|
+
case "s":
|
|
267
|
+
return e5 + T(l2[2]);
|
|
268
|
+
case "m":
|
|
269
|
+
return e5 + T(l2[1]);
|
|
270
|
+
case "h":
|
|
271
|
+
return e5 + T(l2[0]);
|
|
272
|
+
}
|
|
273
|
+
return e5;
|
|
274
|
+
}, "");
|
|
275
|
+
})({ value: i2, timePattern: t3 });
|
|
276
|
+
})({ value: e2, blocks: h2, timePattern: m2, timeFormat: p2 }), e2 = l({ value: e2, delimiters: [d] });
|
|
277
|
+
var E2 = n(h2);
|
|
278
|
+
return e2 = a(e2, E2), u({ value: e2, blocks: h2, delimiter: d, delimiterLazyShow: s2 });
|
|
279
|
+
};
|
|
280
|
+
|
|
281
|
+
// node_modules/.pnpm/libphonenumber-js@1.13.7/node_modules/libphonenumber-js/metadata.min.json.js
|
|
282
|
+
var metadata_min_json_default = { "version": 4, "country_calling_codes": { "1": ["US", "AG", "AI", "AS", "BB", "BM", "BS", "CA", "DM", "DO", "GD", "GU", "JM", "KN", "KY", "LC", "MP", "MS", "PR", "SX", "TC", "TT", "VC", "VG", "VI"], "7": ["RU", "KZ"], "20": ["EG"], "27": ["ZA"], "30": ["GR"], "31": ["NL"], "32": ["BE"], "33": ["FR"], "34": ["ES"], "36": ["HU"], "39": ["IT", "VA"], "40": ["RO"], "41": ["CH"], "43": ["AT"], "44": ["GB", "GG", "IM", "JE"], "45": ["DK"], "46": ["SE"], "47": ["NO", "SJ"], "48": ["PL"], "49": ["DE"], "51": ["PE"], "52": ["MX"], "53": ["CU"], "54": ["AR"], "55": ["BR"], "56": ["CL"], "57": ["CO"], "58": ["VE"], "60": ["MY"], "61": ["AU", "CC", "CX"], "62": ["ID"], "63": ["PH"], "64": ["NZ"], "65": ["SG"], "66": ["TH"], "81": ["JP"], "82": ["KR"], "84": ["VN"], "86": ["CN"], "90": ["TR"], "91": ["IN"], "92": ["PK"], "93": ["AF"], "94": ["LK"], "95": ["MM"], "98": ["IR"], "211": ["SS"], "212": ["MA", "EH"], "213": ["DZ"], "216": ["TN"], "218": ["LY"], "220": ["GM"], "221": ["SN"], "222": ["MR"], "223": ["ML"], "224": ["GN"], "225": ["CI"], "226": ["BF"], "227": ["NE"], "228": ["TG"], "229": ["BJ"], "230": ["MU"], "231": ["LR"], "232": ["SL"], "233": ["GH"], "234": ["NG"], "235": ["TD"], "236": ["CF"], "237": ["CM"], "238": ["CV"], "239": ["ST"], "240": ["GQ"], "241": ["GA"], "242": ["CG"], "243": ["CD"], "244": ["AO"], "245": ["GW"], "246": ["IO"], "247": ["AC"], "248": ["SC"], "249": ["SD"], "250": ["RW"], "251": ["ET"], "252": ["SO"], "253": ["DJ"], "254": ["KE"], "255": ["TZ"], "256": ["UG"], "257": ["BI"], "258": ["MZ"], "260": ["ZM"], "261": ["MG"], "262": ["RE", "YT"], "263": ["ZW"], "264": ["NA"], "265": ["MW"], "266": ["LS"], "267": ["BW"], "268": ["SZ"], "269": ["KM"], "290": ["SH", "TA"], "291": ["ER"], "297": ["AW"], "298": ["FO"], "299": ["GL"], "350": ["GI"], "351": ["PT"], "352": ["LU"], "353": ["IE"], "354": ["IS"], "355": ["AL"], "356": ["MT"], "357": ["CY"], "358": ["FI", "AX"], "359": ["BG"], "370": ["LT"], "371": ["LV"], "372": ["EE"], "373": ["MD"], "374": ["AM"], "375": ["BY"], "376": ["AD"], "377": ["MC"], "378": ["SM"], "380": ["UA"], "381": ["RS"], "382": ["ME"], "383": ["XK"], "385": ["HR"], "386": ["SI"], "387": ["BA"], "389": ["MK"], "420": ["CZ"], "421": ["SK"], "423": ["LI"], "500": ["FK"], "501": ["BZ"], "502": ["GT"], "503": ["SV"], "504": ["HN"], "505": ["NI"], "506": ["CR"], "507": ["PA"], "508": ["PM"], "509": ["HT"], "590": ["GP", "BL", "MF"], "591": ["BO"], "592": ["GY"], "593": ["EC"], "594": ["GF"], "595": ["PY"], "596": ["MQ"], "597": ["SR"], "598": ["UY"], "599": ["CW", "BQ"], "670": ["TL"], "672": ["NF"], "673": ["BN"], "674": ["NR"], "675": ["PG"], "676": ["TO"], "677": ["SB"], "678": ["VU"], "679": ["FJ"], "680": ["PW"], "681": ["WF"], "682": ["CK"], "683": ["NU"], "685": ["WS"], "686": ["KI"], "687": ["NC"], "688": ["TV"], "689": ["PF"], "690": ["TK"], "691": ["FM"], "692": ["MH"], "850": ["KP"], "852": ["HK"], "853": ["MO"], "855": ["KH"], "856": ["LA"], "880": ["BD"], "886": ["TW"], "960": ["MV"], "961": ["LB"], "962": ["JO"], "963": ["SY"], "964": ["IQ"], "965": ["KW"], "966": ["SA"], "967": ["YE"], "968": ["OM"], "970": ["PS"], "971": ["AE"], "972": ["IL"], "973": ["BH"], "974": ["QA"], "975": ["BT"], "976": ["MN"], "977": ["NP"], "992": ["TJ"], "993": ["TM"], "994": ["AZ"], "995": ["GE"], "996": ["KG"], "998": ["UZ"] }, "countries": { "AC": ["247", "00", "(?:[01589]\\d|[46])\\d{4}", [5, 6]], "AD": ["376", "00", "(?:1|6\\d)\\d{7}|[135-9]\\d{5}", [6, 8, 9], [["(\\d{3})(\\d{3})", "$1 $2", ["[135-9]"]], ["(\\d{4})(\\d{4})", "$1 $2", ["1"]], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["6"]]]], "AE": ["971", "00", "(?:[4-7]\\d|9[0-689])\\d{7}|800\\d{2,9}|[2-4679]\\d{7}", [5, 6, 7, 8, 9, 10, 11, 12], [["(\\d{3})(\\d{2,9})", "$1 $2", ["60|8"]], ["(\\d)(\\d{3})(\\d{4})", "$1 $2 $3", ["[236]|[479][2-8]"], "0$1"], ["(\\d{3})(\\d)(\\d{5})", "$1 $2 $3", ["[479]"]], ["(\\d{2})(\\d{3})(\\d{4})", "$1 $2 $3", ["5"], "0$1"]], "0"], "AF": ["93", "00", "[2-7]\\d{8}", [9], [["(\\d{2})(\\d{3})(\\d{4})", "$1 $2 $3", ["[2-7]"], "0$1"]], "0"], "AG": ["1", "011", "(?:268|[58]\\d\\d|900)\\d{7}", [10], 0, "1", 0, "([457]\\d{6})$|1", "268$1", 0, "268"], "AI": ["1", "011", "(?:264|[58]\\d\\d|900)\\d{7}", [10], 0, "1", 0, "([2457]\\d{6})$|1", "264$1", 0, "264"], "AL": ["355", "00", "(?:700\\d\\d|900)\\d{3}|8\\d{5,7}|(?:[2-5]|6\\d)\\d{7}", [6, 7, 8, 9], [["(\\d{3})(\\d{3,4})", "$1 $2", ["80|9"], "0$1"], ["(\\d)(\\d{3})(\\d{4})", "$1 $2 $3", ["4[2-6]"], "0$1"], ["(\\d{2})(\\d{3})(\\d{3})", "$1 $2 $3", ["[2358][2-5]|4"], "0$1"], ["(\\d{3})(\\d{5})", "$1 $2", ["[23578]"], "0$1"], ["(\\d{2})(\\d{3})(\\d{4})", "$1 $2 $3", ["6"], "0$1"]], "0"], "AM": ["374", "00", "(?:[1-489]\\d|55|60|77)\\d{6}", [8], [["(\\d{3})(\\d{2})(\\d{3})", "$1 $2 $3", ["[89]0"], "0 $1"], ["(\\d{3})(\\d{5})", "$1 $2", ["2|3[12]"], "(0$1)"], ["(\\d{2})(\\d{6})", "$1 $2", ["1|47"], "(0$1)"], ["(\\d{2})(\\d{6})", "$1 $2", ["[3-9]"], "0$1"]], "0"], "AO": ["244", "00", "[29]\\d{8}", [9], [["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["[29]"]]]], "AR": ["54", "00", "(?:11|[89]\\d\\d)\\d{8}|[2368]\\d{9}", [10, 11], [["(\\d{4})(\\d{2})(\\d{4})", "$1 $2-$3", ["2(?:2[024-9]|3[0-59]|47|6[245]|9[02-8])|3(?:3[28]|4[03-9]|5[2-46-8]|7[1-578]|8[2-9])", "2(?:[23]02|6(?:[25]|4[6-8])|9(?:[02356]|4[02568]|72|8[23]))|3(?:3[28]|4(?:[04679]|3[5-8]|5[4-68]|8[2379])|5(?:[2467]|3[237]|8[2-5])|7[1-578]|8(?:[2469]|3[2578]|5[4-8]|7[36-8]|8[5-8]))|2(?:2[24-9]|3[1-59]|47)", "2(?:[23]02|6(?:[25]|4(?:64|[78]))|9(?:[02356]|4(?:[0268]|5[2-6])|72|8[23]))|3(?:3[28]|4(?:[04679]|3[78]|5(?:4[46]|8)|8[2379])|5(?:[2467]|3[237]|8[23])|7[1-578]|8(?:[2469]|3[278]|5[56][46]|86[3-6]))|2(?:2[24-9]|3[1-59]|47)|38(?:[58][78]|7[378])|3(?:4[35][56]|58[45]|8(?:[38]5|54|76))[4-6]", "2(?:[23]02|6(?:[25]|4(?:64|[78]))|9(?:[02356]|4(?:[0268]|5[2-6])|72|8[23]))|3(?:3[28]|4(?:[04679]|3(?:5(?:4[0-25689]|[56])|[78])|58|8[2379])|5(?:[2467]|3[237]|8(?:[23]|4(?:[45]|60)|5(?:4[0-39]|5|64)))|7[1-578]|8(?:[2469]|3[278]|54(?:4|5[13-7]|6[89])|86[3-6]))|2(?:2[24-9]|3[1-59]|47)|38(?:[58][78]|7[378])|3(?:454|85[56])[46]|3(?:4(?:36|5[56])|8(?:[38]5|76))[4-6]"], "0$1", 1], ["(\\d{2})(\\d{4})(\\d{4})", "$1 $2-$3", ["1"], "0$1", 1], ["(\\d{3})(\\d{3})(\\d{4})", "$1-$2-$3", ["[68]"], "0$1"], ["(\\d{3})(\\d{3})(\\d{4})", "$1 $2-$3", ["[23]"], "0$1", 1], ["(\\d)(\\d{4})(\\d{2})(\\d{4})", "$2 15-$3-$4", ["9(?:2[2-469]|3[3-578])", "9(?:2(?:2[024-9]|3[0-59]|47|6[245]|9[02-8])|3(?:3[28]|4[03-9]|5[2-46-8]|7[1-578]|8[2-9]))", "9(?:2(?:[23]02|6(?:[25]|4[6-8])|9(?:[02356]|4[02568]|72|8[23]))|3(?:3[28]|4(?:[04679]|3[5-8]|5[4-68]|8[2379])|5(?:[2467]|3[237]|8[2-5])|7[1-578]|8(?:[2469]|3[2578]|5[4-8]|7[36-8]|8[5-8])))|92(?:2[24-9]|3[1-59]|47)", "9(?:2(?:[23]02|6(?:[25]|4(?:64|[78]))|9(?:[02356]|4(?:[0268]|5[2-6])|72|8[23]))|3(?:3[28]|4(?:[04679]|3[78]|5(?:4[46]|8)|8[2379])|5(?:[2467]|3[237]|8[23])|7[1-578]|8(?:[2469]|3[278]|5(?:[56][46]|[78])|7[378]|8(?:6[3-6]|[78]))))|92(?:2[24-9]|3[1-59]|47)|93(?:4[35][56]|58[45]|8(?:[38]5|54|76))[4-6]", "9(?:2(?:[23]02|6(?:[25]|4(?:64|[78]))|9(?:[02356]|4(?:[0268]|5[2-6])|72|8[23]))|3(?:3[28]|4(?:[04679]|3(?:5(?:4[0-25689]|[56])|[78])|5(?:4[46]|8)|8[2379])|5(?:[2467]|3[237]|8(?:[23]|4(?:[45]|60)|5(?:4[0-39]|5|64)))|7[1-578]|8(?:[2469]|3[278]|5(?:4(?:4|5[13-7]|6[89])|[56][46]|[78])|7[378]|8(?:6[3-6]|[78]))))|92(?:2[24-9]|3[1-59]|47)|93(?:4(?:36|5[56])|8(?:[38]5|76))[4-6]"], "0$1", 0, "$1 $2 $3-$4"], ["(\\d)(\\d{2})(\\d{4})(\\d{4})", "$2 15-$3-$4", ["91"], "0$1", 0, "$1 $2 $3-$4"], ["(\\d{3})(\\d{3})(\\d{5})", "$1-$2-$3", ["8"], "0$1"], ["(\\d)(\\d{3})(\\d{3})(\\d{4})", "$2 15-$3-$4", ["9"], "0$1", 0, "$1 $2 $3-$4"]], "0", 0, "0?(?:(11|2(?:2(?:02?|[13]|2[13-79]|4[1-6]|5[2457]|6[124-8]|7[1-4]|8[13-6]|9[1267])|3(?:02?|1[467]|2[03-6]|3[13-8]|[49][2-6]|5[2-8]|[67])|4(?:7[3-578]|9)|6(?:[0136]|2[24-6]|4[6-8]?|5[15-8])|80|9(?:0[1-3]|[19]|2\\d|3[1-6]|4[02568]?|5[2-4]|6[2-46]|72?|8[23]?))|3(?:3(?:2[79]|6|8[2578])|4(?:0[0-24-9]|[12]|3[5-8]?|4[24-7]|5[4-68]?|6[02-9]|7[126]|8[2379]?|9[1-36-8])|5(?:1|2[1245]|3[237]?|4[1-46-9]|6[2-4]|7[1-6]|8[2-5]?)|6[24]|7(?:[069]|1[1568]|2[15]|3[145]|4[13]|5[14-8]|7[2-57]|8[126])|8(?:[01]|2[15-7]|3[2578]?|4[13-6]|5[4-8]?|6[1-357-9]|7[36-8]?|8[5-8]?|9[124])))15)?", "9$1"], "AS": ["1", "011", "(?:[58]\\d\\d|684|900)\\d{7}", [10], 0, "1", 0, "([267]\\d{6})$|1", "684$1", 0, "684"], "AT": ["43", "00", "1\\d{3,12}|2\\d{6,12}|43(?:(?:0\\d|5[02-9])\\d{3,9}|2\\d{4,5}|[3467]\\d{4}|8\\d{4,6}|9\\d{4,7})|5\\d{4,12}|8\\d{7,12}|9\\d{8,12}|(?:[367]\\d|4[0-24-9])\\d{4,11}", [4, 5, 6, 7, 8, 9, 10, 11, 12, 13], [["(\\d)(\\d{3,12})", "$1 $2", ["1(?:11|[2-9])"], "0$1"], ["(\\d{3})(\\d{2})", "$1 $2", ["517"], "0$1"], ["(\\d{2})(\\d{3,5})", "$1 $2", ["5[079]"], "0$1"], ["(\\d{3})(\\d{3,10})", "$1 $2", ["(?:31|4)6|51|6(?:48|5[0-3579]|[6-9])|7(?:20|32|8)|[89]", "(?:31|4)6|51|6(?:485|5[0-3579]|[6-9])|7(?:20|32|8)|[89]"], "0$1"], ["(\\d{4})(\\d{3,9})", "$1 $2", ["[2-467]|5[2-6]"], "0$1"], ["(\\d{2})(\\d{3})(\\d{3,4})", "$1 $2 $3", ["5"], "0$1"], ["(\\d{2})(\\d{4})(\\d{4,7})", "$1 $2 $3", ["5"], "0$1"]], "0"], "AU": ["61", "001[14-689]|14(?:1[14]|34|4[17]|[56]6|7[47]|88)0011", "1(?:[0-79]\\d{7}(?:\\d(?:\\d{2})?)?|8[0-24-9]\\d{7})|[2-478]\\d{8}|1\\d{4,7}", [5, 6, 7, 8, 9, 10, 12], [["(\\d{2})(\\d{3,4})", "$1 $2", ["16"], "0$1"], ["(\\d{2})(\\d{3})(\\d{2,4})", "$1 $2 $3", ["16"], "0$1"], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["14|4"], "0$1"], ["(\\d)(\\d{4})(\\d{4})", "$1 $2 $3", ["[2378]"], "(0$1)"], ["(\\d{4})(\\d{3})(\\d{3})", "$1 $2 $3", ["1(?:30|[89])"]]], "0", 0, "(183[12])|0", 0, 0, 0, [["(?:(?:241|349)0\\d\\d|8(?:51(?:0(?:0[03-9]|[12479]\\d|3[2-9]|5[0-8]|6[1-9]|8[0-7])|1(?:[0235689]\\d|1[0-69]|4[0-589]|7[0-47-9])|2(?:0[0-79]|[18][13579]|2[14-9]|3[0-46-9]|[4-6]\\d|7[89]|9[0-4])|[34]\\d\\d)|91(?:(?:[0-58]\\d|6[0135-9])\\d|7(?:0[0-24-9]|[1-9]\\d)|9(?:[0-46-9]\\d|5[0-79]))))\\d{3}|(?:2(?:[0-26-9]\\d|3[0-8]|4[02-9]|5[0135-9])|3(?:[0-3589]\\d|4[0-578]|6[1-9]|7[0-35-9])|7(?:[013-57-9]\\d|2[0-8])|8(?:55|6[0-8]|[78]\\d|9[02-9]))\\d{6}", [9]], ["4(?:79[01]|83[0-36-9]|95[0-3])\\d{5}|4(?:[0-36]\\d|4[047-9]|[58][0-24-9]|7[02-8]|9[0-47-9])\\d{6}", [9]], ["180(?:0\\d{3}|2)\\d{3}", [7, 10]], ["190[0-26]\\d{6}", [10]], 0, 0, 0, ["163\\d{2,6}", [5, 6, 7, 8, 9]], ["14(?:5(?:1[0458]|[23][458])|71\\d)\\d{4}", [9]], ["13(?:00\\d{6}(?:\\d{2})?|45[0-4]\\d{3})|13\\d{4}", [6, 8, 10, 12]]], "0011"], "AW": ["297", "00", "(?:[25-79]\\d\\d|800)\\d{4}", [7], [["(\\d{3})(\\d{4})", "$1 $2", ["[25-9]"]]]], "AX": ["358", "00|99(?:[01469]|5(?:[14]1|3[23]|5[59]|77|88|9[09]))", "2\\d{4,9}|35\\d{4,5}|(?:60\\d\\d|800)\\d{4,6}|7\\d{5,11}|(?:[14]\\d|3[0-46-9]|50)\\d{4,8}", [5, 6, 7, 8, 9, 10, 11, 12], 0, "0", 0, 0, 0, 0, "18", 0, "00"], "AZ": ["994", "00", "365\\d{6}|(?:[124579]\\d|60|88)\\d{7}", [9], [["(\\d{3})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["90"], "0$1"], ["(\\d{2})(\\d{3})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["1[28]|2|365|46", "1[28]|2|365[45]|46", "1[28]|2|365(?:4|5[02])|46"], "(0$1)"], ["(\\d{2})(\\d{3})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[13-9]"], "0$1"]], "0"], "BA": ["387", "00", "6\\d{8}|(?:[35689]\\d|49|70)\\d{6}", [8, 9], [["(\\d{2})(\\d{3})(\\d{3})", "$1 $2 $3", ["6[1-3]|[7-9]"], "0$1"], ["(\\d{2})(\\d{3})(\\d{3})", "$1 $2-$3", ["[3-5]|6[56]"], "0$1"], ["(\\d{2})(\\d{2})(\\d{2})(\\d{3})", "$1 $2 $3 $4", ["6"], "0$1"]], "0"], "BB": ["1", "011", "(?:246|[58]\\d\\d|900)\\d{7}", [10], 0, "1", 0, "([2-9]\\d{6})$|1", "246$1", 0, "246"], "BD": ["880", "00", "[1-469]\\d{9}|8[0-79]\\d{7,8}|[2-79]\\d{8}|[2-9]\\d{7}|[3-9]\\d{6}|[57-9]\\d{5}", [6, 7, 8, 9, 10], [["(\\d{2})(\\d{4,6})", "$1-$2", ["31[5-8]|[459]1"], "0$1"], ["(\\d{3})(\\d{3,7})", "$1-$2", ["3(?:[67]|8[013-9])|4(?:6[168]|7|[89][18])|5(?:6[128]|9)|6(?:[15]|28|4[14])|7[2-589]|8(?:0[014-9]|[12])|9[358]|(?:3[2-5]|4[235]|5[2-578]|6[0389]|76|8[3-7]|9[24])1|(?:44|66)[01346-9]"], "0$1"], ["(\\d{4})(\\d{3,6})", "$1-$2", ["[13-9]|2[23]"], "0$1"], ["(\\d)(\\d{7,8})", "$1-$2", ["2"], "0$1"]], "0"], "BE": ["32", "00", "4\\d{8}|[1-9]\\d{7}", [8, 9], [["(\\d{3})(\\d{2})(\\d{3})", "$1 $2 $3", ["(?:80|9)0"], "0$1"], ["(\\d)(\\d{3})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[239]|4[23]"], "0$1"], ["(\\d{2})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[15-8]"], "0$1"], ["(\\d{3})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["4"], "0$1"]], "0"], "BF": ["226", "00", "[024-7]\\d{7}", [8], [["(\\d{2})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[024-7]"]]]], "BG": ["359", "00", "00800\\d{7}|[2-7]\\d{6,7}|[89]\\d{6,8}|2\\d{5}", [6, 7, 8, 9, 12], [["(\\d)(\\d)(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["2"], "0$1"], ["(\\d{3})(\\d{4})", "$1 $2", ["43[1-6]|70[1-9]"], "0$1"], ["(\\d)(\\d{3})(\\d{3,4})", "$1 $2 $3", ["2"], "0$1"], ["(\\d{2})(\\d{3})(\\d{2,3})", "$1 $2 $3", ["[356]|4[124-7]|7[1-9]|8[1-6]|9[1-7]"], "0$1"], ["(\\d{3})(\\d{2})(\\d{3})", "$1 $2 $3", ["(?:70|8)0"], "0$1"], ["(\\d{3})(\\d{3})(\\d{2})", "$1 $2 $3", ["43[1-7]|7"], "0$1"], ["(\\d{2})(\\d{3})(\\d{3,4})", "$1 $2 $3", ["[48]|9[08]"], "0$1"], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["9"], "0$1"]], "0"], "BH": ["973", "00", "[136-9]\\d{7}", [8], [["(\\d{4})(\\d{4})", "$1 $2", ["[13679]|8[02-4679]"]]]], "BI": ["257", "00", "(?:[267]\\d|31)\\d{6}", [8], [["(\\d{2})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[2367]"]]]], "BJ": ["229", "00", "(?:01\\d|8)\\d{7}", [8, 10], [["(\\d{2})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["8"]], ["(\\d{2})(\\d{2})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4 $5", ["0"]]]], "BL": ["590", "00", "7090\\d{5}|(?:[56]9|[89]\\d)\\d{7}", [9], 0, "0", 0, 0, 0, 0, 0, [["(?:59(?:0(?:2[7-9]|3[3-7]|5[12]|87)|87\\d)|80[6-9]\\d\\d)\\d{4}"], ["(?:69(?:0\\d\\d|1(?:2[2-9]|3[0-5]))|7090[0-4])\\d{4}"], ["80[0-5]\\d{6}"], ["8[129]\\d{7}"], 0, 0, 0, 0, ["9(?:(?:39[5-7]|76[018])\\d|475[0-6])\\d{4}"]]], "BM": ["1", "011", "(?:441|[58]\\d\\d|900)\\d{7}", [10], 0, "1", 0, "([2-9]\\d{6})$|1", "441$1", 0, "441"], "BN": ["673", "00", "[2-578]\\d{6}", [7], [["(\\d{3})(\\d{4})", "$1 $2", ["[2-578]"]]]], "BO": ["591", "00(?:1\\d)?", "(?:[2-7]\\d\\d|8001)\\d{5}", [8, 9], [["(\\d)(\\d{7})", "$1 $2", ["[23]|4[46]|50"]], ["(\\d{8})", "$1", ["[5-7]"]], ["(\\d{3})(\\d{2})(\\d{4})", "$1 $2 $3", ["8"]]], "0", 0, "0(1\\d)?"], "BQ": ["599", "00", "(?:[34]1|7\\d)\\d{5}", [7], 0, 0, 0, 0, 0, 0, "[347]"], "BR": ["55", "00(?:1[245]|2[1-35]|31|4[13]|[56]5|99)", "[1-467]\\d{9,10}|55[0-46-9]\\d{8}|[34]\\d{7}|55\\d{7,8}|(?:5[0-46-9]|[89]\\d)\\d{7,9}", [8, 9, 10, 11], [["(\\d{4})(\\d{4})", "$1-$2", ["300|4(?:0[02]|37|86)", "300|4(?:0(?:0|20)|370|864)"]], ["(\\d{3})(\\d{2,3})(\\d{4})", "$1 $2 $3", ["(?:[358]|90)0"], "0$1"], ["(\\d{2})(\\d{4})(\\d{4})", "$1 $2-$3", ["(?:[14689][1-9]|2[12478]|3[1-578]|5[13-5]|7[13-579])[2-57]"], "($1)"], ["(\\d{2})(\\d{5})(\\d{4})", "$1 $2-$3", ["[16][1-9]|[2-57-9]"], "($1)"]], "0", 0, "(?:0|90)(?:(1[245]|2[1-35]|31|4[13]|[56]5|99)(\\d{10,11}))?", "$2"], "BS": ["1", "011", "(?:242|[58]\\d\\d|900)\\d{7}", [10], 0, "1", 0, "([3-8]\\d{6})$|1", "242$1", 0, "242"], "BT": ["975", "00", "[178]\\d{7}|[2-8]\\d{6}", [7, 8], [["(\\d)(\\d{3})(\\d{3})", "$1 $2 $3", ["[2-6]|7[246]|8[2-4]"]], ["(\\d{2})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["1[67]|[78]"]]]], "BW": ["267", "00", "(?:0800|(?:[37]|800)\\d)\\d{6}|(?:[2-6]\\d|90)\\d{5}", [7, 8, 10], [["(\\d{2})(\\d{5})", "$1 $2", ["90"]], ["(\\d{3})(\\d{4})", "$1 $2", ["[24-6]|3[15-9]"]], ["(\\d{2})(\\d{3})(\\d{3})", "$1 $2 $3", ["[37]"]], ["(\\d{4})(\\d{3})(\\d{3})", "$1 $2 $3", ["0"]], ["(\\d{3})(\\d{4})(\\d{3})", "$1 $2 $3", ["8"]]]], "BY": ["375", "810", "(?:[12]\\d|33|44|902)\\d{7}|8(?:0[0-79]\\d{5,7}|[1-7]\\d{9})|8(?:1[0-489]|[5-79]\\d)\\d{7}|8[1-79]\\d{6,7}|8[0-79]\\d{5}|8\\d{5}", [6, 7, 8, 9, 10, 11], [["(\\d{3})(\\d{3})", "$1 $2", ["800"], "8 $1"], ["(\\d{3})(\\d{2})(\\d{2,4})", "$1 $2 $3", ["800"], "8 $1"], ["(\\d{4})(\\d{2})(\\d{3})", "$1 $2-$3", ["1(?:5[169]|6[3-5]|7[179])|2(?:1[35]|2[34]|3[3-5])", "1(?:5[169]|6(?:3[1-3]|4|5[125])|7(?:1[3-9]|7[0-24-6]|9[2-7]))|2(?:1[35]|2[34]|3[3-5])"], "8 0$1"], ["(\\d{3})(\\d{2})(\\d{2})(\\d{2})", "$1 $2-$3-$4", ["1(?:[56]|7[467])|2[1-3]"], "8 0$1"], ["(\\d{2})(\\d{3})(\\d{2})(\\d{2})", "$1 $2-$3-$4", ["[1-4]"], "8 0$1"], ["(\\d{3})(\\d{3,4})(\\d{4})", "$1 $2 $3", ["[89]"], "8 $1"]], "8", 0, "0|80?", 0, 0, 0, 0, "8~10"], "BZ": ["501", "00", "(?:0800\\d|[2-8])\\d{6}", [7, 11], [["(\\d{3})(\\d{4})", "$1-$2", ["[2-8]"]], ["(\\d)(\\d{3})(\\d{4})(\\d{3})", "$1-$2-$3-$4", ["0"]]]], "CA": ["1", "011", "[2-9]\\d{9}|3\\d{6}", [7, 10], 0, "1", 0, 0, 0, 0, 0, [["(?:2(?:04|[23]6|[48]9|5[07]|63)|3(?:06|43|54|6[578]|82)|4(?:03|1[68]|[26]8|3[178]|50|74)|5(?:06|1[49]|48|79|8[147])|6(?:04|[18]3|39|47|72)|7(?:0[59]|42|53|78|8[02])|8(?:[06]7|19|25|7[39])|9(?:0[25]|42))[2-9]\\d{6}", [10]], ["", [10]], ["8(?:00|33|44|55|66|77|88)[2-9]\\d{6}", [10]], ["900[2-9]\\d{6}", [10]], ["52(?:3(?:[2-46-9][02-9]\\d|5(?:[02-46-9]\\d|5[0-46-9]))|4(?:[2-478][02-9]\\d|5(?:[034]\\d|2[024-9]|5[0-46-9])|6(?:0[1-9]|[2-9]\\d)|9(?:[05-9]\\d|2[0-5]|49)))\\d{4}|52[34][2-9]1[02-9]\\d{4}|(?:5(?:2[125-9]|3[23]|44|66|77|88)|6(?:22|33))[2-9]\\d{6}", [10]], 0, ["310\\d{4}", [7]], 0, ["600[2-9]\\d{6}", [10]]]], "CC": ["61", "001[14-689]|14(?:1[14]|34|4[17]|[56]6|7[47]|88)0011", "1(?:[0-79]\\d{8}(?:\\d{2})?|8[0-24-9]\\d{7})|[148]\\d{8}|1\\d{5,7}", [6, 7, 8, 9, 10, 12], 0, "0", 0, "([59]\\d{7})$|0", "8$1", 0, 0, [["8(?:51(?:0(?:02|31|60|89)|1(?:18|76)|223)|91(?:0(?:1[0-2]|29)|1(?:[28]2|50|79)|2(?:10|64)|3(?:[06]8|22)|4[29]8|62\\d|70[23]|959))\\d{3}", [9]], ["4(?:79[01]|83[0-36-9]|95[0-3])\\d{5}|4(?:[0-36]\\d|4[047-9]|[58][0-24-9]|7[02-8]|9[0-47-9])\\d{6}", [9]], ["180(?:0\\d{3}|2)\\d{3}", [7, 10]], ["190[0-26]\\d{6}", [10]], 0, 0, 0, 0, ["14(?:5(?:1[0458]|[23][458])|71\\d)\\d{4}", [9]], ["13(?:00\\d{6}(?:\\d{2})?|45[0-4]\\d{3})|13\\d{4}", [6, 8, 10, 12]]], "0011"], "CD": ["243", "00", "(?:(?:[189]|5\\d)\\d|2)\\d{7}|[1-68]\\d{6}", [7, 8, 9, 10], [["(\\d{2})(\\d{2})(\\d{3})", "$1 $2 $3", ["88"], "0$1"], ["(\\d{2})(\\d{5})", "$1 $2", ["[1-6]"], "0$1"], ["(\\d{2})(\\d{2})(\\d{4})", "$1 $2 $3", ["2"], "0$1"], ["(\\d{2})(\\d{3})(\\d{4})", "$1 $2 $3", ["1"], "0$1"], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["[89]"], "0$1"], ["(\\d{2})(\\d{2})(\\d{3})(\\d{3})", "$1 $2 $3 $4", ["5"], "0$1"]], "0"], "CF": ["236", "00", "8776\\d{4}|(?:[27]\\d|61)\\d{6}", [8], [["(\\d{2})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[26-8]"]]]], "CG": ["242", "00", "222\\d{6}|(?:0\\d|80)\\d{7}", [9], [["(\\d)(\\d{4})(\\d{4})", "$1 $2 $3", ["8"]], ["(\\d{2})(\\d{3})(\\d{4})", "$1 $2 $3", ["[02]"]]]], "CH": ["41", "00", "8\\d{11}|[2-9]\\d{8}", [9, 12], [["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["8[047]|90"], "0$1"], ["(\\d{2})(\\d{3})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[2-79]|81"], "0$1"], ["(\\d{3})(\\d{2})(\\d{3})(\\d{2})(\\d{2})", "$1 $2 $3 $4 $5", ["8"], "0$1"]], "0"], "CI": ["225", "00", "[02]\\d{9}", [10], [["(\\d{2})(\\d{2})(\\d)(\\d{5})", "$1 $2 $3 $4", ["2"]], ["(\\d{2})(\\d{2})(\\d{2})(\\d{4})", "$1 $2 $3 $4", ["0"]]]], "CK": ["682", "00", "[2-578]\\d{4}", [5], [["(\\d{2})(\\d{3})", "$1 $2", ["[2-578]"]]]], "CL": ["56", "(?:0|1(?:1[0-69]|2[02-5]|5[13-58]|69|7[0167]|8[018]))0", "12300\\d{6}|6\\d{9,10}|[2-9]\\d{8}", [9, 10, 11], [["(\\d{5})(\\d{4})", "$1 $2", ["219", "2196"], "($1)"], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["60|809"]], ["(\\d{2})(\\d{3})(\\d{4})", "$1 $2 $3", ["44"]], ["(\\d)(\\d{4})(\\d{4})", "$1 $2 $3", ["2[1-36]"], "($1)"], ["(\\d)(\\d{4})(\\d{4})", "$1 $2 $3", ["9(?:10|[2-9])"]], ["(\\d{2})(\\d{3})(\\d{4})", "$1 $2 $3", ["3[2-5]|[47]|5[1-3578]|6[13-57]|8(?:0[1-8]|[1-9])"], "($1)"], ["(\\d{3})(\\d{3})(\\d{3,4})", "$1 $2 $3", ["60|8"]], ["(\\d{4})(\\d{3})(\\d{4})", "$1 $2 $3", ["1"]], ["(\\d{3})(\\d{3})(\\d{2})(\\d{3})", "$1 $2 $3 $4", ["60"]]]], "CM": ["237", "00", "[26]\\d{8}|88\\d{6,7}", [8, 9], [["(\\d{2})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["88"]], ["(\\d)(\\d{2})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4 $5", ["[26]|88"]]]], "CN": ["86", "00|1(?:[12]\\d|79)\\d\\d00", "(?:(?:1[03-689]|2\\d)\\d\\d|6)\\d{8}|1\\d{10}|[126]\\d{6}(?:\\d(?:\\d{2})?)?|86\\d{5,6}|(?:[3-579]\\d|8[0-57-9])\\d{5,9}", [7, 8, 9, 10, 11, 12], [["(\\d{2})(\\d{5,6})", "$1 $2", ["(?:10|2[0-57-9])[19]|3(?:[157]|35|49|9[1-68])|4(?:1[124-9]|2[179]|6[47-9]|7|8[23])|5(?:[1357]|2[37]|4[36]|6[1-46]|80)|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:07|1[236-8]|2[5-7]|[37]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|3|4[13]|5[1-5]|7[0-79]|9[0-35-9])|(?:4[35]|59|85)[1-9]", "(?:10|2[0-57-9])(?:1[02]|9[56])|8078|(?:3(?:[157]\\d|35|49|9[1-68])|4(?:1[124-9]|2[179]|[35][1-9]|6[47-9]|7\\d|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[1-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|3\\d|4[13]|5[1-5]|7[0-79]|9[0-35-9]))1", "10(?:1(?:0|23)|9[56])|2[0-57-9](?:1(?:00|23)|9[56])|80781|(?:3(?:[157]\\d|35|49|9[1-68])|4(?:1[124-9]|2[179]|[35][1-9]|6[47-9]|7\\d|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[1-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|3\\d|4[13]|5[1-5]|7[0-79]|9[0-35-9]))12", "10(?:1(?:0|23)|9[56])|2[0-57-9](?:1(?:00|23)|9[56])|807812|(?:3(?:[157]\\d|35|49|9[1-68])|4(?:1[124-9]|2[179]|[35][1-9]|6[47-9]|7\\d|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[1-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|3\\d|4[13]|5[1-5]|7[0-79]|9[0-35-9]))123", "10(?:1(?:0|23)|9[56])|2[0-57-9](?:1(?:00|23)|9[56])|(?:3(?:[157]\\d|35|49|9[1-68])|4(?:1[124-9]|2[179]|[35][1-9]|6[47-9]|7\\d|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:078|1[236-8]|2[5-7]|[37]\\d|5[1-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|3\\d|4[13]|5[1-5]|7[0-79]|9[0-35-9]))123"], "0$1"], ["(\\d{3})(\\d{5,6})", "$1 $2", ["3(?:[157]|35|49|9[1-68])|4(?:[17]|2[179]|6[47-9]|8[23])|5(?:[1357]|2[37]|4[36]|6[1-46]|80)|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|[379]|4[13]|5[1-5])|(?:4[35]|59|85)[1-9]", "(?:3(?:[157]\\d|35|49|9[1-68])|4(?:[17]\\d|2[179]|[35][1-9]|6[47-9]|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[1-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|[379]\\d|4[13]|5[1-5]))[19]", "85[23](?:10|95)|(?:3(?:[157]\\d|35|49|9[1-68])|4(?:[17]\\d|2[179]|[35][1-9]|6[47-9]|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[14-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|[379]\\d|4[13]|5[1-5]))(?:10|9[56])", "85[23](?:100|95)|(?:3(?:[157]\\d|35|49|9[1-68])|4(?:[17]\\d|2[179]|[35][1-9]|6[47-9]|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[14-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|[379]\\d|4[13]|5[1-5]))(?:100|9[56])"], "0$1"], ["(\\d{3})(\\d{3})(\\d{4})", "$1 $2 $3", ["(?:4|80)0"]], ["(\\d{2})(\\d{4})(\\d{4})", "$1 $2 $3", ["10|2(?:[02-57-9]|1[1-9])", "10|2(?:[02-57-9]|1[1-9])", "10[0-79]|2(?:[02-57-9]|1[1-79])|(?:10|21)8(?:0[1-9]|[1-9])"], "0$1", 1], ["(\\d{3})(\\d{3})(\\d{4})", "$1 $2 $3", ["3(?:[3-59]|7[02-68])|4(?:[26-8]|3[3-9]|5[2-9])|5(?:3[03-9]|[468]|7[028]|9[2-46-9])|6|7(?:[0-247]|3[04-9]|5[0-4689]|6[2368])|8(?:[1-358]|9[1-7])|9(?:[013479]|5[1-5])|(?:[34]1|55|79|87)[02-9]"], "0$1", 1], ["(\\d{3})(\\d{7,8})", "$1 $2", ["9"]], ["(\\d{4})(\\d{3})(\\d{4})", "$1 $2 $3", ["80"], "0$1", 1], ["(\\d{3})(\\d{4})(\\d{4})", "$1 $2 $3", ["[3-578]"], "0$1", 1], ["(\\d{3})(\\d{4})(\\d{4})", "$1 $2 $3", ["1[3-9]"]], ["(\\d{2})(\\d{3})(\\d{3})(\\d{4})", "$1 $2 $3 $4", ["[12]"], "0$1", 1]], "0", 0, "(1(?:[12]\\d|79)\\d\\d)|0", 0, 0, 0, 0, "00"], "CO": ["57", "00(?:4(?:[14]4|56)|[579])", "(?:46|60\\d\\d)\\d{6}|(?:1\\d|[39])\\d{9}", [8, 10, 11], [["(\\d{4})(\\d{4})", "$1 $2", ["46"]], ["(\\d{3})(\\d{7})", "$1 $2", ["6|90"], "($1)"], ["(\\d{3})(\\d{7})", "$1 $2", ["3[0-357]|9[14]"]], ["(\\d)(\\d{3})(\\d{7})", "$1-$2-$3", ["1"], "0$1", 0, "$1 $2 $3"]], "0", 0, "0([3579]|4(?:[14]4|56))?"], "CR": ["506", "00", "(?:8\\d|90)\\d{8}|(?:[24-8]\\d{3}|3005)\\d{4}", [8, 10], [["(\\d{4})(\\d{4})", "$1 $2", ["[2-7]|8[3-9]"]], ["(\\d{3})(\\d{3})(\\d{4})", "$1-$2-$3", ["[89]"]]], 0, 0, "(19(?:0[0-2468]|1[09]|20|66|77|99))"], "CU": ["53", "119", "(?:[2-7]|8\\d\\d)\\d{7}|[2-47]\\d{6}|[34]\\d{5}", [6, 7, 8, 10], [["(\\d{2})(\\d{4,6})", "$1 $2", ["2[1-4]|[34]"], "(0$1)"], ["(\\d)(\\d{6,7})", "$1 $2", ["7"], "(0$1)"], ["(\\d)(\\d{7})", "$1 $2", ["[56]"], "0$1"], ["(\\d{3})(\\d{7})", "$1 $2", ["8"], "0$1"]], "0"], "CV": ["238", "0", "(?:[2-59]\\d\\d|800)\\d{4}", [7], [["(\\d{3})(\\d{2})(\\d{2})", "$1 $2 $3", ["[2-589]"]]]], "CW": ["599", "00", "(?:[34]1|60|(?:7|9\\d)\\d)\\d{5}", [7, 8], [["(\\d{3})(\\d{4})", "$1 $2", ["[3467]"]], ["(\\d)(\\d{3})(\\d{4})", "$1 $2 $3", ["9[4-8]"]]], 0, 0, 0, 0, 0, "[69]"], "CX": ["61", "001[14-689]|14(?:1[14]|34|4[17]|[56]6|7[47]|88)0011", "1(?:[0-79]\\d{8}(?:\\d{2})?|8[0-24-9]\\d{7})|[148]\\d{8}|1\\d{5,7}", [6, 7, 8, 9, 10, 12], 0, "0", 0, "([59]\\d{7})$|0", "8$1", 0, 0, [["8(?:51(?:0(?:01|30|59|88)|1(?:17|46|75)|2(?:22|35))|91(?:00[6-9]|1(?:[28]1|49|78)|2(?:09|63)|3(?:12|26|75)|4(?:56|97)|64\\d|7(?:0[01]|1[0-2])|958))\\d{3}", [9]], ["4(?:79[01]|83[0-36-9]|95[0-3])\\d{5}|4(?:[0-36]\\d|4[047-9]|[58][0-24-9]|7[02-8]|9[0-47-9])\\d{6}", [9]], ["180(?:0\\d{3}|2)\\d{3}", [7, 10]], ["190[0-26]\\d{6}", [10]], 0, 0, 0, 0, ["14(?:5(?:1[0458]|[23][458])|71\\d)\\d{4}", [9]], ["13(?:00\\d{6}(?:\\d{2})?|45[0-4]\\d{3})|13\\d{4}", [6, 8, 10, 12]]], "0011"], "CY": ["357", "00", "(?:[279]\\d|[58]0)\\d{6}", [8], [["(\\d{2})(\\d{6})", "$1 $2", ["[257-9]"]]]], "CZ": ["420", "00", "(?:[2-578]\\d|60)\\d{7}|9\\d{8,11}", [9, 10, 11, 12], [["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["[2-8]|9[015-7]"]], ["(\\d{2})(\\d{3})(\\d{3})(\\d{2})", "$1 $2 $3 $4", ["96"]], ["(\\d{2})(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3 $4", ["9"]], ["(\\d{3})(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3 $4", ["9"]]]], "DE": ["49", "00", "[2579]\\d{5,14}|49(?:[34]0|69|8\\d)\\d\\d?|49(?:37|49|60|7[089]|9\\d)\\d{1,3}|49(?:2[024-9]|3[2-689]|7[1-7])\\d{1,8}|(?:1|[368]\\d|4[0-8])\\d{3,13}|49(?:[015]\\d|2[13]|31|[46][1-8])\\d{1,9}", [4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15], [["(\\d{2})(\\d{3,13})", "$1 $2", ["3[02]|40|[68]9"], "0$1"], ["(\\d{3})(\\d{3,12})", "$1 $2", ["2(?:0[1-389]|1[124]|2[18]|3[14])|3(?:[35-9][15]|4[015])|906|(?:2[4-9]|4[2-9]|[579][1-9]|[68][1-8])1", "2(?:0[1-389]|12[0-8])|3(?:[35-9][15]|4[015])|906|2(?:[13][14]|2[18])|(?:2[4-9]|4[2-9]|[579][1-9]|[68][1-8])1"], "0$1"], ["(\\d{4})(\\d{2,11})", "$1 $2", ["[24-6]|3(?:[3569][02-46-9]|4[2-4679]|7[2-467]|8[2-46-8])|70[2-8]|8(?:0[2-9]|[1-8])|90[7-9]|[79][1-9]", "[24-6]|3(?:3(?:0[1-467]|2[127-9]|3[124578]|7[1257-9]|8[1256]|9[145])|4(?:2[135]|4[13578]|9[1346])|5(?:0[14]|2[1-3589]|6[1-4]|7[13468]|8[13568])|6(?:2[1-489]|3[124-6]|6[13]|7[12579]|8[1-356]|9[135])|7(?:2[1-7]|4[145]|6[1-5]|7[1-4])|8(?:21|3[1468]|6|7[1467]|8[136])|9(?:0[12479]|2[1358]|4[134679]|6[1-9]|7[136]|8[147]|9[1468]))|70[2-8]|8(?:0[2-9]|[1-8])|90[7-9]|[79][1-9]|3[68]4[1347]|3(?:47|60)[1356]|3(?:3[46]|46|5[49])[1246]|3[4579]3[1357]"], "0$1"], ["(\\d{3})(\\d{4})", "$1 $2", ["138"], "0$1"], ["(\\d{5})(\\d{2,10})", "$1 $2", ["3"], "0$1"], ["(\\d{3})(\\d{5,11})", "$1 $2", ["181"], "0$1"], ["(\\d{3})(\\d)(\\d{4,10})", "$1 $2 $3", ["1(?:3|80)|9"], "0$1"], ["(\\d{3})(\\d{7,8})", "$1 $2", ["1[67]"], "0$1"], ["(\\d{3})(\\d{7,12})", "$1 $2", ["8"], "0$1"], ["(\\d{5})(\\d{6})", "$1 $2", ["185", "1850", "18500"], "0$1"], ["(\\d{3})(\\d{4})(\\d{4})", "$1 $2 $3", ["7"], "0$1"], ["(\\d{4})(\\d{7})", "$1 $2", ["18[68]"], "0$1"], ["(\\d{4})(\\d{7})", "$1 $2", ["15[1279]"], "0$1"], ["(\\d{5})(\\d{6})", "$1 $2", ["15[03568]", "15(?:[0568]|3[13])"], "0$1"], ["(\\d{3})(\\d{8})", "$1 $2", ["18"], "0$1"], ["(\\d{3})(\\d{2})(\\d{7,8})", "$1 $2 $3", ["1(?:6[023]|7)"], "0$1"], ["(\\d{4})(\\d{2})(\\d{7})", "$1 $2 $3", ["15[279]"], "0$1"], ["(\\d{3})(\\d{2})(\\d{8})", "$1 $2 $3", ["15"], "0$1"]], "0"], "DJ": ["253", "00", "(?:2\\d|77)\\d{6}", [8], [["(\\d{2})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[27]"]]]], "DK": ["45", "00", "[2-9]\\d{7}", [8], [["(\\d{2})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[2-9]"]]]], "DM": ["1", "011", "(?:[58]\\d\\d|767|900)\\d{7}", [10], 0, "1", 0, "([2-7]\\d{6})$|1", "767$1", 0, "767"], "DO": ["1", "011", "(?:[58]\\d\\d|900)\\d{7}", [10], 0, "1", 0, 0, 0, 0, "8001|8[024]9"], "DZ": ["213", "00", "(?:[1-4]|[5-79]\\d|80)\\d{7}", [8, 9], [["(\\d{2})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[1-4]"], "0$1"], ["(\\d{2})(\\d{3})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["9"], "0$1"], ["(\\d{3})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[5-8]"], "0$1"]], "0"], "EC": ["593", "00", "1\\d{9,10}|(?:[2-7]|9\\d)\\d{7}", [8, 9, 10, 11], [["(\\d)(\\d{3})(\\d{4})", "$1 $2-$3", ["[2-7]"], "(0$1)", 0, "$1-$2-$3"], ["(\\d{2})(\\d{3})(\\d{4})", "$1 $2 $3", ["9"], "0$1"], ["(\\d{4})(\\d{3})(\\d{3,4})", "$1 $2 $3", ["1"]]], "0"], "EE": ["372", "00", "8\\d{9}|[4578]\\d{7}|(?:[3-8]\\d|90)\\d{5}", [7, 8, 10], [["(\\d{3})(\\d{4})", "$1 $2", ["[369]|4[3-8]|5(?:[0-2]|5[0-478]|6[45])|7[1-9]|88", "[369]|4[3-8]|5(?:[02]|1(?:[0-8]|95)|5[0-478]|6(?:4[0-4]|5[1-589]))|7[1-9]|88"]], ["(\\d{4})(\\d{3,4})", "$1 $2", ["[45]|8(?:00|[1-49])", "[45]|8(?:00[1-9]|[1-49])"]], ["(\\d{2})(\\d{2})(\\d{4})", "$1 $2 $3", ["7"]], ["(\\d{4})(\\d{3})(\\d{3})", "$1 $2 $3", ["8"]]]], "EG": ["20", "00", "[189]\\d{8,9}|[24-6]\\d{8}|[135]\\d{7}", [8, 9, 10], [["(\\d)(\\d{7,8})", "$1 $2", ["[23]"], "0$1"], ["(\\d{2})(\\d{6,7})", "$1 $2", ["1[35]|[4-6]|8[2468]|9[235-7]"], "0$1"], ["(\\d{3})(\\d{3})(\\d{4})", "$1 $2 $3", ["[89]"], "0$1"], ["(\\d{2})(\\d{8})", "$1 $2", ["1"], "0$1"]], "0"], "EH": ["212", "00", "[5-8]\\d{8}", [9], 0, "0", 0, 0, 0, 0, 0, [["528[89]\\d{5}"], ["(?:6(?:[0-79]\\d|8[0-247-9])|7(?:[016-8]\\d|2[0-8]|5[0-5]))\\d{6}"], ["80[0-7]\\d{6}"], ["89\\d{7}"], 0, 0, 0, 0, ["(?:592(?:4[0-2]|93)|80[89]\\d\\d)\\d{4}"]]], "ER": ["291", "00", "[178]\\d{6}", [7], [["(\\d)(\\d{3})(\\d{3})", "$1 $2 $3", ["[178]"], "0$1"]], "0"], "ES": ["34", "00", "[5-9]\\d{8}", [9], [["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["[89]00"]], ["(\\d{3})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[5-9]"]]]], "ET": ["251", "00", "(?:11|[2-57-9]\\d)\\d{7}", [9], [["(\\d{2})(\\d{3})(\\d{4})", "$1 $2 $3", ["[1-57-9]"], "0$1"]], "0"], "FI": ["358", "00|99(?:[01469]|5(?:[14]1|3[23]|5[59]|77|88|9[09]))", "[1-35689]\\d{4}|7\\d{10,11}|(?:[124-7]\\d|3[0-46-9])\\d{8}|[1-9]\\d{5,8}", [5, 6, 7, 8, 9, 10, 11, 12], [["(\\d{5})", "$1", ["20[2-59]"], "0$1"], ["(\\d{3})(\\d{3,7})", "$1 $2", ["(?:[1-3]0|[68])0|70[07-9]"], "0$1"], ["(\\d{2})(\\d{4,8})", "$1 $2", ["[14]|2[09]|50|7[135]"], "0$1"], ["(\\d{2})(\\d{6,10})", "$1 $2", ["7"], "0$1"], ["(\\d)(\\d{4,9})", "$1 $2", ["(?:19|[2568])[1-8]|3(?:0[1-9]|[1-9])|9"], "0$1"]], "0", 0, 0, 0, 0, "1[03-79]|[2-9]", 0, "00"], "FJ": ["679", "0(?:0|52)", "45\\d{5}|(?:0800\\d|[235-9])\\d{6}", [7, 11], [["(\\d{3})(\\d{4})", "$1 $2", ["[235-9]|45"]], ["(\\d{4})(\\d{3})(\\d{4})", "$1 $2 $3", ["0"]]], 0, 0, 0, 0, 0, 0, 0, "00"], "FK": ["500", "00", "[2-7]\\d{4}", [5]], "FM": ["691", "00", "(?:[39]\\d\\d|820)\\d{4}", [7], [["(\\d{3})(\\d{4})", "$1 $2", ["[389]"]]]], "FO": ["298", "00", "[2-9]\\d{5}", [6], [["(\\d{6})", "$1", ["[2-9]"]]], 0, 0, "(10(?:01|[12]0|88))"], "FR": ["33", "00", "[1-9]\\d{8}", [9], [["(\\d{3})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["8"], "0 $1"], ["(\\d)(\\d{2})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4 $5", ["[1-79]"], "0$1"]], "0"], "GA": ["241", "00", "(?:[067]\\d|11)\\d{6}|[2-7]\\d{6}", [7, 8], [["(\\d)(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[2-7]"], "0$1"], ["(\\d{2})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["0"]], ["(\\d{2})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["11|[67]"], "0$1"]], 0, 0, "0(11\\d{6}|60\\d{6}|61\\d{6}|6[256]\\d{6}|7[467]\\d{6})", "$1"], "GB": ["44", "00", "[1-357-9]\\d{9}|[18]\\d{8}|8\\d{6}", [7, 9, 10], [["(\\d{3})(\\d{4})", "$1 $2", ["800", "8001", "80011", "800111", "8001111"], "0$1"], ["(\\d{3})(\\d{2})(\\d{2})", "$1 $2 $3", ["845", "8454", "84546", "845464"], "0$1"], ["(\\d{3})(\\d{6})", "$1 $2", ["800"], "0$1"], ["(\\d{5})(\\d{4,5})", "$1 $2", ["1(?:38|5[23]|69|76|94)", "1(?:(?:38|69)7|5(?:24|39)|768|946)", "1(?:3873|5(?:242|39[4-6])|(?:697|768)[347]|9467)"], "0$1"], ["(\\d{4})(\\d{5,6})", "$1 $2", ["1(?:[2-69][02-9]|[78])"], "0$1"], ["(\\d{2})(\\d{4})(\\d{4})", "$1 $2 $3", ["[25]|7(?:0|6[02-9])", "[25]|7(?:0|6(?:[03-9]|2[356]))"], "0$1"], ["(\\d{4})(\\d{6})", "$1 $2", ["7"], "0$1"], ["(\\d{3})(\\d{3})(\\d{4})", "$1 $2 $3", ["[1389]"], "0$1"]], "0", 0, "0|180020", 0, 0, 0, [["(?:1(?:1(?:3(?:[0-58]\\d\\d|73[0-5])|4(?:(?:[0-5]\\d|70)\\d|69[7-9])|(?:(?:5[0-26-9]|[78][0-49])\\d|6(?:[0-4]\\d|5[01]))\\d)|(?:2(?:(?:0[024-9]|2[3-9]|3[3-79]|4[1-689]|[58][02-9]|6[0-47-9]|7[013-9]|9\\d)\\d|1(?:[0-7]\\d|8[0-3]))|(?:3(?:0\\d|1[0-8]|[25][02-9]|3[02-579]|[468][0-46-9]|7[1-35-79]|9[2-578])|4(?:0[03-9]|[137]\\d|[28][02-57-9]|4[02-69]|5[0-8]|[69][0-79])|5(?:0[1-35-9]|[16]\\d|2[024-9]|3[015689]|4[02-9]|5[03-9]|7[0-35-9]|8[0-468]|9[0-57-9])|6(?:0[034689]|1\\d|2[0-35689]|[38][013-9]|4[1-467]|5[0-69]|6[13-9]|7[0-8]|9[0-24578])|7(?:0[0246-9]|2\\d|3[0236-8]|4[03-9]|5[0-46-9]|6[013-9]|7[0-35-9]|8[024-9]|9[02-9])|8(?:0[35-9]|2[1-57-9]|3[02-578]|4[0-578]|5[124-9]|6[2-69]|7\\d|8[02-9]|9[02569])|9(?:0[02-589]|[18]\\d|2[02-689]|3[1-57-9]|4[2-9]|5[0-579]|6[2-47-9]|7[0-24578]|9[2-57]))\\d)\\d)|2(?:0[013478]|3[0189]|4[017]|8[0-46-9]|9[0-2])\\d{3})\\d{4}|1(?:2(?:0(?:46[1-4]|87[2-9])|545[1-79]|76(?:2\\d|3[1-8]|6[1-6])|9(?:7(?:2[0-4]|3[2-5])|8(?:2[2-8]|7[0-47-9]|8[3-5])))|3(?:6(?:38[2-5]|47[23])|8(?:47[04-9]|64[0157-9]))|4(?:044[1-7]|20(?:2[23]|8\\d)|6(?:0(?:30|5[2-57]|6[1-8]|7[2-8])|140)|8(?:052|87[1-3]))|5(?:2(?:4(?:3[2-79]|6\\d)|76\\d)|6(?:26[06-9]|686))|6(?:06(?:4\\d|7[4-79])|295[5-7]|35[34]\\d|47(?:24|61)|59(?:5[08]|6[67]|74)|9(?:55[0-4]|77[23]))|7(?:26(?:6[13-9]|7[0-7])|(?:442|688)\\d|50(?:2[0-3]|[3-68]2|76))|8(?:27[56]\\d|37(?:5[2-5]|8[239])|843[2-58])|9(?:0(?:0(?:6[1-8]|85)|52\\d)|3583|4(?:66[1-8]|9(?:2[01]|81))|63(?:23|3[1-4])|9561))\\d{3}", [9, 10]], ["7(?:457[0-57-9]|700[01]|911[028])\\d{5}|7(?:[1-3]\\d\\d|4(?:[0-46-9]\\d|5[0-689])|5(?:0[0-8]|[13-9]\\d|2[0-35-9])|7(?:0[1-9]|[1-7]\\d|8[02-9]|9[0-689])|8(?:[014-9]\\d|[23][0-8])|9(?:[024-9]\\d|1[02-9]|3[0-689]))\\d{6}", [10]], ["80[08]\\d{7}|800\\d{6}|8001111"], ["(?:8(?:4[2-5]|7[0-3])|9(?:[01]\\d|8[2-49]))\\d{7}|845464\\d", [7, 10]], ["70\\d{8}", [10]], 0, ["(?:3[0347]|55)\\d{8}", [10]], ["76(?:464|652)\\d{5}|76(?:0[0-28]|2[356]|34|4[01347]|5[49]|6[0-369]|77|8[14]|9[139])\\d{6}", [10]], ["56\\d{8}", [10]]], 0, " x"], "GD": ["1", "011", "(?:473|[58]\\d\\d|900)\\d{7}", [10], 0, "1", 0, "([2-9]\\d{6})$|1", "473$1", 0, "473"], "GE": ["995", "00", "(?:[3-57]\\d\\d|800)\\d{6}", [9], [["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["70"], "0$1"], ["(\\d{2})(\\d{3})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["32"], "0$1"], ["(\\d{3})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[57]"]], ["(\\d{3})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[348]"], "0$1"]], "0"], "GF": ["594", "00", "(?:694\\d|7093)\\d{5}|(?:59|[89]\\d)\\d{7}", [9], [["(\\d{3})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[5-7]|80[6-9]|9[47]"], "0$1"], ["(\\d{3})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[89]"], "0$1"]], "0"], "GG": ["44", "00", "(?:1481|[357-9]\\d{3})\\d{6}|8\\d{6}(?:\\d{2})?", [7, 9, 10], 0, "0", 0, "([25-9]\\d{5})$|0|180020", "1481$1", 0, 0, [["1481[25-9]\\d{5}", [10]], ["7(?:(?:781|839)\\d|911[17])\\d{5}", [10]], ["80[08]\\d{7}|800\\d{6}|8001111"], ["(?:8(?:4[2-5]|7[0-3])|9(?:[01]\\d|8[0-3]))\\d{7}|845464\\d", [7, 10]], ["70\\d{8}", [10]], 0, ["(?:3[0347]|55)\\d{8}", [10]], ["76(?:464|652)\\d{5}|76(?:0[0-28]|2[356]|34|4[01347]|5[49]|6[0-369]|77|8[14]|9[139])\\d{6}", [10]], ["56\\d{8}", [10]]]], "GH": ["233", "00", "[235]\\d{8}|800\\d{5,6}", [8, 9], [["(\\d{3})(\\d{5})", "$1 $2", ["8"], "0$1"], ["(\\d{2})(\\d{3})(\\d{4})", "$1 $2 $3", ["[2358]"], "0$1"]], "0"], "GI": ["350", "00", "(?:[25]\\d|60)\\d{6}", [8], [["(\\d{3})(\\d{5})", "$1 $2", ["2"]]]], "GL": ["299", "00", "(?:19|[2-689]\\d|70)\\d{4}", [6], [["(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3", ["19|[2-9]"]]]], "GM": ["220", "00", "[2-9]\\d{6}", [7], [["(\\d{3})(\\d{4})", "$1 $2", ["[2-9]"]]]], "GN": ["224", "00", "722\\d{6}|(?:3|6\\d)\\d{7}", [8, 9], [["(\\d{2})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["3"]], ["(\\d{3})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[67]"]]]], "GP": ["590", "00", "7090\\d{5}|(?:[56]9|[89]\\d)\\d{7}", [9], [["(\\d{3})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[5-79]|80[6-9]"], "0$1"], ["(\\d{3})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["8"], "0$1"]], "0", 0, 0, 0, 0, 0, [["(?:59(?:0(?:0[1-68]|[14][0-24-9]|2[0-68]|3[1-9]|5[3-579]|[68][0-689]|7[08]|9\\d)|87\\d)|80[6-9]\\d\\d)\\d{4}"], ["(?:69(?:0\\d\\d|1(?:2[2-9]|3[0-5]))|7090[0-4])\\d{4}"], ["80[0-5]\\d{6}"], ["8[129]\\d{7}"], 0, 0, 0, 0, ["9(?:(?:39[5-7]|76[018])\\d|475[0-6])\\d{4}"]]], "GQ": ["240", "00", "222\\d{6}|(?:3\\d|55|[89]0)\\d{7}", [9], [["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["[235]"]], ["(\\d{3})(\\d{6})", "$1 $2", ["[89]"]]]], "GR": ["30", "00", "5005000\\d{3}|8\\d{9,11}|(?:[269]\\d|70)\\d{8}", [10, 11, 12], [["(\\d{2})(\\d{4})(\\d{4})", "$1 $2 $3", ["21|7"]], ["(\\d{4})(\\d{6})", "$1 $2", ["2(?:2|3[2-57-9]|4[2-469]|5[2-59]|6[2-9]|7[2-69]|8[2-49])|5"]], ["(\\d{3})(\\d{3})(\\d{4})", "$1 $2 $3", ["[2689]"]], ["(\\d{3})(\\d{3,4})(\\d{5})", "$1 $2 $3", ["8"]]]], "GT": ["502", "00", "80\\d{6}|(?:1\\d{3}|[2-7])\\d{7}", [8, 11], [["(\\d{4})(\\d{4})", "$1 $2", ["[2-8]"]], ["(\\d{4})(\\d{3})(\\d{4})", "$1 $2 $3", ["1"]]]], "GU": ["1", "011", "(?:[58]\\d\\d|671|900)\\d{7}", [10], 0, "1", 0, "([2-9]\\d{6})$|1", "671$1", 0, "671"], "GW": ["245", "00", "[49]\\d{8}|4\\d{6}", [7, 9], [["(\\d{3})(\\d{4})", "$1 $2", ["40"]], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["[49]"]]]], "GY": ["592", "001", "(?:[2-8]\\d{3}|9008)\\d{3}", [7], [["(\\d{3})(\\d{4})", "$1 $2", ["[2-9]"]]]], "HK": ["852", "00(?:30|5[09]|[126-9]?)", "8[0-46-9]\\d{6,7}|9\\d{4,7}|(?:[2-7]|9\\d{3})\\d{7}", [5, 6, 7, 8, 9, 11], [["(\\d{3})(\\d{2,5})", "$1 $2", ["900", "9003"]], ["(\\d{4})(\\d{4})", "$1 $2", ["[2-7]|8[1-4]|9(?:0[1-9]|[1-8])"]], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["8"]], ["(\\d{3})(\\d{2})(\\d{3})(\\d{3})", "$1 $2 $3 $4", ["9"]]], 0, 0, 0, 0, 0, 0, 0, "00"], "HN": ["504", "00", "8\\d{10}|[237-9]\\d{7}", [8, 11], [["(\\d{4})(\\d{4})", "$1-$2", ["[237-9]"]]]], "HR": ["385", "00", "[2-69]\\d{8}|80\\d{5,7}|[1-79]\\d{7}|6\\d{6}", [7, 8, 9], [["(\\d{2})(\\d{2})(\\d{3})", "$1 $2 $3", ["6[01]"], "0$1"], ["(\\d{3})(\\d{2})(\\d{2,3})", "$1 $2 $3", ["8"], "0$1"], ["(\\d)(\\d{4})(\\d{3})", "$1 $2 $3", ["1"], "0$1"], ["(\\d{2})(\\d{3})(\\d{3,4})", "$1 $2 $3", ["6|7[245]"], "0$1"], ["(\\d{2})(\\d{3})(\\d{3,4})", "$1 $2 $3", ["9"], "0$1"], ["(\\d{2})(\\d{3})(\\d{3,4})", "$1 $2 $3", ["[2-57]"], "0$1"], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["8"], "0$1"]], "0"], "HT": ["509", "00", "[2-589]\\d{7}", [8], [["(\\d{2})(\\d{2})(\\d{4})", "$1 $2 $3", ["[2-589]"]]]], "HU": ["36", "00", "[235-7]\\d{8}|[1-9]\\d{7}", [8, 9], [["(\\d)(\\d{3})(\\d{4})", "$1 $2 $3", ["1"], "(06 $1)"], ["(\\d{2})(\\d{3})(\\d{3})", "$1 $2 $3", ["[27][2-9]|3[2-7]|4[24-9]|5[2-79]|6|8[2-57-9]|9[2-69]"], "(06 $1)"], ["(\\d{2})(\\d{3})(\\d{3,4})", "$1 $2 $3", ["[2-9]"], "06 $1"]], "06"], "ID": ["62", "00[89]", "00[1-9]\\d{9,14}|(?:[1-36]|8\\d{5})\\d{6}|00\\d{9}|[1-9]\\d{8,10}|[2-9]\\d{7}", [7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17], [["(\\d)(\\d{3})(\\d{3})", "$1 $2 $3", ["15"]], ["(\\d{2})(\\d{5,9})", "$1 $2", ["2[124]|[36]1"], "(0$1)"], ["(\\d{3})(\\d{5,7})", "$1 $2", ["800"], "0$1"], ["(\\d{3})(\\d{5,8})", "$1 $2", ["[2-79]"], "(0$1)"], ["(\\d{3})(\\d{3,4})(\\d{3})", "$1-$2-$3", ["8[1-35-9]"], "0$1"], ["(\\d{3})(\\d{6,8})", "$1 $2", ["1"], "0$1"], ["(\\d{3})(\\d{3})(\\d{4})", "$1 $2 $3", ["804"], "0$1"], ["(\\d{3})(\\d)(\\d{3})(\\d{3})", "$1 $2 $3 $4", ["80"], "0$1"], ["(\\d{3})(\\d{4})(\\d{4,5})", "$1-$2-$3", ["8"], "0$1"]], "0"], "IE": ["353", "00", "(?:1\\d|[2569])\\d{6,8}|4\\d{6,9}|7\\d{8}|8\\d{8,9}", [7, 8, 9, 10], [["(\\d{2})(\\d{5})", "$1 $2", ["2[24-9]|47|58|6[237-9]|9[35-9]"], "(0$1)"], ["(\\d{3})(\\d{5})", "$1 $2", ["[45]0"], "(0$1)"], ["(\\d)(\\d{3,4})(\\d{4})", "$1 $2 $3", ["1"], "(0$1)"], ["(\\d{2})(\\d{3})(\\d{3,4})", "$1 $2 $3", ["[2569]|4[1-69]|7[14]"], "(0$1)"], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["70"], "0$1"], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["81"], "(0$1)"], ["(\\d{2})(\\d{3})(\\d{4})", "$1 $2 $3", ["[78]"], "0$1"], ["(\\d{4})(\\d{3})(\\d{3})", "$1 $2 $3", ["1"]], ["(\\d{2})(\\d{4})(\\d{4})", "$1 $2 $3", ["4"], "(0$1)"], ["(\\d{2})(\\d)(\\d{3})(\\d{4})", "$1 $2 $3 $4", ["8"], "0$1"]], "0"], "IL": ["972", "0(?:0|1[2-9])", "1\\d{6}(?:\\d{3,5})?|[57]\\d{8}|[1-489]\\d{7}", [7, 8, 9, 10, 11, 12], [["(\\d{4})(\\d{3})", "$1-$2", ["125"]], ["(\\d{4})(\\d{2})(\\d{2})", "$1-$2-$3", ["121"]], ["(\\d)(\\d{3})(\\d{4})", "$1-$2-$3", ["[2-489]"], "0$1"], ["(\\d{2})(\\d{3})(\\d{4})", "$1-$2-$3", ["[57]"], "0$1"], ["(\\d{4})(\\d{3})(\\d{3})", "$1-$2-$3", ["12"]], ["(\\d{4})(\\d{6})", "$1-$2", ["159"]], ["(\\d)(\\d{3})(\\d{3})(\\d{3})", "$1-$2-$3-$4", ["1[7-9]"]], ["(\\d{3})(\\d{1,2})(\\d{3})(\\d{4})", "$1-$2 $3-$4", ["15"]]], "0"], "IM": ["44", "00", "1624\\d{6}|(?:[3578]\\d|90)\\d{8}", [10], 0, "0", 0, "([25-8]\\d{5})$|0|180020", "1624$1", 0, "74576|(?:16|7[56])24"], "IN": ["91", "00", "(?:000800|[2-9]\\d\\d)\\d{7}|1\\d{7,12}", [8, 9, 10, 11, 12, 13], [["(\\d{8})", "$1", ["5(?:0|2[23]|3[03]|[67]1|88)", "5(?:0|2(?:21|3)|3(?:0|3[23])|616|717|888)", "5(?:0|2(?:21|3)|3(?:0|3[23])|616|717|8888)"], 0, 1], ["(\\d{4})(\\d{4,5})", "$1 $2", ["180", "1800"], 0, 1], ["(\\d{3})(\\d{3})(\\d{4})", "$1 $2 $3", ["140"], 0, 1], ["(\\d{2})(\\d{4})(\\d{4})", "$1 $2 $3", ["11|2[02]|33|4[04]|79[1-7]|80[2-46]", "11|2[02]|33|4[04]|79(?:[1-6]|7[19])|80(?:[2-4]|6[0-589])", "11|2[02]|33|4[04]|79(?:[124-6]|3(?:[02-9]|1[0-24-9])|7(?:1|9[1-6]))|80(?:[2-4]|6[0-589])"], "0$1", 1], ["(\\d{3})(\\d{3})(\\d{4})", "$1 $2 $3", ["1(?:2[0-249]|3[0-25]|4[145]|[68]|7[1257])|2(?:1[257]|3[013]|4[01]|5[0137]|6[0158]|78|8[1568])|3(?:26|4[1-3]|5[34]|6[01489]|7[02-46]|8[159])|4(?:1[36]|2[1-47]|5[12]|6[0-26-9]|7[0-24-9]|8[013-57]|9[014-7])|5(?:1[025]|22|[36][25]|4[28]|5[12]|[78]1)|6(?:12|[2-4]1|5[17]|6[13]|80)|7(?:12|3[134]|61|88)|8(?:16|2[014]|3[126]|6[136]|7[078]|8[34]|91)|(?:43|59|75)[15]|(?:1[59]|29|67)[14]", "1(?:2[0-24]|3[0-25]|4[145]|[59][14]|6[1-9]|7[1257]|8[1-57-9])|2(?:1[257]|3[013]|4[01]|5[0137]|6[058]|78|8[1568]|9[14])|3(?:26|4[1-3]|5[34]|6[01489]|7[02-46]|8[159])|4(?:1[36]|2[1-47]|3[15]|5[12]|6[0-26-9]|7[0-24-9]|8[013-57]|9[014-7])|5(?:1[025]|22|[36][25]|4[28]|[578]1|9[15])|674|7(?:(?:3[34]|5[15])[2-6]|61[346]|88[0-8])|8(?:70[2-6]|84[235-7]|91[3-7])|(?:1(?:29|60|8[06])|261|552|6(?:12|[2-47]1|5[17]|6[13]|80)|7(?:12|31)|8(?:16|2[014]|3[126]|6[136]|7[78]|83))[2-7]", "1(?:2[0-24]|3[0-25]|4[145]|[59][14]|6[1-9]|7[1257]|8[1-57-9])|2(?:1[257]|3[013]|4[01]|5[0137]|6[058]|78|8[1568]|9[14])|3(?:26|4[1-3]|5[34]|6[01489]|7[02-46]|8[159])|4(?:1[36]|2[1-47]|3[15]|5[12]|6[0-26-9]|7[0-24-9]|8[013-57]|9[014-7])|5(?:1[025]|22|[36][25]|4[28]|[578]1|9[15])|6(?:12(?:[2-6]|7[0-8])|74[2-7])|7(?:3171|5[15][2-6]|61[346]|88(?:[2-7]|82))|8(?:70[2-6]|84(?:[2356]|7[19])|91(?:[3-6]|7[19]))|73[134][2-6]|8(?:16|2[014]|3[126]|6[136]|7[78]|83)(?:[2-6]|7[19])|(?:1(?:29|60|8[06])|261|552|6(?:[2-4]1|5[17]|6[13]|7(?:1|4[0189])|80)|7(?:12|88[01]))[2-7]"], "0$1", 1], ["(\\d{4})(\\d{3})(\\d{3})", "$1 $2 $3", ["1(?:[2-479]|5[0235-9])|[2-5]|6(?:1[1358]|2[2457-9]|3[2-5]|4[235-7]|5[2-689]|6[24578]|7[235689]|8[1-6])|7(?:1[013-9]|3[129]|5[29]|6[02-5]|70)|807", "1(?:[2-479]|5[0235-9])|[2-5]|6(?:1[1358]|2(?:[2457]|84|95)|3(?:[2-4]|55)|4[235-7]|5[2-689]|6[24578]|7(?:[23569]|8[0-57-9])|8[1-6])|7(?:1(?:[013-8]|9[6-9])|3(?:17|2[0-49]|9[2-57])|5(?:2[1-3]|9[0-6])|6(?:0[5689]|2[5-9]|3[02-8]|4|5[0-367])|70[13-7])|807[19]", "1(?:[2-479]|5(?:[0236-9]|5[013-9]))|[2-5]|6(?:2(?:84|95)|355|8(?:28[235-7]|3))|73179|807(?:1|9[1-3])|(?:1552|6(?:(?:1[1358]|2[2457]|3[2-4]|4[235-7]|5[2-689]|6[24578])\\d|7(?:[23569]\\d|8[0-57-9])|8(?:[14-6]\\d|2[0-79]))|7(?:1(?:[013-8]\\d|9[6-9])|3(?:2[0-49]|9[2-57])|5(?:2[1-3]|9[0-6])|6(?:0[5689]|2[5-9]|3[02-8]|4\\d|5[0-367])|70[13-7]))[2-7]"], "0$1", 1], ["(\\d{5})(\\d{5})", "$1 $2", ["16|[6-9]"], "0$1", 1], ["(\\d{4})(\\d{2,4})(\\d{4})", "$1 $2 $3", ["18[06]", "18[06]0"], 0, 1], ["(\\d{4})(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3 $4", ["18"], 0, 1]], "0"], "IO": ["246", "00", "3\\d{6}", [7], [["(\\d{3})(\\d{4})", "$1 $2", ["3"]]]], "IQ": ["964", "00", "(?:1|7\\d\\d)\\d{7}|[2-6]\\d{7,8}", [8, 9, 10], [["(\\d)(\\d{3})(\\d{4})", "$1 $2 $3", ["1"], "0$1"], ["(\\d{2})(\\d{3})(\\d{3,4})", "$1 $2 $3", ["[2-6]"], "0$1"], ["(\\d{3})(\\d{3})(\\d{4})", "$1 $2 $3", ["7"], "0$1"]], "0"], "IR": ["98", "00", "[1-9]\\d{9}|(?:[1-8]\\d\\d|9)\\d{3,4}", [4, 5, 6, 7, 10], [["(\\d{4,5})", "$1", ["96"], "0$1"], ["(\\d{2})(\\d{4,5})", "$1 $2", ["(?:1[137]|2[13-68]|3[1458]|4[145]|5[1468]|6[16]|7[1467]|8[13467])[12689]"], "0$1"], ["(\\d{3})(\\d{3})(\\d{3,4})", "$1 $2 $3", ["9"], "0$1"], ["(\\d{2})(\\d{4})(\\d{4})", "$1 $2 $3", ["[1-8]"], "0$1"]], "0"], "IS": ["354", "00|1(?:0(?:01|[12]0)|100)", "(?:38\\d|[4-9])\\d{6}", [7, 9], [["(\\d{3})(\\d{4})", "$1 $2", ["[4-9]"]], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["3"]]], 0, 0, 0, 0, 0, 0, 0, "00"], "IT": ["39", "00", "0\\d{5,11}|1\\d{8,10}|3(?:[0-8]\\d{7,10}|9\\d{7,8})|(?:43|55|70)\\d{8}|8\\d{5}(?:\\d{2,4})?", [6, 7, 8, 9, 10, 11, 12], [["(\\d{2})(\\d{4,6})", "$1 $2", ["0[26]"]], ["(\\d{3})(\\d{3,6})", "$1 $2", ["0[13-57-9][0159]|8(?:03|4[17]|9[2-5])", "0[13-57-9][0159]|8(?:03|4[17]|9(?:2|3[04]|[45][0-4]))"]], ["(\\d{4})(\\d{2,6})", "$1 $2", ["0(?:[13-579][2-46-8]|8[236-8])"]], ["(\\d{4})(\\d{4})", "$1 $2", ["894"]], ["(\\d{2})(\\d{3,4})(\\d{4})", "$1 $2 $3", ["0[26]|5"]], ["(\\d{3})(\\d{3})(\\d{3,4})", "$1 $2 $3", ["1(?:44|[679])|[378]|43"]], ["(\\d{3})(\\d{3,4})(\\d{4})", "$1 $2 $3", ["0[13-57-9][0159]|14"]], ["(\\d{2})(\\d{4})(\\d{5})", "$1 $2 $3", ["0[26]"]], ["(\\d{4})(\\d{3})(\\d{4})", "$1 $2 $3", ["0"]], ["(\\d{3})(\\d{4})(\\d{4,5})", "$1 $2 $3", ["[03]"]]], 0, 0, 0, 0, 0, 0, [["0(?:669[0-79]\\d{1,6}|831\\d{2,8})|0(?:1(?:[0159]\\d|[27][1-5]|31|4[1-4]|6[1356]|8[2-57])|2\\d\\d|3(?:[0159]\\d|2[1-4]|3[12]|[48][1-6]|6[2-59]|7[1-7])|4(?:[0159]\\d|[23][1-9]|4[245]|6[1-5]|7[1-4]|81)|5(?:[0159]\\d|2[1-5]|3[2-6]|4[1-79]|6[4-6]|7[1-578]|8[3-8])|6(?:[0-57-9]\\d|6[0-8])|7(?:[0159]\\d|2[12]|3[1-7]|4[2-46]|6[13569]|7[13-6]|8[1-59])|8(?:[0159]\\d|2[3-578]|3[2356]|[6-8][1-5])|9(?:[0159]\\d|[238][1-5]|4[12]|6[1-8]|7[1-6]))\\d{2,7}"], ["3[2-9]\\d{7,8}|(?:31|43)\\d{8}", [9, 10]], ["80(?:0\\d{3}|3)\\d{3}", [6, 9]], ["(?:0878\\d{3}|89(?:2\\d|3[04]|4(?:[0-4]|[5-9]\\d\\d)|5[0-4]))\\d\\d|(?:1(?:44|6[346])|89(?:38|5[5-9]|9))\\d{6}", [6, 8, 9, 10]], ["1(?:78\\d|99)\\d{6}", [9, 10]], ["3[2-8]\\d{9,10}", [11, 12]], 0, 0, ["55\\d{8}", [10]], ["84(?:[08]\\d{3}|[17])\\d{3}", [6, 9]]]], "JE": ["44", "00", "1534\\d{6}|(?:[3578]\\d|90)\\d{8}", [10], 0, "0", 0, "([0-24-8]\\d{5})$|0|180020", "1534$1", 0, 0, [["1534[0-24-8]\\d{5}"], ["7(?:(?:(?:50|82)9|937)\\d|7(?:00[378]|97\\d))\\d{5}"], ["80(?:07(?:35|81)|8901)\\d{4}"], ["(?:8(?:4(?:4(?:4(?:05|42|69)|703)|5(?:041|800))|7(?:0002|1206))|90(?:066[59]|1810|71(?:07|55)))\\d{4}"], ["701511\\d{4}"], 0, ["(?:3(?:0(?:07(?:35|81)|8901)|3\\d{4}|4(?:4(?:4(?:05|42|69)|703)|5(?:041|800))|7(?:0002|1206))|55\\d{4})\\d{4}"], ["76(?:464|652)\\d{5}|76(?:0[0-28]|2[356]|34|4[01347]|5[49]|6[0-369]|77|8[14]|9[139])\\d{6}"], ["56\\d{8}"]]], "JM": ["1", "011", "(?:[58]\\d\\d|658|900)\\d{7}", [10], 0, "1", 0, 0, 0, 0, "658|876"], "JO": ["962", "00", "(?:(?:[2689]|7\\d)\\d|32|427|53)\\d{6}", [8, 9], [["(\\d)(\\d{3})(\\d{4})", "$1 $2 $3", ["[2356]|87"], "(0$1)"], ["(\\d{3})(\\d{5,6})", "$1 $2", ["[89]"], "0$1"], ["(\\d{2})(\\d{7})", "$1 $2", ["70"], "0$1"], ["(\\d)(\\d{4})(\\d{4})", "$1 $2 $3", ["[47]"], "0$1"]], "0"], "JP": ["81", "010", "00[1-9]\\d{6,14}|[25-9]\\d{9}|(?:00|[1-9]\\d\\d)\\d{6}", [8, 9, 10, 11, 12, 13, 14, 15, 16, 17], [["(\\d{3})(\\d{3})(\\d{3})", "$1-$2-$3", ["(?:12|57|99)0"], "0$1"], ["(\\d{4})(\\d)(\\d{4})", "$1-$2-$3", ["1(?:26|3[79]|4[56]|5[4-68]|6[3-5])|499|5(?:76|97)|746|8(?:3[89]|47|51)|9(?:80|9[16])", "1(?:267|3(?:7[247]|9[278])|466|5(?:47|58|64)|6(?:3[245]|48|5[4-68]))|499[2468]|5(?:76|97)9|7468|8(?:3(?:8[7-9]|96)|477|51[2-9])|9(?:802|9(?:1[23]|69))|1(?:45|58)[67]", "1(?:267|3(?:7[247]|9[278])|466|5(?:47|58|64)|6(?:3[245]|48|5[4-68]))|499[2468]|5(?:769|979[2-69])|7468|8(?:3(?:8[7-9]|96[2457-9])|477|51[2-9])|9(?:802|9(?:1[23]|69))|1(?:45|58)[67]"], "0$1"], ["(\\d{2})(\\d{3})(\\d{4})", "$1-$2-$3", ["60"], "0$1"], ["(\\d)(\\d{4})(\\d{4})", "$1-$2-$3", ["3|4(?:2[09]|7[01])|6[1-9]", "3|4(?:2(?:0|9[02-69])|7(?:0[019]|1))|6[1-9]"], "0$1"], ["(\\d{2})(\\d{3})(\\d{4})", "$1-$2-$3", ["1(?:1|5[45]|77|88|9[69])|2(?:2[1-37]|3[0-269]|4[59]|5|6[24]|7[1-358]|8[1369]|9[0-38])|4(?:[28][1-9]|3[0-57]|[45]|6[248]|7[2-579]|9[29])|5(?:2|3[0459]|4[0-369]|5[29]|8[02389]|9[0-389])|7(?:2[02-46-9]|34|[58]|6[0249]|7[57]|9[2-6])|8(?:2[124589]|3[26-9]|49|51|6|7[0-468]|8[68]|9[019])|9(?:[23][1-9]|4[15]|5[138]|6[1-3]|7[156]|8[189]|9[1-489])", "1(?:1|5(?:4[018]|5[017])|77|88|9[69])|2(?:2(?:[127]|3[014-9])|3[0-269]|4[59]|5(?:[1-3]|5[0-69]|9[19])|62|7(?:[1-35]|8[0189])|8(?:[16]|3[0134]|9[0-5])|9(?:[028]|17))|4(?:2(?:[13-79]|8[014-6])|3[0-57]|[45]|6[248]|7[2-47]|8[1-9]|9[29])|5(?:2|3(?:[045]|9[0-8])|4[0-369]|5[29]|8[02389]|9[0-3])|7(?:2[02-46-9]|34|[58]|6[0249]|7[57]|9(?:[23]|4[0-59]|5[01569]|6[0167]))|8(?:2(?:[1258]|4[0-39]|9[0-2469])|3(?:[29]|60)|49|51|6(?:[0-24]|36|5[0-3589]|7[23]|9[01459])|7[0-468]|8[68])|9(?:[23][1-9]|4[15]|5[138]|6[1-3]|7[156]|8[189]|9(?:[1289]|3[34]|4[0178]))|(?:264|837)[016-9]|2(?:57|93)[015-9]|(?:25[0468]|422|838)[01]|(?:47[59]|59[89]|8(?:6[68]|9))[019]", "1(?:1|5(?:4[018]|5[017])|77|88|9[69])|2(?:2[127]|3[0-269]|4[59]|5(?:[1-3]|5[0-69]|9(?:17|99))|6(?:2|4[016-9])|7(?:[1-35]|8[0189])|8(?:[16]|3[0134]|9[0-5])|9(?:[028]|17))|4(?:2(?:[13-79]|8[014-6])|3[0-57]|[45]|6[248]|7[2-47]|9[29])|5(?:2|3(?:[045]|9(?:[0-58]|6[4-9]|7[0-35689]))|4[0-369]|5[29]|8[02389]|9[0-3])|7(?:2[02-46-9]|34|[58]|6[0249]|7[57]|9(?:[23]|4[0-59]|5[01569]|6[0167]))|8(?:2(?:[1258]|4[0-39]|9[0169])|3(?:[29]|60|7(?:[017-9]|6[6-8]))|49|51|6(?:[0-24]|36[2-57-9]|5(?:[0-389]|5[23])|6(?:[01]|9[178])|7(?:2[2-468]|3[78])|9[0145])|7[0-468]|8[68])|9(?:4[15]|5[138]|7[156]|8[189]|9(?:[1289]|3(?:31|4[357])|4[0178]))|(?:8294|96)[1-3]|2(?:57|93)[015-9]|(?:223|8699)[014-9]|(?:25[0468]|422|838)[01]|(?:48|8292|9[23])[1-9]|(?:47[59]|59[89]|8(?:68|9))[019]"], "0$1"], ["(\\d{3})(\\d{2})(\\d{4})", "$1-$2-$3", ["[14]|[289][2-9]|5[3-9]|7[2-4679]"], "0$1"], ["(\\d{3})(\\d{3})(\\d{4})", "$1-$2-$3", ["800"], "0$1"], ["(\\d{2})(\\d{4})(\\d{4})", "$1-$2-$3", ["[25-9]"], "0$1"]], "0", 0, "(000[2569]\\d{4,6})$|(?:(?:003768)0?)|0", "$1"], "KE": ["254", "000", "(?:[17]\\d\\d|900)\\d{6}|(?:2|80)0\\d{6,7}|[4-6]\\d{6,8}", [7, 8, 9, 10], [["(\\d{2})(\\d{5,7})", "$1 $2", ["[24-6]"], "0$1"], ["(\\d{3})(\\d{6})", "$1 $2", ["[17]"], "0$1"], ["(\\d{3})(\\d{3})(\\d{3,4})", "$1 $2 $3", ["[89]"], "0$1"]], "0"], "KG": ["996", "00", "8\\d{9}|[235-9]\\d{8}", [9, 10], [["(\\d{4})(\\d{5})", "$1 $2", ["3(?:1[346]|[24-79])"], "0$1"], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["[235-79]|88"], "0$1"], ["(\\d{3})(\\d{3})(\\d)(\\d{2,3})", "$1 $2 $3 $4", ["8"], "0$1"]], "0"], "KH": ["855", "00[14-9]", "1\\d{9}|[1-9]\\d{7,8}", [8, 9, 10], [["(\\d{2})(\\d{3})(\\d{3,4})", "$1 $2 $3", ["[1-9]"], "0$1"], ["(\\d{4})(\\d{3})(\\d{3})", "$1 $2 $3", ["1"]]], "0"], "KI": ["686", "00", "(?:[37]\\d|6[0-79])\\d{6}|(?:[2-48]\\d|50)\\d{3}", [5, 8], 0, "0"], "KM": ["269", "00", "[3478]\\d{6}", [7], [["(\\d{3})(\\d{2})(\\d{2})", "$1 $2 $3", ["[3478]"]]]], "KN": ["1", "011", "(?:[58]\\d\\d|900)\\d{7}", [10], 0, "1", 0, "([2-7]\\d{6})$|1", "869$1", 0, "869"], "KP": ["850", "00|99", "85\\d{6}|(?:19\\d|[2-7])\\d{7}", [8, 10], [["(\\d{2})(\\d{3})(\\d{3})", "$1 $2 $3", ["8"], "0$1"], ["(\\d)(\\d{3})(\\d{4})", "$1 $2 $3", ["[2-7]"], "0$1"], ["(\\d{3})(\\d{3})(\\d{4})", "$1 $2 $3", ["1"], "0$1"]], "0"], "KR": ["82", "00(?:[125689]|3(?:[46]5|91)|7(?:00|27|3|55|6[126]))", "00[1-9]\\d{8,11}|(?:[12]|5\\d{3})\\d{7}|[13-6]\\d{9}|(?:[1-6]\\d|80)\\d{7}|[3-6]\\d{4,5}|(?:00|7)0\\d{8}", [5, 6, 8, 9, 10, 11, 12, 13, 14], [["(\\d{2})(\\d{3,4})", "$1-$2", ["(?:3[1-3]|[46][1-4]|5[1-5])1"], "0$1"], ["(\\d{4})(\\d{4})", "$1-$2", ["1"]], ["(\\d)(\\d{3,4})(\\d{4})", "$1-$2-$3", ["2"], "0$1"], ["(\\d{2})(\\d{3})(\\d{4})", "$1-$2-$3", ["[36]0|8"], "0$1"], ["(\\d{2})(\\d{3,4})(\\d{4})", "$1-$2-$3", ["[1346]|5[1-5]"], "0$1"], ["(\\d{2})(\\d{4})(\\d{4})", "$1-$2-$3", ["[57]"], "0$1"], ["(\\d{2})(\\d{5})(\\d{4})", "$1-$2-$3", ["5"], "0$1"]], "0", 0, "0(8(?:[1-46-8]|5\\d\\d))?"], "KW": ["965", "00", "18\\d{5}|(?:[2569]\\d|41)\\d{6}", [7, 8], [["(\\d{4})(\\d{3,4})", "$1 $2", ["[169]|2(?:[235]|4[1-35-9])|52"]], ["(\\d{3})(\\d{5})", "$1 $2", ["[245]"]]]], "KY": ["1", "011", "(?:345|[58]\\d\\d|900)\\d{7}", [10], 0, "1", 0, "([2-9]\\d{6})$|1", "345$1", 0, "345"], "KZ": ["7", "810", "8\\d{13}|[78]\\d{9}", [10, 14], 0, "8", 0, 0, 0, 0, "7", 0, "8~10"], "LA": ["856", "00", "[23]\\d{9}|3\\d{8}|(?:[235-8]\\d|41)\\d{6}", [8, 9, 10], [["(\\d{2})(\\d{3})(\\d{3})", "$1 $2 $3", ["2[13]|3[14]|[4-8]"], "0$1"], ["(\\d{2})(\\d{2})(\\d{2})(\\d{3})", "$1 $2 $3 $4", ["3"], "0$1"], ["(\\d{2})(\\d{2})(\\d{3})(\\d{3})", "$1 $2 $3 $4", ["[23]"], "0$1"]], "0"], "LB": ["961", "00", "[27-9]\\d{7}|[13-9]\\d{6}", [7, 8], [["(\\d)(\\d{3})(\\d{3})", "$1 $2 $3", ["[13-69]|7(?:[2-57]|62|8[0-6]|9[04-9])|8[02-9]"], "0$1"], ["(\\d{2})(\\d{3})(\\d{3})", "$1 $2 $3", ["[27-9]"]]], "0"], "LC": ["1", "011", "(?:[58]\\d\\d|758|900)\\d{7}", [10], 0, "1", 0, "([2-8]\\d{6})$|1", "758$1", 0, "758"], "LI": ["423", "00", "[68]\\d{8}|(?:[2378]\\d|90)\\d{5}", [7, 9], [["(\\d{3})(\\d{2})(\\d{2})", "$1 $2 $3", ["[2379]|8(?:0[09]|7)", "[2379]|8(?:0(?:02|9)|7)"]], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["8"]], ["(\\d{2})(\\d{3})(\\d{4})", "$1 $2 $3", ["69"]], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["6"]]], "0", 0, "(1001)|0"], "LK": ["94", "00", "[1-9]\\d{8}", [9], [["(\\d{2})(\\d{3})(\\d{4})", "$1 $2 $3", ["7"], "0$1"], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["[1-689]"], "0$1"]], "0"], "LR": ["231", "00", "(?:[2457]\\d|33|88)\\d{7}|(?:2\\d|[4-6])\\d{6}", [7, 8, 9], [["(\\d)(\\d{3})(\\d{3})", "$1 $2 $3", ["4[67]|[56]"], "0$1"], ["(\\d{2})(\\d{3})(\\d{3})", "$1 $2 $3", ["2"], "0$1"], ["(\\d{2})(\\d{3})(\\d{4})", "$1 $2 $3", ["[2-578]"], "0$1"]], "0"], "LS": ["266", "00", "(?:[256]\\d\\d|800)\\d{5}", [8], [["(\\d{4})(\\d{4})", "$1 $2", ["[2568]"]]]], "LT": ["370", "00", "(?:[3469]\\d|52|[78]0)\\d{6}", [8], [["(\\d)(\\d{3})(\\d{4})", "$1 $2 $3", ["52[0-7]"], "(0-$1)", 1], ["(\\d{3})(\\d{2})(\\d{3})", "$1 $2 $3", ["[7-9]"], "0 $1", 1], ["(\\d{2})(\\d{6})", "$1 $2", ["37|4(?:[15]|6[1-8])"], "(0-$1)", 1], ["(\\d{3})(\\d{5})", "$1 $2", ["[3-6]"], "(0-$1)", 1]], "0", 0, "[08]"], "LU": ["352", "00", "35[013-9]\\d{4,8}|6\\d{8}|35\\d{2,4}|(?:[2457-9]\\d|3[0-46-9])\\d{2,9}", [4, 5, 6, 7, 8, 9, 10, 11], [["(\\d{2})(\\d{3})", "$1 $2", ["2(?:0[2-689]|[2-9])|[3-57]|8(?:0[2-9]|[13-9])|9(?:0[89]|[2-579])"]], ["(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3", ["2(?:0[2-689]|[2-9])|[3-57]|8(?:0[2-9]|[13-9])|9(?:0[89]|[2-579])"]], ["(\\d{2})(\\d{2})(\\d{3})", "$1 $2 $3", ["20[2-689]"]], ["(\\d{2})(\\d{2})(\\d{2})(\\d{1,2})", "$1 $2 $3 $4", ["20"]], ["(\\d{2})(\\d{2})(\\d{2})(\\d{1,5})", "$1 $2 $3 $4", ["[3-57]|8[13-9]|9(?:0[89]|[2-579])|(?:2|80)[2-9]"]], ["(\\d{3})(\\d{2})(\\d{3})", "$1 $2 $3", ["80[01]|90[015]"]], ["(\\d{2})(\\d{2})(\\d{2})(\\d{3})", "$1 $2 $3 $4", ["20"]], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["6"]], ["(\\d{2})(\\d{2})(\\d{2})(\\d{2})(\\d{1,2})", "$1 $2 $3 $4 $5", ["20"]]], 0, 0, "(15(?:0[06]|1[12]|[35]5|4[04]|6[26]|77|88|99)\\d)"], "LV": ["371", "00", "(?:[268]\\d|78|90)\\d{6}", [8], [["(\\d{2})(\\d{3})(\\d{3})", "$1 $2 $3", ["[2679]|8[01]"]]]], "LY": ["218", "00", "[2-9]\\d{8}", [9], [["(\\d{2})(\\d{7})", "$1-$2", ["[2-9]"], "0$1"]], "0"], "MA": ["212", "00", "[5-8]\\d{8}", [9], [["(\\d{4})(\\d{5})", "$1-$2", ["892"], "0$1"], ["(\\d{2})(\\d{7})", "$1-$2", ["8(?:0[0-7]|9)"], "0$1"], ["(\\d)(\\d{2})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4 $5", ["[5-8]"], "0$1"]], "0", 0, 0, 0, 0, "[5-8]"], "MC": ["377", "00", "(?:[3489]|[67]\\d)\\d{7}", [8, 9], [["(\\d{2})(\\d{3})(\\d{3})", "$1 $2 $3", ["4"], "0$1"], ["(\\d{2})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[389]"]], ["(\\d)(\\d{2})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4 $5", ["[67]"], "0$1"]], "0"], "MD": ["373", "00", "(?:[235-7]\\d|[89]0)\\d{6}", [8], [["(\\d{3})(\\d{5})", "$1 $2", ["[89]"], "0$1"], ["(\\d{2})(\\d{3})(\\d{3})", "$1 $2 $3", ["22|3"], "0$1"], ["(\\d{3})(\\d{2})(\\d{3})", "$1 $2 $3", ["[25-7]"], "0$1"]], "0"], "ME": ["382", "00", "(?:20|[3-79]\\d)\\d{6}|80\\d{6,7}", [8, 9], [["(\\d{2})(\\d{3})(\\d{3,4})", "$1 $2 $3", ["[2-9]"], "0$1"]], "0"], "MF": ["590", "00", "7090\\d{5}|(?:[56]9|[89]\\d)\\d{7}", [9], 0, "0", 0, 0, 0, 0, 0, [["(?:59(?:0(?:0[079]|[14]3|[27][79]|3[03-7]|5[0-268]|87)|87\\d)|80[6-9]\\d\\d)\\d{4}"], ["(?:69(?:0\\d\\d|1(?:2[2-9]|3[0-5]))|7090[0-4])\\d{4}"], ["80[0-5]\\d{6}"], ["8[129]\\d{7}"], 0, 0, 0, 0, ["9(?:(?:39[5-7]|76[018])\\d|475[0-6])\\d{4}"]]], "MG": ["261", "00", "[23]\\d{8}", [9], [["(\\d{2})(\\d{2})(\\d{3})(\\d{2})", "$1 $2 $3 $4", ["[23]"], "0$1"]], "0", 0, "([24-9]\\d{6})$|0", "20$1"], "MH": ["692", "011", "329\\d{4}|(?:[256]\\d|45)\\d{5}", [7], [["(\\d{3})(\\d{4})", "$1-$2", ["[2-6]"]]], "1"], "MK": ["389", "00", "[2-578]\\d{7}", [8], [["(\\d)(\\d{3})(\\d{4})", "$1 $2 $3", ["2|34[47]|4(?:[37]7|5[47]|64)"], "0$1"], ["(\\d{2})(\\d{3})(\\d{3})", "$1 $2 $3", ["[347]"], "0$1"], ["(\\d{3})(\\d)(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[58]"], "0$1"]], "0"], "ML": ["223", "00", "[24-9]\\d{7}", [8], [["(\\d{2})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[24-9]"]]]], "MM": ["95", "00", "1\\d{5,7}|95\\d{6}|(?:[4-7]|9[0-46-9])\\d{6,8}|(?:2|8\\d)\\d{5,8}", [6, 7, 8, 9, 10], [["(\\d)(\\d{2})(\\d{3})", "$1 $2 $3", ["16|2"], "0$1"], ["(\\d{2})(\\d{2})(\\d{3})", "$1 $2 $3", ["4(?:[2-46]|5[3-5])|5|6(?:[1-689]|7[235-7])|7(?:[0-4]|5[2-7])|8[1-5]|(?:60|86)[23]"], "0$1"], ["(\\d)(\\d{3})(\\d{3,4})", "$1 $2 $3", ["[12]|452|678|86", "[12]|452|6788|86"], "0$1"], ["(\\d{2})(\\d{3})(\\d{3,4})", "$1 $2 $3", ["[4-7]|8[1-35]"], "0$1"], ["(\\d)(\\d{3})(\\d{4,6})", "$1 $2 $3", ["9(?:2[0-4]|[35-9]|4[137-9])"], "0$1"], ["(\\d)(\\d{4})(\\d{4})", "$1 $2 $3", ["2"], "0$1"], ["(\\d{3})(\\d{3})(\\d{4})", "$1 $2 $3", ["8"], "0$1"], ["(\\d)(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3 $4", ["92"], "0$1"], ["(\\d)(\\d{5})(\\d{4})", "$1 $2 $3", ["9"], "0$1"]], "0"], "MN": ["976", "001", "[12]\\d{7,9}|[5-9]\\d{7}", [8, 9, 10], [["(\\d{2})(\\d{2})(\\d{4})", "$1 $2 $3", ["11|2[16]"], "0$1"], ["(\\d{4})(\\d{4})", "$1 $2", ["[5-9]"]], ["(\\d{3})(\\d{5,6})", "$1 $2", ["[12]2[1-3]"], "0$1"], ["(\\d{4})(\\d{5,6})", "$1 $2", ["[12](?:27|3[2-8]|4[2-68]|5[1-4689])", "[12](?:27|3[2-8]|4[2-68]|5[1-4689])[0-3]"], "0$1"], ["(\\d{5})(\\d{4,5})", "$1 $2", ["[12]"], "0$1"]], "0"], "MO": ["853", "00", "0800\\d{3}|(?:28|[68]\\d)\\d{6}", [7, 8], [["(\\d{4})(\\d{3})", "$1 $2", ["0"]], ["(\\d{4})(\\d{4})", "$1 $2", ["[268]"]]]], "MP": ["1", "011", "[58]\\d{9}|(?:67|90)0\\d{7}", [10], 0, "1", 0, "([2-9]\\d{6})$|1", "670$1", 0, "670"], "MQ": ["596", "00", "7091\\d{5}|(?:[56]9|[89]\\d)\\d{7}", [9], [["(\\d{3})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[5-79]|8(?:0[6-9]|[36])"], "0$1"], ["(\\d{3})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["8"], "0$1"]], "0"], "MR": ["222", "00", "(?:[2-4]\\d\\d|800)\\d{5}", [8], [["(\\d{2})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[2-48]"]]]], "MS": ["1", "011", "(?:[58]\\d\\d|664|900)\\d{7}", [10], 0, "1", 0, "([34]\\d{6})$|1", "664$1", 0, "664"], "MT": ["356", "00", "3550\\d{4}|(?:[2579]\\d\\d|800)\\d{5}", [8], [["(\\d{4})(\\d{4})", "$1 $2", ["[2357-9]"]]]], "MU": ["230", "0(?:0|[24-7]0|3[03])", "(?:[57]|8\\d\\d)\\d{7}|[2-468]\\d{6}", [7, 8, 10], [["(\\d{3})(\\d{4})", "$1 $2", ["[2-46]|8[013]"]], ["(\\d{4})(\\d{4})", "$1 $2", ["[57]"]], ["(\\d{5})(\\d{5})", "$1 $2", ["8"]]], 0, 0, 0, 0, 0, 0, 0, "020"], "MV": ["960", "0(?:0|19)", "(?:800|9[0-57-9]\\d)\\d{7}|[34679]\\d{6}", [7, 10], [["(\\d{3})(\\d{4})", "$1-$2", ["[34679]"]], ["(\\d{3})(\\d{3})(\\d{4})", "$1 $2 $3", ["[89]"]]], 0, 0, 0, 0, 0, 0, 0, "00"], "MW": ["265", "00", "(?:[1289]\\d|31|77)\\d{7}|1\\d{6}", [7, 9], [["(\\d)(\\d{3})(\\d{3})", "$1 $2 $3", ["1[2-9]"], "0$1"], ["(\\d{3})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[1-37-9]"], "0$1"]], "0"], "MX": ["52", "0[09]", "[2-9]\\d{9}", [10], [["(\\d{2})(\\d{4})(\\d{4})", "$1 $2 $3", ["33|5[56]|81"]], ["(\\d{3})(\\d{3})(\\d{4})", "$1 $2 $3", ["[2-9]"]]], 0, 0, 0, 0, 0, 0, 0, "00"], "MY": ["60", "00", "1\\d{8,9}|(?:3\\d|[4-9])\\d{7}", [8, 9, 10], [["(\\d)(\\d{3})(\\d{4})", "$1-$2 $3", ["[4-79]"], "0$1"], ["(\\d{2})(\\d{3})(\\d{3,4})", "$1-$2 $3", ["1(?:[02469]|[378][1-9]|53)|8", "1(?:[02469]|[37][1-9]|53|8(?:[1-46-9]|5[7-9]))|8"], "0$1"], ["(\\d)(\\d{4})(\\d{4})", "$1-$2 $3", ["3"], "0$1"], ["(\\d)(\\d{3})(\\d{2})(\\d{4})", "$1-$2-$3-$4", ["1(?:[367]|80)"]], ["(\\d{3})(\\d{3})(\\d{4})", "$1-$2 $3", ["15"], "0$1"], ["(\\d{2})(\\d{4})(\\d{4})", "$1-$2 $3", ["1"], "0$1"]], "0"], "MZ": ["258", "00", "(?:2|8\\d)\\d{7}", [8, 9], [["(\\d{2})(\\d{3})(\\d{3,4})", "$1 $2 $3", ["2|8[2-79]"]], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["8"]]]], "NA": ["264", "00", "[68]\\d{7,8}", [8, 9], [["(\\d{2})(\\d{3})(\\d{3})", "$1 $2 $3", ["88"], "0$1"], ["(\\d{2})(\\d{3})(\\d{3,4})", "$1 $2 $3", ["6"], "0$1"], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["87"], "0$1"], ["(\\d{2})(\\d{3})(\\d{4})", "$1 $2 $3", ["8"], "0$1"]], "0"], "NC": ["687", "00", "(?:050|[2-57-9]\\d\\d)\\d{3}", [6], [["(\\d{2})(\\d{2})(\\d{2})", "$1.$2.$3", ["[02-57-9]"]]]], "NE": ["227", "00", "[027-9]\\d{7}", [8], [["(\\d{2})(\\d{3})(\\d{3})", "$1 $2 $3", ["08"]], ["(\\d{2})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[089]|2[013]|7[0467]"]]]], "NF": ["672", "00", "[13]\\d{5}", [6], [["(\\d{2})(\\d{4})", "$1 $2", ["1[0-3]"]], ["(\\d)(\\d{5})", "$1 $2", ["[13]"]]], 0, 0, "([0-258]\\d{4})$", "3$1"], "NG": ["234", "009", "(?:20|9\\d)\\d{8}|[78]\\d{9,13}", [10, 11, 12, 13, 14], [["(\\d{3})(\\d{3})(\\d{3,4})", "$1 $2 $3", ["[7-9]"], "0$1"], ["(\\d{3})(\\d{3})(\\d{4})", "$1 $2 $3", ["20[129]"], "0$1"], ["(\\d{4})(\\d{2})(\\d{4})", "$1 $2 $3", ["2"], "0$1"], ["(\\d{3})(\\d{4})(\\d{4,5})", "$1 $2 $3", ["[78]"], "0$1"], ["(\\d{3})(\\d{5})(\\d{5,6})", "$1 $2 $3", ["[78]"], "0$1"]], "0"], "NI": ["505", "00", "(?:1800|[25-8]\\d{3})\\d{4}", [8], [["(\\d{4})(\\d{4})", "$1 $2", ["[125-8]"]]]], "NL": ["31", "00", "(?:[124-7]\\d\\d|3(?:[02-9]\\d|1[0-8]))\\d{6}|8\\d{6,9}|9\\d{6,10}|1\\d{4,5}", [5, 6, 7, 8, 9, 10, 11], [["(\\d{3})(\\d{4,7})", "$1 $2", ["[89]0"], "0$1"], ["(\\d{2})(\\d{7})", "$1 $2", ["66"], "0$1"], ["(\\d)(\\d{8})", "$1 $2", ["6"], "0$1"], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["1[16-8]|2[259]|3[124]|4[17-9]|5[124679]"], "0$1"], ["(\\d{2})(\\d{3})(\\d{4})", "$1 $2 $3", ["[1-578]|91"], "0$1"], ["(\\d{3})(\\d{3})(\\d{5})", "$1 $2 $3", ["9"], "0$1"]], "0"], "NO": ["47", "00", "(?:0|[2-9]\\d{3})\\d{4}", [5, 8], [["(\\d{3})(\\d{2})(\\d{3})", "$1 $2 $3", ["8"]], ["(\\d{2})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[2-79]"]]], 0, 0, 0, 0, 0, "[02-689]|7[0-8]"], "NP": ["977", "00", "(?:1\\d|9)\\d{9}|[1-9]\\d{7}", [8, 10, 11], [["(\\d)(\\d{7})", "$1-$2", ["1[2-6]"], "0$1"], ["(\\d{2})(\\d{6})", "$1-$2", ["1[01]|[2-8]|9(?:[1-59]|[67][2-6])"], "0$1"], ["(\\d{3})(\\d{7})", "$1-$2", ["9"]]], "0"], "NR": ["674", "00", "(?:222|444|(?:55|8\\d)\\d|666|777|999)\\d{4}", [7], [["(\\d{3})(\\d{4})", "$1 $2", ["[24-9]"]]]], "NU": ["683", "00", "(?:[4-7]|888\\d)\\d{3}", [4, 7], [["(\\d{3})(\\d{4})", "$1 $2", ["8"]]]], "NZ": ["64", "0(?:0|161)", "[1289]\\d{9}|50\\d{5}(?:\\d{2,3})?|[27-9]\\d{7,8}|(?:[34]\\d|6[0-35-9])\\d{6}|8\\d{4,6}", [5, 6, 7, 8, 9, 10], [["(\\d{2})(\\d{3,8})", "$1 $2", ["8[1-79]"], "0$1"], ["(\\d{3})(\\d{2})(\\d{2,3})", "$1 $2 $3", ["50[036-8]|8|90", "50(?:[0367]|88)|8|90"], "0$1"], ["(\\d)(\\d{3})(\\d{4})", "$1 $2 $3", ["24|[346]|7[2-57-9]|9[2-9]"], "0$1"], ["(\\d{3})(\\d{3})(\\d{3,4})", "$1 $2 $3", ["2(?:10|74)|[589]"], "0$1"], ["(\\d{2})(\\d{3,4})(\\d{4})", "$1 $2 $3", ["1|2[028]"], "0$1"], ["(\\d{2})(\\d{3})(\\d{3,5})", "$1 $2 $3", ["2(?:[169]|7[0-35-9])|7"], "0$1"]], "0", 0, 0, 0, 0, 0, 0, "00"], "OM": ["968", "00", "(?:1505|[279]\\d{3}|500)\\d{4}|800\\d{5,6}", [7, 8, 9], [["(\\d{3})(\\d{4,6})", "$1 $2", ["[58]"]], ["(\\d{2})(\\d{6})", "$1 $2", ["2"]], ["(\\d{4})(\\d{4})", "$1 $2", ["[179]"]]]], "PA": ["507", "00", "(?:00800|8\\d{3})\\d{6}|[68]\\d{7}|[1-57-9]\\d{6}", [7, 8, 10, 11], [["(\\d{3})(\\d{4})", "$1-$2", ["[1-57-9]"]], ["(\\d{4})(\\d{4})", "$1-$2", ["[68]"]], ["(\\d{3})(\\d{3})(\\d{4})", "$1 $2 $3", ["8"]]]], "PE": ["51", "00|19(?:1[124]|77|90)00", "(?:[14-8]|9\\d)\\d{7}", [8, 9], [["(\\d{3})(\\d{5})", "$1 $2", ["80"], "(0$1)"], ["(\\d)(\\d{7})", "$1 $2", ["1"], "(0$1)"], ["(\\d{2})(\\d{6})", "$1 $2", ["[4-8]"], "(0$1)"], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["9"]]], "0", 0, 0, 0, 0, 0, 0, "00", " Anexo "], "PF": ["689", "00", "4\\d{5}(?:\\d{2})?|8\\d{7,8}", [6, 8, 9], [["(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3", ["44"]], ["(\\d{2})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["4|8[7-9]"]], ["(\\d{3})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["8"]]]], "PG": ["675", "00|140[1-3]", "(?:180|[78]\\d{3})\\d{4}|(?:[2-589]\\d|64)\\d{5}", [7, 8], [["(\\d{3})(\\d{4})", "$1 $2", ["18|[2-69]|85"]], ["(\\d{4})(\\d{4})", "$1 $2", ["[78]"]]], 0, 0, 0, 0, 0, 0, 0, "00"], "PH": ["63", "00", "(?:[2-7]|9\\d)\\d{8}|2\\d{5}|(?:1800|8)\\d{7,9}", [6, 8, 9, 10, 11, 12, 13], [["(\\d)(\\d{5})", "$1 $2", ["2"], "(0$1)"], ["(\\d{4})(\\d{4,6})", "$1 $2", ["3(?:23|39|46)|4(?:2[3-6]|[35]9|4[26]|76)|544|88[245]|(?:52|64|86)2", "3(?:230|397|461)|4(?:2(?:35|[46]4|51)|396|4(?:22|63)|59[347]|76[15])|5(?:221|446)|642[23]|8(?:622|8(?:[24]2|5[13]))"], "(0$1)"], ["(\\d{5})(\\d{4})", "$1 $2", ["346|4(?:27|9[35])|883", "3469|4(?:279|9(?:30|56))|8834"], "(0$1)"], ["(\\d)(\\d{4})(\\d{4})", "$1 $2 $3", ["2"], "(0$1)"], ["(\\d{2})(\\d{3})(\\d{4})", "$1 $2 $3", ["[3-7]|8[2-8]"], "(0$1)"], ["(\\d{3})(\\d{3})(\\d{4})", "$1 $2 $3", ["[89]"], "0$1"], ["(\\d{4})(\\d{3})(\\d{4})", "$1 $2 $3", ["1"]], ["(\\d{4})(\\d{1,2})(\\d{3})(\\d{4})", "$1 $2 $3 $4", ["1"]]], "0"], "PK": ["92", "00", "122\\d{6}|[24-8]\\d{10,11}|9(?:[013-9]\\d{8,10}|2(?:[01]\\d\\d|2(?:[06-8]\\d|1[01]))\\d{7})|(?:[2-8]\\d{3}|92(?:[0-7]\\d|8[1-9]))\\d{6}|[24-9]\\d{8}|[89]\\d{7}", [8, 9, 10, 11, 12], [["(\\d{3})(\\d{3})(\\d{2,7})", "$1 $2 $3", ["[89]0"], "0$1"], ["(\\d{4})(\\d{5})", "$1 $2", ["1"]], ["(\\d{3})(\\d{6,7})", "$1 $2", ["2(?:3[2358]|4[2-4]|9[2-8])|45[3479]|54[2-467]|60[468]|72[236]|8(?:2[2-689]|3[23578]|4[3478]|5[2356])|9(?:2[2-8]|3[27-9]|4[2-6]|6[3569]|9[25-8])", "9(?:2[3-8]|98)|(?:2(?:3[2358]|4[2-4]|9[2-8])|45[3479]|54[2-467]|60[468]|72[236]|8(?:2[2-689]|3[23578]|4[3478]|5[2356])|9(?:22|3[27-9]|4[2-6]|6[3569]|9[25-7]))[2-9]"], "(0$1)"], ["(\\d{2})(\\d{7,8})", "$1 $2", ["(?:2[125]|4[0-246-9]|5[1-35-7]|6[1-8]|7[14]|8[16]|91)[2-9]"], "(0$1)"], ["(\\d{5})(\\d{5})", "$1 $2", ["58"], "(0$1)"], ["(\\d{3})(\\d{7})", "$1 $2", ["3"], "0$1"], ["(\\d{2})(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3 $4", ["2[125]|4[0-246-9]|5[1-35-7]|6[1-8]|7[14]|8[16]|91"], "(0$1)"], ["(\\d{3})(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3 $4", ["[24-9]"], "(0$1)"]], "0"], "PL": ["48", "00", "(?:6|8\\d\\d)\\d{7}|[1-9]\\d{6}(?:\\d{2})?|[26]\\d{5}", [6, 7, 8, 9, 10], [["(\\d{5})", "$1", ["19"]], ["(\\d{3})(\\d{3})", "$1 $2", ["11|20|64"]], ["(\\d{2})(\\d{2})(\\d{3})", "$1 $2 $3", ["30|(?:1[2-8]|2[2-69]|3[2-4]|4[1-468]|5[24-689]|6[1-3578]|7[14-7]|8[1-79]|9[145])1", "30|(?:1[2-8]|2[2-69]|3[2-4]|4[1-468]|5[24-689]|6[1-3578]|7[14-7]|8[1-79]|9[145])19"]], ["(\\d{3})(\\d{2})(\\d{2,3})", "$1 $2 $3", ["64"]], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["21|39|45|5[0137]|6[0469]|7[02389]|8(?:0[14]|8)"]], ["(\\d{2})(\\d{3})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["1[2-8]|[2-7]|8[1-79]|9[145]"]], ["(\\d{3})(\\d{3})(\\d{3,4})", "$1 $2 $3", ["8"]]]], "PM": ["508", "00", "[78]\\d{8}|[2-9]\\d{5}", [6, 9], [["(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3", ["[2-9]"], "0$1"], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["7"]], ["(\\d{3})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["8"], "0$1"]], "0"], "PR": ["1", "011", "(?:[589]\\d\\d|787)\\d{7}", [10], 0, "1", 0, 0, 0, 0, "787|939"], "PS": ["970", "00", "[2489]2\\d{6}|(?:1\\d|5)\\d{8}", [8, 9, 10], [["(\\d)(\\d{3})(\\d{4})", "$1 $2 $3", ["[2489]"], "0$1"], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["5"], "0$1"], ["(\\d{4})(\\d{3})(\\d{3})", "$1 $2 $3", ["1"]]], "0"], "PT": ["351", "00", "1693\\d{5}|(?:[26-9]\\d|30)\\d{7}", [9], [["(\\d{2})(\\d{3})(\\d{4})", "$1 $2 $3", ["2[12]"]], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["16|[236-9]"]]]], "PW": ["680", "01[12]", "(?:[24-8]\\d\\d|345|900)\\d{4}", [7], [["(\\d{3})(\\d{4})", "$1 $2", ["[2-9]"]]]], "PY": ["595", "00", "[36-8]\\d{5,8}|4\\d{6,8}|59\\d{6}|9\\d{5,10}|(?:2\\d|5[0-8])\\d{6,7}", [6, 7, 8, 9, 10, 11], [["(\\d{3})(\\d{3,6})", "$1 $2", ["[2-9]0"], "0$1"], ["(\\d{2})(\\d{5})", "$1 $2", ["3[289]|4[246-8]|61|7[1-3]|8[1-36]"], "(0$1)"], ["(\\d{3})(\\d{4,5})", "$1 $2", ["2[279]|3[13-5]|4[359]|5|6(?:[34]|7[1-46-8])|7[46-8]|85"], "(0$1)"], ["(\\d{2})(\\d{3})(\\d{3,4})", "$1 $2 $3", ["2[14-68]|3[26-9]|4[1246-8]|6(?:1|75)|7[1-35]|8[1-36]"], "(0$1)"], ["(\\d{2})(\\d{3})(\\d{4})", "$1 $2 $3", ["87"]], ["(\\d{3})(\\d{6})", "$1 $2", ["9(?:[5-79]|8[1-7])"], "0$1"], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["[2-8]"], "0$1"], ["(\\d{4})(\\d{3})(\\d{4})", "$1 $2 $3", ["9"]]], "0"], "QA": ["974", "00", "800\\d{4}|(?:2|800)\\d{6}|(?:0080|[3-7])\\d{7}", [7, 8, 9, 11], [["(\\d{3})(\\d{4})", "$1 $2", ["2[136]|8"]], ["(\\d{4})(\\d{4})", "$1 $2", ["[3-7]"]]]], "RE": ["262", "00", "709\\d{6}|(?:26|[689]\\d)\\d{7}", [9], [["(\\d{3})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[26-9]"], "0$1"]], "0", 0, 0, 0, 0, 0, [["2631[0-6]\\d{4}|26(?:2\\d|30|88)\\d{5}"], ["(?:69(?:2\\d\\d|3(?:[06][0-6]|1[0-3]|2[0-2]|3[0-39]|4\\d|5[0-5]|7[0-37]|8[0-8]|9[0-479]))|7092[0-3])\\d{4}"], ["80\\d{7}"], ["89[1-37-9]\\d{6}"], 0, 0, 0, 0, ["9(?:399[0-3]|479[0-6]|76(?:2[278]|3[0-37]))\\d{4}"], ["8(?:1[019]|2[0156]|84|90)\\d{6}"]]], "RO": ["40", "00", "(?:[236-8]\\d|90)\\d{7}|[23]\\d{5}", [6, 9], [["(\\d{3})(\\d{3})", "$1 $2", ["2[3-6]", "2[3-6]\\d9"], "0$1"], ["(\\d{2})(\\d{4})", "$1 $2", ["219|31"], "0$1"], ["(\\d{2})(\\d{3})(\\d{4})", "$1 $2 $3", ["[23]1"], "0$1"], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["[236-9]"], "0$1"]], "0", 0, 0, 0, 0, 0, 0, 0, " int "], "RS": ["381", "00", "38[02-9]\\d{6,9}|6\\d{7,9}|90\\d{4,8}|38\\d{5,6}|(?:7\\d\\d|800)\\d{3,9}|(?:[12]\\d|3[0-79])\\d{5,10}", [6, 7, 8, 9, 10, 11, 12], [["(\\d{3})(\\d{3,9})", "$1 $2", ["(?:2[389]|39)0|[7-9]"], "0$1"], ["(\\d{2})(\\d{5,10})", "$1 $2", ["[1-36]"], "0$1"]], "0"], "RU": ["7", "810", "8\\d{13}|[347-9]\\d{9}", [10, 14], [["(\\d{4})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["7(?:1[0-8]|2[1-9])", "7(?:1(?:[0-356]2|4[29]|7|8[27])|2(?:1[23]|[2-9]2))", "7(?:1(?:[0-356]2|4[29]|7|8[27])|2(?:13[03-69]|62[013-9]))|72[1-57-9]2"], "8 ($1)", 1], ["(\\d{5})(\\d)(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["7(?:1[0-68]|2[1-9])", "7(?:1(?:[06][3-6]|[18]|2[35]|[3-5][3-5])|2(?:[13][3-5]|[24-689]|7[457]))", "7(?:1(?:0(?:[356]|4[023])|[18]|2(?:3[013-9]|5)|3[45]|43[013-79]|5(?:3[1-8]|4[1-7]|5)|6(?:3[0-35-9]|[4-6]))|2(?:1(?:3[178]|[45])|[24-689]|3[35]|7[457]))|7(?:14|23)4[0-8]|71(?:33|45)[1-79]"], "8 ($1)", 1], ["(\\d{3})(\\d{3})(\\d{4})", "$1 $2 $3", ["7"], "8 ($1)", 1], ["(\\d{3})(\\d{3})(\\d{2})(\\d{2})", "$1 $2-$3-$4", ["[349]|8(?:[02-7]|1[1-8])"], "8 ($1)", 1], ["(\\d{4})(\\d{4})(\\d{3})(\\d{3})", "$1 $2 $3 $4", ["8"], "8 ($1)"]], "8", 0, 0, 0, 0, "[3489]", 0, "8~10"], "RW": ["250", "00", "(?:06|[27]\\d\\d|[89]00)\\d{6}", [8, 9], [["(\\d{2})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["0"]], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["2"]], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["[7-9]"], "0$1"]], "0"], "SA": ["966", "00", "(?:[15]\\d|800|92)\\d{7}", [9, 10], [["(\\d{4})(\\d{5})", "$1 $2", ["9"]], ["(\\d{2})(\\d{3})(\\d{4})", "$1 $2 $3", ["1"], "0$1"], ["(\\d{2})(\\d{3})(\\d{4})", "$1 $2 $3", ["5"], "0$1"], ["(\\d{3})(\\d{3})(\\d{4})", "$1 $2 $3", ["8"]]], "0"], "SB": ["677", "0[01]", "[6-9]\\d{6}|[1-6]\\d{4}", [5, 7], [["(\\d{2})(\\d{5})", "$1 $2", ["6[89]|7|8[4-9]|9(?:[1-8]|9[0-8])"]]]], "SC": ["248", "010|0[0-2]", "(?:[2489]\\d|64)\\d{5}", [7], [["(\\d)(\\d{3})(\\d{3})", "$1 $2 $3", ["[246]|9[57]"]]], 0, 0, 0, 0, 0, 0, 0, "00"], "SD": ["249", "00", "[19]\\d{8}", [9], [["(\\d{2})(\\d{3})(\\d{4})", "$1 $2 $3", ["[19]"], "0$1"]], "0"], "SE": ["46", "00", "(?:[26]\\d\\d|9)\\d{9}|[1-9]\\d{8}|[1-689]\\d{7}|[1-4689]\\d{6}|2\\d{5}", [6, 7, 8, 9, 10, 12], [["(\\d{2})(\\d{2,3})(\\d{2})", "$1-$2 $3", ["20"], "0$1", 0, "$1 $2 $3"], ["(\\d{3})(\\d{4})", "$1-$2", ["9(?:00|39|44|9)"], "0$1", 0, "$1 $2"], ["(\\d{2})(\\d{3})(\\d{2})", "$1-$2 $3", ["[12][136]|3[356]|4[0246]|6[03]|90[1-9]"], "0$1", 0, "$1 $2 $3"], ["(\\d)(\\d{2,3})(\\d{2})(\\d{2})", "$1-$2 $3 $4", ["8"], "0$1", 0, "$1 $2 $3 $4"], ["(\\d{3})(\\d{2,3})(\\d{2})", "$1-$2 $3", ["1[2457]|2(?:[247-9]|5[0138])|3[0247-9]|4[1357-9]|5[0-35-9]|6(?:[125689]|4[02-57]|7[0-2])|9(?:[125-8]|3[02-5]|4[0-3])"], "0$1", 0, "$1 $2 $3"], ["(\\d{3})(\\d{2,3})(\\d{3})", "$1-$2 $3", ["9(?:00|39|44)"], "0$1", 0, "$1 $2 $3"], ["(\\d{2})(\\d{2,3})(\\d{2})(\\d{2})", "$1-$2 $3 $4", ["1[13689]|2[0136]|3[1356]|4[0246]|54|6[03]|90[1-9]"], "0$1", 0, "$1 $2 $3 $4"], ["(\\d{2})(\\d{3})(\\d{2})(\\d{2})", "$1-$2 $3 $4", ["10|7"], "0$1", 0, "$1 $2 $3 $4"], ["(\\d)(\\d{3})(\\d{3})(\\d{2})", "$1-$2 $3 $4", ["8"], "0$1", 0, "$1 $2 $3 $4"], ["(\\d{3})(\\d{2})(\\d{2})(\\d{2})", "$1-$2 $3 $4", ["[13-5]|2(?:[247-9]|5[0138])|6(?:[124-689]|7[0-2])|9(?:[125-8]|3[02-5]|4[0-3])"], "0$1", 0, "$1 $2 $3 $4"], ["(\\d{3})(\\d{2})(\\d{2})(\\d{3})", "$1-$2 $3 $4", ["9"], "0$1", 0, "$1 $2 $3 $4"], ["(\\d{3})(\\d{2})(\\d{3})(\\d{2})(\\d{2})", "$1-$2 $3 $4 $5", ["[26]"], "0$1", 0, "$1 $2 $3 $4 $5"]], "0"], "SG": ["65", "0[0-3]\\d", "(?:(?:1\\d|8)\\d\\d|7000)\\d{7}|[3689]\\d{7}", [8, 10, 11], [["(\\d{4})(\\d{4})", "$1 $2", ["[369]|8(?:0[1-9]|[1-9])"]], ["(\\d{3})(\\d{3})(\\d{4})", "$1 $2 $3", ["8"]], ["(\\d{4})(\\d{4})(\\d{3})", "$1 $2 $3", ["7"]], ["(\\d{4})(\\d{3})(\\d{4})", "$1 $2 $3", ["1"]]]], "SH": ["290", "00", "(?:[256]\\d|8)\\d{3}", [4, 5], 0, 0, 0, 0, 0, 0, "[256]"], "SI": ["386", "00|10(?:22|66|88|99)", "[1-7]\\d{7}|8\\d{4,7}|90\\d{4,6}", [5, 6, 7, 8], [["(\\d{2})(\\d{3,6})", "$1 $2", ["8[09]|9"], "0$1"], ["(\\d{3})(\\d{5})", "$1 $2", ["59|8"], "0$1"], ["(\\d{2})(\\d{3})(\\d{3})", "$1 $2 $3", ["[37][01]|4[013]|51|6"], "0$1"], ["(\\d)(\\d{3})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[1-57]"], "(0$1)"]], "0", 0, 0, 0, 0, 0, 0, "00"], "SJ": ["47", "00", "0\\d{4}|(?:[489]\\d|79)\\d{6}", [5, 8], 0, 0, 0, 0, 0, 0, "79"], "SK": ["421", "00", "[2-689]\\d{8}|[2-59]\\d{6}|[2-5]\\d{5}", [6, 7, 9], [["(\\d)(\\d{2})(\\d{3,4})", "$1 $2 $3", ["21"], "0$1"], ["(\\d{2})(\\d{2})(\\d{2,3})", "$1 $2 $3", ["[3-5][1-8]1", "[3-5][1-8]1[67]"], "0$1"], ["(\\d)(\\d{3})(\\d{3})(\\d{2})", "$1 $2 $3 $4", ["2"], "0$1"], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["[689]"], "0$1"], ["(\\d{2})(\\d{3})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[3-5]"], "0$1"]], "0"], "SL": ["232", "00", "(?:[237-9]\\d|66)\\d{6}", [8], [["(\\d{2})(\\d{6})", "$1 $2", ["[236-9]"], "(0$1)"]], "0"], "SM": ["378", "00", "(?:0549|[5-7]\\d)\\d{6}", [8, 10], [["(\\d{2})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[5-7]"]], ["(\\d{4})(\\d{6})", "$1 $2", ["0"]]], 0, 0, "([89]\\d{5})$", "0549$1"], "SN": ["221", "00", "(?:[378]\\d|93)\\d{7}", [9], [["(\\d{3})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["8"]], ["(\\d{2})(\\d{3})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[379]"]]]], "SO": ["252", "00", "[346-9]\\d{8}|[12679]\\d{7}|[1-5]\\d{6}|[1348]\\d{5}", [6, 7, 8, 9], [["(\\d{2})(\\d{4})", "$1 $2", ["8[125]"]], ["(\\d{6})", "$1", ["[134]"]], ["(\\d)(\\d{6})", "$1 $2", ["[15]|2[0-79]|3[0-46-8]|4[0-7]"]], ["(\\d{2})(\\d{5,7})", "$1 $2", ["1|28|9[2-9]"]], ["(\\d)(\\d{7})", "$1 $2", ["[267]|904"]], ["(\\d{2})(\\d{3})(\\d{4})", "$1 $2 $3", ["[346-9]"]]], "0"], "SR": ["597", "00", "(?:[2-5]|[6-9]\\d)\\d{5}", [6, 7], [["(\\d{2})(\\d{2})(\\d{2})", "$1-$2-$3", ["56"]], ["(\\d{3})(\\d{3})", "$1-$2", ["[2-5]"]], ["(\\d{3})(\\d{4})", "$1-$2", ["[6-9]"]]]], "SS": ["211", "00", "[19]\\d{8}", [9], [["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["[19]"], "0$1"]], "0"], "ST": ["239", "00", "(?:22|9\\d)\\d{5}", [7], [["(\\d{3})(\\d{4})", "$1 $2", ["[29]"]]]], "SV": ["503", "00", "[25-7]\\d{7}|(?:80\\d|900)\\d{4}(?:\\d{4})?", [7, 8, 11], [["(\\d{3})(\\d{4})", "$1 $2", ["[89]"]], ["(\\d{4})(\\d{4})", "$1 $2", ["[25-7]"]], ["(\\d{3})(\\d{4})(\\d{4})", "$1 $2 $3", ["[89]"]]]], "SX": ["1", "011", "7215\\d{6}|(?:[58]\\d\\d|900)\\d{7}", [10], 0, "1", 0, "(5\\d{6})$|1", "721$1", 0, "721"], "SY": ["963", "00", "[1-359]\\d{8}|[1-5]\\d{7}", [8, 9], [["(\\d{2})(\\d{3})(\\d{3,4})", "$1 $2 $3", ["[1-4]|5[1-3]"], "0$1", 1], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["[59]"], "0$1", 1]], "0"], "SZ": ["268", "00", "0800\\d{4}|(?:[237]\\d|900)\\d{6}", [8, 9], [["(\\d{4})(\\d{4})", "$1 $2", ["[0237]"]], ["(\\d{5})(\\d{4})", "$1 $2", ["9"]]]], "TA": ["290", "00", "8\\d{3}", [4], 0, 0, 0, 0, 0, 0, "8"], "TC": ["1", "011", "(?:[58]\\d\\d|649|900)\\d{7}", [10], 0, "1", 0, "([2-479]\\d{6})$|1", "649$1", 0, "649"], "TD": ["235", "00|16", "(?:22|[3689]\\d|77)\\d{6}", [8], [["(\\d{2})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[236-9]"]]], 0, 0, 0, 0, 0, 0, 0, "00"], "TG": ["228", "00", "[279]\\d{7}", [8], [["(\\d{2})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[279]"]]]], "TH": ["66", "00[1-9]", "(?:001800|[2-57]|[689]\\d)\\d{7}|1\\d{7,9}", [8, 9, 10, 13], [["(\\d)(\\d{3})(\\d{4})", "$1 $2 $3", ["2"], "0$1"], ["(\\d{2})(\\d{3})(\\d{3,4})", "$1 $2 $3", ["[13-9]"], "0$1"], ["(\\d{4})(\\d{3})(\\d{3})", "$1 $2 $3", ["1"]]], "0"], "TJ": ["992", "810", "(?:[0-57-9]\\d|66)\\d{7}", [9], [["(\\d{6})(\\d)(\\d{2})", "$1 $2 $3", ["331", "3317"]], ["(\\d{3})(\\d{2})(\\d{4})", "$1 $2 $3", ["44[02-479]|[34]7"]], ["(\\d{4})(\\d)(\\d{4})", "$1 $2 $3", ["3(?:[1245]|3[12])"]], ["(\\d{2})(\\d{3})(\\d{4})", "$1 $2 $3", ["\\d"]]], 0, 0, 0, 0, 0, 0, 0, "8~10"], "TK": ["690", "00", "[2-47]\\d{3,6}", [4, 5, 6, 7]], "TL": ["670", "00", "7\\d{7}|(?:[2-47]\\d|[89]0)\\d{5}", [7, 8], [["(\\d{3})(\\d{4})", "$1 $2", ["[2-489]|70"]], ["(\\d{4})(\\d{4})", "$1 $2", ["7"]]]], "TM": ["993", "810", "(?:[1-6]\\d|71)\\d{6}", [8], [["(\\d{2})(\\d{2})(\\d{2})(\\d{2})", "$1 $2-$3-$4", ["12"], "(8 $1)"], ["(\\d{3})(\\d)(\\d{2})(\\d{2})", "$1 $2-$3-$4", ["[1-5]"], "(8 $1)"], ["(\\d{2})(\\d{6})", "$1 $2", ["[67]"], "8 $1"]], "8", 0, 0, 0, 0, 0, 0, "8~10"], "TN": ["216", "00", "[2-57-9]\\d{7}", [8], [["(\\d{2})(\\d{3})(\\d{3})", "$1 $2 $3", ["[2-57-9]"]]]], "TO": ["676", "00", "(?:0800|(?:[5-8]\\d\\d|999)\\d)\\d{3}|[2-8]\\d{4}", [5, 7], [["(\\d{2})(\\d{3})", "$1-$2", ["[2-4]|50|6[09]|7[0-24-69]|8[05]"]], ["(\\d{4})(\\d{3})", "$1 $2", ["0"]], ["(\\d{3})(\\d{4})", "$1 $2", ["[5-9]"]]]], "TR": ["90", "00", "4\\d{6}|8\\d{11,12}|(?:[2-58]\\d\\d|900)\\d{7}", [7, 10, 12, 13], [["(\\d{3})(\\d{3})(\\d{4})", "$1 $2 $3", ["512|8[01589]|90"], "0$1", 1], ["(\\d{3})(\\d{3})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["5[0-79]"], "0$1", 1], ["(\\d{3})(\\d{3})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[24][1-8]|3[1-9]"], "(0$1)", 1], ["(\\d{3})(\\d{3})(\\d{6,7})", "$1 $2 $3", ["80"], "0$1", 1]], "0"], "TT": ["1", "011", "(?:[58]\\d\\d|900)\\d{7}", [10], 0, "1", 0, "([2-46-8]\\d{6})$|1", "868$1", 0, "868"], "TV": ["688", "00", "(?:2|7\\d\\d|90)\\d{4}", [5, 6, 7], [["(\\d{2})(\\d{3})", "$1 $2", ["2"]], ["(\\d{2})(\\d{4})", "$1 $2", ["90"]], ["(\\d{2})(\\d{5})", "$1 $2", ["7"]]]], "TW": ["886", "0(?:0[25-79]|19)", "[2-689]\\d{8}|7\\d{9,10}|[2-8]\\d{7}|2\\d{6}", [7, 8, 9, 10, 11], [["(\\d{2})(\\d)(\\d{4})", "$1 $2 $3", ["202"], "0$1"], ["(\\d{3})(\\d{5})", "$1 $2", ["826"], "0$1"], ["(\\d{3})(\\d{2})(\\d{3})", "$1 $2 $3", ["83"], "0$1"], ["(\\d{2})(\\d{2})(\\d{4})", "$1 $2 $3", ["82"], "0$1"], ["(\\d{2})(\\d{3})(\\d{3,4})", "$1 $2 $3", ["[25]0|37|49|8[09]"], "0$1"], ["(\\d)(\\d{3,4})(\\d{4})", "$1 $2 $3", ["[23568]|4(?:0[02-48]|[1-478])|7[1-9]", "[23568]|4(?:0[2-48]|[1-478])|(?:400|7)[1-9]"], "0$1"], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["[49]"], "0$1"], ["(\\d{2})(\\d{4})(\\d{4,5})", "$1 $2 $3", ["7"], "0$1"]], "0", 0, 0, 0, 0, 0, 0, 0, "#"], "TZ": ["255", "00[056]", "(?:[25-8]\\d|41|90)\\d{7}", [9], [["(\\d{3})(\\d{2})(\\d{4})", "$1 $2 $3", ["[89]"], "0$1"], ["(\\d{2})(\\d{3})(\\d{4})", "$1 $2 $3", ["[24]"], "0$1"], ["(\\d{2})(\\d{7})", "$1 $2", ["5"]], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["[67]"], "0$1"]], "0"], "UA": ["380", "00", "[89]\\d{9}|[3-9]\\d{8}", [9, 10], [["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["6[12][29]|(?:3[1-8]|4[136-8]|5[12457]|6[49])2|(?:56|65)[24]", "6[12][29]|(?:35|4[1378]|5[12457]|6[49])2|(?:56|65)[24]|(?:3[1-46-8]|46)2[013-9]"], "0$1"], ["(\\d{4})(\\d{5})", "$1 $2", ["3[1-8]|4(?:[1367]|[45][6-9]|8[4-6])|5(?:[1-5]|6[0135689]|7[4-6])|6(?:[12][3-7]|[459])", "3[1-8]|4(?:[1367]|[45][6-9]|8[4-6])|5(?:[1-5]|6(?:[015689]|3[02389])|7[4-6])|6(?:[12][3-7]|[459])"], "0$1"], ["(\\d{2})(\\d{3})(\\d{4})", "$1 $2 $3", ["[3-7]|89|9[1-9]"], "0$1"], ["(\\d{3})(\\d{3})(\\d{3,4})", "$1 $2 $3", ["[89]"], "0$1"]], "0", 0, 0, 0, 0, 0, 0, "0~0"], "UG": ["256", "00[057]", "800\\d{6}|(?:[29]0|[347]\\d)\\d{7}", [9], [["(\\d{4})(\\d{5})", "$1 $2", ["202", "2024"], "0$1"], ["(\\d{3})(\\d{6})", "$1 $2", ["[27-9]|4(?:6[45]|[7-9])"], "0$1"], ["(\\d{2})(\\d{7})", "$1 $2", ["[34]"], "0$1"]], "0"], "US": ["1", "011", "[2-9]\\d{9}|3\\d{6}", [10], [["(\\d{3})(\\d{4})", "$1-$2", ["310"], 0, 1], ["(\\d{3})(\\d{3})(\\d{4})", "($1) $2-$3", ["[2-9]"], 0, 1, "$1-$2-$3"]], "1", 0, 0, 0, 0, 0, [["(?:274[27]|(?:472|983)[2-47-9])\\d{6}|(?:2(?:0[1-35-9]|1[02-9]|2[03-57-9]|3[1459]|4[08]|5[1-46]|6[0279]|7[0269]|8[13])|3(?:0[1-57-9]|1[02-9]|2[013-79]|3[0-24679]|4[167]|5[0-3]|6[01349]|8[056])|4(?:0[124-9]|1[02-579]|2[3-5]|3[0245]|4[023578]|58|6[349]|7[0589]|8[04])|5(?:0[1-57-9]|1[0235-8]|20|3[0149]|4[01]|5[179]|6[1-47]|7[0-5]|8[0256])|6(?:0[1-35-9]|1[024-9]|2[03689]|3[016]|4[0156]|5[01679]|6[0-279]|78|8[0-269])|7(?:0[1-46-8]|1[2-9]|2[04-8]|3[0-2478]|4[0378]|5[47]|6[02359]|7[0-59]|8[156])|8(?:0[1-68]|1[02-8]|2[0168]|3[0-2589]|4[03578]|5[046-9]|6[02-5]|7[028])|9(?:0[1346-9]|1[02-9]|2[0589]|3[0146-8]|4[01357-9]|5[12469]|7[0-3589]|8[04-69]))[2-9]\\d{6}"], [""], ["8(?:00|33|44|55|66|77|88)[2-9]\\d{6}"], ["900[2-9]\\d{6}"], ["52(?:3(?:[2-46-9][02-9]\\d|5(?:[02-46-9]\\d|5[0-46-9]))|4(?:[2-478][02-9]\\d|5(?:[034]\\d|2[024-9]|5[0-46-9])|6(?:0[1-9]|[2-9]\\d)|9(?:[05-9]\\d|2[0-5]|49)))\\d{4}|52[34][2-9]1[02-9]\\d{4}|5(?:00|2[125-9]|3[23]|44|66|77|88)[2-9]\\d{6}"]]], "UY": ["598", "0(?:0|1[3-9]\\d)", "0004\\d{2,9}|[1249]\\d{7}|2\\d{3,4}|(?:[49]\\d|80)\\d{5}", [4, 5, 6, 7, 8, 9, 10, 11, 12, 13], [["(\\d{4,5})", "$1", ["21"]], ["(\\d{3})(\\d{3,4})", "$1 $2", ["0"]], ["(\\d{3})(\\d{4})", "$1 $2", ["[49]0|8"], "0$1"], ["(\\d{2})(\\d{3})(\\d{3})", "$1 $2 $3", ["9"], "0$1"], ["(\\d{4})(\\d{4})", "$1 $2", ["[124]"]], ["(\\d{3})(\\d{3})(\\d{2,4})", "$1 $2 $3", ["0"]], ["(\\d{3})(\\d{3})(\\d{3})(\\d{2,4})", "$1 $2 $3 $4", ["0"]]], "0", 0, 0, 0, 0, 0, 0, "00", " int. "], "UZ": ["998", "00", "(?:20|33|[5-9]\\d)\\d{7}", [9], [["(\\d{2})(\\d{3})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[235-9]"]]]], "VA": ["39", "00", "0\\d{5,10}|3[0-8]\\d{7,10}|55\\d{8}|8\\d{5}(?:\\d{2,4})?|(?:1\\d|39)\\d{7,8}", [6, 7, 8, 9, 10, 11, 12], 0, 0, 0, 0, 0, 0, "06698"], "VC": ["1", "011", "(?:[58]\\d\\d|784|900)\\d{7}", [10], 0, "1", 0, "([2-7]\\d{6})$|1", "784$1", 0, "784"], "VE": ["58", "00", "[68]00\\d{7}|(?:[24]\\d|[59]0)\\d{8}", [10], [["(\\d{3})(\\d{7})", "$1-$2", ["[24-689]"], "0$1"]], "0"], "VG": ["1", "011", "(?:284|[58]\\d\\d|900)\\d{7}", [10], 0, "1", 0, "([2-578]\\d{6})$|1", "284$1", 0, "284"], "VI": ["1", "011", "[58]\\d{9}|(?:34|90)0\\d{7}", [10], 0, "1", 0, "([2-9]\\d{6})$|1", "340$1", 0, "340"], "VN": ["84", "00", "[12]\\d{9}|[135-9]\\d{8}|[16]\\d{6,7}|7\\d{6}", [7, 8, 9, 10], [["(\\d{4})(\\d{4,6})", "$1 $2", ["1(?:2[02]|[89])"], 0, 1], ["(\\d{2})(\\d{3})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["1[26]|6"], "0$1", 1], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["[357-9]"], "0$1", 1], ["(\\d{2})(\\d{4})(\\d{4})", "$1 $2 $3", ["2[48]"], "0$1", 1], ["(\\d{3})(\\d{4})(\\d{3})", "$1 $2 $3", ["2"], "0$1", 1]], "0"], "VU": ["678", "00", "[57-9]\\d{6}|(?:[238]\\d|48)\\d{3}", [5, 7], [["(\\d{3})(\\d{4})", "$1 $2", ["[57-9]"]]]], "WF": ["681", "00", "(?:40|72|8\\d{4})\\d{4}|[89]\\d{5}", [6, 9], [["(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3", ["[47-9]"]], ["(\\d{3})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["8"]]]], "WS": ["685", "0", "(?:[2-6]|8\\d{5})\\d{4}|[78]\\d{6}|[68]\\d{5}", [5, 6, 7, 10], [["(\\d{5})", "$1", ["[2-5]|6[1-9]"]], ["(\\d{3})(\\d{3,7})", "$1 $2", ["[68]"]], ["(\\d{2})(\\d{5})", "$1 $2", ["7"]]]], "XK": ["383", "00", "2\\d{7,8}|3\\d{7,11}|(?:4\\d\\d|[89]00)\\d{5}", [8, 9, 10, 11, 12], [["(\\d{3})(\\d{5})", "$1 $2", ["[89]"], "0$1"], ["(\\d{2})(\\d{3})(\\d{3})", "$1 $2 $3", ["[2-4]"], "0$1"], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["2|39"], "0$1"], ["(\\d{2})(\\d{7,10})", "$1 $2", ["3"], "0$1"]], "0"], "YE": ["967", "00", "(?:1|7\\d)\\d{7}|[1-7]\\d{6}", [7, 8, 9], [["(\\d)(\\d{3})(\\d{3,4})", "$1 $2 $3", ["[1-6]|7(?:[24-6]|8[0-7])"], "0$1"], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["7"], "0$1"]], "0"], "YT": ["262", "00", "(?:639\\d|7093)\\d{5}|(?:26|80|9\\d)\\d{7}", [9], 0, "0", 0, 0, 0, 0, 0, [["26(?:89\\d|9(?:0[0-467]|15|5[0-4]|6\\d|[78]0))\\d{4}"], ["(?:639(?:0[0-79]|1[019]|[267]\\d|3[09]|40|5[05-9]|9[04-79])|7093[5-7])\\d{4}"], ["80\\d{7}"], 0, 0, 0, 0, 0, ["9(?:(?:39|47)8[01]|769\\d)\\d{4}"]]], "ZA": ["27", "00", "[1-79]\\d{8}|8\\d{4,9}", [5, 6, 7, 8, 9, 10], [["(\\d{2})(\\d{3,4})", "$1 $2", ["8[1-4]"], "0$1"], ["(\\d{2})(\\d{3})(\\d{2,3})", "$1 $2 $3", ["8[1-4]"], "0$1"], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["860"], "0$1"], ["(\\d{2})(\\d{3})(\\d{4})", "$1 $2 $3", ["[1-9]"], "0$1"], ["(\\d{3})(\\d{3})(\\d{4})", "$1 $2 $3", ["8"], "0$1"]], "0"], "ZM": ["260", "00", "800\\d{6}|(?:21|[579]\\d|63)\\d{7}", [9], [["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["[28]"], "0$1"], ["(\\d{2})(\\d{7})", "$1 $2", ["[579]"], "0$1"]], "0"], "ZW": ["263", "00", "2(?:[0-57-9]\\d{6,8}|6[0-24-9]\\d{6,7})|[38]\\d{9}|[35-8]\\d{8}|[3-6]\\d{7}|[1-689]\\d{6}|[1-3569]\\d{5}|[1356]\\d{4}", [5, 6, 7, 8, 9, 10], [["(\\d{3})(\\d{3,5})", "$1 $2", ["2(?:0[45]|2[278]|[49]8)|3(?:[09]8|17)|6(?:[29]8|37|75)|[23][78]|(?:33|5[15]|6[68])[78]"], "0$1"], ["(\\d)(\\d{3})(\\d{2,4})", "$1 $2 $3", ["[49]"], "0$1"], ["(\\d{3})(\\d{4})", "$1 $2", ["80"], "0$1"], ["(\\d{2})(\\d{7})", "$1 $2", ["24|8[13-59]|(?:2[05-79]|39|5[45]|6[15-8])2", "2(?:02[014]|4|[56]20|[79]2)|392|5(?:42|525)|6(?:[16-8]21|52[013])|8[13-59]"], "(0$1)"], ["(\\d{2})(\\d{3})(\\d{4})", "$1 $2 $3", ["7"], "0$1"], ["(\\d{3})(\\d{3})(\\d{3,4})", "$1 $2 $3", ["2(?:1[39]|2[0157]|[378]|[56][14])|3(?:12|29)", "2(?:1[39]|2[0157]|[378]|[56][14])|3(?:123|29)"], "0$1"], ["(\\d{4})(\\d{6})", "$1 $2", ["8"], "0$1"], ["(\\d{2})(\\d{3,5})", "$1 $2", ["1|2(?:0[0-36-9]|12|29|[56])|3(?:1[0-689]|[24-6])|5(?:[0236-9]|1[2-4])|6(?:[013-59]|7[0-46-9])|(?:33|55|6[68])[0-69]|(?:29|3[09]|62)[0-79]"], "0$1"], ["(\\d{2})(\\d{3})(\\d{3,4})", "$1 $2 $3", ["29[013-9]|39|54"], "0$1"], ["(\\d{4})(\\d{3,5})", "$1 $2", ["(?:25|54)8", "258|5483"], "0$1"]], "0"] }, "nonGeographic": { "800": ["800", 0, "(?:00|[1-9]\\d)\\d{6}", [8], [["(\\d{4})(\\d{4})", "$1 $2", ["\\d"]]], 0, 0, 0, 0, 0, 0, [0, 0, ["(?:00|[1-9]\\d)\\d{6}"]]], "808": ["808", 0, "[1-9]\\d{7}", [8], [["(\\d{4})(\\d{4})", "$1 $2", ["[1-9]"]]], 0, 0, 0, 0, 0, 0, [0, 0, 0, 0, 0, 0, 0, 0, 0, ["[1-9]\\d{7}"]]], "870": ["870", 0, "7\\d{11}|[235-7]\\d{8}", [9, 12], [["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["[235-7]"]]], 0, 0, 0, 0, 0, 0, [0, ["(?:[356]|774[45])\\d{8}|7[6-8]\\d{7}"], 0, 0, 0, 0, 0, 0, ["2\\d{8}", [9]]]], "878": ["878", 0, "10\\d{10}", [12], [["(\\d{2})(\\d{5})(\\d{5})", "$1 $2 $3", ["1"]]], 0, 0, 0, 0, 0, 0, [0, 0, 0, 0, 0, 0, 0, 0, ["10\\d{10}"]]], "881": ["881", 0, "6\\d{9}|[0-36-9]\\d{8}", [9, 10], [["(\\d)(\\d{3})(\\d{5})", "$1 $2 $3", ["[0-37-9]"]], ["(\\d)(\\d{3})(\\d{5,6})", "$1 $2 $3", ["6"]]], 0, 0, 0, 0, 0, 0, [0, ["6\\d{9}|[0-36-9]\\d{8}"]]], "882": ["882", 0, "[13]\\d{6}(?:\\d{2,5})?|[19]\\d{7}|(?:[25]\\d\\d|4)\\d{7}(?:\\d{2})?", [7, 8, 9, 10, 11, 12], [["(\\d{2})(\\d{5})", "$1 $2", ["16|342"]], ["(\\d{2})(\\d{6})", "$1 $2", ["49"]], ["(\\d{2})(\\d{2})(\\d{4})", "$1 $2 $3", ["1[36]|9"]], ["(\\d{2})(\\d{4})(\\d{3})", "$1 $2 $3", ["3[23]"]], ["(\\d{2})(\\d{3,4})(\\d{4})", "$1 $2 $3", ["16"]], ["(\\d{2})(\\d{4})(\\d{4})", "$1 $2 $3", ["10|23|3(?:[15]|4[57])|4|5[12]"]], ["(\\d{3})(\\d{4})(\\d{4})", "$1 $2 $3", ["34"]], ["(\\d{2})(\\d{4,5})(\\d{5})", "$1 $2 $3", ["[1-35]"]]], 0, 0, 0, 0, 0, 0, [0, ["342\\d{4}|(?:337|49)\\d{6}|(?:3(?:2|47|7\\d{3})|5(?:0\\d{3}|2[0-2]))\\d{7}", [7, 8, 9, 10, 12]], 0, 0, 0, ["348[57]\\d{7}", [11]], 0, 0, ["1(?:3(?:0[0347]|[13][0139]|2[035]|4[013568]|6[0459]|7[06]|8[15-8]|9[0689])\\d{4}|6\\d{5,10})|(?:345\\d|9[89])\\d{6}|(?:10|2(?:3|85\\d)|3(?:[15]|[69]\\d\\d)|4[15-8]|51)\\d{8}"]]], "883": ["883", 0, "(?:[1-4]\\d|51)\\d{6,10}", [8, 9, 10, 11, 12], [["(\\d{3})(\\d{3})(\\d{2,8})", "$1 $2 $3", ["[14]|2[24-689]|3[02-689]|51[24-9]"]], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["510"]], ["(\\d{3})(\\d{3})(\\d{4})", "$1 $2 $3", ["21"]], ["(\\d{4})(\\d{4})(\\d{4})", "$1 $2 $3", ["51[13]"]], ["(\\d{3})(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3 $4", ["[235]"]]], 0, 0, 0, 0, 0, 0, [0, 0, 0, 0, 0, 0, 0, 0, ["(?:2(?:00\\d\\d|10)|(?:370[1-9]|51\\d0)\\d)\\d{7}|51(?:00\\d{5}|[24-9]0\\d{4,7})|(?:1[0-79]|2[24-689]|3[02-689]|4[0-4])0\\d{5,9}"]]], "888": ["888", 0, "\\d{11}", [11], [["(\\d{3})(\\d{3})(\\d{5})", "$1 $2 $3"]], 0, 0, 0, 0, 0, 0, [0, 0, 0, 0, 0, 0, ["\\d{11}"]]], "979": ["979", 0, "[1359]\\d{8}", [9], [["(\\d)(\\d{4})(\\d{4})", "$1 $2 $3", ["[1359]"]]], 0, 0, 0, 0, 0, 0, [0, 0, 0, ["[1359]\\d{8}"]]] } };
|
|
283
|
+
|
|
284
|
+
// node_modules/.pnpm/libphonenumber-js@1.13.7/node_modules/libphonenumber-js/es6/tools/semver-compare.js
|
|
285
|
+
function semver_compare_default(a2, b2) {
|
|
286
|
+
a2 = a2.split("-");
|
|
287
|
+
b2 = b2.split("-");
|
|
288
|
+
var pa = a2[0].split(".");
|
|
289
|
+
var pb = b2[0].split(".");
|
|
290
|
+
for (var i2 = 0; i2 < 3; i2++) {
|
|
291
|
+
var na = Number(pa[i2]);
|
|
292
|
+
var nb = Number(pb[i2]);
|
|
293
|
+
if (na > nb) return 1;
|
|
294
|
+
if (nb > na) return -1;
|
|
295
|
+
if (!isNaN(na) && isNaN(nb)) return 1;
|
|
296
|
+
if (isNaN(na) && !isNaN(nb)) return -1;
|
|
297
|
+
}
|
|
298
|
+
if (a2[1] && b2[1]) {
|
|
299
|
+
return a2[1] > b2[1] ? 1 : a2[1] < b2[1] ? -1 : 0;
|
|
300
|
+
}
|
|
301
|
+
return !a2[1] && b2[1] ? 1 : a2[1] && !b2[1] ? -1 : 0;
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
// node_modules/.pnpm/libphonenumber-js@1.13.7/node_modules/libphonenumber-js/es6/helpers/isObject.js
|
|
305
|
+
var objectConstructor = {}.constructor;
|
|
306
|
+
function isObject(object) {
|
|
307
|
+
return object !== void 0 && object !== null && object.constructor === objectConstructor;
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
// node_modules/.pnpm/libphonenumber-js@1.13.7/node_modules/libphonenumber-js/es6/helpers/isCallingCode.js
|
|
311
|
+
var CALLING_CODE_REG_EXP = /^\d+$/;
|
|
312
|
+
function isCallingCode(string) {
|
|
313
|
+
return CALLING_CODE_REG_EXP.test(string);
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
// node_modules/.pnpm/libphonenumber-js@1.13.7/node_modules/libphonenumber-js/es6/metadata.js
|
|
317
|
+
function _typeof(o2) {
|
|
318
|
+
"@babel/helpers - typeof";
|
|
319
|
+
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o3) {
|
|
320
|
+
return typeof o3;
|
|
321
|
+
} : function(o3) {
|
|
322
|
+
return o3 && "function" == typeof Symbol && o3.constructor === Symbol && o3 !== Symbol.prototype ? "symbol" : typeof o3;
|
|
323
|
+
}, _typeof(o2);
|
|
324
|
+
}
|
|
325
|
+
function _classCallCheck(a2, n2) {
|
|
326
|
+
if (!(a2 instanceof n2)) throw new TypeError("Cannot call a class as a function");
|
|
327
|
+
}
|
|
328
|
+
function _defineProperties(e2, r2) {
|
|
329
|
+
for (var t2 = 0; t2 < r2.length; t2++) {
|
|
330
|
+
var o2 = r2[t2];
|
|
331
|
+
o2.enumerable = o2.enumerable || false, o2.configurable = true, "value" in o2 && (o2.writable = true), Object.defineProperty(e2, _toPropertyKey(o2.key), o2);
|
|
332
|
+
}
|
|
333
|
+
}
|
|
334
|
+
function _createClass(e2, r2, t2) {
|
|
335
|
+
return r2 && _defineProperties(e2.prototype, r2), t2 && _defineProperties(e2, t2), Object.defineProperty(e2, "prototype", { writable: false }), e2;
|
|
336
|
+
}
|
|
337
|
+
function _toPropertyKey(t2) {
|
|
338
|
+
var i2 = _toPrimitive(t2, "string");
|
|
339
|
+
return "symbol" == _typeof(i2) ? i2 : i2 + "";
|
|
340
|
+
}
|
|
341
|
+
function _toPrimitive(t2, r2) {
|
|
342
|
+
if ("object" != _typeof(t2) || !t2) return t2;
|
|
343
|
+
var e2 = t2[Symbol.toPrimitive];
|
|
344
|
+
if (void 0 !== e2) {
|
|
345
|
+
var i2 = e2.call(t2, r2 || "default");
|
|
346
|
+
if ("object" != _typeof(i2)) return i2;
|
|
347
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
348
|
+
}
|
|
349
|
+
return ("string" === r2 ? String : Number)(t2);
|
|
350
|
+
}
|
|
351
|
+
var V3 = "1.2.0";
|
|
352
|
+
var V4 = "1.7.35";
|
|
353
|
+
var DEFAULT_EXT_PREFIX = " ext. ";
|
|
354
|
+
var Metadata = /* @__PURE__ */ (function() {
|
|
355
|
+
function Metadata2(metadata) {
|
|
356
|
+
_classCallCheck(this, Metadata2);
|
|
357
|
+
validateMetadata(metadata);
|
|
358
|
+
this.metadata = metadata;
|
|
359
|
+
setVersion.call(this, metadata);
|
|
360
|
+
}
|
|
361
|
+
return _createClass(Metadata2, [{
|
|
362
|
+
key: "getCountries",
|
|
363
|
+
value: function getCountries() {
|
|
364
|
+
return Object.keys(this.metadata.countries).filter(function(_) {
|
|
365
|
+
return _ !== "001";
|
|
366
|
+
});
|
|
367
|
+
}
|
|
368
|
+
}, {
|
|
369
|
+
key: "getCountryMetadata",
|
|
370
|
+
value: function getCountryMetadata(countryCode) {
|
|
371
|
+
return this.metadata.countries[countryCode];
|
|
372
|
+
}
|
|
373
|
+
}, {
|
|
374
|
+
key: "nonGeographic",
|
|
375
|
+
value: function nonGeographic() {
|
|
376
|
+
if (this.v1 || this.v2 || this.v3) return;
|
|
377
|
+
return this.metadata.nonGeographic || this.metadata.nonGeographical;
|
|
378
|
+
}
|
|
379
|
+
}, {
|
|
380
|
+
key: "hasCountry",
|
|
381
|
+
value: function hasCountry(country) {
|
|
382
|
+
return this.getCountryMetadata(country) !== void 0;
|
|
383
|
+
}
|
|
384
|
+
}, {
|
|
385
|
+
key: "hasCallingCode",
|
|
386
|
+
value: function hasCallingCode(callingCode) {
|
|
387
|
+
if (this.getCountryCodesForCallingCode(callingCode)) {
|
|
388
|
+
return true;
|
|
389
|
+
}
|
|
390
|
+
if (this.nonGeographic()) {
|
|
391
|
+
if (this.nonGeographic()[callingCode]) {
|
|
392
|
+
return true;
|
|
393
|
+
}
|
|
394
|
+
} else {
|
|
395
|
+
var countryCodes = this.countryCallingCodes()[callingCode];
|
|
396
|
+
if (countryCodes && countryCodes.length === 1 && countryCodes[0] === "001") {
|
|
397
|
+
return true;
|
|
398
|
+
}
|
|
399
|
+
}
|
|
400
|
+
}
|
|
401
|
+
}, {
|
|
402
|
+
key: "isNonGeographicCallingCode",
|
|
403
|
+
value: function isNonGeographicCallingCode(callingCode) {
|
|
404
|
+
if (this.nonGeographic()) {
|
|
405
|
+
return this.nonGeographic()[callingCode] ? true : false;
|
|
406
|
+
} else {
|
|
407
|
+
return this.getCountryCodesForCallingCode(callingCode) ? false : true;
|
|
408
|
+
}
|
|
409
|
+
}
|
|
410
|
+
// Deprecated.
|
|
411
|
+
}, {
|
|
412
|
+
key: "country",
|
|
413
|
+
value: function country(countryCode) {
|
|
414
|
+
return this.selectNumberingPlan(countryCode);
|
|
415
|
+
}
|
|
416
|
+
/**
|
|
417
|
+
* Selects a telephone numbering plan based on either a country code or a calling code.
|
|
418
|
+
* @param {string} argument — Country code or calling code.
|
|
419
|
+
* @param {string} legacyArgumentCallingCode — Legacy argument: calling code, if the first argument is not passed.
|
|
420
|
+
*/
|
|
421
|
+
}, {
|
|
422
|
+
key: "selectNumberingPlan",
|
|
423
|
+
value: function selectNumberingPlan(argument, legacyArgumentCallingCode) {
|
|
424
|
+
var countryCode;
|
|
425
|
+
var callingCode;
|
|
426
|
+
if (argument) {
|
|
427
|
+
if (isCallingCode(argument)) {
|
|
428
|
+
callingCode = argument;
|
|
429
|
+
} else {
|
|
430
|
+
countryCode = argument;
|
|
431
|
+
}
|
|
432
|
+
}
|
|
433
|
+
if (legacyArgumentCallingCode) {
|
|
434
|
+
callingCode = legacyArgumentCallingCode;
|
|
435
|
+
}
|
|
436
|
+
if (countryCode && countryCode !== "001") {
|
|
437
|
+
var countryMetadata = this.getCountryMetadata(countryCode);
|
|
438
|
+
if (!countryMetadata) {
|
|
439
|
+
throw new Error("Unknown country: ".concat(countryCode));
|
|
440
|
+
}
|
|
441
|
+
this.numberingPlan = new NumberingPlan(countryMetadata, this);
|
|
442
|
+
} else if (callingCode) {
|
|
443
|
+
if (!this.hasCallingCode(callingCode)) {
|
|
444
|
+
throw new Error("Unknown calling code: ".concat(callingCode));
|
|
445
|
+
}
|
|
446
|
+
this.numberingPlan = new NumberingPlan(this.getNumberingPlanMetadata(callingCode), this);
|
|
447
|
+
} else {
|
|
448
|
+
this.numberingPlan = void 0;
|
|
449
|
+
}
|
|
450
|
+
return this;
|
|
451
|
+
}
|
|
452
|
+
}, {
|
|
453
|
+
key: "getCountryCodesForCallingCode",
|
|
454
|
+
value: function getCountryCodesForCallingCode(callingCode) {
|
|
455
|
+
var countryCodes = this.countryCallingCodes()[callingCode];
|
|
456
|
+
if (countryCodes) {
|
|
457
|
+
if (countryCodes.length === 1 && countryCodes[0].length === 3) {
|
|
458
|
+
return;
|
|
459
|
+
}
|
|
460
|
+
return countryCodes;
|
|
461
|
+
}
|
|
462
|
+
}
|
|
463
|
+
}, {
|
|
464
|
+
key: "getCountryCodeForCallingCode",
|
|
465
|
+
value: function getCountryCodeForCallingCode(callingCode) {
|
|
466
|
+
var countryCodes = this.getCountryCodesForCallingCode(callingCode);
|
|
467
|
+
if (countryCodes) {
|
|
468
|
+
return countryCodes[0];
|
|
469
|
+
}
|
|
470
|
+
}
|
|
471
|
+
}, {
|
|
472
|
+
key: "getNumberingPlanMetadata",
|
|
473
|
+
value: function getNumberingPlanMetadata(callingCode) {
|
|
474
|
+
var countryCode = this.getCountryCodeForCallingCode(callingCode);
|
|
475
|
+
if (countryCode) {
|
|
476
|
+
return this.getCountryMetadata(countryCode);
|
|
477
|
+
}
|
|
478
|
+
if (this.nonGeographic()) {
|
|
479
|
+
var metadata = this.nonGeographic()[callingCode];
|
|
480
|
+
if (metadata) {
|
|
481
|
+
return metadata;
|
|
482
|
+
}
|
|
483
|
+
} else {
|
|
484
|
+
var countryCodes = this.countryCallingCodes()[callingCode];
|
|
485
|
+
if (countryCodes && countryCodes.length === 1 && countryCodes[0] === "001") {
|
|
486
|
+
return this.metadata.countries["001"];
|
|
487
|
+
}
|
|
488
|
+
}
|
|
489
|
+
}
|
|
490
|
+
// Deprecated.
|
|
491
|
+
}, {
|
|
492
|
+
key: "countryCallingCode",
|
|
493
|
+
value: function countryCallingCode() {
|
|
494
|
+
return this.numberingPlan.callingCode();
|
|
495
|
+
}
|
|
496
|
+
// Deprecated.
|
|
497
|
+
}, {
|
|
498
|
+
key: "IDDPrefix",
|
|
499
|
+
value: function IDDPrefix() {
|
|
500
|
+
return this.numberingPlan.IDDPrefix();
|
|
501
|
+
}
|
|
502
|
+
// Deprecated.
|
|
503
|
+
}, {
|
|
504
|
+
key: "defaultIDDPrefix",
|
|
505
|
+
value: function defaultIDDPrefix() {
|
|
506
|
+
return this.numberingPlan.defaultIDDPrefix();
|
|
507
|
+
}
|
|
508
|
+
// Deprecated.
|
|
509
|
+
}, {
|
|
510
|
+
key: "nationalNumberPattern",
|
|
511
|
+
value: function nationalNumberPattern() {
|
|
512
|
+
return this.numberingPlan.nationalNumberPattern();
|
|
513
|
+
}
|
|
514
|
+
// Deprecated.
|
|
515
|
+
}, {
|
|
516
|
+
key: "possibleLengths",
|
|
517
|
+
value: function possibleLengths() {
|
|
518
|
+
return this.numberingPlan.possibleLengths();
|
|
519
|
+
}
|
|
520
|
+
// Deprecated.
|
|
521
|
+
}, {
|
|
522
|
+
key: "formats",
|
|
523
|
+
value: function formats() {
|
|
524
|
+
return this.numberingPlan.formats();
|
|
525
|
+
}
|
|
526
|
+
// Deprecated.
|
|
527
|
+
}, {
|
|
528
|
+
key: "nationalPrefixForParsing",
|
|
529
|
+
value: function nationalPrefixForParsing() {
|
|
530
|
+
return this.numberingPlan.nationalPrefixForParsing();
|
|
531
|
+
}
|
|
532
|
+
// Deprecated.
|
|
533
|
+
}, {
|
|
534
|
+
key: "nationalPrefixTransformRule",
|
|
535
|
+
value: function nationalPrefixTransformRule() {
|
|
536
|
+
return this.numberingPlan.nationalPrefixTransformRule();
|
|
537
|
+
}
|
|
538
|
+
// Deprecated.
|
|
539
|
+
}, {
|
|
540
|
+
key: "leadingDigits",
|
|
541
|
+
value: function leadingDigits() {
|
|
542
|
+
return this.numberingPlan.leadingDigits();
|
|
543
|
+
}
|
|
544
|
+
// Deprecated.
|
|
545
|
+
}, {
|
|
546
|
+
key: "hasTypes",
|
|
547
|
+
value: function hasTypes() {
|
|
548
|
+
return this.numberingPlan.hasTypes();
|
|
549
|
+
}
|
|
550
|
+
// Deprecated.
|
|
551
|
+
}, {
|
|
552
|
+
key: "type",
|
|
553
|
+
value: function type(_type) {
|
|
554
|
+
return this.numberingPlan.type(_type);
|
|
555
|
+
}
|
|
556
|
+
// Deprecated.
|
|
557
|
+
}, {
|
|
558
|
+
key: "ext",
|
|
559
|
+
value: function ext() {
|
|
560
|
+
return this.numberingPlan.ext();
|
|
561
|
+
}
|
|
562
|
+
}, {
|
|
563
|
+
key: "countryCallingCodes",
|
|
564
|
+
value: function countryCallingCodes() {
|
|
565
|
+
if (this.v1) return this.metadata.country_phone_code_to_countries;
|
|
566
|
+
return this.metadata.country_calling_codes;
|
|
567
|
+
}
|
|
568
|
+
// Deprecated.
|
|
569
|
+
}, {
|
|
570
|
+
key: "chooseCountryByCountryCallingCode",
|
|
571
|
+
value: function chooseCountryByCountryCallingCode(callingCode) {
|
|
572
|
+
return this.selectNumberingPlan(callingCode);
|
|
573
|
+
}
|
|
574
|
+
}, {
|
|
575
|
+
key: "hasSelectedNumberingPlan",
|
|
576
|
+
value: function hasSelectedNumberingPlan() {
|
|
577
|
+
return this.numberingPlan !== void 0;
|
|
578
|
+
}
|
|
579
|
+
}]);
|
|
580
|
+
})();
|
|
581
|
+
var NumberingPlan = /* @__PURE__ */ (function() {
|
|
582
|
+
function NumberingPlan2(metadata, globalMetadataObject) {
|
|
583
|
+
_classCallCheck(this, NumberingPlan2);
|
|
584
|
+
this.globalMetadataObject = globalMetadataObject;
|
|
585
|
+
this.metadata = metadata;
|
|
586
|
+
setVersion.call(this, globalMetadataObject.metadata);
|
|
587
|
+
}
|
|
588
|
+
return _createClass(NumberingPlan2, [{
|
|
589
|
+
key: "callingCode",
|
|
590
|
+
value: function callingCode() {
|
|
591
|
+
return this.metadata[0];
|
|
592
|
+
}
|
|
593
|
+
// When multiple countries share the same calling code,
|
|
594
|
+
// all phone number formatting rules are included in the metadata
|
|
595
|
+
// of the "default" country for that calling code.
|
|
596
|
+
// Any other countries' metdata doesn't include any formatting rules.
|
|
597
|
+
// Google developers said that such storage architecture was chosen for performance reasons.
|
|
598
|
+
//
|
|
599
|
+
// For example, for NANPA region ("North American Numbering Plan Administration",
|
|
600
|
+
// which includes USA, Canada, Cayman Islands, Bahamas, etc) all formatting rules
|
|
601
|
+
// are contained in the metadata of `US` country.
|
|
602
|
+
//
|
|
603
|
+
// This is not public API.
|
|
604
|
+
//
|
|
605
|
+
}, {
|
|
606
|
+
key: "_getDefaultCountryMetadataForThisCallingCode",
|
|
607
|
+
value: function _getDefaultCountryMetadataForThisCallingCode() {
|
|
608
|
+
return this.globalMetadataObject.getNumberingPlanMetadata(this.callingCode());
|
|
609
|
+
}
|
|
610
|
+
// Deprecated.
|
|
611
|
+
}, {
|
|
612
|
+
key: "getDefaultCountryMetadataForRegion",
|
|
613
|
+
value: function getDefaultCountryMetadataForRegion() {
|
|
614
|
+
return this._getDefaultCountryMetadataForThisCallingCode();
|
|
615
|
+
}
|
|
616
|
+
// Is always present.
|
|
617
|
+
}, {
|
|
618
|
+
key: "IDDPrefix",
|
|
619
|
+
value: function IDDPrefix() {
|
|
620
|
+
if (this.v1 || this.v2) return;
|
|
621
|
+
return this.metadata[1];
|
|
622
|
+
}
|
|
623
|
+
// Is only present when a country supports multiple IDD prefixes.
|
|
624
|
+
}, {
|
|
625
|
+
key: "defaultIDDPrefix",
|
|
626
|
+
value: function defaultIDDPrefix() {
|
|
627
|
+
if (this.v1 || this.v2) return;
|
|
628
|
+
return this.metadata[12];
|
|
629
|
+
}
|
|
630
|
+
}, {
|
|
631
|
+
key: "nationalNumberPattern",
|
|
632
|
+
value: function nationalNumberPattern() {
|
|
633
|
+
if (this.v1 || this.v2) return this.metadata[1];
|
|
634
|
+
return this.metadata[2];
|
|
635
|
+
}
|
|
636
|
+
// "possible length" data is always present in Google's metadata.
|
|
637
|
+
}, {
|
|
638
|
+
key: "possibleLengths",
|
|
639
|
+
value: function possibleLengths() {
|
|
640
|
+
if (this.v1) return;
|
|
641
|
+
return this.metadata[this.v2 ? 2 : 3];
|
|
642
|
+
}
|
|
643
|
+
}, {
|
|
644
|
+
key: "_getFormats",
|
|
645
|
+
value: function _getFormats(metadata) {
|
|
646
|
+
return metadata[this.v1 ? 2 : this.v2 ? 3 : 4];
|
|
647
|
+
}
|
|
648
|
+
// For countries of the same region (e.g. NANPA)
|
|
649
|
+
// formats are all stored in the "main" country for that region.
|
|
650
|
+
// E.g. "RU" and "KZ", "US" and "CA".
|
|
651
|
+
}, {
|
|
652
|
+
key: "formats",
|
|
653
|
+
value: function formats() {
|
|
654
|
+
var _this = this;
|
|
655
|
+
var formats2 = this._getFormats(this.metadata) || this._getFormats(this._getDefaultCountryMetadataForThisCallingCode()) || [];
|
|
656
|
+
return formats2.map(function(_) {
|
|
657
|
+
return new Format(_, _this);
|
|
658
|
+
});
|
|
659
|
+
}
|
|
660
|
+
}, {
|
|
661
|
+
key: "nationalPrefix",
|
|
662
|
+
value: function nationalPrefix() {
|
|
663
|
+
return this.metadata[this.v1 ? 3 : this.v2 ? 4 : 5];
|
|
664
|
+
}
|
|
665
|
+
}, {
|
|
666
|
+
key: "_getNationalPrefixFormattingRule",
|
|
667
|
+
value: function _getNationalPrefixFormattingRule(metadata) {
|
|
668
|
+
return metadata[this.v1 ? 4 : this.v2 ? 5 : 6];
|
|
669
|
+
}
|
|
670
|
+
// For countries of the same region (e.g. NANPA)
|
|
671
|
+
// national prefix formatting rule is stored in the "main" country for that region.
|
|
672
|
+
// E.g. "RU" and "KZ", "US" and "CA".
|
|
673
|
+
}, {
|
|
674
|
+
key: "nationalPrefixFormattingRule",
|
|
675
|
+
value: function nationalPrefixFormattingRule() {
|
|
676
|
+
return this._getNationalPrefixFormattingRule(this.metadata) || this._getNationalPrefixFormattingRule(this._getDefaultCountryMetadataForThisCallingCode());
|
|
677
|
+
}
|
|
678
|
+
}, {
|
|
679
|
+
key: "_nationalPrefixForParsing",
|
|
680
|
+
value: function _nationalPrefixForParsing() {
|
|
681
|
+
return this.metadata[this.v1 ? 5 : this.v2 ? 6 : 7];
|
|
682
|
+
}
|
|
683
|
+
}, {
|
|
684
|
+
key: "nationalPrefixForParsing",
|
|
685
|
+
value: function nationalPrefixForParsing() {
|
|
686
|
+
return this._nationalPrefixForParsing() || this.nationalPrefix();
|
|
687
|
+
}
|
|
688
|
+
}, {
|
|
689
|
+
key: "nationalPrefixTransformRule",
|
|
690
|
+
value: function nationalPrefixTransformRule() {
|
|
691
|
+
return this.metadata[this.v1 ? 6 : this.v2 ? 7 : 8];
|
|
692
|
+
}
|
|
693
|
+
}, {
|
|
694
|
+
key: "_getNationalPrefixIsOptionalWhenFormatting",
|
|
695
|
+
value: function _getNationalPrefixIsOptionalWhenFormatting() {
|
|
696
|
+
return !!this.metadata[this.v1 ? 7 : this.v2 ? 8 : 9];
|
|
697
|
+
}
|
|
698
|
+
// For countries of the same region (e.g. NANPA)
|
|
699
|
+
// "national prefix is optional when formatting" flag is
|
|
700
|
+
// stored in the "main" country for that region.
|
|
701
|
+
// E.g. "RU" and "KZ", "US" and "CA".
|
|
702
|
+
}, {
|
|
703
|
+
key: "nationalPrefixIsOptionalWhenFormattingInNationalFormat",
|
|
704
|
+
value: function nationalPrefixIsOptionalWhenFormattingInNationalFormat() {
|
|
705
|
+
return this._getNationalPrefixIsOptionalWhenFormatting(this.metadata) || this._getNationalPrefixIsOptionalWhenFormatting(this._getDefaultCountryMetadataForThisCallingCode());
|
|
706
|
+
}
|
|
707
|
+
}, {
|
|
708
|
+
key: "leadingDigits",
|
|
709
|
+
value: function leadingDigits() {
|
|
710
|
+
return this.metadata[this.v1 ? 8 : this.v2 ? 9 : 10];
|
|
711
|
+
}
|
|
712
|
+
}, {
|
|
713
|
+
key: "types",
|
|
714
|
+
value: function types() {
|
|
715
|
+
return this.metadata[this.v1 ? 9 : this.v2 ? 10 : 11];
|
|
716
|
+
}
|
|
717
|
+
}, {
|
|
718
|
+
key: "hasTypes",
|
|
719
|
+
value: function hasTypes() {
|
|
720
|
+
if (this.types() && this.types().length === 0) {
|
|
721
|
+
return false;
|
|
722
|
+
}
|
|
723
|
+
return !!this.types();
|
|
724
|
+
}
|
|
725
|
+
}, {
|
|
726
|
+
key: "type",
|
|
727
|
+
value: function type(_type2) {
|
|
728
|
+
if (this.hasTypes() && getType(this.types(), _type2)) {
|
|
729
|
+
return new Type(getType(this.types(), _type2), this);
|
|
730
|
+
}
|
|
731
|
+
}
|
|
732
|
+
}, {
|
|
733
|
+
key: "ext",
|
|
734
|
+
value: function ext() {
|
|
735
|
+
if (this.v1 || this.v2) return DEFAULT_EXT_PREFIX;
|
|
736
|
+
return this.metadata[13] || DEFAULT_EXT_PREFIX;
|
|
737
|
+
}
|
|
738
|
+
}]);
|
|
739
|
+
})();
|
|
740
|
+
var Format = /* @__PURE__ */ (function() {
|
|
741
|
+
function Format2(format2, metadata) {
|
|
742
|
+
_classCallCheck(this, Format2);
|
|
743
|
+
this._format = format2;
|
|
744
|
+
this.metadata = metadata;
|
|
745
|
+
}
|
|
746
|
+
return _createClass(Format2, [{
|
|
747
|
+
key: "pattern",
|
|
748
|
+
value: function pattern() {
|
|
749
|
+
return this._format[0];
|
|
750
|
+
}
|
|
751
|
+
}, {
|
|
752
|
+
key: "format",
|
|
753
|
+
value: function format2() {
|
|
754
|
+
return this._format[1];
|
|
755
|
+
}
|
|
756
|
+
}, {
|
|
757
|
+
key: "leadingDigitsPatterns",
|
|
758
|
+
value: function leadingDigitsPatterns() {
|
|
759
|
+
return this._format[2] || [];
|
|
760
|
+
}
|
|
761
|
+
}, {
|
|
762
|
+
key: "nationalPrefixFormattingRule",
|
|
763
|
+
value: function nationalPrefixFormattingRule() {
|
|
764
|
+
return this._format[3] || this.metadata.nationalPrefixFormattingRule();
|
|
765
|
+
}
|
|
766
|
+
}, {
|
|
767
|
+
key: "nationalPrefixIsOptionalWhenFormattingInNationalFormat",
|
|
768
|
+
value: function nationalPrefixIsOptionalWhenFormattingInNationalFormat() {
|
|
769
|
+
return !!this._format[4] || this.metadata.nationalPrefixIsOptionalWhenFormattingInNationalFormat();
|
|
770
|
+
}
|
|
771
|
+
}, {
|
|
772
|
+
key: "nationalPrefixIsMandatoryWhenFormattingInNationalFormat",
|
|
773
|
+
value: function nationalPrefixIsMandatoryWhenFormattingInNationalFormat() {
|
|
774
|
+
return this.usesNationalPrefix() && !this.nationalPrefixIsOptionalWhenFormattingInNationalFormat();
|
|
775
|
+
}
|
|
776
|
+
// Checks whether national prefix formatting rule contains national prefix.
|
|
777
|
+
}, {
|
|
778
|
+
key: "usesNationalPrefix",
|
|
779
|
+
value: function usesNationalPrefix() {
|
|
780
|
+
return this.nationalPrefixFormattingRule() && // Check that national prefix formatting rule is not a "dummy" one.
|
|
781
|
+
!FIRST_GROUP_ONLY_PREFIX_PATTERN.test(this.nationalPrefixFormattingRule()) ? true : false;
|
|
782
|
+
}
|
|
783
|
+
}, {
|
|
784
|
+
key: "internationalFormat",
|
|
785
|
+
value: function internationalFormat() {
|
|
786
|
+
return this._format[5] || this.format();
|
|
787
|
+
}
|
|
788
|
+
}]);
|
|
789
|
+
})();
|
|
790
|
+
var FIRST_GROUP_ONLY_PREFIX_PATTERN = /^\(?\$1\)?$/;
|
|
791
|
+
var Type = /* @__PURE__ */ (function() {
|
|
792
|
+
function Type2(type, metadata) {
|
|
793
|
+
_classCallCheck(this, Type2);
|
|
794
|
+
this.type = type;
|
|
795
|
+
this.metadata = metadata;
|
|
796
|
+
}
|
|
797
|
+
return _createClass(Type2, [{
|
|
798
|
+
key: "pattern",
|
|
799
|
+
value: function pattern() {
|
|
800
|
+
if (this.metadata.v1) return this.type;
|
|
801
|
+
return this.type[0];
|
|
802
|
+
}
|
|
803
|
+
}, {
|
|
804
|
+
key: "possibleLengths",
|
|
805
|
+
value: function possibleLengths() {
|
|
806
|
+
if (this.metadata.v1) return;
|
|
807
|
+
return this.type[1] || this.metadata.possibleLengths();
|
|
808
|
+
}
|
|
809
|
+
}]);
|
|
810
|
+
})();
|
|
811
|
+
function getType(types, type) {
|
|
812
|
+
switch (type) {
|
|
813
|
+
case "FIXED_LINE":
|
|
814
|
+
return types[0];
|
|
815
|
+
case "MOBILE":
|
|
816
|
+
return types[1];
|
|
817
|
+
case "TOLL_FREE":
|
|
818
|
+
return types[2];
|
|
819
|
+
case "PREMIUM_RATE":
|
|
820
|
+
return types[3];
|
|
821
|
+
case "PERSONAL_NUMBER":
|
|
822
|
+
return types[4];
|
|
823
|
+
case "VOICEMAIL":
|
|
824
|
+
return types[5];
|
|
825
|
+
case "UAN":
|
|
826
|
+
return types[6];
|
|
827
|
+
case "PAGER":
|
|
828
|
+
return types[7];
|
|
829
|
+
case "VOIP":
|
|
830
|
+
return types[8];
|
|
831
|
+
case "SHARED_COST":
|
|
832
|
+
return types[9];
|
|
833
|
+
}
|
|
834
|
+
}
|
|
835
|
+
function validateMetadata(metadata) {
|
|
836
|
+
if (!metadata) {
|
|
837
|
+
throw new Error("[libphonenumber-js] `metadata` argument not passed. Check your arguments.");
|
|
838
|
+
}
|
|
839
|
+
if (!isObject(metadata) || !isObject(metadata.countries)) {
|
|
840
|
+
throw new Error("[libphonenumber-js] `metadata` argument was passed but it's not a valid metadata. Must be an object having `.countries` child object property. Got ".concat(isObject(metadata) ? "an object of shape: { " + Object.keys(metadata).join(", ") + " }" : "a " + typeOf(metadata) + ": " + metadata, "."));
|
|
841
|
+
}
|
|
842
|
+
}
|
|
843
|
+
var typeOf = function typeOf2(_) {
|
|
844
|
+
return _typeof(_);
|
|
845
|
+
};
|
|
846
|
+
function getCountryCallingCode(country, metadataJson) {
|
|
847
|
+
var metadata = new Metadata(metadataJson);
|
|
848
|
+
if (metadata.hasCountry(country)) {
|
|
849
|
+
return metadata.selectNumberingPlan(country).countryCallingCode();
|
|
850
|
+
}
|
|
851
|
+
throw new Error("Unknown country: ".concat(country));
|
|
852
|
+
}
|
|
853
|
+
function setVersion(metadata) {
|
|
854
|
+
var version = metadata.version;
|
|
855
|
+
if (typeof version === "number") {
|
|
856
|
+
this.v1 = version === 1;
|
|
857
|
+
this.v2 = version === 2;
|
|
858
|
+
this.v3 = version === 3;
|
|
859
|
+
this.v4 = version === 4;
|
|
860
|
+
} else {
|
|
861
|
+
if (!version) {
|
|
862
|
+
this.v1 = true;
|
|
863
|
+
} else if (semver_compare_default(version, V3) === -1) {
|
|
864
|
+
this.v2 = true;
|
|
865
|
+
} else if (semver_compare_default(version, V4) === -1) {
|
|
866
|
+
this.v3 = true;
|
|
867
|
+
} else {
|
|
868
|
+
this.v4 = true;
|
|
869
|
+
}
|
|
870
|
+
}
|
|
871
|
+
}
|
|
872
|
+
|
|
873
|
+
// node_modules/.pnpm/libphonenumber-js@1.13.7/node_modules/libphonenumber-js/es6/helpers/mergeArrays.js
|
|
874
|
+
function _createForOfIteratorHelperLoose(r2, e2) {
|
|
875
|
+
var t2 = "undefined" != typeof Symbol && r2[Symbol.iterator] || r2["@@iterator"];
|
|
876
|
+
if (t2) return (t2 = t2.call(r2)).next.bind(t2);
|
|
877
|
+
if (Array.isArray(r2) || (t2 = _unsupportedIterableToArray(r2)) || e2 && r2 && "number" == typeof r2.length) {
|
|
878
|
+
t2 && (r2 = t2);
|
|
879
|
+
var o2 = 0;
|
|
880
|
+
return function() {
|
|
881
|
+
return o2 >= r2.length ? { done: true } : { done: false, value: r2[o2++] };
|
|
882
|
+
};
|
|
883
|
+
}
|
|
884
|
+
throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
885
|
+
}
|
|
886
|
+
function _unsupportedIterableToArray(r2, a2) {
|
|
887
|
+
if (r2) {
|
|
888
|
+
if ("string" == typeof r2) return _arrayLikeToArray(r2, a2);
|
|
889
|
+
var t2 = {}.toString.call(r2).slice(8, -1);
|
|
890
|
+
return "Object" === t2 && r2.constructor && (t2 = r2.constructor.name), "Map" === t2 || "Set" === t2 ? Array.from(r2) : "Arguments" === t2 || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t2) ? _arrayLikeToArray(r2, a2) : void 0;
|
|
891
|
+
}
|
|
892
|
+
}
|
|
893
|
+
function _arrayLikeToArray(r2, a2) {
|
|
894
|
+
(null == a2 || a2 > r2.length) && (a2 = r2.length);
|
|
895
|
+
for (var e2 = 0, n2 = Array(a2); e2 < a2; e2++) n2[e2] = r2[e2];
|
|
896
|
+
return n2;
|
|
897
|
+
}
|
|
898
|
+
function mergeArrays(a2, b2) {
|
|
899
|
+
var merged = a2.slice();
|
|
900
|
+
for (var _iterator = _createForOfIteratorHelperLoose(b2), _step; !(_step = _iterator()).done; ) {
|
|
901
|
+
var element = _step.value;
|
|
902
|
+
if (a2.indexOf(element) < 0) {
|
|
903
|
+
merged.push(element);
|
|
904
|
+
}
|
|
905
|
+
}
|
|
906
|
+
return merged.sort(function(a3, b3) {
|
|
907
|
+
return a3 - b3;
|
|
908
|
+
});
|
|
909
|
+
}
|
|
910
|
+
|
|
911
|
+
// node_modules/.pnpm/libphonenumber-js@1.13.7/node_modules/libphonenumber-js/es6/helpers/checkNumberLength.js
|
|
912
|
+
function checkNumberLength(nationalNumber, country, metadata) {
|
|
913
|
+
return checkNumberLengthForType(nationalNumber, void 0, country, metadata);
|
|
914
|
+
}
|
|
915
|
+
function checkNumberLengthForType(nationalNumber, type, country, metadata) {
|
|
916
|
+
if (country) {
|
|
917
|
+
metadata = new Metadata(metadata.metadata);
|
|
918
|
+
metadata.selectNumberingPlan(country);
|
|
919
|
+
}
|
|
920
|
+
var type_info = metadata.type(type);
|
|
921
|
+
var possible_lengths = type_info && type_info.possibleLengths() || metadata.possibleLengths();
|
|
922
|
+
if (!possible_lengths) {
|
|
923
|
+
return "IS_POSSIBLE";
|
|
924
|
+
}
|
|
925
|
+
if (type === "FIXED_LINE_OR_MOBILE") {
|
|
926
|
+
if (!metadata.type("FIXED_LINE")) {
|
|
927
|
+
return checkNumberLengthForType(nationalNumber, "MOBILE", country, metadata);
|
|
928
|
+
}
|
|
929
|
+
var mobile_type = metadata.type("MOBILE");
|
|
930
|
+
if (mobile_type) {
|
|
931
|
+
possible_lengths = mergeArrays(possible_lengths, mobile_type.possibleLengths());
|
|
932
|
+
}
|
|
933
|
+
} else if (type && !type_info) {
|
|
934
|
+
return "INVALID_LENGTH";
|
|
935
|
+
}
|
|
936
|
+
var actual_length = nationalNumber.length;
|
|
937
|
+
var minimum_length = possible_lengths[0];
|
|
938
|
+
if (minimum_length === actual_length) {
|
|
939
|
+
return "IS_POSSIBLE";
|
|
940
|
+
}
|
|
941
|
+
if (minimum_length > actual_length) {
|
|
942
|
+
return "TOO_SHORT";
|
|
943
|
+
}
|
|
944
|
+
if (possible_lengths[possible_lengths.length - 1] < actual_length) {
|
|
945
|
+
return "TOO_LONG";
|
|
946
|
+
}
|
|
947
|
+
return possible_lengths.indexOf(actual_length, 1) >= 0 ? "IS_POSSIBLE" : "INVALID_LENGTH";
|
|
948
|
+
}
|
|
949
|
+
|
|
950
|
+
// node_modules/.pnpm/libphonenumber-js@1.13.7/node_modules/libphonenumber-js/es6/isPossible.js
|
|
951
|
+
function isPossiblePhoneNumber(input, options, metadataJson) {
|
|
952
|
+
if (options === void 0) {
|
|
953
|
+
options = {};
|
|
954
|
+
}
|
|
955
|
+
var metadata = new Metadata(metadataJson);
|
|
956
|
+
if (options.v2) {
|
|
957
|
+
if (!input.countryCallingCode) {
|
|
958
|
+
throw new Error("Invalid phone number object passed");
|
|
959
|
+
}
|
|
960
|
+
metadata.selectNumberingPlan(input.country || input.countryCallingCode);
|
|
961
|
+
} else {
|
|
962
|
+
if (!input.phone) {
|
|
963
|
+
return false;
|
|
964
|
+
}
|
|
965
|
+
if (input.country) {
|
|
966
|
+
if (!metadata.hasCountry(input.country)) {
|
|
967
|
+
throw new Error("Unknown country: ".concat(input.country));
|
|
968
|
+
}
|
|
969
|
+
metadata.selectNumberingPlan(input.country);
|
|
970
|
+
} else {
|
|
971
|
+
if (!input.countryCallingCode) {
|
|
972
|
+
throw new Error("Invalid phone number object passed");
|
|
973
|
+
}
|
|
974
|
+
metadata.selectNumberingPlan(input.countryCallingCode);
|
|
975
|
+
}
|
|
976
|
+
}
|
|
977
|
+
if (metadata.possibleLengths()) {
|
|
978
|
+
return isPossibleNumber(input.phone || input.nationalNumber, metadata);
|
|
979
|
+
}
|
|
980
|
+
if (input.countryCallingCode && metadata.isNonGeographicCallingCode(input.countryCallingCode)) {
|
|
981
|
+
return true;
|
|
982
|
+
}
|
|
983
|
+
throw new Error('Missing "possibleLengths" in metadata. Perhaps the metadata has been generated before v1.0.18.');
|
|
984
|
+
}
|
|
985
|
+
function isPossibleNumber(nationalNumber, metadata) {
|
|
986
|
+
switch (checkNumberLength(nationalNumber, void 0, metadata)) {
|
|
987
|
+
case "IS_POSSIBLE":
|
|
988
|
+
return true;
|
|
989
|
+
// This library ignores "local-only" phone numbers (for simplicity).
|
|
990
|
+
// See the readme for more info on what are "local-only" phone numbers.
|
|
991
|
+
// case 'IS_POSSIBLE_LOCAL_ONLY':
|
|
992
|
+
// return !isInternational
|
|
993
|
+
default:
|
|
994
|
+
return false;
|
|
995
|
+
}
|
|
996
|
+
}
|
|
997
|
+
|
|
998
|
+
// node_modules/.pnpm/libphonenumber-js@1.13.7/node_modules/libphonenumber-js/es6/helpers/matchesEntirely.js
|
|
999
|
+
function matchesEntirely(text, regularExpressionText) {
|
|
1000
|
+
text = text || "";
|
|
1001
|
+
return new RegExp("^(?:" + regularExpressionText + ")$").test(text);
|
|
1002
|
+
}
|
|
1003
|
+
|
|
1004
|
+
// node_modules/.pnpm/libphonenumber-js@1.13.7/node_modules/libphonenumber-js/es6/helpers/getNumberType.js
|
|
1005
|
+
function _createForOfIteratorHelperLoose2(r2, e2) {
|
|
1006
|
+
var t2 = "undefined" != typeof Symbol && r2[Symbol.iterator] || r2["@@iterator"];
|
|
1007
|
+
if (t2) return (t2 = t2.call(r2)).next.bind(t2);
|
|
1008
|
+
if (Array.isArray(r2) || (t2 = _unsupportedIterableToArray2(r2)) || e2 && r2 && "number" == typeof r2.length) {
|
|
1009
|
+
t2 && (r2 = t2);
|
|
1010
|
+
var o2 = 0;
|
|
1011
|
+
return function() {
|
|
1012
|
+
return o2 >= r2.length ? { done: true } : { done: false, value: r2[o2++] };
|
|
1013
|
+
};
|
|
1014
|
+
}
|
|
1015
|
+
throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
1016
|
+
}
|
|
1017
|
+
function _unsupportedIterableToArray2(r2, a2) {
|
|
1018
|
+
if (r2) {
|
|
1019
|
+
if ("string" == typeof r2) return _arrayLikeToArray2(r2, a2);
|
|
1020
|
+
var t2 = {}.toString.call(r2).slice(8, -1);
|
|
1021
|
+
return "Object" === t2 && r2.constructor && (t2 = r2.constructor.name), "Map" === t2 || "Set" === t2 ? Array.from(r2) : "Arguments" === t2 || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t2) ? _arrayLikeToArray2(r2, a2) : void 0;
|
|
1022
|
+
}
|
|
1023
|
+
}
|
|
1024
|
+
function _arrayLikeToArray2(r2, a2) {
|
|
1025
|
+
(null == a2 || a2 > r2.length) && (a2 = r2.length);
|
|
1026
|
+
for (var e2 = 0, n2 = Array(a2); e2 < a2; e2++) n2[e2] = r2[e2];
|
|
1027
|
+
return n2;
|
|
1028
|
+
}
|
|
1029
|
+
var NON_FIXED_LINE_PHONE_TYPES = ["MOBILE", "PREMIUM_RATE", "TOLL_FREE", "SHARED_COST", "VOIP", "PERSONAL_NUMBER", "PAGER", "UAN", "VOICEMAIL"];
|
|
1030
|
+
function getNumberType(input, options, metadataJson) {
|
|
1031
|
+
options = options || {};
|
|
1032
|
+
if (!input.country && !input.countryCallingCode) {
|
|
1033
|
+
return;
|
|
1034
|
+
}
|
|
1035
|
+
var metadata = new Metadata(metadataJson);
|
|
1036
|
+
metadata.selectNumberingPlan(input.country || input.countryCallingCode);
|
|
1037
|
+
var nationalNumber = options.v2 ? input.nationalNumber : input.phone;
|
|
1038
|
+
if (!matchesEntirely(nationalNumber, metadata.nationalNumberPattern())) {
|
|
1039
|
+
return;
|
|
1040
|
+
}
|
|
1041
|
+
if (isNumberTypeEqualTo(nationalNumber, "FIXED_LINE", metadata)) {
|
|
1042
|
+
if (metadata.type("MOBILE") && metadata.type("MOBILE").pattern() === "") {
|
|
1043
|
+
return "FIXED_LINE_OR_MOBILE";
|
|
1044
|
+
}
|
|
1045
|
+
if (!metadata.type("MOBILE")) {
|
|
1046
|
+
return "FIXED_LINE_OR_MOBILE";
|
|
1047
|
+
}
|
|
1048
|
+
if (isNumberTypeEqualTo(nationalNumber, "MOBILE", metadata)) {
|
|
1049
|
+
return "FIXED_LINE_OR_MOBILE";
|
|
1050
|
+
}
|
|
1051
|
+
return "FIXED_LINE";
|
|
1052
|
+
}
|
|
1053
|
+
for (var _iterator = _createForOfIteratorHelperLoose2(NON_FIXED_LINE_PHONE_TYPES), _step; !(_step = _iterator()).done; ) {
|
|
1054
|
+
var type = _step.value;
|
|
1055
|
+
if (isNumberTypeEqualTo(nationalNumber, type, metadata)) {
|
|
1056
|
+
return type;
|
|
1057
|
+
}
|
|
1058
|
+
}
|
|
1059
|
+
}
|
|
1060
|
+
function isNumberTypeEqualTo(nationalNumber, type, metadata) {
|
|
1061
|
+
var typeDefinition = metadata.type(type);
|
|
1062
|
+
if (!typeDefinition || !typeDefinition.pattern()) {
|
|
1063
|
+
return false;
|
|
1064
|
+
}
|
|
1065
|
+
if (typeDefinition.possibleLengths() && typeDefinition.possibleLengths().indexOf(nationalNumber.length) < 0) {
|
|
1066
|
+
return false;
|
|
1067
|
+
}
|
|
1068
|
+
return matchesEntirely(nationalNumber, typeDefinition.pattern());
|
|
1069
|
+
}
|
|
1070
|
+
|
|
1071
|
+
// node_modules/.pnpm/libphonenumber-js@1.13.7/node_modules/libphonenumber-js/es6/isValid.js
|
|
1072
|
+
function isValidNumber(input, options, metadataJson) {
|
|
1073
|
+
options = options || {};
|
|
1074
|
+
var metadata = new Metadata(metadataJson);
|
|
1075
|
+
metadata.selectNumberingPlan(input.country || input.countryCallingCode);
|
|
1076
|
+
if (metadata.hasTypes()) {
|
|
1077
|
+
return getNumberType(input, options, metadata.metadata) !== void 0;
|
|
1078
|
+
}
|
|
1079
|
+
var nationalNumber = options.v2 ? input.nationalNumber : input.phone;
|
|
1080
|
+
return matchesEntirely(nationalNumber, metadata.nationalNumberPattern());
|
|
1081
|
+
}
|
|
1082
|
+
|
|
1083
|
+
// node_modules/.pnpm/libphonenumber-js@1.13.7/node_modules/libphonenumber-js/es6/helpers/isCountryCode.js
|
|
1084
|
+
var COUNTRY_CODE_REG_EXP = /^[A-Z]{2}$/;
|
|
1085
|
+
function isCountryCode(string) {
|
|
1086
|
+
return COUNTRY_CODE_REG_EXP.test(string);
|
|
1087
|
+
}
|
|
1088
|
+
|
|
1089
|
+
// node_modules/.pnpm/libphonenumber-js@1.13.7/node_modules/libphonenumber-js/es6/helpers/getCountryAndCallingCodeFromOneOfThem.js
|
|
1090
|
+
var USE_NON_GEOGRAPHIC_COUNTRY_CODE = false;
|
|
1091
|
+
function getCountryAndCallingCodeFromOneOfThem(countryOrCallingCode, metadataJson) {
|
|
1092
|
+
var country;
|
|
1093
|
+
var callingCode;
|
|
1094
|
+
var metadata = new Metadata(metadataJson);
|
|
1095
|
+
if (isCountryCode(countryOrCallingCode)) {
|
|
1096
|
+
country = countryOrCallingCode;
|
|
1097
|
+
metadata.selectNumberingPlan(country);
|
|
1098
|
+
callingCode = metadata.countryCallingCode();
|
|
1099
|
+
} else {
|
|
1100
|
+
callingCode = countryOrCallingCode;
|
|
1101
|
+
if (USE_NON_GEOGRAPHIC_COUNTRY_CODE) {
|
|
1102
|
+
if (metadata.isNonGeographicCallingCode(callingCode)) {
|
|
1103
|
+
country = "001";
|
|
1104
|
+
}
|
|
1105
|
+
}
|
|
1106
|
+
}
|
|
1107
|
+
return {
|
|
1108
|
+
country,
|
|
1109
|
+
callingCode
|
|
1110
|
+
};
|
|
1111
|
+
}
|
|
1112
|
+
|
|
1113
|
+
// node_modules/.pnpm/libphonenumber-js@1.13.7/node_modules/libphonenumber-js/es6/helpers/getPossibleCountriesForNumber.js
|
|
1114
|
+
function getPossibleCountriesForNumber(callingCode, nationalNumber, metadata) {
|
|
1115
|
+
var _metadata = new Metadata(metadata);
|
|
1116
|
+
var possibleCountries = _metadata.getCountryCodesForCallingCode(callingCode);
|
|
1117
|
+
if (!possibleCountries) {
|
|
1118
|
+
return [];
|
|
1119
|
+
}
|
|
1120
|
+
return possibleCountries.filter(function(country) {
|
|
1121
|
+
return couldNationalNumberBelongToCountry(nationalNumber, country, metadata);
|
|
1122
|
+
});
|
|
1123
|
+
}
|
|
1124
|
+
function couldNationalNumberBelongToCountry(nationalNumber, country, metadataJson) {
|
|
1125
|
+
var metadata = new Metadata(metadataJson);
|
|
1126
|
+
metadata.selectNumberingPlan(country);
|
|
1127
|
+
return metadata.numberingPlan.possibleLengths().indexOf(nationalNumber.length) >= 0;
|
|
1128
|
+
}
|
|
1129
|
+
|
|
1130
|
+
// node_modules/.pnpm/libphonenumber-js@1.13.7/node_modules/libphonenumber-js/es6/constants.js
|
|
1131
|
+
var MAX_LENGTH_COUNTRY_CODE = 3;
|
|
1132
|
+
var VALID_DIGITS = "0-9\uFF10-\uFF19\u0660-\u0669\u06F0-\u06F9";
|
|
1133
|
+
var DASHES = "-\u2010-\u2015\u2212\u30FC\uFF0D";
|
|
1134
|
+
var SLASHES = "\uFF0F/";
|
|
1135
|
+
var DOTS = "\uFF0E.";
|
|
1136
|
+
var WHITESPACE = " \xA0\xAD\u200B\u2060\u3000";
|
|
1137
|
+
var BRACKETS = "()\uFF08\uFF09\uFF3B\uFF3D\\[\\]";
|
|
1138
|
+
var TILDES = "~\u2053\u223C\uFF5E";
|
|
1139
|
+
var VALID_PUNCTUATION = "".concat(DASHES).concat(SLASHES).concat(DOTS).concat(WHITESPACE).concat(BRACKETS).concat(TILDES);
|
|
1140
|
+
var PLUS_CHARS = "+\uFF0B";
|
|
1141
|
+
|
|
1142
|
+
// node_modules/.pnpm/libphonenumber-js@1.13.7/node_modules/libphonenumber-js/es6/helpers/stripIddPrefix.js
|
|
1143
|
+
var CAPTURING_DIGIT_PATTERN = new RegExp("([" + VALID_DIGITS + "])");
|
|
1144
|
+
function stripIddPrefix(number, country, callingCode, metadataJson) {
|
|
1145
|
+
if (!country) {
|
|
1146
|
+
return;
|
|
1147
|
+
}
|
|
1148
|
+
var metadata = new Metadata(metadataJson);
|
|
1149
|
+
metadata.selectNumberingPlan(country || callingCode);
|
|
1150
|
+
var IDDPrefixPattern = new RegExp(metadata.IDDPrefix());
|
|
1151
|
+
if (number.search(IDDPrefixPattern) !== 0) {
|
|
1152
|
+
return;
|
|
1153
|
+
}
|
|
1154
|
+
number = number.slice(number.match(IDDPrefixPattern)[0].length);
|
|
1155
|
+
var matchedGroups = number.match(CAPTURING_DIGIT_PATTERN);
|
|
1156
|
+
if (matchedGroups && matchedGroups[1] != null && matchedGroups[1].length > 0) {
|
|
1157
|
+
if (matchedGroups[1] === "0") {
|
|
1158
|
+
return;
|
|
1159
|
+
}
|
|
1160
|
+
}
|
|
1161
|
+
return number;
|
|
1162
|
+
}
|
|
1163
|
+
|
|
1164
|
+
// node_modules/.pnpm/libphonenumber-js@1.13.7/node_modules/libphonenumber-js/es6/helpers/extractNationalNumberFromPossiblyIncompleteNumber.js
|
|
1165
|
+
function extractNationalNumberFromPossiblyIncompleteNumber(number, metadata) {
|
|
1166
|
+
if (number && metadata.numberingPlan.nationalPrefixForParsing()) {
|
|
1167
|
+
var prefixPattern = new RegExp("^(?:" + metadata.numberingPlan.nationalPrefixForParsing() + ")");
|
|
1168
|
+
var prefixMatch = prefixPattern.exec(number);
|
|
1169
|
+
if (prefixMatch) {
|
|
1170
|
+
var nationalNumber;
|
|
1171
|
+
var carrierCode;
|
|
1172
|
+
var capturedGroupsCount = prefixMatch.length - 1;
|
|
1173
|
+
var hasCapturedGroups = capturedGroupsCount > 0 && prefixMatch[capturedGroupsCount];
|
|
1174
|
+
if (metadata.nationalPrefixTransformRule() && hasCapturedGroups) {
|
|
1175
|
+
nationalNumber = number.replace(prefixPattern, metadata.nationalPrefixTransformRule());
|
|
1176
|
+
if (capturedGroupsCount > 1) {
|
|
1177
|
+
carrierCode = prefixMatch[1];
|
|
1178
|
+
}
|
|
1179
|
+
} else {
|
|
1180
|
+
var prefixBeforeNationalNumber = prefixMatch[0];
|
|
1181
|
+
nationalNumber = number.slice(prefixBeforeNationalNumber.length);
|
|
1182
|
+
if (hasCapturedGroups) {
|
|
1183
|
+
carrierCode = prefixMatch[1];
|
|
1184
|
+
}
|
|
1185
|
+
}
|
|
1186
|
+
var nationalPrefix;
|
|
1187
|
+
if (hasCapturedGroups) {
|
|
1188
|
+
var possiblePositionOfTheFirstCapturedGroup = number.indexOf(prefixMatch[1]);
|
|
1189
|
+
var possibleNationalPrefix = number.slice(0, possiblePositionOfTheFirstCapturedGroup);
|
|
1190
|
+
if (possibleNationalPrefix === metadata.numberingPlan.nationalPrefix()) {
|
|
1191
|
+
nationalPrefix = metadata.numberingPlan.nationalPrefix();
|
|
1192
|
+
}
|
|
1193
|
+
} else {
|
|
1194
|
+
nationalPrefix = prefixMatch[0];
|
|
1195
|
+
}
|
|
1196
|
+
return {
|
|
1197
|
+
nationalNumber,
|
|
1198
|
+
nationalPrefix,
|
|
1199
|
+
carrierCode
|
|
1200
|
+
};
|
|
1201
|
+
}
|
|
1202
|
+
}
|
|
1203
|
+
return {
|
|
1204
|
+
nationalNumber: number
|
|
1205
|
+
};
|
|
1206
|
+
}
|
|
1207
|
+
|
|
1208
|
+
// node_modules/.pnpm/libphonenumber-js@1.13.7/node_modules/libphonenumber-js/es6/helpers/getCountryByNationalNumber.js
|
|
1209
|
+
function _createForOfIteratorHelperLoose3(r2, e2) {
|
|
1210
|
+
var t2 = "undefined" != typeof Symbol && r2[Symbol.iterator] || r2["@@iterator"];
|
|
1211
|
+
if (t2) return (t2 = t2.call(r2)).next.bind(t2);
|
|
1212
|
+
if (Array.isArray(r2) || (t2 = _unsupportedIterableToArray3(r2)) || e2 && r2 && "number" == typeof r2.length) {
|
|
1213
|
+
t2 && (r2 = t2);
|
|
1214
|
+
var o2 = 0;
|
|
1215
|
+
return function() {
|
|
1216
|
+
return o2 >= r2.length ? { done: true } : { done: false, value: r2[o2++] };
|
|
1217
|
+
};
|
|
1218
|
+
}
|
|
1219
|
+
throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
1220
|
+
}
|
|
1221
|
+
function _unsupportedIterableToArray3(r2, a2) {
|
|
1222
|
+
if (r2) {
|
|
1223
|
+
if ("string" == typeof r2) return _arrayLikeToArray3(r2, a2);
|
|
1224
|
+
var t2 = {}.toString.call(r2).slice(8, -1);
|
|
1225
|
+
return "Object" === t2 && r2.constructor && (t2 = r2.constructor.name), "Map" === t2 || "Set" === t2 ? Array.from(r2) : "Arguments" === t2 || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t2) ? _arrayLikeToArray3(r2, a2) : void 0;
|
|
1226
|
+
}
|
|
1227
|
+
}
|
|
1228
|
+
function _arrayLikeToArray3(r2, a2) {
|
|
1229
|
+
(null == a2 || a2 > r2.length) && (a2 = r2.length);
|
|
1230
|
+
for (var e2 = 0, n2 = Array(a2); e2 < a2; e2++) n2[e2] = r2[e2];
|
|
1231
|
+
return n2;
|
|
1232
|
+
}
|
|
1233
|
+
function getCountryByNationalNumber(nationalNumber, countries, metadataJson) {
|
|
1234
|
+
var metadata = new Metadata(metadataJson);
|
|
1235
|
+
for (var _iterator = _createForOfIteratorHelperLoose3(countries), _step; !(_step = _iterator()).done; ) {
|
|
1236
|
+
var country = _step.value;
|
|
1237
|
+
metadata.selectNumberingPlan(country);
|
|
1238
|
+
if (metadata.leadingDigits()) {
|
|
1239
|
+
if (nationalNumber && nationalNumber.search(metadata.leadingDigits()) === 0) {
|
|
1240
|
+
return country;
|
|
1241
|
+
}
|
|
1242
|
+
} else if (getNumberType({
|
|
1243
|
+
phone: nationalNumber,
|
|
1244
|
+
country
|
|
1245
|
+
}, void 0, metadata.metadata)) {
|
|
1246
|
+
return country;
|
|
1247
|
+
}
|
|
1248
|
+
}
|
|
1249
|
+
}
|
|
1250
|
+
|
|
1251
|
+
// node_modules/.pnpm/libphonenumber-js@1.13.7/node_modules/libphonenumber-js/es6/helpers/getCountryByCallingCode.js
|
|
1252
|
+
var USE_NON_GEOGRAPHIC_COUNTRY_CODE2 = false;
|
|
1253
|
+
function getCountryByCallingCode(callingCode, _ref) {
|
|
1254
|
+
var nationalNumber = _ref.nationalNumber, metadata = _ref.metadata;
|
|
1255
|
+
if (USE_NON_GEOGRAPHIC_COUNTRY_CODE2) {
|
|
1256
|
+
if (metadata.isNonGeographicCallingCode(callingCode)) {
|
|
1257
|
+
return "001";
|
|
1258
|
+
}
|
|
1259
|
+
}
|
|
1260
|
+
var possibleCountries = metadata.getCountryCodesForCallingCode(callingCode);
|
|
1261
|
+
if (!possibleCountries) {
|
|
1262
|
+
return;
|
|
1263
|
+
}
|
|
1264
|
+
if (possibleCountries.length === 1) {
|
|
1265
|
+
return possibleCountries[0];
|
|
1266
|
+
}
|
|
1267
|
+
return getCountryByNationalNumber(nationalNumber, possibleCountries, metadata.metadata);
|
|
1268
|
+
}
|
|
1269
|
+
|
|
1270
|
+
// node_modules/.pnpm/libphonenumber-js@1.13.7/node_modules/libphonenumber-js/es6/helpers/extractNationalNumber.js
|
|
1271
|
+
function extractNationalNumber(number, country, metadata) {
|
|
1272
|
+
var _extractNationalNumbe = extractNationalNumberFromPossiblyIncompleteNumber(number, metadata), carrierCode = _extractNationalNumbe.carrierCode, nationalNumber = _extractNationalNumbe.nationalNumber;
|
|
1273
|
+
if (nationalNumber !== number) {
|
|
1274
|
+
if (!shouldHaveExtractedNationalPrefix(number, nationalNumber, metadata)) {
|
|
1275
|
+
return {
|
|
1276
|
+
nationalNumber: number
|
|
1277
|
+
};
|
|
1278
|
+
}
|
|
1279
|
+
if (metadata.numberingPlan.possibleLengths()) {
|
|
1280
|
+
if (!country) {
|
|
1281
|
+
country = getCountryByCallingCode(metadata.numberingPlan.callingCode(), {
|
|
1282
|
+
nationalNumber,
|
|
1283
|
+
metadata
|
|
1284
|
+
});
|
|
1285
|
+
}
|
|
1286
|
+
if (!isPossibleIncompleteNationalNumber(nationalNumber, country, metadata)) {
|
|
1287
|
+
return {
|
|
1288
|
+
nationalNumber: number
|
|
1289
|
+
};
|
|
1290
|
+
}
|
|
1291
|
+
}
|
|
1292
|
+
}
|
|
1293
|
+
return {
|
|
1294
|
+
nationalNumber,
|
|
1295
|
+
carrierCode
|
|
1296
|
+
};
|
|
1297
|
+
}
|
|
1298
|
+
function shouldHaveExtractedNationalPrefix(nationalNumberBefore, nationalNumberAfter, metadata) {
|
|
1299
|
+
if (matchesEntirely(nationalNumberBefore, metadata.nationalNumberPattern()) && !matchesEntirely(nationalNumberAfter, metadata.nationalNumberPattern())) {
|
|
1300
|
+
return false;
|
|
1301
|
+
}
|
|
1302
|
+
return true;
|
|
1303
|
+
}
|
|
1304
|
+
function isPossibleIncompleteNationalNumber(nationalNumber, country, metadata) {
|
|
1305
|
+
switch (checkNumberLength(nationalNumber, country, metadata)) {
|
|
1306
|
+
case "TOO_SHORT":
|
|
1307
|
+
case "INVALID_LENGTH":
|
|
1308
|
+
return false;
|
|
1309
|
+
default:
|
|
1310
|
+
return true;
|
|
1311
|
+
}
|
|
1312
|
+
}
|
|
1313
|
+
|
|
1314
|
+
// node_modules/.pnpm/libphonenumber-js@1.13.7/node_modules/libphonenumber-js/es6/helpers/extractCountryCallingCodeFromInternationalNumberWithoutPlusSign.js
|
|
1315
|
+
function extractCountryCallingCodeFromInternationalNumberWithoutPlusSign(number, country, defaultCountry, defaultCallingCode, metadataJson) {
|
|
1316
|
+
if (!(country || defaultCountry || defaultCallingCode)) {
|
|
1317
|
+
return {
|
|
1318
|
+
number
|
|
1319
|
+
};
|
|
1320
|
+
}
|
|
1321
|
+
var countryCallingCode = country || defaultCountry ? getCountryCallingCode(country || defaultCountry, metadataJson) : defaultCallingCode;
|
|
1322
|
+
if (number.indexOf(countryCallingCode) === 0) {
|
|
1323
|
+
var metadata = new Metadata(metadataJson);
|
|
1324
|
+
metadata.selectNumberingPlan(country || defaultCountry || defaultCallingCode);
|
|
1325
|
+
var possibleShorterNumber = number.slice(countryCallingCode.length);
|
|
1326
|
+
var _extractNationalNumbe = extractNationalNumber(possibleShorterNumber, void 0, metadata), possibleShorterNationalNumber = _extractNationalNumbe.nationalNumber;
|
|
1327
|
+
var _extractNationalNumbe2 = extractNationalNumber(number, void 0, metadata), nationalNumber = _extractNationalNumbe2.nationalNumber;
|
|
1328
|
+
if (!matchesEntirely(nationalNumber, metadata.nationalNumberPattern()) && matchesEntirely(possibleShorterNationalNumber, metadata.nationalNumberPattern()) || checkNumberLength(nationalNumber, void 0, metadata) === "TOO_LONG") {
|
|
1329
|
+
return {
|
|
1330
|
+
countryCallingCode,
|
|
1331
|
+
number: possibleShorterNumber
|
|
1332
|
+
};
|
|
1333
|
+
}
|
|
1334
|
+
}
|
|
1335
|
+
return {
|
|
1336
|
+
number
|
|
1337
|
+
};
|
|
1338
|
+
}
|
|
1339
|
+
|
|
1340
|
+
// node_modules/.pnpm/libphonenumber-js@1.13.7/node_modules/libphonenumber-js/es6/helpers/extractCountryCallingCode.js
|
|
1341
|
+
function extractCountryCallingCode(number, country, defaultCountry, defaultCallingCode, metadataJson) {
|
|
1342
|
+
if (!number) {
|
|
1343
|
+
return {};
|
|
1344
|
+
}
|
|
1345
|
+
var isNumberWithIddPrefix;
|
|
1346
|
+
if (number[0] !== "+") {
|
|
1347
|
+
var numberWithoutIDD = stripIddPrefix(number, country || defaultCountry, defaultCallingCode, metadataJson);
|
|
1348
|
+
if (numberWithoutIDD && numberWithoutIDD !== number) {
|
|
1349
|
+
isNumberWithIddPrefix = true;
|
|
1350
|
+
number = "+" + numberWithoutIDD;
|
|
1351
|
+
} else {
|
|
1352
|
+
if (country || defaultCountry || defaultCallingCode) {
|
|
1353
|
+
var _extractCountryCallin = extractCountryCallingCodeFromInternationalNumberWithoutPlusSign(number, country, defaultCountry, defaultCallingCode, metadataJson), countryCallingCode = _extractCountryCallin.countryCallingCode, shorterNumber = _extractCountryCallin.number;
|
|
1354
|
+
if (countryCallingCode) {
|
|
1355
|
+
return {
|
|
1356
|
+
countryCallingCodeSource: "FROM_NUMBER_WITHOUT_PLUS_SIGN",
|
|
1357
|
+
countryCallingCode,
|
|
1358
|
+
number: shorterNumber
|
|
1359
|
+
};
|
|
1360
|
+
}
|
|
1361
|
+
}
|
|
1362
|
+
return {
|
|
1363
|
+
// No need to set it to `UNSPECIFIED`. It can be just `undefined`.
|
|
1364
|
+
// countryCallingCodeSource: 'UNSPECIFIED',
|
|
1365
|
+
number
|
|
1366
|
+
};
|
|
1367
|
+
}
|
|
1368
|
+
}
|
|
1369
|
+
if (number[1] === "0") {
|
|
1370
|
+
return {};
|
|
1371
|
+
}
|
|
1372
|
+
var metadata = new Metadata(metadataJson);
|
|
1373
|
+
var i2 = 2;
|
|
1374
|
+
while (i2 - 1 <= MAX_LENGTH_COUNTRY_CODE && i2 <= number.length) {
|
|
1375
|
+
var _countryCallingCode = number.slice(1, i2);
|
|
1376
|
+
if (metadata.hasCallingCode(_countryCallingCode)) {
|
|
1377
|
+
metadata.selectNumberingPlan(_countryCallingCode);
|
|
1378
|
+
return {
|
|
1379
|
+
countryCallingCodeSource: isNumberWithIddPrefix ? "FROM_NUMBER_WITH_IDD" : "FROM_NUMBER_WITH_PLUS_SIGN",
|
|
1380
|
+
countryCallingCode: _countryCallingCode,
|
|
1381
|
+
number: number.slice(i2)
|
|
1382
|
+
};
|
|
1383
|
+
}
|
|
1384
|
+
i2++;
|
|
1385
|
+
}
|
|
1386
|
+
return {};
|
|
1387
|
+
}
|
|
1388
|
+
|
|
1389
|
+
// node_modules/.pnpm/libphonenumber-js@1.13.7/node_modules/libphonenumber-js/es6/helpers/applyInternationalSeparatorStyle.js
|
|
1390
|
+
function applyInternationalSeparatorStyle(formattedNumber) {
|
|
1391
|
+
return formattedNumber.replace(new RegExp("[".concat(VALID_PUNCTUATION, "]+"), "g"), " ").trim();
|
|
1392
|
+
}
|
|
1393
|
+
|
|
1394
|
+
// node_modules/.pnpm/libphonenumber-js@1.13.7/node_modules/libphonenumber-js/es6/helpers/formatNationalNumberUsingFormat.js
|
|
1395
|
+
var FIRST_GROUP_PATTERN = /(\$\d)/;
|
|
1396
|
+
function formatNationalNumberUsingFormat(number, format2, _ref) {
|
|
1397
|
+
var useInternationalFormat = _ref.useInternationalFormat, withNationalPrefix = _ref.withNationalPrefix, carrierCode = _ref.carrierCode, metadata = _ref.metadata;
|
|
1398
|
+
var formattedNumber = number.replace(new RegExp(format2.pattern()), useInternationalFormat ? format2.internationalFormat() : (
|
|
1399
|
+
// This library doesn't use `domestic_carrier_code_formatting_rule`,
|
|
1400
|
+
// because that one is only used when formatting phone numbers
|
|
1401
|
+
// for dialing from a mobile phone, and this is not a dialing library.
|
|
1402
|
+
// carrierCode && format.domesticCarrierCodeFormattingRule()
|
|
1403
|
+
// // First, replace the $CC in the formatting rule with the desired carrier code.
|
|
1404
|
+
// // Then, replace the $FG in the formatting rule with the first group
|
|
1405
|
+
// // and the carrier code combined in the appropriate way.
|
|
1406
|
+
// ? format.format().replace(FIRST_GROUP_PATTERN, format.domesticCarrierCodeFormattingRule().replace('$CC', carrierCode))
|
|
1407
|
+
// : (
|
|
1408
|
+
// withNationalPrefix && format.nationalPrefixFormattingRule()
|
|
1409
|
+
// ? format.format().replace(FIRST_GROUP_PATTERN, format.nationalPrefixFormattingRule())
|
|
1410
|
+
// : format.format()
|
|
1411
|
+
// )
|
|
1412
|
+
withNationalPrefix && format2.nationalPrefixFormattingRule() ? format2.format().replace(FIRST_GROUP_PATTERN, format2.nationalPrefixFormattingRule()) : format2.format()
|
|
1413
|
+
));
|
|
1414
|
+
if (useInternationalFormat) {
|
|
1415
|
+
return applyInternationalSeparatorStyle(formattedNumber);
|
|
1416
|
+
}
|
|
1417
|
+
return formattedNumber;
|
|
1418
|
+
}
|
|
1419
|
+
|
|
1420
|
+
// node_modules/.pnpm/libphonenumber-js@1.13.7/node_modules/libphonenumber-js/es6/helpers/getIddPrefix.js
|
|
1421
|
+
var SINGLE_IDD_PREFIX_REG_EXP = /^[\d]+(?:[~\u2053\u223C\uFF5E][\d]+)?$/;
|
|
1422
|
+
function getIddPrefix(country, callingCode, metadata) {
|
|
1423
|
+
var countryMetadata = new Metadata(metadata);
|
|
1424
|
+
countryMetadata.selectNumberingPlan(country || callingCode);
|
|
1425
|
+
if (countryMetadata.defaultIDDPrefix()) {
|
|
1426
|
+
return countryMetadata.defaultIDDPrefix();
|
|
1427
|
+
}
|
|
1428
|
+
if (SINGLE_IDD_PREFIX_REG_EXP.test(countryMetadata.IDDPrefix())) {
|
|
1429
|
+
return countryMetadata.IDDPrefix();
|
|
1430
|
+
}
|
|
1431
|
+
}
|
|
1432
|
+
|
|
1433
|
+
// node_modules/.pnpm/libphonenumber-js@1.13.7/node_modules/libphonenumber-js/es6/helpers/RFC3966.js
|
|
1434
|
+
function formatRFC3966(_ref) {
|
|
1435
|
+
var number = _ref.number, ext = _ref.ext;
|
|
1436
|
+
if (!number) {
|
|
1437
|
+
return "";
|
|
1438
|
+
}
|
|
1439
|
+
if (number[0] !== "+") {
|
|
1440
|
+
throw new Error('"formatRFC3966()" expects "number" to be in E.164 format.');
|
|
1441
|
+
}
|
|
1442
|
+
return "tel:".concat(number).concat(ext ? ";ext=" + ext : "");
|
|
1443
|
+
}
|
|
1444
|
+
|
|
1445
|
+
// node_modules/.pnpm/libphonenumber-js@1.13.7/node_modules/libphonenumber-js/es6/format.js
|
|
1446
|
+
var DEFAULT_OPTIONS = {
|
|
1447
|
+
formatExtension: function formatExtension(formattedNumber, extension, metadata) {
|
|
1448
|
+
return "".concat(formattedNumber).concat(metadata.ext()).concat(extension);
|
|
1449
|
+
}
|
|
1450
|
+
};
|
|
1451
|
+
function formatNumber(input, format2, options, metadataJson) {
|
|
1452
|
+
if (options) {
|
|
1453
|
+
options = merge({}, DEFAULT_OPTIONS, options);
|
|
1454
|
+
} else {
|
|
1455
|
+
options = DEFAULT_OPTIONS;
|
|
1456
|
+
}
|
|
1457
|
+
var metadata = new Metadata(metadataJson);
|
|
1458
|
+
if (input.country && input.country !== "001") {
|
|
1459
|
+
if (!metadata.hasCountry(input.country)) {
|
|
1460
|
+
throw new Error("Unknown country: ".concat(input.country));
|
|
1461
|
+
}
|
|
1462
|
+
metadata.selectNumberingPlan(input.country);
|
|
1463
|
+
} else if (input.countryCallingCode) {
|
|
1464
|
+
metadata.selectNumberingPlan(input.countryCallingCode);
|
|
1465
|
+
} else return input.phone || "";
|
|
1466
|
+
var countryCallingCode = metadata.countryCallingCode();
|
|
1467
|
+
var nationalNumber = options.v2 ? input.nationalNumber : input.phone;
|
|
1468
|
+
var number;
|
|
1469
|
+
switch (format2) {
|
|
1470
|
+
case "NATIONAL":
|
|
1471
|
+
if (!nationalNumber) {
|
|
1472
|
+
return "";
|
|
1473
|
+
}
|
|
1474
|
+
number = formatNationalNumber(nationalNumber, input.carrierCode, "NATIONAL", metadata, options);
|
|
1475
|
+
return addExtension(number, input.ext, metadata, options.formatExtension);
|
|
1476
|
+
case "INTERNATIONAL":
|
|
1477
|
+
if (!nationalNumber) {
|
|
1478
|
+
return "+".concat(countryCallingCode);
|
|
1479
|
+
}
|
|
1480
|
+
number = formatNationalNumber(nationalNumber, null, "INTERNATIONAL", metadata, options);
|
|
1481
|
+
number = "+".concat(countryCallingCode, " ").concat(number);
|
|
1482
|
+
return addExtension(number, input.ext, metadata, options.formatExtension);
|
|
1483
|
+
case "E.164":
|
|
1484
|
+
return "+".concat(countryCallingCode).concat(nationalNumber);
|
|
1485
|
+
case "RFC3966":
|
|
1486
|
+
return formatRFC3966({
|
|
1487
|
+
number: "+".concat(countryCallingCode).concat(nationalNumber),
|
|
1488
|
+
ext: input.ext
|
|
1489
|
+
});
|
|
1490
|
+
// For reference, here's Google's IDD formatter:
|
|
1491
|
+
// https://github.com/google/libphonenumber/blob/32719cf74e68796788d1ca45abc85dcdc63ba5b9/java/libphonenumber/src/com/google/i18n/phonenumbers/PhoneNumberUtil.java#L1546
|
|
1492
|
+
// Not saying that this IDD formatter replicates it 1:1, but it seems to work.
|
|
1493
|
+
// Who would even need to format phone numbers in IDD format anyway?
|
|
1494
|
+
case "IDD":
|
|
1495
|
+
if (!options.fromCountry) {
|
|
1496
|
+
return;
|
|
1497
|
+
}
|
|
1498
|
+
var formattedNumber = formatIDD(nationalNumber, input.carrierCode, countryCallingCode, options.fromCountry, metadata);
|
|
1499
|
+
if (!formattedNumber) {
|
|
1500
|
+
return;
|
|
1501
|
+
}
|
|
1502
|
+
return addExtension(formattedNumber, input.ext, metadata, options.formatExtension);
|
|
1503
|
+
default:
|
|
1504
|
+
throw new Error('Unknown "format" argument passed to "formatNumber()": "'.concat(format2, '"'));
|
|
1505
|
+
}
|
|
1506
|
+
}
|
|
1507
|
+
function formatNationalNumber(number, carrierCode, formatAs, metadata, options) {
|
|
1508
|
+
var format2 = chooseFormatForNumber(metadata.formats(), number);
|
|
1509
|
+
if (!format2) {
|
|
1510
|
+
return number;
|
|
1511
|
+
}
|
|
1512
|
+
return formatNationalNumberUsingFormat(number, format2, {
|
|
1513
|
+
useInternationalFormat: formatAs === "INTERNATIONAL",
|
|
1514
|
+
withNationalPrefix: format2.nationalPrefixIsOptionalWhenFormattingInNationalFormat() && options && options.nationalPrefix === false ? false : true,
|
|
1515
|
+
carrierCode,
|
|
1516
|
+
metadata
|
|
1517
|
+
});
|
|
1518
|
+
}
|
|
1519
|
+
function chooseFormatForNumber(availableFormats, nationalNumber) {
|
|
1520
|
+
return pickFirstMatchingElement(availableFormats, function(format2) {
|
|
1521
|
+
if (format2.leadingDigitsPatterns().length > 0) {
|
|
1522
|
+
var lastLeadingDigitsPattern = format2.leadingDigitsPatterns()[format2.leadingDigitsPatterns().length - 1];
|
|
1523
|
+
if (nationalNumber.search(lastLeadingDigitsPattern) !== 0) {
|
|
1524
|
+
return false;
|
|
1525
|
+
}
|
|
1526
|
+
}
|
|
1527
|
+
return matchesEntirely(nationalNumber, format2.pattern());
|
|
1528
|
+
});
|
|
1529
|
+
}
|
|
1530
|
+
function addExtension(formattedNumber, ext, metadata, formatExtension2) {
|
|
1531
|
+
return ext ? formatExtension2(formattedNumber, ext, metadata) : formattedNumber;
|
|
1532
|
+
}
|
|
1533
|
+
function formatIDD(nationalNumber, carrierCode, countryCallingCode, fromCountry, metadata) {
|
|
1534
|
+
var fromCountryCallingCode = getCountryCallingCode(fromCountry, metadata.metadata);
|
|
1535
|
+
if (fromCountryCallingCode === countryCallingCode) {
|
|
1536
|
+
var formattedNumber = formatNationalNumber(nationalNumber, carrierCode, "NATIONAL", metadata);
|
|
1537
|
+
if (countryCallingCode === "1") {
|
|
1538
|
+
return countryCallingCode + " " + formattedNumber;
|
|
1539
|
+
}
|
|
1540
|
+
return formattedNumber;
|
|
1541
|
+
}
|
|
1542
|
+
var iddPrefix = getIddPrefix(fromCountry, void 0, metadata.metadata);
|
|
1543
|
+
if (iddPrefix) {
|
|
1544
|
+
return "".concat(iddPrefix, " ").concat(countryCallingCode, " ").concat(formatNationalNumber(nationalNumber, null, "INTERNATIONAL", metadata));
|
|
1545
|
+
}
|
|
1546
|
+
}
|
|
1547
|
+
function merge() {
|
|
1548
|
+
var i2 = 1;
|
|
1549
|
+
for (var _len = arguments.length, objects = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
1550
|
+
objects[_key] = arguments[_key];
|
|
1551
|
+
}
|
|
1552
|
+
while (i2 < objects.length) {
|
|
1553
|
+
if (objects[i2]) {
|
|
1554
|
+
for (var key in objects[i2]) {
|
|
1555
|
+
objects[0][key] = objects[i2][key];
|
|
1556
|
+
}
|
|
1557
|
+
}
|
|
1558
|
+
i2++;
|
|
1559
|
+
}
|
|
1560
|
+
return objects[0];
|
|
1561
|
+
}
|
|
1562
|
+
function pickFirstMatchingElement(elements, testFunction) {
|
|
1563
|
+
var i2 = 0;
|
|
1564
|
+
while (i2 < elements.length) {
|
|
1565
|
+
if (testFunction(elements[i2])) {
|
|
1566
|
+
return elements[i2];
|
|
1567
|
+
}
|
|
1568
|
+
i2++;
|
|
1569
|
+
}
|
|
1570
|
+
}
|
|
1571
|
+
|
|
1572
|
+
// node_modules/.pnpm/libphonenumber-js@1.13.7/node_modules/libphonenumber-js/es6/PhoneNumber.js
|
|
1573
|
+
function _typeof2(o2) {
|
|
1574
|
+
"@babel/helpers - typeof";
|
|
1575
|
+
return _typeof2 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o3) {
|
|
1576
|
+
return typeof o3;
|
|
1577
|
+
} : function(o3) {
|
|
1578
|
+
return o3 && "function" == typeof Symbol && o3.constructor === Symbol && o3 !== Symbol.prototype ? "symbol" : typeof o3;
|
|
1579
|
+
}, _typeof2(o2);
|
|
1580
|
+
}
|
|
1581
|
+
function ownKeys(e2, r2) {
|
|
1582
|
+
var t2 = Object.keys(e2);
|
|
1583
|
+
if (Object.getOwnPropertySymbols) {
|
|
1584
|
+
var o2 = Object.getOwnPropertySymbols(e2);
|
|
1585
|
+
r2 && (o2 = o2.filter(function(r3) {
|
|
1586
|
+
return Object.getOwnPropertyDescriptor(e2, r3).enumerable;
|
|
1587
|
+
})), t2.push.apply(t2, o2);
|
|
1588
|
+
}
|
|
1589
|
+
return t2;
|
|
1590
|
+
}
|
|
1591
|
+
function _objectSpread(e2) {
|
|
1592
|
+
for (var r2 = 1; r2 < arguments.length; r2++) {
|
|
1593
|
+
var t2 = null != arguments[r2] ? arguments[r2] : {};
|
|
1594
|
+
r2 % 2 ? ownKeys(Object(t2), true).forEach(function(r3) {
|
|
1595
|
+
_defineProperty(e2, r3, t2[r3]);
|
|
1596
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e2, Object.getOwnPropertyDescriptors(t2)) : ownKeys(Object(t2)).forEach(function(r3) {
|
|
1597
|
+
Object.defineProperty(e2, r3, Object.getOwnPropertyDescriptor(t2, r3));
|
|
1598
|
+
});
|
|
1599
|
+
}
|
|
1600
|
+
return e2;
|
|
1601
|
+
}
|
|
1602
|
+
function _defineProperty(e2, r2, t2) {
|
|
1603
|
+
return (r2 = _toPropertyKey2(r2)) in e2 ? Object.defineProperty(e2, r2, { value: t2, enumerable: true, configurable: true, writable: true }) : e2[r2] = t2, e2;
|
|
1604
|
+
}
|
|
1605
|
+
function _classCallCheck2(a2, n2) {
|
|
1606
|
+
if (!(a2 instanceof n2)) throw new TypeError("Cannot call a class as a function");
|
|
1607
|
+
}
|
|
1608
|
+
function _defineProperties2(e2, r2) {
|
|
1609
|
+
for (var t2 = 0; t2 < r2.length; t2++) {
|
|
1610
|
+
var o2 = r2[t2];
|
|
1611
|
+
o2.enumerable = o2.enumerable || false, o2.configurable = true, "value" in o2 && (o2.writable = true), Object.defineProperty(e2, _toPropertyKey2(o2.key), o2);
|
|
1612
|
+
}
|
|
1613
|
+
}
|
|
1614
|
+
function _createClass2(e2, r2, t2) {
|
|
1615
|
+
return r2 && _defineProperties2(e2.prototype, r2), t2 && _defineProperties2(e2, t2), Object.defineProperty(e2, "prototype", { writable: false }), e2;
|
|
1616
|
+
}
|
|
1617
|
+
function _toPropertyKey2(t2) {
|
|
1618
|
+
var i2 = _toPrimitive2(t2, "string");
|
|
1619
|
+
return "symbol" == _typeof2(i2) ? i2 : i2 + "";
|
|
1620
|
+
}
|
|
1621
|
+
function _toPrimitive2(t2, r2) {
|
|
1622
|
+
if ("object" != _typeof2(t2) || !t2) return t2;
|
|
1623
|
+
var e2 = t2[Symbol.toPrimitive];
|
|
1624
|
+
if (void 0 !== e2) {
|
|
1625
|
+
var i2 = e2.call(t2, r2 || "default");
|
|
1626
|
+
if ("object" != _typeof2(i2)) return i2;
|
|
1627
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
1628
|
+
}
|
|
1629
|
+
return ("string" === r2 ? String : Number)(t2);
|
|
1630
|
+
}
|
|
1631
|
+
var PhoneNumber = /* @__PURE__ */ (function() {
|
|
1632
|
+
function PhoneNumber2(countryOrCountryCallingCode, nationalNumber, metadata) {
|
|
1633
|
+
_classCallCheck2(this, PhoneNumber2);
|
|
1634
|
+
if (!countryOrCountryCallingCode) {
|
|
1635
|
+
throw new TypeError("First argument is required");
|
|
1636
|
+
}
|
|
1637
|
+
if (typeof countryOrCountryCallingCode !== "string") {
|
|
1638
|
+
throw new TypeError("First argument must be a string");
|
|
1639
|
+
}
|
|
1640
|
+
if (countryOrCountryCallingCode[0] === "+" && !nationalNumber) {
|
|
1641
|
+
throw new TypeError("`metadata` argument not passed");
|
|
1642
|
+
}
|
|
1643
|
+
if (isObject(nationalNumber) && isObject(nationalNumber.countries)) {
|
|
1644
|
+
metadata = nationalNumber;
|
|
1645
|
+
var e164Number = countryOrCountryCallingCode;
|
|
1646
|
+
if (!E164_NUMBER_REGEXP.test(e164Number)) {
|
|
1647
|
+
throw new Error('Invalid `number` argument passed: must consist of a "+" followed by digits');
|
|
1648
|
+
}
|
|
1649
|
+
var _extractCountryCallin = extractCountryCallingCode(e164Number, void 0, void 0, void 0, metadata), _countryCallingCode = _extractCountryCallin.countryCallingCode, number = _extractCountryCallin.number;
|
|
1650
|
+
nationalNumber = number;
|
|
1651
|
+
countryOrCountryCallingCode = _countryCallingCode;
|
|
1652
|
+
if (!nationalNumber) {
|
|
1653
|
+
throw new Error("Invalid `number` argument passed: too short");
|
|
1654
|
+
}
|
|
1655
|
+
}
|
|
1656
|
+
if (!nationalNumber) {
|
|
1657
|
+
throw new TypeError("`nationalNumber` argument is required");
|
|
1658
|
+
}
|
|
1659
|
+
if (typeof nationalNumber !== "string") {
|
|
1660
|
+
throw new TypeError("`nationalNumber` argument must be a string");
|
|
1661
|
+
}
|
|
1662
|
+
validateMetadata(metadata);
|
|
1663
|
+
var _getCountryAndCalling = getCountryAndCallingCodeFromOneOfThem(countryOrCountryCallingCode, metadata), country = _getCountryAndCalling.country, countryCallingCode = _getCountryAndCalling.callingCode;
|
|
1664
|
+
this.country = country;
|
|
1665
|
+
this.countryCallingCode = countryCallingCode;
|
|
1666
|
+
this.nationalNumber = nationalNumber;
|
|
1667
|
+
this.number = "+" + this.countryCallingCode + this.nationalNumber;
|
|
1668
|
+
this.getMetadata = function() {
|
|
1669
|
+
return metadata;
|
|
1670
|
+
};
|
|
1671
|
+
}
|
|
1672
|
+
return _createClass2(PhoneNumber2, [{
|
|
1673
|
+
key: "setExt",
|
|
1674
|
+
value: function setExt(ext) {
|
|
1675
|
+
this.ext = ext;
|
|
1676
|
+
}
|
|
1677
|
+
}, {
|
|
1678
|
+
key: "getPossibleCountries",
|
|
1679
|
+
value: function getPossibleCountries() {
|
|
1680
|
+
if (this.country) {
|
|
1681
|
+
return [this.country];
|
|
1682
|
+
}
|
|
1683
|
+
return getPossibleCountriesForNumber(this.countryCallingCode, this.nationalNumber, this.getMetadata());
|
|
1684
|
+
}
|
|
1685
|
+
}, {
|
|
1686
|
+
key: "isPossible",
|
|
1687
|
+
value: function isPossible() {
|
|
1688
|
+
return isPossiblePhoneNumber(this, {
|
|
1689
|
+
v2: true
|
|
1690
|
+
}, this.getMetadata());
|
|
1691
|
+
}
|
|
1692
|
+
}, {
|
|
1693
|
+
key: "isValid",
|
|
1694
|
+
value: function isValid() {
|
|
1695
|
+
return isValidNumber(this, {
|
|
1696
|
+
v2: true
|
|
1697
|
+
}, this.getMetadata());
|
|
1698
|
+
}
|
|
1699
|
+
}, {
|
|
1700
|
+
key: "isNonGeographic",
|
|
1701
|
+
value: function isNonGeographic() {
|
|
1702
|
+
var metadata = new Metadata(this.getMetadata());
|
|
1703
|
+
return metadata.isNonGeographicCallingCode(this.countryCallingCode);
|
|
1704
|
+
}
|
|
1705
|
+
}, {
|
|
1706
|
+
key: "isEqual",
|
|
1707
|
+
value: function isEqual(phoneNumber) {
|
|
1708
|
+
return this.number === phoneNumber.number && this.ext === phoneNumber.ext;
|
|
1709
|
+
}
|
|
1710
|
+
// `validateLength()` method was originally meant to be an equivalent for `validatePhoneNumberLength()`.
|
|
1711
|
+
//
|
|
1712
|
+
// Later, it became apparent that it's not really a true equivalent.
|
|
1713
|
+
// The reason is that a `PhoneNumber` instance is not created
|
|
1714
|
+
// when the phone number string is too short for it to be considered a valid phone number:
|
|
1715
|
+
// * When there must be at least 2 national (significant) number digits: `"1"`.
|
|
1716
|
+
// * When the country calling code part of an international number is incomplete: `"+12"`.
|
|
1717
|
+
//
|
|
1718
|
+
// So leaving this `validateLength()` method here would suggest a hidden anti-pattern
|
|
1719
|
+
// of using it instead of `validatePhoneNumberLength()` while ignoring
|
|
1720
|
+
// the "too short to be even possible" case from phone number length validation.
|
|
1721
|
+
// And ignoring that case wouldn't make any sense in a real-world application
|
|
1722
|
+
// because it would still be a valid case that should be handled.
|
|
1723
|
+
//
|
|
1724
|
+
// Because of that, this method was eventually commented out in order to not introduce
|
|
1725
|
+
// that kind of an anti-pattern.
|
|
1726
|
+
//
|
|
1727
|
+
// validateLength() {
|
|
1728
|
+
// const result = checkNumberLength(
|
|
1729
|
+
// this.nationalNumber,
|
|
1730
|
+
// undefined,
|
|
1731
|
+
// this.getMetadata()
|
|
1732
|
+
// )
|
|
1733
|
+
// if (result !== 'IS_POSSIBLE') {
|
|
1734
|
+
// return result
|
|
1735
|
+
// }
|
|
1736
|
+
// }
|
|
1737
|
+
}, {
|
|
1738
|
+
key: "getType",
|
|
1739
|
+
value: function getType2() {
|
|
1740
|
+
return getNumberType(this, {
|
|
1741
|
+
v2: true
|
|
1742
|
+
}, this.getMetadata());
|
|
1743
|
+
}
|
|
1744
|
+
}, {
|
|
1745
|
+
key: "format",
|
|
1746
|
+
value: function format2(_format, options) {
|
|
1747
|
+
return formatNumber(this, _format, options ? _objectSpread(_objectSpread({}, options), {}, {
|
|
1748
|
+
v2: true
|
|
1749
|
+
}) : {
|
|
1750
|
+
v2: true
|
|
1751
|
+
}, this.getMetadata());
|
|
1752
|
+
}
|
|
1753
|
+
}, {
|
|
1754
|
+
key: "formatNational",
|
|
1755
|
+
value: function formatNational(options) {
|
|
1756
|
+
return this.format("NATIONAL", options);
|
|
1757
|
+
}
|
|
1758
|
+
}, {
|
|
1759
|
+
key: "formatInternational",
|
|
1760
|
+
value: function formatInternational(options) {
|
|
1761
|
+
return this.format("INTERNATIONAL", options);
|
|
1762
|
+
}
|
|
1763
|
+
}, {
|
|
1764
|
+
key: "getURI",
|
|
1765
|
+
value: function getURI(options) {
|
|
1766
|
+
return this.format("RFC3966", options);
|
|
1767
|
+
}
|
|
1768
|
+
}]);
|
|
1769
|
+
})();
|
|
1770
|
+
var E164_NUMBER_REGEXP = /^\+\d+$/;
|
|
1771
|
+
|
|
1772
|
+
// node_modules/.pnpm/libphonenumber-js@1.13.7/node_modules/libphonenumber-js/es6/helpers/parseDigits.js
|
|
1773
|
+
function _createForOfIteratorHelperLoose4(r2, e2) {
|
|
1774
|
+
var t2 = "undefined" != typeof Symbol && r2[Symbol.iterator] || r2["@@iterator"];
|
|
1775
|
+
if (t2) return (t2 = t2.call(r2)).next.bind(t2);
|
|
1776
|
+
if (Array.isArray(r2) || (t2 = _unsupportedIterableToArray4(r2)) || e2 && r2 && "number" == typeof r2.length) {
|
|
1777
|
+
t2 && (r2 = t2);
|
|
1778
|
+
var o2 = 0;
|
|
1779
|
+
return function() {
|
|
1780
|
+
return o2 >= r2.length ? { done: true } : { done: false, value: r2[o2++] };
|
|
1781
|
+
};
|
|
1782
|
+
}
|
|
1783
|
+
throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
1784
|
+
}
|
|
1785
|
+
function _unsupportedIterableToArray4(r2, a2) {
|
|
1786
|
+
if (r2) {
|
|
1787
|
+
if ("string" == typeof r2) return _arrayLikeToArray4(r2, a2);
|
|
1788
|
+
var t2 = {}.toString.call(r2).slice(8, -1);
|
|
1789
|
+
return "Object" === t2 && r2.constructor && (t2 = r2.constructor.name), "Map" === t2 || "Set" === t2 ? Array.from(r2) : "Arguments" === t2 || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t2) ? _arrayLikeToArray4(r2, a2) : void 0;
|
|
1790
|
+
}
|
|
1791
|
+
}
|
|
1792
|
+
function _arrayLikeToArray4(r2, a2) {
|
|
1793
|
+
(null == a2 || a2 > r2.length) && (a2 = r2.length);
|
|
1794
|
+
for (var e2 = 0, n2 = Array(a2); e2 < a2; e2++) n2[e2] = r2[e2];
|
|
1795
|
+
return n2;
|
|
1796
|
+
}
|
|
1797
|
+
var DIGITS = {
|
|
1798
|
+
"0": "0",
|
|
1799
|
+
"1": "1",
|
|
1800
|
+
"2": "2",
|
|
1801
|
+
"3": "3",
|
|
1802
|
+
"4": "4",
|
|
1803
|
+
"5": "5",
|
|
1804
|
+
"6": "6",
|
|
1805
|
+
"7": "7",
|
|
1806
|
+
"8": "8",
|
|
1807
|
+
"9": "9",
|
|
1808
|
+
"\uFF10": "0",
|
|
1809
|
+
// Fullwidth digit 0
|
|
1810
|
+
"\uFF11": "1",
|
|
1811
|
+
// Fullwidth digit 1
|
|
1812
|
+
"\uFF12": "2",
|
|
1813
|
+
// Fullwidth digit 2
|
|
1814
|
+
"\uFF13": "3",
|
|
1815
|
+
// Fullwidth digit 3
|
|
1816
|
+
"\uFF14": "4",
|
|
1817
|
+
// Fullwidth digit 4
|
|
1818
|
+
"\uFF15": "5",
|
|
1819
|
+
// Fullwidth digit 5
|
|
1820
|
+
"\uFF16": "6",
|
|
1821
|
+
// Fullwidth digit 6
|
|
1822
|
+
"\uFF17": "7",
|
|
1823
|
+
// Fullwidth digit 7
|
|
1824
|
+
"\uFF18": "8",
|
|
1825
|
+
// Fullwidth digit 8
|
|
1826
|
+
"\uFF19": "9",
|
|
1827
|
+
// Fullwidth digit 9
|
|
1828
|
+
"\u0660": "0",
|
|
1829
|
+
// Arabic-indic digit 0
|
|
1830
|
+
"\u0661": "1",
|
|
1831
|
+
// Arabic-indic digit 1
|
|
1832
|
+
"\u0662": "2",
|
|
1833
|
+
// Arabic-indic digit 2
|
|
1834
|
+
"\u0663": "3",
|
|
1835
|
+
// Arabic-indic digit 3
|
|
1836
|
+
"\u0664": "4",
|
|
1837
|
+
// Arabic-indic digit 4
|
|
1838
|
+
"\u0665": "5",
|
|
1839
|
+
// Arabic-indic digit 5
|
|
1840
|
+
"\u0666": "6",
|
|
1841
|
+
// Arabic-indic digit 6
|
|
1842
|
+
"\u0667": "7",
|
|
1843
|
+
// Arabic-indic digit 7
|
|
1844
|
+
"\u0668": "8",
|
|
1845
|
+
// Arabic-indic digit 8
|
|
1846
|
+
"\u0669": "9",
|
|
1847
|
+
// Arabic-indic digit 9
|
|
1848
|
+
"\u06F0": "0",
|
|
1849
|
+
// Eastern-Arabic digit 0
|
|
1850
|
+
"\u06F1": "1",
|
|
1851
|
+
// Eastern-Arabic digit 1
|
|
1852
|
+
"\u06F2": "2",
|
|
1853
|
+
// Eastern-Arabic digit 2
|
|
1854
|
+
"\u06F3": "3",
|
|
1855
|
+
// Eastern-Arabic digit 3
|
|
1856
|
+
"\u06F4": "4",
|
|
1857
|
+
// Eastern-Arabic digit 4
|
|
1858
|
+
"\u06F5": "5",
|
|
1859
|
+
// Eastern-Arabic digit 5
|
|
1860
|
+
"\u06F6": "6",
|
|
1861
|
+
// Eastern-Arabic digit 6
|
|
1862
|
+
"\u06F7": "7",
|
|
1863
|
+
// Eastern-Arabic digit 7
|
|
1864
|
+
"\u06F8": "8",
|
|
1865
|
+
// Eastern-Arabic digit 8
|
|
1866
|
+
"\u06F9": "9"
|
|
1867
|
+
// Eastern-Arabic digit 9
|
|
1868
|
+
};
|
|
1869
|
+
function parseDigit(character) {
|
|
1870
|
+
return DIGITS[character];
|
|
1871
|
+
}
|
|
1872
|
+
function parseDigits(string) {
|
|
1873
|
+
var result = "";
|
|
1874
|
+
for (var _iterator = _createForOfIteratorHelperLoose4(string.split("")), _step; !(_step = _iterator()).done; ) {
|
|
1875
|
+
var character = _step.value;
|
|
1876
|
+
var digit = parseDigit(character);
|
|
1877
|
+
if (digit) {
|
|
1878
|
+
result += digit;
|
|
1879
|
+
}
|
|
1880
|
+
}
|
|
1881
|
+
return result;
|
|
1882
|
+
}
|
|
1883
|
+
|
|
1884
|
+
// node_modules/.pnpm/libphonenumber-js@1.13.7/node_modules/libphonenumber-js/es6/AsYouTypeState.js
|
|
1885
|
+
function _typeof3(o2) {
|
|
1886
|
+
"@babel/helpers - typeof";
|
|
1887
|
+
return _typeof3 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o3) {
|
|
1888
|
+
return typeof o3;
|
|
1889
|
+
} : function(o3) {
|
|
1890
|
+
return o3 && "function" == typeof Symbol && o3.constructor === Symbol && o3 !== Symbol.prototype ? "symbol" : typeof o3;
|
|
1891
|
+
}, _typeof3(o2);
|
|
1892
|
+
}
|
|
1893
|
+
function _classCallCheck3(a2, n2) {
|
|
1894
|
+
if (!(a2 instanceof n2)) throw new TypeError("Cannot call a class as a function");
|
|
1895
|
+
}
|
|
1896
|
+
function _defineProperties3(e2, r2) {
|
|
1897
|
+
for (var t2 = 0; t2 < r2.length; t2++) {
|
|
1898
|
+
var o2 = r2[t2];
|
|
1899
|
+
o2.enumerable = o2.enumerable || false, o2.configurable = true, "value" in o2 && (o2.writable = true), Object.defineProperty(e2, _toPropertyKey3(o2.key), o2);
|
|
1900
|
+
}
|
|
1901
|
+
}
|
|
1902
|
+
function _createClass3(e2, r2, t2) {
|
|
1903
|
+
return r2 && _defineProperties3(e2.prototype, r2), t2 && _defineProperties3(e2, t2), Object.defineProperty(e2, "prototype", { writable: false }), e2;
|
|
1904
|
+
}
|
|
1905
|
+
function _toPropertyKey3(t2) {
|
|
1906
|
+
var i2 = _toPrimitive3(t2, "string");
|
|
1907
|
+
return "symbol" == _typeof3(i2) ? i2 : i2 + "";
|
|
1908
|
+
}
|
|
1909
|
+
function _toPrimitive3(t2, r2) {
|
|
1910
|
+
if ("object" != _typeof3(t2) || !t2) return t2;
|
|
1911
|
+
var e2 = t2[Symbol.toPrimitive];
|
|
1912
|
+
if (void 0 !== e2) {
|
|
1913
|
+
var i2 = e2.call(t2, r2 || "default");
|
|
1914
|
+
if ("object" != _typeof3(i2)) return i2;
|
|
1915
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
1916
|
+
}
|
|
1917
|
+
return ("string" === r2 ? String : Number)(t2);
|
|
1918
|
+
}
|
|
1919
|
+
var AsYouTypeState = /* @__PURE__ */ (function() {
|
|
1920
|
+
function AsYouTypeState2(_ref) {
|
|
1921
|
+
var onCountryChange = _ref.onCountryChange, onCallingCodeChange = _ref.onCallingCodeChange;
|
|
1922
|
+
_classCallCheck3(this, AsYouTypeState2);
|
|
1923
|
+
this.onCountryChange = onCountryChange;
|
|
1924
|
+
this.onCallingCodeChange = onCallingCodeChange;
|
|
1925
|
+
}
|
|
1926
|
+
return _createClass3(AsYouTypeState2, [{
|
|
1927
|
+
key: "reset",
|
|
1928
|
+
value: function reset(_ref2) {
|
|
1929
|
+
var country = _ref2.country, callingCode = _ref2.callingCode;
|
|
1930
|
+
this.international = false;
|
|
1931
|
+
this.missingPlus = false;
|
|
1932
|
+
this.IDDPrefix = void 0;
|
|
1933
|
+
this.callingCode = void 0;
|
|
1934
|
+
this.digits = "";
|
|
1935
|
+
this.resetNationalSignificantNumber();
|
|
1936
|
+
this.initCountryAndCallingCode(country, callingCode);
|
|
1937
|
+
}
|
|
1938
|
+
}, {
|
|
1939
|
+
key: "resetNationalSignificantNumber",
|
|
1940
|
+
value: function resetNationalSignificantNumber() {
|
|
1941
|
+
this.nationalSignificantNumber = this.getNationalDigits();
|
|
1942
|
+
this.nationalSignificantNumberIsModified = false;
|
|
1943
|
+
this.nationalPrefix = void 0;
|
|
1944
|
+
this.carrierCode = void 0;
|
|
1945
|
+
this.prefixBeforeNationalSignificantNumberThatIsNotNationalPrefix = void 0;
|
|
1946
|
+
}
|
|
1947
|
+
}, {
|
|
1948
|
+
key: "update",
|
|
1949
|
+
value: function update(properties) {
|
|
1950
|
+
for (var _i = 0, _Object$keys = Object.keys(properties); _i < _Object$keys.length; _i++) {
|
|
1951
|
+
var key = _Object$keys[_i];
|
|
1952
|
+
this[key] = properties[key];
|
|
1953
|
+
}
|
|
1954
|
+
}
|
|
1955
|
+
}, {
|
|
1956
|
+
key: "initCountryAndCallingCode",
|
|
1957
|
+
value: function initCountryAndCallingCode(country, callingCode) {
|
|
1958
|
+
this.setCountry(country);
|
|
1959
|
+
this.setCallingCode(callingCode);
|
|
1960
|
+
}
|
|
1961
|
+
}, {
|
|
1962
|
+
key: "setCountry",
|
|
1963
|
+
value: function setCountry(country) {
|
|
1964
|
+
this.country = country;
|
|
1965
|
+
this.onCountryChange(country);
|
|
1966
|
+
}
|
|
1967
|
+
}, {
|
|
1968
|
+
key: "setCallingCode",
|
|
1969
|
+
value: function setCallingCode(callingCode) {
|
|
1970
|
+
this.callingCode = callingCode;
|
|
1971
|
+
this.onCallingCodeChange(callingCode, this.country);
|
|
1972
|
+
}
|
|
1973
|
+
}, {
|
|
1974
|
+
key: "startInternationalNumber",
|
|
1975
|
+
value: function startInternationalNumber(country, callingCode) {
|
|
1976
|
+
this.international = true;
|
|
1977
|
+
this.initCountryAndCallingCode(country, callingCode);
|
|
1978
|
+
}
|
|
1979
|
+
}, {
|
|
1980
|
+
key: "appendDigits",
|
|
1981
|
+
value: function appendDigits(nextDigits) {
|
|
1982
|
+
this.digits += nextDigits;
|
|
1983
|
+
}
|
|
1984
|
+
}, {
|
|
1985
|
+
key: "appendNationalSignificantNumberDigits",
|
|
1986
|
+
value: function appendNationalSignificantNumberDigits(nextDigits) {
|
|
1987
|
+
this.nationalSignificantNumber += nextDigits;
|
|
1988
|
+
}
|
|
1989
|
+
/**
|
|
1990
|
+
* Returns the part of `this.digits` that corresponds to the national number.
|
|
1991
|
+
* Basically, all digits that have been input by the user, except for the
|
|
1992
|
+
* international prefix and the country calling code part
|
|
1993
|
+
* (if the number is an international one).
|
|
1994
|
+
* @return {string}
|
|
1995
|
+
*/
|
|
1996
|
+
}, {
|
|
1997
|
+
key: "getNationalDigits",
|
|
1998
|
+
value: function getNationalDigits() {
|
|
1999
|
+
if (this.international) {
|
|
2000
|
+
return this.digits.slice((this.IDDPrefix ? this.IDDPrefix.length : 0) + (this.callingCode ? this.callingCode.length : 0));
|
|
2001
|
+
}
|
|
2002
|
+
return this.digits;
|
|
2003
|
+
}
|
|
2004
|
+
}, {
|
|
2005
|
+
key: "getDigitsWithoutInternationalPrefix",
|
|
2006
|
+
value: function getDigitsWithoutInternationalPrefix() {
|
|
2007
|
+
if (this.international) {
|
|
2008
|
+
if (this.IDDPrefix) {
|
|
2009
|
+
return this.digits.slice(this.IDDPrefix.length);
|
|
2010
|
+
}
|
|
2011
|
+
}
|
|
2012
|
+
return this.digits;
|
|
2013
|
+
}
|
|
2014
|
+
}]);
|
|
2015
|
+
})();
|
|
2016
|
+
|
|
2017
|
+
// node_modules/.pnpm/libphonenumber-js@1.13.7/node_modules/libphonenumber-js/es6/AsYouTypeFormatter.util.js
|
|
2018
|
+
function _createForOfIteratorHelperLoose5(r2, e2) {
|
|
2019
|
+
var t2 = "undefined" != typeof Symbol && r2[Symbol.iterator] || r2["@@iterator"];
|
|
2020
|
+
if (t2) return (t2 = t2.call(r2)).next.bind(t2);
|
|
2021
|
+
if (Array.isArray(r2) || (t2 = _unsupportedIterableToArray5(r2)) || e2 && r2 && "number" == typeof r2.length) {
|
|
2022
|
+
t2 && (r2 = t2);
|
|
2023
|
+
var o2 = 0;
|
|
2024
|
+
return function() {
|
|
2025
|
+
return o2 >= r2.length ? { done: true } : { done: false, value: r2[o2++] };
|
|
2026
|
+
};
|
|
2027
|
+
}
|
|
2028
|
+
throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
2029
|
+
}
|
|
2030
|
+
function _unsupportedIterableToArray5(r2, a2) {
|
|
2031
|
+
if (r2) {
|
|
2032
|
+
if ("string" == typeof r2) return _arrayLikeToArray5(r2, a2);
|
|
2033
|
+
var t2 = {}.toString.call(r2).slice(8, -1);
|
|
2034
|
+
return "Object" === t2 && r2.constructor && (t2 = r2.constructor.name), "Map" === t2 || "Set" === t2 ? Array.from(r2) : "Arguments" === t2 || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t2) ? _arrayLikeToArray5(r2, a2) : void 0;
|
|
2035
|
+
}
|
|
2036
|
+
}
|
|
2037
|
+
function _arrayLikeToArray5(r2, a2) {
|
|
2038
|
+
(null == a2 || a2 > r2.length) && (a2 = r2.length);
|
|
2039
|
+
for (var e2 = 0, n2 = Array(a2); e2 < a2; e2++) n2[e2] = r2[e2];
|
|
2040
|
+
return n2;
|
|
2041
|
+
}
|
|
2042
|
+
var DIGIT_PLACEHOLDER = "x";
|
|
2043
|
+
var DIGIT_PLACEHOLDER_MATCHER = new RegExp(DIGIT_PLACEHOLDER);
|
|
2044
|
+
function repeat(string, times) {
|
|
2045
|
+
if (times < 1) {
|
|
2046
|
+
return "";
|
|
2047
|
+
}
|
|
2048
|
+
var result = "";
|
|
2049
|
+
while (times > 1) {
|
|
2050
|
+
if (times & 1) {
|
|
2051
|
+
result += string;
|
|
2052
|
+
}
|
|
2053
|
+
times >>= 1;
|
|
2054
|
+
string += string;
|
|
2055
|
+
}
|
|
2056
|
+
return result + string;
|
|
2057
|
+
}
|
|
2058
|
+
function cutAndStripNonPairedParens(string, cutBeforeIndex) {
|
|
2059
|
+
if (string[cutBeforeIndex] === ")") {
|
|
2060
|
+
cutBeforeIndex++;
|
|
2061
|
+
}
|
|
2062
|
+
return stripNonPairedParens(string.slice(0, cutBeforeIndex));
|
|
2063
|
+
}
|
|
2064
|
+
function stripNonPairedParens(string) {
|
|
2065
|
+
var dangling_braces = [];
|
|
2066
|
+
var i2 = 0;
|
|
2067
|
+
while (i2 < string.length) {
|
|
2068
|
+
if (string[i2] === "(") {
|
|
2069
|
+
dangling_braces.push(i2);
|
|
2070
|
+
} else if (string[i2] === ")") {
|
|
2071
|
+
dangling_braces.pop();
|
|
2072
|
+
}
|
|
2073
|
+
i2++;
|
|
2074
|
+
}
|
|
2075
|
+
var start = 0;
|
|
2076
|
+
var cleared_string = "";
|
|
2077
|
+
dangling_braces.push(string.length);
|
|
2078
|
+
for (var _i = 0, _dangling_braces = dangling_braces; _i < _dangling_braces.length; _i++) {
|
|
2079
|
+
var index = _dangling_braces[_i];
|
|
2080
|
+
cleared_string += string.slice(start, index);
|
|
2081
|
+
start = index + 1;
|
|
2082
|
+
}
|
|
2083
|
+
return cleared_string;
|
|
2084
|
+
}
|
|
2085
|
+
function populateTemplateWithDigits(template, position, digits) {
|
|
2086
|
+
for (var _iterator2 = _createForOfIteratorHelperLoose5(digits.split("")), _step2; !(_step2 = _iterator2()).done; ) {
|
|
2087
|
+
var digit = _step2.value;
|
|
2088
|
+
if (template.slice(position + 1).search(DIGIT_PLACEHOLDER_MATCHER) < 0) {
|
|
2089
|
+
return;
|
|
2090
|
+
}
|
|
2091
|
+
position = template.search(DIGIT_PLACEHOLDER_MATCHER);
|
|
2092
|
+
template = template.replace(DIGIT_PLACEHOLDER_MATCHER, digit);
|
|
2093
|
+
}
|
|
2094
|
+
return [template, position];
|
|
2095
|
+
}
|
|
2096
|
+
|
|
2097
|
+
// node_modules/.pnpm/libphonenumber-js@1.13.7/node_modules/libphonenumber-js/es6/AsYouTypeFormatter.complete.js
|
|
2098
|
+
function formatCompleteNumber(state, format2, _ref) {
|
|
2099
|
+
var metadata = _ref.metadata, shouldTryNationalPrefixFormattingRule = _ref.shouldTryNationalPrefixFormattingRule, getSeparatorAfterNationalPrefix = _ref.getSeparatorAfterNationalPrefix;
|
|
2100
|
+
var matcher = new RegExp("^(?:".concat(format2.pattern(), ")$"));
|
|
2101
|
+
if (matcher.test(state.nationalSignificantNumber)) {
|
|
2102
|
+
return formatNationalNumberWithAndWithoutNationalPrefixFormattingRule(state, format2, {
|
|
2103
|
+
metadata,
|
|
2104
|
+
shouldTryNationalPrefixFormattingRule,
|
|
2105
|
+
getSeparatorAfterNationalPrefix
|
|
2106
|
+
});
|
|
2107
|
+
}
|
|
2108
|
+
}
|
|
2109
|
+
function canFormatCompleteNumber(nationalSignificantNumber, metadata) {
|
|
2110
|
+
return checkNumberLength(nationalSignificantNumber, void 0, metadata) === "IS_POSSIBLE";
|
|
2111
|
+
}
|
|
2112
|
+
function formatNationalNumberWithAndWithoutNationalPrefixFormattingRule(state, format2, _ref2) {
|
|
2113
|
+
var metadata = _ref2.metadata, shouldTryNationalPrefixFormattingRule = _ref2.shouldTryNationalPrefixFormattingRule, getSeparatorAfterNationalPrefix = _ref2.getSeparatorAfterNationalPrefix;
|
|
2114
|
+
var nationalSignificantNumber = state.nationalSignificantNumber, international = state.international, nationalPrefix = state.nationalPrefix, carrierCode = state.carrierCode;
|
|
2115
|
+
if (shouldTryNationalPrefixFormattingRule(format2)) {
|
|
2116
|
+
var formattedNumber = formatNationalNumber2(state, format2, {
|
|
2117
|
+
useNationalPrefixFormattingRule: true,
|
|
2118
|
+
getSeparatorAfterNationalPrefix,
|
|
2119
|
+
metadata
|
|
2120
|
+
});
|
|
2121
|
+
if (formattedNumber) {
|
|
2122
|
+
return formattedNumber;
|
|
2123
|
+
}
|
|
2124
|
+
}
|
|
2125
|
+
return formatNationalNumber2(state, format2, {
|
|
2126
|
+
useNationalPrefixFormattingRule: false,
|
|
2127
|
+
getSeparatorAfterNationalPrefix,
|
|
2128
|
+
metadata
|
|
2129
|
+
});
|
|
2130
|
+
}
|
|
2131
|
+
function formatNationalNumber2(state, format2, _ref3) {
|
|
2132
|
+
var metadata = _ref3.metadata, useNationalPrefixFormattingRule = _ref3.useNationalPrefixFormattingRule, getSeparatorAfterNationalPrefix = _ref3.getSeparatorAfterNationalPrefix;
|
|
2133
|
+
var formattedNationalNumber = formatNationalNumberUsingFormat(state.nationalSignificantNumber, format2, {
|
|
2134
|
+
carrierCode: state.carrierCode,
|
|
2135
|
+
useInternationalFormat: state.international,
|
|
2136
|
+
withNationalPrefix: useNationalPrefixFormattingRule,
|
|
2137
|
+
metadata
|
|
2138
|
+
});
|
|
2139
|
+
if (!useNationalPrefixFormattingRule) {
|
|
2140
|
+
if (state.nationalPrefix) {
|
|
2141
|
+
formattedNationalNumber = state.nationalPrefix + getSeparatorAfterNationalPrefix(format2) + formattedNationalNumber;
|
|
2142
|
+
} else if (state.prefixBeforeNationalSignificantNumberThatIsNotNationalPrefix) {
|
|
2143
|
+
formattedNationalNumber = state.prefixBeforeNationalSignificantNumberThatIsNotNationalPrefix + " " + formattedNationalNumber;
|
|
2144
|
+
}
|
|
2145
|
+
}
|
|
2146
|
+
if (isValidFormattedNationalNumber(formattedNationalNumber, state)) {
|
|
2147
|
+
return formattedNationalNumber;
|
|
2148
|
+
}
|
|
2149
|
+
}
|
|
2150
|
+
function isValidFormattedNationalNumber(formattedNationalNumber, state) {
|
|
2151
|
+
return parseDigits(formattedNationalNumber) === state.getNationalDigits();
|
|
2152
|
+
}
|
|
2153
|
+
|
|
2154
|
+
// node_modules/.pnpm/libphonenumber-js@1.13.7/node_modules/libphonenumber-js/es6/AsYouTypeFormatter.PatternParser.js
|
|
2155
|
+
function _typeof4(o2) {
|
|
2156
|
+
"@babel/helpers - typeof";
|
|
2157
|
+
return _typeof4 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o3) {
|
|
2158
|
+
return typeof o3;
|
|
2159
|
+
} : function(o3) {
|
|
2160
|
+
return o3 && "function" == typeof Symbol && o3.constructor === Symbol && o3 !== Symbol.prototype ? "symbol" : typeof o3;
|
|
2161
|
+
}, _typeof4(o2);
|
|
2162
|
+
}
|
|
2163
|
+
function _classCallCheck4(a2, n2) {
|
|
2164
|
+
if (!(a2 instanceof n2)) throw new TypeError("Cannot call a class as a function");
|
|
2165
|
+
}
|
|
2166
|
+
function _defineProperties4(e2, r2) {
|
|
2167
|
+
for (var t2 = 0; t2 < r2.length; t2++) {
|
|
2168
|
+
var o2 = r2[t2];
|
|
2169
|
+
o2.enumerable = o2.enumerable || false, o2.configurable = true, "value" in o2 && (o2.writable = true), Object.defineProperty(e2, _toPropertyKey4(o2.key), o2);
|
|
2170
|
+
}
|
|
2171
|
+
}
|
|
2172
|
+
function _createClass4(e2, r2, t2) {
|
|
2173
|
+
return r2 && _defineProperties4(e2.prototype, r2), t2 && _defineProperties4(e2, t2), Object.defineProperty(e2, "prototype", { writable: false }), e2;
|
|
2174
|
+
}
|
|
2175
|
+
function _toPropertyKey4(t2) {
|
|
2176
|
+
var i2 = _toPrimitive4(t2, "string");
|
|
2177
|
+
return "symbol" == _typeof4(i2) ? i2 : i2 + "";
|
|
2178
|
+
}
|
|
2179
|
+
function _toPrimitive4(t2, r2) {
|
|
2180
|
+
if ("object" != _typeof4(t2) || !t2) return t2;
|
|
2181
|
+
var e2 = t2[Symbol.toPrimitive];
|
|
2182
|
+
if (void 0 !== e2) {
|
|
2183
|
+
var i2 = e2.call(t2, r2 || "default");
|
|
2184
|
+
if ("object" != _typeof4(i2)) return i2;
|
|
2185
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
2186
|
+
}
|
|
2187
|
+
return ("string" === r2 ? String : Number)(t2);
|
|
2188
|
+
}
|
|
2189
|
+
var PatternParser = /* @__PURE__ */ (function() {
|
|
2190
|
+
function PatternParser2() {
|
|
2191
|
+
_classCallCheck4(this, PatternParser2);
|
|
2192
|
+
}
|
|
2193
|
+
return _createClass4(PatternParser2, [{
|
|
2194
|
+
key: "parse",
|
|
2195
|
+
value: function parse(pattern) {
|
|
2196
|
+
this.context = [{
|
|
2197
|
+
or: true,
|
|
2198
|
+
instructions: []
|
|
2199
|
+
}];
|
|
2200
|
+
this.parsePattern(pattern);
|
|
2201
|
+
if (this.context.length !== 1) {
|
|
2202
|
+
throw new Error("Non-finalized contexts left when pattern parse ended");
|
|
2203
|
+
}
|
|
2204
|
+
var _this$context$ = this.context[0], branches = _this$context$.branches, instructions = _this$context$.instructions;
|
|
2205
|
+
if (branches) {
|
|
2206
|
+
return {
|
|
2207
|
+
op: "|",
|
|
2208
|
+
args: branches.concat([expandSingleElementArray(instructions)])
|
|
2209
|
+
};
|
|
2210
|
+
}
|
|
2211
|
+
if (instructions.length === 0) {
|
|
2212
|
+
throw new Error("Pattern is required");
|
|
2213
|
+
}
|
|
2214
|
+
if (instructions.length === 1) {
|
|
2215
|
+
return instructions[0];
|
|
2216
|
+
}
|
|
2217
|
+
return instructions;
|
|
2218
|
+
}
|
|
2219
|
+
}, {
|
|
2220
|
+
key: "startContext",
|
|
2221
|
+
value: function startContext(context) {
|
|
2222
|
+
this.context.push(context);
|
|
2223
|
+
}
|
|
2224
|
+
}, {
|
|
2225
|
+
key: "endContext",
|
|
2226
|
+
value: function endContext() {
|
|
2227
|
+
this.context.pop();
|
|
2228
|
+
}
|
|
2229
|
+
}, {
|
|
2230
|
+
key: "getContext",
|
|
2231
|
+
value: function getContext() {
|
|
2232
|
+
return this.context[this.context.length - 1];
|
|
2233
|
+
}
|
|
2234
|
+
}, {
|
|
2235
|
+
key: "parsePattern",
|
|
2236
|
+
value: function parsePattern(pattern) {
|
|
2237
|
+
if (!pattern) {
|
|
2238
|
+
throw new Error("Pattern is required");
|
|
2239
|
+
}
|
|
2240
|
+
var match = pattern.match(OPERATOR);
|
|
2241
|
+
if (!match) {
|
|
2242
|
+
if (ILLEGAL_CHARACTER_REGEXP.test(pattern)) {
|
|
2243
|
+
throw new Error("Illegal characters found in a pattern: ".concat(pattern));
|
|
2244
|
+
}
|
|
2245
|
+
this.getContext().instructions = this.getContext().instructions.concat(pattern.split(""));
|
|
2246
|
+
return;
|
|
2247
|
+
}
|
|
2248
|
+
var operator = match[1];
|
|
2249
|
+
var before = pattern.slice(0, match.index);
|
|
2250
|
+
var rightPart = pattern.slice(match.index + operator.length);
|
|
2251
|
+
switch (operator) {
|
|
2252
|
+
case "(?:":
|
|
2253
|
+
if (before) {
|
|
2254
|
+
this.parsePattern(before);
|
|
2255
|
+
}
|
|
2256
|
+
this.startContext({
|
|
2257
|
+
or: true,
|
|
2258
|
+
instructions: [],
|
|
2259
|
+
branches: []
|
|
2260
|
+
});
|
|
2261
|
+
break;
|
|
2262
|
+
case ")":
|
|
2263
|
+
if (!this.getContext().or) {
|
|
2264
|
+
throw new Error('")" operator must be preceded by "(?:" operator');
|
|
2265
|
+
}
|
|
2266
|
+
if (before) {
|
|
2267
|
+
this.parsePattern(before);
|
|
2268
|
+
}
|
|
2269
|
+
if (this.getContext().instructions.length === 0) {
|
|
2270
|
+
throw new Error('No instructions found after "|" operator in an "or" group');
|
|
2271
|
+
}
|
|
2272
|
+
var _this$getContext = this.getContext(), branches = _this$getContext.branches;
|
|
2273
|
+
branches.push(expandSingleElementArray(this.getContext().instructions));
|
|
2274
|
+
this.endContext();
|
|
2275
|
+
this.getContext().instructions.push({
|
|
2276
|
+
op: "|",
|
|
2277
|
+
args: branches
|
|
2278
|
+
});
|
|
2279
|
+
break;
|
|
2280
|
+
case "|":
|
|
2281
|
+
if (!this.getContext().or) {
|
|
2282
|
+
throw new Error('"|" operator can only be used inside "or" groups');
|
|
2283
|
+
}
|
|
2284
|
+
if (before) {
|
|
2285
|
+
this.parsePattern(before);
|
|
2286
|
+
}
|
|
2287
|
+
if (!this.getContext().branches) {
|
|
2288
|
+
if (this.context.length === 1) {
|
|
2289
|
+
this.getContext().branches = [];
|
|
2290
|
+
} else {
|
|
2291
|
+
throw new Error('"branches" not found in an "or" group context');
|
|
2292
|
+
}
|
|
2293
|
+
}
|
|
2294
|
+
this.getContext().branches.push(expandSingleElementArray(this.getContext().instructions));
|
|
2295
|
+
this.getContext().instructions = [];
|
|
2296
|
+
break;
|
|
2297
|
+
case "[":
|
|
2298
|
+
if (before) {
|
|
2299
|
+
this.parsePattern(before);
|
|
2300
|
+
}
|
|
2301
|
+
this.startContext({
|
|
2302
|
+
oneOfSet: true
|
|
2303
|
+
});
|
|
2304
|
+
break;
|
|
2305
|
+
case "]":
|
|
2306
|
+
if (!this.getContext().oneOfSet) {
|
|
2307
|
+
throw new Error('"]" operator must be preceded by "[" operator');
|
|
2308
|
+
}
|
|
2309
|
+
this.endContext();
|
|
2310
|
+
this.getContext().instructions.push({
|
|
2311
|
+
op: "[]",
|
|
2312
|
+
args: parseOneOfSet(before)
|
|
2313
|
+
});
|
|
2314
|
+
break;
|
|
2315
|
+
/* istanbul ignore next */
|
|
2316
|
+
default:
|
|
2317
|
+
throw new Error("Unknown operator: ".concat(operator));
|
|
2318
|
+
}
|
|
2319
|
+
if (rightPart) {
|
|
2320
|
+
this.parsePattern(rightPart);
|
|
2321
|
+
}
|
|
2322
|
+
}
|
|
2323
|
+
}]);
|
|
2324
|
+
})();
|
|
2325
|
+
function parseOneOfSet(pattern) {
|
|
2326
|
+
var values = [];
|
|
2327
|
+
var i2 = 0;
|
|
2328
|
+
while (i2 < pattern.length) {
|
|
2329
|
+
if (pattern[i2] === "-") {
|
|
2330
|
+
if (i2 === 0 || i2 === pattern.length - 1) {
|
|
2331
|
+
throw new Error("Couldn't parse a one-of set pattern: ".concat(pattern));
|
|
2332
|
+
}
|
|
2333
|
+
var prevValue = pattern[i2 - 1].charCodeAt(0) + 1;
|
|
2334
|
+
var nextValue = pattern[i2 + 1].charCodeAt(0) - 1;
|
|
2335
|
+
var value = prevValue;
|
|
2336
|
+
while (value <= nextValue) {
|
|
2337
|
+
values.push(String.fromCharCode(value));
|
|
2338
|
+
value++;
|
|
2339
|
+
}
|
|
2340
|
+
} else {
|
|
2341
|
+
values.push(pattern[i2]);
|
|
2342
|
+
}
|
|
2343
|
+
i2++;
|
|
2344
|
+
}
|
|
2345
|
+
return values;
|
|
2346
|
+
}
|
|
2347
|
+
var ILLEGAL_CHARACTER_REGEXP = /[\(\)\[\]\?\:\|]/;
|
|
2348
|
+
var OPERATOR = new RegExp(
|
|
2349
|
+
// any of:
|
|
2350
|
+
"(\\||\\(\\?\\:|\\)|\\[|\\])"
|
|
2351
|
+
);
|
|
2352
|
+
function expandSingleElementArray(array) {
|
|
2353
|
+
if (array.length === 1) {
|
|
2354
|
+
return array[0];
|
|
2355
|
+
}
|
|
2356
|
+
return array;
|
|
2357
|
+
}
|
|
2358
|
+
|
|
2359
|
+
// node_modules/.pnpm/libphonenumber-js@1.13.7/node_modules/libphonenumber-js/es6/AsYouTypeFormatter.PatternMatcher.js
|
|
2360
|
+
function _createForOfIteratorHelperLoose6(r2, e2) {
|
|
2361
|
+
var t2 = "undefined" != typeof Symbol && r2[Symbol.iterator] || r2["@@iterator"];
|
|
2362
|
+
if (t2) return (t2 = t2.call(r2)).next.bind(t2);
|
|
2363
|
+
if (Array.isArray(r2) || (t2 = _unsupportedIterableToArray6(r2)) || e2 && r2 && "number" == typeof r2.length) {
|
|
2364
|
+
t2 && (r2 = t2);
|
|
2365
|
+
var o2 = 0;
|
|
2366
|
+
return function() {
|
|
2367
|
+
return o2 >= r2.length ? { done: true } : { done: false, value: r2[o2++] };
|
|
2368
|
+
};
|
|
2369
|
+
}
|
|
2370
|
+
throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
2371
|
+
}
|
|
2372
|
+
function _unsupportedIterableToArray6(r2, a2) {
|
|
2373
|
+
if (r2) {
|
|
2374
|
+
if ("string" == typeof r2) return _arrayLikeToArray6(r2, a2);
|
|
2375
|
+
var t2 = {}.toString.call(r2).slice(8, -1);
|
|
2376
|
+
return "Object" === t2 && r2.constructor && (t2 = r2.constructor.name), "Map" === t2 || "Set" === t2 ? Array.from(r2) : "Arguments" === t2 || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t2) ? _arrayLikeToArray6(r2, a2) : void 0;
|
|
2377
|
+
}
|
|
2378
|
+
}
|
|
2379
|
+
function _arrayLikeToArray6(r2, a2) {
|
|
2380
|
+
(null == a2 || a2 > r2.length) && (a2 = r2.length);
|
|
2381
|
+
for (var e2 = 0, n2 = Array(a2); e2 < a2; e2++) n2[e2] = r2[e2];
|
|
2382
|
+
return n2;
|
|
2383
|
+
}
|
|
2384
|
+
function _typeof5(o2) {
|
|
2385
|
+
"@babel/helpers - typeof";
|
|
2386
|
+
return _typeof5 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o3) {
|
|
2387
|
+
return typeof o3;
|
|
2388
|
+
} : function(o3) {
|
|
2389
|
+
return o3 && "function" == typeof Symbol && o3.constructor === Symbol && o3 !== Symbol.prototype ? "symbol" : typeof o3;
|
|
2390
|
+
}, _typeof5(o2);
|
|
2391
|
+
}
|
|
2392
|
+
function _classCallCheck5(a2, n2) {
|
|
2393
|
+
if (!(a2 instanceof n2)) throw new TypeError("Cannot call a class as a function");
|
|
2394
|
+
}
|
|
2395
|
+
function _defineProperties5(e2, r2) {
|
|
2396
|
+
for (var t2 = 0; t2 < r2.length; t2++) {
|
|
2397
|
+
var o2 = r2[t2];
|
|
2398
|
+
o2.enumerable = o2.enumerable || false, o2.configurable = true, "value" in o2 && (o2.writable = true), Object.defineProperty(e2, _toPropertyKey5(o2.key), o2);
|
|
2399
|
+
}
|
|
2400
|
+
}
|
|
2401
|
+
function _createClass5(e2, r2, t2) {
|
|
2402
|
+
return r2 && _defineProperties5(e2.prototype, r2), t2 && _defineProperties5(e2, t2), Object.defineProperty(e2, "prototype", { writable: false }), e2;
|
|
2403
|
+
}
|
|
2404
|
+
function _toPropertyKey5(t2) {
|
|
2405
|
+
var i2 = _toPrimitive5(t2, "string");
|
|
2406
|
+
return "symbol" == _typeof5(i2) ? i2 : i2 + "";
|
|
2407
|
+
}
|
|
2408
|
+
function _toPrimitive5(t2, r2) {
|
|
2409
|
+
if ("object" != _typeof5(t2) || !t2) return t2;
|
|
2410
|
+
var e2 = t2[Symbol.toPrimitive];
|
|
2411
|
+
if (void 0 !== e2) {
|
|
2412
|
+
var i2 = e2.call(t2, r2 || "default");
|
|
2413
|
+
if ("object" != _typeof5(i2)) return i2;
|
|
2414
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
2415
|
+
}
|
|
2416
|
+
return ("string" === r2 ? String : Number)(t2);
|
|
2417
|
+
}
|
|
2418
|
+
var PatternMatcher = /* @__PURE__ */ (function() {
|
|
2419
|
+
function PatternMatcher2(pattern) {
|
|
2420
|
+
_classCallCheck5(this, PatternMatcher2);
|
|
2421
|
+
this.matchTree = new PatternParser().parse(pattern);
|
|
2422
|
+
}
|
|
2423
|
+
return _createClass5(PatternMatcher2, [{
|
|
2424
|
+
key: "match",
|
|
2425
|
+
value: function match(string) {
|
|
2426
|
+
var _ref = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, allowOverflow = _ref.allowOverflow;
|
|
2427
|
+
if (!string) {
|
|
2428
|
+
throw new Error("String is required");
|
|
2429
|
+
}
|
|
2430
|
+
var result = _match(string.split(""), this.matchTree, true);
|
|
2431
|
+
if (result && result.match) {
|
|
2432
|
+
delete result.matchedChars;
|
|
2433
|
+
}
|
|
2434
|
+
if (result && result.overflow) {
|
|
2435
|
+
if (!allowOverflow) {
|
|
2436
|
+
return;
|
|
2437
|
+
}
|
|
2438
|
+
}
|
|
2439
|
+
return result;
|
|
2440
|
+
}
|
|
2441
|
+
}]);
|
|
2442
|
+
})();
|
|
2443
|
+
function _match(characters, tree, last) {
|
|
2444
|
+
if (typeof tree === "string") {
|
|
2445
|
+
var characterString = characters.join("");
|
|
2446
|
+
if (tree.indexOf(characterString) === 0) {
|
|
2447
|
+
if (characters.length === tree.length) {
|
|
2448
|
+
return {
|
|
2449
|
+
match: true,
|
|
2450
|
+
matchedChars: characters
|
|
2451
|
+
};
|
|
2452
|
+
}
|
|
2453
|
+
return {
|
|
2454
|
+
partialMatch: true
|
|
2455
|
+
// matchedChars: characters
|
|
2456
|
+
};
|
|
2457
|
+
}
|
|
2458
|
+
if (characterString.indexOf(tree) === 0) {
|
|
2459
|
+
if (last) {
|
|
2460
|
+
if (characters.length > tree.length) {
|
|
2461
|
+
return {
|
|
2462
|
+
overflow: true
|
|
2463
|
+
};
|
|
2464
|
+
}
|
|
2465
|
+
}
|
|
2466
|
+
return {
|
|
2467
|
+
match: true,
|
|
2468
|
+
matchedChars: characters.slice(0, tree.length)
|
|
2469
|
+
};
|
|
2470
|
+
}
|
|
2471
|
+
return;
|
|
2472
|
+
}
|
|
2473
|
+
if (Array.isArray(tree)) {
|
|
2474
|
+
var restCharacters = characters.slice();
|
|
2475
|
+
var i2 = 0;
|
|
2476
|
+
while (i2 < tree.length) {
|
|
2477
|
+
var subtree = tree[i2];
|
|
2478
|
+
var result = _match(restCharacters, subtree, last && i2 === tree.length - 1);
|
|
2479
|
+
if (!result) {
|
|
2480
|
+
return;
|
|
2481
|
+
} else if (result.overflow) {
|
|
2482
|
+
return result;
|
|
2483
|
+
} else if (result.match) {
|
|
2484
|
+
restCharacters = restCharacters.slice(result.matchedChars.length);
|
|
2485
|
+
if (restCharacters.length === 0) {
|
|
2486
|
+
if (i2 === tree.length - 1) {
|
|
2487
|
+
return {
|
|
2488
|
+
match: true,
|
|
2489
|
+
matchedChars: characters
|
|
2490
|
+
};
|
|
2491
|
+
} else {
|
|
2492
|
+
return {
|
|
2493
|
+
partialMatch: true
|
|
2494
|
+
// matchedChars: characters
|
|
2495
|
+
};
|
|
2496
|
+
}
|
|
2497
|
+
}
|
|
2498
|
+
} else {
|
|
2499
|
+
if (result.partialMatch) {
|
|
2500
|
+
return {
|
|
2501
|
+
partialMatch: true
|
|
2502
|
+
// matchedChars: characters
|
|
2503
|
+
};
|
|
2504
|
+
} else {
|
|
2505
|
+
throw new Error("Unsupported match result:\n".concat(JSON.stringify(result, null, 2)));
|
|
2506
|
+
}
|
|
2507
|
+
}
|
|
2508
|
+
i2++;
|
|
2509
|
+
}
|
|
2510
|
+
if (last) {
|
|
2511
|
+
return {
|
|
2512
|
+
overflow: true
|
|
2513
|
+
};
|
|
2514
|
+
}
|
|
2515
|
+
return {
|
|
2516
|
+
match: true,
|
|
2517
|
+
matchedChars: characters.slice(0, characters.length - restCharacters.length)
|
|
2518
|
+
};
|
|
2519
|
+
}
|
|
2520
|
+
switch (tree.op) {
|
|
2521
|
+
case "|":
|
|
2522
|
+
var partialMatch;
|
|
2523
|
+
for (var _iterator = _createForOfIteratorHelperLoose6(tree.args), _step; !(_step = _iterator()).done; ) {
|
|
2524
|
+
var branch = _step.value;
|
|
2525
|
+
var _result = _match(characters, branch, last);
|
|
2526
|
+
if (_result) {
|
|
2527
|
+
if (_result.overflow) {
|
|
2528
|
+
return _result;
|
|
2529
|
+
} else if (_result.match) {
|
|
2530
|
+
return {
|
|
2531
|
+
match: true,
|
|
2532
|
+
matchedChars: _result.matchedChars
|
|
2533
|
+
};
|
|
2534
|
+
} else {
|
|
2535
|
+
if (_result.partialMatch) {
|
|
2536
|
+
partialMatch = true;
|
|
2537
|
+
} else {
|
|
2538
|
+
throw new Error("Unsupported match result:\n".concat(JSON.stringify(_result, null, 2)));
|
|
2539
|
+
}
|
|
2540
|
+
}
|
|
2541
|
+
}
|
|
2542
|
+
}
|
|
2543
|
+
if (partialMatch) {
|
|
2544
|
+
return {
|
|
2545
|
+
partialMatch: true
|
|
2546
|
+
// matchedChars: ...
|
|
2547
|
+
};
|
|
2548
|
+
}
|
|
2549
|
+
return;
|
|
2550
|
+
case "[]":
|
|
2551
|
+
for (var _iterator2 = _createForOfIteratorHelperLoose6(tree.args), _step2; !(_step2 = _iterator2()).done; ) {
|
|
2552
|
+
var _char = _step2.value;
|
|
2553
|
+
if (characters[0] === _char) {
|
|
2554
|
+
if (characters.length === 1) {
|
|
2555
|
+
return {
|
|
2556
|
+
match: true,
|
|
2557
|
+
matchedChars: characters
|
|
2558
|
+
};
|
|
2559
|
+
}
|
|
2560
|
+
if (last) {
|
|
2561
|
+
return {
|
|
2562
|
+
overflow: true
|
|
2563
|
+
};
|
|
2564
|
+
}
|
|
2565
|
+
return {
|
|
2566
|
+
match: true,
|
|
2567
|
+
matchedChars: [_char]
|
|
2568
|
+
};
|
|
2569
|
+
}
|
|
2570
|
+
}
|
|
2571
|
+
return;
|
|
2572
|
+
/* istanbul ignore next */
|
|
2573
|
+
default:
|
|
2574
|
+
throw new Error("Unsupported instruction tree: ".concat(tree));
|
|
2575
|
+
}
|
|
2576
|
+
}
|
|
2577
|
+
|
|
2578
|
+
// node_modules/.pnpm/libphonenumber-js@1.13.7/node_modules/libphonenumber-js/es6/AsYouTypeFormatter.js
|
|
2579
|
+
function _typeof6(o2) {
|
|
2580
|
+
"@babel/helpers - typeof";
|
|
2581
|
+
return _typeof6 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o3) {
|
|
2582
|
+
return typeof o3;
|
|
2583
|
+
} : function(o3) {
|
|
2584
|
+
return o3 && "function" == typeof Symbol && o3.constructor === Symbol && o3 !== Symbol.prototype ? "symbol" : typeof o3;
|
|
2585
|
+
}, _typeof6(o2);
|
|
2586
|
+
}
|
|
2587
|
+
function _createForOfIteratorHelperLoose7(r2, e2) {
|
|
2588
|
+
var t2 = "undefined" != typeof Symbol && r2[Symbol.iterator] || r2["@@iterator"];
|
|
2589
|
+
if (t2) return (t2 = t2.call(r2)).next.bind(t2);
|
|
2590
|
+
if (Array.isArray(r2) || (t2 = _unsupportedIterableToArray7(r2)) || e2 && r2 && "number" == typeof r2.length) {
|
|
2591
|
+
t2 && (r2 = t2);
|
|
2592
|
+
var o2 = 0;
|
|
2593
|
+
return function() {
|
|
2594
|
+
return o2 >= r2.length ? { done: true } : { done: false, value: r2[o2++] };
|
|
2595
|
+
};
|
|
2596
|
+
}
|
|
2597
|
+
throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
2598
|
+
}
|
|
2599
|
+
function _unsupportedIterableToArray7(r2, a2) {
|
|
2600
|
+
if (r2) {
|
|
2601
|
+
if ("string" == typeof r2) return _arrayLikeToArray7(r2, a2);
|
|
2602
|
+
var t2 = {}.toString.call(r2).slice(8, -1);
|
|
2603
|
+
return "Object" === t2 && r2.constructor && (t2 = r2.constructor.name), "Map" === t2 || "Set" === t2 ? Array.from(r2) : "Arguments" === t2 || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t2) ? _arrayLikeToArray7(r2, a2) : void 0;
|
|
2604
|
+
}
|
|
2605
|
+
}
|
|
2606
|
+
function _arrayLikeToArray7(r2, a2) {
|
|
2607
|
+
(null == a2 || a2 > r2.length) && (a2 = r2.length);
|
|
2608
|
+
for (var e2 = 0, n2 = Array(a2); e2 < a2; e2++) n2[e2] = r2[e2];
|
|
2609
|
+
return n2;
|
|
2610
|
+
}
|
|
2611
|
+
function _classCallCheck6(a2, n2) {
|
|
2612
|
+
if (!(a2 instanceof n2)) throw new TypeError("Cannot call a class as a function");
|
|
2613
|
+
}
|
|
2614
|
+
function _defineProperties6(e2, r2) {
|
|
2615
|
+
for (var t2 = 0; t2 < r2.length; t2++) {
|
|
2616
|
+
var o2 = r2[t2];
|
|
2617
|
+
o2.enumerable = o2.enumerable || false, o2.configurable = true, "value" in o2 && (o2.writable = true), Object.defineProperty(e2, _toPropertyKey6(o2.key), o2);
|
|
2618
|
+
}
|
|
2619
|
+
}
|
|
2620
|
+
function _createClass6(e2, r2, t2) {
|
|
2621
|
+
return r2 && _defineProperties6(e2.prototype, r2), t2 && _defineProperties6(e2, t2), Object.defineProperty(e2, "prototype", { writable: false }), e2;
|
|
2622
|
+
}
|
|
2623
|
+
function _toPropertyKey6(t2) {
|
|
2624
|
+
var i2 = _toPrimitive6(t2, "string");
|
|
2625
|
+
return "symbol" == _typeof6(i2) ? i2 : i2 + "";
|
|
2626
|
+
}
|
|
2627
|
+
function _toPrimitive6(t2, r2) {
|
|
2628
|
+
if ("object" != _typeof6(t2) || !t2) return t2;
|
|
2629
|
+
var e2 = t2[Symbol.toPrimitive];
|
|
2630
|
+
if (void 0 !== e2) {
|
|
2631
|
+
var i2 = e2.call(t2, r2 || "default");
|
|
2632
|
+
if ("object" != _typeof6(i2)) return i2;
|
|
2633
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
2634
|
+
}
|
|
2635
|
+
return ("string" === r2 ? String : Number)(t2);
|
|
2636
|
+
}
|
|
2637
|
+
var DUMMY_DIGIT = "9";
|
|
2638
|
+
var LONGEST_NATIONAL_PHONE_NUMBER_LENGTH = 15;
|
|
2639
|
+
var LONGEST_DUMMY_PHONE_NUMBER = repeat(DUMMY_DIGIT, LONGEST_NATIONAL_PHONE_NUMBER_LENGTH);
|
|
2640
|
+
var NATIONAL_PREFIX_SEPARATORS_PATTERN = /[- ]/;
|
|
2641
|
+
var SUPPORT_LEGACY_FORMATTING_PATTERNS = true;
|
|
2642
|
+
var CREATE_CHARACTER_CLASS_PATTERN = SUPPORT_LEGACY_FORMATTING_PATTERNS && function() {
|
|
2643
|
+
return /\[([^\[\]])*\]/g;
|
|
2644
|
+
};
|
|
2645
|
+
var CREATE_STANDALONE_DIGIT_PATTERN = SUPPORT_LEGACY_FORMATTING_PATTERNS && function() {
|
|
2646
|
+
return /\d(?=[^,}][^,}])/g;
|
|
2647
|
+
};
|
|
2648
|
+
var NON_ALTERING_FORMAT_REG_EXP = new RegExp("[" + VALID_PUNCTUATION + "]*\\$1[" + VALID_PUNCTUATION + "]*(\\$\\d[" + VALID_PUNCTUATION + "]*)*$");
|
|
2649
|
+
var MIN_LEADING_DIGITS_LENGTH = 3;
|
|
2650
|
+
var AsYouTypeFormatter = /* @__PURE__ */ (function() {
|
|
2651
|
+
function AsYouTypeFormatter2(_ref) {
|
|
2652
|
+
var state = _ref.state, metadata = _ref.metadata;
|
|
2653
|
+
_classCallCheck6(this, AsYouTypeFormatter2);
|
|
2654
|
+
this.metadata = metadata;
|
|
2655
|
+
this.resetFormat();
|
|
2656
|
+
}
|
|
2657
|
+
return _createClass6(AsYouTypeFormatter2, [{
|
|
2658
|
+
key: "resetFormat",
|
|
2659
|
+
value: function resetFormat() {
|
|
2660
|
+
this.chosenFormat = void 0;
|
|
2661
|
+
this.template = void 0;
|
|
2662
|
+
this.nationalNumberTemplate = void 0;
|
|
2663
|
+
this.populatedNationalNumberTemplate = void 0;
|
|
2664
|
+
this.populatedNationalNumberTemplatePosition = -1;
|
|
2665
|
+
}
|
|
2666
|
+
}, {
|
|
2667
|
+
key: "reset",
|
|
2668
|
+
value: function reset(numberingPlan, state) {
|
|
2669
|
+
this.resetFormat();
|
|
2670
|
+
if (numberingPlan) {
|
|
2671
|
+
this.isNANP = numberingPlan.callingCode() === "1";
|
|
2672
|
+
this.matchingFormats = numberingPlan.formats();
|
|
2673
|
+
if (state.nationalSignificantNumber) {
|
|
2674
|
+
this.narrowDownMatchingFormats(state);
|
|
2675
|
+
}
|
|
2676
|
+
} else {
|
|
2677
|
+
this.isNANP = void 0;
|
|
2678
|
+
this.matchingFormats = [];
|
|
2679
|
+
}
|
|
2680
|
+
}
|
|
2681
|
+
/**
|
|
2682
|
+
* Formats an updated phone number.
|
|
2683
|
+
* @param {string} nextDigits — Additional phone number digits.
|
|
2684
|
+
* @param {object} state — `AsYouType` state.
|
|
2685
|
+
* @return {[string]} Returns undefined if the updated phone number can't be formatted using any of the available formats.
|
|
2686
|
+
*/
|
|
2687
|
+
}, {
|
|
2688
|
+
key: "format",
|
|
2689
|
+
value: function format2(nextDigits, state) {
|
|
2690
|
+
var _this = this;
|
|
2691
|
+
if (canFormatCompleteNumber(state.nationalSignificantNumber, this.metadata)) {
|
|
2692
|
+
for (var _iterator = _createForOfIteratorHelperLoose7(this.matchingFormats), _step; !(_step = _iterator()).done; ) {
|
|
2693
|
+
var _format = _step.value;
|
|
2694
|
+
var formattedCompleteNumber = formatCompleteNumber(state, _format, {
|
|
2695
|
+
metadata: this.metadata,
|
|
2696
|
+
shouldTryNationalPrefixFormattingRule: function shouldTryNationalPrefixFormattingRule(format3) {
|
|
2697
|
+
return _this.shouldTryNationalPrefixFormattingRule(format3, {
|
|
2698
|
+
international: state.international,
|
|
2699
|
+
nationalPrefix: state.nationalPrefix
|
|
2700
|
+
});
|
|
2701
|
+
},
|
|
2702
|
+
getSeparatorAfterNationalPrefix: function getSeparatorAfterNationalPrefix(format3) {
|
|
2703
|
+
return _this.getSeparatorAfterNationalPrefix(format3);
|
|
2704
|
+
}
|
|
2705
|
+
});
|
|
2706
|
+
if (formattedCompleteNumber) {
|
|
2707
|
+
this.resetFormat();
|
|
2708
|
+
this.chosenFormat = _format;
|
|
2709
|
+
this.setNationalNumberTemplate(formattedCompleteNumber.replace(/\d/g, DIGIT_PLACEHOLDER), state);
|
|
2710
|
+
this.populatedNationalNumberTemplate = formattedCompleteNumber;
|
|
2711
|
+
this.populatedNationalNumberTemplatePosition = this.template.lastIndexOf(DIGIT_PLACEHOLDER);
|
|
2712
|
+
return formattedCompleteNumber;
|
|
2713
|
+
}
|
|
2714
|
+
}
|
|
2715
|
+
}
|
|
2716
|
+
return this.formatNationalNumberWithNextDigits(nextDigits, state);
|
|
2717
|
+
}
|
|
2718
|
+
// Formats the next phone number digits.
|
|
2719
|
+
}, {
|
|
2720
|
+
key: "formatNationalNumberWithNextDigits",
|
|
2721
|
+
value: function formatNationalNumberWithNextDigits(nextDigits, state) {
|
|
2722
|
+
var previouslyChosenFormat = this.chosenFormat;
|
|
2723
|
+
var newlyChosenFormat = this.chooseFormat(state);
|
|
2724
|
+
if (newlyChosenFormat) {
|
|
2725
|
+
if (newlyChosenFormat === previouslyChosenFormat) {
|
|
2726
|
+
return this.formatNextNationalNumberDigits(nextDigits);
|
|
2727
|
+
} else {
|
|
2728
|
+
return this.formatNextNationalNumberDigits(state.getNationalDigits());
|
|
2729
|
+
}
|
|
2730
|
+
}
|
|
2731
|
+
}
|
|
2732
|
+
}, {
|
|
2733
|
+
key: "narrowDownMatchingFormats",
|
|
2734
|
+
value: function narrowDownMatchingFormats(_ref2) {
|
|
2735
|
+
var _this2 = this;
|
|
2736
|
+
var nationalSignificantNumber = _ref2.nationalSignificantNumber, nationalPrefix = _ref2.nationalPrefix, international = _ref2.international;
|
|
2737
|
+
var leadingDigits = nationalSignificantNumber;
|
|
2738
|
+
var leadingDigitsPatternIndex = leadingDigits.length - MIN_LEADING_DIGITS_LENGTH;
|
|
2739
|
+
if (leadingDigitsPatternIndex < 0) {
|
|
2740
|
+
leadingDigitsPatternIndex = 0;
|
|
2741
|
+
}
|
|
2742
|
+
this.matchingFormats = this.matchingFormats.filter(function(format2) {
|
|
2743
|
+
return _this2.formatSuits(format2, international, nationalPrefix) && _this2.formatMatches(format2, leadingDigits, leadingDigitsPatternIndex);
|
|
2744
|
+
});
|
|
2745
|
+
if (this.chosenFormat && this.matchingFormats.indexOf(this.chosenFormat) === -1) {
|
|
2746
|
+
this.resetFormat();
|
|
2747
|
+
}
|
|
2748
|
+
}
|
|
2749
|
+
}, {
|
|
2750
|
+
key: "formatSuits",
|
|
2751
|
+
value: function formatSuits(format2, international, nationalPrefix) {
|
|
2752
|
+
if (nationalPrefix && !format2.usesNationalPrefix() && // !format.domesticCarrierCodeFormattingRule() &&
|
|
2753
|
+
!format2.nationalPrefixIsOptionalWhenFormattingInNationalFormat()) {
|
|
2754
|
+
return false;
|
|
2755
|
+
}
|
|
2756
|
+
if (!international && !nationalPrefix && format2.nationalPrefixIsMandatoryWhenFormattingInNationalFormat()) {
|
|
2757
|
+
return false;
|
|
2758
|
+
}
|
|
2759
|
+
return true;
|
|
2760
|
+
}
|
|
2761
|
+
}, {
|
|
2762
|
+
key: "formatMatches",
|
|
2763
|
+
value: function formatMatches(format2, leadingDigits, leadingDigitsPatternIndex) {
|
|
2764
|
+
var leadingDigitsPatternsCount = format2.leadingDigitsPatterns().length;
|
|
2765
|
+
if (leadingDigitsPatternsCount === 0) {
|
|
2766
|
+
return true;
|
|
2767
|
+
}
|
|
2768
|
+
leadingDigitsPatternIndex = Math.min(leadingDigitsPatternIndex, leadingDigitsPatternsCount - 1);
|
|
2769
|
+
var leadingDigitsPattern = format2.leadingDigitsPatterns()[leadingDigitsPatternIndex];
|
|
2770
|
+
if (leadingDigits.length < MIN_LEADING_DIGITS_LENGTH) {
|
|
2771
|
+
try {
|
|
2772
|
+
return new PatternMatcher(leadingDigitsPattern).match(leadingDigits, {
|
|
2773
|
+
allowOverflow: true
|
|
2774
|
+
}) !== void 0;
|
|
2775
|
+
} catch (error) {
|
|
2776
|
+
console.error(error);
|
|
2777
|
+
return true;
|
|
2778
|
+
}
|
|
2779
|
+
}
|
|
2780
|
+
return new RegExp("^(".concat(leadingDigitsPattern, ")")).test(leadingDigits);
|
|
2781
|
+
}
|
|
2782
|
+
}, {
|
|
2783
|
+
key: "getFormatFormat",
|
|
2784
|
+
value: function getFormatFormat(format2, international) {
|
|
2785
|
+
return international ? format2.internationalFormat() : format2.format();
|
|
2786
|
+
}
|
|
2787
|
+
}, {
|
|
2788
|
+
key: "chooseFormat",
|
|
2789
|
+
value: function chooseFormat(state) {
|
|
2790
|
+
var _this3 = this;
|
|
2791
|
+
var _loop = function _loop2() {
|
|
2792
|
+
var format2 = _step2.value;
|
|
2793
|
+
if (_this3.chosenFormat === format2) {
|
|
2794
|
+
return 0;
|
|
2795
|
+
}
|
|
2796
|
+
if (!NON_ALTERING_FORMAT_REG_EXP.test(_this3.getFormatFormat(format2, state.international))) {
|
|
2797
|
+
return 1;
|
|
2798
|
+
}
|
|
2799
|
+
if (!_this3.createTemplateForFormat(format2, state)) {
|
|
2800
|
+
_this3.matchingFormats = _this3.matchingFormats.filter(function(_) {
|
|
2801
|
+
return _ !== format2;
|
|
2802
|
+
});
|
|
2803
|
+
return 1;
|
|
2804
|
+
}
|
|
2805
|
+
_this3.chosenFormat = format2;
|
|
2806
|
+
return 0;
|
|
2807
|
+
}, _ret;
|
|
2808
|
+
for (var _iterator2 = _createForOfIteratorHelperLoose7(this.matchingFormats.slice()), _step2; !(_step2 = _iterator2()).done; ) {
|
|
2809
|
+
_ret = _loop();
|
|
2810
|
+
if (_ret === 0) break;
|
|
2811
|
+
if (_ret === 1) continue;
|
|
2812
|
+
}
|
|
2813
|
+
if (!this.chosenFormat) {
|
|
2814
|
+
this.resetFormat();
|
|
2815
|
+
}
|
|
2816
|
+
return this.chosenFormat;
|
|
2817
|
+
}
|
|
2818
|
+
}, {
|
|
2819
|
+
key: "createTemplateForFormat",
|
|
2820
|
+
value: function createTemplateForFormat(format2, state) {
|
|
2821
|
+
if (SUPPORT_LEGACY_FORMATTING_PATTERNS && format2.pattern().indexOf("|") >= 0) {
|
|
2822
|
+
return;
|
|
2823
|
+
}
|
|
2824
|
+
var template = this.getTemplateForFormat(format2, state);
|
|
2825
|
+
if (template) {
|
|
2826
|
+
this.setNationalNumberTemplate(template, state);
|
|
2827
|
+
return true;
|
|
2828
|
+
}
|
|
2829
|
+
}
|
|
2830
|
+
}, {
|
|
2831
|
+
key: "getSeparatorAfterNationalPrefix",
|
|
2832
|
+
value: function getSeparatorAfterNationalPrefix(format2) {
|
|
2833
|
+
if (this.isNANP) {
|
|
2834
|
+
return " ";
|
|
2835
|
+
}
|
|
2836
|
+
if (format2 && format2.nationalPrefixFormattingRule() && NATIONAL_PREFIX_SEPARATORS_PATTERN.test(format2.nationalPrefixFormattingRule())) {
|
|
2837
|
+
return " ";
|
|
2838
|
+
}
|
|
2839
|
+
return "";
|
|
2840
|
+
}
|
|
2841
|
+
}, {
|
|
2842
|
+
key: "getInternationalPrefixBeforeCountryCallingCode",
|
|
2843
|
+
value: function getInternationalPrefixBeforeCountryCallingCode(_ref3, options) {
|
|
2844
|
+
var IDDPrefix = _ref3.IDDPrefix, missingPlus = _ref3.missingPlus;
|
|
2845
|
+
if (IDDPrefix) {
|
|
2846
|
+
return options && options.spacing === false ? IDDPrefix : IDDPrefix + " ";
|
|
2847
|
+
}
|
|
2848
|
+
if (missingPlus) {
|
|
2849
|
+
return "";
|
|
2850
|
+
}
|
|
2851
|
+
return "+";
|
|
2852
|
+
}
|
|
2853
|
+
}, {
|
|
2854
|
+
key: "getTemplate",
|
|
2855
|
+
value: function getTemplate(state) {
|
|
2856
|
+
if (!this.template) {
|
|
2857
|
+
return;
|
|
2858
|
+
}
|
|
2859
|
+
var index = -1;
|
|
2860
|
+
var i2 = 0;
|
|
2861
|
+
var internationalPrefix = state.international ? this.getInternationalPrefixBeforeCountryCallingCode(state, {
|
|
2862
|
+
spacing: false
|
|
2863
|
+
}) : "";
|
|
2864
|
+
while (i2 < internationalPrefix.length + state.getDigitsWithoutInternationalPrefix().length) {
|
|
2865
|
+
index = this.template.indexOf(DIGIT_PLACEHOLDER, index + 1);
|
|
2866
|
+
i2++;
|
|
2867
|
+
}
|
|
2868
|
+
return cutAndStripNonPairedParens(this.template, index + 1);
|
|
2869
|
+
}
|
|
2870
|
+
}, {
|
|
2871
|
+
key: "setNationalNumberTemplate",
|
|
2872
|
+
value: function setNationalNumberTemplate(template, state) {
|
|
2873
|
+
this.nationalNumberTemplate = template;
|
|
2874
|
+
this.populatedNationalNumberTemplate = template;
|
|
2875
|
+
this.populatedNationalNumberTemplatePosition = -1;
|
|
2876
|
+
if (state.international) {
|
|
2877
|
+
this.template = this.getInternationalPrefixBeforeCountryCallingCode(state).replace(/[\d\+]/g, DIGIT_PLACEHOLDER) + repeat(DIGIT_PLACEHOLDER, state.callingCode.length) + " " + template;
|
|
2878
|
+
} else {
|
|
2879
|
+
this.template = template;
|
|
2880
|
+
}
|
|
2881
|
+
}
|
|
2882
|
+
/**
|
|
2883
|
+
* Generates formatting template for a national phone number,
|
|
2884
|
+
* optionally containing a national prefix, for a format.
|
|
2885
|
+
* @param {Format} format
|
|
2886
|
+
* @param {string} nationalPrefix
|
|
2887
|
+
* @return {string}
|
|
2888
|
+
*/
|
|
2889
|
+
}, {
|
|
2890
|
+
key: "getTemplateForFormat",
|
|
2891
|
+
value: function getTemplateForFormat(format2, _ref4) {
|
|
2892
|
+
var nationalSignificantNumber = _ref4.nationalSignificantNumber, international = _ref4.international, nationalPrefix = _ref4.nationalPrefix, prefixBeforeNationalSignificantNumberThatIsNotNationalPrefix = _ref4.prefixBeforeNationalSignificantNumberThatIsNotNationalPrefix;
|
|
2893
|
+
var pattern = format2.pattern();
|
|
2894
|
+
if (SUPPORT_LEGACY_FORMATTING_PATTERNS) {
|
|
2895
|
+
pattern = pattern.replace(CREATE_CHARACTER_CLASS_PATTERN(), "\\d").replace(CREATE_STANDALONE_DIGIT_PATTERN(), "\\d");
|
|
2896
|
+
}
|
|
2897
|
+
var digits = LONGEST_DUMMY_PHONE_NUMBER.match(pattern)[0];
|
|
2898
|
+
if (nationalSignificantNumber.length > digits.length) {
|
|
2899
|
+
return;
|
|
2900
|
+
}
|
|
2901
|
+
var strictPattern = new RegExp("^" + pattern + "$");
|
|
2902
|
+
var nationalNumberDummyDigits = nationalSignificantNumber.replace(/\d/g, DUMMY_DIGIT);
|
|
2903
|
+
if (strictPattern.test(nationalNumberDummyDigits)) {
|
|
2904
|
+
digits = nationalNumberDummyDigits;
|
|
2905
|
+
}
|
|
2906
|
+
var numberFormat = this.getFormatFormat(format2, international);
|
|
2907
|
+
var nationalPrefixIncludedInTemplate;
|
|
2908
|
+
if (this.shouldTryNationalPrefixFormattingRule(format2, {
|
|
2909
|
+
international,
|
|
2910
|
+
nationalPrefix
|
|
2911
|
+
})) {
|
|
2912
|
+
var numberFormatWithNationalPrefix = numberFormat.replace(FIRST_GROUP_PATTERN, format2.nationalPrefixFormattingRule());
|
|
2913
|
+
if (parseDigits(format2.nationalPrefixFormattingRule()) === (nationalPrefix || "") + parseDigits("$1")) {
|
|
2914
|
+
numberFormat = numberFormatWithNationalPrefix;
|
|
2915
|
+
nationalPrefixIncludedInTemplate = true;
|
|
2916
|
+
if (nationalPrefix) {
|
|
2917
|
+
var i2 = nationalPrefix.length;
|
|
2918
|
+
while (i2 > 0) {
|
|
2919
|
+
numberFormat = numberFormat.replace(/\d/, DIGIT_PLACEHOLDER);
|
|
2920
|
+
i2--;
|
|
2921
|
+
}
|
|
2922
|
+
}
|
|
2923
|
+
}
|
|
2924
|
+
}
|
|
2925
|
+
var template = digits.replace(new RegExp(pattern), numberFormat).replace(new RegExp(DUMMY_DIGIT, "g"), DIGIT_PLACEHOLDER);
|
|
2926
|
+
if (!nationalPrefixIncludedInTemplate) {
|
|
2927
|
+
if (prefixBeforeNationalSignificantNumberThatIsNotNationalPrefix) {
|
|
2928
|
+
template = repeat(DIGIT_PLACEHOLDER, prefixBeforeNationalSignificantNumberThatIsNotNationalPrefix.length) + " " + template;
|
|
2929
|
+
} else if (nationalPrefix) {
|
|
2930
|
+
template = repeat(DIGIT_PLACEHOLDER, nationalPrefix.length) + this.getSeparatorAfterNationalPrefix(format2) + template;
|
|
2931
|
+
}
|
|
2932
|
+
}
|
|
2933
|
+
if (international) {
|
|
2934
|
+
template = applyInternationalSeparatorStyle(template);
|
|
2935
|
+
}
|
|
2936
|
+
return template;
|
|
2937
|
+
}
|
|
2938
|
+
}, {
|
|
2939
|
+
key: "formatNextNationalNumberDigits",
|
|
2940
|
+
value: function formatNextNationalNumberDigits(digits) {
|
|
2941
|
+
var result = populateTemplateWithDigits(this.populatedNationalNumberTemplate, this.populatedNationalNumberTemplatePosition, digits);
|
|
2942
|
+
if (!result) {
|
|
2943
|
+
this.resetFormat();
|
|
2944
|
+
return;
|
|
2945
|
+
}
|
|
2946
|
+
this.populatedNationalNumberTemplate = result[0];
|
|
2947
|
+
this.populatedNationalNumberTemplatePosition = result[1];
|
|
2948
|
+
return cutAndStripNonPairedParens(this.populatedNationalNumberTemplate, this.populatedNationalNumberTemplatePosition + 1);
|
|
2949
|
+
}
|
|
2950
|
+
}, {
|
|
2951
|
+
key: "shouldTryNationalPrefixFormattingRule",
|
|
2952
|
+
value: function shouldTryNationalPrefixFormattingRule(format2, _ref5) {
|
|
2953
|
+
var international = _ref5.international, nationalPrefix = _ref5.nationalPrefix;
|
|
2954
|
+
if (format2.nationalPrefixFormattingRule()) {
|
|
2955
|
+
var usesNationalPrefix = format2.usesNationalPrefix();
|
|
2956
|
+
if (usesNationalPrefix && nationalPrefix || !usesNationalPrefix && !international) {
|
|
2957
|
+
return true;
|
|
2958
|
+
}
|
|
2959
|
+
}
|
|
2960
|
+
}
|
|
2961
|
+
}]);
|
|
2962
|
+
})();
|
|
2963
|
+
|
|
2964
|
+
// node_modules/.pnpm/libphonenumber-js@1.13.7/node_modules/libphonenumber-js/es6/AsYouTypeParser.js
|
|
2965
|
+
function _typeof7(o2) {
|
|
2966
|
+
"@babel/helpers - typeof";
|
|
2967
|
+
return _typeof7 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o3) {
|
|
2968
|
+
return typeof o3;
|
|
2969
|
+
} : function(o3) {
|
|
2970
|
+
return o3 && "function" == typeof Symbol && o3.constructor === Symbol && o3 !== Symbol.prototype ? "symbol" : typeof o3;
|
|
2971
|
+
}, _typeof7(o2);
|
|
2972
|
+
}
|
|
2973
|
+
function _slicedToArray(r2, e2) {
|
|
2974
|
+
return _arrayWithHoles(r2) || _iterableToArrayLimit(r2, e2) || _unsupportedIterableToArray8(r2, e2) || _nonIterableRest();
|
|
2975
|
+
}
|
|
2976
|
+
function _nonIterableRest() {
|
|
2977
|
+
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
2978
|
+
}
|
|
2979
|
+
function _unsupportedIterableToArray8(r2, a2) {
|
|
2980
|
+
if (r2) {
|
|
2981
|
+
if ("string" == typeof r2) return _arrayLikeToArray8(r2, a2);
|
|
2982
|
+
var t2 = {}.toString.call(r2).slice(8, -1);
|
|
2983
|
+
return "Object" === t2 && r2.constructor && (t2 = r2.constructor.name), "Map" === t2 || "Set" === t2 ? Array.from(r2) : "Arguments" === t2 || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t2) ? _arrayLikeToArray8(r2, a2) : void 0;
|
|
2984
|
+
}
|
|
2985
|
+
}
|
|
2986
|
+
function _arrayLikeToArray8(r2, a2) {
|
|
2987
|
+
(null == a2 || a2 > r2.length) && (a2 = r2.length);
|
|
2988
|
+
for (var e2 = 0, n2 = Array(a2); e2 < a2; e2++) n2[e2] = r2[e2];
|
|
2989
|
+
return n2;
|
|
2990
|
+
}
|
|
2991
|
+
function _iterableToArrayLimit(r2, l2) {
|
|
2992
|
+
var t2 = null == r2 ? null : "undefined" != typeof Symbol && r2[Symbol.iterator] || r2["@@iterator"];
|
|
2993
|
+
if (null != t2) {
|
|
2994
|
+
var e2, n2, i2, u2, a2 = [], f2 = true, o2 = false;
|
|
2995
|
+
try {
|
|
2996
|
+
if (i2 = (t2 = t2.call(r2)).next, 0 === l2) {
|
|
2997
|
+
if (Object(t2) !== t2) return;
|
|
2998
|
+
f2 = false;
|
|
2999
|
+
} else for (; !(f2 = (e2 = i2.call(t2)).done) && (a2.push(e2.value), a2.length !== l2); f2 = true) ;
|
|
3000
|
+
} catch (r3) {
|
|
3001
|
+
o2 = true, n2 = r3;
|
|
3002
|
+
} finally {
|
|
3003
|
+
try {
|
|
3004
|
+
if (!f2 && null != t2["return"] && (u2 = t2["return"](), Object(u2) !== u2)) return;
|
|
3005
|
+
} finally {
|
|
3006
|
+
if (o2) throw n2;
|
|
3007
|
+
}
|
|
3008
|
+
}
|
|
3009
|
+
return a2;
|
|
3010
|
+
}
|
|
3011
|
+
}
|
|
3012
|
+
function _arrayWithHoles(r2) {
|
|
3013
|
+
if (Array.isArray(r2)) return r2;
|
|
3014
|
+
}
|
|
3015
|
+
function _classCallCheck7(a2, n2) {
|
|
3016
|
+
if (!(a2 instanceof n2)) throw new TypeError("Cannot call a class as a function");
|
|
3017
|
+
}
|
|
3018
|
+
function _defineProperties7(e2, r2) {
|
|
3019
|
+
for (var t2 = 0; t2 < r2.length; t2++) {
|
|
3020
|
+
var o2 = r2[t2];
|
|
3021
|
+
o2.enumerable = o2.enumerable || false, o2.configurable = true, "value" in o2 && (o2.writable = true), Object.defineProperty(e2, _toPropertyKey7(o2.key), o2);
|
|
3022
|
+
}
|
|
3023
|
+
}
|
|
3024
|
+
function _createClass7(e2, r2, t2) {
|
|
3025
|
+
return r2 && _defineProperties7(e2.prototype, r2), t2 && _defineProperties7(e2, t2), Object.defineProperty(e2, "prototype", { writable: false }), e2;
|
|
3026
|
+
}
|
|
3027
|
+
function _toPropertyKey7(t2) {
|
|
3028
|
+
var i2 = _toPrimitive7(t2, "string");
|
|
3029
|
+
return "symbol" == _typeof7(i2) ? i2 : i2 + "";
|
|
3030
|
+
}
|
|
3031
|
+
function _toPrimitive7(t2, r2) {
|
|
3032
|
+
if ("object" != _typeof7(t2) || !t2) return t2;
|
|
3033
|
+
var e2 = t2[Symbol.toPrimitive];
|
|
3034
|
+
if (void 0 !== e2) {
|
|
3035
|
+
var i2 = e2.call(t2, r2 || "default");
|
|
3036
|
+
if ("object" != _typeof7(i2)) return i2;
|
|
3037
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
3038
|
+
}
|
|
3039
|
+
return ("string" === r2 ? String : Number)(t2);
|
|
3040
|
+
}
|
|
3041
|
+
var VALID_FORMATTED_PHONE_NUMBER_DIGITS_PART = "[" + VALID_PUNCTUATION + VALID_DIGITS + "]+";
|
|
3042
|
+
var VALID_FORMATTED_PHONE_NUMBER_DIGITS_PART_PATTERN = new RegExp("^" + VALID_FORMATTED_PHONE_NUMBER_DIGITS_PART + "$", "i");
|
|
3043
|
+
var VALID_FORMATTED_PHONE_NUMBER_PART = "(?:[" + PLUS_CHARS + "][" + VALID_PUNCTUATION + VALID_DIGITS + "]*|[" + VALID_PUNCTUATION + VALID_DIGITS + "]+)";
|
|
3044
|
+
var AFTER_PHONE_NUMBER_DIGITS_END_PATTERN = new RegExp("[^" + VALID_PUNCTUATION + VALID_DIGITS + "]+.*$");
|
|
3045
|
+
var COMPLEX_NATIONAL_PREFIX = /[^\d\[\]]/;
|
|
3046
|
+
var AsYouTypeParser = /* @__PURE__ */ (function() {
|
|
3047
|
+
function AsYouTypeParser2(_ref) {
|
|
3048
|
+
var defaultCountry = _ref.defaultCountry, defaultCallingCode = _ref.defaultCallingCode, metadata = _ref.metadata, onNationalSignificantNumberChange = _ref.onNationalSignificantNumberChange;
|
|
3049
|
+
_classCallCheck7(this, AsYouTypeParser2);
|
|
3050
|
+
this.defaultCountry = defaultCountry;
|
|
3051
|
+
this.defaultCallingCode = defaultCallingCode;
|
|
3052
|
+
this.metadata = metadata;
|
|
3053
|
+
this.onNationalSignificantNumberChange = onNationalSignificantNumberChange;
|
|
3054
|
+
}
|
|
3055
|
+
return _createClass7(AsYouTypeParser2, [{
|
|
3056
|
+
key: "input",
|
|
3057
|
+
value: function input(text, state) {
|
|
3058
|
+
var _extractFormattedDigi = extractFormattedDigitsAndPlus(text), _extractFormattedDigi2 = _slicedToArray(_extractFormattedDigi, 2), formattedDigits = _extractFormattedDigi2[0], hasPlus = _extractFormattedDigi2[1];
|
|
3059
|
+
var digits = parseDigits(formattedDigits);
|
|
3060
|
+
var justLeadingPlus;
|
|
3061
|
+
if (hasPlus) {
|
|
3062
|
+
if (!state.digits) {
|
|
3063
|
+
state.startInternationalNumber(void 0, void 0);
|
|
3064
|
+
if (!digits) {
|
|
3065
|
+
justLeadingPlus = true;
|
|
3066
|
+
}
|
|
3067
|
+
}
|
|
3068
|
+
}
|
|
3069
|
+
if (digits) {
|
|
3070
|
+
this.inputDigits(digits, state);
|
|
3071
|
+
}
|
|
3072
|
+
return {
|
|
3073
|
+
digits,
|
|
3074
|
+
justLeadingPlus
|
|
3075
|
+
};
|
|
3076
|
+
}
|
|
3077
|
+
/**
|
|
3078
|
+
* Inputs "next" phone number digits.
|
|
3079
|
+
* @param {string} digits
|
|
3080
|
+
* @return {string} [formattedNumber] Formatted national phone number (if it can be formatted at this stage). Returning `undefined` means "don't format the national phone number at this stage".
|
|
3081
|
+
*/
|
|
3082
|
+
}, {
|
|
3083
|
+
key: "inputDigits",
|
|
3084
|
+
value: function inputDigits(nextDigits, state) {
|
|
3085
|
+
var digits = state.digits;
|
|
3086
|
+
var hasReceivedThreeLeadingDigits = digits.length < 3 && digits.length + nextDigits.length >= 3;
|
|
3087
|
+
state.appendDigits(nextDigits);
|
|
3088
|
+
if (hasReceivedThreeLeadingDigits) {
|
|
3089
|
+
this.extractIddPrefix(state);
|
|
3090
|
+
}
|
|
3091
|
+
if (this.isWaitingForCountryCallingCode(state)) {
|
|
3092
|
+
if (!this.extractCountryCallingCode(state)) {
|
|
3093
|
+
return;
|
|
3094
|
+
}
|
|
3095
|
+
} else {
|
|
3096
|
+
state.appendNationalSignificantNumberDigits(nextDigits);
|
|
3097
|
+
}
|
|
3098
|
+
if (!state.international) {
|
|
3099
|
+
if (!this.hasExtractedNationalSignificantNumber) {
|
|
3100
|
+
this.extractNationalSignificantNumber(state.getNationalDigits(), function(stateUpdate) {
|
|
3101
|
+
return state.update(stateUpdate);
|
|
3102
|
+
});
|
|
3103
|
+
}
|
|
3104
|
+
}
|
|
3105
|
+
}
|
|
3106
|
+
}, {
|
|
3107
|
+
key: "isWaitingForCountryCallingCode",
|
|
3108
|
+
value: function isWaitingForCountryCallingCode(_ref2) {
|
|
3109
|
+
var international = _ref2.international, callingCode = _ref2.callingCode;
|
|
3110
|
+
return international && !callingCode;
|
|
3111
|
+
}
|
|
3112
|
+
// Extracts a country calling code from a number
|
|
3113
|
+
// being entered in internatonal format.
|
|
3114
|
+
}, {
|
|
3115
|
+
key: "extractCountryCallingCode",
|
|
3116
|
+
value: function extractCountryCallingCode2(state) {
|
|
3117
|
+
var _extractCountryCallin = extractCountryCallingCode("+" + state.getDigitsWithoutInternationalPrefix(), state.country, this.defaultCountry, this.defaultCallingCode, this.metadata.metadata), countryCallingCode = _extractCountryCallin.countryCallingCode, number = _extractCountryCallin.number;
|
|
3118
|
+
if (countryCallingCode) {
|
|
3119
|
+
state.setCallingCode(countryCallingCode);
|
|
3120
|
+
state.update({
|
|
3121
|
+
nationalSignificantNumber: number
|
|
3122
|
+
});
|
|
3123
|
+
return true;
|
|
3124
|
+
}
|
|
3125
|
+
}
|
|
3126
|
+
}, {
|
|
3127
|
+
key: "reset",
|
|
3128
|
+
value: function reset(numberingPlan) {
|
|
3129
|
+
if (numberingPlan) {
|
|
3130
|
+
this.hasSelectedNumberingPlan = true;
|
|
3131
|
+
var nationalPrefixForParsing = numberingPlan._nationalPrefixForParsing();
|
|
3132
|
+
this.couldPossiblyExtractAnotherNationalSignificantNumber = nationalPrefixForParsing && COMPLEX_NATIONAL_PREFIX.test(nationalPrefixForParsing);
|
|
3133
|
+
} else {
|
|
3134
|
+
this.hasSelectedNumberingPlan = void 0;
|
|
3135
|
+
this.couldPossiblyExtractAnotherNationalSignificantNumber = void 0;
|
|
3136
|
+
}
|
|
3137
|
+
}
|
|
3138
|
+
/**
|
|
3139
|
+
* Extracts a national (significant) number from user input.
|
|
3140
|
+
* Google's library is different in that it only applies `national_prefix_for_parsing`
|
|
3141
|
+
* and doesn't apply `national_prefix_transform_rule` after that.
|
|
3142
|
+
* https://github.com/google/libphonenumber/blob/a3d70b0487875475e6ad659af404943211d26456/java/libphonenumber/src/com/google/i18n/phonenumbers/AsYouTypeFormatter.java#L539
|
|
3143
|
+
* @return {boolean} [extracted]
|
|
3144
|
+
*/
|
|
3145
|
+
}, {
|
|
3146
|
+
key: "extractNationalSignificantNumber",
|
|
3147
|
+
value: function extractNationalSignificantNumber(nationalDigits, setState) {
|
|
3148
|
+
if (!this.hasSelectedNumberingPlan) {
|
|
3149
|
+
return;
|
|
3150
|
+
}
|
|
3151
|
+
var _extractNationalNumbe = extractNationalNumberFromPossiblyIncompleteNumber(nationalDigits, this.metadata), nationalPrefix = _extractNationalNumbe.nationalPrefix, nationalNumber = _extractNationalNumbe.nationalNumber, carrierCode = _extractNationalNumbe.carrierCode;
|
|
3152
|
+
if (nationalNumber === nationalDigits) {
|
|
3153
|
+
return;
|
|
3154
|
+
}
|
|
3155
|
+
this.onExtractedNationalNumber(nationalPrefix, carrierCode, nationalNumber, nationalDigits, setState);
|
|
3156
|
+
return true;
|
|
3157
|
+
}
|
|
3158
|
+
/**
|
|
3159
|
+
* In Google's code this function is called "attempt to extract longer NDD".
|
|
3160
|
+
* "Some national prefixes are a substring of others", they say.
|
|
3161
|
+
* @return {boolean} [result] — Returns `true` if extracting a national prefix produced different results from what they were.
|
|
3162
|
+
*/
|
|
3163
|
+
}, {
|
|
3164
|
+
key: "extractAnotherNationalSignificantNumber",
|
|
3165
|
+
value: function extractAnotherNationalSignificantNumber(nationalDigits, prevNationalSignificantNumber, setState) {
|
|
3166
|
+
if (!this.hasExtractedNationalSignificantNumber) {
|
|
3167
|
+
return this.extractNationalSignificantNumber(nationalDigits, setState);
|
|
3168
|
+
}
|
|
3169
|
+
if (!this.couldPossiblyExtractAnotherNationalSignificantNumber) {
|
|
3170
|
+
return;
|
|
3171
|
+
}
|
|
3172
|
+
var _extractNationalNumbe2 = extractNationalNumberFromPossiblyIncompleteNumber(nationalDigits, this.metadata), nationalPrefix = _extractNationalNumbe2.nationalPrefix, nationalNumber = _extractNationalNumbe2.nationalNumber, carrierCode = _extractNationalNumbe2.carrierCode;
|
|
3173
|
+
if (nationalNumber === prevNationalSignificantNumber) {
|
|
3174
|
+
return;
|
|
3175
|
+
}
|
|
3176
|
+
this.onExtractedNationalNumber(nationalPrefix, carrierCode, nationalNumber, nationalDigits, setState);
|
|
3177
|
+
return true;
|
|
3178
|
+
}
|
|
3179
|
+
}, {
|
|
3180
|
+
key: "onExtractedNationalNumber",
|
|
3181
|
+
value: function onExtractedNationalNumber(nationalPrefix, carrierCode, nationalSignificantNumber, nationalDigits, setState) {
|
|
3182
|
+
var nationalSignificantNumberIsModified = false;
|
|
3183
|
+
var prefixBeforeNationalSignificantNumberThatIsNotNationalPrefix;
|
|
3184
|
+
var nationalSignificantNumberIndex = nationalDigits.lastIndexOf(nationalSignificantNumber);
|
|
3185
|
+
if (nationalSignificantNumberIndex < 0 || nationalSignificantNumberIndex !== nationalDigits.length - nationalSignificantNumber.length) {
|
|
3186
|
+
nationalSignificantNumberIsModified = true;
|
|
3187
|
+
} else {
|
|
3188
|
+
var prefixBeforeNationalNumber = nationalDigits.slice(0, nationalSignificantNumberIndex);
|
|
3189
|
+
if (prefixBeforeNationalNumber) {
|
|
3190
|
+
if (prefixBeforeNationalNumber !== nationalPrefix) {
|
|
3191
|
+
prefixBeforeNationalSignificantNumberThatIsNotNationalPrefix = prefixBeforeNationalNumber;
|
|
3192
|
+
}
|
|
3193
|
+
}
|
|
3194
|
+
}
|
|
3195
|
+
setState({
|
|
3196
|
+
nationalPrefix,
|
|
3197
|
+
carrierCode,
|
|
3198
|
+
nationalSignificantNumber,
|
|
3199
|
+
nationalSignificantNumberIsModified,
|
|
3200
|
+
prefixBeforeNationalSignificantNumberThatIsNotNationalPrefix
|
|
3201
|
+
});
|
|
3202
|
+
this.hasExtractedNationalSignificantNumber = true;
|
|
3203
|
+
this.onNationalSignificantNumberChange();
|
|
3204
|
+
}
|
|
3205
|
+
}, {
|
|
3206
|
+
key: "reExtractNationalSignificantNumber",
|
|
3207
|
+
value: function reExtractNationalSignificantNumber(state) {
|
|
3208
|
+
if (this.extractAnotherNationalSignificantNumber(state.getNationalDigits(), state.nationalSignificantNumber, function(stateUpdate) {
|
|
3209
|
+
return state.update(stateUpdate);
|
|
3210
|
+
})) {
|
|
3211
|
+
return true;
|
|
3212
|
+
}
|
|
3213
|
+
if (this.extractIddPrefix(state)) {
|
|
3214
|
+
this.extractCallingCodeAndNationalSignificantNumber(state);
|
|
3215
|
+
return true;
|
|
3216
|
+
}
|
|
3217
|
+
if (this.fixMissingPlus(state)) {
|
|
3218
|
+
this.extractCallingCodeAndNationalSignificantNumber(state);
|
|
3219
|
+
return true;
|
|
3220
|
+
}
|
|
3221
|
+
}
|
|
3222
|
+
}, {
|
|
3223
|
+
key: "extractIddPrefix",
|
|
3224
|
+
value: function extractIddPrefix(state) {
|
|
3225
|
+
var international = state.international, IDDPrefix = state.IDDPrefix, digits = state.digits, nationalSignificantNumber = state.nationalSignificantNumber;
|
|
3226
|
+
if (international || IDDPrefix) {
|
|
3227
|
+
return;
|
|
3228
|
+
}
|
|
3229
|
+
var numberWithoutIDD = stripIddPrefix(digits, this.defaultCountry, this.defaultCallingCode, this.metadata.metadata);
|
|
3230
|
+
if (numberWithoutIDD !== void 0 && numberWithoutIDD !== digits) {
|
|
3231
|
+
state.update({
|
|
3232
|
+
IDDPrefix: digits.slice(0, digits.length - numberWithoutIDD.length)
|
|
3233
|
+
});
|
|
3234
|
+
this.startInternationalNumber(state, {
|
|
3235
|
+
country: void 0,
|
|
3236
|
+
callingCode: void 0
|
|
3237
|
+
});
|
|
3238
|
+
return true;
|
|
3239
|
+
}
|
|
3240
|
+
}
|
|
3241
|
+
}, {
|
|
3242
|
+
key: "fixMissingPlus",
|
|
3243
|
+
value: function fixMissingPlus(state) {
|
|
3244
|
+
if (!state.international) {
|
|
3245
|
+
var _extractCountryCallin2 = extractCountryCallingCodeFromInternationalNumberWithoutPlusSign(state.digits, state.country, this.defaultCountry, this.defaultCallingCode, this.metadata.metadata), newCallingCode = _extractCountryCallin2.countryCallingCode;
|
|
3246
|
+
if (newCallingCode) {
|
|
3247
|
+
state.update({
|
|
3248
|
+
missingPlus: true
|
|
3249
|
+
});
|
|
3250
|
+
this.startInternationalNumber(state, {
|
|
3251
|
+
country: state.country,
|
|
3252
|
+
callingCode: newCallingCode
|
|
3253
|
+
});
|
|
3254
|
+
return true;
|
|
3255
|
+
}
|
|
3256
|
+
}
|
|
3257
|
+
}
|
|
3258
|
+
}, {
|
|
3259
|
+
key: "startInternationalNumber",
|
|
3260
|
+
value: function startInternationalNumber(state, _ref3) {
|
|
3261
|
+
var country = _ref3.country, callingCode = _ref3.callingCode;
|
|
3262
|
+
state.startInternationalNumber(country, callingCode);
|
|
3263
|
+
if (state.nationalSignificantNumber) {
|
|
3264
|
+
state.resetNationalSignificantNumber();
|
|
3265
|
+
this.onNationalSignificantNumberChange();
|
|
3266
|
+
this.hasExtractedNationalSignificantNumber = void 0;
|
|
3267
|
+
}
|
|
3268
|
+
}
|
|
3269
|
+
}, {
|
|
3270
|
+
key: "extractCallingCodeAndNationalSignificantNumber",
|
|
3271
|
+
value: function extractCallingCodeAndNationalSignificantNumber(state) {
|
|
3272
|
+
if (this.extractCountryCallingCode(state)) {
|
|
3273
|
+
this.extractNationalSignificantNumber(state.getNationalDigits(), function(stateUpdate) {
|
|
3274
|
+
return state.update(stateUpdate);
|
|
3275
|
+
});
|
|
3276
|
+
}
|
|
3277
|
+
}
|
|
3278
|
+
}]);
|
|
3279
|
+
})();
|
|
3280
|
+
function extractFormattedPhoneNumber(text) {
|
|
3281
|
+
var startsAt = text.search(VALID_FORMATTED_PHONE_NUMBER_PART);
|
|
3282
|
+
if (startsAt < 0) {
|
|
3283
|
+
return;
|
|
3284
|
+
}
|
|
3285
|
+
text = text.slice(startsAt);
|
|
3286
|
+
var hasPlus;
|
|
3287
|
+
if (text[0] === "+") {
|
|
3288
|
+
hasPlus = true;
|
|
3289
|
+
text = text.slice("+".length);
|
|
3290
|
+
}
|
|
3291
|
+
text = text.replace(AFTER_PHONE_NUMBER_DIGITS_END_PATTERN, "");
|
|
3292
|
+
if (hasPlus) {
|
|
3293
|
+
text = "+" + text;
|
|
3294
|
+
}
|
|
3295
|
+
return text;
|
|
3296
|
+
}
|
|
3297
|
+
function _extractFormattedDigitsAndPlus(text) {
|
|
3298
|
+
var extractedNumber = extractFormattedPhoneNumber(text) || "";
|
|
3299
|
+
if (extractedNumber[0] === "+") {
|
|
3300
|
+
return [extractedNumber.slice("+".length), true];
|
|
3301
|
+
}
|
|
3302
|
+
return [extractedNumber];
|
|
3303
|
+
}
|
|
3304
|
+
function extractFormattedDigitsAndPlus(text) {
|
|
3305
|
+
var _extractFormattedDigi3 = _extractFormattedDigitsAndPlus(text), _extractFormattedDigi4 = _slicedToArray(_extractFormattedDigi3, 2), formattedDigits = _extractFormattedDigi4[0], hasPlus = _extractFormattedDigi4[1];
|
|
3306
|
+
if (!VALID_FORMATTED_PHONE_NUMBER_DIGITS_PART_PATTERN.test(formattedDigits)) {
|
|
3307
|
+
formattedDigits = "";
|
|
3308
|
+
}
|
|
3309
|
+
return [formattedDigits, hasPlus];
|
|
3310
|
+
}
|
|
3311
|
+
|
|
3312
|
+
// node_modules/.pnpm/libphonenumber-js@1.13.7/node_modules/libphonenumber-js/es6/AsYouType.js
|
|
3313
|
+
function _typeof8(o2) {
|
|
3314
|
+
"@babel/helpers - typeof";
|
|
3315
|
+
return _typeof8 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o3) {
|
|
3316
|
+
return typeof o3;
|
|
3317
|
+
} : function(o3) {
|
|
3318
|
+
return o3 && "function" == typeof Symbol && o3.constructor === Symbol && o3 !== Symbol.prototype ? "symbol" : typeof o3;
|
|
3319
|
+
}, _typeof8(o2);
|
|
3320
|
+
}
|
|
3321
|
+
function _slicedToArray2(r2, e2) {
|
|
3322
|
+
return _arrayWithHoles2(r2) || _iterableToArrayLimit2(r2, e2) || _unsupportedIterableToArray9(r2, e2) || _nonIterableRest2();
|
|
3323
|
+
}
|
|
3324
|
+
function _nonIterableRest2() {
|
|
3325
|
+
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
3326
|
+
}
|
|
3327
|
+
function _unsupportedIterableToArray9(r2, a2) {
|
|
3328
|
+
if (r2) {
|
|
3329
|
+
if ("string" == typeof r2) return _arrayLikeToArray9(r2, a2);
|
|
3330
|
+
var t2 = {}.toString.call(r2).slice(8, -1);
|
|
3331
|
+
return "Object" === t2 && r2.constructor && (t2 = r2.constructor.name), "Map" === t2 || "Set" === t2 ? Array.from(r2) : "Arguments" === t2 || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t2) ? _arrayLikeToArray9(r2, a2) : void 0;
|
|
3332
|
+
}
|
|
3333
|
+
}
|
|
3334
|
+
function _arrayLikeToArray9(r2, a2) {
|
|
3335
|
+
(null == a2 || a2 > r2.length) && (a2 = r2.length);
|
|
3336
|
+
for (var e2 = 0, n2 = Array(a2); e2 < a2; e2++) n2[e2] = r2[e2];
|
|
3337
|
+
return n2;
|
|
3338
|
+
}
|
|
3339
|
+
function _iterableToArrayLimit2(r2, l2) {
|
|
3340
|
+
var t2 = null == r2 ? null : "undefined" != typeof Symbol && r2[Symbol.iterator] || r2["@@iterator"];
|
|
3341
|
+
if (null != t2) {
|
|
3342
|
+
var e2, n2, i2, u2, a2 = [], f2 = true, o2 = false;
|
|
3343
|
+
try {
|
|
3344
|
+
if (i2 = (t2 = t2.call(r2)).next, 0 === l2) {
|
|
3345
|
+
if (Object(t2) !== t2) return;
|
|
3346
|
+
f2 = false;
|
|
3347
|
+
} else for (; !(f2 = (e2 = i2.call(t2)).done) && (a2.push(e2.value), a2.length !== l2); f2 = true) ;
|
|
3348
|
+
} catch (r3) {
|
|
3349
|
+
o2 = true, n2 = r3;
|
|
3350
|
+
} finally {
|
|
3351
|
+
try {
|
|
3352
|
+
if (!f2 && null != t2["return"] && (u2 = t2["return"](), Object(u2) !== u2)) return;
|
|
3353
|
+
} finally {
|
|
3354
|
+
if (o2) throw n2;
|
|
3355
|
+
}
|
|
3356
|
+
}
|
|
3357
|
+
return a2;
|
|
3358
|
+
}
|
|
3359
|
+
}
|
|
3360
|
+
function _arrayWithHoles2(r2) {
|
|
3361
|
+
if (Array.isArray(r2)) return r2;
|
|
3362
|
+
}
|
|
3363
|
+
function _classCallCheck8(a2, n2) {
|
|
3364
|
+
if (!(a2 instanceof n2)) throw new TypeError("Cannot call a class as a function");
|
|
3365
|
+
}
|
|
3366
|
+
function _defineProperties8(e2, r2) {
|
|
3367
|
+
for (var t2 = 0; t2 < r2.length; t2++) {
|
|
3368
|
+
var o2 = r2[t2];
|
|
3369
|
+
o2.enumerable = o2.enumerable || false, o2.configurable = true, "value" in o2 && (o2.writable = true), Object.defineProperty(e2, _toPropertyKey8(o2.key), o2);
|
|
3370
|
+
}
|
|
3371
|
+
}
|
|
3372
|
+
function _createClass8(e2, r2, t2) {
|
|
3373
|
+
return r2 && _defineProperties8(e2.prototype, r2), t2 && _defineProperties8(e2, t2), Object.defineProperty(e2, "prototype", { writable: false }), e2;
|
|
3374
|
+
}
|
|
3375
|
+
function _toPropertyKey8(t2) {
|
|
3376
|
+
var i2 = _toPrimitive8(t2, "string");
|
|
3377
|
+
return "symbol" == _typeof8(i2) ? i2 : i2 + "";
|
|
3378
|
+
}
|
|
3379
|
+
function _toPrimitive8(t2, r2) {
|
|
3380
|
+
if ("object" != _typeof8(t2) || !t2) return t2;
|
|
3381
|
+
var e2 = t2[Symbol.toPrimitive];
|
|
3382
|
+
if (void 0 !== e2) {
|
|
3383
|
+
var i2 = e2.call(t2, r2 || "default");
|
|
3384
|
+
if ("object" != _typeof8(i2)) return i2;
|
|
3385
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
3386
|
+
}
|
|
3387
|
+
return ("string" === r2 ? String : Number)(t2);
|
|
3388
|
+
}
|
|
3389
|
+
var USE_NON_GEOGRAPHIC_COUNTRY_CODE3 = false;
|
|
3390
|
+
var AsYouType = /* @__PURE__ */ (function() {
|
|
3391
|
+
function AsYouType3(optionsOrDefaultCountry, metadata) {
|
|
3392
|
+
_classCallCheck8(this, AsYouType3);
|
|
3393
|
+
this.metadata = new Metadata(metadata);
|
|
3394
|
+
var _this$getCountryAndCa = this.getCountryAndCallingCode(optionsOrDefaultCountry), _this$getCountryAndCa2 = _slicedToArray2(_this$getCountryAndCa, 2), defaultCountry = _this$getCountryAndCa2[0], defaultCallingCode = _this$getCountryAndCa2[1];
|
|
3395
|
+
this.defaultCountry = defaultCountry;
|
|
3396
|
+
this.defaultCallingCode = defaultCallingCode;
|
|
3397
|
+
this.reset();
|
|
3398
|
+
}
|
|
3399
|
+
return _createClass8(AsYouType3, [{
|
|
3400
|
+
key: "getCountryAndCallingCode",
|
|
3401
|
+
value: function getCountryAndCallingCode(optionsOrDefaultCountry) {
|
|
3402
|
+
var defaultCountry;
|
|
3403
|
+
var defaultCallingCode;
|
|
3404
|
+
if (optionsOrDefaultCountry) {
|
|
3405
|
+
if (isObject(optionsOrDefaultCountry)) {
|
|
3406
|
+
defaultCountry = optionsOrDefaultCountry.defaultCountry;
|
|
3407
|
+
defaultCallingCode = optionsOrDefaultCountry.defaultCallingCode;
|
|
3408
|
+
} else {
|
|
3409
|
+
defaultCountry = optionsOrDefaultCountry;
|
|
3410
|
+
}
|
|
3411
|
+
}
|
|
3412
|
+
if (defaultCountry && !this.metadata.hasCountry(defaultCountry)) {
|
|
3413
|
+
defaultCountry = void 0;
|
|
3414
|
+
}
|
|
3415
|
+
if (defaultCallingCode) {
|
|
3416
|
+
if (USE_NON_GEOGRAPHIC_COUNTRY_CODE3) {
|
|
3417
|
+
if (this.metadata.isNonGeographicCallingCode(defaultCallingCode)) {
|
|
3418
|
+
defaultCountry = "001";
|
|
3419
|
+
}
|
|
3420
|
+
}
|
|
3421
|
+
}
|
|
3422
|
+
return [defaultCountry, defaultCallingCode];
|
|
3423
|
+
}
|
|
3424
|
+
/**
|
|
3425
|
+
* Inputs "next" phone number characters.
|
|
3426
|
+
* @param {string} text
|
|
3427
|
+
* @return {string} Formatted phone number characters that have been input so far.
|
|
3428
|
+
*/
|
|
3429
|
+
}, {
|
|
3430
|
+
key: "input",
|
|
3431
|
+
value: function input(text) {
|
|
3432
|
+
var _this$parser$input = this.parser.input(text, this.state), digits = _this$parser$input.digits, justLeadingPlus = _this$parser$input.justLeadingPlus;
|
|
3433
|
+
if (justLeadingPlus) {
|
|
3434
|
+
this.formattedOutput = "+";
|
|
3435
|
+
} else if (digits) {
|
|
3436
|
+
this.determineTheCountryIfNeeded();
|
|
3437
|
+
if (this.state.nationalSignificantNumber) {
|
|
3438
|
+
this.formatter.narrowDownMatchingFormats(this.state);
|
|
3439
|
+
}
|
|
3440
|
+
var formattedNationalNumber;
|
|
3441
|
+
if (this.metadata.hasSelectedNumberingPlan()) {
|
|
3442
|
+
formattedNationalNumber = this.formatter.format(digits, this.state);
|
|
3443
|
+
}
|
|
3444
|
+
if (formattedNationalNumber === void 0) {
|
|
3445
|
+
if (this.parser.reExtractNationalSignificantNumber(this.state)) {
|
|
3446
|
+
this.determineTheCountryIfNeeded();
|
|
3447
|
+
var nationalDigits = this.state.getNationalDigits();
|
|
3448
|
+
if (nationalDigits) {
|
|
3449
|
+
formattedNationalNumber = this.formatter.format(nationalDigits, this.state);
|
|
3450
|
+
}
|
|
3451
|
+
}
|
|
3452
|
+
}
|
|
3453
|
+
this.formattedOutput = formattedNationalNumber ? this.getFullNumber(formattedNationalNumber) : this.getNonFormattedNumber();
|
|
3454
|
+
}
|
|
3455
|
+
return this.formattedOutput;
|
|
3456
|
+
}
|
|
3457
|
+
}, {
|
|
3458
|
+
key: "reset",
|
|
3459
|
+
value: function reset() {
|
|
3460
|
+
var _this = this;
|
|
3461
|
+
this.state = new AsYouTypeState({
|
|
3462
|
+
onCountryChange: function onCountryChange(country) {
|
|
3463
|
+
_this.country = country;
|
|
3464
|
+
},
|
|
3465
|
+
onCallingCodeChange: function onCallingCodeChange(callingCode, country) {
|
|
3466
|
+
_this.metadata.selectNumberingPlan(country || callingCode);
|
|
3467
|
+
_this.formatter.reset(_this.metadata.numberingPlan, _this.state);
|
|
3468
|
+
_this.parser.reset(_this.metadata.numberingPlan);
|
|
3469
|
+
}
|
|
3470
|
+
});
|
|
3471
|
+
this.formatter = new AsYouTypeFormatter({
|
|
3472
|
+
state: this.state,
|
|
3473
|
+
metadata: this.metadata
|
|
3474
|
+
});
|
|
3475
|
+
this.parser = new AsYouTypeParser({
|
|
3476
|
+
defaultCountry: this.defaultCountry,
|
|
3477
|
+
defaultCallingCode: this.defaultCallingCode,
|
|
3478
|
+
metadata: this.metadata,
|
|
3479
|
+
state: this.state,
|
|
3480
|
+
onNationalSignificantNumberChange: function onNationalSignificantNumberChange() {
|
|
3481
|
+
_this.determineTheCountryIfNeeded();
|
|
3482
|
+
_this.formatter.reset(_this.metadata.numberingPlan, _this.state);
|
|
3483
|
+
}
|
|
3484
|
+
});
|
|
3485
|
+
this.state.reset({
|
|
3486
|
+
country: this.defaultCountry,
|
|
3487
|
+
callingCode: this.defaultCallingCode
|
|
3488
|
+
});
|
|
3489
|
+
this.formattedOutput = "";
|
|
3490
|
+
return this;
|
|
3491
|
+
}
|
|
3492
|
+
/**
|
|
3493
|
+
* Returns `true` if the phone number is being input in international format.
|
|
3494
|
+
* In other words, returns `true` if and only if the parsed phone number starts with a `"+"`.
|
|
3495
|
+
* @return {boolean}
|
|
3496
|
+
*/
|
|
3497
|
+
}, {
|
|
3498
|
+
key: "isInternational",
|
|
3499
|
+
value: function isInternational() {
|
|
3500
|
+
return this.state.international;
|
|
3501
|
+
}
|
|
3502
|
+
/**
|
|
3503
|
+
* Returns the "calling code" part of the phone number when it's being input
|
|
3504
|
+
* in an international format.
|
|
3505
|
+
* If no valid calling code has been entered so far, returns `undefined`.
|
|
3506
|
+
* @return {string} [callingCode]
|
|
3507
|
+
*/
|
|
3508
|
+
}, {
|
|
3509
|
+
key: "getCallingCode",
|
|
3510
|
+
value: function getCallingCode() {
|
|
3511
|
+
if (this.isInternational()) {
|
|
3512
|
+
return this.state.callingCode;
|
|
3513
|
+
}
|
|
3514
|
+
}
|
|
3515
|
+
// A legacy alias.
|
|
3516
|
+
}, {
|
|
3517
|
+
key: "getCountryCallingCode",
|
|
3518
|
+
value: function getCountryCallingCode2() {
|
|
3519
|
+
return this.getCallingCode();
|
|
3520
|
+
}
|
|
3521
|
+
/**
|
|
3522
|
+
* Returns a two-letter country code of the phone number.
|
|
3523
|
+
* Returns `undefined` for "non-geographic" phone numbering plans.
|
|
3524
|
+
* Returns `undefined` if no phone number has been input yet.
|
|
3525
|
+
* @return {string} [country]
|
|
3526
|
+
*/
|
|
3527
|
+
}, {
|
|
3528
|
+
key: "getCountry",
|
|
3529
|
+
value: function getCountry() {
|
|
3530
|
+
var digits = this.state.digits;
|
|
3531
|
+
if (digits) {
|
|
3532
|
+
return this._getCountry();
|
|
3533
|
+
}
|
|
3534
|
+
}
|
|
3535
|
+
/**
|
|
3536
|
+
* Returns a two-letter country code of the phone number.
|
|
3537
|
+
* Returns `undefined` for "non-geographic" phone numbering plans.
|
|
3538
|
+
* @return {string} [country]
|
|
3539
|
+
*/
|
|
3540
|
+
}, {
|
|
3541
|
+
key: "_getCountry",
|
|
3542
|
+
value: function _getCountry() {
|
|
3543
|
+
var country = this.state.country;
|
|
3544
|
+
if (USE_NON_GEOGRAPHIC_COUNTRY_CODE3) {
|
|
3545
|
+
if (country === "001") {
|
|
3546
|
+
return;
|
|
3547
|
+
}
|
|
3548
|
+
}
|
|
3549
|
+
return country;
|
|
3550
|
+
}
|
|
3551
|
+
}, {
|
|
3552
|
+
key: "determineTheCountryIfNeeded",
|
|
3553
|
+
value: function determineTheCountryIfNeeded() {
|
|
3554
|
+
if (!this.state.country || this.isCountryCallingCodeAmbiguous()) {
|
|
3555
|
+
this.determineTheCountry();
|
|
3556
|
+
}
|
|
3557
|
+
}
|
|
3558
|
+
// Prepends `+CountryCode ` in case of an international phone number
|
|
3559
|
+
}, {
|
|
3560
|
+
key: "getFullNumber",
|
|
3561
|
+
value: function getFullNumber(formattedNationalNumber) {
|
|
3562
|
+
var _this2 = this;
|
|
3563
|
+
if (this.isInternational()) {
|
|
3564
|
+
var prefix = function prefix2(text) {
|
|
3565
|
+
return _this2.formatter.getInternationalPrefixBeforeCountryCallingCode(_this2.state, {
|
|
3566
|
+
spacing: text ? true : false
|
|
3567
|
+
}) + text;
|
|
3568
|
+
};
|
|
3569
|
+
var callingCode = this.state.callingCode;
|
|
3570
|
+
if (!callingCode) {
|
|
3571
|
+
return prefix("".concat(this.state.getDigitsWithoutInternationalPrefix()));
|
|
3572
|
+
}
|
|
3573
|
+
if (!formattedNationalNumber) {
|
|
3574
|
+
return prefix(callingCode);
|
|
3575
|
+
}
|
|
3576
|
+
return prefix("".concat(callingCode, " ").concat(formattedNationalNumber));
|
|
3577
|
+
}
|
|
3578
|
+
return formattedNationalNumber;
|
|
3579
|
+
}
|
|
3580
|
+
}, {
|
|
3581
|
+
key: "getNonFormattedNationalNumberWithPrefix",
|
|
3582
|
+
value: function getNonFormattedNationalNumberWithPrefix() {
|
|
3583
|
+
var _this$state = this.state, nationalSignificantNumber = _this$state.nationalSignificantNumber, prefixBeforeNationalSignificantNumberThatIsNotNationalPrefix = _this$state.prefixBeforeNationalSignificantNumberThatIsNotNationalPrefix, nationalPrefix = _this$state.nationalPrefix;
|
|
3584
|
+
var number = nationalSignificantNumber;
|
|
3585
|
+
var prefix = prefixBeforeNationalSignificantNumberThatIsNotNationalPrefix || nationalPrefix;
|
|
3586
|
+
if (prefix) {
|
|
3587
|
+
number = prefix + number;
|
|
3588
|
+
}
|
|
3589
|
+
return number;
|
|
3590
|
+
}
|
|
3591
|
+
}, {
|
|
3592
|
+
key: "getNonFormattedNumber",
|
|
3593
|
+
value: function getNonFormattedNumber() {
|
|
3594
|
+
var nationalSignificantNumberIsModified = this.state.nationalSignificantNumberIsModified;
|
|
3595
|
+
return this.getFullNumber(nationalSignificantNumberIsModified ? this.state.getNationalDigits() : this.getNonFormattedNationalNumberWithPrefix());
|
|
3596
|
+
}
|
|
3597
|
+
}, {
|
|
3598
|
+
key: "getNonFormattedTemplate",
|
|
3599
|
+
value: function getNonFormattedTemplate() {
|
|
3600
|
+
var number = this.getNonFormattedNumber();
|
|
3601
|
+
if (number) {
|
|
3602
|
+
return number.replace(/[\+\d]/g, DIGIT_PLACEHOLDER);
|
|
3603
|
+
}
|
|
3604
|
+
}
|
|
3605
|
+
}, {
|
|
3606
|
+
key: "isCountryCallingCodeAmbiguous",
|
|
3607
|
+
value: function isCountryCallingCodeAmbiguous() {
|
|
3608
|
+
var callingCode = this.state.callingCode;
|
|
3609
|
+
var countryCodes = this.metadata.getCountryCodesForCallingCode(callingCode);
|
|
3610
|
+
return countryCodes && countryCodes.length > 1;
|
|
3611
|
+
}
|
|
3612
|
+
// Determines the exact country of the phone number
|
|
3613
|
+
// entered so far based on the country phone code
|
|
3614
|
+
// and the national phone number.
|
|
3615
|
+
}, {
|
|
3616
|
+
key: "determineTheCountry",
|
|
3617
|
+
value: function determineTheCountry() {
|
|
3618
|
+
var country = getCountryByCallingCode(this.isInternational() ? this.state.callingCode : this.defaultCallingCode, {
|
|
3619
|
+
nationalNumber: this.state.nationalSignificantNumber,
|
|
3620
|
+
metadata: this.metadata
|
|
3621
|
+
});
|
|
3622
|
+
if (country !== this.state.country) {
|
|
3623
|
+
this.state.setCountry(country);
|
|
3624
|
+
if (country) {
|
|
3625
|
+
this.metadata.selectNumberingPlan(country);
|
|
3626
|
+
}
|
|
3627
|
+
}
|
|
3628
|
+
}
|
|
3629
|
+
/**
|
|
3630
|
+
* Returns a E.164 phone number value for the user's input.
|
|
3631
|
+
*
|
|
3632
|
+
* For example, for country `"US"` and input `"(222) 333-4444"`
|
|
3633
|
+
* it will return `"+12223334444"`.
|
|
3634
|
+
*
|
|
3635
|
+
* For international phone number input, it will also auto-correct
|
|
3636
|
+
* some minor errors such as using a national prefix when writing
|
|
3637
|
+
* an international phone number. For example, if the user inputs
|
|
3638
|
+
* `"+44 0 7400 000000"` then it will return an auto-corrected
|
|
3639
|
+
* `"+447400000000"` phone number value.
|
|
3640
|
+
*
|
|
3641
|
+
* Will return `undefined` if no digits have been input,
|
|
3642
|
+
* or when inputting a phone number in national format and no
|
|
3643
|
+
* default country or default "country calling code" have been set.
|
|
3644
|
+
*
|
|
3645
|
+
* @return {string} [value]
|
|
3646
|
+
*/
|
|
3647
|
+
}, {
|
|
3648
|
+
key: "getNumberValue",
|
|
3649
|
+
value: function getNumberValue() {
|
|
3650
|
+
var _this$state2 = this.state, digits = _this$state2.digits, callingCode = _this$state2.callingCode, country = _this$state2.country, nationalSignificantNumber = _this$state2.nationalSignificantNumber;
|
|
3651
|
+
if (!digits) {
|
|
3652
|
+
return;
|
|
3653
|
+
}
|
|
3654
|
+
if (this.isInternational()) {
|
|
3655
|
+
if (callingCode) {
|
|
3656
|
+
return "+" + callingCode + nationalSignificantNumber;
|
|
3657
|
+
} else {
|
|
3658
|
+
return "+" + digits;
|
|
3659
|
+
}
|
|
3660
|
+
} else {
|
|
3661
|
+
if (country || callingCode) {
|
|
3662
|
+
var callingCode_ = country ? this.metadata.countryCallingCode() : callingCode;
|
|
3663
|
+
return "+" + callingCode_ + nationalSignificantNumber;
|
|
3664
|
+
}
|
|
3665
|
+
}
|
|
3666
|
+
}
|
|
3667
|
+
/**
|
|
3668
|
+
* Returns an instance of `PhoneNumber` class.
|
|
3669
|
+
* Will return `undefined` if no national (significant) number
|
|
3670
|
+
* digits have been entered so far, or if no `defaultCountry` has been
|
|
3671
|
+
* set and the user enters a phone number not in international format.
|
|
3672
|
+
*/
|
|
3673
|
+
}, {
|
|
3674
|
+
key: "getNumber",
|
|
3675
|
+
value: function getNumber() {
|
|
3676
|
+
var _this$state3 = this.state, nationalSignificantNumber = _this$state3.nationalSignificantNumber, carrierCode = _this$state3.carrierCode, callingCode = _this$state3.callingCode;
|
|
3677
|
+
if (!nationalSignificantNumber) {
|
|
3678
|
+
return;
|
|
3679
|
+
}
|
|
3680
|
+
var country = this._getCountry();
|
|
3681
|
+
if (!country && !callingCode) {
|
|
3682
|
+
return;
|
|
3683
|
+
}
|
|
3684
|
+
if (country) {
|
|
3685
|
+
if (country === this.defaultCountry) {
|
|
3686
|
+
var countryCallingCode = this.metadata.numberingPlan.callingCode();
|
|
3687
|
+
var exactCountry = getExactCountryForMultiCountryCallingCode(countryCallingCode, nationalSignificantNumber, this.metadata);
|
|
3688
|
+
if (exactCountry) {
|
|
3689
|
+
country = exactCountry;
|
|
3690
|
+
}
|
|
3691
|
+
}
|
|
3692
|
+
}
|
|
3693
|
+
var phoneNumber = new PhoneNumber(country || callingCode, nationalSignificantNumber, this.metadata.metadata);
|
|
3694
|
+
if (carrierCode) {
|
|
3695
|
+
phoneNumber.carrierCode = carrierCode;
|
|
3696
|
+
}
|
|
3697
|
+
return phoneNumber;
|
|
3698
|
+
}
|
|
3699
|
+
/**
|
|
3700
|
+
* Returns `true` if the phone number is "possible".
|
|
3701
|
+
* Is just a shortcut for `PhoneNumber.isPossible()`.
|
|
3702
|
+
* @return {boolean}
|
|
3703
|
+
*/
|
|
3704
|
+
}, {
|
|
3705
|
+
key: "isPossible",
|
|
3706
|
+
value: function isPossible() {
|
|
3707
|
+
var phoneNumber = this.getNumber();
|
|
3708
|
+
if (!phoneNumber) {
|
|
3709
|
+
return false;
|
|
3710
|
+
}
|
|
3711
|
+
return phoneNumber.isPossible();
|
|
3712
|
+
}
|
|
3713
|
+
/**
|
|
3714
|
+
* Returns `true` if the phone number is "valid".
|
|
3715
|
+
* Is just a shortcut for `PhoneNumber.isValid()`.
|
|
3716
|
+
* @return {boolean}
|
|
3717
|
+
*/
|
|
3718
|
+
}, {
|
|
3719
|
+
key: "isValid",
|
|
3720
|
+
value: function isValid() {
|
|
3721
|
+
var phoneNumber = this.getNumber();
|
|
3722
|
+
if (!phoneNumber) {
|
|
3723
|
+
return false;
|
|
3724
|
+
}
|
|
3725
|
+
return phoneNumber.isValid();
|
|
3726
|
+
}
|
|
3727
|
+
/**
|
|
3728
|
+
* Checks if the phone number length is valid.
|
|
3729
|
+
* If it is, nothing is returned.
|
|
3730
|
+
* Otherwise, a rejection reason is returned.
|
|
3731
|
+
* @return {string?}
|
|
3732
|
+
*/
|
|
3733
|
+
}, {
|
|
3734
|
+
key: "validateLength",
|
|
3735
|
+
value: function validateLength() {
|
|
3736
|
+
var _this$state4 = this.state, digits = _this$state4.digits, nationalSignificantNumber = _this$state4.nationalSignificantNumber;
|
|
3737
|
+
if (!digits) {
|
|
3738
|
+
return "NOT_A_NUMBER";
|
|
3739
|
+
}
|
|
3740
|
+
if (!this.metadata.numberingPlan) {
|
|
3741
|
+
return "INVALID_COUNTRY";
|
|
3742
|
+
}
|
|
3743
|
+
if (!nationalSignificantNumber) {
|
|
3744
|
+
return "TOO_SHORT";
|
|
3745
|
+
}
|
|
3746
|
+
var result = checkNumberLength(nationalSignificantNumber, void 0, this.metadata);
|
|
3747
|
+
if (result !== "IS_POSSIBLE") {
|
|
3748
|
+
return result;
|
|
3749
|
+
}
|
|
3750
|
+
}
|
|
3751
|
+
/**
|
|
3752
|
+
* @deprecated
|
|
3753
|
+
* This method is used in `react-phone-number-input/source/input-control.js`
|
|
3754
|
+
* in versions before `3.0.16`.
|
|
3755
|
+
*/
|
|
3756
|
+
}, {
|
|
3757
|
+
key: "getNationalNumber",
|
|
3758
|
+
value: function getNationalNumber() {
|
|
3759
|
+
return this.state.nationalSignificantNumber;
|
|
3760
|
+
}
|
|
3761
|
+
/**
|
|
3762
|
+
* Returns the phone number characters entered by the user.
|
|
3763
|
+
* @return {string}
|
|
3764
|
+
*/
|
|
3765
|
+
}, {
|
|
3766
|
+
key: "getChars",
|
|
3767
|
+
value: function getChars() {
|
|
3768
|
+
return (this.state.international ? "+" : "") + this.state.digits;
|
|
3769
|
+
}
|
|
3770
|
+
/**
|
|
3771
|
+
* Returns the template for the formatted phone number.
|
|
3772
|
+
* @return {string}
|
|
3773
|
+
*/
|
|
3774
|
+
}, {
|
|
3775
|
+
key: "getTemplate",
|
|
3776
|
+
value: function getTemplate() {
|
|
3777
|
+
return this.formatter.getTemplate(this.state) || this.getNonFormattedTemplate() || "";
|
|
3778
|
+
}
|
|
3779
|
+
}]);
|
|
3780
|
+
})();
|
|
3781
|
+
function getExactCountryForMultiCountryCallingCode(callingCode, nationalSignificantNumber, metadata) {
|
|
3782
|
+
var ambiguousCountries = metadata.getCountryCodesForCallingCode(callingCode);
|
|
3783
|
+
if (ambiguousCountries.length > 1) {
|
|
3784
|
+
return getCountryByNationalNumber(nationalSignificantNumber, ambiguousCountries, metadata.metadata);
|
|
3785
|
+
}
|
|
3786
|
+
}
|
|
3787
|
+
|
|
3788
|
+
// node_modules/.pnpm/libphonenumber-js@1.13.7/node_modules/libphonenumber-js/min/exports/AsYouType.js
|
|
3789
|
+
function AsYouType2(country) {
|
|
3790
|
+
return AsYouType.call(this, country, metadata_min_json_default);
|
|
3791
|
+
}
|
|
3792
|
+
AsYouType2.prototype = Object.create(AsYouType.prototype, {});
|
|
3793
|
+
AsYouType2.prototype.constructor = AsYouType2;
|
|
3794
|
+
|
|
3795
|
+
// src/core/phone.ts
|
|
3796
|
+
var formatPhone = (value, country = "MX", delimiter = " ") => {
|
|
3797
|
+
if (!value) return "";
|
|
3798
|
+
const digits = value.replace(/[^\d+]/g, "");
|
|
3799
|
+
const formatter = new AsYouType2(country);
|
|
3800
|
+
const formatted = formatter.input(digits);
|
|
3801
|
+
if (delimiter !== " ") {
|
|
3802
|
+
return formatted.replace(/ /g, delimiter);
|
|
3803
|
+
}
|
|
3804
|
+
return formatted;
|
|
3805
|
+
};
|
|
3806
|
+
|
|
3807
|
+
// src/core/raw.ts
|
|
3808
|
+
var DEFAULT_DATE_PATTERN = ["d", "m", "Y"];
|
|
3809
|
+
var DEFAULT_DATE_RAW_PATTERN = ["Y", "m", "d"];
|
|
3810
|
+
var DEFAULT_DATE_RAW_PATTERN_DELIMITER = "-";
|
|
3811
|
+
var DEFAULT_TIME_PATTERN = ["h", "m", "s"];
|
|
3812
|
+
var DEFAULT_TIME_RAW_PATTERN = ["h", "m"];
|
|
3813
|
+
var DEFAULT_TIME_RAW_PATTERN_DELIMITER = ":";
|
|
3814
|
+
var getDateSegmentKey = (unit) => {
|
|
3815
|
+
switch (unit.toLowerCase()) {
|
|
3816
|
+
case "d":
|
|
3817
|
+
return "day";
|
|
3818
|
+
case "m":
|
|
3819
|
+
return "month";
|
|
3820
|
+
default:
|
|
3821
|
+
return "year";
|
|
3822
|
+
}
|
|
3823
|
+
};
|
|
3824
|
+
var getDateUnitLength = (unit) => unit === "Y" ? 4 : 2;
|
|
3825
|
+
var normalizeDateSegment = (segment, unit) => {
|
|
3826
|
+
if (!segment) return "";
|
|
3827
|
+
switch (unit) {
|
|
3828
|
+
case "y":
|
|
3829
|
+
return segment.slice(-2);
|
|
3830
|
+
case "Y":
|
|
3831
|
+
return segment.slice(0, 4);
|
|
3832
|
+
default:
|
|
3833
|
+
return segment.slice(0, 2);
|
|
3834
|
+
}
|
|
3835
|
+
};
|
|
3836
|
+
var getDateSegments = (value, pattern) => {
|
|
3837
|
+
const digits = value.replace(/[^\d]/g, "");
|
|
3838
|
+
const segments = {};
|
|
3839
|
+
let start = 0;
|
|
3840
|
+
for (const unit of pattern) {
|
|
3841
|
+
const end = start + getDateUnitLength(unit);
|
|
3842
|
+
const segment = digits.slice(start, end);
|
|
3843
|
+
if (segment) {
|
|
3844
|
+
segments[getDateSegmentKey(unit)] = segment;
|
|
3845
|
+
}
|
|
3846
|
+
start = end;
|
|
3847
|
+
}
|
|
3848
|
+
return segments;
|
|
3849
|
+
};
|
|
3850
|
+
var formatDateSegments = (segments, pattern, delimiter = "") => pattern.map(
|
|
3851
|
+
(unit) => normalizeDateSegment(segments[getDateSegmentKey(unit)] ?? "", unit)
|
|
3852
|
+
).filter(Boolean).join(delimiter);
|
|
3853
|
+
var getTimeSegmentKey = (unit) => {
|
|
3854
|
+
switch (unit) {
|
|
3855
|
+
case "h":
|
|
3856
|
+
return "hours";
|
|
3857
|
+
case "m":
|
|
3858
|
+
return "minutes";
|
|
3859
|
+
default:
|
|
3860
|
+
return "seconds";
|
|
3861
|
+
}
|
|
3862
|
+
};
|
|
3863
|
+
var getTimeSegments = (value, pattern) => {
|
|
3864
|
+
const digits = value.replace(/[^\d]/g, "");
|
|
3865
|
+
const segments = {};
|
|
3866
|
+
let start = 0;
|
|
3867
|
+
for (const unit of pattern) {
|
|
3868
|
+
const end = start + 2;
|
|
3869
|
+
const segment = digits.slice(start, end);
|
|
3870
|
+
if (segment) {
|
|
3871
|
+
segments[getTimeSegmentKey(unit)] = segment;
|
|
3872
|
+
}
|
|
3873
|
+
start = end;
|
|
3874
|
+
}
|
|
3875
|
+
return segments;
|
|
3876
|
+
};
|
|
3877
|
+
var formatTimeSegments = (segments, pattern, delimiter = "") => pattern.map((unit) => (segments[getTimeSegmentKey(unit)] ?? "").slice(0, 2)).filter(Boolean).join(delimiter);
|
|
3878
|
+
var getDateValueFromRaw = (value, options = {}) => {
|
|
3879
|
+
const sourcePattern = options.dateRawPattern ?? DEFAULT_DATE_RAW_PATTERN;
|
|
3880
|
+
const targetPattern = options.datePattern ?? DEFAULT_DATE_PATTERN;
|
|
3881
|
+
return formatDateSegments(
|
|
3882
|
+
getDateSegments(value, sourcePattern),
|
|
3883
|
+
targetPattern
|
|
3884
|
+
);
|
|
3885
|
+
};
|
|
3886
|
+
var getTimeValueFromRaw = (value, options = {}) => {
|
|
3887
|
+
const sourcePattern = options.timeRawPattern ?? options.timePattern ?? DEFAULT_TIME_RAW_PATTERN;
|
|
3888
|
+
const targetPattern = options.timePattern ?? DEFAULT_TIME_PATTERN;
|
|
3889
|
+
return formatTimeSegments(
|
|
3890
|
+
getTimeSegments(value, sourcePattern),
|
|
3891
|
+
targetPattern
|
|
3892
|
+
);
|
|
3893
|
+
};
|
|
3894
|
+
var getDateRawValue = (value, options = {}) => {
|
|
3895
|
+
const sourcePattern = options.datePattern ?? DEFAULT_DATE_PATTERN;
|
|
3896
|
+
const targetPattern = options.dateRawPattern ?? DEFAULT_DATE_RAW_PATTERN;
|
|
3897
|
+
const delimiter = options.dateRawPatternDelimiter ?? DEFAULT_DATE_RAW_PATTERN_DELIMITER;
|
|
3898
|
+
return formatDateSegments(
|
|
3899
|
+
getDateSegments(value, sourcePattern),
|
|
3900
|
+
targetPattern,
|
|
3901
|
+
delimiter
|
|
3902
|
+
);
|
|
3903
|
+
};
|
|
3904
|
+
var getTimeRawValue = (value, options = {}) => {
|
|
3905
|
+
const sourcePattern = options.timePattern ?? DEFAULT_TIME_PATTERN;
|
|
3906
|
+
const targetPattern = options.timeRawPattern ?? options.timePattern ?? DEFAULT_TIME_RAW_PATTERN;
|
|
3907
|
+
const delimiter = options.timeRawPatternDelimiter ?? DEFAULT_TIME_RAW_PATTERN_DELIMITER;
|
|
3908
|
+
return formatTimeSegments(
|
|
3909
|
+
getTimeSegments(value, sourcePattern),
|
|
3910
|
+
targetPattern,
|
|
3911
|
+
delimiter
|
|
3912
|
+
);
|
|
3913
|
+
};
|
|
3914
|
+
var stripPrefixAndSuffix = (value, options = {}) => {
|
|
3915
|
+
if (!value || !options.prefix) return value;
|
|
3916
|
+
const { prefix } = options;
|
|
3917
|
+
const tailPrefix = options.tailPrefix ?? false;
|
|
3918
|
+
if (tailPrefix && value.endsWith(prefix)) {
|
|
3919
|
+
return value.slice(0, -prefix.length);
|
|
3920
|
+
}
|
|
3921
|
+
if (!tailPrefix && value.startsWith(prefix)) {
|
|
3922
|
+
return value.slice(prefix.length);
|
|
3923
|
+
}
|
|
3924
|
+
return value;
|
|
3925
|
+
};
|
|
3926
|
+
var getRawValue = (value, formatType, options = {}) => {
|
|
3927
|
+
if (!value) return "";
|
|
3928
|
+
const cleanValue = stripPrefixAndSuffix(value, options);
|
|
3929
|
+
switch (formatType) {
|
|
3930
|
+
case "numeral": {
|
|
3931
|
+
const numeralOpts = {};
|
|
3932
|
+
if (options.numeralDecimalMark !== void 0) {
|
|
3933
|
+
numeralOpts.numeralDecimalMark = options.numeralDecimalMark;
|
|
3934
|
+
}
|
|
3935
|
+
return S(cleanValue, numeralOpts);
|
|
3936
|
+
}
|
|
3937
|
+
case "creditCard":
|
|
3938
|
+
case "creditCardType":
|
|
3939
|
+
return I(cleanValue);
|
|
3940
|
+
case "general": {
|
|
3941
|
+
const generalOpts = {};
|
|
3942
|
+
if (options.delimiter !== void 0) generalOpts.delimiter = options.delimiter;
|
|
3943
|
+
if (options.delimiters !== void 0) generalOpts.delimiters = options.delimiters;
|
|
3944
|
+
return o(cleanValue, generalOpts);
|
|
3945
|
+
}
|
|
3946
|
+
case "date":
|
|
3947
|
+
return getDateRawValue(cleanValue, options);
|
|
3948
|
+
case "time":
|
|
3949
|
+
return getTimeRawValue(cleanValue, options);
|
|
3950
|
+
case "phone":
|
|
3951
|
+
return cleanValue.replace(/[^\d+]/g, "");
|
|
3952
|
+
default:
|
|
3953
|
+
return cleanValue.replace(/\s+/g, "");
|
|
3954
|
+
}
|
|
3955
|
+
};
|
|
3956
|
+
|
|
3957
|
+
// src/core/format.ts
|
|
3958
|
+
var FORMAT_TYPES = [
|
|
3959
|
+
"general",
|
|
3960
|
+
"phone",
|
|
3961
|
+
"numeral",
|
|
3962
|
+
"date",
|
|
3963
|
+
"time",
|
|
3964
|
+
"creditCard",
|
|
3965
|
+
"creditCardType"
|
|
3966
|
+
];
|
|
3967
|
+
var isFormatType = (value) => typeof value === "string" && FORMAT_TYPES.includes(value);
|
|
3968
|
+
var PHONE_DEFAULT_DELIMITER = " ";
|
|
3969
|
+
var PHONE_DEFAULT_COUNTRY = "MX";
|
|
3970
|
+
var resolveRuntimeOptions = (formatType, options = {}) => {
|
|
3971
|
+
const isPhone = formatType === "phone";
|
|
3972
|
+
const country = options.country ?? (isPhone ? PHONE_DEFAULT_COUNTRY : "");
|
|
3973
|
+
const runtime = {
|
|
3974
|
+
...options,
|
|
3975
|
+
country
|
|
3976
|
+
};
|
|
3977
|
+
if (options.delimiter !== void 0) {
|
|
3978
|
+
runtime.delimiter = options.delimiter;
|
|
3979
|
+
} else if (isPhone) {
|
|
3980
|
+
runtime.delimiter = PHONE_DEFAULT_DELIMITER;
|
|
3981
|
+
}
|
|
3982
|
+
return runtime;
|
|
3983
|
+
};
|
|
3984
|
+
var formatValue = (value, formatType, options) => {
|
|
3985
|
+
switch (formatType) {
|
|
3986
|
+
case "phone":
|
|
3987
|
+
return formatPhone(value, options.country, options.delimiter);
|
|
3988
|
+
case "numeral":
|
|
3989
|
+
return M(value, options);
|
|
3990
|
+
case "date":
|
|
3991
|
+
return y(value, options);
|
|
3992
|
+
case "time":
|
|
3993
|
+
return w(value, options);
|
|
3994
|
+
case "creditCard":
|
|
3995
|
+
return E(value, options);
|
|
3996
|
+
case "creditCardType":
|
|
3997
|
+
return g(value, options.delimiter);
|
|
3998
|
+
case "general":
|
|
3999
|
+
return s(
|
|
4000
|
+
value,
|
|
4001
|
+
options
|
|
4002
|
+
);
|
|
4003
|
+
}
|
|
4004
|
+
};
|
|
4005
|
+
var getValueForFormatting = (value, formatType, options) => {
|
|
4006
|
+
if (formatType === "date") {
|
|
4007
|
+
return getDateValueFromRaw(value, options);
|
|
4008
|
+
}
|
|
4009
|
+
if (formatType === "time") {
|
|
4010
|
+
return getTimeValueFromRaw(value, options);
|
|
4011
|
+
}
|
|
4012
|
+
return value;
|
|
4013
|
+
};
|
|
4014
|
+
|
|
4015
|
+
// src/core/formatter.ts
|
|
4016
|
+
var format = (value, formatType, options = {}) => {
|
|
4017
|
+
if (!isFormatType(formatType)) {
|
|
4018
|
+
throw new TypeError(
|
|
4019
|
+
`Invalid formatType: ${String(formatType)}. Expected one of: ${FORMAT_TYPES.join(", ")}`
|
|
4020
|
+
);
|
|
4021
|
+
}
|
|
4022
|
+
if (value === null || value === void 0 || value === "") {
|
|
4023
|
+
return { formatted: "", raw: "", type: formatType };
|
|
4024
|
+
}
|
|
4025
|
+
const runtime = resolveRuntimeOptions(formatType, options);
|
|
4026
|
+
const stringValue = typeof value === "string" ? value : String(value);
|
|
4027
|
+
const cleanValue = stripPrefixAndSuffix(stringValue, runtime);
|
|
4028
|
+
const preValue = getValueForFormatting(cleanValue, formatType, runtime);
|
|
4029
|
+
const formatted = formatValue(preValue, formatType, runtime);
|
|
4030
|
+
const raw = formatType === "creditCardType" ? getRawValue(cleanValue, formatType, runtime) : getRawValue(formatted, formatType, runtime);
|
|
4031
|
+
return { formatted, raw, type: formatType };
|
|
4032
|
+
};
|
|
4033
|
+
|
|
4034
|
+
// src/core/regex.ts
|
|
4035
|
+
var regex = {
|
|
4036
|
+
phone: {
|
|
4037
|
+
// 10 digit phone numbers, allowing for optional country code and delimiters
|
|
4038
|
+
pattern: /^(?:\D*\d){10}\D*$/,
|
|
4039
|
+
errorMessage: "Please enter a valid 10-digit phone number."
|
|
4040
|
+
},
|
|
4041
|
+
email: {
|
|
4042
|
+
pattern: /^[^\s@]+@[^\s@]+\.[a-zA-Z]{2,}$/,
|
|
4043
|
+
errorMessage: "Please enter a valid email address."
|
|
4044
|
+
},
|
|
4045
|
+
rfc: {
|
|
4046
|
+
// Mexican RFC format (simplified)
|
|
4047
|
+
pattern: /^([A-ZÑ&]{3,4})\d{6}([A-Z0-9]{0,3})$/i,
|
|
4048
|
+
errorMessage: "Please enter a valid RFC."
|
|
4049
|
+
},
|
|
4050
|
+
numeral: {
|
|
4051
|
+
// Numbers with optional thousand separators and decimal points
|
|
4052
|
+
pattern: /\d{1,3}(,\d{3})*(\.\d+)?/,
|
|
4053
|
+
errorMessage: "Please enter a valid number."
|
|
4054
|
+
},
|
|
4055
|
+
onlyNumbers: {
|
|
4056
|
+
pattern: /^\d+$/,
|
|
4057
|
+
errorMessage: "Please enter only numbers."
|
|
4058
|
+
},
|
|
4059
|
+
creditCard: {
|
|
4060
|
+
// 15 or 16 digits, allowing spaces or delimiters
|
|
4061
|
+
pattern: /^(?:\D*\d){15,16}\D*$/,
|
|
4062
|
+
errorMessage: "Please enter a valid card number."
|
|
4063
|
+
},
|
|
4064
|
+
expirationDate: {
|
|
4065
|
+
// MM/YY format
|
|
4066
|
+
pattern: /^(0[1-9]|1[0-2])\/\d{2}$/,
|
|
4067
|
+
errorMessage: "Please enter a valid expiration date."
|
|
4068
|
+
},
|
|
4069
|
+
cardCvc: {
|
|
4070
|
+
// 3 or 4 digit card security codes
|
|
4071
|
+
pattern: /^\d{3,4}$/,
|
|
4072
|
+
errorMessage: "Please enter a valid CVC."
|
|
4073
|
+
},
|
|
4074
|
+
onlyLetters: {
|
|
4075
|
+
// Letters only (including accented characters and spaces)
|
|
4076
|
+
pattern: /^[A-Za-zÁÉÍÓÚáéíóúÑñ\s]+$/,
|
|
4077
|
+
errorMessage: "Please enter only letters."
|
|
4078
|
+
},
|
|
4079
|
+
onlyAlphanumeric: {
|
|
4080
|
+
// Letters and numbers (including accented characters and spaces)
|
|
4081
|
+
pattern: /^[A-Za-zÁÉÍÓÚáéíóúÑñ0-9\s]+$/,
|
|
4082
|
+
errorMessage: "Please enter only letters and numbers."
|
|
4083
|
+
}
|
|
4084
|
+
};
|
|
4085
|
+
|
|
4086
|
+
// src/browser/global.ts
|
|
4087
|
+
var Formatter = {
|
|
4088
|
+
format,
|
|
4089
|
+
regex,
|
|
4090
|
+
// Keep in sync with `version` in `package.json`.
|
|
4091
|
+
version: "1.0.0"
|
|
4092
|
+
};
|
|
4093
|
+
if (typeof window !== "undefined") {
|
|
4094
|
+
window.Formatter = Formatter;
|
|
4095
|
+
}
|
|
4096
|
+
var global_default = Formatter;
|
|
4097
|
+
return __toCommonJS(global_exports);
|
|
4098
|
+
})();
|