@wp-playground/blueprints 0.6.9 → 0.6.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.js CHANGED
@@ -84,7 +84,6 @@ const wpContentFilesExcludedFromExport = [
84
84
  "plugins/wordpress-importer",
85
85
  "mu-plugins/sqlite-database-integration",
86
86
  "mu-plugins/playground-includes",
87
- "mu-plugins/export-wxz.php",
88
87
  "mu-plugins/0-playground.php",
89
88
  /*
90
89
  * Listing core themes like that here isn't ideal, especially since
@@ -903,47 +902,34 @@ const cp = async (e, { fromPath: t, toPath: r }) => {
903
902
  WP_SITEURL: t
904
903
  }
905
904
  });
906
- }, importFile = async (e, { file: t }, r) => {
907
- var u, p;
908
- (u = r == null ? void 0 : r.tracker) == null || u.setCaption("Importing content");
909
- const n = await e.request({
910
- url: "/wp-admin/admin.php?import=wordpress"
911
- }), s = (p = DOM(n).getElementById("import-upload-form")) == null ? void 0 : p.getAttribute("action"), i = await e.request({
912
- url: `/wp-admin/${s}`,
913
- method: "POST",
914
- body: { import: t }
915
- }), o = DOM(i).querySelector(
916
- "#wpbody-content form"
917
- );
918
- if (!o)
919
- throw console.log(i.text), new Error(
920
- "Could not find an importer form in response. See the response text above for details."
921
- );
922
- const l = getFormData(o);
923
- l.fetch_attachments = "1";
924
- for (const $ in l)
925
- if ($.startsWith("user_map[")) {
926
- const O = "user_new[" + $.slice(9, -1) + "]";
927
- l[O] = "1";
928
- }
929
- const d = await e.request({
930
- url: o.action,
931
- method: "POST",
932
- body: l
905
+ }, importWxr = async (e, { file: t }, r) => {
906
+ var s;
907
+ (s = r == null ? void 0 : r.tracker) == null || s.setCaption("Importing content"), await writeFile(e, {
908
+ path: "/tmp/import.wxr",
909
+ data: t
933
910
  });
934
- if (!d.text.includes("All done."))
935
- throw console.warn("WordPress response was: ", {
936
- text: d.text,
937
- errors: d.errors
938
- }), new Error("Import failed, see console for details.");
939
- };
940
- function DOM(e) {
941
- return new DOMParser().parseFromString(e.text, "text/html");
942
- }
943
- function getFormData(e) {
944
- return Object.fromEntries(new FormData(e).entries());
945
- }
946
- const zipFunctions = `<?php
911
+ const n = await e.documentRoot;
912
+ await e.run({
913
+ code: `<?php
914
+ require ${phpVar(n)} . '/wp-load.php';
915
+ kses_remove_filters();
916
+ $admin_id = get_users(array('role' => 'Administrator') )[0];
917
+ $importer = new WXR_Importer( array(
918
+ 'fetch_attachments' => true,
919
+ 'default_author' => $admin_id
920
+ ) );
921
+ $logger = new WP_Importer_Logger_CLI();
922
+ $importer->set_logger( $logger );
923
+
924
+ // Slashes from the imported content are lost if we don't call wp_slash here.
925
+ add_action( 'wp_insert_post_data', function( $data ) {
926
+ return wp_slash($data);
927
+ });
928
+
929
+ $result = $importer->import( '/tmp/import.wxr' );
930
+ `
931
+ });
932
+ }, zipFunctions = `<?php
947
933
 
948
934
  function zipDir($root, $output, $options = array())
949
935
  {
@@ -1109,12 +1095,6 @@ async function exportWXR(e) {
1109
1095
  });
1110
1096
  return new File([t.bytes], "export.xml");
1111
1097
  }
1112
- async function exportWXZ(e) {
1113
- const t = await e.request({
1114
- url: "/wp-admin/export.php?download=true&content=all&export_wxz=1"
1115
- });
1116
- return new File([t.bytes], "export.wxz");
1117
- }
1118
1098
  async function installAsset(e, { targetPath: t, zipFile: r }) {
1119
1099
  const s = r.name.replace(/\.zip$/, ""), i = joinPaths(await e.documentRoot, "wp-content"), o = joinPaths(i, randomString()), l = joinPaths(o, "assets", s);
1120
1100
  await e.fileExists(l) && await e.rmdir(o, {
@@ -1278,9 +1258,8 @@ const allStepHandlers = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.def
1278
1258
  defineWpConfigConsts,
1279
1259
  enableMultisite,
1280
1260
  exportWXR,
1281
- exportWXZ,
1282
- importFile,
1283
1261
  importWordPressFiles,
1262
+ importWxr,
1284
1263
  installPlugin,
1285
1264
  installTheme,
1286
1265
  login,
@@ -1724,7 +1703,8 @@ const SupportedPHPVersions = [
1724
1703
  "xml-bundle",
1725
1704
  "gd"
1726
1705
  ], SupportedPHPExtensionBundles = {
1727
- "kitchen-sink": SupportedPHPExtensionsList
1706
+ "kitchen-sink": SupportedPHPExtensionsList,
1707
+ light: []
1728
1708
  };
1729
1709
  var Ae, Ge;
1730
1710
  class PHPBrowser {
@@ -2200,7 +2180,7 @@ var __defProp = Object.defineProperty, __getOwnPropDesc = Object.getOwnPropertyD
2200
2180
  return n && s && __defProp(t, r, s), s;
2201
2181
  };
2202
2182
  const STRING = "string", NUMBER = "number", __private__dont__use = Symbol("__private__dont__use");
2203
- var Me, Ze, Ye, be, Re, Te, Ee, Xe, gt, Gt, yt, Kt, vt, Jt, wt, Qt, Pt, Zt, bt, Yt, Et, Xt, St, er, Rt, tr, Tt, rr, kt, nr, Ot, sr;
2183
+ var Me, Ze, Ye, be, Re, Te, Ee, Xe, gt, Gt, yt, Kt, vt, Jt, wt, Qt, Pt, Zt, bt, Yt, Et, Xt, St, er, Rt, tr, Tt, rr, kt, nr, Ct, sr;
2204
2184
  class BasePHP {
2205
2185
  /**
2206
2186
  * Initializes a PHP runtime.
@@ -2221,7 +2201,7 @@ class BasePHP {
2221
2201
  Q(this, Rt);
2222
2202
  Q(this, Tt);
2223
2203
  Q(this, kt);
2224
- Q(this, Ot);
2204
+ Q(this, Ct);
2225
2205
  Q(this, Me, void 0);
2226
2206
  Q(this, Ze, void 0);
2227
2207
  Q(this, Ye, void 0);
@@ -2345,7 +2325,7 @@ class BasePHP {
2345
2325
  const i = e.env || {};
2346
2326
  for (const l in i)
2347
2327
  ce(this, Tt, rr).call(this, l, i[l]);
2348
- const o = await ce(this, Ot, sr).call(this);
2328
+ const o = await ce(this, Ct, sr).call(this);
2349
2329
  if (o.exitCode !== 0) {
2350
2330
  const l = {
2351
2331
  stdout: o.text,
@@ -2646,7 +2626,7 @@ Me = new WeakMap(), Ze = new WeakMap(), Ye = new WeakMap(), be = new WeakMap(),
2646
2626
  [STRING],
2647
2627
  [e]
2648
2628
  );
2649
- }, Ot = new WeakSet(), sr = async function() {
2629
+ }, Ct = new WeakSet(), sr = async function() {
2650
2630
  var s;
2651
2631
  let e, t;
2652
2632
  try {
@@ -2979,10 +2959,10 @@ var ajv$1 = { exports: {} }, core$2 = {}, validate = {}, boolSchema = {}, errors
2979
2959
  }
2980
2960
  e._CodeOrName = t, e.IDENTIFIER = /^[a-z$_][a-z$_0-9]*$/i;
2981
2961
  class r extends t {
2982
- constructor(T) {
2983
- if (super(), !e.IDENTIFIER.test(T))
2962
+ constructor(g) {
2963
+ if (super(), !e.IDENTIFIER.test(g))
2984
2964
  throw new Error("CodeGen: name must be a valid identifier");
2985
- this.str = T;
2965
+ this.str = g;
2986
2966
  }
2987
2967
  toString() {
2988
2968
  return this.str;
@@ -2996,8 +2976,8 @@ var ajv$1 = { exports: {} }, core$2 = {}, validate = {}, boolSchema = {}, errors
2996
2976
  }
2997
2977
  e.Name = r;
2998
2978
  class n extends t {
2999
- constructor(T) {
3000
- super(), this._items = typeof T == "string" ? [T] : T;
2979
+ constructor(g) {
2980
+ super(), this._items = typeof g == "string" ? [g] : g;
3001
2981
  }
3002
2982
  toString() {
3003
2983
  return this.str;
@@ -3005,93 +2985,93 @@ var ajv$1 = { exports: {} }, core$2 = {}, validate = {}, boolSchema = {}, errors
3005
2985
  emptyStr() {
3006
2986
  if (this._items.length > 1)
3007
2987
  return !1;
3008
- const T = this._items[0];
3009
- return T === "" || T === '""';
2988
+ const g = this._items[0];
2989
+ return g === "" || g === '""';
3010
2990
  }
3011
2991
  get str() {
3012
- var T;
3013
- return (T = this._str) !== null && T !== void 0 ? T : this._str = this._items.reduce((S, I) => `${S}${I}`, "");
2992
+ var g;
2993
+ return (g = this._str) !== null && g !== void 0 ? g : this._str = this._items.reduce((P, I) => `${P}${I}`, "");
3014
2994
  }
3015
2995
  get names() {
3016
- var T;
3017
- return (T = this._names) !== null && T !== void 0 ? T : this._names = this._items.reduce((S, I) => (I instanceof r && (S[I.str] = (S[I.str] || 0) + 1), S), {});
2996
+ var g;
2997
+ return (g = this._names) !== null && g !== void 0 ? g : this._names = this._items.reduce((P, I) => (I instanceof r && (P[I.str] = (P[I.str] || 0) + 1), P), {});
3018
2998
  }
3019
2999
  }
3020
3000
  e._Code = n, e.nil = new n("");
3021
- function s(m, ...T) {
3022
- const S = [m[0]];
3001
+ function s(_, ...g) {
3002
+ const P = [_[0]];
3023
3003
  let I = 0;
3024
- for (; I < T.length; )
3025
- l(S, T[I]), S.push(m[++I]);
3026
- return new n(S);
3004
+ for (; I < g.length; )
3005
+ l(P, g[I]), P.push(_[++I]);
3006
+ return new n(P);
3027
3007
  }
3028
3008
  e._ = s;
3029
3009
  const i = new n("+");
3030
- function o(m, ...T) {
3031
- const S = [N(m[0])];
3010
+ function o(_, ...g) {
3011
+ const P = [N(_[0])];
3032
3012
  let I = 0;
3033
- for (; I < T.length; )
3034
- S.push(i), l(S, T[I]), S.push(i, N(m[++I]));
3035
- return d(S), new n(S);
3013
+ for (; I < g.length; )
3014
+ P.push(i), l(P, g[I]), P.push(i, N(_[++I]));
3015
+ return d(P), new n(P);
3036
3016
  }
3037
3017
  e.str = o;
3038
- function l(m, T) {
3039
- T instanceof n ? m.push(...T._items) : T instanceof r ? m.push(T) : m.push($(T));
3018
+ function l(_, g) {
3019
+ g instanceof n ? _.push(...g._items) : g instanceof r ? _.push(g) : _.push($(g));
3040
3020
  }
3041
3021
  e.addCodeArg = l;
3042
- function d(m) {
3043
- let T = 1;
3044
- for (; T < m.length - 1; ) {
3045
- if (m[T] === i) {
3046
- const S = u(m[T - 1], m[T + 1]);
3047
- if (S !== void 0) {
3048
- m.splice(T - 1, 3, S);
3022
+ function d(_) {
3023
+ let g = 1;
3024
+ for (; g < _.length - 1; ) {
3025
+ if (_[g] === i) {
3026
+ const P = u(_[g - 1], _[g + 1]);
3027
+ if (P !== void 0) {
3028
+ _.splice(g - 1, 3, P);
3049
3029
  continue;
3050
3030
  }
3051
- m[T++] = "+";
3031
+ _[g++] = "+";
3052
3032
  }
3053
- T++;
3033
+ g++;
3054
3034
  }
3055
3035
  }
3056
- function u(m, T) {
3057
- if (T === '""')
3058
- return m;
3059
- if (m === '""')
3060
- return T;
3061
- if (typeof m == "string")
3062
- return T instanceof r || m[m.length - 1] !== '"' ? void 0 : typeof T != "string" ? `${m.slice(0, -1)}${T}"` : T[0] === '"' ? m.slice(0, -1) + T.slice(1) : void 0;
3063
- if (typeof T == "string" && T[0] === '"' && !(m instanceof r))
3064
- return `"${m}${T.slice(1)}`;
3036
+ function u(_, g) {
3037
+ if (g === '""')
3038
+ return _;
3039
+ if (_ === '""')
3040
+ return g;
3041
+ if (typeof _ == "string")
3042
+ return g instanceof r || _[_.length - 1] !== '"' ? void 0 : typeof g != "string" ? `${_.slice(0, -1)}${g}"` : g[0] === '"' ? _.slice(0, -1) + g.slice(1) : void 0;
3043
+ if (typeof g == "string" && g[0] === '"' && !(_ instanceof r))
3044
+ return `"${_}${g.slice(1)}`;
3065
3045
  }
3066
- function p(m, T) {
3067
- return T.emptyStr() ? m : m.emptyStr() ? T : o`${m}${T}`;
3046
+ function p(_, g) {
3047
+ return g.emptyStr() ? _ : _.emptyStr() ? g : o`${_}${g}`;
3068
3048
  }
3069
3049
  e.strConcat = p;
3070
- function $(m) {
3071
- return typeof m == "number" || typeof m == "boolean" || m === null ? m : N(Array.isArray(m) ? m.join(",") : m);
3050
+ function $(_) {
3051
+ return typeof _ == "number" || typeof _ == "boolean" || _ === null ? _ : N(Array.isArray(_) ? _.join(",") : _);
3072
3052
  }
3073
- function O(m) {
3074
- return new n(N(m));
3053
+ function O(_) {
3054
+ return new n(N(_));
3075
3055
  }
3076
3056
  e.stringify = O;
3077
- function N(m) {
3078
- return JSON.stringify(m).replace(/\u2028/g, "\\u2028").replace(/\u2029/g, "\\u2029");
3057
+ function N(_) {
3058
+ return JSON.stringify(_).replace(/\u2028/g, "\\u2028").replace(/\u2029/g, "\\u2029");
3079
3059
  }
3080
3060
  e.safeStringify = N;
3081
- function R(m) {
3082
- return typeof m == "string" && e.IDENTIFIER.test(m) ? new n(`.${m}`) : s`[${m}]`;
3061
+ function R(_) {
3062
+ return typeof _ == "string" && e.IDENTIFIER.test(_) ? new n(`.${_}`) : s`[${_}]`;
3083
3063
  }
3084
3064
  e.getProperty = R;
3085
- function v(m) {
3086
- if (typeof m == "string" && e.IDENTIFIER.test(m))
3087
- return new n(`${m}`);
3088
- throw new Error(`CodeGen: invalid export name: ${m}, use explicit $id name mapping`);
3065
+ function T(_) {
3066
+ if (typeof _ == "string" && e.IDENTIFIER.test(_))
3067
+ return new n(`${_}`);
3068
+ throw new Error(`CodeGen: invalid export name: ${_}, use explicit $id name mapping`);
3089
3069
  }
3090
- e.getEsmExportName = v;
3091
- function g(m) {
3092
- return new n(m.toString());
3070
+ e.getEsmExportName = T;
3071
+ function y(_) {
3072
+ return new n(_.toString());
3093
3073
  }
3094
- e.regexpCode = g;
3074
+ e.regexpCode = y;
3095
3075
  })(code$1);
3096
3076
  var scope = {};
3097
3077
  (function(e) {
@@ -3157,16 +3137,16 @@ var scope = {};
3157
3137
  if (p.ref === void 0)
3158
3138
  throw new Error("CodeGen: ref must be passed in value");
3159
3139
  const O = this.toName(u), { prefix: N } = O, R = ($ = p.key) !== null && $ !== void 0 ? $ : p.ref;
3160
- let v = this._values[N];
3161
- if (v) {
3162
- const T = v.get(R);
3163
- if (T)
3164
- return T;
3140
+ let T = this._values[N];
3141
+ if (T) {
3142
+ const g = T.get(R);
3143
+ if (g)
3144
+ return g;
3165
3145
  } else
3166
- v = this._values[N] = /* @__PURE__ */ new Map();
3167
- v.set(R, O);
3168
- const g = this._scope[N] || (this._scope[N] = []), m = g.length;
3169
- return g[m] = p.ref, O.setValue(p, { property: N, itemIndex: m }), O;
3146
+ T = this._values[N] = /* @__PURE__ */ new Map();
3147
+ T.set(R, O);
3148
+ const y = this._scope[N] || (this._scope[N] = []), _ = y.length;
3149
+ return y[_] = p.ref, O.setValue(p, { property: N, itemIndex: _ }), O;
3170
3150
  }
