@scavio/twenty 0.0.0-stage → 0.1.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/README.md +83 -2
- package/dependencies/yarn.lock +2036 -0
- package/manifest.json +459 -0
- package/package.json +54 -4
- package/public/gallery/enrich-command.png +0 -0
- package/public/gallery/enriched-companies.png +0 -0
- package/public/logo.png +0 -0
- package/src/front-components/enrich-with-scavio.mjs +67 -0
- package/src/front-components/enrich-with-scavio.mjs.map +7 -0
- package/src/front-components/enrich-with-scavio.tsx +46 -0
- package/src/logic-functions/enrich-worker.mjs +3099 -0
- package/src/logic-functions/enrich-worker.mjs.map +7 -0
- package/src/logic-functions/enrich-worker.ts +34 -0
- package/src/logic-functions/health-check.mjs +122 -0
- package/src/logic-functions/health-check.mjs.map +7 -0
- package/src/logic-functions/health-check.ts +16 -0
- package/src/logic-functions/start-enrichment.mjs +518 -0
- package/src/logic-functions/start-enrichment.mjs.map +7 -0
- package/src/logic-functions/start-enrichment.ts +82 -0
|
@@ -0,0 +1,3099 @@
|
|
|
1
|
+
import { createRequire as __createRequire } from 'module';
|
|
2
|
+
const require = __createRequire(import.meta.url);
|
|
3
|
+
var __create = Object.create;
|
|
4
|
+
var __defProp = Object.defineProperty;
|
|
5
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
6
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
8
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
9
|
+
var __commonJS = (cb, mod) => function __require() {
|
|
10
|
+
try {
|
|
11
|
+
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
12
|
+
} catch (e2) {
|
|
13
|
+
throw mod = 0, e2;
|
|
14
|
+
}
|
|
15
|
+
};
|
|
16
|
+
var __copyProps = (to, from, except, desc) => {
|
|
17
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
18
|
+
for (let key of __getOwnPropNames(from))
|
|
19
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
20
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
21
|
+
}
|
|
22
|
+
return to;
|
|
23
|
+
};
|
|
24
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
25
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
26
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
27
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
28
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
29
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
30
|
+
mod
|
|
31
|
+
));
|
|
32
|
+
|
|
33
|
+
// node_modules/@sniptt/guards/build/guards/primitives.js
|
|
34
|
+
var require_primitives = __commonJS({
|
|
35
|
+
"node_modules/@sniptt/guards/build/guards/primitives.js"(exports) {
|
|
36
|
+
"use strict";
|
|
37
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
38
|
+
exports.isSymbol = exports.isBigInt = exports.isString = exports.isNumber = exports.isBoolean = exports.isUndefined = void 0;
|
|
39
|
+
var isUndefined = (term) => {
|
|
40
|
+
return typeof term === "undefined";
|
|
41
|
+
};
|
|
42
|
+
exports.isUndefined = isUndefined;
|
|
43
|
+
var isBoolean = (term) => {
|
|
44
|
+
return typeof term === "boolean";
|
|
45
|
+
};
|
|
46
|
+
exports.isBoolean = isBoolean;
|
|
47
|
+
var isNumber = (term) => {
|
|
48
|
+
return typeof term === "number" && !Number.isNaN(term);
|
|
49
|
+
};
|
|
50
|
+
exports.isNumber = isNumber;
|
|
51
|
+
var isString = (term) => {
|
|
52
|
+
return typeof term === "string";
|
|
53
|
+
};
|
|
54
|
+
exports.isString = isString;
|
|
55
|
+
var isBigInt = (term) => {
|
|
56
|
+
return typeof term === "bigint";
|
|
57
|
+
};
|
|
58
|
+
exports.isBigInt = isBigInt;
|
|
59
|
+
var isSymbol = (term) => {
|
|
60
|
+
return typeof term === "symbol";
|
|
61
|
+
};
|
|
62
|
+
exports.isSymbol = isSymbol;
|
|
63
|
+
}
|
|
64
|
+
});
|
|
65
|
+
|
|
66
|
+
// node_modules/@sniptt/guards/build/guards/structural.js
|
|
67
|
+
var require_structural = __commonJS({
|
|
68
|
+
"node_modules/@sniptt/guards/build/guards/structural.js"(exports) {
|
|
69
|
+
"use strict";
|
|
70
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
71
|
+
exports.isDate = exports.isWeakSet = exports.isWeakMap = exports.isSet = exports.isMap = exports.isArray = exports.isObject = exports.isFunction = exports.isNull = void 0;
|
|
72
|
+
var isNull = (term) => {
|
|
73
|
+
return term === null;
|
|
74
|
+
};
|
|
75
|
+
exports.isNull = isNull;
|
|
76
|
+
var isFunction = (term) => {
|
|
77
|
+
return typeof term === "function";
|
|
78
|
+
};
|
|
79
|
+
exports.isFunction = isFunction;
|
|
80
|
+
var isObject2 = (term) => {
|
|
81
|
+
return !exports.isNull(term) && typeof term === "object";
|
|
82
|
+
};
|
|
83
|
+
exports.isObject = isObject2;
|
|
84
|
+
var isArray = (term) => {
|
|
85
|
+
return Array.isArray(term);
|
|
86
|
+
};
|
|
87
|
+
exports.isArray = isArray;
|
|
88
|
+
var isMap = (term) => {
|
|
89
|
+
return term instanceof Map;
|
|
90
|
+
};
|
|
91
|
+
exports.isMap = isMap;
|
|
92
|
+
var isSet = (term) => {
|
|
93
|
+
return term instanceof Set;
|
|
94
|
+
};
|
|
95
|
+
exports.isSet = isSet;
|
|
96
|
+
var isWeakMap = (term) => {
|
|
97
|
+
return term instanceof WeakMap;
|
|
98
|
+
};
|
|
99
|
+
exports.isWeakMap = isWeakMap;
|
|
100
|
+
var isWeakSet = (term) => {
|
|
101
|
+
return term instanceof WeakSet;
|
|
102
|
+
};
|
|
103
|
+
exports.isWeakSet = isWeakSet;
|
|
104
|
+
var isDate = (term) => {
|
|
105
|
+
return term instanceof Date;
|
|
106
|
+
};
|
|
107
|
+
exports.isDate = isDate;
|
|
108
|
+
}
|
|
109
|
+
});
|
|
110
|
+
|
|
111
|
+
// node_modules/@sniptt/guards/build/guards/convenience.js
|
|
112
|
+
var require_convenience = __commonJS({
|
|
113
|
+
"node_modules/@sniptt/guards/build/guards/convenience.js"(exports) {
|
|
114
|
+
"use strict";
|
|
115
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
116
|
+
exports.isNegativeInteger = exports.isNonNegativeInteger = exports.isPositiveInteger = exports.isInteger = exports.isNumberOrNaN = exports.isNonEmptyString = exports.isNonEmptyArray = exports.isObjectOrNull = void 0;
|
|
117
|
+
var primitives_1 = require_primitives();
|
|
118
|
+
var structural_1 = require_structural();
|
|
119
|
+
var isObjectOrNull = (term) => {
|
|
120
|
+
return typeof term === "object";
|
|
121
|
+
};
|
|
122
|
+
exports.isObjectOrNull = isObjectOrNull;
|
|
123
|
+
var isNonEmptyArray = (term) => {
|
|
124
|
+
return structural_1.isArray(term) && term.length > 0;
|
|
125
|
+
};
|
|
126
|
+
exports.isNonEmptyArray = isNonEmptyArray;
|
|
127
|
+
var isNonEmptyString = (term) => {
|
|
128
|
+
return primitives_1.isString(term) && term.length > 0;
|
|
129
|
+
};
|
|
130
|
+
exports.isNonEmptyString = isNonEmptyString;
|
|
131
|
+
var isNumberOrNaN = (term) => {
|
|
132
|
+
return typeof term === "number";
|
|
133
|
+
};
|
|
134
|
+
exports.isNumberOrNaN = isNumberOrNaN;
|
|
135
|
+
var isInteger = (term) => {
|
|
136
|
+
return primitives_1.isNumber(term) && Number.isInteger(term);
|
|
137
|
+
};
|
|
138
|
+
exports.isInteger = isInteger;
|
|
139
|
+
var isPositiveInteger = (term) => {
|
|
140
|
+
return exports.isInteger(term) && term > 0;
|
|
141
|
+
};
|
|
142
|
+
exports.isPositiveInteger = isPositiveInteger;
|
|
143
|
+
var isNonNegativeInteger = (term) => {
|
|
144
|
+
return exports.isInteger(term) && term >= 0;
|
|
145
|
+
};
|
|
146
|
+
exports.isNonNegativeInteger = isNonNegativeInteger;
|
|
147
|
+
var isNegativeInteger = (term) => {
|
|
148
|
+
return exports.isInteger(term) && term < 0;
|
|
149
|
+
};
|
|
150
|
+
exports.isNegativeInteger = isNegativeInteger;
|
|
151
|
+
}
|
|
152
|
+
});
|
|
153
|
+
|
|
154
|
+
// node_modules/@sniptt/guards/build/index.js
|
|
155
|
+
var require_build = __commonJS({
|
|
156
|
+
"node_modules/@sniptt/guards/build/index.js"(exports) {
|
|
157
|
+
"use strict";
|
|
158
|
+
var __createBinding = exports && exports.__createBinding || (Object.create ? (function(o2, m, k, k2) {
|
|
159
|
+
if (k2 === void 0) k2 = k;
|
|
160
|
+
Object.defineProperty(o2, k2, { enumerable: true, get: function() {
|
|
161
|
+
return m[k];
|
|
162
|
+
} });
|
|
163
|
+
}) : (function(o2, m, k, k2) {
|
|
164
|
+
if (k2 === void 0) k2 = k;
|
|
165
|
+
o2[k2] = m[k];
|
|
166
|
+
}));
|
|
167
|
+
var __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? (function(o2, v) {
|
|
168
|
+
Object.defineProperty(o2, "default", { enumerable: true, value: v });
|
|
169
|
+
}) : function(o2, v) {
|
|
170
|
+
o2["default"] = v;
|
|
171
|
+
});
|
|
172
|
+
var __importStar = exports && exports.__importStar || function(mod) {
|
|
173
|
+
if (mod && mod.__esModule) return mod;
|
|
174
|
+
var result2 = {};
|
|
175
|
+
if (mod != null) {
|
|
176
|
+
for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result2, mod, k);
|
|
177
|
+
}
|
|
178
|
+
__setModuleDefault(result2, mod);
|
|
179
|
+
return result2;
|
|
180
|
+
};
|
|
181
|
+
var __exportStar = exports && exports.__exportStar || function(m, exports2) {
|
|
182
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports2, p)) __createBinding(exports2, m, p);
|
|
183
|
+
};
|
|
184
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
185
|
+
exports.structural = exports.primitives = exports.convenience = void 0;
|
|
186
|
+
exports.convenience = __importStar(require_convenience());
|
|
187
|
+
__exportStar(require_convenience(), exports);
|
|
188
|
+
exports.primitives = __importStar(require_primitives());
|
|
189
|
+
__exportStar(require_primitives(), exports);
|
|
190
|
+
exports.structural = __importStar(require_structural());
|
|
191
|
+
__exportStar(require_structural(), exports);
|
|
192
|
+
}
|
|
193
|
+
});
|
|
194
|
+
|
|
195
|
+
// src/logic-functions/enrich-worker.ts
|
|
196
|
+
import { CoreApiClient } from "twenty-client-sdk/core";
|
|
197
|
+
|
|
198
|
+
// twenty-sdk-define-stub:__twenty-sdk-define-stub__
|
|
199
|
+
var __defineFactoryStub = (config) => ({
|
|
200
|
+
success: true,
|
|
201
|
+
config,
|
|
202
|
+
errors: []
|
|
203
|
+
});
|
|
204
|
+
var __anyHandler = {
|
|
205
|
+
get(_target, prop) {
|
|
206
|
+
if (prop === "__esModule") return true;
|
|
207
|
+
if (prop === Symbol.toPrimitive) return () => "";
|
|
208
|
+
if (typeof prop === "symbol") return void 0;
|
|
209
|
+
return new Proxy(() => void 0, __anyHandler);
|
|
210
|
+
},
|
|
211
|
+
apply() {
|
|
212
|
+
return new Proxy(() => void 0, __anyHandler);
|
|
213
|
+
}
|
|
214
|
+
};
|
|
215
|
+
var __anyStub = new Proxy(() => void 0, __anyHandler);
|
|
216
|
+
var defineLogicFunction = __defineFactoryStub;
|
|
217
|
+
|
|
218
|
+
// src/constants/universal-identifiers.ts
|
|
219
|
+
var LOGIC_FUNCTION_UNIVERSAL_IDENTIFIERS = {
|
|
220
|
+
startEnrichment: "3299b3b9-f0cd-4ed8-aa81-5ec2b4650606",
|
|
221
|
+
enrichWorker: "d677dd12-557a-4a33-b285-d360b879ebdd"
|
|
222
|
+
};
|
|
223
|
+
|
|
224
|
+
// src/scavio/constants.ts
|
|
225
|
+
var SCAVIO_API_KEY_ENV_VAR_NAME = "SCAVIO_API_KEY";
|
|
226
|
+
var SCAVIO_BASE_URL = "https://api.scavio.dev";
|
|
227
|
+
var SCAVIO_ENRICH_PATH = "/api/v1/company/enrich";
|
|
228
|
+
var CLIENT_SOURCE_HEADER_VALUE = "twenty-app";
|
|
229
|
+
var USER_AGENT = "scavio-twenty/0.1.0";
|
|
230
|
+
var ENRICH_REQUEST_TIMEOUT_MS = 18e4;
|
|
231
|
+
var WORKER_TIMEOUT_SECONDS = 900;
|
|
232
|
+
var WORKER_START_BUDGET_MS = 6e5;
|
|
233
|
+
var RATE_LIMIT_RETRY_DELAY_MS = 3e4;
|
|
234
|
+
var MAX_RATE_LIMIT_RETRIES = 20;
|
|
235
|
+
var MAX_EMAILS = 10;
|
|
236
|
+
var MAX_PHONES = 5;
|
|
237
|
+
|
|
238
|
+
// src/scavio/client.ts
|
|
239
|
+
var buildHeaders = (apiKey) => ({
|
|
240
|
+
Authorization: `Bearer ${apiKey}`,
|
|
241
|
+
"Content-Type": "application/json",
|
|
242
|
+
"User-Agent": USER_AGENT,
|
|
243
|
+
"x-client-source": CLIENT_SOURCE_HEADER_VALUE
|
|
244
|
+
});
|
|
245
|
+
var readErrorMessage = async (response) => {
|
|
246
|
+
try {
|
|
247
|
+
const body = await response.json();
|
|
248
|
+
if (typeof body?.error === "string" && body.error !== "") {
|
|
249
|
+
return body.error.slice(0, 300);
|
|
250
|
+
}
|
|
251
|
+
} catch {
|
|
252
|
+
}
|
|
253
|
+
return `Scavio answered HTTP ${response.status}.`;
|
|
254
|
+
};
|
|
255
|
+
var isScavioEnrichResponse = (value) => {
|
|
256
|
+
const data = value?.data;
|
|
257
|
+
return typeof data === "object" && data !== null && typeof data.company === "object" && data.company !== null;
|
|
258
|
+
};
|
|
259
|
+
var enrichCompany = async ({
|
|
260
|
+
apiKey,
|
|
261
|
+
domain,
|
|
262
|
+
fetchImpl = fetch,
|
|
263
|
+
timeoutMs = ENRICH_REQUEST_TIMEOUT_MS
|
|
264
|
+
}) => {
|
|
265
|
+
const controller = new AbortController();
|
|
266
|
+
const timer = setTimeout(() => controller.abort(), timeoutMs);
|
|
267
|
+
try {
|
|
268
|
+
const response = await fetchImpl(`${SCAVIO_BASE_URL}${SCAVIO_ENRICH_PATH}`, {
|
|
269
|
+
method: "POST",
|
|
270
|
+
headers: buildHeaders(apiKey),
|
|
271
|
+
body: JSON.stringify({ url: domain }),
|
|
272
|
+
signal: controller.signal
|
|
273
|
+
});
|
|
274
|
+
switch (response.status) {
|
|
275
|
+
case 200: {
|
|
276
|
+
const body = await response.json();
|
|
277
|
+
if (!isScavioEnrichResponse(body)) {
|
|
278
|
+
return { kind: "error", message: "Scavio returned an unexpected response." };
|
|
279
|
+
}
|
|
280
|
+
return { kind: "ok", response: body };
|
|
281
|
+
}
|
|
282
|
+
case 400:
|
|
283
|
+
return { kind: "invalid", message: await readErrorMessage(response) };
|
|
284
|
+
case 401:
|
|
285
|
+
case 403:
|
|
286
|
+
return { kind: "auth" };
|
|
287
|
+
case 402:
|
|
288
|
+
return { kind: "credits" };
|
|
289
|
+
case 429:
|
|
290
|
+
return { kind: "rateLimited" };
|
|
291
|
+
case 502:
|
|
292
|
+
return { kind: "unreachable" };
|
|
293
|
+
default:
|
|
294
|
+
return { kind: "error", message: await readErrorMessage(response) };
|
|
295
|
+
}
|
|
296
|
+
} catch (error) {
|
|
297
|
+
const aborted = error instanceof Error && error.name === "AbortError";
|
|
298
|
+
return {
|
|
299
|
+
kind: "error",
|
|
300
|
+
message: aborted ? "Scavio did not answer in time. Run the enrichment again for this company." : "Scavio could not be reached. Run the enrichment again for this company."
|
|
301
|
+
};
|
|
302
|
+
} finally {
|
|
303
|
+
clearTimeout(timer);
|
|
304
|
+
}
|
|
305
|
+
};
|
|
306
|
+
|
|
307
|
+
// src/scavio/company-repository.ts
|
|
308
|
+
var PAGE_SIZE = 200;
|
|
309
|
+
var createCompanyRepository = (client) => ({
|
|
310
|
+
read: async (ids) => {
|
|
311
|
+
const records = [];
|
|
312
|
+
for (let start = 0; start < ids.length; start += PAGE_SIZE) {
|
|
313
|
+
const page = ids.slice(start, start + PAGE_SIZE);
|
|
314
|
+
const result2 = await client.query({
|
|
315
|
+
companies: {
|
|
316
|
+
__args: { filter: { id: { in: page } }, first: page.length },
|
|
317
|
+
edges: {
|
|
318
|
+
node: {
|
|
319
|
+
id: true,
|
|
320
|
+
name: true,
|
|
321
|
+
domainName: { primaryLinkUrl: true },
|
|
322
|
+
linkedinLink: { primaryLinkUrl: true },
|
|
323
|
+
scavioEnrichmentStatus: true
|
|
324
|
+
}
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
});
|
|
328
|
+
for (const edge of result2.companies?.edges ?? []) {
|
|
329
|
+
if (edge?.node?.id) {
|
|
330
|
+
records.push(edge.node);
|
|
331
|
+
}
|
|
332
|
+
}
|
|
333
|
+
}
|
|
334
|
+
return records;
|
|
335
|
+
},
|
|
336
|
+
update: async (id, data) => {
|
|
337
|
+
await client.mutation({
|
|
338
|
+
updateCompany: { __args: { id, data }, id: true }
|
|
339
|
+
});
|
|
340
|
+
},
|
|
341
|
+
updateMany: async (ids, data) => {
|
|
342
|
+
for (let start = 0; start < ids.length; start += PAGE_SIZE) {
|
|
343
|
+
await client.mutation({
|
|
344
|
+
updateCompanies: {
|
|
345
|
+
__args: { filter: { id: { in: ids.slice(start, start + PAGE_SIZE) } }, data },
|
|
346
|
+
id: true
|
|
347
|
+
}
|
|
348
|
+
});
|
|
349
|
+
}
|
|
350
|
+
}
|
|
351
|
+
});
|
|
352
|
+
|
|
353
|
+
// node_modules/twenty-sdk/dist/logic-function/index.mjs
|
|
354
|
+
var import_guards = __toESM(require_build(), 1);
|
|
355
|
+
import { MetadataApiClient as o } from "twenty-client-sdk/metadata";
|
|
356
|
+
var S = ({ objectNameSingular: e2, recordId: t2, displayName: n2 }) => `[[record:${e2}:${t2}:${n2}]]`;
|
|
357
|
+
var C = "\n id\n handle\n displayName\n visibility\n connectedAccountId\n isSyncEnabled\n participantHandleFieldUniversalIdentifier\n messagingProviderUniversalIdentifier\n";
|
|
358
|
+
var w = `
|
|
359
|
+
mutation CreateAppMessageChannel($input: CreateAppMessageChannelInput!) {
|
|
360
|
+
createAppMessageChannel(input: $input) {
|
|
361
|
+
${C}
|
|
362
|
+
}
|
|
363
|
+
}
|
|
364
|
+
`;
|
|
365
|
+
var E = `
|
|
366
|
+
query ListAppMessageChannels($filter: ListAppMessageChannelsInput) {
|
|
367
|
+
appMessageChannels(filter: $filter) {
|
|
368
|
+
${C}
|
|
369
|
+
}
|
|
370
|
+
}
|
|
371
|
+
`;
|
|
372
|
+
var O = `
|
|
373
|
+
mutation UpdateAppMessageChannel($input: UpdateAppMessageChannelInput!) {
|
|
374
|
+
updateAppMessageChannel(input: $input) {
|
|
375
|
+
${C}
|
|
376
|
+
}
|
|
377
|
+
}
|
|
378
|
+
`;
|
|
379
|
+
var A = `
|
|
380
|
+
mutation DeleteAppMessageChannel($id: UUID!) {
|
|
381
|
+
deleteAppMessageChannel(id: $id) {
|
|
382
|
+
${C}
|
|
383
|
+
}
|
|
384
|
+
}
|
|
385
|
+
`;
|
|
386
|
+
var L = "\n id\n externalId\n name\n isSynced\n messageChannelId\n";
|
|
387
|
+
var R = `
|
|
388
|
+
query ListAppMessageFolders($filter: ListAppMessageFoldersInput) {
|
|
389
|
+
appMessageFolders(filter: $filter) {
|
|
390
|
+
${L}
|
|
391
|
+
}
|
|
392
|
+
}
|
|
393
|
+
`;
|
|
394
|
+
var B = `
|
|
395
|
+
mutation SyncAppMessageFolders($input: SyncAppMessageFoldersInput!) {
|
|
396
|
+
syncAppMessageFolders(input: $input) {
|
|
397
|
+
${L}
|
|
398
|
+
}
|
|
399
|
+
}
|
|
400
|
+
`;
|
|
401
|
+
var U = "agentChatAssistant";
|
|
402
|
+
var ze = S({
|
|
403
|
+
objectNameSingular: U,
|
|
404
|
+
recordId: U,
|
|
405
|
+
displayName: "Ada"
|
|
406
|
+
});
|
|
407
|
+
var Ue = async (e2) => {
|
|
408
|
+
let { enqueueJobs: t2 } = await new o().mutation({ enqueueJobs: {
|
|
409
|
+
__args: { input: e2 },
|
|
410
|
+
enqueued: true,
|
|
411
|
+
logicFunctionUniversalIdentifier: true,
|
|
412
|
+
enqueuedJobsCount: true,
|
|
413
|
+
jobIds: true,
|
|
414
|
+
jobs: {
|
|
415
|
+
jobId: true,
|
|
416
|
+
sizeBytes: true
|
|
417
|
+
},
|
|
418
|
+
availableBytes: true
|
|
419
|
+
} });
|
|
420
|
+
return t2;
|
|
421
|
+
};
|
|
422
|
+
|
|
423
|
+
// src/scavio/enqueue-workers.ts
|
|
424
|
+
var enqueueWorkers = async (payloads, options) => {
|
|
425
|
+
if (payloads.length === 0) {
|
|
426
|
+
return;
|
|
427
|
+
}
|
|
428
|
+
await Ue({
|
|
429
|
+
logicFunctionUniversalIdentifier: LOGIC_FUNCTION_UNIVERSAL_IDENTIFIERS.enrichWorker,
|
|
430
|
+
jobs: payloads.map((payload) => ({ payload })),
|
|
431
|
+
...options?.delayMs ? { delayMs: options.delayMs } : {}
|
|
432
|
+
});
|
|
433
|
+
};
|
|
434
|
+
|
|
435
|
+
// node_modules/libphonenumber-js/metadata.min.json.js
|
|
436
|
+
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|[2-467])\\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]|9(?:5[0-3]|6[0-4]))\\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)|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}", [10], [["(\\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", "90\\d{5}|(?:0800|[2-6]|(?:7|800)\\d)\\d{6}", [7, 8, 10], [["(\\d{2})(\\d{5})", "$1 $2", ["90"]], ["(\\d{3})(\\d{4})", "$1 $2", ["[2-6]"]], ["(\\d{2})(\\d{3})(\\d{3})", "$1 $2 $3", ["7"]], ["(\\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]|[67]3)|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]|9(?:5[0-3]|6[0-4]))\\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})", "$1 $2", ["101", "1010", "10100"], "0$1"], ["(\\d{2})(\\d{5,6})", "$1 $2", ["(?:10|2[0-57-9])[19]|3(?:[15]|35|49|9[1-68])|4(?:1[125-9]|2[179]|[35][1-9]|6[47-9]|7|8[23])|5(?:[1357]|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-35]|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]|5[14-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|3|4[13]|5[1-5]|9[0-35-9])|[39]7[0-79]", "10(?:12|9[56])|2[0-57-9](?:1[02]|9[56])|(?:3(?:[15]\\d|35|49|7[0-79]|9[1-68])|4(?:1[125-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-35]|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]|3\\d|4[13]|5[1-5]|7[0-79]|9[0-35-9]))1", "10(?:123|9[56])|2[0-57-9](?:1(?:00|23)|9[56])|(?:3(?:[15]\\d|35|49|7[0-79]|9[1-68])|4(?:1[125-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-35]|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]|3\\d|4[13]|5[1-5]|7[0-79]|9[0-35-9]))12", "10(?:123|9[56])|2[0-57-9](?:1(?:00|23)|9[56])|(?:3(?:[15]\\d|35|49|7[0-79]|9[1-68])|4(?:1[125-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-35]|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]|3\\d|4[13]|5[1-5]|7[0-79]|9[0-35-9]))123"], "0$1"], ["(\\d{4})(\\d{4})", "$1 $2", ["101", "1010"]], ["(\\d{3})(\\d{5,6})", "$1 $2", ["3(?:[15]|35|49|7[0-79]|9[1-68])|4(?:1[125-9]|2[179]|[35][1-9]|6[47-9]|7|8[23])|5(?:[1357]|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-35]|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]|5[14-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|[379]|4[13]|5[1-5])", "(?:3(?:[15]\\d|35|49|7[0-79]|9[1-68])|4(?:1[125-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-35]|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]))[19]", "(?:3(?:[15]\\d|35|49|7[0-79]|9[1-68])|4(?:1[125-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-35]|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])", "(?:3(?:[15]\\d|35|49|7[0-79]|9[1-68])|4(?:1[125-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-35]|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", ["[48]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-6])|4(?:1[25-9]|[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])|(?:31|55|79|87)[02-9]"], "0$1", 1], ["(\\d{3})(\\d{7,8})", "$1 $2", ["9"]], ["(\\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]|94"]], ["(\\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]|9(?:5[0-3]|6[0-4]))\\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[03-68]", "15(?:[0568]|3[13]|41)"], "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]|3[01]|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", "400\\d{6}|(?:51|[6-9]\\d)\\d{7}", [9], [["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["[89]00"]], ["(\\d{3})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[4-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{2})(\\d{2})(\\d{2})", "$1 $2 $3", ["[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", "[48]\\d{8}|[2-9]\\d{6}", [7, 9], [["(\\d{3})(\\d{4})", "$1 $2", ["[235-9]|4(?:[0-35]|4[16-9])"]], ["(\\d{2})(\\d{3})(\\d{4})", "$1 $2 $3", ["[48]"]]]], "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(?:05|[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-5]|80[2-46]", "11|2[02]|33|4[04]|79[1-5]|80(?:[2-4]|6[0-589])", "11|2[02]|33|4[04]|79(?:[1245]|3(?:[02-9]|1[0-24-9]))|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", "(?:2\\d|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", ["2"], "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-9]"]], ["(\\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[02-46-9]"]], ["(\\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-8])"], "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", "(?:[2378]\\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", ["[237-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(?:[0-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", "(?:[2569]\\d|8)\\d{3}", [4, 5], 0, 0, 0, 0, 0, 0, "[2569]"], "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-7]\\d{7}", [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$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", "20240"], "0$1"], ["(\\d{3})(\\d{6})", "$1 $2", ["20[0-35-7]|4(?:6[45]|[7-9])|[7-9]", "20(?:[0135-7]|2[5-9])|4(?:6[45]|[7-9])|[7-9]"], "0$1"], ["(\\d{2})(\\d{7})", "$1 $2", ["[2-4]"], "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, [["983[2-57-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[02469]|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[02589]|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", ["[1357-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", "8\\d{6}(?:\\d{3})?|[235-8]\\d{8}", [7, 9, 10], [["(\\d{3})(\\d{4})", "$1 $2", ["80"], "0$1"], ["(\\d{2})(\\d{3})(\\d{3,4})", "$1 $2 $3", ["29[013-9]"], "0$1"], ["(\\d{2})(\\d{7})", "$1 $2", ["[256]|39|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", ["3"], "0$1"], ["(\\d{4})(\\d{6})", "$1 $2", ["8"], "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}"]]] } };
|
|
437
|
+
|
|
438
|
+
// node_modules/libphonenumber-js/min/exports/withMetadataArgument.js
|
|
439
|
+
function withMetadataArgument(func, _arguments) {
|
|
440
|
+
var args = Array.prototype.slice.call(_arguments);
|
|
441
|
+
args.push(metadata_min_json_default);
|
|
442
|
+
return func.apply(this, args);
|
|
443
|
+
}
|
|
444
|
+
|
|
445
|
+
// node_modules/libphonenumber-js/es6/tools/semver-compare.js
|
|
446
|
+
function semver_compare_default(a2, b) {
|
|
447
|
+
a2 = a2.split("-");
|
|
448
|
+
b = b.split("-");
|
|
449
|
+
var pa = a2[0].split(".");
|
|
450
|
+
var pb = b[0].split(".");
|
|
451
|
+
for (var i2 = 0; i2 < 3; i2++) {
|
|
452
|
+
var na = Number(pa[i2]);
|
|
453
|
+
var nb = Number(pb[i2]);
|
|
454
|
+
if (na > nb) return 1;
|
|
455
|
+
if (nb > na) return -1;
|
|
456
|
+
if (!isNaN(na) && isNaN(nb)) return 1;
|
|
457
|
+
if (isNaN(na) && !isNaN(nb)) return -1;
|
|
458
|
+
}
|
|
459
|
+
if (a2[1] && b[1]) {
|
|
460
|
+
return a2[1] > b[1] ? 1 : a2[1] < b[1] ? -1 : 0;
|
|
461
|
+
}
|
|
462
|
+
return !a2[1] && b[1] ? 1 : a2[1] && !b[1] ? -1 : 0;
|
|
463
|
+
}
|
|
464
|
+
|
|
465
|
+
// node_modules/libphonenumber-js/es6/helpers/isObject.js
|
|
466
|
+
var objectConstructor = {}.constructor;
|
|
467
|
+
function isObject(object) {
|
|
468
|
+
return object !== void 0 && object !== null && object.constructor === objectConstructor;
|
|
469
|
+
}
|
|
470
|
+
|
|
471
|
+
// node_modules/libphonenumber-js/es6/helpers/isCallingCode.js
|
|
472
|
+
var CALLING_CODE_REG_EXP = /^\d+$/;
|
|
473
|
+
function isCallingCode(string) {
|
|
474
|
+
return CALLING_CODE_REG_EXP.test(string);
|
|
475
|
+
}
|
|
476
|
+
|
|
477
|
+
// node_modules/libphonenumber-js/es6/metadata.js
|
|
478
|
+
function _typeof(o2) {
|
|
479
|
+
"@babel/helpers - typeof";
|
|
480
|
+
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o3) {
|
|
481
|
+
return typeof o3;
|
|
482
|
+
} : function(o3) {
|
|
483
|
+
return o3 && "function" == typeof Symbol && o3.constructor === Symbol && o3 !== Symbol.prototype ? "symbol" : typeof o3;
|
|
484
|
+
}, _typeof(o2);
|
|
485
|
+
}
|
|
486
|
+
function _classCallCheck(a2, n2) {
|
|
487
|
+
if (!(a2 instanceof n2)) throw new TypeError("Cannot call a class as a function");
|
|
488
|
+
}
|
|
489
|
+
function _defineProperties(e2, r2) {
|
|
490
|
+
for (var t2 = 0; t2 < r2.length; t2++) {
|
|
491
|
+
var o2 = r2[t2];
|
|
492
|
+
o2.enumerable = o2.enumerable || false, o2.configurable = true, "value" in o2 && (o2.writable = true), Object.defineProperty(e2, _toPropertyKey(o2.key), o2);
|
|
493
|
+
}
|
|
494
|
+
}
|
|
495
|
+
function _createClass(e2, r2, t2) {
|
|
496
|
+
return r2 && _defineProperties(e2.prototype, r2), t2 && _defineProperties(e2, t2), Object.defineProperty(e2, "prototype", { writable: false }), e2;
|
|
497
|
+
}
|
|
498
|
+
function _toPropertyKey(t2) {
|
|
499
|
+
var i2 = _toPrimitive(t2, "string");
|
|
500
|
+
return "symbol" == _typeof(i2) ? i2 : i2 + "";
|
|
501
|
+
}
|
|
502
|
+
function _toPrimitive(t2, r2) {
|
|
503
|
+
if ("object" != _typeof(t2) || !t2) return t2;
|
|
504
|
+
var e2 = t2[Symbol.toPrimitive];
|
|
505
|
+
if (void 0 !== e2) {
|
|
506
|
+
var i2 = e2.call(t2, r2 || "default");
|
|
507
|
+
if ("object" != _typeof(i2)) return i2;
|
|
508
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
509
|
+
}
|
|
510
|
+
return ("string" === r2 ? String : Number)(t2);
|
|
511
|
+
}
|
|
512
|
+
var V3 = "1.2.0";
|
|
513
|
+
var V4 = "1.7.35";
|
|
514
|
+
var DEFAULT_EXT_PREFIX = " ext. ";
|
|
515
|
+
var Metadata = /* @__PURE__ */ (function() {
|
|
516
|
+
function Metadata2(metadata) {
|
|
517
|
+
_classCallCheck(this, Metadata2);
|
|
518
|
+
validateMetadata(metadata);
|
|
519
|
+
this.metadata = metadata;
|
|
520
|
+
setVersion.call(this, metadata);
|
|
521
|
+
}
|
|
522
|
+
return _createClass(Metadata2, [{
|
|
523
|
+
key: "getCountries",
|
|
524
|
+
value: function getCountries() {
|
|
525
|
+
return Object.keys(this.metadata.countries).filter(function(_) {
|
|
526
|
+
return _ !== "001";
|
|
527
|
+
});
|
|
528
|
+
}
|
|
529
|
+
}, {
|
|
530
|
+
key: "getCountryMetadata",
|
|
531
|
+
value: function getCountryMetadata(countryCode) {
|
|
532
|
+
return this.metadata.countries[countryCode];
|
|
533
|
+
}
|
|
534
|
+
}, {
|
|
535
|
+
key: "nonGeographic",
|
|
536
|
+
value: function nonGeographic() {
|
|
537
|
+
if (this.v1 || this.v2 || this.v3) return;
|
|
538
|
+
return this.metadata.nonGeographic || this.metadata.nonGeographical;
|
|
539
|
+
}
|
|
540
|
+
}, {
|
|
541
|
+
key: "hasCountry",
|
|
542
|
+
value: function hasCountry(country) {
|
|
543
|
+
return this.getCountryMetadata(country) !== void 0;
|
|
544
|
+
}
|
|
545
|
+
}, {
|
|
546
|
+
key: "hasCallingCode",
|
|
547
|
+
value: function hasCallingCode(callingCode) {
|
|
548
|
+
if (this.getCountryCodesForCallingCode(callingCode)) {
|
|
549
|
+
return true;
|
|
550
|
+
}
|
|
551
|
+
if (this.nonGeographic()) {
|
|
552
|
+
if (this.nonGeographic()[callingCode]) {
|
|
553
|
+
return true;
|
|
554
|
+
}
|
|
555
|
+
} else {
|
|
556
|
+
var countryCodes = this.countryCallingCodes()[callingCode];
|
|
557
|
+
if (countryCodes && countryCodes.length === 1 && countryCodes[0] === "001") {
|
|
558
|
+
return true;
|
|
559
|
+
}
|
|
560
|
+
}
|
|
561
|
+
}
|
|
562
|
+
}, {
|
|
563
|
+
key: "isNonGeographicCallingCode",
|
|
564
|
+
value: function isNonGeographicCallingCode(callingCode) {
|
|
565
|
+
if (this.nonGeographic()) {
|
|
566
|
+
return this.nonGeographic()[callingCode] ? true : false;
|
|
567
|
+
} else {
|
|
568
|
+
return this.getCountryCodesForCallingCode(callingCode) ? false : true;
|
|
569
|
+
}
|
|
570
|
+
}
|
|
571
|
+
// Deprecated.
|
|
572
|
+
}, {
|
|
573
|
+
key: "country",
|
|
574
|
+
value: function country(countryCode) {
|
|
575
|
+
return this.selectNumberingPlan(countryCode);
|
|
576
|
+
}
|
|
577
|
+
/**
|
|
578
|
+
* Selects a telephone numbering plan based on either a country code or a calling code.
|
|
579
|
+
* @param {string} argument — Country code or calling code.
|
|
580
|
+
* @param {string} legacyArgumentCallingCode — Legacy argument: calling code, if the first argument is not passed.
|
|
581
|
+
*/
|
|
582
|
+
}, {
|
|
583
|
+
key: "selectNumberingPlan",
|
|
584
|
+
value: function selectNumberingPlan(argument, legacyArgumentCallingCode) {
|
|
585
|
+
var countryCode;
|
|
586
|
+
var callingCode;
|
|
587
|
+
if (argument) {
|
|
588
|
+
if (isCallingCode(argument)) {
|
|
589
|
+
callingCode = argument;
|
|
590
|
+
} else {
|
|
591
|
+
countryCode = argument;
|
|
592
|
+
}
|
|
593
|
+
}
|
|
594
|
+
if (legacyArgumentCallingCode) {
|
|
595
|
+
callingCode = legacyArgumentCallingCode;
|
|
596
|
+
}
|
|
597
|
+
if (countryCode && countryCode !== "001") {
|
|
598
|
+
var countryMetadata = this.getCountryMetadata(countryCode);
|
|
599
|
+
if (!countryMetadata) {
|
|
600
|
+
throw new Error("Unknown country: ".concat(countryCode));
|
|
601
|
+
}
|
|
602
|
+
this.numberingPlan = new NumberingPlan(countryMetadata, this);
|
|
603
|
+
} else if (callingCode) {
|
|
604
|
+
if (!this.hasCallingCode(callingCode)) {
|
|
605
|
+
throw new Error("Unknown calling code: ".concat(callingCode));
|
|
606
|
+
}
|
|
607
|
+
this.numberingPlan = new NumberingPlan(this.getNumberingPlanMetadata(callingCode), this);
|
|
608
|
+
} else {
|
|
609
|
+
this.numberingPlan = void 0;
|
|
610
|
+
}
|
|
611
|
+
return this;
|
|
612
|
+
}
|
|
613
|
+
}, {
|
|
614
|
+
key: "getCountryCodesForCallingCode",
|
|
615
|
+
value: function getCountryCodesForCallingCode(callingCode) {
|
|
616
|
+
var countryCodes = this.countryCallingCodes()[callingCode];
|
|
617
|
+
if (countryCodes) {
|
|
618
|
+
if (countryCodes.length === 1 && countryCodes[0].length === 3) {
|
|
619
|
+
return;
|
|
620
|
+
}
|
|
621
|
+
return countryCodes;
|
|
622
|
+
}
|
|
623
|
+
}
|
|
624
|
+
}, {
|
|
625
|
+
key: "getCountryCodeForCallingCode",
|
|
626
|
+
value: function getCountryCodeForCallingCode(callingCode) {
|
|
627
|
+
var countryCodes = this.getCountryCodesForCallingCode(callingCode);
|
|
628
|
+
if (countryCodes) {
|
|
629
|
+
return countryCodes[0];
|
|
630
|
+
}
|
|
631
|
+
}
|
|
632
|
+
}, {
|
|
633
|
+
key: "getNumberingPlanMetadata",
|
|
634
|
+
value: function getNumberingPlanMetadata(callingCode) {
|
|
635
|
+
var countryCode = this.getCountryCodeForCallingCode(callingCode);
|
|
636
|
+
if (countryCode) {
|
|
637
|
+
return this.getCountryMetadata(countryCode);
|
|
638
|
+
}
|
|
639
|
+
if (this.nonGeographic()) {
|
|
640
|
+
var metadata = this.nonGeographic()[callingCode];
|
|
641
|
+
if (metadata) {
|
|
642
|
+
return metadata;
|
|
643
|
+
}
|
|
644
|
+
} else {
|
|
645
|
+
var countryCodes = this.countryCallingCodes()[callingCode];
|
|
646
|
+
if (countryCodes && countryCodes.length === 1 && countryCodes[0] === "001") {
|
|
647
|
+
return this.metadata.countries["001"];
|
|
648
|
+
}
|
|
649
|
+
}
|
|
650
|
+
}
|
|
651
|
+
// Deprecated.
|
|
652
|
+
}, {
|
|
653
|
+
key: "countryCallingCode",
|
|
654
|
+
value: function countryCallingCode() {
|
|
655
|
+
return this.numberingPlan.callingCode();
|
|
656
|
+
}
|
|
657
|
+
// Deprecated.
|
|
658
|
+
}, {
|
|
659
|
+
key: "IDDPrefix",
|
|
660
|
+
value: function IDDPrefix() {
|
|
661
|
+
return this.numberingPlan.IDDPrefix();
|
|
662
|
+
}
|
|
663
|
+
// Deprecated.
|
|
664
|
+
}, {
|
|
665
|
+
key: "defaultIDDPrefix",
|
|
666
|
+
value: function defaultIDDPrefix() {
|
|
667
|
+
return this.numberingPlan.defaultIDDPrefix();
|
|
668
|
+
}
|
|
669
|
+
// Deprecated.
|
|
670
|
+
}, {
|
|
671
|
+
key: "nationalNumberPattern",
|
|
672
|
+
value: function nationalNumberPattern() {
|
|
673
|
+
return this.numberingPlan.nationalNumberPattern();
|
|
674
|
+
}
|
|
675
|
+
// Deprecated.
|
|
676
|
+
}, {
|
|
677
|
+
key: "possibleLengths",
|
|
678
|
+
value: function possibleLengths() {
|
|
679
|
+
return this.numberingPlan.possibleLengths();
|
|
680
|
+
}
|
|
681
|
+
// Deprecated.
|
|
682
|
+
}, {
|
|
683
|
+
key: "formats",
|
|
684
|
+
value: function formats() {
|
|
685
|
+
return this.numberingPlan.formats();
|
|
686
|
+
}
|
|
687
|
+
// Deprecated.
|
|
688
|
+
}, {
|
|
689
|
+
key: "nationalPrefixForParsing",
|
|
690
|
+
value: function nationalPrefixForParsing() {
|
|
691
|
+
return this.numberingPlan.nationalPrefixForParsing();
|
|
692
|
+
}
|
|
693
|
+
// Deprecated.
|
|
694
|
+
}, {
|
|
695
|
+
key: "nationalPrefixTransformRule",
|
|
696
|
+
value: function nationalPrefixTransformRule() {
|
|
697
|
+
return this.numberingPlan.nationalPrefixTransformRule();
|
|
698
|
+
}
|
|
699
|
+
// Deprecated.
|
|
700
|
+
}, {
|
|
701
|
+
key: "leadingDigits",
|
|
702
|
+
value: function leadingDigits() {
|
|
703
|
+
return this.numberingPlan.leadingDigits();
|
|
704
|
+
}
|
|
705
|
+
// Deprecated.
|
|
706
|
+
}, {
|
|
707
|
+
key: "hasTypes",
|
|
708
|
+
value: function hasTypes() {
|
|
709
|
+
return this.numberingPlan.hasTypes();
|
|
710
|
+
}
|
|
711
|
+
// Deprecated.
|
|
712
|
+
}, {
|
|
713
|
+
key: "type",
|
|
714
|
+
value: function type(_type) {
|
|
715
|
+
return this.numberingPlan.type(_type);
|
|
716
|
+
}
|
|
717
|
+
// Deprecated.
|
|
718
|
+
}, {
|
|
719
|
+
key: "ext",
|
|
720
|
+
value: function ext() {
|
|
721
|
+
return this.numberingPlan.ext();
|
|
722
|
+
}
|
|
723
|
+
}, {
|
|
724
|
+
key: "countryCallingCodes",
|
|
725
|
+
value: function countryCallingCodes() {
|
|
726
|
+
if (this.v1) return this.metadata.country_phone_code_to_countries;
|
|
727
|
+
return this.metadata.country_calling_codes;
|
|
728
|
+
}
|
|
729
|
+
// Deprecated.
|
|
730
|
+
}, {
|
|
731
|
+
key: "chooseCountryByCountryCallingCode",
|
|
732
|
+
value: function chooseCountryByCountryCallingCode(callingCode) {
|
|
733
|
+
return this.selectNumberingPlan(callingCode);
|
|
734
|
+
}
|
|
735
|
+
}, {
|
|
736
|
+
key: "hasSelectedNumberingPlan",
|
|
737
|
+
value: function hasSelectedNumberingPlan() {
|
|
738
|
+
return this.numberingPlan !== void 0;
|
|
739
|
+
}
|
|
740
|
+
}]);
|
|
741
|
+
})();
|
|
742
|
+
var NumberingPlan = /* @__PURE__ */ (function() {
|
|
743
|
+
function NumberingPlan2(metadata, globalMetadataObject) {
|
|
744
|
+
_classCallCheck(this, NumberingPlan2);
|
|
745
|
+
this.globalMetadataObject = globalMetadataObject;
|
|
746
|
+
this.metadata = metadata;
|
|
747
|
+
setVersion.call(this, globalMetadataObject.metadata);
|
|
748
|
+
}
|
|
749
|
+
return _createClass(NumberingPlan2, [{
|
|
750
|
+
key: "callingCode",
|
|
751
|
+
value: function callingCode() {
|
|
752
|
+
return this.metadata[0];
|
|
753
|
+
}
|
|
754
|
+
// When multiple countries share the same calling code,
|
|
755
|
+
// all phone number formatting rules are included in the metadata
|
|
756
|
+
// of the "default" country for that calling code.
|
|
757
|
+
// Any other countries' metdata doesn't include any formatting rules.
|
|
758
|
+
// Google developers said that such storage architecture was chosen for performance reasons.
|
|
759
|
+
//
|
|
760
|
+
// For example, for NANPA region ("North American Numbering Plan Administration",
|
|
761
|
+
// which includes USA, Canada, Cayman Islands, Bahamas, etc) all formatting rules
|
|
762
|
+
// are contained in the metadata of `US` country.
|
|
763
|
+
//
|
|
764
|
+
// This is not public API.
|
|
765
|
+
//
|
|
766
|
+
}, {
|
|
767
|
+
key: "_getDefaultCountryMetadataForThisCallingCode",
|
|
768
|
+
value: function _getDefaultCountryMetadataForThisCallingCode() {
|
|
769
|
+
return this.globalMetadataObject.getNumberingPlanMetadata(this.callingCode());
|
|
770
|
+
}
|
|
771
|
+
// Deprecated.
|
|
772
|
+
}, {
|
|
773
|
+
key: "getDefaultCountryMetadataForRegion",
|
|
774
|
+
value: function getDefaultCountryMetadataForRegion() {
|
|
775
|
+
return this._getDefaultCountryMetadataForThisCallingCode();
|
|
776
|
+
}
|
|
777
|
+
// Is always present.
|
|
778
|
+
}, {
|
|
779
|
+
key: "IDDPrefix",
|
|
780
|
+
value: function IDDPrefix() {
|
|
781
|
+
if (this.v1 || this.v2) return;
|
|
782
|
+
return this.metadata[1];
|
|
783
|
+
}
|
|
784
|
+
// Is only present when a country supports multiple IDD prefixes.
|
|
785
|
+
}, {
|
|
786
|
+
key: "defaultIDDPrefix",
|
|
787
|
+
value: function defaultIDDPrefix() {
|
|
788
|
+
if (this.v1 || this.v2) return;
|
|
789
|
+
return this.metadata[12];
|
|
790
|
+
}
|
|
791
|
+
}, {
|
|
792
|
+
key: "nationalNumberPattern",
|
|
793
|
+
value: function nationalNumberPattern() {
|
|
794
|
+
if (this.v1 || this.v2) return this.metadata[1];
|
|
795
|
+
return this.metadata[2];
|
|
796
|
+
}
|
|
797
|
+
// "possible length" data is always present in Google's metadata.
|
|
798
|
+
}, {
|
|
799
|
+
key: "possibleLengths",
|
|
800
|
+
value: function possibleLengths() {
|
|
801
|
+
if (this.v1) return;
|
|
802
|
+
return this.metadata[this.v2 ? 2 : 3];
|
|
803
|
+
}
|
|
804
|
+
}, {
|
|
805
|
+
key: "_getFormats",
|
|
806
|
+
value: function _getFormats(metadata) {
|
|
807
|
+
return metadata[this.v1 ? 2 : this.v2 ? 3 : 4];
|
|
808
|
+
}
|
|
809
|
+
// For countries of the same region (e.g. NANPA)
|
|
810
|
+
// formats are all stored in the "main" country for that region.
|
|
811
|
+
// E.g. "RU" and "KZ", "US" and "CA".
|
|
812
|
+
}, {
|
|
813
|
+
key: "formats",
|
|
814
|
+
value: function formats() {
|
|
815
|
+
var _this = this;
|
|
816
|
+
var formats2 = this._getFormats(this.metadata) || this._getFormats(this._getDefaultCountryMetadataForThisCallingCode()) || [];
|
|
817
|
+
return formats2.map(function(_) {
|
|
818
|
+
return new Format(_, _this);
|
|
819
|
+
});
|
|
820
|
+
}
|
|
821
|
+
}, {
|
|
822
|
+
key: "nationalPrefix",
|
|
823
|
+
value: function nationalPrefix() {
|
|
824
|
+
return this.metadata[this.v1 ? 3 : this.v2 ? 4 : 5];
|
|
825
|
+
}
|
|
826
|
+
}, {
|
|
827
|
+
key: "_getNationalPrefixFormattingRule",
|
|
828
|
+
value: function _getNationalPrefixFormattingRule(metadata) {
|
|
829
|
+
return metadata[this.v1 ? 4 : this.v2 ? 5 : 6];
|
|
830
|
+
}
|
|
831
|
+
// For countries of the same region (e.g. NANPA)
|
|
832
|
+
// national prefix formatting rule is stored in the "main" country for that region.
|
|
833
|
+
// E.g. "RU" and "KZ", "US" and "CA".
|
|
834
|
+
}, {
|
|
835
|
+
key: "nationalPrefixFormattingRule",
|
|
836
|
+
value: function nationalPrefixFormattingRule() {
|
|
837
|
+
return this._getNationalPrefixFormattingRule(this.metadata) || this._getNationalPrefixFormattingRule(this._getDefaultCountryMetadataForThisCallingCode());
|
|
838
|
+
}
|
|
839
|
+
}, {
|
|
840
|
+
key: "_nationalPrefixForParsing",
|
|
841
|
+
value: function _nationalPrefixForParsing() {
|
|
842
|
+
return this.metadata[this.v1 ? 5 : this.v2 ? 6 : 7];
|
|
843
|
+
}
|
|
844
|
+
}, {
|
|
845
|
+
key: "nationalPrefixForParsing",
|
|
846
|
+
value: function nationalPrefixForParsing() {
|
|
847
|
+
return this._nationalPrefixForParsing() || this.nationalPrefix();
|
|
848
|
+
}
|
|
849
|
+
}, {
|
|
850
|
+
key: "nationalPrefixTransformRule",
|
|
851
|
+
value: function nationalPrefixTransformRule() {
|
|
852
|
+
return this.metadata[this.v1 ? 6 : this.v2 ? 7 : 8];
|
|
853
|
+
}
|
|
854
|
+
}, {
|
|
855
|
+
key: "_getNationalPrefixIsOptionalWhenFormatting",
|
|
856
|
+
value: function _getNationalPrefixIsOptionalWhenFormatting() {
|
|
857
|
+
return !!this.metadata[this.v1 ? 7 : this.v2 ? 8 : 9];
|
|
858
|
+
}
|
|
859
|
+
// For countries of the same region (e.g. NANPA)
|
|
860
|
+
// "national prefix is optional when formatting" flag is
|
|
861
|
+
// stored in the "main" country for that region.
|
|
862
|
+
// E.g. "RU" and "KZ", "US" and "CA".
|
|
863
|
+
}, {
|
|
864
|
+
key: "nationalPrefixIsOptionalWhenFormattingInNationalFormat",
|
|
865
|
+
value: function nationalPrefixIsOptionalWhenFormattingInNationalFormat() {
|
|
866
|
+
return this._getNationalPrefixIsOptionalWhenFormatting(this.metadata) || this._getNationalPrefixIsOptionalWhenFormatting(this._getDefaultCountryMetadataForThisCallingCode());
|
|
867
|
+
}
|
|
868
|
+
}, {
|
|
869
|
+
key: "leadingDigits",
|
|
870
|
+
value: function leadingDigits() {
|
|
871
|
+
return this.metadata[this.v1 ? 8 : this.v2 ? 9 : 10];
|
|
872
|
+
}
|
|
873
|
+
}, {
|
|
874
|
+
key: "types",
|
|
875
|
+
value: function types() {
|
|
876
|
+
return this.metadata[this.v1 ? 9 : this.v2 ? 10 : 11];
|
|
877
|
+
}
|
|
878
|
+
}, {
|
|
879
|
+
key: "hasTypes",
|
|
880
|
+
value: function hasTypes() {
|
|
881
|
+
if (this.types() && this.types().length === 0) {
|
|
882
|
+
return false;
|
|
883
|
+
}
|
|
884
|
+
return !!this.types();
|
|
885
|
+
}
|
|
886
|
+
}, {
|
|
887
|
+
key: "type",
|
|
888
|
+
value: function type(_type2) {
|
|
889
|
+
if (this.hasTypes() && getType(this.types(), _type2)) {
|
|
890
|
+
return new Type(getType(this.types(), _type2), this);
|
|
891
|
+
}
|
|
892
|
+
}
|
|
893
|
+
}, {
|
|
894
|
+
key: "ext",
|
|
895
|
+
value: function ext() {
|
|
896
|
+
if (this.v1 || this.v2) return DEFAULT_EXT_PREFIX;
|
|
897
|
+
return this.metadata[13] || DEFAULT_EXT_PREFIX;
|
|
898
|
+
}
|
|
899
|
+
}]);
|
|
900
|
+
})();
|
|
901
|
+
var Format = /* @__PURE__ */ (function() {
|
|
902
|
+
function Format2(format, metadata) {
|
|
903
|
+
_classCallCheck(this, Format2);
|
|
904
|
+
this._format = format;
|
|
905
|
+
this.metadata = metadata;
|
|
906
|
+
}
|
|
907
|
+
return _createClass(Format2, [{
|
|
908
|
+
key: "pattern",
|
|
909
|
+
value: function pattern() {
|
|
910
|
+
return this._format[0];
|
|
911
|
+
}
|
|
912
|
+
}, {
|
|
913
|
+
key: "format",
|
|
914
|
+
value: function format() {
|
|
915
|
+
return this._format[1];
|
|
916
|
+
}
|
|
917
|
+
}, {
|
|
918
|
+
key: "leadingDigitsPatterns",
|
|
919
|
+
value: function leadingDigitsPatterns() {
|
|
920
|
+
return this._format[2] || [];
|
|
921
|
+
}
|
|
922
|
+
}, {
|
|
923
|
+
key: "nationalPrefixFormattingRule",
|
|
924
|
+
value: function nationalPrefixFormattingRule() {
|
|
925
|
+
return this._format[3] || this.metadata.nationalPrefixFormattingRule();
|
|
926
|
+
}
|
|
927
|
+
}, {
|
|
928
|
+
key: "nationalPrefixIsOptionalWhenFormattingInNationalFormat",
|
|
929
|
+
value: function nationalPrefixIsOptionalWhenFormattingInNationalFormat() {
|
|
930
|
+
return !!this._format[4] || this.metadata.nationalPrefixIsOptionalWhenFormattingInNationalFormat();
|
|
931
|
+
}
|
|
932
|
+
}, {
|
|
933
|
+
key: "nationalPrefixIsMandatoryWhenFormattingInNationalFormat",
|
|
934
|
+
value: function nationalPrefixIsMandatoryWhenFormattingInNationalFormat() {
|
|
935
|
+
return this.usesNationalPrefix() && !this.nationalPrefixIsOptionalWhenFormattingInNationalFormat();
|
|
936
|
+
}
|
|
937
|
+
// Checks whether national prefix formatting rule contains national prefix.
|
|
938
|
+
}, {
|
|
939
|
+
key: "usesNationalPrefix",
|
|
940
|
+
value: function usesNationalPrefix() {
|
|
941
|
+
return this.nationalPrefixFormattingRule() && // Check that national prefix formatting rule is not a "dummy" one.
|
|
942
|
+
!FIRST_GROUP_ONLY_PREFIX_PATTERN.test(this.nationalPrefixFormattingRule()) ? true : false;
|
|
943
|
+
}
|
|
944
|
+
}, {
|
|
945
|
+
key: "internationalFormat",
|
|
946
|
+
value: function internationalFormat() {
|
|
947
|
+
return this._format[5] || this.format();
|
|
948
|
+
}
|
|
949
|
+
}]);
|
|
950
|
+
})();
|
|
951
|
+
var FIRST_GROUP_ONLY_PREFIX_PATTERN = /^\(?\$1\)?$/;
|
|
952
|
+
var Type = /* @__PURE__ */ (function() {
|
|
953
|
+
function Type2(type, metadata) {
|
|
954
|
+
_classCallCheck(this, Type2);
|
|
955
|
+
this.type = type;
|
|
956
|
+
this.metadata = metadata;
|
|
957
|
+
}
|
|
958
|
+
return _createClass(Type2, [{
|
|
959
|
+
key: "pattern",
|
|
960
|
+
value: function pattern() {
|
|
961
|
+
if (this.metadata.v1) return this.type;
|
|
962
|
+
return this.type[0];
|
|
963
|
+
}
|
|
964
|
+
}, {
|
|
965
|
+
key: "possibleLengths",
|
|
966
|
+
value: function possibleLengths() {
|
|
967
|
+
if (this.metadata.v1) return;
|
|
968
|
+
return this.type[1] || this.metadata.possibleLengths();
|
|
969
|
+
}
|
|
970
|
+
}]);
|
|
971
|
+
})();
|
|
972
|
+
function getType(types, type) {
|
|
973
|
+
switch (type) {
|
|
974
|
+
case "FIXED_LINE":
|
|
975
|
+
return types[0];
|
|
976
|
+
case "MOBILE":
|
|
977
|
+
return types[1];
|
|
978
|
+
case "TOLL_FREE":
|
|
979
|
+
return types[2];
|
|
980
|
+
case "PREMIUM_RATE":
|
|
981
|
+
return types[3];
|
|
982
|
+
case "PERSONAL_NUMBER":
|
|
983
|
+
return types[4];
|
|
984
|
+
case "VOICEMAIL":
|
|
985
|
+
return types[5];
|
|
986
|
+
case "UAN":
|
|
987
|
+
return types[6];
|
|
988
|
+
case "PAGER":
|
|
989
|
+
return types[7];
|
|
990
|
+
case "VOIP":
|
|
991
|
+
return types[8];
|
|
992
|
+
case "SHARED_COST":
|
|
993
|
+
return types[9];
|
|
994
|
+
}
|
|
995
|
+
}
|
|
996
|
+
function validateMetadata(metadata) {
|
|
997
|
+
if (!metadata) {
|
|
998
|
+
throw new Error("[libphonenumber-js] `metadata` argument not passed. Check your arguments.");
|
|
999
|
+
}
|
|
1000
|
+
if (!isObject(metadata) || !isObject(metadata.countries)) {
|
|
1001
|
+
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, "."));
|
|
1002
|
+
}
|
|
1003
|
+
}
|
|
1004
|
+
var typeOf = function typeOf2(_) {
|
|
1005
|
+
return _typeof(_);
|
|
1006
|
+
};
|
|
1007
|
+
function getCountryCallingCode(country, metadataJson) {
|
|
1008
|
+
var metadata = new Metadata(metadataJson);
|
|
1009
|
+
if (metadata.hasCountry(country)) {
|
|
1010
|
+
return metadata.selectNumberingPlan(country).countryCallingCode();
|
|
1011
|
+
}
|
|
1012
|
+
throw new Error("Unknown country: ".concat(country));
|
|
1013
|
+
}
|
|
1014
|
+
function isSupportedCountry(country, metadataJson) {
|
|
1015
|
+
return metadataJson.countries.hasOwnProperty(country);
|
|
1016
|
+
}
|
|
1017
|
+
function setVersion(metadata) {
|
|
1018
|
+
var version = metadata.version;
|
|
1019
|
+
if (typeof version === "number") {
|
|
1020
|
+
this.v1 = version === 1;
|
|
1021
|
+
this.v2 = version === 2;
|
|
1022
|
+
this.v3 = version === 3;
|
|
1023
|
+
this.v4 = version === 4;
|
|
1024
|
+
} else {
|
|
1025
|
+
if (!version) {
|
|
1026
|
+
this.v1 = true;
|
|
1027
|
+
} else if (semver_compare_default(version, V3) === -1) {
|
|
1028
|
+
this.v2 = true;
|
|
1029
|
+
} else if (semver_compare_default(version, V4) === -1) {
|
|
1030
|
+
this.v3 = true;
|
|
1031
|
+
} else {
|
|
1032
|
+
this.v4 = true;
|
|
1033
|
+
}
|
|
1034
|
+
}
|
|
1035
|
+
}
|
|
1036
|
+
|
|
1037
|
+
// node_modules/libphonenumber-js/es6/helpers/mergeArrays.js
|
|
1038
|
+
function _createForOfIteratorHelperLoose(r2, e2) {
|
|
1039
|
+
var t2 = "undefined" != typeof Symbol && r2[Symbol.iterator] || r2["@@iterator"];
|
|
1040
|
+
if (t2) return (t2 = t2.call(r2)).next.bind(t2);
|
|
1041
|
+
if (Array.isArray(r2) || (t2 = _unsupportedIterableToArray(r2)) || e2 && r2 && "number" == typeof r2.length) {
|
|
1042
|
+
t2 && (r2 = t2);
|
|
1043
|
+
var o2 = 0;
|
|
1044
|
+
return function() {
|
|
1045
|
+
return o2 >= r2.length ? { done: true } : { done: false, value: r2[o2++] };
|
|
1046
|
+
};
|
|
1047
|
+
}
|
|
1048
|
+
throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
1049
|
+
}
|
|
1050
|
+
function _unsupportedIterableToArray(r2, a2) {
|
|
1051
|
+
if (r2) {
|
|
1052
|
+
if ("string" == typeof r2) return _arrayLikeToArray(r2, a2);
|
|
1053
|
+
var t2 = {}.toString.call(r2).slice(8, -1);
|
|
1054
|
+
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;
|
|
1055
|
+
}
|
|
1056
|
+
}
|
|
1057
|
+
function _arrayLikeToArray(r2, a2) {
|
|
1058
|
+
(null == a2 || a2 > r2.length) && (a2 = r2.length);
|
|
1059
|
+
for (var e2 = 0, n2 = Array(a2); e2 < a2; e2++) n2[e2] = r2[e2];
|
|
1060
|
+
return n2;
|
|
1061
|
+
}
|
|
1062
|
+
function mergeArrays(a2, b) {
|
|
1063
|
+
var merged = a2.slice();
|
|
1064
|
+
for (var _iterator = _createForOfIteratorHelperLoose(b), _step; !(_step = _iterator()).done; ) {
|
|
1065
|
+
var element = _step.value;
|
|
1066
|
+
if (a2.indexOf(element) < 0) {
|
|
1067
|
+
merged.push(element);
|
|
1068
|
+
}
|
|
1069
|
+
}
|
|
1070
|
+
return merged.sort(function(a3, b2) {
|
|
1071
|
+
return a3 - b2;
|
|
1072
|
+
});
|
|
1073
|
+
}
|
|
1074
|
+
|
|
1075
|
+
// node_modules/libphonenumber-js/es6/helpers/checkNumberLength.js
|
|
1076
|
+
function checkNumberLength(nationalNumber, country, metadata) {
|
|
1077
|
+
return checkNumberLengthForType(nationalNumber, void 0, country, metadata);
|
|
1078
|
+
}
|
|
1079
|
+
function checkNumberLengthForType(nationalNumber, type, country, metadata) {
|
|
1080
|
+
if (country) {
|
|
1081
|
+
metadata = new Metadata(metadata.metadata);
|
|
1082
|
+
metadata.selectNumberingPlan(country);
|
|
1083
|
+
}
|
|
1084
|
+
var type_info = metadata.type(type);
|
|
1085
|
+
var possible_lengths = type_info && type_info.possibleLengths() || metadata.possibleLengths();
|
|
1086
|
+
if (!possible_lengths) {
|
|
1087
|
+
return "IS_POSSIBLE";
|
|
1088
|
+
}
|
|
1089
|
+
if (type === "FIXED_LINE_OR_MOBILE") {
|
|
1090
|
+
if (!metadata.type("FIXED_LINE")) {
|
|
1091
|
+
return checkNumberLengthForType(nationalNumber, "MOBILE", country, metadata);
|
|
1092
|
+
}
|
|
1093
|
+
var mobile_type = metadata.type("MOBILE");
|
|
1094
|
+
if (mobile_type) {
|
|
1095
|
+
possible_lengths = mergeArrays(possible_lengths, mobile_type.possibleLengths());
|
|
1096
|
+
}
|
|
1097
|
+
} else if (type && !type_info) {
|
|
1098
|
+
return "INVALID_LENGTH";
|
|
1099
|
+
}
|
|
1100
|
+
var actual_length = nationalNumber.length;
|
|
1101
|
+
var minimum_length = possible_lengths[0];
|
|
1102
|
+
if (minimum_length === actual_length) {
|
|
1103
|
+
return "IS_POSSIBLE";
|
|
1104
|
+
}
|
|
1105
|
+
if (minimum_length > actual_length) {
|
|
1106
|
+
return "TOO_SHORT";
|
|
1107
|
+
}
|
|
1108
|
+
if (possible_lengths[possible_lengths.length - 1] < actual_length) {
|
|
1109
|
+
return "TOO_LONG";
|
|
1110
|
+
}
|
|
1111
|
+
return possible_lengths.indexOf(actual_length, 1) >= 0 ? "IS_POSSIBLE" : "INVALID_LENGTH";
|
|
1112
|
+
}
|
|
1113
|
+
|
|
1114
|
+
// node_modules/libphonenumber-js/es6/isPossible.js
|
|
1115
|
+
function isPossiblePhoneNumber(input, options, metadataJson) {
|
|
1116
|
+
if (options === void 0) {
|
|
1117
|
+
options = {};
|
|
1118
|
+
}
|
|
1119
|
+
var metadata = new Metadata(metadataJson);
|
|
1120
|
+
if (options.v2) {
|
|
1121
|
+
if (!input.countryCallingCode) {
|
|
1122
|
+
throw new Error("Invalid phone number object passed");
|
|
1123
|
+
}
|
|
1124
|
+
metadata.selectNumberingPlan(input.country || input.countryCallingCode);
|
|
1125
|
+
} else {
|
|
1126
|
+
if (!input.phone) {
|
|
1127
|
+
return false;
|
|
1128
|
+
}
|
|
1129
|
+
if (input.country) {
|
|
1130
|
+
if (!metadata.hasCountry(input.country)) {
|
|
1131
|
+
throw new Error("Unknown country: ".concat(input.country));
|
|
1132
|
+
}
|
|
1133
|
+
metadata.selectNumberingPlan(input.country);
|
|
1134
|
+
} else {
|
|
1135
|
+
if (!input.countryCallingCode) {
|
|
1136
|
+
throw new Error("Invalid phone number object passed");
|
|
1137
|
+
}
|
|
1138
|
+
metadata.selectNumberingPlan(input.countryCallingCode);
|
|
1139
|
+
}
|
|
1140
|
+
}
|
|
1141
|
+
if (metadata.possibleLengths()) {
|
|
1142
|
+
return isPossibleNumber(input.phone || input.nationalNumber, metadata);
|
|
1143
|
+
}
|
|
1144
|
+
if (input.countryCallingCode && metadata.isNonGeographicCallingCode(input.countryCallingCode)) {
|
|
1145
|
+
return true;
|
|
1146
|
+
}
|
|
1147
|
+
throw new Error('Missing "possibleLengths" in metadata. Perhaps the metadata has been generated before v1.0.18.');
|
|
1148
|
+
}
|
|
1149
|
+
function isPossibleNumber(nationalNumber, metadata) {
|
|
1150
|
+
switch (checkNumberLength(nationalNumber, void 0, metadata)) {
|
|
1151
|
+
case "IS_POSSIBLE":
|
|
1152
|
+
return true;
|
|
1153
|
+
// This library ignores "local-only" phone numbers (for simplicity).
|
|
1154
|
+
// See the readme for more info on what are "local-only" phone numbers.
|
|
1155
|
+
// case 'IS_POSSIBLE_LOCAL_ONLY':
|
|
1156
|
+
// return !isInternational
|
|
1157
|
+
default:
|
|
1158
|
+
return false;
|
|
1159
|
+
}
|
|
1160
|
+
}
|
|
1161
|
+
|
|
1162
|
+
// node_modules/libphonenumber-js/es6/helpers/matchesEntirely.js
|
|
1163
|
+
function matchesEntirely(text, regularExpressionText) {
|
|
1164
|
+
text = text || "";
|
|
1165
|
+
return new RegExp("^(?:" + regularExpressionText + ")$").test(text);
|
|
1166
|
+
}
|
|
1167
|
+
|
|
1168
|
+
// node_modules/libphonenumber-js/es6/helpers/getNumberType.js
|
|
1169
|
+
function _createForOfIteratorHelperLoose2(r2, e2) {
|
|
1170
|
+
var t2 = "undefined" != typeof Symbol && r2[Symbol.iterator] || r2["@@iterator"];
|
|
1171
|
+
if (t2) return (t2 = t2.call(r2)).next.bind(t2);
|
|
1172
|
+
if (Array.isArray(r2) || (t2 = _unsupportedIterableToArray2(r2)) || e2 && r2 && "number" == typeof r2.length) {
|
|
1173
|
+
t2 && (r2 = t2);
|
|
1174
|
+
var o2 = 0;
|
|
1175
|
+
return function() {
|
|
1176
|
+
return o2 >= r2.length ? { done: true } : { done: false, value: r2[o2++] };
|
|
1177
|
+
};
|
|
1178
|
+
}
|
|
1179
|
+
throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
1180
|
+
}
|
|
1181
|
+
function _unsupportedIterableToArray2(r2, a2) {
|
|
1182
|
+
if (r2) {
|
|
1183
|
+
if ("string" == typeof r2) return _arrayLikeToArray2(r2, a2);
|
|
1184
|
+
var t2 = {}.toString.call(r2).slice(8, -1);
|
|
1185
|
+
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;
|
|
1186
|
+
}
|
|
1187
|
+
}
|
|
1188
|
+
function _arrayLikeToArray2(r2, a2) {
|
|
1189
|
+
(null == a2 || a2 > r2.length) && (a2 = r2.length);
|
|
1190
|
+
for (var e2 = 0, n2 = Array(a2); e2 < a2; e2++) n2[e2] = r2[e2];
|
|
1191
|
+
return n2;
|
|
1192
|
+
}
|
|
1193
|
+
var NON_FIXED_LINE_PHONE_TYPES = ["MOBILE", "PREMIUM_RATE", "TOLL_FREE", "SHARED_COST", "VOIP", "PERSONAL_NUMBER", "PAGER", "UAN", "VOICEMAIL"];
|
|
1194
|
+
function getNumberType(input, options, metadataJson) {
|
|
1195
|
+
options = options || {};
|
|
1196
|
+
if (!input.country && !input.countryCallingCode) {
|
|
1197
|
+
return;
|
|
1198
|
+
}
|
|
1199
|
+
var metadata = new Metadata(metadataJson);
|
|
1200
|
+
metadata.selectNumberingPlan(input.country || input.countryCallingCode);
|
|
1201
|
+
var nationalNumber = options.v2 ? input.nationalNumber : input.phone;
|
|
1202
|
+
if (!matchesEntirely(nationalNumber, metadata.nationalNumberPattern())) {
|
|
1203
|
+
return;
|
|
1204
|
+
}
|
|
1205
|
+
if (isNumberTypeEqualTo(nationalNumber, "FIXED_LINE", metadata)) {
|
|
1206
|
+
if (metadata.type("MOBILE") && metadata.type("MOBILE").pattern() === "") {
|
|
1207
|
+
return "FIXED_LINE_OR_MOBILE";
|
|
1208
|
+
}
|
|
1209
|
+
if (!metadata.type("MOBILE")) {
|
|
1210
|
+
return "FIXED_LINE_OR_MOBILE";
|
|
1211
|
+
}
|
|
1212
|
+
if (isNumberTypeEqualTo(nationalNumber, "MOBILE", metadata)) {
|
|
1213
|
+
return "FIXED_LINE_OR_MOBILE";
|
|
1214
|
+
}
|
|
1215
|
+
return "FIXED_LINE";
|
|
1216
|
+
}
|
|
1217
|
+
for (var _iterator = _createForOfIteratorHelperLoose2(NON_FIXED_LINE_PHONE_TYPES), _step; !(_step = _iterator()).done; ) {
|
|
1218
|
+
var type = _step.value;
|
|
1219
|
+
if (isNumberTypeEqualTo(nationalNumber, type, metadata)) {
|
|
1220
|
+
return type;
|
|
1221
|
+
}
|
|
1222
|
+
}
|
|
1223
|
+
}
|
|
1224
|
+
function isNumberTypeEqualTo(nationalNumber, type, metadata) {
|
|
1225
|
+
var typeDefinition = metadata.type(type);
|
|
1226
|
+
if (!typeDefinition || !typeDefinition.pattern()) {
|
|
1227
|
+
return false;
|
|
1228
|
+
}
|
|
1229
|
+
if (typeDefinition.possibleLengths() && typeDefinition.possibleLengths().indexOf(nationalNumber.length) < 0) {
|
|
1230
|
+
return false;
|
|
1231
|
+
}
|
|
1232
|
+
return matchesEntirely(nationalNumber, typeDefinition.pattern());
|
|
1233
|
+
}
|
|
1234
|
+
|
|
1235
|
+
// node_modules/libphonenumber-js/es6/isValid.js
|
|
1236
|
+
function isValidNumber(input, options, metadataJson) {
|
|
1237
|
+
options = options || {};
|
|
1238
|
+
var metadata = new Metadata(metadataJson);
|
|
1239
|
+
metadata.selectNumberingPlan(input.country || input.countryCallingCode);
|
|
1240
|
+
if (metadata.hasTypes()) {
|
|
1241
|
+
return getNumberType(input, options, metadata.metadata) !== void 0;
|
|
1242
|
+
}
|
|
1243
|
+
var nationalNumber = options.v2 ? input.nationalNumber : input.phone;
|
|
1244
|
+
return matchesEntirely(nationalNumber, metadata.nationalNumberPattern());
|
|
1245
|
+
}
|
|
1246
|
+
|
|
1247
|
+
// node_modules/libphonenumber-js/es6/helpers/isCountryCode.js
|
|
1248
|
+
var COUNTRY_CODE_REG_EXP = /^[A-Z]{2}$/;
|
|
1249
|
+
function isCountryCode(string) {
|
|
1250
|
+
return COUNTRY_CODE_REG_EXP.test(string);
|
|
1251
|
+
}
|
|
1252
|
+
|
|
1253
|
+
// node_modules/libphonenumber-js/es6/helpers/getCountryAndCallingCodeFromOneOfThem.js
|
|
1254
|
+
var USE_NON_GEOGRAPHIC_COUNTRY_CODE = false;
|
|
1255
|
+
function getCountryAndCallingCodeFromOneOfThem(countryOrCallingCode, metadataJson) {
|
|
1256
|
+
var country;
|
|
1257
|
+
var callingCode;
|
|
1258
|
+
var metadata = new Metadata(metadataJson);
|
|
1259
|
+
if (isCountryCode(countryOrCallingCode)) {
|
|
1260
|
+
country = countryOrCallingCode;
|
|
1261
|
+
metadata.selectNumberingPlan(country);
|
|
1262
|
+
callingCode = metadata.countryCallingCode();
|
|
1263
|
+
} else {
|
|
1264
|
+
callingCode = countryOrCallingCode;
|
|
1265
|
+
if (USE_NON_GEOGRAPHIC_COUNTRY_CODE) {
|
|
1266
|
+
if (metadata.isNonGeographicCallingCode(callingCode)) {
|
|
1267
|
+
country = "001";
|
|
1268
|
+
}
|
|
1269
|
+
}
|
|
1270
|
+
}
|
|
1271
|
+
return {
|
|
1272
|
+
country,
|
|
1273
|
+
callingCode
|
|
1274
|
+
};
|
|
1275
|
+
}
|
|
1276
|
+
|
|
1277
|
+
// node_modules/libphonenumber-js/es6/helpers/getPossibleCountriesForNumber.js
|
|
1278
|
+
function getPossibleCountriesForNumber(callingCode, nationalNumber, metadata) {
|
|
1279
|
+
var _metadata = new Metadata(metadata);
|
|
1280
|
+
var possibleCountries = _metadata.getCountryCodesForCallingCode(callingCode);
|
|
1281
|
+
if (!possibleCountries) {
|
|
1282
|
+
return [];
|
|
1283
|
+
}
|
|
1284
|
+
return possibleCountries.filter(function(country) {
|
|
1285
|
+
return couldNationalNumberBelongToCountry(nationalNumber, country, metadata);
|
|
1286
|
+
});
|
|
1287
|
+
}
|
|
1288
|
+
function couldNationalNumberBelongToCountry(nationalNumber, country, metadataJson) {
|
|
1289
|
+
var metadata = new Metadata(metadataJson);
|
|
1290
|
+
metadata.selectNumberingPlan(country);
|
|
1291
|
+
return metadata.numberingPlan.possibleLengths().indexOf(nationalNumber.length) >= 0;
|
|
1292
|
+
}
|
|
1293
|
+
|
|
1294
|
+
// node_modules/libphonenumber-js/es6/constants.js
|
|
1295
|
+
var MIN_LENGTH_FOR_NSN = 2;
|
|
1296
|
+
var MAX_LENGTH_FOR_NSN = 17;
|
|
1297
|
+
var MAX_LENGTH_COUNTRY_CODE = 3;
|
|
1298
|
+
var VALID_DIGITS = "0-9\uFF10-\uFF19\u0660-\u0669\u06F0-\u06F9";
|
|
1299
|
+
var DASHES = "-\u2010-\u2015\u2212\u30FC\uFF0D";
|
|
1300
|
+
var SLASHES = "\uFF0F/";
|
|
1301
|
+
var DOTS = "\uFF0E.";
|
|
1302
|
+
var WHITESPACE = " \xA0\xAD\u200B\u2060\u3000";
|
|
1303
|
+
var BRACKETS = "()\uFF08\uFF09\uFF3B\uFF3D\\[\\]";
|
|
1304
|
+
var TILDES = "~\u2053\u223C\uFF5E";
|
|
1305
|
+
var VALID_PUNCTUATION = "".concat(DASHES).concat(SLASHES).concat(DOTS).concat(WHITESPACE).concat(BRACKETS).concat(TILDES);
|
|
1306
|
+
var PLUS_CHARS = "+\uFF0B";
|
|
1307
|
+
|
|
1308
|
+
// node_modules/libphonenumber-js/es6/helpers/stripIddPrefix.js
|
|
1309
|
+
var CAPTURING_DIGIT_PATTERN = new RegExp("([" + VALID_DIGITS + "])");
|
|
1310
|
+
function stripIddPrefix(number, country, callingCode, metadataJson) {
|
|
1311
|
+
if (!country) {
|
|
1312
|
+
return;
|
|
1313
|
+
}
|
|
1314
|
+
var metadata = new Metadata(metadataJson);
|
|
1315
|
+
metadata.selectNumberingPlan(country || callingCode);
|
|
1316
|
+
var IDDPrefixPattern = new RegExp(metadata.IDDPrefix());
|
|
1317
|
+
if (number.search(IDDPrefixPattern) !== 0) {
|
|
1318
|
+
return;
|
|
1319
|
+
}
|
|
1320
|
+
number = number.slice(number.match(IDDPrefixPattern)[0].length);
|
|
1321
|
+
var matchedGroups = number.match(CAPTURING_DIGIT_PATTERN);
|
|
1322
|
+
if (matchedGroups && matchedGroups[1] != null && matchedGroups[1].length > 0) {
|
|
1323
|
+
if (matchedGroups[1] === "0") {
|
|
1324
|
+
return;
|
|
1325
|
+
}
|
|
1326
|
+
}
|
|
1327
|
+
return number;
|
|
1328
|
+
}
|
|
1329
|
+
|
|
1330
|
+
// node_modules/libphonenumber-js/es6/helpers/extractNationalNumberFromPossiblyIncompleteNumber.js
|
|
1331
|
+
function extractNationalNumberFromPossiblyIncompleteNumber(number, metadata) {
|
|
1332
|
+
if (number && metadata.numberingPlan.nationalPrefixForParsing()) {
|
|
1333
|
+
var prefixPattern = new RegExp("^(?:" + metadata.numberingPlan.nationalPrefixForParsing() + ")");
|
|
1334
|
+
var prefixMatch = prefixPattern.exec(number);
|
|
1335
|
+
if (prefixMatch) {
|
|
1336
|
+
var nationalNumber;
|
|
1337
|
+
var carrierCode;
|
|
1338
|
+
var capturedGroupsCount = prefixMatch.length - 1;
|
|
1339
|
+
var hasCapturedGroups = capturedGroupsCount > 0 && prefixMatch[capturedGroupsCount];
|
|
1340
|
+
if (metadata.nationalPrefixTransformRule() && hasCapturedGroups) {
|
|
1341
|
+
nationalNumber = number.replace(prefixPattern, metadata.nationalPrefixTransformRule());
|
|
1342
|
+
if (capturedGroupsCount > 1) {
|
|
1343
|
+
carrierCode = prefixMatch[1];
|
|
1344
|
+
}
|
|
1345
|
+
} else {
|
|
1346
|
+
var prefixBeforeNationalNumber = prefixMatch[0];
|
|
1347
|
+
nationalNumber = number.slice(prefixBeforeNationalNumber.length);
|
|
1348
|
+
if (hasCapturedGroups) {
|
|
1349
|
+
carrierCode = prefixMatch[1];
|
|
1350
|
+
}
|
|
1351
|
+
}
|
|
1352
|
+
var nationalPrefix;
|
|
1353
|
+
if (hasCapturedGroups) {
|
|
1354
|
+
var possiblePositionOfTheFirstCapturedGroup = number.indexOf(prefixMatch[1]);
|
|
1355
|
+
var possibleNationalPrefix = number.slice(0, possiblePositionOfTheFirstCapturedGroup);
|
|
1356
|
+
if (possibleNationalPrefix === metadata.numberingPlan.nationalPrefix()) {
|
|
1357
|
+
nationalPrefix = metadata.numberingPlan.nationalPrefix();
|
|
1358
|
+
}
|
|
1359
|
+
} else {
|
|
1360
|
+
nationalPrefix = prefixMatch[0];
|
|
1361
|
+
}
|
|
1362
|
+
return {
|
|
1363
|
+
nationalNumber,
|
|
1364
|
+
nationalPrefix,
|
|
1365
|
+
carrierCode
|
|
1366
|
+
};
|
|
1367
|
+
}
|
|
1368
|
+
}
|
|
1369
|
+
return {
|
|
1370
|
+
nationalNumber: number
|
|
1371
|
+
};
|
|
1372
|
+
}
|
|
1373
|
+
|
|
1374
|
+
// node_modules/libphonenumber-js/es6/helpers/getCountryByNationalNumber.js
|
|
1375
|
+
function _createForOfIteratorHelperLoose3(r2, e2) {
|
|
1376
|
+
var t2 = "undefined" != typeof Symbol && r2[Symbol.iterator] || r2["@@iterator"];
|
|
1377
|
+
if (t2) return (t2 = t2.call(r2)).next.bind(t2);
|
|
1378
|
+
if (Array.isArray(r2) || (t2 = _unsupportedIterableToArray3(r2)) || e2 && r2 && "number" == typeof r2.length) {
|
|
1379
|
+
t2 && (r2 = t2);
|
|
1380
|
+
var o2 = 0;
|
|
1381
|
+
return function() {
|
|
1382
|
+
return o2 >= r2.length ? { done: true } : { done: false, value: r2[o2++] };
|
|
1383
|
+
};
|
|
1384
|
+
}
|
|
1385
|
+
throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
1386
|
+
}
|
|
1387
|
+
function _unsupportedIterableToArray3(r2, a2) {
|
|
1388
|
+
if (r2) {
|
|
1389
|
+
if ("string" == typeof r2) return _arrayLikeToArray3(r2, a2);
|
|
1390
|
+
var t2 = {}.toString.call(r2).slice(8, -1);
|
|
1391
|
+
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;
|
|
1392
|
+
}
|
|
1393
|
+
}
|
|
1394
|
+
function _arrayLikeToArray3(r2, a2) {
|
|
1395
|
+
(null == a2 || a2 > r2.length) && (a2 = r2.length);
|
|
1396
|
+
for (var e2 = 0, n2 = Array(a2); e2 < a2; e2++) n2[e2] = r2[e2];
|
|
1397
|
+
return n2;
|
|
1398
|
+
}
|
|
1399
|
+
function getCountryByNationalNumber(nationalNumber, countries, metadataJson) {
|
|
1400
|
+
var metadata = new Metadata(metadataJson);
|
|
1401
|
+
for (var _iterator = _createForOfIteratorHelperLoose3(countries), _step; !(_step = _iterator()).done; ) {
|
|
1402
|
+
var country = _step.value;
|
|
1403
|
+
metadata.selectNumberingPlan(country);
|
|
1404
|
+
if (metadata.leadingDigits()) {
|
|
1405
|
+
if (nationalNumber && nationalNumber.search(metadata.leadingDigits()) === 0) {
|
|
1406
|
+
return country;
|
|
1407
|
+
}
|
|
1408
|
+
} else if (getNumberType({
|
|
1409
|
+
phone: nationalNumber,
|
|
1410
|
+
country
|
|
1411
|
+
}, void 0, metadata.metadata)) {
|
|
1412
|
+
return country;
|
|
1413
|
+
}
|
|
1414
|
+
}
|
|
1415
|
+
}
|
|
1416
|
+
|
|
1417
|
+
// node_modules/libphonenumber-js/es6/helpers/getCountryByCallingCode.js
|
|
1418
|
+
var USE_NON_GEOGRAPHIC_COUNTRY_CODE2 = false;
|
|
1419
|
+
function getCountryByCallingCode(callingCode, _ref) {
|
|
1420
|
+
var nationalNumber = _ref.nationalNumber, metadata = _ref.metadata;
|
|
1421
|
+
if (USE_NON_GEOGRAPHIC_COUNTRY_CODE2) {
|
|
1422
|
+
if (metadata.isNonGeographicCallingCode(callingCode)) {
|
|
1423
|
+
return "001";
|
|
1424
|
+
}
|
|
1425
|
+
}
|
|
1426
|
+
var possibleCountries = metadata.getCountryCodesForCallingCode(callingCode);
|
|
1427
|
+
if (!possibleCountries) {
|
|
1428
|
+
return;
|
|
1429
|
+
}
|
|
1430
|
+
if (possibleCountries.length === 1) {
|
|
1431
|
+
return possibleCountries[0];
|
|
1432
|
+
}
|
|
1433
|
+
return getCountryByNationalNumber(nationalNumber, possibleCountries, metadata.metadata);
|
|
1434
|
+
}
|
|
1435
|
+
|
|
1436
|
+
// node_modules/libphonenumber-js/es6/helpers/extractNationalNumber.js
|
|
1437
|
+
function extractNationalNumber(number, country, metadata) {
|
|
1438
|
+
var _extractNationalNumbe = extractNationalNumberFromPossiblyIncompleteNumber(number, metadata), carrierCode = _extractNationalNumbe.carrierCode, nationalNumber = _extractNationalNumbe.nationalNumber;
|
|
1439
|
+
if (nationalNumber !== number) {
|
|
1440
|
+
if (!shouldHaveExtractedNationalPrefix(number, nationalNumber, metadata)) {
|
|
1441
|
+
return {
|
|
1442
|
+
nationalNumber: number
|
|
1443
|
+
};
|
|
1444
|
+
}
|
|
1445
|
+
if (metadata.numberingPlan.possibleLengths()) {
|
|
1446
|
+
if (!country) {
|
|
1447
|
+
country = getCountryByCallingCode(metadata.numberingPlan.callingCode(), {
|
|
1448
|
+
nationalNumber,
|
|
1449
|
+
metadata
|
|
1450
|
+
});
|
|
1451
|
+
}
|
|
1452
|
+
if (!isPossibleIncompleteNationalNumber(nationalNumber, country, metadata)) {
|
|
1453
|
+
return {
|
|
1454
|
+
nationalNumber: number
|
|
1455
|
+
};
|
|
1456
|
+
}
|
|
1457
|
+
}
|
|
1458
|
+
}
|
|
1459
|
+
return {
|
|
1460
|
+
nationalNumber,
|
|
1461
|
+
carrierCode
|
|
1462
|
+
};
|
|
1463
|
+
}
|
|
1464
|
+
function shouldHaveExtractedNationalPrefix(nationalNumberBefore, nationalNumberAfter, metadata) {
|
|
1465
|
+
if (matchesEntirely(nationalNumberBefore, metadata.nationalNumberPattern()) && !matchesEntirely(nationalNumberAfter, metadata.nationalNumberPattern())) {
|
|
1466
|
+
return false;
|
|
1467
|
+
}
|
|
1468
|
+
return true;
|
|
1469
|
+
}
|
|
1470
|
+
function isPossibleIncompleteNationalNumber(nationalNumber, country, metadata) {
|
|
1471
|
+
switch (checkNumberLength(nationalNumber, country, metadata)) {
|
|
1472
|
+
case "TOO_SHORT":
|
|
1473
|
+
case "INVALID_LENGTH":
|
|
1474
|
+
return false;
|
|
1475
|
+
default:
|
|
1476
|
+
return true;
|
|
1477
|
+
}
|
|
1478
|
+
}
|
|
1479
|
+
|
|
1480
|
+
// node_modules/libphonenumber-js/es6/helpers/extractCountryCallingCodeFromInternationalNumberWithoutPlusSign.js
|
|
1481
|
+
function extractCountryCallingCodeFromInternationalNumberWithoutPlusSign(number, country, defaultCountry, defaultCallingCode, metadataJson) {
|
|
1482
|
+
if (!(country || defaultCountry || defaultCallingCode)) {
|
|
1483
|
+
return {
|
|
1484
|
+
number
|
|
1485
|
+
};
|
|
1486
|
+
}
|
|
1487
|
+
var countryCallingCode = country || defaultCountry ? getCountryCallingCode(country || defaultCountry, metadataJson) : defaultCallingCode;
|
|
1488
|
+
if (number.indexOf(countryCallingCode) === 0) {
|
|
1489
|
+
var metadata = new Metadata(metadataJson);
|
|
1490
|
+
metadata.selectNumberingPlan(country || defaultCountry || defaultCallingCode);
|
|
1491
|
+
var possibleShorterNumber = number.slice(countryCallingCode.length);
|
|
1492
|
+
var _extractNationalNumbe = extractNationalNumber(possibleShorterNumber, void 0, metadata), possibleShorterNationalNumber = _extractNationalNumbe.nationalNumber;
|
|
1493
|
+
var _extractNationalNumbe2 = extractNationalNumber(number, void 0, metadata), nationalNumber = _extractNationalNumbe2.nationalNumber;
|
|
1494
|
+
if (!matchesEntirely(nationalNumber, metadata.nationalNumberPattern()) && matchesEntirely(possibleShorterNationalNumber, metadata.nationalNumberPattern()) || checkNumberLength(nationalNumber, void 0, metadata) === "TOO_LONG") {
|
|
1495
|
+
return {
|
|
1496
|
+
countryCallingCode,
|
|
1497
|
+
number: possibleShorterNumber
|
|
1498
|
+
};
|
|
1499
|
+
}
|
|
1500
|
+
}
|
|
1501
|
+
return {
|
|
1502
|
+
number
|
|
1503
|
+
};
|
|
1504
|
+
}
|
|
1505
|
+
|
|
1506
|
+
// node_modules/libphonenumber-js/es6/helpers/extractCountryCallingCode.js
|
|
1507
|
+
function extractCountryCallingCode(number, country, defaultCountry, defaultCallingCode, metadataJson) {
|
|
1508
|
+
if (!number) {
|
|
1509
|
+
return {};
|
|
1510
|
+
}
|
|
1511
|
+
var isNumberWithIddPrefix;
|
|
1512
|
+
if (number[0] !== "+") {
|
|
1513
|
+
var numberWithoutIDD = stripIddPrefix(number, country || defaultCountry, defaultCallingCode, metadataJson);
|
|
1514
|
+
if (numberWithoutIDD && numberWithoutIDD !== number) {
|
|
1515
|
+
isNumberWithIddPrefix = true;
|
|
1516
|
+
number = "+" + numberWithoutIDD;
|
|
1517
|
+
} else {
|
|
1518
|
+
if (country || defaultCountry || defaultCallingCode) {
|
|
1519
|
+
var _extractCountryCallin = extractCountryCallingCodeFromInternationalNumberWithoutPlusSign(number, country, defaultCountry, defaultCallingCode, metadataJson), countryCallingCode = _extractCountryCallin.countryCallingCode, shorterNumber = _extractCountryCallin.number;
|
|
1520
|
+
if (countryCallingCode) {
|
|
1521
|
+
return {
|
|
1522
|
+
countryCallingCodeSource: "FROM_NUMBER_WITHOUT_PLUS_SIGN",
|
|
1523
|
+
countryCallingCode,
|
|
1524
|
+
number: shorterNumber
|
|
1525
|
+
};
|
|
1526
|
+
}
|
|
1527
|
+
}
|
|
1528
|
+
return {
|
|
1529
|
+
// No need to set it to `UNSPECIFIED`. It can be just `undefined`.
|
|
1530
|
+
// countryCallingCodeSource: 'UNSPECIFIED',
|
|
1531
|
+
number
|
|
1532
|
+
};
|
|
1533
|
+
}
|
|
1534
|
+
}
|
|
1535
|
+
if (number[1] === "0") {
|
|
1536
|
+
return {};
|
|
1537
|
+
}
|
|
1538
|
+
var metadata = new Metadata(metadataJson);
|
|
1539
|
+
var i2 = 2;
|
|
1540
|
+
while (i2 - 1 <= MAX_LENGTH_COUNTRY_CODE && i2 <= number.length) {
|
|
1541
|
+
var _countryCallingCode = number.slice(1, i2);
|
|
1542
|
+
if (metadata.hasCallingCode(_countryCallingCode)) {
|
|
1543
|
+
metadata.selectNumberingPlan(_countryCallingCode);
|
|
1544
|
+
return {
|
|
1545
|
+
countryCallingCodeSource: isNumberWithIddPrefix ? "FROM_NUMBER_WITH_IDD" : "FROM_NUMBER_WITH_PLUS_SIGN",
|
|
1546
|
+
countryCallingCode: _countryCallingCode,
|
|
1547
|
+
number: number.slice(i2)
|
|
1548
|
+
};
|
|
1549
|
+
}
|
|
1550
|
+
i2++;
|
|
1551
|
+
}
|
|
1552
|
+
return {};
|
|
1553
|
+
}
|
|
1554
|
+
|
|
1555
|
+
// node_modules/libphonenumber-js/es6/helpers/applyInternationalSeparatorStyle.js
|
|
1556
|
+
function applyInternationalSeparatorStyle(formattedNumber) {
|
|
1557
|
+
return formattedNumber.replace(new RegExp("[".concat(VALID_PUNCTUATION, "]+"), "g"), " ").trim();
|
|
1558
|
+
}
|
|
1559
|
+
|
|
1560
|
+
// node_modules/libphonenumber-js/es6/helpers/formatNationalNumberUsingFormat.js
|
|
1561
|
+
var FIRST_GROUP_PATTERN = /(\$\d)/;
|
|
1562
|
+
function formatNationalNumberUsingFormat(number, format, _ref) {
|
|
1563
|
+
var useInternationalFormat = _ref.useInternationalFormat, withNationalPrefix = _ref.withNationalPrefix, carrierCode = _ref.carrierCode, metadata = _ref.metadata;
|
|
1564
|
+
var formattedNumber = number.replace(new RegExp(format.pattern()), useInternationalFormat ? format.internationalFormat() : (
|
|
1565
|
+
// This library doesn't use `domestic_carrier_code_formatting_rule`,
|
|
1566
|
+
// because that one is only used when formatting phone numbers
|
|
1567
|
+
// for dialing from a mobile phone, and this is not a dialing library.
|
|
1568
|
+
// carrierCode && format.domesticCarrierCodeFormattingRule()
|
|
1569
|
+
// // First, replace the $CC in the formatting rule with the desired carrier code.
|
|
1570
|
+
// // Then, replace the $FG in the formatting rule with the first group
|
|
1571
|
+
// // and the carrier code combined in the appropriate way.
|
|
1572
|
+
// ? format.format().replace(FIRST_GROUP_PATTERN, format.domesticCarrierCodeFormattingRule().replace('$CC', carrierCode))
|
|
1573
|
+
// : (
|
|
1574
|
+
// withNationalPrefix && format.nationalPrefixFormattingRule()
|
|
1575
|
+
// ? format.format().replace(FIRST_GROUP_PATTERN, format.nationalPrefixFormattingRule())
|
|
1576
|
+
// : format.format()
|
|
1577
|
+
// )
|
|
1578
|
+
withNationalPrefix && format.nationalPrefixFormattingRule() ? format.format().replace(FIRST_GROUP_PATTERN, format.nationalPrefixFormattingRule()) : format.format()
|
|
1579
|
+
));
|
|
1580
|
+
if (useInternationalFormat) {
|
|
1581
|
+
return applyInternationalSeparatorStyle(formattedNumber);
|
|
1582
|
+
}
|
|
1583
|
+
return formattedNumber;
|
|
1584
|
+
}
|
|
1585
|
+
|
|
1586
|
+
// node_modules/libphonenumber-js/es6/helpers/getIddPrefix.js
|
|
1587
|
+
var SINGLE_IDD_PREFIX_REG_EXP = /^[\d]+(?:[~\u2053\u223C\uFF5E][\d]+)?$/;
|
|
1588
|
+
function getIddPrefix(country, callingCode, metadata) {
|
|
1589
|
+
var countryMetadata = new Metadata(metadata);
|
|
1590
|
+
countryMetadata.selectNumberingPlan(country || callingCode);
|
|
1591
|
+
if (countryMetadata.defaultIDDPrefix()) {
|
|
1592
|
+
return countryMetadata.defaultIDDPrefix();
|
|
1593
|
+
}
|
|
1594
|
+
if (SINGLE_IDD_PREFIX_REG_EXP.test(countryMetadata.IDDPrefix())) {
|
|
1595
|
+
return countryMetadata.IDDPrefix();
|
|
1596
|
+
}
|
|
1597
|
+
}
|
|
1598
|
+
|
|
1599
|
+
// node_modules/libphonenumber-js/es6/helpers/extension/createExtensionPattern.js
|
|
1600
|
+
var RFC3966_EXTN_PREFIX = ";ext=";
|
|
1601
|
+
var getExtensionDigitsPattern = function getExtensionDigitsPattern2(maxLength) {
|
|
1602
|
+
return "([".concat(VALID_DIGITS, "]{1,").concat(maxLength, "})");
|
|
1603
|
+
};
|
|
1604
|
+
function createExtensionPattern(purpose) {
|
|
1605
|
+
var extLimitAfterExplicitLabel = "20";
|
|
1606
|
+
var extLimitAfterLikelyLabel = "15";
|
|
1607
|
+
var extLimitAfterAmbiguousChar = "9";
|
|
1608
|
+
var extLimitWhenNotSure = "6";
|
|
1609
|
+
var possibleSeparatorsBetweenNumberAndExtLabel = "[ \xA0\\t,]*";
|
|
1610
|
+
var possibleCharsAfterExtLabel = "[:\\.\uFF0E]?[ \xA0\\t,-]*";
|
|
1611
|
+
var optionalExtnSuffix = "#?";
|
|
1612
|
+
var explicitExtLabels = "(?:e?xt(?:ensi(?:o\u0301?|\xF3))?n?|\uFF45?\uFF58\uFF54\uFF4E?|\u0434\u043E\u0431|anexo)";
|
|
1613
|
+
var ambiguousExtLabels = "(?:[x\uFF58#\uFF03~\uFF5E]|int|\uFF49\uFF4E\uFF54)";
|
|
1614
|
+
var ambiguousSeparator = "[- ]+";
|
|
1615
|
+
var possibleSeparatorsNumberExtLabelNoComma = "[ \xA0\\t]*";
|
|
1616
|
+
var autoDiallingAndExtLabelsFound = "(?:,{2}|;)";
|
|
1617
|
+
var rfcExtn = RFC3966_EXTN_PREFIX + getExtensionDigitsPattern(extLimitAfterExplicitLabel);
|
|
1618
|
+
var explicitExtn = possibleSeparatorsBetweenNumberAndExtLabel + explicitExtLabels + possibleCharsAfterExtLabel + getExtensionDigitsPattern(extLimitAfterExplicitLabel) + optionalExtnSuffix;
|
|
1619
|
+
var ambiguousExtn = possibleSeparatorsBetweenNumberAndExtLabel + ambiguousExtLabels + possibleCharsAfterExtLabel + getExtensionDigitsPattern(extLimitAfterAmbiguousChar) + optionalExtnSuffix;
|
|
1620
|
+
var americanStyleExtnWithSuffix = ambiguousSeparator + getExtensionDigitsPattern(extLimitWhenNotSure) + "#";
|
|
1621
|
+
var autoDiallingExtn = possibleSeparatorsNumberExtLabelNoComma + autoDiallingAndExtLabelsFound + possibleCharsAfterExtLabel + getExtensionDigitsPattern(extLimitAfterLikelyLabel) + optionalExtnSuffix;
|
|
1622
|
+
var onlyCommasExtn = possibleSeparatorsNumberExtLabelNoComma + "(?:,)+" + possibleCharsAfterExtLabel + getExtensionDigitsPattern(extLimitAfterAmbiguousChar) + optionalExtnSuffix;
|
|
1623
|
+
return rfcExtn + "|" + explicitExtn + "|" + ambiguousExtn + "|" + americanStyleExtnWithSuffix + "|" + autoDiallingExtn + "|" + onlyCommasExtn;
|
|
1624
|
+
}
|
|
1625
|
+
|
|
1626
|
+
// node_modules/libphonenumber-js/es6/helpers/isViablePhoneNumber.js
|
|
1627
|
+
var MIN_LENGTH_PHONE_NUMBER_PATTERN = "[" + VALID_DIGITS + "]{" + MIN_LENGTH_FOR_NSN + "}";
|
|
1628
|
+
var VALID_PHONE_NUMBER = "[" + PLUS_CHARS + "]{0,1}(?:[" + VALID_PUNCTUATION + "]*[" + VALID_DIGITS + "]){3,}[" + VALID_PUNCTUATION + VALID_DIGITS + "]*";
|
|
1629
|
+
var VALID_PHONE_NUMBER_START_REG_EXP = new RegExp("^[" + PLUS_CHARS + "]{0,1}(?:[" + VALID_PUNCTUATION + "]*[" + VALID_DIGITS + "]){1,2}$", "i");
|
|
1630
|
+
var VALID_PHONE_NUMBER_WITH_EXTENSION = VALID_PHONE_NUMBER + // Phone number extensions
|
|
1631
|
+
"(?:" + createExtensionPattern() + ")?";
|
|
1632
|
+
var VALID_PHONE_NUMBER_PATTERN = new RegExp(
|
|
1633
|
+
// Either a short two-digit-only phone number
|
|
1634
|
+
"^" + MIN_LENGTH_PHONE_NUMBER_PATTERN + "$|^" + VALID_PHONE_NUMBER_WITH_EXTENSION + "$",
|
|
1635
|
+
"i"
|
|
1636
|
+
);
|
|
1637
|
+
function isViablePhoneNumber(number) {
|
|
1638
|
+
return number.length >= MIN_LENGTH_FOR_NSN && VALID_PHONE_NUMBER_PATTERN.test(number);
|
|
1639
|
+
}
|
|
1640
|
+
function isViablePhoneNumberStart(number) {
|
|
1641
|
+
return VALID_PHONE_NUMBER_START_REG_EXP.test(number);
|
|
1642
|
+
}
|
|
1643
|
+
|
|
1644
|
+
// node_modules/libphonenumber-js/es6/helpers/RFC3966.js
|
|
1645
|
+
function formatRFC3966(_ref) {
|
|
1646
|
+
var number = _ref.number, ext = _ref.ext;
|
|
1647
|
+
if (!number) {
|
|
1648
|
+
return "";
|
|
1649
|
+
}
|
|
1650
|
+
if (number[0] !== "+") {
|
|
1651
|
+
throw new Error('"formatRFC3966()" expects "number" to be in E.164 format.');
|
|
1652
|
+
}
|
|
1653
|
+
return "tel:".concat(number).concat(ext ? ";ext=" + ext : "");
|
|
1654
|
+
}
|
|
1655
|
+
|
|
1656
|
+
// node_modules/libphonenumber-js/es6/format.js
|
|
1657
|
+
var DEFAULT_OPTIONS = {
|
|
1658
|
+
formatExtension: function formatExtension(formattedNumber, extension, metadata) {
|
|
1659
|
+
return "".concat(formattedNumber).concat(metadata.ext()).concat(extension);
|
|
1660
|
+
}
|
|
1661
|
+
};
|
|
1662
|
+
function formatNumber(input, format, options, metadataJson) {
|
|
1663
|
+
if (options) {
|
|
1664
|
+
options = merge({}, DEFAULT_OPTIONS, options);
|
|
1665
|
+
} else {
|
|
1666
|
+
options = DEFAULT_OPTIONS;
|
|
1667
|
+
}
|
|
1668
|
+
var metadata = new Metadata(metadataJson);
|
|
1669
|
+
if (input.country && input.country !== "001") {
|
|
1670
|
+
if (!metadata.hasCountry(input.country)) {
|
|
1671
|
+
throw new Error("Unknown country: ".concat(input.country));
|
|
1672
|
+
}
|
|
1673
|
+
metadata.selectNumberingPlan(input.country);
|
|
1674
|
+
} else if (input.countryCallingCode) {
|
|
1675
|
+
metadata.selectNumberingPlan(input.countryCallingCode);
|
|
1676
|
+
} else return input.phone || "";
|
|
1677
|
+
var countryCallingCode = metadata.countryCallingCode();
|
|
1678
|
+
var nationalNumber = options.v2 ? input.nationalNumber : input.phone;
|
|
1679
|
+
var number;
|
|
1680
|
+
switch (format) {
|
|
1681
|
+
case "NATIONAL":
|
|
1682
|
+
if (!nationalNumber) {
|
|
1683
|
+
return "";
|
|
1684
|
+
}
|
|
1685
|
+
number = formatNationalNumber(nationalNumber, input.carrierCode, "NATIONAL", metadata, options);
|
|
1686
|
+
return addExtension(number, input.ext, metadata, options.formatExtension);
|
|
1687
|
+
case "INTERNATIONAL":
|
|
1688
|
+
if (!nationalNumber) {
|
|
1689
|
+
return "+".concat(countryCallingCode);
|
|
1690
|
+
}
|
|
1691
|
+
number = formatNationalNumber(nationalNumber, null, "INTERNATIONAL", metadata, options);
|
|
1692
|
+
number = "+".concat(countryCallingCode, " ").concat(number);
|
|
1693
|
+
return addExtension(number, input.ext, metadata, options.formatExtension);
|
|
1694
|
+
case "E.164":
|
|
1695
|
+
return "+".concat(countryCallingCode).concat(nationalNumber);
|
|
1696
|
+
case "RFC3966":
|
|
1697
|
+
return formatRFC3966({
|
|
1698
|
+
number: "+".concat(countryCallingCode).concat(nationalNumber),
|
|
1699
|
+
ext: input.ext
|
|
1700
|
+
});
|
|
1701
|
+
// For reference, here's Google's IDD formatter:
|
|
1702
|
+
// https://github.com/google/libphonenumber/blob/32719cf74e68796788d1ca45abc85dcdc63ba5b9/java/libphonenumber/src/com/google/i18n/phonenumbers/PhoneNumberUtil.java#L1546
|
|
1703
|
+
// Not saying that this IDD formatter replicates it 1:1, but it seems to work.
|
|
1704
|
+
// Who would even need to format phone numbers in IDD format anyway?
|
|
1705
|
+
case "IDD":
|
|
1706
|
+
if (!options.fromCountry) {
|
|
1707
|
+
return;
|
|
1708
|
+
}
|
|
1709
|
+
var formattedNumber = formatIDD(nationalNumber, input.carrierCode, countryCallingCode, options.fromCountry, metadata);
|
|
1710
|
+
if (!formattedNumber) {
|
|
1711
|
+
return;
|
|
1712
|
+
}
|
|
1713
|
+
return addExtension(formattedNumber, input.ext, metadata, options.formatExtension);
|
|
1714
|
+
default:
|
|
1715
|
+
throw new Error('Unknown "format" argument passed to "formatNumber()": "'.concat(format, '"'));
|
|
1716
|
+
}
|
|
1717
|
+
}
|
|
1718
|
+
function formatNationalNumber(number, carrierCode, formatAs, metadata, options) {
|
|
1719
|
+
var format = chooseFormatForNumber(metadata.formats(), number);
|
|
1720
|
+
if (!format) {
|
|
1721
|
+
return number;
|
|
1722
|
+
}
|
|
1723
|
+
return formatNationalNumberUsingFormat(number, format, {
|
|
1724
|
+
useInternationalFormat: formatAs === "INTERNATIONAL",
|
|
1725
|
+
withNationalPrefix: format.nationalPrefixIsOptionalWhenFormattingInNationalFormat() && options && options.nationalPrefix === false ? false : true,
|
|
1726
|
+
carrierCode,
|
|
1727
|
+
metadata
|
|
1728
|
+
});
|
|
1729
|
+
}
|
|
1730
|
+
function chooseFormatForNumber(availableFormats, nationalNumber) {
|
|
1731
|
+
return pickFirstMatchingElement(availableFormats, function(format) {
|
|
1732
|
+
if (format.leadingDigitsPatterns().length > 0) {
|
|
1733
|
+
var lastLeadingDigitsPattern = format.leadingDigitsPatterns()[format.leadingDigitsPatterns().length - 1];
|
|
1734
|
+
if (nationalNumber.search(lastLeadingDigitsPattern) !== 0) {
|
|
1735
|
+
return false;
|
|
1736
|
+
}
|
|
1737
|
+
}
|
|
1738
|
+
return matchesEntirely(nationalNumber, format.pattern());
|
|
1739
|
+
});
|
|
1740
|
+
}
|
|
1741
|
+
function addExtension(formattedNumber, ext, metadata, formatExtension2) {
|
|
1742
|
+
return ext ? formatExtension2(formattedNumber, ext, metadata) : formattedNumber;
|
|
1743
|
+
}
|
|
1744
|
+
function formatIDD(nationalNumber, carrierCode, countryCallingCode, fromCountry, metadata) {
|
|
1745
|
+
var fromCountryCallingCode = getCountryCallingCode(fromCountry, metadata.metadata);
|
|
1746
|
+
if (fromCountryCallingCode === countryCallingCode) {
|
|
1747
|
+
var formattedNumber = formatNationalNumber(nationalNumber, carrierCode, "NATIONAL", metadata);
|
|
1748
|
+
if (countryCallingCode === "1") {
|
|
1749
|
+
return countryCallingCode + " " + formattedNumber;
|
|
1750
|
+
}
|
|
1751
|
+
return formattedNumber;
|
|
1752
|
+
}
|
|
1753
|
+
var iddPrefix = getIddPrefix(fromCountry, void 0, metadata.metadata);
|
|
1754
|
+
if (iddPrefix) {
|
|
1755
|
+
return "".concat(iddPrefix, " ").concat(countryCallingCode, " ").concat(formatNationalNumber(nationalNumber, null, "INTERNATIONAL", metadata));
|
|
1756
|
+
}
|
|
1757
|
+
}
|
|
1758
|
+
function merge() {
|
|
1759
|
+
var i2 = 1;
|
|
1760
|
+
for (var _len = arguments.length, objects = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
1761
|
+
objects[_key] = arguments[_key];
|
|
1762
|
+
}
|
|
1763
|
+
while (i2 < objects.length) {
|
|
1764
|
+
if (objects[i2]) {
|
|
1765
|
+
for (var key in objects[i2]) {
|
|
1766
|
+
objects[0][key] = objects[i2][key];
|
|
1767
|
+
}
|
|
1768
|
+
}
|
|
1769
|
+
i2++;
|
|
1770
|
+
}
|
|
1771
|
+
return objects[0];
|
|
1772
|
+
}
|
|
1773
|
+
function pickFirstMatchingElement(elements, testFunction) {
|
|
1774
|
+
var i2 = 0;
|
|
1775
|
+
while (i2 < elements.length) {
|
|
1776
|
+
if (testFunction(elements[i2])) {
|
|
1777
|
+
return elements[i2];
|
|
1778
|
+
}
|
|
1779
|
+
i2++;
|
|
1780
|
+
}
|
|
1781
|
+
}
|
|
1782
|
+
|
|
1783
|
+
// node_modules/libphonenumber-js/es6/PhoneNumber.js
|
|
1784
|
+
function _typeof2(o2) {
|
|
1785
|
+
"@babel/helpers - typeof";
|
|
1786
|
+
return _typeof2 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o3) {
|
|
1787
|
+
return typeof o3;
|
|
1788
|
+
} : function(o3) {
|
|
1789
|
+
return o3 && "function" == typeof Symbol && o3.constructor === Symbol && o3 !== Symbol.prototype ? "symbol" : typeof o3;
|
|
1790
|
+
}, _typeof2(o2);
|
|
1791
|
+
}
|
|
1792
|
+
function ownKeys(e2, r2) {
|
|
1793
|
+
var t2 = Object.keys(e2);
|
|
1794
|
+
if (Object.getOwnPropertySymbols) {
|
|
1795
|
+
var o2 = Object.getOwnPropertySymbols(e2);
|
|
1796
|
+
r2 && (o2 = o2.filter(function(r3) {
|
|
1797
|
+
return Object.getOwnPropertyDescriptor(e2, r3).enumerable;
|
|
1798
|
+
})), t2.push.apply(t2, o2);
|
|
1799
|
+
}
|
|
1800
|
+
return t2;
|
|
1801
|
+
}
|
|
1802
|
+
function _objectSpread(e2) {
|
|
1803
|
+
for (var r2 = 1; r2 < arguments.length; r2++) {
|
|
1804
|
+
var t2 = null != arguments[r2] ? arguments[r2] : {};
|
|
1805
|
+
r2 % 2 ? ownKeys(Object(t2), true).forEach(function(r3) {
|
|
1806
|
+
_defineProperty(e2, r3, t2[r3]);
|
|
1807
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e2, Object.getOwnPropertyDescriptors(t2)) : ownKeys(Object(t2)).forEach(function(r3) {
|
|
1808
|
+
Object.defineProperty(e2, r3, Object.getOwnPropertyDescriptor(t2, r3));
|
|
1809
|
+
});
|
|
1810
|
+
}
|
|
1811
|
+
return e2;
|
|
1812
|
+
}
|
|
1813
|
+
function _defineProperty(e2, r2, t2) {
|
|
1814
|
+
return (r2 = _toPropertyKey2(r2)) in e2 ? Object.defineProperty(e2, r2, { value: t2, enumerable: true, configurable: true, writable: true }) : e2[r2] = t2, e2;
|
|
1815
|
+
}
|
|
1816
|
+
function _classCallCheck2(a2, n2) {
|
|
1817
|
+
if (!(a2 instanceof n2)) throw new TypeError("Cannot call a class as a function");
|
|
1818
|
+
}
|
|
1819
|
+
function _defineProperties2(e2, r2) {
|
|
1820
|
+
for (var t2 = 0; t2 < r2.length; t2++) {
|
|
1821
|
+
var o2 = r2[t2];
|
|
1822
|
+
o2.enumerable = o2.enumerable || false, o2.configurable = true, "value" in o2 && (o2.writable = true), Object.defineProperty(e2, _toPropertyKey2(o2.key), o2);
|
|
1823
|
+
}
|
|
1824
|
+
}
|
|
1825
|
+
function _createClass2(e2, r2, t2) {
|
|
1826
|
+
return r2 && _defineProperties2(e2.prototype, r2), t2 && _defineProperties2(e2, t2), Object.defineProperty(e2, "prototype", { writable: false }), e2;
|
|
1827
|
+
}
|
|
1828
|
+
function _toPropertyKey2(t2) {
|
|
1829
|
+
var i2 = _toPrimitive2(t2, "string");
|
|
1830
|
+
return "symbol" == _typeof2(i2) ? i2 : i2 + "";
|
|
1831
|
+
}
|
|
1832
|
+
function _toPrimitive2(t2, r2) {
|
|
1833
|
+
if ("object" != _typeof2(t2) || !t2) return t2;
|
|
1834
|
+
var e2 = t2[Symbol.toPrimitive];
|
|
1835
|
+
if (void 0 !== e2) {
|
|
1836
|
+
var i2 = e2.call(t2, r2 || "default");
|
|
1837
|
+
if ("object" != _typeof2(i2)) return i2;
|
|
1838
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
1839
|
+
}
|
|
1840
|
+
return ("string" === r2 ? String : Number)(t2);
|
|
1841
|
+
}
|
|
1842
|
+
var PhoneNumber = /* @__PURE__ */ (function() {
|
|
1843
|
+
function PhoneNumber2(countryOrCountryCallingCode, nationalNumber, metadata) {
|
|
1844
|
+
_classCallCheck2(this, PhoneNumber2);
|
|
1845
|
+
if (!countryOrCountryCallingCode) {
|
|
1846
|
+
throw new TypeError("First argument is required");
|
|
1847
|
+
}
|
|
1848
|
+
if (typeof countryOrCountryCallingCode !== "string") {
|
|
1849
|
+
throw new TypeError("First argument must be a string");
|
|
1850
|
+
}
|
|
1851
|
+
if (countryOrCountryCallingCode[0] === "+" && !nationalNumber) {
|
|
1852
|
+
throw new TypeError("`metadata` argument not passed");
|
|
1853
|
+
}
|
|
1854
|
+
if (isObject(nationalNumber) && isObject(nationalNumber.countries)) {
|
|
1855
|
+
metadata = nationalNumber;
|
|
1856
|
+
var e164Number = countryOrCountryCallingCode;
|
|
1857
|
+
if (!E164_NUMBER_REGEXP.test(e164Number)) {
|
|
1858
|
+
throw new Error('Invalid `number` argument passed: must consist of a "+" followed by digits');
|
|
1859
|
+
}
|
|
1860
|
+
var _extractCountryCallin = extractCountryCallingCode(e164Number, void 0, void 0, void 0, metadata), _countryCallingCode = _extractCountryCallin.countryCallingCode, number = _extractCountryCallin.number;
|
|
1861
|
+
nationalNumber = number;
|
|
1862
|
+
countryOrCountryCallingCode = _countryCallingCode;
|
|
1863
|
+
if (!nationalNumber) {
|
|
1864
|
+
throw new Error("Invalid `number` argument passed: too short");
|
|
1865
|
+
}
|
|
1866
|
+
}
|
|
1867
|
+
if (!nationalNumber) {
|
|
1868
|
+
throw new TypeError("`nationalNumber` argument is required");
|
|
1869
|
+
}
|
|
1870
|
+
if (typeof nationalNumber !== "string") {
|
|
1871
|
+
throw new TypeError("`nationalNumber` argument must be a string");
|
|
1872
|
+
}
|
|
1873
|
+
validateMetadata(metadata);
|
|
1874
|
+
var _getCountryAndCalling = getCountryAndCallingCodeFromOneOfThem(countryOrCountryCallingCode, metadata), country = _getCountryAndCalling.country, countryCallingCode = _getCountryAndCalling.callingCode;
|
|
1875
|
+
this.country = country;
|
|
1876
|
+
this.countryCallingCode = countryCallingCode;
|
|
1877
|
+
this.nationalNumber = nationalNumber;
|
|
1878
|
+
this.number = "+" + this.countryCallingCode + this.nationalNumber;
|
|
1879
|
+
this.getMetadata = function() {
|
|
1880
|
+
return metadata;
|
|
1881
|
+
};
|
|
1882
|
+
}
|
|
1883
|
+
return _createClass2(PhoneNumber2, [{
|
|
1884
|
+
key: "setExt",
|
|
1885
|
+
value: function setExt(ext) {
|
|
1886
|
+
this.ext = ext;
|
|
1887
|
+
}
|
|
1888
|
+
}, {
|
|
1889
|
+
key: "getPossibleCountries",
|
|
1890
|
+
value: function getPossibleCountries() {
|
|
1891
|
+
if (this.country) {
|
|
1892
|
+
return [this.country];
|
|
1893
|
+
}
|
|
1894
|
+
return getPossibleCountriesForNumber(this.countryCallingCode, this.nationalNumber, this.getMetadata());
|
|
1895
|
+
}
|
|
1896
|
+
}, {
|
|
1897
|
+
key: "isPossible",
|
|
1898
|
+
value: function isPossible() {
|
|
1899
|
+
return isPossiblePhoneNumber(this, {
|
|
1900
|
+
v2: true
|
|
1901
|
+
}, this.getMetadata());
|
|
1902
|
+
}
|
|
1903
|
+
}, {
|
|
1904
|
+
key: "isValid",
|
|
1905
|
+
value: function isValid() {
|
|
1906
|
+
return isValidNumber(this, {
|
|
1907
|
+
v2: true
|
|
1908
|
+
}, this.getMetadata());
|
|
1909
|
+
}
|
|
1910
|
+
}, {
|
|
1911
|
+
key: "isNonGeographic",
|
|
1912
|
+
value: function isNonGeographic() {
|
|
1913
|
+
var metadata = new Metadata(this.getMetadata());
|
|
1914
|
+
return metadata.isNonGeographicCallingCode(this.countryCallingCode);
|
|
1915
|
+
}
|
|
1916
|
+
}, {
|
|
1917
|
+
key: "isEqual",
|
|
1918
|
+
value: function isEqual(phoneNumber) {
|
|
1919
|
+
return this.number === phoneNumber.number && this.ext === phoneNumber.ext;
|
|
1920
|
+
}
|
|
1921
|
+
// `validateLength()` method was originally meant to be an equivalent for `validatePhoneNumberLength()`.
|
|
1922
|
+
//
|
|
1923
|
+
// Later, it became apparent that it's not really a true equivalent.
|
|
1924
|
+
// The reason is that a `PhoneNumber` instance is not created
|
|
1925
|
+
// when the phone number string is too short for it to be considered a valid phone number:
|
|
1926
|
+
// * When there must be at least 2 national (significant) number digits: `"1"`.
|
|
1927
|
+
// * When the country calling code part of an international number is incomplete: `"+12"`.
|
|
1928
|
+
//
|
|
1929
|
+
// So leaving this `validateLength()` method here would suggest a hidden anti-pattern
|
|
1930
|
+
// of using it instead of `validatePhoneNumberLength()` while ignoring
|
|
1931
|
+
// the "too short to be even possible" case from phone number length validation.
|
|
1932
|
+
// And ignoring that case wouldn't make any sense in a real-world application
|
|
1933
|
+
// because it would still be a valid case that should be handled.
|
|
1934
|
+
//
|
|
1935
|
+
// Because of that, this method was eventually commented out in order to not introduce
|
|
1936
|
+
// that kind of an anti-pattern.
|
|
1937
|
+
//
|
|
1938
|
+
// validateLength() {
|
|
1939
|
+
// const result = checkNumberLength(
|
|
1940
|
+
// this.nationalNumber,
|
|
1941
|
+
// undefined,
|
|
1942
|
+
// this.getMetadata()
|
|
1943
|
+
// )
|
|
1944
|
+
// if (result !== 'IS_POSSIBLE') {
|
|
1945
|
+
// return result
|
|
1946
|
+
// }
|
|
1947
|
+
// }
|
|
1948
|
+
}, {
|
|
1949
|
+
key: "getType",
|
|
1950
|
+
value: function getType2() {
|
|
1951
|
+
return getNumberType(this, {
|
|
1952
|
+
v2: true
|
|
1953
|
+
}, this.getMetadata());
|
|
1954
|
+
}
|
|
1955
|
+
}, {
|
|
1956
|
+
key: "format",
|
|
1957
|
+
value: function format(_format, options) {
|
|
1958
|
+
return formatNumber(this, _format, options ? _objectSpread(_objectSpread({}, options), {}, {
|
|
1959
|
+
v2: true
|
|
1960
|
+
}) : {
|
|
1961
|
+
v2: true
|
|
1962
|
+
}, this.getMetadata());
|
|
1963
|
+
}
|
|
1964
|
+
}, {
|
|
1965
|
+
key: "formatNational",
|
|
1966
|
+
value: function formatNational(options) {
|
|
1967
|
+
return this.format("NATIONAL", options);
|
|
1968
|
+
}
|
|
1969
|
+
}, {
|
|
1970
|
+
key: "formatInternational",
|
|
1971
|
+
value: function formatInternational(options) {
|
|
1972
|
+
return this.format("INTERNATIONAL", options);
|
|
1973
|
+
}
|
|
1974
|
+
}, {
|
|
1975
|
+
key: "getURI",
|
|
1976
|
+
value: function getURI(options) {
|
|
1977
|
+
return this.format("RFC3966", options);
|
|
1978
|
+
}
|
|
1979
|
+
}]);
|
|
1980
|
+
})();
|
|
1981
|
+
var E164_NUMBER_REGEXP = /^\+\d+$/;
|
|
1982
|
+
|
|
1983
|
+
// node_modules/libphonenumber-js/es6/ParseError.js
|
|
1984
|
+
function _typeof3(o2) {
|
|
1985
|
+
"@babel/helpers - typeof";
|
|
1986
|
+
return _typeof3 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o3) {
|
|
1987
|
+
return typeof o3;
|
|
1988
|
+
} : function(o3) {
|
|
1989
|
+
return o3 && "function" == typeof Symbol && o3.constructor === Symbol && o3 !== Symbol.prototype ? "symbol" : typeof o3;
|
|
1990
|
+
}, _typeof3(o2);
|
|
1991
|
+
}
|
|
1992
|
+
function _defineProperties3(e2, r2) {
|
|
1993
|
+
for (var t2 = 0; t2 < r2.length; t2++) {
|
|
1994
|
+
var o2 = r2[t2];
|
|
1995
|
+
o2.enumerable = o2.enumerable || false, o2.configurable = true, "value" in o2 && (o2.writable = true), Object.defineProperty(e2, _toPropertyKey3(o2.key), o2);
|
|
1996
|
+
}
|
|
1997
|
+
}
|
|
1998
|
+
function _createClass3(e2, r2, t2) {
|
|
1999
|
+
return r2 && _defineProperties3(e2.prototype, r2), t2 && _defineProperties3(e2, t2), Object.defineProperty(e2, "prototype", { writable: false }), e2;
|
|
2000
|
+
}
|
|
2001
|
+
function _toPropertyKey3(t2) {
|
|
2002
|
+
var i2 = _toPrimitive3(t2, "string");
|
|
2003
|
+
return "symbol" == _typeof3(i2) ? i2 : i2 + "";
|
|
2004
|
+
}
|
|
2005
|
+
function _toPrimitive3(t2, r2) {
|
|
2006
|
+
if ("object" != _typeof3(t2) || !t2) return t2;
|
|
2007
|
+
var e2 = t2[Symbol.toPrimitive];
|
|
2008
|
+
if (void 0 !== e2) {
|
|
2009
|
+
var i2 = e2.call(t2, r2 || "default");
|
|
2010
|
+
if ("object" != _typeof3(i2)) return i2;
|
|
2011
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
2012
|
+
}
|
|
2013
|
+
return ("string" === r2 ? String : Number)(t2);
|
|
2014
|
+
}
|
|
2015
|
+
function _classCallCheck3(a2, n2) {
|
|
2016
|
+
if (!(a2 instanceof n2)) throw new TypeError("Cannot call a class as a function");
|
|
2017
|
+
}
|
|
2018
|
+
function _callSuper(t2, o2, e2) {
|
|
2019
|
+
return o2 = _getPrototypeOf(o2), _possibleConstructorReturn(t2, _isNativeReflectConstruct() ? Reflect.construct(o2, e2 || [], _getPrototypeOf(t2).constructor) : o2.apply(t2, e2));
|
|
2020
|
+
}
|
|
2021
|
+
function _possibleConstructorReturn(t2, e2) {
|
|
2022
|
+
if (e2 && ("object" == _typeof3(e2) || "function" == typeof e2)) return e2;
|
|
2023
|
+
if (void 0 !== e2) throw new TypeError("Derived constructors may only return object or undefined");
|
|
2024
|
+
return _assertThisInitialized(t2);
|
|
2025
|
+
}
|
|
2026
|
+
function _assertThisInitialized(e2) {
|
|
2027
|
+
if (void 0 === e2) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
2028
|
+
return e2;
|
|
2029
|
+
}
|
|
2030
|
+
function _inherits(t2, e2) {
|
|
2031
|
+
if ("function" != typeof e2 && null !== e2) throw new TypeError("Super expression must either be null or a function");
|
|
2032
|
+
t2.prototype = Object.create(e2 && e2.prototype, { constructor: { value: t2, writable: true, configurable: true } }), Object.defineProperty(t2, "prototype", { writable: false }), e2 && _setPrototypeOf(t2, e2);
|
|
2033
|
+
}
|
|
2034
|
+
function _wrapNativeSuper(t2) {
|
|
2035
|
+
var r2 = "function" == typeof Map ? /* @__PURE__ */ new Map() : void 0;
|
|
2036
|
+
return _wrapNativeSuper = function _wrapNativeSuper2(t3) {
|
|
2037
|
+
if (null === t3 || !_isNativeFunction(t3)) return t3;
|
|
2038
|
+
if ("function" != typeof t3) throw new TypeError("Super expression must either be null or a function");
|
|
2039
|
+
if (void 0 !== r2) {
|
|
2040
|
+
if (r2.has(t3)) return r2.get(t3);
|
|
2041
|
+
r2.set(t3, Wrapper);
|
|
2042
|
+
}
|
|
2043
|
+
function Wrapper() {
|
|
2044
|
+
return _construct(t3, arguments, _getPrototypeOf(this).constructor);
|
|
2045
|
+
}
|
|
2046
|
+
return Wrapper.prototype = Object.create(t3.prototype, { constructor: { value: Wrapper, enumerable: false, writable: true, configurable: true } }), _setPrototypeOf(Wrapper, t3);
|
|
2047
|
+
}, _wrapNativeSuper(t2);
|
|
2048
|
+
}
|
|
2049
|
+
function _construct(t2, e2, r2) {
|
|
2050
|
+
if (_isNativeReflectConstruct()) return Reflect.construct.apply(null, arguments);
|
|
2051
|
+
var o2 = [null];
|
|
2052
|
+
o2.push.apply(o2, e2);
|
|
2053
|
+
var p = new (t2.bind.apply(t2, o2))();
|
|
2054
|
+
return r2 && _setPrototypeOf(p, r2.prototype), p;
|
|
2055
|
+
}
|
|
2056
|
+
function _isNativeReflectConstruct() {
|
|
2057
|
+
try {
|
|
2058
|
+
var t2 = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
|
|
2059
|
+
}));
|
|
2060
|
+
} catch (t3) {
|
|
2061
|
+
}
|
|
2062
|
+
return (_isNativeReflectConstruct = function _isNativeReflectConstruct2() {
|
|
2063
|
+
return !!t2;
|
|
2064
|
+
})();
|
|
2065
|
+
}
|
|
2066
|
+
function _isNativeFunction(t2) {
|
|
2067
|
+
try {
|
|
2068
|
+
return -1 !== Function.toString.call(t2).indexOf("[native code]");
|
|
2069
|
+
} catch (n2) {
|
|
2070
|
+
return "function" == typeof t2;
|
|
2071
|
+
}
|
|
2072
|
+
}
|
|
2073
|
+
function _setPrototypeOf(t2, e2) {
|
|
2074
|
+
return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(t3, e3) {
|
|
2075
|
+
return t3.__proto__ = e3, t3;
|
|
2076
|
+
}, _setPrototypeOf(t2, e2);
|
|
2077
|
+
}
|
|
2078
|
+
function _getPrototypeOf(t2) {
|
|
2079
|
+
return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(t3) {
|
|
2080
|
+
return t3.__proto__ || Object.getPrototypeOf(t3);
|
|
2081
|
+
}, _getPrototypeOf(t2);
|
|
2082
|
+
}
|
|
2083
|
+
var ParseError = /* @__PURE__ */ (function(_Error) {
|
|
2084
|
+
function ParseError2(code) {
|
|
2085
|
+
var _this;
|
|
2086
|
+
_classCallCheck3(this, ParseError2);
|
|
2087
|
+
_this = _callSuper(this, ParseError2, [code]);
|
|
2088
|
+
Object.setPrototypeOf(_this, ParseError2.prototype);
|
|
2089
|
+
_this.name = _this.constructor.name;
|
|
2090
|
+
return _this;
|
|
2091
|
+
}
|
|
2092
|
+
_inherits(ParseError2, _Error);
|
|
2093
|
+
return _createClass3(ParseError2);
|
|
2094
|
+
})(/* @__PURE__ */ _wrapNativeSuper(Error));
|
|
2095
|
+
|
|
2096
|
+
// node_modules/libphonenumber-js/es6/helpers/extension/extractExtension.js
|
|
2097
|
+
var EXTN_PATTERN = new RegExp("(?:" + createExtensionPattern() + ")$", "i");
|
|
2098
|
+
function extractExtension(number) {
|
|
2099
|
+
var start = number.search(EXTN_PATTERN);
|
|
2100
|
+
if (start < 0) {
|
|
2101
|
+
return {};
|
|
2102
|
+
}
|
|
2103
|
+
var numberWithoutExtension = number.slice(0, start);
|
|
2104
|
+
var matches = number.match(EXTN_PATTERN);
|
|
2105
|
+
var i2 = 1;
|
|
2106
|
+
while (i2 < matches.length) {
|
|
2107
|
+
if (matches[i2]) {
|
|
2108
|
+
return {
|
|
2109
|
+
number: numberWithoutExtension,
|
|
2110
|
+
ext: matches[i2]
|
|
2111
|
+
};
|
|
2112
|
+
}
|
|
2113
|
+
i2++;
|
|
2114
|
+
}
|
|
2115
|
+
}
|
|
2116
|
+
|
|
2117
|
+
// node_modules/libphonenumber-js/es6/helpers/parseDigits.js
|
|
2118
|
+
var DIGITS = {
|
|
2119
|
+
"0": "0",
|
|
2120
|
+
"1": "1",
|
|
2121
|
+
"2": "2",
|
|
2122
|
+
"3": "3",
|
|
2123
|
+
"4": "4",
|
|
2124
|
+
"5": "5",
|
|
2125
|
+
"6": "6",
|
|
2126
|
+
"7": "7",
|
|
2127
|
+
"8": "8",
|
|
2128
|
+
"9": "9",
|
|
2129
|
+
"\uFF10": "0",
|
|
2130
|
+
// Fullwidth digit 0
|
|
2131
|
+
"\uFF11": "1",
|
|
2132
|
+
// Fullwidth digit 1
|
|
2133
|
+
"\uFF12": "2",
|
|
2134
|
+
// Fullwidth digit 2
|
|
2135
|
+
"\uFF13": "3",
|
|
2136
|
+
// Fullwidth digit 3
|
|
2137
|
+
"\uFF14": "4",
|
|
2138
|
+
// Fullwidth digit 4
|
|
2139
|
+
"\uFF15": "5",
|
|
2140
|
+
// Fullwidth digit 5
|
|
2141
|
+
"\uFF16": "6",
|
|
2142
|
+
// Fullwidth digit 6
|
|
2143
|
+
"\uFF17": "7",
|
|
2144
|
+
// Fullwidth digit 7
|
|
2145
|
+
"\uFF18": "8",
|
|
2146
|
+
// Fullwidth digit 8
|
|
2147
|
+
"\uFF19": "9",
|
|
2148
|
+
// Fullwidth digit 9
|
|
2149
|
+
"\u0660": "0",
|
|
2150
|
+
// Arabic-indic digit 0
|
|
2151
|
+
"\u0661": "1",
|
|
2152
|
+
// Arabic-indic digit 1
|
|
2153
|
+
"\u0662": "2",
|
|
2154
|
+
// Arabic-indic digit 2
|
|
2155
|
+
"\u0663": "3",
|
|
2156
|
+
// Arabic-indic digit 3
|
|
2157
|
+
"\u0664": "4",
|
|
2158
|
+
// Arabic-indic digit 4
|
|
2159
|
+
"\u0665": "5",
|
|
2160
|
+
// Arabic-indic digit 5
|
|
2161
|
+
"\u0666": "6",
|
|
2162
|
+
// Arabic-indic digit 6
|
|
2163
|
+
"\u0667": "7",
|
|
2164
|
+
// Arabic-indic digit 7
|
|
2165
|
+
"\u0668": "8",
|
|
2166
|
+
// Arabic-indic digit 8
|
|
2167
|
+
"\u0669": "9",
|
|
2168
|
+
// Arabic-indic digit 9
|
|
2169
|
+
"\u06F0": "0",
|
|
2170
|
+
// Eastern-Arabic digit 0
|
|
2171
|
+
"\u06F1": "1",
|
|
2172
|
+
// Eastern-Arabic digit 1
|
|
2173
|
+
"\u06F2": "2",
|
|
2174
|
+
// Eastern-Arabic digit 2
|
|
2175
|
+
"\u06F3": "3",
|
|
2176
|
+
// Eastern-Arabic digit 3
|
|
2177
|
+
"\u06F4": "4",
|
|
2178
|
+
// Eastern-Arabic digit 4
|
|
2179
|
+
"\u06F5": "5",
|
|
2180
|
+
// Eastern-Arabic digit 5
|
|
2181
|
+
"\u06F6": "6",
|
|
2182
|
+
// Eastern-Arabic digit 6
|
|
2183
|
+
"\u06F7": "7",
|
|
2184
|
+
// Eastern-Arabic digit 7
|
|
2185
|
+
"\u06F8": "8",
|
|
2186
|
+
// Eastern-Arabic digit 8
|
|
2187
|
+
"\u06F9": "9"
|
|
2188
|
+
// Eastern-Arabic digit 9
|
|
2189
|
+
};
|
|
2190
|
+
function parseDigit(character) {
|
|
2191
|
+
return DIGITS[character];
|
|
2192
|
+
}
|
|
2193
|
+
|
|
2194
|
+
// node_modules/libphonenumber-js/es6/parseIncompletePhoneNumber.js
|
|
2195
|
+
function _createForOfIteratorHelperLoose4(r2, e2) {
|
|
2196
|
+
var t2 = "undefined" != typeof Symbol && r2[Symbol.iterator] || r2["@@iterator"];
|
|
2197
|
+
if (t2) return (t2 = t2.call(r2)).next.bind(t2);
|
|
2198
|
+
if (Array.isArray(r2) || (t2 = _unsupportedIterableToArray4(r2)) || e2 && r2 && "number" == typeof r2.length) {
|
|
2199
|
+
t2 && (r2 = t2);
|
|
2200
|
+
var o2 = 0;
|
|
2201
|
+
return function() {
|
|
2202
|
+
return o2 >= r2.length ? { done: true } : { done: false, value: r2[o2++] };
|
|
2203
|
+
};
|
|
2204
|
+
}
|
|
2205
|
+
throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
2206
|
+
}
|
|
2207
|
+
function _unsupportedIterableToArray4(r2, a2) {
|
|
2208
|
+
if (r2) {
|
|
2209
|
+
if ("string" == typeof r2) return _arrayLikeToArray4(r2, a2);
|
|
2210
|
+
var t2 = {}.toString.call(r2).slice(8, -1);
|
|
2211
|
+
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;
|
|
2212
|
+
}
|
|
2213
|
+
}
|
|
2214
|
+
function _arrayLikeToArray4(r2, a2) {
|
|
2215
|
+
(null == a2 || a2 > r2.length) && (a2 = r2.length);
|
|
2216
|
+
for (var e2 = 0, n2 = Array(a2); e2 < a2; e2++) n2[e2] = r2[e2];
|
|
2217
|
+
return n2;
|
|
2218
|
+
}
|
|
2219
|
+
function parseIncompletePhoneNumber(string) {
|
|
2220
|
+
var result2 = "";
|
|
2221
|
+
for (var _iterator = _createForOfIteratorHelperLoose4(string.split("")), _step; !(_step = _iterator()).done; ) {
|
|
2222
|
+
var character = _step.value;
|
|
2223
|
+
result2 += parsePhoneNumberCharacter(character, result2) || "";
|
|
2224
|
+
}
|
|
2225
|
+
return result2;
|
|
2226
|
+
}
|
|
2227
|
+
function parsePhoneNumberCharacter(character, prevParsedCharacters, eventListener) {
|
|
2228
|
+
if (character === "+") {
|
|
2229
|
+
if (prevParsedCharacters) {
|
|
2230
|
+
if (typeof eventListener === "function") {
|
|
2231
|
+
eventListener("end");
|
|
2232
|
+
}
|
|
2233
|
+
return;
|
|
2234
|
+
}
|
|
2235
|
+
return "+";
|
|
2236
|
+
}
|
|
2237
|
+
return parseDigit(character);
|
|
2238
|
+
}
|
|
2239
|
+
|
|
2240
|
+
// node_modules/libphonenumber-js/es6/helpers/extractPhoneContext.js
|
|
2241
|
+
var PLUS_SIGN = "+";
|
|
2242
|
+
var RFC3966_VISUAL_SEPARATOR_ = "[\\-\\.\\(\\)]?";
|
|
2243
|
+
var RFC3966_PHONE_DIGIT_ = "([" + VALID_DIGITS + "]|" + RFC3966_VISUAL_SEPARATOR_ + ")";
|
|
2244
|
+
var RFC3966_GLOBAL_NUMBER_DIGITS_ = "^\\" + PLUS_SIGN + RFC3966_PHONE_DIGIT_ + "*[" + VALID_DIGITS + "]" + RFC3966_PHONE_DIGIT_ + "*$";
|
|
2245
|
+
var RFC3966_GLOBAL_NUMBER_DIGITS_PATTERN_ = new RegExp(RFC3966_GLOBAL_NUMBER_DIGITS_, "g");
|
|
2246
|
+
var ALPHANUM_ = VALID_DIGITS;
|
|
2247
|
+
var RFC3966_DOMAINLABEL_ = "[" + ALPHANUM_ + "]+((\\-)*[" + ALPHANUM_ + "])*";
|
|
2248
|
+
var VALID_ALPHA_ = "a-zA-Z";
|
|
2249
|
+
var RFC3966_TOPLABEL_ = "[" + VALID_ALPHA_ + "]+((\\-)*[" + ALPHANUM_ + "])*";
|
|
2250
|
+
var RFC3966_DOMAINNAME_ = "^(" + RFC3966_DOMAINLABEL_ + "\\.)*" + RFC3966_TOPLABEL_ + "\\.?$";
|
|
2251
|
+
var RFC3966_DOMAINNAME_PATTERN_ = new RegExp(RFC3966_DOMAINNAME_, "g");
|
|
2252
|
+
var RFC3966_PREFIX_ = "tel:";
|
|
2253
|
+
var RFC3966_PHONE_CONTEXT_ = ";phone-context=";
|
|
2254
|
+
var RFC3966_ISDN_SUBADDRESS_ = ";isub=";
|
|
2255
|
+
function extractPhoneContext(numberToExtractFrom) {
|
|
2256
|
+
var indexOfPhoneContext = numberToExtractFrom.indexOf(RFC3966_PHONE_CONTEXT_);
|
|
2257
|
+
if (indexOfPhoneContext < 0) {
|
|
2258
|
+
return null;
|
|
2259
|
+
}
|
|
2260
|
+
var phoneContextStart = indexOfPhoneContext + RFC3966_PHONE_CONTEXT_.length;
|
|
2261
|
+
if (phoneContextStart >= numberToExtractFrom.length) {
|
|
2262
|
+
return "";
|
|
2263
|
+
}
|
|
2264
|
+
var phoneContextEnd = numberToExtractFrom.indexOf(";", phoneContextStart);
|
|
2265
|
+
if (phoneContextEnd >= 0) {
|
|
2266
|
+
return numberToExtractFrom.substring(phoneContextStart, phoneContextEnd);
|
|
2267
|
+
} else {
|
|
2268
|
+
return numberToExtractFrom.substring(phoneContextStart);
|
|
2269
|
+
}
|
|
2270
|
+
}
|
|
2271
|
+
function isPhoneContextValid(phoneContext) {
|
|
2272
|
+
if (phoneContext === null) {
|
|
2273
|
+
return true;
|
|
2274
|
+
}
|
|
2275
|
+
if (phoneContext.length === 0) {
|
|
2276
|
+
return false;
|
|
2277
|
+
}
|
|
2278
|
+
return RFC3966_GLOBAL_NUMBER_DIGITS_PATTERN_.test(phoneContext) || RFC3966_DOMAINNAME_PATTERN_.test(phoneContext);
|
|
2279
|
+
}
|
|
2280
|
+
|
|
2281
|
+
// node_modules/libphonenumber-js/es6/helpers/extractFormattedPhoneNumberFromPossibleRfc3966NumberUri.js
|
|
2282
|
+
function extractFormattedPhoneNumberFromPossibleRfc3966NumberUri(numberToParse, _ref) {
|
|
2283
|
+
var extractFormattedPhoneNumber = _ref.extractFormattedPhoneNumber;
|
|
2284
|
+
var phoneContext = extractPhoneContext(numberToParse);
|
|
2285
|
+
if (!isPhoneContextValid(phoneContext)) {
|
|
2286
|
+
throw new ParseError("NOT_A_NUMBER");
|
|
2287
|
+
}
|
|
2288
|
+
var phoneNumberString;
|
|
2289
|
+
if (phoneContext === null) {
|
|
2290
|
+
phoneNumberString = extractFormattedPhoneNumber(numberToParse) || "";
|
|
2291
|
+
} else {
|
|
2292
|
+
phoneNumberString = "";
|
|
2293
|
+
if (phoneContext.charAt(0) === PLUS_SIGN) {
|
|
2294
|
+
phoneNumberString += phoneContext;
|
|
2295
|
+
}
|
|
2296
|
+
var indexOfRfc3966Prefix = numberToParse.indexOf(RFC3966_PREFIX_);
|
|
2297
|
+
var indexOfNationalNumber;
|
|
2298
|
+
if (indexOfRfc3966Prefix >= 0) {
|
|
2299
|
+
indexOfNationalNumber = indexOfRfc3966Prefix + RFC3966_PREFIX_.length;
|
|
2300
|
+
} else {
|
|
2301
|
+
indexOfNationalNumber = 0;
|
|
2302
|
+
}
|
|
2303
|
+
var indexOfPhoneContext = numberToParse.indexOf(RFC3966_PHONE_CONTEXT_);
|
|
2304
|
+
phoneNumberString += numberToParse.substring(indexOfNationalNumber, indexOfPhoneContext);
|
|
2305
|
+
}
|
|
2306
|
+
var indexOfIsdn = phoneNumberString.indexOf(RFC3966_ISDN_SUBADDRESS_);
|
|
2307
|
+
if (indexOfIsdn > 0) {
|
|
2308
|
+
phoneNumberString = phoneNumberString.substring(0, indexOfIsdn);
|
|
2309
|
+
}
|
|
2310
|
+
if (phoneNumberString !== "") {
|
|
2311
|
+
return phoneNumberString;
|
|
2312
|
+
}
|
|
2313
|
+
}
|
|
2314
|
+
|
|
2315
|
+
// node_modules/libphonenumber-js/es6/parse.js
|
|
2316
|
+
var MAX_INPUT_STRING_LENGTH = 250;
|
|
2317
|
+
var PHONE_NUMBER_START_PATTERN = new RegExp("[" + PLUS_CHARS + VALID_DIGITS + "]");
|
|
2318
|
+
var AFTER_PHONE_NUMBER_END_PATTERN = new RegExp("[^" + VALID_DIGITS + "#]+$");
|
|
2319
|
+
var USE_NON_GEOGRAPHIC_COUNTRY_CODE3 = false;
|
|
2320
|
+
function parse(text, options, metadataJson) {
|
|
2321
|
+
options = options || {};
|
|
2322
|
+
var metadata = new Metadata(metadataJson);
|
|
2323
|
+
if (options.defaultCountry && !metadata.hasCountry(options.defaultCountry)) {
|
|
2324
|
+
if (options.v2) {
|
|
2325
|
+
throw new ParseError("INVALID_COUNTRY");
|
|
2326
|
+
}
|
|
2327
|
+
throw new Error("Unknown country: ".concat(options.defaultCountry));
|
|
2328
|
+
}
|
|
2329
|
+
var _parseInput = parseInput(text, options.v2, options.extract), formattedPhoneNumber = _parseInput.number, ext = _parseInput.ext, error = _parseInput.error;
|
|
2330
|
+
if (!formattedPhoneNumber) {
|
|
2331
|
+
if (options.v2) {
|
|
2332
|
+
if (error === "TOO_SHORT") {
|
|
2333
|
+
throw new ParseError("TOO_SHORT");
|
|
2334
|
+
}
|
|
2335
|
+
throw new ParseError("NOT_A_NUMBER");
|
|
2336
|
+
}
|
|
2337
|
+
return {};
|
|
2338
|
+
}
|
|
2339
|
+
var _parsePhoneNumber = parsePhoneNumber(
|
|
2340
|
+
formattedPhoneNumber,
|
|
2341
|
+
options.defaultCountry,
|
|
2342
|
+
options.defaultCallingCode,
|
|
2343
|
+
// If `country` is returned, its numbering plan will also be selected in `metadata`.
|
|
2344
|
+
// Otherwise, if `countryCallingCode` is returned, its numbering plan will also be selected in `metadata`.
|
|
2345
|
+
// Otherwise, if neither `country` nor `countryCallingCode` are returned, no numbering plan will be selected in `metadata`.
|
|
2346
|
+
metadata
|
|
2347
|
+
), country = _parsePhoneNumber.country, nationalNumber = _parsePhoneNumber.nationalNumber, countryCallingCode = _parsePhoneNumber.countryCallingCode, countryCallingCodeSource = _parsePhoneNumber.countryCallingCodeSource, carrierCode = _parsePhoneNumber.carrierCode;
|
|
2348
|
+
if (!metadata.hasSelectedNumberingPlan()) {
|
|
2349
|
+
if (options.v2) {
|
|
2350
|
+
throw new ParseError("INVALID_COUNTRY");
|
|
2351
|
+
}
|
|
2352
|
+
return {};
|
|
2353
|
+
}
|
|
2354
|
+
if (!nationalNumber || nationalNumber.length < MIN_LENGTH_FOR_NSN) {
|
|
2355
|
+
if (options.v2) {
|
|
2356
|
+
throw new ParseError("TOO_SHORT");
|
|
2357
|
+
}
|
|
2358
|
+
return {};
|
|
2359
|
+
}
|
|
2360
|
+
if (nationalNumber.length > MAX_LENGTH_FOR_NSN) {
|
|
2361
|
+
if (options.v2) {
|
|
2362
|
+
throw new ParseError("TOO_LONG");
|
|
2363
|
+
}
|
|
2364
|
+
return {};
|
|
2365
|
+
}
|
|
2366
|
+
if (options.v2) {
|
|
2367
|
+
var phoneNumber = new PhoneNumber(countryCallingCode, nationalNumber, metadata.metadata);
|
|
2368
|
+
if (country) {
|
|
2369
|
+
phoneNumber.country = country;
|
|
2370
|
+
}
|
|
2371
|
+
if (carrierCode) {
|
|
2372
|
+
phoneNumber.carrierCode = carrierCode;
|
|
2373
|
+
}
|
|
2374
|
+
if (ext) {
|
|
2375
|
+
phoneNumber.ext = ext;
|
|
2376
|
+
}
|
|
2377
|
+
phoneNumber.__countryCallingCodeSource = countryCallingCodeSource;
|
|
2378
|
+
return phoneNumber;
|
|
2379
|
+
}
|
|
2380
|
+
var valid = (options.extended ? metadata.hasSelectedNumberingPlan() : country) ? matchesEntirely(nationalNumber, metadata.nationalNumberPattern()) : false;
|
|
2381
|
+
if (!options.extended) {
|
|
2382
|
+
return valid ? result(country, nationalNumber, ext) : {};
|
|
2383
|
+
}
|
|
2384
|
+
return {
|
|
2385
|
+
country,
|
|
2386
|
+
countryCallingCode,
|
|
2387
|
+
carrierCode,
|
|
2388
|
+
valid,
|
|
2389
|
+
possible: valid ? true : options.extended === true && metadata.possibleLengths() && isPossibleNumber(nationalNumber, metadata) ? true : false,
|
|
2390
|
+
phone: nationalNumber,
|
|
2391
|
+
ext
|
|
2392
|
+
};
|
|
2393
|
+
}
|
|
2394
|
+
function _extractFormattedPhoneNumber(text, extract, throwOnError) {
|
|
2395
|
+
if (!text) {
|
|
2396
|
+
return;
|
|
2397
|
+
}
|
|
2398
|
+
if (text.length > MAX_INPUT_STRING_LENGTH) {
|
|
2399
|
+
if (throwOnError) {
|
|
2400
|
+
throw new ParseError("TOO_LONG");
|
|
2401
|
+
}
|
|
2402
|
+
return;
|
|
2403
|
+
}
|
|
2404
|
+
if (extract === false) {
|
|
2405
|
+
return text;
|
|
2406
|
+
}
|
|
2407
|
+
var startsAt = text.search(PHONE_NUMBER_START_PATTERN);
|
|
2408
|
+
if (startsAt < 0) {
|
|
2409
|
+
return;
|
|
2410
|
+
}
|
|
2411
|
+
return text.slice(startsAt).replace(AFTER_PHONE_NUMBER_END_PATTERN, "");
|
|
2412
|
+
}
|
|
2413
|
+
function parseInput(text, v2, extract) {
|
|
2414
|
+
var number = extractFormattedPhoneNumberFromPossibleRfc3966NumberUri(text, {
|
|
2415
|
+
extractFormattedPhoneNumber: function extractFormattedPhoneNumber(text2) {
|
|
2416
|
+
return _extractFormattedPhoneNumber(text2, extract, v2);
|
|
2417
|
+
}
|
|
2418
|
+
});
|
|
2419
|
+
if (!number) {
|
|
2420
|
+
return {};
|
|
2421
|
+
}
|
|
2422
|
+
if (!isViablePhoneNumber(number)) {
|
|
2423
|
+
if (isViablePhoneNumberStart(number)) {
|
|
2424
|
+
return {
|
|
2425
|
+
error: "TOO_SHORT"
|
|
2426
|
+
};
|
|
2427
|
+
}
|
|
2428
|
+
return {};
|
|
2429
|
+
}
|
|
2430
|
+
var withExtensionStripped = extractExtension(number);
|
|
2431
|
+
if (withExtensionStripped.ext) {
|
|
2432
|
+
return withExtensionStripped;
|
|
2433
|
+
}
|
|
2434
|
+
return {
|
|
2435
|
+
number
|
|
2436
|
+
};
|
|
2437
|
+
}
|
|
2438
|
+
function result(country, nationalNumber, ext) {
|
|
2439
|
+
var result2 = {
|
|
2440
|
+
country,
|
|
2441
|
+
phone: nationalNumber
|
|
2442
|
+
};
|
|
2443
|
+
if (ext) {
|
|
2444
|
+
result2.ext = ext;
|
|
2445
|
+
}
|
|
2446
|
+
return result2;
|
|
2447
|
+
}
|
|
2448
|
+
function parsePhoneNumber(formattedPhoneNumber, defaultCountry, defaultCallingCode, metadata) {
|
|
2449
|
+
var _extractCountryCallin = extractCountryCallingCode(
|
|
2450
|
+
parseIncompletePhoneNumber(formattedPhoneNumber),
|
|
2451
|
+
void 0,
|
|
2452
|
+
// `defaultCountry` and `defaultCallingCode` are only used to detect
|
|
2453
|
+
// if it's an "international" phone number or not. They won't be used
|
|
2454
|
+
// to derive the resulting `countryCallingCode` from them, or anything like that.
|
|
2455
|
+
defaultCountry,
|
|
2456
|
+
defaultCallingCode,
|
|
2457
|
+
metadata.metadata
|
|
2458
|
+
), countryCallingCodeSource = _extractCountryCallin.countryCallingCodeSource, countryCallingCode = _extractCountryCallin.countryCallingCode, number = _extractCountryCallin.number;
|
|
2459
|
+
var country;
|
|
2460
|
+
if (countryCallingCode) {
|
|
2461
|
+
metadata.selectNumberingPlan(countryCallingCode);
|
|
2462
|
+
} else if (number && (defaultCountry || defaultCallingCode)) {
|
|
2463
|
+
if (defaultCountry) {
|
|
2464
|
+
country = defaultCountry;
|
|
2465
|
+
metadata.selectNumberingPlan(defaultCountry);
|
|
2466
|
+
countryCallingCode = metadata.numberingPlan.callingCode();
|
|
2467
|
+
} else {
|
|
2468
|
+
metadata.selectNumberingPlan(defaultCallingCode);
|
|
2469
|
+
countryCallingCode = defaultCallingCode;
|
|
2470
|
+
if (USE_NON_GEOGRAPHIC_COUNTRY_CODE3) {
|
|
2471
|
+
if (metadata.isNonGeographicCallingCode(countryCallingCode)) {
|
|
2472
|
+
country = "001";
|
|
2473
|
+
}
|
|
2474
|
+
}
|
|
2475
|
+
}
|
|
2476
|
+
} else return {};
|
|
2477
|
+
if (!number) {
|
|
2478
|
+
return {
|
|
2479
|
+
countryCallingCodeSource,
|
|
2480
|
+
countryCallingCode
|
|
2481
|
+
};
|
|
2482
|
+
}
|
|
2483
|
+
var _extractNationalNumbe = extractNationalNumber(parseIncompletePhoneNumber(number), void 0, metadata), nationalNumber = _extractNationalNumbe.nationalNumber, carrierCode = _extractNationalNumbe.carrierCode;
|
|
2484
|
+
var exactCountry = getCountryByCallingCode(countryCallingCode, {
|
|
2485
|
+
nationalNumber,
|
|
2486
|
+
metadata
|
|
2487
|
+
});
|
|
2488
|
+
if (exactCountry) {
|
|
2489
|
+
country = exactCountry;
|
|
2490
|
+
if (exactCountry === "001") {
|
|
2491
|
+
} else {
|
|
2492
|
+
metadata.selectNumberingPlan(country);
|
|
2493
|
+
}
|
|
2494
|
+
}
|
|
2495
|
+
return {
|
|
2496
|
+
country,
|
|
2497
|
+
countryCallingCode,
|
|
2498
|
+
countryCallingCodeSource,
|
|
2499
|
+
nationalNumber,
|
|
2500
|
+
carrierCode
|
|
2501
|
+
};
|
|
2502
|
+
}
|
|
2503
|
+
|
|
2504
|
+
// node_modules/libphonenumber-js/es6/parsePhoneNumberWithError_.js
|
|
2505
|
+
function _typeof4(o2) {
|
|
2506
|
+
"@babel/helpers - typeof";
|
|
2507
|
+
return _typeof4 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o3) {
|
|
2508
|
+
return typeof o3;
|
|
2509
|
+
} : function(o3) {
|
|
2510
|
+
return o3 && "function" == typeof Symbol && o3.constructor === Symbol && o3 !== Symbol.prototype ? "symbol" : typeof o3;
|
|
2511
|
+
}, _typeof4(o2);
|
|
2512
|
+
}
|
|
2513
|
+
function ownKeys2(e2, r2) {
|
|
2514
|
+
var t2 = Object.keys(e2);
|
|
2515
|
+
if (Object.getOwnPropertySymbols) {
|
|
2516
|
+
var o2 = Object.getOwnPropertySymbols(e2);
|
|
2517
|
+
r2 && (o2 = o2.filter(function(r3) {
|
|
2518
|
+
return Object.getOwnPropertyDescriptor(e2, r3).enumerable;
|
|
2519
|
+
})), t2.push.apply(t2, o2);
|
|
2520
|
+
}
|
|
2521
|
+
return t2;
|
|
2522
|
+
}
|
|
2523
|
+
function _objectSpread2(e2) {
|
|
2524
|
+
for (var r2 = 1; r2 < arguments.length; r2++) {
|
|
2525
|
+
var t2 = null != arguments[r2] ? arguments[r2] : {};
|
|
2526
|
+
r2 % 2 ? ownKeys2(Object(t2), true).forEach(function(r3) {
|
|
2527
|
+
_defineProperty2(e2, r3, t2[r3]);
|
|
2528
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e2, Object.getOwnPropertyDescriptors(t2)) : ownKeys2(Object(t2)).forEach(function(r3) {
|
|
2529
|
+
Object.defineProperty(e2, r3, Object.getOwnPropertyDescriptor(t2, r3));
|
|
2530
|
+
});
|
|
2531
|
+
}
|
|
2532
|
+
return e2;
|
|
2533
|
+
}
|
|
2534
|
+
function _defineProperty2(e2, r2, t2) {
|
|
2535
|
+
return (r2 = _toPropertyKey4(r2)) in e2 ? Object.defineProperty(e2, r2, { value: t2, enumerable: true, configurable: true, writable: true }) : e2[r2] = t2, e2;
|
|
2536
|
+
}
|
|
2537
|
+
function _toPropertyKey4(t2) {
|
|
2538
|
+
var i2 = _toPrimitive4(t2, "string");
|
|
2539
|
+
return "symbol" == _typeof4(i2) ? i2 : i2 + "";
|
|
2540
|
+
}
|
|
2541
|
+
function _toPrimitive4(t2, r2) {
|
|
2542
|
+
if ("object" != _typeof4(t2) || !t2) return t2;
|
|
2543
|
+
var e2 = t2[Symbol.toPrimitive];
|
|
2544
|
+
if (void 0 !== e2) {
|
|
2545
|
+
var i2 = e2.call(t2, r2 || "default");
|
|
2546
|
+
if ("object" != _typeof4(i2)) return i2;
|
|
2547
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
2548
|
+
}
|
|
2549
|
+
return ("string" === r2 ? String : Number)(t2);
|
|
2550
|
+
}
|
|
2551
|
+
function parsePhoneNumberWithError(text, options, metadata) {
|
|
2552
|
+
return parse(text, _objectSpread2(_objectSpread2({}, options), {}, {
|
|
2553
|
+
v2: true
|
|
2554
|
+
}), metadata);
|
|
2555
|
+
}
|
|
2556
|
+
|
|
2557
|
+
// node_modules/libphonenumber-js/es6/normalizeArguments.js
|
|
2558
|
+
function _typeof5(o2) {
|
|
2559
|
+
"@babel/helpers - typeof";
|
|
2560
|
+
return _typeof5 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o3) {
|
|
2561
|
+
return typeof o3;
|
|
2562
|
+
} : function(o3) {
|
|
2563
|
+
return o3 && "function" == typeof Symbol && o3.constructor === Symbol && o3 !== Symbol.prototype ? "symbol" : typeof o3;
|
|
2564
|
+
}, _typeof5(o2);
|
|
2565
|
+
}
|
|
2566
|
+
function ownKeys3(e2, r2) {
|
|
2567
|
+
var t2 = Object.keys(e2);
|
|
2568
|
+
if (Object.getOwnPropertySymbols) {
|
|
2569
|
+
var o2 = Object.getOwnPropertySymbols(e2);
|
|
2570
|
+
r2 && (o2 = o2.filter(function(r3) {
|
|
2571
|
+
return Object.getOwnPropertyDescriptor(e2, r3).enumerable;
|
|
2572
|
+
})), t2.push.apply(t2, o2);
|
|
2573
|
+
}
|
|
2574
|
+
return t2;
|
|
2575
|
+
}
|
|
2576
|
+
function _objectSpread3(e2) {
|
|
2577
|
+
for (var r2 = 1; r2 < arguments.length; r2++) {
|
|
2578
|
+
var t2 = null != arguments[r2] ? arguments[r2] : {};
|
|
2579
|
+
r2 % 2 ? ownKeys3(Object(t2), true).forEach(function(r3) {
|
|
2580
|
+
_defineProperty3(e2, r3, t2[r3]);
|
|
2581
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e2, Object.getOwnPropertyDescriptors(t2)) : ownKeys3(Object(t2)).forEach(function(r3) {
|
|
2582
|
+
Object.defineProperty(e2, r3, Object.getOwnPropertyDescriptor(t2, r3));
|
|
2583
|
+
});
|
|
2584
|
+
}
|
|
2585
|
+
return e2;
|
|
2586
|
+
}
|
|
2587
|
+
function _defineProperty3(e2, r2, t2) {
|
|
2588
|
+
return (r2 = _toPropertyKey5(r2)) in e2 ? Object.defineProperty(e2, r2, { value: t2, enumerable: true, configurable: true, writable: true }) : e2[r2] = t2, e2;
|
|
2589
|
+
}
|
|
2590
|
+
function _toPropertyKey5(t2) {
|
|
2591
|
+
var i2 = _toPrimitive5(t2, "string");
|
|
2592
|
+
return "symbol" == _typeof5(i2) ? i2 : i2 + "";
|
|
2593
|
+
}
|
|
2594
|
+
function _toPrimitive5(t2, r2) {
|
|
2595
|
+
if ("object" != _typeof5(t2) || !t2) return t2;
|
|
2596
|
+
var e2 = t2[Symbol.toPrimitive];
|
|
2597
|
+
if (void 0 !== e2) {
|
|
2598
|
+
var i2 = e2.call(t2, r2 || "default");
|
|
2599
|
+
if ("object" != _typeof5(i2)) return i2;
|
|
2600
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
2601
|
+
}
|
|
2602
|
+
return ("string" === r2 ? String : Number)(t2);
|
|
2603
|
+
}
|
|
2604
|
+
function _slicedToArray(r2, e2) {
|
|
2605
|
+
return _arrayWithHoles(r2) || _iterableToArrayLimit(r2, e2) || _unsupportedIterableToArray5(r2, e2) || _nonIterableRest();
|
|
2606
|
+
}
|
|
2607
|
+
function _nonIterableRest() {
|
|
2608
|
+
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
2609
|
+
}
|
|
2610
|
+
function _unsupportedIterableToArray5(r2, a2) {
|
|
2611
|
+
if (r2) {
|
|
2612
|
+
if ("string" == typeof r2) return _arrayLikeToArray5(r2, a2);
|
|
2613
|
+
var t2 = {}.toString.call(r2).slice(8, -1);
|
|
2614
|
+
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;
|
|
2615
|
+
}
|
|
2616
|
+
}
|
|
2617
|
+
function _arrayLikeToArray5(r2, a2) {
|
|
2618
|
+
(null == a2 || a2 > r2.length) && (a2 = r2.length);
|
|
2619
|
+
for (var e2 = 0, n2 = Array(a2); e2 < a2; e2++) n2[e2] = r2[e2];
|
|
2620
|
+
return n2;
|
|
2621
|
+
}
|
|
2622
|
+
function _iterableToArrayLimit(r2, l) {
|
|
2623
|
+
var t2 = null == r2 ? null : "undefined" != typeof Symbol && r2[Symbol.iterator] || r2["@@iterator"];
|
|
2624
|
+
if (null != t2) {
|
|
2625
|
+
var e2, n2, i2, u, a2 = [], f = true, o2 = false;
|
|
2626
|
+
try {
|
|
2627
|
+
if (i2 = (t2 = t2.call(r2)).next, 0 === l) {
|
|
2628
|
+
if (Object(t2) !== t2) return;
|
|
2629
|
+
f = false;
|
|
2630
|
+
} else for (; !(f = (e2 = i2.call(t2)).done) && (a2.push(e2.value), a2.length !== l); f = true) ;
|
|
2631
|
+
} catch (r3) {
|
|
2632
|
+
o2 = true, n2 = r3;
|
|
2633
|
+
} finally {
|
|
2634
|
+
try {
|
|
2635
|
+
if (!f && null != t2["return"] && (u = t2["return"](), Object(u) !== u)) return;
|
|
2636
|
+
} finally {
|
|
2637
|
+
if (o2) throw n2;
|
|
2638
|
+
}
|
|
2639
|
+
}
|
|
2640
|
+
return a2;
|
|
2641
|
+
}
|
|
2642
|
+
}
|
|
2643
|
+
function _arrayWithHoles(r2) {
|
|
2644
|
+
if (Array.isArray(r2)) return r2;
|
|
2645
|
+
}
|
|
2646
|
+
function normalizeArguments(args) {
|
|
2647
|
+
var _Array$prototype$slic = Array.prototype.slice.call(args), _Array$prototype$slic2 = _slicedToArray(_Array$prototype$slic, 4), arg_1 = _Array$prototype$slic2[0], arg_2 = _Array$prototype$slic2[1], arg_3 = _Array$prototype$slic2[2], arg_4 = _Array$prototype$slic2[3];
|
|
2648
|
+
var text;
|
|
2649
|
+
var options;
|
|
2650
|
+
var metadata;
|
|
2651
|
+
if (typeof arg_1 === "string") {
|
|
2652
|
+
text = arg_1;
|
|
2653
|
+
} else throw new TypeError("A text for parsing must be a string.");
|
|
2654
|
+
if (!arg_2 || typeof arg_2 === "string") {
|
|
2655
|
+
if (arg_4) {
|
|
2656
|
+
options = arg_3;
|
|
2657
|
+
metadata = arg_4;
|
|
2658
|
+
} else {
|
|
2659
|
+
options = void 0;
|
|
2660
|
+
metadata = arg_3;
|
|
2661
|
+
}
|
|
2662
|
+
if (arg_2) {
|
|
2663
|
+
options = _objectSpread3({
|
|
2664
|
+
defaultCountry: arg_2
|
|
2665
|
+
}, options);
|
|
2666
|
+
}
|
|
2667
|
+
} else if (isObject(arg_2)) {
|
|
2668
|
+
if (arg_3) {
|
|
2669
|
+
options = arg_2;
|
|
2670
|
+
metadata = arg_3;
|
|
2671
|
+
} else {
|
|
2672
|
+
metadata = arg_2;
|
|
2673
|
+
}
|
|
2674
|
+
} else throw new Error("Invalid second argument: ".concat(arg_2));
|
|
2675
|
+
return {
|
|
2676
|
+
text,
|
|
2677
|
+
options,
|
|
2678
|
+
metadata
|
|
2679
|
+
};
|
|
2680
|
+
}
|
|
2681
|
+
|
|
2682
|
+
// node_modules/libphonenumber-js/es6/parsePhoneNumber_.js
|
|
2683
|
+
function _typeof6(o2) {
|
|
2684
|
+
"@babel/helpers - typeof";
|
|
2685
|
+
return _typeof6 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o3) {
|
|
2686
|
+
return typeof o3;
|
|
2687
|
+
} : function(o3) {
|
|
2688
|
+
return o3 && "function" == typeof Symbol && o3.constructor === Symbol && o3 !== Symbol.prototype ? "symbol" : typeof o3;
|
|
2689
|
+
}, _typeof6(o2);
|
|
2690
|
+
}
|
|
2691
|
+
function ownKeys4(e2, r2) {
|
|
2692
|
+
var t2 = Object.keys(e2);
|
|
2693
|
+
if (Object.getOwnPropertySymbols) {
|
|
2694
|
+
var o2 = Object.getOwnPropertySymbols(e2);
|
|
2695
|
+
r2 && (o2 = o2.filter(function(r3) {
|
|
2696
|
+
return Object.getOwnPropertyDescriptor(e2, r3).enumerable;
|
|
2697
|
+
})), t2.push.apply(t2, o2);
|
|
2698
|
+
}
|
|
2699
|
+
return t2;
|
|
2700
|
+
}
|
|
2701
|
+
function _objectSpread4(e2) {
|
|
2702
|
+
for (var r2 = 1; r2 < arguments.length; r2++) {
|
|
2703
|
+
var t2 = null != arguments[r2] ? arguments[r2] : {};
|
|
2704
|
+
r2 % 2 ? ownKeys4(Object(t2), true).forEach(function(r3) {
|
|
2705
|
+
_defineProperty4(e2, r3, t2[r3]);
|
|
2706
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e2, Object.getOwnPropertyDescriptors(t2)) : ownKeys4(Object(t2)).forEach(function(r3) {
|
|
2707
|
+
Object.defineProperty(e2, r3, Object.getOwnPropertyDescriptor(t2, r3));
|
|
2708
|
+
});
|
|
2709
|
+
}
|
|
2710
|
+
return e2;
|
|
2711
|
+
}
|
|
2712
|
+
function _defineProperty4(e2, r2, t2) {
|
|
2713
|
+
return (r2 = _toPropertyKey6(r2)) in e2 ? Object.defineProperty(e2, r2, { value: t2, enumerable: true, configurable: true, writable: true }) : e2[r2] = t2, e2;
|
|
2714
|
+
}
|
|
2715
|
+
function _toPropertyKey6(t2) {
|
|
2716
|
+
var i2 = _toPrimitive6(t2, "string");
|
|
2717
|
+
return "symbol" == _typeof6(i2) ? i2 : i2 + "";
|
|
2718
|
+
}
|
|
2719
|
+
function _toPrimitive6(t2, r2) {
|
|
2720
|
+
if ("object" != _typeof6(t2) || !t2) return t2;
|
|
2721
|
+
var e2 = t2[Symbol.toPrimitive];
|
|
2722
|
+
if (void 0 !== e2) {
|
|
2723
|
+
var i2 = e2.call(t2, r2 || "default");
|
|
2724
|
+
if ("object" != _typeof6(i2)) return i2;
|
|
2725
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
2726
|
+
}
|
|
2727
|
+
return ("string" === r2 ? String : Number)(t2);
|
|
2728
|
+
}
|
|
2729
|
+
function parsePhoneNumber2(text, options, metadata) {
|
|
2730
|
+
if (options && options.defaultCountry && !isSupportedCountry(options.defaultCountry, metadata)) {
|
|
2731
|
+
options = _objectSpread4(_objectSpread4({}, options), {}, {
|
|
2732
|
+
defaultCountry: void 0
|
|
2733
|
+
});
|
|
2734
|
+
}
|
|
2735
|
+
try {
|
|
2736
|
+
return parsePhoneNumberWithError(text, options, metadata);
|
|
2737
|
+
} catch (error) {
|
|
2738
|
+
if (error instanceof ParseError) {
|
|
2739
|
+
} else {
|
|
2740
|
+
throw error;
|
|
2741
|
+
}
|
|
2742
|
+
}
|
|
2743
|
+
}
|
|
2744
|
+
|
|
2745
|
+
// node_modules/libphonenumber-js/es6/parsePhoneNumber.js
|
|
2746
|
+
function parsePhoneNumber3() {
|
|
2747
|
+
var _normalizeArguments = normalizeArguments(arguments), text = _normalizeArguments.text, options = _normalizeArguments.options, metadata = _normalizeArguments.metadata;
|
|
2748
|
+
return parsePhoneNumber2(text, options, metadata);
|
|
2749
|
+
}
|
|
2750
|
+
|
|
2751
|
+
// node_modules/libphonenumber-js/min/exports/parsePhoneNumber.js
|
|
2752
|
+
function parsePhoneNumber4() {
|
|
2753
|
+
return withMetadataArgument(parsePhoneNumber3, arguments);
|
|
2754
|
+
}
|
|
2755
|
+
|
|
2756
|
+
// src/scavio/clean-contacts.ts
|
|
2757
|
+
var EMAIL_REGEX = /^[a-z0-9._%+-]+@([a-z0-9-]+\.)+[a-z]{2,24}$/;
|
|
2758
|
+
var FREE_MAIL_DOMAINS = /* @__PURE__ */ new Set([
|
|
2759
|
+
"gmail.com",
|
|
2760
|
+
"googlemail.com",
|
|
2761
|
+
"yahoo.com",
|
|
2762
|
+
"ymail.com",
|
|
2763
|
+
"outlook.com",
|
|
2764
|
+
"hotmail.com",
|
|
2765
|
+
"live.com",
|
|
2766
|
+
"msn.com",
|
|
2767
|
+
"icloud.com",
|
|
2768
|
+
"me.com",
|
|
2769
|
+
"mac.com",
|
|
2770
|
+
"aol.com",
|
|
2771
|
+
"protonmail.com",
|
|
2772
|
+
"proton.me",
|
|
2773
|
+
"zoho.com",
|
|
2774
|
+
"gmx.com",
|
|
2775
|
+
"gmx.de",
|
|
2776
|
+
"gmx.net",
|
|
2777
|
+
"web.de",
|
|
2778
|
+
"mail.com",
|
|
2779
|
+
"yandex.com",
|
|
2780
|
+
"comcast.net",
|
|
2781
|
+
"att.net",
|
|
2782
|
+
"sbcglobal.net",
|
|
2783
|
+
"bellsouth.net",
|
|
2784
|
+
"verizon.net",
|
|
2785
|
+
"cox.net",
|
|
2786
|
+
"charter.net",
|
|
2787
|
+
"yahoo.co.uk",
|
|
2788
|
+
"hotmail.co.uk",
|
|
2789
|
+
"btinternet.com",
|
|
2790
|
+
"orange.fr",
|
|
2791
|
+
"free.fr",
|
|
2792
|
+
"laposte.net",
|
|
2793
|
+
"libero.it",
|
|
2794
|
+
"hotmail.fr",
|
|
2795
|
+
"yahoo.fr",
|
|
2796
|
+
"outlook.fr"
|
|
2797
|
+
]);
|
|
2798
|
+
var isSameSite = (emailDomain, companyDomain) => emailDomain === companyDomain || emailDomain.endsWith(`.${companyDomain}`) || companyDomain.endsWith(`.${emailDomain}`);
|
|
2799
|
+
var cleanEmails = (emails, companyDomain) => {
|
|
2800
|
+
const kept = [];
|
|
2801
|
+
const seen = /* @__PURE__ */ new Set();
|
|
2802
|
+
for (const raw of emails ?? []) {
|
|
2803
|
+
if (typeof raw !== "string") {
|
|
2804
|
+
continue;
|
|
2805
|
+
}
|
|
2806
|
+
const email = raw.trim().toLowerCase();
|
|
2807
|
+
if (!EMAIL_REGEX.test(email) || seen.has(email)) {
|
|
2808
|
+
continue;
|
|
2809
|
+
}
|
|
2810
|
+
const emailDomain = email.split("@")[1];
|
|
2811
|
+
if (!isSameSite(emailDomain, companyDomain) && !FREE_MAIL_DOMAINS.has(emailDomain)) {
|
|
2812
|
+
continue;
|
|
2813
|
+
}
|
|
2814
|
+
seen.add(email);
|
|
2815
|
+
kept.push(email);
|
|
2816
|
+
}
|
|
2817
|
+
return kept.slice(0, MAX_EMAILS);
|
|
2818
|
+
};
|
|
2819
|
+
var TLD_COUNTRY_OVERRIDES = {
|
|
2820
|
+
uk: "GB",
|
|
2821
|
+
io: null,
|
|
2822
|
+
co: null,
|
|
2823
|
+
ai: null,
|
|
2824
|
+
me: null,
|
|
2825
|
+
tv: null,
|
|
2826
|
+
fm: null,
|
|
2827
|
+
ly: null,
|
|
2828
|
+
so: null,
|
|
2829
|
+
sh: null,
|
|
2830
|
+
gg: null,
|
|
2831
|
+
to: null,
|
|
2832
|
+
cc: null,
|
|
2833
|
+
ws: null
|
|
2834
|
+
};
|
|
2835
|
+
var guessCountryFromDomain = (domain) => {
|
|
2836
|
+
const tld = domain.split(".").pop() ?? "";
|
|
2837
|
+
if (tld in TLD_COUNTRY_OVERRIDES) {
|
|
2838
|
+
return TLD_COUNTRY_OVERRIDES[tld] ?? "US";
|
|
2839
|
+
}
|
|
2840
|
+
if (tld.length === 2) {
|
|
2841
|
+
return tld.toUpperCase();
|
|
2842
|
+
}
|
|
2843
|
+
return "US";
|
|
2844
|
+
};
|
|
2845
|
+
var lastTenDigits = (value) => value.replace(/\D/g, "").slice(-10);
|
|
2846
|
+
var cleanPhones = (phones, companyDomain) => {
|
|
2847
|
+
const defaultCountry = guessCountryFromDomain(companyDomain);
|
|
2848
|
+
const parsed = (phones ?? []).filter((raw) => typeof raw === "string").map((raw) => ({ raw, phone: parsePhoneNumber4(raw, defaultCountry) })).filter(({ phone }) => phone !== void 0 && phone.isValid());
|
|
2849
|
+
const sameCountryFirst = [
|
|
2850
|
+
...parsed.filter(({ phone }) => phone?.country === defaultCountry),
|
|
2851
|
+
...parsed.filter(({ phone }) => phone?.country !== defaultCountry)
|
|
2852
|
+
];
|
|
2853
|
+
const kept = [];
|
|
2854
|
+
const seen = /* @__PURE__ */ new Set();
|
|
2855
|
+
for (const { raw, phone } of sameCountryFirst) {
|
|
2856
|
+
if (phone === void 0) {
|
|
2857
|
+
continue;
|
|
2858
|
+
}
|
|
2859
|
+
const keys = [phone.number, lastTenDigits(raw), lastTenDigits(phone.number)];
|
|
2860
|
+
if (keys.some((key) => seen.has(key))) {
|
|
2861
|
+
continue;
|
|
2862
|
+
}
|
|
2863
|
+
keys.forEach((key) => seen.add(key));
|
|
2864
|
+
kept.push({
|
|
2865
|
+
number: phone.nationalNumber,
|
|
2866
|
+
countryCode: phone.country ?? "",
|
|
2867
|
+
callingCode: `+${phone.countryCallingCode}`
|
|
2868
|
+
});
|
|
2869
|
+
}
|
|
2870
|
+
return kept.slice(0, MAX_PHONES);
|
|
2871
|
+
};
|
|
2872
|
+
|
|
2873
|
+
// src/scavio/build-company-update.ts
|
|
2874
|
+
var SOCIAL_ORDER = [
|
|
2875
|
+
{ network: "linkedin", label: "LinkedIn" },
|
|
2876
|
+
{ network: "facebook", label: "Facebook" },
|
|
2877
|
+
{ network: "instagram", label: "Instagram" },
|
|
2878
|
+
{ network: "x", label: "X" },
|
|
2879
|
+
{ network: "youtube", label: "YouTube" },
|
|
2880
|
+
{ network: "tiktok", label: "TikTok" },
|
|
2881
|
+
{ network: "pinterest", label: "Pinterest" }
|
|
2882
|
+
];
|
|
2883
|
+
var isHttpUrl = (value) => typeof value === "string" && /^https?:\/\/\S+$/i.test(value.trim());
|
|
2884
|
+
var link = (url, label = "") => ({
|
|
2885
|
+
primaryLinkUrl: url,
|
|
2886
|
+
primaryLinkLabel: label,
|
|
2887
|
+
secondaryLinks: null
|
|
2888
|
+
});
|
|
2889
|
+
var isEmptyLink = (value) => !value || !value.primaryLinkUrl || value.primaryLinkUrl.trim() === "";
|
|
2890
|
+
var textOrNull = (value, max = 200) => typeof value === "string" && value.trim() !== "" ? value.trim().slice(0, max) : null;
|
|
2891
|
+
var buildCompanyUpdate = ({
|
|
2892
|
+
data,
|
|
2893
|
+
domain,
|
|
2894
|
+
existing,
|
|
2895
|
+
now
|
|
2896
|
+
}) => {
|
|
2897
|
+
const company = data.company;
|
|
2898
|
+
const update = {};
|
|
2899
|
+
const emails = cleanEmails(company.emails, domain);
|
|
2900
|
+
if (emails.length > 0) {
|
|
2901
|
+
update.scavioEmails = {
|
|
2902
|
+
primaryEmail: emails[0],
|
|
2903
|
+
additionalEmails: emails.length > 1 ? emails.slice(1) : null
|
|
2904
|
+
};
|
|
2905
|
+
}
|
|
2906
|
+
const phones = cleanPhones(company.phones, domain);
|
|
2907
|
+
if (phones.length > 0) {
|
|
2908
|
+
const [primary, ...rest] = phones;
|
|
2909
|
+
update.scavioPhones = {
|
|
2910
|
+
primaryPhoneNumber: primary.number,
|
|
2911
|
+
primaryPhoneCountryCode: primary.countryCode,
|
|
2912
|
+
primaryPhoneCallingCode: primary.callingCode,
|
|
2913
|
+
additionalPhones: rest.length > 0 ? rest : null
|
|
2914
|
+
};
|
|
2915
|
+
}
|
|
2916
|
+
const socials = SOCIAL_ORDER.map(({ network, label }) => ({ url: company.socials?.[network], label, network })).filter(
|
|
2917
|
+
(social) => isHttpUrl(social.url)
|
|
2918
|
+
);
|
|
2919
|
+
if (socials.length > 0) {
|
|
2920
|
+
const [first, ...rest] = socials;
|
|
2921
|
+
update.scavioSocialProfiles = {
|
|
2922
|
+
primaryLinkUrl: first.url,
|
|
2923
|
+
primaryLinkLabel: first.label,
|
|
2924
|
+
secondaryLinks: rest.length > 0 ? rest.map(({ url, label }) => ({ url, label })) : null
|
|
2925
|
+
};
|
|
2926
|
+
}
|
|
2927
|
+
const linkedin = socials.find((social) => social.network === "linkedin");
|
|
2928
|
+
if (linkedin && isEmptyLink(existing.linkedinLink)) {
|
|
2929
|
+
update.linkedinLink = link(linkedin.url);
|
|
2930
|
+
}
|
|
2931
|
+
if (isHttpUrl(company.contact_page)) {
|
|
2932
|
+
update.scavioContactPage = link(company.contact_page);
|
|
2933
|
+
}
|
|
2934
|
+
const owner = data.owner;
|
|
2935
|
+
const ownerName = textOrNull(owner?.name);
|
|
2936
|
+
if (owner && ownerName) {
|
|
2937
|
+
update.scavioOwnerName = ownerName;
|
|
2938
|
+
update.scavioOwnerTitle = textOrNull(owner.title);
|
|
2939
|
+
const [ownerEmail] = cleanEmails(owner.email ? [owner.email] : [], domain);
|
|
2940
|
+
update.scavioOwnerEmail = ownerEmail ? { primaryEmail: ownerEmail, additionalEmails: null } : { primaryEmail: "", additionalEmails: null };
|
|
2941
|
+
}
|
|
2942
|
+
const foundSomething = emails.length > 0 || phones.length > 0 || socials.length > 0 || ownerName !== null || isHttpUrl(company.contact_page);
|
|
2943
|
+
const status = foundSomething ? "ENRICHED" : "NO_CONTACTS";
|
|
2944
|
+
update.scavioEnrichmentStatus = status;
|
|
2945
|
+
update.scavioLastEnrichedAt = now;
|
|
2946
|
+
update.scavioEnrichmentNote = foundSomething ? owner && ownerName && isHttpUrl(owner.source_url) ? `Owner found on ${owner.source_url}` : null : `Read ${data.pages_read?.length ?? 0} page(s) of ${domain}; no published contact details found.`;
|
|
2947
|
+
return { status, update };
|
|
2948
|
+
};
|
|
2949
|
+
|
|
2950
|
+
// src/scavio/normalize-domain.ts
|
|
2951
|
+
var SCHEME_REGEX = /^[a-z][a-z0-9+.-]*:\/\//;
|
|
2952
|
+
var LEADING_WWW_REGEX = /^www\./;
|
|
2953
|
+
var HOST_REGEX = /^[a-z0-9-]+(\.[a-z0-9-]+)+$/;
|
|
2954
|
+
var normalizeDomain = (raw) => {
|
|
2955
|
+
if (typeof raw !== "string") {
|
|
2956
|
+
return void 0;
|
|
2957
|
+
}
|
|
2958
|
+
const host = raw.trim().toLowerCase().replace(SCHEME_REGEX, "").split(/[/?#]/)[0].split(":")[0].replace(LEADING_WWW_REGEX, "");
|
|
2959
|
+
return HOST_REGEX.test(host) ? host : void 0;
|
|
2960
|
+
};
|
|
2961
|
+
|
|
2962
|
+
// src/scavio/start-enrichment.ts
|
|
2963
|
+
var MISSING_KEY_MESSAGE = "Add your Scavio API key in Settings > Applications > Scavio Company Enrichment.";
|
|
2964
|
+
|
|
2965
|
+
// src/scavio/run-worker.ts
|
|
2966
|
+
var AUTH_MESSAGE = "Scavio rejected the API key. Check it in Settings > Applications > Scavio Company Enrichment, then run the enrichment again.";
|
|
2967
|
+
var CREDITS_MESSAGE = "The Scavio account is out of credits. Add credits at https://dashboard.scavio.dev, then run the enrichment again.";
|
|
2968
|
+
var RATE_LIMIT_MESSAGE = 'Scavio kept answering "too many requests". Lower "Companies enriched at the same time" in the app settings, then run the enrichment again.';
|
|
2969
|
+
var runWorker = async ({
|
|
2970
|
+
payload,
|
|
2971
|
+
repository,
|
|
2972
|
+
enrich,
|
|
2973
|
+
enqueueWorkers: enqueueWorkers2,
|
|
2974
|
+
apiKey,
|
|
2975
|
+
nowMs,
|
|
2976
|
+
nowIso
|
|
2977
|
+
}) => {
|
|
2978
|
+
const ids = payload.companyIds ?? [];
|
|
2979
|
+
const startedAt = nowMs();
|
|
2980
|
+
const stopAll = async (remaining, status, note) => {
|
|
2981
|
+
await repository.updateMany(remaining, {
|
|
2982
|
+
scavioEnrichmentStatus: status,
|
|
2983
|
+
scavioEnrichmentNote: note,
|
|
2984
|
+
scavioLastEnrichedAt: nowIso()
|
|
2985
|
+
});
|
|
2986
|
+
};
|
|
2987
|
+
if (!apiKey) {
|
|
2988
|
+
await stopAll(ids, "FAILED", MISSING_KEY_MESSAGE);
|
|
2989
|
+
return { processed: 0, stoppedBecause: "missingKey" };
|
|
2990
|
+
}
|
|
2991
|
+
for (let index = 0; index < ids.length; index += 1) {
|
|
2992
|
+
const remaining = ids.slice(index);
|
|
2993
|
+
if (index > 0 && nowMs() - startedAt > WORKER_START_BUDGET_MS) {
|
|
2994
|
+
await enqueueWorkers2([
|
|
2995
|
+
{ companyIds: remaining, rateLimitRetries: payload.rateLimitRetries ?? 0 }
|
|
2996
|
+
]);
|
|
2997
|
+
return { processed: index, continued: true };
|
|
2998
|
+
}
|
|
2999
|
+
const [company] = await repository.read([ids[index]]);
|
|
3000
|
+
if (!company || company.scavioEnrichmentStatus !== "QUEUED") {
|
|
3001
|
+
continue;
|
|
3002
|
+
}
|
|
3003
|
+
const domain = normalizeDomain(company.domainName?.primaryLinkUrl);
|
|
3004
|
+
if (!domain) {
|
|
3005
|
+
await repository.update(company.id, {
|
|
3006
|
+
scavioEnrichmentStatus: "NO_WEBSITE",
|
|
3007
|
+
scavioEnrichmentNote: "Add the company website (Domains field) to enrich it.",
|
|
3008
|
+
scavioLastEnrichedAt: nowIso()
|
|
3009
|
+
});
|
|
3010
|
+
continue;
|
|
3011
|
+
}
|
|
3012
|
+
const outcome = await enrich(domain);
|
|
3013
|
+
switch (outcome.kind) {
|
|
3014
|
+
case "ok": {
|
|
3015
|
+
const { update } = buildCompanyUpdate({
|
|
3016
|
+
data: outcome.response.data,
|
|
3017
|
+
domain,
|
|
3018
|
+
existing: company,
|
|
3019
|
+
now: nowIso()
|
|
3020
|
+
});
|
|
3021
|
+
try {
|
|
3022
|
+
await repository.update(company.id, update);
|
|
3023
|
+
} catch {
|
|
3024
|
+
await repository.update(company.id, {
|
|
3025
|
+
scavioEnrichmentStatus: "FAILED",
|
|
3026
|
+
scavioEnrichmentNote: "Scavio answered, but Twenty could not save the result.",
|
|
3027
|
+
scavioLastEnrichedAt: nowIso()
|
|
3028
|
+
});
|
|
3029
|
+
}
|
|
3030
|
+
break;
|
|
3031
|
+
}
|
|
3032
|
+
case "unreachable":
|
|
3033
|
+
await repository.update(company.id, {
|
|
3034
|
+
scavioEnrichmentStatus: "UNREACHABLE",
|
|
3035
|
+
scavioEnrichmentNote: `Could not reach ${domain}. No credits were charged.`,
|
|
3036
|
+
scavioLastEnrichedAt: nowIso()
|
|
3037
|
+
});
|
|
3038
|
+
break;
|
|
3039
|
+
case "invalid":
|
|
3040
|
+
case "error":
|
|
3041
|
+
await repository.update(company.id, {
|
|
3042
|
+
scavioEnrichmentStatus: "FAILED",
|
|
3043
|
+
scavioEnrichmentNote: outcome.message,
|
|
3044
|
+
scavioLastEnrichedAt: nowIso()
|
|
3045
|
+
});
|
|
3046
|
+
break;
|
|
3047
|
+
case "auth":
|
|
3048
|
+
await stopAll(remaining, "FAILED", AUTH_MESSAGE);
|
|
3049
|
+
return { processed: index, stoppedBecause: "auth" };
|
|
3050
|
+
case "credits":
|
|
3051
|
+
await stopAll(remaining, "OUT_OF_CREDITS", CREDITS_MESSAGE);
|
|
3052
|
+
return { processed: index, stoppedBecause: "credits" };
|
|
3053
|
+
case "rateLimited": {
|
|
3054
|
+
const retries = payload.rateLimitRetries ?? 0;
|
|
3055
|
+
if (retries >= MAX_RATE_LIMIT_RETRIES) {
|
|
3056
|
+
await stopAll(remaining, "FAILED", RATE_LIMIT_MESSAGE);
|
|
3057
|
+
return { processed: index, stoppedBecause: "rateLimited" };
|
|
3058
|
+
}
|
|
3059
|
+
await enqueueWorkers2(
|
|
3060
|
+
[{ companyIds: remaining, rateLimitRetries: retries + 1 }],
|
|
3061
|
+
{ delayMs: RATE_LIMIT_RETRY_DELAY_MS }
|
|
3062
|
+
);
|
|
3063
|
+
return { processed: index, requeuedAfterRateLimit: true };
|
|
3064
|
+
}
|
|
3065
|
+
}
|
|
3066
|
+
}
|
|
3067
|
+
return { processed: ids.length };
|
|
3068
|
+
};
|
|
3069
|
+
|
|
3070
|
+
// src/scavio/settings.ts
|
|
3071
|
+
var getApiKey = () => {
|
|
3072
|
+
const key = process.env[SCAVIO_API_KEY_ENV_VAR_NAME]?.trim();
|
|
3073
|
+
return key ? key : void 0;
|
|
3074
|
+
};
|
|
3075
|
+
|
|
3076
|
+
// src/logic-functions/enrich-worker.ts
|
|
3077
|
+
var handler = async (payload) => {
|
|
3078
|
+
const apiKey = getApiKey();
|
|
3079
|
+
return runWorker({
|
|
3080
|
+
payload,
|
|
3081
|
+
repository: createCompanyRepository(new CoreApiClient()),
|
|
3082
|
+
enrich: (domain) => enrichCompany({ apiKey: apiKey ?? "", domain }),
|
|
3083
|
+
enqueueWorkers,
|
|
3084
|
+
apiKey,
|
|
3085
|
+
nowMs: () => Date.now(),
|
|
3086
|
+
nowIso: () => (/* @__PURE__ */ new Date()).toISOString()
|
|
3087
|
+
});
|
|
3088
|
+
};
|
|
3089
|
+
var enrich_worker_default = defineLogicFunction({
|
|
3090
|
+
universalIdentifier: LOGIC_FUNCTION_UNIVERSAL_IDENTIFIERS.enrichWorker,
|
|
3091
|
+
name: "scavio-enrich-worker",
|
|
3092
|
+
description: "Background job: enriches a list of companies one after another through the Scavio API.",
|
|
3093
|
+
timeoutSeconds: WORKER_TIMEOUT_SECONDS,
|
|
3094
|
+
handler
|
|
3095
|
+
});
|
|
3096
|
+
export {
|
|
3097
|
+
enrich_worker_default as default
|
|
3098
|
+
};
|
|
3099
|
+
//# sourceMappingURL=enrich-worker.mjs.map
|