@graphty/graphty-element 2.4.0 → 2.5.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.
Files changed (46) hide show
  1. package/dist/ai.js +3 -3
  2. package/dist/catalog.js +6 -6
  3. package/dist/chunks/{AiManager-BD9XK30e.js → AiManager-DNJCoeTO.js} +5 -5
  4. package/dist/chunks/{DataSource-B8vf2uhW.js → DataSource-xL3Yn0Pa.js} +72 -61
  5. package/dist/chunks/{GraphSession-dcwOjGJh.js → GraphSession-PFm2tJ_j.js} +1483 -1441
  6. package/dist/chunks/{GraphtyLogger-CqOVV13Y.js → GraphtyLogger-kbOx2zq3.js} +169 -221
  7. package/dist/chunks/{VoiceInputAdapter-D0tHHi9G.js → VoiceInputAdapter-CDNKQgUK.js} +1 -1
  8. package/dist/chunks/{XRPivotCameraController-DTfhvhHz.js → XRPivotCameraController-JdlLBcD7.js} +146 -134
  9. package/dist/chunks/{algorithms-BF0X6RPw.js → algorithms-B87OPYw4.js} +2 -2
  10. package/dist/chunks/{capability-check-BJzlK4oL.js → capability-check-B2oYf_30.js} +1 -1
  11. package/dist/chunks/{detect-vJxK7n0D.js → detect-tuYQLJbT.js} +2 -2
  12. package/dist/chunks/{format-detection-C80TLQ2e.js → format-detection-BG6CMwPO.js} +1 -1
  13. package/dist/chunks/{index-2xkq7wyD.js → index-6GDfNfwJ.js} +2928 -2856
  14. package/dist/chunks/{optionsFromZod-BuTOFgVM.js → optionsFromZod-DHLLiX_8.js} +237 -236
  15. package/dist/chunks/{paletteRegistry-A63C71Gn.js → paletteRegistry-jg9uS7wo.js} +66 -66
  16. package/dist/chunks/pluginRegistry-MaTIDh6l.js +238 -0
  17. package/dist/chunks/{registry-jB46Gmeb.js → registry-DQeq4B2K.js} +8 -8
  18. package/dist/chunks/{scales-B2d-7Bf0.js → scales-BXHmwPXC.js} +4 -4
  19. package/dist/extend.js +7 -7
  20. package/dist/graphty-catalog.json +1 -1
  21. package/dist/graphty.bundle.js +25128 -24837
  22. package/dist/graphty.js +67 -63
  23. package/dist/index.d.ts +3 -0
  24. package/dist/logging.js +2 -2
  25. package/dist/session.js +5 -5
  26. package/dist/src/Edge.d.ts +4 -4
  27. package/dist/src/acceleration/AccelerationController.d.ts +6 -0
  28. package/dist/src/acceleration/registry.d.ts +3 -0
  29. package/dist/src/acceleration/types.d.ts +7 -0
  30. package/dist/src/algorithms/Algorithm.d.ts +13 -0
  31. package/dist/src/cameras/InputUtils.d.ts +67 -0
  32. package/dist/src/cameras/XRInputHandler.d.ts +0 -8
  33. package/dist/src/catalog/pluginRegistry.d.ts +62 -0
  34. package/dist/src/catalog/registry.d.ts +7 -0
  35. package/dist/src/data/DataSource.d.ts +1 -1
  36. package/dist/src/errors/codes.d.ts +2 -1
  37. package/dist/src/meshes/CustomLineRenderer.d.ts +11 -9
  38. package/dist/src/meshes/EdgeMesh.d.ts +18 -9
  39. package/dist/src/meshes/FilledArrowRenderer.d.ts +61 -23
  40. package/dist/src/meshes/PatternedLineRenderer.d.ts +5 -37
  41. package/dist/src/meshes/PerSceneMaterials.d.ts +49 -0
  42. package/dist/src/xr/XRSessionManager.d.ts +1 -1
  43. package/dist/webgpu.d.ts +8 -0
  44. package/dist/webgpu.js +2 -2
  45. package/package.json +5 -5
  46. package/dist/chunks/GraphtyError-B93WRH3e.js +0 -134
