@blue-labs/language 1.37.2 → 1.37.3

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,11 +1,11 @@
1
1
  import M from "big.js";
2
- import { isNullable as I, isNonNullable as d, jsonPrimitiveSchema as Yt, isReadonlyArray as pe, isJsonPrimitive as xe, isPreciseNumberString as it } from "@blue-labs/shared-utils";
3
- import { z as h, ZodOptional as ot, ZodNullable as lt, ZodReadonly as ct, ZodBranded as at, ZodEffects as he, ZodLazy as fe, ZodString as J, ZodNumber as Z, ZodBoolean as ae, ZodBigInt as ue, ZodEnum as Gt, ZodNativeEnum as kt, ZodIntersection as zt, ZodUnion as Jt, ZodObject as Zt, ZodRecord as Ht } from "zod";
4
- import se from "bs58";
5
- import { isObject as ut, isArray as je, isString as Le, omit as dt, pascal as Wt, map as qt } from "radash";
6
- import { sha256 as Xt } from "js-sha256";
2
+ import { isNullable as I, isNonNullable as d, jsonPrimitiveSchema as _t, isReadonlyArray as he, isJsonPrimitive as $e, isPreciseNumberString as nt } from "@blue-labs/shared-utils";
3
+ import { z as h, ZodOptional as it, ZodNullable as ot, ZodReadonly as lt, ZodBranded as ct, ZodEffects as fe, ZodLazy as ge, ZodString as J, ZodNumber as Z, ZodBoolean as ue, ZodBigInt as de, ZodEnum as Kt, ZodNativeEnum as Yt, ZodIntersection as Gt, ZodUnion as zt, ZodObject as kt, ZodRecord as Jt } from "zod";
4
+ import re from "bs58";
5
+ import { isObject as at, isArray as xe, isString as je, omit as ut, pascal as Zt, map as Ht } from "radash";
6
+ import { sha256 as Wt } from "js-sha256";
7
7
  import Pe from "crypto";
8
- import Qt from "base32.js";
8
+ import qt from "base32.js";
9
9
  import U from "js-yaml";