3171
3151
  getValue(u, p) {
3172
3152
  const $ = this._values[u];
@@ -3190,23 +3170,23 @@ var scope = {};
3190
3170
  _reduceValues(u, p, $ = {}, O) {
3191
3171
  let N = t.nil;
3192
3172
  for (const R in u) {
3193
- const v = u[R];
3194
- if (!v)
3173
+ const T = u[R];
3174
+ if (!T)
3195
3175
  continue;
3196
- const g = $[R] = $[R] || /* @__PURE__ */ new Map();
3197
- v.forEach((m) => {
3198
- if (g.has(m))
3176
+ const y = $[R] = $[R] || /* @__PURE__ */ new Map();
3177
+ T.forEach((_) => {
3178
+ if (y.has(_))
3199
3179
  return;
3200
- g.set(m, n.Started);
3201
- let T = p(m);
3202
- if (T) {
3203
- const S = this.opts.es5 ? e.varKinds.var : e.varKinds.const;
3204
- N = (0, t._)`${N}${S} ${m} = ${T};${this.opts._n}`;
3205
- } else if (T = O == null ? void 0 : O(m))
3206
- N = (0, t._)`${N}${T}${this.opts._n}`;
3180
+ y.set(_, n.Started);
3181
+ let g = p(_);
3182
+ if (g) {
3183
+ const P = this.opts.es5 ? e.varKinds.var : e.varKinds.const;
3184
+ N = (0, t._)`${N}${P} ${_} = ${g};${this.opts._n}`;
3185
+ } else if (g = O == null ? void 0 : O(_))
3186
+ N = (0, t._)`${N}${g}${this.opts._n}`;
3207
3187
  else
3208
- throw new r(m);
3209
- g.set(m, n.Completed);
3188
+ throw new r(_);
3189
+ y.set(_, n.Completed);
3210
3190
  });
3211
3191
  }
3212
3192
  return N;
@@ -3382,12 +3362,12 @@ var scope = {};
3382
3362
  return "{" + a._n + super.render(a) + "}" + a._n;
3383
3363
  }
3384
3364
  }
3385
- class v extends N {
3365
+ class T extends N {
3386
3366
  }
3387
- class g extends R {
3367
+ class y extends R {
3388
3368
  }
3389
- g.kind = "else";
3390
- class m extends R {
3369
+ y.kind = "else";
3370
+ class _ extends R {
3391
3371
  constructor(a, h) {
3392
3372
  super(h), this.condition = a;
3393
3373
  }
@@ -3403,10 +3383,10 @@ var scope = {};
3403
3383
  let h = this.else;
3404
3384
  if (h) {
3405
3385
  const C = h.optimizeNodes();
3406
- h = this.else = Array.isArray(C) ? new g(C) : C;
3386
+ h = this.else = Array.isArray(C) ? new y(C) : C;
3407
3387
  }
3408
3388
  if (h)
3409
- return a === !1 ? h instanceof m ? h : h.nodes : this.nodes.length ? this : new m(Oe(a), h instanceof m ? [h] : h.nodes);
3389
+ return a === !1 ? h instanceof _ ? h : h.nodes : this.nodes.length ? this : new _(Ce(a), h instanceof _ ? [h] : h.nodes);
3410
3390
  if (!(a === !1 || !this.nodes.length))
3411
3391
  return this;
3412
3392
  }
@@ -3420,11 +3400,11 @@ var scope = {};
3420
3400
  return ue(a, this.condition), this.else && K(a, this.else.names), a;
3421
3401
  }
3422
3402
  }
3423
- m.kind = "if";
3424
- class T extends R {
3403
+ _.kind = "if";
3404
+ class g extends R {
3425
3405
  }
3426
- T.kind = "for";
3427
- class S extends T {
3406
+ g.kind = "for";
3407
+ class P extends g {
3428
3408
  constructor(a) {
3429
3409
  super(), this.iteration = a;
3430
3410
  }
@@ -3439,7 +3419,7 @@ var scope = {};
3439
3419
  return K(super.names, this.iteration.names);
3440
3420
  }
3441
3421
  }
3442
- class I extends T {
3422
+ class I extends g {
3443
3423
  constructor(a, h, C, M) {
3444
3424
  super(), this.varKind = a, this.name = h, this.from = C, this.to = M;
3445
3425
  }
@@ -3452,7 +3432,7 @@ var scope = {};
3452
3432
  return ue(a, this.to);
3453
3433
  }
3454
3434
  }
3455
- class D extends T {
3435
+ class D extends g {
3456
3436
  constructor(a, h, C, M) {
3457
3437
  super(), this.loop = a, this.varKind = h, this.name = C, this.iterable = M;
3458
3438
  }
@@ -3518,7 +3498,7 @@ var scope = {};
3518
3498
  class re {
3519
3499
  constructor(a, h = {}) {
3520
3500
  this._values = {}, this._blockStarts = [], this._constants = {}, this.opts = { ...h, _n: h.lines ? `
3521
- ` : "" }, this._extScope = a, this._scope = new r.Scope({ parent: a }), this._nodes = [new v()];
3501
+ ` : "" }, this._extScope = a, this._scope = new r.Scope({ parent: a }), this._nodes = [new T()];
3522
3502
  }
3523
3503
  toString() {
3524
3504
  return this._root.render(this.opts);
@@ -3584,7 +3564,7 @@ var scope = {};
3584
3564
  }
3585
3565
  // `if` clause (or statement if `thenBody` and, optionally, `elseBody` are passed)
3586
3566
  if(a, h, C) {
3587
- if (this._blockNode(new m(a)), h && C)
3567
+ if (this._blockNode(new _(a)), h && C)
3588
3568
  this.code(h).else().code(C).endIf();
3589
3569
  else if (h)
3590
3570
  this.code(h).endIf();
@@ -3594,22 +3574,22 @@ var scope = {};
3594
3574
  }
3595
3575
  // `else if` clause - invalid without `if` or after `else` clauses
3596
3576
  elseIf(a) {
3597
- return this._elseNode(new m(a));
3577
+ return this._elseNode(new _(a));
3598
3578
  }
3599
3579
  // `else` clause - only valid after `if` or `else if` clauses
3600
3580
  else() {
3601
- return this._elseNode(new g());
3581
+ return this._elseNode(new y());
3602
3582
  }
3603
3583
  // end `if` statement (needed if gen.if was used only with condition)
3604
3584
  endIf() {
3605
- return this._endBlockNode(m, g);
3585
+ return this._endBlockNode(_, y);
3606
3586
  }
3607
3587
  _for(a, h) {
3608
3588
  return this._blockNode(a), h && this.code(h).endFor(), this;
3609
3589
  }
3610
3590
  // a generic `for` clause (or statement if `forBody` is passed)
3611
3591
  for(a, h) {
3612
- return this._for(new S(a), h);
3592
+ return this._for(new P(a), h);
3613
3593
  }
3614
3594
  // `for` statement for a range of values
3615
3595
  forRange(a, h, C, M, q = this.opts.es5 ? r.varKinds.var : r.varKinds.let) {
@@ -3637,7 +3617,7 @@ var scope = {};
3637
3617
  }
3638
3618
  // end `for` loop
3639
3619
  endFor() {
3640
- return this._endBlockNode(T);
3620
+ return this._endBlockNode(g);
3641
3621
  }
3642
3622
  // `label` statement
3643
3623
  label(a) {
@@ -3709,7 +3689,7 @@ var scope = {};
3709
3689
  }
3710
3690
  _elseNode(a) {
3711
3691
  const h = this._currNode;
3712
- if (!(h instanceof m))
3692
+ if (!(h instanceof _))
3713
3693
  throw new Error('CodeGen: "else" without "if"');
3714
3694
  return this._currNode = h.else = a, this;
3715
3695
  }
@@ -3726,20 +3706,20 @@ var scope = {};
3726
3706
  }
3727
3707
  }
3728
3708
  e.CodeGen = re;
3729
- function K(P, a) {
3709
+ function K(b, a) {
3730
3710
  for (const h in a)
3731
- P[h] = (P[h] || 0) + (a[h] || 0);
3732
- return P;
3733
- }
3734
- function ue(P, a) {
3735
- return a instanceof t._CodeOrName ? K(P, a.names) : P;
3736
- }
3737
- function oe(P, a, h) {
3738
- if (P instanceof t.Name)
3739
- return C(P);
3740
- if (!M(P))
3741
- return P;
3742
- return new t._Code(P._items.reduce((q, W) => (W instanceof t.Name && (W = C(W)), W instanceof t._Code ? q.push(...W._items) : q.push(W), q), []));
3711
+ b[h] = (b[h] || 0) + (a[h] || 0);
3712
+ return b;
3713
+ }
3714
+ function ue(b, a) {
3715
+ return a instanceof t._CodeOrName ? K(b, a.names) : b;
3716
+ }
3717
+ function oe(b, a, h) {
3718
+ if (b instanceof t.Name)
3719
+ return C(b);
3720
+ if (!M(b))
3721
+ return b;
3722
+ return new t._Code(b._items.reduce((q, W) => (W instanceof t.Name && (W = C(W)), W instanceof t._Code ? q.push(...W._items) : q.push(W), q), []));
3743
3723
  function C(q) {
3744
3724
  const W = h[q.str];
3745
3725
  return W === void 0 || a[q.str] !== 1 ? q : (delete a[q.str], W);
@@ -3748,29 +3728,29 @@ var scope = {};
3748
3728
  return q instanceof t._Code && q._items.some((W) => W instanceof t.Name && a[W.str] === 1 && h[W.str] !== void 0);
3749
3729
  }
3750
3730
  }
3751
- function ke(P, a) {
3731
+ function ke(b, a) {
3752
3732
  for (const h in a)
3753
- P[h] = (P[h] || 0) - (a[h] || 0);
3733
+ b[h] = (b[h] || 0) - (a[h] || 0);
3754
3734
  }
3755
- function Oe(P) {
3756
- return typeof P == "boolean" || typeof P == "number" || P === null ? !P : (0, t._)`!${j(P)}`;
3735
+ function Ce(b) {
3736
+ return typeof b == "boolean" || typeof b == "number" || b === null ? !b : (0, t._)`!${j(b)}`;
3757
3737
  }
3758
- e.not = Oe;
3759
- const qe = y(e.operators.AND);
3760
- function et(...P) {
3761
- return P.reduce(qe);
3738
+ e.not = Ce;
3739
+ const qe = v(e.operators.AND);
3740
+ function et(...b) {
3741
+ return b.reduce(qe);
3762
3742
  }
3763
3743
  e.and = et;
3764
- const Ue = y(e.operators.OR);
3765
- function F(...P) {
3766
- return P.reduce(Ue);
3744
+ const Ue = v(e.operators.OR);
3745
+ function F(...b) {
3746
+ return b.reduce(Ue);
3767
3747
  }
3768
3748
  e.or = F;
3769
- function y(P) {
3770
- return (a, h) => a === t.nil ? h : h === t.nil ? a : (0, t._)`${j(a)} ${P} ${j(h)}`;
3749
+ function v(b) {
3750
+ return (a, h) => a === t.nil ? h : h === t.nil ? a : (0, t._)`${j(a)} ${b} ${j(h)}`;
3771
3751
  }
3772
- function j(P) {
3773
- return P instanceof t.Name ? P : (0, t._)`(${P})`;
3752
+ function j(b) {
3753
+ return b instanceof t.Name ? b : (0, t._)`(${b})`;
3774
3754
  }
3775
3755
  })(codegen);
3776
3756
  var util = {};
@@ -3861,10 +3841,10 @@ var util = {};
3861
3841
  w.if((0, t._)`${k} === true`, () => w.assign(A, !0), () => w.assign(A, (0, t._)`${A} || {}`).code((0, t._)`Object.assign(${A}, ${k})`));
3862
3842
  }),
3863
3843
  mergeToName: (w, k, A) => w.if((0, t._)`${A} !== true`, () => {
3864
- k === !0 ? w.assign(A, !0) : (w.assign(A, (0, t._)`${A} || {}`), g(w, A, k));
3844
+ k === !0 ? w.assign(A, !0) : (w.assign(A, (0, t._)`${A} || {}`), y(w, A, k));
3865
3845
  }),
3866
3846
  mergeValues: (w, k) => w === !0 ? !0 : { ...w, ...k },
3867
- resultToName: v
3847
+ resultToName: T
3868
3848
  }),
3869
3849
  items: R({
3870
3850
  mergeNames: (w, k, A) => w.if((0, t._)`${A} !== true && ${k} !== undefined`, () => w.assign(A, (0, t._)`${k} === true ? true : ${A} > ${k} ? ${A} : ${k}`)),
@@ -3873,32 +3853,32 @@ var util = {};
3873
3853
  resultToName: (w, k) => w.var("items", k)
3874
3854
  })
3875
3855
  };
3876
- function v(w, k) {
3856
+ function T(w, k) {
3877
3857
  if (k === !0)
3878
3858
  return w.var("props", !0);
3879
3859
  const A = w.var("props", (0, t._)`{}`);
3880
- return k !== void 0 && g(w, A, k), A;
3860
+ return k !== void 0 && y(w, A, k), A;
3881
3861
  }
3882
- e.evaluatedPropsToName = v;
3883
- function g(w, k, A) {
3862
+ e.evaluatedPropsToName = T;
3863
+ function y(w, k, A) {
3884
3864
  Object.keys(A).forEach((V) => w.assign((0, t._)`${k}${(0, t.getProperty)(V)}`, !0));
3885
3865
  }
3886
- e.setEvaluated = g;
3887
- const m = {};
3888
- function T(w, k) {
3866
+ e.setEvaluated = y;
3867
+ const _ = {};
3868
+ function g(w, k) {
3889
3869
  return w.scopeValue("func", {
3890
3870
  ref: k,
3891
- code: m[k.code] || (m[k.code] = new r._Code(k.code))
3871
+ code: _[k.code] || (_[k.code] = new r._Code(k.code))
3892
3872
  });
3893
3873
  }
3894
- e.useFunc = T;
3895
- var S;
3874
+ e.useFunc = g;
3875
+ var P;
3896
3876
  (function(w) {
3897
3877
  w[w.Num = 0] = "Num", w[w.Str = 1] = "Str";
3898
- })(S = e.Type || (e.Type = {}));
3878
+ })(P = e.Type || (e.Type = {}));
3899
3879
  function I(w, k, A) {
3900
3880
  if (w instanceof t.Name) {
3901
- const V = k === S.Num;
3881
+ const V = k === P.Num;
3902
3882
  return A ? V ? (0, t._)`"[" + ${w} + "]"` : (0, t._)`"['" + ${w} + "']"` : V ? (0, t._)`"/" + ${w}` : (0, t._)`"/" + ${w}.replace(/~/g, "~0").replace(/\\//g, "~1")`;
3903
3883
  }
3904
3884
  return A ? (0, t.getProperty)(w).toString() : "/" + $(w);
@@ -3943,40 +3923,40 @@ names$1.default = names;
3943
3923
  Object.defineProperty(e, "__esModule", { value: !0 }), e.extendErrors = e.resetErrorsCount = e.reportExtraError = e.reportError = e.keyword$DataError = e.keywordError = void 0;
3944
3924
  const t = codegen, r = util, n = names$1;
3945
3925
  e.keywordError = {
3946
- message: ({ keyword: g }) => (0, t.str)`must pass "${g}" keyword validation`
3926
+ message: ({ keyword: y }) => (0, t.str)`must pass "${y}" keyword validation`
3947
3927
  }, e.keyword$DataError = {
3948
- message: ({ keyword: g, schemaType: m }) => m ? (0, t.str)`"${g}" keyword must be ${m} ($data)` : (0, t.str)`"${g}" keyword is invalid ($data)`
3928
+ message: ({ keyword: y, schemaType: _ }) => _ ? (0, t.str)`"${y}" keyword must be ${_} ($data)` : (0, t.str)`"${y}" keyword is invalid ($data)`
3949
3929
  };
3950
- function s(g, m = e.keywordError, T, S) {
3951
- const { it: I } = g, { gen: D, compositeRule: w, allErrors: k } = I, A = $(g, m, T);
3952
- S ?? (w || k) ? d(D, A) : u(I, (0, t._)`[${A}]`);
3930
+ function s(y, _ = e.keywordError, g, P) {
3931
+ const { it: I } = y, { gen: D, compositeRule: w, allErrors: k } = I, A = $(y, _, g);
3932
+ P ?? (w || k) ? d(D, A) : u(I, (0, t._)`[${A}]`);
3953
3933
  }
3954
3934
  e.reportError = s;
3955
- function i(g, m = e.keywordError, T) {
3956
- const { it: S } = g, { gen: I, compositeRule: D, allErrors: w } = S, k = $(g, m, T);
3957
- d(I, k), D || w || u(S, n.default.vErrors);
3935
+ function i(y, _ = e.keywordError, g) {
3936
+ const { it: P } = y, { gen: I, compositeRule: D, allErrors: w } = P, k = $(y, _, g);
3937
+ d(I, k), D || w || u(P, n.default.vErrors);
3958
3938
  }
3959
3939
  e.reportExtraError = i;
3960
- function o(g, m) {
3961
- g.assign(n.default.errors, m), g.if((0, t._)`${n.default.vErrors} !== null`, () => g.if(m, () => g.assign((0, t._)`${n.default.vErrors}.length`, m), () => g.assign(n.default.vErrors, null)));
3940
+ function o(y, _) {
3941
+ y.assign(n.default.errors, _), y.if((0, t._)`${n.default.vErrors} !== null`, () => y.if(_, () => y.assign((0, t._)`${n.default.vErrors}.length`, _), () => y.assign(n.default.vErrors, null)));
3962
3942
  }
3963
3943
  e.resetErrorsCount = o;
3964
- function l({ gen: g, keyword: m, schemaValue: T, data: S, errsCount: I, it: D }) {
3944
+ function l({ gen: y, keyword: _, schemaValue: g, data: P, errsCount: I, it: D }) {
3965
3945
  if (I === void 0)
3966
3946
  throw new Error("ajv implementation error");
3967
- const w = g.name("err");
3968
- g.forRange("i", I, n.default.errors, (k) => {
3969
- g.const(w, (0, t._)`${n.default.vErrors}[${k}]`), g.if((0, t._)`${w}.instancePath === undefined`, () => g.assign((0, t._)`${w}.instancePath`, (0, t.strConcat)(n.default.instancePath, D.errorPath))), g.assign((0, t._)`${w}.schemaPath`, (0, t.str)`${D.errSchemaPath}/${m}`), D.opts.verbose && (g.assign((0, t._)`${w}.schema`, T), g.assign((0, t._)`${w}.data`, S));
3947
+ const w = y.name("err");
3948
+ y.forRange("i", I, n.default.errors, (k) => {
3949
+ y.const(w, (0, t._)`${n.default.vErrors}[${k}]`), y.if((0, t._)`${w}.instancePath === undefined`, () => y.assign((0, t._)`${w}.instancePath`, (0, t.strConcat)(n.default.instancePath, D.errorPath))), y.assign((0, t._)`${w}.schemaPath`, (0, t.str)`${D.errSchemaPath}/${_}`), D.opts.verbose && (y.assign((0, t._)`${w}.schema`, g), y.assign((0, t._)`${w}.data`, P));
3970
3950
  });
3971
3951
  }
3972
3952
  e.extendErrors = l;
3973
- function d(g, m) {
3974
- const T = g.const("err", m);
3975
- g.if((0, t._)`${n.default.vErrors} === null`, () => g.assign(n.default.vErrors, (0, t._)`[${T}]`), (0, t._)`${n.default.vErrors}.push(${T})`), g.code((0, t._)`${n.default.errors}++`);
3953
+ function d(y, _) {
3954
+ const g = y.const("err", _);
3955
+ y.if((0, t._)`${n.default.vErrors} === null`, () => y.assign(n.default.vErrors, (0, t._)`[${g}]`), (0, t._)`${n.default.vErrors}.push(${g})`), y.code((0, t._)`${n.default.errors}++`);
3976
3956
  }
3977
- function u(g, m) {
3978
- const { gen: T, validateName: S, schemaEnv: I } = g;
3979
- I.$async ? T.throw((0, t._)`new ${g.ValidationError}(${m})`) : (T.assign((0, t._)`${S}.errors`, m), T.return(!1));
3957
+ function u(y, _) {
3958
+ const { gen: g, validateName: P, schemaEnv: I } = y;
3959
+ I.$async ? g.throw((0, t._)`new ${y.ValidationError}(${_})`) : (g.assign((0, t._)`${P}.errors`, _), g.return(!1));
3980
3960
  }
3981
3961
  const p = {
3982
3962
  keyword: new t.Name("keyword"),
@@ -3987,28 +3967,28 @@ names$1.default = names;
3987
3967
  schema: new t.Name("schema"),
3988
3968
  parentSchema: new t.Name("parentSchema")
3989
3969
  };
3990
- function $(g, m, T) {
3991
- const { createErrors: S } = g.it;
3992
- return S === !1 ? (0, t._)`{}` : O(g, m, T);
3993
- }
3994
- function O(g, m, T = {}) {
3995
- const { gen: S, it: I } = g, D = [
3996
- N(I, T),
3997
- R(g, T)
3970
+ function $(y, _, g) {
3971
+ const { createErrors: P } = y.it;
3972
+ return P === !1 ? (0, t._)`{}` : O(y, _, g);
3973
+ }
3974
+ function O(y, _, g = {}) {
3975
+ const { gen: P, it: I } = y, D = [
3976
+ N(I, g),
3977
+ R(y, g)
3998
3978
  ];
3999
- return v(g, m, D), S.object(...D);
3979
+ return T(y, _, D), P.object(...D);
4000
3980
  }
4001
- function N({ errorPath: g }, { instancePath: m }) {
4002
- const T = m ? (0, t.str)`${g}${(0, r.getErrorPath)(m, r.Type.Str)}` : g;
4003
- return [n.default.instancePath, (0, t.strConcat)(n.default.instancePath, T)];
3981
+ function N({ errorPath: y }, { instancePath: _ }) {
3982
+ const g = _ ? (0, t.str)`${y}${(0, r.getErrorPath)(_, r.Type.Str)}` : y;
3983
+ return [n.default.instancePath, (0, t.strConcat)(n.default.instancePath, g)];
4004
3984
  }
4005
- function R({ keyword: g, it: { errSchemaPath: m } }, { schemaPath: T, parentSchema: S }) {
4006
- let I = S ? m : (0, t.str)`${m}/${g}`;
4007
- return T && (I = (0, t.str)`${I}${(0, r.getErrorPath)(T, r.Type.Str)}`), [p.schemaPath, I];
3985
+ function R({ keyword: y, it: { errSchemaPath: _ } }, { schemaPath: g, parentSchema: P }) {
3986
+ let I = P ? _ : (0, t.str)`${_}/${y}`;
3987
+ return g && (I = (0, t.str)`${I}${(0, r.getErrorPath)(g, r.Type.Str)}`), [p.schemaPath, I];
4008
3988
  }
4009
- function v(g, { params: m, message: T }, S) {
4010
- const { keyword: I, data: D, schemaValue: w, it: k } = g, { opts: A, propertyName: V, topSchemaRef: x, schemaPath: re } = k;
4011
- S.push([p.keyword, I], [p.params, typeof m == "function" ? m(g) : m || (0, t._)`{}`]), A.messages && S.push([p.message, typeof T == "function" ? T(g) : T]), A.verbose && S.push([p.schema, w], [p.parentSchema, (0, t._)`${x}${re}`], [n.default.data, D]), V && S.push([p.propertyName, V]);
3989
+ function T(y, { params: _, message: g }, P) {
3990
+ const { keyword: I, data: D, schemaValue: w, it: k } = y, { opts: A, propertyName: V, topSchemaRef: x, schemaPath: re } = k;
3991
+ P.push([p.keyword, I], [p.params, typeof _ == "function" ? _(y) : _ || (0, t._)`{}`]), A.messages && P.push([p.message, typeof g == "function" ? g(y) : g]), A.verbose && P.push([p.schema, w], [p.parentSchema, (0, t._)`${x}${re}`], [n.default.data, D]), V && P.push([p.propertyName, V]);
4012
3992
  }
4013
3993
  })(errors);
4014
3994
  Object.defineProperty(boolSchema, "__esModule", { value: !0 });
@@ -4084,51 +4064,51 @@ applicability.shouldUseRule = shouldUseRule;
4084
4064
  Object.defineProperty(e, "__esModule", { value: !0 }), e.reportTypeError = e.checkDataTypes = e.checkDataType = e.coerceAndCheckDataType = e.getJSONTypes = e.getSchemaTypes = e.DataType = void 0;
4085
4065
  const t = rules, r = applicability, n = errors, s = codegen, i = util;
4086
4066
  var o;
4087
- (function(S) {
4088
- S[S.Correct = 0] = "Correct", S[S.Wrong = 1] = "Wrong";
4067
+ (function(P) {
4068
+ P[P.Correct = 0] = "Correct", P[P.Wrong = 1] = "Wrong";
4089
4069
  })(o = e.DataType || (e.DataType = {}));
4090
- function l(S) {
4091
- const I = d(S.type);
4070
+ function l(P) {
4071
+ const I = d(P.type);
4092
4072
  if (I.includes("null")) {
4093
- if (S.nullable === !1)
4073
+ if (P.nullable === !1)
4094
4074
  throw new Error("type: null contradicts nullable: false");
4095
4075
  } else {
4096
- if (!I.length && S.nullable !== void 0)
4076
+ if (!I.length && P.nullable !== void 0)
4097
4077
  throw new Error('"nullable" cannot be used without "type"');
4098
- S.nullable === !0 && I.push("null");
4078
+ P.nullable === !0 && I.push("null");
4099
4079
  }
4100
4080
  return I;
4101
4081
  }
4102
4082
  e.getSchemaTypes = l;
4103
- function d(S) {
4104
- const I = Array.isArray(S) ? S : S ? [S] : [];
4083
+ function d(P) {
4084
+ const I = Array.isArray(P) ? P : P ? [P] : [];
4105
4085
  if (I.every(t.isJSONType))
4106
4086
  return I;
4107
4087
  throw new Error("type must be JSONType or JSONType[]: " + I.join(","));
4108
4088
  }
4109
4089
  e.getJSONTypes = d;
4110
- function u(S, I) {
4111
- const { gen: D, data: w, opts: k } = S, A = $(I, k.coerceTypes), V = I.length > 0 && !(A.length === 0 && I.length === 1 && (0, r.schemaHasRulesForType)(S, I[0]));
4090
+ function u(P, I) {
4091
+ const { gen: D, data: w, opts: k } = P, A = $(I, k.coerceTypes), V = I.length > 0 && !(A.length === 0 && I.length === 1 && (0, r.schemaHasRulesForType)(P, I[0]));
4112
4092
  if (V) {
4113
- const x = v(I, w, k.strictNumbers, o.Wrong);
4093
+ const x = T(I, w, k.strictNumbers, o.Wrong);
4114
4094
  D.if(x, () => {
4115
- A.length ? O(S, I, A) : m(S);
4095
+ A.length ? O(P, I, A) : _(P);
4116
4096
  });
4117
4097
  }
4118
4098
  return V;
4119
4099
  }
4120
4100
  e.coerceAndCheckDataType = u;
4121
4101
  const p = /* @__PURE__ */ new Set(["string", "number", "integer", "boolean", "null"]);
4122
- function $(S, I) {
4123
- return I ? S.filter((D) => p.has(D) || I === "array" && D === "array") : [];
4102
+ function $(P, I) {
4103
+ return I ? P.filter((D) => p.has(D) || I === "array" && D === "array") : [];
4124
4104
  }
4125
- function O(S, I, D) {
4126
- const { gen: w, data: k, opts: A } = S, V = w.let("dataType", (0, s._)`typeof ${k}`), x = w.let("coerced", (0, s._)`undefined`);
4127
- A.coerceTypes === "array" && w.if((0, s._)`${V} == 'object' && Array.isArray(${k}) && ${k}.length == 1`, () => w.assign(k, (0, s._)`${k}[0]`).assign(V, (0, s._)`typeof ${k}`).if(v(I, k, A.strictNumbers), () => w.assign(x, k))), w.if((0, s._)`${x} !== undefined`);
4105
+ function O(P, I, D) {
4106
+ const { gen: w, data: k, opts: A } = P, V = w.let("dataType", (0, s._)`typeof ${k}`), x = w.let("coerced", (0, s._)`undefined`);
4107
+ A.coerceTypes === "array" && w.if((0, s._)`${V} == 'object' && Array.isArray(${k}) && ${k}.length == 1`, () => w.assign(k, (0, s._)`${k}[0]`).assign(V, (0, s._)`typeof ${k}`).if(T(I, k, A.strictNumbers), () => w.assign(x, k))), w.if((0, s._)`${x} !== undefined`);
4128
4108
  for (const K of D)
4129
4109
  (p.has(K) || K === "array" && A.coerceTypes === "array") && re(K);
4130
- w.else(), m(S), w.endIf(), w.if((0, s._)`${x} !== undefined`, () => {
4131
- w.assign(k, x), N(S, x);
4110
+ w.else(), _(P), w.endIf(), w.if((0, s._)`${x} !== undefined`, () => {
4111
+ w.assign(k, x), N(P, x);
4132
4112
  });
4133
4113
  function re(K) {
4134
4114
  switch (K) {
@@ -4155,13 +4135,13 @@ applicability.shouldUseRule = shouldUseRule;
4155
4135
  }
4156
4136
  }
4157
4137
  }
4158
- function N({ gen: S, parentData: I, parentDataProperty: D }, w) {
4159
- S.if((0, s._)`${I} !== undefined`, () => S.assign((0, s._)`${I}[${D}]`, w));
4138
+ function N({ gen: P, parentData: I, parentDataProperty: D }, w) {
4139
+ P.if((0, s._)`${I} !== undefined`, () => P.assign((0, s._)`${I}[${D}]`, w));
4160
4140
  }
4161
- function R(S, I, D, w = o.Correct) {
4141
+ function R(P, I, D, w = o.Correct) {
4162
4142
  const k = w === o.Correct ? s.operators.EQ : s.operators.NEQ;
4163
4143
  let A;
4164
- switch (S) {
4144
+ switch (P) {
4165
4145
  case "null":
4166
4146
  return (0, s._)`${I} ${k} null`;
4167
4147
  case "array":
@@ -4177,7 +4157,7 @@ applicability.shouldUseRule = shouldUseRule;
4177
4157
  A = V();
4178
4158
  break;
4179
4159
  default:
4180
- return (0, s._)`typeof ${I} ${k} ${S}`;
4160
+ return (0, s._)`typeof ${I} ${k} ${P}`;
4181
4161
  }
4182
4162
  return w === o.Correct ? A : (0, s.not)(A);
4183
4163
  function V(x = s.nil) {
@@ -4185,11 +4165,11 @@ applicability.shouldUseRule = shouldUseRule;
4185
4165
  }
4186
4166
  }
4187
4167
  e.checkDataType = R;
4188
- function v(S, I, D, w) {
4189
- if (S.length === 1)
4190
- return R(S[0], I, D, w);
4168
+ function T(P, I, D, w) {
4169
+ if (P.length === 1)
4170
+ return R(P[0], I, D, w);
4191
4171
  let k;
4192
- const A = (0, i.toHash)(S);
4172
+ const A = (0, i.toHash)(P);
4193
4173
  if (A.array && A.object) {
4194
4174
  const V = (0, s._)`typeof ${I} != "object"`;
4195
4175
  k = A.null ? V : (0, s._)`!${I} || ${V}`, delete A.null, delete A.array, delete A.object;
@@ -4200,18 +4180,18 @@ applicability.shouldUseRule = shouldUseRule;
4200
4180
  k = (0, s.and)(k, R(V, I, D, w));
4201
4181
  return k;
4202
4182
  }
4203
- e.checkDataTypes = v;
4204
- const g = {
4205
- message: ({ schema: S }) => `must be ${S}`,
4206
- params: ({ schema: S, schemaValue: I }) => typeof S == "string" ? (0, s._)`{type: ${S}}` : (0, s._)`{type: ${I}}`
4183
+ e.checkDataTypes = T;
4184
+ const y = {
4185
+ message: ({ schema: P }) => `must be ${P}`,
4186
+ params: ({ schema: P, schemaValue: I }) => typeof P == "string" ? (0, s._)`{type: ${P}}` : (0, s._)`{type: ${I}}`
4207
4187
  };
4208
- function m(S) {
4209
- const I = T(S);
4210
- (0, n.reportError)(I, g);
4188
+ function _(P) {
4189
+ const I = g(P);
4190
+ (0, n.reportError)(I, y);
4211
4191
  }
4212
- e.reportTypeError = m;
4213
- function T(S) {
4214
- const { gen: I, data: D, schema: w } = S, k = (0, i.schemaRefOrVal)(S, w, "type");
4192
+ e.reportTypeError = _;
4193
+ function g(P) {
4194
+ const { gen: I, data: D, schema: w } = P, k = (0, i.schemaRefOrVal)(P, w, "type");
4215
4195
  return {
4216
4196
  gen: I,
4217
4197
  keyword: "type",
@@ -4221,7 +4201,7 @@ applicability.shouldUseRule = shouldUseRule;
4221
4201
  schemaValue: k,
4222
4202
  parentSchema: w,
4223
4203
  params: {},
4224
- it: S
4204
+ it: P
4225
4205
  };
4226
4206
  }
4227
4207
  })(dataType);
@@ -4381,27 +4361,27 @@ function funcKeywordCode(e, t) {
4381
4361
  e.block$data($, O), e.ok((r = t.valid) !== null && r !== void 0 ? r : $);
4382
4362
  function O() {
4383
4363
  if (t.errors === !1)
4384
- v(), t.modifying && modifyData(e), g(() => e.error());
4364
+ T(), t.modifying && modifyData(e), y(() => e.error());
4385
4365
  else {
4386
- const m = t.async ? N() : R();
4387
- t.modifying && modifyData(e), g(() => addErrs(e, m));
4366
+ const _ = t.async ? N() : R();
4367
+ t.modifying && modifyData(e), y(() => addErrs(e, _));
4388
4368
  }
4389
4369
  }
4390
4370
  function N() {
4391
- const m = n.let("ruleErrs", null);
4392
- return n.try(() => v((0, codegen_1$p._)`await `), (T) => n.assign($, !1).if((0, codegen_1$p._)`${T} instanceof ${d.ValidationError}`, () => n.assign(m, (0, codegen_1$p._)`${T}.errors`), () => n.throw(T))), m;
4371
+ const _ = n.let("ruleErrs", null);
4372
+ return n.try(() => T((0, codegen_1$p._)`await `), (g) => n.assign($, !1).if((0, codegen_1$p._)`${g} instanceof ${d.ValidationError}`, () => n.assign(_, (0, codegen_1$p._)`${g}.errors`), () => n.throw(g))), _;
4393
4373
  }
4394
4374
  function R() {
4395
- const m = (0, codegen_1$p._)`${p}.errors`;
4396
- return n.assign(m, null), v(codegen_1$p.nil), m;
4375
+ const _ = (0, codegen_1$p._)`${p}.errors`;
4376
+ return n.assign(_, null), T(codegen_1$p.nil), _;
4397
4377
  }
4398
- function v(m = t.async ? (0, codegen_1$p._)`await ` : codegen_1$p.nil) {
4399
- const T = d.opts.passContext ? names_1$4.default.this : names_1$4.default.self, S = !("compile" in t && !l || t.schema === !1);
4400
- n.assign($, (0, codegen_1$p._)`${m}${(0, code_1$9.callValidateCode)(e, p, T, S)}`, t.modifying);
4378
+ function T(_ = t.async ? (0, codegen_1$p._)`await ` : codegen_1$p.nil) {
4379
+ const g = d.opts.passContext ? names_1$4.default.this : names_1$4.default.self, P = !("compile" in t && !l || t.schema === !1);
4380
+ n.assign($, (0, codegen_1$p._)`${_}${(0, code_1$9.callValidateCode)(e, p, g, P)}`, t.modifying);
4401
4381
  }
4402
- function g(m) {
4403
- var T;
4404
- n.if((0, codegen_1$p.not)((T = t.valid) !== null && T !== void 0 ? T : $), m);
4382
+ function y(_) {
4383
+ var g;
4384
+ n.if((0, codegen_1$p.not)((g = t.valid) !== null && g !== void 0 ? g : $), _);
4405
4385
  }
4406
4386
  }
4407
4387
  keyword.funcKeywordCode = funcKeywordCode;
@@ -4683,22 +4663,22 @@ function getSchemaRefs(e, t) {
4683
4663
  return traverse(e, { allKeys: !0 }, ($, O, N, R) => {
4684
4664
  if (R === void 0)
4685
4665
  return;
4686
- const v = o + O;
4687
- let g = i[R];
4688
- typeof $[r] == "string" && (g = m.call(this, $[r])), T.call(this, $.$anchor), T.call(this, $.$dynamicAnchor), i[O] = g;
4689
- function m(S) {
4666
+ const T = o + O;
4667
+ let y = i[R];
4668
+ typeof $[r] == "string" && (y = _.call(this, $[r])), g.call(this, $.$anchor), g.call(this, $.$dynamicAnchor), i[O] = y;
4669
+ function _(P) {
4690
4670
  const I = this.opts.uriResolver.resolve;
4691
- if (S = normalizeId(g ? I(g, S) : S), d.has(S))
4692
- throw p(S);
4693
- d.add(S);
4694
- let D = this.refs[S];
4695
- return typeof D == "string" && (D = this.refs[D]), typeof D == "object" ? u($, D.schema, S) : S !== normalizeId(v) && (S[0] === "#" ? (u($, l[S], S), l[S] = $) : this.refs[S] = v), S;
4696
- }
4697
- function T(S) {
4698
- if (typeof S == "string") {
4699
- if (!ANCHOR.test(S))
4700
- throw new Error(`invalid anchor "${S}"`);
4701
- m.call(this, `#${S}`);
4671
+ if (P = normalizeId(y ? I(y, P) : P), d.has(P))
4672
+ throw p(P);
4673
+ d.add(P);
4674
+ let D = this.refs[P];
4675
+ return typeof D == "string" && (D = this.refs[D]), typeof D == "object" ? u($, D.schema, P) : P !== normalizeId(T) && (P[0] === "#" ? (u($, l[P], P), l[P] = $) : this.refs[P] = T), P;
4676
+ }
4677
+ function g(P) {
4678
+ if (typeof P == "string") {
4679
+ if (!ANCHOR.test(P))
4680
+ throw new Error(`invalid anchor "${P}"`);
4681
+ _.call(this, `#${P}`);
4702
4682
  }
4703
4683
  }
4704
4684
  }), l;
@@ -5094,12 +5074,12 @@ function compileSchema(e) {
5094
5074
  p = `${o.scopeRefs(names_1$2.default.scope)}return ${$}`, this.opts.code.process && (p = this.opts.code.process(p, e));
5095
5075
  const N = new Function(`${names_1$2.default.self}`, `${names_1$2.default.scope}`, p)(this, this.scope.get());
5096
5076
  if (this.scope.value(d, { ref: N }), N.errors = null, N.schema = e.schema, N.schemaEnv = e, e.$async && (N.$async = !0), this.opts.code.source === !0 && (N.source = { validateName: d, validateCode: $, scopeValues: o._values }), this.opts.unevaluated) {
5097
- const { props: R, items: v } = u;
5077
+ const { props: R, items: T } = u;
5098
5078
  N.evaluated = {
5099
5079
  props: R instanceof codegen_1$m.Name ? void 0 : R,
5100
- items: v instanceof codegen_1$m.Name ? void 0 : v,
5080
+ items: T instanceof codegen_1$m.Name ? void 0 : T,
5101
5081
  dynamicProps: R instanceof codegen_1$m.Name,
5102
- dynamicItems: v instanceof codegen_1$m.Name
5082
+ dynamicItems: T instanceof codegen_1$m.Name
5103
5083
  }, N.source && (N.source.evaluated = (0, codegen_1$m.stringify)(N.evaluated));
5104
5084
  }
5105
5085
  return e.validate = N, e;
@@ -5221,13 +5201,13 @@ var uri$1 = {}, uri_all = { exports: {} };
5221
5201
  n(t);
5222
5202
  })(commonjsGlobal, function(r) {
5223
5203
  function n() {
5224
- for (var f = arguments.length, c = Array(f), _ = 0; _ < f; _++)
5225
- c[_] = arguments[_];
5204
+ for (var f = arguments.length, c = Array(f), m = 0; m < f; m++)
5205
+ c[m] = arguments[m];
5226
5206
  if (c.length > 1) {
5227
5207
  c[0] = c[0].slice(0, -1);
5228
- for (var E = c.length - 1, b = 1; b < E; ++b)
5229
- c[b] = c[b].slice(1, -1);
5230
- return c[E] = c[E].slice(1), c.join("");
5208
+ for (var S = c.length - 1, E = 1; E < S; ++E)
5209
+ c[E] = c[E].slice(1, -1);
5210
+ return c[S] = c[S].slice(1), c.join("");
5231
5211
  } else
5232
5212
  return c[0];
5233
5213
  }
@@ -5244,20 +5224,20 @@ var uri$1 = {}, uri_all = { exports: {} };
5244
5224
  return f != null ? f instanceof Array ? f : typeof f.length != "number" || f.split || f.setInterval || f.call ? [f] : Array.prototype.slice.call(f) : [];
5245
5225
  }
5246
5226
  function d(f, c) {
5247
- var _ = f;
5227
+ var m = f;
5248
5228
  if (c)
5249
- for (var E in c)
5250
- _[E] = c[E];
5251
- return _;
5229
+ for (var S in c)
5230
+ m[S] = c[S];
5231
+ return m;
5252
5232
  }
5253
5233
  function u(f) {
5254
- var c = "[A-Za-z]", _ = "[0-9]", E = n(_, "[A-Fa-f]"), b = s(s("%[EFef]" + E + "%" + E + E + "%" + E + E) + "|" + s("%[89A-Fa-f]" + E + "%" + E + E) + "|" + s("%" + E + E)), U = "[\\:\\/\\?\\#\\[\\]\\@]", L = "[\\!\\$\\&\\'\\(\\)\\*\\+\\,\\;\\=]", J = n(U, L), Y = f ? "[\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]" : "[]", se = f ? "[\\uE000-\\uF8FF]" : "[]", B = n(c, _, "[\\-\\.\\_\\~]", Y);
5255
- s(c + n(c, _, "[\\+\\-\\.]") + "*"), s(s(b + "|" + n(B, L, "[\\:]")) + "*");
5256
- var Z = s(s("25[0-5]") + "|" + s("2[0-4]" + _) + "|" + s("1" + _ + _) + "|" + s("0?[1-9]" + _) + "|0?0?" + _), ie = s(Z + "\\." + Z + "\\." + Z + "\\." + Z), z = s(E + "{1,4}"), X = s(s(z + "\\:" + z) + "|" + ie), ae = s(s(z + "\\:") + "{6}" + X), ee = s("\\:\\:" + s(z + "\\:") + "{5}" + X), Se = s(s(z) + "?\\:\\:" + s(z + "\\:") + "{4}" + X), $e = s(s(s(z + "\\:") + "{0,1}" + z) + "?\\:\\:" + s(z + "\\:") + "{3}" + X), ge = s(s(s(z + "\\:") + "{0,2}" + z) + "?\\:\\:" + s(z + "\\:") + "{2}" + X), Be = s(s(s(z + "\\:") + "{0,3}" + z) + "?\\:\\:" + z + "\\:" + X), Ie = s(s(s(z + "\\:") + "{0,4}" + z) + "?\\:\\:" + X), fe = s(s(s(z + "\\:") + "{0,5}" + z) + "?\\:\\:" + z), ye = s(s(s(z + "\\:") + "{0,6}" + z) + "?\\:\\:"), je = s([ae, ee, Se, $e, ge, Be, Ie, fe, ye].join("|")), we = s(s(B + "|" + b) + "+");
5257
- s("[vV]" + E + "+\\." + n(B, L, "[\\:]") + "+"), s(s(b + "|" + n(B, L)) + "*");
5258
- var ct = s(b + "|" + n(B, L, "[\\:\\@]"));
5259
- return s(s(b + "|" + n(B, L, "[\\@]")) + "+"), s(s(ct + "|" + n("[\\/\\?]", se)) + "*"), {
5260
- NOT_SCHEME: new RegExp(n("[^]", c, _, "[\\+\\-\\.]"), "g"),
5234
+ var c = "[A-Za-z]", m = "[0-9]", S = n(m, "[A-Fa-f]"), E = s(s("%[EFef]" + S + "%" + S + S + "%" + S + S) + "|" + s("%[89A-Fa-f]" + S + "%" + S + S) + "|" + s("%" + S + S)), U = "[\\:\\/\\?\\#\\[\\]\\@]", L = "[\\!\\$\\&\\'\\(\\)\\*\\+\\,\\;\\=]", J = n(U, L), Y = f ? "[\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]" : "[]", se = f ? "[\\uE000-\\uF8FF]" : "[]", B = n(c, m, "[\\-\\.\\_\\~]", Y);
5235
+ s(c + n(c, m, "[\\+\\-\\.]") + "*"), s(s(E + "|" + n(B, L, "[\\:]")) + "*");
5236
+ var Z = s(s("25[0-5]") + "|" + s("2[0-4]" + m) + "|" + s("1" + m + m) + "|" + s("0?[1-9]" + m) + "|0?0?" + m), ie = s(Z + "\\." + Z + "\\." + Z + "\\." + Z), z = s(S + "{1,4}"), X = s(s(z + "\\:" + z) + "|" + ie), ae = s(s(z + "\\:") + "{6}" + X), ee = s("\\:\\:" + s(z + "\\:") + "{5}" + X), Se = s(s(z) + "?\\:\\:" + s(z + "\\:") + "{4}" + X), $e = s(s(s(z + "\\:") + "{0,1}" + z) + "?\\:\\:" + s(z + "\\:") + "{3}" + X), ge = s(s(s(z + "\\:") + "{0,2}" + z) + "?\\:\\:" + s(z + "\\:") + "{2}" + X), Be = s(s(s(z + "\\:") + "{0,3}" + z) + "?\\:\\:" + z + "\\:" + X), Ie = s(s(s(z + "\\:") + "{0,4}" + z) + "?\\:\\:" + X), fe = s(s(s(z + "\\:") + "{0,5}" + z) + "?\\:\\:" + z), ye = s(s(s(z + "\\:") + "{0,6}" + z) + "?\\:\\:"), je = s([ae, ee, Se, $e, ge, Be, Ie, fe, ye].join("|")), we = s(s(B + "|" + E) + "+");
5237
+ s("[vV]" + S + "+\\." + n(B, L, "[\\:]") + "+"), s(s(E + "|" + n(B, L)) + "*");
5238
+ var ct = s(E + "|" + n(B, L, "[\\:\\@]"));
5239
+ return s(s(E + "|" + n(B, L, "[\\@]")) + "+"), s(s(ct + "|" + n("[\\/\\?]", se)) + "*"), {
5240
+ NOT_SCHEME: new RegExp(n("[^]", c, m, "[\\+\\-\\.]"), "g"),
5261
5241
  NOT_USERINFO: new RegExp(n("[^\\%\\:]", B, L), "g"),
5262
5242
  NOT_HOST: new RegExp(n("[^\\%\\[\\]\\:]", B, L), "g"),
5263
5243
  NOT_PATH: new RegExp(n("[^\\%\\/\\:\\@]", B, L), "g"),
@@ -5267,123 +5247,123 @@ var uri$1 = {}, uri_all = { exports: {} };
5267
5247
  ESCAPE: new RegExp(n("[^]", B, L), "g"),
5268
5248
  UNRESERVED: new RegExp(B, "g"),
5269
5249
  OTHER_CHARS: new RegExp(n("[^\\%]", B, J), "g"),
5270
- PCT_ENCODED: new RegExp(b, "g"),
5250
+ PCT_ENCODED: new RegExp(E, "g"),
5271
5251
  IPV4ADDRESS: new RegExp("^(" + ie + ")$"),
5272
- IPV6ADDRESS: new RegExp("^\\[?(" + je + ")" + s(s("\\%25|\\%(?!" + E + "{2})") + "(" + we + ")") + "?\\]?$")
5252
+ IPV6ADDRESS: new RegExp("^\\[?(" + je + ")" + s(s("\\%25|\\%(?!" + S + "{2})") + "(" + we + ")") + "?\\]?$")
5273
5253
  //RFC 6874, with relaxed parsing rules
5274
5254
  };
5275
5255
  }
5276
5256
  var p = u(!1), $ = u(!0), O = function() {
5277
- function f(c, _) {
5278
- var E = [], b = !0, U = !1, L = void 0;
5257
+ function f(c, m) {
5258
+ var S = [], E = !0, U = !1, L = void 0;
5279
5259
  try {
5280
- for (var J = c[Symbol.iterator](), Y; !(b = (Y = J.next()).done) && (E.push(Y.value), !(_ && E.length === _)); b = !0)
5260
+ for (var J = c[Symbol.iterator](), Y; !(E = (Y = J.next()).done) && (S.push(Y.value), !(m && S.length === m)); E = !0)
5281
5261
  ;
5282
5262
  } catch (se) {
5283
5263
  U = !0, L = se;
5284
5264
  } finally {
5285
5265
  try {
5286
- !b && J.return && J.return();
5266
+ !E && J.return && J.return();
5287
5267
  } finally {
5288
5268
  if (U)
5289
5269
  throw L;
5290
5270
  }
5291
5271
  }
5292
- return E;
5272
+ return S;
5293
5273
  }
5294
- return function(c, _) {
5274
+ return function(c, m) {
5295
5275
  if (Array.isArray(c))
5296
5276
  return c;
5297
5277
  if (Symbol.iterator in Object(c))
5298
- return f(c, _);
5278
+ return f(c, m);
5299
5279
  throw new TypeError("Invalid attempt to destructure non-iterable instance");
5300
5280
  };
5301
5281
  }(), N = function(f) {
5302
5282
  if (Array.isArray(f)) {
5303
- for (var c = 0, _ = Array(f.length); c < f.length; c++)
5304
- _[c] = f[c];
5305
- return _;
5283
+ for (var c = 0, m = Array(f.length); c < f.length; c++)
5284
+ m[c] = f[c];
5285
+ return m;
5306
5286
  } else
5307
5287
  return Array.from(f);
5308
- }, R = 2147483647, v = 36, g = 1, m = 26, T = 38, S = 700, I = 72, D = 128, w = "-", k = /^xn--/, A = /[^\0-\x7E]/, V = /[\x2E\u3002\uFF0E\uFF61]/g, x = {
5288
+ }, R = 2147483647, T = 36, y = 1, _ = 26, g = 38, P = 700, I = 72, D = 128, w = "-", k = /^xn--/, A = /[^\0-\x7E]/, V = /[\x2E\u3002\uFF0E\uFF61]/g, x = {
5309
5289
  overflow: "Overflow: input needs wider integers to process",
5310
5290
  "not-basic": "Illegal input >= 0x80 (not a basic code point)",
5311
5291
  "invalid-input": "Invalid input"
5312
- }, re = v - g, K = Math.floor, ue = String.fromCharCode;
5292
+ }, re = T - y, K = Math.floor, ue = String.fromCharCode;
5313
5293
  function oe(f) {
5314
5294
  throw new RangeError(x[f]);
5315
5295
  }
5316
5296
  function ke(f, c) {
5317
- for (var _ = [], E = f.length; E--; )
5318
- _[E] = c(f[E]);
5319
- return _;
5297
+ for (var m = [], S = f.length; S--; )
5298
+ m[S] = c(f[S]);
5299
+ return m;
5320
5300
  }
5321
- function Oe(f, c) {
5322
- var _ = f.split("@"), E = "";
5323
- _.length > 1 && (E = _[0] + "@", f = _[1]), f = f.replace(V, ".");
5324
- var b = f.split("."), U = ke(b, c).join(".");
5325
- return E + U;
5301
+ function Ce(f, c) {
5302
+ var m = f.split("@"), S = "";
5303
+ m.length > 1 && (S = m[0] + "@", f = m[1]), f = f.replace(V, ".");
5304
+ var E = f.split("."), U = ke(E, c).join(".");
5305
+ return S + U;
5326
5306
  }
5327
5307
  function qe(f) {
5328
- for (var c = [], _ = 0, E = f.length; _ < E; ) {
5329
- var b = f.charCodeAt(_++);
5330
- if (b >= 55296 && b <= 56319 && _ < E) {
5331
- var U = f.charCodeAt(_++);
5332
- (U & 64512) == 56320 ? c.push(((b & 1023) << 10) + (U & 1023) + 65536) : (c.push(b), _--);
5308
+ for (var c = [], m = 0, S = f.length; m < S; ) {
5309
+ var E = f.charCodeAt(m++);
5310
+ if (E >= 55296 && E <= 56319 && m < S) {
5311
+ var U = f.charCodeAt(m++);
5312
+ (U & 64512) == 56320 ? c.push(((E & 1023) << 10) + (U & 1023) + 65536) : (c.push(E), m--);
5333
5313
  } else
5334
- c.push(b);
5314
+ c.push(E);
5335
5315
  }
5336
5316
  return c;
5337
5317
  }
5338
5318
  var et = function(c) {
5339
5319
  return String.fromCodePoint.apply(String, N(c));
5340
5320
  }, Ue = function(c) {
5341
- return c - 48 < 10 ? c - 22 : c - 65 < 26 ? c - 65 : c - 97 < 26 ? c - 97 : v;
5342
- }, F = function(c, _) {
5343
- return c + 22 + 75 * (c < 26) - ((_ != 0) << 5);
5344
- }, y = function(c, _, E) {
5345
- var b = 0;
5321
+ return c - 48 < 10 ? c - 22 : c - 65 < 26 ? c - 65 : c - 97 < 26 ? c - 97 : T;
5322
+ }, F = function(c, m) {
5323
+ return c + 22 + 75 * (c < 26) - ((m != 0) << 5);
5324
+ }, v = function(c, m, S) {
5325
+ var E = 0;
5346
5326
  for (
5347
- c = E ? K(c / S) : c >> 1, c += K(c / _);
5327
+ c = S ? K(c / P) : c >> 1, c += K(c / m);
5348
5328
  /* no initialization */
5349
- c > re * m >> 1;
5350
- b += v
5329
+ c > re * _ >> 1;
5330
+ E += T
5351
5331
  )
5352
5332
  c = K(c / re);
5353
- return K(b + (re + 1) * c / (c + T));
5333
+ return K(E + (re + 1) * c / (c + g));
5354
5334
  }, j = function(c) {
5355
- var _ = [], E = c.length, b = 0, U = D, L = I, J = c.lastIndexOf(w);
5335
+ var m = [], S = c.length, E = 0, U = D, L = I, J = c.lastIndexOf(w);
5356
5336
  J < 0 && (J = 0);
5357
5337
  for (var Y = 0; Y < J; ++Y)
5358
- c.charCodeAt(Y) >= 128 && oe("not-basic"), _.push(c.charCodeAt(Y));
5359
- for (var se = J > 0 ? J + 1 : 0; se < E; ) {
5338
+ c.charCodeAt(Y) >= 128 && oe("not-basic"), m.push(c.charCodeAt(Y));
5339
+ for (var se = J > 0 ? J + 1 : 0; se < S; ) {
5360
5340
  for (
5361
- var B = b, Z = 1, ie = v;
5341
+ var B = E, Z = 1, ie = T;
5362
5342
  ;
5363
5343
  /* no condition */
5364
- ie += v
5344
+ ie += T
5365
5345
  ) {
5366
- se >= E && oe("invalid-input");
5346
+ se >= S && oe("invalid-input");
5367
5347
  var z = Ue(c.charCodeAt(se++));
5368
- (z >= v || z > K((R - b) / Z)) && oe("overflow"), b += z * Z;
5369
- var X = ie <= L ? g : ie >= L + m ? m : ie - L;
5348
+ (z >= T || z > K((R - E) / Z)) && oe("overflow"), E += z * Z;
5349
+ var X = ie <= L ? y : ie >= L + _ ? _ : ie - L;
5370
5350
  if (z < X)
5371
5351
  break;
5372
- var ae = v - X;
5352
+ var ae = T - X;
5373
5353
  Z > K(R / ae) && oe("overflow"), Z *= ae;
5374
5354
  }
5375
- var ee = _.length + 1;
5376
- L = y(b - B, ee, B == 0), K(b / ee) > R - U && oe("overflow"), U += K(b / ee), b %= ee, _.splice(b++, 0, U);
5355
+ var ee = m.length + 1;
5356
+ L = v(E - B, ee, B == 0), K(E / ee) > R - U && oe("overflow"), U += K(E / ee), E %= ee, m.splice(E++, 0, U);
5377
5357
  }
5378
- return String.fromCodePoint.apply(String, _);
5379
- }, P = function(c) {
5380
- var _ = [];
5358
+ return String.fromCodePoint.apply(String, m);
5359
+ }, b = function(c) {
5360
+ var m = [];
5381
5361
  c = qe(c);
5382
- var E = c.length, b = D, U = 0, L = I, J = !0, Y = !1, se = void 0;
5362
+ var S = c.length, E = D, U = 0, L = I, J = !0, Y = !1, se = void 0;
5383
5363
  try {
5384
5364
  for (var B = c[Symbol.iterator](), Z; !(J = (Z = B.next()).done); J = !0) {
5385
5365
  var ie = Z.value;
5386
- ie < 128 && _.push(ue(ie));
5366
+ ie < 128 && m.push(ue(ie));
5387
5367
  }
5388
5368
  } catch (lt) {
5389
5369
  Y = !0, se = lt;
@@ -5395,13 +5375,13 @@ var uri$1 = {}, uri_all = { exports: {} };
5395
5375
  throw se;
5396
5376
  }
5397
5377
  }
5398
- var z = _.length, X = z;
5399
- for (z && _.push(w); X < E; ) {
5378
+ var z = m.length, X = z;
5379
+ for (z && m.push(w); X < S; ) {
5400
5380
  var ae = R, ee = !0, Se = !1, $e = void 0;
5401
5381
  try {
5402
5382
  for (var ge = c[Symbol.iterator](), Be; !(ee = (Be = ge.next()).done); ee = !0) {
5403
5383
  var Ie = Be.value;
5404
- Ie >= b && Ie < ae && (ae = Ie);
5384
+ Ie >= E && Ie < ae && (ae = Ie);
5405
5385
  }
5406
5386
  } catch (lt) {
5407
5387
  Se = !0, $e = lt;
@@ -5414,25 +5394,25 @@ var uri$1 = {}, uri_all = { exports: {} };
5414
5394
  }
5415
5395
  }
5416
5396
  var fe = X + 1;
5417
- ae - b > K((R - U) / fe) && oe("overflow"), U += (ae - b) * fe, b = ae;
5397
+ ae - E > K((R - U) / fe) && oe("overflow"), U += (ae - E) * fe, E = ae;
5418
5398
  var ye = !0, je = !1, we = void 0;
5419
5399
  try {
5420
5400
  for (var ct = c[Symbol.iterator](), Lt; !(ye = (Lt = ct.next()).done); ye = !0) {
5421
5401
  var Ht = Lt.value;
5422
- if (Ht < b && ++U > R && oe("overflow"), Ht == b) {
5402
+ if (Ht < E && ++U > R && oe("overflow"), Ht == E) {
5423
5403
  for (
5424
- var pt = U, ft = v;
5404
+ var pt = U, ft = T;
5425
5405
  ;
5426
5406
  /* no condition */
5427
- ft += v
5407
+ ft += T
5428
5408
  ) {
5429
- var ht = ft <= L ? g : ft >= L + m ? m : ft - L;
5409
+ var ht = ft <= L ? y : ft >= L + _ ? _ : ft - L;
5430
5410
  if (pt < ht)
5431
5411
  break;
5432
- var Vt = pt - ht, zt = v - ht;
5433
- _.push(ue(F(ht + Vt % zt, 0))), pt = K(Vt / zt);
5412
+ var Vt = pt - ht, zt = T - ht;
5413
+ m.push(ue(F(ht + Vt % zt, 0))), pt = K(Vt / zt);
5434
5414
  }
5435
- _.push(ue(F(pt, 0))), L = y(U, fe, X == z), U = 0, ++X;
5415
+ m.push(ue(F(pt, 0))), L = v(U, fe, X == z), U = 0, ++X;
5436
5416
  }
5437
5417
  }
5438
5418
  } catch (lt) {
@@ -5445,16 +5425,16 @@ var uri$1 = {}, uri_all = { exports: {} };
5445
5425
  throw we;
5446
5426
  }
5447
5427
  }
5448
- ++U, ++b;
5428
+ ++U, ++E;
5449
5429
  }
5450
- return _.join("");
5430
+ return m.join("");
5451
5431
  }, a = function(c) {
5452
- return Oe(c, function(_) {
5453
- return k.test(_) ? j(_.slice(4).toLowerCase()) : _;
5432
+ return Ce(c, function(m) {
5433
+ return k.test(m) ? j(m.slice(4).toLowerCase()) : m;
5454
5434
  });
5455
5435
  }, h = function(c) {
5456
- return Oe(c, function(_) {
5457
- return A.test(_) ? "xn--" + P(_) : _;
5436
+ return Ce(c, function(m) {
5437
+ return A.test(m) ? "xn--" + b(m) : m;
5458
5438
  });
5459
5439
  }, C = {
5460
5440
  /**
@@ -5475,56 +5455,56 @@ var uri$1 = {}, uri_all = { exports: {} };
5475
5455
  encode: et
5476
5456
  },
5477
5457
  decode: j,
5478
- encode: P,
5458
+ encode: b,
5479
5459
  toASCII: h,
5480
5460
  toUnicode: a
5481
5461
  }, M = {};
5482
5462
  function q(f) {
5483
- var c = f.charCodeAt(0), _ = void 0;
5484
- return c < 16 ? _ = "%0" + c.toString(16).toUpperCase() : c < 128 ? _ = "%" + c.toString(16).toUpperCase() : c < 2048 ? _ = "%" + (c >> 6 | 192).toString(16).toUpperCase() + "%" + (c & 63 | 128).toString(16).toUpperCase() : _ = "%" + (c >> 12 | 224).toString(16).toUpperCase() + "%" + (c >> 6 & 63 | 128).toString(16).toUpperCase() + "%" + (c & 63 | 128).toString(16).toUpperCase(), _;
5463
+ var c = f.charCodeAt(0), m = void 0;
5464
+ return c < 16 ? m = "%0" + c.toString(16).toUpperCase() : c < 128 ? m = "%" + c.toString(16).toUpperCase() : c < 2048 ? m = "%" + (c >> 6 | 192).toString(16).toUpperCase() + "%" + (c & 63 | 128).toString(16).toUpperCase() : m = "%" + (c >> 12 | 224).toString(16).toUpperCase() + "%" + (c >> 6 & 63 | 128).toString(16).toUpperCase() + "%" + (c & 63 | 128).toString(16).toUpperCase(), m;
5485
5465
  }
5486
5466
  function W(f) {
5487
- for (var c = "", _ = 0, E = f.length; _ < E; ) {
5488
- var b = parseInt(f.substr(_ + 1, 2), 16);
5489
- if (b < 128)
5490
- c += String.fromCharCode(b), _ += 3;
5491
- else if (b >= 194 && b < 224) {
5492
- if (E - _ >= 6) {
5493
- var U = parseInt(f.substr(_ + 4, 2), 16);
5494
- c += String.fromCharCode((b & 31) << 6 | U & 63);
5467
+ for (var c = "", m = 0, S = f.length; m < S; ) {
5468
+ var E = parseInt(f.substr(m + 1, 2), 16);
5469
+ if (E < 128)
5470
+ c += String.fromCharCode(E), m += 3;
5471
+ else if (E >= 194 && E < 224) {
5472
+ if (S - m >= 6) {
5473
+ var U = parseInt(f.substr(m + 4, 2), 16);
5474
+ c += String.fromCharCode((E & 31) << 6 | U & 63);
5495
5475
  } else
5496
- c += f.substr(_, 6);
5497
- _ += 6;
5498
- } else if (b >= 224) {
5499
- if (E - _ >= 9) {
5500
- var L = parseInt(f.substr(_ + 4, 2), 16), J = parseInt(f.substr(_ + 7, 2), 16);
5501
- c += String.fromCharCode((b & 15) << 12 | (L & 63) << 6 | J & 63);
5476
+ c += f.substr(m, 6);
5477
+ m += 6;
5478
+ } else if (E >= 224) {
5479
+ if (S - m >= 9) {
5480
+ var L = parseInt(f.substr(m + 4, 2), 16), J = parseInt(f.substr(m + 7, 2), 16);
5481
+ c += String.fromCharCode((E & 15) << 12 | (L & 63) << 6 | J & 63);
5502
5482
  } else
5503
- c += f.substr(_, 9);
5504
- _ += 9;
5483
+ c += f.substr(m, 9);
5484
+ m += 9;
5505
5485
  } else
5506
- c += f.substr(_, 3), _ += 3;
5486
+ c += f.substr(m, 3), m += 3;
5507
5487
  }
5508
5488
  return c;
5509
5489
  }
5510
5490
  function G(f, c) {
5511
- function _(E) {
5512
- var b = W(E);
5513
- return b.match(c.UNRESERVED) ? b : E;
5491
+ function m(S) {
5492
+ var E = W(S);
5493
+ return E.match(c.UNRESERVED) ? E : S;
5514
5494
  }
5515
- return f.scheme && (f.scheme = String(f.scheme).replace(c.PCT_ENCODED, _).toLowerCase().replace(c.NOT_SCHEME, "")), f.userinfo !== void 0 && (f.userinfo = String(f.userinfo).replace(c.PCT_ENCODED, _).replace(c.NOT_USERINFO, q).replace(c.PCT_ENCODED, o)), f.host !== void 0 && (f.host = String(f.host).replace(c.PCT_ENCODED, _).toLowerCase().replace(c.NOT_HOST, q).replace(c.PCT_ENCODED, o)), f.path !== void 0 && (f.path = String(f.path).replace(c.PCT_ENCODED, _).replace(f.scheme ? c.NOT_PATH : c.NOT_PATH_NOSCHEME, q).replace(c.PCT_ENCODED, o)), f.query !== void 0 && (f.query = String(f.query).replace(c.PCT_ENCODED, _).replace(c.NOT_QUERY, q).replace(c.PCT_ENCODED, o)), f.fragment !== void 0 && (f.fragment = String(f.fragment).replace(c.PCT_ENCODED, _).replace(c.NOT_FRAGMENT, q).replace(c.PCT_ENCODED, o)), f;
5495
+ return f.scheme && (f.scheme = String(f.scheme).replace(c.PCT_ENCODED, m).toLowerCase().replace(c.NOT_SCHEME, "")), f.userinfo !== void 0 && (f.userinfo = String(f.userinfo).replace(c.PCT_ENCODED, m).replace(c.NOT_USERINFO, q).replace(c.PCT_ENCODED, o)), f.host !== void 0 && (f.host = String(f.host).replace(c.PCT_ENCODED, m).toLowerCase().replace(c.NOT_HOST, q).replace(c.PCT_ENCODED, o)), f.path !== void 0 && (f.path = String(f.path).replace(c.PCT_ENCODED, m).replace(f.scheme ? c.NOT_PATH : c.NOT_PATH_NOSCHEME, q).replace(c.PCT_ENCODED, o)), f.query !== void 0 && (f.query = String(f.query).replace(c.PCT_ENCODED, m).replace(c.NOT_QUERY, q).replace(c.PCT_ENCODED, o)), f.fragment !== void 0 && (f.fragment = String(f.fragment).replace(c.PCT_ENCODED, m).replace(c.NOT_FRAGMENT, q).replace(c.PCT_ENCODED, o)), f;
5516
5496
  }
5517
5497
  function ne(f) {
5518
5498
  return f.replace(/^0*(.*)/, "$1") || "0";
5519
5499
  }
5520
5500
  function he(f, c) {
5521
- var _ = f.match(c.IPV4ADDRESS) || [], E = O(_, 2), b = E[1];
5522
- return b ? b.split(".").map(ne).join(".") : f;
5501
+ var m = f.match(c.IPV4ADDRESS) || [], S = O(m, 2), E = S[1];
5502
+ return E ? E.split(".").map(ne).join(".") : f;
5523
5503
  }
5524
5504
  function Le(f, c) {
5525
- var _ = f.match(c.IPV6ADDRESS) || [], E = O(_, 3), b = E[1], U = E[2];
5526
- if (b) {
5527
- for (var L = b.toLowerCase().split("::").reverse(), J = O(L, 2), Y = J[0], se = J[1], B = se ? se.split(":").map(ne) : [], Z = Y.split(":").map(ne), ie = c.IPV4ADDRESS.test(Z[Z.length - 1]), z = ie ? 7 : 8, X = Z.length - z, ae = Array(z), ee = 0; ee < z; ++ee)
5505
+ var m = f.match(c.IPV6ADDRESS) || [], S = O(m, 3), E = S[1], U = S[2];
5506
+ if (E) {
5507
+ for (var L = E.toLowerCase().split("::").reverse(), J = O(L, 2), Y = J[0], se = J[1], B = se ? se.split(":").map(ne) : [], Z = Y.split(":").map(ne), ie = c.IPV4ADDRESS.test(Z[Z.length - 1]), z = ie ? 7 : 8, X = Z.length - z, ae = Array(z), ee = 0; ee < z; ++ee)
5528
5508
  ae[ee] = B[ee] || Z[X + ee] || "";
5529
5509
  ie && (ae[z - 1] = he(ae[z - 1], c));
5530
5510
  var Se = ae.reduce(function(fe, ye, je) {
@@ -5547,32 +5527,32 @@ var uri$1 = {}, uri_all = { exports: {} };
5547
5527
  }
5548
5528
  var tt = /^(?:([^:\/?#]+):)?(?:\/\/((?:([^\/?#@]*)@)?(\[[^\/?#\]]+\]|[^\/?#:]*)(?:\:(\d*))?))?([^?#]*)(?:\?([^#]*))?(?:#((?:.|\n|\r)*))?/i, rt = "".match(/(){0}/)[1] === void 0;
5549
5529
  function de(f) {
5550
- var c = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, _ = {}, E = c.iri !== !1 ? $ : p;
5530
+ var c = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, m = {}, S = c.iri !== !1 ? $ : p;
5551
5531
  c.reference === "suffix" && (f = (c.scheme ? c.scheme + ":" : "") + "//" + f);
5552
- var b = f.match(tt);
5553
- if (b) {
5554
- rt ? (_.scheme = b[1], _.userinfo = b[3], _.host = b[4], _.port = parseInt(b[5], 10), _.path = b[6] || "", _.query = b[7], _.fragment = b[8], isNaN(_.port) && (_.port = b[5])) : (_.scheme = b[1] || void 0, _.userinfo = f.indexOf("@") !== -1 ? b[3] : void 0, _.host = f.indexOf("//") !== -1 ? b[4] : void 0, _.port = parseInt(b[5], 10), _.path = b[6] || "", _.query = f.indexOf("?") !== -1 ? b[7] : void 0, _.fragment = f.indexOf("#") !== -1 ? b[8] : void 0, isNaN(_.port) && (_.port = f.match(/\/\/(?:.|\n)*\:(?:\/|\?|\#|$)/) ? b[4] : void 0)), _.host && (_.host = Le(he(_.host, E), E)), _.scheme === void 0 && _.userinfo === void 0 && _.host === void 0 && _.port === void 0 && !_.path && _.query === void 0 ? _.reference = "same-document" : _.scheme === void 0 ? _.reference = "relative" : _.fragment === void 0 ? _.reference = "absolute" : _.reference = "uri", c.reference && c.reference !== "suffix" && c.reference !== _.reference && (_.error = _.error || "URI is not a " + c.reference + " reference.");
5555
- var U = M[(c.scheme || _.scheme || "").toLowerCase()];
5532
+ var E = f.match(tt);
5533
+ if (E) {
5534
+ rt ? (m.scheme = E[1], m.userinfo = E[3], m.host = E[4], m.port = parseInt(E[5], 10), m.path = E[6] || "", m.query = E[7], m.fragment = E[8], isNaN(m.port) && (m.port = E[5])) : (m.scheme = E[1] || void 0, m.userinfo = f.indexOf("@") !== -1 ? E[3] : void 0, m.host = f.indexOf("//") !== -1 ? E[4] : void 0, m.port = parseInt(E[5], 10), m.path = E[6] || "", m.query = f.indexOf("?") !== -1 ? E[7] : void 0, m.fragment = f.indexOf("#") !== -1 ? E[8] : void 0, isNaN(m.port) && (m.port = f.match(/\/\/(?:.|\n)*\:(?:\/|\?|\#|$)/) ? E[4] : void 0)), m.host && (m.host = Le(he(m.host, S), S)), m.scheme === void 0 && m.userinfo === void 0 && m.host === void 0 && m.port === void 0 && !m.path && m.query === void 0 ? m.reference = "same-document" : m.scheme === void 0 ? m.reference = "relative" : m.fragment === void 0 ? m.reference = "absolute" : m.reference = "uri", c.reference && c.reference !== "suffix" && c.reference !== m.reference && (m.error = m.error || "URI is not a " + c.reference + " reference.");
5535
+ var U = M[(c.scheme || m.scheme || "").toLowerCase()];
5556
5536
  if (!c.unicodeSupport && (!U || !U.unicodeSupport)) {
5557
- if (_.host && (c.domainHost || U && U.domainHost))
5537
+ if (m.host && (c.domainHost || U && U.domainHost))
5558
5538
  try {
5559
- _.host = C.toASCII(_.host.replace(E.PCT_ENCODED, W).toLowerCase());
5539
+ m.host = C.toASCII(m.host.replace(S.PCT_ENCODED, W).toLowerCase());
5560
5540
  } catch (L) {
5561
- _.error = _.error || "Host's domain name can not be converted to ASCII via punycode: " + L;
5541
+ m.error = m.error || "Host's domain name can not be converted to ASCII via punycode: " + L;
5562
5542
  }
5563
- G(_, p);
5543
+ G(m, p);
5564
5544
  } else
5565
- G(_, E);
5566
- U && U.parse && U.parse(_, c);
5545
+ G(m, S);
5546
+ U && U.parse && U.parse(m, c);
5567
5547
  } else
5568
- _.error = _.error || "URI can not be parsed.";
5569
- return _;
5548
+ m.error = m.error || "URI can not be parsed.";
5549
+ return m;
5570
5550
  }
5571
5551
  function nt(f, c) {
5572
- var _ = c.iri !== !1 ? $ : p, E = [];
5573
- return f.userinfo !== void 0 && (E.push(f.userinfo), E.push("@")), f.host !== void 0 && E.push(Le(he(String(f.host), _), _).replace(_.IPV6ADDRESS, function(b, U, L) {
5552
+ var m = c.iri !== !1 ? $ : p, S = [];
5553
+ return f.userinfo !== void 0 && (S.push(f.userinfo), S.push("@")), f.host !== void 0 && S.push(Le(he(String(f.host), m), m).replace(m.IPV6ADDRESS, function(E, U, L) {
5574
5554
  return "[" + U + (L ? "%25" + L : "") + "]";
5575
- })), (typeof f.port == "number" || typeof f.port == "string") && (E.push(":"), E.push(String(f.port))), E.length ? E.join("") : void 0;
5555
+ })), (typeof f.port == "number" || typeof f.port == "string") && (S.push(":"), S.push(String(f.port))), S.length ? S.join("") : void 0;
5576
5556
  }
5577
5557
  var He = /^\.\.?\//, Ve = /^\/\.(\/|$)/, ze = /^\/\.\.(\/|$)/, st = /^\/?(?:.|\n)*?(?=\/|$)/;
5578
5558
  function me(f) {
@@ -5586,46 +5566,46 @@ var uri$1 = {}, uri_all = { exports: {} };
5586
5566
  else if (f === "." || f === "..")
5587
5567
  f = "";
5588
5568
  else {
5589
- var _ = f.match(st);
5590
- if (_) {
5591
- var E = _[0];
5592
- f = f.slice(E.length), c.push(E);
5569
+ var m = f.match(st);
5570
+ if (m) {
5571
+ var S = m[0];
5572
+ f = f.slice(S.length), c.push(S);
5593
5573
  } else
5594
5574
  throw new Error("Unexpected dot segment condition");
5595
5575
  }
5596
5576
  return c.join("");
5597
5577
  }
5598
5578
  function le(f) {
5599
- var c = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, _ = c.iri ? $ : p, E = [], b = M[(c.scheme || f.scheme || "").toLowerCase()];
5600
- if (b && b.serialize && b.serialize(f, c), f.host && !_.IPV6ADDRESS.test(f.host)) {
5601
- if (c.domainHost || b && b.domainHost)
5579
+ var c = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, m = c.iri ? $ : p, S = [], E = M[(c.scheme || f.scheme || "").toLowerCase()];
5580
+ if (E && E.serialize && E.serialize(f, c), f.host && !m.IPV6ADDRESS.test(f.host)) {
5581
+ if (c.domainHost || E && E.domainHost)
5602
5582
  try {
5603
- f.host = c.iri ? C.toUnicode(f.host) : C.toASCII(f.host.replace(_.PCT_ENCODED, W).toLowerCase());
5583
+ f.host = c.iri ? C.toUnicode(f.host) : C.toASCII(f.host.replace(m.PCT_ENCODED, W).toLowerCase());
5604
5584
  } catch (J) {
5605
5585
  f.error = f.error || "Host's domain name can not be converted to " + (c.iri ? "Unicode" : "ASCII") + " via punycode: " + J;
5606
5586
  }
5607
5587
  }
5608
- G(f, _), c.reference !== "suffix" && f.scheme && (E.push(f.scheme), E.push(":"));
5588
+ G(f, m), c.reference !== "suffix" && f.scheme && (S.push(f.scheme), S.push(":"));
5609
5589
  var U = nt(f, c);
5610
- if (U !== void 0 && (c.reference !== "suffix" && E.push("//"), E.push(U), f.path && f.path.charAt(0) !== "/" && E.push("/")), f.path !== void 0) {
5590
+ if (U !== void 0 && (c.reference !== "suffix" && S.push("//"), S.push(U), f.path && f.path.charAt(0) !== "/" && S.push("/")), f.path !== void 0) {
5611
5591
  var L = f.path;
5612
- !c.absolutePath && (!b || !b.absolutePath) && (L = me(L)), U === void 0 && (L = L.replace(/^\/\//, "/%2F")), E.push(L);
5592
+ !c.absolutePath && (!E || !E.absolutePath) && (L = me(L)), U === void 0 && (L = L.replace(/^\/\//, "/%2F")), S.push(L);
5613
5593
  }
5614
- return f.query !== void 0 && (E.push("?"), E.push(f.query)), f.fragment !== void 0 && (E.push("#"), E.push(f.fragment)), E.join("");
5594
+ return f.query !== void 0 && (S.push("?"), S.push(f.query)), f.fragment !== void 0 && (S.push("#"), S.push(f.fragment)), S.join("");
5615
5595
  }
5616
5596
  function xe(f, c) {
5617
- var _ = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}, E = arguments[3], b = {};
5618
- return E || (f = de(le(f, _), _), c = de(le(c, _), _)), _ = _ || {}, !_.tolerant && c.scheme ? (b.scheme = c.scheme, b.userinfo = c.userinfo, b.host = c.host, b.port = c.port, b.path = me(c.path || ""), b.query = c.query) : (c.userinfo !== void 0 || c.host !== void 0 || c.port !== void 0 ? (b.userinfo = c.userinfo, b.host = c.host, b.port = c.port, b.path = me(c.path || ""), b.query = c.query) : (c.path ? (c.path.charAt(0) === "/" ? b.path = me(c.path) : ((f.userinfo !== void 0 || f.host !== void 0 || f.port !== void 0) && !f.path ? b.path = "/" + c.path : f.path ? b.path = f.path.slice(0, f.path.lastIndexOf("/") + 1) + c.path : b.path = c.path, b.path = me(b.path)), b.query = c.query) : (b.path = f.path, c.query !== void 0 ? b.query = c.query : b.query = f.query), b.userinfo = f.userinfo, b.host = f.host, b.port = f.port), b.scheme = f.scheme), b.fragment = c.fragment, b;
5597
+ var m = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}, S = arguments[3], E = {};
5598
+ return S || (f = de(le(f, m), m), c = de(le(c, m), m)), m = m || {}, !m.tolerant && c.scheme ? (E.scheme = c.scheme, E.userinfo = c.userinfo, E.host = c.host, E.port = c.port, E.path = me(c.path || ""), E.query = c.query) : (c.userinfo !== void 0 || c.host !== void 0 || c.port !== void 0 ? (E.userinfo = c.userinfo, E.host = c.host, E.port = c.port, E.path = me(c.path || ""), E.query = c.query) : (c.path ? (c.path.charAt(0) === "/" ? E.path = me(c.path) : ((f.userinfo !== void 0 || f.host !== void 0 || f.port !== void 0) && !f.path ? E.path = "/" + c.path : f.path ? E.path = f.path.slice(0, f.path.lastIndexOf("/") + 1) + c.path : E.path = c.path, E.path = me(E.path)), E.query = c.query) : (E.path = f.path, c.query !== void 0 ? E.query = c.query : E.query = f.query), E.userinfo = f.userinfo, E.host = f.host, E.port = f.port), E.scheme = f.scheme), E.fragment = c.fragment, E;
5619
5599
  }
5620
- function it(f, c, _) {
5621
- var E = d({ scheme: "null" }, _);
5622
- return le(xe(de(f, E), de(c, E), E, !0), E);
5600
+ function it(f, c, m) {
5601
+ var S = d({ scheme: "null" }, m);
5602
+ return le(xe(de(f, S), de(c, S), S, !0), S);
5623
5603
  }
5624
- function Ce(f, c) {
5604
+ function Oe(f, c) {
5625
5605
  return typeof f == "string" ? f = le(de(f, c), c) : i(f) === "object" && (f = de(le(f, c), c)), f;
5626
5606
  }
5627
- function ot(f, c, _) {
5628
- return typeof f == "string" ? f = le(de(f, _), _) : i(f) === "object" && (f = le(f, _)), typeof c == "string" ? c = le(de(c, _), _) : i(c) === "object" && (c = le(c, _)), f === c;
5607
+ function ot(f, c, m) {
5608
+ return typeof f == "string" ? f = le(de(f, m), m) : i(f) === "object" && (f = le(f, m)), typeof c == "string" ? c = le(de(c, m), m) : i(c) === "object" && (c = le(c, m)), f === c;
5629
5609
  }
5630
5610
  function ut(f, c) {
5631
5611
  return f && f.toString().replace(!c || !c.iri ? p.ESCAPE : $.ESCAPE, q);
@@ -5636,12 +5616,12 @@ var uri$1 = {}, uri_all = { exports: {} };
5636
5616
  var Ne = {
5637
5617
  scheme: "http",
5638
5618
  domainHost: !0,
5639
- parse: function(c, _) {
5619
+ parse: function(c, m) {
5640
5620
  return c.host || (c.error = c.error || "HTTP URIs must have a host."), c;
5641
5621
  },
5642
- serialize: function(c, _) {
5643
- var E = String(c.scheme).toLowerCase() === "https";
5644
- return (c.port === (E ? 443 : 80) || c.port === "") && (c.port = void 0), c.path || (c.path = "/"), c;
5622
+ serialize: function(c, m) {
5623
+ var S = String(c.scheme).toLowerCase() === "https";
5624
+ return (c.port === (S ? 443 : 80) || c.port === "") && (c.port = void 0), c.path || (c.path = "/"), c;
5645
5625
  }
5646
5626
  }, It = {
5647
5627
  scheme: "https",
@@ -5655,13 +5635,13 @@ var uri$1 = {}, uri_all = { exports: {} };
5655
5635
  var at = {
5656
5636
  scheme: "ws",
5657
5637
  domainHost: !0,
5658
- parse: function(c, _) {
5659
- var E = c;
5660
- return E.secure = jt(E), E.resourceName = (E.path || "/") + (E.query ? "?" + E.query : ""), E.path = void 0, E.query = void 0, E;
5638
+ parse: function(c, m) {
5639
+ var S = c;
5640
+ return S.secure = jt(S), S.resourceName = (S.path || "/") + (S.query ? "?" + S.query : ""), S.path = void 0, S.query = void 0, S;
5661
5641
  },
5662
- serialize: function(c, _) {
5642
+ serialize: function(c, m) {
5663
5643
  if ((c.port === (jt(c) ? 443 : 80) || c.port === "") && (c.port = void 0), typeof c.secure == "boolean" && (c.scheme = c.secure ? "wss" : "ws", c.secure = void 0), c.resourceName) {
5664
- var E = c.resourceName.split("?"), b = O(E, 2), U = b[0], L = b[1];
5644
+ var S = c.resourceName.split("?"), E = O(S, 2), U = E[0], L = E[1];
5665
5645
  c.path = U && U !== "/" ? U : void 0, c.query = L, c.resourceName = void 0;
5666
5646
  }
5667
5647
  return c.fragment = void 0, c;
@@ -5672,100 +5652,100 @@ var uri$1 = {}, uri_all = { exports: {} };
5672
5652
  parse: at.parse,
5673
5653
  serialize: at.serialize
5674
5654
  }, ir = {}, Dt = "[A-Za-z0-9\\-\\.\\_\\~\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]", _e = "[0-9A-Fa-f]", or = s(s("%[EFef]" + _e + "%" + _e + _e + "%" + _e + _e) + "|" + s("%[89A-Fa-f]" + _e + "%" + _e + _e) + "|" + s("%" + _e + _e)), ar = "[A-Za-z0-9\\!\\$\\%\\'\\*\\+\\-\\^\\_\\`\\{\\|\\}\\~]", cr = "[\\!\\$\\%\\'\\(\\)\\*\\+\\,\\-\\.0-9\\<\\>A-Z\\x5E-\\x7E]", lr = n(cr, '[\\"\\\\]'), dr = "[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]", ur = new RegExp(Dt, "g"), We = new RegExp(or, "g"), pr = new RegExp(n("[^]", ar, "[\\.]", '[\\"]', lr), "g"), Ft = new RegExp(n("[^]", Dt, dr), "g"), fr = Ft;
5675
- function Ct(f) {
5655
+ function Ot(f) {
5676
5656
  var c = W(f);
5677
5657
  return c.match(ur) ? c : f;
5678
5658
  }
5679
5659
  var Mt = {
5680
5660
  scheme: "mailto",
5681
- parse: function(c, _) {
5682
- var E = c, b = E.to = E.path ? E.path.split(",") : [];
5683
- if (E.path = void 0, E.query) {
5684
- for (var U = !1, L = {}, J = E.query.split("&"), Y = 0, se = J.length; Y < se; ++Y) {
5661
+ parse: function(c, m) {
5662
+ var S = c, E = S.to = S.path ? S.path.split(",") : [];
5663
+ if (S.path = void 0, S.query) {
5664
+ for (var U = !1, L = {}, J = S.query.split("&"), Y = 0, se = J.length; Y < se; ++Y) {
5685
5665
  var B = J[Y].split("=");
5686
5666
  switch (B[0]) {
5687
5667
  case "to":
5688
5668
  for (var Z = B[1].split(","), ie = 0, z = Z.length; ie < z; ++ie)
5689
- b.push(Z[ie]);
5669
+ E.push(Z[ie]);
5690
5670
  break;
5691
5671
  case "subject":
5692
- E.subject = pe(B[1], _);
5672
+ S.subject = pe(B[1], m);
5693
5673
  break;
5694
5674
  case "body":
5695
- E.body = pe(B[1], _);
5675
+ S.body = pe(B[1], m);
5696
5676
  break;
5697
5677
  default:
5698
- U = !0, L[pe(B[0], _)] = pe(B[1], _);
5678
+ U = !0, L[pe(B[0], m)] = pe(B[1], m);
5699
5679
  break;
5700
5680
  }
5701
5681
  }
5702
- U && (E.headers = L);
5682
+ U && (S.headers = L);
5703
5683
  }
5704
- E.query = void 0;
5705
- for (var X = 0, ae = b.length; X < ae; ++X) {
5706
- var ee = b[X].split("@");
5707
- if (ee[0] = pe(ee[0]), _.unicodeSupport)
5708
- ee[1] = pe(ee[1], _).toLowerCase();
5684
+ S.query = void 0;
5685
+ for (var X = 0, ae = E.length; X < ae; ++X) {
5686
+ var ee = E[X].split("@");
5687
+ if (ee[0] = pe(ee[0]), m.unicodeSupport)
5688
+ ee[1] = pe(ee[1], m).toLowerCase();
5709
5689
  else
5710
5690
  try {
5711
- ee[1] = C.toASCII(pe(ee[1], _).toLowerCase());
5691
+ ee[1] = C.toASCII(pe(ee[1], m).toLowerCase());
5712
5692
  } catch (Se) {
5713
- E.error = E.error || "Email address's domain name can not be converted to ASCII via punycode: " + Se;
5693
+ S.error = S.error || "Email address's domain name can not be converted to ASCII via punycode: " + Se;
5714
5694
  }
5715
- b[X] = ee.join("@");
5695
+ E[X] = ee.join("@");
5716
5696
  }
5717
- return E;
5697
+ return S;
5718
5698
  },
5719
- serialize: function(c, _) {
5720
- var E = c, b = l(c.to);
5721
- if (b) {
5722
- for (var U = 0, L = b.length; U < L; ++U) {
5723
- var J = String(b[U]), Y = J.lastIndexOf("@"), se = J.slice(0, Y).replace(We, Ct).replace(We, o).replace(pr, q), B = J.slice(Y + 1);
5699
+ serialize: function(c, m) {
5700
+ var S = c, E = l(c.to);
5701
+ if (E) {
5702
+ for (var U = 0, L = E.length; U < L; ++U) {
5703
+ var J = String(E[U]), Y = J.lastIndexOf("@"), se = J.slice(0, Y).replace(We, Ot).replace(We, o).replace(pr, q), B = J.slice(Y + 1);
5724
5704
  try {
5725
- B = _.iri ? C.toUnicode(B) : C.toASCII(pe(B, _).toLowerCase());
5705
+ B = m.iri ? C.toUnicode(B) : C.toASCII(pe(B, m).toLowerCase());
5726
5706
  } catch (X) {
5727
- E.error = E.error || "Email address's domain name can not be converted to " + (_.iri ? "Unicode" : "ASCII") + " via punycode: " + X;
5707
+ S.error = S.error || "Email address's domain name can not be converted to " + (m.iri ? "Unicode" : "ASCII") + " via punycode: " + X;
5728
5708
  }
5729
- b[U] = se + "@" + B;
5709
+ E[U] = se + "@" + B;
5730
5710
  }
5731
- E.path = b.join(",");
5711
+ S.path = E.join(",");
5732
5712
  }
5733
5713
  var Z = c.headers = c.headers || {};
5734
5714
  c.subject && (Z.subject = c.subject), c.body && (Z.body = c.body);
5735
5715
  var ie = [];
5736
5716
  for (var z in Z)
5737
- Z[z] !== ir[z] && ie.push(z.replace(We, Ct).replace(We, o).replace(Ft, q) + "=" + Z[z].replace(We, Ct).replace(We, o).replace(fr, q));
5738
- return ie.length && (E.query = ie.join("&")), E;
5717
+ Z[z] !== ir[z] && ie.push(z.replace(We, Ot).replace(We, o).replace(Ft, q) + "=" + Z[z].replace(We, Ot).replace(We, o).replace(fr, q));
5718
+ return ie.length && (S.query = ie.join("&")), S;
5739
5719
  }
5740
5720
  }, hr = /^([^\:]+)\:(.*)/, qt = {
5741
5721
  scheme: "urn",
5742
- parse: function(c, _) {
5743
- var E = c.path && c.path.match(hr), b = c;
5744
- if (E) {
5745
- var U = _.scheme || b.scheme || "urn", L = E[1].toLowerCase(), J = E[2], Y = U + ":" + (_.nid || L), se = M[Y];
5746
- b.nid = L, b.nss = J, b.path = void 0, se && (b = se.parse(b, _));
5722
+ parse: function(c, m) {
5723
+ var S = c.path && c.path.match(hr), E = c;
5724
+ if (S) {
5725
+ var U = m.scheme || E.scheme || "urn", L = S[1].toLowerCase(), J = S[2], Y = U + ":" + (m.nid || L), se = M[Y];
5726
+ E.nid = L, E.nss = J, E.path = void 0, se && (E = se.parse(E, m));
5747
5727
  } else
5748
- b.error = b.error || "URN can not be parsed.";
5749
- return b;
5728
+ E.error = E.error || "URN can not be parsed.";
5729
+ return E;
5750
5730
  },
5751
- serialize: function(c, _) {
5752
- var E = _.scheme || c.scheme || "urn", b = c.nid, U = E + ":" + (_.nid || b), L = M[U];
5753
- L && (c = L.serialize(c, _));
5731
+ serialize: function(c, m) {
5732
+ var S = m.scheme || c.scheme || "urn", E = c.nid, U = S + ":" + (m.nid || E), L = M[U];
5733
+ L && (c = L.serialize(c, m));
5754
5734
  var J = c, Y = c.nss;
5755
- return J.path = (b || _.nid) + ":" + Y, J;
5735
+ return J.path = (E || m.nid) + ":" + Y, J;
5756
5736
  }
5757
5737
  }, mr = /^[0-9A-Fa-f]{8}(?:\-[0-9A-Fa-f]{4}){3}\-[0-9A-Fa-f]{12}$/, Ut = {
5758
5738
  scheme: "urn:uuid",
5759
- parse: function(c, _) {
5760
- var E = c;
5761
- return E.uuid = E.nss, E.nss = void 0, !_.tolerant && (!E.uuid || !E.uuid.match(mr)) && (E.error = E.error || "UUID is not valid."), E;
5739
+ parse: function(c, m) {
5740
+ var S = c;
5741
+ return S.uuid = S.nss, S.nss = void 0, !m.tolerant && (!S.uuid || !S.uuid.match(mr)) && (S.error = S.error || "UUID is not valid."), S;
5762
5742
  },
5763
- serialize: function(c, _) {
5764
- var E = c;
5765
- return E.nss = (c.uuid || "").toLowerCase(), E;
5743
+ serialize: function(c, m) {
5744
+ var S = c;
5745
+ return S.nss = (c.uuid || "").toLowerCase(), S;
5766
5746
  }
5767
5747
  };
5768
- M[Ne.scheme] = Ne, M[It.scheme] = It, M[at.scheme] = at, M[At.scheme] = At, M[Mt.scheme] = Mt, M[qt.scheme] = qt, M[Ut.scheme] = Ut, r.SCHEMES = M, r.pctEncChar = q, r.pctDecChars = W, r.parse = de, r.removeDotSegments = me, r.serialize = le, r.resolveComponents = xe, r.resolve = it, r.normalize = Ce, r.equal = ot, r.escapeComponent = ut, r.unescapeComponent = pe, Object.defineProperty(r, "__esModule", { value: !0 });
5748
+ M[Ne.scheme] = Ne, M[It.scheme] = It, M[at.scheme] = at, M[At.scheme] = At, M[Mt.scheme] = Mt, M[qt.scheme] = qt, M[Ut.scheme] = Ut, r.SCHEMES = M, r.pctEncChar = q, r.pctDecChars = W, r.parse = de, r.removeDotSegments = me, r.serialize = le, r.resolveComponents = xe, r.resolve = it, r.normalize = Oe, r.equal = ot, r.escapeComponent = ut, r.unescapeComponent = pe, Object.defineProperty(r, "__esModule", { value: !0 });
5769
5749
  });
5770
5750
  })(uri_all, uri_all.exports);
5771
5751
  var uri_allExports = uri_all.exports;
@@ -5793,9 +5773,9 @@ uri$1.default = uri;
5793
5773
  } }), Object.defineProperty(e, "CodeGen", { enumerable: !0, get: function() {
5794
5774
  return r.CodeGen;
5795
5775
  } });
5796
- const n = validation_error, s = ref_error, i = rules, o = compile, l = codegen, d = resolve$1, u = dataType, p = util, $ = require$$9, O = uri$1, N = (F, y) => new RegExp(F, y);
5776
+ const n = validation_error, s = ref_error, i = rules, o = compile, l = codegen, d = resolve$1, u = dataType, p = util, $ = require$$9, O = uri$1, N = (F, v) => new RegExp(F, v);
5797
5777
  N.code = "new RegExp";
5798
- const R = ["removeAdditional", "useDefaults", "coerceTypes"], v = /* @__PURE__ */ new Set([
5778
+ const R = ["removeAdditional", "useDefaults", "coerceTypes"], T = /* @__PURE__ */ new Set([
5799
5779
  "validate",
5800
5780
  "serialize",
5801
5781
  "parse",
@@ -5809,7 +5789,7 @@ uri$1.default = uri;
5809
5789
  "func",
5810
5790
  "obj",
5811
5791
  "Error"
5812
- ]), g = {
5792
+ ]), y = {
5813
5793
  errorDataPath: "",
5814
5794
  format: "`validateFormats: false` can be used instead.",
5815
5795
  nullable: '"nullable" keyword is supported by default.',
@@ -5825,23 +5805,23 @@ uri$1.default = uri;
5825
5805
  cache: "Map is used as cache, schema object as key.",
5826
5806
  serialize: "Map is used as cache, schema object as key.",
5827
5807
  ajvErrors: "It is default now."
5828
- }, m = {
5808
+ }, _ = {
5829
5809
  ignoreKeywordsWithRef: "",
5830
5810
  jsPropertySyntax: "",
5831
5811
  unicode: '"minLength"/"maxLength" account for unicode characters by default.'
5832
- }, T = 200;
5833
- function S(F) {
5834
- var y, j, P, a, h, C, M, q, W, G, ne, he, Le, tt, rt, de, nt, He, Ve, ze, st, me, le, xe, it;
5835
- const Ce = F.strict, ot = (y = F.code) === null || y === void 0 ? void 0 : y.optimize, ut = ot === !0 || ot === void 0 ? 1 : ot || 0, pe = (P = (j = F.code) === null || j === void 0 ? void 0 : j.regExp) !== null && P !== void 0 ? P : N, Ne = (a = F.uriResolver) !== null && a !== void 0 ? a : O.default;
5812
+ }, g = 200;
5813
+ function P(F) {
5814
+ var v, j, b, a, h, C, M, q, W, G, ne, he, Le, tt, rt, de, nt, He, Ve, ze, st, me, le, xe, it;
5815
+ const Oe = F.strict, ot = (v = F.code) === null || v === void 0 ? void 0 : v.optimize, ut = ot === !0 || ot === void 0 ? 1 : ot || 0, pe = (b = (j = F.code) === null || j === void 0 ? void 0 : j.regExp) !== null && b !== void 0 ? b : N, Ne = (a = F.uriResolver) !== null && a !== void 0 ? a : O.default;
5836
5816
  return {
5837
- strictSchema: (C = (h = F.strictSchema) !== null && h !== void 0 ? h : Ce) !== null && C !== void 0 ? C : !0,
5838
- strictNumbers: (q = (M = F.strictNumbers) !== null && M !== void 0 ? M : Ce) !== null && q !== void 0 ? q : !0,
5839
- strictTypes: (G = (W = F.strictTypes) !== null && W !== void 0 ? W : Ce) !== null && G !== void 0 ? G : "log",
5840
- strictTuples: (he = (ne = F.strictTuples) !== null && ne !== void 0 ? ne : Ce) !== null && he !== void 0 ? he : "log",
5841
- strictRequired: (tt = (Le = F.strictRequired) !== null && Le !== void 0 ? Le : Ce) !== null && tt !== void 0 ? tt : !1,
5817
+ strictSchema: (C = (h = F.strictSchema) !== null && h !== void 0 ? h : Oe) !== null && C !== void 0 ? C : !0,
5818
+ strictNumbers: (q = (M = F.strictNumbers) !== null && M !== void 0 ? M : Oe) !== null && q !== void 0 ? q : !0,
5819
+ strictTypes: (G = (W = F.strictTypes) !== null && W !== void 0 ? W : Oe) !== null && G !== void 0 ? G : "log",
5820
+ strictTuples: (he = (ne = F.strictTuples) !== null && ne !== void 0 ? ne : Oe) !== null && he !== void 0 ? he : "log",
5821
+ strictRequired: (tt = (Le = F.strictRequired) !== null && Le !== void 0 ? Le : Oe) !== null && tt !== void 0 ? tt : !1,
5842
5822
  code: F.code ? { ...F.code, optimize: ut, regExp: pe } : { optimize: ut, regExp: pe },
5843
- loopRequired: (rt = F.loopRequired) !== null && rt !== void 0 ? rt : T,
5844
- loopEnum: (de = F.loopEnum) !== null && de !== void 0 ? de : T,
5823
+ loopRequired: (rt = F.loopRequired) !== null && rt !== void 0 ? rt : g,
5824
+ loopEnum: (de = F.loopEnum) !== null && de !== void 0 ? de : g,
5845
5825
  meta: (nt = F.meta) !== null && nt !== void 0 ? nt : !0,
5846
5826
  messages: (He = F.messages) !== null && He !== void 0 ? He : !0,
5847
5827
  inlineRefs: (Ve = F.inlineRefs) !== null && Ve !== void 0 ? Ve : !0,
@@ -5855,44 +5835,44 @@ uri$1.default = uri;
5855
5835
  };
5856
5836
  }
5857
5837
  class I {
5858
- constructor(y = {}) {
5859
- this.schemas = {}, this.refs = {}, this.formats = {}, this._compilations = /* @__PURE__ */ new Set(), this._loading = {}, this._cache = /* @__PURE__ */ new Map(), y = this.opts = { ...y, ...S(y) };
5860
- const { es5: j, lines: P } = this.opts.code;
5861
- this.scope = new l.ValueScope({ scope: {}, prefixes: v, es5: j, lines: P }), this.logger = K(y.logger);
5862
- const a = y.validateFormats;
5863
- y.validateFormats = !1, this.RULES = (0, i.getRules)(), D.call(this, g, y, "NOT SUPPORTED"), D.call(this, m, y, "DEPRECATED", "warn"), this._metaOpts = x.call(this), y.formats && A.call(this), this._addVocabularies(), this._addDefaultMetaSchema(), y.keywords && V.call(this, y.keywords), typeof y.meta == "object" && this.addMetaSchema(y.meta), k.call(this), y.validateFormats = a;
5838
+ constructor(v = {}) {
5839
+ this.schemas = {}, this.refs = {}, this.formats = {}, this._compilations = /* @__PURE__ */ new Set(), this._loading = {}, this._cache = /* @__PURE__ */ new Map(), v = this.opts = { ...v, ...P(v) };
5840
+ const { es5: j, lines: b } = this.opts.code;
5841
+ this.scope = new l.ValueScope({ scope: {}, prefixes: T, es5: j, lines: b }), this.logger = K(v.logger);
5842
+ const a = v.validateFormats;
5843
+ v.validateFormats = !1, this.RULES = (0, i.getRules)(), D.call(this, y, v, "NOT SUPPORTED"), D.call(this, _, v, "DEPRECATED", "warn"), this._metaOpts = x.call(this), v.formats && A.call(this), this._addVocabularies(), this._addDefaultMetaSchema(), v.keywords && V.call(this, v.keywords), typeof v.meta == "object" && this.addMetaSchema(v.meta), k.call(this), v.validateFormats = a;
5864
5844
  }
5865
5845
  _addVocabularies() {
5866
5846
  this.addKeyword("$async");
5867
5847
  }
5868
5848
  _addDefaultMetaSchema() {
5869
- const { $data: y, meta: j, schemaId: P } = this.opts;
5849
+ const { $data: v, meta: j, schemaId: b } = this.opts;
5870
5850
  let a = $;
5871
- P === "id" && (a = { ...$ }, a.id = a.$id, delete a.$id), j && y && this.addMetaSchema(a, a[P], !1);
5851
+ b === "id" && (a = { ...$ }, a.id = a.$id, delete a.$id), j && v && this.addMetaSchema(a, a[b], !1);
5872
5852
  }
5873
5853
  defaultMeta() {
5874
- const { meta: y, schemaId: j } = this.opts;
5875
- return this.opts.defaultMeta = typeof y == "object" ? y[j] || y : void 0;
5876
- }
5877
- validate(y, j) {
5878
- let P;
5879
- if (typeof y == "string") {
5880
- if (P = this.getSchema(y), !P)
5881
- throw new Error(`no schema with key or ref "${y}"`);
5854
+ const { meta: v, schemaId: j } = this.opts;
5855
+ return this.opts.defaultMeta = typeof v == "object" ? v[j] || v : void 0;
5856
+ }
5857
+ validate(v, j) {
5858
+ let b;
5859
+ if (typeof v == "string") {
5860
+ if (b = this.getSchema(v), !b)
5861
+ throw new Error(`no schema with key or ref "${v}"`);
5882
5862
  } else
5883
- P = this.compile(y);
5884
- const a = P(j);
5885
- return "$async" in P || (this.errors = P.errors), a;
5863
+ b = this.compile(v);
5864
+ const a = b(j);
5865
+ return "$async" in b || (this.errors = b.errors), a;
5886
5866
  }
5887
- compile(y, j) {
5888
- const P = this._addSchema(y, j);
5889
- return P.validate || this._compileSchemaEnv(P);
5867
+ compile(v, j) {
5868
+ const b = this._addSchema(v, j);
5869
+ return b.validate || this._compileSchemaEnv(b);
5890
5870
  }
5891
- compileAsync(y, j) {
5871
+ compileAsync(v, j) {
5892
5872
  if (typeof this.opts.loadSchema != "function")
5893
5873
  throw new Error("options.loadSchema should be a function");
5894
- const { loadSchema: P } = this.opts;
5895
- return a.call(this, y, j);
5874
+ const { loadSchema: b } = this.opts;
5875
+ return a.call(this, v, j);
5896
5876
  async function a(G, ne) {
5897
5877
  await h.call(this, G.$schema);
5898
5878
  const he = this._addSchema(G, ne);
@@ -5923,42 +5903,42 @@ uri$1.default = uri;
5923
5903
  if (ne)
5924
5904
  return ne;
5925
5905
  try {
5926
- return await (this._loading[G] = P(G));
5906
+ return await (this._loading[G] = b(G));
5927
5907
  } finally {
5928
5908
  delete this._loading[G];
5929
5909
  }
5930
5910
  }
5931
5911
  }
5932
5912
  // Adds schema to the instance
5933
- addSchema(y, j, P, a = this.opts.validateSchema) {
5934
- if (Array.isArray(y)) {
5935
- for (const C of y)
5936
- this.addSchema(C, void 0, P, a);
5913
+ addSchema(v, j, b, a = this.opts.validateSchema) {
5914
+ if (Array.isArray(v)) {
5915
+ for (const C of v)
5916
+ this.addSchema(C, void 0, b, a);
5937
5917
  return this;
5938
5918
  }
5939
5919
  let h;
5940
- if (typeof y == "object") {
5920
+ if (typeof v == "object") {
5941
5921
  const { schemaId: C } = this.opts;
5942
- if (h = y[C], h !== void 0 && typeof h != "string")
5922
+ if (h = v[C], h !== void 0 && typeof h != "string")
5943
5923
  throw new Error(`schema ${C} must be string`);
5944
5924
  }
5945
- return j = (0, d.normalizeId)(j || h), this._checkUnique(j), this.schemas[j] = this._addSchema(y, P, j, a, !0), this;
5925
+ return j = (0, d.normalizeId)(j || h), this._checkUnique(j), this.schemas[j] = this._addSchema(v, b, j, a, !0), this;
5946
5926
  }
5947
5927
  // Add schema that will be used to validate other schemas
5948
5928
  // options in META_IGNORE_OPTIONS are alway set to false
5949
- addMetaSchema(y, j, P = this.opts.validateSchema) {
5950
- return this.addSchema(y, j, !0, P), this;
5929
+ addMetaSchema(v, j, b = this.opts.validateSchema) {
5930
+ return this.addSchema(v, j, !0, b), this;
5951
5931
  }
5952
5932
  // Validate schema against its meta-schema
5953
- validateSchema(y, j) {
5954
- if (typeof y == "boolean")
5933
+ validateSchema(v, j) {
5934
+ if (typeof v == "boolean")
5955
5935
  return !0;
5956
- let P;
5957
- if (P = y.$schema, P !== void 0 && typeof P != "string")
5936
+ let b;
5937
+ if (b = v.$schema, b !== void 0 && typeof b != "string")
5958
5938
  throw new Error("$schema must be a string");
5959
- if (P = P || this.opts.defaultMeta || this.defaultMeta(), !P)
5939
+ if (b = b || this.opts.defaultMeta || this.defaultMeta(), !b)
5960
5940
  return this.logger.warn("meta-schema not available"), this.errors = null, !0;
5961
- const a = this.validate(P, y);
5941
+ const a = this.validate(b, v);
5962
5942
  if (!a && j) {
5963
5943
  const h = "schema is invalid: " + this.errorsText();
5964
5944
  if (this.opts.validateSchema === "log")
@@ -5970,15 +5950,15 @@ uri$1.default = uri;
5970
5950
  }
5971
5951
  // Get compiled schema by `key` or `ref`.
5972
5952
  // (`key` that was passed to `addSchema` or full schema reference - `schema.$id` or resolved id)
5973
- getSchema(y) {
5953
+ getSchema(v) {
5974
5954
  let j;
5975
- for (; typeof (j = w.call(this, y)) == "string"; )
5976
- y = j;
5955
+ for (; typeof (j = w.call(this, v)) == "string"; )
5956
+ v = j;
5977
5957
  if (j === void 0) {
5978
- const { schemaId: P } = this.opts, a = new o.SchemaEnv({ schema: {}, schemaId: P });
5979
- if (j = o.resolveSchema.call(this, a, y), !j)
5958
+ const { schemaId: b } = this.opts, a = new o.SchemaEnv({ schema: {}, schemaId: b });
5959
+ if (j = o.resolveSchema.call(this, a, v), !j)
5980
5960
  return;
5981
- this.refs[y] = j;
5961
+ this.refs[v] = j;
5982
5962
  }
5983
5963
  return j.validate || this._compileSchemaEnv(j);
5984
5964
  }
@@ -5986,138 +5966,138 @@ uri$1.default = uri;
5986
5966
  // If no parameter is passed all schemas but meta-schemas are removed.
5987
5967
  // If RegExp is passed all schemas with key/id matching pattern but meta-schemas are removed.
5988
5968
  // Even if schema is referenced by other schemas it still can be removed as other schemas have local references.
5989
- removeSchema(y) {
5990
- if (y instanceof RegExp)
5991
- return this._removeAllSchemas(this.schemas, y), this._removeAllSchemas(this.refs, y), this;
5992
- switch (typeof y) {
5969
+ removeSchema(v) {
5970
+ if (v instanceof RegExp)
5971
+ return this._removeAllSchemas(this.schemas, v), this._removeAllSchemas(this.refs, v), this;
5972
+ switch (typeof v) {
5993
5973
  case "undefined":
5994
5974
  return this._removeAllSchemas(this.schemas), this._removeAllSchemas(this.refs), this._cache.clear(), this;
5995
5975
  case "string": {
5996
- const j = w.call(this, y);
5997
- return typeof j == "object" && this._cache.delete(j.schema), delete this.schemas[y], delete this.refs[y], this;
5976
+ const j = w.call(this, v);
5977
+ return typeof j == "object" && this._cache.delete(j.schema), delete this.schemas[v], delete this.refs[v], this;
5998
5978
  }
5999
5979
  case "object": {
6000
- const j = y;
5980
+ const j = v;
6001
5981
  this._cache.delete(j);
6002
- let P = y[this.opts.schemaId];
6003
- return P && (P = (0, d.normalizeId)(P), delete this.schemas[P], delete this.refs[P]), this;
5982
+ let b = v[this.opts.schemaId];
5983
+ return b && (b = (0, d.normalizeId)(b), delete this.schemas[b], delete this.refs[b]), this;
6004
5984
  }
6005
5985
  default:
6006
5986
  throw new Error("ajv.removeSchema: invalid parameter");
6007
5987
  }
6008
5988
  }
6009
5989
  // add "vocabulary" - a collection of keywords
6010
- addVocabulary(y) {
6011
- for (const j of y)
5990
+ addVocabulary(v) {
5991
+ for (const j of v)
6012
5992
  this.addKeyword(j);
6013
5993
  return this;
6014
5994
  }
6015
- addKeyword(y, j) {
6016
- let P;
6017
- if (typeof y == "string")
6018
- P = y, typeof j == "object" && (this.logger.warn("these parameters are deprecated, see docs for addKeyword"), j.keyword = P);
6019
- else if (typeof y == "object" && j === void 0) {
6020
- if (j = y, P = j.keyword, Array.isArray(P) && !P.length)
5995
+ addKeyword(v, j) {
5996
+ let b;
5997
+ if (typeof v == "string")
5998
+ b = v, typeof j == "object" && (this.logger.warn("these parameters are deprecated, see docs for addKeyword"), j.keyword = b);
5999
+ else if (typeof v == "object" && j === void 0) {
6000
+ if (j = v, b = j.keyword, Array.isArray(b) && !b.length)
6021
6001
  throw new Error("addKeywords: keyword must be string or non-empty array");
6022
6002
  } else
6023
6003
  throw new Error("invalid addKeywords parameters");
6024
- if (oe.call(this, P, j), !j)
6025
- return (0, p.eachItem)(P, (h) => ke.call(this, h)), this;
6004
+ if (oe.call(this, b, j), !j)
6005
+ return (0, p.eachItem)(b, (h) => ke.call(this, h)), this;
6026
6006
  qe.call(this, j);
6027
6007
  const a = {
6028
6008
  ...j,
6029
6009
  type: (0, u.getJSONTypes)(j.type),
6030
6010
  schemaType: (0, u.getJSONTypes)(j.schemaType)
6031
6011
  };
6032
- return (0, p.eachItem)(P, a.type.length === 0 ? (h) => ke.call(this, h, a) : (h) => a.type.forEach((C) => ke.call(this, h, a, C))), this;
6012
+ return (0, p.eachItem)(b, a.type.length === 0 ? (h) => ke.call(this, h, a) : (h) => a.type.forEach((C) => ke.call(this, h, a, C))), this;
6033
6013
  }
6034
- getKeyword(y) {
6035
- const j = this.RULES.all[y];
6014
+ getKeyword(v) {
6015
+ const j = this.RULES.all[v];
6036
6016
  return typeof j == "object" ? j.definition : !!j;
6037
6017
  }
6038
6018
  // Remove keyword
6039
- removeKeyword(y) {
6019
+ removeKeyword(v) {
6040
6020
  const { RULES: j } = this;
6041
- delete j.keywords[y], delete j.all[y];
6042
- for (const P of j.rules) {
6043
- const a = P.rules.findIndex((h) => h.keyword === y);
6044
- a >= 0 && P.rules.splice(a, 1);
6021
+ delete j.keywords[v], delete j.all[v];
6022
+ for (const b of j.rules) {
6023
+ const a = b.rules.findIndex((h) => h.keyword === v);
6024
+ a >= 0 && b.rules.splice(a, 1);
6045
6025
  }
6046
6026
  return this;
6047
6027
  }
6048
6028
  // Add format
6049
- addFormat(y, j) {
6050
- return typeof j == "string" && (j = new RegExp(j)), this.formats[y] = j, this;
6029
+ addFormat(v, j) {
6030
+ return typeof j == "string" && (j = new RegExp(j)), this.formats[v] = j, this;
6051
6031
  }
6052
- errorsText(y = this.errors, { separator: j = ", ", dataVar: P = "data" } = {}) {
6053
- return !y || y.length === 0 ? "No errors" : y.map((a) => `${P}${a.instancePath} ${a.message}`).reduce((a, h) => a + j + h);
6032
+ errorsText(v = this.errors, { separator: j = ", ", dataVar: b = "data" } = {}) {
6033
+ return !v || v.length === 0 ? "No errors" : v.map((a) => `${b}${a.instancePath} ${a.message}`).reduce((a, h) => a + j + h);
6054
6034
  }
6055
- $dataMetaSchema(y, j) {
6056
- const P = this.RULES.all;
6057
- y = JSON.parse(JSON.stringify(y));
6035
+ $dataMetaSchema(v, j) {
6036
+ const b = this.RULES.all;
6037
+ v = JSON.parse(JSON.stringify(v));
6058
6038
  for (const a of j) {
6059
6039
  const h = a.split("/").slice(1);
6060
- let C = y;
6040
+ let C = v;
6061
6041
  for (const M of h)
6062
6042
  C = C[M];
6063
- for (const M in P) {
6064
- const q = P[M];
6043
+ for (const M in b) {
6044
+ const q = b[M];
6065
6045
  if (typeof q != "object")
6066
6046
  continue;
6067
6047
  const { $data: W } = q.definition, G = C[M];
6068
6048
  W && G && (C[M] = Ue(G));
6069
6049
  }
6070
6050
  }
6071
- return y;
6051
+ return v;
6072
6052
  }
6073
- _removeAllSchemas(y, j) {
6074
- for (const P in y) {
6075
- const a = y[P];
6076
- (!j || j.test(P)) && (typeof a == "string" ? delete y[P] : a && !a.meta && (this._cache.delete(a.schema), delete y[P]));
6053
+ _removeAllSchemas(v, j) {
6054
+ for (const b in v) {
6055
+ const a = v[b];
6056
+ (!j || j.test(b)) && (typeof a == "string" ? delete v[b] : a && !a.meta && (this._cache.delete(a.schema), delete v[b]));
6077
6057
  }
6078
6058
  }
6079
- _addSchema(y, j, P, a = this.opts.validateSchema, h = this.opts.addUsedSchema) {
6059
+ _addSchema(v, j, b, a = this.opts.validateSchema, h = this.opts.addUsedSchema) {
6080
6060
  let C;
6081
6061
  const { schemaId: M } = this.opts;
6082
- if (typeof y == "object")
6083
- C = y[M];
6062
+ if (typeof v == "object")
6063
+ C = v[M];
6084
6064
  else {
6085
6065
  if (this.opts.jtd)
6086
6066
  throw new Error("schema must be object");
6087
- if (typeof y != "boolean")
6067
+ if (typeof v != "boolean")
6088
6068
  throw new Error("schema must be object or boolean");
6089
6069
  }
6090
- let q = this._cache.get(y);
6070
+ let q = this._cache.get(v);
6091
6071
  if (q !== void 0)
6092
6072
  return q;
6093
- P = (0, d.normalizeId)(C || P);
6094
- const W = d.getSchemaRefs.call(this, y, P);
6095
- return q = new o.SchemaEnv({ schema: y, schemaId: M, meta: j, baseId: P, localRefs: W }), this._cache.set(q.schema, q), h && !P.startsWith("#") && (P && this._checkUnique(P), this.refs[P] = q), a && this.validateSchema(y, !0), q;
6073
+ b = (0, d.normalizeId)(C || b);
6074
+ const W = d.getSchemaRefs.call(this, v, b);
6075
+ return q = new o.SchemaEnv({ schema: v, schemaId: M, meta: j, baseId: b, localRefs: W }), this._cache.set(q.schema, q), h && !b.startsWith("#") && (b && this._checkUnique(b), this.refs[b] = q), a && this.validateSchema(v, !0), q;
6096
6076
  }
6097
- _checkUnique(y) {
6098
- if (this.schemas[y] || this.refs[y])
6099
- throw new Error(`schema with key or id "${y}" already exists`);
6077
+ _checkUnique(v) {
6078
+ if (this.schemas[v] || this.refs[v])
6079
+ throw new Error(`schema with key or id "${v}" already exists`);
6100
6080
  }
6101
- _compileSchemaEnv(y) {
6102
- if (y.meta ? this._compileMetaSchema(y) : o.compileSchema.call(this, y), !y.validate)
6081
+ _compileSchemaEnv(v) {
6082
+ if (v.meta ? this._compileMetaSchema(v) : o.compileSchema.call(this, v), !v.validate)
6103
6083
  throw new Error("ajv implementation error");
6104
- return y.validate;
6084
+ return v.validate;
6105
6085
  }
6106
- _compileMetaSchema(y) {
6086
+ _compileMetaSchema(v) {
6107
6087
  const j = this.opts;
6108
6088
  this.opts = this._metaOpts;
6109
6089
  try {
6110
- o.compileSchema.call(this, y);
6090
+ o.compileSchema.call(this, v);
6111
6091
  } finally {
6112
6092
  this.opts = j;
6113
6093
  }
6114
6094
  }
6115
6095
  }
6116
6096
  e.default = I, I.ValidationError = n.default, I.MissingRefError = s.default;
6117
- function D(F, y, j, P = "error") {
6097
+ function D(F, v, j, b = "error") {
6118
6098
  for (const a in F) {
6119
6099
  const h = a;
6120
- h in y && this.logger[P](`${j}: option ${a}. ${F[h]}`);
6100
+ h in v && this.logger[b](`${j}: option ${a}. ${F[h]}`);
6121
6101
  }
6122
6102
  }
6123
6103
  function w(F) {
@@ -6129,13 +6109,13 @@ uri$1.default = uri;
6129
6109
  if (Array.isArray(F))
6130
6110
  this.addSchema(F);
6131
6111
  else
6132
- for (const y in F)
6133
- this.addSchema(F[y], y);
6112
+ for (const v in F)
6113
+ this.addSchema(F[v], v);
6134
6114
  }
6135
6115
  function A() {
6136
6116
  for (const F in this.opts.formats) {
6137
- const y = this.opts.formats[F];
6138
- y && this.addFormat(F, y);
6117
+ const v = this.opts.formats[F];
6118
+ v && this.addFormat(F, v);
6139
6119
  }
6140
6120
  }
6141
6121
  function V(F) {
@@ -6144,15 +6124,15 @@ uri$1.default = uri;
6144
6124
  return;
6145
6125
  }
6146
6126
  this.logger.warn("keywords option as map is deprecated, pass array");
6147
- for (const y in F) {
6148
- const j = F[y];
6149
- j.keyword || (j.keyword = y), this.addKeyword(j);
6127
+ for (const v in F) {
6128
+ const j = F[v];
6129
+ j.keyword || (j.keyword = v), this.addKeyword(j);
6150
6130
  }
6151
6131
  }
6152
6132
  function x() {
6153
6133
  const F = { ...this.opts };
6154
- for (const y of R)
6155
- delete F[y];
6134
+ for (const v of R)
6135
+ delete F[v];
6156
6136
  return F;
6157
6137
  }
6158
6138
  const re = { log() {
@@ -6169,42 +6149,42 @@ uri$1.default = uri;
6169
6149
  throw new Error("logger must implement log, warn and error methods");
6170
6150
  }
6171
6151
  const ue = /^[a-z_$][a-z0-9_$:-]*$/i;
6172
- function oe(F, y) {
6152
+ function oe(F, v) {
6173
6153
  const { RULES: j } = this;
6174
- if ((0, p.eachItem)(F, (P) => {
6175
- if (j.keywords[P])
6176
- throw new Error(`Keyword ${P} is already defined`);
6177
- if (!ue.test(P))
6178
- throw new Error(`Keyword ${P} has invalid name`);
6179
- }), !!y && y.$data && !("code" in y || "validate" in y))
6154
+ if ((0, p.eachItem)(F, (b) => {
6155
+ if (j.keywords[b])
6156
+ throw new Error(`Keyword ${b} is already defined`);
6157
+ if (!ue.test(b))
6158
+ throw new Error(`Keyword ${b} has invalid name`);
6159
+ }), !!v && v.$data && !("code" in v || "validate" in v))
6180
6160
  throw new Error('$data keyword must have "code" or "validate" function');
6181
6161
  }
6182
- function ke(F, y, j) {
6183
- var P;
6184
- const a = y == null ? void 0 : y.post;
6162
+ function ke(F, v, j) {
6163
+ var b;
6164
+ const a = v == null ? void 0 : v.post;
6185
6165
  if (j && a)
6186
6166
  throw new Error('keyword with "post" flag cannot have "type"');
6187
6167
  const { RULES: h } = this;
6188
6168
  let C = a ? h.post : h.rules.find(({ type: q }) => q === j);
6189
- if (C || (C = { type: j, rules: [] }, h.rules.push(C)), h.keywords[F] = !0, !y)
6169
+ if (C || (C = { type: j, rules: [] }, h.rules.push(C)), h.keywords[F] = !0, !v)
6190
6170
  return;
6191
6171
  const M = {
6192
6172
  keyword: F,
6193
6173
  definition: {
6194
- ...y,
6195
- type: (0, u.getJSONTypes)(y.type),
6196
- schemaType: (0, u.getJSONTypes)(y.schemaType)
6174
+ ...v,
6175
+ type: (0, u.getJSONTypes)(v.type),
6176
+ schemaType: (0, u.getJSONTypes)(v.schemaType)
6197
6177
  }
6198
6178
  };
6199
- y.before ? Oe.call(this, C, M, y.before) : C.rules.push(M), h.all[F] = M, (P = y.implements) === null || P === void 0 || P.forEach((q) => this.addKeyword(q));
6179
+ v.before ? Ce.call(this, C, M, v.before) : C.rules.push(M), h.all[F] = M, (b = v.implements) === null || b === void 0 || b.forEach((q) => this.addKeyword(q));
6200
6180
  }
6201
- function Oe(F, y, j) {
6202
- const P = F.rules.findIndex((a) => a.keyword === j);
6203
- P >= 0 ? F.rules.splice(P, 0, y) : (F.rules.push(y), this.logger.warn(`rule ${j} is not defined`));
6181
+ function Ce(F, v, j) {
6182
+ const b = F.rules.findIndex((a) => a.keyword === j);
6183
+ b >= 0 ? F.rules.splice(b, 0, v) : (F.rules.push(v), this.logger.warn(`rule ${j} is not defined`));
6204
6184
  }
6205
6185
  function qe(F) {
6206
- let { metaSchema: y } = F;
6207
- y !== void 0 && (F.$data && this.opts.$data && (y = Ue(y)), F.validateSchema = this.compile(y, !0));
6186
+ let { metaSchema: v } = F;
6187
+ v !== void 0 && (F.$data && this.opts.$data && (v = Ue(v)), F.validateSchema = this.compile(v, !0));
6208
6188
  }
6209
6189
  const et = {
6210
6190
  $ref: "https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"
@@ -6245,18 +6225,18 @@ const ref_error_1 = ref_error, code_1$8 = code, codegen_1$l = codegen, names_1$1
6245
6225
  return callRef(e, (0, codegen_1$l._)`${R}.validate`, u, u.$async);
6246
6226
  }
6247
6227
  function O(R) {
6248
- const v = getValidate(e, R);
6249
- callRef(e, v, R, R.$async);
6228
+ const T = getValidate(e, R);
6229
+ callRef(e, T, R, R.$async);
6250
6230
  }
6251
6231
  function N(R) {
6252
- const v = t.scopeValue("schema", l.code.source === !0 ? { ref: R, code: (0, codegen_1$l.stringify)(R) } : { ref: R }), g = t.name("valid"), m = e.subschema({
6232
+ const T = t.scopeValue("schema", l.code.source === !0 ? { ref: R, code: (0, codegen_1$l.stringify)(R) } : { ref: R }), y = t.name("valid"), _ = e.subschema({
6253
6233
  schema: R,
6254
6234
  dataTypes: [],
6255
6235
  schemaPath: codegen_1$l.nil,
6256
- topSchemaRef: v,
6236
+ topSchemaRef: T,
6257
6237
  errSchemaPath: r
6258
- }, g);
6259
- e.mergeEvaluated(m), e.ok(g);
6238
+ }, y);
6239
+ e.mergeEvaluated(_), e.ok(y);
6260
6240
  }
6261
6241
  }
6262
6242
  };
@@ -6274,35 +6254,35 @@ function callRef(e, t, r, n) {
6274
6254
  const R = s.let("valid");
6275
6255
  s.try(() => {
6276
6256
  s.code((0, codegen_1$l._)`await ${(0, code_1$8.callValidateCode)(e, t, u)}`), N(t), o || s.assign(R, !0);
6277
- }, (v) => {
6278
- s.if((0, codegen_1$l._)`!(${v} instanceof ${i.ValidationError})`, () => s.throw(v)), O(v), o || s.assign(R, !1);
6257
+ }, (T) => {
6258
+ s.if((0, codegen_1$l._)`!(${T} instanceof ${i.ValidationError})`, () => s.throw(T)), O(T), o || s.assign(R, !1);
6279
6259
  }), e.ok(R);
6280
6260
  }
6281
6261
  function $() {
6282
6262
  e.result((0, code_1$8.callValidateCode)(e, t, u), () => N(t), () => O(t));
6283
6263
  }
6284
6264
  function O(R) {
6285
- const v = (0, codegen_1$l._)`${R}.errors`;
6286
- s.assign(names_1$1.default.vErrors, (0, codegen_1$l._)`${names_1$1.default.vErrors} === null ? ${v} : ${names_1$1.default.vErrors}.concat(${v})`), s.assign(names_1$1.default.errors, (0, codegen_1$l._)`${names_1$1.default.vErrors}.length`);
6265
+ const T = (0, codegen_1$l._)`${R}.errors`;
6266
+ s.assign(names_1$1.default.vErrors, (0, codegen_1$l._)`${names_1$1.default.vErrors} === null ? ${T} : ${names_1$1.default.vErrors}.concat(${T})`), s.assign(names_1$1.default.errors, (0, codegen_1$l._)`${names_1$1.default.vErrors}.length`);
6287
6267
  }
6288
6268
  function N(R) {
6289
- var v;
6269
+ var T;
6290
6270
  if (!i.opts.unevaluated)
6291
6271
  return;
6292
- const g = (v = r == null ? void 0 : r.validate) === null || v === void 0 ? void 0 : v.evaluated;
6272
+ const y = (T = r == null ? void 0 : r.validate) === null || T === void 0 ? void 0 : T.evaluated;
6293
6273
  if (i.props !== !0)
6294
- if (g && !g.dynamicProps)
6295
- g.props !== void 0 && (i.props = util_1$j.mergeEvaluated.props(s, g.props, i.props));
6274
+ if (y && !y.dynamicProps)
6275
+ y.props !== void 0 && (i.props = util_1$j.mergeEvaluated.props(s, y.props, i.props));
6296
6276
  else {
6297
- const m = s.var("props", (0, codegen_1$l._)`${R}.evaluated.props`);
6298
- i.props = util_1$j.mergeEvaluated.props(s, m, i.props, codegen_1$l.Name);
6277
+ const _ = s.var("props", (0, codegen_1$l._)`${R}.evaluated.props`);
6278
+ i.props = util_1$j.mergeEvaluated.props(s, _, i.props, codegen_1$l.Name);
6299
6279
  }
6300
6280
  if (i.items !== !0)
6301
- if (g && !g.dynamicItems)
6302
- g.items !== void 0 && (i.items = util_1$j.mergeEvaluated.items(s, g.items, i.items));
6281
+ if (y && !y.dynamicItems)
6282
+ y.items !== void 0 && (i.items = util_1$j.mergeEvaluated.items(s, y.items, i.items));
6303
6283
  else {
6304
- const m = s.var("items", (0, codegen_1$l._)`${R}.evaluated.items`);
6305
- i.items = util_1$j.mergeEvaluated.items(s, m, i.items, codegen_1$l.Name);
6284
+ const _ = s.var("items", (0, codegen_1$l._)`${R}.evaluated.items`);
6285
+ i.items = util_1$j.mergeEvaluated.items(s, _, i.items, codegen_1$l.Name);
6306
6286
  }
6307
6287
  }
6308
6288
  }
@@ -6444,10 +6424,10 @@ const code_1$6 = code, codegen_1$f = codegen, util_1$h = util, error$d = {
6444
6424
  const d = r.length >= l.loopRequired;
6445
6425
  if (o.allErrors ? u() : p(), l.strictRequired) {
6446
6426
  const N = e.parentSchema.properties, { definedProperties: R } = e.it;
6447
- for (const v of r)
6448
- if ((N == null ? void 0 : N[v]) === void 0 && !R.has(v)) {
6449
- const g = o.schemaEnv.baseId + o.errSchemaPath, m = `required property "${v}" is not defined at "${g}" (strictRequired)`;
6450
- (0, util_1$h.checkStrictMode)(o, m, o.opts.strictRequired);
6427
+ for (const T of r)
6428
+ if ((N == null ? void 0 : N[T]) === void 0 && !R.has(T)) {
6429
+ const y = o.schemaEnv.baseId + o.errSchemaPath, _ = `required property "${T}" is not defined at "${y}" (strictRequired)`;
6430
+ (0, util_1$h.checkStrictMode)(o, _, o.opts.strictRequired);
6451
6431
  }
6452
6432
  }
6453
6433
  function u() {
@@ -6522,24 +6502,24 @@ const dataType_1 = dataType, codegen_1$d = codegen, util_1$g = util, equal_1$2 =
6522
6502
  const d = t.let("valid"), u = i.items ? (0, dataType_1.getSchemaTypes)(i.items) : [];
6523
6503
  e.block$data(d, p, (0, codegen_1$d._)`${o} === false`), e.ok(d);
6524
6504
  function p() {
6525
- const R = t.let("i", (0, codegen_1$d._)`${r}.length`), v = t.let("j");
6526
- e.setParams({ i: R, j: v }), t.assign(d, !0), t.if((0, codegen_1$d._)`${R} > 1`, () => ($() ? O : N)(R, v));
6505
+ const R = t.let("i", (0, codegen_1$d._)`${r}.length`), T = t.let("j");
6506
+ e.setParams({ i: R, j: T }), t.assign(d, !0), t.if((0, codegen_1$d._)`${R} > 1`, () => ($() ? O : N)(R, T));
6527
6507
  }
6528
6508
  function $() {
6529
6509
  return u.length > 0 && !u.some((R) => R === "object" || R === "array");
6530
6510
  }
6531
- function O(R, v) {
6532
- const g = t.name("item"), m = (0, dataType_1.checkDataTypes)(u, g, l.opts.strictNumbers, dataType_1.DataType.Wrong), T = t.const("indices", (0, codegen_1$d._)`{}`);
6511
+ function O(R, T) {
6512
+ const y = t.name("item"), _ = (0, dataType_1.checkDataTypes)(u, y, l.opts.strictNumbers, dataType_1.DataType.Wrong), g = t.const("indices", (0, codegen_1$d._)`{}`);
6533
6513
  t.for((0, codegen_1$d._)`;${R}--;`, () => {
6534
- t.let(g, (0, codegen_1$d._)`${r}[${R}]`), t.if(m, (0, codegen_1$d._)`continue`), u.length > 1 && t.if((0, codegen_1$d._)`typeof ${g} == "string"`, (0, codegen_1$d._)`${g} += "_"`), t.if((0, codegen_1$d._)`typeof ${T}[${g}] == "number"`, () => {
6535
- t.assign(v, (0, codegen_1$d._)`${T}[${g}]`), e.error(), t.assign(d, !1).break();
6536
- }).code((0, codegen_1$d._)`${T}[${g}] = ${R}`);
6514
+ t.let(y, (0, codegen_1$d._)`${r}[${R}]`), t.if(_, (0, codegen_1$d._)`continue`), u.length > 1 && t.if((0, codegen_1$d._)`typeof ${y} == "string"`, (0, codegen_1$d._)`${y} += "_"`), t.if((0, codegen_1$d._)`typeof ${g}[${y}] == "number"`, () => {
6515
+ t.assign(T, (0, codegen_1$d._)`${g}[${y}]`), e.error(), t.assign(d, !1).break();
6516
+ }).code((0, codegen_1$d._)`${g}[${y}] = ${R}`);
6537
6517
  });
6538
6518
  }
6539
- function N(R, v) {
6540
- const g = (0, util_1$g.useFunc)(t, equal_1$2.default), m = t.name("outer");
6541
- t.label(m).for((0, codegen_1$d._)`;${R}--;`, () => t.for((0, codegen_1$d._)`${v} = ${R}; ${v}--;`, () => t.if((0, codegen_1$d._)`${g}(${r}[${R}], ${r}[${v}])`, () => {
6542
- e.error(), t.assign(d, !1).break(m);
6519
+ function N(R, T) {
6520
+ const y = (0, util_1$g.useFunc)(t, equal_1$2.default), _ = t.name("outer");
6521
+ t.label(_).for((0, codegen_1$d._)`;${R}--;`, () => t.for((0, codegen_1$d._)`${T} = ${R}; ${T}--;`, () => t.if((0, codegen_1$d._)`${y}(${r}[${R}], ${r}[${T}])`, () => {
6522
+ e.error(), t.assign(d, !1).break(_);
6543
6523
  })));
6544
6524
  }
6545
6525
  }
@@ -6584,15 +6564,15 @@ const codegen_1$b = codegen, util_1$e = util, equal_1 = equal$1, error$9 = {
6584
6564
  if (!Array.isArray(s))
6585
6565
  throw new Error("ajv implementation error");
6586
6566
  const N = t.const("vSchema", i);
6587
- p = (0, codegen_1$b.or)(...s.map((R, v) => O(N, v)));
6567
+ p = (0, codegen_1$b.or)(...s.map((R, T) => O(N, T)));
6588
6568
  }
6589
6569
  e.pass(p);
6590
6570
  function $() {
6591
6571
  t.assign(p, !1), t.forOf("v", i, (N) => t.if((0, codegen_1$b._)`${u()}(${r}, ${N})`, () => t.assign(p, !0).break()));
6592
6572
  }
6593
6573
  function O(N, R) {
6594
- const v = s[R];
6595
- return typeof v == "object" && v !== null ? (0, codegen_1$b._)`${u()}(${r}, ${N}[${R}])` : (0, codegen_1$b._)`${r} === ${v}`;
6574
+ const T = s[R];
6575
+ return typeof T == "object" && T !== null ? (0, codegen_1$b._)`${u()}(${r}, ${N}[${R}])` : (0, codegen_1$b._)`${r} === ${T}`;
6596
6576
  }
6597
6577
  }
6598
6578
  };
@@ -6684,10 +6664,10 @@ function validateTuple(e, t, r = e.schema) {
6684
6664
  }, d)), e.ok(d));
6685
6665
  });
6686
6666
  function p($) {
6687
- const { opts: O, errSchemaPath: N } = l, R = r.length, v = R === $.minItems && (R === $.maxItems || $[t] === !1);
6688
- if (O.strictTuples && !v) {
6689
- const g = `"${o}" is ${R}-tuple, but minItems or maxItems/${t} are not specified or different at path "${N}"`;
6690
- (0, util_1$c.checkStrictMode)(l, g, O.strictTuples);
6667
+ const { opts: O, errSchemaPath: N } = l, R = r.length, T = R === $.minItems && (R === $.maxItems || $[t] === !1);
6668
+ if (O.strictTuples && !T) {
6669
+ const y = `"${o}" is ${R}-tuple, but minItems or maxItems/${t} are not specified or different at path "${N}"`;
6670
+ (0, util_1$c.checkStrictMode)(l, y, O.strictTuples);
6691
6671
  }
6692
6672
  }
6693
6673
  }
@@ -6746,29 +6726,29 @@ const codegen_1$7 = codegen, util_1$a = util, error$6 = {
6746
6726
  return;
6747
6727
  }
6748
6728
  if ((0, util_1$a.alwaysValidSchema)(i, r)) {
6749
- let v = (0, codegen_1$7._)`${p} >= ${o}`;
6750
- l !== void 0 && (v = (0, codegen_1$7._)`${v} && ${p} <= ${l}`), e.pass(v);
6729
+ let T = (0, codegen_1$7._)`${p} >= ${o}`;
6730
+ l !== void 0 && (T = (0, codegen_1$7._)`${T} && ${p} <= ${l}`), e.pass(T);
6751
6731
  return;
6752
6732
  }
6753
6733
  i.items = !0;
6754
6734
  const $ = t.name("valid");
6755
6735
  l === void 0 && o === 1 ? N($, () => t.if($, () => t.break())) : o === 0 ? (t.let($, !0), l !== void 0 && t.if((0, codegen_1$7._)`${s}.length > 0`, O)) : (t.let($, !1), O()), e.result($, () => e.reset());
6756
6736
  function O() {
6757
- const v = t.name("_valid"), g = t.let("count", 0);
6758
- N(v, () => t.if(v, () => R(g)));
6737
+ const T = t.name("_valid"), y = t.let("count", 0);
6738
+ N(T, () => t.if(T, () => R(y)));
6759
6739
  }
6760
- function N(v, g) {
6761
- t.forRange("i", 0, p, (m) => {
6740
+ function N(T, y) {
6741
+ t.forRange("i", 0, p, (_) => {
6762
6742
  e.subschema({
6763
6743
  keyword: "contains",
6764
- dataProp: m,
6744
+ dataProp: _,
6765
6745
  dataPropType: util_1$a.Type.Num,
6766
6746
  compositeRule: !0
6767
- }, v), g();
6747
+ }, T), y();
6768
6748
  });
6769
6749
  }
6770
- function R(v) {
6771
- t.code((0, codegen_1$7._)`${v}++`), l === void 0 ? t.if((0, codegen_1$7._)`${v} >= ${o}`, () => t.assign($, !0).break()) : (t.if((0, codegen_1$7._)`${v} > ${l}`, () => t.assign($, !1).break()), o === 1 ? t.assign($, !0) : t.if((0, codegen_1$7._)`${v} >= ${o}`, () => t.assign($, !0)));
6750
+ function R(T) {
6751
+ t.code((0, codegen_1$7._)`${T}++`), l === void 0 ? t.if((0, codegen_1$7._)`${T} >= ${o}`, () => t.assign($, !0).break()) : (t.if((0, codegen_1$7._)`${T} > ${l}`, () => t.assign($, !1).break()), o === 1 ? t.assign($, !0) : t.if((0, codegen_1$7._)`${T} >= ${o}`, () => t.assign($, !0)));
6772
6752
  }
6773
6753
  }
6774
6754
  };
@@ -6814,29 +6794,29 @@ var dependencies = {};
6814
6794
  return;
6815
6795
  const N = p.let("missing");
6816
6796
  for (const R in u) {
6817
- const v = u[R];
6818
- if (v.length === 0)
6797
+ const T = u[R];
6798
+ if (T.length === 0)
6819
6799
  continue;
6820
- const g = (0, n.propertyInData)(p, $, R, O.opts.ownProperties);
6800
+ const y = (0, n.propertyInData)(p, $, R, O.opts.ownProperties);
6821
6801
  d.setParams({
6822
6802
  property: R,
6823
- depsCount: v.length,
6824
- deps: v.join(", ")
6825
- }), O.allErrors ? p.if(g, () => {
6826
- for (const m of v)
6827
- (0, n.checkReportMissingProp)(d, m);
6828
- }) : (p.if((0, t._)`${g} && (${(0, n.checkMissingProp)(d, v, N)})`), (0, n.reportMissingProp)(d, N), p.else());
6803
+ depsCount: T.length,
6804
+ deps: T.join(", ")
6805
+ }), O.allErrors ? p.if(y, () => {
6806
+ for (const _ of T)
6807
+ (0, n.checkReportMissingProp)(d, _);
6808
+ }) : (p.if((0, t._)`${y} && (${(0, n.checkMissingProp)(d, T, N)})`), (0, n.reportMissingProp)(d, N), p.else());
6829
6809
  }
6830
6810
  }
6831
6811
  e.validatePropertyDeps = o;
6832
6812
  function l(d, u = d.schema) {
6833
6813
  const { gen: p, data: $, keyword: O, it: N } = d, R = p.name("valid");
6834
- for (const v in u)
6835
- (0, r.alwaysValidSchema)(N, u[v]) || (p.if(
6836
- (0, n.propertyInData)(p, $, v, N.opts.ownProperties),
6814
+ for (const T in u)
6815
+ (0, r.alwaysValidSchema)(N, u[T]) || (p.if(
6816
+ (0, n.propertyInData)(p, $, T, N.opts.ownProperties),
6837
6817
  () => {
6838
- const g = d.subschema({ keyword: O, schemaProp: v }, R);
6839
- d.mergeValidEvaluated(g, R);
6818
+ const y = d.subschema({ keyword: O, schemaProp: T }, R);
6819
+ d.mergeValidEvaluated(y, R);
6840
6820
  },
6841
6821
  () => p.var(R, !0)
6842
6822
  // TODO var
@@ -6895,49 +6875,49 @@ const code_1$3 = code, codegen_1$5 = codegen, names_1 = names$1, util_1$8 = util
6895
6875
  const u = (0, code_1$3.allSchemaProperties)(n.properties), p = (0, code_1$3.allSchemaProperties)(n.patternProperties);
6896
6876
  $(), e.ok((0, codegen_1$5._)`${i} === ${names_1.default.errors}`);
6897
6877
  function $() {
6898
- t.forIn("key", s, (g) => {
6899
- !u.length && !p.length ? R(g) : t.if(O(g), () => R(g));
6878
+ t.forIn("key", s, (y) => {
6879
+ !u.length && !p.length ? R(y) : t.if(O(y), () => R(y));
6900
6880
  });
6901
6881
  }
6902
- function O(g) {
6903
- let m;
6882
+ function O(y) {
6883
+ let _;
6904
6884
  if (u.length > 8) {
6905
- const T = (0, util_1$8.schemaRefOrVal)(o, n.properties, "properties");
6906
- m = (0, code_1$3.isOwnProperty)(t, T, g);
6885
+ const g = (0, util_1$8.schemaRefOrVal)(o, n.properties, "properties");
6886
+ _ = (0, code_1$3.isOwnProperty)(t, g, y);
6907
6887
  } else
6908
- u.length ? m = (0, codegen_1$5.or)(...u.map((T) => (0, codegen_1$5._)`${g} === ${T}`)) : m = codegen_1$5.nil;
6909
- return p.length && (m = (0, codegen_1$5.or)(m, ...p.map((T) => (0, codegen_1$5._)`${(0, code_1$3.usePattern)(e, T)}.test(${g})`))), (0, codegen_1$5.not)(m);
6888
+ u.length ? _ = (0, codegen_1$5.or)(...u.map((g) => (0, codegen_1$5._)`${y} === ${g}`)) : _ = codegen_1$5.nil;
6889
+ return p.length && (_ = (0, codegen_1$5.or)(_, ...p.map((g) => (0, codegen_1$5._)`${(0, code_1$3.usePattern)(e, g)}.test(${y})`))), (0, codegen_1$5.not)(_);
6910
6890
  }
6911
- function N(g) {
6912
- t.code((0, codegen_1$5._)`delete ${s}[${g}]`);
6891
+ function N(y) {
6892
+ t.code((0, codegen_1$5._)`delete ${s}[${y}]`);
6913
6893
  }
6914
- function R(g) {
6894
+ function R(y) {
6915
6895
  if (d.removeAdditional === "all" || d.removeAdditional && r === !1) {
6916
- N(g);
6896
+ N(y);
6917
6897
  return;
6918
6898
  }
6919
6899
  if (r === !1) {
6920
- e.setParams({ additionalProperty: g }), e.error(), l || t.break();
6900
+ e.setParams({ additionalProperty: y }), e.error(), l || t.break();
6921
6901
  return;
6922
6902
  }
6923
6903
  if (typeof r == "object" && !(0, util_1$8.alwaysValidSchema)(o, r)) {
6924
- const m = t.name("valid");
6925
- d.removeAdditional === "failing" ? (v(g, m, !1), t.if((0, codegen_1$5.not)(m), () => {
6926
- e.reset(), N(g);
6927
- })) : (v(g, m), l || t.if((0, codegen_1$5.not)(m), () => t.break()));
6904
+ const _ = t.name("valid");
6905
+ d.removeAdditional === "failing" ? (T(y, _, !1), t.if((0, codegen_1$5.not)(_), () => {
6906
+ e.reset(), N(y);
6907
+ })) : (T(y, _), l || t.if((0, codegen_1$5.not)(_), () => t.break()));
6928
6908
  }
6929
6909
  }
6930
- function v(g, m, T) {
6931
- const S = {
6910
+ function T(y, _, g) {
6911
+ const P = {
6932
6912
  keyword: "additionalProperties",
6933
- dataProp: g,
6913
+ dataProp: y,
6934
6914
  dataPropType: util_1$8.Type.Str
6935
6915
  };
6936
- T === !1 && Object.assign(S, {
6916
+ g === !1 && Object.assign(P, {
6937
6917
  compositeRule: !0,
6938
6918
  createErrors: !1,
6939
6919
  allErrors: !1
6940
- }), e.subschema(S, m);
6920
+ }), e.subschema(P, _);
6941
6921
  }
6942
6922
  }
6943
6923
  };
@@ -6981,7 +6961,7 @@ const code_1$1 = code, codegen_1$4 = codegen, util_1$6 = util, util_2 = util, de
6981
6961
  type: "object",
6982
6962
  schemaType: "object",
6983
6963
  code(e) {
6984
- const { gen: t, schema: r, data: n, parentSchema: s, it: i } = e, { opts: o } = i, l = (0, code_1$1.allSchemaProperties)(r), d = l.filter((v) => (0, util_1$6.alwaysValidSchema)(i, r[v]));
6964
+ const { gen: t, schema: r, data: n, parentSchema: s, it: i } = e, { opts: o } = i, l = (0, code_1$1.allSchemaProperties)(r), d = l.filter((T) => (0, util_1$6.alwaysValidSchema)(i, r[T]));
6985
6965
  if (l.length === 0 || d.length === l.length && (!i.opts.unevaluated || i.props === !0))
6986
6966
  return;
6987
6967
  const u = o.strictSchema && !o.allowMatchingProperties && s.properties, p = t.name("valid");
@@ -6989,23 +6969,23 @@ const code_1$1 = code, codegen_1$4 = codegen, util_1$6 = util, util_2 = util, de
6989
6969
  const { props: $ } = i;
6990
6970
  O();
6991
6971
  function O() {
6992
- for (const v of l)
6993
- u && N(v), i.allErrors ? R(v) : (t.var(p, !0), R(v), t.if(p));
6994
- }
6995
- function N(v) {
6996
- for (const g in u)
6997
- new RegExp(v).test(g) && (0, util_1$6.checkStrictMode)(i, `property ${g} matches pattern ${v} (use allowMatchingProperties)`);
6998
- }
6999
- function R(v) {
7000
- t.forIn("key", n, (g) => {
7001
- t.if((0, codegen_1$4._)`${(0, code_1$1.usePattern)(e, v)}.test(${g})`, () => {
7002
- const m = d.includes(v);
7003
- m || e.subschema({
6972
+ for (const T of l)
6973
+ u && N(T), i.allErrors ? R(T) : (t.var(p, !0), R(T), t.if(p));
6974
+ }
6975
+ function N(T) {
6976
+ for (const y in u)
6977
+ new RegExp(T).test(y) && (0, util_1$6.checkStrictMode)(i, `property ${y} matches pattern ${T} (use allowMatchingProperties)`);
6978
+ }
6979
+ function R(T) {
6980
+ t.forIn("key", n, (y) => {
6981
+ t.if((0, codegen_1$4._)`${(0, code_1$1.usePattern)(e, T)}.test(${y})`, () => {
6982
+ const _ = d.includes(T);
6983
+ _ || e.subschema({
7004
6984
  keyword: "patternProperties",
7005
- schemaProp: v,
7006
- dataProp: g,
6985
+ schemaProp: T,
6986
+ dataProp: y,
7007
6987
  dataPropType: util_2.Type.Str
7008
- }, p), i.opts.unevaluated && $ !== !0 ? t.assign((0, codegen_1$4._)`${$}[${g}]`, !0) : !m && !i.allErrors && t.if((0, codegen_1$4.not)(p), () => t.break());
6988
+ }, p), i.opts.unevaluated && $ !== !0 ? t.assign((0, codegen_1$4._)`${$}[${y}]`, !0) : !_ && !i.allErrors && t.if((0, codegen_1$4.not)(p), () => t.break());
7009
6989
  });
7010
6990
  });
7011
6991
  }
@@ -7193,27 +7173,27 @@ const codegen_1$1 = codegen, error$1 = {
7193
7173
  const R = r.scopeValue("formats", {
7194
7174
  ref: $.formats,
7195
7175
  code: d.code.formats
7196
- }), v = r.const("fDef", (0, codegen_1$1._)`${R}[${o}]`), g = r.let("fType"), m = r.let("format");
7197
- r.if((0, codegen_1$1._)`typeof ${v} == "object" && !(${v} instanceof RegExp)`, () => r.assign(g, (0, codegen_1$1._)`${v}.type || "string"`).assign(m, (0, codegen_1$1._)`${v}.validate`), () => r.assign(g, (0, codegen_1$1._)`"string"`).assign(m, v)), e.fail$data((0, codegen_1$1.or)(T(), S()));
7198
- function T() {
7199
- return d.strictSchema === !1 ? codegen_1$1.nil : (0, codegen_1$1._)`${o} && !${m}`;
7176
+ }), T = r.const("fDef", (0, codegen_1$1._)`${R}[${o}]`), y = r.let("fType"), _ = r.let("format");
7177
+ r.if((0, codegen_1$1._)`typeof ${T} == "object" && !(${T} instanceof RegExp)`, () => r.assign(y, (0, codegen_1$1._)`${T}.type || "string"`).assign(_, (0, codegen_1$1._)`${T}.validate`), () => r.assign(y, (0, codegen_1$1._)`"string"`).assign(_, T)), e.fail$data((0, codegen_1$1.or)(g(), P()));
7178
+ function g() {
7179
+ return d.strictSchema === !1 ? codegen_1$1.nil : (0, codegen_1$1._)`${o} && !${_}`;
7200
7180
  }
7201
- function S() {
7202
- const I = p.$async ? (0, codegen_1$1._)`(${v}.async ? await ${m}(${n}) : ${m}(${n}))` : (0, codegen_1$1._)`${m}(${n})`, D = (0, codegen_1$1._)`(typeof ${m} == "function" ? ${I} : ${m}.test(${n}))`;
7203
- return (0, codegen_1$1._)`${m} && ${m} !== true && ${g} === ${t} && !${D}`;
7181
+ function P() {
7182
+ const I = p.$async ? (0, codegen_1$1._)`(${T}.async ? await ${_}(${n}) : ${_}(${n}))` : (0, codegen_1$1._)`${_}(${n})`, D = (0, codegen_1$1._)`(typeof ${_} == "function" ? ${I} : ${_}.test(${n}))`;
7183
+ return (0, codegen_1$1._)`${_} && ${_} !== true && ${y} === ${t} && !${D}`;
7204
7184
  }
7205
7185
  }
7206
7186
  function N() {
7207
7187
  const R = $.formats[i];
7208
7188
  if (!R) {
7209
- T();
7189
+ g();
7210
7190
  return;
7211
7191
  }
7212
7192
  if (R === !0)
7213
7193
  return;
7214
- const [v, g, m] = S(R);
7215
- v === t && e.pass(I());
7216
- function T() {
7194
+ const [T, y, _] = P(R);
7195
+ T === t && e.pass(I());
7196
+ function g() {
7217
7197
  if (d.strictSchema === !1) {
7218
7198
  $.logger.warn(D());
7219
7199
  return;
@@ -7223,7 +7203,7 @@ const codegen_1$1 = codegen, error$1 = {
7223
7203
  return `unknown format "${i}" ignored in schema at path "${u}"`;
7224
7204
  }
7225
7205
  }
7226
- function S(D) {
7206
+ function P(D) {
7227
7207
  const w = D instanceof RegExp ? (0, codegen_1$1.regexpCode)(D) : d.code.formats ? (0, codegen_1$1._)`${d.code.formats}${(0, codegen_1$1.getProperty)(i)}` : void 0, k = r.scopeValue("formats", { key: i, ref: D, code: w });
7228
7208
  return typeof D == "object" && !(D instanceof RegExp) ? [D.type || "string", D.validate, (0, codegen_1$1._)`${k}.validate`] : ["string", D, k];
7229
7209
  }
@@ -7231,9 +7211,9 @@ const codegen_1$1 = codegen, error$1 = {
7231
7211
  if (typeof R == "object" && !(R instanceof RegExp) && R.async) {
7232
7212
  if (!p.$async)
7233
7213
  throw new Error("async format in sync schema");
7234
- return (0, codegen_1$1._)`await ${m}(${n})`;
7214
+ return (0, codegen_1$1._)`await ${_}(${n})`;
7235
7215
  }
7236
- return typeof g == "function" ? (0, codegen_1$1._)`${m}(${n})` : (0, codegen_1$1._)`${m}.test(${n})`;
7216
+ return typeof y == "function" ? (0, codegen_1$1._)`${_}(${n})` : (0, codegen_1$1._)`${_}.test(${n})`;
7237
7217
  }
7238
7218
  }
7239
7219
  }
@@ -7305,37 +7285,37 @@ const codegen_1 = codegen, types_1 = types, compile_1 = compile, util_1 = util,
7305
7285
  t.else(), e.error(!1, { discrError: types_1.DiscrError.Mapping, tag: u, tagName: l }), t.endIf();
7306
7286
  }
7307
7287
  function $(N) {
7308
- const R = t.name("valid"), v = e.subschema({ keyword: "oneOf", schemaProp: N }, R);
7309
- return e.mergeEvaluated(v, codegen_1.Name), R;
7288
+ const R = t.name("valid"), T = e.subschema({ keyword: "oneOf", schemaProp: N }, R);
7289
+ return e.mergeEvaluated(T, codegen_1.Name), R;
7310
7290
  }
7311
7291
  function O() {
7312
7292
  var N;
7313
- const R = {}, v = m(s);
7314
- let g = !0;
7293
+ const R = {}, T = _(s);
7294
+ let y = !0;
7315
7295
  for (let I = 0; I < o.length; I++) {
7316
7296
  let D = o[I];
7317
7297
  D != null && D.$ref && !(0, util_1.schemaHasRulesButRef)(D, i.self.RULES) && (D = compile_1.resolveRef.call(i.self, i.schemaEnv.root, i.baseId, D == null ? void 0 : D.$ref), D instanceof compile_1.SchemaEnv && (D = D.schema));
7318
7298
  const w = (N = D == null ? void 0 : D.properties) === null || N === void 0 ? void 0 : N[l];
7319
7299
  if (typeof w != "object")
7320
7300
  throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${l}"`);
7321
- g = g && (v || m(D)), T(w, I);
7301
+ y = y && (T || _(D)), g(w, I);
7322
7302
  }
7323
- if (!g)
7303
+ if (!y)
7324
7304
  throw new Error(`discriminator: "${l}" must be required`);
7325
7305
  return R;
7326
- function m({ required: I }) {
7306
+ function _({ required: I }) {
7327
7307
  return Array.isArray(I) && I.includes(l);
7328
7308
  }
7329
- function T(I, D) {
7309
+ function g(I, D) {
7330
7310
  if (I.const)
7331
- S(I.const, D);
7311
+ P(I.const, D);
7332
7312
  else if (I.enum)
7333
7313
  for (const w of I.enum)
7334
- S(w, D);
7314
+ P(w, D);
7335
7315
  else
7336
7316
  throw new Error(`discriminator: "properties/${l}" must have "const" or "enum"`);
7337
7317
  }
7338
- function S(I, D) {
7318
+ function P(I, D) {
7339
7319
  if (typeof I != "string" || I in R)
7340
7320
  throw new Error(`discriminator: "${l}" values must be unique strings`);
7341
7321
  R[I] = D;
@@ -7991,7 +7971,10 @@ const Ajv = /* @__PURE__ */ getDefaultExportFromCjs(ajvExports), $schema = "http
7991
7971
  },
7992
7972
  SupportedPHPExtensionBundle: {
7993
7973
  type: "string",
7994
- const: "kitchen-sink"
7974
+ enum: [
7975
+ "kitchen-sink",
7976
+ "light"
7977
+ ]
7995
7978
  },
7996
7979
  StepDefinition: {
7997
7980
  type: "object",
@@ -8204,6 +8187,36 @@ for existing apps using this option.`
8204
8187
  "step"
8205
8188
  ]
8206
8189
  },
8190
+ {
8191
+ type: "object",
8192
+ additionalProperties: !1,
8193
+ properties: {
8194
+ progress: {
8195
+ type: "object",
8196
+ properties: {
8197
+ weight: {
8198
+ type: "number"
8199
+ },
8200
+ caption: {
8201
+ type: "string"
8202
+ }
8203
+ },
8204
+ additionalProperties: !1
8205
+ },
8206
+ step: {
8207
+ type: "string",
8208
+ const: "importWxr"
8209
+ },
8210
+ file: {
8211
+ $ref: "#/definitions/FileReference",
8212
+ description: "The file to import"
8213
+ }
8214
+ },
8215
+ required: [
8216
+ "file",
8217
+ "step"
8218
+ ]
8219
+ },
8207
8220
  {
8208
8221
  type: "object",
8209
8222
  additionalProperties: !1,
@@ -9199,7 +9212,8 @@ for existing apps using this option.`
9199
9212
  definitions
9200
9213
  }, { wpCLI, ...otherStepHandlers } = allStepHandlers, keyedStepHandlers = {
9201
9214
  ...otherStepHandlers,
9202
- "wp-cli": wpCLI
9215
+ "wp-cli": wpCLI,
9216
+ importFile: otherStepHandlers.importWxr
9203
9217
  };
9204
9218
  function compileBlueprint(e, {
9205
9219
  progress: t = new ProgressTracker(),
@@ -9207,39 +9221,46 @@ function compileBlueprint(e, {
9207
9221
  onStepCompleted: n = () => {
9208
9222
  }
9209
9223
  } = {}) {
9210
- var p, $, O, N, R;
9211
- if (e = {
9224
+ var $, O, N, R, T, y, _;
9225
+ e = {
9212
9226
  ...e,
9213
9227
  steps: (e.steps || []).filter(isStepDefinition)
9214
- }, e.constants && e.steps.unshift({
9228
+ };
9229
+ for (const g of e.steps)
9230
+ typeof g == "object" && g.step === "importFile" && (g.step = "importWxr", console.warn(
9231
+ 'The "importFile" step is deprecated. Use "importWxr" instead.'
9232
+ ));
9233
+ if (e.constants && e.steps.unshift({
9215
9234
  step: "defineWpConfigConsts",
9216
9235
  consts: e.constants
9217
9236
  }), e.siteOptions && e.steps.unshift({
9218
9237
  step: "setSiteOptions",
9219
9238
  options: e.siteOptions
9220
9239
  }), e.plugins) {
9221
- const v = e.plugins.map((g) => typeof g == "string" ? g.startsWith("https://") ? {
9240
+ const g = e.plugins.map((P) => typeof P == "string" ? P.startsWith("https://") ? {
9222
9241
  resource: "url",
9223
- url: g
9242
+ url: P
9224
9243
  } : {
9225
9244
  resource: "wordpress.org/plugins",
9226
- slug: g
9227
- } : g).map((g) => ({
9245
+ slug: P
9246
+ } : P).map((P) => ({
9228
9247
  step: "installPlugin",
9229
- pluginZipFile: g
9248
+ pluginZipFile: P
9230
9249
  }));
9231
- e.steps.unshift(...v);
9250
+ e.steps.unshift(...g);
9232
9251
  }
9233
9252
  e.login && e.steps.push({
9234
9253
  step: "login",
9235
9254
  ...e.login === !0 ? { username: "admin", password: "password" } : e.login
9236
- });
9237
- const s = (p = e.steps) == null ? void 0 : p.findIndex(
9238
- (v) => typeof v == "object" && (v == null ? void 0 : v.step) === "wp-cli"
9255
+ }), e.phpExtensionBundles || (e.phpExtensionBundles = []), e.phpExtensionBundles || (e.phpExtensionBundles = []), e.phpExtensionBundles.length === 0 && e.phpExtensionBundles.push("kitchen-sink");
9256
+ const s = ($ = e.steps) == null ? void 0 : $.findIndex(
9257
+ (g) => typeof g == "object" && (g == null ? void 0 : g.step) === "wp-cli"
9239
9258
  );
9240
- s !== void 0 && s > -1 && (e.phpExtensionBundles || (e.phpExtensionBundles = []), e.phpExtensionBundles.includes("kitchen-sink") || (e.phpExtensionBundles.push("kitchen-sink"), console.warn(
9241
- "The WP-CLI step used in your Blueprint requires the iconv and mbstring PHP extensions. However, you did not specify the kitchen-sink extension bundle. Playground will override your choice and load the kitchen-sink PHP extensions bundle to prevent the WP-CLI step from failing. "
9242
- )), ($ = e.steps) == null || $.splice(s, 0, {
9259
+ s !== void 0 && s > -1 && (e.phpExtensionBundles.includes("light") && (e.phpExtensionBundles = e.phpExtensionBundles.filter(
9260
+ (g) => g !== "light"
9261
+ ), console.warn(
9262
+ "The wpCli step used in your Blueprint requires the iconv and mbstring PHP extensions. However, you did not specify the kitchen-sink extension bundle. Playground will override your choice and load the kitchen-sink PHP extensions bundle to prevent the WP-CLI step from failing. "
9263
+ )), (O = e.steps) == null || O.splice(s, 0, {
9243
9264
  step: "writeFile",
9244
9265
  data: {
9245
9266
  resource: "url",
@@ -9257,34 +9278,49 @@ function compileBlueprint(e, {
9257
9278
  },
9258
9279
  path: "/tmp/wp-cli.phar"
9259
9280
  }));
9260
- const { valid: i, errors: o } = validateBlueprint(e);
9261
- if (!i) {
9262
- const v = new Error(
9263
- `Invalid blueprint: ${o[0].message} at ${o[0].instancePath}`
9281
+ const i = (N = e.steps) == null ? void 0 : N.findIndex(
9282
+ (g) => typeof g == "object" && (g == null ? void 0 : g.step) === "importWxr"
9283
+ );
9284
+ i !== void 0 && i > -1 && (e.phpExtensionBundles.includes("light") && (e.phpExtensionBundles = e.phpExtensionBundles.filter(
9285
+ (g) => g !== "light"
9286
+ ), console.warn(
9287
+ "The importWxr step used in your Blueprint requires the iconv and mbstring PHP extensions. However, you did not specify the kitchen-sink extension bundle. Playground will override your choice and load the kitchen-sink PHP extensions bundle to prevent the WP-CLI step from failing. "
9288
+ )), (R = e.steps) == null || R.splice(i, 0, {
9289
+ step: "installPlugin",
9290
+ pluginZipFile: {
9291
+ resource: "url",
9292
+ url: "https://playground.wordpress.net/wordpress-importer.zip",
9293
+ caption: "Downloading the WordPress Importer plugin"
9294
+ }
9295
+ }));
9296
+ const { valid: o, errors: l } = validateBlueprint(e);
9297
+ if (!o) {
9298
+ const g = new Error(
9299
+ `Invalid blueprint: ${l[0].message} at ${l[0].instancePath}`
9264
9300
  );
9265
- throw v.errors = o, v;
9301
+ throw g.errors = l, g;
9266
9302
  }
9267
- const l = e.steps || [], d = l.reduce(
9268
- (v, g) => {
9269
- var m;
9270
- return v + (((m = g.progress) == null ? void 0 : m.weight) || 1);
9303
+ const d = e.steps || [], u = d.reduce(
9304
+ (g, P) => {
9305
+ var I;
9306
+ return g + (((I = P.progress) == null ? void 0 : I.weight) || 1);
9271
9307
  },
9272
9308
  0
9273
- ), u = l.map(
9274
- (v) => compileStep(v, {
9309
+ ), p = d.map(
9310
+ (g) => compileStep(g, {
9275
9311
  semaphore: r,
9276
9312
  rootProgressTracker: t,
9277
- totalProgressWeight: d
9313
+ totalProgressWeight: u
9278
9314
  })
9279
9315
  );
9280
9316
  return {
9281
9317
  versions: {
9282
9318
  php: compileVersion(
9283
- (O = e.preferredVersions) == null ? void 0 : O.php,
9319
+ (T = e.preferredVersions) == null ? void 0 : T.php,
9284
9320
  SupportedPHPVersions,
9285
9321
  LatestSupportedPHPVersion
9286
9322
  ),
9287
- wp: ((N = e.preferredVersions) == null ? void 0 : N.wp) || "latest"
9323
+ wp: ((y = e.preferredVersions) == null ? void 0 : y.wp) || "latest"
9288
9324
  },
9289
9325
  phpExtensions: compilePHPExtensions(
9290
9326
  [],
@@ -9292,28 +9328,28 @@ function compileBlueprint(e, {
9292
9328
  ),
9293
9329
  features: {
9294
9330
  // Disable networking by default
9295
- networking: ((R = e.features) == null ? void 0 : R.networking) ?? !1
9331
+ networking: ((_ = e.features) == null ? void 0 : _.networking) ?? !1
9296
9332
  },
9297
- run: async (v) => {
9333
+ run: async (g) => {
9298
9334
  try {
9299
- for (const { resources: g } of u)
9300
- for (const m of g)
9301
- m.setPlayground(v), m.isAsync && m.resolve();
9302
- for (const [g, { run: m, step: T }] of Object.entries(u))
9335
+ for (const { resources: P } of p)
9336
+ for (const I of P)
9337
+ I.setPlayground(g), I.isAsync && I.resolve();
9338
+ for (const [P, { run: I, step: D }] of Object.entries(p))
9303
9339
  try {
9304
- const S = await m(v);
9305
- n(S, T);
9306
- } catch (S) {
9307
- throw console.error(S), new Error(
9308
- `Error when executing the blueprint step #${g} (${JSON.stringify(
9309
- T
9310
- )}) ${S instanceof Error ? `: ${S.message}` : S}`,
9311
- { cause: S }
9340
+ const w = await I(g);
9341
+ n(w, D);
9342
+ } catch (w) {
9343
+ throw console.error(w), new Error(
9344
+ `Error when executing the blueprint step #${P} (${JSON.stringify(
9345
+ D
9346
+ )}) ${w instanceof Error ? `: ${w.message}` : w}`,
9347
+ { cause: w }
9312
9348
  );
9313
9349
  }
9314
9350
  } finally {
9315
9351
  try {
9316
- await v.goTo(
9352
+ await g.goTo(
9317
9353
  e.landingPage || "/"
9318
9354
  );
9319
9355
  } catch {
@@ -9422,9 +9458,8 @@ export {
9422
9458
  defineWpConfigConsts,
9423
9459
  enableMultisite,
9424
9460
  exportWXR,
9425
- exportWXZ,
9426
- importFile,
9427
9461
  importWordPressFiles,
9462
+ importWxr,
9428
9463
  installPlugin,
9429
9464
  installTheme,
9430
9465
  login,