@jasonshimmy/custom-elements-runtime 1.0.3 → 1.0.5

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.
@@ -5,9 +5,9 @@ class dt {
5
5
  * Schedule an update to be executed in the next microtask
6
6
  * Uses component identity to deduplicate multiple render requests for the same component
7
7
  */
8
- schedule(t, n) {
9
- const r = n || t.toString();
10
- this.pendingUpdates.set(r, 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()));
8
+ schedule(t, r) {
9
+ const n = r || t.toString();
10
+ this.pendingUpdates.set(n, 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()));
11
11
  }
12
12
  /**
13
13
  * Execute all pending updates
@@ -15,11 +15,11 @@ class dt {
15
15
  flush() {
16
16
  const t = Array.from(this.pendingUpdates.values());
17
17
  this.pendingUpdates.clear(), this.isFlushScheduled = !1;
18
- for (const n of t)
18
+ for (const r of t)
19
19
  try {
20
- n();
21
- } catch (r) {
22
- typeof console < "u" && console.error && console.error("Error in batched update:", r);
20
+ r();
21
+ } catch (n) {
22
+ typeof console < "u" && console.error && console.error("Error in batched update:", n);
23
23
  }
24
24
  }
25
25
  /**
@@ -41,13 +41,13 @@ class ht {
41
41
  /**
42
42
  * Get or create a reactive proxy for an object
43
43
  */
