@origintrail-official/dkg-node-ui 10.0.1 → 10.0.2

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 (39) hide show
  1. package/dist/index.d.ts +4 -2
  2. package/dist/index.d.ts.map +1 -1
  3. package/dist/index.js +4 -1
  4. package/dist/index.js.map +1 -1
  5. package/dist/otlp-log-worker.d.ts +127 -0
  6. package/dist/otlp-log-worker.d.ts.map +1 -0
  7. package/dist/otlp-log-worker.js +268 -0
  8. package/dist/otlp-log-worker.js.map +1 -0
  9. package/dist/telemetry-resource.d.ts +41 -0
  10. package/dist/telemetry-resource.d.ts.map +1 -0
  11. package/dist/telemetry-resource.js +31 -0
  12. package/dist/telemetry-resource.js.map +1 -0
  13. package/dist/telemetry.d.ts +75 -16
  14. package/dist/telemetry.d.ts.map +1 -1
  15. package/dist/telemetry.js +152 -29
  16. package/dist/telemetry.js.map +1 -1
  17. package/dist-ui/assets/{3d-force-graph-DII0C0lY.js → 3d-force-graph-CcVMtgO4.js} +1 -1
  18. package/dist-ui/assets/Admin-DNNaF7rz.js +45 -0
  19. package/dist-ui/assets/{AgentHub-D3eOrb3Z.js → AgentHub-eWb_Tns6.js} +1 -1
  20. package/dist-ui/assets/AgentProfilePage-D2T_V6PG.js +1 -0
  21. package/dist-ui/assets/Network-C6MDsv2e.js +1 -0
  22. package/dist-ui/assets/OnChainProvenanceCard-BbrU7jzL.js +1 -0
  23. package/dist-ui/assets/{Operations-BC6Cv6cR.js → Operations-CCMDENBd.js} +3 -3
  24. package/dist-ui/assets/Settings-WaFKYtwQ.js +1 -0
  25. package/dist-ui/assets/ccip-CDdHldzo.js +1 -0
  26. package/dist-ui/assets/formatTrac-BTy0WudH.js +1 -0
  27. package/dist-ui/assets/{index-B6UQm9N_.js → index-2Gzrk1k3.js} +160 -169
  28. package/dist-ui/assets/{index-D0Mz0SVt.js → index-BrxEjqsW.js} +3 -3
  29. package/dist-ui/assets/{index-BgRu6zNc.css → index-CmliV5st.css} +1 -1
  30. package/dist-ui/assets/{index-ByLJSVQ3.js → index-W4n8cdTA.js} +11 -11
  31. package/dist-ui/assets/{jsonld-32FQRO67-B4_tUX65.js → jsonld-32FQRO67-CbN9NJJW.js} +2 -2
  32. package/dist-ui/assets/{jsonld-D5RXTCJi.js → jsonld-DkQdPwg5.js} +1 -1
  33. package/dist-ui/assets/{renderer-3d-2EVDZII7-BTYEjwma.js → renderer-3d-2EVDZII7-CTUExXUn.js} +2 -2
  34. package/dist-ui/index.html +2 -2
  35. package/package.json +12 -3
  36. package/dist-ui/assets/AgentProfilePage-jB-v9soG.js +0 -1
  37. package/dist-ui/assets/Network-d4igcZQ0.js +0 -1
  38. package/dist-ui/assets/OnChainProvenanceCard-BL6ou6s9.js +0 -1
  39. package/dist-ui/assets/Settings-DXSjvx2a.js +0 -1
@@ -1,12 +1,58 @@
1
1
  /**
2
- * Optional OpenTelemetry integration for the Node UI.
3
- * When enabled (via config), exports metrics and optionally traces to an OTLP endpoint.
4
- * operationId is set as the trace/span attribute for correlation with the dashboard.
2
+ * OpenTelemetry SDK bootstrap for a DKG node (boot side, daemon-only consumer).
5
3
  *
6
- * To enable: add @opentelemetry/api, @opentelemetry/sdk-metrics, and
7
- * @opentelemetry/exporter-metrics-otlp-http; then implement registerMeter() and
8
- * use the same metric names below. For traces, use @opentelemetry/sdk-trace-base
9
- * and set span attributes { 'dkg.operation_id': operationId }.
4
+ * Registers the global Tracer + Meter providers at daemon startup so that the
5
+ * call-site facade in `@origintrail-official/dkg-core` (getTracer/withSpan/
6
+ * getMetrics) used across agent/publisher/chain/sync produces real spans and
7
+ * metrics. When telemetry is disabled, or a signal has no endpoint, this
8
+ * registers NOTHING: the core facade then talks to the API's built-in no-op
9
+ * providers (zero cost, no outbound calls).
10
+ *
11
+ * Logs are NOT handled here — they stay on the hand-rolled `OtlpLogWorker`
12
+ * (bounded buffer + retry + at-source redaction); the OTel Logs SDK is still
13
+ * "Development". This module only wires traces + metrics, and shares ONE
14
+ * Resource with the log worker so all three signals describe the same node.
15
+ *
16
+ * BROWSER SAFETY: the heavy Node-only OTel SDK packages (sdk-trace-node,
17
+ * sdk-metrics, exporter-*-otlp-proto, resources) and `@origintrail-official/dkg-core`
18
+ * are loaded via DYNAMIC import inside `initTelemetry`/`shutdownTelemetry`, never
19
+ * statically. Only `@opentelemetry/api` (browser-safe, no Node built-ins) is a
20
+ * static import. That keeps this module — and the package root that re-exports
21
+ * it — free of server-only code in any static bundle graph: a browser bundler
22
+ * never pulls the Node SDK because it sits behind a runtime `import()` that the
23
+ * UI never triggers.
24
+ */
25
+ import { type TelemetryResourceInput } from './telemetry-resource.js';
26
+ /**
27
+ * Stable resource identity, shared by logs + traces + metrics. Single canonical
28
+ * type — re-exported alias of `TelemetryResourceInput` (the shared resource
29
+ * model in ./telemetry-resource) so logs and traces/metrics can't drift.
30
+ */
31
+ export type TelemetryResource = TelemetryResourceInput;
32
+ export interface OtlpSignalConfig {
33
+ endpoint?: string;
34
+ /** Bearer token → Authorization header. */
35
+ token?: string;
36
+ headers?: Record<string, string>;
37
+ /** Per-signal opt-out. A signal is on only when it has an endpoint AND this is not false. */
38
+ enabled?: boolean;
39
+ }
40
+ export interface TelemetryInitConfig {
41
+ /** Master gate. When false, nothing is registered. */
42
+ enabled?: boolean;
43
+ resource?: TelemetryResource;
44
+ traces?: OtlpSignalConfig & {
45
+ sampleRatio?: number;
46
+ };
47
+ metrics?: OtlpSignalConfig & {
48
+ exportIntervalMs?: number;
49
+ };
50
+ }
51
+ /**
52
+ * LEGACY config shape (pre-PR #1317 stub). Kept so old JS callers that pass
53
+ * `{ enabled, metricsEndpoint, serviceName }` keep working — `initTelemetry`
54
+ * normalizes it into `TelemetryInitConfig` (metricsEndpoint → metrics.endpoint).
55
+ * @deprecated Use `TelemetryInitConfig` (traces/metrics signal blocks).
10
56
  */
