@jasonshimmy/custom-elements-runtime 0.2.7 → 0.3.1

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,13 +1,13 @@
1
- function xt(e, t) {
2
- return fe(e ? t : [], "when-block");
1
+ function we(e, t) {
2
+ return O(e ? t : [], "when-block");
3
3
  }
4
- function kt(e, t) {
4
+ function Ot(e, t) {
5
5
  return e.map((r, i) => {
6
6
  const n = typeof r == "object" ? r?.key ?? r?.id ?? `idx-${i}` : String(r);
7
- return fe(t(r, i), `each-${n}`);
7
+ return O(t(r, i), `each-${n}`);
8
8
  });
9
9
  }
10
- function Pe() {
10
+ function Ke() {
11
11
  const e = [];
12
12
  return {
13
13
  when(t, r) {
@@ -17,18 +17,18 @@ function Pe() {
17
17
  return e.push([!0, t]), this;
18
18
  },
19
19
  done() {
20
- return Ne(...e);
20
+ return Je(...e);
21
21
  }
22
22
  };
23
23
  }
24
- function Ne(...e) {
24
+ function Je(...e) {
25
25
  for (let t = 0; t < e.length; t++) {
26
26
  const [r, i] = e[t];
27
- if (r) return [fe(i, `whenChain-branch-${t}`)];
27
+ if (r) return [O(i, `whenChain-branch-${t}`)];
28
28
  }
29
- return [fe([], "whenChain-empty")];
29
+ return [O([], "whenChain-empty")];
30
30
  }
31
- function fe(e, t) {
31
+ function O(e, t) {
32
32
  const r = e ? Array.isArray(e) ? e.filter(Boolean) : [e].filter(Boolean) : [];
33
33
  return {
34
34
  tag: "#anchor",
@@ -36,7 +36,131 @@ function fe(e, t) {
36
36
  children: r
37
37
  };
38
38
  }
39
- class G extends EventTarget {
39
+ function Pt(e, t) {
40
+ return we(!e, t);
41
+ }
42
+ function Mt(e, t) {
43
+ const r = !e || e.length === 0;
44
+ return we(r, t);
45
+ }
46
+ function Bt(e, t) {
47
+ const r = !!(e && e.length > 0);
48
+ return we(r, t);
49
+ }
50
+ function Wt(e, t, r) {
51
+ const i = [];
52
+ return e.forEach((n, s) => {
53
+ t(n, s) && i.push({ item: n, originalIndex: s });
54
+ }), i.map(({ item: n, originalIndex: s }, o) => {
55
+ const a = typeof n == "object" && n != null ? n?.key ?? n?.id ?? `filtered-${s}` : `filtered-${s}`;
56
+ return O(r(n, s, o), `each-where-${a}`);
57
+ });
58
+ }
59
+ function It(e, t) {
60
+ const r = e?.length ?? 0;
61
+ return r === 0 && t.empty ? O(t.empty, "switch-length-empty") : r === 1 && t.one ? O(t.one(e[0]), "switch-length-one") : t.exactly?.[r] ? O(t.exactly[r](e), `switch-length-${r}`) : r > 1 && t.many ? O(t.many(e), "switch-length-many") : O([], "switch-length-fallback");
62
+ }
63
+ function qt(e, t, r) {
64
+ const i = /* @__PURE__ */ new Map();
65
+ return e.forEach((n) => {
66
+ const s = t(n);
67
+ i.has(s) || i.set(s, []), i.get(s).push(n);
68
+ }), Array.from(i.entries()).map(([n, s], o) => O(
69
+ r(n, s, o),
70
+ `each-group-${n}`
71
+ ));
72
+ }
73
+ function zt(e, t, r, i) {
74
+ const n = r * t, s = Math.min(n + t, e.length);
75
+ return e.slice(n, s).map((a, c) => {
76
+ const u = n + c, m = typeof a == "object" && a != null ? a?.key ?? a?.id ?? `page-${u}` : `page-${u}`;
77
+ return O(i(a, u, c), `each-page-${m}`);
78
+ });
79
+ }
80
+ function Ht(e, t) {
81
+ return e.loading && t.loading ? O(t.loading, "promise-loading") : e.error && t.error ? O(t.error(e.error), "promise-error") : e.data !== void 0 && t.success ? O(t.success(e.data), "promise-success") : t.idle ? O(t.idle, "promise-idle") : O([], "promise-fallback");
82
+ }
83
+ function q(e, t) {
84
+ const r = typeof window < "u" && window.matchMedia?.(e)?.matches;
85
+ return we(!!r, t);
86
+ }
87
+ const G = {
88
+ // Responsive breakpoints (matching style.ts)
89
+ sm: "(min-width:640px)",
90
+ md: "(min-width:768px)",
91
+ lg: "(min-width:1024px)",
92
+ xl: "(min-width:1280px)",
93
+ "2xl": "(min-width:1536px)",
94
+ // Dark mode (matching style.ts)
95
+ dark: "(prefers-color-scheme: dark)"
96
+ }, ze = ["sm", "md", "lg", "xl", "2xl"], Ve = {
97
+ // Breakpoint-based rendering (matching style.ts exactly)
98
+ sm: (e) => q(G.sm, e),
99
+ md: (e) => q(G.md, e),
100
+ lg: (e) => q(G.lg, e),
101
+ xl: (e) => q(G.xl, e),
102
+ "2xl": (e) => q(G["2xl"], e),
103
+ // Dark mode (matching style.ts)
104
+ dark: (e) => q(G.dark, e),
105
+ light: (e) => q("(prefers-color-scheme: light)", e),
106
+ // Accessibility and interaction preferences
107
+ touch: (e) => q("(hover: none) and (pointer: coarse)", e),
108
+ mouse: (e) => q("(hover: hover) and (pointer: fine)", e),
109
+ reducedMotion: (e) => q("(prefers-reduced-motion: reduce)", e),
110
+ highContrast: (e) => q("(prefers-contrast: high)", e),
111
+ // Orientation
112
+ portrait: (e) => q("(orientation: portrait)", e),
113
+ landscape: (e) => q("(orientation: landscape)", e)
114
+ };
115
+ function Nt(e, t) {
116
+ const r = [];
117
+ e.includes("dark") ? r.push(G.dark) : e.includes("light") && r.push("(prefers-color-scheme: light)");
118
+ const i = e.filter(
119
+ (o) => ze.includes(o)
120
+ ), n = i[i.length - 1];
121
+ n && n in G && r.push(G[n]);
122
+ const s = r.length > 0 ? r.join(" and ") : "all";
123
+ return q(s, t);
124
+ }
125
+ function Dt(e) {
126
+ const t = [];
127
+ return e.base && t.push(O(e.base, "responsive-base")), ze.forEach((r) => {
128
+ const i = e[r];
129
+ i && t.push(Ve[r](i));
130
+ }), t;
131
+ }
132
+ function Ut(e) {
133
+ const t = [];
134
+ let r = null;
135
+ return {
136
+ case(i, n) {
137
+ const s = typeof i == "function" ? i : (o) => o === i;
138
+ return t.push({ condition: s, content: n }), this;
139
+ },
140
+ when(i, n) {
141
+ return t.push({ condition: i, content: n }), this;
142
+ },
143
+ otherwise(i) {
144
+ return r = i, this;
145
+ },
146
+ done() {
147
+ for (let i = 0; i < t.length; i++) {
148
+ const { condition: n, content: s } = t[i];
149
+ if (n(e))
150
+ return O(s, `switch-case-${i}`);
151
+ }
152
+ return O(r || [], "switch-otherwise");
153
+ }
154
+ };
155
+ }
156
+ const He = typeof process < "u" && process.env?.NODE_ENV !== "production";
157
+ function Y(e, ...t) {
158
+ He && console.error(e, ...t);
159
+ }
160
+ function pe(e, ...t) {
161
+ He && console.warn(e, ...t);
162
+ }
163
+ class ne extends EventTarget {
40
164
  handlers = {};
41
165
  static instance;
42
166
  eventCounters = /* @__PURE__ */ new Map();
@@ -44,7 +168,7 @@ class G extends EventTarget {
44
168
  * Returns the singleton instance of GlobalEventBus
45
169
  */
46
170
  static getInstance() {
47
- return G.instance || (G.instance = new G()), G.instance;
171
+ return ne.instance || (ne.instance = new ne()), ne.instance;
48
172
  }
49
173
  /**
50
174
  * Emit a global event with optional data. Includes event storm protection.
@@ -68,7 +192,7 @@ class G extends EventTarget {
68
192
  try {
69
193
  o(r);
70
194
  } catch (a) {
71
- console.error(`Error in global event handler for "${t}":`, a);
195
+ Y(`Error in global event handler for "${t}":`, a);
72
196
  }
73
197
  });
74
198
  }
@@ -157,8 +281,8 @@ class G extends EventTarget {
157
281
  this.eventCounters.clear();
158
282
  }
159
283
  }
160
- const re = G.getInstance(), vt = (e, t) => re.emit(e, t), $t = (e, t) => re.on(e, t), _t = (e, t) => re.off(e, t), St = (e, t) => re.once(e, t), Et = (e, t, r) => re.listen(e, t, r);
161
- function $e(e) {
284
+ const le = ne.getInstance(), Ft = (e, t) => le.emit(e, t), Kt = (e, t) => le.on(e, t), Jt = (e, t) => le.off(e, t), Vt = (e, t) => le.once(e, t), Gt = (e, t, r) => le.listen(e, t, r);
285
+ function Le(e) {
162
286
  let t = { ...e };
163
287
  const r = [];
164
288
  function i(a) {
@@ -168,18 +292,18 @@ function $e(e) {
168
292
  return t;
169
293
  }
170
294
  function s(a) {
171
- const f = typeof a == "function" ? a(t) : a;
172
- t = { ...t, ...f }, o();
295
+ const c = typeof a == "function" ? a(t) : a;
296
+ t = { ...t, ...c }, o();
173
297
  }
174
298
  function o() {
175
299
  r.forEach((a) => a(t));
176
300
  }
177
301
  return { subscribe: i, getState: n, setState: s };
178
302
  }
179
- function J(e) {
303
+ function Q(e) {
180
304
  return e.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase();
181
305
  }
182
- function H(e) {
306
+ function Z(e) {
183
307
  return typeof e == "string" ? e.replace(
184
308
  /[&<>"']/g,
185
309
  (t) => ({
@@ -191,57 +315,57 @@ function H(e) {
191
315
  })[t]
192
316
  ) : e;
193
317
  }
194
- function z(e, t) {
318
+ function K(e, t) {
195
319
  return typeof t == "string" ? t.split(".").reduce((r, i) => r?.[i], e) : t;
196
320
  }
197
- function oe(e, t, r) {
321
+ function he(e, t, r) {
198
322
  const i = String(t).split("."), n = i.pop();
199
323
  if (!n) return;
200
324
  const s = i.reduce((o, a) => (o[a] == null && (o[a] = {}), o[a]), e);
201
325
  s[n] = r;
202
326
  }
203
- function ze(e, t, r) {
327
+ function Ge(e, t, r) {
204
328
  if (r)
205
329
  for (const [i, n] of Object.entries(r)) {
206
330
  let s, o = {};
207
331
  if (Array.isArray(n) ? (s = n[0], o = n[1] || {}) : s = n, t.set(i, {
208
332
  callback: s,
209
333
  options: o,
210
- oldValue: z(e, i)
334
+ oldValue: K(e, i)
211
335
  }), o.immediate)
212
336
  try {
213
- const a = z(e, i);
337
+ const a = K(e, i);
214
338
  s(a, void 0, e);
215
339
  } catch (a) {
216
- console.error(`Error in immediate watcher for "${i}":`, a);
340
+ Y(`Error in immediate watcher for "${i}":`, a);
217
341
  }
218
342
  }
219
343
  }
220
- function Me(e, t, r, i) {
344
+ function Ze(e, t, r, i) {
221
345
  const n = (o, a) => {
222
346
  if (o === a) return !0;
223
347
  if (typeof o != typeof a || typeof o != "object" || o === null || a === null) return !1;
224
348
  if (Array.isArray(o) && Array.isArray(a))
225
- return o.length !== a.length ? !1 : o.every((d, y) => n(d, a[y]));
226
- const f = Object.keys(o), u = Object.keys(a);
227
- return f.length !== u.length ? !1 : f.every((d) => n(o[d], a[d]));
349
+ return o.length !== a.length ? !1 : o.every((m, T) => n(m, a[T]));
350
+ const c = Object.keys(o), u = Object.keys(a);
351
+ return c.length !== u.length ? !1 : c.every((m) => n(o[m], a[m]));
228
352
  }, s = t.get(r);
229
353
  if (s && !n(i, s.oldValue))
230
354
  try {
231
355
  s.callback(i, s.oldValue, e), s.oldValue = i;
232
356
  } catch (o) {
233
- console.error(`Error in watcher for "${r}":`, o);
357
+ Y(`Error in watcher for "${r}":`, o);
234
358
  }
235
359
  for (const [o, a] of t.entries())
236
360
  if (a.options.deep && r.startsWith(o + "."))
237
361
  try {
238
- const f = z(e, o);
239
- n(f, a.oldValue) || (a.callback(f, a.oldValue, e), a.oldValue = f);
240
- } catch (f) {
241
- console.error(`Error in deep watcher for "${o}":`, f);
362
+ const c = K(e, o);
363
+ n(c, a.oldValue) || (a.callback(c, a.oldValue, e), a.oldValue = c);
364
+ } catch (c) {
365
+ Y(`Error in deep watcher for "${o}":`, c);
242
366
  }
243
367
  }
244
- function We(e, t, r) {
368
+ function Ye(e, t, r) {
245
369
  if (!t.props) return;
246
370
  function i(n, s) {
247
371
  return s === Boolean ? n === "true" : s === Number ? Number(n) : n;
@@ -250,170 +374,270 @@ function We(e, t, r) {
250
374
  if (s.type === Function && typeof e[n] == "function")
251
375
  r[n] = e[n];
252
376
  else {
253
- const o = e.getAttribute(J(n));
254
- o !== null ? r[n] = H(i(o, s.type)) : "default" in s && s.default !== void 0 && (r[n] = H(s.default));
377
+ const o = Q(n), a = e.getAttribute(o);
378
+ if (typeof e[n] < "u")
379
+ try {
380
+ const c = e[n];
381
+ s.type === Boolean && typeof c == "boolean" || s.type === Number && typeof c == "number" || s.type === Function && typeof c == "function" ? r[n] = c : r[n] = Z(i(String(c), s.type));
382
+ } catch {
383
+ r[n] = e[n];
384
+ }
385
+ else a !== null ? r[n] = Z(i(a, s.type)) : "default" in s && s.default !== void 0 && (r[n] = Z(s.default));
255
386
  }
256
387
  });
257
388
  }
258
- function qe(e, t, r, i) {
389
+ function Qe(e, t, r, i) {
259
390
  e.onConnected && !r && (e.onConnected(t), i(!0));
260
391
  }
261
- function De(e, t, r, i, n, s, o, a) {
262
- e.onDisconnected && e.onDisconnected(t), r.forEach((f) => f()), i(), n(), s(!1), o(null), a(!1);
392
+ function Xe(e, t, r, i, n, s, o, a) {
393
+ e.onDisconnected && e.onDisconnected(t), r.forEach((c) => c()), i(), n(), s(!1), o(null), a(!1);
263
394
  }
264
- function Ie(e, t, r, i, n) {
395
+ function et(e, t, r, i, n) {
265
396
  e.onAttributeChanged && e.onAttributeChanged(t, r, i, n);
266
397
  }
267
- function V(e, t) {
398
+ function te(e, t) {
268
399
  if (t && e instanceof HTMLElement) {
269
400
  for (const r in t)
270
401
  t[r] === e && delete t[r];
271
402
  for (const r of Array.from(e.childNodes))
272
- V(r, t);
403
+ te(r, t);
273
404
  }
274
405
  }
275
- function He(e, t, r, i, n, s, o, a) {
406
+ function tt(e, t, r, i, n, s, o, a) {
276
407
  if (!s) return;
277
- const f = t.includes("lazy"), u = t.includes("trim"), d = t.includes("number"), y = () => z(s._state || s, e), c = y();
278
- let h = "text";
279
- o instanceof HTMLInputElement ? h = i?.type || o.type || "text" : o instanceof HTMLSelectElement ? h = "select" : o instanceof HTMLTextAreaElement && (h = "textarea");
280
- const k = o instanceof HTMLInputElement || o instanceof HTMLTextAreaElement || o instanceof HTMLSelectElement, w = k ? h === "checkbox" || h === "radio" ? "checked" : "value" : a ?? "modelValue";
281
- if (h === "checkbox")
282
- if (Array.isArray(c))
283
- r[w] = c.includes(String(o?.getAttribute("value") ?? i?.value ?? ""));
408
+ const c = t.includes("lazy"), u = t.includes("trim"), m = t.includes("number"), T = () => K(s._state || s, e), p = T();
409
+ let l = "text";
410
+ o instanceof HTMLInputElement ? l = i?.type || o.type || "text" : o instanceof HTMLSelectElement ? l = "select" : o instanceof HTMLTextAreaElement && (l = "textarea");
411
+ const w = o instanceof HTMLInputElement || o instanceof HTMLTextAreaElement || o instanceof HTMLSelectElement, d = w ? l === "checkbox" || l === "radio" ? "checked" : "value" : a ?? "modelValue";
412
+ if (l === "checkbox")
413
+ if (Array.isArray(p))
414
+ r[d] = p.includes(String(o?.getAttribute("value") ?? i?.value ?? ""));
284
415
  else {
285
416
  const x = o?.getAttribute("true-value") ?? !0;
286
- r[w] = c === x;
417
+ r[d] = p === x;
287
418
  }
288
- else if (h === "radio")
289
- r[w] = c === (i?.value ?? "");
290
- else if (h === "select")
419
+ else if (l === "radio")
420
+ r[d] = p === (i?.value ?? "");
421
+ else if (l === "select")
291
422
  if (o && o.hasAttribute("multiple") && o instanceof HTMLSelectElement) {
292
- const x = Array.isArray(c) ? c.map(String) : [];
423
+ const x = Array.isArray(p) ? p.map(String) : [];
293
424
  setTimeout(() => {
294
- Array.from(o.options).forEach((l) => {
295
- l.selected = x.includes(l.value);
425
+ Array.from(o.options).forEach((f) => {
426
+ f.selected = x.includes(f.value);
296
427
  });
297
- }, 0), r[w] = Array.isArray(c) ? c : [];
428
+ }, 0), r[d] = Array.isArray(p) ? p : [];
298
429
  } else
299
- r[w] = c;
430
+ r[d] = p;
300
431
  else {
301
- r[w] = c;
432
+ r[d] = p;
302
433
  try {
303
- const x = J(w);
304
- i && (i[x] = c);
434
+ const x = Q(d);
435
+ i && (i[x] = p);
305
436
  } catch {
306
437
  }
307
438
  }
308
- const b = f || h === "checkbox" || h === "radio" || h === "select" ? "change" : "input", m = (x) => {
309
- if (x.isComposing || n._isComposing || x.isTrusted === !1) return;
310
- const l = x.target;
311
- if (!l || l._modelUpdating) return;
312
- let g = l.value;
313
- if (h === "checkbox") {
314
- const E = y();
439
+ const g = c || l === "checkbox" || l === "radio" || l === "select" ? "change" : "input", y = (x) => {
440
+ if (x.isComposing || n._isComposing) return;
441
+ const f = typeof globalThis.process < "u" && globalThis.process.env?.NODE_ENV === "test" || typeof window < "u" && window.__vitest__;
442
+ if (x.isTrusted === !1 && !f) return;
443
+ const b = x.target;
444
+ if (!b || b._modelUpdating) return;
445
+ let h = b.value;
446
+ if (l === "checkbox") {
447
+ const E = T();
315
448
  if (Array.isArray(E)) {
316
- const S = l.getAttribute("value") ?? "", A = Array.from(E);
317
- if (l.checked)
318
- A.includes(S) || A.push(S);
449
+ const C = b.getAttribute("value") ?? "", A = Array.from(E);
450
+ if (b.checked)
451
+ A.includes(C) || A.push(C);
319
452
  else {
320
- const j = A.indexOf(S);
321
- j > -1 && A.splice(j, 1);
453
+ const P = A.indexOf(C);
454
+ P > -1 && A.splice(P, 1);
322
455
  }
323
- g = A;
456
+ h = A;
324
457
  } else {
325
- const S = l.getAttribute("true-value") ?? !0, A = l.getAttribute("false-value") ?? !1;
326
- g = l.checked ? S : A;
458
+ const C = b.getAttribute("true-value") ?? !0, A = b.getAttribute("false-value") ?? !1;
459
+ h = b.checked ? C : A;
327
460
  }
328
- } else if (h === "radio")
329
- g = l.getAttribute("value") ?? l.value;
330
- else if (h === "select" && l.multiple)
331
- g = Array.from(l.selectedOptions).map((E) => E.value);
332
- else if (u && typeof g == "string" && (g = g.trim()), d) {
333
- const E = Number(g);
334
- isNaN(E) || (g = E);
335
- }
336
- const p = s._state || s, _ = z(p, e);
337
- if (Array.isArray(g) && Array.isArray(_) ? JSON.stringify([...g].sort()) !== JSON.stringify([..._].sort()) : g !== _) {
338
- l._modelUpdating = !0;
461
+ } else if (l === "radio")
462
+ h = b.getAttribute("value") ?? b.value;
463
+ else if (l === "select" && b.multiple)
464
+ h = Array.from(b.selectedOptions).map((E) => E.value);
465
+ else if (u && typeof h == "string" && (h = h.trim()), m) {
466
+ const E = Number(h);
467
+ isNaN(E) || (h = E);
468
+ }
469
+ const _ = s._state || s, $ = K(_, e);
470
+ if (Array.isArray(h) && Array.isArray($) ? JSON.stringify([...h].sort()) !== JSON.stringify([...$].sort()) : h !== $) {
471
+ b._modelUpdating = !0;
339
472
  try {
340
- oe(p, e, g), s._requestRender && s._requestRender();
473
+ if (he(_, e, h), s._requestRender && s._requestRender(), s._triggerWatchers && s._triggerWatchers(e, h), b) {
474
+ const E = `update:${Q(d)}`, C = new CustomEvent(E, {
475
+ detail: h,
476
+ bubbles: !0,
477
+ composed: !0
478
+ });
479
+ b.dispatchEvent(C);
480
+ }
341
481
  } finally {
342
- setTimeout(() => l._modelUpdating = !1, 0);
482
+ setTimeout(() => b._modelUpdating = !1, 0);
343
483
  }
344
484
  }
345
485
  };
346
- k ? n[b] = m : n[`update:${J(w)}`] = (x) => {
347
- const l = s._state || s, g = x.detail !== void 0 ? x.detail : x.target?.value, p = z(l, e);
348
- (Array.isArray(g) && Array.isArray(p) ? JSON.stringify([...g].sort()) !== JSON.stringify([...p].sort()) : g !== p) && (oe(l, e, g), s._requestRender && s._requestRender());
349
- }, (h === "text" || h === "textarea") && (n.compositionstart = (() => n._isComposing = !0), n.compositionend = (x) => {
486
+ if (w) {
487
+ if (n[g]) {
488
+ const x = n[g];
489
+ o && o.removeEventListener(g, x);
490
+ }
491
+ n[g] = y;
492
+ } else {
493
+ const x = `update:${Q(d)}`;
494
+ if (n[x]) {
495
+ const f = n[x];
496
+ o && o.removeEventListener(x, f);
497
+ }
498
+ n[x] = (f) => {
499
+ const b = s._state || s, h = f.detail !== void 0 ? f.detail : f.target?.value, _ = K(b, e);
500
+ if (Array.isArray(h) && Array.isArray(_) ? JSON.stringify([...h].sort()) !== JSON.stringify([..._].sort()) : h !== _) {
501
+ he(b, e, h), s._requestRender && s._requestRender(), s._triggerWatchers && s._triggerWatchers(e, h);
502
+ const S = f.target;
503
+ if (S) {
504
+ S[d] = h;
505
+ try {
506
+ const E = Q(d);
507
+ typeof h == "boolean" ? h ? S.setAttribute(E, "true") : S.setAttribute(E, "false") : S.setAttribute(E, String(h));
508
+ } catch {
509
+ }
510
+ queueMicrotask(() => {
511
+ typeof S._applyProps == "function" && S._applyProps(S._cfg), typeof S._requestRender == "function" && S._requestRender();
512
+ });
513
+ }
514
+ }
515
+ };
516
+ }
517
+ (l === "text" || l === "textarea") && (n.compositionstart = (() => n._isComposing = !0), n.compositionend = (x) => {
350
518
  n._isComposing = !1;
351
- const l = x.target;
352
- l && setTimeout(() => {
353
- const g = l.value, p = s._state || s, _ = z(p, e);
354
- let C = g;
355
- if (u && (C = C.trim()), d) {
356
- const S = Number(C);
357
- isNaN(S) || (C = S);
519
+ const f = x.target;
520
+ f && setTimeout(() => {
521
+ const b = f.value, h = s._state || s, _ = K(h, e);
522
+ let $ = b;
523
+ if (u && ($ = $.trim()), m) {
524
+ const E = Number($);
525
+ isNaN(E) || ($ = E);
358
526
  }
359
- if (Array.isArray(C) && Array.isArray(_) ? JSON.stringify([...C].sort()) !== JSON.stringify([..._].sort()) : C !== _) {
360
- l._modelUpdating = !0;
527
+ if (Array.isArray($) && Array.isArray(_) ? JSON.stringify([...$].sort()) !== JSON.stringify([..._].sort()) : $ !== _) {
528
+ f._modelUpdating = !0;
361
529
  try {
362
- oe(p, e, C), s._requestRender && s._requestRender();
530
+ he(h, e, $), s._requestRender && s._requestRender(), s._triggerWatchers && s._triggerWatchers(e, $);
363
531
  } finally {
364
- setTimeout(() => l._modelUpdating = !1, 0);
532
+ setTimeout(() => f._modelUpdating = !1, 0);
365
533
  }
366
534
  }
367
535
  }, 0);
368
536
  });
369
537
  }
370
- function Le(e) {
538
+ function Ne(e) {
371
539
  const t = e.slice(2);
372
540
  return t ? t.charAt(0).toLowerCase() + t.slice(1) : "";
373
541
  }
374
- function Fe(e, t, r, i) {
375
- if (i) {
376
- if (typeof e == "object" && e !== null)
377
- for (const [n, s] of Object.entries(e))
378
- t[n] = s;
379
- else if (typeof e == "string")
380
- try {
381
- const n = JSON.parse(e);
382
- if (typeof n == "object" && n !== null) {
383
- for (const [s, o] of Object.entries(n))
384
- t[s] = o;
385
- return;
386
- }
387
- } catch {
388
- const n = z(i, e);
542
+ function rt(e, t, r, i) {
543
+ if (typeof e == "object" && e !== null)
544
+ for (const [n, s] of Object.entries(e))
545
+ n.startsWith("data-") || n.startsWith("aria-") || n === "class" ? r[n] = s : t[n] = s;
546
+ else if (typeof e == "string") {
547
+ if (!i) return;
548
+ try {
549
+ const n = xe(e, i);
550
+ if (typeof n == "object" && n !== null) {
551
+ for (const [s, o] of Object.entries(n))
552
+ s.startsWith("data-") || s.startsWith("aria-") || s === "class" ? r[s] = o : t[s] = o;
553
+ return;
554
+ } else {
389
555
  r[e] = n;
556
+ return;
390
557
  }
558
+ } catch {
559
+ const n = K(i, e);
560
+ r[e] = n;
561
+ }
391
562
  }
392
563
  }
393
- function Ke(e, t, r) {
394
- if (!r) return;
395
- const i = z(r, e), n = t.style || "", s = i ? "" : "none";
396
- if (n) {
564
+ function nt(e, t, r) {
565
+ let i;
566
+ if (typeof e == "string") {
567
+ if (!r) return;
568
+ i = xe(e, r);
569
+ } else
570
+ i = e;
571
+ const n = t.style || "";
572
+ let s = n;
573
+ if (i) {
574
+ if (n) {
575
+ const o = n.split(";").map((c) => c.trim()).filter(Boolean), a = o.findIndex(
576
+ (c) => c.startsWith("display:")
577
+ );
578
+ a >= 0 && o[a] === "display: none" && (o.splice(a, 1), s = o.length > 0 ? o.join("; ") + ";" : "");
579
+ }
580
+ } else if (n) {
397
581
  const o = n.split(";").filter(Boolean), a = o.findIndex(
398
- (f) => f.trim().startsWith("display:")
582
+ (c) => c.trim().startsWith("display:")
399
583
  );
400
- a >= 0 ? o[a] = `display: ${s}` : o.push(`display: ${s}`), t.style = o.join("; ");
584
+ a >= 0 ? o[a] = "display: none" : o.push("display: none"), s = o.join("; ");
401
585
  } else
402
- t.style = `display: ${s}`;
586
+ s = "display: none";
587
+ s !== n && (s ? t.style = s : delete t.style);
588
+ }
589
+ function xe(e, t) {
590
+ if ([
591
+ /constructor/i,
592
+ /prototype/i,
593
+ /__proto__/i,
594
+ /function/i,
595
+ /eval/i,
596
+ /import/i,
597
+ /require/i,
598
+ /window/i,
599
+ /document/i,
600
+ /global/i,
601
+ /process/i
602
+ ].some((i) => i.test(e))) {
603
+ pe("Potentially dangerous expression blocked:", e);
604
+ return;
605
+ }
606
+ if (e.trim().startsWith("{") && e.trim().endsWith("}"))
607
+ try {
608
+ const i = Object.keys(t), n = i.map((a) => t[a]), s = e.replace(/ctx\./g, "");
609
+ if (s.length > 1e3) {
610
+ pe("Expression too long, blocked for security:", e);
611
+ return;
612
+ }
613
+ return new Function(...i, `return ${s}`)(...n);
614
+ } catch (i) {
615
+ pe("Failed to evaluate expression:", e, i);
616
+ return;
617
+ }
618
+ if (e.startsWith("ctx.")) {
619
+ const i = e.slice(4);
620
+ return K(t, i);
621
+ }
622
+ return K(t, e);
403
623
  }
404
- function Ue(e, t, r) {
405
- if (!r) return;
406
- const i = z(r, e);
624
+ function it(e, t, r) {
625
+ let i;
626
+ if (typeof e == "string") {
627
+ if (!r) return;
628
+ i = xe(e, r);
629
+ } else
630
+ i = e;
407
631
  let n = [];
408
- typeof i == "string" ? n = [i] : Array.isArray(i) ? n = i.filter(Boolean) : typeof i == "object" && (n = Object.entries(i).filter(([, a]) => !!a).flatMap(([a]) => a.split(/\s+/).filter(Boolean)));
632
+ typeof i == "string" ? n = [i] : Array.isArray(i) ? n = i.filter(Boolean) : typeof i == "object" && i !== null && (n = Object.entries(i).filter(([, a]) => !!a).flatMap(([a]) => a.split(/\s+/).filter(Boolean)));
409
633
  const s = t.class || "", o = s ? `${s} ${n.join(" ")}`.trim() : n.join(" ");
410
634
  o && (t.class = o);
411
635
  }
412
- function Ve(e, t, r) {
636
+ function st(e, t, r) {
413
637
  let i;
414
638
  if (typeof e == "string") {
415
639
  if (!r) return;
416
- i = z(r, e);
640
+ i = xe(e, r);
417
641
  } else
418
642
  i = e;
419
643
  let n = "";
@@ -421,12 +645,12 @@ function Ve(e, t, r) {
421
645
  n = i;
422
646
  else if (i && typeof i == "object") {
423
647
  const o = [];
424
- for (const [a, f] of Object.entries(i))
425
- if (f != null && f !== "") {
648
+ for (const [a, c] of Object.entries(i))
649
+ if (c != null && c !== "") {
426
650
  const u = a.replace(
427
651
  /[A-Z]/g,
428
- (c) => `-${c.toLowerCase()}`
429
- ), d = [
652
+ (p) => `-${p.toLowerCase()}`
653
+ ), m = [
430
654
  "width",
431
655
  "height",
432
656
  "top",
@@ -452,73 +676,83 @@ function Ve(e, t, r) {
452
676
  "min-height",
453
677
  "max-height"
454
678
  ];
455
- let y = String(f);
456
- typeof f == "number" && d.includes(u) && (y = `${f}px`), o.push(`${u}: ${y}`);
679
+ let T = String(c);
680
+ typeof c == "number" && m.includes(u) && (T = `${c}px`), o.push(`${u}: ${T}`);
457
681
  }
458
682
  n = o.join("; ") + (o.length > 0 ? ";" : "");
459
683
  }
460
684
  const s = t.style || "";
461
685
  t.style = s + (s && !s.endsWith(";") ? "; " : "") + n;
462
686
  }
463
- function Re(e, t, r, i) {
687
+ function De(e, t, r, i) {
464
688
  const n = {}, s = { ...i || {} }, o = {};
465
- for (const [a, f] of Object.entries(e)) {
466
- const { value: u, modifiers: d, arg: y } = f;
689
+ for (const [a, c] of Object.entries(e)) {
690
+ const { value: u, modifiers: m, arg: T } = c;
467
691
  if (a === "model" || a.startsWith("model:")) {
468
- const c = a.split(":"), h = c.length > 1 ? c[1] : y;
469
- He(
692
+ const p = a.split(":"), l = p.length > 1 ? p[1] : T;
693
+ tt(
470
694
  typeof u == "string" ? u : String(u),
471
- d,
695
+ m,
472
696
  n,
473
697
  s,
474
698
  o,
475
699
  t,
476
700
  r,
477
- h
701
+ l
478
702
  );
479
703
  continue;
480
704
  }
481
705
  switch (a) {
482
706
  case "bind":
483
- Fe(u, n, s, t);
707
+ rt(u, n, s, t);
484
708
  break;
485
709
  case "show":
486
- Ke(u, s, t);
710
+ nt(u, s, t);
487
711
  break;
488
712
  case "class":
489
- Ue(u, s, t);
713
+ it(u, s, t);
490
714
  break;
491
715
  case "style":
492
- Ve(u, s, t);
716
+ st(u, s, t);
493
717
  break;
494
718
  }
495
719
  }
496
720
  return { props: n, attrs: s, listeners: o };
497
721
  }
498
- function ve(e, t) {
722
+ function je(e, t) {
499
723
  if (Array.isArray(e)) {
500
724
  const s = /* @__PURE__ */ new Set();
501
725
  return e.map((o) => {
502
726
  if (!o || typeof o != "object") return o;
503
727
  let a = o.props?.key ?? o.key;
504
728
  if (!a) {
505
- const y = o.tag || "node", c = o.props?.attrs?.id ?? o.props?.attrs?.name ?? o.props?.attrs?.["data-key"] ?? "";
506
- a = c ? `${t}:${y}:${c}` : `${t}:${y}`;
729
+ const T = o.tag || "node", l = [
730
+ // attrs (kebab-case)
731
+ o.props?.attrs?.id,
732
+ o.props?.attrs?.name,
733
+ o.props?.attrs?.["data-key"],
734
+ // promoted JS props (camelCase or original)
735
+ o.props?.props?.id,
736
+ o.props?.props?.name,
737
+ o.props?.props?.dataKey,
738
+ o.props?.props?.["data-key"]
739
+ ].find((w) => w != null) ?? "";
740
+ a = l ? `${t}:${T}:${l}` : `${t}:${T}`;
507
741
  }
508
- let f = a, u = 1;
509
- for (; s.has(f); )
510
- f = `${a}#${u++}`;
511
- s.add(f);
512
- let d = o.children;
513
- return Array.isArray(d) && (d = ve(d, f)), { ...o, key: f, children: d };
742
+ let c = a, u = 1;
743
+ for (; s.has(c); )
744
+ c = `${a}#${u++}`;
745
+ s.add(c);
746
+ let m = o.children;
747
+ return Array.isArray(m) && (m = je(m, c)), { ...o, key: c, children: m };
514
748
  });
515
749
  }
516
750
  const r = e;
517
751
  let i = r.props?.key ?? r.key ?? t, n = r.children;
518
- return Array.isArray(n) && (n = ve(n, i)), { ...r, key: i, children: n };
752
+ return Array.isArray(n) && (n = je(n, i)), { ...r, key: i, children: n };
519
753
  }
520
- function Je(e, t, r, i) {
521
- const n = r.directives ?? {}, s = Re(
754
+ function Re(e, t, r, i) {
755
+ const n = r.directives ?? {}, s = De(
522
756
  n,
523
757
  i,
524
758
  e,
@@ -531,96 +765,203 @@ function Je(e, t, r, i) {
531
765
  ...t.attrs,
532
766
  ...r.attrs,
533
767
  ...s.attrs
534
- }, f = t.props ?? {}, u = o;
535
- for (const c in { ...f, ...u }) {
536
- const h = f[c], k = u[c];
537
- if (h !== k) {
538
- if (c === "value" && (e instanceof HTMLInputElement || e instanceof HTMLTextAreaElement || e instanceof HTMLSelectElement))
539
- e.value !== k && (e.value = k ?? "");
540
- else if (c === "checked" && e instanceof HTMLInputElement)
541
- e.checked = !!k;
542
- else if (c.startsWith("on") && typeof k == "function") {
543
- const $ = Le(c);
544
- typeof h == "function" && e.removeEventListener($, h), e.addEventListener($, k);
545
- } else if (k == null || k === !1)
546
- e.removeAttribute(c);
547
- else if ((r?.isCustomElement ?? t?.isCustomElement ?? !1) || c in e)
768
+ }, c = t.props ?? {}, u = o, m = r?.isCustomElement ?? t?.isCustomElement ?? !1;
769
+ let T = !1;
770
+ for (const w in { ...c, ...u }) {
771
+ const v = c[w], d = u[w];
772
+ if (v !== d)
773
+ if (T = !0, w === "value" && (e instanceof HTMLInputElement || e instanceof HTMLTextAreaElement || e instanceof HTMLSelectElement))
774
+ e.value !== d && (e.value = d ?? "");
775
+ else if (w === "checked" && e instanceof HTMLInputElement)
776
+ e.checked = !!d;
777
+ else if (w.startsWith("on") && typeof d == "function") {
778
+ const g = Ne(w);
779
+ typeof v == "function" && e.removeEventListener(g, v), e.addEventListener(g, d);
780
+ } else if (d == null)
781
+ e.removeAttribute(w);
782
+ else if ((r?.isCustomElement ?? t?.isCustomElement ?? !1) || w in e)
548
783
  try {
549
- e[c] = k;
784
+ e[w] = d;
550
785
  } catch {
551
786
  }
552
- }
787
+ else
788
+ d === !1 && e.removeAttribute(w);
553
789
  }
554
- for (const [c, h] of Object.entries(
790
+ for (const [w, v] of Object.entries(
555
791
  s.listeners || {}
556
792
  ))
557
- e.addEventListener(c, h);
558
- const d = t.attrs ?? {}, y = a;
559
- for (const c in { ...d, ...y }) {
560
- const h = d[c], k = y[c];
561
- h !== k && (k == null || k === !1 ? e.removeAttribute(c) : e.setAttribute(c, String(k)));
793
+ e.addEventListener(w, v);
794
+ const p = t.attrs ?? {}, l = a;
795
+ for (const w in { ...p, ...l }) {
796
+ const v = p[w], d = l[w];
797
+ if (v !== d)
798
+ if (T = !0, d == null || d === !1) {
799
+ if (e.removeAttribute(w), w === "value") {
800
+ if (e instanceof HTMLInputElement || e instanceof HTMLTextAreaElement)
801
+ try {
802
+ e.value = "";
803
+ } catch {
804
+ }
805
+ else if (e instanceof HTMLSelectElement)
806
+ try {
807
+ e.value = "";
808
+ } catch {
809
+ }
810
+ else if (e instanceof HTMLProgressElement)
811
+ try {
812
+ e.value = 0;
813
+ } catch {
814
+ }
815
+ }
816
+ if (w === "checked" && e instanceof HTMLInputElement)
817
+ try {
818
+ e.checked = !1;
819
+ } catch {
820
+ }
821
+ if (w === "disabled")
822
+ try {
823
+ e.disabled = !1;
824
+ } catch {
825
+ }
826
+ } else {
827
+ if (w === "value") {
828
+ if (e instanceof HTMLInputElement || e instanceof HTMLTextAreaElement) {
829
+ try {
830
+ e.value = d ?? "";
831
+ } catch {
832
+ e.setAttribute(w, String(d));
833
+ }
834
+ continue;
835
+ } else if (e instanceof HTMLSelectElement) {
836
+ try {
837
+ e.value = d ?? "";
838
+ } catch {
839
+ }
840
+ continue;
841
+ } else if (e instanceof HTMLProgressElement) {
842
+ try {
843
+ e.value = Number(d);
844
+ } catch {
845
+ }
846
+ continue;
847
+ }
848
+ }
849
+ if (w === "checked" && e instanceof HTMLInputElement) {
850
+ try {
851
+ e.checked = !!d;
852
+ } catch {
853
+ }
854
+ continue;
855
+ }
856
+ if (w === "style") {
857
+ e.setAttribute(w, String(d));
858
+ continue;
859
+ }
860
+ if (!(e.namespaceURI === "http://www.w3.org/2000/svg") && w in e)
861
+ try {
862
+ e[w] = d;
863
+ } catch {
864
+ e.setAttribute(w, String(d));
865
+ }
866
+ else
867
+ e.setAttribute(w, String(d));
868
+ }
562
869
  }
870
+ if (m && T)
871
+ try {
872
+ if (typeof e._applyProps == "function")
873
+ try {
874
+ e._applyProps(e._cfg);
875
+ } catch {
876
+ }
877
+ typeof e.requestRender == "function" ? e.requestRender() : typeof e._render == "function" && e._render(e._cfg);
878
+ } catch {
879
+ }
563
880
  }
564
- function M(e, t, r) {
881
+ function U(e, t, r) {
565
882
  if (typeof e == "string")
566
883
  return document.createTextNode(e);
567
884
  if (e.tag === "#text") {
568
- const y = document.createTextNode(
885
+ const p = document.createTextNode(
569
886
  typeof e.children == "string" ? e.children : ""
570
887
  );
571
- return e.key != null && (y.key = e.key), y;
888
+ return e.key != null && (p.key = e.key), p;
572
889
  }
573
890
  if (e.tag === "#anchor") {
574
- const y = e, c = Array.isArray(y.children) ? y.children : [], h = document.createTextNode(""), k = document.createTextNode("");
575
- y.key != null && (h.key = `${y.key}:start`, k.key = `${y.key}:end`), y._startNode = h, y._endNode = k;
576
- const $ = document.createDocumentFragment();
577
- $.appendChild(h);
578
- for (const w of c) {
579
- const b = M(w, t);
580
- $.appendChild(b);
891
+ const p = e, l = Array.isArray(p.children) ? p.children : [], w = document.createTextNode(""), v = document.createTextNode("");
892
+ p.key != null && (w.key = `${p.key}:start`, v.key = `${p.key}:end`), p._startNode = w, p._endNode = v;
893
+ const d = document.createDocumentFragment();
894
+ d.appendChild(w);
895
+ for (const g of l) {
896
+ const y = U(g, t);
897
+ d.appendChild(y);
581
898
  }
582
- return $.appendChild(k), $;
899
+ return d.appendChild(v), d;
583
900
  }
584
901
  const i = document.createElement(e.tag);
585
902
  e.key != null && (i.key = e.key);
586
- const { props: n = {}, attrs: s = {}, directives: o = {} } = e.props ?? {}, a = Re(o, t, i, s), f = {
903
+ const { props: n = {}, attrs: s = {}, directives: o = {} } = e.props ?? {}, a = De(o, t, i, s), c = {
587
904
  ...n,
588
905
  ...a.props
589
906
  }, u = {
590
907
  ...s,
591
908
  ...a.attrs
592
- };
593
- for (const y in u) {
594
- const c = u[y];
595
- typeof y != "string" || /\[object Object\]/.test(y) || (typeof c == "boolean" ? c && i.setAttribute(y, "") : c != null && i.setAttribute(y, c));
596
- }
597
- for (const y in f) {
598
- const c = f[y];
599
- if (!(typeof y != "string" || /\[object Object\]/.test(y)))
600
- if (y === "value" && (i instanceof HTMLInputElement || i instanceof HTMLTextAreaElement || i instanceof HTMLSelectElement))
601
- i.value = c ?? "";
602
- else if (y === "checked" && i instanceof HTMLInputElement)
603
- i.checked = !!c;
604
- else if (y.startsWith("on") && typeof c == "function")
605
- i.addEventListener(Le(y), c);
909
+ }, m = i.namespaceURI === "http://www.w3.org/2000/svg";
910
+ for (const p in u) {
911
+ const l = u[p];
912
+ if (!(typeof p != "string" || /\[object Object\]/.test(p))) {
913
+ if (typeof l == "boolean")
914
+ l && i.setAttribute(p, "");
915
+ else if (l != null)
916
+ if (!m && p === "value" && (i instanceof HTMLInputElement || i instanceof HTMLTextAreaElement || i instanceof HTMLSelectElement || i instanceof HTMLProgressElement))
917
+ try {
918
+ i instanceof HTMLProgressElement ? i.value = Number(l) : i.value = l ?? "";
919
+ } catch {
920
+ i.setAttribute(p, String(l));
921
+ }
922
+ else if (!m && p === "checked" && i instanceof HTMLInputElement)
923
+ try {
924
+ i.checked = !!l;
925
+ } catch {
926
+ i.setAttribute(p, String(l));
927
+ }
928
+ else if (!m && p in i)
929
+ try {
930
+ i[p] = l;
931
+ } catch {
932
+ i.setAttribute(p, String(l));
933
+ }
934
+ else
935
+ i.setAttribute(p, String(l));
936
+ }
937
+ }
938
+ for (const p in c) {
939
+ const l = c[p];
940
+ if (!(typeof p != "string" || /\[object Object\]/.test(p)))
941
+ if (p === "value" && (i instanceof HTMLInputElement || i instanceof HTMLTextAreaElement || i instanceof HTMLSelectElement))
942
+ i.value = l ?? "";
943
+ else if (p === "checked" && i instanceof HTMLInputElement)
944
+ i.checked = !!l;
945
+ else if (p.startsWith("on") && typeof l == "function")
946
+ i.addEventListener(Ne(p), l);
606
947
  else {
607
- if (y.startsWith("on") && c === void 0)
948
+ if (p.startsWith("on") && l === void 0)
608
949
  continue;
609
- if (c == null || c === !1)
610
- i.removeAttribute(y);
611
- else if ((e.props?.isCustomElement ?? !1) || y in i)
950
+ if (l == null || l === !1)
951
+ i.removeAttribute(p);
952
+ else if ((e.props?.isCustomElement ?? !1) || p in i)
612
953
  try {
613
- i[y] = c;
954
+ i[p] = l;
614
955
  } catch {
615
956
  }
616
957
  }
617
958
  }
618
- for (const [y, c] of Object.entries(
959
+ for (const [p, l] of Object.entries(
619
960
  a.listeners || {}
620
961
  ))
621
- i.addEventListener(y, c);
622
- const d = e.props?.ref ?? (e.props?.props && e.props.props.ref);
623
- typeof e != "string" && d && r && (r[d] = i);
962
+ i.addEventListener(p, l);
963
+ const T = e.props?.ref ?? (e.props?.props && e.props.props.ref);
964
+ typeof e != "string" && T && r && (r[T] = i);
624
965
  try {
625
966
  if (typeof i._applyProps == "function")
626
967
  try {
@@ -631,118 +972,126 @@ function M(e, t, r) {
631
972
  } catch {
632
973
  }
633
974
  if (Array.isArray(e.children))
634
- for (const y of e.children)
635
- i.appendChild(M(y, t, r));
975
+ for (const p of e.children)
976
+ i.appendChild(U(p, t, r));
636
977
  else typeof e.children == "string" && (i.textContent = e.children);
978
+ try {
979
+ if (i instanceof HTMLSelectElement && u && u.hasOwnProperty("value"))
980
+ try {
981
+ i.value = u.value ?? "";
982
+ } catch {
983
+ }
984
+ } catch {
985
+ }
637
986
  return i;
638
987
  }
639
- function Ze(e, t, r, i, n) {
988
+ function ot(e, t, r, i, n) {
640
989
  if (typeof r == "string") {
641
990
  e.textContent !== r && (e.textContent = r);
642
991
  return;
643
992
  }
644
993
  if (!Array.isArray(r)) return;
645
994
  const s = Array.from(e.childNodes), o = Array.isArray(t) ? t : [], a = /* @__PURE__ */ new Map();
646
- for (const h of o)
647
- h && h.key != null && a.set(h.key, h);
648
- const f = /* @__PURE__ */ new Map();
649
- for (const h of s) {
650
- const k = h.key;
651
- k != null && f.set(k, h);
995
+ for (const l of o)
996
+ l && l.key != null && a.set(l.key, l);
997
+ const c = /* @__PURE__ */ new Map();
998
+ for (const l of s) {
999
+ const w = l.key;
1000
+ w != null && c.set(w, l);
652
1001
  }
653
1002
  const u = /* @__PURE__ */ new Set();
654
- let d = e.firstChild;
655
- function y(h, k) {
656
- let $ = h;
657
- for (; $ && (u.add($), $ !== k); )
658
- $ = $.nextSibling;
659
- }
660
- function c(h, k, $, w) {
661
- const b = [];
662
- let m = h.nextSibling;
663
- for (; m && m !== k; )
664
- b.push(m), m = m.nextSibling;
665
- const x = Array.isArray($) ? $ : [];
666
- if (w.some((g) => g && g.key != null) || x.some((g) => g && g.key != null)) {
667
- const g = /* @__PURE__ */ new Map(), p = /* @__PURE__ */ new Map();
668
- for (const E of x)
669
- E && E.key != null && g.set(E.key, E);
670
- for (const E of b) {
671
- const S = E.key;
672
- S != null && p.set(S, E);
1003
+ let m = e.firstChild;
1004
+ function T(l, w) {
1005
+ let v = l;
1006
+ for (; v && (u.add(v), v !== w); )
1007
+ v = v.nextSibling;
1008
+ }
1009
+ function p(l, w, v, d) {
1010
+ const g = [];
1011
+ let y = l.nextSibling;
1012
+ for (; y && y !== w; )
1013
+ g.push(y), y = y.nextSibling;
1014
+ const x = Array.isArray(v) ? v : [];
1015
+ if (d.some((b) => b && b.key != null) || x.some((b) => b && b.key != null)) {
1016
+ const b = /* @__PURE__ */ new Map(), h = /* @__PURE__ */ new Map();
1017
+ for (const S of x)
1018
+ S && S.key != null && b.set(S.key, S);
1019
+ for (const S of g) {
1020
+ const E = S.key;
1021
+ E != null && h.set(E, S);
673
1022
  }
674
1023
  const _ = /* @__PURE__ */ new Set();
675
- let C = h.nextSibling;
676
- for (const E of w) {
677
- let S;
678
- if (E.key != null && p.has(E.key)) {
679
- const A = g.get(E.key);
680
- S = ae(
681
- p.get(E.key),
682
- A,
683
- E,
1024
+ let $ = l.nextSibling;
1025
+ for (const S of d) {
1026
+ let E;
1027
+ if (S.key != null && h.has(S.key)) {
1028
+ const C = b.get(S.key);
1029
+ E = ge(
1030
+ h.get(S.key),
1031
+ C,
1032
+ S,
684
1033
  i
685
- ), _.add(S), S !== C && e.contains(S) && e.insertBefore(S, C);
1034
+ ), _.add(E), E !== $ && e.contains(E) && e.insertBefore(E, $);
686
1035
  } else
687
- S = M(E, i), e.insertBefore(S, C), _.add(S);
688
- C = S.nextSibling;
1036
+ E = U(S, i), e.insertBefore(E, $), _.add(E);
1037
+ $ = E.nextSibling;
689
1038
  }
690
- for (const E of b)
691
- !_.has(E) && e.contains(E) && e.removeChild(E);
1039
+ for (const S of g)
1040
+ !_.has(S) && e.contains(S) && e.removeChild(S);
692
1041
  } else {
693
- const g = Math.min(
1042
+ const b = Math.min(
694
1043
  x.length,
695
- w.length
1044
+ d.length
696
1045
  );
697
- for (let p = 0; p < g; p++) {
698
- const _ = x[p], C = w[p], E = ae(b[p], _, C, i);
699
- E !== b[p] && (e.insertBefore(E, b[p]), e.removeChild(b[p]));
1046
+ for (let h = 0; h < b; h++) {
1047
+ const _ = x[h], $ = d[h], S = ge(g[h], _, $, i);
1048
+ S !== g[h] && (e.insertBefore(S, g[h]), e.removeChild(g[h]));
700
1049
  }
701
- for (let p = g; p < w.length; p++)
702
- e.insertBefore(M(w[p], i), k);
703
- for (let p = g; p < b.length; p++)
704
- e.removeChild(b[p]);
705
- }
706
- }
707
- for (const h of r) {
708
- let k;
709
- if (h.tag === "#anchor") {
710
- const $ = h.key, w = `${$}:start`, b = `${$}:end`;
711
- let m = f.get(w), x = f.get(b);
712
- const l = Array.isArray(h.children) ? h.children : [];
713
- if (m || (m = document.createTextNode(""), m.key = w), x || (x = document.createTextNode(""), x.key = b), h._startNode = m, h._endNode = x, !e.contains(m) || !e.contains(x)) {
714
- e.insertBefore(m, d);
715
- for (const g of l)
716
- e.insertBefore(M(g, i), d);
717
- e.insertBefore(x, d);
1050
+ for (let h = b; h < d.length; h++)
1051
+ e.insertBefore(U(d[h], i), w);
1052
+ for (let h = b; h < g.length; h++)
1053
+ e.removeChild(g[h]);
1054
+ }
1055
+ }
1056
+ for (const l of r) {
1057
+ let w;
1058
+ if (l.tag === "#anchor") {
1059
+ const v = l.key, d = `${v}:start`, g = `${v}:end`;
1060
+ let y = c.get(d), x = c.get(g);
1061
+ const f = Array.isArray(l.children) ? l.children : [];
1062
+ if (y || (y = document.createTextNode(""), y.key = d), x || (x = document.createTextNode(""), x.key = g), l._startNode = y, l._endNode = x, !e.contains(y) || !e.contains(x)) {
1063
+ e.insertBefore(y, m);
1064
+ for (const b of f)
1065
+ e.insertBefore(U(b, i), m);
1066
+ e.insertBefore(x, m);
718
1067
  } else
719
- c(
720
- m,
1068
+ p(
1069
+ y,
721
1070
  x,
722
- a.get($)?.children,
723
- l
1071
+ a.get(v)?.children,
1072
+ f
724
1073
  );
725
- y(m, x), d = x.nextSibling;
1074
+ T(y, x), m = x.nextSibling;
726
1075
  continue;
727
1076
  }
728
- if (h.key != null && f.has(h.key)) {
729
- const $ = a.get(h.key);
730
- k = ae(
731
- f.get(h.key),
732
- $,
733
- h,
1077
+ if (l.key != null && c.has(l.key)) {
1078
+ const v = a.get(l.key);
1079
+ w = ge(
1080
+ c.get(l.key),
1081
+ v,
1082
+ l,
734
1083
  i,
735
1084
  n
736
- ), u.add(k), k !== d && e.contains(k) && (d && !e.contains(d) && (d = null), e.insertBefore(k, d));
1085
+ ), u.add(w), w !== m && e.contains(w) && (m && !e.contains(m) && (m = null), e.insertBefore(w, m));
737
1086
  } else
738
- k = M(h, i, n), d && !e.contains(d) && (d = null), e.insertBefore(k, d), u.add(k);
739
- d = k.nextSibling;
1087
+ w = U(l, i, n), m && !e.contains(m) && (m = null), e.insertBefore(w, m), u.add(w);
1088
+ m = w.nextSibling;
740
1089
  }
741
- for (const h of s)
742
- !u.has(h) && e.contains(h) && (V(h, n), e.removeChild(h));
1090
+ for (const l of s)
1091
+ !u.has(l) && e.contains(l) && (te(l, n), e.removeChild(l));
743
1092
  }
744
- function ae(e, t, r, i, n) {
745
- if (t && typeof t != "string" && t.props?.ref && n && V(e, n), t === r) return e;
1093
+ function ge(e, t, r, i, n) {
1094
+ if (t && typeof t != "string" && t.props?.ref && n && te(e, n), t === r) return e;
746
1095
  if (typeof r == "string") {
747
1096
  if (e.nodeType === Node.TEXT_NODE)
748
1097
  return e.textContent !== r && (e.textContent = r), e;
@@ -752,91 +1101,97 @@ function ae(e, t, r, i, n) {
752
1101
  }
753
1102
  }
754
1103
  if (r && typeof r != "string" && r.tag === "#anchor") {
755
- const o = r, a = Array.isArray(o.children) ? o.children : [], f = o._startNode ?? document.createTextNode(""), u = o._endNode ?? document.createTextNode("");
756
- o.key != null && (f.key = `${o.key}:start`, u.key = `${o.key}:end`), o._startNode = f, o._endNode = u;
757
- const d = document.createDocumentFragment();
758
- d.appendChild(f);
759
- for (const y of a) {
760
- const c = M(y, i);
761
- d.appendChild(c);
1104
+ const o = r, a = Array.isArray(o.children) ? o.children : [], c = o._startNode ?? document.createTextNode(""), u = o._endNode ?? document.createTextNode("");
1105
+ o.key != null && (c.key = `${o.key}:start`, u.key = `${o.key}:end`), o._startNode = c, o._endNode = u;
1106
+ const m = document.createDocumentFragment();
1107
+ m.appendChild(c);
1108
+ for (const T of a) {
1109
+ const p = U(T, i);
1110
+ m.appendChild(p);
762
1111
  }
763
- return d.appendChild(u), e.parentNode?.replaceChild(d, e), f;
1112
+ return m.appendChild(u), e.parentNode?.replaceChild(m, e), c;
764
1113
  }
765
1114
  if (!r) {
766
- V(e, n);
1115
+ te(e, n);
767
1116
  const o = document.createComment("removed");
768
1117
  return e.parentNode?.replaceChild(o, e), o;
769
1118
  }
770
1119
  if (!t || typeof t == "string") {
771
- V(e, n);
772
- const o = M(r, i, n);
1120
+ te(e, n);
1121
+ const o = U(r, i, n);
773
1122
  return typeof r != "string" && r.props?.ref && n && (n[r.props.ref] = o), e.parentNode?.replaceChild(o, e), o;
774
1123
  }
775
1124
  if (r.tag === "#anchor") {
776
- const o = Array.isArray(r.children) ? r.children : [], a = r._startNode ?? document.createTextNode(""), f = r._endNode ?? document.createTextNode("");
777
- r.key != null && (a.key = `${r.key}:start`, f.key = `${r.key}:end`), r._startNode = a, r._endNode = f;
1125
+ const o = Array.isArray(r.children) ? r.children : [], a = r._startNode ?? document.createTextNode(""), c = r._endNode ?? document.createTextNode("");
1126
+ r.key != null && (a.key = `${r.key}:start`, c.key = `${r.key}:end`), r._startNode = a, r._endNode = c;
778
1127
  const u = document.createDocumentFragment();
779
1128
  u.appendChild(a);
780
- for (const d of o)
781
- u.appendChild(M(d, i));
782
- return u.appendChild(f), e.parentNode?.replaceChild(u, e), a;
1129
+ for (const m of o)
1130
+ u.appendChild(U(m, i));
1131
+ return u.appendChild(c), e.parentNode?.replaceChild(u, e), a;
783
1132
  }
784
1133
  if (typeof t != "string" && typeof r != "string" && t.tag === r.tag && t.key === r.key) {
785
1134
  const o = e;
786
- return Je(o, t.props || {}, r.props || {}, i), Ze(o, t.children, r.children, i, n), typeof r != "string" && r.props?.ref && n && (n[r.props.ref] = o), o;
1135
+ return Re(o, t.props || {}, r.props || {}, i), ot(o, t.children, r.children, i, n), typeof r != "string" && r.props?.ref && n && (n[r.props.ref] = o), o;
787
1136
  }
788
- V(e, n);
789
- const s = M(r, i, n);
1137
+ if (typeof t != "string" && typeof r != "string" && t.tag === r.tag && (t.tag && String(t.tag).includes("-") || r.props && r.props.isCustomElement || t.props && t.props.isCustomElement))
1138
+ try {
1139
+ const a = e;
1140
+ return Re(a, t.props || {}, r.props || {}, i), typeof r != "string" && r.props?.ref && n && (n[r.props.ref] = a), a;
1141
+ } catch {
1142
+ }
1143
+ te(e, n);
1144
+ const s = U(r, i, n);
790
1145
  return typeof r != "string" && r.props?.ref && n && (n[r.props.ref] = s), e.parentNode?.replaceChild(s, e), s;
791
1146
  }
792
- function Ye(e, t, r, i) {
1147
+ function at(e, t, r, i) {
793
1148
  let n;
794
1149
  Array.isArray(t) ? t.length === 1 ? (n = t[0], n && typeof n == "object" && n.key == null && (n = { ...n, key: "__root__" })) : n = { tag: "div", key: "__root__", children: t } : (n = t, n && typeof n == "object" && n.key == null && (n = { ...n, key: "__root__" })), n && typeof n == "object" && n.tag === "#anchor" && (n = {
795
1150
  tag: "div",
796
1151
  key: "__anchor_root__",
797
1152
  props: { attrs: { "data-anchor-block-root": "", key: "__anchor_root__" } },
798
1153
  children: [n]
799
- }), n = ve(n, String(n.key ?? "root"));
1154
+ }), n = je(n, String(n.key ?? "root"));
800
1155
  const s = e._prevVNode ?? null, o = e._prevDom ?? e.firstChild ?? null;
801
1156
  let a;
802
- s && o ? typeof s != "string" && typeof n != "string" && s.tag === n.tag && s.key === n.key ? a = ae(o, s, n, r, i) : (a = M(n, r, i), e.replaceChild(a, o)) : (a = M(n, r, i), e.firstChild ? e.replaceChild(a, e.firstChild) : e.appendChild(a));
803
- const f = [];
1157
+ s && o ? typeof s != "string" && typeof n != "string" && s.tag === n.tag && s.key === n.key ? a = ge(o, s, n, r, i) : (a = U(n, r, i), e.replaceChild(a, o)) : (a = U(n, r, i), e.firstChild ? e.replaceChild(a, e.firstChild) : e.appendChild(a));
1158
+ const c = [];
804
1159
  for (let u = 0; u < e.childNodes.length; u++) {
805
- const d = e.childNodes[u];
806
- d !== a && d.nodeName !== "STYLE" && (V(d, i), f.push(d));
1160
+ const m = e.childNodes[u];
1161
+ m !== a && m.nodeName !== "STYLE" && (te(m, i), c.push(m));
807
1162
  }
808
- f.forEach((u) => e.removeChild(u)), e._prevVNode = n, e._prevDom = a;
1163
+ c.forEach((u) => e.removeChild(u)), e._prevVNode = n, e._prevDom = a;
809
1164
  }
810
- function he(e) {
811
- if (typeof e == "string") return H(e);
1165
+ function ke(e) {
1166
+ if (typeof e == "string") return Z(e);
812
1167
  if (e.tag === "#text")
813
- return typeof e.children == "string" ? H(e.children) : "";
1168
+ return typeof e.children == "string" ? Z(e.children) : "";
814
1169
  if (e.tag === "#anchor")
815
- return (Array.isArray(e.children) ? e.children.filter(Boolean) : []).map(he).join("");
1170
+ return (Array.isArray(e.children) ? e.children.filter(Boolean) : []).map(ke).join("");
816
1171
  let t = "";
817
- e.props && e.props.attrs && (t = Object.entries(e.props.attrs).map(([n, s]) => ` ${n}="${H(String(s))}"`).join(""));
1172
+ e.props && e.props.attrs && (t = Object.entries(e.props.attrs).map(([n, s]) => ` ${n}="${Z(String(s))}"`).join(""));
818
1173
  let r = "";
819
- e.props && (r = Object.entries(e.props).filter(([n]) => n !== "attrs" && n !== "directives" && n !== "ref" && n !== "key").map(([n, s]) => ` ${n}="${H(String(s))}"`).join(""));
820
- const i = Array.isArray(e.children) ? e.children.filter(Boolean).map(he).join("") : typeof e.children == "string" ? H(e.children) : e.children ? he(e.children) : "";
1174
+ e.props && (r = Object.entries(e.props).filter(([n]) => n !== "attrs" && n !== "directives" && n !== "ref" && n !== "key").map(([n, s]) => ` ${n}="${Z(String(s))}"`).join(""));
1175
+ const i = Array.isArray(e.children) ? e.children.filter(Boolean).map(ke).join("") : typeof e.children == "string" ? Z(e.children) : e.children ? ke(e.children) : "";
821
1176
  return `<${e.tag}${t}${r}>${i}</${e.tag}>`;
822
1177
  }
823
- function Oe(e, ...t) {
1178
+ function Ue(e, ...t) {
824
1179
  let r = "";
825
1180
  for (let i = 0; i < e.length; i++)
826
1181
  r += e[i], i < t.length && (r += t[i]);
827
1182
  return r;
828
1183
  }
829
- function Be(e) {
1184
+ function Fe(e) {
830
1185
  return e.replace(/\/\*[\s\S]*?\*\//g, "").replace(/\s+/g, " ").replace(/\s*([{}:;,>+~])\s*/g, "$1").replace(/;}/g, "}").trim();
831
1186
  }
832
- let ie = null;
833
- function _e() {
834
- return ie || (ie = new CSSStyleSheet(), ie.replaceSync(Be(Qe))), ie;
1187
+ let ue = null;
1188
+ function Oe() {
1189
+ return ue || (ue = new CSSStyleSheet(), ue.replaceSync(Fe(lt))), ue;
835
1190
  }
836
- function Ge(e) {
1191
+ function ct(e) {
837
1192
  return e.replace(/url\s*\(\s*['"]?javascript:[^)]*\)/gi, "").replace(/<script[\s\S]*?>[\s\S]*?<\/script>/gi, "").replace(/expression\s*\([^)]*\)/gi, "");
838
1193
  }
839
- const Qe = Oe`
1194
+ const lt = Ue`
840
1195
  :host, *, ::before, ::after {
841
1196
  all: isolate;
842
1197
  box-sizing: border-box;
@@ -894,7 +1249,7 @@ const Qe = Oe`
894
1249
  sup { top: -.5em }
895
1250
  [disabled], [aria-disabled=true] { cursor: not-allowed }
896
1251
  [hidden] { display: none }
897
- `, Xe = {
1252
+ `, ft = {
898
1253
  neutral: {
899
1254
  50: "#fafafa",
900
1255
  100: "#f4f4f5",
@@ -990,8 +1345,8 @@ const Qe = Oe`
990
1345
  black: { DEFAULT: "#000000" },
991
1346
  transparent: { DEFAULT: "transparent" },
992
1347
  current: { DEFAULT: "currentColor" }
993
- }, et = Object.fromEntries(
994
- Object.entries(Xe).map(([e, t]) => [
1348
+ }, ut = Object.fromEntries(
1349
+ Object.entries(ft).map(([e, t]) => [
995
1350
  e,
996
1351
  Object.fromEntries(
997
1352
  Object.entries(t).map(([r, i]) => [
@@ -1000,7 +1355,7 @@ const Qe = Oe`
1000
1355
  ])
1001
1356
  )
1002
1357
  ])
1003
- ), ge = {
1358
+ ), _e = {
1004
1359
  /* Display */
1005
1360
  block: "display:block;",
1006
1361
  inline: "display:inline;",
@@ -1215,7 +1570,7 @@ const Qe = Oe`
1215
1570
  "z-30": "z-index:30;",
1216
1571
  "z-40": "z-index:40;",
1217
1572
  "z-50": "z-index:50;"
1218
- }, tt = "0.25rem", Se = {
1573
+ }, dt = "0.25rem", Pe = {
1219
1574
  m: ["margin"],
1220
1575
  mx: ["margin-inline"],
1221
1576
  my: ["margin-block"],
@@ -1247,7 +1602,7 @@ const Qe = Oe`
1247
1602
  "gap-x": ["column-gap"],
1248
1603
  "gap-y": ["row-gap"]
1249
1604
  };
1250
- function N(e, t) {
1605
+ function D(e, t) {
1251
1606
  let r = 0, i = 0;
1252
1607
  for (let n = 0; n < e.length; n++) {
1253
1608
  const s = e[n];
@@ -1260,21 +1615,21 @@ function N(e, t) {
1260
1615
  }
1261
1616
  return e + t;
1262
1617
  }
1263
- const rt = {
1618
+ const pt = {
1264
1619
  before: (e, t) => `${e}::before{${t}}`,
1265
1620
  after: (e, t) => `${e}::after{${t}}`,
1266
- hover: (e, t) => `${N(e, ":hover")}{${t}}`,
1267
- focus: (e, t) => `${N(e, ":focus")}{${t}}`,
1268
- active: (e, t) => `${N(e, ":active")}{${t}}`,
1269
- disabled: (e, t) => `${N(e, ":disabled")}{${t}}`,
1270
- visited: (e, t) => `${N(e, ":visited")}{${t}}`,
1271
- checked: (e, t) => `${N(e, ":checked")}{${t}}`,
1272
- first: (e, t) => `${N(e, ":first-child")}{${t}}`,
1273
- last: (e, t) => `${N(e, ":last-child")}{${t}}`,
1274
- odd: (e, t) => `${N(e, ":nth-child(odd)")}{${t}}`,
1275
- even: (e, t) => `${N(e, ":nth-child(even)")}{${t}}`,
1276
- "focus-within": (e, t) => `${N(e, ":focus-within")}{${t}}`,
1277
- "focus-visible": (e, t) => `${N(e, ":focus-visible")}{${t}}`,
1621
+ hover: (e, t) => `${D(e, ":hover")}{${t}}`,
1622
+ focus: (e, t) => `${D(e, ":focus")}{${t}}`,
1623
+ active: (e, t) => `${D(e, ":active")}{${t}}`,
1624
+ disabled: (e, t) => `${D(e, ":disabled")}{${t}}`,
1625
+ visited: (e, t) => `${D(e, ":visited")}{${t}}`,
1626
+ checked: (e, t) => `${D(e, ":checked")}{${t}}`,
1627
+ first: (e, t) => `${D(e, ":first-child")}{${t}}`,
1628
+ last: (e, t) => `${D(e, ":last-child")}{${t}}`,
1629
+ odd: (e, t) => `${D(e, ":nth-child(odd)")}{${t}}`,
1630
+ even: (e, t) => `${D(e, ":nth-child(even)")}{${t}}`,
1631
+ "focus-within": (e, t) => `${D(e, ":focus-within")}{${t}}`,
1632
+ "focus-visible": (e, t) => `${D(e, ":focus-visible")}{${t}}`,
1278
1633
  "group-hover": (e, t) => `.group:hover ${e}{${t}}`,
1279
1634
  "group-focus": (e, t) => `.group:focus ${e}{${t}}`,
1280
1635
  "group-active": (e, t) => `.group:active ${e}{${t}}`,
@@ -1283,7 +1638,7 @@ const rt = {
1283
1638
  "peer-focus": (e, t) => `.peer:focus ~ ${e}{${t}}`,
1284
1639
  "peer-checked": (e, t) => `.peer:checked ~ ${e}{${t}}`,
1285
1640
  "peer-disabled": (e, t) => `.peer:disabled ~ ${e}{${t}}`
1286
- }, me = {
1641
+ }, Ee = {
1287
1642
  // Responsive
1288
1643
  sm: "(min-width:640px)",
1289
1644
  md: "(min-width:768px)",
@@ -1292,23 +1647,23 @@ const rt = {
1292
1647
  "2xl": "(min-width:1536px)",
1293
1648
  // Dark mode (now plain string)
1294
1649
  dark: "(prefers-color-scheme: dark)"
1295
- }, ye = ["sm", "md", "lg", "xl", "2xl"];
1296
- function be(e) {
1650
+ }, $e = ["sm", "md", "lg", "xl", "2xl"];
1651
+ function Se(e) {
1297
1652
  const t = e.startsWith("-"), i = (t ? e.slice(1) : e).split("-");
1298
1653
  if (i.length < 2) return null;
1299
1654
  const n = i.slice(0, -1).join("-"), s = i[i.length - 1], o = parseFloat(s);
1300
- if (Number.isNaN(o) || !Se[n]) return null;
1655
+ if (Number.isNaN(o) || !Pe[n]) return null;
1301
1656
  const a = t ? "-" : "";
1302
- return Se[n].map((f) => `${f}:calc(${a}${tt} * ${o});`).join("");
1657
+ return Pe[n].map((c) => `${c}:calc(${a}${dt} * ${o});`).join("");
1303
1658
  }
1304
- function Ee(e) {
1659
+ function Me(e) {
1305
1660
  const t = e.replace("#", ""), r = parseInt(t, 16), i = r >> 16 & 255, n = r >> 8 & 255, s = r & 255;
1306
1661
  return `${i} ${n} ${s}`;
1307
1662
  }
1308
- function nt(e) {
1663
+ function ht(e) {
1309
1664
  const t = /^(bg|text|border|decoration|shadow|outline|caret|accent|fill|stroke)-([a-z]+)-?(\d{2,3}|DEFAULT)?$/.exec(e);
1310
1665
  if (!t) return null;
1311
- const [, r, i, n = "DEFAULT"] = t, s = et[i]?.[n];
1666
+ const [, r, i, n = "DEFAULT"] = t, s = ut[i]?.[n];
1312
1667
  if (!s) return null;
1313
1668
  if (r === "shadow") return `--ce-shadow-color:${s};`;
1314
1669
  const a = {
@@ -1324,41 +1679,41 @@ function nt(e) {
1324
1679
  }[r];
1325
1680
  return a ? `${a}:${s};` : null;
1326
1681
  }
1327
- function it(e) {
1682
+ function gt(e) {
1328
1683
  const [t, r] = e.split("/");
1329
1684
  if (!r) return { base: t };
1330
1685
  const i = parseInt(r, 10);
1331
1686
  return isNaN(i) || i < 0 || i > 100 ? { base: t } : { base: t, opacity: i / 100 };
1332
1687
  }
1333
- function we(e) {
1334
- const { base: t, opacity: r } = it(e), i = nt(t);
1688
+ function Ce(e) {
1689
+ const { base: t, opacity: r } = gt(e), i = ht(t);
1335
1690
  if (i) {
1336
1691
  if (r !== void 0) {
1337
1692
  const s = /#([0-9a-f]{6})/i.exec(i);
1338
1693
  if (s) {
1339
- const o = Ee(s[0]);
1694
+ const o = Me(s[0]);
1340
1695
  return i.replace(/#([0-9a-f]{6})/i, `rgb(${o} / ${r})`);
1341
1696
  }
1342
1697
  }
1343
1698
  return i;
1344
1699
  }
1345
- const n = ce(t);
1700
+ const n = me(t);
1346
1701
  if (n && r !== void 0) {
1347
1702
  const s = /#([0-9a-f]{6})/i.exec(n);
1348
1703
  if (s) {
1349
- const o = Ee(s[0]);
1704
+ const o = Me(s[0]);
1350
1705
  return n.replace(/#([0-9a-f]{6})/i, `rgb(${o} / ${r})`);
1351
1706
  }
1352
1707
  }
1353
1708
  return n;
1354
1709
  }
1355
- function xe(e) {
1710
+ function Ae(e) {
1356
1711
  const t = /^opacity-(\d{1,3})$/.exec(e);
1357
1712
  if (!t) return null;
1358
1713
  const r = parseInt(t[1], 10);
1359
1714
  return r < 0 || r > 100 ? null : `opacity:${r / 100};`;
1360
1715
  }
1361
- function ce(e) {
1716
+ function me(e) {
1362
1717
  if (e.startsWith("[") && e.endsWith("]") && !e.includes("-[")) {
1363
1718
  const n = e.slice(1, -1).trim().match(/^([a-zA-Z][a-zA-Z0-9-]*)\s*:(.*)$/);
1364
1719
  if (n) {
@@ -1422,7 +1777,7 @@ function ce(e) {
1422
1777
  }
1423
1778
  return null;
1424
1779
  }
1425
- function st(e) {
1780
+ function mt(e) {
1426
1781
  if (e.startsWith("[") && e.endsWith("]")) {
1427
1782
  const r = e.slice(1, -1);
1428
1783
  return r.includes("&") ? r : e;
@@ -1434,10 +1789,10 @@ function st(e) {
1434
1789
  }
1435
1790
  return null;
1436
1791
  }
1437
- function ot(e) {
1792
+ function yt(e) {
1438
1793
  return e.replace(/([!"#$%&'()*+,./:;<=>?@[\\\]^`{|}~])/g, "\\$1");
1439
1794
  }
1440
- function at(e) {
1795
+ function bt(e) {
1441
1796
  const t = /class\s*=\s*(['"])(.*?)\1/g, r = [];
1442
1797
  let i;
1443
1798
  for (; i = t.exec(e); ) {
@@ -1446,32 +1801,32 @@ function at(e) {
1446
1801
  }
1447
1802
  return r.filter(Boolean);
1448
1803
  }
1449
- const Ce = /* @__PURE__ */ new Map(), ct = 16;
1450
- function lt(e) {
1451
- const t = Date.now(), r = Ce.get(e);
1452
- if (r && t - r.timestamp < ct) return r.css;
1453
- const i = at(e), n = new Set(i), s = [], o = [], a = [], f = [], u = {};
1454
- function d(w, b = !1) {
1455
- const m = (b ? "dark|" : "") + w;
1456
- if (m in u) return u[m];
1457
- const x = k(w, b);
1458
- return u[m] = x, x;
1459
- }
1460
- function y(w) {
1461
- const b = w.some((x) => ye.includes(x)), m = w.includes("dark");
1462
- return w.length === 0 ? 1 : !b && !m ? 2 : b && !m ? 3 : 4;
1463
- }
1464
- function c(w) {
1465
- const b = [];
1466
- let m = "", x = 0, l = 0;
1467
- for (let g = 0; g < w.length; g++) {
1468
- const p = w[g];
1469
- p === "[" ? x++ : p === "]" && x > 0 ? x-- : p === "(" ? l++ : p === ")" && l > 0 && l--, p === ":" && x === 0 && l === 0 ? (b.push(m), m = "") : m += p;
1470
- }
1471
- return m && b.push(m), b;
1472
- }
1473
- function h(w) {
1474
- switch (w) {
1804
+ const Be = /* @__PURE__ */ new Map(), wt = 16;
1805
+ function xt(e) {
1806
+ const t = Date.now(), r = Be.get(e);
1807
+ if (r && t - r.timestamp < wt) return r.css;
1808
+ const i = bt(e), n = new Set(i), s = [], o = [], a = [], c = [], u = {};
1809
+ function m(d, g = !1) {
1810
+ const y = (g ? "dark|" : "") + d;
1811
+ if (y in u) return u[y];
1812
+ const x = w(d, g);
1813
+ return u[y] = x, x;
1814
+ }
1815
+ function T(d) {
1816
+ const g = d.some((x) => $e.includes(x)), y = d.includes("dark");
1817
+ return d.length === 0 ? 1 : !g && !y ? 2 : g && !y ? 3 : 4;
1818
+ }
1819
+ function p(d) {
1820
+ const g = [];
1821
+ let y = "", x = 0, f = 0;
1822
+ for (let b = 0; b < d.length; b++) {
1823
+ const h = d[b];
1824
+ h === "[" ? x++ : h === "]" && x > 0 ? x-- : h === "(" ? f++ : h === ")" && f > 0 && f--, h === ":" && x === 0 && f === 0 ? (g.push(y), y = "") : y += h;
1825
+ }
1826
+ return y && g.push(y), g;
1827
+ }
1828
+ function l(d) {
1829
+ switch (d) {
1475
1830
  case "hover":
1476
1831
  return ":hover";
1477
1832
  case "focus":
@@ -1500,132 +1855,132 @@ function lt(e) {
1500
1855
  return null;
1501
1856
  }
1502
1857
  }
1503
- function k(w, b = !1) {
1504
- const m = c(w);
1858
+ function w(d, g = !1) {
1859
+ const y = p(d);
1505
1860
  let x = !1;
1506
- const l = m.find((v) => (v.startsWith("!") && (x = !0, v = v.slice(1)), ge[v] || be(v) || xe(v) || we(v) || ce(v)));
1507
- if (!l) return null;
1508
- const g = l.replace(/^!/, ""), p = ge[g] ?? be(g) ?? xe(g) ?? we(g) ?? ce(g);
1509
- if (!p) return null;
1510
- const _ = m.indexOf(l);
1511
- let C = _ >= 0 ? m.slice(0, _) : [];
1512
- b && (C = C.filter((v) => v !== "dark"));
1513
- const E = `.${ot(w)}`, S = "__SUBJECT__", A = x ? p.replace(/;$/, " !important;") : p;
1514
- let j = S;
1515
- const Q = [];
1516
- for (const v of C)
1517
- v.startsWith("group-") ? (j = `.group:${v.slice(6)} ${j}`, Q.push(v)) : v.startsWith("peer-") && (j = j.replace(S, `.peer:${v.slice(5)}~${S}`), Q.push(v));
1518
- C = C.filter((v) => !Q.includes(v));
1519
- const X = [], de = [];
1520
- let q = null;
1521
- for (const v of C) {
1522
- if (v === "dark" || ye.includes(v)) continue;
1523
- const B = st(v);
1524
- if (B) {
1525
- q = B;
1861
+ const f = y.find((k) => (k.startsWith("!") && (x = !0, k = k.slice(1)), _e[k] || Se(k) || Ae(k) || Ce(k) || me(k)));
1862
+ if (!f) return null;
1863
+ const b = f.replace(/^!/, ""), h = _e[b] ?? Se(b) ?? Ae(b) ?? Ce(b) ?? me(b);
1864
+ if (!h) return null;
1865
+ const _ = y.indexOf(f);
1866
+ let $ = _ >= 0 ? y.slice(0, _) : [];
1867
+ g && ($ = $.filter((k) => k !== "dark"));
1868
+ const S = `.${yt(d)}`, E = "__SUBJECT__", C = x ? h.replace(/;$/, " !important;") : h;
1869
+ let A = E;
1870
+ const P = [];
1871
+ for (const k of $)
1872
+ k.startsWith("group-") ? (A = `.group:${k.slice(6)} ${A}`, P.push(k)) : k.startsWith("peer-") && (A = A.replace(E, `.peer:${k.slice(5)}~${E}`), P.push(k));
1873
+ $ = $.filter((k) => !P.includes(k));
1874
+ const X = [], ie = [];
1875
+ let M = null;
1876
+ for (const k of $) {
1877
+ if (k === "dark" || $e.includes(k)) continue;
1878
+ const W = mt(k);
1879
+ if (W) {
1880
+ M = W;
1526
1881
  continue;
1527
1882
  }
1528
- const O = h(v);
1529
- if (O) {
1530
- q ? de.push(O) : X.push(O);
1883
+ const R = l(k);
1884
+ if (R) {
1885
+ M ? ie.push(R) : X.push(R);
1531
1886
  continue;
1532
1887
  }
1533
- const P = rt[v];
1534
- typeof P == "function" && (j = P(j, A).split("{")[0]);
1535
- }
1536
- function I(v, B) {
1537
- if (!B) return v;
1538
- let O = 0, P = 0;
1539
- if (v.length && (v[0] === ">" || v[0] === "+" || v[0] === "~" || v[0] === " ")) {
1540
- let T = 1;
1541
- for (; T < v.length && v[T] === " "; ) T++;
1542
- for (; T < v.length; T++) {
1543
- const R = v[T];
1544
- if (R === "[" ? O++ : R === "]" && O > 0 ? O-- : R === "(" ? P++ : R === ")" && P > 0 && P--, O === 0 && P === 0 && (v[T] === ">" || v[T] === "+" || v[T] === "~" || v[T] === " "))
1545
- return v.slice(0, T) + B + v.slice(T);
1888
+ const B = pt[k];
1889
+ typeof B == "function" && (A = B(A, C).split("{")[0]);
1890
+ }
1891
+ function F(k, W) {
1892
+ if (!W) return k;
1893
+ let R = 0, B = 0;
1894
+ if (k.length && (k[0] === ">" || k[0] === "+" || k[0] === "~" || k[0] === " ")) {
1895
+ let j = 1;
1896
+ for (; j < k.length && k[j] === " "; ) j++;
1897
+ for (; j < k.length; j++) {
1898
+ const L = k[j];
1899
+ if (L === "[" ? R++ : L === "]" && R > 0 ? R-- : L === "(" ? B++ : L === ")" && B > 0 && B--, R === 0 && B === 0 && (k[j] === ">" || k[j] === "+" || k[j] === "~" || k[j] === " "))
1900
+ return k.slice(0, j) + W + k.slice(j);
1546
1901
  }
1547
- return v + B;
1902
+ return k + W;
1548
1903
  }
1549
- for (let T = 0; T < v.length; T++) {
1550
- const R = v[T];
1551
- if (R === "[" ? O++ : R === "]" && O > 0 ? O-- : R === "(" ? P++ : R === ")" && P > 0 && P--, O === 0 && P === 0 && (R === ">" || R === "+" || R === "~" || R === " "))
1552
- return v.slice(0, T) + B + v.slice(T);
1904
+ for (let j = 0; j < k.length; j++) {
1905
+ const L = k[j];
1906
+ if (L === "[" ? R++ : L === "]" && R > 0 ? R-- : L === "(" ? B++ : L === ")" && B > 0 && B--, R === 0 && B === 0 && (L === ">" || L === "+" || L === "~" || L === " "))
1907
+ return k.slice(0, j) + W + k.slice(j);
1553
1908
  }
1554
- return v + B;
1909
+ return k + W;
1555
1910
  }
1556
- const Z = X.join(""), F = de.join("");
1557
- if (q)
1558
- if (q.includes("&")) {
1559
- const v = q.indexOf("&"), B = q.slice(0, v), O = q.slice(v + 1), P = S + Z, T = j;
1911
+ const H = X.join(""), N = ie.join("");
1912
+ if (M)
1913
+ if (M.includes("&")) {
1914
+ const k = M.indexOf("&"), W = M.slice(0, k), R = M.slice(k + 1), B = E + H, j = A;
1560
1915
  if (X.length === 0)
1561
- j = T.replace(S, B + P + F + O);
1916
+ A = j.replace(E, W + B + N + R);
1562
1917
  else {
1563
- const R = I(O, F);
1564
- j = T.replace(S, B + P + R);
1918
+ const L = F(R, N);
1919
+ A = j.replace(E, W + B + L);
1565
1920
  }
1566
1921
  } else
1567
- j = j.replace(S, `${q}${S + Z}`), F && (j = j.replace(S, `${S}${F}`));
1922
+ A = A.replace(E, `${M}${E + H}`), N && (A = A.replace(E, `${E}${N}`));
1568
1923
  else
1569
- j = S + Z + F;
1570
- j = j.replace(new RegExp(S, "g"), E);
1571
- let L = `${j}{${A}}`;
1572
- const K = C.filter((v) => ye.includes(v)), D = K.length ? K[K.length - 1] : null, ne = C.includes("dark");
1573
- return b && D ? L = `@media (prefers-color-scheme: dark) and ${me[D]}{${L}}` : b ? L = `@media (prefers-color-scheme: dark){${L}}` : ne && D ? L = `@media (prefers-color-scheme: dark) and ${me[D]}{${L}}` : ne ? L = `@media (prefers-color-scheme: dark){${L}}` : D && (L = `@media ${me[D]}{${L}}`), L;
1574
- }
1575
- for (const w of n) {
1576
- const b = c(w), m = b.find(
1577
- (p) => ge[p] || be(p) || xe(p) || we(p) || ce(p)
1924
+ A = E + H + N;
1925
+ A = A.replace(new RegExp(E, "g"), S);
1926
+ let I = `${A}{${C}}`;
1927
+ const z = $.filter((k) => $e.includes(k)), J = z.length ? z[z.length - 1] : null, se = $.includes("dark");
1928
+ return g && J ? I = `@media (prefers-color-scheme: dark) and ${Ee[J]}{${I}}` : g ? I = `@media (prefers-color-scheme: dark){${I}}` : se && J ? I = `@media (prefers-color-scheme: dark) and ${Ee[J]}{${I}}` : se ? I = `@media (prefers-color-scheme: dark){${I}}` : J && (I = `@media ${Ee[J]}{${I}}`), I;
1929
+ }
1930
+ for (const d of n) {
1931
+ const g = p(d), y = g.find(
1932
+ (h) => _e[h] || Se(h) || Ae(h) || Ce(h) || me(h)
1578
1933
  );
1579
- if (!m) continue;
1580
- const x = b.indexOf(m), l = x >= 0 ? b.slice(0, x) : [], g = y(l);
1581
- if (g === 4) {
1582
- const p = d(w, !0);
1583
- p && f.push(p);
1934
+ if (!y) continue;
1935
+ const x = g.indexOf(y), f = x >= 0 ? g.slice(0, x) : [], b = T(f);
1936
+ if (b === 4) {
1937
+ const h = m(d, !0);
1938
+ h && c.push(h);
1584
1939
  } else {
1585
- const p = d(w);
1586
- p && (g === 1 ? s.push(p) : g === 2 ? o.push(p) : g === 3 && a.push(p));
1940
+ const h = m(d);
1941
+ h && (b === 1 ? s.push(h) : b === 2 ? o.push(h) : b === 3 && a.push(h));
1587
1942
  }
1588
1943
  }
1589
- const $ = [...s, ...o, ...a, ...f].join("");
1590
- return Ce.set(e, { css: $, timestamp: t }), $;
1944
+ const v = [...s, ...o, ...a, ...c].join("");
1945
+ return Be.set(e, { css: v, timestamp: t }), v;
1591
1946
  }
1592
- const te = [];
1593
- function ft(e, t, r, i, n, s, o, a) {
1947
+ const ce = [];
1948
+ function vt(e, t, r, i, n, s, o, a) {
1594
1949
  if (e) {
1595
- te.push(r);
1950
+ ce.push(r);
1596
1951
  try {
1597
1952
  if (t.loadingTemplate && r.isLoading) {
1598
- Y(e, t.loadingTemplate(r), r, i, n);
1953
+ re(e, t.loadingTemplate(r), r, i, n);
1599
1954
  return;
1600
1955
  }
1601
1956
  if (t.errorTemplate && r.hasError) {
1602
- r.error instanceof Error && Y(e, t.errorTemplate(r.error, r), r, i, n);
1957
+ r.error instanceof Error && re(e, t.errorTemplate(r.error, r), r, i, n);
1603
1958
  return;
1604
1959
  }
1605
- const f = t.render(r);
1606
- if (f instanceof Promise) {
1607
- s(!0), f.then((u) => {
1608
- s(!1), o(null), Y(e, u, r, i, n), a(e.innerHTML);
1960
+ const c = t.render(r);
1961
+ if (c instanceof Promise) {
1962
+ s(!0), c.then((u) => {
1963
+ s(!1), o(null), re(e, u, r, i, n), a(e.innerHTML);
1609
1964
  }).catch((u) => {
1610
- s(!1), o(u), t.errorTemplate && Y(e, t.errorTemplate(u, r), r, i, n);
1611
- }), t.loadingTemplate && Y(e, t.loadingTemplate(r), r, i, n);
1965
+ s(!1), o(u), t.errorTemplate && re(e, t.errorTemplate(u, r), r, i, n);
1966
+ }), t.loadingTemplate && re(e, t.loadingTemplate(r), r, i, n);
1612
1967
  return;
1613
1968
  }
1614
- Y(e, f, r, i, n), a(e.innerHTML);
1969
+ re(e, c, r, i, n), a(e.innerHTML);
1615
1970
  } finally {
1616
- te.pop();
1971
+ ce.pop();
1617
1972
  }
1618
1973
  }
1619
1974
  }
1620
- function Y(e, t, r, i, n) {
1621
- e && (Ye(
1975
+ function re(e, t, r, i, n) {
1976
+ e && (at(
1622
1977
  e,
1623
1978
  Array.isArray(t) ? t : [t],
1624
1979
  r,
1625
1980
  i
1626
1981
  ), n(e.innerHTML));
1627
1982
  }
1628
- function ut(e, t, r, i, n, s, o) {
1983
+ function kt(e, t, r, i, n, s, o) {
1629
1984
  if (s !== null && clearTimeout(s), Date.now() - t < 16) {
1630
1985
  if (n(r + 1), r > 10) {
1631
1986
  o(null);
@@ -1633,38 +1988,73 @@ function ut(e, t, r, i, n, s, o) {
1633
1988
  }
1634
1989
  } else
1635
1990
  n(0);
1636
- const f = setTimeout(() => {
1991
+ const c = setTimeout(() => {
1637
1992
  i(Date.now()), e(), o(null);
1638
1993
  }, 0);
1639
- o(f);
1994
+ o(c);
1640
1995
  }
1641
- function dt(e, t, r, i, n, s) {
1996
+ function _t(e, t, r, i, n, s) {
1642
1997
  if (!e) return;
1643
- const o = lt(i);
1998
+ const o = xt(i);
1644
1999
  if (!t.style && (!o || o.trim() === "")) {
1645
- s(null), e.adoptedStyleSheets = [_e()];
2000
+ s(null), e.adoptedStyleSheets = [Oe()];
1646
2001
  return;
1647
2002
  }
1648
2003
  let a = "";
1649
2004
  t.style && (typeof t.style == "string" ? a = t.style : typeof t.style == "function" && (a = t.style(r)));
1650
- let f = Ge(`${a}
2005
+ let c = ct(`${a}
1651
2006
  ${o}
1652
2007
  `);
1653
- f = Be(f);
2008
+ c = Fe(c);
1654
2009
  let u = n;
1655
- u || (u = new CSSStyleSheet()), (u.cssRules.length === 0 || u.toString() !== f) && u.replaceSync(f), e.adoptedStyleSheets = [_e(), u], s(u);
2010
+ u || (u = new CSSStyleSheet()), (u.cssRules.length === 0 || u.toString() !== c) && u.replaceSync(c), e.adoptedStyleSheets = [Oe(), u], s(u);
1656
2011
  }
1657
- const ue = /* @__PURE__ */ new Map(), Ae = Symbol.for("cer.registry");
2012
+ class Et {
2013
+ pendingUpdates = /* @__PURE__ */ new Map();
2014
+ isFlushScheduled = !1;
2015
+ /**
2016
+ * Schedule an update to be executed in the next microtask
2017
+ * Uses component identity to deduplicate multiple render requests for the same component
2018
+ */
2019
+ schedule(t, r) {
2020
+ const i = r || t.toString();
2021
+ this.pendingUpdates.set(i, t), this.isFlushScheduled || (this.isFlushScheduled = !0, typeof globalThis.process < "u" && globalThis.process.env?.NODE_ENV === "test" || typeof window < "u" && (window.__vitest__ || window.Cypress) ? this.flush() : queueMicrotask(() => this.flush()));
2022
+ }
2023
+ /**
2024
+ * Execute all pending updates
2025
+ */
2026
+ flush() {
2027
+ const t = Array.from(this.pendingUpdates.values());
2028
+ this.pendingUpdates.clear(), this.isFlushScheduled = !1;
2029
+ for (const r of t)
2030
+ try {
2031
+ r();
2032
+ } catch (i) {
2033
+ typeof console < "u" && console.error && console.error("Error in batched update:", i);
2034
+ }
2035
+ }
2036
+ /**
2037
+ * Get the number of pending updates
2038
+ */
2039
+ get pendingCount() {
2040
+ return this.pendingUpdates.size;
2041
+ }
2042
+ }
2043
+ const $t = new Et();
2044
+ function oe(e, t) {
2045
+ $t.schedule(e, t);
2046
+ }
2047
+ const be = /* @__PURE__ */ new Map(), We = Symbol.for("cer.registry");
1658
2048
  if (typeof window < "u") {
1659
2049
  const e = globalThis;
1660
- e[Ae] || (e[Ae] = ue);
2050
+ e[We] || (e[We] = be);
1661
2051
  }
1662
- function je(e, t, r) {
1663
- let i = J(e);
2052
+ function Ie(e, t, r) {
2053
+ let i = Q(e);
1664
2054
  i.includes("-") || (i = `cer-${i}`);
1665
2055
  let n;
1666
2056
  typeof t == "function" ? n = { ...r, render: t } : n = t, typeof n.onError != "function" && (n.onError = (s, o) => {
1667
- console.error(`[${i}] Error:`, s, o);
2057
+ Y(`[${i}] Error:`, s, o);
1668
2058
  });
1669
2059
  try {
1670
2060
  const s = /* @__PURE__ */ new Set([
@@ -1683,15 +2073,15 @@ function je(e, t, r) {
1683
2073
  s.has(a) && o.push(a);
1684
2074
  }), o.length > 0) {
1685
2075
  const a = Array.from(new Set(o));
1686
- console.warn(
2076
+ pe(
1687
2077
  `[${i}] Reserved runtime context keys used in component config: ${a.join(", ")}. These names are provided by the runtime (for example: refs, error, emit). Rename your state/prop/computed keys (e.g. 'error' -> 'errorMessage') to avoid collisions and TypeScript type conflicts.`
1688
2078
  );
1689
2079
  }
1690
2080
  } catch {
1691
2081
  }
1692
- if (ue.set(i, n), typeof window < "u")
2082
+ if (be.set(i, n), typeof window < "u")
1693
2083
  if (!customElements.get(i))
1694
- customElements.define(i, pt(i, n));
2084
+ customElements.define(i, St(i, n));
1695
2085
  else
1696
2086
  try {
1697
2087
  document.querySelectorAll(i).forEach((s) => {
@@ -1703,7 +2093,7 @@ function je(e, t, r) {
1703
2093
  } catch {
1704
2094
  }
1705
2095
  }
1706
- function pt(e, t) {
2096
+ function St(e, t) {
1707
2097
  if (!t.render)
1708
2098
  throw new Error(
1709
2099
  "Component must have a render function"
@@ -1721,6 +2111,7 @@ function pt(e, t) {
1721
2111
  _mounted = !1;
1722
2112
  _hasError = !1;
1723
2113
  _initializing = !0;
2114
+ _componentId;
1724
2115
  _styleSheet = null;
1725
2116
  _lastHtmlStringForJitCSS = "";
1726
2117
  /**
@@ -1747,7 +2138,7 @@ function pt(e, t) {
1747
2138
  _templateLoading = !1;
1748
2139
  _templateError = null;
1749
2140
  constructor() {
1750
- super(), this.attachShadow({ mode: "open" }), this._cfg = ue.get(e) || t;
2141
+ super(), this.attachShadow({ mode: "open" }), this._cfg = be.get(e) || t, this._componentId = `${e}-${Math.random().toString(36).substr(2, 9)}`;
1751
2142
  const r = this._initContext(t);
1752
2143
  Object.defineProperty(r, "refs", {
1753
2144
  value: this._refs,
@@ -1759,6 +2150,16 @@ function pt(e, t) {
1759
2150
  writable: !1,
1760
2151
  enumerable: !1,
1761
2152
  configurable: !1
2153
+ }), Object.defineProperty(r, "_requestRender", {
2154
+ value: () => this._requestRender(),
2155
+ writable: !1,
2156
+ enumerable: !1,
2157
+ configurable: !1
2158
+ }), Object.defineProperty(r, "_triggerWatchers", {
2159
+ value: (n, s) => this._triggerWatchers(n, s),
2160
+ writable: !1,
2161
+ enumerable: !1,
2162
+ configurable: !1
1762
2163
  }), this.context = r, Object.defineProperty(this.context, "emit", {
1763
2164
  value: (n, s, o) => {
1764
2165
  const a = new CustomEvent(n, {
@@ -1773,15 +2174,28 @@ function pt(e, t) {
1773
2174
  enumerable: !1,
1774
2175
  configurable: !1
1775
2176
  });
1776
- const i = ue.get(e) || t;
2177
+ const i = be.get(e) || t;
1777
2178
  Object.keys(i).forEach((n) => {
1778
2179
  const s = i[n];
1779
2180
  typeof s == "function" && (this.context[n] = (...o) => s(...o, this.context));
1780
- }), this._applyComputed(i), this._initializing = !1, this._initWatchers(i), this._render(i);
2181
+ }), this._applyComputed(i), i.props && Object.keys(i.props).forEach((n) => {
2182
+ let s = this[n];
2183
+ Object.defineProperty(this, n, {
2184
+ get() {
2185
+ return s;
2186
+ },
2187
+ set(o) {
2188
+ const a = s;
2189
+ s = o, this.context[n] = o, this._initializing || (this._applyProps(i), a !== o && this._requestRender());
2190
+ },
2191
+ enumerable: !0,
2192
+ configurable: !0
2193
+ });
2194
+ }), this._initializing = !1, this._initWatchers(i), this._render(i);
1781
2195
  }
1782
2196
  connectedCallback() {
1783
2197
  this._runLogicWithinErrorBoundary(t, () => {
1784
- this._applyProps(t), qe(
2198
+ this._applyProps(t), Qe(
1785
2199
  t,
1786
2200
  this.context,
1787
2201
  this._mounted,
@@ -1793,7 +2207,7 @@ function pt(e, t) {
1793
2207
  }
1794
2208
  disconnectedCallback() {
1795
2209
  this._runLogicWithinErrorBoundary(t, () => {
1796
- De(
2210
+ Xe(
1797
2211
  t,
1798
2212
  this.context,
1799
2213
  this._listeners,
@@ -1817,7 +2231,7 @@ function pt(e, t) {
1817
2231
  }
1818
2232
  attributeChangedCallback(r, i, n) {
1819
2233
  this._runLogicWithinErrorBoundary(t, () => {
1820
- this._applyProps(t), Ie(
2234
+ this._applyProps(t), et(
1821
2235
  t,
1822
2236
  r,
1823
2237
  i,
@@ -1827,7 +2241,7 @@ function pt(e, t) {
1827
2241
  });
1828
2242
  }
1829
2243
  static get observedAttributes() {
1830
- return t.props ? Object.keys(t.props).map(J) : [];
2244
+ return t.props ? Object.keys(t.props).map(Q) : [];
1831
2245
  }
1832
2246
  _applyComputed(r) {
1833
2247
  this._runLogicWithinErrorBoundary(t, () => {
@@ -1835,7 +2249,7 @@ function pt(e, t) {
1835
2249
  Object.defineProperty(this.context, i, {
1836
2250
  get: () => {
1837
2251
  const s = n(this.context);
1838
- return H(s);
2252
+ return Z(s);
1839
2253
  },
1840
2254
  enumerable: !0
1841
2255
  });
@@ -1845,7 +2259,7 @@ function pt(e, t) {
1845
2259
  // --- Render ---
1846
2260
  _render(r) {
1847
2261
  this._runLogicWithinErrorBoundary(r, () => {
1848
- ft(
2262
+ vt(
1849
2263
  this.shadowRoot,
1850
2264
  r,
1851
2265
  this.context,
@@ -1868,27 +2282,29 @@ function pt(e, t) {
1868
2282
  }
1869
2283
  _requestRender() {
1870
2284
  this._runLogicWithinErrorBoundary(this._cfg, () => {
1871
- ut(
1872
- () => this._render(this._cfg),
1873
- this._lastRenderTime,
1874
- this._renderCount,
1875
- (r) => {
1876
- this._lastRenderTime = r;
1877
- },
1878
- (r) => {
1879
- this._renderCount = r;
1880
- },
1881
- this._renderTimeoutId,
1882
- (r) => {
1883
- this._renderTimeoutId = r;
1884
- }
1885
- );
2285
+ oe(() => {
2286
+ kt(
2287
+ () => this._render(this._cfg),
2288
+ this._lastRenderTime,
2289
+ this._renderCount,
2290
+ (r) => {
2291
+ this._lastRenderTime = r;
2292
+ },
2293
+ (r) => {
2294
+ this._renderCount = r;
2295
+ },
2296
+ this._renderTimeoutId,
2297
+ (r) => {
2298
+ this._renderTimeoutId = r;
2299
+ }
2300
+ );
2301
+ }, this._componentId);
1886
2302
  });
1887
2303
  }
1888
2304
  // --- Style ---
1889
2305
  _applyStyle(r, i) {
1890
2306
  this._runLogicWithinErrorBoundary(r, () => {
1891
- dt(
2307
+ _t(
1892
2308
  this.shadowRoot,
1893
2309
  r,
1894
2310
  this.context,
@@ -1917,9 +2333,9 @@ function pt(e, t) {
1917
2333
  try {
1918
2334
  let i = function(s, o = "") {
1919
2335
  return Array.isArray(s) ? new Proxy(s, {
1920
- get(a, f, u) {
1921
- const d = Reflect.get(a, f, u);
1922
- return typeof d == "function" && typeof f == "string" && [
2336
+ get(a, c, u) {
2337
+ const m = Reflect.get(a, c, u);
2338
+ return typeof m == "function" && typeof c == "string" && [
1923
2339
  "push",
1924
2340
  "pop",
1925
2341
  "shift",
@@ -1927,42 +2343,42 @@ function pt(e, t) {
1927
2343
  "splice",
1928
2344
  "sort",
1929
2345
  "reverse"
1930
- ].includes(f) ? function(...c) {
1931
- const h = d.apply(a, c);
2346
+ ].includes(c) ? function(...p) {
2347
+ const l = m.apply(a, p);
1932
2348
  if (!n._initializing) {
1933
- const k = o || "root";
1934
- n._triggerWatchers(k, a), n._render(r);
2349
+ const w = o || "root";
2350
+ n._triggerWatchers(w, a), oe(() => n._render(r), n._componentId);
1935
2351
  }
1936
- return h;
1937
- } : d;
2352
+ return l;
2353
+ } : m;
1938
2354
  },
1939
- set(a, f, u) {
1940
- if (a[f] = u, !n._initializing) {
1941
- const d = o ? `${o}.${String(f)}` : String(f);
1942
- n._triggerWatchers(d, u), n._render(r);
2355
+ set(a, c, u) {
2356
+ if (a[c] = u, !n._initializing) {
2357
+ const m = o ? `${o}.${String(c)}` : String(c);
2358
+ n._triggerWatchers(m, u), oe(() => n._render(r), n._componentId);
1943
2359
  }
1944
2360
  return !0;
1945
2361
  },
1946
- deleteProperty(a, f) {
1947
- if (delete a[f], !n._initializing) {
1948
- const u = o ? `${o}.${String(f)}` : String(f);
1949
- n._triggerWatchers(u, void 0), n._render(r);
2362
+ deleteProperty(a, c) {
2363
+ if (delete a[c], !n._initializing) {
2364
+ const u = o ? `${o}.${String(c)}` : String(c);
2365
+ n._triggerWatchers(u, void 0), oe(() => n._render(r), n._componentId);
1950
2366
  }
1951
2367
  return !0;
1952
2368
  }
1953
2369
  }) : s && typeof s == "object" ? (Object.keys(s).forEach((a) => {
1954
- const f = o ? `${o}.${a}` : a;
1955
- s[a] = i(s[a], f);
2370
+ const c = o ? `${o}.${a}` : a;
2371
+ s[a] = i(s[a], c);
1956
2372
  }), new Proxy(s, {
1957
- set(a, f, u) {
1958
- const d = o ? `${o}.${String(f)}` : String(f);
1959
- return a[f] = i(u, d), n._initializing || (n._triggerWatchers(
1960
- d,
1961
- a[f]
1962
- ), n._render(r)), !0;
2373
+ set(a, c, u) {
2374
+ const m = o ? `${o}.${String(c)}` : String(c);
2375
+ return a[c] = i(u, m), n._initializing || (n._triggerWatchers(
2376
+ m,
2377
+ a[c]
2378
+ ), oe(() => n._render(r), n._componentId)), !0;
1963
2379
  },
1964
- get(a, f, u) {
1965
- return Reflect.get(a, f, u);
2380
+ get(a, c, u) {
2381
+ return Reflect.get(a, c, u);
1966
2382
  }
1967
2383
  })) : s;
1968
2384
  };
@@ -1974,7 +2390,7 @@ function pt(e, t) {
1974
2390
  }
1975
2391
  _initWatchers(r) {
1976
2392
  this._runLogicWithinErrorBoundary(r, () => {
1977
- ze(
2393
+ Ge(
1978
2394
  this.context,
1979
2395
  this._watchers,
1980
2396
  r.watch || {}
@@ -1982,12 +2398,12 @@ function pt(e, t) {
1982
2398
  });
1983
2399
  }
1984
2400
  _triggerWatchers(r, i) {
1985
- Me(this.context, this._watchers, r, i);
2401
+ Ze(this.context, this._watchers, r, i);
1986
2402
  }
1987
2403
  _applyProps(r) {
1988
2404
  this._runLogicWithinErrorBoundary(r, () => {
1989
2405
  try {
1990
- We(this, r, this.context);
2406
+ Ye(this, r, this.context);
1991
2407
  } catch (i) {
1992
2408
  this._hasError = !0, r.onError && r.onError(i, this.context), r.errorFallback && this.shadowRoot && (this.shadowRoot.innerHTML = r.errorFallback(i, this.context));
1993
2409
  }
@@ -1995,103 +2411,109 @@ function pt(e, t) {
1995
2411
  }
1996
2412
  };
1997
2413
  }
1998
- function ee(e, t = {}, r, i) {
2414
+ function ae(e, t = {}, r, i) {
1999
2415
  const n = i ?? t.key;
2000
2416
  return { tag: e, key: n, props: t, children: r };
2001
2417
  }
2002
- function le(e) {
2418
+ function ye(e) {
2003
2419
  return !!e && typeof e == "object" && (e.type === "AnchorBlock" || e.tag === "#anchor");
2004
2420
  }
2005
- function se(e) {
2006
- return typeof e == "object" && e !== null && "tag" in e && !le(e);
2421
+ function de(e) {
2422
+ return typeof e == "object" && e !== null && "tag" in e && !ye(e);
2007
2423
  }
2008
- function ht(e, t) {
2424
+ function Ct(e, t) {
2009
2425
  return e.key != null ? e : { ...e, key: t };
2010
2426
  }
2011
- function gt(e, t = [], r = {}) {
2012
- const i = {}, n = {}, s = {}, o = /([:@#]?)([a-zA-Z0-9-:\.]+)=("([^"\\]*(\\.[^"\\]*)*)"|'([^'\\]*(\\.[^'\\]*)*)')/g;
2013
- let a;
2014
- for (; a = o.exec(e); ) {
2015
- const f = a[1], u = a[2], d = (a[4] || a[6]) ?? "", y = d.match(/^{{(\d+)}}$/);
2016
- let c = y ? t[Number(y[1])] ?? null : d;
2017
- y || (c === "true" ? c = !0 : c === "false" ? c = !1 : c === "null" ? c = null : isNaN(Number(c)) || (c = Number(c)));
2018
- const h = ["model", "bind", "show", "class", "style"];
2019
- if (f === ":") {
2020
- const [k, $] = u.split(":"), [w, ...b] = k.split(".");
2021
- if (h.includes(w)) {
2022
- const m = [...b], x = w === "model" && $ ? `model:${$}` : w;
2023
- s[x] = {
2024
- value: c,
2025
- modifiers: m,
2026
- arg: $
2427
+ function At(e, t = [], r = {}) {
2428
+ const i = {}, n = {}, s = {}, o = [], a = /([:@#]?)([a-zA-Z0-9-:\.]+)=("([^"\\]*(\\.[^"\\]*)*)"|'([^'\\]*(\\.[^'\\]*)*)')/g;
2429
+ let c;
2430
+ for (; c = a.exec(e); ) {
2431
+ const u = c[1], m = c[2], T = (c[4] || c[6]) ?? "", p = T.match(/^{{(\d+)}}$/);
2432
+ let l = p ? t[Number(p[1])] ?? null : T;
2433
+ p || (l === "true" ? l = !0 : l === "false" ? l = !1 : l === "null" ? l = null : isNaN(Number(l)) || (l = Number(l)));
2434
+ const w = ["model", "bind", "show", "class", "style"];
2435
+ if (u === ":") {
2436
+ const [v, d] = m.split(":"), [g, ...y] = v.split(".");
2437
+ if (w.includes(g)) {
2438
+ const x = [...y], f = g === "model" && d ? `model:${d}` : g;
2439
+ s[f] = {
2440
+ value: l,
2441
+ modifiers: x,
2442
+ arg: d
2027
2443
  };
2028
2444
  } else
2029
- n[u] = c;
2030
- } else if (f === "@") {
2031
- const k = "on" + u.charAt(0).toUpperCase() + u.slice(1);
2032
- i[k] = typeof c == "function" ? c : typeof r[c] == "function" ? r[c] : void 0;
2033
- } else u === "ref" ? i.ref = c : n[u] = c;
2445
+ n[m] = l, o.push(m);
2446
+ } else if (u === "@") {
2447
+ const [v, ...d] = m.split("."), g = d, y = typeof l == "function" ? l : typeof r[l] == "function" ? r[l] : void 0;
2448
+ if (y) {
2449
+ const x = (b) => {
2450
+ if (g.includes("prevent") && b.preventDefault(), g.includes("stop") && b.stopPropagation(), !(g.includes("self") && b.target !== b.currentTarget))
2451
+ return g.includes("once") && b.currentTarget?.removeEventListener(v, x), y(b);
2452
+ }, f = "on" + v.charAt(0).toUpperCase() + v.slice(1);
2453
+ i[f] = x;
2454
+ }
2455
+ } else m === "ref" ? i.ref = l : n[m] = l;
2034
2456
  }
2035
- return { props: i, attrs: n, directives: s };
2457
+ return { props: i, attrs: n, directives: s, bound: o };
2036
2458
  }
2037
- function mt(e, t, r) {
2038
- const i = te.length > 0 ? te[te.length - 1] : void 0, n = r ?? i;
2039
- function s(l, g) {
2040
- return ee("#text", {}, l, g);
2459
+ function Tt(e, t, r) {
2460
+ const i = ce.length > 0 ? ce[ce.length - 1] : void 0, n = r ?? i;
2461
+ function s(f, b) {
2462
+ return ae("#text", {}, f, b);
2041
2463
  }
2042
2464
  let o = "";
2043
- for (let l = 0; l < e.length; l++)
2044
- o += e[l], l < t.length && (o += `{{${l}}}`);
2045
- const a = /<\/?([a-zA-Z0-9-]+)((?:\s+[^\s=>/]+(?:\s*=\s*(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|[^\s>]+))?)*)\s*\/?>|{{(\d+)}}|([^<]+)/g, f = [];
2046
- let u, d = [], y = null, c = {}, h, k = 0, $ = [];
2047
- function w(l) {
2048
- !l || typeof l != "object" || le(l) || (l.props || l.attrs ? (l.props && (c.props || (c.props = {}), Object.assign(c.props, l.props)), l.attrs && (c.attrs || (c.attrs = {}), Object.keys(l.attrs).forEach((g) => {
2049
- if (g === "style" && c.attrs.style) {
2050
- const p = c.attrs.style.replace(
2465
+ for (let f = 0; f < e.length; f++)
2466
+ o += e[f], f < t.length && (o += `{{${f}}}`);
2467
+ const a = /<!--[\s\S]*?-->|<\/?([a-zA-Z0-9-]+)((?:\s+[^\s=>/]+(?:\s*=\s*(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|[^\s>]+))?)*)\s*\/?>|{{(\d+)}}|([^<]+)/g, c = [];
2468
+ let u, m = [], T = null, p = {}, l, w = 0, v = [];
2469
+ function d(f) {
2470
+ !f || typeof f != "object" || ye(f) || (f.props || f.attrs ? (f.props && (p.props || (p.props = {}), Object.assign(p.props, f.props)), f.attrs && (p.attrs || (p.attrs = {}), Object.keys(f.attrs).forEach((b) => {
2471
+ if (b === "style" && p.attrs.style) {
2472
+ const h = p.attrs.style.replace(
2051
2473
  /;?\s*$/,
2052
2474
  ""
2053
- ), _ = l.attrs.style.replace(/^;?\s*/, "");
2054
- c.attrs.style = p + "; " + _;
2055
- } else if (g === "class" && c.attrs.class) {
2056
- const p = c.attrs.class.trim().split(/\s+/).filter(Boolean), _ = l.attrs.class.trim().split(/\s+/).filter(Boolean), C = [
2057
- .../* @__PURE__ */ new Set([...p, ..._])
2475
+ ), _ = f.attrs.style.replace(/^;?\s*/, "");
2476
+ p.attrs.style = h + "; " + _;
2477
+ } else if (b === "class" && p.attrs.class) {
2478
+ const h = p.attrs.class.trim().split(/\s+/).filter(Boolean), _ = f.attrs.class.trim().split(/\s+/).filter(Boolean), $ = [
2479
+ .../* @__PURE__ */ new Set([...h, ..._])
2058
2480
  ];
2059
- c.attrs.class = C.join(" ");
2481
+ p.attrs.class = $.join(" ");
2060
2482
  } else
2061
- c.attrs[g] = l.attrs[g];
2062
- }))) : (c.props || (c.props = {}), Object.assign(c.props, l)));
2063
- }
2064
- function b(l, g) {
2065
- const p = y ? d : $;
2066
- if (le(l)) {
2067
- const _ = l.key ?? g;
2068
- let C = l.children;
2069
- p.push({
2070
- ...l,
2483
+ p.attrs[b] = f.attrs[b];
2484
+ }))) : (p.props || (p.props = {}), Object.assign(p.props, f)));
2485
+ }
2486
+ function g(f, b) {
2487
+ const h = T ? m : v;
2488
+ if (ye(f)) {
2489
+ const _ = f.key ?? b;
2490
+ let $ = f.children;
2491
+ h.push({
2492
+ ...f,
2071
2493
  key: _,
2072
- children: C
2494
+ children: $
2073
2495
  });
2074
2496
  return;
2075
2497
  }
2076
- if (se(l)) {
2077
- p.push(ht(l, void 0));
2498
+ if (de(f)) {
2499
+ h.push(Ct(f, void 0));
2078
2500
  return;
2079
2501
  }
2080
- if (Array.isArray(l)) {
2081
- if (l.length === 0) return;
2082
- for (let _ = 0; _ < l.length; _++) {
2083
- const C = l[_];
2084
- le(C) || se(C) || Array.isArray(C) ? b(C, `${g}-${_}`) : C !== null && typeof C == "object" ? w(C) : p.push(s(String(C), `${g}-${_}`));
2502
+ if (Array.isArray(f)) {
2503
+ if (f.length === 0) return;
2504
+ for (let _ = 0; _ < f.length; _++) {
2505
+ const $ = f[_];
2506
+ ye($) || de($) || Array.isArray($) ? g($, `${b}-${_}`) : $ !== null && typeof $ == "object" ? d($) : h.push(s(String($), `${b}-${_}`));
2085
2507
  }
2086
2508
  return;
2087
2509
  }
2088
- if (l !== null && typeof l == "object") {
2089
- w(l);
2510
+ if (f !== null && typeof f == "object") {
2511
+ d(f);
2090
2512
  return;
2091
2513
  }
2092
- p.push(s(String(l), g));
2514
+ h.push(s(String(f), b));
2093
2515
  }
2094
- const m = /* @__PURE__ */ new Set([
2516
+ const y = /* @__PURE__ */ new Set([
2095
2517
  "area",
2096
2518
  "base",
2097
2519
  "br",
@@ -2108,245 +2530,278 @@ function mt(e, t, r) {
2108
2530
  "wbr"
2109
2531
  ]);
2110
2532
  for (; u = a.exec(o); )
2111
- if (u[1]) {
2112
- const l = u[1], g = u[0][1] === "/", p = u[0][u[0].length - 2] === "/" || m.has(l), {
2113
- props: _,
2114
- attrs: C,
2115
- directives: E
2116
- } = gt(u[2] || "", t, n), S = { props: {}, attrs: {} };
2117
- for (const A in _) S.props[A] = _[A];
2118
- for (const A in C) S.attrs[A] = C[A];
2119
- if (E && Object.keys(E).some((A) => A === "model" || A.startsWith("model:")))
2533
+ if (!(u[0].startsWith("<!--") && u[0].endsWith("-->"))) {
2534
+ if (u[1]) {
2535
+ const f = u[1], b = u[0][1] === "/", h = u[0][u[0].length - 2] === "/" || y.has(f), {
2536
+ props: _,
2537
+ attrs: $,
2538
+ directives: S,
2539
+ bound: E
2540
+ } = At(u[2] || "", t, n), C = { props: {}, attrs: {} };
2541
+ for (const A in _) C.props[A] = _[A];
2542
+ for (const A in $) C.attrs[A] = $[A];
2543
+ if (C.attrs && Object.prototype.hasOwnProperty.call(C.attrs, "key") && !(C.props && Object.prototype.hasOwnProperty.call(C.props, "key")))
2544
+ try {
2545
+ C.props.key = C.attrs.key;
2546
+ } catch {
2547
+ }
2120
2548
  try {
2121
- const A = Symbol.for("cer.registry"), j = globalThis[A], Q = !!(j && typeof j.has == "function" && j.has(l)), X = !!(n && (n.__customElements instanceof Set && n.__customElements.has(l) || Array.isArray(n.__isCustomElements) && n.__isCustomElements.includes(l)));
2122
- if (!!(l.includes("-") || X || Q))
2123
- for (const I of Object.keys(E)) {
2124
- if (I !== "model" && !I.startsWith("model:")) continue;
2125
- const Z = E[I], F = Z.arg ?? (I.includes(":") ? I.split(":", 2)[1] : void 0), L = Z.value, K = F ?? "modelValue", D = z, ne = oe, v = n ? n._state || n : void 0;
2126
- let B;
2127
- typeof L == "string" && n ? B = D(v, L) : B = L, S.props[K] = B;
2128
- try {
2129
- const T = J(K);
2130
- S.attrs || (S.attrs = {}), B !== void 0 && (S.attrs[T] = B);
2131
- } catch {
2549
+ const A = {
2550
+ input: ["value", "checked", "disabled", "readonly", "required", "placeholder", "maxlength", "minlength"],
2551
+ textarea: ["value", "disabled", "readonly", "required", "placeholder", "maxlength", "minlength"],
2552
+ select: ["value", "disabled", "required", "multiple"],
2553
+ option: ["selected", "disabled", "value"],
2554
+ video: ["muted", "autoplay", "controls", "loop", "playsinline"],
2555
+ audio: ["muted", "autoplay", "controls", "loop"],
2556
+ img: ["src", "alt", "width", "height"],
2557
+ button: ["type", "name", "value", "disabled", "autofocus", "form"]
2558
+ }, P = f.toLowerCase(), X = A[P] ?? [];
2559
+ if (C.attrs)
2560
+ for (const M of X)
2561
+ E && E.includes(M) && M in C.attrs && !(C.props && M in C.props) && (C.props[M] = C.attrs[M], delete C.attrs[M]);
2562
+ if ((f.includes("-") || !!n?.__customElements?.has?.(f)) && E && C.attrs) {
2563
+ const M = /* @__PURE__ */ new Set(["id", "name", "data-key", "key"]);
2564
+ for (const F of E)
2565
+ if (F in C.attrs && !(C.props && F in C.props)) {
2566
+ const H = F.includes("-") ? F.split("-").map((N, I) => I === 0 ? N : N.charAt(0).toUpperCase() + N.slice(1)).join("") : F;
2567
+ C.props[H] = C.attrs[F], M.has(F) || delete C.attrs[F];
2132
2568
  }
2133
- S.isCustomElement = !0;
2134
- const O = `update:${J(K)}`, P = "on" + O.charAt(0).toUpperCase() + O.slice(1);
2135
- S.props[P] = function(T) {
2136
- const R = T.detail !== void 0 ? T.detail : T.target ? T.target.value : void 0;
2137
- if (!v) return;
2138
- const pe = D(v, typeof L == "string" ? L : String(L));
2139
- (Array.isArray(R) && Array.isArray(pe) ? JSON.stringify([...R].sort()) !== JSON.stringify([...pe].sort()) : R !== pe) && (ne(v, typeof L == "string" ? L : String(L), R), n?.requestRender ? n.requestRender() : n?._requestRender && n._requestRender());
2140
- }, delete E[I];
2141
- }
2569
+ C.isCustomElement = !0;
2570
+ }
2142
2571
  } catch {
2143
2572
  }
2144
- if (Object.keys(E).length > 0 && (S.directives = { ...E }), g) {
2145
- const A = ee(
2146
- y,
2147
- c,
2148
- d.length === 1 && se(d[0]) && d[0].tag === "#text" ? typeof d[0].children == "string" ? d[0].children : "" : d.length ? d : void 0,
2149
- h
2150
- ), j = f.pop();
2151
- j ? (y = j.tag, c = j.props, h = j.key, d = j.children, d.push(A)) : ($.push(A), y = null, c = {}, h = void 0, d = []);
2152
- } else p ? y ? d.push(ee(l, S, void 0, void 0)) : $.push(ee(l, S, void 0, void 0)) : (y && f.push({
2153
- tag: y,
2154
- props: c,
2155
- children: d,
2156
- key: h
2157
- }), y = l, c = S, d = []);
2158
- } else if (typeof u[3] < "u") {
2159
- const l = Number(u[3]), g = t[l], p = `interp-${l}`;
2160
- b(g, p);
2161
- } else if (u[4]) {
2162
- const l = u[4], g = y ? d : $, p = l.split(/({{\d+}})/);
2163
- for (const _ of p) {
2164
- if (!_) continue;
2165
- const C = _.match(/^{{(\d+)}}$/);
2166
- if (C) {
2167
- const E = Number(C[1]), S = t[E], A = `interp-${E}`;
2168
- b(S, A);
2169
- } else {
2170
- const E = `text-${k++}`;
2171
- g.push(s(_, E));
2573
+ if (S && Object.keys(S).some((A) => A === "model" || A.startsWith("model:")))
2574
+ try {
2575
+ const A = Symbol.for("cer.registry"), P = globalThis[A], X = !!(P && typeof P.has == "function" && P.has(f)), ie = !!(n && (n.__customElements instanceof Set && n.__customElements.has(f) || Array.isArray(n.__isCustomElements) && n.__isCustomElements.includes(f)));
2576
+ if (!!(f.includes("-") || ie || X))
2577
+ for (const H of Object.keys(S)) {
2578
+ if (H !== "model" && !H.startsWith("model:")) continue;
2579
+ const N = S[H], I = N.arg ?? (H.includes(":") ? H.split(":", 2)[1] : void 0), z = N.value, J = I ?? "modelValue", se = K, k = he, W = n ? n._state || n : void 0;
2580
+ let R;
2581
+ typeof z == "string" && n ? R = se(W, z) : R = z, C.props[J] = R;
2582
+ try {
2583
+ const L = Q(J);
2584
+ C.attrs || (C.attrs = {}), R !== void 0 && (C.attrs[L] = R);
2585
+ } catch {
2586
+ }
2587
+ C.isCustomElement = !0;
2588
+ const B = `update:${Q(J)}`, j = "on" + B.charAt(0).toUpperCase() + B.slice(1);
2589
+ C.props[j] = function(L) {
2590
+ const fe = L.detail !== void 0 ? L.detail : L.target ? L.target.value : void 0;
2591
+ if (!W) return;
2592
+ const ve = se(W, typeof z == "string" ? z : String(z));
2593
+ (Array.isArray(fe) && Array.isArray(ve) ? JSON.stringify([...fe].sort()) !== JSON.stringify([...ve].sort()) : fe !== ve) && (k(W, typeof z == "string" ? z : String(z), fe), n?.requestRender ? n.requestRender() : n?._requestRender && n._requestRender());
2594
+ }, delete S[H];
2595
+ }
2596
+ } catch {
2597
+ }
2598
+ if (Object.keys(S).length > 0 && (C.directives = { ...S }), b) {
2599
+ const A = ae(
2600
+ T,
2601
+ p,
2602
+ m.length === 1 && de(m[0]) && m[0].tag === "#text" ? typeof m[0].children == "string" ? m[0].children : "" : m.length ? m : void 0,
2603
+ l
2604
+ ), P = c.pop();
2605
+ P ? (T = P.tag, p = P.props, l = P.key, m = P.children, m.push(A)) : (v.push(A), T = null, p = {}, l = void 0, m = []);
2606
+ } else h ? T ? m.push(ae(f, C, void 0, void 0)) : v.push(ae(f, C, void 0, void 0)) : (T && c.push({
2607
+ tag: T,
2608
+ props: p,
2609
+ children: m,
2610
+ key: l
2611
+ }), T = f, p = C, m = []);
2612
+ } else if (typeof u[3] < "u") {
2613
+ const f = Number(u[3]), b = t[f], h = `interp-${f}`;
2614
+ g(b, h);
2615
+ } else if (u[4]) {
2616
+ const f = u[4], b = T ? m : v, h = f.split(/({{\d+}})/);
2617
+ for (const _ of h) {
2618
+ if (!_) continue;
2619
+ const $ = _.match(/^{{(\d+)}}$/);
2620
+ if ($) {
2621
+ const S = Number($[1]), E = t[S], C = `interp-${S}`;
2622
+ g(E, C);
2623
+ } else {
2624
+ const S = `text-${w++}`;
2625
+ b.push(s(_, S));
2626
+ }
2172
2627
  }
2173
2628
  }
2174
2629
  }
2175
- const x = $.filter((l) => se(l) && l.tag === "#text" ? typeof l.children == "string" && l.children.trim() !== "" : !0);
2176
- return x.length === 1 ? x[0] : x.length > 1 ? x : ee("div", {}, "", "fallback-root");
2630
+ const x = v.filter((f) => de(f) && f.tag === "#text" ? typeof f.children == "string" && f.children.trim() !== "" : !0);
2631
+ return x.length === 1 ? x[0] : x.length > 1 ? x : ae("div", {}, "", "fallback-root");
2177
2632
  }
2178
- function U(e, ...t) {
2633
+ function ee(e, ...t) {
2179
2634
  const r = t[t.length - 1], i = typeof r == "object" && r && !Array.isArray(r) ? r : void 0;
2180
- return mt(e, t, i);
2635
+ return Tt(e, t, i);
2181
2636
  }
2182
- const Te = (e) => e ? typeof URLSearchParams > "u" ? {} : Object.fromEntries(new URLSearchParams(e)) : {}, W = (e, t) => {
2637
+ const qe = (e) => e ? typeof URLSearchParams > "u" ? {} : Object.fromEntries(new URLSearchParams(e)) : {}, V = (e, t) => {
2183
2638
  for (const r of e) {
2184
2639
  const i = [], n = r.path.replace(/:[^/]+/g, (a) => (i.push(a.slice(1)), "([^/]+)")), s = new RegExp(`^${n}$`), o = t.match(s);
2185
2640
  if (o) {
2186
2641
  const a = {};
2187
- return i.forEach((f, u) => {
2188
- a[f] = o[u + 1];
2642
+ return i.forEach((c, u) => {
2643
+ a[c] = o[u + 1];
2189
2644
  }), { route: r, params: a };
2190
2645
  }
2191
2646
  }
2192
2647
  return { route: null, params: {} };
2193
- }, ke = {};
2194
- async function yt(e) {
2648
+ }, Te = {};
2649
+ async function jt(e) {
2195
2650
  if (e.component) return e.component;
2196
2651
  if (e.load) {
2197
- if (ke[e.path]) return ke[e.path];
2652
+ if (Te[e.path]) return Te[e.path];
2198
2653
  try {
2199
2654
  const t = await e.load();
2200
- return ke[e.path] = t.default, t.default;
2655
+ return Te[e.path] = t.default, t.default;
2201
2656
  } catch {
2202
2657
  throw new Error(`Failed to load component for route: ${e.path}`);
2203
2658
  }
2204
2659
  }
2205
2660
  throw new Error(`No component or loader defined for route: ${e.path}`);
2206
2661
  }
2207
- function bt(e) {
2662
+ function Lt(e) {
2208
2663
  const { routes: t, base: r = "", initialUrl: i } = e;
2209
- let n, s, o, a, f, u, d;
2210
- const y = async ($, w) => {
2211
- const b = t.find((m) => W([m], $.path).route !== null);
2212
- if (b?.beforeEnter)
2664
+ let n, s, o, a, c, u, m;
2665
+ const T = async (v, d) => {
2666
+ const g = t.find((y) => V([y], v.path).route !== null);
2667
+ if (g?.beforeEnter)
2213
2668
  try {
2214
- const m = await b.beforeEnter($, w);
2215
- return typeof m == "string" ? (await k(m, !0), !1) : m !== !1;
2216
- } catch (m) {
2217
- return console.error("beforeEnter error", m), !1;
2669
+ const y = await g.beforeEnter(v, d);
2670
+ return typeof y == "string" ? (await w(y, !0), !1) : y !== !1;
2671
+ } catch (y) {
2672
+ return Y("beforeEnter error", y), !1;
2218
2673
  }
2219
2674
  return !0;
2220
- }, c = async ($, w) => {
2221
- const b = t.find((m) => W([m], $.path).route !== null);
2222
- if (b?.onEnter)
2675
+ }, p = async (v, d) => {
2676
+ const g = t.find((y) => V([y], v.path).route !== null);
2677
+ if (g?.onEnter)
2223
2678
  try {
2224
- const m = await b.onEnter($, w);
2225
- return typeof m == "string" ? (await k(m, !0), !1) : m !== !1;
2226
- } catch (m) {
2227
- return console.error("onEnter error", m), !1;
2679
+ const y = await g.onEnter(v, d);
2680
+ return typeof y == "string" ? (await w(y, !0), !1) : y !== !1;
2681
+ } catch (y) {
2682
+ return Y("onEnter error", y), !1;
2228
2683
  }
2229
2684
  return !0;
2230
- }, h = ($, w) => {
2231
- const b = t.find((m) => W([m], $.path).route !== null);
2232
- if (b?.afterEnter)
2685
+ }, l = (v, d) => {
2686
+ const g = t.find((y) => V([y], v.path).route !== null);
2687
+ if (g?.afterEnter)
2233
2688
  try {
2234
- b.afterEnter($, w);
2235
- } catch (m) {
2236
- console.error("afterEnter error", m);
2689
+ g.afterEnter(v, d);
2690
+ } catch (y) {
2691
+ Y("afterEnter error", y);
2237
2692
  }
2238
- }, k = async ($, w = !1) => {
2693
+ }, w = async (v, d = !1) => {
2239
2694
  try {
2240
- const b = {
2241
- path: $.replace(r, "") || "/",
2695
+ const g = {
2696
+ path: v.replace(r, "") || "/",
2242
2697
  query: {}
2243
- }, m = W(t, b.path);
2244
- if (!m) throw new Error(`No route found for ${b.path}`);
2245
- const x = o.getState(), l = {
2246
- path: b.path,
2247
- params: m.params,
2248
- query: b.query
2698
+ }, y = V(t, g.path);
2699
+ if (!y) throw new Error(`No route found for ${g.path}`);
2700
+ const x = o.getState(), f = {
2701
+ path: g.path,
2702
+ params: y.params,
2703
+ query: g.query
2249
2704
  };
2250
- if (!await y(l, x) || !await c(l, x)) return;
2251
- typeof window < "u" && typeof document < "u" && (w ? window.history.replaceState({}, "", r + $) : window.history.pushState({}, "", r + $)), o.setState(l), h(l, x);
2252
- } catch (b) {
2253
- console.error("Navigation error:", b);
2705
+ if (!await T(f, x) || !await p(f, x)) return;
2706
+ typeof window < "u" && typeof document < "u" && (d ? window.history.replaceState({}, "", r + v) : window.history.pushState({}, "", r + v)), o.setState(f), l(f, x);
2707
+ } catch (g) {
2708
+ Y("Navigation error:", g);
2254
2709
  }
2255
2710
  };
2256
2711
  if (typeof window < "u" && typeof document < "u") {
2257
2712
  n = () => {
2258
- const w = new URL(window.location.href), b = w.pathname.replace(r, "") || "/", m = Te(w.search);
2259
- return { path: b, query: m };
2713
+ const d = new URL(window.location.href), g = d.pathname.replace(r, "") || "/", y = qe(d.search);
2714
+ return { path: g, query: y };
2260
2715
  }, s = n();
2261
- const $ = W(t, s.path);
2262
- o = $e({
2716
+ const v = V(t, s.path);
2717
+ o = Le({
2263
2718
  path: s.path,
2264
- params: $.params,
2719
+ params: v.params,
2265
2720
  query: s.query
2266
- }), a = async (w = !1) => {
2267
- const b = n();
2268
- await k(b.path, w);
2269
- }, window.addEventListener("popstate", () => a(!0)), f = (w) => k(w, !1), u = (w) => k(w, !0), d = () => window.history.back();
2721
+ }), a = async (d = !1) => {
2722
+ const g = n();
2723
+ await w(g.path, d);
2724
+ }, window.addEventListener("popstate", () => a(!0)), c = (d) => w(d, !1), u = (d) => w(d, !0), m = () => window.history.back();
2270
2725
  } else {
2271
2726
  n = () => {
2272
- const b = new URL(i || "/", "http://localhost"), m = b.pathname.replace(r, "") || "/", x = Te(b.search);
2273
- return { path: m, query: x };
2727
+ const g = new URL(i || "/", "http://localhost"), y = g.pathname.replace(r, "") || "/", x = qe(g.search);
2728
+ return { path: y, query: x };
2274
2729
  }, s = n();
2275
- const $ = W(t, s.path);
2276
- o = $e({
2730
+ const v = V(t, s.path);
2731
+ o = Le({
2277
2732
  path: s.path,
2278
- params: $.params,
2733
+ params: v.params,
2279
2734
  query: s.query
2280
2735
  }), a = async () => {
2281
- const b = n();
2282
- await w(b.path);
2736
+ const g = n();
2737
+ await d(g.path);
2283
2738
  };
2284
- const w = async (b) => {
2739
+ const d = async (g) => {
2285
2740
  try {
2286
- const m = {
2287
- path: b.replace(r, "") || "/",
2741
+ const y = {
2742
+ path: g.replace(r, "") || "/",
2288
2743
  query: {}
2289
- }, x = W(t, m.path);
2290
- if (!x) throw new Error(`No route found for ${m.path}`);
2291
- const l = o.getState(), g = {
2292
- path: m.path,
2744
+ }, x = V(t, y.path);
2745
+ if (!x) throw new Error(`No route found for ${y.path}`);
2746
+ const f = o.getState(), b = {
2747
+ path: y.path,
2293
2748
  params: x.params,
2294
- query: m.query
2295
- }, p = t.find((_) => W([_], g.path).route !== null);
2296
- if (p?.beforeEnter)
2749
+ query: y.query
2750
+ }, h = t.find((_) => V([_], b.path).route !== null);
2751
+ if (h?.beforeEnter)
2297
2752
  try {
2298
- const _ = await p.beforeEnter(g, l);
2753
+ const _ = await h.beforeEnter(b, f);
2299
2754
  if (typeof _ == "string") {
2300
- await w(_);
2755
+ await d(_);
2301
2756
  return;
2302
2757
  }
2303
2758
  if (_ === !1) return;
2304
2759
  } catch {
2305
2760
  return;
2306
2761
  }
2307
- if (p?.onEnter)
2762
+ if (h?.onEnter)
2308
2763
  try {
2309
- const _ = await p.onEnter(g, l);
2764
+ const _ = await h.onEnter(b, f);
2310
2765
  if (typeof _ == "string") {
2311
- await w(_);
2766
+ await d(_);
2312
2767
  return;
2313
2768
  }
2314
2769
  if (_ === !1) return;
2315
2770
  } catch {
2316
2771
  return;
2317
2772
  }
2318
- if (o.setState(g), p?.afterEnter)
2773
+ if (o.setState(b), h?.afterEnter)
2319
2774
  try {
2320
- p.afterEnter(g, l);
2775
+ h.afterEnter(b, f);
2321
2776
  } catch {
2322
2777
  }
2323
2778
  } catch {
2324
2779
  }
2325
2780
  };
2326
- f = async (b) => w(b), u = async (b) => w(b), d = () => {
2781
+ c = async (g) => d(g), u = async (g) => d(g), m = () => {
2327
2782
  };
2328
2783
  }
2329
2784
  return {
2330
2785
  store: o,
2331
- push: f,
2786
+ push: c,
2332
2787
  replace: u,
2333
- back: d,
2788
+ back: m,
2334
2789
  subscribe: o.subscribe,
2335
- matchRoute: ($) => W(t, $),
2790
+ matchRoute: (v) => V(t, v),
2336
2791
  getCurrent: () => o.getState(),
2337
- resolveRouteComponent: yt
2792
+ resolveRouteComponent: jt
2338
2793
  };
2339
2794
  }
2340
- function Ct(e, t) {
2341
- return W(e, t);
2795
+ function Zt(e, t) {
2796
+ return V(e, t);
2342
2797
  }
2343
- function At(e) {
2344
- const t = bt(e);
2345
- return je("router-view", {
2798
+ function Yt(e) {
2799
+ const t = Lt(e);
2800
+ return Ie("router-view", {
2346
2801
  async render() {
2347
- if (!t) return U`<div>Router not initialized.</div>`;
2802
+ if (!t) return ee`<div>Router not initialized.</div>`;
2348
2803
  const r = t.getCurrent(), { path: i } = r, n = t.matchRoute(i);
2349
- if (!n.route) return U`<div>Not found</div>`;
2804
+ if (!n.route) return ee`<div>Not found</div>`;
2350
2805
  try {
2351
2806
  const s = await t.resolveRouteComponent(n.route);
2352
2807
  if (typeof s == "string")
@@ -2355,9 +2810,9 @@ function At(e) {
2355
2810
  const o = s(), a = o instanceof Promise ? await o : o;
2356
2811
  return typeof a == "string" ? { tag: a, props: {}, children: [] } : a;
2357
2812
  }
2358
- return U`<div>Invalid route component</div>`;
2813
+ return ee`<div>Invalid route component</div>`;
2359
2814
  } catch {
2360
- return U`<div>Invalid route component</div>`;
2815
+ return ee`<div>Invalid route component</div>`;
2361
2816
  }
2362
2817
  },
2363
2818
  onConnected(r) {
@@ -2365,7 +2820,7 @@ function At(e) {
2365
2820
  typeof r.requestRender == "function" && r.requestRender();
2366
2821
  });
2367
2822
  }
2368
- }), je("router-link", {
2823
+ }), Ie("router-link", {
2369
2824
  state: {},
2370
2825
  props: {
2371
2826
  to: { type: String, default: "" },
@@ -2378,7 +2833,7 @@ function At(e) {
2378
2833
  disabled: { type: Boolean, default: !1 },
2379
2834
  external: { type: Boolean, default: !1 },
2380
2835
  class: { type: String, default: "" },
2381
- style: { type: String, default: Oe`
2836
+ style: { type: String, default: Ue`
2382
2837
  [aria-disabled="true"] {
2383
2838
  pointer-events: none;
2384
2839
  opacity: 0.5;
@@ -2387,32 +2842,32 @@ function At(e) {
2387
2842
  },
2388
2843
  style: (r) => r.style,
2389
2844
  render: (r) => {
2390
- const i = t.getCurrent(), n = r.to, s = r.exact, o = r.exactActiveClass, a = r.activeClass, f = r.ariaCurrentValue, u = r.tag, d = r.disabled, y = r.external, c = i.path === n, h = s ? c : i && typeof i.path == "string" ? i.path.startsWith(n) : !1, k = c ? `aria-current="${f}"` : "", $ = (r.class || "").split(/\s+/).filter(Boolean), w = {};
2391
- for (const g of $) w[g] = !0;
2392
- const b = {
2393
- ...w,
2845
+ const i = t.getCurrent(), n = r.to, s = r.exact, o = r.exactActiveClass, a = r.activeClass, c = r.ariaCurrentValue, u = r.tag, m = r.disabled, T = r.external, p = i.path === n, l = s ? p : i && typeof i.path == "string" ? i.path.startsWith(n) : !1, w = p ? `aria-current="${c}"` : "", v = (r.class || "").split(/\s+/).filter(Boolean), d = {};
2846
+ for (const b of v) d[b] = !0;
2847
+ const g = {
2848
+ ...d,
2394
2849
  // Also include the configurable names (may duplicate the above)
2395
- [a]: h,
2396
- [o]: c
2397
- }, m = u === "button", x = d ? m ? 'disabled aria-disabled="true" tabindex="-1"' : 'aria-disabled="true" tabindex="-1"' : "", l = y && (u === "a" || !u) ? 'target="_blank" rel="noopener noreferrer"' : "";
2398
- return U`
2399
- ${Pe().when(m, U`
2850
+ [a]: l,
2851
+ [o]: p
2852
+ }, y = u === "button", x = m ? y ? 'disabled aria-disabled="true" tabindex="-1"' : 'aria-disabled="true" tabindex="-1"' : "", f = T && (u === "a" || !u) ? 'target="_blank" rel="noopener noreferrer"' : "";
2853
+ return ee`
2854
+ ${Ke().when(y, ee`
2400
2855
  <button
2401
2856
  part="button"
2402
- :class="${b}"
2403
- ${k}
2857
+ :class="${g}"
2858
+ ${w}
2404
2859
  ${x}
2405
- ${l}
2860
+ ${f}
2406
2861
  @click="navigate"
2407
2862
  ><slot></slot></button>
2408
- `).otherwise(U`
2863
+ `).otherwise(ee`
2409
2864
  <a
2410
2865
  part="link"
2411
2866
  href="${n}"
2412
- :class="${b}"
2413
- ${k}
2867
+ :class="${g}"
2868
+ ${w}
2414
2869
  ${x}
2415
- ${l}
2870
+ ${f}
2416
2871
  @click="navigate"
2417
2872
  ><slot></slot></a>
2418
2873
  `).done()}
@@ -2428,26 +2883,42 @@ function At(e) {
2428
2883
  }), t;
2429
2884
  }
2430
2885
  export {
2431
- G as GlobalEventBus,
2432
- je as component,
2433
- $e as createStore,
2434
- Oe as css,
2435
- kt as each,
2436
- vt as emit,
2437
- re as eventBus,
2438
- U as html,
2439
- At as initRouter,
2440
- Et as listen,
2441
- Pe as match,
2442
- W as matchRoute,
2443
- Ct as matchRouteSSR,
2444
- _t as off,
2445
- $t as on,
2446
- St as once,
2447
- Te as parseQuery,
2448
- he as renderToString,
2449
- yt as resolveRouteComponent,
2450
- bt as useRouter,
2451
- xt as when
2886
+ ne as GlobalEventBus,
2887
+ O as anchorBlock,
2888
+ Ie as component,
2889
+ Le as createStore,
2890
+ Ue as css,
2891
+ Ot as each,
2892
+ qt as eachGroup,
2893
+ zt as eachPage,
2894
+ Wt as eachWhere,
2895
+ Ft as emit,
2896
+ le as eventBus,
2897
+ ee as html,
2898
+ Yt as initRouter,
2899
+ Gt as listen,
2900
+ Ke as match,
2901
+ V as matchRoute,
2902
+ Zt as matchRouteSSR,
2903
+ G as mediaVariants,
2904
+ Jt as off,
2905
+ Kt as on,
2906
+ Vt as once,
2907
+ qe as parseQuery,
2908
+ ke as renderToString,
2909
+ jt as resolveRouteComponent,
2910
+ Ve as responsive,
2911
+ ze as responsiveOrder,
2912
+ Dt as responsiveSwitch,
2913
+ Ut as switchOn,
2914
+ It as switchOnLength,
2915
+ Ht as switchOnPromise,
2916
+ Pt as unless,
2917
+ Lt as useRouter,
2918
+ we as when,
2919
+ Mt as whenEmpty,
2920
+ q as whenMedia,
2921
+ Bt as whenNotEmpty,
2922
+ Nt as whenVariants
2452
2923
  };
2453
2924
  //# sourceMappingURL=custom-elements-runtime.es.js.map