@vscode/component-explorer 0.1.1-10 → 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.
Files changed (35) hide show
  1. package/dist/components/Explorer.d.ts +4 -3
  2. package/dist/components/Explorer.d.ts.map +1 -1
  3. package/dist/components/ExplorerModel.d.ts +14 -2
  4. package/dist/components/ExplorerModel.d.ts.map +1 -1
  5. package/dist/components/FixturePreviewItem.d.ts.map +1 -1
  6. package/dist/components/PreviewArea.d.ts.map +1 -1
  7. package/dist/components/ReportComparisonRow.d.ts +16 -0
  8. package/dist/components/ReportComparisonRow.d.ts.map +1 -0
  9. package/dist/components/TitleBar.d.ts.map +1 -1
  10. package/dist/components/index.d.ts +3 -1
  11. package/dist/components/index.d.ts.map +1 -1
  12. package/dist/core/CliRuntime.d.ts +4 -3
  13. package/dist/core/CliRuntime.d.ts.map +1 -1
  14. package/dist/core/ErrorInfo.d.ts +1 -1
  15. package/dist/core/fixtureApi.d.ts +98 -6
  16. package/dist/core/fixtureApi.d.ts.map +1 -1
  17. package/dist/core/fixtureApiConsumer.d.ts +3 -3
  18. package/dist/core/fixtureApiConsumer.d.ts.map +1 -1
  19. package/dist/core/index.d.ts +3 -3
  20. package/dist/core/index.d.ts.map +1 -1
  21. package/dist/index-DnRcKk60.js +61 -0
  22. package/dist/index-DnRcKk60.js.map +1 -0
  23. package/dist/index.js +4 -22
  24. package/dist/index.js.map +1 -1
  25. package/dist/report/ReportModel.d.ts +23 -0
  26. package/dist/report/ReportModel.d.ts.map +1 -0
  27. package/dist/report/ScreenshotReport.d.ts +25 -0
  28. package/dist/report/ScreenshotReport.d.ts.map +1 -0
  29. package/dist/report/index.d.ts +3 -0
  30. package/dist/report/index.d.ts.map +1 -0
  31. package/dist/viewer.d.ts +5 -1
  32. package/dist/viewer.d.ts.map +1 -1
  33. package/dist/viewer.js +1360 -1483
  34. package/dist/viewer.js.map +1 -1
  35. package/package.json +3 -1
