@milaboratories/graph-maker 1.1.134 → 1.1.136

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.
@@ -1,226 +1,272 @@
1
1
  import u from "../../../zod/lib/index.js";
2
- import y from "../../../canonicalize/lib/canonicalize.js";
3
- var k = Object.defineProperty, P = (t, e, n) => e in t ? k(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n, m = (t, e, n) => P(t, typeof e != "symbol" ? e + "" : e, n);
2
+ import l from "../../../canonicalize/lib/canonicalize.js";
3
+ var A = Object.defineProperty, k = (e, t, r) => t in e ? A(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r, m = (e, t, r) => k(e, typeof t != "symbol" ? t + "" : t, r);
4
4
  u.object({
5
5
  /** Included left border. */
6
6
  from: u.number(),
7
7
  /** Excluded right border. */
8
8
  to: u.number()
9
9
  });
10
- function w(t) {
11
- throw new Error("Unexpected object: " + t);
10
+ function P(e) {
11
+ throw new Error("Unexpected object: " + e);
12
12
  }
13
- function N(t) {
14
- if (!t || typeof t != "object")
13
+ function F(e) {
14
+ if (!e || typeof e != "object")
15
15
  return !1;
16
- const e = t;
17
- if (!("type" in e))
16
+ const t = e;
17
+ if (!("type" in t))
18
18
  return !1;
19
- switch (e.type) {
19
+ switch (t.type) {
20
20
  case "Json":
21
- return typeof e.keyLength == "number" && e.data !== void 0 && typeof e.data == "object";
21
+ return typeof t.keyLength == "number" && t.data !== void 0 && typeof t.data == "object";
22
22
  case "JsonPartitioned":
23
- return typeof e.partitionKeyLength == "number" && e.parts !== void 0 && typeof e.parts == "object";
23
+ return typeof t.partitionKeyLength == "number" && t.parts !== void 0 && typeof t.parts == "object";
24
24
  case "BinaryPartitioned":
25
- return typeof e.partitionKeyLength == "number" && e.parts !== void 0 && typeof e.parts == "object";
25
+ return typeof t.partitionKeyLength == "number" && t.parts !== void 0 && typeof t.parts == "object";
26
26
  default:
27
27
  return !1;
28
28
  }
29
29
  }
30
- function T(t, e) {
31
- if (t !== void 0)
32
- switch (t.type) {
30
+ function z(e, t) {
31
+ if (e !== void 0)
32
+ switch (e.type) {
33
33
  case "Json":
34
- return t;
34
+ return e;
35
35
  case "JsonPartitioned": {
36
- const n = {};
37
- for (const [r, o] of Object.entries(t.parts))
38
- n[r] = e(o);
36
+ const r = {};
37
+ for (const [n, o] of Object.entries(e.parts))
38
+ r[n] = t(o);
39
39
  return {
40
- ...t,
41
- parts: n
40
+ ...e,
41
+ parts: r
42
42
  };
43
43
  }
44
44
  case "BinaryPartitioned": {
45
- const n = {};
46
- for (const [r, o] of Object.entries(t.parts))
47
- n[r] = {
48
- index: e(o.index),
49
- values: e(o.values)
45
+ const r = {};
46
+ for (const [n, o] of Object.entries(e.parts))
47
+ r[n] = {
48
+ index: t(o.index),
49
+ values: t(o.values)
50
50
  };
51
51
  return {
52
- ...t,
53
- parts: n
52
+ ...e,
53
+ parts: r
54
54
  };
55
55
  }
56
56
  }
57
57
  }
58
- function A(t) {
59
- if (!t || typeof t != "object")
58
+ function S(e) {
59
+ if (!e || typeof e != "object")
60
60
  return !1;
61
- const e = t;
62
- if (!("type" in e))
61
+ const t = e;
62
+ if (!("type" in t))
63
63
  return !1;
64
- switch (e.type) {
64
+ switch (t.type) {
65
65
  case "Json":
66
- return typeof e.keyLength == "number" && Array.isArray(e.data);
66
+ return typeof t.keyLength == "number" && Array.isArray(t.data);
67
67
  case "JsonPartitioned":
68
- return typeof e.partitionKeyLength == "number" && Array.isArray(e.parts);
68
+ return typeof t.partitionKeyLength == "number" && Array.isArray(t.parts);
69
69
  case "BinaryPartitioned":
70
- return typeof e.partitionKeyLength == "number" && Array.isArray(e.parts);
70
+ return typeof t.partitionKeyLength == "number" && Array.isArray(t.parts);
71
71
  default:
72
72
  return !1;
73
73
  }
74
74
  }
75
- function D(t) {
76
- return A(t) ? t.type === "JsonPartitioned" || t.type === "BinaryPartitioned" : !1;
75
+ function q(e) {
76
+ return S(e) ? e.type === "JsonPartitioned" || e.type === "BinaryPartitioned" : !1;
77
77
  }
78
- function B(t) {
79
- switch (t.type) {
78
+ function U(e) {
79
+ switch (e.type) {
80
80
  case "Json": {
81
- const e = Object.entries(t.data).map(([n, r]) => ({ key: JSON.parse(n), value: r }));
81
+ const t = Object.entries(e.data).map(([r, n]) => ({ key: JSON.parse(r), value: n }));
82
82
  return {
83
83
  type: "Json",
84
- keyLength: t.keyLength,
85
- data: e
84
+ keyLength: e.keyLength,
85
+ data: t
86
86
  };
87
87
  }
88
88
  case "JsonPartitioned": {
89
- const e = Object.entries(t.parts).map(([n, r]) => ({ key: JSON.parse(n), value: r }));
89
+ const t = Object.entries(e.parts).map(([r, n]) => ({ key: JSON.parse(r), value: n }));
90
90
  return {
91
91
  type: "JsonPartitioned",
92
- partitionKeyLength: t.partitionKeyLength,
93
- parts: e
92
+ partitionKeyLength: e.partitionKeyLength,
93
+ parts: t
94
94
  };
95
95
  }
96
96
  case "BinaryPartitioned": {
97
- const e = Object.entries(t.parts).map(([n, r]) => ({ key: JSON.parse(n), value: r }));
97
+ const t = Object.entries(e.parts).map(([r, n]) => ({ key: JSON.parse(r), value: n }));
98
98
  return {
99
99
  type: "BinaryPartitioned",
100
- partitionKeyLength: t.partitionKeyLength,
101
- parts: e
100
+ partitionKeyLength: e.partitionKeyLength,
101
+ parts: t
102
102
  };
103
103
  }
104
104
  }
105
105
  }
106
- function M(t) {
107
- switch (t.type) {
106
+ function G(e) {
107
+ switch (e.type) {
108
108
  case "Json": {
109
- const e = {};
110
- for (const n of t.data)
111
- e[JSON.stringify(n.key)] = n.value;
109
+ const t = {};
110
+ for (const r of e.data)
111
+ t[JSON.stringify(r.key)] = r.value;
112
112
  return {
113
113
  type: "Json",
114
- keyLength: t.keyLength,
115
- data: e
114
+ keyLength: e.keyLength,
115
+ data: t
116
116
  };
117
117
  }
118
118
  case "JsonPartitioned": {
119
- const e = {};
120
- for (const n of t.parts)
121
- e[JSON.stringify(n.key)] = n.value;
119
+ const t = {};
120
+ for (const r of e.parts)
121
+ t[JSON.stringify(r.key)] = r.value;
122
122
  return {
123
123
  type: "JsonPartitioned",
124
- partitionKeyLength: t.partitionKeyLength,
125
- parts: e
124
+ partitionKeyLength: e.partitionKeyLength,
125
+ parts: t
126
126
  };
127
127
  }
128
128
  case "BinaryPartitioned": {
129
- const e = {};
130
- for (const n of t.parts)
131
- e[JSON.stringify(n.key)] = n.value;
129
+ const t = {};
130
+ for (const r of e.parts)
131
+ t[JSON.stringify(r.key)] = r.value;
132
132
  return {
133
133
  type: "BinaryPartitioned",
134
- partitionKeyLength: t.partitionKeyLength,
135
- parts: e
134
+ partitionKeyLength: e.partitionKeyLength,
135
+ parts: t
136
136
  };
137
137
  }
138
138
  }
139
139
  }
140
- function d(t) {
141
- const { type: e, name: n, domain: r } = t, o = { type: e, name: n };
142
- return r && Object.entries(r).length > 0 && Object.assign(o, { domain: r }), o;
140
+ const E = -2147483648, b = -9007199254740991n, j = null, N = null;
141
+ function O(e, t) {
142
+ switch (t) {
143
+ case "Int":
144
+ return e === E;
145
+ case "Long":
146
+ return e === Number(b) || e === b;
147
+ case "Float":
148
+ return Number.isNaN(e);
149
+ case "Double":
150
+ return Number.isNaN(e);
151
+ case "String":
152
+ return e === j;
153
+ case "Bytes":
154
+ return e === N;
155
+ default:
156
+ throw Error(`unsupported data type: ${t}`);
157
+ }
143
158
  }
144
- function O(t) {
145
- return t.map(d);
159
+ function I(e, t) {
160
+ const r = Math.floor(t / 8), n = 1 << 7 - t % 8;
161
+ return (e[r] & n) > 0;
162
+ }
163
+ const J = { type: "absent" }, L = null;
164
+ function Q(e, t, r = {}) {
165
+ if (I(e.absent, t))
166
+ return r.absent === void 0 ? J : r.absent;
167
+ const n = e.data[t], o = e.type;
168
+ if (O(n, o)) return r.na === void 0 ? L : r.na;
169
+ switch (o) {
170
+ case "Int":
171
+ return n;
172
+ case "Long":
173
+ return Number(n);
174
+ case "Float":
175
+ return n;
176
+ case "Double":
177
+ return n;
178
+ case "String":
179
+ return n;
180
+ case "Bytes":
181
+ throw Error("Bytes not yet supported");
182
+ default:
183
+ throw Error(`unsupported data type: ${o}`);
184
+ }
146
185
  }
147
- function R(t) {
148
- return y(d(t));
186
+ function d(e) {
187
+ const { type: t, name: r, domain: n } = e, o = { type: t, name: r };
188
+ return n && Object.entries(n).length > 0 && Object.assign(o, { domain: n }), o;
149
189
  }
150
- function j(t, e) {
151
- if (t === void 0) return e === void 0;
152
- if (e === void 0) return !0;
153
- for (const n in e)
154
- if (t[n] !== e[n]) return !1;
190
+ function $(e) {
191
+ return e.map(d);
192
+ }
193
+ function X(e) {
194
+ return l(d(e));
195
+ }
196
+ function C(e, t) {
197
+ if (e === void 0) return t === void 0;
198
+ if (t === void 0) return !0;
199
+ for (const r in t)
200
+ if (e[r] !== t[r]) return !1;
155
201
  return !0;
156
202
  }
157
- function S(t, e) {
158
- return t.name === e.name && j(t.domain, e.domain);
203
+ function T(e, t) {
204
+ return e.name === t.name && C(e.domain, t.domain);
159
205
  }
160
- function _(t, e) {
161
- return { ...t, src: p(t.src, e) };
206
+ function Y(e, t) {
207
+ return { ...e, src: h(e.src, t) };
162
208
  }
163
- function p(t, e) {
164
- switch (t.type) {
209
+ function h(e, t) {
210
+ switch (e.type) {
165
211
  case "column":
166
212
  return {
167
213
  type: "column",
168
- column: e(t.column)
214
+ column: t(e.column)
169
215
  };
170
216
  case "slicedColumn":
171
217
  return {
172
218
  type: "slicedColumn",
173
- column: e(t.column),
174
- newId: t.newId,
175
- axisFilters: t.axisFilters
219
+ column: t(e.column),
220
+ newId: e.newId,
221
+ axisFilters: e.axisFilters
176
222
  };
177
223
  case "inlineColumn":
178
- return t;
224
+ return e;
179
225
  case "inner":
180
226
  case "full":
181
227
  return {
182
- type: t.type,
183
- entries: t.entries.map((n) => p(n, e))
228
+ type: e.type,
229
+ entries: e.entries.map((r) => h(r, t))
184
230
  };
185
231
  case "outer":
186
232
  return {
187
233
  type: "outer",
188
- primary: p(t.primary, e),
189
- secondary: t.secondary.map((n) => p(n, e))
234
+ primary: h(e.primary, t),
235
+ secondary: e.secondary.map((r) => h(r, t))
190
236
  };
191
237
  default:
192
- w(t);
238
+ P(e);
193
239
  }
194
240
  }
195
- function E(t) {
196
- return y(t);
241
+ function B(e) {
242
+ return l(e);
197
243
  }
198
- function g(t) {
199
- return y(d(t));
244
+ function g(e) {
245
+ return l(d(e));
200
246
  }
201
- function b(t, e) {
202
- return JSON.stringify([t, e]);
247
+ function x(e, t) {
248
+ return JSON.stringify([e, t]);
203
249
  }
204
- class q {
250
+ class Z {
205
251
  /**
206
252
  * Creates a new anchor context from a set of anchor column specifications
207
253
  * @param anchors Record of anchor column specifications indexed by anchor ID
208
254
  */
209
- constructor(e) {
210
- m(this, "domains", /* @__PURE__ */ new Map()), m(this, "axes", /* @__PURE__ */ new Map()), m(this, "domainPacks", []), m(this, "domainPackToAnchor", /* @__PURE__ */ new Map()), this.anchors = e;
211
- const n = Object.entries(e);
212
- n.sort((r, o) => r[0].localeCompare(o[0]));
213
- for (const [r, o] of n) {
255
+ constructor(t) {
256
+ m(this, "domains", /* @__PURE__ */ new Map()), m(this, "axes", /* @__PURE__ */ new Map()), m(this, "domainPacks", []), m(this, "domainPackToAnchor", /* @__PURE__ */ new Map()), this.anchors = t;
257
+ const r = Object.entries(t);
258
+ r.sort((n, o) => n[0].localeCompare(o[0]));
259
+ for (const [n, o] of r) {
214
260
  for (let i = 0; i < o.axesSpec.length; i++) {
215
261
  const a = o.axesSpec[i], s = g(a);
216
- this.axes.set(s, { anchor: r, idx: i });
262
+ this.axes.set(s, { anchor: n, idx: i });
217
263
  }
218
264
  if (o.domain !== void 0) {
219
265
  const i = Object.entries(o.domain);
220
- i.sort((a, s) => a[0].localeCompare(s[0])), this.domainPackToAnchor.set(JSON.stringify(i), r), this.domainPacks.push(i.map(([a]) => a));
266
+ i.sort((a, s) => a[0].localeCompare(s[0])), this.domainPackToAnchor.set(JSON.stringify(i), n), this.domainPacks.push(i.map(([a]) => a));
221
267
  for (const [a, s] of i) {
222
- const c = b(a, s);
223
- this.domains.set(c, r);
268
+ const c = x(a, s);
269
+ this.domains.set(c, n);
224
270
  }
225
271
  }
226
272
  }
@@ -228,56 +274,56 @@ class q {
228
274
  /**
229
275
  * Implementation of derive method
230
276
  */
231
- derive(e, n) {
232
- const r = {
233
- name: e.name,
277
+ derive(t, r) {
278
+ const n = {
279
+ name: t.name,
234
280
  axes: []
235
281
  };
236
282
  let o;
237
- if (e.domain !== void 0)
283
+ if (t.domain !== void 0)
238
284
  e:
239
285
  for (const a of this.domainPacks) {
240
286
  const s = [];
241
287
  for (const f of a) {
242
- const l = e.domain[f];
243
- if (l !== void 0)
244
- s.push([f, l]);
288
+ const p = t.domain[f];
289
+ if (p !== void 0)
290
+ s.push([f, p]);
245
291
  else
246
292
  break e;
247
293
  }
248
294
  const c = this.domainPackToAnchor.get(JSON.stringify(s));
249
295
  if (c !== void 0) {
250
- r.domainAnchor = c, o = new Set(a);
296
+ n.domainAnchor = c, o = new Set(a);
251
297
  break;
252
298
  }
253
299
  }
254
- for (const [a, s] of Object.entries(e.domain ?? {})) {
300
+ for (const [a, s] of Object.entries(t.domain ?? {})) {
255
301
  if (o !== void 0 && o.has(a))
256
302
  continue;
257
- const c = b(a, s), f = this.domains.get(c);
258
- r.domain ?? (r.domain = {}), r.domain[a] = f ? { anchor: f } : s;
303
+ const c = x(a, s), f = this.domains.get(c);
304
+ n.domain ?? (n.domain = {}), n.domain[a] = f ? { anchor: f } : s;
259
305
  }
260
- if (r.axes = e.axesSpec.map((a) => {
306
+ if (n.axes = t.axesSpec.map((a) => {
261
307
  const s = g(a), c = this.axes.get(s);
262
308
  return c === void 0 ? d(a) : c;
263
- }), !n || n.length === 0)
264
- return r;
309
+ }), !r || r.length === 0)
310
+ return n;
265
311
  const i = [];
266
- for (const a of n) {
312
+ for (const a of r) {
267
313
  const [s, c] = a;
268
314
  if (typeof s == "number") {
269
- if (s < 0 || s >= e.axesSpec.length)
270
- throw new Error(`Axis index ${s} is out of bounds (0-${e.axesSpec.length - 1})`);
315
+ if (s < 0 || s >= t.axesSpec.length)
316
+ throw new Error(`Axis index ${s} is out of bounds (0-${t.axesSpec.length - 1})`);
271
317
  i.push([s, c]);
272
318
  } else {
273
- const f = e.axesSpec.findIndex((l) => l.name === s);
319
+ const f = t.axesSpec.findIndex((p) => p.name === s);
274
320
  if (f === -1)
275
321
  throw new Error(`Axis with name "${s}" not found in the column specification`);
276
322
  i.push([f, c]);
277
323
  }
278
324
  }
279
325
  return i.sort((a, s) => a[0] - s[0]), {
280
- source: r,
326
+ source: n,
281
327
  axisFilters: i
282
328
  };
283
329
  }
@@ -287,26 +333,26 @@ class q {
287
333
  * @param axisFilters Optional axis filters to apply to the column
288
334
  * @returns A canonicalized string representation of the anchored column identifier
289
335
  */
290
- deriveS(e, n) {
291
- return E(this.derive(e, n));
336
+ deriveS(t, r) {
337
+ return B(this.derive(t, r));
292
338
  }
293
339
  }
294
- function F(t, e, n) {
295
- const r = { ...e }, o = (n == null ? void 0 : n.ignoreMissingDomains) ?? !1;
296
- if (r.domainAnchor !== void 0) {
297
- const i = t[r.domainAnchor];
340
+ function H(e, t, r) {
341
+ const n = { ...t }, o = (r == null ? void 0 : r.ignoreMissingDomains) ?? !1;
342
+ if (n.domainAnchor !== void 0) {
343
+ const i = e[n.domainAnchor];
298
344
  if (!i)
299
- throw new Error(`Anchor "${r.domainAnchor}" not found`);
345
+ throw new Error(`Anchor "${n.domainAnchor}" not found`);
300
346
  const a = i.domain || {};
301
- r.domain = { ...a, ...r.domain }, delete r.domainAnchor;
347
+ n.domain = { ...a, ...n.domain }, delete n.domainAnchor;
302
348
  }
303
- if (r.domain) {
349
+ if (n.domain) {
304
350
  const i = {};
305
- for (const [a, s] of Object.entries(r.domain))
351
+ for (const [a, s] of Object.entries(n.domain))
306
352
  if (typeof s == "string")
307
353
  i[a] = s;
308
354
  else {
309
- const c = t[s.anchor];
355
+ const c = e[s.anchor];
310
356
  if (!c)
311
357
  throw new Error(`Anchor "${s.anchor}" not found for domain key "${a}"`);
312
358
  if (!c.domain || c.domain[a] === void 0) {
@@ -316,154 +362,154 @@ function F(t, e, n) {
316
362
  }
317
363
  i[a] = c.domain[a];
318
364
  }
319
- r.domain = i;
365
+ n.domain = i;
320
366
  }
321
- return r.axes && (r.axes = r.axes.map((i) => J(t, i))), r;
322
- }
323
- function J(t, e) {
324
- if (!I(e))
325
- return e;
326
- const n = e.anchor, r = t[n];
327
- if (!r)
328
- throw new Error(`Anchor "${n}" not found for axis reference`);
329
- if ("idx" in e) {
330
- if (e.idx < 0 || e.idx >= r.axesSpec.length)
331
- throw new Error(`Axis index ${e.idx} out of bounds for anchor "${n}"`);
332
- return r.axesSpec[e.idx];
333
- } else if ("name" in e) {
334
- const o = r.axesSpec.filter((i) => i.name === e.name);
367
+ return n.axes && (n.axes = n.axes.map((i) => D(e, i))), n;
368
+ }
369
+ function D(e, t) {
370
+ if (!K(t))
371
+ return t;
372
+ const r = t.anchor, n = e[r];
373
+ if (!n)
374
+ throw new Error(`Anchor "${r}" not found for axis reference`);
375
+ if ("idx" in t) {
376
+ if (t.idx < 0 || t.idx >= n.axesSpec.length)
377
+ throw new Error(`Axis index ${t.idx} out of bounds for anchor "${r}"`);
378
+ return n.axesSpec[t.idx];
379
+ } else if ("name" in t) {
380
+ const o = n.axesSpec.filter((i) => i.name === t.name);
335
381
  if (o.length > 1)
336
- throw new Error(`Multiple axes with name "${e.name}" found in anchor "${n}"`);
382
+ throw new Error(`Multiple axes with name "${t.name}" found in anchor "${r}"`);
337
383
  if (o.length === 0)
338
- throw new Error(`Axis with name "${e.name}" not found in anchor "${n}"`);
384
+ throw new Error(`Axis with name "${t.name}" not found in anchor "${r}"`);
339
385
  return o[0];
340
- } else if ("id" in e) {
341
- const o = r.axesSpec.filter((i) => S(e.id, d(i)));
386
+ } else if ("id" in t) {
387
+ const o = n.axesSpec.filter((i) => T(t.id, d(i)));
342
388
  if (o.length > 1)
343
- throw new Error(`Multiple matching axes found for matcher in anchor "${n}"`);
389
+ throw new Error(`Multiple matching axes found for matcher in anchor "${r}"`);
344
390
  if (o.length === 0)
345
- throw new Error(`No matching axis found for matcher in anchor "${n}"`);
391
+ throw new Error(`No matching axis found for matcher in anchor "${r}"`);
346
392
  return o[0];
347
393
  }
348
394
  throw new Error("Unsupported axis reference type");
349
395
  }
350
- function I(t) {
351
- return typeof t == "object" && "anchor" in t;
396
+ function K(e) {
397
+ return typeof e == "object" && "anchor" in e;
352
398
  }
353
- function h(t) {
354
- return t.kind === "PColumn";
399
+ function y(e) {
400
+ return e.kind === "PColumn";
355
401
  }
356
- function L(t) {
357
- return h(t.spec);
402
+ function M(e) {
403
+ return y(e.spec);
358
404
  }
359
- function U(t) {
360
- if (!L(t)) throw new Error(`not a PColumn (kind = ${t.spec.kind})`);
361
- return t;
405
+ function W(e) {
406
+ if (!M(e)) throw new Error(`not a PColumn (kind = ${e.spec.kind})`);
407
+ return e;
362
408
  }
363
- function V(t, e) {
364
- return t === void 0 ? void 0 : {
365
- ...t,
366
- data: e(t.data)
409
+ function ee(e, t) {
410
+ return e === void 0 ? void 0 : {
411
+ ...e,
412
+ data: t(e.data)
367
413
  };
368
414
  }
369
- function z(t) {
370
- const e = /* @__PURE__ */ new Map(), n = (r) => {
371
- switch (r.type) {
415
+ function te(e) {
416
+ const t = /* @__PURE__ */ new Map(), r = (n) => {
417
+ switch (n.type) {
372
418
  case "column":
373
- e.set(r.column.id, r.column);
419
+ t.set(n.column.id, n.column);
374
420
  return;
375
421
  case "slicedColumn":
376
- e.set(r.column.id, r.column);
422
+ t.set(n.column.id, n.column);
377
423
  return;
378
424
  case "inlineColumn":
379
425
  return;
380
426
  case "full":
381
427
  case "inner":
382
- for (const o of r.entries) n(o);
428
+ for (const o of n.entries) r(o);
383
429
  return;
384
430
  case "outer":
385
- n(r.primary);
386
- for (const o of r.secondary) n(o);
431
+ r(n.primary);
432
+ for (const o of n.secondary) r(o);
387
433
  return;
388
434
  default:
389
- w(r);
435
+ P(n);
390
436
  }
391
437
  };
392
- return n(t), [...e.values()];
438
+ return r(e), [...t.values()];
393
439
  }
394
- function x(t, e) {
395
- if (t.name !== void 0 && t.name !== e.name)
440
+ function v(e, t) {
441
+ if (e.name !== void 0 && e.name !== t.name)
396
442
  return !1;
397
- if (t.type !== void 0) {
398
- if (Array.isArray(t.type)) {
399
- if (!t.type.includes(e.type))
443
+ if (e.type !== void 0) {
444
+ if (Array.isArray(e.type)) {
445
+ if (!e.type.includes(t.type))
400
446
  return !1;
401
- } else if (t.type !== e.type)
447
+ } else if (e.type !== t.type)
402
448
  return !1;
403
449
  }
404
- if (t.domain !== void 0) {
405
- const n = e.domain || {};
406
- for (const [r, o] of Object.entries(t.domain))
407
- if (n[r] !== o)
450
+ if (e.domain !== void 0) {
451
+ const r = t.domain || {};
452
+ for (const [n, o] of Object.entries(e.domain))
453
+ if (r[n] !== o)
408
454
  return !1;
409
455
  }
410
456
  return !0;
411
457
  }
412
- function v(t, e) {
413
- if (e.name !== void 0 && t.name !== e.name || e.namePattern !== void 0 && !new RegExp(e.namePattern).test(t.name))
458
+ function w(e, t) {
459
+ if (t.name !== void 0 && e.name !== t.name || t.namePattern !== void 0 && !new RegExp(t.namePattern).test(e.name))
414
460
  return !1;
415
- if (e.type !== void 0) {
416
- if (Array.isArray(e.type)) {
417
- if (!e.type.includes(t.valueType))
461
+ if (t.type !== void 0) {
462
+ if (Array.isArray(t.type)) {
463
+ if (!t.type.includes(e.valueType))
418
464
  return !1;
419
- } else if (e.type !== t.valueType)
465
+ } else if (t.type !== e.valueType)
420
466
  return !1;
421
467
  }
422
- if (e.domain !== void 0) {
423
- const n = t.domain || {};
424
- for (const [r, o] of Object.entries(e.domain))
425
- if (n[r] !== o)
468
+ if (t.domain !== void 0) {
469
+ const r = e.domain || {};
470
+ for (const [n, o] of Object.entries(t.domain))
471
+ if (r[n] !== o)
426
472
  return !1;
427
473
  }
428
- if (e.axes !== void 0) {
429
- const n = t.axesSpec.map(d);
430
- if (e.partialAxesMatch) {
431
- for (const r of e.axes)
432
- if (!n.some((o) => x(r, o)))
474
+ if (t.axes !== void 0) {
475
+ const r = e.axesSpec.map(d);
476
+ if (t.partialAxesMatch) {
477
+ for (const n of t.axes)
478
+ if (!r.some((o) => v(n, o)))
433
479
  return !1;
434
480
  } else {
435
- if (n.length !== e.axes.length)
481
+ if (r.length !== t.axes.length)
436
482
  return !1;
437
- for (let r = 0; r < e.axes.length; r++)
438
- if (!x(e.axes[r], n[r]))
483
+ for (let n = 0; n < t.axes.length; n++)
484
+ if (!v(t.axes[n], r[n]))
439
485
  return !1;
440
486
  }
441
487
  }
442
- if (e.annotations !== void 0) {
443
- const n = t.annotations || {};
444
- for (const [r, o] of Object.entries(e.annotations))
445
- if (n[r] !== o)
488
+ if (t.annotations !== void 0) {
489
+ const r = e.annotations || {};
490
+ for (const [n, o] of Object.entries(t.annotations))
491
+ if (r[n] !== o)
446
492
  return !1;
447
493
  }
448
- if (e.annotationPatterns !== void 0) {
449
- const n = t.annotations || {};
450
- for (const [r, o] of Object.entries(e.annotationPatterns)) {
451
- const i = n[r];
494
+ if (t.annotationPatterns !== void 0) {
495
+ const r = e.annotations || {};
496
+ for (const [n, o] of Object.entries(t.annotationPatterns)) {
497
+ const i = r[n];
452
498
  if (i === void 0 || !new RegExp(o).test(i))
453
499
  return !1;
454
500
  }
455
501
  }
456
502
  return !0;
457
503
  }
458
- function G(t) {
459
- return Array.isArray(t) ? (e) => t.some((n) => h(e) && v(e, n)) : (e) => h(e) && v(e, t);
504
+ function ne(e) {
505
+ return Array.isArray(e) ? (t) => e.some((r) => y(t) && w(t, r)) : (t) => y(t) && w(t, e);
460
506
  }
461
- function W(t) {
462
- const e = {
463
- kind: t.kind,
464
- name: t.name
507
+ function re(e) {
508
+ const t = {
509
+ kind: e.kind,
510
+ name: e.name
465
511
  };
466
- return t.domain !== void 0 && (e.domain = t.domain), h(t) && (e.axesSpec = O(t.axesSpec)), y(e);
512
+ return e.domain !== void 0 && (t.domain = e.domain), y(e) && (t.axesSpec = $(e.axesSpec)), l(t);
467
513
  }
468
514
  u.object({
469
515
  __isRef: u.literal(!0).describe("Crucial marker for the block dependency tree reconstruction"),
@@ -473,53 +519,66 @@ u.object({
473
519
  }).describe(
474
520
  "Universal reference type, allowing to set block connections. It is crucial that {@link __isRef} is present and equal to true, internal logic relies on this marker to build block dependency trees."
475
521
  ).readonly();
476
- function Z(t) {
477
- return typeof t == "object" && t !== null && "__isRef" in t && t.__isRef === !0 && "blockId" in t && "name" in t;
522
+ function oe(e) {
523
+ return typeof e == "object" && e !== null && "__isRef" in e && e.__isRef === !0 && "blockId" in e && "name" in e;
478
524
  }
479
- function H(t, e = !0) {
480
- if (e)
525
+ function ie(e, t = !0) {
526
+ if (t)
481
527
  return {
482
- ...t,
528
+ ...e,
483
529
  requireEnrichments: !0
484
530
  };
485
531
  {
486
- const { requireEnrichments: n, ...r } = t;
487
- return r;
532
+ const { requireEnrichments: r, ...n } = e;
533
+ return n;
488
534
  }
489
535
  }
490
- function Q(t, e) {
491
- return t.ok ? { ok: !0, value: e(t.value) } : t;
536
+ function ae(e, t) {
537
+ return e.ok ? { ok: !0, value: t(e.value) } : e;
538
+ }
539
+ const V = 24;
540
+ u.string().length(V).regex(/[ABCDEFGHIJKLMNOPQRSTUVWXYZ234567]/).brand("PlId");
541
+ function se(e) {
542
+ return l(e);
492
543
  }
493
- const C = 24;
494
- u.string().length(C).regex(/[ABCDEFGHIJKLMNOPQRSTUVWXYZ234567]/).brand("PlId");
495
544
  export {
496
- q as AnchoredIdDeriver,
497
- C as PlIdLength,
498
- R as canonicalizeAxisId,
499
- B as dataInfoToEntries,
500
- W as deriveNativeId,
501
- U as ensurePColumn,
502
- M as entriesToDataInfo,
503
- z as extractAllColumns,
504
- O as getAxesId,
545
+ Z as AnchoredIdDeriver,
546
+ J as PTableAbsent,
547
+ L as PTableNA,
548
+ N as PValueBytesNA,
549
+ E as PValueIntNA,
550
+ b as PValueLongNA,
551
+ j as PValueStringNA,
552
+ V as PlIdLength,
553
+ X as canonicalizeAxisId,
554
+ se as canonicalizeJson,
555
+ U as dataInfoToEntries,
556
+ re as deriveNativeId,
557
+ W as ensurePColumn,
558
+ G as entriesToDataInfo,
559
+ te as extractAllColumns,
560
+ $ as getAxesId,
505
561
  d as getAxisId,
506
- N as isDataInfo,
507
- A as isDataInfoEntries,
508
- L as isPColumn,
509
- h as isPColumnSpec,
510
- D as isPartitionedDataInfoEntries,
511
- Z as isPlRef,
512
- T as mapDataInfo,
513
- p as mapJoinEntry,
514
- V as mapPObjectData,
515
- _ as mapPTableDef,
516
- Q as mapValueInVOE,
517
- x as matchAxis,
518
- S as matchAxisId,
519
- v as matchPColumn,
520
- F as resolveAnchors,
521
- G as selectorsToPredicate,
522
- E as stringifyColumnId,
523
- H as withEnrichments
562
+ F as isDataInfo,
563
+ S as isDataInfoEntries,
564
+ M as isPColumn,
565
+ y as isPColumnSpec,
566
+ q as isPartitionedDataInfoEntries,
567
+ oe as isPlRef,
568
+ I as isValueAbsent,
569
+ O as isValueNA,
570
+ z as mapDataInfo,
571
+ h as mapJoinEntry,
572
+ ee as mapPObjectData,
573
+ Y as mapPTableDef,
574
+ ae as mapValueInVOE,
575
+ v as matchAxis,
576
+ T as matchAxisId,
577
+ w as matchPColumn,
578
+ Q as pTableValue,
579
+ H as resolveAnchors,
580
+ ne as selectorsToPredicate,
581
+ B as stringifyColumnId,
582
+ ie as withEnrichments
524
583
  };
525
584
  //# sourceMappingURL=index.js.map