@gravity-rail/cli 0.22.0 → 0.33.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/dist/lib.js CHANGED
@@ -33,7 +33,7 @@ import {
33
33
  startAccountPhoneVerify,
34
34
  stderr,
35
35
  unwrapItems
36
- } from "./chunk-EGO3LMNZ.js";
36
+ } from "./chunk-KHUZAYUS.js";
37
37
  import {
38
38
  AGUIClient,
39
39
  formatTimestamp,
@@ -41,7 +41,7 @@ import {
41
41
  getTextDelta,
42
42
  performOAuthFlow,
43
43
  selectFromList
44
- } from "./chunk-IYCL6P6B.js";
44
+ } from "./chunk-IGZVMTG5.js";
45
45
  import {
46
46
  AuthRequiredError,
47
47
  CLIError,
@@ -122,7 +122,12 @@ function parseArgs(defs, argv) {
122
122
  if (value === void 0) {
123
123
  throw new CLIError(`Missing value for --${def.name}`);
124
124
  }
125
- result2[def.name] = value;
125
+ if (def.repeatable) {
126
+ const existing = result2[def.name];
127
+ result2[def.name] = Array.isArray(existing) ? [...existing, value] : [value];
128
+ } else {
129
+ result2[def.name] = value;
130
+ }
126
131
  }
127
132
  }
128
133
  for (const def of allDefs) {
@@ -1130,6 +1135,12 @@ function sandboxExample(example) {
1130
1135
  }
1131
1136
 
1132
1137
  // src/lib/types.ts
1138
+ function repeatedValues(args, name) {
1139
+ const value = args[name];
1140
+ if (Array.isArray(value)) return value;
1141
+ if (typeof value === "string" && value.length > 0) return [value];
1142
+ return [];
1143
+ }
1133
1144
  function requireString(args, key) {
1134
1145
  const val = args[key];
1135
1146
  if (typeof val !== "string") throw new Error(`Missing required argument: --${key}`);
@@ -1350,6 +1361,7 @@ Optional
1350
1361
  email / phone / externalId Optional contact fields
1351
1362
  labelIds (number[]) Member label ids
1352
1363
  codeInterpreterEnabled (bool)
1364
+ webBrowserEnabled (bool)
1353
1365
  maxDailyActions (number|null)
1354
1366
 
1355
1367
  Attach an agent\u2019s models/identity to a workflow (draft), then publish:
@@ -2104,6 +2116,198 @@ var chatsDomain = {
2104
2116
  ]
2105
2117
  };
2106
2118
 
2119
+ // ../sdk/src/types/generated/member_relationship_catalog.ts
2120
+ var MEMBER_RELATIONSHIP_KINDS = [
2121
+ {
2122
+ "kind": "parent_of",
2123
+ "cardinality": "many_to_many",
2124
+ "symmetric": false,
2125
+ "grantsChartAccess": false,
2126
+ "roles": [
2127
+ {
2128
+ "role": "parent",
2129
+ "label": "Parent",
2130
+ "inverseLabel": "Child",
2131
+ "description": "This person is a parent of the member. For a minor, also add Legal guardian if they should read the chart."
2132
+ },
2133
+ {
2134
+ "role": "child",
2135
+ "label": "Child",
2136
+ "inverseLabel": "Parent",
2137
+ "description": "This person is a child of the member."
2138
+ }
2139
+ ]
2140
+ },
2141
+ {
2142
+ "kind": "sibling_of",
2143
+ "cardinality": "many_to_many",
2144
+ "symmetric": true,
2145
+ "grantsChartAccess": false,
2146
+ "roles": [
2147
+ {
2148
+ "role": "sibling",
2149
+ "label": "Sibling",
2150
+ "inverseLabel": "Sibling",
2151
+ "description": "These members are siblings."
2152
+ }
2153
+ ]
2154
+ },
2155
+ {
2156
+ "kind": "spouse_of",
2157
+ "cardinality": "one_to_one",
2158
+ "symmetric": true,
2159
+ "grantsChartAccess": false,
2160
+ "roles": [
2161
+ {
2162
+ "role": "spouse",
2163
+ "label": "Spouse",
2164
+ "inverseLabel": "Spouse",
2165
+ "description": "These members are spouses or partners."
2166
+ }
2167
+ ]
2168
+ },
2169
+ {
2170
+ "kind": "caregiver_of",
2171
+ "cardinality": "many_to_many",
2172
+ "symmetric": false,
2173
+ "grantsChartAccess": false,
2174
+ "roles": [
2175
+ {
2176
+ "role": "caregiver",
2177
+ "label": "Caregiver",
2178
+ "inverseLabel": "Care recipient",
2179
+ "description": "This person provides care for the member at home."
2180
+ },
2181
+ {
2182
+ "role": "care_recipient",
2183
+ "label": "Care recipient",
2184
+ "inverseLabel": "Caregiver",
2185
+ "description": "This person receives care from the member."
2186
+ }
2187
+ ]
2188
+ },
2189
+ {
2190
+ "kind": "emergency_contact_of",
2191
+ "cardinality": "many_to_many",
2192
+ "symmetric": false,
2193
+ "grantsChartAccess": false,
2194
+ "roles": [
2195
+ {
2196
+ "role": "emergency_contact",
2197
+ "label": "Emergency contact",
2198
+ "inverseLabel": "Emergency contact for",
2199
+ "description": "This person is the member's emergency contact."
2200
+ },
2201
+ {
2202
+ "role": "emergency_contact_for",
2203
+ "label": "Emergency contact for",
2204
+ "inverseLabel": "Emergency contact",
2205
+ "description": "The member is listed as this person's emergency contact."
2206
+ }
2207
+ ]
2208
+ },
2209
+ {
2210
+ "kind": "next_of_kin_of",
2211
+ "cardinality": "one_per_target",
2212
+ "symmetric": false,
2213
+ "grantsChartAccess": false,
2214
+ "roles": [
2215
+ {
2216
+ "role": "next_of_kin",
2217
+ "label": "Next of kin",
2218
+ "inverseLabel": "Next of kin for",
2219
+ "description": "This person is the member's designated next of kin. A member has at most one."
2220
+ },
2221
+ {
2222
+ "role": "next_of_kin_for",
2223
+ "label": "Next of kin for",
2224
+ "inverseLabel": "Next of kin",
2225
+ "description": "The member is this person's designated next of kin."
2226
+ }
2227
+ ]
2228
+ },
2229
+ {
2230
+ "kind": "legal_guardian_of",
2231
+ "cardinality": "many_to_many",
2232
+ "symmetric": false,
2233
+ "grantsChartAccess": true,
2234
+ "roles": [
2235
+ {
2236
+ "role": "legal_guardian",
2237
+ "label": "Legal guardian",
2238
+ "inverseLabel": "Legal guardian for",
2239
+ "description": "Court-appointed guardian, or parent/person with parental responsibility for a minor."
2240
+ },
2241
+ {
2242
+ "role": "legal_guardian_for",
2243
+ "label": "Legal guardian for",
2244
+ "inverseLabel": "Legal guardian",
2245
+ "description": "The member is this person's legal guardian."
2246
+ }
2247
+ ]
2248
+ },
2249
+ {
2250
+ "kind": "healthcare_agent_of",
2251
+ "cardinality": "many_to_many",
2252
+ "symmetric": false,
2253
+ "grantsChartAccess": true,
2254
+ "roles": [
2255
+ {
2256
+ "role": "healthcare_agent",
2257
+ "label": "Healthcare agent",
2258
+ "inverseLabel": "Healthcare agent for",
2259
+ "description": "Healthcare power of attorney or health proxy."
2260
+ },
2261
+ {
2262
+ "role": "healthcare_agent_for",
2263
+ "label": "Healthcare agent for",
2264
+ "inverseLabel": "Healthcare agent",
2265
+ "description": "The member is this person's healthcare agent (healthcare power of attorney or health proxy)."
2266
+ }
2267
+ ]
2268
+ },
2269
+ {
2270
+ "kind": "doctor_of",
2271
+ "cardinality": "many_to_many",
2272
+ "symmetric": false,
2273
+ "grantsChartAccess": true,
2274
+ "roles": [
2275
+ {
2276
+ "role": "doctor",
2277
+ "label": "Doctor",
2278
+ "inverseLabel": "Patient",
2279
+ "description": "This person is a treating clinician for the member."
2280
+ },
2281
+ {
2282
+ "role": "patient",
2283
+ "label": "Patient",
2284
+ "inverseLabel": "Doctor",
2285
+ "description": "This person is a patient of the member."
2286
+ }
2287
+ ]
2288
+ },
2289
+ {
2290
+ "kind": "primary_contact_of",
2291
+ "cardinality": "one_per_target",
2292
+ "symmetric": false,
2293
+ "grantsChartAccess": true,
2294
+ "roles": [
2295
+ {
2296
+ "role": "primary_contact",
2297
+ "label": "Primary contact",
2298
+ "inverseLabel": "Primary contact for",
2299
+ "description": "This person is the organization's primary contact for the member. A member has at most one."
2300
+ },
2301
+ {
2302
+ "role": "primary_contact_for",
2303
+ "label": "Primary contact for",
2304
+ "inverseLabel": "Primary contact",
2305
+ "description": "The member is this person's assigned primary contact inside the organization."
2306
+ }
2307
+ ]
2308
+ }
2309
+ ];
2310
+
2107
2311
  // src/domains/members.ts
2108
2312
  var COLUMNS3 = [
2109
2313
  COL.id(),
@@ -2144,9 +2348,7 @@ var membersDomain = {
2144
2348
  columns: COLUMNS3,
2145
2349
  updateExamples: [
2146
2350
  `yarn gr members update -w $UUID --id 2 --data '{"phone":"+15551234567"}' --allow-write`,
2147
- "yarn gr members update --profile acme-demo/acme-admin --id 2 --file /tmp/member.json --allow-write",
2148
- "# Trust a member's phone so they can use SMS as themselves (no account):",
2149
- `yarn gr members update -w $UUID --id 2 --data '{"phoneTrusted":true}' --allow-write`
2351
+ "yarn gr members update --profile acme-demo/acme-admin --id 2 --file /tmp/member.json --allow-write"
2150
2352
  ]
2151
2353
  }),
2152
2354
  // Current member
@@ -2159,13 +2361,12 @@ var membersDomain = {
2159
2361
  outputSingle(result2, ctx, COLUMNS3);
2160
2362
  }
2161
2363
  },
2162
- // Send a member an SMS to confirm their phone (member-attested trust).
2163
- // On reply, a trusted phone auth binding is created so they can use SMS
2164
- // as themselves without an account. Lower-privilege alternative to
2165
- // setting phoneTrusted directly via `members update`.
2364
+ // Send a member an SMS to confirm their phone. On reply, a verified
2365
+ // phone auth binding is created so they can use SMS as themselves
2366
+ // without an account. This is the only way to earn the Verified badge.
2166
2367
  {
2167
2368
  path: ["members", "confirm-phone"],
2168
- description: "Text a member to confirm their phone (trust on reply)",
2369
+ description: "Text a member to confirm their phone (verifies it on reply)",
2169
2370
  mutates: true,
2170
2371
  requiresWorkspace: true,
2171
2372
  args: [{ name: "id", description: "Member ID", required: true }],
@@ -2322,6 +2523,90 @@ var membersDomain = {
2322
2523
  }
2323
2524
  },
2324
2525
  // Member Roles CRUD
2526
+ {
2527
+ path: ["members", "relationships", "kinds"],
2528
+ description: "List the hardcoded member relationship kinds",
2529
+ requiresWorkspace: false,
2530
+ requiresAuth: false,
2531
+ handler: async ({ ctx }) => {
2532
+ outputData([...MEMBER_RELATIONSHIP_KINDS], ctx, [
2533
+ { header: "KIND", getValue: (item) => item.kind },
2534
+ { header: "CARDINALITY", getValue: (item) => item.cardinality },
2535
+ {
2536
+ header: "CHART",
2537
+ getValue: (item) => item.grantsChartAccess ? "read" : ""
2538
+ }
2539
+ ]);
2540
+ }
2541
+ },
2542
+ {
2543
+ path: ["members", "relationships", "list"],
2544
+ description: "List relationships for a member",
2545
+ requiresWorkspace: true,
2546
+ args: [{ name: "member-id", description: "Member ID", required: true }],
2547
+ handler: async ({ ctx, workspace, args }) => {
2548
+ const memberId = requireNumber(args, "member-id");
2549
+ const result2 = await requireAuth(ctx).apiClient.getMemberRelationships(
2550
+ workspace,
2551
+ memberId
2552
+ );
2553
+ outputData(result2.items, ctx, [
2554
+ COL.id(),
2555
+ { header: "ROLE", getValue: (item) => item.relatedRole ?? "" },
2556
+ { header: "RELATED", getValue: (item) => String(item.relatedMemberId ?? "") },
2557
+ {
2558
+ header: "CHART",
2559
+ getValue: (item) => item.grantsChartAccess ? "read" : ""
2560
+ }
2561
+ ]);
2562
+ }
2563
+ },
2564
+ {
2565
+ path: ["members", "relationships", "create"],
2566
+ description: "Create a relationship from a related-member role",
2567
+ mutates: true,
2568
+ requiresWorkspace: true,
2569
+ args: [
2570
+ { name: "member-id", description: "Member ID", required: true },
2571
+ { name: "related-member-id", description: "Related member ID", required: true },
2572
+ {
2573
+ name: "related-role",
2574
+ description: "Related role (legal_guardian, doctor, parent, ...)",
2575
+ required: true
2576
+ }
2577
+ ],
2578
+ handler: async ({ ctx, workspace, args }) => {
2579
+ const memberId = requireNumber(args, "member-id");
2580
+ const relatedMemberId = requireNumber(args, "related-member-id");
2581
+ const relatedRole = String(args["related-role"]);
2582
+ const result2 = await requireAuth(ctx).apiClient.createMemberRelationship(
2583
+ workspace,
2584
+ memberId,
2585
+ { relatedMemberId, relatedRole }
2586
+ );
2587
+ outputSingle(result2, ctx);
2588
+ }
2589
+ },
2590
+ {
2591
+ path: ["members", "relationships", "archive"],
2592
+ description: "Archive a member relationship",
2593
+ mutates: true,
2594
+ requiresWorkspace: true,
2595
+ args: [
2596
+ { name: "member-id", description: "Member ID", required: true },
2597
+ { name: "id", description: "Relationship ID", required: true }
2598
+ ],
2599
+ handler: async ({ ctx, workspace, args }) => {
2600
+ const memberId = requireNumber(args, "member-id");
2601
+ const relationshipId = requireNumber(args, "id");
2602
+ const result2 = await requireAuth(ctx).apiClient.archiveMemberRelationship(
2603
+ workspace,
2604
+ memberId,
2605
+ relationshipId
2606
+ );
2607
+ outputSingle(result2, ctx);
2608
+ }
2609
+ },
2325
2610
  ...crudCommands({
2326
2611
  prefix: ["members", "roles"],
2327
2612
  entityName: "member role",
@@ -3471,137 +3756,601 @@ ${WORKFLOW_FIELD_REFERENCE}`,
3471
3756
  // src/domains/workspaces.ts
3472
3757
  import { writeFile } from "fs/promises";
3473
3758
  import { extractWorkspaceExportJson } from "@gravity-rail/sdk/helpers";
3474
- var COLUMNS6 = [
3475
- COL.id(),
3476
- COL.uuid(),
3477
- COL.name(),
3478
- { header: "SLUG", getValue: (item) => item.slug ?? "" },
3479
- COL.status(),
3480
- COL.created()
3481
- ];
3482
- var PRODUCT_COLUMNS = [
3483
- COL.id(),
3484
- COL.uuid(),
3485
- COL.name(),
3486
- COL.status(),
3487
- // The plan a flow picks when it cannot ask (the signup funnel's workspace step,
3488
- // for one). One per type per catalogue — see `gr workspaces products set-default`.
3489
- { header: "DEFAULT", getValue: (item) => item.isDefault ? "yes" : "\u2014" }
3490
- ];
3491
- var INVITATION_COLUMNS = [
3492
- COL.id(),
3493
- { header: "EMAIL", getValue: (item) => item.email ?? "" },
3494
- COL.status(),
3495
- COL.created()
3496
- ];
3497
- var NOTIFICATION_COLUMNS = [
3498
- COL.id(),
3499
- { header: "TYPE", getValue: (item) => item.type ?? "" },
3500
- { header: "READ", getValue: (item) => String(item.read ?? false) },
3501
- COL.created()
3502
- ];
3503
- var FEATURE_COLUMNS = [
3504
- { header: "SLUG", getValue: (item) => item.slug ?? "" },
3505
- COL.name(),
3506
- { header: "CATEGORY", getValue: (item) => item.category ?? "" }
3507
- ];
3508
- var SCOPE_COLUMNS = [
3509
- COL.name(),
3510
- { header: "CATEGORY", getValue: (item) => item.category ?? "" },
3511
- COL.description()
3512
- ];
3513
- var THEME_COLUMNS = [
3514
- { header: "SLUG", getValue: (item) => item.slug ?? "" },
3515
- COL.name(),
3516
- COL.description()
3517
- ];
3518
- var DM_COLUMNS = [
3519
- { header: "ID", getValue: (item) => String(item.id ?? "") },
3520
- {
3521
- header: "PARTICIPANTS",
3522
- getValue: (item) => (item.participants ?? []).map((p) => p.name).join(", "),
3523
- maxWidth: 40
3524
- },
3525
- {
3526
- header: "SUMMARY",
3527
- getValue: (item) => String(item.summary ?? "").slice(0, 60),
3528
- maxWidth: 60
3529
- },
3530
- { header: "UPDATED", getValue: (item) => item.updatedAt ?? "" }
3531
- ];
3532
- var MESSAGE_COLUMNS3 = [
3533
- COL.id(),
3534
- { header: "ROLE", getValue: (item) => item.role ?? "" },
3535
- {
3536
- header: "CONTENT",
3537
- getValue: (item) => String(item.content ?? "").slice(0, 80),
3538
- maxWidth: 80
3539
- },
3540
- COL.created()
3541
- ];
3542
- var workspacesDomain = {
3543
- name: "workspaces",
3544
- description: "Manage workspaces",
3545
- commands: [
3546
- // List workspaces (no workspace required)
3547
- ...crudCommands({
3548
- prefix: ["workspaces"],
3549
- entityName: "workspace",
3550
- listMethod: "getWorkspaces",
3551
- // getMethod omitted — custom get below accepts -w as the identifier
3552
- updateMethod: "updateWorkspace",
3553
- deleteMethod: "deleteWorkspace",
3554
- columns: COLUMNS6,
3555
- requiresWorkspace: false
3556
- }),
3557
- // Custom get that accepts either --id or -w as the workspace identifier
3558
- {
3559
- path: ["workspaces", "get"],
3560
- description: "Get a workspace by UUID (via --id or -w)",
3561
- requiresWorkspace: false,
3562
- args: [{ name: "id", description: "Workspace UUID (or use -w)" }],
3563
- handler: async ({ ctx, workspace, args }) => {
3564
- const id = args.id ?? args.uuid ?? workspace;
3565
- if (!id) throw new CLIError("Provide workspace UUID via --id or -w");
3566
- const result2 = await requireAuth(ctx).apiClient.getWorkspace(id);
3567
- outputSingle(result2, ctx, COLUMNS6);
3759
+
3760
+ // src/lib/workspace-sync/import-payload.ts
3761
+ var UNRECOGNIZED_PAYLOAD = 'Unrecognized data format. Provide either raw export data (from "workspaces export") or a full import payload with {exportData, importMappings, createNew, autoMap?}.';
3762
+ var MALFORMED_AUTO_MAP = 'autoMap must be an object mapping each entity type to a list of UUIDs (an empty object means "match nothing by name").';
3763
+ function isPlainObject(value) {
3764
+ return typeof value === "object" && value !== null && !Array.isArray(value);
3765
+ }
3766
+ function parseImportPayload(payload) {
3767
+ if (isPlainObject(payload.exportData)) {
3768
+ const importMappings = isPlainObject(payload.importMappings) ? payload.importMappings : {};
3769
+ const createNew = isPlainObject(payload.createNew) ? payload.createNew : {};
3770
+ const parsed = {
3771
+ exportData: payload.exportData,
3772
+ importMappings,
3773
+ createNew
3774
+ };
3775
+ if (payload.autoMap !== void 0) {
3776
+ if (!isPlainObject(payload.autoMap)) {
3777
+ throw new CLIError(MALFORMED_AUTO_MAP);
3568
3778
  }
3569
- },
3570
- // Provision a workspace under an organization's active subscription.
3571
- {
3572
- path: ["workspaces", "create"],
3573
- description: "Provision a workspace in an organization (requires an active subscription)",
3574
- mutates: true,
3575
- requiresWorkspace: false,
3576
- args: [
3577
- {
3578
- name: "org",
3579
- aliases: ["org-uuid"],
3580
- description: "Organization UUID",
3581
- required: true
3582
- },
3583
- { name: "name", description: "Workspace name", required: true },
3584
- { name: "slug", description: "Workspace slug (optional)" },
3585
- { name: "template", description: "Template workspace UUID to clone (optional)" }
3586
- ],
3587
- examples: ['gr workspaces create --org <org-uuid> --name "Front Desk"'],
3588
- handler: async ({ ctx, args }) => {
3589
- const orgUuid = args.org ?? args["org-uuid"];
3590
- const name = args.name;
3591
- if (!orgUuid) throw new CLIError("Missing required argument: --org <org-uuid>");
3592
- if (!name) throw new CLIError("Missing required argument: --name");
3593
- const payload = { name };
3594
- if (args.slug) payload.slug = String(args.slug);
3595
- if (args.template) payload.templateWorkspaceUuid = String(args.template);
3596
- try {
3597
- const result2 = await requireAuth(ctx).apiClient.createOrganizationWorkspace(
3598
- orgUuid,
3599
- payload
3600
- );
3601
- outputSingle(result2, ctx, COLUMNS6);
3602
- if ((ctx.outputFormat ?? "table") === "table") {
3603
- const wsUuid = result2?.uuid ?? "<workspace-uuid>";
3604
- process.stdout.write(
3779
+ parsed.autoMap = payload.autoMap;
3780
+ }
3781
+ return parsed;
3782
+ }
3783
+ if (payload.version && payload.workflows) {
3784
+ return { exportData: payload, importMappings: {}, createNew: {} };
3785
+ }
3786
+ throw new CLIError(UNRECOGNIZED_PAYLOAD);
3787
+ }
3788
+ function deriveCreateNew(exportData, existing) {
3789
+ const merged = {};
3790
+ for (const [key, uuids] of Object.entries(existing ?? {})) {
3791
+ if (Array.isArray(uuids)) {
3792
+ merged[key] = [...uuids];
3793
+ }
3794
+ }
3795
+ for (const [key, value] of Object.entries(exportData)) {
3796
+ if (!Array.isArray(value)) continue;
3797
+ const seen = new Set(merged[key] ?? []);
3798
+ const discovered = [];
3799
+ for (const element of value) {
3800
+ if (!isPlainObject(element)) continue;
3801
+ const uuid = element.uuid;
3802
+ if (typeof uuid !== "string" || uuid.length === 0) continue;
3803
+ if (seen.has(uuid)) continue;
3804
+ seen.add(uuid);
3805
+ discovered.push(uuid);
3806
+ }
3807
+ if (discovered.length === 0) continue;
3808
+ merged[key] = [...merged[key] ?? [], ...discovered];
3809
+ }
3810
+ return merged;
3811
+ }
3812
+
3813
+ // src/lib/workspace-sync/bindings-file.ts
3814
+ function requireString2(value, field, where) {
3815
+ if (typeof value !== "string" || value.length === 0) {
3816
+ throw new CLIError(`${where}: "${field}" must be a non-empty string.`);
3817
+ }
3818
+ return value;
3819
+ }
3820
+ function optionalString2(value, field, where) {
3821
+ if (value === void 0 || value === null) return void 0;
3822
+ if (typeof value !== "string" || value.length === 0) {
3823
+ throw new CLIError(`${where}: "${field}" must be a non-empty string when present.`);
3824
+ }
3825
+ return value;
3826
+ }
3827
+ function parseBindingsFile(payload) {
3828
+ if (typeof payload !== "object" || payload === null || Array.isArray(payload)) {
3829
+ throw new CLIError("The bindings file must be a JSON object keyed by target workspace UUID.");
3830
+ }
3831
+ const parsed = {};
3832
+ for (const [targetUuid, entries] of Object.entries(payload)) {
3833
+ if (!Array.isArray(entries)) {
3834
+ throw new CLIError(
3835
+ `Bindings for target ${targetUuid} must be a JSON array of binding objects.`
3836
+ );
3837
+ }
3838
+ parsed[targetUuid] = entries.map((entry, index) => {
3839
+ const where = `Bindings for target ${targetUuid}, entry ${index}`;
3840
+ if (typeof entry !== "object" || entry === null || Array.isArray(entry)) {
3841
+ throw new CLIError(`${where}: each binding must be a JSON object.`);
3842
+ }
3843
+ const record = entry;
3844
+ const value = record.value;
3845
+ if (typeof value !== "string" && typeof value !== "boolean") {
3846
+ throw new CLIError(`${where}: "value" must be a string or a boolean.`);
3847
+ }
3848
+ if (typeof value === "string" && value.length === 0) {
3849
+ throw new CLIError(`${where}: "value" must not be empty.`);
3850
+ }
3851
+ const binding = {
3852
+ entityType: requireString2(record.entityType, "entityType", where),
3853
+ sourceUuid: requireString2(record.sourceUuid, "sourceUuid", where),
3854
+ fieldPath: requireString2(record.fieldPath, "fieldPath", where),
3855
+ value
3856
+ };
3857
+ const parentKind = optionalString2(record.parentKind, "parentKind", where);
3858
+ if (parentKind !== void 0) binding.parentKind = parentKind;
3859
+ const parentUuid = optionalString2(record.parentUuid, "parentUuid", where);
3860
+ if (parentUuid !== void 0) binding.parentUuid = parentUuid;
3861
+ return binding;
3862
+ });
3863
+ }
3864
+ return parsed;
3865
+ }
3866
+ function bindingsForTarget(parsed, targetUuid) {
3867
+ return parsed[targetUuid] ?? [];
3868
+ }
3869
+ function unusedBindingTargets(parsed, selected) {
3870
+ const chosen = new Set(selected);
3871
+ return Object.keys(parsed).filter((uuid) => !chosen.has(uuid));
3872
+ }
3873
+
3874
+ // src/lib/workspace-sync/output.ts
3875
+ function projectReadiness(readiness, skipped) {
3876
+ return {
3877
+ issues: (readiness.issues ?? []).map((issue) => {
3878
+ const projected = {
3879
+ code: issue.code,
3880
+ resourceType: issue.resourceType,
3881
+ resourceId: issue.resourceId,
3882
+ resourceUuid: issue.resourceUuid
3883
+ };
3884
+ if (issue.resourceName) projected.resourceName = issue.resourceName;
3885
+ return projected;
3886
+ }),
3887
+ truncated: readiness.truncated === true,
3888
+ outstandingGroups: (skipped.groups ?? []).map((group) => ({
3889
+ resourceType: group.resourceType,
3890
+ outstandingCount: group.outstandingCount,
3891
+ activeCount: group.activeCount,
3892
+ ruleCount: (group.rules ?? []).length
3893
+ })),
3894
+ skippedTruncated: skipped.truncated === true
3895
+ };
3896
+ }
3897
+ function readinessIsIncomplete(projection) {
3898
+ return projection.truncated || projection.skippedTruncated;
3899
+ }
3900
+ function renderReadiness(projection) {
3901
+ const lines = ["Import readiness (server-owned)"];
3902
+ if (projection.issues.length === 0) {
3903
+ lines.push(" no binding gaps reported");
3904
+ } else {
3905
+ for (const issue of projection.issues) {
3906
+ lines.push(
3907
+ ` ${issue.code} ${issue.resourceType} id=${issue.resourceId} uuid=${issue.resourceUuid}` + (issue.resourceName ? ` name=${issue.resourceName}` : "")
3908
+ );
3909
+ }
3910
+ }
3911
+ if (projection.truncated) {
3912
+ lines.push(
3913
+ " INCOMPLETE: the readiness scan was truncated. This report does not mean the workspace is ready."
3914
+ );
3915
+ }
3916
+ lines.push("");
3917
+ lines.push("Outstanding skipped EventRule groups");
3918
+ if (projection.outstandingGroups.length === 0) {
3919
+ lines.push(" none outstanding");
3920
+ } else {
3921
+ for (const group of projection.outstandingGroups) {
3922
+ lines.push(
3923
+ ` ${group.resourceType} outstanding=${group.outstandingCount} active=${group.activeCount} rules=${group.ruleCount}`
3924
+ );
3925
+ }
3926
+ }
3927
+ if (projection.skippedTruncated) {
3928
+ lines.push(" INCOMPLETE: the skipped-rule listing was truncated.");
3929
+ }
3930
+ return lines.join("\n") + "\n";
3931
+ }
3932
+ var MAX_RENDERED_PATHS = 5;
3933
+ function renderPaths(paths) {
3934
+ if (paths.length === 0) return "";
3935
+ const head = paths.slice(0, MAX_RENDERED_PATHS).join(", ");
3936
+ const extra = paths.length - MAX_RENDERED_PATHS;
3937
+ return extra > 0 ? `${head} (+${extra} more)` : head;
3938
+ }
3939
+ function padded(cells, widths) {
3940
+ return cells.map((cell, i) => cell.padEnd(widths[i] ?? 0)).join(" ").trimEnd();
3941
+ }
3942
+ var PLAN_CONTRACT_FAILURE_CODE = "plan_contract_incomplete";
3943
+ var MissingPlanContract = class extends CLIError {
3944
+ code = PLAN_CONTRACT_FAILURE_CODE;
3945
+ constructor(missing) {
3946
+ super(`The server's plan response omitted ${missing}, so this target could not be planned.`);
3947
+ this.name = "MissingPlanContract";
3948
+ }
3949
+ };
3950
+ function isPlanRowShaped(row) {
3951
+ if (typeof row !== "object" || row === null) return false;
3952
+ const candidate = row;
3953
+ return typeof candidate.entityType === "string" && typeof candidate.sourceUuid === "string" && typeof candidate.action === "string";
3954
+ }
3955
+ function projectImportPlan(response) {
3956
+ if (!Array.isArray(response.planRows)) throw new MissingPlanContract("planRows");
3957
+ if (!response.planFingerprint) throw new MissingPlanContract("planFingerprint");
3958
+ if (!response.sourceFingerprint) throw new MissingPlanContract("sourceFingerprint");
3959
+ if (!response.planRows.every(isPlanRowShaped)) {
3960
+ throw new MissingPlanContract("well-formed planRows");
3961
+ }
3962
+ const rows = response.planRows.map((row) => {
3963
+ const projected = {
3964
+ entityType: row.entityType,
3965
+ sourceUuid: row.sourceUuid,
3966
+ action: row.action,
3967
+ changedPaths: [...row.changedPaths ?? []],
3968
+ retainedPaths: [...row.retainedPaths ?? []],
3969
+ reasonCodes: [...row.reasonCodes ?? []],
3970
+ blocksApply: row.blocksApply === true
3971
+ };
3972
+ if (row.targetUuid) projected.targetUuid = row.targetUuid;
3973
+ if ("name" in row && row.name) projected.name = row.name;
3974
+ return projected;
3975
+ });
3976
+ const counts = {};
3977
+ for (const row of rows) counts[row.action] = (counts[row.action] ?? 0) + 1;
3978
+ return {
3979
+ rows,
3980
+ counts,
3981
+ blocked: rows.some((row) => row.blocksApply),
3982
+ // Derived from the projection the operator is shown, not from a separate
3983
+ // server field: what they approve is what these rows say.
3984
+ hasWrites: rows.some((row) => row.action === "create" || row.action === "update"),
3985
+ planFingerprint: response.planFingerprint,
3986
+ sourceFingerprint: response.sourceFingerprint
3987
+ };
3988
+ }
3989
+ var PLAN_ACTION_ORDER = ["refuse", "create", "update", "retain"];
3990
+ function renderImportPlan(projection) {
3991
+ const header = ["ACTION", "ENTITY", "SOURCE", "NAME", "CHANGED", "RETAINED", "REASONS"];
3992
+ const body = projection.rows.map((row) => [
3993
+ row.action,
3994
+ row.entityType,
3995
+ row.sourceUuid,
3996
+ row.name ?? "",
3997
+ renderPaths(row.changedPaths),
3998
+ renderPaths(row.retainedPaths),
3999
+ row.reasonCodes.join(", ")
4000
+ ]);
4001
+ const widths = header.map(
4002
+ (cell, i) => Math.max(cell.length, ...body.map((cells) => (cells[i] ?? "").length), 0)
4003
+ );
4004
+ const lines = [padded(header, widths)];
4005
+ for (const cells of body) lines.push(padded(cells, widths));
4006
+ if (body.length === 0) lines.push("(the template describes no rows for this target)");
4007
+ lines.push("");
4008
+ lines.push(
4009
+ PLAN_ACTION_ORDER.map((action) => `${action}=${projection.counts[action] ?? 0}`).join(" ")
4010
+ );
4011
+ if (projection.blocked) {
4012
+ lines.push(
4013
+ "BLOCKED: at least one row cannot be applied safely. Nothing may be written until each refusing row is resolved."
4014
+ );
4015
+ } else if (!projection.hasWrites) {
4016
+ lines.push("This target already matches the template; applying would write nothing.");
4017
+ }
4018
+ return lines.join("\n") + "\n";
4019
+ }
4020
+
4021
+ // src/domains/workspaces.ts
4022
+ function archiveBlob(zip) {
4023
+ return new Blob([new Uint8Array(zip)]);
4024
+ }
4025
+ var REAPPLY_EXPORT_EXCLUDE = "channels";
4026
+ async function exportTemplateArchive(client, templateUuid) {
4027
+ return client.exportWorkspaceZip(templateUuid, void 0, void 0, REAPPLY_EXPORT_EXCLUDE);
4028
+ }
4029
+ async function readBindingsFile(filePath, targets) {
4030
+ if (!filePath) return {};
4031
+ const { readFile } = await import("fs/promises");
4032
+ let raw;
4033
+ try {
4034
+ raw = await readFile(filePath, "utf8");
4035
+ } catch (err) {
4036
+ throw new CLIError(
4037
+ `Could not read --bindings-file ${filePath}: ${err instanceof Error ? err.name : "unknown error"}`
4038
+ );
4039
+ }
4040
+ let payload;
4041
+ try {
4042
+ payload = JSON.parse(raw);
4043
+ } catch {
4044
+ throw new CLIError(`--bindings-file ${filePath} is not valid JSON.`);
4045
+ }
4046
+ const parsed = parseBindingsFile(payload);
4047
+ const unused = unusedBindingTargets(parsed, targets);
4048
+ if (unused.length > 0) {
4049
+ throw new CLIError(
4050
+ `--bindings-file names ${unused.length} target(s) that no --target selected: ${unused.join(", ")}. Add them as --target, or remove them from the file.`
4051
+ );
4052
+ }
4053
+ return parsed;
4054
+ }
4055
+ async function confirmApply(ctx, targetUuid) {
4056
+ if (!isTerminalReport(ctx)) {
4057
+ stderr(
4058
+ `Output is not a terminal report, so the plan for ${targetUuid} was not shown and was not confirmed. Run --plan-only to review it, then re-run with --yes.`
4059
+ );
4060
+ return false;
4061
+ }
4062
+ if (!process.stdout.isTTY) {
4063
+ stderr(
4064
+ `stdout is not a terminal, so the plan for ${targetUuid} was written where it cannot be read before confirming; not confirmed. Re-run in a terminal, or review with --plan-only and re-run with --yes.`
4065
+ );
4066
+ return false;
4067
+ }
4068
+ if (!process.stdin.isTTY) {
4069
+ stderr(
4070
+ `Not a terminal, so ${targetUuid} was not confirmed. Re-run with --yes to apply without prompting.`
4071
+ );
4072
+ return false;
4073
+ }
4074
+ const readline4 = await import("readline");
4075
+ const rl = readline4.createInterface({ input: process.stdin, output: process.stderr });
4076
+ const answer = await new Promise(
4077
+ (resolve) => rl.question(`Apply this plan to ${targetUuid}? [y/N] `, resolve)
4078
+ );
4079
+ rl.close();
4080
+ return answer.trim().toLowerCase() === "y";
4081
+ }
4082
+ function structuredErrorData(error) {
4083
+ const data = error?.errorData;
4084
+ if (typeof data !== "object" || data === null) return void 0;
4085
+ return data;
4086
+ }
4087
+ function failureCode(error) {
4088
+ if (error instanceof MissingPlanContract) return error.code;
4089
+ const code = structuredErrorData(error)?.code;
4090
+ if (typeof code === "string") return code;
4091
+ const status = error?.statusCode;
4092
+ if (typeof status === "number") return `http_${status}`;
4093
+ return error instanceof Error ? error.name : "unknown_error";
4094
+ }
4095
+ function conflictPlan(error) {
4096
+ const data = structuredErrorData(error);
4097
+ if (!data || !Array.isArray(data.planRows)) return void 0;
4098
+ try {
4099
+ return projectImportPlan(data);
4100
+ } catch (projectionError) {
4101
+ if (projectionError instanceof MissingPlanContract) return void 0;
4102
+ throw projectionError;
4103
+ }
4104
+ }
4105
+ async function reapplyOneTarget(ctx, client, options) {
4106
+ const { targetUuid, bindings, planOnly, autoConfirm } = options;
4107
+ let projection;
4108
+ try {
4109
+ const preview = await client.previewWorkspaceImportZip(
4110
+ targetUuid,
4111
+ archiveBlob(options.archive),
4112
+ { intent: "template_reapply", bindings }
4113
+ );
4114
+ projection = projectImportPlan(preview);
4115
+ } catch (err) {
4116
+ const code = failureCode(err);
4117
+ stderr(`${targetUuid}: planning failed (${code})`);
4118
+ return { target: targetUuid, status: "failed", code };
4119
+ }
4120
+ if (isTerminalReport(ctx)) {
4121
+ process.stdout.write(`
4122
+ ${targetUuid}
4123
+ ${renderImportPlan(projection)}`);
4124
+ }
4125
+ if (projection.blocked) {
4126
+ return {
4127
+ target: targetUuid,
4128
+ status: "refused",
4129
+ refusedRows: projection.counts.refuse ?? 0,
4130
+ code: "import_plan_refused",
4131
+ plan: projection
4132
+ };
4133
+ }
4134
+ if (planOnly) {
4135
+ return {
4136
+ target: targetUuid,
4137
+ status: "planned",
4138
+ counts: projection.counts,
4139
+ plan: projection
4140
+ };
4141
+ }
4142
+ if (!projection.hasWrites) {
4143
+ return {
4144
+ target: targetUuid,
4145
+ status: "noop",
4146
+ counts: projection.counts,
4147
+ plan: projection
4148
+ };
4149
+ }
4150
+ if (!autoConfirm && !await confirmApply(ctx, targetUuid)) {
4151
+ return { target: targetUuid, status: "skipped", code: "not_confirmed", plan: projection };
4152
+ }
4153
+ try {
4154
+ const applied = await client.importWorkspaceZip(targetUuid, archiveBlob(options.archive), {
4155
+ intent: "template_reapply",
4156
+ expectedPlanFingerprint: projection.planFingerprint,
4157
+ bindings
4158
+ });
4159
+ if (applied.status === "noop") {
4160
+ return {
4161
+ target: targetUuid,
4162
+ status: "noop",
4163
+ counts: projection.counts,
4164
+ plan: projection
4165
+ };
4166
+ }
4167
+ return {
4168
+ target: targetUuid,
4169
+ status: "applied",
4170
+ counts: projection.counts,
4171
+ plan: projection
4172
+ };
4173
+ } catch (err) {
4174
+ const conflict = conflictPlan(err);
4175
+ if (conflict && isTerminalReport(ctx)) {
4176
+ process.stdout.write(renderImportPlan(conflict));
4177
+ }
4178
+ const code = failureCode(err);
4179
+ stderr(`${targetUuid}: apply failed (${code})`);
4180
+ return {
4181
+ target: targetUuid,
4182
+ status: code === "import_plan_refused" ? "refused" : "failed",
4183
+ code,
4184
+ plan: conflict ?? projection
4185
+ };
4186
+ }
4187
+ }
4188
+ function renderReapplySummary(summary) {
4189
+ const lines = ["", "Re-apply summary"];
4190
+ for (const result2 of summary.targets) {
4191
+ lines.push(
4192
+ ` ${result2.status.padEnd(8)} ${result2.target}` + (result2.code ? ` ${result2.code}` : "")
4193
+ );
4194
+ }
4195
+ lines.push("");
4196
+ lines.push(
4197
+ Object.entries(summary.counts).map(([status, count]) => `${status}=${count}`).join(" ")
4198
+ );
4199
+ return lines.join("\n") + "\n";
4200
+ }
4201
+ function requireArg(hctx, name) {
4202
+ const value = hctx.args[name];
4203
+ if (typeof value !== "string" || value.length === 0) {
4204
+ throw new CLIError(`Missing required argument: --${name}`);
4205
+ }
4206
+ return value;
4207
+ }
4208
+ function emitReport(ctx, table, json) {
4209
+ const format = ctx.jq ? "json" : ctx.outputFormat ?? "table";
4210
+ if (format === "table") {
4211
+ process.stdout.write(table);
4212
+ return;
4213
+ }
4214
+ outputSingle(json, ctx);
4215
+ }
4216
+ function failCommand(reason) {
4217
+ stderr(reason);
4218
+ process.exitCode = 1;
4219
+ }
4220
+ function isTerminalReport(ctx) {
4221
+ return !ctx.jq && (ctx.outputFormat ?? "table") === "table";
4222
+ }
4223
+ var COLUMNS6 = [
4224
+ COL.id(),
4225
+ COL.uuid(),
4226
+ COL.name(),
4227
+ { header: "SLUG", getValue: (item) => item.slug ?? "" },
4228
+ COL.status(),
4229
+ COL.created()
4230
+ ];
4231
+ var PRODUCT_COLUMNS = [
4232
+ COL.id(),
4233
+ COL.uuid(),
4234
+ COL.name(),
4235
+ COL.status(),
4236
+ // The plan a flow picks when it cannot ask (the signup funnel's workspace step,
4237
+ // for one). One per type per catalogue — see `gr workspaces products set-default`.
4238
+ { header: "DEFAULT", getValue: (item) => item.isDefault ? "yes" : "\u2014" }
4239
+ ];
4240
+ var INVITATION_COLUMNS = [
4241
+ COL.id(),
4242
+ { header: "EMAIL", getValue: (item) => item.email ?? "" },
4243
+ COL.status(),
4244
+ COL.created()
4245
+ ];
4246
+ var NOTIFICATION_COLUMNS = [
4247
+ COL.id(),
4248
+ { header: "TYPE", getValue: (item) => item.type ?? "" },
4249
+ { header: "READ", getValue: (item) => String(item.read ?? false) },
4250
+ COL.created()
4251
+ ];
4252
+ var FEATURE_COLUMNS = [
4253
+ { header: "SLUG", getValue: (item) => item.slug ?? "" },
4254
+ COL.name(),
4255
+ { header: "CATEGORY", getValue: (item) => item.category ?? "" }
4256
+ ];
4257
+ var SCOPE_COLUMNS = [
4258
+ COL.name(),
4259
+ { header: "CATEGORY", getValue: (item) => item.category ?? "" },
4260
+ COL.description()
4261
+ ];
4262
+ var THEME_COLUMNS = [
4263
+ { header: "SLUG", getValue: (item) => item.slug ?? "" },
4264
+ COL.name(),
4265
+ COL.description()
4266
+ ];
4267
+ var DM_COLUMNS = [
4268
+ { header: "ID", getValue: (item) => String(item.id ?? "") },
4269
+ {
4270
+ header: "PARTICIPANTS",
4271
+ getValue: (item) => (item.participants ?? []).map((p) => p.name).join(", "),
4272
+ maxWidth: 40
4273
+ },
4274
+ {
4275
+ header: "SUMMARY",
4276
+ getValue: (item) => String(item.summary ?? "").slice(0, 60),
4277
+ maxWidth: 60
4278
+ },
4279
+ { header: "UPDATED", getValue: (item) => item.updatedAt ?? "" }
4280
+ ];
4281
+ var MESSAGE_COLUMNS3 = [
4282
+ COL.id(),
4283
+ { header: "ROLE", getValue: (item) => item.role ?? "" },
4284
+ {
4285
+ header: "CONTENT",
4286
+ getValue: (item) => String(item.content ?? "").slice(0, 80),
4287
+ maxWidth: 80
4288
+ },
4289
+ COL.created()
4290
+ ];
4291
+ var workspacesDomain = {
4292
+ name: "workspaces",
4293
+ description: "Manage workspaces",
4294
+ commands: [
4295
+ // List workspaces (no workspace required)
4296
+ ...crudCommands({
4297
+ prefix: ["workspaces"],
4298
+ entityName: "workspace",
4299
+ listMethod: "getWorkspaces",
4300
+ // getMethod omitted — custom get below accepts -w as the identifier
4301
+ updateMethod: "updateWorkspace",
4302
+ deleteMethod: "deleteWorkspace",
4303
+ columns: COLUMNS6,
4304
+ requiresWorkspace: false
4305
+ }),
4306
+ // Custom get that accepts either --id or -w as the workspace identifier
4307
+ {
4308
+ path: ["workspaces", "get"],
4309
+ description: "Get a workspace by UUID (via --id or -w)",
4310
+ requiresWorkspace: false,
4311
+ args: [{ name: "id", description: "Workspace UUID (or use -w)" }],
4312
+ handler: async ({ ctx, workspace, args }) => {
4313
+ const id = args.id ?? args.uuid ?? workspace;
4314
+ if (!id) throw new CLIError("Provide workspace UUID via --id or -w");
4315
+ const result2 = await requireAuth(ctx).apiClient.getWorkspace(id);
4316
+ outputSingle(result2, ctx, COLUMNS6);
4317
+ }
4318
+ },
4319
+ // Provision a workspace under an organization's active subscription.
4320
+ {
4321
+ path: ["workspaces", "create"],
4322
+ description: "Provision a workspace in an organization (requires an active subscription)",
4323
+ mutates: true,
4324
+ requiresWorkspace: false,
4325
+ args: [
4326
+ {
4327
+ name: "org",
4328
+ aliases: ["org-uuid"],
4329
+ description: "Organization UUID",
4330
+ required: true
4331
+ },
4332
+ { name: "name", description: "Workspace name", required: true },
4333
+ { name: "slug", description: "Workspace slug (optional)" },
4334
+ { name: "template", description: "Template workspace UUID to clone (optional)" }
4335
+ ],
4336
+ examples: ['gr workspaces create --org <org-uuid> --name "Front Desk"'],
4337
+ handler: async ({ ctx, args }) => {
4338
+ const orgUuid = args.org ?? args["org-uuid"];
4339
+ const name = args.name;
4340
+ if (!orgUuid) throw new CLIError("Missing required argument: --org <org-uuid>");
4341
+ if (!name) throw new CLIError("Missing required argument: --name");
4342
+ const payload = { name };
4343
+ if (args.slug) payload.slug = String(args.slug);
4344
+ if (args.template) payload.templateWorkspaceUuid = String(args.template);
4345
+ try {
4346
+ const result2 = await requireAuth(ctx).apiClient.createOrganizationWorkspace(
4347
+ orgUuid,
4348
+ payload
4349
+ );
4350
+ outputSingle(result2, ctx, COLUMNS6);
4351
+ if ((ctx.outputFormat ?? "table") === "table") {
4352
+ const wsUuid = result2?.uuid ?? "<workspace-uuid>";
4353
+ process.stdout.write(
3605
4354
  `
3606
4355
  Provisioning started. Watch it come up with:
3607
4356
  gr workspaces get -w ${wsUuid}
@@ -3748,12 +4497,18 @@ Provisioning started. Watch it come up with:
3748
4497
  name: "create-all",
3749
4498
  description: "Auto-generate createNew entries for all entities in the export data. Use when importing into a fresh workspace.",
3750
4499
  isFlag: true
4500
+ },
4501
+ {
4502
+ name: "activate-webhooks",
4503
+ description: "Keep imported webhook:send EventRules at their exported active state. Safety default: OFF \u2014 without this flag, an exported-active webhook rule is force-disabled on import so a cloned workspace never calls the source workspace's webhook URLs. An exported-inactive rule stays inactive either way. Only pass this once you have verified the destination should own those webhook calls.",
4504
+ isFlag: true
3751
4505
  }
3752
4506
  ],
3753
4507
  examples: [
3754
4508
  "yarn gr workspaces import -w $UUID --env dev --file export.json --create-all",
3755
4509
  "yarn gr workspaces import -w $UUID --env dev --file export.zip --create-all",
3756
- `yarn gr workspaces import -w $UUID --env dev --data '{"exportData": ..., "createNew": ..., "importMappings": {}}'`
4510
+ `yarn gr workspaces import -w $UUID --env dev --data '{"exportData": ..., "createNew": ..., "importMappings": {}}'`,
4511
+ "yarn gr workspaces import -w $UUID --env dev --file export.json --create-all --activate-webhooks"
3757
4512
  ],
3758
4513
  handler: async ({ ctx, workspace, data, args }) => {
3759
4514
  if (!data) throw new CLIError("JSON or ZIP data required (--data, --file, or stdin)");
@@ -3772,150 +4527,251 @@ Provisioning started. Watch it come up with:
3772
4527
  payload = data;
3773
4528
  }
3774
4529
  const createAll = args["create-all"] === true;
3775
- let exportData;
3776
- let importMappings;
3777
- let createNew;
3778
- if (payload.exportData && typeof payload.exportData === "object") {
3779
- exportData = payload.exportData;
3780
- importMappings = payload.importMappings ?? {};
3781
- createNew = payload.createNew ?? {};
3782
- } else if (payload.version && payload.workflows) {
3783
- exportData = payload;
3784
- importMappings = {};
3785
- createNew = {};
3786
- } else {
3787
- throw new CLIError(
3788
- 'Unrecognized data format. Provide either raw export data (from "workspaces export") or a full import payload with {exportData, importMappings, createNew}.'
3789
- );
3790
- }
3791
- if (createAll) {
3792
- const entityKeys = [
3793
- "workflows",
3794
- "tasks",
3795
- "dataTypes",
3796
- "agents",
3797
- "memberLabels",
3798
- "files",
3799
- "eventRules",
3800
- "memberRoles",
3801
- "phoneNumbers",
3802
- "sites",
3803
- "inboxes",
3804
- "routines",
3805
- "memberFilters",
3806
- "customToolkits",
3807
- "customTools",
3808
- "pages",
3809
- "menuItems",
3810
- "mcpServers",
3811
- "fileFolders",
3812
- "fileLabels",
3813
- "workflowNotes",
3814
- "abilities",
3815
- "qualifications",
3816
- "chatLabels",
3817
- "chatFilters",
3818
- "chatFilterRules",
3819
- "calendars",
3820
- "calendarEventTypes",
3821
- "calendarSchedules",
3822
- "journeys"
3823
- ];
3824
- for (const key of entityKeys) {
3825
- const entities = exportData[key];
3826
- if (Array.isArray(entities)) {
3827
- createNew[key] = entities.map((e) => e.uuid).filter(Boolean);
3828
- }
3829
- }
3830
- }
4530
+ const activateWebhooks = args["activate-webhooks"] === true;
4531
+ const parsed = parseImportPayload(payload);
4532
+ const { exportData, importMappings } = parsed;
4533
+ const createNew = createAll ? deriveCreateNew(exportData, parsed.createNew) : parsed.createNew;
3831
4534
  const result2 = await requireAuth(ctx).apiClient.importWorkspace(
3832
4535
  workspace,
3833
4536
  exportData,
3834
4537
  importMappings,
3835
4538
  createNew,
3836
- archive
4539
+ archive,
4540
+ activateWebhooks,
4541
+ // Forwarded as parsed: present when the payload carried it,
4542
+ // absent otherwise. The server reads presence (see
4543
+ // `ParsedImportPayload`), so this is the operator's choice of
4544
+ // name-matching, not the CLI's.
4545
+ parsed.autoMap
3837
4546
  );
3838
4547
  outputSingle(result2, ctx);
3839
4548
  }
3840
4549
  },
3841
4550
  {
3842
- path: ["workspaces", "preview-import"],
3843
- description: "Preview workspace import",
3844
- requiresWorkspace: true,
4551
+ path: ["workspaces", "preview-import"],
4552
+ description: "Preview workspace import",
4553
+ requiresWorkspace: true,
4554
+ args: [
4555
+ {
4556
+ name: "create-all",
4557
+ description: "Auto-generate createNew entries for all entities in the export data",
4558
+ isFlag: true
4559
+ }
4560
+ ],
4561
+ handler: async ({ ctx, workspace, data, args }) => {
4562
+ if (!data) throw new CLIError("JSON data required (--data, --file, or stdin)");
4563
+ const payload = data;
4564
+ const createAll = args["create-all"] === true;
4565
+ const parsed = parseImportPayload(payload);
4566
+ const { exportData, importMappings } = parsed;
4567
+ const createNew = createAll ? deriveCreateNew(exportData, parsed.createNew) : parsed.createNew;
4568
+ const result2 = await requireAuth(ctx).apiClient.previewImportWorkspace(
4569
+ workspace,
4570
+ exportData,
4571
+ importMappings,
4572
+ createNew,
4573
+ parsed.autoMap
4574
+ );
4575
+ outputSingle(result2, ctx);
4576
+ }
4577
+ },
4578
+ {
4579
+ path: ["workspaces", "configuration-readiness"],
4580
+ description: "Check configuration health, post-import bindings, and skipped EventRules",
4581
+ requiresWorkspace: true,
4582
+ handler: async ({ ctx, workspace }) => {
4583
+ const client = requireAuth(ctx).apiClient;
4584
+ const [configurationHealth, importReadiness, skippedRules] = await Promise.all([
4585
+ client.getConfigurationHealth(workspace, { page: 1, pageSize: 100 }),
4586
+ client.getImportReadiness(workspace),
4587
+ client.getImportSkippedRules(workspace, "outstanding")
4588
+ ]);
4589
+ const failedChecks = configurationHealth.checks.filter(
4590
+ (check) => check.status !== "complete"
4591
+ );
4592
+ const configurationBlockers = configurationHealth.summary.critical + configurationHealth.summary.warning;
4593
+ const bindingBlockers = importReadiness.issues.length;
4594
+ const skippedRuleBlockers = skippedRules.rules.length;
4595
+ const incomplete = Boolean(importReadiness.truncated || skippedRules.truncated);
4596
+ const blockerDetails = {
4597
+ failedChecks: failedChecks.map((check) => ({
4598
+ checkSlug: check.checkSlug,
4599
+ status: check.status,
4600
+ issueCount: check.issueCount,
4601
+ failureCode: check.failureCode
4602
+ })),
4603
+ bindings: importReadiness.issues.map((issue) => ({
4604
+ code: issue.code,
4605
+ resourceType: issue.resourceType,
4606
+ resourceId: issue.resourceId,
4607
+ resourceUuid: issue.resourceUuid
4608
+ })),
4609
+ skippedRules: skippedRules.rules.map((rule) => ({
4610
+ uuid: rule.uuid,
4611
+ status: rule.status
4612
+ }))
4613
+ };
4614
+ outputSingle(
4615
+ {
4616
+ configurationReady: configurationBlockers === 0 && bindingBlockers === 0 && skippedRuleBlockers === 0 && failedChecks.length === 0 && !incomplete,
4617
+ blockerCounts: {
4618
+ configuration: configurationBlockers,
4619
+ binding: bindingBlockers,
4620
+ skippedRules: skippedRuleBlockers,
4621
+ failedChecks: failedChecks.length
4622
+ },
4623
+ incomplete,
4624
+ blockerDetails
4625
+ },
4626
+ ctx
4627
+ );
4628
+ }
4629
+ },
4630
+ // ---- Template re-apply (removed at Installable Definitions N8) ----
4631
+ {
4632
+ path: ["workspaces", "diff"],
4633
+ description: "Render the target server's plan for a template workspace",
4634
+ requiresWorkspace: true,
4635
+ args: [
4636
+ {
4637
+ name: "template",
4638
+ description: "Template workspace UUID to plan against this target",
4639
+ required: true
4640
+ }
4641
+ ],
4642
+ examples: [
4643
+ "gr workspaces diff --template $TEMPLATE_UUID -w $TARGET_UUID",
4644
+ "gr workspaces diff --template $TEMPLATE_UUID -w $TARGET_UUID -o json"
4645
+ ],
4646
+ handler: async (hctx) => {
4647
+ const ctx = requireAuth(hctx.ctx);
4648
+ const templateUuid = requireArg(hctx, "template");
4649
+ const client = ctx.apiClient;
4650
+ const archive = await exportTemplateArchive(client, templateUuid);
4651
+ const preview = await client.previewWorkspaceImportZip(
4652
+ hctx.workspace,
4653
+ archiveBlob(archive),
4654
+ { intent: "template_reapply" }
4655
+ );
4656
+ const projection = projectImportPlan(preview);
4657
+ emitReport(ctx, renderImportPlan(projection), projection);
4658
+ if (projection.blocked) {
4659
+ failCommand(
4660
+ `${projection.counts.refuse ?? 0} row(s) cannot be applied safely. Nothing may be written until each is resolved.`
4661
+ );
4662
+ }
4663
+ }
4664
+ },
4665
+ {
4666
+ path: ["workspaces", "reapply"],
4667
+ description: "Apply one template workspace to explicitly named targets",
4668
+ mutates: true,
4669
+ requiresWorkspace: false,
3845
4670
  args: [
3846
4671
  {
3847
- name: "create-all",
3848
- description: "Auto-generate createNew entries for all entities in the export data",
4672
+ name: "template",
4673
+ description: "Template workspace UUID to apply",
4674
+ required: true
4675
+ },
4676
+ {
4677
+ name: "target",
4678
+ description: "Target workspace UUID. Repeat the flag for each target; there is no fleet discovery.",
4679
+ required: true,
4680
+ repeatable: true
4681
+ },
4682
+ {
4683
+ name: "plan-only",
4684
+ description: "Render each target's plan and write nothing",
4685
+ isFlag: true
4686
+ },
4687
+ {
4688
+ name: "bindings-file",
4689
+ description: "Local JSON keyed by target workspace UUID, supplying that target's phone / inbox / Member / webhook endpoint / signing secret / active state. Values are sent in the request body and never printed."
4690
+ },
4691
+ {
4692
+ name: "yes",
4693
+ description: "Skip the per-target confirmation prompt",
3849
4694
  isFlag: true
3850
4695
  }
3851
4696
  ],
3852
- handler: async ({ ctx, workspace, data, args }) => {
3853
- if (!data) throw new CLIError("JSON data required (--data, --file, or stdin)");
3854
- const payload = data;
3855
- const createAll = args["create-all"] === true;
3856
- let exportData;
3857
- let importMappings;
3858
- let createNew;
3859
- if (payload.exportData && typeof payload.exportData === "object") {
3860
- exportData = payload.exportData;
3861
- importMappings = payload.importMappings ?? {};
3862
- createNew = payload.createNew ?? {};
3863
- } else if (payload.version && payload.workflows) {
3864
- exportData = payload;
3865
- importMappings = {};
3866
- createNew = {};
3867
- } else {
3868
- throw new CLIError(
3869
- 'Unrecognized data format. Provide either raw export data (from "workspaces export") or a full import payload with {exportData, importMappings, createNew}.'
4697
+ examples: [
4698
+ "gr workspaces reapply --template $TEMPLATE_UUID --target $A --target $B --plan-only",
4699
+ "gr workspaces reapply --template $TEMPLATE_UUID --target $A --bindings-file ./bindings.json"
4700
+ ],
4701
+ handler: async (hctx) => {
4702
+ const ctx = requireAuth(hctx.ctx);
4703
+ const templateUuid = requireArg(hctx, "template");
4704
+ const targets = repeatedValues(hctx.args, "target");
4705
+ if (targets.length === 0) {
4706
+ throw new CLIError("Missing required argument: --target <workspace-uuid>");
4707
+ }
4708
+ const duplicate = targets.find((uuid, index) => targets.indexOf(uuid) !== index);
4709
+ if (duplicate) {
4710
+ throw new CLIError(`--target ${duplicate} was given more than once.`);
4711
+ }
4712
+ const planOnly = hctx.args["plan-only"] === true;
4713
+ const bindings = await readBindingsFile(
4714
+ hctx.args["bindings-file"],
4715
+ targets
4716
+ );
4717
+ const client = ctx.apiClient;
4718
+ const archive = await exportTemplateArchive(client, templateUuid);
4719
+ const results = [];
4720
+ for (const targetUuid of targets) {
4721
+ results.push(
4722
+ await reapplyOneTarget(ctx, client, {
4723
+ archive,
4724
+ targetUuid,
4725
+ bindings: bindingsForTarget(bindings, targetUuid),
4726
+ planOnly,
4727
+ autoConfirm: hctx.args.yes === true
4728
+ })
3870
4729
  );
3871
4730
  }
3872
- if (createAll) {
3873
- const entityKeys = [
3874
- "workflows",
3875
- "tasks",
3876
- "dataTypes",
3877
- "agents",
3878
- "memberLabels",
3879
- "files",
3880
- "eventRules",
3881
- "memberRoles",
3882
- "phoneNumbers",
3883
- "sites",
3884
- "inboxes",
3885
- "routines",
3886
- "memberFilters",
3887
- "customToolkits",
3888
- "customTools",
3889
- "pages",
3890
- "menuItems",
3891
- "mcpServers",
3892
- "fileFolders",
3893
- "fileLabels",
3894
- "workflowNotes",
3895
- "abilities",
3896
- "qualifications",
3897
- "chatLabels",
3898
- "chatFilters",
3899
- "chatFilterRules",
3900
- "calendars",
3901
- "calendarEventTypes",
3902
- "calendarSchedules",
3903
- "journeys"
3904
- ];
3905
- for (const key of entityKeys) {
3906
- const entities = exportData[key];
3907
- if (Array.isArray(entities)) {
3908
- createNew[key] = entities.map((e) => e.uuid).filter(Boolean);
3909
- }
4731
+ const summary = {
4732
+ template: templateUuid,
4733
+ planOnly,
4734
+ targets: results,
4735
+ counts: {
4736
+ applied: results.filter((r) => r.status === "applied").length,
4737
+ noop: results.filter((r) => r.status === "noop").length,
4738
+ planned: results.filter((r) => r.status === "planned").length,
4739
+ skipped: results.filter((r) => r.status === "skipped").length,
4740
+ refused: results.filter((r) => r.status === "refused").length,
4741
+ failed: results.filter((r) => r.status === "failed").length
3910
4742
  }
4743
+ };
4744
+ emitReport(ctx, renderReapplySummary(summary), summary);
4745
+ if (summary.counts.refused > 0 || summary.counts.failed > 0 || summary.counts.skipped > 0) {
4746
+ failCommand(
4747
+ `${summary.counts.refused} target(s) refused, ${summary.counts.failed} failed and ${summary.counts.skipped} not confirmed. Each target is independent; the rest were processed.`
4748
+ );
4749
+ }
4750
+ }
4751
+ },
4752
+ {
4753
+ path: ["workspaces", "readiness"],
4754
+ description: "Report server-owned import readiness and outstanding skipped EventRules",
4755
+ requiresWorkspace: true,
4756
+ examples: ["gr workspaces readiness -w $TARGET_UUID"],
4757
+ handler: async (hctx) => {
4758
+ const ctx = requireAuth(hctx.ctx);
4759
+ const client = ctx.apiClient;
4760
+ const readiness = await client.getImportReadiness(hctx.workspace);
4761
+ const skipped = await client.getImportSkippedRules(hctx.workspace, "outstanding");
4762
+ const projection = projectReadiness(readiness, skipped);
4763
+ emitReport(ctx, renderReadiness(projection), projection);
4764
+ if (readinessIsIncomplete(projection)) {
4765
+ failCommand(
4766
+ "The readiness report is incomplete (truncated). It cannot establish that this workspace is ready."
4767
+ );
4768
+ return;
4769
+ }
4770
+ if (projection.issues.length > 0 || projection.outstandingGroups.length > 0) {
4771
+ failCommand(
4772
+ `${projection.issues.length} readiness issue(s) and ${projection.outstandingGroups.length} outstanding skipped-rule group(s) need attention.`
4773
+ );
3911
4774
  }
3912
- const result2 = await requireAuth(ctx).apiClient.previewImportWorkspace(
3913
- workspace,
3914
- exportData,
3915
- importMappings,
3916
- createNew
3917
- );
3918
- outputSingle(result2, ctx);
3919
4775
  }
3920
4776
  },
3921
4777
  // Features
@@ -4586,6 +5442,107 @@ var calendarsDomain = {
4586
5442
  ]
4587
5443
  };
4588
5444
 
5445
+ // src/domains/data-type-schema.ts
5446
+ function counter(args, key, minimum = 0) {
5447
+ const value = requireNumber(args, key);
5448
+ if (!Number.isSafeInteger(value) || value < minimum) {
5449
+ throw new Error(`--${key} must be an integer of at least ${minimum}`);
5450
+ }
5451
+ return value;
5452
+ }
5453
+ var idArg = { name: "id", description: "Form ID", required: true };
5454
+ var expectedArgs = [
5455
+ {
5456
+ name: "expected-version",
5457
+ description: "Published version from schema draft get",
5458
+ required: true
5459
+ },
5460
+ {
5461
+ name: "expected-draft-generation",
5462
+ description: "Draft generation from schema draft get",
5463
+ required: true
5464
+ }
5465
+ ];
5466
+ var expected = (args) => ({
5467
+ expectedVersion: counter(args, "expected-version"),
5468
+ expectedDraftGeneration: counter(args, "expected-draft-generation")
5469
+ });
5470
+ var dataTypeSchemaCommands = [
5471
+ {
5472
+ path: ["data-types", "schema", "draft", "get"],
5473
+ description: "Read the saved schema draft and concurrency counters (does not enable versioning)",
5474
+ requiresWorkspace: true,
5475
+ args: [idArg],
5476
+ handler: async ({ ctx, workspace, args }) => {
5477
+ outputSingle(
5478
+ await requireAuth(ctx).apiClient.getDataTypeDraft(workspace, counter(args, "id", 1)),
5479
+ ctx
5480
+ );
5481
+ }
5482
+ },
5483
+ {
5484
+ path: ["data-types", "schema", "draft", "save"],
5485
+ description: 'Save a complete schema draft from --file JSON {"fields": [...]}, without publishing. First save enables versioning; do not enable connector-managed Forms until their schema writer supports drafts.',
5486
+ mutates: true,
5487
+ requiresWorkspace: true,
5488
+ args: [idArg, ...expectedArgs],
5489
+ handler: async ({ ctx, workspace, args, data }) => {
5490
+ if (!data || typeof data !== "object" || !("fields" in data) || !Array.isArray(data.fields)) {
5491
+ throw new Error("Provide --file JSON with a fields array");
5492
+ }
5493
+ outputSingle(
5494
+ await requireAuth(ctx).apiClient.saveDataTypeDraft(workspace, counter(args, "id", 1), {
5495
+ ...expected(args),
5496
+ fields: data.fields
5497
+ }),
5498
+ ctx
5499
+ );
5500
+ }
5501
+ },
5502
+ {
5503
+ path: ["data-types", "schema", "publish"],
5504
+ description: "Publish the saved draft using its exact expected counters. Conflicts require explicit reload and reconciliation.",
5505
+ mutates: true,
5506
+ requiresWorkspace: true,
5507
+ args: [idArg, ...expectedArgs],
5508
+ handler: async ({ ctx, workspace, args }) => {
5509
+ outputSingle(
5510
+ await requireAuth(ctx).apiClient.publishDataTypeDraft(
5511
+ workspace,
5512
+ counter(args, "id", 1),
5513
+ expected(args)
5514
+ ),
5515
+ ctx
5516
+ );
5517
+ }
5518
+ },
5519
+ {
5520
+ path: ["data-types", "schema", "versions"],
5521
+ description: "Read immutable schema history, newest first. Use the last version as --before-version.",
5522
+ requiresWorkspace: true,
5523
+ args: [
5524
+ idArg,
5525
+ { name: "before-version", description: "Exclusive version cursor" },
5526
+ { name: "limit", description: "Page size (1\u2013100, default 25)" }
5527
+ ],
5528
+ handler: async ({ ctx, workspace, args }) => {
5529
+ const limit = args.limit === void 0 ? 25 : counter(args, "limit", 1);
5530
+ if (limit > 100) throw new Error("--limit must not exceed 100");
5531
+ outputSingle(
5532
+ await requireAuth(ctx).apiClient.getDataTypeVersions(
5533
+ workspace,
5534
+ counter(args, "id", 1),
5535
+ {
5536
+ limit,
5537
+ ...args["before-version"] !== void 0 ? { beforeVersion: counter(args, "before-version", 1) } : {}
5538
+ }
5539
+ ),
5540
+ ctx
5541
+ );
5542
+ }
5543
+ }
5544
+ ];
5545
+
4589
5546
  // src/domains/data-types.ts
4590
5547
  var COLUMNS9 = [
4591
5548
  COL.id(),
@@ -4630,6 +5587,7 @@ var dataTypesDomain = {
4630
5587
  name: "data-types",
4631
5588
  description: "Manage data types and records",
4632
5589
  commands: [
5590
+ ...dataTypeSchemaCommands,
4633
5591
  ...crudCommands({
4634
5592
  prefix: ["data-types"],
4635
5593
  entityName: "data type",
@@ -4824,123 +5782,6 @@ ${DATA_TYPE_FIELD_REFERENCE}`
4824
5782
  ]
4825
5783
  };
4826
5784
 
4827
- // src/domains/devices.ts
4828
- var DEVICE_COLUMNS = [
4829
- { header: "UUID", getValue: (item) => item.uuid ?? "" },
4830
- { header: "NAME", getValue: (item) => item.displayName ?? "" },
4831
- { header: "KIND", getValue: (item) => item.kindName ?? "" },
4832
- { header: "SLUG", getValue: (item) => item.slug ?? "" },
4833
- { header: "MEMBER", getValue: (item) => String(item.memberId ?? "") },
4834
- { header: "REVOKED", getValue: (item) => item.isRevoked ? "yes" : "" },
4835
- { header: "LAST SEEN", getValue: (item) => item.lastSeenAt ?? "" },
4836
- { header: "FIRMWARE", getValue: (item) => item.firmwareVersion ?? "" }
4837
- ];
4838
- var KIND_COLUMNS = [
4839
- { header: "SLUG", getValue: (item) => item.slug ?? "" },
4840
- { header: "NAME", getValue: (item) => item.name ?? "" },
4841
- { header: "FAMILY", getValue: (item) => item.family ?? "" }
4842
- ];
4843
- var devicesDomain = {
4844
- name: "devices",
4845
- description: "Registered devices: list, inspect, rename, revoke, claim pairing",
4846
- commands: [
4847
- {
4848
- path: ["devices", "list"],
4849
- description: "List registered devices (all with devices:admin; --mine for the session member\u2019s own)",
4850
- requiresWorkspace: true,
4851
- args: [
4852
- {
4853
- name: "mine",
4854
- description: "Only the session member\u2019s own devices",
4855
- isFlag: true
4856
- }
4857
- ],
4858
- examples: ["gr devices list -w $WID", "gr devices list -w $WID --mine"],
4859
- handler: async ({ ctx, workspace, args }) => {
4860
- const auth = requireAuth(ctx);
4861
- const result2 = await auth.apiClient.getDevices(workspace, {
4862
- mine: args.mine === true
4863
- });
4864
- outputData(result2, ctx, DEVICE_COLUMNS);
4865
- }
4866
- },
4867
- {
4868
- path: ["devices", "get"],
4869
- description: "Show one device",
4870
- requiresWorkspace: true,
4871
- args: [{ name: "uuid", description: "Device UUID", required: true }],
4872
- handler: async ({ ctx, workspace, args }) => {
4873
- const auth = requireAuth(ctx);
4874
- const result2 = await auth.apiClient.getDevice(workspace, requireString(args, "uuid"));
4875
- outputSingle(result2, ctx, DEVICE_COLUMNS);
4876
- }
4877
- },
4878
- {
4879
- path: ["devices", "kinds"],
4880
- description: "List the device catalog (kinds a device can register as)",
4881
- requiresWorkspace: true,
4882
- handler: async ({ ctx, workspace }) => {
4883
- const auth = requireAuth(ctx);
4884
- const result2 = await auth.apiClient.getDeviceKinds(workspace);
4885
- outputData(result2, ctx, KIND_COLUMNS);
4886
- }
4887
- },
4888
- {
4889
- path: ["devices", "update"],
4890
- description: "Update a device (displayName, lanReceive, lanBroadcast)",
4891
- mutates: true,
4892
- requiresWorkspace: true,
4893
- args: [{ name: "uuid", description: "Device UUID", required: true }],
4894
- examples: [
4895
- `gr devices update -w $WID --uuid $UUID --data '{"displayName":"Kitchen Lantern"}' --allow-write`
4896
- ],
4897
- handler: async ({ ctx, workspace, args, data }) => {
4898
- const auth = requireAuth(ctx);
4899
- const result2 = await auth.apiClient.updateDevice(
4900
- workspace,
4901
- requireString(args, "uuid"),
4902
- data ?? {}
4903
- );
4904
- outputSingle(result2, ctx, DEVICE_COLUMNS);
4905
- }
4906
- },
4907
- {
4908
- path: ["devices", "revoke"],
4909
- description: "Revoke a device credential (the device must pair again)",
4910
- mutates: true,
4911
- requiresWorkspace: true,
4912
- args: [{ name: "uuid", description: "Device UUID", required: true }],
4913
- handler: async ({ ctx, workspace, args }) => {
4914
- const auth = requireAuth(ctx);
4915
- const result2 = await auth.apiClient.revokeDevice(
4916
- workspace,
4917
- requireString(args, "uuid")
4918
- );
4919
- outputSingle(result2, ctx, DEVICE_COLUMNS);
4920
- }
4921
- },
4922
- {
4923
- path: ["devices", "claim"],
4924
- description: "Claim a device pairing code (binds the device to the CLAIMING member \u2014 the normal self-service pairing flow)",
4925
- mutates: true,
4926
- requiresWorkspace: true,
4927
- args: [
4928
- { name: "code", description: "Pairing code shown on the device", required: true },
4929
- { name: "name", description: "Optional display name", required: false }
4930
- ],
4931
- handler: async ({ ctx, workspace, args }) => {
4932
- const auth = requireAuth(ctx);
4933
- const displayName = optionalString(args, "name");
4934
- const result2 = await auth.apiClient.claimDevicePairing(workspace, {
4935
- pairingCode: requireString(args, "code"),
4936
- ...displayName !== void 0 ? { displayName } : {}
4937
- });
4938
- outputSingle(result2, ctx, DEVICE_COLUMNS);
4939
- }
4940
- }
4941
- ]
4942
- };
4943
-
4944
5785
  // src/lib/events/action-params.ts
4945
5786
  var ACTION_PARAM_HINTS = {
4946
5787
  "chat:create": {
@@ -4986,7 +5827,7 @@ var ACTION_PARAM_HINTS = {
4986
5827
  ],
4987
5828
  notes: [
4988
5829
  "inboxUUID is required \u2014 list them with `gr inboxes list -w $WID`.",
4989
- 'Optional: toEmail, contentType ("text" default), initialUserMessage.'
5830
+ 'Optional: toEmail (one address or up to 20 comma-separated addresses), contentType ("text" default), initialUserMessage.'
4990
5831
  ]
4991
5832
  },
4992
5833
  "member:label": {
@@ -8918,136 +9759,1122 @@ var abilitiesDomain = {
8918
9759
  const result2 = await requireAuth(ctx).apiClient.updateAbility(workspace, uuid, {
8919
9760
  enabled: false
8920
9761
  });
8921
- outputSingle(result2, ctx, CONFIGURED_COLUMNS);
9762
+ outputSingle(result2, ctx, CONFIGURED_COLUMNS);
9763
+ }
9764
+ },
9765
+ {
9766
+ path: ["abilities", "configure"],
9767
+ description: "Update a configured ability by UUID.",
9768
+ mutates: true,
9769
+ requiresWorkspace: true,
9770
+ args: [
9771
+ { name: "uuid", description: "Configured ability UUID", required: true },
9772
+ { name: "enabled", description: "Set enabled state (true|false)" },
9773
+ {
9774
+ name: "allow-missing-connections",
9775
+ isFlag: true,
9776
+ description: "Allow enabling before required app connections are configured"
9777
+ }
9778
+ ],
9779
+ handler: async ({ ctx, workspace, args, data }) => {
9780
+ const uuid = args.uuid;
9781
+ if (typeof uuid !== "string") throw new CLIError("--uuid is required");
9782
+ const body = {};
9783
+ if (data && typeof data === "object") body.config = data;
9784
+ if (typeof args.enabled === "string") {
9785
+ if (args.enabled !== "true" && args.enabled !== "false") {
9786
+ throw new CLIError("--enabled must be true or false");
9787
+ }
9788
+ body.enabled = args.enabled === "true";
9789
+ if (args["allow-missing-connections"] === true) {
9790
+ body.allowMissingConnections = true;
9791
+ }
9792
+ }
9793
+ if (Object.keys(body).length === 0) {
9794
+ throw new CLIError("Nothing to update: provide --data config and/or --enabled");
9795
+ }
9796
+ const result2 = await requireAuth(ctx).apiClient.updateAbility(workspace, uuid, body);
9797
+ outputSingle(result2, ctx, CONFIGURED_COLUMNS);
9798
+ }
9799
+ },
9800
+ {
9801
+ path: ["abilities", "attached"],
9802
+ description: "List a task's task-specific abilities (excludes workflow-inherited).",
9803
+ requiresWorkspace: true,
9804
+ columns: ATTACHED_COLUMNS,
9805
+ args: [{ name: "task", description: "Task ID", required: true }],
9806
+ handler: async (hctx) => {
9807
+ const task = await requireAuth(hctx.ctx).apiClient.getTask(
9808
+ hctx.workspace,
9809
+ requireNumber(hctx.args, "task")
9810
+ );
9811
+ outputData(task.abilities ?? [], hctx.ctx, ATTACHED_COLUMNS);
9812
+ }
9813
+ },
9814
+ {
9815
+ path: ["abilities", "attach"],
9816
+ description: "Attach an ability to a task. Reads the task, appends the new ability (generating its uuid), and saves \u2014 so existing abilities aren't lost. Find slugs via 'gr abilities list' and the config schema via 'gr abilities get'.",
9817
+ mutates: true,
9818
+ requiresWorkspace: true,
9819
+ args: [
9820
+ { name: "task", description: "Task ID to attach to", required: true },
9821
+ {
9822
+ name: "type",
9823
+ aliases: ["ability-type", "slug"],
9824
+ description: "Ability type slug, e.g. 'integration:data_access'",
9825
+ required: true
9826
+ },
9827
+ {
9828
+ name: "config",
9829
+ description: `Ability config as a JSON object, e.g. '{"pauseOnEscalate":true}'`
9830
+ },
9831
+ { name: "cel", description: "Optional CEL activation condition" },
9832
+ {
9833
+ name: "disabled",
9834
+ description: "Attach in a disabled state (default: enabled)",
9835
+ isFlag: true
9836
+ }
9837
+ ],
9838
+ handler: async (hctx) => {
9839
+ const api = requireAuth(hctx.ctx).apiClient;
9840
+ const taskId = requireNumber(hctx.args, "task");
9841
+ const abilityType = hctx.args.type ?? hctx.args["ability-type"] ?? hctx.args.slug;
9842
+ if (!abilityType) throw new CLIError("--type is required (an ability type slug)");
9843
+ let config = {};
9844
+ if (hctx.args.config) {
9845
+ try {
9846
+ config = JSON.parse(hctx.args.config);
9847
+ } catch {
9848
+ throw new CLIError("--config must be a valid JSON object");
9849
+ }
9850
+ }
9851
+ const task = await api.getTask(hctx.workspace, taskId);
9852
+ const existing = (task.abilities ?? []).map(toAbilityData);
9853
+ const next = {
9854
+ uuid: randomUUID(),
9855
+ abilityType,
9856
+ config,
9857
+ enabled: hctx.args.disabled !== true,
9858
+ ...hctx.args.cel ? { celCondition: hctx.args.cel } : {}
9859
+ };
9860
+ const updated = await api.updateTask(hctx.workspace, taskId, {
9861
+ abilities: [...existing, next]
9862
+ });
9863
+ outputData(updated.abilities ?? [], hctx.ctx, ATTACHED_COLUMNS);
8922
9864
  }
8923
9865
  },
8924
9866
  {
8925
- path: ["abilities", "configure"],
8926
- description: "Update a configured ability by UUID.",
9867
+ path: ["abilities", "detach"],
9868
+ description: "Detach an ability from a task by its uuid (from `gr abilities attached`). Re-saves the remaining task-specific abilities so the rest are preserved.",
8927
9869
  mutates: true,
8928
9870
  requiresWorkspace: true,
8929
9871
  args: [
8930
- { name: "uuid", description: "Configured ability UUID", required: true },
8931
- { name: "enabled", description: "Set enabled state (true|false)" },
8932
- {
8933
- name: "allow-missing-connections",
8934
- isFlag: true,
8935
- description: "Allow enabling before required app connections are configured"
8936
- }
9872
+ { name: "task", description: "Task ID", required: true },
9873
+ { name: "uuid", description: "UUID of the attached ability to remove", required: true }
8937
9874
  ],
8938
- handler: async ({ ctx, workspace, args, data }) => {
8939
- const uuid = args.uuid;
8940
- if (typeof uuid !== "string") throw new CLIError("--uuid is required");
8941
- const body = {};
8942
- if (data && typeof data === "object") body.config = data;
8943
- if (typeof args.enabled === "string") {
8944
- if (args.enabled !== "true" && args.enabled !== "false") {
8945
- throw new CLIError("--enabled must be true or false");
8946
- }
8947
- body.enabled = args.enabled === "true";
8948
- if (args["allow-missing-connections"] === true) {
8949
- body.allowMissingConnections = true;
8950
- }
8951
- }
8952
- if (Object.keys(body).length === 0) {
8953
- throw new CLIError("Nothing to update: provide --data config and/or --enabled");
9875
+ handler: async (hctx) => {
9876
+ const api = requireAuth(hctx.ctx).apiClient;
9877
+ const taskId = requireNumber(hctx.args, "task");
9878
+ const uuid = hctx.args.uuid;
9879
+ if (!uuid) throw new CLIError("--uuid is required");
9880
+ const task = await api.getTask(hctx.workspace, taskId);
9881
+ const existing = task.abilities ?? [];
9882
+ const remaining = existing.filter((a) => a.uuid !== uuid).map(toAbilityData);
9883
+ if (remaining.length === existing.length) {
9884
+ throw new CLIError(`No attached ability with uuid '${uuid}' on task ${taskId}`);
8954
9885
  }
8955
- const result2 = await requireAuth(ctx).apiClient.updateAbility(workspace, uuid, body);
8956
- outputSingle(result2, ctx, CONFIGURED_COLUMNS);
9886
+ const updated = await api.updateTask(hctx.workspace, taskId, {
9887
+ abilities: remaining
9888
+ });
9889
+ outputData(updated.abilities ?? [], hctx.ctx, ATTACHED_COLUMNS);
8957
9890
  }
8958
- },
9891
+ }
9892
+ ]
9893
+ };
9894
+
9895
+ // src/lib/activity-query.ts
9896
+ import {
9897
+ ActivityGrain,
9898
+ ActivityGroupBy,
9899
+ ActivityOpenItemOrder,
9900
+ ActivityEventType,
9901
+ ActivityWindowBasis,
9902
+ EntityKind
9903
+ } from "@gravity-rail/sdk";
9904
+ var DEFAULT_WINDOW_DAYS = 30;
9905
+ var ACTIVITY_MOUNT_ARGS = [
9906
+ {
9907
+ name: "org-uuid",
9908
+ aliases: ["org"],
9909
+ description: "Answer from the org mount (organization UUID)"
9910
+ },
9911
+ {
9912
+ name: "workspace",
9913
+ alias: "w",
9914
+ description: "Answer from the workspace mount (workspace UUID)"
9915
+ }
9916
+ ];
9917
+ var SCOPE_ARGS = [
9918
+ {
9919
+ name: "scope-workspace",
9920
+ description: "Narrow to these workspace UUIDs (comma-separated); intersected, never widening"
9921
+ },
9922
+ {
9923
+ name: "scope-org",
9924
+ description: "Narrow to these org UUIDs (comma-separated); intersected, never widening"
9925
+ }
9926
+ ];
9927
+ var WINDOW_ARGS = [
9928
+ { name: "from", description: "Window start, inclusive (ISO-8601 or YYYY-MM-DD, UTC midnight)" },
9929
+ { name: "to", description: "Window end, exclusive (ISO-8601 or YYYY-MM-DD, UTC midnight)" },
9930
+ {
9931
+ name: "last",
9932
+ description: `Relative window ending now, e.g. 24h, 7d, 3mo (default: ${DEFAULT_WINDOW_DAYS}d)`
9933
+ },
9934
+ {
9935
+ name: "window-basis",
9936
+ // Server-issued, and listed anyway: a printed drill command carries it,
9937
+ // and a flag a pasted command contains but `--help` does not name reads
9938
+ // as a typo. Typing it by hand is legal and almost never wanted.
9939
+ description: "absolute | workspace_local \u2014 whose clock --from/--to are in (default: absolute; drill commands carry workspace_local)"
9940
+ }
9941
+ ];
9942
+ var RESOLUTION_ARGS = [
9943
+ {
9944
+ name: "ids",
9945
+ isFlag: true,
9946
+ description: "Print bare kind:uuid refs and make zero hydration calls"
9947
+ }
9948
+ ];
9949
+ var ACTIVITY_QUERY_ARGS = [
9950
+ ...ACTIVITY_MOUNT_ARGS,
9951
+ ...WINDOW_ARGS,
9952
+ {
9953
+ name: "grain",
9954
+ // The ladder, coarsest first, so `--help` reads the way a drill does.
9955
+ // Weeks start on SUNDAY, matching every calendar surface in the product.
9956
+ description: "month | week | day | hour | event (server default: day)"
9957
+ },
9958
+ { name: "group-by", description: "workspace | event_type (server default: event_type)" },
9959
+ { name: "types", description: "Event types to include (comma-separated)" },
9960
+ {
9961
+ name: "subject",
9962
+ description: "Narrow to one entity, as kind:uuid (implies --grain event)"
9963
+ },
9964
+ ...SCOPE_ARGS,
9965
+ { name: "cursor", description: "Opaque cursor from a previous page (sent back unchanged)" },
9966
+ { name: "page-size", description: "Rows per page, 1-200" },
9967
+ ...RESOLUTION_ARGS
9968
+ ];
9969
+ var ACTIVITY_OPEN_ITEMS_ARGS = [
9970
+ ...ACTIVITY_MOUNT_ARGS,
9971
+ { name: "order", description: "priority | recency (server default: priority)" },
9972
+ { name: "kinds", description: "Open-item kinds to include (comma-separated)" },
9973
+ { name: "assigned-to-me", isFlag: true, description: "Only items assigned directly to you" },
9974
+ {
9975
+ name: "point-person",
9976
+ isFlag: true,
9977
+ description: "Only items whose subject member you are point person for"
9978
+ },
9979
+ ...SCOPE_ARGS,
9980
+ { name: "page-size", description: "Rows to show, 1-200" },
9981
+ ...RESOLUTION_ARGS
9982
+ ];
9983
+ var ACTIVITY_COUNTS_ARGS = [
9984
+ ...ACTIVITY_MOUNT_ARGS,
9985
+ ...WINDOW_ARGS,
9986
+ { name: "types", description: "Event types to count (comma-separated)" },
9987
+ ...SCOPE_ARGS,
9988
+ {
9989
+ name: "no-open-items",
9990
+ isFlag: true,
9991
+ description: "Skip the open-items badge count"
9992
+ }
9993
+ ];
9994
+ function optional(args, name) {
9995
+ const raw = args[name];
9996
+ if (typeof raw !== "string" || raw === "") return void 0;
9997
+ return raw;
9998
+ }
9999
+ function resolveActivityMount(args) {
10000
+ const org = optional(args, "org-uuid") ?? optional(args, "org");
10001
+ const workspace = optional(args, "workspace") ?? optional(args, "w");
10002
+ if (org && workspace) {
10003
+ throw new CLIError("Pass --org or --workspace, not both \u2014 they select different mounts");
10004
+ }
10005
+ if (org) return { kind: "org", uuid: org };
10006
+ if (workspace) return { kind: "workspace", uuid: workspace };
10007
+ return { kind: "account" };
10008
+ }
10009
+ function mountFlags(mount) {
10010
+ switch (mount.kind) {
10011
+ case "account":
10012
+ return [];
10013
+ case "org":
10014
+ return ["--org", mount.uuid];
10015
+ case "workspace":
10016
+ return ["--workspace", mount.uuid];
10017
+ }
10018
+ }
10019
+ function describeMount(mount) {
10020
+ return mount.kind === "account" ? "account" : `${mount.kind} ${mount.uuid}`;
10021
+ }
10022
+ var RELATIVE_WINDOW = /^(\d+)(h|d|w|mo)$/;
10023
+ var RELATIVE_MS = {
10024
+ h: 60 * 60 * 1e3,
10025
+ d: 24 * 60 * 60 * 1e3,
10026
+ w: 7 * 24 * 60 * 60 * 1e3,
10027
+ mo: 30 * 24 * 60 * 60 * 1e3
10028
+ };
10029
+ function normalizeInstant(raw, flag) {
10030
+ if (/^\d{4}-\d{2}-\d{2}$/.test(raw)) return `${raw}T00:00:00Z`;
10031
+ if (Number.isNaN(Date.parse(raw))) {
10032
+ throw new CLIError(`--${flag} must be ISO-8601 (2026-08-01T00:00:00Z) or YYYY-MM-DD`);
10033
+ }
10034
+ if (!/(Z|[+-]\d{2}:?\d{2})$/.test(raw)) {
10035
+ throw new CLIError(
10036
+ `--${flag} needs a timezone: append Z for UTC, or an offset like -07:00. At aggregate grains the offset chooses the local calendar label.`
10037
+ );
10038
+ }
10039
+ return raw;
10040
+ }
10041
+ function buildWindow(args, now = /* @__PURE__ */ new Date()) {
10042
+ const from = optional(args, "from");
10043
+ const to = optional(args, "to");
10044
+ const last = optional(args, "last");
10045
+ if (last && (from || to)) {
10046
+ throw new CLIError("Pass --last or --from/--to, not both");
10047
+ }
10048
+ const basis = parseEnum(args, "window-basis", ActivityWindowBasis);
10049
+ const explicitFrom = from ? normalizeInstant(from, "from") : void 0;
10050
+ const explicitTo = to ? normalizeInstant(to, "to") : void 0;
10051
+ if (explicitFrom && explicitTo) {
10052
+ return withBasis({ occurredFrom: explicitFrom, occurredBefore: explicitTo }, basis);
10053
+ }
10054
+ const end = explicitTo ? new Date(explicitTo) : now;
10055
+ let spanMs = DEFAULT_WINDOW_DAYS * RELATIVE_MS.d;
10056
+ if (last) {
10057
+ const match = RELATIVE_WINDOW.exec(last);
10058
+ if (!match) {
10059
+ throw new CLIError("--last must look like 24h, 7d, 2w or 3mo");
10060
+ }
10061
+ spanMs = Number(match[1]) * RELATIVE_MS[match[2]];
10062
+ if (spanMs === 0) throw new CLIError("--last must be a non-zero duration");
10063
+ }
10064
+ const start = explicitFrom ? new Date(explicitFrom) : new Date(end.getTime() - spanMs);
10065
+ return withBasis(
8959
10066
  {
8960
- path: ["abilities", "attached"],
8961
- description: "List a task's task-specific abilities (excludes workflow-inherited).",
8962
- requiresWorkspace: true,
8963
- columns: ATTACHED_COLUMNS,
8964
- args: [{ name: "task", description: "Task ID", required: true }],
8965
- handler: async (hctx) => {
8966
- const task = await requireAuth(hctx.ctx).apiClient.getTask(
8967
- hctx.workspace,
8968
- requireNumber(hctx.args, "task")
8969
- );
8970
- outputData(task.abilities ?? [], hctx.ctx, ATTACHED_COLUMNS);
10067
+ occurredFrom: explicitFrom ?? start.toISOString(),
10068
+ occurredBefore: explicitTo ?? end.toISOString()
10069
+ },
10070
+ basis
10071
+ );
10072
+ }
10073
+ function withBasis(window, basis) {
10074
+ return basis ? { ...window, basis } : window;
10075
+ }
10076
+ function parseCsv(raw) {
10077
+ if (!raw) return [];
10078
+ return raw.split(",").map((value) => value.trim()).filter((value) => value.length > 0);
10079
+ }
10080
+ var EVENT_TYPE_VALUES = Object.values(ActivityEventType);
10081
+ var ENTITY_KIND_VALUES = Object.values(EntityKind);
10082
+ function activityEventTypes() {
10083
+ return [...EVENT_TYPE_VALUES].sort();
10084
+ }
10085
+ function parseEventTypes(args) {
10086
+ const requested = parseCsv(optional(args, "types"));
10087
+ const unknown = requested.filter((value) => !EVENT_TYPE_VALUES.includes(value));
10088
+ if (unknown.length > 0) {
10089
+ throw new CLIError(
10090
+ `Unknown event type(s): ${unknown.join(", ")}. Run \`gr activity event-types\` for the closed vocabulary.`
10091
+ );
10092
+ }
10093
+ return requested;
10094
+ }
10095
+ function parseSubject(args) {
10096
+ const raw = optional(args, "subject");
10097
+ if (!raw) return void 0;
10098
+ const separator = raw.indexOf(":");
10099
+ if (separator <= 0) {
10100
+ throw new CLIError("--subject must be kind:uuid, e.g. member:8f1c\u2026");
10101
+ }
10102
+ const kind = raw.slice(0, separator);
10103
+ const uuid = raw.slice(separator + 1);
10104
+ if (!ENTITY_KIND_VALUES.includes(kind)) {
10105
+ throw new CLIError(
10106
+ `Unknown subject kind "${kind}". Known kinds: ${[...ENTITY_KIND_VALUES].sort().join(", ")}`
10107
+ );
10108
+ }
10109
+ if (!uuid) throw new CLIError("--subject must be kind:uuid, e.g. member:8f1c\u2026");
10110
+ return { kind, uuid };
10111
+ }
10112
+ function parseScope(args) {
10113
+ const workspaceUuids = parseCsv(optional(args, "scope-workspace"));
10114
+ const orgUuids = parseCsv(optional(args, "scope-org"));
10115
+ if (workspaceUuids.length === 0 && orgUuids.length === 0) return void 0;
10116
+ const scope = {};
10117
+ if (workspaceUuids.length > 0) scope.workspaceUuids = workspaceUuids;
10118
+ if (orgUuids.length > 0) scope.orgUuids = orgUuids;
10119
+ return scope;
10120
+ }
10121
+ function parsePageSize(args) {
10122
+ const raw = optional(args, "page-size");
10123
+ if (raw === void 0) return void 0;
10124
+ const value = Number(raw);
10125
+ if (!Number.isInteger(value) || value < 1 || value > 200) {
10126
+ throw new CLIError("--page-size must be an integer between 1 and 200");
10127
+ }
10128
+ return value;
10129
+ }
10130
+ function parseEnum(args, flag, allowed) {
10131
+ const raw = optional(args, flag);
10132
+ if (raw === void 0) return void 0;
10133
+ const values = Object.values(allowed);
10134
+ if (!values.includes(raw)) {
10135
+ throw new CLIError(`--${flag} must be one of: ${values.join(" | ")}`);
10136
+ }
10137
+ return raw;
10138
+ }
10139
+ function buildQueryRequest(args, now) {
10140
+ const request = { window: buildWindow(args, now) };
10141
+ const grain = parseEnum(args, "grain", ActivityGrain);
10142
+ if (grain) request.grain = grain;
10143
+ const groupBy = parseEnum(args, "group-by", ActivityGroupBy);
10144
+ if (groupBy) request.groupBy = groupBy;
10145
+ const eventTypes = parseEventTypes(args);
10146
+ if (eventTypes.length > 0) request.eventTypes = eventTypes;
10147
+ const subject = parseSubject(args);
10148
+ if (subject) {
10149
+ request.subject = subject;
10150
+ if (!request.grain) request.grain = ActivityGrain.event;
10151
+ }
10152
+ const scope = parseScope(args);
10153
+ if (scope) request.scope = scope;
10154
+ const cursor = optional(args, "cursor");
10155
+ if (cursor) request.cursor = cursor;
10156
+ const pageSize = parsePageSize(args);
10157
+ if (pageSize !== void 0) request.pageSize = pageSize;
10158
+ return request;
10159
+ }
10160
+ function buildOpenItemsRequest(args) {
10161
+ const request = {};
10162
+ const order = parseEnum(args, "order", ActivityOpenItemOrder);
10163
+ if (order) request.order = order;
10164
+ const kinds = parseCsv(optional(args, "kinds"));
10165
+ if (kinds.length > 0) request.kinds = kinds;
10166
+ const scope = parseScope(args);
10167
+ if (scope) request.scope = scope;
10168
+ if (args["assigned-to-me"] === true) request.assignedToMe = true;
10169
+ if (args["point-person"] === true) request.pointPerson = true;
10170
+ const pageSize = parsePageSize(args);
10171
+ if (pageSize !== void 0) request.pageSize = pageSize;
10172
+ return request;
10173
+ }
10174
+ function buildCountsRequest(args, now) {
10175
+ const request = { window: buildWindow(args, now) };
10176
+ const eventTypes = parseEventTypes(args);
10177
+ if (eventTypes.length > 0) request.eventTypes = eventTypes;
10178
+ const scope = parseScope(args);
10179
+ if (scope) request.scope = scope;
10180
+ if (args["no-open-items"] === true) request.includeOpenItems = false;
10181
+ return request;
10182
+ }
10183
+ function shellArg(value) {
10184
+ return /^[A-Za-z0-9_@%+=:,./-]+$/.test(value) ? value : `'${value.replace(/'/g, `'\\''`)}'`;
10185
+ }
10186
+ function renderQueryCommand(mount, request, options = {}) {
10187
+ const program = options.binary ?? "gr";
10188
+ const parts = ["activity", "query", ...mountFlags(mount)];
10189
+ parts.push("--from", request.window.occurredFrom, "--to", request.window.occurredBefore);
10190
+ if (request.window.basis) parts.push("--window-basis", request.window.basis);
10191
+ if (request.grain) parts.push("--grain", request.grain);
10192
+ if (request.groupBy) parts.push("--group-by", request.groupBy);
10193
+ if (request.eventTypes && request.eventTypes.length > 0) {
10194
+ parts.push("--types", request.eventTypes.join(","));
10195
+ }
10196
+ if (request.subject) parts.push("--subject", `${request.subject.kind}:${request.subject.uuid}`);
10197
+ if (request.scope?.workspaceUuids && request.scope.workspaceUuids.length > 0) {
10198
+ parts.push("--scope-workspace", request.scope.workspaceUuids.join(","));
10199
+ }
10200
+ if (request.scope?.orgUuids && request.scope.orgUuids.length > 0) {
10201
+ parts.push("--scope-org", request.scope.orgUuids.join(","));
10202
+ }
10203
+ if (request.cursor) parts.push("--cursor", request.cursor);
10204
+ if (request.pageSize !== void 0) parts.push("--page-size", String(request.pageSize));
10205
+ if (options.ids) parts.push("--ids");
10206
+ if (options.globals) parts.push(...options.globals);
10207
+ return [program, ...parts.map(shellArg)].join(" ");
10208
+ }
10209
+
10210
+ // src/lib/activity-refs.ts
10211
+ import { ApiError } from "@gravity-rail/sdk";
10212
+ var BATCH_RESOLVABLE = /* @__PURE__ */ new Set([
10213
+ "agent",
10214
+ "assignment",
10215
+ "call",
10216
+ "chat",
10217
+ "connection",
10218
+ "data_type",
10219
+ "escalation",
10220
+ "inbox",
10221
+ "journey",
10222
+ "journey_step",
10223
+ "member",
10224
+ "member_label",
10225
+ "operator_group",
10226
+ "phone_number",
10227
+ "routine",
10228
+ "task",
10229
+ "voicemail",
10230
+ "workflow",
10231
+ "workflow_revision"
10232
+ ]);
10233
+ var NO_UUID_LOOKUP = /* @__PURE__ */ new Set([
10234
+ "account",
10235
+ "org_account",
10236
+ "subscription",
10237
+ "member_subscription",
10238
+ "purchase",
10239
+ "import",
10240
+ "invoice",
10241
+ "workspace_config"
10242
+ ]);
10243
+ var HYDRATORS = {
10244
+ workspace: async ({ client }, ref) => (await client.getWorkspace(ref.uuid)).name,
10245
+ org: async ({ orgNames }, ref) => (await orgNames()).get(ref.uuid),
10246
+ workflow: async ({ client }, ref) => {
10247
+ const detail = await client.getWorkflow(requireWorkspace(ref), ref.uuid);
10248
+ return detail.workflow?.name;
10249
+ },
10250
+ task: async ({ client }, ref) => (await client.getTask(requireWorkspace(ref), ref.uuid)).name,
10251
+ data_type: async ({ client }, ref) => (await client.getDataTypeByUuid(requireWorkspace(ref), ref.uuid)).name,
10252
+ member_label: async ({ client }, ref) => (await client.getMemberLabelByUuid(requireWorkspace(ref), ref.uuid)).name,
10253
+ inbox: async ({ client }, ref) => (await client.getInbox(requireWorkspace(ref), ref.uuid)).name,
10254
+ phone_number: async ({ client }, ref) => {
10255
+ const phoneNumber = await client.getPhoneNumber(requireWorkspace(ref), ref.uuid);
10256
+ return phoneNumber.name || phoneNumber.number;
10257
+ },
10258
+ domain: async ({ client }, ref) => {
10259
+ if (!ref.orgUuid) return null;
10260
+ return (await client.getOrgDomain(ref.orgUuid, ref.uuid)).domain;
10261
+ }
10262
+ };
10263
+ var MissingScopeError = class extends Error {
10264
+ };
10265
+ function requireWorkspace(ref) {
10266
+ if (!ref.workspaceUuid) {
10267
+ throw new MissingScopeError(`${ref.kind} ref carries no workspace scope`);
10268
+ }
10269
+ return ref.workspaceUuid;
10270
+ }
10271
+ function shortUuid(uuid) {
10272
+ return uuid.length > 8 ? uuid.slice(0, 8) : uuid;
10273
+ }
10274
+ function bareLabel(ref) {
10275
+ return `${ref.kind}:${shortUuid(ref.uuid)}`;
10276
+ }
10277
+ var MAX_REFS_PER_BATCH = 500;
10278
+ function batchResolution(ref, entry) {
10279
+ if (entry.status === "resolved") {
10280
+ return { label: entry.label || bareLabel(ref), status: "resolved" };
10281
+ }
10282
+ if (entry.status === "unresolved") {
10283
+ return { label: `${bareLabel(ref)} (no access)`, status: "unresolved" };
10284
+ }
10285
+ return null;
10286
+ }
10287
+ var ActivityRefResolver = class {
10288
+ constructor(client, options = {}) {
10289
+ this.client = client;
10290
+ this.options = options;
10291
+ }
10292
+ client;
10293
+ options;
10294
+ cache = /* @__PURE__ */ new Map();
10295
+ /**
10296
+ * In-flight batches, keyed by workspace and the exact set asked about.
10297
+ *
10298
+ * The per-ref cache is only populated once a batch *settles*, so two
10299
+ * concurrent priming paths sharing one resolver would both look, both find
10300
+ * nothing, and both fire — which is the N+1 this endpoint exists to remove,
10301
+ * reappearing at a different layer. The promise is cached rather than its
10302
+ * value, which is the same rule the ref cache already follows.
10303
+ */
10304
+ inFlight = /* @__PURE__ */ new Map();
10305
+ fetches = 0;
10306
+ /** The org membership listing, fetched at most once per invocation. */
10307
+ orgNamesPromise;
10308
+ /** How many API calls hydration actually made. `--ids` must keep this at 0. */
10309
+ get fetchCount() {
10310
+ return this.fetches;
10311
+ }
10312
+ /** Distinct refs seen, resolved or not — the denominator the memo divides. */
10313
+ get cacheSize() {
10314
+ return this.cache.size;
10315
+ }
10316
+ async resolve(ref) {
10317
+ if (this.options.bare) {
10318
+ return { label: bareLabel(ref), status: "skipped" };
10319
+ }
10320
+ const key = this.cacheKey(ref);
10321
+ const cached = this.cache.get(key);
10322
+ if (cached) return cached;
10323
+ const pending = this.lookup(ref);
10324
+ this.cache.set(key, pending);
10325
+ return pending;
10326
+ }
10327
+ /** Resolve many refs, deduped through the same cache. */
10328
+ async resolveAll(refs) {
10329
+ await this.prime(refs);
10330
+ return Promise.all(refs.map((ref) => this.resolve(ref)));
10331
+ }
10332
+ /**
10333
+ * Seed the cache with one batch call per workspace.
10334
+ *
10335
+ * The N+1 relief valve, used: a listing's whole set of workspace-scoped refs
10336
+ * becomes one `POST /w/{wid}/entity-refs/resolve` per workspace instead of
10337
+ * one request per ref. Call it before rendering; `resolve()` then reads the
10338
+ * cache. It is idempotent and skips anything already cached, so a renderer
10339
+ * that primes twice pays once.
10340
+ *
10341
+ * **A failed batch is not a failed listing.** If the call throws — an older
10342
+ * server with no such route, a network blip, a 5xx — nothing is seeded and
10343
+ * every ref falls through to its per-entity hydrator, which is the behaviour
10344
+ * this resolver had before the batch existed. That is why the fallback is
10345
+ * kept rather than deleted: it is the same code path on a bad day as on a
10346
+ * server that predates this endpoint.
10347
+ */
10348
+ async prime(refs) {
10349
+ if (this.options.bare) return;
10350
+ const byWorkspace = /* @__PURE__ */ new Map();
10351
+ for (const ref of refs) {
10352
+ if (!ref.workspaceUuid || !BATCH_RESOLVABLE.has(ref.kind)) continue;
10353
+ if (this.cache.has(this.cacheKey(ref))) continue;
10354
+ const forWorkspace = byWorkspace.get(ref.workspaceUuid) ?? /* @__PURE__ */ new Map();
10355
+ forWorkspace.set(`${ref.kind}|${ref.uuid}`, ref);
10356
+ byWorkspace.set(ref.workspaceUuid, forWorkspace);
10357
+ }
10358
+ const groups = [...byWorkspace].map(
10359
+ ([workspaceUuid, wanted]) => [workspaceUuid, [...wanted.values()]]
10360
+ );
10361
+ if (this.options.orgUuid) {
10362
+ await this.primeOrg(this.options.orgUuid, groups);
10363
+ return;
10364
+ }
10365
+ await Promise.all(
10366
+ groups.map(([workspaceUuid, wanted]) => this.primeWorkspace(workspaceUuid, wanted))
10367
+ );
10368
+ }
10369
+ /**
10370
+ * One org call per chunk, each carrying whole workspace groups.
10371
+ *
10372
+ * The server's cap is over the whole request rather than per workspace, and
10373
+ * it accepts each workspace at most once per request — so a group larger
10374
+ * than the cap is split across requests, and smaller groups ride together
10375
+ * until the next one would not fit.
10376
+ */
10377
+ async primeOrg(orgUuid, groups) {
10378
+ const chunks = [];
10379
+ let current = [];
10380
+ let size = 0;
10381
+ for (const [workspaceUuid, refs] of groups) {
10382
+ for (let start = 0; start < refs.length; start += MAX_REFS_PER_BATCH) {
10383
+ const slice = refs.slice(start, start + MAX_REFS_PER_BATCH);
10384
+ if (size + slice.length > MAX_REFS_PER_BATCH && current.length > 0) {
10385
+ chunks.push(current);
10386
+ current = [];
10387
+ size = 0;
10388
+ }
10389
+ current.push([workspaceUuid, slice]);
10390
+ size += slice.length;
10391
+ }
10392
+ }
10393
+ if (current.length > 0) chunks.push(current);
10394
+ for (const chunk of chunks) {
10395
+ const key = `org:${orgUuid}|${chunk.map(
10396
+ ([workspaceUuid, refs]) => `${workspaceUuid}:${refs.map((ref) => `${ref.kind}|${ref.uuid}`).sort().join(",")}`
10397
+ ).sort().join(";")}`;
10398
+ const pending = this.inFlight.get(key) ?? this.fetchOrgChunk(orgUuid, chunk, key);
10399
+ this.inFlight.set(key, pending);
10400
+ await pending;
10401
+ }
10402
+ }
10403
+ /** One org batch call, seeded into the same per-ref cache. */
10404
+ async fetchOrgChunk(orgUuid, chunk, key) {
10405
+ try {
10406
+ this.fetches += 1;
10407
+ const response = await this.client.resolveOrgEntityRefs(orgUuid, {
10408
+ workspaces: chunk.map(([workspaceUuid, refs]) => ({
10409
+ workspaceUuid,
10410
+ refs: refs.map((ref) => ({ kind: ref.kind, uuid: ref.uuid }))
10411
+ }))
10412
+ });
10413
+ const answered = new Map(
10414
+ response.workspaces.map((group) => [
10415
+ group.workspaceUuid,
10416
+ new Map(group.refs.map((entry) => [`${entry.kind}|${entry.uuid}`, entry]))
10417
+ ])
10418
+ );
10419
+ for (const [workspaceUuid, refs] of chunk) {
10420
+ const byKey = answered.get(workspaceUuid);
10421
+ if (!byKey) continue;
10422
+ for (const ref of refs) {
10423
+ const entry = byKey.get(`${ref.kind}|${ref.uuid}`);
10424
+ if (!entry) continue;
10425
+ const resolution = batchResolution(ref, entry);
10426
+ if (resolution) this.cache.set(this.cacheKey(ref), Promise.resolve(resolution));
10427
+ }
10428
+ }
10429
+ } catch {
10430
+ this.inFlight.delete(key);
10431
+ }
10432
+ }
10433
+ async primeWorkspace(workspaceUuid, refs) {
10434
+ for (let start = 0; start < refs.length; start += MAX_REFS_PER_BATCH) {
10435
+ const chunk = refs.slice(start, start + MAX_REFS_PER_BATCH);
10436
+ const key = `${workspaceUuid}|${chunk.map((ref) => `${ref.kind}|${ref.uuid}`).sort().join(",")}`;
10437
+ const pending = this.inFlight.get(key) ?? this.fetchChunk(workspaceUuid, chunk, key);
10438
+ this.inFlight.set(key, pending);
10439
+ await pending;
10440
+ }
10441
+ }
10442
+ /**
10443
+ * One batch call, seeded into the per-ref cache.
10444
+ *
10445
+ * A failed batch is deliberately **not** negatively memoized: the entry is
10446
+ * dropped on the way out, so a later prime tries again. That is the right
10447
+ * trade for a CLI invocation — a transient 5xx should not silently mark
10448
+ * every ref unresolvable for the rest of the run — and the per-entity
10449
+ * hydrators cover the refs in flight when it fails.
10450
+ */
10451
+ async fetchChunk(workspaceUuid, chunk, key) {
10452
+ const lookups = chunk.map((ref) => ({
10453
+ kind: ref.kind,
10454
+ uuid: ref.uuid
10455
+ }));
10456
+ try {
10457
+ this.fetches += 1;
10458
+ const response = await this.client.resolveEntityRefs(workspaceUuid, {
10459
+ refs: lookups
10460
+ });
10461
+ const byKey = new Map(
10462
+ [...response.refs].map((entry) => [`${entry.kind}|${entry.uuid}`, entry])
10463
+ );
10464
+ for (const ref of chunk) {
10465
+ const entry = byKey.get(`${ref.kind}|${ref.uuid}`);
10466
+ if (!entry) continue;
10467
+ const resolution = batchResolution(ref, entry);
10468
+ if (resolution) this.cache.set(this.cacheKey(ref), Promise.resolve(resolution));
10469
+ }
10470
+ } catch {
10471
+ this.inFlight.delete(key);
10472
+ }
10473
+ }
10474
+ /**
10475
+ * The scope chain is part of the key: the same UUID observed under two
10476
+ * workspaces is two lookups against two authorizers, and collapsing them
10477
+ * would let one workspace's answer render another workspace's row.
10478
+ */
10479
+ cacheKey(ref) {
10480
+ return `${ref.workspaceUuid ?? ref.orgUuid ?? ref.accountUuid ?? ""}|${ref.kind}|${ref.uuid}`;
10481
+ }
10482
+ /** `label` for display; the bare ref when nothing better is available. */
10483
+ async label(ref) {
10484
+ if (!ref) return "";
10485
+ const resolution = await this.resolve(ref);
10486
+ return resolution.label;
10487
+ }
10488
+ /**
10489
+ * The caller's org memberships as uuid → name, fetched once.
10490
+ *
10491
+ * The promise is cached, not its value, so N org refs resolving at once
10492
+ * share one request — the same rule the ref cache follows.
10493
+ */
10494
+ orgNames() {
10495
+ this.orgNamesPromise ??= this.client.getMyOrganizations().then(
10496
+ (memberships) => new Map(
10497
+ memberships.map((membership) => [
10498
+ membership.organizationUuid,
10499
+ membership.organizationName
10500
+ ])
10501
+ )
10502
+ );
10503
+ return this.orgNamesPromise;
10504
+ }
10505
+ async lookup(ref) {
10506
+ const hydrator = HYDRATORS[ref.kind];
10507
+ if (!hydrator) {
10508
+ const known = NO_UUID_LOOKUP.has(ref.kind);
10509
+ return {
10510
+ label: `${bareLabel(ref)} (${known ? "no uuid lookup" : "unhydrated kind"})`,
10511
+ status: "no-lookup"
10512
+ };
10513
+ }
10514
+ this.fetches += 1;
10515
+ try {
10516
+ const name = await hydrator({ client: this.client, orgNames: () => this.orgNames() }, ref);
10517
+ if (!name) return { label: bareLabel(ref), status: "unresolved" };
10518
+ return { label: name, status: "resolved" };
10519
+ } catch (error) {
10520
+ if (error instanceof MissingScopeError) {
10521
+ return { label: `${bareLabel(ref)} (no scope)`, status: "no-lookup" };
10522
+ }
10523
+ if (error instanceof ApiError) {
10524
+ const denied = error.statusCode === 403 || error.statusCode === 404;
10525
+ return {
10526
+ label: `${bareLabel(ref)} (${denied ? "no access" : `http ${error.statusCode}`})`,
10527
+ status: denied ? "unresolved" : "error"
10528
+ };
10529
+ }
10530
+ return { label: `${bareLabel(ref)} (lookup failed)`, status: "error" };
10531
+ }
10532
+ }
10533
+ };
10534
+
10535
+ // src/lib/activity-render.ts
10536
+ var DIM = "\x1B[2m";
10537
+ var RESET = "\x1B[0m";
10538
+ function dim(text) {
10539
+ return process.stdout.isTTY ? `${DIM}${text}${RESET}` : text;
10540
+ }
10541
+ function envelopeLine(envelope, mount) {
10542
+ return dim(
10543
+ `mount=${mount} generated=${envelope.generatedAt} vocabulary=v${envelope.vocabularyVersion} priority-policy=v${envelope.priorityPolicyVersion}`
10544
+ );
10545
+ }
10546
+ function actorLabel(actor) {
10547
+ if (!actor.uuid) return actor.kind;
10548
+ return `${actor.kind}:${shortUuid(actor.uuid)}`;
10549
+ }
10550
+ function detailSummary(detail) {
10551
+ if (!detail || typeof detail !== "object") return "";
10552
+ return Object.entries(detail).filter(([key, value]) => key !== "type" && value !== null && value !== void 0).map(([key, value]) => `${key}=${formatDetailValue(value)}`).join(" ");
10553
+ }
10554
+ function formatDetailValue(value) {
10555
+ if (Array.isArray(value)) return `[${value.length}]`;
10556
+ if (typeof value === "object") return "{\u2026}";
10557
+ return String(value);
10558
+ }
10559
+ async function aggregateRows(response, mount, resolver, options) {
10560
+ return Promise.all(
10561
+ response.lines.map(async (line) => ({
10562
+ bucketLabel: line.bucketLabel,
10563
+ group: await groupLabel(line, resolver),
10564
+ count: line.count,
10565
+ drillCommand: line.drill ? renderQueryCommand(mount, line.drill, {
10566
+ binary: options.binary,
10567
+ globals: options.globals,
10568
+ ids: options.ids
10569
+ }) : null
10570
+ }))
10571
+ );
10572
+ }
10573
+ async function groupLabel(line, resolver) {
10574
+ if (line.groupKey.eventType) return line.groupKey.eventType;
10575
+ if (line.groupKey.workspaceUuid) {
10576
+ return resolver.label({ kind: "workspace", uuid: line.groupKey.workspaceUuid });
10577
+ }
10578
+ return "(all)";
10579
+ }
10580
+ function printAggregateLines(rows) {
10581
+ if (rows.length === 0) {
10582
+ console.log("\nNo activity in this window.");
10583
+ return;
10584
+ }
10585
+ const headers2 = ["BUCKET", "GROUP", "COUNT"];
10586
+ const widths = [
10587
+ Math.max(headers2[0].length, ...rows.map((row) => row.bucketLabel.length)),
10588
+ Math.max(headers2[1].length, ...rows.map((row) => row.group.length)),
10589
+ Math.max(headers2[2].length, ...rows.map((row) => String(row.count).length))
10590
+ ];
10591
+ console.log("");
10592
+ console.log(
10593
+ `${headers2[0].padEnd(widths[0])} ${headers2[1].padEnd(widths[1])} ${headers2[2].padStart(widths[2])}`
10594
+ );
10595
+ console.log(widths.map((width) => "-".repeat(width)).join(" "));
10596
+ for (const row of rows) {
10597
+ console.log(
10598
+ `${row.bucketLabel.padEnd(widths[0])} ${row.group.padEnd(widths[1])} ${String(row.count).padStart(widths[2])}`
10599
+ );
10600
+ if (row.drillCommand) {
10601
+ console.log(dim(` \u21B3 ${row.drillCommand}`));
10602
+ }
10603
+ }
10604
+ }
10605
+ async function eventRows(response, resolver) {
10606
+ await resolver.prime(response.items.flatMap((item) => [item.subject, ...item.refs ?? []]));
10607
+ return Promise.all(
10608
+ response.items.map(async (item) => ({
10609
+ occurredAt: item.occurredAt,
10610
+ eventType: item.eventType ?? "Unknown activity",
10611
+ subject: await resolver.label(item.subject),
10612
+ actor: actorLabel(item.actor),
10613
+ workspace: item.workspaceUuid ? await resolver.label({ kind: "workspace", uuid: item.workspaceUuid }) : "",
10614
+ detail: detailSummary(item.detail),
10615
+ visibility: item.visibility
10616
+ }))
10617
+ );
10618
+ }
10619
+ var EVENT_COLUMNS2 = [
10620
+ { header: "OCCURRED", getValue: (row) => row.occurredAt },
10621
+ { header: "TYPE", getValue: (row) => row.eventType },
10622
+ { header: "SUBJECT", getValue: (row) => row.subject, maxWidth: 42 },
10623
+ { header: "ACTOR", getValue: (row) => row.actor },
10624
+ { header: "WORKSPACE", getValue: (row) => row.workspace, maxWidth: 28 },
10625
+ { header: "VISIBILITY", getValue: (row) => row.visibility },
10626
+ { header: "DETAIL", getValue: (row) => row.detail, maxWidth: 48 }
10627
+ ];
10628
+ async function openItemRows(items, resolver) {
10629
+ await resolver.prime(items.flatMap((item) => [item.ref, ...item.responsible ?? []]));
10630
+ return Promise.all(
10631
+ items.map(async (item) => ({
10632
+ rank: item.priorityRank === null || item.priorityRank === void 0 ? "" : String(item.priorityRank),
10633
+ kind: item.kind,
10634
+ reasons: item.reasons.join(","),
10635
+ ref: await resolver.label(item.ref),
10636
+ workspace: await resolver.label({ kind: "workspace", uuid: item.workspaceUuid }),
10637
+ responsible: (await labelAll(item.responsible ?? [], resolver)).join(", "),
10638
+ openedAt: item.openedAt,
10639
+ lastEventAt: item.lastEventAt
10640
+ }))
10641
+ );
10642
+ }
10643
+ async function labelAll(refs, resolver) {
10644
+ const resolutions = await resolver.resolveAll(refs);
10645
+ return resolutions.map((resolution) => resolution.label);
10646
+ }
10647
+ var OPEN_ITEM_COLUMNS = [
10648
+ { header: "RANK", getValue: (row) => row.rank },
10649
+ { header: "KIND", getValue: (row) => row.kind },
10650
+ { header: "REASONS", getValue: (row) => row.reasons, maxWidth: 36 },
10651
+ { header: "REF", getValue: (row) => row.ref, maxWidth: 42 },
10652
+ { header: "WORKSPACE", getValue: (row) => row.workspace, maxWidth: 28 },
10653
+ { header: "RESPONSIBLE", getValue: (row) => row.responsible, maxWidth: 36 },
10654
+ { header: "OPENED", getValue: (row) => row.openedAt },
10655
+ { header: "LAST EVENT", getValue: (row) => row.lastEventAt }
10656
+ ];
10657
+ async function eventLabels(item, resolver) {
10658
+ return {
10659
+ subjectLabel: await resolver.label(item.subject),
10660
+ actorLabel: actorLabel(item.actor),
10661
+ refLabels: await labelAll(item.refs ?? [], resolver)
10662
+ };
10663
+ }
10664
+ async function openItemLabels(item, resolver) {
10665
+ return {
10666
+ refLabel: await resolver.label(item.ref),
10667
+ workspaceLabel: await resolver.label({ kind: "workspace", uuid: item.workspaceUuid }),
10668
+ responsibleLabels: await labelAll(item.responsible ?? [], resolver)
10669
+ };
10670
+ }
10671
+
10672
+ // src/domains/activity.ts
10673
+ function binaryName() {
10674
+ if (process.env.GRAVITY_RAIL_SANDBOX === "1") return "gr";
10675
+ const entry = process.argv[1] ?? "";
10676
+ return entry.includes("gr-cli") ? "yarn gr" : "gr";
10677
+ }
10678
+ function globalFlags(ctx) {
10679
+ const flags = ["--env", ctx.env];
10680
+ if (ctx.profile && ctx.profile !== "default") flags.push("--profile", ctx.profile);
10681
+ return flags;
10682
+ }
10683
+ function resolverFor(hctx) {
10684
+ const mount = resolveActivityMount(hctx.args);
10685
+ return new ActivityRefResolver(requireAuth(hctx.ctx).apiClient, {
10686
+ bare: hctx.args.ids === true,
10687
+ orgUuid: mount.kind === "org" ? mount.uuid : void 0
10688
+ });
10689
+ }
10690
+ function isAggregate(response) {
10691
+ return "lines" in response;
10692
+ }
10693
+ var queryCommand = {
10694
+ path: ["activity", "query"],
10695
+ description: "Query the activity feed at any grain. Aggregate grains (month/day/hour) read the hourly rollup; grain=event reads the log. Each aggregate line prints the server-issued drill query that reproduces exactly its count \u2014 run it to go a level deeper.",
10696
+ requiresWorkspace: false,
10697
+ args: ACTIVITY_QUERY_ARGS,
10698
+ examples: [
10699
+ "gr activity query --last 7d",
10700
+ "gr activity query --group-by workspace --grain month --last 3mo",
10701
+ "gr activity query --workspace $WORKSPACE_UUID --grain event --types chat.started --last 24h",
10702
+ "gr activity query --org $ORG_UUID --grain day --last 30d -o json",
10703
+ "gr activity query --grain event --subject member:$MEMBER_UUID --last 90d --ids"
10704
+ ],
10705
+ handler: async (hctx) => {
10706
+ const ctx = requireAuth(hctx.ctx);
10707
+ const mount = resolveActivityMount(hctx.args);
10708
+ const request = buildQueryRequest(hctx.args);
10709
+ const response = mount.kind === "account" ? await ctx.apiClient.queryActivity(request) : mount.kind === "org" ? await ctx.apiClient.queryOrgActivity(mount.uuid, request) : await ctx.apiClient.queryWorkspaceActivity(mount.uuid, request);
10710
+ const resolver = resolverFor(hctx);
10711
+ const binary = binaryName();
10712
+ const globals = globalFlags(ctx);
10713
+ if (isAggregate(response)) {
10714
+ const rows = await aggregateRows(response, mount, resolver, {
10715
+ binary,
10716
+ globals,
10717
+ ids: hctx.args.ids === true
10718
+ });
10719
+ if (hctx.ctx.outputFormat === "table") {
10720
+ console.log(envelopeLine(response.envelope, describeMount(mount)));
10721
+ printAggregateLines(rows);
10722
+ printPagingHint(hctx, mount, request, response.nextCursor, binary, globals);
10723
+ return;
8971
10724
  }
8972
- },
8973
- {
8974
- path: ["abilities", "attach"],
8975
- description: "Attach an ability to a task. Reads the task, appends the new ability (generating its uuid), and saves \u2014 so existing abilities aren't lost. Find slugs via 'gr abilities list' and the config schema via 'gr abilities get'.",
8976
- mutates: true,
8977
- requiresWorkspace: true,
8978
- args: [
8979
- { name: "task", description: "Task ID to attach to", required: true },
8980
- {
8981
- name: "type",
8982
- aliases: ["ability-type", "slug"],
8983
- description: "Ability type slug, e.g. 'integration:data_access'",
8984
- required: true
8985
- },
10725
+ outputSingle(
8986
10726
  {
8987
- name: "config",
8988
- description: `Ability config as a JSON object, e.g. '{"pauseOnEscalate":true}'`
10727
+ ...response,
10728
+ lines: response.lines.map((line, index) => ({
10729
+ ...line,
10730
+ drillCommand: rows[index]?.drillCommand ?? null,
10731
+ groupLabel: rows[index]?.group ?? null
10732
+ }))
8989
10733
  },
8990
- { name: "cel", description: "Optional CEL activation condition" },
8991
- {
8992
- name: "disabled",
8993
- description: "Attach in a disabled state (default: enabled)",
8994
- isFlag: true
8995
- }
8996
- ],
8997
- handler: async (hctx) => {
8998
- const api = requireAuth(hctx.ctx).apiClient;
8999
- const taskId = requireNumber(hctx.args, "task");
9000
- const abilityType = hctx.args.type ?? hctx.args["ability-type"] ?? hctx.args.slug;
9001
- if (!abilityType) throw new CLIError("--type is required (an ability type slug)");
9002
- let config = {};
9003
- if (hctx.args.config) {
9004
- try {
9005
- config = JSON.parse(hctx.args.config);
9006
- } catch {
9007
- throw new CLIError("--config must be a valid JSON object");
9008
- }
9009
- }
9010
- const task = await api.getTask(hctx.workspace, taskId);
9011
- const existing = (task.abilities ?? []).map(toAbilityData);
9012
- const next = {
9013
- uuid: randomUUID(),
9014
- abilityType,
9015
- config,
9016
- enabled: hctx.args.disabled !== true,
9017
- ...hctx.args.cel ? { celCondition: hctx.args.cel } : {}
9018
- };
9019
- const updated = await api.updateTask(hctx.workspace, taskId, {
9020
- abilities: [...existing, next]
9021
- });
9022
- outputData(updated.abilities ?? [], hctx.ctx, ATTACHED_COLUMNS);
9023
- }
9024
- },
9025
- {
9026
- path: ["abilities", "detach"],
9027
- description: "Detach an ability from a task by its uuid (from `gr abilities attached`). Re-saves the remaining task-specific abilities so the rest are preserved.",
9028
- mutates: true,
9029
- requiresWorkspace: true,
9030
- args: [
9031
- { name: "task", description: "Task ID", required: true },
9032
- { name: "uuid", description: "UUID of the attached ability to remove", required: true }
9033
- ],
9034
- handler: async (hctx) => {
9035
- const api = requireAuth(hctx.ctx).apiClient;
9036
- const taskId = requireNumber(hctx.args, "task");
9037
- const uuid = hctx.args.uuid;
9038
- if (!uuid) throw new CLIError("--uuid is required");
9039
- const task = await api.getTask(hctx.workspace, taskId);
9040
- const existing = task.abilities ?? [];
9041
- const remaining = existing.filter((a) => a.uuid !== uuid).map(toAbilityData);
9042
- if (remaining.length === existing.length) {
9043
- throw new CLIError(`No attached ability with uuid '${uuid}' on task ${taskId}`);
9044
- }
9045
- const updated = await api.updateTask(hctx.workspace, taskId, {
9046
- abilities: remaining
9047
- });
9048
- outputData(updated.abilities ?? [], hctx.ctx, ATTACHED_COLUMNS);
10734
+ hctx.ctx
10735
+ );
10736
+ return;
10737
+ }
10738
+ if (hctx.ctx.outputFormat === "table") {
10739
+ console.log(envelopeLine(response.envelope, describeMount(mount)));
10740
+ if (response.totalMatched !== null && response.totalMatched !== void 0) {
10741
+ console.log(`showing ${response.items.length} of ${response.totalMatched} matched`);
9049
10742
  }
10743
+ outputData(await eventRows(response, resolver), hctx.ctx, EVENT_COLUMNS2);
10744
+ printPagingHint(hctx, mount, request, response.nextCursor, binary, globals);
10745
+ return;
10746
+ }
10747
+ const bare = hctx.args.ids === true;
10748
+ const items = await Promise.all(
10749
+ response.items.map(
10750
+ async (item) => bare ? item : { ...item, ...await eventLabels(item, resolver) }
10751
+ )
10752
+ );
10753
+ outputSingle({ ...response, items }, hctx.ctx);
10754
+ }
10755
+ };
10756
+ function printPagingHint(hctx, mount, request, nextCursor, binary, globals) {
10757
+ if (!nextCursor) return;
10758
+ const next = renderQueryCommand(
10759
+ mount,
10760
+ { ...request, cursor: nextCursor },
10761
+ { binary, globals, ids: hctx.args.ids === true }
10762
+ );
10763
+ hint(hctx.ctx, [`next page:`, ` ${next}`]);
10764
+ }
10765
+ var openItemsCommand = {
10766
+ path: ["activity", "open-items"],
10767
+ description: "The priority lane \u2014 what needs a human now, ordered by read-time policy. Deliberately not paged: narrow with --kinds, --scope-workspace or the responsibility filters rather than walking pages.",
10768
+ requiresWorkspace: false,
10769
+ args: ACTIVITY_OPEN_ITEMS_ARGS,
10770
+ examples: [
10771
+ "gr activity open-items",
10772
+ "gr activity open-items --assigned-to-me --order recency",
10773
+ "gr activity open-items --workspace $WORKSPACE_UUID --kinds awaiting_human,missed_call",
10774
+ "gr activity open-items --org $ORG_UUID --point-person -o json"
10775
+ ],
10776
+ handler: async (hctx) => {
10777
+ const ctx = requireAuth(hctx.ctx);
10778
+ const mount = resolveActivityMount(hctx.args);
10779
+ const request = buildOpenItemsRequest(hctx.args);
10780
+ const response = mount.kind === "account" ? await ctx.apiClient.queryActivityOpenItems(request) : mount.kind === "org" ? await ctx.apiClient.queryOrgActivityOpenItems(mount.uuid, request) : await ctx.apiClient.queryWorkspaceActivityOpenItems(mount.uuid, request);
10781
+ const resolver = resolverFor(hctx);
10782
+ if (hctx.ctx.outputFormat === "table") {
10783
+ console.log(envelopeLine(response.envelope, describeMount(mount)));
10784
+ const total = response.truncated ? `${response.totalOpen}+` : `${response.totalOpen}`;
10785
+ console.log(`showing ${response.items.length} of ${total} open`);
10786
+ outputData(await openItemRows(response.items, resolver), hctx.ctx, OPEN_ITEM_COLUMNS);
10787
+ return;
10788
+ }
10789
+ const bare = hctx.args.ids === true;
10790
+ const items = await Promise.all(
10791
+ response.items.map(
10792
+ async (item) => bare ? item : { ...item, ...await openItemLabels(item, resolver) }
10793
+ )
10794
+ );
10795
+ outputSingle({ ...response, items }, hctx.ctx);
10796
+ }
10797
+ };
10798
+ var countsCommand = {
10799
+ path: ["activity", "counts"],
10800
+ description: "Badge numbers: how many open items, and how much happened in the window, by type.",
10801
+ requiresWorkspace: false,
10802
+ args: ACTIVITY_COUNTS_ARGS,
10803
+ examples: [
10804
+ "gr activity counts --last 24h",
10805
+ "gr activity counts --workspace $WORKSPACE_UUID --last 7d",
10806
+ "gr activity counts --org $ORG_UUID --from 2026-08-01 --to 2026-09-01 -o json"
10807
+ ],
10808
+ handler: async (hctx) => {
10809
+ const ctx = requireAuth(hctx.ctx);
10810
+ const mount = resolveActivityMount(hctx.args);
10811
+ const request = buildCountsRequest(hctx.args);
10812
+ const response = mount.kind === "account" ? await ctx.apiClient.getActivityCounts(request) : mount.kind === "org" ? await ctx.apiClient.getOrgActivityCounts(mount.uuid, request) : await ctx.apiClient.getWorkspaceActivityCounts(mount.uuid, request);
10813
+ if (hctx.ctx.outputFormat !== "table") {
10814
+ outputSingle(response, hctx.ctx);
10815
+ return;
10816
+ }
10817
+ console.log(envelopeLine(response.envelope, describeMount(mount)));
10818
+ console.log(`open items: ${response.openItems}`);
10819
+ console.log(`events in window: ${response.totalEvents}`);
10820
+ outputData(response.byEventType ?? [], hctx.ctx, [
10821
+ { header: "EVENT TYPE", getValue: (row) => row.eventType },
10822
+ { header: "COUNT", getValue: (row) => String(row.count) }
10823
+ ]);
10824
+ }
10825
+ };
10826
+ var capabilitiesCommand = {
10827
+ path: ["activity", "capabilities"],
10828
+ description: "What this caller may see: capability classes, how many workspaces the grant set admits, org:read coverage, and whether a private lane exists. Account mount only.",
10829
+ requiresWorkspace: false,
10830
+ // The mount flags are declared so that naming one gets the explanation
10831
+ // below rather than a generic "unknown flag".
10832
+ args: ACTIVITY_MOUNT_ARGS,
10833
+ examples: ["gr activity capabilities", "gr activity capabilities --env prod -o json"],
10834
+ handler: async (hctx) => {
10835
+ const mount = resolveActivityMount(hctx.args);
10836
+ if (mount.kind !== "account") {
10837
+ throw new CLIError(
10838
+ "activity capabilities is served by the account mount only \u2014 drop --org/--workspace. Org and workspace membership is answered by `gr org` and `gr workspaces`."
10839
+ );
9050
10840
  }
10841
+ const response = await requireAuth(hctx.ctx).apiClient.getActivityCapabilities();
10842
+ outputSingle(response, hctx.ctx, [
10843
+ {
10844
+ header: "CAPABILITIES",
10845
+ getValue: (row) => row.capabilities.join(","),
10846
+ maxWidth: 80
10847
+ },
10848
+ { header: "WORKSPACES", getValue: (row) => String(row.workspaceCount) },
10849
+ { header: "ORG:READ", getValue: (row) => String(row.orgReadCount) },
10850
+ { header: "PRIVATE LANE", getValue: (row) => String(row.hasPrivateLane) }
10851
+ ]);
10852
+ }
10853
+ };
10854
+ var eventTypesCommand = {
10855
+ path: ["activity", "event-types"],
10856
+ description: "The closed event-type vocabulary this build knows, for --types. Local; calls no API.",
10857
+ requiresWorkspace: false,
10858
+ requiresAuth: false,
10859
+ args: [],
10860
+ examples: ["gr activity event-types"],
10861
+ handler: async (hctx) => {
10862
+ outputData(
10863
+ activityEventTypes().map((eventType) => ({ eventType })),
10864
+ hctx.ctx,
10865
+ [{ header: "EVENT TYPE", getValue: (row) => row.eventType }]
10866
+ );
10867
+ }
10868
+ };
10869
+ var activityDomain = {
10870
+ name: "activity",
10871
+ description: "Activity feed: what has been happening, and what needs a human now",
10872
+ commands: [
10873
+ queryCommand,
10874
+ openItemsCommand,
10875
+ countsCommand,
10876
+ capabilitiesCommand,
10877
+ eventTypesCommand
9051
10878
  ]
9052
10879
  };
9053
10880
 
@@ -11174,7 +13001,7 @@ var commands2 = [
11174
13001
  },
11175
13002
  {
11176
13003
  path: ["org", "business-profile", "get"],
11177
- description: "Read a legal entity's business profile LIVE from Twilio. SUBMITTABLE is derived from evaluationStatus, not status.",
13004
+ description: "Read a legal entity's business profile: a live Twilio fetch with any locally saved draft overlaid on top. draftPending=YES means the fields shown include saved edits that no submit has pushed \u2014 on this path a real Twilio fetch is compared, so it is only set when the draft differs from what the carrier holds. SUBMITTABLE is derived from evaluationStatus, not status.",
11178
13005
  requiresWorkspace: false,
11179
13006
  args: [ORG_UUID_ARG, LEGAL_ENTITY_UUID_ARG],
11180
13007
  examples: ["yarn gr org business-profile get --org-uuid $ORG_UUID"],
@@ -11192,6 +13019,7 @@ var commands2 = [
11192
13019
  legalName: profile.businessInfo?.legalName ?? "(missing)",
11193
13020
  authorizedReps: (profile.authorizedReps ?? []).length,
11194
13021
  hasAddress: profile.address ? "yes" : "no",
13022
+ draftPending: profile.draftPending ? "YES" : "no",
11195
13023
  failureReasons: (profile.failureReasons ?? []).join("; ") || "(none)",
11196
13024
  profileRecoveryFailed: profile.profileRecoveryFailed ? "YES" : "no"
11197
13025
  },
@@ -11201,7 +13029,7 @@ var commands2 = [
11201
13029
  },
11202
13030
  {
11203
13031
  path: ["org", "business-profile", "update"],
11204
- description: "Upsert the business profile (idempotent via cached SIDs). Returns the fresh compliance evaluation.",
13032
+ description: "Save the business profile locally. Makes NO provider call, so nothing reaches the carrier until `submit` \u2014 a representative removed here stays attached at Twilio until then. The evaluation returned is the last known one, not a fresh check.",
11205
13033
  mutates: true,
11206
13034
  requiresWorkspace: false,
11207
13035
  args: [ORG_UUID_ARG, LEGAL_ENTITY_UUID_ARG],
@@ -11265,7 +13093,7 @@ var commands2 = [
11265
13093
  },
11266
13094
  {
11267
13095
  path: ["org", "trust-products", "sync"],
11268
- description: "Reconcile voice trust products against Twilio: claim products staged outside the app and refresh non-terminal statuses. This is the prerequisite for `admin phone-numbers migrate`, whose preflight reads the cached state. 409 if another Trust Hub operation holds this legal entity lock \u2014 it fails fast and sends no Retry-After, because holders range from milliseconds to minutes. Back off on your own schedule and re-read before retrying.",
13096
+ description: "Reconcile voice trust products against Twilio: claim products staged outside the app and refresh non-terminal statuses. Strongly advised before `admin phone-numbers migrate`, whose preflight attaches only the bundles approved in the cached state \u2014 an unreconciled product is simply left off the number, and needs a later `--reattach-trust` trip. 409 if another Trust Hub operation holds this legal entity lock \u2014 it fails fast and sends no Retry-After, because holders range from milliseconds to minutes. Back off on your own schedule and re-read before retrying.",
11269
13097
  // Writes trust_hub_state and calls Twilio. Read-only in business terms
11270
13098
  // (it discovers, it does not create or submit), but it mutates our cache,
11271
13099
  // so it takes --allow-write like every other state-changing verb.
@@ -12117,7 +13945,7 @@ async function findOutboundPhoneUsers(client, workspace, phone) {
12117
13945
  }
12118
13946
 
12119
13947
  // ../../node_modules/libphonenumber-js/metadata.min.json.js
12120
- 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]|95[0-3])\\d{5}|4(?:[0-36]\\d|4[047-9]|[58][0-24-9]|7[02-8]|9[0-47-9])\\d{6}", [9]], ["180(?:0\\d{3}|2)\\d{3}", [7, 10]], ["190[0-26]\\d{6}", [10]], 0, 0, 0, ["163\\d{2,6}", [5, 6, 7, 8, 9]], ["14(?:5(?:1[0458]|[23][458])|71\\d)\\d{4}", [9]], ["13(?:00\\d{6}(?:\\d{2})?|45[0-4]\\d{3})|13\\d{4}", [6, 8, 10, 12]]], "0011"], "AW": ["297", "00", "(?:[25-79]\\d\\d|800)\\d{4}", [7], [["(\\d{3})(\\d{4})", "$1 $2", ["[25-9]"]]]], "AX": ["358", "00|99(?:[01469]|5(?:[14]1|3[23]|5[59]|77|88|9[09]))", "2\\d{4,9}|35\\d{4,5}|(?:60\\d\\d|800)\\d{4,6}|7\\d{5,11}|(?:[14]\\d|3[0-46-9]|50)\\d{4,8}", [5, 6, 7, 8, 9, 10, 11, 12], 0, "0", 0, 0, 0, 0, "18", 0, "00"], "AZ": ["994", "00", "365\\d{6}|(?:[124579]\\d|60|88)\\d{7}", [9], [["(\\d{3})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["90"], "0$1"], ["(\\d{2})(\\d{3})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["1[28]|2|365|46", "1[28]|2|365[45]|46", "1[28]|2|365(?:4|5[02])|46"], "(0$1)"], ["(\\d{2})(\\d{3})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[13-9]"], "0$1"]], "0"], "BA": ["387", "00", "6\\d{8}|(?:[35689]\\d|49|70)\\d{6}", [8, 9], [["(\\d{2})(\\d{3})(\\d{3})", "$1 $2 $3", ["6[1-3]|[7-9]"], "0$1"], ["(\\d{2})(\\d{3})(\\d{3})", "$1 $2-$3", ["[3-5]|6[56]"], "0$1"], ["(\\d{2})(\\d{2})(\\d{2})(\\d{3})", "$1 $2 $3 $4", ["6"], "0$1"]], "0"], "BB": ["1", "011", "(?:246|[58]\\d\\d|900)\\d{7}", [10], 0, "1", 0, "([2-9]\\d{6})$|1", "246$1", 0, "246"], "BD": ["880", "00", "[1-469]\\d{9}|8[0-79]\\d{7,8}|[2-79]\\d{8}|[2-9]\\d{7}|[3-9]\\d{6}|[57-9]\\d{5}", [6, 7, 8, 9, 10], [["(\\d{2})(\\d{4,6})", "$1-$2", ["31[5-8]|[459]1"], "0$1"], ["(\\d{3})(\\d{3,7})", "$1-$2", ["3(?:[67]|8[013-9])|4(?:6[168]|7|[89][18])|5(?:6[128]|9)|6(?:[15]|28|4[14])|7[2-589]|8(?:0[014-9]|[12])|9[358]|(?:3[2-5]|4[235]|5[2-578]|6[0389]|76|8[3-7]|9[24])1|(?:44|66)[01346-9]"], "0$1"], ["(\\d{4})(\\d{3,6})", "$1-$2", ["[13-9]|2[23]"], "0$1"], ["(\\d)(\\d{7,8})", "$1-$2", ["2"], "0$1"]], "0"], "BE": ["32", "00", "4\\d{8}|[1-9]\\d{7}", [8, 9], [["(\\d{3})(\\d{2})(\\d{3})", "$1 $2 $3", ["(?:80|9)0"], "0$1"], ["(\\d)(\\d{3})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[239]|4[23]"], "0$1"], ["(\\d{2})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[15-8]"], "0$1"], ["(\\d{3})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["4"], "0$1"]], "0"], "BF": ["226", "00", "[024-7]\\d{7}", [8], [["(\\d{2})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[024-7]"]]]], "BG": ["359", "00", "00800\\d{7}|[2-7]\\d{6,7}|[89]\\d{6,8}|2\\d{5}", [6, 7, 8, 9, 12], [["(\\d)(\\d)(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["2"], "0$1"], ["(\\d{3})(\\d{4})", "$1 $2", ["43[1-6]|70[1-9]"], "0$1"], ["(\\d)(\\d{3})(\\d{3,4})", "$1 $2 $3", ["2"], "0$1"], ["(\\d{2})(\\d{3})(\\d{2,3})", "$1 $2 $3", ["[356]|4[124-7]|7[1-9]|8[1-6]|9[1-7]"], "0$1"], ["(\\d{3})(\\d{2})(\\d{3})", "$1 $2 $3", ["(?:70|8)0"], "0$1"], ["(\\d{3})(\\d{3})(\\d{2})", "$1 $2 $3", ["43[1-7]|7"], "0$1"], ["(\\d{2})(\\d{3})(\\d{3,4})", "$1 $2 $3", ["[48]|9[08]"], "0$1"], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["9"], "0$1"]], "0"], "BH": ["973", "00", "[136-9]\\d{7}", [8], [["(\\d{4})(\\d{4})", "$1 $2", ["[13679]|8[02-4679]"]]]], "BI": ["257", "00", "(?:[267]\\d|31)\\d{6}", [8], [["(\\d{2})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[2367]"]]]], "BJ": ["229", "00", "(?:01\\d|8)\\d{7}", [8, 10], [["(\\d{2})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["8"]], ["(\\d{2})(\\d{2})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4 $5", ["0"]]]], "BL": ["590", "00", "7090\\d{5}|(?:[56]9|[89]\\d)\\d{7}", [9], 0, "0", 0, 0, 0, 0, 0, [["(?:59(?:0(?:2[7-9]|3[3-7]|5[12]|87)|87\\d)|80[6-9]\\d\\d)\\d{4}"], ["(?:69(?:0\\d\\d|1(?:2[2-9]|3[0-5]))|7090[0-4])\\d{4}"], ["80[0-5]\\d{6}"], ["8[129]\\d{7}"], 0, 0, 0, 0, ["9(?:(?:39[5-7]|76[018])\\d|475[0-6])\\d{4}"]]], "BM": ["1", "011", "(?:441|[58]\\d\\d|900)\\d{7}", [10], 0, "1", 0, "([2-9]\\d{6})$|1", "441$1", 0, "441"], "BN": ["673", "00", "[2-578]\\d{6}", [7], [["(\\d{3})(\\d{4})", "$1 $2", ["[2-578]"]]]], "BO": ["591", "00(?:1\\d)?", "(?:[2-7]\\d\\d|8001)\\d{5}", [8, 9], [["(\\d)(\\d{7})", "$1 $2", ["[23]|4[46]|50"]], ["(\\d{8})", "$1", ["[5-7]"]], ["(\\d{3})(\\d{2})(\\d{4})", "$1 $2 $3", ["8"]]], "0", 0, "0(1\\d)?"], "BQ": ["599", "00", "(?:[34]1|7\\d)\\d{5}", [7], 0, 0, 0, 0, 0, 0, "[347]"], "BR": ["55", "00(?:1[245]|2[1-35]|31|4[13]|[56]5|99)", "[1-467]\\d{9,10}|55[0-46-9]\\d{8}|[34]\\d{7}|55\\d{7,8}|(?:5[0-46-9]|[89]\\d)\\d{7,9}", [8, 9, 10, 11], [["(\\d{4})(\\d{4})", "$1-$2", ["300|4(?:0[02]|37|86)", "300|4(?:0(?:0|20)|370|864)"]], ["(\\d{3})(\\d{2,3})(\\d{4})", "$1 $2 $3", ["(?:[358]|90)0"], "0$1"], ["(\\d{2})(\\d{4})(\\d{4})", "$1 $2-$3", ["(?:[14689][1-9]|2[12478]|3[1-578]|5[13-5]|7[13-579])[2-57]"], "($1)"], ["(\\d{2})(\\d{5})(\\d{4})", "$1 $2-$3", ["[16][1-9]|[2-57-9]"], "($1)"]], "0", 0, "(?:0|90)(?:(1[245]|2[1-35]|31|4[13]|[56]5|99)(\\d{10,11}))?", "$2"], "BS": ["1", "011", "(?:242|[58]\\d\\d|900)\\d{7}", [10], 0, "1", 0, "([3-8]\\d{6})$|1", "242$1", 0, "242"], "BT": ["975", "00", "[178]\\d{7}|[2-8]\\d{6}", [7, 8], [["(\\d)(\\d{3})(\\d{3})", "$1 $2 $3", ["[2-6]|7[246]|8[2-4]"]], ["(\\d{2})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["1[67]|[78]"]]]], "BW": ["267", "00", "(?:0800|(?:[37]|800)\\d)\\d{6}|(?:[2-6]\\d|90)\\d{5}", [7, 8, 10], [["(\\d{2})(\\d{5})", "$1 $2", ["90"]], ["(\\d{3})(\\d{4})", "$1 $2", ["[24-6]|3[15-9]"]], ["(\\d{2})(\\d{3})(\\d{3})", "$1 $2 $3", ["[37]"]], ["(\\d{4})(\\d{3})(\\d{3})", "$1 $2 $3", ["0"]], ["(\\d{3})(\\d{4})(\\d{3})", "$1 $2 $3", ["8"]]]], "BY": ["375", "810", "(?:[12]\\d|33|44|902)\\d{7}|8(?:0[0-79]\\d{5,7}|[1-7]\\d{9})|8(?:1[0-489]|[5-79]\\d)\\d{7}|8[1-79]\\d{6,7}|8[0-79]\\d{5}|8\\d{5}", [6, 7, 8, 9, 10, 11], [["(\\d{3})(\\d{3})", "$1 $2", ["800"], "8 $1"], ["(\\d{3})(\\d{2})(\\d{2,4})", "$1 $2 $3", ["800"], "8 $1"], ["(\\d{4})(\\d{2})(\\d{3})", "$1 $2-$3", ["1(?:5[169]|6[3-5]|7[179])|2(?:1[35]|2[34]|3[3-5])", "1(?:5[169]|6(?:3[1-3]|4|5[125])|7(?:1[3-9]|7[0-24-6]|9[2-7]))|2(?:1[35]|2[34]|3[3-5])"], "8 0$1"], ["(\\d{3})(\\d{2})(\\d{2})(\\d{2})", "$1 $2-$3-$4", ["1(?:[56]|7[467])|2[1-3]"], "8 0$1"], ["(\\d{2})(\\d{3})(\\d{2})(\\d{2})", "$1 $2-$3-$4", ["[1-4]"], "8 0$1"], ["(\\d{3})(\\d{3,4})(\\d{4})", "$1 $2 $3", ["[89]"], "8 $1"]], "8", 0, "0|80?", 0, 0, 0, 0, "8~10"], "BZ": ["501", "00", "(?:0800\\d|[2-8])\\d{6}", [7, 11], [["(\\d{3})(\\d{4})", "$1-$2", ["[2-8]"]], ["(\\d)(\\d{3})(\\d{4})(\\d{3})", "$1-$2-$3-$4", ["0"]]]], "CA": ["1", "011", "[2-9]\\d{9}|3\\d{6}", [7, 10], 0, "1", 0, 0, 0, 0, 0, [["(?:2(?:04|[23]6|[48]9|5[07]|63)|3(?:06|43|54|6[578]|82)|4(?:03|1[68]|[26]8|3[178]|50|74)|5(?:06|1[49]|48|79|8[147])|6(?:04|[18]3|39|47|72)|7(?:0[59]|42|53|78|8[02])|8(?:[06]7|19|25|7[39])|9(?:0[25]|42))[2-9]\\d{6}", [10]], ["", [10]], ["8(?:00|33|44|55|66|77|88)[2-9]\\d{6}", [10]], ["900[2-9]\\d{6}", [10]], ["52(?:3(?:[2-46-9][02-9]\\d|5(?:[02-46-9]\\d|5[0-46-9]))|4(?:[2-478][02-9]\\d|5(?:[034]\\d|2[024-9]|5[0-46-9])|6(?:0[1-9]|[2-9]\\d)|9(?:[05-9]\\d|2[0-5]|49)))\\d{4}|52[34][2-9]1[02-9]\\d{4}|(?:5(?:2[125-9]|3[23]|44|66|77|88)|6(?:22|33))[2-9]\\d{6}", [10]], 0, ["310\\d{4}", [7]], 0, ["600[2-9]\\d{6}", [10]]]], "CC": ["61", "001[14-689]|14(?:1[14]|34|4[17]|[56]6|7[47]|88)0011", "1(?:[0-79]\\d{8}(?:\\d{2})?|8[0-24-9]\\d{7})|[148]\\d{8}|1\\d{5,7}", [6, 7, 8, 9, 10, 12], 0, "0", 0, "([59]\\d{7})$|0", "8$1", 0, 0, [["8(?:51(?:0(?:02|31|60|89)|1(?:18|76)|223)|91(?:0(?:1[0-2]|29)|1(?:[28]2|50|79)|2(?:10|64)|3(?:[06]8|22)|4[29]8|62\\d|70[23]|959))\\d{3}", [9]], ["4(?:79[01]|83[0-36-9]|95[0-3])\\d{5}|4(?:[0-36]\\d|4[047-9]|[58][0-24-9]|7[02-8]|9[0-47-9])\\d{6}", [9]], ["180(?:0\\d{3}|2)\\d{3}", [7, 10]], ["190[0-26]\\d{6}", [10]], 0, 0, 0, 0, ["14(?:5(?:1[0458]|[23][458])|71\\d)\\d{4}", [9]], ["13(?:00\\d{6}(?:\\d{2})?|45[0-4]\\d{3})|13\\d{4}", [6, 8, 10, 12]]], "0011"], "CD": ["243", "00", "(?:(?:[189]|5\\d)\\d|2)\\d{7}|[1-68]\\d{6}", [7, 8, 9, 10], [["(\\d{2})(\\d{2})(\\d{3})", "$1 $2 $3", ["88"], "0$1"], ["(\\d{2})(\\d{5})", "$1 $2", ["[1-6]"], "0$1"], ["(\\d{2})(\\d{2})(\\d{4})", "$1 $2 $3", ["2"], "0$1"], ["(\\d{2})(\\d{3})(\\d{4})", "$1 $2 $3", ["1"], "0$1"], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["[89]"], "0$1"], ["(\\d{2})(\\d{2})(\\d{3})(\\d{3})", "$1 $2 $3 $4", ["5"], "0$1"]], "0"], "CF": ["236", "00", "8776\\d{4}|(?:[27]\\d|61)\\d{6}", [8], [["(\\d{2})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[26-8]"]]]], "CG": ["242", "00", "222\\d{6}|(?:0\\d|80)\\d{7}", [9], [["(\\d)(\\d{4})(\\d{4})", "$1 $2 $3", ["8"]], ["(\\d{2})(\\d{3})(\\d{4})", "$1 $2 $3", ["[02]"]]]], "CH": ["41", "00", "8\\d{11}|[2-9]\\d{8}", [9, 12], [["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["8[047]|90"], "0$1"], ["(\\d{2})(\\d{3})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[2-79]|81"], "0$1"], ["(\\d{3})(\\d{2})(\\d{3})(\\d{2})(\\d{2})", "$1 $2 $3 $4 $5", ["8"], "0$1"]], "0"], "CI": ["225", "00", "[02]\\d{9}", [10], [["(\\d{2})(\\d{2})(\\d)(\\d{5})", "$1 $2 $3 $4", ["2"]], ["(\\d{2})(\\d{2})(\\d{2})(\\d{4})", "$1 $2 $3 $4", ["0"]]]], "CK": ["682", "00", "[2-578]\\d{4}", [5], [["(\\d{2})(\\d{3})", "$1 $2", ["[2-578]"]]]], "CL": ["56", "(?:0|1(?:1[0-69]|2[02-5]|5[13-58]|69|7[0167]|8[018]))0", "12300\\d{6}|6\\d{9,10}|[2-9]\\d{8}", [9, 10, 11], [["(\\d{5})(\\d{4})", "$1 $2", ["219", "2196"], "($1)"], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["60|809"]], ["(\\d{2})(\\d{3})(\\d{4})", "$1 $2 $3", ["44"]], ["(\\d)(\\d{4})(\\d{4})", "$1 $2 $3", ["2[1-36]"], "($1)"], ["(\\d)(\\d{4})(\\d{4})", "$1 $2 $3", ["9(?:10|[2-9])"]], ["(\\d{2})(\\d{3})(\\d{4})", "$1 $2 $3", ["3[2-5]|[47]|5[1-3578]|6[13-57]|8(?:0[1-8]|[1-9])"], "($1)"], ["(\\d{3})(\\d{3})(\\d{3,4})", "$1 $2 $3", ["60|8"]], ["(\\d{4})(\\d{3})(\\d{4})", "$1 $2 $3", ["1"]], ["(\\d{3})(\\d{3})(\\d{2})(\\d{3})", "$1 $2 $3 $4", ["60"]]]], "CM": ["237", "00", "[26]\\d{8}|88\\d{6,7}", [8, 9], [["(\\d{2})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["88"]], ["(\\d)(\\d{2})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4 $5", ["[26]|88"]]]], "CN": ["86", "00|1(?:[12]\\d|79)\\d\\d00", "(?:(?:1[03-689]|2\\d)\\d\\d|6)\\d{8}|1\\d{10}|[126]\\d{6}(?:\\d(?:\\d{2})?)?|86\\d{5,6}|(?:[3-579]\\d|8[0-57-9])\\d{5,9}", [7, 8, 9, 10, 11, 12], [["(\\d{2})(\\d{5,6})", "$1 $2", ["(?:10|2[0-57-9])[19]|3(?:[157]|35|49|9[1-68])|4(?:1[124-9]|2[179]|6[47-9]|7|8[23])|5(?:[1357]|2[37]|4[36]|6[1-46]|80)|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:07|1[236-8]|2[5-7]|[37]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|3|4[13]|5[1-5]|7[0-79]|9[0-35-9])|(?:4[35]|59|85)[1-9]", "(?:10|2[0-57-9])(?:1[02]|9[56])|8078|(?:3(?:[157]\\d|35|49|9[1-68])|4(?:1[124-9]|2[179]|[35][1-9]|6[47-9]|7\\d|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[1-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|3\\d|4[13]|5[1-5]|7[0-79]|9[0-35-9]))1", "10(?:1(?:0|23)|9[56])|2[0-57-9](?:1(?:00|23)|9[56])|80781|(?:3(?:[157]\\d|35|49|9[1-68])|4(?:1[124-9]|2[179]|[35][1-9]|6[47-9]|7\\d|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[1-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|3\\d|4[13]|5[1-5]|7[0-79]|9[0-35-9]))12", "10(?:1(?:0|23)|9[56])|2[0-57-9](?:1(?:00|23)|9[56])|807812|(?:3(?:[157]\\d|35|49|9[1-68])|4(?:1[124-9]|2[179]|[35][1-9]|6[47-9]|7\\d|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[1-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|3\\d|4[13]|5[1-5]|7[0-79]|9[0-35-9]))123", "10(?:1(?:0|23)|9[56])|2[0-57-9](?:1(?:00|23)|9[56])|(?:3(?:[157]\\d|35|49|9[1-68])|4(?:1[124-9]|2[179]|[35][1-9]|6[47-9]|7\\d|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:078|1[236-8]|2[5-7]|[37]\\d|5[1-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|3\\d|4[13]|5[1-5]|7[0-79]|9[0-35-9]))123"], "0$1"], ["(\\d{3})(\\d{5,6})", "$1 $2", ["3(?:[157]|35|49|9[1-68])|4(?:[17]|2[179]|6[47-9]|8[23])|5(?:[1357]|2[37]|4[36]|6[1-46]|80)|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|[379]|4[13]|5[1-5])|(?:4[35]|59|85)[1-9]", "(?:3(?:[157]\\d|35|49|9[1-68])|4(?:[17]\\d|2[179]|[35][1-9]|6[47-9]|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[1-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|[379]\\d|4[13]|5[1-5]))[19]", "85[23](?:10|95)|(?:3(?:[157]\\d|35|49|9[1-68])|4(?:[17]\\d|2[179]|[35][1-9]|6[47-9]|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[14-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|[379]\\d|4[13]|5[1-5]))(?:10|9[56])", "85[23](?:100|95)|(?:3(?:[157]\\d|35|49|9[1-68])|4(?:[17]\\d|2[179]|[35][1-9]|6[47-9]|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[14-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|[379]\\d|4[13]|5[1-5]))(?:100|9[56])"], "0$1"], ["(\\d{3})(\\d{3})(\\d{4})", "$1 $2 $3", ["(?:4|80)0"]], ["(\\d{2})(\\d{4})(\\d{4})", "$1 $2 $3", ["10|2(?:[02-57-9]|1[1-9])", "10|2(?:[02-57-9]|1[1-9])", "10[0-79]|2(?:[02-57-9]|1[1-79])|(?:10|21)8(?:0[1-9]|[1-9])"], "0$1", 1], ["(\\d{3})(\\d{3})(\\d{4})", "$1 $2 $3", ["3(?:[3-59]|7[02-68])|4(?:[26-8]|3[3-9]|5[2-9])|5(?:3[03-9]|[468]|7[028]|9[2-46-9])|6|7(?:[0-247]|3[04-9]|5[0-4689]|6[2368])|8(?:[1-358]|9[1-7])|9(?:[013479]|5[1-5])|(?:[34]1|55|79|87)[02-9]"], "0$1", 1], ["(\\d{3})(\\d{7,8})", "$1 $2", ["9"]], ["(\\d{4})(\\d{3})(\\d{4})", "$1 $2 $3", ["80"], "0$1", 1], ["(\\d{3})(\\d{4})(\\d{4})", "$1 $2 $3", ["[3-578]"], "0$1", 1], ["(\\d{3})(\\d{4})(\\d{4})", "$1 $2 $3", ["1[3-9]"]], ["(\\d{2})(\\d{3})(\\d{3})(\\d{4})", "$1 $2 $3 $4", ["[12]"], "0$1", 1]], "0", 0, "(1(?:[12]\\d|79)\\d\\d)|0", 0, 0, 0, 0, "00"], "CO": ["57", "00(?:4(?:[14]4|56)|[579])", "(?:46|60\\d\\d)\\d{6}|(?:1\\d|[39])\\d{9}", [8, 10, 11], [["(\\d{4})(\\d{4})", "$1 $2", ["46"]], ["(\\d{3})(\\d{7})", "$1 $2", ["6|90"], "($1)"], ["(\\d{3})(\\d{7})", "$1 $2", ["3[0-357]|9[14]"]], ["(\\d)(\\d{3})(\\d{7})", "$1-$2-$3", ["1"], "0$1", 0, "$1 $2 $3"]], "0", 0, "0([3579]|4(?:[14]4|56))?"], "CR": ["506", "00", "(?:8\\d|90)\\d{8}|(?:[24-8]\\d{3}|3005)\\d{4}", [8, 10], [["(\\d{4})(\\d{4})", "$1 $2", ["[2-7]|8[3-9]"]], ["(\\d{3})(\\d{3})(\\d{4})", "$1-$2-$3", ["[89]"]]], 0, 0, "(19(?:0[0-2468]|1[09]|20|66|77|99))"], "CU": ["53", "119", "(?:[2-7]|8\\d\\d)\\d{7}|[2-47]\\d{6}|[34]\\d{5}", [6, 7, 8, 10], [["(\\d{2})(\\d{4,6})", "$1 $2", ["2[1-4]|[34]"], "(0$1)"], ["(\\d)(\\d{6,7})", "$1 $2", ["7"], "(0$1)"], ["(\\d)(\\d{7})", "$1 $2", ["[56]"], "0$1"], ["(\\d{3})(\\d{7})", "$1 $2", ["8"], "0$1"]], "0"], "CV": ["238", "0", "(?:[2-59]\\d\\d|800)\\d{4}", [7], [["(\\d{3})(\\d{2})(\\d{2})", "$1 $2 $3", ["[2-589]"]]]], "CW": ["599", "00", "(?:[34]1|60|(?:7|9\\d)\\d)\\d{5}", [7, 8], [["(\\d{3})(\\d{4})", "$1 $2", ["[3467]"]], ["(\\d)(\\d{3})(\\d{4})", "$1 $2 $3", ["9[4-8]"]]], 0, 0, 0, 0, 0, "[69]"], "CX": ["61", "001[14-689]|14(?:1[14]|34|4[17]|[56]6|7[47]|88)0011", "1(?:[0-79]\\d{8}(?:\\d{2})?|8[0-24-9]\\d{7})|[148]\\d{8}|1\\d{5,7}", [6, 7, 8, 9, 10, 12], 0, "0", 0, "([59]\\d{7})$|0", "8$1", 0, 0, [["8(?:51(?:0(?:01|30|59|88)|1(?:17|46|75)|2(?:22|35))|91(?:00[6-9]|1(?:[28]1|49|78)|2(?:09|63)|3(?:12|26|75)|4(?:56|97)|64\\d|7(?:0[01]|1[0-2])|958))\\d{3}", [9]], ["4(?:79[01]|83[0-36-9]|95[0-3])\\d{5}|4(?:[0-36]\\d|4[047-9]|[58][0-24-9]|7[02-8]|9[0-47-9])\\d{6}", [9]], ["180(?:0\\d{3}|2)\\d{3}", [7, 10]], ["190[0-26]\\d{6}", [10]], 0, 0, 0, 0, ["14(?:5(?:1[0458]|[23][458])|71\\d)\\d{4}", [9]], ["13(?:00\\d{6}(?:\\d{2})?|45[0-4]\\d{3})|13\\d{4}", [6, 8, 10, 12]]], "0011"], "CY": ["357", "00", "(?:[279]\\d|[58]0)\\d{6}", [8], [["(\\d{2})(\\d{6})", "$1 $2", ["[257-9]"]]]], "CZ": ["420", "00", "(?:[2-578]\\d|60)\\d{7}|9\\d{8,11}", [9, 10, 11, 12], [["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["[2-8]|9[015-7]"]], ["(\\d{2})(\\d{3})(\\d{3})(\\d{2})", "$1 $2 $3 $4", ["96"]], ["(\\d{2})(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3 $4", ["9"]], ["(\\d{3})(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3 $4", ["9"]]]], "DE": ["49", "00", "[2579]\\d{5,14}|49(?:[34]0|69|8\\d)\\d\\d?|49(?:37|49|60|7[089]|9\\d)\\d{1,3}|49(?:2[024-9]|3[2-689]|7[1-7])\\d{1,8}|(?:1|[368]\\d|4[0-8])\\d{3,13}|49(?:[015]\\d|2[13]|31|[46][1-8])\\d{1,9}", [4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15], [["(\\d{2})(\\d{3,13})", "$1 $2", ["3[02]|40|[68]9"], "0$1"], ["(\\d{3})(\\d{3,12})", "$1 $2", ["2(?:0[1-389]|1[124]|2[18]|3[14])|3(?:[35-9][15]|4[015])|906|(?:2[4-9]|4[2-9]|[579][1-9]|[68][1-8])1", "2(?:0[1-389]|12[0-8])|3(?:[35-9][15]|4[015])|906|2(?:[13][14]|2[18])|(?:2[4-9]|4[2-9]|[579][1-9]|[68][1-8])1"], "0$1"], ["(\\d{4})(\\d{2,11})", "$1 $2", ["[24-6]|3(?:[3569][02-46-9]|4[2-4679]|7[2-467]|8[2-46-8])|70[2-8]|8(?:0[2-9]|[1-8])|90[7-9]|[79][1-9]", "[24-6]|3(?:3(?:0[1-467]|2[127-9]|3[124578]|7[1257-9]|8[1256]|9[145])|4(?:2[135]|4[13578]|9[1346])|5(?:0[14]|2[1-3589]|6[1-4]|7[13468]|8[13568])|6(?:2[1-489]|3[124-6]|6[13]|7[12579]|8[1-356]|9[135])|7(?:2[1-7]|4[145]|6[1-5]|7[1-4])|8(?:21|3[1468]|6|7[1467]|8[136])|9(?:0[12479]|2[1358]|4[134679]|6[1-9]|7[136]|8[147]|9[1468]))|70[2-8]|8(?:0[2-9]|[1-8])|90[7-9]|[79][1-9]|3[68]4[1347]|3(?:47|60)[1356]|3(?:3[46]|46|5[49])[1246]|3[4579]3[1357]"], "0$1"], ["(\\d{3})(\\d{4})", "$1 $2", ["138"], "0$1"], ["(\\d{5})(\\d{2,10})", "$1 $2", ["3"], "0$1"], ["(\\d{3})(\\d{5,11})", "$1 $2", ["181"], "0$1"], ["(\\d{3})(\\d)(\\d{4,10})", "$1 $2 $3", ["1(?:3|80)|9"], "0$1"], ["(\\d{3})(\\d{7,8})", "$1 $2", ["1[67]"], "0$1"], ["(\\d{3})(\\d{7,12})", "$1 $2", ["8"], "0$1"], ["(\\d{5})(\\d{6})", "$1 $2", ["185", "1850", "18500"], "0$1"], ["(\\d{3})(\\d{4})(\\d{4})", "$1 $2 $3", ["7"], "0$1"], ["(\\d{4})(\\d{7})", "$1 $2", ["18[68]"], "0$1"], ["(\\d{4})(\\d{7})", "$1 $2", ["15[1279]"], "0$1"], ["(\\d{5})(\\d{6})", "$1 $2", ["15[03568]", "15(?:[0568]|3[13])"], "0$1"], ["(\\d{3})(\\d{8})", "$1 $2", ["18"], "0$1"], ["(\\d{3})(\\d{2})(\\d{7,8})", "$1 $2 $3", ["1(?:6[023]|7)"], "0$1"], ["(\\d{4})(\\d{2})(\\d{7})", "$1 $2 $3", ["15[279]"], "0$1"], ["(\\d{3})(\\d{2})(\\d{8})", "$1 $2 $3", ["15"], "0$1"]], "0"], "DJ": ["253", "00", "(?:2\\d|77)\\d{6}", [8], [["(\\d{2})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[27]"]]]], "DK": ["45", "00", "[2-9]\\d{7}", [8], [["(\\d{2})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[2-9]"]]]], "DM": ["1", "011", "(?:[58]\\d\\d|767|900)\\d{7}", [10], 0, "1", 0, "([2-7]\\d{6})$|1", "767$1", 0, "767"], "DO": ["1", "011", "(?:[58]\\d\\d|900)\\d{7}", [10], 0, "1", 0, 0, 0, 0, "8001|8[024]9"], "DZ": ["213", "00", "(?:[1-4]|[5-79]\\d|80)\\d{7}", [8, 9], [["(\\d{2})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[1-4]"], "0$1"], ["(\\d{2})(\\d{3})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["9"], "0$1"], ["(\\d{3})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[5-8]"], "0$1"]], "0"], "EC": ["593", "00", "1\\d{9,10}|(?:[2-7]|9\\d)\\d{7}", [8, 9, 10, 11], [["(\\d)(\\d{3})(\\d{4})", "$1 $2-$3", ["[2-7]"], "(0$1)", 0, "$1-$2-$3"], ["(\\d{2})(\\d{3})(\\d{4})", "$1 $2 $3", ["9"], "0$1"], ["(\\d{4})(\\d{3})(\\d{3,4})", "$1 $2 $3", ["1"]]], "0"], "EE": ["372", "00", "8\\d{9}|[4578]\\d{7}|(?:[3-8]\\d|90)\\d{5}", [7, 8, 10], [["(\\d{3})(\\d{4})", "$1 $2", ["[369]|4[3-8]|5(?:[0-2]|5[0-478]|6[45])|7[1-9]|88", "[369]|4[3-8]|5(?:[02]|1(?:[0-8]|95)|5[0-478]|6(?:4[0-4]|5[1-589]))|7[1-9]|88"]], ["(\\d{4})(\\d{3,4})", "$1 $2", ["[45]|8(?:00|[1-49])", "[45]|8(?:00[1-9]|[1-49])"]], ["(\\d{2})(\\d{2})(\\d{4})", "$1 $2 $3", ["7"]], ["(\\d{4})(\\d{3})(\\d{3})", "$1 $2 $3", ["8"]]]], "EG": ["20", "00", "[189]\\d{8,9}|[24-6]\\d{8}|[135]\\d{7}", [8, 9, 10], [["(\\d)(\\d{7,8})", "$1 $2", ["[23]"], "0$1"], ["(\\d{2})(\\d{6,7})", "$1 $2", ["1[35]|[4-6]|8[2468]|9[235-7]"], "0$1"], ["(\\d{3})(\\d{3})(\\d{4})", "$1 $2 $3", ["[89]"], "0$1"], ["(\\d{2})(\\d{8})", "$1 $2", ["1"], "0$1"]], "0"], "EH": ["212", "00", "[5-8]\\d{8}", [9], 0, "0", 0, 0, 0, 0, 0, [["528[89]\\d{5}"], ["(?:6(?:[0-79]\\d|8[0-247-9])|7(?:[016-8]\\d|2[0-8]|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|[5-9]\\d\\d)\\d{6}", [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-7]|80[2-46]", "11|2[02]|33|4[04]|79(?:[1-6]|7[19])|80(?:[2-4]|6[0-589])", "11|2[02]|33|4[04]|79(?:[124-6]|3(?:[02-9]|1[0-24-9])|7(?:1|9[1-6]))|80(?:[2-4]|6[0-589])"], "0$1", 1], ["(\\d{3})(\\d{3})(\\d{4})", "$1 $2 $3", ["1(?:2[0-249]|3[0-25]|4[145]|[68]|7[1257])|2(?:1[257]|3[013]|4[01]|5[0137]|6[0158]|78|8[1568])|3(?:26|4[1-3]|5[34]|6[01489]|7[02-46]|8[159])|4(?:1[36]|2[1-47]|5[12]|6[0-26-9]|7[0-24-9]|8[013-57]|9[014-7])|5(?:1[025]|22|[36][25]|4[28]|5[12]|[78]1)|6(?:12|[2-4]1|5[17]|6[13]|80)|7(?:12|3[134]|61|88)|8(?:16|2[014]|3[126]|6[136]|7[078]|8[34]|91)|(?:43|59|75)[15]|(?:1[59]|29|67)[14]", "1(?:2[0-24]|3[0-25]|4[145]|[59][14]|6[1-9]|7[1257]|8[1-57-9])|2(?:1[257]|3[013]|4[01]|5[0137]|6[058]|78|8[1568]|9[14])|3(?:26|4[1-3]|5[34]|6[01489]|7[02-46]|8[159])|4(?:1[36]|2[1-47]|3[15]|5[12]|6[0-26-9]|7[0-24-9]|8[013-57]|9[014-7])|5(?:1[025]|22|[36][25]|4[28]|[578]1|9[15])|674|7(?:(?:3[34]|5[15])[2-6]|61[346]|88[0-8])|8(?:70[2-6]|84[235-7]|91[3-7])|(?:1(?:29|60|8[06])|261|552|6(?:12|[2-47]1|5[17]|6[13]|80)|7(?:12|31)|8(?:16|2[014]|3[126]|6[136]|7[78]|83))[2-7]", "1(?:2[0-24]|3[0-25]|4[145]|[59][14]|6[1-9]|7[1257]|8[1-57-9])|2(?:1[257]|3[013]|4[01]|5[0137]|6[058]|78|8[1568]|9[14])|3(?:26|4[1-3]|5[34]|6[01489]|7[02-46]|8[159])|4(?:1[36]|2[1-47]|3[15]|5[12]|6[0-26-9]|7[0-24-9]|8[013-57]|9[014-7])|5(?:1[025]|22|[36][25]|4[28]|[578]1|9[15])|6(?:12(?:[2-6]|7[0-8])|74[2-7])|7(?:3171|5[15][2-6]|61[346]|88(?:[2-7]|82))|8(?:70[2-6]|84(?:[2356]|7[19])|91(?:[3-6]|7[19]))|73[134][2-6]|8(?:16|2[014]|3[126]|6[136]|7[78]|83)(?:[2-6]|7[19])|(?:1(?:29|60|8[06])|261|552|6(?:[2-4]1|5[17]|6[13]|7(?:1|4[0189])|80)|7(?:12|88[01]))[2-7]"], "0$1", 1], ["(\\d{4})(\\d{3})(\\d{3})", "$1 $2 $3", ["1(?:[2-479]|5[0235-9])|[2-5]|6(?:1[1358]|2[2457-9]|3[2-5]|4[235-7]|5[2-689]|6[24578]|7[235689]|8[1-6])|7(?:1[013-9]|3[129]|5[29]|6[02-5]|70)|807", "1(?:[2-479]|5[0235-9])|[2-5]|6(?:1[1358]|2(?:[2457]|84|95)|3(?:[2-4]|55)|4[235-7]|5[2-689]|6[24578]|7(?:[23569]|8[0-57-9])|8[1-6])|7(?:1(?:[013-8]|9[6-9])|3(?:17|2[0-49]|9[2-57])|5(?:2[1-3]|9[0-6])|6(?:0[5689]|2[5-9]|3[02-8]|4|5[0-367])|70[13-7])|807[19]", "1(?:[2-479]|5(?:[0236-9]|5[013-9]))|[2-5]|6(?:2(?:84|95)|355|8(?:28[235-7]|3))|73179|807(?:1|9[1-3])|(?:1552|6(?:(?:1[1358]|2[2457]|3[2-4]|4[235-7]|5[2-689]|6[24578])\\d|7(?:[23569]\\d|8[0-57-9])|8(?:[14-6]\\d|2[0-79]))|7(?:1(?:[013-8]\\d|9[6-9])|3(?:2[0-49]|9[2-57])|5(?:2[1-3]|9[0-6])|6(?:0[5689]|2[5-9]|3[02-8]|4\\d|5[0-367])|70[13-7]))[2-7]"], "0$1", 1], ["(\\d{5})(\\d{5})", "$1 $2", ["16|[6-9]"], "0$1", 1], ["(\\d{4})(\\d{2,4})(\\d{4})", "$1 $2 $3", ["18[06]", "18[06]0"], 0, 1], ["(\\d{4})(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3 $4", ["18"], 0, 1]], "0"], "IO": ["246", "00", "3\\d{6}", [7], [["(\\d{3})(\\d{4})", "$1 $2", ["3"]]]], "IQ": ["964", "00", "(?:1|7\\d\\d)\\d{7}|[2-6]\\d{7,8}", [8, 9, 10], [["(\\d)(\\d{3})(\\d{4})", "$1 $2 $3", ["1"], "0$1"], ["(\\d{2})(\\d{3})(\\d{3,4})", "$1 $2 $3", ["[2-6]"], "0$1"], ["(\\d{3})(\\d{3})(\\d{4})", "$1 $2 $3", ["7"], "0$1"]], "0"], "IR": ["98", "00", "[1-9]\\d{9}|(?:[1-8]\\d\\d|9)\\d{3,4}", [4, 5, 6, 7, 10], [["(\\d{4,5})", "$1", ["96"], "0$1"], ["(\\d{2})(\\d{4,5})", "$1 $2", ["(?:1[137]|2[13-68]|3[1458]|4[145]|5[1468]|6[16]|7[1467]|8[13467])[12689]"], "0$1"], ["(\\d{3})(\\d{3})(\\d{3,4})", "$1 $2 $3", ["9"], "0$1"], ["(\\d{2})(\\d{4})(\\d{4})", "$1 $2 $3", ["[1-8]"], "0$1"]], "0"], "IS": ["354", "00|1(?:0(?:01|[12]0)|100)", "(?:38\\d|[4-9])\\d{6}", [7, 9], [["(\\d{3})(\\d{4})", "$1 $2", ["[4-9]"]], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["3"]]], 0, 0, 0, 0, 0, 0, 0, "00"], "IT": ["39", "00", "0\\d{5,11}|1\\d{8,10}|3(?:[0-8]\\d{7,10}|9\\d{7,8})|(?:43|55|70)\\d{8}|8\\d{5}(?:\\d{2,4})?", [6, 7, 8, 9, 10, 11, 12], [["(\\d{2})(\\d{4,6})", "$1 $2", ["0[26]"]], ["(\\d{3})(\\d{3,6})", "$1 $2", ["0[13-57-9][0159]|8(?:03|4[17]|9[2-5])", "0[13-57-9][0159]|8(?:03|4[17]|9(?:2|3[04]|[45][0-4]))"]], ["(\\d{4})(\\d{2,6})", "$1 $2", ["0(?:[13-579][2-46-8]|8[236-8])"]], ["(\\d{4})(\\d{4})", "$1 $2", ["894"]], ["(\\d{2})(\\d{3,4})(\\d{4})", "$1 $2 $3", ["0[26]|5"]], ["(\\d{3})(\\d{3})(\\d{3,4})", "$1 $2 $3", ["1(?:44|[679])|[378]|43"]], ["(\\d{3})(\\d{3,4})(\\d{4})", "$1 $2 $3", ["0[13-57-9][0159]|14"]], ["(\\d{2})(\\d{4})(\\d{5})", "$1 $2 $3", ["0[26]"]], ["(\\d{4})(\\d{3})(\\d{4})", "$1 $2 $3", ["0"]], ["(\\d{3})(\\d{4})(\\d{4,5})", "$1 $2 $3", ["[03]"]]], 0, 0, 0, 0, 0, 0, [["0(?:669[0-79]\\d{1,6}|831\\d{2,8})|0(?:1(?:[0159]\\d|[27][1-5]|31|4[1-4]|6[1356]|8[2-57])|2\\d\\d|3(?:[0159]\\d|2[1-4]|3[12]|[48][1-6]|6[2-59]|7[1-7])|4(?:[0159]\\d|[23][1-9]|4[245]|6[1-5]|7[1-4]|81)|5(?:[0159]\\d|2[1-5]|3[2-6]|4[1-79]|6[4-6]|7[1-578]|8[3-8])|6(?:[0-57-9]\\d|6[0-8])|7(?:[0159]\\d|2[12]|3[1-7]|4[2-46]|6[13569]|7[13-6]|8[1-59])|8(?:[0159]\\d|2[3-578]|3[2356]|[6-8][1-5])|9(?:[0159]\\d|[238][1-5]|4[12]|6[1-8]|7[1-6]))\\d{2,7}"], ["3[2-9]\\d{7,8}|(?:31|43)\\d{8}", [9, 10]], ["80(?:0\\d{3}|3)\\d{3}", [6, 9]], ["(?:0878\\d{3}|89(?:2\\d|3[04]|4(?:[0-4]|[5-9]\\d\\d)|5[0-4]))\\d\\d|(?:1(?:44|6[346])|89(?:38|5[5-9]|9))\\d{6}", [6, 8, 9, 10]], ["1(?:78\\d|99)\\d{6}", [9, 10]], ["3[2-8]\\d{9,10}", [11, 12]], 0, 0, ["55\\d{8}", [10]], ["84(?:[08]\\d{3}|[17])\\d{3}", [6, 9]]]], "JE": ["44", "00", "1534\\d{6}|(?:[3578]\\d|90)\\d{8}", [10], 0, "0", 0, "([0-24-8]\\d{5})$|0|180020", "1534$1", 0, 0, [["1534[0-24-8]\\d{5}"], ["7(?:(?:(?:50|82)9|937)\\d|7(?:00[378]|97\\d))\\d{5}"], ["80(?:07(?:35|81)|8901)\\d{4}"], ["(?:8(?:4(?:4(?:4(?:05|42|69)|703)|5(?:041|800))|7(?:0002|1206))|90(?:066[59]|1810|71(?:07|55)))\\d{4}"], ["701511\\d{4}"], 0, ["(?:3(?:0(?:07(?:35|81)|8901)|3\\d{4}|4(?:4(?:4(?:05|42|69)|703)|5(?:041|800))|7(?:0002|1206))|55\\d{4})\\d{4}"], ["76(?:464|652)\\d{5}|76(?:0[0-28]|2[356]|34|4[01347]|5[49]|6[0-369]|77|8[14]|9[139])\\d{6}"], ["56\\d{8}"]]], "JM": ["1", "011", "(?:[58]\\d\\d|658|900)\\d{7}", [10], 0, "1", 0, 0, 0, 0, "658|876"], "JO": ["962", "00", "(?:(?:[2689]|7\\d)\\d|32|427|53)\\d{6}", [8, 9], [["(\\d)(\\d{3})(\\d{4})", "$1 $2 $3", ["[2356]|87"], "(0$1)"], ["(\\d{3})(\\d{5,6})", "$1 $2", ["[89]"], "0$1"], ["(\\d{2})(\\d{7})", "$1 $2", ["70"], "0$1"], ["(\\d)(\\d{4})(\\d{4})", "$1 $2 $3", ["[47]"], "0$1"]], "0"], "JP": ["81", "010", "00[1-9]\\d{6,14}|[25-9]\\d{9}|(?:00|[1-9]\\d\\d)\\d{6}", [8, 9, 10, 11, 12, 13, 14, 15, 16, 17], [["(\\d{3})(\\d{3})(\\d{3})", "$1-$2-$3", ["(?:12|57|99)0"], "0$1"], ["(\\d{4})(\\d)(\\d{4})", "$1-$2-$3", ["1(?:26|3[79]|4[56]|5[4-68]|6[3-5])|499|5(?:76|97)|746|8(?:3[89]|47|51)|9(?:80|9[16])", "1(?:267|3(?:7[247]|9[278])|466|5(?:47|58|64)|6(?:3[245]|48|5[4-68]))|499[2468]|5(?:76|97)9|7468|8(?:3(?:8[7-9]|96)|477|51[2-9])|9(?:802|9(?:1[23]|69))|1(?:45|58)[67]", "1(?:267|3(?:7[247]|9[278])|466|5(?:47|58|64)|6(?:3[245]|48|5[4-68]))|499[2468]|5(?:769|979[2-69])|7468|8(?:3(?:8[7-9]|96[2457-9])|477|51[2-9])|9(?:802|9(?:1[23]|69))|1(?:45|58)[67]"], "0$1"], ["(\\d{2})(\\d{3})(\\d{4})", "$1-$2-$3", ["60"], "0$1"], ["(\\d)(\\d{4})(\\d{4})", "$1-$2-$3", ["3|4(?:2[09]|7[01])|6[1-9]", "3|4(?:2(?:0|9[02-69])|7(?:0[019]|1))|6[1-9]"], "0$1"], ["(\\d{2})(\\d{3})(\\d{4})", "$1-$2-$3", ["1(?:1|5[45]|77|88|9[69])|2(?:2[1-37]|3[0-269]|4[59]|5|6[24]|7[1-358]|8[1369]|9[0-38])|4(?:[28][1-9]|3[0-57]|[45]|6[248]|7[2-579]|9[29])|5(?:2|3[0459]|4[0-369]|5[29]|8[02389]|9[0-389])|7(?:2[02-46-9]|34|[58]|6[0249]|7[57]|9[2-6])|8(?:2[124589]|3[26-9]|49|51|6|7[0-468]|8[68]|9[019])|9(?:[23][1-9]|4[15]|5[138]|6[1-3]|7[156]|8[189]|9[1-489])", "1(?:1|5(?:4[018]|5[017])|77|88|9[69])|2(?:2(?:[127]|3[014-9])|3[0-269]|4[59]|5(?:[1-3]|5[0-69]|9[19])|62|7(?:[1-35]|8[0189])|8(?:[16]|3[0134]|9[0-5])|9(?:[028]|17))|4(?:2(?:[13-79]|8[014-6])|3[0-57]|[45]|6[248]|7[2-47]|8[1-9]|9[29])|5(?:2|3(?:[045]|9[0-8])|4[0-369]|5[29]|8[02389]|9[0-3])|7(?:2[02-46-9]|34|[58]|6[0249]|7[57]|9(?:[23]|4[0-59]|5[01569]|6[0167]))|8(?:2(?:[1258]|4[0-39]|9[0-2469])|3(?:[29]|60)|49|51|6(?:[0-24]|36|5[0-3589]|7[23]|9[01459])|7[0-468]|8[68])|9(?:[23][1-9]|4[15]|5[138]|6[1-3]|7[156]|8[189]|9(?:[1289]|3[34]|4[0178]))|(?:264|837)[016-9]|2(?:57|93)[015-9]|(?:25[0468]|422|838)[01]|(?:47[59]|59[89]|8(?:6[68]|9))[019]", "1(?:1|5(?:4[018]|5[017])|77|88|9[69])|2(?:2[127]|3[0-269]|4[59]|5(?:[1-3]|5[0-69]|9(?:17|99))|6(?:2|4[016-9])|7(?:[1-35]|8[0189])|8(?:[16]|3[0134]|9[0-5])|9(?:[028]|17))|4(?:2(?:[13-79]|8[014-6])|3[0-57]|[45]|6[248]|7[2-47]|9[29])|5(?:2|3(?:[045]|9(?:[0-58]|6[4-9]|7[0-35689]))|4[0-369]|5[29]|8[02389]|9[0-3])|7(?:2[02-46-9]|34|[58]|6[0249]|7[57]|9(?:[23]|4[0-59]|5[01569]|6[0167]))|8(?:2(?:[1258]|4[0-39]|9[0169])|3(?:[29]|60|7(?:[017-9]|6[6-8]))|49|51|6(?:[0-24]|36[2-57-9]|5(?:[0-389]|5[23])|6(?:[01]|9[178])|7(?:2[2-468]|3[78])|9[0145])|7[0-468]|8[68])|9(?:4[15]|5[138]|7[156]|8[189]|9(?:[1289]|3(?:31|4[357])|4[0178]))|(?:8294|96)[1-3]|2(?:57|93)[015-9]|(?:223|8699)[014-9]|(?:25[0468]|422|838)[01]|(?:48|8292|9[23])[1-9]|(?:47[59]|59[89]|8(?:68|9))[019]"], "0$1"], ["(\\d{3})(\\d{2})(\\d{4})", "$1-$2-$3", ["[14]|[289][2-9]|5[3-9]|7[2-4679]"], "0$1"], ["(\\d{3})(\\d{3})(\\d{4})", "$1-$2-$3", ["800"], "0$1"], ["(\\d{2})(\\d{4})(\\d{4})", "$1-$2-$3", ["[25-9]"], "0$1"]], "0", 0, "(000[2569]\\d{4,6})$|(?:(?:003768)0?)|0", "$1"], "KE": ["254", "000", "(?:[17]\\d\\d|900)\\d{6}|(?:2|80)0\\d{6,7}|[4-6]\\d{6,8}", [7, 8, 9, 10], [["(\\d{2})(\\d{5,7})", "$1 $2", ["[24-6]"], "0$1"], ["(\\d{3})(\\d{6})", "$1 $2", ["[17]"], "0$1"], ["(\\d{3})(\\d{3})(\\d{3,4})", "$1 $2 $3", ["[89]"], "0$1"]], "0"], "KG": ["996", "00", "8\\d{9}|[235-9]\\d{8}", [9, 10], [["(\\d{4})(\\d{5})", "$1 $2", ["3(?:1[346]|[24-79])"], "0$1"], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["[235-79]|88"], "0$1"], ["(\\d{3})(\\d{3})(\\d)(\\d{2,3})", "$1 $2 $3 $4", ["8"], "0$1"]], "0"], "KH": ["855", "00[14-9]", "1\\d{9}|[1-9]\\d{7,8}", [8, 9, 10], [["(\\d{2})(\\d{3})(\\d{3,4})", "$1 $2 $3", ["[1-9]"], "0$1"], ["(\\d{4})(\\d{3})(\\d{3})", "$1 $2 $3", ["1"]]], "0"], "KI": ["686", "00", "(?:[37]\\d|6[0-79])\\d{6}|(?:[2-48]\\d|50)\\d{3}", [5, 8], 0, "0"], "KM": ["269", "00", "[3478]\\d{6}", [7], [["(\\d{3})(\\d{2})(\\d{2})", "$1 $2 $3", ["[3478]"]]]], "KN": ["1", "011", "(?:[58]\\d\\d|900)\\d{7}", [10], 0, "1", 0, "([2-7]\\d{6})$|1", "869$1", 0, "869"], "KP": ["850", "00|99", "85\\d{6}|(?:19\\d|[2-7])\\d{7}", [8, 10], [["(\\d{2})(\\d{3})(\\d{3})", "$1 $2 $3", ["8"], "0$1"], ["(\\d)(\\d{3})(\\d{4})", "$1 $2 $3", ["[2-7]"], "0$1"], ["(\\d{3})(\\d{3})(\\d{4})", "$1 $2 $3", ["1"], "0$1"]], "0"], "KR": ["82", "00(?:[125689]|3(?:[46]5|91)|7(?:00|27|3|55|6[126]))", "00[1-9]\\d{8,11}|(?:[12]|5\\d{3})\\d{7}|[13-6]\\d{9}|(?:[1-6]\\d|80)\\d{7}|[3-6]\\d{4,5}|(?:00|7)0\\d{8}", [5, 6, 8, 9, 10, 11, 12, 13, 14], [["(\\d{2})(\\d{3,4})", "$1-$2", ["(?:3[1-3]|[46][1-4]|5[1-5])1"], "0$1"], ["(\\d{4})(\\d{4})", "$1-$2", ["1"]], ["(\\d)(\\d{3,4})(\\d{4})", "$1-$2-$3", ["2"], "0$1"], ["(\\d{2})(\\d{3})(\\d{4})", "$1-$2-$3", ["[36]0|8"], "0$1"], ["(\\d{2})(\\d{3,4})(\\d{4})", "$1-$2-$3", ["[1346]|5[1-5]"], "0$1"], ["(\\d{2})(\\d{4})(\\d{4})", "$1-$2-$3", ["[57]"], "0$1"], ["(\\d{2})(\\d{5})(\\d{4})", "$1-$2-$3", ["5"], "0$1"]], "0", 0, "0(8(?:[1-46-8]|5\\d\\d))?"], "KW": ["965", "00", "18\\d{5}|(?:[2569]\\d|41)\\d{6}", [7, 8], [["(\\d{4})(\\d{3,4})", "$1 $2", ["[169]|2(?:[235]|4[1-35-9])|52"]], ["(\\d{3})(\\d{5})", "$1 $2", ["[245]"]]]], "KY": ["1", "011", "(?:345|[58]\\d\\d|900)\\d{7}", [10], 0, "1", 0, "([2-9]\\d{6})$|1", "345$1", 0, "345"], "KZ": ["7", "810", "8\\d{13}|[78]\\d{9}", [10, 14], 0, "8", 0, 0, 0, 0, "7", 0, "8~10"], "LA": ["856", "00", "[23]\\d{9}|3\\d{8}|(?:[235-8]\\d|41)\\d{6}", [8, 9, 10], [["(\\d{2})(\\d{3})(\\d{3})", "$1 $2 $3", ["2[13]|3[14]|[4-8]"], "0$1"], ["(\\d{2})(\\d{2})(\\d{2})(\\d{3})", "$1 $2 $3 $4", ["3"], "0$1"], ["(\\d{2})(\\d{2})(\\d{3})(\\d{3})", "$1 $2 $3 $4", ["[23]"], "0$1"]], "0"], "LB": ["961", "00", "[27-9]\\d{7}|[13-9]\\d{6}", [7, 8], [["(\\d)(\\d{3})(\\d{3})", "$1 $2 $3", ["[13-69]|7(?:[2-57]|62|8[0-6]|9[04-9])|8[02-9]"], "0$1"], ["(\\d{2})(\\d{3})(\\d{3})", "$1 $2 $3", ["[27-9]"]]], "0"], "LC": ["1", "011", "(?:[58]\\d\\d|758|900)\\d{7}", [10], 0, "1", 0, "([2-8]\\d{6})$|1", "758$1", 0, "758"], "LI": ["423", "00", "[68]\\d{8}|(?:[2378]\\d|90)\\d{5}", [7, 9], [["(\\d{3})(\\d{2})(\\d{2})", "$1 $2 $3", ["[2379]|8(?:0[09]|7)", "[2379]|8(?:0(?:02|9)|7)"]], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["8"]], ["(\\d{2})(\\d{3})(\\d{4})", "$1 $2 $3", ["69"]], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["6"]]], "0", 0, "(1001)|0"], "LK": ["94", "00", "[1-9]\\d{8}", [9], [["(\\d{2})(\\d{3})(\\d{4})", "$1 $2 $3", ["7"], "0$1"], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["[1-689]"], "0$1"]], "0"], "LR": ["231", "00", "(?:[2457]\\d|33|88)\\d{7}|(?:2\\d|[4-6])\\d{6}", [7, 8, 9], [["(\\d)(\\d{3})(\\d{3})", "$1 $2 $3", ["4[67]|[56]"], "0$1"], ["(\\d{2})(\\d{3})(\\d{3})", "$1 $2 $3", ["2"], "0$1"], ["(\\d{2})(\\d{3})(\\d{4})", "$1 $2 $3", ["[2-578]"], "0$1"]], "0"], "LS": ["266", "00", "(?:[256]\\d\\d|800)\\d{5}", [8], [["(\\d{4})(\\d{4})", "$1 $2", ["[2568]"]]]], "LT": ["370", "00", "(?:[3469]\\d|52|[78]0)\\d{6}", [8], [["(\\d)(\\d{3})(\\d{4})", "$1 $2 $3", ["52[0-7]"], "(0-$1)", 1], ["(\\d{3})(\\d{2})(\\d{3})", "$1 $2 $3", ["[7-9]"], "0 $1", 1], ["(\\d{2})(\\d{6})", "$1 $2", ["37|4(?:[15]|6[1-8])"], "(0-$1)", 1], ["(\\d{3})(\\d{5})", "$1 $2", ["[3-6]"], "(0-$1)", 1]], "0", 0, "[08]"], "LU": ["352", "00", "35[013-9]\\d{4,8}|6\\d{8}|35\\d{2,4}|(?:[2457-9]\\d|3[0-46-9])\\d{2,9}", [4, 5, 6, 7, 8, 9, 10, 11], [["(\\d{2})(\\d{3})", "$1 $2", ["2(?:0[2-689]|[2-9])|[3-57]|8(?:0[2-9]|[13-9])|9(?:0[89]|[2-579])"]], ["(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3", ["2(?:0[2-689]|[2-9])|[3-57]|8(?:0[2-9]|[13-9])|9(?:0[89]|[2-579])"]], ["(\\d{2})(\\d{2})(\\d{3})", "$1 $2 $3", ["20[2-689]"]], ["(\\d{2})(\\d{2})(\\d{2})(\\d{1,2})", "$1 $2 $3 $4", ["20"]], ["(\\d{2})(\\d{2})(\\d{2})(\\d{1,5})", "$1 $2 $3 $4", ["[3-57]|8[13-9]|9(?:0[89]|[2-579])|(?:2|80)[2-9]"]], ["(\\d{3})(\\d{2})(\\d{3})", "$1 $2 $3", ["80[01]|90[015]"]], ["(\\d{2})(\\d{2})(\\d{2})(\\d{3})", "$1 $2 $3 $4", ["20"]], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["6"]], ["(\\d{2})(\\d{2})(\\d{2})(\\d{2})(\\d{1,2})", "$1 $2 $3 $4 $5", ["20"]]], 0, 0, "(15(?:0[06]|1[12]|[35]5|4[04]|6[26]|77|88|99)\\d)"], "LV": ["371", "00", "(?:[268]\\d|78|90)\\d{6}", [8], [["(\\d{2})(\\d{3})(\\d{3})", "$1 $2 $3", ["[2679]|8[01]"]]]], "LY": ["218", "00", "[2-9]\\d{8}", [9], [["(\\d{2})(\\d{7})", "$1-$2", ["[2-9]"], "0$1"]], "0"], "MA": ["212", "00", "[5-8]\\d{8}", [9], [["(\\d{4})(\\d{5})", "$1-$2", ["892"], "0$1"], ["(\\d{2})(\\d{7})", "$1-$2", ["8(?:0[0-7]|9)"], "0$1"], ["(\\d)(\\d{2})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4 $5", ["[5-8]"], "0$1"]], "0", 0, 0, 0, 0, "[5-8]"], "MC": ["377", "00", "(?:[3489]|[67]\\d)\\d{7}", [8, 9], [["(\\d{2})(\\d{3})(\\d{3})", "$1 $2 $3", ["4"], "0$1"], ["(\\d{2})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[389]"]], ["(\\d)(\\d{2})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4 $5", ["[67]"], "0$1"]], "0"], "MD": ["373", "00", "(?:[235-7]\\d|[89]0)\\d{6}", [8], [["(\\d{3})(\\d{5})", "$1 $2", ["[89]"], "0$1"], ["(\\d{2})(\\d{3})(\\d{3})", "$1 $2 $3", ["22|3"], "0$1"], ["(\\d{3})(\\d{2})(\\d{3})", "$1 $2 $3", ["[25-7]"], "0$1"]], "0"], "ME": ["382", "00", "(?:20|[3-79]\\d)\\d{6}|80\\d{6,7}", [8, 9], [["(\\d{2})(\\d{3})(\\d{3,4})", "$1 $2 $3", ["[2-9]"], "0$1"]], "0"], "MF": ["590", "00", "7090\\d{5}|(?:[56]9|[89]\\d)\\d{7}", [9], 0, "0", 0, 0, 0, 0, 0, [["(?:59(?:0(?:0[079]|[14]3|[27][79]|3[03-7]|5[0-268]|87)|87\\d)|80[6-9]\\d\\d)\\d{4}"], ["(?:69(?:0\\d\\d|1(?:2[2-9]|3[0-5]))|7090[0-4])\\d{4}"], ["80[0-5]\\d{6}"], ["8[129]\\d{7}"], 0, 0, 0, 0, ["9(?:(?:39[5-7]|76[018])\\d|475[0-6])\\d{4}"]]], "MG": ["261", "00", "[23]\\d{8}", [9], [["(\\d{2})(\\d{2})(\\d{3})(\\d{2})", "$1 $2 $3 $4", ["[23]"], "0$1"]], "0", 0, "([24-9]\\d{6})$|0", "20$1"], "MH": ["692", "011", "329\\d{4}|(?:[256]\\d|45)\\d{5}", [7], [["(\\d{3})(\\d{4})", "$1-$2", ["[2-6]"]]], "1"], "MK": ["389", "00", "[2-578]\\d{7}", [8], [["(\\d)(\\d{3})(\\d{4})", "$1 $2 $3", ["2|34[47]|4(?:[37]7|5[47]|64)"], "0$1"], ["(\\d{2})(\\d{3})(\\d{3})", "$1 $2 $3", ["[347]"], "0$1"], ["(\\d{3})(\\d)(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[58]"], "0$1"]], "0"], "ML": ["223", "00", "[24-9]\\d{7}", [8], [["(\\d{2})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[24-9]"]]]], "MM": ["95", "00", "1\\d{5,7}|95\\d{6}|(?:[4-7]|9[0-46-9])\\d{6,8}|(?:2|8\\d)\\d{5,8}", [6, 7, 8, 9, 10], [["(\\d)(\\d{2})(\\d{3})", "$1 $2 $3", ["16|2"], "0$1"], ["(\\d{2})(\\d{2})(\\d{3})", "$1 $2 $3", ["4(?:[2-46]|5[3-5])|5|6(?:[1-689]|7[235-7])|7(?:[0-4]|5[2-7])|8[1-5]|(?:60|86)[23]"], "0$1"], ["(\\d)(\\d{3})(\\d{3,4})", "$1 $2 $3", ["[12]|452|678|86", "[12]|452|6788|86"], "0$1"], ["(\\d{2})(\\d{3})(\\d{3,4})", "$1 $2 $3", ["[4-7]|8[1-35]"], "0$1"], ["(\\d)(\\d{3})(\\d{4,6})", "$1 $2 $3", ["9(?:2[0-4]|[35-9]|4[137-9])"], "0$1"], ["(\\d)(\\d{4})(\\d{4})", "$1 $2 $3", ["2"], "0$1"], ["(\\d{3})(\\d{3})(\\d{4})", "$1 $2 $3", ["8"], "0$1"], ["(\\d)(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3 $4", ["92"], "0$1"], ["(\\d)(\\d{5})(\\d{4})", "$1 $2 $3", ["9"], "0$1"]], "0"], "MN": ["976", "001", "[12]\\d{7,9}|[5-9]\\d{7}", [8, 9, 10], [["(\\d{2})(\\d{2})(\\d{4})", "$1 $2 $3", ["11|2[16]"], "0$1"], ["(\\d{4})(\\d{4})", "$1 $2", ["[5-9]"]], ["(\\d{3})(\\d{5,6})", "$1 $2", ["[12]2[1-3]"], "0$1"], ["(\\d{4})(\\d{5,6})", "$1 $2", ["[12](?:27|3[2-8]|4[2-68]|5[1-4689])", "[12](?:27|3[2-8]|4[2-68]|5[1-4689])[0-3]"], "0$1"], ["(\\d{5})(\\d{4,5})", "$1 $2", ["[12]"], "0$1"]], "0"], "MO": ["853", "00", "0800\\d{3}|(?:28|[68]\\d)\\d{6}", [7, 8], [["(\\d{4})(\\d{3})", "$1 $2", ["0"]], ["(\\d{4})(\\d{4})", "$1 $2", ["[268]"]]]], "MP": ["1", "011", "[58]\\d{9}|(?:67|90)0\\d{7}", [10], 0, "1", 0, "([2-9]\\d{6})$|1", "670$1", 0, "670"], "MQ": ["596", "00", "7091\\d{5}|(?:[56]9|[89]\\d)\\d{7}", [9], [["(\\d{3})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[5-79]|8(?:0[6-9]|[36])"], "0$1"], ["(\\d{3})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["8"], "0$1"]], "0"], "MR": ["222", "00", "(?:[2-4]\\d\\d|800)\\d{5}", [8], [["(\\d{2})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[2-48]"]]]], "MS": ["1", "011", "(?:[58]\\d\\d|664|900)\\d{7}", [10], 0, "1", 0, "([34]\\d{6})$|1", "664$1", 0, "664"], "MT": ["356", "00", "3550\\d{4}|(?:[2579]\\d\\d|800)\\d{5}", [8], [["(\\d{4})(\\d{4})", "$1 $2", ["[2357-9]"]]]], "MU": ["230", "0(?:0|[24-7]0|3[03])", "(?:[57]|8\\d\\d)\\d{7}|[2-468]\\d{6}", [7, 8, 10], [["(\\d{3})(\\d{4})", "$1 $2", ["[2-46]|8[013]"]], ["(\\d{4})(\\d{4})", "$1 $2", ["[57]"]], ["(\\d{5})(\\d{5})", "$1 $2", ["8"]]], 0, 0, 0, 0, 0, 0, 0, "020"], "MV": ["960", "0(?:0|19)", "(?:800|9[0-57-9]\\d)\\d{7}|[34679]\\d{6}", [7, 10], [["(\\d{3})(\\d{4})", "$1-$2", ["[34679]"]], ["(\\d{3})(\\d{3})(\\d{4})", "$1 $2 $3", ["[89]"]]], 0, 0, 0, 0, 0, 0, 0, "00"], "MW": ["265", "00", "(?:[1289]\\d|31|77)\\d{7}|1\\d{6}", [7, 9], [["(\\d)(\\d{3})(\\d{3})", "$1 $2 $3", ["1[2-9]"], "0$1"], ["(\\d{3})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[1-37-9]"], "0$1"]], "0"], "MX": ["52", "0[09]", "[2-9]\\d{9}", [10], [["(\\d{2})(\\d{4})(\\d{4})", "$1 $2 $3", ["33|5[56]|81"]], ["(\\d{3})(\\d{3})(\\d{4})", "$1 $2 $3", ["[2-9]"]]], 0, 0, 0, 0, 0, 0, 0, "00"], "MY": ["60", "00", "1\\d{8,9}|(?:3\\d|[4-9])\\d{7}", [8, 9, 10], [["(\\d)(\\d{3})(\\d{4})", "$1-$2 $3", ["[4-79]"], "0$1"], ["(\\d{2})(\\d{3})(\\d{3,4})", "$1-$2 $3", ["1(?:[02469]|[378][1-9]|53)|8", "1(?:[02469]|[37][1-9]|53|8(?:[1-46-9]|5[7-9]))|8"], "0$1"], ["(\\d)(\\d{4})(\\d{4})", "$1-$2 $3", ["3"], "0$1"], ["(\\d)(\\d{3})(\\d{2})(\\d{4})", "$1-$2-$3-$4", ["1(?:[367]|80)"]], ["(\\d{3})(\\d{3})(\\d{4})", "$1-$2 $3", ["15"], "0$1"], ["(\\d{2})(\\d{4})(\\d{4})", "$1-$2 $3", ["1"], "0$1"]], "0"], "MZ": ["258", "00", "(?:2|8\\d)\\d{7}", [8, 9], [["(\\d{2})(\\d{3})(\\d{3,4})", "$1 $2 $3", ["2|8[2-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"]], ["(\\d{4})(\\d{4})", "$1 $2", ["[78]"]]], 0, 0, 0, 0, 0, 0, 0, "00"], "PH": ["63", "00", "(?:[2-7]|9\\d)\\d{8}|2\\d{5}|(?:1800|8)\\d{7,9}", [6, 8, 9, 10, 11, 12, 13], [["(\\d)(\\d{5})", "$1 $2", ["2"], "(0$1)"], ["(\\d{4})(\\d{4,6})", "$1 $2", ["3(?:23|39|46)|4(?:2[3-6]|[35]9|4[26]|76)|544|88[245]|(?:52|64|86)2", "3(?:230|397|461)|4(?:2(?:35|[46]4|51)|396|4(?:22|63)|59[347]|76[15])|5(?:221|446)|642[23]|8(?:622|8(?:[24]2|5[13]))"], "(0$1)"], ["(\\d{5})(\\d{4})", "$1 $2", ["346|4(?:27|9[35])|883", "3469|4(?:279|9(?:30|56))|8834"], "(0$1)"], ["(\\d)(\\d{4})(\\d{4})", "$1 $2 $3", ["2"], "(0$1)"], ["(\\d{2})(\\d{3})(\\d{4})", "$1 $2 $3", ["[3-7]|8[2-8]"], "(0$1)"], ["(\\d{3})(\\d{3})(\\d{4})", "$1 $2 $3", ["[89]"], "0$1"], ["(\\d{4})(\\d{3})(\\d{4})", "$1 $2 $3", ["1"]], ["(\\d{4})(\\d{1,2})(\\d{3})(\\d{4})", "$1 $2 $3 $4", ["1"]]], "0"], "PK": ["92", "00", "122\\d{6}|[24-8]\\d{10,11}|9(?:[013-9]\\d{8,10}|2(?:[01]\\d\\d|2(?:[06-8]\\d|1[01]))\\d{7})|(?:[2-8]\\d{3}|92(?:[0-7]\\d|8[1-9]))\\d{6}|[24-9]\\d{8}|[89]\\d{7}", [8, 9, 10, 11, 12], [["(\\d{3})(\\d{3})(\\d{2,7})", "$1 $2 $3", ["[89]0"], "0$1"], ["(\\d{4})(\\d{5})", "$1 $2", ["1"]], ["(\\d{3})(\\d{6,7})", "$1 $2", ["2(?:3[2358]|4[2-4]|9[2-8])|45[3479]|54[2-467]|60[468]|72[236]|8(?:2[2-689]|3[23578]|4[3478]|5[2356])|9(?:2[2-8]|3[27-9]|4[2-6]|6[3569]|9[25-8])", "9(?:2[3-8]|98)|(?:2(?:3[2358]|4[2-4]|9[2-8])|45[3479]|54[2-467]|60[468]|72[236]|8(?:2[2-689]|3[23578]|4[3478]|5[2356])|9(?:22|3[27-9]|4[2-6]|6[3569]|9[25-7]))[2-9]"], "(0$1)"], ["(\\d{2})(\\d{7,8})", "$1 $2", ["(?:2[125]|4[0-246-9]|5[1-35-7]|6[1-8]|7[14]|8[16]|91)[2-9]"], "(0$1)"], ["(\\d{5})(\\d{5})", "$1 $2", ["58"], "(0$1)"], ["(\\d{3})(\\d{7})", "$1 $2", ["3"], "0$1"], ["(\\d{2})(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3 $4", ["2[125]|4[0-246-9]|5[1-35-7]|6[1-8]|7[14]|8[16]|91"], "(0$1)"], ["(\\d{3})(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3 $4", ["[24-9]"], "(0$1)"]], "0"], "PL": ["48", "00", "(?:6|8\\d\\d)\\d{7}|[1-9]\\d{6}(?:\\d{2})?|[26]\\d{5}", [6, 7, 8, 9, 10], [["(\\d{5})", "$1", ["19"]], ["(\\d{3})(\\d{3})", "$1 $2", ["11|20|64"]], ["(\\d{2})(\\d{2})(\\d{3})", "$1 $2 $3", ["30|(?:1[2-8]|2[2-69]|3[2-4]|4[1-468]|5[24-689]|6[1-3578]|7[14-7]|8[1-79]|9[145])1", "30|(?:1[2-8]|2[2-69]|3[2-4]|4[1-468]|5[24-689]|6[1-3578]|7[14-7]|8[1-79]|9[145])19"]], ["(\\d{3})(\\d{2})(\\d{2,3})", "$1 $2 $3", ["64"]], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["21|39|45|5[0137]|6[0469]|7[02389]|8(?:0[14]|8)"]], ["(\\d{2})(\\d{3})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["1[2-8]|[2-7]|8[1-79]|9[145]"]], ["(\\d{3})(\\d{3})(\\d{3,4})", "$1 $2 $3", ["8"]]]], "PM": ["508", "00", "[78]\\d{8}|[2-9]\\d{5}", [6, 9], [["(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3", ["[2-9]"], "0$1"], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["7"]], ["(\\d{3})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["8"], "0$1"]], "0"], "PR": ["1", "011", "(?:[589]\\d\\d|787)\\d{7}", [10], 0, "1", 0, 0, 0, 0, "787|939"], "PS": ["970", "00", "[2489]2\\d{6}|(?:1\\d|5)\\d{8}", [8, 9, 10], [["(\\d)(\\d{3})(\\d{4})", "$1 $2 $3", ["[2489]"], "0$1"], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["5"], "0$1"], ["(\\d{4})(\\d{3})(\\d{3})", "$1 $2 $3", ["1"]]], "0"], "PT": ["351", "00", "1693\\d{5}|(?:[26-9]\\d|30)\\d{7}", [9], [["(\\d{2})(\\d{3})(\\d{4})", "$1 $2 $3", ["2[12]"]], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["16|[236-9]"]]]], "PW": ["680", "01[12]", "(?:[24-8]\\d\\d|345|900)\\d{4}", [7], [["(\\d{3})(\\d{4})", "$1 $2", ["[2-9]"]]]], "PY": ["595", "00", "[36-8]\\d{5,8}|4\\d{6,8}|59\\d{6}|9\\d{5,10}|(?:2\\d|5[0-8])\\d{6,7}", [6, 7, 8, 9, 10, 11], [["(\\d{3})(\\d{3,6})", "$1 $2", ["[2-9]0"], "0$1"], ["(\\d{2})(\\d{5})", "$1 $2", ["3[289]|4[246-8]|61|7[1-3]|8[1-36]"], "(0$1)"], ["(\\d{3})(\\d{4,5})", "$1 $2", ["2[279]|3[13-5]|4[359]|5|6(?:[34]|7[1-46-8])|7[46-8]|85"], "(0$1)"], ["(\\d{2})(\\d{3})(\\d{3,4})", "$1 $2 $3", ["2[14-68]|3[26-9]|4[1246-8]|6(?:1|75)|7[1-35]|8[1-36]"], "(0$1)"], ["(\\d{2})(\\d{3})(\\d{4})", "$1 $2 $3", ["87"]], ["(\\d{3})(\\d{6})", "$1 $2", ["9(?:[5-79]|8[1-7])"], "0$1"], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["[2-8]"], "0$1"], ["(\\d{4})(\\d{3})(\\d{4})", "$1 $2 $3", ["9"]]], "0"], "QA": ["974", "00", "800\\d{4}|(?:2|800)\\d{6}|(?:0080|[3-7])\\d{7}", [7, 8, 9, 11], [["(\\d{3})(\\d{4})", "$1 $2", ["2[136]|8"]], ["(\\d{4})(\\d{4})", "$1 $2", ["[3-7]"]]]], "RE": ["262", "00", "709\\d{6}|(?:26|[689]\\d)\\d{7}", [9], [["(\\d{3})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[26-9]"], "0$1"]], "0", 0, 0, 0, 0, 0, [["2631[0-6]\\d{4}|26(?:2\\d|30|88)\\d{5}"], ["(?:69(?:2\\d\\d|3(?:[06][0-6]|1[0-3]|2[0-2]|3[0-39]|4\\d|5[0-5]|7[0-37]|8[0-8]|9[0-479]))|7092[0-3])\\d{4}"], ["80\\d{7}"], ["89[1-37-9]\\d{6}"], 0, 0, 0, 0, ["9(?:399[0-3]|479[0-6]|76(?:2[278]|3[0-37]))\\d{4}"], ["8(?:1[019]|2[0156]|84|90)\\d{6}"]]], "RO": ["40", "00", "(?:[236-8]\\d|90)\\d{7}|[23]\\d{5}", [6, 9], [["(\\d{3})(\\d{3})", "$1 $2", ["2[3-6]", "2[3-6]\\d9"], "0$1"], ["(\\d{2})(\\d{4})", "$1 $2", ["219|31"], "0$1"], ["(\\d{2})(\\d{3})(\\d{4})", "$1 $2 $3", ["[23]1"], "0$1"], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["[236-9]"], "0$1"]], "0", 0, 0, 0, 0, 0, 0, 0, " int "], "RS": ["381", "00", "38[02-9]\\d{6,9}|6\\d{7,9}|90\\d{4,8}|38\\d{5,6}|(?:7\\d\\d|800)\\d{3,9}|(?:[12]\\d|3[0-79])\\d{5,10}", [6, 7, 8, 9, 10, 11, 12], [["(\\d{3})(\\d{3,9})", "$1 $2", ["(?:2[389]|39)0|[7-9]"], "0$1"], ["(\\d{2})(\\d{5,10})", "$1 $2", ["[1-36]"], "0$1"]], "0"], "RU": ["7", "810", "8\\d{13}|[347-9]\\d{9}", [10, 14], [["(\\d{4})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["7(?:1[0-8]|2[1-9])", "7(?:1(?:[0-356]2|4[29]|7|8[27])|2(?:1[23]|[2-9]2))", "7(?:1(?:[0-356]2|4[29]|7|8[27])|2(?:13[03-69]|62[013-9]))|72[1-57-9]2"], "8 ($1)", 1], ["(\\d{5})(\\d)(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["7(?:1[0-68]|2[1-9])", "7(?:1(?:[06][3-6]|[18]|2[35]|[3-5][3-5])|2(?:[13][3-5]|[24-689]|7[457]))", "7(?:1(?:0(?:[356]|4[023])|[18]|2(?:3[013-9]|5)|3[45]|43[013-79]|5(?:3[1-8]|4[1-7]|5)|6(?:3[0-35-9]|[4-6]))|2(?:1(?:3[178]|[45])|[24-689]|3[35]|7[457]))|7(?:14|23)4[0-8]|71(?:33|45)[1-79]"], "8 ($1)", 1], ["(\\d{3})(\\d{3})(\\d{4})", "$1 $2 $3", ["7"], "8 ($1)", 1], ["(\\d{3})(\\d{3})(\\d{2})(\\d{2})", "$1 $2-$3-$4", ["[349]|8(?:[02-7]|1[1-8])"], "8 ($1)", 1], ["(\\d{4})(\\d{4})(\\d{3})(\\d{3})", "$1 $2 $3 $4", ["8"], "8 ($1)"]], "8", 0, 0, 0, 0, "[3489]", 0, "8~10"], "RW": ["250", "00", "(?:06|[27]\\d\\d|[89]00)\\d{6}", [8, 9], [["(\\d{2})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["0"]], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["2"]], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["[7-9]"], "0$1"]], "0"], "SA": ["966", "00", "(?:[15]\\d|800|92)\\d{7}", [9, 10], [["(\\d{4})(\\d{5})", "$1 $2", ["9"]], ["(\\d{2})(\\d{3})(\\d{4})", "$1 $2 $3", ["1"], "0$1"], ["(\\d{2})(\\d{3})(\\d{4})", "$1 $2 $3", ["5"], "0$1"], ["(\\d{3})(\\d{3})(\\d{4})", "$1 $2 $3", ["8"]]], "0"], "SB": ["677", "0[01]", "[6-9]\\d{6}|[1-6]\\d{4}", [5, 7], [["(\\d{2})(\\d{5})", "$1 $2", ["6[89]|7|8[4-9]|9(?:[1-8]|9[0-8])"]]]], "SC": ["248", "010|0[0-2]", "(?:[2489]\\d|64)\\d{5}", [7], [["(\\d)(\\d{3})(\\d{3})", "$1 $2 $3", ["[246]|9[57]"]]], 0, 0, 0, 0, 0, 0, 0, "00"], "SD": ["249", "00", "[19]\\d{8}", [9], [["(\\d{2})(\\d{3})(\\d{4})", "$1 $2 $3", ["[19]"], "0$1"]], "0"], "SE": ["46", "00", "(?:[26]\\d\\d|9)\\d{9}|[1-9]\\d{8}|[1-689]\\d{7}|[1-4689]\\d{6}|2\\d{5}", [6, 7, 8, 9, 10, 12], [["(\\d{2})(\\d{2,3})(\\d{2})", "$1-$2 $3", ["20"], "0$1", 0, "$1 $2 $3"], ["(\\d{3})(\\d{4})", "$1-$2", ["9(?:00|39|44|9)"], "0$1", 0, "$1 $2"], ["(\\d{2})(\\d{3})(\\d{2})", "$1-$2 $3", ["[12][136]|3[356]|4[0246]|6[03]|90[1-9]"], "0$1", 0, "$1 $2 $3"], ["(\\d)(\\d{2,3})(\\d{2})(\\d{2})", "$1-$2 $3 $4", ["8"], "0$1", 0, "$1 $2 $3 $4"], ["(\\d{3})(\\d{2,3})(\\d{2})", "$1-$2 $3", ["1[2457]|2(?:[247-9]|5[0138])|3[0247-9]|4[1357-9]|5[0-35-9]|6(?:[125689]|4[02-57]|7[0-2])|9(?:[125-8]|3[02-5]|4[0-3])"], "0$1", 0, "$1 $2 $3"], ["(\\d{3})(\\d{2,3})(\\d{3})", "$1-$2 $3", ["9(?:00|39|44)"], "0$1", 0, "$1 $2 $3"], ["(\\d{2})(\\d{2,3})(\\d{2})(\\d{2})", "$1-$2 $3 $4", ["1[13689]|2[0136]|3[1356]|4[0246]|54|6[03]|90[1-9]"], "0$1", 0, "$1 $2 $3 $4"], ["(\\d{2})(\\d{3})(\\d{2})(\\d{2})", "$1-$2 $3 $4", ["10|7"], "0$1", 0, "$1 $2 $3 $4"], ["(\\d)(\\d{3})(\\d{3})(\\d{2})", "$1-$2 $3 $4", ["8"], "0$1", 0, "$1 $2 $3 $4"], ["(\\d{3})(\\d{2})(\\d{2})(\\d{2})", "$1-$2 $3 $4", ["[13-5]|2(?:[247-9]|5[0138])|6(?:[124-689]|7[0-2])|9(?:[125-8]|3[02-5]|4[0-3])"], "0$1", 0, "$1 $2 $3 $4"], ["(\\d{3})(\\d{2})(\\d{2})(\\d{3})", "$1-$2 $3 $4", ["9"], "0$1", 0, "$1 $2 $3 $4"], ["(\\d{3})(\\d{2})(\\d{3})(\\d{2})(\\d{2})", "$1-$2 $3 $4 $5", ["[26]"], "0$1", 0, "$1 $2 $3 $4 $5"]], "0"], "SG": ["65", "0[0-3]\\d", "(?:(?:1\\d|8)\\d\\d|7000)\\d{7}|[3689]\\d{7}", [8, 10, 11], [["(\\d{4})(\\d{4})", "$1 $2", ["[369]|8(?:0[1-9]|[1-9])"]], ["(\\d{3})(\\d{3})(\\d{4})", "$1 $2 $3", ["8"]], ["(\\d{4})(\\d{4})(\\d{3})", "$1 $2 $3", ["7"]], ["(\\d{4})(\\d{3})(\\d{4})", "$1 $2 $3", ["1"]]]], "SH": ["290", "00", "(?:[256]\\d|8)\\d{3}", [4, 5], 0, 0, 0, 0, 0, 0, "[256]"], "SI": ["386", "00|10(?:22|66|88|99)", "[1-7]\\d{7}|8\\d{4,7}|90\\d{4,6}", [5, 6, 7, 8], [["(\\d{2})(\\d{3,6})", "$1 $2", ["8[09]|9"], "0$1"], ["(\\d{3})(\\d{5})", "$1 $2", ["59|8"], "0$1"], ["(\\d{2})(\\d{3})(\\d{3})", "$1 $2 $3", ["[37][01]|4[013]|51|6"], "0$1"], ["(\\d)(\\d{3})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[1-57]"], "(0$1)"]], "0", 0, 0, 0, 0, 0, 0, "00"], "SJ": ["47", "00", "0\\d{4}|(?:[489]\\d|79)\\d{6}", [5, 8], 0, 0, 0, 0, 0, 0, "79"], "SK": ["421", "00", "[2-689]\\d{8}|[2-59]\\d{6}|[2-5]\\d{5}", [6, 7, 9], [["(\\d)(\\d{2})(\\d{3,4})", "$1 $2 $3", ["21"], "0$1"], ["(\\d{2})(\\d{2})(\\d{2,3})", "$1 $2 $3", ["[3-5][1-8]1", "[3-5][1-8]1[67]"], "0$1"], ["(\\d)(\\d{3})(\\d{3})(\\d{2})", "$1 $2 $3 $4", ["2"], "0$1"], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["[689]"], "0$1"], ["(\\d{2})(\\d{3})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[3-5]"], "0$1"]], "0"], "SL": ["232", "00", "(?:[237-9]\\d|66)\\d{6}", [8], [["(\\d{2})(\\d{6})", "$1 $2", ["[236-9]"], "(0$1)"]], "0"], "SM": ["378", "00", "(?:0549|[5-7]\\d)\\d{6}", [8, 10], [["(\\d{2})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[5-7]"]], ["(\\d{4})(\\d{6})", "$1 $2", ["0"]]], 0, 0, "([89]\\d{5})$", "0549$1"], "SN": ["221", "00", "(?:[378]\\d|93)\\d{7}", [9], [["(\\d{3})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["8"]], ["(\\d{2})(\\d{3})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[379]"]]]], "SO": ["252", "00", "[346-9]\\d{8}|[12679]\\d{7}|[1-5]\\d{6}|[1348]\\d{5}", [6, 7, 8, 9], [["(\\d{2})(\\d{4})", "$1 $2", ["8[125]"]], ["(\\d{6})", "$1", ["[134]"]], ["(\\d)(\\d{6})", "$1 $2", ["[15]|2[0-79]|3[0-46-8]|4[0-7]"]], ["(\\d{2})(\\d{5,7})", "$1 $2", ["1|28|9[2-9]"]], ["(\\d)(\\d{7})", "$1 $2", ["[267]|904"]], ["(\\d{2})(\\d{3})(\\d{4})", "$1 $2 $3", ["[346-9]"]]], "0"], "SR": ["597", "00", "(?:[2-5]|[6-9]\\d)\\d{5}", [6, 7], [["(\\d{2})(\\d{2})(\\d{2})", "$1-$2-$3", ["56"]], ["(\\d{3})(\\d{3})", "$1-$2", ["[2-5]"]], ["(\\d{3})(\\d{4})", "$1-$2", ["[6-9]"]]]], "SS": ["211", "00", "[19]\\d{8}", [9], [["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["[19]"], "0$1"]], "0"], "ST": ["239", "00", "(?:22|9\\d)\\d{5}", [7], [["(\\d{3})(\\d{4})", "$1 $2", ["[29]"]]]], "SV": ["503", "00", "[25-7]\\d{7}|(?:80\\d|900)\\d{4}(?:\\d{4})?", [7, 8, 11], [["(\\d{3})(\\d{4})", "$1 $2", ["[89]"]], ["(\\d{4})(\\d{4})", "$1 $2", ["[25-7]"]], ["(\\d{3})(\\d{4})(\\d{4})", "$1 $2 $3", ["[89]"]]]], "SX": ["1", "011", "7215\\d{6}|(?:[58]\\d\\d|900)\\d{7}", [10], 0, "1", 0, "(5\\d{6})$|1", "721$1", 0, "721"], "SY": ["963", "00", "[1-359]\\d{8}|[1-5]\\d{7}", [8, 9], [["(\\d{2})(\\d{3})(\\d{3,4})", "$1 $2 $3", ["[1-4]|5[1-3]"], "0$1", 1], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["[59]"], "0$1", 1]], "0"], "SZ": ["268", "00", "0800\\d{4}|(?:[237]\\d|900)\\d{6}", [8, 9], [["(\\d{4})(\\d{4})", "$1 $2", ["[0237]"]], ["(\\d{5})(\\d{4})", "$1 $2", ["9"]]]], "TA": ["290", "00", "8\\d{3}", [4], 0, 0, 0, 0, 0, 0, "8"], "TC": ["1", "011", "(?:[58]\\d\\d|649|900)\\d{7}", [10], 0, "1", 0, "([2-479]\\d{6})$|1", "649$1", 0, "649"], "TD": ["235", "00|16", "(?:22|[3689]\\d|77)\\d{6}", [8], [["(\\d{2})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[236-9]"]]], 0, 0, 0, 0, 0, 0, 0, "00"], "TG": ["228", "00", "[279]\\d{7}", [8], [["(\\d{2})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[279]"]]]], "TH": ["66", "00[1-9]", "(?:001800|[2-57]|[689]\\d)\\d{7}|1\\d{7,9}", [8, 9, 10, 13], [["(\\d)(\\d{3})(\\d{4})", "$1 $2 $3", ["2"], "0$1"], ["(\\d{2})(\\d{3})(\\d{3,4})", "$1 $2 $3", ["[13-9]"], "0$1"], ["(\\d{4})(\\d{3})(\\d{3})", "$1 $2 $3", ["1"]]], "0"], "TJ": ["992", "810", "(?:[0-57-9]\\d|66)\\d{7}", [9], [["(\\d{6})(\\d)(\\d{2})", "$1 $2 $3", ["331", "3317"]], ["(\\d{3})(\\d{2})(\\d{4})", "$1 $2 $3", ["44[02-479]|[34]7"]], ["(\\d{4})(\\d)(\\d{4})", "$1 $2 $3", ["3(?:[1245]|3[12])"]], ["(\\d{2})(\\d{3})(\\d{4})", "$1 $2 $3", ["\\d"]]], 0, 0, 0, 0, 0, 0, 0, "8~10"], "TK": ["690", "00", "[2-47]\\d{3,6}", [4, 5, 6, 7]], "TL": ["670", "00", "7\\d{7}|(?:[2-47]\\d|[89]0)\\d{5}", [7, 8], [["(\\d{3})(\\d{4})", "$1 $2", ["[2-489]|70"]], ["(\\d{4})(\\d{4})", "$1 $2", ["7"]]]], "TM": ["993", "810", "[1-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, [["(?:472[2-47-9]|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[0589]|8[04])|5(?:0[1-57-9]|1[0235-8]|20|3[0149]|4[01]|5[179]|6[1-47]|7[0-5]|8[0256])|6(?:0[1-35-9]|1[024-9]|2[03689]|3[016]|4[0156]|5[01679]|6[0-279]|78|8[0-269])|7(?:0[1-46-8]|1[2-9]|2[04-8]|3[0-2478]|4[0378]|5[47]|6[02359]|7[0-59]|8[156])|8(?:0[1-68]|1[02-8]|2[0168]|3[0-2589]|4[03578]|5[046-9]|6[02-5]|7[028])|9(?:0[1346-9]|1[02-9]|2[0589]|3[0146-8]|4[01357-9]|5[12469]|7[0-3589]|8[04-69]))[2-9]\\d{6}"], [""], ["8(?:00|33|44|55|66|77|88)[2-9]\\d{6}"], ["900[2-9]\\d{6}"], ["52(?:3(?:[2-46-9][02-9]\\d|5(?:[02-46-9]\\d|5[0-46-9]))|4(?:[2-478][02-9]\\d|5(?:[034]\\d|2[024-9]|5[0-46-9])|6(?:0[1-9]|[2-9]\\d)|9(?:[05-9]\\d|2[0-5]|49)))\\d{4}|52[34][2-9]1[02-9]\\d{4}|5(?:00|2[125-9]|3[23]|44|66|77|88)[2-9]\\d{6}"]]], "UY": ["598", "0(?:0|1[3-9]\\d)", "0004\\d{2,9}|[1249]\\d{7}|2\\d{3,4}|(?:[49]\\d|80)\\d{5}", [4, 5, 6, 7, 8, 9, 10, 11, 12, 13], [["(\\d{4,5})", "$1", ["21"]], ["(\\d{3})(\\d{3,4})", "$1 $2", ["0"]], ["(\\d{3})(\\d{4})", "$1 $2", ["[49]0|8"], "0$1"], ["(\\d{2})(\\d{3})(\\d{3})", "$1 $2 $3", ["9"], "0$1"], ["(\\d{4})(\\d{4})", "$1 $2", ["[124]"]], ["(\\d{3})(\\d{3})(\\d{2,4})", "$1 $2 $3", ["0"]], ["(\\d{3})(\\d{3})(\\d{3})(\\d{2,4})", "$1 $2 $3 $4", ["0"]]], "0", 0, 0, 0, 0, 0, 0, "00", " int. "], "UZ": ["998", "00", "(?:20|33|[5-9]\\d)\\d{7}", [9], [["(\\d{2})(\\d{3})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[235-9]"]]]], "VA": ["39", "00", "0\\d{5,10}|3[0-8]\\d{7,10}|55\\d{8}|8\\d{5}(?:\\d{2,4})?|(?:1\\d|39)\\d{7,8}", [6, 7, 8, 9, 10, 11, 12], 0, 0, 0, 0, 0, 0, "06698"], "VC": ["1", "011", "(?:[58]\\d\\d|784|900)\\d{7}", [10], 0, "1", 0, "([2-7]\\d{6})$|1", "784$1", 0, "784"], "VE": ["58", "00", "[68]00\\d{7}|(?:[24]\\d|[59]0)\\d{8}", [10], [["(\\d{3})(\\d{7})", "$1-$2", ["[24-689]"], "0$1"]], "0"], "VG": ["1", "011", "(?:284|[58]\\d\\d|900)\\d{7}", [10], 0, "1", 0, "([2-578]\\d{6})$|1", "284$1", 0, "284"], "VI": ["1", "011", "[58]\\d{9}|(?:34|90)0\\d{7}", [10], 0, "1", 0, "([2-9]\\d{6})$|1", "340$1", 0, "340"], "VN": ["84", "00", "[12]\\d{9}|[135-9]\\d{8}|[16]\\d{6,7}|7\\d{6}", [7, 8, 9, 10], [["(\\d{4})(\\d{4,6})", "$1 $2", ["1(?:2[02]|[89])"], 0, 1], ["(\\d{2})(\\d{3})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["1[26]|6"], "0$1", 1], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["[357-9]"], "0$1", 1], ["(\\d{2})(\\d{4})(\\d{4})", "$1 $2 $3", ["2[48]"], "0$1", 1], ["(\\d{3})(\\d{4})(\\d{3})", "$1 $2 $3", ["2"], "0$1", 1]], "0"], "VU": ["678", "00", "[57-9]\\d{6}|(?:[238]\\d|48)\\d{3}", [5, 7], [["(\\d{3})(\\d{4})", "$1 $2", ["[57-9]"]]]], "WF": ["681", "00", "(?:40|72|8\\d{4})\\d{4}|[89]\\d{5}", [6, 9], [["(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3", ["[47-9]"]], ["(\\d{3})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["8"]]]], "WS": ["685", "0", "(?:[2-6]|8\\d{5})\\d{4}|[78]\\d{6}|[68]\\d{5}", [5, 6, 7, 10], [["(\\d{5})", "$1", ["[2-5]|6[1-9]"]], ["(\\d{3})(\\d{3,7})", "$1 $2", ["[68]"]], ["(\\d{2})(\\d{5})", "$1 $2", ["7"]]]], "XK": ["383", "00", "2\\d{7,8}|3\\d{7,11}|(?:4\\d\\d|[89]00)\\d{5}", [8, 9, 10, 11, 12], [["(\\d{3})(\\d{5})", "$1 $2", ["[89]"], "0$1"], ["(\\d{2})(\\d{3})(\\d{3})", "$1 $2 $3", ["[2-4]"], "0$1"], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["2|39"], "0$1"], ["(\\d{2})(\\d{7,10})", "$1 $2", ["3"], "0$1"]], "0"], "YE": ["967", "00", "(?:1|7\\d)\\d{7}|[1-7]\\d{6}", [7, 8, 9], [["(\\d)(\\d{3})(\\d{3,4})", "$1 $2 $3", ["[1-6]|7(?:[24-6]|8[0-7])"], "0$1"], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["7"], "0$1"]], "0"], "YT": ["262", "00", "(?:639\\d|7093)\\d{5}|(?:26|80|9\\d)\\d{7}", [9], 0, "0", 0, 0, 0, 0, 0, [["26(?:89\\d|9(?:0[0-467]|15|5[0-4]|6\\d|[78]0))\\d{4}"], ["(?:639(?:0[0-79]|1[019]|[267]\\d|3[09]|40|5[05-9]|9[04-79])|7093[5-7])\\d{4}"], ["80\\d{7}"], 0, 0, 0, 0, 0, ["9(?:(?:39|47)8[01]|769\\d)\\d{4}"]]], "ZA": ["27", "00", "[1-79]\\d{8}|8\\d{4,9}", [5, 6, 7, 8, 9, 10], [["(\\d{2})(\\d{3,4})", "$1 $2", ["8[1-4]"], "0$1"], ["(\\d{2})(\\d{3})(\\d{2,3})", "$1 $2 $3", ["8[1-4]"], "0$1"], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["860"], "0$1"], ["(\\d{2})(\\d{3})(\\d{4})", "$1 $2 $3", ["[1-9]"], "0$1"], ["(\\d{3})(\\d{3})(\\d{4})", "$1 $2 $3", ["8"], "0$1"]], "0"], "ZM": ["260", "00", "800\\d{6}|(?:21|[579]\\d|63)\\d{7}", [9], [["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["[28]"], "0$1"], ["(\\d{2})(\\d{7})", "$1 $2", ["[579]"], "0$1"]], "0"], "ZW": ["263", "00", "2(?:[0-57-9]\\d{6,8}|6[0-24-9]\\d{6,7})|[38]\\d{9}|[35-8]\\d{8}|[3-6]\\d{7}|[1-689]\\d{6}|[1-3569]\\d{5}|[1356]\\d{4}", [5, 6, 7, 8, 9, 10], [["(\\d{3})(\\d{3,5})", "$1 $2", ["2(?:0[45]|2[278]|[49]8)|3(?:[09]8|17)|6(?:[29]8|37|75)|[23][78]|(?:33|5[15]|6[68])[78]"], "0$1"], ["(\\d)(\\d{3})(\\d{2,4})", "$1 $2 $3", ["[49]"], "0$1"], ["(\\d{3})(\\d{4})", "$1 $2", ["80"], "0$1"], ["(\\d{2})(\\d{7})", "$1 $2", ["24|8[13-59]|(?:2[05-79]|39|5[45]|6[15-8])2", "2(?:02[014]|4|[56]20|[79]2)|392|5(?:42|525)|6(?:[16-8]21|52[013])|8[13-59]"], "(0$1)"], ["(\\d{2})(\\d{3})(\\d{4})", "$1 $2 $3", ["7"], "0$1"], ["(\\d{3})(\\d{3})(\\d{3,4})", "$1 $2 $3", ["2(?:1[39]|2[0157]|[378]|[56][14])|3(?:12|29)", "2(?:1[39]|2[0157]|[378]|[56][14])|3(?:123|29)"], "0$1"], ["(\\d{4})(\\d{6})", "$1 $2", ["8"], "0$1"], ["(\\d{2})(\\d{3,5})", "$1 $2", ["1|2(?:0[0-36-9]|12|29|[56])|3(?:1[0-689]|[24-6])|5(?:[0236-9]|1[2-4])|6(?:[013-59]|7[0-46-9])|(?:33|55|6[68])[0-69]|(?:29|3[09]|62)[0-79]"], "0$1"], ["(\\d{2})(\\d{3})(\\d{3,4})", "$1 $2 $3", ["29[013-9]|39|54"], "0$1"], ["(\\d{4})(\\d{3,5})", "$1 $2", ["(?:25|54)8", "258|5483"], "0$1"]], "0"] }, "nonGeographic": { "800": ["800", 0, "(?:00|[1-9]\\d)\\d{6}", [8], [["(\\d{4})(\\d{4})", "$1 $2", ["\\d"]]], 0, 0, 0, 0, 0, 0, [0, 0, ["(?:00|[1-9]\\d)\\d{6}"]]], "808": ["808", 0, "[1-9]\\d{7}", [8], [["(\\d{4})(\\d{4})", "$1 $2", ["[1-9]"]]], 0, 0, 0, 0, 0, 0, [0, 0, 0, 0, 0, 0, 0, 0, 0, ["[1-9]\\d{7}"]]], "870": ["870", 0, "7\\d{11}|[235-7]\\d{8}", [9, 12], [["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["[235-7]"]]], 0, 0, 0, 0, 0, 0, [0, ["(?:[356]|774[45])\\d{8}|7[6-8]\\d{7}"], 0, 0, 0, 0, 0, 0, ["2\\d{8}", [9]]]], "878": ["878", 0, "10\\d{10}", [12], [["(\\d{2})(\\d{5})(\\d{5})", "$1 $2 $3", ["1"]]], 0, 0, 0, 0, 0, 0, [0, 0, 0, 0, 0, 0, 0, 0, ["10\\d{10}"]]], "881": ["881", 0, "6\\d{9}|[0-36-9]\\d{8}", [9, 10], [["(\\d)(\\d{3})(\\d{5})", "$1 $2 $3", ["[0-37-9]"]], ["(\\d)(\\d{3})(\\d{5,6})", "$1 $2 $3", ["6"]]], 0, 0, 0, 0, 0, 0, [0, ["6\\d{9}|[0-36-9]\\d{8}"]]], "882": ["882", 0, "[13]\\d{6}(?:\\d{2,5})?|[19]\\d{7}|(?:[25]\\d\\d|4)\\d{7}(?:\\d{2})?", [7, 8, 9, 10, 11, 12], [["(\\d{2})(\\d{5})", "$1 $2", ["16|342"]], ["(\\d{2})(\\d{6})", "$1 $2", ["49"]], ["(\\d{2})(\\d{2})(\\d{4})", "$1 $2 $3", ["1[36]|9"]], ["(\\d{2})(\\d{4})(\\d{3})", "$1 $2 $3", ["3[23]"]], ["(\\d{2})(\\d{3,4})(\\d{4})", "$1 $2 $3", ["16"]], ["(\\d{2})(\\d{4})(\\d{4})", "$1 $2 $3", ["10|23|3(?:[15]|4[57])|4|5[12]"]], ["(\\d{3})(\\d{4})(\\d{4})", "$1 $2 $3", ["34"]], ["(\\d{2})(\\d{4,5})(\\d{5})", "$1 $2 $3", ["[1-35]"]]], 0, 0, 0, 0, 0, 0, [0, ["342\\d{4}|(?:337|49)\\d{6}|(?:3(?:2|47|7\\d{3})|5(?:0\\d{3}|2[0-2]))\\d{7}", [7, 8, 9, 10, 12]], 0, 0, 0, ["348[57]\\d{7}", [11]], 0, 0, ["1(?:3(?:0[0347]|[13][0139]|2[035]|4[013568]|6[0459]|7[06]|8[15-8]|9[0689])\\d{4}|6\\d{5,10})|(?:345\\d|9[89])\\d{6}|(?:10|2(?:3|85\\d)|3(?:[15]|[69]\\d\\d)|4[15-8]|51)\\d{8}"]]], "883": ["883", 0, "(?:[1-4]\\d|51)\\d{6,10}", [8, 9, 10, 11, 12], [["(\\d{3})(\\d{3})(\\d{2,8})", "$1 $2 $3", ["[14]|2[24-689]|3[02-689]|51[24-9]"]], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["510"]], ["(\\d{3})(\\d{3})(\\d{4})", "$1 $2 $3", ["21"]], ["(\\d{4})(\\d{4})(\\d{4})", "$1 $2 $3", ["51[13]"]], ["(\\d{3})(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3 $4", ["[235]"]]], 0, 0, 0, 0, 0, 0, [0, 0, 0, 0, 0, 0, 0, 0, ["(?:2(?:00\\d\\d|10)|(?:370[1-9]|51\\d0)\\d)\\d{7}|51(?:00\\d{5}|[24-9]0\\d{4,7})|(?:1[0-79]|2[24-689]|3[02-689]|4[0-4])0\\d{5,9}"]]], "888": ["888", 0, "\\d{11}", [11], [["(\\d{3})(\\d{3})(\\d{5})", "$1 $2 $3"]], 0, 0, 0, 0, 0, 0, [0, 0, 0, 0, 0, 0, ["\\d{11}"]]], "979": ["979", 0, "[1359]\\d{8}", [9], [["(\\d)(\\d{4})(\\d{4})", "$1 $2 $3", ["[1359]"]]], 0, 0, 0, 0, 0, 0, [0, 0, 0, ["[1359]\\d{8}"]]] } };
13948
+ 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]|95[0-3])\\d{5}|4(?:[0-36]\\d|4[047-9]|[58][0-24-9]|7[02-8]|9[0-47-9])\\d{6}", [9]], ["180(?:0\\d{3}|2)\\d{3}", [7, 10]], ["190[0-26]\\d{6}", [10]], 0, 0, 0, ["163\\d{2,6}", [5, 6, 7, 8, 9]], ["14(?:5(?:1[0458]|[23][458])|71\\d)\\d{4}", [9]], ["13(?:00\\d{6}(?:\\d{2})?|45[0-4]\\d{3})|13\\d{4}", [6, 8, 10, 12]]], "0011"], "AW": ["297", "00", "(?:[25-79]\\d\\d|800)\\d{4}", [7], [["(\\d{3})(\\d{4})", "$1 $2", ["[25-9]"]]]], "AX": ["358", "00|99(?:[01469]|5(?:[14]1|3[23]|5[59]|77|88|9[09]))", "2\\d{4,9}|35\\d{4,5}|(?:60\\d\\d|800)\\d{4,6}|7\\d{5,11}|(?:[14]\\d|3[0-46-9]|50)\\d{4,8}", [5, 6, 7, 8, 9, 10, 11, 12], 0, "0", 0, 0, 0, 0, "18", 0, "00"], "AZ": ["994", "00", "365\\d{6}|(?:[124579]\\d|60|88)\\d{7}", [9], [["(\\d{3})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["90"], "0$1"], ["(\\d{2})(\\d{3})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["1[28]|2|365|46", "1[28]|2|365[45]|46", "1[28]|2|365(?:4|5[02])|46"], "(0$1)"], ["(\\d{2})(\\d{3})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[13-9]"], "0$1"]], "0"], "BA": ["387", "00", "6\\d{8}|(?:[35689]\\d|49|70)\\d{6}", [8, 9], [["(\\d{2})(\\d{3})(\\d{3})", "$1 $2 $3", ["6[1-3]|[7-9]"], "0$1"], ["(\\d{2})(\\d{3})(\\d{3})", "$1 $2-$3", ["[3-5]|6[56]"], "0$1"], ["(\\d{2})(\\d{2})(\\d{2})(\\d{3})", "$1 $2 $3 $4", ["6"], "0$1"]], "0"], "BB": ["1", "011", "(?:246|[58]\\d\\d|900)\\d{7}", [10], 0, "1", 0, "([2-9]\\d{6})$|1", "246$1", 0, "246"], "BD": ["880", "00", "[1-469]\\d{9}|8[0-79]\\d{7,8}|[2-79]\\d{8}|[2-9]\\d{7}|[3-9]\\d{6}|[57-9]\\d{5}", [6, 7, 8, 9, 10], [["(\\d{2})(\\d{4,6})", "$1-$2", ["31[5-8]|[459]1"], "0$1"], ["(\\d{3})(\\d{3,7})", "$1-$2", ["3(?:[67]|8[013-9])|4(?:6[168]|7|[89][18])|5(?:6[128]|9)|6(?:[15]|28|4[14])|7[2-589]|8(?:0[014-9]|[12])|9[358]|(?:3[2-5]|4[235]|5[2-578]|6[0389]|76|8[3-7]|9[24])1|(?:44|66)[01346-9]"], "0$1"], ["(\\d{4})(\\d{3,6})", "$1-$2", ["[13-9]|2[23]"], "0$1"], ["(\\d)(\\d{7,8})", "$1-$2", ["2"], "0$1"]], "0"], "BE": ["32", "00", "4\\d{8}|[1-9]\\d{7}", [8, 9], [["(\\d{3})(\\d{2})(\\d{3})", "$1 $2 $3", ["(?:80|9)0"], "0$1"], ["(\\d)(\\d{3})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[239]|4[23]"], "0$1"], ["(\\d{2})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[15-8]"], "0$1"], ["(\\d{3})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["4"], "0$1"]], "0"], "BF": ["226", "00", "[024-7]\\d{7}", [8], [["(\\d{2})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[024-7]"]]]], "BG": ["359", "00", "00800\\d{7}|[2-7]\\d{6,7}|[89]\\d{6,8}|2\\d{5}", [6, 7, 8, 9, 12], [["(\\d)(\\d)(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["2"], "0$1"], ["(\\d{3})(\\d{4})", "$1 $2", ["43[1-6]|70[1-9]"], "0$1"], ["(\\d)(\\d{3})(\\d{3,4})", "$1 $2 $3", ["2"], "0$1"], ["(\\d{2})(\\d{3})(\\d{2,3})", "$1 $2 $3", ["[356]|4[124-7]|7[1-9]|8[1-6]|9[1-7]"], "0$1"], ["(\\d{3})(\\d{2})(\\d{3})", "$1 $2 $3", ["(?:70|8)0"], "0$1"], ["(\\d{3})(\\d{3})(\\d{2})", "$1 $2 $3", ["43[1-7]|7"], "0$1"], ["(\\d{2})(\\d{3})(\\d{3,4})", "$1 $2 $3", ["[48]|9[08]"], "0$1"], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["9"], "0$1"]], "0"], "BH": ["973", "00", "[136-9]\\d{7}", [8], [["(\\d{4})(\\d{4})", "$1 $2", ["[13679]|8[02-4679]"]]]], "BI": ["257", "00", "(?:[267]\\d|31)\\d{6}", [8], [["(\\d{2})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[2367]"]]]], "BJ": ["229", "00", "(?:01\\d|8)\\d{7}", [8, 10], [["(\\d{2})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["8"]], ["(\\d{2})(\\d{2})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4 $5", ["0"]]]], "BL": ["590", "00", "7090\\d{5}|(?:[56]9|[89]\\d)\\d{7}", [9], 0, "0", 0, 0, 0, 0, 0, [["(?:59(?:0(?:2[7-9]|3[3-7]|5[12]|87)|87\\d)|80[6-9]\\d\\d)\\d{4}"], ["(?:69(?:0\\d\\d|1(?:2[2-9]|3[0-5]))|7090[0-4])\\d{4}"], ["80[0-5]\\d{6}"], ["8[129]\\d{7}"], 0, 0, 0, 0, ["9(?:(?:39[5-7]|76[018])\\d|475[0-6])\\d{4}"]]], "BM": ["1", "011", "(?:441|[58]\\d\\d|900)\\d{7}", [10], 0, "1", 0, "([2-9]\\d{6})$|1", "441$1", 0, "441"], "BN": ["673", "00", "[2-578]\\d{6}", [7], [["(\\d{3})(\\d{4})", "$1 $2", ["[2-578]"]]]], "BO": ["591", "00(?:1\\d)?", "(?:[2-7]\\d\\d|8001)\\d{5}", [8, 9], [["(\\d)(\\d{7})", "$1 $2", ["[23]|4[46]|50"]], ["(\\d{8})", "$1", ["[5-7]"]], ["(\\d{3})(\\d{2})(\\d{4})", "$1 $2 $3", ["8"]]], "0", 0, "0(1\\d)?"], "BQ": ["599", "00", "(?:[34]1|7\\d)\\d{5}", [7], 0, 0, 0, 0, 0, 0, "[347]"], "BR": ["55", "00(?:1[245]|2[1-35]|31|4[13]|[56]5|99)", "[1-467]\\d{9,10}|55[0-46-9]\\d{8}|[34]\\d{7}|55\\d{7,8}|(?:5[0-46-9]|[89]\\d)\\d{7,9}", [8, 9, 10, 11], [["(\\d{4})(\\d{4})", "$1-$2", ["300|4(?:0[02]|37|86)", "300|4(?:0(?:0|20)|370|864)"]], ["(\\d{3})(\\d{2,3})(\\d{4})", "$1 $2 $3", ["(?:[358]|90)0"], "0$1"], ["(\\d{2})(\\d{4})(\\d{4})", "$1 $2-$3", ["(?:[14689][1-9]|2[12478]|3[1-578]|5[13-5]|7[13-579])[2-57]"], "($1)"], ["(\\d{2})(\\d{5})(\\d{4})", "$1 $2-$3", ["[16][1-9]|[2-57-9]"], "($1)"]], "0", 0, "(?:0|90)(?:(1[245]|2[1-35]|31|4[13]|[56]5|99)(\\d{10,11}))?", "$2"], "BS": ["1", "011", "(?:242|[58]\\d\\d|900)\\d{7}", [10], 0, "1", 0, "([3-8]\\d{6})$|1", "242$1", 0, "242"], "BT": ["975", "00", "[178]\\d{7}|[2-8]\\d{6}", [7, 8], [["(\\d)(\\d{3})(\\d{3})", "$1 $2 $3", ["[2-6]|7[246]|8[2-4]"]], ["(\\d{2})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["1[67]|[78]"]]]], "BW": ["267", "00", "(?:0800|(?:[37]|800)\\d)\\d{6}|(?:[2-6]\\d|90)\\d{5}", [7, 8, 10], [["(\\d{2})(\\d{5})", "$1 $2", ["90"]], ["(\\d{3})(\\d{4})", "$1 $2", ["[24-6]|3[15-9]"]], ["(\\d{2})(\\d{3})(\\d{3})", "$1 $2 $3", ["[37]"]], ["(\\d{4})(\\d{3})(\\d{3})", "$1 $2 $3", ["0"]], ["(\\d{3})(\\d{4})(\\d{3})", "$1 $2 $3", ["8"]]]], "BY": ["375", "810", "(?:[12]\\d|33|44|902)\\d{7}|8(?:0[0-79]\\d{5,7}|[1-7]\\d{9})|8(?:1[0-489]|[5-79]\\d)\\d{7}|8[1-79]\\d{6,7}|8[0-79]\\d{5}|8\\d{5}", [6, 7, 8, 9, 10, 11], [["(\\d{3})(\\d{3})", "$1 $2", ["800"], "8 $1"], ["(\\d{3})(\\d{2})(\\d{2,4})", "$1 $2 $3", ["800"], "8 $1"], ["(\\d{4})(\\d{2})(\\d{3})", "$1 $2-$3", ["1(?:5[169]|6[3-5]|7[179])|2(?:1[35]|2[34]|3[3-5])", "1(?:5[169]|6(?:3[1-3]|4|5[125])|7(?:1[3-9]|7[0-24-6]|9[2-7]))|2(?:1[35]|2[34]|3[3-5])"], "8 0$1"], ["(\\d{3})(\\d{2})(\\d{2})(\\d{2})", "$1 $2-$3-$4", ["1(?:[56]|7[467])|2[1-3]"], "8 0$1"], ["(\\d{2})(\\d{3})(\\d{2})(\\d{2})", "$1 $2-$3-$4", ["[1-4]"], "8 0$1"], ["(\\d{3})(\\d{3,4})(\\d{4})", "$1 $2 $3", ["[89]"], "8 $1"]], "8", 0, "0|80?", 0, 0, 0, 0, "8~10"], "BZ": ["501", "00", "(?:0800\\d|[2-8])\\d{6}", [7, 11], [["(\\d{3})(\\d{4})", "$1-$2", ["[2-8]"]], ["(\\d)(\\d{3})(\\d{4})(\\d{3})", "$1-$2-$3-$4", ["0"]]]], "CA": ["1", "011", "[2-9]\\d{9}|3\\d{6}", [7, 10], 0, "1", 0, 0, 0, 0, 0, [["(?:2(?:04|[23]6|[48]9|5[07]|63)|3(?:06|43|54|6[578]|82)|4(?:03|1[68]|[26]8|3[178]|50|74)|5(?:06|1[49]|48|79|8[147])|6(?:04|[18]3|39|47|72)|7(?:0[59]|42|53|78|8[02])|8(?:[06]7|19|25|7[39])|9(?:0[25]|42))[2-9]\\d{6}", [10]], ["", [10]], ["8(?:00|33|44|55|66|77|88)[2-9]\\d{6}", [10]], ["900[2-9]\\d{6}", [10]], ["52(?:3(?:[2-46-9][02-9]\\d|5(?:[02-46-9]\\d|5[0-46-9]))|4(?:[2-478][02-9]\\d|5(?:[034]\\d|2[024-9]|5[0-46-9])|6(?:0[1-9]|[2-9]\\d)|9(?:[05-9]\\d|2[0-5]|49)))\\d{4}|52[34][2-9]1[02-9]\\d{4}|(?:5(?:2[125-9]|3[23]|44|66|77|88)|6(?:22|33))[2-9]\\d{6}", [10]], 0, ["310\\d{4}", [7]], 0, ["600[2-9]\\d{6}", [10]]]], "CC": ["61", "001[14-689]|14(?:1[14]|34|4[17]|[56]6|7[47]|88)0011", "1(?:[0-79]\\d{8}(?:\\d{2})?|8[0-24-9]\\d{7})|[148]\\d{8}|1\\d{5,7}", [6, 7, 8, 9, 10, 12], 0, "0", 0, "([59]\\d{7})$|0", "8$1", 0, 0, [["8(?:51(?:0(?:02|31|60|89)|1(?:18|76)|223)|91(?:0(?:1[0-2]|29)|1(?:[28]2|50|79)|2(?:10|64)|3(?:[06]8|22)|4[29]8|62\\d|70[23]|959))\\d{3}", [9]], ["4(?:79[01]|83[0-36-9]|95[0-3])\\d{5}|4(?:[0-36]\\d|4[047-9]|[58][0-24-9]|7[02-8]|9[0-47-9])\\d{6}", [9]], ["180(?:0\\d{3}|2)\\d{3}", [7, 10]], ["190[0-26]\\d{6}", [10]], 0, 0, 0, 0, ["14(?:5(?:1[0458]|[23][458])|71\\d)\\d{4}", [9]], ["13(?:00\\d{6}(?:\\d{2})?|45[0-4]\\d{3})|13\\d{4}", [6, 8, 10, 12]]], "0011"], "CD": ["243", "00", "(?:(?:[189]|5\\d)\\d|2)\\d{7}|[1-68]\\d{6}", [7, 8, 9, 10], [["(\\d{2})(\\d{2})(\\d{3})", "$1 $2 $3", ["88"], "0$1"], ["(\\d{2})(\\d{5})", "$1 $2", ["[1-6]"], "0$1"], ["(\\d{2})(\\d{2})(\\d{4})", "$1 $2 $3", ["2"], "0$1"], ["(\\d{2})(\\d{3})(\\d{4})", "$1 $2 $3", ["1"], "0$1"], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["[89]"], "0$1"], ["(\\d{2})(\\d{2})(\\d{3})(\\d{3})", "$1 $2 $3 $4", ["5"], "0$1"]], "0"], "CF": ["236", "00", "8776\\d{4}|(?:[27]\\d|61)\\d{6}", [8], [["(\\d{2})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[26-8]"]]]], "CG": ["242", "00", "222\\d{6}|(?:0\\d|80)\\d{7}", [9], [["(\\d)(\\d{4})(\\d{4})", "$1 $2 $3", ["8"]], ["(\\d{2})(\\d{3})(\\d{4})", "$1 $2 $3", ["[02]"]]]], "CH": ["41", "00", "8\\d{11}|[2-9]\\d{8}", [9, 12], [["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["8[047]|90"], "0$1"], ["(\\d{2})(\\d{3})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[2-79]|81"], "0$1"], ["(\\d{3})(\\d{2})(\\d{3})(\\d{2})(\\d{2})", "$1 $2 $3 $4 $5", ["8"], "0$1"]], "0"], "CI": ["225", "00", "[02]\\d{9}", [10], [["(\\d{2})(\\d{2})(\\d)(\\d{5})", "$1 $2 $3 $4", ["2"]], ["(\\d{2})(\\d{2})(\\d{2})(\\d{4})", "$1 $2 $3 $4", ["0"]]]], "CK": ["682", "00", "[2-578]\\d{4}", [5], [["(\\d{2})(\\d{3})", "$1 $2", ["[2-578]"]]]], "CL": ["56", "(?:0|1(?:1[0-69]|2[02-5]|5[13-58]|69|7[0167]|8[018]))0", "12300\\d{6}|6\\d{9,10}|[2-9]\\d{8}", [9, 10, 11], [["(\\d{5})(\\d{4})", "$1 $2", ["219", "2196"], "($1)"], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["60|809"]], ["(\\d{2})(\\d{3})(\\d{4})", "$1 $2 $3", ["44"]], ["(\\d)(\\d{4})(\\d{4})", "$1 $2 $3", ["2[1-36]"], "($1)"], ["(\\d)(\\d{4})(\\d{4})", "$1 $2 $3", ["9(?:10|[2-9])"]], ["(\\d{2})(\\d{3})(\\d{4})", "$1 $2 $3", ["3[2-5]|[47]|5[1-3578]|6[13-57]|8(?:0[1-8]|[1-9])"], "($1)"], ["(\\d{3})(\\d{3})(\\d{3,4})", "$1 $2 $3", ["60|8"]], ["(\\d{4})(\\d{3})(\\d{4})", "$1 $2 $3", ["1"]], ["(\\d{3})(\\d{3})(\\d{2})(\\d{3})", "$1 $2 $3 $4", ["60"]]]], "CM": ["237", "00", "[26]\\d{8}|88\\d{6,7}", [8, 9], [["(\\d{2})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["88"]], ["(\\d)(\\d{2})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4 $5", ["[26]|88"]]]], "CN": ["86", "00|1(?:[12]\\d|79)\\d\\d00", "(?:(?:1[03-689]|2\\d)\\d\\d|6)\\d{8}|1\\d{10}|[126]\\d{6}(?:\\d(?:\\d{2})?)?|86\\d{5,6}|(?:[3-579]\\d|8[0-57-9])\\d{5,9}", [7, 8, 9, 10, 11, 12], [["(\\d{2})(\\d{5,6})", "$1 $2", ["(?:10|2[0-57-9])[19]|3(?:[157]|35|49|9[1-68])|4(?:1[124-9]|2[179]|6[47-9]|7|8[23])|5(?:[1357]|2[37]|4[36]|6[1-46]|80)|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:07|1[236-8]|2[5-7]|[37]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|3|4[13]|5[1-5]|7[0-79]|9[0-35-9])|(?:4[35]|59|85)[1-9]", "(?:10|2[0-57-9])(?:1[02]|9[56])|8078|(?:3(?:[157]\\d|35|49|9[1-68])|4(?:1[124-9]|2[179]|[35][1-9]|6[47-9]|7\\d|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[1-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|3\\d|4[13]|5[1-5]|7[0-79]|9[0-35-9]))1", "10(?:1(?:0|23)|9[56])|2[0-57-9](?:1(?:00|23)|9[56])|80781|(?:3(?:[157]\\d|35|49|9[1-68])|4(?:1[124-9]|2[179]|[35][1-9]|6[47-9]|7\\d|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[1-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|3\\d|4[13]|5[1-5]|7[0-79]|9[0-35-9]))12", "10(?:1(?:0|23)|9[56])|2[0-57-9](?:1(?:00|23)|9[56])|807812|(?:3(?:[157]\\d|35|49|9[1-68])|4(?:1[124-9]|2[179]|[35][1-9]|6[47-9]|7\\d|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[1-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|3\\d|4[13]|5[1-5]|7[0-79]|9[0-35-9]))123", "10(?:1(?:0|23)|9[56])|2[0-57-9](?:1(?:00|23)|9[56])|(?:3(?:[157]\\d|35|49|9[1-68])|4(?:1[124-9]|2[179]|[35][1-9]|6[47-9]|7\\d|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:078|1[236-8]|2[5-7]|[37]\\d|5[1-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|3\\d|4[13]|5[1-5]|7[0-79]|9[0-35-9]))123"], "0$1"], ["(\\d{3})(\\d{5,6})", "$1 $2", ["3(?:[157]|35|49|9[1-68])|4(?:[17]|2[179]|6[47-9]|8[23])|5(?:[1357]|2[37]|4[36]|6[1-46]|80)|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|[379]|4[13]|5[1-5])|(?:4[35]|59|85)[1-9]", "(?:3(?:[157]\\d|35|49|9[1-68])|4(?:[17]\\d|2[179]|[35][1-9]|6[47-9]|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[1-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|[379]\\d|4[13]|5[1-5]))[19]", "85[23](?:10|95)|(?:3(?:[157]\\d|35|49|9[1-68])|4(?:[17]\\d|2[179]|[35][1-9]|6[47-9]|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[14-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|[379]\\d|4[13]|5[1-5]))(?:10|9[56])", "85[23](?:100|95)|(?:3(?:[157]\\d|35|49|9[1-68])|4(?:[17]\\d|2[179]|[35][1-9]|6[47-9]|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[14-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|[379]\\d|4[13]|5[1-5]))(?:100|9[56])"], "0$1"], ["(\\d{3})(\\d{3})(\\d{4})", "$1 $2 $3", ["(?:4|80)0"]], ["(\\d{2})(\\d{4})(\\d{4})", "$1 $2 $3", ["10|2(?:[02-57-9]|1[1-9])", "10|2(?:[02-57-9]|1[1-9])", "10[0-79]|2(?:[02-57-9]|1[1-79])|(?:10|21)8(?:0[1-9]|[1-9])"], "0$1", 1], ["(\\d{3})(\\d{3})(\\d{4})", "$1 $2 $3", ["3(?:[3-59]|7[02-68])|4(?:[26-8]|3[3-9]|5[2-9])|5(?:3[03-9]|[468]|7[028]|9[2-46-9])|6|7(?:[0-247]|3[04-9]|5[0-4689]|6[2368])|8(?:[1-358]|9[1-7])|9(?:[013479]|5[1-5])|(?:[34]1|55|79|87)[02-9]"], "0$1", 1], ["(\\d{3})(\\d{7,8})", "$1 $2", ["9"]], ["(\\d{4})(\\d{3})(\\d{4})", "$1 $2 $3", ["80"], "0$1", 1], ["(\\d{3})(\\d{4})(\\d{4})", "$1 $2 $3", ["[3-578]"], "0$1", 1], ["(\\d{3})(\\d{4})(\\d{4})", "$1 $2 $3", ["1[3-9]"]], ["(\\d{2})(\\d{3})(\\d{3})(\\d{4})", "$1 $2 $3 $4", ["[12]"], "0$1", 1]], "0", 0, "(1(?:[12]\\d|79)\\d\\d)|0", 0, 0, 0, 0, "00"], "CO": ["57", "00(?:4(?:[14]4|56)|[579])", "(?:46|60\\d\\d)\\d{6}|(?:1\\d|[39])\\d{9}", [8, 10, 11], [["(\\d{4})(\\d{4})", "$1 $2", ["46"]], ["(\\d{3})(\\d{7})", "$1 $2", ["6|90"], "($1)"], ["(\\d{3})(\\d{7})", "$1 $2", ["3[0-357]|9[14]"]], ["(\\d)(\\d{3})(\\d{7})", "$1-$2-$3", ["1"], "0$1", 0, "$1 $2 $3"]], "0", 0, "0([3579]|4(?:[14]4|56))?"], "CR": ["506", "00", "(?:8\\d|90)\\d{8}|(?:[24-8]\\d{3}|3005)\\d{4}", [8, 10], [["(\\d{4})(\\d{4})", "$1 $2", ["[2-7]|8[3-9]"]], ["(\\d{3})(\\d{3})(\\d{4})", "$1-$2-$3", ["[89]"]]], 0, 0, "(19(?:0[0-2468]|1[09]|20|66|77|99))"], "CU": ["53", "119", "(?:[2-7]|8\\d\\d)\\d{7}|[2-47]\\d{6}|[34]\\d{5}", [6, 7, 8, 10], [["(\\d{2})(\\d{4,6})", "$1 $2", ["2[1-4]|[34]"], "(0$1)"], ["(\\d)(\\d{6,7})", "$1 $2", ["7"], "(0$1)"], ["(\\d)(\\d{7})", "$1 $2", ["[56]"], "0$1"], ["(\\d{3})(\\d{7})", "$1 $2", ["8"], "0$1"]], "0"], "CV": ["238", "0", "(?:[2-59]\\d\\d|800)\\d{4}", [7], [["(\\d{3})(\\d{2})(\\d{2})", "$1 $2 $3", ["[2-589]"]]]], "CW": ["599", "00", "(?:[34]1|60|(?:7|9\\d)\\d)\\d{5}", [7, 8], [["(\\d{3})(\\d{4})", "$1 $2", ["[3467]"]], ["(\\d)(\\d{3})(\\d{4})", "$1 $2 $3", ["9[4-8]"]]], 0, 0, 0, 0, 0, "[69]"], "CX": ["61", "001[14-689]|14(?:1[14]|34|4[17]|[56]6|7[47]|88)0011", "1(?:[0-79]\\d{8}(?:\\d{2})?|8[0-24-9]\\d{7})|[148]\\d{8}|1\\d{5,7}", [6, 7, 8, 9, 10, 12], 0, "0", 0, "([59]\\d{7})$|0", "8$1", 0, 0, [["8(?:51(?:0(?:01|30|59|88)|1(?:17|46|75)|2(?:22|35))|91(?:00[6-9]|1(?:[28]1|49|78)|2(?:09|63)|3(?:12|26|75)|4(?:56|97)|64\\d|7(?:0[01]|1[0-2])|958))\\d{3}", [9]], ["4(?:79[01]|83[0-36-9]|95[0-3])\\d{5}|4(?:[0-36]\\d|4[047-9]|[58][0-24-9]|7[02-8]|9[0-47-9])\\d{6}", [9]], ["180(?:0\\d{3}|2)\\d{3}", [7, 10]], ["190[0-26]\\d{6}", [10]], 0, 0, 0, 0, ["14(?:5(?:1[0458]|[23][458])|71\\d)\\d{4}", [9]], ["13(?:00\\d{6}(?:\\d{2})?|45[0-4]\\d{3})|13\\d{4}", [6, 8, 10, 12]]], "0011"], "CY": ["357", "00", "(?:[279]\\d|[58]0)\\d{6}", [8], [["(\\d{2})(\\d{6})", "$1 $2", ["[257-9]"]]]], "CZ": ["420", "00", "(?:[2-578]\\d|60)\\d{7}|9\\d{8,11}", [9, 10, 11, 12], [["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["[2-8]|9[015-7]"]], ["(\\d{2})(\\d{3})(\\d{3})(\\d{2})", "$1 $2 $3 $4", ["96"]], ["(\\d{2})(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3 $4", ["9"]], ["(\\d{3})(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3 $4", ["9"]]]], "DE": ["49", "00", "[2579]\\d{5,14}|49(?:[34]0|69|8\\d)\\d\\d?|49(?:37|49|60|7[089]|9\\d)\\d{1,3}|49(?:2[024-9]|3[2-689]|7[1-7])\\d{1,8}|(?:1|[368]\\d|4[0-8])\\d{3,13}|49(?:[015]\\d|2[13]|31|[46][1-8])\\d{1,9}", [4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15], [["(\\d{2})(\\d{3,13})", "$1 $2", ["3[02]|40|[68]9"], "0$1"], ["(\\d{3})(\\d{3,12})", "$1 $2", ["2(?:0[1-389]|1[124]|2[18]|3[14])|3(?:[35-9][15]|4[015])|906|(?:2[4-9]|4[2-9]|[579][1-9]|[68][1-8])1", "2(?:0[1-389]|12[0-8])|3(?:[35-9][15]|4[015])|906|2(?:[13][14]|2[18])|(?:2[4-9]|4[2-9]|[579][1-9]|[68][1-8])1"], "0$1"], ["(\\d{4})(\\d{2,11})", "$1 $2", ["[24-6]|3(?:[3569][02-46-9]|4[2-4679]|7[2-467]|8[2-46-8])|70[2-8]|8(?:0[2-9]|[1-8])|90[7-9]|[79][1-9]", "[24-6]|3(?:3(?:0[1-467]|2[127-9]|3[124578]|7[1257-9]|8[1256]|9[145])|4(?:2[135]|4[13578]|9[1346])|5(?:0[14]|2[1-3589]|6[1-4]|7[13468]|8[13568])|6(?:2[1-489]|3[124-6]|6[13]|7[12579]|8[1-356]|9[135])|7(?:2[1-7]|4[145]|6[1-5]|7[1-4])|8(?:21|3[1468]|6|7[1467]|8[136])|9(?:0[12479]|2[1358]|4[134679]|6[1-9]|7[136]|8[147]|9[1468]))|70[2-8]|8(?:0[2-9]|[1-8])|90[7-9]|[79][1-9]|3[68]4[1347]|3(?:47|60)[1356]|3(?:3[46]|46|5[49])[1246]|3[4579]3[1357]"], "0$1"], ["(\\d{3})(\\d{4})", "$1 $2", ["138"], "0$1"], ["(\\d{5})(\\d{2,10})", "$1 $2", ["3"], "0$1"], ["(\\d{3})(\\d{5,11})", "$1 $2", ["181"], "0$1"], ["(\\d{3})(\\d)(\\d{4,10})", "$1 $2 $3", ["1(?:3|80)|9"], "0$1"], ["(\\d{3})(\\d{7,8})", "$1 $2", ["1[67]"], "0$1"], ["(\\d{3})(\\d{7,12})", "$1 $2", ["8"], "0$1"], ["(\\d{5})(\\d{6})", "$1 $2", ["185", "1850", "18500"], "0$1"], ["(\\d{3})(\\d{4})(\\d{4})", "$1 $2 $3", ["7"], "0$1"], ["(\\d{4})(\\d{7})", "$1 $2", ["18[68]"], "0$1"], ["(\\d{4})(\\d{7})", "$1 $2", ["15[1279]"], "0$1"], ["(\\d{5})(\\d{6})", "$1 $2", ["15[03568]", "15(?:[0568]|3[13])"], "0$1"], ["(\\d{3})(\\d{8})", "$1 $2", ["18"], "0$1"], ["(\\d{3})(\\d{2})(\\d{7,8})", "$1 $2 $3", ["1(?:6[023]|7)"], "0$1"], ["(\\d{4})(\\d{2})(\\d{7})", "$1 $2 $3", ["15[279]"], "0$1"], ["(\\d{3})(\\d{2})(\\d{8})", "$1 $2 $3", ["15"], "0$1"]], "0"], "DJ": ["253", "00", "(?:2\\d|77)\\d{6}", [8], [["(\\d{2})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[27]"]]]], "DK": ["45", "00", "[2-9]\\d{7}", [8], [["(\\d{2})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[2-9]"]]]], "DM": ["1", "011", "(?:[58]\\d\\d|767|900)\\d{7}", [10], 0, "1", 0, "([2-7]\\d{6})$|1", "767$1", 0, "767"], "DO": ["1", "011", "(?:[58]\\d\\d|900)\\d{7}", [10], 0, "1", 0, 0, 0, 0, "8001|8[024]9"], "DZ": ["213", "00", "(?:[1-4]|[5-79]\\d|80)\\d{7}", [8, 9], [["(\\d{2})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[1-4]"], "0$1"], ["(\\d{2})(\\d{3})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["9"], "0$1"], ["(\\d{3})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[5-8]"], "0$1"]], "0"], "EC": ["593", "00", "1\\d{9,10}|(?:[2-7]|9\\d)\\d{7}", [8, 9, 10, 11], [["(\\d)(\\d{3})(\\d{4})", "$1 $2-$3", ["[2-7]"], "(0$1)", 0, "$1-$2-$3"], ["(\\d{2})(\\d{3})(\\d{4})", "$1 $2 $3", ["9"], "0$1"], ["(\\d{4})(\\d{3})(\\d{3,4})", "$1 $2 $3", ["1"]]], "0"], "EE": ["372", "00", "8\\d{9}|[4578]\\d{7}|(?:[3-8]\\d|90)\\d{5}", [7, 8, 10], [["(\\d{3})(\\d{4})", "$1 $2", ["[369]|4[3-8]|5(?:[0-2]|5[0-478]|6[45])|7[1-9]|88", "[369]|4[3-8]|5(?:[02]|1(?:[0-8]|95)|5[0-478]|6(?:4[0-4]|5[1-589]))|7[1-9]|88"]], ["(\\d{4})(\\d{3,4})", "$1 $2", ["[45]|8(?:00|[1-49])", "[45]|8(?:00[1-9]|[1-49])"]], ["(\\d{2})(\\d{2})(\\d{4})", "$1 $2 $3", ["7"]], ["(\\d{4})(\\d{3})(\\d{3})", "$1 $2 $3", ["8"]]]], "EG": ["20", "00", "[189]\\d{8,9}|[24-6]\\d{8}|[135]\\d{7}", [8, 9, 10], [["(\\d)(\\d{7,8})", "$1 $2", ["[23]"], "0$1"], ["(\\d{2})(\\d{6,7})", "$1 $2", ["1[35]|[4-6]|8[2468]|9[235-7]"], "0$1"], ["(\\d{3})(\\d{3})(\\d{4})", "$1 $2 $3", ["[89]"], "0$1"], ["(\\d{2})(\\d{8})", "$1 $2", ["1"], "0$1"]], "0"], "EH": ["212", "00", "[5-8]\\d{8}", [9], 0, "0", 0, 0, 0, 0, 0, [["528[89]\\d{5}"], ["(?:6(?:[0-79]\\d|8[0-247-9])|7(?:[016-8]\\d|2[0-8]|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|[5-9]\\d\\d)\\d{6}", [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-7]|80[2-46]", "11|2[02]|33|4[04]|79(?:[1-6]|7[19])|80(?:[2-4]|6[0-589])", "11|2[02]|33|4[04]|79(?:[124-6]|3(?:[02-9]|1[0-24-9])|7(?:1|9[1-6]))|80(?:[2-4]|6[0-589])"], "0$1", 1], ["(\\d{3})(\\d{3})(\\d{4})", "$1 $2 $3", ["1(?:2[0-249]|3[0-25]|4[145]|[68]|7[1257])|2(?:1[257]|3[013]|4[01]|5[0137]|6[0158]|78|8[1568])|3(?:26|4[1-3]|5[34]|6[01489]|7[02-46]|8[159])|4(?:1[36]|2[1-47]|5[12]|6[0-26-9]|7[0-24-9]|8[013-57]|9[014-7])|5(?:1[025]|22|[36][25]|4[28]|5[12]|[78]1)|6(?:12|[2-4]1|5[17]|6[13]|80)|7(?:12|3[134]|61|88)|8(?:16|2[014]|3[126]|6[136]|7[078]|8[34]|91)|(?:43|59|75)[15]|(?:1[59]|29|67)[14]", "1(?:2[0-24]|3[0-25]|4[145]|[59][14]|6[1-9]|7[1257]|8[1-57-9])|2(?:1[257]|3[013]|4[01]|5[0137]|6[058]|78|8[1568]|9[14])|3(?:26|4[1-3]|5[34]|6[01489]|7[02-46]|8[159])|4(?:1[36]|2[1-47]|3[15]|5[12]|6[0-26-9]|7[0-24-9]|8[013-57]|9[014-7])|5(?:1[025]|22|[36][25]|4[28]|[578]1|9[15])|674|7(?:(?:3[34]|5[15])[2-6]|61[346]|88[0-8])|8(?:70[2-6]|84[235-7]|91[3-7])|(?:1(?:29|60|8[06])|261|552|6(?:12|[2-47]1|5[17]|6[13]|80)|7(?:12|31)|8(?:16|2[014]|3[126]|6[136]|7[78]|83))[2-7]", "1(?:2[0-24]|3[0-25]|4[145]|[59][14]|6[1-9]|7[1257]|8[1-57-9])|2(?:1[257]|3[013]|4[01]|5[0137]|6[058]|78|8[1568]|9[14])|3(?:26|4[1-3]|5[34]|6[01489]|7[02-46]|8[159])|4(?:1[36]|2[1-47]|3[15]|5[12]|6[0-26-9]|7[0-24-9]|8[013-57]|9[014-7])|5(?:1[025]|22|[36][25]|4[28]|[578]1|9[15])|6(?:12(?:[2-6]|7[0-8])|74[2-7])|7(?:3171|5[15][2-6]|61[346]|88(?:[2-7]|82))|8(?:70[2-6]|84(?:[2356]|7[19])|91(?:[3-6]|7[19]))|73[134][2-6]|8(?:16|2[014]|3[126]|6[136]|7[78]|83)(?:[2-6]|7[19])|(?:1(?:29|60|8[06])|261|552|6(?:[2-4]1|5[17]|6[13]|7(?:1|4[0189])|80)|7(?:12|88[01]))[2-7]"], "0$1", 1], ["(\\d{4})(\\d{3})(\\d{3})", "$1 $2 $3", ["1(?:[2-479]|5[0235-9])|[2-5]|6(?:1[1358]|2[2457-9]|3[2-5]|4[235-7]|5[2-689]|6[24578]|7[235689]|8[1-6])|7(?:1[013-9]|3[129]|5[29]|6[02-5]|70)|807", "1(?:[2-479]|5[0235-9])|[2-5]|6(?:1[1358]|2(?:[2457]|84|95)|3(?:[2-4]|55)|4[235-7]|5[2-689]|6[24578]|7(?:[23569]|8[0-57-9])|8[1-6])|7(?:1(?:[013-8]|9[6-9])|3(?:17|2[0-49]|9[2-57])|5(?:2[1-3]|9[0-6])|6(?:0[5689]|2[5-9]|3[02-8]|4|5[0-367])|70[13-7])|807[19]", "1(?:[2-479]|5(?:[0236-9]|5[013-9]))|[2-5]|6(?:2(?:84|95)|355|8(?:28[235-7]|3))|73179|807(?:1|9[1-3])|(?:1552|6(?:(?:1[1358]|2[2457]|3[2-4]|4[235-7]|5[2-689]|6[24578])\\d|7(?:[23569]\\d|8[0-57-9])|8(?:[14-6]\\d|2[0-79]))|7(?:1(?:[013-8]\\d|9[6-9])|3(?:2[0-49]|9[2-57])|5(?:2[1-3]|9[0-6])|6(?:0[5689]|2[5-9]|3[02-8]|4\\d|5[0-367])|70[13-7]))[2-7]"], "0$1", 1], ["(\\d{5})(\\d{5})", "$1 $2", ["16|[6-9]"], "0$1", 1], ["(\\d{4})(\\d{2,4})(\\d{4})", "$1 $2 $3", ["18[06]", "18[06]0"], 0, 1], ["(\\d{4})(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3 $4", ["18"], 0, 1]], "0"], "IO": ["246", "00", "3\\d{6}", [7], [["(\\d{3})(\\d{4})", "$1 $2", ["3"]]]], "IQ": ["964", "00", "(?:1|7\\d\\d)\\d{7}|[2-6]\\d{7,8}", [8, 9, 10], [["(\\d)(\\d{3})(\\d{4})", "$1 $2 $3", ["1"], "0$1"], ["(\\d{2})(\\d{3})(\\d{3,4})", "$1 $2 $3", ["[2-6]"], "0$1"], ["(\\d{3})(\\d{3})(\\d{4})", "$1 $2 $3", ["7"], "0$1"]], "0"], "IR": ["98", "00", "[1-9]\\d{9}|(?:[1-8]\\d\\d|9)\\d{3,4}", [4, 5, 6, 7, 10], [["(\\d{4,5})", "$1", ["96"], "0$1"], ["(\\d{2})(\\d{4,5})", "$1 $2", ["(?:1[137]|2[13-68]|3[1458]|4[145]|5[1468]|6[16]|7[1467]|8[13467])[12689]"], "0$1"], ["(\\d{3})(\\d{3})(\\d{3,4})", "$1 $2 $3", ["9"], "0$1"], ["(\\d{2})(\\d{4})(\\d{4})", "$1 $2 $3", ["[1-8]"], "0$1"]], "0"], "IS": ["354", "00|1(?:0(?:01|[12]0)|100)", "(?:38\\d|[4-9])\\d{6}", [7, 9], [["(\\d{3})(\\d{4})", "$1 $2", ["[4-9]"]], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["3"]]], 0, 0, 0, 0, 0, 0, 0, "00"], "IT": ["39", "00", "0\\d{5,11}|1\\d{8,10}|3(?:[0-8]\\d{7,10}|9\\d{7,8})|(?:43|55|70)\\d{8}|8\\d{5}(?:\\d{2,4})?", [6, 7, 8, 9, 10, 11, 12], [["(\\d{2})(\\d{4,6})", "$1 $2", ["0[26]"]], ["(\\d{3})(\\d{3,6})", "$1 $2", ["0[13-57-9][0159]|8(?:03|4[17]|9[2-5])", "0[13-57-9][0159]|8(?:03|4[17]|9(?:2|3[04]|[45][0-4]))"]], ["(\\d{4})(\\d{2,6})", "$1 $2", ["0(?:[13-579][2-46-8]|8[236-8])"]], ["(\\d{4})(\\d{4})", "$1 $2", ["894"]], ["(\\d{2})(\\d{3,4})(\\d{4})", "$1 $2 $3", ["0[26]|5"]], ["(\\d{3})(\\d{3})(\\d{3,4})", "$1 $2 $3", ["1(?:44|[679])|[378]|43"]], ["(\\d{3})(\\d{3,4})(\\d{4})", "$1 $2 $3", ["0[13-57-9][0159]|14"]], ["(\\d{2})(\\d{4})(\\d{5})", "$1 $2 $3", ["0[26]"]], ["(\\d{4})(\\d{3})(\\d{4})", "$1 $2 $3", ["0"]], ["(\\d{3})(\\d{4})(\\d{4,5})", "$1 $2 $3", ["[03]"]]], 0, 0, 0, 0, 0, 0, [["0(?:669[0-79]\\d{1,6}|831\\d{2,8})|0(?:1(?:[0159]\\d|[27][1-5]|31|4[1-4]|6[1356]|8[2-57])|2\\d\\d|3(?:[0159]\\d|2[1-4]|3[12]|[48][1-6]|6[2-59]|7[1-7])|4(?:[0159]\\d|[23][1-9]|4[245]|6[1-5]|7[1-4]|81)|5(?:[0159]\\d|2[1-5]|3[2-6]|4[1-79]|6[4-6]|7[1-578]|8[3-8])|6(?:[0-57-9]\\d|6[0-8])|7(?:[0159]\\d|2[12]|3[1-7]|4[2-46]|6[13569]|7[13-6]|8[1-59])|8(?:[0159]\\d|2[3-578]|3[2356]|[6-8][1-5])|9(?:[0159]\\d|[238][1-5]|4[12]|6[1-8]|7[1-6]))\\d{2,7}"], ["3[2-9]\\d{7,8}|(?:31|43)\\d{8}", [9, 10]], ["80(?:0\\d{3}|3)\\d{3}", [6, 9]], ["(?:0878\\d{3}|89(?:2\\d|3[04]|4(?:[0-4]|[5-9]\\d\\d)|5[0-4]))\\d\\d|(?:1(?:44|6[346])|89(?:38|5[5-9]|9))\\d{6}", [6, 8, 9, 10]], ["1(?:78\\d|99)\\d{6}", [9, 10]], ["3[2-8]\\d{9,10}", [11, 12]], 0, 0, ["55\\d{8}", [10]], ["84(?:[08]\\d{3}|[17])\\d{3}", [6, 9]]]], "JE": ["44", "00", "1534\\d{6}|(?:[3578]\\d|90)\\d{8}", [10], 0, "0", 0, "([0-24-8]\\d{5})$|0|180020", "1534$1", 0, 0, [["1534[0-24-8]\\d{5}"], ["7(?:(?:(?:50|82)9|937)\\d|7(?:00[378]|97\\d))\\d{5}"], ["80(?:07(?:35|81)|8901)\\d{4}"], ["(?:8(?:4(?:4(?:4(?:05|42|69)|703)|5(?:041|800))|7(?:0002|1206))|90(?:066[59]|1810|71(?:07|55)))\\d{4}"], ["701511\\d{4}"], 0, ["(?:3(?:0(?:07(?:35|81)|8901)|3\\d{4}|4(?:4(?:4(?:05|42|69)|703)|5(?:041|800))|7(?:0002|1206))|55\\d{4})\\d{4}"], ["76(?:464|652)\\d{5}|76(?:0[0-28]|2[356]|34|4[01347]|5[49]|6[0-369]|77|8[14]|9[139])\\d{6}"], ["56\\d{8}"]]], "JM": ["1", "011", "(?:[58]\\d\\d|658|900)\\d{7}", [10], 0, "1", 0, 0, 0, 0, "658|876"], "JO": ["962", "00", "(?:(?:[2689]|7\\d)\\d|32|427|53)\\d{6}", [8, 9], [["(\\d)(\\d{3})(\\d{4})", "$1 $2 $3", ["[2356]|87"], "(0$1)"], ["(\\d{3})(\\d{5,6})", "$1 $2", ["[89]"], "0$1"], ["(\\d{2})(\\d{7})", "$1 $2", ["70"], "0$1"], ["(\\d)(\\d{4})(\\d{4})", "$1 $2 $3", ["[47]"], "0$1"]], "0"], "JP": ["81", "010", "00[1-9]\\d{6,14}|[25-9]\\d{9}|(?:00|[1-9]\\d\\d)\\d{6}", [8, 9, 10, 11, 12, 13, 14, 15, 16, 17], [["(\\d{3})(\\d{3})(\\d{3})", "$1-$2-$3", ["(?:12|57|99)0"], "0$1"], ["(\\d{4})(\\d)(\\d{4})", "$1-$2-$3", ["1(?:26|3[79]|4[56]|5[4-68]|6[3-5])|499|5(?:76|97)|746|8(?:3[89]|47|51)|9(?:80|9[16])", "1(?:267|3(?:7[247]|9[278])|466|5(?:47|58|64)|6(?:3[245]|48|5[4-68]))|499[2468]|5(?:76|97)9|7468|8(?:3(?:8[7-9]|96)|477|51[2-9])|9(?:802|9(?:1[23]|69))|1(?:45|58)[67]", "1(?:267|3(?:7[247]|9[278])|466|5(?:47|58|64)|6(?:3[245]|48|5[4-68]))|499[2468]|5(?:769|979[2-69])|7468|8(?:3(?:8[7-9]|96[2457-9])|477|51[2-9])|9(?:802|9(?:1[23]|69))|1(?:45|58)[67]"], "0$1"], ["(\\d{2})(\\d{3})(\\d{4})", "$1-$2-$3", ["60"], "0$1"], ["(\\d)(\\d{4})(\\d{4})", "$1-$2-$3", ["3|4(?:2[09]|7[01])|6[1-9]", "3|4(?:2(?:0|9[02-69])|7(?:0[019]|1))|6[1-9]"], "0$1"], ["(\\d{2})(\\d{3})(\\d{4})", "$1-$2-$3", ["1(?:1|5[45]|77|88|9[69])|2(?:2[1-37]|3[0-269]|4[59]|5|6[24]|7[1-358]|8[1369]|9[0-38])|4(?:[28][1-9]|3[0-57]|[45]|6[248]|7[2-579]|9[29])|5(?:2|3[0459]|4[0-369]|5[29]|8[02389]|9[0-389])|7(?:2[02-46-9]|34|[58]|6[0249]|7[57]|9[2-6])|8(?:2[124589]|3[26-9]|49|51|6|7[0-468]|8[68]|9[019])|9(?:[23][1-9]|4[15]|5[138]|6[1-3]|7[156]|8[189]|9[1-489])", "1(?:1|5(?:4[018]|5[017])|77|88|9[69])|2(?:2(?:[127]|3[014-9])|3[0-269]|4[59]|5(?:[1-3]|5[0-69]|9[19])|62|7(?:[1-35]|8[0189])|8(?:[16]|3[0134]|9[0-5])|9(?:[028]|17))|4(?:2(?:[13-79]|8[014-6])|3[0-57]|[45]|6[248]|7[2-47]|8[1-9]|9[29])|5(?:2|3(?:[045]|9[0-8])|4[0-369]|5[29]|8[02389]|9[0-3])|7(?:2[02-46-9]|34|[58]|6[0249]|7[57]|9(?:[23]|4[0-59]|5[01569]|6[0167]))|8(?:2(?:[1258]|4[0-39]|9[0-2469])|3(?:[29]|60)|49|51|6(?:[0-24]|36|5[0-3589]|7[23]|9[01459])|7[0-468]|8[68])|9(?:[23][1-9]|4[15]|5[138]|6[1-3]|7[156]|8[189]|9(?:[1289]|3[34]|4[0178]))|(?:264|837)[016-9]|2(?:57|93)[015-9]|(?:25[0468]|422|838)[01]|(?:47[59]|59[89]|8(?:6[68]|9))[019]", "1(?:1|5(?:4[018]|5[017])|77|88|9[69])|2(?:2[127]|3[0-269]|4[59]|5(?:[1-3]|5[0-69]|9(?:17|99))|6(?:2|4[016-9])|7(?:[1-35]|8[0189])|8(?:[16]|3[0134]|9[0-5])|9(?:[028]|17))|4(?:2(?:[13-79]|8[014-6])|3[0-57]|[45]|6[248]|7[2-47]|9[29])|5(?:2|3(?:[045]|9(?:[0-58]|6[4-9]|7[0-35689]))|4[0-369]|5[29]|8[02389]|9[0-3])|7(?:2[02-46-9]|34|[58]|6[0249]|7[57]|9(?:[23]|4[0-59]|5[01569]|6[0167]))|8(?:2(?:[1258]|4[0-39]|9[0169])|3(?:[29]|60|7(?:[017-9]|6[6-8]))|49|51|6(?:[0-24]|36[2-57-9]|5(?:[0-389]|5[23])|6(?:[01]|9[178])|7(?:2[2-468]|3[78])|9[0145])|7[0-468]|8[68])|9(?:4[15]|5[138]|7[156]|8[189]|9(?:[1289]|3(?:31|4[357])|4[0178]))|(?:8294|96)[1-3]|2(?:57|93)[015-9]|(?:223|8699)[014-9]|(?:25[0468]|422|838)[01]|(?:48|8292|9[23])[1-9]|(?:47[59]|59[89]|8(?:68|9))[019]"], "0$1"], ["(\\d{3})(\\d{2})(\\d{4})", "$1-$2-$3", ["[14]|[289][2-9]|5[3-9]|7[2-4679]"], "0$1"], ["(\\d{3})(\\d{3})(\\d{4})", "$1-$2-$3", ["800"], "0$1"], ["(\\d{2})(\\d{4})(\\d{4})", "$1-$2-$3", ["[25-9]"], "0$1"]], "0", 0, "(000[2569]\\d{4,6})$|(?:(?:003768)0?)|0", "$1"], "KE": ["254", "000", "(?:[17]\\d\\d|900)\\d{6}|(?:2|80)0\\d{6,7}|[4-6]\\d{6,8}", [7, 8, 9, 10], [["(\\d{2})(\\d{5,7})", "$1 $2", ["[24-6]"], "0$1"], ["(\\d{3})(\\d{6})", "$1 $2", ["[17]"], "0$1"], ["(\\d{3})(\\d{3})(\\d{3,4})", "$1 $2 $3", ["[89]"], "0$1"]], "0"], "KG": ["996", "00", "8\\d{9}|[235-9]\\d{8}", [9, 10], [["(\\d{4})(\\d{5})", "$1 $2", ["3(?:1[346]|[24-79])"], "0$1"], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["[235-79]|88"], "0$1"], ["(\\d{3})(\\d{3})(\\d)(\\d{2,3})", "$1 $2 $3 $4", ["8"], "0$1"]], "0"], "KH": ["855", "00[14-9]", "1\\d{9}|[1-9]\\d{7,8}", [8, 9, 10], [["(\\d{2})(\\d{3})(\\d{3,4})", "$1 $2 $3", ["[1-9]"], "0$1"], ["(\\d{4})(\\d{3})(\\d{3})", "$1 $2 $3", ["1"]]], "0"], "KI": ["686", "00", "(?:[37]\\d|6[0-79])\\d{6}|(?:[2-48]\\d|50)\\d{3}", [5, 8], 0, "0"], "KM": ["269", "00", "[3478]\\d{6}", [7], [["(\\d{3})(\\d{2})(\\d{2})", "$1 $2 $3", ["[3478]"]]]], "KN": ["1", "011", "(?:[58]\\d\\d|900)\\d{7}", [10], 0, "1", 0, "([2-7]\\d{6})$|1", "869$1", 0, "869"], "KP": ["850", "00|99", "85\\d{6}|(?:19\\d|[2-7])\\d{7}", [8, 10], [["(\\d{2})(\\d{3})(\\d{3})", "$1 $2 $3", ["8"], "0$1"], ["(\\d)(\\d{3})(\\d{4})", "$1 $2 $3", ["[2-7]"], "0$1"], ["(\\d{3})(\\d{3})(\\d{4})", "$1 $2 $3", ["1"], "0$1"]], "0"], "KR": ["82", "00(?:[125689]|3(?:[46]5|91)|7(?:00|27|3|55|6[126]))", "00[1-9]\\d{8,11}|(?:[12]|5\\d{3})\\d{7}|[13-6]\\d{9}|(?:[1-6]\\d|80)\\d{7}|[3-6]\\d{4,5}|(?:00|7)0\\d{8}", [5, 6, 8, 9, 10, 11, 12, 13, 14], [["(\\d{2})(\\d{3,4})", "$1-$2", ["(?:3[1-3]|[46][1-4]|5[1-5])1"], "0$1"], ["(\\d{4})(\\d{4})", "$1-$2", ["1"]], ["(\\d)(\\d{3,4})(\\d{4})", "$1-$2-$3", ["2"], "0$1"], ["(\\d{2})(\\d{3})(\\d{4})", "$1-$2-$3", ["[36]0|8"], "0$1"], ["(\\d{2})(\\d{3,4})(\\d{4})", "$1-$2-$3", ["[1346]|5[1-5]"], "0$1"], ["(\\d{2})(\\d{4})(\\d{4})", "$1-$2-$3", ["[57]"], "0$1"], ["(\\d{2})(\\d{5})(\\d{4})", "$1-$2-$3", ["5"], "0$1"]], "0", 0, "0(8(?:[1-46-8]|5\\d\\d))?"], "KW": ["965", "00", "18\\d{5}|(?:[2569]\\d|41)\\d{6}", [7, 8], [["(\\d{4})(\\d{3,4})", "$1 $2", ["[169]|2(?:[235]|4[1-35-9])|52"]], ["(\\d{3})(\\d{5})", "$1 $2", ["[245]"]]]], "KY": ["1", "011", "(?:345|[58]\\d\\d|900)\\d{7}", [10], 0, "1", 0, "([2-9]\\d{6})$|1", "345$1", 0, "345"], "KZ": ["7", "810", "8\\d{13}|[78]\\d{9}", [10, 14], 0, "8", 0, 0, 0, 0, "7", 0, "8~10"], "LA": ["856", "00", "[23]\\d{9}|3\\d{8}|(?:[235-8]\\d|41)\\d{6}", [8, 9, 10], [["(\\d{2})(\\d{3})(\\d{3})", "$1 $2 $3", ["2[13]|3[14]|[4-8]"], "0$1"], ["(\\d{2})(\\d{2})(\\d{2})(\\d{3})", "$1 $2 $3 $4", ["3"], "0$1"], ["(\\d{2})(\\d{2})(\\d{3})(\\d{3})", "$1 $2 $3 $4", ["[23]"], "0$1"]], "0"], "LB": ["961", "00", "[27-9]\\d{7}|[13-9]\\d{6}", [7, 8], [["(\\d)(\\d{3})(\\d{3})", "$1 $2 $3", ["[13-69]|7(?:[2-57]|62|8[0-6]|9[04-9])|8[02-9]"], "0$1"], ["(\\d{2})(\\d{3})(\\d{3})", "$1 $2 $3", ["[27-9]"]]], "0"], "LC": ["1", "011", "(?:[58]\\d\\d|758|900)\\d{7}", [10], 0, "1", 0, "([2-8]\\d{6})$|1", "758$1", 0, "758"], "LI": ["423", "00", "[68]\\d{8}|(?:[2378]\\d|90)\\d{5}", [7, 9], [["(\\d{3})(\\d{2})(\\d{2})", "$1 $2 $3", ["[2379]|8(?:0[09]|7)", "[2379]|8(?:0(?:02|9)|7)"]], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["8"]], ["(\\d{2})(\\d{3})(\\d{4})", "$1 $2 $3", ["69"]], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["6"]]], "0", 0, "(1001)|0"], "LK": ["94", "00", "[1-9]\\d{8}", [9], [["(\\d{2})(\\d{3})(\\d{4})", "$1 $2 $3", ["7"], "0$1"], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["[1-689]"], "0$1"]], "0"], "LR": ["231", "00", "(?:[2457]\\d|33|88)\\d{7}|(?:2\\d|[4-6])\\d{6}", [7, 8, 9], [["(\\d)(\\d{3})(\\d{3})", "$1 $2 $3", ["4[67]|[56]"], "0$1"], ["(\\d{2})(\\d{3})(\\d{3})", "$1 $2 $3", ["2"], "0$1"], ["(\\d{2})(\\d{3})(\\d{4})", "$1 $2 $3", ["[2-578]"], "0$1"]], "0"], "LS": ["266", "00", "(?:[256]\\d\\d|800)\\d{5}", [8], [["(\\d{4})(\\d{4})", "$1 $2", ["[2568]"]]]], "LT": ["370", "00", "(?:[3469]\\d|52|[78]0)\\d{6}", [8], [["(\\d)(\\d{3})(\\d{4})", "$1 $2 $3", ["52[0-7]"], "(0-$1)", 1], ["(\\d{3})(\\d{2})(\\d{3})", "$1 $2 $3", ["[7-9]"], "0 $1", 1], ["(\\d{2})(\\d{6})", "$1 $2", ["37|4(?:[15]|6[1-8])"], "(0-$1)", 1], ["(\\d{3})(\\d{5})", "$1 $2", ["[3-6]"], "(0-$1)", 1]], "0", 0, "[08]"], "LU": ["352", "00", "35[013-9]\\d{4,8}|6\\d{8}|35\\d{2,4}|(?:[2457-9]\\d|3[0-46-9])\\d{2,9}", [4, 5, 6, 7, 8, 9, 10, 11], [["(\\d{2})(\\d{3})", "$1 $2", ["2(?:0[2-689]|[2-9])|[3-57]|8(?:0[2-9]|[13-9])|9(?:0[89]|[2-579])"]], ["(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3", ["2(?:0[2-689]|[2-9])|[3-57]|8(?:0[2-9]|[13-9])|9(?:0[89]|[2-579])"]], ["(\\d{2})(\\d{2})(\\d{3})", "$1 $2 $3", ["20[2-689]"]], ["(\\d{2})(\\d{2})(\\d{2})(\\d{1,2})", "$1 $2 $3 $4", ["20"]], ["(\\d{2})(\\d{2})(\\d{2})(\\d{1,5})", "$1 $2 $3 $4", ["[3-57]|8[13-9]|9(?:0[89]|[2-579])|(?:2|80)[2-9]"]], ["(\\d{3})(\\d{2})(\\d{3})", "$1 $2 $3", ["80[01]|90[015]"]], ["(\\d{2})(\\d{2})(\\d{2})(\\d{3})", "$1 $2 $3 $4", ["20"]], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["6"]], ["(\\d{2})(\\d{2})(\\d{2})(\\d{2})(\\d{1,2})", "$1 $2 $3 $4 $5", ["20"]]], 0, 0, "(15(?:0[06]|1[12]|[35]5|4[04]|6[26]|77|88|99)\\d)"], "LV": ["371", "00", "(?:[268]\\d|78|90)\\d{6}", [8], [["(\\d{2})(\\d{3})(\\d{3})", "$1 $2 $3", ["[2679]|8[01]"]]]], "LY": ["218", "00", "[2-9]\\d{8}", [9], [["(\\d{2})(\\d{7})", "$1-$2", ["[2-9]"], "0$1"]], "0"], "MA": ["212", "00", "[5-8]\\d{8}", [9], [["(\\d{4})(\\d{5})", "$1-$2", ["892"], "0$1"], ["(\\d{2})(\\d{7})", "$1-$2", ["8(?:0[0-7]|9)"], "0$1"], ["(\\d)(\\d{2})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4 $5", ["[5-8]"], "0$1"]], "0", 0, 0, 0, 0, "[5-8]"], "MC": ["377", "00", "(?:[3489]|[67]\\d)\\d{7}", [8, 9], [["(\\d{2})(\\d{3})(\\d{3})", "$1 $2 $3", ["4"], "0$1"], ["(\\d{2})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[389]"]], ["(\\d)(\\d{2})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4 $5", ["[67]"], "0$1"]], "0"], "MD": ["373", "00", "(?:[235-7]\\d|[89]0)\\d{6}", [8], [["(\\d{3})(\\d{5})", "$1 $2", ["[89]"], "0$1"], ["(\\d{2})(\\d{3})(\\d{3})", "$1 $2 $3", ["22|3"], "0$1"], ["(\\d{3})(\\d{2})(\\d{3})", "$1 $2 $3", ["[25-7]"], "0$1"]], "0"], "ME": ["382", "00", "(?:20|[3-79]\\d)\\d{6}|80\\d{6,7}", [8, 9], [["(\\d{2})(\\d{3})(\\d{3,4})", "$1 $2 $3", ["[2-9]"], "0$1"]], "0"], "MF": ["590", "00", "7090\\d{5}|(?:[56]9|[89]\\d)\\d{7}", [9], 0, "0", 0, 0, 0, 0, 0, [["(?:59(?:0(?:0[079]|[14]3|[27][79]|3[03-7]|5[0-268]|87)|87\\d)|80[6-9]\\d\\d)\\d{4}"], ["(?:69(?:0\\d\\d|1(?:2[2-9]|3[0-5]))|7090[0-4])\\d{4}"], ["80[0-5]\\d{6}"], ["8[129]\\d{7}"], 0, 0, 0, 0, ["9(?:(?:39[5-7]|76[018])\\d|475[0-6])\\d{4}"]]], "MG": ["261", "00", "[23]\\d{8}", [9], [["(\\d{2})(\\d{2})(\\d{3})(\\d{2})", "$1 $2 $3 $4", ["[23]"], "0$1"]], "0", 0, "([24-9]\\d{6})$|0", "20$1"], "MH": ["692", "011", "329\\d{4}|(?:[256]\\d|45)\\d{5}", [7], [["(\\d{3})(\\d{4})", "$1-$2", ["[2-6]"]]], "1"], "MK": ["389", "00", "[2-578]\\d{7}", [8], [["(\\d)(\\d{3})(\\d{4})", "$1 $2 $3", ["2|34[47]|4(?:[37]7|5[47]|64)"], "0$1"], ["(\\d{2})(\\d{3})(\\d{3})", "$1 $2 $3", ["[347]"], "0$1"], ["(\\d{3})(\\d)(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[58]"], "0$1"]], "0"], "ML": ["223", "00", "[24-9]\\d{7}", [8], [["(\\d{2})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[24-9]"]]]], "MM": ["95", "00", "1\\d{5,7}|95\\d{6}|(?:[4-7]|9[0-46-9])\\d{6,8}|(?:2|8\\d)\\d{5,8}", [6, 7, 8, 9, 10], [["(\\d)(\\d{2})(\\d{3})", "$1 $2 $3", ["16|2"], "0$1"], ["(\\d{2})(\\d{2})(\\d{3})", "$1 $2 $3", ["4(?:[2-46]|5[3-5])|5|6(?:[1-689]|7[235-7])|7(?:[0-4]|5[2-7])|8[1-5]|(?:60|86)[23]"], "0$1"], ["(\\d)(\\d{3})(\\d{3,4})", "$1 $2 $3", ["[12]|452|678|86", "[12]|452|6788|86"], "0$1"], ["(\\d{2})(\\d{3})(\\d{3,4})", "$1 $2 $3", ["[4-7]|8[1-35]"], "0$1"], ["(\\d)(\\d{3})(\\d{4,6})", "$1 $2 $3", ["9(?:2[0-4]|[35-9]|4[137-9])"], "0$1"], ["(\\d)(\\d{4})(\\d{4})", "$1 $2 $3", ["2"], "0$1"], ["(\\d{3})(\\d{3})(\\d{4})", "$1 $2 $3", ["8"], "0$1"], ["(\\d)(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3 $4", ["92"], "0$1"], ["(\\d)(\\d{5})(\\d{4})", "$1 $2 $3", ["9"], "0$1"]], "0"], "MN": ["976", "001", "[12]\\d{7,9}|[5-9]\\d{7}", [8, 9, 10], [["(\\d{2})(\\d{2})(\\d{4})", "$1 $2 $3", ["11|2[16]"], "0$1"], ["(\\d{4})(\\d{4})", "$1 $2", ["[5-9]"]], ["(\\d{3})(\\d{5,6})", "$1 $2", ["[12]2[1-3]"], "0$1"], ["(\\d{4})(\\d{5,6})", "$1 $2", ["[12](?:27|3[2-8]|4[2-68]|5[1-4689])", "[12](?:27|3[2-8]|4[2-68]|5[1-4689])[0-3]"], "0$1"], ["(\\d{5})(\\d{4,5})", "$1 $2", ["[12]"], "0$1"]], "0"], "MO": ["853", "00", "0800\\d{3}|(?:28|[68]\\d)\\d{6}", [7, 8], [["(\\d{4})(\\d{3})", "$1 $2", ["0"]], ["(\\d{4})(\\d{4})", "$1 $2", ["[268]"]]]], "MP": ["1", "011", "[58]\\d{9}|(?:67|90)0\\d{7}", [10], 0, "1", 0, "([2-9]\\d{6})$|1", "670$1", 0, "670"], "MQ": ["596", "00", "7091\\d{5}|(?:[56]9|[89]\\d)\\d{7}", [9], [["(\\d{3})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[5-79]|8(?:0[6-9]|[36])"], "0$1"], ["(\\d{3})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["8"], "0$1"]], "0"], "MR": ["222", "00", "(?:[2-4]\\d\\d|800)\\d{5}", [8], [["(\\d{2})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[2-48]"]]]], "MS": ["1", "011", "(?:[58]\\d\\d|664|900)\\d{7}", [10], 0, "1", 0, "([34]\\d{6})$|1", "664$1", 0, "664"], "MT": ["356", "00", "3550\\d{4}|(?:[2579]\\d\\d|800)\\d{5}", [8], [["(\\d{4})(\\d{4})", "$1 $2", ["[2357-9]"]]]], "MU": ["230", "0(?:0|[24-7]0|3[03])", "(?:[57]|8\\d\\d)\\d{7}|[2-468]\\d{6}", [7, 8, 10], [["(\\d{3})(\\d{4})", "$1 $2", ["[2-46]|8[013]"]], ["(\\d{4})(\\d{4})", "$1 $2", ["[57]"]], ["(\\d{5})(\\d{5})", "$1 $2", ["8"]]], 0, 0, 0, 0, 0, 0, 0, "020"], "MV": ["960", "0(?:0|19)", "(?:800|9[0-57-9]\\d)\\d{7}|[34679]\\d{6}", [7, 10], [["(\\d{3})(\\d{4})", "$1-$2", ["[34679]"]], ["(\\d{3})(\\d{3})(\\d{4})", "$1 $2 $3", ["[89]"]]], 0, 0, 0, 0, 0, 0, 0, "00"], "MW": ["265", "00", "(?:[1289]\\d|31|77)\\d{7}|1\\d{6}", [7, 9], [["(\\d)(\\d{3})(\\d{3})", "$1 $2 $3", ["1[2-9]"], "0$1"], ["(\\d{3})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[1-37-9]"], "0$1"]], "0"], "MX": ["52", "0[09]", "[2-9]\\d{9}", [10], [["(\\d{2})(\\d{4})(\\d{4})", "$1 $2 $3", ["33|5[56]|81"]], ["(\\d{3})(\\d{3})(\\d{4})", "$1 $2 $3", ["[2-9]"]]], 0, 0, 0, 0, 0, 0, 0, "00"], "MY": ["60", "00", "1\\d{8,9}|(?:3\\d|[4-9])\\d{7}", [8, 9, 10], [["(\\d)(\\d{3})(\\d{4})", "$1-$2 $3", ["[4-79]"], "0$1"], ["(\\d{2})(\\d{3})(\\d{3,4})", "$1-$2 $3", ["1(?:[02469]|[378][1-9]|53)|8", "1(?:[02469]|[37][1-9]|53|8(?:[1-46-9]|5[7-9]))|8"], "0$1"], ["(\\d)(\\d{4})(\\d{4})", "$1-$2 $3", ["3"], "0$1"], ["(\\d)(\\d{3})(\\d{2})(\\d{4})", "$1-$2-$3-$4", ["1(?:[367]|80)"]], ["(\\d{3})(\\d{3})(\\d{4})", "$1-$2 $3", ["15"], "0$1"], ["(\\d{2})(\\d{4})(\\d{4})", "$1-$2 $3", ["1"], "0$1"]], "0"], "MZ": ["258", "00", "(?:2|8\\d)\\d{7}", [8, 9], [["(\\d{2})(\\d{3})(\\d{3,4})", "$1 $2 $3", ["2|8[2-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-7])"], "0$1"], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["[2-8]"], "0$1"], ["(\\d{4})(\\d{3})(\\d{4})", "$1 $2 $3", ["9"]]], "0"], "QA": ["974", "00", "800\\d{4}|(?:2|800)\\d{6}|(?:0080|[3-7])\\d{7}", [7, 8, 9, 11], [["(\\d{3})(\\d{4})", "$1 $2", ["2[136]|8"]], ["(\\d{4})(\\d{4})", "$1 $2", ["[3-7]"]]]], "RE": ["262", "00", "709\\d{6}|(?:26|[689]\\d)\\d{7}", [9], [["(\\d{3})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[26-9]"], "0$1"]], "0", 0, 0, 0, 0, 0, [["2631[0-6]\\d{4}|26(?:2\\d|30|88)\\d{5}"], ["(?:69(?:2\\d\\d|3(?:[06][0-6]|1[0-3]|2[0-2]|3[0-39]|4\\d|5[0-5]|7[0-37]|8[0-8]|9[0-479]))|7092[0-3])\\d{4}"], ["80\\d{7}"], ["89[1-37-9]\\d{6}"], 0, 0, 0, 0, ["9(?:399[0-3]|479[0-6]|76(?:2[278]|3[0-37]))\\d{4}"], ["8(?:1[019]|2[0156]|84|90)\\d{6}"]]], "RO": ["40", "00", "(?:[236-8]\\d|90)\\d{7}|[23]\\d{5}", [6, 9], [["(\\d{3})(\\d{3})", "$1 $2", ["2[3-6]", "2[3-6]\\d9"], "0$1"], ["(\\d{2})(\\d{4})", "$1 $2", ["219|31"], "0$1"], ["(\\d{2})(\\d{3})(\\d{4})", "$1 $2 $3", ["[23]1"], "0$1"], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["[236-9]"], "0$1"]], "0", 0, 0, 0, 0, 0, 0, 0, " int "], "RS": ["381", "00", "38[02-9]\\d{6,9}|6\\d{7,9}|90\\d{4,8}|38\\d{5,6}|(?:7\\d\\d|800)\\d{3,9}|(?:[12]\\d|3[0-79])\\d{5,10}", [6, 7, 8, 9, 10, 11, 12], [["(\\d{3})(\\d{3,9})", "$1 $2", ["(?:2[389]|39)0|[7-9]"], "0$1"], ["(\\d{2})(\\d{5,10})", "$1 $2", ["[1-36]"], "0$1"]], "0"], "RU": ["7", "810", "8\\d{13}|[347-9]\\d{9}", [10, 14], [["(\\d{4})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["7(?:1[0-8]|2[1-9])", "7(?:1(?:[0-356]2|4[29]|7|8[27])|2(?:1[23]|[2-9]2))", "7(?:1(?:[0-356]2|4[29]|7|8[27])|2(?:13[03-69]|62[013-9]))|72[1-57-9]2"], "8 ($1)", 1], ["(\\d{5})(\\d)(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["7(?:1[0-68]|2[1-9])", "7(?:1(?:[06][3-6]|[18]|2[35]|[3-5][3-5])|2(?:[13][3-5]|[24-689]|7[457]))", "7(?:1(?:0(?:[356]|4[023])|[18]|2(?:3[013-9]|5)|3[45]|43[013-79]|5(?:3[1-8]|4[1-7]|5)|6(?:3[0-35-9]|[4-6]))|2(?:1(?:3[178]|[45])|[24-689]|3[35]|7[457]))|7(?:14|23)4[0-8]|71(?:33|45)[1-79]"], "8 ($1)", 1], ["(\\d{3})(\\d{3})(\\d{4})", "$1 $2 $3", ["7"], "8 ($1)", 1], ["(\\d{3})(\\d{3})(\\d{2})(\\d{2})", "$1 $2-$3-$4", ["[349]|8(?:[02-7]|1[1-8])"], "8 ($1)", 1], ["(\\d{4})(\\d{4})(\\d{3})(\\d{3})", "$1 $2 $3 $4", ["8"], "8 ($1)"]], "8", 0, 0, 0, 0, "[3489]", 0, "8~10"], "RW": ["250", "00", "(?:06|[27]\\d\\d|[89]00)\\d{6}", [8, 9], [["(\\d{2})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["0"]], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["2"]], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["[7-9]"], "0$1"]], "0"], "SA": ["966", "00", "(?:[15]\\d|800|92)\\d{7}", [9, 10], [["(\\d{4})(\\d{5})", "$1 $2", ["9"]], ["(\\d{2})(\\d{3})(\\d{4})", "$1 $2 $3", ["1"], "0$1"], ["(\\d{2})(\\d{3})(\\d{4})", "$1 $2 $3", ["5"], "0$1"], ["(\\d{3})(\\d{3})(\\d{4})", "$1 $2 $3", ["8"]]], "0"], "SB": ["677", "0[01]", "[6-9]\\d{6}|[1-6]\\d{4}", [5, 7], [["(\\d{2})(\\d{5})", "$1 $2", ["6[89]|7|8[4-9]|9(?:[1-8]|9[0-8])"]]]], "SC": ["248", "010|0[0-2]", "(?:[2489]\\d|64)\\d{5}", [7], [["(\\d)(\\d{3})(\\d{3})", "$1 $2 $3", ["[246]|9[57]"]]], 0, 0, 0, 0, 0, 0, 0, "00"], "SD": ["249", "00", "[19]\\d{8}", [9], [["(\\d{2})(\\d{3})(\\d{4})", "$1 $2 $3", ["[19]"], "0$1"]], "0"], "SE": ["46", "00", "(?:[26]\\d\\d|9)\\d{9}|[1-9]\\d{8}|[1-689]\\d{7}|[1-4689]\\d{6}|2\\d{5}", [6, 7, 8, 9, 10, 12], [["(\\d{2})(\\d{2,3})(\\d{2})", "$1-$2 $3", ["20"], "0$1", 0, "$1 $2 $3"], ["(\\d{3})(\\d{4})", "$1-$2", ["9(?:00|39|44|9)"], "0$1", 0, "$1 $2"], ["(\\d{2})(\\d{3})(\\d{2})", "$1-$2 $3", ["[12][136]|3[356]|4[0246]|6[03]|90[1-9]"], "0$1", 0, "$1 $2 $3"], ["(\\d)(\\d{2,3})(\\d{2})(\\d{2})", "$1-$2 $3 $4", ["8"], "0$1", 0, "$1 $2 $3 $4"], ["(\\d{3})(\\d{2,3})(\\d{2})", "$1-$2 $3", ["1[2457]|2(?:[247-9]|5[0138])|3[0247-9]|4[1357-9]|5[0-35-9]|6(?:[125689]|4[02-57]|7[0-2])|9(?:[125-8]|3[02-5]|4[0-3])"], "0$1", 0, "$1 $2 $3"], ["(\\d{3})(\\d{2,3})(\\d{3})", "$1-$2 $3", ["9(?:00|39|44)"], "0$1", 0, "$1 $2 $3"], ["(\\d{2})(\\d{2,3})(\\d{2})(\\d{2})", "$1-$2 $3 $4", ["1[13689]|2[0136]|3[1356]|4[0246]|54|6[03]|90[1-9]"], "0$1", 0, "$1 $2 $3 $4"], ["(\\d{2})(\\d{3})(\\d{2})(\\d{2})", "$1-$2 $3 $4", ["10|7"], "0$1", 0, "$1 $2 $3 $4"], ["(\\d)(\\d{3})(\\d{3})(\\d{2})", "$1-$2 $3 $4", ["8"], "0$1", 0, "$1 $2 $3 $4"], ["(\\d{3})(\\d{2})(\\d{2})(\\d{2})", "$1-$2 $3 $4", ["[13-5]|2(?:[247-9]|5[0138])|6(?:[124-689]|7[0-2])|9(?:[125-8]|3[02-5]|4[0-3])"], "0$1", 0, "$1 $2 $3 $4"], ["(\\d{3})(\\d{2})(\\d{2})(\\d{3})", "$1-$2 $3 $4", ["9"], "0$1", 0, "$1 $2 $3 $4"], ["(\\d{3})(\\d{2})(\\d{3})(\\d{2})(\\d{2})", "$1-$2 $3 $4 $5", ["[26]"], "0$1", 0, "$1 $2 $3 $4 $5"]], "0"], "SG": ["65", "0[0-3]\\d", "(?:(?:1\\d|8)\\d\\d|7000)\\d{7}|[3689]\\d{7}", [8, 10, 11], [["(\\d{4})(\\d{4})", "$1 $2", ["[369]|8(?:0[1-9]|[1-9])"]], ["(\\d{3})(\\d{3})(\\d{4})", "$1 $2 $3", ["8"]], ["(\\d{4})(\\d{4})(\\d{3})", "$1 $2 $3", ["7"]], ["(\\d{4})(\\d{3})(\\d{4})", "$1 $2 $3", ["1"]]]], "SH": ["290", "00", "(?:[256]\\d|8)\\d{3}", [4, 5], 0, 0, 0, 0, 0, 0, "[256]"], "SI": ["386", "00|10(?:22|66|88|99)", "[1-7]\\d{7}|8\\d{4,7}|90\\d{4,6}", [5, 6, 7, 8], [["(\\d{2})(\\d{3,6})", "$1 $2", ["8[09]|9"], "0$1"], ["(\\d{3})(\\d{5})", "$1 $2", ["59|8"], "0$1"], ["(\\d{2})(\\d{3})(\\d{3})", "$1 $2 $3", ["[37][01]|4[013]|51|6"], "0$1"], ["(\\d)(\\d{3})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[1-57]"], "(0$1)"]], "0", 0, 0, 0, 0, 0, 0, "00"], "SJ": ["47", "00", "0\\d{4}|(?:[489]\\d|79)\\d{6}", [5, 8], 0, 0, 0, 0, 0, 0, "79"], "SK": ["421", "00", "[2-689]\\d{8}|[2-59]\\d{6}|[2-5]\\d{5}", [6, 7, 9], [["(\\d)(\\d{2})(\\d{3,4})", "$1 $2 $3", ["21"], "0$1"], ["(\\d{2})(\\d{2})(\\d{2,3})", "$1 $2 $3", ["[3-5][1-8]1", "[3-5][1-8]1[67]"], "0$1"], ["(\\d)(\\d{3})(\\d{3})(\\d{2})", "$1 $2 $3 $4", ["2"], "0$1"], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["[689]"], "0$1"], ["(\\d{2})(\\d{3})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[3-5]"], "0$1"]], "0"], "SL": ["232", "00", "(?:[237-9]\\d|66)\\d{6}", [8], [["(\\d{2})(\\d{6})", "$1 $2", ["[236-9]"], "(0$1)"]], "0"], "SM": ["378", "00", "(?:0549|[5-7]\\d)\\d{6}", [8, 10], [["(\\d{2})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[5-7]"]], ["(\\d{4})(\\d{6})", "$1 $2", ["0"]]], 0, 0, "([89]\\d{5})$", "0549$1"], "SN": ["221", "00", "(?:[378]\\d|93)\\d{7}", [9], [["(\\d{3})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["8"]], ["(\\d{2})(\\d{3})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[379]"]]]], "SO": ["252", "00", "[346-9]\\d{8}|[12679]\\d{7}|[1-5]\\d{6}|[1348]\\d{5}", [6, 7, 8, 9], [["(\\d{2})(\\d{4})", "$1 $2", ["8[125]"]], ["(\\d{6})", "$1", ["[134]"]], ["(\\d)(\\d{6})", "$1 $2", ["[15]|2[0-79]|3[0-46-8]|4[0-7]"]], ["(\\d{2})(\\d{5,7})", "$1 $2", ["1|28|9[2-9]"]], ["(\\d)(\\d{7})", "$1 $2", ["[267]|904"]], ["(\\d{2})(\\d{3})(\\d{4})", "$1 $2 $3", ["[346-9]"]]], "0"], "SR": ["597", "00", "(?:[2-5]|[6-9]\\d)\\d{5}", [6, 7], [["(\\d{2})(\\d{2})(\\d{2})", "$1-$2-$3", ["56"]], ["(\\d{3})(\\d{3})", "$1-$2", ["[2-5]"]], ["(\\d{3})(\\d{4})", "$1-$2", ["[6-9]"]]]], "SS": ["211", "00", "[19]\\d{8}", [9], [["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["[19]"], "0$1"]], "0"], "ST": ["239", "00", "(?:22|9\\d)\\d{5}", [7], [["(\\d{3})(\\d{4})", "$1 $2", ["[29]"]]]], "SV": ["503", "00", "[25-7]\\d{7}|(?:80\\d|900)\\d{4}(?:\\d{4})?", [7, 8, 11], [["(\\d{3})(\\d{4})", "$1 $2", ["[89]"]], ["(\\d{4})(\\d{4})", "$1 $2", ["[25-7]"]], ["(\\d{3})(\\d{4})(\\d{4})", "$1 $2 $3", ["[89]"]]]], "SX": ["1", "011", "7215\\d{6}|(?:[58]\\d\\d|900)\\d{7}", [10], 0, "1", 0, "(5\\d{6})$|1", "721$1", 0, "721"], "SY": ["963", "00", "[1-359]\\d{8}|[1-5]\\d{7}", [8, 9], [["(\\d{2})(\\d{3})(\\d{3,4})", "$1 $2 $3", ["[1-4]|5[1-3]"], "0$1", 1], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["[59]"], "0$1", 1]], "0"], "SZ": ["268", "00", "0800\\d{4}|(?:[237]\\d|900)\\d{6}", [8, 9], [["(\\d{4})(\\d{4})", "$1 $2", ["[0237]"]], ["(\\d{5})(\\d{4})", "$1 $2", ["9"]]]], "TA": ["290", "00", "8\\d{3}", [4], 0, 0, 0, 0, 0, 0, "8"], "TC": ["1", "011", "(?:[58]\\d\\d|649|900)\\d{7}", [10], 0, "1", 0, "([2-479]\\d{6})$|1", "649$1", 0, "649"], "TD": ["235", "00|16", "(?:22|[3689]\\d|77)\\d{6}", [8], [["(\\d{2})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[236-9]"]]], 0, 0, 0, 0, 0, 0, 0, "00"], "TG": ["228", "00", "[279]\\d{7}", [8], [["(\\d{2})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[279]"]]]], "TH": ["66", "00[1-9]", "(?:001800|[2-57]|[689]\\d)\\d{7}|1\\d{7,9}", [8, 9, 10, 13], [["(\\d)(\\d{3})(\\d{4})", "$1 $2 $3", ["2"], "0$1"], ["(\\d{2})(\\d{3})(\\d{3,4})", "$1 $2 $3", ["[13-9]"], "0$1"], ["(\\d{4})(\\d{3})(\\d{3})", "$1 $2 $3", ["1"]]], "0"], "TJ": ["992", "810", "(?:[0-57-9]\\d|66)\\d{7}", [9], [["(\\d{6})(\\d)(\\d{2})", "$1 $2 $3", ["331", "3317"]], ["(\\d{3})(\\d{2})(\\d{4})", "$1 $2 $3", ["44[02-479]|[34]7"]], ["(\\d{4})(\\d)(\\d{4})", "$1 $2 $3", ["3(?:[1245]|3[12])"]], ["(\\d{2})(\\d{3})(\\d{4})", "$1 $2 $3", ["\\d"]]], 0, 0, 0, 0, 0, 0, 0, "8~10"], "TK": ["690", "00", "[2-47]\\d{3,6}", [4, 5, 6, 7]], "TL": ["670", "00", "7\\d{7}|(?:[2-47]\\d|[89]0)\\d{5}", [7, 8], [["(\\d{3})(\\d{4})", "$1 $2", ["[2-489]|70"]], ["(\\d{4})(\\d{4})", "$1 $2", ["7"]]]], "TM": ["993", "810", "[1-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, [["(?:472[2-47-9]|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[0589]|8[04])|5(?:0[1-57-9]|1[0235-8]|20|3[0149]|4[01]|5[179]|6[1-47]|7[0-5]|8[0256])|6(?:0[1-35-9]|1[024-9]|2[03689]|3[016]|4[0156]|5[01679]|6[0-279]|78|8[0-269])|7(?:0[1-46-8]|1[2-9]|2[04-8]|3[0-2478]|4[0378]|5[47]|6[02359]|7[0-59]|8[156])|8(?:0[1-68]|1[02-8]|2[0168]|3[0-2589]|4[03578]|5[046-9]|6[02-5]|7[028])|9(?:0[1346-9]|1[02-9]|2[0589]|3[0146-8]|4[01357-9]|5[12469]|7[0-3589]|8[04-69]))[2-9]\\d{6}"], [""], ["8(?:00|33|44|55|66|77|88)[2-9]\\d{6}"], ["900[2-9]\\d{6}"], ["52(?:3(?:[2-46-9][02-9]\\d|5(?:[02-46-9]\\d|5[0-46-9]))|4(?:[2-478][02-9]\\d|5(?:[034]\\d|2[024-9]|5[0-46-9])|6(?:0[1-9]|[2-9]\\d)|9(?:[05-9]\\d|2[0-5]|49)))\\d{4}|52[34][2-9]1[02-9]\\d{4}|5(?:00|2[125-9]|3[23]|44|66|77|88)[2-9]\\d{6}"]]], "UY": ["598", "0(?:0|1[3-9]\\d)", "0004\\d{2,9}|[1249]\\d{7}|2\\d{3,4}|(?:[49]\\d|80)\\d{5}", [4, 5, 6, 7, 8, 9, 10, 11, 12, 13], [["(\\d{4,5})", "$1", ["21"]], ["(\\d{3})(\\d{3,4})", "$1 $2", ["0"]], ["(\\d{3})(\\d{4})", "$1 $2", ["[49]0|8"], "0$1"], ["(\\d{2})(\\d{3})(\\d{3})", "$1 $2 $3", ["9"], "0$1"], ["(\\d{4})(\\d{4})", "$1 $2", ["[124]"]], ["(\\d{3})(\\d{3})(\\d{2,4})", "$1 $2 $3", ["0"]], ["(\\d{3})(\\d{3})(\\d{3})(\\d{2,4})", "$1 $2 $3 $4", ["0"]]], "0", 0, 0, 0, 0, 0, 0, "00", " int. "], "UZ": ["998", "00", "(?:20|33|[5-9]\\d)\\d{7}", [9], [["(\\d{2})(\\d{3})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[235-9]"]]]], "VA": ["39", "00", "0\\d{5,10}|3[0-8]\\d{7,10}|55\\d{8}|8\\d{5}(?:\\d{2,4})?|(?:1\\d|39)\\d{7,8}", [6, 7, 8, 9, 10, 11, 12], 0, 0, 0, 0, 0, 0, "06698"], "VC": ["1", "011", "(?:[58]\\d\\d|784|900)\\d{7}", [10], 0, "1", 0, "([2-7]\\d{6})$|1", "784$1", 0, "784"], "VE": ["58", "00", "[68]00\\d{7}|(?:[24]\\d|[59]0)\\d{8}", [10], [["(\\d{3})(\\d{7})", "$1-$2", ["[24-689]"], "0$1"]], "0"], "VG": ["1", "011", "(?:284|[58]\\d\\d|900)\\d{7}", [10], 0, "1", 0, "([2-578]\\d{6})$|1", "284$1", 0, "284"], "VI": ["1", "011", "[58]\\d{9}|(?:34|90)0\\d{7}", [10], 0, "1", 0, "([2-9]\\d{6})$|1", "340$1", 0, "340"], "VN": ["84", "00", "[12]\\d{9}|[135-9]\\d{8}|[16]\\d{6,7}|7\\d{6}", [7, 8, 9, 10], [["(\\d{4})(\\d{4,6})", "$1 $2", ["1(?:2[02]|[89])"], 0, 1], ["(\\d{2})(\\d{3})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["1[26]|6"], "0$1", 1], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["[357-9]"], "0$1", 1], ["(\\d{2})(\\d{4})(\\d{4})", "$1 $2 $3", ["2[48]"], "0$1", 1], ["(\\d{3})(\\d{4})(\\d{3})", "$1 $2 $3", ["2"], "0$1", 1]], "0"], "VU": ["678", "00", "[57-9]\\d{6}|(?:[238]\\d|48)\\d{3}", [5, 7], [["(\\d{3})(\\d{4})", "$1 $2", ["[57-9]"]]]], "WF": ["681", "00", "(?:40|72|8\\d{4})\\d{4}|[89]\\d{5}", [6, 9], [["(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3", ["[47-9]"]], ["(\\d{3})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["8"]]]], "WS": ["685", "0", "(?:[2-6]|8\\d{5})\\d{4}|[78]\\d{6}|[68]\\d{5}", [5, 6, 7, 10], [["(\\d{5})", "$1", ["[2-5]|6[1-9]"]], ["(\\d{3})(\\d{3,7})", "$1 $2", ["[68]"]], ["(\\d{2})(\\d{5})", "$1 $2", ["7"]]]], "XK": ["383", "00", "2\\d{7,8}|3\\d{7,11}|(?:4\\d\\d|[89]00)\\d{5}", [8, 9, 10, 11, 12], [["(\\d{3})(\\d{5})", "$1 $2", ["[89]"], "0$1"], ["(\\d{2})(\\d{3})(\\d{3})", "$1 $2 $3", ["[2-4]"], "0$1"], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["2|39"], "0$1"], ["(\\d{2})(\\d{7,10})", "$1 $2", ["3"], "0$1"]], "0"], "YE": ["967", "00", "(?:1|7\\d)\\d{7}|[1-7]\\d{6}", [7, 8, 9], [["(\\d)(\\d{3})(\\d{3,4})", "$1 $2 $3", ["[1-6]|7(?:[24-6]|8[0-7])"], "0$1"], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["7"], "0$1"]], "0"], "YT": ["262", "00", "(?:639\\d|7093)\\d{5}|(?:26|80|9\\d)\\d{7}", [9], 0, "0", 0, 0, 0, 0, 0, [["26(?:89\\d|9(?:0[0-467]|15|5[0-4]|6\\d|[78]0))\\d{4}"], ["(?:639(?:0[0-79]|1[019]|[267]\\d|3[09]|40|5[05-9]|9[04-79])|7093[5-7])\\d{4}"], ["80\\d{7}"], 0, 0, 0, 0, 0, ["9(?:(?:39|47)8[01]|769\\d)\\d{4}"]]], "ZA": ["27", "00", "[1-79]\\d{8}|8\\d{4,9}", [5, 6, 7, 8, 9, 10], [["(\\d{2})(\\d{3,4})", "$1 $2", ["8[1-4]"], "0$1"], ["(\\d{2})(\\d{3})(\\d{2,3})", "$1 $2 $3", ["8[1-4]"], "0$1"], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["860"], "0$1"], ["(\\d{2})(\\d{3})(\\d{4})", "$1 $2 $3", ["[1-9]"], "0$1"], ["(\\d{3})(\\d{3})(\\d{4})", "$1 $2 $3", ["8"], "0$1"]], "0"], "ZM": ["260", "00", "800\\d{6}|(?:21|[579]\\d|63)\\d{7}", [9], [["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["[28]"], "0$1"], ["(\\d{2})(\\d{7})", "$1 $2", ["[579]"], "0$1"]], "0"], "ZW": ["263", "00", "(?:13|8\\d{4})\\d{5}|[235-8]\\d{8}|[2-689]\\d{6}", [7, 9, 10], [["(\\d{2})(\\d{3,5})", "$1 $2", ["1|2(?:0[0-36-9]|29|58)|67[0-46-9]|(?:55|68)[0-69]"], "0$1"], ["(\\d{3})(\\d{3,5})", "$1 $2", ["2(?:0[45]|[27]|48)|37|675|(?:55|68)[78]"], "0$1"], ["(\\d)(\\d{3})(\\d{2,4})", "$1 $2 $3", ["[49]"], "0$1"], ["(\\d{3})(\\d{4})", "$1 $2", ["80"], "0$1"], ["(\\d{4})(\\d{3,5})", "$1 $2", ["548"], "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}"]]] } };
12121
13949
 
12122
13950
  // ../../node_modules/libphonenumber-js/min/exports/withMetadataArgument.js
12123
13951
  function withMetadataArgument(func, _arguments) {
@@ -16742,6 +18570,36 @@ var COLUMNS32 = [
16742
18570
  { header: "URL", getValue: (item) => item.baseUrl ?? "" },
16743
18571
  COL.status()
16744
18572
  ];
18573
+ function summarizeReasons(collections, key) {
18574
+ if (!collections?.length) return "";
18575
+ const parts = [];
18576
+ for (const collection of collections) {
18577
+ const counts = collection?.[key];
18578
+ if (!counts) continue;
18579
+ for (const [reason, count] of Object.entries(counts)) {
18580
+ parts.push(`${collection.collection}:${reason} x${count}`);
18581
+ }
18582
+ }
18583
+ return parts.join(", ");
18584
+ }
18585
+ var ENCOUNTER_RUN_COLUMNS = [
18586
+ { header: "RUN ID", getValue: (item) => item.runId ?? "" },
18587
+ { header: "STATUS", getValue: (item) => item.status ?? "" },
18588
+ { header: "KIND", getValue: (item) => item.runKind ?? "full_sweep" },
18589
+ { header: "SOURCE", getValue: (item) => item.source ?? "" },
18590
+ { header: "TOTAL", getValue: (item) => String(item.total ?? 0) },
18591
+ { header: "UPDATED", getValue: (item) => String(item.synced ?? 0) },
18592
+ { header: "FAILED", getValue: (item) => String(item.failed ?? 0) },
18593
+ { header: "STARTED", getValue: (item) => item.startedAt ?? "" },
18594
+ {
18595
+ header: "SKIPPED (BY DESIGN)",
18596
+ getValue: (item) => summarizeReasons(item.attribution?.collections, "skipReasonCounts")
18597
+ },
18598
+ {
18599
+ header: "COLLECTION ERRORS",
18600
+ getValue: (item) => summarizeReasons(item.attribution?.collections, "errorReasonCounts")
18601
+ }
18602
+ ];
16745
18603
  var fhirConnectionsDomain = {
16746
18604
  name: "fhir-connections",
16747
18605
  description: "Manage FHIR connections",
@@ -16769,6 +18627,36 @@ var fhirConnectionsDomain = {
16769
18627
  );
16770
18628
  outputSingle(result2, ctx);
16771
18629
  }
18630
+ },
18631
+ {
18632
+ // Deliberately separate from `gr sync runs`, which stays generic and
18633
+ // connector-neutral. Encounter-sync attribution is eCW-specific, so
18634
+ // it lives on the eCW route and on this eCW command.
18635
+ //
18636
+ // Note an aggregate eCW full sweep publishes NO per-item rows, so
18637
+ // `gr sync items` is expected to come back empty for these runs —
18638
+ // the per-collection counters below are the item-level detail.
18639
+ path: ["fhir-connections", "encounter-sync", "runs"],
18640
+ description: "List encounter-sync runs for a FHIR connection, with collection attribution",
18641
+ requiresWorkspace: true,
18642
+ args: [
18643
+ { name: "id", description: "FHIR connection ID", required: true },
18644
+ { name: "limit", description: "Max runs to return (default 20)" }
18645
+ ],
18646
+ examples: [
18647
+ "fhir-connections encounter-sync runs --id 12",
18648
+ "fhir-connections encounter-sync runs --id 12 --output json",
18649
+ "fhir-connections encounter-sync runs --id 12 --limit 5 --output json"
18650
+ ],
18651
+ handler: async ({ ctx, workspace, args }) => {
18652
+ const limit = args["limit"] ? Number(args["limit"]) : 20;
18653
+ const runs = await requireAuth(ctx).apiClient.fhirGetEncounterSyncRuns(
18654
+ workspace,
18655
+ requireNumber(args, "id"),
18656
+ limit
18657
+ );
18658
+ outputData(runs, ctx, ENCOUNTER_RUN_COLUMNS);
18659
+ }
16772
18660
  }
16773
18661
  ]
16774
18662
  };
@@ -18115,7 +20003,6 @@ function registerPublicDomains(registry) {
18115
20003
  registry.register(agentTasksDomain);
18116
20004
  registry.register(assignmentsDomain);
18117
20005
  registry.register(dataTypesDomain);
18118
- registry.register(devicesDomain);
18119
20006
  registry.register(sitesDomain);
18120
20007
  registry.register(filesDomain);
18121
20008
  registry.register(eventsDomain);
@@ -18127,6 +20014,7 @@ function registerPublicDomains(registry) {
18127
20014
  registry.register(personasDomain);
18128
20015
  registry.register(metricsDomain);
18129
20016
  registry.register(journeysDomain);
20017
+ registry.register(activityDomain);
18130
20018
  registry.register(abilitiesDomain);
18131
20019
  registry.register(phoneNumbersDomain);
18132
20020
  registry.register(recordingsDomain);
@@ -18341,6 +20229,90 @@ var UI_CHOICE_DECLINE_MESSAGE = "The user declined to make a selection.";
18341
20229
  // src/lib/openui-terminal.ts
18342
20230
  import * as readline from "readline";
18343
20231
 
20232
+ // src/lib/ui-prompt-response.ts
20233
+ var UI_PROMPT_KINDS = {
20234
+ render_ui: true,
20235
+ present_choice_list: true,
20236
+ inline_connect: true
20237
+ };
20238
+ function isUiPromptKind(value) {
20239
+ return typeof value === "string" && Object.hasOwn(UI_PROMPT_KINDS, value);
20240
+ }
20241
+ function multiChoiceValue(values) {
20242
+ return JSON.stringify(values);
20243
+ }
20244
+ function serializeBody(body) {
20245
+ if (body.status === "declined") {
20246
+ return JSON.stringify({ status: "declined" });
20247
+ }
20248
+ if ("values" in body) {
20249
+ return JSON.stringify({ status: "submitted", values: body.values });
20250
+ }
20251
+ return JSON.stringify({ status: "submitted", chosenValue: body.chosenValue });
20252
+ }
20253
+ function formatUiPromptResponse(args) {
20254
+ const { promptId, kind, body } = args;
20255
+ if (!promptId || /["\r\n]/.test(promptId)) {
20256
+ throw new Error(
20257
+ "formatUiPromptResponse: promptId must be a non-empty id without quotes or newlines"
20258
+ );
20259
+ }
20260
+ return [
20261
+ `<ui-prompt-response prompt_id="${promptId}" kind="${kind}">`,
20262
+ serializeBody(body),
20263
+ "</ui-prompt-response>"
20264
+ ].join("\n");
20265
+ }
20266
+ var BLOCK_RE = /^<ui-prompt-response\s+prompt_id="([^"]+)"\s+kind="([^"]+)">\n([\s\S]*)\n<\/ui-prompt-response>$/;
20267
+ function parseUiPromptResponse(content) {
20268
+ if (typeof content !== "string") return null;
20269
+ const match = BLOCK_RE.exec(content.trim());
20270
+ if (!match) return null;
20271
+ const [, promptId, kind, json] = match;
20272
+ if (!promptId || !isUiPromptKind(kind) || json === void 0) return null;
20273
+ let parsed;
20274
+ try {
20275
+ parsed = JSON.parse(json);
20276
+ } catch {
20277
+ return null;
20278
+ }
20279
+ if (!parsed || typeof parsed !== "object") return null;
20280
+ const record = parsed;
20281
+ const hasChoice = record.chosenValue !== void 0;
20282
+ const hasValues = record.values !== void 0;
20283
+ if (record.status === "declined") {
20284
+ return hasChoice || hasValues ? null : { promptId, kind, body: { status: "declined" } };
20285
+ }
20286
+ if (record.status !== "submitted" || hasChoice === hasValues) return null;
20287
+ if (hasChoice) {
20288
+ return typeof record.chosenValue === "string" ? { promptId, kind, body: { status: "submitted", chosenValue: record.chosenValue } } : null;
20289
+ }
20290
+ const values = parseFormValues(record.values);
20291
+ return values ? { promptId, kind, body: { status: "submitted", values } } : null;
20292
+ }
20293
+ function parseFormValues(raw) {
20294
+ if (typeof raw !== "object" || raw === null || Array.isArray(raw)) return null;
20295
+ const values = {};
20296
+ for (const [key, value] of Object.entries(raw)) {
20297
+ if (typeof value !== "string") return null;
20298
+ values[key] = value;
20299
+ }
20300
+ return values;
20301
+ }
20302
+ function summarizeUiPromptResponse(response) {
20303
+ const { body } = response;
20304
+ if (body.status === "declined") return "Declined";
20305
+ if ("values" in body) {
20306
+ const count = Object.keys(body.values).length;
20307
+ return `Submitted form (${count} field${count === 1 ? "" : "s"})`;
20308
+ }
20309
+ return `Selected: ${body.chosenValue}`;
20310
+ }
20311
+ function displayUserMessage(content) {
20312
+ const parsed = parseUiPromptResponse(content);
20313
+ return parsed ? summarizeUiPromptResponse(parsed) : content;
20314
+ }
20315
+
18344
20316
  // src/lib/openui-parse.ts
18345
20317
  function markupIsInteractive(markup) {
18346
20318
  return markup.includes("ChoiceButton(") || markup.includes("Form(") || markup.includes("Input(") || markup.includes("TextArea(") || markup.includes("Select(") || markup.includes("ChoiceField(");
@@ -18573,11 +20545,11 @@ function resolveFormControl(bindings, ref) {
18573
20545
  }
18574
20546
  return null;
18575
20547
  }
18576
- function isPlainObject(arg) {
20548
+ function isPlainObject2(arg) {
18577
20549
  return !!arg && typeof arg === "object" && !Array.isArray(arg) && !("__ref" in arg);
18578
20550
  }
18579
20551
  function rulesRequired(arg) {
18580
- if (!isPlainObject(arg)) return false;
20552
+ if (!isPlainObject2(arg)) return false;
18581
20553
  return arg["required"] === true;
18582
20554
  }
18583
20555
  function splitPlaceholderAndRules(args, start) {
@@ -18592,7 +20564,7 @@ function splitPlaceholderAndRules(args, start) {
18592
20564
  if (placeholder === void 0) placeholder = arg;
18593
20565
  continue;
18594
20566
  }
18595
- if (isPlainObject(arg)) {
20567
+ if (isPlainObject2(arg)) {
18596
20568
  required = rulesRequired(arg);
18597
20569
  break;
18598
20570
  }
@@ -18673,16 +20645,16 @@ function extractDisplay(bindings) {
18673
20645
 
18674
20646
  // src/lib/openui-terminal.ts
18675
20647
  var CYAN = "\x1B[36m";
18676
- var DIM = "\x1B[90m";
20648
+ var DIM2 = "\x1B[90m";
18677
20649
  var BOLD = "\x1B[1m";
18678
- var RESET = "\x1B[0m";
20650
+ var RESET2 = "\x1B[0m";
18679
20651
  var INVERSE = "\x1B[7m";
18680
20652
  var GREEN = "\x1B[32m";
18681
- async function promptOpenUiTerminal(payload) {
20653
+ async function promptOpenUiTerminalResult(payload, opts = {}) {
18682
20654
  const prompt = payload.userPrompt && payload.userPrompt.trim() || payload.description && payload.description.trim() || "Choose an option";
18683
20655
  const markup = payload.openuiMarkup ?? "";
18684
20656
  writeOut(`
18685
- ${CYAN}${BOLD}${prompt}${RESET}
20657
+ ${CYAN}${BOLD}${prompt}${RESET2}
18686
20658
  `);
18687
20659
  if (!markup.trim()) {
18688
20660
  return promptFreeform("Your reply");
@@ -18691,22 +20663,39 @@ ${CYAN}${BOLD}${prompt}${RESET}
18691
20663
  renderDisplay(parsed.display);
18692
20664
  if (!process.stdin.isTTY) {
18693
20665
  writeParsedSummary(parsed, markup);
18694
- return "";
20666
+ return { kind: "skipped" };
18695
20667
  }
18696
20668
  if (parsed.form) {
18697
20669
  return promptForm(parsed.form, parsed.choices);
18698
20670
  }
18699
20671
  if (parsed.choices.length > 0) {
18700
- return promptChoices(parsed.choices);
20672
+ return promptChoices(parsed.choices, opts.multi === true);
18701
20673
  }
18702
20674
  if (markupIsInteractive(markup)) {
18703
- writeOut(`${DIM}(Could not fully parse UI controls \u2014 enter a value manually.)${RESET}
20675
+ writeOut(`${DIM2}(Could not fully parse UI controls \u2014 enter a value manually.)${RESET2}
18704
20676
  `);
18705
- writeOut(`${DIM}${markup.slice(0, 500)}${markup.length > 500 ? "\u2026" : ""}${RESET}
20677
+ writeOut(`${DIM2}${markup.slice(0, 500)}${markup.length > 500 ? "\u2026" : ""}${RESET2}
18706
20678
  `);
18707
20679
  }
18708
20680
  return promptFreeform("Your reply");
18709
20681
  }
20682
+ async function promptOpenUiTerminal(payload) {
20683
+ return resumeValueFor(await promptOpenUiTerminalResult(payload));
20684
+ }
20685
+ function resumeValueFor(result2) {
20686
+ switch (result2.kind) {
20687
+ case "choice":
20688
+ return result2.value;
20689
+ case "form":
20690
+ return JSON.stringify(result2.values);
20691
+ case "text":
20692
+ return result2.text;
20693
+ case "declined":
20694
+ return UI_CHOICE_DECLINE_MESSAGE;
20695
+ case "skipped":
20696
+ return "";
20697
+ }
20698
+ }
18710
20699
  function writeOut(text) {
18711
20700
  process.stderr.write(text);
18712
20701
  }
@@ -18714,7 +20703,7 @@ function writeParsedSummary(parsed, markup) {
18714
20703
  if (parsed.choices.length) {
18715
20704
  for (const [i, c] of parsed.choices.entries()) {
18716
20705
  writeOut(
18717
- ` ${i + 1}. ${c.label}${c.value !== c.label ? ` ${DIM}[${c.value}]${RESET}` : ""}
20706
+ ` ${i + 1}. ${c.label}${c.value !== c.label ? ` ${DIM2}[${c.value}]${RESET2}` : ""}
18718
20707
  `
18719
20708
  );
18720
20709
  }
@@ -18734,17 +20723,17 @@ function renderDisplay(display) {
18734
20723
  for (const item of display) {
18735
20724
  if (item.kind === "info") {
18736
20725
  writeOut(`
18737
- ${BOLD}${item.icon ? `${item.icon} ` : ""}${item.title}${RESET}
20726
+ ${BOLD}${item.icon ? `${item.icon} ` : ""}${item.title}${RESET2}
18738
20727
  `);
18739
20728
  if (item.body) {
18740
20729
  for (const line of item.body.split("\n")) {
18741
- writeOut(` ${DIM}${line}${RESET}
20730
+ writeOut(` ${DIM2}${line}${RESET2}
18742
20731
  `);
18743
20732
  }
18744
20733
  }
18745
20734
  } else if (item.kind === "stat") {
18746
20735
  const trend = item.trend === "up" ? " \u2191" : item.trend === "down" ? " \u2193" : item.trend === "neutral" ? "" : "";
18747
- writeOut(` ${DIM}${item.label}${RESET} ${BOLD}${item.value}${trend}${RESET}
20736
+ writeOut(` ${DIM2}${item.label}${RESET2} ${BOLD}${item.value}${trend}${RESET2}
18748
20737
  `);
18749
20738
  } else if (item.kind === "table") {
18750
20739
  writeOut("\n");
@@ -18760,13 +20749,46 @@ function renderDisplay(display) {
18760
20749
  }
18761
20750
  if (display.length) writeOut("\n");
18762
20751
  }
20752
+ async function promptConnectTerminal(connect) {
20753
+ writeOut(`
20754
+ ${CYAN}${BOLD}Connect ${connect.label}${RESET2}
20755
+ `);
20756
+ if (connect.connectUrl === null) {
20757
+ writeOut(
20758
+ ` ${DIM2}This secure link is no longer available \u2014 ask the assistant for a new one.${RESET2}
20759
+ `
20760
+ );
20761
+ } else {
20762
+ writeOut(" Open this URL in a browser to finish connecting:\n");
20763
+ writeOut(` ${connect.connectUrl}
20764
+ `);
20765
+ if (connect.expiresInMinutes > 0) {
20766
+ writeOut(` ${DIM2}The link expires in ${connect.expiresInMinutes} minutes.${RESET2}
20767
+ `);
20768
+ }
20769
+ }
20770
+ if (!process.stdin.isTTY) return "pending";
20771
+ const outcome = await selectChoice([
20772
+ {
20773
+ label: `I'll connect ${connect.label} now`,
20774
+ value: "connect",
20775
+ terminal: true,
20776
+ variant: "primary"
20777
+ },
20778
+ { label: "Don't connect", value: "decline", terminal: true }
20779
+ ]);
20780
+ if (outcome.kind === "abort") return "declined";
20781
+ if (outcome.kind === "escape") return "pending";
20782
+ return outcome.choice.value === "decline" ? "declined" : "pending";
20783
+ }
18763
20784
  var OpenUiTerminalAbortError = class extends Error {
18764
20785
  constructor() {
18765
20786
  super("UI choice cancelled");
18766
20787
  this.name = "OpenUiTerminalAbortError";
18767
20788
  }
18768
20789
  };
18769
- async function promptChoices(choices) {
20790
+ async function promptChoices(choices, multi) {
20791
+ if (multi) return promptMultiChoices(choices);
18770
20792
  for (; ; ) {
18771
20793
  const outcome = await selectChoice(choices);
18772
20794
  if (outcome.kind === "abort") {
@@ -18779,48 +20801,67 @@ async function promptChoices(choices) {
18779
20801
  if (!selected.terminal) {
18780
20802
  const body = selected.auxiliaryBody?.trim() || selected.description?.trim() || `Selected "${selected.label}".`;
18781
20803
  writeOut(`
18782
- ${BOLD}${selected.label}${RESET}
20804
+ ${BOLD}${selected.label}${RESET2}
18783
20805
  `);
18784
20806
  for (const line of body.split("\n")) {
18785
20807
  writeOut(` ${line}
18786
20808
  `);
18787
20809
  }
18788
20810
  writeOut(`
18789
- ${DIM}(Press Enter to return to choices)${RESET}
20811
+ ${DIM2}(Press Enter to return to choices)${RESET2}
18790
20812
  `);
18791
20813
  await promptLine("");
18792
20814
  continue;
18793
20815
  }
18794
- writeOut(`${GREEN}\u2713${RESET} ${selected.label}
20816
+ writeOut(`${GREEN}\u2713${RESET2} ${selected.label}
18795
20817
  `);
18796
- return selected.value;
20818
+ return { kind: "choice", value: selected.value };
18797
20819
  }
18798
20820
  }
20821
+ async function promptMultiChoices(choices) {
20822
+ const selectable = choices.filter((c) => c.terminal);
20823
+ if (selectable.length === 0) return promptFreeform("Your reply (or empty to cancel)");
20824
+ const outcome = await runPicker(selectable, true);
20825
+ if (outcome.kind === "abort") throw new OpenUiTerminalAbortError();
20826
+ if (outcome.kind === "escape") return promptFreeform("Your reply (or empty to cancel)");
20827
+ const picked = outcome.indices.map((i) => selectable[i]);
20828
+ writeOut(`${GREEN}\u2713${RESET2} ${picked.map((c) => c.label).join(", ")}
20829
+ `);
20830
+ return { kind: "choice", value: multiChoiceValue(picked.map((c) => c.value)) };
20831
+ }
18799
20832
  async function selectChoice(choices) {
18800
- if (choices.length === 0) return { kind: "escape" };
20833
+ const outcome = await runPicker(choices, false);
20834
+ if (outcome.kind !== "pick") return outcome;
20835
+ return { kind: "pick", choice: choices[outcome.indices[0]] };
20836
+ }
20837
+ function runPicker(choices, multi) {
20838
+ if (choices.length === 0) return Promise.resolve({ kind: "escape" });
18801
20839
  return new Promise((resolve) => {
18802
20840
  let index = 0;
18803
20841
  let linesDrawn = 0;
20842
+ const ticked = /* @__PURE__ */ new Set();
18804
20843
  const draw = () => {
18805
20844
  if (linesDrawn > 0) {
18806
20845
  process.stderr.write(`\x1B[${linesDrawn}A`);
18807
20846
  }
20847
+ const jump = `1-${Math.min(choices.length, 9)}`;
18808
20848
  const lines = [
18809
- `${DIM}\u2191/\u2193 move \xB7 Enter select \xB7 1-${Math.min(choices.length, 9)} jump \xB7 Esc type freely${RESET}`,
20849
+ multi ? `${DIM2}\u2191/\u2193 move \xB7 Space toggle \xB7 Enter confirm \xB7 ${jump} toggle \xB7 Esc type freely${RESET2}` : `${DIM2}\u2191/\u2193 move \xB7 Enter select \xB7 ${jump} jump \xB7 Esc type freely${RESET2}`,
18810
20850
  ""
18811
20851
  ];
18812
20852
  for (let i = 0; i < choices.length; i++) {
18813
20853
  const c = choices[i];
18814
20854
  const selected = i === index;
18815
20855
  const marker = selected ? ">" : " ";
20856
+ const box = multi ? ticked.has(i) ? "[x] " : "[ ] " : "";
18816
20857
  const num = String(i + 1).padStart(2);
18817
20858
  const descPlain = c.description ? ` \u2014 ${c.description}` : "";
18818
20859
  if (selected) {
18819
- lines.push(`${INVERSE} ${marker} ${num}. ${c.label}${descPlain}${RESET}`);
20860
+ lines.push(`${INVERSE} ${marker} ${num}. ${box}${c.label}${descPlain}${RESET2}`);
18820
20861
  } else {
18821
- const label = c.variant === "primary" ? `${BOLD}${c.label}${RESET}` : c.label;
18822
- const desc = c.description ? `${DIM}${descPlain}${RESET}` : "";
18823
- lines.push(` ${marker} ${num}. ${label}${desc}`);
20862
+ const label = c.variant === "primary" ? `${BOLD}${c.label}${RESET2}` : c.label;
20863
+ const desc = c.description ? `${DIM2}${descPlain}${RESET2}` : "";
20864
+ lines.push(` ${marker} ${num}. ${box}${label}${desc}`);
18824
20865
  }
18825
20866
  }
18826
20867
  lines.push("");
@@ -18848,6 +20889,12 @@ async function selectChoice(choices) {
18848
20889
  const onClose = () => {
18849
20890
  settle({ kind: "abort" });
18850
20891
  };
20892
+ const toggle = (i) => {
20893
+ if (ticked.has(i)) ticked.delete(i);
20894
+ else ticked.add(i);
20895
+ index = i;
20896
+ draw();
20897
+ };
18851
20898
  const onKey = (_str, key) => {
18852
20899
  if (!key) return;
18853
20900
  if (key.name === "up") {
@@ -18860,8 +20907,13 @@ async function selectChoice(choices) {
18860
20907
  draw();
18861
20908
  return;
18862
20909
  }
20910
+ if (multi && key.name === "space") {
20911
+ toggle(index);
20912
+ return;
20913
+ }
18863
20914
  if (key.name === "return") {
18864
- settle({ kind: "pick", choice: choices[index] });
20915
+ const picked = multi ? [...ticked].sort((a, b) => a - b) : [index];
20916
+ settle({ kind: "pick", indices: picked.length > 0 ? picked : [index] });
18865
20917
  return;
18866
20918
  }
18867
20919
  if (key.ctrl && key.name === "c") {
@@ -18875,7 +20927,8 @@ async function selectChoice(choices) {
18875
20927
  if (_str && /^[0-9]$/.test(_str)) {
18876
20928
  const n = _str === "0" ? 10 : Number(_str);
18877
20929
  if (n >= 1 && n <= choices.length) {
18878
- settle({ kind: "pick", choice: choices[n - 1] });
20930
+ if (multi) toggle(n - 1);
20931
+ else settle({ kind: "pick", indices: [n - 1] });
18879
20932
  }
18880
20933
  }
18881
20934
  };
@@ -18886,11 +20939,11 @@ async function selectChoice(choices) {
18886
20939
  async function promptForm(form, extraChoices) {
18887
20940
  if (form.title) {
18888
20941
  writeOut(`
18889
- ${BOLD}${form.title}${RESET}
20942
+ ${BOLD}${form.title}${RESET2}
18890
20943
  `);
18891
20944
  }
18892
20945
  if (form.description) {
18893
- writeOut(`${DIM}${form.description}${RESET}
20946
+ writeOut(`${DIM2}${form.description}${RESET2}
18894
20947
  `);
18895
20948
  }
18896
20949
  writeOut("\n");
@@ -18898,7 +20951,7 @@ ${BOLD}${form.title}${RESET}
18898
20951
  for (const field of form.fields) {
18899
20952
  const answer = await promptField(field);
18900
20953
  if (answer === null && field.required) {
18901
- writeOut(`${DIM}Required field \u2014 try again.${RESET}
20954
+ writeOut(`${DIM2}Required field \u2014 try again.${RESET2}
18902
20955
  `);
18903
20956
  const retry = await promptField(field);
18904
20957
  if (retry === null) {
@@ -18912,13 +20965,13 @@ ${BOLD}${form.title}${RESET}
18912
20965
  }
18913
20966
  const actions = buildFormActions(form.buttons, extraChoices);
18914
20967
  if (actions.length === 0) {
18915
- writeOut(`${GREEN}\u2713${RESET} Submitted
20968
+ writeOut(`${GREEN}\u2713${RESET2} Submitted
18916
20969
  `);
18917
- return JSON.stringify(values);
20970
+ return { kind: "form", values };
18918
20971
  }
18919
20972
  for (; ; ) {
18920
20973
  writeOut(`
18921
- ${DIM}Select an action:${RESET}
20974
+ ${DIM2}Select an action:${RESET2}
18922
20975
  `);
18923
20976
  const outcome = await selectChoice(
18924
20977
  actions.map((a) => ({
@@ -18933,42 +20986,42 @@ ${DIM}Select an action:${RESET}
18933
20986
  throw new OpenUiTerminalAbortError();
18934
20987
  }
18935
20988
  if (outcome.kind === "escape") {
18936
- writeOut(`${GREEN}\u2713${RESET} Submitted
20989
+ writeOut(`${GREEN}\u2713${RESET2} Submitted
18937
20990
  `);
18938
- return JSON.stringify(values);
20991
+ return { kind: "form", values };
18939
20992
  }
18940
20993
  const action = actions.find((a) => a.id === outcome.choice.value);
18941
20994
  if (!action || action.kind === "submit") {
18942
- writeOut(`${GREEN}\u2713${RESET} ${action?.label ?? "Submitted"}
20995
+ writeOut(`${GREEN}\u2713${RESET2} ${action?.label ?? "Submitted"}
18943
20996
  `);
18944
- return JSON.stringify(values);
20997
+ return { kind: "form", values };
18945
20998
  }
18946
20999
  if (action.kind === "choice") {
18947
- writeOut(`${GREEN}\u2713${RESET} ${action.label}
21000
+ writeOut(`${GREEN}\u2713${RESET2} ${action.label}
18948
21001
  `);
18949
- return action.choiceValue ?? action.label;
21002
+ return { kind: "choice", value: action.choiceValue ?? action.label };
18950
21003
  }
18951
21004
  if (action.kind === "cancel") {
18952
- return UI_CHOICE_DECLINE_MESSAGE;
21005
+ return { kind: "declined" };
18953
21006
  }
18954
21007
  if (action.kind === "open_url" && action.url) {
18955
- writeOut(`${DIM}Open URL: ${action.url}${RESET}
21008
+ writeOut(`${DIM2}Open URL: ${action.url}${RESET2}
18956
21009
  `);
18957
21010
  continue;
18958
21011
  }
18959
21012
  if (action.kind === "auxiliary") {
18960
21013
  const body = action.context?.replace(/^auxiliary:/i, "").trim() || action.label;
18961
21014
  writeOut(`
18962
- ${BOLD}${action.label}${RESET}
21015
+ ${BOLD}${action.label}${RESET2}
18963
21016
  `);
18964
21017
  for (const line of body.split("\n")) writeOut(` ${line}
18965
21018
  `);
18966
21019
  writeOut(`
18967
- ${DIM}(Returning to actions \u2014 pick Submit when ready)${RESET}
21020
+ ${DIM2}(Returning to actions \u2014 pick Submit when ready)${RESET2}
18968
21021
  `);
18969
21022
  continue;
18970
21023
  }
18971
- return JSON.stringify(values);
21024
+ return { kind: "form", values };
18972
21025
  }
18973
21026
  }
18974
21027
  function buildFormActions(buttons, extraChoices) {
@@ -19024,10 +21077,10 @@ function buildFormActions(buttons, extraChoices) {
19024
21077
  }
19025
21078
  async function promptField(field) {
19026
21079
  const req = field.required ? " *" : "";
19027
- const hint2 = field.hint ? ` ${DIM}(${field.hint})${RESET}` : "";
21080
+ const hint2 = field.hint ? ` ${DIM2}(${field.hint})${RESET2}` : "";
19028
21081
  if (field.kind === "select" && field.options && field.options.length > 0) {
19029
21082
  writeOut(`
19030
- ${BOLD}${field.label}${req}${RESET}${hint2}
21083
+ ${BOLD}${field.label}${req}${RESET2}${hint2}
19031
21084
  `);
19032
21085
  const outcome = await selectChoice(
19033
21086
  field.options.map((o) => ({
@@ -19045,7 +21098,7 @@ ${BOLD}${field.label}${req}${RESET}${hint2}
19045
21098
  }
19046
21099
  return outcome.choice.value;
19047
21100
  }
19048
- const placeholder = field.placeholder ? ` ${DIM}[${field.placeholder}]${RESET}` : "";
21101
+ const placeholder = field.placeholder ? ` ${DIM2}[${field.placeholder}]${RESET2}` : "";
19049
21102
  const answer = await promptLine(`${field.label}${req}${placeholder}: `);
19050
21103
  if (!answer.trim()) {
19051
21104
  if (field.required) return null;
@@ -19063,9 +21116,9 @@ function promptLine(question) {
19063
21116
  });
19064
21117
  }
19065
21118
  async function promptFreeform(label) {
19066
- if (!process.stdin.isTTY) return "";
19067
- const answer = await promptLine(`${label}: `);
19068
- return answer.trim();
21119
+ if (!process.stdin.isTTY) return { kind: "skipped" };
21120
+ const answer = (await promptLine(`${label}: `)).trim();
21121
+ return answer ? { kind: "text", text: answer } : { kind: "skipped" };
19069
21122
  }
19070
21123
 
19071
21124
  // src/lib/trusted-dirs.ts
@@ -19165,12 +21218,7 @@ Re-run with --trust-cwd (or --trust-dir <path>) after reviewing files in that di
19165
21218
  }
19166
21219
 
19167
21220
  // src/lib/cli-hitl.ts
19168
- var UI_CHOICE_INTERRUPT_TYPES = /* @__PURE__ */ new Set([
19169
- "render_ui",
19170
- "present_choice_list",
19171
- /** @deprecated Pre-rename interrupt type */
19172
- "present_choice"
19173
- ]);
21221
+ var UI_CHOICE_INTERRUPT_TYPES = /* @__PURE__ */ new Set(["render_ui"]);
19174
21222
  function extractHumanInputRequest(event) {
19175
21223
  const type = String(event.type ?? "").toUpperCase();
19176
21224
  if (type === "CUSTOM" && event.name === "human_input_request") {
@@ -19253,27 +21301,155 @@ async function handleUIChoiceTerminal(payload) {
19253
21301
  }
19254
21302
  }
19255
21303
 
21304
+ // src/lib/ui-prompt-presented.ts
21305
+ function optionalString3(record, key) {
21306
+ const value = record[key];
21307
+ return typeof value === "string" && value.length > 0 ? value : void 0;
21308
+ }
21309
+ var CONNECT_TOOL_NAME = /^connect_[a-z0-9_]+_account$/;
21310
+ function isUiPromptToolName(name) {
21311
+ if (typeof name !== "string" || !name) return false;
21312
+ return name === "render_ui" || name === "present_choice_list" || CONNECT_TOOL_NAME.test(name);
21313
+ }
21314
+ function parseConnect(value) {
21315
+ if (!value || typeof value !== "object") return void 0;
21316
+ const record = value;
21317
+ const appSlug = optionalString3(record, "appSlug");
21318
+ if (!appSlug) return void 0;
21319
+ return {
21320
+ appSlug,
21321
+ connectionUuid: optionalString3(record, "connectionUuid") ?? "",
21322
+ label: optionalString3(record, "label") ?? appSlug,
21323
+ expiresInMinutes: typeof record.expiresInMinutes === "number" ? record.expiresInMinutes : 0
21324
+ };
21325
+ }
21326
+ function parseUiPromptPresented(content) {
21327
+ let value = content;
21328
+ if (typeof value === "string") {
21329
+ const trimmed = value.trim();
21330
+ if (!trimmed.startsWith("{") || !trimmed.includes('"presented"')) return null;
21331
+ try {
21332
+ value = JSON.parse(trimmed);
21333
+ } catch {
21334
+ return null;
21335
+ }
21336
+ }
21337
+ if (!value || typeof value !== "object") return null;
21338
+ const record = value;
21339
+ if (record.status !== "presented") return null;
21340
+ const promptId = optionalString3(record, "promptId");
21341
+ const kind = record.kind;
21342
+ if (!promptId || !isUiPromptKind(kind)) return null;
21343
+ const connect = parseConnect(record.connect);
21344
+ if (kind === "inline_connect" && !connect) return null;
21345
+ return {
21346
+ status: "presented",
21347
+ promptId,
21348
+ kind,
21349
+ userPrompt: optionalString3(record, "userPrompt"),
21350
+ openuiMarkup: optionalString3(record, "openuiMarkup"),
21351
+ description: optionalString3(record, "description"),
21352
+ multi: record.multi === true,
21353
+ // LLM-facing guidance. The CLI never renders it, but it is part of the
21354
+ // result, so it travels rather than being dropped on the floor.
21355
+ instructions: typeof record.instructions === "string" ? record.instructions : "",
21356
+ ...connect ? { connect } : {}
21357
+ };
21358
+ }
21359
+ function extractUiPromptPresented(event, toolCallNames) {
21360
+ if (String(event.type ?? "").toUpperCase() !== "TOOL_CALL_RESULT") return null;
21361
+ const toolCallId = String(event.toolCallId ?? event.tool_call_id ?? "");
21362
+ const toolName = event.toolName ?? event.tool_name ?? event.toolCallName ?? toolCallNames?.get(toolCallId);
21363
+ if (!isUiPromptToolName(toolName)) return null;
21364
+ return parseUiPromptPresented(event.content ?? event.result);
21365
+ }
21366
+
21367
+ // src/lib/ui-prompt-terminal.ts
21368
+ function responseAnswer(prompt, body) {
21369
+ return {
21370
+ content: formatUiPromptResponse({ promptId: prompt.promptId, kind: prompt.kind, body }),
21371
+ summary: summarizeUiPromptResponse({ promptId: prompt.promptId, kind: prompt.kind, body })
21372
+ };
21373
+ }
21374
+ async function promptUiPromptTerminal(prompt, opts = {}) {
21375
+ if (prompt.kind === "inline_connect") {
21376
+ if (!prompt.connect) return null;
21377
+ const link = opts.fetchConnectLink ? await opts.fetchConnectLink(prompt.connect.appSlug) : null;
21378
+ const outcome = await promptConnectTerminal({
21379
+ label: prompt.connect.label,
21380
+ connectUrl: link?.connectUrl ?? null,
21381
+ expiresInMinutes: prompt.connect.expiresInMinutes
21382
+ });
21383
+ if (outcome === "declined") {
21384
+ return responseAnswer(prompt, { status: "declined" });
21385
+ }
21386
+ return null;
21387
+ }
21388
+ let result2;
21389
+ try {
21390
+ result2 = await promptOpenUiTerminalResult(
21391
+ // The wire model spells "absent" as null; the renderer's optionals
21392
+ // mean undefined. Normalized at the boundary rather than widened on
21393
+ // the renderer, which has no business knowing the wire has two of them.
21394
+ {
21395
+ userPrompt: prompt.userPrompt ?? void 0,
21396
+ openuiMarkup: prompt.openuiMarkup ?? void 0
21397
+ },
21398
+ { multi: prompt.multi }
21399
+ );
21400
+ } catch (err) {
21401
+ if (err instanceof OpenUiTerminalAbortError) {
21402
+ return responseAnswer(prompt, { status: "declined" });
21403
+ }
21404
+ throw err;
21405
+ }
21406
+ switch (result2.kind) {
21407
+ case "choice":
21408
+ return responseAnswer(prompt, { status: "submitted", chosenValue: result2.value });
21409
+ case "form":
21410
+ return responseAnswer(prompt, { status: "submitted", values: result2.values });
21411
+ case "declined":
21412
+ return responseAnswer(prompt, { status: "declined" });
21413
+ case "text":
21414
+ return { content: result2.text, summary: result2.text };
21415
+ case "skipped":
21416
+ return null;
21417
+ }
21418
+ }
21419
+
19256
21420
  // src/lib/concierge-agui-loop.ts
19257
- var MAX_HITL_ROUNDS = 25;
21421
+ var MAX_TURN_ROUNDS = 25;
19258
21422
  async function runConciergeAguiLoop(client, initialMessages, onEvent, opts) {
19259
21423
  let streamText = "";
19260
21424
  let hasToolCalls = false;
19261
21425
  let errorMessage;
19262
21426
  let resume;
19263
- for (let round = 0; round < MAX_HITL_ROUNDS; round++) {
21427
+ let followUpMessages;
21428
+ const answeredPromptIds = /* @__PURE__ */ new Set();
21429
+ const pendingPrompts = /* @__PURE__ */ new Map();
21430
+ const toolCallNames = /* @__PURE__ */ new Map();
21431
+ for (let round = 0; round < MAX_TURN_ROUNDS; round++) {
19264
21432
  let hitlPayload = null;
19265
21433
  await client.streamRequest(
19266
21434
  resume ? {
19267
21435
  messages: [],
19268
21436
  resumeValue: resume.resumeValue,
19269
21437
  resumeInterruptId: resume.resumeInterruptId
19270
- } : { messages: initialMessages },
21438
+ } : { messages: followUpMessages ?? initialMessages },
19271
21439
  (event) => {
19272
21440
  onEvent(event);
19273
21441
  const delta = getTextDelta(event);
19274
21442
  if (delta) streamText += delta;
19275
21443
  const type = event.type?.toLowerCase() ?? "";
19276
- if (type === "tool_call_start") hasToolCalls = true;
21444
+ if (type === "tool_call_start") {
21445
+ hasToolCalls = true;
21446
+ const record = event;
21447
+ const callId = record.toolCallId ?? record.tool_call_id;
21448
+ const name = record.toolCallName ?? record.tool_call_name ?? record.toolName;
21449
+ if (typeof callId === "string" && typeof name === "string") {
21450
+ toolCallNames.set(callId, name);
21451
+ }
21452
+ }
19277
21453
  const errorMsg = getErrorMessage(event);
19278
21454
  if (errorMsg) {
19279
21455
  errorMessage = errorMsg;
@@ -19282,13 +21458,34 @@ async function runConciergeAguiLoop(client, initialMessages, onEvent, opts) {
19282
21458
  }
19283
21459
  const hitl = extractHumanInputRequest(event);
19284
21460
  if (hitl) hitlPayload = hitl;
21461
+ const prompt = extractUiPromptPresented(
21462
+ event,
21463
+ toolCallNames
21464
+ );
21465
+ if (prompt && !answeredPromptIds.has(prompt.promptId)) {
21466
+ pendingPrompts.set(prompt.promptId, prompt);
21467
+ }
19285
21468
  },
19286
21469
  { autoApprove: opts.autoApprove }
19287
21470
  );
19288
21471
  if (!hitlPayload) {
19289
- break;
21472
+ if (pendingPrompts.size === 0) break;
21473
+ const prompts = [...pendingPrompts.values()];
21474
+ pendingPrompts.clear();
21475
+ const answers = await answerPresentedPrompts(prompts, answeredPromptIds, {
21476
+ ...opts,
21477
+ // The prompt names the account but carries no link; the client
21478
+ // fetches the operator's own from the self-access endpoint.
21479
+ fetchConnectLink: (appSlug) => client.fetchInlineConnectLink(appSlug)
21480
+ });
21481
+ if (answers.length === 0) break;
21482
+ followUpMessages = answers;
21483
+ resume = void 0;
21484
+ streamText = "";
21485
+ errorMessage = void 0;
21486
+ continue;
19290
21487
  }
19291
- opts.onHitlPromptStart?.();
21488
+ opts.onTerminalPromptStart?.();
19292
21489
  let next;
19293
21490
  try {
19294
21491
  next = await handleCliHitlInterrupt(hitlPayload, {
@@ -19299,7 +21496,7 @@ async function runConciergeAguiLoop(client, initialMessages, onEvent, opts) {
19299
21496
  nonInteractive: opts.nonInteractive
19300
21497
  });
19301
21498
  } finally {
19302
- opts.onHitlPromptEnd?.();
21499
+ opts.onTerminalPromptEnd?.();
19303
21500
  }
19304
21501
  if (!next) {
19305
21502
  process.stderr.write(
@@ -19313,11 +21510,30 @@ async function runConciergeAguiLoop(client, initialMessages, onEvent, opts) {
19313
21510
  };
19314
21511
  }
19315
21512
  resume = next;
21513
+ followUpMessages = void 0;
19316
21514
  streamText = "";
19317
21515
  errorMessage = void 0;
19318
21516
  }
19319
21517
  return { streamText, hasToolCalls, errorMessage };
19320
21518
  }
21519
+ async function answerPresentedPrompts(prompts, answeredPromptIds, opts) {
21520
+ const answers = [];
21521
+ opts.onTerminalPromptStart?.();
21522
+ try {
21523
+ for (const prompt of prompts) {
21524
+ answeredPromptIds.add(prompt.promptId);
21525
+ const answer = await promptUiPromptTerminal(prompt, {
21526
+ fetchConnectLink: opts.fetchConnectLink
21527
+ });
21528
+ if (!answer) continue;
21529
+ answers.push({ role: "user", content: answer.content });
21530
+ opts.onPromptAnswered?.(answer.summary);
21531
+ }
21532
+ } finally {
21533
+ opts.onTerminalPromptEnd?.();
21534
+ }
21535
+ return answers;
21536
+ }
19321
21537
  function normalizeUnsupportedHitl(raw) {
19322
21538
  const payload = raw && typeof raw === "object" ? raw : {};
19323
21539
  return {
@@ -19629,7 +21845,7 @@ var SHOW_CURSOR = `${CSI}?25h`;
19629
21845
  var ALT_SCREEN_ON = `${CSI}?1049h`;
19630
21846
  var ALT_SCREEN_OFF = `${CSI}?1049l`;
19631
21847
  var CLEAR_EOL = `${CSI}K`;
19632
- var RESET2 = `${CSI}0m`;
21848
+ var RESET3 = `${CSI}0m`;
19633
21849
  var MOUSE_ON = `${CSI}?1000h${CSI}?1006h`;
19634
21850
  var MOUSE_OFF = `${CSI}?1000l${CSI}?1006l`;
19635
21851
  var BRACKETED_PASTE_ON = `${CSI}?2004h`;
@@ -19640,7 +21856,7 @@ var GRAY = `${CSI}90m`;
19640
21856
  var YELLOW = `${CSI}33m`;
19641
21857
  var ORANGE = `${CSI}38;5;208m`;
19642
21858
  var LIGHT_BLUE = `${CSI}38;5;117m`;
19643
- var DIM2 = `${CSI}2m`;
21859
+ var DIM3 = `${CSI}2m`;
19644
21860
  var DIM_ITALIC_GRAY = `${CSI}2;3;90m`;
19645
21861
  var RED = `${CSI}31m`;
19646
21862
  var CYAN2 = `${CSI}36m`;
@@ -20217,7 +22433,7 @@ var ChatTUI = class {
20217
22433
  CLEAR_EOL,
20218
22434
  // clear to end handles rest, but we need to position divider
20219
22435
  moveTo(msgTop + i, divCol),
20220
- `${DIM2}\u2502${RESET2}`,
22436
+ `${DIM3}\u2502${RESET3}`,
20221
22437
  debugLine
20222
22438
  );
20223
22439
  buf.push(CLEAR_EOL);
@@ -20231,7 +22447,7 @@ var ChatTUI = class {
20231
22447
  for (let i = 0; i < inputRows; i++) {
20232
22448
  const row = startRow + i;
20233
22449
  const line = inputLines[i] ?? "";
20234
- const prefix = i === 0 ? `${BLUE}${INPUT_LABEL}${RESET2} ` : " ".repeat(INPUT_LABEL_WIDTH);
22450
+ const prefix = i === 0 ? `${BLUE}${INPUT_LABEL}${RESET3} ` : " ".repeat(INPUT_LABEL_WIDTH);
20235
22451
  buf.push(moveTo(row, 1), prefix, line, CLEAR_EOL);
20236
22452
  }
20237
22453
  }
@@ -20254,27 +22470,27 @@ var ChatTUI = class {
20254
22470
  buildTitleBar() {
20255
22471
  const parts = [];
20256
22472
  if (this.options.title) {
20257
- parts.push(`${CYAN2}${this.options.title}${RESET2}`);
22473
+ parts.push(`${CYAN2}${this.options.title}${RESET3}`);
20258
22474
  }
20259
22475
  if (this.options.subtitle) {
20260
- parts.push(`${DIM2}${this.options.subtitle}${RESET2}`);
22476
+ parts.push(`${DIM3}${this.options.subtitle}${RESET3}`);
20261
22477
  }
20262
22478
  let status = "";
20263
22479
  switch (this.runState) {
20264
22480
  case "thinking":
20265
- status = `${YELLOW}Thinking\u2026${RESET2}`;
22481
+ status = `${YELLOW}Thinking\u2026${RESET3}`;
20266
22482
  break;
20267
22483
  case "tool_running":
20268
- status = `${YELLOW}Running ${this.activeToolName}\u2026${RESET2}`;
22484
+ status = `${YELLOW}Running ${this.activeToolName}\u2026${RESET3}`;
20269
22485
  break;
20270
22486
  case "streaming":
20271
- status = `${GREEN2}Writing\u2026${RESET2}`;
22487
+ status = `${GREEN2}Writing\u2026${RESET3}`;
20272
22488
  break;
20273
22489
  default:
20274
22490
  break;
20275
22491
  }
20276
22492
  if (status) parts.push(status);
20277
- const line = parts.join(` ${DIM2}|${RESET2} `);
22493
+ const line = parts.join(` ${DIM3}|${RESET3} `);
20278
22494
  return truncateAnsi(line, this.cols);
20279
22495
  }
20280
22496
  // ─── Separator ────────────────────────────────────────────────────
@@ -20293,13 +22509,13 @@ var ChatTUI = class {
20293
22509
  hints.push("Enter send");
20294
22510
  const lineWidth = Math.min(this.cols, 60);
20295
22511
  if (!hints.length) {
20296
- return `${GRAY}${"\u2500".repeat(lineWidth)}${RESET2}`;
22512
+ return `${GRAY}${"\u2500".repeat(lineWidth)}${RESET3}`;
20297
22513
  }
20298
22514
  const hintStr = ` ${hints.join(" ")} `;
20299
22515
  const dashes = Math.max(0, lineWidth - hintStr.length);
20300
22516
  const left = Math.max(2, Math.floor(dashes / 2));
20301
22517
  const right = Math.max(2, dashes - left);
20302
- return `${GRAY}${"\u2500".repeat(left)}${hintStr}${"\u2500".repeat(right)}${RESET2}`;
22518
+ return `${GRAY}${"\u2500".repeat(left)}${hintStr}${"\u2500".repeat(right)}${RESET3}`;
20303
22519
  }
20304
22520
  // ─── Chat display line building ───────────────────────────────────
20305
22521
  buildDisplayLines() {
@@ -20323,7 +22539,7 @@ var ChatTUI = class {
20323
22539
  appendToolCallLines(lines, tc, width) {
20324
22540
  const status = tc.done ? "\u2713" : "\u2026";
20325
22541
  const verb = tc.done ? "Called" : "Calling";
20326
- const summary = ` ${tc.done ? GREEN2 : YELLOW}${status}${RESET2} ${GRAY}${verb} ${tc.name}${RESET2}`;
22542
+ const summary = ` ${tc.done ? GREEN2 : YELLOW}${status}${RESET3} ${GRAY}${verb} ${tc.name}${RESET3}`;
20327
22543
  if (!this.expandDetails) {
20328
22544
  lines.push(summary);
20329
22545
  return;
@@ -20338,21 +22554,21 @@ var ChatTUI = class {
20338
22554
  const indent = " ";
20339
22555
  for (const argLine of formatted.split("\n")) {
20340
22556
  for (const wl of this.wrapText(argLine, width - indent.length)) {
20341
- lines.push(`${indent}${GRAY}${wl}${RESET2}`);
22557
+ lines.push(`${indent}${GRAY}${wl}${RESET3}`);
20342
22558
  }
20343
22559
  }
20344
22560
  }
20345
22561
  }
20346
22562
  appendToolResultLines(lines, tr, width) {
20347
- const mark = tr.failed ? `${RED}\u2717${RESET2}` : `${GREEN2}\u2713${RESET2}`;
22563
+ const mark = tr.failed ? `${RED}\u2717${RESET3}` : `${GREEN2}\u2713${RESET3}`;
20348
22564
  if (!this.expandDetails) {
20349
22565
  const maxLen = width - 12;
20350
22566
  const preview = tr.content.replace(/\n/g, " ").slice(0, maxLen);
20351
22567
  const truncated = preview.length < tr.content.length ? "..." : "";
20352
- lines.push(` ${mark} ${GRAY}${tr.toolName}: ${preview}${truncated}${RESET2}`);
22568
+ lines.push(` ${mark} ${GRAY}${tr.toolName}: ${preview}${truncated}${RESET3}`);
20353
22569
  return;
20354
22570
  }
20355
- lines.push(` ${mark} ${GRAY}${tr.toolName} result:${RESET2}`);
22571
+ lines.push(` ${mark} ${GRAY}${tr.toolName} result:${RESET3}`);
20356
22572
  let formatted = tr.content;
20357
22573
  try {
20358
22574
  formatted = JSON.stringify(JSON.parse(tr.content), null, 2);
@@ -20361,7 +22577,7 @@ var ChatTUI = class {
20361
22577
  const indent = " ";
20362
22578
  for (const resultLine of formatted.split("\n")) {
20363
22579
  for (const wl of this.wrapText(resultLine, width - indent.length)) {
20364
- lines.push(`${indent}${GRAY}${wl}${RESET2}`);
22580
+ lines.push(`${indent}${GRAY}${wl}${RESET3}`);
20365
22581
  }
20366
22582
  }
20367
22583
  }
@@ -20369,13 +22585,13 @@ var ChatTUI = class {
20369
22585
  if (msg.role === "system") {
20370
22586
  for (const para of msg.content.split("\n")) {
20371
22587
  for (const wl of this.wrapText(para, width - 2)) {
20372
- lines.push(` ${GRAY}${wl}${RESET2}`);
22588
+ lines.push(` ${GRAY}${wl}${RESET3}`);
20373
22589
  }
20374
22590
  }
20375
22591
  return;
20376
22592
  }
20377
22593
  const isUser = msg.role === "user";
20378
- const label = isUser ? `${BLUE}You:${RESET2} ` : `${GREEN2}Assistant:${RESET2} `;
22594
+ const label = isUser ? `${BLUE}You:${RESET3} ` : `${GREEN2}Assistant:${RESET3} `;
20379
22595
  const labelWidth = isUser ? 5 : 12;
20380
22596
  const indent = " ".repeat(labelWidth);
20381
22597
  let first = true;
@@ -20388,25 +22604,25 @@ var ChatTUI = class {
20388
22604
  }
20389
22605
  if (msg.truncationReason) {
20390
22606
  const reasonLabel = getTruncationLabel(msg.truncationReason, msg.truncatedAtMs);
20391
- lines.push(`${indent}${YELLOW}[${reasonLabel}]${RESET2}`);
22607
+ lines.push(`${indent}${YELLOW}[${reasonLabel}]${RESET3}`);
20392
22608
  const extra = getExtraContent(msg.content, msg.originalContent);
20393
22609
  if (extra) {
20394
22610
  for (const para of extra.split("\n")) {
20395
22611
  for (const wl of this.wrapText(para, width - labelWidth)) {
20396
- lines.push(`${indent}${DIM_ITALIC_GRAY}${wl}${RESET2}`);
22612
+ lines.push(`${indent}${DIM_ITALIC_GRAY}${wl}${RESET3}`);
20397
22613
  }
20398
22614
  }
20399
22615
  }
20400
22616
  }
20401
22617
  }
20402
22618
  appendStreamLines(lines, width) {
20403
- const label = `${GREEN2}Assistant:${RESET2} `;
22619
+ const label = `${GREEN2}Assistant:${RESET3} `;
20404
22620
  const labelWidth = 12;
20405
22621
  const indent = " ".repeat(labelWidth);
20406
22622
  if (!this.streamContent) {
20407
22623
  if (this.runState === "thinking" || this.runState === "tool_running") {
20408
22624
  const hint2 = this.runState === "tool_running" && this.activeToolName ? `Running ${this.activeToolName}\u2026` : "Thinking\u2026";
20409
- lines.push(`${label}${YELLOW}${hint2}${RESET2}`);
22625
+ lines.push(`${label}${YELLOW}${hint2}${RESET3}`);
20410
22626
  } else {
20411
22627
  lines.push(label);
20412
22628
  }
@@ -20428,18 +22644,18 @@ var ChatTUI = class {
20428
22644
  for (const entry of this.debugEntries) {
20429
22645
  const color = entry.direction === "in" ? ORANGE : LIGHT_BLUE;
20430
22646
  const arrow = entry.direction === "in" ? "\u25BC" : "\u25B2";
20431
- const prefix = `${DIM2}${entry.ts}${RESET2} ${color}${arrow}${RESET2} `;
22647
+ const prefix = `${DIM3}${entry.ts}${RESET3} ${color}${arrow}${RESET3} `;
20432
22648
  const prefixWidth = entry.ts.length + 3;
20433
22649
  if (!this.expandDetails) {
20434
22650
  const maxSummary = dw - prefixWidth;
20435
22651
  const summaryText = entry.summary.slice(0, maxSummary);
20436
- lines.push(`${prefix}${color}${summaryText}${RESET2}`);
22652
+ lines.push(`${prefix}${color}${summaryText}${RESET3}`);
20437
22653
  } else {
20438
- lines.push(`${prefix}${color}${entry.summary}${RESET2}`);
22654
+ lines.push(`${prefix}${color}${entry.summary}${RESET3}`);
20439
22655
  const indent = " ".repeat(prefixWidth);
20440
22656
  for (const detailLine of entry.detail.split("\n")) {
20441
22657
  for (const wl of this.wrapText(detailLine, dw - prefixWidth)) {
20442
- lines.push(`${indent}${color}${DIM2}${wl}${RESET2}`);
22658
+ lines.push(`${indent}${color}${DIM3}${wl}${RESET3}`);
20443
22659
  }
20444
22660
  }
20445
22661
  lines.push("");
@@ -20489,7 +22705,7 @@ function truncateAnsi(s, maxCols) {
20489
22705
  i++;
20490
22706
  }
20491
22707
  }
20492
- return s.slice(0, i) + RESET2;
22708
+ return s.slice(0, i) + RESET3;
20493
22709
  }
20494
22710
  function redactAudio(msg) {
20495
22711
  if (!msg || typeof msg !== "object") return msg;
@@ -20565,6 +22781,14 @@ function handleAguiEvent(tui, event) {
20565
22781
  case "tool_call_result": {
20566
22782
  const toolCallId = event.toolCallId ?? "";
20567
22783
  const toolName = tui.findToolCallName(toolCallId);
22784
+ const prompt = extractUiPromptPresented(
22785
+ event,
22786
+ /* @__PURE__ */ new Map([[toolCallId, toolName]])
22787
+ );
22788
+ if (prompt) {
22789
+ tui.toolCallResult(toolCallId, toolName, "Waiting for your answer\u2026");
22790
+ break;
22791
+ }
20568
22792
  const content = typeof event.content === "string" ? event.content : typeof event.result === "string" ? event.result : JSON.stringify(event.result ?? event.content ?? "");
20569
22793
  tui.toolCallResult(toolCallId, toolName, content);
20570
22794
  break;
@@ -20601,7 +22825,7 @@ function createFeedRenderer(tui, isTurnInProgress) {
20601
22825
  const text = (userMessageBuffers.get(messageId) ?? "").trim();
20602
22826
  userMessageBuffers.delete(messageId);
20603
22827
  renderedMessageIds.add(messageId);
20604
- if (text) tui.addUserMessage(text);
22828
+ if (text) tui.addUserMessage(displayUserMessage(text));
20605
22829
  }
20606
22830
  return;
20607
22831
  }
@@ -21106,8 +23330,11 @@ async function interactiveChatSession(session, debug, autoApprove, allowWrite) {
21106
23330
  debug,
21107
23331
  trustCwd: session.trustCwd,
21108
23332
  trustDir: session.trustDir,
21109
- onHitlPromptStart: () => tui.pauseForPrompt(),
21110
- onHitlPromptEnd: () => tui.resumeAfterPrompt()
23333
+ onTerminalPromptStart: () => tui.pauseForPrompt(),
23334
+ onTerminalPromptEnd: () => tui.resumeAfterPrompt(),
23335
+ // A prompt answered inline is a message the operator sent; show
23336
+ // it in the transcript the way their typed messages appear.
23337
+ onPromptAnswered: (summary) => tui.addUserMessage(summary)
21111
23338
  }
21112
23339
  );
21113
23340
  if (streamText && !assistantContent) {
@@ -21178,7 +23405,10 @@ function buildHistory(messages, limit) {
21178
23405
  const text = typeof msg.content === "string" ? msg.content : "";
21179
23406
  if (msg.role === "user" || msg.role === "assistant") {
21180
23407
  if (text.trim()) {
21181
- history.push({ role: msg.role, content: text });
23408
+ history.push({
23409
+ role: msg.role,
23410
+ content: msg.role === "user" ? displayUserMessage(text) : text
23411
+ });
21182
23412
  }
21183
23413
  if (msg.role === "assistant" && msg.tool_calls) {
21184
23414
  for (const tc of msg.tool_calls) {
@@ -22262,7 +24492,7 @@ var topLevelCommands = [
22262
24492
  mutates: true,
22263
24493
  args: [{ name: "phone", description: "E.164 phone number (optional; prompts if omitted)" }],
22264
24494
  handler: async (hctx) => {
22265
- const { accountVerifyPhoneCommand } = await import("./account-verify-phone-QJDC57CB.js");
24495
+ const { accountVerifyPhoneCommand } = await import("./account-verify-phone-5DY6ETMV.js");
22266
24496
  await accountVerifyPhoneCommand(hctx);
22267
24497
  }
22268
24498
  },