10
10
  class P extends M {
11
11
  constructor(e) {
@@ -17,7 +17,7 @@ class w extends M {
17
17
  super(e);
18
18
  }
19
19
  }
20
- class er {
20
+ class Xt {
21
21
  static get(e, t, r, n = !0) {
22
22
  if (I(t) || !t.startsWith("/"))
23
23
  throw new Error(`Invalid path: ${t}`);
@@ -135,37 +135,37 @@ class er {
135
135
  return d(r) ? r : e;
136
136
  }
137
137
  }
138
- const H = "name", W = "description", ge = "type", Ue = "itemType", _e = "keyType", Ke = "valueType", ve = "value", Ye = "items", j = "blueId", Ge = "blue", tr = [
138
+ const H = "name", W = "description", ye = "type", Le = "itemType", Ue = "keyType", _e = "valueType", be = "value", Ke = "items", j = "blueId", Ye = "blue", Qt = [
139
139
  H,
140
140
  W,
141
- ge,
141
+ ye,
142
+ Le,
142
143
  Ue,
143
144
  _e,
145
+ be,
144
146
  Ke,
145
- ve,
146
- Ye,
147
147
  j,
148
- Ge
149
- ], rr = "Text", sr = "Double", nr = "Integer", ir = "Boolean", or = "List", lr = "Dictionary", ke = [
148
+ Ye
149
+ ], er = "Text", tr = "Double", rr = "Integer", sr = "Boolean", nr = "List", ir = "Dictionary", Ge = [
150
+ er,
151
+ tr,
150
152
  rr,
151
- sr,
152
- nr,
153
- ir
154
- ], pt = [...ke, or, lr], _ = "DLRQwz7MQeCrzjy9bohPNwtCxKEBbKaMK65KBrwjfG6K", K = "7pwXmXYCJtWnd348c2JQGBkm9C4renmZRwxbfaypsx5y", Y = "5WNMiV9Knz63B4dVY5JtMyh3FB4FSGqv7ceScvuapdE1", G = "4EzhSubEimSQD3zrYHRtobfPPWntUuhEz8YcdxHsi12u", ht = "6aehfNAxHLC1PHHoDr3tYtFH3RWNbiWdFancJ1bypXEY", ft = "G7fBT9PSod1RfHLHkpafAGBDVAJMrMhAMY51ERcyXNrj", gt = [
153
+ sr
154
+ ], dt = [...Ge, nr, ir], _ = "DLRQwz7MQeCrzjy9bohPNwtCxKEBbKaMK65KBrwjfG6K", K = "7pwXmXYCJtWnd348c2JQGBkm9C4renmZRwxbfaypsx5y", Y = "5WNMiV9Knz63B4dVY5JtMyh3FB4FSGqv7ceScvuapdE1", G = "4EzhSubEimSQD3zrYHRtobfPPWntUuhEz8YcdxHsi12u", pt = "6aehfNAxHLC1PHHoDr3tYtFH3RWNbiWdFancJ1bypXEY", ht = "G7fBT9PSod1RfHLHkpafAGBDVAJMrMhAMY51ERcyXNrj", ft = [
155
155
  _,
156
156
  K,
157
157
  Y,
158
158
  G
159
159
  ], le = [
160
- ...gt,
161
- ht,
162
- ft
160
+ ...ft,
161
+ pt,
162
+ ht
163
163
  ];
164
164
  Object.fromEntries(
165
- pt.map((s, e) => [s, le[e]])
165
+ dt.map((s, e) => [s, le[e]])
166
166
  );
167
- const yt = Object.fromEntries(
168
- le.map((s, e) => [s, pt[e]])
167
+ const gt = Object.fromEntries(
168
+ le.map((s, e) => [s, dt[e]])
169
169
  );
170
170
  class a {
171
171
  static INTEGER = new a("Integer");
@@ -305,7 +305,7 @@ class a {
305
305
  return !1;
306
306
  }
307
307
  get(e, t) {
308
- return er.get(this, e, t);
308
+ return Xt.get(this, e, t);
309
309
  }
310
310
  getAsNode(e) {
311
311
  const t = this.get(e);
@@ -331,7 +331,7 @@ class a {
331
331
  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}}`;
332
332
  }
333
333
  }
334
- class ye {
334
+ class me {
335
335
  static MIN_BLUE_ID_LENGTH = 41;
336
336
  static MAX_BLUE_ID_LENGTH = 45;
337
337
  static BLUE_ID_PATTERN = /^[1-9A-HJ-NP-Za-km-z]{41,45}(?:#\d+)?$/;
@@ -342,7 +342,7 @@ class ye {
342
342
  if (n < this.MIN_BLUE_ID_LENGTH || n > this.MAX_BLUE_ID_LENGTH)
343
343
  return !1;
344
344
  try {
345
- if (se.decode(r).length !== 32)
345
+ if (re.decode(r).length !== 32)
346
346
  return !1;
347
347
  } catch {
348
348
  return !1;
@@ -357,14 +357,14 @@ class ye {
357
357
  return !0;
358
358
  }
359
359
  }
360
- const Zs = h.string().max(ye.MAX_BLUE_ID_LENGTH, {
360
+ const Ys = h.string().max(me.MAX_BLUE_ID_LENGTH, {
361
361
  message: "Blue Id has a maximum length of 45 characters"
362
- }).min(ye.MIN_BLUE_ID_LENGTH, {
362
+ }).min(me.MIN_BLUE_ID_LENGTH, {
363
363
  message: "Blue Id has a minimum length of 41 characters"
364
364
  }).refine(
365
365
  (s) => {
366
366
  try {
367
- return se.decode(s), !0;
367
+ return re.decode(s), !0;
368
368
  } catch {
369
369
  return !1;
370
370
  }
@@ -372,45 +372,45 @@ const Zs = h.string().max(ye.MAX_BLUE_ID_LENGTH, {
372
372
  {
373
373
  message: "Blue Id must be a valid Base58 string"
374
374
  }
375
- ), ne = h.lazy(
375
+ ), se = h.lazy(
376
376
  () => h.record(h.unknown()).and(
377
377
  h.object({
378
378
  blueId: h.string().optional(),
379
379
  name: h.string().optional(),
380
380
  description: h.string().optional(),
381
- type: ne.optional(),
381
+ type: se.optional(),
382
382
  value: h.union([h.string(), h.number(), h.boolean()]).optional().nullable(),
383
- items: h.array(ne).optional()
383
+ items: h.array(se).optional()
384
384
  })
385
385
  )
386
- ), be = h.object({
386
+ ), we = h.object({
387
387
  blueId: h.string().optional(),
388
388
  name: h.string().optional(),
389
389
  description: h.string().optional(),
390
- type: ne.optional()
391
- }), Hs = be.extend({
390
+ type: se.optional()
391
+ }), Gs = we.extend({
392
392
  value: h.string().optional()
393
- }), Ws = be.extend({
393
+ }), zs = we.extend({
394
394
  value: h.number().optional()
395
- }), qs = be.extend({
395
+ }), ks = we.extend({
396
396
  value: h.boolean().optional()
397
- }), Xs = be.extend({
397
+ }), Js = we.extend({
398
398
  items: h.array(h.string()).optional()
399
- }), Qs = (s) => ne.safeParse(s).success, cr = (s) => d(s) && "blueId" in s && d(s.blueId), en = (s) => d(s) && "name" in s && d(s.name), ar = (s) => d(s) && "items" in s && d(s.items), ur = (s) => d(s) && "type" in s && d(s.type), dr = (s) => d(s) && "value" in s && d(s.value), tn = (s, e) => s.required({ type: !0 }).safeParse(e).success, S = (s) => s instanceof M, L = (s) => S(s) && s instanceof w, De = (s) => S(s) && s instanceof P, pr = h.lazy(
400
- () => h.record(me)
401
- ), hr = h.lazy(
399
+ }), Zs = (s) => se.safeParse(s).success, or = (s) => d(s) && "blueId" in s && d(s.blueId), Hs = (s) => d(s) && "name" in s && d(s.name), lr = (s) => d(s) && "items" in s && d(s.items), cr = (s) => d(s) && "type" in s && d(s.type), ar = (s) => d(s) && "value" in s && d(s.value), Ws = (s, e) => s.required({ type: !0 }).safeParse(e).success, S = (s) => s instanceof M, L = (s) => S(s) && s instanceof w, De = (s) => S(s) && s instanceof P, ur = h.lazy(
400
+ () => h.record(Ie)
401
+ ), dr = h.lazy(
402
402
  () => h.union([
403
- h.array(me),
404
- h.array(me).readonly()
403
+ h.array(Ie),
404
+ h.array(Ie).readonly()
405
405
  ])
406
- ), me = h.lazy(
406
+ ), Ie = h.lazy(
407
407
  () => h.union([
408
- Yt,
409
- pr,
410
- hr,
408
+ _t,
409
+ ur,
410
+ dr,
411
411
  h.instanceof(M)
412
412
  ])
413
- ), mt = (s) => ut(s) && !je(s) && !pe(s) && !S(s), It = (s) => je(s) || pe(s), rn = (s) => It(s) || mt(s) || S(s) || xe(s);
413
+ ), yt = (s) => at(s) && !xe(s) && !he(s) && !S(s), mt = (s) => xe(s) || he(s), qs = (s) => mt(s) || yt(s) || S(s) || $e(s);
414
414
  class g {
415
415
  static deserialize(e) {
416
416
  return g.handleNode(e);
@@ -420,7 +420,7 @@ class g {
420
420
  throw new Error(
421
421
  "This is not a valid JSON-like value. Found 'undefined' as a value."
422
422
  );
423
- if (mt(e)) {
423
+ if (yt(e)) {
424
424
  const t = new a(), r = {};
425
425
  return Object.entries(e).forEach(([n, i]) => {
426
426
  switch (n) {
@@ -444,19 +444,19 @@ class g {
444
444
  t.setDescription(i);
445
445
  }
446
446
  break;
447
- case ge:
447
+ case ye:
448
448
  t.setType(g.handleNode(i));
449
449
  break;
450
- case Ue:
450
+ case Le:
451
451
  t.setItemType(g.handleNode(i));
452
452
  break;
453
- case _e:
453
+ case Ue:
454
454
  t.setKeyType(g.handleNode(i));
455
455
  break;
456
- case Ke:
456
+ case _e:
457
457
  t.setValueType(g.handleNode(i));
458
458
  break;
459
- case ve:
459
+ case be:
460
460
  t.setValue(g.handleValue(i));
461
461
  break;
462
462
  case j:
@@ -464,10 +464,10 @@ class g {
464
464
  throw new Error(`The ${j} field must be a string.`);
465
465
  t.setBlueId(i);
466
466
  break;
467
- case Ye:
467
+ case Ke:
468
468
  t.setItems(g.handleArray(i));
469
469
  break;
470
- case Ge:
470
+ case Ye:
471
471
  t.setBlue(g.handleNode(i));
472
472
  break;
473
473
  default:
@@ -476,7 +476,7 @@ class g {
476
476
  }
477
477
  }), Object.keys(r).length > 0 && t.setProperties(r), t;
478
478
  } else {
479
- if (It(e))
479
+ if (mt(e))
480
480
  return new a().setItems(g.handleArray(e));
481
481
  {
482
482
  const t = e;
@@ -503,7 +503,7 @@ class g {
503
503
  }
504
504
  static handleArray(e) {
505
505
  if (e != null) {
506
- if (ut(e) && !Array.isArray(e))
506
+ if (at(e) && !Array.isArray(e))
507
507
  return [g.handleNode(e)];
508
508
  if (Array.isArray(e))
509
509
  return e.map(g.handleNode);
@@ -511,12 +511,12 @@ class g {
511
511
  }
512
512
  }
513
513
  }
514
- function fr(s) {
514
+ function pr(s) {
515
515
  return s && s.__esModule && Object.prototype.hasOwnProperty.call(s, "default") ? s.default : s;
516
516
  }
517
- var Ee, Qe;
518
- function gr() {
519
- return Qe || (Qe = 1, Ee = function s(e) {
517
+ var Ee, Xe;
518
+ function hr() {
519
+ return Xe || (Xe = 1, Ee = function s(e) {
520
520
  if (typeof e == "number" && isNaN(e))
521
521
  throw new Error("NaN is not allowed");
522
522
  if (typeof e == "number" && !isFinite(e))
@@ -529,11 +529,11 @@ function gr() {
529
529
  }, "")}}`;
530
530
  }), Ee;
531
531
  }
532
- var yr = gr();
533
- const mr = /* @__PURE__ */ fr(yr);
534
- class Ir {
532
+ var fr = hr();
533
+ const gr = /* @__PURE__ */ pr(fr);
534
+ class yr {
535
535
  static canonicalize(e) {
536
- return mr(e);
536
+ return gr(e);
537
537
  }
538
538
  }
539
539
  const Se = typeof process < "u" && process.versions != null && process.versions.node != null;
@@ -559,18 +559,18 @@ class ze {
559
559
  return Se ? Pe : null;
560
560
  }
561
561
  }
562
- class Tr {
562
+ class mr {
563
563
  cryptoEnv = ze.getInstance();
564
564
  applySync(e) {
565
565
  const t = this.canonicalizeInput(e), r = this.cryptoEnv.hasNodeCrypto() ? this.sha256Sync(t) : this.sha256SyncBrowser(t);
566
- return se.encode(r);
566
+ return re.encode(r);
567
567
  }
568
568
  async apply(e) {
569
569
  const t = this.canonicalizeInput(e), r = this.cryptoEnv.hasNodeCrypto() ? this.sha256Sync(t) : await this.sha256Async(t);
570
- return se.encode(r);
570
+ return re.encode(r);
571
571
  }
572
572
  canonicalizeInput(e) {
573
- const t = Ir.canonicalize(e);
573
+ const t = yr.canonicalize(e);
574
574
  if (typeof t != "string")
575
575
  throw new Error("Canonized value must be a string");
576
576
  return t;
@@ -585,7 +585,7 @@ class Tr {
585
585
  return new Uint8Array(r);
586
586
  }
587
587
  sha256SyncBrowser(e) {
588
- return new Uint8Array(Xt.arrayBuffer(e));
588
+ return new Uint8Array(Wt.arrayBuffer(e));
589
589
  }
590
590
  async sha256Async(e) {
591
591
  if (this.cryptoEnv.hasNodeCrypto())
@@ -612,7 +612,7 @@ class m {
612
612
  const r = e.getValue(), n = this.handleValue(r);
613
613
  if (n !== void 0 && t === "simple")
614
614
  return n;
615
- const i = e.getItems()?.map((z) => m.get(z, t));
615
+ const i = e.getItems()?.map((k) => m.get(k, t));
616
616
  if (i !== void 0 && t === "simple")
617
617
  return i;
618
618
  const o = e.getName(), l = e.getDescription();
@@ -626,22 +626,22 @@ class m {
626
626
  o !== void 0 && (c[H] = o), l !== void 0 && (c[W] = l);
627
627
  const u = e.getType();
628
628
  if (t === "official" && r !== void 0 && u === void 0) {
629
- const z = this.inferTypeBlueId(r);
630
- z !== null && (c[ge] = { [j]: z });
631
- } else u !== void 0 && (c[ge] = m.get(u, t));
629
+ const k = this.inferTypeBlueId(r);
630
+ k !== null && (c[ye] = { [j]: k });
631
+ } else u !== void 0 && (c[ye] = m.get(u, t));
632
632
  const y = e.getItemType();
633
- y !== void 0 && (c[Ue] = m.get(y, t));
633
+ y !== void 0 && (c[Le] = m.get(y, t));
634
634
  const p = e.getKeyType();
635
- p !== void 0 && (c[_e] = m.get(p, t));
635
+ p !== void 0 && (c[Ue] = m.get(p, t));
636
636
  const f = e.getValueType();
637
- f !== void 0 && (c[Ke] = m.get(f, t)), n !== void 0 && (c[ve] = n), i !== void 0 && (c[Ye] = i);
637
+ f !== void 0 && (c[_e] = m.get(f, t)), n !== void 0 && (c[be] = n), i !== void 0 && (c[Ke] = i);
638
638
  const v = e.getBlueId();
639
639
  v !== void 0 && (c[j] = v);
640
640
  const O = e.getBlue();
641
- O !== void 0 && (c[Ge] = O);
642
- const k = e.getProperties();
643
- return k !== void 0 && Object.entries(k).forEach(([z, Kt]) => {
644
- c[z] = m.get(Kt, t);
641
+ O !== void 0 && (c[Ye] = O);
642
+ const z = e.getProperties();
643
+ return z !== void 0 && Object.entries(z).forEach(([k, Ut]) => {
644
+ c[k] = m.get(Ut, t);
645
645
  }), c;
646
646
  }
647
647
  static handleValue(e) {
@@ -659,9 +659,9 @@ class m {
659
659
  return typeof e == "string" ? _ : S(e) ? L(e) ? Y : K : typeof e == "boolean" ? G : null;
660
660
  }
661
661
  }
662
- const vr = (s) => xe(s) && d(s);
662
+ const Ir = (s) => $e(s) && d(s);
663
663
  class T {
664
- static INSTANCE = new T(new Tr());
664
+ static INSTANCE = new T(new mr());
665
665
  hashProvider;
666
666
  constructor(e) {
667
667
  this.hashProvider = e;
@@ -696,14 +696,14 @@ class T {
696
696
  }
697
697
  // Internal method to calculate BlueId recursively
698
698
  internalCalculate(e, t) {
699
- return vr(e) || S(e) ? this.applyHash(e.toString(), t) : Array.isArray(e) || pe(e) ? this.calculateList(e, t) : this.calculateMap(e, t);
699
+ return Ir(e) || S(e) ? this.applyHash(e.toString(), t) : Array.isArray(e) || he(e) ? this.calculateList(e, t) : this.calculateMap(e, t);
700
700
  }
701
701
  calculateMap(e, t) {
702
702
  if (e[j] !== void 0)
703
703
  return e[j];
704
704
  const n = Object.keys(e).map((o) => {
705
705
  const l = e[o];
706
- if ([H, ve, W].includes(o))
706
+ if ([H, be, W].includes(o))
707
707
  return t ? [o, l] : Promise.resolve([o, l]);
708
708
  {
709
709
  const c = this.internalCalculate(l, t);
@@ -746,9 +746,9 @@ class T {
746
746
  // Method to clean the input structure by removing null or undefined values
747
747
  cleanStructure(e) {
748
748
  if (e != null) {
749
- if (xe(e) || S(e))
749
+ if ($e(e) || S(e))
750
750
  return e;
751
- if (Array.isArray(e) || pe(e)) {
751
+ if (Array.isArray(e) || he(e)) {
752
752
  const t = e.map((r) => this.cleanStructure(r)).filter(d);
753
753
  return t.length > 0 ? t : void 0;
754
754
  } else if (typeof e == "object") {
@@ -763,12 +763,12 @@ class T {
763
763
  }
764
764
  }
765
765
  }
766
- class sn {
766
+ class Xs {
767
767
  static convert(e) {
768
- const t = se.decode(e), r = new Uint8Array(2 + t.length);
768
+ const t = re.decode(e), r = new Uint8Array(2 + t.length);
769
769
  r[0] = 18, r[1] = 32, r.set(t, 2);
770
770
  const n = new Uint8Array(2 + r.length);
771
- return n[0] = 1, n[1] = 85, n.set(r, 2), "b" + new Qt.Encoder({ type: "rfc4648", lc: !0 }).write(n).finalize().replace(/=/g, "");
771
+ return n[0] = 1, n[1] = 85, n.set(r, 2), "b" + new qt.Encoder({ type: "rfc4648", lc: !0 }).write(n).finalize().replace(/=/g, "");
772
772
  }
773
773
  }
774
774
  class E {
@@ -811,12 +811,12 @@ class E {
811
811
  return r;
812
812
  }
813
813
  }
814
- const D = (s) => !!s && typeof s == "object" && !Array.isArray(s) && !(s instanceof a), C = (s) => s instanceof w || s instanceof P, br = (s) => s.replace(/~1/g, "/").replace(/~0/g, "~");
814
+ const D = (s) => !!s && typeof s == "object" && !Array.isArray(s) && !(s instanceof a), C = (s) => s instanceof w || s instanceof P, Tr = (s) => s.replace(/~1/g, "/").replace(/~0/g, "~");
815
815
  function Q(s) {
816
816
  if (s === "/") return [];
817
817
  if (!s.startsWith("/"))
818
818
  throw new Error(`Path must start with '/': ${s}`);
819
- return s.split("/").slice(1).map(br);
819
+ return s.split("/").slice(1).map(Tr);
820
820
  }
821
821
  function q(s) {
822
822
  if (s === "-") return -1;
@@ -829,7 +829,7 @@ function q(s) {
829
829
  );
830
830
  return e;
831
831
  }
832
- function Tt(s, e, t, r = !0) {
832
+ function It(s, e, t, r = !0) {
833
833
  switch (e) {
834
834
  case "name":
835
835
  return t ? r ? s.getName() ?? null : s : s.getName();
@@ -859,9 +859,9 @@ function Tt(s, e, t, r = !0) {
859
859
  return;
860
860
  }
861
861
  }
862
- function et(s, e, t = !0) {
862
+ function Qe(s, e, t = !0) {
863
863
  if (s instanceof a) {
864
- const r = Tt(
864
+ const r = It(
865
865
  s,
866
866
  e,
867
867
  !0,
@@ -905,14 +905,14 @@ function ee(s, e) {
905
905
  };
906
906
  let t = s;
907
907
  for (let n = 0; n < e.length - 1; ++n) {
908
- const i = e[n], o = et(t, i);
908
+ const i = e[n], o = Qe(t, i);
909
909
  if (o === void 0)
910
910
  throw new Error(`Cannot resolve '/${e.slice(0, n + 1).join("/")}'`);
911
911
  t = o;
912
912
  }
913
913
  const r = e[e.length - 1];
914
914
  if (t instanceof a) {
915
- const n = et(t, r, !1);
915
+ const n = Qe(t, r, !1);
916
916
  if ((typeof n != "object" || n === null || C(n)) && !(n instanceof a) && !Array.isArray(n) && ["name", "description", "value", "blueId"].includes(r))
917
917
  return {
918
918
  parent: t,
@@ -925,9 +925,9 @@ function ee(s, e) {
925
925
  key: Array.isArray(t) ? q(r) : r
926
926
  };
927
927
  }
928
- function Je(s, e) {
928
+ function ke(s, e) {
929
929
  if (s instanceof a) {
930
- const t = e, r = Tt(s, t, !1);
930
+ const t = e, r = It(s, t, !1);
931
931
  if (r !== void 0 || [
932
932
  "name",
933
933
  "description",
@@ -967,7 +967,7 @@ function Fe(s) {
967
967
  e[t] = Fe(r);
968
968
  return e;
969
969
  }
970
- function Ze(s, e, t) {
970
+ function Je(s, e, t) {
971
971
  if (s instanceof a) {
972
972
  const r = e;
973
973
  switch (r) {
@@ -1031,7 +1031,7 @@ function Ze(s, e, t) {
1031
1031
  }
1032
1032
  Array.isArray(s) ? s.splice(q(e), 1) : D(s) && (t === void 0 ? delete s[e] : s[e] = t);
1033
1033
  }
1034
- function wr(s, e, t, r) {
1034
+ function vr(s, e, t, r) {
1035
1035
  let n = -1;
1036
1036
  if (e !== "-" && (n = typeof e == "number" ? e : parseInt(e, 10), isNaN(n)))
1037
1037
  throw new Error(
@@ -1057,7 +1057,7 @@ function wr(s, e, t, r) {
1057
1057
  } else
1058
1058
  i.splice(n, 0, t);
1059
1059
  }
1060
- function Ie(s, e, t, r) {
1060
+ function Te(s, e, t, r) {
1061
1061
  if (Array.isArray(s)) {
1062
1062
  const n = e === "-" ? s.length : q(e);
1063
1063
  if (!r && n > s.length)
@@ -1079,7 +1079,7 @@ function Ie(s, e, t, r) {
1079
1079
  return;
1080
1080
  }
1081
1081
  if (s instanceof a) {
1082
- e === "-" || typeof e == "number" && !isNaN(e) || typeof e == "string" && /^\d+$/.test(e) ? wr(s, e, N(t), r) : Ze(s, e, t);
1082
+ e === "-" || typeof e == "number" && !isNaN(e) || typeof e == "string" && /^\d+$/.test(e) ? vr(s, e, N(t), r) : Je(s, e, t);
1083
1083
  return;
1084
1084
  }
1085
1085
  if (D(s)) {
@@ -1088,7 +1088,7 @@ function Ie(s, e, t, r) {
1088
1088
  }
1089
1089
  throw new Error(`Cannot insert into parent of type ${typeof s}`);
1090
1090
  }
1091
- function Br(s, e) {
1091
+ function br(s, e) {
1092
1092
  if (Array.isArray(s)) {
1093
1093
  const t = q(e);
1094
1094
  t === -1 && e === "-" ? s.length > 0 && s.pop() : t >= 0 && t < s.length && s.splice(t, 1);
@@ -1103,7 +1103,7 @@ function Br(s, e) {
1103
1103
  return;
1104
1104
  }
1105
1105
  }
1106
- Ze(s, e, void 0);
1106
+ Je(s, e, void 0);
1107
1107
  } else D(s) && delete s[e];
1108
1108
  }
1109
1109
  function Oe(s) {
@@ -1131,11 +1131,11 @@ function $(s, e) {
1131
1131
  }
1132
1132
  return !1;
1133
1133
  }
1134
- function vt(s, e) {
1134
+ function Tt(s, e) {
1135
1135
  const { parent: t, key: r } = ee(s, Q(e));
1136
- return Je(t, r);
1136
+ return ke(t, r);
1137
1137
  }
1138
- function bt(s, e, t) {
1138
+ function vt(s, e, t) {
1139
1139
  const r = Q(e);
1140
1140
  if (r.length === 0 && e === "/") {
1141
1141
  const o = N(t);
@@ -1143,9 +1143,9 @@ function bt(s, e, t) {
1143
1143
  return;
1144
1144
  }
1145
1145
  const { parent: n, key: i } = ee(s, r);
1146
- Ie(n, i, t, !0);
1146
+ Te(n, i, t, !0);
1147
1147
  }
1148
- function Nr(s, e, t) {
1148
+ function wr(s, e, t) {
1149
1149
  const r = Q(e);
1150
1150
  if (r.length === 0 && e === "/") {
1151
1151
  if (s.getItems() && Array.isArray(t)) {
@@ -1158,9 +1158,9 @@ function Nr(s, e, t) {
1158
1158
  return !0;
1159
1159
  }
1160
1160
  const { parent: n, key: i } = ee(s, r);
1161
- return Ie(n, i, t, !1), !0;
1161
+ return Te(n, i, t, !1), !0;
1162
1162
  }
1163
- function Pr(s, e, t) {
1163
+ function Br(s, e, t) {
1164
1164
  const r = Q(e);
1165
1165
  if (r.length === 0 && e === "/") {
1166
1166
  const l = N(t);
@@ -1168,39 +1168,39 @@ function Pr(s, e, t) {
1168
1168
  }
1169
1169
  const { parent: n, key: i, actualTarget: o } = ee(s, r);
1170
1170
  if (o !== void 0 && n instanceof a)
1171
- Ze(n, i, t);
1171
+ Je(n, i, t);
1172
1172
  else {
1173
- const l = Je(n, i), c = Array.isArray(n) || n instanceof a && n.getItems() && (typeof i == "number" || typeof i == "string" && /^\d+$/.test(i));
1173
+ const l = ke(n, i), c = Array.isArray(n) || n instanceof a && n.getItems() && (typeof i == "number" || typeof i == "string" && /^\d+$/.test(i));
1174
1174
  if (l === void 0) {
1175
1175
  if (c)
1176
1176
  throw new Error(
1177
1177
  `REPLACE failed: Target array index '${i.toString()}' is out of bounds or does not exist at path '${e}'.`
1178
1178
  );
1179
- Ie(n, i, t, !0);
1179
+ Te(n, i, t, !0);
1180
1180
  } else
1181
- Ie(n, i, t, !0);
1181
+ Te(n, i, t, !0);
1182
1182
  }
1183
1183
  return !0;
1184
1184
  }
1185
- function wt(s, e) {
1185
+ function bt(s, e) {
1186
1186
  const t = Q(e);
1187
1187
  if (t.length === 0 && e === "/")
1188
1188
  return s.setValue(null), s.setItems(void 0), s.setProperties(void 0), !0;
1189
1189
  const { parent: r, key: n } = ee(s, t);
1190
- return Br(r, n), !0;
1190
+ return br(r, n), !0;
1191
1191
  }
1192
- function Er(s, e, t) {
1193
- const r = Oe(vt(s, e));
1194
- return bt(s, t, r), !0;
1192
+ function Nr(s, e, t) {
1193
+ const r = Oe(Tt(s, e));
1194
+ return vt(s, t, r), !0;
1195
1195
  }
1196
- function Sr(s, e, t) {
1197
- const r = Q(e), { parent: n, key: i } = ee(s, r), o = Je(n, i);
1196
+ function Pr(s, e, t) {
1197
+ const r = Q(e), { parent: n, key: i } = ee(s, r), o = ke(n, i);
1198
1198
  if (o === void 0)
1199
1199
  throw new Error(`MOVE failed: 'from' location '${e}' does not exist.`);
1200
- return wt(s, e) ? (bt(s, t, o), !0) : !1;
1200
+ return bt(s, e) ? (vt(s, t, o), !0) : !1;
1201
1201
  }
1202
- function Ar(s, e, t) {
1203
- const r = vt(s, e);
1202
+ function Er(s, e, t) {
1203
+ const r = Tt(s, e);
1204
1204
  let n = t;
1205
1205
  if (r instanceof a)
1206
1206
  if ((t === null || typeof t == "string" || typeof t == "number" || typeof t == "boolean" || C(t)) && (r.isInlineValue() || r.getValue() !== void 0)) {
@@ -1226,118 +1226,93 @@ function Ar(s, e, t) {
1226
1226
  }
1227
1227
  return !0;
1228
1228
  }
1229
- function Vr(s, e) {
1229
+ function Sr(s, e) {
1230
1230
  switch (e.op) {
1231
1231
  case "add":
1232
- return Nr(s, e.path, e.val);
1232
+ return wr(s, e.path, e.val);
1233
1233
  case "replace":
1234
- return Pr(s, e.path, e.val);
1234
+ return Br(s, e.path, e.val);
1235
1235
  case "remove":
1236
- return wt(s, e.path);
1236
+ return bt(s, e.path);
1237
1237
  case "copy":
1238
- return Er(s, e.from, e.path);
1238
+ return Nr(s, e.from, e.path);
1239
1239
  case "move":
1240
- return Sr(s, e.from, e.path);
1240
+ return Pr(s, e.from, e.path);
1241
1241
  case "test":
1242
- return Ar(s, e.path, e.val);
1242
+ return Er(s, e.path, e.val);
1243
1243
  }
1244
1244
  }
1245
- function nn(s, e, t = !1) {
1245
+ function Qs(s, e, t = !1) {
1246
1246
  const r = t ? s : s.clone();
1247
- return Vr(r, e), r;
1247
+ return Sr(r, e), r;
1248
1248
  }
1249
1249
  const Ae = Symbol.for("zod-schema-annotations");
1250
- function Cr() {
1250
+ function Ar() {
1251
1251
  if (typeof globalThis < "u") return globalThis;
1252
1252
  if (typeof global < "u") return global;
1253
1253
  if (typeof window < "u") return window;
1254
1254
  if (typeof self < "u") return self;
1255
1255
  throw new Error("Unable to locate global object");
1256
1256
  }
1257
- function Bt() {
1258
- const s = Cr();
1257
+ function wt() {
1258
+ const s = Ar();
1259
1259
  return Ae in s || (s[Ae] = /* @__PURE__ */ new WeakMap()), s[Ae];
1260
1260
  }
1261
- function te(s, e) {
1262
- const t = Bt(), r = t.get(s) || {};
1261
+ function ce(s, e) {
1262
+ const t = wt(), r = t.get(s) || {};
1263
1263
  return t.set(s, { ...r, ...e }), s;
1264
1264
  }
1265
- const A = (s) => Bt().get(s), Mr = (s) => (e) => {
1266
- const t = A(e);
1267
- return te(e, {
1265
+ const V = (s) => wt().get(s), Vr = (s) => (e) => {
1266
+ const t = V(e);
1267
+ return ce(e, {
1268
1268
  ...t,
1269
1269
  blueDescription: s
1270
1270
  });
1271
- }, Dr = (s) => {
1272
- const e = A(s);
1273
- return d(e) && Le(e.blueDescription) ? e.blueDescription : null;
1274
- }, on = (s) => Mr(s)(h.string().optional()), Fr = h.union([h.string(), h.boolean()]), Or = (s) => (e) => {
1275
- const t = A(e);
1276
- return te(e, {
1271
+ }, Cr = (s) => {
1272
+ const e = V(s);
1273
+ return d(e) && je(e.blueDescription) ? e.blueDescription : null;
1274
+ }, en = (s) => Vr(s)(h.string().optional()), Mr = h.union([h.string(), h.boolean()]), Dr = (s) => (e) => {
1275
+ const t = V(e);
1276
+ return ce(e, {
1277
1277
  ...t,
1278
1278
  blueId: s
1279
1279
  });
1280
- }, Rr = (s) => {
1281
- const e = A(s), t = Fr.safeParse(e?.blueId);
1280
+ }, Fr = (s) => {
1281
+ const e = V(s), t = Mr.safeParse(e?.blueId);
1282
1282
  return t.success ? t.data : null;
1283
- }, ln = (s) => Or(s ?? !0)(h.string()), $r = (s) => (e) => {
1284
- const t = A(e);
1285
- return te(e, {
1283
+ }, tn = (s) => Dr(s ?? !0)(h.string()), Or = (s) => (e) => {
1284
+ const t = V(e);
1285
+ return ce(e, {
1286
1286
  ...t,
1287
1287
  blueName: s
1288
1288
  });
1289
- }, xr = (s) => {
1290
- const e = A(s);
1291
- return d(e) && Le(e.blueName) ? e.blueName : null;
1292
- }, cn = (s) => {
1289
+ }, Rr = (s) => {
1290
+ const e = V(s);
1291
+ return d(e) && je(e.blueName) ? e.blueName : null;
1292
+ }, rn = (s) => {
1293
1293
  const e = h.string().optional();
1294
- return $r(s)(e);
1295
- }, jr = () => (s) => {
1296
- const e = A(s);
1297
- return te(s, {
1294
+ return Or(s)(e);
1295
+ }, $r = () => (s) => {
1296
+ const e = V(s);
1297
+ return ce(s, {
1298
1298
  ...e,
1299
1299
  blueNode: !0
1300
1300
  });
1301
- }, Lr = (s) => {
1302
- const e = A(s);
1301
+ }, xr = (s) => {
1302
+ const e = V(s);
1303
1303
  return d(e) && d(e.blueNode) && e.blueNode === !0 ? e.blueNode : null;
1304
- }, Nt = (s) => !!Lr(s), an = () => {
1304
+ }, Bt = (s) => !!xr(s), sn = () => {
1305
1305
  const s = h.instanceof(a);
1306
- return jr()(s);
1307
- }, Re = "extendedFrom", Ur = ({
1308
- schema: s,
1309
- baseSchema: e
1310
- }) => {
1311
- const t = A(s) || {};
1312
- return te(s, {
1313
- ...t,
1314
- [Re]: e
1315
- });
1316
- }, _r = (s) => {
1317
- const e = A(s);
1318
- return d(e) && e[Re] ? e[Re] : null;
1319
- }, Pt = (s, e) => {
1320
- const t = _r(s);
1321
- return I(t) ? !1 : t?._def === e?._def ? !0 : Pt(t, e);
1322
- }, Kr = (s) => new Proxy(s, {
1323
- get(e, t, r) {
1324
- return t === "extend" ? function(...n) {
1325
- const i = e.extend(...n);
1326
- return Ur({
1327
- schema: i,
1328
- baseSchema: e
1329
- });
1330
- } : Reflect.get(e, t, r);
1331
- }
1332
- }), Yr = h.object({
1306
+ return $r()(s);
1307
+ }, jr = h.object({
1333
1308
  value: h.array(h.string()).optional(),
1334
1309
  defaultValue: h.string().optional()
1335
- }), Gr = (s) => {
1336
- const e = A(s), t = Yr.passthrough().safeParse(e?.typeBlueId);
1310
+ }), Lr = (s) => {
1311
+ const e = V(s), t = jr.passthrough().safeParse(e?.typeBlueId);
1337
1312
  return t.success ? t.data : null;
1338
- }, un = (s) => (e) => {
1339
- const t = A(e), r = typeof s == "string" ? { value: [s] } : s, n = Kr(e);
1340
- return te(n, {
1313
+ }, nn = (s) => (e) => {
1314
+ const t = V(e), r = typeof s == "string" ? { value: [s] } : s;
1315
+ return ce(e, {
1341
1316
  ...t,
1342
1317
  typeBlueId: {
1343
1318
  ...t?.typeBlueId || {},
@@ -1345,72 +1320,207 @@ const A = (s) => Bt().get(s), Mr = (s) => (e) => {
1345
1320
  }
1346
1321
  });
1347
1322
  };
1348
- class we {
1323
+ class ne {
1349
1324
  static resolveBlueId(e) {
1350
- const t = Gr(e);
1325
+ const t = Lr(e);
1351
1326
  if (I(t))
1352
1327
  return null;
1353
1328
  const r = t.defaultValue;
1354
1329
  if (d(r))
1355
1330
  return r;
1356
1331
  const n = t.value?.[0];
1357
- return d(n) ? n : we.getRepositoryBlueId(t, e);
1332
+ return d(n) ? n : ne.getRepositoryBlueId(t, e);
1358
1333
  }
1359
1334
  static getRepositoryBlueId(e, t) {
1360
1335
  throw new Error("Not implemented");
1361
1336
  }
1362
1337
  }
1363
- class V {
1338
+ class A {
1364
1339
  // TODO: Enhance to support schemas associated with multiple blueIds
1365
1340
  static isTypeOf(e, t, r) {
1366
- const n = we.resolveBlueId(t), i = e.getType()?.getBlueId();
1341
+ const n = ne.resolveBlueId(t), i = e.getType()?.getBlueId();
1367
1342
  if (I(n) || I(i))
1368
1343
  return !1;
1369
1344
  if (n === i)
1370
1345
  return !0;
1371
1346
  if (r?.checkSchemaExtensions && d(r.typeSchemaResolver)) {
1372
1347
  const o = r.typeSchemaResolver.resolveSchema(e);
1373
- return V.checkSchemaExtension(o, t);
1348
+ return A.checkSchemaExtension(o, t, {
1349
+ typeSchemaResolver: r.typeSchemaResolver
1350
+ });
1374
1351
  }
1375
1352
  return !1;
1376
1353
  }
1377
1354
  /**
1378
1355
  * Checks if a schema extends a base schema.
1379
1356
  */
1380
- static checkSchemaExtension(e, t) {
1357
+ static checkSchemaExtension(e, t, r) {
1381
1358
  if (!d(e))
1382
1359
  return !1;
1383
- const r = V.unwrapSchema(e), n = V.unwrapSchema(t);
1384
- return Pt(r, n);
1360
+ const n = A.unwrapSchema(e), i = A.unwrapSchema(t);
1361
+ return d(r?.typeSchemaResolver) ? r.typeSchemaResolver.isSchemaExtendedFrom(
1362
+ n,
1363
+ i
1364
+ ) : !1;
1385
1365
  }
1386
1366
  static isWrapperType(e) {
1387
- return e instanceof ot || e instanceof lt || e instanceof ct || e instanceof at || e instanceof he || e instanceof fe;
1367
+ return e instanceof it || e instanceof ot || e instanceof lt || e instanceof ct || e instanceof fe || e instanceof ge;
1388
1368
  }
1389
1369
  static unwrapSchema(e) {
1390
- return Nt(e) ? e : V.isWrapperType(e) ? e instanceof he ? V.unwrapSchema(e.innerType()) : e instanceof fe ? V.unwrapSchema(e.schema) : V.unwrapSchema(e.unwrap()) : e;
1370
+ return Bt(e) ? e : A.isWrapperType(e) ? e instanceof fe ? A.unwrapSchema(e.innerType()) : e instanceof ge ? A.unwrapSchema(e.schema) : A.unwrapSchema(e.unwrap()) : e;
1371
+ }
1372
+ }
1373
+ function et(s, e) {
1374
+ const t = s.getType();
1375
+ if (t === void 0)
1376
+ return;
1377
+ const r = t.getBlueId();
1378
+ if (r !== void 0) {
1379
+ if (le.includes(
1380
+ r
1381
+ )) {
1382
+ const i = gt[r];
1383
+ return new a().setBlueId(r).setName(i);
1384
+ }
1385
+ const n = e.fetchByBlueId(r);
1386
+ if (!n || n.length === 0)
1387
+ return;
1388
+ if (n.length > 1)
1389
+ throw new Error(
1390
+ `Expected a single node for type with blueId '${r}', but found multiple.`
1391
+ );
1392
+ return n[0];
1391
1393
  }
1394
+ return t;
1392
1395
  }
1393
- class kr {
1396
+ function b(s, e, t) {
1397
+ const r = T.calculateBlueIdSync(s), n = T.calculateBlueIdSync(e);
1398
+ if (r === n)
1399
+ return !0;
1400
+ if (r && le.includes(
1401
+ r
1402
+ )) {
1403
+ let c = e;
1404
+ for (; c !== void 0; ) {
1405
+ if (T.calculateBlueIdSync(c) === r)
1406
+ return !0;
1407
+ c = et(c, t);
1408
+ }
1409
+ return !1;
1410
+ }
1411
+ let i = s;
1412
+ const o = s.getBlueId();
1413
+ if (o) {
1414
+ const c = t.fetchByBlueId(o);
1415
+ c && c.length === 1 && (i = c[0]);
1416
+ }
1417
+ let l = i;
1418
+ for (; l !== void 0; ) {
1419
+ if (T.calculateBlueIdSync(l) === n)
1420
+ return !0;
1421
+ l = et(l, t);
1422
+ }
1423
+ return !1;
1424
+ }
1425
+ function Ur(s, e) {
1426
+ return ft.some((t) => {
1427
+ const r = new a().setBlueId(t);
1428
+ return b(s, r, e);
1429
+ });
1430
+ }
1431
+ function _r(s, e) {
1432
+ const t = new a().setBlueId(_);
1433
+ return b(s, t, e);
1434
+ }
1435
+ function Kr(s, e) {
1436
+ const t = new a().setBlueId(Y);
1437
+ return b(s, t, e);
1438
+ }
1439
+ function Yr(s, e) {
1440
+ const t = new a().setBlueId(K);
1441
+ return b(s, t, e);
1442
+ }
1443
+ function Gr(s, e) {
1444
+ const t = new a().setBlueId(G);
1445
+ return b(s, t, e);
1446
+ }
1447
+ function Nt(s, e) {
1448
+ const t = new a().setBlueId(pt);
1449
+ return b(s, t, e);
1450
+ }
1451
+ function Pt(s, e) {
1452
+ const t = new a().setBlueId(ht);
1453
+ return b(s, t, e);
1454
+ }
1455
+ function zr(s, e) {
1456
+ return Ge.some((t) => {
1457
+ const r = new a().setName(t);
1458
+ return b(s, r, e);
1459
+ });
1460
+ }
1461
+ function kr(s, e) {
1462
+ for (const t of Ge) {
1463
+ const r = new a().setName(t);
1464
+ if (b(s, r, e))
1465
+ return t;
1466
+ }
1467
+ throw new Error(
1468
+ `Cannot determine the basic type for node of type "${s.getName() || "unknown"}".`
1469
+ );
1470
+ }
1471
+ class Jr {
1394
1472
  blueIdMap = /* @__PURE__ */ new Map();
1395
- constructor(e) {
1396
- this.registerSchemas(e);
1473
+ nodeProvider;
1474
+ constructor(e = [], t) {
1475
+ this.nodeProvider = t?.nodeProvider ?? null, this.registerSchemas(e);
1397
1476
  }
1398
1477
  registerSchemas(e) {
1399
1478
  for (const t of e)
1400
1479
  this.registerSchema(t);
1401
1480
  }
1402
1481
  registerSchema(e) {
1403
- const t = we.resolveBlueId(e);
1482
+ const t = ne.resolveBlueId(e);
1404
1483
  if (d(t)) {
1405
1484
  if (this.blueIdMap.has(t))
1406
1485
  throw new Error(`Duplicate BlueId value: ${t}`);
1407
1486
  this.blueIdMap.set(t, e);
1408
1487
  }
1409
1488
  }
1489
+ setNodeProvider(e) {
1490
+ this.nodeProvider = e;
1491
+ }
1410
1492
  resolveSchema(e) {
1411
1493
  const t = this.getEffectiveBlueId(e);
1412
1494
  return I(t) ? null : this.blueIdMap.get(t);
1413
1495
  }
1496
+ isSchemaExtendedFrom(e, t) {
1497
+ if (I(e))
1498
+ return !1;
1499
+ const r = this.getBlueIdForSchema(e), n = this.getBlueIdForSchema(t);
1500
+ if (I(r) || I(n))
1501
+ return !1;
1502
+ if (r === n)
1503
+ return !0;
1504
+ if (d(this.nodeProvider))
1505
+ try {
1506
+ const i = new a().setBlueId(r), o = new a().setBlueId(n);
1507
+ if (b(i, o, this.nodeProvider))
1508
+ return !0;
1509
+ } catch {
1510
+ }
1511
+ return !1;
1512
+ }
1513
+ getBlueIdForSchema(e) {
1514
+ if (I(e))
1515
+ return null;
1516
+ const t = ne.resolveBlueId(e);
1517
+ if (d(t))
1518
+ return t;
1519
+ for (const [r, n] of this.blueIdMap)
1520
+ if (n === e || n._def === e._def)
1521
+ return r;
1522
+ return null;
1523
+ }
1414
1524
  getEffectiveBlueId(e) {
1415
1525
  const t = e.getType();
1416
1526
  return d(t) && d(t.getBlueId()) ? t.getBlueId() : d(t) ? T.calculateBlueIdSync(t) : null;
@@ -1432,7 +1542,7 @@ const B = {
1432
1542
  BLUE: "blue",
1433
1543
  ITEMS: "items"
1434
1544
  };
1435
- class He {
1545
+ class Ze {
1436
1546
  /**
1437
1547
  * Check if a node is empty (has no fields set)
1438
1548
  */
@@ -1536,12 +1646,12 @@ class He {
1536
1646
  }
1537
1647
  }
1538
1648
  }
1539
- class We {
1649
+ class He {
1540
1650
  }
1541
- class re {
1651
+ class te {
1542
1652
  static convert(e) {
1543
- const t = new $e();
1544
- return re.traverseNode(e, "", t), t.build();
1653
+ const t = new Re();
1654
+ return te.traverseNode(e, "", t), t.build();
1545
1655
  }
1546
1656
  static traverseNode(e, t, r) {
1547
1657
  if (!e)
@@ -1554,12 +1664,12 @@ class re {
1554
1664
  if (n)
1555
1665
  for (const [c, u] of Object.entries(n)) {
1556
1666
  const y = `${t}/${c}`;
1557
- re.traverseNode(u, y, r);
1667
+ te.traverseNode(u, y, r);
1558
1668
  }
1559
1669
  if (i)
1560
1670
  for (let c = 0; c < i.length; c++) {
1561
1671
  const u = `${t}/${c}`;
1562
- re.traverseNode(i[c], u, r);
1672
+ te.traverseNode(i[c], u, r);
1563
1673
  }
1564
1674
  }
1565
1675
  }
@@ -1567,7 +1677,7 @@ function tt(s, e) {
1567
1677
  const t = s.split(e), r = [...t].reverse().findIndex((i) => i !== ""), n = r === -1 ? 0 : t.length - r;
1568
1678
  return t.slice(0, n);
1569
1679
  }
1570
- class Be extends We {
1680
+ class Be extends He {
1571
1681
  allowedPaths;
1572
1682
  maxDepth;
1573
1683
  currentPath = [];
@@ -1660,7 +1770,7 @@ class Be extends We {
1660
1770
  * @returns The path limits
1661
1771
  */
1662
1772
  static withMaxDepth(e) {
1663
- const t = new $e().setMaxDepth(e);
1773
+ const t = new Re().setMaxDepth(e);
1664
1774
  for (let r = 1; r <= e; r++) {
1665
1775
  const n = "/" + Array(r).fill("*").join("/");
1666
1776
  t.addPath(n);
@@ -1673,17 +1783,17 @@ class Be extends We {
1673
1783
  * @returns The path limits
1674
1784
  */
1675
1785
  static withSinglePath(e) {
1676
- return new $e().addPath(e).build();
1786
+ return new Re().addPath(e).build();
1677
1787
  }
1678
1788
  /**
1679
1789
  * Creates path limits by analyzing the structure of a node.
1680
1790
  * Leaf paths (no properties and no items) are added as allowed paths.
1681
1791
  */
1682
1792
  static fromNode(e) {
1683
- return re.convert(e);
1793
+ return te.convert(e);
1684
1794
  }
1685
1795
  }
1686
- class $e {
1796
+ class Re {
1687
1797
  allowedPaths = /* @__PURE__ */ new Set();
1688
1798
  maxDepth = Number.MAX_SAFE_INTEGER;
1689
1799
  /**
@@ -1710,7 +1820,7 @@ class $e {
1710
1820
  return new Be(this.allowedPaths, this.maxDepth);
1711
1821
  }
1712
1822
  }
1713
- class zr extends We {
1823
+ class Zr extends He {
1714
1824
  /**
1715
1825
  * Determines if a path segment should be extended - always returns true
1716
1826
  * @returns Always true
@@ -1736,7 +1846,7 @@ class zr extends We {
1736
1846
  exitPathSegment() {
1737
1847
  }
1738
1848
  }
1739
- class Ne extends We {
1849
+ class Ne extends He {
1740
1850
  limits;
1741
1851
  /**
1742
1852
  * Creates a composite limits with the specified limit strategies
@@ -1796,106 +1906,8 @@ class Ne extends We {
1796
1906
  return new Ne(e);
1797
1907
  }
1798
1908
  }
1799
- const R = new zr();
1800
- function rt(s, e) {
1801
- const t = s.getType();
1802
- if (t === void 0)
1803
- return;
1804
- const r = t.getBlueId();
1805
- if (r !== void 0) {
1806
- if (le.includes(
1807
- r
1808
- )) {
1809
- const i = yt[r];
1810
- return new a().setBlueId(r).setName(i);
1811
- }
1812
- const n = e.fetchByBlueId(r);
1813
- if (!n || n.length === 0)
1814
- return;
1815
- if (n.length > 1)
1816
- throw new Error(
1817
- `Expected a single node for type with blueId '${r}', but found multiple.`
1818
- );
1819
- return n[0];
1820
- }
1821
- return t;
1822
- }
1823
- function b(s, e, t) {
1824
- const r = T.calculateBlueIdSync(s), n = T.calculateBlueIdSync(e);
1825
- if (r === n)
1826
- return !0;
1827
- if (r && le.includes(
1828
- r
1829
- )) {
1830
- let c = e;
1831
- for (; c !== void 0; ) {
1832
- if (T.calculateBlueIdSync(c) === r)
1833
- return !0;
1834
- c = rt(c, t);
1835
- }
1836
- return !1;
1837
- }
1838
- let i = s;
1839
- const o = s.getBlueId();
1840
- if (o) {
1841
- const c = t.fetchByBlueId(o);
1842
- c && c.length === 1 && (i = c[0]);
1843
- }
1844
- let l = i;
1845
- for (; l !== void 0; ) {
1846
- if (T.calculateBlueIdSync(l) === n)
1847
- return !0;
1848
- l = rt(l, t);
1849
- }
1850
- return !1;
1851
- }
1852
- function Jr(s, e) {
1853
- return gt.some((t) => {
1854
- const r = new a().setBlueId(t);
1855
- return b(s, r, e);
1856
- });
1857
- }
1858
- function Zr(s, e) {
1859
- const t = new a().setBlueId(_);
1860
- return b(s, t, e);
1861
- }
1862
- function Hr(s, e) {
1863
- const t = new a().setBlueId(Y);
1864
- return b(s, t, e);
1865
- }
1866
- function Wr(s, e) {
1867
- const t = new a().setBlueId(K);
1868
- return b(s, t, e);
1869
- }
1870
- function qr(s, e) {
1871
- const t = new a().setBlueId(G);
1872
- return b(s, t, e);
1873
- }
1874
- function Et(s, e) {
1875
- const t = new a().setBlueId(ht);
1876
- return b(s, t, e);
1877
- }
1878
- function St(s, e) {
1879
- const t = new a().setBlueId(ft);
1880
- return b(s, t, e);
1881
- }
1882
- function Xr(s, e) {
1883
- return ke.some((t) => {
1884
- const r = new a().setName(t);
1885
- return b(s, r, e);
1886
- });
1887
- }
1888
- function Qr(s, e) {
1889
- for (const t of ke) {
1890
- const r = new a().setName(t);
1891
- if (b(s, r, e))
1892
- return t;
1893
- }
1894
- throw new Error(
1895
- `Cannot determine the basic type for node of type "${s.getName() || "unknown"}".`
1896
- );
1897
- }
1898
- class es {
1909
+ const R = new Zr();
1910
+ class Hr {
1899
1911
  blue;
1900
1912
  constructor(e) {
1901
1913
  this.blue = e;
@@ -2047,7 +2059,7 @@ class es {
2047
2059
  * shape of the requested core list or dictionary type.
2048
2060
  */
2049
2061
  matchesImplicitStructure(e, t) {
2050
- return t === void 0 || e.getType() !== void 0 ? !1 : Et(t, this.blue.getNodeProvider()) ? this.isImplicitListStructure(e) : St(t, this.blue.getNodeProvider()) ? this.isImplicitDictionaryStructure(e) : !1;
2062
+ return t === void 0 || e.getType() !== void 0 ? !1 : Nt(t, this.blue.getNodeProvider()) ? this.isImplicitListStructure(e) : Pt(t, this.blue.getNodeProvider()) ? this.isImplicitDictionaryStructure(e) : !1;
2051
2063
  }
2052
2064
  isImplicitListStructure(e) {
2053
2065
  return e.getItems() !== void 0 && e.getValue() === void 0;
@@ -2056,11 +2068,11 @@ class es {
2056
2068
  return e.getProperties() !== void 0 && e.getValue() === void 0;
2057
2069
  }
2058
2070
  }
2059
- const ts = (s) => s instanceof ot || s instanceof lt || s instanceof ct || s instanceof at || s instanceof he || s instanceof fe, rs = (s) => s instanceof J || s instanceof Z || s instanceof ae || s instanceof ue;
2060
- class At {
2071
+ const Wr = (s) => s instanceof it || s instanceof ot || s instanceof lt || s instanceof ct || s instanceof fe || s instanceof ge, qr = (s) => s instanceof J || s instanceof Z || s instanceof ue || s instanceof de;
2072
+ class Et {
2061
2073
  static convertValue(e, t) {
2062
2074
  const r = e.getType()?.getBlueId(), n = e.getValue();
2063
- return I(n) ? rs(t) && He.isValidValueNode(e) ? this.getDefaultPrimitiveValue(t) : n : _ === r ? this.convertFromString(String(n), t) : K === r || n instanceof P ? this.convertFromBigDecimal(
2075
+ return I(n) ? qr(t) && Ze.isValidValueNode(e) ? this.getDefaultPrimitiveValue(t) : n : _ === r ? this.convertFromString(String(n), t) : K === r || n instanceof P ? this.convertFromBigDecimal(
2064
2076
  new P(n?.toString()),
2065
2077
  t
2066
2078
  ) : Y === r || n instanceof w ? this.convertFromBigInteger(
@@ -2069,13 +2081,13 @@ class At {
2069
2081
  ) : G === r || typeof n == "boolean" ? this.convertFromBoolean(!!n, t) : this.convertFromString(String(n), t);
2070
2082
  }
2071
2083
  static convertFromString(e, t) {
2072
- if (!t || t instanceof J || t instanceof Gt || t instanceof kt)
2084
+ if (!t || t instanceof J || t instanceof Kt || t instanceof Yt)
2073
2085
  return e;
2074
2086
  if (t instanceof Z)
2075
2087
  return Number(e);
2076
- if (t instanceof ae)
2077
- return e.toLowerCase() === "true";
2078
2088
  if (t instanceof ue)
2089
+ return e.toLowerCase() === "true";
2090
+ if (t instanceof de)
2079
2091
  return BigInt(e);
2080
2092
  throw new Error(`Cannot convert String to ${t._def.typeName}`);
2081
2093
  }
@@ -2089,20 +2101,20 @@ class At {
2089
2101
  static convertFromBigInteger(e, t) {
2090
2102
  if (t instanceof Z)
2091
2103
  return e.toNumber();
2092
- if (t instanceof ue)
2104
+ if (t instanceof de)
2093
2105
  return BigInt(e.toString());
2094
2106
  if (t instanceof J)
2095
2107
  return e.toString();
2096
2108
  throw new Error(`Cannot convert Number to ${t._def.typeName}`);
2097
2109
  }
2098
2110
  static convertFromBoolean(e, t) {
2099
- if (!t || t instanceof ae)
2111
+ if (!t || t instanceof ue)
2100
2112
  return e;
2101
2113
  if (t instanceof J)
2102
2114
  return e.toString();
2103
2115
  if (t instanceof Z)
2104
2116
  return Number(e);
2105
- if (t instanceof ue)
2117
+ if (t instanceof de)
2106
2118
  return BigInt(e);
2107
2119
  throw new Error(`Cannot convert Boolean to ${t._def.typeName}`);
2108
2120
  }
@@ -2110,7 +2122,7 @@ class At {
2110
2122
  if (!e) return null;
2111
2123
  if (e instanceof Z)
2112
2124
  return 0;
2113
- if (e instanceof ae)
2125
+ if (e instanceof ue)
2114
2126
  return !1;
2115
2127
  if (e instanceof J)
2116
2128
  return "";
@@ -2119,12 +2131,12 @@ class At {
2119
2131
  );
2120
2132
  }
2121
2133
  }
2122
- class ss {
2134
+ class Xr {
2123
2135
  convert(e, t) {
2124
- return At.convertValue(e, t);
2136
+ return Et.convertValue(e, t);
2125
2137
  }
2126
2138
  }
2127
- class ns {
2139
+ class Qr {
2128
2140
  constructor(e) {
2129
2141
  this.nodeToObjectConverter = e;
2130
2142
  }
@@ -2132,26 +2144,26 @@ class ns {
2132
2144
  return this.convertFields(e, t);
2133
2145
  }
2134
2146
  convertFields(e, t) {
2135
- if (t instanceof zt) {
2147
+ if (t instanceof Gt) {
2136
2148
  const r = t._def.left, n = t._def.right, i = this.convert(e, r), o = this.convert(e, n);
2137
2149
  return { ...i, ...o };
2138
2150
  }
2139
- if (t instanceof Jt)
2151
+ if (t instanceof zt)
2140
2152
  throw new Error("Union not supported");
2141
- if (t instanceof Zt)
2153
+ if (t instanceof kt)
2142
2154
  return Object.keys(t.shape).reduce(
2143
2155
  (n, i) => {
2144
- const o = e.getProperties(), l = t.shape[i], c = Rr(l);
2156
+ const o = e.getProperties(), l = t.shape[i], c = Fr(l);
2145
2157
  if (d(c)) {
2146
- const v = Le(c) ? c : i, O = o?.[v], k = O ? T.calculateBlueIdSync(O) : void 0;
2147
- return n[i] = k, n;
2158
+ const v = je(c) ? c : i, O = o?.[v], z = O ? T.calculateBlueIdSync(O) : void 0;
2159
+ return n[i] = z, n;
2148
2160
  }
2149
- const u = xr(l);
2161
+ const u = Rr(l);
2150
2162
  if (d(u)) {
2151
2163
  const v = o?.[u];
2152
2164
  return n[i] = v?.getName(), n;
2153
2165
  }
2154
- const y = Dr(l);
2166
+ const y = Cr(l);
2155
2167
  if (d(y)) {
2156
2168
  const v = o?.[y];
2157
2169
  return n[i] = v?.getDescription(), n;
@@ -2178,7 +2190,7 @@ class ns {
2178
2190
  throw new Error("Unknown schema type, " + t._def.typeName);
2179
2191
  }
2180
2192
  }
2181
- class is {
2193
+ class es {
2182
2194
  constructor(e) {
2183
2195
  this.nodeToObjectConverter = e;
2184
2196
  }
@@ -2192,7 +2204,7 @@ class is {
2192
2204
  );
2193
2205
  }
2194
2206
  }
2195
- class os {
2207
+ class ts {
2196
2208
  constructor(e) {
2197
2209
  this.nodeToObjectConverter = e;
2198
2210
  }
@@ -2206,7 +2218,7 @@ class os {
2206
2218
  return new Set(i);
2207
2219
  }
2208
2220
  }
2209
- class ls {
2221
+ class rs {
2210
2222
  constructor(e) {
2211
2223
  this.nodeToObjectConverter = e;
2212
2224
  }
@@ -2219,22 +2231,22 @@ class ls {
2219
2231
  return d(c) && Object.entries(c).forEach(([u, y]) => {
2220
2232
  const p = new a().setValue(u);
2221
2233
  p.setType(new a().setBlueId(_));
2222
- const f = At.convertValue(p, r), v = this.nodeToObjectConverter.convert(y, n);
2234
+ const f = Et.convertValue(p, r), v = this.nodeToObjectConverter.convert(y, n);
2223
2235
  i.set(f, v);
2224
- }), t instanceof Ht ? Object.fromEntries(i) : i;
2236
+ }), t instanceof Jt ? Object.fromEntries(i) : i;
2225
2237
  }
2226
2238
  }
2227
- class cs {
2239
+ class ss {
2228
2240
  convert(e) {
2229
2241
  return m.get(e);
2230
2242
  }
2231
2243
  }
2232
- class as {
2244
+ class ns {
2233
2245
  convert(e) {
2234
2246
  return m.get(e);
2235
2247
  }
2236
2248
  }
2237
- class us {
2249
+ class is {
2238
2250
  constructor(e) {
2239
2251
  this.nodeToObjectConverter = e;
2240
2252
  }
@@ -2248,7 +2260,7 @@ class us {
2248
2260
  );
2249
2261
  }
2250
2262
  }
2251
- const ds = h.union([
2263
+ const os = h.union([
2252
2264
  h.literal("ZodString"),
2253
2265
  h.literal("ZodNumber"),
2254
2266
  h.literal("ZodBoolean"),
@@ -2264,53 +2276,54 @@ const ds = h.union([
2264
2276
  h.literal("ZodAny"),
2265
2277
  h.literal("ZodTuple")
2266
2278
  ]);
2267
- class ps {
2279
+ class ls {
2268
2280
  constructor(e) {
2269
- this.nodeToObjectConverter = e, this.registerConverters(), this.complexObjectConverter = new ns(
2281
+ this.nodeToObjectConverter = e, this.registerConverters(), this.complexObjectConverter = new Qr(
2270
2282
  this.nodeToObjectConverter
2271
2283
  );
2272
2284
  }
2273
2285
  converters = /* @__PURE__ */ new Map();
2274
2286
  complexObjectConverter;
2275
2287
  registerConverters() {
2276
- const e = new ss(), t = new is(this.nodeToObjectConverter), r = new us(this.nodeToObjectConverter), n = new os(this.nodeToObjectConverter), i = new ls(this.nodeToObjectConverter);
2277
- 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 cs()), this.converters.set("ZodAny", new as()), 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);
2288
+ const e = new Xr(), t = new es(this.nodeToObjectConverter), r = new is(this.nodeToObjectConverter), n = new ts(this.nodeToObjectConverter), i = new rs(this.nodeToObjectConverter);
2289
+ 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 ss()), this.converters.set("ZodAny", new ns()), 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);
2278
2290
  }
2279
2291
  getConverter(e) {
2280
2292
  const t = this.getSchemaTypeName(e);
2281
2293
  return this.converters.get(t) ?? this.complexObjectConverter;
2282
2294
  }
2283
2295
  getSchemaTypeName(e) {
2284
- if (ts(e))
2285
- return e instanceof he ? this.getSchemaTypeName(e.innerType()) : e instanceof fe ? this.getSchemaTypeName(e.schema) : this.getSchemaTypeName(e.unwrap());
2296
+ if (Wr(e))
2297
+ return e instanceof fe ? this.getSchemaTypeName(e.innerType()) : e instanceof ge ? this.getSchemaTypeName(e.schema) : this.getSchemaTypeName(e.unwrap());
2286
2298
  const t = e._def.typeName;
2287
2299
  try {
2288
- return ds.parse(t);
2300
+ return os.parse(t);
2289
2301
  } catch {
2290
2302
  throw new Error(`Schema type name ${t} is not supported`);
2291
2303
  }
2292
2304
  }
2293
2305
  }
2294
- class hs {
2306
+ class cs {
2295
2307
  constructor(e) {
2296
- this.typeSchemaResolver = e, this.converterFactory = new ps(this);
2308
+ this.typeSchemaResolver = e, this.converterFactory = new ls(this);
2297
2309
  }
2298
2310
  converterFactory;
2299
2311
  convert(e, t) {
2300
- const r = this.typeSchemaResolver?.resolveSchema(e), n = V.unwrapSchema(t);
2301
- if (Nt(n))
2312
+ const r = this.typeSchemaResolver?.resolveSchema(e), n = A.unwrapSchema(t);
2313
+ if (Bt(n))
2302
2314
  return e;
2303
2315
  let i = n;
2304
- return V.checkSchemaExtension(
2316
+ return A.checkSchemaExtension(
2305
2317
  r,
2306
- n
2318
+ n,
2319
+ { typeSchemaResolver: this.typeSchemaResolver }
2307
2320
  ) && d(r) && (i = r), this.convertWithType(e, i);
2308
2321
  }
2309
2322
  convertWithType(e, t) {
2310
2323
  return this.converterFactory.getConverter(t).convert(e, t);
2311
2324
  }
2312
2325
  }
2313
- class Vt {
2326
+ class St {
2314
2327
  reverse(e) {
2315
2328
  const t = new a();
2316
2329
  return this.reverseNode(t, e, e.getType()), t;
@@ -2371,7 +2384,7 @@ class Vt {
2371
2384
  t,
2372
2385
  r
2373
2386
  ), u = new a();
2374
- this.reverseNode(u, l, c), He.isEmptyNode(u) || (i[o] = u);
2387
+ this.reverseNode(u, l, c), Ze.isEmptyNode(u) || (i[o] = u);
2375
2388
  }
2376
2389
  Object.keys(i).length > 0 && e.setProperties(i);
2377
2390
  }
@@ -2433,7 +2446,7 @@ class ie extends a {
2433
2446
  * @returns The minimal node representation
2434
2447
  */
2435
2448
  getMinimalNode() {
2436
- return new Vt().reverse(this);
2449
+ return new St().reverse(this);
2437
2450
  }
2438
2451
  getMinimalBlueId() {
2439
2452
  const e = this.getMinimalNode();
@@ -2457,7 +2470,7 @@ class ie extends a {
2457
2470
  t !== void 0 && this.setValue(t);
2458
2471
  }
2459
2472
  }
2460
- class ce {
2473
+ class ae {
2461
2474
  /**
2462
2475
  * Fetches the first node associated with the given Blue ID
2463
2476
  * Default implementation that takes the first node from fetchByBlueId result
@@ -2470,14 +2483,14 @@ class ce {
2470
2483
  return t && t.length > 0 ? t[0] : null;
2471
2484
  }
2472
2485
  }
2473
- function fs(s) {
2474
- return new class extends ce {
2486
+ function as(s) {
2487
+ return new class extends ae {
2475
2488
  fetchByBlueId(e) {
2476
2489
  return s(e);
2477
2490
  }
2478
2491
  }();
2479
2492
  }
2480
- class gs extends ce {
2493
+ class us extends ae {
2481
2494
  nodeProviders;
2482
2495
  constructor(e) {
2483
2496
  super(), this.nodeProviders = e;
@@ -2504,31 +2517,31 @@ class gs extends ce {
2504
2517
  return this.nodeProviders;
2505
2518
  }
2506
2519
  }
2507
- const Ve = U.types.float.options, ys = {
2520
+ const Ve = U.types.float.options, ds = {
2508
2521
  ...Ve,
2509
2522
  construct: (s) => {
2510
2523
  const e = s.replace(/_/g, "").toLowerCase();
2511
- if (!it(e))
2524
+ if (!nt(e))
2512
2525
  return new P(e);
2513
2526
  if (Ve.construct)
2514
2527
  return Ve.construct(s);
2515
2528
  }
2516
- }, ms = new U.Type("tag:yaml.org,2002:float", ys), Ce = U.types.int.options, Is = {
2529
+ }, ps = new U.Type("tag:yaml.org,2002:float", ds), Ce = U.types.int.options, hs = {
2517
2530
  ...Ce,
2518
2531
  construct: (s) => {
2519
2532
  let e = s;
2520
- if (e.indexOf("_") !== -1 && (e = e.replace(/_/g, "")), !it(e))
2533
+ if (e.indexOf("_") !== -1 && (e = e.replace(/_/g, "")), !nt(e))
2521
2534
  return new w(e);
2522
2535
  if (Ce.construct)
2523
2536
  return Ce.construct(s);
2524
2537
  }
2525
- }, Ts = new U.Type("tag:yaml.org,2002:int", Is), Ct = U.CORE_SCHEMA.extend({
2526
- implicit: [ms, Ts]
2538
+ }, fs = new U.Type("tag:yaml.org,2002:int", hs), At = U.CORE_SCHEMA.extend({
2539
+ implicit: [ps, fs]
2527
2540
  }), F = (s) => {
2528
- const e = U.load(s, { schema: Ct });
2541
+ const e = U.load(s, { schema: At });
2529
2542
  return e === void 0 ? void 0 : e;
2530
- }, dn = (s) => U.dump(s, {
2531
- schema: Ct,
2543
+ }, on = (s) => U.dump(s, {
2544
+ schema: At,
2532
2545
  replacer: (e, t) => {
2533
2546
  if (S(t)) {
2534
2547
  if (L(t)) {
@@ -2540,7 +2553,7 @@ const Ve = U.types.float.options, ys = {
2540
2553
  }
2541
2554
  return t;
2542
2555
  }
2543
- }), Mt = `- type:
2556
+ }), Vt = `- type:
2544
2557
  blueId: 27B7fuxQCS1VAptiCPc2RMkKoutP5qxkh3uDxZ7dr6Eo
2545
2558
  mappings:
2546
2559
  Text: DLRQwz7MQeCrzjy9bohPNwtCxKEBbKaMK65KBrwjfG6K
@@ -2551,20 +2564,20 @@ const Ve = U.types.float.options, ys = {
2551
2564
  Dictionary: G7fBT9PSod1RfHLHkpafAGBDVAJMrMhAMY51ERcyXNrj
2552
2565
  - type:
2553
2566
  blueId: FGYuTXwaoSKfZmpTysLTLsb8WzSqf43384rKZDkXhxD4
2554
- `, vs = `name: Transformation
2555
- description: TODO`, bs = `name: Infer Basic Types For Untyped Values
2567
+ `, gs = `name: Transformation
2568
+ description: TODO`, ys = `name: Infer Basic Types For Untyped Values
2556
2569
  type:
2557
2570
  blueId: Ct1SGRGw1i47qjzm1ruiUdSZofeV6WevPTGuieVvbRS4
2558
- description: This transformation infers type details for Text, Integer, Number and Boolean.`, ws = `name: Replace Inline Types with BlueIds
2571
+ description: This transformation infers type details for Text, Integer, Number and Boolean.`, ms = `name: Replace Inline Types with BlueIds
2559
2572
  type:
2560
2573
  blueId: Ct1SGRGw1i47qjzm1ruiUdSZofeV6WevPTGuieVvbRS4
2561
- description: This transformation replaces`, Bs = [
2562
- Mt,
2563
- vs,
2564
- bs,
2565
- ws
2574
+ description: This transformation replaces`, Is = [
2575
+ Vt,
2576
+ gs,
2577
+ ys,
2578
+ ms
2566
2579
  ];
2567
- class Ns extends ce {
2580
+ class Ts extends ae {
2568
2581
  blueIdToNodesMap = /* @__PURE__ */ new Map();
2569
2582
  constructor() {
2570
2583
  super(), this.load();
@@ -2573,7 +2586,7 @@ class Ns extends ce {
2573
2586
  return this.blueIdToNodesMap.get(e) || [];
2574
2587
  }
2575
2588
  load() {
2576
- for (const e of Bs) {
2589
+ for (const e of Is) {
2577
2590
  const t = F(e);
2578
2591
  if (t === void 0) {
2579
2592
  console.error(`This content file is not valid YAML: ${e}`);
@@ -2591,11 +2604,11 @@ class Ns extends ce {
2591
2604
  }
2592
2605
  }
2593
2606
  }
2594
- class qe extends ce {
2595
- static INSTANCE = new qe();
2607
+ class We extends ae {
2608
+ static INSTANCE = new We();
2596
2609
  nodeProvider;
2597
2610
  constructor() {
2598
- super(), this.nodeProvider = new Ns();
2611
+ super(), this.nodeProvider = new Ts();
2599
2612
  }
2600
2613
  fetchByBlueId(e) {
2601
2614
  return this.nodeProvider.fetchByBlueId(e);
@@ -2693,7 +2706,7 @@ class x {
2693
2706
  }
2694
2707
  }
2695
2708
  }
2696
- class Ps extends ce {
2709
+ class vs extends ae {
2697
2710
  fetchByBlueId(e) {
2698
2711
  const t = e.split("#")[0], r = this.fetchContentByBlueId(t);
2699
2712
  if (r == null)
@@ -2725,7 +2738,7 @@ class Ps extends ce {
2725
2738
  }
2726
2739
  }
2727
2740
  }
2728
- class Dt extends Ps {
2741
+ class Ct extends vs {
2729
2742
  nameToBlueIdsMap = /* @__PURE__ */ new Map();
2730
2743
  /**
2731
2744
  * Find a node by name. Throws an error if multiple nodes are found with the same name.
@@ -2769,17 +2782,17 @@ class Dt extends Ps {
2769
2782
  ]);
2770
2783
  }
2771
2784
  }
2772
- const Ft = (s) => s instanceof a || Array.isArray(s) && s.every((e) => e instanceof a) ? s : je(s) ? s.map((e) => g.deserialize(e)) : g.deserialize(s), Es = async (s) => {
2773
- const e = Ft(s);
2785
+ const Mt = (s) => s instanceof a || Array.isArray(s) && s.every((e) => e instanceof a) ? s : xe(s) ? s.map((e) => g.deserialize(e)) : g.deserialize(s), bs = async (s) => {
2786
+ const e = Mt(s);
2774
2787
  return T.calculateBlueId(e);
2775
- }, pn = (s) => {
2776
- const e = Ft(s);
2788
+ }, ln = (s) => {
2789
+ const e = Mt(s);
2777
2790
  return T.calculateBlueIdSync(e);
2778
- }, st = async (s) => {
2779
- if (cr(s))
2791
+ }, rt = async (s) => {
2792
+ if (or(s))
2780
2793
  return s;
2781
2794
  try {
2782
- const e = me.parse(s), t = await Es(e);
2795
+ const e = Ie.parse(s), t = await bs(e);
2783
2796
  return {
2784
2797
  ...s,
2785
2798
  blueId: t
@@ -2787,31 +2800,31 @@ const Ft = (s) => s instanceof a || Array.isArray(s) && s.every((e) => e instanc
2787
2800
  } catch (e) {
2788
2801
  throw new Error(`Failed enriching object with Blue ID: ${e}`);
2789
2802
  }
2790
- }, hn = (s) => s?.items, fn = (s) => s?.value, gn = (s) => I(s) ? {} : dt(
2803
+ }, cn = (s) => s?.items, an = (s) => s?.value, un = (s) => I(s) ? {} : ut(
2791
2804
  s,
2792
- tr
2793
- ), yn = (s) => ur(s) ? s.type.name ?? null : dr(s) ? Wt(typeof s.value) : ar(s) ? "List" : null, Ss = (s) => d(s) && Object.keys(dt(s, ["blueId"])).length > 0, mn = (s) => {
2805
+ Qt
2806
+ ), dn = (s) => cr(s) ? s.type.name ?? null : ar(s) ? Zt(typeof s.value) : lr(s) ? "List" : null, ws = (s) => d(s) && Object.keys(ut(s, ["blueId"])).length > 0, pn = (s) => {
2794
2807
  try {
2795
2808
  const e = g.deserialize(s), t = m.get(e);
2796
- return ne.parse(t);
2809
+ return se.parse(t);
2797
2810
  } catch (e) {
2798
2811
  throw new Error(
2799
2812
  `Failed transforming JSON-like value to BlueObject: ${e}`
2800
2813
  );
2801
2814
  }
2802
- }, nt = async (s) => {
2815
+ }, st = async (s) => {
2803
2816
  const {
2804
2817
  resolveFunction: e,
2805
2818
  signal: t = new AbortController().signal,
2806
2819
  omitItems: r
2807
2820
  } = s, n = s.count ?? s.items.length;
2808
- let i = await qt(s.items, async (l) => await st(l));
2821
+ let i = await Ht(s.items, async (l) => await rt(l));
2809
2822
  const o = Math.max(i?.length - n, 0);
2810
2823
  for (let l = i.length - 1; l >= o; l--)
2811
- if (!Ss(i[l])) {
2824
+ if (!ws(i[l])) {
2812
2825
  const c = await e(i[l], { signal: t });
2813
2826
  if (Array.isArray(c))
2814
- return nt({
2827
+ return st({
2815
2828
  ...s,
2816
2829
  items: [
2817
2830
  ...i.slice(0, l),
@@ -2819,9 +2832,9 @@ const Ft = (s) => s instanceof a || Array.isArray(s) && s.every((e) => e instanc
2819
2832
  ...i.slice(l + 1)
2820
2833
  ]
2821
2834
  });
2822
- const u = await st(c);
2835
+ const u = await rt(c);
2823
2836
  if (r?.includes(u.blueId))
2824
- return nt({
2837
+ return st({
2825
2838
  ...s,
2826
2839
  items: [...i.slice(0, l), ...i.slice(l + 1)]
2827
2840
  });
@@ -2833,7 +2846,7 @@ const Ft = (s) => s instanceof a || Array.isArray(s) && s.every((e) => e instanc
2833
2846
  }
2834
2847
  return i;
2835
2848
  };
2836
- function de(s) {
2849
+ function pe(s) {
2837
2850
  try {
2838
2851
  const e = new URL(s);
2839
2852
  return e.protocol === "http:" || e.protocol === "https:";
@@ -2841,7 +2854,7 @@ function de(s) {
2841
2854
  return !1;
2842
2855
  }
2843
2856
  }
2844
- class As {
2857
+ class Bs {
2845
2858
  /**
2846
2859
  * Process a document node to infer basic types for untyped values
2847
2860
  * @param document - The document to process
@@ -2860,7 +2873,7 @@ class As {
2860
2873
  return I(t) && d(r) && (typeof r == "string" ? e.setType(new a().setBlueId(_)) : typeof r == "bigint" || L(r) ? e.setType(new a().setBlueId(Y)) : De(r) ? e.setType(new a().setBlueId(K)) : typeof r == "boolean" && e.setType(new a().setBlueId(G))), e;
2861
2874
  }
2862
2875
  }
2863
- class Te {
2876
+ class ve {
2864
2877
  static MAPPINGS = "mappings";
2865
2878
  mappings = /* @__PURE__ */ new Map();
2866
2879
  /**
@@ -2870,8 +2883,8 @@ class Te {
2870
2883
  constructor(e) {
2871
2884
  if (e instanceof a) {
2872
2885
  const r = e.getProperties();
2873
- if (r && r[Te.MAPPINGS]) {
2874
- const i = r[Te.MAPPINGS].getProperties();
2886
+ if (r && r[ve.MAPPINGS]) {
2887
+ const i = r[ve.MAPPINGS].getProperties();
2875
2888
  i && Object.entries(i).forEach(([o, l]) => {
2876
2889
  const c = l.getValue();
2877
2890
  typeof c == "string" && this.mappings.set(o, c);
@@ -2905,7 +2918,7 @@ class Te {
2905
2918
  }
2906
2919
  }
2907
2920
  }
2908
- class Vs {
2921
+ class Ns {
2909
2922
  /**
2910
2923
  * Process a document node to validate all inline types have been replaced
2911
2924
  * @param document - The document to process
@@ -2927,7 +2940,7 @@ class Vs {
2927
2940
  }
2928
2941
  }
2929
2942
  }
2930
- class Xe {
2943
+ class qe {
2931
2944
  nodeProvider;
2932
2945
  strategy;
2933
2946
  /**
@@ -2963,7 +2976,7 @@ class Xe {
2963
2976
  const v = f[0];
2964
2977
  this.mergeNodes(e, v);
2965
2978
  } else {
2966
- const v = f.map((k) => k.clone()), O = new a().setItems(v);
2979
+ const v = f.map((z) => z.clone()), O = new a().setItems(v);
2967
2980
  this.mergeNodes(e, O);
2968
2981
  }
2969
2982
  }
@@ -3021,7 +3034,7 @@ class Xe {
3021
3034
  d(r) && e.setValue(r), e.setItems(t.getItems()), e.setProperties(t.getProperties());
3022
3035
  }
3023
3036
  }
3024
- class Ot {
3037
+ class Dt {
3025
3038
  blueIdsCollections = [];
3026
3039
  /**
3027
3040
  * Initializes the generator with default BlueIds collections
@@ -3105,7 +3118,7 @@ class X {
3105
3118
  const { nodeProvider: t, processorProvider: r, blueIdsMappingGenerator: n } = e;
3106
3119
  if (!t)
3107
3120
  throw new Error("NodeProvider is required");
3108
- this.nodeProvider = oe.wrap(t), this.processorProvider = r || X.getStandardProvider(), this.blueIdsMappingGenerator = n || new Ot(), this.loadDefaultSimpleBlue();
3121
+ this.nodeProvider = oe.wrap(t), this.processorProvider = r || X.getStandardProvider(), this.blueIdsMappingGenerator = n || new Dt(), this.loadDefaultSimpleBlue();
3109
3122
  }
3110
3123
  /**
3111
3124
  * Preprocesses a document node
@@ -3132,7 +3145,7 @@ class X {
3132
3145
  preprocessWithOptions(e, t) {
3133
3146
  let r = e.clone(), n = r.getBlue();
3134
3147
  if (!n && t && (n = t.clone()), n) {
3135
- new Xe(this.nodeProvider).extend(
3148
+ new qe(this.nodeProvider).extend(
3136
3149
  n,
3137
3150
  Be.withSinglePath("/*")
3138
3151
  );
@@ -3149,7 +3162,7 @@ class X {
3149
3162
  }
3150
3163
  r.setBlue(void 0);
3151
3164
  }
3152
- r = new Vs().process(
3165
+ r = new Ns().process(
3153
3166
  r
3154
3167
  );
3155
3168
  }
@@ -3164,11 +3177,11 @@ class X {
3164
3177
  getProcessor(e) {
3165
3178
  const t = "27B7fuxQCS1VAptiCPc2RMkKoutP5qxkh3uDxZ7dr6Eo", r = "FGYuTXwaoSKfZmpTysLTLsb8WzSqf43384rKZDkXhxD4", n = e.getType()?.getBlueId();
3166
3179
  if (t === n)
3167
- return new Te(
3180
+ return new ve(
3168
3181
  e
3169
3182
  );
3170
3183
  if (r === n)
3171
- return new As();
3184
+ return new Bs();
3172
3185
  }
3173
3186
  };
3174
3187
  }
@@ -3188,7 +3201,7 @@ ${t}
3188
3201
  * Loads the default simple Blue node
3189
3202
  */
3190
3203
  loadDefaultSimpleBlue() {
3191
- const e = this.enrichDefaultBlue(Mt);
3204
+ const e = this.enrichDefaultBlue(Vt);
3192
3205
  try {
3193
3206
  const t = F(e);
3194
3207
  if (t)
@@ -3200,7 +3213,7 @@ ${t}
3200
3213
  }
3201
3214
  }
3202
3215
  }
3203
- class Cs extends Dt {
3216
+ class Ps extends Ct {
3204
3217
  blueIdToContentMap = /* @__PURE__ */ new Map();
3205
3218
  blueIdToMultipleDocumentsMap = /* @__PURE__ */ new Map();
3206
3219
  preprocessor;
@@ -3275,15 +3288,15 @@ class oe {
3275
3288
  * @returns A wrapped NodeProvider that includes bootstrap providers and repository definitions
3276
3289
  */
3277
3290
  static wrap(e, t) {
3278
- const r = [qe.INSTANCE];
3291
+ const r = [We.INSTANCE];
3279
3292
  if (t && t.length > 0) {
3280
- const n = new Cs(t);
3293
+ const n = new Ps(t);
3281
3294
  r.push(n);
3282
3295
  }
3283
- return r.push(e), new gs(r);
3296
+ return r.push(e), new us(r);
3284
3297
  }
3285
3298
  }
3286
- class Ms {
3299
+ class Es {
3287
3300
  preprocessingAliases = /* @__PURE__ */ new Map();
3288
3301
  urlContentFetcher;
3289
3302
  /**
@@ -3307,9 +3320,9 @@ class Ms {
3307
3320
  const r = e.clone();
3308
3321
  if (this.preprocessingAliases.has(t))
3309
3322
  return this.handleAliasValue(r, t);
3310
- if (ye.isPotentialBlueId(t))
3323
+ if (me.isPotentialBlueId(t))
3311
3324
  return this.handleBlueId(r, t);
3312
- throw de(t) ? new Error(
3325
+ throw pe(t) ? new Error(
3313
3326
  `URL '${t}' detected. Use the async version of this method to fetch the content.`
3314
3327
  ) : new Error(`Invalid blue value: ${t}`);
3315
3328
  }
@@ -3327,9 +3340,9 @@ class Ms {
3327
3340
  const r = e.clone();
3328
3341
  if (this.preprocessingAliases.has(t))
3329
3342
  return this.handleAliasValue(r, t);
3330
- if (ye.isPotentialBlueId(t))
3343
+ if (me.isPotentialBlueId(t))
3331
3344
  return this.handleBlueId(r, t);
3332
- if (de(t) && this.urlContentFetcher)
3345
+ if (pe(t) && this.urlContentFetcher)
3333
3346
  try {
3334
3347
  const n = await this.fetchFromUrl(t);
3335
3348
  return n && r.setBlue(new a().setItems(n)), r;
@@ -3339,7 +3352,7 @@ class Ms {
3339
3352
  ${n.message}`
3340
3353
  ) : n;
3341
3354
  }
3342
- else throw de(t) ? new Error(
3355
+ else throw pe(t) ? new Error(
3343
3356
  `UrlContentFetcher not provided for URL: ${t}`
3344
3357
  ) : new Error(`Invalid blue value: ${t}`);
3345
3358
  }
@@ -3425,24 +3438,24 @@ ${n.message}`
3425
3438
  return this.urlContentFetcher;
3426
3439
  }
3427
3440
  }
3428
- const Ds = {
3441
+ const Ss = {
3429
3442
  fetchUrl: async (s) => {
3430
3443
  throw new Error(
3431
3444
  `You must provide a custom UrlFetchStrategy to fetch content from URL: ${s}`
3432
3445
  );
3433
3446
  }
3434
3447
  };
3435
- class Fs {
3448
+ class As {
3436
3449
  // Cache to avoid repeated network requests for the same URL
3437
3450
  cache = /* @__PURE__ */ new Map();
3438
3451
  fetchStrategy;
3439
3452
  enabled = !1;
3440
3453
  allowedDomains = [];
3441
3454
  constructor(e) {
3442
- this.fetchStrategy = e || Ds;
3455
+ this.fetchStrategy = e || Ss;
3443
3456
  }
3444
3457
  validateUrl(e) {
3445
- if (!de(e))
3458
+ if (!pe(e))
3446
3459
  throw new Error(`Invalid URL: ${e}`);
3447
3460
  return !0;
3448
3461
  }
@@ -3561,7 +3574,7 @@ class Fs {
3561
3574
  return this.allowedDomains = [], this;
3562
3575
  }
3563
3576
  }
3564
- class Os {
3577
+ class Vs {
3565
3578
  /**
3566
3579
  * Resolves a node without limits
3567
3580
  * Default implementation that uses NO_LIMITS
@@ -3573,7 +3586,7 @@ class Os {
3573
3586
  return this.resolve(e, R);
3574
3587
  }
3575
3588
  }
3576
- class Rs extends Os {
3589
+ class Cs extends Vs {
3577
3590
  mergingProcessor;
3578
3591
  nodeProvider;
3579
3592
  /**
@@ -3600,7 +3613,7 @@ class Rs extends Os {
3600
3613
  const i = t.getType();
3601
3614
  if (d(i)) {
3602
3615
  const o = i.clone();
3603
- d(o.getBlueId()) && new Xe(this.nodeProvider).extend(
3616
+ d(o.getBlueId()) && new qe(this.nodeProvider).extend(
3604
3617
  o,
3605
3618
  Be.withSinglePath("/")
3606
3619
  );
@@ -3705,7 +3718,7 @@ class Rs extends Os {
3705
3718
  return new ie(i);
3706
3719
  }
3707
3720
  }
3708
- class Rt {
3721
+ class Ft {
3709
3722
  mergingProcessors;
3710
3723
  /**
3711
3724
  * Creates a new SequentialMergingProcessor with the given processors
@@ -3730,14 +3743,14 @@ class Rt {
3730
3743
  return this.mergingProcessors.reduce((n, i) => i.postProcess ? i.postProcess(n, t, r) : n, e);
3731
3744
  }
3732
3745
  }
3733
- class $t {
3746
+ class Ot {
3734
3747
  process(e, t) {
3735
3748
  const r = t.getValue();
3736
3749
  if (d(r)) {
3737
3750
  const n = e.getValue();
3738
3751
  if (I(n))
3739
3752
  return e.clone().setValue(r);
3740
- if (!$s(r, n))
3753
+ if (!Ms(r, n))
3741
3754
  throw new Error(
3742
3755
  `Node values conflict. Source node value: ${r}, target node value: ${n}`
3743
3756
  );
@@ -3745,8 +3758,8 @@ class $t {
3745
3758
  return e;
3746
3759
  }
3747
3760
  }
3748
- const $s = (s, e) => L(s) && L(e) || De(s) && De(e) ? s.eq(e) : s === e;
3749
- class xt {
3761
+ const Ms = (s, e) => L(s) && L(e) || De(s) && De(e) ? s.eq(e) : s === e;
3762
+ class Rt {
3750
3763
  process(e, t, r) {
3751
3764
  const n = e.getType(), i = t.getType();
3752
3765
  let o = e;
@@ -3772,10 +3785,10 @@ class xt {
3772
3785
  return o;
3773
3786
  }
3774
3787
  }
3775
- class jt {
3788
+ class $t {
3776
3789
  process(e, t, r) {
3777
3790
  const n = t.getItemType(), i = t.getType();
3778
- if (n !== void 0 && i !== void 0 && !Et(i, r))
3791
+ if (n !== void 0 && i !== void 0 && !Nt(i, r))
3779
3792
  throw new Error("Source node with itemType must have a List type");
3780
3793
  const o = e.getItemType();
3781
3794
  let l = e;
@@ -3822,10 +3835,10 @@ class jt {
3822
3835
  return l;
3823
3836
  }
3824
3837
  }
3825
- class Lt {
3838
+ class xt {
3826
3839
  process(e, t, r) {
3827
3840
  const n = t.getKeyType(), i = t.getValueType(), o = t.getType();
3828
- if ((n !== void 0 || i !== void 0) && o !== void 0 && !St(o, r))
3841
+ if ((n !== void 0 || i !== void 0) && o !== void 0 && !Pt(o, r))
3829
3842
  throw new Error(
3830
3843
  "Source node with keyType or valueType must have a Dictionary type"
3831
3844
  );
@@ -3885,20 +3898,20 @@ class Lt {
3885
3898
  return e;
3886
3899
  }
3887
3900
  validateBasicKeyType(e, t) {
3888
- if (!Jr(e, t))
3901
+ if (!Ur(e, t))
3889
3902
  throw new Error("Dictionary key type must be a basic type");
3890
3903
  }
3891
3904
  validateKeyType(e, t, r) {
3892
- if (!Zr(t, r))
3893
- if (Hr(t, r)) {
3905
+ if (!_r(t, r))
3906
+ if (Kr(t, r)) {
3894
3907
  const n = Number.parseInt(e, 10);
3895
3908
  if (Number.isNaN(n) || n.toString() !== e)
3896
3909
  throw new Error(`Key '${e}' is not a valid Integer.`);
3897
- } else if (Wr(t, r)) {
3910
+ } else if (Yr(t, r)) {
3898
3911
  const n = Number.parseFloat(e);
3899
3912
  if (Number.isNaN(n))
3900
3913
  throw new Error(`Key '${e}' is not a valid Number.`);
3901
- } else if (qr(t, r)) {
3914
+ } else if (Gr(t, r)) {
3902
3915
  if (e.toLowerCase() !== "true" && e.toLowerCase() !== "false")
3903
3916
  throw new Error(`Key '${e}' is not a valid Boolean.`);
3904
3917
  } else
@@ -3920,16 +3933,16 @@ class Lt {
3920
3933
  }
3921
3934
  }
3922
3935
  }
3923
- class Ut {
3936
+ class jt {
3924
3937
  process(e) {
3925
3938
  return e;
3926
3939
  }
3927
3940
  postProcess(e, t, r) {
3928
3941
  const n = e.getType();
3929
- if (n !== void 0 && Xr(n, r)) {
3942
+ if (n !== void 0 && zr(n, r)) {
3930
3943
  const i = e.getItems(), o = e.getProperties();
3931
3944
  if (i !== void 0 && i.length > 0 || o !== void 0 && Object.keys(o).length > 0) {
3932
- const l = Qr(
3945
+ const l = kr(
3933
3946
  n,
3934
3947
  r
3935
3948
  ), c = n.getName() || "unknown";
@@ -3941,7 +3954,7 @@ class Ut {
3941
3954
  return e;
3942
3955
  }
3943
3956
  }
3944
- class _t {
3957
+ class Lt {
3945
3958
  process(e, t) {
3946
3959
  let r = e;
3947
3960
  const n = t.getName(), i = e.getName();
@@ -3950,32 +3963,32 @@ class _t {
3950
3963
  return o !== void 0 && l === void 0 && (r = r.clone().setDescription(o)), r;
3951
3964
  }
3952
3965
  }
3953
- const In = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3966
+ const hn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3954
3967
  __proto__: null,
3955
- BasicTypesVerifier: Ut,
3956
- DictionaryProcessor: Lt,
3957
- ListProcessor: jt,
3958
- MetadataPropagator: _t,
3959
- SequentialMergingProcessor: Rt,
3960
- TypeAssigner: xt,
3961
- ValuePropagator: $t
3968
+ BasicTypesVerifier: jt,
3969
+ DictionaryProcessor: xt,
3970
+ ListProcessor: $t,
3971
+ MetadataPropagator: Lt,
3972
+ SequentialMergingProcessor: Ft,
3973
+ TypeAssigner: Rt,
3974
+ ValuePropagator: Ot
3962
3975
  }, Symbol.toStringTag, { value: "Module" }));
3963
- function xs() {
3964
- return new Rt([
3976
+ function Ds() {
3977
+ return new Ft([
3978
+ new Ot(),
3979
+ new Rt(),
3965
3980
  new $t(),
3966
3981
  new xt(),
3967
- new jt(),
3968
3982
  new Lt(),
3969
- new _t(),
3970
- new Ut()
3983
+ new jt()
3971
3984
  ]);
3972
3985
  }
3973
- class js {
3986
+ class Fs {
3974
3987
  nodeProvider;
3975
3988
  blueIdToInlineValue = /* @__PURE__ */ new Map();
3976
3989
  constructor(e) {
3977
3990
  const { nodeProvider: t, blueIdsMappingGenerator: r } = e;
3978
- this.nodeProvider = t, Object.entries(yt).forEach(([i, o]) => {
3991
+ this.nodeProvider = t, Object.entries(gt).forEach(([i, o]) => {
3979
3992
  this.blueIdToInlineValue.set(i, o);
3980
3993
  });
3981
3994
  const n = r.getAllBlueIds();
@@ -4036,7 +4049,7 @@ class js {
4036
4049
  return this.blueIdToInlineValue.set(e, o), o;
4037
4050
  }
4038
4051
  }
4039
- class Tn {
4052
+ class fn {
4040
4053
  nodeProvider;
4041
4054
  typeSchemaResolver;
4042
4055
  blueDirectivePreprocessor;
@@ -4054,14 +4067,14 @@ class Tn {
4054
4067
  mergingProcessor: o
4055
4068
  } = e;
4056
4069
  this.repositories = i;
4057
- const l = fs(() => []);
4070
+ const l = as(() => []);
4058
4071
  if (this.nodeProvider = oe.wrap(
4059
4072
  t || l,
4060
4073
  i
4061
- ), this.typeSchemaResolver = r ?? new kr([]), this.mergingProcessor = o ?? xs(), this.urlContentFetcher = new Fs(n), this.blueDirectivePreprocessor = new Ms(
4074
+ ), this.typeSchemaResolver = r ?? new Jr([], { nodeProvider: this.nodeProvider }), this.typeSchemaResolver?.setNodeProvider(this.nodeProvider), this.mergingProcessor = o ?? Ds(), this.urlContentFetcher = new As(n), this.blueDirectivePreprocessor = new Es(
4062
4075
  void 0,
4063
4076
  this.urlContentFetcher
4064
- ), this.blueIdsMappingGenerator = new Ot(), i)
4077
+ ), this.blueIdsMappingGenerator = new Dt(), i)
4065
4078
  for (const { schemas: c, blueIds: u } of i)
4066
4079
  this.typeSchemaResolver?.registerSchemas(c), this.blueIdsMappingGenerator.registerBlueIds(u);
4067
4080
  }
@@ -4076,11 +4089,11 @@ class Tn {
4076
4089
  return m.get(e, t);
4077
4090
  }
4078
4091
  nodeToSchemaOutput(e, t) {
4079
- return new hs(this.typeSchemaResolver).convert(e, t);
4092
+ return new cs(this.typeSchemaResolver).convert(e, t);
4080
4093
  }
4081
4094
  resolve(e, t = R) {
4082
4095
  const r = this.combineWithGlobalLimits(t);
4083
- return new Rs(this.mergingProcessor, this.nodeProvider).resolve(e, r);
4096
+ return new Cs(this.mergingProcessor, this.nodeProvider).resolve(e, r);
4084
4097
  }
4085
4098
  /**
4086
4099
  * Wraps an already resolved (merged) BlueNode in a ResolvedBlueNode.
@@ -4094,7 +4107,7 @@ class Tn {
4094
4107
  return e instanceof ie ? e : new ie(e);
4095
4108
  }
4096
4109
  reverse(e) {
4097
- return new Vt().reverse(e);
4110
+ return new St().reverse(e);
4098
4111
  }
4099
4112
  /**
4100
4113
  * Returns a copy of the provided node with any referenced types converted back to their
@@ -4104,14 +4117,14 @@ class Tn {
4104
4117
  * repository-backed definitions currently known to this {@link Blue} instance.
4105
4118
  */
4106
4119
  restoreInlineTypes(e) {
4107
- return new js({
4120
+ return new Fs({
4108
4121
  nodeProvider: this.nodeProvider,
4109
4122
  blueIdsMappingGenerator: this.blueIdsMappingGenerator
4110
4123
  }).restore(e);
4111
4124
  }
4112
4125
  extend(e, t) {
4113
4126
  const r = this.combineWithGlobalLimits(t);
4114
- new Xe(this.nodeProvider).extend(e, r);
4127
+ new qe(this.nodeProvider).extend(e, r);
4115
4128
  }
4116
4129
  jsonValueToNode(e) {
4117
4130
  return this.preprocess(g.deserialize(e));
@@ -4170,13 +4183,13 @@ class Tn {
4170
4183
  return this.nodeProvider = oe.wrap(
4171
4184
  e,
4172
4185
  this.repositories
4173
- ), this;
4186
+ ), this.typeSchemaResolver?.setNodeProvider(this.nodeProvider), this;
4174
4187
  }
4175
4188
  getTypeSchemaResolver() {
4176
4189
  return this.typeSchemaResolver;
4177
4190
  }
4178
4191
  setTypeSchemaResolver(e) {
4179
- return this.typeSchemaResolver = e, this;
4192
+ return this.typeSchemaResolver = e, this.typeSchemaResolver?.setNodeProvider(this.nodeProvider), this;
4180
4193
  }
4181
4194
  getUrlContentFetcher() {
4182
4195
  return this.urlContentFetcher;
@@ -4291,7 +4304,7 @@ class Tn {
4291
4304
  * @returns true if the node matches the schema type, false otherwise
4292
4305
  */
4293
4306
  isTypeOf(e, t, r) {
4294
- return V.isTypeOf(e, t, {
4307
+ return A.isTypeOf(e, t, {
4295
4308
  checkSchemaExtensions: r?.checkSchemaExtensions,
4296
4309
  typeSchemaResolver: this.typeSchemaResolver
4297
4310
  });
@@ -4304,7 +4317,7 @@ class Tn {
4304
4317
  * @returns true if the node matches the type, false otherwise.
4305
4318
  */
4306
4319
  isTypeOfNode(e, t) {
4307
- return new es(this).matchesType(e, t, this.globalLimits);
4320
+ return new Hr(this).matchesType(e, t, this.globalLimits);
4308
4321
  }
4309
4322
  /**
4310
4323
  * Sets the global limits for this Blue instance.
@@ -4328,7 +4341,7 @@ class Tn {
4328
4341
  return this.globalLimits == R ? e : e == R ? this.globalLimits : Ne.of(this.globalLimits, e);
4329
4342
  }
4330
4343
  }
4331
- class vn extends Dt {
4344
+ class gn extends Ct {
4332
4345
  blueIdToContentMap = /* @__PURE__ */ new Map();
4333
4346
  blueIdToMultipleDocumentsMap = /* @__PURE__ */ new Map();
4334
4347
  preprocessor;
@@ -4338,7 +4351,7 @@ class vn extends Dt {
4338
4351
  this.preprocessor = (r) => t.preprocessWithDefaultBlue(r), e.forEach((r) => this.processNode(r));
4339
4352
  }
4340
4353
  processNode(e) {
4341
- He.hasItemsOnly(e) ? this.processNodeWithItems(e) : this.processSingleNode(e);
4354
+ Ze.hasItemsOnly(e) ? this.processNodeWithItems(e) : this.processSingleNode(e);
4342
4355
  }
4343
4356
  processSingleNode(e) {
4344
4357
  const t = x.parseAndCalculateBlueIdForNode(
@@ -4455,72 +4468,69 @@ class vn extends Dt {
4455
4468
  }
4456
4469
  }
4457
4470
  export {
4458
- Tr as Base58Sha256Provider,
4459
- vn as BasicNodeProvider,
4460
- Tn as Blue,
4471
+ mr as Base58Sha256Provider,
4472
+ gn as BasicNodeProvider,
4473
+ fn as Blue,
4461
4474
  T as BlueIdCalculator,
4462
- sn as BlueIdToCid,
4475
+ Xs as BlueIdToCid,
4463
4476
  a as BlueNode,
4464
- V as BlueNodeTypeSchema,
4465
- Ir as JsonCanonicalizer,
4466
- We as Limits,
4467
- Rs as Merger,
4468
- In as MergingProcessors,
4469
- Os as NodeResolver,
4470
- He as Nodes,
4477
+ A as BlueNodeTypeSchema,
4478
+ yr as JsonCanonicalizer,
4479
+ He as Limits,
4480
+ Cs as Merger,
4481
+ hn as MergingProcessors,
4482
+ Vs as NodeResolver,
4483
+ Ze as Nodes,
4471
4484
  ie as ResolvedBlueNode,
4472
- kr as TypeSchemaResolver,
4473
- nn as applyBlueNodePatch,
4474
- be as baseBlueObjectSchema,
4475
- on as blueDescriptionField,
4476
- ln as blueIdField,
4477
- Zs as blueIdSchema,
4478
- cn as blueNameField,
4479
- an as blueNodeField,
4480
- qs as blueObjectBooleanValueSchema,
4481
- Ws as blueObjectNumberValueSchema,
4482
- ne as blueObjectSchema,
4483
- Xs as blueObjectStringListItemsSchema,
4484
- Hs as blueObjectStringValueSchema,
4485
- Es as calculateBlueId,
4486
- pn as calculateBlueIdSync,
4487
- st as enrichWithBlueId,
4488
- Dr as getBlueDescriptionAnnotation,
4489
- Rr as getBlueIdAnnotation,
4490
- xr as getBlueNameAnnotation,
4491
- Lr as getBlueNodeAnnotation,
4492
- hn as getBlueObjectItems,
4493
- gn as getBlueObjectProperties,
4494
- yn as getBlueObjectTypeLabel,
4495
- fn as getBlueObjectValue,
4496
- _r as getExtendedFromSchemaAnnotation,
4497
- Gr as getTypeBlueIdAnnotation,
4498
- cr as hasBlueObjectBlueIdDefined,
4499
- ar as hasBlueObjectItemsDefined,
4500
- en as hasBlueObjectNameDefined,
4501
- ur as hasBlueObjectTypeDefined,
4502
- dr as hasBlueObjectValueDefined,
4485
+ Jr as TypeSchemaResolver,
4486
+ Qs as applyBlueNodePatch,
4487
+ we as baseBlueObjectSchema,
4488
+ en as blueDescriptionField,
4489
+ tn as blueIdField,
4490
+ Ys as blueIdSchema,
4491
+ rn as blueNameField,
4492
+ sn as blueNodeField,
4493
+ ks as blueObjectBooleanValueSchema,
4494
+ zs as blueObjectNumberValueSchema,
4495
+ se as blueObjectSchema,
4496
+ Js as blueObjectStringListItemsSchema,
4497
+ Gs as blueObjectStringValueSchema,
4498
+ bs as calculateBlueId,
4499
+ ln as calculateBlueIdSync,
4500
+ rt as enrichWithBlueId,
4501
+ Cr as getBlueDescriptionAnnotation,
4502
+ Fr as getBlueIdAnnotation,
4503
+ Rr as getBlueNameAnnotation,
4504
+ xr as getBlueNodeAnnotation,
4505
+ cn as getBlueObjectItems,
4506
+ un as getBlueObjectProperties,
4507
+ dn as getBlueObjectTypeLabel,
4508
+ an as getBlueObjectValue,
4509
+ Lr as getTypeBlueIdAnnotation,
4510
+ or as hasBlueObjectBlueIdDefined,
4511
+ lr as hasBlueObjectItemsDefined,
4512
+ Hs as hasBlueObjectNameDefined,
4513
+ cr as hasBlueObjectTypeDefined,
4514
+ ar as hasBlueObjectValueDefined,
4503
4515
  De as isBigDecimalNumber,
4504
4516
  L as isBigIntegerNumber,
4505
4517
  S as isBigNumber,
4506
- Nt as isBlueNodeSchema,
4507
- Qs as isBlueObject,
4508
- Ss as isBlueObjectResolved,
4509
- tn as isGivenBlueObjectTypeSchema,
4510
- It as isJsonBlueArray,
4511
- mt as isJsonBlueObject,
4512
- rn as isJsonBlueValue,
4513
- Pt as isSchemaExtendedFrom,
4514
- de as isUrl,
4515
- me as jsonBlueValueSchema,
4516
- mn as normalizeToBlueObject,
4517
- nt as resolveBlueObjectItems,
4518
- Mr as withBlueDescription,
4519
- Or as withBlueId,
4520
- $r as withBlueName,
4521
- jr as withBlueNode,
4522
- Ur as withExtendedFromSchema,
4523
- un as withTypeBlueId,
4524
- dn as yamlBlueDump,
4518
+ Bt as isBlueNodeSchema,
4519
+ Zs as isBlueObject,
4520
+ ws as isBlueObjectResolved,
4521
+ Ws as isGivenBlueObjectTypeSchema,
4522
+ mt as isJsonBlueArray,
4523
+ yt as isJsonBlueObject,
4524
+ qs as isJsonBlueValue,
4525
+ pe as isUrl,
4526
+ Ie as jsonBlueValueSchema,
4527
+ pn as normalizeToBlueObject,
4528
+ st as resolveBlueObjectItems,
4529
+ Vr as withBlueDescription,
4530
+ Dr as withBlueId,
4531
+ Or as withBlueName,
4532
+ $r as withBlueNode,
4533
+ nn as withTypeBlueId,
4534
+ on as yamlBlueDump,
4525
4535
  F as yamlBlueParse
4526
4536
  };