@alcyone-labs/arg-parser 2.8.1 → 2.8.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -807,6 +807,7 @@ const Wl = w.object({
807
807
  "Allow passing the same flag multiple times, e.g., `-f val1 -f val2` results in an array."
808
808
  ),
809
809
  description: w.union([w.string(), w.array(w.string())]).optional().describe("Textual description for help messages."),
810
+ valueHint: w.string().optional().describe("Hint/example value shown in help and examples."),
810
811
  options: w.array(w.string().min(1)).min(1, "Flag must have at least one option (e.g., ['-f', '--flag'])").describe("Array of option strings, e.g., ['-f', '--flag']."),
811
812
  defaultValue: w.any().optional().describe("Default value if the flag is not provided."),
812
813
  type: w.union([
@@ -1708,13 +1709,13 @@ class Kl {
1708
1709
  Ke.detectContext(),
1709
1710
  { allowUndefined: !0 }
1710
1711
  // Allow undefined variables for flexibility
1711
- ), I = K.resolve(o, O);
1712
- te.existsSync(I) ? (console.log(J.gray(` • ${O}`)), P.push({
1713
- from: I,
1712
+ ), M = K.resolve(o, O);
1713
+ te.existsSync(M) ? (console.log(J.gray(` • ${O}`)), P.push({
1714
+ from: M,
1714
1715
  to: K.join(C, O)
1715
1716
  })) : console.warn(
1716
1717
  J.yellow(
1717
- ` ⚠ File not found: ${O} (resolved to ${I})`
1718
+ ` ⚠ File not found: ${O} (resolved to ${M})`
1718
1719
  )
1719
1720
  );
1720
1721
  } else {
@@ -1722,16 +1723,16 @@ class Kl {
1722
1723
  D.from,
1723
1724
  Ke.detectContext(),
1724
1725
  { allowUndefined: !0 }
1725
- ), I = Ke.substituteVariables(
1726
+ ), M = Ke.substituteVariables(
1726
1727
  D.to,
1727
1728
  Ke.detectContext(),
1728
1729
  { allowUndefined: !0 }
1729
1730
  ), R = K.resolve(o, O);
1730
1731
  te.existsSync(R) ? (console.log(
1731
- J.gray(` • ${O} → ${I}`)
1732
+ J.gray(` • ${O} → ${M}`)
1732
1733
  ), P.push({
1733
1734
  from: R,
1734
- to: K.join(C, I)
1735
+ to: K.join(C, M)
1735
1736
  })) : console.warn(
1736
1737
  J.yellow(
1737
1738
  ` ⚠ File not found: ${O} (resolved to ${R})`
@@ -3296,9 +3297,9 @@ ${e("Flags:")}
3296
3297
  try {
3297
3298
  const D = f.type._def;
3298
3299
  if (D.shape) {
3299
- const O = typeof D.shape == "function" ? D.shape() : D.shape, I = Object.keys(O);
3300
- I.length > 0 && (I.length <= 4 ? p.push(`Properties: ${I.join(", ")}`) : p.push(
3301
- `Properties: ${I.slice(0, 4).join(", ")}, ... (${I.length} total)`
3300
+ const O = typeof D.shape == "function" ? D.shape() : D.shape, M = Object.keys(O);
3301
+ M.length > 0 && (M.length <= 4 ? p.push(`Properties: ${M.join(", ")}`) : p.push(
3302
+ `Properties: ${M.slice(0, 4).join(", ")}, ... (${M.length} total)`
3302
3303
  ));
3303
3304
  }
3304
3305
  p.push("Expected: JSON string");
@@ -3306,7 +3307,29 @@ ${e("Flags:")}
3306
3307
  p.push("Expected: JSON string");
3307
3308
  }
3308
3309
  } else typeof f.type == "function" ? (x = f.type.name || "custom function", x === "Boolean" && (x = "boolean"), x === "String" && (x = "string"), x === "Number" && (x = "number"), x === "Array" && (x = "array"), x === "Object" && (x = "object")) : typeof f.type == "string" && (x = f.type);
3309
- y.push(`Type: ${x}`), p.length > 0 && y.push(...p), f.flagOnly && y.push("Flag only (no value expected)"), f.defaultValue !== void 0 && f.defaultValue !== null && y.push(`Default: ${JSON.stringify(f.defaultValue)}`), f.enum && f.enum.length > 0 && y.push(
3310
+ y.push(`Type: ${x}`);
3311
+ {
3312
+ let C = !1;
3313
+ try {
3314
+ typeof f.type == "function" && f.type.name === "Array" && (C = !0);
3315
+ const M = f.type;
3316
+ M && typeof M == "object" && M._def && M._def.typeName === "ZodArray" && (C = !0), f.allowMultiple && (C = !0);
3317
+ } catch {
3318
+ }
3319
+ const D = f.options.find((M) => M.startsWith("--")) ?? f.options[0], O = f.valueHint;
3320
+ if (!f.flagOnly)
3321
+ if (C) {
3322
+ y.push("Multiple values allowed (repeat flag)");
3323
+ const M = O ?? "value1", R = O ?? "value2";
3324
+ y.push(
3325
+ `Example: ${D} ${M} ${D} ${R}`
3326
+ );
3327
+ } else {
3328
+ const M = O ?? "value";
3329
+ y.push(`Example: ${D} ${M}`);
3330
+ }
3331
+ }
3332
+ p.length > 0 && y.push(...p), f.flagOnly && y.push("Flag only (no value expected)"), f.defaultValue !== void 0 && f.defaultValue !== null && y.push(`Default: ${JSON.stringify(f.defaultValue)}`), f.enum && f.enum.length > 0 && y.push(
3310
3333
  `Allowed values: ${f.enum.map((C) => `'${C}'`).join(", ")}`
3311
3334
  );
3312
3335
  const S = Math.max(
@@ -3602,19 +3625,19 @@ cn = function(e = this) {
3602
3625
  }
3603
3626
  E = (h = j(E, Re).get(D)) == null ? void 0 : h.parser, y = y.slice(1);
3604
3627
  const O = y.findIndex(
3605
- (M) => j(E, Re).has(M)
3606
- ), I = O === -1 ? y : y.slice(0, O), R = {
3628
+ (A) => j(E, Re).has(A)
3629
+ ), M = O === -1 ? y : y.slice(0, O), R = {
3607
3630
  level: D,
3608
- argsSlice: I
3631
+ argsSlice: M
3609
3632
  };
3610
3633
  p.push(R);
3611
3634
  try {
3612
- const { parsedArgs: M } = await ve(f = E, le, ot).call(f, I, {
3635
+ const { parsedArgs: A } = await ve(f = E, le, ot).call(f, M, {
3613
3636
  skipHelpHandling: !0
3614
3637
  });
3615
- R.parsed = M, x = { ...x, ...M };
3616
- } catch (M) {
3617
- R.error = M.message;
3638
+ R.parsed = A, x = { ...x, ...A };
3639
+ } catch (A) {
3640
+ R.error = A.message;
3618
3641
  }
3619
3642
  y = O === -1 ? [] : y.slice(O);
3620
3643
  }
@@ -4499,8 +4522,8 @@ function Cs(i, e) {
4499
4522
  const S = f, P = {}, C = S.some((R) => R.name === "help");
4500
4523
  for (const R of S) {
4501
4524
  if (R.name === "help") continue;
4502
- let M = xi(R);
4503
- C && R.mandatory && (M = M.optional()), P[R.name] = M;
4525
+ let A = xi(R);
4526
+ C && R.mandatory && (A = A.optional()), P[R.name] = A;
4504
4527
  }
4505
4528
  const D = w.object(P);
4506
4529
  let O;
@@ -4508,7 +4531,7 @@ function Cs(i, e) {
4508
4531
  const R = e.outputSchemaMap[x];
4509
4532
  O = typeof R == "object" && R !== null && !R._def ? w.object(R) : R;
4510
4533
  } else e != null && e.defaultOutputSchema ? O = e.defaultOutputSchema : e != null && e.autoGenerateOutputSchema && (typeof e.autoGenerateOutputSchema == "string" ? O = Dr(e.autoGenerateOutputSchema) : e.autoGenerateOutputSchema === !0 && (O = Dr("successWithData")));
4511
- const I = {
4534
+ const M = {
4512
4535
  name: x,
4513
4536
  description: d || `Executes the ${x} command.`,
4514
4537
  inputSchema: D,
@@ -4551,25 +4574,25 @@ function Cs(i, e) {
4551
4574
  }
4552
4575
  return { success: !0, message: ne };
4553
4576
  }
4554
- const M = [...o], k = f;
4577
+ const A = [...o], k = f;
4555
4578
  for (const ee of k) {
4556
4579
  const ae = ee.name;
4557
4580
  if (R.hasOwnProperty(ae)) {
4558
4581
  const ne = R[ae], ce = ee.type, me = ee.options, we = ee.flagOnly, Te = ee.allowMultiple;
4559
4582
  let N = typeof ce == "function" ? ce.name.toLowerCase().replace("constructor", "") : String(ce).toLowerCase();
4560
- if (M.push(me[0]), N === "boolean")
4561
- (ne === !0 && we === !1 || ne === !1 && we === !1) && M.push(String(ne));
4583
+ if (A.push(me[0]), N === "boolean")
4584
+ (ne === !0 && we === !1 || ne === !1 && we === !1) && A.push(String(ne));
4562
4585
  else if (N === "array")
4563
4586
  if (Array.isArray(ne))
4564
4587
  if (Te) {
4565
- const B = M.length;
4588
+ const B = A.length;
4566
4589
  ne.forEach((H) => {
4567
- M.push(me[0]), M.push(String(H));
4568
- }), ne.length > 0 && M[B - 1] === me[0] && M.splice(B - 1, 1);
4590
+ A.push(me[0]), A.push(String(H));
4591
+ }), ne.length > 0 && A[B - 1] === me[0] && A.splice(B - 1, 1);
4569
4592
  } else
4570
- M.push(ne.join(","));
4571
- else ne != null && M.push(String(ne));
4572
- else ne != null && M.push(String(ne));
4593
+ A.push(ne.join(","));
4594
+ else ne != null && A.push(String(ne));
4595
+ else ne != null && A.push(String(ne));
4573
4596
  }
4574
4597
  }
4575
4598
  try {
@@ -4658,9 +4681,9 @@ function Cs(i, e) {
4658
4681
  `[MCP Tool Debug] Using CLI-generated tool parsing for '${x}'`
4659
4682
  ), console.error(
4660
4683
  "[MCP Tool Debug] Parse argv:",
4661
- JSON.stringify(M, null, 2)
4684
+ JSON.stringify(A, null, 2)
4662
4685
  )), ce = await i.parse(
4663
- M
4686
+ A
4664
4687
  );
4665
4688
  if (ce.$error) {
4666
4689
  const B = ce.$error, H = {
@@ -4918,18 +4941,18 @@ function Cs(i, e) {
4918
4941
  },
4919
4942
  async executeForTesting(R) {
4920
4943
  try {
4921
- const M = await this.execute(R);
4922
- return rc(M);
4923
- } catch (M) {
4944
+ const A = await this.execute(R);
4945
+ return rc(A);
4946
+ } catch (A) {
4924
4947
  return {
4925
4948
  success: !1,
4926
- error: M.message || String(M),
4949
+ error: A.message || String(A),
4927
4950
  exitCode: 1
4928
4951
  };
4929
4952
  }
4930
4953
  }
4931
4954
  };
4932
- t.push(I);
4955
+ t.push(M);
4933
4956
  }
4934
4957
  const p = v;
4935
4958
  if (p && (e == null ? void 0 : e.includeSubCommands) !== !1)
@@ -5348,7 +5371,7 @@ Migration guide: https://github.com/alcyone-labs/arg-parser/blob/main/docs/MCP-M
5348
5371
  );
5349
5372
  try {
5350
5373
  const C = process.argv.slice(2).filter(
5351
- (I) => !I.startsWith("--s-mcp-") && I !== "--s-mcp-serve"
5374
+ (M) => !M.startsWith("--s-mcp-") && M !== "--s-mcp-serve"
5352
5375
  ), D = await this.parse(C, {
5353
5376
  skipHandlerExecution: !0,
5354
5377
  isMcp: !0
@@ -5399,7 +5422,7 @@ Migration guide: https://github.com/alcyone-labs/arg-parser/blob/main/docs/MCP-M
5399
5422
  o.mcpError(
5400
5423
  `After deduplication: ${E.length} unique tools`
5401
5424
  ), E.forEach((p) => {
5402
- var R, M, k, V, G, Z, re;
5425
+ var R, A, k, V, G, Z, re;
5403
5426
  o.mcpError(`Registering tool: ${p.name}`);
5404
5427
  let S;
5405
5428
  const P = Array.from(this._tools.values()).find(
@@ -5457,7 +5480,7 @@ Migration guide: https://github.com/alcyone-labs/arg-parser/blob/main/docs/MCP-M
5457
5480
  typeof O.inputSchema
5458
5481
  ), console.error(
5459
5482
  "[MCP Debug] toolConfig.inputSchema constructor:",
5460
- (k = (M = O.inputSchema) == null ? void 0 : M.constructor) == null ? void 0 : k.name
5483
+ (k = (A = O.inputSchema) == null ? void 0 : A.constructor) == null ? void 0 : k.name
5461
5484
  ), console.error(
5462
5485
  "[MCP Debug] toolConfig.inputSchema._def:",
5463
5486
  (V = O.inputSchema) == null ? void 0 : V._def
@@ -5490,7 +5513,7 @@ Migration guide: https://github.com/alcyone-labs/arg-parser/blob/main/docs/MCP-M
5490
5513
  `[MCP Debug] NOT including outputSchema for tool '${p.name}':`,
5491
5514
  `hasOutputSchema=${!!p.outputSchema}, supportsOutputSchemas=${this.supportsOutputSchemas()}`
5492
5515
  );
5493
- const I = async (Y) => {
5516
+ const M = async (Y) => {
5494
5517
  process.env.MCP_DEBUG && console.error(
5495
5518
  `[MCP Simple Execute] 🎯 TOOL CALLED: '${p.name}' with args:`,
5496
5519
  JSON.stringify(Y, null, 2)
@@ -5524,7 +5547,7 @@ Migration guide: https://github.com/alcyone-labs/arg-parser/blob/main/docs/MCP-M
5524
5547
  };
5525
5548
  }
5526
5549
  };
5527
- u.registerTool(p.name, O, I);
5550
+ u.registerTool(p.name, O, M);
5528
5551
  }), o.mcpError("Successfully registered all tools with MCP server");
5529
5552
  const y = this.getMcpResources();
5530
5553
  o.mcpError(`Registering ${y.length} MCP resources`), y.forEach((p) => {
@@ -5545,16 +5568,16 @@ Migration guide: https://github.com/alcyone-labs/arg-parser/blob/main/docs/MCP-M
5545
5568
  new URL(D.href || D),
5546
5569
  O
5547
5570
  )).contents.map((R) => {
5548
- const M = {
5571
+ const A = {
5549
5572
  uri: R.uri
5550
5573
  };
5551
- return R.text !== void 0 && (M.text = R.text), R.blob !== void 0 && (M.blob = R.blob), R.mimeType !== void 0 && (M.mimeType = R.mimeType), M;
5574
+ return R.text !== void 0 && (A.text = R.text), R.blob !== void 0 && (A.blob = R.blob), R.mimeType !== void 0 && (A.mimeType = R.mimeType), A;
5552
5575
  })
5553
5576
  };
5554
- } catch (I) {
5577
+ } catch (M) {
5555
5578
  throw o.mcpError(
5556
- `Resource template handler error for ${p.name}: ${I instanceof Error ? I.message : String(I)}`
5557
- ), I;
5579
+ `Resource template handler error for ${p.name}: ${M instanceof Error ? M.message : String(M)}`
5580
+ ), M;
5558
5581
  }
5559
5582
  };
5560
5583
  u.registerResource(
@@ -5571,10 +5594,10 @@ Migration guide: https://github.com/alcyone-labs/arg-parser/blob/main/docs/MCP-M
5571
5594
  new URL(C.href || C),
5572
5595
  {}
5573
5596
  )).contents.map((O) => {
5574
- const I = {
5597
+ const M = {
5575
5598
  uri: O.uri
5576
5599
  };
5577
- return O.text !== void 0 && (I.text = O.text), O.blob !== void 0 && (I.blob = O.blob), O.mimeType !== void 0 && (I.mimeType = O.mimeType), I;
5600
+ return O.text !== void 0 && (M.text = O.text), O.blob !== void 0 && (M.blob = O.blob), O.mimeType !== void 0 && (M.mimeType = O.mimeType), M;
5578
5601
  })
5579
5602
  };
5580
5603
  } catch (D) {
@@ -5626,10 +5649,10 @@ Migration guide: https://github.com/alcyone-labs/arg-parser/blob/main/docs/MCP-M
5626
5649
  // Use Zod v3 compatible schema for MCP SDK
5627
5650
  }, C = async (D) => {
5628
5651
  try {
5629
- const O = p.argsSchema.parse(D), I = await p.handler(O);
5652
+ const O = p.argsSchema.parse(D), M = await p.handler(O);
5630
5653
  return process.env.MCP_DEBUG && console.error(
5631
5654
  `[MCP Debug] Prompt '${p.name}' executed successfully`
5632
- ), I;
5655
+ ), M;
5633
5656
  } catch (O) {
5634
5657
  throw process.env.MCP_DEBUG && console.error(
5635
5658
  `[MCP Debug] Prompt '${p.name}' execution error:`,
@@ -6033,12 +6056,12 @@ _i = function(t) {
6033
6056
  }
6034
6057
  case "streamable-http": {
6035
6058
  const { StreamableHTTPServerTransport: v } = await Promise.resolve().then(() => sd), g = (await import("express")).default, E = g();
6036
- E.disable("x-powered-by"), E.use(g.json()), E.get("/favicon.ico", (I, R) => {
6037
- const M = `<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16">
6059
+ E.disable("x-powered-by"), E.use(g.json()), E.get("/favicon.ico", (M, R) => {
6060
+ const A = `<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16">
6038
6061
  <rect width="16" height="16" fill="white"/>
6039
6062
  <circle cx="8" cy="8" r="4" fill="red"/>
6040
6063
  </svg>`;
6041
- R.setHeader("Content-Type", "image/svg+xml"), R.setHeader("Cache-Control", "public, max-age=86400"), R.send(M);
6064
+ R.setHeader("Content-Type", "image/svg+xml"), R.setHeader("Cache-Control", "public, max-age=86400"), R.send(A);
6042
6065
  });
6043
6066
  try {
6044
6067
  (d = (c = (l = this._mcpServerConfig) == null ? void 0 : l.httpServer) == null ? void 0 : c.configureExpress) == null || d.call(c, E);
@@ -6046,21 +6069,21 @@ _i = function(t) {
6046
6069
  }
6047
6070
  const y = r.port || 3e3, x = r.path || "/mcp";
6048
6071
  if (r.cors) {
6049
- const I = r.cors, R = ((h = I.methods) == null ? void 0 : h.join(", ")) || "GET,POST,PUT,PATCH,DELETE,OPTIONS", M = (Z) => {
6072
+ const M = r.cors, R = ((h = M.methods) == null ? void 0 : h.join(", ")) || "GET,POST,PUT,PATCH,DELETE,OPTIONS", A = (Z) => {
6050
6073
  var re;
6051
- return ((re = I.headers) == null ? void 0 : re.join(", ")) || Z.headers["access-control-request-headers"] || "Content-Type, Authorization, MCP-Session-Id";
6052
- }, k = ((f = I.exposedHeaders) == null ? void 0 : f.join(", ")) || void 0, V = (Z) => {
6053
- const re = Z.headers.origin, Y = I.origins ?? "*";
6054
- if (Y === "*") return I.credentials ? re : "*";
6074
+ return ((re = M.headers) == null ? void 0 : re.join(", ")) || Z.headers["access-control-request-headers"] || "Content-Type, Authorization, MCP-Session-Id";
6075
+ }, k = ((f = M.exposedHeaders) == null ? void 0 : f.join(", ")) || void 0, V = (Z) => {
6076
+ const re = Z.headers.origin, Y = M.origins ?? "*";
6077
+ if (Y === "*") return M.credentials ? re : "*";
6055
6078
  if (!re) return;
6056
6079
  const oe = Array.isArray(Y) ? Y : [Y];
6057
6080
  for (const ee of oe)
6058
6081
  if (typeof ee == "string" && ee === re || ee instanceof RegExp && ee.test(re)) return re;
6059
6082
  }, G = (Z, re) => {
6060
6083
  const Y = V(Z);
6061
- Y && re.setHeader("Access-Control-Allow-Origin", Y), I.credentials && re.setHeader("Access-Control-Allow-Credentials", "true"), re.setHeader("Vary", "Origin"), re.setHeader("Access-Control-Allow-Methods", R);
6062
- const oe = M(Z);
6063
- oe && re.setHeader("Access-Control-Allow-Headers", oe), k && re.setHeader("Access-Control-Expose-Headers", k), typeof I.maxAge == "number" && re.setHeader("Access-Control-Max-Age", String(I.maxAge));
6084
+ Y && re.setHeader("Access-Control-Allow-Origin", Y), M.credentials && re.setHeader("Access-Control-Allow-Credentials", "true"), re.setHeader("Vary", "Origin"), re.setHeader("Access-Control-Allow-Methods", R);
6085
+ const oe = A(Z);
6086
+ oe && re.setHeader("Access-Control-Allow-Headers", oe), k && re.setHeader("Access-Control-Expose-Headers", k), typeof M.maxAge == "number" && re.setHeader("Access-Control-Max-Age", String(M.maxAge));
6064
6087
  };
6065
6088
  E.options(x, (Z, re) => {
6066
6089
  G(Z, re), re.status(204).end();
@@ -6069,17 +6092,17 @@ _i = function(t) {
6069
6092
  });
6070
6093
  }
6071
6094
  (u = r.auth) != null && u.customMiddleware && E.use(r.auth.customMiddleware);
6072
- const p = r.auth, S = (I) => {
6095
+ const p = r.auth, S = (M) => {
6073
6096
  if (!p) return !1;
6074
- const R = I.path, M = p.publicPaths || [], k = p.protectedPaths;
6075
- return M.includes(R) || k && !k.includes(R) ? !1 : p.required !== !1;
6076
- }, P = (I) => Buffer.from(I.replace(/-/g, "+").replace(/_/g, "/"), "base64"), C = async (I) => {
6097
+ const R = M.path, A = p.publicPaths || [], k = p.protectedPaths;
6098
+ return A.includes(R) || k && !k.includes(R) ? !1 : p.required !== !1;
6099
+ }, P = (M) => Buffer.from(M.replace(/-/g, "+").replace(/_/g, "/"), "base64"), C = async (M) => {
6077
6100
  if (!(p != null && p.jwt)) return !1;
6078
- const [R, M, k] = I.split(".");
6079
- if (!R || !M || !k) return !1;
6080
- const V = JSON.parse(P(R).toString("utf8")), G = JSON.parse(P(M).toString("utf8")), Z = V.alg;
6101
+ const [R, A, k] = M.split(".");
6102
+ if (!R || !A || !k) return !1;
6103
+ const V = JSON.parse(P(R).toString("utf8")), G = JSON.parse(P(A).toString("utf8")), Z = V.alg;
6081
6104
  if (p.jwt.algorithms && !p.jwt.algorithms.includes(Z)) return !1;
6082
- const re = Buffer.from(`${R}.${M}`), Y = P(k);
6105
+ const re = Buffer.from(`${R}.${A}`), Y = P(k);
6083
6106
  if (Z === "HS256") {
6084
6107
  const ae = p.jwt.secret;
6085
6108
  if (!ae || !(await import("node:crypto")).createHmac("sha256", ae).update(re).digest().equals(Y)) return !1;
@@ -6095,35 +6118,35 @@ _i = function(t) {
6095
6118
  return !1;
6096
6119
  const oe = Math.floor(Date.now() / 1e3), ee = p.jwt.clockToleranceSec || 0;
6097
6120
  return !(G.nbf && oe + ee < G.nbf || G.exp && oe - ee >= G.exp);
6098
- }, D = async (I) => {
6121
+ }, D = async (M) => {
6099
6122
  if (!p) return !0;
6100
- const R = I.headers.authorization, M = R != null && R.startsWith("Bearer ") ? R.slice(7) : void 0;
6101
- if (!M)
6102
- return p.validator ? !!await p.validator(I, M) : !1;
6123
+ const R = M.headers.authorization, A = R != null && R.startsWith("Bearer ") ? R.slice(7) : void 0;
6124
+ if (!A)
6125
+ return p.validator ? !!await p.validator(M, A) : !1;
6103
6126
  if (p.scheme === "jwt" || p.jwt) {
6104
- if (!await C(M)) return !1;
6105
- } else if ((p.scheme === "bearer" || !p.scheme) && p.allowedTokens && !p.allowedTokens.includes(M))
6106
- return p.validator ? !!await p.validator(I, M) : !1;
6107
- return !(p.validator && !await p.validator(I, M));
6127
+ if (!await C(A)) return !1;
6128
+ } else if ((p.scheme === "bearer" || !p.scheme) && p.allowedTokens && !p.allowedTokens.includes(A))
6129
+ return p.validator ? !!await p.validator(M, A) : !1;
6130
+ return !(p.validator && !await p.validator(M, A));
6108
6131
  }, O = {};
6109
- E.all(x, async (I, R) => {
6110
- if (S(I) && !await D(I)) {
6132
+ E.all(x, async (M, R) => {
6133
+ if (S(M) && !await D(M)) {
6111
6134
  R.status(401).json({ error: "Unauthorized" });
6112
6135
  return;
6113
6136
  }
6114
- const M = I.headers["mcp-session-id"];
6137
+ const A = M.headers["mcp-session-id"];
6115
6138
  let k;
6116
- M && O[M] ? k = O[M] : (k = new v({
6139
+ A && O[A] ? k = O[A] : (k = new v({
6117
6140
  sessionIdGenerator: r.sessionIdGenerator || (() => Math.random().toString(36).substring(7)),
6118
6141
  onsessioninitialized: (V) => {
6119
6142
  O[V] = k;
6120
6143
  }
6121
6144
  }), k.onclose = () => {
6122
6145
  k.sessionId && delete O[k.sessionId];
6123
- }, await t.connect(k)), await k.handleRequest(I, R, I.body);
6124
- }), await new Promise((I) => {
6146
+ }, await t.connect(k)), await k.handleRequest(M, R, M.body);
6147
+ }), await new Promise((M) => {
6125
6148
  E.listen(y, r.host || "localhost", () => {
6126
- I();
6149
+ M();
6127
6150
  });
6128
6151
  });
6129
6152
  break;
@@ -7827,7 +7850,7 @@ function lu() {
7827
7850
  a(e);
7828
7851
  })(iu, function(t) {
7829
7852
  function a() {
7830
- for (var A = arguments.length, T = Array(A), F = 0; F < A; F++)
7853
+ for (var I = arguments.length, T = Array(I), F = 0; F < I; F++)
7831
7854
  T[F] = arguments[F];
7832
7855
  if (T.length > 1) {
7833
7856
  T[0] = T[0].slice(0, -1);
@@ -7837,27 +7860,27 @@ function lu() {
7837
7860
  } else
7838
7861
  return T[0];
7839
7862
  }
7840
- function r(A) {
7841
- return "(?:" + A + ")";
7863
+ function r(I) {
7864
+ return "(?:" + I + ")";
7842
7865
  }
7843
- function n(A) {
7844
- return A === void 0 ? "undefined" : A === null ? "null" : Object.prototype.toString.call(A).split(" ").pop().split("]").shift().toLowerCase();
7866
+ function n(I) {
7867
+ return I === void 0 ? "undefined" : I === null ? "null" : Object.prototype.toString.call(I).split(" ").pop().split("]").shift().toLowerCase();
7845
7868
  }
7846
- function o(A) {
7847
- return A.toUpperCase();
7869
+ function o(I) {
7870
+ return I.toUpperCase();
7848
7871
  }
7849
- function s(A) {
7850
- return A != null ? A instanceof Array ? A : typeof A.length != "number" || A.split || A.setInterval || A.call ? [A] : Array.prototype.slice.call(A) : [];
7872
+ function s(I) {
7873
+ return I != null ? I instanceof Array ? I : typeof I.length != "number" || I.split || I.setInterval || I.call ? [I] : Array.prototype.slice.call(I) : [];
7851
7874
  }
7852
- function l(A, T) {
7853
- var F = A;
7875
+ function l(I, T) {
7876
+ var F = I;
7854
7877
  if (T)
7855
7878
  for (var U in T)
7856
7879
  F[U] = T[U];
7857
7880
  return F;
7858
7881
  }
7859
- function c(A) {
7860
- var T = "[A-Za-z]", F = "[0-9]", U = a(F, "[A-Fa-f]"), q = r(r("%[EFef]" + U + "%" + U + U + "%" + U + U) + "|" + r("%[89A-Fa-f]" + U + "%" + U + U) + "|" + r("%" + U + U)), de = "[\\:\\/\\?\\#\\[\\]\\@]", pe = "[\\!\\$\\&\\'\\(\\)\\*\\+\\,\\;\\=]", Se = a(de, pe), Me = A ? "[\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]" : "[]", Le = A ? "[\\uE000-\\uF8FF]" : "[]", Ee = a(T, F, "[\\-\\.\\_\\~]", Me);
7882
+ function c(I) {
7883
+ var T = "[A-Za-z]", F = "[0-9]", U = a(F, "[A-Fa-f]"), q = r(r("%[EFef]" + U + "%" + U + U + "%" + U + U) + "|" + r("%[89A-Fa-f]" + U + "%" + U + U) + "|" + r("%" + U + U)), de = "[\\:\\/\\?\\#\\[\\]\\@]", pe = "[\\!\\$\\&\\'\\(\\)\\*\\+\\,\\;\\=]", Se = a(de, pe), Me = I ? "[\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]" : "[]", Le = I ? "[\\uE000-\\uF8FF]" : "[]", Ee = a(T, F, "[\\-\\.\\_\\~]", Me);
7861
7884
  r(T + a(T, F, "[\\+\\-\\.]") + "*"), r(r(q + "|" + a(Ee, pe, "[\\:]")) + "*");
7862
7885
  var Oe = r(r("25[0-5]") + "|" + r("2[0-4]" + F) + "|" + r("1" + F + F) + "|" + r("0?[1-9]" + F) + "|0?0?" + F), Be = r(Oe + "\\." + Oe + "\\." + Oe + "\\." + Oe), ge = r(U + "{1,4}"), Ie = r(r(ge + "\\:" + ge) + "|" + Be), Ue = r(r(ge + "\\:") + "{6}" + Ie), Fe = r("\\:\\:" + r(ge + "\\:") + "{5}" + Ie), $r = r(r(ge) + "?\\:\\:" + r(ge + "\\:") + "{4}" + Ie), ur = r(r(r(ge + "\\:") + "{0,1}" + ge) + "?\\:\\:" + r(ge + "\\:") + "{3}" + Ie), fr = r(r(r(ge + "\\:") + "{0,2}" + ge) + "?\\:\\:" + r(ge + "\\:") + "{2}" + Ie), Hr = r(r(r(ge + "\\:") + "{0,3}" + ge) + "?\\:\\:" + ge + "\\:" + Ie), Ir = r(r(r(ge + "\\:") + "{0,4}" + ge) + "?\\:\\:" + Ie), er = r(r(r(ge + "\\:") + "{0,5}" + ge) + "?\\:\\:" + ge), dr = r(r(r(ge + "\\:") + "{0,6}" + ge) + "?\\:\\:"), Fr = r([Ue, Fe, $r, ur, fr, Hr, Ir, er, dr].join("|")), Er = r(r(Ee + "|" + q) + "+");
7863
7886
  r("[vV]" + U + "+\\." + a(Ee, pe, "[\\:]") + "+"), r(r(q + "|" + a(Ee, pe)) + "*");
@@ -7880,7 +7903,7 @@ function lu() {
7880
7903
  };
7881
7904
  }
7882
7905
  var d = c(!1), h = c(!0), f = /* @__PURE__ */ function() {
7883
- function A(T, F) {
7906
+ function I(T, F) {
7884
7907
  var U = [], q = !0, de = !1, pe = void 0;
7885
7908
  try {
7886
7909
  for (var Se = T[Symbol.iterator](), Me; !(q = (Me = Se.next()).done) && (U.push(Me.value), !(F && U.length === F)); q = !0)
@@ -7900,39 +7923,39 @@ function lu() {
7900
7923
  if (Array.isArray(T))
7901
7924
  return T;
7902
7925
  if (Symbol.iterator in Object(T))
7903
- return A(T, F);
7926
+ return I(T, F);
7904
7927
  throw new TypeError("Invalid attempt to destructure non-iterable instance");
7905
7928
  };
7906
- }(), u = function(A) {
7907
- if (Array.isArray(A)) {
7908
- for (var T = 0, F = Array(A.length); T < A.length; T++) F[T] = A[T];
7929
+ }(), u = function(I) {
7930
+ if (Array.isArray(I)) {
7931
+ for (var T = 0, F = Array(I.length); T < I.length; T++) F[T] = I[T];
7909
7932
  return F;
7910
7933
  } else
7911
- return Array.from(A);
7912
- }, v = 2147483647, g = 36, E = 1, y = 26, x = 38, p = 700, S = 72, P = 128, C = "-", D = /^xn--/, O = /[^\0-\x7E]/, I = /[\x2E\u3002\uFF0E\uFF61]/g, R = {
7934
+ return Array.from(I);
7935
+ }, v = 2147483647, g = 36, E = 1, y = 26, x = 38, p = 700, S = 72, P = 128, C = "-", D = /^xn--/, O = /[^\0-\x7E]/, M = /[\x2E\u3002\uFF0E\uFF61]/g, R = {
7913
7936
  overflow: "Overflow: input needs wider integers to process",
7914
7937
  "not-basic": "Illegal input >= 0x80 (not a basic code point)",
7915
7938
  "invalid-input": "Invalid input"
7916
- }, M = g - E, k = Math.floor, V = String.fromCharCode;
7917
- function G(A) {
7918
- throw new RangeError(R[A]);
7939
+ }, A = g - E, k = Math.floor, V = String.fromCharCode;
7940
+ function G(I) {
7941
+ throw new RangeError(R[I]);
7919
7942
  }
7920
- function Z(A, T) {
7921
- for (var F = [], U = A.length; U--; )
7922
- F[U] = T(A[U]);
7943
+ function Z(I, T) {
7944
+ for (var F = [], U = I.length; U--; )
7945
+ F[U] = T(I[U]);
7923
7946
  return F;
7924
7947
  }
7925
- function re(A, T) {
7926
- var F = A.split("@"), U = "";
7927
- F.length > 1 && (U = F[0] + "@", A = F[1]), A = A.replace(I, ".");
7928
- var q = A.split("."), de = Z(q, T).join(".");
7948
+ function re(I, T) {
7949
+ var F = I.split("@"), U = "";
7950
+ F.length > 1 && (U = F[0] + "@", I = F[1]), I = I.replace(M, ".");
7951
+ var q = I.split("."), de = Z(q, T).join(".");
7929
7952
  return U + de;
7930
7953
  }
7931
- function Y(A) {
7932
- for (var T = [], F = 0, U = A.length; F < U; ) {
7933
- var q = A.charCodeAt(F++);
7954
+ function Y(I) {
7955
+ for (var T = [], F = 0, U = I.length; F < U; ) {
7956
+ var q = I.charCodeAt(F++);
7934
7957
  if (q >= 55296 && q <= 56319 && F < U) {
7935
- var de = A.charCodeAt(F++);
7958
+ var de = I.charCodeAt(F++);
7936
7959
  (de & 64512) == 56320 ? T.push(((q & 1023) << 10) + (de & 1023) + 65536) : (T.push(q), F--);
7937
7960
  } else
7938
7961
  T.push(q);
@@ -7950,11 +7973,11 @@ function lu() {
7950
7973
  for (
7951
7974
  T = U ? k(T / p) : T >> 1, T += k(T / F);
7952
7975
  /* no initialization */
7953
- T > M * y >> 1;
7976
+ T > A * y >> 1;
7954
7977
  q += g
7955
7978
  )
7956
- T = k(T / M);
7957
- return k(q + (M + 1) * T / (T + x));
7979
+ T = k(T / A);
7980
+ return k(q + (A + 1) * T / (T + x));
7958
7981
  }, ce = function(T) {
7959
7982
  var F = [], U = T.length, q = 0, de = P, pe = S, Se = T.lastIndexOf(C);
7960
7983
  Se < 0 && (Se = 0);
@@ -8083,50 +8106,50 @@ function lu() {
8083
8106
  toASCII: Te,
8084
8107
  toUnicode: we
8085
8108
  }, B = {};
8086
- function H(A) {
8087
- var T = A.charCodeAt(0), F = void 0;
8109
+ function H(I) {
8110
+ var T = I.charCodeAt(0), F = void 0;
8088
8111
  return T < 16 ? F = "%0" + T.toString(16).toUpperCase() : T < 128 ? F = "%" + T.toString(16).toUpperCase() : T < 2048 ? F = "%" + (T >> 6 | 192).toString(16).toUpperCase() + "%" + (T & 63 | 128).toString(16).toUpperCase() : F = "%" + (T >> 12 | 224).toString(16).toUpperCase() + "%" + (T >> 6 & 63 | 128).toString(16).toUpperCase() + "%" + (T & 63 | 128).toString(16).toUpperCase(), F;
8089
8112
  }
8090
- function ie(A) {
8091
- for (var T = "", F = 0, U = A.length; F < U; ) {
8092
- var q = parseInt(A.substr(F + 1, 2), 16);
8113
+ function ie(I) {
8114
+ for (var T = "", F = 0, U = I.length; F < U; ) {
8115
+ var q = parseInt(I.substr(F + 1, 2), 16);
8093
8116
  if (q < 128)
8094
8117
  T += String.fromCharCode(q), F += 3;
8095
8118
  else if (q >= 194 && q < 224) {
8096
8119
  if (U - F >= 6) {
8097
- var de = parseInt(A.substr(F + 4, 2), 16);
8120
+ var de = parseInt(I.substr(F + 4, 2), 16);
8098
8121
  T += String.fromCharCode((q & 31) << 6 | de & 63);
8099
8122
  } else
8100
- T += A.substr(F, 6);
8123
+ T += I.substr(F, 6);
8101
8124
  F += 6;
8102
8125
  } else if (q >= 224) {
8103
8126
  if (U - F >= 9) {
8104
- var pe = parseInt(A.substr(F + 4, 2), 16), Se = parseInt(A.substr(F + 7, 2), 16);
8127
+ var pe = parseInt(I.substr(F + 4, 2), 16), Se = parseInt(I.substr(F + 7, 2), 16);
8105
8128
  T += String.fromCharCode((q & 15) << 12 | (pe & 63) << 6 | Se & 63);
8106
8129
  } else
8107
- T += A.substr(F, 9);
8130
+ T += I.substr(F, 9);
8108
8131
  F += 9;
8109
8132
  } else
8110
- T += A.substr(F, 3), F += 3;
8133
+ T += I.substr(F, 3), F += 3;
8111
8134
  }
8112
8135
  return T;
8113
8136
  }
8114
- function z(A, T) {
8137
+ function z(I, T) {
8115
8138
  function F(U) {
8116
8139
  var q = ie(U);
8117
8140
  return q.match(T.UNRESERVED) ? q : U;
8118
8141
  }
8119
- return A.scheme && (A.scheme = String(A.scheme).replace(T.PCT_ENCODED, F).toLowerCase().replace(T.NOT_SCHEME, "")), A.userinfo !== void 0 && (A.userinfo = String(A.userinfo).replace(T.PCT_ENCODED, F).replace(T.NOT_USERINFO, H).replace(T.PCT_ENCODED, o)), A.host !== void 0 && (A.host = String(A.host).replace(T.PCT_ENCODED, F).toLowerCase().replace(T.NOT_HOST, H).replace(T.PCT_ENCODED, o)), A.path !== void 0 && (A.path = String(A.path).replace(T.PCT_ENCODED, F).replace(A.scheme ? T.NOT_PATH : T.NOT_PATH_NOSCHEME, H).replace(T.PCT_ENCODED, o)), A.query !== void 0 && (A.query = String(A.query).replace(T.PCT_ENCODED, F).replace(T.NOT_QUERY, H).replace(T.PCT_ENCODED, o)), A.fragment !== void 0 && (A.fragment = String(A.fragment).replace(T.PCT_ENCODED, F).replace(T.NOT_FRAGMENT, H).replace(T.PCT_ENCODED, o)), A;
8142
+ return I.scheme && (I.scheme = String(I.scheme).replace(T.PCT_ENCODED, F).toLowerCase().replace(T.NOT_SCHEME, "")), I.userinfo !== void 0 && (I.userinfo = String(I.userinfo).replace(T.PCT_ENCODED, F).replace(T.NOT_USERINFO, H).replace(T.PCT_ENCODED, o)), I.host !== void 0 && (I.host = String(I.host).replace(T.PCT_ENCODED, F).toLowerCase().replace(T.NOT_HOST, H).replace(T.PCT_ENCODED, o)), I.path !== void 0 && (I.path = String(I.path).replace(T.PCT_ENCODED, F).replace(I.scheme ? T.NOT_PATH : T.NOT_PATH_NOSCHEME, H).replace(T.PCT_ENCODED, o)), I.query !== void 0 && (I.query = String(I.query).replace(T.PCT_ENCODED, F).replace(T.NOT_QUERY, H).replace(T.PCT_ENCODED, o)), I.fragment !== void 0 && (I.fragment = String(I.fragment).replace(T.PCT_ENCODED, F).replace(T.NOT_FRAGMENT, H).replace(T.PCT_ENCODED, o)), I;
8120
8143
  }
8121
- function X(A) {
8122
- return A.replace(/^0*(.*)/, "$1") || "0";
8144
+ function X(I) {
8145
+ return I.replace(/^0*(.*)/, "$1") || "0";
8123
8146
  }
8124
- function fe(A, T) {
8125
- var F = A.match(T.IPV4ADDRESS) || [], U = f(F, 2), q = U[1];
8126
- return q ? q.split(".").map(X).join(".") : A;
8147
+ function fe(I, T) {
8148
+ var F = I.match(T.IPV4ADDRESS) || [], U = f(F, 2), q = U[1];
8149
+ return q ? q.split(".").map(X).join(".") : I;
8127
8150
  }
8128
- function se(A, T) {
8129
- var F = A.match(T.IPV6ADDRESS) || [], U = f(F, 3), q = U[1], de = U[2];
8151
+ function se(I, T) {
8152
+ var F = I.match(T.IPV6ADDRESS) || [], U = f(F, 3), q = U[1], de = U[2];
8130
8153
  if (q) {
8131
8154
  for (var pe = q.toLowerCase().split("::").reverse(), Se = f(pe, 2), Me = Se[0], Le = Se[1], Ee = Le ? Le.split(":").map(X) : [], Oe = Me.split(":").map(X), Be = T.IPV4ADDRESS.test(Oe[Oe.length - 1]), ge = Be ? 7 : 8, Ie = Oe.length - ge, Ue = Array(ge), Fe = 0; Fe < ge; ++Fe)
8132
8155
  Ue[Fe] = Ee[Fe] || Oe[Ie + Fe] || "";
@@ -8147,15 +8170,15 @@ function lu() {
8147
8170
  fr = Ue.join(":");
8148
8171
  return de && (fr += "%" + de), fr;
8149
8172
  } else
8150
- return A;
8173
+ return I;
8151
8174
  }
8152
8175
  var ue = /^(?:([^:\/?#]+):)?(?:\/\/((?:([^\/?#@]*)@)?(\[[^\/?#\]]+\]|[^\/?#:]*)(?:\:(\d*))?))?([^?#]*)(?:\?([^#]*))?(?:#((?:.|\n|\r)*))?/i, xe = "".match(/(){0}/)[1] === void 0;
8153
- function _(A) {
8176
+ function _(I) {
8154
8177
  var T = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, F = {}, U = T.iri !== !1 ? h : d;
8155
- T.reference === "suffix" && (A = (T.scheme ? T.scheme + ":" : "") + "//" + A);
8156
- var q = A.match(ue);
8178
+ T.reference === "suffix" && (I = (T.scheme ? T.scheme + ":" : "") + "//" + I);
8179
+ var q = I.match(ue);
8157
8180
  if (q) {
8158
- xe ? (F.scheme = q[1], F.userinfo = q[3], F.host = q[4], F.port = parseInt(q[5], 10), F.path = q[6] || "", F.query = q[7], F.fragment = q[8], isNaN(F.port) && (F.port = q[5])) : (F.scheme = q[1] || void 0, F.userinfo = A.indexOf("@") !== -1 ? q[3] : void 0, F.host = A.indexOf("//") !== -1 ? q[4] : void 0, F.port = parseInt(q[5], 10), F.path = q[6] || "", F.query = A.indexOf("?") !== -1 ? q[7] : void 0, F.fragment = A.indexOf("#") !== -1 ? q[8] : void 0, isNaN(F.port) && (F.port = A.match(/\/\/(?:.|\n)*\:(?:\/|\?|\#|$)/) ? q[4] : void 0)), F.host && (F.host = se(fe(F.host, U), U)), F.scheme === void 0 && F.userinfo === void 0 && F.host === void 0 && F.port === void 0 && !F.path && F.query === void 0 ? F.reference = "same-document" : F.scheme === void 0 ? F.reference = "relative" : F.fragment === void 0 ? F.reference = "absolute" : F.reference = "uri", T.reference && T.reference !== "suffix" && T.reference !== F.reference && (F.error = F.error || "URI is not a " + T.reference + " reference.");
8181
+ xe ? (F.scheme = q[1], F.userinfo = q[3], F.host = q[4], F.port = parseInt(q[5], 10), F.path = q[6] || "", F.query = q[7], F.fragment = q[8], isNaN(F.port) && (F.port = q[5])) : (F.scheme = q[1] || void 0, F.userinfo = I.indexOf("@") !== -1 ? q[3] : void 0, F.host = I.indexOf("//") !== -1 ? q[4] : void 0, F.port = parseInt(q[5], 10), F.path = q[6] || "", F.query = I.indexOf("?") !== -1 ? q[7] : void 0, F.fragment = I.indexOf("#") !== -1 ? q[8] : void 0, isNaN(F.port) && (F.port = I.match(/\/\/(?:.|\n)*\:(?:\/|\?|\#|$)/) ? q[4] : void 0)), F.host && (F.host = se(fe(F.host, U), U)), F.scheme === void 0 && F.userinfo === void 0 && F.host === void 0 && F.port === void 0 && !F.path && F.query === void 0 ? F.reference = "same-document" : F.scheme === void 0 ? F.reference = "relative" : F.fragment === void 0 ? F.reference = "absolute" : F.reference = "uri", T.reference && T.reference !== "suffix" && T.reference !== F.reference && (F.error = F.error || "URI is not a " + T.reference + " reference.");
8159
8182
  var de = B[(T.scheme || F.scheme || "").toLowerCase()];
8160
8183
  if (!T.unicodeSupport && (!de || !de.unicodeSupport)) {
8161
8184
  if (F.host && (T.domainHost || de && de.domainHost))
@@ -8172,70 +8195,70 @@ function lu() {
8172
8195
  F.error = F.error || "URI can not be parsed.";
8173
8196
  return F;
8174
8197
  }
8175
- function m(A, T) {
8198
+ function m(I, T) {
8176
8199
  var F = T.iri !== !1 ? h : d, U = [];
8177
- return A.userinfo !== void 0 && (U.push(A.userinfo), U.push("@")), A.host !== void 0 && U.push(se(fe(String(A.host), F), F).replace(F.IPV6ADDRESS, function(q, de, pe) {
8200
+ return I.userinfo !== void 0 && (U.push(I.userinfo), U.push("@")), I.host !== void 0 && U.push(se(fe(String(I.host), F), F).replace(F.IPV6ADDRESS, function(q, de, pe) {
8178
8201
  return "[" + de + (pe ? "%25" + pe : "") + "]";
8179
- })), (typeof A.port == "number" || typeof A.port == "string") && (U.push(":"), U.push(String(A.port))), U.length ? U.join("") : void 0;
8202
+ })), (typeof I.port == "number" || typeof I.port == "string") && (U.push(":"), U.push(String(I.port))), U.length ? U.join("") : void 0;
8180
8203
  }
8181
8204
  var b = /^\.\.?\//, $ = /^\/\.(\/|$)/, L = /^\/\.\.(\/|$)/, W = /^\/?(?:.|\n)*?(?=\/|$)/;
8182
- function Q(A) {
8183
- for (var T = []; A.length; )
8184
- if (A.match(b))
8185
- A = A.replace(b, "");
8186
- else if (A.match($))
8187
- A = A.replace($, "/");
8188
- else if (A.match(L))
8189
- A = A.replace(L, "/"), T.pop();
8190
- else if (A === "." || A === "..")
8191
- A = "";
8205
+ function Q(I) {
8206
+ for (var T = []; I.length; )
8207
+ if (I.match(b))
8208
+ I = I.replace(b, "");
8209
+ else if (I.match($))
8210
+ I = I.replace($, "/");
8211
+ else if (I.match(L))
8212
+ I = I.replace(L, "/"), T.pop();
8213
+ else if (I === "." || I === "..")
8214
+ I = "";
8192
8215
  else {
8193
- var F = A.match(W);
8216
+ var F = I.match(W);
8194
8217
  if (F) {
8195
8218
  var U = F[0];
8196
- A = A.slice(U.length), T.push(U);
8219
+ I = I.slice(U.length), T.push(U);
8197
8220
  } else
8198
8221
  throw new Error("Unexpected dot segment condition");
8199
8222
  }
8200
8223
  return T.join("");
8201
8224
  }
8202
- function he(A) {
8203
- var T = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, F = T.iri ? h : d, U = [], q = B[(T.scheme || A.scheme || "").toLowerCase()];
8204
- if (q && q.serialize && q.serialize(A, T), A.host && !F.IPV6ADDRESS.test(A.host)) {
8225
+ function he(I) {
8226
+ var T = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, F = T.iri ? h : d, U = [], q = B[(T.scheme || I.scheme || "").toLowerCase()];
8227
+ if (q && q.serialize && q.serialize(I, T), I.host && !F.IPV6ADDRESS.test(I.host)) {
8205
8228
  if (T.domainHost || q && q.domainHost)
8206
8229
  try {
8207
- A.host = T.iri ? N.toUnicode(A.host) : N.toASCII(A.host.replace(F.PCT_ENCODED, ie).toLowerCase());
8230
+ I.host = T.iri ? N.toUnicode(I.host) : N.toASCII(I.host.replace(F.PCT_ENCODED, ie).toLowerCase());
8208
8231
  } catch (Se) {
8209
- A.error = A.error || "Host's domain name can not be converted to " + (T.iri ? "Unicode" : "ASCII") + " via punycode: " + Se;
8232
+ I.error = I.error || "Host's domain name can not be converted to " + (T.iri ? "Unicode" : "ASCII") + " via punycode: " + Se;
8210
8233
  }
8211
8234
  }
8212
- z(A, F), T.reference !== "suffix" && A.scheme && (U.push(A.scheme), U.push(":"));
8213
- var de = m(A, T);
8214
- if (de !== void 0 && (T.reference !== "suffix" && U.push("//"), U.push(de), A.path && A.path.charAt(0) !== "/" && U.push("/")), A.path !== void 0) {
8215
- var pe = A.path;
8235
+ z(I, F), T.reference !== "suffix" && I.scheme && (U.push(I.scheme), U.push(":"));
8236
+ var de = m(I, T);
8237
+ if (de !== void 0 && (T.reference !== "suffix" && U.push("//"), U.push(de), I.path && I.path.charAt(0) !== "/" && U.push("/")), I.path !== void 0) {
8238
+ var pe = I.path;
8216
8239
  !T.absolutePath && (!q || !q.absolutePath) && (pe = Q(pe)), de === void 0 && (pe = pe.replace(/^\/\//, "/%2F")), U.push(pe);
8217
8240
  }
8218
- return A.query !== void 0 && (U.push("?"), U.push(A.query)), A.fragment !== void 0 && (U.push("#"), U.push(A.fragment)), U.join("");
8241
+ return I.query !== void 0 && (U.push("?"), U.push(I.query)), I.fragment !== void 0 && (U.push("#"), U.push(I.fragment)), U.join("");
8219
8242
  }
8220
- function ye(A, T) {
8243
+ function ye(I, T) {
8221
8244
  var F = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}, U = arguments[3], q = {};
8222
- return U || (A = _(he(A, F), F), T = _(he(T, F), F)), F = F || {}, !F.tolerant && T.scheme ? (q.scheme = T.scheme, q.userinfo = T.userinfo, q.host = T.host, q.port = T.port, q.path = Q(T.path || ""), q.query = T.query) : (T.userinfo !== void 0 || T.host !== void 0 || T.port !== void 0 ? (q.userinfo = T.userinfo, q.host = T.host, q.port = T.port, q.path = Q(T.path || ""), q.query = T.query) : (T.path ? (T.path.charAt(0) === "/" ? q.path = Q(T.path) : ((A.userinfo !== void 0 || A.host !== void 0 || A.port !== void 0) && !A.path ? q.path = "/" + T.path : A.path ? q.path = A.path.slice(0, A.path.lastIndexOf("/") + 1) + T.path : q.path = T.path, q.path = Q(q.path)), q.query = T.query) : (q.path = A.path, T.query !== void 0 ? q.query = T.query : q.query = A.query), q.userinfo = A.userinfo, q.host = A.host, q.port = A.port), q.scheme = A.scheme), q.fragment = T.fragment, q;
8245
+ return U || (I = _(he(I, F), F), T = _(he(T, F), F)), F = F || {}, !F.tolerant && T.scheme ? (q.scheme = T.scheme, q.userinfo = T.userinfo, q.host = T.host, q.port = T.port, q.path = Q(T.path || ""), q.query = T.query) : (T.userinfo !== void 0 || T.host !== void 0 || T.port !== void 0 ? (q.userinfo = T.userinfo, q.host = T.host, q.port = T.port, q.path = Q(T.path || ""), q.query = T.query) : (T.path ? (T.path.charAt(0) === "/" ? q.path = Q(T.path) : ((I.userinfo !== void 0 || I.host !== void 0 || I.port !== void 0) && !I.path ? q.path = "/" + T.path : I.path ? q.path = I.path.slice(0, I.path.lastIndexOf("/") + 1) + T.path : q.path = T.path, q.path = Q(q.path)), q.query = T.query) : (q.path = I.path, T.query !== void 0 ? q.query = T.query : q.query = I.query), q.userinfo = I.userinfo, q.host = I.host, q.port = I.port), q.scheme = I.scheme), q.fragment = T.fragment, q;
8223
8246
  }
8224
- function _e(A, T, F) {
8247
+ function _e(I, T, F) {
8225
8248
  var U = l({ scheme: "null" }, F);
8226
- return he(ye(_(A, U), _(T, U), U, !0), U);
8249
+ return he(ye(_(I, U), _(T, U), U, !0), U);
8227
8250
  }
8228
- function qe(A, T) {
8229
- return typeof A == "string" ? A = he(_(A, T), T) : n(A) === "object" && (A = _(he(A, T), T)), A;
8251
+ function qe(I, T) {
8252
+ return typeof I == "string" ? I = he(_(I, T), T) : n(I) === "object" && (I = _(he(I, T), T)), I;
8230
8253
  }
8231
- function De(A, T, F) {
8232
- return typeof A == "string" ? A = he(_(A, F), F) : n(A) === "object" && (A = he(A, F)), typeof T == "string" ? T = he(_(T, F), F) : n(T) === "object" && (T = he(T, F)), A === T;
8254
+ function De(I, T, F) {
8255
+ return typeof I == "string" ? I = he(_(I, F), F) : n(I) === "object" && (I = he(I, F)), typeof T == "string" ? T = he(_(T, F), F) : n(T) === "object" && (T = he(T, F)), I === T;
8233
8256
  }
8234
- function qr(A, T) {
8235
- return A && A.toString().replace(!T || !T.iri ? d.ESCAPE : h.ESCAPE, H);
8257
+ function qr(I, T) {
8258
+ return I && I.toString().replace(!T || !T.iri ? d.ESCAPE : h.ESCAPE, H);
8236
8259
  }
8237
- function Ye(A, T) {
8238
- return A && A.toString().replace(!T || !T.iri ? d.PCT_ENCODED : h.PCT_ENCODED, ie);
8260
+ function Ye(I, T) {
8261
+ return I && I.toString().replace(!T || !T.iri ? d.PCT_ENCODED : h.PCT_ENCODED, ie);
8239
8262
  }
8240
8263
  var Cr = {
8241
8264
  scheme: "http",
@@ -8253,8 +8276,8 @@ function lu() {
8253
8276
  parse: Cr.parse,
8254
8277
  serialize: Cr.serialize
8255
8278
  };
8256
- function rs(A) {
8257
- return typeof A.secure == "boolean" ? A.secure : String(A.scheme).toLowerCase() === "wss";
8279
+ function rs(I) {
8280
+ return typeof I.secure == "boolean" ? I.secure : String(I.scheme).toLowerCase() === "wss";
8258
8281
  }
8259
8282
  var et = {
8260
8283
  scheme: "ws",
@@ -8276,9 +8299,9 @@ function lu() {
8276
8299
  parse: et.parse,
8277
8300
  serialize: et.serialize
8278
8301
  }, nl = {}, as = "[A-Za-z0-9\\-\\.\\_\\~\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]", cr = "[0-9A-Fa-f]", sl = r(r("%[EFef]" + cr + "%" + cr + cr + "%" + cr + cr) + "|" + r("%[89A-Fa-f]" + cr + "%" + cr + cr) + "|" + r("%" + cr + cr)), ol = "[A-Za-z0-9\\!\\$\\%\\'\\*\\+\\-\\^\\_\\`\\{\\|\\}\\~]", il = "[\\!\\$\\%\\'\\(\\)\\*\\+\\,\\-\\.0-9\\<\\>A-Z\\x5E-\\x7E]", ll = a(il, '[\\"\\\\]'), cl = "[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]", ul = new RegExp(as, "g"), Ur = new RegExp(sl, "g"), fl = new RegExp(a("[^]", ol, "[\\.]", '[\\"]', ll), "g"), ns = new RegExp(a("[^]", as, cl), "g"), dl = ns;
8279
- function Vt(A) {
8280
- var T = ie(A);
8281
- return T.match(ul) ? T : A;
8302
+ function Vt(I) {
8303
+ var T = ie(I);
8304
+ return T.match(ul) ? T : I;
8282
8305
  }
8283
8306
  var ss = {
8284
8307
  scheme: "mailto",
@@ -8432,62 +8455,62 @@ function Yr() {
8432
8455
  getPath: y,
8433
8456
  getData: S,
8434
8457
  unescapeFragment: C,
8435
- unescapeJsonPointer: I,
8458
+ unescapeJsonPointer: M,
8436
8459
  escapeFragment: D,
8437
8460
  escapeJsonPointer: O
8438
8461
  };
8439
- function i(R, M) {
8440
- M = M || {};
8441
- for (var k in R) M[k] = R[k];
8442
- return M;
8462
+ function i(R, A) {
8463
+ A = A || {};
8464
+ for (var k in R) A[k] = R[k];
8465
+ return A;
8443
8466
  }
8444
- function e(R, M, k, V) {
8467
+ function e(R, A, k, V) {
8445
8468
  var G = V ? " !== " : " === ", Z = V ? " || " : " && ", re = V ? "!" : "", Y = V ? "" : "!";
8446
8469
  switch (R) {
8447
8470
  case "null":
8448
- return M + G + "null";
8471
+ return A + G + "null";
8449
8472
  case "array":
8450
- return re + "Array.isArray(" + M + ")";
8473
+ return re + "Array.isArray(" + A + ")";
8451
8474
  case "object":
8452
- return "(" + re + M + Z + "typeof " + M + G + '"object"' + Z + Y + "Array.isArray(" + M + "))";
8475
+ return "(" + re + A + Z + "typeof " + A + G + '"object"' + Z + Y + "Array.isArray(" + A + "))";
8453
8476
  case "integer":
8454
- return "(typeof " + M + G + '"number"' + Z + Y + "(" + M + " % 1)" + Z + M + G + M + (k ? Z + re + "isFinite(" + M + ")" : "") + ")";
8477
+ return "(typeof " + A + G + '"number"' + Z + Y + "(" + A + " % 1)" + Z + A + G + A + (k ? Z + re + "isFinite(" + A + ")" : "") + ")";
8455
8478
  case "number":
8456
- return "(typeof " + M + G + '"' + R + '"' + (k ? Z + re + "isFinite(" + M + ")" : "") + ")";
8479
+ return "(typeof " + A + G + '"' + R + '"' + (k ? Z + re + "isFinite(" + A + ")" : "") + ")";
8457
8480
  default:
8458
- return "typeof " + M + G + '"' + R + '"';
8481
+ return "typeof " + A + G + '"' + R + '"';
8459
8482
  }
8460
8483
  }
8461
- function t(R, M, k) {
8484
+ function t(R, A, k) {
8462
8485
  switch (R.length) {
8463
8486
  case 1:
8464
- return e(R[0], M, k, !0);
8487
+ return e(R[0], A, k, !0);
8465
8488
  default:
8466
8489
  var V = "", G = n(R);
8467
- G.array && G.object && (V = G.null ? "(" : "(!" + M + " || ", V += "typeof " + M + ' !== "object")', delete G.null, delete G.array, delete G.object), G.number && delete G.integer;
8490
+ G.array && G.object && (V = G.null ? "(" : "(!" + A + " || ", V += "typeof " + A + ' !== "object")', delete G.null, delete G.array, delete G.object), G.number && delete G.integer;
8468
8491
  for (var Z in G)
8469
- V += (V ? " && " : "") + e(Z, M, k, !0);
8492
+ V += (V ? " && " : "") + e(Z, A, k, !0);
8470
8493
  return V;
8471
8494
  }
8472
8495
  }
8473
8496
  var a = n(["string", "number", "integer", "boolean", "null"]);
8474
- function r(R, M) {
8475
- if (Array.isArray(M)) {
8476
- for (var k = [], V = 0; V < M.length; V++) {
8477
- var G = M[V];
8497
+ function r(R, A) {
8498
+ if (Array.isArray(A)) {
8499
+ for (var k = [], V = 0; V < A.length; V++) {
8500
+ var G = A[V];
8478
8501
  (a[G] || R === "array" && G === "array") && (k[k.length] = G);
8479
8502
  }
8480
8503
  if (k.length) return k;
8481
8504
  } else {
8482
- if (a[M])
8483
- return [M];
8484
- if (R === "array" && M === "array")
8505
+ if (a[A])
8506
+ return [A];
8507
+ if (R === "array" && A === "array")
8485
8508
  return ["array"];
8486
8509
  }
8487
8510
  }
8488
8511
  function n(R) {
8489
- for (var M = {}, k = 0; k < R.length; k++) M[R[k]] = !0;
8490
- return M;
8512
+ for (var A = {}, k = 0; k < R.length; k++) A[R[k]] = !0;
8513
+ return A;
8491
8514
  }
8492
8515
  var o = /^[a-z$_][a-z$_0-9]*$/i, s = /'|\\/g;
8493
8516
  function l(R) {
@@ -8496,40 +8519,40 @@ function Yr() {
8496
8519
  function c(R) {
8497
8520
  return R.replace(s, "\\$&").replace(/\n/g, "\\n").replace(/\r/g, "\\r").replace(/\f/g, "\\f").replace(/\t/g, "\\t");
8498
8521
  }
8499
- function d(R, M) {
8500
- M += "[^0-9]";
8501
- var k = R.match(new RegExp(M, "g"));
8522
+ function d(R, A) {
8523
+ A += "[^0-9]";
8524
+ var k = R.match(new RegExp(A, "g"));
8502
8525
  return k ? k.length : 0;
8503
8526
  }
8504
- function h(R, M, k) {
8505
- return M += "([^0-9])", k = k.replace(/\$/g, "$$$$"), R.replace(new RegExp(M, "g"), k + "$1");
8527
+ function h(R, A, k) {
8528
+ return A += "([^0-9])", k = k.replace(/\$/g, "$$$$"), R.replace(new RegExp(A, "g"), k + "$1");
8506
8529
  }
8507
- function f(R, M) {
8530
+ function f(R, A) {
8508
8531
  if (typeof R == "boolean") return !R;
8509
- for (var k in R) if (M[k]) return !0;
8532
+ for (var k in R) if (A[k]) return !0;
8510
8533
  }
8511
- function u(R, M, k) {
8534
+ function u(R, A, k) {
8512
8535
  if (typeof R == "boolean") return !R && k != "not";
8513
- for (var V in R) if (V != k && M[V]) return !0;
8536
+ for (var V in R) if (V != k && A[V]) return !0;
8514
8537
  }
8515
- function v(R, M) {
8538
+ function v(R, A) {
8516
8539
  if (typeof R != "boolean") {
8517
- for (var k in R) if (!M[k]) return k;
8540
+ for (var k in R) if (!A[k]) return k;
8518
8541
  }
8519
8542
  }
8520
8543
  function g(R) {
8521
8544
  return "'" + c(R) + "'";
8522
8545
  }
8523
- function E(R, M, k, V) {
8524
- var G = k ? "'/' + " + M + (V ? "" : ".replace(/~/g, '~0').replace(/\\//g, '~1')") : V ? "'[' + " + M + " + ']'" : "'[\\'' + " + M + " + '\\']'";
8546
+ function E(R, A, k, V) {
8547
+ var G = k ? "'/' + " + A + (V ? "" : ".replace(/~/g, '~0').replace(/\\//g, '~1')") : V ? "'[' + " + A + " + ']'" : "'[\\'' + " + A + " + '\\']'";
8525
8548
  return P(R, G);
8526
8549
  }
8527
- function y(R, M, k) {
8528
- var V = g(k ? "/" + O(M) : l(M));
8550
+ function y(R, A, k) {
8551
+ var V = g(k ? "/" + O(A) : l(A));
8529
8552
  return P(R, V);
8530
8553
  }
8531
8554
  var x = /^\/(?:[^~]|~0|~1)*$/, p = /^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;
8532
- function S(R, M, k) {
8555
+ function S(R, A, k) {
8533
8556
  var V, G, Z, re;
8534
8557
  if (R === "") return "rootData";
8535
8558
  if (R[0] == "/") {
@@ -8538,23 +8561,23 @@ function Yr() {
8538
8561
  } else {
8539
8562
  if (re = R.match(p), !re) throw new Error("Invalid JSON-pointer: " + R);
8540
8563
  if (V = +re[1], G = re[2], G == "#") {
8541
- if (V >= M) throw new Error("Cannot access property/index " + V + " levels up, current level is " + M);
8542
- return k[M - V];
8564
+ if (V >= A) throw new Error("Cannot access property/index " + V + " levels up, current level is " + A);
8565
+ return k[A - V];
8543
8566
  }
8544
- if (V > M) throw new Error("Cannot access data " + V + " levels up, current level is " + M);
8545
- if (Z = "data" + (M - V || ""), !G) return Z;
8567
+ if (V > A) throw new Error("Cannot access data " + V + " levels up, current level is " + A);
8568
+ if (Z = "data" + (A - V || ""), !G) return Z;
8546
8569
  }
8547
8570
  for (var Y = Z, oe = G.split("/"), ee = 0; ee < oe.length; ee++) {
8548
8571
  var ae = oe[ee];
8549
- ae && (Z += l(I(ae)), Y += " && " + Z);
8572
+ ae && (Z += l(M(ae)), Y += " && " + Z);
8550
8573
  }
8551
8574
  return Y;
8552
8575
  }
8553
- function P(R, M) {
8554
- return R == '""' ? M : (R + " + " + M).replace(/([^\\])' \+ '/g, "$1");
8576
+ function P(R, A) {
8577
+ return R == '""' ? A : (R + " + " + A).replace(/([^\\])' \+ '/g, "$1");
8555
8578
  }
8556
8579
  function C(R) {
8557
- return I(decodeURIComponent(R));
8580
+ return M(decodeURIComponent(R));
8558
8581
  }
8559
8582
  function D(R) {
8560
8583
  return encodeURIComponent(O(R));
@@ -8562,7 +8585,7 @@ function Yr() {
8562
8585
  function O(R) {
8563
8586
  return R.replace(/~/g, "~0").replace(/\//g, "~1");
8564
8587
  }
8565
- function I(R) {
8588
+ function M(R) {
8566
8589
  return R.replace(/~1/g, "/").replace(/~0/g, "~");
8567
8590
  }
8568
8591
  return Xt;
@@ -8662,19 +8685,19 @@ function Vn() {
8662
8685
  else return n.call(this, S, P, D);
8663
8686
  if (D = D || this._schemas[C], D instanceof a)
8664
8687
  return h(D.schema, this._opts.inlineRefs) ? D.schema : D.validate || this._compile(D);
8665
- var O = o.call(this, P, C), I, R, M;
8666
- return O && (I = O.schema, P = O.root, M = O.baseId), I instanceof a ? R = I.validate || S.call(this, I.schema, P, void 0, M) : I !== void 0 && (R = h(I, this._opts.inlineRefs) ? I : S.call(this, I, P, void 0, M)), R;
8688
+ var O = o.call(this, P, C), M, R, A;
8689
+ return O && (M = O.schema, P = O.root, A = O.baseId), M instanceof a ? R = M.validate || S.call(this, M.schema, P, void 0, A) : M !== void 0 && (R = h(M, this._opts.inlineRefs) ? M : S.call(this, M, P, void 0, A)), R;
8667
8690
  }
8668
8691
  function o(S, P) {
8669
8692
  var C = i.parse(P), D = g(C), O = v(this._getId(S.schema));
8670
8693
  if (Object.keys(S.schema).length === 0 || D !== O) {
8671
- var I = y(D), R = this._refs[I];
8694
+ var M = y(D), R = this._refs[M];
8672
8695
  if (typeof R == "string")
8673
8696
  return s.call(this, S, R, C);
8674
8697
  if (R instanceof a)
8675
8698
  R.validate || this._compile(R), S = R;
8676
- else if (R = this._schemas[I], R instanceof a) {
8677
- if (R.validate || this._compile(R), I == y(P))
8699
+ else if (R = this._schemas[M], R instanceof a) {
8700
+ if (R.validate || this._compile(R), M == y(P))
8678
8701
  return { schema: R, root: S, baseId: O };
8679
8702
  S = R;
8680
8703
  } else
@@ -8687,21 +8710,21 @@ function Vn() {
8687
8710
  function s(S, P, C) {
8688
8711
  var D = o.call(this, S, P);
8689
8712
  if (D) {
8690
- var O = D.schema, I = D.baseId;
8713
+ var O = D.schema, M = D.baseId;
8691
8714
  S = D.root;
8692
8715
  var R = this._getId(O);
8693
- return R && (I = x(I, R)), c.call(this, C, I, O, S);
8716
+ return R && (M = x(M, R)), c.call(this, C, M, O, S);
8694
8717
  }
8695
8718
  }
8696
8719
  var l = t.toHash(["properties", "patternProperties", "enum", "dependencies", "definitions"]);
8697
8720
  function c(S, P, C, D) {
8698
8721
  if (S.fragment = S.fragment || "", S.fragment.slice(0, 1) == "/") {
8699
- for (var O = S.fragment.split("/"), I = 1; I < O.length; I++) {
8700
- var R = O[I];
8722
+ for (var O = S.fragment.split("/"), M = 1; M < O.length; M++) {
8723
+ var R = O[M];
8701
8724
  if (R) {
8702
8725
  if (R = t.unescapeFragment(R), C = C[R], C === void 0) break;
8703
- var M;
8704
- if (!l[R] && (M = this._getId(C), M && (P = x(P, M)), C.$ref)) {
8726
+ var A;
8727
+ if (!l[R] && (A = this._getId(C), A && (P = x(P, A)), C.$ref)) {
8705
8728
  var k = x(P, C.$ref), V = o.call(this, D, k);
8706
8729
  V && (C = V.schema, D = V.root, P = V.baseId);
8707
8730
  }
@@ -8773,14 +8796,14 @@ function Vn() {
8773
8796
  return P = y(P), i.resolve(S, P);
8774
8797
  }
8775
8798
  function p(S) {
8776
- var P = y(this._getId(S)), C = { "": P }, D = { "": v(P, !1) }, O = {}, I = this;
8777
- return r(S, { allKeys: !0 }, function(R, M, k, V, G, Z, re) {
8778
- if (M !== "") {
8779
- var Y = I._getId(R), oe = C[V], ee = D[V] + "/" + G;
8799
+ var P = y(this._getId(S)), C = { "": P }, D = { "": v(P, !1) }, O = {}, M = this;
8800
+ return r(S, { allKeys: !0 }, function(R, A, k, V, G, Z, re) {
8801
+ if (A !== "") {
8802
+ var Y = M._getId(R), oe = C[V], ee = D[V] + "/" + G;
8780
8803
  if (re !== void 0 && (ee += "/" + (typeof re == "number" ? re : t.escapeFragment(re))), typeof Y == "string") {
8781
8804
  Y = oe = y(oe ? i.resolve(oe, Y) : Y);
8782
- var ae = I._refs[Y];
8783
- if (typeof ae == "string" && (ae = I._refs[ae]), ae && ae.schema) {
8805
+ var ae = M._refs[Y];
8806
+ if (typeof ae == "string" && (ae = M._refs[ae]), ae && ae.schema) {
8784
8807
  if (!e(R, ae.schema))
8785
8808
  throw new Error('id "' + Y + '" resolves to more than one schema');
8786
8809
  } else if (Y != y(ee))
@@ -8789,9 +8812,9 @@ function Vn() {
8789
8812
  throw new Error('id "' + Y + '" resolves to more than one schema');
8790
8813
  O[Y] = R;
8791
8814
  } else
8792
- I._refs[Y] = ee;
8815
+ M._refs[Y] = ee;
8793
8816
  }
8794
- C[M] = oe, D[M] = ee;
8817
+ C[A] = oe, D[A] = ee;
8795
8818
  }
8796
8819
  }), O;
8797
8820
  }
@@ -8894,35 +8917,35 @@ function Wi() {
8894
8917
  if (s && (e.baseId = e.resolve.url(e.baseId, s)), n && !e.async) throw new Error("async schema in sync schema");
8895
8918
  r += " var errs_" + d + " = errors;";
8896
8919
  }
8897
- var S = "valid" + d, P = !e.opts.allErrors, C = "", D = "", O, I = e.schema.type, R = Array.isArray(I);
8898
- if (I && e.opts.nullable && e.schema.nullable === !0 && (R ? I.indexOf("null") == -1 && (I = I.concat("null")) : I != "null" && (I = [I, "null"], R = !0)), R && I.length == 1 && (I = I[0], R = !1), e.schema.$ref && o) {
8920
+ var S = "valid" + d, P = !e.opts.allErrors, C = "", D = "", O, M = e.schema.type, R = Array.isArray(M);
8921
+ if (M && e.opts.nullable && e.schema.nullable === !0 && (R ? M.indexOf("null") == -1 && (M = M.concat("null")) : M != "null" && (M = [M, "null"], R = !0)), R && M.length == 1 && (M = M[0], R = !1), e.schema.$ref && o) {
8899
8922
  if (e.opts.extendRefs == "fail")
8900
8923
  throw new Error('$ref: validation keywords used in schema at path "' + e.errSchemaPath + '" (see option extendRefs)');
8901
8924
  e.opts.extendRefs !== !0 && (o = !1, e.logger.warn('$ref: keywords ignored in schema at path "' + e.errSchemaPath + '"'));
8902
8925
  }
8903
- if (e.schema.$comment && e.opts.$comment && (r += " " + e.RULES.all.$comment.code(e, "$comment")), I) {
8926
+ if (e.schema.$comment && e.opts.$comment && (r += " " + e.RULES.all.$comment.code(e, "$comment")), M) {
8904
8927
  if (e.opts.coerceTypes)
8905
- var M = e.util.coerceToTypes(e.opts.coerceTypes, I);
8906
- var k = e.RULES.types[I];
8907
- if (M || R || k === !0 || k && !$(k)) {
8928
+ var A = e.util.coerceToTypes(e.opts.coerceTypes, M);
8929
+ var k = e.RULES.types[M];
8930
+ if (A || R || k === !0 || k && !$(k)) {
8908
8931
  var u = e.schemaPath + ".type", v = e.errSchemaPath + "/type", u = e.schemaPath + ".type", v = e.errSchemaPath + "/type", V = R ? "checkDataTypes" : "checkDataType";
8909
- if (r += " if (" + e.util[V](I, g, e.opts.strictNumbers, !0) + ") { ", M) {
8932
+ if (r += " if (" + e.util[V](M, g, e.opts.strictNumbers, !0) + ") { ", A) {
8910
8933
  var G = "dataType" + d, Z = "coerced" + d;
8911
8934
  r += " var " + G + " = typeof " + g + "; var " + Z + " = undefined; ", e.opts.coerceTypes == "array" && (r += " if (" + G + " == 'object' && Array.isArray(" + g + ") && " + g + ".length == 1) { " + g + " = " + g + "[0]; " + G + " = typeof " + g + "; if (" + e.util.checkDataType(e.schema.type, g, e.opts.strictNumbers) + ") " + Z + " = " + g + "; } "), r += " if (" + Z + " !== undefined) ; ";
8912
- var re = M;
8935
+ var re = A;
8913
8936
  if (re)
8914
8937
  for (var Y, oe = -1, ee = re.length - 1; oe < ee; )
8915
8938
  Y = re[oe += 1], Y == "string" ? r += " else if (" + G + " == 'number' || " + G + " == 'boolean') " + Z + " = '' + " + g + "; else if (" + g + " === null) " + Z + " = ''; " : Y == "number" || Y == "integer" ? (r += " else if (" + G + " == 'boolean' || " + g + " === null || (" + G + " == 'string' && " + g + " && " + g + " == +" + g + " ", Y == "integer" && (r += " && !(" + g + " % 1)"), r += ")) " + Z + " = +" + g + "; ") : Y == "boolean" ? r += " else if (" + g + " === 'false' || " + g + " === 0 || " + g + " === null) " + Z + " = false; else if (" + g + " === 'true' || " + g + " === 1) " + Z + " = true; " : Y == "null" ? r += " else if (" + g + " === '' || " + g + " === 0 || " + g + " === false) " + Z + " = null; " : e.opts.coerceTypes == "array" && Y == "array" && (r += " else if (" + G + " == 'string' || " + G + " == 'number' || " + G + " == 'boolean' || " + g + " == null) " + Z + " = [" + g + "]; ");
8916
8939
  r += " else { ";
8917
8940
  var E = E || [];
8918
- E.push(r), r = "", e.createErrors !== !1 ? (r += " { keyword: '" + (O || "type") + "' , dataPath: (dataPath || '') + " + e.errorPath + " , schemaPath: " + e.util.toQuotedString(v) + " , params: { type: '", R ? r += "" + I.join(",") : r += "" + I, r += "' } ", e.opts.messages !== !1 && (r += " , message: 'should be ", R ? r += "" + I.join(",") : r += "" + I, r += "' "), e.opts.verbose && (r += " , schema: validate.schema" + u + " , parentSchema: validate.schema" + e.schemaPath + " , data: " + g + " "), r += " } ") : r += " {} ";
8941
+ E.push(r), r = "", e.createErrors !== !1 ? (r += " { keyword: '" + (O || "type") + "' , dataPath: (dataPath || '') + " + e.errorPath + " , schemaPath: " + e.util.toQuotedString(v) + " , params: { type: '", R ? r += "" + M.join(",") : r += "" + M, r += "' } ", e.opts.messages !== !1 && (r += " , message: 'should be ", R ? r += "" + M.join(",") : r += "" + M, r += "' "), e.opts.verbose && (r += " , schema: validate.schema" + u + " , parentSchema: validate.schema" + e.schemaPath + " , data: " + g + " "), r += " } ") : r += " {} ";
8919
8942
  var y = r;
8920
8943
  r = E.pop(), !e.compositeRule && P ? e.async ? r += " throw new ValidationError([" + y + "]); " : r += " validate.errors = [" + y + "]; return false; " : r += " var err = " + y + "; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ", r += " } if (" + Z + " !== undefined) { ";
8921
8944
  var ae = h ? "data" + (h - 1 || "") : "parentData", ne = h ? e.dataPathArr[h] : "parentDataProperty";
8922
8945
  r += " " + g + " = " + Z + "; ", h || (r += "if (" + ae + " !== undefined)"), r += " " + ae + "[" + ne + "] = " + Z + "; } ";
8923
8946
  } else {
8924
8947
  var E = E || [];
8925
- E.push(r), r = "", e.createErrors !== !1 ? (r += " { keyword: '" + (O || "type") + "' , dataPath: (dataPath || '') + " + e.errorPath + " , schemaPath: " + e.util.toQuotedString(v) + " , params: { type: '", R ? r += "" + I.join(",") : r += "" + I, r += "' } ", e.opts.messages !== !1 && (r += " , message: 'should be ", R ? r += "" + I.join(",") : r += "" + I, r += "' "), e.opts.verbose && (r += " , schema: validate.schema" + u + " , parentSchema: validate.schema" + e.schemaPath + " , data: " + g + " "), r += " } ") : r += " {} ";
8948
+ E.push(r), r = "", e.createErrors !== !1 ? (r += " { keyword: '" + (O || "type") + "' , dataPath: (dataPath || '') + " + e.errorPath + " , schemaPath: " + e.util.toQuotedString(v) + " , params: { type: '", R ? r += "" + M.join(",") : r += "" + M, r += "' } ", e.opts.messages !== !1 && (r += " , message: 'should be ", R ? r += "" + M.join(",") : r += "" + M, r += "' "), e.opts.verbose && (r += " , schema: validate.schema" + u + " , parentSchema: validate.schema" + e.schemaPath + " , data: " + g + " "), r += " } ") : r += " {} ";
8926
8949
  var y = r;
8927
8950
  r = E.pop(), !e.compositeRule && P ? e.async ? r += " throw new ValidationError([" + y + "]); " : r += " validate.errors = [" + y + "]; return false; " : r += " var err = " + y + "; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";
8928
8951
  }
@@ -8981,10 +9004,10 @@ function Wi() {
8981
9004
  b && (r += " " + b + " ", P && (C += "}"));
8982
9005
  }
8983
9006
  }
8984
- if (P && (r += " " + C + " ", C = ""), k.type && (r += " } ", I && I === k.type && !M)) {
9007
+ if (P && (r += " " + C + " ", C = ""), k.type && (r += " } ", M && M === k.type && !A)) {
8985
9008
  r += " else { ";
8986
9009
  var u = e.schemaPath + ".type", v = e.errSchemaPath + "/type", E = E || [];
8987
- E.push(r), r = "", e.createErrors !== !1 ? (r += " { keyword: '" + (O || "type") + "' , dataPath: (dataPath || '') + " + e.errorPath + " , schemaPath: " + e.util.toQuotedString(v) + " , params: { type: '", R ? r += "" + I.join(",") : r += "" + I, r += "' } ", e.opts.messages !== !1 && (r += " , message: 'should be ", R ? r += "" + I.join(",") : r += "" + I, r += "' "), e.opts.verbose && (r += " , schema: validate.schema" + u + " , parentSchema: validate.schema" + e.schemaPath + " , data: " + g + " "), r += " } ") : r += " {} ";
9010
+ E.push(r), r = "", e.createErrors !== !1 ? (r += " { keyword: '" + (O || "type") + "' , dataPath: (dataPath || '') + " + e.errorPath + " , schemaPath: " + e.util.toQuotedString(v) + " , params: { type: '", R ? r += "" + M.join(",") : r += "" + M, r += "' } ", e.opts.messages !== !1 && (r += " , message: 'should be ", R ? r += "" + M.join(",") : r += "" + M, r += "' "), e.opts.verbose && (r += " , schema: validate.schema" + u + " , parentSchema: validate.schema" + e.schemaPath + " , data: " + g + " "), r += " } ") : r += " {} ";
8988
9011
  var y = r;
8989
9012
  r = E.pop(), !e.compositeRule && P ? e.async ? r += " throw new ValidationError([" + y + "]); " : r += " validate.errors = [" + y + "]; return false; " : r += " var err = " + y + "; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ", r += " } ";
8990
9013
  }
@@ -9014,7 +9037,7 @@ function fu() {
9014
9037
  var i = Vn(), e = Yr(), t = Gn(), a = Ji(), r = Wi(), n = e.ucs2length, o = zn(), s = t.Validation;
9015
9038
  na = l;
9016
9039
  function l(y, x, p, S) {
9017
- var P = this, C = this._opts, D = [void 0], O = {}, I = [], R = {}, M = [], k = {}, V = [];
9040
+ var P = this, C = this._opts, D = [void 0], O = {}, M = [], R = {}, A = [], k = {}, V = [];
9018
9041
  x = x || { schema: y, refVal: D, refs: O };
9019
9042
  var G = c.call(this, y, x, S), Z = this._compilations[G.index];
9020
9043
  if (G.compiling) return Z.callValidate = ae;
@@ -9058,7 +9081,7 @@ function fu() {
9058
9081
  logger: P.logger,
9059
9082
  self: P
9060
9083
  });
9061
- _ = E(D, v) + E(I, f) + E(M, u) + E(V, g) + _, C.processCode && (_ = C.processCode(_, z));
9084
+ _ = E(D, v) + E(M, f) + E(A, u) + E(V, g) + _, C.processCode && (_ = C.processCode(_, z));
9062
9085
  var m;
9063
9086
  try {
9064
9087
  var b = new Function(
@@ -9080,7 +9103,7 @@ function fu() {
9080
9103
  re,
9081
9104
  x,
9082
9105
  D,
9083
- M,
9106
+ A,
9084
9107
  V,
9085
9108
  o,
9086
9109
  n,
@@ -9091,8 +9114,8 @@ function fu() {
9091
9114
  }
9092
9115
  return m.schema = z, m.errors = null, m.refs = O, m.refVal = D, m.root = ue ? m : X, xe && (m.$async = !0), C.sourceCode === !0 && (m.source = {
9093
9116
  code: _,
9094
- patterns: I,
9095
- defaults: M
9117
+ patterns: M,
9118
+ defaults: A
9096
9119
  }), m;
9097
9120
  }
9098
9121
  function ce(z, X, fe) {
@@ -9132,7 +9155,7 @@ function fu() {
9132
9155
  }
9133
9156
  function B(z) {
9134
9157
  var X = R[z];
9135
- return X === void 0 && (X = R[z] = I.length, I[X] = z), "pattern" + X;
9158
+ return X === void 0 && (X = R[z] = M.length, M[X] = z), "pattern" + X;
9136
9159
  }
9137
9160
  function H(z) {
9138
9161
  switch (typeof z) {
@@ -9144,7 +9167,7 @@ function fu() {
9144
9167
  case "object":
9145
9168
  if (z === null) return "null";
9146
9169
  var X = a(z), fe = k[X];
9147
- return fe === void 0 && (fe = k[X] = M.length, M[fe] = z), "default" + fe;
9170
+ return fe === void 0 && (fe = k[X] = A.length, A[fe] = z), "default" + fe;
9148
9171
  }
9149
9172
  }
9150
9173
  function ie(z, X, fe, se) {
@@ -9299,14 +9322,14 @@ function hu() {
9299
9322
  function g(D) {
9300
9323
  var O = D.match(e);
9301
9324
  if (!O) return !1;
9302
- var I = +O[1], R = +O[2], M = +O[3];
9303
- return R >= 1 && R <= 12 && M >= 1 && M <= (R == 2 && v(I) ? 29 : t[R]);
9325
+ var M = +O[1], R = +O[2], A = +O[3];
9326
+ return R >= 1 && R <= 12 && A >= 1 && A <= (R == 2 && v(M) ? 29 : t[R]);
9304
9327
  }
9305
9328
  function E(D, O) {
9306
- var I = D.match(a);
9307
- if (!I) return !1;
9308
- var R = I[1], M = I[2], k = I[3], V = I[5];
9309
- return (R <= 23 && M <= 59 && k <= 59 || R == 23 && M == 59 && k == 60) && (!O || V);
9329
+ var M = D.match(a);
9330
+ if (!M) return !1;
9331
+ var R = M[1], A = M[2], k = M[3], V = M[5];
9332
+ return (R <= 23 && A <= 59 && k <= 59 || R == 23 && A == 59 && k == 60) && (!O || V);
9310
9333
  }
9311
9334
  var y = /t|\s/i;
9312
9335
  function x(D) {
@@ -9443,10 +9466,10 @@ function bu() {
9443
9466
  v.baseId = S, e.util.varOccurences(O, p) < 2 ? r += " " + e.util.varReplace(O, p, D) + " " : r += " var " + p + " = " + D + "; " + O + " ", r += " if (" + E + ") break; } ", e.compositeRule = v.compositeRule = C, r += " " + g + " if (!" + E + ") {";
9444
9467
  } else
9445
9468
  r += " if (" + h + ".length == 0) {";
9446
- var I = I || [];
9447
- I.push(r), r = "", e.createErrors !== !1 ? (r += " { keyword: 'contains' , dataPath: (dataPath || '') + " + e.errorPath + " , schemaPath: " + e.util.toQuotedString(c) + " , params: {} ", e.opts.messages !== !1 && (r += " , message: 'should contain a valid item' "), e.opts.verbose && (r += " , schema: validate.schema" + l + " , parentSchema: validate.schema" + e.schemaPath + " , data: " + h + " "), r += " } ") : r += " {} ";
9469
+ var M = M || [];
9470
+ M.push(r), r = "", e.createErrors !== !1 ? (r += " { keyword: 'contains' , dataPath: (dataPath || '') + " + e.errorPath + " , schemaPath: " + e.util.toQuotedString(c) + " , params: {} ", e.opts.messages !== !1 && (r += " , message: 'should contain a valid item' "), e.opts.verbose && (r += " , schema: validate.schema" + l + " , parentSchema: validate.schema" + e.schemaPath + " , data: " + h + " "), r += " } ") : r += " {} ";
9448
9471
  var R = r;
9449
- return r = I.pop(), !e.compositeRule && d ? e.async ? r += " throw new ValidationError([" + R + "]); " : r += " validate.errors = [" + R + "]; return false; " : r += " var err = " + R + "; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ", r += " } else { ", P && (r += " errors = " + u + "; if (vErrors !== null) { if (" + u + ") vErrors.length = " + u + "; else vErrors = null; } "), e.opts.allErrors && (r += " } "), r;
9472
+ return r = M.pop(), !e.compositeRule && d ? e.async ? r += " throw new ValidationError([" + R + "]); " : r += " validate.errors = [" + R + "]; return false; " : r += " var err = " + R + "; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ", r += " } else { ", P && (r += " errors = " + u + "; if (vErrors !== null) { if (" + u + ") vErrors.length = " + u + "; else vErrors = null; } "), e.opts.allErrors && (r += " } "), r;
9450
9473
  }), da;
9451
9474
  }
9452
9475
  var ha, Ws;
@@ -9469,10 +9492,10 @@ function wu() {
9469
9492
  r += " && ( ";
9470
9493
  var D = S;
9471
9494
  if (D)
9472
- for (var O, I = -1, R = D.length - 1; I < R; ) {
9473
- O = D[I += 1], I && (r += " || ");
9474
- var M = e.util.getProperty(O), k = h + M;
9475
- r += " ( ( " + k + " === undefined ", x && (r += " || ! Object.prototype.hasOwnProperty.call(" + h + ", '" + e.util.escapeQuotes(O) + "') "), r += ") && (missing" + n + " = " + e.util.toQuotedString(e.opts.jsonPointers ? O : M) + ") ) ";
9495
+ for (var O, M = -1, R = D.length - 1; M < R; ) {
9496
+ O = D[M += 1], M && (r += " || ");
9497
+ var A = e.util.getProperty(O), k = h + A;
9498
+ r += " ( ( " + k + " === undefined ", x && (r += " || ! Object.prototype.hasOwnProperty.call(" + h + ", '" + e.util.escapeQuotes(O) + "') "), r += ") && (missing" + n + " = " + e.util.toQuotedString(e.opts.jsonPointers ? O : A) + ") ) ";
9476
9499
  }
9477
9500
  r += ")) { ";
9478
9501
  var V = "missing" + n, G = "' + " + V + " + '";
@@ -9487,7 +9510,7 @@ function wu() {
9487
9510
  if (Y)
9488
9511
  for (var O, oe = -1, ee = Y.length - 1; oe < ee; ) {
9489
9512
  O = Y[oe += 1];
9490
- var M = e.util.getProperty(O), G = e.util.escapeQuotes(O), k = h + M;
9513
+ var A = e.util.getProperty(O), G = e.util.escapeQuotes(O), k = h + A;
9491
9514
  e.opts._errorDataPathProperty && (e.errorPath = e.util.getPath(P, O, e.opts.jsonPointers)), r += " if ( " + k + " === undefined ", x && (r += " || ! Object.prototype.hasOwnProperty.call(" + h + ", '" + e.util.escapeQuotes(O) + "') "), r += ") { var err = ", e.createErrors !== !1 ? (r += " { keyword: 'dependencies' , dataPath: (dataPath || '') + " + e.errorPath + " , schemaPath: " + e.util.toQuotedString(c) + " , params: { property: '" + e.util.escapeQuotes(C) + "', missingProperty: '" + G + "', depsCount: " + S.length + ", deps: '" + e.util.escapeQuotes(S.length == 1 ? S[0] : S.join(", ")) + "' } ", e.opts.messages !== !1 && (r += " , message: 'should have ", S.length == 1 ? r += "property " + e.util.escapeQuotes(S[0]) : r += "properties " + e.util.escapeQuotes(S.join(", ")), r += " when property " + e.util.escapeQuotes(C) + " is present' "), e.opts.verbose && (r += " , schema: validate.schema" + l + " , parentSchema: validate.schema" + e.schemaPath + " , data: " + h + " "), r += " } ") : r += " {} ", r += "; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } ";
9492
9515
  }
9493
9516
  }
@@ -9592,13 +9615,13 @@ function Pu() {
9592
9615
  var O = r;
9593
9616
  r = D.pop(), !e.compositeRule && d ? e.async ? r += " throw new ValidationError([" + O + "]); " : r += " validate.errors = [" + O + "]; return false; " : r += " var err = " + O + "; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ", r += " } ", c = C, d && (g += "}", r += " else { ");
9594
9617
  }
9595
- var I = s;
9596
- if (I) {
9597
- for (var R, M = -1, k = I.length - 1; M < k; )
9598
- if (R = I[M += 1], e.opts.strictKeywords ? typeof R == "object" && Object.keys(R).length > 0 || R === !1 : e.util.schemaHasRules(R, e.RULES.all)) {
9599
- r += " " + E + " = true; if (" + h + ".length > " + M + ") { ";
9600
- var V = h + "[" + M + "]";
9601
- v.schema = R, v.schemaPath = l + "[" + M + "]", v.errSchemaPath = c + "/" + M, v.errorPath = e.util.getPathExpr(e.errorPath, M, e.opts.jsonPointers, !0), v.dataPathArr[x] = M;
9618
+ var M = s;
9619
+ if (M) {
9620
+ for (var R, A = -1, k = M.length - 1; A < k; )
9621
+ if (R = M[A += 1], e.opts.strictKeywords ? typeof R == "object" && Object.keys(R).length > 0 || R === !1 : e.util.schemaHasRules(R, e.RULES.all)) {
9622
+ r += " " + E + " = true; if (" + h + ".length > " + A + ") { ";
9623
+ var V = h + "[" + A + "]";
9624
+ v.schema = R, v.schemaPath = l + "[" + A + "]", v.errSchemaPath = c + "/" + A, v.errorPath = e.util.getPathExpr(e.errorPath, A, e.opts.jsonPointers, !0), v.dataPathArr[x] = A;
9602
9625
  var G = e.validate(v);
9603
9626
  v.baseId = S, e.util.varOccurences(G, p) < 2 ? r += " " + e.util.varReplace(G, p, V) + " " : r += " var " + p + " = " + V + "; " + G + " ", r += " } ", d && (r += " if (" + E + ") { ", g += "}");
9604
9627
  }
@@ -9631,28 +9654,28 @@ function eo() {
9631
9654
  if (!(y || E === void 0 || typeof E == "number" || typeof E == "boolean"))
9632
9655
  throw new Error(g + " must be number or boolean");
9633
9656
  if (y) {
9634
- var P = e.util.getData(E.$data, o, e.dataPathArr), C = "exclusive" + n, D = "exclType" + n, O = "exclIsNumber" + n, I = "op" + n, R = "' + " + I + " + '";
9657
+ var P = e.util.getData(E.$data, o, e.dataPathArr), C = "exclusive" + n, D = "exclType" + n, O = "exclIsNumber" + n, M = "op" + n, R = "' + " + M + " + '";
9635
9658
  r += " var schemaExcl" + n + " = " + P + "; ", P = "schemaExcl" + n, r += " var " + C + "; var " + D + " = typeof " + P + "; if (" + D + " != 'boolean' && " + D + " != 'undefined' && " + D + " != 'number') { ";
9636
- var S = g, M = M || [];
9637
- M.push(r), r = "", e.createErrors !== !1 ? (r += " { keyword: '" + (S || "_exclusiveLimit") + "' , dataPath: (dataPath || '') + " + e.errorPath + " , schemaPath: " + e.util.toQuotedString(c) + " , params: {} ", e.opts.messages !== !1 && (r += " , message: '" + g + " should be boolean' "), e.opts.verbose && (r += " , schema: validate.schema" + l + " , parentSchema: validate.schema" + e.schemaPath + " , data: " + h + " "), r += " } ") : r += " {} ";
9659
+ var S = g, A = A || [];
9660
+ A.push(r), r = "", e.createErrors !== !1 ? (r += " { keyword: '" + (S || "_exclusiveLimit") + "' , dataPath: (dataPath || '') + " + e.errorPath + " , schemaPath: " + e.util.toQuotedString(c) + " , params: {} ", e.opts.messages !== !1 && (r += " , message: '" + g + " should be boolean' "), e.opts.verbose && (r += " , schema: validate.schema" + l + " , parentSchema: validate.schema" + e.schemaPath + " , data: " + h + " "), r += " } ") : r += " {} ";
9638
9661
  var k = r;
9639
- r = M.pop(), !e.compositeRule && d ? e.async ? r += " throw new ValidationError([" + k + "]); " : r += " validate.errors = [" + k + "]; return false; " : r += " var err = " + k + "; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ", r += " } else if ( ", f && (r += " (" + u + " !== undefined && typeof " + u + " != 'number') || "), r += " " + D + " == 'number' ? ( (" + C + " = " + u + " === undefined || " + P + " " + x + "= " + u + ") ? " + h + " " + p + "= " + P + " : " + h + " " + p + " " + u + " ) : ( (" + C + " = " + P + " === true) ? " + h + " " + p + "= " + u + " : " + h + " " + p + " " + u + " ) || " + h + " !== " + h + ") { var op" + n + " = " + C + " ? '" + x + "' : '" + x + "='; ", s === void 0 && (S = g, c = e.errSchemaPath + "/" + g, u = P, f = y);
9662
+ r = A.pop(), !e.compositeRule && d ? e.async ? r += " throw new ValidationError([" + k + "]); " : r += " validate.errors = [" + k + "]; return false; " : r += " var err = " + k + "; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ", r += " } else if ( ", f && (r += " (" + u + " !== undefined && typeof " + u + " != 'number') || "), r += " " + D + " == 'number' ? ( (" + C + " = " + u + " === undefined || " + P + " " + x + "= " + u + ") ? " + h + " " + p + "= " + P + " : " + h + " " + p + " " + u + " ) : ( (" + C + " = " + P + " === true) ? " + h + " " + p + "= " + u + " : " + h + " " + p + " " + u + " ) || " + h + " !== " + h + ") { var op" + n + " = " + C + " ? '" + x + "' : '" + x + "='; ", s === void 0 && (S = g, c = e.errSchemaPath + "/" + g, u = P, f = y);
9640
9663
  } else {
9641
9664
  var O = typeof E == "number", R = x;
9642
9665
  if (O && f) {
9643
- var I = "'" + R + "'";
9666
+ var M = "'" + R + "'";
9644
9667
  r += " if ( ", f && (r += " (" + u + " !== undefined && typeof " + u + " != 'number') || "), r += " ( " + u + " === undefined || " + E + " " + x + "= " + u + " ? " + h + " " + p + "= " + E + " : " + h + " " + p + " " + u + " ) || " + h + " !== " + h + ") { ";
9645
9668
  } else {
9646
9669
  O && s === void 0 ? (C = !0, S = g, c = e.errSchemaPath + "/" + g, u = E, p += "=") : (O && (u = Math[v ? "min" : "max"](E, s)), E === (O ? u : !0) ? (C = !0, S = g, c = e.errSchemaPath + "/" + g, p += "=") : (C = !1, R += "="));
9647
- var I = "'" + R + "'";
9670
+ var M = "'" + R + "'";
9648
9671
  r += " if ( ", f && (r += " (" + u + " !== undefined && typeof " + u + " != 'number') || "), r += " " + h + " " + p + " " + u + " || " + h + " !== " + h + ") { ";
9649
9672
  }
9650
9673
  }
9651
9674
  S = S || t;
9652
- var M = M || [];
9653
- M.push(r), r = "", e.createErrors !== !1 ? (r += " { keyword: '" + (S || "_limit") + "' , dataPath: (dataPath || '') + " + e.errorPath + " , schemaPath: " + e.util.toQuotedString(c) + " , params: { comparison: " + I + ", limit: " + u + ", exclusive: " + C + " } ", e.opts.messages !== !1 && (r += " , message: 'should be " + R + " ", f ? r += "' + " + u : r += "" + u + "'"), e.opts.verbose && (r += " , schema: ", f ? r += "validate.schema" + l : r += "" + s, r += " , parentSchema: validate.schema" + e.schemaPath + " , data: " + h + " "), r += " } ") : r += " {} ";
9675
+ var A = A || [];
9676
+ A.push(r), r = "", e.createErrors !== !1 ? (r += " { keyword: '" + (S || "_limit") + "' , dataPath: (dataPath || '') + " + e.errorPath + " , schemaPath: " + e.util.toQuotedString(c) + " , params: { comparison: " + M + ", limit: " + u + ", exclusive: " + C + " } ", e.opts.messages !== !1 && (r += " , message: 'should be " + R + " ", f ? r += "' + " + u : r += "" + u + "'"), e.opts.verbose && (r += " , schema: ", f ? r += "validate.schema" + l : r += "" + s, r += " , parentSchema: validate.schema" + e.schemaPath + " , data: " + h + " "), r += " } ") : r += " {} ";
9654
9677
  var k = r;
9655
- return r = M.pop(), !e.compositeRule && d ? e.async ? r += " throw new ValidationError([" + k + "]); " : r += " validate.errors = [" + k + "]; return false; " : r += " var err = " + k + "; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ", r += " } ", d && (r += " else { "), r;
9678
+ return r = A.pop(), !e.compositeRule && d ? e.async ? r += " throw new ValidationError([" + k + "]); " : r += " validate.errors = [" + k + "]; return false; " : r += " var err = " + k + "; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ", r += " } ", d && (r += " else { "), r;
9656
9679
  }), ya;
9657
9680
  }
9658
9681
  var ba, ro;
@@ -9765,14 +9788,14 @@ function Ru() {
9765
9788
  return fo || (fo = 1, Ca = function(e, t, a) {
9766
9789
  var r = " ", n = e.level, o = e.dataLevel, s = e.schema[t], l = e.schemaPath + e.util.getProperty(t), c = e.errSchemaPath + "/" + t, d = !e.opts.allErrors, h = "data" + (o || ""), f = "errs__" + n, u = e.util.copy(e), v = "";
9767
9790
  u.level++;
9768
- var g = "valid" + u.level, E = "key" + n, y = "idx" + n, x = u.dataLevel = e.dataLevel + 1, p = "data" + x, S = "dataProperties" + n, P = Object.keys(s || {}).filter(oe), C = e.schema.patternProperties || {}, D = Object.keys(C).filter(oe), O = e.schema.additionalProperties, I = P.length || D.length, R = O === !1, M = typeof O == "object" && Object.keys(O).length, k = e.opts.removeAdditional, V = R || M || k, G = e.opts.ownProperties, Z = e.baseId, re = e.schema.required;
9791
+ var g = "valid" + u.level, E = "key" + n, y = "idx" + n, x = u.dataLevel = e.dataLevel + 1, p = "data" + x, S = "dataProperties" + n, P = Object.keys(s || {}).filter(oe), C = e.schema.patternProperties || {}, D = Object.keys(C).filter(oe), O = e.schema.additionalProperties, M = P.length || D.length, R = O === !1, A = typeof O == "object" && Object.keys(O).length, k = e.opts.removeAdditional, V = R || A || k, G = e.opts.ownProperties, Z = e.baseId, re = e.schema.required;
9769
9792
  if (re && !(e.opts.$data && re.$data) && re.length < e.opts.loopRequired)
9770
9793
  var Y = e.util.toHash(re);
9771
9794
  function oe(De) {
9772
9795
  return De !== "__proto__";
9773
9796
  }
9774
9797
  if (r += "var " + f + " = errors;var " + g + " = true;", G && (r += " var " + S + " = undefined;"), V) {
9775
- if (G ? r += " " + S + " = " + S + " || Object.keys(" + h + "); for (var " + y + "=0; " + y + "<" + S + ".length; " + y + "++) { var " + E + " = " + S + "[" + y + "]; " : r += " for (var " + E + " in " + h + ") { ", I) {
9798
+ if (G ? r += " " + S + " = " + S + " || Object.keys(" + h + "); for (var " + y + "=0; " + y + "<" + S + ".length; " + y + "++) { var " + E + " = " + S + "[" + y + "]; " : r += " for (var " + E + " in " + h + ") { ", M) {
9776
9799
  if (r += " var isAdditional" + n + " = !(false ", P.length)
9777
9800
  if (P.length > 8)
9778
9801
  r += " || validate.schema" + l + ".hasOwnProperty(" + E + ") ";
@@ -9806,7 +9829,7 @@ function Ru() {
9806
9829
  var X = r;
9807
9830
  r = z.pop(), !e.compositeRule && d ? e.async ? r += " throw new ValidationError([" + X + "]); " : r += " validate.errors = [" + X + "]; return false; " : r += " var err = " + X + "; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ", c = ie, d && (r += " break; ");
9808
9831
  }
9809
- else if (M)
9832
+ else if (A)
9810
9833
  if (k == "failing") {
9811
9834
  r += " var " + f + " = errors; ";
9812
9835
  var fe = e.compositeRule;
@@ -9824,7 +9847,7 @@ function Ru() {
9824
9847
  }
9825
9848
  e.errorPath = B;
9826
9849
  }
9827
- I && (r += " } "), r += " } ", d && (r += " if (" + g + ") { ", v += "}");
9850
+ M && (r += " } "), r += " } ", d && (r += " if (" + g + ") { ", v += "}");
9828
9851
  }
9829
9852
  var xe = e.opts.useDefaults && !e.compositeRule;
9830
9853
  if (P.length) {
@@ -9891,10 +9914,10 @@ function Du() {
9891
9914
  u.schema = s, u.schemaPath = l, u.errSchemaPath = c;
9892
9915
  var E = "key" + n, y = "idx" + n, x = "i" + n, p = "' + " + E + " + '", S = u.dataLevel = e.dataLevel + 1, P = "data" + S, C = "dataProperties" + n, D = e.opts.ownProperties, O = e.baseId;
9893
9916
  D && (r += " var " + C + " = undefined; "), D ? r += " " + C + " = " + C + " || Object.keys(" + h + "); for (var " + y + "=0; " + y + "<" + C + ".length; " + y + "++) { var " + E + " = " + C + "[" + y + "]; " : r += " for (var " + E + " in " + h + ") { ", r += " var startErrs" + n + " = errors; ";
9894
- var I = E, R = e.compositeRule;
9917
+ var M = E, R = e.compositeRule;
9895
9918
  e.compositeRule = u.compositeRule = !0;
9896
- var M = e.validate(u);
9897
- u.baseId = O, e.util.varOccurences(M, P) < 2 ? r += " " + e.util.varReplace(M, P, I) + " " : r += " var " + P + " = " + I + "; " + M + " ", e.compositeRule = u.compositeRule = R, r += " if (!" + g + ") { for (var " + x + "=startErrs" + n + "; " + x + "<errors; " + x + "++) { vErrors[" + x + "].propertyName = " + E + "; } var err = ", e.createErrors !== !1 ? (r += " { keyword: 'propertyNames' , dataPath: (dataPath || '') + " + e.errorPath + " , schemaPath: " + e.util.toQuotedString(c) + " , params: { propertyName: '" + p + "' } ", e.opts.messages !== !1 && (r += " , message: 'property name \\'" + p + "\\' is invalid' "), e.opts.verbose && (r += " , schema: validate.schema" + l + " , parentSchema: validate.schema" + e.schemaPath + " , data: " + h + " "), r += " } ") : r += " {} ", r += "; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ", !e.compositeRule && d && (e.async ? r += " throw new ValidationError(vErrors); " : r += " validate.errors = vErrors; return false; "), d && (r += " break; "), r += " } }";
9919
+ var A = e.validate(u);
9920
+ u.baseId = O, e.util.varOccurences(A, P) < 2 ? r += " " + e.util.varReplace(A, P, M) + " " : r += " var " + P + " = " + M + "; " + A + " ", e.compositeRule = u.compositeRule = R, r += " if (!" + g + ") { for (var " + x + "=startErrs" + n + "; " + x + "<errors; " + x + "++) { vErrors[" + x + "].propertyName = " + E + "; } var err = ", e.createErrors !== !1 ? (r += " { keyword: 'propertyNames' , dataPath: (dataPath || '') + " + e.errorPath + " , schemaPath: " + e.util.toQuotedString(c) + " , params: { propertyName: '" + p + "' } ", e.opts.messages !== !1 && (r += " , message: 'property name \\'" + p + "\\' is invalid' "), e.opts.verbose && (r += " , schema: validate.schema" + l + " , parentSchema: validate.schema" + e.schemaPath + " , data: " + h + " "), r += " } ") : r += " {} ", r += "; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ", !e.compositeRule && d && (e.async ? r += " throw new ValidationError(vErrors); " : r += " validate.errors = vErrors; return false; "), d && (r += " break; "), r += " } }";
9898
9921
  }
9899
9922
  return d && (r += " " + v + " if (" + f + " == errors) {"), r;
9900
9923
  }), $a;
@@ -9921,12 +9944,12 @@ function Ou() {
9921
9944
  if (d)
9922
9945
  if (r += " var missing" + n + "; ", C) {
9923
9946
  u || (r += " var " + v + " = validate.schema" + l + "; ");
9924
- var O = "i" + n, I = "schema" + n + "[" + O + "]", R = "' + " + I + " + '";
9925
- e.opts._errorDataPathProperty && (e.errorPath = e.util.getPathExpr(P, I, e.opts.jsonPointers)), r += " var " + f + " = true; ", u && (r += " if (schema" + n + " === undefined) " + f + " = true; else if (!Array.isArray(schema" + n + ")) " + f + " = false; else {"), r += " for (var " + O + " = 0; " + O + " < " + v + ".length; " + O + "++) { " + f + " = " + h + "[" + v + "[" + O + "]] !== undefined ", D && (r += " && Object.prototype.hasOwnProperty.call(" + h + ", " + v + "[" + O + "]) "), r += "; if (!" + f + ") break; } ", u && (r += " } "), r += " if (!" + f + ") { ";
9926
- var M = M || [];
9927
- M.push(r), r = "", e.createErrors !== !1 ? (r += " { keyword: 'required' , dataPath: (dataPath || '') + " + e.errorPath + " , schemaPath: " + e.util.toQuotedString(c) + " , params: { missingProperty: '" + R + "' } ", e.opts.messages !== !1 && (r += " , message: '", e.opts._errorDataPathProperty ? r += "is a required property" : r += "should have required property \\'" + R + "\\'", r += "' "), e.opts.verbose && (r += " , schema: validate.schema" + l + " , parentSchema: validate.schema" + e.schemaPath + " , data: " + h + " "), r += " } ") : r += " {} ";
9947
+ var O = "i" + n, M = "schema" + n + "[" + O + "]", R = "' + " + M + " + '";
9948
+ e.opts._errorDataPathProperty && (e.errorPath = e.util.getPathExpr(P, M, e.opts.jsonPointers)), r += " var " + f + " = true; ", u && (r += " if (schema" + n + " === undefined) " + f + " = true; else if (!Array.isArray(schema" + n + ")) " + f + " = false; else {"), r += " for (var " + O + " = 0; " + O + " < " + v + ".length; " + O + "++) { " + f + " = " + h + "[" + v + "[" + O + "]] !== undefined ", D && (r += " && Object.prototype.hasOwnProperty.call(" + h + ", " + v + "[" + O + "]) "), r += "; if (!" + f + ") break; } ", u && (r += " } "), r += " if (!" + f + ") { ";
9949
+ var A = A || [];
9950
+ A.push(r), r = "", e.createErrors !== !1 ? (r += " { keyword: 'required' , dataPath: (dataPath || '') + " + e.errorPath + " , schemaPath: " + e.util.toQuotedString(c) + " , params: { missingProperty: '" + R + "' } ", e.opts.messages !== !1 && (r += " , message: '", e.opts._errorDataPathProperty ? r += "is a required property" : r += "should have required property \\'" + R + "\\'", r += "' "), e.opts.verbose && (r += " , schema: validate.schema" + l + " , parentSchema: validate.schema" + e.schemaPath + " , data: " + h + " "), r += " } ") : r += " {} ";
9928
9951
  var k = r;
9929
- r = M.pop(), !e.compositeRule && d ? e.async ? r += " throw new ValidationError([" + k + "]); " : r += " validate.errors = [" + k + "]; return false; " : r += " var err = " + k + "; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ", r += " } else { ";
9952
+ r = A.pop(), !e.compositeRule && d ? e.async ? r += " throw new ValidationError([" + k + "]); " : r += " validate.errors = [" + k + "]; return false; " : r += " var err = " + k + "; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ", r += " } else { ";
9930
9953
  } else {
9931
9954
  r += " if ( ";
9932
9955
  var V = g;
@@ -9937,17 +9960,17 @@ function Ou() {
9937
9960
  r += " ( ( " + Y + " === undefined ", D && (r += " || ! Object.prototype.hasOwnProperty.call(" + h + ", '" + e.util.escapeQuotes(G) + "') "), r += ") && (missing" + n + " = " + e.util.toQuotedString(e.opts.jsonPointers ? G : re) + ") ) ";
9938
9961
  }
9939
9962
  r += ") { ";
9940
- var I = "missing" + n, R = "' + " + I + " + '";
9941
- e.opts._errorDataPathProperty && (e.errorPath = e.opts.jsonPointers ? e.util.getPathExpr(P, I, !0) : P + " + " + I);
9942
- var M = M || [];
9943
- M.push(r), r = "", e.createErrors !== !1 ? (r += " { keyword: 'required' , dataPath: (dataPath || '') + " + e.errorPath + " , schemaPath: " + e.util.toQuotedString(c) + " , params: { missingProperty: '" + R + "' } ", e.opts.messages !== !1 && (r += " , message: '", e.opts._errorDataPathProperty ? r += "is a required property" : r += "should have required property \\'" + R + "\\'", r += "' "), e.opts.verbose && (r += " , schema: validate.schema" + l + " , parentSchema: validate.schema" + e.schemaPath + " , data: " + h + " "), r += " } ") : r += " {} ";
9963
+ var M = "missing" + n, R = "' + " + M + " + '";
9964
+ e.opts._errorDataPathProperty && (e.errorPath = e.opts.jsonPointers ? e.util.getPathExpr(P, M, !0) : P + " + " + M);
9965
+ var A = A || [];
9966
+ A.push(r), r = "", e.createErrors !== !1 ? (r += " { keyword: 'required' , dataPath: (dataPath || '') + " + e.errorPath + " , schemaPath: " + e.util.toQuotedString(c) + " , params: { missingProperty: '" + R + "' } ", e.opts.messages !== !1 && (r += " , message: '", e.opts._errorDataPathProperty ? r += "is a required property" : r += "should have required property \\'" + R + "\\'", r += "' "), e.opts.verbose && (r += " , schema: validate.schema" + l + " , parentSchema: validate.schema" + e.schemaPath + " , data: " + h + " "), r += " } ") : r += " {} ";
9944
9967
  var k = r;
9945
- r = M.pop(), !e.compositeRule && d ? e.async ? r += " throw new ValidationError([" + k + "]); " : r += " validate.errors = [" + k + "]; return false; " : r += " var err = " + k + "; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ", r += " } else { ";
9968
+ r = A.pop(), !e.compositeRule && d ? e.async ? r += " throw new ValidationError([" + k + "]); " : r += " validate.errors = [" + k + "]; return false; " : r += " var err = " + k + "; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ", r += " } else { ";
9946
9969
  }
9947
9970
  else if (C) {
9948
9971
  u || (r += " var " + v + " = validate.schema" + l + "; ");
9949
- var O = "i" + n, I = "schema" + n + "[" + O + "]", R = "' + " + I + " + '";
9950
- e.opts._errorDataPathProperty && (e.errorPath = e.util.getPathExpr(P, I, e.opts.jsonPointers)), u && (r += " if (" + v + " && !Array.isArray(" + v + ")) { var err = ", e.createErrors !== !1 ? (r += " { keyword: 'required' , dataPath: (dataPath || '') + " + e.errorPath + " , schemaPath: " + e.util.toQuotedString(c) + " , params: { missingProperty: '" + R + "' } ", e.opts.messages !== !1 && (r += " , message: '", e.opts._errorDataPathProperty ? r += "is a required property" : r += "should have required property \\'" + R + "\\'", r += "' "), e.opts.verbose && (r += " , schema: validate.schema" + l + " , parentSchema: validate.schema" + e.schemaPath + " , data: " + h + " "), r += " } ") : r += " {} ", r += "; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } else if (" + v + " !== undefined) { "), r += " for (var " + O + " = 0; " + O + " < " + v + ".length; " + O + "++) { if (" + h + "[" + v + "[" + O + "]] === undefined ", D && (r += " || ! Object.prototype.hasOwnProperty.call(" + h + ", " + v + "[" + O + "]) "), r += ") { var err = ", e.createErrors !== !1 ? (r += " { keyword: 'required' , dataPath: (dataPath || '') + " + e.errorPath + " , schemaPath: " + e.util.toQuotedString(c) + " , params: { missingProperty: '" + R + "' } ", e.opts.messages !== !1 && (r += " , message: '", e.opts._errorDataPathProperty ? r += "is a required property" : r += "should have required property \\'" + R + "\\'", r += "' "), e.opts.verbose && (r += " , schema: validate.schema" + l + " , parentSchema: validate.schema" + e.schemaPath + " , data: " + h + " "), r += " } ") : r += " {} ", r += "; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } } ", u && (r += " } ");
9972
+ var O = "i" + n, M = "schema" + n + "[" + O + "]", R = "' + " + M + " + '";
9973
+ e.opts._errorDataPathProperty && (e.errorPath = e.util.getPathExpr(P, M, e.opts.jsonPointers)), u && (r += " if (" + v + " && !Array.isArray(" + v + ")) { var err = ", e.createErrors !== !1 ? (r += " { keyword: 'required' , dataPath: (dataPath || '') + " + e.errorPath + " , schemaPath: " + e.util.toQuotedString(c) + " , params: { missingProperty: '" + R + "' } ", e.opts.messages !== !1 && (r += " , message: '", e.opts._errorDataPathProperty ? r += "is a required property" : r += "should have required property \\'" + R + "\\'", r += "' "), e.opts.verbose && (r += " , schema: validate.schema" + l + " , parentSchema: validate.schema" + e.schemaPath + " , data: " + h + " "), r += " } ") : r += " {} ", r += "; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } else if (" + v + " !== undefined) { "), r += " for (var " + O + " = 0; " + O + " < " + v + ".length; " + O + "++) { if (" + h + "[" + v + "[" + O + "]] === undefined ", D && (r += " || ! Object.prototype.hasOwnProperty.call(" + h + ", " + v + "[" + O + "]) "), r += ") { var err = ", e.createErrors !== !1 ? (r += " { keyword: 'required' , dataPath: (dataPath || '') + " + e.errorPath + " , schemaPath: " + e.util.toQuotedString(c) + " , params: { missingProperty: '" + R + "' } ", e.opts.messages !== !1 && (r += " , message: '", e.opts._errorDataPathProperty ? r += "is a required property" : r += "should have required property \\'" + R + "\\'", r += "' "), e.opts.verbose && (r += " , schema: validate.schema" + l + " , parentSchema: validate.schema" + e.schemaPath + " , data: " + h + " "), r += " } ") : r += " {} ", r += "; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } } ", u && (r += " } ");
9951
9974
  } else {
9952
9975
  var oe = g;
9953
9976
  if (oe)
@@ -10201,18 +10224,18 @@ function Nu() {
10201
10224
  return wo || (wo = 1, Ia = function(e, t, a) {
10202
10225
  var r = " ", n = e.level, o = e.dataLevel, s = e.schema[t], l = e.schemaPath + e.util.getProperty(t), c = e.errSchemaPath + "/" + t, d = !e.opts.allErrors, h, f = "data" + (o || ""), u = "valid" + n, v = "errs__" + n, g = e.opts.$data && s && s.$data, E;
10203
10226
  g ? (r += " var schema" + n + " = " + e.util.getData(s.$data, o, e.dataPathArr) + "; ", E = "schema" + n) : E = s;
10204
- var y = this, x = "definition" + n, p = y.definition, S = "", P, C, D, O, I;
10227
+ var y = this, x = "definition" + n, p = y.definition, S = "", P, C, D, O, M;
10205
10228
  if (g && p.$data) {
10206
- I = "keywordValidate" + n;
10229
+ M = "keywordValidate" + n;
10207
10230
  var R = p.validateSchema;
10208
- r += " var " + x + " = RULES.custom['" + t + "'].definition; var " + I + " = " + x + ".validate;";
10231
+ r += " var " + x + " = RULES.custom['" + t + "'].definition; var " + M + " = " + x + ".validate;";
10209
10232
  } else {
10210
10233
  if (O = e.useCustomRule(y, s, e.schema, e), !O) return;
10211
- E = "validate.schema" + l, I = O.code, P = p.compile, C = p.inline, D = p.macro;
10234
+ E = "validate.schema" + l, M = O.code, P = p.compile, C = p.inline, D = p.macro;
10212
10235
  }
10213
- var M = I + ".errors", k = "i" + n, V = "ruleErr" + n, G = p.async;
10236
+ var A = M + ".errors", k = "i" + n, V = "ruleErr" + n, G = p.async;
10214
10237
  if (G && !e.async) throw new Error("async keyword in sync schema");
10215
- if (C || D || (r += "" + M + " = null;"), r += "var " + v + " = errors;var " + u + ";", g && p.$data && (S += "}", r += " if (" + E + " === undefined) { " + u + " = true; } else { ", R && (S += "}", r += " " + u + " = " + x + ".validateSchema(" + E + "); if (" + u + ") { ")), C)
10238
+ if (C || D || (r += "" + A + " = null;"), r += "var " + v + " = errors;var " + u + ";", g && p.$data && (S += "}", r += " if (" + E + " === undefined) { " + u + " = true; } else { ", R && (S += "}", r += " " + u + " = " + x + ".validateSchema(" + E + "); if (" + u + ") { ")), C)
10216
10239
  p.statements ? r += " " + O.validate + " " : r += " " + u + " = " + O.validate + "; ";
10217
10240
  else if (D) {
10218
10241
  var Z = e.util.copy(e), S = "";
@@ -10221,15 +10244,15 @@ function Nu() {
10221
10244
  Z.schema = O.validate, Z.schemaPath = "";
10222
10245
  var Y = e.compositeRule;
10223
10246
  e.compositeRule = Z.compositeRule = !0;
10224
- var oe = e.validate(Z).replace(/validate\.schema/g, I);
10247
+ var oe = e.validate(Z).replace(/validate\.schema/g, M);
10225
10248
  e.compositeRule = Z.compositeRule = Y, r += " " + oe;
10226
10249
  } else {
10227
10250
  var ee = ee || [];
10228
- ee.push(r), r = "", r += " " + I + ".call( ", e.opts.passContext ? r += "this" : r += "self", P || p.schema === !1 ? r += " , " + f + " " : r += " , " + E + " , " + f + " , validate.schema" + e.schemaPath + " ", r += " , (dataPath || '')", e.errorPath != '""' && (r += " + " + e.errorPath);
10251
+ ee.push(r), r = "", r += " " + M + ".call( ", e.opts.passContext ? r += "this" : r += "self", P || p.schema === !1 ? r += " , " + f + " " : r += " , " + E + " , " + f + " , validate.schema" + e.schemaPath + " ", r += " , (dataPath || '')", e.errorPath != '""' && (r += " + " + e.errorPath);
10229
10252
  var ae = o ? "data" + (o - 1 || "") : "parentData", ne = o ? e.dataPathArr[o] : "parentDataProperty";
10230
10253
  r += " , " + ae + " , " + ne + " , rootData ) ";
10231
10254
  var ce = r;
10232
- r = ee.pop(), p.errors === !1 ? (r += " " + u + " = ", G && (r += "await "), r += "" + ce + "; ") : G ? (M = "customErrors" + n, r += " var " + M + " = null; try { " + u + " = await " + ce + "; } catch (e) { " + u + " = false; if (e instanceof ValidationError) " + M + " = e.errors; else throw e; } ") : r += " " + M + " = null; " + u + " = " + ce + "; ";
10255
+ r = ee.pop(), p.errors === !1 ? (r += " " + u + " = ", G && (r += "await "), r += "" + ce + "; ") : G ? (A = "customErrors" + n, r += " var " + A + " = null; try { " + u + " = await " + ce + "; } catch (e) { " + u + " = false; if (e instanceof ValidationError) " + A + " = e.errors; else throw e; } ") : r += " " + A + " = null; " + u + " = " + ce + "; ";
10233
10256
  }
10234
10257
  if (p.modifying && (r += " if (" + ae + ") " + f + " = " + ae + "[" + ne + "];"), r += "" + S, p.valid)
10235
10258
  d && (r += " if (true) { ");
@@ -10242,7 +10265,7 @@ function Nu() {
10242
10265
  var me = r;
10243
10266
  r = ee.pop(), !e.compositeRule && d ? e.async ? r += " throw new ValidationError([" + me + "]); " : r += " validate.errors = [" + me + "]; return false; " : r += " var err = " + me + "; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";
10244
10267
  var we = r;
10245
- r = ee.pop(), C ? p.errors ? p.errors != "full" && (r += " for (var " + k + "=" + v + "; " + k + "<errors; " + k + "++) { var " + V + " = vErrors[" + k + "]; if (" + V + ".dataPath === undefined) " + V + ".dataPath = (dataPath || '') + " + e.errorPath + "; if (" + V + ".schemaPath === undefined) { " + V + '.schemaPath = "' + c + '"; } ', e.opts.verbose && (r += " " + V + ".schema = " + E + "; " + V + ".data = " + f + "; "), r += " } ") : p.errors === !1 ? r += " " + we + " " : (r += " if (" + v + " == errors) { " + we + " } else { for (var " + k + "=" + v + "; " + k + "<errors; " + k + "++) { var " + V + " = vErrors[" + k + "]; if (" + V + ".dataPath === undefined) " + V + ".dataPath = (dataPath || '') + " + e.errorPath + "; if (" + V + ".schemaPath === undefined) { " + V + '.schemaPath = "' + c + '"; } ', e.opts.verbose && (r += " " + V + ".schema = " + E + "; " + V + ".data = " + f + "; "), r += " } } ") : D ? (r += " var err = ", e.createErrors !== !1 ? (r += " { keyword: '" + (h || "custom") + "' , dataPath: (dataPath || '') + " + e.errorPath + " , schemaPath: " + e.util.toQuotedString(c) + " , params: { keyword: '" + y.keyword + "' } ", e.opts.messages !== !1 && (r += ` , message: 'should pass "` + y.keyword + `" keyword validation' `), e.opts.verbose && (r += " , schema: validate.schema" + l + " , parentSchema: validate.schema" + e.schemaPath + " , data: " + f + " "), r += " } ") : r += " {} ", r += "; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ", !e.compositeRule && d && (e.async ? r += " throw new ValidationError(vErrors); " : r += " validate.errors = vErrors; return false; ")) : p.errors === !1 ? r += " " + we + " " : (r += " if (Array.isArray(" + M + ")) { if (vErrors === null) vErrors = " + M + "; else vErrors = vErrors.concat(" + M + "); errors = vErrors.length; for (var " + k + "=" + v + "; " + k + "<errors; " + k + "++) { var " + V + " = vErrors[" + k + "]; if (" + V + ".dataPath === undefined) " + V + ".dataPath = (dataPath || '') + " + e.errorPath + "; " + V + '.schemaPath = "' + c + '"; ', e.opts.verbose && (r += " " + V + ".schema = " + E + "; " + V + ".data = " + f + "; "), r += " } } else { " + we + " } "), r += " } ", d && (r += " else { ");
10268
+ r = ee.pop(), C ? p.errors ? p.errors != "full" && (r += " for (var " + k + "=" + v + "; " + k + "<errors; " + k + "++) { var " + V + " = vErrors[" + k + "]; if (" + V + ".dataPath === undefined) " + V + ".dataPath = (dataPath || '') + " + e.errorPath + "; if (" + V + ".schemaPath === undefined) { " + V + '.schemaPath = "' + c + '"; } ', e.opts.verbose && (r += " " + V + ".schema = " + E + "; " + V + ".data = " + f + "; "), r += " } ") : p.errors === !1 ? r += " " + we + " " : (r += " if (" + v + " == errors) { " + we + " } else { for (var " + k + "=" + v + "; " + k + "<errors; " + k + "++) { var " + V + " = vErrors[" + k + "]; if (" + V + ".dataPath === undefined) " + V + ".dataPath = (dataPath || '') + " + e.errorPath + "; if (" + V + ".schemaPath === undefined) { " + V + '.schemaPath = "' + c + '"; } ', e.opts.verbose && (r += " " + V + ".schema = " + E + "; " + V + ".data = " + f + "; "), r += " } } ") : D ? (r += " var err = ", e.createErrors !== !1 ? (r += " { keyword: '" + (h || "custom") + "' , dataPath: (dataPath || '') + " + e.errorPath + " , schemaPath: " + e.util.toQuotedString(c) + " , params: { keyword: '" + y.keyword + "' } ", e.opts.messages !== !1 && (r += ` , message: 'should pass "` + y.keyword + `" keyword validation' `), e.opts.verbose && (r += " , schema: validate.schema" + l + " , parentSchema: validate.schema" + e.schemaPath + " , data: " + f + " "), r += " } ") : r += " {} ", r += "; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ", !e.compositeRule && d && (e.async ? r += " throw new ValidationError(vErrors); " : r += " validate.errors = vErrors; return false; ")) : p.errors === !1 ? r += " " + we + " " : (r += " if (Array.isArray(" + A + ")) { if (vErrors === null) vErrors = " + A + "; else vErrors = vErrors.concat(" + A + "); errors = vErrors.length; for (var " + k + "=" + v + "; " + k + "<errors; " + k + "++) { var " + V + " = vErrors[" + k + "]; if (" + V + ".dataPath === undefined) " + V + ".dataPath = (dataPath || '') + " + e.errorPath + "; " + V + '.schemaPath = "' + c + '"; ', e.opts.verbose && (r += " " + V + ".schema = " + E + "; " + V + ".data = " + f + "; "), r += " } } else { " + we + " } "), r += " } ", d && (r += " else { ");
10246
10269
  }
10247
10270
  return r;
10248
10271
  }), Ia;
@@ -10388,7 +10411,7 @@ function ef() {
10388
10411
  if (xo) return Na;
10389
10412
  xo = 1;
10390
10413
  var i = fu(), e = Vn(), t = du(), a = Gi(), r = Ji(), n = hu(), o = Iu(), s = Fu(), l = Yr();
10391
- Na = v, v.prototype.validate = g, v.prototype.compile = E, v.prototype.addSchema = y, v.prototype.addMetaSchema = x, v.prototype.validateSchema = p, v.prototype.getSchema = P, v.prototype.removeSchema = O, v.prototype.addFormat = Y, v.prototype.errorsText = re, v.prototype._addSchema = R, v.prototype._compile = M, v.prototype.compileAsync = ju();
10414
+ Na = v, v.prototype.validate = g, v.prototype.compile = E, v.prototype.addSchema = y, v.prototype.addMetaSchema = x, v.prototype.validateSchema = p, v.prototype.getSchema = P, v.prototype.removeSchema = O, v.prototype.addFormat = Y, v.prototype.errorsText = re, v.prototype._addSchema = R, v.prototype._compile = A, v.prototype.compileAsync = ju();
10392
10415
  var c = Vu();
10393
10416
  v.prototype.addKeyword = c.add, v.prototype.getKeyword = c.get, v.prototype.removeKeyword = c.remove, v.prototype.validateKeyword = c.validate;
10394
10417
  var d = Gn();
@@ -10474,10 +10497,10 @@ function ef() {
10474
10497
  }
10475
10498
  function O(N) {
10476
10499
  if (N instanceof RegExp)
10477
- return I(this, this._schemas, N), I(this, this._refs, N), this;
10500
+ return M(this, this._schemas, N), M(this, this._refs, N), this;
10478
10501
  switch (typeof N) {
10479
10502
  case "undefined":
10480
- return I(this, this._schemas), I(this, this._refs), this._cache.clear(), this;
10503
+ return M(this, this._schemas), M(this, this._refs), this._cache.clear(), this;
10481
10504
  case "string":
10482
10505
  var B = D(this, N);
10483
10506
  return B && this._cache.del(B.cacheKey), delete this._schemas[N], delete this._refs[N], this;
@@ -10489,7 +10512,7 @@ function ef() {
10489
10512
  }
10490
10513
  return this;
10491
10514
  }
10492
- function I(N, B, H) {
10515
+ function M(N, B, H) {
10493
10516
  for (var ie in B) {
10494
10517
  var z = B[ie];
10495
10518
  !z.meta && (!H || H.test(ie)) && (N._cache.del(z.cacheKey), delete B[ie]);
@@ -10514,7 +10537,7 @@ function ef() {
10514
10537
  });
10515
10538
  return se[0] != "#" && ie && (this._refs[se] = m), this._cache.put(X, m), ue && xe && this.validateSchema(N, !0), m;
10516
10539
  }
10517
- function M(N, B) {
10540
+ function A(N, B) {
10518
10541
  if (N.compiling)
10519
10542
  return N.validate = z, z.schema = N.schema, z.errors = null, z.root = B || z, N.schema.$async === !0 && (z.$async = !0), z;
10520
10543
  N.compiling = !0;
@@ -12520,13 +12543,13 @@ function Ki() {
12520
12543
  }
12521
12544
  return Q;
12522
12545
  }
12523
- function I(_, m, b, $) {
12546
+ function M(_, m, b, $) {
12524
12547
  return fe(H(m, _.length - b), _, b, $);
12525
12548
  }
12526
12549
  function R(_, m, b, $) {
12527
12550
  return fe(ie(m), _, b, $);
12528
12551
  }
12529
- function M(_, m, b, $) {
12552
+ function A(_, m, b, $) {
12530
12553
  return fe(X(m), _, b, $);
12531
12554
  }
12532
12555
  function k(_, m, b, $) {
@@ -12553,13 +12576,13 @@ function Ki() {
12553
12576
  return O(this, m, b, $);
12554
12577
  case "utf8":
12555
12578
  case "utf-8":
12556
- return I(this, m, b, $);
12579
+ return M(this, m, b, $);
12557
12580
  case "ascii":
12558
12581
  case "latin1":
12559
12582
  case "binary":
12560
12583
  return R(this, m, b, $);
12561
12584
  case "base64":
12562
- return M(this, m, b, $);
12585
+ return A(this, m, b, $);
12563
12586
  case "ucs2":
12564
12587
  case "ucs-2":
12565
12588
  case "utf16le":
@@ -14229,19 +14252,19 @@ function Nf() {
14229
14252
  }
14230
14253
  }
14231
14254
  this.defaultCharUnicode = u.defaultCharUnicode, this.encodeTable = [], this.encodeTableSeq = [];
14232
- var I = {};
14255
+ var M = {};
14233
14256
  if (f.encodeSkipVals)
14234
14257
  for (var g = 0; g < f.encodeSkipVals.length; g++) {
14235
14258
  var R = f.encodeSkipVals[g];
14236
14259
  if (typeof R == "number")
14237
- I[R] = !0;
14260
+ M[R] = !0;
14238
14261
  else
14239
14262
  for (var S = R.from; S <= R.to; S++)
14240
- I[S] = !0;
14263
+ M[S] = !0;
14241
14264
  }
14242
- if (this._fillEncodeTable(0, 0, I), f.encodeAdd)
14243
- for (var M in f.encodeAdd)
14244
- Object.prototype.hasOwnProperty.call(f.encodeAdd, M) && this._setEncodeChar(M.charCodeAt(0), f.encodeAdd[M]);
14265
+ if (this._fillEncodeTable(0, 0, M), f.encodeAdd)
14266
+ for (var A in f.encodeAdd)
14267
+ Object.prototype.hasOwnProperty.call(f.encodeAdd, A) && this._setEncodeChar(A.charCodeAt(0), f.encodeAdd[A]);
14245
14268
  this.defCharSB = this.encodeTable[0][u.defaultCharSingleByte.charCodeAt(0)], this.defCharSB === e && (this.defCharSB = this.encodeTable[0]["?"]), this.defCharSB === e && (this.defCharSB = 63);
14246
14269
  }
14247
14270
  l.prototype.encoder = c, l.prototype.decoder = d, l.prototype._getDecodeTrieNode = function(f) {
@@ -14394,8 +14417,8 @@ function Nf() {
14394
14417
  v = r - x;
14395
14418
  continue;
14396
14419
  } else if (x <= a) {
14397
- for (var O = this.decodeTableSeq[a - x], I = 0; I < O.length - 1; I++)
14398
- x = O[I], u[S++] = x & 255, u[S++] = x >> 8;
14420
+ for (var O = this.decodeTableSeq[a - x], M = 0; M < O.length - 1; M++)
14421
+ x = O[M], u[S++] = x & 255, u[S++] = x >> 8;
14399
14422
  x = O[O.length - 1];
14400
14423
  } else
14401
14424
  throw new Error("iconv-lite internal error: invalid decoding table value " + x + " at " + v + "/" + P);
@@ -16206,9 +16229,9 @@ function Kf() {
16206
16229
  throw new TypeError("argument callback is required");
16207
16230
  var y = E.encoding !== !0 ? E.encoding : "utf-8", x = e.parse(E.limit), p = E.length != null && !isNaN(E.length) ? parseInt(E.length, 10) : null;
16208
16231
  return g ? c(f, y, p, x, h(g)) : new Promise(function(P, C) {
16209
- c(f, y, p, x, function(O, I) {
16232
+ c(f, y, p, x, function(O, M) {
16210
16233
  if (O) return C(O);
16211
- P(I);
16234
+ P(M);
16212
16235
  });
16213
16236
  });
16214
16237
  }
@@ -16240,13 +16263,13 @@ function Kf() {
16240
16263
  return D(k);
16241
16264
  }
16242
16265
  var C = P ? "" : [];
16243
- f.on("aborted", O), f.on("close", M), f.on("data", I), f.on("end", R), f.on("error", R), x = !1;
16266
+ f.on("aborted", O), f.on("close", A), f.on("data", M), f.on("end", R), f.on("error", R), x = !1;
16244
16267
  function D() {
16245
16268
  for (var k = new Array(arguments.length), V = 0; V < k.length; V++)
16246
16269
  k[V] = arguments[V];
16247
16270
  y = !0, x ? process.nextTick(G) : G();
16248
16271
  function G() {
16249
- M(), k[0] && l(f), E.apply(null, k);
16272
+ A(), k[0] && l(f), E.apply(null, k);
16250
16273
  }
16251
16274
  }
16252
16275
  function O() {
@@ -16258,7 +16281,7 @@ function Kf() {
16258
16281
  type: "request.aborted"
16259
16282
  }));
16260
16283
  }
16261
- function I(k) {
16284
+ function M(k) {
16262
16285
  y || (S += k.length, g !== null && S > g ? D(t(413, "request entity too large", {
16263
16286
  limit: g,
16264
16287
  received: S,
@@ -16281,8 +16304,8 @@ function Kf() {
16281
16304
  }
16282
16305
  }
16283
16306
  }
16284
- function M() {
16285
- C = null, f.removeListener("aborted", O), f.removeListener("data", I), f.removeListener("end", R), f.removeListener("error", R), f.removeListener("close", M);
16307
+ function A() {
16308
+ C = null, f.removeListener("aborted", O), f.removeListener("data", M), f.removeListener("end", R), f.removeListener("error", R), f.removeListener("close", A);
16286
16309
  }
16287
16310
  }
16288
16311
  function d() {