@reactive-web-components/rwc 2.51.6 → 2.51.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,15 +1,15 @@
1
1
  {
2
2
  "name": "@reactive-web-components/rwc",
3
- "version": "2.51.6",
3
+ "version": "2.51.8",
4
4
  "type": "module",
5
5
  "types": "./shared/index.d.ts",
6
6
  "exports": {
7
7
  ".": {
8
8
  "types": "./shared/index.d.ts",
9
- "import": "./reactive-web-component.LbpjNXBd.js",
10
- "require": "./reactive-web-component.BKXQTlov.umd.cjs"
9
+ "import": "./reactive-web-component.C6ivwJzW.js",
10
+ "require": "./reactive-web-component.D9B4LRRS.umd.cjs"
11
11
  }
12
12
  },
13
- "module": "./reactive-web-component.LbpjNXBd.js",
14
- "main": "./reactive-web-component.BKXQTlov.umd.cjs"
13
+ "module": "./reactive-web-component.C6ivwJzW.js",
14
+ "main": "./reactive-web-component.D9B4LRRS.umd.cjs"
15
15
  }
@@ -1,18 +1,18 @@
1
1
  var X = Object.defineProperty;
2
2
  var Z = (t, e, s) => e in t ? X(t, e, { enumerable: !0, configurable: !0, writable: !0, value: s }) : t[e] = s;
3
3
  var E = (t, e, s) => Z(t, typeof e != "symbol" ? e + "" : e, s);
