@vscode/component-explorer 0.1.1-11 → 0.1.1-12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/viewer.js CHANGED
@@ -1,35 +1,35 @@
1
- var St = Object.defineProperty;
2
- var wt = (s, e, t) => e in s ? St(s, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : s[e] = t;
3
- var l = (s, e, t) => wt(s, typeof e != "symbol" ? e + "" : e, t);
4
- import { fixtureGroupBrand as ke, fixtureVariantsBrand as Ve, singleFixtureBrand as Ne } from "./index.js";
5
- import { defineFixture as Hs, defineFixtureGroup as Ls, defineFixtureVariants as Us } from "./index.js";
6
- import { createRoot as It } from "react-dom/client";
7
- import { createContext as Je, useReducer as Ot, useState as Rt, useContext as Tt, useEffect as De, createElement as kt } from "react";
8
- import { jsx as a, jsxs as f, Fragment as ye } from "react/jsx-runtime";
9
- import { unstable_batchedUpdates as Ze } from "react-dom";
10
- function xe(s) {
11
- return typeof s == "object" && s !== null && Ne in s && s[Ne] === !0 && "_options" in s && typeof s._options == "object";
12
- }
13
- function Ce(s) {
14
- return typeof s == "object" && s !== null && ke in s && s[ke] === !0 && "_entries" in s && typeof s._entries == "object";
15
- }
16
- function Se(s) {
17
- return typeof s == "object" && s !== null && Ve in s && s[Ve] === !0 && "_variants" in s && typeof s._variants == "object";
18
- }
19
- function Ns(s) {
20
- return xe(s) ? { success: !0, data: s } : Ce(s) ? { success: !0, data: s } : Se(s) ? { success: !0, data: s } : { success: !1, error: "Value is not a valid fixture export (missing brand symbol or _options/_entries/_variants)" };
21
- }
22
- function Ds(s) {
23
- return xe(s) ? { success: !0, data: s } : { success: !1, error: "Value is not a SingleFixtureExport" };
24
- }
25
- function Ms(s) {
26
- return Ce(s) ? { success: !0, data: s } : { success: !1, error: "Value is not a FixtureGroupExport" };
27
- }
28
- function Fs(s) {
29
- return Se(s) ? { success: !0, data: s } : { success: !1, error: "Value is not a FixtureVariantsExport" };
30
- }
31
- function Me(s, e, t) {
32
- const n = s._options;
1
+ var mt = Object.defineProperty;
2
+ var vt = (r, e, t) => e in r ? mt(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t;
3
+ var l = (r, e, t) => vt(r, typeof e != "symbol" ? e + "" : e, t);
4
+ import { f as Se, a as we, s as Re } from "./index-DnRcKk60.js";
5
+ import { b as Mn, d as Fn, c as En, e as Bn, g as An } from "./index-DnRcKk60.js";
6
+ import { createRoot as _t } from "react-dom/client";
7
+ import { createContext as Ue, useReducer as bt, useState as yt, useContext as xt, useEffect as Te, createElement as Ct } from "react";
8
+ import { jsx as a, jsxs as f, Fragment as pe } from "react/jsx-runtime";
9
+ import { unstable_batchedUpdates as Pe } from "react-dom";
10
+ function ge(r) {
11
+ return typeof r == "object" && r !== null && Re in r && r[Re] === !0 && "_options" in r && typeof r._options == "object";
12
+ }
13
+ function me(r) {
14
+ return typeof r == "object" && r !== null && Se in r && r[Se] === !0 && "_entries" in r && typeof r._entries == "object";
15
+ }
16
+ function ve(r) {
17
+ return typeof r == "object" && r !== null && we in r && r[we] === !0 && "_variants" in r && typeof r._variants == "object";
18
+ }
19
+ function wn(r) {
20
+ return ge(r) ? { success: !0, data: r } : me(r) ? { success: !0, data: r } : ve(r) ? { success: !0, data: r } : { success: !1, error: "Value is not a valid fixture export (missing brand symbol or _options/_entries/_variants)" };
21
+ }
22
+ function Rn(r) {
23
+ return ge(r) ? { success: !0, data: r } : { success: !1, error: "Value is not a SingleFixtureExport" };
24
+ }
25
+ function Tn(r) {
26
+ return me(r) ? { success: !0, data: r } : { success: !1, error: "Value is not a FixtureGroupExport" };
27
+ }
28
+ function In(r) {
29
+ return ve(r) ? { success: !0, data: r } : { success: !1, error: "Value is not a FixtureVariantsExport" };
30
+ }
31
+ function Ie(r, e, t) {
32
+ const n = r._options;
33
33
  return {
34
34
  id: e,
35
35
  name: t,
@@ -42,115 +42,115 @@ function Me(s, e, t) {
42
42
  render: n.render
43
43
  };
44
44
  }
45
- function Es(s) {
46
- return typeof s == "object" && s !== null && "render" in s && typeof s.render == "function" && "id" in s && "name" in s;
45
+ function On(r) {
46
+ return typeof r == "object" && r !== null && "render" in r && typeof r.render == "function" && "id" in r && "name" in r;
47
47
  }
48
- const Vt = {
48
+ const St = {
49
49
  mobile: { width: 390, height: 844 },
50
50
  tablet: { width: 768, height: 1024 },
51
51
  desktop: { width: 1440, height: 900 }
52
52
  };
53
- function Nt(s) {
54
- return typeof s == "string" ? { name: s, ...Vt[s] } : s;
53
+ function wt(r) {
54
+ return typeof r == "string" ? { name: r, ...St[r] } : r;
55
55
  }
56
- function Dt(s) {
56
+ function Rt(r) {
57
57
  const e = {};
58
- for (const t of s)
58
+ for (const t of r)
59
59
  e[t.name] = t.defaultValue;
60
60
  return e;
61
61
  }
62
- function le(s) {
62
+ function oe(r) {
63
63
  const e = {
64
64
  id: "",
65
65
  name: "Components",
66
66
  type: "folder",
67
67
  children: []
68
68
  };
69
- for (const [t, n] of s) {
70
- const r = Mt(t);
71
- Xe(e, [r], n);
69
+ for (const [t, n] of r) {
70
+ const s = Tt(t);
71
+ We(e, [s], n);
72
72
  }
73
73
  return e;
74
74
  }
75
- function Mt(s) {
76
- return (s.split("/").pop() ?? s).replace(/\.fixture\.(tsx?|jsx?)$/, "");
75
+ function Tt(r) {
76
+ return (r.split("/").pop() ?? r).replace(/\.fixture\.(tsx?|jsx?)$/, "");
77
77
  }
78
- function Xe(s, e, t) {
78
+ function We(r, e, t) {
79
79
  var n;
80
- if (xe(t)) {
81
- const r = e.join("/"), i = e[e.length - 1], o = {
82
- id: r,
83
- name: i,
80
+ if (ge(t)) {
81
+ const s = e.join("/"), o = e[e.length - 1], i = {
82
+ id: s,
83
+ name: o,
84
84
  type: "component",
85
- component: Me(t, r, i)
85
+ component: Ie(t, s, o)
86
86
  };
87
- s.children || (s.children = []), s.children.push(o);
88
- } else if (Ce(t)) {
89
- const r = e[e.length - 1], i = e.join("/");
90
- let o = (n = s.children) == null ? void 0 : n.find(
91
- (d) => d.type === "folder" && d.name === r
87
+ r.children || (r.children = []), r.children.push(i);
88
+ } else if (me(t)) {
89
+ const s = e[e.length - 1], o = e.join("/");
90
+ let i = (n = r.children) == null ? void 0 : n.find(
91
+ (d) => d.type === "folder" && d.name === s
92
92
  );
93
- o || (o = {
94
- id: i,
95
- name: r,
93
+ i || (i = {
94
+ id: o,
95
+ name: s,
96
96
  type: "folder",
97
97
  children: []
98
- }, s.children || (s.children = []), s.children.push(o));
98
+ }, r.children || (r.children = []), r.children.push(i));
99
99
  for (const [d, c] of Object.entries(t._entries))
100
- Xe(o, [...e, d], c);
101
- } else if (Se(t)) {
102
- const r = e[e.length - 1], o = {
100
+ We(i, [...e, d], c);
101
+ } else if (ve(t)) {
102
+ const s = e[e.length - 1], i = {
103
103
  id: e.join("/"),
104
- name: r,
104
+ name: s,
105
105
  type: "variants",
106
106
  children: []
107
107
  };
108
- s.children || (s.children = []), s.children.push(o);
108
+ r.children || (r.children = []), r.children.push(i);
109
109
  for (const [d, c] of Object.entries(t._variants)) {
110
- const m = [...e, d].join("/"), _ = {
111
- id: m,
110
+ const g = [...e, d].join("/"), _ = {
111
+ id: g,
112
112
  name: d,
113
113
  type: "component",
114
- component: Me(c, m, d)
114
+ component: Ie(c, g, d)
115
115
  };
116
- o.children.push(_);
116
+ i.children.push(_);
117
117
  }
118
118
  }
119
119
  }
120
- function Fe(s, e) {
120
+ function Oe(r, e) {
121
121
  if (e.length === 0)
122
- return s;
123
- let t = s;
122
+ return r;
123
+ let t = r;
124
124
  for (const n of e) {
125
125
  if (!t || !t.children)
126
126
  return;
127
- t = t.children.find((r) => r.name === n);
127
+ t = t.children.find((s) => s.name === n);
128
128
  }
129
129
  return t;
130
130
  }
131
- function Ft(s) {
132
- if (s.type === "component" && s.component)
133
- return [s.component];
131
+ function It(r) {
132
+ if (r.type === "component" && r.component)
133
+ return [r.component];
134
134
  const e = [];
135
- for (const t of s.children ?? [])
136
- e.push(...Ft(t));
135
+ for (const t of r.children ?? [])
136
+ e.push(...It(t));
137
137
  return e;
138
138
  }
139
- let j;
140
- function Qe(s) {
141
- j ? j instanceof Ee ? j.loggers.push(s) : j = new Ee([j, s]) : j = s;
139
+ let $;
140
+ function Ot(r) {
141
+ $ ? $ instanceof ke ? $.loggers.push(r) : $ = new ke([$, r]) : $ = r;
142
142
  }
143
143
  function b() {
144
- return j;
144
+ return $;
145
145
  }
146
- let he;
147
- function Et(s) {
148
- he = s;
146
+ let ie;
147
+ function kt(r) {
148
+ ie = r;
149
149
  }
150
- function At(s) {
151
- he && he(s);
150
+ function Vt(r) {
151
+ ie && ie(r);
152
152
  }
153
- class Ee {
153
+ class ke {
154
154
  constructor(e) {
155
155
  this.loggers = e;
156
156
  }
@@ -175,8 +175,8 @@ class Ee {
175
175
  t.handleAutorunDisposed(e);
176
176
  }
177
177
  handleAutorunDependencyChanged(e, t, n) {
178
- for (const r of this.loggers)
179
- r.handleAutorunDependencyChanged(e, t, n);
178
+ for (const s of this.loggers)
179
+ s.handleAutorunDependencyChanged(e, t, n);
180
180
  }
181
181
  handleAutorunStarted(e) {
182
182
  for (const t of this.loggers)
@@ -187,8 +187,8 @@ class Ee {
187
187
  t.handleAutorunFinished(e);
188
188
  }
189
189
  handleDerivedDependencyChanged(e, t, n) {
190
- for (const r of this.loggers)
191
- r.handleDerivedDependencyChanged(e, t, n);
190
+ for (const s of this.loggers)
191
+ s.handleDerivedDependencyChanged(e, t, n);
192
192
  }
193
193
  handleDerivedCleared(e) {
194
194
  for (const t of this.loggers)
@@ -203,143 +203,143 @@ class Ee {
203
203
  t.handleEndTransaction(e);
204
204
  }
205
205
  }
206
- var T;
207
- (function(s) {
206
+ var D;
207
+ (function(r) {
208
208
  let e = !1;
209
209
  function t() {
210
210
  e = !0;
211
211
  }
212
- s.enable = t;
212
+ r.enable = t;
213
213
  function n() {
214
- return r(1);
214
+ return s(1);
215
215
  }
216
- s.ofCaller = n;
217
- function r(i) {
216
+ r.ofCaller = n;
217
+ function s(o) {
218
218
  if (!e)
219
219
  return;
220
- const o = Error, d = o.stackTraceLimit;
221
- o.stackTraceLimit = 3;
220
+ const i = Error, d = i.stackTraceLimit;
221
+ i.stackTraceLimit = 3;
222
222
  const c = new Error().stack;
223
- return o.stackTraceLimit = d, we.fromStack(c, i + 1);
223
+ return i.stackTraceLimit = d, _e.fromStack(c, o + 1);
224
224
  }
225
- s.ofNthCaller = r;
226
- })(T || (T = {}));
227
- class we {
225
+ r.ofNthCaller = s;
226
+ })(D || (D = {}));
227
+ class _e {
228
228
  static fromStack(e, t) {
229
229
  const n = e.split(`
230
- `), r = Bt(n[t + 1]);
231
- if (r)
232
- return new we(r.fileName, r.line, r.column, r.id);
230
+ `), s = Nt(n[t + 1]);
231
+ if (s)
232
+ return new _e(s.fileName, s.line, s.column, s.id);
233
233
  }
234
- constructor(e, t, n, r) {
235
- this.fileName = e, this.line = t, this.column = n, this.id = r;
234
+ constructor(e, t, n, s) {
235
+ this.fileName = e, this.line = t, this.column = n, this.id = s;
236
236
  }
237
237
  }
238
- function Bt(s) {
239
- if (!s)
238
+ function Nt(r) {
239
+ if (!r)
240
240
  return;
241
- const e = s.match(/\((.*):(\d+):(\d+)\)/);
241
+ const e = r.match(/\((.*):(\d+):(\d+)\)/);
242
242
  if (e)
243
243
  return {
244
244
  fileName: e[1],
245
245
  line: parseInt(e[2]),
246
246
  column: parseInt(e[3]),
247
- id: s
247
+ id: r
248
248
  };
249
- const t = s.match(/at ([^\(\)]*):(\d+):(\d+)/);
249
+ const t = r.match(/at ([^\(\)]*):(\d+):(\d+)/);
250
250
  if (t)
251
251
  return {
252
252
  fileName: t[1],
253
253
  line: parseInt(t[2]),
254
254
  column: parseInt(t[3]),
255
- id: s
255
+ id: r
256
256
  };
257
257
  }
258
- class B {
258
+ class M {
259
259
  constructor(e, t, n) {
260
260
  this.owner = e, this.debugNameSource = t, this.referenceFn = n;
261
261
  }
262
262
  getDebugName(e) {
263
- return zt(e, this);
263
+ return Dt(e, this);
264
264
  }
265
265
  }
266
- const Ae = /* @__PURE__ */ new Map(), ue = /* @__PURE__ */ new WeakMap();
267
- function zt(s, e) {
268
- const t = ue.get(s);
266
+ const Ve = /* @__PURE__ */ new Map(), ae = /* @__PURE__ */ new WeakMap();
267
+ function Dt(r, e) {
268
+ const t = ae.get(r);
269
269
  if (t)
270
270
  return t;
271
- const n = $t(s, e);
271
+ const n = Mt(r, e);
272
272
  if (n) {
273
- let r = Ae.get(n) ?? 0;
274
- r++, Ae.set(n, r);
275
- const i = r === 1 ? n : `${n}#${r}`;
276
- return ue.set(s, i), i;
273
+ let s = Ve.get(n) ?? 0;
274
+ s++, Ve.set(n, s);
275
+ const o = s === 1 ? n : `${n}#${s}`;
276
+ return ae.set(r, o), o;
277
277
  }
278
278
  }
279
- function $t(s, e) {
280
- const t = ue.get(s);
279
+ function Mt(r, e) {
280
+ const t = ae.get(r);
281
281
  if (t)
282
282
  return t;
283
- const n = e.owner ? Lt(e.owner) + "." : "";
284
- let r;
285
- const i = e.debugNameSource;
286
- if (i !== void 0)
287
- if (typeof i == "function") {
288
- if (r = i(), r !== void 0)
289
- return n + r;
283
+ const n = e.owner ? Et(e.owner) + "." : "";
284
+ let s;
285
+ const o = e.debugNameSource;
286
+ if (o !== void 0)
287
+ if (typeof o == "function") {
288
+ if (s = o(), s !== void 0)
289
+ return n + s;
290
290
  } else
291
- return n + i;
292
- const o = e.referenceFn;
293
- if (o !== void 0 && (r = Ie(o), r !== void 0))
294
- return n + r;
291
+ return n + o;
292
+ const i = e.referenceFn;
293
+ if (i !== void 0 && (s = be(i), s !== void 0))
294
+ return n + s;
295
295
  if (e.owner !== void 0) {
296
- const d = Ht(e.owner, s);
296
+ const d = Ft(e.owner, r);
297
297
  if (d !== void 0)
298
298
  return n + d;
299
299
  }
300
300
  }
301
- function Ht(s, e) {
302
- for (const t in s)
303
- if (s[t] === e)
301
+ function Ft(r, e) {
302
+ for (const t in r)
303
+ if (r[t] === e)
304
304
  return t;
305
305
  }
306
- const Be = /* @__PURE__ */ new Map(), ze = /* @__PURE__ */ new WeakMap();
307
- function Lt(s) {
308
- const e = ze.get(s);
306
+ const Ne = /* @__PURE__ */ new Map(), De = /* @__PURE__ */ new WeakMap();
307
+ function Et(r) {
308
+ const e = De.get(r);
309
309
  if (e)
310
310
  return e;
311
- const t = Ye(s) ?? "Object";
312
- let n = Be.get(t) ?? 0;
313
- n++, Be.set(t, n);
314
- const r = n === 1 ? t : `${t}#${n}`;
315
- return ze.set(s, r), r;
316
- }
317
- function Ye(s) {
318
- const e = s.constructor;
311
+ const t = Ge(r) ?? "Object";
312
+ let n = Ne.get(t) ?? 0;
313
+ n++, Ne.set(t, n);
314
+ const s = n === 1 ? t : `${t}#${n}`;
315
+ return De.set(r, s), s;
316
+ }
317
+ function Ge(r) {
318
+ const e = r.constructor;
319
319
  if (e)
320
320
  return e.name === "Object" ? void 0 : e.name;
321
321
  }
322
- function Ie(s) {
323
- const e = s.toString(), n = /\/\*\*\s*@description\s*([^*]*)\*\//.exec(e), r = n ? n[1] : void 0;
324
- return r == null ? void 0 : r.trim();
322
+ function be(r) {
323
+ const e = r.toString(), n = /\/\*\*\s*@description\s*([^*]*)\*\//.exec(e), s = n ? n[1] : void 0;
324
+ return s == null ? void 0 : s.trim();
325
325
  }
326
- let fe;
327
- function Ut(s) {
328
- fe = s;
326
+ let de;
327
+ function Bt(r) {
328
+ de = r;
329
329
  }
330
- let et;
331
- function jt(s) {
332
- et = s;
330
+ let qe;
331
+ function At(r) {
332
+ qe = r;
333
333
  }
334
- let tt;
335
- function Pt(s) {
336
- tt = s;
334
+ let Ke;
335
+ function zt(r) {
336
+ Ke = r;
337
337
  }
338
- let nt;
339
- function Gt(s) {
340
- nt = s;
338
+ let Je;
339
+ function $t(r) {
340
+ Je = r;
341
341
  }
342
- class Wt {
342
+ class Lt {
343
343
  get TChange() {
344
344
  return null;
345
345
  }
@@ -350,35 +350,35 @@ class Wt {
350
350
  read(e) {
351
351
  return e ? e.readObservable(this) : this.get();
352
352
  }
353
- map(e, t, n = T.ofCaller()) {
354
- const r = t === void 0 ? void 0 : e, i = t === void 0 ? e : t;
355
- return fe({
356
- owner: r,
353
+ map(e, t, n = D.ofCaller()) {
354
+ const s = t === void 0 ? void 0 : e, o = t === void 0 ? e : t;
355
+ return de({
356
+ owner: s,
357
357
  debugName: () => {
358
- const o = Ie(i);
359
- if (o !== void 0)
360
- return o;
361
- const c = /^\s*\(?\s*([a-zA-Z_$][a-zA-Z_$0-9]*)\s*\)?\s*=>\s*\1(?:\??)\.([a-zA-Z_$][a-zA-Z_$0-9]*)\s*$/.exec(i.toString());
358
+ const i = be(o);
359
+ if (i !== void 0)
360
+ return i;
361
+ const c = /^\s*\(?\s*([a-zA-Z_$][a-zA-Z_$0-9]*)\s*\)?\s*=>\s*\1(?:\??)\.([a-zA-Z_$][a-zA-Z_$0-9]*)\s*$/.exec(o.toString());
362
362
  if (c)
363
363
  return `${this.debugName}.${c[2]}`;
364
- if (!r)
364
+ if (!s)
365
365
  return `${this.debugName} (mapped)`;
366
366
  },
367
- debugReferenceFn: i
368
- }, (o) => i(this.read(o), o), n);
367
+ debugReferenceFn: o
368
+ }, (i) => o(this.read(i), i), n);
369
369
  }
370
370
  /**
371
371
  * @sealed
372
372
  * Converts an observable of an observable value into a direct observable of the value.
373
373
  */
374
374
  flatten() {
375
- return fe({
375
+ return de({
376
376
  owner: void 0,
377
377
  debugName: () => `${this.debugName} (flattened)`
378
378
  }, (e) => this.read(e).read(e));
379
379
  }
380
380
  recomputeInitiallyAndOnChange(e, t) {
381
- return e.add(et(this, t)), this;
381
+ return e.add(qe(this, t)), this;
382
382
  }
383
383
  /**
384
384
  * Ensures that this observable is observed. This keeps the cache alive.
@@ -386,16 +386,16 @@ class Wt {
386
386
  * Use `recomputeInitiallyAndOnChange` for eager evaluation.
387
387
  */
388
388
  keepObserved(e) {
389
- return e.add(tt(this)), this;
389
+ return e.add(Ke(this)), this;
390
390
  }
391
391
  get debugValue() {
392
392
  return this.get();
393
393
  }
394
394
  debugGetDependencyGraph() {
395
- return nt(this);
395
+ return Je(this);
396
396
  }
397
397
  }
398
- class Oe extends Wt {
398
+ class ye extends Lt {
399
399
  constructor(e) {
400
400
  var t;
401
401
  super(), this._observers = /* @__PURE__ */ new Set(), (t = b()) == null || t.handleObservableCreated(this, e);
@@ -417,32 +417,29 @@ class Oe extends Wt {
417
417
  log() {
418
418
  var t;
419
419
  const e = !!b();
420
- return At(this), e || (t = b()) == null || t.handleObservableCreated(this, T.ofCaller()), this;
420
+ return Vt(this), e || (t = b()) == null || t.handleObservableCreated(this, D.ofCaller()), this;
421
421
  }
422
422
  debugGetObservers() {
423
423
  return this._observers;
424
424
  }
425
425
  }
426
- function st(s) {
426
+ function Ze(r) {
427
427
  return {
428
- dispose: s
428
+ dispose: r
429
429
  };
430
430
  }
431
- class O extends Error {
431
+ class H extends Error {
432
432
  constructor(e) {
433
- super(e || "An unexpected bug occurred."), Object.setPrototypeOf(this, O.prototype);
433
+ super(e || "An unexpected bug occurred."), Object.setPrototypeOf(this, H.prototype);
434
434
  }
435
435
  }
436
- function se(s) {
437
- throw s;
438
- }
439
- function pe(s) {
440
- console.error("Unexpected error:", s);
436
+ function te(r) {
437
+ throw r;
441
438
  }
442
- const Q = (s, e) => s === e;
443
- function ee(s) {
444
- return s != null;
439
+ function Ht(r) {
440
+ console.error("Unexpected error:", r);
445
441
  }
442
+ const X = (r, e) => r === e;
446
443
  class Y {
447
444
  constructor() {
448
445
  this.disposables = [], this._isDisposed = !1;
@@ -471,8 +468,8 @@ class Y {
471
468
  this.disposables = [];
472
469
  }
473
470
  }
474
- function qt(s) {
475
- switch (s) {
471
+ function jt(r) {
472
+ switch (r) {
476
473
  case 0:
477
474
  return "initial";
478
475
  case 1:
@@ -485,13 +482,13 @@ function qt(s) {
485
482
  return "<unknown>";
486
483
  }
487
484
  }
488
- class w extends Oe {
485
+ class j extends ye {
489
486
  get debugName() {
490
487
  return this._debugNameData.getDebugName(this) ?? "(anonymous)";
491
488
  }
492
- constructor(e, t, n, r = void 0, i, o) {
489
+ constructor(e, t, n, s = void 0, o, i) {
493
490
  var d;
494
- super(o), this._debugNameData = e, this._computeFn = t, this._changeTracker = n, this._handleLastObserverRemoved = r, this._equalityComparator = i, this._state = 0, this._value = void 0, this._updateCount = 0, this._dependencies = /* @__PURE__ */ new Set(), this._dependenciesToBeRemoved = /* @__PURE__ */ new Set(), this._changeSummary = void 0, this._isUpdating = !1, this._isComputing = !1, this._didReportChange = !1, this._isInBeforeUpdate = !1, this._isReaderValid = !1, this._store = void 0, this._delayedStore = void 0, this._removedObserverToCallEndUpdateOn = null, this._changeSummary = (d = this._changeTracker) == null ? void 0 : d.createChangeSummary(void 0);
491
+ super(i), this._debugNameData = e, this._computeFn = t, this._changeTracker = n, this._handleLastObserverRemoved = s, this._equalityComparator = o, this._state = 0, this._value = void 0, this._updateCount = 0, this._dependencies = /* @__PURE__ */ new Set(), this._dependenciesToBeRemoved = /* @__PURE__ */ new Set(), this._changeSummary = void 0, this._isUpdating = !1, this._isComputing = !1, this._didReportChange = !1, this._isInBeforeUpdate = !1, this._isReaderValid = !1, this._store = void 0, this._delayedStore = void 0, this._removedObserverToCallEndUpdateOn = null, this._changeSummary = (d = this._changeTracker) == null ? void 0 : d.createChangeSummary(void 0);
495
492
  }
496
493
  onLastObserverRemoved() {
497
494
  var e, t;
@@ -503,20 +500,20 @@ class w extends Oe {
503
500
  get() {
504
501
  var t, n;
505
502
  if (this._isComputing, this._observers.size === 0) {
506
- let r;
503
+ let s;
507
504
  try {
508
505
  this._isReaderValid = !0;
509
- let i;
510
- this._changeTracker && (i = this._changeTracker.createChangeSummary(void 0), (n = (t = this._changeTracker).beforeUpdate) == null || n.call(t, this, i)), r = this._computeFn(this, i);
506
+ let o;
507
+ this._changeTracker && (o = this._changeTracker.createChangeSummary(void 0), (n = (t = this._changeTracker).beforeUpdate) == null || n.call(t, this, o)), s = this._computeFn(this, o);
511
508
  } finally {
512
509
  this._isReaderValid = !1;
513
510
  }
514
- return this.onLastObserverRemoved(), r;
511
+ return this.onLastObserverRemoved(), s;
515
512
  } else {
516
513
  do {
517
514
  if (this._state === 1) {
518
- for (const r of this._dependencies)
519
- if (r.reportChanges(), this._state === 2)
515
+ for (const s of this._dependencies)
516
+ if (s.reportChanges(), this._state === 2)
520
517
  break;
521
518
  }
522
519
  this._state === 1 && (this._state = 3), this._state !== 3 && this._recompute();
@@ -525,27 +522,27 @@ class w extends Oe {
525
522
  }
526
523
  }
527
524
  _recompute() {
528
- var n, r, i, o;
525
+ var n, s, o, i;
529
526
  let e = !1;
530
527
  this._isComputing = !0, this._didReportChange = !1;
531
528
  const t = this._dependenciesToBeRemoved;
532
529
  this._dependenciesToBeRemoved = this._dependencies, this._dependencies = t;
533
530
  try {
534
531
  const d = this._changeSummary;
535
- this._isReaderValid = !0, this._changeTracker && (this._isInBeforeUpdate = !0, (r = (n = this._changeTracker).beforeUpdate) == null || r.call(n, this, d), this._isInBeforeUpdate = !1, this._changeSummary = (i = this._changeTracker) == null ? void 0 : i.createChangeSummary(d));
532
+ this._isReaderValid = !0, this._changeTracker && (this._isInBeforeUpdate = !0, (s = (n = this._changeTracker).beforeUpdate) == null || s.call(n, this, d), this._isInBeforeUpdate = !1, this._changeSummary = (o = this._changeTracker) == null ? void 0 : o.createChangeSummary(d));
536
533
  const c = this._state !== 0, h = this._value;
537
534
  this._state = 3;
538
- const m = this._delayedStore;
539
- m !== void 0 && (this._delayedStore = void 0);
535
+ const g = this._delayedStore;
536
+ g !== void 0 && (this._delayedStore = void 0);
540
537
  try {
541
538
  this._store !== void 0 && (this._store.dispose(), this._store = void 0), this._value = this._computeFn(this, d);
542
539
  } finally {
543
540
  this._isReaderValid = !1;
544
541
  for (const _ of this._dependenciesToBeRemoved)
545
542
  _.removeObserver(this);
546
- this._dependenciesToBeRemoved.clear(), m !== void 0 && m.dispose();
543
+ this._dependenciesToBeRemoved.clear(), g !== void 0 && g.dispose();
547
544
  }
548
- e = this._didReportChange || c && !this._equalityComparator(h, this._value), (o = b()) == null || o.handleObservableUpdated(this, {
545
+ e = this._didReportChange || c && !this._equalityComparator(h, this._value), (i = b()) == null || i.handleObservableUpdated(this, {
549
546
  oldValue: h,
550
547
  newValue: this._value,
551
548
  change: void 0,
@@ -553,7 +550,7 @@ class w extends Oe {
553
550
  hadValue: c
554
551
  });
555
552
  } catch (d) {
556
- se(d);
553
+ te(d);
557
554
  }
558
555
  if (this._isComputing = !1, !this._didReportChange && e)
559
556
  for (const d of this._observers)
@@ -567,7 +564,7 @@ class w extends Oe {
567
564
  // IObserver Implementation
568
565
  beginUpdate(e) {
569
566
  if (this._isUpdating)
570
- throw new O("Cyclic deriveds are not supported yet!");
567
+ throw new H("Cyclic deriveds are not supported yet!");
571
568
  this._updateCount++, this._isUpdating = !0;
572
569
  try {
573
570
  const t = this._updateCount === 1;
@@ -589,8 +586,8 @@ class w extends Oe {
589
586
  if (this._removedObserverToCallEndUpdateOn) {
590
587
  const n = [...this._removedObserverToCallEndUpdateOn];
591
588
  this._removedObserverToCallEndUpdateOn = null;
592
- for (const r of n)
593
- r.endUpdate(this);
589
+ for (const s of n)
590
+ s.endUpdate(this);
594
591
  }
595
592
  }
596
593
  }
@@ -605,26 +602,26 @@ class w extends Oe {
605
602
  var n;
606
603
  if (this._dependencies.has(e) && !this._dependenciesToBeRemoved.has(e) || this._isInBeforeUpdate) {
607
604
  (n = b()) == null || n.handleDerivedDependencyChanged(this, e, t);
608
- let r = !1;
605
+ let s = !1;
609
606
  try {
610
- r = this._changeTracker ? this._changeTracker.handleChange({
607
+ s = this._changeTracker ? this._changeTracker.handleChange({
611
608
  changedObservable: e,
612
609
  change: t,
613
- didChange: (o) => o === e
610
+ didChange: (i) => i === e
614
611
  }, this._changeSummary) : !0;
615
- } catch (o) {
616
- se(o);
612
+ } catch (i) {
613
+ te(i);
617
614
  }
618
- const i = this._state === 3;
619
- if (r && (this._state === 1 || i) && (this._state = 2, i))
620
- for (const o of this._observers)
621
- o.handlePossibleChange(this);
615
+ const o = this._state === 3;
616
+ if (s && (this._state === 1 || o) && (this._state = 2, o))
617
+ for (const i of this._observers)
618
+ i.handlePossibleChange(this);
622
619
  }
623
620
  }
624
621
  // IReader Implementation
625
622
  _ensureReaderValid() {
626
623
  if (!this._isReaderValid)
627
- throw new O("The reader object cannot be used outside its compute function!");
624
+ throw new H("The reader object cannot be used outside its compute function!");
628
625
  }
629
626
  readObservable(e) {
630
627
  this._ensureReaderValid(), e.addObserver(this);
@@ -652,7 +649,7 @@ class w extends Oe {
652
649
  debugGetState() {
653
650
  return {
654
651
  state: this._state,
655
- stateStr: qt(this._state),
652
+ stateStr: jt(this._state),
656
653
  updateCount: this._updateCount,
657
654
  isComputing: this._isComputing,
658
655
  dependencies: this._dependencies,
@@ -667,33 +664,33 @@ class w extends Oe {
667
664
  }
668
665
  setValue(e, t, n) {
669
666
  this._value = e;
670
- const r = this._observers;
667
+ const s = this._observers;
671
668
  t.updateObserver(this, this);
672
- for (const i of r)
673
- i.handleChange(this, n);
669
+ for (const o of s)
670
+ o.handleChange(this, n);
674
671
  }
675
672
  }
676
- function F(s, e, t = T.ofCaller()) {
677
- return e !== void 0 ? new w(new B(s, void 0, e), e, void 0, void 0, Q, t) : new w(new B(void 0, void 0, s), s, void 0, void 0, Q, t);
673
+ function N(r, e, t = D.ofCaller()) {
674
+ return e !== void 0 ? new j(new M(r, void 0, e), e, void 0, void 0, X, t) : new j(new M(void 0, void 0, r), r, void 0, void 0, X, t);
678
675
  }
679
- function Kt(s, e, t = T.ofCaller()) {
680
- return new w(new B(s.owner, s.debugName, s.debugReferenceFn), e, void 0, s.onLastObserverRemoved, s.equalsFn ?? Q, t);
676
+ function Ut(r, e, t = D.ofCaller()) {
677
+ return new j(new M(r.owner, r.debugName, r.debugReferenceFn), e, void 0, r.onLastObserverRemoved, r.equalsFn ?? X, t);
681
678
  }
682
- Ut(Kt);
683
- function Jt(s, e, t = T.ofCaller()) {
684
- let n, r;
685
- n = s, r = void 0;
686
- let i;
687
- return new w(new B(r, void 0, n), (o) => {
688
- i ? i.clear() : i = new Y();
689
- const d = n(o);
690
- return d && i.add(d), d;
679
+ Bt(Ut);
680
+ function Pt(r, e, t = D.ofCaller()) {
681
+ let n, s;
682
+ n = r, s = void 0;
683
+ let o;
684
+ return new j(new M(s, void 0, n), (i) => {
685
+ o ? o.clear() : o = new Y();
686
+ const d = n(i);
687
+ return d && o.add(d), d;
691
688
  }, void 0, () => {
692
- i && (i.dispose(), i = void 0);
693
- }, Q, t);
689
+ o && (o.dispose(), o = void 0);
690
+ }, X, t);
694
691
  }
695
- function Zt(s) {
696
- switch (s) {
692
+ function Wt(r) {
693
+ switch (r) {
697
694
  case 1:
698
695
  return "dependenciesMightHaveChanged";
699
696
  case 2:
@@ -704,13 +701,13 @@ function Zt(s) {
704
701
  return "<unknown>";
705
702
  }
706
703
  }
707
- class re {
704
+ class Xe {
708
705
  get debugName() {
709
706
  return this._debugNameData.getDebugName(this) ?? "(anonymous)";
710
707
  }
711
- constructor(e, t, n, r) {
712
- var i, o;
713
- this._debugNameData = e, this._runFn = t, this._changeTracker = n, this._state = 2, this._updateCount = 0, this._disposed = !1, this._dependencies = /* @__PURE__ */ new Set(), this._dependenciesToBeRemoved = /* @__PURE__ */ new Set(), this._isRunning = !1, this._store = void 0, this._delayedStore = void 0, this._changeSummary = (i = this._changeTracker) == null ? void 0 : i.createChangeSummary(void 0), (o = b()) == null || o.handleAutorunCreated(this, r), this._run();
708
+ constructor(e, t, n, s) {
709
+ var o, i;
710
+ this._debugNameData = e, this._runFn = t, this._changeTracker = n, this._state = 2, this._updateCount = 0, this._disposed = !1, this._dependencies = /* @__PURE__ */ new Set(), this._dependenciesToBeRemoved = /* @__PURE__ */ new Set(), this._isRunning = !1, this._store = void 0, this._delayedStore = void 0, this._changeSummary = (o = this._changeTracker) == null ? void 0 : o.createChangeSummary(void 0), (i = b()) == null || i.handleAutorunCreated(this, s), this._run();
714
711
  }
715
712
  dispose() {
716
713
  var e;
@@ -722,26 +719,26 @@ class re {
722
719
  }
723
720
  }
724
721
  _run() {
725
- var t, n, r, i;
722
+ var t, n, s, o;
726
723
  const e = this._dependenciesToBeRemoved;
727
724
  this._dependenciesToBeRemoved = this._dependencies, this._dependencies = e, this._state = 3;
728
725
  try {
729
726
  if (!this._disposed) {
730
727
  (t = b()) == null || t.handleAutorunStarted(this);
731
- const o = this._changeSummary, d = this._delayedStore;
728
+ const i = this._changeSummary, d = this._delayedStore;
732
729
  d !== void 0 && (this._delayedStore = void 0);
733
730
  try {
734
- this._isRunning = !0, this._changeTracker && ((r = (n = this._changeTracker).beforeUpdate) == null || r.call(n, this, o), this._changeSummary = this._changeTracker.createChangeSummary(o)), this._store !== void 0 && (this._store.dispose(), this._store = void 0), this._runFn(this, o);
731
+ this._isRunning = !0, this._changeTracker && ((s = (n = this._changeTracker).beforeUpdate) == null || s.call(n, this, i), this._changeSummary = this._changeTracker.createChangeSummary(i)), this._store !== void 0 && (this._store.dispose(), this._store = void 0), this._runFn(this, i);
735
732
  } catch (c) {
736
- se(c);
733
+ te(c);
737
734
  } finally {
738
735
  this._isRunning = !1, d !== void 0 && d.dispose();
739
736
  }
740
737
  }
741
738
  } finally {
742
- this._disposed || (i = b()) == null || i.handleAutorunFinished(this);
743
- for (const o of this._dependenciesToBeRemoved)
744
- o.removeObserver(this);
739
+ this._disposed || (o = b()) == null || o.handleAutorunFinished(this);
740
+ for (const i of this._dependenciesToBeRemoved)
741
+ i.removeObserver(this);
745
742
  this._dependenciesToBeRemoved.clear();
746
743
  }
747
744
  }
@@ -779,10 +776,10 @@ class re {
779
776
  (this._changeTracker ? this._changeTracker.handleChange({
780
777
  changedObservable: e,
781
778
  change: t,
782
- didChange: (i) => i === e
779
+ didChange: (o) => o === e
783
780
  }, this._changeSummary) : !0) && (this._state = 2);
784
- } catch (r) {
785
- se(r);
781
+ } catch (s) {
782
+ te(s);
786
783
  }
787
784
  }
788
785
  }
@@ -792,7 +789,7 @@ class re {
792
789
  // IReader implementation
793
790
  _ensureNoRunning() {
794
791
  if (!this._isRunning)
795
- throw new O("The reader object cannot be used outside its compute function!");
792
+ throw new H("The reader object cannot be used outside its compute function!");
796
793
  }
797
794
  readObservable(e) {
798
795
  if (this._ensureNoRunning(), this._disposed)
@@ -803,12 +800,12 @@ class re {
803
800
  }
804
801
  get store() {
805
802
  if (this._ensureNoRunning(), this._disposed)
806
- throw new O("Cannot access store after dispose");
803
+ throw new H("Cannot access store after dispose");
807
804
  return this._store === void 0 && (this._store = new Y()), this._store;
808
805
  }
809
806
  get delayedStore() {
810
807
  if (this._ensureNoRunning(), this._disposed)
811
- throw new O("Cannot access store after dispose");
808
+ throw new H("Cannot access store after dispose");
812
809
  return this._delayedStore === void 0 && (this._delayedStore = new Y()), this._delayedStore;
813
810
  }
814
811
  debugGetState() {
@@ -817,42 +814,42 @@ class re {
817
814
  updateCount: this._updateCount,
818
815
  dependencies: this._dependencies,
819
816
  state: this._state,
820
- stateStr: Zt(this._state)
817
+ stateStr: Wt(this._state)
821
818
  };
822
819
  }
823
820
  debugRerun() {
824
821
  this._isRunning ? this._state = 2 : this._run();
825
822
  }
826
823
  }
827
- function rt(s, e = T.ofCaller()) {
828
- return new re(new B(void 0, void 0, s), s, void 0, e);
824
+ function Ye(r, e = D.ofCaller()) {
825
+ return new Xe(new M(void 0, void 0, r), r, void 0, e);
829
826
  }
830
- function $e(s) {
831
- const e = new Error("BugIndicatingErrorRecovery: " + s);
832
- pe(e), console.error("recovered from an error that indicates a bug", e);
827
+ function Me(r) {
828
+ const e = new Error("BugIndicatingErrorRecovery: " + r);
829
+ Ht(e), console.error("recovered from an error that indicates a bug", e);
833
830
  }
834
- function it(s, e) {
835
- const t = new ot(s, e);
831
+ function Qe(r, e) {
832
+ const t = new et(r, e);
836
833
  try {
837
- s(t);
834
+ r(t);
838
835
  } finally {
839
836
  t.finish();
840
837
  }
841
838
  }
842
- function Xt(s, e, t) {
843
- s ? e(s) : it(e, t);
839
+ function Gt(r, e, t) {
840
+ r ? e(r) : Qe(e, t);
844
841
  }
845
- class ot {
842
+ class et {
846
843
  constructor(e, t) {
847
844
  var n;
848
845
  this._fn = e, this._getDebugName = t, this._updatingObservers = [], (n = b()) == null || n.handleBeginTransaction(this);
849
846
  }
850
847
  getDebugName() {
851
- return this._getDebugName ? this._getDebugName() : Ie(this._fn);
848
+ return this._getDebugName ? this._getDebugName() : be(this._fn);
852
849
  }
853
850
  updateObserver(e, t) {
854
851
  if (!this._updatingObservers) {
855
- $e("Transaction already finished!"), it((n) => {
852
+ Me("Transaction already finished!"), Qe((n) => {
856
853
  n.updateObserver(e, t);
857
854
  });
858
855
  return;
@@ -863,12 +860,12 @@ class ot {
863
860
  var t;
864
861
  const e = this._updatingObservers;
865
862
  if (!e) {
866
- $e("transaction.finish() has already been called!");
863
+ Me("transaction.finish() has already been called!");
867
864
  return;
868
865
  }
869
866
  for (let n = 0; n < e.length; n++) {
870
- const { observer: r, observable: i } = e[n];
871
- r.endUpdate(i);
867
+ const { observer: s, observable: o } = e[n];
868
+ s.endUpdate(o);
872
869
  }
873
870
  this._updatingObservers = null, (t = b()) == null || t.handleEndTransaction(this);
874
871
  }
@@ -876,35 +873,35 @@ class ot {
876
873
  return this._updatingObservers;
877
874
  }
878
875
  }
879
- function x(s, e, t = T.ofCaller()) {
876
+ function x(r, e, t = D.ofCaller()) {
880
877
  let n;
881
- return typeof s == "string" ? n = new B(void 0, s, void 0) : n = new B(s, void 0, void 0), new ie(n, e, Q, t);
878
+ return typeof r == "string" ? n = new M(void 0, r, void 0) : n = new M(r, void 0, void 0), new tt(n, e, X, t);
882
879
  }
883
- class ie extends Oe {
880
+ class tt extends ye {
884
881
  get debugName() {
885
882
  return this._debugNameData.getDebugName(this) ?? "ObservableValue";
886
883
  }
887
- constructor(e, t, n, r) {
888
- var i;
889
- super(r), this._debugNameData = e, this._equalityComparator = n, this._value = t, (i = b()) == null || i.handleObservableUpdated(this, { hadValue: !1, newValue: t, change: void 0, didChange: !0, oldValue: void 0 });
884
+ constructor(e, t, n, s) {
885
+ var o;
886
+ super(s), this._debugNameData = e, this._equalityComparator = n, this._value = t, (o = b()) == null || o.handleObservableUpdated(this, { hadValue: !1, newValue: t, change: void 0, didChange: !0, oldValue: void 0 });
890
887
  }
891
888
  get() {
892
889
  return this._value;
893
890
  }
894
891
  set(e, t, n) {
895
- var i;
892
+ var o;
896
893
  if (n === void 0 && this._equalityComparator(this._value, e))
897
894
  return;
898
- let r;
899
- t || (t = r = new ot(() => {
895
+ let s;
896
+ t || (t = s = new et(() => {
900
897
  }, () => `Setting ${this.debugName}`));
901
898
  try {
902
- const o = this._value;
903
- this._setValue(e), (i = b()) == null || i.handleObservableUpdated(this, { oldValue: o, newValue: e, change: n, didChange: !0, hadValue: !0 });
899
+ const i = this._value;
900
+ this._setValue(e), (o = b()) == null || o.handleObservableUpdated(this, { oldValue: i, newValue: e, change: n, didChange: !0, hadValue: !0 });
904
901
  for (const d of this._observers)
905
902
  t.updateObserver(d, this), d.handleChange(this, n);
906
903
  } finally {
907
- r && r.finish();
904
+ s && s.finish();
908
905
  }
909
906
  }
910
907
  toString() {
@@ -922,25 +919,25 @@ class ie extends Oe {
922
919
  this._value = e;
923
920
  }
924
921
  }
925
- function He(...s) {
926
- let e, t, n, r;
927
- return s.length === 2 ? [t, n] = s : [e, t, n, r] = s, new A(new B(e, void 0, n), t, n, () => A.globalTransaction, Q, r ?? T.ofCaller());
922
+ function Fe(...r) {
923
+ let e, t, n, s;
924
+ return r.length === 2 ? [t, n] = r : [e, t, n, s] = r, new L(new M(e, void 0, n), t, n, () => L.globalTransaction, X, s ?? D.ofCaller());
928
925
  }
929
- class A extends Oe {
930
- constructor(e, t, n, r, i, o) {
931
- super(o), this._debugNameData = e, this.event = t, this._getValue = n, this._getTransaction = r, this._equalityComparator = i, this._hasValue = !1, this.handleEvent = (d) => {
932
- var g;
933
- const c = this._getValue(d), h = this._value, m = !this._hasValue || !this._equalityComparator(h, c);
926
+ class L extends ye {
927
+ constructor(e, t, n, s, o, i) {
928
+ super(i), this._debugNameData = e, this.event = t, this._getValue = n, this._getTransaction = s, this._equalityComparator = o, this._hasValue = !1, this.handleEvent = (d) => {
929
+ var C;
930
+ const c = this._getValue(d), h = this._value, g = !this._hasValue || !this._equalityComparator(h, c);
934
931
  let _ = !1;
935
- m && (this._value = c, this._hasValue && (_ = !0, Xt(this._getTransaction(), (v) => {
936
- var E;
937
- (E = b()) == null || E.handleObservableUpdated(this, { oldValue: h, newValue: c, change: void 0, didChange: m, hadValue: this._hasValue });
938
- for (const V of this._observers)
939
- v.updateObserver(V, this), V.handleChange(this, void 0);
932
+ g && (this._value = c, this._hasValue && (_ = !0, Gt(this._getTransaction(), (m) => {
933
+ var v;
934
+ (v = b()) == null || v.handleObservableUpdated(this, { oldValue: h, newValue: c, change: void 0, didChange: g, hadValue: this._hasValue });
935
+ for (const O of this._observers)
936
+ m.updateObserver(O, this), O.handleChange(this, void 0);
940
937
  }, () => {
941
- const v = this.getDebugName();
942
- return "Event fired" + (v ? `: ${v}` : "");
943
- })), this._hasValue = !0), _ || (g = b()) == null || g.handleObservableUpdated(this, { oldValue: h, newValue: c, change: void 0, didChange: m, hadValue: this._hasValue });
938
+ const m = this.getDebugName();
939
+ return "Event fired" + (m ? `: ${m}` : "");
940
+ })), this._hasValue = !0), _ || (C = b()) == null || C.handleObservableUpdated(this, { oldValue: h, newValue: c, change: void 0, didChange: g, hadValue: this._hasValue });
944
941
  };
945
942
  }
946
943
  getDebugName() {
@@ -966,40 +963,40 @@ class A extends Oe {
966
963
  return { value: this._value, hasValue: this._hasValue };
967
964
  }
968
965
  }
969
- (function(s) {
970
- s.Observer = A;
966
+ (function(r) {
967
+ r.Observer = L;
971
968
  function e(t, n) {
972
- let r = !1;
973
- A.globalTransaction === void 0 && (A.globalTransaction = t, r = !0);
969
+ let s = !1;
970
+ L.globalTransaction === void 0 && (L.globalTransaction = t, s = !0);
974
971
  try {
975
972
  n();
976
973
  } finally {
977
- r && (A.globalTransaction = void 0);
974
+ s && (L.globalTransaction = void 0);
978
975
  }
979
976
  }
980
- s.batchEventsGlobally = e;
981
- })(He || (He = {}));
982
- function Qt(s) {
983
- const e = new at(!1, void 0);
984
- return s.addObserver(e), st(() => {
985
- s.removeObserver(e);
977
+ r.batchEventsGlobally = e;
978
+ })(Fe || (Fe = {}));
979
+ function qt(r) {
980
+ const e = new rt(!1, void 0);
981
+ return r.addObserver(e), Ze(() => {
982
+ r.removeObserver(e);
986
983
  });
987
984
  }
988
- Pt(Qt);
989
- function Yt(s, e) {
990
- const t = new at(!0, e);
991
- s.addObserver(t);
985
+ zt(qt);
986
+ function Kt(r, e) {
987
+ const t = new rt(!0, e);
988
+ r.addObserver(t);
992
989
  try {
993
- t.beginUpdate(s);
990
+ t.beginUpdate(r);
994
991
  } finally {
995
- t.endUpdate(s);
992
+ t.endUpdate(r);
996
993
  }
997
- return st(() => {
998
- s.removeObserver(t);
994
+ return Ze(() => {
995
+ r.removeObserver(t);
999
996
  });
1000
997
  }
1001
- jt(Yt);
1002
- class at {
998
+ At(Kt);
999
+ class rt {
1003
1000
  constructor(e, t) {
1004
1001
  this._forceRecompute = e, this._handleValue = t, this._counter = 0;
1005
1002
  }
@@ -1014,11 +1011,11 @@ class at {
1014
1011
  handleChange(e, t) {
1015
1012
  }
1016
1013
  }
1017
- let ne;
1018
- function en(s) {
1019
- ne || (ne = new tn(), Qe(ne)), ne.addFilteredObj(s);
1014
+ let ee;
1015
+ function Jt(r) {
1016
+ ee || (ee = new Zt(), Ot(ee)), ee.addFilteredObj(r);
1020
1017
  }
1021
- class tn {
1018
+ class Zt {
1022
1019
  constructor() {
1023
1020
  this.indentation = 0, this.changedObservablesSets = /* @__PURE__ */ new WeakMap();
1024
1021
  }
@@ -1030,32 +1027,32 @@ class tn {
1030
1027
  return ((t = this._filteredObjects) == null ? void 0 : t.has(e)) ?? !0;
1031
1028
  }
1032
1029
  textToConsoleArgs(e) {
1033
- return nn([
1034
- G(on("| ", this.indentation)),
1030
+ return Xt([
1031
+ U(tr("| ", this.indentation)),
1035
1032
  e
1036
1033
  ]);
1037
1034
  }
1038
1035
  formatInfo(e) {
1039
1036
  return e.hadValue ? e.didChange ? [
1040
- G(" "),
1041
- I(M(e.oldValue, 70), {
1037
+ U(" "),
1038
+ R(Z(e.oldValue, 70), {
1042
1039
  color: "red",
1043
1040
  strikeThrough: !0
1044
1041
  }),
1045
- G(" "),
1046
- I(M(e.newValue, 60), {
1042
+ U(" "),
1043
+ R(Z(e.newValue, 60), {
1047
1044
  color: "green"
1048
1045
  })
1049
- ] : [G(" (unchanged)")] : [
1050
- G(" "),
1051
- I(M(e.newValue, 60), {
1046
+ ] : [U(" (unchanged)")] : [
1047
+ U(" "),
1048
+ R(Z(e.newValue, 60), {
1052
1049
  color: "green"
1053
1050
  }),
1054
- G(" (initial)")
1051
+ U(" (initial)")
1055
1052
  ];
1056
1053
  }
1057
1054
  handleObservableCreated(e) {
1058
- if (e instanceof w) {
1055
+ if (e instanceof j) {
1059
1056
  const t = e;
1060
1057
  this.changedObservablesSets.set(t, /* @__PURE__ */ new Set());
1061
1058
  }
@@ -1064,32 +1061,32 @@ class tn {
1064
1061
  }
1065
1062
  handleObservableUpdated(e, t) {
1066
1063
  if (this._isIncluded(e)) {
1067
- if (e instanceof w) {
1064
+ if (e instanceof j) {
1068
1065
  this._handleDerivedRecomputed(e, t);
1069
1066
  return;
1070
1067
  }
1071
1068
  console.log(...this.textToConsoleArgs([
1072
- W("observable value changed"),
1073
- I(e.debugName, { color: "BlueViolet" }),
1069
+ P("observable value changed"),
1070
+ R(e.debugName, { color: "BlueViolet" }),
1074
1071
  ...this.formatInfo(t)
1075
1072
  ]));
1076
1073
  }
1077
1074
  }
1078
1075
  formatChanges(e) {
1079
1076
  if (e.size !== 0)
1080
- return I(" (changed deps: " + [...e].map((t) => t.debugName).join(", ") + ")", { color: "gray" });
1077
+ return R(" (changed deps: " + [...e].map((t) => t.debugName).join(", ") + ")", { color: "gray" });
1081
1078
  }
1082
1079
  handleDerivedDependencyChanged(e, t, n) {
1083
- var r;
1084
- this._isIncluded(e) && ((r = this.changedObservablesSets.get(e)) == null || r.add(t));
1080
+ var s;
1081
+ this._isIncluded(e) && ((s = this.changedObservablesSets.get(e)) == null || s.add(t));
1085
1082
  }
1086
1083
  _handleDerivedRecomputed(e, t) {
1087
1084
  if (!this._isIncluded(e))
1088
1085
  return;
1089
1086
  const n = this.changedObservablesSets.get(e);
1090
1087
  n && (console.log(...this.textToConsoleArgs([
1091
- W("derived recomputed"),
1092
- I(e.debugName, { color: "BlueViolet" }),
1088
+ P("derived recomputed"),
1089
+ R(e.debugName, { color: "BlueViolet" }),
1093
1090
  ...this.formatInfo(t),
1094
1091
  this.formatChanges(n),
1095
1092
  { data: [{ fn: e._debugNameData.referenceFn ?? e._computeFn }] }
@@ -1097,14 +1094,14 @@ class tn {
1097
1094
  }
1098
1095
  handleDerivedCleared(e) {
1099
1096
  this._isIncluded(e) && console.log(...this.textToConsoleArgs([
1100
- W("derived cleared"),
1101
- I(e.debugName, { color: "BlueViolet" })
1097
+ P("derived cleared"),
1098
+ R(e.debugName, { color: "BlueViolet" })
1102
1099
  ]));
1103
1100
  }
1104
1101
  handleFromEventObservableTriggered(e, t) {
1105
1102
  this._isIncluded(e) && console.log(...this.textToConsoleArgs([
1106
- W("observable from event triggered"),
1107
- I(e.debugName, { color: "BlueViolet" }),
1103
+ P("observable from event triggered"),
1104
+ R(e.debugName, { color: "BlueViolet" }),
1108
1105
  ...this.formatInfo(t),
1109
1106
  { data: [{ fn: e._getValue }] }
1110
1107
  ]));
@@ -1120,8 +1117,8 @@ class tn {
1120
1117
  handleAutorunStarted(e) {
1121
1118
  const t = this.changedObservablesSets.get(e);
1122
1119
  t && (this._isIncluded(e) && console.log(...this.textToConsoleArgs([
1123
- W("autorun"),
1124
- I(e.debugName, { color: "BlueViolet" }),
1120
+ P("autorun"),
1121
+ R(e.debugName, { color: "BlueViolet" }),
1125
1122
  this.formatChanges(t),
1126
1123
  { data: [{ fn: e._debugNameData.referenceFn ?? e._runFn }] }
1127
1124
  ])), t.clear(), this.indentation++);
@@ -1132,8 +1129,8 @@ class tn {
1132
1129
  handleBeginTransaction(e) {
1133
1130
  let t = e.getDebugName();
1134
1131
  t === void 0 && (t = ""), this._isIncluded(e) && console.log(...this.textToConsoleArgs([
1135
- W("transaction"),
1136
- I(t, { color: "BlueViolet" }),
1132
+ P("transaction"),
1133
+ R(t, { color: "BlueViolet" }),
1137
1134
  { data: [{ fn: e._fn }] }
1138
1135
  ])), this.indentation++;
1139
1136
  }
@@ -1141,543 +1138,162 @@ class tn {
1141
1138
  this.indentation--;
1142
1139
  }
1143
1140
  }
1144
- function nn(s) {
1141
+ function Xt(r) {
1145
1142
  const e = new Array(), t = [];
1146
1143
  let n = "";
1147
- function r(o) {
1148
- if ("length" in o)
1149
- for (const d of o)
1150
- d && r(d);
1151
- else "text" in o ? (n += `%c${o.text}`, e.push(o.style), o.data && t.push(...o.data)) : "data" in o && t.push(...o.data);
1144
+ function s(i) {
1145
+ if ("length" in i)
1146
+ for (const d of i)
1147
+ d && s(d);
1148
+ else "text" in i ? (n += `%c${i.text}`, e.push(i.style), i.data && t.push(...i.data)) : "data" in i && t.push(...i.data);
1152
1149
  }
1153
- r(s);
1154
- const i = [n, ...e];
1155
- return i.push(...t), i;
1150
+ s(r);
1151
+ const o = [n, ...e];
1152
+ return o.push(...t), o;
1156
1153
  }
1157
- function G(s) {
1158
- return I(s, { color: "black" });
1154
+ function U(r) {
1155
+ return R(r, { color: "black" });
1159
1156
  }
1160
- function W(s) {
1161
- return I(an(`${s}: `, 10), { color: "black", bold: !0 });
1157
+ function P(r) {
1158
+ return R(rr(`${r}: `, 10), { color: "black", bold: !0 });
1162
1159
  }
1163
- function I(s, e = {
1160
+ function R(r, e = {
1164
1161
  color: "black"
1165
1162
  }) {
1166
- function t(r) {
1167
- return Object.entries(r).reduce((i, [o, d]) => `${i}${o}:${d};`, "");
1163
+ function t(s) {
1164
+ return Object.entries(s).reduce((o, [i, d]) => `${o}${i}:${d};`, "");
1168
1165
  }
1169
1166
  const n = {
1170
1167
  color: e.color
1171
1168
  };
1172
1169
  return e.strikeThrough && (n["text-decoration"] = "line-through"), e.bold && (n["font-weight"] = "bold"), {
1173
- text: s,
1170
+ text: r,
1174
1171
  style: t(n)
1175
1172
  };
1176
1173
  }
1177
- function M(s, e) {
1178
- switch (typeof s) {
1174
+ function Z(r, e) {
1175
+ try {
1176
+ return Yt(r, e);
1177
+ } catch {
1178
+ return "[[???]]";
1179
+ }
1180
+ }
1181
+ function Yt(r, e) {
1182
+ switch (typeof r) {
1179
1183
  case "number":
1180
- return "" + s;
1184
+ return "" + r;
1181
1185
  case "string":
1182
- return s.length + 2 <= e ? `"${s}"` : `"${s.substr(0, e - 7)}"+...`;
1186
+ return r.length + 2 <= e ? `"${r}"` : `"${r.substr(0, e - 7)}"+...`;
1183
1187
  case "boolean":
1184
- return s ? "true" : "false";
1188
+ return r ? "true" : "false";
1185
1189
  case "undefined":
1186
1190
  return "undefined";
1187
1191
  case "object":
1188
- return s === null ? "null" : Array.isArray(s) ? sn(s, e) : rn(s, e);
1192
+ return r === null ? "null" : Array.isArray(r) ? Qt(r, e) : er(r, e);
1189
1193
  case "symbol":
1190
- return s.toString();
1194
+ return r.toString();
1191
1195
  case "function":
1192
- return `[[Function${s.name ? " " + s.name : ""}]]`;
1196
+ return `[[Function${r.name ? " " + r.name : ""}]]`;
1193
1197
  default:
1194
- return "" + s;
1198
+ return "" + r;
1195
1199
  }
1196
1200
  }
1197
- function sn(s, e) {
1201
+ function Qt(r, e) {
1198
1202
  let t = "[ ", n = !0;
1199
- for (const r of s) {
1203
+ for (const s of r) {
1200
1204
  if (n || (t += ", "), t.length - 5 > e) {
1201
1205
  t += "...";
1202
1206
  break;
1203
1207
  }
1204
- n = !1, t += `${M(r, e - t.length)}`;
1208
+ n = !1, t += `${Z(s, e - t.length)}`;
1205
1209
  }
1206
1210
  return t += " ]", t;
1207
1211
  }
1208
- function rn(s, e) {
1209
- if (typeof s.toString == "function" && s.toString !== Object.prototype.toString) {
1210
- const i = s.toString();
1211
- return i.length <= e ? i : i.substring(0, e - 3) + "...";
1212
+ function er(r, e) {
1213
+ try {
1214
+ if (typeof r.toString == "function" && r.toString !== Object.prototype.toString) {
1215
+ const i = r.toString();
1216
+ return i.length <= e ? i : i.substring(0, e - 3) + "...";
1217
+ }
1218
+ } catch {
1219
+ return "[[Object]]";
1220
+ }
1221
+ const t = Ge(r);
1222
+ let n = t ? t + "(" : "{ ", s = !0, o;
1223
+ try {
1224
+ o = Object.entries(r);
1225
+ } catch {
1226
+ return t ? `${t}(...)` : "[[Object]]";
1212
1227
  }
1213
- const t = Ye(s);
1214
- let n = t ? t + "(" : "{ ", r = !0;
1215
- for (const [i, o] of Object.entries(s)) {
1216
- if (r || (n += ", "), n.length - 5 > e) {
1228
+ for (const [i, d] of o) {
1229
+ if (s || (n += ", "), n.length - 5 > e) {
1217
1230
  n += "...";
1218
1231
  break;
1219
1232
  }
1220
- r = !1, n += `${i}: ${M(o, e - n.length)}`;
1233
+ s = !1, n += `${i}: ${Z(d, e - n.length)}`;
1221
1234
  }
1222
1235
  return n += t ? ")" : " }", n;
1223
1236
  }
1224
- function on(s, e) {
1237
+ function tr(r, e) {
1225
1238
  let t = "";
1226
1239
  for (let n = 1; n <= e; n++)
1227
- t += s;
1240
+ t += r;
1228
1241
  return t;
1229
1242
  }
1230
- function an(s, e) {
1231
- for (; s.length < e; )
1232
- s += " ";
1233
- return s;
1234
- }
1235
- class oe {
1236
- static createHost(e, t) {
1237
- return new oe(e, t);
1238
- }
1239
- static createClient(e, t) {
1240
- return new oe(e, t);
1241
- }
1242
- constructor(e, t) {
1243
- this._channelFactory = e, this._getHandler = t, this._channel = this._channelFactory({
1244
- handleNotification: (i) => {
1245
- const o = i, d = this._getHandler().notifications[o[0]];
1246
- if (!d)
1247
- throw new Error(`Unknown notification "${o[0]}"!`);
1248
- d(...o[1]);
1249
- },
1250
- handleRequest: (i) => {
1251
- const o = i;
1252
- try {
1253
- return { type: "result", value: this._getHandler().requests[o[0]](...o[1]) };
1254
- } catch (d) {
1255
- return { type: "error", value: d };
1256
- }
1257
- }
1258
- });
1259
- const n = new Proxy({}, {
1260
- get: (i, o) => async (...d) => {
1261
- const c = await this._channel.sendRequest([o, d]);
1262
- if (c.type === "error")
1263
- throw c.value;
1264
- return c.value;
1265
- }
1266
- }), r = new Proxy({}, {
1267
- get: (i, o) => (...d) => {
1268
- this._channel.sendNotification([o, d]);
1269
- }
1270
- });
1271
- this.api = { notifications: r, requests: n };
1272
- }
1273
- }
1274
- function dn(s, e) {
1275
- const t = globalThis;
1276
- let n = [], r;
1277
- const { channel: i, handler: o } = cn({
1278
- sendNotification: (c) => {
1279
- r ? r.sendNotification(c) : n.push(c);
1280
- }
1281
- });
1282
- let d;
1283
- return (t.$$debugValueEditor_debugChannels ?? (t.$$debugValueEditor_debugChannels = {}))[s] = (c) => {
1284
- d = e(), r = c;
1285
- for (const h of n)
1286
- c.sendNotification(h);
1287
- return n = [], o;
1288
- }, oe.createClient(i, () => {
1289
- if (!d)
1290
- throw new Error("Not supported");
1291
- return d;
1292
- });
1293
- }
1294
- function cn(s) {
1295
- let e;
1296
- return {
1297
- channel: (n) => (e = n, {
1298
- sendNotification: (r) => {
1299
- s.sendNotification(r);
1300
- },
1301
- sendRequest: (r) => {
1302
- throw new Error("not supported");
1303
- }
1304
- }),
1305
- handler: {
1306
- handleRequest: (n) => n.type === "notification" ? e == null ? void 0 : e.handleNotification(n.data) : e == null ? void 0 : e.handleRequest(n.data)
1307
- }
1308
- };
1309
- }
1310
- class ln {
1311
- constructor() {
1312
- this._timeout = void 0;
1313
- }
1314
- throttle(e, t) {
1315
- this._timeout === void 0 && (this._timeout = setTimeout(() => {
1316
- this._timeout = void 0, e();
1317
- }, t));
1318
- }
1319
- dispose() {
1320
- this._timeout !== void 0 && clearTimeout(this._timeout);
1321
- }
1322
- }
1323
- function dt(s, e) {
1324
- for (const t in e)
1325
- s[t] && typeof s[t] == "object" && e[t] && typeof e[t] == "object" ? dt(s[t], e[t]) : s[t] = e[t];
1326
- }
1327
- function ct(s, e) {
1328
- for (const t in e)
1329
- e[t] === null ? delete s[t] : s[t] && typeof s[t] == "object" && e[t] && typeof e[t] == "object" ? ct(s[t], e[t]) : s[t] = e[t];
1330
- }
1331
- class P {
1332
- static getInstance() {
1333
- return P._instance === void 0 && (P._instance = new P()), P._instance;
1334
- }
1335
- getTransactionState() {
1336
- const e = [], t = [...this._activeTransactions];
1337
- if (t.length === 0)
1338
- return;
1339
- const n = t.flatMap((i) => i.debugGetUpdatingObservers() ?? []).map((i) => i.observer), r = /* @__PURE__ */ new Set();
1340
- for (; n.length > 0; ) {
1341
- const i = n.shift();
1342
- if (r.has(i))
1343
- continue;
1344
- r.add(i);
1345
- const o = this._getInfo(i, (d) => {
1346
- r.has(d) || n.push(d);
1347
- });
1348
- o && e.push(o);
1349
- }
1350
- return { names: t.map((i) => i.getDebugName() ?? "tx"), affected: e };
1351
- }
1352
- _getObservableInfo(e) {
1353
- const t = this._instanceInfos.get(e);
1354
- if (!t) {
1355
- pe(new O("No info found"));
1356
- return;
1357
- }
1358
- return t;
1359
- }
1360
- _getAutorunInfo(e) {
1361
- const t = this._instanceInfos.get(e);
1362
- if (!t) {
1363
- pe(new O("No info found"));
1364
- return;
1365
- }
1366
- return t;
1367
- }
1368
- _getInfo(e, t) {
1369
- if (e instanceof w) {
1370
- const n = [...e.debugGetObservers()];
1371
- for (const c of n)
1372
- t(c);
1373
- const r = this._getObservableInfo(e);
1374
- if (!r)
1375
- return;
1376
- const i = e.debugGetState(), o = { name: e.debugName, instanceId: r.instanceId, updateCount: i.updateCount }, d = [...r.changedObservables].map((c) => {
1377
- var h;
1378
- return (h = this._instanceInfos.get(c)) == null ? void 0 : h.instanceId;
1379
- }).filter(ee);
1380
- if (i.isComputing)
1381
- return { ...o, type: "observable/derived", state: "updating", changedDependencies: d, initialComputation: !1 };
1382
- switch (i.state) {
1383
- case 0:
1384
- return { ...o, type: "observable/derived", state: "noValue" };
1385
- case 3:
1386
- return { ...o, type: "observable/derived", state: "upToDate" };
1387
- case 2:
1388
- return { ...o, type: "observable/derived", state: "stale", changedDependencies: d };
1389
- case 1:
1390
- return { ...o, type: "observable/derived", state: "possiblyStale" };
1391
- }
1392
- } else if (e instanceof re) {
1393
- const n = this._getAutorunInfo(e);
1394
- if (!n)
1395
- return;
1396
- const r = { name: e.debugName, instanceId: n.instanceId, updateCount: n.updateCount }, i = [...n.changedObservables].map((o) => this._instanceInfos.get(o).instanceId);
1397
- if (e.debugGetState().isRunning)
1398
- return { ...r, type: "autorun", state: "updating", changedDependencies: i };
1399
- switch (e.debugGetState().state) {
1400
- case 3:
1401
- return { ...r, type: "autorun", state: "upToDate" };
1402
- case 2:
1403
- return { ...r, type: "autorun", state: "stale", changedDependencies: i };
1404
- case 1:
1405
- return { ...r, type: "autorun", state: "possiblyStale" };
1406
- }
1407
- }
1408
- }
1409
- _formatObservable(e) {
1410
- const t = this._getObservableInfo(e);
1411
- if (t)
1412
- return { name: e.debugName, instanceId: t.instanceId };
1413
- }
1414
- _formatObserver(e) {
1415
- var n;
1416
- if (e instanceof w)
1417
- return { name: e.toString(), instanceId: (n = this._getObservableInfo(e)) == null ? void 0 : n.instanceId };
1418
- const t = this._getAutorunInfo(e);
1419
- if (t)
1420
- return { name: e.toString(), instanceId: t.instanceId };
1421
- }
1422
- constructor() {
1423
- this._declarationId = 0, this._instanceId = 0, this._declarations = /* @__PURE__ */ new Map(), this._instanceInfos = /* @__PURE__ */ new WeakMap(), this._aliveInstances = /* @__PURE__ */ new Map(), this._activeTransactions = /* @__PURE__ */ new Set(), this._channel = dn("observableDevTools", () => ({
1424
- notifications: {
1425
- setDeclarationIdFilter: (e) => {
1426
- },
1427
- logObservableValue: (e) => {
1428
- console.log("logObservableValue", e);
1429
- },
1430
- flushUpdates: () => {
1431
- this._flushUpdates();
1432
- },
1433
- resetUpdates: () => {
1434
- this._pendingChanges = null, this._channel.api.notifications.handleChange(this._fullState, !0);
1435
- }
1436
- },
1437
- requests: {
1438
- getDeclarations: () => {
1439
- const e = {};
1440
- for (const t of this._declarations.values())
1441
- e[t.id] = t;
1442
- return { decls: e };
1443
- },
1444
- getSummarizedInstances: () => null,
1445
- getObservableValueInfo: (e) => ({
1446
- observers: [...this._aliveInstances.get(e).debugGetObservers()].map((n) => this._formatObserver(n)).filter(ee)
1447
- }),
1448
- getDerivedInfo: (e) => {
1449
- const t = this._aliveInstances.get(e);
1450
- return {
1451
- dependencies: [...t.debugGetState().dependencies].map((n) => this._formatObservable(n)).filter(ee),
1452
- observers: [...t.debugGetObservers()].map((n) => this._formatObserver(n)).filter(ee)
1453
- };
1454
- },
1455
- getAutorunInfo: (e) => ({
1456
- dependencies: [...this._aliveInstances.get(e).debugGetState().dependencies].map((n) => this._formatObservable(n)).filter(ee)
1457
- }),
1458
- getTransactionState: () => this.getTransactionState(),
1459
- setValue: (e, t) => {
1460
- const n = this._aliveInstances.get(e);
1461
- if (n instanceof w)
1462
- n.debugSetValue(t);
1463
- else if (n instanceof ie)
1464
- n.debugSetValue(t);
1465
- else if (n instanceof A)
1466
- n.debugSetValue(t);
1467
- else
1468
- throw new O("Observable is not supported");
1469
- const r = [...n.debugGetObservers()];
1470
- for (const i of r)
1471
- i.beginUpdate(n);
1472
- for (const i of r)
1473
- i.handleChange(n, void 0);
1474
- for (const i of r)
1475
- i.endUpdate(n);
1476
- },
1477
- getValue: (e) => {
1478
- const t = this._aliveInstances.get(e);
1479
- if (t instanceof w)
1480
- return M(t.debugGetState().value, 200);
1481
- if (t instanceof ie)
1482
- return M(t.debugGetState().value, 200);
1483
- },
1484
- logValue: (e) => {
1485
- const t = this._aliveInstances.get(e);
1486
- if (t && "get" in t)
1487
- console.log("Logged Value:", t.get());
1488
- else
1489
- throw new O("Observable is not supported");
1490
- },
1491
- rerun: (e) => {
1492
- const t = this._aliveInstances.get(e);
1493
- if (t instanceof w)
1494
- t.debugRecompute();
1495
- else if (t instanceof re)
1496
- t.debugRerun();
1497
- else
1498
- throw new O("Observable is not supported");
1499
- }
1500
- }
1501
- })), this._pendingChanges = null, this._changeThrottler = new ln(), this._fullState = {}, this._flushUpdates = () => {
1502
- this._pendingChanges !== null && (this._channel.api.notifications.handleChange(this._pendingChanges, !1), this._pendingChanges = null);
1503
- }, T.enable();
1504
- }
1505
- _handleChange(e) {
1506
- ct(this._fullState, e), this._pendingChanges === null ? this._pendingChanges = e : dt(this._pendingChanges, e), this._changeThrottler.throttle(this._flushUpdates, 10);
1507
- }
1508
- _getDeclarationId(e, t) {
1509
- if (!t)
1510
- return -1;
1511
- let n = this._declarations.get(t.id);
1512
- return n === void 0 && (n = {
1513
- id: this._declarationId++,
1514
- type: e,
1515
- url: t.fileName,
1516
- line: t.line,
1517
- column: t.column
1518
- }, this._declarations.set(t.id, n), this._handleChange({ decls: { [n.id]: n } })), n.id;
1519
- }
1520
- handleObservableCreated(e, t) {
1521
- const r = {
1522
- declarationId: this._getDeclarationId("observable/value", t),
1523
- instanceId: this._instanceId++,
1524
- listenerCount: 0,
1525
- lastValue: void 0,
1526
- updateCount: 0,
1527
- changedObservables: /* @__PURE__ */ new Set()
1528
- };
1529
- this._instanceInfos.set(e, r);
1530
- }
1531
- handleOnListenerCountChanged(e, t) {
1532
- const n = this._getObservableInfo(e);
1533
- if (n) {
1534
- if (n.listenerCount === 0 && t > 0) {
1535
- const r = e instanceof w ? "observable/derived" : "observable/value";
1536
- this._aliveInstances.set(n.instanceId, e), this._handleChange({
1537
- instances: {
1538
- [n.instanceId]: {
1539
- instanceId: n.instanceId,
1540
- declarationId: n.declarationId,
1541
- formattedValue: n.lastValue,
1542
- type: r,
1543
- name: e.debugName
1544
- }
1545
- }
1546
- });
1547
- } else n.listenerCount > 0 && t === 0 && (this._handleChange({
1548
- instances: { [n.instanceId]: null }
1549
- }), this._aliveInstances.delete(n.instanceId));
1550
- n.listenerCount = t;
1551
- }
1552
- }
1553
- handleObservableUpdated(e, t) {
1554
- if (e instanceof w) {
1555
- this._handleDerivedRecomputed(e, t);
1556
- return;
1557
- }
1558
- const n = this._getObservableInfo(e);
1559
- n && t.didChange && (n.lastValue = M(t.newValue, 30), n.listenerCount > 0 && this._handleChange({
1560
- instances: { [n.instanceId]: { formattedValue: n.lastValue } }
1561
- }));
1562
- }
1563
- handleAutorunCreated(e, t) {
1564
- const r = {
1565
- declarationId: this._getDeclarationId("autorun", t),
1566
- instanceId: this._instanceId++,
1567
- updateCount: 0,
1568
- changedObservables: /* @__PURE__ */ new Set()
1569
- };
1570
- this._instanceInfos.set(e, r), this._aliveInstances.set(r.instanceId, e), r && this._handleChange({
1571
- instances: {
1572
- [r.instanceId]: {
1573
- instanceId: r.instanceId,
1574
- declarationId: r.declarationId,
1575
- runCount: 0,
1576
- type: "autorun",
1577
- name: e.debugName
1578
- }
1579
- }
1580
- });
1581
- }
1582
- handleAutorunDisposed(e) {
1583
- const t = this._getAutorunInfo(e);
1584
- t && (this._handleChange({
1585
- instances: { [t.instanceId]: null }
1586
- }), this._instanceInfos.delete(e), this._aliveInstances.delete(t.instanceId));
1587
- }
1588
- handleAutorunDependencyChanged(e, t, n) {
1589
- const r = this._getAutorunInfo(e);
1590
- r && r.changedObservables.add(t);
1591
- }
1592
- handleAutorunStarted(e) {
1593
- }
1594
- handleAutorunFinished(e) {
1595
- const t = this._getAutorunInfo(e);
1596
- t && (t.changedObservables.clear(), t.updateCount++, this._handleChange({
1597
- instances: { [t.instanceId]: { runCount: t.updateCount } }
1598
- }));
1599
- }
1600
- handleDerivedDependencyChanged(e, t, n) {
1601
- const r = this._getObservableInfo(e);
1602
- r && r.changedObservables.add(t);
1603
- }
1604
- _handleDerivedRecomputed(e, t) {
1605
- const n = this._getObservableInfo(e);
1606
- if (!n)
1607
- return;
1608
- const r = M(t.newValue, 30);
1609
- n.updateCount++, n.changedObservables.clear(), n.lastValue = r, n.listenerCount > 0 && this._handleChange({
1610
- instances: { [n.instanceId]: { formattedValue: r, recomputationCount: n.updateCount } }
1611
- });
1612
- }
1613
- handleDerivedCleared(e) {
1614
- const t = this._getObservableInfo(e);
1615
- t && (t.lastValue = void 0, t.changedObservables.clear(), t.listenerCount > 0 && this._handleChange({
1616
- instances: {
1617
- [t.instanceId]: {
1618
- formattedValue: void 0
1619
- }
1620
- }
1621
- }));
1622
- }
1623
- handleBeginTransaction(e) {
1624
- this._activeTransactions.add(e);
1625
- }
1626
- handleEndTransaction(e) {
1627
- this._activeTransactions.delete(e);
1628
- }
1243
+ function rr(r, e) {
1244
+ for (; r.length < e; )
1245
+ r += " ";
1246
+ return r;
1629
1247
  }
1630
- P._instance = void 0;
1631
- function hn(s, e) {
1632
- const t = (e == null ? void 0 : e.debugNamePostProcessor) ?? ((i) => i), n = R.from(s, t);
1633
- return n ? lt(n, 0, /* @__PURE__ */ new Set()).trim() : "";
1248
+ function nr(r, e) {
1249
+ const t = (e == null ? void 0 : e.debugNamePostProcessor) ?? ((o) => o), n = T.from(r, t);
1250
+ return n ? nt(n, 0, /* @__PURE__ */ new Set()).trim() : "";
1634
1251
  }
1635
- function lt(s, e, t) {
1636
- const n = " ".repeat(e), r = [];
1637
- if (t.has(s.sourceObj))
1638
- return r.push(`${n}* ${s.type} ${s.name} (already listed)`), r.join(`
1252
+ function nt(r, e, t) {
1253
+ const n = " ".repeat(e), s = [];
1254
+ if (t.has(r.sourceObj))
1255
+ return s.push(`${n}* ${r.type} ${r.name} (already listed)`), s.join(`
1639
1256
  `);
1640
- if (t.add(s.sourceObj), r.push(`${n}* ${s.type} ${s.name}:`), r.push(`${n} value: ${M(s.value, 50)}`), r.push(`${n} state: ${s.state}`), s.dependencies.length > 0) {
1641
- r.push(`${n} dependencies:`);
1642
- for (const o of s.dependencies)
1643
- r.push(lt(o, e + 1, t));
1257
+ if (t.add(r.sourceObj), s.push(`${n}* ${r.type} ${r.name}:`), s.push(`${n} value: ${Z(r.value, 50)}`), s.push(`${n} state: ${r.state}`), r.dependencies.length > 0) {
1258
+ s.push(`${n} dependencies:`);
1259
+ for (const i of r.dependencies)
1260
+ s.push(nt(i, e + 1, t));
1644
1261
  }
1645
- return r.join(`
1262
+ return s.join(`
1646
1263
  `);
1647
1264
  }
1648
- class R {
1265
+ class T {
1649
1266
  static from(e, t) {
1650
- if (e instanceof re) {
1267
+ if (e instanceof Xe) {
1651
1268
  const n = e.debugGetState();
1652
- return new R(e, t(e.debugName), "autorun", void 0, n.stateStr, Array.from(n.dependencies).map((r) => R.from(r, t) || R.unknown(r)));
1653
- } else if (e instanceof w) {
1269
+ return new T(e, t(e.debugName), "autorun", void 0, n.stateStr, Array.from(n.dependencies).map((s) => T.from(s, t) || T.unknown(s)));
1270
+ } else if (e instanceof j) {
1654
1271
  const n = e.debugGetState();
1655
- return new R(e, t(e.debugName), "derived", n.value, n.stateStr, Array.from(n.dependencies).map((r) => R.from(r, t) || R.unknown(r)));
1656
- } else if (e instanceof ie) {
1272
+ return new T(e, t(e.debugName), "derived", n.value, n.stateStr, Array.from(n.dependencies).map((s) => T.from(s, t) || T.unknown(s)));
1273
+ } else if (e instanceof tt) {
1657
1274
  const n = e.debugGetState();
1658
- return new R(e, t(e.debugName), "observableValue", n.value, "upToDate", []);
1659
- } else if (e instanceof A) {
1275
+ return new T(e, t(e.debugName), "observableValue", n.value, "upToDate", []);
1276
+ } else if (e instanceof L) {
1660
1277
  const n = e.debugGetState();
1661
- return new R(e, t(e.debugName), "fromEvent", n.value, n.hasValue ? "upToDate" : "initial", []);
1278
+ return new T(e, t(e.debugName), "fromEvent", n.value, n.hasValue ? "upToDate" : "initial", []);
1662
1279
  }
1663
1280
  }
1664
1281
  static unknown(e) {
1665
- return new R(e, "(unknown)", "unknown", void 0, "unknown", []);
1282
+ return new T(e, "(unknown)", "unknown", void 0, "unknown", []);
1666
1283
  }
1667
- constructor(e, t, n, r, i, o) {
1668
- this.sourceObj = e, this.name = t, this.type = n, this.value = r, this.state = i, this.dependencies = o;
1284
+ constructor(e, t, n, s, o, i) {
1285
+ this.sourceObj = e, this.name = t, this.type = n, this.value = s, this.state = o, this.dependencies = i;
1669
1286
  }
1670
1287
  }
1671
- Gt(hn);
1672
- Et(en);
1673
- Qe(P.getInstance());
1674
- class un {
1288
+ $t(nr);
1289
+ kt(Jt);
1290
+ class sr {
1675
1291
  constructor() {
1676
1292
  l(this, "_fixtures", x(this, /* @__PURE__ */ new Map()));
1677
1293
  /** Observable root of the fixture tree */
1678
- l(this, "root", F(this, (e) => {
1294
+ l(this, "root", N(this, (e) => {
1679
1295
  const t = this._fixtures.read(e);
1680
- return le(t);
1296
+ return oe(t);
1681
1297
  }));
1682
1298
  }
1683
1299
  /**
@@ -1708,18 +1324,18 @@ class un {
1708
1324
  */
1709
1325
  getNode(e, t) {
1710
1326
  const n = this.root.read(e);
1711
- return Fe(n, t);
1327
+ return Oe(n, t);
1712
1328
  }
1713
1329
  /**
1714
1330
  * Gets a component by path (non-reactive, for use in preview iframe).
1715
1331
  * @param path Array of path segments (e.g., ['Button', 'Primary'])
1716
1332
  */
1717
1333
  getComponentByPath(e) {
1718
- const t = this._fixtures.get(), n = le(t), r = Fe(n, e);
1719
- return r == null ? void 0 : r.component;
1334
+ const t = this._fixtures.get(), n = oe(t), s = Oe(n, e);
1335
+ return s == null ? void 0 : s.component;
1720
1336
  }
1721
1337
  }
1722
- class As {
1338
+ class kn {
1723
1339
  constructor(e, t) {
1724
1340
  l(this, "sessionId", Math.random().toString(36).slice(2));
1725
1341
  l(this, "_updateVersion", 0);
@@ -1746,66 +1362,71 @@ class As {
1746
1362
  return this._flattenFixtures(this._root);
1747
1363
  }
1748
1364
  async renderFixture(e) {
1365
+ var C;
1749
1366
  const t = this._findFixtureNode(this._root, e);
1750
1367
  if (!t || !t.component)
1751
1368
  throw new Error("Fixture not found: " + e);
1752
- this._currentDisposable && (this._currentDisposable.dispose(), this._currentDisposable = void 0), this._currentContainer && (this._currentContainer.remove(), this._currentContainer = void 0);
1369
+ (C = this._currentDisposable) != null && C.dispose && this._currentDisposable.dispose(), this._currentDisposable = void 0, this._currentContainer && (this._currentContainer.remove(), this._currentContainer = void 0);
1753
1370
  const n = document.createElement("div");
1754
1371
  n.style.display = "inline-block", this._containerElement.appendChild(n), this._currentContainer = n;
1755
- const r = t.component, i = Dt(r.properties);
1756
- let o = n;
1757
- if (r.isolation === "shadow-dom") {
1758
- const g = n.attachShadow({ mode: "open" });
1759
- o = document.createElement("div"), g.appendChild(o);
1372
+ const s = t.component, o = Rt(s.properties);
1373
+ let i = n;
1374
+ if (s.isolation === "shadow-dom") {
1375
+ const m = n.attachShadow({ mode: "open" });
1376
+ i = document.createElement("div"), m.appendChild(i);
1760
1377
  }
1761
1378
  const d = [], c = console.error, h = console.warn;
1762
- console.error = (...g) => {
1763
- d.push({ kind: "console", level: "error", message: g.map(String).join(" ") }), c.apply(console, g);
1764
- }, console.warn = (...g) => {
1765
- d.push({ kind: "console", level: "warn", message: g.map(String).join(" ") }), h.apply(console, g);
1379
+ console.error = (...m) => {
1380
+ d.push({ kind: "console", level: "error", message: m.map(String).join(" ") }), c.apply(console, m);
1381
+ }, console.warn = (...m) => {
1382
+ d.push({ kind: "console", level: "warn", message: m.map(String).join(" ") }), h.apply(console, m);
1766
1383
  };
1767
- const m = (g) => {
1384
+ const g = (m) => {
1768
1385
  var v;
1769
- d.push({ kind: "exception", message: g.message, stack: (v = g.error) == null ? void 0 : v.stack });
1770
- }, _ = (g) => {
1771
- const v = g.reason, E = v instanceof Error ? v.message : String(v), V = v instanceof Error ? v.stack : void 0;
1772
- d.push({ kind: "exception", message: E, stack: V });
1386
+ d.push({ kind: "exception", message: m.message, stack: (v = m.error) == null ? void 0 : v.stack });
1387
+ }, _ = (m) => {
1388
+ const v = m.reason, O = v instanceof Error ? v.message : String(v), S = v instanceof Error ? v.stack : void 0;
1389
+ d.push({ kind: "exception", message: O, stack: S });
1773
1390
  };
1774
- window.addEventListener("error", m), window.addEventListener("unhandledrejection", _);
1391
+ window.addEventListener("error", g), window.addEventListener("unhandledrejection", _);
1775
1392
  try {
1776
- const g = r.render(o, i);
1777
- this._currentDisposable = g && typeof g == "object" && "dispose" in g ? g : void 0;
1778
- } catch (g) {
1779
- const v = g instanceof Error ? g : new Error(String(g));
1393
+ const m = new AbortController();
1394
+ let v = s.render(i, {
1395
+ props: o,
1396
+ signal: m.signal
1397
+ });
1398
+ v instanceof Promise && (v = await v), this._currentDisposable = v ?? void 0, v != null && v.ready && await v.ready;
1399
+ } catch (m) {
1400
+ const v = m instanceof Error ? m : new Error(String(m));
1780
1401
  d.push({ kind: "exception", message: v.message, stack: v.stack });
1781
1402
  } finally {
1782
1403
  console.error = c, console.warn = h;
1783
1404
  }
1784
- return await new Promise((g) => requestAnimationFrame(() => requestAnimationFrame(() => g()))), window.removeEventListener("error", m), window.removeEventListener("unhandledrejection", _), { errors: d };
1405
+ return await new Promise((m) => requestAnimationFrame(() => requestAnimationFrame(() => m()))), window.removeEventListener("error", g), window.removeEventListener("unhandledrejection", _), { errors: d };
1785
1406
  }
1786
1407
  _buildRegistry() {
1787
1408
  const e = /* @__PURE__ */ new Map();
1788
1409
  for (const [t, n] of Object.entries(this._fixtureModules)) {
1789
- const r = n.default;
1790
- r && typeof r == "object" && e.set(t, r);
1410
+ const s = n.default;
1411
+ s && typeof s == "object" && e.set(t, s);
1791
1412
  }
1792
- return le(e);
1413
+ return oe(e);
1793
1414
  }
1794
1415
  _flattenFixtures(e, t = []) {
1795
- var r;
1416
+ var s;
1796
1417
  const n = [];
1797
- e.type === "component" && n.push({ fixtureId: e.id, fixtureName: e.name, groupPath: t, background: ((r = e.component) == null ? void 0 : r.background) ?? "light" });
1798
- for (const i of e.children ?? []) {
1799
- const o = e.id ? [...t, e.name] : t;
1800
- n.push(...this._flattenFixtures(i, o));
1418
+ e.type === "component" && n.push({ fixtureId: e.id, fixtureName: e.name, groupPath: t, background: ((s = e.component) == null ? void 0 : s.background) ?? "light" });
1419
+ for (const o of e.children ?? []) {
1420
+ const i = e.id ? [...t, e.name] : t;
1421
+ n.push(...this._flattenFixtures(o, i));
1801
1422
  }
1802
1423
  return n;
1803
1424
  }
1804
1425
  _findFixtureNode(e, t) {
1805
1426
  if (e.id === t) return e;
1806
1427
  for (const n of e.children ?? []) {
1807
- const r = this._findFixtureNode(n, t);
1808
- if (r) return r;
1428
+ const s = this._findFixtureNode(n, t);
1429
+ if (s) return s;
1809
1430
  }
1810
1431
  }
1811
1432
  _installGlobalApi() {
@@ -1821,7 +1442,7 @@ class As {
1821
1442
  });
1822
1443
  }
1823
1444
  }
1824
- class fn {
1445
+ class or {
1825
1446
  constructor(e) {
1826
1447
  this._run = e, this._changes = [], this._map = /* @__PURE__ */ new Map(), this._updateCounter = 0;
1827
1448
  }
@@ -1848,48 +1469,48 @@ class fn {
1848
1469
  }
1849
1470
  }
1850
1471
  function u() {
1851
- return ge.instance;
1472
+ return ce.instance;
1852
1473
  }
1853
- function pn() {
1854
- return me.instance;
1474
+ function ir() {
1475
+ return le.instance;
1855
1476
  }
1856
- function gn() {
1857
- return ve.instance;
1477
+ function ar() {
1478
+ return he.instance;
1858
1479
  }
1859
- u.const = pn;
1860
- u.obs = gn;
1861
- class ge {
1480
+ u.const = ir;
1481
+ u.obs = ar;
1482
+ class ce {
1862
1483
  create(e) {
1863
- const t = F((n) => e(n));
1484
+ const t = N((n) => e(n));
1864
1485
  return { read: (n) => t };
1865
1486
  }
1866
1487
  }
1867
- ge.instance = new ge();
1868
- class me {
1488
+ ce.instance = new ce();
1489
+ class le {
1869
1490
  create(e) {
1870
- const t = F((n) => e(n));
1491
+ const t = N((n) => e(n));
1871
1492
  return { read: (n) => t.read(n) };
1872
1493
  }
1873
1494
  }
1874
- me.instance = new me();
1875
- class ve {
1495
+ le.instance = new le();
1496
+ class he {
1876
1497
  create(e) {
1877
- const t = F((n) => {
1878
- const r = e(n);
1879
- return mn(r) ? r.read(n) : r;
1498
+ const t = N((n) => {
1499
+ const s = e(n);
1500
+ return dr(s) ? s.read(n) : s;
1880
1501
  });
1881
1502
  return { read: (n) => t };
1882
1503
  }
1883
1504
  }
1884
- ve.instance = new ve();
1885
- function mn(s) {
1886
- return typeof s == "object" && s !== null && "read" in s;
1505
+ he.instance = new he();
1506
+ function dr(r) {
1507
+ return typeof r == "object" && r !== null && "read" in r;
1887
1508
  }
1888
- function Z(s, e) {
1889
- return Object.fromEntries(Object.entries(s).map(([t, n]) => [t, e(n, t)]));
1509
+ function K(r, e) {
1510
+ return Object.fromEntries(Object.entries(r).map(([t, n]) => [t, e(n, t)]));
1890
1511
  }
1891
- const de = Symbol("ViewModelContext");
1892
- class vn {
1512
+ const ne = Symbol("ViewModelContext");
1513
+ class cr {
1893
1514
  constructor(e) {
1894
1515
  this._store = new Y(), this.props = e;
1895
1516
  }
@@ -1897,35 +1518,35 @@ class vn {
1897
1518
  this._store.dispose();
1898
1519
  }
1899
1520
  }
1900
- function _n(s) {
1901
- return s[de] || (s[de] = Je(void 0)), s[de];
1521
+ function lr(r) {
1522
+ return r[ne] || (r[ne] = Ue(void 0)), r[ne];
1902
1523
  }
1903
- function z(s = {}) {
1524
+ function F(r = {}) {
1904
1525
  var e;
1905
- return e = class extends vn {
1906
- }, e._props = s, e;
1526
+ return e = class extends cr {
1527
+ }, e._props = r, e;
1907
1528
  }
1908
- let _e = 0;
1909
- const bn = new fn((s) => {
1910
- for (const e of s)
1529
+ let ue = 0;
1530
+ const hr = new or((r) => {
1531
+ for (const e of r)
1911
1532
  e.rendered = !1;
1912
- if (_e > 0) {
1913
- const e = s.find((t) => t.isRendering);
1914
- e.itemsToRender = s;
1533
+ if (ue > 0) {
1534
+ const e = r.find((t) => t.isRendering);
1535
+ e.itemsToRender = r;
1915
1536
  } else
1916
- Ze(() => {
1917
- for (const e of s)
1537
+ Pe(() => {
1538
+ for (const e of r)
1918
1539
  e.rendered || e.forceUpdate();
1919
1540
  });
1920
1541
  });
1921
- let yn = 0;
1922
- class xn {
1542
+ let ur = 0;
1543
+ class fr {
1923
1544
  constructor(e, t) {
1924
1545
  this.debugName = e, this.renderFactory = t, this._obsProps = void 0, this.forceUpdate = void 0, this._render = void 0, this._disposable = void 0, this.contextValues = /* @__PURE__ */ new Map(), this.cleanupEffect = () => () => {
1925
1546
  var n;
1926
1547
  (n = this._disposable) == null || n.dispose();
1927
1548
  }, this.itemsToRender = [], this.handleAfterRender = () => {
1928
- Ze(() => {
1549
+ Pe(() => {
1929
1550
  for (const n of this.itemsToRender)
1930
1551
  n.rendered || n.forceUpdate();
1931
1552
  }), this.itemsToRender = [];
@@ -1935,139 +1556,139 @@ class xn {
1935
1556
  return this.debugName;
1936
1557
  }
1937
1558
  updateProps(e) {
1938
- this._obsProps ? this._obsProps.set(e, void 0) : (this._obsProps = x(this, e), this._render = this.renderFactory(this._obsProps, () => this.contextValues), this.rendering = F(this, this._render), this._disposable = bn.addDependency(this.rendering, this));
1559
+ this._obsProps ? this._obsProps.set(e, void 0) : (this._obsProps = x(this, e), this._render = this.renderFactory(this._obsProps, () => this.contextValues), this.rendering = N(this, this._render), this._disposable = hr.addDependency(this.rendering, this));
1939
1560
  }
1940
1561
  }
1941
- function Re(s, e, t) {
1942
- const n = (o) => o + 1, r = () => new xn(s + ++yn, e), i = function(o) {
1943
- const d = Ot(n, 0)[1], c = Rt(r)[0];
1562
+ function xe(r, e, t) {
1563
+ const n = (i) => i + 1, s = () => new fr(r + ++ur, e), o = function(i) {
1564
+ const d = bt(n, 0)[1], c = yt(s)[0];
1944
1565
  for (const h of t ?? [])
1945
- c.contextValues.set(h, Tt(h));
1946
- if (De(c.cleanupEffect, []), De(c.handleAfterRender), c.isRendering)
1566
+ c.contextValues.set(h, xt(h));
1567
+ if (Te(c.cleanupEffect, []), Te(c.handleAfterRender), c.isRendering)
1947
1568
  throw new Error("Component is already rendering");
1948
- c.isRendering = !0, _e++;
1569
+ c.isRendering = !0, ue++;
1949
1570
  try {
1950
- c.forceUpdate = d, c.updateProps(o);
1571
+ c.forceUpdate = d, c.updateProps(i);
1951
1572
  const h = c.rendering.get();
1952
1573
  return c.rendered = !0, h;
1953
1574
  } finally {
1954
- c.isRendering = !1, _e--;
1575
+ c.isRendering = !1, ue--;
1955
1576
  }
1956
1577
  };
1957
- return i.displayName = s, i;
1958
- }
1959
- Re("ObsView", (s) => (e) => s.read(e).children(e));
1960
- function k(s, e) {
1961
- return Re("view", (t) => {
1962
- const n = Z(s, (r, i) => r.create((o) => t.read(o)[i], void 0));
1963
- return (r) => {
1964
- const i = Z(n, (o) => o.read(r));
1965
- return e(r, i);
1578
+ return o.displayName = r, o;
1579
+ }
1580
+ xe("ObsView", (r) => (e) => r.read(e).children(e));
1581
+ function I(r, e) {
1582
+ return xe("view", (t) => {
1583
+ const n = K(r, (s, o) => s.create((i) => t.read(i)[o], void 0));
1584
+ return (s) => {
1585
+ const o = K(n, (i) => i.read(s));
1586
+ return e(s, o);
1966
1587
  };
1967
1588
  });
1968
1589
  }
1969
- function Cn(s) {
1590
+ function pr(r) {
1970
1591
  const e = [];
1971
- for (const t of Object.values(s)) {
1592
+ for (const t of Object.values(r)) {
1972
1593
  const n = t._requiredContext;
1973
1594
  n && !e.includes(n) && e.push(n);
1974
1595
  }
1975
1596
  return e;
1976
1597
  }
1977
- function $(s, e, t) {
1978
- const n = typeof e == "function" ? {} : e, r = typeof e == "function" ? e : t, i = "_props" in s ? s._props : {}, o = Cn({ ...i, ...n }), d = _n(s), c = [...o, d];
1979
- return Re("viewWithModel", (h, m) => {
1980
- const _ = m(), g = _.get(d), v = "_props" in s ? Z(s._props, (S, H) => S.create((L) => h.read(L)[H], _.get(S._requiredContext))) : {}, E = g ? { read: () => g, dispose: () => {
1981
- } } : Jt((S) => {
1982
- const H = Z(v, (L) => L.read(S));
1983
- return new s(H);
1984
- }), V = Z(n, (S, H) => S.create((L) => h.read(L)[H], _.get(S._requiredContext)));
1598
+ function E(r, e, t) {
1599
+ const n = typeof e == "function" ? {} : e, s = typeof e == "function" ? e : t, o = "_props" in r ? r._props : {}, i = pr({ ...o, ...n }), d = lr(r), c = [...i, d];
1600
+ return xe("viewWithModel", (h, g) => {
1601
+ const _ = g(), C = _.get(d), m = "_props" in r ? K(r._props, (S, B) => S.create((A) => h.read(A)[B], _.get(S._requiredContext))) : {}, v = C ? { read: () => C, dispose: () => {
1602
+ } } : Pt((S) => {
1603
+ const B = K(m, (A) => A.read(S));
1604
+ return new r(B);
1605
+ }), O = K(n, (S, B) => S.create((A) => h.read(A)[B], _.get(S._requiredContext)));
1985
1606
  return (S) => {
1986
- const H = E.read(S), L = Z(V, (Ct) => Ct.read(S));
1987
- return r(S, H, L);
1607
+ const B = v.read(S), A = K(O, (gt) => gt.read(S));
1608
+ return s(S, B, A);
1988
1609
  };
1989
1610
  }, c.length > 0 ? c : void 0);
1990
1611
  }
1991
- k({ value: u.obs() }, (s, e) => e.value.read(s));
1992
- Je(null);
1993
- function ht(s) {
1612
+ I({ value: u.obs() }, (r, e) => e.value.read(r));
1613
+ Ue(null);
1614
+ function st(r) {
1994
1615
  var e;
1995
1616
  return {
1996
- id: s.id,
1997
- name: s.name,
1998
- type: s.type,
1999
- children: (e = s.children) == null ? void 0 : e.map(ht),
2000
- component: s.component
1617
+ id: r.id,
1618
+ name: r.name,
1619
+ type: r.type,
1620
+ children: (e = r.children) == null ? void 0 : e.map(st),
1621
+ component: r.component
2001
1622
  };
2002
1623
  }
2003
- function te(s, e) {
1624
+ function Q(r, e) {
2004
1625
  const {
2005
1626
  storageKey: t,
2006
1627
  defaultValue: n,
2007
- serialize: r = JSON.stringify,
2008
- deserialize: i = JSON.parse
1628
+ serialize: s = JSON.stringify,
1629
+ deserialize: o = JSON.parse
2009
1630
  } = e;
2010
- let o = n;
1631
+ let i = n;
2011
1632
  try {
2012
1633
  const h = localStorage.getItem(t);
2013
- h !== null && (o = i(h));
1634
+ h !== null && (i = o(h));
2014
1635
  } catch {
2015
1636
  }
2016
- const d = x(s, o), c = d.set.bind(d);
2017
- return d.set = (h, m) => {
1637
+ const d = x(r, i), c = d.set.bind(d);
1638
+ return d.set = (h, g) => {
2018
1639
  try {
2019
- localStorage.setItem(t, r(h));
1640
+ localStorage.setItem(t, s(h));
2020
1641
  } catch {
2021
1642
  }
2022
- c(h, m);
1643
+ c(h, g);
2023
1644
  }, d;
2024
1645
  }
2025
- class Sn extends z({
1646
+ class gr extends F({
2026
1647
  registry: u.const(),
2027
1648
  daemonModel: u.const(),
2028
1649
  reportModel: u.const()
2029
1650
  }) {
2030
1651
  constructor() {
2031
1652
  super(...arguments);
2032
- l(this, "leftSidebarVisible", te(this, {
1653
+ l(this, "leftSidebarVisible", Q(this, {
2033
1654
  storageKey: "component-explorer:leftSidebarVisible",
2034
1655
  defaultValue: !0
2035
1656
  }));
2036
- l(this, "rightSidebarVisible", te(this, {
1657
+ l(this, "rightSidebarVisible", Q(this, {
2037
1658
  storageKey: "component-explorer:rightSidebarVisible",
2038
1659
  defaultValue: !1
2039
1660
  }));
2040
- l(this, "isDarkTheme", te(this, {
1661
+ l(this, "isDarkTheme", Q(this, {
2041
1662
  storageKey: "component-explorer:isDarkTheme",
2042
1663
  defaultValue: !0
2043
1664
  }));
2044
- l(this, "selectedNodeId", te(this, {
1665
+ l(this, "selectedNodeId", Q(this, {
2045
1666
  storageKey: "component-explorer:selectedNodeId",
2046
1667
  defaultValue: void 0
2047
1668
  }));
2048
1669
  l(this, "expandedNodeIds", x(this, /* @__PURE__ */ new Set([""])));
2049
- l(this, "viewMode", te(this, {
1670
+ l(this, "viewMode", Q(this, {
2050
1671
  storageKey: "component-explorer:viewMode",
2051
1672
  defaultValue: "session"
2052
1673
  }));
2053
1674
  /** The explorer's tree derived from the registry or report */
2054
- l(this, "tree", F(this, (t) => {
1675
+ l(this, "tree", N(this, (t) => {
2055
1676
  const n = this.props.reportModel;
2056
1677
  if (n)
2057
1678
  return n.buildTree(t);
2058
- const r = this.props.registry.root.read(t);
2059
- return ht(r);
1679
+ const s = this.props.registry.root.read(t);
1680
+ return st(s);
2060
1681
  }));
2061
- l(this, "selectedNode", F(this, (t) => {
1682
+ l(this, "selectedNode", N(this, (t) => {
2062
1683
  const n = this.selectedNodeId.read(t);
2063
1684
  if (n === void 0) return;
2064
- const r = this.tree.read(t);
2065
- return r.id === n ? r : this._findNode(r.children ?? [], n);
1685
+ const s = this.tree.read(t);
1686
+ return s.id === n ? s : this._findNode(s.children ?? [], n);
2066
1687
  }));
2067
1688
  /** List of preview rows to render based on current selection and view mode */
2068
- l(this, "selectedFixtures", F(this, (t) => {
1689
+ l(this, "selectedFixtures", N(this, (t) => {
2069
1690
  const n = this.selectedNode.read(t);
2070
- return n ? this.isReportMode ? (this.props.reportModel.state.read(t), this._collectReportRows(n, n.name)) : this.viewMode.read(t) === "diff" && this.daemonAvailable ? this._collectDiffRows(n, n.name) : this._collectPreviewRows(n, n.name) : [];
1691
+ return n ? this.isReportMode ? (this.props.reportModel.state.read(t), this._collectReportRows(n, n.name)) : this.viewMode.read(t) === "diff" && this.daemonAvailable && this.daemon.sessions.read(t).length > 1 ? this._collectDiffRows(n, n.name) : this._collectPreviewRows(n, n.name) : [];
2071
1692
  }));
2072
1693
  l(this, "setViewMode", (t) => {
2073
1694
  this.viewMode.set(t, void 0);
@@ -2075,8 +1696,8 @@ class Sn extends z({
2075
1696
  l(this, "navigateToSession", (t) => {
2076
1697
  const n = this.props.daemonModel;
2077
1698
  if (!n) return;
2078
- const r = n.getSessionExplorerUrl(t);
2079
- r && (window.location.href = r);
1699
+ const s = n.getSessionExplorerUrl(t);
1700
+ s && (window.location.href = s);
2080
1701
  });
2081
1702
  l(this, "toggleLeftSidebar", () => {
2082
1703
  this.leftSidebarVisible.set(!this.leftSidebarVisible.get(), void 0);
@@ -2091,8 +1712,8 @@ class Sn extends z({
2091
1712
  this.selectedNodeId.set(t, void 0);
2092
1713
  });
2093
1714
  l(this, "toggleNodeExpanded", (t) => {
2094
- const n = this.expandedNodeIds.get(), r = new Set(n);
2095
- r.has(t) ? r.delete(t) : r.add(t), this.expandedNodeIds.set(r, void 0);
1715
+ const n = this.expandedNodeIds.get(), s = new Set(n);
1716
+ s.has(t) ? s.delete(t) : s.add(t), this.expandedNodeIds.set(s, void 0);
2096
1717
  });
2097
1718
  }
2098
1719
  get daemonAvailable() {
@@ -2111,11 +1732,11 @@ class Sn extends z({
2111
1732
  return this.expandedNodeIds.read(n).has(t);
2112
1733
  }
2113
1734
  _findNode(t, n) {
2114
- for (const r of t) {
2115
- if (r.id === n) return r;
2116
- if (r.children) {
2117
- const i = this._findNode(r.children, n);
2118
- if (i) return i;
1735
+ for (const s of t) {
1736
+ if (s.id === n) return s;
1737
+ if (s.children) {
1738
+ const o = this._findNode(s.children, n);
1739
+ if (o) return o;
2119
1740
  }
2120
1741
  }
2121
1742
  }
@@ -2131,28 +1752,28 @@ class Sn extends z({
2131
1752
  }
2132
1753
  }];
2133
1754
  if (t.type === "variants") {
2134
- const i = [];
2135
- for (const o of t.children ?? [])
2136
- o.type === "component" && o.component && i.push({
2137
- id: o.id,
2138
- name: o.name,
2139
- path: `${n} / ${o.name}`,
2140
- component: o.component
1755
+ const o = [];
1756
+ for (const i of t.children ?? [])
1757
+ i.type === "component" && i.component && o.push({
1758
+ id: i.id,
1759
+ name: i.name,
1760
+ path: `${n} / ${i.name}`,
1761
+ component: i.component
2141
1762
  });
2142
- return i.length > 0 ? [{
1763
+ return o.length > 0 ? [{
2143
1764
  type: "variants",
2144
1765
  id: t.id,
2145
1766
  name: t.name,
2146
1767
  path: n,
2147
- fixtures: i
1768
+ fixtures: o
2148
1769
  }] : [];
2149
1770
  }
2150
- const r = [];
2151
- for (const i of t.children ?? []) {
2152
- const o = n ? `${n} / ${i.name}` : i.name;
2153
- r.push(...this._collectPreviewRows(i, o));
1771
+ const s = [];
1772
+ for (const o of t.children ?? []) {
1773
+ const i = n ? `${n} / ${o.name}` : o.name;
1774
+ s.push(...this._collectPreviewRows(o, i));
2154
1775
  }
2155
- return r;
1776
+ return s;
2156
1777
  }
2157
1778
  /**
2158
1779
  * In diff mode: fixtures become screenshot comparison items showing current vs baseline.
@@ -2172,34 +1793,34 @@ class Sn extends z({
2172
1793
  }]
2173
1794
  }];
2174
1795
  if (t.type === "variants") {
2175
- const i = [];
2176
- for (const o of t.children ?? [])
2177
- o.type === "component" && i.push({
2178
- fixtureId: o.id,
2179
- name: o.name,
2180
- path: `${n} / ${o.name}`
1796
+ const o = [];
1797
+ for (const i of t.children ?? [])
1798
+ i.type === "component" && o.push({
1799
+ fixtureId: i.id,
1800
+ name: i.name,
1801
+ path: `${n} / ${i.name}`
2181
1802
  });
2182
- return i.length > 0 ? [{
1803
+ return o.length > 0 ? [{
2183
1804
  type: "screenshot-comparison",
2184
1805
  id: t.id,
2185
1806
  name: t.name,
2186
1807
  path: n,
2187
- items: i
1808
+ items: o
2188
1809
  }] : [];
2189
1810
  }
2190
- const r = [];
2191
- for (const i of t.children ?? []) {
2192
- const o = n ? `${n} / ${i.name}` : i.name;
2193
- r.push(...this._collectDiffRows(i, o));
1811
+ const s = [];
1812
+ for (const o of t.children ?? []) {
1813
+ const i = n ? `${n} / ${o.name}` : o.name;
1814
+ s.push(...this._collectDiffRows(o, i));
2194
1815
  }
2195
- return r;
1816
+ return s;
2196
1817
  }
2197
1818
  _collectReportRows(t, n) {
2198
- const r = this.props.reportModel.state.get();
2199
- if (r.status !== "ready") return [];
2200
- const i = r.report.fixtures;
1819
+ const s = this.props.reportModel.state.get();
1820
+ if (s.status !== "ready") return [];
1821
+ const o = s.report.fixtures;
2201
1822
  if (t.type === "component") {
2202
- const d = i[t.id];
1823
+ const d = o[t.id];
2203
1824
  return d ? [{
2204
1825
  type: "report-comparison",
2205
1826
  id: t.id,
@@ -2213,12 +1834,12 @@ class Sn extends z({
2213
1834
  }]
2214
1835
  }] : [];
2215
1836
  }
2216
- const o = [];
1837
+ const i = [];
2217
1838
  for (const d of t.children ?? []) {
2218
1839
  const c = n ? `${n} / ${d.name}` : d.name;
2219
- o.push(...this._collectReportRows(d, c));
1840
+ i.push(...this._collectReportRows(d, c));
2220
1841
  }
2221
- return o;
1842
+ return i;
2222
1843
  }
2223
1844
  }
2224
1845
  const p = {
@@ -2410,10 +2031,10 @@ const p = {
2410
2031
  cursor: "pointer"
2411
2032
  }
2412
2033
  };
2413
- function Te(...s) {
2414
- return Object.assign({}, ...s.filter(Boolean));
2034
+ function Ce(...r) {
2035
+ return Object.assign({}, ...r.filter(Boolean));
2415
2036
  }
2416
- class wn extends z({
2037
+ class mr extends F({
2417
2038
  active: u()
2418
2039
  }) {
2419
2040
  constructor() {
@@ -2427,23 +2048,23 @@ class wn extends z({
2427
2048
  return this.props.active;
2428
2049
  }
2429
2050
  }
2430
- const ce = $(
2431
- wn,
2051
+ const se = E(
2052
+ mr,
2432
2053
  {
2433
2054
  onClick: u.const(),
2434
2055
  title: u.const(),
2435
2056
  children: u.const()
2436
2057
  },
2437
- (s, e, t) => {
2438
- const n = e.isHovered.read(s), r = e.active.read(s), i = Te(
2058
+ (r, e, t) => {
2059
+ const n = e.isHovered.read(r), s = e.active.read(r), o = Ce(
2439
2060
  p.titleBarButton,
2440
- n && !r && p.titleBarButtonHover,
2441
- r && p.titleBarButtonActive
2061
+ n && !s && p.titleBarButtonHover,
2062
+ s && p.titleBarButtonActive
2442
2063
  );
2443
2064
  return /* @__PURE__ */ a(
2444
2065
  "button",
2445
2066
  {
2446
- style: i,
2067
+ style: o,
2447
2068
  onClick: t.onClick,
2448
2069
  title: t.title,
2449
2070
  onMouseEnter: () => e.setHovered(!0),
@@ -2452,20 +2073,20 @@ const ce = $(
2452
2073
  }
2453
2074
  );
2454
2075
  }
2455
- ), In = ({ style: s }) => /* @__PURE__ */ a("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "currentColor", style: s, children: /* @__PURE__ */ a("path", { d: "M5.7 13.7L5 13l4.6-4.6L5 3.7l.7-.7 5.3 5.4-5.3 5.3z" }) }), On = ({ style: s }) => /* @__PURE__ */ a("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "currentColor", style: s, children: /* @__PURE__ */ a("path", { d: "M11 5.5L6 10.5L5.3 9.8L9.6 5.5L5.3 1.2L6 0.5L11 5.5z", transform: "rotate(90 8 5.5)" }) }), Rn = ({ style: s }) => /* @__PURE__ */ a("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "currentColor", style: s, children: /* @__PURE__ */ a("path", { d: "M14.5 2H9l-.35.15-.65.64-.65-.64L7 2H1.5l-.5.5v10l.5.5H7l.35-.15.65-.64.65.64.35.15h5.5l.5-.5v-10l-.5-.5zm-7 10H2V3h5v.86L5.85 5l1.15 1.14V10l-1.15-1.14L7 7.72V12zm6 0H8V7.72l1.15 1.14L8 10V6.14L9.15 5 8 3.86V3h5v9z" }) }), Tn = ({ style: s }) => /* @__PURE__ */ a("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "currentColor", style: s, children: /* @__PURE__ */ a("path", { d: "M14.5 3H7.71l-.85-.85L6.5 2h-5l-.5.5v11l.5.5h13l.5-.5v-10l-.5-.5zm-.5 10H2V6h12v7zm0-8H2V3h4.29l.85.85.36.15H14v1z" }) }), kn = () => /* @__PURE__ */ a("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "currentColor", children: /* @__PURE__ */ a("path", { d: "M2 2v12h12V2H2zm11 11H6V3h7v10zM3 3h2v10H3V3z" }) }), Vn = () => /* @__PURE__ */ a("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "currentColor", children: /* @__PURE__ */ a("path", { d: "M2 2v12h12V2H2zm6 11V3h5v10H8zM3 3h4v10H3V3z" }) }), Nn = () => /* @__PURE__ */ a("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "currentColor", children: /* @__PURE__ */ a("path", { d: "M8 11a3 3 0 1 1 0-6 3 3 0 0 1 0 6zm0 1a4 4 0 1 0 0-8 4 4 0 0 0 0 8zM8 0a.5.5 0 0 1 .5.5v2a.5.5 0 0 1-1 0v-2A.5.5 0 0 1 8 0zm0 13a.5.5 0 0 1 .5.5v2a.5.5 0 0 1-1 0v-2A.5.5 0 0 1 8 13zm8-5a.5.5 0 0 1-.5.5h-2a.5.5 0 0 1 0-1h2a.5.5 0 0 1 .5.5zM3 8a.5.5 0 0 1-.5.5h-2a.5.5 0 0 1 0-1h2A.5.5 0 0 1 3 8zm10.657-5.657a.5.5 0 0 1 0 .707l-1.414 1.415a.5.5 0 1 1-.707-.708l1.414-1.414a.5.5 0 0 1 .707 0zm-9.193 9.193a.5.5 0 0 1 0 .707L3.05 13.657a.5.5 0 0 1-.707-.707l1.414-1.414a.5.5 0 0 1 .707 0zm9.193 2.121a.5.5 0 0 1-.707 0l-1.414-1.414a.5.5 0 0 1 .707-.707l1.414 1.414a.5.5 0 0 1 0 .707zM4.464 4.465a.5.5 0 0 1-.707 0L2.343 3.05a.5.5 0 1 1 .707-.707l1.414 1.414a.5.5 0 0 1 0 .708z" }) }), Dn = () => /* @__PURE__ */ a("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "currentColor", children: /* @__PURE__ */ a("path", { d: "M6 .278a.768.768 0 0 1 .08.858 7.208 7.208 0 0 0-.878 3.46c0 4.021 3.278 7.277 7.318 7.277.527 0 1.04-.055 1.533-.16a.787.787 0 0 1 .81.316.733.733 0 0 1-.031.893A8.349 8.349 0 0 1 8.344 16C3.734 16 0 12.286 0 7.71 0 4.266 2.114 1.312 5.124.06A.752.752 0 0 1 6 .278z" }) }), Mn = k(
2076
+ ), vr = ({ style: r }) => /* @__PURE__ */ a("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "currentColor", style: r, children: /* @__PURE__ */ a("path", { d: "M5.7 13.7L5 13l4.6-4.6L5 3.7l.7-.7 5.3 5.4-5.3 5.3z" }) }), _r = ({ style: r }) => /* @__PURE__ */ a("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "currentColor", style: r, children: /* @__PURE__ */ a("path", { d: "M11 5.5L6 10.5L5.3 9.8L9.6 5.5L5.3 1.2L6 0.5L11 5.5z", transform: "rotate(90 8 5.5)" }) }), br = ({ style: r }) => /* @__PURE__ */ a("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "currentColor", style: r, children: /* @__PURE__ */ a("path", { d: "M14.5 2H9l-.35.15-.65.64-.65-.64L7 2H1.5l-.5.5v10l.5.5H7l.35-.15.65-.64.65.64.35.15h5.5l.5-.5v-10l-.5-.5zm-7 10H2V3h5v.86L5.85 5l1.15 1.14V10l-1.15-1.14L7 7.72V12zm6 0H8V7.72l1.15 1.14L8 10V6.14L9.15 5 8 3.86V3h5v9z" }) }), yr = ({ style: r }) => /* @__PURE__ */ a("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "currentColor", style: r, children: /* @__PURE__ */ a("path", { d: "M14.5 3H7.71l-.85-.85L6.5 2h-5l-.5.5v11l.5.5h13l.5-.5v-10l-.5-.5zm-.5 10H2V6h12v7zm0-8H2V3h4.29l.85.85.36.15H14v1z" }) }), xr = () => /* @__PURE__ */ a("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "currentColor", children: /* @__PURE__ */ a("path", { d: "M2 2v12h12V2H2zm11 11H6V3h7v10zM3 3h2v10H3V3z" }) }), Cr = () => /* @__PURE__ */ a("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "currentColor", children: /* @__PURE__ */ a("path", { d: "M2 2v12h12V2H2zm6 11V3h5v10H8zM3 3h4v10H3V3z" }) }), Sr = () => /* @__PURE__ */ a("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "currentColor", children: /* @__PURE__ */ a("path", { d: "M8 11a3 3 0 1 1 0-6 3 3 0 0 1 0 6zm0 1a4 4 0 1 0 0-8 4 4 0 0 0 0 8zM8 0a.5.5 0 0 1 .5.5v2a.5.5 0 0 1-1 0v-2A.5.5 0 0 1 8 0zm0 13a.5.5 0 0 1 .5.5v2a.5.5 0 0 1-1 0v-2A.5.5 0 0 1 8 13zm8-5a.5.5 0 0 1-.5.5h-2a.5.5 0 0 1 0-1h2a.5.5 0 0 1 .5.5zM3 8a.5.5 0 0 1-.5.5h-2a.5.5 0 0 1 0-1h2A.5.5 0 0 1 3 8zm10.657-5.657a.5.5 0 0 1 0 .707l-1.414 1.415a.5.5 0 1 1-.707-.708l1.414-1.414a.5.5 0 0 1 .707 0zm-9.193 9.193a.5.5 0 0 1 0 .707L3.05 13.657a.5.5 0 0 1-.707-.707l1.414-1.414a.5.5 0 0 1 .707 0zm9.193 2.121a.5.5 0 0 1-.707 0l-1.414-1.414a.5.5 0 0 1 .707-.707l1.414 1.414a.5.5 0 0 1 0 .707zM4.464 4.465a.5.5 0 0 1-.707 0L2.343 3.05a.5.5 0 1 1 .707-.707l1.414 1.414a.5.5 0 0 1 0 .708z" }) }), wr = () => /* @__PURE__ */ a("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "currentColor", children: /* @__PURE__ */ a("path", { d: "M6 .278a.768.768 0 0 1 .08.858 7.208 7.208 0 0 0-.878 3.46c0 4.021 3.278 7.277 7.318 7.277.527 0 1.04-.055 1.533-.16a.787.787 0 0 1 .81.316.733.733 0 0 1-.031.893A8.349 8.349 0 0 1 8.344 16C3.734 16 0 12.286 0 7.71 0 4.266 2.114 1.312 5.124.06A.752.752 0 0 1 6 .278z" }) }), Rr = I(
2456
2077
  { model: u.const() },
2457
- (s, e) => {
2078
+ (r, e) => {
2458
2079
  var d, c;
2459
- const t = e.model, n = t.viewMode.read(s), r = ((d = t.daemon) == null ? void 0 : d.sessions.read(s)) ?? [], i = (c = t.daemon) == null ? void 0 : c.sessionName, o = r.filter((h) => h.name !== i);
2460
- return /* @__PURE__ */ f("div", { style: X.container, children: [
2461
- /* @__PURE__ */ f("div", { style: X.segmentedControl, children: [
2462
- /* @__PURE__ */ a(Le, { label: "Live", mode: "session", active: n === "session", onClick: () => t.setViewMode("session") }),
2463
- /* @__PURE__ */ a(Le, { label: "Diff", mode: "diff", active: n === "diff", onClick: () => t.setViewMode("diff") })
2080
+ const t = e.model, n = t.viewMode.read(r), s = ((d = t.daemon) == null ? void 0 : d.sessions.read(r)) ?? [], o = (c = t.daemon) == null ? void 0 : c.sessionName, i = s.filter((h) => h.name !== o);
2081
+ return s.length <= 1 ? null : /* @__PURE__ */ f("div", { style: J.container, children: [
2082
+ /* @__PURE__ */ f("div", { style: J.segmentedControl, children: [
2083
+ /* @__PURE__ */ a(Ee, { label: "Live", mode: "session", active: n === "session", onClick: () => t.setViewMode("session") }),
2084
+ /* @__PURE__ */ a(Ee, { label: "Diff", mode: "diff", active: n === "diff", onClick: () => t.setViewMode("diff") })
2464
2085
  ] }),
2465
- o.length > 0 && /* @__PURE__ */ a("div", { style: X.sessionLinks, children: o.map((h) => /* @__PURE__ */ f(
2086
+ i.length > 0 && /* @__PURE__ */ a("div", { style: J.sessionLinks, children: i.map((h) => /* @__PURE__ */ f(
2466
2087
  "button",
2467
2088
  {
2468
- style: X.sessionLink,
2089
+ style: J.sessionLink,
2469
2090
  onClick: () => t.navigateToSession(h.name),
2470
2091
  title: `Switch to ${h.name} session`,
2471
2092
  children: [
@@ -2478,63 +2099,63 @@ const ce = $(
2478
2099
  ] });
2479
2100
  }
2480
2101
  );
2481
- function Le({ label: s, mode: e, active: t, onClick: n }) {
2102
+ function Ee({ label: r, mode: e, active: t, onClick: n }) {
2482
2103
  return /* @__PURE__ */ a(
2483
2104
  "button",
2484
2105
  {
2485
- style: t ? X.segmentActive : X.segment,
2106
+ style: t ? J.segmentActive : J.segment,
2486
2107
  onClick: n,
2487
- children: s
2108
+ children: r
2488
2109
  }
2489
2110
  );
2490
2111
  }
2491
- const Fn = k(
2112
+ const Tr = I(
2492
2113
  {
2493
2114
  model: u.const()
2494
2115
  },
2495
- (s, e) => {
2496
- const t = e.model, n = t.leftSidebarVisible.read(s), r = t.rightSidebarVisible.read(s), i = t.isDarkTheme.read(s), o = t.selectedNode.read(s);
2116
+ (r, e) => {
2117
+ const t = e.model, n = t.leftSidebarVisible.read(r), s = t.rightSidebarVisible.read(r), o = t.isDarkTheme.read(r), i = t.selectedNode.read(r);
2497
2118
  return /* @__PURE__ */ f("div", { style: p.titleBar, children: [
2498
2119
  /* @__PURE__ */ a("div", { style: p.titleBarSection, children: /* @__PURE__ */ a(
2499
- ce,
2120
+ se,
2500
2121
  {
2501
2122
  active: n,
2502
2123
  onClick: t.toggleLeftSidebar,
2503
2124
  title: "Toggle left sidebar",
2504
- children: /* @__PURE__ */ a(kn, {})
2125
+ children: /* @__PURE__ */ a(xr, {})
2505
2126
  }
2506
2127
  ) }),
2507
2128
  /* @__PURE__ */ f("div", { style: p.titleBarCenter, children: [
2508
- t.isReportMode ? /* @__PURE__ */ a("span", { style: { fontSize: 12, color: "var(--vscode-descriptionForeground)" }, children: "Screenshot Report" }) : t.daemonAvailable ? /* @__PURE__ */ a(Mn, { model: t }) : null,
2509
- o ? /* @__PURE__ */ f(ye, { children: [
2129
+ t.isReportMode ? /* @__PURE__ */ a("span", { style: { fontSize: 12, color: "var(--vscode-descriptionForeground)" }, children: "Screenshot Report" }) : t.daemonAvailable ? /* @__PURE__ */ a(Rr, { model: t }) : null,
2130
+ i ? /* @__PURE__ */ f(pe, { children: [
2510
2131
  /* @__PURE__ */ a("span", { style: { color: "var(--vscode-textLink-foreground)" }, children: "<" }),
2511
- /* @__PURE__ */ a("span", { children: o.name }),
2132
+ /* @__PURE__ */ a("span", { children: i.name }),
2512
2133
  /* @__PURE__ */ a("span", { style: { color: "var(--vscode-textLink-foreground)" }, children: "/>" })
2513
2134
  ] }) : /* @__PURE__ */ a("span", { style: { color: "var(--vscode-descriptionForeground)" }, children: "No component selected" })
2514
2135
  ] }),
2515
2136
  /* @__PURE__ */ f("div", { style: p.titleBarSection, children: [
2516
2137
  /* @__PURE__ */ a(
2517
- ce,
2138
+ se,
2518
2139
  {
2519
2140
  active: !1,
2520
2141
  onClick: t.toggleTheme,
2521
- title: i ? "Switch to light theme" : "Switch to dark theme",
2522
- children: i ? /* @__PURE__ */ a(Nn, {}) : /* @__PURE__ */ a(Dn, {})
2142
+ title: o ? "Switch to light theme" : "Switch to dark theme",
2143
+ children: o ? /* @__PURE__ */ a(Sr, {}) : /* @__PURE__ */ a(wr, {})
2523
2144
  }
2524
2145
  ),
2525
2146
  /* @__PURE__ */ a(
2526
- ce,
2147
+ se,
2527
2148
  {
2528
- active: r,
2149
+ active: s,
2529
2150
  onClick: t.toggleRightSidebar,
2530
2151
  title: "Toggle right sidebar",
2531
- children: /* @__PURE__ */ a(Vn, {})
2152
+ children: /* @__PURE__ */ a(Cr, {})
2532
2153
  }
2533
2154
  )
2534
2155
  ] })
2535
2156
  ] });
2536
2157
  }
2537
- ), X = {
2158
+ ), J = {
2538
2159
  container: {
2539
2160
  display: "flex",
2540
2161
  alignItems: "center",
@@ -2578,15 +2199,15 @@ const Fn = k(
2578
2199
  color: "var(--vscode-textLink-foreground)",
2579
2200
  cursor: "pointer"
2580
2201
  }
2581
- }, ut = k(
2202
+ }, ot = I(
2582
2203
  {
2583
2204
  model: u.const(),
2584
2205
  nodes: u.const(),
2585
2206
  depth: u.const()
2586
2207
  },
2587
- (s, e) => /* @__PURE__ */ a(ye, { children: e.nodes.map((t) => /* @__PURE__ */ a(An, { model: e.model, node: t, depth: e.depth }, t.id)) })
2208
+ (r, e) => /* @__PURE__ */ a(pe, { children: e.nodes.map((t) => /* @__PURE__ */ a(Or, { model: e.model, node: t, depth: e.depth }, t.id)) })
2588
2209
  );
2589
- class En extends z({
2210
+ class Ir extends F({
2590
2211
  model: u.const(),
2591
2212
  node: u.const(),
2592
2213
  depth: u.const()
@@ -2621,45 +2242,45 @@ class En extends z({
2621
2242
  return !!(this.props.node.children && this.props.node.children.length > 0);
2622
2243
  }
2623
2244
  }
2624
- const An = $(En, {}, (s, e) => {
2625
- const t = e.explorerModel, n = e.treeNode, r = e.treeDepth, i = !!(n.children && n.children.length > 0), o = i ? t.isNodeExpanded(n.id, s) : !1, c = t.selectedNodeId.read(s) === n.id, h = e.isHovered.read(s), m = Te(
2245
+ const Or = E(Ir, {}, (r, e) => {
2246
+ const t = e.explorerModel, n = e.treeNode, s = e.treeDepth, o = !!(n.children && n.children.length > 0), i = o ? t.isNodeExpanded(n.id, r) : !1, c = t.selectedNodeId.read(r) === n.id, h = e.isHovered.read(r), g = Ce(
2626
2247
  p.treeItem,
2627
- { paddingLeft: `${8 + r * 12}px` },
2248
+ { paddingLeft: `${8 + s * 12}px` },
2628
2249
  c && p.treeItemSelected,
2629
2250
  !c && h && p.treeItemHover
2630
2251
  );
2631
- return /* @__PURE__ */ f(ye, { children: [
2252
+ return /* @__PURE__ */ f(pe, { children: [
2632
2253
  /* @__PURE__ */ f(
2633
2254
  "div",
2634
2255
  {
2635
- style: m,
2256
+ style: g,
2636
2257
  onClick: e.handleClick,
2637
2258
  onDoubleClick: e.handleDoubleClick,
2638
2259
  onMouseEnter: () => e.setHovered(!0),
2639
2260
  onMouseLeave: () => e.setHovered(!1),
2640
2261
  children: [
2641
- i ? /* @__PURE__ */ a("div", { style: p.treeItemChevron, onClick: e.handleChevronClick, children: o ? /* @__PURE__ */ a(On, {}) : /* @__PURE__ */ a(In, {}) }) : /* @__PURE__ */ a("div", { style: p.treeItemChevronPlaceholder }),
2642
- /* @__PURE__ */ a("div", { style: p.treeItemIcon, children: n.type === "folder" ? /* @__PURE__ */ a(Tn, { style: { color: "var(--vscode-symbolIcon-folderForeground)" } }) : /* @__PURE__ */ a(Rn, { style: { color: "#deb45b" } }) }),
2262
+ o ? /* @__PURE__ */ a("div", { style: p.treeItemChevron, onClick: e.handleChevronClick, children: i ? /* @__PURE__ */ a(_r, {}) : /* @__PURE__ */ a(vr, {}) }) : /* @__PURE__ */ a("div", { style: p.treeItemChevronPlaceholder }),
2263
+ /* @__PURE__ */ a("div", { style: p.treeItemIcon, children: n.type === "folder" ? /* @__PURE__ */ a(yr, { style: { color: "var(--vscode-symbolIcon-folderForeground)" } }) : /* @__PURE__ */ a(br, { style: { color: "#deb45b" } }) }),
2643
2264
  /* @__PURE__ */ a("span", { style: p.treeItemLabel, children: n.name }),
2644
- i && /* @__PURE__ */ a("span", { style: p.treeItemCount, children: n.children.length })
2265
+ o && /* @__PURE__ */ a("span", { style: p.treeItemCount, children: n.children.length })
2645
2266
  ]
2646
2267
  }
2647
2268
  ),
2648
- i && o && /* @__PURE__ */ a(ut, { model: t, nodes: n.children, depth: r + 1 })
2269
+ o && i && /* @__PURE__ */ a(ot, { model: t, nodes: n.children, depth: s + 1 })
2649
2270
  ] });
2650
- }), Bn = k(
2271
+ }), kr = I(
2651
2272
  {
2652
2273
  model: u.const()
2653
2274
  },
2654
- (s, e) => {
2655
- const t = e.model.tree.read(s);
2275
+ (r, e) => {
2276
+ const t = e.model.tree.read(r);
2656
2277
  return /* @__PURE__ */ f("div", { style: p.sidebar, children: [
2657
2278
  /* @__PURE__ */ a("div", { style: p.sidebarHeader, children: "Explorer" }),
2658
- /* @__PURE__ */ a("div", { style: p.sidebarContent, children: /* @__PURE__ */ a(ut, { model: e.model, nodes: [t], depth: 0 }) })
2279
+ /* @__PURE__ */ a("div", { style: p.sidebarContent, children: /* @__PURE__ */ a(ot, { model: e.model, nodes: [t], depth: 0 }) })
2659
2280
  ] });
2660
2281
  }
2661
2282
  );
2662
- class zn extends z({}) {
2283
+ class Vr extends F({}) {
2663
2284
  constructor() {
2664
2285
  super(...arguments);
2665
2286
  l(this, "checked", x(this, !1));
@@ -2668,8 +2289,8 @@ class zn extends z({}) {
2668
2289
  });
2669
2290
  }
2670
2291
  }
2671
- const $n = $(zn, {}, (s, e) => {
2672
- const t = e.checked.read(s), n = {
2292
+ const Nr = E(Vr, {}, (r, e) => {
2293
+ const t = e.checked.read(r), n = {
2673
2294
  position: "relative",
2674
2295
  width: "36px",
2675
2296
  height: "18px",
@@ -2678,7 +2299,7 @@ const $n = $(zn, {}, (s, e) => {
2678
2299
  cursor: "pointer",
2679
2300
  transition: "background-color 0.2s",
2680
2301
  border: "1px solid var(--vscode-input-border, transparent)"
2681
- }, r = {
2302
+ }, s = {
2682
2303
  position: "absolute",
2683
2304
  top: "2px",
2684
2305
  left: t ? "18px" : "2px",
@@ -2688,12 +2309,12 @@ const $n = $(zn, {}, (s, e) => {
2688
2309
  borderRadius: "50%",
2689
2310
  transition: "left 0.2s"
2690
2311
  };
2691
- return /* @__PURE__ */ a("div", { style: n, onClick: e.toggle, children: /* @__PURE__ */ a("div", { style: r }) });
2692
- }), Hn = k(
2312
+ return /* @__PURE__ */ a("div", { style: n, onClick: e.toggle, children: /* @__PURE__ */ a("div", { style: s }) });
2313
+ }), Dr = I(
2693
2314
  {
2694
2315
  node: u.const()
2695
2316
  },
2696
- (s, e) => e.node.type !== "component" ? /* @__PURE__ */ a("div", { style: { padding: "12px", color: "var(--vscode-descriptionForeground)", fontSize: "12px" }, children: "Select a component (not a folder) to view its properties" }) : /* @__PURE__ */ f("div", { style: p.propertiesPanel, children: [
2317
+ (r, e) => e.node.type !== "component" ? /* @__PURE__ */ a("div", { style: { padding: "12px", color: "var(--vscode-descriptionForeground)", fontSize: "12px" }, children: "Select a component (not a folder) to view its properties" }) : /* @__PURE__ */ f("div", { style: p.propertiesPanel, children: [
2697
2318
  /* @__PURE__ */ f("div", { style: p.propertyRow, children: [
2698
2319
  /* @__PURE__ */ f("div", { style: p.propertyLabel, children: [
2699
2320
  "children",
@@ -2740,23 +2361,23 @@ const $n = $(zn, {}, (s, e) => {
2740
2361
  "disabled",
2741
2362
  /* @__PURE__ */ a("span", { style: { color: "var(--vscode-descriptionForeground)" }, children: " : boolean" })
2742
2363
  ] }),
2743
- /* @__PURE__ */ a($n, {}),
2364
+ /* @__PURE__ */ a(Nr, {}),
2744
2365
  /* @__PURE__ */ a("div", { style: p.propertyDescription, children: "Disable the button" })
2745
2366
  ] })
2746
2367
  ] })
2747
- ), Ln = k(
2368
+ ), Mr = I(
2748
2369
  {
2749
2370
  selectedNode: u.const()
2750
2371
  },
2751
- (s, e) => /* @__PURE__ */ f("div", { style: Te(p.sidebar, p.sidebarRight), children: [
2372
+ (r, e) => /* @__PURE__ */ f("div", { style: Ce(p.sidebar, p.sidebarRight), children: [
2752
2373
  /* @__PURE__ */ f("div", { style: p.sidebarHeader, children: [
2753
2374
  /* @__PURE__ */ a("span", { style: { marginRight: "6px", color: "var(--vscode-textLink-foreground)" }, children: "</>" }),
2754
2375
  "Props"
2755
2376
  ] }),
2756
- /* @__PURE__ */ a("div", { style: p.sidebarContent, children: e.selectedNode ? /* @__PURE__ */ a(Hn, { node: e.selectedNode }) : /* @__PURE__ */ a("div", { style: { padding: "12px", color: "var(--vscode-descriptionForeground)", fontSize: "12px" }, children: "Select a component to view its properties" }) })
2377
+ /* @__PURE__ */ a("div", { style: p.sidebarContent, children: e.selectedNode ? /* @__PURE__ */ a(Dr, { node: e.selectedNode }) : /* @__PURE__ */ a("div", { style: { padding: "12px", color: "var(--vscode-descriptionForeground)", fontSize: "12px" }, children: "Select a component to view its properties" }) })
2757
2378
  ] })
2758
2379
  );
2759
- class Un extends z({
2380
+ class Fr extends F({
2760
2381
  fixture: u.const(),
2761
2382
  compact: u.const()
2762
2383
  }) {
@@ -2765,7 +2386,8 @@ class Un extends z({
2765
2386
  l(this, "_containerRef", null);
2766
2387
  l(this, "_shadowRoot", null);
2767
2388
  l(this, "_renderContainer", null);
2768
- l(this, "_disposable", null);
2389
+ l(this, "_renderResult", null);
2390
+ l(this, "_abortController", null);
2769
2391
  l(this, "_resizeObserver", null);
2770
2392
  l(this, "measuredWidth", x(this, void 0));
2771
2393
  l(this, "measuredHeight", x(this, void 0));
@@ -2773,13 +2395,13 @@ class Un extends z({
2773
2395
  if (t === this._containerRef || (this._cleanup(), this._containerRef = t, !t)) return;
2774
2396
  const n = this.fixture.component;
2775
2397
  n.isolation === "shadow-dom" ? this._renderInShadowDom(t, n) : this._renderDirect(t, n);
2776
- const r = this._renderContainer ?? t;
2777
- this._resizeObserver = new ResizeObserver((i) => {
2778
- for (const o of i) {
2779
- const { width: d, height: c } = o.contentRect;
2398
+ const s = this._renderContainer ?? t;
2399
+ this._resizeObserver = new ResizeObserver((o) => {
2400
+ for (const i of o) {
2401
+ const { width: d, height: c } = i.contentRect;
2780
2402
  c > 0 && (this.measuredWidth.set(Math.round(d), void 0), this.measuredHeight.set(Math.round(c), void 0));
2781
2403
  }
2782
- }), this._resizeObserver.observe(r);
2404
+ }), this._resizeObserver.observe(s);
2783
2405
  });
2784
2406
  }
2785
2407
  get fixture() {
@@ -2796,69 +2418,81 @@ class Un extends z({
2796
2418
  } else
2797
2419
  this._shadowRoot = t.attachShadow({ mode: "open" });
2798
2420
  if (n.styles)
2799
- for (const o of n.styles)
2800
- if (o.type === "css") {
2421
+ for (const i of n.styles)
2422
+ if (i.type === "css") {
2801
2423
  const d = document.createElement("style");
2802
- d.textContent = o.content, this._shadowRoot.appendChild(d);
2803
- } else if (o.type === "url") {
2424
+ d.textContent = i.content, this._shadowRoot.appendChild(d);
2425
+ } else if (i.type === "url") {
2804
2426
  const d = document.createElement("link");
2805
- d.rel = "stylesheet", d.href = o.href, this._shadowRoot.appendChild(d);
2806
- } else o.type === "adopted" && (this._shadowRoot.adoptedStyleSheets = [
2427
+ d.rel = "stylesheet", d.href = i.href, this._shadowRoot.appendChild(d);
2428
+ } else i.type === "adopted" && (this._shadowRoot.adoptedStyleSheets = [
2807
2429
  ...this._shadowRoot.adoptedStyleSheets,
2808
- o.sheet
2430
+ i.sheet
2809
2431
  ]);
2810
- const r = document.createElement("div");
2811
- r.style.display = "inline-block", this._renderContainer = r, this._shadowRoot.appendChild(r);
2812
- const i = this._getDefaultProps(n);
2813
- this._disposable = n.render(r, i);
2432
+ const s = document.createElement("div");
2433
+ s.style.display = "inline-block", this._renderContainer = s, this._shadowRoot.appendChild(s);
2434
+ const o = this._getDefaultProps(n);
2435
+ this._abortController = new AbortController(), this._handleRenderReturn(n.render(s, {
2436
+ props: o,
2437
+ signal: this._abortController.signal
2438
+ }));
2814
2439
  }
2815
2440
  _renderDirect(t, n) {
2816
2441
  this._renderContainer = t;
2817
- const r = this._getDefaultProps(n);
2818
- this._disposable = n.render(t, r);
2442
+ const s = this._getDefaultProps(n);
2443
+ this._abortController = new AbortController(), this._handleRenderReturn(n.render(t, {
2444
+ props: s,
2445
+ signal: this._abortController.signal
2446
+ }));
2447
+ }
2448
+ _handleRenderReturn(t) {
2449
+ t instanceof Promise ? t.then((n) => {
2450
+ this._abortController && !this._abortController.signal.aborted && (this._renderResult = n ?? void 0);
2451
+ }).catch(() => {
2452
+ }) : this._renderResult = t ?? void 0;
2819
2453
  }
2820
2454
  _getDefaultProps(t) {
2821
2455
  const n = {};
2822
- for (const r of t.properties)
2823
- n[r.name] = r.defaultValue;
2456
+ for (const s of t.properties)
2457
+ n[s.name] = s.defaultValue;
2824
2458
  return n;
2825
2459
  }
2826
2460
  _cleanup() {
2827
- var t;
2828
- this._disposable && (typeof this._disposable == "function" ? this._disposable() : typeof this._disposable.dispose == "function" && this._disposable.dispose()), this._disposable = null, (t = this._resizeObserver) == null || t.disconnect(), this._resizeObserver = null, this._shadowRoot = null, this._renderContainer = null;
2461
+ var t, n;
2462
+ this._abortController && (this._abortController.abort(), this._abortController = null), (t = this._renderResult) != null && t.dispose && this._renderResult.dispose(), this._renderResult = null, (n = this._resizeObserver) == null || n.disconnect(), this._resizeObserver = null, this._shadowRoot = null, this._renderContainer = null;
2829
2463
  }
2830
2464
  dispose() {
2831
2465
  this._cleanup();
2832
2466
  }
2833
2467
  }
2834
- const ft = $(
2835
- Un,
2468
+ const it = E(
2469
+ Fr,
2836
2470
  {},
2837
- (s, e) => {
2838
- const t = e.fixture, n = t.component, r = n.displayMode, i = e.measuredWidth.read(s), o = e.measuredHeight.read(s), d = e.compact;
2471
+ (r, e) => {
2472
+ const t = e.fixture, n = t.component, s = n.displayMode, o = e.measuredWidth.read(r), i = e.measuredHeight.read(r), d = e.compact;
2839
2473
  let c;
2840
- if (r.type === "page") {
2841
- const g = r.viewports[0], v = Nt(g);
2474
+ if (s.type === "page") {
2475
+ const C = s.viewports[0], m = wt(C);
2842
2476
  c = {
2843
- width: v.width,
2844
- height: v.height,
2477
+ width: m.width,
2478
+ height: m.height,
2845
2479
  overflow: "auto"
2846
2480
  };
2847
2481
  } else
2848
2482
  c = {
2849
2483
  display: "inline-block"
2850
2484
  };
2851
- const h = i && o ? `${i} × ${o}` : "", m = d ? K.wrapperCompact : K.wrapper, _ = d ? K.nameCompact : K.name;
2852
- return /* @__PURE__ */ f("div", { style: m, children: [
2853
- /* @__PURE__ */ f("div", { style: K.labelRow, children: [
2485
+ const h = o && i ? `${o} × ${i}` : "", g = d ? G.wrapperCompact : G.wrapper, _ = d ? G.nameCompact : G.name;
2486
+ return /* @__PURE__ */ f("div", { style: g, children: [
2487
+ /* @__PURE__ */ f("div", { style: G.labelRow, children: [
2854
2488
  /* @__PURE__ */ a("span", { style: _, children: t.name }),
2855
- !d && h && /* @__PURE__ */ a("span", { style: K.dimensions, children: h })
2489
+ !d && h && /* @__PURE__ */ a("span", { style: G.dimensions, children: h })
2856
2490
  ] }),
2857
- /* @__PURE__ */ a("div", { style: Wn(n.background), children: /* @__PURE__ */ a("div", { ref: e.setContainerRef, style: c }) })
2491
+ /* @__PURE__ */ a("div", { style: zr(n.background), children: /* @__PURE__ */ a("div", { ref: e.setContainerRef, style: c }) })
2858
2492
  ] });
2859
2493
  }
2860
- ), q = 8;
2861
- function pt(s, e) {
2494
+ ), W = 8;
2495
+ function at(r, e) {
2862
2496
  return `
2863
2497
  linear-gradient(45deg, ${e} 25%, transparent 25%),
2864
2498
  linear-gradient(-45deg, ${e} 25%, transparent 25%),
@@ -2866,29 +2500,29 @@ function pt(s, e) {
2866
2500
  linear-gradient(-45deg, transparent 75%, ${e} 75%)
2867
2501
  `;
2868
2502
  }
2869
- const jn = {
2503
+ const Er = {
2870
2504
  backgroundColor: "#ffffff",
2871
- backgroundImage: pt("#ffffff", "#e5e5e5")
2872
- }, Pn = {
2505
+ backgroundImage: at("#ffffff", "#e5e5e5")
2506
+ }, Br = {
2873
2507
  backgroundColor: "#1e1e1e",
2874
- backgroundImage: pt("#1e1e1e", "#2d2d2d")
2875
- }, Gn = {
2508
+ backgroundImage: at("#1e1e1e", "#2d2d2d")
2509
+ }, Ar = {
2876
2510
  display: "inline-block",
2877
2511
  padding: "12px",
2878
2512
  borderRadius: "4px",
2879
- backgroundSize: `${q * 2}px ${q * 2}px`,
2880
- backgroundPosition: `0 0, 0 ${q}px, ${q}px -${q}px, -${q}px 0`,
2513
+ backgroundSize: `${W * 2}px ${W * 2}px`,
2514
+ backgroundPosition: `0 0, 0 ${W}px, ${W}px -${W}px, -${W}px 0`,
2881
2515
  boxShadow: "0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.08)"
2882
2516
  };
2883
- function Wn(s) {
2884
- const e = s === "dark" ? Pn : jn;
2517
+ function zr(r) {
2518
+ const e = r === "dark" ? Br : Er;
2885
2519
  return {
2886
- ...Gn,
2520
+ ...Ar,
2887
2521
  backgroundColor: e.backgroundColor,
2888
2522
  backgroundImage: e.backgroundImage
2889
2523
  };
2890
2524
  }
2891
- const K = {
2525
+ const G = {
2892
2526
  wrapper: {
2893
2527
  marginBottom: "32px"
2894
2528
  },
@@ -2917,7 +2551,7 @@ const K = {
2917
2551
  fontFamily: "var(--vscode-editor-font-family, monospace)"
2918
2552
  }
2919
2553
  };
2920
- class qn extends z({
2554
+ class $r extends F({
2921
2555
  fixtureId: u.const(),
2922
2556
  sessionName: u.const(),
2923
2557
  daemon: u.const()
@@ -2926,7 +2560,7 @@ class qn extends z({
2926
2560
  super(t);
2927
2561
  l(this, "screenshot", x(this, { status: "idle" }));
2928
2562
  l(this, "_fetchVersion", 0);
2929
- this._store.add(rt((n) => {
2563
+ this._store.add(Ye((n) => {
2930
2564
  this.props.daemon.sourceTreeIds.read(n).get(this.props.sessionName) && this._fetchScreenshot();
2931
2565
  }));
2932
2566
  }
@@ -2944,26 +2578,26 @@ class qn extends z({
2944
2578
  }
2945
2579
  }
2946
2580
  }
2947
- const Ue = $(
2948
- qn,
2581
+ const Be = E(
2582
+ $r,
2949
2583
  {},
2950
- (s, e) => {
2951
- const t = e.screenshot.read(s);
2584
+ (r, e) => {
2585
+ const t = e.screenshot.read(r);
2952
2586
  if (t.status === "idle" || t.status === "loading")
2953
- return /* @__PURE__ */ a("div", { style: U.placeholder, children: /* @__PURE__ */ a("div", { style: U.shimmer }) });
2587
+ return /* @__PURE__ */ a("div", { style: z.placeholder, children: /* @__PURE__ */ a("div", { style: z.shimmer }) });
2954
2588
  if (t.status === "error")
2955
- return /* @__PURE__ */ a("div", { style: U.error, children: /* @__PURE__ */ a("span", { style: U.errorText, children: "Screenshot failed" }) });
2589
+ return /* @__PURE__ */ a("div", { style: z.error, children: /* @__PURE__ */ a("span", { style: z.errorText, children: "Screenshot failed" }) });
2956
2590
  const { data: n } = t;
2957
2591
  return n.image ? /* @__PURE__ */ a(
2958
2592
  "img",
2959
2593
  {
2960
2594
  src: `data:image/png;base64,${n.image}`,
2961
- style: U.image,
2595
+ style: z.image,
2962
2596
  alt: `Screenshot of ${e.fixtureId}`
2963
2597
  }
2964
- ) : /* @__PURE__ */ a("div", { style: U.placeholder, children: /* @__PURE__ */ a("span", { style: U.hashText, children: n.hash.slice(0, 12) }) });
2598
+ ) : /* @__PURE__ */ a("div", { style: z.placeholder, children: /* @__PURE__ */ a("span", { style: z.hashText, children: n.hash.slice(0, 12) }) });
2965
2599
  }
2966
- ), U = {
2600
+ ), z = {
2967
2601
  placeholder: {
2968
2602
  minHeight: 80,
2969
2603
  display: "flex",
@@ -3006,7 +2640,7 @@ const Ue = $(
3006
2640
  border: "1px solid var(--vscode-panel-border)"
3007
2641
  }
3008
2642
  };
3009
- class Kn extends z({
2643
+ class Lr extends F({
3010
2644
  fixtureId: u.const(),
3011
2645
  daemon: u.const(),
3012
2646
  baselineSession: u.const(),
@@ -3015,9 +2649,9 @@ class Kn extends z({
3015
2649
  constructor(t) {
3016
2650
  super(t);
3017
2651
  l(this, "comparisonStatus", x(this, { status: "loading" }));
3018
- this._store.add(rt((n) => {
3019
- const r = this.props.daemon.sourceTreeIds.read(n), i = r.get(this.props.baselineSession), o = r.get(this.props.currentSession);
3020
- i && o && this._fetchComparison();
2652
+ this._store.add(Ye((n) => {
2653
+ const s = this.props.daemon.sourceTreeIds.read(n), o = s.get(this.props.baselineSession), i = s.get(this.props.currentSession);
2654
+ o && i && this._fetchComparison();
3021
2655
  }));
3022
2656
  }
3023
2657
  get fixtureId() {
@@ -3046,21 +2680,21 @@ class Kn extends z({
3046
2680
  }
3047
2681
  }
3048
2682
  }
3049
- const Jn = $(
3050
- Kn,
2683
+ const Hr = E(
2684
+ Lr,
3051
2685
  {},
3052
- (s, e) => {
3053
- const t = e.comparisonStatus.read(s), n = t.status === "loading" ? /* @__PURE__ */ a("span", { style: C.badgeLoading, children: "comparing..." }) : t.status === "error" ? /* @__PURE__ */ a("span", { style: C.badgeError, children: "error" }) : t.match ? /* @__PURE__ */ a("span", { style: C.badgeMatch, children: "✓ match" }) : /* @__PURE__ */ a("span", { style: C.badgeChanged, children: "● changed" });
3054
- return /* @__PURE__ */ f("div", { style: C.fixtureRow, children: [
3055
- /* @__PURE__ */ f("div", { style: C.fixtureLabel, children: [
3056
- /* @__PURE__ */ a("span", { style: C.fixtureName, children: e.fixtureId }),
2686
+ (r, e) => {
2687
+ const t = e.comparisonStatus.read(r), n = t.status === "loading" ? /* @__PURE__ */ a("span", { style: w.badgeLoading, children: "comparing..." }) : t.status === "error" ? /* @__PURE__ */ a("span", { style: w.badgeError, children: "error" }) : t.match ? /* @__PURE__ */ a("span", { style: w.badgeMatch, children: "✓ match" }) : /* @__PURE__ */ a("span", { style: w.badgeChanged, children: "● changed" });
2688
+ return /* @__PURE__ */ f("div", { style: w.fixtureRow, children: [
2689
+ /* @__PURE__ */ f("div", { style: w.fixtureLabel, children: [
2690
+ /* @__PURE__ */ a("span", { style: w.fixtureName, children: e.fixtureId }),
3057
2691
  n
3058
2692
  ] }),
3059
- /* @__PURE__ */ f("div", { style: C.sideBySide, children: [
3060
- /* @__PURE__ */ f("div", { style: C.screenshotColumn, children: [
3061
- /* @__PURE__ */ a("span", { style: C.columnLabel, children: "Current" }),
2693
+ /* @__PURE__ */ f("div", { style: w.sideBySide, children: [
2694
+ /* @__PURE__ */ f("div", { style: w.screenshotColumn, children: [
2695
+ /* @__PURE__ */ a("span", { style: w.columnLabel, children: "Current" }),
3062
2696
  /* @__PURE__ */ a(
3063
- Ue,
2697
+ Be,
3064
2698
  {
3065
2699
  fixtureId: e.fixtureId,
3066
2700
  sessionName: e.currentSession,
@@ -3068,10 +2702,10 @@ const Jn = $(
3068
2702
  }
3069
2703
  )
3070
2704
  ] }),
3071
- /* @__PURE__ */ f("div", { style: C.screenshotColumn, children: [
3072
- /* @__PURE__ */ a("span", { style: C.columnLabel, children: "Baseline" }),
2705
+ /* @__PURE__ */ f("div", { style: w.screenshotColumn, children: [
2706
+ /* @__PURE__ */ a("span", { style: w.columnLabel, children: "Baseline" }),
3073
2707
  /* @__PURE__ */ a(
3074
- Ue,
2708
+ Be,
3075
2709
  {
3076
2710
  fixtureId: e.fixtureId,
3077
2711
  sessionName: e.baselineSession,
@@ -3082,7 +2716,7 @@ const Jn = $(
3082
2716
  ] })
3083
2717
  ] });
3084
2718
  }
3085
- ), Zn = k(
2719
+ ), jr = I(
3086
2720
  {
3087
2721
  name: u.const(),
3088
2722
  path: u.const(),
@@ -3091,10 +2725,10 @@ const Jn = $(
3091
2725
  baselineSession: u.const(),
3092
2726
  currentSession: u.const()
3093
2727
  },
3094
- (s, e) => /* @__PURE__ */ f("div", { children: [
3095
- /* @__PURE__ */ a("div", { style: C.groupHeader, children: /* @__PURE__ */ a("span", { style: C.groupTitle, children: e.path }) }),
3096
- /* @__PURE__ */ a("div", { style: C.groupContent, children: e.items.map((t) => /* @__PURE__ */ a(
3097
- Jn,
2728
+ (r, e) => /* @__PURE__ */ f("div", { children: [
2729
+ /* @__PURE__ */ a("div", { style: w.groupHeader, children: /* @__PURE__ */ a("span", { style: w.groupTitle, children: e.path }) }),
2730
+ /* @__PURE__ */ a("div", { style: w.groupContent, children: e.items.map((t) => /* @__PURE__ */ a(
2731
+ Hr,
3098
2732
  {
3099
2733
  fixtureId: t.fixtureId,
3100
2734
  daemon: e.daemon,
@@ -3104,7 +2738,7 @@ const Jn = $(
3104
2738
  t.fixtureId
3105
2739
  )) })
3106
2740
  ] })
3107
- ), C = {
2741
+ ), w = {
3108
2742
  groupHeader: {
3109
2743
  marginBottom: 12
3110
2744
  },
@@ -3172,8 +2806,8 @@ const Jn = $(
3172
2806
  color: "var(--vscode-errorForeground)",
3173
2807
  fontWeight: 500
3174
2808
  }
3175
- }, J = 8;
3176
- function gt(s, e) {
2809
+ }, q = 8;
2810
+ function dt(r, e) {
3177
2811
  return `
3178
2812
  linear-gradient(45deg, ${e} 25%, transparent 25%),
3179
2813
  linear-gradient(-45deg, ${e} 25%, transparent 25%),
@@ -3181,84 +2815,84 @@ function gt(s, e) {
3181
2815
  linear-gradient(-45deg, transparent 75%, ${e} 75%)
3182
2816
  `;
3183
2817
  }
3184
- const Xn = {
2818
+ const Ur = {
3185
2819
  backgroundColor: "#ffffff",
3186
- backgroundImage: gt("#ffffff", "#e5e5e5")
3187
- }, Qn = {
2820
+ backgroundImage: dt("#ffffff", "#e5e5e5")
2821
+ }, Pr = {
3188
2822
  backgroundColor: "#1e1e1e",
3189
- backgroundImage: gt("#1e1e1e", "#2d2d2d")
3190
- }, Yn = {
2823
+ backgroundImage: dt("#1e1e1e", "#2d2d2d")
2824
+ }, Wr = {
3191
2825
  display: "inline-block",
3192
2826
  padding: "12px",
3193
2827
  borderRadius: "4px",
3194
- backgroundSize: `${J * 2}px ${J * 2}px`,
3195
- backgroundPosition: `0 0, 0 ${J}px, ${J}px -${J}px, -${J}px 0`,
2828
+ backgroundSize: `${q * 2}px ${q * 2}px`,
2829
+ backgroundPosition: `0 0, 0 ${q}px, ${q}px -${q}px, -${q}px 0`,
3196
2830
  boxShadow: "0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.08)"
3197
2831
  };
3198
- function es(s) {
3199
- const e = s === "dark" ? Qn : Xn;
2832
+ function Gr(r) {
2833
+ const e = r === "dark" ? Pr : Ur;
3200
2834
  return {
3201
- ...Yn,
2835
+ ...Wr,
3202
2836
  backgroundColor: e.backgroundColor,
3203
2837
  backgroundImage: e.backgroundImage
3204
2838
  };
3205
2839
  }
3206
- function je({ src: s, alt: e, background: t }) {
3207
- return /* @__PURE__ */ a("div", { style: es(t), children: /* @__PURE__ */ a("img", { src: s, alt: e, style: y.image }) });
2840
+ function Ae({ src: r, alt: e, background: t }) {
2841
+ return /* @__PURE__ */ a("div", { style: Gr(t), children: /* @__PURE__ */ a("img", { src: r, alt: e, style: y.image }) });
3208
2842
  }
3209
- const ts = k(
2843
+ const qr = I(
3210
2844
  {
3211
2845
  item: u.const(),
3212
2846
  reportModel: u.const()
3213
2847
  },
3214
- (s, e) => {
3215
- const { item: t, reportModel: n } = e, { entry: r } = t, i = r.background ?? "light", o = r.status === "unchanged" ? /* @__PURE__ */ a("span", { style: y.badgeMatch, children: "✓ match" }) : r.status === "changed" ? /* @__PURE__ */ a("span", { style: y.badgeChanged, children: "● changed" }) : /* @__PURE__ */ a("span", { style: y.badgeAdded, children: "+ added" }), d = r.baselineScreenshot || r.currentScreenshot;
2848
+ (r, e) => {
2849
+ const { item: t, reportModel: n } = e, { entry: s } = t, o = s.background ?? "light", i = s.status === "unchanged" ? /* @__PURE__ */ a("span", { style: y.badgeMatch, children: "✓ match" }) : s.status === "changed" ? /* @__PURE__ */ a("span", { style: y.badgeChanged, children: "● changed" }) : /* @__PURE__ */ a("span", { style: y.badgeAdded, children: "+ added" }), d = s.baselineScreenshot || s.currentScreenshot;
3216
2850
  return /* @__PURE__ */ f("div", { style: y.fixtureRow, children: [
3217
2851
  /* @__PURE__ */ f("div", { style: y.fixtureLabel, children: [
3218
2852
  /* @__PURE__ */ a("span", { style: y.fixtureName, children: t.fixtureId }),
3219
- o
2853
+ i
3220
2854
  ] }),
3221
2855
  d && /* @__PURE__ */ f("div", { style: y.sideBySide, children: [
3222
- r.baselineScreenshot && /* @__PURE__ */ f("div", { style: y.screenshotColumn, children: [
2856
+ s.baselineScreenshot && /* @__PURE__ */ f("div", { style: y.screenshotColumn, children: [
3223
2857
  /* @__PURE__ */ a("span", { style: y.columnLabel, children: "Baseline" }),
3224
2858
  /* @__PURE__ */ a(
3225
- je,
2859
+ Ae,
3226
2860
  {
3227
- src: n.resolveScreenshotUrl(r.baselineScreenshot),
2861
+ src: n.resolveScreenshotUrl(s.baselineScreenshot),
3228
2862
  alt: `Baseline screenshot of ${t.fixtureId}`,
3229
- background: i
2863
+ background: o
3230
2864
  }
3231
2865
  )
3232
2866
  ] }),
3233
- r.currentScreenshot && /* @__PURE__ */ f("div", { style: y.screenshotColumn, children: [
2867
+ s.currentScreenshot && /* @__PURE__ */ f("div", { style: y.screenshotColumn, children: [
3234
2868
  /* @__PURE__ */ a("span", { style: y.columnLabel, children: "Current" }),
3235
2869
  /* @__PURE__ */ a(
3236
- je,
2870
+ Ae,
3237
2871
  {
3238
- src: n.resolveScreenshotUrl(r.currentScreenshot),
2872
+ src: n.resolveScreenshotUrl(s.currentScreenshot),
3239
2873
  alt: `Current screenshot of ${t.fixtureId}`,
3240
- background: i
2874
+ background: o
3241
2875
  }
3242
2876
  )
3243
2877
  ] })
3244
2878
  ] }),
3245
- !d && r.status === "unchanged" && /* @__PURE__ */ a("div", { style: y.hashRow, children: /* @__PURE__ */ f("span", { style: y.hashText, children: [
2879
+ !d && s.status === "unchanged" && /* @__PURE__ */ a("div", { style: y.hashRow, children: /* @__PURE__ */ f("span", { style: y.hashText, children: [
3246
2880
  "hash: ",
3247
- r.targetHash
2881
+ s.targetHash
3248
2882
  ] }) })
3249
2883
  ] });
3250
2884
  }
3251
- ), ns = k(
2885
+ ), Kr = I(
3252
2886
  {
3253
2887
  name: u.const(),
3254
2888
  path: u.const(),
3255
2889
  items: u.const(),
3256
2890
  reportModel: u.const()
3257
2891
  },
3258
- (s, e) => /* @__PURE__ */ f("div", { children: [
2892
+ (r, e) => /* @__PURE__ */ f("div", { children: [
3259
2893
  /* @__PURE__ */ a("div", { style: y.groupHeader, children: /* @__PURE__ */ a("span", { style: y.groupTitle, children: e.path }) }),
3260
2894
  /* @__PURE__ */ a("div", { style: y.groupContent, children: e.items.map((t) => /* @__PURE__ */ a(
3261
- ts,
2895
+ qr,
3262
2896
  {
3263
2897
  item: t,
3264
2898
  reportModel: e.reportModel
@@ -3338,105 +2972,105 @@ const ts = k(
3338
2972
  color: "var(--vscode-testing-iconQueued)",
3339
2973
  fontWeight: 500
3340
2974
  }
3341
- }, mt = "component-explorer:fixtureHeights", Pe = 500;
3342
- let D = null;
3343
- function vt() {
3344
- if (D !== null) return D;
2975
+ }, ct = "component-explorer:fixtureHeights", ze = 500;
2976
+ let V = null;
2977
+ function lt() {
2978
+ if (V !== null) return V;
3345
2979
  try {
3346
- const s = localStorage.getItem(mt);
3347
- if (s)
3348
- return D = JSON.parse(s), D;
2980
+ const r = localStorage.getItem(ct);
2981
+ if (r)
2982
+ return V = JSON.parse(r), V;
3349
2983
  } catch {
3350
2984
  }
3351
- return D = {}, D;
2985
+ return V = {}, V;
3352
2986
  }
3353
- function ss() {
3354
- if (D !== null)
2987
+ function Jr() {
2988
+ if (V !== null)
3355
2989
  try {
3356
- const s = Object.entries(D);
3357
- s.length > Pe && (D = Object.fromEntries(s.slice(-Pe))), localStorage.setItem(mt, JSON.stringify(D));
2990
+ const r = Object.entries(V);
2991
+ r.length > ze && (V = Object.fromEntries(r.slice(-ze))), localStorage.setItem(ct, JSON.stringify(V));
3358
2992
  } catch {
3359
2993
  }
3360
2994
  }
3361
- function rs(s, e) {
3362
- const t = vt();
3363
- t[s] = e, ss();
2995
+ function Zr(r, e) {
2996
+ const t = lt();
2997
+ t[r] = e, Jr();
3364
2998
  }
3365
- function is() {
3366
- return new Map(Object.entries(vt()));
2999
+ function Xr() {
3000
+ return new Map(Object.entries(lt()));
3367
3001
  }
3368
- const os = 280, as = 32, ae = 32, Ge = 400, _t = "component-explorer:scrollAnchors", We = 100;
3369
- function bt() {
3002
+ const Yr = 280, Qr = 32, re = 32, $e = 400, ht = "component-explorer:scrollAnchors", Le = 100;
3003
+ function ut() {
3370
3004
  try {
3371
- const s = localStorage.getItem(_t);
3372
- if (s) return JSON.parse(s);
3005
+ const r = localStorage.getItem(ht);
3006
+ if (r) return JSON.parse(r);
3373
3007
  } catch {
3374
3008
  }
3375
3009
  return {};
3376
3010
  }
3377
- function ds(s, e) {
3011
+ function en(r, e) {
3378
3012
  try {
3379
- const t = bt();
3380
- t[s] = e;
3381
- const n = Object.entries(t), r = n.length > We ? Object.fromEntries(n.slice(-We)) : t;
3382
- localStorage.setItem(_t, JSON.stringify(r));
3013
+ const t = ut();
3014
+ t[r] = e;
3015
+ const n = Object.entries(t), s = n.length > Le ? Object.fromEntries(n.slice(-Le)) : t;
3016
+ localStorage.setItem(ht, JSON.stringify(s));
3383
3017
  } catch {
3384
3018
  }
3385
3019
  }
3386
- function cs(s) {
3387
- return bt()[s];
3020
+ function tn(r) {
3021
+ return ut()[r];
3388
3022
  }
3389
- function yt(s) {
3390
- return s.type === "single" ? s.fixture.id : s.id;
3023
+ function ft(r) {
3024
+ return r.type === "single" ? r.fixture.id : r.id;
3391
3025
  }
3392
- function ls(s, e) {
3393
- const t = new Array(s.length);
3394
- let n = ae;
3395
- for (let r = 0; r < s.length; r++) {
3396
- const i = e.get(yt(s[r])) ?? os;
3397
- t[r] = { top: n, height: i }, n += i + as;
3026
+ function rn(r, e) {
3027
+ const t = new Array(r.length);
3028
+ let n = re;
3029
+ for (let s = 0; s < r.length; s++) {
3030
+ const o = e.get(ft(r[s])) ?? Yr;
3031
+ t[s] = { top: n, height: o }, n += o + Qr;
3398
3032
  }
3399
3033
  return t;
3400
3034
  }
3401
- function hs(s) {
3402
- if (s.length === 0) return 0;
3403
- const e = s[s.length - 1];
3404
- return e.top + e.height + ae;
3035
+ function nn(r) {
3036
+ if (r.length === 0) return 0;
3037
+ const e = r[r.length - 1];
3038
+ return e.top + e.height + re;
3405
3039
  }
3406
- function xt(s, e) {
3407
- let t = 0, n = s.length;
3040
+ function pt(r, e) {
3041
+ let t = 0, n = r.length;
3408
3042
  for (; t < n; ) {
3409
- const r = t + n >> 1;
3410
- s[r].top + s[r].height < e ? t = r + 1 : n = r;
3043
+ const s = t + n >> 1;
3044
+ r[s].top + r[s].height < e ? t = s + 1 : n = s;
3411
3045
  }
3412
3046
  return t;
3413
3047
  }
3414
- function us(s, e, t) {
3415
- if (s.length === 0) return { start: 0, end: 0 };
3416
- const n = xt(s, e - Ge);
3417
- let r = n;
3418
- const i = e + t + Ge;
3419
- for (; r < s.length && s[r].top < i; )
3420
- r++;
3421
- return { start: n, end: r };
3422
- }
3423
- function qe(s, e) {
3424
- if (s.length === 0) return;
3425
- const t = xt(s, e), n = Math.min(t, s.length - 1);
3048
+ function sn(r, e, t) {
3049
+ if (r.length === 0) return { start: 0, end: 0 };
3050
+ const n = pt(r, e - $e);
3051
+ let s = n;
3052
+ const o = e + t + $e;
3053
+ for (; s < r.length && r[s].top < o; )
3054
+ s++;
3055
+ return { start: n, end: s };
3056
+ }
3057
+ function He(r, e) {
3058
+ if (r.length === 0) return;
3059
+ const t = pt(r, e), n = Math.min(t, r.length - 1);
3426
3060
  return {
3427
3061
  rowIndex: n,
3428
- offsetFromViewport: s[n].top - e
3062
+ offsetFromViewport: r[n].top - e
3429
3063
  };
3430
3064
  }
3431
- function Ke(s, e) {
3432
- return e.rowIndex >= s.length ? 0 : s[e.rowIndex].top - e.offsetFromViewport;
3065
+ function je(r, e) {
3066
+ return e.rowIndex >= r.length ? 0 : r[e.rowIndex].top - e.offsetFromViewport;
3433
3067
  }
3434
- class fs extends z({
3068
+ class on extends F({
3435
3069
  model: u.const()
3436
3070
  }) {
3437
3071
  constructor() {
3438
3072
  super(...arguments);
3439
- l(this, "_rowHeights", x(this, is()));
3073
+ l(this, "_rowHeights", x(this, Xr()));
3440
3074
  l(this, "_scrollTop", x(this, 0));
3441
3075
  l(this, "_viewportHeight", x(this, 0));
3442
3076
  l(this, "_scrollContainerRef", null);
@@ -3445,42 +3079,42 @@ class fs extends z({
3445
3079
  l(this, "_currentNodeId");
3446
3080
  l(this, "_scrollSaveTimeout", null);
3447
3081
  l(this, "_suppressScrollHandler", !1);
3448
- l(this, "layout", F(this, (t) => {
3449
- const n = this.explorerModel.selectedFixtures.read(t), r = this._rowHeights.read(t);
3450
- return ls(n, r);
3082
+ l(this, "layout", N(this, (t) => {
3083
+ const n = this.explorerModel.selectedFixtures.read(t), s = this._rowHeights.read(t);
3084
+ return rn(n, s);
3451
3085
  }));
3452
- l(this, "visibleRowRange", F(this, (t) => {
3453
- const n = this.layout.read(t), r = this._scrollTop.read(t), i = this._viewportHeight.read(t);
3454
- return us(n, r, i);
3086
+ l(this, "visibleRowRange", N(this, (t) => {
3087
+ const n = this.layout.read(t), s = this._scrollTop.read(t), o = this._viewportHeight.read(t);
3088
+ return sn(n, s, o);
3455
3089
  }));
3456
3090
  l(this, "setScrollContainerRef", (t) => {
3457
3091
  var n;
3458
- this._scrollContainerRef && this._scrollContainerRef.removeEventListener("scroll", this._handleScroll), (n = this._viewportResizeObserver) == null || n.disconnect(), this._scrollContainerRef = t, t && (t.addEventListener("scroll", this._handleScroll, { passive: !0 }), this._viewportHeight.set(t.clientHeight, void 0), this._viewportResizeObserver = new ResizeObserver(([r]) => {
3459
- this._viewportHeight.set(Math.round(r.contentRect.height), void 0);
3092
+ this._scrollContainerRef && this._scrollContainerRef.removeEventListener("scroll", this._handleScroll), (n = this._viewportResizeObserver) == null || n.disconnect(), this._scrollContainerRef = t, t && (t.addEventListener("scroll", this._handleScroll, { passive: !0 }), this._viewportHeight.set(t.clientHeight, void 0), this._viewportResizeObserver = new ResizeObserver(([s]) => {
3093
+ this._viewportHeight.set(Math.round(s.contentRect.height), void 0);
3460
3094
  }), this._viewportResizeObserver.observe(t), this._restoreScrollPosition());
3461
3095
  });
3462
3096
  l(this, "_handleScroll", () => {
3463
3097
  this._scrollContainerRef && (this._scrollTop.set(this._scrollContainerRef.scrollTop, void 0), !(this._suppressScrollHandler || !this._currentNodeId) && (this._scrollSaveTimeout && clearTimeout(this._scrollSaveTimeout), this._scrollSaveTimeout = setTimeout(() => {
3464
3098
  if (!this._currentNodeId) return;
3465
- const t = this.layout.get(), n = qe(t, this._scrollTop.get());
3466
- n && ds(this._currentNodeId, n);
3099
+ const t = this.layout.get(), n = He(t, this._scrollTop.get());
3100
+ n && en(this._currentNodeId, n);
3467
3101
  }, 150)));
3468
3102
  });
3469
3103
  l(this, "observeRowElement", (t, n) => {
3470
- t && (this._resizeObserver || (this._resizeObserver = new ResizeObserver((r) => {
3471
- const i = this._rowHeights.get();
3472
- let o;
3473
- for (const d of r) {
3104
+ t && (this._resizeObserver || (this._resizeObserver = new ResizeObserver((s) => {
3105
+ const o = this._rowHeights.get();
3106
+ let i;
3107
+ for (const d of s) {
3474
3108
  const c = d.target.getAttribute("data-row-id");
3475
3109
  if (!c) continue;
3476
3110
  const h = Math.round(d.contentRect.height);
3477
- h > 0 && i.get(c) !== h && (o || (o = new Map(i)), o.set(c, h), rs(c, h));
3111
+ h > 0 && o.get(c) !== h && (i || (i = new Map(o)), i.set(c, h), Zr(c, h));
3478
3112
  }
3479
- if (o) {
3480
- const d = this.layout.get(), c = qe(d, this._scrollTop.get());
3481
- if (this._rowHeights.set(o, void 0), c && this._scrollContainerRef) {
3482
- const h = this.layout.get(), m = Ke(h, c);
3483
- this._suppressScrollHandler = !0, this._scrollContainerRef.scrollTop = m, this._scrollTop.set(m, void 0), requestAnimationFrame(() => {
3113
+ if (i) {
3114
+ const d = this.layout.get(), c = He(d, this._scrollTop.get());
3115
+ if (this._rowHeights.set(i, void 0), c && this._scrollContainerRef) {
3116
+ const h = this.layout.get(), g = je(h, c);
3117
+ this._suppressScrollHandler = !0, this._scrollContainerRef.scrollTop = g, this._scrollTop.set(g, void 0), requestAnimationFrame(() => {
3484
3118
  this._suppressScrollHandler = !1;
3485
3119
  });
3486
3120
  }
@@ -3496,10 +3130,10 @@ class fs extends z({
3496
3130
  }
3497
3131
  _restoreScrollPosition() {
3498
3132
  if (!this._scrollContainerRef || !this._currentNodeId) return;
3499
- const t = cs(this._currentNodeId);
3133
+ const t = tn(this._currentNodeId);
3500
3134
  if (!t) return;
3501
- const n = this.layout.get(), r = Ke(n, t);
3502
- this._suppressScrollHandler = !0, this._scrollContainerRef.scrollTop = r, this._scrollTop.set(r, void 0), requestAnimationFrame(() => {
3135
+ const n = this.layout.get(), s = je(n, t);
3136
+ this._suppressScrollHandler = !0, this._scrollContainerRef.scrollTop = s, this._scrollTop.set(s, void 0), requestAnimationFrame(() => {
3503
3137
  this._suppressScrollHandler = !1;
3504
3138
  });
3505
3139
  }
@@ -3508,35 +3142,35 @@ class fs extends z({
3508
3142
  (t = this._resizeObserver) == null || t.disconnect(), (n = this._viewportResizeObserver) == null || n.disconnect(), this._scrollContainerRef && this._scrollContainerRef.removeEventListener("scroll", this._handleScroll), this._scrollSaveTimeout && clearTimeout(this._scrollSaveTimeout);
3509
3143
  }
3510
3144
  }
3511
- const ps = $(
3512
- fs,
3145
+ const an = E(
3146
+ on,
3513
3147
  {},
3514
- (s, e) => {
3515
- const t = e.explorerModel.selectedFixtures.read(s), n = e.explorerModel.selectedNodeId.read(s), r = e.layout.read(s), { start: i, end: o } = e.visibleRowRange.read(s);
3148
+ (r, e) => {
3149
+ const t = e.explorerModel.selectedFixtures.read(r), n = e.explorerModel.selectedNodeId.read(r), s = e.layout.read(r), { start: o, end: i } = e.visibleRowRange.read(r);
3516
3150
  if (e.updateForSelection(n), t.length === 0) {
3517
3151
  const c = e.explorerModel.reportModel;
3518
3152
  if (c) {
3519
- const h = c.state.read(s);
3153
+ const h = c.state.read(r);
3520
3154
  if (h.status === "loading")
3521
- return /* @__PURE__ */ a("div", { style: N.emptyState, children: /* @__PURE__ */ a("span", { style: N.emptyText, children: "Loading report..." }) });
3155
+ return /* @__PURE__ */ a("div", { style: k.emptyState, children: /* @__PURE__ */ a("span", { style: k.emptyText, children: "Loading report..." }) });
3522
3156
  if (h.status === "error")
3523
- return /* @__PURE__ */ a("div", { style: N.emptyState, children: /* @__PURE__ */ f("span", { style: { ...N.emptyText, color: "var(--vscode-errorForeground)" }, children: [
3157
+ return /* @__PURE__ */ a("div", { style: k.emptyState, children: /* @__PURE__ */ f("span", { style: { ...k.emptyText, color: "var(--vscode-errorForeground)" }, children: [
3524
3158
  "Failed to load report: ",
3525
3159
  h.message
3526
3160
  ] }) });
3527
3161
  }
3528
- return /* @__PURE__ */ a("div", { style: N.emptyState, children: /* @__PURE__ */ a("span", { style: N.emptyText, children: "Select a component or folder to preview" }) });
3162
+ return /* @__PURE__ */ a("div", { style: k.emptyState, children: /* @__PURE__ */ a("span", { style: k.emptyText, children: "Select a component or folder to preview" }) });
3529
3163
  }
3530
- const d = hs(r);
3531
- return /* @__PURE__ */ a("div", { ref: e.setScrollContainerRef, style: N.scrollContainer, children: /* @__PURE__ */ a("div", { style: { position: "relative", height: d }, children: t.slice(i, o).map((c, h) => {
3532
- const m = i + h, { top: _ } = r[m], g = yt(c);
3164
+ const d = nn(s);
3165
+ return /* @__PURE__ */ a("div", { ref: e.setScrollContainerRef, style: k.scrollContainer, children: /* @__PURE__ */ a("div", { style: { position: "relative", height: d }, children: t.slice(o, i).map((c, h) => {
3166
+ const g = o + h, { top: _ } = s[g], C = ft(c);
3533
3167
  return /* @__PURE__ */ a(
3534
3168
  "div",
3535
3169
  {
3536
- ref: (v) => e.observeRowElement(v, g),
3537
- style: { position: "absolute", top: _, left: ae, right: ae },
3538
- children: c.type === "single" ? /* @__PURE__ */ a(ft, { fixture: c.fixture, compact: !1 }) : c.type === "variants" ? /* @__PURE__ */ a(gs, { row: c }) : c.type === "screenshot-comparison" && e.explorerModel.daemon ? /* @__PURE__ */ a(
3539
- Zn,
3170
+ ref: (m) => e.observeRowElement(m, C),
3171
+ style: { position: "absolute", top: _, left: re, right: re },
3172
+ children: c.type === "single" ? /* @__PURE__ */ a(it, { fixture: c.fixture, compact: !1 }) : c.type === "variants" ? /* @__PURE__ */ a(dn, { row: c }) : c.type === "screenshot-comparison" && e.explorerModel.daemon ? /* @__PURE__ */ a(
3173
+ jr,
3540
3174
  {
3541
3175
  name: c.name,
3542
3176
  path: c.path,
@@ -3546,7 +3180,7 @@ const ps = $(
3546
3180
  currentSession: "current"
3547
3181
  }
3548
3182
  ) : c.type === "report-comparison" && e.explorerModel.reportModel ? /* @__PURE__ */ a(
3549
- ns,
3183
+ Kr,
3550
3184
  {
3551
3185
  name: c.name,
3552
3186
  path: c.path,
@@ -3555,20 +3189,20 @@ const ps = $(
3555
3189
  }
3556
3190
  ) : null
3557
3191
  },
3558
- g
3192
+ C
3559
3193
  );
3560
3194
  }) }) });
3561
3195
  }
3562
- ), gs = k(
3196
+ ), dn = I(
3563
3197
  { row: u.const() },
3564
- (s, e) => {
3198
+ (r, e) => {
3565
3199
  const t = e.row;
3566
3200
  return /* @__PURE__ */ f("div", { children: [
3567
- /* @__PURE__ */ a("div", { style: N.variantsHeader, children: /* @__PURE__ */ a("span", { style: N.variantsTitle, children: t.path }) }),
3568
- /* @__PURE__ */ a("div", { style: N.variantsContent, children: t.fixtures.map((n) => /* @__PURE__ */ a(ft, { fixture: n, compact: !0 }, n.id)) })
3201
+ /* @__PURE__ */ a("div", { style: k.variantsHeader, children: /* @__PURE__ */ a("span", { style: k.variantsTitle, children: t.path }) }),
3202
+ /* @__PURE__ */ a("div", { style: k.variantsContent, children: t.fixtures.map((n) => /* @__PURE__ */ a(it, { fixture: n, compact: !0 }, n.id)) })
3569
3203
  ] });
3570
3204
  }
3571
- ), N = {
3205
+ ), k = {
3572
3206
  scrollContainer: {
3573
3207
  flex: 1,
3574
3208
  overflow: "auto",
@@ -3599,55 +3233,58 @@ const ps = $(
3599
3233
  flexWrap: "wrap",
3600
3234
  gap: "16px"
3601
3235
  }
3602
- }, ms = $(
3603
- Sn,
3236
+ }, cn = E(
3237
+ gr,
3604
3238
  { daemonModel: u.const(), reportModel: u.const() },
3605
- (s, e) => {
3606
- const t = e.leftSidebarVisible.read(s), n = e.rightSidebarVisible.read(s), r = e.isDarkTheme.read(s), i = e.selectedNode.read(s);
3607
- return /* @__PURE__ */ f("div", { className: r ? "vscode-theme default-dark-plus" : "vscode-theme default-light-plus", style: p.container, children: [
3608
- t && /* @__PURE__ */ a(Bn, { model: e }),
3239
+ (r, e) => {
3240
+ const t = e.leftSidebarVisible.read(r), n = e.rightSidebarVisible.read(r), s = e.isDarkTheme.read(r), o = e.selectedNode.read(r);
3241
+ return /* @__PURE__ */ f("div", { className: s ? "vscode-theme default-dark-plus" : "vscode-theme default-light-plus", style: p.container, children: [
3242
+ t && /* @__PURE__ */ a(kr, { model: e }),
3609
3243
  /* @__PURE__ */ f("div", { style: p.centerArea, children: [
3610
- /* @__PURE__ */ a(Fn, { model: e }),
3611
- /* @__PURE__ */ a(ps, { model: e })
3244
+ /* @__PURE__ */ a(Tr, { model: e }),
3245
+ /* @__PURE__ */ a(an, { model: e })
3612
3246
  ] }),
3613
- n && /* @__PURE__ */ a(Ln, { selectedNode: i })
3247
+ n && /* @__PURE__ */ a(Mr, { selectedNode: o })
3614
3248
  ] });
3615
3249
  }
3616
3250
  );
3617
- var vs = class be {
3251
+ var ln = class fe {
3618
3252
  constructor(e) {
3619
3253
  this.iterator = e;
3620
3254
  }
3621
3255
  static fromIterable(e) {
3622
- return new be(e[Symbol.asyncIterator]());
3256
+ return new fe(e[Symbol.asyncIterator]());
3623
3257
  }
3624
3258
  static fromFn(e) {
3625
- return new be(e());
3259
+ return new fe(e());
3626
3260
  }
3627
3261
  [Symbol.asyncIterator]() {
3628
3262
  return this.iterator;
3629
3263
  }
3630
- }, _s = class extends Error {
3631
- constructor(s, e, t) {
3632
- super(t), this.statusCode = s, this.method = e, this.name = "ApiError";
3264
+ }, hn = class extends Error {
3265
+ constructor(r, e, t) {
3266
+ super(t), this.statusCode = r, this.method = e, this.name = "ApiError";
3633
3267
  }
3634
- }, bs = class {
3635
- constructor(s) {
3268
+ }, un = class {
3269
+ constructor(r) {
3636
3270
  l(this, "methods", this._createProxy(""));
3637
- this._request = s;
3271
+ this._request = r;
3638
3272
  }
3639
- _createProxy(s) {
3273
+ _createProxy(r) {
3640
3274
  return new Proxy(() => {
3641
3275
  }, {
3642
- apply: async (e, t, n) => await this._request(s, n[0]),
3643
- get: (e, t) => this._createProxy(`${s}${s ? "/" : ""}${t}`)
3276
+ apply: async (e, t, n) => await this._request(r, n[0]),
3277
+ get: (e, t) => {
3278
+ if (typeof t != "symbol" && !(t === "then" || t === "catch" || t === "finally" || t === "toString" || t === "valueOf" || t === "toJSON" || t === "name" || t === "length" || t === "prototype" || t === "constructor" || t === "caller" || t === "arguments"))
3279
+ return this._createProxy(`${r}${r ? "/" : ""}${t}`);
3280
+ }
3644
3281
  });
3645
3282
  }
3646
3283
  };
3647
- function ys(s, e) {
3648
- return new bs(async (t, n) => {
3284
+ function fn(r, e) {
3285
+ return new un(async (t, n) => {
3649
3286
  var d;
3650
- const r = await fetch(`${s}/${t}`, {
3287
+ const s = await fetch(`${r}/${t}`, {
3651
3288
  method: "POST",
3652
3289
  headers: {
3653
3290
  "Content-Type": "application/json",
@@ -3655,37 +3292,37 @@ function ys(s, e) {
3655
3292
  },
3656
3293
  body: JSON.stringify(n)
3657
3294
  });
3658
- if (r.status !== 200) {
3659
- const c = await r.json().catch(() => null);
3295
+ if (s.status !== 200) {
3296
+ const c = await s.json().catch(() => null);
3660
3297
  let h;
3661
- throw c && typeof c == "object" && "errorMessage" in c ? h = `${c.errorMessage}` : h = `Error calling API method ${t}: ${JSON.stringify(c)} (Status: ${r.status}, Status Text: ${r.statusText})`, new _s(r.status, t, h);
3298
+ throw c && typeof c == "object" && "errorMessage" in c ? h = `${c.errorMessage}` : h = `Error calling API method ${t}: ${JSON.stringify(c)} (Status: ${s.status}, Status Text: ${s.statusText})`, new hn(s.status, t, h);
3662
3299
  }
3663
- const i = r.headers.get("Content-Type");
3664
- return i != null && i.startsWith("application/jsonl") ? vs.fromFn(async function* () {
3665
- var g;
3666
- const c = (g = r.body) == null ? void 0 : g.getReader();
3300
+ const o = s.headers.get("Content-Type");
3301
+ return o != null && o.startsWith("application/jsonl") ? ln.fromFn(async function* () {
3302
+ var C;
3303
+ const c = (C = s.body) == null ? void 0 : C.getReader();
3667
3304
  if (!c)
3668
3305
  return;
3669
3306
  let h = "";
3670
- const m = new TextDecoder("utf-8");
3307
+ const g = new TextDecoder("utf-8");
3671
3308
  for (; ; ) {
3672
- const { done: v, value: E } = await c.read();
3673
- if (v)
3309
+ const { done: m, value: v } = await c.read();
3310
+ if (m)
3674
3311
  break;
3675
- h += m.decode(E, { stream: !0 });
3676
- let V;
3677
- for (; (V = h.indexOf(`
3312
+ h += g.decode(v, { stream: !0 });
3313
+ let O;
3314
+ for (; (O = h.indexOf(`
3678
3315
  `)) >= 0; ) {
3679
- const S = h.slice(0, V).trim();
3680
- h = h.slice(V + 1), S.length > 0 && (yield JSON.parse(S));
3316
+ const S = h.slice(0, O).trim();
3317
+ h = h.slice(O + 1), S.length > 0 && (yield JSON.parse(S));
3681
3318
  }
3682
3319
  }
3683
3320
  const _ = h.trim();
3684
3321
  _.length > 0 && (yield JSON.parse(_));
3685
- }) : await r.json();
3322
+ }) : await s.json();
3686
3323
  });
3687
3324
  }
3688
- class xs {
3325
+ class pn {
3689
3326
  constructor(e) {
3690
3327
  l(this, "_sourceTreeIds", x(this, /* @__PURE__ */ new Map()));
3691
3328
  l(this, "_sessions", x(this, []));
@@ -3697,7 +3334,7 @@ class xs {
3697
3334
  l(this, "sourceTreeIds", this._sourceTreeIds);
3698
3335
  /** Observable list of sessions from the daemon */
3699
3336
  l(this, "sessions", this._sessions);
3700
- this.config = e, this.sessionName = e.sessionName, this._client = ys("/__explorer/daemon-api");
3337
+ this.config = e, this.sessionName = e.sessionName, this._client = fn("/__explorer/daemon-api");
3701
3338
  }
3702
3339
  /**
3703
3340
  * Initializes the model: fetches initial session info and starts listening to events.
@@ -3714,30 +3351,30 @@ class xs {
3714
3351
  const n = this._sourceTreeIds.get().get(e);
3715
3352
  if (!n)
3716
3353
  throw new Error(`No sourceTreeId known for session '${e}'`);
3717
- const r = `${e}:${t}`, i = this._screenshotCache.get(r);
3718
- if (i && i.sourceTreeId === n)
3719
- return i.data;
3720
- const o = await this._client.methods.screenshots.take({
3354
+ const s = `${e}:${t}`, o = this._screenshotCache.get(s);
3355
+ if (o && o.sourceTreeId === n)
3356
+ return o.data;
3357
+ const i = await this._client.methods.screenshots.take({
3721
3358
  fixtureId: t,
3722
3359
  sessionName: e,
3723
3360
  sourceTreeId: n,
3724
3361
  includeImage: !0
3725
3362
  });
3726
- return this._screenshotCache.set(r, { sourceTreeId: n, data: o }), o;
3363
+ return this._screenshotCache.set(s, { sourceTreeId: n, data: i }), i;
3727
3364
  }
3728
3365
  /**
3729
3366
  * Compare a fixture across two sessions. Returns match status and hashes (no images).
3730
3367
  */
3731
3368
  async compare(e, t, n) {
3732
- const r = this._sourceTreeIds.get().get(t), i = this._sourceTreeIds.get().get(n);
3733
- if (!r || !i)
3369
+ const s = this._sourceTreeIds.get().get(t), o = this._sourceTreeIds.get().get(n);
3370
+ if (!s || !o)
3734
3371
  throw new Error("Missing sourceTreeId for sessions");
3735
3372
  return this._client.methods.screenshots.compare({
3736
3373
  fixtureId: e,
3737
3374
  baselineSessionName: t,
3738
- baselineSourceTreeId: r,
3375
+ baselineSourceTreeId: s,
3739
3376
  currentSessionName: n,
3740
- currentSourceTreeId: i,
3377
+ currentSourceTreeId: o,
3741
3378
  includeImages: !1
3742
3379
  });
3743
3380
  }
@@ -3767,8 +3404,8 @@ class xs {
3767
3404
  // ---------------------------------------------------------------------------
3768
3405
  async _fetchSessionInfos() {
3769
3406
  const e = await this._client.methods.sessions(), t = /* @__PURE__ */ new Map(), n = [];
3770
- for (const r of e)
3771
- t.set(r.name, r.sourceTreeId), n.push({ name: r.name, serverUrl: r.serverUrl });
3407
+ for (const s of e)
3408
+ t.set(s.name, s.sourceTreeId), n.push({ name: s.name, serverUrl: s.serverUrl });
3772
3409
  this._sourceTreeIds.set(t, void 0), this._sessions.set(n, void 0);
3773
3410
  }
3774
3411
  async _startEventStream() {
@@ -3795,10 +3432,10 @@ class xs {
3795
3432
  }
3796
3433
  }
3797
3434
  }
3798
- function Cs() {
3435
+ function gn() {
3799
3436
  return window.__EXPLORER_DAEMON__;
3800
3437
  }
3801
- class Ss {
3438
+ class mn {
3802
3439
  constructor(e) {
3803
3440
  l(this, "state", x(this, { status: "loading" }));
3804
3441
  l(this, "_baseUrl");
@@ -3811,7 +3448,7 @@ class Ss {
3811
3448
  }
3812
3449
  buildTree(e) {
3813
3450
  const t = this.state.read(e);
3814
- return t.status !== "ready" ? { id: "", name: "Report", type: "folder", children: [] } : ws(t.report.fixtures);
3451
+ return t.status !== "ready" ? { id: "", name: "Report", type: "folder", children: [] } : vn(t.report.fixtures);
3815
3452
  }
3816
3453
  async _fetch() {
3817
3454
  this.state.set({ status: "loading" }, void 0);
@@ -3826,35 +3463,35 @@ class Ss {
3826
3463
  }
3827
3464
  }
3828
3465
  }
3829
- function ws(s) {
3466
+ function vn(r) {
3830
3467
  const e = { id: "", name: "Components", type: "folder", children: [] };
3831
- for (const [t, n] of Object.entries(s)) {
3832
- const r = t.split("/");
3833
- let i = e;
3834
- for (let o = 0; o < r.length; o++) {
3835
- const d = r[o], c = o === r.length - 1, h = r.slice(0, o + 1).join("/");
3468
+ for (const [t, n] of Object.entries(r)) {
3469
+ const s = t.split("/");
3470
+ let o = e;
3471
+ for (let i = 0; i < s.length; i++) {
3472
+ const d = s[i], c = i === s.length - 1, h = s.slice(0, i + 1).join("/");
3836
3473
  if (c)
3837
- i.children.push({
3474
+ o.children.push({
3838
3475
  id: h,
3839
3476
  name: d,
3840
3477
  type: "component",
3841
3478
  reportEntry: n
3842
3479
  });
3843
3480
  else {
3844
- let m = i.children.find((_) => _.type === "folder" && _.name === d);
3845
- m || (m = { id: h, name: d, type: "folder", children: [] }, i.children.push(m)), i = m;
3481
+ let g = o.children.find((_) => _.type === "folder" && _.name === d);
3482
+ g || (g = { id: h, name: d, type: "folder", children: [] }, o.children.push(g)), o = g;
3846
3483
  }
3847
3484
  }
3848
3485
  }
3849
3486
  return e;
3850
3487
  }
3851
- class Bs {
3488
+ class Vn {
3852
3489
  constructor(e, t) {
3853
3490
  l(this, "_root");
3854
- l(this, "_registry", new un());
3491
+ l(this, "_registry", new sr());
3855
3492
  l(this, "_daemonModel");
3856
3493
  l(this, "_reportModel");
3857
- this._populateRegistry(t), this._reportModel = this._initializeReportModel(), this._daemonModel = this._reportModel ? void 0 : this._initializeDaemonModel(), this._root = It(e), this._root.render(kt(ms, {
3494
+ this._populateRegistry(t), this._reportModel = this._initializeReportModel(), this._daemonModel = this._reportModel ? void 0 : this._initializeDaemonModel(), this._root = _t(e), this._root.render(Ct(cn, {
3858
3495
  registry: this._registry,
3859
3496
  daemonModel: this._daemonModel,
3860
3497
  reportModel: this._reportModel
@@ -3863,13 +3500,13 @@ class Bs {
3863
3500
  _initializeReportModel() {
3864
3501
  const t = new URLSearchParams(location.search).get("report");
3865
3502
  if (t)
3866
- return new Ss(t);
3503
+ return new mn(t);
3867
3504
  }
3868
3505
  _initializeDaemonModel() {
3869
- const e = Cs();
3506
+ const e = gn();
3870
3507
  if (!e)
3871
3508
  return;
3872
- const t = new xs(e);
3509
+ const t = new pn(e);
3873
3510
  return t.initialize().catch((n) => {
3874
3511
  console.error("[ExplorerApp] Failed to initialize DaemonModel:", n);
3875
3512
  }), t;
@@ -3877,8 +3514,8 @@ class Bs {
3877
3514
  _populateRegistry(e) {
3878
3515
  this._registry.clear();
3879
3516
  for (const [t, n] of Object.entries(e)) {
3880
- const r = n.default;
3881
- r && typeof r == "object" && this._registry.register(t, r);
3517
+ const s = n.default;
3518
+ s && typeof s == "object" && this._registry.register(t, s);
3882
3519
  }
3883
3520
  }
3884
3521
  /**
@@ -3902,50 +3539,52 @@ class Bs {
3902
3539
  }
3903
3540
  }
3904
3541
  export {
3905
- On as ChevronDownIcon,
3906
- In as ChevronRightIcon,
3907
- As as CliRuntime,
3908
- Rn as ComponentIcon,
3909
- xs as DaemonModel,
3910
- ms as Explorer,
3911
- Bs as ExplorerApp,
3912
- Sn as ExplorerModel,
3913
- un as FixtureRegistry,
3914
- Tn as FolderIcon,
3915
- Bn as LeftSidebar,
3916
- Dn as MoonIcon,
3917
- kn as PanelLeftIcon,
3918
- Vn as PanelRightIcon,
3919
- Ss as ReportModel,
3920
- Ln as RightSidebar,
3921
- Nn as SunIcon,
3922
- Fn as TitleBar,
3923
- ce as TitleBarButton,
3924
- An as TreeItem,
3925
- ut as TreeView,
3926
- Vt as VIEWPORT_SIZES,
3927
- Ft as collectComponents,
3928
- Me as createComponentDefinition,
3929
- le as createFixtureTree,
3930
- Hs as defineFixture,
3931
- Ls as defineFixtureGroup,
3932
- Us as defineFixtureVariants,
3933
- Fe as findNodeByPath,
3934
- ke as fixtureGroupBrand,
3935
- Ve as fixtureVariantsBrand,
3936
- Dt as getDefaultPropertyValues,
3937
- Es as isComponentDefinition,
3938
- Ce as isFixtureGroup,
3939
- Se as isFixtureVariants,
3940
- xe as isSingleFixture,
3941
- Te as mergeStyles,
3942
- Ns as parseFixtureExport,
3943
- Ms as parseFixtureGroup,
3944
- Fs as parseFixtureVariants,
3945
- Ds as parseSingleFixture,
3946
- Nt as resolveViewport,
3947
- Ne as singleFixtureBrand,
3542
+ _r as ChevronDownIcon,
3543
+ vr as ChevronRightIcon,
3544
+ kn as CliRuntime,
3545
+ br as ComponentIcon,
3546
+ pn as DaemonModel,
3547
+ cn as Explorer,
3548
+ Vn as ExplorerApp,
3549
+ gr as ExplorerModel,
3550
+ sr as FixtureRegistry,
3551
+ yr as FolderIcon,
3552
+ kr as LeftSidebar,
3553
+ wr as MoonIcon,
3554
+ xr as PanelLeftIcon,
3555
+ Cr as PanelRightIcon,
3556
+ mn as ReportModel,
3557
+ Mr as RightSidebar,
3558
+ Sr as SunIcon,
3559
+ Tr as TitleBar,
3560
+ se as TitleBarButton,
3561
+ Or as TreeItem,
3562
+ ot as TreeView,
3563
+ St as VIEWPORT_SIZES,
3564
+ Mn as asyncRender,
3565
+ It as collectComponents,
3566
+ Ie as createComponentDefinition,
3567
+ oe as createFixtureTree,
3568
+ Fn as defineFixture,
3569
+ En as defineFixtureGroup,
3570
+ Bn as defineFixtureVariants,
3571
+ Oe as findNodeByPath,
3572
+ Se as fixtureGroupBrand,
3573
+ we as fixtureVariantsBrand,
3574
+ Rt as getDefaultPropertyValues,
3575
+ On as isComponentDefinition,
3576
+ me as isFixtureGroup,
3577
+ ve as isFixtureVariants,
3578
+ ge as isSingleFixture,
3579
+ Ce as mergeStyles,
3580
+ wn as parseFixtureExport,
3581
+ Tn as parseFixtureGroup,
3582
+ In as parseFixtureVariants,
3583
+ Rn as parseSingleFixture,
3584
+ wt as resolveViewport,
3585
+ Re as singleFixtureBrand,
3948
3586
  p as styles,
3949
- ht as toExplorerTree
3587
+ An as syncRender,
3588
+ st as toExplorerTree
3950
3589
  };
3951
3590
  //# sourceMappingURL=viewer.js.map