@blue-labs/language 4.0.0-rc.4 → 4.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -1,14 +1,14 @@
1
1
  import G from "big.js";
2
- import { isNullable as v, isNonNullable as p, jsonPrimitiveSchema as jr, isReadonlyArray as Gt, isJsonPrimitive as Jt, isPreciseNumberString as Zt } from "@blue-labs/shared-utils";
3
- import { z as y, ZodOptional as Xt, ZodNullable as qt, ZodReadonly as Qt, ZodBranded as er, ZodEffects as Ge, ZodLazy as Je, ZodString as ge, ZodNumber as me, ZodBoolean as ze, ZodBigInt as Ke, ZodEnum as Fr, ZodNativeEnum as Ur, ZodIntersection as zr, ZodUnion as Kr, ZodObject as kr, ZodRecord as Hr } from "zod";
2
+ import { isNullable as I, isNonNullable as d, jsonPrimitiveSchema as Vr, isReadonlyArray as Kt, isJsonPrimitive as Ht, isPreciseNumberString as kt } from "@blue-labs/shared-utils";
3
+ import { z as f, ZodOptional as Yt, ZodNullable as Wt, ZodReadonly as Gt, ZodBranded as Jt, ZodEffects as Ye, ZodLazy as We, ZodString as ye, ZodNumber as ge, ZodBoolean as je, ZodBigInt as Ue, ZodEnum as Or, ZodNativeEnum as Mr, ZodIntersection as Dr, ZodUnion as Lr, ZodObject as $r, ZodRecord as _r } from "zod";
4
4
  import Ae from "bs58";
5
- import { isObject as tr, isArray as rr, isString as St, omit as sr, pascal as Yr, map as Wr } from "radash";
6
- import { OBJECT_CONTRACTS as z, OBJECT_MERGE_POLICY as bt, OBJECT_SCHEMA as ir, BLUE_REPOSITORY_STATUS_STABLE as Ce, BLUE_REPOSITORY_STATUS_DEV as Et, validateAttributesAddedPointer as Gr, parsePointer as nr } from "@blue-labs/repository-contract";
7
- import { sha256 as Jr } from "js-sha256";
8
- import at from "crypto";
9
- import Zr from "base32.js";
10
- import pe from "js-yaml";
11
- class $ extends G {
5
+ import { isObject as Zt, isArray as Xt, isString as vt, omit as qt, pascal as xr, map as Fr } from "radash";
6
+ import { OBJECT_CONTRACTS as U, OBJECT_MERGE_POLICY as Tt, OBJECT_SCHEMA as Qt, BLUE_REPOSITORY_STATUS_STABLE as Ne, BLUE_REPOSITORY_STATUS_DEV as Bt, validateAttributesAddedPointer as jr, parsePointer as er } from "@blue-labs/repository-contract";
7
+ import { sha256 as Ur } from "js-sha256";
8
+ import nt from "crypto";
9
+ import zr from "base32.js";
10
+ import he from "js-yaml";
11
+ class _ extends G {
12
12
  constructor(e) {
13
13
  super(e);
14
14
  }
@@ -18,73 +18,73 @@ class A extends G {
18
18
  super(e);
19
19
  }
20
20
  }
21
- const ie = "name", ne = "description", K = "type", we = "itemType", Se = "keyType", be = "valueType", W = "value", Y = "items", V = "blueId", Le = "blue", Nt = [
21
+ const ie = "name", ne = "description", z = "type", Pe = "itemType", we = "keyType", Se = "valueType", W = "value", Y = "items", V = "blueId", Le = "blue", Pt = [
22
22
  ie,
23
23
  ne,
24
- K,
24
+ z,
25
+ Pe,
25
26
  we,
26
27
  Se,
27
- be,
28
28
  W,
29
29
  Y,
30
30
  V,
31
31
  Le
32
- ], or = "Text", lr = "Double", ar = "Integer", cr = "Boolean", ur = "List", dr = "Dictionary", tt = [
33
- or,
34
- lr,
35
- ar,
36
- cr
37
- ], Ct = [...tt, ur, dr], Q = "DLRQwz7MQeCrzjy9bohPNwtCxKEBbKaMK65KBrwjfG6K", ee = "7pwXmXYCJtWnd348c2JQGBkm9C4renmZRwxbfaypsx5y", te = "5WNMiV9Knz63B4dVY5JtMyh3FB4FSGqv7ceScvuapdE1", re = "4EzhSubEimSQD3zrYHRtobfPPWntUuhEz8YcdxHsi12u", rt = "6aehfNAxHLC1PHHoDr3tYtFH3RWNbiWdFancJ1bypXEY", Rt = "G7fBT9PSod1RfHLHkpafAGBDVAJMrMhAMY51ERcyXNrj", At = [
32
+ ], tr = "Text", rr = "Double", sr = "Integer", ir = "Boolean", nr = "List", or = "Dictionary", qe = [
33
+ tr,
34
+ rr,
35
+ sr,
36
+ ir
37
+ ], wt = [...qe, nr, or], Q = "DLRQwz7MQeCrzjy9bohPNwtCxKEBbKaMK65KBrwjfG6K", ee = "7pwXmXYCJtWnd348c2JQGBkm9C4renmZRwxbfaypsx5y", te = "5WNMiV9Knz63B4dVY5JtMyh3FB4FSGqv7ceScvuapdE1", re = "4EzhSubEimSQD3zrYHRtobfPPWntUuhEz8YcdxHsi12u", Qe = "6aehfNAxHLC1PHHoDr3tYtFH3RWNbiWdFancJ1bypXEY", St = "G7fBT9PSod1RfHLHkpafAGBDVAJMrMhAMY51ERcyXNrj", bt = [
38
38
  Q,
39
39
  ee,
40
40
  te,
41
41
  re
42
- ], fe = [
43
- ...At,
44
- rt,
45
- Rt
46
- ], hr = Object.fromEntries(
47
- Ct.map((i, e) => [i, fe[e]])
48
- ), st = Object.fromEntries(
49
- fe.map((i, e) => [i, Ct[e]])
50
- ), Pn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
42
+ ], pe = [
43
+ ...bt,
44
+ Qe,
45
+ St
46
+ ], lr = Object.fromEntries(
47
+ wt.map((i, e) => [i, pe[e]])
48
+ ), et = Object.fromEntries(
49
+ pe.map((i, e) => [i, wt[e]])
50
+ ), nn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
51
51
  __proto__: null,
52
- BASIC_TYPES: tt,
53
- BASIC_TYPE_BLUE_IDS: At,
54
- BOOLEAN_TYPE: cr,
52
+ BASIC_TYPES: qe,
53
+ BASIC_TYPE_BLUE_IDS: bt,
54
+ BOOLEAN_TYPE: ir,
55
55
  BOOLEAN_TYPE_BLUE_ID: re,
56
- CORE_TYPES: Ct,
57
- CORE_TYPE_BLUE_IDS: fe,
58
- CORE_TYPE_BLUE_ID_TO_NAME_MAP: st,
59
- CORE_TYPE_NAME_TO_BLUE_ID_MAP: hr,
60
- DICTIONARY_TYPE: dr,
61
- DICTIONARY_TYPE_BLUE_ID: Rt,
62
- DOUBLE_TYPE: lr,
56
+ CORE_TYPES: wt,
57
+ CORE_TYPE_BLUE_IDS: pe,
58
+ CORE_TYPE_BLUE_ID_TO_NAME_MAP: et,
59
+ CORE_TYPE_NAME_TO_BLUE_ID_MAP: lr,
60
+ DICTIONARY_TYPE: or,
61
+ DICTIONARY_TYPE_BLUE_ID: St,
62
+ DOUBLE_TYPE: rr,
63
63
  DOUBLE_TYPE_BLUE_ID: ee,
64
- INTEGER_TYPE: ar,
64
+ INTEGER_TYPE: sr,
65
65
  INTEGER_TYPE_BLUE_ID: te,
66
- LIST_TYPE: ur,
67
- LIST_TYPE_BLUE_ID: rt,
66
+ LIST_TYPE: nr,
67
+ LIST_TYPE_BLUE_ID: Qe,
68
68
  OBJECT_BLUE: Le,
69
69
  OBJECT_BLUE_ID: V,
70
- OBJECT_CONTRACTS: z,
70
+ OBJECT_CONTRACTS: U,
71
71
  OBJECT_DESCRIPTION: ne,
72
72
  OBJECT_ITEMS: Y,
73
- OBJECT_ITEM_TYPE: we,
74
- OBJECT_KEY_TYPE: Se,
75
- OBJECT_MERGE_POLICY: bt,
73
+ OBJECT_ITEM_TYPE: Pe,
74
+ OBJECT_KEY_TYPE: we,
75
+ OBJECT_MERGE_POLICY: Tt,
76
76
  OBJECT_NAME: ie,
77
- OBJECT_SCHEMA: ir,
78
- OBJECT_SPECIFIC_KEYS: Nt,
79
- OBJECT_TYPE: K,
77
+ OBJECT_SCHEMA: Qt,
78
+ OBJECT_SPECIFIC_KEYS: Pt,
79
+ OBJECT_TYPE: z,
80
80
  OBJECT_VALUE: W,
81
- OBJECT_VALUE_TYPE: be,
82
- TEXT_TYPE: or,
81
+ OBJECT_VALUE_TYPE: Se,
82
+ TEXT_TYPE: tr,
83
83
  TEXT_TYPE_BLUE_ID: Q
84
84
  }, Symbol.toStringTag, { value: "Module" }));