@@ -1,64 +1,13 @@
1
- import { G as c } from "./GraphtyError-B93WRH3e.js";
1
+ import { c as G, G as c } from "./pluginRegistry-MaTIDh6l.js";
2
2
  import { c as $ } from "./types-C_c53VgR.js";
3
- function G(e) {
4
- const t = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Set();
5
- let s = null;
6
- return {
7
- register(i, n) {
8
- const o = e.idOf(i);
9
- if (typeof o != "string" || o === "")
10
- throw new c({
11
- code: "E_BAD_COMMAND",
12
- message: `a ${e.kind} registration needs an id`,
13
- source: "registry",
14
- details: { kind: e.kind, field: "id" }
15
- });
16
- if (e.builtInIds().includes(o))
17
- throw new c({
18
- code: "E_DUPLICATE_PLUGIN",
19
- message: `"${o}" is the id of a ${e.kind} the element ships, and a built-in id may not be taken: a saved document that named it yesterday has to mean the same thing today`,
20
- source: "registry",
21
- details: { kind: e.kind, name: o, builtIn: !0 }
22
- });
23
- const u = t.get(o);
24
- if (u !== void 0) {
25
- if (e.implementationOf(u) === e.implementationOf(i))
26
- return;
27
- if (n?.strict === !0)
28
- throw new c({
29
- code: "E_DUPLICATE_PLUGIN",
30
- message: `a ${e.kind} named "${o}" is already registered`,
31
- source: "registry",
32
- details: { kind: e.kind, name: o }
33
- });
34
- r.has(o) || (r.add(o), console.warn(
35
- `graphty: a second ${e.kind} named "${o}" replaced the first. Register one implementation per name, or pass { strict: true } to make this throw.`
36
- ));
37
- }
38
- t.set(o, i), s = null;
39
- },
40
- entries() {
41
- return Object.freeze([...t.values()]);
42
- },
43
- descriptors() {
44
- return s ??= Object.freeze([...t.values()].map((i) => e.descriptorOf(i))), s;
45
- },
46
- byId(i) {
47
- return t.get(i);
48
- },
49
- clearForTesting() {
50
- t.clear(), r.clear(), s = null;
51
- }
52
- };
53
- }
54
- const _ = G({
3
+ const E = G({
55
4
  kind: "sink",
56
5
  idOf: (e) => e.descriptor.id,
57
6
  descriptorOf: (e) => e.descriptor,
58
7
  implementationOf: (e) => e.create,
59
8
  builtInIds: () => $
60
9
  });
61
- function Oe(e, t) {
10
+ function Te(e, t) {
62
11
  const r = e.descriptor;
63
12
  if (r === void 0 || typeof r != "object")
64
13
  throw new c({
@@ -74,18 +23,18 @@ function Oe(e, t) {
74
23
  source: "registry",
75
24
  details: { kind: "sink", name: String(r.id), field: "create" }
76
25
  });
77
- _.register(e, t);
26
+ E.register(e, t);
78
27
  }
79
- function U() {
80
- return _.descriptors();
28
+ function F() {
29
+ return E.descriptors();
81
30
  }
82
31
  function v(e) {
83
- return _.byId(e);
32
+ return E.byId(e);
84
33
  }
85
- function Te() {
86
- _.clearForTesting();
34
+ function Oe() {
35
+ E.clearForTesting();
87
36
  }
88
- const F = Object.freeze([
37
+ const U = Object.freeze([
89
38
  {
90
39
  id: "console",
91
40
  plainName: "Browser console",
@@ -158,38 +107,38 @@ const F = Object.freeze([
158
107
  ]
159
108
  }
160
109
  ]);
161
- function j(e) {
162
- return F.find((t) => t.id === e) ?? v(e)?.descriptor;
110
+ function x(e) {
111
+ return U.find((t) => t.id === e) ?? v(e)?.descriptor;
163
112
  }
164
- const x = 3;
113
+ const j = 3;
165
114
  function B(e, t) {
166
- let r = Array.from({ length: t.length + 1 }, (s, i) => i);
167
- for (let s = 1; s <= e.length; s++) {
168
- const i = [s];
169
- for (let n = 1; n <= t.length; n++) {
170
- const o = (r[n - 1] ?? 0) + (e[s - 1] === t[n - 1] ? 0 : 1);
171
- i[n] = Math.min(o, (r[n] ?? 0) + 1, (i[n - 1] ?? 0) + 1);
115
+ let r = Array.from({ length: t.length + 1 }, (n, o) => o);
116
+ for (let n = 1; n <= e.length; n++) {
117
+ const o = [n];
118
+ for (let s = 1; s <= t.length; s++) {
119
+ const i = (r[s - 1] ?? 0) + (e[n - 1] === t[s - 1] ? 0 : 1);
120
+ o[s] = Math.min(i, (r[s] ?? 0) + 1, (o[s - 1] ?? 0) + 1);
172
121
  }
173
- r = i;
122
+ r = o;
174
123
  }
175
124
  return r[t.length] ?? Math.max(e.length, t.length);
176
125
  }
177
126
  function W(e, t) {
178
- return t.map((r) => ({ name: r, distance: B(e.toLowerCase(), r.toLowerCase()) })).filter((r) => r.distance <= x).sort((r, s) => r.distance - s.distance).slice(0, 3).map((r) => r.name);
127
+ return t.map((r) => ({ name: r, distance: B(e.toLowerCase(), r.toLowerCase()) })).filter((r) => r.distance <= j).sort((r, n) => r.distance - n.distance).slice(0, 3).map((r) => r.name);
179
128
  }
180
- function O(e) {
129
+ function T(e) {
181
130
  return typeof e == "number" ? e : void 0;
182
131
  }
183
132
  function K(e, t, r) {
184
- const s = { kind: r.kind, id: r.id, option: e.name, value: t };
133
+ const n = { kind: r.kind, id: r.id, option: e.name, value: t };
185
134
  if (e.type === "enum" && e.values !== void 0) {
186
- const i = e.values.map((n) => n.value);
187
- if (typeof t != "string" || !i.includes(t))
135
+ const o = e.values.map((s) => s.value);
136
+ if (typeof t != "string" || !o.includes(t))
188
137
  throw new c({
189
138
  code: "E_OPTION_RANGE",
190
- message: `"${e.name}" accepts ${i.map((n) => `"${n}"`).join(", ")}`,
139
+ message: `"${e.name}" accepts ${o.map((s) => `"${s}"`).join(", ")}`,
191
140
  source: "config",
192
- details: { ...s, values: i }
141
+ details: { ...n, values: o }
193
142
  });
194
143
  return;
195
144
  }
@@ -199,22 +148,22 @@ function K(e, t, r) {
199
148
  code: "E_OPTION_RANGE",
200
149
  message: `"${e.name}" takes a number`,
201
150
  source: "config",
202
- details: s
151
+ details: n
203
152
  });
204
153
  if (e.type === "integer" && !Number.isInteger(t))
205
154
  throw new c({
206
155
  code: "E_OPTION_RANGE",
207
156
  message: `"${e.name}" takes a whole number`,
208
157
  source: "config",
209
- details: s
158
+ details: n
210
159
  });
211
- const i = O(e.min), n = O(e.max);
212
- if (i !== void 0 && t < i || n !== void 0 && t > n)
160
+ const o = T(e.min), s = T(e.max);
161
+ if (o !== void 0 && t < o || s !== void 0 && t > s)
213
162
  throw new c({
214
163
  code: "E_OPTION_RANGE",
215
- message: `"${e.name}" is limited to ${i ?? "any"} through ${n ?? "any"}`,
164
+ message: `"${e.name}" is limited to ${o ?? "any"} through ${s ?? "any"}`,
216
165
  source: "config",
217
- details: { ...s, min: i, max: n }
166
+ details: { ...n, min: o, max: s }
218
167
  });
219
168
  return;
220
169
  }
@@ -223,37 +172,37 @@ function K(e, t, r) {
223
172
  code: "E_OPTION_RANGE",
224
173
  message: `"${e.name}" takes true or false`,
225
174
  source: "config",
226
- details: s
175
+ details: n
227
176
  });
228
177
  }
229
- function T(e, t, r) {
230
- const s = new Map(e.map((n) => [n.name, n]));
231
- for (const n of Object.keys(t))
232
- if (!s.has(n)) {
233
- const o = e.map((u) => u.name);
178
+ function O(e, t, r) {
179
+ const n = new Map(e.map((s) => [s.name, s]));
180
+ for (const s of Object.keys(t))
181
+ if (!n.has(s)) {
182
+ const i = e.map((m) => m.name);
234
183
  throw new c({
235
184
  code: "E_UNKNOWN_OPTION",
236
- message: `the ${r.kind} "${r.id}" has no option named "${n}"`,
185
+ message: `the ${r.kind} "${r.id}" has no option named "${s}"`,
237
186
  source: "config",
238
187
  details: {
239
188
  kind: r.kind,
240
189
  id: r.id,
241
- option: n,
242
- available: o,
243
- candidates: W(n, o)
190
+ option: s,
191
+ available: i,
192
+ candidates: W(s, i)
244
193
  }
245
194
  });
246
195
  }
247
- const i = {};
248
- for (const n of e) {
249
- const o = t[n.name];
250
- if (o === void 0) {
251
- n.default !== void 0 && (i[n.name] = n.default);
196
+ const o = {};
197
+ for (const s of e) {
198
+ const i = t[s.name];
199
+ if (i === void 0) {
200
+ s.default !== void 0 && (o[s.name] = s.default);
252
201
  continue;
253
202
  }
254
- K(n, o, r), i[n.name] = o;
203
+ K(s, i, r), o[s.name] = i;
255
204
  }
256
- return i;
205
+ return o;
257
206
  }
258
207
  var l = /* @__PURE__ */ ((e) => (e[e.SILENT = 0] = "SILENT", e[e.ERROR = 1] = "ERROR", e[e.WARN = 2] = "WARN", e[e.INFO = 3] = "INFO", e[e.DEBUG = 4] = "DEBUG", e[e.TRACE = 5] = "TRACE", e))(l || {});
259
208
  const H = {
@@ -275,7 +224,7 @@ const H = {
275
224
  function be(e) {
276
225
  return H[e.toLowerCase()];
277
226
  }
278
- const y = {
227
+ const _ = {
279
228
  enabled: !1,
280
229
  level: l.INFO,
281
230
  modules: "*",
@@ -285,7 +234,7 @@ const y = {
285
234
  colors: !0
286
235
  }
287
236
  };
288
- let a = { ...y, format: { ...y.format } };
237
+ let a = { ..._, format: { ..._.format } };
289
238
  function z(e) {
290
239
  a = {
291
240
  enabled: e.enabled ?? a.enabled,
@@ -305,13 +254,13 @@ function b(e) {
305
254
  if (t === void 0)
306
255
  return a.level;
307
256
  for (let r = e.length - 1; r >= 0; r--) {
308
- const s = t[e[r]];
309
- if (s !== void 0)
310
- return s;
257
+ const n = t[e[r]];
258
+ if (n !== void 0)
259
+ return n;
311
260
  }
312
261
  return a.level;
313
262
  }
314
- function m() {
263
+ function d() {
315
264
  return { ...a, format: { ...a.format } };
316
265
  }
317
266
  function k(e) {
@@ -326,28 +275,28 @@ function k(e) {
326
275
  return !1;
327
276
  }
328
277
  function ke() {
329
- a = { ...y, format: { ...y.format } };
278
+ a = { ..._, format: { ..._.format } };
330
279
  }
331
- function R(e, t) {
332
- const { format: r } = m(), s = t?.timestamp ?? r.timestamp, i = t?.module ?? r.module, n = [];
333
- return s && n.push(`[${e.timestamp.toISOString()}]`), i && n.push(`[${e.category.join(".")}]`), n.push(`[${N[e.level]}]`), n.push(e.message), n.join(" ");
280
+ function w(e, t) {
281
+ const { format: r } = d(), n = t?.timestamp ?? r.timestamp, o = t?.module ?? r.module, s = [];
282
+ return n && s.push(`[${e.timestamp.toISOString()}]`), o && s.push(`[${e.category.join(".")}]`), s.push(`[${N[e.level]}]`), s.push(e.message), s.join(" ");
334
283
  }
335
- const I = /* @__PURE__ */ Symbol.for("graphty.lazy");
284
+ const S = /* @__PURE__ */ Symbol.for("graphty.lazy");
336
285
  function Me(e) {
337
286
  let t, r = !1;
338
- const s = () => (r || (t = e(), r = !0), t);
339
- return s[I] = !0, s;
287
+ const n = () => (r || (t = e(), r = !0), t);
288
+ return n[S] = !0, n;
340
289
  }
341
290
  function J(e) {
342
- return typeof e == "function" && I in e;
291
+ return typeof e == "function" && S in e;
343
292
  }
344
293
  function V(e) {
345
294
  const t = {};
346
- for (const [r, s] of Object.entries(e))
347
- t[r] = J(s) ? s() : s;
295
+ for (const [r, n] of Object.entries(e))
296
+ t[r] = J(n) ? n() : n;
348
297
  return t;
349
298
  }
350
- function q(e) {
299
+ function Y(e) {
351
300
  switch (e) {
352
301
  case l.ERROR:
353
302
  return "error";
@@ -359,17 +308,17 @@ function q(e) {
359
308
  return "debug";
360
309
  }
361
310
  }
362
- function Y(e) {
311
+ function q(e) {
363
312
  const t = { ...e.data };
364
313
  return e.error && (t.error = e.error.stack ?? e.error.message), Object.keys(t).length > 0 ? t : void 0;
365
314
  }
366
- function S(e = {}) {
367
- const t = e.formatter ?? R, r = e.colors ?? !0;
315
+ function L(e = {}) {
316
+ const t = e.formatter ?? w, r = e.colors ?? !0;
368
317
  return {
369
318
  name: "console",
370
- write(s) {
371
- const i = t(s), n = r ? q(s.level) : "log", o = Y(s);
372
- o ? console[n](i, o) : console[n](i);
319
+ write(n) {
320
+ const o = t(n), s = r ? Y(n.level) : "log", i = q(n);
321
+ i ? console[s](o, i) : console[s](o);
373
322
  }
374
323
  };
375
324
  }
@@ -388,7 +337,7 @@ function re(e) {
388
337
  const t = Date.now().toString(36), r = Math.random().toString(36).substring(2, 8);
389
338
  return `${e}-${t}-${r}`;
390
339
  }
391
- class ne {
340
+ class se {
392
341
  /**
393
342
  * Creates a new RemoteLogClient.
394
343
  * @param options - Configuration options
@@ -404,10 +353,10 @@ class ne {
404
353
  */
405
354
  shouldThrottle(t) {
406
355
  const r = Date.now();
407
- for (const { pattern: s, intervalMs: i } of this.throttlePatterns)
408
- if (s.test(t)) {
409
- const n = s.source, o = this.throttleLastTimes.get(n) ?? 0;
410
- return r - o < i ? !0 : (this.throttleLastTimes.set(n, r), !1);
356
+ for (const { pattern: n, intervalMs: o } of this.throttlePatterns)
357
+ if (n.test(t)) {
358
+ const s = n.source, i = this.throttleLastTimes.get(s) ?? 0;
359
+ return r - i < o ? !0 : (this.throttleLastTimes.set(s, r), !1);
411
360
  }
412
361
  return !1;
413
362
  }
@@ -417,16 +366,16 @@ class ne {
417
366
  * @param message - The log message
418
367
  * @param data - Optional additional data to include
419
368
  */
420
- log(t, r, s) {
369
+ log(t, r, n) {
421
370
  if (this.isClosed || this.shouldThrottle(r))
422
371
  return;
423
- const i = {
372
+ const o = {
424
373
  time: (/* @__PURE__ */ new Date()).toISOString(),
425
374
  level: t,
426
375
  message: r,
427
- ...s !== void 0 && { data: s }
376
+ ...n !== void 0 && { data: n }
428
377
  };
429
- this.pendingLogs.push(i), this.scheduleBatchSend();
378
+ this.pendingLogs.push(o), this.scheduleBatchSend();
430
379
  }
431
380
  /**
432
381
  * Schedules a batch send after the configured interval.
@@ -453,14 +402,14 @@ class ne {
453
402
  */
454
403
  async sendWithRetry(t) {
455
404
  let r = null;
456
- for (let s = 0; s <= this.maxRetries; s++)
405
+ for (let n = 0; n <= this.maxRetries; n++)
457
406
  try {
458
407
  await this.sendRequest(t);
459
408
  return;
460
- } catch (i) {
461
- if (r = i instanceof Error ? i : new Error(String(i)), s < this.maxRetries) {
462
- const n = this.retryDelayMs * Math.pow(2, s);
463
- await this.sleep(n);
409
+ } catch (o) {
410
+ if (r = o instanceof Error ? o : new Error(String(o)), n < this.maxRetries) {
411
+ const s = this.retryDelayMs * Math.pow(2, n);
412
+ await this.sleep(s);
464
413
  }
465
414
  }
466
415
  console.error("[RemoteLogClient] Failed to send logs after retries:", r?.message);
@@ -476,22 +425,22 @@ class ne {
476
425
  logs: t
477
426
  };
478
427
  this.projectMarker !== void 0 && (r.projectMarker = this.projectMarker), this.worktreePath !== void 0 && (r.worktreePath = this.worktreePath);
479
- const s = new AbortController(), i = setTimeout(() => {
480
- s.abort();
428
+ const n = new AbortController(), o = setTimeout(() => {
429
+ n.abort();
481
430
  }, this.timeoutMs);
482
431
  try {
483
- const n = await fetch(`${this.serverUrl}/log`, {
432
+ const s = await fetch(`${this.serverUrl}/log`, {
484
433
  method: "POST",
485
434
  headers: {
486
435
  "Content-Type": "application/json"
487
436
  },
488
437
  body: JSON.stringify(r),
489
- signal: s.signal
438
+ signal: n.signal
490
439
  });
491
- if (!n.ok)
492
- throw new Error(`HTTP ${n.status}: ${n.statusText}`);
440
+ if (!s.ok)
441
+ throw new Error(`HTTP ${s.status}: ${s.statusText}`);
493
442
  } finally {
494
- clearTimeout(i);
443
+ clearTimeout(o);
495
444
  }
496
445
  }
497
446
  /**
@@ -517,8 +466,8 @@ class ne {
517
466
  this.isClosed || (this.isClosed = !0, await this.flush());
518
467
  }
519
468
  }
520
- function se(e) {
521
- const t = [R(e, { timestamp: !1, module: !0 })];
469
+ function ne(e) {
470
+ const t = [w(e, { timestamp: !1, module: !0 })];
522
471
  if (e.data && Object.keys(e.data).length > 0)
523
472
  try {
524
473
  t.push(JSON.stringify(e.data));
@@ -529,23 +478,23 @@ function se(e) {
529
478
  Error: ${e.error.message}`), e.error.stack && t.push(`
530
479
  ${e.error.stack}`)), t.join(" ");
531
480
  }
532
- function L(e) {
533
- const t = e.serverUrl.replace(/\/$/, ""), r = e.sessionPrefix ?? "graphty", s = e.batchIntervalMs ?? 100, i = e.maxRetries ?? 3, n = e.retryDelayMs ?? 1e3, o = e.throttleMs ?? 5e3, u = e.throttlePatterns?.map((f) => ({
534
- pattern: f,
535
- intervalMs: o
536
- })), h = new ne({
481
+ function I(e) {
482
+ const t = e.serverUrl.replace(/\/$/, ""), r = e.sessionPrefix ?? "graphty", n = e.batchIntervalMs ?? 100, o = e.maxRetries ?? 3, s = e.retryDelayMs ?? 1e3, i = e.throttleMs ?? 5e3, m = e.throttlePatterns?.map((u) => ({
483
+ pattern: u,
484
+ intervalMs: i
485
+ })), h = new se({
537
486
  serverUrl: t,
538
487
  sessionPrefix: r,
539
- batchIntervalMs: s,
540
- maxRetries: i,
541
- retryDelayMs: n,
542
- throttlePatterns: u
488
+ batchIntervalMs: n,
489
+ maxRetries: o,
490
+ retryDelayMs: s,
491
+ throttlePatterns: m
543
492
  });
544
493
  return {
545
494
  name: "remote",
546
- write(f) {
547
- const D = se(f), C = N[f.level];
548
- h.log(C, D, f.data);
495
+ write(u) {
496
+ const D = ne(u), C = N[u.level];
497
+ h.log(C, D, u.data);
549
498
  },
550
499
  async flush() {
551
500
  await h.flush();
@@ -560,9 +509,9 @@ function L(e) {
560
509
  }
561
510
  };
562
511
  }
563
- const E = /* @__PURE__ */ new Map(), d = /* @__PURE__ */ new Map();
564
- let w;
565
- function ie(e) {
512
+ const y = /* @__PURE__ */ new Map(), f = /* @__PURE__ */ new Map();
513
+ let R;
514
+ function oe(e) {
566
515
  return e.join(".");
567
516
  }
568
517
  function A(e) {
@@ -576,13 +525,13 @@ function A(e) {
576
525
  console.error(`[GraphtyLogger] Error disposing sink "${e.name}":`, t);
577
526
  }
578
527
  }
579
- function oe(e, t) {
528
+ function ie(e, t) {
580
529
  return e.level !== void 0 && t.level > e.level ? !1 : e.categories !== void 0 && e.categories.length > 0 ? e.categories.some((r) => t.category.includes(r)) : !0;
581
530
  }
582
531
  function ae(e) {
583
532
  e.data && Object.freeze(e.data), Object.freeze(e);
584
- for (const t of d.values())
585
- if (oe(t, e))
533
+ for (const t of f.values())
534
+ if (ie(t, e))
586
535
  try {
587
536
  t.write(e);
588
537
  } catch (r) {
@@ -590,41 +539,41 @@ function ae(e) {
590
539
  }
591
540
  }
592
541
  function le(e) {
593
- const t = (i, n, o, u) => {
594
- if (!m().enabled || !k(e) || i > b(e))
542
+ const t = (o, s, i, m) => {
543
+ if (!d().enabled || !k(e) || o > b(e))
595
544
  return;
596
- const f = o ? V(o) : void 0;
545
+ const u = i ? V(i) : void 0;
597
546
  ae({
598
547
  timestamp: /* @__PURE__ */ new Date(),
599
- level: i,
548
+ level: o,
600
549
  category: e,
601
- message: n,
602
- data: f,
603
- error: u
550
+ message: s,
551
+ data: u,
552
+ error: m
604
553
  });
605
- }, r = (i) => (n, o) => {
606
- t(i, n, o);
607
- }, s = (i) => m().enabled && k(e) && b(e) >= i;
554
+ }, r = (o) => (s, i) => {
555
+ t(o, s, i);
556
+ }, n = (o) => d().enabled && k(e) && b(e) >= o;
608
557
  return {
609
558
  trace: r(l.TRACE),
610
559
  debug: r(l.DEBUG),
611
560
  info: r(l.INFO),
612
561
  warn: r(l.WARN),
613
- error: (i, n, o) => {
614
- t(l.ERROR, i, o, n);
562
+ error: (o, s, i) => {
563
+ t(l.ERROR, o, i, s);
615
564
  },
616
- isTraceEnabled: () => s(l.TRACE),
617
- isDebugEnabled: () => s(l.DEBUG)
565
+ isTraceEnabled: () => n(l.TRACE),
566
+ isDebugEnabled: () => n(l.DEBUG)
618
567
  };
619
568
  }
620
569
  function ce(e) {
621
- return S({ colors: e.colors === !0 });
570
+ return L({ colors: e.colors === !0 });
622
571
  }
623
572
  function g(e) {
624
573
  return typeof e == "number" ? e : void 0;
625
574
  }
626
575
  function ue(e) {
627
- return L({
576
+ return I({
628
577
  serverUrl: typeof e.serverUrl == "string" ? e.serverUrl : "",
629
578
  sessionPrefix: typeof e.sessionPrefix == "string" ? e.sessionPrefix : void 0,
630
579
  batchIntervalMs: g(e.batchIntervalMs),
@@ -638,9 +587,9 @@ const P = /* @__PURE__ */ new Map([
638
587
  ["remote", ue]
639
588
  ]);
640
589
  function fe() {
641
- return [...P.keys(), ...U().map((e) => e.id)];
590
+ return [...P.keys(), ...F().map((e) => e.id)];
642
591
  }
643
- function de(e) {
592
+ function me(e) {
644
593
  throw new c({
645
594
  code: "E_UNKNOWN_SINK",
646
595
  message: `nothing is registered as the log destination "${e}". Register it with registerLogSink before naming it in a configuration.`,
@@ -648,35 +597,35 @@ function de(e) {
648
597
  details: { kind: "sink", name: e, available: fe() }
649
598
  });
650
599
  }
651
- function me(e) {
652
- const t = e.use, r = e.options ?? {}, s = v(t);
653
- if (s)
654
- return s.create(T(s.descriptor.options, r, { kind: "sink", id: t }));
655
- const i = P.get(t), n = j(t);
656
- return (!i || !n) && de(t), i(T(n.options, r, { kind: "sink", id: t }));
600
+ function de(e) {
601
+ const t = e.use, r = e.options ?? {}, n = v(t);
602
+ if (n)
603
+ return n.create(O(n.descriptor.options, r, { kind: "sink", id: t }));
604
+ const o = P.get(t), s = x(t);
605
+ return (!o || !s) && me(t), o(O(s.options, r, { kind: "sink", id: t }));
657
606
  }
658
607
  function p(e) {
659
- const t = d.get(e.name);
660
- t && t !== e && A(t), d.set(e.name, e);
608
+ const t = f.get(e.name);
609
+ t && t !== e && A(t), f.set(e.name, e);
661
610
  }
662
611
  function he(e) {
663
- z(e), p(S({ colors: m().format.colors ?? !0 }));
612
+ z(e), p(L({ colors: d().format.colors ?? !0 }));
664
613
  const { remoteLogUrl: t } = e;
665
- t && t !== w && (w = t, p(L({ serverUrl: t })));
614
+ t && t !== R && (R = t, p(I({ serverUrl: t })));
666
615
  for (const r of e.sinks ?? [])
667
- p("write" in r ? r : me(r));
668
- return E.clear(), Promise.resolve();
616
+ p("write" in r ? r : de(r));
617
+ return y.clear(), Promise.resolve();
669
618
  }
670
619
  function ge(e) {
671
- const t = d.get(e);
672
- return t ? (d.delete(e), A(t), e === "remote" && (w = void 0), !0) : !1;
620
+ const t = f.get(e);
621
+ return t ? (f.delete(e), A(t), e === "remote" && (R = void 0), !0) : !1;
673
622
  }
674
623
  function pe() {
675
- return Array.from(d.values());
624
+ return Array.from(f.values());
676
625
  }
677
- async function ye() {
626
+ async function _e() {
678
627
  const e = [];
679
- for (const t of d.values())
628
+ for (const t of f.values())
680
629
  t.flush && e.push(
681
630
  t.flush().catch((r) => {
682
631
  console.error(`[GraphtyLogger] Error flushing sink "${t.name}":`, r);
@@ -684,15 +633,15 @@ async function ye() {
684
633
  );
685
634
  await Promise.all(e);
686
635
  }
687
- function _e(e) {
688
- const t = ie(e), r = E.get(t);
636
+ function Ee(e) {
637
+ const t = oe(e), r = y.get(t);
689
638
  if (r)
690
639
  return r;
691
- const s = le(e);
692
- return E.set(t, s), s;
640
+ const n = le(e);
641
+ return y.set(t, n), n;
693
642
  }
694
- function Ee() {
695
- return m().enabled;
643
+ function ye() {
644
+ return d().enabled;
696
645
  }
697
646
  const ve = {
698
647
  /**
@@ -702,11 +651,11 @@ const ve = {
702
651
  /**
703
652
  * Get a logger for the specified category.
704
653
  */
705
- getLogger: _e,
654
+ getLogger: Ee,
706
655
  /**
707
656
  * Check if logging is enabled.
708
657
  */
709
- isEnabled: Ee,
658
+ isEnabled: ye,
710
659
  /**
711
660
  * Add a custom sink to the logger.
712
661
  */
@@ -722,31 +671,30 @@ const ve = {
722
671
  /**
723
672
  * Flush all sinks that support flushing.
724
673
  */
725
- flush: ye,
674
+ flush: _e,
726
675
  /**
727
676
  * Render a record the way the element renders its own console line.
728
677
  */
729
- formatRecord: R
678
+ formatRecord: w
730
679
  };
731
680
  export {
732
681
  ve as G,
733
- F as L,
734
- U as a,
735
- T as b,
736
- Te as c,
682
+ U as L,
683
+ F as a,
684
+ O as b,
685
+ Oe as c,
737
686
  l as d,
738
687
  H as e,
739
688
  N as f,
740
689
  z as g,
741
- S as h,
742
- L as i,
743
- R as j,
744
- m as k,
745
- j as l,
690
+ L as h,
691
+ I as i,
692
+ w as j,
693
+ d as k,
694
+ x as l,
746
695
  k as m,
747
696
  Me as n,
748
697
  ke as o,
749
698
  be as p,
750
- G as q,
751
- Oe as r
699
+ Te as r
752
700
  };