package/dist/viewer.js CHANGED
@@ -1,35 +1,35 @@
1
- var wt = Object.defineProperty;
2
- var St = (s, e, t) => e in s ? wt(s, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : s[e] = t;
3
- var l = (s, e, t) => St(s, typeof e != "symbol" ? e + "" : e, t);
4
- import { fixtureGroupBrand as Ve, fixtureVariantsBrand as ke, singleFixtureBrand as Ne, defineFixtureGroup as ae, defineFixture as L } from "./index.js";
5
- import { defineFixtureVariants as Ds } from "./index.js";
6
- import { createRoot as It } from "react-dom/client";
7
- import { createContext as Ke, useReducer as Ot, useState as Tt, useContext as Rt, useEffect as De, createElement as Vt } from "react";
8
- import { jsx as a, jsxs as g, Fragment as ye } from "react/jsx-runtime";
9
- import { unstable_batchedUpdates as Je } 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 && Ve in s && s[Ve] === !0 && "_entries" in s && typeof s._entries == "object";
15
- }
16
- function we(s) {
17
- return typeof s == "object" && s !== null && ke in s && s[ke] === !0 && "_variants" in s && typeof s._variants == "object";
18
- }
19
- function Cs(s) {
20
- return xe(s) ? { success: !0, data: s } : Ce(s) ? { success: !0, data: s } : we(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 ws(s) {
23
- return xe(s) ? { success: !0, data: s } : { success: !1, error: "Value is not a SingleFixtureExport" };
24
- }
25
- function Ss(s) {
26
- return Ce(s) ? { success: !0, data: s } : { success: !1, error: "Value is not a FixtureGroupExport" };
27
- }
28
- function Is(s) {
29
- return we(s) ? { success: !0, data: s } : { success: !1, error: "Value is not a FixtureVariantsExport" };
30
- }
31
- function Ee(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 Ee(s, e, t) {
42
42
  render: n.render
43
43
  };
44
44
  }
45
- function Os(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 kt = {
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, ...kt[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 = Et(t);
71
- Ze(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 Et(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 Ze(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: Ee(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
- Ze(o, [...e, d], c);
101
- } else if (we(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("/"), v = {
111
- id: m,
110
+ const g = [...e, d].join("/"), _ = {
111
+ id: g,
112
112
  name: d,
113
113
  type: "component",
114
- component: Ee(c, m, d)
114
+ component: Ie(c, g, d)
115
115
  };
116
- o.children.push(v);
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 Xe(s) {
141
- j ? j instanceof Ae ? j.loggers.push(s) : j = new Ae([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 At(s) {
148
- he = s;
146
+ let ie;
147
+ function kt(r) {
148
+ ie = r;
149
149
  }
150
- function Mt(s) {
151
- he && he(s);
150
+ function Vt(r) {
151
+ ie && ie(r);
152
152
  }
153
- class Ae {
153
+ class ke {
154
154
  constructor(e) {
155
155
  this.loggers = e;
156
156
  }
@@ -175,8 +175,8 @@ class Ae {
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 Ae {
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 Ae {
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, Se.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 Se {
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 Se(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 A {
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 Me = /* @__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 = Ht(s, e);
271
+ const n = Mt(r, e);
272
272
  if (n) {
273
- let r = Me.get(n) ?? 0;
274
- r++, Me.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 Ht(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 ? $t(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 = Lt(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 Lt(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 $t(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 jt(s) {
328
- fe = s;
326
+ let de;
327
+ function Bt(r) {
328
+ de = r;
329
329
  }
330
- let Qe;
331
- function Ut(s) {
332
- Qe = s;
330
+ let qe;
331
+ function At(r) {
332
+ qe = r;
333
333
  }
334
- let et;
335
- function Pt(s) {
336
- et = s;
334
+ let Ke;
335
+ function zt(r) {
336
+ Ke = r;
337
337
  }
338
- let tt;
339
- function Gt(s) {
340
- tt = 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(Qe(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(et(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 tt(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 Mt(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 nt(s) {
426
+ function Ze(r) {
427
427
  return {
428
- dispose: s
428
+ dispose: r
429
429
  };
430
430
  }
431
- class I extends Error {
431
+ class H extends Error {
432
432
  constructor(e) {
433
- super(e || "An unexpected bug occurred."), Object.setPrototypeOf(this, I.prototype);
433
+ super(e || "An unexpected bug occurred."), Object.setPrototypeOf(this, H.prototype);
434
434
  }
435
435
  }
436
- function ne(s) {
437
- throw s;
436
+ function te(r) {
437
+ throw r;
438
438
  }
439
- function pe(s) {
440
- console.error("Unexpected error:", s);
441
- }
442
- const X = (s, e) => s === e;
443
- function Q(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
- for (const v of this._dependenciesToBeRemoved)
545
- v.removeObserver(this);
546
- this._dependenciesToBeRemoved.clear(), m !== void 0 && m.dispose();
541
+ for (const _ of this._dependenciesToBeRemoved)
542
+ _.removeObserver(this);
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
- ne(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 I("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
- ne(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 I("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 N(s, e, t = T.ofCaller()) {
677
- return e !== void 0 ? new w(new A(s, void 0, e), e, void 0, void 0, X, t) : new w(new A(void 0, void 0, s), s, void 0, void 0, X, 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 A(s.owner, s.debugName, s.debugReferenceFn), e, void 0, s.onLastObserverRemoved, s.equalsFn ?? X, 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
- jt(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 A(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);
689
+ o && (o.dispose(), o = void 0);
693
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 se {
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 se {
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
- ne(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 se {
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
- ne(r);
781
+ } catch (s) {
782
+ te(s);
786
783
  }
787
784
  }
788
785
  }
@@ -792,7 +789,7 @@ class se {
792
789
  // IReader implementation
793
790
  _ensureNoRunning() {
794
791
  if (!this._isRunning)
795
- throw new I("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 se {
803
800
  }
804
801
  get store() {
805
802
  if (this._ensureNoRunning(), this._disposed)
806
- throw new I("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 I("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 se {
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 st(s, e = T.ofCaller()) {
828
- return new se(new A(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 He(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 rt(s, e) {
835
- const t = new it(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) : rt(e, t);
839
+ function Gt(r, e, t) {
840
+ r ? e(r) : Qe(e, t);
844
841
  }
845
- class it {
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
- He("Transaction already finished!"), rt((n) => {
852
+ Me("Transaction already finished!"), Qe((n) => {
856
853
  n.updateObserver(e, t);
857
854
  });
858
855
  return;
@@ -863,12 +860,12 @@ class it {
863
860
  var t;
864
861
  const e = this._updatingObservers;
865
862
  if (!e) {
866
- He("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 it {
876
873
  return this._updatingObservers;
877
874
  }
878
875
  }
879
- function y(s, e, t = T.ofCaller()) {
876
+ function x(r, e, t = D.ofCaller()) {
880
877
  let n;
881
- return typeof s == "string" ? n = new A(void 0, s, void 0) : n = new A(s, void 0, void 0), new re(n, e, X, 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 re 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 it(() => {
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 re extends Oe {
922
919
  this._value = e;
923
920
  }
924
921
  }
925
- function Le(...s) {
926
- let e, t, n, r;
927
- return s.length === 2 ? [t, n] = s : [e, t, n, r] = s, new F(new A(e, void 0, n), t, n, () => F.globalTransaction, X, r ?? T.ofCaller());
928
- }
929
- class F 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 p;
933
- const c = this._getValue(d), h = this._value, m = !this._hasValue || !this._equalityComparator(h, c);
934
- let v = !1;
935
- m && (this._value = c, this._hasValue && (v = !0, Xt(this._getTransaction(), (_) => {
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 R of this._observers)
939
- _.updateObserver(R, this), R.handleChange(this, void 0);
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());
925
+ }
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);
931
+ let _ = !1;
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 _ = this.getDebugName();
942
- return "Event fired" + (_ ? `: ${_}` : "");
943
- })), this._hasValue = !0), v || (p = b()) == null || p.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 F extends Oe {
966
963
  return { value: this._value, hasValue: this._hasValue };
967
964
  }
968
965
  }
969
- (function(s) {
970
- s.Observer = F;
966
+ (function(r) {
967
+ r.Observer = L;
971
968
  function e(t, n) {
972
- let r = !1;
973
- F.globalTransaction === void 0 && (F.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 && (F.globalTransaction = void 0);
974
+ s && (L.globalTransaction = void 0);
978
975
  }
979
976
  }
980
- s.batchEventsGlobally = e;
981
- })(Le || (Le = {}));
982
- function Yt(s) {
983
- const e = new ot(!1, void 0);
984
- return s.addObserver(e), nt(() => {
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(Yt);
989
- function Qt(s, e) {
990
- const t = new ot(!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 nt(() => {
998
- s.removeObserver(t);
994
+ return Ze(() => {
995
+ r.removeObserver(t);
999
996
  });
1000
997
  }
1001
- Ut(Qt);
1002
- class ot {
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 ot {
1014
1011
  handleChange(e, t) {
1015
1012
  }
1016
1013
  }
1017
- let te;
1018
- function en(s) {
1019
- te || (te = new tn(), Xe(te)), te.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
- P(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
- P(" "),
1041
- S(k(e.oldValue, 70), {
1037
+ U(" "),
1038
+ R(Z(e.oldValue, 70), {
1042
1039
  color: "red",
1043
1040
  strikeThrough: !0
1044
1041
  }),
1045
- P(" "),
1046
- S(k(e.newValue, 60), {
1042
+ U(" "),
1043
+ R(Z(e.newValue, 60), {
1047
1044
  color: "green"
1048
1045
  })
1049
- ] : [P(" (unchanged)")] : [
1050
- P(" "),
1051
- S(k(e.newValue, 60), {
1046
+ ] : [U(" (unchanged)")] : [
1047
+ U(" "),
1048
+ R(Z(e.newValue, 60), {
1052
1049
  color: "green"
1053
1050
  }),
1054
- P(" (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
- G("observable value changed"),
1073
- S(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 S(" (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
- G("derived recomputed"),
1092
- S(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
- G("derived cleared"),
1101
- S(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
- G("observable from event triggered"),
1107
- S(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
- G("autorun"),
1124
- S(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
- G("transaction"),
1136
- S(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 P(s) {
1158
- return S(s, { color: "black" });
1154
+ function U(r) {
1155
+ return R(r, { color: "black" });
1159
1156
  }
1160
- function G(s) {
1161
- return S(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 S(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 k(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 += `${k(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]]";
1212
1220
  }
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) {
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]]";
1227
+ }
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}: ${k(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 ie {
1236
- static createHost(e, t) {
1237
- return new ie(e, t);
1238
- }
1239
- static createClient(e, t) {
1240
- return new ie(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
- }, ie.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 at(s, e) {
1324
- for (const t in e)
1325
- s[t] && typeof s[t] == "object" && e[t] && typeof e[t] == "object" ? at(s[t], e[t]) : s[t] = e[t];
1326
- }
1327
- function dt(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" ? dt(s[t], e[t]) : s[t] = e[t];
1330
- }
1331
- class U {
1332
- static getInstance() {
1333
- return U._instance === void 0 && (U._instance = new U()), U._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 I("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 I("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(Q);
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 se) {
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(Q)
1447
- }),
1448
- getDerivedInfo: (e) => {
1449
- const t = this._aliveInstances.get(e);
1450
- return {
1451
- dependencies: [...t.debugGetState().dependencies].map((n) => this._formatObservable(n)).filter(Q),
1452
- observers: [...t.debugGetObservers()].map((n) => this._formatObserver(n)).filter(Q)
1453
- };
1454
- },
1455
- getAutorunInfo: (e) => ({
1456
- dependencies: [...this._aliveInstances.get(e).debugGetState().dependencies].map((n) => this._formatObservable(n)).filter(Q)
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 re)
1464
- n.debugSetValue(t);
1465
- else if (n instanceof F)
1466
- n.debugSetValue(t);
1467
- else
1468
- throw new I("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 k(t.debugGetState().value, 200);
1481
- if (t instanceof re)
1482
- return k(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 I("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 se)
1496
- t.debugRerun();
1497
- else
1498
- throw new I("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
- dt(this._fullState, e), this._pendingChanges === null ? this._pendingChanges = e : at(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 = k(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 = k(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
- U._instance = void 0;
1631
- function hn(s, e) {
1632
- const t = (e == null ? void 0 : e.debugNamePostProcessor) ?? ((i) => i), n = O.from(s, t);
1633
- return n ? ct(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 ct(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: ${k(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(ct(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 O {
1265
+ class T {
1649
1266
  static from(e, t) {
1650
- if (e instanceof se) {
1267
+ if (e instanceof Xe) {
1651
1268
  const n = e.debugGetState();
1652
- return new O(e, t(e.debugName), "autorun", void 0, n.stateStr, Array.from(n.dependencies).map((r) => O.from(r, t) || O.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 O(e, t(e.debugName), "derived", n.value, n.stateStr, Array.from(n.dependencies).map((r) => O.from(r, t) || O.unknown(r)));
1656
- } else if (e instanceof re) {
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 O(e, t(e.debugName), "observableValue", n.value, "upToDate", []);
1659
- } else if (e instanceof F) {
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 O(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 O(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
- At(en);
1673
- Xe(U.getInstance());
1674
- class lt {
1288
+ $t(nr);
1289
+ kt(Jt);
1290
+ class sr {
1675
1291
  constructor() {
1676
- l(this, "_fixtures", y(this, /* @__PURE__ */ new Map()));
1292
+ l(this, "_fixtures", x(this, /* @__PURE__ */ new Map()));
1677
1293
  /** Observable root of the fixture tree */
1678
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 lt {
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 Ts {
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,65 +1362,71 @@ class Ts {
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 p = n.attachShadow({ mode: "open" });
1759
- o = document.createElement("div"), p.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 = (...p) => {
1763
- d.push({ kind: "console", level: "error", message: p.map(String).join(" ") }), c.apply(console, p);
1764
- }, console.warn = (...p) => {
1765
- d.push({ kind: "console", level: "warn", message: p.map(String).join(" ") }), h.apply(console, p);
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 = (p) => {
1768
- var _;
1769
- d.push({ kind: "exception", message: p.message, stack: (_ = p.error) == null ? void 0 : _.stack });
1770
- }, v = (p) => {
1771
- const _ = p.reason, E = _ instanceof Error ? _.message : String(_), R = _ instanceof Error ? _.stack : void 0;
1772
- d.push({ kind: "exception", message: E, stack: R });
1384
+ const g = (m) => {
1385
+ var 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", v);
1391
+ window.addEventListener("error", g), window.addEventListener("unhandledrejection", _);
1775
1392
  try {
1776
- const p = r.render(o, i);
1777
- this._currentDisposable = p && typeof p == "object" && "dispose" in p ? p : void 0;
1778
- } catch (p) {
1779
- const _ = p instanceof Error ? p : new Error(String(p));
1780
- d.push({ kind: "exception", message: _.message, stack: _.stack });
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));
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((p) => requestAnimationFrame(() => requestAnimationFrame(() => p()))), window.removeEventListener("error", m), window.removeEventListener("unhandledrejection", v), { 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 = []) {
1416
+ var s;
1795
1417
  const n = [];
1796
- e.type === "component" && n.push({ fixtureId: e.id, fixtureName: e.name, groupPath: t });
1797
- for (const r of e.children ?? []) {
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 ?? []) {
1798
1420
  const i = e.id ? [...t, e.name] : t;
1799
- n.push(...this._flattenFixtures(r, i));
1421
+ n.push(...this._flattenFixtures(o, i));
1800
1422
  }
1801
1423
  return n;
1802
1424
  }
1803
1425
  _findFixtureNode(e, t) {
1804
1426
  if (e.id === t) return e;
1805
1427
  for (const n of e.children ?? []) {
1806
- const r = this._findFixtureNode(n, t);
1807
- if (r) return r;
1428
+ const s = this._findFixtureNode(n, t);
1429
+ if (s) return s;
1808
1430
  }
1809
1431
  }
1810
1432
  _installGlobalApi() {
@@ -1820,7 +1442,7 @@ class Ts {
1820
1442
  });
1821
1443
  }
1822
1444
  }
1823
- class un {
1445
+ class or {
1824
1446
  constructor(e) {
1825
1447
  this._run = e, this._changes = [], this._map = /* @__PURE__ */ new Map(), this._updateCounter = 0;
1826
1448
  }
@@ -1846,49 +1468,49 @@ class un {
1846
1468
  handleChange(e, t) {
1847
1469
  }
1848
1470
  }
1849
- function f() {
1850
- return ge.instance;
1471
+ function u() {
1472
+ return ce.instance;
1851
1473
  }
1852
- function fn() {
1853
- return me.instance;
1474
+ function ir() {
1475
+ return le.instance;
1854
1476
  }
1855
- function pn() {
1856
- return _e.instance;
1477
+ function ar() {
1478
+ return he.instance;
1857
1479
  }
1858
- f.const = fn;
1859
- f.obs = pn;
1860
- class ge {
1480
+ u.const = ir;
1481
+ u.obs = ar;
1482
+ class ce {
1861
1483
  create(e) {
1862
1484
  const t = N((n) => e(n));
1863
1485
  return { read: (n) => t };
1864
1486
  }
1865
1487
  }
1866
- ge.instance = new ge();
1867
- class me {
1488
+ ce.instance = new ce();
1489
+ class le {
1868
1490
  create(e) {
1869
1491
  const t = N((n) => e(n));
1870
1492
  return { read: (n) => t.read(n) };
1871
1493
  }
1872
1494
  }
1873
- me.instance = new me();
1874
- class _e {
1495
+ le.instance = new le();
1496
+ class he {
1875
1497
  create(e) {
1876
1498
  const t = N((n) => {
1877
- const r = e(n);
1878
- return gn(r) ? r.read(n) : r;
1499
+ const s = e(n);
1500
+ return dr(s) ? s.read(n) : s;
1879
1501
  });
1880
1502
  return { read: (n) => t };
1881
1503
  }
1882
1504
  }
1883
- _e.instance = new _e();
1884
- function gn(s) {
1885
- 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;
1886
1508
  }
1887
- function K(s, e) {
1888
- 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)]));
1889
1511
  }
1890
- const de = Symbol("ViewModelContext");
1891
- class mn {
1512
+ const ne = Symbol("ViewModelContext");
1513
+ class cr {
1892
1514
  constructor(e) {
1893
1515
  this._store = new Y(), this.props = e;
1894
1516
  }
@@ -1896,35 +1518,35 @@ class mn {
1896
1518
  this._store.dispose();
1897
1519
  }
1898
1520
  }
1899
- function _n(s) {
1900
- return s[de] || (s[de] = Ke(void 0)), s[de];
1521
+ function lr(r) {
1522
+ return r[ne] || (r[ne] = Ue(void 0)), r[ne];
1901
1523
  }
1902
- function M(s = {}) {
1524
+ function F(r = {}) {
1903
1525
  var e;
1904
- return e = class extends mn {
1905
- }, e._props = s, e;
1526
+ return e = class extends cr {
1527
+ }, e._props = r, e;
1906
1528
  }
1907
- let ve = 0;
1908
- const vn = new un((s) => {
1909
- for (const e of s)
1529
+ let ue = 0;
1530
+ const hr = new or((r) => {
1531
+ for (const e of r)
1910
1532
  e.rendered = !1;
1911
- if (ve > 0) {
1912
- const e = s.find((t) => t.isRendering);
1913
- e.itemsToRender = s;
1533
+ if (ue > 0) {
1534
+ const e = r.find((t) => t.isRendering);
1535
+ e.itemsToRender = r;
1914
1536
  } else
1915
- Je(() => {
1916
- for (const e of s)
1537
+ Pe(() => {
1538
+ for (const e of r)
1917
1539
  e.rendered || e.forceUpdate();
1918
1540
  });
1919
1541
  });
1920
- let bn = 0;
1921
- class yn {
1542
+ let ur = 0;
1543
+ class fr {
1922
1544
  constructor(e, t) {
1923
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 = () => () => {
1924
1546
  var n;
1925
1547
  (n = this._disposable) == null || n.dispose();
1926
1548
  }, this.itemsToRender = [], this.handleAfterRender = () => {
1927
- Je(() => {
1549
+ Pe(() => {
1928
1550
  for (const n of this.itemsToRender)
1929
1551
  n.rendered || n.forceUpdate();
1930
1552
  }), this.itemsToRender = [];
@@ -1934,135 +1556,139 @@ class yn {
1934
1556
  return this.debugName;
1935
1557
  }
1936
1558
  updateProps(e) {
1937
- this._obsProps ? this._obsProps.set(e, void 0) : (this._obsProps = y(this, e), this._render = this.renderFactory(this._obsProps, () => this.contextValues), this.rendering = N(this, this._render), this._disposable = vn.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));
1938
1560
  }
1939
1561
  }
1940
- function Te(s, e, t) {
1941
- const n = (o) => o + 1, r = () => new yn(s + ++bn, e), i = function(o) {
1942
- const d = Ot(n, 0)[1], c = Tt(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];
1943
1565
  for (const h of t ?? [])
1944
- c.contextValues.set(h, Rt(h));
1945
- 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)
1946
1568
  throw new Error("Component is already rendering");
1947
- c.isRendering = !0, ve++;
1569
+ c.isRendering = !0, ue++;
1948
1570
  try {
1949
- c.forceUpdate = d, c.updateProps(o);
1571
+ c.forceUpdate = d, c.updateProps(i);
1950
1572
  const h = c.rendering.get();
1951
1573
  return c.rendered = !0, h;
1952
1574
  } finally {
1953
- c.isRendering = !1, ve--;
1575
+ c.isRendering = !1, ue--;
1954
1576
  }
1955
1577
  };
1956
- return i.displayName = s, i;
1957
- }
1958
- Te("ObsView", (s) => (e) => s.read(e).children(e));
1959
- function D(s, e) {
1960
- return Te("view", (t) => {
1961
- const n = K(s, (r, i) => r.create((o) => t.read(o)[i], void 0));
1962
- return (r) => {
1963
- const i = K(n, (o) => o.read(r));
1964
- 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);
1965
1587
  };
1966
1588
  });
1967
1589
  }
1968
- function xn(s) {
1590
+ function pr(r) {
1969
1591
  const e = [];
1970
- for (const t of Object.values(s)) {
1592
+ for (const t of Object.values(r)) {
1971
1593
  const n = t._requiredContext;
1972
1594
  n && !e.includes(n) && e.push(n);
1973
1595
  }
1974
1596
  return e;
1975
1597
  }
1976
- function B(s, e, t) {
1977
- const n = typeof e == "function" ? {} : e, r = typeof e == "function" ? e : t, i = "_props" in s ? s._props : {}, o = xn({ ...i, ...n }), d = _n(s), c = [...o, d];
1978
- return Te("viewWithModel", (h, m) => {
1979
- const v = m(), p = v.get(d), _ = "_props" in s ? K(s._props, (C, z) => C.create((H) => h.read(H)[z], v.get(C._requiredContext))) : {}, E = p ? { read: () => p, dispose: () => {
1980
- } } : Jt((C) => {
1981
- const z = K(_, (H) => H.read(C));
1982
- return new s(z);
1983
- }), R = K(n, (C, z) => C.create((H) => h.read(H)[z], v.get(C._requiredContext)));
1984
- return (C) => {
1985
- const z = E.read(C), H = K(R, (Ct) => Ct.read(C));
1986
- return r(C, z, H);
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)));
1606
+ return (S) => {
1607
+ const B = v.read(S), A = K(O, (gt) => gt.read(S));
1608
+ return s(S, B, A);
1987
1609
  };
1988
1610
  }, c.length > 0 ? c : void 0);
1989
1611
  }
1990
- D({ value: f.obs() }, (s, e) => e.value.read(s));
1991
- Ke(null);
1992
- function ht(s) {
1612
+ I({ value: u.obs() }, (r, e) => e.value.read(r));
1613
+ Ue(null);
1614
+ function st(r) {
1993
1615
  var e;
1994
1616
  return {
1995
- id: s.id,
1996
- name: s.name,
1997
- type: s.type,
1998
- children: (e = s.children) == null ? void 0 : e.map(ht),
1999
- 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
2000
1622
  };
2001
1623
  }
2002
- function ee(s, e) {
1624
+ function Q(r, e) {
2003
1625
  const {
2004
1626
  storageKey: t,
2005
1627
  defaultValue: n,
2006
- serialize: r = JSON.stringify,
2007
- deserialize: i = JSON.parse
1628
+ serialize: s = JSON.stringify,
1629
+ deserialize: o = JSON.parse
2008
1630
  } = e;
2009
- let o = n;
1631
+ let i = n;
2010
1632
  try {
2011
1633
  const h = localStorage.getItem(t);
2012
- h !== null && (o = i(h));
1634
+ h !== null && (i = o(h));
2013
1635
  } catch {
2014
1636
  }
2015
- const d = y(s, o), c = d.set.bind(d);
2016
- return d.set = (h, m) => {
1637
+ const d = x(r, i), c = d.set.bind(d);
1638
+ return d.set = (h, g) => {
2017
1639
  try {
2018
- localStorage.setItem(t, r(h));
1640
+ localStorage.setItem(t, s(h));
2019
1641
  } catch {
2020
1642
  }
2021
- c(h, m);
1643
+ c(h, g);
2022
1644
  }, d;
2023
1645
  }
2024
- class Cn extends M({
2025
- registry: f.const(),
2026
- daemonModel: f.const()
1646
+ class gr extends F({
1647
+ registry: u.const(),
1648
+ daemonModel: u.const(),
1649
+ reportModel: u.const()
2027
1650
  }) {
2028
1651
  constructor() {
2029
1652
  super(...arguments);
2030
- l(this, "leftSidebarVisible", ee(this, {
1653
+ l(this, "leftSidebarVisible", Q(this, {
2031
1654
  storageKey: "component-explorer:leftSidebarVisible",
2032
1655
  defaultValue: !0
2033
1656
  }));
2034
- l(this, "rightSidebarVisible", ee(this, {
1657
+ l(this, "rightSidebarVisible", Q(this, {
2035
1658
  storageKey: "component-explorer:rightSidebarVisible",
2036
- defaultValue: !0
1659
+ defaultValue: !1
2037
1660
  }));
2038
- l(this, "isDarkTheme", ee(this, {
1661
+ l(this, "isDarkTheme", Q(this, {
2039
1662
  storageKey: "component-explorer:isDarkTheme",
2040
1663
  defaultValue: !0
2041
1664
  }));
2042
- l(this, "selectedNodeId", ee(this, {
1665
+ l(this, "selectedNodeId", Q(this, {
2043
1666
  storageKey: "component-explorer:selectedNodeId",
2044
1667
  defaultValue: void 0
2045
1668
  }));
2046
- l(this, "expandedNodeIds", y(this, /* @__PURE__ */ new Set()));
2047
- l(this, "viewMode", ee(this, {
1669
+ l(this, "expandedNodeIds", x(this, /* @__PURE__ */ new Set([""])));
1670
+ l(this, "viewMode", Q(this, {
2048
1671
  storageKey: "component-explorer:viewMode",
2049
1672
  defaultValue: "session"
2050
1673
  }));
2051
- /** The explorer's tree derived from the registry */
1674
+ /** The explorer's tree derived from the registry or report */
2052
1675
  l(this, "tree", N(this, (t) => {
2053
- const n = this.props.registry.root.read(t);
2054
- return ht(n);
1676
+ const n = this.props.reportModel;
1677
+ if (n)
1678
+ return n.buildTree(t);
1679
+ const s = this.props.registry.root.read(t);
1680
+ return st(s);
2055
1681
  }));
2056
1682
  l(this, "selectedNode", N(this, (t) => {
2057
1683
  const n = this.selectedNodeId.read(t);
2058
- if (!n) return;
2059
- const r = this.tree.read(t);
2060
- return this._findNode(r.children ?? [], n);
1684
+ if (n === void 0) return;
1685
+ const s = this.tree.read(t);
1686
+ return s.id === n ? s : this._findNode(s.children ?? [], n);
2061
1687
  }));
2062
1688
  /** List of preview rows to render based on current selection and view mode */
2063
1689
  l(this, "selectedFixtures", N(this, (t) => {
2064
1690
  const n = this.selectedNode.read(t);
2065
- return n ? 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) : [];
2066
1692
  }));
2067
1693
  l(this, "setViewMode", (t) => {
2068
1694
  this.viewMode.set(t, void 0);
@@ -2070,8 +1696,8 @@ class Cn extends M({
2070
1696
  l(this, "navigateToSession", (t) => {
2071
1697
  const n = this.props.daemonModel;
2072
1698
  if (!n) return;
2073
- const r = n.getSessionExplorerUrl(t);
2074
- r && (window.location.href = r);
1699
+ const s = n.getSessionExplorerUrl(t);
1700
+ s && (window.location.href = s);
2075
1701
  });
2076
1702
  l(this, "toggleLeftSidebar", () => {
2077
1703
  this.leftSidebarVisible.set(!this.leftSidebarVisible.get(), void 0);
@@ -2086,8 +1712,8 @@ class Cn extends M({
2086
1712
  this.selectedNodeId.set(t, void 0);
2087
1713
  });
2088
1714
  l(this, "toggleNodeExpanded", (t) => {
2089
- const n = this.expandedNodeIds.get(), r = new Set(n);
2090
- 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);
2091
1717
  });
2092
1718
  }
2093
1719
  get daemonAvailable() {
@@ -2096,15 +1722,21 @@ class Cn extends M({
2096
1722
  get daemon() {
2097
1723
  return this.props.daemonModel;
2098
1724
  }
1725
+ get reportModel() {
1726
+ return this.props.reportModel;
1727
+ }
1728
+ get isReportMode() {
1729
+ return this.props.reportModel !== void 0;
1730
+ }
2099
1731
  isNodeExpanded(t, n) {
2100
1732
  return this.expandedNodeIds.read(n).has(t);
2101
1733
  }
2102
1734
  _findNode(t, n) {
2103
- for (const r of t) {
2104
- if (r.id === n) return r;
2105
- if (r.children) {
2106
- const i = this._findNode(r.children, n);
2107
- 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;
2108
1740
  }
2109
1741
  }
2110
1742
  }
@@ -2120,28 +1752,28 @@ class Cn extends M({
2120
1752
  }
2121
1753
  }];
2122
1754
  if (t.type === "variants") {
2123
- const i = [];
2124
- for (const o of t.children ?? [])
2125
- o.type === "component" && o.component && i.push({
2126
- id: o.id,
2127
- name: o.name,
2128
- path: `${n} / ${o.name}`,
2129
- 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
2130
1762
  });
2131
- return i.length > 0 ? [{
1763
+ return o.length > 0 ? [{
2132
1764
  type: "variants",
2133
1765
  id: t.id,
2134
1766
  name: t.name,
2135
1767
  path: n,
2136
- fixtures: i
1768
+ fixtures: o
2137
1769
  }] : [];
2138
1770
  }
2139
- const r = [];
2140
- for (const i of t.children ?? []) {
2141
- const o = n ? `${n} / ${i.name}` : i.name;
2142
- 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));
2143
1775
  }
2144
- return r;
1776
+ return s;
2145
1777
  }
2146
1778
  /**
2147
1779
  * In diff mode: fixtures become screenshot comparison items showing current vs baseline.
@@ -2161,30 +1793,56 @@ class Cn extends M({
2161
1793
  }]
2162
1794
  }];
2163
1795
  if (t.type === "variants") {
2164
- const i = [];
2165
- for (const o of t.children ?? [])
2166
- o.type === "component" && i.push({
2167
- fixtureId: o.id,
2168
- name: o.name,
2169
- 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}`
2170
1802
  });
2171
- return i.length > 0 ? [{
1803
+ return o.length > 0 ? [{
2172
1804
  type: "screenshot-comparison",
2173
1805
  id: t.id,
2174
1806
  name: t.name,
2175
1807
  path: n,
2176
- items: i
1808
+ items: o
2177
1809
  }] : [];
2178
1810
  }
2179
- const r = [];
2180
- for (const i of t.children ?? []) {
2181
- const o = n ? `${n} / ${i.name}` : i.name;
2182
- 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));
2183
1815
  }
2184
- return r;
1816
+ return s;
1817
+ }
1818
+ _collectReportRows(t, n) {
1819
+ const s = this.props.reportModel.state.get();
1820
+ if (s.status !== "ready") return [];
1821
+ const o = s.report.fixtures;
1822
+ if (t.type === "component") {
1823
+ const d = o[t.id];
1824
+ return d ? [{
1825
+ type: "report-comparison",
1826
+ id: t.id,
1827
+ name: t.name,
1828
+ path: n,
1829
+ items: [{
1830
+ fixtureId: t.id,
1831
+ name: t.name,
1832
+ path: n,
1833
+ entry: d
1834
+ }]
1835
+ }] : [];
1836
+ }
1837
+ const i = [];
1838
+ for (const d of t.children ?? []) {
1839
+ const c = n ? `${n} / ${d.name}` : d.name;
1840
+ i.push(...this._collectReportRows(d, c));
1841
+ }
1842
+ return i;
2185
1843
  }
2186
1844
  }
2187
- const u = {
1845
+ const p = {
2188
1846
  container: {
2189
1847
  display: "flex",
2190
1848
  flexDirection: "row",
@@ -2373,15 +2031,15 @@ const u = {
2373
2031
  cursor: "pointer"
2374
2032
  }
2375
2033
  };
2376
- function Re(...s) {
2377
- return Object.assign({}, ...s.filter(Boolean));
2034
+ function Ce(...r) {
2035
+ return Object.assign({}, ...r.filter(Boolean));
2378
2036
  }
2379
- class wn extends M({
2380
- active: f()
2037
+ class mr extends F({
2038
+ active: u()
2381
2039
  }) {
2382
2040
  constructor() {
2383
2041
  super(...arguments);
2384
- l(this, "isHovered", y(this, !1));
2042
+ l(this, "isHovered", x(this, !1));
2385
2043
  l(this, "setHovered", (t) => {
2386
2044
  this.isHovered.set(t, void 0);
2387
2045
  });
@@ -2390,23 +2048,23 @@ class wn extends M({
2390
2048
  return this.props.active;
2391
2049
  }
2392
2050
  }
2393
- const ce = B(
2394
- wn,
2051
+ const se = E(
2052
+ mr,
2395
2053
  {
2396
- onClick: f.const(),
2397
- title: f.const(),
2398
- children: f.const()
2399
- },
2400
- (s, e, t) => {
2401
- const n = e.isHovered.read(s), r = e.active.read(s), i = Re(
2402
- u.titleBarButton,
2403
- n && !r && u.titleBarButtonHover,
2404
- r && u.titleBarButtonActive
2054
+ onClick: u.const(),
2055
+ title: u.const(),
2056
+ children: u.const()
2057
+ },
2058
+ (r, e, t) => {
2059
+ const n = e.isHovered.read(r), s = e.active.read(r), o = Ce(
2060
+ p.titleBarButton,
2061
+ n && !s && p.titleBarButtonHover,
2062
+ s && p.titleBarButtonActive
2405
2063
  );
2406
2064
  return /* @__PURE__ */ a(
2407
2065
  "button",
2408
2066
  {
2409
- style: i,
2067
+ style: o,
2410
2068
  onClick: t.onClick,
2411
2069
  title: t.title,
2412
2070
  onMouseEnter: () => e.setHovered(!0),
@@ -2415,17 +2073,17 @@ const ce = B(
2415
2073
  }
2416
2074
  );
2417
2075
  }
2418
- ), Sn = ({ 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" }) }), In = ({ 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)" }) }), On = ({ 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" }) }), Rn = () => /* @__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" }) }), kn = () => /* @__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" }) }), Nn = () => /* @__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" }) }), Dn = D(
2419
- { model: f.const() },
2420
- (s, e) => {
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(
2077
+ { model: u.const() },
2078
+ (r, e) => {
2421
2079
  var d, c;
2422
- 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);
2423
- return /* @__PURE__ */ g("div", { style: J.container, children: [
2424
- /* @__PURE__ */ g("div", { style: J.segmentedControl, children: [
2425
- /* @__PURE__ */ a($e, { label: "Live", mode: "session", active: n === "session", onClick: () => t.setViewMode("session") }),
2426
- /* @__PURE__ */ a($e, { 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") })
2427
2085
  ] }),
2428
- o.length > 0 && /* @__PURE__ */ a("div", { style: J.sessionLinks, children: o.map((h) => /* @__PURE__ */ g(
2086
+ i.length > 0 && /* @__PURE__ */ a("div", { style: J.sessionLinks, children: i.map((h) => /* @__PURE__ */ f(
2429
2087
  "button",
2430
2088
  {
2431
2089
  style: J.sessionLink,
@@ -2441,57 +2099,57 @@ const ce = B(
2441
2099
  ] });
2442
2100
  }
2443
2101
  );
2444
- function $e({ label: s, mode: e, active: t, onClick: n }) {
2102
+ function Ee({ label: r, mode: e, active: t, onClick: n }) {
2445
2103
  return /* @__PURE__ */ a(
2446
2104
  "button",
2447
2105
  {
2448
2106
  style: t ? J.segmentActive : J.segment,
2449
2107
  onClick: n,
2450
- children: s
2108
+ children: r
2451
2109
  }
2452
2110
  );
2453
2111
  }
2454
- const En = D(
2112
+ const Tr = I(
2455
2113
  {
2456
- model: f.const()
2114
+ model: u.const()
2457
2115
  },
2458
- (s, e) => {
2459
- const t = e.model, n = t.leftSidebarVisible.read(s), r = t.rightSidebarVisible.read(s), i = t.isDarkTheme.read(s), o = t.selectedNode.read(s);
2460
- return /* @__PURE__ */ g("div", { style: u.titleBar, children: [
2461
- /* @__PURE__ */ a("div", { style: u.titleBarSection, children: /* @__PURE__ */ a(
2462
- ce,
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);
2118
+ return /* @__PURE__ */ f("div", { style: p.titleBar, children: [
2119
+ /* @__PURE__ */ a("div", { style: p.titleBarSection, children: /* @__PURE__ */ a(
2120
+ se,
2463
2121
  {
2464
2122
  active: n,
2465
2123
  onClick: t.toggleLeftSidebar,
2466
2124
  title: "Toggle left sidebar",
2467
- children: /* @__PURE__ */ a(Rn, {})
2125
+ children: /* @__PURE__ */ a(xr, {})
2468
2126
  }
2469
2127
  ) }),
2470
- /* @__PURE__ */ g("div", { style: u.titleBarCenter, children: [
2471
- t.daemonAvailable && /* @__PURE__ */ a(Dn, { model: t }),
2472
- o ? /* @__PURE__ */ g(ye, { children: [
2128
+ /* @__PURE__ */ f("div", { style: p.titleBarCenter, 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: [
2473
2131
  /* @__PURE__ */ a("span", { style: { color: "var(--vscode-textLink-foreground)" }, children: "<" }),
2474
- /* @__PURE__ */ a("span", { children: o.name }),
2132
+ /* @__PURE__ */ a("span", { children: i.name }),
2475
2133
  /* @__PURE__ */ a("span", { style: { color: "var(--vscode-textLink-foreground)" }, children: "/>" })
2476
2134
  ] }) : /* @__PURE__ */ a("span", { style: { color: "var(--vscode-descriptionForeground)" }, children: "No component selected" })
2477
2135
  ] }),
2478
- /* @__PURE__ */ g("div", { style: u.titleBarSection, children: [
2136
+ /* @__PURE__ */ f("div", { style: p.titleBarSection, children: [
2479
2137
  /* @__PURE__ */ a(
2480
- ce,
2138
+ se,
2481
2139
  {
2482
2140
  active: !1,
2483
2141
  onClick: t.toggleTheme,
2484
- title: i ? "Switch to light theme" : "Switch to dark theme",
2485
- children: i ? /* @__PURE__ */ a(kn, {}) : /* @__PURE__ */ a(Nn, {})
2142
+ title: o ? "Switch to light theme" : "Switch to dark theme",
2143
+ children: o ? /* @__PURE__ */ a(Sr, {}) : /* @__PURE__ */ a(wr, {})
2486
2144
  }
2487
2145
  ),
2488
2146
  /* @__PURE__ */ a(
2489
- ce,
2147
+ se,
2490
2148
  {
2491
- active: r,
2149
+ active: s,
2492
2150
  onClick: t.toggleRightSidebar,
2493
2151
  title: "Toggle right sidebar",
2494
- children: /* @__PURE__ */ a(Vn, {})
2152
+ children: /* @__PURE__ */ a(Cr, {})
2495
2153
  }
2496
2154
  )
2497
2155
  ] })
@@ -2541,22 +2199,22 @@ const En = D(
2541
2199
  color: "var(--vscode-textLink-foreground)",
2542
2200
  cursor: "pointer"
2543
2201
  }
2544
- }, ut = D(
2202
+ }, ot = I(
2545
2203
  {
2546
- model: f.const(),
2547
- nodes: f.const(),
2548
- depth: f.const()
2204
+ model: u.const(),
2205
+ nodes: u.const(),
2206
+ depth: u.const()
2549
2207
  },
2550
- (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)) })
2551
2209
  );
2552
- class Fn extends M({
2553
- model: f.const(),
2554
- node: f.const(),
2555
- depth: f.const()
2210
+ class Ir extends F({
2211
+ model: u.const(),
2212
+ node: u.const(),
2213
+ depth: u.const()
2556
2214
  }) {
2557
2215
  constructor() {
2558
2216
  super(...arguments);
2559
- l(this, "isHovered", y(this, !1));
2217
+ l(this, "isHovered", x(this, !1));
2560
2218
  l(this, "setHovered", (t) => {
2561
2219
  this.isHovered.set(t, void 0);
2562
2220
  });
@@ -2584,55 +2242,55 @@ class Fn extends M({
2584
2242
  return !!(this.props.node.children && this.props.node.children.length > 0);
2585
2243
  }
2586
2244
  }
2587
- const An = B(Fn, {}, (s, e) => {
2588
- 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 = Re(
2589
- u.treeItem,
2590
- { paddingLeft: `${8 + r * 12}px` },
2591
- c && u.treeItemSelected,
2592
- !c && h && u.treeItemHover
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(
2247
+ p.treeItem,
2248
+ { paddingLeft: `${8 + s * 12}px` },
2249
+ c && p.treeItemSelected,
2250
+ !c && h && p.treeItemHover
2593
2251
  );
2594
- return /* @__PURE__ */ g(ye, { children: [
2595
- /* @__PURE__ */ g(
2252
+ return /* @__PURE__ */ f(pe, { children: [
2253
+ /* @__PURE__ */ f(
2596
2254
  "div",
2597
2255
  {
2598
- style: m,
2256
+ style: g,
2599
2257
  onClick: e.handleClick,
2600
2258
  onDoubleClick: e.handleDoubleClick,
2601
2259
  onMouseEnter: () => e.setHovered(!0),
2602
2260
  onMouseLeave: () => e.setHovered(!1),
2603
2261
  children: [
2604
- i ? /* @__PURE__ */ a("div", { style: u.treeItemChevron, onClick: e.handleChevronClick, children: o ? /* @__PURE__ */ a(In, {}) : /* @__PURE__ */ a(Sn, {}) }) : /* @__PURE__ */ a("div", { style: u.treeItemChevronPlaceholder }),
2605
- /* @__PURE__ */ a("div", { style: u.treeItemIcon, children: n.type === "folder" ? /* @__PURE__ */ a(Tn, { style: { color: "var(--vscode-symbolIcon-folderForeground)" } }) : /* @__PURE__ */ a(On, { style: { color: "#deb45b" } }) }),
2606
- /* @__PURE__ */ a("span", { style: u.treeItemLabel, children: n.name }),
2607
- i && /* @__PURE__ */ a("span", { style: u.treeItemCount, children: n.children.length })
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" } }) }),
2264
+ /* @__PURE__ */ a("span", { style: p.treeItemLabel, children: n.name }),
2265
+ o && /* @__PURE__ */ a("span", { style: p.treeItemCount, children: n.children.length })
2608
2266
  ]
2609
2267
  }
2610
2268
  ),
2611
- 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 })
2612
2270
  ] });
2613
- }), Mn = D(
2271
+ }), kr = I(
2614
2272
  {
2615
- model: f.const()
2273
+ model: u.const()
2616
2274
  },
2617
- (s, e) => {
2618
- const t = e.model.tree.read(s);
2619
- return /* @__PURE__ */ g("div", { style: u.sidebar, children: [
2620
- /* @__PURE__ */ a("div", { style: u.sidebarHeader, children: "Explorer" }),
2621
- /* @__PURE__ */ a("div", { style: u.sidebarContent, children: /* @__PURE__ */ a(ut, { model: e.model, nodes: t.children ?? [], depth: 0 }) })
2275
+ (r, e) => {
2276
+ const t = e.model.tree.read(r);
2277
+ return /* @__PURE__ */ f("div", { style: p.sidebar, children: [
2278
+ /* @__PURE__ */ a("div", { style: p.sidebarHeader, children: "Explorer" }),
2279
+ /* @__PURE__ */ a("div", { style: p.sidebarContent, children: /* @__PURE__ */ a(ot, { model: e.model, nodes: [t], depth: 0 }) })
2622
2280
  ] });
2623
2281
  }
2624
2282
  );
2625
- class Bn extends M({}) {
2283
+ class Vr extends F({}) {
2626
2284
  constructor() {
2627
2285
  super(...arguments);
2628
- l(this, "checked", y(this, !1));
2286
+ l(this, "checked", x(this, !1));
2629
2287
  l(this, "toggle", () => {
2630
2288
  this.checked.set(!this.checked.get(), void 0);
2631
2289
  });
2632
2290
  }
2633
2291
  }
2634
- const zn = B(Bn, {}, (s, e) => {
2635
- const t = e.checked.read(s), n = {
2292
+ const Nr = E(Vr, {}, (r, e) => {
2293
+ const t = e.checked.read(r), n = {
2636
2294
  position: "relative",
2637
2295
  width: "36px",
2638
2296
  height: "18px",
@@ -2641,7 +2299,7 @@ const zn = B(Bn, {}, (s, e) => {
2641
2299
  cursor: "pointer",
2642
2300
  transition: "background-color 0.2s",
2643
2301
  border: "1px solid var(--vscode-input-border, transparent)"
2644
- }, r = {
2302
+ }, s = {
2645
2303
  position: "absolute",
2646
2304
  top: "2px",
2647
2305
  left: t ? "18px" : "2px",
@@ -2651,14 +2309,14 @@ const zn = B(Bn, {}, (s, e) => {
2651
2309
  borderRadius: "50%",
2652
2310
  transition: "left 0.2s"
2653
2311
  };
2654
- return /* @__PURE__ */ a("div", { style: n, onClick: e.toggle, children: /* @__PURE__ */ a("div", { style: r }) });
2655
- }), Hn = D(
2312
+ return /* @__PURE__ */ a("div", { style: n, onClick: e.toggle, children: /* @__PURE__ */ a("div", { style: s }) });
2313
+ }), Dr = I(
2656
2314
  {
2657
- node: f.const()
2315
+ node: u.const()
2658
2316
  },
2659
- (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__ */ g("div", { style: u.propertiesPanel, children: [
2660
- /* @__PURE__ */ g("div", { style: u.propertyRow, children: [
2661
- /* @__PURE__ */ g("div", { style: u.propertyLabel, 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: [
2318
+ /* @__PURE__ */ f("div", { style: p.propertyRow, children: [
2319
+ /* @__PURE__ */ f("div", { style: p.propertyLabel, children: [
2662
2320
  "children",
2663
2321
  /* @__PURE__ */ a("span", { style: { color: "var(--vscode-descriptionForeground)" }, children: " : string" })
2664
2322
  ] }),
@@ -2666,83 +2324,84 @@ const zn = B(Bn, {}, (s, e) => {
2666
2324
  "input",
2667
2325
  {
2668
2326
  type: "text",
2669
- style: u.propertyInput,
2327
+ style: p.propertyInput,
2670
2328
  defaultValue: "Click me",
2671
2329
  placeholder: "Enter text..."
2672
2330
  }
2673
2331
  ),
2674
- /* @__PURE__ */ a("div", { style: u.propertyDescription, children: "Button text content" })
2332
+ /* @__PURE__ */ a("div", { style: p.propertyDescription, children: "Button text content" })
2675
2333
  ] }),
2676
- /* @__PURE__ */ g("div", { style: u.propertyRow, children: [
2677
- /* @__PURE__ */ g("div", { style: u.propertyLabel, children: [
2334
+ /* @__PURE__ */ f("div", { style: p.propertyRow, children: [
2335
+ /* @__PURE__ */ f("div", { style: p.propertyLabel, children: [
2678
2336
  "variant",
2679
2337
  /* @__PURE__ */ a("span", { style: { color: "var(--vscode-descriptionForeground)" }, children: " : select" })
2680
2338
  ] }),
2681
- /* @__PURE__ */ g("select", { style: u.propertySelect, defaultValue: "default", children: [
2339
+ /* @__PURE__ */ f("select", { style: p.propertySelect, defaultValue: "default", children: [
2682
2340
  /* @__PURE__ */ a("option", { value: "default", children: "default" }),
2683
2341
  /* @__PURE__ */ a("option", { value: "primary", children: "primary" }),
2684
2342
  /* @__PURE__ */ a("option", { value: "secondary", children: "secondary" }),
2685
2343
  /* @__PURE__ */ a("option", { value: "destructive", children: "destructive" })
2686
2344
  ] }),
2687
- /* @__PURE__ */ a("div", { style: u.propertyDescription, children: "Visual style variant" })
2345
+ /* @__PURE__ */ a("div", { style: p.propertyDescription, children: "Visual style variant" })
2688
2346
  ] }),
2689
- /* @__PURE__ */ g("div", { style: u.propertyRow, children: [
2690
- /* @__PURE__ */ g("div", { style: u.propertyLabel, children: [
2347
+ /* @__PURE__ */ f("div", { style: p.propertyRow, children: [
2348
+ /* @__PURE__ */ f("div", { style: p.propertyLabel, children: [
2691
2349
  "size",
2692
2350
  /* @__PURE__ */ a("span", { style: { color: "var(--vscode-descriptionForeground)" }, children: " : select" })
2693
2351
  ] }),
2694
- /* @__PURE__ */ g("select", { style: u.propertySelect, defaultValue: "default", children: [
2352
+ /* @__PURE__ */ f("select", { style: p.propertySelect, defaultValue: "default", children: [
2695
2353
  /* @__PURE__ */ a("option", { value: "sm", children: "sm" }),
2696
2354
  /* @__PURE__ */ a("option", { value: "default", children: "default" }),
2697
2355
  /* @__PURE__ */ a("option", { value: "lg", children: "lg" })
2698
2356
  ] }),
2699
- /* @__PURE__ */ a("div", { style: u.propertyDescription, children: "Button size" })
2357
+ /* @__PURE__ */ a("div", { style: p.propertyDescription, children: "Button size" })
2700
2358
  ] }),
2701
- /* @__PURE__ */ g("div", { style: u.propertyRow, children: [
2702
- /* @__PURE__ */ g("div", { style: u.propertyLabel, children: [
2359
+ /* @__PURE__ */ f("div", { style: p.propertyRow, children: [
2360
+ /* @__PURE__ */ f("div", { style: p.propertyLabel, children: [
2703
2361
  "disabled",
2704
2362
  /* @__PURE__ */ a("span", { style: { color: "var(--vscode-descriptionForeground)" }, children: " : boolean" })
2705
2363
  ] }),
2706
- /* @__PURE__ */ a(zn, {}),
2707
- /* @__PURE__ */ a("div", { style: u.propertyDescription, children: "Disable the button" })
2364
+ /* @__PURE__ */ a(Nr, {}),
2365
+ /* @__PURE__ */ a("div", { style: p.propertyDescription, children: "Disable the button" })
2708
2366
  ] })
2709
2367
  ] })
2710
- ), Ln = D(
2368
+ ), Mr = I(
2711
2369
  {
2712
- selectedNode: f.const()
2370
+ selectedNode: u.const()
2713
2371
  },
2714
- (s, e) => /* @__PURE__ */ g("div", { style: Re(u.sidebar, u.sidebarRight), children: [
2715
- /* @__PURE__ */ g("div", { style: u.sidebarHeader, children: [
2372
+ (r, e) => /* @__PURE__ */ f("div", { style: Ce(p.sidebar, p.sidebarRight), children: [
2373
+ /* @__PURE__ */ f("div", { style: p.sidebarHeader, children: [
2716
2374
  /* @__PURE__ */ a("span", { style: { marginRight: "6px", color: "var(--vscode-textLink-foreground)" }, children: "</>" }),
2717
2375
  "Props"
2718
2376
  ] }),
2719
- /* @__PURE__ */ a("div", { style: u.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" }) })
2720
2378
  ] })
2721
2379
  );
2722
- class $n extends M({
2723
- fixture: f.const(),
2724
- compact: f.const()
2380
+ class Fr extends F({
2381
+ fixture: u.const(),
2382
+ compact: u.const()
2725
2383
  }) {
2726
2384
  constructor() {
2727
2385
  super(...arguments);
2728
2386
  l(this, "_containerRef", null);
2729
2387
  l(this, "_shadowRoot", null);
2730
2388
  l(this, "_renderContainer", null);
2731
- l(this, "_disposable", null);
2389
+ l(this, "_renderResult", null);
2390
+ l(this, "_abortController", null);
2732
2391
  l(this, "_resizeObserver", null);
2733
- l(this, "measuredWidth", y(this, void 0));
2734
- l(this, "measuredHeight", y(this, void 0));
2392
+ l(this, "measuredWidth", x(this, void 0));
2393
+ l(this, "measuredHeight", x(this, void 0));
2735
2394
  l(this, "setContainerRef", (t) => {
2736
2395
  if (t === this._containerRef || (this._cleanup(), this._containerRef = t, !t)) return;
2737
2396
  const n = this.fixture.component;
2738
2397
  n.isolation === "shadow-dom" ? this._renderInShadowDom(t, n) : this._renderDirect(t, n);
2739
- const r = this._renderContainer ?? t;
2740
- this._resizeObserver = new ResizeObserver((i) => {
2741
- for (const o of i) {
2742
- 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;
2743
2402
  c > 0 && (this.measuredWidth.set(Math.round(d), void 0), this.measuredHeight.set(Math.round(c), void 0));
2744
2403
  }
2745
- }), this._resizeObserver.observe(r);
2404
+ }), this._resizeObserver.observe(s);
2746
2405
  });
2747
2406
  }
2748
2407
  get fixture() {
@@ -2759,69 +2418,81 @@ class $n extends M({
2759
2418
  } else
2760
2419
  this._shadowRoot = t.attachShadow({ mode: "open" });
2761
2420
  if (n.styles)
2762
- for (const o of n.styles)
2763
- if (o.type === "css") {
2421
+ for (const i of n.styles)
2422
+ if (i.type === "css") {
2764
2423
  const d = document.createElement("style");
2765
- d.textContent = o.content, this._shadowRoot.appendChild(d);
2766
- } else if (o.type === "url") {
2424
+ d.textContent = i.content, this._shadowRoot.appendChild(d);
2425
+ } else if (i.type === "url") {
2767
2426
  const d = document.createElement("link");
2768
- d.rel = "stylesheet", d.href = o.href, this._shadowRoot.appendChild(d);
2769
- } 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 = [
2770
2429
  ...this._shadowRoot.adoptedStyleSheets,
2771
- o.sheet
2430
+ i.sheet
2772
2431
  ]);
2773
- const r = document.createElement("div");
2774
- r.style.display = "inline-block", this._renderContainer = r, this._shadowRoot.appendChild(r);
2775
- const i = this._getDefaultProps(n);
2776
- 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
+ }));
2777
2439
  }
2778
2440
  _renderDirect(t, n) {
2779
2441
  this._renderContainer = t;
2780
- const r = this._getDefaultProps(n);
2781
- 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;
2782
2453
  }
2783
2454
  _getDefaultProps(t) {
2784
2455
  const n = {};
2785
- for (const r of t.properties)
2786
- n[r.name] = r.defaultValue;
2456
+ for (const s of t.properties)
2457
+ n[s.name] = s.defaultValue;
2787
2458
  return n;
2788
2459
  }
2789
2460
  _cleanup() {
2790
- var t;
2791
- 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;
2792
2463
  }
2793
2464
  dispose() {
2794
2465
  this._cleanup();
2795
2466
  }
2796
2467
  }
2797
- const ft = B(
2798
- $n,
2468
+ const it = E(
2469
+ Fr,
2799
2470
  {},
2800
- (s, e) => {
2801
- 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;
2802
2473
  let c;
2803
- if (r.type === "page") {
2804
- const p = r.viewports[0], _ = Nt(p);
2474
+ if (s.type === "page") {
2475
+ const C = s.viewports[0], m = wt(C);
2805
2476
  c = {
2806
- width: _.width,
2807
- height: _.height,
2477
+ width: m.width,
2478
+ height: m.height,
2808
2479
  overflow: "auto"
2809
2480
  };
2810
2481
  } else
2811
2482
  c = {
2812
2483
  display: "inline-block"
2813
2484
  };
2814
- const h = i && o ? `${i} × ${o}` : "", m = d ? q.wrapperCompact : q.wrapper, v = d ? q.nameCompact : q.name;
2815
- return /* @__PURE__ */ g("div", { style: m, children: [
2816
- /* @__PURE__ */ g("div", { style: q.labelRow, children: [
2817
- /* @__PURE__ */ a("span", { style: v, children: t.name }),
2818
- !d && h && /* @__PURE__ */ a("span", { style: q.dimensions, children: h })
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: [
2488
+ /* @__PURE__ */ a("span", { style: _, children: t.name }),
2489
+ !d && h && /* @__PURE__ */ a("span", { style: G.dimensions, children: h })
2819
2490
  ] }),
2820
- /* @__PURE__ */ a("div", { style: Gn(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 }) })
2821
2492
  ] });
2822
2493
  }
2823
2494
  ), W = 8;
2824
- function pt(s, e) {
2495
+ function at(r, e) {
2825
2496
  return `
2826
2497
  linear-gradient(45deg, ${e} 25%, transparent 25%),
2827
2498
  linear-gradient(-45deg, ${e} 25%, transparent 25%),
@@ -2829,13 +2500,13 @@ function pt(s, e) {
2829
2500
  linear-gradient(-45deg, transparent 75%, ${e} 75%)
2830
2501
  `;
2831
2502
  }
2832
- const jn = {
2503
+ const Er = {
2833
2504
  backgroundColor: "#ffffff",
2834
- backgroundImage: pt("#ffffff", "#e5e5e5")
2835
- }, Un = {
2505
+ backgroundImage: at("#ffffff", "#e5e5e5")
2506
+ }, Br = {
2836
2507
  backgroundColor: "#1e1e1e",
2837
- backgroundImage: pt("#1e1e1e", "#2d2d2d")
2838
- }, Pn = {
2508
+ backgroundImage: at("#1e1e1e", "#2d2d2d")
2509
+ }, Ar = {
2839
2510
  display: "inline-block",
2840
2511
  padding: "12px",
2841
2512
  borderRadius: "4px",
@@ -2843,15 +2514,15 @@ const jn = {
2843
2514
  backgroundPosition: `0 0, 0 ${W}px, ${W}px -${W}px, -${W}px 0`,
2844
2515
  boxShadow: "0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.08)"
2845
2516
  };
2846
- function Gn(s) {
2847
- const e = s === "dark" ? Un : jn;
2517
+ function zr(r) {
2518
+ const e = r === "dark" ? Br : Er;
2848
2519
  return {
2849
- ...Pn,
2520
+ ...Ar,
2850
2521
  backgroundColor: e.backgroundColor,
2851
2522
  backgroundImage: e.backgroundImage
2852
2523
  };
2853
2524
  }
2854
- const q = {
2525
+ const G = {
2855
2526
  wrapper: {
2856
2527
  marginBottom: "32px"
2857
2528
  },
@@ -2880,16 +2551,16 @@ const q = {
2880
2551
  fontFamily: "var(--vscode-editor-font-family, monospace)"
2881
2552
  }
2882
2553
  };
2883
- class Wn extends M({
2884
- fixtureId: f.const(),
2885
- sessionName: f.const(),
2886
- daemon: f.const()
2554
+ class $r extends F({
2555
+ fixtureId: u.const(),
2556
+ sessionName: u.const(),
2557
+ daemon: u.const()
2887
2558
  }) {
2888
2559
  constructor(t) {
2889
2560
  super(t);
2890
- l(this, "screenshot", y(this, { status: "idle" }));
2561
+ l(this, "screenshot", x(this, { status: "idle" }));
2891
2562
  l(this, "_fetchVersion", 0);
2892
- this._store.add(st((n) => {
2563
+ this._store.add(Ye((n) => {
2893
2564
  this.props.daemon.sourceTreeIds.read(n).get(this.props.sessionName) && this._fetchScreenshot();
2894
2565
  }));
2895
2566
  }
@@ -2907,26 +2578,26 @@ class Wn extends M({
2907
2578
  }
2908
2579
  }
2909
2580
  }
2910
- const je = B(
2911
- Wn,
2581
+ const Be = E(
2582
+ $r,
2912
2583
  {},
2913
- (s, e) => {
2914
- const t = e.screenshot.read(s);
2584
+ (r, e) => {
2585
+ const t = e.screenshot.read(r);
2915
2586
  if (t.status === "idle" || t.status === "loading")
2916
- return /* @__PURE__ */ a("div", { style: $.placeholder, children: /* @__PURE__ */ a("div", { style: $.shimmer }) });
2587
+ return /* @__PURE__ */ a("div", { style: z.placeholder, children: /* @__PURE__ */ a("div", { style: z.shimmer }) });
2917
2588
  if (t.status === "error")
2918
- return /* @__PURE__ */ a("div", { style: $.error, children: /* @__PURE__ */ a("span", { style: $.errorText, children: "Screenshot failed" }) });
2589
+ return /* @__PURE__ */ a("div", { style: z.error, children: /* @__PURE__ */ a("span", { style: z.errorText, children: "Screenshot failed" }) });
2919
2590
  const { data: n } = t;
2920
2591
  return n.image ? /* @__PURE__ */ a(
2921
2592
  "img",
2922
2593
  {
2923
2594
  src: `data:image/png;base64,${n.image}`,
2924
- style: $.image,
2595
+ style: z.image,
2925
2596
  alt: `Screenshot of ${e.fixtureId}`
2926
2597
  }
2927
- ) : /* @__PURE__ */ a("div", { style: $.placeholder, children: /* @__PURE__ */ a("span", { style: $.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) }) });
2928
2599
  }
2929
- ), $ = {
2600
+ ), z = {
2930
2601
  placeholder: {
2931
2602
  minHeight: 80,
2932
2603
  display: "flex",
@@ -2969,18 +2640,18 @@ const je = B(
2969
2640
  border: "1px solid var(--vscode-panel-border)"
2970
2641
  }
2971
2642
  };
2972
- class qn extends M({
2973
- fixtureId: f.const(),
2974
- daemon: f.const(),
2975
- baselineSession: f.const(),
2976
- currentSession: f.const()
2643
+ class Lr extends F({
2644
+ fixtureId: u.const(),
2645
+ daemon: u.const(),
2646
+ baselineSession: u.const(),
2647
+ currentSession: u.const()
2977
2648
  }) {
2978
2649
  constructor(t) {
2979
2650
  super(t);
2980
- l(this, "comparisonStatus", y(this, { status: "loading" }));
2981
- this._store.add(st((n) => {
2982
- const r = this.props.daemon.sourceTreeIds.read(n), i = r.get(this.props.baselineSession), o = r.get(this.props.currentSession);
2983
- i && o && this._fetchComparison();
2651
+ l(this, "comparisonStatus", x(this, { status: "loading" }));
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();
2984
2655
  }));
2985
2656
  }
2986
2657
  get fixtureId() {
@@ -3009,21 +2680,21 @@ class qn extends M({
3009
2680
  }
3010
2681
  }
3011
2682
  }
3012
- const Kn = B(
3013
- qn,
2683
+ const Hr = E(
2684
+ Lr,
3014
2685
  {},
3015
- (s, e) => {
3016
- const t = e.comparisonStatus.read(s), n = t.status === "loading" ? /* @__PURE__ */ a("span", { style: x.badgeLoading, children: "comparing..." }) : t.status === "error" ? /* @__PURE__ */ a("span", { style: x.badgeError, children: "error" }) : t.match ? /* @__PURE__ */ a("span", { style: x.badgeMatch, children: "✓ match" }) : /* @__PURE__ */ a("span", { style: x.badgeChanged, children: "● changed" });
3017
- return /* @__PURE__ */ g("div", { style: x.fixtureRow, children: [
3018
- /* @__PURE__ */ g("div", { style: x.fixtureLabel, children: [
3019
- /* @__PURE__ */ a("span", { style: x.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 }),
3020
2691
  n
3021
2692
  ] }),
3022
- /* @__PURE__ */ g("div", { style: x.sideBySide, children: [
3023
- /* @__PURE__ */ g("div", { style: x.screenshotColumn, children: [
3024
- /* @__PURE__ */ a("span", { style: x.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" }),
3025
2696
  /* @__PURE__ */ a(
3026
- je,
2697
+ Be,
3027
2698
  {
3028
2699
  fixtureId: e.fixtureId,
3029
2700
  sessionName: e.currentSession,
@@ -3031,10 +2702,10 @@ const Kn = B(
3031
2702
  }
3032
2703
  )
3033
2704
  ] }),
3034
- /* @__PURE__ */ g("div", { style: x.screenshotColumn, children: [
3035
- /* @__PURE__ */ a("span", { style: x.columnLabel, children: "Baseline" }),
2705
+ /* @__PURE__ */ f("div", { style: w.screenshotColumn, children: [
2706
+ /* @__PURE__ */ a("span", { style: w.columnLabel, children: "Baseline" }),
3036
2707
  /* @__PURE__ */ a(
3037
- je,
2708
+ Be,
3038
2709
  {
3039
2710
  fixtureId: e.fixtureId,
3040
2711
  sessionName: e.baselineSession,
@@ -3045,19 +2716,19 @@ const Kn = B(
3045
2716
  ] })
3046
2717
  ] });
3047
2718
  }
3048
- ), Jn = D(
2719
+ ), jr = I(
3049
2720
  {
3050
- name: f.const(),
3051
- path: f.const(),
3052
- items: f.const(),
3053
- daemon: f.const(),
3054
- baselineSession: f.const(),
3055
- currentSession: f.const()
3056
- },
3057
- (s, e) => /* @__PURE__ */ g("div", { children: [
3058
- /* @__PURE__ */ a("div", { style: x.groupHeader, children: /* @__PURE__ */ a("span", { style: x.groupTitle, children: e.path }) }),
3059
- /* @__PURE__ */ a("div", { style: x.groupContent, children: e.items.map((t) => /* @__PURE__ */ a(
3060
- Kn,
2721
+ name: u.const(),
2722
+ path: u.const(),
2723
+ items: u.const(),
2724
+ daemon: u.const(),
2725
+ baselineSession: u.const(),
2726
+ currentSession: u.const()
2727
+ },
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,
3061
2732
  {
3062
2733
  fixtureId: t.fixtureId,
3063
2734
  daemon: e.daemon,
@@ -3067,7 +2738,7 @@ const Kn = B(
3067
2738
  t.fixtureId
3068
2739
  )) })
3069
2740
  ] })
3070
- ), x = {
2741
+ ), w = {
3071
2742
  groupHeader: {
3072
2743
  marginBottom: 12
3073
2744
  },
@@ -3135,107 +2806,273 @@ const Kn = B(
3135
2806
  color: "var(--vscode-errorForeground)",
3136
2807
  fontWeight: 500
3137
2808
  }
3138
- }, gt = "component-explorer:fixtureHeights", Ue = 500;
2809
+ }, q = 8;
2810
+ function dt(r, e) {
2811
+ return `
2812
+ linear-gradient(45deg, ${e} 25%, transparent 25%),
2813
+ linear-gradient(-45deg, ${e} 25%, transparent 25%),
2814
+ linear-gradient(45deg, transparent 75%, ${e} 75%),
2815
+ linear-gradient(-45deg, transparent 75%, ${e} 75%)
2816
+ `;
2817
+ }
2818
+ const Ur = {
2819
+ backgroundColor: "#ffffff",
2820
+ backgroundImage: dt("#ffffff", "#e5e5e5")
2821
+ }, Pr = {
2822
+ backgroundColor: "#1e1e1e",
2823
+ backgroundImage: dt("#1e1e1e", "#2d2d2d")
2824
+ }, Wr = {
2825
+ display: "inline-block",
2826
+ padding: "12px",
2827
+ borderRadius: "4px",
2828
+ backgroundSize: `${q * 2}px ${q * 2}px`,
2829
+ backgroundPosition: `0 0, 0 ${q}px, ${q}px -${q}px, -${q}px 0`,
2830
+ boxShadow: "0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.08)"
2831
+ };
2832
+ function Gr(r) {
2833
+ const e = r === "dark" ? Pr : Ur;
2834
+ return {
2835
+ ...Wr,
2836
+ backgroundColor: e.backgroundColor,
2837
+ backgroundImage: e.backgroundImage
2838
+ };
2839
+ }
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 }) });
2842
+ }
2843
+ const qr = I(
2844
+ {
2845
+ item: u.const(),
2846
+ reportModel: u.const()
2847
+ },
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;
2850
+ return /* @__PURE__ */ f("div", { style: y.fixtureRow, children: [
2851
+ /* @__PURE__ */ f("div", { style: y.fixtureLabel, children: [
2852
+ /* @__PURE__ */ a("span", { style: y.fixtureName, children: t.fixtureId }),
2853
+ i
2854
+ ] }),
2855
+ d && /* @__PURE__ */ f("div", { style: y.sideBySide, children: [
2856
+ s.baselineScreenshot && /* @__PURE__ */ f("div", { style: y.screenshotColumn, children: [
2857
+ /* @__PURE__ */ a("span", { style: y.columnLabel, children: "Baseline" }),
2858
+ /* @__PURE__ */ a(
2859
+ Ae,
2860
+ {
2861
+ src: n.resolveScreenshotUrl(s.baselineScreenshot),
2862
+ alt: `Baseline screenshot of ${t.fixtureId}`,
2863
+ background: o
2864
+ }
2865
+ )
2866
+ ] }),
2867
+ s.currentScreenshot && /* @__PURE__ */ f("div", { style: y.screenshotColumn, children: [
2868
+ /* @__PURE__ */ a("span", { style: y.columnLabel, children: "Current" }),
2869
+ /* @__PURE__ */ a(
2870
+ Ae,
2871
+ {
2872
+ src: n.resolveScreenshotUrl(s.currentScreenshot),
2873
+ alt: `Current screenshot of ${t.fixtureId}`,
2874
+ background: o
2875
+ }
2876
+ )
2877
+ ] })
2878
+ ] }),
2879
+ !d && s.status === "unchanged" && /* @__PURE__ */ a("div", { style: y.hashRow, children: /* @__PURE__ */ f("span", { style: y.hashText, children: [
2880
+ "hash: ",
2881
+ s.targetHash
2882
+ ] }) })
2883
+ ] });
2884
+ }
2885
+ ), Kr = I(
2886
+ {
2887
+ name: u.const(),
2888
+ path: u.const(),
2889
+ items: u.const(),
2890
+ reportModel: u.const()
2891
+ },
2892
+ (r, e) => /* @__PURE__ */ f("div", { children: [
2893
+ /* @__PURE__ */ a("div", { style: y.groupHeader, children: /* @__PURE__ */ a("span", { style: y.groupTitle, children: e.path }) }),
2894
+ /* @__PURE__ */ a("div", { style: y.groupContent, children: e.items.map((t) => /* @__PURE__ */ a(
2895
+ qr,
2896
+ {
2897
+ item: t,
2898
+ reportModel: e.reportModel
2899
+ },
2900
+ t.fixtureId
2901
+ )) })
2902
+ ] })
2903
+ ), y = {
2904
+ groupHeader: {
2905
+ marginBottom: 12
2906
+ },
2907
+ groupTitle: {
2908
+ fontSize: 13,
2909
+ fontWeight: 500,
2910
+ color: "var(--vscode-foreground)"
2911
+ },
2912
+ groupContent: {
2913
+ display: "flex",
2914
+ flexDirection: "column",
2915
+ gap: 24
2916
+ },
2917
+ fixtureRow: {
2918
+ display: "flex",
2919
+ flexDirection: "column",
2920
+ gap: 8
2921
+ },
2922
+ fixtureLabel: {
2923
+ display: "flex",
2924
+ alignItems: "center",
2925
+ gap: 8
2926
+ },
2927
+ fixtureName: {
2928
+ fontSize: 12,
2929
+ fontWeight: 500,
2930
+ color: "var(--vscode-foreground)"
2931
+ },
2932
+ sideBySide: {
2933
+ display: "flex",
2934
+ flexDirection: "row",
2935
+ gap: 16
2936
+ },
2937
+ screenshotColumn: {
2938
+ display: "flex",
2939
+ flexDirection: "column",
2940
+ gap: 4
2941
+ },
2942
+ columnLabel: {
2943
+ fontSize: 11,
2944
+ fontWeight: 500,
2945
+ color: "var(--vscode-descriptionForeground)",
2946
+ textTransform: "uppercase",
2947
+ letterSpacing: "0.05em"
2948
+ },
2949
+ image: {
2950
+ display: "block"
2951
+ },
2952
+ hashRow: {
2953
+ padding: "8px 0"
2954
+ },
2955
+ hashText: {
2956
+ fontSize: 11,
2957
+ color: "var(--vscode-descriptionForeground)",
2958
+ fontFamily: "monospace"
2959
+ },
2960
+ badgeMatch: {
2961
+ fontSize: 11,
2962
+ color: "var(--vscode-testing-iconPassed)",
2963
+ fontWeight: 500
2964
+ },
2965
+ badgeChanged: {
2966
+ fontSize: 11,
2967
+ color: "var(--vscode-testing-iconFailed)",
2968
+ fontWeight: 500
2969
+ },
2970
+ badgeAdded: {
2971
+ fontSize: 11,
2972
+ color: "var(--vscode-testing-iconQueued)",
2973
+ fontWeight: 500
2974
+ }
2975
+ }, ct = "component-explorer:fixtureHeights", ze = 500;
3139
2976
  let V = null;
3140
- function mt() {
2977
+ function lt() {
3141
2978
  if (V !== null) return V;
3142
2979
  try {
3143
- const s = localStorage.getItem(gt);
3144
- if (s)
3145
- return V = JSON.parse(s), V;
2980
+ const r = localStorage.getItem(ct);
2981
+ if (r)
2982
+ return V = JSON.parse(r), V;
3146
2983
  } catch {
3147
2984
  }
3148
2985
  return V = {}, V;
3149
2986
  }
3150
- function Zn() {
2987
+ function Jr() {
3151
2988
  if (V !== null)
3152
2989
  try {
3153
- const s = Object.entries(V);
3154
- s.length > Ue && (V = Object.fromEntries(s.slice(-Ue))), localStorage.setItem(gt, JSON.stringify(V));
2990
+ const r = Object.entries(V);
2991
+ r.length > ze && (V = Object.fromEntries(r.slice(-ze))), localStorage.setItem(ct, JSON.stringify(V));
3155
2992
  } catch {
3156
2993
  }
3157
2994
  }
3158
- function Xn(s, e) {
3159
- const t = mt();
3160
- t[s] = e, Zn();
2995
+ function Zr(r, e) {
2996
+ const t = lt();
2997
+ t[r] = e, Jr();
3161
2998
  }
3162
- function Yn() {
3163
- return new Map(Object.entries(mt()));
2999
+ function Xr() {
3000
+ return new Map(Object.entries(lt()));
3164
3001
  }
3165
- const Qn = 280, es = 32, oe = 32, Pe = 400, _t = "component-explorer:scrollAnchors", Ge = 100;
3166
- function vt() {
3002
+ const Yr = 280, Qr = 32, re = 32, $e = 400, ht = "component-explorer:scrollAnchors", Le = 100;
3003
+ function ut() {
3167
3004
  try {
3168
- const s = localStorage.getItem(_t);
3169
- if (s) return JSON.parse(s);
3005
+ const r = localStorage.getItem(ht);
3006
+ if (r) return JSON.parse(r);
3170
3007
  } catch {
3171
3008
  }
3172
3009
  return {};
3173
3010
  }
3174
- function ts(s, e) {
3011
+ function en(r, e) {
3175
3012
  try {
3176
- const t = vt();
3177
- t[s] = e;
3178
- const n = Object.entries(t), r = n.length > Ge ? Object.fromEntries(n.slice(-Ge)) : t;
3179
- 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));
3180
3017
  } catch {
3181
3018
  }
3182
3019
  }
3183
- function ns(s) {
3184
- return vt()[s];
3020
+ function tn(r) {
3021
+ return ut()[r];
3185
3022
  }
3186
- function bt(s) {
3187
- return s.type === "single" ? s.fixture.id : s.id;
3023
+ function ft(r) {
3024
+ return r.type === "single" ? r.fixture.id : r.id;
3188
3025
  }
3189
- function ss(s, e) {
3190
- const t = new Array(s.length);
3191
- let n = oe;
3192
- for (let r = 0; r < s.length; r++) {
3193
- const i = e.get(bt(s[r])) ?? Qn;
3194
- t[r] = { top: n, height: i }, n += i + es;
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;
3195
3032
  }
3196
3033
  return t;
3197
3034
  }
3198
- function rs(s) {
3199
- if (s.length === 0) return 0;
3200
- const e = s[s.length - 1];
3201
- return e.top + e.height + oe;
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;
3202
3039
  }
3203
- function yt(s, e) {
3204
- let t = 0, n = s.length;
3040
+ function pt(r, e) {
3041
+ let t = 0, n = r.length;
3205
3042
  for (; t < n; ) {
3206
- const r = t + n >> 1;
3207
- 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;
3208
3045
  }
3209
3046
  return t;
3210
3047
  }
3211
- function is(s, e, t) {
3212
- if (s.length === 0) return { start: 0, end: 0 };
3213
- const n = yt(s, e - Pe);
3214
- let r = n;
3215
- const i = e + t + Pe;
3216
- for (; r < s.length && s[r].top < i; )
3217
- r++;
3218
- return { start: n, end: r };
3219
- }
3220
- function We(s, e) {
3221
- if (s.length === 0) return;
3222
- const t = yt(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);
3223
3060
  return {
3224
3061
  rowIndex: n,
3225
- offsetFromViewport: s[n].top - e
3062
+ offsetFromViewport: r[n].top - e
3226
3063
  };
3227
3064
  }
3228
- function qe(s, e) {
3229
- 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;
3230
3067
  }
3231
- class os extends M({
3232
- model: f.const()
3068
+ class on extends F({
3069
+ model: u.const()
3233
3070
  }) {
3234
3071
  constructor() {
3235
3072
  super(...arguments);
3236
- l(this, "_rowHeights", y(this, Yn()));
3237
- l(this, "_scrollTop", y(this, 0));
3238
- l(this, "_viewportHeight", y(this, 0));
3073
+ l(this, "_rowHeights", x(this, Xr()));
3074
+ l(this, "_scrollTop", x(this, 0));
3075
+ l(this, "_viewportHeight", x(this, 0));
3239
3076
  l(this, "_scrollContainerRef", null);
3240
3077
  l(this, "_resizeObserver", null);
3241
3078
  l(this, "_viewportResizeObserver", null);
@@ -3243,41 +3080,41 @@ class os extends M({
3243
3080
  l(this, "_scrollSaveTimeout", null);
3244
3081
  l(this, "_suppressScrollHandler", !1);
3245
3082
  l(this, "layout", N(this, (t) => {
3246
- const n = this.explorerModel.selectedFixtures.read(t), r = this._rowHeights.read(t);
3247
- return ss(n, r);
3083
+ const n = this.explorerModel.selectedFixtures.read(t), s = this._rowHeights.read(t);
3084
+ return rn(n, s);
3248
3085
  }));
3249
3086
  l(this, "visibleRowRange", N(this, (t) => {
3250
- const n = this.layout.read(t), r = this._scrollTop.read(t), i = this._viewportHeight.read(t);
3251
- return is(n, r, i);
3087
+ const n = this.layout.read(t), s = this._scrollTop.read(t), o = this._viewportHeight.read(t);
3088
+ return sn(n, s, o);
3252
3089
  }));
3253
3090
  l(this, "setScrollContainerRef", (t) => {
3254
3091
  var n;
3255
- 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]) => {
3256
- 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);
3257
3094
  }), this._viewportResizeObserver.observe(t), this._restoreScrollPosition());
3258
3095
  });
3259
3096
  l(this, "_handleScroll", () => {
3260
3097
  this._scrollContainerRef && (this._scrollTop.set(this._scrollContainerRef.scrollTop, void 0), !(this._suppressScrollHandler || !this._currentNodeId) && (this._scrollSaveTimeout && clearTimeout(this._scrollSaveTimeout), this._scrollSaveTimeout = setTimeout(() => {
3261
3098
  if (!this._currentNodeId) return;
3262
- const t = this.layout.get(), n = We(t, this._scrollTop.get());
3263
- n && ts(this._currentNodeId, n);
3099
+ const t = this.layout.get(), n = He(t, this._scrollTop.get());
3100
+ n && en(this._currentNodeId, n);
3264
3101
  }, 150)));
3265
3102
  });
3266
3103
  l(this, "observeRowElement", (t, n) => {
3267
- t && (this._resizeObserver || (this._resizeObserver = new ResizeObserver((r) => {
3268
- const i = this._rowHeights.get();
3269
- let o;
3270
- 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) {
3271
3108
  const c = d.target.getAttribute("data-row-id");
3272
3109
  if (!c) continue;
3273
3110
  const h = Math.round(d.contentRect.height);
3274
- h > 0 && i.get(c) !== h && (o || (o = new Map(i)), o.set(c, h), Xn(c, h));
3111
+ h > 0 && o.get(c) !== h && (i || (i = new Map(o)), i.set(c, h), Zr(c, h));
3275
3112
  }
3276
- if (o) {
3277
- const d = this.layout.get(), c = We(d, this._scrollTop.get());
3278
- if (this._rowHeights.set(o, void 0), c && this._scrollContainerRef) {
3279
- const h = this.layout.get(), m = qe(h, c);
3280
- 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(() => {
3281
3118
  this._suppressScrollHandler = !1;
3282
3119
  });
3283
3120
  }
@@ -3293,10 +3130,10 @@ class os extends M({
3293
3130
  }
3294
3131
  _restoreScrollPosition() {
3295
3132
  if (!this._scrollContainerRef || !this._currentNodeId) return;
3296
- const t = ns(this._currentNodeId);
3133
+ const t = tn(this._currentNodeId);
3297
3134
  if (!t) return;
3298
- const n = this.layout.get(), r = qe(n, t);
3299
- 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(() => {
3300
3137
  this._suppressScrollHandler = !1;
3301
3138
  });
3302
3139
  }
@@ -3305,23 +3142,35 @@ class os extends M({
3305
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);
3306
3143
  }
3307
3144
  }
3308
- const as = B(
3309
- os,
3145
+ const an = E(
3146
+ on,
3310
3147
  {},
3311
- (s, e) => {
3312
- 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);
3313
- if (e.updateForSelection(n), t.length === 0)
3314
- return /* @__PURE__ */ a("div", { style: Z.emptyState, children: /* @__PURE__ */ a("span", { style: Z.emptyText, children: "Select a component or folder to preview" }) });
3315
- const d = rs(r);
3316
- return /* @__PURE__ */ a("div", { ref: e.setScrollContainerRef, style: Z.scrollContainer, children: /* @__PURE__ */ a("div", { style: { position: "relative", height: d }, children: t.slice(i, o).map((c, h) => {
3317
- const m = i + h, { top: v } = r[m], p = bt(c);
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);
3150
+ if (e.updateForSelection(n), t.length === 0) {
3151
+ const c = e.explorerModel.reportModel;
3152
+ if (c) {
3153
+ const h = c.state.read(r);
3154
+ if (h.status === "loading")
3155
+ return /* @__PURE__ */ a("div", { style: k.emptyState, children: /* @__PURE__ */ a("span", { style: k.emptyText, children: "Loading report..." }) });
3156
+ if (h.status === "error")
3157
+ return /* @__PURE__ */ a("div", { style: k.emptyState, children: /* @__PURE__ */ f("span", { style: { ...k.emptyText, color: "var(--vscode-errorForeground)" }, children: [
3158
+ "Failed to load report: ",
3159
+ h.message
3160
+ ] }) });
3161
+ }
3162
+ return /* @__PURE__ */ a("div", { style: k.emptyState, children: /* @__PURE__ */ a("span", { style: k.emptyText, children: "Select a component or folder to preview" }) });
3163
+ }
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);
3318
3167
  return /* @__PURE__ */ a(
3319
3168
  "div",
3320
3169
  {
3321
- ref: (_) => e.observeRowElement(_, p),
3322
- style: { position: "absolute", top: v, left: oe, right: oe },
3323
- children: c.type === "single" ? /* @__PURE__ */ a(ft, { fixture: c.fixture, compact: !1 }) : c.type === "variants" ? /* @__PURE__ */ a(ds, { row: c }) : c.type === "screenshot-comparison" && e.explorerModel.daemon ? /* @__PURE__ */ a(
3324
- Jn,
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,
3325
3174
  {
3326
3175
  name: c.name,
3327
3176
  path: c.path,
@@ -3330,22 +3179,30 @@ const as = B(
3330
3179
  baselineSession: "baseline",
3331
3180
  currentSession: "current"
3332
3181
  }
3182
+ ) : c.type === "report-comparison" && e.explorerModel.reportModel ? /* @__PURE__ */ a(
3183
+ Kr,
3184
+ {
3185
+ name: c.name,
3186
+ path: c.path,
3187
+ items: c.items,
3188
+ reportModel: e.explorerModel.reportModel
3189
+ }
3333
3190
  ) : null
3334
3191
  },
3335
- p
3192
+ C
3336
3193
  );
3337
3194
  }) }) });
3338
3195
  }
3339
- ), ds = D(
3340
- { row: f.const() },
3341
- (s, e) => {
3196
+ ), dn = I(
3197
+ { row: u.const() },
3198
+ (r, e) => {
3342
3199
  const t = e.row;
3343
- return /* @__PURE__ */ g("div", { children: [
3344
- /* @__PURE__ */ a("div", { style: Z.variantsHeader, children: /* @__PURE__ */ a("span", { style: Z.variantsTitle, children: t.path }) }),
3345
- /* @__PURE__ */ a("div", { style: Z.variantsContent, children: t.fixtures.map((n) => /* @__PURE__ */ a(ft, { fixture: n, compact: !0 }, n.id)) })
3200
+ return /* @__PURE__ */ f("div", { children: [
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)) })
3346
3203
  ] });
3347
3204
  }
3348
- ), Z = {
3205
+ ), k = {
3349
3206
  scrollContainer: {
3350
3207
  flex: 1,
3351
3208
  overflow: "auto",
@@ -3376,100 +3233,58 @@ const as = B(
3376
3233
  flexWrap: "wrap",
3377
3234
  gap: "16px"
3378
3235
  }
3379
- }, xt = B(
3380
- Cn,
3381
- { daemonModel: f.const() },
3382
- (s, e) => {
3383
- const t = e.leftSidebarVisible.read(s), n = e.rightSidebarVisible.read(s), r = e.isDarkTheme.read(s), i = e.selectedNode.read(s);
3384
- return /* @__PURE__ */ g("div", { className: r ? "vscode-theme default-dark-plus" : "vscode-theme default-light-plus", style: u.container, children: [
3385
- t && /* @__PURE__ */ a(Mn, { model: e }),
3386
- /* @__PURE__ */ g("div", { style: u.centerArea, children: [
3387
- /* @__PURE__ */ a(En, { model: e }),
3388
- /* @__PURE__ */ a(as, { model: e })
3236
+ }, cn = E(
3237
+ gr,
3238
+ { daemonModel: u.const(), reportModel: u.const() },
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 }),
3243
+ /* @__PURE__ */ f("div", { style: p.centerArea, children: [
3244
+ /* @__PURE__ */ a(Tr, { model: e }),
3245
+ /* @__PURE__ */ a(an, { model: e })
3389
3246
  ] }),
3390
- n && /* @__PURE__ */ a(Ln, { selectedNode: i })
3247
+ n && /* @__PURE__ */ a(Mr, { selectedNode: o })
3391
3248
  ] });
3392
3249
  }
3393
3250
  );
3394
- function cs() {
3395
- const s = new lt();
3396
- return s.register("components/Button.fixture.tsx", ae({
3397
- Primary: L({
3398
- render: (e) => (e.innerHTML = "<button>Primary Button</button>", { dispose: () => {
3399
- e.innerHTML = "";
3400
- } })
3401
- }),
3402
- Icon: L({
3403
- render: (e) => (e.innerHTML = "<button>🔔 Icon Button</button>", { dispose: () => {
3404
- e.innerHTML = "";
3405
- } })
3406
- })
3407
- })), s.register("components/Input.fixture.tsx", ae({
3408
- Text: L({
3409
- render: (e) => (e.innerHTML = '<input type="text" placeholder="Text Input" />', { dispose: () => {
3410
- e.innerHTML = "";
3411
- } })
3412
- }),
3413
- Search: L({
3414
- render: (e) => (e.innerHTML = '<input type="search" placeholder="Search..." />', { dispose: () => {
3415
- e.innerHTML = "";
3416
- } })
3417
- })
3418
- })), s.register("components/Card.fixture.tsx", L({
3419
- render: (e) => (e.innerHTML = '<div style="border: 1px solid #ccc; padding: 16px;">Basic Card</div>', { dispose: () => {
3420
- e.innerHTML = "";
3421
- } })
3422
- })), s.register("components/Feedback.fixture.tsx", ae({
3423
- Badge: L({
3424
- render: (e) => (e.innerHTML = '<span style="background: blue; color: white; padding: 2px 8px; border-radius: 4px;">Badge</span>', { dispose: () => {
3425
- e.innerHTML = "";
3426
- } })
3427
- }),
3428
- Alert: L({
3429
- render: (e) => (e.innerHTML = '<div style="background: #ffffcc; padding: 8px; border: 1px solid #cc0;">Alert message</div>', { dispose: () => {
3430
- e.innerHTML = "";
3431
- } })
3432
- })
3433
- })), s;
3434
- }
3435
- function Rs() {
3436
- const s = cs();
3437
- return /* @__PURE__ */ a(xt, { registry: s, daemonModel: void 0 });
3438
- }
3439
- var ls = class be {
3251
+ var ln = class fe {
3440
3252
  constructor(e) {
3441
3253
  this.iterator = e;
3442
3254
  }
3443
3255
  static fromIterable(e) {
3444
- return new be(e[Symbol.asyncIterator]());
3256
+ return new fe(e[Symbol.asyncIterator]());
3445
3257
  }
3446
3258
  static fromFn(e) {
3447
- return new be(e());
3259
+ return new fe(e());
3448
3260
  }
3449
3261
  [Symbol.asyncIterator]() {
3450
3262
  return this.iterator;
3451
3263
  }
3452
- }, hs = class extends Error {
3453
- constructor(s, e, t) {
3454
- 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";
3455
3267
  }
3456
- }, us = class {
3457
- constructor(s) {
3268
+ }, un = class {
3269
+ constructor(r) {
3458
3270
  l(this, "methods", this._createProxy(""));
3459
- this._request = s;
3271
+ this._request = r;
3460
3272
  }
3461
- _createProxy(s) {
3273
+ _createProxy(r) {
3462
3274
  return new Proxy(() => {
3463
3275
  }, {
3464
- apply: async (e, t, n) => await this._request(s, n[0]),
3465
- 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
+ }
3466
3281
  });
3467
3282
  }
3468
3283
  };
3469
- function fs(s, e) {
3470
- return new us(async (t, n) => {
3284
+ function fn(r, e) {
3285
+ return new un(async (t, n) => {
3471
3286
  var d;
3472
- const r = await fetch(`${s}/${t}`, {
3287
+ const s = await fetch(`${r}/${t}`, {
3473
3288
  method: "POST",
3474
3289
  headers: {
3475
3290
  "Content-Type": "application/json",
@@ -3477,40 +3292,40 @@ function fs(s, e) {
3477
3292
  },
3478
3293
  body: JSON.stringify(n)
3479
3294
  });
3480
- if (r.status !== 200) {
3481
- const c = await r.json().catch(() => null);
3295
+ if (s.status !== 200) {
3296
+ const c = await s.json().catch(() => null);
3482
3297
  let h;
3483
- 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 hs(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);
3484
3299
  }
3485
- const i = r.headers.get("Content-Type");
3486
- return i != null && i.startsWith("application/jsonl") ? ls.fromFn(async function* () {
3487
- var p;
3488
- const c = (p = r.body) == null ? void 0 : p.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();
3489
3304
  if (!c)
3490
3305
  return;
3491
3306
  let h = "";
3492
- const m = new TextDecoder("utf-8");
3307
+ const g = new TextDecoder("utf-8");
3493
3308
  for (; ; ) {
3494
- const { done: _, value: E } = await c.read();
3495
- if (_)
3309
+ const { done: m, value: v } = await c.read();
3310
+ if (m)
3496
3311
  break;
3497
- h += m.decode(E, { stream: !0 });
3498
- let R;
3499
- for (; (R = h.indexOf(`
3312
+ h += g.decode(v, { stream: !0 });
3313
+ let O;
3314
+ for (; (O = h.indexOf(`
3500
3315
  `)) >= 0; ) {
3501
- const C = h.slice(0, R).trim();
3502
- h = h.slice(R + 1), C.length > 0 && (yield JSON.parse(C));
3316
+ const S = h.slice(0, O).trim();
3317
+ h = h.slice(O + 1), S.length > 0 && (yield JSON.parse(S));
3503
3318
  }
3504
3319
  }
3505
- const v = h.trim();
3506
- v.length > 0 && (yield JSON.parse(v));
3507
- }) : await r.json();
3320
+ const _ = h.trim();
3321
+ _.length > 0 && (yield JSON.parse(_));
3322
+ }) : await s.json();
3508
3323
  });
3509
3324
  }
3510
- class ps {
3325
+ class pn {
3511
3326
  constructor(e) {
3512
- l(this, "_sourceTreeIds", y(this, /* @__PURE__ */ new Map()));
3513
- l(this, "_sessions", y(this, []));
3327
+ l(this, "_sourceTreeIds", x(this, /* @__PURE__ */ new Map()));
3328
+ l(this, "_sessions", x(this, []));
3514
3329
  l(this, "_screenshotCache", /* @__PURE__ */ new Map());
3515
3330
  l(this, "_client");
3516
3331
  l(this, "_eventStreamAbort", null);
@@ -3519,7 +3334,7 @@ class ps {
3519
3334
  l(this, "sourceTreeIds", this._sourceTreeIds);
3520
3335
  /** Observable list of sessions from the daemon */
3521
3336
  l(this, "sessions", this._sessions);
3522
- this.config = e, this.sessionName = e.sessionName, this._client = fs("/__explorer/daemon-api");
3337
+ this.config = e, this.sessionName = e.sessionName, this._client = fn("/__explorer/daemon-api");
3523
3338
  }
3524
3339
  /**
3525
3340
  * Initializes the model: fetches initial session info and starts listening to events.
@@ -3536,30 +3351,30 @@ class ps {
3536
3351
  const n = this._sourceTreeIds.get().get(e);
3537
3352
  if (!n)
3538
3353
  throw new Error(`No sourceTreeId known for session '${e}'`);
3539
- const r = `${e}:${t}`, i = this._screenshotCache.get(r);
3540
- if (i && i.sourceTreeId === n)
3541
- return i.data;
3542
- 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({
3543
3358
  fixtureId: t,
3544
3359
  sessionName: e,
3545
3360
  sourceTreeId: n,
3546
3361
  includeImage: !0
3547
3362
  });
3548
- return this._screenshotCache.set(r, { sourceTreeId: n, data: o }), o;
3363
+ return this._screenshotCache.set(s, { sourceTreeId: n, data: i }), i;
3549
3364
  }
3550
3365
  /**
3551
3366
  * Compare a fixture across two sessions. Returns match status and hashes (no images).
3552
3367
  */
3553
3368
  async compare(e, t, n) {
3554
- const r = this._sourceTreeIds.get().get(t), i = this._sourceTreeIds.get().get(n);
3555
- if (!r || !i)
3369
+ const s = this._sourceTreeIds.get().get(t), o = this._sourceTreeIds.get().get(n);
3370
+ if (!s || !o)
3556
3371
  throw new Error("Missing sourceTreeId for sessions");
3557
3372
  return this._client.methods.screenshots.compare({
3558
3373
  fixtureId: e,
3559
3374
  baselineSessionName: t,
3560
- baselineSourceTreeId: r,
3375
+ baselineSourceTreeId: s,
3561
3376
  currentSessionName: n,
3562
- currentSourceTreeId: i,
3377
+ currentSourceTreeId: o,
3563
3378
  includeImages: !1
3564
3379
  });
3565
3380
  }
@@ -3589,8 +3404,8 @@ class ps {
3589
3404
  // ---------------------------------------------------------------------------
3590
3405
  async _fetchSessionInfos() {
3591
3406
  const e = await this._client.methods.sessions(), t = /* @__PURE__ */ new Map(), n = [];
3592
- for (const r of e)
3593
- 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 });
3594
3409
  this._sourceTreeIds.set(t, void 0), this._sessions.set(n, void 0);
3595
3410
  }
3596
3411
  async _startEventStream() {
@@ -3617,21 +3432,81 @@ class ps {
3617
3432
  }
3618
3433
  }
3619
3434
  }
3620
- function gs() {
3435
+ function gn() {
3621
3436
  return window.__EXPLORER_DAEMON__;
3622
3437
  }
3623
- class Vs {
3438
+ class mn {
3439
+ constructor(e) {
3440
+ l(this, "state", x(this, { status: "loading" }));
3441
+ l(this, "_baseUrl");
3442
+ this.reportUrl = e;
3443
+ const t = e.lastIndexOf("/");
3444
+ this._baseUrl = t >= 0 ? e.slice(0, t + 1) : "", this._fetch();
3445
+ }
3446
+ resolveScreenshotUrl(e) {
3447
+ return this._baseUrl + e;
3448
+ }
3449
+ buildTree(e) {
3450
+ const t = this.state.read(e);
3451
+ return t.status !== "ready" ? { id: "", name: "Report", type: "folder", children: [] } : vn(t.report.fixtures);
3452
+ }
3453
+ async _fetch() {
3454
+ this.state.set({ status: "loading" }, void 0);
3455
+ try {
3456
+ const e = await fetch(this.reportUrl);
3457
+ if (!e.ok)
3458
+ throw new Error(`HTTP ${e.status}: ${e.statusText}`);
3459
+ const t = await e.json();
3460
+ this.state.set({ status: "ready", report: t }, void 0);
3461
+ } catch (e) {
3462
+ this.state.set({ status: "error", message: String(e) }, void 0);
3463
+ }
3464
+ }
3465
+ }
3466
+ function vn(r) {
3467
+ const e = { id: "", name: "Components", type: "folder", children: [] };
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("/");
3473
+ if (c)
3474
+ o.children.push({
3475
+ id: h,
3476
+ name: d,
3477
+ type: "component",
3478
+ reportEntry: n
3479
+ });
3480
+ else {
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;
3483
+ }
3484
+ }
3485
+ }
3486
+ return e;
3487
+ }
3488
+ class Vn {
3624
3489
  constructor(e, t) {
3625
3490
  l(this, "_root");
3626
- l(this, "_registry", new lt());
3491
+ l(this, "_registry", new sr());
3627
3492
  l(this, "_daemonModel");
3628
- this._populateRegistry(t), this._daemonModel = this._initializeDaemonModel(), this._root = It(e), this._root.render(Vt(xt, { registry: this._registry, daemonModel: this._daemonModel }));
3493
+ l(this, "_reportModel");
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, {
3495
+ registry: this._registry,
3496
+ daemonModel: this._daemonModel,
3497
+ reportModel: this._reportModel
3498
+ }));
3499
+ }
3500
+ _initializeReportModel() {
3501
+ const t = new URLSearchParams(location.search).get("report");
3502
+ if (t)
3503
+ return new mn(t);
3629
3504
  }
3630
3505
  _initializeDaemonModel() {
3631
- const e = gs();
3506
+ const e = gn();
3632
3507
  if (!e)
3633
3508
  return;
3634
- const t = new ps(e);
3509
+ const t = new pn(e);
3635
3510
  return t.initialize().catch((n) => {
3636
3511
  console.error("[ExplorerApp] Failed to initialize DaemonModel:", n);
3637
3512
  }), t;
@@ -3639,8 +3514,8 @@ class Vs {
3639
3514
  _populateRegistry(e) {
3640
3515
  this._registry.clear();
3641
3516
  for (const [t, n] of Object.entries(e)) {
3642
- const r = n.default;
3643
- r && typeof r == "object" && this._registry.register(t, r);
3517
+ const s = n.default;
3518
+ s && typeof s == "object" && this._registry.register(t, s);
3644
3519
  }
3645
3520
  }
3646
3521
  /**
@@ -3664,50 +3539,52 @@ class Vs {
3664
3539
  }
3665
3540
  }
3666
3541
  export {
3667
- In as ChevronDownIcon,
3668
- Sn as ChevronRightIcon,
3669
- Ts as CliRuntime,
3670
- On as ComponentIcon,
3671
- ps as DaemonModel,
3672
- xt as Explorer,
3673
- Vs as ExplorerApp,
3674
- Cn as ExplorerModel,
3675
- Rs as ExplorerWithDefaults,
3676
- lt as FixtureRegistry,
3677
- Tn as FolderIcon,
3678
- Mn as LeftSidebar,
3679
- Nn as MoonIcon,
3680
- Rn as PanelLeftIcon,
3681
- Vn as PanelRightIcon,
3682
- Ln as RightSidebar,
3683
- kn as SunIcon,
3684
- En as TitleBar,
3685
- ce as TitleBarButton,
3686
- An as TreeItem,
3687
- ut as TreeView,
3688
- kt as VIEWPORT_SIZES,
3689
- Ft as collectComponents,
3690
- Ee as createComponentDefinition,
3691
- le as createFixtureTree,
3692
- L as defineFixture,
3693
- ae as defineFixtureGroup,
3694
- Ds as defineFixtureVariants,
3695
- Fe as findNodeByPath,
3696
- Ve as fixtureGroupBrand,
3697
- ke as fixtureVariantsBrand,
3698
- Dt as getDefaultPropertyValues,
3699
- Os as isComponentDefinition,
3700
- Ce as isFixtureGroup,
3701
- we as isFixtureVariants,
3702
- xe as isSingleFixture,
3703
- Re as mergeStyles,
3704
- Cs as parseFixtureExport,
3705
- Ss as parseFixtureGroup,
3706
- Is as parseFixtureVariants,
3707
- ws as parseSingleFixture,
3708
- Nt as resolveViewport,
3709
- Ne as singleFixtureBrand,
3710
- u as styles,
3711
- ht as toExplorerTree
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,
3586
+ p as styles,
3587
+ An as syncRender,
3588
+ st as toExplorerTree
3712
3589
  };
3713
3590
  //# sourceMappingURL=viewer.js.map