85
- class Xr {
85
+ class Kr {
86
86
  static get(e, t, r, s = !0) {
87
- if (v(t) || !t.startsWith("/"))
87
+ if (I(t) || !t.startsWith("/"))
88
88
  throw new Error(`Invalid path: ${t}`);
89
89
  if (t === "/") {
90
90
  const o = e.getValue();
@@ -178,7 +178,7 @@ class Xr {
178
178
  n = new u().setProperties(l);
179
179
  break;
180
180
  }
181
- case z: {
181
+ case U: {
182
182
  const l = e.getContracts();
183
183
  n = new u().setContracts(l);
184
184
  break;
@@ -197,7 +197,7 @@ class Xr {
197
197
  }
198
198
  static link(e, t) {
199
199
  const r = t(e);
200
- return p(r) ? r : e;
200
+ return d(r) ? r : e;
201
201
  }
202
202
  }
203
203
  class u {
@@ -255,19 +255,19 @@ class u {
255
255
  }
256
256
  getValue() {
257
257
  const e = this.type?.getBlueId();
258
- if (p(e) && p(this.value)) {
258
+ if (d(e) && d(this.value)) {
259
259
  if (e === te && typeof this.value == "string")
260
260
  return new A(this.value);
261
261
  if (e === ee && typeof this.value == "string") {
262
- const t = new $(this.value), r = parseFloat(t.toString());
263
- return new $(r.toString());
262
+ const t = new _(this.value), r = parseFloat(t.toString());
263
+ return new _(r.toString());
264
264
  } else if (e === re && typeof this.value == "string")
265
265
  return this.value.toLowerCase() === "true";
266
266
  }
267
267
  return this.value;
268
268
  }
269
269
  setValue(e) {
270
- return typeof e == "number" ? e % 1 === 0 ? this.value = new A(e.toString()) : this.value = new $(e.toString()) : this.value = e, this;
270
+ return typeof e == "number" ? e % 1 === 0 ? this.value = new A(e.toString()) : this.value = new _(e.toString()) : this.value = e, this;
271
271
  }
272
272
  getItems() {
273
273
  return this.items;
@@ -291,21 +291,21 @@ class u {
291
291
  return this.properties && delete this.properties[e], this;
292
292
  }
293
293
  getContractsProperty() {
294
- return this.properties?.[z];
294
+ return this.properties?.[U];
295
295
  }
296
296
  getContracts() {
297
297
  return this.getContractsProperty()?.getProperties();
298
298
  }
299
299
  setContracts(e) {
300
- return v(e) ? this.removeProperty(z) : this.addProperty(
301
- z,
300
+ return I(e) ? this.removeProperty(U) : this.addProperty(
301
+ U,
302
302
  new u().setProperties(e)
303
303
  ), this;
304
304
  }
305
305
  addContract(e, t) {
306
306
  const r = this.getContractsProperty();
307
- return v(r) ? this.addProperty(
308
- z,
307
+ return I(r) ? this.addProperty(
308
+ U,
309
309
  new u().addProperty(e, t)
310
310
  ) : r.addProperty(e, t), this;
311
311
  }
@@ -314,7 +314,7 @@ class u {
314
314
  if (t) {
315
315
  t.removeProperty(e);
316
316
  const r = t.getProperties();
317
- r && Object.keys(r).length === 0 && this.removeProperty(z);
317
+ r && Object.keys(r).length === 0 && this.removeProperty(U);
318
318
  }
319
319
  return this;
320
320
  }
@@ -358,7 +358,7 @@ class u {
358
358
  return !1;
359
359
  }
360
360
  get(e, t) {
361
- return Xr.get(this, e, t);
361
+ return Kr.get(this, e, t);
362
362
  }
363
363
  getAsNode(e) {
364
364
  const t = this.get(e);
@@ -368,7 +368,7 @@ class u {
368
368
  }
369
369
  getAsInteger(e) {
370
370
  const t = this.get(e);
371
- if (t instanceof A || t instanceof $)
371
+ if (t instanceof A || t instanceof _)
372
372
  return t.toNumber();
373
373
  throw new Error(
374
374
  `Value at path ${e} is not a BigInteger or BigDecimal: ${t}`
@@ -388,7 +388,7 @@ class u {
388
388
  return `BlueNode{name='${this.name}', description='${this.description}', type=${this.type}, itemType=${this.itemType}, keyType=${this.keyType}, valueType=${this.valueType}, value=${this.value}, items=${this.items}, properties=${this.properties}, blueId='${this.blueId}', blue=${this.blue}, inlineValue=${this.inlineValue}}`;
389
389
  }
390
390
  }
391
- class Be {
391
+ class ve {
392
392
  static MIN_BLUE_ID_LENGTH = 41;
393
393
  static MAX_BLUE_ID_LENGTH = 45;
394
394
  static BLUE_ID_PATTERN = /^[1-9A-HJ-NP-Za-km-z]{41,45}(?:#\d+)?$/;
@@ -414,9 +414,9 @@ class Be {
414
414
  return !0;
415
415
  }
416
416
  }
417
- const wn = y.string().max(Be.MAX_BLUE_ID_LENGTH, {
417
+ const on = f.string().max(ve.MAX_BLUE_ID_LENGTH, {
418
418
  message: "Blue Id has a maximum length of 45 characters"
419
- }).min(Be.MIN_BLUE_ID_LENGTH, {
419
+ }).min(ve.MIN_BLUE_ID_LENGTH, {
420
420
  message: "Blue Id has a minimum length of 41 characters"
421
421
  }).refine(
422
422
  (i) => {
@@ -429,45 +429,45 @@ const wn = y.string().max(Be.MAX_BLUE_ID_LENGTH, {
429
429
  {
430
430
  message: "Blue Id must be a valid Base58 string"
431
431
  }
432
- ), Ve = y.lazy(
433
- () => y.record(y.unknown()).and(
434
- y.object({
435
- blueId: y.string().optional(),
436
- name: y.string().optional(),
437
- description: y.string().optional(),
432
+ ), Ve = f.lazy(
433
+ () => f.record(f.unknown()).and(
434
+ f.object({
435
+ blueId: f.string().optional(),
436
+ name: f.string().optional(),
437
+ description: f.string().optional(),
438
438
  type: Ve.optional(),
439
- value: y.union([y.string(), y.number(), y.boolean()]).optional().nullable(),
440
- items: y.array(Ve).optional()
439
+ value: f.union([f.string(), f.number(), f.boolean()]).optional().nullable(),
440
+ items: f.array(Ve).optional()
441
441
  })
442
442
  )
443
- ), it = y.object({
444
- blueId: y.string().optional(),
445
- name: y.string().optional(),
446
- description: y.string().optional(),
443
+ ), tt = f.object({
444
+ blueId: f.string().optional(),
445
+ name: f.string().optional(),
446
+ description: f.string().optional(),
447
447
  type: Ve.optional()
448
- }), Sn = it.extend({
449
- value: y.string().optional()
450
- }), bn = it.extend({
451
- value: y.number().optional()
452
- }), En = it.extend({
453
- value: y.boolean().optional()
454
- }), Nn = it.extend({
455
- items: y.array(y.string()).optional()
456
- }), Cn = (i) => Ve.safeParse(i).success, qr = (i) => p(i) && "blueId" in i && p(i.blueId), Rn = (i) => p(i) && "name" in i && p(i.name), Qr = (i) => p(i) && "items" in i && p(i.items), es = (i) => p(i) && "type" in i && p(i.type), ts = (i) => p(i) && "value" in i && p(i.value), An = (i, e) => i.required({ type: !0 }).safeParse(e).success, C = (i) => i instanceof G, oe = (i) => C(i) && i instanceof A, yt = (i) => C(i) && i instanceof $, rs = y.lazy(
457
- () => y.record(Ze)
458
- ), ss = y.lazy(
459
- () => y.union([
460
- y.array(Ze),
461
- y.array(Ze).readonly()
448
+ }), ln = tt.extend({
449
+ value: f.string().optional()
450
+ }), an = tt.extend({
451
+ value: f.number().optional()
452
+ }), cn = tt.extend({
453
+ value: f.boolean().optional()
454
+ }), un = tt.extend({
455
+ items: f.array(f.string()).optional()
456
+ }), dn = (i) => Ve.safeParse(i).success, Hr = (i) => d(i) && "blueId" in i && d(i.blueId), hn = (i) => d(i) && "name" in i && d(i.name), kr = (i) => d(i) && "items" in i && d(i.items), Yr = (i) => d(i) && "type" in i && d(i.type), Wr = (i) => d(i) && "value" in i && d(i.value), pn = (i, e) => i.required({ type: !0 }).safeParse(e).success, C = (i) => i instanceof G, oe = (i) => C(i) && i instanceof A, dt = (i) => C(i) && i instanceof _, Gr = f.lazy(
457
+ () => f.record(Ge)
458
+ ), Jr = f.lazy(
459
+ () => f.union([
460
+ f.array(Ge),
461
+ f.array(Ge).readonly()
462
462
  ])
463
- ), Ze = y.lazy(
464
- () => y.union([
465
- jr,
466
- rs,
467
- ss,
468
- y.instanceof(G)
463
+ ), Ge = f.lazy(
464
+ () => f.union([
465
+ Vr,
466
+ Gr,
467
+ Jr,
468
+ f.instanceof(G)
469
469
  ])
470
- ), pr = (i) => tr(i) && !rr(i) && !Gt(i) && !C(i), fr = (i) => rr(i) || Gt(i), Vn = (i) => fr(i) || pr(i) || C(i) || Jt(i);
470
+ ), ar = (i) => Zt(i) && !Xt(i) && !Kt(i) && !C(i), cr = (i) => Xt(i) || Kt(i), fn = (i) => cr(i) || ar(i) || C(i) || Ht(i);
471
471
  class m {
472
472
  static deserialize(e) {
473
473
  return m.handleNode(e);
@@ -477,7 +477,7 @@ class m {
477
477
  throw new Error(
478
478
  "This is not a valid JSON-like value. Found 'undefined' as a value."
479
479
  );
480
- if (pr(e)) {
480
+ if (ar(e)) {
481
481
  const t = new u(), r = {};
482
482
  return Object.entries(e).forEach(([s, n]) => {
483
483
  switch (s) {
@@ -501,16 +501,16 @@ class m {
501
501
  t.setDescription(n);
502
502
  }
503
503
  break;
504
- case K:
504
+ case z:
505
505
  t.setType(m.handleNode(n));
506
506
  break;
507
- case we:
507
+ case Pe:
508
508
  t.setItemType(m.handleNode(n));
509
509
  break;
510
- case Se:
510
+ case we:
511
511
  t.setKeyType(m.handleNode(n));
512
512
  break;
513
- case be:
513
+ case Se:
514
514
  t.setValueType(m.handleNode(n));
515
515
  break;
516
516
  case W:
@@ -533,7 +533,7 @@ class m {
533
533
  }
534
534
  }), Object.keys(r).length > 0 && t.setProperties(r), t;
535
535
  } else {
536
- if (fr(e))
536
+ if (cr(e))
537
537
  return new u().setItems(m.handleArray(e));
538
538
  {
539
539
  const t = e;
@@ -552,7 +552,7 @@ class m {
552
552
  return t.lt(r) ? new A(r.toString()) : t.gt(s) ? new A(s.toString()) : t;
553
553
  } else {
554
554
  const t = parseFloat(e.toString());
555
- return new $(t.toString());
555
+ return new _(t.toString());
556
556
  }
557
557
  else if (typeof e == "boolean")
558
558
  return e;
@@ -560,7 +560,7 @@ class m {
560
560
  }
561
561
  static handleArray(e) {
562
562
  if (e != null) {
563
- if (tr(e) && !Array.isArray(e))
563
+ if (Zt(e) && !Array.isArray(e))
564
564
  return [m.handleNode(e)];
565
565
  if (Array.isArray(e))
566
566
  return e.map(m.handleNode);
@@ -568,12 +568,12 @@ class m {
568
568
  }
569
569
  }
570
570
  }
571
- function is(i) {
571
+ function Zr(i) {
572
572
  return i && i.__esModule && Object.prototype.hasOwnProperty.call(i, "default") ? i.default : i;
573
573
  }
574
- var ct, Ft;
575
- function ns() {
576
- return Ft || (Ft = 1, ct = function i(e) {
574
+ var ot, Lt;
575
+ function Xr() {
576
+ return Lt || (Lt = 1, ot = function i(e) {
577
577
  if (typeof e == "number" && isNaN(e))
578
578
  throw new Error("NaN is not allowed");
579
579
  if (typeof e == "number" && !isFinite(e))
@@ -584,40 +584,40 @@ function ns() {
584
584
  const n = r.length === 0 ? "" : ",";
585
585
  return `${r}${n}${i(s)}:${i(e[s])}`;
586
586
  }, "")}}`;
587
- }), ct;
587
+ }), ot;
588
588
  }
589
- var os = ns();
590
- const ls = /* @__PURE__ */ is(os);
591
- class gt {
589
+ var qr = Xr();
590
+ const Qr = /* @__PURE__ */ Zr(qr);
591
+ class ht {
592
592
  static canonicalize(e) {
593
- return ls(e);
593
+ return Qr(e);
594
594
  }
595
595
  }
596
- const ut = typeof process < "u" && process.versions != null && process.versions.node != null;
597
- class Vt {
596
+ const lt = typeof process < "u" && process.versions != null && process.versions.node != null;
597
+ class Et {
598
598
  static instance;
599
599
  browserCrypto;
600
600
  constructor() {
601
601
  this.browserCrypto = this.initBrowserCrypto();
602
602
  }
603
603
  static getInstance() {
604
- return this.instance || (this.instance = new Vt()), this.instance;
604
+ return this.instance || (this.instance = new Et()), this.instance;
605
605
  }
606
606
  initBrowserCrypto() {
607
- return ut ? null : "crypto" in globalThis ? globalThis.crypto : null;
607
+ return lt ? null : "crypto" in globalThis ? globalThis.crypto : null;
608
608
  }
609
609
  hasNodeCrypto() {
610
- return ut && !!at && typeof at.createHash == "function";
610
+ return lt && !!nt && typeof nt.createHash == "function";
611
611
  }
612
612
  getBrowserCrypto() {
613
613
  return this.browserCrypto;
614
614
  }
615
615
  getNodeCrypto() {
616
- return ut ? at : null;
616
+ return lt ? nt : null;
617
617
  }
618
618
  }
619
- class as {
620
- cryptoEnv = Vt.getInstance();
619
+ class es {
620
+ cryptoEnv = Et.getInstance();
621
621
  applySync(e) {
622
622
  const t = this.canonicalizeInput(e), r = this.cryptoEnv.hasNodeCrypto() ? this.sha256Sync(t) : this.sha256SyncBrowser(t);
623
623
  return Ae.encode(r);
@@ -627,7 +627,7 @@ class as {
627
627
  return Ae.encode(r);
628
628
  }
629
629
  canonicalizeInput(e) {
630
- const t = gt.canonicalize(e);
630
+ const t = ht.canonicalize(e);
631
631
  if (typeof t != "string")
632
632
  throw new Error("Canonized value must be a string");
633
633
  return t;
@@ -642,7 +642,7 @@ class as {
642
642
  return new Uint8Array(r);
643
643
  }
644
644
  sha256SyncBrowser(e) {
645
- return new Uint8Array(Jr.arrayBuffer(e));
645
+ return new Uint8Array(Ur.arrayBuffer(e));
646
646
  }
647
647
  async sha256Async(e) {
648
648
  if (this.cryptoEnv.hasNodeCrypto())
@@ -693,7 +693,7 @@ class b {
693
693
  */
694
694
  static isValidValueNode(e) {
695
695
  const t = e.getValue(), r = e.getProperties(), s = e.getItems();
696
- return p(t) && v(r) && v(s);
696
+ return d(t) && I(r) && I(s);
697
697
  }
698
698
  /**
699
699
  * Create a text node
@@ -712,7 +712,7 @@ class b {
712
712
  * Create a double node
713
713
  */
714
714
  static doubleNode(e) {
715
- const t = e instanceof $ ? e : new $(e.toString());
715
+ const t = e instanceof _ ? e : new _(e.toString());
716
716
  return new u().setType(new u().setBlueId(ee)).setValue(t);
717
717
  }
718
718
  /**
@@ -730,7 +730,7 @@ class b {
730
730
  */
731
731
  static hasFieldsAndMayHaveFields(e, t = /* @__PURE__ */ new Set(), r = /* @__PURE__ */ new Set()) {
732
732
  for (const s of Object.values(S)) {
733
- const n = p(this.getFieldValue(e, s));
733
+ const n = d(this.getFieldValue(e, s));
734
734
  if (t.has(s)) {
735
735
  if (!n) return !1;
736
736
  } else if (!r.has(s)) {
@@ -771,14 +771,14 @@ class b {
771
771
  }
772
772
  }
773
773
  }
774
- const Ie = "$previous", ce = "$pos", mt = "$empty";
774
+ const me = "$previous", ce = "$pos", pt = "$empty";
775
775
  class B {
776
776
  static getMergePolicy(e, t) {
777
777
  const r = this.getMergePolicyValue(e);
778
778
  return r !== void 0 ? r : (t === void 0 ? void 0 : this.getMergePolicyValue(t)) ?? "positional";
779
779
  }
780
780
  static getMergePolicyValue(e) {
781
- const t = e.getProperties()?.[bt]?.getValue();
781
+ const t = e.getProperties()?.[Tt]?.getValue();
782
782
  if (t === "append-only" || t === "positional")
783
783
  return t;
784
784
  }
@@ -802,7 +802,7 @@ class B {
802
802
  static hasPreviousProperty(e) {
803
803
  return Object.prototype.hasOwnProperty.call(
804
804
  e.getProperties() ?? {},
805
- Ie
805
+ me
806
806
  );
807
807
  }
808
808
  static hasPositionProperty(e) {
@@ -814,11 +814,11 @@ class B {
814
814
  static hasEmptyProperty(e) {
815
815
  return Object.prototype.hasOwnProperty.call(
816
816
  e.getProperties() ?? {},
817
- mt
817
+ pt
818
818
  );
819
819
  }
820
820
  static isEmptyItem(e) {
821
- const t = e.getProperties(), r = t?.[mt];
821
+ const t = e.getProperties(), r = t?.[pt];
822
822
  return t !== void 0 && Object.keys(t).length === 1 && r !== void 0 && b.hasFieldsAndMayHaveFields(
823
823
  e,
824
824
  /* @__PURE__ */ new Set([S.PROPERTIES])
@@ -833,15 +833,15 @@ class B {
833
833
  return t !== void 0 && Object.keys(t).length === 1 && b.hasFieldsAndMayHaveFields(
834
834
  e,
835
835
  /* @__PURE__ */ new Set([S.PROPERTIES])
836
- ) && b.hasBlueIdOnly(t[Ie]);
836
+ ) && b.hasBlueIdOnly(t[me]);
837
837
  }
838
838
  static getPreviousBlueId(e) {
839
839
  if (this.isPreviousItem(e))
840
- return e.getProperties()?.[Ie]?.getBlueId();
840
+ return e.getProperties()?.[me]?.getBlueId();
841
841
  }
842
842
  static createPreviousItem(e) {
843
843
  return new u().setProperties({
844
- [Ie]: new u().setBlueId(e)
844
+ [me]: new u().setBlueId(e)
845
845
  });
846
846
  }
847
847
  static readPosition(e) {
@@ -874,7 +874,7 @@ class B {
874
874
  return !b.isEmptyNode(this.withoutPosition(e));
875
875
  }
876
876
  static isReplacementPayload(e) {
877
- return p(e.getValue()) || p(e.getItems()) || p(e.getBlueId());
877
+ return d(e.getValue()) || d(e.getItems()) || d(e.getBlueId());
878
878
  }
879
879
  static hasAnyListControlChild(e) {
880
880
  return e !== void 0 && this.hasAnyListControl(e);
@@ -883,12 +883,12 @@ class B {
883
883
  return e !== void 0 && this.hasPositionControl(e);
884
884
  }
885
885
  }
886
- const cs = /* @__PURE__ */ new Set([
886
+ const ts = /* @__PURE__ */ new Set([
887
887
  ie,
888
888
  ne,
889
889
  W
890
- ]), us = { $list: "empty" }, ds = "$listCons", hs = "prev", ps = "elem";
891
- class fs {
890
+ ]), rs = { $list: "empty" }, ss = "$listCons", is = "prev", ns = "elem";
891
+ class os {
892
892
  constructor(e) {
893
893
  this.hashProvider = e;
894
894
  }
@@ -910,7 +910,7 @@ class fs {
910
910
  calculateMap(e, t) {
911
911
  const s = Object.entries(e).sort(([o], [l]) => o.localeCompare(l)).map(
912
912
  ([o, l]) => {
913
- if (cs.has(o))
913
+ if (ts.has(o))
914
914
  return t ? [o, l] : Promise.resolve([o, l]);
915
915
  const a = this.calculateInternal(l, t);
916
916
  return t ? [o, { [V]: a }] : Promise.resolve(a).then((c) => [
@@ -937,7 +937,7 @@ class fs {
937
937
  );
938
938
  s = t ? o : Promise.resolve(o), r = 1;
939
939
  } else
940
- s = this.applyHash(us, t);
940
+ s = this.applyHash(rs, t);
941
941
  for (let o = r; o < e.length; o++) {
942
942
  const l = e[o];
943
943
  if (this.hasPreviousControlKey(l))
@@ -951,16 +951,16 @@ class fs {
951
951
  this.createListFoldInput(a, c),
952
952
  !0
953
953
  ) : s = Promise.all([a, c]).then(
954
- ([d, h]) => this.applyHash(this.createListFoldInput(d, h), !1)
954
+ ([h, p]) => this.applyHash(this.createListFoldInput(h, p), !1)
955
955
  );
956
956
  }
957
957
  return s;
958
958
  }
959
959
  createListFoldInput(e, t) {
960
960
  return {
961
- [ds]: {
962
- [hs]: { [V]: e },
963
- [ps]: { [V]: t }
961
+ [ss]: {
962
+ [is]: { [V]: e },
963
+ [ns]: { [V]: t }
964
964
  }
965
965
  };
966
966
  }
@@ -968,14 +968,14 @@ class fs {
968
968
  if (typeof e != "object" || e === null || Array.isArray(e) || C(e))
969
969
  return;
970
970
  const t = Object.entries(e);
971
- if (t.length !== 1 || t[0][0] !== Ie)
971
+ if (t.length !== 1 || t[0][0] !== me)
972
972
  return;
973
973
  const r = t[0][1];
974
974
  if (!(typeof r != "object" || r === null || Array.isArray(r) || C(r) || !this.isPureReference(r)))
975
975
  return r[V];
976
976
  }
977
977
  hasPreviousControlKey(e) {
978
- return this.hasControlKey(e, Ie);
978
+ return this.hasControlKey(e, me);
979
979
  }
980
980
  hasPositionControlKey(e) {
981
981
  return this.hasControlKey(e, ce);
@@ -991,7 +991,7 @@ class fs {
991
991
  }
992
992
  nodeToHashValue(e) {
993
993
  const t = {};
994
- this.setIfPresent(t, ie, e.getName()), this.setIfPresent(t, ne, e.getDescription()), this.setIfPresent(t, K, e.getType()), this.setIfPresent(t, we, e.getItemType()), this.setIfPresent(t, Se, e.getKeyType()), this.setIfPresent(t, be, e.getValueType());
994
+ this.setIfPresent(t, ie, e.getName()), this.setIfPresent(t, ne, e.getDescription()), this.setIfPresent(t, z, e.getType()), this.setIfPresent(t, Pe, e.getItemType()), this.setIfPresent(t, we, e.getKeyType()), this.setIfPresent(t, Se, e.getValueType());
995
995
  const r = e.getValue();
996
996
  r !== void 0 && (t[W] = this.scalarToHashValue(r));
997
997
  const s = e.getItems();
@@ -1043,14 +1043,14 @@ class fs {
1043
1043
  return t.length === 1 && t[0]?.[0] === W;
1044
1044
  }
1045
1045
  isBasicTypedScalarWrapper(e) {
1046
- return this.hasOnlyKeys(e, [K, W]) && this.isBasicScalarTypeReference(e[K]);
1046
+ return this.hasOnlyKeys(e, [z, W]) && this.isBasicScalarTypeReference(e[z]);
1047
1047
  }
1048
1048
  isListWrapper(e) {
1049
1049
  const t = Object.entries(e);
1050
1050
  return t.length === 1 && t[0]?.[0] === Y && Array.isArray(t[0]?.[1]);
1051
1051
  }
1052
1052
  isBasicTypedListWrapper(e) {
1053
- return this.hasOnlyKeys(e, [K, Y]) && this.isTypeReference(e[K], rt) && Array.isArray(e[Y]);
1053
+ return this.hasOnlyKeys(e, [z, Y]) && this.isTypeReference(e[z], Qe) && Array.isArray(e[Y]);
1054
1054
  }
1055
1055
  hasOnlyKeys(e, t) {
1056
1056
  return Object.keys(e).length === t.length && t.every(
@@ -1064,24 +1064,24 @@ class fs {
1064
1064
  return typeof e != "object" || e === null || Array.isArray(e) || C(e) ? !1 : this.isPureReference(e) && e[V] === t;
1065
1065
  }
1066
1066
  isScalar(e) {
1067
- return Jt(e) && e !== null || C(e);
1067
+ return Ht(e) && e !== null || C(e);
1068
1068
  }
1069
1069
  scalarToHashValue(e) {
1070
1070
  if (e instanceof A || oe(e)) {
1071
1071
  const t = new G(Number.MIN_SAFE_INTEGER.toString()), r = new G(Number.MAX_SAFE_INTEGER.toString());
1072
1072
  return e.lt(t) || e.gt(r) ? e.toString() : e.toNumber();
1073
1073
  }
1074
- return e instanceof $ || C(e) ? e.toNumber() : e;
1074
+ return e instanceof _ || C(e) ? e.toNumber() : e;
1075
1075
  }
1076
1076
  toJsonScalar(e) {
1077
1077
  return C(e) ? this.scalarToHashValue(e) : e;
1078
1078
  }
1079
1079
  }
1080
1080
  class M {
1081
- static INSTANCE = new M(new as());
1081
+ static INSTANCE = new M(new es());
1082
1082
  hasher;
1083
1083
  constructor(e) {
1084
- this.hasher = new fs(e);
1084
+ this.hasher = new os(e);
1085
1085
  }
1086
1086
  static calculateBlueId(e) {
1087
1087
  return M.INSTANCE.calculate(e);
@@ -1096,7 +1096,7 @@ class M {
1096
1096
  return this.hasher.calculateSync(e);
1097
1097
  }
1098
1098
  }
1099
- class U {
1099
+ class j {
1100
1100
  constructor(e = {
1101
1101
  emitListControls: !0
1102
1102
  }) {
@@ -1115,7 +1115,7 @@ class U {
1115
1115
  );
1116
1116
  }
1117
1117
  static toHashMinimalNode(e) {
1118
- return new U({ emitListControls: !1 }).reverse(e);
1118
+ return new j({ emitListControls: !1 }).reverse(e);
1119
1119
  }
1120
1120
  reverseNode(e, t, r, s) {
1121
1121
  const n = this.getEffectiveFromType(
@@ -1130,16 +1130,16 @@ class U {
1130
1130
  ), this.reverseItems(e, t, n), this.reverseProperties(e, t, n));
1131
1131
  }
1132
1132
  isIdenticalToType(e, t) {
1133
- return p(e.getBlueId()) && p(t?.getBlueId()) && e.getBlueId() === t.getBlueId();
1133
+ return d(e.getBlueId()) && d(t?.getBlueId()) && e.getBlueId() === t.getBlueId();
1134
1134
  }
1135
1135
  reverseBasicProperties(e, t, r, s) {
1136
1136
  const n = t.getValue();
1137
- p(n) && (v(r) || v(r.getValue())) && e.setValue(n), p(t.getName()) && (s || v(r) || t.getName() !== r.getName()) && e.setName(t.getName()), p(t.getDescription()) && (s || v(r) || t.getDescription() !== r.getDescription()) && e.setDescription(t.getDescription()), p(t.getBlueId()) && (v(r) || t.getBlueId() !== r.getBlueId()) && e.setBlueId(t.getBlueId());
1137
+ d(n) && (I(r) || I(r.getValue())) && e.setValue(n), d(t.getName()) && (s || I(r) || t.getName() !== r.getName()) && e.setName(t.getName()), d(t.getDescription()) && (s || I(r) || t.getDescription() !== r.getDescription()) && e.setDescription(t.getDescription()), d(t.getBlueId()) && (I(r) || t.getBlueId() !== r.getBlueId()) && e.setBlueId(t.getBlueId());
1138
1138
  }
1139
1139
  reverseTypeReferences(e, t, r, s) {
1140
1140
  const n = (o, l, a) => {
1141
- const c = o(t), d = a ? o(a) : void 0;
1142
- p(c) && !this.areTypeReferencesEquivalent(c, d) && l(e, this.toMinimalTypeReference(c));
1141
+ const c = o(t), h = a ? o(a) : void 0;
1142
+ d(c) && !this.areTypeReferencesEquivalent(c, h) && l(e, this.toMinimalTypeReference(c));
1143
1143
  };
1144
1144
  n(
1145
1145
  (o) => o.getType(),
@@ -1160,32 +1160,32 @@ class U {
1160
1160
  );
1161
1161
  }
1162
1162
  areTypeReferencesEquivalent(e, t) {
1163
- if (v(t))
1163
+ if (I(t))
1164
1164
  return !1;
1165
1165
  const r = e.getBlueId(), s = t.getBlueId();
1166
- return p(r) || p(s) ? p(r) && p(s) && r === s : U.calculateHashMinimalBlueId(e) === U.calculateHashMinimalBlueId(t);
1166
+ return d(r) || d(s) ? d(r) && d(s) && r === s : j.calculateHashMinimalBlueId(e) === j.calculateHashMinimalBlueId(t);
1167
1167
  }
1168
1168
  toMinimalTypeReference(e) {
1169
1169
  const t = e.getBlueId();
1170
- if (p(t))
1170
+ if (d(t))
1171
1171
  return new u().setBlueId(t);
1172
1172
  const r = new u();
1173
1173
  return this.reverseNode(r, e, void 0, !0), b.isEmptyNode(r) ? e.clone() : r;
1174
1174
  }
1175
1175
  reverseItems(e, t, r) {
1176
1176
  const s = t.getItems();
1177
- if (v(s))
1177
+ if (I(s))
1178
1178
  return;
1179
1179
  const n = r?.getItems();
1180
1180
  if (s.length === 0) {
1181
- (v(n) || n.length > 0) && e.setItems([]);
1181
+ (I(n) || n.length > 0) && e.setItems([]);
1182
1182
  return;
1183
1183
  }
1184
- if (p(n) && s.length === n.length && s.every(
1185
- (l, a) => U.calculateHashMinimalBlueId(l) === U.calculateHashMinimalBlueId(n[a])
1184
+ if (d(n) && s.length === n.length && s.every(
1185
+ (l, a) => j.calculateHashMinimalBlueId(l) === j.calculateHashMinimalBlueId(n[a])
1186
1186
  ))
1187
1187
  return;
1188
- const o = this.options.emitListControls !== !1 && p(n) && n.length > 0 ? this.reverseInheritedItems(t, r) : this.reverseFullItems(s);
1188
+ const o = this.options.emitListControls !== !1 && d(n) && n.length > 0 ? this.reverseInheritedItems(t, r) : this.reverseFullItems(s);
1189
1189
  o.length > 0 && e.setItems(o);
1190
1190
  }
1191
1191
  reverseInheritedItems(e, t) {
@@ -1196,26 +1196,26 @@ class U {
1196
1196
  );
1197
1197
  const n = B.getMergePolicy(e, t), o = [];
1198
1198
  for (let c = 0; c < s.length; c++)
1199
- U.calculateHashMinimalBlueId(r[c]) !== U.calculateHashMinimalBlueId(s[c]) && o.push(c);
1199
+ j.calculateHashMinimalBlueId(r[c]) !== j.calculateHashMinimalBlueId(s[c]) && o.push(c);
1200
1200
  if (o.length > 0 && n === "append-only")
1201
1201
  throw new Error(
1202
1202
  "append-only list cannot be minimized as a non-prefix mutation."
1203
1203
  );
1204
- const l = U.calculateHashMinimalListBlueId(s), a = [B.createPreviousItem(l)];
1204
+ const l = j.calculateHashMinimalListBlueId(s), a = [B.createPreviousItem(l)];
1205
1205
  for (const c of o) {
1206
- const d = new u();
1206
+ const h = new u();
1207
1207
  this.reverseNode(
1208
- d,
1208
+ h,
1209
1209
  r[c],
1210
1210
  s[c],
1211
1211
  !1
1212
1212
  );
1213
- const h = b.isEmptyNode(d) ? r[c].clone() : d;
1214
- a.push(B.createPositionedItem(c, h));
1213
+ const p = b.isEmptyNode(h) ? r[c].clone() : h;
1214
+ a.push(B.createPositionedItem(c, p));
1215
1215
  }
1216
1216
  for (let c = s.length; c < r.length; c++) {
1217
- const d = new u();
1218
- this.reverseNode(d, r[c], void 0, !1), a.push(d);
1217
+ const h = new u();
1218
+ this.reverseNode(h, r[c], void 0, !1), a.push(h);
1219
1219
  }
1220
1220
  return a.length === 1 ? [] : a;
1221
1221
  }
@@ -1229,7 +1229,7 @@ class U {
1229
1229
  }
1230
1230
  reverseProperties(e, t, r) {
1231
1231
  const s = t.getProperties();
1232
- if (v(s))
1232
+ if (I(s))
1233
1233
  return;
1234
1234
  const n = {};
1235
1235
  for (const [o, l] of Object.entries(s)) {
@@ -1252,10 +1252,10 @@ class U {
1252
1252
  }
1253
1253
  getEffectiveFromType(e, t) {
1254
1254
  const r = this.createOwnTypeOverlay(t.getType());
1255
- return v(e) ? r : v(r) ? e : this.mergeNodes(e, r);
1255
+ return I(e) ? r : I(r) ? e : this.mergeNodes(e, r);
1256
1256
  }
1257
1257
  createOwnTypeOverlay(e) {
1258
- if (v(e))
1258
+ if (I(e))
1259
1259
  return;
1260
1260
  const t = e.cloneShallow().setName(void 0).setDescription(void 0).setType(void 0).setBlueId(void 0);
1261
1261
  if (!b.isEmptyNode(t))
@@ -1268,31 +1268,31 @@ class U {
1268
1268
  */
1269
1269
  mergeNodes(e, t) {
1270
1270
  const r = e.clone(), s = t.getValue();
1271
- p(s) && r.setValue(s);
1271
+ d(s) && r.setValue(s);
1272
1272
  const n = t.getType();
1273
- p(n) && r.setType(n.clone());
1273
+ d(n) && r.setType(n.clone());
1274
1274
  const o = t.getItemType();
1275
- p(o) && r.setItemType(o.clone());
1275
+ d(o) && r.setItemType(o.clone());
1276
1276
  const l = t.getKeyType();
1277
- p(l) && r.setKeyType(l.clone());
1277
+ d(l) && r.setKeyType(l.clone());
1278
1278
  const a = t.getValueType();
1279
- p(a) && r.setValueType(a.clone());
1279
+ d(a) && r.setValueType(a.clone());
1280
1280
  const c = t.getProperties();
1281
- if (p(c)) {
1282
- const h = r.getProperties() || {};
1283
- for (const [f, g] of Object.entries(c)) {
1284
- const I = h[f];
1285
- h[f] = I === void 0 ? g.clone() : this.mergeNodes(I, g);
1281
+ if (d(c)) {
1282
+ const p = r.getProperties() || {};
1283
+ for (const [y, g] of Object.entries(c)) {
1284
+ const v = p[y];
1285
+ p[y] = v === void 0 ? g.clone() : this.mergeNodes(v, g);
1286
1286
  }
1287
- r.setProperties(h);
1287
+ r.setProperties(p);
1288
1288
  }
1289
- const d = t.getItems();
1290
- return p(d) && r.setItems(d.map((h) => h.clone())), r;
1289
+ const h = t.getItems();
1290
+ return d(h) && r.setItems(h.map((p) => p.clone())), r;
1291
1291
  }
1292
1292
  }
1293
- class It {
1294
- mergeReverser = new U();
1295
- hashMergeReverser = new U({
1293
+ class ft {
1294
+ mergeReverser = new j();
1295
+ hashMergeReverser = new j({
1296
1296
  emitListControls: !1
1297
1297
  });
1298
1298
  /**
@@ -1314,16 +1314,15 @@ class It {
1314
1314
  return this.hashMergeReverser.reverse(e);
1315
1315
  }
1316
1316
  }
1317
- class he extends Error {
1317
+ class Te extends Error {
1318
1318
  code;
1319
1319
  details;
1320
1320
  constructor(e, t, r) {
1321
1321
  super(t), this.code = e, this.details = r && r.length > 0 ? r : [], this.name = "BlueError";
1322
1322
  }
1323
1323
  }
1324
- const j = {
1324
+ const K = {
1325
1325
  AMBIGUOUS_BLUE_ID_PAYLOAD: "AMBIGUOUS_BLUE_ID_PAYLOAD",
1326
- BLUE_ID_MISMATCH: "BLUE_ID_MISMATCH",
1327
1326
  INVALID_STORAGE_SHAPE: "INVALID_STORAGE_SHAPE",
1328
1327
  REPO_UNKNOWN_REPO_BLUE_ID: "REPO_UNKNOWN_REPO_BLUE_ID",
1329
1328
  REPO_UNREPRESENTABLE_IN_TARGET_VERSION: "REPO_UNREPRESENTABLE_IN_TARGET_VERSION",
@@ -1332,9 +1331,9 @@ const j = {
1332
1331
  };
1333
1332
  class X {
1334
1333
  static RESERVED_PROPERTY_KEYS = /* @__PURE__ */ new Set([
1335
- ir,
1336
- bt,
1337
- z
1334
+ Qt,
1335
+ Tt,
1336
+ U
1338
1337
  ]);
1339
1338
  static INTERNAL_PROPERTIES_KEY = "properties";
1340
1339
  static validateStorageShape(e) {
@@ -1373,13 +1372,13 @@ class X {
1373
1372
  if (r.insideItems && B.hasPositionProperty(e) && b.hasBlueIdOnly(B.withoutPosition(e)))
1374
1373
  B.readPosition(e);
1375
1374
  else {
1376
- const h = this.toPointer(t);
1377
- throw new he(
1378
- j.AMBIGUOUS_BLUE_ID_PAYLOAD,
1379
- `Ambiguous blueId plus payload at ${h}. Use exact { blueId } for references or remove blueId from payload content.`,
1375
+ const p = this.toPointer(t);
1376
+ throw new Te(
1377
+ K.AMBIGUOUS_BLUE_ID_PAYLOAD,
1378
+ `Ambiguous blueId plus payload at ${p}. Use exact { blueId } for references or remove blueId from payload content.`,
1380
1379
  [
1381
1380
  {
1382
- code: j.AMBIGUOUS_BLUE_ID_PAYLOAD,
1381
+ code: K.AMBIGUOUS_BLUE_ID_PAYLOAD,
1383
1382
  message: "A storage or authoring node cannot combine blueId with payload.",
1384
1383
  locationPath: t,
1385
1384
  context: { blueId: s }
@@ -1397,16 +1396,16 @@ class X {
1397
1396
  ), l && a && this.throwInvalidStorageShape(
1398
1397
  t,
1399
1398
  "A storage or authoring node cannot combine items payload with object child fields."
1400
- ), this.validateChild(e.getType(), [...t, "type"]), this.validateChild(e.getItemType(), [...t, "itemType"]), this.validateChild(e.getKeyType(), [...t, "keyType"]), this.validateChild(e.getValueType(), [...t, "valueType"]), this.validateChild(e.getBlue(), [...t, "blue"]), e.getItems()?.forEach((d, h) => {
1401
- this.validateNode(d, [...t, "items", String(h)], {
1399
+ ), this.validateChild(e.getType(), [...t, "type"]), this.validateChild(e.getItemType(), [...t, "itemType"]), this.validateChild(e.getKeyType(), [...t, "keyType"]), this.validateChild(e.getValueType(), [...t, "valueType"]), this.validateChild(e.getBlue(), [...t, "blue"]), e.getItems()?.forEach((h, p) => {
1400
+ this.validateNode(h, [...t, "items", String(p)], {
1402
1401
  insideItems: !0,
1403
- itemIndex: h
1402
+ itemIndex: p
1404
1403
  });
1405
1404
  });
1406
1405
  const c = e.getProperties();
1407
1406
  if (c !== void 0)
1408
- for (const [d, h] of Object.entries(c))
1409
- this.validateNode(h, [...t, d], { insideItems: !1 });
1407
+ for (const [h, p] of Object.entries(c))
1408
+ this.validateNode(p, [...t, h], { insideItems: !1 });
1410
1409
  }
1411
1410
  static validateListControlItem(e, t, r) {
1412
1411
  if (B.hasEmptyProperty(e) && (B.hasPreviousProperty(e) && this.throwInvalidStorageShape(
@@ -1459,18 +1458,18 @@ class X {
1459
1458
  "The document-level properties key is not part of the Blue language."
1460
1459
  ), Object.fromEntries(
1461
1460
  Object.entries(s).filter(
1462
- ([n]) => !this.RESERVED_PROPERTY_KEYS.has(n) && !(r.insideItems && (n === ce || n === mt))
1461
+ ([n]) => !this.RESERVED_PROPERTY_KEYS.has(n) && !(r.insideItems && (n === ce || n === pt))
1463
1462
  )
1464
1463
  );
1465
1464
  }
1466
1465
  static throwInvalidStorageShape(e, t) {
1467
1466
  const r = this.toPointer(e);
1468
- throw new he(
1469
- j.INVALID_STORAGE_SHAPE,
1467
+ throw new Te(
1468
+ K.INVALID_STORAGE_SHAPE,
1470
1469
  `${t} at ${r}`,
1471
1470
  [
1472
1471
  {
1473
- code: j.INVALID_STORAGE_SHAPE,
1472
+ code: K.INVALID_STORAGE_SHAPE,
1474
1473
  message: t,
1475
1474
  locationPath: e
1476
1475
  }
@@ -1481,12 +1480,12 @@ class X {
1481
1480
  return e.length === 0 ? "/" : `/${e.map((t) => t.replace(/~/g, "~0").replace(/\//g, "~1")).join("/")}`;
1482
1481
  }
1483
1482
  }
1484
- class On {
1483
+ class yn {
1485
1484
  static convert(e) {
1486
1485
  const t = Ae.decode(e), r = new Uint8Array(2 + t.length);
1487
1486
  r[0] = 18, r[1] = 32, r.set(t, 2);
1488
1487
  const s = new Uint8Array(2 + r.length);
1489
- return s[0] = 1, s[1] = 85, s.set(r, 2), "b" + new Zr.Encoder({ type: "rfc4648", lc: !0 }).write(s).finalize().replace(/=/g, "");
1488
+ return s[0] = 1, s[1] = 85, s.set(r, 2), "b" + new zr.Encoder({ type: "rfc4648", lc: !0 }).write(s).finalize().replace(/=/g, "");
1490
1489
  }
1491
1490
  }
1492
1491
  class T {
@@ -1504,7 +1503,7 @@ class T {
1504
1503
  const { strategy: r } = this.normalizeOptions(t), s = e.getValue(), n = this.handleValue(s);
1505
1504
  if (n !== void 0 && r === "simple")
1506
1505
  return n;
1507
- const o = e.getItems()?.map((x) => T.get(x, r));
1506
+ const o = e.getItems()?.map((L) => T.get(L, r));
1508
1507
  if (o !== void 0 && r === "simple")
1509
1508
  return o;
1510
1509
  const l = e.getName(), a = e.getDescription();
@@ -1516,24 +1515,24 @@ class T {
1516
1515
  }
1517
1516
  const c = {};
1518
1517
  l !== void 0 && (c[ie] = l), a !== void 0 && (c[ne] = a);
1519
- const d = e.getType();
1520
- if (r === "official" && s !== void 0 && d === void 0) {
1521
- const x = this.inferTypeBlueId(s);
1522
- x !== null && (c[K] = { [V]: x });
1523
- } else d !== void 0 && (c[K] = T.get(d, r));
1524
- const h = e.getItemType();
1525
- h !== void 0 && (c[we] = T.get(h, r));
1526
- const f = e.getKeyType();
1527
- f !== void 0 && (c[Se] = T.get(f, r));
1518
+ const h = e.getType();
1519
+ if (r === "official" && s !== void 0 && h === void 0) {
1520
+ const L = this.inferTypeBlueId(s);
1521
+ L !== null && (c[z] = { [V]: L });
1522
+ } else h !== void 0 && (c[z] = T.get(h, r));
1523
+ const p = e.getItemType();
1524
+ p !== void 0 && (c[Pe] = T.get(p, r));
1525
+ const y = e.getKeyType();
1526
+ y !== void 0 && (c[we] = T.get(y, r));
1528
1527
  const g = e.getValueType();
1529
- g !== void 0 && (c[be] = T.get(g, r)), n !== void 0 && (c[W] = n), o !== void 0 && (c[Y] = o);
1530
- const I = e.getBlueId();
1531
- I !== void 0 && (c[V] = I);
1528
+ g !== void 0 && (c[Se] = T.get(g, r)), n !== void 0 && (c[W] = n), o !== void 0 && (c[Y] = o);
1529
+ const v = e.getBlueId();
1530
+ v !== void 0 && (c[V] = v);
1532
1531
  const D = e.getBlue();
1533
1532
  D !== void 0 && (c[Le] = D);
1534
1533
  const R = e.getProperties();
1535
- return R !== void 0 && Object.entries(R).forEach(([x, je]) => {
1536
- c[x] = T.get(je, r);
1534
+ return R !== void 0 && Object.entries(R).forEach(([L, _e]) => {
1535
+ c[L] = T.get(_e, r);
1537
1536
  }), c;
1538
1537
  }
1539
1538
  static handleValue(e) {
@@ -1558,7 +1557,7 @@ class T {
1558
1557
  };
1559
1558
  }
1560
1559
  }
1561
- class L {
1560
+ class $ {
1562
1561
  /**
1563
1562
  * Transforms a node and all its child nodes using the provided transformer function
1564
1563
  * @param node - The node to transform
@@ -1567,45 +1566,45 @@ class L {
1567
1566
  */
1568
1567
  static transform(e, t) {
1569
1568
  const r = t(e.clone()), s = r.getType();
1570
- s !== void 0 && r.setType(L.transform(s, t));
1569
+ s !== void 0 && r.setType($.transform(s, t));
1571
1570
  const n = r.getItemType();
1572
1571
  n !== void 0 && r.setItemType(
1573
- L.transform(n, t)
1572
+ $.transform(n, t)
1574
1573
  );
1575
1574
  const o = r.getKeyType();
1576
1575
  o !== void 0 && r.setKeyType(
1577
- L.transform(o, t)
1576
+ $.transform(o, t)
1578
1577
  );
1579
1578
  const l = r.getValueType();
1580
1579
  l !== void 0 && r.setValueType(
1581
- L.transform(l, t)
1580
+ $.transform(l, t)
1582
1581
  );
1583
1582
  const a = r.getItems();
1584
1583
  if (a !== void 0) {
1585
- const d = a.map(
1586
- (h) => L.transform(h, t)
1584
+ const h = a.map(
1585
+ (p) => $.transform(p, t)
1587
1586
  );
1588
- r.setItems(d);
1587
+ r.setItems(h);
1589
1588
  }
1590
1589
  const c = r.getProperties();
1591
1590
  if (c !== void 0) {
1592
- const d = Object.keys(c).reduce(
1593
- (h, f) => (h[f] = L.transform(c[f], t), h),
1591
+ const h = Object.keys(c).reduce(
1592
+ (p, y) => (p[y] = $.transform(c[y], t), p),
1594
1593
  {}
1595
1594
  );
1596
- r.setProperties(d);
1595
+ r.setProperties(h);
1597
1596
  }
1598
1597
  return r;
1599
1598
  }
1600
1599
  }
1601
- const le = (i) => !!i && typeof i == "object" && !Array.isArray(i) && !(i instanceof u), q = (i) => i instanceof A || i instanceof $, ys = (i) => i.replace(/~1/g, "/").replace(/~0/g, "~");
1602
- function Ee(i) {
1600
+ const le = (i) => !!i && typeof i == "object" && !Array.isArray(i) && !(i instanceof u), q = (i) => i instanceof A || i instanceof _, ls = (i) => i.replace(/~1/g, "/").replace(/~0/g, "~");
1601
+ function be(i) {
1603
1602
  if (i === "/") return [];
1604
1603
  if (!i.startsWith("/"))
1605
1604
  throw new Error(`Path must start with '/': ${i}`);
1606
- return i.split("/").slice(1).map(ys);
1605
+ return i.split("/").slice(1).map(ls);
1607
1606
  }
1608
- function Pe(i) {
1607
+ function Be(i) {
1609
1608
  if (i === "-") return -1;
1610
1609
  const e = typeof i == "number" ? i : parseInt(i, 10);
1611
1610
  if (isNaN(e))
@@ -1616,7 +1615,7 @@ function Pe(i) {
1616
1615
  );
1617
1616
  return e;
1618
1617
  }
1619
- function yr(i, e, t, r = !0) {
1618
+ function ur(i, e, t, r = !0) {
1620
1619
  switch (e) {
1621
1620
  case "name":
1622
1621
  return t ? r ? i.getName() ?? null : i : i.getName();
@@ -1640,15 +1639,15 @@ function yr(i, e, t, r = !0) {
1640
1639
  return i.getItems();
1641
1640
  case "properties":
1642
1641
  return i.getProperties();
1643
- case z:
1642
+ case U:
1644
1643
  return i.getContracts();
1645
1644
  default:
1646
1645
  return;
1647
1646
  }
1648
1647
  }
1649
- function Ut(i, e, t = !0) {
1648
+ function $t(i, e, t = !0) {
1650
1649
  if (i instanceof u) {
1651
- const r = yr(
1650
+ const r = ur(
1652
1651
  i,
1653
1652
  e,
1654
1653
  !0,
@@ -1666,7 +1665,7 @@ function Ut(i, e, t = !0) {
1666
1665
  "blue",
1667
1666
  "items",
1668
1667
  "properties",
1669
- z
1668
+ U
1670
1669
  ].includes(e))
1671
1670
  return r;
1672
1671
  if (/^-?\d+$/.test(e) && e !== "-") {
@@ -1678,12 +1677,12 @@ function Ut(i, e, t = !0) {
1678
1677
  }
1679
1678
  if (Array.isArray(i)) {
1680
1679
  if (e === "-") return;
1681
- const r = Pe(e);
1680
+ const r = Be(e);
1682
1681
  return r >= 0 && r < i.length ? i[r] : void 0;
1683
1682
  }
1684
1683
  if (le(i)) return i[e];
1685
1684
  }
1686
- function Ne(i, e) {
1685
+ function Ee(i, e) {
1687
1686
  if (e.length === 0)
1688
1687
  return {
1689
1688
  parent: i,
@@ -1692,14 +1691,14 @@ function Ne(i, e) {
1692
1691
  };
1693
1692
  let t = i;
1694
1693
  for (let s = 0; s < e.length - 1; ++s) {
1695
- const n = e[s], o = Ut(t, n);
1694
+ const n = e[s], o = $t(t, n);
1696
1695
  if (o === void 0)
1697
1696
  throw new Error(`Cannot resolve '/${e.slice(0, s + 1).join("/")}'`);
1698
1697
  t = o;
1699
1698
  }
1700
1699
  const r = e[e.length - 1];
1701
1700
  if (t instanceof u) {
1702
- const s = Ut(t, r, !1);
1701
+ const s = $t(t, r, !1);
1703
1702
  if ((typeof s != "object" || s === null || q(s)) && !(s instanceof u) && !Array.isArray(s) && ["name", "description", "value", "blueId"].includes(r))
1704
1703
  return {
1705
1704
  parent: t,
@@ -1709,12 +1708,12 @@ function Ne(i, e) {
1709
1708
  }
1710
1709
  return Array.isArray(t) && r === "-" ? { parent: t, key: "-" } : t instanceof u && t.getItems() && r === "-" ? { parent: t, key: "-" } : {
1711
1710
  parent: t,
1712
- key: Array.isArray(t) ? Pe(r) : r
1711
+ key: Array.isArray(t) ? Be(r) : r
1713
1712
  };
1714
1713
  }
1715
- function Ot(i, e) {
1714
+ function Nt(i, e) {
1716
1715
  if (i instanceof u) {
1717
- const t = e, r = yr(i, t, !1);
1716
+ const t = e, r = ur(i, t, !1);
1718
1717
  if (r !== void 0 || [
1719
1718
  "name",
1720
1719
  "description",
@@ -1727,7 +1726,7 @@ function Ot(i, e) {
1727
1726
  "blue",
1728
1727
  "items",
1729
1728
  "properties",
1730
- z
1729
+ U
1731
1730
  ].includes(t))
1732
1731
  return r;
1733
1732
  if (typeof e == "number" || typeof e == "string" && /^\d+$/.test(e)) {
@@ -1738,23 +1737,23 @@ function Ot(i, e) {
1738
1737
  }
1739
1738
  return Array.isArray(i) || le(i) ? i[e] : i;
1740
1739
  }
1741
- function _(i) {
1740
+ function x(i) {
1742
1741
  if (i instanceof u) return i;
1743
1742
  if (i === null || typeof i == "string" || typeof i == "number" || typeof i == "boolean" || q(i))
1744
1743
  return m.deserialize(i);
1745
- const e = vt(i);
1744
+ const e = yt(i);
1746
1745
  return m.deserialize(e);
1747
1746
  }
1748
- function vt(i) {
1747
+ function yt(i) {
1749
1748
  if (i === void 0) return null;
1750
1749
  if (i === null || typeof i != "object") return i;
1751
- if (Array.isArray(i)) return i.map(vt);
1750
+ if (Array.isArray(i)) return i.map(yt);
1752
1751
  const e = {};
1753
1752
  for (const [t, r] of Object.entries(i))
1754
- e[t] = vt(r);
1753
+ e[t] = yt(r);
1755
1754
  return e;
1756
1755
  }
1757
- function Mt(i, e, t) {
1756
+ function Ct(i, e, t) {
1758
1757
  if (i instanceof u) {
1759
1758
  const r = e;
1760
1759
  switch (r) {
@@ -1766,22 +1765,22 @@ function Mt(i, e, t) {
1766
1765
  return;
1767
1766
  case "type":
1768
1767
  i.setType(
1769
- t instanceof u || typeof t == "string" || t === void 0 ? t : _(t)
1768
+ t instanceof u || typeof t == "string" || t === void 0 ? t : x(t)
1770
1769
  );
1771
1770
  return;
1772
1771
  case "itemType":
1773
1772
  i.setItemType(
1774
- t instanceof u || typeof t == "string" || t === void 0 ? t : _(t)
1773
+ t instanceof u || typeof t == "string" || t === void 0 ? t : x(t)
1775
1774
  );
1776
1775
  return;
1777
1776
  case "keyType":
1778
1777
  i.setKeyType(
1779
- t instanceof u || typeof t == "string" || t === void 0 ? t : _(t)
1778
+ t instanceof u || typeof t == "string" || t === void 0 ? t : x(t)
1780
1779
  );
1781
1780
  return;
1782
1781
  case "valueType":
1783
1782
  i.setValueType(
1784
- t instanceof u || typeof t == "string" || t === void 0 ? t : _(t)
1783
+ t instanceof u || typeof t == "string" || t === void 0 ? t : x(t)
1785
1784
  );
1786
1785
  return;
1787
1786
  case "value": {
@@ -1794,7 +1793,7 @@ function Mt(i, e, t) {
1794
1793
  return;
1795
1794
  case "blue":
1796
1795
  i.setBlue(
1797
- t instanceof u || t === void 0 ? t : _(t)
1796
+ t instanceof u || t === void 0 ? t : x(t)
1798
1797
  );
1799
1798
  return;
1800
1799
  case "items":
@@ -1803,7 +1802,7 @@ function Mt(i, e, t) {
1803
1802
  case "properties":
1804
1803
  i.setProperties(t);
1805
1804
  return;
1806
- case z:
1805
+ case U:
1807
1806
  i.setContracts(t);
1808
1807
  return;
1809
1808
  default: {
@@ -1811,14 +1810,14 @@ function Mt(i, e, t) {
1811
1810
  const s = i.getProperties();
1812
1811
  s && r in s && delete s[r];
1813
1812
  } else
1814
- i.getProperties() || i.setProperties({}), i.addProperty(r, t instanceof u ? t : _(t));
1813
+ i.getProperties() || i.setProperties({}), i.addProperty(r, t instanceof u ? t : x(t));
1815
1814
  return;
1816
1815
  }
1817
1816
  }
1818
1817
  }
1819
- Array.isArray(i) ? i.splice(Pe(e), 1) : le(i) && (t === void 0 ? delete i[e] : i[e] = t);
1818
+ Array.isArray(i) ? i.splice(Be(e), 1) : le(i) && (t === void 0 ? delete i[e] : i[e] = t);
1820
1819
  }
1821
- function gs(i, e, t, r) {
1820
+ function as(i, e, t, r) {
1822
1821
  let s = -1;
1823
1822
  if (e !== "-" && (s = typeof e == "number" ? e : parseInt(e, 10), isNaN(s)))
1824
1823
  throw new Error(
@@ -1844,16 +1843,16 @@ function gs(i, e, t, r) {
1844
1843
  } else
1845
1844
  n.splice(s, 0, t);
1846
1845
  }
1847
- function Xe(i, e, t, r) {
1846
+ function Je(i, e, t, r) {
1848
1847
  if (Array.isArray(i)) {
1849
- const s = e === "-" ? i.length : Pe(e);
1848
+ const s = e === "-" ? i.length : Be(e);
1850
1849
  if (!r && s > i.length)
1851
1850
  throw new Error(
1852
1851
  `ADD operation failed: Target array index '${s}' is greater than array length ${i.length}. Path involving key '${e}'.`
1853
1852
  );
1854
1853
  if (s < 0 && e !== "-")
1855
1854
  throw new Error(`Invalid negative array index: ${e}`);
1856
- const n = _(t);
1855
+ const n = x(t);
1857
1856
  if (r) {
1858
1857
  if (s >= 0 && s < i.length) i[s] = n;
1859
1858
  else if (s >= i.length) {
@@ -1866,18 +1865,18 @@ function Xe(i, e, t, r) {
1866
1865
  return;
1867
1866
  }
1868
1867
  if (i instanceof u) {
1869
- e === "-" || typeof e == "number" && !isNaN(e) || typeof e == "string" && /^\d+$/.test(e) ? gs(i, e, _(t), r) : Mt(i, e, t);
1868
+ e === "-" || typeof e == "number" && !isNaN(e) || typeof e == "string" && /^\d+$/.test(e) ? as(i, e, x(t), r) : Ct(i, e, t);
1870
1869
  return;
1871
1870
  }
1872
1871
  if (le(i)) {
1873
- i[e] = _(t);
1872
+ i[e] = x(t);
1874
1873
  return;
1875
1874
  }
1876
1875
  throw new Error(`Cannot insert into parent of type ${typeof i}`);
1877
1876
  }
1878
- function ms(i, e) {
1877
+ function cs(i, e) {
1879
1878
  if (Array.isArray(i)) {
1880
- const t = Pe(e);
1879
+ const t = Be(e);
1881
1880
  t === -1 && e === "-" ? i.length > 0 && i.pop() : t >= 0 && t < i.length && i.splice(t, 1);
1882
1881
  return;
1883
1882
  }
@@ -1885,22 +1884,22 @@ function ms(i, e) {
1885
1884
  if (typeof e == "number" || typeof e == "string" && /^-?\d+$/.test(e)) {
1886
1885
  const t = i.getItems();
1887
1886
  if (t) {
1888
- const r = Pe(e);
1887
+ const r = Be(e);
1889
1888
  r === -1 && e === "-" ? t.length > 0 && t.pop() : r >= 0 && r < t.length && t.splice(r, 1), t.length === 0 && i.setItems(void 0);
1890
1889
  return;
1891
1890
  }
1892
1891
  }
1893
- Mt(i, e, void 0);
1892
+ Ct(i, e, void 0);
1894
1893
  } else le(i) && delete i[e];
1895
1894
  }
1896
- function Tt(i) {
1895
+ function gt(i) {
1897
1896
  if (i instanceof u) return i.clone();
1898
1897
  if (Array.isArray(i))
1899
- return i.map((t) => Tt(t));
1898
+ return i.map((t) => gt(t));
1900
1899
  if (le(i)) {
1901
1900
  const e = {};
1902
1901
  return Object.keys(i).forEach((t) => {
1903
- e[t] = Tt(i[t]);
1902
+ e[t] = gt(i[t]);
1904
1903
  }), e;
1905
1904
  }
1906
1905
  return i;
@@ -1918,76 +1917,76 @@ function ue(i, e) {
1918
1917
  }
1919
1918
  return !1;
1920
1919
  }
1921
- function gr(i, e) {
1922
- const { parent: t, key: r } = Ne(i, Ee(e));
1923
- return Ot(t, r);
1920
+ function dr(i, e) {
1921
+ const { parent: t, key: r } = Ee(i, be(e));
1922
+ return Nt(t, r);
1924
1923
  }
1925
- function mr(i, e, t) {
1926
- const r = Ee(e);
1924
+ function hr(i, e, t) {
1925
+ const r = be(e);
1927
1926
  if (r.length === 0 && e === "/") {
1928
- const o = _(t);
1927
+ const o = x(t);
1929
1928
  i.setValue(o.getValue() ?? null), o.getItems() ? i.setItems(o.getItems()) : i.setItems(void 0);
1930
1929
  return;
1931
1930
  }
1932
- const { parent: s, key: n } = Ne(i, r);
1933
- Xe(s, n, t, !0);
1931
+ const { parent: s, key: n } = Ee(i, r);
1932
+ Je(s, n, t, !0);
1934
1933
  }
1935
- function Is(i, e, t) {
1936
- const r = Ee(e);
1934
+ function us(i, e, t) {
1935
+ const r = be(e);
1937
1936
  if (r.length === 0 && e === "/") {
1938
1937
  if (i.getItems() && Array.isArray(t)) {
1939
- const o = _(t);
1938
+ const o = x(t);
1940
1939
  o.getItems() ? (i.setItems(o.getItems()), i.setValue(null)) : (i.setValue(o.getValue() ?? null), i.setItems(void 0));
1941
1940
  } else {
1942
- const o = _(t);
1941
+ const o = x(t);
1943
1942
  i.setValue(o.getValue() ?? null), o.getItems() && i.setItems(o.getItems());
1944
1943
  }
1945
1944
  return !0;
1946
1945
  }
1947
- const { parent: s, key: n } = Ne(i, r);
1948
- return Xe(s, n, t, !1), !0;
1946
+ const { parent: s, key: n } = Ee(i, r);
1947
+ return Je(s, n, t, !1), !0;
1949
1948
  }
1950
- function vs(i, e, t) {
1951
- const r = Ee(e);
1949
+ function ds(i, e, t) {
1950
+ const r = be(e);
1952
1951
  if (r.length === 0 && e === "/") {
1953
- const l = _(t);
1952
+ const l = x(t);
1954
1953
  return i.setValue(l.getValue() ?? null), l.getItems() ? i.setItems(l.getItems()) : i.setItems(void 0), !0;
1955
1954
  }
1956
- const { parent: s, key: n, actualTarget: o } = Ne(i, r);
1955
+ const { parent: s, key: n, actualTarget: o } = Ee(i, r);
1957
1956
  if (o !== void 0 && s instanceof u)
1958
- Mt(s, n, t);
1957
+ Ct(s, n, t);
1959
1958
  else {
1960
- const l = Ot(s, n), a = Array.isArray(s) || s instanceof u && s.getItems() && (typeof n == "number" || typeof n == "string" && /^\d+$/.test(n));
1959
+ const l = Nt(s, n), a = Array.isArray(s) || s instanceof u && s.getItems() && (typeof n == "number" || typeof n == "string" && /^\d+$/.test(n));
1961
1960
  if (l === void 0) {
1962
1961
  if (a)
1963
1962
  throw new Error(
1964
1963
  `REPLACE failed: Target array index '${n.toString()}' is out of bounds or does not exist at path '${e}'.`
1965
1964
  );
1966
- Xe(s, n, t, !0);
1965
+ Je(s, n, t, !0);
1967
1966
  } else
1968
- Xe(s, n, t, !0);
1967
+ Je(s, n, t, !0);
1969
1968
  }
1970
1969
  return !0;
1971
1970
  }
1972
- function Ir(i, e) {
1973
- const t = Ee(e);
1971
+ function pr(i, e) {
1972
+ const t = be(e);
1974
1973
  if (t.length === 0 && e === "/")
1975
1974
  return i.setValue(null), i.setItems(void 0), i.setProperties(void 0), !0;
1976
- const { parent: r, key: s } = Ne(i, t);
1977
- return ms(r, s), !0;
1975
+ const { parent: r, key: s } = Ee(i, t);
1976
+ return cs(r, s), !0;
1978
1977
  }
1979
- function Ts(i, e, t) {
1980
- const r = Tt(gr(i, e));
1981
- return mr(i, t, r), !0;
1978
+ function hs(i, e, t) {
1979
+ const r = gt(dr(i, e));
1980
+ return hr(i, t, r), !0;
1982
1981
  }
1983
- function Bs(i, e, t) {
1984
- const r = Ee(e), { parent: s, key: n } = Ne(i, r), o = Ot(s, n);
1982
+ function ps(i, e, t) {
1983
+ const r = be(e), { parent: s, key: n } = Ee(i, r), o = Nt(s, n);
1985
1984
  if (o === void 0)
1986
1985
  throw new Error(`MOVE failed: 'from' location '${e}' does not exist.`);
1987
- return Ir(i, e) ? (mr(i, t, o), !0) : !1;
1986
+ return pr(i, e) ? (hr(i, t, o), !0) : !1;
1988
1987
  }
1989
- function Ps(i, e, t) {
1990
- const r = gr(i, e);
1988
+ function fs(i, e, t) {
1989
+ const r = dr(i, e);
1991
1990
  let s = t;
1992
1991
  if (r instanceof u)
1993
1992
  if ((t === null || typeof t == "string" || typeof t == "number" || typeof t == "boolean" || q(t)) && (r.isInlineValue() || r.getValue() !== void 0)) {
@@ -1998,9 +1997,9 @@ function Ps(i, e, t) {
1998
1997
  )}, got ${JSON.stringify(r.getValue() ?? null)}`
1999
1998
  );
2000
1999
  return !0;
2001
- } else typeof t == "object" && !(t instanceof u) && (s = _(t));
2000
+ } else typeof t == "object" && !(t instanceof u) && (s = x(t));
2002
2001
  else if (q(r) && typeof t == "number")
2003
- r instanceof A ? s = new A(t.toString()) : r instanceof $ && (s = new $(t.toString()));
2002
+ r instanceof A ? s = new A(t.toString()) : r instanceof _ && (s = new _(t.toString()));
2004
2003
  else if ((r === null || typeof r == "string" || typeof r == "number" || typeof r == "boolean") && q(t)) {
2005
2004
  const n = t;
2006
2005
  !ue(r, n.toString()) && (typeof r == "number" && parseFloat(n.toString()));
@@ -2013,91 +2012,91 @@ function Ps(i, e, t) {
2013
2012
  }
2014
2013
  return !0;
2015
2014
  }
2016
- function ws(i, e) {
2015
+ function ys(i, e) {
2017
2016
  switch (e.op) {
2018
2017
  case "add":
2019
- return Is(i, e.path, e.val);
2018
+ return us(i, e.path, e.val);
2020
2019
  case "replace":
2021
- return vs(i, e.path, e.val);
2020
+ return ds(i, e.path, e.val);
2022
2021
  case "remove":
2023
- return Ir(i, e.path);
2022
+ return pr(i, e.path);
2024
2023
  case "copy":
2025
- return Ts(i, e.from, e.path);
2024
+ return hs(i, e.from, e.path);
2026
2025
  case "move":
2027
- return Bs(i, e.from, e.path);
2026
+ return ps(i, e.from, e.path);
2028
2027
  case "test":
2029
- return Ps(i, e.path, e.val);
2028
+ return fs(i, e.path, e.val);
2030
2029
  }
2031
2030
  }
2032
- function Mn(i, e, t = !1) {
2031
+ function gn(i, e, t = !1) {
2033
2032
  const r = t ? i : i.clone();
2034
- return ws(r, e), r;
2033
+ return ys(r, e), r;
2035
2034
  }
2036
- const dt = Symbol.for("zod-schema-annotations");
2037
- function Ss() {
2035
+ const at = Symbol.for("zod-schema-annotations");
2036
+ function gs() {
2038
2037
  if (typeof globalThis < "u") return globalThis;
2039
2038
  if (typeof global < "u") return global;
2040
2039
  if (typeof window < "u") return window;
2041
2040
  if (typeof self < "u") return self;
2042
2041
  throw new Error("Unable to locate global object");
2043
2042
  }
2044
- function vr() {
2045
- const i = Ss();
2046
- return dt in i || (i[dt] = /* @__PURE__ */ new WeakMap()), i[dt];
2043
+ function fr() {
2044
+ const i = gs();
2045
+ return at in i || (i[at] = /* @__PURE__ */ new WeakMap()), i[at];
2047
2046
  }
2048
2047
  function $e(i, e) {
2049
- const t = vr(), r = t.get(i) || {};
2048
+ const t = fr(), r = t.get(i) || {};
2050
2049
  return t.set(i, { ...r, ...e }), i;
2051
2050
  }
2052
- const Z = (i) => vr().get(i), bs = (i) => (e) => {
2051
+ const Z = (i) => fr().get(i), ms = (i) => (e) => {
2053
2052
  const t = Z(e);
2054
2053
  return $e(e, {
2055
2054
  ...t,
2056
2055
  blueDescription: i
2057
2056
  });
2058
- }, Es = (i) => {
2057
+ }, Is = (i) => {
2059
2058
  const e = Z(i);
2060
- return p(e) && St(e.blueDescription) ? e.blueDescription : null;
2061
- }, Dn = (i) => bs(i)(y.string().optional()), Ns = y.union([y.string(), y.boolean()]), Cs = (i) => (e) => {
2059
+ return d(e) && vt(e.blueDescription) ? e.blueDescription : null;
2060
+ }, mn = (i) => ms(i)(f.string().optional()), vs = f.union([f.string(), f.boolean()]), Ts = (i) => (e) => {
2062
2061
  const t = Z(e);
2063
2062
  return $e(e, {
2064
2063
  ...t,
2065
2064
  blueId: i
2066
2065
  });
2067
- }, Rs = (i) => {
2068
- const e = Z(i), t = Ns.safeParse(e?.blueId);
2066
+ }, Bs = (i) => {
2067
+ const e = Z(i), t = vs.safeParse(e?.blueId);
2069
2068
  return t.success ? t.data : null;
2070
- }, xn = (i) => Cs(i ?? !0)(y.string()), As = (i) => (e) => {
2069
+ }, In = (i) => Ts(i ?? !0)(f.string()), Ps = (i) => (e) => {
2071
2070
  const t = Z(e);
2072
2071
  return $e(e, {
2073
2072
  ...t,
2074
2073
  blueName: i
2075
2074
  });
2076
- }, Vs = (i) => {
2075
+ }, ws = (i) => {
2077
2076
  const e = Z(i);
2078
- return p(e) && St(e.blueName) ? e.blueName : null;
2079
- }, Ln = (i) => {
2080
- const e = y.string().optional();
2081
- return As(i)(e);
2082
- }, Os = () => (i) => {
2077
+ return d(e) && vt(e.blueName) ? e.blueName : null;
2078
+ }, vn = (i) => {
2079
+ const e = f.string().optional();
2080
+ return Ps(i)(e);
2081
+ }, Ss = () => (i) => {
2083
2082
  const e = Z(i);
2084
2083
  return $e(i, {
2085
2084
  ...e,
2086
2085
  blueNode: !0
2087
2086
  });
2088
- }, Ms = (i) => {
2087
+ }, bs = (i) => {
2089
2088
  const e = Z(i);
2090
- return p(e) && p(e.blueNode) && e.blueNode === !0 ? e.blueNode : null;
2091
- }, Tr = (i) => !!Ms(i), $n = () => {
2092
- const i = y.instanceof(u);
2093
- return Os()(i);
2094
- }, Ds = y.object({
2095
- value: y.array(y.string()).optional(),
2096
- defaultValue: y.string().optional()
2097
- }), xs = (i) => {
2098
- const e = Z(i), t = Ds.passthrough().safeParse(e?.typeBlueId);
2089
+ return d(e) && d(e.blueNode) && e.blueNode === !0 ? e.blueNode : null;
2090
+ }, yr = (i) => !!bs(i), Tn = () => {
2091
+ const i = f.instanceof(u);
2092
+ return Ss()(i);
2093
+ }, Es = f.object({
2094
+ value: f.array(f.string()).optional(),
2095
+ defaultValue: f.string().optional()
2096
+ }), Ns = (i) => {
2097
+ const e = Z(i), t = Es.passthrough().safeParse(e?.typeBlueId);
2099
2098
  return t.success ? t.data : null;
2100
- }, Ls = (i) => (e) => {
2099
+ }, Bn = (i) => (e) => {
2101
2100
  const t = Z(e), r = typeof i == "string" ? { value: [i] } : i;
2102
2101
  return $e(e, {
2103
2102
  ...t,
@@ -2109,31 +2108,31 @@ const Z = (i) => vr().get(i), bs = (i) => (e) => {
2109
2108
  };
2110
2109
  class Oe {
2111
2110
  static resolveBlueId(e) {
2112
- const t = xs(e);
2113
- if (v(t))
2111
+ const t = Ns(e);
2112
+ if (I(t))
2114
2113
  return null;
2115
2114
  const r = t.defaultValue;
2116
- if (p(r))
2115
+ if (d(r))
2117
2116
  return r;
2118
2117
  const s = t.value?.[0];
2119
- return p(s) ? s : Oe.getRepositoryBlueId(t, e);
2118
+ return d(s) ? s : Oe.getRepositoryBlueId(t, e);
2120
2119
  }
2121
2120
  static getRepositoryBlueId(e, t) {
2122
2121
  throw new Error("Not implemented");
2123
2122
  }
2124
2123
  }
2125
- class k {
2124
+ class H {
2126
2125
  // TODO: Enhance to support schemas associated with multiple blueIds
2127
2126
  static isTypeOf(e, t, r) {
2128
2127
  const s = Oe.resolveBlueId(t), n = e.getType()?.getBlueId();
2129
- if (v(s) || v(n))
2128
+ if (I(s) || I(n))
2130
2129
  return !1;
2131
2130
  const o = r?.blueIdMapper?.toCurrentBlueId(s) ?? s, l = r?.blueIdMapper?.toCurrentBlueId(n) ?? n;
2132
2131
  if (o === l)
2133
2132
  return !0;
2134
- if (r?.checkSchemaExtensions && p(r.typeSchemaResolver)) {
2133
+ if (r?.checkSchemaExtensions && d(r.typeSchemaResolver)) {
2135
2134
  const a = r.typeSchemaResolver.resolveSchema(e);
2136
- return k.checkSchemaExtension(a, t, {
2135
+ return H.checkSchemaExtension(a, t, {
2137
2136
  typeSchemaResolver: r.typeSchemaResolver
2138
2137
  });
2139
2138
  }
@@ -2143,35 +2142,35 @@ class k {
2143
2142
  * Checks if a schema extends a base schema.
2144
2143
  */
2145
2144
  static checkSchemaExtension(e, t, r) {
2146
- if (!p(e))
2145
+ if (!d(e))
2147
2146
  return !1;
2148
- const s = k.unwrapSchema(e), n = k.unwrapSchema(t);
2149
- return p(r?.typeSchemaResolver) ? r.typeSchemaResolver.isSchemaExtendedFrom(
2147
+ const s = H.unwrapSchema(e), n = H.unwrapSchema(t);
2148
+ return d(r?.typeSchemaResolver) ? r.typeSchemaResolver.isSchemaExtendedFrom(
2150
2149
  s,
2151
2150
  n
2152
2151
  ) : !1;
2153
2152
  }
2154
2153
  static isWrapperType(e) {
2155
- return e instanceof Xt || e instanceof qt || e instanceof Qt || e instanceof er || e instanceof Ge || e instanceof Je;
2154
+ return e instanceof Yt || e instanceof Wt || e instanceof Gt || e instanceof Jt || e instanceof Ye || e instanceof We;
2156
2155
  }
2157
2156
  static unwrapSchema(e) {
2158
- return Tr(e) ? e : k.isWrapperType(e) ? e instanceof Ge ? k.unwrapSchema(e.innerType()) : e instanceof Je ? k.unwrapSchema(e.schema) : k.unwrapSchema(e.unwrap()) : e;
2157
+ return yr(e) ? e : H.isWrapperType(e) ? e instanceof Ye ? H.unwrapSchema(e.innerType()) : e instanceof We ? H.unwrapSchema(e.schema) : H.unwrapSchema(e.unwrap()) : e;
2159
2158
  }
2160
2159
  }
2161
- const Br = Symbol("blue.subtypeCache");
2162
- function $s(i, e) {
2163
- return i[Br] = e, i;
2160
+ const gr = Symbol("blue.subtypeCache");
2161
+ function Cs(i, e) {
2162
+ return i[gr] = e, i;
2164
2163
  }
2165
- function zt(i, e) {
2164
+ function _t(i, e) {
2166
2165
  const t = i.getType();
2167
2166
  if (t === void 0)
2168
2167
  return;
2169
2168
  const r = t.getBlueId();
2170
2169
  if (r !== void 0) {
2171
- if (fe.includes(
2170
+ if (pe.includes(
2172
2171
  r
2173
2172
  )) {
2174
- const n = st[r];
2173
+ const n = et[r];
2175
2174
  return new u().setBlueId(r).setName(n);
2176
2175
  }
2177
2176
  const s = e.fetchByBlueId(r);
@@ -2186,10 +2185,10 @@ function zt(i, e) {
2186
2185
  return t;
2187
2186
  }
2188
2187
  function E(i, e, t) {
2189
- const r = qe(i), s = qe(e), n = t[Br], o = `${r}|${s}`, l = n?.get(o);
2188
+ const r = Ze(i), s = Ze(e), n = t[gr], o = `${r}|${s}`, l = n?.get(o);
2190
2189
  if (l !== void 0)
2191
2190
  return l;
2192
- const a = _s(
2191
+ const a = Rs(
2193
2192
  i,
2194
2193
  e,
2195
2194
  t,
@@ -2198,14 +2197,14 @@ function E(i, e, t) {
2198
2197
  );
2199
2198
  return n?.set(o, a), a;
2200
2199
  }
2201
- function qe(i) {
2200
+ function Ze(i) {
2202
2201
  const e = i.getReferenceBlueId();
2203
2202
  return e !== void 0 ? e : M.calculateBlueIdSync(
2204
2203
  se(i)
2205
2204
  );
2206
2205
  }
2207
2206
  function se(i) {
2208
- if (!Pr(i))
2207
+ if (!mr(i))
2209
2208
  return i;
2210
2209
  const e = i.cloneShallow();
2211
2210
  e.getReferenceBlueId() !== void 0 && !b.hasBlueIdOnly(e) && e.setReferenceBlueId(void 0);
@@ -2226,14 +2225,14 @@ function se(i) {
2226
2225
  const a = e.getProperties();
2227
2226
  return a !== void 0 && e.setProperties(
2228
2227
  Object.fromEntries(
2229
- Object.entries(a).map(([c, d]) => [
2228
+ Object.entries(a).map(([c, h]) => [
2230
2229
  c,
2231
- se(d)
2230
+ se(h)
2232
2231
  ])
2233
2232
  )
2234
2233
  ), e;
2235
2234
  }
2236
- function Pr(i) {
2235
+ function mr(i) {
2237
2236
  return i.getReferenceBlueId() !== void 0 && !b.hasBlueIdOnly(i) ? !0 : [
2238
2237
  i.getType(),
2239
2238
  i.getItemType(),
@@ -2243,20 +2242,20 @@ function Pr(i) {
2243
2242
  ...i.getItems() ?? [],
2244
2243
  ...Object.values(i.getProperties() ?? {})
2245
2244
  ].some(
2246
- (t) => t !== void 0 && Pr(t)
2245
+ (t) => t !== void 0 && mr(t)
2247
2246
  );
2248
2247
  }
2249
- function _s(i, e, t, r, s) {
2248
+ function Rs(i, e, t, r, s) {
2250
2249
  if (r === s)
2251
2250
  return !0;
2252
- if (r && fe.includes(
2251
+ if (r && pe.includes(
2253
2252
  r
2254
2253
  )) {
2255
2254
  let a = e;
2256
2255
  for (; a !== void 0; ) {
2257
- if (qe(a) === r)
2256
+ if (Ze(a) === r)
2258
2257
  return !0;
2259
- a = zt(a, t);
2258
+ a = _t(a, t);
2260
2259
  }
2261
2260
  return !1;
2262
2261
  }
@@ -2268,50 +2267,50 @@ function _s(i, e, t, r, s) {
2268
2267
  }
2269
2268
  let l = n;
2270
2269
  for (; l !== void 0; ) {
2271
- if (qe(l) === s)
2270
+ if (Ze(l) === s)
2272
2271
  return !0;
2273
- l = zt(l, t);
2272
+ l = _t(l, t);
2274
2273
  }
2275
2274
  return !1;
2276
2275
  }
2277
- function js(i, e) {
2278
- return At.some((t) => {
2276
+ function As(i, e) {
2277
+ return bt.some((t) => {
2279
2278
  const r = new u().setBlueId(t);
2280
2279
  return E(i, r, e);
2281
2280
  });
2282
2281
  }
2283
- function Fs(i, e) {
2282
+ function Vs(i, e) {
2284
2283
  const t = new u().setBlueId(Q);
2285
2284
  return E(i, t, e);
2286
2285
  }
2287
- function Us(i, e) {
2286
+ function Os(i, e) {
2288
2287
  const t = new u().setBlueId(te);
2289
2288
  return E(i, t, e);
2290
2289
  }
2291
- function zs(i, e) {
2290
+ function Ms(i, e) {
2292
2291
  const t = new u().setBlueId(ee);
2293
2292
  return E(i, t, e);
2294
2293
  }
2295
- function Ks(i, e) {
2294
+ function Ds(i, e) {
2296
2295
  const t = new u().setBlueId(re);
2297
2296
  return E(i, t, e);
2298
2297
  }
2299
- function ke(i, e) {
2300
- const t = new u().setBlueId(rt);
2298
+ function ze(i, e) {
2299
+ const t = new u().setBlueId(Qe);
2301
2300
  return E(i, t, e);
2302
2301
  }
2303
- function He(i, e) {
2304
- const t = new u().setBlueId(Rt);
2302
+ function Ke(i, e) {
2303
+ const t = new u().setBlueId(St);
2305
2304
  return E(i, t, e);
2306
2305
  }
2307
- function ks(i, e) {
2308
- return tt.some((t) => {
2306
+ function Ls(i, e) {
2307
+ return qe.some((t) => {
2309
2308
  const r = new u().setName(t);
2310
2309
  return E(i, r, e);
2311
2310
  });
2312
2311
  }
2313
- function Hs(i, e) {
2314
- for (const t of tt) {
2312
+ function $s(i, e) {
2313
+ for (const t of qe) {
2315
2314
  const r = new u().setName(t);
2316
2315
  if (E(i, r, e))
2317
2316
  return t;
@@ -2320,7 +2319,7 @@ function Hs(i, e) {
2320
2319
  `Cannot determine the basic type for node of type "${i.getName() || "unknown"}".`
2321
2320
  );
2322
2321
  }
2323
- class Ys {
2322
+ class _s {
2324
2323
  blueIdMap = /* @__PURE__ */ new Map();
2325
2324
  nodeProvider;
2326
2325
  constructor(e = [], t) {
@@ -2332,7 +2331,7 @@ class Ys {
2332
2331
  }
2333
2332
  registerSchema(e) {
2334
2333
  const t = Oe.resolveBlueId(e);
2335
- if (p(t)) {
2334
+ if (d(t)) {
2336
2335
  if (this.blueIdMap.has(t))
2337
2336
  throw new Error(`Duplicate BlueId value: ${t}`);
2338
2337
  this.blueIdMap.set(t, e);
@@ -2343,17 +2342,17 @@ class Ys {
2343
2342
  }
2344
2343
  resolveSchema(e) {
2345
2344
  const t = this.getEffectiveBlueId(e);
2346
- return v(t) ? null : this.blueIdMap.get(t);
2345
+ return I(t) ? null : this.blueIdMap.get(t);
2347
2346
  }
2348
2347
  isSchemaExtendedFrom(e, t) {
2349
- if (v(e))
2348
+ if (I(e))
2350
2349
  return !1;
2351
2350
  const r = this.getBlueIdForSchema(e), s = this.getBlueIdForSchema(t);
2352
- if (v(r) || v(s))
2351
+ if (I(r) || I(s))
2353
2352
  return !1;
2354
2353
  if (r === s)
2355
2354
  return !0;
2356
- if (p(this.nodeProvider))
2355
+ if (d(this.nodeProvider))
2357
2356
  try {
2358
2357
  const n = new u().setBlueId(r), o = new u().setBlueId(s);
2359
2358
  if (E(n, o, this.nodeProvider))
@@ -2363,10 +2362,10 @@ class Ys {
2363
2362
  return !1;
2364
2363
  }
2365
2364
  getBlueIdForSchema(e) {
2366
- if (v(e))
2365
+ if (I(e))
2367
2366
  return null;
2368
2367
  const t = Oe.resolveBlueId(e);
2369
- if (p(t))
2368
+ if (d(t))
2370
2369
  return t;
2371
2370
  for (const [r, s] of this.blueIdMap)
2372
2371
  if (s === e || s._def === e._def)
@@ -2375,18 +2374,18 @@ class Ys {
2375
2374
  }
2376
2375
  getEffectiveBlueId(e) {
2377
2376
  const t = e.getType();
2378
- return p(t) && p(t.getBlueId()) ? t.getBlueId() : p(t) ? M.calculateBlueIdSync(t) : null;
2377
+ return d(t) && d(t.getBlueId()) ? t.getBlueId() : d(t) ? M.calculateBlueIdSync(t) : null;
2379
2378
  }
2380
2379
  getBlueIdMap() {
2381
2380
  return new Map(this.blueIdMap);
2382
2381
  }
2383
2382
  }
2384
- class Dt {
2383
+ class Rt {
2385
2384
  }
2386
- class Re {
2385
+ class Ce {
2387
2386
  static convert(e) {
2388
- const t = new Bt();
2389
- return Re.traverseNode(e, "", t), t.build();
2387
+ const t = new mt();
2388
+ return Ce.traverseNode(e, "", t), t.build();
2390
2389
  }
2391
2390
  static traverseNode(e, t, r) {
2392
2391
  if (!e)
@@ -2398,21 +2397,21 @@ class Re {
2398
2397
  }
2399
2398
  if (s)
2400
2399
  for (const [a, c] of Object.entries(s)) {
2401
- const d = `${t}/${a}`;
2402
- Re.traverseNode(c, d, r);
2400
+ const h = `${t}/${a}`;
2401
+ Ce.traverseNode(c, h, r);
2403
2402
  }
2404
2403
  if (n)
2405
2404
  for (let a = 0; a < n.length; a++) {
2406
2405
  const c = `${t}/${a}`;
2407
- Re.traverseNode(n[a], c, r);
2406
+ Ce.traverseNode(n[a], c, r);
2408
2407
  }
2409
2408
  }
2410
2409
  }
2411
- function Kt(i, e) {
2410
+ function xt(i, e) {
2412
2411
  const t = i.split(e), r = [...t].reverse().findIndex((n) => n !== ""), s = r === -1 ? 0 : t.length - r;
2413
2412
  return t.slice(0, s);
2414
2413
  }
2415
- class nt extends Dt {
2414
+ class rt extends Rt {
2416
2415
  allowedPaths;
2417
2416
  maxDepth;
2418
2417
  currentPath = [];
@@ -2463,7 +2462,7 @@ class nt extends Dt {
2463
2462
  * @returns True if the path matches the allowed path pattern, false otherwise
2464
2463
  */
2465
2464
  matchesAllowedPath(e, t) {
2466
- const r = Kt(e, "/"), s = Kt(t, "/");
2465
+ const r = xt(e, "/"), s = xt(t, "/");
2467
2466
  if (s.length > r.length)
2468
2467
  return !1;
2469
2468
  for (let n = 1; n < s.length; n++)
@@ -2505,7 +2504,7 @@ class nt extends Dt {
2505
2504
  * @returns The path limits
2506
2505
  */
2507
2506
  static withMaxDepth(e) {
2508
- const t = new Bt().setMaxDepth(e);
2507
+ const t = new mt().setMaxDepth(e);
2509
2508
  for (let r = 1; r <= e; r++) {
2510
2509
  const s = "/" + Array(r).fill("*").join("/");
2511
2510
  t.addPath(s);
@@ -2518,17 +2517,17 @@ class nt extends Dt {
2518
2517
  * @returns The path limits
2519
2518
  */
2520
2519
  static withSinglePath(e) {
2521
- return new Bt().addPath(e).build();
2520
+ return new mt().addPath(e).build();
2522
2521
  }
2523
2522
  /**
2524
2523
  * Creates path limits by analyzing the structure of a node.
2525
2524
  * Leaf paths (no properties and no items) are added as allowed paths.
2526
2525
  */
2527
2526
  static fromNode(e) {
2528
- return Re.convert(e);
2527
+ return Ce.convert(e);
2529
2528
  }
2530
2529
  }
2531
- class Bt {
2530
+ class mt {
2532
2531
  allowedPaths = /* @__PURE__ */ new Set();
2533
2532
  maxDepth = Number.MAX_SAFE_INTEGER;
2534
2533
  /**
@@ -2552,10 +2551,10 @@ class Bt {
2552
2551
  * @returns The built PathLimits
2553
2552
  */
2554
2553
  build() {
2555
- return new nt(this.allowedPaths, this.maxDepth);
2554
+ return new rt(this.allowedPaths, this.maxDepth);
2556
2555
  }
2557
2556
  }
2558
- class H extends Dt {
2557
+ class k extends Rt {
2559
2558
  /**
2560
2559
  * Determines if a path segment should be extended - always returns true
2561
2560
  * @returns Always true
@@ -2581,7 +2580,7 @@ class H extends Dt {
2581
2580
  exitPathSegment() {
2582
2581
  }
2583
2582
  }
2584
- class ot extends Dt {
2583
+ class st extends Rt {
2585
2584
  limits;
2586
2585
  /**
2587
2586
  * Creates a composite limits with the specified limit strategies
@@ -2638,10 +2637,10 @@ class ot extends Dt {
2638
2637
  * @returns A new CompositeLimits instance
2639
2638
  */
2640
2639
  static of(...e) {
2641
- return new ot(e);
2640
+ return new st(e);
2642
2641
  }
2643
2642
  }
2644
- const F = new H();
2643
+ const F = new k();
2645
2644
  class J extends u {
2646
2645
  completeness;
2647
2646
  sourceSemanticBlueId;
@@ -2675,7 +2674,7 @@ class J extends u {
2675
2674
  "Cannot minimize a path-limited resolved node without a source semantic BlueId."
2676
2675
  );
2677
2676
  }
2678
- return new It().minimizeResolved(this);
2677
+ return new ft().minimizeResolved(this);
2679
2678
  }
2680
2679
  /**
2681
2680
  * @deprecated Prefer `blue.calculateBlueIdSync(resolved)` so callers use the
@@ -2689,7 +2688,7 @@ class J extends u {
2689
2688
  "Cannot calculate minimal BlueId for a path-limited resolved node without a source semantic BlueId."
2690
2689
  );
2691
2690
  }
2692
- const t = new It().minimizeResolvedForHash(this);
2691
+ const t = new ft().minimizeResolvedForHash(this);
2693
2692
  return M.calculateBlueIdSync(t);
2694
2693
  }
2695
2694
  /**
@@ -2720,7 +2719,7 @@ class J extends u {
2720
2719
  }
2721
2720
  validateSourceSemanticBlueId(e) {
2722
2721
  if (e !== void 0) {
2723
- if (!Be.isPotentialBlueId(e))
2722
+ if (!ve.isPotentialBlueId(e))
2724
2723
  throw new Error("sourceSemanticBlueId must be a valid BlueId.");
2725
2724
  return e;
2726
2725
  }
@@ -2741,13 +2740,13 @@ class J extends u {
2741
2740
  t !== void 0 && this.setValue(t);
2742
2741
  }
2743
2742
  }
2744
- class Ws {
2743
+ class xs {
2745
2744
  blue;
2746
2745
  constructor(e) {
2747
2746
  this.blue = e;
2748
2747
  }
2749
2748
  matchesType(e, t, r = F) {
2750
- const s = nt.fromNode(t), n = ot.of(r, s);
2749
+ const s = rt.fromNode(t), n = st.of(r, s);
2751
2750
  let o, l;
2752
2751
  try {
2753
2752
  o = this.extendAndResolve(e, n), l = this.blue.resolve(t, n);
@@ -2788,9 +2787,9 @@ class Ws {
2788
2787
  if (n) {
2789
2788
  let a = e.getProperties();
2790
2789
  a || (a = {}, e.setProperties(a));
2791
- for (const [c, d] of Object.entries(n)) {
2792
- const h = a[c];
2793
- h === void 0 ? a[c] = d.clone() : this.restoreMissingStructure(h, d);
2790
+ for (const [c, h] of Object.entries(n)) {
2791
+ const p = a[c];
2792
+ p === void 0 ? a[c] = h.clone() : this.restoreMissingStructure(p, h);
2794
2793
  }
2795
2794
  }
2796
2795
  const o = t.getBlueId();
@@ -2843,33 +2842,33 @@ class Ws {
2843
2842
  const c = e.getBlueId();
2844
2843
  if (!l && a === void 0 && c !== void 0 && e.getType() === void 0 && t.getItems() === void 0 && this.hasMatcherShape(t) && !this.matchesCalculatedBlueId(t, c))
2845
2844
  return !1;
2846
- const d = t.getValue();
2847
- if (d !== void 0) {
2845
+ const h = t.getValue();
2846
+ if (h !== void 0) {
2848
2847
  const P = e.getValue();
2849
2848
  if (P === void 0)
2850
2849
  return !1;
2851
- if (C(P) && C(d)) {
2852
- if (!P.eq(d))
2850
+ if (C(P) && C(h)) {
2851
+ if (!P.eq(h))
2853
2852
  return !1;
2854
- } else if (P !== d)
2853
+ } else if (P !== h)
2855
2854
  return !1;
2856
2855
  }
2857
- const h = t.getItems(), f = r.getItems();
2858
- if (h !== void 0) {
2856
+ const p = t.getItems(), y = r.getItems();
2857
+ if (p !== void 0) {
2859
2858
  const P = e.getItems() ?? [];
2860
- for (let w = 0; w < h.length; w++)
2859
+ for (let w = 0; w < p.length; w++)
2861
2860
  if (w < P.length) {
2862
2861
  if (!this.recursiveValueComparison(
2863
2862
  P[w],
2864
- h[w],
2865
- f?.[w] ?? h[w],
2863
+ p[w],
2864
+ y?.[w] ?? p[w],
2866
2865
  s
2867
2866
  ))
2868
2867
  return !1;
2869
- } else if (this.hasValueInNestedStructure(h[w]))
2868
+ } else if (this.hasValueInNestedStructure(p[w]))
2870
2869
  return !1;
2871
2870
  }
2872
- const g = t.getItemType(), I = r.getItemType();
2871
+ const g = t.getItemType(), v = r.getItemType();
2873
2872
  if (g !== void 0) {
2874
2873
  const P = e.getItems() ?? [];
2875
2874
  for (const w of P)
@@ -2877,12 +2876,12 @@ class Ws {
2877
2876
  this.resolveUntypedNodeAgainstMatcherType(
2878
2877
  w,
2879
2878
  g,
2880
- I ?? g,
2879
+ v ?? g,
2881
2880
  s,
2882
2881
  "type-reference"
2883
2882
  ),
2884
2883
  g,
2885
- I ?? g,
2884
+ v ?? g,
2886
2885
  s,
2887
2886
  { bareBlueIdMatcherMode: "type-reference" }
2888
2887
  ))
@@ -2891,32 +2890,32 @@ class Ws {
2891
2890
  const D = t.getProperties(), R = r.getProperties();
2892
2891
  if (D !== void 0) {
2893
2892
  const P = e.getProperties() ?? {};
2894
- for (const [w, lt] of Object.entries(D))
2893
+ for (const [w, it] of Object.entries(D))
2895
2894
  if (w in P) {
2896
2895
  if (!this.recursiveValueComparison(
2897
2896
  P[w],
2898
- lt,
2899
- R?.[w] ?? lt,
2897
+ it,
2898
+ R?.[w] ?? it,
2900
2899
  s
2901
2900
  ))
2902
2901
  return !1;
2903
- } else if (this.hasValueInNestedStructure(lt))
2902
+ } else if (this.hasValueInNestedStructure(it))
2904
2903
  return !1;
2905
2904
  }
2906
- const x = t.getValueType(), je = r.getValueType();
2907
- if (x !== void 0) {
2905
+ const L = t.getValueType(), _e = r.getValueType();
2906
+ if (L !== void 0) {
2908
2907
  const P = Object.values(e.getProperties() ?? {});
2909
2908
  for (const w of P)
2910
2909
  if (!this.recursiveValueComparison(
2911
2910
  this.resolveUntypedNodeAgainstMatcherType(
2912
2911
  w,
2913
- x,
2914
- je ?? x,
2912
+ L,
2913
+ _e ?? L,
2915
2914
  s,
2916
2915
  "type-reference"
2917
2916
  ),
2918
- x,
2919
- je ?? x,
2917
+ L,
2918
+ _e ?? L,
2920
2919
  s,
2921
2920
  { bareBlueIdMatcherMode: "type-reference" }
2922
2921
  ))
@@ -2985,31 +2984,31 @@ class Ws {
2985
2984
  const l = e.getValueType();
2986
2985
  l !== void 0 && t.setValueType(this.toPlainBlueNode(l));
2987
2986
  const a = e.getItems();
2988
- a !== void 0 && t.setItems(a.map((h) => this.toPlainBlueNode(h)));
2987
+ a !== void 0 && t.setItems(a.map((p) => this.toPlainBlueNode(p)));
2989
2988
  const c = e.getProperties();
2990
2989
  c !== void 0 && t.setProperties(
2991
2990
  Object.fromEntries(
2992
- Object.entries(c).map(([h, f]) => [
2993
- h,
2994
- this.toPlainBlueNode(f)
2991
+ Object.entries(c).map(([p, y]) => [
2992
+ p,
2993
+ this.toPlainBlueNode(y)
2995
2994
  ])
2996
2995
  )
2997
2996
  );
2998
- const d = e.getBlue();
2999
- return d !== void 0 && t.setBlue(this.toPlainBlueNode(d)), t;
2997
+ const h = e.getBlue();
2998
+ return h !== void 0 && t.setBlue(this.toPlainBlueNode(h)), t;
3000
2999
  }
3001
3000
  /**
3002
3001
  * Determines whether a node without an explicit type already satisfies the
3003
3002
  * shape of the requested core list or dictionary type.
3004
3003
  */
3005
3004
  matchesImplicitStructure(e, t) {
3006
- return t === void 0 || e.getType() !== void 0 ? !1 : ke(t, this.blue.getNodeProvider()) ? this.isImplicitListStructure(e) : He(t, this.blue.getNodeProvider()) ? this.isImplicitDictionaryStructure(e) : !1;
3005
+ return t === void 0 || e.getType() !== void 0 ? !1 : ze(t, this.blue.getNodeProvider()) ? this.isImplicitListStructure(e) : Ke(t, this.blue.getNodeProvider()) ? this.isImplicitDictionaryStructure(e) : !1;
3007
3006
  }
3008
3007
  matchesImplicitCoreCollectionType(e, t) {
3009
- return e.getType() !== void 0 ? !1 : ke(t, this.blue.getNodeProvider()) ? this.isImplicitListStructure(e) : He(t, this.blue.getNodeProvider()) ? this.isImplicitDictionaryStructure(e) : !1;
3008
+ return e.getType() !== void 0 ? !1 : ze(t, this.blue.getNodeProvider()) ? this.isImplicitListStructure(e) : Ke(t, this.blue.getNodeProvider()) ? this.isImplicitDictionaryStructure(e) : !1;
3010
3009
  }
3011
3010
  isCoreCollectionType(e) {
3012
- return ke(e, this.blue.getNodeProvider()) || He(e, this.blue.getNodeProvider());
3011
+ return ze(e, this.blue.getNodeProvider()) || Ke(e, this.blue.getNodeProvider());
3013
3012
  }
3014
3013
  isImplicitListStructure(e) {
3015
3014
  return e.getItems() !== void 0 && e.getValue() === void 0;
@@ -3058,15 +3057,15 @@ class Ws {
3058
3057
  const a = e.getItems();
3059
3058
  a && e.setItems(
3060
3059
  a.map(
3061
- (d) => this.expandSchemaTypeReferences(d, r)
3060
+ (h) => this.expandSchemaTypeReferences(h, r)
3062
3061
  )
3063
3062
  );
3064
3063
  const c = e.getProperties();
3065
3064
  return c && e.setProperties(
3066
3065
  Object.fromEntries(
3067
- Object.entries(c).map(([d, h]) => [
3068
- d,
3069
- this.expandSchemaTypeReferences(h, r)
3066
+ Object.entries(c).map(([h, p]) => [
3067
+ h,
3068
+ this.expandSchemaTypeReferences(p, r)
3070
3069
  ])
3071
3070
  )
3072
3071
  ), e;
@@ -3242,7 +3241,7 @@ class O {
3242
3241
  ].filter((t) => t !== void 0);
3243
3242
  }
3244
3243
  }
3245
- class ye {
3244
+ class fe {
3246
3245
  /**
3247
3246
  * Fetches the first node associated with the given Blue ID
3248
3247
  * Default implementation that takes the first node from fetchByBlueId result
@@ -3255,14 +3254,14 @@ class ye {
3255
3254
  return t && t.length > 0 ? t[0] : null;
3256
3255
  }
3257
3256
  }
3258
- function xt(i) {
3259
- return new class extends ye {
3257
+ function At(i) {
3258
+ return new class extends fe {
3260
3259
  fetchByBlueId(e) {
3261
3260
  return i(e);
3262
3261
  }
3263
3262
  }();
3264
3263
  }
3265
- class Gs {
3264
+ class Fs {
3266
3265
  /**
3267
3266
  * Resolves a node without limits
3268
3267
  * Default implementation that uses NO_LIMITS
@@ -3274,7 +3273,7 @@ class Gs {
3274
3273
  return this.resolve(e, F);
3275
3274
  }
3276
3275
  }
3277
- class wr extends ye {
3276
+ class Ir extends fe {
3278
3277
  nodeProviders;
3279
3278
  constructor(e) {
3280
3279
  super(), this.nodeProviders = e;
@@ -3301,31 +3300,31 @@ class wr extends ye {
3301
3300
  return this.nodeProviders;
3302
3301
  }
3303
3302
  }
3304
- const ht = pe.types.float.options, Js = {
3305
- ...ht,
3303
+ const ct = he.types.float.options, js = {
3304
+ ...ct,
3306
3305
  construct: (i) => {
3307
3306
  const e = i.replace(/_/g, "").toLowerCase();
3308
- if (!Zt(e))
3309
- return new $(e);
3310
- if (ht.construct)
3311
- return ht.construct(i);
3307
+ if (!kt(e))
3308
+ return new _(e);
3309
+ if (ct.construct)
3310
+ return ct.construct(i);
3312
3311
  }
3313
- }, Zs = new pe.Type("tag:yaml.org,2002:float", Js), pt = pe.types.int.options, Xs = {
3314
- ...pt,
3312
+ }, Us = new he.Type("tag:yaml.org,2002:float", js), ut = he.types.int.options, zs = {
3313
+ ...ut,
3315
3314
  construct: (i) => {
3316
3315
  let e = i;
3317
- if (e.indexOf("_") !== -1 && (e = e.replace(/_/g, "")), !Zt(e))
3316
+ if (e.indexOf("_") !== -1 && (e = e.replace(/_/g, "")), !kt(e))
3318
3317
  return new A(e);
3319
- if (pt.construct)
3320
- return pt.construct(i);
3318
+ if (ut.construct)
3319
+ return ut.construct(i);
3321
3320
  }
3322
- }, qs = new pe.Type("tag:yaml.org,2002:int", Xs), Sr = pe.CORE_SCHEMA.extend({
3323
- implicit: [Zs, qs]
3321
+ }, Ks = new he.Type("tag:yaml.org,2002:int", zs), vr = he.CORE_SCHEMA.extend({
3322
+ implicit: [Us, Ks]
3324
3323
  }), ae = (i) => {
3325
- const e = pe.load(i, { schema: Sr });
3324
+ const e = he.load(i, { schema: vr });
3326
3325
  return e === void 0 ? void 0 : e;
3327
- }, Qs = (i) => pe.dump(i, {
3328
- schema: Sr,
3326
+ }, Hs = (i) => he.dump(i, {
3327
+ schema: vr,
3329
3328
  replacer: (e, t) => {
3330
3329
  if (C(t)) {
3331
3330
  if (oe(t)) {
@@ -3337,7 +3336,7 @@ const ht = pe.types.float.options, Js = {
3337
3336
  }
3338
3337
  return t;
3339
3338
  }
3340
- }), br = `- type:
3339
+ }), Tr = `- type:
3341
3340
  blueId: 27B7fuxQCS1VAptiCPc2RMkKoutP5qxkh3uDxZ7dr6Eo
3342
3341
  mappings:
3343
3342
  Text: DLRQwz7MQeCrzjy9bohPNwtCxKEBbKaMK65KBrwjfG6K
@@ -3348,20 +3347,20 @@ const ht = pe.types.float.options, Js = {
3348
3347
  Dictionary: G7fBT9PSod1RfHLHkpafAGBDVAJMrMhAMY51ERcyXNrj
3349
3348
  - type:
3350
3349
  blueId: FGYuTXwaoSKfZmpTysLTLsb8WzSqf43384rKZDkXhxD4
3351
- `, ei = `name: Transformation
3352
- description: TODO`, ti = `name: Infer Basic Types For Untyped Values
3350
+ `, ks = `name: Transformation
3351
+ description: TODO`, Ys = `name: Infer Basic Types For Untyped Values
3353
3352
  type:
3354
3353
  blueId: Ct1SGRGw1i47qjzm1ruiUdSZofeV6WevPTGuieVvbRS4
3355
- description: This transformation infers type details for Text, Integer, Number and Boolean.`, ri = `name: Replace Inline Types with BlueIds
3354
+ description: This transformation infers type details for Text, Integer, Number and Boolean.`, Ws = `name: Replace Inline Types with BlueIds
3356
3355
  type:
3357
3356
  blueId: Ct1SGRGw1i47qjzm1ruiUdSZofeV6WevPTGuieVvbRS4
3358
- description: This transformation replaces`, si = [
3359
- br,
3360
- ei,
3361
- ti,
3362
- ri
3357
+ description: This transformation replaces`, Gs = [
3358
+ Tr,
3359
+ ks,
3360
+ Ys,
3361
+ Ws
3363
3362
  ];
3364
- class ii extends ye {
3363
+ class Js extends fe {
3365
3364
  blueIdToNodesMap = /* @__PURE__ */ new Map();
3366
3365
  constructor() {
3367
3366
  super(), this.load();
@@ -3370,7 +3369,7 @@ class ii extends ye {
3370
3369
  return this.blueIdToNodesMap.get(e) || [];
3371
3370
  }
3372
3371
  load() {
3373
- for (const e of si) {
3372
+ for (const e of Gs) {
3374
3373
  const t = ae(e);
3375
3374
  if (t === void 0) {
3376
3375
  console.error(`This content file is not valid YAML: ${e}`);
@@ -3388,11 +3387,11 @@ class ii extends ye {
3388
3387
  }
3389
3388
  }
3390
3389
  }
3391
- class Lt extends ye {
3392
- static INSTANCE = new Lt();
3390
+ class Vt extends fe {
3391
+ static INSTANCE = new Vt();
3393
3392
  nodeProvider;
3394
3393
  constructor() {
3395
- super(), this.nodeProvider = new ii();
3394
+ super(), this.nodeProvider = new Js();
3396
3395
  }
3397
3396
  fetchByBlueId(e) {
3398
3397
  return this.nodeProvider.fetchByBlueId(e);
@@ -3405,11 +3404,11 @@ class Me {
3405
3404
  * @returns A wrapped NodeProvider that includes bootstrap providers
3406
3405
  */
3407
3406
  static wrap(e) {
3408
- const t = [Lt.INSTANCE];
3409
- return t.push(e), new wr(t);
3407
+ const t = [Vt.INSTANCE];
3408
+ return t.push(e), new Ir(t);
3410
3409
  }
3411
3410
  }
3412
- class $t {
3411
+ class Ot {
3413
3412
  nodeProvider;
3414
3413
  strategy;
3415
3414
  /**
@@ -3436,20 +3435,20 @@ class $t {
3436
3435
  }
3437
3436
  try {
3438
3437
  const n = e.getBlueId();
3439
- if (n && b.hasBlueIdOnly(e) && !fe.includes(
3438
+ if (n && b.hasBlueIdOnly(e) && !pe.includes(
3440
3439
  n
3441
3440
  )) {
3442
- const f = this.fetchNode(e);
3443
- if (f && f.length > 0) {
3441
+ const y = this.fetchNode(e);
3442
+ if (y && y.length > 0) {
3444
3443
  const g = this.shouldPreserveReferenceBlueId(
3445
3444
  r,
3446
3445
  s
3447
3446
  );
3448
- if (f.length === 1) {
3449
- const I = f[0];
3450
- this.mergeNodes(e, I, g);
3447
+ if (y.length === 1) {
3448
+ const v = y[0];
3449
+ this.mergeNodes(e, v, g);
3451
3450
  } else {
3452
- const I = f.map((R) => R.clone()), D = new u().setItems(I);
3451
+ const v = y.map((R) => R.clone()), D = new u().setItems(v);
3453
3452
  this.mergeNodes(e, D, g);
3454
3453
  }
3455
3454
  }
@@ -3462,14 +3461,14 @@ class $t {
3462
3461
  a && this.extendNode(a, t, "keyType", !0);
3463
3462
  const c = e.getValueType();
3464
3463
  c && this.extendNode(c, t, "valueType", !0);
3465
- const d = e.getProperties();
3466
- d && Object.entries(d).forEach(([f, g]) => {
3467
- this.extendNode(g, t, f, !1);
3464
+ const h = e.getProperties();
3465
+ h && Object.entries(h).forEach(([y, g]) => {
3466
+ this.extendNode(g, t, y, !1);
3468
3467
  });
3469
- const h = e.getItems();
3470
- if (h && h.length > 0)
3471
- for (let f = 0; f < h.length; f++)
3472
- this.extendNode(h[f], t, String(f), !1);
3468
+ const p = e.getItems();
3469
+ if (p && p.length > 0)
3470
+ for (let y = 0; y < p.length; y++)
3471
+ this.extendNode(p[y], t, String(y), !1);
3473
3472
  } finally {
3474
3473
  s || t.exitPathSegment();
3475
3474
  }
@@ -3495,7 +3494,7 @@ class $t {
3495
3494
  mergeNodes(e, t, r) {
3496
3495
  r || e.setReferenceBlueId(void 0), e.setName(t.getName()), e.setDescription(t.getDescription()), e.setType(t.getType()?.clone()), e.setItemType(t.getItemType()?.clone()), e.setKeyType(t.getKeyType()?.clone()), e.setValueType(t.getValueType()?.clone());
3497
3496
  const s = t.getValue();
3498
- p(s) && e.setValue(s), e.setItems(t.getItems()?.map((o) => o.clone()));
3497
+ d(s) && e.setValue(s), e.setItems(t.getItems()?.map((o) => o.clone()));
3499
3498
  const n = t.getProperties();
3500
3499
  e.setProperties(
3501
3500
  n === void 0 ? void 0 : Object.fromEntries(
@@ -3507,7 +3506,7 @@ class $t {
3507
3506
  ), e.setBlue(t.getBlue()?.clone());
3508
3507
  }
3509
3508
  }
3510
- class de extends Gs {
3509
+ class de extends Fs {
3511
3510
  mergingProcessor;
3512
3511
  nodeProvider;
3513
3512
  /**
@@ -3533,13 +3532,13 @@ class de extends Gs {
3533
3532
  );
3534
3533
  }
3535
3534
  mergeWithContext(e, t, r) {
3536
- if (p(t.getBlue()))
3535
+ if (d(t.getBlue()))
3537
3536
  throw new Error(
3538
3537
  'Document contains "blue" attribute. Preprocess document before merging.'
3539
3538
  );
3540
3539
  let s = e;
3541
3540
  const n = t.getType();
3542
- if (p(n)) {
3541
+ if (d(n)) {
3543
3542
  const o = this.resolveTypeNode(n, r), l = this.getTypeOverlay(n, o, r);
3544
3543
  s = this.mergeObject(s, l, r);
3545
3544
  const a = t.cloneShallow().setType(o.clone());
@@ -3562,9 +3561,9 @@ class de extends Gs {
3562
3561
  r.nodeProvider
3563
3562
  );
3564
3563
  const o = t.getItems();
3565
- p(o) && (n = this.mergeChildren(n, t, r));
3564
+ d(o) && (n = this.mergeChildren(n, t, r));
3566
3565
  const l = t.getProperties();
3567
- return p(l) && (n = this.mergeProperties(n, t, l, r)), p(t.getBlueId()) && (n = n.cloneShallow().setBlueId(t.getBlueId())), this.mergingProcessor.postProcess && (n = this.mergingProcessor.postProcess(
3566
+ return d(l) && (n = this.mergeProperties(n, t, l, r)), d(t.getBlueId()) && (n = n.cloneShallow().setBlueId(t.getBlueId())), this.mergingProcessor.postProcess && (n = this.mergingProcessor.postProcess(
3568
3567
  n,
3569
3568
  t,
3570
3569
  r.nodeProvider
@@ -3587,7 +3586,7 @@ class de extends Gs {
3587
3586
  }
3588
3587
  mergeChildrenWithoutListControls(e, t, r) {
3589
3588
  const s = e.getItems();
3590
- if (v(s)) {
3589
+ if (I(s)) {
3591
3590
  const o = [];
3592
3591
  for (let l = 0; l < t.length; l++) {
3593
3592
  const a = t[l];
@@ -3616,14 +3615,14 @@ class de extends Gs {
3616
3615
  this.enterPathSegment(r, String(o), t[o]);
3617
3616
  try {
3618
3617
  if (o >= n.length) {
3619
- const d = this.materializeForCurrentContext(
3618
+ const h = this.materializeForCurrentContext(
3620
3619
  t[o],
3621
3620
  r
3622
3621
  );
3623
- n.push(d);
3622
+ n.push(h);
3624
3623
  continue;
3625
3624
  }
3626
- const l = r.limits instanceof H ? t[o] : this.materializeForCurrentContext(t[o], r), a = this.calculateNodeBlueId(
3625
+ const l = r.limits instanceof k ? t[o] : this.materializeForCurrentContext(t[o], r), a = this.calculateNodeBlueId(
3627
3626
  l,
3628
3627
  r
3629
3628
  ), c = this.calculateNodeBlueId(
@@ -3643,49 +3642,49 @@ class de extends Gs {
3643
3642
  mergeChildrenWithListControls(e, t, r) {
3644
3643
  const s = t.getItems() ?? [], n = e.getItems() ?? [], o = B.getMergePolicy(t, e), l = [...n];
3645
3644
  let a = 0, c = !1;
3646
- const d = s[0];
3647
- if (d !== void 0 && B.hasPreviousProperty(d)) {
3648
- if (B.getPreviousBlueId(d) === void 0)
3645
+ const h = s[0];
3646
+ if (h !== void 0 && B.hasPreviousProperty(h)) {
3647
+ if (B.getPreviousBlueId(h) === void 0)
3649
3648
  throw new Error(
3650
3649
  "$previous list control must be exactly { $previous: { blueId: <id> } }."
3651
3650
  );
3652
3651
  c = !0, a = 1;
3653
3652
  }
3654
- const h = c && n.length === 0 && !(r.limits instanceof H), f = /* @__PURE__ */ new Set();
3653
+ const p = c && n.length === 0 && !(r.limits instanceof k), y = /* @__PURE__ */ new Set();
3655
3654
  for (; a < s.length; a++) {
3656
3655
  const g = s[a];
3657
3656
  if (B.hasPreviousProperty(g))
3658
3657
  throw new Error(
3659
3658
  "$previous list control is allowed only as the first item."
3660
3659
  );
3661
- const I = B.readPosition(g);
3662
- if (I !== void 0) {
3660
+ const v = B.readPosition(g);
3661
+ if (v !== void 0) {
3663
3662
  if (o === "append-only")
3664
3663
  throw new Error("$pos is not allowed in append-only lists.");
3665
- if (I >= n.length)
3664
+ if (v >= n.length)
3666
3665
  throw new Error(
3667
- `$pos ${I} is out of range for inherited list length ${n.length}.`
3666
+ `$pos ${v} is out of range for inherited list length ${n.length}.`
3668
3667
  );
3669
- if (f.has(I))
3670
- throw new Error(`Duplicate $pos list overlay for index ${I}.`);
3671
- f.add(I);
3668
+ if (y.has(v))
3669
+ throw new Error(`Duplicate $pos list overlay for index ${v}.`);
3670
+ y.add(v);
3672
3671
  const R = B.withoutPosition(g);
3673
3672
  if (!B.hasPayloadAfterRemovingPosition(g))
3674
3673
  throw new Error("$pos list control must include an item payload.");
3675
- if (!r.limits.shouldMergePathSegment(String(I), R))
3674
+ if (!r.limits.shouldMergePathSegment(String(v), R))
3676
3675
  continue;
3677
- this.enterPathSegment(r, String(I), R);
3676
+ this.enterPathSegment(r, String(v), R);
3678
3677
  try {
3679
- const x = l[I];
3680
- l[I] = x === void 0 || B.isReplacementPayload(R) ? this.materializeForCurrentContext(R, r) : this.mergeWithContext(x, R, r);
3678
+ const L = l[v];
3679
+ l[v] = L === void 0 || B.isReplacementPayload(R) ? this.materializeForCurrentContext(R, r) : this.mergeWithContext(L, R, r);
3681
3680
  } finally {
3682
3681
  this.exitPathSegment(r);
3683
3682
  }
3684
3683
  continue;
3685
3684
  }
3686
3685
  const D = l.length;
3687
- if (!(!h && !r.limits.shouldMergePathSegment(String(D), g))) {
3688
- if (h) {
3686
+ if (!(!p && !r.limits.shouldMergePathSegment(String(D), g))) {
3687
+ if (p) {
3689
3688
  l.push(
3690
3689
  this.materializeWithoutLimits(g, r)
3691
3690
  );
@@ -3726,28 +3725,28 @@ class de extends Gs {
3726
3725
  if (s.limits.shouldMergePathSegment(a, c)) {
3727
3726
  this.enterPathSegment(s, a, c);
3728
3727
  try {
3729
- const d = o[a], h = this.getPathLimitedListControlTarget(
3730
- d,
3728
+ const h = o[a], p = this.getPathLimitedListControlTarget(
3729
+ h,
3731
3730
  t,
3732
3731
  a,
3733
3732
  c,
3734
3733
  s
3735
- ), f = h ?? d, I = this.shouldMergePropertyWithoutPreResolve(
3736
- f,
3734
+ ), y = p ?? h, v = this.shouldMergePropertyWithoutPreResolve(
3735
+ y,
3737
3736
  c,
3738
3737
  s
3739
- ) ? this.mergeExistingProperty(f, c, s) : (() => {
3738
+ ) ? this.mergeExistingProperty(y, c, s) : (() => {
3740
3739
  const R = this.materializeForCurrentContext(
3741
3740
  c,
3742
3741
  s
3743
3742
  );
3744
- return f === void 0 ? R : this.mergeObject(
3745
- f,
3743
+ return y === void 0 ? R : this.mergeObject(
3744
+ y,
3746
3745
  R,
3747
3746
  s
3748
3747
  );
3749
- })(), D = h === void 0 ? I : this.projectListNodeToCurrentLimits(I, s);
3750
- D !== d && (l || (o = { ...n }, l = !0), o[a] = D);
3748
+ })(), D = p === void 0 ? v : this.projectListNodeToCurrentLimits(v, s);
3749
+ D !== h && (l || (o = { ...n }, l = !0), o[a] = D);
3751
3750
  } finally {
3752
3751
  this.exitPathSegment(s);
3753
3752
  }
@@ -3761,7 +3760,7 @@ class de extends Gs {
3761
3760
  * through mergeWithContext so source type overlays are resolved.
3762
3761
  */
3763
3762
  shouldMergePropertyWithoutPreResolve(e, t, r) {
3764
- return v(e) || r.limits instanceof H ? p(e) && B.hasListControlItems(t.getItems()) : p(t.getItems()) || p(e.getItems());
3763
+ return I(e) || r.limits instanceof k ? d(e) && B.hasListControlItems(t.getItems()) : d(t.getItems()) || d(e.getItems());
3765
3764
  }
3766
3765
  mergeExistingProperty(e, t, r) {
3767
3766
  if (e === void 0)
@@ -3780,11 +3779,11 @@ class de extends Gs {
3780
3779
  resolveWithContext(e, t) {
3781
3780
  const r = new u(), n = this.mergeWithContext(r, e, t).cloneShallow().setName(e.getName()).setDescription(e.getDescription()).setBlueId(e.getBlueId());
3782
3781
  return new J(n, {
3783
- completeness: t.limits instanceof H ? "full" : "path-limited"
3782
+ completeness: t.limits instanceof k ? "full" : "path-limited"
3784
3783
  });
3785
3784
  }
3786
3785
  createResolutionContext(e) {
3787
- const t = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Map(), s = $s(
3786
+ const t = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Map(), s = Cs(
3788
3787
  this.createResolutionNodeProvider(this.nodeProvider, t),
3789
3788
  r
3790
3789
  );
@@ -3803,9 +3802,9 @@ class de extends Gs {
3803
3802
  }
3804
3803
  resolveTypeNode(e, t) {
3805
3804
  const r = e.getBlueId();
3806
- if (p(r)) {
3805
+ if (d(r)) {
3807
3806
  const s = this.createResolvedTypeCacheKey(r, t), n = t.resolvedTypeCache.get(s);
3808
- if (p(n) && !t.resolvingTypeKeys.has(s))
3807
+ if (d(n) && !t.resolvingTypeKeys.has(s))
3809
3808
  return n;
3810
3809
  if (t.resolvingTypeBlueIds.has(r))
3811
3810
  return n ?? this.createCyclicTypeReference(r, t);
@@ -3827,22 +3826,22 @@ class de extends Gs {
3827
3826
  }
3828
3827
  createCyclicTypeReference(e, t) {
3829
3828
  return new J(new u().setReferenceBlueId(e), {
3830
- completeness: t.limits instanceof H ? "full" : "path-limited"
3829
+ completeness: t.limits instanceof k ? "full" : "path-limited"
3831
3830
  });
3832
3831
  }
3833
3832
  resolveAndExtendTypeNode(e, t) {
3834
3833
  const r = e.clone();
3835
- return p(r.getBlueId()) && new $t(t.nodeProvider).extend(
3834
+ return d(r.getBlueId()) && new Ot(t.nodeProvider).extend(
3836
3835
  r,
3837
- nt.withSinglePath("/")
3836
+ rt.withSinglePath("/")
3838
3837
  ), this.resolveWithContext(r, t);
3839
3838
  }
3840
3839
  getTypeOverlay(e, t, r) {
3841
3840
  const s = e.getBlueId();
3842
- if (v(s))
3841
+ if (I(s))
3843
3842
  return this.createTypeOverlay(t);
3844
3843
  const n = this.createResolvedTypeCacheKey(s, r), o = r.typeOverlayCache.get(n);
3845
- if (p(o))
3844
+ if (d(o))
3846
3845
  return o;
3847
3846
  const l = this.createTypeOverlay(t);
3848
3847
  return r.resolvingTypeBlueIds.has(s) || r.typeOverlayCache.set(n, l), l;
@@ -3851,23 +3850,23 @@ class de extends Gs {
3851
3850
  return e.cloneShallow().setType(void 0).setBlueId(void 0);
3852
3851
  }
3853
3852
  createResolvedTypeCacheKey(e, t) {
3854
- return t.limits instanceof H ? e : `${e}|${this.getCurrentPointer(t)}`;
3853
+ return t.limits instanceof k ? e : `${e}|${this.getCurrentPointer(t)}`;
3855
3854
  }
3856
3855
  materializeForCurrentContext(e, t) {
3857
3856
  return e.isResolved() && this.canReuseResolvedSubtree(t) ? e.clone() : this.resolveWithContext(e, t);
3858
3857
  }
3859
3858
  canReuseResolvedSubtree(e) {
3860
- return e.limits instanceof H;
3859
+ return e.limits instanceof k;
3861
3860
  }
3862
3861
  calculateNodeBlueId(e, t) {
3863
3862
  const r = t.nodeHashCache.get(e);
3864
- if (p(r))
3863
+ if (d(r))
3865
3864
  return r;
3866
- const s = U.calculateHashMinimalBlueId(e);
3865
+ const s = j.calculateHashMinimalBlueId(e);
3867
3866
  return t.nodeHashCache.set(e, s), s;
3868
3867
  }
3869
3868
  getPathLimitedListControlTarget(e, t, r, s, n) {
3870
- if (!(e === void 0 || n.limits instanceof H || !B.hasListControlItems(s.getItems())))
3869
+ if (!(e === void 0 || n.limits instanceof k || !B.hasListControlItems(s.getItems())))
3871
3870
  return this.resolveFullInheritedProperty(t, r, n);
3872
3871
  }
3873
3872
  resolveFullInheritedProperty(e, t, r) {
@@ -3875,7 +3874,7 @@ class de extends Gs {
3875
3874
  if (s === void 0)
3876
3875
  return;
3877
3876
  const n = s.getBlueId();
3878
- if (p(n)) {
3877
+ if (d(n)) {
3879
3878
  const a = r.nodeProvider.fetchByBlueId(n)?.[0];
3880
3879
  return a === void 0 ? void 0 : new de(this.mergingProcessor, r.nodeProvider).resolve(a, F).getProperties()?.[t]?.clone();
3881
3880
  }
@@ -3890,7 +3889,7 @@ class de extends Gs {
3890
3889
  );
3891
3890
  }
3892
3891
  createResolutionNodeProvider(e, t) {
3893
- return new class extends ye {
3892
+ return new class extends fe {
3894
3893
  fetchByBlueId(r) {
3895
3894
  if (t.has(r))
3896
3895
  return t.get(r) ?? null;
@@ -3909,7 +3908,7 @@ class de extends Gs {
3909
3908
  e.pathStack.pop(), e.limits.exitPathSegment();
3910
3909
  }
3911
3910
  }
3912
- class Er {
3911
+ class Br {
3913
3912
  mergingProcessors;
3914
3913
  /**
3915
3914
  * Creates a new SequentialMergingProcessor with the given processors
@@ -3934,14 +3933,14 @@ class Er {
3934
3933
  return this.mergingProcessors.reduce((s, n) => n.postProcess ? n.postProcess(s, t, r) : s, e);
3935
3934
  }
3936
3935
  }
3937
- class Nr {
3936
+ class Pr {
3938
3937
  process(e, t) {
3939
3938
  const r = t.getValue();
3940
- if (p(r)) {
3939
+ if (d(r)) {
3941
3940
  const s = e.getValue();
3942
- if (v(s))
3941
+ if (I(s))
3943
3942
  return e.cloneShallow().setValue(r);
3944
- if (!ni(r, s))
3943
+ if (!Zs(r, s))
3945
3944
  throw new Error(
3946
3945
  `Node values conflict. Source node value: ${r}, target node value: ${s}`
3947
3946
  );
@@ -3949,8 +3948,8 @@ class Nr {
3949
3948
  return e;
3950
3949
  }
3951
3950
  }
3952
- const ni = (i, e) => oe(i) && oe(e) || yt(i) && yt(e) ? i.eq(e) : i === e;
3953
- class Cr {
3951
+ const Zs = (i, e) => oe(i) && oe(e) || dt(i) && dt(e) ? i.eq(e) : i === e;
3952
+ class wr {
3954
3953
  process(e, t, r) {
3955
3954
  const s = e.getType(), n = t.getType();
3956
3955
  let o = e;
@@ -3976,10 +3975,10 @@ class Cr {
3976
3975
  return o;
3977
3976
  }
3978
3977
  }
3979
- class Rr {
3978
+ class Sr {
3980
3979
  process(e, t, r) {
3981
3980
  const s = t.getItemType(), n = t.getType();
3982
- if (s !== void 0 && n !== void 0 && !ke(n, r))
3981
+ if (s !== void 0 && n !== void 0 && !ze(n, r))
3983
3982
  throw new Error("Source node with itemType must have a List type");
3984
3983
  const o = e.getItemType();
3985
3984
  let l = e;
@@ -3991,12 +3990,12 @@ class Rr {
3991
3990
  o,
3992
3991
  r
3993
3992
  )) {
3994
- const h = T.get(s), f = T.get(o);
3993
+ const p = T.get(s), y = T.get(o);
3995
3994
  throw new Error(
3996
3995
  `The source item type '${JSON.stringify(
3997
- h
3996
+ p
3998
3997
  )}' is not a subtype of the target item type '${JSON.stringify(
3999
- f
3998
+ y
4000
3999
  )}'.`
4001
4000
  );
4002
4001
  }
@@ -4004,19 +4003,19 @@ class Rr {
4004
4003
  }
4005
4004
  const a = l.getItemType(), c = t.getItems();
4006
4005
  if (a !== void 0 && c !== void 0)
4007
- for (const d of c) {
4008
- const h = d.getType();
4009
- if (h !== void 0 && !E(
4010
- h,
4006
+ for (const h of c) {
4007
+ const p = h.getType();
4008
+ if (p !== void 0 && !E(
4009
+ p,
4011
4010
  a,
4012
4011
  r
4013
4012
  )) {
4014
- const f = T.get(h), g = T.get(
4013
+ const y = T.get(p), g = T.get(
4015
4014
  a
4016
4015
  );
4017
4016
  throw new Error(
4018
4017
  `Item of type '${JSON.stringify(
4019
- f
4018
+ y
4020
4019
  )}' is not a subtype of the list's item type '${JSON.stringify(
4021
4020
  g
4022
4021
  )}'.`
@@ -4026,18 +4025,18 @@ class Rr {
4026
4025
  return l;
4027
4026
  }
4028
4027
  }
4029
- class Ar {
4028
+ class br {
4030
4029
  process(e, t, r) {
4031
4030
  const s = t.getKeyType(), n = t.getValueType(), o = t.getType();
4032
- if ((s !== void 0 || n !== void 0) && o !== void 0 && !He(o, r))
4031
+ if ((s !== void 0 || n !== void 0) && o !== void 0 && !Ke(o, r))
4033
4032
  throw new Error(
4034
4033
  "Source node with keyType or valueType must have a Dictionary type"
4035
4034
  );
4036
4035
  let l = this.processKeyType(e, t, r);
4037
4036
  l = this.processValueType(l, t, r);
4038
- const a = l.getKeyType(), c = l.getValueType(), d = t.getProperties();
4039
- return (a !== void 0 || c !== void 0) && d !== void 0 && Object.entries(d).forEach(([h, f]) => {
4040
- a !== void 0 && this.validateKeyType(h, a, r), c !== void 0 && this.validateValueType(f, c, r);
4037
+ const a = l.getKeyType(), c = l.getValueType(), h = t.getProperties();
4038
+ return (a !== void 0 || c !== void 0) && h !== void 0 && Object.entries(h).forEach(([p, y]) => {
4039
+ a !== void 0 && this.validateKeyType(p, a, r), c !== void 0 && this.validateValueType(y, c, r);
4041
4040
  }), l;
4042
4041
  }
4043
4042
  processKeyType(e, t, r) {
@@ -4089,20 +4088,20 @@ class Ar {
4089
4088
  return e;
4090
4089
  }
4091
4090
  validateBasicKeyType(e, t) {
4092
- if (!js(e, t))
4091
+ if (!As(e, t))
4093
4092
  throw new Error("Dictionary key type must be a basic type");
4094
4093
  }
4095
4094
  validateKeyType(e, t, r) {
4096
- if (!Fs(t, r))
4097
- if (Us(t, r)) {
4095
+ if (!Vs(t, r))
4096
+ if (Os(t, r)) {
4098
4097
  const s = Number.parseInt(e, 10);
4099
4098
  if (Number.isNaN(s) || s.toString() !== e)
4100
4099
  throw new Error(`Key '${e}' is not a valid Integer.`);
4101
- } else if (zs(t, r)) {
4100
+ } else if (Ms(t, r)) {
4102
4101
  const s = Number.parseFloat(e);
4103
4102
  if (Number.isNaN(s))
4104
4103
  throw new Error(`Key '${e}' is not a valid Number.`);
4105
- } else if (Ks(t, r)) {
4104
+ } else if (Ds(t, r)) {
4106
4105
  if (e.toLowerCase() !== "true" && e.toLowerCase() !== "false")
4107
4106
  throw new Error(`Key '${e}' is not a valid Boolean.`);
4108
4107
  } else
@@ -4124,16 +4123,16 @@ class Ar {
4124
4123
  }
4125
4124
  }
4126
4125
  }
4127
- class Vr {
4126
+ class Er {
4128
4127
  process(e) {
4129
4128
  return e;
4130
4129
  }
4131
4130
  postProcess(e, t, r) {
4132
4131
  const s = e.getType();
4133
- if (s !== void 0 && ks(s, r)) {
4132
+ if (s !== void 0 && Ls(s, r)) {
4134
4133
  const n = e.getItems(), o = e.getProperties();
4135
4134
  if (n !== void 0 && n.length > 0 || o !== void 0 && Object.keys(o).length > 0) {
4136
- const l = Hs(
4135
+ const l = $s(
4137
4136
  s,
4138
4137
  r
4139
4138
  ), a = s.getName() || "unknown";
@@ -4145,7 +4144,7 @@ class Vr {
4145
4144
  return e;
4146
4145
  }
4147
4146
  }
4148
- class Or {
4147
+ class Nr {
4149
4148
  process(e, t) {
4150
4149
  let r = e;
4151
4150
  const s = t.getName();
@@ -4154,33 +4153,33 @@ class Or {
4154
4153
  return n !== void 0 && n !== r.getDescription() && (r = r.cloneShallow().setDescription(n)), r;
4155
4154
  }
4156
4155
  }
4157
- const _n = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
4156
+ const Pn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
4158
4157
  __proto__: null,
4159
- BasicTypesVerifier: Vr,
4160
- DictionaryProcessor: Ar,
4161
- ListProcessor: Rr,
4162
- MetadataPropagator: Or,
4163
- SequentialMergingProcessor: Er,
4164
- TypeAssigner: Cr,
4165
- ValuePropagator: Nr
4158
+ BasicTypesVerifier: Er,
4159
+ DictionaryProcessor: br,
4160
+ ListProcessor: Sr,
4161
+ MetadataPropagator: Nr,
4162
+ SequentialMergingProcessor: Br,
4163
+ TypeAssigner: wr,
4164
+ ValuePropagator: Pr
4166
4165
  }, Symbol.toStringTag, { value: "Module" }));
4167
- function _e() {
4168
- return new Er([
4166
+ function Mt() {
4167
+ return new Br([
4168
+ new Pr(),
4169
+ new wr(),
4170
+ new Sr(),
4171
+ new br(),
4169
4172
  new Nr(),
4170
- new Cr(),
4171
- new Rr(),
4172
- new Ar(),
4173
- new Or(),
4174
- new Vr()
4173
+ new Er()
4175
4174
  ]);
4176
4175
  }
4177
- class Ye {
4176
+ class He {
4178
4177
  nodeProvider;
4179
4178
  mergingProcessor;
4180
- minimizer = new It();
4179
+ minimizer = new ft();
4181
4180
  cyclicSetIdentity;
4182
4181
  constructor(e = {}) {
4183
- this.nodeProvider = e.nodeProvider ?? xt(() => []), this.mergingProcessor = e.mergingProcessor ?? _e(), this.cyclicSetIdentity = this.createCyclicSetIdentityService();
4182
+ this.nodeProvider = e.nodeProvider ?? At(() => []), this.mergingProcessor = e.mergingProcessor ?? Mt(), this.cyclicSetIdentity = this.createCyclicSetIdentityService();
4184
4183
  }
4185
4184
  /** @internal */
4186
4185
  createCyclicSetIdentityService() {
@@ -4278,7 +4277,7 @@ class Ye {
4278
4277
  }
4279
4278
  createCyclicReferenceNodeProvider() {
4280
4279
  const e = this.nodeProvider;
4281
- return new class extends ye {
4280
+ return new class extends fe {
4282
4281
  fetchByBlueId(t) {
4283
4282
  return t === O.ZERO_BLUE_ID || O.isIndexedThisReference(t) ? [new u().setReferenceBlueId(t)] : e.fetchByBlueId(t);
4284
4283
  }
@@ -4311,12 +4310,12 @@ class Ye {
4311
4310
  return this.minimizeAuthoring(t).getItems() ?? [];
4312
4311
  }
4313
4312
  }
4314
- class oi {
4313
+ class Xs {
4315
4314
  semanticIdentity;
4316
4315
  cyclicSetIdentity;
4317
4316
  constructor(e = {}) {
4318
- const t = e.nodeProvider ?? xt(() => []), r = e.mergingProcessor ?? _e();
4319
- this.semanticIdentity = new Ye({
4317
+ const t = e.nodeProvider ?? At(() => []), r = e.mergingProcessor ?? Mt();
4318
+ this.semanticIdentity = new He({
4320
4319
  nodeProvider: t,
4321
4320
  mergingProcessor: r
4322
4321
  }), this.cyclicSetIdentity = this.semanticIdentity.createCyclicSetIdentityService();
@@ -4382,12 +4381,12 @@ class oi {
4382
4381
  );
4383
4382
  }
4384
4383
  }
4385
- const li = (i) => i instanceof Xt || i instanceof qt || i instanceof Qt || i instanceof er || i instanceof Ge || i instanceof Je, ai = (i) => i instanceof ge || i instanceof me || i instanceof ze || i instanceof Ke;
4386
- class Mr {
4384
+ const qs = (i) => i instanceof Yt || i instanceof Wt || i instanceof Gt || i instanceof Jt || i instanceof Ye || i instanceof We, Qs = (i) => i instanceof ye || i instanceof ge || i instanceof je || i instanceof Ue;
4385
+ class Cr {
4387
4386
  static convertValue(e, t) {
4388
4387
  const r = e.getType()?.getBlueId(), s = e.getValue();
4389
- return v(s) ? ai(t) && b.isValidValueNode(e) ? this.getDefaultPrimitiveValue(t) : s : Q === r ? this.convertFromString(String(s), t) : ee === r || s instanceof $ ? this.convertFromBigDecimal(
4390
- new $(s?.toString()),
4388
+ return I(s) ? Qs(t) && b.isValidValueNode(e) ? this.getDefaultPrimitiveValue(t) : s : Q === r ? this.convertFromString(String(s), t) : ee === r || s instanceof _ ? this.convertFromBigDecimal(
4389
+ new _(s?.toString()),
4391
4390
  t
4392
4391
  ) : te === r || s instanceof A ? this.convertFromBigInteger(
4393
4392
  new A(s?.toString()),
@@ -4395,62 +4394,62 @@ class Mr {
4395
4394
  ) : re === r || typeof s == "boolean" ? this.convertFromBoolean(!!s, t) : this.convertFromString(String(s), t);
4396
4395
  }
4397
4396
  static convertFromString(e, t) {
4398
- if (!t || t instanceof ge || t instanceof Fr || t instanceof Ur)
4397
+ if (!t || t instanceof ye || t instanceof Or || t instanceof Mr)
4399
4398
  return e;
4400
- if (t instanceof me)
4399
+ if (t instanceof ge)
4401
4400
  return Number(e);
4402
- if (t instanceof ze)
4401
+ if (t instanceof je)
4403
4402
  return e.toLowerCase() === "true";
4404
- if (t instanceof Ke)
4403
+ if (t instanceof Ue)
4405
4404
  return BigInt(e);
4406
4405
  throw new Error(`Cannot convert String to ${t._def.typeName}`);
4407
4406
  }
4408
4407
  static convertFromBigDecimal(e, t) {
4409
- if (t instanceof me)
4410
- return e.toNumber();
4411
4408
  if (t instanceof ge)
4409
+ return e.toNumber();
4410
+ if (t instanceof ye)
4412
4411
  return e.toString();
4413
4412
  throw new Error(`Cannot convert Number to ${t._def.typeName}`);
4414
4413
  }
4415
4414
  static convertFromBigInteger(e, t) {
4416
- if (t instanceof me)
4415
+ if (t instanceof ge)
4417
4416
  return e.toNumber();
4418
- if (t instanceof Ke)
4417
+ if (t instanceof Ue)
4419
4418
  return BigInt(e.toString());
4420
- if (t instanceof ge)
4419
+ if (t instanceof ye)
4421
4420
  return e.toString();
4422
4421
  throw new Error(`Cannot convert Number to ${t._def.typeName}`);
4423
4422
  }
4424
4423
  static convertFromBoolean(e, t) {
4425
- if (!t || t instanceof ze)
4424
+ if (!t || t instanceof je)
4426
4425
  return e;
4427
- if (t instanceof ge)
4426
+ if (t instanceof ye)
4428
4427
  return e.toString();
4429
- if (t instanceof me)
4428
+ if (t instanceof ge)
4430
4429
  return Number(e);
4431
- if (t instanceof Ke)
4430
+ if (t instanceof Ue)
4432
4431
  return BigInt(e);
4433
4432
  throw new Error(`Cannot convert Boolean to ${t._def.typeName}`);
4434
4433
  }
4435
4434
  static getDefaultPrimitiveValue(e) {
4436
4435
  if (!e) return null;
4437
- if (e instanceof me)
4436
+ if (e instanceof ge)
4438
4437
  return 0;
4439
- if (e instanceof ze)
4438
+ if (e instanceof je)
4440
4439
  return !1;
4441
- if (e instanceof ge)
4440
+ if (e instanceof ye)
4442
4441
  return "";
4443
4442
  throw new Error(
4444
4443
  `Unsupported primitive type: ${e._def.typeName}`
4445
4444
  );
4446
4445
  }
4447
4446
  }
4448
- class ci {
4447
+ class ei {
4449
4448
  convert(e, t) {
4450
- return Mr.convertValue(e, t);
4449
+ return Cr.convertValue(e, t);
4451
4450
  }
4452
4451
  }
4453
- class ui {
4452
+ class ti {
4454
4453
  constructor(e, t) {
4455
4454
  this.nodeToObjectConverter = e, this.calculateBlueId = t;
4456
4455
  }
@@ -4458,28 +4457,28 @@ class ui {
4458
4457
  return this.convertFields(e, t);
4459
4458
  }
4460
4459
  convertFields(e, t) {
4461
- if (t instanceof zr) {
4460
+ if (t instanceof Dr) {
4462
4461
  const r = t._def.left, s = t._def.right, n = this.convert(e, r), o = this.convert(e, s);
4463
4462
  return { ...n, ...o };
4464
4463
  }
4465
- if (t instanceof Kr)
4464
+ if (t instanceof Lr)
4466
4465
  throw new Error("Union not supported");
4467
- if (t instanceof kr)
4466
+ if (t instanceof $r)
4468
4467
  return Object.keys(t.shape).reduce(
4469
4468
  (s, n) => {
4470
- const o = e.getProperties(), l = t.shape[n], a = Rs(l);
4471
- if (p(a)) {
4472
- const g = St(a) ? a : n, I = o?.[g], D = I ? this.calculateBlueId(I) : void 0;
4469
+ const o = e.getProperties(), l = t.shape[n], a = Bs(l);
4470
+ if (d(a)) {
4471
+ const g = vt(a) ? a : n, v = o?.[g], D = v ? this.calculateBlueId(v) : void 0;
4473
4472
  return s[n] = D, s;
4474
4473
  }
4475
- const c = Vs(l);
4476
- if (p(c)) {
4474
+ const c = ws(l);
4475
+ if (d(c)) {
4477
4476
  const g = o?.[c];
4478
4477
  return s[n] = g?.getName(), s;
4479
4478
  }
4480
- const d = Es(l);
4481
- if (p(d)) {
4482
- const g = o?.[d];
4479
+ const h = Is(l);
4480
+ if (d(h)) {
4481
+ const g = o?.[h];
4483
4482
  return s[n] = g?.getDescription(), s;
4484
4483
  }
4485
4484
  if (n === "name") {
@@ -4490,21 +4489,21 @@ class ui {
4490
4489
  const g = e.getDescription();
4491
4490
  return s[n] = g, s;
4492
4491
  }
4493
- const h = o?.[n];
4494
- if (v(h))
4492
+ const p = o?.[n];
4493
+ if (I(p))
4495
4494
  return s;
4496
- const f = this.nodeToObjectConverter.convert(
4497
- h,
4495
+ const y = this.nodeToObjectConverter.convert(
4496
+ p,
4498
4497
  l
4499
4498
  );
4500
- return s[n] = f, s;
4499
+ return s[n] = y, s;
4501
4500
  },
4502
4501
  {}
4503
4502
  );
4504
4503
  throw new Error("Unknown schema type, " + t._def.typeName);
4505
4504
  }
4506
4505
  }
4507
- class di {
4506
+ class ri {
4508
4507
  constructor(e) {
4509
4508
  this.nodeToObjectConverter = e;
4510
4509
  }
@@ -4518,7 +4517,7 @@ class di {
4518
4517
  );
4519
4518
  }
4520
4519
  }
4521
- class hi {
4520
+ class si {
4522
4521
  constructor(e) {
4523
4522
  this.nodeToObjectConverter = e;
4524
4523
  }
@@ -4532,35 +4531,35 @@ class hi {
4532
4531
  return new Set(n);
4533
4532
  }
4534
4533
  }
4535
- class pi {
4534
+ class ii {
4536
4535
  constructor(e) {
4537
4536
  this.nodeToObjectConverter = e;
4538
4537
  }
4539
4538
  convert(e, t) {
4540
4539
  const r = t.keySchema, s = t.valueSchema, n = /* @__PURE__ */ new Map(), o = e.getName();
4541
- p(o) && n.set(ie, o);
4540
+ d(o) && n.set(ie, o);
4542
4541
  const l = e.getDescription();
4543
- p(l) && n.set(ne, l);
4542
+ d(l) && n.set(ne, l);
4544
4543
  const a = e.getProperties();
4545
- return p(a) && Object.entries(a).forEach(([c, d]) => {
4546
- const h = new u().setValue(c);
4547
- h.setType(new u().setBlueId(Q));
4548
- const f = Mr.convertValue(h, r), g = this.nodeToObjectConverter.convert(d, s);
4549
- n.set(f, g);
4550
- }), t instanceof Hr ? Object.fromEntries(n) : n;
4544
+ return d(a) && Object.entries(a).forEach(([c, h]) => {
4545
+ const p = new u().setValue(c);
4546
+ p.setType(new u().setBlueId(Q));
4547
+ const y = Cr.convertValue(p, r), g = this.nodeToObjectConverter.convert(h, s);
4548
+ n.set(y, g);
4549
+ }), t instanceof _r ? Object.fromEntries(n) : n;
4551
4550
  }
4552
4551
  }
4553
- class fi {
4552
+ class ni {
4554
4553
  convert(e) {
4555
4554
  return T.get(e);
4556
4555
  }
4557
4556
  }
4558
- class yi {
4557
+ class oi {
4559
4558
  convert(e) {
4560
4559
  return T.get(e);
4561
4560
  }
4562
4561
  }
4563
- class gi {
4562
+ class li {
4564
4563
  constructor(e) {
4565
4564
  this.nodeToObjectConverter = e;
4566
4565
  }
@@ -4574,25 +4573,25 @@ class gi {
4574
4573
  );
4575
4574
  }
4576
4575
  }
4577
- const mi = y.union([
4578
- y.literal("ZodString"),
4579
- y.literal("ZodNumber"),
4580
- y.literal("ZodBoolean"),
4581
- y.literal("ZodBigInt"),
4582
- y.literal("ZodArray"),
4583
- y.literal("ZodSet"),
4584
- y.literal("ZodMap"),
4585
- y.literal("ZodRecord"),
4586
- y.literal("ZodObject"),
4587
- y.literal("ZodEnum"),
4588
- y.literal("ZodNativeEnum"),
4589
- y.literal("ZodUnknown"),
4590
- y.literal("ZodAny"),
4591
- y.literal("ZodTuple")
4576
+ const ai = f.union([
4577
+ f.literal("ZodString"),
4578
+ f.literal("ZodNumber"),
4579
+ f.literal("ZodBoolean"),
4580
+ f.literal("ZodBigInt"),
4581
+ f.literal("ZodArray"),
4582
+ f.literal("ZodSet"),
4583
+ f.literal("ZodMap"),
4584
+ f.literal("ZodRecord"),
4585
+ f.literal("ZodObject"),
4586
+ f.literal("ZodEnum"),
4587
+ f.literal("ZodNativeEnum"),
4588
+ f.literal("ZodUnknown"),
4589
+ f.literal("ZodAny"),
4590
+ f.literal("ZodTuple")
4592
4591
  ]);
4593
- class Ii {
4592
+ class ci {
4594
4593
  constructor(e, t) {
4595
- this.nodeToObjectConverter = e, this.registerConverters(), this.complexObjectConverter = new ui(
4594
+ this.nodeToObjectConverter = e, this.registerConverters(), this.complexObjectConverter = new ti(
4596
4595
  this.nodeToObjectConverter,
4597
4596
  t
4598
4597
  );
@@ -4600,60 +4599,60 @@ class Ii {
4600
4599
  converters = /* @__PURE__ */ new Map();
4601
4600
  complexObjectConverter;
4602
4601
  registerConverters() {
4603
- const e = new ci(), t = new di(this.nodeToObjectConverter), r = new gi(this.nodeToObjectConverter), s = new hi(this.nodeToObjectConverter), n = new pi(this.nodeToObjectConverter);
4604
- this.converters.set("ZodString", e), this.converters.set("ZodNumber", e), this.converters.set("ZodBoolean", e), this.converters.set("ZodBigInt", e), this.converters.set("ZodEnum", e), this.converters.set("ZodNativeEnum", e), this.converters.set("ZodUnknown", new fi()), this.converters.set("ZodAny", new yi()), this.converters.set("ZodArray", t), this.converters.set("ZodTuple", r), this.converters.set("ZodSet", s), this.converters.set("ZodMap", n), this.converters.set("ZodRecord", n), this.converters.set("ZodObject", this.complexObjectConverter);
4602
+ const e = new ei(), t = new ri(this.nodeToObjectConverter), r = new li(this.nodeToObjectConverter), s = new si(this.nodeToObjectConverter), n = new ii(this.nodeToObjectConverter);
4603
+ this.converters.set("ZodString", e), this.converters.set("ZodNumber", e), this.converters.set("ZodBoolean", e), this.converters.set("ZodBigInt", e), this.converters.set("ZodEnum", e), this.converters.set("ZodNativeEnum", e), this.converters.set("ZodUnknown", new ni()), this.converters.set("ZodAny", new oi()), this.converters.set("ZodArray", t), this.converters.set("ZodTuple", r), this.converters.set("ZodSet", s), this.converters.set("ZodMap", n), this.converters.set("ZodRecord", n), this.converters.set("ZodObject", this.complexObjectConverter);
4605
4604
  }
4606
4605
  getConverter(e) {
4607
4606
  const t = this.getSchemaTypeName(e);
4608
4607
  return this.converters.get(t) ?? this.complexObjectConverter;
4609
4608
  }
4610
4609
  getSchemaTypeName(e) {
4611
- if (li(e))
4612
- return e instanceof Ge ? this.getSchemaTypeName(e.innerType()) : e instanceof Je ? this.getSchemaTypeName(e.schema) : this.getSchemaTypeName(e.unwrap());
4610
+ if (qs(e))
4611
+ return e instanceof Ye ? this.getSchemaTypeName(e.innerType()) : e instanceof We ? this.getSchemaTypeName(e.schema) : this.getSchemaTypeName(e.unwrap());
4613
4612
  const t = e._def.typeName;
4614
4613
  try {
4615
- return mi.parse(t);
4614
+ return ai.parse(t);
4616
4615
  } catch {
4617
4616
  throw new Error(`Schema type name ${t} is not supported`);
4618
4617
  }
4619
4618
  }
4620
4619
  }
4621
- class vi {
4620
+ class ui {
4622
4621
  constructor(e, t) {
4623
4622
  if (this.typeSchemaResolver = e, !t?.calculateBlueId)
4624
4623
  throw new Error(
4625
4624
  "NodeToObjectConverter requires a semantic calculateBlueId option."
4626
4625
  );
4627
- this.calculateBlueId = t.calculateBlueId, this.converterFactory = new Ii(this, this.calculateBlueId);
4626
+ this.calculateBlueId = t.calculateBlueId, this.converterFactory = new ci(this, this.calculateBlueId);
4628
4627
  }
4629
4628
  converterFactory;
4630
4629
  calculateBlueId;
4631
4630
  convert(e, t) {
4632
- const r = this.typeSchemaResolver?.resolveSchema(e), s = k.unwrapSchema(t);
4633
- if (Tr(s))
4631
+ const r = this.typeSchemaResolver?.resolveSchema(e), s = H.unwrapSchema(t);
4632
+ if (yr(s))
4634
4633
  return e;
4635
4634
  let n = s;
4636
- return k.checkSchemaExtension(
4635
+ return H.checkSchemaExtension(
4637
4636
  r,
4638
4637
  s,
4639
4638
  { typeSchemaResolver: this.typeSchemaResolver }
4640
- ) && p(r) && (n = r), this.convertWithType(e, n);
4639
+ ) && d(r) && (n = r), this.convertWithType(e, n);
4641
4640
  }
4642
4641
  convertWithType(e, t) {
4643
4642
  return this.converterFactory.getConverter(t).convert(e, t);
4644
4643
  }
4645
4644
  }
4646
- class Ti {
4645
+ class di {
4647
4646
  static get(e, t = {}) {
4648
4647
  const { strategy: r = "official" } = t, s = T.get(e, r);
4649
- return Qs(s);
4648
+ return Hs(s);
4650
4649
  }
4651
4650
  }
4652
- const kt = async (i) => {
4653
- if (qr(i))
4651
+ const Ft = async (i) => {
4652
+ if (Hr(i))
4654
4653
  return i;
4655
4654
  try {
4656
- const e = Ze.parse(i), { Blue: t } = await Promise.resolve().then(() => tn), r = await new t().calculateBlueId(e);
4655
+ const e = Ge.parse(i), { Blue: t } = await Promise.resolve().then(() => Wi), r = await new t().calculateBlueId(e);
4657
4656
  return {
4658
4657
  ...i,
4659
4658
  blueId: r
@@ -4661,10 +4660,10 @@ const kt = async (i) => {
4661
4660
  } catch (e) {
4662
4661
  throw new Error(`Failed enriching object with Blue ID: ${e}`);
4663
4662
  }
4664
- }, jn = (i) => i?.items, Fn = (i) => i?.value, Un = (i) => v(i) ? {} : sr(
4663
+ }, wn = (i) => i?.items, Sn = (i) => i?.value, bn = (i) => I(i) ? {} : qt(
4665
4664
  i,
4666
- Nt
4667
- ), zn = (i) => es(i) ? i.type.name ?? null : ts(i) ? Yr(typeof i.value) : Qr(i) ? "List" : null, Bi = (i) => p(i) && Object.keys(sr(i, ["blueId"])).length > 0, Kn = (i) => {
4665
+ Pt
4666
+ ), En = (i) => Yr(i) ? i.type.name ?? null : Wr(i) ? xr(typeof i.value) : kr(i) ? "List" : null, hi = (i) => d(i) && Object.keys(qt(i, ["blueId"])).length > 0, Nn = (i) => {
4668
4667
  try {
4669
4668
  const e = m.deserialize(i), t = T.get(e);
4670
4669
  return Ve.parse(t);
@@ -4673,19 +4672,19 @@ const kt = async (i) => {
4673
4672
  `Failed transforming JSON-like value to BlueObject: ${e}`
4674
4673
  );
4675
4674
  }
4676
- }, Ht = async (i) => {
4675
+ }, jt = async (i) => {
4677
4676
  const {
4678
4677
  resolveFunction: e,
4679
4678
  signal: t = new AbortController().signal,
4680
4679
  omitItems: r
4681
4680
  } = i, s = i.count ?? i.items.length;
4682
- let n = await Wr(i.items, async (l) => await kt(l));
4681
+ let n = await Fr(i.items, async (l) => await Ft(l));
4683
4682
  const o = Math.max(n?.length - s, 0);
4684
4683
  for (let l = n.length - 1; l >= o; l--)
4685
- if (!Bi(n[l])) {
4684
+ if (!hi(n[l])) {
4686
4685
  const a = await e(n[l], { signal: t });
4687
4686
  if (Array.isArray(a))
4688
- return Ht({
4687
+ return jt({
4689
4688
  ...i,
4690
4689
  items: [
4691
4690
  ...n.slice(0, l),
@@ -4693,9 +4692,9 @@ const kt = async (i) => {
4693
4692
  ...n.slice(l + 1)
4694
4693
  ]
4695
4694
  });
4696
- const c = await kt(a);
4695
+ const c = await Ft(a);
4697
4696
  if (r?.includes(c.blueId))
4698
- return Ht({
4697
+ return jt({
4699
4698
  ...i,
4700
4699
  items: [...n.slice(0, l), ...n.slice(l + 1)]
4701
4700
  });
@@ -4707,7 +4706,7 @@ const kt = async (i) => {
4707
4706
  }
4708
4707
  return n;
4709
4708
  };
4710
- function We(i) {
4709
+ function ke(i) {
4711
4710
  try {
4712
4711
  const e = new URL(i);
4713
4712
  return e.protocol === "http:" || e.protocol === "https:";
@@ -4715,14 +4714,14 @@ function We(i) {
4715
4714
  return !1;
4716
4715
  }
4717
4716
  }
4718
- class Pi {
4717
+ class pi {
4719
4718
  /**
4720
4719
  * Process a document node to infer basic types for untyped values
4721
4720
  * @param document - The document to process
4722
4721
  * @returns The processed document
4723
4722
  */
4724
4723
  process(e) {
4725
- return L.transform(e, this.inferType.bind(this));
4724
+ return $.transform(e, this.inferType.bind(this));
4726
4725
  }
4727
4726
  /**
4728
4727
  * Infer a basic type for a node
@@ -4731,10 +4730,10 @@ class Pi {
4731
4730
  */
4732
4731
  inferType(e) {
4733
4732
  const t = e.getType(), r = e.getValue();
4734
- return v(t) && p(r) && (typeof r == "string" ? e.setType(new u().setBlueId(Q)) : typeof r == "bigint" || oe(r) ? e.setType(new u().setBlueId(te)) : yt(r) ? e.setType(new u().setBlueId(ee)) : typeof r == "boolean" && e.setType(new u().setBlueId(re))), e;
4733
+ return I(t) && d(r) && (typeof r == "string" ? e.setType(new u().setBlueId(Q)) : typeof r == "bigint" || oe(r) ? e.setType(new u().setBlueId(te)) : dt(r) ? e.setType(new u().setBlueId(ee)) : typeof r == "boolean" && e.setType(new u().setBlueId(re))), e;
4735
4734
  }
4736
4735
  }
4737
- class Qe {
4736
+ class Xe {
4738
4737
  static MAPPINGS = "mappings";
4739
4738
  mappings = /* @__PURE__ */ new Map();
4740
4739
  /**
@@ -4744,8 +4743,8 @@ class Qe {
4744
4743
  constructor(e) {
4745
4744
  if (e instanceof u) {
4746
4745
  const r = e.getProperties();
4747
- if (r && r[Qe.MAPPINGS]) {
4748
- const n = r[Qe.MAPPINGS].getProperties();
4746
+ if (r && r[Xe.MAPPINGS]) {
4747
+ const n = r[Xe.MAPPINGS].getProperties();
4749
4748
  n && Object.entries(n).forEach(([o, l]) => {
4750
4749
  const a = l.getValue();
4751
4750
  typeof a == "string" && this.mappings.set(o, a);
@@ -4760,7 +4759,7 @@ class Qe {
4760
4759
  * @returns The processed document
4761
4760
  */
4762
4761
  process(e) {
4763
- return L.transform(e, this.transformNode.bind(this));
4762
+ return $.transform(e, this.transformNode.bind(this));
4764
4763
  }
4765
4764
  transformNode(e) {
4766
4765
  const t = e.clone();
@@ -4779,7 +4778,7 @@ class Qe {
4779
4778
  }
4780
4779
  }
4781
4780
  }
4782
- class wi {
4781
+ class fi {
4783
4782
  /**
4784
4783
  * Process a document node to validate all inline types have been replaced
4785
4784
  * @param document - The document to process
@@ -4787,7 +4786,7 @@ class wi {
4787
4786
  * @throws Error if any inline type values remain without BlueId mappings
4788
4787
  */
4789
4788
  process(e) {
4790
- return L.transform(e, this.validateNode.bind(this)), e;
4789
+ return $.transform(e, this.validateNode.bind(this)), e;
4791
4790
  }
4792
4791
  validateNode(e) {
4793
4792
  return this.validateTypeField(e, e.getType(), "type"), this.validateTypeField(e, e.getItemType(), "itemType"), this.validateTypeField(e, e.getKeyType(), "keyType"), this.validateTypeField(e, e.getValueType(), "valueType"), e;
@@ -4801,7 +4800,7 @@ class wi {
4801
4800
  }
4802
4801
  }
4803
4802
  }
4804
- class Dr {
4803
+ class Rr {
4805
4804
  blueIdsCollections = [];
4806
4805
  /**
4807
4806
  * Initializes the generator with default BlueIds collections
@@ -4890,7 +4889,7 @@ class De {
4890
4889
  const { nodeProvider: t, processorProvider: r, blueIdsMappingGenerator: s } = e;
4891
4890
  if (!t)
4892
4891
  throw new Error("NodeProvider is required");
4893
- this.nodeProvider = Me.wrap(t), this.processorProvider = r || De.getStandardProvider(), this.blueIdsMappingGenerator = s || new Dr(), this.loadDefaultSimpleBlue();
4892
+ this.nodeProvider = Me.wrap(t), this.processorProvider = r || De.getStandardProvider(), this.blueIdsMappingGenerator = s || new Rr(), this.loadDefaultSimpleBlue();
4894
4893
  }
4895
4894
  /**
4896
4895
  * Preprocesses a document node
@@ -4917,9 +4916,9 @@ class De {
4917
4916
  preprocessWithOptions(e, t) {
4918
4917
  let r = e.clone(), s = r.getBlue();
4919
4918
  if (!s && t && (s = t.clone()), s) {
4920
- new $t(this.nodeProvider).extend(
4919
+ new Ot(this.nodeProvider).extend(
4921
4920
  s,
4922
- nt.withSinglePath("/*")
4921
+ rt.withSinglePath("/*")
4923
4922
  );
4924
4923
  const n = this.flattenTransformationItems(
4925
4924
  s.getItems()
@@ -4936,7 +4935,7 @@ class De {
4936
4935
  }
4937
4936
  r.setBlue(void 0);
4938
4937
  }
4939
- r = new wi().process(
4938
+ r = new fi().process(
4940
4939
  r
4941
4940
  );
4942
4941
  }
@@ -4955,11 +4954,11 @@ class De {
4955
4954
  getProcessor(e) {
4956
4955
  const t = "27B7fuxQCS1VAptiCPc2RMkKoutP5qxkh3uDxZ7dr6Eo", r = "FGYuTXwaoSKfZmpTysLTLsb8WzSqf43384rKZDkXhxD4", s = e.getType()?.getBlueId();
4957
4956
  if (t === s)
4958
- return new Qe(
4957
+ return new Xe(
4959
4958
  e
4960
4959
  );
4961
4960
  if (r === s)
4962
- return new Pi();
4961
+ return new pi();
4963
4962
  }
4964
4963
  };
4965
4964
  }
@@ -4982,7 +4981,7 @@ ${t}
4982
4981
  */
4983
4982
  loadDefaultSimpleBlue() {
4984
4983
  try {
4985
- const e = this.enrichDefaultBlue(br), t = ae(e);
4984
+ const e = this.enrichDefaultBlue(Tr), t = ae(e);
4986
4985
  if (t)
4987
4986
  this.defaultSimpleBlue = m.deserialize(t);
4988
4987
  else
@@ -4992,7 +4991,7 @@ ${t}
4992
4991
  }
4993
4992
  }
4994
4993
  }
4995
- class Si {
4994
+ class yi {
4996
4995
  preprocessingAliases = /* @__PURE__ */ new Map();
4997
4996
  urlContentFetcher;
4998
4997
  /**
@@ -5016,9 +5015,9 @@ class Si {
5016
5015
  const r = e.clone();
5017
5016
  if (this.preprocessingAliases.has(t))
5018
5017
  return this.handleAliasValue(r, t);
5019
- if (Be.isPotentialBlueId(t))
5018
+ if (ve.isPotentialBlueId(t))
5020
5019
  return this.handleBlueId(r, t);
5021
- throw We(t) ? new Error(
5020
+ throw ke(t) ? new Error(
5022
5021
  `URL '${t}' detected. Use the async version of this method to fetch the content.`
5023
5022
  ) : new Error(`Invalid blue value: ${t}`);
5024
5023
  }
@@ -5036,9 +5035,9 @@ class Si {
5036
5035
  const r = e.clone();
5037
5036
  if (this.preprocessingAliases.has(t))
5038
5037
  return this.handleAliasValue(r, t);
5039
- if (Be.isPotentialBlueId(t))
5038
+ if (ve.isPotentialBlueId(t))
5040
5039
  return this.handleBlueId(r, t);
5041
- if (We(t) && this.urlContentFetcher)
5040
+ if (ke(t) && this.urlContentFetcher)
5042
5041
  try {
5043
5042
  const s = await this.fetchFromUrl(t);
5044
5043
  return s && r.setBlue(new u().setItems(s)), r;
@@ -5048,7 +5047,7 @@ class Si {
5048
5047
  ${s.message}`
5049
5048
  ) : s;
5050
5049
  }
5051
- else throw We(t) ? new Error(
5050
+ else throw ke(t) ? new Error(
5052
5051
  `UrlContentFetcher not provided for URL: ${t}`
5053
5052
  ) : new Error(`Invalid blue value: ${t}`);
5054
5053
  }
@@ -5134,24 +5133,24 @@ ${s.message}`
5134
5133
  return this.urlContentFetcher;
5135
5134
  }
5136
5135
  }
5137
- const bi = {
5136
+ const gi = {
5138
5137
  fetchUrl: async (i) => {
5139
5138
  throw new Error(
5140
5139
  `You must provide a custom UrlFetchStrategy to fetch content from URL: ${i}`
5141
5140
  );
5142
5141
  }
5143
5142
  };
5144
- class Ei {
5143
+ class mi {
5145
5144
  // Cache to avoid repeated network requests for the same URL
5146
5145
  cache = /* @__PURE__ */ new Map();
5147
5146
  fetchStrategy;
5148
5147
  enabled = !1;
5149
5148
  allowedDomains = [];
5150
5149
  constructor(e) {
5151
- this.fetchStrategy = e || bi;
5150
+ this.fetchStrategy = e || gi;
5152
5151
  }
5153
5152
  validateUrl(e) {
5154
- if (!We(e))
5153
+ if (!ke(e))
5155
5154
  throw new Error(`Invalid URL: ${e}`);
5156
5155
  return !0;
5157
5156
  }
@@ -5270,12 +5269,12 @@ class Ei {
5270
5269
  return this.allowedDomains = [], this;
5271
5270
  }
5272
5271
  }
5273
- class Fe {
5272
+ class xe {
5274
5273
  constructor(e, t, r, s = [], n = !1) {
5275
5274
  this.blueId = e, this.content = t, this.isMultipleDocuments = r, this.documentBlueIds = s, this.isCyclicSet = n;
5276
5275
  }
5277
5276
  }
5278
- class Te {
5277
+ class Re {
5279
5278
  static THIS_REFERENCE_PATTERN = /^this(#\d+)?$/;
5280
5279
  static parseAndCalculateBlueId(e, t, r) {
5281
5280
  let s;
@@ -5291,14 +5290,14 @@ class Te {
5291
5290
  const l = Array.isArray(s);
5292
5291
  if (l) {
5293
5292
  const a = s.map(
5294
- (d) => m.deserialize(d)
5293
+ (h) => m.deserialize(h)
5295
5294
  ), c = r.prepareStorageNodeList(
5296
5295
  a,
5297
5296
  t
5298
5297
  );
5299
5298
  return n = c.blueId, o = c.nodes.map(
5300
- (d) => T.get(d)
5301
- ), new Fe(
5299
+ (h) => T.get(h)
5300
+ ), new xe(
5302
5301
  n,
5303
5302
  o,
5304
5303
  !0,
@@ -5309,11 +5308,11 @@ class Te {
5309
5308
  const a = m.deserialize(s), c = r.prepareStorageNode(a, t);
5310
5309
  n = c.blueId, o = T.get(c.node);
5311
5310
  }
5312
- return new Fe(n, o, l);
5311
+ return new xe(n, o, l);
5313
5312
  }
5314
5313
  static parseAndCalculateBlueIdForNode(e, t, r) {
5315
5314
  const s = r.prepareStorageNode(e, t), n = T.get(s.node);
5316
- return new Fe(s.blueId, n, !1);
5315
+ return new xe(s.blueId, n, !1);
5317
5316
  }
5318
5317
  static parseAndCalculateBlueIdForNodeList(e, t, r) {
5319
5318
  if (!e || e.length === 0)
@@ -5324,7 +5323,7 @@ class Te {
5324
5323
  ), n = s.nodes.map(
5325
5324
  (l) => T.get(l)
5326
5325
  ), o = !0;
5327
- return new Fe(
5326
+ return new xe(
5328
5327
  s.blueId,
5329
5328
  n,
5330
5329
  o,
@@ -5377,12 +5376,12 @@ class Te {
5377
5376
  }
5378
5377
  }
5379
5378
  }
5380
- class Ni extends ye {
5379
+ class Ii extends fe {
5381
5380
  fetchByBlueId(e) {
5382
5381
  const t = e.split("#")[0], r = this.fetchContentByBlueId(t);
5383
5382
  if (r == null)
5384
5383
  return null;
5385
- const s = Array.isArray(r), n = Te.resolveThisReferences(
5384
+ const s = Array.isArray(r), n = Re.resolveThisReferences(
5386
5385
  r,
5387
5386
  t,
5388
5387
  s
@@ -5400,7 +5399,7 @@ class Ni extends ye {
5400
5399
  return Array.isArray(n) ? n.map((o) => m.deserialize(o)) : [m.deserialize(n)];
5401
5400
  }
5402
5401
  }
5403
- class xr extends Ni {
5402
+ class Ar extends Ii {
5404
5403
  nameToBlueIdsMap = /* @__PURE__ */ new Map();
5405
5404
  /**
5406
5405
  * Find a node by name. Throws an error if multiple nodes are found with the same name.
@@ -5444,23 +5443,23 @@ class xr extends Ni {
5444
5443
  ]);
5445
5444
  }
5446
5445
  }
5447
- function Ci(i) {
5448
- return Array.isArray(i) ? Ri(i) : i;
5446
+ function vi(i) {
5447
+ return Array.isArray(i) ? Ti(i) : i;
5449
5448
  }
5450
- function Ri(i) {
5449
+ function Ti(i) {
5451
5450
  const e = i.map((t) => m.deserialize(t));
5452
- return O.hasIndexedThisReference(e) ? Ai(e) : i;
5451
+ return O.hasIndexedThisReference(e) ? Bi(e) : i;
5453
5452
  }
5454
- function Ai(i) {
5453
+ function Bi(i) {
5455
5454
  return new O().calculate(i).nodes.map((t) => T.get(t));
5456
5455
  }
5457
- class _t extends xr {
5456
+ class Dt extends Ar {
5458
5457
  blueIdToContentMap = /* @__PURE__ */ new Map();
5459
5458
  blueIdToMultipleDocumentsMap = /* @__PURE__ */ new Map();
5460
5459
  aliasBlueIdMap = /* @__PURE__ */ new Map();
5461
5460
  constructor(e, t = {}) {
5462
5461
  super();
5463
- const r = _t.collectAliasMappings(e);
5462
+ const r = Dt.collectAliasMappings(e);
5464
5463
  this.aliasBlueIdMap = new Map(Object.entries(r)), this.loadRepositories(e);
5465
5464
  }
5466
5465
  static collectAliasMappings(e) {
@@ -5479,7 +5478,7 @@ class _t extends xr {
5479
5478
  for (const t of e)
5480
5479
  Object.values(t.packages).forEach((r) => {
5481
5480
  for (const [s, n] of Object.entries(r.contents)) {
5482
- const o = Ci(n);
5481
+ const o = vi(n);
5483
5482
  this.storeContent(
5484
5483
  s,
5485
5484
  o,
@@ -5504,7 +5503,7 @@ class _t extends xr {
5504
5503
  }
5505
5504
  fetchContentByBlueId(e) {
5506
5505
  const t = this.blueIdToContentMap.get(e), r = this.blueIdToMultipleDocumentsMap.get(e);
5507
- return t !== void 0 && r !== void 0 ? Te.resolveThisReferences(
5506
+ return t !== void 0 && r !== void 0 ? Re.resolveThisReferences(
5508
5507
  t,
5509
5508
  e,
5510
5509
  r
@@ -5553,12 +5552,12 @@ class _t extends xr {
5553
5552
  };
5554
5553
  }
5555
5554
  }
5556
- class Vi {
5555
+ class Pi {
5557
5556
  nodeProvider;
5558
5557
  blueIdToInlineValue = /* @__PURE__ */ new Map();
5559
5558
  constructor(e) {
5560
5559
  const { nodeProvider: t, blueIdsMappingGenerator: r } = e;
5561
- this.nodeProvider = t, Object.entries(st).forEach(([n, o]) => {
5560
+ this.nodeProvider = t, Object.entries(et).forEach(([n, o]) => {
5562
5561
  this.blueIdToInlineValue.set(n, o);
5563
5562
  });
5564
5563
  const s = r.getAllBlueIds();
@@ -5570,7 +5569,7 @@ class Vi {
5570
5569
  * Returns a new BlueNode where all type references are restored to inline values when possible.
5571
5570
  */
5572
5571
  restore(e) {
5573
- return L.transform(
5572
+ return $.transform(
5574
5573
  e,
5575
5574
  (t) => this.restoreNode(t)
5576
5575
  );
@@ -5619,17 +5618,17 @@ class Vi {
5619
5618
  return this.blueIdToInlineValue.set(e, o), o;
5620
5619
  }
5621
5620
  }
5622
- class Oi {
5621
+ class wi {
5623
5622
  runtimes;
5624
5623
  contents;
5625
5624
  aliases;
5626
5625
  constructor(e) {
5627
5626
  const t = [];
5628
5627
  for (const r of e)
5629
- t.push(Mi(r));
5628
+ t.push(Si(r));
5630
5629
  this.runtimes = t, this.contents = {}, this.aliases = {};
5631
5630
  for (const r of this.runtimes)
5632
- ki(this.contents, r.contents, r.name), Ki(this.aliases, r.aliases, r.name);
5631
+ Li(this.contents, r.contents, r.name), Di(this.aliases, r.aliases, r.name);
5633
5632
  }
5634
5633
  getRuntimes() {
5635
5634
  return this.runtimes;
@@ -5644,7 +5643,7 @@ class Oi {
5644
5643
  return this.runtimes.find((t) => t.name === e);
5645
5644
  }
5646
5645
  toCurrentBlueId(e) {
5647
- const t = this.aliases[e] ?? hr[e] ?? e;
5646
+ const t = this.aliases[e] ?? lr[e] ?? e;
5648
5647
  for (const r of this.runtimes) {
5649
5648
  const s = r.toCurrentBlueIdIndex[t];
5650
5649
  if (s)
@@ -5653,7 +5652,7 @@ class Oi {
5653
5652
  return t;
5654
5653
  }
5655
5654
  getTypeAlias(e) {
5656
- const t = this.toCurrentBlueId(e), r = st[t];
5655
+ const t = this.toCurrentBlueId(e), r = et[t];
5657
5656
  if (r)
5658
5657
  return r;
5659
5658
  for (const s of this.runtimes) {
@@ -5676,10 +5675,10 @@ class Oi {
5676
5675
  }
5677
5676
  }
5678
5677
  }
5679
- function Mi(i) {
5680
- const e = Di(i);
5678
+ function Si(i) {
5679
+ const e = bi(i);
5681
5680
  return Object.values(i.packages).forEach((t) => {
5682
- xi(e, i, t);
5681
+ Ei(e, i, t);
5683
5682
  }), {
5684
5683
  name: i.name,
5685
5684
  repositoryVersions: i.repositoryVersions,
@@ -5694,7 +5693,7 @@ function Mi(i) {
5694
5693
  typePackageByCurrentBlueId: e.typePackageByCurrentBlueId
5695
5694
  };
5696
5695
  }
5697
- function Di(i) {
5696
+ function bi(i) {
5698
5697
  const e = Object.fromEntries(
5699
5698
  i.repositoryVersions.map((r, s) => [r, s])
5700
5699
  ), t = i.repositoryVersions[i.repositoryVersions.length - 1];
@@ -5711,29 +5710,29 @@ function Di(i) {
5711
5710
  currentRepoBlueId: t
5712
5711
  };
5713
5712
  }
5714
- function xi(i, e, t) {
5713
+ function Ei(i, e, t) {
5715
5714
  if (i.packageNames.has(t.name))
5716
5715
  throw new Error(`Duplicate package name detected: ${t.name}`);
5717
- i.packageNames.add(t.name), Li(i, t), $i(i, e, t), _i(i, t), ji(i, t);
5716
+ i.packageNames.add(t.name), Ni(i, t), Ci(i, e, t), Ri(i, t), Ai(i, t);
5718
5717
  }
5719
- function Li(i, e) {
5718
+ function Ni(i, e) {
5720
5719
  Object.entries(e.aliases).forEach(([t, r]) => {
5721
5720
  if (i.aliases[t] && i.aliases[t] !== r)
5722
5721
  throw new Error(`Conflicting alias mapping for ${t}`);
5723
5722
  i.aliases[t] = r;
5724
5723
  });
5725
5724
  }
5726
- function $i(i, e, t) {
5725
+ function Ci(i, e, t) {
5727
5726
  Object.entries(t.typesMeta).forEach(([r, s]) => {
5728
5727
  if (i.types[r])
5729
5728
  throw new Error(`Duplicate type mapping for BlueId ${r}`);
5730
- const n = Fi(
5729
+ const n = Vi(
5731
5730
  s,
5732
5731
  e,
5733
5732
  r,
5734
5733
  t.name
5735
5734
  );
5736
- if (i.types[r] = n, i.typePackageByCurrentBlueId[r] = t.name, i.typeAliasByCurrentBlueId[r] = `${t.name}/${s.name}`, n.status === Ce && !i.toCurrentBlueIdIndex[r] && (i.toCurrentBlueIdIndex[r] = r), n.status === Ce)
5735
+ if (i.types[r] = n, i.typePackageByCurrentBlueId[r] = t.name, i.typeAliasByCurrentBlueId[r] = `${t.name}/${s.name}`, n.status === Ne && !i.toCurrentBlueIdIndex[r] && (i.toCurrentBlueIdIndex[r] = r), n.status === Ne)
5737
5736
  for (const o of n.versions) {
5738
5737
  const l = i.toCurrentBlueIdIndex[o.typeBlueId];
5739
5738
  if (l && l !== r)
@@ -5744,17 +5743,17 @@ function $i(i, e, t) {
5744
5743
  }
5745
5744
  });
5746
5745
  }
5747
- function _i(i, e) {
5746
+ function Ri(i, e) {
5748
5747
  Object.entries(e.contents).forEach(([t, r]) => {
5749
5748
  i.contents[t] = r;
5750
5749
  });
5751
5750
  }
5752
- function ji(i, e) {
5751
+ function Ai(i, e) {
5753
5752
  i.schemas.push(...Object.values(e.schemas));
5754
5753
  }
5755
- function Fi(i, e, t, r) {
5756
- if (i.status === Et)
5757
- return Ui(i, e, t, r), {
5754
+ function Vi(i, e, t, r) {
5755
+ if (i.status === Bt)
5756
+ return Oi(i, e, t, r), {
5758
5757
  ...i,
5759
5758
  versions: i.versions ? [...i.versions] : i.versions
5760
5759
  };
@@ -5777,7 +5776,7 @@ function Fi(i, e, t, r) {
5777
5776
  );
5778
5777
  n.add(o.repositoryVersionIndex);
5779
5778
  for (const l of o.attributesAdded ?? [])
5780
- zi(
5779
+ Mi(
5781
5780
  l,
5782
5781
  e.name,
5783
5782
  t,
@@ -5788,8 +5787,8 @@ function Fi(i, e, t, r) {
5788
5787
  versions: s
5789
5788
  };
5790
5789
  }
5791
- function Ui(i, e, t, r) {
5792
- if (i.status === Et) {
5790
+ function Oi(i, e, t, r) {
5791
+ if (i.status === Bt) {
5793
5792
  if (i.versions && i.versions.length > 1)
5794
5793
  throw new Error(
5795
5794
  `Dev type ${r}/${i.name} (${t}) must not declare multiple versions`
@@ -5803,9 +5802,9 @@ function Ui(i, e, t, r) {
5803
5802
  }
5804
5803
  }
5805
5804
  }
5806
- function zi(i, e, t, r) {
5805
+ function Mi(i, e, t, r) {
5807
5806
  try {
5808
- Gr(i);
5807
+ jr(i);
5809
5808
  } catch (s) {
5810
5809
  const n = s instanceof Error ? s.message : "Unknown error";
5811
5810
  throw new Error(
@@ -5813,7 +5812,7 @@ function zi(i, e, t, r) {
5813
5812
  );
5814
5813
  }
5815
5814
  }
5816
- function Ki(i, e, t) {
5815
+ function Di(i, e, t) {
5817
5816
  for (const [r, s] of Object.entries(e)) {
5818
5817
  const n = i[r];
5819
5818
  if (n && n !== s)
@@ -5823,11 +5822,11 @@ function Ki(i, e, t) {
5823
5822
  i[r] = s;
5824
5823
  }
5825
5824
  }
5826
- function ki(i, e, t) {
5825
+ function Li(i, e, t) {
5827
5826
  for (const [r, s] of Object.entries(e)) {
5828
5827
  if (r in i) {
5829
5828
  const n = i[r];
5830
- if (!Hi(n, s))
5829
+ if (!$i(n, s))
5831
5830
  throw new Error(
5832
5831
  `Conflicting content for BlueId '${r}' across repositories (from ${t})`
5833
5832
  );
@@ -5836,57 +5835,57 @@ function ki(i, e, t) {
5836
5835
  i[r] = s;
5837
5836
  }
5838
5837
  }
5839
- function Hi(i, e) {
5838
+ function $i(i, e) {
5840
5839
  if (i === e) return !0;
5841
5840
  if (i === null || e === null || typeof i != "object" || typeof e != "object") return !1;
5842
- const t = gt.canonicalize(i), r = gt.canonicalize(e);
5841
+ const t = ht.canonicalize(i), r = ht.canonicalize(e);
5843
5842
  return t !== void 0 && t === r;
5844
5843
  }
5845
- const Yi = /* @__PURE__ */ new Set([
5844
+ const _i = /* @__PURE__ */ new Set([
5846
5845
  "__proto__",
5847
5846
  "constructor",
5848
5847
  "prototype"
5849
5848
  ]);
5850
- function Yt(i) {
5849
+ function Ut(i) {
5851
5850
  const e = i.at(0), t = i.at(-1);
5852
5851
  return !e || !t ? i : e === "'" && t === "'" || e === '"' && t === '"' ? i.slice(1, -1) : i;
5853
5852
  }
5854
- function Wi(i, e) {
5853
+ function xi(i, e) {
5855
5854
  const t = i.indexOf("=");
5856
5855
  if (t === -1)
5857
- throw ve(e, `Missing '=' in segment '${i.trim()}'`);
5856
+ throw Ie(e, `Missing '=' in segment '${i.trim()}'`);
5858
5857
  if (i.indexOf("=", t + 1) !== -1)
5859
- throw ve(e, `Unexpected '=' in segment '${i.trim()}'`);
5860
- const r = Yt(i.slice(0, t).trim()), s = Yt(i.slice(t + 1).trim());
5858
+ throw Ie(e, `Unexpected '=' in segment '${i.trim()}'`);
5859
+ const r = Ut(i.slice(0, t).trim()), s = Ut(i.slice(t + 1).trim());
5861
5860
  if (!r)
5862
- throw ve(e, "Repository name is empty");
5861
+ throw Ie(e, "Repository name is empty");
5863
5862
  if (!s)
5864
- throw ve(e, `Repository BlueId is empty for '${r}'`);
5863
+ throw Ie(e, `Repository BlueId is empty for '${r}'`);
5865
5864
  return { name: r, value: s };
5866
5865
  }
5867
- function Gi(i) {
5866
+ function Fi(i) {
5868
5867
  if (i.trim().length === 0)
5869
5868
  return /* @__PURE__ */ Object.create(null);
5870
5869
  const e = /* @__PURE__ */ Object.create(null);
5871
5870
  for (const t of i.split(",")) {
5872
5871
  const r = t.trim();
5873
5872
  if (!r)
5874
- throw ve(i, "Empty repository segment");
5875
- const { name: s, value: n } = Wi(r, i);
5876
- Zi(s, i), e[s] = n;
5873
+ throw Ie(i, "Empty repository segment");
5874
+ const { name: s, value: n } = xi(r, i);
5875
+ Ui(s, i), e[s] = n;
5877
5876
  }
5878
5877
  return e;
5879
5878
  }
5880
- function Ji(i) {
5881
- return typeof i == "string" ? Gi(i) : i;
5879
+ function ji(i) {
5880
+ return typeof i == "string" ? Fi(i) : i;
5882
5881
  }
5883
- function ve(i, e) {
5884
- return new he(
5885
- j.INVALID_BLUE_CONTEXT_REPOSITORIES,
5882
+ function Ie(i, e) {
5883
+ return new Te(
5884
+ K.INVALID_BLUE_CONTEXT_REPOSITORIES,
5886
5885
  `Invalid BlueContext repositories value: ${e}`,
5887
5886
  [
5888
5887
  {
5889
- code: j.INVALID_BLUE_CONTEXT_REPOSITORIES,
5888
+ code: K.INVALID_BLUE_CONTEXT_REPOSITORIES,
5890
5889
  message: e,
5891
5890
  locationPath: [],
5892
5891
  context: {
@@ -5897,31 +5896,31 @@ function ve(i, e) {
5897
5896
  ]
5898
5897
  );
5899
5898
  }
5900
- function Zi(i, e) {
5901
- if (Yi.has(i))
5902
- throw ve(e, `Forbidden repository name '${i}'`);
5899
+ function Ui(i, e) {
5900
+ if (_i.has(i))
5901
+ throw Ie(e, `Forbidden repository name '${i}'`);
5903
5902
  }
5904
- function Xi(i, e) {
5903
+ function zi(i, e) {
5905
5904
  const t = i.filter((s) => s.repositoryVersionIndex > e).sort((s, n) => n.repositoryVersionIndex - s.repositoryVersionIndex), r = [];
5906
5905
  for (const s of t) {
5907
5906
  const n = [...s.attributesAdded].sort(
5908
- (o, l) => Wt(l) - Wt(o)
5907
+ (o, l) => zt(l) - zt(o)
5909
5908
  );
5910
5909
  r.push(...n);
5911
5910
  }
5912
5911
  return r;
5913
5912
  }
5914
- function Wt(i) {
5915
- return nr(i).length;
5913
+ function zt(i) {
5914
+ return er(i).length;
5916
5915
  }
5917
- const qi = /* @__PURE__ */ new Set([...Nt]), N = {
5916
+ const Ki = /* @__PURE__ */ new Set([...Pt]), N = {
5918
5917
  core: "core",
5919
5918
  noRuntime: "no-runtime",
5920
5919
  noTargetContext: "no-target-context",
5921
5920
  representable: "representable",
5922
5921
  unrepresentable: "unrepresentable"
5923
5922
  };
5924
- class Qi {
5923
+ class Hi {
5925
5924
  registry;
5926
5925
  targetRepoVersionIndexes;
5927
5926
  fallbackToCurrentInlineDefinitions;
@@ -5930,7 +5929,7 @@ class Qi {
5930
5929
  this.registry = e.registry, this.targetRepoVersionIndexes = e.targetRepoVersionIndexes, this.fallbackToCurrentInlineDefinitions = e.fallbackToCurrentInlineDefinitions;
5931
5930
  }
5932
5931
  transform(e) {
5933
- return L.transform(
5932
+ return $.transform(
5934
5933
  e,
5935
5934
  (t) => this.transformNode(t)
5936
5935
  );
@@ -5992,7 +5991,7 @@ class Qi {
5992
5991
  }
5993
5992
  }
5994
5993
  resolveType(e) {
5995
- if (fe.includes(e))
5994
+ if (pe.includes(e))
5996
5995
  return { kind: N.core, blueId: e };
5997
5996
  const t = this.registry.toCurrentBlueId(e), r = this.registry.getTypeAlias(t), s = this.registry.findRuntimeByBlueId(t);
5998
5997
  if (!s || !s.typeMeta)
@@ -6008,9 +6007,9 @@ class Qi {
6008
6007
  typeAlias: r
6009
6008
  };
6010
6009
  const o = s.typeMeta;
6011
- if (o.status === Et) {
6012
- const h = s.runtime.repositoryVersions.length - 1;
6013
- if (n !== h)
6010
+ if (o.status === Bt) {
6011
+ const p = s.runtime.repositoryVersions.length - 1;
6012
+ if (n !== p)
6014
6013
  return {
6015
6014
  kind: N.unrepresentable,
6016
6015
  currentBlueId: t,
@@ -6023,11 +6022,11 @@ class Qi {
6023
6022
  r
6024
6023
  )
6025
6024
  };
6026
- const f = o.versions?.[0];
6025
+ const y = o.versions?.[0];
6027
6026
  return {
6028
6027
  kind: N.representable,
6029
6028
  currentBlueId: t,
6030
- targetBlueId: f?.typeBlueId ?? t,
6029
+ targetBlueId: y?.typeBlueId ?? t,
6031
6030
  dropPointers: []
6032
6031
  };
6033
6032
  }
@@ -6060,18 +6059,18 @@ class Qi {
6060
6059
  )
6061
6060
  };
6062
6061
  let c = l[0].typeBlueId;
6063
- for (const h of l)
6064
- h.repositoryVersionIndex <= n && (c = h.typeBlueId);
6065
- const d = o.status === Ce ? this.getDropPointers(o, n) : [];
6062
+ for (const p of l)
6063
+ p.repositoryVersionIndex <= n && (c = p.typeBlueId);
6064
+ const h = o.status === Ne ? this.getDropPointers(o, n) : [];
6066
6065
  return {
6067
6066
  kind: N.representable,
6068
6067
  currentBlueId: t,
6069
6068
  targetBlueId: c,
6070
- dropPointers: d
6069
+ dropPointers: h
6071
6070
  };
6072
6071
  }
6073
6072
  getDropPointers(e, t) {
6074
- return e.status !== Ce ? [] : Xi(e.versions, t);
6073
+ return e.status !== Ne ? [] : zi(e.versions, t);
6075
6074
  }
6076
6075
  applyDropPointers(e, t, r = {}) {
6077
6076
  if (e.length === 0 || t.length === 0)
@@ -6084,13 +6083,13 @@ class Qi {
6084
6083
  getDictionaryValueTargets(e) {
6085
6084
  const t = e.getProperties();
6086
6085
  return t ? Object.entries(t).filter(
6087
- ([r, s]) => s instanceof u && !qi.has(r)
6086
+ ([r, s]) => s instanceof u && !Ki.has(r)
6088
6087
  ).map(([, r]) => r) : [];
6089
6088
  }
6090
6089
  deletePropertyAtPointer(e, t, r) {
6091
6090
  let s;
6092
6091
  try {
6093
- s = nr(t);
6092
+ s = er(t);
6094
6093
  } catch {
6095
6094
  throw this.invalidPointerError(t);
6096
6095
  }
@@ -6100,22 +6099,22 @@ class Qi {
6100
6099
  if (t.length === 0)
6101
6100
  return;
6102
6101
  const [s, ...n] = t;
6103
- if (s === K) {
6102
+ if (s === z) {
6104
6103
  const a = e.getType();
6105
6104
  a && this.applyPointerSegments(a, n, !0);
6106
6105
  return;
6107
6106
  }
6108
- if (s === we) {
6107
+ if (s === Pe) {
6109
6108
  const a = e.getItemType();
6110
6109
  a && this.applyPointerSegments(a, n, !0);
6111
6110
  return;
6112
6111
  }
6113
- if (s === Se) {
6112
+ if (s === we) {
6114
6113
  const a = e.getKeyType();
6115
6114
  a && this.applyPointerSegments(a, n, !0);
6116
6115
  return;
6117
6116
  }
6118
- if (s === be) {
6117
+ if (s === Se) {
6119
6118
  const a = e.getValueType();
6120
6119
  a && this.applyPointerSegments(a, n, !0);
6121
6120
  return;
@@ -6157,7 +6156,7 @@ class Qi {
6157
6156
  try {
6158
6157
  const o = m.deserialize(n);
6159
6158
  o.setBlueId(void 0);
6160
- const l = L.transform(
6159
+ const l = $.transform(
6161
6160
  o,
6162
6161
  (a) => this.transformNode(a)
6163
6162
  );
@@ -6168,9 +6167,9 @@ class Qi {
6168
6167
  }
6169
6168
  invalidPointerError(e) {
6170
6169
  const t = `Invalid attributesAdded pointer '${e}'.`;
6171
- return new he(j.INVALID_REPOSITORY_POINTER, t, [
6170
+ return new Te(K.INVALID_REPOSITORY_POINTER, t, [
6172
6171
  {
6173
- code: j.INVALID_REPOSITORY_POINTER,
6172
+ code: K.INVALID_REPOSITORY_POINTER,
6174
6173
  message: t,
6175
6174
  locationPath: [],
6176
6175
  context: { pointer: e }
@@ -6184,43 +6183,43 @@ class Qi {
6184
6183
  typeAlias: o,
6185
6184
  ...l
6186
6185
  };
6187
- if (r && (n !== void 0 && (a.requestedRepoBlueId = r.repositoryVersions[n]), a.serverRepoBlueId = r.currentRepoBlueId), s && s.status === Ce) {
6188
- const d = s.versions?.[0]?.repositoryVersionIndex;
6189
- d !== void 0 && (a.typeIntroducedInRepoBlueId = r?.repositoryVersions[d]);
6186
+ if (r && (n !== void 0 && (a.requestedRepoBlueId = r.repositoryVersions[n]), a.serverRepoBlueId = r.currentRepoBlueId), s && s.status === Ne) {
6187
+ const h = s.versions?.[0]?.repositoryVersionIndex;
6188
+ h !== void 0 && (a.typeIntroducedInRepoBlueId = r?.repositoryVersions[h]);
6190
6189
  }
6191
6190
  const c = {
6192
- code: j.REPO_UNREPRESENTABLE_IN_TARGET_VERSION,
6191
+ code: K.REPO_UNREPRESENTABLE_IN_TARGET_VERSION,
6193
6192
  message: t,
6194
- locationPath: [K],
6193
+ locationPath: [z],
6195
6194
  context: a
6196
6195
  };
6197
- return new he(
6198
- j.REPO_UNREPRESENTABLE_IN_TARGET_VERSION,
6196
+ return new Te(
6197
+ K.REPO_UNREPRESENTABLE_IN_TARGET_VERSION,
6199
6198
  t,
6200
6199
  [c]
6201
6200
  );
6202
6201
  }
6203
6202
  }
6204
- function Pt(i, e) {
6205
- return e ? L.transform(i, (t) => (Ue(
6203
+ function It(i, e) {
6204
+ return e ? $.transform(i, (t) => (Fe(
6206
6205
  () => t.getType(),
6207
6206
  (r) => t.setType(r),
6208
6207
  e
6209
- ), Ue(
6208
+ ), Fe(
6210
6209
  () => t.getItemType(),
6211
6210
  (r) => t.setItemType(r),
6212
6211
  e
6213
- ), Ue(
6212
+ ), Fe(
6214
6213
  () => t.getKeyType(),
6215
6214
  (r) => t.setKeyType(r),
6216
6215
  e
6217
- ), Ue(
6216
+ ), Fe(
6218
6217
  () => t.getValueType(),
6219
6218
  (r) => t.setValueType(r),
6220
6219
  e
6221
6220
  ), t)) : i;
6222
6221
  }
6223
- function Ue(i, e, t) {
6222
+ function Fe(i, e, t) {
6224
6223
  const r = i();
6225
6224
  if (!r || r.isInlineValue())
6226
6225
  return;
@@ -6230,7 +6229,7 @@ function Ue(i, e, t) {
6230
6229
  const n = t.toCurrentBlueId(s);
6231
6230
  n !== s && e(r.clone().setBlueId(n));
6232
6231
  }
6233
- class en {
6232
+ class ki {
6234
6233
  registry;
6235
6234
  blueIdMapper;
6236
6235
  constructor(e) {
@@ -6240,8 +6239,8 @@ class en {
6240
6239
  const r = this.computeTargetRepoVersionIndexes(t);
6241
6240
  if (Object.keys(r).length === 0)
6242
6241
  return e;
6243
- const s = Pt(e, this.blueIdMapper);
6244
- return new Qi({
6242
+ const s = It(e, this.blueIdMapper);
6243
+ return new Hi({
6245
6244
  registry: this.registry,
6246
6245
  targetRepoVersionIndexes: r,
6247
6246
  fallbackToCurrentInlineDefinitions: t.fallbackToCurrentInlineDefinitions !== !1
@@ -6251,7 +6250,7 @@ class en {
6251
6250
  const t = {};
6252
6251
  if (!e?.repositories)
6253
6252
  return t;
6254
- const r = typeof e.repositories == "string" ? Ji(e.repositories) : e.repositories;
6253
+ const r = typeof e.repositories == "string" ? ji(e.repositories) : e.repositories;
6255
6254
  for (const [s, n] of Object.entries(r)) {
6256
6255
  const o = this.registry.findRuntimeByName(s);
6257
6256
  if (!o)
@@ -6269,7 +6268,7 @@ class en {
6269
6268
  }
6270
6269
  unknownRepoBlueIdError(e, t, r) {
6271
6270
  const s = `Unknown RepoBlueId '${t}' for repository '${e}'.`, n = {
6272
- code: j.REPO_UNKNOWN_REPO_BLUE_ID,
6271
+ code: K.REPO_UNKNOWN_REPO_BLUE_ID,
6273
6272
  message: s,
6274
6273
  locationPath: [],
6275
6274
  context: {
@@ -6278,12 +6277,12 @@ class en {
6278
6277
  serverRepoBlueId: r
6279
6278
  }
6280
6279
  };
6281
- return new he(j.REPO_UNKNOWN_REPO_BLUE_ID, s, [
6280
+ return new Te(K.REPO_UNKNOWN_REPO_BLUE_ID, s, [
6282
6281
  n
6283
6282
  ]);
6284
6283
  }
6285
6284
  }
6286
- class xe {
6285
+ class Yi {
6287
6286
  nodeProvider;
6288
6287
  typeSchemaResolver;
6289
6288
  blueDirectivePreprocessor;
@@ -6302,20 +6301,20 @@ class xe {
6302
6301
  repositories: n,
6303
6302
  mergingProcessor: o
6304
6303
  } = e;
6305
- this.repositories = n, this.repositoryRegistry = new Oi(n ?? []), this.blueContextResolver = new en({
6304
+ this.repositories = n, this.repositoryRegistry = new wi(n ?? []), this.blueContextResolver = new ki({
6306
6305
  registry: this.repositoryRegistry,
6307
6306
  blueIdMapper: this.repositoryRegistry
6308
- }), this.mergingProcessor = o ?? _e();
6309
- const l = xt(() => []);
6307
+ }), this.mergingProcessor = o ?? Mt();
6308
+ const l = At(() => []);
6310
6309
  this.nodeProvider = this.wrapNodeProviderWithRepositories(
6311
6310
  t || l,
6312
6311
  n
6313
- ), this.typeSchemaResolver = r ?? new Ys([], {
6312
+ ), this.typeSchemaResolver = r ?? new _s([], {
6314
6313
  nodeProvider: this.nodeProvider
6315
- }), this.typeSchemaResolver?.setNodeProvider(this.nodeProvider), this.urlContentFetcher = new Ei(s), this.blueDirectivePreprocessor = new Si(
6314
+ }), this.typeSchemaResolver?.setNodeProvider(this.nodeProvider), this.urlContentFetcher = new mi(s), this.blueDirectivePreprocessor = new yi(
6316
6315
  void 0,
6317
6316
  this.urlContentFetcher
6318
- ), this.blueIdsMappingGenerator = new Dr(), this.blueIdsMappingGenerator.registerBlueIds(
6317
+ ), this.blueIdsMappingGenerator = new Rr(), this.blueIdsMappingGenerator.registerBlueIds(
6319
6318
  this.repositoryRegistry.getAliases()
6320
6319
  );
6321
6320
  const a = this.repositoryRegistry.getRuntimes().flatMap((c) => c.schemas);
@@ -6338,18 +6337,18 @@ class xe {
6338
6337
  */
6339
6338
  nodeToYaml(e, t = "official") {
6340
6339
  const r = this.normalizeNodeToJsonOptions(t), s = r.blueContext ? this.blueContextResolver.transform(e, r.blueContext) : e;
6341
- return Ti.get(s, {
6340
+ return di.get(s, {
6342
6341
  strategy: r.format
6343
6342
  });
6344
6343
  }
6345
6344
  nodeToSchemaOutput(e, t) {
6346
- return new vi(this.typeSchemaResolver, {
6345
+ return new ui(this.typeSchemaResolver, {
6347
6346
  calculateBlueId: (s) => this.calculateBlueIdSync(s)
6348
6347
  }).convert(e, t);
6349
6348
  }
6350
6349
  resolve(e, t = F) {
6351
6350
  const r = this.combineWithGlobalLimits(t), n = new de(this.mergingProcessor, this.nodeProvider).resolve(e, r);
6352
- if (!(r instanceof H)) {
6351
+ if (!(r instanceof k)) {
6353
6352
  const o = this.getExactReferenceBlueId(e);
6354
6353
  o !== void 0 && n.setSourceSemanticBlueId(o);
6355
6354
  }
@@ -6377,7 +6376,7 @@ class xe {
6377
6376
  * Produces a minimal overlay that re-resolves to the same semantic BlueId.
6378
6377
  */
6379
6378
  minimize(e) {
6380
- return new Ye({
6379
+ return new He({
6381
6380
  nodeProvider: this.nodeProvider,
6382
6381
  mergingProcessor: this.mergingProcessor
6383
6382
  }).minimize(e);
@@ -6390,18 +6389,18 @@ class xe {
6390
6389
  * repository-backed definitions currently known to this {@link Blue} instance.
6391
6390
  */
6392
6391
  restoreInlineTypes(e) {
6393
- return new Vi({
6392
+ return new Pi({
6394
6393
  nodeProvider: this.nodeProvider,
6395
6394
  blueIdsMappingGenerator: this.blueIdsMappingGenerator
6396
6395
  }).restore(e);
6397
6396
  }
6398
6397
  extend(e, t) {
6399
6398
  const r = this.combineWithGlobalLimits(t);
6400
- new $t(this.nodeProvider).extend(e, r);
6399
+ new Ot(this.nodeProvider).extend(e, r);
6401
6400
  }
6402
6401
  jsonValueToNode(e) {
6403
6402
  const t = this.preprocess(m.deserialize(e));
6404
- return Pt(
6403
+ return It(
6405
6404
  t,
6406
6405
  this.repositoryRegistry
6407
6406
  );
@@ -6410,7 +6409,7 @@ class xe {
6410
6409
  const t = await this.preprocessAsync(
6411
6410
  m.deserialize(e)
6412
6411
  );
6413
- return Pt(
6412
+ return It(
6414
6413
  t,
6415
6414
  this.repositoryRegistry
6416
6415
  );
@@ -6432,7 +6431,7 @@ class xe {
6432
6431
  ) : this.jsonValueToNodeAsync(e);
6433
6432
  calculateBlueId = async (e) => {
6434
6433
  const t = await this.prepareForBlueIdCalculation(e);
6435
- return new Ye({
6434
+ return new He({
6436
6435
  nodeProvider: this.nodeProvider,
6437
6436
  mergingProcessor: this.mergingProcessor
6438
6437
  }).calculateBlueId(t);
@@ -6440,7 +6439,7 @@ class xe {
6440
6439
  prepareForBlueIdCalculationSync = (e) => e instanceof u || Array.isArray(e) && e.every((t) => t instanceof u) ? e : Array.isArray(e) ? e.map((t) => this.jsonValueToNode(t)) : this.jsonValueToNode(e);
6441
6440
  calculateBlueIdSync(e) {
6442
6441
  const t = this.prepareForBlueIdCalculationSync(e);
6443
- return new Ye({
6442
+ return new He({
6444
6443
  nodeProvider: this.nodeProvider,
6445
6444
  mergingProcessor: this.mergingProcessor
6446
6445
  }).calculateBlueIdSync(t);
@@ -6478,7 +6477,7 @@ class xe {
6478
6477
  }).preprocessWithDefaultBlue(t);
6479
6478
  }
6480
6479
  transform(e, t) {
6481
- return L.transform(e, t);
6480
+ return $.transform(e, t);
6482
6481
  }
6483
6482
  getNodeProvider() {
6484
6483
  return this.nodeProvider;
@@ -6493,7 +6492,7 @@ class xe {
6493
6492
  if (!b.hasBlueIdOnly(e))
6494
6493
  return;
6495
6494
  const t = e.getReferenceBlueId();
6496
- return t !== void 0 && Be.isPotentialBlueId(t) ? t : void 0;
6495
+ return t !== void 0 && ve.isPotentialBlueId(t) ? t : void 0;
6497
6496
  }
6498
6497
  getTypeSchemaResolver() {
6499
6498
  return this.typeSchemaResolver;
@@ -6614,7 +6613,7 @@ class xe {
6614
6613
  * @returns true if the node matches the schema type, false otherwise
6615
6614
  */
6616
6615
  isTypeOf(e, t, r) {
6617
- return k.isTypeOf(e, t, {
6616
+ return H.isTypeOf(e, t, {
6618
6617
  checkSchemaExtensions: r?.checkSchemaExtensions,
6619
6618
  typeSchemaResolver: this.typeSchemaResolver,
6620
6619
  blueIdMapper: this.repositoryRegistry
@@ -6645,7 +6644,7 @@ class xe {
6645
6644
  * @returns true if the node matches the type, false otherwise.
6646
6645
  */
6647
6646
  isTypeOfNode(e, t) {
6648
- return new Ws(this).matchesType(e, t, this.globalLimits);
6647
+ return new xs(this).matchesType(e, t, this.globalLimits);
6649
6648
  }
6650
6649
  /**
6651
6650
  * Sets the global limits for this Blue instance.
@@ -6676,8 +6675,8 @@ class xe {
6676
6675
  }
6677
6676
  wrapNodeProviderWithRepositories(e, t) {
6678
6677
  return t && t.length > 0 ? Me.wrap(
6679
- new wr([
6680
- new _t(t, {
6678
+ new Ir([
6679
+ new Dt(t, {
6681
6680
  mergingProcessor: this.mergingProcessor
6682
6681
  }),
6683
6682
  e
@@ -6685,268 +6684,14 @@ class xe {
6685
6684
  ) : Me.wrap(e);
6686
6685
  }
6687
6686
  combineWithGlobalLimits(e) {
6688
- return this.globalLimits == F ? e : e == F ? this.globalLimits : ot.of(this.globalLimits, e);
6687
+ return this.globalLimits == F ? e : e == F ? this.globalLimits : st.of(this.globalLimits, e);
6689
6688
  }
6690
6689
  }
6691
- const tn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
6690
+ const Wi = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
6692
6691
  __proto__: null,
6693
- Blue: xe
6694
- }, Symbol.toStringTag, { value: "Module" })), ft = /* @__PURE__ */ new WeakMap(), rn = 10;
6695
- function kn(i, e = {}) {
6696
- const t = e.mergingProcessor === void 0;
6697
- if (t) {
6698
- const a = ft.get(i);
6699
- if (a)
6700
- return a;
6701
- }
6702
- const r = Lr(i);
6703
- if (r.length === 0)
6704
- return t && ft.set(i, i), i;
6705
- const s = $r(i), n = e.mergingProcessor ?? _e();
6706
- let o = Object.fromEntries(
6707
- r.map(({ oldBlueId: a }) => [a, a])
6708
- );
6709
- const l = sn(r.length);
6710
- for (let a = 0; a < l; a++) {
6711
- const c = ln(
6712
- r,
6713
- s,
6714
- o,
6715
- n
6716
- );
6717
- if (dn(o, c)) {
6718
- const d = an(i, o);
6719
- return t && ft.set(i, d), d;
6720
- }
6721
- o = c;
6722
- }
6723
- throw new Error(
6724
- `Repository semantic reindexing did not converge after ${l} passes for ${r.length} entries.`
6725
- );
6726
- }
6727
- function Hn(i, e = {}) {
6728
- const t = Lr(i);
6729
- if (t.length === 0)
6730
- return;
6731
- const r = $r(i), s = e.mergingProcessor ?? _e(), n = new xe({
6732
- nodeProvider: nn(t, r),
6733
- mergingProcessor: s
6734
- });
6735
- n.registerBlueIds(r);
6736
- for (const { packageName: o, oldBlueId: l, content: a } of t) {
6737
- const c = Array.isArray(a) ? a.map((h) => n.jsonValueToNode(h)) : n.jsonValueToNode(a), d = n.calculateBlueIdSync(c);
6738
- if (d !== l)
6739
- throw new he(
6740
- j.BLUE_ID_MISMATCH,
6741
- `Repository content key '${l}' does not match semantic BlueId '${d}'.`,
6742
- [
6743
- {
6744
- code: j.BLUE_ID_MISMATCH,
6745
- message: "Repository contents must be keyed by the semantic BlueId of their minimal storage form.",
6746
- context: { packageName: o, providedBlueId: l, computedBlueId: d }
6747
- }
6748
- ]
6749
- );
6750
- }
6751
- }
6752
- function sn(i) {
6753
- return Math.max(rn, i + 1);
6754
- }
6755
- function Lr(i) {
6756
- const e = [];
6757
- for (const [t, r] of Object.entries(i.packages))
6758
- for (const [s, n] of Object.entries(r.contents))
6759
- e.push({ packageName: t, oldBlueId: s, content: n });
6760
- return e;
6761
- }
6762
- function $r(i) {
6763
- const e = {};
6764
- for (const t of Object.values(i.packages))
6765
- for (const [r, s] of Object.entries(t.aliases))
6766
- e[r] = s;
6767
- return e;
6768
- }
6769
- function nn(i, e) {
6770
- const t = new Map(
6771
- i.map(({ oldBlueId: n, content: o }) => [n, o])
6772
- ), r = new Map(Object.entries(e)), s = new xe();
6773
- return {
6774
- fetchByBlueId(n) {
6775
- const o = on(n, r);
6776
- if (o === void 0)
6777
- return [];
6778
- const { baseBlueId: l, suffix: a } = wt(o), c = t.get(l);
6779
- if (c === void 0)
6780
- return [];
6781
- const d = Array.isArray(c), h = Te.resolveThisReferences(
6782
- c,
6783
- l,
6784
- d
6785
- );
6786
- if (a !== void 0) {
6787
- const f = Number(a.slice(1));
6788
- if (Array.isArray(h)) {
6789
- const g = h[f];
6790
- return g === void 0 ? [] : [s.jsonValueToNode(g)];
6791
- }
6792
- return f === 0 ? [s.jsonValueToNode(h)] : [];
6793
- }
6794
- return Array.isArray(h) ? h.map((f) => s.jsonValueToNode(f)) : [s.jsonValueToNode(h)];
6795
- },
6796
- fetchFirstByBlueId(n) {
6797
- return this.fetchByBlueId(n)[0] ?? null;
6798
- }
6799
- };
6800
- }
6801
- function on(i, e) {
6802
- const t = e.get(i);
6803
- if (t !== void 0)
6804
- return t;
6805
- const { baseBlueId: r, suffix: s } = wt(i);
6806
- if (s === void 0)
6807
- return i;
6808
- const n = e.get(r);
6809
- if (n === void 0)
6810
- return i;
6811
- if (wt(n).suffix === void 0)
6812
- return `${n}${s}`;
6813
- }
6814
- function wt(i) {
6815
- const e = i.indexOf("#");
6816
- return e === -1 ? { baseBlueId: i } : {
6817
- baseBlueId: i.slice(0, e),
6818
- suffix: i.slice(e)
6819
- };
6820
- }
6821
- function ln(i, e, t, r) {
6822
- const s = new Map(
6823
- i.map(({ oldBlueId: c, content: d }) => [
6824
- c,
6825
- et(d, t)
6826
- ])
6827
- ), n = /* @__PURE__ */ new Map();
6828
- for (const { oldBlueId: c } of i)
6829
- n.set(c, c), n.set(t[c], c);
6830
- const o = new xe(), l = {
6831
- fetchByBlueId(c) {
6832
- const [d, h] = c.split("#"), f = n.get(d);
6833
- if (!f)
6834
- return [];
6835
- const g = s.get(f);
6836
- if (g === void 0)
6837
- return [];
6838
- if (Array.isArray(g)) {
6839
- if (h !== void 0) {
6840
- const I = g[Number(h)];
6841
- return I === void 0 ? [] : [o.jsonValueToNode(I)];
6842
- }
6843
- return g.map((I) => o.jsonValueToNode(I));
6844
- }
6845
- return h !== void 0 && h !== "0" ? [] : [o.jsonValueToNode(g)];
6846
- },
6847
- fetchFirstByBlueId(c) {
6848
- return this.fetchByBlueId(c)[0] ?? null;
6849
- }
6850
- }, a = new xe({
6851
- nodeProvider: l,
6852
- mergingProcessor: r
6853
- });
6854
- return a.registerBlueIds(_r(e, t)), Object.fromEntries(
6855
- i.map(({ packageName: c, oldBlueId: d }) => {
6856
- const h = s.get(d);
6857
- if (h === void 0)
6858
- throw new Error(`Missing repository content for ${d}.`);
6859
- try {
6860
- const f = a.jsonValueToNode(h);
6861
- return [d, a.calculateBlueIdSync(f)];
6862
- } catch (f) {
6863
- const g = f instanceof Error ? f.message : String(f);
6864
- throw new Error(
6865
- `Failed to calculate semantic BlueId for ${c}/${d}: ${g}`
6866
- );
6867
- }
6868
- })
6869
- );
6870
- }
6871
- function an(i, e) {
6872
- return {
6873
- name: i.name,
6874
- repositoryVersions: i.repositoryVersions,
6875
- packages: Object.fromEntries(
6876
- Object.entries(i.packages).map(([t, r]) => [
6877
- t,
6878
- cn(r, e)
6879
- ])
6880
- )
6881
- };
6882
- }
6883
- function cn(i, e) {
6884
- return {
6885
- name: i.name,
6886
- aliases: _r(i.aliases, e),
6887
- typesMeta: Object.fromEntries(
6888
- Object.entries(i.typesMeta).map(([t, r]) => [
6889
- e[t] ?? t,
6890
- un(r, e)
6891
- ])
6892
- ),
6893
- contents: Object.fromEntries(
6894
- Object.entries(i.contents).map(([t, r]) => [
6895
- e[t] ?? t,
6896
- et(r, e)
6897
- ])
6898
- ),
6899
- schemas: Object.fromEntries(
6900
- Object.entries(i.schemas).map(([t, r]) => {
6901
- const s = e[t] ?? t;
6902
- return [
6903
- s,
6904
- Ls(s)(r)
6905
- ];
6906
- })
6907
- )
6908
- };
6909
- }
6910
- function un(i, e) {
6911
- return {
6912
- ...i,
6913
- versions: i.versions.map((t) => ({
6914
- ...t,
6915
- typeBlueId: jt(t.typeBlueId, e)
6916
- }))
6917
- };
6918
- }
6919
- function dn(i, e) {
6920
- const t = Object.keys(i);
6921
- return t.length !== Object.keys(e).length ? !1 : t.every((r) => i[r] === e[r]);
6922
- }
6923
- function _r(i, e) {
6924
- return Object.fromEntries(
6925
- Object.entries(i).map(([t, r]) => [
6926
- t,
6927
- jt(r, e)
6928
- ])
6929
- );
6930
- }
6931
- function et(i, e) {
6932
- return Array.isArray(i) ? i.map((t) => et(t, e)) : i && typeof i == "object" ? Object.fromEntries(
6933
- Object.entries(i).map(([t, r]) => [
6934
- t,
6935
- t === "blueId" && typeof r == "string" ? jt(r, e) : et(r, e)
6936
- ])
6937
- ) : i;
6938
- }
6939
- function jt(i, e) {
6940
- const t = e[i];
6941
- if (t !== void 0)
6942
- return t;
6943
- const r = /^(.*)(#\d+)$/.exec(i);
6944
- if (!r)
6945
- return i;
6946
- const [, s, n] = r;
6947
- return `${e[s] ?? s}${n}`;
6948
- }
6949
- class Yn extends xr {
6692
+ Blue: Yi
6693
+ }, Symbol.toStringTag, { value: "Module" }));
6694
+ class Cn extends Ar {
6950
6695
  blueIdToContentMap = /* @__PURE__ */ new Map();
6951
6696
  blueIdToMultipleDocumentsMap = /* @__PURE__ */ new Map();
6952
6697
  preprocessor;
@@ -6954,7 +6699,7 @@ class Yn extends xr {
6954
6699
  constructor(e = []) {
6955
6700
  super();
6956
6701
  const t = new De({ nodeProvider: this });
6957
- this.preprocessor = (r) => t.preprocessWithDefaultBlue(r), this.storageService = new oi({
6702
+ this.preprocessor = (r) => t.preprocessWithDefaultBlue(r), this.storageService = new Xs({
6958
6703
  nodeProvider: this
6959
6704
  }), e.forEach((r) => this.processNode(r));
6960
6705
  }
@@ -6962,7 +6707,7 @@ class Yn extends xr {
6962
6707
  b.hasItemsOnly(e) ? this.processNodeWithItems(e) : this.processSingleNode(e);
6963
6708
  }
6964
6709
  processSingleNode(e) {
6965
- const t = Te.parseAndCalculateBlueIdForNode(
6710
+ const t = Re.parseAndCalculateBlueIdForNode(
6966
6711
  e,
6967
6712
  this.preprocessor,
6968
6713
  this.storageService
@@ -6984,7 +6729,7 @@ class Yn extends xr {
6984
6729
  this.storeNodeList(e);
6985
6730
  }
6986
6731
  storeNodeList(e) {
6987
- const t = Te.parseAndCalculateBlueIdForNodeList(
6732
+ const t = Re.parseAndCalculateBlueIdForNodeList(
6988
6733
  e,
6989
6734
  this.preprocessor,
6990
6735
  this.storageService
@@ -6993,7 +6738,7 @@ class Yn extends xr {
6993
6738
  }
6994
6739
  fetchContentByBlueId(e) {
6995
6740
  const t = this.blueIdToContentMap.get(e), r = this.blueIdToMultipleDocumentsMap.get(e);
6996
- return t !== void 0 && r !== void 0 ? Te.resolveThisReferences(
6741
+ return t !== void 0 && r !== void 0 ? Re.resolveThisReferences(
6997
6742
  t,
6998
6743
  e,
6999
6744
  r
@@ -7088,72 +6833,70 @@ class Yn extends xr {
7088
6833
  }
7089
6834
  }
7090
6835
  export {
7091
- as as Base58Sha256Provider,
7092
- Yn as BasicNodeProvider,
7093
- xe as Blue,
6836
+ es as Base58Sha256Provider,
6837
+ Cn as BasicNodeProvider,
6838
+ Yi as Blue,
7094
6839
  M as BlueIdCalculator,
7095
- On as BlueIdToCid,
6840
+ yn as BlueIdToCid,
7096
6841
  u as BlueNode,
7097
- k as BlueNodeTypeSchema,
7098
- gt as JsonCanonicalizer,
7099
- Dt as Limits,
6842
+ H as BlueNodeTypeSchema,
6843
+ ht as JsonCanonicalizer,
6844
+ Rt as Limits,
7100
6845
  de as Merger,
7101
- _n as MergingProcessors,
7102
- Gs as NodeResolver,
6846
+ Pn as MergingProcessors,
6847
+ Fs as NodeResolver,
7103
6848
  b as Nodes,
7104
- Pn as Properties,
6849
+ nn as Properties,
7105
6850
  J as ResolvedBlueNode,
7106
- Ye as SemanticIdentityService,
7107
- Ys as TypeSchemaResolver,
7108
- Mn as applyBlueNodePatch,
7109
- it as baseBlueObjectSchema,
7110
- Dn as blueDescriptionField,
7111
- xn as blueIdField,
7112
- wn as blueIdSchema,
7113
- Ln as blueNameField,
7114
- $n as blueNodeField,
7115
- En as blueObjectBooleanValueSchema,
7116
- bn as blueObjectNumberValueSchema,
6851
+ He as SemanticIdentityService,
6852
+ _s as TypeSchemaResolver,
6853
+ gn as applyBlueNodePatch,
6854
+ tt as baseBlueObjectSchema,
6855
+ mn as blueDescriptionField,
6856
+ In as blueIdField,
6857
+ on as blueIdSchema,
6858
+ vn as blueNameField,
6859
+ Tn as blueNodeField,
6860
+ cn as blueObjectBooleanValueSchema,
6861
+ an as blueObjectNumberValueSchema,
7117
6862
  Ve as blueObjectSchema,
7118
- Nn as blueObjectStringListItemsSchema,
7119
- Sn as blueObjectStringValueSchema,
7120
- xt as createNodeProvider,
7121
- kt as enrichWithBlueId,
7122
- Es as getBlueDescriptionAnnotation,
7123
- Rs as getBlueIdAnnotation,
7124
- Vs as getBlueNameAnnotation,
7125
- Ms as getBlueNodeAnnotation,
7126
- jn as getBlueObjectItems,
7127
- Un as getBlueObjectProperties,
7128
- zn as getBlueObjectTypeLabel,
7129
- Fn as getBlueObjectValue,
7130
- xs as getTypeBlueIdAnnotation,
7131
- qr as hasBlueObjectBlueIdDefined,
7132
- Qr as hasBlueObjectItemsDefined,
7133
- Rn as hasBlueObjectNameDefined,
7134
- es as hasBlueObjectTypeDefined,
7135
- ts as hasBlueObjectValueDefined,
7136
- yt as isBigDecimalNumber,
6863
+ un as blueObjectStringListItemsSchema,
6864
+ ln as blueObjectStringValueSchema,
6865
+ At as createNodeProvider,
6866
+ Ft as enrichWithBlueId,
6867
+ Is as getBlueDescriptionAnnotation,
6868
+ Bs as getBlueIdAnnotation,
6869
+ ws as getBlueNameAnnotation,
6870
+ bs as getBlueNodeAnnotation,
6871
+ wn as getBlueObjectItems,
6872
+ bn as getBlueObjectProperties,
6873
+ En as getBlueObjectTypeLabel,
6874
+ Sn as getBlueObjectValue,
6875
+ Ns as getTypeBlueIdAnnotation,
6876
+ Hr as hasBlueObjectBlueIdDefined,
6877
+ kr as hasBlueObjectItemsDefined,
6878
+ hn as hasBlueObjectNameDefined,
6879
+ Yr as hasBlueObjectTypeDefined,
6880
+ Wr as hasBlueObjectValueDefined,
6881
+ dt as isBigDecimalNumber,
7137
6882
  oe as isBigIntegerNumber,
7138
6883
  C as isBigNumber,
7139
- Tr as isBlueNodeSchema,
7140
- Cn as isBlueObject,
7141
- Bi as isBlueObjectResolved,
7142
- An as isGivenBlueObjectTypeSchema,
7143
- fr as isJsonBlueArray,
7144
- pr as isJsonBlueObject,
7145
- Vn as isJsonBlueValue,
7146
- We as isUrl,
7147
- Ze as jsonBlueValueSchema,
7148
- Kn as normalizeToBlueObject,
7149
- kn as reindexRepositoryForSemanticStorage,
7150
- Ht as resolveBlueObjectItems,
7151
- Hn as validateRepositorySemanticStorage,
7152
- bs as withBlueDescription,
7153
- Cs as withBlueId,
7154
- As as withBlueName,
7155
- Os as withBlueNode,
7156
- Ls as withTypeBlueId,
7157
- Qs as yamlBlueDump,
6884
+ yr as isBlueNodeSchema,
6885
+ dn as isBlueObject,
6886
+ hi as isBlueObjectResolved,
6887
+ pn as isGivenBlueObjectTypeSchema,
6888
+ cr as isJsonBlueArray,
6889
+ ar as isJsonBlueObject,
6890
+ fn as isJsonBlueValue,
6891
+ ke as isUrl,
6892
+ Ge as jsonBlueValueSchema,
6893
+ Nn as normalizeToBlueObject,
6894
+ jt as resolveBlueObjectItems,
6895
+ ms as withBlueDescription,
6896
+ Ts as withBlueId,
6897
+ Ps as withBlueName,
6898
+ Ss as withBlueNode,
6899
+ Bn as withTypeBlueId,
6900
+ Hs as yamlBlueDump,
7158
6901
  ae as yamlBlueParse
7159
6902
  };