@blue-labs/language 3.9.0 → 3.9.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,88 +1,88 @@
1
- import D from "big.js";
2
- import { isNullable as m, isNonNullable as d, jsonPrimitiveSchema as cr, isReadonlyArray as Pe, isJsonPrimitive as et, isPreciseNumberString as Pt } from "@blue-labs/shared-utils";
3
- import { z as h, ZodOptional as Nt, ZodNullable as St, ZodReadonly as Ct, ZodBranded as At, ZodEffects as Ne, ZodLazy as Se, ZodString as ee, ZodNumber as te, ZodBoolean as Be, ZodBigInt as be, ZodEnum as ur, ZodNativeEnum as dr, ZodIntersection as pr, ZodUnion as hr, ZodObject as fr, ZodRecord as yr } from "zod";
4
- import ue from "bs58";
5
- import { isObject as Vt, isArray as tt, isString as rt, omit as Rt, pascal as gr, map as mr } from "radash";
6
- import { OBJECT_CONTRACTS as V, OBJECT_MERGE_POLICY as Ir, OBJECT_SCHEMA as Tr, BLUE_REPOSITORY_STATUS_STABLE as ae, BLUE_REPOSITORY_STATUS_DEV as st, validateAttributesAddedPointer as vr, parsePointer as Ot } from "@blue-labs/repository-contract";
7
- import { sha256 as Br } from "js-sha256";
8
- import Ue from "crypto";
9
- import br from "base32.js";
10
- import H from "js-yaml";
11
- class S extends D {
1
+ import j from "big.js";
2
+ import { isNullable as m, isNonNullable as d, jsonPrimitiveSchema as dr, isReadonlyArray as Ae, isJsonPrimitive as it, isPreciseNumberString as Vt } from "@blue-labs/shared-utils";
3
+ import { z as p, ZodOptional as Rt, ZodNullable as Ot, ZodReadonly as Mt, ZodBranded as Dt, ZodEffects as Ve, ZodLazy as Re, ZodString as re, ZodNumber as se, ZodBoolean as we, ZodBigInt as Pe, ZodEnum as pr, ZodNativeEnum as hr, ZodIntersection as fr, ZodUnion as yr, ZodObject as gr, ZodRecord as mr } from "zod";
4
+ import pe from "bs58";
5
+ import { isObject as xt, isArray as ot, isString as lt, omit as Ft, pascal as Ir, map as Tr } from "radash";
6
+ import { OBJECT_CONTRACTS as M, OBJECT_MERGE_POLICY as vr, OBJECT_SCHEMA as Br, BLUE_REPOSITORY_STATUS_STABLE as ue, BLUE_REPOSITORY_STATUS_DEV as at, validateAttributesAddedPointer as br, parsePointer as $t } from "@blue-labs/repository-contract";
7
+ import { sha256 as wr } from "js-sha256";
8
+ import Ge from "crypto";
9
+ import Pr from "base32.js";
10
+ import ee from "js-yaml";
11
+ class A extends j {
12
12
  constructor(e) {
13
13
  super(e);
14
14
  }
15
15
  }
16
- class E extends D {
16
+ class N extends j {
17
17
  constructor(e) {
18
18
  super(e);
19
19
  }
20
20
  }
21
- const G = "name", J = "description", W = "type", fe = "itemType", ye = "keyType", ge = "valueType", me = "value", Me = "items", x = "blueId", De = "blue", nt = [
22
- G,
23
- J,
24
- W,
25
- fe,
26
- ye,
21
+ const H = "name", X = "description", q = "type", ge = "itemType", me = "keyType", Ie = "valueType", Te = "value", $e = "items", U = "blueId", _e = "blue", ct = [
22
+ H,
23
+ X,
24
+ q,
27
25
  ge,
28
26
  me,
29
- Me,
30
- x,
31
- De
32
- ], Mt = "Text", Dt = "Double", xt = "Integer", Ft = "Boolean", $t = "List", _t = "Dictionary", xe = [
33
- Mt,
34
- Dt,
35
- xt,
36
- Ft
37
- ], it = [...xe, $t, _t], _ = "DLRQwz7MQeCrzjy9bohPNwtCxKEBbKaMK65KBrwjfG6K", L = "7pwXmXYCJtWnd348c2JQGBkm9C4renmZRwxbfaypsx5y", j = "5WNMiV9Knz63B4dVY5JtMyh3FB4FSGqv7ceScvuapdE1", U = "4EzhSubEimSQD3zrYHRtobfPPWntUuhEz8YcdxHsi12u", ot = "6aehfNAxHLC1PHHoDr3tYtFH3RWNbiWdFancJ1bypXEY", lt = "G7fBT9PSod1RfHLHkpafAGBDVAJMrMhAMY51ERcyXNrj", at = [
38
- _,
39
- L,
40
- j,
41
- U
42
- ], X = [
43
- ...at,
44
- ot,
45
- lt
46
- ], wr = Object.fromEntries(
47
- it.map((s, e) => [s, X[e]])
48
- ), Fe = Object.fromEntries(
49
- X.map((s, e) => [s, it[e]])
50
- ), On = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
27
+ Ie,
28
+ Te,
29
+ $e,
30
+ U,
31
+ _e
32
+ ], _t = "Text", Lt = "Double", jt = "Integer", Ut = "Boolean", kt = "List", Kt = "Dictionary", Le = [
33
+ _t,
34
+ Lt,
35
+ jt,
36
+ Ut
37
+ ], ut = [...Le, kt, Kt], Y = "DLRQwz7MQeCrzjy9bohPNwtCxKEBbKaMK65KBrwjfG6K", z = "7pwXmXYCJtWnd348c2JQGBkm9C4renmZRwxbfaypsx5y", G = "5WNMiV9Knz63B4dVY5JtMyh3FB4FSGqv7ceScvuapdE1", J = "4EzhSubEimSQD3zrYHRtobfPPWntUuhEz8YcdxHsi12u", dt = "6aehfNAxHLC1PHHoDr3tYtFH3RWNbiWdFancJ1bypXEY", pt = "G7fBT9PSod1RfHLHkpafAGBDVAJMrMhAMY51ERcyXNrj", ht = [
38
+ Y,
39
+ z,
40
+ G,
41
+ J
42
+ ], te = [
43
+ ...ht,
44
+ dt,
45
+ pt
46
+ ], Er = Object.fromEntries(
47
+ ut.map((s, e) => [s, te[e]])
48
+ ), je = Object.fromEntries(
49
+ te.map((s, e) => [s, ut[e]])
50
+ ), Dn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
51
51
  __proto__: null,
52
- BASIC_TYPES: xe,
53
- BASIC_TYPE_BLUE_IDS: at,
54
- BOOLEAN_TYPE: Ft,
55
- BOOLEAN_TYPE_BLUE_ID: U,
56
- CORE_TYPES: it,
57
- CORE_TYPE_BLUE_IDS: X,
58
- CORE_TYPE_BLUE_ID_TO_NAME_MAP: Fe,
59
- CORE_TYPE_NAME_TO_BLUE_ID_MAP: wr,
60
- DICTIONARY_TYPE: _t,
61
- DICTIONARY_TYPE_BLUE_ID: lt,
62
- DOUBLE_TYPE: Dt,
63
- DOUBLE_TYPE_BLUE_ID: L,
64
- INTEGER_TYPE: xt,
65
- INTEGER_TYPE_BLUE_ID: j,
66
- LIST_TYPE: $t,
67
- LIST_TYPE_BLUE_ID: ot,
68
- OBJECT_BLUE: De,
69
- OBJECT_BLUE_ID: x,
70
- OBJECT_CONTRACTS: V,
71
- OBJECT_DESCRIPTION: J,
72
- OBJECT_ITEMS: Me,
73
- OBJECT_ITEM_TYPE: fe,
74
- OBJECT_KEY_TYPE: ye,
75
- OBJECT_MERGE_POLICY: Ir,
76
- OBJECT_NAME: G,
77
- OBJECT_SCHEMA: Tr,
78
- OBJECT_SPECIFIC_KEYS: nt,
79
- OBJECT_TYPE: W,
80
- OBJECT_VALUE: me,
81
- OBJECT_VALUE_TYPE: ge,
82
- TEXT_TYPE: Mt,
83
- TEXT_TYPE_BLUE_ID: _
52
+ BASIC_TYPES: Le,
53
+ BASIC_TYPE_BLUE_IDS: ht,
54
+ BOOLEAN_TYPE: Ut,
55
+ BOOLEAN_TYPE_BLUE_ID: J,
56
+ CORE_TYPES: ut,
57
+ CORE_TYPE_BLUE_IDS: te,
58
+ CORE_TYPE_BLUE_ID_TO_NAME_MAP: je,
59
+ CORE_TYPE_NAME_TO_BLUE_ID_MAP: Er,
60
+ DICTIONARY_TYPE: Kt,
61
+ DICTIONARY_TYPE_BLUE_ID: pt,
62
+ DOUBLE_TYPE: Lt,
63
+ DOUBLE_TYPE_BLUE_ID: z,
64
+ INTEGER_TYPE: jt,
65
+ INTEGER_TYPE_BLUE_ID: G,
66
+ LIST_TYPE: kt,
67
+ LIST_TYPE_BLUE_ID: dt,
68
+ OBJECT_BLUE: _e,
69
+ OBJECT_BLUE_ID: U,
70
+ OBJECT_CONTRACTS: M,
71
+ OBJECT_DESCRIPTION: X,
72
+ OBJECT_ITEMS: $e,
73
+ OBJECT_ITEM_TYPE: ge,
74
+ OBJECT_KEY_TYPE: me,
75
+ OBJECT_MERGE_POLICY: vr,
76
+ OBJECT_NAME: H,
77
+ OBJECT_SCHEMA: Br,
78
+ OBJECT_SPECIFIC_KEYS: ct,
79
+ OBJECT_TYPE: q,
80
+ OBJECT_VALUE: Te,
81
+ OBJECT_VALUE_TYPE: Ie,
82
+ TEXT_TYPE: _t,
83
+ TEXT_TYPE_BLUE_ID: Y
84
84
  }, Symbol.toStringTag, { value: "Module" }));
