@genome-spy/inspector 0.79.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.
@@ -0,0 +1,1619 @@
1
+ //#region ../../node_modules/@lit/reactive-element/css-tag.js
2
+ var e = globalThis, t = e.ShadowRoot && (e.ShadyCSS === void 0 || e.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, n = Symbol(), r = /* @__PURE__ */ new WeakMap(), i = class {
3
+ constructor(e, t, r) {
4
+ if (this._$cssResult$ = !0, r !== n) throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");
5
+ this.cssText = e, this.t = t;
6
+ }
7
+ get styleSheet() {
8
+ let e = this.o, n = this.t;
9
+ if (t && e === void 0) {
10
+ let t = n !== void 0 && n.length === 1;
11
+ t && (e = r.get(n)), e === void 0 && ((this.o = e = new CSSStyleSheet()).replaceSync(this.cssText), t && r.set(n, e));
12
+ }
13
+ return e;
14
+ }
15
+ toString() {
16
+ return this.cssText;
17
+ }
18
+ }, a = (e) => new i(typeof e == "string" ? e : e + "", void 0, n), o = (e, ...t) => new i(e.length === 1 ? e[0] : t.reduce((t, n, r) => t + ((e) => {
19
+ if (!0 === e._$cssResult$) return e.cssText;
20
+ if (typeof e == "number") return e;
21
+ throw Error("Value passed to 'css' function must be a 'css' function result: " + e + ". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.");
22
+ })(n) + e[r + 1], e[0]), e, n), s = (n, r) => {
23
+ if (t) n.adoptedStyleSheets = r.map((e) => e instanceof CSSStyleSheet ? e : e.styleSheet);
24
+ else for (let t of r) {
25
+ let r = document.createElement("style"), i = e.litNonce;
26
+ i !== void 0 && r.setAttribute("nonce", i), r.textContent = t.cssText, n.appendChild(r);
27
+ }
28
+ }, c = t ? (e) => e : (e) => e instanceof CSSStyleSheet ? ((e) => {
29
+ let t = "";
30
+ for (let n of e.cssRules) t += n.cssText;
31
+ return a(t);
32
+ })(e) : e, { is: l, defineProperty: u, getOwnPropertyDescriptor: d, getOwnPropertyNames: ee, getOwnPropertySymbols: te, getPrototypeOf: ne } = Object, f = globalThis, p = f.trustedTypes, re = p ? p.emptyScript : "", ie = f.reactiveElementPolyfillSupport, m = (e, t) => e, h = {
33
+ toAttribute(e, t) {
34
+ switch (t) {
35
+ case Boolean:
36
+ e = e ? re : null;
37
+ break;
38
+ case Object:
39
+ case Array: e = e == null ? e : JSON.stringify(e);
40
+ }
41
+ return e;
42
+ },
43
+ fromAttribute(e, t) {
44
+ let n = e;
45
+ switch (t) {
46
+ case Boolean:
47
+ n = e !== null;
48
+ break;
49
+ case Number:
50
+ n = e === null ? null : Number(e);
51
+ break;
52
+ case Object:
53
+ case Array: try {
54
+ n = JSON.parse(e);
55
+ } catch {
56
+ n = null;
57
+ }
58
+ }
59
+ return n;
60
+ }
61
+ }, ae = (e, t) => !l(e, t), g = {
62
+ attribute: !0,
63
+ type: String,
64
+ converter: h,
65
+ reflect: !1,
66
+ useDefault: !1,
67
+ hasChanged: ae
68
+ };
69
+ Symbol.metadata ??= Symbol("metadata"), f.litPropertyMetadata ??= /* @__PURE__ */ new WeakMap();
70
+ var _ = class extends HTMLElement {
71
+ static addInitializer(e) {
72
+ this._$Ei(), (this.l ??= []).push(e);
73
+ }
74
+ static get observedAttributes() {
75
+ return this.finalize(), this._$Eh && [...this._$Eh.keys()];
76
+ }
77
+ static createProperty(e, t = g) {
78
+ if (t.state && (t.attribute = !1), this._$Ei(), this.prototype.hasOwnProperty(e) && ((t = Object.create(t)).wrapped = !0), this.elementProperties.set(e, t), !t.noAccessor) {
79
+ let n = Symbol(), r = this.getPropertyDescriptor(e, n, t);
80
+ r !== void 0 && u(this.prototype, e, r);
81
+ }
82
+ }
83
+ static getPropertyDescriptor(e, t, n) {
84
+ let { get: r, set: i } = d(this.prototype, e) ?? {
85
+ get() {
86
+ return this[t];
87
+ },
88
+ set(e) {
89
+ this[t] = e;
90
+ }
91
+ };
92
+ return {
93
+ get: r,
94
+ set(t) {
95
+ let a = r?.call(this);
96
+ i?.call(this, t), this.requestUpdate(e, a, n);
97
+ },
98
+ configurable: !0,
99
+ enumerable: !0
100
+ };
101
+ }
102
+ static getPropertyOptions(e) {
103
+ return this.elementProperties.get(e) ?? g;
104
+ }
105
+ static _$Ei() {
106
+ if (this.hasOwnProperty(m("elementProperties"))) return;
107
+ let e = ne(this);
108
+ e.finalize(), e.l !== void 0 && (this.l = [...e.l]), this.elementProperties = new Map(e.elementProperties);
109
+ }
110
+ static finalize() {
111
+ if (this.hasOwnProperty(m("finalized"))) return;
112
+ if (this.finalized = !0, this._$Ei(), this.hasOwnProperty(m("properties"))) {
113
+ let e = this.properties, t = [...ee(e), ...te(e)];
114
+ for (let n of t) this.createProperty(n, e[n]);
115
+ }
116
+ let e = this[Symbol.metadata];
117
+ if (e !== null) {
118
+ let t = litPropertyMetadata.get(e);
119
+ if (t !== void 0) for (let [e, n] of t) this.elementProperties.set(e, n);
120
+ }
121
+ this._$Eh = /* @__PURE__ */ new Map();
122
+ for (let [e, t] of this.elementProperties) {
123
+ let n = this._$Eu(e, t);
124
+ n !== void 0 && this._$Eh.set(n, e);
125
+ }
126
+ this.elementStyles = this.finalizeStyles(this.styles);
127
+ }
128
+ static finalizeStyles(e) {
129
+ let t = [];
130
+ if (Array.isArray(e)) {
131
+ let n = new Set(e.flat(Infinity).reverse());
132
+ for (let e of n) t.unshift(c(e));
133
+ } else e !== void 0 && t.push(c(e));
134
+ return t;
135
+ }
136
+ static _$Eu(e, t) {
137
+ let n = t.attribute;
138
+ return !1 === n ? void 0 : typeof n == "string" ? n : typeof e == "string" ? e.toLowerCase() : void 0;
139
+ }
140
+ constructor() {
141
+ super(), this._$Ep = void 0, this.isUpdatePending = !1, this.hasUpdated = !1, this._$Em = null, this._$Ev();
142
+ }
143
+ _$Ev() {
144
+ this._$ES = new Promise((e) => this.enableUpdating = e), this._$AL = /* @__PURE__ */ new Map(), this._$E_(), this.requestUpdate(), this.constructor.l?.forEach((e) => e(this));
145
+ }
146
+ addController(e) {
147
+ (this._$EO ??= /* @__PURE__ */ new Set()).add(e), this.renderRoot !== void 0 && this.isConnected && e.hostConnected?.();
148
+ }
149
+ removeController(e) {
150
+ this._$EO?.delete(e);
151
+ }
152
+ _$E_() {
153
+ let e = /* @__PURE__ */ new Map(), t = this.constructor.elementProperties;
154
+ for (let n of t.keys()) this.hasOwnProperty(n) && (e.set(n, this[n]), delete this[n]);
155
+ e.size > 0 && (this._$Ep = e);
156
+ }
157
+ createRenderRoot() {
158
+ let e = this.shadowRoot ?? this.attachShadow(this.constructor.shadowRootOptions);
159
+ return s(e, this.constructor.elementStyles), e;
160
+ }
161
+ connectedCallback() {
162
+ this.renderRoot ??= this.createRenderRoot(), this.enableUpdating(!0), this._$EO?.forEach((e) => e.hostConnected?.());
163
+ }
164
+ enableUpdating(e) {}
165
+ disconnectedCallback() {
166
+ this._$EO?.forEach((e) => e.hostDisconnected?.());
167
+ }
168
+ attributeChangedCallback(e, t, n) {
169
+ this._$AK(e, n);
170
+ }
171
+ _$ET(e, t) {
172
+ let n = this.constructor.elementProperties.get(e), r = this.constructor._$Eu(e, n);
173
+ if (r !== void 0 && !0 === n.reflect) {
174
+ let i = (n.converter?.toAttribute === void 0 ? h : n.converter).toAttribute(t, n.type);
175
+ this._$Em = e, i == null ? this.removeAttribute(r) : this.setAttribute(r, i), this._$Em = null;
176
+ }
177
+ }
178
+ _$AK(e, t) {
179
+ let n = this.constructor, r = n._$Eh.get(e);
180
+ if (r !== void 0 && this._$Em !== r) {
181
+ let e = n.getPropertyOptions(r), i = typeof e.converter == "function" ? { fromAttribute: e.converter } : e.converter?.fromAttribute === void 0 ? h : e.converter;
182
+ this._$Em = r;
183
+ let a = i.fromAttribute(t, e.type);
184
+ this[r] = a ?? this._$Ej?.get(r) ?? a, this._$Em = null;
185
+ }
186
+ }
187
+ requestUpdate(e, t, n, r = !1, i) {
188
+ if (e !== void 0) {
189
+ let a = this.constructor;
190
+ if (!1 === r && (i = this[e]), n ??= a.getPropertyOptions(e), !((n.hasChanged ?? ae)(i, t) || n.useDefault && n.reflect && i === this._$Ej?.get(e) && !this.hasAttribute(a._$Eu(e, n)))) return;
191
+ this.C(e, t, n);
192
+ }
193
+ !1 === this.isUpdatePending && (this._$ES = this._$EP());
194
+ }
195
+ C(e, t, { useDefault: n, reflect: r, wrapped: i }, a) {
196
+ n && !(this._$Ej ??= /* @__PURE__ */ new Map()).has(e) && (this._$Ej.set(e, a ?? t ?? this[e]), !0 !== i || a !== void 0) || (this._$AL.has(e) || (this.hasUpdated || n || (t = void 0), this._$AL.set(e, t)), !0 === r && this._$Em !== e && (this._$Eq ??= /* @__PURE__ */ new Set()).add(e));
197
+ }
198
+ async _$EP() {
199
+ this.isUpdatePending = !0;
200
+ try {
201
+ await this._$ES;
202
+ } catch (e) {
203
+ Promise.reject(e);
204
+ }
205
+ let e = this.scheduleUpdate();
206
+ return e != null && await e, !this.isUpdatePending;
207
+ }
208
+ scheduleUpdate() {
209
+ return this.performUpdate();
210
+ }
211
+ performUpdate() {
212
+ if (!this.isUpdatePending) return;
213
+ if (!this.hasUpdated) {
214
+ if (this.renderRoot ??= this.createRenderRoot(), this._$Ep) {
215
+ for (let [e, t] of this._$Ep) this[e] = t;
216
+ this._$Ep = void 0;
217
+ }
218
+ let e = this.constructor.elementProperties;
219
+ if (e.size > 0) for (let [t, n] of e) {
220
+ let { wrapped: e } = n, r = this[t];
221
+ !0 !== e || this._$AL.has(t) || r === void 0 || this.C(t, void 0, n, r);
222
+ }
223
+ }
224
+ let e = !1, t = this._$AL;
225
+ try {
226
+ e = this.shouldUpdate(t), e ? (this.willUpdate(t), this._$EO?.forEach((e) => e.hostUpdate?.()), this.update(t)) : this._$EM();
227
+ } catch (t) {
228
+ throw e = !1, this._$EM(), t;
229
+ }
230
+ e && this._$AE(t);
231
+ }
232
+ willUpdate(e) {}
233
+ _$AE(e) {
234
+ this._$EO?.forEach((e) => e.hostUpdated?.()), this.hasUpdated || (this.hasUpdated = !0, this.firstUpdated(e)), this.updated(e);
235
+ }
236
+ _$EM() {
237
+ this._$AL = /* @__PURE__ */ new Map(), this.isUpdatePending = !1;
238
+ }
239
+ get updateComplete() {
240
+ return this.getUpdateComplete();
241
+ }
242
+ getUpdateComplete() {
243
+ return this._$ES;
244
+ }
245
+ shouldUpdate(e) {
246
+ return !0;
247
+ }
248
+ update(e) {
249
+ this._$Eq &&= this._$Eq.forEach((e) => this._$ET(e, this[e])), this._$EM();
250
+ }
251
+ updated(e) {}
252
+ firstUpdated(e) {}
253
+ };
254
+ _.elementStyles = [], _.shadowRootOptions = { mode: "open" }, _[m("elementProperties")] = /* @__PURE__ */ new Map(), _[m("finalized")] = /* @__PURE__ */ new Map(), ie?.({ ReactiveElement: _ }), (f.reactiveElementVersions ??= []).push("2.1.2");
255
+ //#endregion
256
+ //#region ../../node_modules/lit-html/lit-html.js
257
+ var v = globalThis, y = (e) => e, b = v.trustedTypes, x = b ? b.createPolicy("lit-html", { createHTML: (e) => e }) : void 0, S = "$lit$", C = `lit$${Math.random().toFixed(9).slice(2)}$`, w = "?" + C, oe = `<${w}>`, T = document, E = () => T.createComment(""), D = (e) => e === null || typeof e != "object" && typeof e != "function", O = Array.isArray, se = (e) => O(e) || typeof e?.[Symbol.iterator] == "function", k = "[ \n\f\r]", A = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, j = /-->/g, M = />/g, N = RegExp(`>|${k}(?:([^\\s"'>=/]+)(${k}*=${k}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`, "g"), P = /'/g, F = /"/g, I = /^(?:script|style|textarea|title)$/i, L = ((e) => (t, ...n) => ({
258
+ _$litType$: e,
259
+ strings: t,
260
+ values: n
261
+ }))(1), R = Symbol.for("lit-noChange"), z = Symbol.for("lit-nothing"), B = /* @__PURE__ */ new WeakMap(), V = T.createTreeWalker(T, 129);
262
+ function H(e, t) {
263
+ if (!O(e) || !e.hasOwnProperty("raw")) throw Error("invalid template strings array");
264
+ return x === void 0 ? t : x.createHTML(t);
265
+ }
266
+ var ce = (e, t) => {
267
+ let n = e.length - 1, r = [], i, a = t === 2 ? "<svg>" : t === 3 ? "<math>" : "", o = A;
268
+ for (let t = 0; t < n; t++) {
269
+ let n = e[t], s, c, l = -1, u = 0;
270
+ for (; u < n.length && (o.lastIndex = u, c = o.exec(n), c !== null);) u = o.lastIndex, o === A ? c[1] === "!--" ? o = j : c[1] === void 0 ? c[2] === void 0 ? c[3] !== void 0 && (o = N) : (I.test(c[2]) && (i = RegExp("</" + c[2], "g")), o = N) : o = M : o === N ? c[0] === ">" ? (o = i ?? A, l = -1) : c[1] === void 0 ? l = -2 : (l = o.lastIndex - c[2].length, s = c[1], o = c[3] === void 0 ? N : c[3] === "\"" ? F : P) : o === F || o === P ? o = N : o === j || o === M ? o = A : (o = N, i = void 0);
271
+ let d = o === N && e[t + 1].startsWith("/>") ? " " : "";
272
+ a += o === A ? n + oe : l >= 0 ? (r.push(s), n.slice(0, l) + S + n.slice(l) + C + d) : n + C + (l === -2 ? t : d);
273
+ }
274
+ return [H(e, a + (e[n] || "<?>") + (t === 2 ? "</svg>" : t === 3 ? "</math>" : "")), r];
275
+ }, U = class e {
276
+ constructor({ strings: t, _$litType$: n }, r) {
277
+ let i;
278
+ this.parts = [];
279
+ let a = 0, o = 0, s = t.length - 1, c = this.parts, [l, u] = ce(t, n);
280
+ if (this.el = e.createElement(l, r), V.currentNode = this.el.content, n === 2 || n === 3) {
281
+ let e = this.el.content.firstChild;
282
+ e.replaceWith(...e.childNodes);
283
+ }
284
+ for (; (i = V.nextNode()) !== null && c.length < s;) {
285
+ if (i.nodeType === 1) {
286
+ if (i.hasAttributes()) for (let e of i.getAttributeNames()) if (e.endsWith(S)) {
287
+ let t = u[o++], n = i.getAttribute(e).split(C), r = /([.?@])?(.*)/.exec(t);
288
+ c.push({
289
+ type: 1,
290
+ index: a,
291
+ name: r[2],
292
+ strings: n,
293
+ ctor: r[1] === "." ? ue : r[1] === "?" ? de : r[1] === "@" ? fe : K
294
+ }), i.removeAttribute(e);
295
+ } else e.startsWith(C) && (c.push({
296
+ type: 6,
297
+ index: a
298
+ }), i.removeAttribute(e));
299
+ if (I.test(i.tagName)) {
300
+ let e = i.textContent.split(C), t = e.length - 1;
301
+ if (t > 0) {
302
+ i.textContent = b ? b.emptyScript : "";
303
+ for (let n = 0; n < t; n++) i.append(e[n], E()), V.nextNode(), c.push({
304
+ type: 2,
305
+ index: ++a
306
+ });
307
+ i.append(e[t], E());
308
+ }
309
+ }
310
+ } else if (i.nodeType === 8) if (i.data === w) c.push({
311
+ type: 2,
312
+ index: a
313
+ });
314
+ else {
315
+ let e = -1;
316
+ for (; (e = i.data.indexOf(C, e + 1)) !== -1;) c.push({
317
+ type: 7,
318
+ index: a
319
+ }), e += C.length - 1;
320
+ }
321
+ a++;
322
+ }
323
+ }
324
+ static createElement(e, t) {
325
+ let n = T.createElement("template");
326
+ return n.innerHTML = e, n;
327
+ }
328
+ };
329
+ function W(e, t, n = e, r) {
330
+ if (t === R) return t;
331
+ let i = r === void 0 ? n._$Cl : n._$Co?.[r], a = D(t) ? void 0 : t._$litDirective$;
332
+ return i?.constructor !== a && (i?._$AO?.(!1), a === void 0 ? i = void 0 : (i = new a(e), i._$AT(e, n, r)), r === void 0 ? n._$Cl = i : (n._$Co ??= [])[r] = i), i !== void 0 && (t = W(e, i._$AS(e, t.values), i, r)), t;
333
+ }
334
+ var le = class {
335
+ constructor(e, t) {
336
+ this._$AV = [], this._$AN = void 0, this._$AD = e, this._$AM = t;
337
+ }
338
+ get parentNode() {
339
+ return this._$AM.parentNode;
340
+ }
341
+ get _$AU() {
342
+ return this._$AM._$AU;
343
+ }
344
+ u(e) {
345
+ let { el: { content: t }, parts: n } = this._$AD, r = (e?.creationScope ?? T).importNode(t, !0);
346
+ V.currentNode = r;
347
+ let i = V.nextNode(), a = 0, o = 0, s = n[0];
348
+ for (; s !== void 0;) {
349
+ if (a === s.index) {
350
+ let t;
351
+ s.type === 2 ? t = new G(i, i.nextSibling, this, e) : s.type === 1 ? t = new s.ctor(i, s.name, s.strings, this, e) : s.type === 6 && (t = new pe(i, this, e)), this._$AV.push(t), s = n[++o];
352
+ }
353
+ a !== s?.index && (i = V.nextNode(), a++);
354
+ }
355
+ return V.currentNode = T, r;
356
+ }
357
+ p(e) {
358
+ let t = 0;
359
+ for (let n of this._$AV) n !== void 0 && (n.strings === void 0 ? n._$AI(e[t]) : (n._$AI(e, n, t), t += n.strings.length - 2)), t++;
360
+ }
361
+ }, G = class e {
362
+ get _$AU() {
363
+ return this._$AM?._$AU ?? this._$Cv;
364
+ }
365
+ constructor(e, t, n, r) {
366
+ this.type = 2, this._$AH = z, this._$AN = void 0, this._$AA = e, this._$AB = t, this._$AM = n, this.options = r, this._$Cv = r?.isConnected ?? !0;
367
+ }
368
+ get parentNode() {
369
+ let e = this._$AA.parentNode, t = this._$AM;
370
+ return t !== void 0 && e?.nodeType === 11 && (e = t.parentNode), e;
371
+ }
372
+ get startNode() {
373
+ return this._$AA;
374
+ }
375
+ get endNode() {
376
+ return this._$AB;
377
+ }
378
+ _$AI(e, t = this) {
379
+ e = W(this, e, t), D(e) ? e === z || e == null || e === "" ? (this._$AH !== z && this._$AR(), this._$AH = z) : e !== this._$AH && e !== R && this._(e) : e._$litType$ === void 0 ? e.nodeType === void 0 ? se(e) ? this.k(e) : this._(e) : this.T(e) : this.$(e);
380
+ }
381
+ O(e) {
382
+ return this._$AA.parentNode.insertBefore(e, this._$AB);
383
+ }
384
+ T(e) {
385
+ this._$AH !== e && (this._$AR(), this._$AH = this.O(e));
386
+ }
387
+ _(e) {
388
+ this._$AH !== z && D(this._$AH) ? this._$AA.nextSibling.data = e : this.T(T.createTextNode(e)), this._$AH = e;
389
+ }
390
+ $(e) {
391
+ let { values: t, _$litType$: n } = e, r = typeof n == "number" ? this._$AC(e) : (n.el === void 0 && (n.el = U.createElement(H(n.h, n.h[0]), this.options)), n);
392
+ if (this._$AH?._$AD === r) this._$AH.p(t);
393
+ else {
394
+ let e = new le(r, this), n = e.u(this.options);
395
+ e.p(t), this.T(n), this._$AH = e;
396
+ }
397
+ }
398
+ _$AC(e) {
399
+ let t = B.get(e.strings);
400
+ return t === void 0 && B.set(e.strings, t = new U(e)), t;
401
+ }
402
+ k(t) {
403
+ O(this._$AH) || (this._$AH = [], this._$AR());
404
+ let n = this._$AH, r, i = 0;
405
+ for (let a of t) i === n.length ? n.push(r = new e(this.O(E()), this.O(E()), this, this.options)) : r = n[i], r._$AI(a), i++;
406
+ i < n.length && (this._$AR(r && r._$AB.nextSibling, i), n.length = i);
407
+ }
408
+ _$AR(e = this._$AA.nextSibling, t) {
409
+ for (this._$AP?.(!1, !0, t); e !== this._$AB;) {
410
+ let t = y(e).nextSibling;
411
+ y(e).remove(), e = t;
412
+ }
413
+ }
414
+ setConnected(e) {
415
+ this._$AM === void 0 && (this._$Cv = e, this._$AP?.(e));
416
+ }
417
+ }, K = class {
418
+ get tagName() {
419
+ return this.element.tagName;
420
+ }
421
+ get _$AU() {
422
+ return this._$AM._$AU;
423
+ }
424
+ constructor(e, t, n, r, i) {
425
+ this.type = 1, this._$AH = z, this._$AN = void 0, this.element = e, this.name = t, this._$AM = r, this.options = i, n.length > 2 || n[0] !== "" || n[1] !== "" ? (this._$AH = Array(n.length - 1).fill(/* @__PURE__ */ new String()), this.strings = n) : this._$AH = z;
426
+ }
427
+ _$AI(e, t = this, n, r) {
428
+ let i = this.strings, a = !1;
429
+ if (i === void 0) e = W(this, e, t, 0), a = !D(e) || e !== this._$AH && e !== R, a && (this._$AH = e);
430
+ else {
431
+ let r = e, o, s;
432
+ for (e = i[0], o = 0; o < i.length - 1; o++) s = W(this, r[n + o], t, o), s === R && (s = this._$AH[o]), a ||= !D(s) || s !== this._$AH[o], s === z ? e = z : e !== z && (e += (s ?? "") + i[o + 1]), this._$AH[o] = s;
433
+ }
434
+ a && !r && this.j(e);
435
+ }
436
+ j(e) {
437
+ e === z ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, e ?? "");
438
+ }
439
+ }, ue = class extends K {
440
+ constructor() {
441
+ super(...arguments), this.type = 3;
442
+ }
443
+ j(e) {
444
+ this.element[this.name] = e === z ? void 0 : e;
445
+ }
446
+ }, de = class extends K {
447
+ constructor() {
448
+ super(...arguments), this.type = 4;
449
+ }
450
+ j(e) {
451
+ this.element.toggleAttribute(this.name, !!e && e !== z);
452
+ }
453
+ }, fe = class extends K {
454
+ constructor(e, t, n, r, i) {
455
+ super(e, t, n, r, i), this.type = 5;
456
+ }
457
+ _$AI(e, t = this) {
458
+ if ((e = W(this, e, t, 0) ?? z) === R) return;
459
+ let n = this._$AH, r = e === z && n !== z || e.capture !== n.capture || e.once !== n.once || e.passive !== n.passive, i = e !== z && (n === z || r);
460
+ r && this.element.removeEventListener(this.name, this, n), i && this.element.addEventListener(this.name, this, e), this._$AH = e;
461
+ }
462
+ handleEvent(e) {
463
+ typeof this._$AH == "function" ? this._$AH.call(this.options?.host ?? this.element, e) : this._$AH.handleEvent(e);
464
+ }
465
+ }, pe = class {
466
+ constructor(e, t, n) {
467
+ this.element = e, this.type = 6, this._$AN = void 0, this._$AM = t, this.options = n;
468
+ }
469
+ get _$AU() {
470
+ return this._$AM._$AU;
471
+ }
472
+ _$AI(e) {
473
+ W(this, e);
474
+ }
475
+ }, me = v.litHtmlPolyfillSupport;
476
+ me?.(U, G), (v.litHtmlVersions ??= []).push("3.3.3");
477
+ var he = (e, t, n) => {
478
+ let r = n?.renderBefore ?? t, i = r._$litPart$;
479
+ if (i === void 0) {
480
+ let e = n?.renderBefore ?? null;
481
+ r._$litPart$ = i = new G(t.insertBefore(E(), e), e, void 0, n ?? {});
482
+ }
483
+ return i._$AI(e), i;
484
+ }, q = globalThis, J = class extends _ {
485
+ constructor() {
486
+ super(...arguments), this.renderOptions = { host: this }, this._$Do = void 0;
487
+ }
488
+ createRenderRoot() {
489
+ let e = super.createRenderRoot();
490
+ return this.renderOptions.renderBefore ??= e.firstChild, e;
491
+ }
492
+ update(e) {
493
+ let t = this.render();
494
+ this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(e), this._$Do = he(t, this.renderRoot, this.renderOptions);
495
+ }
496
+ connectedCallback() {
497
+ super.connectedCallback(), this._$Do?.setConnected(!0);
498
+ }
499
+ disconnectedCallback() {
500
+ super.disconnectedCallback(), this._$Do?.setConnected(!1);
501
+ }
502
+ render() {
503
+ return R;
504
+ }
505
+ };
506
+ J._$litElement$ = !0, J.finalized = !0, q.litElementHydrateSupport?.({ LitElement: J });
507
+ var ge = q.litElementPolyfillSupport;
508
+ ge?.({ LitElement: J }), (q.litElementVersions ??= []).push("4.2.2");
509
+ //#endregion
510
+ //#region src/components/formatters.js
511
+ function Y(e) {
512
+ let t = Object.entries(e);
513
+ return t.length ? t.map(([e, t]) => e + ": " + t).join(", ") : "-";
514
+ }
515
+ function _e(e) {
516
+ return e.disposed ? "disposed" : e.initialized ? e.completed ? "done" : "active" : "new";
517
+ }
518
+ function X(e) {
519
+ return e === void 0 ? "-" : typeof e == "string" ? e : JSON.stringify(e);
520
+ }
521
+ //#endregion
522
+ //#region src/components/sharedStyles.js
523
+ var Z = o`
524
+ :host {
525
+ display: block;
526
+ height: 100%;
527
+ min-height: 0;
528
+ color: #d8dee9;
529
+ background: #20242b;
530
+ font:
531
+ 12px/1.45 ui-monospace,
532
+ SFMono-Regular,
533
+ Menlo,
534
+ Consolas,
535
+ "Liberation Mono",
536
+ monospace;
537
+ }
538
+
539
+ .shell {
540
+ display: grid;
541
+ grid-template-rows: auto 1fr;
542
+ height: 100%;
543
+ min-height: 0;
544
+ }
545
+
546
+ .toolbar {
547
+ display: flex;
548
+ align-items: center;
549
+ gap: 0.75rem;
550
+ padding: 0.5rem 0.65rem;
551
+ border-bottom: 1px solid #3a404a;
552
+ background: #292e36;
553
+ }
554
+
555
+ .toolbar-title {
556
+ white-space: nowrap;
557
+ }
558
+
559
+ .panel-tabs {
560
+ display: flex;
561
+ gap: 0.2rem;
562
+ }
563
+
564
+ button,
565
+ label {
566
+ font: inherit;
567
+ }
568
+
569
+ button {
570
+ color: #d8dee9;
571
+ background: #353b45;
572
+ border: 1px solid #4a5260;
573
+ border-radius: 4px;
574
+ padding: 0.2rem 0.45rem;
575
+ cursor: pointer;
576
+ }
577
+
578
+ button:hover {
579
+ background: #414856;
580
+ }
581
+
582
+ .panel-tab {
583
+ color: #b8c0cc;
584
+ background: transparent;
585
+ border-color: transparent;
586
+ }
587
+
588
+ .panel-tab.selected {
589
+ color: #f4f7fb;
590
+ background: #174f78;
591
+ border-color: #2d6e9e;
592
+ }
593
+
594
+ .close-button {
595
+ margin-left: auto;
596
+ }
597
+
598
+ .main {
599
+ display: grid;
600
+ grid-template-columns: minmax(15rem, 38%) minmax(0, 1fr);
601
+ height: 100%;
602
+ min-height: 0;
603
+ }
604
+
605
+ .single-panel {
606
+ display: block;
607
+ box-sizing: border-box;
608
+ height: 100%;
609
+ min-height: 0;
610
+ overflow: auto;
611
+ padding: 0.75rem;
612
+ }
613
+
614
+ .tree,
615
+ .details {
616
+ min-height: 0;
617
+ overflow: auto;
618
+ }
619
+
620
+ .tree {
621
+ border-right: 1px solid #3a404a;
622
+ padding: 0.4rem 0;
623
+ }
624
+
625
+ .tree-controls {
626
+ display: flex;
627
+ align-items: center;
628
+ gap: 0.5rem;
629
+ padding: 0.2rem 0.65rem 0.45rem;
630
+ border-bottom: 1px solid #303743;
631
+ margin-bottom: 0.3rem;
632
+ color: #b8c0cc;
633
+ }
634
+
635
+ .details {
636
+ padding: 0.75rem;
637
+ }
638
+
639
+ .empty {
640
+ color: #9aa6b2;
641
+ padding: 0.75rem;
642
+ }
643
+
644
+ .section-note {
645
+ margin: -0.35rem 0 0.6rem;
646
+ color: #9aa6b2;
647
+ }
648
+
649
+ .debug-errors {
650
+ margin: 0 0 0.75rem;
651
+ padding: 0.5rem 0.65rem;
652
+ border: 1px solid #8f6a2f;
653
+ border-radius: 4px;
654
+ background: #34291c;
655
+ color: #ffcf8a;
656
+ }
657
+
658
+ .debug-errors ul {
659
+ margin: 0.35rem 0 0;
660
+ padding-left: 1rem;
661
+ }
662
+
663
+ .node {
664
+ display: grid;
665
+ grid-template-columns: 1fr auto;
666
+ align-items: center;
667
+ gap: 0.45rem;
668
+ width: 100%;
669
+ min-width: 0;
670
+ padding: 0.12rem 0.65rem;
671
+ border: 0;
672
+ border-radius: 0;
673
+ background: transparent;
674
+ color: inherit;
675
+ text-align: left;
676
+ }
677
+
678
+ .node:hover {
679
+ background: #303743;
680
+ }
681
+
682
+ .node.selected {
683
+ background: #174f78;
684
+ }
685
+
686
+ .node.warning {
687
+ color: #ffcf8a;
688
+ }
689
+
690
+ .node-main {
691
+ min-width: 0;
692
+ overflow: hidden;
693
+ white-space: nowrap;
694
+ text-overflow: ellipsis;
695
+ }
696
+
697
+ .node-meta {
698
+ color: #9aa6b2;
699
+ white-space: nowrap;
700
+ }
701
+
702
+ .badge {
703
+ display: inline-block;
704
+ margin-left: 0.35rem;
705
+ padding: 0 0.25rem;
706
+ border: 1px solid #596273;
707
+ border-radius: 3px;
708
+ color: #b8c0cc;
709
+ }
710
+
711
+ h2 {
712
+ margin: 0 0 0.6rem;
713
+ font-size: 0.9rem;
714
+ line-height: 1.2;
715
+ }
716
+
717
+ h3 {
718
+ margin: 0 0 0.6rem;
719
+ font-size: 1rem;
720
+ line-height: 1.2;
721
+ }
722
+
723
+ h3 {
724
+ margin-top: 1rem;
725
+ font-size: 0.8rem;
726
+ color: #9aa6b2;
727
+ text-transform: uppercase;
728
+ }
729
+
730
+ dl {
731
+ display: grid;
732
+ grid-template-columns: max-content minmax(0, 1fr);
733
+ gap: 0.25rem 0.75rem;
734
+ margin: 0;
735
+ }
736
+
737
+ dt {
738
+ color: #9aa6b2;
739
+ }
740
+
741
+ dd {
742
+ margin: 0;
743
+ min-width: 0;
744
+ overflow-wrap: anywhere;
745
+ }
746
+
747
+ pre {
748
+ margin: 0;
749
+ padding: 0.6rem;
750
+ overflow: auto;
751
+ border: 1px solid #3a404a;
752
+ border-radius: 4px;
753
+ background: #171a20;
754
+ color: #d8dee9;
755
+ }
756
+
757
+ table {
758
+ width: 100%;
759
+ border-collapse: collapse;
760
+ margin-bottom: 0.75rem;
761
+ }
762
+
763
+ th,
764
+ td {
765
+ padding: 0.25rem 0.35rem;
766
+ border-bottom: 1px solid #303743;
767
+ text-align: left;
768
+ vertical-align: top;
769
+ }
770
+
771
+ th {
772
+ color: #9aa6b2;
773
+ font-weight: 600;
774
+ }
775
+
776
+ .linked {
777
+ color: #8cc7ff;
778
+ cursor: pointer;
779
+ }
780
+
781
+ .member-list {
782
+ margin: 0;
783
+ padding-left: 1rem;
784
+ }
785
+
786
+ .member-list li {
787
+ margin: 0 0 0.15rem;
788
+ }
789
+
790
+ .link-button,
791
+ .inline-action {
792
+ padding: 0;
793
+ border: 0;
794
+ background: transparent;
795
+ color: #8cc7ff;
796
+ }
797
+
798
+ .link-button {
799
+ text-align: left;
800
+ }
801
+
802
+ .current-member {
803
+ color: #d8dee9;
804
+ }
805
+
806
+ .current-member::after {
807
+ color: #9aa6b2;
808
+ content: " current";
809
+ }
810
+
811
+ .inline-action {
812
+ margin-top: 0.25rem;
813
+ }
814
+
815
+ .link-button:hover,
816
+ .inline-action:hover {
817
+ background: transparent;
818
+ text-decoration: underline;
819
+ }
820
+
821
+ .muted {
822
+ color: #9aa6b2;
823
+ }
824
+
825
+ .flow-first {
826
+ max-height: 22rem;
827
+ }
828
+ `, ve = class extends J {
829
+ static properties = {
830
+ snapshot: { attribute: !1 },
831
+ selectedFlowNodeId: { attribute: !1 }
832
+ };
833
+ static styles = Z;
834
+ constructor() {
835
+ super(), this.snapshot = { dataflow: {
836
+ sourceIds: [],
837
+ nodes: [],
838
+ collectorCount: 0
839
+ } }, this.selectedFlowNodeId = void 0;
840
+ }
841
+ render() {
842
+ if (this.snapshot.dataflow.sourceIds.length === 0) return L`
843
+ <div class="single-panel">
844
+ <p class="empty">No dataflow has been built yet.</p>
845
+ </div>
846
+ `;
847
+ let e = this.selectedFlowNodeId ? this.#n(this.selectedFlowNodeId) : this.#n(this.snapshot.dataflow.sourceIds[0]);
848
+ return L`
849
+ <div class="main">
850
+ <div class="tree">
851
+ <p class="empty">
852
+ ${this.snapshot.dataflow.sourceIds.length} sources,
853
+ ${this.snapshot.dataflow.collectorCount} collectors
854
+ </p>
855
+ ${this.snapshot.dataflow.sourceIds.map((e) => this.#e(this.#n(e), 0))}
856
+ </div>
857
+ <div class="details">
858
+ ${this.#t(e)}
859
+ </div>
860
+ </div>
861
+ `;
862
+ }
863
+ #e(e, t) {
864
+ let n = e.id === this.selectedFlowNodeId, r = e.disposed || !e.initialized;
865
+ return L`
866
+ <button
867
+ class=${[
868
+ "node",
869
+ n ? "selected" : "",
870
+ r ? "warning" : ""
871
+ ].join(" ")}
872
+ style=${`padding-left: ${.65 + t * 1.1}rem`}
873
+ @click=${() => this.#r(e.id)}
874
+ @mouseenter=${() => this.#a(e.viewId)}
875
+ @mouseleave=${() => this.#a(void 0)}
876
+ >
877
+ <span class="node-main">
878
+ ${e.childIds.length > 0 ? "v" : "-"} ${e.label}
879
+ ${e.completed ? L`<span class="badge">done</span>` : z}
880
+ ${e.disposed ? L`<span class="badge">disposed</span>` : z}
881
+ ${e.initialized ? z : L`<span class="badge">new</span>`}
882
+ </span>
883
+ <span class="node-meta">out ${e.count}</span>
884
+ </button>
885
+ ${e.childIds.map((e) => this.#e(this.#n(e), t + 1))}
886
+ `;
887
+ }
888
+ #t(e) {
889
+ return L`
890
+ <h2>${e.label}</h2>
891
+ <dl>
892
+ <dt>id</dt>
893
+ <dd>${e.id}</dd>
894
+ <dt>out count</dt>
895
+ <dd>${e.count}</dd>
896
+ <dt>children</dt>
897
+ <dd>${e.childIds.length}</dd>
898
+ <dt>completed</dt>
899
+ <dd>${String(e.completed)}</dd>
900
+ <dt>initialized</dt>
901
+ <dd>${String(e.initialized)}</dd>
902
+ <dt>disposed</dt>
903
+ <dd>${String(e.disposed)}</dd>
904
+ <dt>view</dt>
905
+ <dd>
906
+ ${e.viewId ? L`<span
907
+ class="linked"
908
+ @click=${() => this.#i(e.viewId)}
909
+ >${e.viewPath}</span
910
+ >` : "-"}
911
+ </dd>
912
+ <dt>domain-sensitive scales</dt>
913
+ <dd>
914
+ ${e.domainSensitiveScaleChannels.length ? e.domainSensitiveScaleChannels.join(", ") : "-"}
915
+ </dd>
916
+ </dl>
917
+
918
+ <h3>Params</h3>
919
+ ${e.params ? L`<pre>${X(e.params)}</pre>` : L`<p class="empty">No flow node parameters.</p>`}
920
+
921
+ <h3>First Datum</h3>
922
+ ${e.first ? L`<pre class="flow-first">${X(e.first)}</pre>` : L`<p class="empty">
923
+ ${e.count > 0 ? "No datum preview is available." : "No data was propagated."}
924
+ </p>`}
925
+ `;
926
+ }
927
+ #n(e) {
928
+ let t = this.snapshot.dataflow.nodes.find((t) => t.id === e);
929
+ if (!t) throw Error("Unknown inspector flow node: " + e);
930
+ return t;
931
+ }
932
+ #r(e) {
933
+ this.selectedFlowNodeId = e, this.dispatchEvent(new CustomEvent("select-flow-node", {
934
+ detail: { flowNodeId: e },
935
+ bubbles: !0,
936
+ composed: !0
937
+ }));
938
+ }
939
+ #i(e) {
940
+ this.dispatchEvent(new CustomEvent("select-view", {
941
+ detail: { viewId: e },
942
+ bubbles: !0,
943
+ composed: !0
944
+ }));
945
+ }
946
+ #a(e) {
947
+ this.dispatchEvent(new CustomEvent("highlight-view", {
948
+ detail: { viewId: e },
949
+ bubbles: !0,
950
+ composed: !0
951
+ }));
952
+ }
953
+ };
954
+ customElements.define("gs-inspector-dataflow-panel", ve);
955
+ //#endregion
956
+ //#region src/components/paramsPanel.js
957
+ var ye = class extends J {
958
+ static properties = { snapshot: { attribute: !1 } };
959
+ static styles = Z;
960
+ constructor() {
961
+ super(), this.snapshot = { params: { scopes: [] } };
962
+ }
963
+ render() {
964
+ let e = this.snapshot.params.scopes.filter((e) => e.params.length > 0);
965
+ return e.length === 0 ? L`
966
+ <div class="single-panel">
967
+ <p class="empty">No params.</p>
968
+ </div>
969
+ ` : L`
970
+ <div class="single-panel">
971
+ <h2>Params</h2>
972
+ ${e.map((e) => L`
973
+ <h3>
974
+ <span
975
+ class="linked"
976
+ @click=${() => this.#e(e.viewId)}
977
+ >${e.viewPath}</span
978
+ >
979
+ <span class="muted">${e.scopeId}</span>
980
+ </h3>
981
+ ${Q(e.params)}
982
+ `)}
983
+ </div>
984
+ `;
985
+ }
986
+ #e(e) {
987
+ this.dispatchEvent(new CustomEvent("select-view", {
988
+ detail: { viewId: e },
989
+ bubbles: !0,
990
+ composed: !0
991
+ }));
992
+ }
993
+ };
994
+ function Q(e) {
995
+ return L`
996
+ <table>
997
+ <thead>
998
+ <tr>
999
+ <th>name</th>
1000
+ <th>kind</th>
1001
+ <th>writable</th>
1002
+ <th>value</th>
1003
+ <th>config</th>
1004
+ </tr>
1005
+ </thead>
1006
+ <tbody>
1007
+ ${e.map((e) => L`
1008
+ <tr>
1009
+ <td>${e.name}</td>
1010
+ <td>${e.kind}</td>
1011
+ <td>${String(e.writable)}</td>
1012
+ <td>${X(e.value)}</td>
1013
+ <td>
1014
+ ${e.config ? X(e.config) : "-"}
1015
+ </td>
1016
+ </tr>
1017
+ `)}
1018
+ </tbody>
1019
+ </table>
1020
+ `;
1021
+ }
1022
+ customElements.define("gs-inspector-params-panel", ye);
1023
+ //#endregion
1024
+ //#region src/components/inspectorPanel.js
1025
+ var $ = class extends J {
1026
+ static properties = {
1027
+ session: { attribute: !1 },
1028
+ snapshot: { state: !0 },
1029
+ selectedViewId: { state: !0 },
1030
+ selectedFlowNodeId: { state: !0 },
1031
+ activePanel: { state: !0 },
1032
+ expandedResolutionMemberIds: { state: !0 }
1033
+ };
1034
+ static styles = Z;
1035
+ constructor() {
1036
+ super(), this.session = void 0, this.snapshot = {
1037
+ rootId: void 0,
1038
+ nodes: [],
1039
+ resolutions: {
1040
+ scales: [],
1041
+ axes: [],
1042
+ legends: []
1043
+ },
1044
+ dataflow: {
1045
+ sourceIds: [],
1046
+ nodes: [],
1047
+ collectorCount: 0
1048
+ },
1049
+ params: { scopes: [] },
1050
+ marks: { marks: [] }
1051
+ }, this.selectedViewId = void 0, this.selectedFlowNodeId = void 0, this.activePanel = "elements", this.expandedResolutionMemberIds = /* @__PURE__ */ new Set();
1052
+ }
1053
+ connectedCallback() {
1054
+ super.connectedCallback(), this.#i();
1055
+ }
1056
+ disconnectedCallback() {
1057
+ this.#a(), super.disconnectedCallback();
1058
+ }
1059
+ updated(e) {
1060
+ e.has("session") && (this.#a(), this.#i()), (e.has("selectedViewId") || e.has("activePanel")) && this.#o();
1061
+ }
1062
+ #e = void 0;
1063
+ #t = (e) => {
1064
+ this.selectedViewId = e.detail.viewId, this.activePanel = "elements";
1065
+ };
1066
+ #n = (e) => {
1067
+ this.selectedFlowNodeId = e.detail.flowNodeId;
1068
+ };
1069
+ #r = (e) => {
1070
+ this.session?.highlightView(e.detail.viewId);
1071
+ };
1072
+ #i() {
1073
+ if (!this.session || this.#e) return;
1074
+ let e = () => {
1075
+ this.snapshot = this.session.snapshot, this.selectedViewId && !this.snapshot.nodes.some((e) => e.id === this.selectedViewId) ? this.selectedViewId = this.snapshot.rootId : this.selectedViewId ??= this.snapshot.rootId, this.selectedFlowNodeId && !this.snapshot.dataflow.nodes.some((e) => e.id === this.selectedFlowNodeId) ? this.selectedFlowNodeId = this.snapshot.dataflow.sourceIds[0] : this.selectedFlowNodeId ??= this.snapshot.dataflow.sourceIds[0];
1076
+ };
1077
+ this.session.addEventListener("snapshot", e), this.#e = () => {
1078
+ this.session?.removeEventListener("snapshot", e), this.#e = void 0;
1079
+ }, this.#D();
1080
+ }
1081
+ #a() {
1082
+ this.#e?.();
1083
+ }
1084
+ #o() {
1085
+ this.activePanel !== "elements" && this.activePanel !== "resolutions" || this.renderRoot.querySelector(`.node.selected[data-view-id="${this.selectedViewId}"]`)?.scrollIntoView({
1086
+ block: "nearest",
1087
+ inline: "nearest"
1088
+ });
1089
+ }
1090
+ render() {
1091
+ let e = this.#O(), t = this.#k();
1092
+ return L`
1093
+ <div class="shell">
1094
+ <div class="toolbar">
1095
+ <strong class="toolbar-title">Inspector</strong>
1096
+ <span class="panel-tabs">
1097
+ ${this.#c("elements", "Views")}
1098
+ ${this.#c("resolutions", "Resolutions")}
1099
+ ${this.#c("dataflow", "Dataflow")}
1100
+ ${this.#c("params", "Params")}
1101
+ </span>
1102
+ <button @click=${() => this.#D()}>Refresh</button>
1103
+ <button
1104
+ class="close-button"
1105
+ title="Close inspector"
1106
+ aria-label="Close inspector"
1107
+ @click=${() => this.#s()}
1108
+ >
1109
+ x
1110
+ </button>
1111
+ </div>
1112
+ ${this.#l(e, t)}
1113
+ </div>
1114
+ `;
1115
+ }
1116
+ #s() {
1117
+ this.dispatchEvent(new CustomEvent("close", {
1118
+ bubbles: !0,
1119
+ composed: !0
1120
+ }));
1121
+ }
1122
+ #c(e, t) {
1123
+ return L`
1124
+ <button
1125
+ class=${this.activePanel === e ? "panel-tab selected" : "panel-tab"}
1126
+ @click=${() => {
1127
+ this.activePanel = e;
1128
+ }}
1129
+ >
1130
+ ${t}
1131
+ </button>
1132
+ `;
1133
+ }
1134
+ #l(e, t) {
1135
+ return this.activePanel === "dataflow" ? L`
1136
+ <gs-inspector-dataflow-panel
1137
+ .snapshot=${this.snapshot}
1138
+ .selectedFlowNodeId=${this.selectedFlowNodeId}
1139
+ @select-flow-node=${this.#n}
1140
+ @select-view=${this.#t}
1141
+ @highlight-view=${this.#r}
1142
+ ></gs-inspector-dataflow-panel>
1143
+ ` : this.activePanel === "params" ? L`
1144
+ <gs-inspector-params-panel
1145
+ .snapshot=${this.snapshot}
1146
+ @select-view=${this.#t}
1147
+ ></gs-inspector-params-panel>
1148
+ ` : this.activePanel === "resolutions" ? L`
1149
+ <div class="main">
1150
+ ${this.#u(e)}
1151
+ <div class="details">${this.#g()}</div>
1152
+ </div>
1153
+ ` : L`
1154
+ <div class="main">
1155
+ ${this.#u(e)}
1156
+ <div class="details">
1157
+ ${t ? this.#f(t) : L`<div class="empty">No view selected.</div>`}
1158
+ </div>
1159
+ </div>
1160
+ `;
1161
+ }
1162
+ #u(e) {
1163
+ return L`
1164
+ <div class="tree">
1165
+ <div class="tree-controls">
1166
+ <label>
1167
+ <input
1168
+ type="checkbox"
1169
+ .checked=${this.session?.includeChrome ?? !1}
1170
+ @change=${(e) => {
1171
+ let t = e.target;
1172
+ this.session?.setIncludeChrome(t.checked);
1173
+ }}
1174
+ />
1175
+ Show view chrome
1176
+ </label>
1177
+ </div>
1178
+ ${e ? this.#d(e, 0) : L`<div class="empty">
1179
+ Launch the app to inspect the hierarchy.
1180
+ </div>`}
1181
+ </div>
1182
+ `;
1183
+ }
1184
+ #d(e, t) {
1185
+ return L`
1186
+ <button
1187
+ class=${e.id === this.selectedViewId ? "node selected" : "node"}
1188
+ data-view-id=${e.id}
1189
+ style=${`padding-left: ${.65 + t * 1.1}rem`}
1190
+ @click=${() => {
1191
+ this.selectedViewId = e.id;
1192
+ }}
1193
+ @mouseenter=${() => this.session?.highlightView(e.id)}
1194
+ @mouseleave=${() => this.session?.highlightView(void 0)}
1195
+ >
1196
+ <span class="node-main">
1197
+ ${e.childIds.length > 0 ? "v" : "-"} ${e.name}
1198
+ ${e.chrome ? L`<span class="badge">chrome</span>` : z}
1199
+ ${e.visible ? z : L`<span class="badge">hidden</span>`}
1200
+ </span>
1201
+ <span class="node-meta"> ${e.markType ?? e.type} </span>
1202
+ </button>
1203
+ ${e.childIds.map((e) => this.#d(this.#A(e), t + 1))}
1204
+ `;
1205
+ }
1206
+ #f(e) {
1207
+ return L`
1208
+ <h2>${e.path}</h2>
1209
+ ${this.#p(e)}
1210
+ <dl>
1211
+ <dt>id</dt>
1212
+ <dd>${e.id}</dd>
1213
+ <dt>class</dt>
1214
+ <dd>${e.className}</dd>
1215
+ <dt>type</dt>
1216
+ <dd>${e.type}</dd>
1217
+ <dt>mark</dt>
1218
+ <dd>${e.markType ?? "-"}</dd>
1219
+ <dt>selector</dt>
1220
+ <dd>${e.selector ? JSON.stringify(e.selector) : "-"}</dd>
1221
+ <dt>visible</dt>
1222
+ <dd>${String(e.visible)}</dd>
1223
+ <dt>configured visible</dt>
1224
+ <dd>${String(e.configuredVisible)}</dd>
1225
+ <dt>data init</dt>
1226
+ <dd>${e.dataInitializationState}</dd>
1227
+ <dt>bounds</dt>
1228
+ <dd>${e.bounds ? JSON.stringify(e.bounds) : "-"}</dd>
1229
+ </dl>
1230
+
1231
+ <h3>Encodings</h3>
1232
+ <p class="section-note">
1233
+ Channels defined on this view and the resolution ids they use.
1234
+ </p>
1235
+ ${this.#h(e)}
1236
+
1237
+ <h3>Resolutions</h3>
1238
+ <p class="section-note">
1239
+ Direct scale, axis, and legend resolution ids registered on this
1240
+ view.
1241
+ </p>
1242
+ <dl>
1243
+ <dt>scale</dt>
1244
+ <dd>${Y(e.scaleResolutionIds)}</dd>
1245
+ <dt>axis</dt>
1246
+ <dd>${Y(e.axisResolutionIds)}</dd>
1247
+ <dt>legend</dt>
1248
+ <dd>${Y(e.legendResolutionIds)}</dd>
1249
+ </dl>
1250
+
1251
+ <h3>Dataflow</h3>
1252
+ <p class="section-note">
1253
+ Flow nodes owned by this view. Use the Dataflow button to jump
1254
+ to the full flow tree.
1255
+ </p>
1256
+ ${this.#m(e)}
1257
+
1258
+ <h3>Params</h3>
1259
+ <p class="section-note">Params declared in this view scope.</p>
1260
+ ${this.#T(e)}
1261
+
1262
+ <h3>Mark</h3>
1263
+ <p class="section-note">
1264
+ Runtime mark state for unit views, including data and vertex
1265
+ counts.
1266
+ </p>
1267
+ ${this.#E(e)}
1268
+
1269
+ <h3>Related Resolutions</h3>
1270
+ <p class="section-note">
1271
+ Resolutions that this view uses directly or participates in as a
1272
+ member. The Resolutions tab shows the global list.
1273
+ </p>
1274
+ ${this.#_(e)}
1275
+
1276
+ <h3>Spec</h3>
1277
+ <p class="section-note">
1278
+ Authored or generated view spec snapshot for this runtime view.
1279
+ </p>
1280
+ <pre>${JSON.stringify(e.spec, null, 2)}</pre>
1281
+ `;
1282
+ }
1283
+ #p(e) {
1284
+ return !e.debugErrors || e.debugErrors.length === 0 ? z : L`
1285
+ <div class="debug-errors">
1286
+ <strong>Incomplete debug snapshot</strong>
1287
+ <ul>
1288
+ ${e.debugErrors.map((e) => L`
1289
+ <li>${e.field}: ${e.message}</li>
1290
+ `)}
1291
+ </ul>
1292
+ </div>
1293
+ `;
1294
+ }
1295
+ #m(e) {
1296
+ let t = this.#N(e.id);
1297
+ return t.length === 0 ? L`<p class="empty">No linked dataflow nodes.</p>` : L`
1298
+ <table>
1299
+ <thead>
1300
+ <tr>
1301
+ <th>node</th>
1302
+ <th>out</th>
1303
+ <th>state</th>
1304
+ <th></th>
1305
+ </tr>
1306
+ </thead>
1307
+ <tbody>
1308
+ ${t.map((e) => L`
1309
+ <tr>
1310
+ <td>${e.label}</td>
1311
+ <td>${e.count}</td>
1312
+ <td>${_e(e)}</td>
1313
+ <td>
1314
+ <button
1315
+ @click=${() => this.#P(e.id)}
1316
+ >
1317
+ Dataflow
1318
+ </button>
1319
+ </td>
1320
+ </tr>
1321
+ `)}
1322
+ </tbody>
1323
+ </table>
1324
+ `;
1325
+ }
1326
+ #h(e) {
1327
+ let t = Object.values(e.encodings);
1328
+ return t.length === 0 ? L`<p class="empty">No encodings.</p>` : L`
1329
+ <table>
1330
+ <thead>
1331
+ <tr>
1332
+ <th>channel</th>
1333
+ <th>field / expr / value</th>
1334
+ <th>type</th>
1335
+ <th>scale</th>
1336
+ <th>axis</th>
1337
+ <th>legend</th>
1338
+ </tr>
1339
+ </thead>
1340
+ <tbody>
1341
+ ${t.map((e) => L`
1342
+ <tr>
1343
+ <td>${e.channel}</td>
1344
+ <td>
1345
+ ${e.field ?? e.expr ?? X(e.value)}
1346
+ </td>
1347
+ <td>${e.type ?? "-"}</td>
1348
+ <td>${e.scaleResolutionId ?? "-"}</td>
1349
+ <td>${e.axisResolutionId ?? "-"}</td>
1350
+ <td>${e.legendResolutionId ?? "-"}</td>
1351
+ </tr>
1352
+ `)}
1353
+ </tbody>
1354
+ </table>
1355
+ `;
1356
+ }
1357
+ #g() {
1358
+ let { scales: e, axes: t, legends: n } = this.snapshot.resolutions;
1359
+ return L`
1360
+ <h3>Scales</h3>
1361
+ ${this.#v(e)}
1362
+ <h3>Axes</h3>
1363
+ ${this.#y(t)}
1364
+ <h3>Legends</h3>
1365
+ ${this.#b(n)}
1366
+ `;
1367
+ }
1368
+ #_(e) {
1369
+ let { scales: t, axes: n, legends: r } = this.snapshot.resolutions, i = new Set(Object.values(e.scaleResolutionIds)), a = new Set(Object.values(e.axisResolutionIds)), o = new Set(Object.values(e.legendResolutionIds)), s = t.filter((t) => i.has(t.id) || t.members.some((t) => t.viewId === e.id)), c = n.filter((t) => a.has(t.id) || t.members.some((t) => t.viewId === e.id)), l = r.filter((t) => o.has(t.id) || t.members.some((t) => t.viewId === e.id));
1370
+ return s.length === 0 && c.length === 0 && l.length === 0 ? L`<p class="empty">No related resolutions.</p>` : L`
1371
+ <h4>Scales</h4>
1372
+ ${this.#v(s)}
1373
+ <h4>Axes</h4>
1374
+ ${this.#y(c)}
1375
+ <h4>Legends</h4>
1376
+ ${this.#b(l)}
1377
+ `;
1378
+ }
1379
+ #v(e) {
1380
+ return e.length === 0 ? L`<p class="empty">No scale resolutions.</p>` : L`
1381
+ <table>
1382
+ <thead>
1383
+ <tr>
1384
+ <th>id</th>
1385
+ <th>channel</th>
1386
+ <th>name</th>
1387
+ <th>type</th>
1388
+ <th>domain</th>
1389
+ <th>owner</th>
1390
+ <th>members</th>
1391
+ </tr>
1392
+ </thead>
1393
+ <tbody>
1394
+ ${e.map((e) => L`
1395
+ <tr>
1396
+ <td>${e.id}</td>
1397
+ <td>${e.channel}</td>
1398
+ <td>${e.name ?? "-"}</td>
1399
+ <td>
1400
+ ${e.resolvedScaleType ?? e.type}
1401
+ </td>
1402
+ <td>
1403
+ ${X(e.complexDomain ?? e.domain)}
1404
+ </td>
1405
+ <td>
1406
+ ${this.#S(e.hostViewId, e.hostViewPath, "Jump to owner view")}
1407
+ </td>
1408
+ <td>
1409
+ ${this.#x(e.id, e.members)}
1410
+ </td>
1411
+ </tr>
1412
+ `)}
1413
+ </tbody>
1414
+ </table>
1415
+ `;
1416
+ }
1417
+ #y(e) {
1418
+ return e.length === 0 ? L`<p class="empty">No axis resolutions.</p>` : L`
1419
+ <table>
1420
+ <thead>
1421
+ <tr>
1422
+ <th>id</th>
1423
+ <th>channel</th>
1424
+ <th>title</th>
1425
+ <th>scale</th>
1426
+ <th>owner</th>
1427
+ <th>members</th>
1428
+ </tr>
1429
+ </thead>
1430
+ <tbody>
1431
+ ${e.map((e) => L`
1432
+ <tr>
1433
+ <td>${e.id}</td>
1434
+ <td>${e.channel}</td>
1435
+ <td>${e.title ?? "-"}</td>
1436
+ <td>${e.scaleResolutionId ?? "-"}</td>
1437
+ <td>
1438
+ ${this.#S(e.hostViewId, e.hostViewPath, "Jump to owner view")}
1439
+ </td>
1440
+ <td>
1441
+ ${this.#x(e.id, e.members)}
1442
+ </td>
1443
+ </tr>
1444
+ `)}
1445
+ </tbody>
1446
+ </table>
1447
+ `;
1448
+ }
1449
+ #b(e) {
1450
+ return e.length === 0 ? L`<p class="empty">No legend resolutions.</p>` : L`
1451
+ <table>
1452
+ <thead>
1453
+ <tr>
1454
+ <th>id</th>
1455
+ <th>channel</th>
1456
+ <th>definitions</th>
1457
+ <th>owner</th>
1458
+ <th>members</th>
1459
+ </tr>
1460
+ </thead>
1461
+ <tbody>
1462
+ ${e.map((e) => L`
1463
+ <tr>
1464
+ <td>${e.id}</td>
1465
+ <td>${e.channel}</td>
1466
+ <td>${e.definitionCount}</td>
1467
+ <td>
1468
+ ${this.#S(e.hostViewId, e.hostViewPath, "Jump to owner view")}
1469
+ </td>
1470
+ <td>
1471
+ ${this.#x(e.id, e.members)}
1472
+ </td>
1473
+ </tr>
1474
+ `)}
1475
+ </tbody>
1476
+ </table>
1477
+ `;
1478
+ }
1479
+ #x(e, t) {
1480
+ if (t.length === 0) return L`<span class="muted">none</span>`;
1481
+ let n = t.slice().sort((e, t) => Number(!!e.chrome) - Number(!!t.chrome)), r = this.expandedResolutionMemberIds.has(e), i = r ? n : n.slice(0, 5);
1482
+ return L`
1483
+ <ul class="member-list">
1484
+ ${i.map((e) => e.viewId === this.selectedViewId ? L`
1485
+ <li>
1486
+ <span class="current-member">
1487
+ ${e.viewPath}:${e.channel}
1488
+ </span>
1489
+ ${e.chrome ? L`<span class="badge">chrome</span>` : z}
1490
+ </li>
1491
+ ` : L`
1492
+ <li>
1493
+ <button
1494
+ class="link-button"
1495
+ title="Jump to member view"
1496
+ @click=${() => {
1497
+ this.#C(e);
1498
+ }}
1499
+ @mouseenter=${() => this.session?.highlightView(e.viewId)}
1500
+ @mouseleave=${() => this.session?.highlightView(void 0)}
1501
+ >
1502
+ ${e.viewPath}:${e.channel}
1503
+ </button>
1504
+ ${e.chrome ? L`<span class="badge">chrome</span>` : z}
1505
+ </li>
1506
+ `)}
1507
+ </ul>
1508
+ ${t.length > i.length ? L`
1509
+ <button
1510
+ class="inline-action"
1511
+ @click=${() => this.#w(e, !0)}
1512
+ >
1513
+ Show all ${t.length}
1514
+ </button>
1515
+ ` : z}
1516
+ ${r && t.length > 5 ? L`
1517
+ <button
1518
+ class="inline-action"
1519
+ @click=${() => this.#w(e, !1)}
1520
+ >
1521
+ Show fewer
1522
+ </button>
1523
+ ` : z}
1524
+ `;
1525
+ }
1526
+ #S(e, t, n) {
1527
+ return !e || !t ? L`<span class="muted">-</span>` : e === this.selectedViewId ? L`<span class="current-member">${t}</span>` : L`
1528
+ <button
1529
+ class="link-button"
1530
+ title=${n}
1531
+ @click=${() => {
1532
+ this.#C({ viewId: e });
1533
+ }}
1534
+ @mouseenter=${() => this.session?.highlightView(e)}
1535
+ @mouseleave=${() => this.session?.highlightView(void 0)}
1536
+ >
1537
+ ${t}
1538
+ </button>
1539
+ `;
1540
+ }
1541
+ async #C(e) {
1542
+ !this.#M(e.viewId) && this.session && (await this.session.setIncludeChrome(!0), this.snapshot = this.session.snapshot), this.#M(e.viewId) && (this.selectedViewId = e.viewId), this.activePanel = "elements", this.session?.highlightView(void 0), await this.updateComplete, this.#o();
1543
+ }
1544
+ #w(e, t) {
1545
+ let n = new Set(this.expandedResolutionMemberIds);
1546
+ t ? n.add(e) : n.delete(e), this.expandedResolutionMemberIds = n;
1547
+ }
1548
+ #T(e) {
1549
+ let t = this.#F(e.id);
1550
+ return !t || t.params.length === 0 ? L`<p class="empty">No local params.</p>` : Q(t.params);
1551
+ }
1552
+ #E(e) {
1553
+ let t = this.#I(e.id);
1554
+ return t ? L`
1555
+ <dl>
1556
+ <dt>type</dt>
1557
+ <dd>${t.type}</dd>
1558
+ <dt>ready</dt>
1559
+ <dd>${String(t.ready)}</dd>
1560
+ <dt>picking</dt>
1561
+ <dd>${String(t.pickingParticipant)}</dd>
1562
+ <dt>data count</dt>
1563
+ <dd>${t.dataCount ?? "-"}</dd>
1564
+ <dt>vertices</dt>
1565
+ <dd>${t.vertexCount ?? "-"}</dd>
1566
+ <dt>allocated vertices</dt>
1567
+ <dd>${t.allocatedVertices ?? "-"}</dd>
1568
+ <dt>ranges</dt>
1569
+ <dd>${t.rangeCount}</dd>
1570
+ <dt>encoding channels</dt>
1571
+ <dd>${t.encodingChannels.join(", ") || "-"}</dd>
1572
+ <dt>encoder channels</dt>
1573
+ <dd>${t.encoderChannels.join(", ") || "-"}</dd>
1574
+ <dt>search fields</dt>
1575
+ <dd>${t.searchFields.join(", ") || "-"}</dd>
1576
+ <dt>uniforms dirty</dt>
1577
+ <dd>${String(t.markUniformsAltered)}</dd>
1578
+ </dl>
1579
+
1580
+ <h3>Mark Props</h3>
1581
+ <pre>${X(t.properties)}</pre>
1582
+ ` : L`<p class="empty">No mark for this view.</p>`;
1583
+ }
1584
+ async #D() {
1585
+ this.session && await this.session.refresh();
1586
+ }
1587
+ #O() {
1588
+ return this.snapshot.rootId ? this.#j(this.snapshot.rootId) : void 0;
1589
+ }
1590
+ #k() {
1591
+ return this.selectedViewId ? this.#j(this.selectedViewId) ?? this.#O() : this.#O();
1592
+ }
1593
+ #A(e) {
1594
+ let t = this.snapshot.nodes.find((t) => t.id === e);
1595
+ if (!t) throw Error("Unknown inspector node: " + e);
1596
+ return t;
1597
+ }
1598
+ #j(e) {
1599
+ return this.snapshot.nodes.find((t) => t.id === e);
1600
+ }
1601
+ #M(e) {
1602
+ return this.snapshot.nodes.some((t) => t.id === e);
1603
+ }
1604
+ #N(e) {
1605
+ return this.snapshot.dataflow.nodes.filter((t) => t.viewId === e);
1606
+ }
1607
+ #P(e) {
1608
+ this.selectedFlowNodeId = e, this.activePanel = "dataflow";
1609
+ }
1610
+ #F(e) {
1611
+ return this.snapshot.params.scopes.find((t) => t.viewId === e);
1612
+ }
1613
+ #I(e) {
1614
+ return this.snapshot.marks.marks.find((t) => t.viewId === e);
1615
+ }
1616
+ };
1617
+ customElements.define("gs-inspector-panel", $);
1618
+ //#endregion
1619
+ export { $ as GsInspectorPanel };