44
- static getOrCreateProxy(t, n, r = !1) {
44
+ static getOrCreateProxy(t, r, n = !1) {
45
45
  const i = this.cache.get(t);
46
46
  if (i)
47
47
  return i;
48
- const s = r ? this.getOrCreateArrayHandler(n) : this.getOrCreateObjectHandler(n), o = new Proxy(t, s);
48
+ const s = n ? this.getOrCreateArrayHandler(r) : this.getOrCreateObjectHandler(r), o = new Proxy(t, s);
49
49
  try {
50
- rt.markAsProxy(o);
50
+ nt.markAsProxy(o);
51
51
  } catch {
52
52
  }
53
53
  return this.cache.set(t, o), o;
@@ -57,9 +57,9 @@ class ht {
57
57
  */
58
58
  static getOrCreateArrayHandler(t) {
59
59
  if (!this.arrayHandlerCache.has(t)) {
60
- const n = {
61
- get: (r, i, s) => {
62
- const o = Reflect.get(r, i, s);
60
+ const r = {
61
+ get: (n, i, s) => {
62
+ const o = Reflect.get(n, i, s);
63
63
  return typeof o == "function" && typeof i == "string" && [
64
64
  "push",
65
65
  "pop",
@@ -71,14 +71,14 @@ class ht {
71
71
  "fill",
72
72
  "copyWithin"
73
73
  ].includes(i) ? function(...u) {
74
- const m = o.apply(r, u);
74
+ const m = o.apply(n, u);
75
75
  return t.triggerUpdate(), m;
76
76
  } : o;
77
77
  },
78
- set: (r, i, s) => (r[i] = t.makeReactiveValue(s), t.triggerUpdate(), !0),
79
- deleteProperty: (r, i) => (delete r[i], t.triggerUpdate(), !0)
78
+ set: (n, i, s) => (n[i] = t.makeReactiveValue(s), t.triggerUpdate(), !0),
79
+ deleteProperty: (n, i) => (delete n[i], t.triggerUpdate(), !0)
80
80
  };
81
- this.arrayHandlerCache.set(t, n);
81
+ this.arrayHandlerCache.set(t, r);
82
82
  }
83
83
  return this.arrayHandlerCache.get(t);
84
84
  }
@@ -87,12 +87,12 @@ class ht {
87
87
  */
88
88
  static getOrCreateObjectHandler(t) {
89
89
  if (!this.objectHandlerCache.has(t)) {
90
- const n = {
91
- get: (r, i, s) => Reflect.get(r, i, s),
92
- set: (r, i, s) => (r[i] = t.makeReactiveValue(s), t.triggerUpdate(), !0),
93
- deleteProperty: (r, i) => (delete r[i], t.triggerUpdate(), !0)
90
+ const r = {
91
+ get: (n, i, s) => Reflect.get(n, i, s),
92
+ set: (n, i, s) => (n[i] = t.makeReactiveValue(s), t.triggerUpdate(), !0),
93
+ deleteProperty: (n, i) => (delete n[i], t.triggerUpdate(), !0)
94
94
  };
95
- this.objectHandlerCache.set(t, n);
95
+ this.objectHandlerCache.set(t, r);
96
96
  }
97
97
  return this.objectHandlerCache.get(t);
98
98
  }
@@ -118,7 +118,7 @@ class ht {
118
118
  };
119
119
  }
120
120
  }
121
- class rt {
121
+ class nt {
122
122
  // Cache a stable reactiveContext object keyed by onUpdate -> makeReactive
123
123
  // This allows handler caches in ReactiveProxyCache to reuse handlers
124
124
  // for identical reactive contexts instead of creating a new context object
@@ -127,19 +127,19 @@ class rt {
127
127
  /**
128
128
  * Create an optimized reactive proxy with minimal overhead
129
129
  */
130
- static createReactiveProxy(t, n, r) {
130
+ static createReactiveProxy(t, r, n) {
131
131
  try {
132
132
  if (Fe.has(t)) return t;
133
133
  } catch {
134
134
  }
135
135
  const i = Array.isArray(t);
136
- let s = this.contextCache.get(n);
137
- s || (s = /* @__PURE__ */ new WeakMap(), this.contextCache.set(n, s));
138
- let o = s.get(r);
136
+ let s = this.contextCache.get(r);
137
+ s || (s = /* @__PURE__ */ new WeakMap(), this.contextCache.set(r, s));
138
+ let o = s.get(n);
139
139
  return o || (o = {
140
- triggerUpdate: n,
141
- makeReactiveValue: r
142
- }, s.set(r, o)), ht.getOrCreateProxy(t, o, i);
140
+ triggerUpdate: r,
141
+ makeReactiveValue: n
142
+ }, s.set(n, o)), ht.getOrCreateProxy(t, o, i);
143
143
  }
144
144
  /**
145
145
  * Mark an object as a proxy (for optimization)
@@ -165,8 +165,8 @@ class gt {
165
165
  /**
166
166
  * Set the current component being rendered for dependency tracking
167
167
  */
168
- setCurrentComponent(t, n) {
169
- this.currentComponent = t, this.componentRenderFunctions.set(t, n), this.componentDependencies.has(t) || this.componentDependencies.set(t, /* @__PURE__ */ new Set()), this.stateIndexCounter.set(t, 0);
168
+ setCurrentComponent(t, r) {
169
+ this.currentComponent = t, this.componentRenderFunctions.set(t, r), this.componentDependencies.has(t) || this.componentDependencies.set(t, /* @__PURE__ */ new Set()), this.stateIndexCounter.set(t, 0);
170
170
  }
171
171
  /**
172
172
  * Clear the current component after rendering
@@ -198,19 +198,19 @@ class gt {
198
198
  */
199
199
  shouldEmitRenderWarning() {
200
200
  if (!this.currentComponent) return !0;
201
- const t = this.currentComponent, n = this.lastWarningTime.get(t) || 0, r = Date.now();
202
- return r - n < 1e3 ? !1 : (this.lastWarningTime.set(t, r), !0);
201
+ const t = this.currentComponent, r = this.lastWarningTime.get(t) || 0, n = Date.now();
202
+ return n - r < 1e3 ? !1 : (this.lastWarningTime.set(t, n), !0);
203
203
  }
204
204
  /**
205
205
  * Execute a function with tracking disabled
206
206
  */
207
207
  withoutTracking(t) {
208
- const n = this.trackingDisabled;
208
+ const r = this.trackingDisabled;
209
209
  this.trackingDisabled = !0;
210
210
  try {
211
211
  return t();
212
212
  } finally {
213
- this.trackingDisabled = n;
213
+ this.trackingDisabled = r;
214
214
  }
215
215
  }
216
216
  /**
@@ -219,8 +219,8 @@ class gt {
219
219
  getOrCreateState(t) {
220
220
  if (!this.currentComponent)
221
221
  return new He(t);
222
- const n = this.currentComponent, r = this.stateIndexCounter.get(n) || 0, i = `${n}:${r}`;
223
- if (this.stateIndexCounter.set(n, r + 1), this.stateStorage.has(i))
222
+ const r = this.currentComponent, n = this.stateIndexCounter.get(r) || 0, i = `${r}:${n}`;
223
+ if (this.stateIndexCounter.set(r, n + 1), this.stateStorage.has(i))
224
224
  return this.stateStorage.get(i);
225
225
  const s = new He(t);
226
226
  return this.stateStorage.set(i, s), s;
@@ -235,19 +235,19 @@ class gt {
235
235
  * Trigger updates for all components that depend on a state
236
236
  */
237
237
  triggerUpdate(t) {
238
- t.getDependents().forEach((n) => {
239
- const r = this.componentRenderFunctions.get(n);
240
- r && fe(r, n);
238
+ t.getDependents().forEach((r) => {
239
+ const n = this.componentRenderFunctions.get(r);
240
+ n && fe(n, r);
241
241
  });
242
242
  }
243
243
  /**
244
244
  * Clean up component dependencies when component is destroyed
245
245
  */
246
246
  cleanup(t) {
247
- const n = this.componentDependencies.get(t);
248
- n && (n.forEach((r) => r.removeDependent(t)), this.componentDependencies.delete(t)), this.componentRenderFunctions.delete(t);
249
- for (const r of Array.from(this.stateStorage.keys()))
250
- r.startsWith(t + ":") && this.stateStorage.delete(r);
247
+ const r = this.componentDependencies.get(t);
248
+ r && (r.forEach((n) => n.removeDependent(t)), this.componentDependencies.delete(t)), this.componentRenderFunctions.delete(t);
249
+ for (const n of Array.from(this.stateStorage.keys()))
250
+ n.startsWith(t + ":") && this.stateStorage.delete(n);
251
251
  this.stateIndexCounter.delete(t);
252
252
  }
253
253
  }
@@ -258,8 +258,8 @@ class He {
258
258
  constructor(t) {
259
259
  this._value = this.makeReactive(t);
260
260
  try {
261
- const n = Symbol.for("@cer/ReactiveState");
262
- Object.defineProperty(this, n, { value: !0, enumerable: !1, configurable: !1 });
261
+ const r = Symbol.for("@cer/ReactiveState");
262
+ Object.defineProperty(this, r, { value: !0, enumerable: !1, configurable: !1 });
263
263
  } catch {
264
264
  }
265
265
  }
@@ -284,14 +284,14 @@ class He {
284
284
  return this.dependents;
285
285
  }
286
286
  makeReactive(t) {
287
- return t === null || typeof t != "object" || t instanceof Node || t instanceof Element || t instanceof HTMLElement ? t : rt.createReactiveProxy(
287
+ return t === null || typeof t != "object" || t instanceof Node || t instanceof Element || t instanceof HTMLElement ? t : nt.createReactiveProxy(
288
288
  t,
289
289
  () => F.triggerUpdate(this),
290
- (n) => this.makeReactive(n)
290
+ (r) => this.makeReactive(r)
291
291
  );
292
292
  }
293
293
  }
294
- function fn(e) {
294
+ function ur(e) {
295
295
  return F.getOrCreateState(e === void 0 ? null : e);
296
296
  }
297
297
  function ee(e) {
@@ -307,7 +307,7 @@ function ee(e) {
307
307
  return !1;
308
308
  }
309
309
  }
310
- function dn(e) {
310
+ function fr(e) {
311
311
  const t = new He(e());
312
312
  return {
313
313
  get value() {
@@ -315,44 +315,44 @@ function dn(e) {
315
315
  }
316
316
  };
317
317
  }
318
- function pn(e, t, n = {}) {
319
- let r = e();
320
- n.immediate && t(r, r);
318
+ function dr(e, t, r = {}) {
319
+ let n = e();
320
+ r.immediate && t(n, n);
321
321
  const i = `watch-${Math.random().toString(36).substr(2, 9)}`, s = () => {
322
322
  F.setCurrentComponent(i, s);
323
323
  const o = e();
324
- F.clearCurrentComponent(), o !== r && (t(o, r), r = o);
324
+ F.clearCurrentComponent(), o !== n && (t(o, n), n = o);
325
325
  };
326
326
  return F.setCurrentComponent(i, s), e(), F.clearCurrentComponent(), () => {
327
327
  F.cleanup(i);
328
328
  };
329
329
  }
330
- const ve = /* @__PURE__ */ new Map(), xe = /* @__PURE__ */ new Map(), ke = /* @__PURE__ */ new Map(), Ue = 500;
331
- function ne(e) {
332
- if (ve.has(e))
333
- return ve.get(e);
334
- const t = e.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase();
335
- return ve.size < Ue && ve.set(e, t), t;
336
- }
337
- function it(e) {
330
+ const xe = /* @__PURE__ */ new Map(), ve = /* @__PURE__ */ new Map(), ke = /* @__PURE__ */ new Map(), Ue = 500;
331
+ function re(e) {
338
332
  if (xe.has(e))
339
333
  return xe.get(e);
340
- const t = e.replace(/-([a-z])/g, (n, r) => r.toUpperCase());
334
+ const t = e.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase();
341
335
  return xe.size < Ue && xe.set(e, t), t;
342
336
  }
337
+ function it(e) {
338
+ if (ve.has(e))
339
+ return ve.get(e);
340
+ const t = e.replace(/-([a-z])/g, (r, n) => n.toUpperCase());
341
+ return ve.size < Ue && ve.set(e, t), t;
342
+ }
343
343
  function ie(e) {
344
344
  if (typeof e == "string") {
345
345
  if (ke.has(e))
346
346
  return ke.get(e);
347
347
  const t = e.replace(
348
348
  /[&<>"']/g,
349
- (n) => ({
349
+ (r) => ({
350
350
  "&": "&amp;",
351
351
  "<": "&lt;",
352
352
  ">": "&gt;",
353
353
  '"': "&quot;",
354
354
  "'": "&#39;"
355
- })[n]
355
+ })[r]
356
356
  );
357
357
  return t !== e && ke.size < Ue && ke.set(e, t), t;
358
358
  }
@@ -360,16 +360,16 @@ function ie(e) {
360
360
  }
361
361
  function H(e, t) {
362
362
  if (typeof t == "string") {
363
- const n = t.split(".").reduce((r, i) => r?.[i], e);
364
- return ee(n) ? n.value : n;
363
+ const r = t.split(".").reduce((n, i) => n?.[i], e);
364
+ return ee(r) ? r.value : r;
365
365
  }
366
366
  return t;
367
367
  }
368
- function Ee(e, t, n) {
369
- const r = String(t).split("."), i = r.pop();
368
+ function Ee(e, t, r) {
369
+ const n = String(t).split("."), i = n.pop();
370
370
  if (!i) return;
371
- const s = r.reduce((o, a) => (o[a] == null && (o[a] = {}), o[a]), e);
372
- ee(s[i]) ? s[i].value = n : s[i] = n;
371
+ const s = n.reduce((o, a) => (o[a] == null && (o[a] = {}), o[a]), e);
372
+ ee(s[i]) ? s[i].value = r : s[i] = r;
373
373
  }
374
374
  const st = typeof process < "u" && process.env?.NODE_ENV !== "production";
375
375
  function se(e, ...t) {
@@ -378,24 +378,24 @@ function se(e, ...t) {
378
378
  function Oe(e, ...t) {
379
379
  st && console.warn(e, ...t);
380
380
  }
381
- function mt(e, t, n) {
382
- if (n)
383
- for (const [r, i] of Object.entries(n)) {
381
+ function mt(e, t, r) {
382
+ if (r)
383
+ for (const [n, i] of Object.entries(r)) {
384
384
  let s, o = {};
385
- if (Array.isArray(i) ? (s = i[0], o = i[1] || {}) : s = i, t.set(r, {
385
+ if (Array.isArray(i) ? (s = i[0], o = i[1] || {}) : s = i, t.set(n, {
386
386
  callback: s,
387
387
  options: o,
388
- oldValue: H(e, r)
388
+ oldValue: H(e, n)
389
389
  }), o.immediate)
390
390
  try {
391
- const a = H(e, r);
391
+ const a = H(e, n);
392
392
  s(a, void 0, e);
393
393
  } catch (a) {
394
- se(`Error in immediate watcher for "${r}":`, a);
394
+ se(`Error in immediate watcher for "${n}":`, a);
395
395
  }
396
396
  }
397
397
  }
398
- function yt(e, t, n, r) {
398
+ function yt(e, t, r, n) {
399
399
  const i = (o, a) => {
400
400
  if (o === a) return !0;
401
401
  if (typeof o != typeof a || typeof o != "object" || o === null || a === null) return !1;
@@ -403,15 +403,15 @@ function yt(e, t, n, r) {
403
403
  return o.length !== a.length ? !1 : o.every((g, b) => i(g, a[b]));
404
404
  const u = Object.keys(o), m = Object.keys(a);
405
405
  return u.length !== m.length ? !1 : u.every((g) => i(o[g], a[g]));
406
- }, s = t.get(n);
407
- if (s && !i(r, s.oldValue))
406
+ }, s = t.get(r);
407
+ if (s && !i(n, s.oldValue))
408
408
  try {
409
- s.callback(r, s.oldValue, e), s.oldValue = r;
409
+ s.callback(n, s.oldValue, e), s.oldValue = n;
410
410
  } catch (o) {
411
- se(`Error in watcher for "${n}":`, o);
411
+ se(`Error in watcher for "${r}":`, o);
412
412
  }
413
413
  for (const [o, a] of t.entries())
414
- if (a.options.deep && n.startsWith(o + "."))
414
+ if (a.options.deep && r.startsWith(o + "."))
415
415
  try {
416
416
  const u = H(e, o);
417
417
  i(u, a.oldValue) || (a.callback(u, a.oldValue, e), a.oldValue = u);
@@ -422,32 +422,32 @@ function yt(e, t, n, r) {
422
422
  function Ke(e, t) {
423
423
  return t === Boolean ? e === "true" : t === Number ? Number(e) : e;
424
424
  }
425
- function bt(e, t, n) {
426
- t && Object.entries(t).forEach(([r, i]) => {
427
- const s = ne(r), o = e.getAttribute(s);
428
- if (i.type === Function && typeof e[r] == "function")
429
- n[r] = e[r];
430
- else if (typeof e[r] < "u")
425
+ function bt(e, t, r) {
426
+ t && Object.entries(t).forEach(([n, i]) => {
427
+ const s = re(n), o = e.getAttribute(s);
428
+ if (i.type === Function && typeof e[n] == "function")
429
+ r[n] = e[n];
430
+ else if (typeof e[n] < "u")
431
431
  try {
432
- const a = e[r];
433
- i.type === Boolean && typeof a == "boolean" || i.type === Number && typeof a == "number" || i.type === Function && typeof a == "function" ? n[r] = a : n[r] = ie(Ke(String(a), i.type));
432
+ const a = e[n];
433
+ i.type === Boolean && typeof a == "boolean" || i.type === Number && typeof a == "number" || i.type === Function && typeof a == "function" ? r[n] = a : r[n] = ie(Ke(String(a), i.type));
434
434
  } catch {
435
- n[r] = e[r];
435
+ r[n] = e[n];
436
436
  }
437
- else o !== null ? n[r] = ie(Ke(o, i.type)) : "default" in i && i.default !== void 0 && (n[r] = ie(i.default));
437
+ else o !== null ? r[n] = ie(Ke(o, i.type)) : "default" in i && i.default !== void 0 && (r[n] = ie(i.default));
438
438
  });
439
439
  }
440
- function wt(e, t, n) {
441
- t.props && bt(e, t.props, n);
440
+ function wt(e, t, r) {
441
+ t.props && bt(e, t.props, r);
442
442
  }
443
- function vt(e, t, n, r) {
444
- e.onConnected && !n && (e.onConnected(t), r(!0));
443
+ function xt(e, t, r, n) {
444
+ e.onConnected && !r && (e.onConnected(t), n(!0));
445
445
  }
446
- function xt(e, t, n, r, i, s, o, a) {
447
- e.onDisconnected && e.onDisconnected(t), n.forEach((u) => u()), r(), i(), s(!1), o(null), a(!1);
446
+ function vt(e, t, r, n, i, s, o, a) {
447
+ e.onDisconnected && e.onDisconnected(t), r.forEach((u) => u()), n(), i(), s(!1), o(null), a(!1);
448
448
  }
449
- function kt(e, t, n, r, i) {
450
- e.onAttributeChanged && e.onAttributeChanged(t, n, r, i);
449
+ function kt(e, t, r, n, i) {
450
+ e.onAttributeChanged && e.onAttributeChanged(t, r, n, i);
451
451
  }
452
452
  class Ct {
453
453
  static cache = /* @__PURE__ */ new Map();
@@ -470,14 +470,14 @@ class Ct {
470
470
  /fetch/i,
471
471
  /XMLHttpRequest/i
472
472
  ];
473
- static evaluate(t, n) {
474
- const r = this.cache.get(t);
475
- if (r) {
476
- if (!r.isSecure) {
473
+ static evaluate(t, r) {
474
+ const n = this.cache.get(t);
475
+ if (n) {
476
+ if (!n.isSecure) {
477
477
  Oe("Blocked cached dangerous expression:", t);
478
478
  return;
479
479
  }
480
- return r.evaluator(n);
480
+ return n.evaluator(r);
481
481
  }
482
482
  const i = this.createEvaluator(t);
483
483
  if (this.cache.size >= this.maxCacheSize) {
@@ -488,7 +488,7 @@ class Ct {
488
488
  Oe("Blocked dangerous expression:", t);
489
489
  return;
490
490
  }
491
- return i.evaluator(n);
491
+ return i.evaluator(r);
492
492
  }
493
493
  static createEvaluator(t) {
494
494
  if (this.hasDangerousPatterns(t))
@@ -499,28 +499,28 @@ class Ct {
499
499
  }, isSecure: !1 };
500
500
  try {
501
501
  return { evaluator: this.createSafeEvaluator(t), isSecure: !0 };
502
- } catch (n) {
503
- return Oe("Failed to create evaluator for expression:", t, n), { evaluator: () => {
502
+ } catch (r) {
503
+ return Oe("Failed to create evaluator for expression:", t, r), { evaluator: () => {
504
504
  }, isSecure: !1 };
505
505
  }
506
506
  }
507
507
  static hasDangerousPatterns(t) {
508
- return this.dangerousPatterns.some((n) => n.test(t));
508
+ return this.dangerousPatterns.some((r) => r.test(t));
509
509
  }
510
510
  static createSafeEvaluator(t) {
511
511
  if (t.trim().startsWith("{") && t.trim().endsWith("}"))
512
512
  return this.createObjectEvaluator(t);
513
513
  if (/^ctx\.[a-zA-Z0-9_\.]+$/.test(t.trim())) {
514
- const n = t.trim().slice(4);
515
- return (r) => H(r, n);
514
+ const r = t.trim().slice(4);
515
+ return (n) => H(n, r);
516
516
  }
517
- return t.includes("ctx") || /[+\-*/%<>=&|?:\[\]]/.test(t) ? this.createSimpleEvaluator(t) : (n) => H(n, t);
517
+ return t.includes("ctx") || /[+\-*/%<>=&|?:\[\]]/.test(t) ? this.createSimpleEvaluator(t) : (r) => H(r, t);
518
518
  }
519
519
  static createObjectEvaluator(t) {
520
- const n = t.trim().slice(1, -1), r = this.parseObjectProperties(n);
520
+ const r = t.trim().slice(1, -1), n = this.parseObjectProperties(r);
521
521
  return (i) => {
522
522
  const s = {};
523
- for (const { key: o, value: a } of r)
523
+ for (const { key: o, value: a } of n)
524
524
  try {
525
525
  if (a.startsWith("ctx.")) {
526
526
  const u = a.slice(4);
@@ -534,51 +534,51 @@ class Ct {
534
534
  };
535
535
  }
536
536
  static parseObjectProperties(t) {
537
- const n = [], r = t.split(",");
538
- for (const i of r) {
537
+ const r = [], n = t.split(",");
538
+ for (const i of n) {
539
539
  const s = i.indexOf(":");
540
540
  if (s === -1) continue;
541
541
  const o = i.slice(0, s).trim(), a = i.slice(s + 1).trim(), u = o.replace(/^['"]|['"]$/g, "");
542
- n.push({ key: u, value: a });
542
+ r.push({ key: u, value: a });
543
543
  }
544
- return n;
544
+ return r;
545
545
  }
546
546
  static createSimpleEvaluator(t) {
547
- return (n) => {
547
+ return (r) => {
548
548
  try {
549
- let r = t;
549
+ let n = t;
550
550
  const i = [];
551
- r = r.replace(/("[^"\\]*(?:\\.[^"\\]*)*"|'[^'\\]*(?:\\.[^'\\]*)*')/g, (b) => `<<#${i.push(b) - 1}#>>`);
552
- const s = r.match(/ctx\.[\w.]+/g) || [];
551
+ n = n.replace(/("[^"\\]*(?:\\.[^"\\]*)*"|'[^'\\]*(?:\\.[^'\\]*)*')/g, (b) => `<<#${i.push(b) - 1}#>>`);
552
+ const s = n.match(/ctx\.[\w.]+/g) || [];
553
553
  for (const b of s) {
554
- const h = b.slice(4), l = H(n, h);
554
+ const h = b.slice(4), l = H(r, h);
555
555
  if (l === void 0) return;
556
556
  const d = i.push(JSON.stringify(l)) - 1;
557
- r = r.replace(new RegExp(b.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), "g"), `<<#${d}#>>`);
557
+ n = n.replace(new RegExp(b.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), "g"), `<<#${d}#>>`);
558
558
  }
559
- const o = /\b[a-zA-Z_][a-zA-Z0-9_]*(?:\.[a-zA-Z_][a-zA-Z0-9_]*)+\b/g, a = r.match(o) || [];
559
+ const o = /\b[a-zA-Z_][a-zA-Z0-9_]*(?:\.[a-zA-Z_][a-zA-Z0-9_]*)+\b/g, a = n.match(o) || [];
560
560
  for (const b of a) {
561
561
  if (b.startsWith("ctx.")) continue;
562
- const h = H(n, b);
562
+ const h = H(r, b);
563
563
  if (h === void 0) return;
564
564
  const l = i.push(JSON.stringify(h)) - 1;
565
- r = r.replace(new RegExp(b.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), "g"), `<<#${l}#>>`);
565
+ n = n.replace(new RegExp(b.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), "g"), `<<#${l}#>>`);
566
566
  }
567
567
  const u = /\b([a-zA-Z_][a-zA-Z0-9_]*)\b/g;
568
568
  let m;
569
569
  const g = /* @__PURE__ */ new Set();
570
- for (; (m = u.exec(r)) !== null; ) {
570
+ for (; (m = u.exec(n)) !== null; ) {
571
571
  const b = m[1];
572
572
  if (["true", "false", "null", "undefined"].includes(b) || /^[0-9]+$/.test(b) || b === "ctx" || g.has(b)) continue;
573
573
  g.add(b);
574
- const h = H(n, b);
574
+ const h = H(r, b);
575
575
  if (h === void 0) return;
576
576
  const l = JSON.stringify(h), d = i.push(l) - 1;
577
- b.includes(".") ? r = r.replace(new RegExp(b.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), "g"), `<<#${d}#>>`) : r = r.replace(new RegExp("\\b" + b.replace(/[.*+?^${}()|[\]\\]/g, "\\$&") + "\\b", "g"), `<<#${d}#>>`);
577
+ b.includes(".") ? n = n.replace(new RegExp(b.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), "g"), `<<#${d}#>>`) : n = n.replace(new RegExp("\\b" + b.replace(/[.*+?^${}()|[\]\\]/g, "\\$&") + "\\b", "g"), `<<#${d}#>>`);
578
578
  }
579
- r = r.replace(/<<#(\d+)#>>/g, (b, h) => i[Number(h)]);
579
+ n = n.replace(/<<#(\d+)#>>/g, (b, h) => i[Number(h)]);
580
580
  try {
581
- return this.evaluateBasicExpression(r);
581
+ return this.evaluateBasicExpression(n);
582
582
  } catch {
583
583
  return;
584
584
  }
@@ -593,13 +593,13 @@ class Ct {
593
593
  * arithmetic (+ - * / %), comparisons, logical && and ||, parentheses, and ternary `a ? b : c`.
594
594
  */
595
595
  static evaluateBasicExpression(t) {
596
- const n = this.tokenize(t);
597
- let r = 0;
596
+ const r = this.tokenize(t);
597
+ let n = 0;
598
598
  function i() {
599
- return n[r];
599
+ return r[n];
600
600
  }
601
601
  function s(c) {
602
- const p = n[r++];
602
+ const p = r[n++];
603
603
  if (c && !p)
604
604
  throw new Error(`Unexpected token EOF, expected ${c}`);
605
605
  if (c && p && p.type !== c && p.value !== c)
@@ -707,9 +707,9 @@ class Ct {
707
707
  return c;
708
708
  }
709
709
  function d() {
710
- return i() && i().value === "!" ? (s("OP"), !d()) : i() && i().value === "-" ? (s("OP"), -d()) : v();
710
+ return i() && i().value === "!" ? (s("OP"), !d()) : i() && i().value === "-" ? (s("OP"), -d()) : x();
711
711
  }
712
- function v() {
712
+ function x() {
713
713
  const c = i();
714
714
  if (c) {
715
715
  if (c.type === "NUMBER")
@@ -736,21 +736,21 @@ class Ct {
736
736
  return o();
737
737
  }
738
738
  static tokenize(t) {
739
- const n = [], r = /\s*(=>|===|!==|==|!=|>=|<=|\|\||&&|[()?:,\[\]]|\+|-|\*|\/|%|>|<|!|\d+\.?\d*|"[^"]*"|'[^']*'|[a-zA-Z_][a-zA-Z0-9_]*|\S)\s*/g;
739
+ const r = [], n = /\s*(=>|===|!==|==|!=|>=|<=|\|\||&&|[()?:,\[\]]|\+|-|\*|\/|%|>|<|!|\d+\.?\d*|"[^"]*"|'[^']*'|[a-zA-Z_][a-zA-Z0-9_]*|\S)\s*/g;
740
740
  let i;
741
- for (; (i = r.exec(t)) !== null; ) {
741
+ for (; (i = n.exec(t)) !== null; ) {
742
742
  const s = i[1];
743
- s && (/^\d/.test(s) ? n.push({ type: "NUMBER", value: s }) : /^"/.test(s) || /^'/.test(s) ? n.push({ type: "STRING", value: s }) : /^[a-zA-Z_]/.test(s) ? n.push({ type: "IDENT", value: s }) : /^[()?:,\[\]]$/.test(s) ? n.push({ type: "PUNC", value: s }) : n.push({ type: "OP", value: s }));
743
+ s && (/^\d/.test(s) ? r.push({ type: "NUMBER", value: s }) : /^"/.test(s) || /^'/.test(s) ? r.push({ type: "STRING", value: s }) : /^[a-zA-Z_]/.test(s) ? r.push({ type: "IDENT", value: s }) : /^[()?:,\[\]]$/.test(s) ? r.push({ type: "PUNC", value: s }) : r.push({ type: "OP", value: s }));
744
744
  }
745
- return n;
745
+ return r;
746
746
  }
747
- static evaluateSimpleValue(t, n) {
747
+ static evaluateSimpleValue(t, r) {
748
748
  if (t === "true") return !0;
749
749
  if (t === "false") return !1;
750
750
  if (!isNaN(Number(t))) return Number(t);
751
751
  if (t.startsWith("ctx.")) {
752
- const r = t.slice(4);
753
- return H(n, r);
752
+ const n = t.slice(4);
753
+ return H(r, n);
754
754
  }
755
755
  return t.startsWith('"') && t.endsWith('"') || t.startsWith("'") && t.endsWith("'") ? t.slice(1, -1) : t;
756
756
  }
@@ -766,9 +766,9 @@ class oe {
766
766
  /**
767
767
  * Add an event listener with automatic cleanup tracking
768
768
  */
769
- static addListener(t, n, r, i) {
770
- t.addEventListener(n, r, i);
771
- const o = { event: n, handler: r, options: i, cleanup: () => t.removeEventListener(n, r, i), addedAt: Date.now() };
769
+ static addListener(t, r, n, i) {
770
+ t.addEventListener(r, n, i);
771
+ const o = { event: r, handler: n, options: i, cleanup: () => t.removeEventListener(r, n, i), addedAt: Date.now() };
772
772
  this.cleanupFunctions.has(t) || this.cleanupFunctions.set(t, []);
773
773
  const a = this.cleanupFunctions.get(t);
774
774
  a.push(o), this.cleanupFunctions.get(t).__metaList = a;
@@ -776,13 +776,13 @@ class oe {
776
776
  /**
777
777
  * Remove a specific event listener
778
778
  */
779
- static removeListener(t, n, r, i) {
780
- t.removeEventListener(n, r, i);
779
+ static removeListener(t, r, n, i) {
780
+ t.removeEventListener(r, n, i);
781
781
  const s = this.cleanupFunctions.get(t);
782
782
  if (s) {
783
783
  const o = s.__metaList || null;
784
784
  if (o) {
785
- const a = o.findIndex((u) => u.event === n && u.handler === r && JSON.stringify(u.options) === JSON.stringify(i));
785
+ const a = o.findIndex((u) => u.event === r && u.handler === n && JSON.stringify(u.options) === JSON.stringify(i));
786
786
  if (a >= 0) {
787
787
  try {
788
788
  o[a].cleanup();
@@ -801,8 +801,8 @@ class oe {
801
801
  * Clean up all event listeners for an element
802
802
  */
803
803
  static cleanup(t) {
804
- const n = this.cleanupFunctions.get(t);
805
- n && ((n.__metaList || n).forEach((i) => {
804
+ const r = this.cleanupFunctions.get(t);
805
+ r && ((r.__metaList || r).forEach((i) => {
806
806
  try {
807
807
  typeof i == "function" ? i() : i && typeof i.cleanup == "function" && i.cleanup();
808
808
  } catch (s) {
@@ -824,32 +824,32 @@ class oe {
824
824
  * Check if an element has any tracked event listeners
825
825
  */
826
826
  static hasListeners(t) {
827
- const n = this.cleanupFunctions.get(t), r = n ? n.__metaList || n : void 0;
828
- return !!(r && r.length > 0);
827
+ const r = this.cleanupFunctions.get(t), n = r ? r.__metaList || r : void 0;
828
+ return !!(n && n.length > 0);
829
829
  }
830
830
  /**
831
831
  * Get the number of tracked event listeners for an element
832
832
  */
833
833
  static getListenerCount(t) {
834
- const n = this.cleanupFunctions.get(t), r = n ? n.__metaList || n : void 0;
835
- return r ? r.length : 0;
834
+ const r = this.cleanupFunctions.get(t), n = r ? r.__metaList || r : void 0;
835
+ return n ? n.length : 0;
836
836
  }
837
837
  }
838
838
  function ue(e, t) {
839
839
  if (t && e instanceof HTMLElement) {
840
840
  oe.cleanup(e);
841
- for (const n in t)
842
- t[n] === e && delete t[n];
843
- for (const n of Array.from(e.childNodes))
844
- ue(n, t);
841
+ for (const r in t)
842
+ t[r] === e && delete t[r];
843
+ for (const r of Array.from(e.childNodes))
844
+ ue(r, t);
845
845
  }
846
846
  }
847
- function he(e, t, n) {
847
+ function he(e, t, r) {
848
848
  if (typeof e == "string") return;
849
- const r = e.props?.reactiveRef ?? (e.props?.props && e.props.props.reactiveRef), i = e.props?.ref ?? (e.props?.props && e.props.props.ref);
850
- r ? r.value = t : i && n && (n[i] = t);
849
+ const n = e.props?.reactiveRef ?? (e.props?.props && e.props.props.reactiveRef), i = e.props?.ref ?? (e.props?.props && e.props.props.ref);
850
+ n ? n.value = t : i && r && (r[i] = t);
851
851
  }
852
- function _t(e, t, n, r, i, s, o, a) {
852
+ function _t(e, t, r, n, i, s, o, a) {
853
853
  if (!s) return;
854
854
  const u = t.includes("lazy"), m = t.includes("trim"), g = t.includes("number"), b = e && typeof e == "object" && "value" in e && typeof e.value < "u", h = () => {
855
855
  if (b) {
@@ -859,17 +859,17 @@ function _t(e, t, n, r, i, s, o, a) {
859
859
  return H(s._state || s, e);
860
860
  }, l = h();
861
861
  let d = "text";
862
- o instanceof HTMLInputElement ? d = r?.type || o.type || "text" : o instanceof HTMLSelectElement ? d = "select" : o instanceof HTMLTextAreaElement && (d = "textarea");
863
- const v = o instanceof HTMLInputElement || o instanceof HTMLTextAreaElement || o instanceof HTMLSelectElement, c = v ? d === "checkbox" || d === "radio" ? "checked" : "value" : a ?? "modelValue";
862
+ o instanceof HTMLInputElement ? d = n?.type || o.type || "text" : o instanceof HTMLSelectElement ? d = "select" : o instanceof HTMLTextAreaElement && (d = "textarea");
863
+ const x = o instanceof HTMLInputElement || o instanceof HTMLTextAreaElement || o instanceof HTMLSelectElement, c = x ? d === "checkbox" || d === "radio" ? "checked" : "value" : a ?? "modelValue";
864
864
  if (d === "checkbox")
865
865
  if (Array.isArray(l))
866
- n[c] = l.includes(String(o?.getAttribute("value") ?? r?.value ?? ""));
866
+ r[c] = l.includes(String(o?.getAttribute("value") ?? n?.value ?? ""));
867
867
  else {
868
868
  const C = o?.getAttribute("true-value") ?? !0;
869
- n[c] = l === C;
869
+ r[c] = l === C;
870
870
  }
871
871
  else if (d === "radio")
872
- n[c] = l === (r?.value ?? "");
872
+ r[c] = l === (n?.value ?? "");
873
873
  else if (d === "select")
874
874
  if (o && o.hasAttribute("multiple") && o instanceof HTMLSelectElement) {
875
875
  const C = Array.isArray(l) ? l.map(String) : [];
@@ -877,14 +877,14 @@ function _t(e, t, n, r, i, s, o, a) {
877
877
  Array.from(o.options).forEach((k) => {
878
878
  k.selected = C.includes(k.value);
879
879
  });
880
- }, 0), n[c] = Array.isArray(l) ? l : [];
880
+ }, 0), r[c] = Array.isArray(l) ? l : [];
881
881
  } else
882
- n[c] = l;
882
+ r[c] = l;
883
883
  else {
884
- n[c] = l;
884
+ r[c] = l;
885
885
  try {
886
- const C = ne(c);
887
- r && (r[C] = l);
886
+ const C = re(c);
887
+ n && (n[C] = l);
888
888
  } catch {
889
889
  }
890
890
  }
@@ -894,7 +894,7 @@ function _t(e, t, n, r, i, s, o, a) {
894
894
  if (C.isTrusted === !1 && !k) return;
895
895
  const f = C.target;
896
896
  if (!f || f._modelUpdating) return;
897
- let x = f.value;
897
+ let v = f.value;
898
898
  if (d === "checkbox") {
899
899
  const T = h();
900
900
  if (Array.isArray(T)) {
@@ -905,38 +905,38 @@ function _t(e, t, n, r, i, s, o, a) {
905
905
  const P = S.indexOf(R);
906
906
  P > -1 && S.splice(P, 1);
907
907
  }
908
- x = S;
908
+ v = S;
909
909
  } else {
910
910
  const R = f.getAttribute("true-value") ?? !0, S = f.getAttribute("false-value") ?? !1;
911
- x = f.checked ? R : S;
911
+ v = f.checked ? R : S;
912
912
  }
913
913
  } else if (d === "radio")
914
- x = f.getAttribute("value") ?? f.value;
914
+ v = f.getAttribute("value") ?? f.value;
915
915
  else if (d === "select" && f.multiple)
916
- x = Array.from(f.selectedOptions).map((T) => T.value);
917
- else if (m && typeof x == "string" && (x = x.trim()), g) {
918
- const T = Number(x);
919
- isNaN(T) || (x = T);
916
+ v = Array.from(f.selectedOptions).map((T) => T.value);
917
+ else if (m && typeof v == "string" && (v = v.trim()), g) {
918
+ const T = Number(v);
919
+ isNaN(T) || (v = T);
920
920
  }
921
921
  const A = s._state || s, _ = h();
922
- if (Array.isArray(x) && Array.isArray(_) ? JSON.stringify([...x].sort()) !== JSON.stringify([..._].sort()) : x !== _) {
922
+ if (Array.isArray(v) && Array.isArray(_) ? JSON.stringify([...v].sort()) !== JSON.stringify([..._].sort()) : v !== _) {
923
923
  f._modelUpdating = !0;
924
924
  try {
925
925
  if (b)
926
926
  if (a && typeof e.value == "object" && e.value !== null) {
927
927
  const T = { ...e.value };
928
- T[a] = x, e.value = T;
928
+ T[a] = v, e.value = T;
929
929
  } else
930
- e.value = x;
930
+ e.value = v;
931
931
  else
932
- Ee(A, e, x);
932
+ Ee(A, e, v);
933
933
  if (s._requestRender && s._requestRender(), s._triggerWatchers) {
934
934
  const T = b ? "reactiveState" : e;
935
- s._triggerWatchers(T, x);
935
+ s._triggerWatchers(T, v);
936
936
  }
937
937
  if (f) {
938
- const T = `update:${ne(c)}`, R = new CustomEvent(T, {
939
- detail: x,
938
+ const T = `update:${re(c)}`, R = new CustomEvent(T, {
939
+ detail: v,
940
940
  bubbles: !0,
941
941
  composed: !0
942
942
  });
@@ -947,28 +947,28 @@ function _t(e, t, n, r, i, s, o, a) {
947
947
  }
948
948
  }
949
949
  };
950
- if (v) {
950
+ if (x) {
951
951
  if (i[p]) {
952
952
  const C = i[p];
953
953
  o && oe.removeListener(o, p, C);
954
954
  }
955
955
  i[p] = y;
956
956
  } else {
957
- const C = `update:${ne(c)}`;
957
+ const C = `update:${re(c)}`;
958
958
  if (i[C]) {
959
959
  const k = i[C];
960
960
  o && oe.removeListener(o, C, k);
961
961
  }
962
962
  i[C] = (k) => {
963
- const f = s._state || s, x = k.detail !== void 0 ? k.detail : k.target?.value, A = H(f, e);
964
- if (Array.isArray(x) && Array.isArray(A) ? JSON.stringify([...x].sort()) !== JSON.stringify([...A].sort()) : x !== A) {
965
- Ee(f, e, x), s._requestRender && s._requestRender(), s._triggerWatchers && s._triggerWatchers(e, x);
963
+ const f = s._state || s, v = k.detail !== void 0 ? k.detail : k.target?.value, A = H(f, e);
964
+ if (Array.isArray(v) && Array.isArray(A) ? JSON.stringify([...v].sort()) !== JSON.stringify([...A].sort()) : v !== A) {
965
+ Ee(f, e, v), s._requestRender && s._requestRender(), s._triggerWatchers && s._triggerWatchers(e, v);
966
966
  const $ = k.target;
967
967
  if ($) {
968
- $[c] = x;
968
+ $[c] = v;
969
969
  try {
970
- const T = ne(c);
971
- typeof x == "boolean" ? x ? $.setAttribute(T, "true") : $.setAttribute(T, "false") : $.setAttribute(T, String(x));
970
+ const T = re(c);
971
+ typeof v == "boolean" ? v ? $.setAttribute(T, "true") : $.setAttribute(T, "false") : $.setAttribute(T, String(v));
972
972
  } catch {
973
973
  }
974
974
  queueMicrotask(() => {
@@ -982,7 +982,7 @@ function _t(e, t, n, r, i, s, o, a) {
982
982
  i._isComposing = !1;
983
983
  const k = C.target;
984
984
  k && setTimeout(() => {
985
- const f = k.value, x = s._state || s, A = H(x, e);
985
+ const f = k.value, v = s._state || s, A = H(v, e);
986
986
  let _ = f;
987
987
  if (m && (_ = _.trim()), g) {
988
988
  const T = Number(_);
@@ -991,7 +991,7 @@ function _t(e, t, n, r, i, s, o, a) {
991
991
  if (Array.isArray(_) && Array.isArray(A) ? JSON.stringify([..._].sort()) !== JSON.stringify([...A].sort()) : _ !== A) {
992
992
  k._modelUpdating = !0;
993
993
  try {
994
- Ee(x, e, _), s._requestRender && s._requestRender(), s._triggerWatchers && s._triggerWatchers(e, _);
994
+ Ee(v, e, _), s._requestRender && s._requestRender(), s._triggerWatchers && s._triggerWatchers(e, _);
995
995
  } finally {
996
996
  setTimeout(() => k._modelUpdating = !1, 0);
997
997
  }
@@ -1003,38 +1003,38 @@ function ot(e) {
1003
1003
  const t = e.slice(2);
1004
1004
  return t ? t.charAt(0).toLowerCase() + t.slice(1) : "";
1005
1005
  }
1006
- function Et(e, t, n, r) {
1006
+ function Et(e, t, r, n) {
1007
1007
  if (typeof e == "object" && e !== null)
1008
1008
  for (const [i, s] of Object.entries(e))
1009
- i.startsWith("data-") || i.startsWith("aria-") || i === "class" ? n[i] = s : t[i] = s;
1009
+ i.startsWith("data-") || i.startsWith("aria-") || i === "class" ? r[i] = s : t[i] = s;
1010
1010
  else if (typeof e == "string") {
1011
- if (!r) return;
1011
+ if (!n) return;
1012
1012
  try {
1013
- const i = me(e, r);
1013
+ const i = me(e, n);
1014
1014
  if (typeof i == "object" && i !== null) {
1015
1015
  for (const [s, o] of Object.entries(i))
1016
- s.startsWith("data-") || s.startsWith("aria-") || s === "class" ? n[s] = o : t[s] = o;
1016
+ s.startsWith("data-") || s.startsWith("aria-") || s === "class" ? r[s] = o : t[s] = o;
1017
1017
  return;
1018
1018
  } else {
1019
- n[e] = i;
1019
+ r[e] = i;
1020
1020
  return;
1021
1021
  }
1022
1022
  } catch {
1023
- const i = H(r, e);
1024
- n[e] = i;
1023
+ const i = H(n, e);
1024
+ r[e] = i;
1025
1025
  }
1026
1026
  }
1027
1027
  }
1028
- function $t(e, t, n) {
1029
- let r;
1028
+ function $t(e, t, r) {
1029
+ let n;
1030
1030
  if (typeof e == "string") {
1031
- if (!n) return;
1032
- r = me(e, n);
1031
+ if (!r) return;
1032
+ n = me(e, r);
1033
1033
  } else
1034
- r = e;
1034
+ n = e;
1035
1035
  const i = t.style || "";
1036
1036
  let s = i;
1037
- if (r) {
1037
+ if (n) {
1038
1038
  if (i) {
1039
1039
  const o = i.split(";").map((u) => u.trim()).filter(Boolean), a = o.findIndex(
1040
1040
  (u) => u.startsWith("display:")
@@ -1053,31 +1053,31 @@ function $t(e, t, n) {
1053
1053
  function me(e, t) {
1054
1054
  return Ct.evaluate(e, t);
1055
1055
  }
1056
- function St(e, t, n) {
1057
- let r;
1056
+ function St(e, t, r) {
1057
+ let n;
1058
1058
  if (typeof e == "string") {
1059
- if (!n) return;
1060
- r = me(e, n);
1059
+ if (!r) return;
1060
+ n = me(e, r);
1061
1061
  } else
1062
- r = e;
1062
+ n = e;
1063
1063
  let i = [];
1064
- typeof r == "string" ? i = [r] : Array.isArray(r) ? i = r.filter(Boolean) : typeof r == "object" && r !== null && (i = Object.entries(r).filter(([, a]) => !!a).flatMap(([a]) => a.split(/\s+/).filter(Boolean)));
1064
+ typeof n == "string" ? i = [n] : Array.isArray(n) ? i = n.filter(Boolean) : typeof n == "object" && n !== null && (i = Object.entries(n).filter(([, a]) => !!a).flatMap(([a]) => a.split(/\s+/).filter(Boolean)));
1065
1065
  const s = t.class || "", o = s ? `${s} ${i.join(" ")}`.trim() : i.join(" ");
1066
1066
  o && (t.class = o);
1067
1067
  }
1068
- function At(e, t, n) {
1069
- let r;
1068
+ function At(e, t, r) {
1069
+ let n;
1070
1070
  if (typeof e == "string") {
1071
- if (!n) return;
1072
- r = me(e, n);
1071
+ if (!r) return;
1072
+ n = me(e, r);
1073
1073
  } else
1074
- r = e;
1074
+ n = e;
1075
1075
  let i = "";
1076
- if (typeof r == "string")
1077
- i = r;
1078
- else if (r && typeof r == "object") {
1076
+ if (typeof n == "string")
1077
+ i = n;
1078
+ else if (n && typeof n == "object") {
1079
1079
  const o = [];
1080
- for (const [a, u] of Object.entries(r))
1080
+ for (const [a, u] of Object.entries(n))
1081
1081
  if (u != null && u !== "") {
1082
1082
  const m = a.replace(
1083
1083
  /[A-Z]/g,
@@ -1116,12 +1116,12 @@ function At(e, t, n) {
1116
1116
  const s = t.style || "";
1117
1117
  t.style = s + (s && !s.endsWith(";") ? "; " : "") + i;
1118
1118
  }
1119
- function Tt(e, t, n) {
1120
- let r = e;
1121
- typeof e == "string" && n && (r = me(e, n)), ee(r) ? t.reactiveRef = r : t.ref = r;
1119
+ function Tt(e, t, r) {
1120
+ let n = e;
1121
+ typeof e == "string" && r && (n = me(e, r)), ee(n) ? t.reactiveRef = n : t.ref = n;
1122
1122
  }
1123
- function at(e, t, n, r) {
1124
- const i = {}, s = { ...r || {} }, o = {};
1123
+ function at(e, t, r, n) {
1124
+ const i = {}, s = { ...n || {} }, o = {};
1125
1125
  for (const [a, u] of Object.entries(e)) {
1126
1126
  const { value: m, modifiers: g, arg: b } = u;
1127
1127
  if (a === "model" || a.startsWith("model:")) {
@@ -1134,7 +1134,7 @@ function at(e, t, n, r) {
1134
1134
  s,
1135
1135
  o,
1136
1136
  t,
1137
- n,
1137
+ r,
1138
1138
  l
1139
1139
  );
1140
1140
  continue;
@@ -1187,39 +1187,39 @@ function Be(e, t) {
1187
1187
  return Array.isArray(g) && (g = Be(g, u)), { ...o, key: u, children: g };
1188
1188
  });
1189
1189
  }
1190
- const n = e;
1191
- let r = n.props?.key ?? n.key ?? t, i = n.children;
1192
- return Array.isArray(i) && (i = Be(i, r)), { ...n, key: r, children: i };
1190
+ const r = e;
1191
+ let n = r.props?.key ?? r.key ?? t, i = r.children;
1192
+ return Array.isArray(i) && (i = Be(i, n)), { ...r, key: n, children: i };
1193
1193
  }
1194
- function Ve(e, t, n, r) {
1195
- const i = n.directives ?? {}, s = at(
1194
+ function Ve(e, t, r, n) {
1195
+ const i = r.directives ?? {}, s = at(
1196
1196
  i,
1197
- r,
1197
+ n,
1198
1198
  e,
1199
- n.attrs
1199
+ r.attrs
1200
1200
  ), o = {
1201
1201
  ...t.props,
1202
- ...n.props,
1202
+ ...r.props,
1203
1203
  ...s.props
1204
1204
  }, a = {
1205
1205
  ...t.attrs,
1206
- ...n.attrs,
1206
+ ...r.attrs,
1207
1207
  ...s.attrs
1208
- }, u = t.props ?? {}, m = o, g = n?.isCustomElement ?? t?.isCustomElement ?? !1;
1208
+ }, u = t.props ?? {}, m = o, g = r?.isCustomElement ?? t?.isCustomElement ?? !1;
1209
1209
  let b = !1;
1210
1210
  for (const d in { ...u, ...m }) {
1211
- const v = u[d], w = m[d];
1212
- if (v !== w)
1211
+ const x = u[d], w = m[d];
1212
+ if (x !== w)
1213
1213
  if (b = !0, d === "value" && (e instanceof HTMLInputElement || e instanceof HTMLTextAreaElement || e instanceof HTMLSelectElement))
1214
1214
  e.value !== w && (e.value = w ?? "");
1215
1215
  else if (d === "checked" && e instanceof HTMLInputElement)
1216
1216
  e.checked = !!w;
1217
1217
  else if (d.startsWith("on") && typeof w == "function") {
1218
1218
  const c = ot(d);
1219
- typeof v == "function" && oe.removeListener(e, c, v), oe.addListener(e, c, w);
1219
+ typeof x == "function" && oe.removeListener(e, c, x), oe.addListener(e, c, w);
1220
1220
  } else if (w == null)
1221
1221
  e.removeAttribute(d);
1222
- else if ((n?.isCustomElement ?? t?.isCustomElement ?? !1) || d in e)
1222
+ else if ((r?.isCustomElement ?? t?.isCustomElement ?? !1) || d in e)
1223
1223
  try {
1224
1224
  e[d] = w;
1225
1225
  } catch {
@@ -1227,15 +1227,15 @@ function Ve(e, t, n, r) {
1227
1227
  else
1228
1228
  w === !1 && e.removeAttribute(d);
1229
1229
  }
1230
- for (const [d, v] of Object.entries(
1230
+ for (const [d, x] of Object.entries(
1231
1231
  s.listeners || {}
1232
1232
  ))
1233
- oe.addListener(e, d, v);
1233
+ oe.addListener(e, d, x);
1234
1234
  const h = t.attrs ?? {}, l = a;
1235
1235
  for (const d in { ...h, ...l }) {
1236
- const v = h[d], w = l[d];
1237
- let c = v, p = w;
1238
- if (ee(v) && (c = v.value), ee(w) && (p = w.value), c !== p)
1236
+ const x = h[d], w = l[d];
1237
+ let c = x, p = w;
1238
+ if (ee(x) && (c = x.value), ee(w) && (p = w.value), c !== p)
1239
1239
  if (b = !0, p == null || p === !1) {
1240
1240
  if (e.removeAttribute(d), d === "value") {
1241
1241
  if (e instanceof HTMLInputElement || e instanceof HTMLTextAreaElement)
@@ -1327,7 +1327,7 @@ function Ve(e, t, n, r) {
1327
1327
  } catch {
1328
1328
  }
1329
1329
  }
1330
- function X(e, t, n) {
1330
+ function X(e, t, r) {
1331
1331
  if (typeof e == "string")
1332
1332
  return document.createTextNode(e);
1333
1333
  if (e.tag === "#text") {
@@ -1337,80 +1337,80 @@ function X(e, t, n) {
1337
1337
  return e.key != null && (h.key = e.key), h;
1338
1338
  }
1339
1339
  if (e.tag === "#anchor") {
1340
- const h = e, l = Array.isArray(h.children) ? h.children : [], d = document.createTextNode(""), v = document.createTextNode("");
1341
- h.key != null && (d.key = `${h.key}:start`, v.key = `${h.key}:end`), h._startNode = d, h._endNode = v;
1340
+ const h = e, l = Array.isArray(h.children) ? h.children : [], d = document.createTextNode(""), x = document.createTextNode("");
1341
+ h.key != null && (d.key = `${h.key}:start`, x.key = `${h.key}:end`), h._startNode = d, h._endNode = x;
1342
1342
  const w = document.createDocumentFragment();
1343
1343
  w.appendChild(d);
1344
1344
  for (const c of l) {
1345
1345
  const p = X(c, t);
1346
1346
  w.appendChild(p);
1347
1347
  }
1348
- return w.appendChild(v), w;
1348
+ return w.appendChild(x), w;
1349
1349
  }
1350
- const r = document.createElement(e.tag);
1351
- e.key != null && (r.key = e.key);
1352
- const { props: i = {}, attrs: s = {}, directives: o = {} } = e.props ?? {}, a = at(o, t, r, s), u = {
1350
+ const n = document.createElement(e.tag);
1351
+ e.key != null && (n.key = e.key);
1352
+ const { props: i = {}, attrs: s = {}, directives: o = {} } = e.props ?? {}, a = at(o, t, n, s), u = {
1353
1353
  ...i,
1354
1354
  ...a.props
1355
1355
  }, m = {
1356
1356
  ...s,
1357
1357
  ...a.attrs
1358
- }, g = r.namespaceURI === "http://www.w3.org/2000/svg";
1358
+ }, g = n.namespaceURI === "http://www.w3.org/2000/svg";
1359
1359
  for (const h in m) {
1360
1360
  const l = m[h];
1361
1361
  if (!(typeof h != "string" || /\[object Object\]/.test(h))) {
1362
1362
  if (typeof l == "boolean")
1363
- l && r.setAttribute(h, "");
1363
+ l && n.setAttribute(h, "");
1364
1364
  else if (l != null)
1365
- if (!g && h === "value" && (r instanceof HTMLInputElement || r instanceof HTMLTextAreaElement || r instanceof HTMLSelectElement || r instanceof HTMLProgressElement))
1365
+ if (!g && h === "value" && (n instanceof HTMLInputElement || n instanceof HTMLTextAreaElement || n instanceof HTMLSelectElement || n instanceof HTMLProgressElement))
1366
1366
  try {
1367
- r instanceof HTMLProgressElement ? r.value = Number(l) : r.value = l ?? "";
1367
+ n instanceof HTMLProgressElement ? n.value = Number(l) : n.value = l ?? "";
1368
1368
  } catch {
1369
- r.setAttribute(h, String(l));
1369
+ n.setAttribute(h, String(l));
1370
1370
  }
1371
- else if (!g && h === "checked" && r instanceof HTMLInputElement)
1371
+ else if (!g && h === "checked" && n instanceof HTMLInputElement)
1372
1372
  try {
1373
- r.checked = !!l;
1373
+ n.checked = !!l;
1374
1374
  } catch {
1375
- r.setAttribute(h, String(l));
1375
+ n.setAttribute(h, String(l));
1376
1376
  }
1377
- else if (!g && h in r)
1377
+ else if (!g && h in n)
1378
1378
  try {
1379
- r[h] = l;
1379
+ n[h] = l;
1380
1380
  } catch {
1381
- r.setAttribute(h, String(l));
1381
+ n.setAttribute(h, String(l));
1382
1382
  }
1383
1383
  else if ((e.props?.isCustomElement ?? !1) && !g && h.includes("-")) {
1384
- const v = it(h);
1384
+ const x = it(h);
1385
1385
  try {
1386
- r[v] = l;
1386
+ n[x] = l;
1387
1387
  } catch {
1388
- r.setAttribute(h, String(l));
1388
+ n.setAttribute(h, String(l));
1389
1389
  }
1390
1390
  } else
1391
- r.setAttribute(h, String(l));
1391
+ n.setAttribute(h, String(l));
1392
1392
  }
1393
1393
  }
1394
1394
  for (const h in u) {
1395
1395
  const l = u[h];
1396
1396
  if (!(typeof h != "string" || /\[object Object\]/.test(h)))
1397
- if (h === "value" && (r instanceof HTMLInputElement || r instanceof HTMLTextAreaElement || r instanceof HTMLSelectElement)) {
1397
+ if (h === "value" && (n instanceof HTMLInputElement || n instanceof HTMLTextAreaElement || n instanceof HTMLSelectElement)) {
1398
1398
  const d = typeof l == "object" && l !== null && typeof l.value < "u" ? l.value : l;
1399
- r.value = d ?? "";
1400
- } else if (h === "checked" && r instanceof HTMLInputElement) {
1399
+ n.value = d ?? "";
1400
+ } else if (h === "checked" && n instanceof HTMLInputElement) {
1401
1401
  const d = typeof l == "object" && l !== null && typeof l.value < "u" ? l.value : l;
1402
- r.checked = !!d;
1402
+ n.checked = !!d;
1403
1403
  } else if (h.startsWith("on") && typeof l == "function")
1404
- oe.addListener(r, ot(h), l);
1404
+ oe.addListener(n, ot(h), l);
1405
1405
  else {
1406
1406
  if (h.startsWith("on") && l === void 0)
1407
1407
  continue;
1408
1408
  if (l == null || l === !1)
1409
- r.removeAttribute(h);
1410
- else if ((e.props?.isCustomElement ?? !1) || h in r)
1409
+ n.removeAttribute(h);
1410
+ else if ((e.props?.isCustomElement ?? !1) || h in n)
1411
1411
  try {
1412
- const v = typeof l == "object" && l !== null && typeof l.value < "u" ? l.value : l;
1413
- r[h] = v;
1412
+ const x = typeof l == "object" && l !== null && typeof l.value < "u" ? l.value : l;
1413
+ n[h] = x;
1414
1414
  } catch {
1415
1415
  }
1416
1416
  }
@@ -1418,7 +1418,7 @@ function X(e, t, n) {
1418
1418
  for (const [h, l] of Object.entries(
1419
1419
  a.listeners || {}
1420
1420
  ))
1421
- oe.addListener(r, h, l);
1421
+ oe.addListener(n, h, l);
1422
1422
  const b = {
1423
1423
  ...e,
1424
1424
  props: {
@@ -1426,36 +1426,36 @@ function X(e, t, n) {
1426
1426
  ...a.props
1427
1427
  }
1428
1428
  };
1429
- he(b, r, n);
1429
+ he(b, n, r);
1430
1430
  try {
1431
- if (typeof r._applyProps == "function")
1431
+ if (typeof n._applyProps == "function")
1432
1432
  try {
1433
- r._applyProps(r._cfg);
1433
+ n._applyProps(n._cfg);
1434
1434
  } catch {
1435
1435
  }
1436
- typeof r.requestRender == "function" ? r.requestRender() : typeof r._render == "function" && r._render(r._cfg);
1436
+ typeof n.requestRender == "function" ? n.requestRender() : typeof n._render == "function" && n._render(n._cfg);
1437
1437
  } catch {
1438
1438
  }
1439
1439
  if (Array.isArray(e.children))
1440
1440
  for (const h of e.children)
1441
- r.appendChild(X(h, t, n));
1442
- else typeof e.children == "string" && (r.textContent = e.children);
1441
+ n.appendChild(X(h, t, r));
1442
+ else typeof e.children == "string" && (n.textContent = e.children);
1443
1443
  try {
1444
- if (r instanceof HTMLSelectElement && m && m.hasOwnProperty("value"))
1444
+ if (n instanceof HTMLSelectElement && m && m.hasOwnProperty("value"))
1445
1445
  try {
1446
- r.value = m.value ?? "";
1446
+ n.value = m.value ?? "";
1447
1447
  } catch {
1448
1448
  }
1449
1449
  } catch {
1450
1450
  }
1451
- return r;
1451
+ return n;
1452
1452
  }
1453
- function Rt(e, t, n, r, i) {
1454
- if (typeof n == "string") {
1455
- e.textContent !== n && (e.textContent = n);
1453
+ function Rt(e, t, r, n, i) {
1454
+ if (typeof r == "string") {
1455
+ e.textContent !== r && (e.textContent = r);
1456
1456
  return;
1457
1457
  }
1458
- if (!Array.isArray(n)) return;
1458
+ if (!Array.isArray(r)) return;
1459
1459
  const s = Array.from(e.childNodes), o = Array.isArray(t) ? t : [], a = /* @__PURE__ */ new Map();
1460
1460
  for (const l of o)
1461
1461
  l && l.key != null && a.set(l.key, l);
@@ -1467,16 +1467,16 @@ function Rt(e, t, n, r, i) {
1467
1467
  const m = /* @__PURE__ */ new Set();
1468
1468
  let g = e.firstChild;
1469
1469
  function b(l, d) {
1470
- let v = l;
1471
- for (; v && (m.add(v), v !== d); )
1472
- v = v.nextSibling;
1470
+ let x = l;
1471
+ for (; x && (m.add(x), x !== d); )
1472
+ x = x.nextSibling;
1473
1473
  }
1474
- function h(l, d, v, w) {
1474
+ function h(l, d, x, w) {
1475
1475
  const c = [];
1476
1476
  let p = l.nextSibling;
1477
1477
  for (; p && p !== d; )
1478
1478
  c.push(p), p = p.nextSibling;
1479
- const y = Array.isArray(v) ? v : [];
1479
+ const y = Array.isArray(x) ? x : [];
1480
1480
  if (w.some((k) => k && k.key != null) || y.some((k) => k && k.key != null)) {
1481
1481
  const k = /* @__PURE__ */ new Map(), f = /* @__PURE__ */ new Map();
1482
1482
  for (const _ of y)
@@ -1485,7 +1485,7 @@ function Rt(e, t, n, r, i) {
1485
1485
  const $ = _.key;
1486
1486
  $ != null && f.set($, _);
1487
1487
  }
1488
- const x = /* @__PURE__ */ new Set();
1488
+ const v = /* @__PURE__ */ new Set();
1489
1489
  let A = l.nextSibling;
1490
1490
  for (const _ of w) {
1491
1491
  let $;
@@ -1495,121 +1495,121 @@ function Rt(e, t, n, r, i) {
1495
1495
  f.get(_.key),
1496
1496
  T,
1497
1497
  _,
1498
- r
1499
- ), x.add($), $ !== A && e.contains($) && e.insertBefore($, A);
1498
+ n
1499
+ ), v.add($), $ !== A && e.contains($) && e.insertBefore($, A);
1500
1500
  } else
1501
- $ = X(_, r), e.insertBefore($, A), x.add($);
1501
+ $ = X(_, n), e.insertBefore($, A), v.add($);
1502
1502
  A = $.nextSibling;
1503
1503
  }
1504
1504
  for (const _ of c)
1505
- !x.has(_) && e.contains(_) && e.removeChild(_);
1505
+ !v.has(_) && e.contains(_) && e.removeChild(_);
1506
1506
  } else {
1507
1507
  const k = Math.min(
1508
1508
  y.length,
1509
1509
  w.length
1510
1510
  );
1511
1511
  for (let f = 0; f < k; f++) {
1512
- const x = y[f], A = w[f], _ = $e(c[f], x, A, r);
1512
+ const v = y[f], A = w[f], _ = $e(c[f], v, A, n);
1513
1513
  _ !== c[f] && (e.insertBefore(_, c[f]), e.removeChild(c[f]));
1514
1514
  }
1515
1515
  for (let f = k; f < w.length; f++)
1516
- e.insertBefore(X(w[f], r), d);
1516
+ e.insertBefore(X(w[f], n), d);
1517
1517
  for (let f = k; f < c.length; f++)
1518
1518
  e.removeChild(c[f]);
1519
1519
  }
1520
1520
  }
1521
- for (const l of n) {
1521
+ for (const l of r) {
1522
1522
  let d;
1523
1523
  if (l.tag === "#anchor") {
1524
- const v = l.key, w = `${v}:start`, c = `${v}:end`;
1524
+ const x = l.key, w = `${x}:start`, c = `${x}:end`;
1525
1525
  let p = u.get(w), y = u.get(c);
1526
1526
  const C = Array.isArray(l.children) ? l.children : [];
1527
1527
  if (p || (p = document.createTextNode(""), p.key = w), y || (y = document.createTextNode(""), y.key = c), l._startNode = p, l._endNode = y, !e.contains(p) || !e.contains(y)) {
1528
1528
  e.insertBefore(p, g);
1529
1529
  for (const k of C)
1530
- e.insertBefore(X(k, r), g);
1530
+ e.insertBefore(X(k, n), g);
1531
1531
  e.insertBefore(y, g);
1532
1532
  } else
1533
1533
  h(
1534
1534
  p,
1535
1535
  y,
1536
- a.get(v)?.children,
1536
+ a.get(x)?.children,
1537
1537
  C
1538
1538
  );
1539
1539
  b(p, y), g = y.nextSibling;
1540
1540
  continue;
1541
1541
  }
1542
1542
  if (l.key != null && u.has(l.key)) {
1543
- const v = a.get(l.key);
1543
+ const x = a.get(l.key);
1544
1544
  d = $e(
1545
1545
  u.get(l.key),
1546
- v,
1546
+ x,
1547
1547
  l,
1548
- r,
1548
+ n,
1549
1549
  i
1550
1550
  ), m.add(d), d !== g && e.contains(d) && (g && !e.contains(g) && (g = null), e.insertBefore(d, g));
1551
1551
  } else
1552
- d = X(l, r, i), g && !e.contains(g) && (g = null), e.insertBefore(d, g), m.add(d);
1552
+ d = X(l, n, i), g && !e.contains(g) && (g = null), e.insertBefore(d, g), m.add(d);
1553
1553
  g = d.nextSibling;
1554
1554
  }
1555
1555
  for (const l of s)
1556
1556
  !m.has(l) && e.contains(l) && (ue(l, i), e.removeChild(l));
1557
1557
  }
1558
- function $e(e, t, n, r, i) {
1559
- if (t && typeof t != "string" && t.props?.ref && i && ue(e, i), t === n) return e;
1560
- if (typeof n == "string") {
1558
+ function $e(e, t, r, n, i) {
1559
+ if (t && typeof t != "string" && t.props?.ref && i && ue(e, i), t === r) return e;
1560
+ if (typeof r == "string") {
1561
1561
  if (e.nodeType === Node.TEXT_NODE)
1562
- return e.textContent !== n && (e.textContent = n), e;
1562
+ return e.textContent !== r && (e.textContent = r), e;
1563
1563
  {
1564
- const o = document.createTextNode(n);
1564
+ const o = document.createTextNode(r);
1565
1565
  return e.parentNode?.replaceChild(o, e), o;
1566
1566
  }
1567
1567
  }
1568
- if (n && typeof n != "string" && n.tag === "#anchor") {
1569
- const o = n, a = Array.isArray(o.children) ? o.children : [], u = o._startNode ?? document.createTextNode(""), m = o._endNode ?? document.createTextNode("");
1568
+ if (r && typeof r != "string" && r.tag === "#anchor") {
1569
+ const o = r, a = Array.isArray(o.children) ? o.children : [], u = o._startNode ?? document.createTextNode(""), m = o._endNode ?? document.createTextNode("");
1570
1570
  o.key != null && (u.key = `${o.key}:start`, m.key = `${o.key}:end`), o._startNode = u, o._endNode = m;
1571
1571
  const g = document.createDocumentFragment();
1572
1572
  g.appendChild(u);
1573
1573
  for (const b of a) {
1574
- const h = X(b, r);
1574
+ const h = X(b, n);
1575
1575
  g.appendChild(h);
1576
1576
  }
1577
1577
  return g.appendChild(m), e.parentNode?.replaceChild(g, e), u;
1578
1578
  }
1579
- if (!n) {
1579
+ if (!r) {
1580
1580
  ue(e, i);
1581
1581
  const o = document.createComment("removed");
1582
1582
  return e.parentNode?.replaceChild(o, e), o;
1583
1583
  }
1584
1584
  if (!t || typeof t == "string") {
1585
1585
  ue(e, i);
1586
- const o = X(n, r, i);
1587
- return he(n, o, i), e.parentNode?.replaceChild(o, e), o;
1586
+ const o = X(r, n, i);
1587
+ return he(r, o, i), e.parentNode?.replaceChild(o, e), o;
1588
1588
  }
1589
- if (n.tag === "#anchor") {
1590
- const o = Array.isArray(n.children) ? n.children : [], a = n._startNode ?? document.createTextNode(""), u = n._endNode ?? document.createTextNode("");
1591
- n.key != null && (a.key = `${n.key}:start`, u.key = `${n.key}:end`), n._startNode = a, n._endNode = u;
1589
+ if (r.tag === "#anchor") {
1590
+ const o = Array.isArray(r.children) ? r.children : [], a = r._startNode ?? document.createTextNode(""), u = r._endNode ?? document.createTextNode("");
1591
+ r.key != null && (a.key = `${r.key}:start`, u.key = `${r.key}:end`), r._startNode = a, r._endNode = u;
1592
1592
  const m = document.createDocumentFragment();
1593
1593
  m.appendChild(a);
1594
1594
  for (const g of o)
1595
- m.appendChild(X(g, r));
1595
+ m.appendChild(X(g, n));
1596
1596
  return m.appendChild(u), e.parentNode?.replaceChild(m, e), a;
1597
1597
  }
1598
- if (typeof t != "string" && typeof n != "string" && t.tag === n.tag && t.key === n.key) {
1598
+ if (typeof t != "string" && typeof r != "string" && t.tag === r.tag && t.key === r.key) {
1599
1599
  const o = e;
1600
- return Ve(o, t.props || {}, n.props || {}, r), Rt(o, t.children, n.children, r, i), he(n, o, i), o;
1600
+ return Ve(o, t.props || {}, r.props || {}, n), Rt(o, t.children, r.children, n, i), he(r, o, i), o;
1601
1601
  }
1602
- if (typeof t != "string" && typeof n != "string" && t.tag === n.tag && (t.tag && String(t.tag).includes("-") || n.props && n.props.isCustomElement || t.props && t.props.isCustomElement))
1602
+ 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))
1603
1603
  try {
1604
1604
  const a = e;
1605
- return Ve(a, t.props || {}, n.props || {}, r), he(n, a, i), a;
1605
+ return Ve(a, t.props || {}, r.props || {}, n), he(r, a, i), a;
1606
1606
  } catch {
1607
1607
  }
1608
1608
  ue(e, i);
1609
- const s = X(n, r, i);
1610
- return he(n, s, i), e.parentNode?.replaceChild(s, e), s;
1609
+ const s = X(r, n, i);
1610
+ return he(r, s, i), e.parentNode?.replaceChild(s, e), s;
1611
1611
  }
1612
- function Ot(e, t, n, r) {
1612
+ function Ot(e, t, r, n) {
1613
1613
  let i;
1614
1614
  Array.isArray(t) ? t.length === 1 ? (i = t[0], i && typeof i == "object" && i.key == null && (i = { ...i, key: "__root__" })) : i = { tag: "div", key: "__root__", children: t } : (i = t, i && typeof i == "object" && i.key == null && (i = { ...i, key: "__root__" })), i && typeof i == "object" && i.tag === "#anchor" && (i = {
1615
1615
  tag: "div",
@@ -1619,11 +1619,11 @@ function Ot(e, t, n, r) {
1619
1619
  }), i = Be(i, String(i.key ?? "root"));
1620
1620
  const s = e._prevVNode ?? null, o = e._prevDom ?? e.firstChild ?? null;
1621
1621
  let a;
1622
- s && o ? typeof s != "string" && typeof i != "string" && s.tag === i.tag && s.key === i.key ? a = $e(o, s, i, n, r) : (a = X(i, n, r), e.replaceChild(a, o)) : (a = X(i, n, r), e.firstChild ? e.replaceChild(a, e.firstChild) : e.appendChild(a));
1622
+ s && o ? typeof s != "string" && typeof i != "string" && s.tag === i.tag && s.key === i.key ? a = $e(o, s, i, r, n) : (a = X(i, r, n), e.replaceChild(a, o)) : (a = X(i, r, n), e.firstChild ? e.replaceChild(a, e.firstChild) : e.appendChild(a));
1623
1623
  const u = [];
1624
1624
  for (let m = 0; m < e.childNodes.length; m++) {
1625
1625
  const g = e.childNodes[m];
1626
- g !== a && g.nodeName !== "STYLE" && (ue(g, r), u.push(g));
1626
+ g !== a && g.nodeName !== "STYLE" && (ue(g, n), u.push(g));
1627
1627
  }
1628
1628
  u.forEach((m) => e.removeChild(m)), e._prevVNode = i, e._prevDom = a;
1629
1629
  }
@@ -1635,16 +1635,16 @@ function Pe(e) {
1635
1635
  return (Array.isArray(e.children) ? e.children.filter(Boolean) : []).map(Pe).join("");
1636
1636
  let t = "";
1637
1637
  e.props && e.props.attrs && (t = Object.entries(e.props.attrs).map(([i, s]) => ` ${i}="${ie(String(s))}"`).join(""));
1638
- let n = "";
1639
- e.props && (n = Object.entries(e.props).filter(([i]) => i !== "attrs" && i !== "directives" && i !== "ref" && i !== "key").map(([i, s]) => ` ${i}="${ie(String(s))}"`).join(""));
1640
- const r = Array.isArray(e.children) ? e.children.filter(Boolean).map(Pe).join("") : typeof e.children == "string" ? ie(e.children) : e.children ? Pe(e.children) : "";
1641
- return `<${e.tag}${t}${n}>${r}</${e.tag}>`;
1638
+ let r = "";
1639
+ e.props && (r = Object.entries(e.props).filter(([i]) => i !== "attrs" && i !== "directives" && i !== "ref" && i !== "key").map(([i, s]) => ` ${i}="${ie(String(s))}"`).join(""));
1640
+ const n = Array.isArray(e.children) ? e.children.filter(Boolean).map(Pe).join("") : typeof e.children == "string" ? ie(e.children) : e.children ? Pe(e.children) : "";
1641
+ return `<${e.tag}${t}${r}>${n}</${e.tag}>`;
1642
1642
  }
1643
1643
  function Pt(e, ...t) {
1644
- let n = "";
1645
- for (let r = 0; r < e.length; r++)
1646
- n += e[r], r < t.length && (n += t[r]);
1647
- return n;
1644
+ let r = "";
1645
+ for (let n = 0; n < e.length; n++)
1646
+ r += e[n], n < t.length && (r += t[n]);
1647
+ return r;
1648
1648
  }
1649
1649
  function ct(e) {
1650
1650
  return e.replace(/\/\*[\s\S]*?\*\//g, "").replace(/\s+/g, " ").replace(/\s*([{}:;,>+~])\s*/g, "$1").replace(/;}/g, "}").trim();
@@ -1814,9 +1814,9 @@ const Mt = Pt`
1814
1814
  Object.entries(jt).map(([e, t]) => [
1815
1815
  e,
1816
1816
  Object.fromEntries(
1817
- Object.entries(t).map(([n, r]) => [
1818
- n,
1819
- `var(--color-${e}${n === "DEFAULT" ? "" : `-${n}`}, ${r})`
1817
+ Object.entries(t).map(([r, n]) => [
1818
+ r,
1819
+ `var(--color-${e}${r === "DEFAULT" ? "" : `-${r}`}, ${n})`
1820
1820
  ])
1821
1821
  )
1822
1822
  ])
@@ -1850,8 +1850,8 @@ const Mt = Pt`
1850
1850
  "7xl": 320
1851
1851
  }, zt = () => {
1852
1852
  const e = {};
1853
- for (const [t, n] of Object.entries(Wt))
1854
- e[`max-w-${t}`] = `max-width:calc(${le} * ${n});`, e[`min-w-${t}`] = `min-width:calc(${le} * ${n});`, e[`w-${t}`] = `width:calc(${le} * ${n});`, e[`max-h-${t}`] = `max-height:calc(${le} * ${n});`, e[`min-h-${t}`] = `min-height:calc(${le} * ${n});`, e[`h-${t}`] = `height:calc(${le} * ${n});`;
1853
+ for (const [t, r] of Object.entries(Wt))
1854
+ e[`max-w-${t}`] = `max-width:calc(${le} * ${r});`, e[`min-w-${t}`] = `min-width:calc(${le} * ${r});`, e[`w-${t}`] = `width:calc(${le} * ${r});`, e[`max-h-${t}`] = `max-height:calc(${le} * ${r});`, e[`min-h-${t}`] = `min-height:calc(${le} * ${r});`, e[`h-${t}`] = `height:calc(${le} * ${r});`;
1855
1855
  return e;
1856
1856
  }, Dt = () => {
1857
1857
  const e = {};
@@ -1889,6 +1889,14 @@ const Mt = Pt`
1889
1889
  "overflow-hidden": "overflow:hidden;",
1890
1890
  "overflow-visible": "overflow:visible;",
1891
1891
  "overflow-scroll": "overflow:scroll;",
1892
+ "overflow-y-auto": "overflow-y:auto;",
1893
+ "overflow-y-hidden": "overflow-y:hidden;",
1894
+ "overflow-y-visible": "overflow-y:visible;",
1895
+ "overflow-y-scroll": "overflow-y:scroll;",
1896
+ "overflow-x-auto": "overflow-x:auto;",
1897
+ "overflow-x-hidden": "overflow-x:hidden;",
1898
+ "overflow-x-visible": "overflow-x:visible;",
1899
+ "overflow-x-scroll": "overflow-x:scroll;",
1892
1900
  /* Pointer Events */
1893
1901
  "pointer-events-none": "pointer-events:none;",
1894
1902
  "pointer-events-auto": "pointer-events:auto;",
@@ -1934,20 +1942,62 @@ const Mt = Pt`
1934
1942
  "text-8xl": "font-size:6rem;line-height:1",
1935
1943
  /* Borders */
1936
1944
  border: "border-width:1px;",
1945
+ "border-t": "border-top-width:1px;",
1946
+ "border-r": "border-right-width:1px;",
1947
+ "border-b": "border-bottom-width:1px;",
1948
+ "border-l": "border-left-width:1px;",
1949
+ "border-x": "border-inline-width:1px;",
1950
+ "border-y": "border-block-width:1px;",
1937
1951
  "border-2": "border-width:2px;",
1938
1952
  "border-4": "border-width:4px;",
1939
1953
  "border-6": "border-width:6px;",
1940
1954
  "border-8": "border-width:8px;",
1941
1955
  "rounded-none": "border-radius:0;",
1942
1956
  "rounded-xs": "border-radius:0.125rem;",
1957
+ "rounded-t-xs": "border-top-left-radius:0.125rem;border-top-right-radius:0.125rem;",
1958
+ "rounded-r-xs": "border-top-right-radius:0.125rem;border-bottom-right-radius:0.125rem;",
1959
+ "rounded-b-xs": "border-bottom-left-radius:0.125rem;border-bottom-right-radius:0.125rem;",
1960
+ "rounded-l-xs": "border-top-left-radius:0.125rem;border-bottom-left-radius:0.125rem;",
1943
1961
  "rounded-sm": "border-radius:0.25rem;",
1962
+ "rounded-t-sm": "border-top-left-radius:0.25rem;border-top-right-radius:0.25rem;",
1963
+ "rounded-r-sm": "border-top-right-radius:0.25rem;border-bottom-right-radius:0.25rem;",
1964
+ "rounded-b-sm": "border-bottom-left-radius:0.25rem;border-bottom-right-radius:0.25rem;",
1965
+ "rounded-l-sm": "border-top-left-radius:0.25rem;border-bottom-left-radius:0.25rem;",
1944
1966
  "rounded-md": "border-radius:0.375rem;",
1967
+ "rounded-t-md": "border-top-left-radius:0.375rem;border-top-right-radius:0.375rem;",
1968
+ "rounded-r-md": "border-top-right-radius:0.375rem;border-bottom-right-radius:0.375rem;",
1969
+ "rounded-b-md": "border-bottom-left-radius:0.375rem;border-bottom-right-radius:0.375rem;",
1970
+ "rounded-l-md": "border-top-left-radius:0.375rem;border-bottom-left-radius:0.375rem;",
1945
1971
  "rounded-lg": "border-radius:0.5rem;",
1972
+ "rounded-t-lg": "border-top-left-radius:0.5rem;border-top-right-radius:0.5rem;",
1973
+ "rounded-r-lg": "border-top-right-radius:0.5rem;border-bottom-right-radius:0.5rem;",
1974
+ "rounded-b-lg": "border-bottom-left-radius:0.5rem;border-bottom-right-radius:0.5rem;",
1975
+ "rounded-l-lg": "border-top-left-radius:0.5rem;border-bottom-left-radius:0.5rem;",
1946
1976
  "rounded-xl": "border-radius:0.75rem;",
1977
+ "rounded-t-xl": "border-top-left-radius:0.75rem;border-top-right-radius:0.75rem;",
1978
+ "rounded-r-xl": "border-top-right-radius:0.75rem;border-bottom-right-radius:0.75rem;",
1979
+ "rounded-b-xl": "border-bottom-left-radius:0.75rem;border-bottom-right-radius:0.75rem;",
1980
+ "rounded-l-xl": "border-top-left-radius:0.75rem;border-bottom-left-radius:0.75rem;",
1947
1981
  "rounded-2xl": "border-radius:1rem;",
1982
+ "rounded-t-2xl": "border-top-left-radius:1rem;border-top-right-radius:1rem;",
1983
+ "rounded-r-2xl": "border-top-right-radius:1rem;border-bottom-right-radius:1rem;",
1984
+ "rounded-b-2xl": "border-bottom-left-radius:1rem;border-bottom-right-radius:1rem;",
1985
+ "rounded-l-2xl": "border-top-left-radius:1rem;border-bottom-left-radius:1rem;",
1948
1986
  "rounded-3xl": "border-radius:1.5rem;",
1987
+ "rounded-t-3xl": "border-top-left-radius:1.5rem;border-top-right-radius:1.5rem;",
1988
+ "rounded-r-3xl": "border-top-right-radius:1.5rem;border-bottom-right-radius:1.5rem;",
1989
+ "rounded-b-3xl": "border-bottom-left-radius:1.5rem;border-bottom-right-radius:1.5rem;",
1990
+ "rounded-l-3xl": "border-top-left-radius:1.5rem;border-bottom-left-radius:1.5rem;",
1949
1991
  "rounded-4xl": "border-radius:2rem;",
1992
+ "rounded-t-4xl": "border-top-left-radius:2rem;border-top-right-radius:2rem;",
1993
+ "rounded-r-4xl": "border-top-right-radius:2rem;border-bottom-right-radius:2rem;",
1994
+ "rounded-b-4xl": "border-bottom-left-radius:2rem;border-bottom-right-radius:2rem;",
1995
+ "rounded-l-4xl": "border-top-left-radius:2rem;border-bottom-left-radius:2rem;",
1950
1996
  "rounded-full": "border-radius:9999px;",
1997
+ "rounded-t-full": "border-top-left-radius:9999px;border-top-right-radius:9999px;",
1998
+ "rounded-r-full": "border-top-right-radius:9999px;border-bottom-right-radius:9999px;",
1999
+ "rounded-b-full": "border-bottom-left-radius:9999px;border-bottom-right-radius:9999px;",
2000
+ "rounded-l-full": "border-top-left-radius:9999px;border-bottom-left-radius:9999px;",
1951
2001
  /* Shadow and effects */
1952
2002
  // Shadows use a CSS variable for color so color utilities can modify --ce-shadow-color
1953
2003
  "shadow-none": "--ce-shadow-color: rgb(0 0 0 / 0);box-shadow:0 0 var(--ce-shadow-color, #0000);",
@@ -2064,14 +2114,14 @@ const Mt = Pt`
2064
2114
  "gap-y": ["row-gap"]
2065
2115
  };
2066
2116
  function G(e, t) {
2067
- let n = 0, r = 0;
2117
+ let r = 0, n = 0;
2068
2118
  for (let i = 0; i < e.length; i++) {
2069
2119
  const s = e[i];
2070
- if (s === "[") n++;
2071
- else if (s === "]" && n > 0) n--;
2072
- else if (s === "(") r++;
2073
- else if (s === ")" && r > 0) r--;
2074
- else if (n === 0 && r === 0 && (s === ">" || s === "+" || s === "~" || s === " "))
2120
+ if (s === "[") r++;
2121
+ else if (s === "]" && r > 0) r--;
2122
+ else if (s === "(") n++;
2123
+ else if (s === ")" && n > 0) n--;
2124
+ else if (r === 0 && n === 0 && (s === ">" || s === "+" || s === "~" || s === " "))
2075
2125
  return e.slice(0, i) + t + e.slice(i);
2076
2126
  }
2077
2127
  return e + t;
@@ -2110,23 +2160,23 @@ const It = {
2110
2160
  dark: "(prefers-color-scheme: dark)"
2111
2161
  }, je = ["sm", "md", "lg", "xl", "2xl"];
2112
2162
  function Ne(e) {
2113
- const t = e.startsWith("-"), r = (t ? e.slice(1) : e).split("-");
2114
- if (r.length < 2) return null;
2115
- const i = r.slice(0, -1).join("-"), s = r[r.length - 1], o = parseFloat(s);
2163
+ const t = e.startsWith("-"), n = (t ? e.slice(1) : e).split("-");
2164
+ if (n.length < 2) return null;
2165
+ const i = n.slice(0, -1).join("-"), s = n[n.length - 1], o = parseFloat(s);
2116
2166
  if (Number.isNaN(o) || !Ze[i]) return null;
2117
2167
  const a = t ? "-" : "";
2118
2168
  return Ze[i].map((u) => `${u}:calc(${a}${le} * ${o});`).join("");
2119
2169
  }
2120
2170
  function Ge(e) {
2121
- const t = e.replace("#", ""), n = parseInt(t, 16), r = n >> 16 & 255, i = n >> 8 & 255, s = n & 255;
2122
- return `${r} ${i} ${s}`;
2171
+ const t = e.replace("#", ""), r = parseInt(t, 16), n = r >> 16 & 255, i = r >> 8 & 255, s = r & 255;
2172
+ return `${n} ${i} ${s}`;
2123
2173
  }
2124
2174
  function Ht(e) {
2125
2175
  const t = /^(bg|text|border|decoration|shadow|outline|caret|accent|fill|stroke)-([a-z]+)-?(\d{2,3}|DEFAULT)?$/.exec(e);
2126
2176
  if (!t) return null;
2127
- const [, n, r, i = "DEFAULT"] = t, s = Nt[r]?.[i];
2177
+ const [, r, n, i = "DEFAULT"] = t, s = Nt[n]?.[i];
2128
2178
  if (!s) return null;
2129
- if (n === "shadow") return `--ce-shadow-color:${s};`;
2179
+ if (r === "shadow") return `--ce-shadow-color:${s};`;
2130
2180
  const a = {
2131
2181
  bg: "background-color",
2132
2182
  decoration: "text-decoration-color",
@@ -2137,33 +2187,33 @@ function Ht(e) {
2137
2187
  accent: "accent-color",
2138
2188
  fill: "fill",
2139
2189
  stroke: "stroke"
2140
- }[n];
2190
+ }[r];
2141
2191
  return a ? `${a}:${s};` : null;
2142
2192
  }
2143
2193
  function Bt(e) {
2144
- const [t, n] = e.split("/");
2145
- if (!n) return { base: t };
2146
- const r = parseInt(n, 10);
2147
- return isNaN(r) || r < 0 || r > 100 ? { base: t } : { base: t, opacity: r / 100 };
2194
+ const [t, r] = e.split("/");
2195
+ if (!r) return { base: t };
2196
+ const n = parseInt(r, 10);
2197
+ return isNaN(n) || n < 0 || n > 100 ? { base: t } : { base: t, opacity: n / 100 };
2148
2198
  }
2149
2199
  function We(e) {
2150
- const { base: t, opacity: n } = Bt(e), r = Ht(t);
2151
- if (r) {
2152
- if (n !== void 0) {
2153
- const s = /#([0-9a-f]{6})/i.exec(r);
2200
+ const { base: t, opacity: r } = Bt(e), n = Ht(t);
2201
+ if (n) {
2202
+ if (r !== void 0) {
2203
+ const s = /#([0-9a-f]{6})/i.exec(n);
2154
2204
  if (s) {
2155
2205
  const o = Ge(s[0]);
2156
- return r.replace(/#([0-9a-f]{6})/i, `rgb(${o} / ${n})`);
2206
+ return n.replace(/#([0-9a-f]{6})/i, `rgb(${o} / ${r})`);
2157
2207
  }
2158
2208
  }
2159
- return r;
2209
+ return n;
2160
2210
  }
2161
2211
  const i = Se(t);
2162
- if (i && n !== void 0) {
2212
+ if (i && r !== void 0) {
2163
2213
  const s = /#([0-9a-f]{6})/i.exec(i);
2164
2214
  if (s) {
2165
2215
  const o = Ge(s[0]);
2166
- return i.replace(/#([0-9a-f]{6})/i, `rgb(${o} / ${n})`);
2216
+ return i.replace(/#([0-9a-f]{6})/i, `rgb(${o} / ${r})`);
2167
2217
  }
2168
2218
  }
2169
2219
  return i;
@@ -2171,8 +2221,8 @@ function We(e) {
2171
2221
  function ze(e) {
2172
2222
  const t = /^opacity-(\d{1,3})$/.exec(e);
2173
2223
  if (!t) return null;
2174
- const n = parseInt(t[1], 10);
2175
- return n < 0 || n > 100 ? null : `opacity:${n / 100};`;
2224
+ const r = parseInt(t[1], 10);
2225
+ return r < 0 || r > 100 ? null : `opacity:${r / 100};`;
2176
2226
  }
2177
2227
  function Se(e) {
2178
2228
  if (e.startsWith("[") && e.endsWith("]") && !e.includes("-[")) {
@@ -2184,9 +2234,9 @@ function Se(e) {
2184
2234
  }
2185
2235
  return null;
2186
2236
  }
2187
- const t = e.indexOf("-["), n = e.endsWith("]");
2188
- if (t > 0 && n) {
2189
- const r = e.slice(0, t);
2237
+ const t = e.indexOf("-["), r = e.endsWith("]");
2238
+ if (t > 0 && r) {
2239
+ const n = e.slice(0, t);
2190
2240
  let i = e.slice(t + 2, -1);
2191
2241
  i = i.replace(/_/g, " ");
2192
2242
  const s = {
@@ -2205,12 +2255,12 @@ function Se(e) {
2205
2255
  "max-w": "max-width",
2206
2256
  "min-h": "min-height",
2207
2257
  "max-h": "max-height",
2208
- "border-t": "border-top",
2209
- "border-b": "border-bottom",
2210
- "border-l": "border-left",
2211
- "border-r": "border-right",
2212
- "border-x": "border-inline",
2213
- "border-y": "border-block",
2258
+ "border-t": "border-top-width",
2259
+ "border-b": "border-bottom-width",
2260
+ "border-l": "border-left-width",
2261
+ "border-r": "border-right-width",
2262
+ "border-x": "border-inline-width",
2263
+ "border-y": "border-block-width",
2214
2264
  "grid-cols": "grid-template-columns",
2215
2265
  "grid-rows": "grid-template-rows",
2216
2266
  transition: "transition-property",
@@ -2233,22 +2283,22 @@ function Se(e) {
2233
2283
  leading: "line-height",
2234
2284
  z: "z-index"
2235
2285
  };
2236
- if (r === "rotate")
2286
+ if (n === "rotate")
2237
2287
  return `transform:rotate(${i});`;
2238
- const o = s[r] ?? r.replace(/_/g, "-");
2288
+ const o = s[n] ?? n.replace(/_/g, "-");
2239
2289
  if (o && i) return `${o}:${i};`;
2240
2290
  }
2241
2291
  return null;
2242
2292
  }
2243
2293
  function Ut(e) {
2244
2294
  if (e.startsWith("[") && e.endsWith("]")) {
2245
- const n = e.slice(1, -1);
2246
- return n.includes("&") ? n : e;
2295
+ const r = e.slice(1, -1);
2296
+ return r.includes("&") ? r : e;
2247
2297
  }
2248
2298
  const t = e.indexOf("-[");
2249
2299
  if (t > 0 && e.endsWith("]")) {
2250
- const n = e.slice(t + 2, -1).replace(/_/g, "-");
2251
- return n.includes("&") ? n : e.replace(/_/g, "-");
2300
+ const r = e.slice(t + 2, -1).replace(/_/g, "-");
2301
+ return r.includes("&") ? r : e.replace(/_/g, "-");
2252
2302
  }
2253
2303
  return null;
2254
2304
  }
@@ -2256,19 +2306,19 @@ function qt(e) {
2256
2306
  return e.replace(/([!"#$%&'()*+,./:;<=>?@[\\\]^`{|}~])/g, "\\$1");
2257
2307
  }
2258
2308
  function Ft(e) {
2259
- const t = /class\s*=\s*(['"])(.*?)\1/g, n = [];
2260
- let r;
2261
- for (; r = t.exec(e); ) {
2262
- const i = r[2].split(/\s+/).filter(Boolean);
2263
- i.length && n.push(...i);
2309
+ const t = /class\s*=\s*(['"])(.*?)\1/g, r = [];
2310
+ let n;
2311
+ for (; n = t.exec(e); ) {
2312
+ const i = n[2].split(/\s+/).filter(Boolean);
2313
+ i.length && r.push(...i);
2264
2314
  }
2265
- return n.filter(Boolean);
2315
+ return r.filter(Boolean);
2266
2316
  }
2267
2317
  const Xe = /* @__PURE__ */ new Map(), Kt = 16;
2268
2318
  function Vt(e) {
2269
- const t = Date.now(), n = Xe.get(e);
2270
- if (n && t - n.timestamp < Kt) return n.css;
2271
- const r = Ft(e), i = new Set(r), s = [], o = [], a = [], u = [], m = {};
2319
+ const t = Date.now(), r = Xe.get(e);
2320
+ if (r && t - r.timestamp < Kt) return r.css;
2321
+ const n = Ft(e), i = new Set(n), s = [], o = [], a = [], u = [], m = {};
2272
2322
  function g(w, c = !1) {
2273
2323
  const p = (c ? "dark|" : "") + w;
2274
2324
  if (p in m) return m[p];
@@ -2325,8 +2375,8 @@ function Vt(e) {
2325
2375
  if (!C) return null;
2326
2376
  const k = C.replace(/^!/, ""), f = Le[k] ?? Ne(k) ?? ze(k) ?? We(k) ?? Se(k);
2327
2377
  if (!f) return null;
2328
- const x = p.indexOf(C);
2329
- let A = x >= 0 ? p.slice(0, x) : [];
2378
+ const v = p.indexOf(C);
2379
+ let A = v >= 0 ? p.slice(0, v) : [];
2330
2380
  c && (A = A.filter((E) => E !== "dark"));
2331
2381
  const _ = `.${qt(w)}`, $ = "__SUBJECT__", T = y ? f.replace(/;$/, " !important;") : f;
2332
2382
  let R = $;
@@ -2404,40 +2454,40 @@ function Vt(e) {
2404
2454
  f && (k === 1 ? s.push(f) : k === 2 ? o.push(f) : k === 3 && a.push(f));
2405
2455
  }
2406
2456
  }
2407
- const v = [...s, ...o, ...a, ...u].join("");
2408
- return Xe.set(e, { css: v, timestamp: t }), v;
2457
+ const x = [...s, ...o, ...a, ...u].join("");
2458
+ return Xe.set(e, { css: x, timestamp: t }), x;
2409
2459
  }
2410
2460
  const ge = [];
2411
- function Jt(e, t, n, r, i, s, o, a) {
2461
+ function Jt(e, t, r, n, i, s, o, a) {
2412
2462
  if (e) {
2413
- ge.push(n);
2463
+ ge.push(r);
2414
2464
  try {
2415
- const u = t.render(n);
2465
+ const u = t.render(r);
2416
2466
  if (u instanceof Promise) {
2417
2467
  s(!0), u.then((m) => {
2418
- s(!1), o(null), Ye(e, m, n, r, i), a(e.innerHTML);
2468
+ s(!1), o(null), Ye(e, m, r, n, i), a(e.innerHTML);
2419
2469
  }).catch((m) => {
2420
2470
  s(!1), o(m);
2421
2471
  });
2422
2472
  return;
2423
2473
  }
2424
- Ye(e, u, n, r, i), a(e.innerHTML);
2474
+ Ye(e, u, r, n, i), a(e.innerHTML);
2425
2475
  } finally {
2426
2476
  ge.pop();
2427
2477
  }
2428
2478
  }
2429
2479
  }
2430
- function Ye(e, t, n, r, i) {
2480
+ function Ye(e, t, r, n, i) {
2431
2481
  e && (Ot(
2432
2482
  e,
2433
2483
  Array.isArray(t) ? t : [t],
2434
- n,
2435
- r
2484
+ r,
2485
+ n
2436
2486
  ), i(e.innerHTML));
2437
2487
  }
2438
- function Zt(e, t, n, r, i, s, o) {
2488
+ function Zt(e, t, r, n, i, s, o) {
2439
2489
  if (s !== null && clearTimeout(s), Date.now() - t < 16) {
2440
- if (i(n + 1), n === 15)
2490
+ if (i(r + 1), r === 15)
2441
2491
  console.warn(
2442
2492
  `⚠️ Component is re-rendering rapidly. This might indicate:
2443
2493
  Common causes:
@@ -2446,7 +2496,7 @@ function Zt(e, t, n, r, i, s, o) {
2446
2496
  • Missing dependencies in computed/watch
2447
2497
  Component rendering will be throttled to prevent browser freeze.`
2448
2498
  );
2449
- else if (n > 20) {
2499
+ else if (r > 20) {
2450
2500
  console.error(
2451
2501
  `🛑 Infinite loop detected in component render:
2452
2502
  • This might be caused by state updates during render
@@ -2458,13 +2508,13 @@ Stopping runaway component render to prevent browser freeze`
2458
2508
  } else
2459
2509
  i(0);
2460
2510
  const m = setTimeout(() => {
2461
- r(Date.now()), e(), o(null);
2462
- }, n > 10 ? 100 : 0);
2511
+ n(Date.now()), e(), o(null);
2512
+ }, r > 10 ? 100 : 0);
2463
2513
  o(m);
2464
2514
  }
2465
- function Gt(e, t, n, r, i) {
2515
+ function Gt(e, t, r, n, i) {
2466
2516
  if (!e) return;
2467
- const s = Vt(n);
2517
+ const s = Vt(r);
2468
2518
  if ((!s || s.trim() === "") && !t._computedStyle) {
2469
2519
  i(null), e.adoptedStyleSheets = [Je()];
2470
2520
  return;
@@ -2475,7 +2525,7 @@ function Gt(e, t, n, r, i) {
2475
2525
  ${s}
2476
2526
  `);
2477
2527
  a = ct(a);
2478
- let u = r;
2528
+ let u = n;
2479
2529
  u || (u = new CSSStyleSheet()), (u.cssRules.length === 0 || u.toString() !== a) && u.replaceSync(a), e.adoptedStyleSheets = [Je(), u], i(u);
2480
2530
  }
2481
2531
  let N = null;
@@ -2485,11 +2535,11 @@ function Xt(e) {
2485
2535
  function Yt() {
2486
2536
  N = null;
2487
2537
  }
2488
- function hn() {
2538
+ function pr() {
2489
2539
  if (!N)
2490
2540
  throw new Error("useEmit must be called during component render");
2491
2541
  const e = N.emit;
2492
- return (t, n) => e(t, n);
2542
+ return (t, r) => e(t, r);
2493
2543
  }
2494
2544
  function ye(e) {
2495
2545
  e._hookCallbacks || Object.defineProperty(e, "_hookCallbacks", {
@@ -2499,27 +2549,27 @@ function ye(e) {
2499
2549
  configurable: !1
2500
2550
  });
2501
2551
  }
2502
- function gn(e) {
2552
+ function hr(e) {
2503
2553
  if (!N)
2504
2554
  throw new Error("useOnConnected must be called during component render");
2505
2555
  ye(N), N._hookCallbacks.onConnected = e;
2506
2556
  }
2507
- function mn(e) {
2557
+ function gr(e) {
2508
2558
  if (!N)
2509
2559
  throw new Error("useOnDisconnected must be called during component render");
2510
2560
  ye(N), N._hookCallbacks.onDisconnected = e;
2511
2561
  }
2512
- function yn(e) {
2562
+ function mr(e) {
2513
2563
  if (!N)
2514
2564
  throw new Error("useOnAttributeChanged must be called during component render");
2515
2565
  ye(N), N._hookCallbacks.onAttributeChanged = e;
2516
2566
  }
2517
- function bn(e) {
2567
+ function yr(e) {
2518
2568
  if (!N)
2519
2569
  throw new Error("useOnError must be called during component render");
2520
2570
  ye(N), N._hookCallbacks.onError = e;
2521
2571
  }
2522
- function wn(e) {
2572
+ function br(e) {
2523
2573
  if (!N)
2524
2574
  throw new Error("useStyle must be called during component render");
2525
2575
  ye(N);
@@ -2591,33 +2641,33 @@ function Qt(e, t) {
2591
2641
  _templateError = null;
2592
2642
  constructor() {
2593
2643
  super(), this.attachShadow({ mode: "open" }), this._cfg = Te.get(e) || t, this._componentId = `${e}-${Math.random().toString(36).substr(2, 9)}`;
2594
- const n = this._initContext(t);
2595
- Object.defineProperty(n, "refs", {
2644
+ const r = this._initContext(t);
2645
+ Object.defineProperty(r, "refs", {
2596
2646
  value: this._refs,
2597
2647
  writable: !1,
2598
2648
  enumerable: !1,
2599
2649
  configurable: !1
2600
- }), Object.defineProperty(n, "requestRender", {
2650
+ }), Object.defineProperty(r, "requestRender", {
2601
2651
  value: () => this.requestRender(),
2602
2652
  writable: !1,
2603
2653
  enumerable: !1,
2604
2654
  configurable: !1
2605
- }), Object.defineProperty(n, "_requestRender", {
2655
+ }), Object.defineProperty(r, "_requestRender", {
2606
2656
  value: () => this._requestRender(),
2607
2657
  writable: !1,
2608
2658
  enumerable: !1,
2609
2659
  configurable: !1
2610
- }), Object.defineProperty(n, "_componentId", {
2660
+ }), Object.defineProperty(r, "_componentId", {
2611
2661
  value: this._componentId,
2612
2662
  writable: !1,
2613
2663
  enumerable: !1,
2614
2664
  configurable: !1
2615
- }), Object.defineProperty(n, "_triggerWatchers", {
2665
+ }), Object.defineProperty(r, "_triggerWatchers", {
2616
2666
  value: (i, s) => this._triggerWatchers(i, s),
2617
2667
  writable: !1,
2618
2668
  enumerable: !1,
2619
2669
  configurable: !1
2620
- }), this.context = n, Object.defineProperty(this.context, "emit", {
2670
+ }), this.context = r, Object.defineProperty(this.context, "emit", {
2621
2671
  value: (i, s, o) => {
2622
2672
  const a = new CustomEvent(i, {
2623
2673
  detail: s,
@@ -2631,11 +2681,11 @@ function Qt(e, t) {
2631
2681
  enumerable: !1,
2632
2682
  configurable: !1
2633
2683
  });
2634
- const r = Te.get(e) || t;
2635
- Object.keys(r).forEach((i) => {
2636
- const s = r[i];
2684
+ const n = Te.get(e) || t;
2685
+ Object.keys(n).forEach((i) => {
2686
+ const s = n[i];
2637
2687
  typeof s == "function" && (this.context[i] = (...o) => s(...o, this.context));
2638
- }), this._applyComputed(r), r.props && Object.keys(r.props).forEach((i) => {
2688
+ }), this._applyComputed(n), n.props && Object.keys(n.props).forEach((i) => {
2639
2689
  let s = this[i];
2640
2690
  Object.defineProperty(this, i, {
2641
2691
  get() {
@@ -2643,28 +2693,28 @@ function Qt(e, t) {
2643
2693
  },
2644
2694
  set(o) {
2645
2695
  const a = s;
2646
- s = o, this.context[i] = o, this._initializing || (this._applyProps(r), a !== o && this._requestRender());
2696
+ s = o, this.context[i] = o, this._initializing || (this._applyProps(n), a !== o && this._requestRender());
2647
2697
  },
2648
2698
  enumerable: !0,
2649
2699
  configurable: !0
2650
2700
  });
2651
- }), this._initializing = !1, this._initWatchers(r), this._applyProps(r), this._render(r);
2701
+ }), this._initializing = !1, this._initWatchers(n), this._applyProps(n), this._render(n);
2652
2702
  }
2653
2703
  connectedCallback() {
2654
2704
  this._runLogicWithinErrorBoundary(t, () => {
2655
- this._applyProps(t), this._requestRender(), vt(
2705
+ this._applyProps(t), this._requestRender(), xt(
2656
2706
  t,
2657
2707
  this.context,
2658
2708
  this._mounted,
2659
- (n) => {
2660
- this._mounted = n;
2709
+ (r) => {
2710
+ this._mounted = r;
2661
2711
  }
2662
2712
  );
2663
2713
  });
2664
2714
  }
2665
2715
  disconnectedCallback() {
2666
2716
  this._runLogicWithinErrorBoundary(t, () => {
2667
- xt(
2717
+ vt(
2668
2718
  t,
2669
2719
  this.context,
2670
2720
  this._listeners,
@@ -2674,52 +2724,52 @@ function Qt(e, t) {
2674
2724
  () => {
2675
2725
  this._watchers.clear();
2676
2726
  },
2677
- (n) => {
2678
- this._templateLoading = n;
2727
+ (r) => {
2728
+ this._templateLoading = r;
2679
2729
  },
2680
- (n) => {
2681
- this._templateError = n;
2730
+ (r) => {
2731
+ this._templateError = r;
2682
2732
  },
2683
- (n) => {
2684
- this._mounted = n;
2733
+ (r) => {
2734
+ this._mounted = r;
2685
2735
  }
2686
2736
  );
2687
2737
  });
2688
2738
  }
2689
- attributeChangedCallback(n, r, i) {
2739
+ attributeChangedCallback(r, n, i) {
2690
2740
  this._runLogicWithinErrorBoundary(t, () => {
2691
- this._applyProps(t), r !== i && this._requestRender(), kt(
2741
+ this._applyProps(t), n !== i && this._requestRender(), kt(
2692
2742
  t,
2693
- n,
2694
2743
  r,
2744
+ n,
2695
2745
  i,
2696
2746
  this.context
2697
2747
  );
2698
2748
  });
2699
2749
  }
2700
2750
  static get observedAttributes() {
2701
- return t.props ? Object.keys(t.props).map(ne) : [];
2751
+ return t.props ? Object.keys(t.props).map(re) : [];
2702
2752
  }
2703
- _applyComputed(n) {
2753
+ _applyComputed(r) {
2704
2754
  }
2705
2755
  // --- Render ---
2706
- _render(n) {
2707
- this._runLogicWithinErrorBoundary(n, () => {
2756
+ _render(r) {
2757
+ this._runLogicWithinErrorBoundary(r, () => {
2708
2758
  Jt(
2709
2759
  this.shadowRoot,
2710
- n,
2760
+ r,
2711
2761
  this.context,
2712
2762
  this._refs,
2713
- (r) => {
2714
- this._lastHtmlStringForJitCSS = r, typeof this.onHtmlStringUpdate == "function" && this.onHtmlStringUpdate(r);
2763
+ (n) => {
2764
+ this._lastHtmlStringForJitCSS = n, typeof this.onHtmlStringUpdate == "function" && this.onHtmlStringUpdate(n);
2715
2765
  },
2716
- (r) => {
2717
- this._templateLoading = r, typeof this.onLoadingStateChange == "function" && this.onLoadingStateChange(r);
2766
+ (n) => {
2767
+ this._templateLoading = n, typeof this.onLoadingStateChange == "function" && this.onLoadingStateChange(n);
2718
2768
  },
2719
- (r) => {
2720
- this._templateError = r, typeof this.onErrorStateChange == "function" && this.onErrorStateChange(r);
2769
+ (n) => {
2770
+ this._templateError = n, typeof this.onErrorStateChange == "function" && this.onErrorStateChange(n);
2721
2771
  },
2722
- (r) => this._applyStyle(n, r)
2772
+ (n) => this._applyStyle(r, n)
2723
2773
  );
2724
2774
  });
2725
2775
  }
@@ -2733,27 +2783,27 @@ function Qt(e, t) {
2733
2783
  () => this._render(this._cfg),
2734
2784
  this._lastRenderTime,
2735
2785
  this._renderCount,
2736
- (n) => {
2737
- this._lastRenderTime = n;
2786
+ (r) => {
2787
+ this._lastRenderTime = r;
2738
2788
  },
2739
- (n) => {
2740
- this._renderCount = n;
2789
+ (r) => {
2790
+ this._renderCount = r;
2741
2791
  },
2742
2792
  this._renderTimeoutId,
2743
- (n) => {
2744
- this._renderTimeoutId = n;
2793
+ (r) => {
2794
+ this._renderTimeoutId = r;
2745
2795
  }
2746
2796
  );
2747
2797
  }, this._componentId);
2748
2798
  });
2749
2799
  }
2750
2800
  // --- Style ---
2751
- _applyStyle(n, r) {
2752
- this._runLogicWithinErrorBoundary(n, () => {
2801
+ _applyStyle(r, n) {
2802
+ this._runLogicWithinErrorBoundary(r, () => {
2753
2803
  Gt(
2754
2804
  this.shadowRoot,
2755
2805
  this.context,
2756
- r,
2806
+ n,
2757
2807
  this._styleSheet,
2758
2808
  (i) => {
2759
2809
  this._styleSheet = i;
@@ -2762,18 +2812,18 @@ function Qt(e, t) {
2762
2812
  });
2763
2813
  }
2764
2814
  // --- Error Boundary function ---
2765
- _runLogicWithinErrorBoundary(n, r) {
2815
+ _runLogicWithinErrorBoundary(r, n) {
2766
2816
  this._hasError && (this._hasError = !1);
2767
2817
  try {
2768
- r();
2818
+ n();
2769
2819
  } catch (i) {
2770
- this._hasError = !0, n.onError && n.onError(i, this.context);
2820
+ this._hasError = !0, r.onError && r.onError(i, this.context);
2771
2821
  }
2772
2822
  }
2773
2823
  // --- State, props, computed ---
2774
- _initContext(n) {
2824
+ _initContext(r) {
2775
2825
  try {
2776
- let r = function(s, o = "") {
2826
+ let n = function(s, o = "") {
2777
2827
  return Array.isArray(s) ? new Proxy(s, {
2778
2828
  get(a, u, m) {
2779
2829
  const g = Reflect.get(a, u, m);
@@ -2789,7 +2839,7 @@ function Qt(e, t) {
2789
2839
  const l = g.apply(a, h);
2790
2840
  if (!i._initializing) {
2791
2841
  const d = o || "root";
2792
- i._triggerWatchers(d, a), fe(() => i._render(n), i._componentId);
2842
+ i._triggerWatchers(d, a), fe(() => i._render(r), i._componentId);
2793
2843
  }
2794
2844
  return l;
2795
2845
  } : g;
@@ -2797,27 +2847,27 @@ function Qt(e, t) {
2797
2847
  set(a, u, m) {
2798
2848
  if (a[u] = m, !i._initializing) {
2799
2849
  const g = o ? `${o}.${String(u)}` : String(u);
2800
- i._triggerWatchers(g, m), fe(() => i._render(n), i._componentId);
2850
+ i._triggerWatchers(g, m), fe(() => i._render(r), i._componentId);
2801
2851
  }
2802
2852
  return !0;
2803
2853
  },
2804
2854
  deleteProperty(a, u) {
2805
2855
  if (delete a[u], !i._initializing) {
2806
2856
  const m = o ? `${o}.${String(u)}` : String(u);
2807
- i._triggerWatchers(m, void 0), fe(() => i._render(n), i._componentId);
2857
+ i._triggerWatchers(m, void 0), fe(() => i._render(r), i._componentId);
2808
2858
  }
2809
2859
  return !0;
2810
2860
  }
2811
2861
  }) : s && typeof s == "object" ? s.constructor && s.constructor.name === "ReactiveState" ? s : (Object.keys(s).forEach((a) => {
2812
2862
  const u = o ? `${o}.${a}` : a;
2813
- s[a] = r(s[a], u);
2863
+ s[a] = n(s[a], u);
2814
2864
  }), new Proxy(s, {
2815
2865
  set(a, u, m) {
2816
2866
  const g = o ? `${o}.${String(u)}` : String(u);
2817
- return a[u] = r(m, g), i._initializing || (i._triggerWatchers(
2867
+ return a[u] = n(m, g), i._initializing || (i._triggerWatchers(
2818
2868
  g,
2819
2869
  a[u]
2820
- ), fe(() => i._render(n), i._componentId)), !0;
2870
+ ), fe(() => i._render(r), i._componentId)), !0;
2821
2871
  },
2822
2872
  get(a, u, m) {
2823
2873
  return Reflect.get(a, u, m);
@@ -2825,19 +2875,19 @@ function Qt(e, t) {
2825
2875
  })) : s;
2826
2876
  };
2827
2877
  const i = this;
2828
- return r({
2878
+ return n({
2829
2879
  // For functional components, state is managed by state() function calls
2830
2880
  // Include prop defaults in initial reactive context so prop updates trigger reactivity
2831
- ...n.props ? Object.fromEntries(
2832
- Object.entries(n.props).map(([s, o]) => [s, o.default])
2881
+ ...r.props ? Object.fromEntries(
2882
+ Object.entries(r.props).map(([s, o]) => [s, o.default])
2833
2883
  ) : {}
2834
2884
  });
2835
2885
  } catch {
2836
2886
  return {};
2837
2887
  }
2838
2888
  }
2839
- _initWatchers(n) {
2840
- this._runLogicWithinErrorBoundary(n, () => {
2889
+ _initWatchers(r) {
2890
+ this._runLogicWithinErrorBoundary(r, () => {
2841
2891
  mt(
2842
2892
  this.context,
2843
2893
  this._watchers,
@@ -2846,24 +2896,24 @@ function Qt(e, t) {
2846
2896
  );
2847
2897
  });
2848
2898
  }
2849
- _triggerWatchers(n, r) {
2850
- yt(this.context, this._watchers, n, r);
2899
+ _triggerWatchers(r, n) {
2900
+ yt(this.context, this._watchers, r, n);
2851
2901
  }
2852
- _applyProps(n) {
2853
- this._runLogicWithinErrorBoundary(n, () => {
2902
+ _applyProps(r) {
2903
+ this._runLogicWithinErrorBoundary(r, () => {
2854
2904
  try {
2855
- wt(this, n, this.context);
2856
- } catch (r) {
2857
- this._hasError = !0, n.onError && n.onError(r, this.context);
2905
+ wt(this, r, this.context);
2906
+ } catch (n) {
2907
+ this._hasError = !0, r.onError && r.onError(n, this.context);
2858
2908
  }
2859
2909
  });
2860
2910
  }
2861
2911
  };
2862
2912
  }
2863
2913
  function et(e, t) {
2864
- let n = ne(e);
2865
- n.includes("-") || (n = `cer-${n}`);
2866
- let r = {};
2914
+ let r = re(e);
2915
+ r.includes("-") || (r = `cer-${r}`);
2916
+ let n = {};
2867
2917
  if (typeof window < "u")
2868
2918
  try {
2869
2919
  const a = t.toString().match(/\(\s*{\s*([^}]+)\s*}/);
@@ -2874,13 +2924,13 @@ function et(e, t) {
2874
2924
  if (b !== -1) {
2875
2925
  const h = g.substring(0, b).trim(), l = g.substring(b + 1).trim();
2876
2926
  try {
2877
- l === "true" ? r[h] = !0 : l === "false" ? r[h] = !1 : l === "[]" ? r[h] = [] : l === "{}" ? r[h] = {} : /^\d+$/.test(l) ? r[h] = parseInt(l) : /^'.*'$/.test(l) || /^".*"$/.test(l) ? r[h] = l.slice(1, -1) : r[h] = l;
2927
+ l === "true" ? n[h] = !0 : l === "false" ? n[h] = !1 : l === "[]" ? n[h] = [] : l === "{}" ? n[h] = {} : /^\d+$/.test(l) ? n[h] = parseInt(l) : /^'.*'$/.test(l) || /^".*"$/.test(l) ? n[h] = l.slice(1, -1) : n[h] = l;
2878
2928
  } catch {
2879
- r[h] = "";
2929
+ n[h] = "";
2880
2930
  }
2881
2931
  } else {
2882
2932
  const h = g.split(":")[0].trim();
2883
- h && !h.includes("}") && (r[h] = "");
2933
+ h && !h.includes("}") && (n[h] = "");
2884
2934
  }
2885
2935
  }
2886
2936
  }
@@ -2890,7 +2940,7 @@ function et(e, t) {
2890
2940
  const s = {
2891
2941
  // Generate props config from defaults
2892
2942
  props: Object.fromEntries(
2893
- Object.entries(r).map(([o, a]) => [o, { type: typeof a == "boolean" ? Boolean : typeof a == "number" ? Number : typeof a == "string" ? String : Function, default: a }])
2943
+ Object.entries(n).map(([o, a]) => [o, { type: typeof a == "boolean" ? Boolean : typeof a == "number" ? Number : typeof a == "string" ? String : Function, default: a }])
2894
2944
  ),
2895
2945
  // Add lifecycle hooks from the stored functions
2896
2946
  onConnected: (o) => {
@@ -2906,18 +2956,18 @@ function et(e, t) {
2906
2956
  i.onError && o && i.onError(o);
2907
2957
  },
2908
2958
  render: (o) => {
2909
- const a = o._componentId || `${n}-${Math.random().toString(36).substr(2, 9)}`;
2959
+ const a = o._componentId || `${r}-${Math.random().toString(36).substr(2, 9)}`;
2910
2960
  F.setCurrentComponent(a, () => {
2911
2961
  o.requestRender && o.requestRender();
2912
2962
  });
2913
2963
  try {
2914
2964
  Xt(o);
2915
- const u = Object.keys(r).length > 0;
2965
+ const u = Object.keys(n).length > 0;
2916
2966
  let m;
2917
2967
  if (u) {
2918
2968
  const g = {};
2919
- Object.keys(r).forEach((b) => {
2920
- g[b] = o[b] ?? r[b];
2969
+ Object.keys(n).forEach((b) => {
2970
+ g[b] = o[b] ?? n[b];
2921
2971
  }), m = t(g);
2922
2972
  } else
2923
2973
  m = t();
@@ -2931,23 +2981,23 @@ function et(e, t) {
2931
2981
  }
2932
2982
  }
2933
2983
  };
2934
- Te.set(n, s), typeof window < "u" && (customElements.get(n) || customElements.define(n, Qt(n, s)));
2984
+ Te.set(r, s), typeof window < "u" && (customElements.get(r) || customElements.define(r, Qt(r, s)));
2935
2985
  }
2936
- class en {
2986
+ class er {
2937
2987
  map = /* @__PURE__ */ new Map();
2938
2988
  maxSize;
2939
2989
  constructor(t) {
2940
2990
  this.maxSize = t;
2941
2991
  }
2942
2992
  get(t) {
2943
- const n = this.map.get(t);
2944
- if (n !== void 0)
2945
- return this.map.delete(t), this.map.set(t, n), n;
2993
+ const r = this.map.get(t);
2994
+ if (r !== void 0)
2995
+ return this.map.delete(t), this.map.set(t, r), r;
2946
2996
  }
2947
- set(t, n) {
2948
- if (this.map.has(t) && this.map.delete(t), this.map.set(t, n), this.map.size > this.maxSize) {
2949
- const r = this.map.keys().next().value;
2950
- r !== void 0 && this.map.delete(r);
2997
+ set(t, r) {
2998
+ if (this.map.has(t) && this.map.delete(t), this.map.set(t, r), this.map.size > this.maxSize) {
2999
+ const n = this.map.keys().next().value;
3000
+ n !== void 0 && this.map.delete(n);
2951
3001
  }
2952
3002
  }
2953
3003
  has(t) {
@@ -2957,8 +3007,8 @@ class en {
2957
3007
  this.map.clear();
2958
3008
  }
2959
3009
  }
2960
- const De = new en(500);
2961
- function tn(e, t) {
3010
+ const De = new er(500);
3011
+ function tr(e, t) {
2962
3012
  if (e == null) {
2963
3013
  console.warn(
2964
3014
  `⚠️ Event handler for '@${t}' is ${e}. This will prevent the event from working. Use a function reference instead: @${t}="\${functionName}"`
@@ -2971,9 +3021,9 @@ function tn(e, t) {
2971
3021
  `💡 Tip: If your event handler function returns undefined, make sure you're passing the function reference, not calling it. Use @${t}="\${fn}" not @${t}="\${fn()}"`
2972
3022
  );
2973
3023
  }
2974
- function pe(e, t = {}, n, r) {
2975
- const i = r ?? t.key;
2976
- return { tag: e, key: i, props: t, children: n };
3024
+ function pe(e, t = {}, r, n) {
3025
+ const i = n ?? t.key;
3026
+ return { tag: e, key: i, props: t, children: r };
2977
3027
  }
2978
3028
  function Ae(e) {
2979
3029
  return !!e && typeof e == "object" && (e.type === "AnchorBlock" || e.tag === "#anchor");
@@ -2981,11 +3031,11 @@ function Ae(e) {
2981
3031
  function _e(e) {
2982
3032
  return typeof e == "object" && e !== null && "tag" in e && !Ae(e);
2983
3033
  }
2984
- function nn(e, t) {
3034
+ function rr(e, t) {
2985
3035
  return e.key != null ? e : { ...e, key: t };
2986
3036
  }
2987
- function rn(e, t = [], n = {}) {
2988
- const r = {}, i = {}, s = {}, o = [], a = /([:@#]?)([a-zA-Z0-9-:\.]+)=("([^"\\]*(\\.[^"\\]*)*)"|'([^'\\]*(\\.[^'\\]*)*)')/g;
3037
+ function nr(e, t = [], r = {}) {
3038
+ const n = {}, i = {}, s = {}, o = [], a = /([:@#]?)([a-zA-Z0-9-:\.]+)=("([^"\\]*(\\.[^"\\]*)*)"|'([^'\\]*(\\.[^'\\]*)*)')/g;
2989
3039
  let u;
2990
3040
  for (; u = a.exec(e); ) {
2991
3041
  const m = u[1], g = u[2], b = (u[4] || u[6]) ?? "", h = b.match(/^{{(\d+)}}$/);
@@ -2993,7 +3043,7 @@ function rn(e, t = [], n = {}) {
2993
3043
  h || (l === "true" ? l = !0 : l === "false" ? l = !1 : l === "null" ? l = null : isNaN(Number(l)) || (l = Number(l)));
2994
3044
  const d = ["model", "bind", "show", "class", "style", "ref"];
2995
3045
  if (m === ":") {
2996
- const [v, w] = g.split(":"), [c, ...p] = v.split(".");
3046
+ const [x, w] = g.split(":"), [c, ...p] = x.split(".");
2997
3047
  if (d.includes(c)) {
2998
3048
  const y = [...p], C = c === "model" && w ? `model:${w}` : c;
2999
3049
  s[C] = {
@@ -3006,55 +3056,55 @@ function rn(e, t = [], n = {}) {
3006
3056
  y && ee(y) && (y = y.value), i[g] = y, o.push(g);
3007
3057
  }
3008
3058
  } else if (m === "@") {
3009
- const [v, ...w] = g.split("."), c = w;
3010
- tn(l, v);
3011
- const p = typeof l == "function" ? l : typeof n[l] == "function" ? n[l] : void 0;
3059
+ const [x, ...w] = g.split("."), c = w;
3060
+ tr(l, x);
3061
+ const p = typeof l == "function" ? l : typeof r[l] == "function" ? r[l] : void 0;
3012
3062
  if (p) {
3013
3063
  const y = (k) => {
3014
3064
  if (c.includes("prevent") && k.preventDefault(), c.includes("stop") && k.stopPropagation(), !(c.includes("self") && k.target !== k.currentTarget))
3015
- return c.includes("once") && k.currentTarget?.removeEventListener(v, y), p(k);
3016
- }, C = "on" + v.charAt(0).toUpperCase() + v.slice(1);
3017
- r[C] = y;
3065
+ return c.includes("once") && k.currentTarget?.removeEventListener(x, y), p(k);
3066
+ }, C = "on" + x.charAt(0).toUpperCase() + x.slice(1);
3067
+ n[C] = y;
3018
3068
  }
3019
- } else g === "ref" ? r.ref = l : i[g] = l;
3069
+ } else g === "ref" ? n.ref = l : i[g] = l;
3020
3070
  }
3021
- return { props: r, attrs: i, directives: s, bound: o };
3071
+ return { props: n, attrs: i, directives: s, bound: o };
3022
3072
  }
3023
- function sn(e, t, n) {
3024
- const r = ge.length > 0 ? ge[ge.length - 1] : void 0, i = n ?? r, s = !n && t.length === 0, o = s ? e.join("<!--TEMPLATE_DELIM-->") : null;
3073
+ function ir(e, t, r) {
3074
+ const n = ge.length > 0 ? ge[ge.length - 1] : void 0, i = r ?? n, s = !r && t.length === 0, o = s ? e.join("<!--TEMPLATE_DELIM-->") : null;
3025
3075
  if (s && o) {
3026
3076
  const f = De.get(o);
3027
3077
  if (f) return f;
3028
3078
  }
3029
- function a(f, x) {
3030
- return pe("#text", {}, f, x);
3079
+ function a(f, v) {
3080
+ return pe("#text", {}, f, v);
3031
3081
  }
3032
3082
  let u = "";
3033
3083
  for (let f = 0; f < e.length; f++)
3034
3084
  u += e[f], f < t.length && (u += `{{${f}}}`);
3035
3085
  const m = /<!--[\s\S]*?-->|<\/?([a-zA-Z0-9-]+)((?:\s+[^\s=>/]+(?:\s*=\s*(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|[^\s>]+))?)*)\s*\/?>|{{(\d+)}}|([^<]+)/g, g = [];
3036
- let b, h = [], l = null, d = {}, v, w = 0, c = [];
3086
+ let b, h = [], l = null, d = {}, x, w = 0, c = [];
3037
3087
  function p(f) {
3038
- !f || typeof f != "object" || Ae(f) || (f.props || f.attrs ? (f.props && (d.props || (d.props = {}), Object.assign(d.props, f.props)), f.attrs && (d.attrs || (d.attrs = {}), Object.keys(f.attrs).forEach((x) => {
3039
- if (x === "style" && d.attrs.style) {
3088
+ !f || typeof f != "object" || Ae(f) || (f.props || f.attrs ? (f.props && (d.props || (d.props = {}), Object.assign(d.props, f.props)), f.attrs && (d.attrs || (d.attrs = {}), Object.keys(f.attrs).forEach((v) => {
3089
+ if (v === "style" && d.attrs.style) {
3040
3090
  const A = d.attrs.style.replace(
3041
3091
  /;?\s*$/,
3042
3092
  ""
3043
3093
  ), _ = f.attrs.style.replace(/^;?\s*/, "");
3044
3094
  d.attrs.style = A + "; " + _;
3045
- } else if (x === "class" && d.attrs.class) {
3095
+ } else if (v === "class" && d.attrs.class) {
3046
3096
  const A = d.attrs.class.trim().split(/\s+/).filter(Boolean), _ = f.attrs.class.trim().split(/\s+/).filter(Boolean), $ = [
3047
3097
  .../* @__PURE__ */ new Set([...A, ..._])
3048
3098
  ];
3049
3099
  d.attrs.class = $.join(" ");
3050
3100
  } else
3051
- d.attrs[x] = f.attrs[x];
3101
+ d.attrs[v] = f.attrs[v];
3052
3102
  }))) : (d.props || (d.props = {}), Object.assign(d.props, f)));
3053
3103
  }
3054
- function y(f, x) {
3104
+ function y(f, v) {
3055
3105
  const A = l ? h : c;
3056
3106
  if (Ae(f)) {
3057
- const _ = f.key ?? x;
3107
+ const _ = f.key ?? v;
3058
3108
  let $ = f.children;
3059
3109
  A.push({
3060
3110
  ...f,
@@ -3064,14 +3114,14 @@ function sn(e, t, n) {
3064
3114
  return;
3065
3115
  }
3066
3116
  if (_e(f)) {
3067
- A.push(nn(f, void 0));
3117
+ A.push(rr(f, void 0));
3068
3118
  return;
3069
3119
  }
3070
3120
  if (Array.isArray(f)) {
3071
3121
  if (f.length === 0) return;
3072
3122
  for (let _ = 0; _ < f.length; _++) {
3073
3123
  const $ = f[_];
3074
- Ae($) || _e($) || Array.isArray($) ? y($, `${x}-${_}`) : $ !== null && typeof $ == "object" ? p($) : A.push(a(String($), `${x}-${_}`));
3124
+ Ae($) || _e($) || Array.isArray($) ? y($, `${v}-${_}`) : $ !== null && typeof $ == "object" ? p($) : A.push(a(String($), `${v}-${_}`));
3075
3125
  }
3076
3126
  return;
3077
3127
  }
@@ -3079,7 +3129,7 @@ function sn(e, t, n) {
3079
3129
  p(f);
3080
3130
  return;
3081
3131
  }
3082
- A.push(a(String(f), x));
3132
+ A.push(a(String(f), v));
3083
3133
  }
3084
3134
  const C = /* @__PURE__ */ new Set([
3085
3135
  "area",
@@ -3100,12 +3150,12 @@ function sn(e, t, n) {
3100
3150
  for (; b = m.exec(u); )
3101
3151
  if (!(b[0].startsWith("<!--") && b[0].endsWith("-->"))) {
3102
3152
  if (b[1]) {
3103
- const f = b[1], x = b[0][1] === "/", A = b[0][b[0].length - 2] === "/" || C.has(f), {
3153
+ const f = b[1], v = b[0][1] === "/", A = b[0][b[0].length - 2] === "/" || C.has(f), {
3104
3154
  props: _,
3105
3155
  attrs: $,
3106
3156
  directives: T,
3107
3157
  bound: R
3108
- } = rn(b[2] || "", t, i), S = { props: {}, attrs: {} };
3158
+ } = nr(b[2] || "", t, i), S = { props: {}, attrs: {} };
3109
3159
  for (const P in _) S.props[P] = _[P];
3110
3160
  for (const P in $) S.attrs[P] = $[P];
3111
3161
  if (S.attrs && Object.prototype.hasOwnProperty.call(S.attrs, "key") && !(S.props && Object.prototype.hasOwnProperty.call(S.props, "key")))
@@ -3152,14 +3202,14 @@ function sn(e, t, n) {
3152
3202
  let O;
3153
3203
  typeof z == "string" && i ? O = U(W, z) : (O = z, O && ee(O) && (O = O.value)), S.props[E] = O;
3154
3204
  try {
3155
- const re = ne(E);
3156
- S.attrs || (S.attrs = {}), O !== void 0 && (S.attrs[re] = O);
3205
+ const ne = re(E);
3206
+ S.attrs || (S.attrs = {}), O !== void 0 && (S.attrs[ne] = O);
3157
3207
  } catch {
3158
3208
  }
3159
3209
  S.isCustomElement = !0;
3160
- const qe = `update:${ne(E)}`.replace(/-([a-z])/g, (re, Y) => Y.toUpperCase()), ut = "on" + qe.charAt(0).toUpperCase() + qe.slice(1);
3161
- S.props[ut] = function(re) {
3162
- const Y = re.detail !== void 0 ? re.detail : re.target ? re.target.value : void 0;
3210
+ const qe = `update:${re(E)}`.replace(/-([a-z])/g, (ne, Y) => Y.toUpperCase()), ut = "on" + qe.charAt(0).toUpperCase() + qe.slice(1);
3211
+ S.props[ut] = function(ne) {
3212
+ const Y = ne.detail !== void 0 ? ne.detail : ne.target ? ne.target.value : void 0;
3163
3213
  if (W)
3164
3214
  if (z && ee(z)) {
3165
3215
  const ae = z.value;
@@ -3172,25 +3222,25 @@ function sn(e, t, n) {
3172
3222
  }
3173
3223
  } catch {
3174
3224
  }
3175
- if (Object.keys(T).length > 0 && (S.directives = { ...T }), x) {
3225
+ if (Object.keys(T).length > 0 && (S.directives = { ...T }), v) {
3176
3226
  const P = pe(
3177
3227
  l,
3178
3228
  d,
3179
3229
  h.length === 1 && _e(h[0]) && h[0].tag === "#text" ? typeof h[0].children == "string" ? h[0].children : "" : h.length ? h : void 0,
3180
- v
3230
+ x
3181
3231
  ), B = g.pop();
3182
- B ? (l = B.tag, d = B.props, v = B.key, h = B.children, h.push(P)) : (c.push(P), l = null, d = {}, v = void 0, h = []);
3232
+ B ? (l = B.tag, d = B.props, x = B.key, h = B.children, h.push(P)) : (c.push(P), l = null, d = {}, x = void 0, h = []);
3183
3233
  } else A ? l ? h.push(pe(f, S, void 0, void 0)) : c.push(pe(f, S, void 0, void 0)) : (l && g.push({
3184
3234
  tag: l,
3185
3235
  props: d,
3186
3236
  children: h,
3187
- key: v
3237
+ key: x
3188
3238
  }), l = f, d = S, h = []);
3189
3239
  } else if (typeof b[3] < "u") {
3190
- const f = Number(b[3]), x = t[f], A = `interp-${f}`;
3191
- y(x, A);
3240
+ const f = Number(b[3]), v = t[f], A = `interp-${f}`;
3241
+ y(v, A);
3192
3242
  } else if (b[4]) {
3193
- const f = b[4], x = l ? h : c, A = f.split(/({{\d+}})/);
3243
+ const f = b[4], v = l ? h : c, A = f.split(/({{\d+}})/);
3194
3244
  for (const _ of A) {
3195
3245
  if (!_) continue;
3196
3246
  const $ = _.match(/^{{(\d+)}}$/);
@@ -3199,7 +3249,7 @@ function sn(e, t, n) {
3199
3249
  y(R, S);
3200
3250
  } else {
3201
3251
  const T = `text-${w++}`;
3202
- x.push(a(_, T));
3252
+ v.push(a(_, T));
3203
3253
  }
3204
3254
  }
3205
3255
  }
@@ -3215,94 +3265,94 @@ function sn(e, t, n) {
3215
3265
  return pe("div", {}, "", "fallback-root");
3216
3266
  }
3217
3267
  function ce(e, ...t) {
3218
- const n = t[t.length - 1], r = typeof n == "object" && n && !Array.isArray(n) ? n : void 0;
3219
- return sn(e, t, r);
3268
+ const r = t[t.length - 1], n = typeof r == "object" && r && !Array.isArray(r) ? r : void 0;
3269
+ return ir(e, t, n);
3220
3270
  }
3221
3271
  function Re(e, t) {
3222
3272
  return j(e ? t : [], "when-block");
3223
3273
  }
3224
- function vn(e, t) {
3225
- return e.map((n, r) => {
3226
- const i = typeof n == "object" ? n?.key ?? n?.id ?? `idx-${r}` : String(n);
3227
- return j(t(n, r), `each-${i}`);
3274
+ function wr(e, t) {
3275
+ return e.map((r, n) => {
3276
+ const i = typeof r == "object" ? r?.key ?? r?.id ?? `idx-${n}` : String(r);
3277
+ return j(t(r, n), `each-${i}`);
3228
3278
  });
3229
3279
  }
3230
- function on() {
3280
+ function sr() {
3231
3281
  const e = [];
3232
3282
  return {
3233
- when(t, n) {
3234
- return e.push([t, n]), this;
3283
+ when(t, r) {
3284
+ return e.push([t, r]), this;
3235
3285
  },
3236
3286
  otherwise(t) {
3237
3287
  return e.push([!0, t]), this;
3238
3288
  },
3239
3289
  done() {
3240
- return an(...e);
3290
+ return or(...e);
3241
3291
  }
3242
3292
  };
3243
3293
  }
3244
- function an(...e) {
3294
+ function or(...e) {
3245
3295
  for (let t = 0; t < e.length; t++) {
3246
- const [n, r] = e[t];
3247
- if (n) return [j(r, `whenChain-branch-${t}`)];
3296
+ const [r, n] = e[t];
3297
+ if (r) return [j(n, `whenChain-branch-${t}`)];
3248
3298
  }
3249
3299
  return [j([], "whenChain-empty")];
3250
3300
  }
3251
3301
  function j(e, t) {
3252
- const n = e ? Array.isArray(e) ? e.filter(Boolean) : [e].filter(Boolean) : [];
3302
+ const r = e ? Array.isArray(e) ? e.filter(Boolean) : [e].filter(Boolean) : [];
3253
3303
  return {
3254
3304
  tag: "#anchor",
3255
3305
  key: t,
3256
- children: n
3306
+ children: r
3257
3307
  };
3258
3308
  }
3259
- function xn(e, t) {
3309
+ function xr(e, t) {
3260
3310
  return Re(!e, t);
3261
3311
  }
3262
- function kn(e, t) {
3263
- const n = !e || e.length === 0;
3264
- return Re(n, t);
3312
+ function vr(e, t) {
3313
+ const r = !e || e.length === 0;
3314
+ return Re(r, t);
3265
3315
  }
3266
- function Cn(e, t) {
3267
- const n = !!(e && e.length > 0);
3268
- return Re(n, t);
3316
+ function kr(e, t) {
3317
+ const r = !!(e && e.length > 0);
3318
+ return Re(r, t);
3269
3319
  }
3270
- function _n(e, t, n) {
3271
- const r = [];
3320
+ function Cr(e, t, r) {
3321
+ const n = [];
3272
3322
  return e.forEach((i, s) => {
3273
- t(i, s) && r.push({ item: i, originalIndex: s });
3274
- }), r.map(({ item: i, originalIndex: s }, o) => {
3323
+ t(i, s) && n.push({ item: i, originalIndex: s });
3324
+ }), n.map(({ item: i, originalIndex: s }, o) => {
3275
3325
  const a = typeof i == "object" && i != null ? i?.key ?? i?.id ?? `filtered-${s}` : `filtered-${s}`;
3276
- return j(n(i, s, o), `each-where-${a}`);
3326
+ return j(r(i, s, o), `each-where-${a}`);
3277
3327
  });
3278
3328
  }
3279
- function En(e, t) {
3280
- const n = e?.length ?? 0;
3281
- return n === 0 && t.empty ? j(t.empty, "switch-length-empty") : n === 1 && t.one ? j(t.one(e[0]), "switch-length-one") : t.exactly?.[n] ? j(t.exactly[n](e), `switch-length-${n}`) : n > 1 && t.many ? j(t.many(e), "switch-length-many") : j([], "switch-length-fallback");
3329
+ function _r(e, t) {
3330
+ const r = e?.length ?? 0;
3331
+ return r === 0 && t.empty ? j(t.empty, "switch-length-empty") : r === 1 && t.one ? j(t.one(e[0]), "switch-length-one") : t.exactly?.[r] ? j(t.exactly[r](e), `switch-length-${r}`) : r > 1 && t.many ? j(t.many(e), "switch-length-many") : j([], "switch-length-fallback");
3282
3332
  }
3283
- function $n(e, t, n) {
3284
- const r = /* @__PURE__ */ new Map();
3333
+ function Er(e, t, r) {
3334
+ const n = /* @__PURE__ */ new Map();
3285
3335
  return e.forEach((i) => {
3286
3336
  const s = t(i);
3287
- r.has(s) || r.set(s, []), r.get(s).push(i);
3288
- }), Array.from(r.entries()).map(([i, s], o) => j(
3289
- n(i, s, o),
3337
+ n.has(s) || n.set(s, []), n.get(s).push(i);
3338
+ }), Array.from(n.entries()).map(([i, s], o) => j(
3339
+ r(i, s, o),
3290
3340
  `each-group-${i}`
3291
3341
  ));
3292
3342
  }
3293
- function Sn(e, t, n, r) {
3294
- const i = n * t, s = Math.min(i + t, e.length);
3343
+ function $r(e, t, r, n) {
3344
+ const i = r * t, s = Math.min(i + t, e.length);
3295
3345
  return e.slice(i, s).map((a, u) => {
3296
3346
  const m = i + u, g = typeof a == "object" && a != null ? a?.key ?? a?.id ?? `page-${m}` : `page-${m}`;
3297
- return j(r(a, m, u), `each-page-${g}`);
3347
+ return j(n(a, m, u), `each-page-${g}`);
3298
3348
  });
3299
3349
  }
3300
- function An(e, t) {
3350
+ function Sr(e, t) {
3301
3351
  return e.loading && t.loading ? j(t.loading, "promise-loading") : e.error && t.error ? j(t.error(e.error), "promise-error") : e.data !== void 0 && t.success ? j(t.success(e.data), "promise-success") : t.idle ? j(t.idle, "promise-idle") : j([], "promise-fallback");
3302
3352
  }
3303
3353
  function q(e, t) {
3304
- const n = typeof window < "u" && window.matchMedia?.(e)?.matches;
3305
- return Re(!!n, t);
3354
+ const r = typeof window < "u" && window.matchMedia?.(e)?.matches;
3355
+ return Re(!!r, t);
3306
3356
  }
3307
3357
  const te = {
3308
3358
  // Responsive breakpoints (matching style.ts)
@@ -3313,7 +3363,7 @@ const te = {
3313
3363
  "2xl": "(min-width:1536px)",
3314
3364
  // Dark mode (matching style.ts)
3315
3365
  dark: "(prefers-color-scheme: dark)"
3316
- }, lt = ["sm", "md", "lg", "xl", "2xl"], cn = {
3366
+ }, lt = ["sm", "md", "lg", "xl", "2xl"], ar = {
3317
3367
  // Breakpoint-based rendering (matching style.ts exactly)
3318
3368
  sm: (e) => q(te.sm, e),
3319
3369
  md: (e) => q(te.md, e),
@@ -3332,44 +3382,44 @@ const te = {
3332
3382
  portrait: (e) => q("(orientation: portrait)", e),
3333
3383
  landscape: (e) => q("(orientation: landscape)", e)
3334
3384
  };
3335
- function Tn(e, t) {
3336
- const n = [];
3337
- e.includes("dark") ? n.push(te.dark) : e.includes("light") && n.push("(prefers-color-scheme: light)");
3338
- const r = e.filter(
3385
+ function Ar(e, t) {
3386
+ const r = [];
3387
+ e.includes("dark") ? r.push(te.dark) : e.includes("light") && r.push("(prefers-color-scheme: light)");
3388
+ const n = e.filter(
3339
3389
  (o) => lt.includes(o)
3340
- ), i = r[r.length - 1];
3341
- i && i in te && n.push(te[i]);
3342
- const s = n.length > 0 ? n.join(" and ") : "all";
3390
+ ), i = n[n.length - 1];
3391
+ i && i in te && r.push(te[i]);
3392
+ const s = r.length > 0 ? r.join(" and ") : "all";
3343
3393
  return q(s, t);
3344
3394
  }
3345
- function Rn(e) {
3395
+ function Tr(e) {
3346
3396
  const t = [];
3347
- return e.base && t.push(j(e.base, "responsive-base")), lt.forEach((n) => {
3348
- const r = e[n];
3349
- r && t.push(cn[n](r));
3397
+ return e.base && t.push(j(e.base, "responsive-base")), lt.forEach((r) => {
3398
+ const n = e[r];
3399
+ n && t.push(ar[r](n));
3350
3400
  }), t;
3351
3401
  }
3352
- function On(e) {
3402
+ function Rr(e) {
3353
3403
  const t = [];
3354
- let n = null;
3404
+ let r = null;
3355
3405
  return {
3356
- case(r, i) {
3357
- const s = typeof r == "function" ? r : (o) => o === r;
3406
+ case(n, i) {
3407
+ const s = typeof n == "function" ? n : (o) => o === n;
3358
3408
  return t.push({ condition: s, content: i }), this;
3359
3409
  },
3360
- when(r, i) {
3361
- return t.push({ condition: r, content: i }), this;
3410
+ when(n, i) {
3411
+ return t.push({ condition: n, content: i }), this;
3362
3412
  },
3363
- otherwise(r) {
3364
- return n = r, this;
3413
+ otherwise(n) {
3414
+ return r = n, this;
3365
3415
  },
3366
3416
  done() {
3367
- for (let r = 0; r < t.length; r++) {
3368
- const { condition: i, content: s } = t[r];
3417
+ for (let n = 0; n < t.length; n++) {
3418
+ const { condition: i, content: s } = t[n];
3369
3419
  if (i(e))
3370
- return j(s, `switch-case-${r}`);
3420
+ return j(s, `switch-case-${n}`);
3371
3421
  }
3372
- return j(n || [], "switch-otherwise");
3422
+ return j(r || [], "switch-otherwise");
3373
3423
  }
3374
3424
  };
3375
3425
  }
@@ -3388,14 +3438,14 @@ class de extends EventTarget {
3388
3438
  * @param eventName - Name of the event
3389
3439
  * @param data - Optional event payload
3390
3440
  */
3391
- emit(t, n) {
3392
- const r = Date.now(), i = this.eventCounters.get(t);
3393
- if (!i || r - i.window > 1e3)
3394
- this.eventCounters.set(t, { count: 1, window: r });
3441
+ emit(t, r) {
3442
+ const n = Date.now(), i = this.eventCounters.get(t);
3443
+ if (!i || n - i.window > 1e3)
3444
+ this.eventCounters.set(t, { count: 1, window: n });
3395
3445
  else if (i.count++, i.count > 50 && i.count > 100)
3396
3446
  return;
3397
3447
  this.dispatchEvent(new CustomEvent(t, {
3398
- detail: n,
3448
+ detail: r,
3399
3449
  bubbles: !1,
3400
3450
  // Global events don't need to bubble
3401
3451
  cancelable: !0
@@ -3403,7 +3453,7 @@ class de extends EventTarget {
3403
3453
  const s = this.handlers[t];
3404
3454
  s && s.forEach((o) => {
3405
3455
  try {
3406
- o(n);
3456
+ o(r);
3407
3457
  } catch (a) {
3408
3458
  se(`Error in global event handler for "${t}":`, a);
3409
3459
  }
@@ -3414,17 +3464,17 @@ class de extends EventTarget {
3414
3464
  * @param eventName - Name of the event
3415
3465
  * @param handler - Handler function
3416
3466
  */
3417
- on(t, n) {
3418
- return this.handlers[t] || (this.handlers[t] = /* @__PURE__ */ new Set()), this.handlers[t].add(n), () => this.off(t, n);
3467
+ on(t, r) {
3468
+ return this.handlers[t] || (this.handlers[t] = /* @__PURE__ */ new Set()), this.handlers[t].add(r), () => this.off(t, r);
3419
3469
  }
3420
3470
  /**
3421
3471
  * Remove a specific handler for a global event.
3422
3472
  * @param eventName - Name of the event
3423
3473
  * @param handler - Handler function to remove
3424
3474
  */
3425
- off(t, n) {
3426
- const r = this.handlers[t];
3427
- r && r.delete(n);
3475
+ off(t, r) {
3476
+ const n = this.handlers[t];
3477
+ n && n.delete(r);
3428
3478
  }
3429
3479
  /**
3430
3480
  * Remove all handlers for a specific event.
@@ -3439,18 +3489,18 @@ class de extends EventTarget {
3439
3489
  * @param handler - CustomEvent handler
3440
3490
  * @param options - AddEventListener options
3441
3491
  */
3442
- listen(t, n, r) {
3443
- return this.addEventListener(t, n, r), () => this.removeEventListener(t, n);
3492
+ listen(t, r, n) {
3493
+ return this.addEventListener(t, r, n), () => this.removeEventListener(t, r);
3444
3494
  }
3445
3495
  /**
3446
3496
  * Register a one-time event handler. Returns a promise that resolves with the event data.
3447
3497
  * @param eventName - Name of the event
3448
3498
  * @param handler - Handler function
3449
3499
  */
3450
- once(t, n) {
3451
- return new Promise((r) => {
3500
+ once(t, r) {
3501
+ return new Promise((n) => {
3452
3502
  const i = this.on(t, (s) => {
3453
- i(), n(s), r(s);
3503
+ i(), r(s), n(s);
3454
3504
  });
3455
3505
  });
3456
3506
  }
@@ -3480,10 +3530,10 @@ class de extends EventTarget {
3480
3530
  */
3481
3531
  getEventStats() {
3482
3532
  const t = {};
3483
- for (const [n, r] of this.eventCounters.entries())
3484
- t[n] = {
3485
- count: r.count,
3486
- handlersCount: this.getHandlerCount(n)
3533
+ for (const [r, n] of this.eventCounters.entries())
3534
+ t[r] = {
3535
+ count: n.count,
3536
+ handlersCount: this.getHandlerCount(r)
3487
3537
  };
3488
3538
  return t;
3489
3539
  }
@@ -3494,12 +3544,12 @@ class de extends EventTarget {
3494
3544
  this.eventCounters.clear();
3495
3545
  }
3496
3546
  }
3497
- const be = de.getInstance(), Pn = (e, t) => be.emit(e, t), Ln = (e, t) => be.on(e, t), Mn = (e, t) => be.off(e, t), jn = (e, t) => be.once(e, t), Nn = (e, t, n) => be.listen(e, t, n);
3547
+ const be = de.getInstance(), Or = (e, t) => be.emit(e, t), Pr = (e, t) => be.on(e, t), Lr = (e, t) => be.off(e, t), Mr = (e, t) => be.once(e, t), jr = (e, t, r) => be.listen(e, t, r);
3498
3548
  function tt(e) {
3499
3549
  let t = { ...e };
3500
- const n = [];
3501
- function r(a) {
3502
- n.push(a), a(t);
3550
+ const r = [];
3551
+ function n(a) {
3552
+ r.push(a), a(t);
3503
3553
  }
3504
3554
  function i() {
3505
3555
  return t;
@@ -3509,23 +3559,23 @@ function tt(e) {
3509
3559
  t = { ...t, ...u }, o();
3510
3560
  }
3511
3561
  function o() {
3512
- n.forEach((a) => a(t));
3562
+ r.forEach((a) => a(t));
3513
3563
  }
3514
- return { subscribe: r, getState: i, setState: s };
3564
+ return { subscribe: n, getState: i, setState: s };
3515
3565
  }
3516
- const nt = (e) => e ? typeof URLSearchParams > "u" ? {} : Object.fromEntries(new URLSearchParams(e)) : {}, Q = (e, t) => {
3517
- for (const n of e) {
3518
- const r = [], i = n.path.replace(/:[^/]+/g, (a) => (r.push(a.slice(1)), "([^/]+)")), s = new RegExp(`^${i}$`), o = t.match(s);
3566
+ const rt = (e) => e ? typeof URLSearchParams > "u" ? {} : Object.fromEntries(new URLSearchParams(e)) : {}, Q = (e, t) => {
3567
+ for (const r of e) {
3568
+ const n = [], i = r.path.replace(/:[^/]+/g, (a) => (n.push(a.slice(1)), "([^/]+)")), s = new RegExp(`^${i}$`), o = t.match(s);
3519
3569
  if (o) {
3520
3570
  const a = {};
3521
- return r.forEach((u, m) => {
3571
+ return n.forEach((u, m) => {
3522
3572
  a[u] = o[m + 1];
3523
- }), { route: n, params: a };
3573
+ }), { route: r, params: a };
3524
3574
  }
3525
3575
  }
3526
3576
  return { route: null, params: {} };
3527
3577
  }, Ie = {};
3528
- async function ln(e) {
3578
+ async function cr(e) {
3529
3579
  if (e.component) return e.component;
3530
3580
  if (e.load) {
3531
3581
  if (Ie[e.path]) return Ie[e.path];
@@ -3538,41 +3588,41 @@ async function ln(e) {
3538
3588
  }
3539
3589
  throw new Error(`No component or loader defined for route: ${e.path}`);
3540
3590
  }
3541
- function un(e) {
3542
- const { routes: t, base: n = "", initialUrl: r } = e;
3591
+ function lr(e) {
3592
+ const { routes: t, base: r = "", initialUrl: n } = e;
3543
3593
  let i, s, o, a, u, m, g;
3544
- const b = async (v, w) => {
3545
- const c = t.find((p) => Q([p], v.path).route !== null);
3594
+ const b = async (x, w) => {
3595
+ const c = t.find((p) => Q([p], x.path).route !== null);
3546
3596
  if (c?.beforeEnter)
3547
3597
  try {
3548
- const p = await c.beforeEnter(v, w);
3598
+ const p = await c.beforeEnter(x, w);
3549
3599
  return typeof p == "string" ? (await d(p, !0), !1) : p !== !1;
3550
3600
  } catch (p) {
3551
3601
  return se("beforeEnter error", p), !1;
3552
3602
  }
3553
3603
  return !0;
3554
- }, h = async (v, w) => {
3555
- const c = t.find((p) => Q([p], v.path).route !== null);
3604
+ }, h = async (x, w) => {
3605
+ const c = t.find((p) => Q([p], x.path).route !== null);
3556
3606
  if (c?.onEnter)
3557
3607
  try {
3558
- const p = await c.onEnter(v, w);
3608
+ const p = await c.onEnter(x, w);
3559
3609
  return typeof p == "string" ? (await d(p, !0), !1) : p !== !1;
3560
3610
  } catch (p) {
3561
3611
  return se("onEnter error", p), !1;
3562
3612
  }
3563
3613
  return !0;
3564
- }, l = (v, w) => {
3565
- const c = t.find((p) => Q([p], v.path).route !== null);
3614
+ }, l = (x, w) => {
3615
+ const c = t.find((p) => Q([p], x.path).route !== null);
3566
3616
  if (c?.afterEnter)
3567
3617
  try {
3568
- c.afterEnter(v, w);
3618
+ c.afterEnter(x, w);
3569
3619
  } catch (p) {
3570
3620
  se("afterEnter error", p);
3571
3621
  }
3572
- }, d = async (v, w = !1) => {
3622
+ }, d = async (x, w = !1) => {
3573
3623
  try {
3574
3624
  const c = {
3575
- path: v.replace(n, "") || "/",
3625
+ path: x.replace(r, "") || "/",
3576
3626
  query: {}
3577
3627
  }, p = Q(t, c.path);
3578
3628
  if (!p) throw new Error(`No route found for ${c.path}`);
@@ -3582,20 +3632,20 @@ function un(e) {
3582
3632
  query: c.query
3583
3633
  };
3584
3634
  if (!await b(C, y) || !await h(C, y)) return;
3585
- typeof window < "u" && typeof document < "u" && (w ? window.history.replaceState({}, "", n + v) : window.history.pushState({}, "", n + v)), o.setState(C), l(C, y);
3635
+ typeof window < "u" && typeof document < "u" && (w ? window.history.replaceState({}, "", r + x) : window.history.pushState({}, "", r + x)), o.setState(C), l(C, y);
3586
3636
  } catch (c) {
3587
3637
  se("Navigation error:", c);
3588
3638
  }
3589
3639
  };
3590
- if (typeof window < "u" && typeof document < "u" && typeof r > "u") {
3640
+ if (typeof window < "u" && typeof document < "u" && typeof n > "u") {
3591
3641
  i = () => {
3592
- const w = new URL(window.location.href), c = w.pathname.replace(n, "") || "/", p = nt(w.search);
3642
+ const w = new URL(window.location.href), c = w.pathname.replace(r, "") || "/", p = rt(w.search);
3593
3643
  return { path: c, query: p };
3594
3644
  }, s = i();
3595
- const v = Q(t, s.path);
3645
+ const x = Q(t, s.path);
3596
3646
  o = tt({
3597
3647
  path: s.path,
3598
- params: v.params,
3648
+ params: x.params,
3599
3649
  query: s.query
3600
3650
  }), a = async (w = !1) => {
3601
3651
  const c = i();
@@ -3603,13 +3653,13 @@ function un(e) {
3603
3653
  }, window.addEventListener("popstate", () => a(!0)), u = (w) => d(w, !1), m = (w) => d(w, !0), g = () => window.history.back();
3604
3654
  } else {
3605
3655
  i = () => {
3606
- const c = new URL(r || "/", "http://localhost"), p = c.pathname.replace(n, "") || "/", y = nt(c.search);
3656
+ const c = new URL(n || "/", "http://localhost"), p = c.pathname.replace(r, "") || "/", y = rt(c.search);
3607
3657
  return { path: p, query: y };
3608
3658
  }, s = i();
3609
- const v = Q(t, s.path);
3659
+ const x = Q(t, s.path);
3610
3660
  o = tt({
3611
3661
  path: s.path,
3612
- params: v.params,
3662
+ params: x.params,
3613
3663
  query: s.query
3614
3664
  }), a = async () => {
3615
3665
  const c = i();
@@ -3618,7 +3668,7 @@ function un(e) {
3618
3668
  const w = async (c) => {
3619
3669
  try {
3620
3670
  const p = {
3621
- path: c.replace(n, "") || "/",
3671
+ path: c.replace(r, "") || "/",
3622
3672
  query: {}
3623
3673
  }, y = Q(t, p.path);
3624
3674
  if (!y) throw new Error(`No route found for ${p.path}`);
@@ -3626,26 +3676,26 @@ function un(e) {
3626
3676
  path: p.path,
3627
3677
  params: y.params,
3628
3678
  query: p.query
3629
- }, f = t.find((x) => Q([x], k.path).route !== null);
3679
+ }, f = t.find((v) => Q([v], k.path).route !== null);
3630
3680
  if (f?.beforeEnter)
3631
3681
  try {
3632
- const x = await f.beforeEnter(k, C);
3633
- if (typeof x == "string") {
3634
- await w(x);
3682
+ const v = await f.beforeEnter(k, C);
3683
+ if (typeof v == "string") {
3684
+ await w(v);
3635
3685
  return;
3636
3686
  }
3637
- if (x === !1) return;
3687
+ if (v === !1) return;
3638
3688
  } catch {
3639
3689
  return;
3640
3690
  }
3641
3691
  if (f?.onEnter)
3642
3692
  try {
3643
- const x = await f.onEnter(k, C);
3644
- if (typeof x == "string") {
3645
- await w(x);
3693
+ const v = await f.onEnter(k, C);
3694
+ if (typeof v == "string") {
3695
+ await w(v);
3646
3696
  return;
3647
3697
  }
3648
- if (x === !1) return;
3698
+ if (v === !1) return;
3649
3699
  } catch {
3650
3700
  return;
3651
3701
  }
@@ -3666,18 +3716,18 @@ function un(e) {
3666
3716
  replace: m,
3667
3717
  back: g,
3668
3718
  subscribe: o.subscribe,
3669
- matchRoute: (v) => Q(t, v),
3719
+ matchRoute: (x) => Q(t, x),
3670
3720
  getCurrent: () => o.getState(),
3671
- resolveRouteComponent: ln
3721
+ resolveRouteComponent: cr
3672
3722
  };
3673
3723
  }
3674
- function Wn(e, t) {
3724
+ function Nr(e, t) {
3675
3725
  return Q(e, t);
3676
3726
  }
3677
- function zn(e) {
3678
- const t = un(e);
3679
- return et("router-view", (n = {}, r = {}) => {
3680
- const { onConnected: i } = r;
3727
+ function Wr(e) {
3728
+ const t = lr(e);
3729
+ return et("router-view", (r = {}, n = {}) => {
3730
+ const { onConnected: i } = n;
3681
3731
  if (i && i(() => {
3682
3732
  t && typeof t.subscribe == "function" && t.subscribe(() => {
3683
3733
  });
@@ -3692,7 +3742,7 @@ function zn(e) {
3692
3742
  }
3693
3743
  return ce`<div>Invalid route component</div>`;
3694
3744
  }).catch(() => ce`<div>Invalid route component</div>`) : ce`<div>Not found</div>`;
3695
- }), et("router-link", (n = {}, r = {}) => {
3745
+ }), et("router-link", (r = {}, n = {}) => {
3696
3746
  const {
3697
3747
  to: i = "",
3698
3748
  tag: s = "a",
@@ -3704,14 +3754,14 @@ function zn(e) {
3704
3754
  disabled: b = !1,
3705
3755
  external: h = !1,
3706
3756
  class: l = ""
3707
- } = n, d = t.getCurrent(), v = d.path === i, w = a ? v : d && typeof d.path == "string" ? d.path.startsWith(i) : !1, c = v ? `aria-current="${g}"` : "", p = (l || "").split(/\s+/).filter(Boolean), y = {};
3757
+ } = r, d = t.getCurrent(), x = d.path === i, w = a ? x : d && typeof d.path == "string" ? d.path.startsWith(i) : !1, c = x ? `aria-current="${g}"` : "", p = (l || "").split(/\s+/).filter(Boolean), y = {};
3708
3758
  for (const _ of p) y[_] = !0;
3709
3759
  const C = {
3710
3760
  ...y,
3711
3761
  // Also include the configurable names (may duplicate the above)
3712
3762
  [u]: w,
3713
- [m]: v
3714
- }, k = s === "button", f = b ? k ? 'disabled aria-disabled="true" tabindex="-1"' : 'aria-disabled="true" tabindex="-1"' : "", x = h && (s === "a" || !s) ? 'target="_blank" rel="noopener noreferrer"' : "", A = (_) => {
3763
+ [m]: x
3764
+ }, k = s === "button", f = b ? k ? 'disabled aria-disabled="true" tabindex="-1"' : 'aria-disabled="true" tabindex="-1"' : "", v = h && (s === "a" || !s) ? 'target="_blank" rel="noopener noreferrer"' : "", A = (_) => {
3715
3765
  if (b) {
3716
3766
  _.preventDefault();
3717
3767
  return;
@@ -3719,13 +3769,13 @@ function zn(e) {
3719
3769
  h && (s === "a" || !s) || (_.preventDefault(), o ? t.replace(i) : t.push(i));
3720
3770
  };
3721
3771
  return ce`
3722
- ${on().when(k, ce`
3772
+ ${sr().when(k, ce`
3723
3773
  <button
3724
3774
  part="button"
3725
3775
  :class="${C}"
3726
3776
  ${c}
3727
3777
  ${f}
3728
- ${x}
3778
+ ${v}
3729
3779
  @click="${A}"
3730
3780
  ><slot></slot></button>
3731
3781
  `).otherwise(ce`
@@ -3735,7 +3785,7 @@ function zn(e) {
3735
3785
  :class="${C}"
3736
3786
  ${c}
3737
3787
  ${f}
3738
- ${x}
3788
+ ${v}
3739
3789
  @click="${A}"
3740
3790
  ><slot></slot></a>
3741
3791
  `).done()}
@@ -3746,48 +3796,48 @@ export {
3746
3796
  de as GlobalEventBus,
3747
3797
  j as anchorBlock,
3748
3798
  et as component,
3749
- dn as computed,
3799
+ fr as computed,
3750
3800
  tt as createStore,
3751
3801
  Pt as css,
3752
- vn as each,
3753
- $n as eachGroup,
3754
- Sn as eachPage,
3755
- _n as eachWhere,
3756
- Pn as emit,
3802
+ wr as each,
3803
+ Er as eachGroup,
3804
+ $r as eachPage,
3805
+ Cr as eachWhere,
3806
+ Or as emit,
3757
3807
  be as eventBus,
3758
3808
  ce as html,
3759
- zn as initRouter,
3760
- Nn as listen,
3761
- on as match,
3809
+ Wr as initRouter,
3810
+ jr as listen,
3811
+ sr as match,
3762
3812
  Q as matchRoute,
3763
- Wn as matchRouteSSR,
3813
+ Nr as matchRouteSSR,
3764
3814
  te as mediaVariants,
3765
- Mn as off,
3766
- Ln as on,
3767
- jn as once,
3768
- nt as parseQuery,
3769
- fn as ref,
3815
+ Lr as off,
3816
+ Pr as on,
3817
+ Mr as once,
3818
+ rt as parseQuery,
3819
+ ur as ref,
3770
3820
  Pe as renderToString,
3771
- ln as resolveRouteComponent,
3772
- cn as responsive,
3821
+ cr as resolveRouteComponent,
3822
+ ar as responsive,
3773
3823
  lt as responsiveOrder,
3774
- Rn as responsiveSwitch,
3775
- On as switchOn,
3776
- En as switchOnLength,
3777
- An as switchOnPromise,
3778
- xn as unless,
3779
- hn as useEmit,
3780
- yn as useOnAttributeChanged,
3781
- gn as useOnConnected,
3782
- mn as useOnDisconnected,
3783
- bn as useOnError,
3784
- un as useRouter,
3785
- wn as useStyle,
3786
- pn as watch,
3824
+ Tr as responsiveSwitch,
3825
+ Rr as switchOn,
3826
+ _r as switchOnLength,
3827
+ Sr as switchOnPromise,
3828
+ xr as unless,
3829
+ pr as useEmit,
3830
+ mr as useOnAttributeChanged,
3831
+ hr as useOnConnected,
3832
+ gr as useOnDisconnected,
3833
+ yr as useOnError,
3834
+ lr as useRouter,
3835
+ br as useStyle,
3836
+ dr as watch,
3787
3837
  Re as when,
3788
- kn as whenEmpty,
3838
+ vr as whenEmpty,
3789
3839
  q as whenMedia,
3790
- Cn as whenNotEmpty,
3791
- Tn as whenVariants
3840
+ kr as whenNotEmpty,
3841
+ Ar as whenVariants
3792
3842
  };
3793
3843
  //# sourceMappingURL=custom-elements-runtime.es.js.map