4
- const w = (t) => t && typeof t == "object" && ("classList" in t || "attributes" in t || "customAttributes" in t || "reactiveClassList" in t || "listeners" in t || "customListeners" in t || "children" in t || "effects" in t || "style" in t || Object.keys(t).some(
4
+ const $ = (t) => t && typeof t == "object" && ("classList" in t || "attributes" in t || "customAttributes" in t || "reactiveClassList" in t || "listeners" in t || "customListeners" in t || "children" in t || "effects" in t || "style" in t || Object.keys(t).some(
5
5
  (e) => e.startsWith(".") || e.startsWith("@") || e.startsWith("$")
6
- )) && !("hostElement" in t), Q = (t) => t && typeof t == "object" && "hostElement" in t && "append" in t && "set" in t && "addStyle" in t && "setAttribute" in t && "addClass" in t && "addEffect" in t && "addReactiveContent" in t && "setReactiveContent" in t && "clear" in t, F = (t, e, ...s) => {
6
+ )) && !("hostElement" in t), Q = (t) => t && typeof t == "object" && "hostElement" in t && "append" in t && "set" in t && "addStyle" in t && "setAttribute" in t && "addClass" in t && "addEffect" in t && "addReactiveContent" in t && "setReactiveContent" in t && "clear" in t, W = (t, e, ...s) => {
7
7
  e && e.apply(t, s);
8
8
  };
9
9
  let P = !0;
10
- const C = (...t) => {
10
+ const b = (...t) => {
11
11
  P && console.log(
12
12
  t.join(" | "),
13
13
  ...Array.from(t.join("").matchAll(/%c/gm)).map((e, s) => s % 2 === 0 ? "color:red" : "color:inherit")
14
14
  );
15
- }, $ = (t) => t.replace(/([A-Z])/gm, (e) => `-${e.toLowerCase()}`), Y = (t) => t.replace(/-(\w)/gm, (e, s) => s.toUpperCase()), A = (t, ...e) => {
15
+ }, w = (t) => t.replace(/([A-Z])/gm, (e) => `-${e.toLowerCase()}`), Y = (t) => t.replace(/-(\w)/gm, (e, s) => s.toUpperCase()), A = (t, ...e) => {
16
16
  if (!P) return;
17
17
  const s = {
18
18
  r: "color: #ff0000",
@@ -31,15 +31,15 @@ const C = (...t) => {
31
31
  // orange
32
32
  w: "color: #808080"
33
33
  // gray (w for white/gray)
34
- }, n = t.match(/@[rgbpycow]/g) || [], o = n.map((r) => {
35
- const h = r.slice(1);
36
- return s[h] || "color: inherit";
34
+ }, n = t.match(/@[rgbpycow]/g) || [], o = n.map((i) => {
35
+ const a = i.slice(1);
36
+ return s[a] || "color: inherit";
37
37
  });
38
- let c = t;
39
- n.forEach((r) => {
40
- const h = new RegExp(`\\${r}([^\\s,]+)`, "g");
41
- c = c.replace(h, "%c$1");
42
- }), console.log(c, ...o, ...e);
38
+ let r = t;
39
+ n.forEach((i) => {
40
+ const a = new RegExp(`\\${i}([^\\s,]+)`, "g");
41
+ r = r.replace(a, "%c$1");
42
+ }), console.log(r, ...o, ...e);
43
43
  }, yt = () => {
44
44
  P = !0;
45
45
  }, K = () => {
@@ -47,51 +47,51 @@ const C = (...t) => {
47
47
  };
48
48
  K();
49
49
  const L = /* @__PURE__ */ new WeakMap(), M = [], g = [];
50
- function R(t, e = () => !0) {
50
+ function j(t, e = () => !0) {
51
51
  const s = /* @__PURE__ */ new Set();
52
52
  let n = e;
53
53
  function o() {
54
- const c = M[M.length - 1];
55
- if (c && !("fake" in c && c.fake)) {
56
- const r = L.get(c), h = r == null ? void 0 : r.parent;
57
- if (h) {
58
- const l = L.get(h);
59
- l == null || l.cleanupFns.add(() => {
60
- s.delete(c);
54
+ const r = M[M.length - 1];
55
+ if (r && !("fake" in r && r.fake)) {
56
+ const i = L.get(r), a = i == null ? void 0 : i.parent;
57
+ if (a) {
58
+ const u = L.get(a);
59
+ u == null || u.cleanupFns.add(() => {
60
+ s.delete(r);
61
61
  });
62
62
  }
63
- s.add(c);
63
+ s.add(r);
64
64
  }
65
65
  return t;
66
66
  }
67
- return o.getSubscribers = () => [...s], o.setCompareFn = function(c) {
68
- return n = c, o;
67
+ return o.getSubscribers = () => [...s], o.setCompareFn = function(r) {
68
+ return n = r, o;
69
69
  }, o.clearSubscribers = function() {
70
70
  s.clear();
71
71
  }, o.peek = function() {
72
72
  return Object.freeze(t);
73
- }, o.initValue = Object.freeze(t), o.oldValue = Object.freeze(t), o.forceSet = function(c) {
74
- o.oldValue = Object.freeze(t), t = c, s.forEach((r) => Promise.resolve(r).then((h) => {
75
- const l = L.get(h);
76
- l && l.cleanupFns.size > 0 && (l.cleanupFns.forEach((a) => a()), l.cleanupFns.clear()), g.push(h), h(), g.pop();
73
+ }, o.initValue = Object.freeze(t), o.oldValue = Object.freeze(t), o.forceSet = function(r) {
74
+ o.oldValue = Object.freeze(t), t = r, s.forEach((i) => Promise.resolve(i).then((a) => {
75
+ const u = L.get(a);
76
+ u && u.cleanupFns.size > 0 && (u.cleanupFns.forEach((l) => l()), u.cleanupFns.clear()), g.push(a), a(), g.pop();
77
77
  }));
78
- }, o.set = function(c, r = n) {
79
- t !== c && r(t, c) && o.forceSet(c);
80
- }, o.update = function(c) {
81
- o.set(c(t));
82
- }, o.pipe = (c) => {
83
- const r = R(null);
84
- return m(() => {
85
- const h = c(o());
86
- h instanceof Promise ? h.then((l) => r.set(l)) : y(h) ? m(() => r.set(h())) : r.set(h);
87
- }), r;
78
+ }, o.set = function(r, i = n) {
79
+ t !== r && i(t, r) && o.forceSet(r);
80
+ }, o.update = function(r) {
81
+ o.set(r(t));
82
+ }, o.pipe = (r) => {
83
+ const i = j(null);
84
+ return C(() => {
85
+ const a = r(o());
86
+ a instanceof Promise ? a.then((u) => i.set(u)) : y(a) ? C(() => i.set(a())) : i.set(a);
87
+ }), i;
88
88
  }, o;
89
89
  }
90
- function m(t) {
90
+ function C(t) {
91
91
  const e = Date.now();
92
- C("current effect", `%c${e}%c`);
92
+ b("current effect", `%c${e}%c`);
93
93
  const s = t;
94
- t = () => (C("current effect callback", `%c${e}%c`), s());
94
+ t = () => (b("current effect callback", `%c${e}%c`), s());
95
95
  const n = g[g.length - 1];
96
96
  L.has(t) || L.set(t, { cleanupFns: /* @__PURE__ */ new Set() });
97
97
  const o = L.get(t);
@@ -99,37 +99,37 @@ function m(t) {
99
99
  }
100
100
  const y = (t) => !!t && ["object", "function"].includes(typeof t) && "set" in t && "oldValue" in t && "update" in t && "forceSet" in t;
101
101
  function St(t, ...e) {
102
- const s = R("");
103
- return m(() => {
102
+ const s = j("");
103
+ return C(() => {
104
104
  const n = e.map(
105
- (c) => y(c) ? String(c()) : String(c)
105
+ (r) => y(r) ? String(r()) : String(r)
106
106
  ), o = [t[0]];
107
- n.forEach((c, r) => {
108
- o.push(c, t[r + 1]);
107
+ n.forEach((r, i) => {
108
+ o.push(r, t[i + 1]);
109
109
  }), s.set(o.join(""));
110
110
  }), s;
111
111
  }
112
112
  function vt(t, e) {
113
- const s = R(e ?? null), n = (o) => s.set(o);
114
- return t instanceof Promise ? t.then(n) : typeof t == "function" && m(() => {
113
+ const s = j(e ?? null), n = (o) => s.set(o);
114
+ return t instanceof Promise ? t.then(n) : typeof t == "function" && C(() => {
115
115
  const o = t();
116
- o instanceof Promise ? o.then(n) : y(o) ? m(() => n(o())) : n(o);
116
+ o instanceof Promise ? o.then(n) : y(o) ? C(() => n(o())) : n(o);
117
117
  }), s;
118
118
  }
119
119
  function At(t, e) {
120
120
  let s = t(), n = e();
121
- m(() => {
122
- const o = t(), c = e();
123
- o !== c && (o !== s ? e.set(o) : c !== n && t.set(c)), s = o, n = c;
121
+ C(() => {
122
+ const o = t(), r = e();
123
+ o !== r && (o !== s ? e.set(o) : r !== n && t.set(r)), s = o, n = r;
124
124
  });
125
125
  }
126
126
  function gt(...t) {
127
127
  let e = t.map((n) => n());
128
- const s = R(e);
128
+ const s = j(e);
129
129
  return t.forEach((n, o) => {
130
- m(() => {
131
- const c = () => e.filter((r) => r !== void 0).length;
132
- c() === t.length && (e = Array.from(e).fill(void 0)), e[o] = n(), c() === t.length && s.set([...e]);
130
+ C(() => {
131
+ const r = () => e.filter((i) => i !== void 0).length;
132
+ r() === t.length && (e = Array.from(e).fill(void 0)), e[o] = n(), r() === t.length && s.set([...e]);
133
133
  });
134
134
  }), s;
135
135
  }
@@ -155,8 +155,8 @@ class O extends HTMLElement {
155
155
  var o;
156
156
  if (this.isSlotLazyLoading && n) {
157
157
  if (s instanceof HTMLElement) {
158
- const c = s.slot || "default";
159
- this.htmlSlotContent[c] || (this.htmlSlotContent[c] = []), (o = this.htmlSlotContent[c]) == null || o.push(s);
158
+ const r = s.slot || "default";
159
+ this.htmlSlotContent[r] || (this.htmlSlotContent[r] = []), (o = this.htmlSlotContent[r]) == null || o.push(s);
160
160
  }
161
161
  } else return super.appendChild(s);
162
162
  }
@@ -165,11 +165,11 @@ class O extends HTMLElement {
165
165
  (s = this.appendAllSlotContent) == null || s.call(this);
166
166
  }
167
167
  inject(s) {
168
- return C("%cinject%c", s), this.injects[s] || (this.injects[s] = R(null)), this.injects[s];
168
+ return b("%cinject%c", s), this.injects[s] || (this.injects[s] = j(null)), this.injects[s];
169
169
  }
170
170
  checkInjects() {
171
171
  Object.entries(this.injects).forEach(([s, n]) => {
172
- C(
172
+ b(
173
173
  "%cinject%c",
174
174
  `%c${s}%c`,
175
175
  "from BaseElement (dispatch event)"
@@ -177,7 +177,7 @@ class O extends HTMLElement {
177
177
  new CustomEvent(s, {
178
178
  detail: {
179
179
  context: s,
180
- callback: (o) => m(() => {
180
+ callback: (o) => C(() => {
181
181
  n.set(o());
182
182
  })
183
183
  },
@@ -200,7 +200,7 @@ const Lt = (t) => "render" in t && "setReactiveValue" in t, tt = "handleSlotCont
200
200
  return t.appendChild(s), t;
201
201
  }, D = (t, e) => (t.innerHTML = "", z(t, e)), B = (t) => {
202
202
  const e = document.createElement("div");
203
- return e.style.display = "contents", m(() => {
203
+ return e.style.display = "contents", C(() => {
204
204
  const s = t();
205
205
  D(e, s);
206
206
  }), e;
@@ -251,7 +251,7 @@ const Lt = (t) => "render" in t && "setReactiveValue" in t, tt = "handleSlotCont
251
251
  return o in t && (t[o] = null), this;
252
252
  }
253
253
  else typeof s != "string" ? n = JSON.stringify(s) : n = s;
254
- if (t.setAttribute($(e), n), !(t instanceof O)) {
254
+ if (t.setAttribute(w(e), n), !(t instanceof O)) {
255
255
  const o = e.toLowerCase();
256
256
  o in t && (t[o] = s);
257
257
  }
@@ -259,24 +259,24 @@ const Lt = (t) => "render" in t && "setReactiveValue" in t, tt = "handleSlotCont
259
259
  },
260
260
  setCustomAttribute(e, s) {
261
261
  let n;
262
- return typeof s != "string" ? n = JSON.stringify(s) : n = s, t.setAttribute($(e), n), this;
262
+ return typeof s != "string" ? n = JSON.stringify(s) : n = s, t.setAttribute(w(e), n), this;
263
263
  },
264
264
  setReactiveAttribute(e, s) {
265
- return m(() => this.setAttribute(e, s())), this;
265
+ return C(() => this.setAttribute(e, s())), this;
266
266
  },
267
267
  setReactiveCustomAttribute(e, s) {
268
- return m(() => this.setCustomAttribute(e, s())), this;
268
+ return C(() => this.setCustomAttribute(e, s())), this;
269
269
  },
270
270
  removeAttribute(e) {
271
- return t.removeAttribute($(e)), this;
271
+ return t.removeAttribute(w(e)), this;
272
272
  },
273
273
  addStyle(e) {
274
274
  return Object.entries(e).forEach(([s, n]) => {
275
275
  const o = s.startsWith("--");
276
276
  typeof n == "function" ? this.addEffect(() => {
277
277
  if (o) {
278
- const c = String(n() || "");
279
- t.style.setProperty(s, c);
278
+ const r = String(n() || "");
279
+ t.style.setProperty(s, r);
280
280
  } else
281
281
  t.style[s] = n();
282
282
  }) : typeof n == "string" && (o ? t.style.setProperty(s, n) : t.style[s] = n);
@@ -308,7 +308,7 @@ const Lt = (t) => "render" in t && "setReactiveValue" in t, tt = "handleSlotCont
308
308
  },
309
309
  addReactiveClass(e) {
310
310
  return Object.keys(e).forEach((s) => {
311
- m(() => {
311
+ C(() => {
312
312
  e[s]() ? this.addClass(s) : this.removeClass(s);
313
313
  });
314
314
  }), this;
@@ -320,7 +320,7 @@ const Lt = (t) => "render" in t && "setReactiveValue" in t, tt = "handleSlotCont
320
320
  return t.classList.replace(e, s), this;
321
321
  },
322
322
  addEffect(e) {
323
- return m(() => e(this, this.hostElement)), this;
323
+ return C(() => e(this, this.hostElement)), this;
324
324
  },
325
325
  addReactiveContent(e) {
326
326
  return t.appendChild(B(e)), this;
@@ -334,7 +334,7 @@ const Lt = (t) => "render" in t && "setReactiveValue" in t, tt = "handleSlotCont
334
334
  hostElement: t
335
335
  }), et = (t, ...e) => ({
336
336
  classList: [...t.map((s) => s.trim()).filter(Boolean), ...e]
337
- }), jt = (t, ...e) => et(t, ...e), G = (t, e) => {
337
+ }), Rt = (t, ...e) => et(t, ...e), G = (t, e) => {
338
338
  if (!e) return t;
339
339
  const s = Object.keys(e || {}).filter(
340
340
  (n) => n.startsWith(".") || n.startsWith("@") || n.startsWith("$")
@@ -347,92 +347,92 @@ const Lt = (t) => "render" in t && "setReactiveValue" in t, tt = "handleSlotCont
347
347
  e.listeners[o] = e[n];
348
348
  }), s.filter((n) => n.startsWith("$")).forEach((n) => {
349
349
  e != null && e.effects || (e.effects = []), e.effects.push(e[n]);
350
- }), rt(t, e.classList), it(t, e.style), lt(t, e.attributes), ct(t, e.reactiveClassList), ot(t, e.customAttributes), nt(t, e.children), st(t, e.effects), J(t, e.listeners), J(t, e.customListeners), t;
350
+ }), rt(t, e.classList), ct(t, e.style), lt(t, e.attributes), it(t, e.reactiveClassList), ot(t, e.customAttributes), nt(t, e.children), st(t, e.effects), J(t, e.listeners), J(t, e.customListeners), t;
351
351
  }, J = (t, e) => {
352
352
  e && Object.entries(e).forEach(([s, n]) => {
353
353
  typeof n == "function" && t.addEventlistener(s, n);
354
354
  });
355
- }, st = (t, e) => e == null ? void 0 : e.forEach((s) => t.addEffect(s)), nt = (t, e) => W(t, ...e || []), ot = (t, e) => {
355
+ }, st = (t, e) => e == null ? void 0 : e.forEach((s) => t.addEffect(s)), nt = (t, e) => F(t, ...e || []), ot = (t, e) => {
356
356
  const s = e;
357
357
  s && Object.keys(s).forEach((n) => {
358
358
  y(s[n]) ? t.setReactiveCustomAttribute(n, s[n]) : typeof s[n] == "function" ? t.addEffect(() => {
359
359
  t.setCustomAttribute(n, s[n]());
360
360
  }) : t.setCustomAttribute(n, s[n]);
361
361
  });
362
- }, rt = (t, e) => t.addClass(...e || []), ct = (t, e) => t.addReactiveClass(e || {}), it = (t, e) => t.addStyle(e || {}), lt = (t, e) => {
363
- const s = e, n = (o, c) => {
364
- c && (y(c) ? t.setReactiveAttribute(o, c) : typeof c == "function" ? t.addEffect(() => {
365
- t.setAttribute(o, c());
366
- }) : t.setAttribute(o, c));
362
+ }, rt = (t, e) => t.addClass(...e || []), it = (t, e) => t.addReactiveClass(e || {}), ct = (t, e) => t.addStyle(e || {}), lt = (t, e) => {
363
+ const s = e, n = (o, r) => {
364
+ r && (y(r) ? t.setReactiveAttribute(o, r) : typeof r == "function" ? t.addEffect(() => {
365
+ t.setAttribute(o, r());
366
+ }) : t.setAttribute(o, r));
367
367
  };
368
368
  s && Object.keys(s).forEach((o) => {
369
369
  n(o, s[o]);
370
370
  });
371
- }, W = (t, ...e) => (e.forEach((s) => {
371
+ }, F = (t, ...e) => (e.forEach((s) => {
372
372
  typeof s == "string" ? s.trim().length > 0 && t.addHtmlContent(s) : y(s) ? t.addReactiveContent(s) : t.append(s);
373
- }), t), j = (t, e) => {
373
+ }), t), R = (t, e) => {
374
374
  const s = document.createElement(t), n = {
375
375
  ...N(s)
376
376
  };
377
377
  return G(n, e);
378
378
  }, at = (t, e) => {
379
- const [s, ...n] = t.split(" ").map((c) => c.trim()), o = j(s, e);
380
- return n.length > 0 && o.addClass(...n), (...c) => W(
379
+ const [s, ...n] = t.split(" ").map((r) => r.trim()), o = R(s, e);
380
+ return n.length > 0 && o.addClass(...n), (...r) => F(
381
381
  o,
382
- ...c.filter(Boolean).map(
383
- (r) => typeof r == "function" && !y(r) ? S(() => r(o)) : r
382
+ ...r.filter(Boolean).map(
383
+ (i) => typeof i == "function" && !y(i) ? S(() => i(o)) : i
384
384
  )
385
385
  );
386
386
  }, V = (t, e) => {
387
387
  const s = at(t, e);
388
388
  return Object.assign(s, s());
389
- }, S = (t) => j("div").addStyle({ display: "contents" }).addEffect((e) => {
389
+ }, S = (t) => R("div").addStyle({ display: "contents" }).addEffect((e) => {
390
390
  const s = t(), n = [];
391
- Array.isArray(s) ? n.push(...s) : n.push(s), e.clear(), W(e, ...n);
392
- }), Rt = (t, e, s) => {
393
- const n = j("div").addStyle({ display: "contents" }), o = /* @__PURE__ */ new Map(), c = /* @__PURE__ */ new Map();
394
- let r = [];
395
- const h = /* @__PURE__ */ new Set();
396
- let l = t.peek();
397
- const a = (d) => {
398
- h.delete(d), o.delete(d), c.delete(d);
391
+ Array.isArray(s) ? n.push(...s) : n.push(s), e.clear(), F(e, ...n);
392
+ }), jt = (t, e, s) => {
393
+ const n = R("div").addStyle({ display: "contents" }), o = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Map();
394
+ let i = [];
395
+ const a = /* @__PURE__ */ new Set();
396
+ let u = t.peek();
397
+ const l = (h) => {
398
+ a.delete(h), o.delete(h), r.delete(h);
399
399
  };
400
- return m(() => {
401
- const d = t();
402
- r = d.map(e).map((f) => typeof f == "string" ? f : f.toString());
403
- const u = Array.from(n.hostElement.children);
404
- C("containerChildren", u, r), u.forEach((f) => {
405
- const b = f.dataset.key;
406
- r.includes(b) || (C("remove element", b, f), f.remove(), a(b));
407
- }), r.forEach((f) => {
400
+ return C(() => {
401
+ const h = t();
402
+ i = h.map(e).map((d) => typeof d == "string" ? d : d.toString());
403
+ const p = Array.from(n.hostElement.children);
404
+ b("containerChildren", p, i), p.forEach((d) => {
405
+ const m = d.dataset.key;
406
+ i.includes(m) || (b("remove element", m, d), d.remove(), l(m));
407
+ }), i.forEach((d) => {
408
408
  var T, v;
409
- const b = d[r.indexOf(f)];
410
- o.has(f) ? JSON.stringify(b) !== JSON.stringify(l[r.indexOf(f)]) && ((T = n.hostElement.querySelector(`[data-key="${f}"]`)) == null || T.remove(), (v = o.get(f)) == null || v.set(Math.random().toString(36).substring(2, 15)), c.set(
411
- f,
412
- () => s(b, r.indexOf(f), d).setCustomAttribute(
409
+ const m = h[i.indexOf(d)];
410
+ o.has(d) ? JSON.stringify(m) !== JSON.stringify(u[i.indexOf(d)]) && ((T = n.hostElement.querySelector(`[data-key="${d}"]`)) == null || T.remove(), (v = o.get(d)) == null || v.set(Math.random().toString(36).substring(2, 15)), r.set(
411
+ d,
412
+ () => s(m, i.indexOf(d), h).setCustomAttribute(
413
413
  "data-key",
414
- f
414
+ d
415
415
  )
416
- )) : (C("create new element", f, b), o.set(
417
- f,
418
- R(Math.random().toString(36).substring(2, 15))
419
- ), c.set(
420
- f,
421
- () => s(b, r.indexOf(f), d).setCustomAttribute(
416
+ )) : (b("create new element", d, m), o.set(
417
+ d,
418
+ j(Math.random().toString(36).substring(2, 15))
419
+ ), r.set(
420
+ d,
421
+ () => s(m, i.indexOf(d), h).setCustomAttribute(
422
422
  "data-key",
423
- f
423
+ d
424
424
  )
425
425
  ));
426
- }), l = d;
427
- const p = () => {
428
- o.forEach((f, b) => {
429
- C("key from setTimeout foreach currItemSignalMap", b), h.has(b) || (h.add(b), m(() => {
426
+ }), u = h;
427
+ const f = () => {
428
+ o.forEach((d, m) => {
429
+ b("key from setTimeout foreach currItemSignalMap", m), a.has(m) || (a.add(m), C(() => {
430
430
  var H;
431
- f();
432
- const T = r.indexOf(b), v = (H = c.get(b)) == null ? void 0 : H();
433
- v && (C(
431
+ d();
432
+ const T = i.indexOf(m), v = (H = r.get(m)) == null ? void 0 : H();
433
+ v && (b(
434
434
  "call effect from setTimeout",
435
- b,
435
+ m,
436
436
  v.hostElement
437
437
  ), T <= n.hostElement.children.length - 1 ? n.hostElement.insertBefore(
438
438
  v.hostElement,
@@ -441,67 +441,67 @@ const Lt = (t) => "render" in t && "setReactiveValue" in t, tt = "handleSlotCont
441
441
  }));
442
442
  });
443
443
  };
444
- Promise.resolve().then(() => p());
444
+ Promise.resolve().then(() => f());
445
445
  }), n;
446
446
  }, Tt = (t, e, s) => {
447
- const n = j("div").addStyle({ display: "contents" }), o = /* @__PURE__ */ new Map();
448
- return m(() => {
449
- let c = Array.from(n.hostElement.children).map(
450
- (a) => a.dataset.key
447
+ const n = R("div").addStyle({ display: "contents" }), o = /* @__PURE__ */ new Map();
448
+ return C(() => {
449
+ let r = Array.from(n.hostElement.children).map(
450
+ (l) => l.dataset.key
451
451
  );
452
- const r = t(), h = r.map(e).map((a) => a.toString()), l = /* @__PURE__ */ new Map();
453
- r.forEach((a, d) => l.set(h[d], a)), c.filter((a) => !h.includes(a)).forEach(
454
- (a) => {
455
- var d;
456
- return (d = n.hostElement.querySelector(`[data-key="${a}"]`)) == null ? void 0 : d.remove();
452
+ const i = t(), a = i.map(e).map((l) => l.toString()), u = /* @__PURE__ */ new Map();
453
+ i.forEach((l, h) => u.set(a[h], l)), r.filter((l) => !a.includes(l)).forEach(
454
+ (l) => {
455
+ var h;
456
+ return (h = n.hostElement.querySelector(`[data-key="${l}"]`)) == null ? void 0 : h.remove();
457
457
  }
458
- ), c = c.filter(
459
- (a) => h.includes(a)
460
- ), h.forEach((a, d) => {
461
- if (c.includes(a)) {
462
- if (JSON.stringify(o.get(a)) !== JSON.stringify(l.get(a))) {
463
- const u = s(r[d], d, r).setCustomAttribute(
458
+ ), r = r.filter(
459
+ (l) => a.includes(l)
460
+ ), a.forEach((l, h) => {
461
+ if (r.includes(l)) {
462
+ if (JSON.stringify(o.get(l)) !== JSON.stringify(u.get(l))) {
463
+ const p = s(i[h], h, i).setCustomAttribute(
464
464
  "data-key",
465
- a
465
+ l
466
466
  ).hostElement;
467
467
  n.hostElement.querySelector(
468
- `[data-key="${a}"]`
469
- ).replaceWith(u);
470
- const p = n.hostElement.children;
471
- d > p.length - 2 ? n.hostElement.append(u) : n.hostElement.insertBefore(u, p[d + 1]);
468
+ `[data-key="${l}"]`
469
+ ).replaceWith(p);
470
+ const f = n.hostElement.children;
471
+ h > f.length - 2 ? n.hostElement.append(p) : n.hostElement.insertBefore(p, f[h + 1]);
472
472
  }
473
473
  } else {
474
- const u = s(r[d], d, r).setCustomAttribute(
474
+ const p = s(i[h], h, i).setCustomAttribute(
475
475
  "data-key",
476
- a
477
- ), p = n.hostElement.children;
478
- d > p.length - 1 ? n.hostElement.append(u.hostElement) : n.hostElement.insertBefore(
479
- u.hostElement,
480
- p[d]
476
+ l
477
+ ), f = n.hostElement.children;
478
+ h > f.length - 1 ? n.hostElement.append(p.hostElement) : n.hostElement.insertBefore(
479
+ p.hostElement,
480
+ f[h]
481
481
  );
482
482
  }
483
- }), r.forEach((a, d) => o.set(h[d], a));
483
+ }), i.forEach((l, h) => o.set(a[h], l));
484
484
  }), n;
485
485
  }, xt = (t) => {
486
- let e = [j("div")], s = !1;
487
- return m(() => {
488
- var c;
486
+ let e = [R("div")], s = !1;
487
+ return C(() => {
488
+ var r;
489
489
  const n = t(), o = [];
490
490
  Array.isArray(n) ? (o.push(...n), s = !0) : o.push(n), o.length === 0 && o.push(
491
- j("div").addStyle({ display: "none" })
491
+ R("div").addStyle({ display: "none" })
492
492
  );
493
493
  try {
494
- (c = e[0].hostElement) == null || c.replaceWith(
495
- ...o.map((r) => r.hostElement)
496
- ), e.forEach((r) => {
497
- var h;
498
- return (h = r.hostElement) == null ? void 0 : h.remove();
494
+ (r = e[0].hostElement) == null || r.replaceWith(
495
+ ...o.map((i) => i.hostElement)
496
+ ), e.forEach((i) => {
497
+ var a;
498
+ return (a = i.hostElement) == null ? void 0 : a.remove();
499
499
  }), e = o;
500
- } catch (r) {
501
- console.error(r);
500
+ } catch (i) {
501
+ console.error(i);
502
502
  }
503
503
  }), s ? e : e[0];
504
- }, wt = (t) => tt in t, $t = (t) => {
504
+ }, $t = (t) => tt in t, wt = (t) => {
505
505
  const e = V("div").addStyle({ display: "contents" }), s = (n) => (e.hostElement.innerHTML = n, e);
506
506
  return typeof t == "string" ? s(t) : e.addEffect(() => {
507
507
  s(t());
@@ -520,16 +520,16 @@ const Lt = (t) => "render" in t && "setReactiveValue" in t, tt = "handleSlotCont
520
520
  )
521
521
  ), S(() => n);
522
522
  }, dt = (t, e) => {
523
- C("createCustomElement", t);
523
+ b("createCustomElement", t);
524
524
  const s = document.createElement(t), n = {
525
525
  ...N(s),
526
526
  setReactiveValue(o) {
527
527
  return s instanceof O && s.setReactiveValue(o), this;
528
528
  },
529
529
  setSlotTemplate(o) {
530
- const c = s.slotTemplate;
531
- return c && Object.entries(o).forEach(([r, h]) => {
532
- c[r] = h;
530
+ const r = s.slotTemplate;
531
+ return r && Object.entries(o).forEach(([i, a]) => {
532
+ r[i] = a;
533
533
  }), this;
534
534
  }
535
535
  };
@@ -538,20 +538,20 @@ const Lt = (t) => "render" in t && "setReactiveValue" in t, tt = "handleSlotCont
538
538
  const s = t.split(" ").slice(1).map((o) => o.trim()), n = dt(t.split(" ")[0], e);
539
539
  return Array.isArray(s) && s.length > 0 && n.addClass(...s), (...o) => {
540
540
  A("@rcreateCustomEl content", t, o);
541
- const c = o.filter(Boolean).map(
542
- (r) => typeof r == "function" && !y(r) ? S(() => r(n)) : r
541
+ const r = o.filter(Boolean).map(
542
+ (i) => typeof i == "function" && !y(i) ? S(() => i(n)) : i
543
543
  );
544
- return n.hostElement.allSlotContent = c, n.hostElement.slotContent = c.filter(Q).reduce(
545
- (r, h) => {
546
- const l = h.hostElement.getAttribute("slot") || "default";
547
- return r[l] || (r[l] = []), r[l].push(h), r;
544
+ return n.hostElement.allSlotContent = r, n.hostElement.slotContent = r.filter(Q).reduce(
545
+ (i, a) => {
546
+ const u = a.hostElement.getAttribute("slot") || "default";
547
+ return i[u] || (i[u] = []), i[u].push(a), i;
548
548
  },
549
549
  {}
550
- ), n.hostElement.appendAllSlotContent = () => W(n, ...c), n;
550
+ ), n.hostElement.appendAllSlotContent = () => F(n, ...r), n;
551
551
  };
552
552
  }, ft = (t, e, s) => ut(
553
553
  `${t.renderTagName}${e && typeof e == "string" ? " " + e : ""}`,
554
- w(e) ? e : e && typeof e == "string" ? s : void 0
554
+ $(e) ? e : e && typeof e == "string" ? s : void 0
555
555
  ), pt = (t, e, s) => {
556
556
  const n = ft(t, e, s);
557
557
  return Object.assign(n, n());
@@ -559,13 +559,13 @@ const Lt = (t) => "render" in t && "setReactiveValue" in t, tt = "handleSlotCont
559
559
  const t = () => {
560
560
  };
561
561
  return t.oldValue = null, t;
562
- }, Pt = () => ({}), Wt = (t, e, s) => {
562
+ }, Pt = () => ({}), Ft = (t, e, s) => {
563
563
  const n = e ? Et(e, s)(t) : t;
564
- return (o, ...c) => {
565
- const r = [...c];
566
- return o && !w(o) && r.unshift(o), pt(n, w(o) ? o : {})(...r);
564
+ return (o, ...r) => {
565
+ const i = [...r];
566
+ return o && !$(o) && i.unshift(o), pt(n, $(o) ? o : {})(...i);
567
567
  };
568
- }, i = {}, mt = [
568
+ }, c = {}, mt = [
569
569
  "div",
570
570
  "span",
571
571
  "section",
@@ -628,16 +628,16 @@ const Lt = (t) => "render" in t && "setReactiveValue" in t, tt = "handleSlotCont
628
628
  "slot"
629
629
  ];
630
630
  mt.forEach((t) => {
631
- i[t] = (e, ...s) => {
631
+ c[t] = (e, ...s) => {
632
632
  let n = [...s];
633
- return e && !w(e) && (n = [e].concat(n)), V(t, w(e) ? e : {})(...n);
633
+ return e && !$(e) && (n = [e].concat(n)), V(t, $(e) ? e : {})(...n);
634
634
  };
635
635
  });
636
- const Ct = i.div, Ft = i.span, Ht = i.section, _t = i.input, Bt = i.button, Jt = i.table, qt = i.tr, zt = i.td, Dt = i.th, Nt = i.ul, Gt = i.li, Vt = i.ol, Ut = i.form, Xt = i.label, Zt = i.select, Qt = i.option, Yt = i.textarea, Kt = i.img, te = i.a, ee = i.p, se = i.h1, ne = i.h2, oe = i.h3, re = i.h4, ce = i.h5, ie = i.h6, le = i.br, ae = i.hr, he = i.pre, de = i.code, ue = i.nav, fe = i.header, pe = i.footer, me = i.main, Ce = i.aside, Ee = i.article, be = i.figure, ye = i.figcaption, Se = i.blockquote, ve = i.cite, Ae = i.small, ge = i.strong, Le = i.em, Oe = i.b, je = i.i, Re = i.u, Te = i.s, xe = i.sub, we = i.sup, $e = i.mark, ke = i.del, Ie = i.ins, Me = i.details, Pe = i.summary, We = i.progress, Fe = i.meter, He = i.audio, _e = i.video, Be = i.canvas, Je = i.slot, qe = (t) => (e) => t(e).addClass(...e.classList ?? []).addReactiveClass(e.reactiveClassList ?? {}), k = "eventProps", I = "EVENT_CONFIG", x = "observedAttributes", ze = () => (t, e) => {
636
+ const Ct = c.div, Wt = c.span, Ht = c.section, _t = c.input, Bt = c.button, Jt = c.table, qt = c.tr, zt = c.td, Dt = c.th, Nt = c.ul, Gt = c.li, Vt = c.ol, Ut = c.form, Xt = c.label, Zt = c.select, Qt = c.option, Yt = c.textarea, Kt = c.img, te = c.a, ee = c.p, se = c.h1, ne = c.h2, oe = c.h3, re = c.h4, ie = c.h5, ce = c.h6, le = c.br, ae = c.hr, he = c.pre, de = c.code, ue = c.nav, fe = c.header, pe = c.footer, me = c.main, Ce = c.aside, Ee = c.article, be = c.figure, ye = c.figcaption, Se = c.blockquote, ve = c.cite, Ae = c.small, ge = c.strong, Le = c.em, Oe = c.b, Re = c.i, je = c.u, Te = c.s, xe = c.sub, $e = c.sup, we = c.mark, ke = c.del, Ie = c.ins, Me = c.details, Pe = c.summary, Fe = c.progress, We = c.meter, He = c.audio, _e = c.video, Be = c.canvas, Je = c.slot, qe = (t) => (e) => t(e).addClass(...e.classList ?? []).addReactiveClass(e.reactiveClassList ?? {}), k = "eventProps", I = "EVENT_CONFIG", x = "observedAttributes", ze = () => (t, e) => {
637
637
  Reflect.get(t, x) || Reflect.defineProperty(t, x, {
638
638
  value: []
639
639
  }), Reflect.get(t, x).push(
640
- $(e)
640
+ w(e)
641
641
  );
642
642
  }, De = (t) => (e, s) => {
643
643
  Reflect.get(e, k) || Reflect.defineProperty(e, k, {
@@ -649,111 +649,117 @@ const Ct = i.div, Ft = i.span, Ht = i.section, _t = i.input, Bt = i.button, Jt =
649
649
  composed: (t == null ? void 0 : t.composed) ?? !1
650
650
  }, Reflect.get(e, k).push(s);
651
651
  }, Et = (t, e = !1) => (s) => {
652
- C(
652
+ b(
653
653
  t,
654
654
  "start register static attr",
655
655
  s.prototype[x]
656
656
  );
657
657
  const n = [];
658
658
  if (s.styles) {
659
- const c = s.styles, r = [];
660
- Array.isArray(c) ? r.push(...c) : r.push(c), r.forEach((h) => {
659
+ const r = s.styles, i = [];
660
+ Array.isArray(r) ? i.push(...r) : i.push(r), i.forEach((a) => {
661
+ const u = new CSSStyleSheet();
662
+ u.replaceSync(a), n.push(u);
661
663
  const l = new CSSStyleSheet();
662
- l.replaceSync(h), n.push(l);
663
- const a = new CSSStyleSheet();
664
- a.replaceSync(h.slice(h.indexOf("@property"))), document.adoptedStyleSheets.push(a);
664
+ l.replaceSync(a.slice(a.indexOf("@property"))), document.adoptedStyleSheets.push(l);
665
665
  });
666
666
  }
667
667
  class o extends s {
668
- constructor(...r) {
669
- C("constructor", `%c${t}%c`), super(e, ...r), A("@osheet", n), n.length > 0 && this.shadow.adoptedStyleSheets.push(...n);
668
+ constructor(...a) {
669
+ b("constructor", `%c${t}%c`);
670
+ super(e, ...a);
671
+ E(this, "isFirstRender", !0);
672
+ A("@osheet", n), n.length > 0 && this.shadow.adoptedStyleSheets.push(...n);
670
673
  }
671
674
  render() {
672
- let r = Ct();
673
- const h = () => {
674
- r = s.prototype.render.call(this);
675
+ let a = Ct();
676
+ const u = () => {
677
+ a = s.prototype.render.call(this);
675
678
  };
676
- return h.fake = !0, m(h), r;
679
+ return u.fake = !0, C(u), a;
677
680
  }
678
- attributeChangedCallback(r, h, l) {
679
- C(
681
+ attributeChangedCallback(a, u, l) {
682
+ b(
680
683
  "%cAttribute has changed.%c",
681
- `%c${r}%c`,
682
- `oldValue: ${h}, newValue: ${l}`,
684
+ `%c${a}%c`,
685
+ `oldValue: ${u}, newValue: ${l}`,
683
686
  `%c${t}%c`
684
687
  );
685
688
  try {
686
689
  l = JSON.parse(l);
687
690
  } catch {
688
691
  }
689
- const a = Y(r);
690
- if (a in this && y(this[a])) {
691
- const d = this[a];
692
- l === null ? (d.set(d.initValue), this.removeAttribute(r)) : d.set(l);
692
+ const h = Y(a);
693
+ if (h in this && y(this[h])) {
694
+ const p = this[h];
695
+ l === null ? (p.set(p.initValue), this.removeAttribute(a)) : p.set(l);
693
696
  }
694
- F(
697
+ W(
695
698
  this,
696
699
  s.prototype.attributeChangedCallback,
697
- r,
698
- h,
700
+ a,
701
+ u,
699
702
  l
700
703
  );
701
704
  }
702
705
  connectedCallback() {
703
- var h;
704
- C("connectedCallback", `%c${t}%c`, this), this.providers && Object.keys(this.providers).length > 0 && (C("WRAPPER for providers", t), Object.entries(this.providers).forEach(
705
- ([l, a]) => {
706
- C("register provider", l, a()), this.addEventListener(l, (d) => {
707
- var p;
708
- C("send provider", l, a());
709
- const u = d;
710
- ((p = u.detail) == null ? void 0 : p.context) === l && (u.stopPropagation(), u.detail.callback(a));
706
+ var u;
707
+ b("connectedCallback", `%c${t}%c`, this), this.providers && Object.keys(this.providers).length > 0 && (b("WRAPPER for providers", t), Object.entries(this.providers).forEach(
708
+ ([l, h]) => {
709
+ b("register provider", l, h()), this.addEventListener(l, (p) => {
710
+ var d;
711
+ b("send provider", l, h());
712
+ const f = p;
713
+ ((d = f.detail) == null ? void 0 : d.context) === l && (f.stopPropagation(), f.detail.callback(h));
711
714
  });
712
715
  }
713
- )), this.checkInjects(), (h = s.prototype[k]) == null || h.forEach(
716
+ )), this.checkInjects(), (u = s.prototype[k]) == null || u.forEach(
714
717
  (l) => {
715
- this[l] = (a) => {
716
- const d = s.prototype[I][l], { bubbles: u, composed: p } = d;
717
- y(a) ? m(() => {
718
- A("@oemit reactive value", a()), this.dispatchEvent(
718
+ this[l] = (h) => {
719
+ const p = s.prototype[I][l], { bubbles: f, composed: d } = p;
720
+ y(h) ? C(() => {
721
+ A("@oemit reactive value", h()), this.dispatchEvent(
719
722
  new CustomEvent(l, {
720
- detail: a(),
721
- bubbles: u,
722
- composed: p
723
+ detail: h(),
724
+ bubbles: f,
725
+ composed: d
723
726
  })
724
727
  );
725
- }) : (A("@oemit value", a), this.dispatchEvent(
728
+ }) : (A("@oemit value", h), this.dispatchEvent(
726
729
  new CustomEvent(l, {
727
- detail: a,
728
- bubbles: u,
729
- composed: p
730
+ detail: h,
731
+ bubbles: f,
732
+ composed: d
730
733
  })
731
734
  ));
732
735
  };
733
736
  }
734
- ), C("start render", `%c${t}%c`, t);
735
- const r = () => {
737
+ ), b("start render", `%c${t}%c`, t);
738
+ const a = () => {
739
+ if (setTimeout(() => {
740
+ W(this, s.prototype.connectedCallback);
741
+ }), !this.isFirstRender) return;
736
742
  const l = this.render();
737
- this.shadow.appendChild(l.hostElement), F(this, s.prototype.connectedCallback);
743
+ this.shadow.appendChild(l.hostElement), this.appendSlotContent(), this.isFirstRender = !1;
738
744
  };
739
745
  if (this.rootStyle && !s.styles) {
740
- const l = (u) => u instanceof Promise || Array.isArray(u) && u.every((p) => p instanceof Promise), a = this.rootStyle, d = (u) => {
741
- const p = new CSSStyleSheet();
742
- p.replaceSync(u), this.shadow.adoptedStyleSheets.push(p);
743
- const f = new CSSStyleSheet();
744
- f.replaceSync(u.slice(u.indexOf("@property"))), document.adoptedStyleSheets.push(f);
746
+ const l = (f) => f instanceof Promise || Array.isArray(f) && f.every((d) => d instanceof Promise), h = this.rootStyle, p = (f) => {
747
+ const d = new CSSStyleSheet();
748
+ d.replaceSync(f), this.shadow.adoptedStyleSheets.push(d);
749
+ const m = new CSSStyleSheet();
750
+ m.replaceSync(f.slice(f.indexOf("@property"))), document.adoptedStyleSheets.push(m);
745
751
  };
746
- if (l(a)) {
747
- const u = [];
748
- Array.isArray(a) ? u.push(...a) : u.push(a), Promise.all(u).then((p) => p.forEach((f) => d(f.default))).then(() => r());
752
+ if (l(h)) {
753
+ const f = [];
754
+ Array.isArray(h) ? f.push(...h) : f.push(h), Promise.all(f).then((d) => d.forEach((m) => p(m.default))).then(() => a());
749
755
  } else {
750
- const u = [];
751
- Array.isArray(a) ? u.push(...a) : u.push(a), u.forEach((p) => d(p)), r();
756
+ const f = [];
757
+ Array.isArray(h) ? f.push(...h) : f.push(h), f.forEach((d) => p(d)), a();
752
758
  }
753
759
  } else
754
- r();
755
- this.appendSlotContent(), this.slotContext && Object.keys(this.slotContext).length > 0 && this.shadow.querySelectorAll("slot").forEach((l) => {
756
- C(
760
+ a();
761
+ this.slotContext && Object.keys(this.slotContext).length > 0 && this.shadow.querySelectorAll("slot").forEach((l) => {
762
+ b(
757
763
  this.slotContext,
758
764
  this.slotContext && this.slotContext[l.name]
759
765
  ), A(
@@ -761,17 +767,17 @@ const Ct = i.div, Ft = i.span, Ht = i.section, _t = i.input, Bt = i.button, Jt =
761
767
  l,
762
768
  `name:${l.name};`,
763
769
  l.assignedElements()
764
- ), l.assignedElements().forEach((a) => {
765
- const d = this.slotContext[l.name];
766
- this.slotContext && y(d) && (A(
770
+ ), l.assignedElements().forEach((h) => {
771
+ const p = this.slotContext[l.name];
772
+ this.slotContext && y(p) && (A(
767
773
  "@oslot element",
768
774
  l,
769
775
  `name:${l.name};`,
770
776
  l.assignedElements()
771
- ), m(() => {
772
- a.dispatchEvent(
777
+ ), C(() => {
778
+ h.dispatchEvent(
773
779
  new CustomEvent("handleSlotContext", {
774
- detail: d()
780
+ detail: p()
775
781
  })
776
782
  );
777
783
  }));
@@ -779,7 +785,7 @@ const Ct = i.div, Ft = i.span, Ht = i.section, _t = i.input, Bt = i.button, Jt =
779
785
  });
780
786
  }
781
787
  disconnectedCallback() {
782
- this.shadow.replaceChildren(), this.replaceChildren(), F(this, s.prototype.disconnectedCallback);
788
+ W(this, s.prototype.disconnectedCallback);
783
789
  }
784
790
  }
785
791
  return E(o, "observedAttributes", s.prototype[x] ?? []), E(o, "renderTagName", t), o.toString = () => t, customElements.get(t) ? console.error(
@@ -793,9 +799,9 @@ export {
793
799
  rt as addClassList,
794
800
  ot as addCustomAttributes,
795
801
  z as addHtmlContent,
796
- ct as addReactiveClassList,
797
- it as addStyleList,
798
- W as appendContentItem,
802
+ it as addReactiveClassList,
803
+ ct as addStyleList,
804
+ F as appendContentItem,
799
805
  Ee as article,
800
806
  Ce as aside,
801
807
  He as audio,
@@ -804,12 +810,12 @@ export {
804
810
  Se as blockquote,
805
811
  le as br,
806
812
  Bt as button,
807
- $ as camelToKebab,
813
+ w as camelToKebab,
808
814
  Be as canvas,
809
- F as checkCall,
815
+ W as checkCall,
810
816
  ve as cite,
811
817
  et as classList,
812
- jt as cls,
818
+ Rt as cls,
813
819
  de as code,
814
820
  A as colorLog,
815
821
  Et as component,
@@ -818,7 +824,7 @@ export {
818
824
  ut as createCustomEl,
819
825
  dt as createCustomElement,
820
826
  at as createEl,
821
- j as createElement,
827
+ R as createElement,
822
828
  vt as createSignal,
823
829
  pt as customEl,
824
830
  Pt as defineSlotTemplate,
@@ -826,7 +832,7 @@ export {
826
832
  Me as details,
827
833
  K as disableLogs,
828
834
  Ct as div,
829
- m as effect,
835
+ C as effect,
830
836
  V as el,
831
837
  N as elementHelpers,
832
838
  Le as em,
@@ -838,33 +844,33 @@ export {
838
844
  pe as footer,
839
845
  gt as forkJoin,
840
846
  Ut as form,
841
- Rt as getList,
847
+ jt as getList,
842
848
  S as getSignalContent,
843
849
  se as h1,
844
850
  ne as h2,
845
851
  oe as h3,
846
852
  re as h4,
847
- ce as h5,
848
- ie as h6,
853
+ ie as h5,
854
+ ce as h6,
849
855
  fe as header,
850
856
  ae as hr,
851
857
  B as htmlEffectWrapper,
852
- je as i,
858
+ Re as i,
853
859
  Kt as img,
854
860
  G as initComponent,
855
861
  _t as input,
856
862
  Ie as ins,
857
863
  Lt as isBaseElement,
858
864
  Q as isComponentConfig,
859
- w as isComponentInitConfig,
865
+ $ as isComponentInitConfig,
860
866
  y as isReactiveSignal,
861
- wt as isSlotTemplate,
867
+ $t as isSlotTemplate,
862
868
  Y as kebabToCamel,
863
869
  Xt as label,
864
870
  Gt as li,
865
871
  me as main,
866
- $e as mark,
867
- Fe as meter,
872
+ we as mark,
873
+ We as meter,
868
874
  ue as nav,
869
875
  Mt as newEventEmitter,
870
876
  Vt as ol,
@@ -872,8 +878,8 @@ export {
872
878
  Qt as option,
873
879
  ee as p,
874
880
  he as pre,
875
- We as progress,
876
- C as projectLog,
881
+ Fe as progress,
882
+ b as projectLog,
877
883
  ze as property,
878
884
  U as renderIf,
879
885
  St as rs,
@@ -887,24 +893,24 @@ export {
887
893
  J as setListeners,
888
894
  It as show,
889
895
  q as showIf,
890
- R as signal,
896
+ j as signal,
891
897
  xt as signalComponent,
892
898
  Je as slot,
893
899
  Ae as small,
894
- Ft as span,
900
+ Wt as span,
895
901
  ge as strong,
896
902
  xe as sub,
897
903
  Pe as summary,
898
- we as sup,
904
+ $e as sup,
899
905
  Jt as table,
900
906
  zt as td,
901
907
  Yt as textarea,
902
908
  Dt as th,
903
909
  qt as tr,
904
- Re as u,
910
+ je as u,
905
911
  Nt as ul,
906
- $t as unsafeHtml,
907
- Wt as useCustomComponent,
912
+ wt as unsafeHtml,
913
+ Ft as useCustomComponent,
908
914
  _e as video,
909
915
  kt as when
910
916
  };
@@ -0,0 +1,2 @@
1
+ (function(o,S){typeof exports=="object"&&typeof module<"u"?S(exports):typeof define=="function"&&define.amd?define(["exports"],S):(o=typeof globalThis<"u"?globalThis:o||self,S(o.ReactiveComponent={}))})(this,function(o){"use strict";var ze=Object.defineProperty;var Ge=(o,S,A)=>S in o?ze(o,S,{enumerable:!0,configurable:!0,writable:!0,value:A}):o[S]=A;var p=(o,S,A)=>Ge(o,typeof S!="symbol"?S+"":S,A);const S=t=>t&&typeof t=="object"&&("classList"in t||"attributes"in t||"customAttributes"in t||"reactiveClassList"in t||"listeners"in t||"customListeners"in t||"children"in t||"effects"in t||"style"in t||Object.keys(t).some(e=>e.startsWith(".")||e.startsWith("@")||e.startsWith("$")))&&!("hostElement"in t),A=t=>t&&typeof t=="object"&&"hostElement"in t&&"append"in t&&"set"in t&&"addStyle"in t&&"setAttribute"in t&&"addClass"in t&&"addEffect"in t&&"addReactiveContent"in t&&"setReactiveContent"in t&&"clear"in t,F=(t,e,...n)=>{e&&e.apply(t,n)};let H=!0;const E=(...t)=>{H&&console.log(t.join(" | "),...Array.from(t.join("").matchAll(/%c/gm)).map((e,n)=>n%2===0?"color:red":"color:inherit"))},I=t=>t.replace(/([A-Z])/gm,e=>`-${e.toLowerCase()}`),Z=t=>t.replace(/-(\w)/gm,(e,n)=>n.toUpperCase()),L=(t,...e)=>{if(!H)return;const n={r:"color: #ff0000",g:"color: #00ff00",b:"color: #0000ff",y:"color: #ffff00",p:"color: #800080",c:"color: #00ffff",o:"color: #ffa500",w:"color: #808080"},s=t.match(/@[rgbpycow]/g)||[],i=s.map(c=>{const d=c.slice(1);return n[d]||"color: inherit"});let l=t;s.forEach(c=>{const d=new RegExp(`\\${c}([^\\s,]+)`,"g");l=l.replace(d,"%c$1")}),console.log(l,...i,...e)},Ct=()=>{H=!0},Q=()=>{H=!1};Q();const k=new WeakMap,W=[],w=[];function R(t,e=()=>!0){const n=new Set;let s=e;function i(){const l=W[W.length-1];if(l&&!("fake"in l&&l.fake)){const c=k.get(l),d=c==null?void 0:c.parent;if(d){const f=k.get(d);f==null||f.cleanupFns.add(()=>{n.delete(l)})}n.add(l)}return t}return i.getSubscribers=()=>[...n],i.setCompareFn=function(l){return s=l,i},i.clearSubscribers=function(){n.clear()},i.peek=function(){return Object.freeze(t)},i.initValue=Object.freeze(t),i.oldValue=Object.freeze(t),i.forceSet=function(l){i.oldValue=Object.freeze(t),t=l,n.forEach(c=>Promise.resolve(c).then(d=>{const f=k.get(d);f&&f.cleanupFns.size>0&&(f.cleanupFns.forEach(a=>a()),f.cleanupFns.clear()),w.push(d),d(),w.pop()}))},i.set=function(l,c=s){t!==l&&c(t,l)&&i.forceSet(l)},i.update=function(l){i.set(l(t))},i.pipe=l=>{const c=R(null);return b(()=>{const d=l(i());d instanceof Promise?d.then(f=>c.set(f)):v(d)?b(()=>c.set(d())):c.set(d)}),c},i}function b(t){const e=Date.now();E("current effect",`%c${e}%c`);const n=t;t=()=>(E("current effect callback",`%c${e}%c`),n());const s=w[w.length-1];k.has(t)||k.set(t,{cleanupFns:new Set});const i=k.get(t);s?i.parent=s:delete i.parent,w.push(t),W.push(t),t(),W.pop(),w.pop()}const v=t=>!!t&&["object","function"].includes(typeof t)&&"set"in t&&"oldValue"in t&&"update"in t&&"forceSet"in t;function bt(t,...e){const n=R("");return b(()=>{const s=e.map(l=>v(l)?String(l()):String(l)),i=[t[0]];s.forEach((l,c)=>{i.push(l,t[c+1])}),n.set(i.join(""))}),n}function Et(t,e){const n=R(e??null),s=i=>n.set(i);return t instanceof Promise?t.then(s):typeof t=="function"&&b(()=>{const i=t();i instanceof Promise?i.then(s):v(i)?b(()=>s(i())):s(i)}),n}function yt(t,e){let n=t(),s=e();b(()=>{const i=t(),l=e();i!==l&&(i!==n?e.set(i):l!==s&&t.set(l)),n=i,s=l})}function pt(...t){let e=t.map(s=>s());const n=R(e);return t.forEach((s,i)=>{b(()=>{const l=()=>e.filter(c=>c!==void 0).length;l()===t.length&&(e=Array.from(e).fill(void 0)),e[i]=s(),l()===t.length&&n.set([...e])})}),n}class O extends HTMLElement{constructor(n=!1){super();p(this,"isSlotLazyLoading",!1);p(this,"slotTemplate");p(this,"slotContext");p(this,"rootStyle");p(this,"modelValue");p(this,"providers");p(this,"appendAllSlotContent");p(this,"allSlotContent",[]);p(this,"slotContent",{});p(this,"htmlSlotContent",{});p(this,"shadow");p(this,"injects",{});this.shadow=this.attachShadow({mode:n?"closed":"open"})}appendChild(n,s=!0){var i;if(this.isSlotLazyLoading&&s){if(n instanceof HTMLElement){const l=n.slot||"default";this.htmlSlotContent[l]||(this.htmlSlotContent[l]=[]),(i=this.htmlSlotContent[l])==null||i.push(n)}}else return super.appendChild(n)}appendSlotContent(){var n;(n=this.appendAllSlotContent)==null||n.call(this)}inject(n){return E("%cinject%c",n),this.injects[n]||(this.injects[n]=R(null)),this.injects[n]}checkInjects(){Object.entries(this.injects).forEach(([n,s])=>{E("%cinject%c",`%c${n}%c`,"from BaseElement (dispatch event)"),this.shadow.dispatchEvent(new CustomEvent(n,{detail:{context:n,callback:i=>b(()=>{s.set(i())})},bubbles:!0,composed:!0}))})}setReactiveValue(n){this.modelValue=n}}p(O,"observedAttributes",[]),p(O,"renderTagName",""),p(O,"styles");const St=t=>"render"in t&&"setReactiveValue"in t,vt="handleSlotContext",Y="onConnected",gt=()=>()=>{},_=(t,e)=>{const n=new Text(typeof e=="string"?e:JSON.stringify(e));return t.appendChild(n),t},q=(t,e)=>(t.innerHTML="",_(t,e)),z=t=>{const e=document.createElement("div");return e.style.display="contents",b(()=>{const n=t();q(e,n)}),e},G=t=>({append(...e){return e.forEach(n=>{t.appendChild(n.hostElement),Y in n.hostElement&&setTimeout(()=>{var s,i;(i=(s=n.hostElement).onConnected)==null||i.call(s,n,n.hostElement)})}),this},set(...e){this.clear();const n=document.createDocumentFragment();return e.forEach(s=>{n.appendChild(s.hostElement)}),t.appendChild(n),this},removeChild(...e){return e.forEach(n=>{Array.from(t.childNodes.values()).some(s=>s===n.hostElement)&&t.removeChild(n.hostElement)}),this},addHtmlContent(e){return _(t,e),this},setHtmlContent(e){return q(t,e),this},addEventlistener(e,n,s=!1){return t.addEventListener(e,i=>n(i,this,t),s),this},setAttribute(e,n){let s;if(typeof n=="boolean"&&!(t instanceof O))if(n)s="";else{this.removeAttribute(e);const i=e.toLowerCase();return i in t&&(t[i]=null),this}else typeof n!="string"?s=JSON.stringify(n):s=n;if(t.setAttribute(I(e),s),!(t instanceof O)){const i=e.toLowerCase();i in t&&(t[i]=n)}return this},setCustomAttribute(e,n){let s;return typeof n!="string"?s=JSON.stringify(n):s=n,t.setAttribute(I(e),s),this},setReactiveAttribute(e,n){return b(()=>this.setAttribute(e,n())),this},setReactiveCustomAttribute(e,n){return b(()=>this.setCustomAttribute(e,n())),this},removeAttribute(e){return t.removeAttribute(I(e)),this},addStyle(e){return Object.entries(e).forEach(([n,s])=>{const i=n.startsWith("--");typeof s=="function"?this.addEffect(()=>{if(i){const l=String(s()||"");t.style.setProperty(n,l)}else t.style[n]=s()}):typeof s=="string"&&(i?t.style.setProperty(n,s):t.style[n]=s)}),this},onConnected(e){return Reflect.defineProperty(t,Y,{get(){return e}}),this},addClass(...e){return e.forEach(n=>{typeof n=="string"?t.classList.add(...n.split(" ").flatMap(s=>s.split(`
2
+ `)).map(s=>s.trim()).filter(Boolean)):(()=>{let s=null;this.addEffect(()=>{const i=n();i.length>0&&(s?this.replaceClass(s,i):this.addClass(i),s=i)})})()}),this},setClass(...e){return t.classList.remove(...t.classList),t.classList.add(...e),this},addReactiveClass(e){return Object.keys(e).forEach(n=>{b(()=>{e[n]()?this.addClass(n):this.removeClass(n)})}),this},removeClass(...e){return t.classList.remove(...e),this},replaceClass(e,n){return t.classList.replace(e,n),this},addEffect(e){return b(()=>e(this,this.hostElement)),this},addReactiveContent(e){return t.appendChild(z(e)),this},setReactiveContent(e){return this.clear(),t.appendChild(z(e)),this},clear(){return t.innerHTML="",this},hostElement:t}),K=(t,...e)=>({classList:[...t.map(n=>n.trim()).filter(Boolean),...e]}),At=(t,...e)=>K(t,...e),D=(t,e)=>{if(!e)return t;const n=Object.keys(e||{}).filter(s=>s.startsWith(".")||s.startsWith("@")||s.startsWith("$"));return n.filter(s=>s.startsWith(".")).forEach(s=>{e!=null&&e.attributes||(e.attributes={}),e.attributes[s.slice(1)]=e[s]}),n.filter(s=>s.startsWith("@")).forEach(s=>{e!=null&&e.listeners||(e.listeners={});const i=s.slice(1);e.listeners[i]=e[s]}),n.filter(s=>s.startsWith("$")).forEach(s=>{e!=null&&e.effects||(e.effects=[]),e.effects.push(e[s])}),nt(t,e.classList),ot(t,e.style),it(t,e.attributes),st(t,e.reactiveClassList),et(t,e.customAttributes),tt(t,e.children),x(t,e.effects),N(t,e.listeners),N(t,e.customListeners),t},N=(t,e)=>{e&&Object.entries(e).forEach(([n,s])=>{typeof s=="function"&&t.addEventlistener(n,s)})},x=(t,e)=>e==null?void 0:e.forEach(n=>t.addEffect(n)),tt=(t,e)=>$(t,...e||[]),et=(t,e)=>{const n=e;n&&Object.keys(n).forEach(s=>{v(n[s])?t.setReactiveCustomAttribute(s,n[s]):typeof n[s]=="function"?t.addEffect(()=>{t.setCustomAttribute(s,n[s]())}):t.setCustomAttribute(s,n[s])})},nt=(t,e)=>t.addClass(...e||[]),st=(t,e)=>t.addReactiveClass(e||{}),ot=(t,e)=>t.addStyle(e||{}),it=(t,e)=>{const n=e,s=(i,l)=>{l&&(v(l)?t.setReactiveAttribute(i,l):typeof l=="function"?t.addEffect(()=>{t.setAttribute(i,l())}):t.setAttribute(i,l))};n&&Object.keys(n).forEach(i=>{s(i,n[i])})},$=(t,...e)=>(e.forEach(n=>{typeof n=="string"?n.trim().length>0&&t.addHtmlContent(n):v(n)?t.addReactiveContent(n):t.append(n)}),t),j=(t,e)=>{const n=document.createElement(t),s={...G(n)};return D(s,e)},lt=(t,e)=>{const[n,...s]=t.split(" ").map(l=>l.trim()),i=j(n,e);return s.length>0&&i.addClass(...s),(...l)=>$(i,...l.filter(Boolean).map(c=>typeof c=="function"&&!v(c)?g(()=>c(i)):c))},V=(t,e)=>{const n=lt(t,e);return Object.assign(n,n())},g=t=>j("div").addStyle({display:"contents"}).addEffect(e=>{const n=t(),s=[];Array.isArray(n)?s.push(...n):s.push(n),e.clear(),$(e,...s)}),Lt=(t,e,n)=>{const s=j("div").addStyle({display:"contents"}),i=new Map,l=new Map;let c=[];const d=new Set;let f=t.peek();const a=h=>{d.delete(h),i.delete(h),l.delete(h)};return b(()=>{const h=t();c=h.map(e).map(u=>typeof u=="string"?u:u.toString());const C=Array.from(s.hostElement.children);E("containerChildren",C,c),C.forEach(u=>{const y=u.dataset.key;c.includes(y)||(E("remove element",y,u),u.remove(),a(y))}),c.forEach(u=>{var P,T;const y=h[c.indexOf(u)];i.has(u)?JSON.stringify(y)!==JSON.stringify(f[c.indexOf(u)])&&((P=s.hostElement.querySelector(`[data-key="${u}"]`))==null||P.remove(),(T=i.get(u))==null||T.set(Math.random().toString(36).substring(2,15)),l.set(u,()=>n(y,c.indexOf(u),h).setCustomAttribute("data-key",u))):(E("create new element",u,y),i.set(u,R(Math.random().toString(36).substring(2,15))),l.set(u,()=>n(y,c.indexOf(u),h).setCustomAttribute("data-key",u)))}),f=h;const m=()=>{i.forEach((u,y)=>{E("key from setTimeout foreach currItemSignalMap",y),d.has(y)||(d.add(y),b(()=>{var mt;u();const P=c.indexOf(y),T=(mt=l.get(y))==null?void 0:mt();T&&(E("call effect from setTimeout",y,T.hostElement),P<=s.hostElement.children.length-1?s.hostElement.insertBefore(T.hostElement,s.hostElement.children[P]):s.hostElement.append(T.hostElement))}))})};Promise.resolve().then(()=>m())}),s},Rt=(t,e,n)=>{const s=j("div").addStyle({display:"contents"}),i=new Map;return b(()=>{let l=Array.from(s.hostElement.children).map(a=>a.dataset.key);const c=t(),d=c.map(e).map(a=>a.toString()),f=new Map;c.forEach((a,h)=>f.set(d[h],a)),l.filter(a=>!d.includes(a)).forEach(a=>{var h;return(h=s.hostElement.querySelector(`[data-key="${a}"]`))==null?void 0:h.remove()}),l=l.filter(a=>d.includes(a)),d.forEach((a,h)=>{if(l.includes(a)){if(JSON.stringify(i.get(a))!==JSON.stringify(f.get(a))){const C=n(c[h],h,c).setCustomAttribute("data-key",a).hostElement;s.hostElement.querySelector(`[data-key="${a}"]`).replaceWith(C);const m=s.hostElement.children;h>m.length-2?s.hostElement.append(C):s.hostElement.insertBefore(C,m[h+1])}}else{const C=n(c[h],h,c).setCustomAttribute("data-key",a),m=s.hostElement.children;h>m.length-1?s.hostElement.append(C.hostElement):s.hostElement.insertBefore(C.hostElement,m[h])}}),c.forEach((a,h)=>i.set(d[h],a))}),s},Ot=t=>{let e=[j("div")],n=!1;return b(()=>{var l;const s=t(),i=[];Array.isArray(s)?(i.push(...s),n=!0):i.push(s),i.length===0&&i.push(j("div").addStyle({display:"none"}));try{(l=e[0].hostElement)==null||l.replaceWith(...i.map(c=>c.hostElement)),e.forEach(c=>{var d;return(d=c.hostElement)==null?void 0:d.remove()}),e=i}catch(c){console.error(c)}}),n?e:e[0]},jt=t=>vt in t,Tt=t=>{const e=V("div").addStyle({display:"contents"}),n=s=>(e.hostElement.innerHTML=s,e);return typeof t=="string"?n(t):e.addEffect(()=>{n(t())}),e},U=(t,e,n)=>g(t?e:n||(()=>"")),ct=(t,e,n)=>g(()=>U(!!t(),e,n)),kt=(t,e,n)=>typeof t=="boolean"?U(t,e,n):ct(t,e,n),X=(t,e)=>{const n=g(e);return typeof t=="boolean"?n.hostElement.style.display=t?"contents":"none":n.addEffect((s,i)=>{i.style.display=t()?"contents":"none"}),n},wt=(t,e,n)=>{const s=[];return s.push(X(t,e)),n&&s.push(X(()=>typeof t=="boolean"?!t:!t(),n)),g(()=>s)},rt=(t,e)=>{E("createCustomElement",t);const n=document.createElement(t),s={...G(n),setReactiveValue(i){return n instanceof O&&n.setReactiveValue(i),this},setSlotTemplate(i){const l=n.slotTemplate;return l&&Object.entries(i).forEach(([c,d])=>{l[c]=d}),this}};return D(s,e)},at=(t,e)=>{const n=t.split(" ").slice(1).map(i=>i.trim()),s=rt(t.split(" ")[0],e);return Array.isArray(n)&&n.length>0&&s.addClass(...n),(...i)=>{L("@rcreateCustomEl content",t,i);const l=i.filter(Boolean).map(c=>typeof c=="function"&&!v(c)?g(()=>c(s)):c);return s.hostElement.allSlotContent=l,s.hostElement.slotContent=l.filter(A).reduce((c,d)=>{const f=d.hostElement.getAttribute("slot")||"default";return c[f]||(c[f]=[]),c[f].push(d),c},{}),s.hostElement.appendAllSlotContent=()=>$(s,...l),s}},dt=(t,e,n)=>at(`${t.renderTagName}${e&&typeof e=="string"?" "+e:""}`,S(e)?e:e&&typeof e=="string"?n:void 0),ht=(t,e,n)=>{const s=dt(t,e,n);return Object.assign(s,s())},It=()=>{const t=()=>{};return t.oldValue=null,t},$t=()=>({}),Mt=(t,e,n)=>{const s=e?ft(e,n)(t):t;return(i,...l)=>{const c=[...l];return i&&!S(i)&&c.unshift(i),ht(s,S(i)?i:{})(...c)}},r={};["div","span","section","input","button","table","tr","td","th","ul","li","ol","form","label","select","option","textarea","img","a","p","h1","h2","h3","h4","h5","h6","br","hr","pre","code","nav","header","footer","main","aside","article","figure","figcaption","blockquote","cite","small","strong","em","b","i","u","s","sub","sup","mark","del","ins","details","summary","progress","meter","audio","video","canvas","slot"].forEach(t=>{r[t]=(e,...n)=>{let s=[...n];return e&&!S(e)&&(s=[e].concat(s)),V(t,S(e)?e:{})(...s)}});const ut=r.div,Pt=r.span,Ft=r.section,Ht=r.input,Wt=r.button,Bt=r.table,Jt=r.tr,_t=r.td,qt=r.th,zt=r.ul,Gt=r.li,Dt=r.ol,Nt=r.form,Vt=r.label,Ut=r.select,Xt=r.option,Zt=r.textarea,Qt=r.img,Yt=r.a,Kt=r.p,xt=r.h1,te=r.h2,ee=r.h3,ne=r.h4,se=r.h5,oe=r.h6,ie=r.br,le=r.hr,ce=r.pre,re=r.code,ae=r.nav,de=r.header,he=r.footer,ue=r.main,fe=r.aside,me=r.article,Ce=r.figure,be=r.figcaption,Ee=r.blockquote,ye=r.cite,pe=r.small,Se=r.strong,ve=r.em,ge=r.b,Ae=r.i,Le=r.u,Re=r.s,Oe=r.sub,je=r.sup,Te=r.mark,ke=r.del,we=r.ins,Ie=r.details,$e=r.summary,Me=r.progress,Pe=r.meter,Fe=r.audio,He=r.video,We=r.canvas,Be=r.slot,Je=t=>e=>t(e).addClass(...e.classList??[]).addReactiveClass(e.reactiveClassList??{}),B="eventProps",J="EVENT_CONFIG",M="observedAttributes",_e=()=>(t,e)=>{Reflect.get(t,M)||Reflect.defineProperty(t,M,{value:[]}),Reflect.get(t,M).push(I(e))},qe=t=>(e,n)=>{Reflect.get(e,B)||Reflect.defineProperty(e,B,{value:[]}),Reflect.get(e,J)||Reflect.defineProperty(e,J,{value:{}}),Reflect.get(e,J)[n]={bubbles:(t==null?void 0:t.bubbles)??!1,composed:(t==null?void 0:t.composed)??!1},Reflect.get(e,B).push(n)},ft=(t,e=!1)=>n=>{E(t,"start register static attr",n.prototype[M]);const s=[];if(n.styles){const l=n.styles,c=[];Array.isArray(l)?c.push(...l):c.push(l),c.forEach(d=>{const f=new CSSStyleSheet;f.replaceSync(d),s.push(f);const a=new CSSStyleSheet;a.replaceSync(d.slice(d.indexOf("@property"))),document.adoptedStyleSheets.push(a)})}class i extends n{constructor(...d){E("constructor",`%c${t}%c`);super(e,...d);p(this,"isFirstRender",!0);L("@osheet",s),s.length>0&&this.shadow.adoptedStyleSheets.push(...s)}render(){let d=ut();const f=()=>{d=n.prototype.render.call(this)};return f.fake=!0,b(f),d}attributeChangedCallback(d,f,a){E("%cAttribute has changed.%c",`%c${d}%c`,`oldValue: ${f}, newValue: ${a}`,`%c${t}%c`);try{a=JSON.parse(a)}catch{}const h=Z(d);if(h in this&&v(this[h])){const C=this[h];a===null?(C.set(C.initValue),this.removeAttribute(d)):C.set(a)}F(this,n.prototype.attributeChangedCallback,d,f,a)}connectedCallback(){var f;E("connectedCallback",`%c${t}%c`,this),this.providers&&Object.keys(this.providers).length>0&&(E("WRAPPER for providers",t),Object.entries(this.providers).forEach(([a,h])=>{E("register provider",a,h()),this.addEventListener(a,C=>{var u;E("send provider",a,h());const m=C;((u=m.detail)==null?void 0:u.context)===a&&(m.stopPropagation(),m.detail.callback(h))})})),this.checkInjects(),(f=n.prototype[B])==null||f.forEach(a=>{this[a]=h=>{const C=n.prototype[J][a],{bubbles:m,composed:u}=C;v(h)?b(()=>{L("@oemit reactive value",h()),this.dispatchEvent(new CustomEvent(a,{detail:h(),bubbles:m,composed:u}))}):(L("@oemit value",h),this.dispatchEvent(new CustomEvent(a,{detail:h,bubbles:m,composed:u})))}}),E("start render",`%c${t}%c`,t);const d=()=>{if(setTimeout(()=>{F(this,n.prototype.connectedCallback)}),!this.isFirstRender)return;const a=this.render();this.shadow.appendChild(a.hostElement),this.appendSlotContent(),this.isFirstRender=!1};if(this.rootStyle&&!n.styles){const a=m=>m instanceof Promise||Array.isArray(m)&&m.every(u=>u instanceof Promise),h=this.rootStyle,C=m=>{const u=new CSSStyleSheet;u.replaceSync(m),this.shadow.adoptedStyleSheets.push(u);const y=new CSSStyleSheet;y.replaceSync(m.slice(m.indexOf("@property"))),document.adoptedStyleSheets.push(y)};if(a(h)){const m=[];Array.isArray(h)?m.push(...h):m.push(h),Promise.all(m).then(u=>u.forEach(y=>C(y.default))).then(()=>d())}else{const m=[];Array.isArray(h)?m.push(...h):m.push(h),m.forEach(u=>C(u)),d()}}else d();this.slotContext&&Object.keys(this.slotContext).length>0&&this.shadow.querySelectorAll("slot").forEach(a=>{E(this.slotContext,this.slotContext&&this.slotContext[a.name]),L("@bslot element",a,`name:${a.name};`,a.assignedElements()),a.assignedElements().forEach(h=>{const C=this.slotContext[a.name];this.slotContext&&v(C)&&(L("@oslot element",a,`name:${a.name};`,a.assignedElements()),b(()=>{h.dispatchEvent(new CustomEvent("handleSlotContext",{detail:C()}))}))})})}disconnectedCallback(){F(this,n.prototype.disconnectedCallback)}}return p(i,"observedAttributes",n.prototype[M]??[]),p(i,"renderTagName",t),i.toString=()=>t,customElements.get(t)?console.error(`название тега ${t} повторяется, компонент ${n.name} не зарегистрирован`):customElements.define(t,i),i};o.BaseElement=O,o.a=Yt,o.addAttributeList=it,o.addClassList=nt,o.addCustomAttributes=et,o.addHtmlContent=_,o.addReactiveClassList=st,o.addStyleList=ot,o.appendContentItem=$,o.article=me,o.aside=fe,o.audio=Fe,o.b=ge,o.bindReactiveSignals=yt,o.blockquote=Ee,o.br=ie,o.button=Wt,o.camelToKebab=I,o.canvas=We,o.checkCall=F,o.cite=ye,o.classList=K,o.cls=At,o.code=re,o.colorLog=L,o.component=ft,o.createComponent=Je,o.createCustom=dt,o.createCustomEl=at,o.createCustomElement=rt,o.createEl=lt,o.createElement=j,o.createSignal=Et,o.customEl=ht,o.defineSlotTemplate=$t,o.del=ke,o.details=Ie,o.disableLogs=Q,o.div=ut,o.effect=b,o.el=V,o.elementHelpers=G,o.em=ve,o.enableLogs=Ct,o.event=qe,o.eventEmitter=gt,o.figcaption=be,o.figure=Ce,o.footer=he,o.forkJoin=pt,o.form=Nt,o.getList=Lt,o.getSignalContent=g,o.h1=xt,o.h2=te,o.h3=ee,o.h4=ne,o.h5=se,o.h6=oe,o.header=de,o.hr=le,o.htmlEffectWrapper=z,o.i=Ae,o.img=Qt,o.initComponent=D,o.input=Ht,o.ins=we,o.isBaseElement=St,o.isComponentConfig=A,o.isComponentInitConfig=S,o.isReactiveSignal=v,o.isSlotTemplate=jt,o.kebabToCamel=Z,o.label=Vt,o.li=Gt,o.main=ue,o.mark=Te,o.meter=Pe,o.nav=ae,o.newEventEmitter=It,o.ol=Dt,o.oldGetList=Rt,o.option=Xt,o.p=Kt,o.pre=ce,o.progress=Me,o.projectLog=E,o.property=_e,o.renderIf=U,o.rs=bt,o.rxRenderIf=ct,o.s=Re,o.section=Ft,o.select=Ut,o.setChildren=tt,o.setEffects=x,o.setHtmlContent=q,o.setListeners=N,o.show=wt,o.showIf=X,o.signal=R,o.signalComponent=Ot,o.slot=Be,o.small=pe,o.span=Pt,o.strong=Se,o.sub=Oe,o.summary=$e,o.sup=je,o.table=Bt,o.td=_t,o.textarea=Zt,o.th=qt,o.tr=Jt,o.u=Le,o.ul=zt,o.unsafeHtml=Tt,o.useCustomComponent=Mt,o.video=He,o.when=kt,Object.defineProperty(o,Symbol.toStringTag,{value:"Module"})});
@@ -1,2 +0,0 @@
1
- (function(o,y){typeof exports=="object"&&typeof module<"u"?y(exports):typeof define=="function"&&define.amd?define(["exports"],y):(o=typeof globalThis<"u"?globalThis:o||self,y(o.ReactiveComponent={}))})(this,function(o){"use strict";var ze=Object.defineProperty;var Ge=(o,y,A)=>y in o?ze(o,y,{enumerable:!0,configurable:!0,writable:!0,value:A}):o[y]=A;var p=(o,y,A)=>Ge(o,typeof y!="symbol"?y+"":y,A);const y=t=>t&&typeof t=="object"&&("classList"in t||"attributes"in t||"customAttributes"in t||"reactiveClassList"in t||"listeners"in t||"customListeners"in t||"children"in t||"effects"in t||"style"in t||Object.keys(t).some(e=>e.startsWith(".")||e.startsWith("@")||e.startsWith("$")))&&!("hostElement"in t),A=t=>t&&typeof t=="object"&&"hostElement"in t&&"append"in t&&"set"in t&&"addStyle"in t&&"setAttribute"in t&&"addClass"in t&&"addEffect"in t&&"addReactiveContent"in t&&"setReactiveContent"in t&&"clear"in t,H=(t,e,...n)=>{e&&e.apply(t,n)};let W=!0;const E=(...t)=>{W&&console.log(t.join(" | "),...Array.from(t.join("").matchAll(/%c/gm)).map((e,n)=>n%2===0?"color:red":"color:inherit"))},I=t=>t.replace(/([A-Z])/gm,e=>`-${e.toLowerCase()}`),Z=t=>t.replace(/-(\w)/gm,(e,n)=>n.toUpperCase()),L=(t,...e)=>{if(!W)return;const n={r:"color: #ff0000",g:"color: #00ff00",b:"color: #0000ff",y:"color: #ffff00",p:"color: #800080",c:"color: #00ffff",o:"color: #ffa500",w:"color: #808080"},s=t.match(/@[rgbpycow]/g)||[],i=s.map(l=>{const h=l.slice(1);return n[h]||"color: inherit"});let c=t;s.forEach(l=>{const h=new RegExp(`\\${l}([^\\s,]+)`,"g");c=c.replace(h,"%c$1")}),console.log(c,...i,...e)},Ct=()=>{W=!0},Q=()=>{W=!1};Q();const w=new WeakMap,F=[],k=[];function O(t,e=()=>!0){const n=new Set;let s=e;function i(){const c=F[F.length-1];if(c&&!("fake"in c&&c.fake)){const l=w.get(c),h=l==null?void 0:l.parent;if(h){const a=w.get(h);a==null||a.cleanupFns.add(()=>{n.delete(c)})}n.add(c)}return t}return i.getSubscribers=()=>[...n],i.setCompareFn=function(c){return s=c,i},i.clearSubscribers=function(){n.clear()},i.peek=function(){return Object.freeze(t)},i.initValue=Object.freeze(t),i.oldValue=Object.freeze(t),i.forceSet=function(c){i.oldValue=Object.freeze(t),t=c,n.forEach(l=>Promise.resolve(l).then(h=>{const a=w.get(h);a&&a.cleanupFns.size>0&&(a.cleanupFns.forEach(d=>d()),a.cleanupFns.clear()),k.push(h),h(),k.pop()}))},i.set=function(c,l=s){t!==c&&l(t,c)&&i.forceSet(c)},i.update=function(c){i.set(c(t))},i.pipe=c=>{const l=O(null);return b(()=>{const h=c(i());h instanceof Promise?h.then(a=>l.set(a)):v(h)?b(()=>l.set(h())):l.set(h)}),l},i}function b(t){const e=Date.now();E("current effect",`%c${e}%c`);const n=t;t=()=>(E("current effect callback",`%c${e}%c`),n());const s=k[k.length-1];w.has(t)||w.set(t,{cleanupFns:new Set});const i=w.get(t);s?i.parent=s:delete i.parent,k.push(t),F.push(t),t(),F.pop(),k.pop()}const v=t=>!!t&&["object","function"].includes(typeof t)&&"set"in t&&"oldValue"in t&&"update"in t&&"forceSet"in t;function bt(t,...e){const n=O("");return b(()=>{const s=e.map(c=>v(c)?String(c()):String(c)),i=[t[0]];s.forEach((c,l)=>{i.push(c,t[l+1])}),n.set(i.join(""))}),n}function Et(t,e){const n=O(e??null),s=i=>n.set(i);return t instanceof Promise?t.then(s):typeof t=="function"&&b(()=>{const i=t();i instanceof Promise?i.then(s):v(i)?b(()=>s(i())):s(i)}),n}function yt(t,e){let n=t(),s=e();b(()=>{const i=t(),c=e();i!==c&&(i!==n?e.set(i):c!==s&&t.set(c)),n=i,s=c})}function pt(...t){let e=t.map(s=>s());const n=O(e);return t.forEach((s,i)=>{b(()=>{const c=()=>e.filter(l=>l!==void 0).length;c()===t.length&&(e=Array.from(e).fill(void 0)),e[i]=s(),c()===t.length&&n.set([...e])})}),n}class R extends HTMLElement{constructor(n=!1){super();p(this,"isSlotLazyLoading",!1);p(this,"slotTemplate");p(this,"slotContext");p(this,"rootStyle");p(this,"modelValue");p(this,"providers");p(this,"appendAllSlotContent");p(this,"allSlotContent",[]);p(this,"slotContent",{});p(this,"htmlSlotContent",{});p(this,"shadow");p(this,"injects",{});this.shadow=this.attachShadow({mode:n?"closed":"open"})}appendChild(n,s=!0){var i;if(this.isSlotLazyLoading&&s){if(n instanceof HTMLElement){const c=n.slot||"default";this.htmlSlotContent[c]||(this.htmlSlotContent[c]=[]),(i=this.htmlSlotContent[c])==null||i.push(n)}}else return super.appendChild(n)}appendSlotContent(){var n;(n=this.appendAllSlotContent)==null||n.call(this)}inject(n){return E("%cinject%c",n),this.injects[n]||(this.injects[n]=O(null)),this.injects[n]}checkInjects(){Object.entries(this.injects).forEach(([n,s])=>{E("%cinject%c",`%c${n}%c`,"from BaseElement (dispatch event)"),this.shadow.dispatchEvent(new CustomEvent(n,{detail:{context:n,callback:i=>b(()=>{s.set(i())})},bubbles:!0,composed:!0}))})}setReactiveValue(n){this.modelValue=n}}p(R,"observedAttributes",[]),p(R,"renderTagName",""),p(R,"styles");const St=t=>"render"in t&&"setReactiveValue"in t,vt="handleSlotContext",Y="onConnected",gt=()=>()=>{},_=(t,e)=>{const n=new Text(typeof e=="string"?e:JSON.stringify(e));return t.appendChild(n),t},q=(t,e)=>(t.innerHTML="",_(t,e)),z=t=>{const e=document.createElement("div");return e.style.display="contents",b(()=>{const n=t();q(e,n)}),e},G=t=>({append(...e){return e.forEach(n=>{t.appendChild(n.hostElement),Y in n.hostElement&&setTimeout(()=>{var s,i;(i=(s=n.hostElement).onConnected)==null||i.call(s,n,n.hostElement)})}),this},set(...e){this.clear();const n=document.createDocumentFragment();return e.forEach(s=>{n.appendChild(s.hostElement)}),t.appendChild(n),this},removeChild(...e){return e.forEach(n=>{Array.from(t.childNodes.values()).some(s=>s===n.hostElement)&&t.removeChild(n.hostElement)}),this},addHtmlContent(e){return _(t,e),this},setHtmlContent(e){return q(t,e),this},addEventlistener(e,n,s=!1){return t.addEventListener(e,i=>n(i,this,t),s),this},setAttribute(e,n){let s;if(typeof n=="boolean"&&!(t instanceof R))if(n)s="";else{this.removeAttribute(e);const i=e.toLowerCase();return i in t&&(t[i]=null),this}else typeof n!="string"?s=JSON.stringify(n):s=n;if(t.setAttribute(I(e),s),!(t instanceof R)){const i=e.toLowerCase();i in t&&(t[i]=n)}return this},setCustomAttribute(e,n){let s;return typeof n!="string"?s=JSON.stringify(n):s=n,t.setAttribute(I(e),s),this},setReactiveAttribute(e,n){return b(()=>this.setAttribute(e,n())),this},setReactiveCustomAttribute(e,n){return b(()=>this.setCustomAttribute(e,n())),this},removeAttribute(e){return t.removeAttribute(I(e)),this},addStyle(e){return Object.entries(e).forEach(([n,s])=>{const i=n.startsWith("--");typeof s=="function"?this.addEffect(()=>{if(i){const c=String(s()||"");t.style.setProperty(n,c)}else t.style[n]=s()}):typeof s=="string"&&(i?t.style.setProperty(n,s):t.style[n]=s)}),this},onConnected(e){return Reflect.defineProperty(t,Y,{get(){return e}}),this},addClass(...e){return e.forEach(n=>{typeof n=="string"?t.classList.add(...n.split(" ").flatMap(s=>s.split(`
2
- `)).map(s=>s.trim()).filter(Boolean)):(()=>{let s=null;this.addEffect(()=>{const i=n();i.length>0&&(s?this.replaceClass(s,i):this.addClass(i),s=i)})})()}),this},setClass(...e){return t.classList.remove(...t.classList),t.classList.add(...e),this},addReactiveClass(e){return Object.keys(e).forEach(n=>{b(()=>{e[n]()?this.addClass(n):this.removeClass(n)})}),this},removeClass(...e){return t.classList.remove(...e),this},replaceClass(e,n){return t.classList.replace(e,n),this},addEffect(e){return b(()=>e(this,this.hostElement)),this},addReactiveContent(e){return t.appendChild(z(e)),this},setReactiveContent(e){return this.clear(),t.appendChild(z(e)),this},clear(){return t.innerHTML="",this},hostElement:t}),K=(t,...e)=>({classList:[...t.map(n=>n.trim()).filter(Boolean),...e]}),At=(t,...e)=>K(t,...e),D=(t,e)=>{if(!e)return t;const n=Object.keys(e||{}).filter(s=>s.startsWith(".")||s.startsWith("@")||s.startsWith("$"));return n.filter(s=>s.startsWith(".")).forEach(s=>{e!=null&&e.attributes||(e.attributes={}),e.attributes[s.slice(1)]=e[s]}),n.filter(s=>s.startsWith("@")).forEach(s=>{e!=null&&e.listeners||(e.listeners={});const i=s.slice(1);e.listeners[i]=e[s]}),n.filter(s=>s.startsWith("$")).forEach(s=>{e!=null&&e.effects||(e.effects=[]),e.effects.push(e[s])}),nt(t,e.classList),ot(t,e.style),it(t,e.attributes),st(t,e.reactiveClassList),et(t,e.customAttributes),tt(t,e.children),x(t,e.effects),N(t,e.listeners),N(t,e.customListeners),t},N=(t,e)=>{e&&Object.entries(e).forEach(([n,s])=>{typeof s=="function"&&t.addEventlistener(n,s)})},x=(t,e)=>e==null?void 0:e.forEach(n=>t.addEffect(n)),tt=(t,e)=>$(t,...e||[]),et=(t,e)=>{const n=e;n&&Object.keys(n).forEach(s=>{v(n[s])?t.setReactiveCustomAttribute(s,n[s]):typeof n[s]=="function"?t.addEffect(()=>{t.setCustomAttribute(s,n[s]())}):t.setCustomAttribute(s,n[s])})},nt=(t,e)=>t.addClass(...e||[]),st=(t,e)=>t.addReactiveClass(e||{}),ot=(t,e)=>t.addStyle(e||{}),it=(t,e)=>{const n=e,s=(i,c)=>{c&&(v(c)?t.setReactiveAttribute(i,c):typeof c=="function"?t.addEffect(()=>{t.setAttribute(i,c())}):t.setAttribute(i,c))};n&&Object.keys(n).forEach(i=>{s(i,n[i])})},$=(t,...e)=>(e.forEach(n=>{typeof n=="string"?n.trim().length>0&&t.addHtmlContent(n):v(n)?t.addReactiveContent(n):t.append(n)}),t),j=(t,e)=>{const n=document.createElement(t),s={...G(n)};return D(s,e)},lt=(t,e)=>{const[n,...s]=t.split(" ").map(c=>c.trim()),i=j(n,e);return s.length>0&&i.addClass(...s),(...c)=>$(i,...c.filter(Boolean).map(l=>typeof l=="function"&&!v(l)?g(()=>l(i)):l))},V=(t,e)=>{const n=lt(t,e);return Object.assign(n,n())},g=t=>j("div").addStyle({display:"contents"}).addEffect(e=>{const n=t(),s=[];Array.isArray(n)?s.push(...n):s.push(n),e.clear(),$(e,...s)}),Lt=(t,e,n)=>{const s=j("div").addStyle({display:"contents"}),i=new Map,c=new Map;let l=[];const h=new Set;let a=t.peek();const d=u=>{h.delete(u),i.delete(u),c.delete(u)};return b(()=>{const u=t();l=u.map(e).map(m=>typeof m=="string"?m:m.toString());const f=Array.from(s.hostElement.children);E("containerChildren",f,l),f.forEach(m=>{const S=m.dataset.key;l.includes(S)||(E("remove element",S,m),m.remove(),d(S))}),l.forEach(m=>{var P,T;const S=u[l.indexOf(m)];i.has(m)?JSON.stringify(S)!==JSON.stringify(a[l.indexOf(m)])&&((P=s.hostElement.querySelector(`[data-key="${m}"]`))==null||P.remove(),(T=i.get(m))==null||T.set(Math.random().toString(36).substring(2,15)),c.set(m,()=>n(S,l.indexOf(m),u).setCustomAttribute("data-key",m))):(E("create new element",m,S),i.set(m,O(Math.random().toString(36).substring(2,15))),c.set(m,()=>n(S,l.indexOf(m),u).setCustomAttribute("data-key",m)))}),a=u;const C=()=>{i.forEach((m,S)=>{E("key from setTimeout foreach currItemSignalMap",S),h.has(S)||(h.add(S),b(()=>{var mt;m();const P=l.indexOf(S),T=(mt=c.get(S))==null?void 0:mt();T&&(E("call effect from setTimeout",S,T.hostElement),P<=s.hostElement.children.length-1?s.hostElement.insertBefore(T.hostElement,s.hostElement.children[P]):s.hostElement.append(T.hostElement))}))})};Promise.resolve().then(()=>C())}),s},Ot=(t,e,n)=>{const s=j("div").addStyle({display:"contents"}),i=new Map;return b(()=>{let c=Array.from(s.hostElement.children).map(d=>d.dataset.key);const l=t(),h=l.map(e).map(d=>d.toString()),a=new Map;l.forEach((d,u)=>a.set(h[u],d)),c.filter(d=>!h.includes(d)).forEach(d=>{var u;return(u=s.hostElement.querySelector(`[data-key="${d}"]`))==null?void 0:u.remove()}),c=c.filter(d=>h.includes(d)),h.forEach((d,u)=>{if(c.includes(d)){if(JSON.stringify(i.get(d))!==JSON.stringify(a.get(d))){const f=n(l[u],u,l).setCustomAttribute("data-key",d).hostElement;s.hostElement.querySelector(`[data-key="${d}"]`).replaceWith(f);const C=s.hostElement.children;u>C.length-2?s.hostElement.append(f):s.hostElement.insertBefore(f,C[u+1])}}else{const f=n(l[u],u,l).setCustomAttribute("data-key",d),C=s.hostElement.children;u>C.length-1?s.hostElement.append(f.hostElement):s.hostElement.insertBefore(f.hostElement,C[u])}}),l.forEach((d,u)=>i.set(h[u],d))}),s},Rt=t=>{let e=[j("div")],n=!1;return b(()=>{var c;const s=t(),i=[];Array.isArray(s)?(i.push(...s),n=!0):i.push(s),i.length===0&&i.push(j("div").addStyle({display:"none"}));try{(c=e[0].hostElement)==null||c.replaceWith(...i.map(l=>l.hostElement)),e.forEach(l=>{var h;return(h=l.hostElement)==null?void 0:h.remove()}),e=i}catch(l){console.error(l)}}),n?e:e[0]},jt=t=>vt in t,Tt=t=>{const e=V("div").addStyle({display:"contents"}),n=s=>(e.hostElement.innerHTML=s,e);return typeof t=="string"?n(t):e.addEffect(()=>{n(t())}),e},U=(t,e,n)=>g(t?e:n||(()=>"")),ct=(t,e,n)=>g(()=>U(!!t(),e,n)),wt=(t,e,n)=>typeof t=="boolean"?U(t,e,n):ct(t,e,n),X=(t,e)=>{const n=g(e);return typeof t=="boolean"?n.hostElement.style.display=t?"contents":"none":n.addEffect((s,i)=>{i.style.display=t()?"contents":"none"}),n},kt=(t,e,n)=>{const s=[];return s.push(X(t,e)),n&&s.push(X(()=>typeof t=="boolean"?!t:!t(),n)),g(()=>s)},rt=(t,e)=>{E("createCustomElement",t);const n=document.createElement(t),s={...G(n),setReactiveValue(i){return n instanceof R&&n.setReactiveValue(i),this},setSlotTemplate(i){const c=n.slotTemplate;return c&&Object.entries(i).forEach(([l,h])=>{c[l]=h}),this}};return D(s,e)},at=(t,e)=>{const n=t.split(" ").slice(1).map(i=>i.trim()),s=rt(t.split(" ")[0],e);return Array.isArray(n)&&n.length>0&&s.addClass(...n),(...i)=>{L("@rcreateCustomEl content",t,i);const c=i.filter(Boolean).map(l=>typeof l=="function"&&!v(l)?g(()=>l(s)):l);return s.hostElement.allSlotContent=c,s.hostElement.slotContent=c.filter(A).reduce((l,h)=>{const a=h.hostElement.getAttribute("slot")||"default";return l[a]||(l[a]=[]),l[a].push(h),l},{}),s.hostElement.appendAllSlotContent=()=>$(s,...c),s}},dt=(t,e,n)=>at(`${t.renderTagName}${e&&typeof e=="string"?" "+e:""}`,y(e)?e:e&&typeof e=="string"?n:void 0),ht=(t,e,n)=>{const s=dt(t,e,n);return Object.assign(s,s())},It=()=>{const t=()=>{};return t.oldValue=null,t},$t=()=>({}),Mt=(t,e,n)=>{const s=e?ft(e,n)(t):t;return(i,...c)=>{const l=[...c];return i&&!y(i)&&l.unshift(i),ht(s,y(i)?i:{})(...l)}},r={};["div","span","section","input","button","table","tr","td","th","ul","li","ol","form","label","select","option","textarea","img","a","p","h1","h2","h3","h4","h5","h6","br","hr","pre","code","nav","header","footer","main","aside","article","figure","figcaption","blockquote","cite","small","strong","em","b","i","u","s","sub","sup","mark","del","ins","details","summary","progress","meter","audio","video","canvas","slot"].forEach(t=>{r[t]=(e,...n)=>{let s=[...n];return e&&!y(e)&&(s=[e].concat(s)),V(t,y(e)?e:{})(...s)}});const ut=r.div,Pt=r.span,Ht=r.section,Wt=r.input,Ft=r.button,Bt=r.table,Jt=r.tr,_t=r.td,qt=r.th,zt=r.ul,Gt=r.li,Dt=r.ol,Nt=r.form,Vt=r.label,Ut=r.select,Xt=r.option,Zt=r.textarea,Qt=r.img,Yt=r.a,Kt=r.p,xt=r.h1,te=r.h2,ee=r.h3,ne=r.h4,se=r.h5,oe=r.h6,ie=r.br,le=r.hr,ce=r.pre,re=r.code,ae=r.nav,de=r.header,he=r.footer,ue=r.main,fe=r.aside,me=r.article,Ce=r.figure,be=r.figcaption,Ee=r.blockquote,ye=r.cite,pe=r.small,Se=r.strong,ve=r.em,ge=r.b,Ae=r.i,Le=r.u,Oe=r.s,Re=r.sub,je=r.sup,Te=r.mark,we=r.del,ke=r.ins,Ie=r.details,$e=r.summary,Me=r.progress,Pe=r.meter,He=r.audio,We=r.video,Fe=r.canvas,Be=r.slot,Je=t=>e=>t(e).addClass(...e.classList??[]).addReactiveClass(e.reactiveClassList??{}),B="eventProps",J="EVENT_CONFIG",M="observedAttributes",_e=()=>(t,e)=>{Reflect.get(t,M)||Reflect.defineProperty(t,M,{value:[]}),Reflect.get(t,M).push(I(e))},qe=t=>(e,n)=>{Reflect.get(e,B)||Reflect.defineProperty(e,B,{value:[]}),Reflect.get(e,J)||Reflect.defineProperty(e,J,{value:{}}),Reflect.get(e,J)[n]={bubbles:(t==null?void 0:t.bubbles)??!1,composed:(t==null?void 0:t.composed)??!1},Reflect.get(e,B).push(n)},ft=(t,e=!1)=>n=>{E(t,"start register static attr",n.prototype[M]);const s=[];if(n.styles){const c=n.styles,l=[];Array.isArray(c)?l.push(...c):l.push(c),l.forEach(h=>{const a=new CSSStyleSheet;a.replaceSync(h),s.push(a);const d=new CSSStyleSheet;d.replaceSync(h.slice(h.indexOf("@property"))),document.adoptedStyleSheets.push(d)})}class i extends n{constructor(...l){E("constructor",`%c${t}%c`),super(e,...l),L("@osheet",s),s.length>0&&this.shadow.adoptedStyleSheets.push(...s)}render(){let l=ut();const h=()=>{l=n.prototype.render.call(this)};return h.fake=!0,b(h),l}attributeChangedCallback(l,h,a){E("%cAttribute has changed.%c",`%c${l}%c`,`oldValue: ${h}, newValue: ${a}`,`%c${t}%c`);try{a=JSON.parse(a)}catch{}const d=Z(l);if(d in this&&v(this[d])){const u=this[d];a===null?(u.set(u.initValue),this.removeAttribute(l)):u.set(a)}H(this,n.prototype.attributeChangedCallback,l,h,a)}connectedCallback(){var h;E("connectedCallback",`%c${t}%c`,this),this.providers&&Object.keys(this.providers).length>0&&(E("WRAPPER for providers",t),Object.entries(this.providers).forEach(([a,d])=>{E("register provider",a,d()),this.addEventListener(a,u=>{var C;E("send provider",a,d());const f=u;((C=f.detail)==null?void 0:C.context)===a&&(f.stopPropagation(),f.detail.callback(d))})})),this.checkInjects(),(h=n.prototype[B])==null||h.forEach(a=>{this[a]=d=>{const u=n.prototype[J][a],{bubbles:f,composed:C}=u;v(d)?b(()=>{L("@oemit reactive value",d()),this.dispatchEvent(new CustomEvent(a,{detail:d(),bubbles:f,composed:C}))}):(L("@oemit value",d),this.dispatchEvent(new CustomEvent(a,{detail:d,bubbles:f,composed:C})))}}),E("start render",`%c${t}%c`,t);const l=()=>{const a=this.render();this.shadow.appendChild(a.hostElement),H(this,n.prototype.connectedCallback)};if(this.rootStyle&&!n.styles){const a=f=>f instanceof Promise||Array.isArray(f)&&f.every(C=>C instanceof Promise),d=this.rootStyle,u=f=>{const C=new CSSStyleSheet;C.replaceSync(f),this.shadow.adoptedStyleSheets.push(C);const m=new CSSStyleSheet;m.replaceSync(f.slice(f.indexOf("@property"))),document.adoptedStyleSheets.push(m)};if(a(d)){const f=[];Array.isArray(d)?f.push(...d):f.push(d),Promise.all(f).then(C=>C.forEach(m=>u(m.default))).then(()=>l())}else{const f=[];Array.isArray(d)?f.push(...d):f.push(d),f.forEach(C=>u(C)),l()}}else l();this.appendSlotContent(),this.slotContext&&Object.keys(this.slotContext).length>0&&this.shadow.querySelectorAll("slot").forEach(a=>{E(this.slotContext,this.slotContext&&this.slotContext[a.name]),L("@bslot element",a,`name:${a.name};`,a.assignedElements()),a.assignedElements().forEach(d=>{const u=this.slotContext[a.name];this.slotContext&&v(u)&&(L("@oslot element",a,`name:${a.name};`,a.assignedElements()),b(()=>{d.dispatchEvent(new CustomEvent("handleSlotContext",{detail:u()}))}))})})}disconnectedCallback(){this.shadow.replaceChildren(),this.replaceChildren(),H(this,n.prototype.disconnectedCallback)}}return p(i,"observedAttributes",n.prototype[M]??[]),p(i,"renderTagName",t),i.toString=()=>t,customElements.get(t)?console.error(`название тега ${t} повторяется, компонент ${n.name} не зарегистрирован`):customElements.define(t,i),i};o.BaseElement=R,o.a=Yt,o.addAttributeList=it,o.addClassList=nt,o.addCustomAttributes=et,o.addHtmlContent=_,o.addReactiveClassList=st,o.addStyleList=ot,o.appendContentItem=$,o.article=me,o.aside=fe,o.audio=He,o.b=ge,o.bindReactiveSignals=yt,o.blockquote=Ee,o.br=ie,o.button=Ft,o.camelToKebab=I,o.canvas=Fe,o.checkCall=H,o.cite=ye,o.classList=K,o.cls=At,o.code=re,o.colorLog=L,o.component=ft,o.createComponent=Je,o.createCustom=dt,o.createCustomEl=at,o.createCustomElement=rt,o.createEl=lt,o.createElement=j,o.createSignal=Et,o.customEl=ht,o.defineSlotTemplate=$t,o.del=we,o.details=Ie,o.disableLogs=Q,o.div=ut,o.effect=b,o.el=V,o.elementHelpers=G,o.em=ve,o.enableLogs=Ct,o.event=qe,o.eventEmitter=gt,o.figcaption=be,o.figure=Ce,o.footer=he,o.forkJoin=pt,o.form=Nt,o.getList=Lt,o.getSignalContent=g,o.h1=xt,o.h2=te,o.h3=ee,o.h4=ne,o.h5=se,o.h6=oe,o.header=de,o.hr=le,o.htmlEffectWrapper=z,o.i=Ae,o.img=Qt,o.initComponent=D,o.input=Wt,o.ins=ke,o.isBaseElement=St,o.isComponentConfig=A,o.isComponentInitConfig=y,o.isReactiveSignal=v,o.isSlotTemplate=jt,o.kebabToCamel=Z,o.label=Vt,o.li=Gt,o.main=ue,o.mark=Te,o.meter=Pe,o.nav=ae,o.newEventEmitter=It,o.ol=Dt,o.oldGetList=Ot,o.option=Xt,o.p=Kt,o.pre=ce,o.progress=Me,o.projectLog=E,o.property=_e,o.renderIf=U,o.rs=bt,o.rxRenderIf=ct,o.s=Oe,o.section=Ht,o.select=Ut,o.setChildren=tt,o.setEffects=x,o.setHtmlContent=q,o.setListeners=N,o.show=kt,o.showIf=X,o.signal=O,o.signalComponent=Rt,o.slot=Be,o.small=pe,o.span=Pt,o.strong=Se,o.sub=Re,o.summary=$e,o.sup=je,o.table=Bt,o.td=_t,o.textarea=Zt,o.th=qt,o.tr=Jt,o.u=Le,o.ul=zt,o.unsafeHtml=Tt,o.useCustomComponent=Mt,o.video=We,o.when=wt,Object.defineProperty(o,Symbol.toStringTag,{value:"Module"})});