@capillaryjs/capillary-ui 1.0.0 → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,12 +1,13 @@
1
- var ge = Object.defineProperty;
2
- var we = (e, t, n) => t in e ? ge(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
3
- var l = (e, t, n) => we(e, typeof t != "symbol" ? t + "" : t, n);
4
- const D = "data-cap-structural-styles";
5
- let Se = 1;
6
- class J {
7
- constructor(t = `runtime-${Se++}`) {
8
- l(this, "id");
9
- l(this, "cssFragments", /* @__PURE__ */ new Map());
1
+ var Te = Object.defineProperty;
2
+ var je = (e, t, n) => t in e ? Te(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
3
+ var c = (e, t, n) => je(e, typeof t != "symbol" ? t + "" : t, n);
4
+ import { defaultDiagnosticScope as Pe, Diagnostics as u, diagnosticInfo as Ae, EventBubble as $e } from "@capillaryjs/capillary";
5
+ const G = "data-cap-structural-styles";
6
+ let ke = 1;
7
+ class re {
8
+ constructor(t = `runtime-${ke++}`) {
9
+ c(this, "id");
10
+ c(this, "cssFragments", /* @__PURE__ */ new Map());
10
11
  if (typeof t != "string") throw new TypeError("StyleRegistry id must be a string");
11
12
  this.id = t;
12
13
  }
@@ -20,136 +21,136 @@ class J {
20
21
  if (typeof t != "string") throw new TypeError("Component CSS must be a string");
21
22
  if (typeof n != "string" || n.trim().length === 0)
22
23
  throw new TypeError("Component CSS host must be a non-empty selector");
23
- const r = t.trim();
24
- if (r.length === 0) return this;
25
- if (!r.includes("&")) return this.registerCSS(r);
26
- const i = `host:${r}`, s = this.cssFragments.get(i);
27
- return s == null ? this.cssFragments.set(i, {
24
+ const i = t.trim();
25
+ if (i.length === 0) return this;
26
+ if (!i.includes("&")) return this.registerCSS(i);
27
+ const r = `host:${i}`, s = this.cssFragments.get(r);
28
+ return s == null ? this.cssFragments.set(r, {
28
29
  kind: "host",
29
- css: r,
30
+ css: i,
30
31
  hosts: /* @__PURE__ */ new Set([n.trim()])
31
32
  }) : s.kind === "host" && s.hosts.add(n.trim()), this;
32
33
  }
33
34
  generateCSS() {
34
- return [...this.cssFragments.values()].map((t) => t.kind === "raw" ? t.css : Q(t.css, [...t.hosts])).join(`
35
+ return [...this.cssFragments.values()].map((t) => t.kind === "raw" ? t.css : se(t.css, [...t.hosts])).join(`
35
36
 
36
37
  `);
37
38
  }
38
39
  injectAll(t = globalThis.document) {
39
40
  if ((t == null ? void 0 : t.head) == null)
40
41
  throw new TypeError("StyleRegistry.injectAll requires a document with a head");
41
- const n = `style[${D}="${Ce(this.id)}"]`;
42
- let r = t.head.querySelector(n);
43
- r == null && (r = t.createElement("style"), r.setAttribute(D, this.id), t.head.prepend(r));
44
- const i = this.generateCSS();
45
- return r.textContent !== i && (r.textContent = i), r;
42
+ const n = `style[${G}="${Ne(this.id)}"]`;
43
+ let i = t.head.querySelector(n);
44
+ i == null && (i = t.createElement("style"), i.setAttribute(G, this.id), t.head.prepend(i));
45
+ const r = this.generateCSS();
46
+ return i.textContent !== r && (i.textContent = r), i;
46
47
  }
47
48
  reset() {
48
49
  this.cssFragments.clear();
49
50
  }
50
51
  }
51
- function ve() {
52
- return new J();
52
+ function ze() {
53
+ return new re();
53
54
  }
54
- const Ee = new J("");
55
- function Ce(e) {
55
+ const _e = new re("");
56
+ function Ne(e) {
56
57
  return e.replaceAll("\\", "\\\\").replaceAll('"', '\\"');
57
58
  }
58
- function Q(e, t) {
59
- let n = "", r = 0;
60
- for (; r < e.length; ) {
61
- const i = Le(e, r);
62
- if (i < 0) return n + e.slice(r);
63
- const s = Te(e, i);
64
- if (s < 0) return n + e.slice(r);
65
- const o = e.slice(r, i), a = e.slice(i + 1, s), c = o.trim();
66
- n += c.startsWith("@") ? `${o}{${Q(a, t)}}` : `${Re(o, t)}{${a}}`, r = s + 1;
59
+ function se(e, t) {
60
+ let n = "", i = 0;
61
+ for (; i < e.length; ) {
62
+ const r = Ue(e, i);
63
+ if (r < 0) return n + e.slice(i);
64
+ const s = Fe(e, r);
65
+ if (s < 0) return n + e.slice(i);
66
+ const o = e.slice(i, r), a = e.slice(r + 1, s), l = o.trim();
67
+ n += l.startsWith("@") ? `${o}{${se(a, t)}}` : `${Ie(o, t)}{${a}}`, i = s + 1;
67
68
  }
68
69
  return n;
69
70
  }
70
- function Re(e, t) {
71
- var o, a, c;
71
+ function Ie(e, t) {
72
+ var o, a, l;
72
73
  if (t.length === 1 || !e.includes("&"))
73
74
  return t.length === 1 ? e.replaceAll("&", t[0]) : e;
74
- const n = ((o = e.match(/^\s*/)) == null ? void 0 : o[0]) ?? "", r = ((a = e.match(/\s*$/)) == null ? void 0 : a[0]) ?? "", i = Oe(e.trim()), s = ((c = n.match(/(?:^|\n)([ \t]*)$/)) == null ? void 0 : c[1]) ?? "";
75
- return n + i.flatMap((u) => u.includes("&") ? t.map((p) => u.replaceAll("&", p)) : [u]).join(`,
76
- ${s}`) + r;
75
+ const n = ((o = e.match(/^\s*/)) == null ? void 0 : o[0]) ?? "", i = ((a = e.match(/\s*$/)) == null ? void 0 : a[0]) ?? "", r = Me(e.trim()), s = ((l = n.match(/(?:^|\n)([ \t]*)$/)) == null ? void 0 : l[1]) ?? "";
76
+ return n + r.flatMap((f) => f.includes("&") ? t.map((p) => f.replaceAll("&", p)) : [f]).join(`,
77
+ ${s}`) + i;
77
78
  }
78
- function Oe(e) {
79
+ function Me(e) {
79
80
  const t = [];
80
- let n = 0, r = 0, i = 0, s = null;
81
+ let n = 0, i = 0, r = 0, s = null;
81
82
  for (let o = 0; o < e.length; o += 1) {
82
83
  const a = e[o];
83
84
  if (s != null) {
84
85
  a === "\\" ? o += 1 : a === s && (s = null);
85
86
  continue;
86
87
  }
87
- a === '"' || a === "'" ? s = a : a === "(" ? r += 1 : a === ")" ? r -= 1 : a === "[" ? i += 1 : a === "]" ? i -= 1 : a === "," && r === 0 && i === 0 && (t.push(e.slice(n, o).trim()), n = o + 1);
88
+ a === '"' || a === "'" ? s = a : a === "(" ? i += 1 : a === ")" ? i -= 1 : a === "[" ? r += 1 : a === "]" ? r -= 1 : a === "," && i === 0 && r === 0 && (t.push(e.slice(n, o).trim()), n = o + 1);
88
89
  }
89
90
  return t.push(e.slice(n).trim()), t.filter(Boolean);
90
91
  }
91
- function Le(e, t) {
92
+ function Ue(e, t) {
92
93
  for (let n = t; n < e.length; n += 1) {
93
- const r = e[n];
94
- if (r === '"' || r === "'")
95
- n = X(e, n);
96
- else if (r === "/" && e[n + 1] === "*")
97
- n = ee(e, n);
98
- else if (r === "{")
94
+ const i = e[n];
95
+ if (i === '"' || i === "'")
96
+ n = oe(e, n);
97
+ else if (i === "/" && e[n + 1] === "*")
98
+ n = ae(e, n);
99
+ else if (i === "{")
99
100
  return n;
100
101
  }
101
102
  return -1;
102
103
  }
103
- function Te(e, t) {
104
+ function Fe(e, t) {
104
105
  let n = 1;
105
- for (let r = t + 1; r < e.length; r += 1) {
106
- const i = e[r];
107
- if (i === '"' || i === "'")
108
- r = X(e, r);
109
- else if (i === "/" && e[r + 1] === "*")
110
- r = ee(e, r);
111
- else if (i === "{")
106
+ for (let i = t + 1; i < e.length; i += 1) {
107
+ const r = e[i];
108
+ if (r === '"' || r === "'")
109
+ i = oe(e, i);
110
+ else if (r === "/" && e[i + 1] === "*")
111
+ i = ae(e, i);
112
+ else if (r === "{")
112
113
  n += 1;
113
- else if (i === "}" && --n === 0)
114
- return r;
114
+ else if (r === "}" && --n === 0)
115
+ return i;
115
116
  }
116
117
  return -1;
117
118
  }
118
- function X(e, t) {
119
+ function oe(e, t) {
119
120
  const n = e[t];
120
- for (let r = t + 1; r < e.length; r += 1)
121
- if (e[r] === "\\") r += 1;
122
- else if (e[r] === n) return r;
121
+ for (let i = t + 1; i < e.length; i += 1)
122
+ if (e[i] === "\\") i += 1;
123
+ else if (e[i] === n) return i;
123
124
  return e.length;
124
125
  }
125
- function ee(e, t) {
126
+ function ae(e, t) {
126
127
  const n = e.indexOf("*/", t + 2);
127
128
  return n < 0 ? e.length : n + 1;
128
129
  }
129
- const te = /* @__PURE__ */ new WeakSet(), ne = /* @__PURE__ */ new WeakSet();
130
- function st(e) {
130
+ const le = /* @__PURE__ */ new WeakSet(), ce = /* @__PURE__ */ new WeakSet();
131
+ function yt(e) {
131
132
  if (typeof e != "string" || e.trim() === "")
132
133
  throw new TypeError("Service name must be a non-empty string");
133
134
  const t = Object.freeze({ name: e.trim() });
134
- return te.add(t), t;
135
+ return le.add(t), t;
135
136
  }
136
- function ot(e, t) {
137
- if (I(e), typeof t != "function")
137
+ function wt(e, t) {
138
+ if (x(e), typeof t != "function")
138
139
  throw new TypeError(`Service provider "${e.name}" requires a factory function`);
139
140
  const n = Object.freeze({ key: e, create: t });
140
- return ne.add(n), n;
141
+ return ce.add(n), n;
141
142
  }
142
- class re {
143
+ class ue {
143
144
  constructor(t = []) {
144
- l(this, "providers", /* @__PURE__ */ new Map());
145
- l(this, "instances", /* @__PURE__ */ new Map());
146
- l(this, "creationOrder", []);
147
- l(this, "resolving", []);
148
- l(this, "disposed", !1);
145
+ c(this, "providers", /* @__PURE__ */ new Map());
146
+ c(this, "instances", /* @__PURE__ */ new Map());
147
+ c(this, "creationOrder", []);
148
+ c(this, "resolving", []);
149
+ c(this, "disposed", !1);
149
150
  if (!Array.isArray(t))
150
151
  throw new TypeError("ServiceScope providers must be an array");
151
152
  for (const n of t) {
152
- if (Ae(n), this.providers.has(n.key))
153
+ if (Be(n), this.providers.has(n.key))
153
154
  throw new Error(`Service "${n.key.name}" is registered more than once`);
154
155
  this.providers.set(n.key, n);
155
156
  }
@@ -158,21 +159,21 @@ class re {
158
159
  return this.disposed;
159
160
  }
160
161
  has(t) {
161
- return this.assertActive(), I(t), this.providers.has(t);
162
+ return this.assertActive(), x(t), this.providers.has(t);
162
163
  }
163
164
  require(t) {
164
- if (this.assertActive(), I(t), this.instances.has(t)) return this.instances.get(t);
165
+ if (this.assertActive(), x(t), this.instances.has(t)) return this.instances.get(t);
165
166
  const n = this.providers.get(t);
166
167
  if (n == null) throw new Error(`Service "${t.name}" is not registered`);
167
- const r = this.resolving.indexOf(t);
168
- if (r >= 0) {
169
- const i = [...this.resolving.slice(r), t].map((s) => s.name).join(" -> ");
170
- throw new Error(`Circular service dependency: ${i}`);
168
+ const i = this.resolving.indexOf(t);
169
+ if (i >= 0) {
170
+ const r = [...this.resolving.slice(i), t].map((s) => s.name).join(" -> ");
171
+ throw new Error(`Circular service dependency: ${r}`);
171
172
  }
172
173
  this.resolving.push(t);
173
174
  try {
174
- const i = n.create(this);
175
- return this.instances.set(t, i), this.creationOrder.push(t), i;
175
+ const r = n.create(this);
176
+ return this.instances.set(t, r), this.creationOrder.push(t), r;
176
177
  } finally {
177
178
  this.resolving.pop();
178
179
  }
@@ -182,12 +183,12 @@ class re {
182
183
  this.disposed = !0;
183
184
  const t = [];
184
185
  for (const n of [...this.creationOrder].reverse()) {
185
- const r = this.instances.get(n);
186
+ const i = this.instances.get(n);
186
187
  try {
187
- const i = ze(r);
188
- i != null && i.call(r);
189
- } catch (i) {
190
- t.push(i);
188
+ const r = Ve(i);
189
+ r != null && r.call(i);
190
+ } catch (r) {
191
+ t.push(r);
191
192
  }
192
193
  }
193
194
  if (this.instances.clear(), this.creationOrder.length = 0, this.resolving.length = 0, t.length === 1) throw t[0];
@@ -198,25 +199,25 @@ class re {
198
199
  if (this.disposed) throw new Error("ServiceScope has been disposed");
199
200
  }
200
201
  }
201
- function je(e = []) {
202
- return new re(e);
202
+ function xe(e = []) {
203
+ return new ue(e);
203
204
  }
204
- function Pe(e) {
205
- return e != null && (typeof e == "object" || typeof e == "function") && te.has(e);
205
+ function qe(e) {
206
+ return e != null && (typeof e == "object" || typeof e == "function") && le.has(e);
206
207
  }
207
- function I(e) {
208
- if (!Pe(e)) throw new TypeError("Expected a service key created by defineService()");
208
+ function x(e) {
209
+ if (!qe(e)) throw new TypeError("Expected a service key created by defineService()");
209
210
  }
210
- function Ae(e) {
211
- if (e == null || typeof e != "object" && typeof e != "function" || !ne.has(e))
211
+ function Be(e) {
212
+ if (e == null || typeof e != "object" && typeof e != "function" || !ce.has(e))
212
213
  throw new TypeError("Expected a service provider created by provideService()");
213
214
  }
214
- function ze(e) {
215
+ function Ve(e) {
215
216
  if (e == null || typeof e != "object" && typeof e != "function") return null;
216
217
  const t = Reflect.get(e, "dispose");
217
218
  return typeof t == "function" ? t : null;
218
219
  }
219
- const T = Object.freeze({
220
+ const P = Object.freeze({
220
221
  breadcrumbLabel: "Breadcrumb",
221
222
  checkboxOptionLabel: "Option",
222
223
  checkboxStateLabel: (e, t) => `${e}: ${t}`,
@@ -261,40 +262,40 @@ const T = Object.freeze({
261
262
  treeViewLoadError: "Unable to load tree items",
262
263
  treeViewLoading: "Loading tree items…"
263
264
  });
264
- class ie {
265
+ class fe {
265
266
  constructor(t, n) {
266
- l(this, "locale");
267
- l(this, "messages");
267
+ c(this, "locale");
268
+ c(this, "messages");
268
269
  this.locale = t, this.messages = n, Object.freeze(this);
269
270
  }
270
271
  message(t) {
271
272
  return this.messages[t];
272
273
  }
273
274
  }
274
- const _e = new ie(
275
+ const De = new fe(
275
276
  void 0,
276
- T
277
+ P
277
278
  );
278
- function ke(e) {
279
- if (e == null) return _e;
279
+ function He(e) {
280
+ if (e == null) return De;
280
281
  if (typeof e != "object" || Array.isArray(e))
281
282
  throw new TypeError("Capillary UI localization must be an object");
282
- const t = $e(e.locale), n = e.messages;
283
+ const t = We(e.locale), n = e.messages;
283
284
  if (n != null && (typeof n != "object" || Array.isArray(n)))
284
285
  throw new TypeError("Capillary UI localization messages must be an object");
285
- const r = { ...T };
286
+ const i = { ...P };
286
287
  if (n != null)
287
- for (const i of Object.keys(T)) {
288
- const s = n[i];
288
+ for (const r of Object.keys(P)) {
289
+ const s = n[r];
289
290
  if (s === void 0) continue;
290
- const o = T[i];
291
+ const o = P[r];
291
292
  if (typeof s != typeof o)
292
- throw new TypeError(`Capillary UI localization message "${i}" has the wrong type`);
293
- Object.assign(r, { [i]: s });
293
+ throw new TypeError(`Capillary UI localization message "${r}" has the wrong type`);
294
+ Object.assign(i, { [r]: s });
294
295
  }
295
- return new ie(t, Object.freeze(r));
296
+ return new fe(t, Object.freeze(i));
296
297
  }
297
- function $e(e) {
298
+ function We(e) {
298
299
  if (typeof e != "string" || e.trim() === "")
299
300
  throw new TypeError("Capillary UI localization locale must be a non-empty BCP 47 language tag");
300
301
  try {
@@ -303,7 +304,7 @@ function $e(e) {
303
304
  throw new RangeError(`Invalid Capillary UI localization locale: ${e}`, { cause: t });
304
305
  }
305
306
  }
306
- const Ne = /* @__PURE__ */ new Set([
307
+ const Ke = /* @__PURE__ */ new Set([
307
308
  "annotation-xml",
308
309
  "color-profile",
309
310
  "font-face",
@@ -313,27 +314,28 @@ const Ne = /* @__PURE__ */ new Set([
313
314
  "font-face-name",
314
315
  "missing-glyph"
315
316
  ]);
316
- class M {
317
- constructor(t = {}, n = ve()) {
318
- l(this, "styleRegistry");
319
- l(this, "services");
320
- l(this, "router");
321
- l(this, "localization");
322
- l(this, "routedRoots", /* @__PURE__ */ new WeakSet());
317
+ class V {
318
+ constructor(t = {}, n = ze()) {
319
+ c(this, "styleRegistry");
320
+ c(this, "services");
321
+ c(this, "router");
322
+ c(this, "localization");
323
+ c(this, "diagnosticScope");
324
+ c(this, "routedRoots", /* @__PURE__ */ new WeakSet());
323
325
  if (t == null || typeof t != "object" || Array.isArray(t))
324
326
  throw new TypeError("CapillaryUiRuntime options must be an object");
325
327
  if (Object.hasOwn(t, "elementNames"))
326
328
  throw new TypeError("CapillaryUiRuntime no longer supports configurable element names");
327
- if (this.styleRegistry = n, this.localization = ke(t.localization), this.services = t.services ?? je(), !(this.services instanceof re))
329
+ if (this.styleRegistry = n, this.diagnosticScope = t.diagnosticScope ?? Pe, this.localization = He(t.localization), this.services = t.services ?? xe(), !(this.services instanceof ue))
328
330
  throw new TypeError("Capillary UI services must be a ServiceScope");
329
331
  if (this.router = t.router ?? null, this.router != null && (typeof this.router != "object" || typeof this.router.openScope != "function" || typeof this.router.completeScope != "function"))
330
332
  throw new TypeError("Capillary UI router must be a BrowserRouter");
331
333
  }
332
334
  /** Resolve a fixed one-hyphen public host name for a built-in component. */
333
335
  resolveElementName(t) {
334
- se(t, "Capillary UI component host name");
336
+ pe(t, "Capillary UI component host name");
335
337
  const n = `cap-${t.replaceAll("-", "")}`;
336
- return Ie(n), n;
338
+ return Ye(n), n;
337
339
  }
338
340
  resolveHostSelector(t, n) {
339
341
  if (typeof t != "string") throw new TypeError("Host selector must be a string");
@@ -344,17 +346,17 @@ class M {
344
346
  return t.replaceAll("&", this.resolveElementName(n));
345
347
  }
346
348
  create(t, ...n) {
347
- const r = new t(...n);
348
- return r._setRuntime(this), r;
349
+ const i = u.withScope(this.diagnosticScope, () => new t(...n));
350
+ return i._setRuntime(this), i;
349
351
  }
350
- mount(t, n, r = null) {
352
+ mount(t, n, i = null) {
351
353
  t._setRuntime(this);
352
- let i = null;
353
- this.router != null && !this.routedRoots.has(t) && (this.routedRoots.add(t), i = this.router.openScope(this.router.root, t), t.onCleanup(i));
354
+ let r = null;
355
+ this.router != null && !this.routedRoots.has(t) && (this.routedRoots.add(t), r = this.router.openScope(this.router.root, t), t.onCleanup(r));
354
356
  try {
355
- t.mount(n, r), this.router != null && i != null && this.router.completeScope(this.router.root, t);
357
+ t.mount(n, i), this.router != null && r != null && this.router.completeScope(this.router.root, t);
356
358
  } catch (s) {
357
- throw i == null || i(), s;
359
+ throw r == null || r(), s;
358
360
  }
359
361
  return t;
360
362
  }
@@ -367,19 +369,19 @@ class M {
367
369
  return this.styleRegistry.injectAll(t);
368
370
  }
369
371
  }
370
- function at(e = {}) {
371
- return new M(e);
372
+ function St(e = {}) {
373
+ return new V(e);
372
374
  }
373
- const K = new M({}, Ee);
374
- function se(e, t) {
375
+ const J = new V({}, _e);
376
+ function pe(e, t) {
375
377
  if (typeof e != "string" || !/^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$/.test(e))
376
378
  throw new TypeError(`${t} must be a lowercase kebab-case name`);
377
379
  }
378
- function Ie(e) {
379
- if (se(e, "Capillary UI element name"), !e.includes("-") || Ne.has(e))
380
+ function Ye(e) {
381
+ if (pe(e, "Capillary UI element name"), !e.includes("-") || Ke.has(e))
380
382
  throw new TypeError(`Capillary UI element name must be a non-reserved name containing a hyphen: ${e}`);
381
383
  }
382
- const P = Symbol.for("@capillaryjs/capillary-ui.Fragment"), oe = /* @__PURE__ */ new WeakSet(), Ue = /* @__PURE__ */ new Set([
384
+ const $ = Symbol.for("@capillaryjs/capillary-ui.Fragment"), de = /* @__PURE__ */ new WeakSet(), Ze = /* @__PURE__ */ new Set([
383
385
  "allowFullScreen",
384
386
  "async",
385
387
  "autoFocus",
@@ -403,7 +405,7 @@ const P = Symbol.for("@capillaryjs/capillary-ui.Fragment"), oe = /* @__PURE__ */
403
405
  "required",
404
406
  "reversed",
405
407
  "selected"
406
- ]), xe = /* @__PURE__ */ new Set([
408
+ ]), Ge = /* @__PURE__ */ new Set([
407
409
  "checked",
408
410
  "defaultChecked",
409
411
  "defaultValue",
@@ -417,58 +419,58 @@ const P = Symbol.for("@capillaryjs/capillary-ui.Fragment"), oe = /* @__PURE__ */
417
419
  "selectedIndex",
418
420
  "tabIndex",
419
421
  "value"
420
- ]), W = "data-cap";
421
- function lt(e) {
422
- H(e, "live");
422
+ ]), Q = "data-cap";
423
+ function vt(e) {
424
+ Z(e, "live");
423
425
  const t = Object.freeze({ emitter: e });
424
- return oe.add(t), t;
426
+ return de.add(t), t;
425
427
  }
426
- function A(e, t = null, ...n) {
427
- const r = t ?? {};
428
- if (typeof r != "object" || Array.isArray(r))
428
+ function k(e, t = null, ...n) {
429
+ const i = t ?? {};
430
+ if (typeof i != "object" || Array.isArray(i))
429
431
  throw new TypeError("VNode props must be an object or null");
430
432
  const {
431
- children: i,
433
+ children: r,
432
434
  key: s = null,
433
435
  ...o
434
- } = r;
436
+ } = i;
435
437
  return {
436
438
  type: e,
437
439
  key: s,
438
440
  props: {
439
441
  ...o,
440
- children: ae([i, n])
442
+ children: he([r, n])
441
443
  }
442
444
  };
443
445
  }
444
- function Me(e, ...t) {
445
- return e.reduce((n, r, i) => n + r + String(t[i] ?? ""), "");
446
+ function Je(e, ...t) {
447
+ return e.reduce((n, i, r) => n + i + String(t[r] ?? ""), "");
446
448
  }
447
449
  const h = class h {
448
450
  constructor(t = {}) {
449
- l(this, "props");
450
- l(this, "dom", null);
451
+ c(this, "props");
452
+ c(this, "dom", null);
451
453
  /** @internal */
452
- l(this, "_rendered", null);
454
+ c(this, "_rendered", null);
453
455
  /** @internal */
454
- l(this, "_childComponents", /* @__PURE__ */ new Set());
456
+ c(this, "_childComponents", /* @__PURE__ */ new Set());
455
457
  /** @internal Component ancestry used to enforce structural invariants. */
456
- l(this, "_parentComponent", null);
457
- l(this, "initialized", !1);
458
- l(this, "mounted", !1);
459
- l(this, "destroyed", !1);
460
- l(this, "updating", !1);
461
- l(this, "updateRequested", !1);
462
- l(this, "cleanupFunctions", /* @__PURE__ */ new Set());
463
- l(this, "watched", /* @__PURE__ */ new Map());
464
- l(this, "renderReadSubscriptions", /* @__PURE__ */ new Map());
465
- l(this, "collectingRenderReads", null);
458
+ c(this, "_parentComponent", null);
459
+ c(this, "initialized", !1);
460
+ c(this, "mounted", !1);
461
+ c(this, "destroyed", !1);
462
+ c(this, "updating", !1);
463
+ c(this, "updateRequested", !1);
464
+ c(this, "cleanupFunctions", /* @__PURE__ */ new Set());
465
+ c(this, "watched", /* @__PURE__ */ new Map());
466
+ c(this, "renderReadSubscriptions", /* @__PURE__ */ new Map());
467
+ c(this, "collectingRenderReads", null);
466
468
  /** @internal */
467
- l(this, "_runtime", K);
469
+ c(this, "_runtime", J);
468
470
  /** @internal Route lineage inherited by nested routed components. */
469
- l(this, "_routeContext", null);
471
+ c(this, "_routeContext", null);
470
472
  /** JSX component for this instance's runtime-configured custom host. */
471
- l(this, "Host", ({
473
+ c(this, "Host", ({
472
474
  children: t = [],
473
475
  ...n
474
476
  }) => this.host(n, t));
@@ -482,20 +484,33 @@ const h = class h {
482
484
  throw new TypeError("Component.new() requires a Component constructor");
483
485
  return n.mount();
484
486
  }
485
- static registerStyles(t = K, n = /* @__PURE__ */ new Set()) {
487
+ static registerStyles(t = J, n = /* @__PURE__ */ new Set()) {
486
488
  if (n.has(this)) return;
487
489
  n.add(this);
488
- const r = this.hostName ?? null, i = nt(this);
489
- for (const s of i)
490
- Object.hasOwn(s, "css") && s.css && (r == null ? t.styleRegistry.registerCSS(s.css) : t.styleRegistry.registerHostCSS(
490
+ const i = this.hostName ?? null, r = ht(this);
491
+ for (const s of r)
492
+ Object.hasOwn(s, "css") && s.css && (i == null ? t.styleRegistry.registerCSS(s.css) : t.styleRegistry.registerHostCSS(
491
493
  s.css,
492
- t.resolveElementName(r)
494
+ t.resolveElementName(i)
493
495
  ));
494
- for (const s of i)
496
+ for (const s of r)
495
497
  if (Object.hasOwn(s, "dependencies"))
496
498
  for (const o of s.dependencies ?? [])
497
499
  o.registerStyles(t, n);
498
500
  }
501
+ get diagnosticScope() {
502
+ var t;
503
+ return this.constructor.diagnosticScope ?? ((t = this._parentComponent) == null ? void 0 : t.diagnosticScope) ?? this._runtime.diagnosticScope;
504
+ }
505
+ [Ae]() {
506
+ return {
507
+ kind: "component",
508
+ label: T(this),
509
+ scope: this.diagnosticScope,
510
+ sources: [...this.watched.keys(), ...this.renderReadSubscriptions.keys()],
511
+ targets: [...this._childComponents]
512
+ };
513
+ }
499
514
  /** One-time setup hook. Constructors must not subscribe or render. */
500
515
  initialize() {
501
516
  }
@@ -504,25 +519,25 @@ const h = class h {
504
519
  }
505
520
  /** Render this component's configured custom host element. */
506
521
  host(t = null, ...n) {
507
- const r = this.constructor, i = r.hostName;
508
- if (i == null)
522
+ const i = this.constructor, r = i.hostName;
523
+ if (r == null)
509
524
  throw new Error(`${this.constructor.name} does not declare a custom host name`);
510
525
  const {
511
526
  class: s,
512
527
  className: o,
513
528
  ...a
514
- } = t ?? {}, c = o ?? s, u = this.props.island === !0 ? rt(c, "island") : c;
515
- return A(this._runtime.resolveElementName(i), {
529
+ } = t ?? {}, l = o ?? s, f = this.props.island === !0 ? mt(l, "island") : l;
530
+ return k(this._runtime.resolveElementName(r), {
516
531
  ...a,
517
- ...u == null ? {} : { className: u },
518
- "data-cap-component": i,
519
- ...r.dataSurface == null ? {} : { "data-cap-surface": r.dataSurface }
532
+ ...f == null ? {} : { className: f },
533
+ "data-cap-component": r,
534
+ ...i.dataSurface == null ? {} : { "data-cap-surface": i.dataSurface }
520
535
  }, ...n);
521
536
  }
522
537
  /** @internal Assign an immutable application runtime before initialization or mounting. */
523
538
  _setRuntime(t) {
524
539
  var n;
525
- if (!(t instanceof M))
540
+ if (!(t instanceof V))
526
541
  throw new TypeError("Component runtime must be a CapillaryUiRuntime");
527
542
  if (t === this._runtime) return this;
528
543
  if (this.initialized || this.mounted || this._rendered != null)
@@ -548,8 +563,8 @@ const h = class h {
548
563
  mount(t = null, n = null) {
549
564
  if (this.destroyed) throw new Error("Cannot mount a destroyed component");
550
565
  this.validateIslandAncestry(this.props);
551
- let r = !1;
552
- return this.initialized || (this.validateRequiredServices(), this.initialized = !0, this.initialize()), this.mounted || (this.mounted = !0, this.update(), r = !0), t != null && (tt(t), V(t, this._rendered, n)), r && this.afterMount(this.dom), this;
566
+ let i = !1;
567
+ return this.initialized || (this.validateRequiredServices(), this.initialized = !0, u.withScope(this.diagnosticScope, () => this.initialize())), this.mounted || (this.mounted = !0, this.update(), i = !0), t != null && (dt(t), Y(t, this._rendered, n)), i && this.afterMount(this.dom), this;
553
568
  }
554
569
  attachTo(t) {
555
570
  return this.mount(t), this;
@@ -560,19 +575,37 @@ const h = class h {
560
575
  if (this.updating)
561
576
  return this.updateRequested = !0, this;
562
577
  this.updating = !0;
578
+ const n = u.event(this, "consumer", {
579
+ parent: t instanceof $e ? t : u.currentEvent,
580
+ cause: "component render",
581
+ outcome: "started"
582
+ });
563
583
  try {
564
- do {
565
- this.updateRequested = !1;
566
- const n = /* @__PURE__ */ new Set();
567
- this.collectingRenderReads = n;
568
- let r;
569
- try {
570
- r = R(this.render());
571
- } finally {
572
- this.collectingRenderReads = null;
573
- }
574
- this._rendered = F(this._rendered, r, this), this.dom = pe(this._rendered), this.reconcileRenderReads(n), this.afterUpdate(this.dom);
575
- } while (this.updateRequested && !this.destroyed);
584
+ u.withEvent(n, () => {
585
+ do {
586
+ this.updateRequested = !1;
587
+ const i = /* @__PURE__ */ new Set();
588
+ this.collectingRenderReads = i;
589
+ let r;
590
+ try {
591
+ r = u.withScope(this.diagnosticScope, () => L(this.render()));
592
+ } finally {
593
+ this.collectingRenderReads = null;
594
+ }
595
+ this._rendered = D(this._rendered, r, this), this.dom = ve(this._rendered), this.reconcileRenderReads(i), this.afterUpdate(this.dom);
596
+ } while (this.updateRequested && !this.destroyed);
597
+ }), n && u.event(this, "consumer", {
598
+ parent: n,
599
+ cause: "component rendered",
600
+ outcome: "succeeded"
601
+ });
602
+ } catch (i) {
603
+ throw n && u.event(this, "consumer", {
604
+ parent: n,
605
+ cause: "component render failed",
606
+ outcome: "failed",
607
+ error: i
608
+ }), i;
576
609
  } finally {
577
610
  this.updating = !1;
578
611
  }
@@ -592,11 +625,11 @@ const h = class h {
592
625
  if (n == null || typeof n.subscribe != "function")
593
626
  throw new TypeError("watch requires emitter-like values");
594
627
  if (this.watched.has(n)) continue;
595
- const r = n.subscribe(({ event: i }) => {
596
- this.mounted && !this.destroyed && this.update(i);
597
- }, { emitCurrent: !1 });
598
- this.watched.set(n, r), this.onCleanup(() => {
599
- r(), this.watched.delete(n);
628
+ const i = n.subscribe(({ event: r }) => {
629
+ this.mounted && !this.destroyed && this.update(r);
630
+ }, { emitCurrent: !1, diagnosticTarget: this });
631
+ this.watched.set(n, i), this.onCleanup(() => {
632
+ i(), this.watched.delete(n);
600
633
  });
601
634
  }
602
635
  return this;
@@ -646,24 +679,39 @@ const h = class h {
646
679
  capillaryUiMessage(t) {
647
680
  return this.localization.message(t);
648
681
  }
649
- listen(t, n, r, i) {
682
+ listen(t, n, i, r) {
650
683
  if (t == null || typeof t.addEventListener != "function")
651
684
  throw new TypeError("listen target must be an EventTarget");
652
- const s = r;
653
- return t.addEventListener(n, s, i), this.onCleanup(() => t.removeEventListener(n, s, i)), this;
685
+ const s = {};
686
+ u.configure(s, {
687
+ kind: "interaction",
688
+ label: `${T(this)}: ${n}`,
689
+ scope: this.diagnosticScope
690
+ });
691
+ const o = (a) => K(
692
+ s,
693
+ this.diagnosticScope,
694
+ a,
695
+ o,
696
+ n,
697
+ () => i(a)
698
+ );
699
+ return t.addEventListener(n, o, r), this.onCleanup(() => {
700
+ t.removeEventListener(n, o, r), u.dispose(s);
701
+ }), this;
654
702
  }
655
703
  registerChild(t) {
656
704
  if (!(t instanceof h))
657
705
  throw new TypeError("registerChild requires a Component");
658
- return this._childComponents.add(t), t;
706
+ return this._childComponents.add(t), u.active && u.inspect(this), t;
659
707
  }
660
708
  destroy() {
661
709
  if (!this.destroyed) {
662
- this.destroyed = !0, this.mounted = !1;
710
+ this.destroyed = !0, this.mounted = !1, u.dispose(this);
663
711
  for (const t of [...this.cleanupFunctions]) t();
664
712
  this.cleanupFunctions.clear(), this.watched.clear();
665
713
  for (const t of this.renderReadSubscriptions.values()) t();
666
- this.renderReadSubscriptions.clear(), this.collectingRenderReads = null, this._rendered && g(this._rendered, !0), this._rendered = null, this.dom = null, this._childComponents.clear(), this.onDestroy();
714
+ this.renderReadSubscriptions.clear(), this.collectingRenderReads = null, this._rendered && w(this._rendered, !0), this._rendered = null, this.dom = null, this._childComponents.clear(), this.onDestroy();
667
715
  }
668
716
  }
669
717
  validateRequiredServices() {
@@ -673,42 +721,42 @@ const h = class h {
673
721
  throw new Error(`${t.name} requires unregistered service "${n.name}"`);
674
722
  }
675
723
  validateIslandAncestry(t) {
676
- if (!N(t)) return;
724
+ if (!F(t)) return;
677
725
  if (this.hasIslandDescendant())
678
726
  throw new Error("An island component cannot contain another island");
679
727
  let n = this._parentComponent;
680
728
  for (; n != null; ) {
681
- if (N(n.props))
729
+ if (F(n.props))
682
730
  throw new Error("An island component cannot be nested inside another island");
683
731
  n = n._parentComponent;
684
732
  }
685
733
  }
686
734
  hasIslandDescendant() {
687
735
  for (const t of this._childComponents)
688
- if (N(t.props) || t.hasIslandDescendant()) return !0;
736
+ if (F(t.props) || t.hasIslandDescendant()) return !0;
689
737
  return !1;
690
738
  }
691
739
  onDestroy() {
692
740
  }
693
741
  trackRenderRead(t) {
694
- if (H(t, "Component.read"), this.collectingRenderReads == null)
742
+ if (Z(t, "Component.read"), this.collectingRenderReads == null)
695
743
  throw new Error("Component.read() and snapshot() may only be called during render()");
696
744
  this.collectingRenderReads.add(t);
697
745
  }
698
746
  reconcileRenderReads(t) {
699
- for (const [n, r] of this.renderReadSubscriptions)
700
- t.has(n) || (r(), this.renderReadSubscriptions.delete(n));
747
+ for (const [n, i] of this.renderReadSubscriptions)
748
+ t.has(n) || (i(), this.renderReadSubscriptions.delete(n));
701
749
  for (const n of t) {
702
750
  if (this.watched.has(n) || this.renderReadSubscriptions.has(n)) continue;
703
- const r = n.subscribe(({ event: i }) => {
704
- this.mounted && !this.destroyed && this.update(i);
705
- }, { emitCurrent: !1 });
706
- this.renderReadSubscriptions.set(n, r);
751
+ const i = n.subscribe(({ event: r }) => {
752
+ this.mounted && !this.destroyed && this.update(r);
753
+ }, { emitCurrent: !1, diagnosticTarget: this });
754
+ this.renderReadSubscriptions.set(n, i);
707
755
  }
708
756
  }
709
757
  };
710
- l(h, "dependencies", []), l(h, "requiredServices", []), /** Component `live()` bindings are opt-in; subclasses declare their allowlist. */
711
- l(h, "liveProps", []), l(h, "css", Me`
758
+ c(h, "dependencies", []), c(h, "requiredServices", []), /** Component `live()` bindings are opt-in; subclasses declare their allowlist. */
759
+ c(h, "liveProps", []), c(h, "css", Je`
712
760
  .cap-fill-horizontal,
713
761
  .cap-fill-vertical {
714
762
  box-sizing: border-box;
@@ -808,17 +856,19 @@ l(h, "liveProps", []), l(h, "css", Me`
808
856
  label[data-cap] {
809
857
  user-select: none;
810
858
  }
811
- `), l(h, "hostName", null), /** Optional host-level data surface marker for parent composition. */
812
- l(h, "dataSurface", null);
813
- let m = h;
814
- function R(e) {
815
- return Array.isArray(e) ? A(P, null, e) : e == null || typeof e == "boolean" ? A(P) : e;
816
- }
817
- function ae(e) {
818
- const t = [], n = (r) => {
819
- if (Array.isArray(r))
820
- for (const i of r) n(i);
821
- else r != null && typeof r != "boolean" && t.push(r);
859
+ `), c(h, "hostName", null), /** Override for a diagnostic-tool subtree; ordinary components inherit their owner/runtime. */
860
+ c(h, "diagnosticScope", null), /** Optional stable display name for bundled application components. Built-ins use their host name. */
861
+ c(h, "diagnosticLabel", null), /** Optional host-level data surface marker for parent composition. */
862
+ c(h, "dataSurface", null);
863
+ let b = h;
864
+ function L(e) {
865
+ return Array.isArray(e) ? k($, null, e) : e == null || typeof e == "boolean" ? k($) : e;
866
+ }
867
+ function he(e) {
868
+ const t = [], n = (i) => {
869
+ if (Array.isArray(i))
870
+ for (const r of i) n(r);
871
+ else i != null && typeof i != "boolean" && t.push(i);
822
872
  };
823
873
  return n(e), t;
824
874
  }
@@ -831,35 +881,35 @@ function O(e, t) {
831
881
  node: document.createTextNode(String(e)),
832
882
  owner: t
833
883
  };
834
- if (k(e)) {
884
+ if (I(e)) {
835
885
  const s = document.createComment("cap-emitter-start"), o = document.createComment("cap-emitter-end"), a = e.get();
836
886
  if (Object.is(a, e))
837
887
  throw new TypeError("A Capillary UI emitter child cannot render itself");
838
- const c = document.createDocumentFragment();
839
- c.append(s, o);
840
- const u = O(R(a), t);
841
- V(c, u, o);
888
+ const l = document.createDocumentFragment();
889
+ l.append(s, o);
890
+ const f = O(L(a), t);
891
+ Y(l, f, o);
842
892
  const p = {
843
893
  kind: "emitter",
844
894
  key: null,
845
895
  source: e,
846
896
  start: s,
847
897
  end: o,
848
- child: u,
898
+ child: f,
849
899
  unsubscribe: () => {
850
900
  },
851
901
  owner: t
852
902
  };
853
- return p.unsubscribe = e.subscribe(({ value: b }) => {
854
- if (Object.is(b, e))
903
+ return p.unsubscribe = N(e, p, t, "reactive child", (y) => {
904
+ if (Object.is(y, e))
855
905
  throw new TypeError("A Capillary UI emitter child cannot render itself");
856
- p.child = F(p.child, R(b), t);
857
- }, { emitCurrent: !1 }), p;
906
+ p.child = D(p.child, L(y), t);
907
+ }), p;
858
908
  }
859
- if (e instanceof m)
909
+ if (e instanceof b)
860
910
  return e._setRuntime(t._runtime), e._setRouteContext(t._routeContextForChildren()), e._setParentComponent(t), e.mount(), t.registerChild(e), {
861
911
  kind: "component",
862
- key: de(e.props),
912
+ key: Ee(e.props),
863
913
  type: e.constructor,
864
914
  instance: e,
865
915
  prebuilt: !0,
@@ -867,23 +917,23 @@ function O(e, t) {
867
917
  liveProps: /* @__PURE__ */ new Map(),
868
918
  owner: t
869
919
  };
870
- if (!y(e))
871
- throw new TypeError(`Invalid Capillary UI child: ${G(e)}`);
872
- const { type: n, key: r = null, props: i } = e;
873
- if (n === P) {
920
+ if (!g(e))
921
+ throw new TypeError(`Invalid Capillary UI child: ${ie(e)}`);
922
+ const { type: n, key: i = null, props: r } = e;
923
+ if (n === $) {
874
924
  const s = document.createComment("cap-fragment-start"), o = document.createComment("cap-fragment-end"), a = {
875
925
  kind: "fragment",
876
- key: r,
926
+ key: i,
877
927
  type: n,
878
928
  start: s,
879
929
  end: o,
880
930
  children: [],
881
931
  owner: t
882
- }, c = document.createDocumentFragment();
883
- return c.append(s, o), a.children = z(
884
- c,
932
+ }, l = document.createDocumentFragment();
933
+ return l.append(s, o), a.children = z(
934
+ l,
885
935
  [],
886
- i.children,
936
+ r.children,
887
937
  t,
888
938
  o,
889
939
  s
@@ -892,7 +942,7 @@ function O(e, t) {
892
942
  if (typeof n == "string") {
893
943
  const s = document.createElement(n), o = {
894
944
  kind: "element",
895
- key: r,
945
+ key: i,
896
946
  type: n,
897
947
  node: s,
898
948
  props: {},
@@ -903,16 +953,19 @@ function O(e, t) {
903
953
  children: [],
904
954
  owner: t
905
955
  };
906
- return fe(o, i), o.children = z(s, [], i.children, t), o;
956
+ return we(o, r), o.children = z(s, [], r.children, t), o;
907
957
  }
908
- if (me(n)) {
909
- const s = i;
910
- ue(n, s);
911
- const o = Y(s), a = new n(o);
958
+ if (Re(n)) {
959
+ const s = r;
960
+ ge(n, s);
961
+ const o = X(s), a = u.withScope(
962
+ n.diagnosticScope ?? t.diagnosticScope,
963
+ () => new n(o)
964
+ );
912
965
  a._setRuntime(t._runtime), a._setRouteContext(t._routeContextForChildren()), a._setParentComponent(t);
913
- const c = {
966
+ const l = {
914
967
  kind: "component",
915
- key: r,
968
+ key: i,
916
969
  type: n,
917
970
  instance: a,
918
971
  prebuilt: !1,
@@ -920,191 +973,218 @@ function O(e, t) {
920
973
  liveProps: /* @__PURE__ */ new Map(),
921
974
  owner: t
922
975
  };
923
- return ce(c, s), a.mount(), t.registerChild(a), c;
976
+ return be(l, s), a.mount(), t.registerChild(a), l;
924
977
  }
925
978
  if (typeof n == "function") {
926
- const s = n, o = i, a = Y(o), c = R(s(a)), u = {
979
+ const s = n, o = r, a = X(o), l = s === Reflect.get(t, "Host") ? null : {};
980
+ l && u.configure(l, {
981
+ kind: "component",
982
+ label: String(Reflect.get(s, "diagnosticLabel") ?? s.name ?? "Function component"),
983
+ scope: t.diagnosticScope,
984
+ sources: [t]
985
+ });
986
+ const f = ye(l, () => O(L(s(a)), t)), p = {
927
987
  kind: "function",
928
- key: r,
988
+ key: i,
929
989
  type: s,
930
990
  props: a,
931
991
  sourceProps: o,
932
992
  liveProps: /* @__PURE__ */ new Map(),
933
- child: O(c, t),
993
+ child: f,
994
+ diagnosticSubject: l,
934
995
  owner: t
935
996
  };
936
- return qe(u), u;
997
+ return Xe(p), p;
937
998
  }
938
- throw new TypeError(`Unsupported vnode type: ${G(n)}`);
999
+ throw new TypeError(`Unsupported vnode type: ${ie(n)}`);
939
1000
  }
940
- function F(e, t, n) {
1001
+ function D(e, t, n) {
941
1002
  if (e == null) return O(t, n);
942
- if (he(e, t)) return le(e, t, n);
943
- const r = O(t, n), i = pe(e), s = (i == null ? void 0 : i.parentNode) ?? null;
944
- return s && V(s, r, i), g(e, !0), r;
1003
+ if (Ce(e, t)) return me(e, t, n);
1004
+ const i = O(t, n), r = ve(e), s = (r == null ? void 0 : r.parentNode) ?? null;
1005
+ return s && Y(s, i, r), w(e, !0), i;
945
1006
  }
946
- function le(e, t, n) {
947
- return e.kind === "text" ? (typeof t != "string" && typeof t != "number" || Object.is(e.value, t) || (e.value = t, e.node.data = String(t)), e) : e.kind === "emitter" ? (!k(t) || e.source !== t, e) : e.kind === "component" ? (t instanceof m || y(t) && Fe(e, t.props), e) : y(t) ? e.kind === "function" ? (Be(e, t.props), e) : e.kind === "fragment" ? (e.children = z(
1007
+ function me(e, t, n) {
1008
+ return e.kind === "text" ? (typeof t != "string" && typeof t != "number" || Object.is(e.value, t) || (e.value = t, e.node.data = String(t)), e) : e.kind === "emitter" ? (!I(t) || e.source !== t, e) : e.kind === "component" ? (t instanceof b || g(t) && Qe(e, t.props), e) : g(t) ? e.kind === "function" ? (et(e, t.props), e) : e.kind === "fragment" ? (e.children = z(
948
1009
  e.start.parentNode,
949
1010
  e.children,
950
1011
  t.props.children,
951
1012
  n,
952
1013
  e.end,
953
1014
  e.start
954
- ), e) : (fe(e, t.props), e.children = z(
1015
+ ), e) : (we(e, t.props), e.children = z(
955
1016
  e.node,
956
1017
  e.children,
957
1018
  t.props.children,
958
1019
  n
959
1020
  ), e) : e;
960
1021
  }
961
- function Y(e) {
1022
+ function X(e) {
962
1023
  return Object.fromEntries(Object.entries(e).map(([t, n]) => [
963
1024
  t,
964
- v(n) ? n.emitter.get() : n
1025
+ E(n) ? n.emitter.get() : n
965
1026
  ]));
966
1027
  }
967
- function ce(e, t) {
968
- q(e.liveProps, t, (n, r) => {
969
- e.props = { ...e.props, [n]: r }, e.instance.setProps(e.props);
970
- }), e.props = B(e.liveProps, t), e.instance.setProps(e.props);
1028
+ function be(e, t) {
1029
+ H(e.liveProps, t, e.instance, T(e.instance), (n, i) => {
1030
+ e.props = { ...e.props, [n]: i }, e.instance.setProps(e.props);
1031
+ }), e.props = W(e.liveProps, t), e.instance.setProps(e.props);
971
1032
  }
972
- function Fe(e, t) {
973
- ue(e.type, t), ce(e, t);
1033
+ function Qe(e, t) {
1034
+ ge(e.type, t), be(e, t);
974
1035
  }
975
- function ue(e, t) {
1036
+ function ge(e, t) {
976
1037
  const n = Reflect.get(e, "liveProps");
977
1038
  if (n == null) return;
978
- if (!Array.isArray(n) || n.some((i) => typeof i != "string"))
1039
+ if (!Array.isArray(n) || n.some((r) => typeof r != "string"))
979
1040
  throw new TypeError(`${e.name || "Component"}.liveProps must be an array`);
980
- const r = new Set(n);
981
- for (const [i, s] of Object.entries(t))
982
- if (v(s) && !r.has(i))
1041
+ const i = new Set(n);
1042
+ for (const [r, s] of Object.entries(t))
1043
+ if (E(s) && !i.has(r))
983
1044
  throw new TypeError(
984
- `${e.name || "Component"} prop "${i}" does not support live()`
1045
+ `${e.name || "Component"} prop "${r}" does not support live()`
985
1046
  );
986
1047
  }
987
- function qe(e) {
988
- q(e.liveProps, e.sourceProps, (t, n) => {
989
- e.props = { ...e.props, [t]: n }, U(e);
990
- }), e.props = B(e.liveProps, e.sourceProps);
991
- }
992
- function Be(e, t) {
993
- e.sourceProps = t, q(e.liveProps, t, (n, r) => {
994
- e.props = { ...e.props, [n]: r }, U(e);
995
- }), e.props = B(e.liveProps, t), U(e);
996
- }
997
- function U(e) {
998
- const t = R(e.type(e.props));
999
- e.child = F(e.child, t, e.owner);
1000
- }
1001
- function q(e, t, n) {
1002
- for (const [r, i] of e) {
1003
- const s = t[r];
1004
- v(s) && s.emitter === i.source || (i.unsubscribe(), e.delete(r));
1005
- }
1006
- for (const [r, i] of Object.entries(t)) {
1007
- if (!v(i) || e.has(r)) continue;
1008
- const s = {
1009
- source: i.emitter,
1010
- value: i.emitter.get(),
1048
+ function Xe(e) {
1049
+ H(e.liveProps, e.sourceProps, e.owner, e.type.diagnosticLabel ?? e.type.name, (t, n) => {
1050
+ e.props = { ...e.props, [t]: n }, q(e);
1051
+ }), e.props = W(e.liveProps, e.sourceProps);
1052
+ }
1053
+ function et(e, t) {
1054
+ e.sourceProps = t, H(e.liveProps, t, e.owner, e.type.diagnosticLabel ?? e.type.name, (n, i) => {
1055
+ e.props = { ...e.props, [n]: i }, q(e);
1056
+ }), e.props = W(e.liveProps, t), q(e);
1057
+ }
1058
+ function q(e) {
1059
+ ye(e.diagnosticSubject, () => {
1060
+ const t = L(e.type(e.props));
1061
+ e.child = D(e.child, t, e.owner);
1062
+ });
1063
+ }
1064
+ function ye(e, t) {
1065
+ if (!e) return t();
1066
+ const n = u.event(e, "consumer", { cause: "function component render", outcome: "started" });
1067
+ try {
1068
+ const i = n ? u.withEvent(n, t) : t();
1069
+ return n && u.event(e, "consumer", { parent: n, cause: "function component rendered", outcome: "succeeded" }), i;
1070
+ } catch (i) {
1071
+ throw n && u.event(e, "consumer", { parent: n, cause: "function component failed", outcome: "failed", error: i }), i;
1072
+ }
1073
+ }
1074
+ function H(e, t, n, i, r) {
1075
+ for (const [s, o] of e) {
1076
+ const a = t[s];
1077
+ E(a) && a.emitter === o.source || (o.unsubscribe(), e.delete(s));
1078
+ }
1079
+ for (const [s, o] of Object.entries(t)) {
1080
+ if (!E(o) || e.has(s)) continue;
1081
+ const a = {
1082
+ source: o.emitter,
1083
+ value: o.emitter.get(),
1011
1084
  unsubscribe: () => {
1012
1085
  }
1013
1086
  };
1014
- s.unsubscribe = i.emitter.subscribe(({ value: o }) => {
1015
- e.get(r) === s && (s.value = o, n(r, o));
1016
- }, { emitCurrent: !1 }), e.set(r, s);
1087
+ a.unsubscribe = N(o.emitter, a, n, `${i}.${s}`, (l) => {
1088
+ e.get(s) === a && (a.value = l, r(s, l));
1089
+ }), e.set(s, a);
1017
1090
  }
1018
1091
  }
1019
- function B(e, t) {
1020
- return Object.fromEntries(Object.entries(t).map(([n, r]) => {
1021
- var i;
1092
+ function W(e, t) {
1093
+ return Object.fromEntries(Object.entries(t).map(([n, i]) => {
1094
+ var r;
1022
1095
  return [
1023
1096
  n,
1024
- v(r) ? ((i = e.get(n)) == null ? void 0 : i.value) ?? r.emitter.get() : r
1097
+ E(i) ? ((r = e.get(n)) == null ? void 0 : r.value) ?? i.emitter.get() : i
1025
1098
  ];
1026
1099
  }));
1027
1100
  }
1028
- function z(e, t, n, r, i = null, s = null) {
1101
+ function z(e, t, n, i, r = null, s = null) {
1029
1102
  if (e == null) throw new Error("Cannot patch a detached fragment range");
1030
- const o = ae(n), a = /* @__PURE__ */ new Map(), c = [];
1031
- for (const f of t)
1032
- f.key == null ? c.push(f) : a.has(f.key) || a.set(f.key, f);
1033
- const u = /* @__PURE__ */ new Set(), p = /* @__PURE__ */ new Set(), b = [];
1034
- let be = 0;
1035
- for (const f of o) {
1036
- const d = C(f);
1037
- if (d != null) {
1038
- if (u.has(d)) throw new Error(`Duplicate sibling key: ${String(d)}`);
1039
- u.add(d);
1103
+ const o = he(n), a = /* @__PURE__ */ new Map(), l = [];
1104
+ for (const d of t)
1105
+ d.key == null ? l.push(d) : a.has(d.key) || a.set(d.key, d);
1106
+ const f = /* @__PURE__ */ new Set(), p = /* @__PURE__ */ new Set(), y = [];
1107
+ let Oe = 0;
1108
+ for (const d of o) {
1109
+ const m = R(d);
1110
+ if (m != null) {
1111
+ if (f.has(m)) throw new Error(`Duplicate sibling key: ${String(m)}`);
1112
+ f.add(m);
1040
1113
  }
1041
- const L = d == null ? c[be++] : a.get(d);
1042
- L && he(L, f) ? (p.add(L), b.push(le(L, f, r))) : b.push(O(f, r));
1043
- }
1044
- for (const f of t)
1045
- p.has(f) || g(f, !0);
1046
- let E = s ? s.nextSibling : e.firstChild;
1047
- for (const f of b)
1048
- for (const d of w(f))
1049
- d === E ? E = E.nextSibling : (e.insertBefore(d, E ?? i), E = d.nextSibling);
1050
- return b;
1051
- }
1052
- function fe(e, t) {
1114
+ const j = m == null ? l[Oe++] : a.get(m);
1115
+ j && Ce(j, d) ? (p.add(j), y.push(me(j, d, i))) : y.push(O(d, i));
1116
+ }
1117
+ for (const d of t)
1118
+ p.has(d) || w(d, !0);
1119
+ let C = s ? s.nextSibling : e.firstChild;
1120
+ for (const d of y)
1121
+ for (const m of S(d))
1122
+ m === C ? C = C.nextSibling : (e.insertBefore(m, C ?? r), C = m.nextSibling);
1123
+ return y;
1124
+ }
1125
+ function we(e, t) {
1053
1126
  const n = Object.fromEntries(Object.entries(t).filter(
1054
- ([s]) => s !== "children" && j(s) !== W
1055
- )), r = e.props, i = /* @__PURE__ */ new Set([...Object.keys(r), ...Object.keys(n)]);
1127
+ ([s]) => s !== "children" && A(s) !== Q
1128
+ )), i = e.props, r = /* @__PURE__ */ new Set([...Object.keys(i), ...Object.keys(n)]);
1056
1129
  for (const s of ["value", "checked"])
1057
1130
  if (Object.hasOwn(n, s) && Object.hasOwn(n, `bind:${s}`))
1058
1131
  throw new Error(`${s} and bind:${s} cannot be used together`);
1059
- for (const s of i) {
1060
- const o = r[s], a = n[s];
1061
- if (Je(s))
1062
- He(e, s, a);
1132
+ for (const s of r) {
1133
+ const o = i[s], a = n[s];
1134
+ if (ct(s))
1135
+ nt(e, s, a);
1063
1136
  else if (s === "ref")
1064
- o !== a && Ke(e, a);
1065
- else if (Ge(s))
1066
- De(e, s, a);
1067
- else if (v(a))
1068
- Ve(e, s, a);
1137
+ o !== a && rt(e, a);
1138
+ else if (lt(s))
1139
+ it(e, s, a);
1140
+ else if (E(a))
1141
+ tt(e, s, a);
1069
1142
  else {
1070
- const c = e.liveProps.get(s);
1071
- c && (c.unsubscribe(), e.liveProps.delete(s));
1072
- const u = (c == null ? void 0 : c.value) ?? o;
1073
- Object.is(u, a) || S(e.node, s, u, a);
1143
+ const l = e.liveProps.get(s);
1144
+ l && (l.unsubscribe(), e.liveProps.delete(s));
1145
+ const f = (l == null ? void 0 : l.value) ?? o;
1146
+ Object.is(f, a) || v(e.node, s, f, a);
1074
1147
  }
1075
1148
  }
1076
- e.node.setAttribute(W, ""), e.props = { ...n };
1149
+ e.node.setAttribute(Q, ""), e.props = { ...n };
1077
1150
  }
1078
- function Ve(e, t, n) {
1079
- const r = e.liveProps.get(t);
1080
- if ((r == null ? void 0 : r.source) === n.emitter) return;
1081
- r == null || r.unsubscribe();
1082
- const i = n.emitter.get();
1083
- S(e.node, t, (r == null ? void 0 : r.value) ?? e.props[t], i);
1151
+ function tt(e, t, n) {
1152
+ const i = e.liveProps.get(t);
1153
+ if ((i == null ? void 0 : i.source) === n.emitter) return;
1154
+ i == null || i.unsubscribe();
1155
+ const r = n.emitter.get();
1156
+ v(e.node, t, (i == null ? void 0 : i.value) ?? e.props[t], r);
1084
1157
  const s = {
1085
1158
  source: n.emitter,
1086
- value: i,
1159
+ value: r,
1087
1160
  unsubscribe: () => {
1088
1161
  }
1089
1162
  };
1090
- s.unsubscribe = n.emitter.subscribe(({ value: o }) => {
1163
+ s.unsubscribe = N(n.emitter, s, e.owner, `${e.type}.${t}`, (o) => {
1091
1164
  const a = s.value;
1092
- s.value = o, Object.is(a, o) || S(e.node, t, a, o);
1093
- }, { emitCurrent: !1 }), e.liveProps.set(t, s);
1165
+ s.value = o, Object.is(a, o) || v(e.node, t, a, o);
1166
+ }), e.liveProps.set(t, s);
1094
1167
  }
1095
- function He(e, t, n) {
1096
- const r = t.slice(5), i = e.nativeBindings.get(t);
1168
+ function nt(e, t, n) {
1169
+ const i = t.slice(5), r = e.nativeBindings.get(t);
1097
1170
  if (n == null) {
1098
- i && (i.unsubscribe(), e.node.removeEventListener(i.eventName, i.listener), e.nativeBindings.delete(t), S(e.node, r, i.value, void 0));
1171
+ r && (r.unsubscribe(), e.node.removeEventListener(r.eventName, r.listener), e.nativeBindings.delete(t), v(e.node, i, r.value, void 0));
1099
1172
  return;
1100
1173
  }
1101
- if (Qe(n, t), (i == null ? void 0 : i.source) === n) return;
1102
- i && (i.unsubscribe(), e.node.removeEventListener(i.eventName, i.listener)), Xe(e.node, r);
1103
- const s = et(e.node, r), o = n.get();
1104
- S(e.node, r, i == null ? void 0 : i.value, o);
1105
- const a = () => {
1106
- n.set(Reflect.get(e.node, r), `${t} changed`);
1107
- }, c = {
1174
+ if (ut(n, t), (r == null ? void 0 : r.source) === n) return;
1175
+ r && (r.unsubscribe(), e.node.removeEventListener(r.eventName, r.listener)), ft(e.node, i);
1176
+ const s = pt(e.node, i), o = n.get();
1177
+ v(e.node, i, r == null ? void 0 : r.value, o);
1178
+ const a = (f) => {
1179
+ K(
1180
+ Se(e, s),
1181
+ e.owner.diagnosticScope,
1182
+ f,
1183
+ a,
1184
+ `${t} changed`,
1185
+ () => n.set(Reflect.get(e.node, i), `${t} changed`)
1186
+ );
1187
+ }, l = {
1108
1188
  source: n,
1109
1189
  value: o,
1110
1190
  eventName: s,
@@ -1112,73 +1192,142 @@ function He(e, t, n) {
1112
1192
  unsubscribe: () => {
1113
1193
  }
1114
1194
  };
1115
- c.unsubscribe = n.subscribe(({ value: u }) => {
1116
- const p = c.value;
1117
- c.value = u, Object.is(p, u) || S(e.node, r, p, u);
1118
- }, { emitCurrent: !1 }), e.node.addEventListener(s, a), e.nativeBindings.set(t, c);
1119
- }
1120
- function De(e, t, n) {
1121
- const r = t.slice(2).toLowerCase(), i = e.listeners.get(t);
1122
- if (i && i !== n && (e.node.removeEventListener(r, i), e.listeners.delete(t)), n != null && typeof n != "function")
1195
+ l.unsubscribe = N(n, l, e.owner, `${e.type}.${t}`, (f) => {
1196
+ const p = l.value;
1197
+ l.value = f, Object.is(p, f) || v(e.node, i, p, f);
1198
+ }), e.node.addEventListener(s, a), e.nativeBindings.set(t, l);
1199
+ }
1200
+ function it(e, t, n) {
1201
+ const i = t.slice(2).toLowerCase(), r = e.listeners.get(t), s = r ? te.get(r) ?? r : null;
1202
+ if (r && s !== n && (e.node.removeEventListener(i, r), e.listeners.delete(t)), n != null && typeof n != "function")
1123
1203
  throw new TypeError(`${t} must be a function or null`);
1124
- if (typeof n == "function" && i !== n) {
1125
- const s = n;
1126
- e.node.addEventListener(r, s), e.listeners.set(t, s);
1127
- }
1204
+ if (typeof n == "function" && s !== n) {
1205
+ const o = (a) => K(
1206
+ Se(e, i),
1207
+ e.owner.diagnosticScope,
1208
+ a,
1209
+ o,
1210
+ i,
1211
+ () => n.call(e.node, a)
1212
+ );
1213
+ te.set(o, n), e.node.addEventListener(i, o), e.listeners.set(t, o);
1214
+ }
1215
+ }
1216
+ const ee = /* @__PURE__ */ new WeakMap(), te = /* @__PURE__ */ new WeakMap(), M = /* @__PURE__ */ new WeakMap();
1217
+ function K(e, t, n, i, r, s) {
1218
+ return u.withScope(t, () => {
1219
+ if (!u.active) return s();
1220
+ let o = M.get(n);
1221
+ return (!o || o.listeners.has(i)) && (o = { event: u.event(e, "interaction", { cause: r, outcome: "started" }), listeners: /* @__PURE__ */ new Set() }, M.set(n, o), queueMicrotask(() => M.delete(n))), o.listeners.add(i), u.withEvent(o.event, s);
1222
+ });
1223
+ }
1224
+ function Se(e, t) {
1225
+ var r;
1226
+ let n = ee.get(e);
1227
+ n || (n = /* @__PURE__ */ new Map(), ee.set(e, n));
1228
+ let i = n.get(t);
1229
+ if (!i) {
1230
+ i = {};
1231
+ const s = e.node.getAttribute("aria-label") ?? e.node.getAttribute("name") ?? ((r = e.node.textContent) == null ? void 0 : r.trim().slice(0, 80)) ?? "";
1232
+ u.configure(i, {
1233
+ kind: "interaction",
1234
+ label: `${T(e.owner)}: ${e.type} ${s} ${t}`.trim(),
1235
+ scope: e.owner.diagnosticScope
1236
+ }), n.set(t, i);
1237
+ }
1238
+ return i;
1239
+ }
1240
+ function N(e, t, n, i, r) {
1241
+ u.configure(t, {
1242
+ kind: "binding",
1243
+ label: `${T(n)}: ${i}`,
1244
+ scope: n.diagnosticScope,
1245
+ sources: [e]
1246
+ });
1247
+ const s = e.subscribe(({ value: o, event: a }) => {
1248
+ const l = u.event(t, "consumer", {
1249
+ parent: a,
1250
+ cause: "binding update",
1251
+ value: o,
1252
+ outcome: "started"
1253
+ });
1254
+ try {
1255
+ u.withEvent(l, () => r(o)), l && u.event(t, "consumer", {
1256
+ parent: l,
1257
+ cause: "binding updated",
1258
+ value: o,
1259
+ outcome: "succeeded"
1260
+ });
1261
+ } catch (f) {
1262
+ throw l && u.event(t, "consumer", {
1263
+ parent: l,
1264
+ cause: "binding update failed",
1265
+ outcome: "failed",
1266
+ error: f
1267
+ }), f;
1268
+ }
1269
+ }, { emitCurrent: !1, diagnosticTarget: t });
1270
+ return () => {
1271
+ s(), u.dispose(t);
1272
+ };
1273
+ }
1274
+ function T(e) {
1275
+ const t = e.constructor;
1276
+ return t.diagnosticLabel ?? t.hostName ?? t.name;
1128
1277
  }
1129
- function Ke(e, t) {
1130
- if (x(e.ref, null), t != null && typeof t != "function" && typeof t != "object")
1278
+ function rt(e, t) {
1279
+ if (B(e.ref, null), t != null && typeof t != "function" && typeof t != "object")
1131
1280
  throw new TypeError("ref must be a function, object, or null");
1132
- e.ref = t, x(e.ref, e.node);
1281
+ e.ref = t, B(e.ref, e.node);
1133
1282
  }
1134
- function S(e, t, n, r) {
1283
+ function v(e, t, n, i) {
1135
1284
  if (t === "class" || t === "className") {
1136
- $(e, "class", r);
1285
+ U(e, "class", i);
1137
1286
  return;
1138
1287
  }
1139
1288
  if (t === "for" || t === "htmlFor") {
1140
- $(e, "for", r);
1289
+ U(e, "for", i);
1141
1290
  return;
1142
1291
  }
1143
1292
  if (t === "dataset") {
1144
- We(e, n, r);
1293
+ st(e, n, i);
1145
1294
  return;
1146
1295
  }
1147
1296
  if (t === "style") {
1148
- Ye(e, n, r);
1297
+ ot(e, n, i);
1149
1298
  return;
1150
1299
  }
1151
1300
  if (t === "dangerouslySetInnerHTML")
1152
1301
  throw new Error("dangerouslySetInnerHTML is not supported");
1153
- const i = Ze(t);
1154
- if (Ue.has(i)) {
1155
- const s = !!r;
1156
- i in e && Reflect.set(e, i, s), e.toggleAttribute(j(t), s);
1302
+ const r = at(t);
1303
+ if (Ze.has(r)) {
1304
+ const s = !!i;
1305
+ r in e && Reflect.set(e, r, s), e.toggleAttribute(A(t), s);
1157
1306
  return;
1158
1307
  }
1159
- if (xe.has(i) && i in e) {
1160
- const s = r ?? (i === "value" ? "" : !1);
1161
- Object.is(Reflect.get(e, i), s) || Reflect.set(e, i, s), r == null && e.removeAttribute(j(t));
1308
+ if (Ge.has(r) && r in e) {
1309
+ const s = i ?? (r === "value" ? "" : !1);
1310
+ Object.is(Reflect.get(e, r), s) || Reflect.set(e, r, s), i == null && e.removeAttribute(A(t));
1162
1311
  return;
1163
1312
  }
1164
- $(e, j(t), r);
1313
+ U(e, A(t), i);
1165
1314
  }
1166
- function We(e, t, n) {
1167
- const r = _(t, "dataset"), i = _(n, "dataset");
1168
- for (const s of /* @__PURE__ */ new Set([...Object.keys(r), ...Object.keys(i)])) {
1169
- const o = i[s];
1315
+ function st(e, t, n) {
1316
+ const i = _(t, "dataset"), r = _(n, "dataset");
1317
+ for (const s of /* @__PURE__ */ new Set([...Object.keys(i), ...Object.keys(r)])) {
1318
+ const o = r[s];
1170
1319
  o == null ? delete e.dataset[s] : e.dataset[s] = String(o);
1171
1320
  }
1172
1321
  }
1173
- function Ye(e, t, n) {
1322
+ function ot(e, t, n) {
1174
1323
  if (typeof n == "string") {
1175
1324
  e.style.cssText = n;
1176
1325
  return;
1177
1326
  }
1178
- const r = typeof t == "string" ? {} : _(t, "style"), i = _(n, "style");
1327
+ const i = typeof t == "string" ? {} : _(t, "style"), r = _(n, "style");
1179
1328
  typeof t == "string" && (e.style.cssText = "");
1180
- for (const s of /* @__PURE__ */ new Set([...Object.keys(r), ...Object.keys(i)])) {
1181
- const o = i[s];
1329
+ for (const s of /* @__PURE__ */ new Set([...Object.keys(i), ...Object.keys(r)])) {
1330
+ const o = r[s];
1182
1331
  s.startsWith("--") ? o == null ? e.style.removeProperty(s) : e.style.setProperty(s, String(o)) : Reflect.set(e.style, s, o == null ? "" : String(o));
1183
1332
  }
1184
1333
  }
@@ -1188,25 +1337,25 @@ function _(e, t) {
1188
1337
  throw new TypeError(`${t} must be an object or null`);
1189
1338
  return e;
1190
1339
  }
1191
- function $(e, t, n) {
1340
+ function U(e, t, n) {
1192
1341
  n == null || n === !1 ? e.removeAttribute(t) : n === !0 ? e.setAttribute(t, "") : e.setAttribute(t, String(n));
1193
1342
  }
1194
- function Ze(e) {
1343
+ function at(e) {
1195
1344
  return e === "readonly" ? "readOnly" : e === "autofocus" ? "autoFocus" : e;
1196
1345
  }
1197
- function j(e) {
1198
- return e === "className" ? "class" : e === "htmlFor" ? "for" : e === "minLength" ? "minlength" : e === "maxLength" ? "maxlength" : e === "autoComplete" ? "autocomplete" : e === "inputMode" ? "inputmode" : /^aria[A-Z]/.test(e) || /^data[A-Z]/.test(e) ? Z(e) : e.replace(/[A-Z]/g, (t) => `-${t.toLowerCase()}`);
1346
+ function A(e) {
1347
+ return e === "className" ? "class" : e === "htmlFor" ? "for" : e === "minLength" ? "minlength" : e === "maxLength" ? "maxlength" : e === "autoComplete" ? "autocomplete" : e === "inputMode" ? "inputmode" : /^aria[A-Z]/.test(e) || /^data[A-Z]/.test(e) ? ne(e) : e.replace(/[A-Z]/g, (t) => `-${t.toLowerCase()}`);
1199
1348
  }
1200
- function Z(e) {
1349
+ function ne(e) {
1201
1350
  return e.replace(/[A-Z]/g, (t) => `-${t.toLowerCase()}`);
1202
1351
  }
1203
- function x(e, t) {
1352
+ function B(e, t) {
1204
1353
  e != null && (typeof e == "function" ? e(t) : e.current = t);
1205
1354
  }
1206
- function g(e, t) {
1355
+ function w(e, t) {
1207
1356
  if (e.kind === "emitter") {
1208
- if (e.unsubscribe(), g(e.child, !1), t)
1209
- for (const n of w(e)) n.remove();
1357
+ if (e.unsubscribe(), w(e.child, !1), t)
1358
+ for (const n of S(e)) n.remove();
1210
1359
  return;
1211
1360
  }
1212
1361
  if (e.kind === "component") {
@@ -1216,147 +1365,147 @@ function g(e, t) {
1216
1365
  }
1217
1366
  if (e.kind === "function") {
1218
1367
  for (const n of e.liveProps.values()) n.unsubscribe();
1219
- e.liveProps.clear(), g(e.child, t);
1368
+ e.liveProps.clear(), e.diagnosticSubject && u.dispose(e.diagnosticSubject), w(e.child, t);
1220
1369
  return;
1221
1370
  }
1222
1371
  if (e.kind === "element") {
1223
- x(e.ref, null);
1224
- for (const [n, r] of e.listeners)
1225
- e.node.removeEventListener(n.slice(2).toLowerCase(), r);
1372
+ B(e.ref, null);
1373
+ for (const [n, i] of e.listeners)
1374
+ e.node.removeEventListener(n.slice(2).toLowerCase(), i);
1226
1375
  e.listeners.clear();
1227
1376
  for (const n of e.liveProps.values()) n.unsubscribe();
1228
1377
  e.liveProps.clear();
1229
1378
  for (const n of e.nativeBindings.values())
1230
1379
  n.unsubscribe(), e.node.removeEventListener(n.eventName, n.listener);
1231
1380
  e.nativeBindings.clear();
1232
- for (const n of e.children) g(n, !1);
1381
+ for (const n of e.children) w(n, !1);
1233
1382
  t && e.node.remove();
1234
1383
  return;
1235
1384
  }
1236
1385
  if (e.kind === "fragment") {
1237
- for (const n of e.children) g(n, !1);
1386
+ for (const n of e.children) w(n, !1);
1238
1387
  if (t)
1239
- for (const n of w(e)) n.remove();
1388
+ for (const n of S(e)) n.remove();
1240
1389
  return;
1241
1390
  }
1242
1391
  t && e.node.remove();
1243
1392
  }
1244
- function V(e, t, n = null) {
1393
+ function Y(e, t, n = null) {
1245
1394
  if (t != null)
1246
- for (const r of w(t)) e.insertBefore(r, n);
1395
+ for (const i of S(t)) e.insertBefore(i, n);
1247
1396
  }
1248
- function w(e) {
1397
+ function S(e) {
1249
1398
  if (e == null) return [];
1250
1399
  if (e.kind === "text" || e.kind === "element") return [e.node];
1251
- if (e.kind === "component") return w(e.instance._rendered);
1252
- if (e.kind === "function") return w(e.child);
1400
+ if (e.kind === "component") return S(e.instance._rendered);
1401
+ if (e.kind === "function") return S(e.child);
1253
1402
  const t = [];
1254
1403
  let n = e.start;
1255
1404
  for (; n && (t.push(n), n !== e.end); )
1256
1405
  n = n.nextSibling;
1257
1406
  return t;
1258
1407
  }
1259
- function pe(e) {
1260
- return w(e)[0] ?? null;
1408
+ function ve(e) {
1409
+ return S(e)[0] ?? null;
1261
1410
  }
1262
- function C(e) {
1263
- return e instanceof m ? de(e.props) : y(e) ? e.key : null;
1411
+ function R(e) {
1412
+ return e instanceof b ? Ee(e.props) : g(e) ? e.key : null;
1264
1413
  }
1265
- function de(e) {
1414
+ function Ee(e) {
1266
1415
  const t = e.key;
1267
1416
  return typeof t == "string" || typeof t == "number" ? t : null;
1268
1417
  }
1269
- function he(e, t) {
1270
- return e.kind === "text" ? typeof t == "string" || typeof t == "number" : e.kind === "emitter" ? k(t) && e.source === t : e.kind === "component" ? t instanceof m ? e.instance === t : y(t) && me(t.type) && e.type === t.type && e.key === C(t) : e.kind === "function" ? y(t) && e.type === t.type && e.key === C(t) : e.kind === "fragment" ? y(t) && t.type === P && e.key === C(t) : y(t) && typeof t.type == "string" && e.type === t.type && e.key === C(t);
1418
+ function Ce(e, t) {
1419
+ return e.kind === "text" ? typeof t == "string" || typeof t == "number" : e.kind === "emitter" ? I(t) && e.source === t : e.kind === "component" ? t instanceof b ? e.instance === t : g(t) && Re(t.type) && e.type === t.type && e.key === R(t) : e.kind === "function" ? g(t) && e.type === t.type && e.key === R(t) : e.kind === "fragment" ? g(t) && t.type === $ && e.key === R(t) : g(t) && typeof t.type == "string" && e.type === t.type && e.key === R(t);
1271
1420
  }
1272
- function y(e) {
1421
+ function g(e) {
1273
1422
  return e != null && typeof e == "object" && Object.hasOwn(e, "type");
1274
1423
  }
1275
- function me(e) {
1276
- return typeof e == "function" && (e === m || e.prototype instanceof m);
1424
+ function Re(e) {
1425
+ return typeof e == "function" && (e === b || e.prototype instanceof b);
1277
1426
  }
1278
- function Ge(e) {
1427
+ function lt(e) {
1279
1428
  return /^on[A-Z]/.test(e);
1280
1429
  }
1281
- function Je(e) {
1430
+ function ct(e) {
1282
1431
  return e === "bind:value" || e === "bind:checked";
1283
1432
  }
1284
- function v(e) {
1285
- return e != null && typeof e == "object" && oe.has(e);
1433
+ function E(e) {
1434
+ return e != null && typeof e == "object" && de.has(e);
1286
1435
  }
1287
- function k(e) {
1436
+ function I(e) {
1288
1437
  return (typeof e != "object" || e == null) && typeof e != "function" ? !1 : typeof Reflect.get(e, "get") == "function" && typeof Reflect.get(e, "getFetchState") == "function" && typeof Reflect.get(e, "getError") == "function" && typeof Reflect.get(e, "subscribe") == "function";
1289
1438
  }
1290
- function H(e, t) {
1291
- if (!k(e)) throw new TypeError(`${t} requires a readable emitter`);
1439
+ function Z(e, t) {
1440
+ if (!I(e)) throw new TypeError(`${t} requires a readable emitter`);
1292
1441
  }
1293
- function Qe(e, t) {
1294
- if (H(e, t), typeof Reflect.get(e, "set") != "function")
1442
+ function ut(e, t) {
1443
+ if (Z(e, t), typeof Reflect.get(e, "set") != "function")
1295
1444
  throw new TypeError(`${t} requires a writable emitter`);
1296
1445
  }
1297
- function Xe(e, t) {
1446
+ function ft(e, t) {
1298
1447
  const n = e.localName;
1299
1448
  if (!(t === "checked" ? n === "input" : n === "input" || n === "textarea" || n === "select")) throw new TypeError(`bind:${t} is not supported on ${n}`);
1300
1449
  }
1301
- function et(e, t) {
1450
+ function pt(e, t) {
1302
1451
  return t === "value" && e.localName !== "select" ? "input" : "change";
1303
1452
  }
1304
- function tt(e) {
1453
+ function dt(e) {
1305
1454
  if (e == null || typeof e != "object" && typeof e != "function" || typeof Reflect.get(e, "insertBefore") != "function")
1306
1455
  throw new TypeError("Component parent must be a DOM ParentNode");
1307
1456
  }
1308
- function G(e) {
1457
+ function ie(e) {
1309
1458
  try {
1310
1459
  return String(e);
1311
1460
  } catch {
1312
1461
  return Object.prototype.toString.call(e);
1313
1462
  }
1314
1463
  }
1315
- function nt(e) {
1464
+ function ht(e) {
1316
1465
  const t = [];
1317
1466
  let n = e;
1318
- for (; n != null && typeof n == "function" && (t.unshift(n), n !== m); )
1467
+ for (; n != null && typeof n == "function" && (t.unshift(n), n !== b); )
1319
1468
  n = Object.getPrototypeOf(n);
1320
1469
  return t;
1321
1470
  }
1322
- function rt(...e) {
1471
+ function mt(...e) {
1323
1472
  return [...new Set(e.flatMap((t) => typeof t == "string" ? t.split(/\s+/) : []).filter(Boolean))].join(" ");
1324
1473
  }
1325
- function N(e) {
1474
+ function F(e) {
1326
1475
  if (e.island === !0) return !0;
1327
1476
  const t = e.className ?? e.class;
1328
1477
  return typeof t == "string" && t.split(/\s+/).includes("island");
1329
1478
  }
1330
- function ye(e, t, n) {
1331
- const r = t == null ? {} : { ...t };
1332
- return n !== void 0 && (r.key = n), A(e, r);
1479
+ function Le(e, t, n) {
1480
+ const i = t == null ? {} : { ...t };
1481
+ return n !== void 0 && (i.key = n), k(e, i);
1333
1482
  }
1334
- const ct = ye, ut = ye;
1335
- function ft(e) {
1336
- if (!(e instanceof m))
1483
+ const Et = Le, Ct = Le;
1484
+ function Rt(e) {
1485
+ if (!(e instanceof b))
1337
1486
  throw new TypeError("createPrebuiltElement requires a Component instance");
1338
1487
  return e;
1339
1488
  }
1340
1489
  export {
1341
- m as C,
1342
- P as F,
1343
- re as S,
1344
- ct as a,
1345
- M as b,
1346
- Me as c,
1347
- J as d,
1348
- at as e,
1349
- je as f,
1350
- ve as g,
1351
- A as h,
1352
- y as i,
1353
- ye as j,
1354
- K as k,
1355
- st as l,
1356
- ut as m,
1357
- lt as n,
1358
- ft as o,
1359
- ot as p,
1360
- Ee as s
1490
+ b as C,
1491
+ $ as F,
1492
+ ue as S,
1493
+ Le as a,
1494
+ Et as b,
1495
+ Je as c,
1496
+ V as d,
1497
+ re as e,
1498
+ St as f,
1499
+ xe as g,
1500
+ k as h,
1501
+ g as i,
1502
+ Ct as j,
1503
+ ze as k,
1504
+ J as l,
1505
+ yt as m,
1506
+ vt as n,
1507
+ Rt as o,
1508
+ wt as p,
1509
+ _e as s
1361
1510
  };
1362
- //# sourceMappingURL=jsx-dev-runtime-D3UnwrKT.js.map
1511
+ //# sourceMappingURL=jsx-runtime-BD_q3rPg.js.map