11
57
  export interface TelemetryConfig {
12
58
  enabled?: boolean;
@@ -16,20 +62,33 @@ export interface TelemetryConfig {
16
62
  serviceName?: string;
17
63
  }
18
64
  /**
19
- * Initialize telemetry. No-op if disabled or OTel packages not installed.
20
- * Call once at daemon startup.
65
+ * Initialize traces + metrics. No-op when disabled or when a signal has no
66
+ * endpoint. Safe to call once at daemon boot. Idempotent (subsequent calls are
67
+ * ignored once configured). Async because the Node OTel SDK is dynamically
68
+ * imported (see the BROWSER SAFETY note above).
21
69
  */
22
- export declare function initTelemetry(_config: TelemetryConfig): void;
70
+ export declare function initTelemetry(input: TelemetryInitConfig | TelemetryConfig): Promise<void>;
71
+ /** True once EITHER signal (traces or metrics) has registered a real provider. */
72
+ export declare function isTelemetryConfigured(): boolean;
23
73
  /**
24
- * Record a gauge value for export. No-op when telemetry is disabled.
25
- * Metric names match dashboard: dkg.network.peers, dkg.knowledge.triples, dkg.system.cpu_percent, etc.
74
+ * Flush + shut down providers. Used both at daemon teardown AND when telemetry
75
+ * is turned off via the runtime master gate, so it must FULLY reverse
76
+ * `initTelemetry`: stop the exporters, then clear the OTel API globals so a
77
+ * later `initTelemetry` (live re-enable) can register fresh providers — without
78
+ * the `disable()` calls, the API keeps the first (now shut-down) provider and a
79
+ * re-enable would silently no-op. Safe if never initialized; idempotent.
80
+ */
81
+ export declare function shutdownTelemetry(): Promise<void>;
82
+ /**
83
+ * @deprecated No-op compatibility shim for the pre-PR #1317 telemetry API. Node
84
+ * metrics flow through the `@origintrail-official/dkg-core` facade
85
+ * (`getMetrics()`), not this call. Kept so old callers don't break at import.
26
86
  */
27
87
  export declare function recordGauge(_name: string, _value: number): void;
28
88
  /**
29
- * Start a span for an operation (for trace correlation).
30
- * operationId should be set as span attribute so traces match the Operations panel.
31
- * No-op when telemetry is disabled.
89
+ * @deprecated No-op compatibility shim for the pre-PR #1317 telemetry API. Spans
90
+ * are created via the core facade `withSpan()`/`getTracer()`. Kept so old
91
+ * callers don't break at import.
32
92
  */
33
93
  export declare function setOperationSpan(_operationId: string, _operationName: string): void;
34
- export declare function isTelemetryConfigured(): boolean;
35
94
  //# sourceMappingURL=telemetry.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"telemetry.d.ts","sourceRoot":"","sources":["../src/telemetry.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,MAAM,WAAW,eAAe;IAC9B,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,6EAA6E;IAC7E,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,2CAA2C;IAC3C,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAID;;;GAGG;AACH,wBAAgB,aAAa,CAAC,OAAO,EAAE,eAAe,GAAG,IAAI,CAK5D;AAED;;;GAGG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,IAAI,CAG/D;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,YAAY,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,GAAG,IAAI,CAGnF;AAED,wBAAgB,qBAAqB,IAAI,OAAO,CAE/C"}
1
+ {"version":3,"file":"telemetry.d.ts","sourceRoot":"","sources":["../src/telemetry.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAGH,OAAO,EAA+B,KAAK,sBAAsB,EAAE,MAAM,yBAAyB,CAAC;AAKnG;;;;GAIG;AACH,MAAM,MAAM,iBAAiB,GAAG,sBAAsB,CAAC;AAEvD,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,2CAA2C;IAC3C,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACjC,6FAA6F;IAC7F,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,MAAM,WAAW,mBAAmB;IAClC,sDAAsD;IACtD,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,iBAAiB,CAAC;IAC7B,MAAM,CAAC,EAAE,gBAAgB,GAAG;QAAE,WAAW,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IACrD,OAAO,CAAC,EAAE,gBAAgB,GAAG;QAAE,gBAAgB,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;CAC5D;AAED;;;;;GAKG;AACH,MAAM,WAAW,eAAe;IAC9B,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,6EAA6E;IAC7E,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,2CAA2C;IAC3C,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AA+BD;;;;;GAKG;AACH,wBAAsB,aAAa,CAAC,KAAK,EAAE,mBAAmB,GAAG,eAAe,GAAG,OAAO,CAAC,IAAI,CAAC,CAwD/F;AAED,kFAAkF;AAClF,wBAAgB,qBAAqB,IAAI,OAAO,CAE/C;AAED;;;;;;;GAOG;AACH,wBAAsB,iBAAiB,IAAI,OAAO,CAAC,IAAI,CAAC,CAyBvD;AAED;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,IAAI,CAE/D;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,YAAY,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,GAAG,IAAI,CAEnF"}
package/dist/telemetry.js CHANGED
@@ -1,45 +1,168 @@
1
1
  /**
2
- * Optional OpenTelemetry integration for the Node UI.
3
- * When enabled (via config), exports metrics and optionally traces to an OTLP endpoint.
4
- * operationId is set as the trace/span attribute for correlation with the dashboard.
2
+ * OpenTelemetry SDK bootstrap for a DKG node (boot side, daemon-only consumer).
5
3
  *
6
- * To enable: add @opentelemetry/api, @opentelemetry/sdk-metrics, and
7
- * @opentelemetry/exporter-metrics-otlp-http; then implement registerMeter() and
8
- * use the same metric names below. For traces, use @opentelemetry/sdk-trace-base
9
- * and set span attributes { 'dkg.operation_id': operationId }.
4
+ * Registers the global Tracer + Meter providers at daemon startup so that the
5
+ * call-site facade in `@origintrail-official/dkg-core` (getTracer/withSpan/
6
+ * getMetrics) used across agent/publisher/chain/sync produces real spans and
7
+ * metrics. When telemetry is disabled, or a signal has no endpoint, this
8
+ * registers NOTHING: the core facade then talks to the API's built-in no-op
9
+ * providers (zero cost, no outbound calls).
10
+ *
11
+ * Logs are NOT handled here — they stay on the hand-rolled `OtlpLogWorker`
12
+ * (bounded buffer + retry + at-source redaction); the OTel Logs SDK is still
13
+ * "Development". This module only wires traces + metrics, and shares ONE
14
+ * Resource with the log worker so all three signals describe the same node.
15
+ *
16
+ * BROWSER SAFETY: the heavy Node-only OTel SDK packages (sdk-trace-node,
17
+ * sdk-metrics, exporter-*-otlp-proto, resources) and `@origintrail-official/dkg-core`
18
+ * are loaded via DYNAMIC import inside `initTelemetry`/`shutdownTelemetry`, never
19
+ * statically. Only `@opentelemetry/api` (browser-safe, no Node built-ins) is a
20
+ * static import. That keeps this module — and the package root that re-exports
21
+ * it — free of server-only code in any static bundle graph: a browser bundler
22
+ * never pulls the Node SDK because it sits behind a runtime `import()` that the
23
+ * UI never triggers.
10
24
  */
11
- let configured = false;
25
+ import { metrics as otelMetrics, trace as otelTrace } from '@opentelemetry/api';
26
+ import { buildTelemetryResourceAttrs } from './telemetry-resource.js';
27
+ // Independent per-signal lifecycle state (NOT one shared flag) so traces and
28
+ // metrics can be registered separately and one signal's setup never gates the other.
29
+ let tracerProvider = null;
30
+ let meterProvider = null;
31
+ // Traces/metrics resource attributes come from the SAME shared builder the log
32
+ // worker uses — no second mapping to drift.
33
+ const buildAttrs = buildTelemetryResourceAttrs;
34
+ function authHeaders(sig) {
35
+ const headers = { ...(sig.headers ?? {}) };
36
+ if (sig.token)
37
+ headers['Authorization'] = `Bearer ${sig.token}`;
38
+ return Object.keys(headers).length ? headers : undefined;
39
+ }
40
+ /** Map the legacy flat `{ metricsEndpoint, serviceName }` shape onto the new one. */
41
+ function normalizeInitConfig(input) {
42
+ const legacy = input;
43
+ const next = input;
44
+ if (legacy.metricsEndpoint && !next.metrics && !next.traces) {
45
+ return {
46
+ enabled: legacy.enabled,
47
+ resource: { serviceName: legacy.serviceName },
48
+ metrics: { endpoint: legacy.metricsEndpoint },
49
+ };
50
+ }
51
+ return next;
52
+ }
12
53
  /**
13
- * Initialize telemetry. No-op if disabled or OTel packages not installed.
14
- * Call once at daemon startup.
54
+ * Initialize traces + metrics. No-op when disabled or when a signal has no
55
+ * endpoint. Safe to call once at daemon boot. Idempotent (subsequent calls are
56
+ * ignored once configured). Async because the Node OTel SDK is dynamically
57
+ * imported (see the BROWSER SAFETY note above).
15
58
  */
16
- export function initTelemetry(_config) {
17
- if (!_config.enabled || !_config.metricsEndpoint)
59
+ export async function initTelemetry(input) {
60
+ const cfg = normalizeInitConfig(input);
61
+ if (!cfg.enabled)
18
62
  return;
19
- configured = true;
20
- // When OTel is added: create MeterProvider, OTLP exporter, register gauges
21
- // meter.createObservableGauge('dkg.network.peers', ...), etc.
63
+ // Traces and metrics are INDEPENDENT signals: each registers only if it has
64
+ // an endpoint AND isn't already registered. (No single `configured` gate — a
65
+ // metrics-only init followed by a traces init must still register traces.)
66
+ const tracesOn = !!cfg.traces?.endpoint && cfg.traces.enabled !== false && tracerProvider === null;
67
+ const metricsOn = !!cfg.metrics?.endpoint && cfg.metrics.enabled !== false && meterProvider === null;
68
+ if (!tracesOn && !metricsOn)
69
+ return;
70
+ const { resourceFromAttributes } = await import('@opentelemetry/resources');
71
+ const resource = resourceFromAttributes(buildAttrs(cfg.resource));
72
+ // ── Traces ──
73
+ if (tracesOn) {
74
+ const { NodeTracerProvider, BatchSpanProcessor, ParentBasedSampler, TraceIdRatioBasedSampler } = await import('@opentelemetry/sdk-trace-node');
75
+ const { OTLPTraceExporter } = await import('@opentelemetry/exporter-trace-otlp-proto');
76
+ const exporter = new OTLPTraceExporter({
77
+ url: cfg.traces.endpoint,
78
+ headers: authHeaders(cfg.traces),
79
+ });
80
+ const ratio = cfg.traces.sampleRatio ?? 1;
81
+ tracerProvider = new NodeTracerProvider({
82
+ resource,
83
+ sampler: new ParentBasedSampler({ root: new TraceIdRatioBasedSampler(ratio) }),
84
+ spanProcessors: [new BatchSpanProcessor(exporter)],
85
+ });
86
+ // register() installs the global tracer provider + an AsyncLocalStorage
87
+ // context manager (so spans flow across awaits) + W3C trace-context propagator.
88
+ tracerProvider.register();
89
+ }
90
+ // ── Metrics ──
91
+ if (metricsOn) {
92
+ const { MeterProvider, PeriodicExportingMetricReader } = await import('@opentelemetry/sdk-metrics');
93
+ const { OTLPMetricExporter } = await import('@opentelemetry/exporter-metrics-otlp-proto');
94
+ const { rebuildMetrics } = await import('@origintrail-official/dkg-core');
95
+ const exporter = new OTLPMetricExporter({
96
+ url: cfg.metrics.endpoint,
97
+ headers: authHeaders(cfg.metrics),
98
+ });
99
+ meterProvider = new MeterProvider({
100
+ resource,
101
+ readers: [
102
+ new PeriodicExportingMetricReader({
103
+ exporter,
104
+ exportIntervalMillis: cfg.metrics.exportIntervalMs ?? 30_000,
105
+ }),
106
+ ],
107
+ });
108
+ otelMetrics.setGlobalMeterProvider(meterProvider);
109
+ // Re-bind the core facade's instrument cache to the real meter.
110
+ rebuildMetrics();
111
+ }
112
+ }
113
+ /** True once EITHER signal (traces or metrics) has registered a real provider. */
114
+ export function isTelemetryConfigured() {
115
+ return tracerProvider !== null || meterProvider !== null;
22
116
  }
23
117
  /**
24
- * Record a gauge value for export. No-op when telemetry is disabled.
25
- * Metric names match dashboard: dkg.network.peers, dkg.knowledge.triples, dkg.system.cpu_percent, etc.
118
+ * Flush + shut down providers. Used both at daemon teardown AND when telemetry
119
+ * is turned off via the runtime master gate, so it must FULLY reverse
120
+ * `initTelemetry`: stop the exporters, then clear the OTel API globals so a
121
+ * later `initTelemetry` (live re-enable) can register fresh providers — without
122
+ * the `disable()` calls, the API keeps the first (now shut-down) provider and a
123
+ * re-enable would silently no-op. Safe if never initialized; idempotent.
124
+ */
125
+ export async function shutdownTelemetry() {
126
+ const hadTracer = !!tracerProvider;
127
+ const hadMeter = !!meterProvider;
128
+ const tasks = [];
129
+ if (tracerProvider) {
130
+ tasks.push(tracerProvider.forceFlush().catch(() => { }));
131
+ tasks.push(tracerProvider.shutdown().catch(() => { }));
132
+ }
133
+ if (meterProvider) {
134
+ tasks.push(meterProvider.forceFlush().catch(() => { }));
135
+ tasks.push(meterProvider.shutdown().catch(() => { }));
136
+ }
137
+ await Promise.all(tasks);
138
+ // Reset the global API so a subsequent initTelemetry() can re-register
139
+ // (setGlobal*Provider only takes effect once until the slot is disabled).
140
+ if (hadTracer)
141
+ otelTrace.disable();
142
+ if (hadMeter) {
143
+ otelMetrics.disable();
144
+ // Rebind the core facade's instrument cache back to the no-op meter so
145
+ // getMetrics() after disable is inert rather than holding dead instruments.
146
+ const { rebuildMetrics } = await import('@origintrail-official/dkg-core');
147
+ rebuildMetrics();
148
+ }
149
+ tracerProvider = null;
150
+ meterProvider = null;
151
+ }
152
+ /**
153
+ * @deprecated No-op compatibility shim for the pre-PR #1317 telemetry API. Node
154
+ * metrics flow through the `@origintrail-official/dkg-core` facade
155
+ * (`getMetrics()`), not this call. Kept so old callers don't break at import.
26
156
  */
27
157
  export function recordGauge(_name, _value) {
28
- if (!configured)
29
- return;
30
- // When OTel is added: update the observable gauge callback or record value
158
+ /* no-op (browser-safe): real metrics go through getMetrics() */
31
159
  }
32
160
  /**
33
- * Start a span for an operation (for trace correlation).
34
- * operationId should be set as span attribute so traces match the Operations panel.
35
- * No-op when telemetry is disabled.
161
+ * @deprecated No-op compatibility shim for the pre-PR #1317 telemetry API. Spans
162
+ * are created via the core facade `withSpan()`/`getTracer()`. Kept so old
163
+ * callers don't break at import.
36
164
  */
37
165
  export function setOperationSpan(_operationId, _operationName) {
38
- if (!configured)
39
- return;
40
- // When OTel is added: tracer.startSpan(operationName, { attributes: { 'dkg.operation_id': operationId } })
41
- }
42
- export function isTelemetryConfigured() {
43
- return configured;
166
+ /* no-op (browser-safe): real spans go through withSpan() */
44
167
  }
45
168
  //# sourceMappingURL=telemetry.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"telemetry.js","sourceRoot":"","sources":["../src/telemetry.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAUH,IAAI,UAAU,GAAG,KAAK,CAAC;AAEvB;;;GAGG;AACH,MAAM,UAAU,aAAa,CAAC,OAAwB;IACpD,IAAI,CAAC,OAAO,CAAC,OAAO,IAAI,CAAC,OAAO,CAAC,eAAe;QAAE,OAAO;IACzD,UAAU,GAAG,IAAI,CAAC;IAClB,2EAA2E;IAC3E,8DAA8D;AAChE,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,WAAW,CAAC,KAAa,EAAE,MAAc;IACvD,IAAI,CAAC,UAAU;QAAE,OAAO;IACxB,2EAA2E;AAC7E,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,gBAAgB,CAAC,YAAoB,EAAE,cAAsB;IAC3E,IAAI,CAAC,UAAU;QAAE,OAAO;IACxB,2GAA2G;AAC7G,CAAC;AAED,MAAM,UAAU,qBAAqB;IACnC,OAAO,UAAU,CAAC;AACpB,CAAC"}
1
+ {"version":3,"file":"telemetry.js","sourceRoot":"","sources":["../src/telemetry.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,KAAK,IAAI,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAChF,OAAO,EAAE,2BAA2B,EAA+B,MAAM,yBAAyB,CAAC;AA2CnG,6EAA6E;AAC7E,qFAAqF;AACrF,IAAI,cAAc,GAA8B,IAAI,CAAC;AACrD,IAAI,aAAa,GAAyB,IAAI,CAAC;AAE/C,+EAA+E;AAC/E,4CAA4C;AAC5C,MAAM,UAAU,GAAG,2BAA2B,CAAC;AAE/C,SAAS,WAAW,CAAC,GAAqB;IACxC,MAAM,OAAO,GAAG,EAAE,GAAG,CAAC,GAAG,CAAC,OAAO,IAAI,EAAE,CAAC,EAAE,CAAC;IAC3C,IAAI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vD,KAAK,CAAC,IAAI,CAAC,aAAa,CAAC,QAAQ,EAAE,CAAC,KAAK,CAAC,GAAG,EAAE,GAAE,CAAC,CAAC,CAAC,CAAC;IACvD,CAAC;IACD,MAAM,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;IACzB,uEAAuE;IACvE,0EAA0E;IAC1E,IAAI,SAAS;QAAE,SAAS,CAAC,OAAO,EAAE,CAAC;IACnC,IAAI,QAAQ,EAAE,CAAC;QACb,WAAW,CAAC,OAAO,EAAE,CAAC;QACtB,uEAAuE;QACvE,4EAA4E;QAC5E,MAAM,EAAE,cAAc,EAAE,GAAG,MAAM,MAAM,CAAC,gCAAgC,CAAC,CAAC;QAC1E,cAAc,EAAE,CAAC;IACnB,CAAC;IACD,cAAc,GAAG,IAAI,CAAC;IACtB,aAAa,GAAG,IAAI,CAAC;AACvB,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,WAAW,CAAC,KAAa,EAAE,MAAc;IACvD,gEAAgE;AAClE,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,gBAAgB,CAAC,YAAoB,EAAE,cAAsB;IAC3E,4DAA4D;AAC9D,CAAC"}
@@ -1,4 +1,4 @@
1
- import{v as Po,c8 as Lh,aG as Qe,cD as _n,cX as ce,br as bl,cY as V,aM as St,o as si,aO as kt,ct as _l,r as Dt,aQ as Uh,n as Yi,ax as cm,ae as Oh,K as Ih,l as kh,F as dm,bv as hm,ay as Gh,u as fm,cJ as pm,db as z,af as it,cm as xl,ba as cs,bo as Vh,co as Tl,dd as $h,dc as Oe,d6 as k,s as Ge,cd as Ss,aA as vt,bD as It,cZ as ze,a7 as gm,a6 as mm,B as ot,a5 as hs,T as xn,cW as Or,c_ as uo,cI as Zt,t as Ns,bt as ym,S as zh,c9 as bm,cv as vl,i as Wh,ag as _m,aw as xm,aE as Tm,cc as vm,C as Sm,A as Nm,d as Rm,b3 as wm,p as Ws,cO as ht,cr as js,cV as ds,al as st,cS as Ve,a3 as rt,e as jh,ca as Fo,cb as Do,P as Tn,Q as vn,c5 as Jt,c6 as Lo,b_ as Uo,b$ as qh,cT as Hh,cU as Xh,cQ as Sn,cR as Sl,cP as Nl,a0 as Oo,a4 as Kh,R as nn,bq as Hr,j as Em,bs as Am,aP as On,J as qs,a as pn,d3 as Un,bw as Js,d2 as Cm,_ as Rl,$ as wl,E as yu,W as lo,cn as ae,aL as ri,bn as El,aH as dc,bB as Io,d1 as Xr,d5 as Mm,d8 as co,aY as ko,q as Kr,ce as Go,aB as fs,aC as bu,b1 as Yr,b2 as Yh,b0 as xt,be as Qh,a8 as ho,aa as er,X as Zh,as as ii,aq as Al,f as Jh,b4 as ef,aF as hc,b8 as tr,d7 as Bm,cg as tf,cB as nf,bj as sf,bk as rf,bl as of,bm as af,U as uf,V as lf,cy as cf,cx as df,cz as hf,bi as ff,I as Pm,G as Fm,H as Dm,aI as pf,b7 as Nn,a_ as ks,cC as Gs,c as Vs,bb as gn,bf as gf,a9 as mf,ab as yf,Y as bf,at as _f,ar as xf,g as Tf,b5 as vf,bE as Cl,c4 as Qi,bX as Zi,bY as Ji,bZ as eo,c3 as fc,c2 as pc,bW as gc,bV as mc,c0 as _u,c1 as xu,bU as Tu,bx as vu,ci as Su,bC as fo,cl as Nu,bL as Ru,bM as wu,bN as Eu,bO as Au,bP as Cu,bQ as Mu,bR as Bu,bS as Pu,bG as Fu,bH as Du,bI as Lu,bF as Uu,bJ as Ou,bK as Iu,bT as ku,bA as Gu,ck as Vu,bz as po,cj as $u,M as Sf,aT as Lm,aV as Um,aU as Om,aW as Im,aS as km,aR as Gm,az as Vm,bu as $m,cw as zm,cq as Wm,by as jm,D as Vo,cF as Ml,cK as qm,cM as Hm,cL as Xm,a2 as go,bg as Km,ad as Ym,ac as Qm,Z as Zm,au as Jm,av as ey,h as ty,b6 as ny,O as sy,ai as ry,N as iy,ah as oy,ao as ay,cf as uy,d4 as ly,ap as cy,aN as dy,aX as hy,ch as Nf,a1 as Rf,b as fy,aZ as py,a$ as gy,aJ as mo,bd as wf,aK as Ef,m as Af,w as my,k as yy,x as by,cs as _y,bp as xy,y as yo,z as bo,cE as ia,b9 as oa,bc as Ty,bh as vy,aj as Sy,ak as Ny,L as Ry,cA as Bl,aD as wy,an as Ey,am as Ay,d9 as Cy,cu as yc,c7 as My,cp as bc,cN as By,c$ as Py,cH as Cf,cG as Fy,d0 as Dy}from"./three.module-BXIk8GZS.js";import{I as Ly}from"./index-B6UQm9N_.js";import{i as fe,s as Uy,e as Pl,c as Oy,d as Iy,a as ky,b as Gy,f as Vy,t as Mf,g as $y,G as zy,T as _c,E as xc}from"./index-D0Mz0SVt.js";import{o as Wy,h as jy,m as qy}from"./ordinal-DhEzRPdO.js";const Hs=new bl,mn=new ce,Bf=new V,aa=new ce,to=new ce,_o=new V,zu=new V,Pf=new St,Ff=new V,Df=new V;let nt=null,qt=null;const yn=[],$n={NONE:-1,PAN:0,ROTATE:1};class Hy extends Po{constructor(e,t,n=null){super(t,n),this.objects=e,this.recursive=!0,this.transformGroup=!1,this.rotateSpeed=1,this.raycaster=new Lh,this.mouseButtons={LEFT:Qe.PAN,MIDDLE:Qe.PAN,RIGHT:Qe.ROTATE},this.touches={ONE:_n.PAN},this._onPointerMove=Xy.bind(this),this._onPointerDown=Ky.bind(this),this._onPointerCancel=Yy.bind(this),this._onContextMenu=Qy.bind(this),n!==null&&this.connect(n)}connect(e){super.connect(e),this.domElement.addEventListener("pointermove",this._onPointerMove),this.domElement.addEventListener("pointerdown",this._onPointerDown),this.domElement.addEventListener("pointerup",this._onPointerCancel),this.domElement.addEventListener("pointerleave",this._onPointerCancel),this.domElement.addEventListener("contextmenu",this._onContextMenu),this.domElement.style.touchAction="none"}disconnect(){this.domElement.removeEventListener("pointermove",this._onPointerMove),this.domElement.removeEventListener("pointerdown",this._onPointerDown),this.domElement.removeEventListener("pointerup",this._onPointerCancel),this.domElement.removeEventListener("pointerleave",this._onPointerCancel),this.domElement.removeEventListener("contextmenu",this._onContextMenu),this.domElement.style.touchAction="",this.domElement.style.cursor=""}dispose(){this.disconnect()}_updatePointer(e){const t=this.domElement.getBoundingClientRect();mn.x=(e.clientX-t.left)/t.width*2-1,mn.y=-(e.clientY-t.top)/t.height*2+1}_updateState(e){let t;if(e.pointerType==="touch")t=this.touches.ONE;else switch(e.button){case 0:t=this.mouseButtons.LEFT;break;case 1:t=this.mouseButtons.MIDDLE;break;case 2:t=this.mouseButtons.RIGHT;break;default:t=null}switch(t){case Qe.PAN:case _n.PAN:this.state=$n.PAN;break;case Qe.ROTATE:case _n.ROTATE:this.state=$n.ROTATE;break;default:this.state=$n.NONE}}}function Xy(i){const e=this.object,t=this.domElement,n=this.raycaster;if(this.enabled!==!1){if(this._updatePointer(i),n.setFromCamera(mn,e),nt)this.state===$n.PAN?n.ray.intersectPlane(Hs,_o)&&(nt.position.copy(_o.sub(Bf).applyMatrix4(Pf)),this.dispatchEvent({type:"drag",object:nt})):this.state===$n.ROTATE&&(aa.subVectors(mn,to).multiplyScalar(this.rotateSpeed),nt.rotateOnWorldAxis(Ff,aa.x),nt.rotateOnWorldAxis(Df.normalize(),-aa.y),this.dispatchEvent({type:"drag",object:nt})),to.copy(mn);else if(i.pointerType==="mouse"||i.pointerType==="pen")if(yn.length=0,n.setFromCamera(mn,e),n.intersectObjects(this.objects,this.recursive,yn),yn.length>0){const s=yn[0].object;Hs.setFromNormalAndCoplanarPoint(e.getWorldDirection(Hs.normal),zu.setFromMatrixPosition(s.matrixWorld)),qt!==s&&qt!==null&&(this.dispatchEvent({type:"hoveroff",object:qt}),t.style.cursor="auto",qt=null),qt!==s&&(this.dispatchEvent({type:"hoveron",object:s}),t.style.cursor="pointer",qt=s)}else qt!==null&&(this.dispatchEvent({type:"hoveroff",object:qt}),t.style.cursor="auto",qt=null);to.copy(mn)}}function Ky(i){const e=this.object,t=this.domElement,n=this.raycaster;this.enabled!==!1&&(this._updatePointer(i),this._updateState(i),yn.length=0,n.setFromCamera(mn,e),n.intersectObjects(this.objects,this.recursive,yn),yn.length>0&&(this.transformGroup===!0?nt=Lf(yn[0].object):nt=yn[0].object,Hs.setFromNormalAndCoplanarPoint(e.getWorldDirection(Hs.normal),zu.setFromMatrixPosition(nt.matrixWorld)),n.ray.intersectPlane(Hs,_o)&&(this.state===$n.PAN?(Pf.copy(nt.parent.matrixWorld).invert(),Bf.copy(_o).sub(zu.setFromMatrixPosition(nt.matrixWorld)),t.style.cursor="move",this.dispatchEvent({type:"dragstart",object:nt})):this.state===$n.ROTATE&&(Ff.set(0,1,0).applyQuaternion(e.quaternion).normalize(),Df.set(1,0,0).applyQuaternion(e.quaternion).normalize(),t.style.cursor="move",this.dispatchEvent({type:"dragstart",object:nt})))),to.copy(mn))}function Yy(){this.enabled!==!1&&(nt&&(this.dispatchEvent({type:"dragend",object:nt}),nt=null),this.domElement.style.cursor=qt?"pointer":"auto",this.state=$n.NONE)}function Qy(i){this.enabled!==!1&&i.preventDefault()}function Lf(i,e=null){return i.isGroup&&(e=i),i.parent===null?e:Lf(i.parent,e)}function Zy(i){eb(i);const e=Jy(i);return i.on=e.on,i.off=e.off,i.fire=e.fire,i}function Jy(i){let e=Object.create(null);return{on:function(t,n,s){if(typeof n!="function")throw new Error("callback is expected to be a function");let r=e[t];return r||(r=e[t]=[]),r.push({callback:n,ctx:s}),i},off:function(t,n){if(typeof t>"u")return e=Object.create(null),i;if(e[t])if(typeof n!="function")delete e[t];else{const o=e[t];for(let a=0;a<o.length;++a)o[a].callback===n&&o.splice(a,1)}return i},fire:function(t){const n=e[t];if(!n)return i;let s;arguments.length>1&&(s=Array.prototype.slice.call(arguments,1));for(let r=0;r<n.length;++r){const o=n[r];o.callback.apply(o.ctx,s)}return i}}}function eb(i){if(!i)throw new Error("Eventify cannot use falsy object as events subject");const e=["on","fire","off"];for(let t=0;t<e.length;++t)if(i.hasOwnProperty(e[t]))throw new Error("Subject cannot be eventified, since it already has property '"+e[t]+"'")}function tb(i){if(i=i||{},"uniqueLinkId"in i&&(console.warn("ngraph.graph: Starting from version 0.14 `uniqueLinkId` is deprecated.\nUse `multigraph` option instead\n",`
1
+ import{v as Po,c8 as Lh,aG as Qe,cD as _n,cX as ce,br as bl,cY as V,aM as St,o as si,aO as kt,ct as _l,r as Dt,aQ as Uh,n as Yi,ax as cm,ae as Oh,K as Ih,l as kh,F as dm,bv as hm,ay as Gh,u as fm,cJ as pm,db as z,af as it,cm as xl,ba as cs,bo as Vh,co as Tl,dd as $h,dc as Oe,d6 as k,s as Ge,cd as Ss,aA as vt,bD as It,cZ as ze,a7 as gm,a6 as mm,B as ot,a5 as hs,T as xn,cW as Or,c_ as uo,cI as Zt,t as Ns,bt as ym,S as zh,c9 as bm,cv as vl,i as Wh,ag as _m,aw as xm,aE as Tm,cc as vm,C as Sm,A as Nm,d as Rm,b3 as wm,p as Ws,cO as ht,cr as js,cV as ds,al as st,cS as Ve,a3 as rt,e as jh,ca as Fo,cb as Do,P as Tn,Q as vn,c5 as Jt,c6 as Lo,b_ as Uo,b$ as qh,cT as Hh,cU as Xh,cQ as Sn,cR as Sl,cP as Nl,a0 as Oo,a4 as Kh,R as nn,bq as Hr,j as Em,bs as Am,aP as On,J as qs,a as pn,d3 as Un,bw as Js,d2 as Cm,_ as Rl,$ as wl,E as yu,W as lo,cn as ae,aL as ri,bn as El,aH as dc,bB as Io,d1 as Xr,d5 as Mm,d8 as co,aY as ko,q as Kr,ce as Go,aB as fs,aC as bu,b1 as Yr,b2 as Yh,b0 as xt,be as Qh,a8 as ho,aa as er,X as Zh,as as ii,aq as Al,f as Jh,b4 as ef,aF as hc,b8 as tr,d7 as Bm,cg as tf,cB as nf,bj as sf,bk as rf,bl as of,bm as af,U as uf,V as lf,cy as cf,cx as df,cz as hf,bi as ff,I as Pm,G as Fm,H as Dm,aI as pf,b7 as Nn,a_ as ks,cC as Gs,c as Vs,bb as gn,bf as gf,a9 as mf,ab as yf,Y as bf,at as _f,ar as xf,g as Tf,b5 as vf,bE as Cl,c4 as Qi,bX as Zi,bY as Ji,bZ as eo,c3 as fc,c2 as pc,bW as gc,bV as mc,c0 as _u,c1 as xu,bU as Tu,bx as vu,ci as Su,bC as fo,cl as Nu,bL as Ru,bM as wu,bN as Eu,bO as Au,bP as Cu,bQ as Mu,bR as Bu,bS as Pu,bG as Fu,bH as Du,bI as Lu,bF as Uu,bJ as Ou,bK as Iu,bT as ku,bA as Gu,ck as Vu,bz as po,cj as $u,M as Sf,aT as Lm,aV as Um,aU as Om,aW as Im,aS as km,aR as Gm,az as Vm,bu as $m,cw as zm,cq as Wm,by as jm,D as Vo,cF as Ml,cK as qm,cM as Hm,cL as Xm,a2 as go,bg as Km,ad as Ym,ac as Qm,Z as Zm,au as Jm,av as ey,h as ty,b6 as ny,O as sy,ai as ry,N as iy,ah as oy,ao as ay,cf as uy,d4 as ly,ap as cy,aN as dy,aX as hy,ch as Nf,a1 as Rf,b as fy,aZ as py,a$ as gy,aJ as mo,bd as wf,aK as Ef,m as Af,w as my,k as yy,x as by,cs as _y,bp as xy,y as yo,z as bo,cE as ia,b9 as oa,bc as Ty,bh as vy,aj as Sy,ak as Ny,L as Ry,cA as Bl,aD as wy,an as Ey,am as Ay,d9 as Cy,cu as yc,c7 as My,cp as bc,cN as By,c$ as Py,cH as Cf,cG as Fy,d0 as Dy}from"./three.module-BXIk8GZS.js";import{V as Ly}from"./index-2Gzrk1k3.js";import{i as fe,s as Uy,e as Pl,c as Oy,d as Iy,a as ky,b as Gy,f as Vy,t as Mf,g as $y,G as zy,T as _c,E as xc}from"./index-BrxEjqsW.js";import{o as Wy,h as jy,m as qy}from"./ordinal-DhEzRPdO.js";const Hs=new bl,mn=new ce,Bf=new V,aa=new ce,to=new ce,_o=new V,zu=new V,Pf=new St,Ff=new V,Df=new V;let nt=null,qt=null;const yn=[],$n={NONE:-1,PAN:0,ROTATE:1};class Hy extends Po{constructor(e,t,n=null){super(t,n),this.objects=e,this.recursive=!0,this.transformGroup=!1,this.rotateSpeed=1,this.raycaster=new Lh,this.mouseButtons={LEFT:Qe.PAN,MIDDLE:Qe.PAN,RIGHT:Qe.ROTATE},this.touches={ONE:_n.PAN},this._onPointerMove=Xy.bind(this),this._onPointerDown=Ky.bind(this),this._onPointerCancel=Yy.bind(this),this._onContextMenu=Qy.bind(this),n!==null&&this.connect(n)}connect(e){super.connect(e),this.domElement.addEventListener("pointermove",this._onPointerMove),this.domElement.addEventListener("pointerdown",this._onPointerDown),this.domElement.addEventListener("pointerup",this._onPointerCancel),this.domElement.addEventListener("pointerleave",this._onPointerCancel),this.domElement.addEventListener("contextmenu",this._onContextMenu),this.domElement.style.touchAction="none"}disconnect(){this.domElement.removeEventListener("pointermove",this._onPointerMove),this.domElement.removeEventListener("pointerdown",this._onPointerDown),this.domElement.removeEventListener("pointerup",this._onPointerCancel),this.domElement.removeEventListener("pointerleave",this._onPointerCancel),this.domElement.removeEventListener("contextmenu",this._onContextMenu),this.domElement.style.touchAction="",this.domElement.style.cursor=""}dispose(){this.disconnect()}_updatePointer(e){const t=this.domElement.getBoundingClientRect();mn.x=(e.clientX-t.left)/t.width*2-1,mn.y=-(e.clientY-t.top)/t.height*2+1}_updateState(e){let t;if(e.pointerType==="touch")t=this.touches.ONE;else switch(e.button){case 0:t=this.mouseButtons.LEFT;break;case 1:t=this.mouseButtons.MIDDLE;break;case 2:t=this.mouseButtons.RIGHT;break;default:t=null}switch(t){case Qe.PAN:case _n.PAN:this.state=$n.PAN;break;case Qe.ROTATE:case _n.ROTATE:this.state=$n.ROTATE;break;default:this.state=$n.NONE}}}function Xy(i){const e=this.object,t=this.domElement,n=this.raycaster;if(this.enabled!==!1){if(this._updatePointer(i),n.setFromCamera(mn,e),nt)this.state===$n.PAN?n.ray.intersectPlane(Hs,_o)&&(nt.position.copy(_o.sub(Bf).applyMatrix4(Pf)),this.dispatchEvent({type:"drag",object:nt})):this.state===$n.ROTATE&&(aa.subVectors(mn,to).multiplyScalar(this.rotateSpeed),nt.rotateOnWorldAxis(Ff,aa.x),nt.rotateOnWorldAxis(Df.normalize(),-aa.y),this.dispatchEvent({type:"drag",object:nt})),to.copy(mn);else if(i.pointerType==="mouse"||i.pointerType==="pen")if(yn.length=0,n.setFromCamera(mn,e),n.intersectObjects(this.objects,this.recursive,yn),yn.length>0){const s=yn[0].object;Hs.setFromNormalAndCoplanarPoint(e.getWorldDirection(Hs.normal),zu.setFromMatrixPosition(s.matrixWorld)),qt!==s&&qt!==null&&(this.dispatchEvent({type:"hoveroff",object:qt}),t.style.cursor="auto",qt=null),qt!==s&&(this.dispatchEvent({type:"hoveron",object:s}),t.style.cursor="pointer",qt=s)}else qt!==null&&(this.dispatchEvent({type:"hoveroff",object:qt}),t.style.cursor="auto",qt=null);to.copy(mn)}}function Ky(i){const e=this.object,t=this.domElement,n=this.raycaster;this.enabled!==!1&&(this._updatePointer(i),this._updateState(i),yn.length=0,n.setFromCamera(mn,e),n.intersectObjects(this.objects,this.recursive,yn),yn.length>0&&(this.transformGroup===!0?nt=Lf(yn[0].object):nt=yn[0].object,Hs.setFromNormalAndCoplanarPoint(e.getWorldDirection(Hs.normal),zu.setFromMatrixPosition(nt.matrixWorld)),n.ray.intersectPlane(Hs,_o)&&(this.state===$n.PAN?(Pf.copy(nt.parent.matrixWorld).invert(),Bf.copy(_o).sub(zu.setFromMatrixPosition(nt.matrixWorld)),t.style.cursor="move",this.dispatchEvent({type:"dragstart",object:nt})):this.state===$n.ROTATE&&(Ff.set(0,1,0).applyQuaternion(e.quaternion).normalize(),Df.set(1,0,0).applyQuaternion(e.quaternion).normalize(),t.style.cursor="move",this.dispatchEvent({type:"dragstart",object:nt})))),to.copy(mn))}function Yy(){this.enabled!==!1&&(nt&&(this.dispatchEvent({type:"dragend",object:nt}),nt=null),this.domElement.style.cursor=qt?"pointer":"auto",this.state=$n.NONE)}function Qy(i){this.enabled!==!1&&i.preventDefault()}function Lf(i,e=null){return i.isGroup&&(e=i),i.parent===null?e:Lf(i.parent,e)}function Zy(i){eb(i);const e=Jy(i);return i.on=e.on,i.off=e.off,i.fire=e.fire,i}function Jy(i){let e=Object.create(null);return{on:function(t,n,s){if(typeof n!="function")throw new Error("callback is expected to be a function");let r=e[t];return r||(r=e[t]=[]),r.push({callback:n,ctx:s}),i},off:function(t,n){if(typeof t>"u")return e=Object.create(null),i;if(e[t])if(typeof n!="function")delete e[t];else{const o=e[t];for(let a=0;a<o.length;++a)o[a].callback===n&&o.splice(a,1)}return i},fire:function(t){const n=e[t];if(!n)return i;let s;arguments.length>1&&(s=Array.prototype.slice.call(arguments,1));for(let r=0;r<n.length;++r){const o=n[r];o.callback.apply(o.ctx,s)}return i}}}function eb(i){if(!i)throw new Error("Eventify cannot use falsy object as events subject");const e=["on","fire","off"];for(let t=0;t<e.length;++t)if(i.hasOwnProperty(e[t]))throw new Error("Subject cannot be eventified, since it already has property '"+e[t]+"'")}function tb(i){if(i=i||{},"uniqueLinkId"in i&&(console.warn("ngraph.graph: Starting from version 0.14 `uniqueLinkId` is deprecated.\nUse `multigraph` option instead\n",`
2
2
  `,`Note: there is also change in default behavior: From now on each graph
3
3
  is considered to be not a multigraph by default (each edge is unique).`),i.multigraph=i.uniqueLinkId),i.multigraph===void 0&&(i.multigraph=!1),typeof Map!="function")throw new Error("ngraph.graph requires `Map` to be defined. Please polyfill it before using ngraph");var e=new Map,t=new Map,n={},s=0,r=i.multigraph?S:T,o=[],a=F,u=F,l=F,c=F,d={version:20,addNode:g,addLink:_,removeLink:P,removeNode:y,getNode:m,getNodeCount:N,getLinkCount:R,getEdgeCount:R,getLinksCount:R,getNodesCount:N,getLinks:v,forEachNode:ve,forEachLinkedNode:se,forEachLink:re,beginUpdate:l,endUpdate:c,clear:ee,hasLink:L,hasNode:m,getLink:L,getLinkById:j};return Zy(d),h(),d;function h(){var I=d.on;d.on=H;function H(){return d.beginUpdate=l=G,d.endUpdate=c=Q,a=f,u=p,d.on=I,I.apply(d,arguments)}}function f(I,H){o.push({link:I,changeType:H})}function p(I,H){o.push({node:I,changeType:H})}function g(I,H){if(I===void 0)throw new Error("Invalid node identifier");l();var le=m(I);return le?(le.data=H,u(le,"update")):(le=new nb(I,H),u(le,"add")),e.set(I,le),c(),le}function m(I){return e.get(I)}function y(I){var H=m(I);if(!H)return!1;l();var le=H.links;return le&&(le.forEach(D),H.links=null),e.delete(I),u(H,"remove"),c(),!0}function _(I,H,le){l();var Ce=m(I)||g(I),B=m(H)||g(H),U=r(I,H,le),K=t.has(U.id);return t.set(U.id,U),Tc(Ce,U),I!==H&&Tc(B,U),a(U,K?"update":"add"),c(),U}function T(I,H,le){var Ce=hi(I,H),B=t.get(Ce);return B?(B.data=le,B):new vc(I,H,le,Ce)}function S(I,H,le){var Ce=hi(I,H),B=n.hasOwnProperty(Ce);if(B||L(I,H)){B||(n[Ce]=0);var U="@"+ ++n[Ce];Ce=hi(I+U,H+U)}return new vc(I,H,le,Ce)}function N(){return e.size}function R(){return t.size}function v(I){var H=m(I);return H?H.links:null}function P(I,H){return H!==void 0&&(I=L(I,H)),D(I)}function D(I){if(!I||!t.get(I.id))return!1;l(),t.delete(I.id);var H=m(I.fromId),le=m(I.toId);return H&&H.links.delete(I),le&&le.links.delete(I),a(I,"remove"),c(),!0}function L(I,H){if(!(I===void 0||H===void 0))return t.get(hi(I,H))}function j(I){if(I!==void 0)return t.get(I)}function ee(){l(),ve(function(I){y(I.id)}),c()}function re(I){if(typeof I=="function")for(var H=t.values(),le=H.next();!le.done;){if(I(le.value))return!0;le=H.next()}}function se(I,H,le){var Ce=m(I);if(Ce&&Ce.links&&typeof H=="function")return le?oe(Ce.links,I,H):Z(Ce.links,I,H)}function Z(I,H,le){for(var Ce,B=I.values(),U=B.next();!U.done;){var K=U.value,me=K.fromId===H?K.toId:K.fromId;if(Ce=le(e.get(me),K),Ce)return!0;U=B.next()}}function oe(I,H,le){for(var Ce,B=I.values(),U=B.next();!U.done;){var K=U.value;if(K.fromId===H&&(Ce=le(e.get(K.toId),K),Ce))return!0;U=B.next()}}function F(){}function G(){s+=1}function Q(){s-=1,s===0&&o.length>0&&(d.fire("changed",o),o.length=0)}function ve(I){if(typeof I!="function")throw new Error("Function is expected to iterate over graph nodes. You passed "+I);for(var H=e.values(),le=H.next();!le.done;){if(I(le.value))return!0;le=H.next()}}}function nb(i,e){this.id=i,this.links=null,this.data=e}function Tc(i,e){i.links?i.links.add(e):i.links=new Set([e])}function vc(i,e,t,n){this.fromId=i,this.toId=e,this.data=t,this.id=n}function hi(i,e){return i.toString()+"👉 "+e.toString()}var fi={exports:{}},Cs={exports:{}},ua,Sc;function Uf(){return Sc||(Sc=1,ua=function(e){return e===0?"x":e===1?"y":e===2?"z":"c"+(e+1)}),ua}var la,Nc;function ar(){if(Nc)return la;Nc=1;const i=Uf();return la=function(t){return n;function n(s,r){let o=r&&r.indent||0,a=r&&r.join!==void 0?r.join:`
4
4
  `,u=Array(o+1).join(" "),l=[];for(let c=0;c<t;++c){let d=i(c),h=c===0?"":u;l.push(h+s.replace(/{var}/g,d))}return l.join(a)}},la}var Rc;function sb(){if(Rc)return Cs.exports;Rc=1;const i=ar();Cs.exports=e,Cs.exports.generateCreateBodyFunctionBody=t,Cs.exports.getVectorCode=s,Cs.exports.getBodyCode=n;function e(r,o){let a=t(r,o),{Body:u}=new Function(a)();return u}function t(r,o){return`