85
- class Er {
85
+ class Nr {
86
86
  static get(e, t, r, n = !0) {
87
87
  if (m(t) || !t.startsWith("/"))
88
88
  throw new Error(`Invalid path: ${t}`);
@@ -178,7 +178,7 @@ class Er {
178
178
  i = new c().setProperties(l);
179
179
  break;
180
180
  }
181
- case V: {
181
+ case M: {
182
182
  const l = e.getContracts();
183
183
  i = new c().setContracts(l);
184
184
  break;
@@ -256,18 +256,18 @@ class c {
256
256
  getValue() {
257
257
  const e = this.type?.getBlueId();
258
258
  if (d(e) && d(this.value)) {
259
- if (e === j && typeof this.value == "string")
260
- return new E(this.value);
261
- if (e === L && typeof this.value == "string") {
262
- const t = new S(this.value), r = parseFloat(t.toString());
263
- return new S(r.toString());
264
- } else if (e === U && typeof this.value == "string")
259
+ if (e === G && typeof this.value == "string")
260
+ return new N(this.value);
261
+ if (e === z && typeof this.value == "string") {
262
+ const t = new A(this.value), r = parseFloat(t.toString());
263
+ return new A(r.toString());
264
+ } else if (e === J && 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 E(e.toString()) : this.value = new S(e.toString()) : this.value = e, this;
270
+ return typeof e == "number" ? e % 1 === 0 ? this.value = new N(e.toString()) : this.value = new A(e.toString()) : this.value = e, this;
271
271
  }
272
272
  getItems() {
273
273
  return this.items;
@@ -291,21 +291,21 @@ class c {
291
291
  return this.properties && delete this.properties[e], this;
292
292
  }
293
293
  getContractsProperty() {
294
- return this.properties?.[V];
294
+ return this.properties?.[M];
295
295
  }
296
296
  getContracts() {
297
297
  return this.getContractsProperty()?.getProperties();
298
298
  }
299
299
  setContracts(e) {
300
- return m(e) ? this.removeProperty(V) : this.addProperty(
301
- V,
300
+ return m(e) ? this.removeProperty(M) : this.addProperty(
301
+ M,
302
302
  new c().setProperties(e)
303
303
  ), this;
304
304
  }
305
305
  addContract(e, t) {
306
306
  const r = this.getContractsProperty();
307
307
  return m(r) ? this.addProperty(
308
- V,
308
+ M,
309
309
  new c().addProperty(e, t)
310
310
  ) : r.addProperty(e, t), this;
311
311
  }
@@ -314,7 +314,7 @@ class c {
314
314
  if (t) {
315
315
  t.removeProperty(e);
316
316
  const r = t.getProperties();
317
- r && Object.keys(r).length === 0 && this.removeProperty(V);
317
+ r && Object.keys(r).length === 0 && this.removeProperty(M);
318
318
  }
319
319
  return this;
320
320
  }
@@ -344,7 +344,7 @@ class c {
344
344
  return !1;
345
345
  }
346
346
  get(e, t) {
347
- return Er.get(this, e, t);
347
+ return Nr.get(this, e, t);
348
348
  }
349
349
  getAsNode(e) {
350
350
  const t = this.get(e);
@@ -354,7 +354,7 @@ class c {
354
354
  }
355
355
  getAsInteger(e) {
356
356
  const t = this.get(e);
357
- if (t instanceof E || t instanceof S)
357
+ if (t instanceof N || t instanceof A)
358
358
  return t.toNumber();
359
359
  throw new Error(
360
360
  `Value at path ${e} is not a BigInteger or BigDecimal: ${t}`
@@ -374,7 +374,7 @@ class c {
374
374
  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}}`;
375
375
  }
376
376
  }
377
- class Ce {
377
+ class Oe {
378
378
  static MIN_BLUE_ID_LENGTH = 41;
379
379
  static MAX_BLUE_ID_LENGTH = 45;
380
380
  static BLUE_ID_PATTERN = /^[1-9A-HJ-NP-Za-km-z]{41,45}(?:#\d+)?$/;
@@ -385,7 +385,7 @@ class Ce {
385
385
  if (n < this.MIN_BLUE_ID_LENGTH || n > this.MAX_BLUE_ID_LENGTH)
386
386
  return !1;
387
387
  try {
388
- if (ue.decode(r).length !== 32)
388
+ if (pe.decode(r).length !== 32)
389
389
  return !1;
390
390
  } catch {
391
391
  return !1;
@@ -400,14 +400,14 @@ class Ce {
400
400
  return !0;
401
401
  }
402
402
  }
403
- const Mn = h.string().max(Ce.MAX_BLUE_ID_LENGTH, {
403
+ const xn = p.string().max(Oe.MAX_BLUE_ID_LENGTH, {
404
404
  message: "Blue Id has a maximum length of 45 characters"
405
- }).min(Ce.MIN_BLUE_ID_LENGTH, {
405
+ }).min(Oe.MIN_BLUE_ID_LENGTH, {
406
406
  message: "Blue Id has a minimum length of 41 characters"
407
407
  }).refine(
408
408
  (s) => {
409
409
  try {
410
- return ue.decode(s), !0;
410
+ return pe.decode(s), !0;
411
411
  } catch {
412
412
  return !1;
413
413
  }
@@ -415,115 +415,115 @@ const Mn = h.string().max(Ce.MAX_BLUE_ID_LENGTH, {
415
415
  {
416
416
  message: "Blue Id must be a valid Base58 string"
417
417
  }
418
- ), de = h.lazy(
419
- () => h.record(h.unknown()).and(
420
- h.object({
421
- blueId: h.string().optional(),
422
- name: h.string().optional(),
423
- description: h.string().optional(),
424
- type: de.optional(),
425
- value: h.union([h.string(), h.number(), h.boolean()]).optional().nullable(),
426
- items: h.array(de).optional()
418
+ ), he = p.lazy(
419
+ () => p.record(p.unknown()).and(
420
+ p.object({
421
+ blueId: p.string().optional(),
422
+ name: p.string().optional(),
423
+ description: p.string().optional(),
424
+ type: he.optional(),
425
+ value: p.union([p.string(), p.number(), p.boolean()]).optional().nullable(),
426
+ items: p.array(he).optional()
427
427
  })
428
428
  )
429
- ), $e = h.object({
430
- blueId: h.string().optional(),
431
- name: h.string().optional(),
432
- description: h.string().optional(),
433
- type: de.optional()
434
- }), Dn = $e.extend({
435
- value: h.string().optional()
436
- }), xn = $e.extend({
437
- value: h.number().optional()
438
- }), Fn = $e.extend({
439
- value: h.boolean().optional()
440
- }), $n = $e.extend({
441
- items: h.array(h.string()).optional()
442
- }), _n = (s) => de.safeParse(s).success, Pr = (s) => d(s) && "blueId" in s && d(s.blueId), Ln = (s) => d(s) && "name" in s && d(s.name), Nr = (s) => d(s) && "items" in s && d(s.items), Sr = (s) => d(s) && "type" in s && d(s.type), Cr = (s) => d(s) && "value" in s && d(s.value), jn = (s, e) => s.required({ type: !0 }).safeParse(e).success, C = (s) => s instanceof D, Z = (s) => C(s) && s instanceof E, We = (s) => C(s) && s instanceof S, Ar = h.lazy(
443
- () => h.record(Ae)
444
- ), Vr = h.lazy(
445
- () => h.union([
446
- h.array(Ae),
447
- h.array(Ae).readonly()
429
+ ), Ue = p.object({
430
+ blueId: p.string().optional(),
431
+ name: p.string().optional(),
432
+ description: p.string().optional(),
433
+ type: he.optional()
434
+ }), Fn = Ue.extend({
435
+ value: p.string().optional()
436
+ }), $n = Ue.extend({
437
+ value: p.number().optional()
438
+ }), _n = Ue.extend({
439
+ value: p.boolean().optional()
440
+ }), Ln = Ue.extend({
441
+ items: p.array(p.string()).optional()
442
+ }), jn = (s) => he.safeParse(s).success, Sr = (s) => d(s) && "blueId" in s && d(s.blueId), Un = (s) => d(s) && "name" in s && d(s.name), Cr = (s) => d(s) && "items" in s && d(s.items), Ar = (s) => d(s) && "type" in s && d(s.type), Vr = (s) => d(s) && "value" in s && d(s.value), kn = (s, e) => s.required({ type: !0 }).safeParse(e).success, R = (s) => s instanceof j, Q = (s) => R(s) && s instanceof N, Qe = (s) => R(s) && s instanceof A, Rr = p.lazy(
443
+ () => p.record(Me)
444
+ ), Or = p.lazy(
445
+ () => p.union([
446
+ p.array(Me),
447
+ p.array(Me).readonly()
448
448
  ])
449
- ), Ae = h.lazy(
450
- () => h.union([
451
- cr,
452
- Ar,
453
- Vr,
454
- h.instanceof(D)
449
+ ), Me = p.lazy(
450
+ () => p.union([
451
+ dr,
452
+ Rr,
453
+ Or,
454
+ p.instanceof(j)
455
455
  ])
456
- ), Lt = (s) => Vt(s) && !tt(s) && !Pe(s) && !C(s), jt = (s) => tt(s) || Pe(s), Un = (s) => jt(s) || Lt(s) || C(s) || et(s);
457
- class g {
456
+ ), Yt = (s) => xt(s) && !ot(s) && !Ae(s) && !R(s), zt = (s) => ot(s) || Ae(s), Kn = (s) => zt(s) || Yt(s) || R(s) || it(s);
457
+ class y {
458
458
  static deserialize(e) {
459
- return g.handleNode(e);
459
+ return y.handleNode(e);
460
460
  }
461
461
  static handleNode(e) {
462
462
  if (e === void 0)
463
463
  throw new Error(
464
464
  "This is not a valid JSON-like value. Found 'undefined' as a value."
465
465
  );
466
- if (Lt(e)) {
466
+ if (Yt(e)) {
467
467
  const t = new c(), r = {};
468
468
  return Object.entries(e).forEach(([n, i]) => {
469
469
  switch (n) {
470
- case G:
470
+ case H:
471
471
  if (i == null)
472
472
  t.setName(void 0);
473
473
  else {
474
474
  if (typeof i != "string")
475
- throw new Error(`The ${G} field must be a string.`);
475
+ throw new Error(`The ${H} field must be a string.`);
476
476
  t.setName(i);
477
477
  }
478
478
  break;
479
- case J:
479
+ case X:
480
480
  if (i == null)
481
481
  t.setDescription(void 0);
482
482
  else {
483
483
  if (typeof i != "string")
484
484
  throw new Error(
485
- `The ${J} field must be a string.`
485
+ `The ${X} field must be a string.`
486
486
  );
487
487
  t.setDescription(i);
488
488
  }
489
489
  break;
490
- case W:
491
- t.setType(g.handleNode(i));
492
- break;
493
- case fe:
494
- t.setItemType(g.handleNode(i));
495
- break;
496
- case ye:
497
- t.setKeyType(g.handleNode(i));
490
+ case q:
491
+ t.setType(y.handleNode(i));
498
492
  break;
499
493
  case ge:
500
- t.setValueType(g.handleNode(i));
494
+ t.setItemType(y.handleNode(i));
501
495
  break;
502
496
  case me:
503
- t.setValue(g.handleValue(i));
497
+ t.setKeyType(y.handleNode(i));
504
498
  break;
505
- case x:
499
+ case Ie:
500
+ t.setValueType(y.handleNode(i));
501
+ break;
502
+ case Te:
503
+ t.setValue(y.handleValue(i));
504
+ break;
505
+ case U:
506
506
  if (typeof i != "string")
507
- throw new Error(`The ${x} field must be a string.`);
507
+ throw new Error(`The ${U} field must be a string.`);
508
508
  t.setBlueId(i);
509
509
  break;
510
- case Me:
511
- t.setItems(g.handleArray(i));
510
+ case $e:
511
+ t.setItems(y.handleArray(i));
512
512
  break;
513
- case De:
514
- t.setBlue(g.handleNode(i));
513
+ case _e:
514
+ t.setBlue(y.handleNode(i));
515
515
  break;
516
516
  default:
517
- r[n] = g.handleNode(i);
517
+ r[n] = y.handleNode(i);
518
518
  break;
519
519
  }
520
520
  }), Object.keys(r).length > 0 && t.setProperties(r), t;
521
521
  } else {
522
- if (jt(e))
523
- return new c().setItems(g.handleArray(e));
522
+ if (zt(e))
523
+ return new c().setItems(y.handleArray(e));
524
524
  {
525
525
  const t = e;
526
- return new c().setValue(g.handleValue(t)).setInlineValue(!0);
526
+ return new c().setValue(y.handleValue(t)).setInlineValue(!0);
527
527
  }
528
528
  }
529
529
  }
@@ -532,13 +532,13 @@ class g {
532
532
  return null;
533
533
  if (typeof e == "string")
534
534
  return e;
535
- if (typeof e == "number" || C(e))
536
- if (Z(e) || Number.isSafeInteger(e)) {
537
- const t = new E(e.toString()), r = Number.MIN_SAFE_INTEGER, n = Number.MAX_SAFE_INTEGER;
538
- return t.lt(r) ? new E(r.toString()) : t.gt(n) ? new E(n.toString()) : t;
535
+ if (typeof e == "number" || R(e))
536
+ if (Q(e) || Number.isSafeInteger(e)) {
537
+ const t = new N(e.toString()), r = Number.MIN_SAFE_INTEGER, n = Number.MAX_SAFE_INTEGER;
538
+ return t.lt(r) ? new N(r.toString()) : t.gt(n) ? new N(n.toString()) : t;
539
539
  } else {
540
540
  const t = parseFloat(e.toString());
541
- return new S(t.toString());
541
+ return new A(t.toString());
542
542
  }
543
543
  else if (typeof e == "boolean")
544
544
  return e;
@@ -546,20 +546,20 @@ class g {
546
546
  }
547
547
  static handleArray(e) {
548
548
  if (e != null) {
549
- if (Vt(e) && !Array.isArray(e))
550
- return [g.handleNode(e)];
549
+ if (xt(e) && !Array.isArray(e))
550
+ return [y.handleNode(e)];
551
551
  if (Array.isArray(e))
552
- return e.map(g.handleNode);
552
+ return e.map(y.handleNode);
553
553
  throw new Error("Expected an array node");
554
554
  }
555
555
  }
556
556
  }
557
- function Rr(s) {
557
+ function Mr(s) {
558
558
  return s && s.__esModule && Object.prototype.hasOwnProperty.call(s, "default") ? s.default : s;
559
559
  }
560
- var ke, mt;
561
- function Or() {
562
- return mt || (mt = 1, ke = function s(e) {
560
+ var Je, bt;
561
+ function Dr() {
562
+ return bt || (bt = 1, Je = function s(e) {
563
563
  if (typeof e == "number" && isNaN(e))
564
564
  throw new Error("NaN is not allowed");
565
565
  if (typeof e == "number" && !isFinite(e))
@@ -570,50 +570,50 @@ function Or() {
570
570
  const i = r.length === 0 ? "" : ",";
571
571
  return `${r}${i}${s(n)}:${s(e[n])}`;
572
572
  }, "")}}`;
573
- }), ke;
573
+ }), Je;
574
574
  }
575
- var Mr = Or();
576
- const Dr = /* @__PURE__ */ Rr(Mr);
577
- class Ze {
575
+ var xr = Dr();
576
+ const Fr = /* @__PURE__ */ Mr(xr);
577
+ class et {
578
578
  static canonicalize(e) {
579
- return Dr(e);
579
+ return Fr(e);
580
580
  }
581
581
  }
582
- const Ke = typeof process < "u" && process.versions != null && process.versions.node != null;
583
- class ct {
582
+ const We = typeof process < "u" && process.versions != null && process.versions.node != null;
583
+ class ft {
584
584
  static instance;
585
585
  browserCrypto;
586
586
  constructor() {
587
587
  this.browserCrypto = this.initBrowserCrypto();
588
588
  }
589
589
  static getInstance() {
590
- return this.instance || (this.instance = new ct()), this.instance;
590
+ return this.instance || (this.instance = new ft()), this.instance;
591
591
  }
592
592
  initBrowserCrypto() {
593
- return Ke ? null : "crypto" in globalThis ? globalThis.crypto : null;
593
+ return We ? null : "crypto" in globalThis ? globalThis.crypto : null;
594
594
  }
595
595
  hasNodeCrypto() {
596
- return Ke && !!Ue && typeof Ue.createHash == "function";
596
+ return We && !!Ge && typeof Ge.createHash == "function";
597
597
  }
598
598
  getBrowserCrypto() {
599
599
  return this.browserCrypto;
600
600
  }
601
601
  getNodeCrypto() {
602
- return Ke ? Ue : null;
602
+ return We ? Ge : null;
603
603
  }
604
604
  }
605
- class xr {
606
- cryptoEnv = ct.getInstance();
605
+ class $r {
606
+ cryptoEnv = ft.getInstance();
607
607
  applySync(e) {
608
608
  const t = this.canonicalizeInput(e), r = this.cryptoEnv.hasNodeCrypto() ? this.sha256Sync(t) : this.sha256SyncBrowser(t);
609
- return ue.encode(r);
609
+ return pe.encode(r);
610
610
  }
611
611
  async apply(e) {
612
612
  const t = this.canonicalizeInput(e), r = this.cryptoEnv.hasNodeCrypto() ? this.sha256Sync(t) : await this.sha256Async(t);
613
- return ue.encode(r);
613
+ return pe.encode(r);
614
614
  }
615
615
  canonicalizeInput(e) {
616
- const t = Ze.canonicalize(e);
616
+ const t = et.canonicalize(e);
617
617
  if (typeof t != "string")
618
618
  throw new Error("Canonized value must be a string");
619
619
  return t;
@@ -628,7 +628,7 @@ class xr {
628
628
  return new Uint8Array(r);
629
629
  }
630
630
  sha256SyncBrowser(e) {
631
- return new Uint8Array(Br.arrayBuffer(e));
631
+ return new Uint8Array(wr.arrayBuffer(e));
632
632
  }
633
633
  async sha256Async(e) {
634
634
  if (this.cryptoEnv.hasNodeCrypto())
@@ -655,7 +655,7 @@ class I {
655
655
  const r = e.getValue(), n = this.handleValue(r);
656
656
  if (n !== void 0 && t === "simple")
657
657
  return n;
658
- const i = e.getItems()?.map((Q) => I.get(Q, t));
658
+ const i = e.getItems()?.map((F) => I.get(F, t));
659
659
  if (i !== void 0 && t === "simple")
660
660
  return i;
661
661
  const o = e.getName(), l = e.getDescription();
@@ -666,31 +666,31 @@ class I {
666
666
  return i;
667
667
  }
668
668
  const a = {};
669
- o !== void 0 && (a[G] = o), l !== void 0 && (a[J] = l);
669
+ o !== void 0 && (a[H] = o), l !== void 0 && (a[X] = l);
670
670
  const u = e.getType();
671
671
  if (t === "official" && r !== void 0 && u === void 0) {
672
- const Q = this.inferTypeBlueId(r);
673
- Q !== null && (a[W] = { [x]: Q });
674
- } else u !== void 0 && (a[W] = I.get(u, t));
675
- const y = e.getItemType();
676
- y !== void 0 && (a[fe] = I.get(y, t));
677
- const p = e.getKeyType();
678
- p !== void 0 && (a[ye] = I.get(p, t));
679
- const f = e.getValueType();
680
- f !== void 0 && (a[ge] = I.get(f, t)), n !== void 0 && (a[me] = n), i !== void 0 && (a[Me] = i);
672
+ const F = this.inferTypeBlueId(r);
673
+ F !== null && (a[q] = { [U]: F });
674
+ } else u !== void 0 && (a[q] = I.get(u, t));
675
+ const f = e.getItemType();
676
+ f !== void 0 && (a[ge] = I.get(f, t));
677
+ const h = e.getKeyType();
678
+ h !== void 0 && (a[me] = I.get(h, t));
679
+ const g = e.getValueType();
680
+ g !== void 0 && (a[Ie] = I.get(g, t)), n !== void 0 && (a[Te] = n), i !== void 0 && (a[$e] = i);
681
681
  const v = e.getBlueId();
682
- v !== void 0 && (a[x] = v);
683
- const k = e.getBlue();
684
- k !== void 0 && (a[De] = k);
685
- const q = e.getProperties();
686
- return q !== void 0 && Object.entries(q).forEach(([Q, ar]) => {
687
- a[Q] = I.get(ar, t);
682
+ v !== void 0 && (a[U] = v);
683
+ const x = e.getBlue();
684
+ x !== void 0 && (a[_e] = x);
685
+ const V = e.getProperties();
686
+ return V !== void 0 && Object.entries(V).forEach(([F, B]) => {
687
+ a[F] = I.get(B, t);
688
688
  }), a;
689
689
  }
690
690
  static handleValue(e) {
691
- if (C(e)) {
692
- if (Z(e)) {
693
- const t = new D(Number.MIN_SAFE_INTEGER.toString()), r = new D(Number.MAX_SAFE_INTEGER.toString());
691
+ if (R(e)) {
692
+ if (Q(e)) {
693
+ const t = new j(Number.MIN_SAFE_INTEGER.toString()), r = new j(Number.MAX_SAFE_INTEGER.toString());
694
694
  if (e.lt(t) || e.gt(r))
695
695
  return e.toString();
696
696
  }
@@ -699,12 +699,12 @@ class I {
699
699
  return e;
700
700
  }
701
701
  static inferTypeBlueId(e) {
702
- return typeof e == "string" ? _ : C(e) ? Z(e) ? j : L : typeof e == "boolean" ? U : null;
702
+ return typeof e == "string" ? Y : R(e) ? Q(e) ? G : z : typeof e == "boolean" ? J : null;
703
703
  }
704
704
  }
705
- const Fr = (s) => et(s) && d(s);
705
+ const _r = (s) => it(s) && d(s);
706
706
  class T {
707
- static INSTANCE = new T(new xr());
707
+ static INSTANCE = new T(new $r());
708
708
  hashProvider;
709
709
  constructor(e) {
710
710
  this.hashProvider = e;
@@ -739,14 +739,14 @@ class T {
739
739
  }
740
740
  // Internal method to calculate BlueId recursively
741
741
  internalCalculate(e, t) {
742
- return Fr(e) || C(e) ? this.applyHash(e.toString(), t) : Array.isArray(e) || Pe(e) ? this.calculateList(e, t) : this.calculateMap(e, t);
742
+ return _r(e) || R(e) ? this.applyHash(e.toString(), t) : Array.isArray(e) || Ae(e) ? this.calculateList(e, t) : this.calculateMap(e, t);
743
743
  }
744
744
  calculateMap(e, t) {
745
- if (e[x] !== void 0)
746
- return e[x];
745
+ if (e[U] !== void 0)
746
+ return e[U];
747
747
  const n = Object.keys(e).map((o) => {
748
748
  const l = e[o];
749
- if ([G, me, J].includes(o))
749
+ if ([H, Te, X].includes(o))
750
750
  return t ? [o, l] : Promise.resolve([o, l]);
751
751
  {
752
752
  const a = this.internalCalculate(l, t);
@@ -789,9 +789,9 @@ class T {
789
789
  // Method to clean the input structure by removing null or undefined values
790
790
  cleanStructure(e) {
791
791
  if (e != null) {
792
- if (et(e) || C(e))
792
+ if (it(e) || R(e))
793
793
  return e;
794
- if (Array.isArray(e) || Pe(e)) {
794
+ if (Array.isArray(e) || Ae(e)) {
795
795
  const t = e.map((r) => this.cleanStructure(r)).filter(d);
796
796
  return t.length > 0 ? t : void 0;
797
797
  } else if (typeof e == "object") {
@@ -806,15 +806,15 @@ class T {
806
806
  }
807
807
  }
808
808
  }
809
- class kn {
809
+ class Yn {
810
810
  static convert(e) {
811
- const t = ue.decode(e), r = new Uint8Array(2 + t.length);
811
+ const t = pe.decode(e), r = new Uint8Array(2 + t.length);
812
812
  r[0] = 18, r[1] = 32, r.set(t, 2);
813
813
  const n = new Uint8Array(2 + r.length);
814
- return n[0] = 1, n[1] = 85, n.set(r, 2), "b" + new br.Encoder({ type: "rfc4648", lc: !0 }).write(n).finalize().replace(/=/g, "");
814
+ return n[0] = 1, n[1] = 85, n.set(r, 2), "b" + new Pr.Encoder({ type: "rfc4648", lc: !0 }).write(n).finalize().replace(/=/g, "");
815
815
  }
816
816
  }
817
- class w {
817
+ class E {
818
818
  /**
819
819
  * Transforms a node and all its child nodes using the provided transformer function
820
820
  * @param node - The node to transform
@@ -823,45 +823,45 @@ class w {
823
823
  */
824
824
  static transform(e, t) {
825
825
  const r = t(e.clone()), n = r.getType();
826
- n !== void 0 && r.setType(w.transform(n, t));
826
+ n !== void 0 && r.setType(E.transform(n, t));
827
827
  const i = r.getItemType();
828
828
  i !== void 0 && r.setItemType(
829
- w.transform(i, t)
829
+ E.transform(i, t)
830
830
  );
831
831
  const o = r.getKeyType();
832
832
  o !== void 0 && r.setKeyType(
833
- w.transform(o, t)
833
+ E.transform(o, t)
834
834
  );
835
835
  const l = r.getValueType();
836
836
  l !== void 0 && r.setValueType(
837
- w.transform(l, t)
837
+ E.transform(l, t)
838
838
  );
839
839
  const a = r.getItems();
840
840
  if (a !== void 0) {
841
- const y = a.map(
842
- (p) => w.transform(p, t)
841
+ const f = a.map(
842
+ (h) => E.transform(h, t)
843
843
  );
844
- r.setItems(y);
844
+ r.setItems(f);
845
845
  }
846
846
  const u = r.getProperties();
847
847
  if (u !== void 0) {
848
- const y = Object.keys(u).reduce(
849
- (p, f) => (p[f] = w.transform(u[f], t), p),
848
+ const f = Object.keys(u).reduce(
849
+ (h, g) => (h[g] = E.transform(u[g], t), h),
850
850
  {}
851
851
  );
852
- r.setProperties(y);
852
+ r.setProperties(f);
853
853
  }
854
854
  return r;
855
855
  }
856
856
  }
857
- const F = (s) => !!s && typeof s == "object" && !Array.isArray(s) && !(s instanceof c), O = (s) => s instanceof E || s instanceof S, $r = (s) => s.replace(/~1/g, "/").replace(/~0/g, "~");
858
- function oe(s) {
857
+ const k = (s) => !!s && typeof s == "object" && !Array.isArray(s) && !(s instanceof c), $ = (s) => s instanceof N || s instanceof A, Lr = (s) => s.replace(/~1/g, "/").replace(/~0/g, "~");
858
+ function ae(s) {
859
859
  if (s === "/") return [];
860
860
  if (!s.startsWith("/"))
861
861
  throw new Error(`Path must start with '/': ${s}`);
862
- return s.split("/").slice(1).map($r);
862
+ return s.split("/").slice(1).map(Lr);
863
863
  }
864
- function se(s) {
864
+ function ie(s) {
865
865
  if (s === "-") return -1;
866
866
  const e = typeof s == "number" ? s : parseInt(s, 10);
867
867
  if (isNaN(e))
@@ -872,7 +872,7 @@ function se(s) {
872
872
  );
873
873
  return e;
874
874
  }
875
- function Ut(s, e, t, r = !0) {
875
+ function Gt(s, e, t, r = !0) {
876
876
  switch (e) {
877
877
  case "name":
878
878
  return t ? r ? s.getName() ?? null : s : s.getName();
@@ -896,15 +896,15 @@ function Ut(s, e, t, r = !0) {
896
896
  return s.getItems();
897
897
  case "properties":
898
898
  return s.getProperties();
899
- case V:
899
+ case M:
900
900
  return s.getContracts();
901
901
  default:
902
902
  return;
903
903
  }
904
904
  }
905
- function It(s, e, t = !0) {
905
+ function wt(s, e, t = !0) {
906
906
  if (s instanceof c) {
907
- const r = Ut(
907
+ const r = Gt(
908
908
  s,
909
909
  e,
910
910
  !0,
@@ -922,7 +922,7 @@ function It(s, e, t = !0) {
922
922
  "blue",
923
923
  "items",
924
924
  "properties",
925
- V
925
+ M
926
926
  ].includes(e))
927
927
  return r;
928
928
  if (/^-?\d+$/.test(e) && e !== "-") {
@@ -934,12 +934,12 @@ function It(s, e, t = !0) {
934
934
  }
935
935
  if (Array.isArray(s)) {
936
936
  if (e === "-") return;
937
- const r = se(e);
937
+ const r = ie(e);
938
938
  return r >= 0 && r < s.length ? s[r] : void 0;
939
939
  }
940
- if (F(s)) return s[e];
940
+ if (k(s)) return s[e];
941
941
  }
942
- function le(s, e) {
942
+ function ce(s, e) {
943
943
  if (e.length === 0)
944
944
  return {
945
945
  parent: s,
@@ -948,15 +948,15 @@ function le(s, e) {
948
948
  };
949
949
  let t = s;
950
950
  for (let n = 0; n < e.length - 1; ++n) {
951
- const i = e[n], o = It(t, i);
951
+ const i = e[n], o = wt(t, i);
952
952
  if (o === void 0)
953
953
  throw new Error(`Cannot resolve '/${e.slice(0, n + 1).join("/")}'`);
954
954
  t = o;
955
955
  }
956
956
  const r = e[e.length - 1];
957
957
  if (t instanceof c) {
958
- const n = It(t, r, !1);
959
- if ((typeof n != "object" || n === null || O(n)) && !(n instanceof c) && !Array.isArray(n) && ["name", "description", "value", "blueId"].includes(r))
958
+ const n = wt(t, r, !1);
959
+ if ((typeof n != "object" || n === null || $(n)) && !(n instanceof c) && !Array.isArray(n) && ["name", "description", "value", "blueId"].includes(r))
960
960
  return {
961
961
  parent: t,
962
962
  key: r,
@@ -965,12 +965,12 @@ function le(s, e) {
965
965
  }
966
966
  return Array.isArray(t) && r === "-" ? { parent: t, key: "-" } : t instanceof c && t.getItems() && r === "-" ? { parent: t, key: "-" } : {
967
967
  parent: t,
968
- key: Array.isArray(t) ? se(r) : r
968
+ key: Array.isArray(t) ? ie(r) : r
969
969
  };
970
970
  }
971
- function ut(s, e) {
971
+ function yt(s, e) {
972
972
  if (s instanceof c) {
973
- const t = e, r = Ut(s, t, !1);
973
+ const t = e, r = Gt(s, t, !1);
974
974
  if (r !== void 0 || [
975
975
  "name",
976
976
  "description",
@@ -983,7 +983,7 @@ function ut(s, e) {
983
983
  "blue",
984
984
  "items",
985
985
  "properties",
986
- V
986
+ M
987
987
  ].includes(t))
988
988
  return r;
989
989
  if (typeof e == "number" || typeof e == "string" && /^\d+$/.test(e)) {
@@ -992,25 +992,25 @@ function ut(s, e) {
992
992
  }
993
993
  return s.getProperties()?.[t];
994
994
  }
995
- return Array.isArray(s) || F(s) ? s[e] : s;
995
+ return Array.isArray(s) || k(s) ? s[e] : s;
996
996
  }
997
- function N(s) {
997
+ function C(s) {
998
998
  if (s instanceof c) return s;
999
- if (s === null || typeof s == "string" || typeof s == "number" || typeof s == "boolean" || O(s))
1000
- return g.deserialize(s);
1001
- const e = He(s);
1002
- return g.deserialize(e);
999
+ if (s === null || typeof s == "string" || typeof s == "number" || typeof s == "boolean" || $(s))
1000
+ return y.deserialize(s);
1001
+ const e = tt(s);
1002
+ return y.deserialize(e);
1003
1003
  }
1004
- function He(s) {
1004
+ function tt(s) {
1005
1005
  if (s === void 0) return null;
1006
1006
  if (s === null || typeof s != "object") return s;
1007
- if (Array.isArray(s)) return s.map(He);
1007
+ if (Array.isArray(s)) return s.map(tt);
1008
1008
  const e = {};
1009
1009
  for (const [t, r] of Object.entries(s))
1010
- e[t] = He(r);
1010
+ e[t] = tt(r);
1011
1011
  return e;
1012
1012
  }
1013
- function dt(s, e, t) {
1013
+ function gt(s, e, t) {
1014
1014
  if (s instanceof c) {
1015
1015
  const r = e;
1016
1016
  switch (r) {
@@ -1022,22 +1022,22 @@ function dt(s, e, t) {
1022
1022
  return;
1023
1023
  case "type":
1024
1024
  s.setType(
1025
- t instanceof c || typeof t == "string" || t === void 0 ? t : N(t)
1025
+ t instanceof c || typeof t == "string" || t === void 0 ? t : C(t)
1026
1026
  );
1027
1027
  return;
1028
1028
  case "itemType":
1029
1029
  s.setItemType(
1030
- t instanceof c || typeof t == "string" || t === void 0 ? t : N(t)
1030
+ t instanceof c || typeof t == "string" || t === void 0 ? t : C(t)
1031
1031
  );
1032
1032
  return;
1033
1033
  case "keyType":
1034
1034
  s.setKeyType(
1035
- t instanceof c || typeof t == "string" || t === void 0 ? t : N(t)
1035
+ t instanceof c || typeof t == "string" || t === void 0 ? t : C(t)
1036
1036
  );
1037
1037
  return;
1038
1038
  case "valueType":
1039
1039
  s.setValueType(
1040
- t instanceof c || typeof t == "string" || t === void 0 ? t : N(t)
1040
+ t instanceof c || typeof t == "string" || t === void 0 ? t : C(t)
1041
1041
  );
1042
1042
  return;
1043
1043
  case "value": {
@@ -1050,7 +1050,7 @@ function dt(s, e, t) {
1050
1050
  return;
1051
1051
  case "blue":
1052
1052
  s.setBlue(
1053
- t instanceof c || t === void 0 ? t : N(t)
1053
+ t instanceof c || t === void 0 ? t : C(t)
1054
1054
  );
1055
1055
  return;
1056
1056
  case "items":
@@ -1059,7 +1059,7 @@ function dt(s, e, t) {
1059
1059
  case "properties":
1060
1060
  s.setProperties(t);
1061
1061
  return;
1062
- case V:
1062
+ case M:
1063
1063
  s.setContracts(t);
1064
1064
  return;
1065
1065
  default: {
@@ -1067,14 +1067,14 @@ function dt(s, e, t) {
1067
1067
  const n = s.getProperties();
1068
1068
  n && r in n && delete n[r];
1069
1069
  } else
1070
- s.getProperties() || s.setProperties({}), s.addProperty(r, t instanceof c ? t : N(t));
1070
+ s.getProperties() || s.setProperties({}), s.addProperty(r, t instanceof c ? t : C(t));
1071
1071
  return;
1072
1072
  }
1073
1073
  }
1074
1074
  }
1075
- Array.isArray(s) ? s.splice(se(e), 1) : F(s) && (t === void 0 ? delete s[e] : s[e] = t);
1075
+ Array.isArray(s) ? s.splice(ie(e), 1) : k(s) && (t === void 0 ? delete s[e] : s[e] = t);
1076
1076
  }
1077
- function _r(s, e, t, r) {
1077
+ function jr(s, e, t, r) {
1078
1078
  let n = -1;
1079
1079
  if (e !== "-" && (n = typeof e == "number" ? e : parseInt(e, 10), isNaN(n)))
1080
1080
  throw new Error(
@@ -1094,27 +1094,27 @@ function _r(s, e, t, r) {
1094
1094
  if (n < i.length) i[n] = t;
1095
1095
  else {
1096
1096
  for (let o = i.length; o < n; o++)
1097
- i.push(g.deserialize(null));
1097
+ i.push(y.deserialize(null));
1098
1098
  i.push(t);
1099
1099
  }
1100
1100
  } else
1101
1101
  i.splice(n, 0, t);
1102
1102
  }
1103
- function Ve(s, e, t, r) {
1103
+ function De(s, e, t, r) {
1104
1104
  if (Array.isArray(s)) {
1105
- const n = e === "-" ? s.length : se(e);
1105
+ const n = e === "-" ? s.length : ie(e);
1106
1106
  if (!r && n > s.length)
1107
1107
  throw new Error(
1108
1108
  `ADD operation failed: Target array index '${n}' is greater than array length ${s.length}. Path involving key '${e}'.`
1109
1109
  );
1110
1110
  if (n < 0 && e !== "-")
1111
1111
  throw new Error(`Invalid negative array index: ${e}`);
1112
- const i = N(t);
1112
+ const i = C(t);
1113
1113
  if (r) {
1114
1114
  if (n >= 0 && n < s.length) s[n] = i;
1115
1115
  else if (n >= s.length) {
1116
1116
  for (let o = s.length; o < n; o++)
1117
- s.push(g.deserialize(null));
1117
+ s.push(y.deserialize(null));
1118
1118
  s.push(i);
1119
1119
  }
1120
1120
  } else
@@ -1122,18 +1122,18 @@ function Ve(s, e, t, r) {
1122
1122
  return;
1123
1123
  }
1124
1124
  if (s instanceof c) {
1125
- e === "-" || typeof e == "number" && !isNaN(e) || typeof e == "string" && /^\d+$/.test(e) ? _r(s, e, N(t), r) : dt(s, e, t);
1125
+ e === "-" || typeof e == "number" && !isNaN(e) || typeof e == "string" && /^\d+$/.test(e) ? jr(s, e, C(t), r) : gt(s, e, t);
1126
1126
  return;
1127
1127
  }
1128
- if (F(s)) {
1129
- s[e] = N(t);
1128
+ if (k(s)) {
1129
+ s[e] = C(t);
1130
1130
  return;
1131
1131
  }
1132
1132
  throw new Error(`Cannot insert into parent of type ${typeof s}`);
1133
1133
  }
1134
- function Lr(s, e) {
1134
+ function Ur(s, e) {
1135
1135
  if (Array.isArray(s)) {
1136
- const t = se(e);
1136
+ const t = ie(e);
1137
1137
  t === -1 && e === "-" ? s.length > 0 && s.pop() : t >= 0 && t < s.length && s.splice(t, 1);
1138
1138
  return;
1139
1139
  }
@@ -1141,127 +1141,127 @@ function Lr(s, e) {
1141
1141
  if (typeof e == "number" || typeof e == "string" && /^-?\d+$/.test(e)) {
1142
1142
  const t = s.getItems();
1143
1143
  if (t) {
1144
- const r = se(e);
1144
+ const r = ie(e);
1145
1145
  r === -1 && e === "-" ? t.length > 0 && t.pop() : r >= 0 && r < t.length && t.splice(r, 1), t.length === 0 && s.setItems(void 0);
1146
1146
  return;
1147
1147
  }
1148
1148
  }
1149
- dt(s, e, void 0);
1150
- } else F(s) && delete s[e];
1149
+ gt(s, e, void 0);
1150
+ } else k(s) && delete s[e];
1151
1151
  }
1152
- function Xe(s) {
1152
+ function rt(s) {
1153
1153
  if (s instanceof c) return s.clone();
1154
1154
  if (Array.isArray(s))
1155
- return s.map((t) => Xe(t));
1156
- if (F(s)) {
1155
+ return s.map((t) => rt(t));
1156
+ if (k(s)) {
1157
1157
  const e = {};
1158
1158
  return Object.keys(s).forEach((t) => {
1159
- e[t] = Xe(s[t]);
1159
+ e[t] = rt(s[t]);
1160
1160
  }), e;
1161
1161
  }
1162
1162
  return s;
1163
1163
  }
1164
- function Y(s, e) {
1165
- if (s === e || s instanceof c && (s.isInlineValue() || s.getValue() !== void 0) && Y(s.getValue() ?? null, e) || e instanceof c && (e.isInlineValue() || e.getValue() !== void 0) && Y(s, e.getValue() ?? null))
1164
+ function W(s, e) {
1165
+ if (s === e || s instanceof c && (s.isInlineValue() || s.getValue() !== void 0) && W(s.getValue() ?? null, e) || e instanceof c && (e.isInlineValue() || e.getValue() !== void 0) && W(s, e.getValue() ?? null))
1166
1166
  return !0;
1167
- if (s instanceof c && e instanceof c || O(s) && O(e) || O(s) && typeof e == "number" || typeof s == "number" && O(e))
1167
+ if (s instanceof c && e instanceof c || $(s) && $(e) || $(s) && typeof e == "number" || typeof s == "number" && $(e))
1168
1168
  return s.toString() === e.toString();
1169
1169
  if (Array.isArray(s) && Array.isArray(e))
1170
- return s.length === e.length && s.every((t, r) => Y(t, e[r]));
1171
- if (F(s) && F(e)) {
1170
+ return s.length === e.length && s.every((t, r) => W(t, e[r]));
1171
+ if (k(s) && k(e)) {
1172
1172
  const t = Object.keys(s), r = Object.keys(e);
1173
- return t.length === r.length && t.every((n) => Y(s[n], e[n]));
1173
+ return t.length === r.length && t.every((n) => W(s[n], e[n]));
1174
1174
  }
1175
1175
  return !1;
1176
1176
  }
1177
- function kt(s, e) {
1178
- const { parent: t, key: r } = le(s, oe(e));
1179
- return ut(t, r);
1177
+ function Jt(s, e) {
1178
+ const { parent: t, key: r } = ce(s, ae(e));
1179
+ return yt(t, r);
1180
1180
  }
1181
- function Kt(s, e, t) {
1182
- const r = oe(e);
1181
+ function Wt(s, e, t) {
1182
+ const r = ae(e);
1183
1183
  if (r.length === 0 && e === "/") {
1184
- const o = N(t);
1184
+ const o = C(t);
1185
1185
  s.setValue(o.getValue() ?? null), o.getItems() ? s.setItems(o.getItems()) : s.setItems(void 0);
1186
1186
  return;
1187
1187
  }
1188
- const { parent: n, key: i } = le(s, r);
1189
- Ve(n, i, t, !0);
1188
+ const { parent: n, key: i } = ce(s, r);
1189
+ De(n, i, t, !0);
1190
1190
  }
1191
- function jr(s, e, t) {
1192
- const r = oe(e);
1191
+ function kr(s, e, t) {
1192
+ const r = ae(e);
1193
1193
  if (r.length === 0 && e === "/") {
1194
1194
  if (s.getItems() && Array.isArray(t)) {
1195
- const o = N(t);
1195
+ const o = C(t);
1196
1196
  o.getItems() ? (s.setItems(o.getItems()), s.setValue(null)) : (s.setValue(o.getValue() ?? null), s.setItems(void 0));
1197
1197
  } else {
1198
- const o = N(t);
1198
+ const o = C(t);
1199
1199
  s.setValue(o.getValue() ?? null), o.getItems() && s.setItems(o.getItems());
1200
1200
  }
1201
1201
  return !0;
1202
1202
  }
1203
- const { parent: n, key: i } = le(s, r);
1204
- return Ve(n, i, t, !1), !0;
1203
+ const { parent: n, key: i } = ce(s, r);
1204
+ return De(n, i, t, !1), !0;
1205
1205
  }
1206
- function Ur(s, e, t) {
1207
- const r = oe(e);
1206
+ function Kr(s, e, t) {
1207
+ const r = ae(e);
1208
1208
  if (r.length === 0 && e === "/") {
1209
- const l = N(t);
1209
+ const l = C(t);
1210
1210
  return s.setValue(l.getValue() ?? null), l.getItems() ? s.setItems(l.getItems()) : s.setItems(void 0), !0;
1211
1211
  }
1212
- const { parent: n, key: i, actualTarget: o } = le(s, r);
1212
+ const { parent: n, key: i, actualTarget: o } = ce(s, r);
1213
1213
  if (o !== void 0 && n instanceof c)
1214
- dt(n, i, t);
1214
+ gt(n, i, t);
1215
1215
  else {
1216
- const l = ut(n, i), a = Array.isArray(n) || n instanceof c && n.getItems() && (typeof i == "number" || typeof i == "string" && /^\d+$/.test(i));
1216
+ const l = yt(n, i), a = Array.isArray(n) || n instanceof c && n.getItems() && (typeof i == "number" || typeof i == "string" && /^\d+$/.test(i));
1217
1217
  if (l === void 0) {
1218
1218
  if (a)
1219
1219
  throw new Error(
1220
1220
  `REPLACE failed: Target array index '${i.toString()}' is out of bounds or does not exist at path '${e}'.`
1221
1221
  );
1222
- Ve(n, i, t, !0);
1222
+ De(n, i, t, !0);
1223
1223
  } else
1224
- Ve(n, i, t, !0);
1224
+ De(n, i, t, !0);
1225
1225
  }
1226
1226
  return !0;
1227
1227
  }
1228
- function Yt(s, e) {
1229
- const t = oe(e);
1228
+ function Zt(s, e) {
1229
+ const t = ae(e);
1230
1230
  if (t.length === 0 && e === "/")
1231
1231
  return s.setValue(null), s.setItems(void 0), s.setProperties(void 0), !0;
1232
- const { parent: r, key: n } = le(s, t);
1233
- return Lr(r, n), !0;
1232
+ const { parent: r, key: n } = ce(s, t);
1233
+ return Ur(r, n), !0;
1234
1234
  }
1235
- function kr(s, e, t) {
1236
- const r = Xe(kt(s, e));
1237
- return Kt(s, t, r), !0;
1235
+ function Yr(s, e, t) {
1236
+ const r = rt(Jt(s, e));
1237
+ return Wt(s, t, r), !0;
1238
1238
  }
1239
- function Kr(s, e, t) {
1240
- const r = oe(e), { parent: n, key: i } = le(s, r), o = ut(n, i);
1239
+ function zr(s, e, t) {
1240
+ const r = ae(e), { parent: n, key: i } = ce(s, r), o = yt(n, i);
1241
1241
  if (o === void 0)
1242
1242
  throw new Error(`MOVE failed: 'from' location '${e}' does not exist.`);
1243
- return Yt(s, e) ? (Kt(s, t, o), !0) : !1;
1243
+ return Zt(s, e) ? (Wt(s, t, o), !0) : !1;
1244
1244
  }
1245
- function Yr(s, e, t) {
1246
- const r = kt(s, e);
1245
+ function Gr(s, e, t) {
1246
+ const r = Jt(s, e);
1247
1247
  let n = t;
1248
1248
  if (r instanceof c)
1249
- if ((t === null || typeof t == "string" || typeof t == "number" || typeof t == "boolean" || O(t)) && (r.isInlineValue() || r.getValue() !== void 0)) {
1250
- if (!Y(r.getValue() ?? null, t))
1249
+ if ((t === null || typeof t == "string" || typeof t == "number" || typeof t == "boolean" || $(t)) && (r.isInlineValue() || r.getValue() !== void 0)) {
1250
+ if (!W(r.getValue() ?? null, t))
1251
1251
  throw new Error(
1252
1252
  `TEST failed at '${e}': Expected ${JSON.stringify(
1253
1253
  t
1254
1254
  )}, got ${JSON.stringify(r.getValue() ?? null)}`
1255
1255
  );
1256
1256
  return !0;
1257
- } else typeof t == "object" && !(t instanceof c) && (n = N(t));
1258
- else if (O(r) && typeof t == "number")
1259
- r instanceof E ? n = new E(t.toString()) : r instanceof S && (n = new S(t.toString()));
1260
- else if ((r === null || typeof r == "string" || typeof r == "number" || typeof r == "boolean") && O(t)) {
1257
+ } else typeof t == "object" && !(t instanceof c) && (n = C(t));
1258
+ else if ($(r) && typeof t == "number")
1259
+ r instanceof N ? n = new N(t.toString()) : r instanceof A && (n = new A(t.toString()));
1260
+ else if ((r === null || typeof r == "string" || typeof r == "number" || typeof r == "boolean") && $(t)) {
1261
1261
  const i = t;
1262
- !Y(r, i.toString()) && (typeof r == "number" && parseFloat(i.toString()));
1262
+ !W(r, i.toString()) && (typeof r == "number" && parseFloat(i.toString()));
1263
1263
  }
1264
- if (!Y(r, n)) {
1264
+ if (!W(r, n)) {
1265
1265
  const i = r instanceof c ? r.toString() : JSON.stringify(r), o = n instanceof c ? n.toString() : JSON.stringify(n);
1266
1266
  throw new Error(
1267
1267
  `TEST failed at '${e}': Expected ${o}, got ${i}`
@@ -1269,93 +1269,93 @@ function Yr(s, e, t) {
1269
1269
  }
1270
1270
  return !0;
1271
1271
  }
1272
- function zr(s, e) {
1272
+ function Jr(s, e) {
1273
1273
  switch (e.op) {
1274
1274
  case "add":
1275
- return jr(s, e.path, e.val);
1275
+ return kr(s, e.path, e.val);
1276
1276
  case "replace":
1277
- return Ur(s, e.path, e.val);
1277
+ return Kr(s, e.path, e.val);
1278
1278
  case "remove":
1279
- return Yt(s, e.path);
1279
+ return Zt(s, e.path);
1280
1280
  case "copy":
1281
- return kr(s, e.from, e.path);
1281
+ return Yr(s, e.from, e.path);
1282
1282
  case "move":
1283
- return Kr(s, e.from, e.path);
1283
+ return zr(s, e.from, e.path);
1284
1284
  case "test":
1285
- return Yr(s, e.path, e.val);
1285
+ return Gr(s, e.path, e.val);
1286
1286
  }
1287
1287
  }
1288
- function Kn(s, e, t = !1) {
1288
+ function zn(s, e, t = !1) {
1289
1289
  const r = t ? s : s.clone();
1290
- return zr(r, e), r;
1290
+ return Jr(r, e), r;
1291
1291
  }
1292
- const Ye = Symbol.for("zod-schema-annotations");
1293
- function Gr() {
1292
+ const Ze = Symbol.for("zod-schema-annotations");
1293
+ function Wr() {
1294
1294
  if (typeof globalThis < "u") return globalThis;
1295
1295
  if (typeof global < "u") return global;
1296
1296
  if (typeof window < "u") return window;
1297
1297
  if (typeof self < "u") return self;
1298
1298
  throw new Error("Unable to locate global object");
1299
1299
  }
1300
- function zt() {
1301
- const s = Gr();
1302
- return Ye in s || (s[Ye] = /* @__PURE__ */ new WeakMap()), s[Ye];
1300
+ function Ht() {
1301
+ const s = Wr();
1302
+ return Ze in s || (s[Ze] = /* @__PURE__ */ new WeakMap()), s[Ze];
1303
1303
  }
1304
- function Ie(s, e) {
1305
- const t = zt(), r = t.get(s) || {};
1304
+ function ve(s, e) {
1305
+ const t = Ht(), r = t.get(s) || {};
1306
1306
  return t.set(s, { ...r, ...e }), s;
1307
1307
  }
1308
- const R = (s) => zt().get(s), Jr = (s) => (e) => {
1309
- const t = R(e);
1310
- return Ie(e, {
1308
+ const D = (s) => Ht().get(s), Zr = (s) => (e) => {
1309
+ const t = D(e);
1310
+ return ve(e, {
1311
1311
  ...t,
1312
1312
  blueDescription: s
1313
1313
  });
1314
- }, Wr = (s) => {
1315
- const e = R(s);
1316
- return d(e) && rt(e.blueDescription) ? e.blueDescription : null;
1317
- }, Yn = (s) => Jr(s)(h.string().optional()), Zr = h.union([h.string(), h.boolean()]), Hr = (s) => (e) => {
1318
- const t = R(e);
1319
- return Ie(e, {
1314
+ }, Hr = (s) => {
1315
+ const e = D(s);
1316
+ return d(e) && lt(e.blueDescription) ? e.blueDescription : null;
1317
+ }, Gn = (s) => Zr(s)(p.string().optional()), Xr = p.union([p.string(), p.boolean()]), qr = (s) => (e) => {
1318
+ const t = D(e);
1319
+ return ve(e, {
1320
1320
  ...t,
1321
1321
  blueId: s
1322
1322
  });
1323
- }, Xr = (s) => {
1324
- const e = R(s), t = Zr.safeParse(e?.blueId);
1323
+ }, Qr = (s) => {
1324
+ const e = D(s), t = Xr.safeParse(e?.blueId);
1325
1325
  return t.success ? t.data : null;
1326
- }, zn = (s) => Hr(s ?? !0)(h.string()), qr = (s) => (e) => {
1327
- const t = R(e);
1328
- return Ie(e, {
1326
+ }, Jn = (s) => qr(s ?? !0)(p.string()), es = (s) => (e) => {
1327
+ const t = D(e);
1328
+ return ve(e, {
1329
1329
  ...t,
1330
1330
  blueName: s
1331
1331
  });
1332
- }, Qr = (s) => {
1333
- const e = R(s);
1334
- return d(e) && rt(e.blueName) ? e.blueName : null;
1335
- }, Gn = (s) => {
1336
- const e = h.string().optional();
1337
- return qr(s)(e);
1338
- }, es = () => (s) => {
1339
- const e = R(s);
1340
- return Ie(s, {
1332
+ }, ts = (s) => {
1333
+ const e = D(s);
1334
+ return d(e) && lt(e.blueName) ? e.blueName : null;
1335
+ }, Wn = (s) => {
1336
+ const e = p.string().optional();
1337
+ return es(s)(e);
1338
+ }, rs = () => (s) => {
1339
+ const e = D(s);
1340
+ return ve(s, {
1341
1341
  ...e,
1342
1342
  blueNode: !0
1343
1343
  });
1344
- }, ts = (s) => {
1345
- const e = R(s);
1344
+ }, ss = (s) => {
1345
+ const e = D(s);
1346
1346
  return d(e) && d(e.blueNode) && e.blueNode === !0 ? e.blueNode : null;
1347
- }, Gt = (s) => !!ts(s), Jn = () => {
1348
- const s = h.instanceof(c);
1349
- return es()(s);
1350
- }, rs = h.object({
1351
- value: h.array(h.string()).optional(),
1352
- defaultValue: h.string().optional()
1353
- }), ss = (s) => {
1354
- const e = R(s), t = rs.passthrough().safeParse(e?.typeBlueId);
1347
+ }, Xt = (s) => !!ss(s), Zn = () => {
1348
+ const s = p.instanceof(c);
1349
+ return rs()(s);
1350
+ }, ns = p.object({
1351
+ value: p.array(p.string()).optional(),
1352
+ defaultValue: p.string().optional()
1353
+ }), is = (s) => {
1354
+ const e = D(s), t = ns.passthrough().safeParse(e?.typeBlueId);
1355
1355
  return t.success ? t.data : null;
1356
- }, Wn = (s) => (e) => {
1357
- const t = R(e), r = typeof s == "string" ? { value: [s] } : s;
1358
- return Ie(e, {
1356
+ }, Hn = (s) => (e) => {
1357
+ const t = D(e), r = typeof s == "string" ? { value: [s] } : s;
1358
+ return ve(e, {
1359
1359
  ...t,
1360
1360
  typeBlueId: {
1361
1361
  ...t?.typeBlueId || {},
@@ -1363,32 +1363,32 @@ const R = (s) => zt().get(s), Jr = (s) => (e) => {
1363
1363
  }
1364
1364
  });
1365
1365
  };
1366
- class pe {
1366
+ class fe {
1367
1367
  static resolveBlueId(e) {
1368
- const t = ss(e);
1368
+ const t = is(e);
1369
1369
  if (m(t))
1370
1370
  return null;
1371
1371
  const r = t.defaultValue;
1372
1372
  if (d(r))
1373
1373
  return r;
1374
1374
  const n = t.value?.[0];
1375
- return d(n) ? n : pe.getRepositoryBlueId(t, e);
1375
+ return d(n) ? n : fe.getRepositoryBlueId(t, e);
1376
1376
  }
1377
1377
  static getRepositoryBlueId(e, t) {
1378
1378
  throw new Error("Not implemented");
1379
1379
  }
1380
1380
  }
1381
- class A {
1381
+ class O {
1382
1382
  // TODO: Enhance to support schemas associated with multiple blueIds
1383
1383
  static isTypeOf(e, t, r) {
1384
- const n = pe.resolveBlueId(t), i = e.getType()?.getBlueId();
1384
+ const n = fe.resolveBlueId(t), i = e.getType()?.getBlueId();
1385
1385
  if (m(n) || m(i))
1386
1386
  return !1;
1387
1387
  if (n === i)
1388
1388
  return !0;
1389
1389
  if (r?.checkSchemaExtensions && d(r.typeSchemaResolver)) {
1390
1390
  const o = r.typeSchemaResolver.resolveSchema(e);
1391
- return A.checkSchemaExtension(o, t, {
1391
+ return O.checkSchemaExtension(o, t, {
1392
1392
  typeSchemaResolver: r.typeSchemaResolver
1393
1393
  });
1394
1394
  }
@@ -1400,29 +1400,29 @@ class A {
1400
1400
  static checkSchemaExtension(e, t, r) {
1401
1401
  if (!d(e))
1402
1402
  return !1;
1403
- const n = A.unwrapSchema(e), i = A.unwrapSchema(t);
1403
+ const n = O.unwrapSchema(e), i = O.unwrapSchema(t);
1404
1404
  return d(r?.typeSchemaResolver) ? r.typeSchemaResolver.isSchemaExtendedFrom(
1405
1405
  n,
1406
1406
  i
1407
1407
  ) : !1;
1408
1408
  }
1409
1409
  static isWrapperType(e) {
1410
- return e instanceof Nt || e instanceof St || e instanceof Ct || e instanceof At || e instanceof Ne || e instanceof Se;
1410
+ return e instanceof Rt || e instanceof Ot || e instanceof Mt || e instanceof Dt || e instanceof Ve || e instanceof Re;
1411
1411
  }
1412
1412
  static unwrapSchema(e) {
1413
- return Gt(e) ? e : A.isWrapperType(e) ? e instanceof Ne ? A.unwrapSchema(e.innerType()) : e instanceof Se ? A.unwrapSchema(e.schema) : A.unwrapSchema(e.unwrap()) : e;
1413
+ return Xt(e) ? e : O.isWrapperType(e) ? e instanceof Ve ? O.unwrapSchema(e.innerType()) : e instanceof Re ? O.unwrapSchema(e.schema) : O.unwrapSchema(e.unwrap()) : e;
1414
1414
  }
1415
1415
  }
1416
- function Tt(s, e) {
1416
+ function Pt(s, e) {
1417
1417
  const t = s.getType();
1418
1418
  if (t === void 0)
1419
1419
  return;
1420
1420
  const r = t.getBlueId();
1421
1421
  if (r !== void 0) {
1422
- if (X.includes(
1422
+ if (te.includes(
1423
1423
  r
1424
1424
  )) {
1425
- const i = Fe[r];
1425
+ const i = je[r];
1426
1426
  return new c().setBlueId(r).setName(i);
1427
1427
  }
1428
1428
  const n = e.fetchByBlueId(r);
@@ -1436,18 +1436,18 @@ function Tt(s, e) {
1436
1436
  }
1437
1437
  return t;
1438
1438
  }
1439
- function b(s, e, t) {
1439
+ function w(s, e, t) {
1440
1440
  const r = T.calculateBlueIdSync(s), n = T.calculateBlueIdSync(e);
1441
1441
  if (r === n)
1442
1442
  return !0;
1443
- if (r && X.includes(
1443
+ if (r && te.includes(
1444
1444
  r
1445
1445
  )) {
1446
1446
  let a = e;
1447
1447
  for (; a !== void 0; ) {
1448
1448
  if (T.calculateBlueIdSync(a) === r)
1449
1449
  return !0;
1450
- a = Tt(a, t);
1450
+ a = Pt(a, t);
1451
1451
  }
1452
1452
  return !1;
1453
1453
  }
@@ -1461,57 +1461,57 @@ function b(s, e, t) {
1461
1461
  for (; l !== void 0; ) {
1462
1462
  if (T.calculateBlueIdSync(l) === n)
1463
1463
  return !0;
1464
- l = Tt(l, t);
1464
+ l = Pt(l, t);
1465
1465
  }
1466
1466
  return !1;
1467
1467
  }
1468
- function ns(s, e) {
1469
- return at.some((t) => {
1468
+ function os(s, e) {
1469
+ return ht.some((t) => {
1470
1470
  const r = new c().setBlueId(t);
1471
- return b(s, r, e);
1471
+ return w(s, r, e);
1472
1472
  });
1473
1473
  }
1474
- function is(s, e) {
1475
- const t = new c().setBlueId(_);
1476
- return b(s, t, e);
1477
- }
1478
- function os(s, e) {
1479
- const t = new c().setBlueId(j);
1480
- return b(s, t, e);
1481
- }
1482
1474
  function ls(s, e) {
1483
- const t = new c().setBlueId(L);
1484
- return b(s, t, e);
1475
+ const t = new c().setBlueId(Y);
1476
+ return w(s, t, e);
1485
1477
  }
1486
1478
  function as(s, e) {
1487
- const t = new c().setBlueId(U);
1488
- return b(s, t, e);
1479
+ const t = new c().setBlueId(G);
1480
+ return w(s, t, e);
1489
1481
  }
1490
- function Jt(s, e) {
1491
- const t = new c().setBlueId(ot);
1492
- return b(s, t, e);
1482
+ function cs(s, e) {
1483
+ const t = new c().setBlueId(z);
1484
+ return w(s, t, e);
1485
+ }
1486
+ function us(s, e) {
1487
+ const t = new c().setBlueId(J);
1488
+ return w(s, t, e);
1493
1489
  }
1494
- function Wt(s, e) {
1495
- const t = new c().setBlueId(lt);
1496
- return b(s, t, e);
1490
+ function Ee(s, e) {
1491
+ const t = new c().setBlueId(dt);
1492
+ return w(s, t, e);
1497
1493
  }
1498
- function cs(s, e) {
1499
- return xe.some((t) => {
1494
+ function Ne(s, e) {
1495
+ const t = new c().setBlueId(pt);
1496
+ return w(s, t, e);
1497
+ }
1498
+ function ds(s, e) {
1499
+ return Le.some((t) => {
1500
1500
  const r = new c().setName(t);
1501
- return b(s, r, e);
1501
+ return w(s, r, e);
1502
1502
  });
1503
1503
  }
1504
- function us(s, e) {
1505
- for (const t of xe) {
1504
+ function ps(s, e) {
1505
+ for (const t of Le) {
1506
1506
  const r = new c().setName(t);
1507
- if (b(s, r, e))
1507
+ if (w(s, r, e))
1508
1508
  return t;
1509
1509
  }
1510
1510
  throw new Error(
1511
1511
  `Cannot determine the basic type for node of type "${s.getName() || "unknown"}".`
1512
1512
  );
1513
1513
  }
1514
- class ds {
1514
+ class hs {
1515
1515
  blueIdMap = /* @__PURE__ */ new Map();
1516
1516
  nodeProvider;
1517
1517
  constructor(e = [], t) {
@@ -1522,7 +1522,7 @@ class ds {
1522
1522
  this.registerSchema(t);
1523
1523
  }
1524
1524
  registerSchema(e) {
1525
- const t = pe.resolveBlueId(e);
1525
+ const t = fe.resolveBlueId(e);
1526
1526
  if (d(t)) {
1527
1527
  if (this.blueIdMap.has(t))
1528
1528
  throw new Error(`Duplicate BlueId value: ${t}`);
@@ -1547,7 +1547,7 @@ class ds {
1547
1547
  if (d(this.nodeProvider))
1548
1548
  try {
1549
1549
  const i = new c().setBlueId(r), o = new c().setBlueId(n);
1550
- if (b(i, o, this.nodeProvider))
1550
+ if (w(i, o, this.nodeProvider))
1551
1551
  return !0;
1552
1552
  } catch {
1553
1553
  }
@@ -1556,7 +1556,7 @@ class ds {
1556
1556
  getBlueIdForSchema(e) {
1557
1557
  if (m(e))
1558
1558
  return null;
1559
- const t = pe.resolveBlueId(e);
1559
+ const t = fe.resolveBlueId(e);
1560
1560
  if (d(t))
1561
1561
  return t;
1562
1562
  for (const [r, n] of this.blueIdMap)
@@ -1572,7 +1572,7 @@ class ds {
1572
1572
  return new Map(this.blueIdMap);
1573
1573
  }
1574
1574
  }
1575
- const P = {
1575
+ const S = {
1576
1576
  NAME: "name",
1577
1577
  DESCRIPTION: "description",
1578
1578
  TYPE: "type",
@@ -1585,7 +1585,7 @@ const P = {
1585
1585
  BLUE: "blue",
1586
1586
  ITEMS: "items"
1587
1587
  };
1588
- class _e {
1588
+ class ke {
1589
1589
  /**
1590
1590
  * Check if a node is empty (has no fields set)
1591
1591
  */
@@ -1596,13 +1596,13 @@ class _e {
1596
1596
  * Check if a node has only a Blue ID
1597
1597
  */
1598
1598
  static hasBlueIdOnly(e) {
1599
- return this.hasFieldsAndMayHaveFields(e, /* @__PURE__ */ new Set([P.BLUE_ID]));
1599
+ return this.hasFieldsAndMayHaveFields(e, /* @__PURE__ */ new Set([S.BLUE_ID]));
1600
1600
  }
1601
1601
  /**
1602
1602
  * Check if a node has only items
1603
1603
  */
1604
1604
  static hasItemsOnly(e) {
1605
- return this.hasFieldsAndMayHaveFields(e, /* @__PURE__ */ new Set([P.ITEMS]));
1605
+ return this.hasFieldsAndMayHaveFields(e, /* @__PURE__ */ new Set([S.ITEMS]));
1606
1606
  }
1607
1607
  /**
1608
1608
  * Check if a node is a valid value node (has a value, no properties, no items)
@@ -1617,27 +1617,27 @@ class _e {
1617
1617
  * Create a text node
1618
1618
  */
1619
1619
  static textNode(e) {
1620
- return new c().setType(new c().setBlueId(_)).setValue(e);
1620
+ return new c().setType(new c().setBlueId(Y)).setValue(e);
1621
1621
  }
1622
1622
  /**
1623
1623
  * Create an integer node
1624
1624
  */
1625
1625
  static integerNode(e) {
1626
- const t = e instanceof E ? e : new E(e.toString());
1627
- return new c().setType(new c().setBlueId(j)).setValue(t);
1626
+ const t = e instanceof N ? e : new N(e.toString());
1627
+ return new c().setType(new c().setBlueId(G)).setValue(t);
1628
1628
  }
1629
1629
  /**
1630
1630
  * Create a double node
1631
1631
  */
1632
1632
  static doubleNode(e) {
1633
- const t = e instanceof S ? e : new S(e.toString());
1634
- return new c().setType(new c().setBlueId(L)).setValue(t);
1633
+ const t = e instanceof A ? e : new A(e.toString());
1634
+ return new c().setType(new c().setBlueId(z)).setValue(t);
1635
1635
  }
1636
1636
  /**
1637
1637
  * Create a boolean node
1638
1638
  */
1639
1639
  static booleanNode(e) {
1640
- return new c().setType(new c().setBlueId(U)).setValue(e);
1640
+ return new c().setType(new c().setBlueId(J)).setValue(e);
1641
1641
  }
1642
1642
  /**
1643
1643
  * Check if a node has exactly the specified fields
@@ -1647,7 +1647,7 @@ class _e {
1647
1647
  * @returns true if the node matches the field requirements
1648
1648
  */
1649
1649
  static hasFieldsAndMayHaveFields(e, t = /* @__PURE__ */ new Set(), r = /* @__PURE__ */ new Set()) {
1650
- for (const n of Object.values(P)) {
1650
+ for (const n of Object.values(S)) {
1651
1651
  const i = d(this.getFieldValue(e, n));
1652
1652
  if (t.has(n)) {
1653
1653
  if (!i) return !1;
@@ -1662,39 +1662,39 @@ class _e {
1662
1662
  */
1663
1663
  static getFieldValue(e, t) {
1664
1664
  switch (t) {
1665
- case P.NAME:
1665
+ case S.NAME:
1666
1666
  return e.getName();
1667
- case P.TYPE:
1667
+ case S.TYPE:
1668
1668
  return e.getType();
1669
- case P.VALUE:
1669
+ case S.VALUE:
1670
1670
  return e.getValue();
1671
- case P.DESCRIPTION:
1671
+ case S.DESCRIPTION:
1672
1672
  return e.getDescription();
1673
- case P.PROPERTIES:
1673
+ case S.PROPERTIES:
1674
1674
  return e.getProperties();
1675
- case P.BLUE:
1675
+ case S.BLUE:
1676
1676
  return e.getBlue();
1677
- case P.ITEMS:
1677
+ case S.ITEMS:
1678
1678
  return e.getItems();
1679
- case P.KEY_TYPE:
1679
+ case S.KEY_TYPE:
1680
1680
  return e.getKeyType();
1681
- case P.VALUE_TYPE:
1681
+ case S.VALUE_TYPE:
1682
1682
  return e.getValueType();
1683
- case P.ITEM_TYPE:
1683
+ case S.ITEM_TYPE:
1684
1684
  return e.getItemType();
1685
- case P.BLUE_ID:
1685
+ case S.BLUE_ID:
1686
1686
  return e.getBlueId();
1687
1687
  default:
1688
1688
  throw new Error(`Unknown field: ${t}`);
1689
1689
  }
1690
1690
  }
1691
1691
  }
1692
- class pt {
1692
+ class mt {
1693
1693
  }
1694
- class ce {
1694
+ class de {
1695
1695
  static convert(e) {
1696
- const t = new qe();
1697
- return ce.traverseNode(e, "", t), t.build();
1696
+ const t = new st();
1697
+ return de.traverseNode(e, "", t), t.build();
1698
1698
  }
1699
1699
  static traverseNode(e, t, r) {
1700
1700
  if (!e)
@@ -1706,21 +1706,21 @@ class ce {
1706
1706
  }
1707
1707
  if (n)
1708
1708
  for (const [a, u] of Object.entries(n)) {
1709
- const y = `${t}/${a}`;
1710
- ce.traverseNode(u, y, r);
1709
+ const f = `${t}/${a}`;
1710
+ de.traverseNode(u, f, r);
1711
1711
  }
1712
1712
  if (i)
1713
1713
  for (let a = 0; a < i.length; a++) {
1714
1714
  const u = `${t}/${a}`;
1715
- ce.traverseNode(i[a], u, r);
1715
+ de.traverseNode(i[a], u, r);
1716
1716
  }
1717
1717
  }
1718
1718
  }
1719
- function vt(s, e) {
1719
+ function Et(s, e) {
1720
1720
  const t = s.split(e), r = [...t].reverse().findIndex((i) => i !== ""), n = r === -1 ? 0 : t.length - r;
1721
1721
  return t.slice(0, n);
1722
1722
  }
1723
- class Le extends pt {
1723
+ class Ke extends mt {
1724
1724
  allowedPaths;
1725
1725
  maxDepth;
1726
1726
  currentPath = [];
@@ -1771,7 +1771,7 @@ class Le extends pt {
1771
1771
  * @returns True if the path matches the allowed path pattern, false otherwise
1772
1772
  */
1773
1773
  matchesAllowedPath(e, t) {
1774
- const r = vt(e, "/"), n = vt(t, "/");
1774
+ const r = Et(e, "/"), n = Et(t, "/");
1775
1775
  if (n.length > r.length)
1776
1776
  return !1;
1777
1777
  for (let i = 1; i < n.length; i++)
@@ -1813,7 +1813,7 @@ class Le extends pt {
1813
1813
  * @returns The path limits
1814
1814
  */
1815
1815
  static withMaxDepth(e) {
1816
- const t = new qe().setMaxDepth(e);
1816
+ const t = new st().setMaxDepth(e);
1817
1817
  for (let r = 1; r <= e; r++) {
1818
1818
  const n = "/" + Array(r).fill("*").join("/");
1819
1819
  t.addPath(n);
@@ -1826,17 +1826,17 @@ class Le extends pt {
1826
1826
  * @returns The path limits
1827
1827
  */
1828
1828
  static withSinglePath(e) {
1829
- return new qe().addPath(e).build();
1829
+ return new st().addPath(e).build();
1830
1830
  }
1831
1831
  /**
1832
1832
  * Creates path limits by analyzing the structure of a node.
1833
1833
  * Leaf paths (no properties and no items) are added as allowed paths.
1834
1834
  */
1835
1835
  static fromNode(e) {
1836
- return ce.convert(e);
1836
+ return de.convert(e);
1837
1837
  }
1838
1838
  }
1839
- class qe {
1839
+ class st {
1840
1840
  allowedPaths = /* @__PURE__ */ new Set();
1841
1841
  maxDepth = Number.MAX_SAFE_INTEGER;
1842
1842
  /**
@@ -1860,10 +1860,10 @@ class qe {
1860
1860
  * @returns The built PathLimits
1861
1861
  */
1862
1862
  build() {
1863
- return new Le(this.allowedPaths, this.maxDepth);
1863
+ return new Ke(this.allowedPaths, this.maxDepth);
1864
1864
  }
1865
1865
  }
1866
- class we extends pt {
1866
+ class Se extends mt {
1867
1867
  /**
1868
1868
  * Determines if a path segment should be extended - always returns true
1869
1869
  * @returns Always true
@@ -1889,7 +1889,7 @@ class we extends pt {
1889
1889
  exitPathSegment() {
1890
1890
  }
1891
1891
  }
1892
- class je extends pt {
1892
+ class Ye extends mt {
1893
1893
  limits;
1894
1894
  /**
1895
1895
  * Creates a composite limits with the specified limit strategies
@@ -1946,21 +1946,23 @@ class je extends pt {
1946
1946
  * @returns A new CompositeLimits instance
1947
1947
  */
1948
1948
  static of(...e) {
1949
- return new je(e);
1949
+ return new Ye(e);
1950
1950
  }
1951
1951
  }
1952
- const K = new we();
1953
- class ps {
1952
+ const _ = new Se();
1953
+ class fs {
1954
1954
  blue;
1955
1955
  constructor(e) {
1956
1956
  this.blue = e;
1957
1957
  }
1958
- matchesType(e, t, r = K) {
1959
- const n = t.getType();
1960
- if (this.matchesImplicitStructure(e, n))
1961
- return !0;
1962
- const i = Le.fromNode(t), o = je.of(r, i), l = this.extendAndResolve(e, o), a = this.blue.resolve(t, o);
1963
- return this.verifyMatch(l, t, o) && this.recursiveValueComparison(l, a);
1958
+ matchesType(e, t, r = _) {
1959
+ const n = Ke.fromNode(t), i = Ye.of(r, n), o = this.extendAndResolve(e, i), l = this.blue.resolve(t, i), a = this.expandSchemaOwnedTypeReferences(t);
1960
+ return this.verifyMatch(o, t, i) && this.recursiveValueComparison(
1961
+ o,
1962
+ l,
1963
+ a,
1964
+ i
1965
+ );
1964
1966
  }
1965
1967
  /**
1966
1968
  * Resolves a node with the runtime while preserving any structure that could
@@ -1988,9 +1990,9 @@ class ps {
1988
1990
  if (i) {
1989
1991
  let a = e.getProperties();
1990
1992
  a || (a = {}, e.setProperties(a));
1991
- for (const [u, y] of Object.entries(i)) {
1992
- const p = a[u];
1993
- p === void 0 ? a[u] = y.clone() : this.restoreMissingStructure(p, y);
1993
+ for (const [u, f] of Object.entries(i)) {
1994
+ const h = a[u];
1995
+ h === void 0 ? a[u] = f.clone() : this.restoreMissingStructure(h, f);
1994
1996
  }
1995
1997
  }
1996
1998
  const o = t.getBlueId();
@@ -2010,76 +2012,114 @@ class ps {
2010
2012
  }
2011
2013
  return !0;
2012
2014
  }
2013
- recursiveValueComparison(e, t) {
2014
- const r = t.getType(), n = this.matchesImplicitStructure(
2015
- e,
2016
- r
2017
- );
2018
- if (r && !n) {
2019
- const p = e.getType();
2020
- if (!p || !b(
2021
- p,
2022
- r,
2015
+ recursiveValueComparison(e, t, r = t, n = _) {
2016
+ const i = t.getType(), o = this.matchesImplicitStructure(e, i) || this.matchesImplicitCoreCollectionType(e, t);
2017
+ if (e.getType() === void 0 && this.isCoreCollectionType(t) && !o)
2018
+ return !1;
2019
+ if (i && !o) {
2020
+ const B = e.getType();
2021
+ if (!B || !w(
2022
+ B,
2023
+ i,
2023
2024
  this.blue.getNodeProvider()
2024
2025
  ))
2025
2026
  return !1;
2026
2027
  }
2027
- const i = t.getBlueId();
2028
- if (!n && i !== void 0) {
2029
- const p = e.getBlueId(), f = e.getType()?.getBlueId();
2030
- if (p !== void 0) {
2031
- if (i !== p)
2028
+ const l = t.getBlueId();
2029
+ if (!o && l !== void 0)
2030
+ if (this.isExplicitBlueIdMatcher(r)) {
2031
+ const B = e.getBlueId(), b = e.getType()?.getBlueId();
2032
+ if (B !== l && b !== l)
2032
2033
  return !1;
2033
- } else if (f === void 0 || i !== f)
2034
- return !1;
2035
- }
2036
- const o = t.getValue();
2037
- if (o !== void 0) {
2038
- const p = e.getValue();
2039
- if (p === void 0)
2034
+ } else {
2035
+ const B = e.getBlueId(), b = e.getType();
2036
+ if (b === void 0 && B !== void 0 && B !== l || b && !w(
2037
+ b,
2038
+ t,
2039
+ this.blue.getNodeProvider()
2040
+ ))
2041
+ return !1;
2042
+ }
2043
+ const a = t.getValue();
2044
+ if (a !== void 0) {
2045
+ const B = e.getValue();
2046
+ if (B === void 0)
2040
2047
  return !1;
2041
- if (C(p) && C(o)) {
2042
- if (!p.eq(o))
2048
+ if (R(B) && R(a)) {
2049
+ if (!B.eq(a))
2043
2050
  return !1;
2044
- } else if (p !== o)
2051
+ } else if (B !== a)
2045
2052
  return !1;
2046
2053
  }
2047
- const l = t.getItems();
2048
- if (l !== void 0) {
2049
- const p = e.getItems() ?? [];
2050
- for (let f = 0; f < l.length; f++)
2051
- if (f < p.length) {
2052
- if (!this.recursiveValueComparison(p[f], l[f]))
2054
+ const u = t.getItems(), f = r.getItems();
2055
+ if (u !== void 0) {
2056
+ const B = e.getItems() ?? [];
2057
+ for (let b = 0; b < u.length; b++)
2058
+ if (b < B.length) {
2059
+ if (!this.recursiveValueComparison(
2060
+ B[b],
2061
+ u[b],
2062
+ f?.[b] ?? u[b],
2063
+ n
2064
+ ))
2053
2065
  return !1;
2054
- } else if (this.hasValueInNestedStructure(l[f]))
2066
+ } else if (this.hasValueInNestedStructure(u[b]))
2055
2067
  return !1;
2056
2068
  }
2057
- const a = t.getItemType();
2058
- if (a !== void 0) {
2059
- const p = e.getItems() ?? [];
2060
- for (const f of p)
2061
- if (!this.recursiveValueComparison(f, a))
2069
+ const h = t.getItemType(), g = r.getItemType();
2070
+ if (h !== void 0) {
2071
+ const B = e.getItems() ?? [];
2072
+ for (const b of B)
2073
+ if (!this.recursiveValueComparison(
2074
+ this.resolveUntypedNodeAgainstMatcherType(
2075
+ b,
2076
+ h,
2077
+ g ?? h,
2078
+ n
2079
+ ),
2080
+ h,
2081
+ g ?? h,
2082
+ n
2083
+ ))
2062
2084
  return !1;
2063
2085
  }
2064
- const u = t.getProperties();
2065
- if (u !== void 0) {
2066
- const p = e.getProperties() ?? {};
2067
- for (const [f, v] of Object.entries(u))
2068
- if (f in p) {
2069
- if (!this.recursiveValueComparison(p[f], v))
2086
+ const v = t.getProperties(), x = r.getProperties();
2087
+ if (v !== void 0) {
2088
+ const B = e.getProperties() ?? {};
2089
+ for (const [b, ze] of Object.entries(v))
2090
+ if (b in B) {
2091
+ if (!this.recursiveValueComparison(
2092
+ B[b],
2093
+ ze,
2094
+ x?.[b] ?? ze,
2095
+ n
2096
+ ))
2070
2097
  return !1;
2071
- } else if (this.hasValueInNestedStructure(v))
2098
+ } else if (this.hasValueInNestedStructure(ze))
2072
2099
  return !1;
2073
2100
  }
2074
- const y = t.getValueType();
2075
- if (y !== void 0) {
2076
- const p = Object.values(e.getProperties() ?? {});
2077
- for (const f of p)
2078
- if (!this.recursiveValueComparison(f, y))
2101
+ const V = t.getValueType(), F = r.getValueType();
2102
+ if (V !== void 0) {
2103
+ const B = Object.values(e.getProperties() ?? {});
2104
+ for (const b of B)
2105
+ if (!this.recursiveValueComparison(
2106
+ this.resolveUntypedNodeAgainstMatcherType(
2107
+ b,
2108
+ V,
2109
+ F ?? V,
2110
+ n
2111
+ ),
2112
+ V,
2113
+ F ?? V,
2114
+ n
2115
+ ))
2079
2116
  return !1;
2080
2117
  }
2081
2118
  return !0;
2082
2119
  }
2120
+ resolveUntypedNodeAgainstMatcherType(e, t, r, n) {
2121
+ return e.getType() !== void 0 || this.isExplicitBlueIdMatcher(r) ? e : this.resolveAgainstTargetType(e, t, n) ?? e;
2122
+ }
2083
2123
  hasValueInNestedStructure(e) {
2084
2124
  if (e.getValue() !== void 0)
2085
2125
  return !0;
@@ -2102,7 +2142,13 @@ class ps {
2102
2142
  * shape of the requested core list or dictionary type.
2103
2143
  */
2104
2144
  matchesImplicitStructure(e, t) {
2105
- return t === void 0 || e.getType() !== void 0 ? !1 : Jt(t, this.blue.getNodeProvider()) ? this.isImplicitListStructure(e) : Wt(t, this.blue.getNodeProvider()) ? this.isImplicitDictionaryStructure(e) : !1;
2145
+ return t === void 0 || e.getType() !== void 0 ? !1 : Ee(t, this.blue.getNodeProvider()) ? this.isImplicitListStructure(e) : Ne(t, this.blue.getNodeProvider()) ? this.isImplicitDictionaryStructure(e) : !1;
2146
+ }
2147
+ matchesImplicitCoreCollectionType(e, t) {
2148
+ return e.getType() !== void 0 ? !1 : Ee(t, this.blue.getNodeProvider()) ? this.isImplicitListStructure(e) : Ne(t, this.blue.getNodeProvider()) ? this.isImplicitDictionaryStructure(e) : !1;
2149
+ }
2150
+ isCoreCollectionType(e) {
2151
+ return Ee(e, this.blue.getNodeProvider()) || Ne(e, this.blue.getNodeProvider());
2106
2152
  }
2107
2153
  isImplicitListStructure(e) {
2108
2154
  return e.getItems() !== void 0 && e.getValue() === void 0;
@@ -2110,76 +2156,145 @@ class ps {
2110
2156
  isImplicitDictionaryStructure(e) {
2111
2157
  return e.getProperties() !== void 0 && e.getValue() === void 0;
2112
2158
  }
2159
+ isBareBlueIdReference(e) {
2160
+ return e.getBlueId() !== void 0 && e.getType() === void 0 && e.getValue() === void 0 && e.getItems() === void 0 && e.getItemType() === void 0 && e.getKeyType() === void 0 && e.getProperties() === void 0 && e.getValueType() === void 0;
2161
+ }
2162
+ isExplicitBlueIdMatcher(e) {
2163
+ return this.isBareBlueIdReference(e);
2164
+ }
2165
+ resolveAgainstTargetType(e, t, r) {
2166
+ try {
2167
+ const n = e.clone(), i = n.clone().setType(t.clone()), o = this.blue.resolve(i, r);
2168
+ return this.restoreMissingStructure(o, n), o;
2169
+ } catch {
2170
+ return null;
2171
+ }
2172
+ }
2173
+ expandSchemaOwnedTypeReferences(e) {
2174
+ return this.isSchemaDefinitionNode(e) ? this.expandSchemaTypeReferences(e.clone()) : e;
2175
+ }
2176
+ isSchemaDefinitionNode(e) {
2177
+ return e.getBlueId() !== void 0 && (e.getName() !== void 0 || e.getDescription() !== void 0 || e.getType() !== void 0 || e.getItemType() !== void 0 || e.getKeyType() !== void 0 || e.getValueType() !== void 0 || e.getItems() !== void 0 || e.getProperties() !== void 0);
2178
+ }
2179
+ expandSchemaTypeReferences(e, t = /* @__PURE__ */ new Set()) {
2180
+ const r = this.withVisitedBlueId(
2181
+ t,
2182
+ e.getBlueId()
2183
+ ), n = e.getType();
2184
+ n && e.setType(this.expandReferencedTypeNode(n, r));
2185
+ const i = e.getItemType();
2186
+ i && e.setItemType(
2187
+ this.expandReferencedTypeNode(i, r)
2188
+ );
2189
+ const o = e.getKeyType();
2190
+ o && e.setKeyType(
2191
+ this.expandReferencedTypeNode(o, r)
2192
+ );
2193
+ const l = e.getValueType();
2194
+ l && e.setValueType(
2195
+ this.expandReferencedTypeNode(l, r)
2196
+ );
2197
+ const a = e.getItems();
2198
+ a && e.setItems(
2199
+ a.map(
2200
+ (f) => this.expandSchemaTypeReferences(f, r)
2201
+ )
2202
+ );
2203
+ const u = e.getProperties();
2204
+ return u && e.setProperties(
2205
+ Object.fromEntries(
2206
+ Object.entries(u).map(([f, h]) => [
2207
+ f,
2208
+ this.expandSchemaTypeReferences(h, r)
2209
+ ])
2210
+ )
2211
+ ), e;
2212
+ }
2213
+ expandReferencedTypeNode(e, t) {
2214
+ if (!this.isBareBlueIdReference(e))
2215
+ return this.expandSchemaTypeReferences(e.clone(), t);
2216
+ const r = e.getBlueId();
2217
+ if (!r || t.has(r))
2218
+ return e.clone();
2219
+ const n = this.blue.getNodeProvider().fetchByBlueId(r);
2220
+ return !n || n.length !== 1 ? e.clone() : this.expandSchemaTypeReferences(n[0].clone(), t);
2221
+ }
2222
+ withVisitedBlueId(e, t) {
2223
+ if (!t || e.has(t))
2224
+ return e;
2225
+ const r = new Set(e);
2226
+ return r.add(t), r;
2227
+ }
2113
2228
  }
2114
- const hs = (s) => s instanceof Nt || s instanceof St || s instanceof Ct || s instanceof At || s instanceof Ne || s instanceof Se, fs = (s) => s instanceof ee || s instanceof te || s instanceof Be || s instanceof be;
2115
- class Zt {
2229
+ const ys = (s) => s instanceof Rt || s instanceof Ot || s instanceof Mt || s instanceof Dt || s instanceof Ve || s instanceof Re, gs = (s) => s instanceof re || s instanceof se || s instanceof we || s instanceof Pe;
2230
+ class qt {
2116
2231
  static convertValue(e, t) {
2117
2232
  const r = e.getType()?.getBlueId(), n = e.getValue();
2118
- return m(n) ? fs(t) && _e.isValidValueNode(e) ? this.getDefaultPrimitiveValue(t) : n : _ === r ? this.convertFromString(String(n), t) : L === r || n instanceof S ? this.convertFromBigDecimal(
2119
- new S(n?.toString()),
2233
+ return m(n) ? gs(t) && ke.isValidValueNode(e) ? this.getDefaultPrimitiveValue(t) : n : Y === r ? this.convertFromString(String(n), t) : z === r || n instanceof A ? this.convertFromBigDecimal(
2234
+ new A(n?.toString()),
2120
2235
  t
2121
- ) : j === r || n instanceof E ? this.convertFromBigInteger(
2122
- new E(n?.toString()),
2236
+ ) : G === r || n instanceof N ? this.convertFromBigInteger(
2237
+ new N(n?.toString()),
2123
2238
  t
2124
- ) : U === r || typeof n == "boolean" ? this.convertFromBoolean(!!n, t) : this.convertFromString(String(n), t);
2239
+ ) : J === r || typeof n == "boolean" ? this.convertFromBoolean(!!n, t) : this.convertFromString(String(n), t);
2125
2240
  }
2126
2241
  static convertFromString(e, t) {
2127
- if (!t || t instanceof ee || t instanceof ur || t instanceof dr)
2242
+ if (!t || t instanceof re || t instanceof pr || t instanceof hr)
2128
2243
  return e;
2129
- if (t instanceof te)
2244
+ if (t instanceof se)
2130
2245
  return Number(e);
2131
- if (t instanceof Be)
2246
+ if (t instanceof we)
2132
2247
  return e.toLowerCase() === "true";
2133
- if (t instanceof be)
2248
+ if (t instanceof Pe)
2134
2249
  return BigInt(e);
2135
2250
  throw new Error(`Cannot convert String to ${t._def.typeName}`);
2136
2251
  }
2137
2252
  static convertFromBigDecimal(e, t) {
2138
- if (t instanceof te)
2253
+ if (t instanceof se)
2139
2254
  return e.toNumber();
2140
- if (t instanceof ee)
2255
+ if (t instanceof re)
2141
2256
  return e.toString();
2142
2257
  throw new Error(`Cannot convert Number to ${t._def.typeName}`);
2143
2258
  }
2144
2259
  static convertFromBigInteger(e, t) {
2145
- if (t instanceof te)
2260
+ if (t instanceof se)
2146
2261
  return e.toNumber();
2147
- if (t instanceof be)
2262
+ if (t instanceof Pe)
2148
2263
  return BigInt(e.toString());
2149
- if (t instanceof ee)
2264
+ if (t instanceof re)
2150
2265
  return e.toString();
2151
2266
  throw new Error(`Cannot convert Number to ${t._def.typeName}`);
2152
2267
  }
2153
2268
  static convertFromBoolean(e, t) {
2154
- if (!t || t instanceof Be)
2269
+ if (!t || t instanceof we)
2155
2270
  return e;
2156
- if (t instanceof ee)
2271
+ if (t instanceof re)
2157
2272
  return e.toString();
2158
- if (t instanceof te)
2273
+ if (t instanceof se)
2159
2274
  return Number(e);
2160
- if (t instanceof be)
2275
+ if (t instanceof Pe)
2161
2276
  return BigInt(e);
2162
2277
  throw new Error(`Cannot convert Boolean to ${t._def.typeName}`);
2163
2278
  }
2164
2279
  static getDefaultPrimitiveValue(e) {
2165
2280
  if (!e) return null;
2166
- if (e instanceof te)
2281
+ if (e instanceof se)
2167
2282
  return 0;
2168
- if (e instanceof Be)
2283
+ if (e instanceof we)
2169
2284
  return !1;
2170
- if (e instanceof ee)
2285
+ if (e instanceof re)
2171
2286
  return "";
2172
2287
  throw new Error(
2173
2288
  `Unsupported primitive type: ${e._def.typeName}`
2174
2289
  );
2175
2290
  }
2176
2291
  }
2177
- class ys {
2292
+ class ms {
2178
2293
  convert(e, t) {
2179
- return Zt.convertValue(e, t);
2294
+ return qt.convertValue(e, t);
2180
2295
  }
2181
2296
  }
2182
- class gs {
2297
+ class Is {
2183
2298
  constructor(e) {
2184
2299
  this.nodeToObjectConverter = e;
2185
2300
  }
@@ -2187,28 +2302,28 @@ class gs {
2187
2302
  return this.convertFields(e, t);
2188
2303
  }
2189
2304
  convertFields(e, t) {
2190
- if (t instanceof pr) {
2305
+ if (t instanceof fr) {
2191
2306
  const r = t._def.left, n = t._def.right, i = this.convert(e, r), o = this.convert(e, n);
2192
2307
  return { ...i, ...o };
2193
2308
  }
2194
- if (t instanceof hr)
2309
+ if (t instanceof yr)
2195
2310
  throw new Error("Union not supported");
2196
- if (t instanceof fr)
2311
+ if (t instanceof gr)
2197
2312
  return Object.keys(t.shape).reduce(
2198
2313
  (n, i) => {
2199
- const o = e.getProperties(), l = t.shape[i], a = Xr(l);
2314
+ const o = e.getProperties(), l = t.shape[i], a = Qr(l);
2200
2315
  if (d(a)) {
2201
- const v = rt(a) ? a : i, k = o?.[v], q = k ? T.calculateBlueIdSync(k) : void 0;
2202
- return n[i] = q, n;
2316
+ const v = lt(a) ? a : i, x = o?.[v], V = x ? T.calculateBlueIdSync(x) : void 0;
2317
+ return n[i] = V, n;
2203
2318
  }
2204
- const u = Qr(l);
2319
+ const u = ts(l);
2205
2320
  if (d(u)) {
2206
2321
  const v = o?.[u];
2207
2322
  return n[i] = v?.getName(), n;
2208
2323
  }
2209
- const y = Wr(l);
2210
- if (d(y)) {
2211
- const v = o?.[y];
2324
+ const f = Hr(l);
2325
+ if (d(f)) {
2326
+ const v = o?.[f];
2212
2327
  return n[i] = v?.getDescription(), n;
2213
2328
  }
2214
2329
  if (i === "name") {
@@ -2219,21 +2334,21 @@ class gs {
2219
2334
  const v = e.getDescription();
2220
2335
  return n[i] = v, n;
2221
2336
  }
2222
- const p = o?.[i];
2223
- if (m(p))
2337
+ const h = o?.[i];
2338
+ if (m(h))
2224
2339
  return n;
2225
- const f = this.nodeToObjectConverter.convert(
2226
- p,
2340
+ const g = this.nodeToObjectConverter.convert(
2341
+ h,
2227
2342
  l
2228
2343
  );
2229
- return n[i] = f, n;
2344
+ return n[i] = g, n;
2230
2345
  },
2231
2346
  {}
2232
2347
  );
2233
2348
  throw new Error("Unknown schema type, " + t._def.typeName);
2234
2349
  }
2235
2350
  }
2236
- class ms {
2351
+ class Ts {
2237
2352
  constructor(e) {
2238
2353
  this.nodeToObjectConverter = e;
2239
2354
  }
@@ -2247,7 +2362,7 @@ class ms {
2247
2362
  );
2248
2363
  }
2249
2364
  }
2250
- class Is {
2365
+ class vs {
2251
2366
  constructor(e) {
2252
2367
  this.nodeToObjectConverter = e;
2253
2368
  }
@@ -2261,35 +2376,35 @@ class Is {
2261
2376
  return new Set(i);
2262
2377
  }
2263
2378
  }
2264
- class Ts {
2379
+ class Bs {
2265
2380
  constructor(e) {
2266
2381
  this.nodeToObjectConverter = e;
2267
2382
  }
2268
2383
  convert(e, t) {
2269
2384
  const r = t.keySchema, n = t.valueSchema, i = /* @__PURE__ */ new Map(), o = e.getName();
2270
- d(o) && i.set(G, o);
2385
+ d(o) && i.set(H, o);
2271
2386
  const l = e.getDescription();
2272
- d(l) && i.set(J, l);
2387
+ d(l) && i.set(X, l);
2273
2388
  const a = e.getProperties();
2274
- return d(a) && Object.entries(a).forEach(([u, y]) => {
2275
- const p = new c().setValue(u);
2276
- p.setType(new c().setBlueId(_));
2277
- const f = Zt.convertValue(p, r), v = this.nodeToObjectConverter.convert(y, n);
2278
- i.set(f, v);
2279
- }), t instanceof yr ? Object.fromEntries(i) : i;
2389
+ return d(a) && Object.entries(a).forEach(([u, f]) => {
2390
+ const h = new c().setValue(u);
2391
+ h.setType(new c().setBlueId(Y));
2392
+ const g = qt.convertValue(h, r), v = this.nodeToObjectConverter.convert(f, n);
2393
+ i.set(g, v);
2394
+ }), t instanceof mr ? Object.fromEntries(i) : i;
2280
2395
  }
2281
2396
  }
2282
- class vs {
2397
+ class bs {
2283
2398
  convert(e) {
2284
2399
  return I.get(e);
2285
2400
  }
2286
2401
  }
2287
- class Bs {
2402
+ class ws {
2288
2403
  convert(e) {
2289
2404
  return I.get(e);
2290
2405
  }
2291
2406
  }
2292
- class bs {
2407
+ class Ps {
2293
2408
  constructor(e) {
2294
2409
  this.nodeToObjectConverter = e;
2295
2410
  }
@@ -2303,60 +2418,60 @@ class bs {
2303
2418
  );
2304
2419
  }
2305
2420
  }
2306
- const ws = h.union([
2307
- h.literal("ZodString"),
2308
- h.literal("ZodNumber"),
2309
- h.literal("ZodBoolean"),
2310
- h.literal("ZodBigInt"),
2311
- h.literal("ZodArray"),
2312
- h.literal("ZodSet"),
2313
- h.literal("ZodMap"),
2314
- h.literal("ZodRecord"),
2315
- h.literal("ZodObject"),
2316
- h.literal("ZodEnum"),
2317
- h.literal("ZodNativeEnum"),
2318
- h.literal("ZodUnknown"),
2319
- h.literal("ZodAny"),
2320
- h.literal("ZodTuple")
2421
+ const Es = p.union([
2422
+ p.literal("ZodString"),
2423
+ p.literal("ZodNumber"),
2424
+ p.literal("ZodBoolean"),
2425
+ p.literal("ZodBigInt"),
2426
+ p.literal("ZodArray"),
2427
+ p.literal("ZodSet"),
2428
+ p.literal("ZodMap"),
2429
+ p.literal("ZodRecord"),
2430
+ p.literal("ZodObject"),
2431
+ p.literal("ZodEnum"),
2432
+ p.literal("ZodNativeEnum"),
2433
+ p.literal("ZodUnknown"),
2434
+ p.literal("ZodAny"),
2435
+ p.literal("ZodTuple")
2321
2436
  ]);
2322
- class Es {
2437
+ class Ns {
2323
2438
  constructor(e) {
2324
- this.nodeToObjectConverter = e, this.registerConverters(), this.complexObjectConverter = new gs(
2439
+ this.nodeToObjectConverter = e, this.registerConverters(), this.complexObjectConverter = new Is(
2325
2440
  this.nodeToObjectConverter
2326
2441
  );
2327
2442
  }
2328
2443
  converters = /* @__PURE__ */ new Map();
2329
2444
  complexObjectConverter;
2330
2445
  registerConverters() {
2331
- const e = new ys(), t = new ms(this.nodeToObjectConverter), r = new bs(this.nodeToObjectConverter), n = new Is(this.nodeToObjectConverter), i = new Ts(this.nodeToObjectConverter);
2332
- 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 vs()), this.converters.set("ZodAny", new Bs()), this.converters.set("ZodArray", t), this.converters.set("ZodTuple", r), this.converters.set("ZodSet", n), this.converters.set("ZodMap", i), this.converters.set("ZodRecord", i), this.converters.set("ZodObject", this.complexObjectConverter);
2446
+ const e = new ms(), t = new Ts(this.nodeToObjectConverter), r = new Ps(this.nodeToObjectConverter), n = new vs(this.nodeToObjectConverter), i = new Bs(this.nodeToObjectConverter);
2447
+ 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 bs()), this.converters.set("ZodAny", new ws()), this.converters.set("ZodArray", t), this.converters.set("ZodTuple", r), this.converters.set("ZodSet", n), this.converters.set("ZodMap", i), this.converters.set("ZodRecord", i), this.converters.set("ZodObject", this.complexObjectConverter);
2333
2448
  }
2334
2449
  getConverter(e) {
2335
2450
  const t = this.getSchemaTypeName(e);
2336
2451
  return this.converters.get(t) ?? this.complexObjectConverter;
2337
2452
  }
2338
2453
  getSchemaTypeName(e) {
2339
- if (hs(e))
2340
- return e instanceof Ne ? this.getSchemaTypeName(e.innerType()) : e instanceof Se ? this.getSchemaTypeName(e.schema) : this.getSchemaTypeName(e.unwrap());
2454
+ if (ys(e))
2455
+ return e instanceof Ve ? this.getSchemaTypeName(e.innerType()) : e instanceof Re ? this.getSchemaTypeName(e.schema) : this.getSchemaTypeName(e.unwrap());
2341
2456
  const t = e._def.typeName;
2342
2457
  try {
2343
- return ws.parse(t);
2458
+ return Es.parse(t);
2344
2459
  } catch {
2345
2460
  throw new Error(`Schema type name ${t} is not supported`);
2346
2461
  }
2347
2462
  }
2348
2463
  }
2349
- class Ps {
2464
+ class Ss {
2350
2465
  constructor(e) {
2351
- this.typeSchemaResolver = e, this.converterFactory = new Es(this);
2466
+ this.typeSchemaResolver = e, this.converterFactory = new Ns(this);
2352
2467
  }
2353
2468
  converterFactory;
2354
2469
  convert(e, t) {
2355
- const r = this.typeSchemaResolver?.resolveSchema(e), n = A.unwrapSchema(t);
2356
- if (Gt(n))
2470
+ const r = this.typeSchemaResolver?.resolveSchema(e), n = O.unwrapSchema(t);
2471
+ if (Xt(n))
2357
2472
  return e;
2358
2473
  let i = n;
2359
- return A.checkSchemaExtension(
2474
+ return O.checkSchemaExtension(
2360
2475
  r,
2361
2476
  n,
2362
2477
  { typeSchemaResolver: this.typeSchemaResolver }
@@ -2366,7 +2481,7 @@ class Ps {
2366
2481
  return this.converterFactory.getConverter(t).convert(e, t);
2367
2482
  }
2368
2483
  }
2369
- class Ht {
2484
+ class Qt {
2370
2485
  reverse(e) {
2371
2486
  const t = new c();
2372
2487
  return this.reverseNode(t, e, e.getType()), t;
@@ -2411,8 +2526,8 @@ class Ht {
2411
2526
  }
2412
2527
  const a = i?.length || 0;
2413
2528
  for (let u = a; u < n.length; u++) {
2414
- const y = new c();
2415
- this.reverseNode(y, n[u], void 0), o.push(y);
2529
+ const f = new c();
2530
+ this.reverseNode(f, n[u], void 0), o.push(f);
2416
2531
  }
2417
2532
  o.length > 0 && e.setItems(o);
2418
2533
  }
@@ -2427,7 +2542,7 @@ class Ht {
2427
2542
  t,
2428
2543
  r
2429
2544
  ), u = new c();
2430
- this.reverseNode(u, l, a), _e.isEmptyNode(u) || (i[o] = u);
2545
+ this.reverseNode(u, l, a), ke.isEmptyNode(u) || (i[o] = u);
2431
2546
  }
2432
2547
  Object.keys(i).length > 0 && e.setProperties(i);
2433
2548
  }
@@ -2458,16 +2573,16 @@ class Ht {
2458
2573
  d(a) && r.setValueType(a.clone());
2459
2574
  const u = t.getProperties();
2460
2575
  if (d(u)) {
2461
- const p = r.getProperties() || {};
2462
- for (const [f, v] of Object.entries(u))
2463
- p[f] = v.clone();
2464
- r.setProperties(p);
2576
+ const h = r.getProperties() || {};
2577
+ for (const [g, v] of Object.entries(u))
2578
+ h[g] = v.clone();
2579
+ r.setProperties(h);
2465
2580
  }
2466
- const y = t.getItems();
2467
- return d(y) && r.setItems(y.map((p) => p.clone())), r;
2581
+ const f = t.getItems();
2582
+ return d(f) && r.setItems(f.map((h) => h.clone())), r;
2468
2583
  }
2469
2584
  }
2470
- class ne extends c {
2585
+ class oe extends c {
2471
2586
  /**
2472
2587
  * Creates a new ResolvedBlueNode from a resolved BlueNode
2473
2588
  * @param resolvedNode - The fully resolved node after merge operations
@@ -2489,7 +2604,7 @@ class ne extends c {
2489
2604
  * @returns The minimal node representation
2490
2605
  */
2491
2606
  getMinimalNode() {
2492
- return new Ht().reverse(this);
2607
+ return new Qt().reverse(this);
2493
2608
  }
2494
2609
  getMinimalBlueId() {
2495
2610
  const e = this.getMinimalNode();
@@ -2501,7 +2616,7 @@ class ne extends c {
2501
2616
  */
2502
2617
  clone() {
2503
2618
  const e = super.clone();
2504
- return new ne(e);
2619
+ return new oe(e);
2505
2620
  }
2506
2621
  /**
2507
2622
  * Creates a shallow clone of this ResolvedBlueNode while preserving
@@ -2510,7 +2625,7 @@ class ne extends c {
2510
2625
  */
2511
2626
  cloneShallow() {
2512
2627
  const e = super.cloneShallow();
2513
- return new ne(e);
2628
+ return new oe(e);
2514
2629
  }
2515
2630
  /**
2516
2631
  * Copies all properties from another BlueNode
@@ -2522,7 +2637,7 @@ class ne extends c {
2522
2637
  t !== void 0 && this.setValue(t);
2523
2638
  }
2524
2639
  }
2525
- class Te {
2640
+ class Be {
2526
2641
  /**
2527
2642
  * Fetches the first node associated with the given Blue ID
2528
2643
  * Default implementation that takes the first node from fetchByBlueId result
@@ -2535,42 +2650,42 @@ class Te {
2535
2650
  return t && t.length > 0 ? t[0] : null;
2536
2651
  }
2537
2652
  }
2538
- function Ns(s) {
2539
- return new class extends Te {
2653
+ function Cs(s) {
2654
+ return new class extends Be {
2540
2655
  fetchByBlueId(e) {
2541
2656
  return s(e);
2542
2657
  }
2543
2658
  }();
2544
2659
  }
2545
- const ze = H.types.float.options, Ss = {
2546
- ...ze,
2660
+ const He = ee.types.float.options, As = {
2661
+ ...He,
2547
2662
  construct: (s) => {
2548
2663
  const e = s.replace(/_/g, "").toLowerCase();
2549
- if (!Pt(e))
2550
- return new S(e);
2551
- if (ze.construct)
2552
- return ze.construct(s);
2664
+ if (!Vt(e))
2665
+ return new A(e);
2666
+ if (He.construct)
2667
+ return He.construct(s);
2553
2668
  }
2554
- }, Cs = new H.Type("tag:yaml.org,2002:float", Ss), Ge = H.types.int.options, As = {
2555
- ...Ge,
2669
+ }, Vs = new ee.Type("tag:yaml.org,2002:float", As), Xe = ee.types.int.options, Rs = {
2670
+ ...Xe,
2556
2671
  construct: (s) => {
2557
2672
  let e = s;
2558
- if (e.indexOf("_") !== -1 && (e = e.replace(/_/g, "")), !Pt(e))
2559
- return new E(e);
2560
- if (Ge.construct)
2561
- return Ge.construct(s);
2562
- }
2563
- }, Vs = new H.Type("tag:yaml.org,2002:int", As), Xt = H.CORE_SCHEMA.extend({
2564
- implicit: [Cs, Vs]
2565
- }), $ = (s) => {
2566
- const e = H.load(s, { schema: Xt });
2673
+ if (e.indexOf("_") !== -1 && (e = e.replace(/_/g, "")), !Vt(e))
2674
+ return new N(e);
2675
+ if (Xe.construct)
2676
+ return Xe.construct(s);
2677
+ }
2678
+ }, Os = new ee.Type("tag:yaml.org,2002:int", Rs), er = ee.CORE_SCHEMA.extend({
2679
+ implicit: [Vs, Os]
2680
+ }), K = (s) => {
2681
+ const e = ee.load(s, { schema: er });
2567
2682
  return e === void 0 ? void 0 : e;
2568
- }, Rs = (s) => H.dump(s, {
2569
- schema: Xt,
2683
+ }, Ms = (s) => ee.dump(s, {
2684
+ schema: er,
2570
2685
  replacer: (e, t) => {
2571
- if (C(t)) {
2572
- if (Z(t)) {
2573
- const r = new D(Number.MIN_SAFE_INTEGER.toString()), n = new D(Number.MAX_SAFE_INTEGER.toString());
2686
+ if (R(t)) {
2687
+ if (Q(t)) {
2688
+ const r = new j(Number.MIN_SAFE_INTEGER.toString()), n = new j(Number.MAX_SAFE_INTEGER.toString());
2574
2689
  if (t.lt(r) || t.gt(n))
2575
2690
  return t.toString();
2576
2691
  }
@@ -2579,13 +2694,13 @@ const ze = H.types.float.options, Ss = {
2579
2694
  return t;
2580
2695
  }
2581
2696
  });
2582
- class Os {
2697
+ class Ds {
2583
2698
  static get(e, t = {}) {
2584
2699
  const { strategy: r = "official" } = t, n = I.get(e, r);
2585
- return Rs(n);
2700
+ return Ms(n);
2586
2701
  }
2587
2702
  }
2588
- class Ms extends Te {
2703
+ class xs extends Be {
2589
2704
  nodeProviders;
2590
2705
  constructor(e) {
2591
2706
  super(), this.nodeProviders = e;
@@ -2612,7 +2727,7 @@ class Ms extends Te {
2612
2727
  return this.nodeProviders;
2613
2728
  }
2614
2729
  }
2615
- const qt = `- type:
2730
+ const tr = `- type:
2616
2731
  blueId: 27B7fuxQCS1VAptiCPc2RMkKoutP5qxkh3uDxZ7dr6Eo
2617
2732
  mappings:
2618
2733
  Text: DLRQwz7MQeCrzjy9bohPNwtCxKEBbKaMK65KBrwjfG6K
@@ -2623,20 +2738,20 @@ const qt = `- type:
2623
2738
  Dictionary: G7fBT9PSod1RfHLHkpafAGBDVAJMrMhAMY51ERcyXNrj
2624
2739
  - type:
2625
2740
  blueId: FGYuTXwaoSKfZmpTysLTLsb8WzSqf43384rKZDkXhxD4
2626
- `, Ds = `name: Transformation
2627
- description: TODO`, xs = `name: Infer Basic Types For Untyped Values
2741
+ `, Fs = `name: Transformation
2742
+ description: TODO`, $s = `name: Infer Basic Types For Untyped Values
2628
2743
  type:
2629
2744
  blueId: Ct1SGRGw1i47qjzm1ruiUdSZofeV6WevPTGuieVvbRS4
2630
- description: This transformation infers type details for Text, Integer, Number and Boolean.`, Fs = `name: Replace Inline Types with BlueIds
2745
+ description: This transformation infers type details for Text, Integer, Number and Boolean.`, _s = `name: Replace Inline Types with BlueIds
2631
2746
  type:
2632
2747
  blueId: Ct1SGRGw1i47qjzm1ruiUdSZofeV6WevPTGuieVvbRS4
2633
- description: This transformation replaces`, $s = [
2634
- qt,
2635
- Ds,
2636
- xs,
2637
- Fs
2748
+ description: This transformation replaces`, Ls = [
2749
+ tr,
2750
+ Fs,
2751
+ $s,
2752
+ _s
2638
2753
  ];
2639
- class _s extends Te {
2754
+ class js extends Be {
2640
2755
  blueIdToNodesMap = /* @__PURE__ */ new Map();
2641
2756
  constructor() {
2642
2757
  super(), this.load();
@@ -2645,45 +2760,45 @@ class _s extends Te {
2645
2760
  return this.blueIdToNodesMap.get(e) || [];
2646
2761
  }
2647
2762
  load() {
2648
- for (const e of $s) {
2649
- const t = $(e);
2763
+ for (const e of Ls) {
2764
+ const t = K(e);
2650
2765
  if (t === void 0) {
2651
2766
  console.error(`This content file is not valid YAML: ${e}`);
2652
2767
  continue;
2653
2768
  }
2654
2769
  if (Array.isArray(t)) {
2655
2770
  const r = t.map(
2656
- (i) => g.deserialize(i)
2771
+ (i) => y.deserialize(i)
2657
2772
  ), n = T.calculateBlueIdSync(r);
2658
2773
  this.blueIdToNodesMap.set(n, r);
2659
2774
  } else {
2660
- const r = g.deserialize(t), n = T.calculateBlueIdSync(r);
2775
+ const r = y.deserialize(t), n = T.calculateBlueIdSync(r);
2661
2776
  this.blueIdToNodesMap.set(n, [r]);
2662
2777
  }
2663
2778
  }
2664
2779
  }
2665
2780
  }
2666
- class ht extends Te {
2667
- static INSTANCE = new ht();
2781
+ class It extends Be {
2782
+ static INSTANCE = new It();
2668
2783
  nodeProvider;
2669
2784
  constructor() {
2670
- super(), this.nodeProvider = new _s();
2785
+ super(), this.nodeProvider = new js();
2671
2786
  }
2672
2787
  fetchByBlueId(e) {
2673
2788
  return this.nodeProvider.fetchByBlueId(e);
2674
2789
  }
2675
2790
  }
2676
- class Je {
2791
+ class qe {
2677
2792
  constructor(e, t, r) {
2678
2793
  this.blueId = e, this.content = t, this.isMultipleDocuments = r;
2679
2794
  }
2680
2795
  }
2681
- class z {
2796
+ class Z {
2682
2797
  static THIS_REFERENCE_PATTERN = /^this(#\d+)?$/;
2683
2798
  static parseAndCalculateBlueId(e, t) {
2684
2799
  let r;
2685
2800
  try {
2686
- const l = $(e);
2801
+ const l = K(e);
2687
2802
  if (l === void 0)
2688
2803
  throw new Error();
2689
2804
  r = l;
@@ -2694,19 +2809,19 @@ class z {
2694
2809
  const o = Array.isArray(r) && r.length > 1;
2695
2810
  if (o) {
2696
2811
  const l = r.map((a) => {
2697
- const u = g.deserialize(a);
2812
+ const u = y.deserialize(a);
2698
2813
  return t(u);
2699
2814
  });
2700
2815
  n = T.calculateBlueIdSync(l), i = l.map((a) => I.get(a));
2701
2816
  } else {
2702
- const l = g.deserialize(r), a = t(l);
2817
+ const l = y.deserialize(r), a = t(l);
2703
2818
  n = T.calculateBlueIdSync(a), i = I.get(a);
2704
2819
  }
2705
- return new Je(n, i, o);
2820
+ return new qe(n, i, o);
2706
2821
  }
2707
2822
  static parseAndCalculateBlueIdForNode(e, t) {
2708
2823
  const r = t(e), n = T.calculateBlueIdSync(r), i = I.get(r);
2709
- return new Je(n, i, !1);
2824
+ return new qe(n, i, !1);
2710
2825
  }
2711
2826
  static parseAndCalculateBlueIdForNodeList(e, t) {
2712
2827
  if (!e || e.length === 0)
@@ -2714,7 +2829,7 @@ class z {
2714
2829
  const r = e.map(t), n = T.calculateBlueIdSync(r), i = r.map(
2715
2830
  (l) => I.get(l)
2716
2831
  ), o = e.length > 1;
2717
- return new Je(n, i, o);
2832
+ return new qe(n, i, o);
2718
2833
  }
2719
2834
  static resolveThisReferences(e, t, r) {
2720
2835
  return this.resolveThisReferencesRecursive(
@@ -2765,12 +2880,12 @@ class z {
2765
2880
  }
2766
2881
  }
2767
2882
  }
2768
- class Ls extends Te {
2883
+ class Us extends Be {
2769
2884
  fetchByBlueId(e) {
2770
2885
  const t = e.split("#")[0], r = this.fetchContentByBlueId(t);
2771
2886
  if (r == null)
2772
2887
  return null;
2773
- const n = Array.isArray(r) && r.length > 1, i = z.resolveThisReferences(
2888
+ const n = Array.isArray(r) && r.length > 1, i = Z.resolveThisReferences(
2774
2889
  r,
2775
2890
  t,
2776
2891
  n
@@ -2780,24 +2895,24 @@ class Ls extends Te {
2780
2895
  if (o.length > 1) {
2781
2896
  const l = parseInt(o[1]);
2782
2897
  if (Array.isArray(i) && l < i.length) {
2783
- const a = i[l], u = g.deserialize(a);
2898
+ const a = i[l], u = y.deserialize(a);
2784
2899
  return u.setBlueId(e), [u];
2785
2900
  } else if (l === 0) {
2786
- const a = g.deserialize(i);
2901
+ const a = y.deserialize(i);
2787
2902
  return a.setBlueId(e), [a];
2788
2903
  } else
2789
2904
  return null;
2790
2905
  }
2791
2906
  }
2792
2907
  if (Array.isArray(i))
2793
- return i.map((o) => g.deserialize(o));
2908
+ return i.map((o) => y.deserialize(o));
2794
2909
  {
2795
- const o = g.deserialize(i);
2910
+ const o = y.deserialize(i);
2796
2911
  return o.setBlueId(t), [o];
2797
2912
  }
2798
2913
  }
2799
2914
  }
2800
- class Qt extends Ls {
2915
+ class rr extends Us {
2801
2916
  nameToBlueIdsMap = /* @__PURE__ */ new Map();
2802
2917
  /**
2803
2918
  * Find a node by name. Throws an error if multiple nodes are found with the same name.
@@ -2841,17 +2956,17 @@ class Qt extends Ls {
2841
2956
  ]);
2842
2957
  }
2843
2958
  }
2844
- const er = (s) => s instanceof c || Array.isArray(s) && s.every((e) => e instanceof c) ? s : tt(s) ? s.map((e) => g.deserialize(e)) : g.deserialize(s), js = async (s) => {
2845
- const e = er(s);
2959
+ const sr = (s) => s instanceof c || Array.isArray(s) && s.every((e) => e instanceof c) ? s : ot(s) ? s.map((e) => y.deserialize(e)) : y.deserialize(s), ks = async (s) => {
2960
+ const e = sr(s);
2846
2961
  return T.calculateBlueId(e);
2847
- }, Zn = (s) => {
2848
- const e = er(s);
2962
+ }, Xn = (s) => {
2963
+ const e = sr(s);
2849
2964
  return T.calculateBlueIdSync(e);
2850
- }, Bt = async (s) => {
2851
- if (Pr(s))
2965
+ }, Nt = async (s) => {
2966
+ if (Sr(s))
2852
2967
  return s;
2853
2968
  try {
2854
- const e = Ae.parse(s), t = await js(e);
2969
+ const e = Me.parse(s), t = await ks(e);
2855
2970
  return {
2856
2971
  ...s,
2857
2972
  blueId: t
@@ -2859,31 +2974,31 @@ const er = (s) => s instanceof c || Array.isArray(s) && s.every((e) => e instanc
2859
2974
  } catch (e) {
2860
2975
  throw new Error(`Failed enriching object with Blue ID: ${e}`);
2861
2976
  }
2862
- }, Hn = (s) => s?.items, Xn = (s) => s?.value, qn = (s) => m(s) ? {} : Rt(
2977
+ }, qn = (s) => s?.items, Qn = (s) => s?.value, ei = (s) => m(s) ? {} : Ft(
2863
2978
  s,
2864
- nt
2865
- ), Qn = (s) => Sr(s) ? s.type.name ?? null : Cr(s) ? gr(typeof s.value) : Nr(s) ? "List" : null, Us = (s) => d(s) && Object.keys(Rt(s, ["blueId"])).length > 0, ei = (s) => {
2979
+ ct
2980
+ ), ti = (s) => Ar(s) ? s.type.name ?? null : Vr(s) ? Ir(typeof s.value) : Cr(s) ? "List" : null, Ks = (s) => d(s) && Object.keys(Ft(s, ["blueId"])).length > 0, ri = (s) => {
2866
2981
  try {
2867
- const e = g.deserialize(s), t = I.get(e);
2868
- return de.parse(t);
2982
+ const e = y.deserialize(s), t = I.get(e);
2983
+ return he.parse(t);
2869
2984
  } catch (e) {
2870
2985
  throw new Error(
2871
2986
  `Failed transforming JSON-like value to BlueObject: ${e}`
2872
2987
  );
2873
2988
  }
2874
- }, bt = async (s) => {
2989
+ }, St = async (s) => {
2875
2990
  const {
2876
2991
  resolveFunction: e,
2877
2992
  signal: t = new AbortController().signal,
2878
2993
  omitItems: r
2879
2994
  } = s, n = s.count ?? s.items.length;
2880
- let i = await mr(s.items, async (l) => await Bt(l));
2995
+ let i = await Tr(s.items, async (l) => await Nt(l));
2881
2996
  const o = Math.max(i?.length - n, 0);
2882
2997
  for (let l = i.length - 1; l >= o; l--)
2883
- if (!Us(i[l])) {
2998
+ if (!Ks(i[l])) {
2884
2999
  const a = await e(i[l], { signal: t });
2885
3000
  if (Array.isArray(a))
2886
- return bt({
3001
+ return St({
2887
3002
  ...s,
2888
3003
  items: [
2889
3004
  ...i.slice(0, l),
@@ -2891,9 +3006,9 @@ const er = (s) => s instanceof c || Array.isArray(s) && s.every((e) => e instanc
2891
3006
  ...i.slice(l + 1)
2892
3007
  ]
2893
3008
  });
2894
- const u = await Bt(a);
3009
+ const u = await Nt(a);
2895
3010
  if (r?.includes(u.blueId))
2896
- return bt({
3011
+ return St({
2897
3012
  ...s,
2898
3013
  items: [...i.slice(0, l), ...i.slice(l + 1)]
2899
3014
  });
@@ -2905,7 +3020,7 @@ const er = (s) => s instanceof c || Array.isArray(s) && s.every((e) => e instanc
2905
3020
  }
2906
3021
  return i;
2907
3022
  };
2908
- function Ee(s) {
3023
+ function Ce(s) {
2909
3024
  try {
2910
3025
  const e = new URL(s);
2911
3026
  return e.protocol === "http:" || e.protocol === "https:";
@@ -2913,14 +3028,14 @@ function Ee(s) {
2913
3028
  return !1;
2914
3029
  }
2915
3030
  }
2916
- class ks {
3031
+ class Ys {
2917
3032
  /**
2918
3033
  * Process a document node to infer basic types for untyped values
2919
3034
  * @param document - The document to process
2920
3035
  * @returns The processed document
2921
3036
  */
2922
3037
  process(e) {
2923
- return w.transform(e, this.inferType.bind(this));
3038
+ return E.transform(e, this.inferType.bind(this));
2924
3039
  }
2925
3040
  /**
2926
3041
  * Infer a basic type for a node
@@ -2929,10 +3044,10 @@ class ks {
2929
3044
  */
2930
3045
  inferType(e) {
2931
3046
  const t = e.getType(), r = e.getValue();
2932
- return m(t) && d(r) && (typeof r == "string" ? e.setType(new c().setBlueId(_)) : typeof r == "bigint" || Z(r) ? e.setType(new c().setBlueId(j)) : We(r) ? e.setType(new c().setBlueId(L)) : typeof r == "boolean" && e.setType(new c().setBlueId(U))), e;
3047
+ return m(t) && d(r) && (typeof r == "string" ? e.setType(new c().setBlueId(Y)) : typeof r == "bigint" || Q(r) ? e.setType(new c().setBlueId(G)) : Qe(r) ? e.setType(new c().setBlueId(z)) : typeof r == "boolean" && e.setType(new c().setBlueId(J))), e;
2933
3048
  }
2934
3049
  }
2935
- class Re {
3050
+ class xe {
2936
3051
  static MAPPINGS = "mappings";
2937
3052
  mappings = /* @__PURE__ */ new Map();
2938
3053
  /**
@@ -2942,8 +3057,8 @@ class Re {
2942
3057
  constructor(e) {
2943
3058
  if (e instanceof c) {
2944
3059
  const r = e.getProperties();
2945
- if (r && r[Re.MAPPINGS]) {
2946
- const i = r[Re.MAPPINGS].getProperties();
3060
+ if (r && r[xe.MAPPINGS]) {
3061
+ const i = r[xe.MAPPINGS].getProperties();
2947
3062
  i && Object.entries(i).forEach(([o, l]) => {
2948
3063
  const a = l.getValue();
2949
3064
  typeof a == "string" && this.mappings.set(o, a);
@@ -2958,7 +3073,7 @@ class Re {
2958
3073
  * @returns The processed document
2959
3074
  */
2960
3075
  process(e) {
2961
- return w.transform(e, this.transformNode.bind(this));
3076
+ return E.transform(e, this.transformNode.bind(this));
2962
3077
  }
2963
3078
  transformNode(e) {
2964
3079
  const t = e.clone();
@@ -2977,7 +3092,7 @@ class Re {
2977
3092
  }
2978
3093
  }
2979
3094
  }
2980
- class Ks {
3095
+ class zs {
2981
3096
  /**
2982
3097
  * Process a document node to validate all inline types have been replaced
2983
3098
  * @param document - The document to process
@@ -2985,7 +3100,7 @@ class Ks {
2985
3100
  * @throws Error if any inline type values remain without BlueId mappings
2986
3101
  */
2987
3102
  process(e) {
2988
- return w.transform(e, this.validateNode.bind(this)), e;
3103
+ return E.transform(e, this.validateNode.bind(this)), e;
2989
3104
  }
2990
3105
  validateNode(e) {
2991
3106
  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;
@@ -2999,7 +3114,7 @@ class Ks {
2999
3114
  }
3000
3115
  }
3001
3116
  }
3002
- class ft {
3117
+ class Tt {
3003
3118
  nodeProvider;
3004
3119
  strategy;
3005
3120
  /**
@@ -3008,7 +3123,7 @@ class ft {
3008
3123
  * @param strategy - The strategy to use for missing elements (defaults to THROW_EXCEPTION)
3009
3124
  */
3010
3125
  constructor(e, t) {
3011
- this.nodeProvider = he.wrap(e), this.strategy = t || "THROW_EXCEPTION";
3126
+ this.nodeProvider = ye.wrap(e), this.strategy = t || "THROW_EXCEPTION";
3012
3127
  }
3013
3128
  /**
3014
3129
  * Extends a node with its resolved references
@@ -3026,17 +3141,17 @@ class ft {
3026
3141
  }
3027
3142
  try {
3028
3143
  const i = e.getBlueId();
3029
- if (i && !X.includes(
3144
+ if (i && !te.includes(
3030
3145
  i
3031
3146
  )) {
3032
- const f = this.fetchNode(e);
3033
- if (f && f.length > 0)
3034
- if (f.length === 1) {
3035
- const v = f[0];
3147
+ const g = this.fetchNode(e);
3148
+ if (g && g.length > 0)
3149
+ if (g.length === 1) {
3150
+ const v = g[0];
3036
3151
  this.mergeNodes(e, v);
3037
3152
  } else {
3038
- const v = f.map((q) => q.clone()), k = new c().setItems(v);
3039
- this.mergeNodes(e, k);
3153
+ const v = g.map((V) => V.clone()), x = new c().setItems(v);
3154
+ this.mergeNodes(e, x);
3040
3155
  }
3041
3156
  }
3042
3157
  const o = e.getType();
@@ -3047,15 +3162,15 @@ class ft {
3047
3162
  a && this.extendNode(a, t, "keyType", !0);
3048
3163
  const u = e.getValueType();
3049
3164
  u && this.extendNode(u, t, "valueType", !0);
3050
- const y = e.getProperties();
3051
- y && Object.entries(y).forEach(([f, v]) => {
3052
- this.extendNode(v, t, f, !1);
3165
+ const f = e.getProperties();
3166
+ f && Object.entries(f).forEach(([g, v]) => {
3167
+ this.extendNode(v, t, g, !1);
3053
3168
  });
3054
- const p = e.getItems();
3055
- if (p && p.length > 0) {
3056
- this.reconstructList(p);
3057
- for (let f = 0; f < p.length; f++)
3058
- this.extendNode(p[f], t, String(f), !1);
3169
+ const h = e.getItems();
3170
+ if (h && h.length > 0) {
3171
+ this.reconstructList(h);
3172
+ for (let g = 0; g < h.length; g++)
3173
+ this.extendNode(h[g], t, String(g), !1);
3059
3174
  }
3060
3175
  } finally {
3061
3176
  n || t.exitPathSegment();
@@ -3093,7 +3208,7 @@ class ft {
3093
3208
  d(r) && e.setValue(r), e.setItems(t.getItems()), e.setProperties(t.getProperties());
3094
3209
  }
3095
3210
  }
3096
- class yt {
3211
+ class vt {
3097
3212
  blueIdsCollections = [];
3098
3213
  /**
3099
3214
  * Initializes the generator with default BlueIds collections
@@ -3163,7 +3278,7 @@ ${r}`;
3163
3278
  return Object.keys(this.getAllBlueIds()).length;
3164
3279
  }
3165
3280
  }
3166
- class ie {
3281
+ class le {
3167
3282
  static DEFAULT_BLUE_BLUE_ID = "6sqUywMoBRyj9hgQxSu2nDPnqcyiSM7xu9AB9sN98YJK";
3168
3283
  processorProvider;
3169
3284
  nodeProvider;
@@ -3177,7 +3292,7 @@ class ie {
3177
3292
  const { nodeProvider: t, processorProvider: r, blueIdsMappingGenerator: n } = e;
3178
3293
  if (!t)
3179
3294
  throw new Error("NodeProvider is required");
3180
- this.nodeProvider = he.wrap(t), this.processorProvider = r || ie.getStandardProvider(), this.blueIdsMappingGenerator = n || new yt(), this.loadDefaultSimpleBlue();
3295
+ this.nodeProvider = ye.wrap(t), this.processorProvider = r || le.getStandardProvider(), this.blueIdsMappingGenerator = n || new vt(), this.loadDefaultSimpleBlue();
3181
3296
  }
3182
3297
  /**
3183
3298
  * Preprocesses a document node
@@ -3204,9 +3319,9 @@ class ie {
3204
3319
  preprocessWithOptions(e, t) {
3205
3320
  let r = e.clone(), n = r.getBlue();
3206
3321
  if (!n && t && (n = t.clone()), n) {
3207
- new ft(this.nodeProvider).extend(
3322
+ new Tt(this.nodeProvider).extend(
3208
3323
  n,
3209
- Le.withSinglePath("/*")
3324
+ Ke.withSinglePath("/*")
3210
3325
  );
3211
3326
  const i = n.getItems();
3212
3327
  if (i && i.length > 0) {
@@ -3221,7 +3336,7 @@ class ie {
3221
3336
  }
3222
3337
  r.setBlue(void 0);
3223
3338
  }
3224
- r = new Ks().process(
3339
+ r = new zs().process(
3225
3340
  r
3226
3341
  );
3227
3342
  }
@@ -3236,11 +3351,11 @@ class ie {
3236
3351
  getProcessor(e) {
3237
3352
  const t = "27B7fuxQCS1VAptiCPc2RMkKoutP5qxkh3uDxZ7dr6Eo", r = "FGYuTXwaoSKfZmpTysLTLsb8WzSqf43384rKZDkXhxD4", n = e.getType()?.getBlueId();
3238
3353
  if (t === n)
3239
- return new Re(
3354
+ return new xe(
3240
3355
  e
3241
3356
  );
3242
3357
  if (r === n)
3243
- return new ks();
3358
+ return new Ys();
3244
3359
  }
3245
3360
  };
3246
3361
  }
@@ -3261,9 +3376,9 @@ ${t}
3261
3376
  */
3262
3377
  loadDefaultSimpleBlue() {
3263
3378
  try {
3264
- const e = this.enrichDefaultBlue(qt), t = $(e);
3379
+ const e = this.enrichDefaultBlue(tr), t = K(e);
3265
3380
  if (t)
3266
- this.defaultSimpleBlue = g.deserialize(t);
3381
+ this.defaultSimpleBlue = y.deserialize(t);
3267
3382
  else
3268
3383
  throw new Error("Failed to parse default Blue content");
3269
3384
  } catch (e) {
@@ -3271,15 +3386,15 @@ ${t}
3271
3386
  }
3272
3387
  }
3273
3388
  }
3274
- class gt extends Qt {
3389
+ class Bt extends rr {
3275
3390
  blueIdToContentMap = /* @__PURE__ */ new Map();
3276
3391
  blueIdToMultipleDocumentsMap = /* @__PURE__ */ new Map();
3277
3392
  preprocessor;
3278
3393
  constructor(e) {
3279
3394
  super();
3280
- const t = new yt(), r = gt.collectAliasMappings(e);
3395
+ const t = new vt(), r = Bt.collectAliasMappings(e);
3281
3396
  Object.keys(r).length > 0 && t.registerBlueIds(r);
3282
- const n = new ie({
3397
+ const n = new le({
3283
3398
  nodeProvider: this,
3284
3399
  blueIdsMappingGenerator: t
3285
3400
  });
@@ -3308,7 +3423,7 @@ class gt extends Qt {
3308
3423
  Array.isArray(e) ? this.processMultipleDocuments(e, t) : this.processSingleDocument(e, t);
3309
3424
  }
3310
3425
  processSingleDocument(e, t) {
3311
- const r = g.deserialize(e), n = z.parseAndCalculateBlueIdForNode(
3426
+ const r = y.deserialize(e), n = Z.parseAndCalculateBlueIdForNode(
3312
3427
  r,
3313
3428
  this.preprocessor
3314
3429
  ), i = t || n.blueId;
@@ -3318,22 +3433,22 @@ class gt extends Qt {
3318
3433
  }
3319
3434
  processMultipleDocuments(e, t) {
3320
3435
  const r = e.map((o) => {
3321
- const l = g.deserialize(o);
3436
+ const l = y.deserialize(o);
3322
3437
  return this.preprocessor(l);
3323
- }), n = z.parseAndCalculateBlueIdForNodeList(
3438
+ }), n = Z.parseAndCalculateBlueIdForNodeList(
3324
3439
  r,
3325
3440
  (o) => o
3326
3441
  ), i = t || n.blueId;
3327
3442
  this.blueIdToContentMap.set(i, n.content), this.blueIdToMultipleDocumentsMap.set(i, !0), r.forEach((o, l) => {
3328
- const a = `${i}#${l}`, u = I.get(o), y = T.calculateBlueIdSync(o);
3329
- this.blueIdToContentMap.set(y, u), this.blueIdToMultipleDocumentsMap.set(y, !1);
3330
- const p = o.getName();
3331
- p && this.addToNameMap(p, a);
3443
+ const a = `${i}#${l}`, u = I.get(o), f = T.calculateBlueIdSync(o);
3444
+ this.blueIdToContentMap.set(f, u), this.blueIdToMultipleDocumentsMap.set(f, !1);
3445
+ const h = o.getName();
3446
+ h && this.addToNameMap(h, a);
3332
3447
  });
3333
3448
  }
3334
3449
  fetchContentByBlueId(e) {
3335
3450
  const t = this.blueIdToContentMap.get(e), r = this.blueIdToMultipleDocumentsMap.get(e);
3336
- return t !== void 0 && r !== void 0 ? z.resolveThisReferences(
3451
+ return t !== void 0 && r !== void 0 ? Z.resolveThisReferences(
3337
3452
  t,
3338
3453
  e,
3339
3454
  r
@@ -3353,7 +3468,7 @@ class gt extends Qt {
3353
3468
  return this.blueIdToContentMap.has(t);
3354
3469
  }
3355
3470
  }
3356
- class he {
3471
+ class ye {
3357
3472
  /**
3358
3473
  * Wraps a NodeProvider with a SequentialNodeProvider that includes bootstrap providers and repository definitions
3359
3474
  * @param originalProvider - The original NodeProvider to wrap
@@ -3361,15 +3476,15 @@ class he {
3361
3476
  * @returns A wrapped NodeProvider that includes bootstrap providers and repository definitions
3362
3477
  */
3363
3478
  static wrap(e, t) {
3364
- const r = [ht.INSTANCE];
3479
+ const r = [It.INSTANCE];
3365
3480
  if (t && t.length > 0) {
3366
- const n = new gt(t);
3481
+ const n = new Bt(t);
3367
3482
  r.push(n);
3368
3483
  }
3369
- return r.push(e), new Ms(r);
3484
+ return r.push(e), new xs(r);
3370
3485
  }
3371
3486
  }
3372
- class Ys {
3487
+ class Gs {
3373
3488
  preprocessingAliases = /* @__PURE__ */ new Map();
3374
3489
  urlContentFetcher;
3375
3490
  /**
@@ -3393,9 +3508,9 @@ class Ys {
3393
3508
  const r = e.clone();
3394
3509
  if (this.preprocessingAliases.has(t))
3395
3510
  return this.handleAliasValue(r, t);
3396
- if (Ce.isPotentialBlueId(t))
3511
+ if (Oe.isPotentialBlueId(t))
3397
3512
  return this.handleBlueId(r, t);
3398
- throw Ee(t) ? new Error(
3513
+ throw Ce(t) ? new Error(
3399
3514
  `URL '${t}' detected. Use the async version of this method to fetch the content.`
3400
3515
  ) : new Error(`Invalid blue value: ${t}`);
3401
3516
  }
@@ -3413,9 +3528,9 @@ class Ys {
3413
3528
  const r = e.clone();
3414
3529
  if (this.preprocessingAliases.has(t))
3415
3530
  return this.handleAliasValue(r, t);
3416
- if (Ce.isPotentialBlueId(t))
3531
+ if (Oe.isPotentialBlueId(t))
3417
3532
  return this.handleBlueId(r, t);
3418
- if (Ee(t) && this.urlContentFetcher)
3533
+ if (Ce(t) && this.urlContentFetcher)
3419
3534
  try {
3420
3535
  const n = await this.fetchFromUrl(t);
3421
3536
  return n && r.setBlue(new c().setItems(n)), r;
@@ -3425,7 +3540,7 @@ class Ys {
3425
3540
  ${n.message}`
3426
3541
  ) : n;
3427
3542
  }
3428
- else throw Ee(t) ? new Error(
3543
+ else throw Ce(t) ? new Error(
3429
3544
  `UrlContentFetcher not provided for URL: ${t}`
3430
3545
  ) : new Error(`Invalid blue value: ${t}`);
3431
3546
  }
@@ -3511,24 +3626,24 @@ ${n.message}`
3511
3626
  return this.urlContentFetcher;
3512
3627
  }
3513
3628
  }
3514
- const zs = {
3629
+ const Js = {
3515
3630
  fetchUrl: async (s) => {
3516
3631
  throw new Error(
3517
3632
  `You must provide a custom UrlFetchStrategy to fetch content from URL: ${s}`
3518
3633
  );
3519
3634
  }
3520
3635
  };
3521
- class Gs {
3636
+ class Ws {
3522
3637
  // Cache to avoid repeated network requests for the same URL
3523
3638
  cache = /* @__PURE__ */ new Map();
3524
3639
  fetchStrategy;
3525
3640
  enabled = !1;
3526
3641
  allowedDomains = [];
3527
3642
  constructor(e) {
3528
- this.fetchStrategy = e || zs;
3643
+ this.fetchStrategy = e || Js;
3529
3644
  }
3530
3645
  validateUrl(e) {
3531
- if (!Ee(e))
3646
+ if (!Ce(e))
3532
3647
  throw new Error(`Invalid URL: ${e}`);
3533
3648
  return !0;
3534
3649
  }
@@ -3567,13 +3682,13 @@ class Gs {
3567
3682
  const { data: r, contentType: n } = t;
3568
3683
  let i;
3569
3684
  if (n.includes("application/json") || n.includes("text/yaml") || n.includes("application/yaml") || n.includes("text/plain"))
3570
- i = $(r);
3685
+ i = K(r);
3571
3686
  else
3572
3687
  throw new Error(`Unsupported content type from URL: ${n}`);
3573
3688
  if (i === void 0)
3574
3689
  throw new Error(`Failed to parse content from URL: ${e}`);
3575
3690
  let o;
3576
- return Array.isArray(i) ? o = i.map((l) => g.deserialize(l)) : o = [g.deserialize(i)], this.cache.set(e, o), o;
3691
+ return Array.isArray(i) ? o = i.map((l) => y.deserialize(l)) : o = [y.deserialize(i)], this.cache.set(e, o), o;
3577
3692
  }
3578
3693
  prefetchUrl(e, t) {
3579
3694
  try {
@@ -3647,7 +3762,7 @@ class Gs {
3647
3762
  return this.allowedDomains = [], this;
3648
3763
  }
3649
3764
  }
3650
- class Js {
3765
+ class Zs {
3651
3766
  /**
3652
3767
  * Resolves a node without limits
3653
3768
  * Default implementation that uses NO_LIMITS
@@ -3656,10 +3771,10 @@ class Js {
3656
3771
  * @returns The resolved node using NO_LIMITS
3657
3772
  */
3658
3773
  resolveWithoutLimits(e) {
3659
- return this.resolve(e, K);
3774
+ return this.resolve(e, _);
3660
3775
  }
3661
3776
  }
3662
- class Ws extends Js {
3777
+ class Hs extends Zs {
3663
3778
  mergingProcessor;
3664
3779
  nodeProvider;
3665
3780
  /**
@@ -3668,7 +3783,7 @@ class Ws extends Js {
3668
3783
  * @param nodeProvider - The provider to use for resolving nodes
3669
3784
  */
3670
3785
  constructor(e, t) {
3671
- super(), this.mergingProcessor = e, this.nodeProvider = he.wrap(t);
3786
+ super(), this.mergingProcessor = e, this.nodeProvider = ye.wrap(t);
3672
3787
  }
3673
3788
  /**
3674
3789
  * Merges a source node into a target node with the given limits
@@ -3746,11 +3861,11 @@ class Ws extends Js {
3746
3861
  if (r.limits.shouldMergePathSegment(String(a), u)) {
3747
3862
  this.enterPathSegment(r, String(a), u);
3748
3863
  try {
3749
- const y = this.materializeForCurrentContext(
3864
+ const f = this.materializeForCurrentContext(
3750
3865
  u,
3751
3866
  r
3752
3867
  );
3753
- l.push(y);
3868
+ l.push(f);
3754
3869
  } finally {
3755
3870
  this.exitPathSegment(r);
3756
3871
  }
@@ -3777,11 +3892,11 @@ class Ws extends Js {
3777
3892
  this.enterPathSegment(r, String(l), t[l]);
3778
3893
  try {
3779
3894
  if (l >= o.length) {
3780
- const y = this.materializeForCurrentContext(
3895
+ const f = this.materializeForCurrentContext(
3781
3896
  t[l],
3782
3897
  r
3783
3898
  );
3784
- o.push(y);
3899
+ o.push(f);
3785
3900
  continue;
3786
3901
  }
3787
3902
  const a = T.calculateBlueIdSync(
@@ -3845,7 +3960,7 @@ class Ws extends Js {
3845
3960
  d(u) && u.length >= a.length || r.inheritedItemsPrefixByPath.set(n, a);
3846
3961
  }
3847
3962
  isInheritedListMarkerNode(e) {
3848
- return d(e) && d(e.getBlueId()) && _e.hasBlueIdOnly(e);
3963
+ return d(e) && d(e.getBlueId()) && ke.hasBlueIdOnly(e);
3849
3964
  }
3850
3965
  mergeChildrenWithInheritedItemsPrefix(e, t, r, n) {
3851
3966
  const i = [...t];
@@ -3880,18 +3995,18 @@ class Ws extends Js {
3880
3995
  if (r.limits.shouldMergePathSegment(l, a)) {
3881
3996
  this.enterPathSegment(r, l, a);
3882
3997
  try {
3883
- const u = i[l], p = this.shouldMergePropertyWithoutPreResolve(
3998
+ const u = i[l], h = this.shouldMergePropertyWithoutPreResolve(
3884
3999
  u,
3885
4000
  a,
3886
4001
  r
3887
4002
  ) ? this.mergeWithContext(u, a, r) : (() => {
3888
- const f = this.materializeForCurrentContext(
4003
+ const g = this.materializeForCurrentContext(
3889
4004
  a,
3890
4005
  r
3891
4006
  );
3892
- return u === void 0 ? f : this.mergeObject(u, f, r);
4007
+ return u === void 0 ? g : this.mergeObject(u, g, r);
3893
4008
  })();
3894
- p !== u && (o || (i = { ...n }, o = !0), i[l] = p);
4009
+ h !== u && (o || (i = { ...n }, o = !0), i[l] = h);
3895
4010
  } finally {
3896
4011
  this.exitPathSegment(r);
3897
4012
  }
@@ -3905,7 +4020,7 @@ class Ws extends Js {
3905
4020
  * through mergeWithContext so source type overlays are resolved.
3906
4021
  */
3907
4022
  shouldMergePropertyWithoutPreResolve(e, t, r) {
3908
- return m(e) || r.limits instanceof we ? !1 : d(t.getItems()) || d(e.getItems());
4023
+ return m(e) || r.limits instanceof Se ? !1 : d(t.getItems()) || d(e.getItems());
3909
4024
  }
3910
4025
  /**
3911
4026
  * Resolves a node by creating a new node and merging the source into it
@@ -3918,7 +4033,7 @@ class Ws extends Js {
3918
4033
  }
3919
4034
  resolveWithContext(e, t) {
3920
4035
  const r = new c(), i = this.mergeWithContext(r, e, t).clone().setName(e.getName()).setDescription(e.getDescription()).setBlueId(e.getBlueId());
3921
- return new ne(i);
4036
+ return new oe(i);
3922
4037
  }
3923
4038
  createResolutionContext(e) {
3924
4039
  return {
@@ -3942,19 +4057,19 @@ class Ws extends Js {
3942
4057
  }
3943
4058
  resolveAndExtendTypeNode(e, t) {
3944
4059
  const r = e.clone();
3945
- return d(r.getBlueId()) && new ft(t.nodeProvider).extend(
4060
+ return d(r.getBlueId()) && new Tt(t.nodeProvider).extend(
3946
4061
  r,
3947
- Le.withSinglePath("/")
4062
+ Ke.withSinglePath("/")
3948
4063
  ), this.resolveWithContext(r, t);
3949
4064
  }
3950
4065
  createResolvedTypeCacheKey(e, t) {
3951
- return t.limits instanceof we ? e : `${e}|${this.getCurrentPointer(t)}`;
4066
+ return t.limits instanceof Se ? e : `${e}|${this.getCurrentPointer(t)}`;
3952
4067
  }
3953
4068
  materializeForCurrentContext(e, t) {
3954
4069
  return e.isResolved() && this.canReuseResolvedSubtree(t) ? e.clone() : this.resolveWithContext(e, t);
3955
4070
  }
3956
4071
  canReuseResolvedSubtree(e) {
3957
- return e.limits instanceof we;
4072
+ return e.limits instanceof Se;
3958
4073
  }
3959
4074
  getCurrentPointer(e) {
3960
4075
  return e.pathStack.length === 0 ? "/" : `/${e.pathStack.join("/")}`;
@@ -3966,7 +4081,7 @@ class Ws extends Js {
3966
4081
  e.pathStack.pop(), e.limits.exitPathSegment();
3967
4082
  }
3968
4083
  }
3969
- class tr {
4084
+ class nr {
3970
4085
  mergingProcessors;
3971
4086
  /**
3972
4087
  * Creates a new SequentialMergingProcessor with the given processors
@@ -3991,14 +4106,14 @@ class tr {
3991
4106
  return this.mergingProcessors.reduce((n, i) => i.postProcess ? i.postProcess(n, t, r) : n, e);
3992
4107
  }
3993
4108
  }
3994
- class rr {
4109
+ class ir {
3995
4110
  process(e, t) {
3996
4111
  const r = t.getValue();
3997
4112
  if (d(r)) {
3998
4113
  const n = e.getValue();
3999
4114
  if (m(n))
4000
4115
  return e.cloneShallow().setValue(r);
4001
- if (!Zs(r, n))
4116
+ if (!Xs(r, n))
4002
4117
  throw new Error(
4003
4118
  `Node values conflict. Source node value: ${r}, target node value: ${n}`
4004
4119
  );
@@ -4006,15 +4121,15 @@ class rr {
4006
4121
  return e;
4007
4122
  }
4008
4123
  }
4009
- const Zs = (s, e) => Z(s) && Z(e) || We(s) && We(e) ? s.eq(e) : s === e;
4010
- class sr {
4124
+ const Xs = (s, e) => Q(s) && Q(e) || Qe(s) && Qe(e) ? s.eq(e) : s === e;
4125
+ class or {
4011
4126
  process(e, t, r) {
4012
4127
  const n = e.getType(), i = t.getType();
4013
4128
  let o = e;
4014
4129
  if (n === void 0)
4015
4130
  o = e.cloneShallow().setType(i);
4016
4131
  else if (i !== void 0) {
4017
- if (!b(
4132
+ if (!w(
4018
4133
  i,
4019
4134
  n,
4020
4135
  r
@@ -4033,27 +4148,27 @@ class sr {
4033
4148
  return o;
4034
4149
  }
4035
4150
  }
4036
- class nr {
4151
+ class lr {
4037
4152
  process(e, t, r) {
4038
4153
  const n = t.getItemType(), i = t.getType();
4039
- if (n !== void 0 && i !== void 0 && !Jt(i, r))
4154
+ if (n !== void 0 && i !== void 0 && !Ee(i, r))
4040
4155
  throw new Error("Source node with itemType must have a List type");
4041
4156
  const o = e.getItemType();
4042
4157
  let l = e;
4043
4158
  if (o === void 0)
4044
4159
  n !== void 0 && (l = e.cloneShallow().setItemType(n));
4045
4160
  else if (n !== void 0) {
4046
- if (!b(
4161
+ if (!w(
4047
4162
  n,
4048
4163
  o,
4049
4164
  r
4050
4165
  )) {
4051
- const p = I.get(n), f = I.get(o);
4166
+ const h = I.get(n), g = I.get(o);
4052
4167
  throw new Error(
4053
4168
  `The source item type '${JSON.stringify(
4054
- p
4169
+ h
4055
4170
  )}' is not a subtype of the target item type '${JSON.stringify(
4056
- f
4171
+ g
4057
4172
  )}'.`
4058
4173
  );
4059
4174
  }
@@ -4061,19 +4176,19 @@ class nr {
4061
4176
  }
4062
4177
  const a = l.getItemType(), u = t.getItems();
4063
4178
  if (a !== void 0 && u !== void 0)
4064
- for (const y of u) {
4065
- const p = y.getType();
4066
- if (p !== void 0 && !b(
4067
- p,
4179
+ for (const f of u) {
4180
+ const h = f.getType();
4181
+ if (h !== void 0 && !w(
4182
+ h,
4068
4183
  a,
4069
4184
  r
4070
4185
  )) {
4071
- const f = I.get(p), v = I.get(
4186
+ const g = I.get(h), v = I.get(
4072
4187
  a
4073
4188
  );
4074
4189
  throw new Error(
4075
4190
  `Item of type '${JSON.stringify(
4076
- f
4191
+ g
4077
4192
  )}' is not a subtype of the list's item type '${JSON.stringify(
4078
4193
  v
4079
4194
  )}'.`
@@ -4083,18 +4198,18 @@ class nr {
4083
4198
  return l;
4084
4199
  }
4085
4200
  }
4086
- class ir {
4201
+ class ar {
4087
4202
  process(e, t, r) {
4088
4203
  const n = t.getKeyType(), i = t.getValueType(), o = t.getType();
4089
- if ((n !== void 0 || i !== void 0) && o !== void 0 && !Wt(o, r))
4204
+ if ((n !== void 0 || i !== void 0) && o !== void 0 && !Ne(o, r))
4090
4205
  throw new Error(
4091
4206
  "Source node with keyType or valueType must have a Dictionary type"
4092
4207
  );
4093
4208
  let l = this.processKeyType(e, t, r);
4094
4209
  l = this.processValueType(l, t, r);
4095
- const a = l.getKeyType(), u = l.getValueType(), y = t.getProperties();
4096
- return (a !== void 0 || u !== void 0) && y !== void 0 && Object.entries(y).forEach(([p, f]) => {
4097
- a !== void 0 && this.validateKeyType(p, a, r), u !== void 0 && this.validateValueType(f, u, r);
4210
+ const a = l.getKeyType(), u = l.getValueType(), f = t.getProperties();
4211
+ return (a !== void 0 || u !== void 0) && f !== void 0 && Object.entries(f).forEach(([h, g]) => {
4212
+ a !== void 0 && this.validateKeyType(h, a, r), u !== void 0 && this.validateValueType(g, u, r);
4098
4213
  }), l;
4099
4214
  }
4100
4215
  processKeyType(e, t, r) {
@@ -4103,7 +4218,7 @@ class ir {
4103
4218
  if (i !== void 0)
4104
4219
  return this.validateBasicKeyType(i, r), e.cloneShallow().setKeyType(i);
4105
4220
  } else if (i !== void 0) {
4106
- if (this.validateBasicKeyType(i, r), !b(
4221
+ if (this.validateBasicKeyType(i, r), !w(
4107
4222
  i,
4108
4223
  n,
4109
4224
  r
@@ -4127,7 +4242,7 @@ class ir {
4127
4242
  if (i !== void 0)
4128
4243
  return e.cloneShallow().setValueType(i);
4129
4244
  } else if (i !== void 0) {
4130
- if (!b(
4245
+ if (!w(
4131
4246
  i,
4132
4247
  n,
4133
4248
  r
@@ -4146,20 +4261,20 @@ class ir {
4146
4261
  return e;
4147
4262
  }
4148
4263
  validateBasicKeyType(e, t) {
4149
- if (!ns(e, t))
4264
+ if (!os(e, t))
4150
4265
  throw new Error("Dictionary key type must be a basic type");
4151
4266
  }
4152
4267
  validateKeyType(e, t, r) {
4153
- if (!is(t, r))
4154
- if (os(t, r)) {
4268
+ if (!ls(t, r))
4269
+ if (as(t, r)) {
4155
4270
  const n = Number.parseInt(e, 10);
4156
4271
  if (Number.isNaN(n) || n.toString() !== e)
4157
4272
  throw new Error(`Key '${e}' is not a valid Integer.`);
4158
- } else if (ls(t, r)) {
4273
+ } else if (cs(t, r)) {
4159
4274
  const n = Number.parseFloat(e);
4160
4275
  if (Number.isNaN(n))
4161
4276
  throw new Error(`Key '${e}' is not a valid Number.`);
4162
- } else if (as(t, r)) {
4277
+ } else if (us(t, r)) {
4163
4278
  if (e.toLowerCase() !== "true" && e.toLowerCase() !== "false")
4164
4279
  throw new Error(`Key '${e}' is not a valid Boolean.`);
4165
4280
  } else
@@ -4169,7 +4284,7 @@ class ir {
4169
4284
  }
4170
4285
  validateValueType(e, t, r) {
4171
4286
  const n = e.getType();
4172
- if (n !== void 0 && !b(n, t, r)) {
4287
+ if (n !== void 0 && !w(n, t, r)) {
4173
4288
  const i = I.get(n), o = I.get(t);
4174
4289
  throw new Error(
4175
4290
  `Value of type '${JSON.stringify(
@@ -4181,16 +4296,16 @@ class ir {
4181
4296
  }
4182
4297
  }
4183
4298
  }
4184
- class or {
4299
+ class cr {
4185
4300
  process(e) {
4186
4301
  return e;
4187
4302
  }
4188
4303
  postProcess(e, t, r) {
4189
4304
  const n = e.getType();
4190
- if (n !== void 0 && cs(n, r)) {
4305
+ if (n !== void 0 && ds(n, r)) {
4191
4306
  const i = e.getItems(), o = e.getProperties();
4192
4307
  if (i !== void 0 && i.length > 0 || o !== void 0 && Object.keys(o).length > 0) {
4193
- const l = us(
4308
+ const l = ps(
4194
4309
  n,
4195
4310
  r
4196
4311
  ), a = n.getName() || "unknown";
@@ -4202,7 +4317,7 @@ class or {
4202
4317
  return e;
4203
4318
  }
4204
4319
  }
4205
- class lr {
4320
+ class ur {
4206
4321
  process(e, t) {
4207
4322
  let r = e;
4208
4323
  const n = t.getName();
@@ -4211,32 +4326,32 @@ class lr {
4211
4326
  return i !== void 0 && i !== r.getDescription() && (r = r.cloneShallow().setDescription(i)), r;
4212
4327
  }
4213
4328
  }
4214
- const ti = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
4329
+ const si = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
4215
4330
  __proto__: null,
4216
- BasicTypesVerifier: or,
4217
- DictionaryProcessor: ir,
4218
- ListProcessor: nr,
4219
- MetadataPropagator: lr,
4220
- SequentialMergingProcessor: tr,
4221
- TypeAssigner: sr,
4222
- ValuePropagator: rr
4331
+ BasicTypesVerifier: cr,
4332
+ DictionaryProcessor: ar,
4333
+ ListProcessor: lr,
4334
+ MetadataPropagator: ur,
4335
+ SequentialMergingProcessor: nr,
4336
+ TypeAssigner: or,
4337
+ ValuePropagator: ir
4223
4338
  }, Symbol.toStringTag, { value: "Module" }));
4224
- function Hs() {
4225
- return new tr([
4226
- new rr(),
4227
- new sr(),
4228
- new nr(),
4339
+ function qs() {
4340
+ return new nr([
4229
4341
  new ir(),
4342
+ new or(),
4230
4343
  new lr(),
4231
- new or()
4344
+ new ar(),
4345
+ new ur(),
4346
+ new cr()
4232
4347
  ]);
4233
4348
  }
4234
- class Xs {
4349
+ class Qs {
4235
4350
  nodeProvider;
4236
4351
  blueIdToInlineValue = /* @__PURE__ */ new Map();
4237
4352
  constructor(e) {
4238
4353
  const { nodeProvider: t, blueIdsMappingGenerator: r } = e;
4239
- this.nodeProvider = t, Object.entries(Fe).forEach(([i, o]) => {
4354
+ this.nodeProvider = t, Object.entries(je).forEach(([i, o]) => {
4240
4355
  this.blueIdToInlineValue.set(i, o);
4241
4356
  });
4242
4357
  const n = r.getAllBlueIds();
@@ -4248,7 +4363,7 @@ class Xs {
4248
4363
  * Returns a new BlueNode where all type references are restored to inline values when possible.
4249
4364
  */
4250
4365
  restore(e) {
4251
- return w.transform(
4366
+ return E.transform(
4252
4367
  e,
4253
4368
  (t) => this.restoreNode(t)
4254
4369
  );
@@ -4297,17 +4412,17 @@ class Xs {
4297
4412
  return this.blueIdToInlineValue.set(e, o), o;
4298
4413
  }
4299
4414
  }
4300
- class qs {
4415
+ class en {
4301
4416
  runtimes;
4302
4417
  contents;
4303
4418
  aliases;
4304
4419
  constructor(e) {
4305
4420
  const t = [];
4306
4421
  for (const r of e)
4307
- t.push(Qs(r));
4422
+ t.push(tn(r));
4308
4423
  this.runtimes = t, this.contents = {}, this.aliases = {};
4309
4424
  for (const r of this.runtimes)
4310
- dn(this.contents, r.contents, r.name), un(this.aliases, r.aliases, r.name);
4425
+ hn(this.contents, r.contents, r.name), pn(this.aliases, r.aliases, r.name);
4311
4426
  }
4312
4427
  getRuntimes() {
4313
4428
  return this.runtimes;
@@ -4330,7 +4445,7 @@ class qs {
4330
4445
  return e;
4331
4446
  }
4332
4447
  getTypeAlias(e) {
4333
- const t = this.toCurrentBlueId(e), r = Fe[t];
4448
+ const t = this.toCurrentBlueId(e), r = je[t];
4334
4449
  if (r)
4335
4450
  return r;
4336
4451
  for (const n of this.runtimes) {
@@ -4353,10 +4468,10 @@ class qs {
4353
4468
  }
4354
4469
  }
4355
4470
  }
4356
- function Qs(s) {
4357
- const e = en(s);
4471
+ function tn(s) {
4472
+ const e = rn(s);
4358
4473
  return Object.values(s.packages).forEach((t) => {
4359
- tn(e, s, t);
4474
+ sn(e, s, t);
4360
4475
  }), {
4361
4476
  name: s.name,
4362
4477
  repositoryVersions: s.repositoryVersions,
@@ -4371,7 +4486,7 @@ function Qs(s) {
4371
4486
  typePackageByCurrentBlueId: e.typePackageByCurrentBlueId
4372
4487
  };
4373
4488
  }
4374
- function en(s) {
4489
+ function rn(s) {
4375
4490
  const e = Object.fromEntries(
4376
4491
  s.repositoryVersions.map((r, n) => [r, n])
4377
4492
  ), t = s.repositoryVersions[s.repositoryVersions.length - 1];
@@ -4388,29 +4503,29 @@ function en(s) {
4388
4503
  currentRepoBlueId: t
4389
4504
  };
4390
4505
  }
4391
- function tn(s, e, t) {
4506
+ function sn(s, e, t) {
4392
4507
  if (s.packageNames.has(t.name))
4393
4508
  throw new Error(`Duplicate package name detected: ${t.name}`);
4394
- s.packageNames.add(t.name), rn(s, t), sn(s, e, t), nn(s, t), on(s, t);
4509
+ s.packageNames.add(t.name), nn(s, t), on(s, e, t), ln(s, t), an(s, t);
4395
4510
  }
4396
- function rn(s, e) {
4511
+ function nn(s, e) {
4397
4512
  Object.entries(e.aliases).forEach(([t, r]) => {
4398
4513
  if (s.aliases[t] && s.aliases[t] !== r)
4399
4514
  throw new Error(`Conflicting alias mapping for ${t}`);
4400
4515
  s.aliases[t] = r;
4401
4516
  });
4402
4517
  }
4403
- function sn(s, e, t) {
4518
+ function on(s, e, t) {
4404
4519
  Object.entries(t.typesMeta).forEach(([r, n]) => {
4405
4520
  if (s.types[r])
4406
4521
  throw new Error(`Duplicate type mapping for BlueId ${r}`);
4407
- const i = ln(
4522
+ const i = cn(
4408
4523
  n,
4409
4524
  e,
4410
4525
  r,
4411
4526
  t.name
4412
4527
  );
4413
- if (s.types[r] = i, s.typePackageByCurrentBlueId[r] = t.name, s.typeAliasByCurrentBlueId[r] = `${t.name}/${n.name}`, i.status === ae && !s.toCurrentBlueIdIndex[r] && (s.toCurrentBlueIdIndex[r] = r), i.status === ae)
4528
+ if (s.types[r] = i, s.typePackageByCurrentBlueId[r] = t.name, s.typeAliasByCurrentBlueId[r] = `${t.name}/${n.name}`, i.status === ue && !s.toCurrentBlueIdIndex[r] && (s.toCurrentBlueIdIndex[r] = r), i.status === ue)
4414
4529
  for (const o of i.versions) {
4415
4530
  const l = s.toCurrentBlueIdIndex[o.typeBlueId];
4416
4531
  if (l && l !== r)
@@ -4421,17 +4536,17 @@ function sn(s, e, t) {
4421
4536
  }
4422
4537
  });
4423
4538
  }
4424
- function nn(s, e) {
4539
+ function ln(s, e) {
4425
4540
  Object.entries(e.contents).forEach(([t, r]) => {
4426
4541
  s.contents[t] = r;
4427
4542
  });
4428
4543
  }
4429
- function on(s, e) {
4544
+ function an(s, e) {
4430
4545
  s.schemas.push(...Object.values(e.schemas));
4431
4546
  }
4432
- function ln(s, e, t, r) {
4433
- if (s.status === st)
4434
- return an(s, e, t, r), {
4547
+ function cn(s, e, t, r) {
4548
+ if (s.status === at)
4549
+ return un(s, e, t, r), {
4435
4550
  ...s,
4436
4551
  versions: s.versions ? [...s.versions] : s.versions
4437
4552
  };
@@ -4454,7 +4569,7 @@ function ln(s, e, t, r) {
4454
4569
  );
4455
4570
  i.add(o.repositoryVersionIndex);
4456
4571
  for (const l of o.attributesAdded ?? [])
4457
- cn(
4572
+ dn(
4458
4573
  l,
4459
4574
  e.name,
4460
4575
  t,
@@ -4465,8 +4580,8 @@ function ln(s, e, t, r) {
4465
4580
  versions: n
4466
4581
  };
4467
4582
  }
4468
- function an(s, e, t, r) {
4469
- if (s.status === st) {
4583
+ function un(s, e, t, r) {
4584
+ if (s.status === at) {
4470
4585
  if (s.versions && s.versions.length > 1)
4471
4586
  throw new Error(
4472
4587
  `Dev type ${r}/${s.name} (${t}) must not declare multiple versions`
@@ -4480,9 +4595,9 @@ function an(s, e, t, r) {
4480
4595
  }
4481
4596
  }
4482
4597
  }
4483
- function cn(s, e, t, r) {
4598
+ function dn(s, e, t, r) {
4484
4599
  try {
4485
- vr(s);
4600
+ br(s);
4486
4601
  } catch (n) {
4487
4602
  const i = n instanceof Error ? n.message : "Unknown error";
4488
4603
  throw new Error(
@@ -4490,7 +4605,7 @@ function cn(s, e, t, r) {
4490
4605
  );
4491
4606
  }
4492
4607
  }
4493
- function un(s, e, t) {
4608
+ function pn(s, e, t) {
4494
4609
  for (const [r, n] of Object.entries(e)) {
4495
4610
  const i = s[r];
4496
4611
  if (i && i !== n)
@@ -4500,11 +4615,11 @@ function un(s, e, t) {
4500
4615
  s[r] = n;
4501
4616
  }
4502
4617
  }
4503
- function dn(s, e, t) {
4618
+ function hn(s, e, t) {
4504
4619
  for (const [r, n] of Object.entries(e)) {
4505
4620
  if (r in s) {
4506
4621
  const i = s[r];
4507
- if (!pn(i, n))
4622
+ if (!fn(i, n))
4508
4623
  throw new Error(
4509
4624
  `Conflicting content for BlueId '${r}' across repositories (from ${t})`
4510
4625
  );
@@ -4513,69 +4628,69 @@ function dn(s, e, t) {
4513
4628
  s[r] = n;
4514
4629
  }
4515
4630
  }
4516
- function pn(s, e) {
4631
+ function fn(s, e) {
4517
4632
  if (s === e) return !0;
4518
4633
  if (s === null || e === null || typeof s != "object" || typeof e != "object") return !1;
4519
- const t = Ze.canonicalize(s), r = Ze.canonicalize(e);
4634
+ const t = et.canonicalize(s), r = et.canonicalize(e);
4520
4635
  return t !== void 0 && t === r;
4521
4636
  }
4522
- class Oe extends Error {
4637
+ class Fe extends Error {
4523
4638
  code;
4524
4639
  details;
4525
4640
  constructor(e, t, r) {
4526
4641
  super(t), this.code = e, this.details = r && r.length > 0 ? r : [], this.name = "BlueError";
4527
4642
  }
4528
4643
  }
4529
- const M = {
4644
+ const L = {
4530
4645
  REPO_UNKNOWN_REPO_BLUE_ID: "REPO_UNKNOWN_REPO_BLUE_ID",
4531
4646
  REPO_UNREPRESENTABLE_IN_TARGET_VERSION: "REPO_UNREPRESENTABLE_IN_TARGET_VERSION",
4532
4647
  INVALID_BLUE_CONTEXT_REPOSITORIES: "INVALID_BLUE_CONTEXT_REPOSITORIES",
4533
4648
  INVALID_REPOSITORY_POINTER: "INVALID_REPOSITORY_POINTER"
4534
- }, hn = /* @__PURE__ */ new Set([
4649
+ }, yn = /* @__PURE__ */ new Set([
4535
4650
  "__proto__",
4536
4651
  "constructor",
4537
4652
  "prototype"
4538
4653
  ]);
4539
- function wt(s) {
4654
+ function Ct(s) {
4540
4655
  const e = s.at(0), t = s.at(-1);
4541
4656
  return !e || !t ? s : e === "'" && t === "'" || e === '"' && t === '"' ? s.slice(1, -1) : s;
4542
4657
  }
4543
- function fn(s, e) {
4658
+ function gn(s, e) {
4544
4659
  const t = s.indexOf("=");
4545
4660
  if (t === -1)
4546
- throw re(e, `Missing '=' in segment '${s.trim()}'`);
4661
+ throw ne(e, `Missing '=' in segment '${s.trim()}'`);
4547
4662
  if (s.indexOf("=", t + 1) !== -1)
4548
- throw re(e, `Unexpected '=' in segment '${s.trim()}'`);
4549
- const r = wt(s.slice(0, t).trim()), n = wt(s.slice(t + 1).trim());
4663
+ throw ne(e, `Unexpected '=' in segment '${s.trim()}'`);
4664
+ const r = Ct(s.slice(0, t).trim()), n = Ct(s.slice(t + 1).trim());
4550
4665
  if (!r)
4551
- throw re(e, "Repository name is empty");
4666
+ throw ne(e, "Repository name is empty");
4552
4667
  if (!n)
4553
- throw re(e, `Repository BlueId is empty for '${r}'`);
4668
+ throw ne(e, `Repository BlueId is empty for '${r}'`);
4554
4669
  return { name: r, value: n };
4555
4670
  }
4556
- function yn(s) {
4671
+ function mn(s) {
4557
4672
  if (s.trim().length === 0)
4558
4673
  return /* @__PURE__ */ Object.create(null);
4559
4674
  const e = /* @__PURE__ */ Object.create(null);
4560
4675
  for (const t of s.split(",")) {
4561
4676
  const r = t.trim();
4562
4677
  if (!r)
4563
- throw re(s, "Empty repository segment");
4564
- const { name: n, value: i } = fn(r, s);
4565
- mn(n, s), e[n] = i;
4678
+ throw ne(s, "Empty repository segment");
4679
+ const { name: n, value: i } = gn(r, s);
4680
+ Tn(n, s), e[n] = i;
4566
4681
  }
4567
4682
  return e;
4568
4683
  }
4569
- function gn(s) {
4570
- return typeof s == "string" ? yn(s) : s;
4684
+ function In(s) {
4685
+ return typeof s == "string" ? mn(s) : s;
4571
4686
  }
4572
- function re(s, e) {
4573
- return new Oe(
4574
- M.INVALID_BLUE_CONTEXT_REPOSITORIES,
4687
+ function ne(s, e) {
4688
+ return new Fe(
4689
+ L.INVALID_BLUE_CONTEXT_REPOSITORIES,
4575
4690
  `Invalid BlueContext repositories value: ${e}`,
4576
4691
  [
4577
4692
  {
4578
- code: M.INVALID_BLUE_CONTEXT_REPOSITORIES,
4693
+ code: L.INVALID_BLUE_CONTEXT_REPOSITORIES,
4579
4694
  message: e,
4580
4695
  locationPath: [],
4581
4696
  context: {
@@ -4586,31 +4701,31 @@ function re(s, e) {
4586
4701
  ]
4587
4702
  );
4588
4703
  }
4589
- function mn(s, e) {
4590
- if (hn.has(s))
4591
- throw re(e, `Forbidden repository name '${s}'`);
4704
+ function Tn(s, e) {
4705
+ if (yn.has(s))
4706
+ throw ne(e, `Forbidden repository name '${s}'`);
4592
4707
  }
4593
- function In(s, e) {
4708
+ function vn(s, e) {
4594
4709
  const t = s.filter((n) => n.repositoryVersionIndex > e).sort((n, i) => i.repositoryVersionIndex - n.repositoryVersionIndex), r = [];
4595
4710
  for (const n of t) {
4596
4711
  const i = [...n.attributesAdded].sort(
4597
- (o, l) => Et(l) - Et(o)
4712
+ (o, l) => At(l) - At(o)
4598
4713
  );
4599
4714
  r.push(...i);
4600
4715
  }
4601
4716
  return r;
4602
4717
  }
4603
- function Et(s) {
4604
- return Ot(s).length;
4718
+ function At(s) {
4719
+ return $t(s).length;
4605
4720
  }
4606
- const Tn = /* @__PURE__ */ new Set([...nt]), B = {
4721
+ const Bn = /* @__PURE__ */ new Set([...ct]), P = {
4607
4722
  core: "core",
4608
4723
  noRuntime: "no-runtime",
4609
4724
  noTargetContext: "no-target-context",
4610
4725
  representable: "representable",
4611
4726
  unrepresentable: "unrepresentable"
4612
4727
  };
4613
- class vn {
4728
+ class bn {
4614
4729
  registry;
4615
4730
  targetRepoVersionIndexes;
4616
4731
  fallbackToCurrentInlineDefinitions;
@@ -4619,7 +4734,7 @@ class vn {
4619
4734
  this.registry = e.registry, this.targetRepoVersionIndexes = e.targetRepoVersionIndexes, this.fallbackToCurrentInlineDefinitions = e.fallbackToCurrentInlineDefinitions;
4620
4735
  }
4621
4736
  transform(e) {
4622
- return w.transform(
4737
+ return E.transform(
4623
4738
  e,
4624
4739
  (t) => this.transformNode(t)
4625
4740
  );
@@ -4649,11 +4764,11 @@ class vn {
4649
4764
  return;
4650
4765
  const i = this.resolveType(n);
4651
4766
  switch (i.kind) {
4652
- case B.core: {
4767
+ case P.core: {
4653
4768
  r.setBlueId(i.blueId);
4654
4769
  return;
4655
4770
  }
4656
- case B.representable: {
4771
+ case P.representable: {
4657
4772
  this.applyDropPointers([r], i.dropPointers, {
4658
4773
  rootIsSchema: !0
4659
4774
  }), this.applyDropPointers(
@@ -4662,34 +4777,34 @@ class vn {
4662
4777
  ), r.setBlueId(i.targetBlueId);
4663
4778
  return;
4664
4779
  }
4665
- case B.noRuntime:
4666
- case B.noTargetContext:
4667
- case B.unrepresentable: {
4780
+ case P.noRuntime:
4781
+ case P.noTargetContext:
4782
+ case P.unrepresentable: {
4668
4783
  if (this.fallbackToCurrentInlineDefinitions) {
4669
4784
  this.inlineDefinition(e, t.setter, n);
4670
4785
  return;
4671
4786
  }
4672
- throw i.kind === B.unrepresentable ? i.error : this.unrepresentableError(
4787
+ throw i.kind === P.unrepresentable ? i.error : this.unrepresentableError(
4673
4788
  n,
4674
- i.kind === B.noTargetContext ? `Repository '${i.runtimeName}' not provided in BlueContext.` : "Type does not belong to any declared repository.",
4675
- i.kind === B.noTargetContext ? i.runtime : void 0,
4676
- i.kind === B.noTargetContext ? i.meta : void 0,
4789
+ i.kind === P.noTargetContext ? `Repository '${i.runtimeName}' not provided in BlueContext.` : "Type does not belong to any declared repository.",
4790
+ i.kind === P.noTargetContext ? i.runtime : void 0,
4791
+ i.kind === P.noTargetContext ? i.meta : void 0,
4677
4792
  void 0,
4678
- i.kind === B.noTargetContext ? i.typeAlias : void 0
4793
+ i.kind === P.noTargetContext ? i.typeAlias : void 0
4679
4794
  );
4680
4795
  }
4681
4796
  }
4682
4797
  }
4683
4798
  resolveType(e) {
4684
- if (X.includes(e))
4685
- return { kind: B.core, blueId: e };
4799
+ if (te.includes(e))
4800
+ return { kind: P.core, blueId: e };
4686
4801
  const t = this.registry.toCurrentBlueId(e), r = this.registry.getTypeAlias(t), n = this.registry.findRuntimeByBlueId(t);
4687
4802
  if (!n || !n.typeMeta)
4688
- return { kind: B.noRuntime };
4803
+ return { kind: P.noRuntime };
4689
4804
  const i = this.targetRepoVersionIndexes[n.runtime.name];
4690
4805
  if (i === void 0)
4691
4806
  return {
4692
- kind: B.noTargetContext,
4807
+ kind: P.noTargetContext,
4693
4808
  currentBlueId: t,
4694
4809
  runtimeName: n.runtime.name,
4695
4810
  runtime: n.runtime,
@@ -4697,11 +4812,11 @@ class vn {
4697
4812
  typeAlias: r
4698
4813
  };
4699
4814
  const o = n.typeMeta;
4700
- if (o.status === st) {
4701
- const p = n.runtime.repositoryVersions.length - 1;
4702
- if (i !== p)
4815
+ if (o.status === at) {
4816
+ const h = n.runtime.repositoryVersions.length - 1;
4817
+ if (i !== h)
4703
4818
  return {
4704
- kind: B.unrepresentable,
4819
+ kind: P.unrepresentable,
4705
4820
  currentBlueId: t,
4706
4821
  error: this.unrepresentableError(
4707
4822
  t,
@@ -4712,18 +4827,18 @@ class vn {
4712
4827
  r
4713
4828
  )
4714
4829
  };
4715
- const f = o.versions?.[0];
4830
+ const g = o.versions?.[0];
4716
4831
  return {
4717
- kind: B.representable,
4832
+ kind: P.representable,
4718
4833
  currentBlueId: t,
4719
- targetBlueId: f?.typeBlueId ?? t,
4834
+ targetBlueId: g?.typeBlueId ?? t,
4720
4835
  dropPointers: []
4721
4836
  };
4722
4837
  }
4723
4838
  const l = o.versions || [];
4724
4839
  if (l.length === 0)
4725
4840
  return {
4726
- kind: B.unrepresentable,
4841
+ kind: P.unrepresentable,
4727
4842
  currentBlueId: t,
4728
4843
  error: this.unrepresentableError(
4729
4844
  t,
@@ -4737,7 +4852,7 @@ class vn {
4737
4852
  const a = l[0].repositoryVersionIndex;
4738
4853
  if (i < a)
4739
4854
  return {
4740
- kind: B.unrepresentable,
4855
+ kind: P.unrepresentable,
4741
4856
  currentBlueId: t,
4742
4857
  error: this.unrepresentableError(
4743
4858
  t,
@@ -4749,18 +4864,18 @@ class vn {
4749
4864
  )
4750
4865
  };
4751
4866
  let u = l[0].typeBlueId;
4752
- for (const p of l)
4753
- p.repositoryVersionIndex <= i && (u = p.typeBlueId);
4754
- const y = o.status === ae ? this.getDropPointers(o, i) : [];
4867
+ for (const h of l)
4868
+ h.repositoryVersionIndex <= i && (u = h.typeBlueId);
4869
+ const f = o.status === ue ? this.getDropPointers(o, i) : [];
4755
4870
  return {
4756
- kind: B.representable,
4871
+ kind: P.representable,
4757
4872
  currentBlueId: t,
4758
4873
  targetBlueId: u,
4759
- dropPointers: y
4874
+ dropPointers: f
4760
4875
  };
4761
4876
  }
4762
4877
  getDropPointers(e, t) {
4763
- return e.status !== ae ? [] : In(e.versions, t);
4878
+ return e.status !== ue ? [] : vn(e.versions, t);
4764
4879
  }
4765
4880
  applyDropPointers(e, t, r = {}) {
4766
4881
  if (e.length === 0 || t.length === 0)
@@ -4773,13 +4888,13 @@ class vn {
4773
4888
  getDictionaryValueTargets(e) {
4774
4889
  const t = e.getProperties();
4775
4890
  return t ? Object.entries(t).filter(
4776
- ([r, n]) => n instanceof c && !Tn.has(r)
4891
+ ([r, n]) => n instanceof c && !Bn.has(r)
4777
4892
  ).map(([, r]) => r) : [];
4778
4893
  }
4779
4894
  deletePropertyAtPointer(e, t, r) {
4780
4895
  let n;
4781
4896
  try {
4782
- n = Ot(t);
4897
+ n = $t(t);
4783
4898
  } catch {
4784
4899
  throw this.invalidPointerError(t);
4785
4900
  }
@@ -4789,22 +4904,22 @@ class vn {
4789
4904
  if (t.length === 0)
4790
4905
  return;
4791
4906
  const [n, ...i] = t;
4792
- if (n === W) {
4907
+ if (n === q) {
4793
4908
  const a = e.getType();
4794
4909
  a && this.applyPointerSegments(a, i, !0);
4795
4910
  return;
4796
4911
  }
4797
- if (n === fe) {
4912
+ if (n === ge) {
4798
4913
  const a = e.getItemType();
4799
4914
  a && this.applyPointerSegments(a, i, !0);
4800
4915
  return;
4801
4916
  }
4802
- if (n === ye) {
4917
+ if (n === me) {
4803
4918
  const a = e.getKeyType();
4804
4919
  a && this.applyPointerSegments(a, i, !0);
4805
4920
  return;
4806
4921
  }
4807
- if (n === ge) {
4922
+ if (n === Ie) {
4808
4923
  const a = e.getValueType();
4809
4924
  a && this.applyPointerSegments(a, i, !0);
4810
4925
  return;
@@ -4844,9 +4959,9 @@ class vn {
4844
4959
  );
4845
4960
  this.inliningStack.add(n);
4846
4961
  try {
4847
- const o = g.deserialize(i);
4962
+ const o = y.deserialize(i);
4848
4963
  o.setBlueId(void 0);
4849
- const l = w.transform(
4964
+ const l = E.transform(
4850
4965
  o,
4851
4966
  (a) => this.transformNode(a)
4852
4967
  );
@@ -4857,9 +4972,9 @@ class vn {
4857
4972
  }
4858
4973
  invalidPointerError(e) {
4859
4974
  const t = `Invalid attributesAdded pointer '${e}'.`;
4860
- return new Oe(M.INVALID_REPOSITORY_POINTER, t, [
4975
+ return new Fe(L.INVALID_REPOSITORY_POINTER, t, [
4861
4976
  {
4862
- code: M.INVALID_REPOSITORY_POINTER,
4977
+ code: L.INVALID_REPOSITORY_POINTER,
4863
4978
  message: t,
4864
4979
  locationPath: [],
4865
4980
  context: { pointer: e }
@@ -4873,43 +4988,43 @@ class vn {
4873
4988
  typeAlias: o,
4874
4989
  ...l
4875
4990
  };
4876
- if (r && (i !== void 0 && (a.requestedRepoBlueId = r.repositoryVersions[i]), a.serverRepoBlueId = r.currentRepoBlueId), n && n.status === ae) {
4877
- const y = n.versions?.[0]?.repositoryVersionIndex;
4878
- y !== void 0 && (a.typeIntroducedInRepoBlueId = r?.repositoryVersions[y]);
4991
+ if (r && (i !== void 0 && (a.requestedRepoBlueId = r.repositoryVersions[i]), a.serverRepoBlueId = r.currentRepoBlueId), n && n.status === ue) {
4992
+ const f = n.versions?.[0]?.repositoryVersionIndex;
4993
+ f !== void 0 && (a.typeIntroducedInRepoBlueId = r?.repositoryVersions[f]);
4879
4994
  }
4880
4995
  const u = {
4881
- code: M.REPO_UNREPRESENTABLE_IN_TARGET_VERSION,
4996
+ code: L.REPO_UNREPRESENTABLE_IN_TARGET_VERSION,
4882
4997
  message: t,
4883
- locationPath: [W],
4998
+ locationPath: [q],
4884
4999
  context: a
4885
5000
  };
4886
- return new Oe(
4887
- M.REPO_UNREPRESENTABLE_IN_TARGET_VERSION,
5001
+ return new Fe(
5002
+ L.REPO_UNREPRESENTABLE_IN_TARGET_VERSION,
4888
5003
  t,
4889
5004
  [u]
4890
5005
  );
4891
5006
  }
4892
5007
  }
4893
- function Qe(s, e) {
4894
- return e ? w.transform(s, (t) => (ve(
5008
+ function nt(s, e) {
5009
+ return e ? E.transform(s, (t) => (be(
4895
5010
  () => t.getType(),
4896
5011
  (r) => t.setType(r),
4897
5012
  e
4898
- ), ve(
5013
+ ), be(
4899
5014
  () => t.getItemType(),
4900
5015
  (r) => t.setItemType(r),
4901
5016
  e
4902
- ), ve(
5017
+ ), be(
4903
5018
  () => t.getKeyType(),
4904
5019
  (r) => t.setKeyType(r),
4905
5020
  e
4906
- ), ve(
5021
+ ), be(
4907
5022
  () => t.getValueType(),
4908
5023
  (r) => t.setValueType(r),
4909
5024
  e
4910
5025
  ), t)) : s;
4911
5026
  }
4912
- function ve(s, e, t) {
5027
+ function be(s, e, t) {
4913
5028
  const r = s();
4914
5029
  if (!r || r.isInlineValue())
4915
5030
  return;
@@ -4919,7 +5034,7 @@ function ve(s, e, t) {
4919
5034
  const i = t.toCurrentBlueId(n);
4920
5035
  i !== n && e(r.clone().setBlueId(i));
4921
5036
  }
4922
- class Bn {
5037
+ class wn {
4923
5038
  registry;
4924
5039
  blueIdMapper;
4925
5040
  constructor(e) {
@@ -4929,8 +5044,8 @@ class Bn {
4929
5044
  const r = this.computeTargetRepoVersionIndexes(t);
4930
5045
  if (Object.keys(r).length === 0)
4931
5046
  return e;
4932
- const n = Qe(e, this.blueIdMapper);
4933
- return new vn({
5047
+ const n = nt(e, this.blueIdMapper);
5048
+ return new bn({
4934
5049
  registry: this.registry,
4935
5050
  targetRepoVersionIndexes: r,
4936
5051
  fallbackToCurrentInlineDefinitions: t.fallbackToCurrentInlineDefinitions !== !1
@@ -4940,7 +5055,7 @@ class Bn {
4940
5055
  const t = {};
4941
5056
  if (!e?.repositories)
4942
5057
  return t;
4943
- const r = typeof e.repositories == "string" ? gn(e.repositories) : e.repositories;
5058
+ const r = typeof e.repositories == "string" ? In(e.repositories) : e.repositories;
4944
5059
  for (const [n, i] of Object.entries(r)) {
4945
5060
  const o = this.registry.findRuntimeByName(n);
4946
5061
  if (!o)
@@ -4958,7 +5073,7 @@ class Bn {
4958
5073
  }
4959
5074
  unknownRepoBlueIdError(e, t, r) {
4960
5075
  const n = `Unknown RepoBlueId '${t}' for repository '${e}'.`, i = {
4961
- code: M.REPO_UNKNOWN_REPO_BLUE_ID,
5076
+ code: L.REPO_UNKNOWN_REPO_BLUE_ID,
4962
5077
  message: n,
4963
5078
  locationPath: [],
4964
5079
  context: {
@@ -4967,18 +5082,18 @@ class Bn {
4967
5082
  serverRepoBlueId: r
4968
5083
  }
4969
5084
  };
4970
- return new Oe(M.REPO_UNKNOWN_REPO_BLUE_ID, n, [
5085
+ return new Fe(L.REPO_UNKNOWN_REPO_BLUE_ID, n, [
4971
5086
  i
4972
5087
  ]);
4973
5088
  }
4974
5089
  }
4975
- class ri {
5090
+ class ni {
4976
5091
  nodeProvider;
4977
5092
  typeSchemaResolver;
4978
5093
  blueDirectivePreprocessor;
4979
5094
  urlContentFetcher;
4980
5095
  blueIdsMappingGenerator;
4981
- globalLimits = K;
5096
+ globalLimits = _;
4982
5097
  mergingProcessor;
4983
5098
  repositories;
4984
5099
  repositoryRegistry;
@@ -4991,20 +5106,20 @@ class ri {
4991
5106
  repositories: i,
4992
5107
  mergingProcessor: o
4993
5108
  } = e;
4994
- this.repositories = i, this.repositoryRegistry = new qs(i ?? []), this.blueContextResolver = new Bn({
5109
+ this.repositories = i, this.repositoryRegistry = new en(i ?? []), this.blueContextResolver = new wn({
4995
5110
  registry: this.repositoryRegistry,
4996
5111
  blueIdMapper: this.repositoryRegistry
4997
5112
  });
4998
- const l = Ns(() => []);
4999
- this.nodeProvider = he.wrap(
5113
+ const l = Cs(() => []);
5114
+ this.nodeProvider = ye.wrap(
5000
5115
  t || l,
5001
5116
  i
5002
- ), this.typeSchemaResolver = r ?? new ds([], {
5117
+ ), this.typeSchemaResolver = r ?? new hs([], {
5003
5118
  nodeProvider: this.nodeProvider
5004
- }), this.typeSchemaResolver?.setNodeProvider(this.nodeProvider), this.mergingProcessor = o ?? Hs(), this.urlContentFetcher = new Gs(n), this.blueDirectivePreprocessor = new Ys(
5119
+ }), this.typeSchemaResolver?.setNodeProvider(this.nodeProvider), this.mergingProcessor = o ?? qs(), this.urlContentFetcher = new Ws(n), this.blueDirectivePreprocessor = new Gs(
5005
5120
  void 0,
5006
5121
  this.urlContentFetcher
5007
- ), this.blueIdsMappingGenerator = new yt(), this.blueIdsMappingGenerator.registerBlueIds(
5122
+ ), this.blueIdsMappingGenerator = new vt(), this.blueIdsMappingGenerator.registerBlueIds(
5008
5123
  this.repositoryRegistry.getAliases()
5009
5124
  );
5010
5125
  const a = this.repositoryRegistry.getRuntimes().flatMap((u) => u.schemas);
@@ -5027,14 +5142,14 @@ class ri {
5027
5142
  */
5028
5143
  nodeToYaml(e, t = "official") {
5029
5144
  const r = this.normalizeNodeToJsonOptions(t), n = r.blueContext ? this.blueContextResolver.transform(e, r.blueContext) : e;
5030
- return Os.get(n, { strategy: r.format });
5145
+ return Ds.get(n, { strategy: r.format });
5031
5146
  }
5032
5147
  nodeToSchemaOutput(e, t) {
5033
- return new Ps(this.typeSchemaResolver).convert(e, t);
5148
+ return new Ss(this.typeSchemaResolver).convert(e, t);
5034
5149
  }
5035
- resolve(e, t = K) {
5150
+ resolve(e, t = _) {
5036
5151
  const r = this.combineWithGlobalLimits(t);
5037
- return new Ws(this.mergingProcessor, this.nodeProvider).resolve(e, r);
5152
+ return new Hs(this.mergingProcessor, this.nodeProvider).resolve(e, r);
5038
5153
  }
5039
5154
  /**
5040
5155
  * Wraps an already resolved (merged) BlueNode in a ResolvedBlueNode.
@@ -5045,10 +5160,10 @@ class ri {
5045
5160
  * @returns A new ResolvedBlueNode instance.
5046
5161
  */
5047
5162
  createResolvedNode(e) {
5048
- return e instanceof ne ? e : new ne(e);
5163
+ return e instanceof oe ? e : new oe(e);
5049
5164
  }
5050
5165
  reverse(e) {
5051
- return new Ht().reverse(e);
5166
+ return new Qt().reverse(e);
5052
5167
  }
5053
5168
  /**
5054
5169
  * Returns a copy of the provided node with any referenced types converted back to their
@@ -5058,33 +5173,33 @@ class ri {
5058
5173
  * repository-backed definitions currently known to this {@link Blue} instance.
5059
5174
  */
5060
5175
  restoreInlineTypes(e) {
5061
- return new Xs({
5176
+ return new Qs({
5062
5177
  nodeProvider: this.nodeProvider,
5063
5178
  blueIdsMappingGenerator: this.blueIdsMappingGenerator
5064
5179
  }).restore(e);
5065
5180
  }
5066
5181
  extend(e, t) {
5067
5182
  const r = this.combineWithGlobalLimits(t);
5068
- new ft(this.nodeProvider).extend(e, r);
5183
+ new Tt(this.nodeProvider).extend(e, r);
5069
5184
  }
5070
5185
  jsonValueToNode(e) {
5071
- const t = this.preprocess(g.deserialize(e));
5072
- return Qe(t, this.repositoryRegistry);
5186
+ const t = this.preprocess(y.deserialize(e));
5187
+ return nt(t, this.repositoryRegistry);
5073
5188
  }
5074
5189
  async jsonValueToNodeAsync(e) {
5075
5190
  const t = await this.preprocessAsync(
5076
- g.deserialize(e)
5191
+ y.deserialize(e)
5077
5192
  );
5078
- return Qe(t, this.repositoryRegistry);
5193
+ return nt(t, this.repositoryRegistry);
5079
5194
  }
5080
5195
  yamlToNode(e) {
5081
- const t = $(e);
5196
+ const t = K(e);
5082
5197
  if (!t)
5083
5198
  throw new Error("Failed to parse YAML to JSON");
5084
5199
  return this.jsonValueToNode(t);
5085
5200
  }
5086
5201
  async yamlToNodeAsync(e) {
5087
- const t = $(e);
5202
+ const t = K(e);
5088
5203
  if (!t)
5089
5204
  throw new Error("Failed to parse YAML to JSON");
5090
5205
  return this.jsonValueToNodeAsync(t);
@@ -5121,26 +5236,26 @@ class ri {
5121
5236
  }
5122
5237
  preprocess(e) {
5123
5238
  const t = this.blueDirectivePreprocessor.process(e);
5124
- return new ie({
5239
+ return new le({
5125
5240
  nodeProvider: this.nodeProvider,
5126
5241
  blueIdsMappingGenerator: this.blueIdsMappingGenerator
5127
5242
  }).preprocessWithDefaultBlue(t);
5128
5243
  }
5129
5244
  async preprocessAsync(e) {
5130
5245
  const t = await this.blueDirectivePreprocessor.processAsync(e);
5131
- return new ie({
5246
+ return new le({
5132
5247
  nodeProvider: this.nodeProvider,
5133
5248
  blueIdsMappingGenerator: this.blueIdsMappingGenerator
5134
5249
  }).preprocessWithDefaultBlue(t);
5135
5250
  }
5136
5251
  transform(e, t) {
5137
- return w.transform(e, t);
5252
+ return E.transform(e, t);
5138
5253
  }
5139
5254
  getNodeProvider() {
5140
5255
  return this.nodeProvider;
5141
5256
  }
5142
5257
  setNodeProvider(e) {
5143
- return this.nodeProvider = he.wrap(
5258
+ return this.nodeProvider = ye.wrap(
5144
5259
  e,
5145
5260
  this.repositories
5146
5261
  ), this.typeSchemaResolver?.setNodeProvider(this.nodeProvider), this;
@@ -5264,7 +5379,7 @@ class ri {
5264
5379
  * @returns true if the node matches the schema type, false otherwise
5265
5380
  */
5266
5381
  isTypeOf(e, t, r) {
5267
- return A.isTypeOf(e, t, {
5382
+ return O.isTypeOf(e, t, {
5268
5383
  checkSchemaExtensions: r?.checkSchemaExtensions,
5269
5384
  typeSchemaResolver: this.typeSchemaResolver
5270
5385
  });
@@ -5284,7 +5399,7 @@ class ri {
5284
5399
  if (!n)
5285
5400
  return !1;
5286
5401
  const i = new c().setBlueId(r);
5287
- return b(n, i, this.nodeProvider);
5402
+ return w(n, i, this.nodeProvider);
5288
5403
  }
5289
5404
  /**
5290
5405
  * Checks if a BlueNode matches a BlueNode type.
@@ -5294,7 +5409,7 @@ class ri {
5294
5409
  * @returns true if the node matches the type, false otherwise.
5295
5410
  */
5296
5411
  isTypeOfNode(e, t) {
5297
- return new ps(this).matchesType(e, t, this.globalLimits);
5412
+ return new fs(this).matchesType(e, t, this.globalLimits);
5298
5413
  }
5299
5414
  /**
5300
5415
  * Sets the global limits for this Blue instance.
@@ -5304,7 +5419,7 @@ class ri {
5304
5419
  * @returns This instance for chaining
5305
5420
  */
5306
5421
  setGlobalLimits(e) {
5307
- return this.globalLimits = e ?? K, this;
5422
+ return this.globalLimits = e ?? _, this;
5308
5423
  }
5309
5424
  /**
5310
5425
  * Gets the current global limits for this Blue instance.
@@ -5321,23 +5436,23 @@ class ri {
5321
5436
  };
5322
5437
  }
5323
5438
  combineWithGlobalLimits(e) {
5324
- return this.globalLimits == K ? e : e == K ? this.globalLimits : je.of(this.globalLimits, e);
5439
+ return this.globalLimits == _ ? e : e == _ ? this.globalLimits : Ye.of(this.globalLimits, e);
5325
5440
  }
5326
5441
  }
5327
- class si extends Qt {
5442
+ class ii extends rr {
5328
5443
  blueIdToContentMap = /* @__PURE__ */ new Map();
5329
5444
  blueIdToMultipleDocumentsMap = /* @__PURE__ */ new Map();
5330
5445
  preprocessor;
5331
5446
  constructor(e = []) {
5332
5447
  super();
5333
- const t = new ie({ nodeProvider: this });
5448
+ const t = new le({ nodeProvider: this });
5334
5449
  this.preprocessor = (r) => t.preprocessWithDefaultBlue(r), e.forEach((r) => this.processNode(r));
5335
5450
  }
5336
5451
  processNode(e) {
5337
- _e.hasItemsOnly(e) ? this.processNodeWithItems(e) : this.processSingleNode(e);
5452
+ ke.hasItemsOnly(e) ? this.processNodeWithItems(e) : this.processSingleNode(e);
5338
5453
  }
5339
5454
  processSingleNode(e) {
5340
- const t = z.parseAndCalculateBlueIdForNode(
5455
+ const t = Z.parseAndCalculateBlueIdForNode(
5341
5456
  e,
5342
5457
  this.preprocessor
5343
5458
  );
@@ -5352,7 +5467,7 @@ class si extends Qt {
5352
5467
  const t = e.getItems();
5353
5468
  if (!t) return;
5354
5469
  this.processNodeList(t);
5355
- const r = z.parseAndCalculateBlueIdForNodeList(
5470
+ const r = Z.parseAndCalculateBlueIdForNodeList(
5356
5471
  t,
5357
5472
  this.preprocessor
5358
5473
  );
@@ -5367,7 +5482,7 @@ class si extends Qt {
5367
5482
  }
5368
5483
  fetchContentByBlueId(e) {
5369
5484
  const t = this.blueIdToContentMap.get(e), r = this.blueIdToMultipleDocumentsMap.get(e);
5370
- return t !== void 0 && r !== void 0 ? z.resolveThisReferences(
5485
+ return t !== void 0 && r !== void 0 ? Z.resolveThisReferences(
5371
5486
  t,
5372
5487
  e,
5373
5488
  r
@@ -5386,9 +5501,9 @@ class si extends Qt {
5386
5501
  */
5387
5502
  addSingleDocs(...e) {
5388
5503
  e.forEach((t) => {
5389
- const r = $(t);
5504
+ const r = K(t);
5390
5505
  if (r !== void 0) {
5391
- const n = g.deserialize(r);
5506
+ const n = y.deserialize(r);
5392
5507
  this.processNode(n);
5393
5508
  }
5394
5509
  });
@@ -5429,9 +5544,9 @@ class si extends Qt {
5429
5544
  * @param doc - The YAML document containing a list
5430
5545
  */
5431
5546
  addListAndItsItemsFromDoc(e) {
5432
- const t = $(e);
5547
+ const t = K(e);
5433
5548
  if (t !== void 0) {
5434
- const n = g.deserialize(t).getItems();
5549
+ const n = y.deserialize(t).getItems();
5435
5550
  n && this.addListAndItsItems(n);
5436
5551
  }
5437
5552
  }
@@ -5451,70 +5566,70 @@ class si extends Qt {
5451
5566
  }
5452
5567
  }
5453
5568
  export {
5454
- xr as Base58Sha256Provider,
5455
- si as BasicNodeProvider,
5456
- ri as Blue,
5569
+ $r as Base58Sha256Provider,
5570
+ ii as BasicNodeProvider,
5571
+ ni as Blue,
5457
5572
  T as BlueIdCalculator,
5458
- kn as BlueIdToCid,
5573
+ Yn as BlueIdToCid,
5459
5574
  c as BlueNode,
5460
- A as BlueNodeTypeSchema,
5461
- Ze as JsonCanonicalizer,
5462
- pt as Limits,
5463
- Ws as Merger,
5464
- ti as MergingProcessors,
5465
- Js as NodeResolver,
5466
- _e as Nodes,
5467
- On as Properties,
5468
- ne as ResolvedBlueNode,
5469
- ds as TypeSchemaResolver,
5470
- Kn as applyBlueNodePatch,
5471
- $e as baseBlueObjectSchema,
5472
- Yn as blueDescriptionField,
5473
- zn as blueIdField,
5474
- Mn as blueIdSchema,
5475
- Gn as blueNameField,
5476
- Jn as blueNodeField,
5477
- Fn as blueObjectBooleanValueSchema,
5478
- xn as blueObjectNumberValueSchema,
5479
- de as blueObjectSchema,
5480
- $n as blueObjectStringListItemsSchema,
5481
- Dn as blueObjectStringValueSchema,
5482
- js as calculateBlueId,
5483
- Zn as calculateBlueIdSync,
5484
- Bt as enrichWithBlueId,
5485
- Wr as getBlueDescriptionAnnotation,
5486
- Xr as getBlueIdAnnotation,
5487
- Qr as getBlueNameAnnotation,
5488
- ts as getBlueNodeAnnotation,
5489
- Hn as getBlueObjectItems,
5490
- qn as getBlueObjectProperties,
5491
- Qn as getBlueObjectTypeLabel,
5492
- Xn as getBlueObjectValue,
5493
- ss as getTypeBlueIdAnnotation,
5494
- Pr as hasBlueObjectBlueIdDefined,
5495
- Nr as hasBlueObjectItemsDefined,
5496
- Ln as hasBlueObjectNameDefined,
5497
- Sr as hasBlueObjectTypeDefined,
5498
- Cr as hasBlueObjectValueDefined,
5499
- We as isBigDecimalNumber,
5500
- Z as isBigIntegerNumber,
5501
- C as isBigNumber,
5502
- Gt as isBlueNodeSchema,
5503
- _n as isBlueObject,
5504
- Us as isBlueObjectResolved,
5505
- jn as isGivenBlueObjectTypeSchema,
5506
- jt as isJsonBlueArray,
5507
- Lt as isJsonBlueObject,
5508
- Un as isJsonBlueValue,
5509
- Ee as isUrl,
5510
- Ae as jsonBlueValueSchema,
5511
- ei as normalizeToBlueObject,
5512
- bt as resolveBlueObjectItems,
5513
- Jr as withBlueDescription,
5514
- Hr as withBlueId,
5515
- qr as withBlueName,
5516
- es as withBlueNode,
5517
- Wn as withTypeBlueId,
5518
- Rs as yamlBlueDump,
5519
- $ as yamlBlueParse
5575
+ O as BlueNodeTypeSchema,
5576
+ et as JsonCanonicalizer,
5577
+ mt as Limits,
5578
+ Hs as Merger,
5579
+ si as MergingProcessors,
5580
+ Zs as NodeResolver,
5581
+ ke as Nodes,
5582
+ Dn as Properties,
5583
+ oe as ResolvedBlueNode,
5584
+ hs as TypeSchemaResolver,
5585
+ zn as applyBlueNodePatch,
5586
+ Ue as baseBlueObjectSchema,
5587
+ Gn as blueDescriptionField,
5588
+ Jn as blueIdField,
5589
+ xn as blueIdSchema,
5590
+ Wn as blueNameField,
5591
+ Zn as blueNodeField,
5592
+ _n as blueObjectBooleanValueSchema,
5593
+ $n as blueObjectNumberValueSchema,
5594
+ he as blueObjectSchema,
5595
+ Ln as blueObjectStringListItemsSchema,
5596
+ Fn as blueObjectStringValueSchema,
5597
+ ks as calculateBlueId,
5598
+ Xn as calculateBlueIdSync,
5599
+ Nt as enrichWithBlueId,
5600
+ Hr as getBlueDescriptionAnnotation,
5601
+ Qr as getBlueIdAnnotation,
5602
+ ts as getBlueNameAnnotation,
5603
+ ss as getBlueNodeAnnotation,
5604
+ qn as getBlueObjectItems,
5605
+ ei as getBlueObjectProperties,
5606
+ ti as getBlueObjectTypeLabel,
5607
+ Qn as getBlueObjectValue,
5608
+ is as getTypeBlueIdAnnotation,
5609
+ Sr as hasBlueObjectBlueIdDefined,
5610
+ Cr as hasBlueObjectItemsDefined,
5611
+ Un as hasBlueObjectNameDefined,
5612
+ Ar as hasBlueObjectTypeDefined,
5613
+ Vr as hasBlueObjectValueDefined,
5614
+ Qe as isBigDecimalNumber,
5615
+ Q as isBigIntegerNumber,
5616
+ R as isBigNumber,
5617
+ Xt as isBlueNodeSchema,
5618
+ jn as isBlueObject,
5619
+ Ks as isBlueObjectResolved,
5620
+ kn as isGivenBlueObjectTypeSchema,
5621
+ zt as isJsonBlueArray,
5622
+ Yt as isJsonBlueObject,
5623
+ Kn as isJsonBlueValue,
5624
+ Ce as isUrl,
5625
+ Me as jsonBlueValueSchema,
5626
+ ri as normalizeToBlueObject,
5627
+ St as resolveBlueObjectItems,
5628
+ Zr as withBlueDescription,
5629
+ qr as withBlueId,
5630
+ es as withBlueName,
5631
+ rs as withBlueNode,
5632
+ Hn as withTypeBlueId,
5633
+ Ms as yamlBlueDump,
5634
+ K as yamlBlueParse
5520
5635
  };