@blue-labs/language 1.23.0 → 1.24.0

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,17 +1,17 @@
1
- var St = Object.defineProperty;
2
- var Ct = (n, e, t) => e in n ? St(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t;
3
- var u = (n, e, t) => Ct(n, typeof e != "symbol" ? e + "" : e, t);
4
- import { isNullable as N, isNonNullable as f, jsonPrimitiveSchema as Ft, isReadonlyArray as K, isJsonPrimitive as Me, isPreciseNumberString as rt } from "@blue-labs/shared-utils";
5
- import { z as d, ZodString as Z, ZodEnum as Vt, ZodNativeEnum as Dt, ZodNumber as _, ZodBoolean as oe, ZodBigInt as le, ZodAny as st, ZodObject as Fe, ZodRecord as Ve, ZodMap as it, ZodUnknown as ot, ZodIntersection as Ot, ZodUnion as jt, ZodOptional as lt, ZodNullable as ct, ZodReadonly as at, ZodBranded as ut, ZodEffects as ae, ZodLazy as ue } from "zod";
6
- import X from "bs58";
7
- import R from "big.js";
8
- import { isObject as De, isArray as be, isString as Le, omit as dt, pascal as Rt, map as xt } from "radash";
9
- import { sha256 as Ut } from "js-sha256";
10
- import We from "crypto";
11
- import $t from "base32.js";
12
- import L from "js-yaml";
13
- class Mt {
14
- static get(e, t, r, s = !0) {
1
+ var Ct = Object.defineProperty;
2
+ var Ft = (r, e, t) => e in r ? Ct(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t;
3
+ var u = (r, e, t) => Ft(r, typeof e != "symbol" ? e + "" : e, t);
4
+ import { isNullable as N, isNonNullable as d, jsonPrimitiveSchema as Vt, isReadonlyArray as X, isJsonPrimitive as Le, isPreciseNumberString as nt } from "@blue-labs/shared-utils";
5
+ import { z as f, ZodOptional as st, ZodNullable as it, ZodReadonly as ot, ZodBranded as ct, ZodEffects as ue, ZodLazy as fe, ZodString as k, ZodEnum as Dt, ZodNativeEnum as Ot, ZodNumber as _, ZodBoolean as ce, ZodBigInt as le, ZodAny as lt, ZodObject as Ve, ZodRecord as De, ZodMap as at, ZodUnknown as ut, ZodIntersection as jt, ZodUnion as Rt } from "zod";
6
+ import q from "bs58";
7
+ import x from "big.js";
8
+ import { isObject as Oe, isArray as Te, isString as Ze, omit as ft, pascal as xt, map as Ut } from "radash";
9
+ import { sha256 as $t } from "js-sha256";
10
+ import Ke from "crypto";
11
+ import Mt from "base32.js";
12
+ import Z from "js-yaml";
13
+ class Lt {
14
+ static get(e, t, n, s = !0) {
15
15
  if (N(t) || !t.startsWith("/"))
16
16
  throw new Error(`Invalid path: ${t}`);
17
17
  if (t === "/") {
@@ -23,38 +23,38 @@ class Mt {
23
23
  e,
24
24
  i,
25
25
  0,
26
- r,
26
+ n,
27
27
  s
28
28
  );
29
29
  }
30
- static getRecursive(e, t, r, s, i) {
31
- if (r === t.length - 1 && !i)
30
+ static getRecursive(e, t, n, s, i) {
31
+ if (n === t.length - 1 && !i)
32
32
  return this.getNodeForSegment(
33
33
  e,
34
- t[r],
34
+ t[n],
35
35
  s,
36
36
  !1
37
37
  );
38
- if (r === t.length) {
38
+ if (n === t.length) {
39
39
  const a = e.getValue();
40
40
  return i && a !== void 0 ? a : e;
41
41
  }
42
- const o = t[r], l = this.getNodeForSegment(
42
+ const o = t[n], c = this.getNodeForSegment(
43
43
  e,
44
44
  o,
45
45
  s,
46
46
  !0
47
47
  );
48
- if (l)
48
+ if (c)
49
49
  return this.getRecursive(
50
- l,
50
+ c,
51
51
  t,
52
- r + 1,
52
+ n + 1,
53
53
  s,
54
54
  i
55
55
  );
56
56
  }
57
- static getNodeForSegment(e, t, r, s) {
57
+ static getNodeForSegment(e, t, n, s) {
58
58
  let i;
59
59
  const o = e.getProperties();
60
60
  if (o && t in o)
@@ -62,116 +62,116 @@ class Mt {
62
62
  else
63
63
  switch (t) {
64
64
  case "name": {
65
- const l = e.getName();
66
- i = f(l) ? new c().setValue(l) : new c();
65
+ const c = e.getName();
66
+ i = d(c) ? new l().setValue(c) : new l();
67
67
  break;
68
68
  }
69
69
  case "description": {
70
- const l = e.getDescription();
71
- i = f(l) ? new c().setValue(l) : new c();
70
+ const c = e.getDescription();
71
+ i = d(c) ? new l().setValue(c) : new l();
72
72
  break;
73
73
  }
74
74
  case "type":
75
- i = e.getType() ?? new c();
75
+ i = e.getType() ?? new l();
76
76
  break;
77
77
  case "itemType":
78
- i = e.getItemType() ?? new c();
78
+ i = e.getItemType() ?? new l();
79
79
  break;
80
80
  case "keyType":
81
- i = e.getKeyType() ?? new c();
81
+ i = e.getKeyType() ?? new l();
82
82
  break;
83
83
  case "valueType":
84
- i = e.getValueType() ?? new c();
84
+ i = e.getValueType() ?? new l();
85
85
  break;
86
86
  case "value": {
87
- const l = e.getValue();
88
- i = new c().setValue(l ?? null);
87
+ const c = e.getValue();
88
+ i = new l().setValue(c ?? null);
89
89
  break;
90
90
  }
91
91
  case "blueId": {
92
- const l = e.getBlueId();
93
- i = f(l) ? new c().setValue(l) : new c();
92
+ const c = e.getBlueId();
93
+ i = d(c) ? new l().setValue(c) : new l();
94
94
  break;
95
95
  }
96
96
  case "blue":
97
97
  i = e.getBlue();
98
98
  break;
99
99
  case "items": {
100
- const l = e.getItems();
101
- i = new c().setItems(l);
100
+ const c = e.getItems();
101
+ i = new l().setItems(c);
102
102
  break;
103
103
  }
104
104
  case "properties": {
105
- const l = e.getProperties();
106
- i = new c().setProperties(l);
105
+ const c = e.getProperties();
106
+ i = new l().setProperties(c);
107
107
  break;
108
108
  }
109
109
  case "contracts": {
110
- const l = e.getContracts();
111
- i = new c().setContracts(l);
110
+ const c = e.getContracts();
111
+ i = new l().setContracts(c);
112
112
  break;
113
113
  }
114
114
  default: {
115
115
  if (/^\d+$/.test(t)) {
116
- const l = parseInt(t, 10), a = e.getItems();
117
- a && l >= 0 && l < a.length ? i = a[l] : i = void 0;
116
+ const c = parseInt(t, 10), a = e.getItems();
117
+ a && c >= 0 && c < a.length ? i = a[c] : i = void 0;
118
118
  } else
119
119
  i = void 0;
120
120
  break;
121
121
  }
122
122
  }
123
123
  if (i)
124
- return s && r ? this.link(i, r) : i;
124
+ return s && n ? this.link(i, n) : i;
125
125
  }
126
126
  static link(e, t) {
127
- const r = t(e);
128
- return f(r) ? r : e;
127
+ const n = t(e);
128
+ return d(n) ? n : e;
129
129
  }
130
130
  }
131
- class v extends R {
131
+ class B extends x {
132
132
  constructor(e) {
133
133
  super(e);
134
134
  }
135
135
  }
136
- class P extends R {
136
+ class A extends x {
137
137
  constructor(e) {
138
138
  super(e);
139
139
  }
140
140
  }
141
- const k = "name", Y = "description", de = "type", Ze = "itemType", _e = "keyType", ke = "valueType", Te = "value", Ye = "items", M = "blueId", Ge = "blue", we = "contracts", Lt = [
142
- k,
141
+ const Y = "name", G = "description", de = "type", ke = "itemType", _e = "keyType", Ye = "valueType", we = "value", Ge = "items", L = "blueId", ze = "blue", ve = "contracts", Zt = [
143
142
  Y,
143
+ G,
144
144
  de,
145
- Ze,
146
- _e,
147
145
  ke,
148
- Te,
146
+ _e,
149
147
  Ye,
150
- M,
148
+ we,
151
149
  Ge,
152
- we
153
- ], Zt = "Text", _t = "Double", kt = "Integer", Yt = "Boolean", Gt = "List", zt = "Dictionary", Jt = [
154
- Zt,
155
- _t,
150
+ L,
151
+ ze,
152
+ ve
153
+ ], kt = "Text", _t = "Double", Yt = "Integer", Gt = "Boolean", zt = "List", Jt = "Dictionary", Ht = [
156
154
  kt,
157
- Yt
158
- ], ft = [...Jt, Gt, zt], te = "F92yo19rCcbBoBSpUA5LRxpfDejJDAaP1PRxxbWAraVP", ne = "68ryJtnmui4j5rCZWUnkZ3DChtmEb7Z9F8atn1mBSM3L", re = "DHmxTkFbXePZHCHCYmQr2dSzcNLcryFVjXVHkdQrrZr8", se = "EL6AjrbJsxTWRTPzY8WR8Y2zAMXRbydQj83PcZwuAHbo", Ht = "G8wmfjEqugPEEXByMYWJXiEdbLToPRWNQEekNxrxfQWB", Wt = "294NBTj2mFRL3RB4kDRUSckwGg7Kzj6T8CTAFeR1kcSA", Kt = [
159
- te,
160
- ne,
155
+ _t,
156
+ Yt,
157
+ Gt
158
+ ], dt = [...Ht, zt, Jt], re = "F92yo19rCcbBoBSpUA5LRxpfDejJDAaP1PRxxbWAraVP", ne = "68ryJtnmui4j5rCZWUnkZ3DChtmEb7Z9F8atn1mBSM3L", se = "DHmxTkFbXePZHCHCYmQr2dSzcNLcryFVjXVHkdQrrZr8", ie = "EL6AjrbJsxTWRTPzY8WR8Y2zAMXRbydQj83PcZwuAHbo", Wt = "G8wmfjEqugPEEXByMYWJXiEdbLToPRWNQEekNxrxfQWB", Kt = "294NBTj2mFRL3RB4kDRUSckwGg7Kzj6T8CTAFeR1kcSA", Xt = [
161
159
  re,
162
- se
163
- ], ze = [
164
- ...Kt,
165
- Ht,
166
- Wt
160
+ ne,
161
+ se,
162
+ ie
163
+ ], Je = [
164
+ ...Xt,
165
+ Wt,
166
+ Kt
167
167
  ];
168
168
  Object.fromEntries(
169
- ft.map((n, e) => [n, ze[e]])
169
+ dt.map((r, e) => [r, Je[e]])
170
170
  );
171
171
  Object.fromEntries(
172
- ze.map((n, e) => [n, ft[e]])
172
+ Je.map((r, e) => [r, dt[e]])
173
173
  );
174
- const D = class D {
174
+ const O = class O {
175
175
  constructor(e) {
176
176
  u(this, "name");
177
177
  u(this, "description");
@@ -204,42 +204,42 @@ const D = class D {
204
204
  return this.type;
205
205
  }
206
206
  setType(e) {
207
- return typeof e == "string" ? this.type = new D().setValue(e).setInlineValue(!0) : this.type = e, this;
207
+ return typeof e == "string" ? this.type = new O().setValue(e).setInlineValue(!0) : this.type = e, this;
208
208
  }
209
209
  getItemType() {
210
210
  return this.itemType;
211
211
  }
212
212
  setItemType(e) {
213
- return typeof e == "string" ? this.itemType = new D().setValue(e).setInlineValue(!0) : this.itemType = e, this;
213
+ return typeof e == "string" ? this.itemType = new O().setValue(e).setInlineValue(!0) : this.itemType = e, this;
214
214
  }
215
215
  getKeyType() {
216
216
  return this.keyType;
217
217
  }
218
218
  setKeyType(e) {
219
- return typeof e == "string" ? this.keyType = new D().setValue(e).setInlineValue(!0) : this.keyType = e, this;
219
+ return typeof e == "string" ? this.keyType = new O().setValue(e).setInlineValue(!0) : this.keyType = e, this;
220
220
  }
221
221
  getValueType() {
222
222
  return this.valueType;
223
223
  }
224
224
  setValueType(e) {
225
- return typeof e == "string" ? this.valueType = new D().setValue(e).setInlineValue(!0) : this.valueType = e, this;
225
+ return typeof e == "string" ? this.valueType = new O().setValue(e).setInlineValue(!0) : this.valueType = e, this;
226
226
  }
227
227
  getValue() {
228
228
  var t;
229
229
  const e = (t = this.type) == null ? void 0 : t.getBlueId();
230
- if (f(e) && f(this.value)) {
231
- if (e === re && typeof this.value == "string")
232
- return new v(this.value);
230
+ if (d(e) && d(this.value)) {
231
+ if (e === se && typeof this.value == "string")
232
+ return new B(this.value);
233
233
  if (e === ne && typeof this.value == "string") {
234
- const r = new P(this.value), s = parseFloat(r.toString());
235
- return new P(s.toString());
236
- } else if (e === se && typeof this.value == "string")
234
+ const n = new A(this.value), s = parseFloat(n.toString());
235
+ return new A(s.toString());
236
+ } else if (e === ie && typeof this.value == "string")
237
237
  return this.value.toLowerCase() === "true";
238
238
  }
239
239
  return this.value;
240
240
  }
241
241
  setValue(e) {
242
- return typeof e == "number" ? e % 1 === 0 ? this.value = new v(e.toString()) : this.value = new P(e.toString()) : this.value = e, this;
242
+ return typeof e == "number" ? e % 1 === 0 ? this.value = new B(e.toString()) : this.value = new A(e.toString()) : this.value = e, this;
243
243
  }
244
244
  getItems() {
245
245
  return this.items;
@@ -287,32 +287,32 @@ const D = class D {
287
287
  return this.inlineValue = e, this;
288
288
  }
289
289
  get(e, t) {
290
- return Mt.get(this, e, t);
290
+ return Lt.get(this, e, t);
291
291
  }
292
292
  clone() {
293
- var t, r, s, i, o, l;
294
- const e = new D(this.name);
295
- return e.description = this.description, e.type = (t = this.type) == null ? void 0 : t.clone(), e.itemType = (r = this.itemType) == null ? void 0 : r.clone(), e.keyType = (s = this.keyType) == null ? void 0 : s.clone(), e.valueType = (i = this.valueType) == null ? void 0 : i.clone(), e.value = this.value, e.items = (o = this.items) == null ? void 0 : o.map((a) => a.clone()), this.properties && (e.properties = Object.fromEntries(
293
+ var t, n, s, i, o, c;
294
+ const e = new O(this.name);
295
+ return e.description = this.description, e.type = (t = this.type) == null ? void 0 : t.clone(), e.itemType = (n = this.itemType) == null ? void 0 : n.clone(), e.keyType = (s = this.keyType) == null ? void 0 : s.clone(), e.valueType = (i = this.valueType) == null ? void 0 : i.clone(), e.value = this.value, e.items = (o = this.items) == null ? void 0 : o.map((a) => a.clone()), this.properties && (e.properties = Object.fromEntries(
296
296
  Object.entries(this.properties).map(([a, g]) => [a, g.clone()])
297
297
  )), this.contracts && (e.contracts = Object.fromEntries(
298
298
  Object.entries(this.contracts).map(([a, g]) => [a, g.clone()])
299
- )), e.blueId = this.blueId, e.blue = (l = this.blue) == null ? void 0 : l.clone(), e.inlineValue = this.inlineValue, e;
299
+ )), e.blueId = this.blueId, e.blue = (c = this.blue) == null ? void 0 : c.clone(), e.inlineValue = this.inlineValue, e;
300
300
  }
301
301
  toString() {
302
302
  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}, contracts=${this.contracts}, blueId='${this.blueId}', blue=${this.blue}, inlineValue=${this.inlineValue}}`;
303
303
  }
304
304
  };
305
- u(D, "INTEGER", new D("Integer"));
306
- let c = D;
307
- class $ {
305
+ u(O, "INTEGER", new O("Integer"));
306
+ let l = O;
307
+ class M {
308
308
  static isPotentialBlueId(e) {
309
309
  if (!e || e.length === 0 || !this.BLUE_ID_PATTERN.test(e))
310
310
  return !1;
311
- const t = e.split("#"), r = t[0], s = r.length;
311
+ const t = e.split("#"), n = t[0], s = n.length;
312
312
  if (s < this.MIN_BLUE_ID_LENGTH || s > this.MAX_BLUE_ID_LENGTH)
313
313
  return !1;
314
314
  try {
315
- if (X.decode(r).length !== 32)
315
+ if (q.decode(n).length !== 32)
316
316
  return !1;
317
317
  } catch {
318
318
  return !1;
@@ -327,15 +327,15 @@ class $ {
327
327
  return !0;
328
328
  }
329
329
  }
330
- u($, "MIN_BLUE_ID_LENGTH", 41), u($, "MAX_BLUE_ID_LENGTH", 45), u($, "BLUE_ID_PATTERN", /^[1-9A-HJ-NP-Za-km-z]{41,45}(?:#\d+)?$/);
331
- const Er = d.string().max($.MAX_BLUE_ID_LENGTH, {
330
+ u(M, "MIN_BLUE_ID_LENGTH", 41), u(M, "MAX_BLUE_ID_LENGTH", 45), u(M, "BLUE_ID_PATTERN", /^[1-9A-HJ-NP-Za-km-z]{41,45}(?:#\d+)?$/);
331
+ const Pn = f.string().max(M.MAX_BLUE_ID_LENGTH, {
332
332
  message: "Blue Id has a maximum length of 45 characters"
333
- }).min($.MIN_BLUE_ID_LENGTH, {
333
+ }).min(M.MIN_BLUE_ID_LENGTH, {
334
334
  message: "Blue Id has a minimum length of 41 characters"
335
335
  }).refine(
336
- (n) => {
336
+ (r) => {
337
337
  try {
338
- return X.decode(n), !0;
338
+ return q.decode(r), !0;
339
339
  } catch {
340
340
  return !1;
341
341
  }
@@ -343,45 +343,45 @@ const Er = d.string().max($.MAX_BLUE_ID_LENGTH, {
343
343
  {
344
344
  message: "Blue Id must be a valid Base58 string"
345
345
  }
346
- ), q = d.lazy(
347
- () => d.record(d.unknown()).and(
348
- d.object({
349
- blueId: d.string().optional(),
350
- name: d.string().optional(),
351
- description: d.string().optional(),
352
- type: q.optional(),
353
- value: d.union([d.string(), d.number(), d.boolean()]).optional().nullable(),
354
- items: d.array(q).optional()
346
+ ), Q = f.lazy(
347
+ () => f.record(f.unknown()).and(
348
+ f.object({
349
+ blueId: f.string().optional(),
350
+ name: f.string().optional(),
351
+ description: f.string().optional(),
352
+ type: Q.optional(),
353
+ value: f.union([f.string(), f.number(), f.boolean()]).optional().nullable(),
354
+ items: f.array(Q).optional()
355
355
  })
356
356
  )
357
- ), Be = d.object({
358
- blueId: d.string().optional(),
359
- name: d.string().optional(),
360
- description: d.string().optional(),
361
- type: q.optional()
362
- }), Pr = Be.extend({
363
- value: d.string().optional()
364
- }), Ar = Be.extend({
365
- value: d.number().optional()
366
- }), Nr = Be.extend({
367
- value: d.boolean().optional()
368
- }), Sr = Be.extend({
369
- items: d.array(d.string()).optional()
370
- }), Cr = (n) => q.safeParse(n).success, Xt = (n) => f(n) && "blueId" in n && f(n.blueId), Fr = (n) => f(n) && "name" in n && f(n.name), qt = (n) => f(n) && "items" in n && f(n.items), Qt = (n) => f(n) && "type" in n && f(n.type), en = (n) => f(n) && "value" in n && f(n.value), Vr = (n, e) => n.required({ type: !0 }).safeParse(e).success, S = (n) => n instanceof R, Q = (n) => S(n) && n instanceof v, tn = (n) => S(n) && n instanceof P, nn = d.lazy(
371
- () => d.record(fe)
372
- ), rn = d.lazy(
373
- () => d.union([
374
- d.array(fe),
375
- d.array(fe).readonly()
357
+ ), Be = f.object({
358
+ blueId: f.string().optional(),
359
+ name: f.string().optional(),
360
+ description: f.string().optional(),
361
+ type: Q.optional()
362
+ }), An = Be.extend({
363
+ value: f.string().optional()
364
+ }), Sn = Be.extend({
365
+ value: f.number().optional()
366
+ }), Nn = Be.extend({
367
+ value: f.boolean().optional()
368
+ }), Cn = Be.extend({
369
+ items: f.array(f.string()).optional()
370
+ }), Fn = (r) => Q.safeParse(r).success, qt = (r) => d(r) && "blueId" in r && d(r.blueId), Vn = (r) => d(r) && "name" in r && d(r.name), Qt = (r) => d(r) && "items" in r && d(r.items), er = (r) => d(r) && "type" in r && d(r.type), tr = (r) => d(r) && "value" in r && d(r.value), Dn = (r, e) => r.required({ type: !0 }).safeParse(e).success, C = (r) => r instanceof x, ee = (r) => C(r) && r instanceof B, rr = (r) => C(r) && r instanceof A, nr = f.lazy(
371
+ () => f.record(he)
372
+ ), sr = f.lazy(
373
+ () => f.union([
374
+ f.array(he),
375
+ f.array(he).readonly()
376
376
  ])
377
- ), fe = d.lazy(
378
- () => d.union([
379
- Ft,
380
- nn,
381
- rn,
382
- d.instanceof(R)
377
+ ), he = f.lazy(
378
+ () => f.union([
379
+ Vt,
380
+ nr,
381
+ sr,
382
+ f.instanceof(x)
383
383
  ])
384
- ), ht = (n) => De(n) && !be(n) && !K(n) && !S(n), pt = (n) => be(n) || K(n), Dr = (n) => pt(n) || ht(n) || S(n) || Me(n);
384
+ ), ht = (r) => Oe(r) && !Te(r) && !X(r) && !C(r), pt = (r) => Te(r) || X(r), On = (r) => pt(r) || ht(r) || C(r) || Le(r);
385
385
  class p {
386
386
  static deserialize(e) {
387
387
  return p.handleNode(e);
@@ -392,25 +392,25 @@ class p {
392
392
  "This is not a valid JSON-like value. Found 'undefined' as a value."
393
393
  );
394
394
  if (ht(e)) {
395
- const t = new c(), r = {}, s = {};
395
+ const t = new l(), n = {}, s = {};
396
396
  return Object.entries(e).forEach(([i, o]) => {
397
397
  switch (i) {
398
- case k:
398
+ case Y:
399
399
  if (o == null)
400
400
  t.setName(void 0);
401
401
  else {
402
402
  if (typeof o != "string")
403
- throw new Error(`The ${k} field must be a string.`);
403
+ throw new Error(`The ${Y} field must be a string.`);
404
404
  t.setName(o);
405
405
  }
406
406
  break;
407
- case Y:
407
+ case G:
408
408
  if (o == null)
409
409
  t.setDescription(void 0);
410
410
  else {
411
411
  if (typeof o != "string")
412
412
  throw new Error(
413
- `The ${Y} field must be a string.`
413
+ `The ${G} field must be a string.`
414
414
  );
415
415
  t.setDescription(o);
416
416
  }
@@ -418,45 +418,45 @@ class p {
418
418
  case de:
419
419
  t.setType(p.handleNode(o));
420
420
  break;
421
- case Ze:
421
+ case ke:
422
422
  t.setItemType(p.handleNode(o));
423
423
  break;
424
424
  case _e:
425
425
  t.setKeyType(p.handleNode(o));
426
426
  break;
427
- case ke:
427
+ case Ye:
428
428
  t.setValueType(p.handleNode(o));
429
429
  break;
430
- case Te:
430
+ case we:
431
431
  t.setValue(p.handleValue(o));
432
432
  break;
433
- case M:
433
+ case L:
434
434
  if (typeof o != "string")
435
- throw new Error(`The ${M} field must be a string.`);
435
+ throw new Error(`The ${L} field must be a string.`);
436
436
  t.setBlueId(o);
437
437
  break;
438
- case Ye:
438
+ case Ge:
439
439
  t.setItems(p.handleArray(o));
440
440
  break;
441
- case Ge:
441
+ case ze:
442
442
  t.setBlue(p.handleNode(o));
443
443
  break;
444
- case we:
445
- De(o) && !be(o) && !K(o) && Object.entries(o).forEach(([l, a]) => {
446
- s[l] = p.handleNode(a);
444
+ case ve:
445
+ Oe(o) && !Te(o) && !X(o) && Object.entries(o).forEach(([c, a]) => {
446
+ s[c] = p.handleNode(a);
447
447
  });
448
448
  break;
449
449
  default:
450
- r[i] = p.handleNode(o);
450
+ n[i] = p.handleNode(o);
451
451
  break;
452
452
  }
453
- }), Object.keys(r).length > 0 && t.setProperties(r), Object.keys(s).length > 0 && t.setContracts(s), t;
453
+ }), Object.keys(n).length > 0 && t.setProperties(n), Object.keys(s).length > 0 && t.setContracts(s), t;
454
454
  } else {
455
455
  if (pt(e))
456
- return new c().setItems(p.handleArray(e));
456
+ return new l().setItems(p.handleArray(e));
457
457
  {
458
458
  const t = e;
459
- return new c().setValue(p.handleValue(t)).setInlineValue(!0);
459
+ return new l().setValue(p.handleValue(t)).setInlineValue(!0);
460
460
  }
461
461
  }
462
462
  }
@@ -465,13 +465,13 @@ class p {
465
465
  return null;
466
466
  if (typeof e == "string")
467
467
  return e;
468
- if (typeof e == "number" || S(e))
469
- if (Q(e) || Number.isSafeInteger(e)) {
470
- const t = new v(e.toString()), r = Number.MIN_SAFE_INTEGER, s = Number.MAX_SAFE_INTEGER;
471
- return t.lt(r) ? new v(r.toString()) : t.gt(s) ? new v(s.toString()) : t;
468
+ if (typeof e == "number" || C(e))
469
+ if (ee(e) || Number.isSafeInteger(e)) {
470
+ const t = new B(e.toString()), n = Number.MIN_SAFE_INTEGER, s = Number.MAX_SAFE_INTEGER;
471
+ return t.lt(n) ? new B(n.toString()) : t.gt(s) ? new B(s.toString()) : t;
472
472
  } else {
473
473
  const t = parseFloat(e.toString());
474
- return new P(t.toString());
474
+ return new A(t.toString());
475
475
  }
476
476
  else if (typeof e == "boolean")
477
477
  return e;
@@ -479,7 +479,7 @@ class p {
479
479
  }
480
480
  static handleArray(e) {
481
481
  if (e != null) {
482
- if (De(e) && !Array.isArray(e))
482
+ if (Oe(e) && !Array.isArray(e))
483
483
  return [p.handleNode(e)];
484
484
  if (Array.isArray(e))
485
485
  return e.map(p.handleNode);
@@ -487,68 +487,68 @@ class p {
487
487
  }
488
488
  }
489
489
  }
490
- function sn(n) {
491
- return n && n.__esModule && Object.prototype.hasOwnProperty.call(n, "default") ? n.default : n;
490
+ function ir(r) {
491
+ return r && r.__esModule && Object.prototype.hasOwnProperty.call(r, "default") ? r.default : r;
492
492
  }
493
- var Ae, Ke;
494
- function on() {
495
- return Ke || (Ke = 1, Ae = function n(e) {
493
+ var Se, Xe;
494
+ function or() {
495
+ return Xe || (Xe = 1, Se = function r(e) {
496
496
  if (typeof e == "number" && isNaN(e))
497
497
  throw new Error("NaN is not allowed");
498
498
  if (typeof e == "number" && !isFinite(e))
499
499
  throw new Error("Infinity is not allowed");
500
- return e === null || typeof e != "object" ? JSON.stringify(e) : e.toJSON instanceof Function ? n(e.toJSON()) : Array.isArray(e) ? `[${e.reduce((s, i, o) => `${s}${o === 0 ? "" : ","}${n(i === void 0 || typeof i == "symbol" ? null : i)}`, "")}]` : `{${Object.keys(e).sort().reduce((r, s) => {
500
+ return e === null || typeof e != "object" ? JSON.stringify(e) : e.toJSON instanceof Function ? r(e.toJSON()) : Array.isArray(e) ? `[${e.reduce((s, i, o) => `${s}${o === 0 ? "" : ","}${r(i === void 0 || typeof i == "symbol" ? null : i)}`, "")}]` : `{${Object.keys(e).sort().reduce((n, s) => {
501
501
  if (e[s] === void 0 || typeof e[s] == "symbol")
502
- return r;
503
- const i = r.length === 0 ? "" : ",";
504
- return `${r}${i}${n(s)}:${n(e[s])}`;
502
+ return n;
503
+ const i = n.length === 0 ? "" : ",";
504
+ return `${n}${i}${r(s)}:${r(e[s])}`;
505
505
  }, "")}}`;
506
- }), Ae;
506
+ }), Se;
507
507
  }
508
- var ln = on();
509
- const cn = /* @__PURE__ */ sn(ln);
510
- class an {
508
+ var cr = or();
509
+ const lr = /* @__PURE__ */ ir(cr);
510
+ class ar {
511
511
  static canonicalize(e) {
512
- return cn(e);
512
+ return lr(e);
513
513
  }
514
514
  }
515
- const un = typeof process < "u" && process.versions != null && process.versions.node != null, ye = class ye {
515
+ const ur = typeof process < "u" && process.versions != null && process.versions.node != null, me = class me {
516
516
  constructor() {
517
517
  u(this, "browserCrypto");
518
518
  this.browserCrypto = this.initBrowserCrypto();
519
519
  }
520
520
  static getInstance() {
521
- return this.instance || (this.instance = new ye()), this.instance;
521
+ return this.instance || (this.instance = new me()), this.instance;
522
522
  }
523
523
  initBrowserCrypto() {
524
- return un ? null : "crypto" in globalThis ? globalThis.crypto : null;
524
+ return ur ? null : "crypto" in globalThis ? globalThis.crypto : null;
525
525
  }
526
526
  hasNodeCrypto() {
527
- return !!We.createHash;
527
+ return !!Ke.createHash;
528
528
  }
529
529
  getBrowserCrypto() {
530
530
  return this.browserCrypto;
531
531
  }
532
532
  getNodeCrypto() {
533
- return We;
533
+ return Ke;
534
534
  }
535
535
  };
536
- u(ye, "instance");
537
- let Oe = ye;
538
- class dn {
536
+ u(me, "instance");
537
+ let je = me;
538
+ class fr {
539
539
  constructor() {
540
- u(this, "cryptoEnv", Oe.getInstance());
540
+ u(this, "cryptoEnv", je.getInstance());
541
541
  }
542
542
  applySync(e) {
543
- const t = this.canonicalizeInput(e), r = this.cryptoEnv.hasNodeCrypto() ? this.sha256Sync(t) : this.sha256SyncBrowser(t);
544
- return X.encode(new Uint8Array(r));
543
+ const t = this.canonicalizeInput(e), n = this.cryptoEnv.hasNodeCrypto() ? this.sha256Sync(t) : this.sha256SyncBrowser(t);
544
+ return q.encode(new Uint8Array(n));
545
545
  }
546
546
  async apply(e) {
547
- const t = this.canonicalizeInput(e), r = this.cryptoEnv.hasNodeCrypto() ? this.sha256Sync(t) : await this.sha256Async(t);
548
- return X.encode(new Uint8Array(r));
547
+ const t = this.canonicalizeInput(e), n = this.cryptoEnv.hasNodeCrypto() ? this.sha256Sync(t) : await this.sha256Async(t);
548
+ return q.encode(new Uint8Array(n));
549
549
  }
550
550
  canonicalizeInput(e) {
551
- const t = an.canonicalize(e);
551
+ const t = ar.canonicalize(e);
552
552
  if (typeof t != "string")
553
553
  throw new Error("Canonized value must be a string");
554
554
  return t;
@@ -562,7 +562,7 @@ class dn {
562
562
  return t.createHash("sha256").update(e).digest();
563
563
  }
564
564
  sha256SyncBrowser(e) {
565
- return Ut.arrayBuffer(e);
565
+ return $t.arrayBuffer(e);
566
566
  }
567
567
  async sha256Async(e) {
568
568
  if (this.cryptoEnv.hasNodeCrypto())
@@ -586,54 +586,54 @@ class T {
586
586
  * @returns A JSON representation of the node.
587
587
  */
588
588
  static get(e, t = "official") {
589
- var ie;
590
- const r = e.getValue(), s = this.handleValue(r);
589
+ var oe;
590
+ const n = e.getValue(), s = this.handleValue(n);
591
591
  if (s !== void 0 && t === "simple")
592
592
  return s;
593
- const i = (ie = e.getItems()) == null ? void 0 : ie.map((V) => T.get(V, t));
593
+ const i = (oe = e.getItems()) == null ? void 0 : oe.map((D) => T.get(D, t));
594
594
  if (i !== void 0 && t === "simple")
595
595
  return i;
596
- const o = e.getName(), l = e.getDescription();
597
- if (t === "original" && o === void 0 && l === void 0) {
596
+ const o = e.getName(), c = e.getDescription();
597
+ if (t === "original" && o === void 0 && c === void 0) {
598
598
  if (s !== void 0)
599
599
  return s;
600
600
  if (i !== void 0)
601
601
  return i;
602
602
  }
603
603
  const a = {};
604
- o !== void 0 && (a[k] = o), l !== void 0 && (a[Y] = l);
604
+ o !== void 0 && (a[Y] = o), c !== void 0 && (a[G] = c);
605
605
  const g = e.getType();
606
- if (t === "official" && r !== void 0 && g === void 0) {
607
- const V = this.inferTypeBlueId(r);
608
- V !== null && (a[de] = { [M]: V });
606
+ if (t === "official" && n !== void 0 && g === void 0) {
607
+ const D = this.inferTypeBlueId(n);
608
+ D !== null && (a[de] = { [L]: D });
609
609
  } else g !== void 0 && (a[de] = T.get(g, t));
610
610
  const b = e.getItemType();
611
- b !== void 0 && (a[Ze] = T.get(b, t));
611
+ b !== void 0 && (a[ke] = T.get(b, t));
612
612
  const I = e.getKeyType();
613
613
  I !== void 0 && (a[_e] = T.get(I, t));
614
614
  const m = e.getValueType();
615
- m !== void 0 && (a[ke] = T.get(m, t)), s !== void 0 && (a[Te] = s), i !== void 0 && (a[Ye] = i);
615
+ m !== void 0 && (a[Ye] = T.get(m, t)), s !== void 0 && (a[we] = s), i !== void 0 && (a[Ge] = i);
616
616
  const y = e.getBlueId();
617
- y !== void 0 && (a[M] = y);
617
+ y !== void 0 && (a[L] = y);
618
618
  const h = e.getBlue();
619
- h !== void 0 && (a[Ge] = h);
619
+ h !== void 0 && (a[ze] = h);
620
620
  const w = e.getContracts();
621
621
  if (w !== void 0) {
622
- const V = {};
623
- Object.entries(w).forEach(([Pe, Nt]) => {
624
- V[Pe] = T.get(Nt, t);
625
- }), a[we] = V;
622
+ const D = {};
623
+ Object.entries(w).forEach(([Ae, Nt]) => {
624
+ D[Ae] = T.get(Nt, t);
625
+ }), a[ve] = D;
626
626
  }
627
- const F = e.getProperties();
628
- return F !== void 0 && Object.entries(F).forEach(([V, Pe]) => {
629
- a[V] = T.get(Pe, t);
627
+ const V = e.getProperties();
628
+ return V !== void 0 && Object.entries(V).forEach(([D, Ae]) => {
629
+ a[D] = T.get(Ae, t);
630
630
  }), a;
631
631
  }
632
632
  static handleValue(e) {
633
- if (S(e)) {
634
- if (Q(e)) {
635
- const t = new R(Number.MIN_SAFE_INTEGER.toString()), r = new R(Number.MAX_SAFE_INTEGER.toString());
636
- if (e.lt(t) || e.gt(r))
633
+ if (C(e)) {
634
+ if (ee(e)) {
635
+ const t = new x(Number.MIN_SAFE_INTEGER.toString()), n = new x(Number.MAX_SAFE_INTEGER.toString());
636
+ if (e.lt(t) || e.gt(n))
637
637
  return e.toString();
638
638
  }
639
639
  return e.toNumber();
@@ -641,29 +641,29 @@ class T {
641
641
  return e;
642
642
  }
643
643
  static inferTypeBlueId(e) {
644
- return typeof e == "string" ? te : S(e) ? Q(e) ? re : ne : typeof e == "boolean" ? se : null;
644
+ return typeof e == "string" ? re : C(e) ? ee(e) ? se : ne : typeof e == "boolean" ? ie : null;
645
645
  }
646
646
  }
647
- const fn = (n) => Me(n) && f(n), j = class j {
647
+ const dr = (r) => Le(r) && d(r), R = class R {
648
648
  constructor(e) {
649
649
  u(this, "hashProvider");
650
650
  this.hashProvider = e;
651
651
  }
652
652
  static calculateBlueId(e) {
653
653
  if (Array.isArray(e)) {
654
- const r = e.map((s) => T.get(s));
655
- return j.INSTANCE.calculate(r);
654
+ const n = e.map((s) => T.get(s));
655
+ return R.INSTANCE.calculate(n);
656
656
  }
657
657
  const t = T.get(e);
658
- return j.INSTANCE.calculate(t);
658
+ return R.INSTANCE.calculate(t);
659
659
  }
660
660
  static calculateBlueIdSync(e) {
661
661
  if (Array.isArray(e)) {
662
- const r = e.map((s) => T.get(s));
663
- return j.INSTANCE.calculateSync(r);
662
+ const n = e.map((s) => T.get(s));
663
+ return R.INSTANCE.calculateSync(n);
664
664
  }
665
665
  const t = T.get(e);
666
- return j.INSTANCE.calculateSync(t);
666
+ return R.INSTANCE.calculateSync(t);
667
667
  }
668
668
  // public static calculateBlueIdForNodes(nodes: BlueNode[]) {
669
669
  // const objects = nodes.map((node) => NodeToMapListOrValue.get(node));
@@ -687,34 +687,34 @@ const fn = (n) => Me(n) && f(n), j = class j {
687
687
  }
688
688
  // Internal method to calculate BlueId recursively
689
689
  internalCalculate(e, t) {
690
- return fn(e) || S(e) ? this.applyHash(e.toString(), t) : Array.isArray(e) || K(e) ? this.calculateList(e, t) : this.calculateMap(e, t);
690
+ return dr(e) || C(e) ? this.applyHash(e.toString(), t) : Array.isArray(e) || X(e) ? this.calculateList(e, t) : this.calculateMap(e, t);
691
691
  }
692
692
  calculateMap(e, t) {
693
- if (e[M] !== void 0)
694
- return e[M];
693
+ if (e[L] !== void 0)
694
+ return e[L];
695
695
  const s = Object.keys(e).map((o) => {
696
- const l = e[o];
697
- if ([k, Te, Y].includes(o))
698
- return t ? [o, l] : Promise.resolve([o, l]);
696
+ const c = e[o];
697
+ if ([Y, we, G].includes(o))
698
+ return t ? [o, c] : Promise.resolve([o, c]);
699
699
  {
700
- const a = this.internalCalculate(l, t);
700
+ const a = this.internalCalculate(c, t);
701
701
  return t ? [o, { blueId: a }] : Promise.resolve(a).then((g) => [
702
702
  o,
703
703
  { blueId: g }
704
704
  ]);
705
705
  }
706
706
  }), i = (o) => {
707
- const l = {};
707
+ const c = {};
708
708
  for (const [a, g] of o)
709
- l[a] = g;
710
- return this.applyHash(l, t);
709
+ c[a] = g;
710
+ return this.applyHash(c, t);
711
711
  };
712
712
  return t ? i(s) : Promise.all(s).then(i);
713
713
  }
714
714
  calculateList(e, t) {
715
715
  if (e.length === 0)
716
716
  throw new Error("Cannot calculate BlueId for an empty list.");
717
- let r = this.internalCalculate(
717
+ let n = this.internalCalculate(
718
718
  e[0],
719
719
  t
720
720
  );
@@ -722,13 +722,13 @@ const fn = (n) => Me(n) && f(n), j = class j {
722
722
  [{ blueId: i }, { blueId: o }],
723
723
  !0
724
724
  ) : Promise.all([i, o]).then(
725
- ([l, a]) => this.applyHash([{ blueId: l }, { blueId: a }], !1)
725
+ ([c, a]) => this.applyHash([{ blueId: c }, { blueId: a }], !1)
726
726
  );
727
727
  for (let i = 1; i < e.length; i++) {
728
728
  const o = this.internalCalculate(e[i], t);
729
- r = s(r, o);
729
+ n = s(n, o);
730
730
  }
731
- return r;
731
+ return n;
732
732
  }
733
733
  // Method to apply the hash provider to a value
734
734
  applyHash(e, t) {
@@ -737,16 +737,16 @@ const fn = (n) => Me(n) && f(n), j = class j {
737
737
  // Method to clean the input structure by removing null or undefined values
738
738
  cleanStructure(e) {
739
739
  if (e != null) {
740
- if (Me(e) || S(e))
740
+ if (Le(e) || C(e))
741
741
  return e;
742
- if (Array.isArray(e) || K(e)) {
743
- const t = e.map((r) => this.cleanStructure(r)).filter(f);
742
+ if (Array.isArray(e) || X(e)) {
743
+ const t = e.map((n) => this.cleanStructure(n)).filter(d);
744
744
  return t.length > 0 ? t : void 0;
745
745
  } else if (typeof e == "object") {
746
746
  const t = {};
747
- for (const r in e) {
748
- const s = this.cleanStructure(e[r]);
749
- s != null && (t[r] = s);
747
+ for (const n in e) {
748
+ const s = this.cleanStructure(e[n]);
749
+ s != null && (t[n] = s);
750
750
  }
751
751
  return Object.keys(t).length > 0 ? t : void 0;
752
752
  } else
@@ -754,17 +754,17 @@ const fn = (n) => Me(n) && f(n), j = class j {
754
754
  }
755
755
  }
756
756
  };
757
- u(j, "INSTANCE", new j(new dn()));
758
- let C = j;
759
- class Or {
757
+ u(R, "INSTANCE", new R(new fr()));
758
+ let F = R;
759
+ class jn {
760
760
  static convert(e) {
761
- const t = X.decode(e), r = new Uint8Array(2 + t.length);
762
- r[0] = 18, r[1] = 32, r.set(t, 2);
763
- const s = new Uint8Array(2 + r.length);
764
- return s[0] = 1, s[1] = 85, s.set(r, 2), "b" + new $t.Encoder({ type: "rfc4648", lc: !0 }).write(s).finalize().replace(/=/g, "");
761
+ const t = q.decode(e), n = new Uint8Array(2 + t.length);
762
+ n[0] = 18, n[1] = 32, n.set(t, 2);
763
+ const s = new Uint8Array(2 + n.length);
764
+ return s[0] = 1, s[1] = 85, s.set(n, 2), "b" + new Mt.Encoder({ type: "rfc4648", lc: !0 }).write(s).finalize().replace(/=/g, "");
765
765
  }
766
766
  }
767
- class A {
767
+ class S {
768
768
  /**
769
769
  * Transforms a node and all its child nodes using the provided transformer function
770
770
  * @param node - The node to transform
@@ -772,100 +772,100 @@ class A {
772
772
  * @returns The transformed node
773
773
  */
774
774
  static transform(e, t) {
775
- const r = t(e.clone()), s = r.getType();
776
- s !== void 0 && r.setType(A.transform(s, t));
777
- const i = r.getItemType();
778
- i !== void 0 && r.setItemType(
779
- A.transform(i, t)
775
+ const n = t(e.clone()), s = n.getType();
776
+ s !== void 0 && n.setType(S.transform(s, t));
777
+ const i = n.getItemType();
778
+ i !== void 0 && n.setItemType(
779
+ S.transform(i, t)
780
780
  );
781
- const o = r.getKeyType();
782
- o !== void 0 && r.setKeyType(
783
- A.transform(o, t)
781
+ const o = n.getKeyType();
782
+ o !== void 0 && n.setKeyType(
783
+ S.transform(o, t)
784
784
  );
785
- const l = r.getValueType();
786
- l !== void 0 && r.setValueType(
787
- A.transform(l, t)
785
+ const c = n.getValueType();
786
+ c !== void 0 && n.setValueType(
787
+ S.transform(c, t)
788
788
  );
789
- const a = r.getItems();
789
+ const a = n.getItems();
790
790
  if (a !== void 0) {
791
791
  const I = a.map(
792
- (m) => A.transform(m, t)
792
+ (m) => S.transform(m, t)
793
793
  );
794
- r.setItems(I);
794
+ n.setItems(I);
795
795
  }
796
- const g = r.getProperties();
796
+ const g = n.getProperties();
797
797
  if (g !== void 0) {
798
798
  const I = Object.keys(g).reduce(
799
- (m, y) => (m[y] = A.transform(g[y], t), m),
799
+ (m, y) => (m[y] = S.transform(g[y], t), m),
800
800
  {}
801
801
  );
802
- r.setProperties(I);
802
+ n.setProperties(I);
803
803
  }
804
- const b = r.getContracts();
804
+ const b = n.getContracts();
805
805
  if (b !== void 0) {
806
- const I = Object.keys(b).reduce((m, y) => (m[y] = A.transform(b[y], t), m), {});
807
- r.setContracts(I);
806
+ const I = Object.keys(b).reduce((m, y) => (m[y] = S.transform(b[y], t), m), {});
807
+ n.setContracts(I);
808
808
  }
809
- return r;
809
+ return n;
810
810
  }
811
811
  }
812
- const x = (n) => !!n && typeof n == "object" && !Array.isArray(n) && !(n instanceof c), O = (n) => n instanceof v || n instanceof P, hn = (n) => n.replace(/~1/g, "/").replace(/~0/g, "~");
813
- function z(n) {
814
- if (n === "/") return [];
815
- if (!n.startsWith("/"))
816
- throw new Error(`Path must start with '/': ${n}`);
817
- return n.split("/").slice(1).map(hn);
812
+ const U = (r) => !!r && typeof r == "object" && !Array.isArray(r) && !(r instanceof l), j = (r) => r instanceof B || r instanceof A, hr = (r) => r.replace(/~1/g, "/").replace(/~0/g, "~");
813
+ function J(r) {
814
+ if (r === "/") return [];
815
+ if (!r.startsWith("/"))
816
+ throw new Error(`Path must start with '/': ${r}`);
817
+ return r.split("/").slice(1).map(hr);
818
818
  }
819
- function G(n) {
820
- if (n === "-") return -1;
821
- const e = typeof n == "number" ? n : parseInt(n, 10);
819
+ function z(r) {
820
+ if (r === "-") return -1;
821
+ const e = typeof r == "number" ? r : parseInt(r, 10);
822
822
  if (isNaN(e))
823
- throw new Error(`Invalid array index (NaN) from '${n}'`);
823
+ throw new Error(`Invalid array index (NaN) from '${r}'`);
824
824
  if (!Number.isFinite(e))
825
825
  throw new Error(
826
- `Invalid array index '${n}' results in non-finite number ${e}`
826
+ `Invalid array index '${r}' results in non-finite number ${e}`
827
827
  );
828
828
  return e;
829
829
  }
830
- function gt(n, e, t, r = !0) {
830
+ function gt(r, e, t, n = !0) {
831
831
  switch (e) {
832
832
  case "name":
833
- return t ? r ? n.getName() ?? null : n : n.getName();
833
+ return t ? n ? r.getName() ?? null : r : r.getName();
834
834
  case "description":
835
- return t ? r ? n.getDescription() : n : n.getDescription();
835
+ return t ? n ? r.getDescription() : r : r.getDescription();
836
836
  case "type":
837
- return n.getType();
837
+ return r.getType();
838
838
  case "itemType":
839
- return n.getItemType();
839
+ return r.getItemType();
840
840
  case "keyType":
841
- return n.getKeyType();
841
+ return r.getKeyType();
842
842
  case "valueType":
843
- return n.getValueType();
843
+ return r.getValueType();
844
844
  case "value":
845
- return t ? r ? n.getValue() ?? null : n : n.getValue();
845
+ return t ? n ? r.getValue() ?? null : r : r.getValue();
846
846
  case "blueId":
847
- return t ? r ? n.getBlueId() ?? null : n : n.getBlueId();
847
+ return t ? n ? r.getBlueId() ?? null : r : r.getBlueId();
848
848
  case "blue":
849
- return n.getBlue();
849
+ return r.getBlue();
850
850
  case "items":
851
- return n.getItems();
851
+ return r.getItems();
852
852
  case "properties":
853
- return n.getProperties();
853
+ return r.getProperties();
854
854
  case "contracts":
855
- return n.getContracts();
855
+ return r.getContracts();
856
856
  default:
857
857
  return;
858
858
  }
859
859
  }
860
- function Xe(n, e, t = !0) {
861
- if (n instanceof c) {
862
- const r = gt(
863
- n,
860
+ function qe(r, e, t = !0) {
861
+ if (r instanceof l) {
862
+ const n = gt(
863
+ r,
864
864
  e,
865
865
  !0,
866
866
  t
867
867
  );
868
- if (r !== void 0 || [
868
+ if (n !== void 0 || [
869
869
  "name",
870
870
  "description",
871
871
  "type",
@@ -879,54 +879,54 @@ function Xe(n, e, t = !0) {
879
879
  "properties",
880
880
  "contracts"
881
881
  ].includes(e))
882
- return r;
882
+ return n;
883
883
  if (/^-?\d+$/.test(e) && e !== "-") {
884
- const i = n.getItems(), o = parseInt(e, 10);
884
+ const i = r.getItems(), o = parseInt(e, 10);
885
885
  return i && o >= 0 && o < i.length ? i[o] : void 0;
886
886
  }
887
- const s = n.getProperties();
887
+ const s = r.getProperties();
888
888
  return s && e in s ? s[e] : void 0;
889
889
  }
890
- if (Array.isArray(n)) {
890
+ if (Array.isArray(r)) {
891
891
  if (e === "-") return;
892
- const r = G(e);
893
- return r >= 0 && r < n.length ? n[r] : void 0;
892
+ const n = z(e);
893
+ return n >= 0 && n < r.length ? r[n] : void 0;
894
894
  }
895
- if (x(n)) return n[e];
895
+ if (U(r)) return r[e];
896
896
  }
897
- function J(n, e) {
897
+ function H(r, e) {
898
898
  if (e.length === 0)
899
899
  return {
900
- parent: n,
900
+ parent: r,
901
901
  key: "value",
902
- actualTarget: n.getValue() ?? n
902
+ actualTarget: r.getValue() ?? r
903
903
  };
904
- let t = n;
904
+ let t = r;
905
905
  for (let s = 0; s < e.length - 1; ++s) {
906
- const i = e[s], o = Xe(t, i);
906
+ const i = e[s], o = qe(t, i);
907
907
  if (o === void 0)
908
908
  throw new Error(`Cannot resolve '/${e.slice(0, s + 1).join("/")}'`);
909
909
  t = o;
910
910
  }
911
- const r = e[e.length - 1];
912
- if (t instanceof c) {
913
- const s = Xe(t, r, !1);
914
- if ((typeof s != "object" || s === null || O(s)) && !(s instanceof c) && !Array.isArray(s) && ["name", "description", "value", "blueId"].includes(r))
911
+ const n = e[e.length - 1];
912
+ if (t instanceof l) {
913
+ const s = qe(t, n, !1);
914
+ if ((typeof s != "object" || s === null || j(s)) && !(s instanceof l) && !Array.isArray(s) && ["name", "description", "value", "blueId"].includes(n))
915
915
  return {
916
916
  parent: t,
917
- key: r,
917
+ key: n,
918
918
  actualTarget: s
919
919
  };
920
920
  }
921
- return Array.isArray(t) && r === "-" ? { parent: t, key: "-" } : t instanceof c && t.getItems() && r === "-" ? { parent: t, key: "-" } : {
921
+ return Array.isArray(t) && n === "-" ? { parent: t, key: "-" } : t instanceof l && t.getItems() && n === "-" ? { parent: t, key: "-" } : {
922
922
  parent: t,
923
- key: Array.isArray(t) ? G(r) : r
923
+ key: Array.isArray(t) ? z(n) : n
924
924
  };
925
925
  }
926
- function Je(n, e) {
926
+ function He(r, e) {
927
927
  var t;
928
- if (n instanceof c) {
929
- const r = e, s = gt(n, r, !1);
928
+ if (r instanceof l) {
929
+ const n = e, s = gt(r, n, !1);
930
930
  if (s !== void 0 || [
931
931
  "name",
932
932
  "description",
@@ -940,97 +940,97 @@ function Je(n, e) {
940
940
  "items",
941
941
  "properties",
942
942
  "contracts"
943
- ].includes(r))
943
+ ].includes(n))
944
944
  return s;
945
945
  if (typeof e == "number" || typeof e == "string" && /^\d+$/.test(e)) {
946
- const i = n.getItems(), o = typeof e == "number" ? e : parseInt(e, 10);
946
+ const i = r.getItems(), o = typeof e == "number" ? e : parseInt(e, 10);
947
947
  if (i && o >= 0 && o < i.length) return i[o];
948
948
  }
949
- return (t = n.getProperties()) == null ? void 0 : t[r];
949
+ return (t = r.getProperties()) == null ? void 0 : t[n];
950
950
  }
951
- return Array.isArray(n) || x(n) ? n[e] : n;
951
+ return Array.isArray(r) || U(r) ? r[e] : r;
952
952
  }
953
- function B(n) {
954
- if (n instanceof c) return n;
955
- if (n === null || typeof n == "string" || typeof n == "number" || typeof n == "boolean" || O(n))
956
- return p.deserialize(n);
957
- const e = je(n);
953
+ function v(r) {
954
+ if (r instanceof l) return r;
955
+ if (r === null || typeof r == "string" || typeof r == "number" || typeof r == "boolean" || j(r))
956
+ return p.deserialize(r);
957
+ const e = Re(r);
958
958
  return p.deserialize(e);
959
959
  }
960
- function je(n) {
961
- if (n === void 0) return null;
962
- if (n === null || typeof n != "object") return n;
963
- if (Array.isArray(n)) return n.map(je);
960
+ function Re(r) {
961
+ if (r === void 0) return null;
962
+ if (r === null || typeof r != "object") return r;
963
+ if (Array.isArray(r)) return r.map(Re);
964
964
  const e = {};
965
- for (const [t, r] of Object.entries(n))
966
- e[t] = je(r);
965
+ for (const [t, n] of Object.entries(r))
966
+ e[t] = Re(n);
967
967
  return e;
968
968
  }
969
- function He(n, e, t) {
970
- if (n instanceof c) {
971
- const r = e;
972
- switch (r) {
969
+ function We(r, e, t) {
970
+ if (r instanceof l) {
971
+ const n = e;
972
+ switch (n) {
973
973
  case "name":
974
- n.setName(t);
974
+ r.setName(t);
975
975
  return;
976
976
  case "description":
977
- n.setDescription(t);
977
+ r.setDescription(t);
978
978
  return;
979
979
  case "type":
980
- n.setType(
981
- t instanceof c || typeof t == "string" || t === void 0 ? t : B(t)
980
+ r.setType(
981
+ t instanceof l || typeof t == "string" || t === void 0 ? t : v(t)
982
982
  );
983
983
  return;
984
984
  case "itemType":
985
- n.setItemType(
986
- t instanceof c || typeof t == "string" || t === void 0 ? t : B(t)
985
+ r.setItemType(
986
+ t instanceof l || typeof t == "string" || t === void 0 ? t : v(t)
987
987
  );
988
988
  return;
989
989
  case "keyType":
990
- n.setKeyType(
991
- t instanceof c || typeof t == "string" || t === void 0 ? t : B(t)
990
+ r.setKeyType(
991
+ t instanceof l || typeof t == "string" || t === void 0 ? t : v(t)
992
992
  );
993
993
  return;
994
994
  case "valueType":
995
- n.setValueType(
996
- t instanceof c || typeof t == "string" || t === void 0 ? t : B(t)
995
+ r.setValueType(
996
+ t instanceof l || typeof t == "string" || t === void 0 ? t : v(t)
997
997
  );
998
998
  return;
999
999
  case "value": {
1000
1000
  const s = t;
1001
- n.setValue(s === void 0 ? null : s);
1001
+ r.setValue(s === void 0 ? null : s);
1002
1002
  return;
1003
1003
  }
1004
1004
  case "blueId":
1005
- n.setBlueId(t);
1005
+ r.setBlueId(t);
1006
1006
  return;
1007
1007
  case "blue":
1008
- n.setBlue(
1009
- t instanceof c || t === void 0 ? t : B(t)
1008
+ r.setBlue(
1009
+ t instanceof l || t === void 0 ? t : v(t)
1010
1010
  );
1011
1011
  return;
1012
1012
  case "items":
1013
- n.setItems(t);
1013
+ r.setItems(t);
1014
1014
  return;
1015
1015
  case "properties":
1016
- n.setProperties(t);
1016
+ r.setProperties(t);
1017
1017
  return;
1018
1018
  case "contracts":
1019
- n.setContracts(t);
1019
+ r.setContracts(t);
1020
1020
  return;
1021
1021
  default: {
1022
1022
  if (t === void 0) {
1023
- const s = n.getProperties();
1024
- s && r in s && delete s[r];
1023
+ const s = r.getProperties();
1024
+ s && n in s && delete s[n];
1025
1025
  } else
1026
- n.getProperties() || n.setProperties({}), n.addProperty(r, t instanceof c ? t : B(t));
1026
+ r.getProperties() || r.setProperties({}), r.addProperty(n, t instanceof l ? t : v(t));
1027
1027
  return;
1028
1028
  }
1029
1029
  }
1030
1030
  }
1031
- Array.isArray(n) ? n.splice(G(e), 1) : x(n) && (t === void 0 ? delete n[e] : n[e] = t);
1031
+ Array.isArray(r) ? r.splice(z(e), 1) : U(r) && (t === void 0 ? delete r[e] : r[e] = t);
1032
1032
  }
1033
- function pn(n, e, t, r) {
1033
+ function pr(r, e, t, n) {
1034
1034
  let s = -1;
1035
1035
  if (e !== "-" && (s = typeof e == "number" ? e : parseInt(e, 10), isNaN(s)))
1036
1036
  throw new Error(
@@ -1038,14 +1038,14 @@ function pn(n, e, t, r) {
1038
1038
  );
1039
1039
  if (s < -1)
1040
1040
  throw new Error(`Invalid array index for BlueNode items: ${s}`);
1041
- let i = n.getItems();
1042
- if (i || (i = [], n.setItems(i)), !r && s !== -1 && s > i.length)
1041
+ let i = r.getItems();
1042
+ if (i || (i = [], r.setItems(i)), !n && s !== -1 && s > i.length)
1043
1043
  throw new Error(
1044
1044
  `ADD operation failed: Target array index '${s}' is greater than array length ${i.length}.`
1045
1045
  );
1046
1046
  if (e === "-")
1047
1047
  i.push(t);
1048
- else if (r) {
1048
+ else if (n) {
1049
1049
  if (s >= 0)
1050
1050
  if (s < i.length) i[s] = t;
1051
1051
  else {
@@ -1056,197 +1056,197 @@ function pn(n, e, t, r) {
1056
1056
  } else
1057
1057
  i.splice(s, 0, t);
1058
1058
  }
1059
- function he(n, e, t, r) {
1060
- if (Array.isArray(n)) {
1061
- const s = e === "-" ? n.length : G(e);
1062
- if (!r && s > n.length)
1059
+ function pe(r, e, t, n) {
1060
+ if (Array.isArray(r)) {
1061
+ const s = e === "-" ? r.length : z(e);
1062
+ if (!n && s > r.length)
1063
1063
  throw new Error(
1064
- `ADD operation failed: Target array index '${s}' is greater than array length ${n.length}. Path involving key '${e}'.`
1064
+ `ADD operation failed: Target array index '${s}' is greater than array length ${r.length}. Path involving key '${e}'.`
1065
1065
  );
1066
1066
  if (s < 0 && e !== "-")
1067
1067
  throw new Error(`Invalid negative array index: ${e}`);
1068
- const i = B(t);
1069
- if (r) {
1070
- if (s >= 0 && s < n.length) n[s] = i;
1071
- else if (s >= n.length) {
1072
- for (let o = n.length; o < s; o++)
1073
- n.push(p.deserialize(null));
1074
- n.push(i);
1068
+ const i = v(t);
1069
+ if (n) {
1070
+ if (s >= 0 && s < r.length) r[s] = i;
1071
+ else if (s >= r.length) {
1072
+ for (let o = r.length; o < s; o++)
1073
+ r.push(p.deserialize(null));
1074
+ r.push(i);
1075
1075
  }
1076
1076
  } else
1077
- n.splice(s, 0, i);
1077
+ r.splice(s, 0, i);
1078
1078
  return;
1079
1079
  }
1080
- if (n instanceof c) {
1081
- e === "-" || typeof e == "number" && !isNaN(e) || typeof e == "string" && /^\d+$/.test(e) ? pn(n, e, B(t), r) : He(n, e, t);
1080
+ if (r instanceof l) {
1081
+ e === "-" || typeof e == "number" && !isNaN(e) || typeof e == "string" && /^\d+$/.test(e) ? pr(r, e, v(t), n) : We(r, e, t);
1082
1082
  return;
1083
1083
  }
1084
- if (x(n)) {
1085
- n[e] = B(t);
1084
+ if (U(r)) {
1085
+ r[e] = v(t);
1086
1086
  return;
1087
1087
  }
1088
- throw new Error(`Cannot insert into parent of type ${typeof n}`);
1088
+ throw new Error(`Cannot insert into parent of type ${typeof r}`);
1089
1089
  }
1090
- function gn(n, e) {
1091
- if (Array.isArray(n)) {
1092
- const t = G(e);
1093
- t === -1 && e === "-" ? n.length > 0 && n.pop() : t >= 0 && t < n.length && n.splice(t, 1);
1090
+ function gr(r, e) {
1091
+ if (Array.isArray(r)) {
1092
+ const t = z(e);
1093
+ t === -1 && e === "-" ? r.length > 0 && r.pop() : t >= 0 && t < r.length && r.splice(t, 1);
1094
1094
  return;
1095
1095
  }
1096
- if (n instanceof c) {
1096
+ if (r instanceof l) {
1097
1097
  if (typeof e == "number" || typeof e == "string" && /^-?\d+$/.test(e)) {
1098
- const t = n.getItems();
1098
+ const t = r.getItems();
1099
1099
  if (t) {
1100
- const r = G(e);
1101
- r === -1 && e === "-" ? t.length > 0 && t.pop() : r >= 0 && r < t.length && t.splice(r, 1), t.length === 0 && n.setItems(void 0);
1100
+ const n = z(e);
1101
+ n === -1 && e === "-" ? t.length > 0 && t.pop() : n >= 0 && n < t.length && t.splice(n, 1), t.length === 0 && r.setItems(void 0);
1102
1102
  return;
1103
1103
  }
1104
1104
  }
1105
- He(n, e, void 0);
1106
- } else x(n) && delete n[e];
1107
- }
1108
- function Re(n) {
1109
- if (n instanceof c) return n.clone();
1110
- if (Array.isArray(n))
1111
- return n.map((t) => Re(t));
1112
- if (x(n)) {
1105
+ We(r, e, void 0);
1106
+ } else U(r) && delete r[e];
1107
+ }
1108
+ function xe(r) {
1109
+ if (r instanceof l) return r.clone();
1110
+ if (Array.isArray(r))
1111
+ return r.map((t) => xe(t));
1112
+ if (U(r)) {
1113
1113
  const e = {};
1114
- return Object.keys(n).forEach((t) => {
1115
- e[t] = Re(n[t]);
1114
+ return Object.keys(r).forEach((t) => {
1115
+ e[t] = xe(r[t]);
1116
1116
  }), e;
1117
1117
  }
1118
- return n;
1118
+ return r;
1119
1119
  }
1120
- function U(n, e) {
1121
- if (n === e || n instanceof c && (n.isInlineValue() || n.getValue() !== void 0) && U(n.getValue() ?? null, e) || e instanceof c && (e.isInlineValue() || e.getValue() !== void 0) && U(n, e.getValue() ?? null))
1120
+ function $(r, e) {
1121
+ if (r === e || r instanceof l && (r.isInlineValue() || r.getValue() !== void 0) && $(r.getValue() ?? null, e) || e instanceof l && (e.isInlineValue() || e.getValue() !== void 0) && $(r, e.getValue() ?? null))
1122
1122
  return !0;
1123
- if (n instanceof c && e instanceof c || O(n) && O(e) || O(n) && typeof e == "number" || typeof n == "number" && O(e))
1124
- return n.toString() === e.toString();
1125
- if (Array.isArray(n) && Array.isArray(e))
1126
- return n.length === e.length && n.every((t, r) => U(t, e[r]));
1127
- if (x(n) && x(e)) {
1128
- const t = Object.keys(n), r = Object.keys(e);
1129
- return t.length === r.length && t.every((s) => U(n[s], e[s]));
1123
+ if (r instanceof l && e instanceof l || j(r) && j(e) || j(r) && typeof e == "number" || typeof r == "number" && j(e))
1124
+ return r.toString() === e.toString();
1125
+ if (Array.isArray(r) && Array.isArray(e))
1126
+ return r.length === e.length && r.every((t, n) => $(t, e[n]));
1127
+ if (U(r) && U(e)) {
1128
+ const t = Object.keys(r), n = Object.keys(e);
1129
+ return t.length === n.length && t.every((s) => $(r[s], e[s]));
1130
1130
  }
1131
1131
  return !1;
1132
1132
  }
1133
- function yt(n, e) {
1134
- const { parent: t, key: r } = J(n, z(e));
1135
- return Je(t, r);
1133
+ function yt(r, e) {
1134
+ const { parent: t, key: n } = H(r, J(e));
1135
+ return He(t, n);
1136
1136
  }
1137
- function mt(n, e, t) {
1138
- const r = z(e);
1139
- if (r.length === 0 && e === "/") {
1140
- const o = B(t);
1141
- n.setValue(o.getValue() ?? null), o.getItems() ? n.setItems(o.getItems()) : n.setItems(void 0);
1137
+ function mt(r, e, t) {
1138
+ const n = J(e);
1139
+ if (n.length === 0 && e === "/") {
1140
+ const o = v(t);
1141
+ r.setValue(o.getValue() ?? null), o.getItems() ? r.setItems(o.getItems()) : r.setItems(void 0);
1142
1142
  return;
1143
1143
  }
1144
- const { parent: s, key: i } = J(n, r);
1145
- he(s, i, t, !0);
1144
+ const { parent: s, key: i } = H(r, n);
1145
+ pe(s, i, t, !0);
1146
1146
  }
1147
- function yn(n, e, t) {
1148
- const r = z(e);
1149
- if (r.length === 0 && e === "/") {
1150
- if (n.getItems() && Array.isArray(t)) {
1151
- const o = B(t);
1152
- o.getItems() ? (n.setItems(o.getItems()), n.setValue(null)) : (n.setValue(o.getValue() ?? null), n.setItems(void 0));
1147
+ function yr(r, e, t) {
1148
+ const n = J(e);
1149
+ if (n.length === 0 && e === "/") {
1150
+ if (r.getItems() && Array.isArray(t)) {
1151
+ const o = v(t);
1152
+ o.getItems() ? (r.setItems(o.getItems()), r.setValue(null)) : (r.setValue(o.getValue() ?? null), r.setItems(void 0));
1153
1153
  } else {
1154
- const o = B(t);
1155
- n.setValue(o.getValue() ?? null), o.getItems() && n.setItems(o.getItems());
1154
+ const o = v(t);
1155
+ r.setValue(o.getValue() ?? null), o.getItems() && r.setItems(o.getItems());
1156
1156
  }
1157
1157
  return !0;
1158
1158
  }
1159
- const { parent: s, key: i } = J(n, r);
1160
- return he(s, i, t, !1), !0;
1159
+ const { parent: s, key: i } = H(r, n);
1160
+ return pe(s, i, t, !1), !0;
1161
1161
  }
1162
- function mn(n, e, t) {
1163
- const r = z(e);
1164
- if (r.length === 0 && e === "/") {
1165
- const l = B(t);
1166
- return n.setValue(l.getValue() ?? null), l.getItems() ? n.setItems(l.getItems()) : n.setItems(void 0), !0;
1162
+ function mr(r, e, t) {
1163
+ const n = J(e);
1164
+ if (n.length === 0 && e === "/") {
1165
+ const c = v(t);
1166
+ return r.setValue(c.getValue() ?? null), c.getItems() ? r.setItems(c.getItems()) : r.setItems(void 0), !0;
1167
1167
  }
1168
- const { parent: s, key: i, actualTarget: o } = J(n, r);
1169
- if (o !== void 0 && s instanceof c)
1170
- He(s, i, t);
1168
+ const { parent: s, key: i, actualTarget: o } = H(r, n);
1169
+ if (o !== void 0 && s instanceof l)
1170
+ We(s, i, t);
1171
1171
  else {
1172
- const l = Je(s, i), a = Array.isArray(s) || s instanceof c && s.getItems() && (typeof i == "number" || typeof i == "string" && /^\d+$/.test(i));
1173
- if (l === void 0) {
1172
+ const c = He(s, i), a = Array.isArray(s) || s instanceof l && s.getItems() && (typeof i == "number" || typeof i == "string" && /^\d+$/.test(i));
1173
+ if (c === void 0) {
1174
1174
  if (a)
1175
1175
  throw new Error(
1176
1176
  `REPLACE failed: Target array index '${i.toString()}' is out of bounds or does not exist at path '${e}'.`
1177
1177
  );
1178
- he(s, i, t, !0);
1178
+ pe(s, i, t, !0);
1179
1179
  } else
1180
- he(s, i, t, !0);
1180
+ pe(s, i, t, !0);
1181
1181
  }
1182
1182
  return !0;
1183
1183
  }
1184
- function It(n, e) {
1185
- const t = z(e);
1184
+ function It(r, e) {
1185
+ const t = J(e);
1186
1186
  if (t.length === 0 && e === "/")
1187
- return n.setValue(null), n.setItems(void 0), n.setProperties(void 0), !0;
1188
- const { parent: r, key: s } = J(n, t);
1189
- return gn(r, s), !0;
1187
+ return r.setValue(null), r.setItems(void 0), r.setProperties(void 0), !0;
1188
+ const { parent: n, key: s } = H(r, t);
1189
+ return gr(n, s), !0;
1190
1190
  }
1191
- function In(n, e, t) {
1192
- const r = Re(yt(n, e));
1193
- return mt(n, t, r), !0;
1191
+ function Ir(r, e, t) {
1192
+ const n = xe(yt(r, e));
1193
+ return mt(r, t, n), !0;
1194
1194
  }
1195
- function bn(n, e, t) {
1196
- const r = z(e), { parent: s, key: i } = J(n, r), o = Je(s, i);
1195
+ function br(r, e, t) {
1196
+ const n = J(e), { parent: s, key: i } = H(r, n), o = He(s, i);
1197
1197
  if (o === void 0)
1198
1198
  throw new Error(`MOVE failed: 'from' location '${e}' does not exist.`);
1199
- return It(n, e) ? (mt(n, t, o), !0) : !1;
1199
+ return It(r, e) ? (mt(r, t, o), !0) : !1;
1200
1200
  }
1201
- function Tn(n, e, t) {
1202
- const r = yt(n, e);
1201
+ function Tr(r, e, t) {
1202
+ const n = yt(r, e);
1203
1203
  let s = t;
1204
- if (r instanceof c)
1205
- if ((t === null || typeof t == "string" || typeof t == "number" || typeof t == "boolean" || O(t)) && (r.isInlineValue() || r.getValue() !== void 0)) {
1206
- if (!U(r.getValue() ?? null, t))
1204
+ if (n instanceof l)
1205
+ if ((t === null || typeof t == "string" || typeof t == "number" || typeof t == "boolean" || j(t)) && (n.isInlineValue() || n.getValue() !== void 0)) {
1206
+ if (!$(n.getValue() ?? null, t))
1207
1207
  throw new Error(
1208
1208
  `TEST failed at '${e}': Expected ${JSON.stringify(
1209
1209
  t
1210
- )}, got ${JSON.stringify(r.getValue() ?? null)}`
1210
+ )}, got ${JSON.stringify(n.getValue() ?? null)}`
1211
1211
  );
1212
1212
  return !0;
1213
- } else typeof t == "object" && !(t instanceof c) && (s = B(t));
1214
- else if (O(r) && typeof t == "number")
1215
- r instanceof v ? s = new v(t.toString()) : r instanceof P && (s = new P(t.toString()));
1216
- else if ((r === null || typeof r == "string" || typeof r == "number" || typeof r == "boolean") && O(t)) {
1213
+ } else typeof t == "object" && !(t instanceof l) && (s = v(t));
1214
+ else if (j(n) && typeof t == "number")
1215
+ n instanceof B ? s = new B(t.toString()) : n instanceof A && (s = new A(t.toString()));
1216
+ else if ((n === null || typeof n == "string" || typeof n == "number" || typeof n == "boolean") && j(t)) {
1217
1217
  const i = t;
1218
- !U(r, i.toString()) && (typeof r == "number" && parseFloat(i.toString()));
1218
+ !$(n, i.toString()) && (typeof n == "number" && parseFloat(i.toString()));
1219
1219
  }
1220
- if (!U(r, s)) {
1221
- const i = r instanceof c ? r.toString() : JSON.stringify(r), o = s instanceof c ? s.toString() : JSON.stringify(s);
1220
+ if (!$(n, s)) {
1221
+ const i = n instanceof l ? n.toString() : JSON.stringify(n), o = s instanceof l ? s.toString() : JSON.stringify(s);
1222
1222
  throw new Error(
1223
1223
  `TEST failed at '${e}': Expected ${o}, got ${i}`
1224
1224
  );
1225
1225
  }
1226
1226
  return !0;
1227
1227
  }
1228
- function wn(n, e) {
1228
+ function wr(r, e) {
1229
1229
  switch (e.op) {
1230
1230
  case "add":
1231
- return yn(n, e.path, e.val);
1231
+ return yr(r, e.path, e.val);
1232
1232
  case "replace":
1233
- return mn(n, e.path, e.val);
1233
+ return mr(r, e.path, e.val);
1234
1234
  case "remove":
1235
- return It(n, e.path);
1235
+ return It(r, e.path);
1236
1236
  case "copy":
1237
- return In(n, e.from, e.path);
1237
+ return Ir(r, e.from, e.path);
1238
1238
  case "move":
1239
- return bn(n, e.from, e.path);
1239
+ return br(r, e.from, e.path);
1240
1240
  case "test":
1241
- return Tn(n, e.path, e.val);
1241
+ return Tr(r, e.path, e.val);
1242
1242
  }
1243
1243
  }
1244
- function jr(n, e, t = !1) {
1245
- const r = t ? n : n.clone();
1246
- return wn(r, e), r;
1244
+ function Rn(r, e, t = !1) {
1245
+ const n = t ? r : r.clone();
1246
+ return wr(n, e), n;
1247
1247
  }
1248
1248
  const Ne = Symbol.for("zod-schema-annotations");
1249
- function Bn() {
1249
+ function vr() {
1250
1250
  if (typeof globalThis < "u") return globalThis;
1251
1251
  if (typeof global < "u") return global;
1252
1252
  if (typeof window < "u") return window;
@@ -1254,120 +1254,144 @@ function Bn() {
1254
1254
  throw new Error("Unable to locate global object");
1255
1255
  }
1256
1256
  function bt() {
1257
- const n = Bn();
1258
- return Ne in n || (n[Ne] = /* @__PURE__ */ new WeakMap()), n[Ne];
1257
+ const r = vr();
1258
+ return Ne in r || (r[Ne] = /* @__PURE__ */ new WeakMap()), r[Ne];
1259
1259
  }
1260
- function H(n, e) {
1261
- const t = bt(), r = t.get(n) || {};
1262
- return t.set(n, { ...r, ...e }), n;
1260
+ function W(r, e) {
1261
+ const t = bt(), n = t.get(r) || {};
1262
+ return t.set(r, { ...n, ...e }), r;
1263
1263
  }
1264
- const E = (n) => bt().get(n), vn = (n) => (e) => {
1264
+ const E = (r) => bt().get(r), Br = (r) => (e) => {
1265
1265
  const t = E(e);
1266
- return H(e, {
1266
+ return W(e, {
1267
1267
  ...t,
1268
- blueDescription: n
1268
+ blueDescription: r
1269
1269
  });
1270
- }, En = (n) => {
1271
- const e = E(n);
1272
- return f(e) && Le(e.blueDescription) ? e.blueDescription : null;
1273
- }, Rr = (n) => vn(n)(d.string().optional()), Pn = d.union([d.string(), d.boolean()]), An = (n) => (e) => {
1270
+ }, Er = (r) => {
1271
+ const e = E(r);
1272
+ return d(e) && Ze(e.blueDescription) ? e.blueDescription : null;
1273
+ }, xn = (r) => Br(r)(f.string().optional()), Pr = f.union([f.string(), f.boolean()]), Ar = (r) => (e) => {
1274
1274
  const t = E(e);
1275
- return H(e, {
1275
+ return W(e, {
1276
1276
  ...t,
1277
- blueId: n
1277
+ blueId: r
1278
1278
  });
1279
- }, Nn = (n) => {
1280
- const e = E(n), t = Pn.safeParse(e == null ? void 0 : e.blueId);
1279
+ }, Sr = (r) => {
1280
+ const e = E(r), t = Pr.safeParse(e == null ? void 0 : e.blueId);
1281
1281
  return t.success ? t.data : null;
1282
- }, xr = (n) => An(n ?? !0)(d.string()), Sn = (n) => (e) => {
1282
+ }, Un = (r) => Ar(r ?? !0)(f.string()), Nr = (r) => (e) => {
1283
1283
  const t = E(e);
1284
- return H(e, {
1284
+ return W(e, {
1285
1285
  ...t,
1286
- blueName: n
1286
+ blueName: r
1287
1287
  });
1288
- }, Cn = (n) => {
1289
- const e = E(n);
1290
- return f(e) && Le(e.blueName) ? e.blueName : null;
1291
- }, Ur = (n) => {
1292
- const e = d.string().optional();
1293
- return Sn(n)(e);
1294
- }, Fn = () => (n) => {
1295
- const e = E(n);
1296
- return H(n, {
1288
+ }, Cr = (r) => {
1289
+ const e = E(r);
1290
+ return d(e) && Ze(e.blueName) ? e.blueName : null;
1291
+ }, $n = (r) => {
1292
+ const e = f.string().optional();
1293
+ return Nr(r)(e);
1294
+ }, Fr = () => (r) => {
1295
+ const e = E(r);
1296
+ return W(r, {
1297
1297
  ...e,
1298
1298
  blueNode: !0
1299
1299
  });
1300
- }, Vn = (n) => {
1301
- const e = E(n);
1302
- return f(e) && f(e.blueNode) && e.blueNode === !0 ? e.blueNode : null;
1303
- }, qe = (n) => !!Vn(n), $r = () => {
1304
- const n = d.instanceof(c);
1305
- return Fn()(n);
1306
- }, xe = "extendedFrom", Dn = ({
1307
- schema: n,
1300
+ }, Vr = (r) => {
1301
+ const e = E(r);
1302
+ return d(e) && d(e.blueNode) && e.blueNode === !0 ? e.blueNode : null;
1303
+ }, Tt = (r) => !!Vr(r), Mn = () => {
1304
+ const r = f.instanceof(l);
1305
+ return Fr()(r);
1306
+ }, Ue = "extendedFrom", Dr = ({
1307
+ schema: r,
1308
1308
  baseSchema: e
1309
1309
  }) => {
1310
- const t = E(n) || {};
1311
- return H(n, {
1310
+ const t = E(r) || {};
1311
+ return W(r, {
1312
1312
  ...t,
1313
- [xe]: e
1313
+ [Ue]: e
1314
1314
  });
1315
- }, On = (n) => {
1316
- const e = E(n);
1317
- return f(e) && e[xe] ? e[xe] : null;
1318
- }, Tt = (n, e) => {
1319
- const t = On(n);
1320
- return N(t) ? !1 : (t == null ? void 0 : t._def) === (e == null ? void 0 : e._def) ? !0 : Tt(t, e);
1321
- }, jn = (n) => new Proxy(n, {
1322
- get(e, t, r) {
1315
+ }, Or = (r) => {
1316
+ const e = E(r);
1317
+ return d(e) && e[Ue] ? e[Ue] : null;
1318
+ }, wt = (r, e) => {
1319
+ const t = Or(r);
1320
+ return N(t) ? !1 : (t == null ? void 0 : t._def) === (e == null ? void 0 : e._def) ? !0 : wt(t, e);
1321
+ }, jr = (r) => new Proxy(r, {
1322
+ get(e, t, n) {
1323
1323
  return t === "extend" ? function(...s) {
1324
1324
  const i = e.extend(...s);
1325
- return Dn({
1325
+ return Dr({
1326
1326
  schema: i,
1327
1327
  baseSchema: e
1328
1328
  });
1329
- } : Reflect.get(e, t, r);
1329
+ } : Reflect.get(e, t, n);
1330
1330
  }
1331
- }), Rn = d.object({
1332
- value: d.array(d.string()).optional(),
1333
- defaultValue: d.string().optional()
1334
- }), xn = (n) => {
1335
- const e = E(n), t = Rn.passthrough().safeParse(e == null ? void 0 : e.typeBlueId);
1331
+ }), Rr = f.object({
1332
+ value: f.array(f.string()).optional(),
1333
+ defaultValue: f.string().optional()
1334
+ }), xr = (r) => {
1335
+ const e = E(r), t = Rr.passthrough().safeParse(e == null ? void 0 : e.typeBlueId);
1336
1336
  return t.success ? t.data : null;
1337
- }, Mr = (n) => (e) => {
1338
- const t = E(e), r = typeof n == "string" ? { value: [n] } : n, s = jn(e);
1339
- return H(s, {
1337
+ }, Ln = (r) => (e) => {
1338
+ const t = E(e), n = typeof r == "string" ? { value: [r] } : r, s = jr(e);
1339
+ return W(s, {
1340
1340
  ...t,
1341
1341
  typeBlueId: {
1342
1342
  ...(t == null ? void 0 : t.typeBlueId) || {},
1343
- ...r
1343
+ ...n
1344
1344
  }
1345
1345
  });
1346
1346
  };
1347
- class ve {
1347
+ class Ee {
1348
1348
  static resolveBlueId(e) {
1349
1349
  var i;
1350
- const t = xn(e);
1350
+ const t = xr(e);
1351
1351
  if (N(t))
1352
1352
  return null;
1353
- const r = t.defaultValue;
1354
- if (f(r))
1355
- return r;
1353
+ const n = t.defaultValue;
1354
+ if (d(n))
1355
+ return n;
1356
1356
  const s = (i = t.value) == null ? void 0 : i[0];
1357
- return f(s) ? s : ve.getRepositoryBlueId(t, e);
1357
+ return d(s) ? s : Ee.getRepositoryBlueId(t, e);
1358
1358
  }
1359
1359
  static getRepositoryBlueId(e, t) {
1360
1360
  throw new Error("Not implemented");
1361
1361
  }
1362
1362
  }
1363
- class Lr {
1364
- static isTypeOf(e, t) {
1365
- var i;
1366
- const r = ve.resolveBlueId(t), s = (i = e.getType()) == null ? void 0 : i.getBlueId();
1367
- return N(r) || N(s) ? !1 : r === s;
1363
+ class P {
1364
+ // TODO: Enhance to support schemas associated with multiple blueIds
1365
+ static isTypeOf(e, t, n) {
1366
+ var o;
1367
+ const s = Ee.resolveBlueId(t), i = (o = e.getType()) == null ? void 0 : o.getBlueId();
1368
+ if (N(s) || N(i))
1369
+ return !1;
1370
+ if (s === i)
1371
+ return !0;
1372
+ if (n != null && n.checkSchemaExtensions && d(n.typeSchemaResolver)) {
1373
+ const c = n.typeSchemaResolver.resolveSchema(e);
1374
+ return P.checkSchemaExtension(c, t);
1375
+ }
1376
+ return !1;
1377
+ }
1378
+ /**
1379
+ * Checks if a schema extends a base schema.
1380
+ */
1381
+ static checkSchemaExtension(e, t) {
1382
+ if (!d(e))
1383
+ return !1;
1384
+ const n = P.unwrapSchema(e), s = P.unwrapSchema(t);
1385
+ return wt(n, s);
1386
+ }
1387
+ static isWrapperType(e) {
1388
+ return e instanceof st || e instanceof it || e instanceof ot || e instanceof ct || e instanceof ue || e instanceof fe;
1389
+ }
1390
+ static unwrapSchema(e) {
1391
+ return Tt(e) ? e : P.isWrapperType(e) ? e instanceof ue ? P.unwrapSchema(e.innerType()) : e instanceof fe ? P.unwrapSchema(e.schema) : P.unwrapSchema(e.unwrap()) : e;
1368
1392
  }
1369
1393
  }
1370
- class Un {
1394
+ class Ur {
1371
1395
  constructor(e) {
1372
1396
  u(this, "blueIdMap", /* @__PURE__ */ new Map());
1373
1397
  this.registerSchemas(e);
@@ -1377,8 +1401,8 @@ class Un {
1377
1401
  this.registerSchema(t);
1378
1402
  }
1379
1403
  registerSchema(e) {
1380
- const t = ve.resolveBlueId(e);
1381
- if (f(t)) {
1404
+ const t = Ee.resolveBlueId(e);
1405
+ if (d(t)) {
1382
1406
  if (this.blueIdMap.has(t))
1383
1407
  throw new Error(`Duplicate BlueId value: ${t}`);
1384
1408
  this.blueIdMap.set(t, e);
@@ -1390,30 +1414,30 @@ class Un {
1390
1414
  }
1391
1415
  getEffectiveBlueId(e) {
1392
1416
  const t = e.getType();
1393
- return f(t) && f(t.getBlueId()) ? t.getBlueId() : f(t) ? C.calculateBlueIdSync(t) : null;
1417
+ return d(t) && d(t.getBlueId()) ? t.getBlueId() : d(t) ? F.calculateBlueIdSync(t) : null;
1394
1418
  }
1395
1419
  getBlueIdMap() {
1396
1420
  return new Map(this.blueIdMap);
1397
1421
  }
1398
1422
  }
1399
- class wt {
1423
+ class vt {
1400
1424
  static convertValue(e, t) {
1401
1425
  var i;
1402
- const r = (i = e.getType()) == null ? void 0 : i.getBlueId(), s = e.getValue();
1403
- return N(s) ? this.isPrimitive(t) ? this.getDefaultPrimitiveValue(t) : s : te === r ? this.convertFromString(String(s), t) : ne === r || s instanceof P ? this.convertFromBigDecimal(
1404
- new P(s == null ? void 0 : s.toString()),
1426
+ const n = (i = e.getType()) == null ? void 0 : i.getBlueId(), s = e.getValue();
1427
+ return N(s) ? this.isPrimitive(t) ? this.getDefaultPrimitiveValue(t) : s : re === n ? this.convertFromString(String(s), t) : ne === n || s instanceof A ? this.convertFromBigDecimal(
1428
+ new A(s == null ? void 0 : s.toString()),
1405
1429
  t
1406
- ) : re === r || s instanceof v ? this.convertFromBigInteger(
1407
- new v(s == null ? void 0 : s.toString()),
1430
+ ) : se === n || s instanceof B ? this.convertFromBigInteger(
1431
+ new B(s == null ? void 0 : s.toString()),
1408
1432
  t
1409
- ) : se === r || typeof s == "boolean" ? this.convertFromBoolean(!!s, t) : this.convertFromString(String(s), t);
1433
+ ) : ie === n || typeof s == "boolean" ? this.convertFromBoolean(!!s, t) : this.convertFromString(String(s), t);
1410
1434
  }
1411
1435
  static convertFromString(e, t) {
1412
- if (!t || t instanceof Z || t instanceof Vt || t instanceof Dt)
1436
+ if (!t || t instanceof k || t instanceof Dt || t instanceof Ot)
1413
1437
  return e;
1414
1438
  if (t instanceof _)
1415
1439
  return Number(e);
1416
- if (t instanceof oe)
1440
+ if (t instanceof ce)
1417
1441
  return e.toLowerCase() === "true";
1418
1442
  if (t instanceof le)
1419
1443
  return BigInt(e);
@@ -1424,7 +1448,7 @@ class wt {
1424
1448
  static convertFromBigDecimal(e, t) {
1425
1449
  if (t instanceof _)
1426
1450
  return e.toNumber();
1427
- if (t instanceof Z)
1451
+ if (t instanceof k)
1428
1452
  return e.toString();
1429
1453
  throw new Error(
1430
1454
  `Cannot convert Number to ${t.constructor.name}`
@@ -1435,16 +1459,16 @@ class wt {
1435
1459
  return e.toNumber();
1436
1460
  if (t instanceof le)
1437
1461
  return BigInt(e.toString());
1438
- if (t instanceof Z)
1462
+ if (t instanceof k)
1439
1463
  return e.toString();
1440
1464
  throw new Error(
1441
1465
  `Cannot convert Number to ${t.constructor.name}`
1442
1466
  );
1443
1467
  }
1444
1468
  static convertFromBoolean(e, t) {
1445
- if (!t || t instanceof oe)
1469
+ if (!t || t instanceof ce)
1446
1470
  return e;
1447
- if (t instanceof Z)
1471
+ if (t instanceof k)
1448
1472
  return e.toString();
1449
1473
  if (t instanceof _)
1450
1474
  return Number(e);
@@ -1455,27 +1479,27 @@ class wt {
1455
1479
  );
1456
1480
  }
1457
1481
  static isPrimitive(e) {
1458
- return e ? e instanceof Z || e instanceof _ || e instanceof oe || e instanceof le : !1;
1482
+ return e ? e instanceof k || e instanceof _ || e instanceof ce || e instanceof le : !1;
1459
1483
  }
1460
1484
  static getDefaultPrimitiveValue(e) {
1461
1485
  if (!e) return null;
1462
1486
  if (e instanceof _)
1463
1487
  return 0;
1464
- if (e instanceof oe)
1488
+ if (e instanceof ce)
1465
1489
  return !1;
1466
- if (e instanceof Z)
1490
+ if (e instanceof k)
1467
1491
  return "";
1468
1492
  throw new Error(
1469
1493
  `Unsupported primitive type: ${e.constructor.name}`
1470
1494
  );
1471
1495
  }
1472
1496
  }
1473
- class $n {
1497
+ class $r {
1474
1498
  convert(e, t) {
1475
- return wt.convertValue(e, t);
1499
+ return vt.convertValue(e, t);
1476
1500
  }
1477
1501
  }
1478
- class Mn {
1502
+ class Mr {
1479
1503
  constructor(e) {
1480
1504
  this.nodeToObjectConverter = e;
1481
1505
  }
@@ -1483,32 +1507,32 @@ class Mn {
1483
1507
  * Check if the valueSchema can handle structured data (contracts should be processed specially)
1484
1508
  */
1485
1509
  canHandleStructuredData(e) {
1486
- return e instanceof st || e instanceof Fe || e instanceof Ve || e instanceof it || e instanceof ot;
1510
+ return e instanceof lt || e instanceof Ve || e instanceof De || e instanceof at || e instanceof ut;
1487
1511
  }
1488
1512
  convert(e, t) {
1489
1513
  return this.convertFields(e, t);
1490
1514
  }
1491
1515
  convertFields(e, t) {
1492
- if (t instanceof Ot) {
1493
- const r = t._def.left, s = t._def.right, i = this.convert(e, r), o = this.convert(e, s);
1516
+ if (t instanceof jt) {
1517
+ const n = t._def.left, s = t._def.right, i = this.convert(e, n), o = this.convert(e, s);
1494
1518
  return { ...i, ...o };
1495
1519
  }
1496
- if (t instanceof jt)
1520
+ if (t instanceof Rt)
1497
1521
  throw new Error("Union not supported");
1498
- if (t instanceof Fe)
1522
+ if (t instanceof Ve)
1499
1523
  return Object.keys(t.shape).reduce((s, i) => {
1500
- const o = e.getProperties(), l = t.shape[i], a = Nn(l);
1501
- if (f(a)) {
1502
- const h = Le(a) ? a : i, w = o == null ? void 0 : o[h], F = w ? C.calculateBlueIdSync(w) : void 0;
1503
- return s[i] = F, s;
1524
+ const o = e.getProperties(), c = t.shape[i], a = Sr(c);
1525
+ if (d(a)) {
1526
+ const h = Ze(a) ? a : i, w = o == null ? void 0 : o[h], V = w ? F.calculateBlueIdSync(w) : void 0;
1527
+ return s[i] = V, s;
1504
1528
  }
1505
- const g = Cn(l);
1506
- if (f(g)) {
1529
+ const g = Cr(c);
1530
+ if (d(g)) {
1507
1531
  const h = o == null ? void 0 : o[g];
1508
1532
  return s[i] = h == null ? void 0 : h.getName(), s;
1509
1533
  }
1510
- const b = En(l);
1511
- if (f(b)) {
1534
+ const b = Er(c);
1535
+ if (d(b)) {
1512
1536
  const h = o == null ? void 0 : o[b];
1513
1537
  return s[i] = h == null ? void 0 : h.getDescription(), s;
1514
1538
  }
@@ -1521,16 +1545,16 @@ class Mn {
1521
1545
  return s[i] = h, s;
1522
1546
  }
1523
1547
  const I = e.getContracts();
1524
- if (i === "contracts" && f(I) && this.canHandleStructuredData(l)) {
1548
+ if (i === "contracts" && d(I) && this.canHandleStructuredData(c)) {
1525
1549
  const h = Object.fromEntries(
1526
- Object.entries(I).map(([F, ie]) => [
1527
- F,
1528
- T.get(ie)
1550
+ Object.entries(I).map(([V, oe]) => [
1551
+ V,
1552
+ T.get(oe)
1529
1553
  ])
1530
1554
  ), w = p.deserialize(h);
1531
1555
  s[i] = this.nodeToObjectConverter.convert(
1532
1556
  w,
1533
- l
1557
+ c
1534
1558
  );
1535
1559
  }
1536
1560
  const m = o == null ? void 0 : o[i];
@@ -1538,42 +1562,42 @@ class Mn {
1538
1562
  return s;
1539
1563
  const y = this.nodeToObjectConverter.convert(
1540
1564
  m,
1541
- l
1565
+ c
1542
1566
  );
1543
1567
  return s[i] = y, s;
1544
1568
  }, {});
1545
1569
  throw new Error("Unknown schema type, " + t.constructor.name);
1546
1570
  }
1547
1571
  }
1548
- class Ln {
1572
+ class Lr {
1549
1573
  constructor(e) {
1550
1574
  this.nodeToObjectConverter = e;
1551
1575
  }
1552
1576
  convert(e, t) {
1553
- const r = e.getItems();
1554
- if (!r)
1577
+ const n = e.getItems();
1578
+ if (!n)
1555
1579
  return;
1556
1580
  const s = t.element;
1557
- return r.map(
1581
+ return n.map(
1558
1582
  (o) => this.nodeToObjectConverter.convert(o, s)
1559
1583
  );
1560
1584
  }
1561
1585
  }
1562
- class Zn {
1586
+ class Zr {
1563
1587
  constructor(e) {
1564
1588
  this.nodeToObjectConverter = e;
1565
1589
  }
1566
1590
  convert(e, t) {
1567
- const r = e.getItems();
1568
- if (!r)
1591
+ const n = e.getItems();
1592
+ if (!n)
1569
1593
  return;
1570
- const s = t._def.valueType, i = r.map(
1594
+ const s = t._def.valueType, i = n.map(
1571
1595
  (o) => this.nodeToObjectConverter.convert(o, s)
1572
1596
  );
1573
1597
  return new Set(i);
1574
1598
  }
1575
1599
  }
1576
- class _n {
1600
+ class kr {
1577
1601
  constructor(e) {
1578
1602
  this.nodeToObjectConverter = e;
1579
1603
  }
@@ -1581,15 +1605,15 @@ class _n {
1581
1605
  * Check if the valueSchema can handle structured data (contracts should be processed specially)
1582
1606
  */
1583
1607
  canHandleStructuredData(e) {
1584
- return e instanceof st || e instanceof Fe || e instanceof Ve || e instanceof it || e instanceof ot;
1608
+ return e instanceof lt || e instanceof Ve || e instanceof De || e instanceof at || e instanceof ut;
1585
1609
  }
1586
1610
  convert(e, t) {
1587
- const r = t.keySchema, s = t.valueSchema, i = /* @__PURE__ */ new Map(), o = e.getName();
1588
- f(o) && i.set(k, o);
1589
- const l = e.getDescription();
1590
- f(l) && i.set(Y, l);
1611
+ const n = t.keySchema, s = t.valueSchema, i = /* @__PURE__ */ new Map(), o = e.getName();
1612
+ d(o) && i.set(Y, o);
1613
+ const c = e.getDescription();
1614
+ d(c) && i.set(G, c);
1591
1615
  const a = e.getContracts();
1592
- if (f(a) && this.canHandleStructuredData(s)) {
1616
+ if (d(a) && this.canHandleStructuredData(s)) {
1593
1617
  let b = !1;
1594
1618
  const I = Object.entries(a).reduce(
1595
1619
  (m, [y, h]) => {
@@ -1605,111 +1629,108 @@ class _n {
1605
1629
  },
1606
1630
  {}
1607
1631
  );
1608
- b && i.set(we, I);
1632
+ b && i.set(ve, I);
1609
1633
  }
1610
1634
  const g = e.getProperties();
1611
- return f(g) && Object.entries(g).forEach(([b, I]) => {
1612
- const m = new c().setValue(b);
1613
- m.setType(new c().setBlueId(te));
1614
- const y = wt.convertValue(m, r), h = this.nodeToObjectConverter.convert(I, s);
1635
+ return d(g) && Object.entries(g).forEach(([b, I]) => {
1636
+ const m = new l().setValue(b);
1637
+ m.setType(new l().setBlueId(re));
1638
+ const y = vt.convertValue(m, n), h = this.nodeToObjectConverter.convert(I, s);
1615
1639
  i.set(y, h);
1616
- }), t instanceof Ve ? Object.fromEntries(i) : i;
1640
+ }), t instanceof De ? Object.fromEntries(i) : i;
1617
1641
  }
1618
1642
  }
1619
- class kn {
1643
+ class _r {
1620
1644
  convert(e) {
1621
1645
  return T.get(e);
1622
1646
  }
1623
1647
  }
1624
- class Yn {
1648
+ class Yr {
1625
1649
  convert(e) {
1626
1650
  return T.get(e);
1627
1651
  }
1628
1652
  }
1629
- class Gn {
1653
+ class Gr {
1630
1654
  constructor(e) {
1631
1655
  this.nodeToObjectConverter = e;
1632
1656
  }
1633
1657
  convert(e, t) {
1634
- const r = e.getItems();
1635
- if (!r)
1658
+ const n = e.getItems();
1659
+ if (!n)
1636
1660
  return;
1637
1661
  const s = t.items;
1638
- return r.map(
1639
- (o, l) => this.nodeToObjectConverter.convert(o, s[l])
1662
+ return n.map(
1663
+ (o, c) => this.nodeToObjectConverter.convert(o, s[c])
1640
1664
  );
1641
1665
  }
1642
1666
  }
1643
- const zn = d.union([
1644
- d.literal("ZodString"),
1645
- d.literal("ZodNumber"),
1646
- d.literal("ZodBoolean"),
1647
- d.literal("ZodBigInt"),
1648
- d.literal("ZodArray"),
1649
- d.literal("ZodSet"),
1650
- d.literal("ZodMap"),
1651
- d.literal("ZodRecord"),
1652
- d.literal("ZodObject"),
1653
- d.literal("ZodEnum"),
1654
- d.literal("ZodNativeEnum"),
1655
- d.literal("ZodUnknown"),
1656
- d.literal("ZodAny"),
1657
- d.literal("ZodTuple")
1667
+ const zr = f.union([
1668
+ f.literal("ZodString"),
1669
+ f.literal("ZodNumber"),
1670
+ f.literal("ZodBoolean"),
1671
+ f.literal("ZodBigInt"),
1672
+ f.literal("ZodArray"),
1673
+ f.literal("ZodSet"),
1674
+ f.literal("ZodMap"),
1675
+ f.literal("ZodRecord"),
1676
+ f.literal("ZodObject"),
1677
+ f.literal("ZodEnum"),
1678
+ f.literal("ZodNativeEnum"),
1679
+ f.literal("ZodUnknown"),
1680
+ f.literal("ZodAny"),
1681
+ f.literal("ZodTuple")
1658
1682
  ]);
1659
- class Jn {
1683
+ class Jr {
1660
1684
  constructor(e) {
1661
1685
  u(this, "converters", /* @__PURE__ */ new Map());
1662
1686
  u(this, "complexObjectConverter");
1663
- this.nodeToObjectConverter = e, this.registerConverters(), this.complexObjectConverter = new Mn(
1687
+ this.nodeToObjectConverter = e, this.registerConverters(), this.complexObjectConverter = new Mr(
1664
1688
  this.nodeToObjectConverter
1665
1689
  );
1666
1690
  }
1667
1691
  registerConverters() {
1668
- const e = new $n(), t = new Ln(this.nodeToObjectConverter), r = new Gn(this.nodeToObjectConverter), s = new Zn(this.nodeToObjectConverter), i = new _n(this.nodeToObjectConverter);
1669
- 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 kn()), this.converters.set("ZodAny", new Yn()), this.converters.set("ZodArray", t), this.converters.set("ZodTuple", r), this.converters.set("ZodSet", s), this.converters.set("ZodMap", i), this.converters.set("ZodRecord", i), this.converters.set("ZodObject", this.complexObjectConverter);
1692
+ const e = new $r(), t = new Lr(this.nodeToObjectConverter), n = new Gr(this.nodeToObjectConverter), s = new Zr(this.nodeToObjectConverter), i = new kr(this.nodeToObjectConverter);
1693
+ 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 _r()), this.converters.set("ZodAny", new Yr()), this.converters.set("ZodArray", t), this.converters.set("ZodTuple", n), this.converters.set("ZodSet", s), this.converters.set("ZodMap", i), this.converters.set("ZodRecord", i), this.converters.set("ZodObject", this.complexObjectConverter);
1670
1694
  }
1671
1695
  getConverter(e) {
1672
1696
  const t = this.getSchemaTypeName(e);
1673
1697
  return this.converters.get(t) ?? this.complexObjectConverter;
1674
1698
  }
1675
1699
  isWrapperType(e) {
1676
- return e instanceof lt || e instanceof ct || e instanceof at || e instanceof ut || e instanceof ae || e instanceof ue;
1700
+ return e instanceof st || e instanceof it || e instanceof ot || e instanceof ct || e instanceof ue || e instanceof fe;
1677
1701
  }
1678
1702
  getSchemaTypeName(e) {
1679
1703
  if (this.isWrapperType(e))
1680
- return e instanceof ae ? this.getSchemaTypeName(e.innerType()) : e instanceof ue ? this.getSchemaTypeName(e.schema) : this.getSchemaTypeName(e.unwrap());
1704
+ return e instanceof ue ? this.getSchemaTypeName(e.innerType()) : e instanceof fe ? this.getSchemaTypeName(e.schema) : this.getSchemaTypeName(e.unwrap());
1681
1705
  const t = e.constructor.name;
1682
1706
  try {
1683
- return zn.parse(t);
1707
+ return zr.parse(t);
1684
1708
  } catch {
1685
1709
  throw new Error(`Schema type name ${t} is not supported`);
1686
1710
  }
1687
1711
  }
1688
1712
  }
1689
- class Hn {
1713
+ class Hr {
1690
1714
  constructor(e) {
1691
1715
  u(this, "converterFactory");
1692
- this.typeSchemaResolver = e, this.converterFactory = new Jn(this);
1716
+ this.typeSchemaResolver = e, this.converterFactory = new Jr(this);
1693
1717
  }
1694
1718
  convert(e, t) {
1695
1719
  var o;
1696
- const r = (o = this.typeSchemaResolver) == null ? void 0 : o.resolveSchema(e), s = this.unwrapSchema(t);
1697
- if (qe(s))
1720
+ const n = (o = this.typeSchemaResolver) == null ? void 0 : o.resolveSchema(e), s = P.unwrapSchema(t);
1721
+ if (Tt(s))
1698
1722
  return e;
1699
1723
  let i = s;
1700
- return f(r) && Tt(r, s) && (i = r), this.convertWithType(e, i);
1724
+ return P.checkSchemaExtension(
1725
+ n,
1726
+ s
1727
+ ) && d(n) && (i = n), this.convertWithType(e, i);
1701
1728
  }
1702
1729
  convertWithType(e, t) {
1703
1730
  return this.converterFactory.getConverter(t).convert(e, t);
1704
1731
  }
1705
- isWrapperType(e) {
1706
- return e instanceof lt || e instanceof ct || e instanceof at || e instanceof ut || e instanceof ae || e instanceof ue;
1707
- }
1708
- unwrapSchema(e) {
1709
- return qe(e) ? e : this.isWrapperType(e) ? e instanceof ae ? this.unwrapSchema(e.innerType()) : e instanceof ue ? this.unwrapSchema(e.schema) : this.unwrapSchema(e.unwrap()) : e;
1710
- }
1711
1732
  }
1712
- class Ee {
1733
+ class Pe {
1713
1734
  /**
1714
1735
  * Fetches the first node associated with the given Blue ID
1715
1736
  * Default implementation that takes the first node from fetchByBlueId result
@@ -1722,22 +1743,22 @@ class Ee {
1722
1743
  return t && t.length > 0 ? t[0] : null;
1723
1744
  }
1724
1745
  }
1725
- function Wn(n) {
1726
- return new class extends Ee {
1746
+ function Wr(r) {
1747
+ return new class extends Pe {
1727
1748
  fetchByBlueId(e) {
1728
- return n(e);
1749
+ return r(e);
1729
1750
  }
1730
1751
  }();
1731
1752
  }
1732
- class Kn extends Ee {
1753
+ class Kr extends Pe {
1733
1754
  constructor(t) {
1734
1755
  super();
1735
1756
  u(this, "nodeProviders");
1736
1757
  this.nodeProviders = t;
1737
1758
  }
1738
1759
  fetchByBlueId(t) {
1739
- for (const r of this.nodeProviders) {
1740
- const s = r.fetchByBlueId(t);
1760
+ for (const n of this.nodeProviders) {
1761
+ const s = n.fetchByBlueId(t);
1741
1762
  if (s && s.length > 0)
1742
1763
  return s;
1743
1764
  }
@@ -1746,8 +1767,8 @@ class Kn extends Ee {
1746
1767
  // Override fetchFirstByBlueId for more efficient implementation
1747
1768
  // In Java, this would call the default implementation, but we optimize here
1748
1769
  fetchFirstByBlueId(t) {
1749
- for (const r of this.nodeProviders) {
1750
- const s = r.fetchFirstByBlueId(t);
1770
+ for (const n of this.nodeProviders) {
1771
+ const s = n.fetchFirstByBlueId(t);
1751
1772
  if (s)
1752
1773
  return s;
1753
1774
  }
@@ -1757,43 +1778,43 @@ class Kn extends Ee {
1757
1778
  return this.nodeProviders;
1758
1779
  }
1759
1780
  }
1760
- const Se = L.types.float.options, Xn = {
1761
- ...Se,
1762
- construct: (n) => {
1763
- const e = n.replace(/_/g, "").toLowerCase();
1764
- if (!rt(e))
1765
- return new P(e);
1766
- if (Se.construct)
1767
- return Se.construct(n);
1768
- }
1769
- }, qn = new L.Type("tag:yaml.org,2002:float", Xn), Ce = L.types.int.options, Qn = {
1781
+ const Ce = Z.types.float.options, Xr = {
1770
1782
  ...Ce,
1771
- construct: (n) => {
1772
- let e = n;
1773
- if (e.indexOf("_") !== -1 && (e = e.replace(/_/g, "")), !rt(e))
1774
- return new v(e);
1783
+ construct: (r) => {
1784
+ const e = r.replace(/_/g, "").toLowerCase();
1785
+ if (!nt(e))
1786
+ return new A(e);
1775
1787
  if (Ce.construct)
1776
- return Ce.construct(n);
1777
- }
1778
- }, er = new L.Type("tag:yaml.org,2002:int", Qn), Bt = L.CORE_SCHEMA.extend({
1779
- implicit: [qn, er]
1780
- }), ee = (n) => {
1781
- const e = L.load(n, { schema: Bt });
1788
+ return Ce.construct(r);
1789
+ }
1790
+ }, qr = new Z.Type("tag:yaml.org,2002:float", Xr), Fe = Z.types.int.options, Qr = {
1791
+ ...Fe,
1792
+ construct: (r) => {
1793
+ let e = r;
1794
+ if (e.indexOf("_") !== -1 && (e = e.replace(/_/g, "")), !nt(e))
1795
+ return new B(e);
1796
+ if (Fe.construct)
1797
+ return Fe.construct(r);
1798
+ }
1799
+ }, en = new Z.Type("tag:yaml.org,2002:int", Qr), Bt = Z.CORE_SCHEMA.extend({
1800
+ implicit: [qr, en]
1801
+ }), te = (r) => {
1802
+ const e = Z.load(r, { schema: Bt });
1782
1803
  return e === void 0 ? void 0 : e;
1783
- }, Zr = (n) => L.dump(n, {
1804
+ }, Zn = (r) => Z.dump(r, {
1784
1805
  schema: Bt,
1785
1806
  replacer: (e, t) => {
1786
- if (S(t)) {
1787
- if (Q(t)) {
1788
- const r = new R(Number.MIN_SAFE_INTEGER.toString()), s = new R(Number.MAX_SAFE_INTEGER.toString());
1789
- if (t.lt(r) || t.gt(s))
1807
+ if (C(t)) {
1808
+ if (ee(t)) {
1809
+ const n = new x(Number.MIN_SAFE_INTEGER.toString()), s = new x(Number.MAX_SAFE_INTEGER.toString());
1810
+ if (t.lt(n) || t.gt(s))
1790
1811
  return t.toString();
1791
1812
  }
1792
1813
  return t.toNumber();
1793
1814
  }
1794
1815
  return t;
1795
1816
  }
1796
- }), vt = `- type:
1817
+ }), Et = `- type:
1797
1818
  blueId: 27B7fuxQCS1VAptiCPc2RMkKoutP5qxkh3uDxZ7dr6Eo
1798
1819
  mappings:
1799
1820
  Text: F92yo19rCcbBoBSpUA5LRxpfDejJDAaP1PRxxbWAraVP
@@ -1804,20 +1825,20 @@ const Se = L.types.float.options, Xn = {
1804
1825
  Dictionary: 294NBTj2mFRL3RB4kDRUSckwGg7Kzj6T8CTAFeR1kcSA
1805
1826
  - type:
1806
1827
  blueId: FGYuTXwaoSKfZmpTysLTLsb8WzSqf43384rKZDkXhxD4
1807
- `, tr = `name: Transformation
1808
- description: TODO`, nr = `name: Infer Basic Types For Untyped Values
1828
+ `, tn = `name: Transformation
1829
+ description: TODO`, rn = `name: Infer Basic Types For Untyped Values
1809
1830
  type:
1810
1831
  blueId: Ct1SGRGw1i47qjzm1ruiUdSZofeV6WevPTGuieVvbRS4
1811
- description: This transformation infers type details for Text, Integer, Number and Boolean.`, rr = `name: Replace Inline Types with BlueIds
1832
+ description: This transformation infers type details for Text, Integer, Number and Boolean.`, nn = `name: Replace Inline Types with BlueIds
1812
1833
  type:
1813
1834
  blueId: Ct1SGRGw1i47qjzm1ruiUdSZofeV6WevPTGuieVvbRS4
1814
- description: This transformation replaces`, sr = [
1815
- vt,
1816
- tr,
1817
- nr,
1818
- rr
1835
+ description: This transformation replaces`, sn = [
1836
+ Et,
1837
+ tn,
1838
+ rn,
1839
+ nn
1819
1840
  ];
1820
- class ir extends Ee {
1841
+ class on extends Pe {
1821
1842
  constructor() {
1822
1843
  super();
1823
1844
  u(this, "blueIdToNodesMap", /* @__PURE__ */ new Map());
@@ -1827,129 +1848,129 @@ class ir extends Ee {
1827
1848
  return this.blueIdToNodesMap.get(t) || [];
1828
1849
  }
1829
1850
  load() {
1830
- for (const t of sr) {
1831
- const r = ee(t);
1832
- if (r === void 0) {
1851
+ for (const t of sn) {
1852
+ const n = te(t);
1853
+ if (n === void 0) {
1833
1854
  console.error(`This content file is not valid YAML: ${t}`);
1834
1855
  continue;
1835
1856
  }
1836
- if (Array.isArray(r)) {
1837
- const s = r.map(
1857
+ if (Array.isArray(n)) {
1858
+ const s = n.map(
1838
1859
  (o) => p.deserialize(o)
1839
- ), i = C.calculateBlueIdSync(s);
1860
+ ), i = F.calculateBlueIdSync(s);
1840
1861
  this.blueIdToNodesMap.set(i, s);
1841
1862
  } else {
1842
- const s = p.deserialize(r), i = C.calculateBlueIdSync(s);
1863
+ const s = p.deserialize(n), i = F.calculateBlueIdSync(s);
1843
1864
  this.blueIdToNodesMap.set(i, [s]);
1844
1865
  }
1845
1866
  }
1846
1867
  }
1847
1868
  }
1848
- const me = class me extends Ee {
1869
+ const Ie = class Ie extends Pe {
1849
1870
  constructor() {
1850
1871
  super();
1851
1872
  u(this, "nodeProvider");
1852
- this.nodeProvider = new ir();
1873
+ this.nodeProvider = new on();
1853
1874
  }
1854
1875
  fetchByBlueId(t) {
1855
1876
  return this.nodeProvider.fetchByBlueId(t);
1856
1877
  }
1857
1878
  };
1858
- u(me, "INSTANCE", new me());
1859
- let Ue = me;
1860
- class pe {
1879
+ u(Ie, "INSTANCE", new Ie());
1880
+ let $e = Ie;
1881
+ class ge {
1861
1882
  /**
1862
1883
  * Wraps a NodeProvider with a SequentialNodeProvider that includes bootstrap providers
1863
1884
  * @param originalProvider - The original NodeProvider to wrap
1864
1885
  * @returns A wrapped NodeProvider that includes bootstrap providers
1865
1886
  */
1866
1887
  static wrap(e) {
1867
- return new Kn([
1868
- Ue.INSTANCE,
1888
+ return new Kr([
1889
+ $e.INSTANCE,
1869
1890
  e
1870
1891
  ]);
1871
1892
  }
1872
1893
  }
1873
- const Et = (n) => n instanceof c || Array.isArray(n) && n.every((e) => e instanceof c) ? n : be(n) ? n.map((e) => p.deserialize(e)) : p.deserialize(n), or = async (n) => {
1874
- const e = Et(n);
1875
- return C.calculateBlueId(e);
1876
- }, _r = (n) => {
1877
- const e = Et(n);
1878
- return C.calculateBlueIdSync(e);
1879
- }, Qe = async (n) => {
1880
- if (Xt(n))
1881
- return n;
1894
+ const Pt = (r) => r instanceof l || Array.isArray(r) && r.every((e) => e instanceof l) ? r : Te(r) ? r.map((e) => p.deserialize(e)) : p.deserialize(r), cn = async (r) => {
1895
+ const e = Pt(r);
1896
+ return F.calculateBlueId(e);
1897
+ }, kn = (r) => {
1898
+ const e = Pt(r);
1899
+ return F.calculateBlueIdSync(e);
1900
+ }, Qe = async (r) => {
1901
+ if (qt(r))
1902
+ return r;
1882
1903
  try {
1883
- const e = fe.parse(n), t = await or(e);
1904
+ const e = he.parse(r), t = await cn(e);
1884
1905
  return {
1885
- ...n,
1906
+ ...r,
1886
1907
  blueId: t
1887
1908
  };
1888
1909
  } catch (e) {
1889
1910
  throw new Error(`Failed enriching object with Blue ID: ${e}`);
1890
1911
  }
1891
- }, kr = (n) => n == null ? void 0 : n.items, Yr = (n) => n == null ? void 0 : n.value, Gr = (n) => N(n) ? {} : dt(
1892
- n,
1893
- Lt
1894
- ), zr = (n) => Qt(n) ? n.type.name ?? null : en(n) ? Rt(typeof n.value) : qt(n) ? "List" : null, lr = (n) => f(n) && Object.keys(dt(n, ["blueId"])).length > 0, Jr = (n) => {
1912
+ }, _n = (r) => r == null ? void 0 : r.items, Yn = (r) => r == null ? void 0 : r.value, Gn = (r) => N(r) ? {} : ft(
1913
+ r,
1914
+ Zt
1915
+ ), zn = (r) => er(r) ? r.type.name ?? null : tr(r) ? xt(typeof r.value) : Qt(r) ? "List" : null, ln = (r) => d(r) && Object.keys(ft(r, ["blueId"])).length > 0, Jn = (r) => {
1895
1916
  try {
1896
- const e = p.deserialize(n), t = T.get(e);
1897
- return q.parse(t);
1917
+ const e = p.deserialize(r), t = T.get(e);
1918
+ return Q.parse(t);
1898
1919
  } catch (e) {
1899
1920
  throw new Error(
1900
1921
  `Failed transforming JSON-like value to BlueObject: ${e}`
1901
1922
  );
1902
1923
  }
1903
- }, et = async (n) => {
1924
+ }, et = async (r) => {
1904
1925
  const {
1905
1926
  resolveFunction: e,
1906
1927
  signal: t = new AbortController().signal,
1907
- omitItems: r
1908
- } = n, s = n.count ?? n.items.length;
1909
- let i = await xt(n.items, async (l) => await Qe(l));
1928
+ omitItems: n
1929
+ } = r, s = r.count ?? r.items.length;
1930
+ let i = await Ut(r.items, async (c) => await Qe(c));
1910
1931
  const o = Math.max((i == null ? void 0 : i.length) - s, 0);
1911
- for (let l = i.length - 1; l >= o; l--)
1912
- if (!lr(i[l])) {
1913
- const a = await e(i[l], { signal: t });
1932
+ for (let c = i.length - 1; c >= o; c--)
1933
+ if (!ln(i[c])) {
1934
+ const a = await e(i[c], { signal: t });
1914
1935
  if (Array.isArray(a))
1915
1936
  return et({
1916
- ...n,
1937
+ ...r,
1917
1938
  items: [
1918
- ...i.slice(0, l),
1939
+ ...i.slice(0, c),
1919
1940
  ...a,
1920
- ...i.slice(l + 1)
1941
+ ...i.slice(c + 1)
1921
1942
  ]
1922
1943
  });
1923
1944
  const g = await Qe(a);
1924
- if (r != null && r.includes(g.blueId))
1945
+ if (n != null && n.includes(g.blueId))
1925
1946
  return et({
1926
- ...n,
1927
- items: [...i.slice(0, l), ...i.slice(l + 1)]
1947
+ ...r,
1948
+ items: [...i.slice(0, c), ...i.slice(c + 1)]
1928
1949
  });
1929
1950
  i = [
1930
- ...i.slice(0, l),
1951
+ ...i.slice(0, c),
1931
1952
  g,
1932
- ...i.slice(l + 1)
1953
+ ...i.slice(c + 1)
1933
1954
  ];
1934
1955
  }
1935
1956
  return i;
1936
1957
  };
1937
- function ce(n) {
1958
+ function ae(r) {
1938
1959
  try {
1939
- const e = new URL(n);
1960
+ const e = new URL(r);
1940
1961
  return e.protocol === "http:" || e.protocol === "https:";
1941
1962
  } catch {
1942
1963
  return !1;
1943
1964
  }
1944
1965
  }
1945
- class cr {
1966
+ class an {
1946
1967
  /**
1947
1968
  * Process a document node to infer basic types for untyped values
1948
1969
  * @param document - The document to process
1949
1970
  * @returns The processed document
1950
1971
  */
1951
1972
  process(e) {
1952
- return A.transform(e, this.inferType.bind(this));
1973
+ return S.transform(e, this.inferType.bind(this));
1953
1974
  }
1954
1975
  /**
1955
1976
  * Infer a basic type for a node
@@ -1957,23 +1978,23 @@ class cr {
1957
1978
  * @returns The node with the inferred type
1958
1979
  */
1959
1980
  inferType(e) {
1960
- const t = e.getType(), r = e.getValue();
1961
- return N(t) && f(r) && (typeof r == "string" ? e.setType(new c().setBlueId(te)) : typeof r == "bigint" || Q(r) ? e.setType(new c().setBlueId(re)) : tn(r) ? e.setType(new c().setBlueId(ne)) : typeof r == "boolean" && e.setType(new c().setBlueId(se))), e;
1981
+ const t = e.getType(), n = e.getValue();
1982
+ return N(t) && d(n) && (typeof n == "string" ? e.setType(new l().setBlueId(re)) : typeof n == "bigint" || ee(n) ? e.setType(new l().setBlueId(se)) : rr(n) ? e.setType(new l().setBlueId(ne)) : typeof n == "boolean" && e.setType(new l().setBlueId(ie))), e;
1962
1983
  }
1963
1984
  }
1964
- const W = class W {
1985
+ const K = class K {
1965
1986
  /**
1966
1987
  * Creates a new processor with the given transformation node or mappings
1967
1988
  * @param transformationOrMappings - The transformation node or mappings to use
1968
1989
  */
1969
1990
  constructor(e) {
1970
1991
  u(this, "mappings", /* @__PURE__ */ new Map());
1971
- if (e instanceof c) {
1972
- const r = e.getProperties();
1973
- if (r && r[W.MAPPINGS]) {
1974
- const i = r[W.MAPPINGS].getProperties();
1975
- i && Object.entries(i).forEach(([o, l]) => {
1976
- const a = l.getValue();
1992
+ if (e instanceof l) {
1993
+ const n = e.getProperties();
1994
+ if (n && n[K.MAPPINGS]) {
1995
+ const i = n[K.MAPPINGS].getProperties();
1996
+ i && Object.entries(i).forEach(([o, c]) => {
1997
+ const a = c.getValue();
1977
1998
  typeof a == "string" && this.mappings.set(o, a);
1978
1999
  });
1979
2000
  }
@@ -1986,7 +2007,7 @@ const W = class W {
1986
2007
  * @returns The processed document
1987
2008
  */
1988
2009
  process(e) {
1989
- return A.transform(e, this.transformNode.bind(this));
2010
+ return S.transform(e, this.transformNode.bind(this));
1990
2011
  }
1991
2012
  transformNode(e) {
1992
2013
  const t = e.clone();
@@ -1994,20 +2015,20 @@ const W = class W {
1994
2015
  }
1995
2016
  transformTypeField(e, t) {
1996
2017
  if (t && t.isInlineValue() && t.getValue() !== void 0) {
1997
- const r = String(t.getValue());
1998
- if (this.mappings.has(r)) {
1999
- const s = this.mappings.get(r);
2018
+ const n = String(t.getValue());
2019
+ if (this.mappings.has(n)) {
2020
+ const s = this.mappings.get(n);
2000
2021
  if (s) {
2001
- const i = new c().setBlueId(s);
2022
+ const i = new l().setBlueId(s);
2002
2023
  t === e.getType() ? e.setType(i) : t === e.getItemType() ? e.setItemType(i) : t === e.getKeyType() ? e.setKeyType(i) : t === e.getValueType() && e.setValueType(i);
2003
2024
  }
2004
2025
  }
2005
2026
  }
2006
2027
  }
2007
2028
  };
2008
- u(W, "MAPPINGS", "mappings");
2009
- let $e = W;
2010
- class ar {
2029
+ u(K, "MAPPINGS", "mappings");
2030
+ let Me = K;
2031
+ class un {
2011
2032
  /**
2012
2033
  * Creates a new NodeExtender with the specified NodeProvider and optional strategy
2013
2034
  * @param nodeProvider - The NodeProvider to use for resolving nodes
@@ -2016,7 +2037,7 @@ class ar {
2016
2037
  constructor(e, t) {
2017
2038
  u(this, "nodeProvider");
2018
2039
  u(this, "strategy");
2019
- this.nodeProvider = pe.wrap(e), this.strategy = t || "THROW_EXCEPTION";
2040
+ this.nodeProvider = ge.wrap(e), this.strategy = t || "THROW_EXCEPTION";
2020
2041
  }
2021
2042
  /**
2022
2043
  * Extends a node with its resolved references
@@ -2026,29 +2047,29 @@ class ar {
2026
2047
  extend(e, t) {
2027
2048
  this.extendNode(e, t, "");
2028
2049
  }
2029
- extendNode(e, t, r, s = !1) {
2050
+ extendNode(e, t, n, s = !1) {
2030
2051
  if (!s) {
2031
- if (!t.shouldExtendPathSegment(r, e))
2052
+ if (!t.shouldExtendPathSegment(n, e))
2032
2053
  return;
2033
- t.enterPathSegment(r, e);
2054
+ t.enterPathSegment(n, e);
2034
2055
  }
2035
2056
  try {
2036
2057
  const i = e.getBlueId();
2037
- if (i && !(i in ze)) {
2058
+ if (i && !(i in Je)) {
2038
2059
  const y = this.fetchNode(e);
2039
2060
  if (y && y.length > 0)
2040
2061
  if (y.length === 1) {
2041
2062
  const h = y[0];
2042
2063
  this.mergeNodes(e, h);
2043
2064
  } else {
2044
- const h = y.map((F) => F.clone()), w = new c().setItems(h);
2065
+ const h = y.map((V) => V.clone()), w = new l().setItems(h);
2045
2066
  this.mergeNodes(e, w);
2046
2067
  }
2047
2068
  }
2048
2069
  const o = e.getType();
2049
2070
  o && this.extendNode(o, t, "type", !0);
2050
- const l = e.getItemType();
2051
- l && this.extendNode(l, t, "itemType", !0);
2071
+ const c = e.getItemType();
2072
+ c && this.extendNode(c, t, "itemType", !0);
2052
2073
  const a = e.getKeyType();
2053
2074
  a && this.extendNode(a, t, "keyType", !0);
2054
2075
  const g = e.getValueType();
@@ -2073,10 +2094,10 @@ class ar {
2073
2094
  }
2074
2095
  reconstructList(e) {
2075
2096
  for (; e.length > 0; ) {
2076
- const t = e[0], r = t == null ? void 0 : t.getBlueId();
2077
- if (!r)
2097
+ const t = e[0], n = t == null ? void 0 : t.getBlueId();
2098
+ if (!n)
2078
2099
  break;
2079
- const s = this.nodeProvider.fetchByBlueId(r);
2100
+ const s = this.nodeProvider.fetchByBlueId(n);
2080
2101
  if (!s || s.length === 1)
2081
2102
  break;
2082
2103
  e.shift(), e.unshift(...s);
@@ -2089,36 +2110,36 @@ class ar {
2089
2110
  return null;
2090
2111
  throw new Error(`No blueId found for node: ${e.getName()}`);
2091
2112
  }
2092
- const r = this.nodeProvider.fetchByBlueId(t);
2093
- if (!r || r.length === 0) {
2113
+ const n = this.nodeProvider.fetchByBlueId(t);
2114
+ if (!n || n.length === 0) {
2094
2115
  if (this.strategy === "RETURN_EMPTY")
2095
2116
  return null;
2096
2117
  throw new Error(`No content found for blueId: ${e.getBlueId()}`);
2097
2118
  }
2098
- return r;
2119
+ return n;
2099
2120
  }
2100
2121
  mergeNodes(e, t) {
2101
2122
  e.setName(t.getName()), e.setDescription(t.getDescription()), e.setType(t.getType()), e.setItemType(t.getItemType()), e.setKeyType(t.getKeyType()), e.setValueType(t.getValueType()), e.setValue(t.getValue() ?? null), e.setItems(t.getItems()), e.setProperties(t.getProperties()), e.setContracts(t.getContracts());
2102
2123
  }
2103
2124
  }
2104
- class ur {
2125
+ class fn {
2105
2126
  }
2106
- function tt(n, e) {
2107
- const t = n.split(e), r = [...t].reverse().findIndex((i) => i !== ""), s = r === -1 ? 0 : t.length - r;
2127
+ function tt(r, e) {
2128
+ const t = r.split(e), n = [...t].reverse().findIndex((i) => i !== ""), s = n === -1 ? 0 : t.length - n;
2108
2129
  return t.slice(0, s);
2109
2130
  }
2110
- class Pt extends ur {
2131
+ class At extends fn {
2111
2132
  /**
2112
2133
  * Creates path limits with the specified paths and max depth
2113
2134
  * @param allowedPaths - The paths to limit extension to
2114
2135
  * @param maxDepth - The maximum depth of paths to allow
2115
2136
  */
2116
- constructor(t, r) {
2137
+ constructor(t, n) {
2117
2138
  super();
2118
2139
  u(this, "allowedPaths");
2119
2140
  u(this, "maxDepth");
2120
2141
  u(this, "currentPath", []);
2121
- this.allowedPaths = t, this.maxDepth = r;
2142
+ this.allowedPaths = t, this.maxDepth = n;
2122
2143
  }
2123
2144
  /**
2124
2145
  * Determines if a path segment should be extended
@@ -2128,10 +2149,10 @@ class Pt extends ur {
2128
2149
  shouldExtendPathSegment(t) {
2129
2150
  if (this.currentPath.length >= this.maxDepth)
2130
2151
  return !1;
2131
- const r = this.normalizePath(
2152
+ const n = this.normalizePath(
2132
2153
  this.getCurrentFullPath() + "/" + t
2133
2154
  );
2134
- return this.isAllowedPath(r);
2155
+ return this.isAllowedPath(n);
2135
2156
  }
2136
2157
  /**
2137
2158
  * Determines if a path segment should be merged
@@ -2147,8 +2168,8 @@ class Pt extends ur {
2147
2168
  * @returns True if the path is allowed, false otherwise
2148
2169
  */
2149
2170
  isAllowedPath(t) {
2150
- for (const r of this.allowedPaths)
2151
- if (this.matchesAllowedPath(r, t))
2171
+ for (const n of this.allowedPaths)
2172
+ if (this.matchesAllowedPath(n, t))
2152
2173
  return !0;
2153
2174
  return !1;
2154
2175
  }
@@ -2158,8 +2179,8 @@ class Pt extends ur {
2158
2179
  * @param path - The path to check
2159
2180
  * @returns True if the path matches the allowed path pattern, false otherwise
2160
2181
  */
2161
- matchesAllowedPath(t, r) {
2162
- const s = tt(t, "/"), i = tt(r, "/");
2182
+ matchesAllowedPath(t, n) {
2183
+ const s = tt(t, "/"), i = tt(n, "/");
2163
2184
  if (i.length > s.length)
2164
2185
  return !1;
2165
2186
  for (let o = 1; o < i.length; o++)
@@ -2193,7 +2214,7 @@ class Pt extends ur {
2193
2214
  * @returns The normalized path
2194
2215
  */
2195
2216
  normalizePath(t) {
2196
- return "/" + t.split("/").filter((r) => r !== "").join("/");
2217
+ return "/" + t.split("/").filter((n) => n !== "").join("/");
2197
2218
  }
2198
2219
  /**
2199
2220
  * Creates path limits with a maximum depth
@@ -2201,7 +2222,7 @@ class Pt extends ur {
2201
2222
  * @returns The path limits
2202
2223
  */
2203
2224
  static withMaxDepth(t) {
2204
- return new nt().setMaxDepth(t).addPath("*").build();
2225
+ return new rt().setMaxDepth(t).addPath("*").build();
2205
2226
  }
2206
2227
  /**
2207
2228
  * Creates path limits with a single path
@@ -2209,10 +2230,10 @@ class Pt extends ur {
2209
2230
  * @returns The path limits
2210
2231
  */
2211
2232
  static withSinglePath(t) {
2212
- return new nt().addPath(t).build();
2233
+ return new rt().addPath(t).build();
2213
2234
  }
2214
2235
  }
2215
- class nt {
2236
+ class rt {
2216
2237
  constructor() {
2217
2238
  u(this, "allowedPaths", /* @__PURE__ */ new Set());
2218
2239
  u(this, "maxDepth", Number.MAX_SAFE_INTEGER);
@@ -2238,10 +2259,10 @@ class nt {
2238
2259
  * @returns The built PathLimits
2239
2260
  */
2240
2261
  build() {
2241
- return new Pt(this.allowedPaths, this.maxDepth);
2262
+ return new At(this.allowedPaths, this.maxDepth);
2242
2263
  }
2243
2264
  }
2244
- class At {
2265
+ class St {
2245
2266
  constructor() {
2246
2267
  u(this, "blueIdsCollections", []);
2247
2268
  }
@@ -2268,12 +2289,12 @@ class At {
2268
2289
  const t = {};
2269
2290
  for (const s of this.blueIdsCollections)
2270
2291
  Object.assign(t, s);
2271
- const r = Object.entries(t).map(([s, i]) => ` ${s}: ${i}`).join(`
2292
+ const n = Object.entries(t).map(([s, i]) => ` ${s}: ${i}`).join(`
2272
2293
  `);
2273
2294
  return `- type:
2274
2295
  blueId: ${e}
2275
2296
  mappings:
2276
- ${r}`;
2297
+ ${n}`;
2277
2298
  }
2278
2299
  /**
2279
2300
  * Gets all currently registered BlueIds as a merged object
@@ -2313,7 +2334,7 @@ ${r}`;
2313
2334
  return Object.keys(this.getAllBlueIds()).length;
2314
2335
  }
2315
2336
  }
2316
- const Ie = class Ie {
2337
+ const be = class be {
2317
2338
  /**
2318
2339
  * Creates a new Preprocessor with the specified options
2319
2340
  * @param options - Configuration options for the preprocessor
@@ -2323,10 +2344,10 @@ const Ie = class Ie {
2323
2344
  u(this, "nodeProvider");
2324
2345
  u(this, "defaultSimpleBlue", null);
2325
2346
  u(this, "blueIdsMappingGenerator");
2326
- const { nodeProvider: t, processorProvider: r, blueIdsMappingGenerator: s } = e;
2347
+ const { nodeProvider: t, processorProvider: n, blueIdsMappingGenerator: s } = e;
2327
2348
  if (!t)
2328
2349
  throw new Error("NodeProvider is required");
2329
- this.nodeProvider = pe.wrap(t), this.processorProvider = r || Ie.getStandardProvider(), this.blueIdsMappingGenerator = s || new At(), this.loadDefaultSimpleBlue();
2350
+ this.nodeProvider = ge.wrap(t), this.processorProvider = n || be.getStandardProvider(), this.blueIdsMappingGenerator = s || new St(), this.loadDefaultSimpleBlue();
2330
2351
  }
2331
2352
  /**
2332
2353
  * Preprocesses a document node
@@ -2351,27 +2372,27 @@ const Ie = class Ie {
2351
2372
  * @returns The preprocessed document
2352
2373
  */
2353
2374
  preprocessWithOptions(e, t) {
2354
- let r = e.clone(), s = r.getBlue();
2375
+ let n = e.clone(), s = n.getBlue();
2355
2376
  if (!s && t && (s = t.clone()), s) {
2356
- new ar(this.nodeProvider).extend(
2377
+ new un(this.nodeProvider).extend(
2357
2378
  s,
2358
- Pt.withSinglePath("/*")
2379
+ At.withSinglePath("/*")
2359
2380
  );
2360
2381
  const i = s.getItems();
2361
2382
  if (i && i.length > 0) {
2362
2383
  for (const o of i) {
2363
- const l = this.processorProvider.getProcessor(o);
2364
- if (l)
2365
- r = l.process(r);
2384
+ const c = this.processorProvider.getProcessor(o);
2385
+ if (c)
2386
+ n = c.process(n);
2366
2387
  else
2367
2388
  throw new Error(
2368
2389
  `No processor found for transformation: ${o}`
2369
2390
  );
2370
2391
  }
2371
- r.setBlue(void 0);
2392
+ n.setBlue(void 0);
2372
2393
  }
2373
2394
  }
2374
- return r;
2395
+ return n;
2375
2396
  }
2376
2397
  /**
2377
2398
  * Gets the standard transformation processor provider
@@ -2381,13 +2402,13 @@ const Ie = class Ie {
2381
2402
  return {
2382
2403
  getProcessor(e) {
2383
2404
  var i;
2384
- const t = "27B7fuxQCS1VAptiCPc2RMkKoutP5qxkh3uDxZ7dr6Eo", r = "FGYuTXwaoSKfZmpTysLTLsb8WzSqf43384rKZDkXhxD4", s = (i = e.getType()) == null ? void 0 : i.getBlueId();
2405
+ const t = "27B7fuxQCS1VAptiCPc2RMkKoutP5qxkh3uDxZ7dr6Eo", n = "FGYuTXwaoSKfZmpTysLTLsb8WzSqf43384rKZDkXhxD4", s = (i = e.getType()) == null ? void 0 : i.getBlueId();
2385
2406
  if (t === s)
2386
- return new $e(
2407
+ return new Me(
2387
2408
  e
2388
2409
  );
2389
- if (r === s)
2390
- return new cr();
2410
+ if (n === s)
2411
+ return new an();
2391
2412
  }
2392
2413
  };
2393
2414
  }
@@ -2407,9 +2428,9 @@ ${t}
2407
2428
  * Loads the default simple Blue node
2408
2429
  */
2409
2430
  loadDefaultSimpleBlue() {
2410
- const e = this.enrichDefaultBlue(vt);
2431
+ const e = this.enrichDefaultBlue(Et);
2411
2432
  try {
2412
- const t = ee(e);
2433
+ const t = te(e);
2413
2434
  if (t)
2414
2435
  this.defaultSimpleBlue = p.deserialize(t);
2415
2436
  else
@@ -2419,9 +2440,9 @@ ${t}
2419
2440
  }
2420
2441
  }
2421
2442
  };
2422
- u(Ie, "DEFAULT_BLUE_BLUE_ID", "FREHAAGDZSzpnoTUoCQ86bBmxbVCULMjvx9JZM6fyqT1");
2423
- let ge = Ie;
2424
- class dr {
2443
+ u(be, "DEFAULT_BLUE_BLUE_ID", "FREHAAGDZSzpnoTUoCQ86bBmxbVCULMjvx9JZM6fyqT1");
2444
+ let ye = be;
2445
+ class dn {
2425
2446
  /**
2426
2447
  * Creates a new BlueDirectivePreprocessor
2427
2448
  *
@@ -2442,12 +2463,12 @@ class dr {
2442
2463
  process(e) {
2443
2464
  const t = this.getBlueNodeValue(e);
2444
2465
  if (t) {
2445
- const r = e.clone();
2466
+ const n = e.clone();
2446
2467
  if (this.preprocessingAliases.has(t))
2447
- return this.handleAliasValue(r, t);
2448
- if ($.isPotentialBlueId(t))
2449
- return this.handleBlueId(r, t);
2450
- throw ce(t) ? new Error(
2468
+ return this.handleAliasValue(n, t);
2469
+ if (M.isPotentialBlueId(t))
2470
+ return this.handleBlueId(n, t);
2471
+ throw ae(t) ? new Error(
2451
2472
  `URL '${t}' detected. Use the async version of this method to fetch the content.`
2452
2473
  ) : new Error(`Invalid blue value: ${t}`);
2453
2474
  }
@@ -2462,22 +2483,22 @@ class dr {
2462
2483
  async processAsync(e) {
2463
2484
  const t = this.getBlueNodeValue(e);
2464
2485
  if (t) {
2465
- const r = e.clone();
2486
+ const n = e.clone();
2466
2487
  if (this.preprocessingAliases.has(t))
2467
- return this.handleAliasValue(r, t);
2468
- if ($.isPotentialBlueId(t))
2469
- return this.handleBlueId(r, t);
2470
- if (ce(t) && this.urlContentFetcher)
2488
+ return this.handleAliasValue(n, t);
2489
+ if (M.isPotentialBlueId(t))
2490
+ return this.handleBlueId(n, t);
2491
+ if (ae(t) && this.urlContentFetcher)
2471
2492
  try {
2472
2493
  const s = await this.fetchFromUrl(t);
2473
- return s && r.setBlue(new c().setItems(s)), r;
2494
+ return s && n.setBlue(new l().setItems(s)), n;
2474
2495
  } catch (s) {
2475
2496
  throw s instanceof Error ? new Error(
2476
2497
  `Failed to fetch from URL '${t}'.
2477
2498
  ${s.message}`
2478
2499
  ) : s;
2479
2500
  }
2480
- else throw ce(t) ? new Error(
2501
+ else throw ae(t) ? new Error(
2481
2502
  `UrlContentFetcher not provided for URL: ${t}`
2482
2503
  ) : new Error(`Invalid blue value: ${t}`);
2483
2504
  }
@@ -2489,8 +2510,8 @@ ${s.message}`
2489
2510
  * @returns The blue node value or null if it doesn't exist or isn't a string
2490
2511
  */
2491
2512
  getBlueNodeValue(e) {
2492
- const t = e.getBlue(), r = t == null ? void 0 : t.getValue();
2493
- return r && typeof r == "string" ? r : null;
2513
+ const t = e.getBlue(), n = t == null ? void 0 : t.getValue();
2514
+ return n && typeof n == "string" ? n : null;
2494
2515
  }
2495
2516
  /**
2496
2517
  * Handles a blue value that is an alias
@@ -2500,7 +2521,7 @@ ${s.message}`
2500
2521
  */
2501
2522
  handleAliasValue(e, t) {
2502
2523
  return e.setBlue(
2503
- new c().setBlueId(this.preprocessingAliases.get(t))
2524
+ new l().setBlueId(this.preprocessingAliases.get(t))
2504
2525
  ), e;
2505
2526
  }
2506
2527
  /**
@@ -2510,7 +2531,7 @@ ${s.message}`
2510
2531
  * @returns The modified node
2511
2532
  */
2512
2533
  handleBlueId(e, t) {
2513
- return e.setBlue(new c().setBlueId(t)), e;
2534
+ return e.setBlue(new l().setBlueId(t)), e;
2514
2535
  }
2515
2536
  /**
2516
2537
  * Fetches content from a URL
@@ -2543,8 +2564,8 @@ ${s.message}`
2543
2564
  * @returns this instance for chaining
2544
2565
  */
2545
2566
  addPreprocessingAliases(e) {
2546
- return e.forEach((t, r) => {
2547
- this.preprocessingAliases.set(r, t);
2567
+ return e.forEach((t, n) => {
2568
+ this.preprocessingAliases.set(n, t);
2548
2569
  }), this;
2549
2570
  }
2550
2571
  /**
@@ -2563,24 +2584,24 @@ ${s.message}`
2563
2584
  return this.urlContentFetcher;
2564
2585
  }
2565
2586
  }
2566
- const fr = {
2567
- fetchUrl: async (n) => {
2587
+ const hn = {
2588
+ fetchUrl: async (r) => {
2568
2589
  throw new Error(
2569
- `You must provide a custom UrlFetchStrategy to fetch content from URL: ${n}`
2590
+ `You must provide a custom UrlFetchStrategy to fetch content from URL: ${r}`
2570
2591
  );
2571
2592
  }
2572
2593
  };
2573
- class hr {
2594
+ class pn {
2574
2595
  constructor(e) {
2575
2596
  // Cache to avoid repeated network requests for the same URL
2576
2597
  u(this, "cache", /* @__PURE__ */ new Map());
2577
2598
  u(this, "fetchStrategy");
2578
2599
  u(this, "enabled", !1);
2579
2600
  u(this, "allowedDomains", []);
2580
- this.fetchStrategy = e || fr;
2601
+ this.fetchStrategy = e || hn;
2581
2602
  }
2582
2603
  validateUrl(e) {
2583
- if (!ce(e))
2604
+ if (!ae(e))
2584
2605
  throw new Error(`Invalid URL: ${e}`);
2585
2606
  return !0;
2586
2607
  }
@@ -2590,7 +2611,7 @@ class hr {
2590
2611
  try {
2591
2612
  const t = new URL(e);
2592
2613
  return this.allowedDomains.some(
2593
- (r) => t.hostname === r || t.hostname.endsWith(`.${r}`)
2614
+ (n) => t.hostname === n || t.hostname.endsWith(`.${n}`)
2594
2615
  );
2595
2616
  } catch {
2596
2617
  return !1;
@@ -2613,19 +2634,19 @@ class hr {
2613
2634
  let t;
2614
2635
  try {
2615
2636
  t = await this.fetchStrategy.fetchUrl(e);
2616
- } catch (l) {
2617
- throw new Error(`Error fetching from URL: ${e}`, { cause: l });
2637
+ } catch (c) {
2638
+ throw new Error(`Error fetching from URL: ${e}`, { cause: c });
2618
2639
  }
2619
- const { data: r, contentType: s } = t;
2640
+ const { data: n, contentType: s } = t;
2620
2641
  let i;
2621
2642
  if (s.includes("application/json") || s.includes("text/yaml") || s.includes("application/yaml") || s.includes("text/plain"))
2622
- i = ee(r);
2643
+ i = te(n);
2623
2644
  else
2624
2645
  throw new Error(`Unsupported content type from URL: ${s}`);
2625
2646
  if (i === void 0)
2626
2647
  throw new Error(`Failed to parse content from URL: ${e}`);
2627
2648
  let o;
2628
- return Array.isArray(i) ? o = i.map((l) => p.deserialize(l)) : o = [p.deserialize(i)], this.cache.set(e, o), o;
2649
+ return Array.isArray(i) ? o = i.map((c) => p.deserialize(c)) : o = [p.deserialize(i)], this.cache.set(e, o), o;
2629
2650
  }
2630
2651
  prefetchUrl(e, t) {
2631
2652
  try {
@@ -2699,36 +2720,36 @@ class hr {
2699
2720
  return this.allowedDomains = [], this;
2700
2721
  }
2701
2722
  }
2702
- class Hr {
2723
+ class Hn {
2703
2724
  constructor(e = {}) {
2704
2725
  u(this, "nodeProvider");
2705
2726
  u(this, "typeSchemaResolver");
2706
2727
  u(this, "blueDirectivePreprocessor");
2707
2728
  u(this, "urlContentFetcher");
2708
2729
  u(this, "blueIdsMappingGenerator");
2709
- u(this, "prepareForBlueIdCalculation", async (e) => e instanceof c || Array.isArray(e) && e.every((t) => t instanceof c) ? e : Array.isArray(e) ? await Promise.all(
2710
- e.map((r) => this.jsonValueToNodeAsync(r))
2730
+ u(this, "prepareForBlueIdCalculation", async (e) => e instanceof l || Array.isArray(e) && e.every((t) => t instanceof l) ? e : Array.isArray(e) ? await Promise.all(
2731
+ e.map((n) => this.jsonValueToNodeAsync(n))
2711
2732
  ) : this.jsonValueToNodeAsync(e));
2712
2733
  u(this, "calculateBlueId", async (e) => {
2713
2734
  const t = await this.prepareForBlueIdCalculation(e);
2714
- return C.calculateBlueId(t);
2735
+ return F.calculateBlueId(t);
2715
2736
  });
2716
- u(this, "prepareForBlueIdCalculationSync", (e) => e instanceof c || Array.isArray(e) && e.every((t) => t instanceof c) ? e : Array.isArray(e) ? e.map((t) => this.jsonValueToNode(t)) : this.jsonValueToNode(e));
2717
- var l;
2737
+ u(this, "prepareForBlueIdCalculationSync", (e) => e instanceof l || Array.isArray(e) && e.every((t) => t instanceof l) ? e : Array.isArray(e) ? e.map((t) => this.jsonValueToNode(t)) : this.jsonValueToNode(e));
2738
+ var c;
2718
2739
  const {
2719
2740
  nodeProvider: t,
2720
- typeSchemaResolver: r = null,
2741
+ typeSchemaResolver: n = null,
2721
2742
  urlFetchStrategy: s,
2722
2743
  repositories: i
2723
- } = e, o = Wn(() => []);
2724
- if (this.nodeProvider = pe.wrap(
2744
+ } = e, o = Wr(() => []);
2745
+ if (this.nodeProvider = ge.wrap(
2725
2746
  t || o
2726
- ), this.typeSchemaResolver = r ?? new Un([]), this.urlContentFetcher = new hr(s), this.blueDirectivePreprocessor = new dr(
2747
+ ), this.typeSchemaResolver = n ?? new Ur([]), this.urlContentFetcher = new pn(s), this.blueDirectivePreprocessor = new dn(
2727
2748
  void 0,
2728
2749
  this.urlContentFetcher
2729
- ), this.blueIdsMappingGenerator = new At(), i)
2750
+ ), this.blueIdsMappingGenerator = new St(), i)
2730
2751
  for (const { schemas: a, blueIds: g } of i)
2731
- (l = this.typeSchemaResolver) == null || l.registerSchemas(a), this.blueIdsMappingGenerator.registerBlueIds(g);
2752
+ (c = this.typeSchemaResolver) == null || c.registerSchemas(a), this.blueIdsMappingGenerator.registerBlueIds(g);
2732
2753
  }
2733
2754
  /**
2734
2755
  * Converts a BlueNode to a JSON representation based on the specified strategy.
@@ -2741,7 +2762,7 @@ class Hr {
2741
2762
  return T.get(e, t);
2742
2763
  }
2743
2764
  nodeToSchemaOutput(e, t) {
2744
- return new Hn(this.typeSchemaResolver).convert(e, t);
2765
+ return new Hr(this.typeSchemaResolver).convert(e, t);
2745
2766
  }
2746
2767
  jsonValueToNode(e) {
2747
2768
  return this.preprocess(p.deserialize(e));
@@ -2750,27 +2771,27 @@ class Hr {
2750
2771
  return this.preprocessAsync(p.deserialize(e));
2751
2772
  }
2752
2773
  yamlToNode(e) {
2753
- const t = ee(e);
2774
+ const t = te(e);
2754
2775
  if (!t)
2755
2776
  throw new Error("Failed to parse YAML to JSON");
2756
2777
  return this.jsonValueToNode(t);
2757
2778
  }
2758
2779
  async yamlToNodeAsync(e) {
2759
- const t = ee(e);
2780
+ const t = te(e);
2760
2781
  if (!t)
2761
2782
  throw new Error("Failed to parse YAML to JSON");
2762
2783
  return this.jsonValueToNodeAsync(t);
2763
2784
  }
2764
2785
  calculateBlueIdSync(e) {
2765
2786
  const t = this.prepareForBlueIdCalculationSync(e);
2766
- return C.calculateBlueIdSync(t);
2787
+ return F.calculateBlueIdSync(t);
2767
2788
  }
2768
2789
  addPreprocessingAliases(e) {
2769
2790
  this.blueDirectivePreprocessor.addPreprocessingAliases(e);
2770
2791
  }
2771
2792
  preprocess(e) {
2772
2793
  const t = this.blueDirectivePreprocessor.process(e);
2773
- return new ge({
2794
+ return new ye({
2774
2795
  nodeProvider: this.nodeProvider,
2775
2796
  blueIdsMappingGenerator: this.blueIdsMappingGenerator
2776
2797
  }).preprocessWithDefaultBlue(t);
@@ -2779,7 +2800,7 @@ class Hr {
2779
2800
  const t = await this.blueDirectivePreprocessor.processAsync(
2780
2801
  e
2781
2802
  );
2782
- return new ge({
2803
+ return new ye({
2783
2804
  nodeProvider: this.nodeProvider,
2784
2805
  blueIdsMappingGenerator: this.blueIdsMappingGenerator
2785
2806
  }).preprocessWithDefaultBlue(t);
@@ -2788,7 +2809,7 @@ class Hr {
2788
2809
  return this.nodeProvider;
2789
2810
  }
2790
2811
  setNodeProvider(e) {
2791
- return this.nodeProvider = pe.wrap(e), this;
2812
+ return this.nodeProvider = ge.wrap(e), this;
2792
2813
  }
2793
2814
  getTypeSchemaResolver() {
2794
2815
  return this.typeSchemaResolver;
@@ -2900,67 +2921,81 @@ class Hr {
2900
2921
  getBlueIdsMappingGenerator() {
2901
2922
  return this.blueIdsMappingGenerator;
2902
2923
  }
2924
+ /**
2925
+ * Checks if a BlueNode is of a specific type schema.
2926
+ *
2927
+ * @param node - The BlueNode to check
2928
+ * @param schema - The Zod schema to check against
2929
+ * @param options - Optional configuration
2930
+ * @returns true if the node matches the schema type, false otherwise
2931
+ */
2932
+ isTypeOf(e, t, n) {
2933
+ return P.isTypeOf(e, t, {
2934
+ checkSchemaExtensions: n == null ? void 0 : n.checkSchemaExtensions,
2935
+ typeSchemaResolver: this.typeSchemaResolver
2936
+ });
2937
+ }
2903
2938
  }
2904
2939
  export {
2905
- dn as Base58Sha256Provider,
2906
- Hr as Blue,
2907
- C as BlueIdCalculator,
2908
- Or as BlueIdToCid,
2909
- c as BlueNode,
2910
- Lr as BlueNodeTypeSchema,
2911
- an as JsonCanonicalizer,
2912
- Un as TypeSchemaResolver,
2913
- jr as applyBlueNodePatch,
2940
+ fr as Base58Sha256Provider,
2941
+ Hn as Blue,
2942
+ F as BlueIdCalculator,
2943
+ jn as BlueIdToCid,
2944
+ l as BlueNode,
2945
+ P as BlueNodeTypeSchema,
2946
+ ar as JsonCanonicalizer,
2947
+ Ur as TypeSchemaResolver,
2948
+ Rn as applyBlueNodePatch,
2914
2949
  Be as baseBlueObjectSchema,
2915
- Rr as blueDescriptionField,
2916
- xr as blueIdField,
2917
- Er as blueIdSchema,
2918
- Ur as blueNameField,
2919
- $r as blueNodeField,
2920
- Nr as blueObjectBooleanValueSchema,
2921
- Ar as blueObjectNumberValueSchema,
2922
- q as blueObjectSchema,
2923
- Sr as blueObjectStringListItemsSchema,
2924
- Pr as blueObjectStringValueSchema,
2925
- or as calculateBlueId,
2926
- _r as calculateBlueIdSync,
2950
+ xn as blueDescriptionField,
2951
+ Un as blueIdField,
2952
+ Pn as blueIdSchema,
2953
+ $n as blueNameField,
2954
+ Mn as blueNodeField,
2955
+ Nn as blueObjectBooleanValueSchema,
2956
+ Sn as blueObjectNumberValueSchema,
2957
+ Q as blueObjectSchema,
2958
+ Cn as blueObjectStringListItemsSchema,
2959
+ An as blueObjectStringValueSchema,
2960
+ cn as calculateBlueId,
2961
+ kn as calculateBlueIdSync,
2927
2962
  Qe as enrichWithBlueId,
2928
- En as getBlueDescriptionAnnotation,
2929
- Nn as getBlueIdAnnotation,
2930
- Cn as getBlueNameAnnotation,
2931
- Vn as getBlueNodeAnnotation,
2932
- kr as getBlueObjectItems,
2933
- Gr as getBlueObjectProperties,
2934
- zr as getBlueObjectTypeLabel,
2935
- Yr as getBlueObjectValue,
2936
- On as getExtendedFromSchemaAnnotation,
2937
- xn as getTypeBlueIdAnnotation,
2938
- Xt as hasBlueObjectBlueIdDefined,
2939
- qt as hasBlueObjectItemsDefined,
2940
- Fr as hasBlueObjectNameDefined,
2941
- Qt as hasBlueObjectTypeDefined,
2942
- en as hasBlueObjectValueDefined,
2943
- tn as isBigDecimalNumber,
2944
- Q as isBigIntegerNumber,
2945
- S as isBigNumber,
2946
- qe as isBlueNodeSchema,
2947
- Cr as isBlueObject,
2948
- lr as isBlueObjectResolved,
2949
- Vr as isGivenBlueObjectTypeSchema,
2963
+ Er as getBlueDescriptionAnnotation,
2964
+ Sr as getBlueIdAnnotation,
2965
+ Cr as getBlueNameAnnotation,
2966
+ Vr as getBlueNodeAnnotation,
2967
+ _n as getBlueObjectItems,
2968
+ Gn as getBlueObjectProperties,
2969
+ zn as getBlueObjectTypeLabel,
2970
+ Yn as getBlueObjectValue,
2971
+ Or as getExtendedFromSchemaAnnotation,
2972
+ xr as getTypeBlueIdAnnotation,
2973
+ qt as hasBlueObjectBlueIdDefined,
2974
+ Qt as hasBlueObjectItemsDefined,
2975
+ Vn as hasBlueObjectNameDefined,
2976
+ er as hasBlueObjectTypeDefined,
2977
+ tr as hasBlueObjectValueDefined,
2978
+ rr as isBigDecimalNumber,
2979
+ ee as isBigIntegerNumber,
2980
+ C as isBigNumber,
2981
+ Tt as isBlueNodeSchema,
2982
+ Fn as isBlueObject,
2983
+ ln as isBlueObjectResolved,
2984
+ Dn as isGivenBlueObjectTypeSchema,
2950
2985
  pt as isJsonBlueArray,
2951
2986
  ht as isJsonBlueObject,
2952
- Dr as isJsonBlueValue,
2953
- Tt as isSchemaExtendedFrom,
2954
- ce as isUrl,
2955
- fe as jsonBlueValueSchema,
2956
- Jr as normalizeToBlueObject,
2987
+ On as isJsonBlueValue,
2988
+ wt as isSchemaExtendedFrom,
2989
+ ae as isUrl,
2990
+ he as jsonBlueValueSchema,
2991
+ Jn as normalizeToBlueObject,
2957
2992
  et as resolveBlueObjectItems,
2958
- vn as withBlueDescription,
2959
- An as withBlueId,
2960
- Sn as withBlueName,
2961
- Fn as withBlueNode,
2962
- Dn as withExtendedFromSchema,
2963
- Mr as withTypeBlueId,
2964
- Zr as yamlBlueDump,
2965
- ee as yamlBlueParse
2993
+ Br as withBlueDescription,
2994
+ Ar as withBlueId,
2995
+ Nr as withBlueName,
2996
+ Fr as withBlueNode,
2997
+ Dr as withExtendedFromSchema,
2998
+ Ln as withTypeBlueId,
2999
+ Zn as yamlBlueDump,
3000
+ te as yamlBlueParse
2966
3001
  };